summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9066
-rw-r--r--ChangeLog.20075283
-rw-r--r--README6
-rw-r--r--carbon/GNUmakefile314
-rw-r--r--carbon/README339
-rw-r--r--carbon/Tk-Info.plist.in36
-rw-r--r--carbon/Wish-Common.xcconfig (renamed from macosx/Wish-Common.xcconfig)4
-rw-r--r--carbon/Wish-Debug.xcconfig (renamed from macosx/Wish-Debug.xcconfig)0
-rw-r--r--carbon/Wish-Info.plist.in73
-rw-r--r--carbon/Wish-Release.xcconfig (renamed from macosx/Wish-Release.xcconfig)0
-rw-r--r--carbon/Wish.icns (renamed from macosx/Wish.icns)bin35960 -> 35960 bytes
-rw-r--r--carbon/Wish.xcode/default.pbxuser (renamed from macosx/Wish.xcode/default.pbxuser)0
-rw-r--r--carbon/Wish.xcode/project.pbxproj (renamed from macosx/Wish.xcode/project.pbxproj)172
-rw-r--r--carbon/Wish.xcodeproj/default.pbxuser (renamed from macosx/Wish.xcodeproj/default.pbxuser)0
-rw-r--r--carbon/Wish.xcodeproj/project.pbxproj (renamed from macosx/Wish.xcodeproj/project.pbxproj)184
-rw-r--r--carbon/configure.ac11
-rw-r--r--carbon/tkAboutDlg.r (renamed from macosx/tkAboutDlg.r)0
-rw-r--r--carbon/tkMacOSX.h36
-rw-r--r--carbon/tkMacOSXAETE.r (renamed from macosx/tkMacOSXAETE.r)0
-rw-r--r--carbon/tkMacOSXBitmap.c268
-rw-r--r--carbon/tkMacOSXButton.c1621
-rw-r--r--carbon/tkMacOSXCarbonEvents.c (renamed from macosx/tkMacOSXCarbonEvents.c)5
-rw-r--r--carbon/tkMacOSXClipboard.c371
-rw-r--r--carbon/tkMacOSXColor.c736
-rw-r--r--carbon/tkMacOSXConfig.c43
-rw-r--r--carbon/tkMacOSXCursor.c487
-rw-r--r--carbon/tkMacOSXCursors.r (renamed from macosx/tkMacOSXCursors.r)0
-rw-r--r--carbon/tkMacOSXDebug.c643
-rw-r--r--carbon/tkMacOSXDebug.h96
-rw-r--r--carbon/tkMacOSXDefault.h555
-rw-r--r--carbon/tkMacOSXDialog.c2316
-rw-r--r--carbon/tkMacOSXDraw.c2118
-rw-r--r--carbon/tkMacOSXEmbed.c1181
-rw-r--r--carbon/tkMacOSXEntry.c324
-rw-r--r--carbon/tkMacOSXEvent.c294
-rw-r--r--carbon/tkMacOSXEvent.h107
-rw-r--r--carbon/tkMacOSXFont.c2678
-rw-r--r--carbon/tkMacOSXFont.h38
-rw-r--r--carbon/tkMacOSXHLEvents.c691
-rw-r--r--carbon/tkMacOSXInit.c599
-rw-r--r--carbon/tkMacOSXInt.h186
-rw-r--r--carbon/tkMacOSXKeyEvent.c1168
-rw-r--r--carbon/tkMacOSXKeyboard.c840
-rw-r--r--carbon/tkMacOSXMenu.c4743
-rw-r--r--carbon/tkMacOSXMenubutton.c950
-rw-r--r--carbon/tkMacOSXMenus.c406
-rw-r--r--carbon/tkMacOSXMouseEvent.c1190
-rw-r--r--carbon/tkMacOSXNotify.c196
-rw-r--r--carbon/tkMacOSXPort.h187
-rw-r--r--carbon/tkMacOSXPrivate.h352
-rw-r--r--carbon/tkMacOSXRegion.c644
-rw-r--r--carbon/tkMacOSXScale.c482
-rw-r--r--carbon/tkMacOSXScrlbr.c1017
-rw-r--r--carbon/tkMacOSXSend.c506
-rw-r--r--carbon/tkMacOSXSubwindows.c1469
-rw-r--r--carbon/tkMacOSXTest.c80
-rw-r--r--carbon/tkMacOSXWindowEvent.c985
-rw-r--r--carbon/tkMacOSXWm.c6495
-rw-r--r--carbon/tkMacOSXWm.h304
-rw-r--r--carbon/tkMacOSXXCursors.r (renamed from macosx/tkMacOSXXCursors.r)0
-rw-r--r--carbon/tkMacOSXXStubs.c1283
-rw-r--r--carbon/ttkMacOSXTheme.c1132
-rw-r--r--changes245
-rw-r--r--compat/stdlib.h53
-rw-r--r--compat/unistd.h110
-rw-r--r--doc/3DBorder.35
-rw-r--r--doc/AddOption.32
-rw-r--r--doc/BindTable.316
-rw-r--r--doc/CanvPsY.331
-rw-r--r--doc/CanvTkwin.313
-rw-r--r--doc/CanvTxtInfo.34
-rw-r--r--doc/Clipboard.313
-rw-r--r--doc/ClrSelect.34
-rw-r--r--doc/ConfigWidg.374
-rw-r--r--doc/CoordToWin.32
-rw-r--r--doc/CrtCmHdlr.39
-rw-r--r--doc/CrtErrHdlr.37
-rw-r--r--doc/CrtGenHdlr.37
-rw-r--r--doc/CrtImgType.392
-rw-r--r--doc/CrtItemType.3417
-rw-r--r--doc/CrtPhImgFmt.3118
-rw-r--r--doc/CrtSelHdlr.311
-rw-r--r--doc/CrtWindow.35
-rw-r--r--doc/DeleteImg.32
-rw-r--r--doc/DrawFocHlt.32
-rw-r--r--doc/EventHndlr.38
-rw-r--r--doc/FindPhoto.322
-rw-r--r--doc/FontId.33
-rw-r--r--doc/GeomReq.32
-rw-r--r--doc/GetAnchor.323
-rw-r--r--doc/GetBitmap.310
-rw-r--r--doc/GetCapStyl.313
-rw-r--r--doc/GetColor.31
-rw-r--r--doc/GetCursor.36
-rw-r--r--doc/GetDash.340
-rw-r--r--doc/GetFont.32
-rw-r--r--doc/GetGC.32
-rw-r--r--doc/GetHWND.31
-rw-r--r--doc/GetImage.321
-rw-r--r--doc/GetJoinStl.313
-rw-r--r--doc/GetJustify.310
-rw-r--r--doc/GetOption.32
-rw-r--r--doc/GetPixels.34
-rw-r--r--doc/GetPixmap.32
-rw-r--r--doc/GetRelief.313
-rw-r--r--doc/GetScroll.351
-rw-r--r--doc/GetSelect.323
-rw-r--r--doc/GetUid.32
-rw-r--r--doc/GetVRoot.32
-rw-r--r--doc/GetVisual.32
-rw-r--r--doc/Grab.37
-rw-r--r--doc/HWNDToWindow.32
-rw-r--r--doc/HandleEvent.34
-rw-r--r--doc/IdToWindow.32
-rw-r--r--doc/ImgChanged.33
-rw-r--r--doc/Inactive.32
-rw-r--r--doc/InternAtom.32
-rw-r--r--doc/MainLoop.32
-rw-r--r--doc/MainWin.310
-rw-r--r--doc/MaintGeom.31
-rw-r--r--doc/ManageGeom.315
-rw-r--r--doc/MapWindow.32
-rw-r--r--doc/MoveToplev.32
-rw-r--r--doc/Name.38
-rw-r--r--doc/NameOfImg.32
-rw-r--r--doc/OwnSelect.35
-rw-r--r--doc/ParseArgv.320
-rw-r--r--doc/QWinEvent.32
-rw-r--r--doc/Restack.32
-rw-r--r--doc/RestrictEv.319
-rw-r--r--doc/SetAppName.32
-rw-r--r--doc/SetCaret.32
-rw-r--r--doc/SetClass.32
-rw-r--r--doc/SetClassProcs.324
-rw-r--r--doc/SetGrid.32
-rw-r--r--doc/SetOptions.358
-rw-r--r--doc/SetVisual.32
-rw-r--r--doc/StrictMotif.32
-rw-r--r--doc/TextLayout.315
-rw-r--r--doc/TkInitStubs.318
-rw-r--r--doc/Tk_Init.34
-rw-r--r--doc/Tk_Main.318
-rw-r--r--doc/WindowId.32
-rw-r--r--doc/bell.n5
-rw-r--r--doc/bind.n13
-rw-r--r--doc/bindtags.n7
-rw-r--r--doc/bitmap.n24
-rw-r--r--doc/busy.n267
-rw-r--r--doc/button.n52
-rw-r--r--doc/canvas.n805
-rw-r--r--doc/checkbutton.n63
-rw-r--r--doc/chooseColor.n8
-rw-r--r--doc/chooseDirectory.n5
-rw-r--r--doc/clipboard.n43
-rw-r--r--doc/colors.n5
-rw-r--r--doc/console.n4
-rw-r--r--doc/cursors.n26
-rw-r--r--doc/destroy.n5
-rw-r--r--doc/dialog.n10
-rw-r--r--doc/entry.n79
-rw-r--r--doc/event.n116
-rw-r--r--doc/focus.n6
-rw-r--r--doc/focusNext.n5
-rw-r--r--doc/font.n25
-rw-r--r--doc/fontchooser.n181
-rw-r--r--doc/frame.n13
-rw-r--r--doc/getOpenFile.n13
-rw-r--r--doc/grab.n9
-rw-r--r--doc/grid.n88
-rw-r--r--doc/image.n6
-rw-r--r--doc/keysyms.n15
-rw-r--r--doc/label.n16
-rw-r--r--doc/labelframe.n12
-rw-r--r--doc/listbox.n64
-rw-r--r--doc/loadTk.n82
-rw-r--r--doc/lower.n10
-rw-r--r--doc/menu.n387
-rw-r--r--doc/menubar.n6
-rw-r--r--doc/menubutton.n19
-rw-r--r--doc/message.n27
-rw-r--r--doc/messageBox.n33
-rw-r--r--doc/option.n12
-rw-r--r--doc/optionMenu.n4
-rw-r--r--doc/options.n45
-rw-r--r--doc/pack-old.n5
-rw-r--r--doc/pack.n7
-rw-r--r--doc/palette.n5
-rw-r--r--doc/panedwindow.n55
-rw-r--r--doc/photo.n122
-rw-r--r--doc/place.n15
-rw-r--r--doc/popup.n7
-rw-r--r--doc/radiobutton.n55
-rw-r--r--doc/raise.n11
-rw-r--r--doc/scale.n41
-rw-r--r--doc/scrollbar.n33
-rw-r--r--doc/selection.n62
-rw-r--r--doc/send.n10
-rw-r--r--doc/spinbox.n85
-rw-r--r--doc/text.n3168
-rw-r--r--doc/tk.n61
-rw-r--r--doc/tk_mac.n237
-rw-r--r--doc/tkerror.n5
-rw-r--r--doc/tkvars.n70
-rw-r--r--doc/tkwait.n7
-rw-r--r--doc/toplevel.n16
-rw-r--r--doc/ttk_entry.n8
-rw-r--r--doc/ttk_notebook.n24
-rw-r--r--doc/ttk_panedwindow.n20
-rw-r--r--doc/ttk_progressbar.n4
-rw-r--r--doc/ttk_radiobutton.n2
-rw-r--r--doc/ttk_scale.n4
-rw-r--r--doc/ttk_scrollbar.n6
-rw-r--r--doc/ttk_spinbox.n16
-rw-r--r--doc/ttk_treeview.n10
-rw-r--r--doc/ttk_vsapi.n34
-rw-r--r--doc/ttk_widget.n35
-rw-r--r--doc/winfo.n6
-rw-r--r--doc/wish.111
-rw-r--r--doc/wm.n182
-rw-r--r--generic/tk.decls728
-rw-r--r--generic/tk.h515
-rw-r--r--generic/tk3d.c122
-rw-r--r--generic/tk3d.h15
-rw-r--r--generic/tkArgv.c32
-rw-r--r--generic/tkAtom.c33
-rw-r--r--generic/tkBind.c831
-rw-r--r--generic/tkBitmap.c133
-rw-r--r--generic/tkBusy.c926
-rw-r--r--generic/tkBusy.h41
-rw-r--r--generic/tkButton.c181
-rw-r--r--generic/tkButton.h21
-rw-r--r--generic/tkCanvArc.c129
-rw-r--r--generic/tkCanvBmap.c70
-rw-r--r--generic/tkCanvImg.c64
-rw-r--r--generic/tkCanvLine.c497
-rw-r--r--generic/tkCanvPoly.c512
-rw-r--r--generic/tkCanvPs.c329
-rw-r--r--generic/tkCanvText.c422
-rw-r--r--generic/tkCanvUtil.c284
-rw-r--r--generic/tkCanvWind.c101
-rw-r--r--generic/tkCanvas.c1465
-rw-r--r--generic/tkCanvas.h8
-rw-r--r--generic/tkClipboard.c74
-rw-r--r--generic/tkCmds.c876
-rw-r--r--generic/tkColor.c51
-rw-r--r--generic/tkColor.h10
-rw-r--r--generic/tkConfig.c136
-rw-r--r--generic/tkConsole.c203
-rw-r--r--generic/tkCursor.c88
-rw-r--r--generic/tkDecls.h1685
-rw-r--r--generic/tkEntry.c444
-rw-r--r--generic/tkEntry.h14
-rw-r--r--generic/tkError.c13
-rw-r--r--generic/tkEvent.c110
-rw-r--r--generic/tkFileFilter.c194
-rw-r--r--generic/tkFileFilter.h9
-rw-r--r--generic/tkFocus.c158
-rw-r--r--generic/tkFont.c810
-rw-r--r--generic/tkFont.h32
-rw-r--r--generic/tkFrame.c232
-rw-r--r--generic/tkGC.c12
-rw-r--r--generic/tkGeometry.c115
-rw-r--r--generic/tkGet.c34
-rw-r--r--generic/tkGrab.c60
-rw-r--r--generic/tkGrid.c228
-rw-r--r--generic/tkImage.c160
-rw-r--r--generic/tkImgBmap.c134
-rw-r--r--generic/tkImgGIF.c1131
-rw-r--r--generic/tkImgPNG.c3485
-rw-r--r--generic/tkImgPPM.c29
-rw-r--r--generic/tkImgPhInstance.c1965
-rw-r--r--generic/tkImgPhoto.c2672
-rw-r--r--generic/tkImgPhoto.h260
-rw-r--r--generic/tkImgUtil.c2
-rw-r--r--generic/tkInt.decls530
-rw-r--r--generic/tkInt.h209
-rw-r--r--generic/tkIntDecls.h1281
-rw-r--r--generic/tkIntPlatDecls.h606
-rw-r--r--generic/tkIntXlibDecls.h1020
-rw-r--r--generic/tkListbox.c224
-rw-r--r--generic/tkMacWinMenu.c8
-rw-r--r--generic/tkMain.c368
-rw-r--r--generic/tkMenu.c428
-rw-r--r--generic/tkMenu.h14
-rw-r--r--generic/tkMenuDraw.c28
-rw-r--r--generic/tkMenubutton.c114
-rw-r--r--generic/tkMenubutton.h14
-rw-r--r--generic/tkMessage.c86
-rw-r--r--generic/tkObj.c146
-rw-r--r--generic/tkOldConfig.c110
-rw-r--r--generic/tkOldTest.c46
-rw-r--r--generic/tkOption.c123
-rw-r--r--generic/tkPack.c218
-rw-r--r--generic/tkPanedWindow.c201
-rw-r--r--generic/tkPlace.c112
-rw-r--r--generic/tkPlatDecls.h109
-rw-r--r--generic/tkPointer.c20
-rw-r--r--generic/tkPort.h13
-rw-r--r--generic/tkRectOval.c121
-rw-r--r--generic/tkScale.c96
-rw-r--r--generic/tkScale.h8
-rw-r--r--generic/tkScrollbar.c134
-rw-r--r--generic/tkScrollbar.h20
-rw-r--r--generic/tkSelect.c179
-rw-r--r--generic/tkSelect.h6
-rw-r--r--generic/tkSquare.c83
-rw-r--r--generic/tkStubInit.c192
-rw-r--r--generic/tkStubLib.c59
-rw-r--r--generic/tkStyle.c140
-rw-r--r--generic/tkTest.c365
-rw-r--r--generic/tkText.c454
-rw-r--r--generic/tkText.h62
-rw-r--r--generic/tkTextBTree.c205
-rw-r--r--generic/tkTextDisp.c599
-rw-r--r--generic/tkTextImage.c33
-rw-r--r--generic/tkTextIndex.c136
-rw-r--r--generic/tkTextMark.c79
-rw-r--r--generic/tkTextTag.c84
-rw-r--r--generic/tkTextWind.c81
-rw-r--r--generic/tkTrig.c6
-rw-r--r--generic/tkUndo.c31
-rw-r--r--generic/tkUndo.h10
-rw-r--r--generic/tkUtil.c250
-rw-r--r--generic/tkVisual.c19
-rw-r--r--generic/tkWindow.c393
-rw-r--r--generic/ttk/ttk.decls124
-rw-r--r--generic/ttk/ttkBlink.c4
-rw-r--r--generic/ttk/ttkCache.c4
-rw-r--r--generic/ttk/ttkDecls.h34
-rw-r--r--generic/ttk/ttkGenStubs.tcl168
-rw-r--r--generic/ttk/ttkImage.c14
-rw-r--r--generic/ttk/ttkLabel.c6
-rw-r--r--generic/ttk/ttkLayout.c12
-rw-r--r--generic/ttk/ttkManager.c13
-rw-r--r--generic/ttk/ttkScroll.c4
-rw-r--r--generic/ttk/ttkTagSet.c20
-rw-r--r--generic/ttk/ttkTheme.c30
-rw-r--r--generic/ttk/ttkTrace.c6
-rw-r--r--generic/ttk/ttkTrack.c2
-rw-r--r--generic/ttk/ttkTreeview.c35
-rw-r--r--library/bgerror.tcl100
-rw-r--r--library/button.tcl7
-rw-r--r--library/choosedir.tcl9
-rw-r--r--library/console.tcl75
-rw-r--r--library/demos/combo.tcl1
-rw-r--r--library/demos/ctext.tcl61
-rw-r--r--library/demos/en.msg2
-rw-r--r--library/demos/filebox.tcl15
-rw-r--r--library/demos/fontchoose.tcl69
-rw-r--r--library/demos/hello2
-rw-r--r--library/demos/image2.tcl2
-rw-r--r--library/demos/images/face.xbm173
-rw-r--r--library/demos/images/ouster.pngbin0 -> 54257 bytes
-rw-r--r--library/demos/items.tcl25
-rw-r--r--library/demos/knightstour.tcl29
-rw-r--r--library/demos/label.tcl11
-rw-r--r--library/demos/mclist.tcl47
-rw-r--r--library/demos/msgbox.tcl1
-rw-r--r--library/demos/nl.msg2
-rw-r--r--library/demos/pendulum.tcl6
-rw-r--r--library/demos/rmt2
-rw-r--r--library/demos/square2
-rw-r--r--library/demos/tcolor2
-rw-r--r--library/demos/text.tcl27
-rw-r--r--library/demos/timer2
-rw-r--r--library/demos/toolbar.tcl7
-rw-r--r--library/demos/tree.tcl10
-rw-r--r--library/demos/ttkbut.tcl1
-rw-r--r--library/demos/ttkmenu.tcl1
-rw-r--r--library/demos/ttknote.tcl7
-rw-r--r--library/demos/ttkpane.tcl11
-rw-r--r--library/demos/ttkprogress.tcl1
-rw-r--r--library/demos/twind.tcl2
-rw-r--r--library/demos/unicodeout.tcl103
-rw-r--r--library/demos/widget27
-rw-r--r--library/dialog.tcl2
-rw-r--r--library/entry.tcl29
-rw-r--r--library/fontchooser.tcl442
-rw-r--r--library/iconlist.tcl694
-rw-r--r--library/icons.tcl153
-rw-r--r--library/images/lamp.pngbin0 -> 8203 bytes
-rw-r--r--library/images/lamp.svg114
-rw-r--r--library/listbox.tcl13
-rw-r--r--library/megawidget.tcl140
-rw-r--r--library/mkpsenc.tcl2782
-rw-r--r--library/msgbox.tcl60
-rw-r--r--library/msgs/cs.msg67
-rw-r--r--library/msgs/da.msg5
-rw-r--r--library/msgs/de.msg15
-rw-r--r--library/msgs/el.msg8
-rw-r--r--library/msgs/en.msg15
-rw-r--r--library/msgs/eo.msg4
-rw-r--r--library/msgs/es.msg14
-rw-r--r--library/msgs/fr.msg16
-rw-r--r--library/msgs/hu.msg7
-rw-r--r--library/msgs/it.msg21
-rw-r--r--library/msgs/nl.msg82
-rw-r--r--library/msgs/pl.msg22
-rw-r--r--library/msgs/pt.msg140
-rw-r--r--library/msgs/ru.msg24
-rw-r--r--library/msgs/sv.msg4
-rw-r--r--library/safetk.tcl4
-rw-r--r--library/scrlbar.tcl36
-rw-r--r--library/spinbox.tcl26
-rw-r--r--library/tclIndex31
-rw-r--r--library/text.tcl64
-rw-r--r--library/tk.tcl257
-rw-r--r--library/tkfbox.tcl1075
-rw-r--r--library/ttk/entry.tcl28
-rw-r--r--library/unsupported.tcl28
-rw-r--r--library/xmfbox.tcl2
-rw-r--r--license.terms7
-rw-r--r--macosx/README394
-rw-r--r--macosx/Tk-Common.xcconfig46
-rw-r--r--macosx/Tk-Debug.xcconfig19
-rw-r--r--macosx/Tk-Info.plist.in5
-rw-r--r--macosx/Tk-Release.xcconfig19
-rw-r--r--macosx/Tk.icnsbin0 -> 154497 bytes
-rw-r--r--macosx/Tk.tiffbin0 -> 53684 bytes
-rw-r--r--macosx/Tk.xcode/default.pbxuser384
-rw-r--r--macosx/Tk.xcode/project.pbxproj5785
-rw-r--r--macosx/Tk.xcodeproj/default.pbxuser399
-rw-r--r--macosx/Tk.xcodeproj/project.pbxproj5929
-rw-r--r--macosx/Wish-Info.plist.in9
-rw-r--r--macosx/Wish.pbproj/default.pbxuser178
-rw-r--r--macosx/Wish.pbproj/jingham.pbxuser178
-rw-r--r--macosx/Wish.pbproj/project.pbxproj2312
-rw-r--r--macosx/Wish.sdef37
-rw-r--r--macosx/tkMacOSX.h14
-rw-r--r--macosx/tkMacOSXBitmap.c487
-rw-r--r--macosx/tkMacOSXButton.c2205
-rw-r--r--macosx/tkMacOSXClipboard.c361
-rw-r--r--macosx/tkMacOSXColor.c459
-rw-r--r--macosx/tkMacOSXConfig.c6
-rw-r--r--macosx/tkMacOSXCursor.c509
-rw-r--r--macosx/tkMacOSXCursors.h89
-rw-r--r--macosx/tkMacOSXDebug.c525
-rw-r--r--macosx/tkMacOSXDebug.h70
-rw-r--r--macosx/tkMacOSXDefault.h111
-rw-r--r--macosx/tkMacOSXDialog.c2482
-rw-r--r--macosx/tkMacOSXDraw.c1483
-rw-r--r--macosx/tkMacOSXEmbed.c118
-rw-r--r--macosx/tkMacOSXEntry.c273
-rw-r--r--macosx/tkMacOSXEvent.c331
-rw-r--r--macosx/tkMacOSXEvent.h90
-rw-r--r--macosx/tkMacOSXFont.c2377
-rw-r--r--macosx/tkMacOSXFont.h8
-rw-r--r--macosx/tkMacOSXHLEvents.c111
-rw-r--r--macosx/tkMacOSXInit.c494
-rw-r--r--macosx/tkMacOSXInt.h126
-rw-r--r--macosx/tkMacOSXKeyEvent.c1159
-rw-r--r--macosx/tkMacOSXKeyboard.c405
-rw-r--r--macosx/tkMacOSXMenu.c4889
-rw-r--r--macosx/tkMacOSXMenubutton.c1105
-rw-r--r--macosx/tkMacOSXMenus.c690
-rw-r--r--macosx/tkMacOSXMouseEvent.c1132
-rw-r--r--macosx/tkMacOSXNotify.c282
-rw-r--r--macosx/tkMacOSXPort.h22
-rw-r--r--macosx/tkMacOSXPrivate.h417
-rw-r--r--macosx/tkMacOSXRegion.c153
-rw-r--r--macosx/tkMacOSXScale.c19
-rw-r--r--macosx/tkMacOSXScrlbr.c1140
-rw-r--r--macosx/tkMacOSXSend.c41
-rw-r--r--macosx/tkMacOSXSubwindows.c756
-rw-r--r--macosx/tkMacOSXTest.c16
-rw-r--r--macosx/tkMacOSXWindowEvent.c1258
-rw-r--r--macosx/tkMacOSXWm.c2264
-rw-r--r--macosx/tkMacOSXWm.h58
-rw-r--r--macosx/tkMacOSXXCursors.h711
-rw-r--r--macosx/tkMacOSXXStubs.c465
-rw-r--r--macosx/ttkMacOSXTheme.c544
-rw-r--r--tests/bell.test57
-rw-r--r--tests/bgerror.test45
-rw-r--r--tests/bind.test7992
-rw-r--r--tests/bitmap.test82
-rw-r--r--tests/border.test158
-rw-r--r--tests/busy.test477
-rw-r--r--tests/button.test4401
-rw-r--r--tests/canvImg.test809
-rw-r--r--tests/canvMoveto.test56
-rw-r--r--tests/canvPs.test45
-rw-r--r--tests/canvRect.test599
-rw-r--r--tests/canvText.test914
-rw-r--r--tests/canvWind.test43
-rw-r--r--tests/canvas.test746
-rw-r--r--tests/choosedir.test82
-rw-r--r--tests/clipboard.test361
-rw-r--r--tests/clrpick.test191
-rw-r--r--tests/cmds.test50
-rw-r--r--tests/config.test2135
-rw-r--r--tests/constraints.tcl39
-rw-r--r--tests/cursor.test900
-rw-r--r--tests/dialog.test75
-rw-r--r--tests/embed.test96
-rw-r--r--tests/entry.test3701
-rw-r--r--tests/event.test211
-rw-r--r--tests/focus.test556
-rw-r--r--tests/focusTcl.test483
-rw-r--r--tests/font.test2806
-rw-r--r--tests/fontchooser.test201
-rw-r--r--tests/frame.test1483
-rw-r--r--tests/geometry.test168
-rw-r--r--tests/get.test132
-rw-r--r--tests/grab.test218
-rw-r--r--tests/grid.test1542
-rw-r--r--tests/id.test91
-rw-r--r--tests/image.test639
-rw-r--r--tests/imgBmap.test490
-rw-r--r--tests/imgPNG.test1116
-rw-r--r--tests/imgPPM.test212
-rw-r--r--tests/imgPhoto.test1553
-rw-r--r--tests/listbox.test2862
-rw-r--r--tests/main.test136
-rw-r--r--tests/menu.test4664
-rw-r--r--tests/menuDraw.test778
-rw-r--r--tests/menubut.test817
-rw-r--r--tests/message.test534
-rw-r--r--tests/msgbox.test466
-rw-r--r--tests/obj.test22
-rw-r--r--tests/oldpack.test577
-rw-r--r--tests/option.test503
-rw-r--r--tests/pack.test1797
-rw-r--r--tests/packgrid.test250
-rw-r--r--tests/panedwindow.test5619
-rw-r--r--tests/place.test435
-rw-r--r--tests/raise.test201
-rw-r--r--tests/safe.test151
-rw-r--r--tests/scale.test1494
-rw-r--r--tests/scrollbar.test8
-rw-r--r--tests/select.test681
-rw-r--r--tests/send.test4
-rw-r--r--tests/spinbox.test4031
-rw-r--r--tests/text.test8318
-rw-r--r--tests/textBTree.test1087
-rw-r--r--tests/textImage.test692
-rw-r--r--tests/textIndex.test2
-rw-r--r--tests/textMark.test261
-rw-r--r--tests/textTag.test1666
-rw-r--r--tests/textWind.test1188
-rw-r--r--tests/tk.test204
-rw-r--r--tests/unixButton.test199
-rw-r--r--tests/unixEmbed.test596
-rw-r--r--tests/unixMenu.test1179
-rw-r--r--tests/unixSelect.test420
-rw-r--r--tests/util.test66
-rw-r--r--tests/visual.test562
-rw-r--r--tests/visual_bb.test54
-rw-r--r--tests/winButton.test172
-rw-r--r--tests/winClipboard.test116
-rw-r--r--tests/winDialog.test555
-rw-r--r--tests/winFont.test454
-rw-r--r--tests/winMenu.test1257
-rw-r--r--tests/winMsgbox.test45
-rw-r--r--tests/winSend.test2
-rw-r--r--tests/winWm.test317
-rw-r--r--tests/window.test201
-rw-r--r--tests/winfo.test599
-rw-r--r--tests/wm.test14
-rw-r--r--tests/xmfbox.test107
-rw-r--r--unix/Makefile.in366
-rwxr-xr-xunix/configure760
-rw-r--r--unix/configure.in106
-rw-r--r--[-rwxr-xr-x]unix/install-sh580
-rwxr-xr-xunix/installManPage7
-rw-r--r--unix/tcl.m4155
-rw-r--r--unix/tk.pc.in15
-rw-r--r--unix/tk.spec6
-rw-r--r--unix/tkAppInit.c70
-rw-r--r--unix/tkConfig.h.in26
-rw-r--r--unix/tkUnix.c4
-rw-r--r--unix/tkUnix3d.c15
-rw-r--r--unix/tkUnixButton.c15
-rw-r--r--unix/tkUnixColor.c16
-rw-r--r--unix/tkUnixConfig.c4
-rw-r--r--unix/tkUnixCursor.c50
-rw-r--r--unix/tkUnixDefault.h65
-rw-r--r--unix/tkUnixDialog.c18
-rw-r--r--unix/tkUnixDraw.c11
-rw-r--r--unix/tkUnixEmbed.c199
-rw-r--r--unix/tkUnixEvent.c37
-rw-r--r--unix/tkUnixFont.c498
-rw-r--r--unix/tkUnixInit.c7
-rw-r--r--unix/tkUnixKey.c94
-rw-r--r--unix/tkUnixMenu.c133
-rw-r--r--unix/tkUnixMenubu.c13
-rw-r--r--unix/tkUnixPort.h28
-rw-r--r--unix/tkUnixRFont.c406
-rw-r--r--unix/tkUnixScale.c16
-rw-r--r--unix/tkUnixScrlbr.c29
-rw-r--r--unix/tkUnixSelect.c117
-rw-r--r--unix/tkUnixSend.c152
-rw-r--r--unix/tkUnixWm.c687
-rw-r--r--unix/tkUnixXId.c473
-rw-r--r--win/Makefile.in80
-rw-r--r--win/README2
-rwxr-xr-xwin/buildall.vc.bat2
-rwxr-xr-xwin/configure363
-rw-r--r--win/configure.in64
-rw-r--r--win/makefile.bc3
-rw-r--r--win/makefile.vc81
-rw-r--r--win/nmakehlp.c8
-rw-r--r--win/rc/tk.icobin1398 -> 57022 bytes
-rw-r--r--win/rc/wish.icobin3630 -> 46878 bytes
-rw-r--r--win/rules.vc51
-rw-r--r--win/stubs.c2
-rw-r--r--win/tcl.m4110
-rw-r--r--win/tkWin.h16
-rw-r--r--win/tkWin32Dll.c6
-rw-r--r--win/tkWin3d.c2
-rw-r--r--win/tkWinButton.c33
-rw-r--r--win/tkWinClipboard.c14
-rw-r--r--win/tkWinColor.c73
-rw-r--r--win/tkWinConfig.c4
-rw-r--r--win/tkWinCursor.c37
-rw-r--r--win/tkWinDefault.h65
-rw-r--r--win/tkWinDialog.c1384
-rw-r--r--win/tkWinDraw.c25
-rw-r--r--win/tkWinEmbed.c18
-rw-r--r--win/tkWinFont.c617
-rw-r--r--win/tkWinImage.c70
-rw-r--r--win/tkWinInit.c37
-rw-r--r--win/tkWinInt.h71
-rw-r--r--win/tkWinKey.c27
-rw-r--r--win/tkWinMenu.c141
-rw-r--r--win/tkWinPixmap.c12
-rw-r--r--win/tkWinPointer.c14
-rw-r--r--win/tkWinPort.h48
-rw-r--r--win/tkWinScrlbr.c121
-rw-r--r--win/tkWinSend.c28
-rw-r--r--win/tkWinSendCom.c8
-rw-r--r--win/tkWinTest.c205
-rw-r--r--win/tkWinWindow.c192
-rw-r--r--win/tkWinWm.c958
-rw-r--r--win/tkWinX.c189
-rw-r--r--win/ttkWinMonitor.c2
-rw-r--r--win/ttkWinTheme.c2
-rw-r--r--win/ttkWinXPTheme.c27
-rw-r--r--win/winMain.c224
-rw-r--r--xlib/xcolors.c8
-rw-r--r--xlib/xgc.c45
-rw-r--r--xlib/xutil.c5
641 files changed, 164376 insertions, 79217 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a42f43..d7fb2e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
-2011-10-01 Kevin B. Kenny <kennykb@acm.org>
+2011-10-27 Kevin B. Kenny <kennykb@acm.org>
- * generic/tkInt.h: [Bug 3410609] Change the event mechanism
+ * generic/tkInt.h: [Bug 3410609]: Change the event mechanism
* unix/tkUnixEvent.c: for <KeyPress> events to use the keysym
* unix/tkUnixKey.c: returned by XLookupString in preference to
the one that appears in the raw X event at any level. This change
@@ -8,6 +8,32 @@
and similar beasts. KeyRelease events still work as they did before,
as does Tk with input methods disabled.
+2011-10-13 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinDialog.c: Internationalization of all Windows font
+ * win/tkWinFont.c: handling.
+
+2011-10-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinDialog.c: [BUG 3163893] -initialdir option bug for
+ tk_chooseDirectory under XP
+
+2011-10-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinInt.h: Remove tkWinProcs, as it is no longer
+ * win/tkWinX.c: being used.
+ * win/tkWinTest.c:
+
+2011-09-27 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPNG.c (WriteExtraChunks): [Bug 3405839]: Write the sDAT
+ chunk with the correct length.
+
+2011-09-08 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkDecls.h: Don't let tkDecls.h depend on <tchar.h> on
+ windows, not even in UNICODE mode.
+
2011-09-01 Donal K. Fellows <dkf@users.sf.net>
* doc/photo.n: Correctly documented what the [$ph data] command
@@ -15,59 +41,78 @@
2011-08-16 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinDialog.c: [Bug 3388350] mingw64 compiler warnings
- * win/tkWinDraw.c
- * win/tkWinSend.c
- * win/tkWinSendCom.c
- * win/tkWinColor.c
- * win/tkWinDialog.c
+ * win/tkWinDialog.c: [Bug 3388350]: mingw64 compiler warnings
* win/tkWinEmbed.c
* win/tkWinMenu.c
- * win/tkWinPixmap.c
* win/tkWinTest.c
- * win/tkWinWindow.c
* win/tkWinWm.c
* win/tkWinX.c
- * win/stubs.c
- * generic/tkAtom.c
- * generic/tkSelect.c
2011-08-13 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkBitmap.c: [Bug 3388350] mingw64 compiler warnings
+ * generic/tkBitmap.c: [Bug 3388350]: mingw64 compiler warnings
* generic/tkConsole.c
- * unix/tkUnixMenubu.c
- * win/tkWinButton.c
+ * win/tkWinDialog.c
* win/tkWinEmbed.c
- * win/tkWinFont.c
- * win/tkWinImage.c
- * win/tkWinKey.c
- * win/tkWinTest.c
- * win/tkWinWm.c
+ * win/tkWinSend.c
+ * win/tkWinSendCom.c
+
+2011-08-05 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.6b2 TAGGED FOR RELEASE ***
+
+ * changes: Updates for 8.6b2 release.
+
+2011-08-03 Don Porter <dgp@users.sourceforge.net>
+
+ * win/tkWinWm.c: [Bug 2891541]: Merge of 8.5.8 fix from Pat Thoyts.
+ Permit normal behaviour on Windows for a grabbed toplevel when it
+ is the main window.
2011-08-03 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinDialog.c: [Bug 3314770] regression - Windows file
+ * win/tkWinDialog.c: [Bug 3314770]: regression - Windows file
dialogs not resizable
+2011-07-28 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.6b2 release.
+
2011-07-28 Jan Nijtmans <nijtmans@users.sf.net>
- * xlib/X11/Xutil.h: [Bug 3380684] XEmptyRegion prototype doesn't
+ * xlib/X11/Xutil.h: [Bug 3380684]: XEmptyRegion prototype doesn't
match usage
+2011-07-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/*.3, doc/*.n: Many small fixes to documentation as part of
+ project to improve quality of generated HTML docs.
+
+2011-07-18 Don Porter <dgp@users.sourceforge.net>
+
+ * README: Bump version number to 8.6b2
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
2011-06-29 Don Porter <dgp@users.sourceforge.net>
- * generic/ttk/ttkTrace.c: [Bug 3341056] Correct segfault due to flaw
+ * generic/ttk/ttkTrace.c: [Bug 3341056]: Correct segfault due to flaw
* tests/ttk/ttk.test: in the 2011-06-17 commit.
-2011-06-23 Don Porter <dgp@users.sourceforge.net>
+2011-06-19 Donal K. Fellows <dkf@users.sf.net>
- * changes: Updated for 8.5.10 release.
+ * doc/wm.n: Added documentation of the -type attribute that was
+ introduced in TIP#359, and moved documentation of -alpha to common
+ section as it is supported on all platforms now.
2011-06-17 Don Porter <dgp@users.sourceforge.net>
- *** 8.5.10 TAGGED FOR RELEASE ***
-
* generic/ttk/ttkTrace.c: Workaround Bug 3062331.
* tests/ttk/ttk.test:
* changes: Updated
@@ -79,31 +124,26 @@
2011-06-10 Don Porter <dgp@users.sourceforge.net>
- * README: Correct some README bitrot.
- * macosx/README:
+ * generic/tkEntry.c: [Bug 3315731]: Fix [$entry -invcmd].
- * generic/tkCanvLine.c: [Bug 3175610] Incomplete refresh of line item.
- Backport of 2011-03-03 trunk commit from Alexandre Ferrieux.
-
-2011-06-08 Don Porter <dgp@users.sourceforge.net>
+2011-06-10 Don Porter <dgp@users.sourceforge.net>
- * changes: Updated for 8.5.10 release.
+ * README: Correct some README bitrot.
+ * macosx/README:
2011-06-07 Don Porter <dgp@users.sourceforge.net>
- * win/tkWinDialog.c: Backport [Bug 2484771] fix.
-
- * generic/tkEntry.c: Restore support for values "08" and "09"
- in a [spinbox] configured to use -from and -to values. [Bug 2358545].
+ * generic/tkEntry.c: [Bug 2358545]: Restore support for values "08"
+ and "09" in a [spinbox] configured to use -from and -to values.
2011-06-06 Don Porter <dgp@users.sourceforge.net>
- * generic/tkConsole.c: Restore proper NUL output to the [console].
- [Bug 2546087]
+ * generic/tkConsole.c: [Bug 2546087]: Restore proper NUL output to
+ * library/console.tcl: the [console].
2011-04-22 Peter Spjuth <peter.spjuth@gmail.com>
- * generic/tkCanvPoly.c: [Bug 3291543] There was a crash if dchars
+ * generic/tkCanvPoly.c: [Bug 3291543]: There was a crash if dchars
* tests/canvas.test: removed all coordinates of a polygon.
2011-04-21 Peter Spjuth <peter.spjuth@gmail.com>
@@ -118,12 +158,26 @@
* doc/ttk_progressbar.n:
* doc/ttk_widget.n:
+2011-04-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tkAppInit.c: Make symbols "main" and "Tcl_AppInit"
+ MODULE_SCOPE: there is absolutely no reason for exporting them.
+ * unix/tcl.m4: Don't use -fvisibility=hidden with static
+ * unix/configure libraries (--disable-shared)
+
2011-04-04 Peter Spjuth <peter.spjuth@gmail.com>
* tests/grid.test:
* generic/tkGrid.c: [Bug 723765]: When a slave was removed from grid,
the -in option was not remembered.
+2011-04-04 Joe Mistachkin <joe@mistachkin.com>
+
+ * win/tkWinDialog.c (FontchooserShowCmd): Change the CHOOSEFONT and
+ LOGFONT used with sizeof to CHOOSEFONTA and LOGFONTA to match their
+ local variable declarations (i.e. mismatch with -DUNICODE). This code
+ is not present in 8.4 or 8.5.
+
2011-04-04 Peter Spjuth <peter.spjuth@gmail.com>
* doc/labelframe.n:
@@ -133,15 +187,21 @@
sense as a container. Added note to frame about restrictions when used
as a container.
+2011-03-28 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/tk.tcl (::tk::FindAltKeyTarget): Make this handle the
+ traversal of the logical window manager hierarchy correctly. Based on
+ comments by Emiliano Gavilan.
+
2011-03-28 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkTextBTree.c: [Bug 3129527]: Fix buffer overflow
- w/ GCC 4.5 and -D_FORTIFY_SOURCE=2. One more place where this problem
- could appear.
+ * generic/tkTextBTree.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5
+ and -D_FORTIFY_SOURCE=2. One more place where this problem could
+ appear.
2011-03-24 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinMenu.c: [Bug #3239768] tk8.4.19 (and later) WIN32
+ * win/tkWinMenu.c: [Bug #3239768]: tk8.4.19 (and later) WIN32
menu font support.
2011-03-16 Jan Nijtmans <nijtmans@users.sf.net>
@@ -151,6 +211,17 @@
Backported from TEA, but kept all original platform code which was
removed from TEA.
+2011-03-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkBind.c: Eliminate some more unneeded write-only
+ * generic/tkCanvUtil.c: variables (discovered by gcc-4.6)
+ * generic/tkFocus.c:
+
+2011-03-12 Donal K. Fellows <dkf@users.sf.net>
+
+ Remove casts from uses of ckalloc/ckfree/... now that Tcl declares
+ them to be using useful casts internally.
+
2011-03-12 Jan Nijtmans <nijtmans@users.sf.net>
* win/tkWin32Dll.c: Eliminate unneeded _TkFinalize wrapper.
@@ -167,33 +238,47 @@
test rather than one from libfreetype, because the latter doesn't
work when the linker is called with --as-needed.
-2011-01-25 Jan Nijtmans <nijtmans@users.sf.net>
+2011-03-03 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+
+ * generic/tkCanvLine.c: [Bug 3175610]: Incomplete refresh of line items.
+
+2011-03-02 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkSelect.c: [Patch #3129527]: Fix buffer overflow
- * win/tkWinWm.c: w/ GCC 4.5 and -D_FORTIFY_SOURCE=2. Just the
- * unix/tkUnixWm.c: strcpy->memcpy part, to prevent anything
- like [Bug #3164879]
+ * doc/tk_mac.n (new file): Description of OSX-specific functionality
+ in Tk, contributed by Kevin Walzer.
+ * doc/button.n, doc/font.n, doc/menu.n: Noted which parts of these
+ commands are intentionally not fully supported on OSX.
+
+2011-01-24 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkSelect.c: Fix for [Bug #3164879]:
+ (memory allocation bug introduced by [Patch #3129527])
2011-01-22 Joe English <jenglish@users.sourceforge.net>
* generic/ttk/ttkEntry.c(ttk::combobox): Add missing
'validate' command (reported by schelte).
-2011-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+2011-01-13 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/ttk/ttkGenStubs.tcl: Make sure to use CONST/VOID in stead of
- * generic/ttk/ttkDecls.h: const/void when appropriate. This allows to
- use const/void in the *.decls file always, genStubs will do the right
- thing.
+ * library/msgbox.tcl: [Patch #3154705]: Close button has no effect
-2011-01-17 Jan Nijtmans <nijtmans@users.sf.net>
+2011-01-12 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tcl.m4: handle --enable-64bit=ia64 for gcc. BACKPORT.
+ * win/tcl.m4: handle --enable-64bit=ia64 for gcc
+ * win/configure.in typo
* win/configure: (autoconf-2.59)
-2011-01-13 Jan Nijtmans <nijtmans@users.sf.net>
+2011-01-06 Kevin Walzer <wordtech@users.sourceforge.net>
- * library/msgbox.tcl: [Patch #3154705] Close button has no effect
+ * macosx/README: Added info on textured background windows.
+ * macosx/tkMacOSXFont.c: Fix for 2857300, improves rounding up on text
+ width [submitted by treectrl]
+ * macosx/tkMacOSXMenu.c: Fix for radiobuttons and checkbuttons not
+ displaying in popup menus, and disabled menu entries.
+ * macosx/tkMacOSXWindowEvent.c: Fix for 3086887, speeds up scrolling;
+ also textured background windows
+ * macosx/tkMacOSXWm.c: Textured background windows.
2011-01-06 Stuart Cassoff <stwo@users.sourceforge.net>
@@ -204,245 +289,490 @@
2010-12-17 Stuart Cassoff <stwo@users.sourceforge.net>
+ * unix/Makefile.in: Clean up '.PHONY:' targets: Arrange those
+ common to Tcl and Tk as in Tcl's Makefile.in,
+ add any missing ones and remove duplicates.
+
+2010-12-17 Stuart Cassoff <stwo@users.sourceforge.net>
+
* unix/Makefile.in: [Bug 2446711]: Remove 'allpatch' target.
2010-12-17 Stuart Cassoff <stwo@users.sourceforge.net>
* unix/Makefile.in: Use 'rpmbuild', not 'rpm' [Bug 2537626].
+2010-12-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkMain.c: refactor isatty() function for Windows.
+ * win/tkWinImage.c: better warning message.
+ * win/tkWinInit.c: Let TkpDisplayWarning() send the message
+ directly to the debugger, if available, otherwise do as before.
+
+2010-12-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tk.h: [Patch 3124554]: Move WishPanic from Tk to Tcl
+ * win/winMain.c: Remove special MessageBox'es here, since every
+ panic-related thing is now handled correctly by Tcl.
+
+2010-12-15 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * unix/Makefile.in: Installer Improvements.
+ * unix/install-sh: Similar to Tcl [Patch 3101127].
+
+2010-12-15 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkMain.c: [Patch #3124683]: platform specific stuff
+ in (tcl|tk)Main.c
+
2010-12-13 Jan Nijtmans <nijtmans@users.sf.net>
- * unix/tcl.m4: Cross-compile support for Win and UNIX (backported)
- * unix/configure: (autoconf-2.59)
- * win/tcl.m4:
- * win/configure.in:
- * win/configure: (autoconf-2.59)
- * win/tkWin32Dll.c: SEH-emulation for AMD64
- * win/tkWinX.c: mingw-w64 does not accept _WIN32_IE < 0x0501
+ * unix/tcl.m4: [Bug 3135271]: Link error due to hidden
+ * unix/configure: symbols (CentOS 4.2) (autoconf-2.59)
+ * generic/tkMain.c: Change "Application initialization failed" to
+ * tests/main.test: "application-specific initialization failed",
+ for consistency with Tcl.
+ * win/tkWin32Dll.c: See also: [Patch 1910041] and [Patch 3059922].
+ SEH emulation on Win64 was not correct here: it sometimes results in
+ a crash. Contrary to the other places, the code here is not meant to
+ protect from OS bugs, but to protect Finalizing Tk when the application
+ went in an invalid state.
2010-12-12 Stuart Cassoff <stwo@users.sourceforge.net>
* unix/tcl.m4: Better building on OpenBSD.
* unix/configure: (autoconf-2.59)
+2010-12-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: Fix manifest-generation for 64-bit gcc (mingw-w64)
+ * win/configure: (autoconf-2.59)
+
+2010-12-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkSelect.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5
+ * generic/tkTextDisp.c: and -D_FORTIFY_SOURCE=2
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c:
+
+2010-12-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: [Patch 3116490]: cross-compile support for unix
+ * unix/configure (autoconf-2.59)
+
+2010-12-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: [Patch 3116490]: cross-compile Tcl mingw32 on unix
+ * win/configure: This makes it possible to cross-compile Tcl/Tk for
+ Windows (either 32-bit or 64-bit) out-of-the-box on UNIX, using
+ mingw-w64 build tools.
+
+2010-12-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkInt.decls (TkDrawAngledTextLayout,TkDrawAngledChars,...):
+ Expose angled text API for Emiliano Gavilan. Still only in internal
+ stub table.
+
+2010-11-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkAtom.c: Fix various 64-bit gcc(-4.5.2) warnings: cast
+ * generic/tkSelect.c: from pointer to integer of different size.
+ * win/stubs.c:
+ * win/tkWinButton.c:
+ * win/tkWinColor.c:
+ * win/tkWinPixmap.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWindow.c:
+ * win/tkWinWm.c:
+ * win/ttkWinMonitor.c:
+ * win/tkWin32Dll.c: Make assembler code compile in Win64 with gcc.
+
2010-11-24 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinDialog.c: [Bug #3071836]: Crash/Tcl_Panic on WinXP saving
- * win/tkWinInit.c: file to C:\ re-wrote TkpDisplayWarning such
- that it does not use an Tcl API calls any more, so it works even with
- an ill-initialized Tcl.
- * win/winMain.c: Teach WishPanic how to thread UTF-8 in it's
- messagebox. Backports from Tcl 8.6. No change in functionality.
+ * win/tkWinDialog.c: [Bug 3071836]: Crash/Tcl_Panic on WinXP saving
+ * win/tkWinInit.c: file to C:\, and rewrite TkpDisplayWarning not
+ to use any Tcl functions any more. This allows TkpDisplayWarning to be
+ used as panic proc.
+ * win/winMain.c: Use TkpDisplayWarning as panic proc on Windows.
+ * generic/tkMain.c: Remove unused strrchr, combine outChannel and
+ errChannel variables to a single variable.
2010-11-19 Jan Nijtmans <nijtmans@users.sf.net>
- * win/configure.in: Allow cross-compilation by default. (backported)
- * win/tcl.m4: Use -pipe for gcc on win32 (backported)
- * win/configure: (regenerated)
+ * generic/tkCanv*.c: Revise Tcl_Panic() calls ending with a
+ * generic/tkGeomerty.c: newline removing the newline, because
+ * generic/tkImgPhInstance.c: Tcl_Panic() outputs a final newline
+ * generic/tkMenu.c: already.
+ * generic/tkRectOval.c:
+ * generic/tkTextBTree.c:
+ * generic/tkWindow.c:
+ * unix/tkUnixRFont.c:
+ * win/tkWinColor.c:
+ * win/tkWinDraw.c:
+ * win/tkWinMenu.c:
+
+2010-11-18 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/winMain.c: [FRQ 491789]: "setargv() doesn't support a unicode
+ cmdline" now implemented for cygwin and mingw32 too.
+ * win/configure.in: Allow cross-compilation by default.
+ * win/configure (regenerated)
+
+2010-11-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: [FRQ 491789]: "setargv() doesn't support a unicode
+ cmdline" now implemented for mingw-w64
+ * win/configure (regenerated)
+ * win/winMain.c Workaround for bug in some versions of mingw-w64
2010-11-16 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinPort.h [Bug #3110161]: Extensions using TCHAR don't compile
+ * win/winMain.c Bring compilation under mingw-w64 a bit closer
+ * win/tcl.m4 to reality. See for what's missing:
+ https://sourceforge.net/apps/trac/mingw-w64/wiki/Unicode%20apps
+ * win/configure: (re-generated)
+ * win/tkWinPort.h: [Bug 3110161]: Extensions using TCHAR don't compile
on VS2005 SP1
-2010-11-04 Jan Nijtmans <nijtmans@users.sf.net>
+2010-11-10 Andreas Kupries <andreask@activestate.com>
+
+ * changes: Updates for 8.6b2 release.
- * library/msgs/de.msg: Updated German messages. Thanks to Ruediger
- Haertel. [Patch 2442309] [Bug 3102739].
+2010-11-06 Jan Nijtmans <nijtmans@users.sf.net>
-2010-10-23 Jan Nijtmans <nijtmans@users.sf.net>
+ * library/msgs/*.msg: Update NL catalog. For other languages,
+ sorting and fix some locations of "&".
- * win/rules.vc Update for VS10
+2010-11-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/demos/widget: Use unicode copyright sign, instead of
+ * library/demos/en.msg: depending on translation.
+ * library/demos/nl.msg:
+ * generic/tkMain.c: Sync TK_ASCII_MAIN usage with tclMain.c
+
+2010-11-04 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.6b2 release.
+
+2010-11-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinClipboard.c: [FRQ 2965056]: Windows build with
+ * win/tkWinDialog.c: -DUNICODE
+ * win/tkWinMenu.c:
+
+2010-10-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkDecls.h: [FRQ 491789]: "setargv() doesn't support a
+ * doc/Tk_Main.3: unicode cmdline" implemented for Tk on MSVC++
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/winMain.c:
+ * win/rules.vc: Update for VS10
2010-10-11 Joe English <jenglish@users.sourceforge.net>
- * generic/ttk/ttkTreeview.c: Fix crash in 'tag add' / 'tag remove'
- commands when no -tags specified [Bug 3085489].
+ * generic/ttk/ttkTreeview.c: [Bug 3085489]: Fix crash in 'tag add' /
+ 'tag remove' commands when no -tags specified.
+
+2010-10-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinMenu.c: [FRQ 2965056]: Windows build with -DUNICODE
+ * win/tkWinWm.c:
+ * win/tcl.m4: Add netapi32 to the link line, so we no longer
+ * win/makefile.vc: have to use LoadLibrary to access those
+ * win/configure: functions.
+
+2010-10-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinClipboard.c: [FRQ 2965056]: Windows build with
+ * win/tkWinColor.c: -DUNICODE
+ * win/tkWinCursor.c:
+ * win/tkWinFont.c:
+ * win/tkWinTest.c:
+ * win/tkWinMenu.c:
+ * win/tkWinPixmap.c:
+ * win/tkWinX.c: Eliminate isWinNT variable
+ * win/Makefile.in (genstubs): Generate ttk files as well.
2010-10-06 Donal K. Fellows <dkf@users.sf.net>
* win/Makefile.in (genstubs): [Tcl Bug 3082049]: Typo.
-2010-09-08 Joe English <jenglish@users.sourceforge.net>
+2010-10-05 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/ttk/ttkTreeview.c (TreeviewSeeCommand): [Bug 2829363]:
- Schedule redisplay if [$tv see] opens any items.
+ * generic/tkWinX.c: [Bug 3080953]: Malformed Unicode characters in %A
+ substitution Problem was in the static function GetTranslatedKey().
-2010-09-02 Joe English <jenglish@users.sourceforge.net>
+2010-10-01 Donal K. Fellows <dkf@users.sf.net>
- * library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl,
- * library/ttk/vistaTheme.tcl: [Bug 3057573]: Specify disabled combobox
- text foreground color.
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
+ [Bug 3078902]: Ensure that zero-dimensioned data blocks cause no
+ changes at all instead of causing a hang.
+
+2010-09-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Sync with Tcl version
+ * unix/configure: Re-generate with autoconf-2.59
+ * win/configure:
+ * generic/tkMain.c Make compilable with -DUNICODE as well
+
+2010-09-28 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinSend.c: [Bug 3076671]: CVS HEAD Tk build fails on win32
+ with msys/mingw. Make it compile on older mingw as well.
+ * generic/tk.decls: Add explicit scspec "EXTERN", as in Tcl
+ * generic/tkInt.decls:
+ * generic/tkStubInit.c: Don't let Tk_MainEx macro disturb compilation
+
+2010-09-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: Add -Wdeclaration-after-statement
+ * win/configure: (regenerated)
+ * win/tkWinX.c: Make compilable with -DUNICODE.
+ * win/winMain.c:
+ * unix/tkAppInit.c: Many clean-ups in comments, so all
+ (tcl|tk)AppInit.c variants use the same style.
+ * generic/ttk/ttkGenStubs.tcl: Dummy genStubs::export (from
+ genStubs.tcl)
-2010-09-01 Don Porter <dgp@users.sourceforge.net>
+2010-09-20 Jan Nijtmans <nijtmans@users.sf.net>
- *** 8.5.9 TAGGED FOR RELEASE ***
+ * generic/ttk/ttkGenStubs.tcl: Clean-up, port all genStubs.tcl changes
+ * generic/ttk/ttk.decls: from Tcl to ttkGenStubs.tcl as well (no
+ * generic/tk.decls: change in any output files). This brings
+ * generic/tkInt.decls: all *.decls in the same form as tcl.decls
- * changes: Updated for 8.5.9 release.
+2010-09-16 Jeff Hobbs <jeffh@ActiveState.com>
- * doc/menu.n: Formatting error.
+ * win/tkWinX.c (_WIN32_IE): update to IE5.5 base expectation
-2010-09-01 Joe English <jenglish@users.sourceforge.net>
+2010-09-14 Jan Nijtmans <nijtmans@users.sf.net>
- * library/ttk/entry.tcl: Revert keyboard navigation bindings
- to use real events instead of virtual events.
+ * win/rules.vc [FRQ 2965056]: Windows build with -DUNICODE
+ * win/Makefile.in
+
+2010-09-13 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWin.h Move definitions of WINVER/_WIN32_WINNT
+ * win/tkWinDialog.h to one place, now that we only support
+ * win/tkWinMenu.c Win2000+
+ * win/tkWinX.c
+
+2010-09-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinEmbed.c: Make compilable with -DUNICODE
+ * win/tkWinClipboard.c: Mark those files as not compilable with
+ * win/tkWinColor.c: -DUNICODE, so add a TODO.
+ * win/tkWinCursor.c:
+ * win/tkWinDialog.c:
+ * win/tkWinFont.c:
+ * win/tkWinMenu.c:
+ * win/tkWinPixmap.c:
+ * win/tkWinTest.c:
+ * win/tkWinWm.c:
+ * win/tkWinX.c:
+ * win/winMain.c:
+ * win/tkWinPort.h: mingw/cygwin fixes: <tchar.h> should always
+ be included here.
+
+2010-09-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/rules.vc: (sync with tcl version)
+ * win/makefile.vc: mingw should always link with -ladvapi32
+ * win/tcl.m4:
+ * win/configure: (regenerated)
+ * win/tkWinInt.h: Remove ascii variant of tkWinPocs table,
+ * win/tkWinX.c: it is no longer necessary.
+ * win/tkWinTest.c:
+
+2010-09-08 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c (TreeviewSeeCommand): [Bug 2829363]:
+ Schedule redisplay if [$tv see] opens any items.
+
+2010-09-05 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/bgerror.tcl: [Bugs 3046742,3046750]: Improve keybindings for
+ the background error dialog, and allow the use of the window manager
+ controls for closing it (where supported). The Escape key now causes
+ all remaining background error messages in the queue to be dropped.
+
+2010-09-02 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl,
+ * library/ttk/vistaTheme.tcl: [Bug 3057573]: Specify disabled combobox
+ text foreground color.
2010-08-31 Andreas Kupries <andreask@activestate.com>
- * win/tcl.m4: Applied patch by Jeff fixing issues with the
- manifest handling on Win64.
+ * win/tcl.m4: Applied patch by Jeff fixing issues with the manifest
+ handling on Win64.
* win/configure: Regenerated.
2010-08-26 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkText.c (DumpLine): [Bug 3053347]:
- s/segPtr->size/currentSize/ throughout, but particularly in if
- lineChanged block where segPtr may no longer be valid.
-
- * unix/Makefile.in: add valgrind target
+ * unix/Makefile.in: Add valgrind target
* unix/configure, unix/tcl.m4: [Bug 1230554]: SHLIB_LD_LIBS='${LIBS}'
for OSF1-V*. Add /usr/lib64 to set of auto-search dirs.
(SC_PATH_X): Correct syntax error when xincludes not found.
* win/Makefile.in (VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE):
- * win/configure, win/configure.in, win/tcl.m4: SC_EMBED_MANIFEST
- macro and --enable-embedded-manifest configure arg added to support
- manifest embedding where we know the magic. Help prevents DLL hell
- with MSVC8+.
-
-2010-08-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/ttk_spinbox.n (new), doc/ttk_*.3, doc/ttk_*.n:
- * generic/ttk/ttkGenStubs.tcl:
- * generic/ttk/ttk.decls, generic/ttk/ttkDecls.h:
- * generic/ttk/ttkButton.c, generic/ttk/ttkCache.c:
- * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
- * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkElements.c:
- * generic/ttk/ttkEntry.c, generic/ttk/ttkFrame.c:
- * generic/ttk/ttkImage.c, generic/ttk/ttkInit.c:
- * generic/ttk/ttkLabel.c, generic/ttk/ttkLayout.c:
- * generic/ttk/ttkNotebook.c, generic/ttk/ttkPanedwindow.c:
- * generic/ttk/ttkProgress.c, generic/ttk/ttkScale.c:
- * generic/ttk/ttkScroll.c, generic/ttk/ttkScrollbar.c:
- * generic/ttk/ttkSeparator.c, generic/ttk/ttkSquare.c:
- * generic/ttk/ttkState.c, generic/ttk/ttkStubInit.c:
- * generic/ttk/ttkStubLib.c, generic/ttk/ttkTagSet.c:
- * generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h:
- * generic/ttk/ttkThemeInt.h, generic/ttk/ttkTrace.c:
- * generic/ttk/ttkTrack.c, generic/ttk/ttkTreeview.c:
- * generic/ttk/ttkWidget.c, generic/ttk/ttkWidget.h:
- * library/ttk/spinbox.tcl (new):
- * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl:
- * library/ttk/button.tcl, library/ttk/clamTheme.tcl:
- * library/ttk/classicTheme.tcl, library/ttk/combobox.tcl:
- * library/ttk/cursors.tcl, library/ttk/defaults.tcl:
- * library/ttk/entry.tcl, library/ttk/notebook.tcl:
- * library/ttk/panedwindow.tcl, library/ttk/scale.tcl:
- * library/ttk/sizegrip.tcl, library/ttk/treeview.tcl:
- * library/ttk/ttk.tcl, library/ttk/utils.tcl:
- * library/ttk/vistaTheme.tcl, library/ttk/winTheme.tcl:
- * library/ttk/xpTheme.tcl:
- * macosx/ttkMacOSXTheme.c: used 8.6/carbon variant
- * tests/ttk/combobox.test, tests/ttk/treetags.test:
- * tests/ttk/treeview.test, tests/ttk/ttk.test:
- * tests/ttk/vsapi.test:
- * tests/ttk/checkbutton.test (new):
- * tests/ttk/radiobutton.test (new):
- * tests/ttk/spinbox.test (new):
- * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c:
- Major backport of 8.6 Ttk for 8.5.9. Most changes were only being
- committed to head (8.6), although they could apply for 8.5 as well.
- This re-sync makes future work easier to maintain and adds some
- useful work for 8.5 users. [Bug 3053320]: Notable changes:
- - Lots of code cleanup
- - Some bug fixes never backported
- - Addition of ttk::spinbox
- - minor color changes
- - Improved Vista/7 styling
- - Move to tile version 0.8.6 (pseudo-package)
- - ABI and API compatible (even $w identify)
- - minor new features (extended $w identify)
-
-2010-08-03 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updated for 8.5.9 release.
-
-2010-08-20 Donal K. Fellows <dkf@users.sf.net>
-
- * doc/listbox.n (SEE ALSO): [Bug 3048809]: Corrected what other page
- was referred to (ttk::treeview can work as a listbox).
-
-2010-08-12 Donal K. Fellows <dkf@users.sf.net>
-
- * library/text.tcl (TextCursorInSelection): [Patch 2585265]: Backport
- of factoring-out of decision logic for whether to delete the selected
- text.
+ * win/configure, win/configure.in, win/tcl.m4: SC_EMBED_MANIFEST macro
+ and --enable-embedded-manifest configure arg added to support manifest
+ embedding where we know the magic. Help prevents DLL hell with MSVC8+.
+
+ * generic/tkText.c (DumpLine): [Bug 3053347]: Replace segPtr->size
+ with currentSize throughout, but particularly in if lineChanged block
+ where segPtr may no longer be valid.
+
+2010-08-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tk*Decls.h: (regenerated with modified genStubs.tcl)
+ * generic/tk*StubInit.c
+
+2010-08-18 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkGenStubs.tcl: [Patch 3034251]: partly: remove some
+ more unneeded ifdeffery, as in tcl/tools/genStubs.tcl.
+ * generic/tk.h: Move USE_OLD_IMAGE support after tkDecls.h
+ * generic/*Decls.h (regenerated)
+ * generic/ttk/ttkDecls.h
2010-08-11 Jeff Hobbs <jeffh@ActiveState.com>
- * win/Makefile.in (%.${OBJEXT}): better implicit rules support
+ * win/Makefile.in (%.${OBJEXT}): Better implicit rules support
* unix/configure: regen with ac-2.59
* unix/configure.in, unix/Makefile.in:
- * unix/tcl.m4 (AIX): remove the need for ldAIX, replace with
+ * unix/tcl.m4 (AIX): Remove the need for ldAIX, replace with
-bexpall/-brtl. Remove TK_EXP_FILE (export file) and other baggage
that went with it. Remove pre-4 AIX build support.
-2010-08-11 Donal K. Fellows <dkf@users.sf.net>
+2010-08-11 Don Porter <dgp@users.sourceforge.net>
- * generic/tkCanvLine.c (LineDeleteCoords): [Bug 2900121]: Backport of
- fix to sense of test.
-
-2010-08-10 Don Porter <dgp@users.sourceforge.net>
-
- * library/msgs/pl.msg: Backport updates to pl.msg from HEAD
+ * changes: Updates for 8.6b2 release.
2010-08-04 Jeff Hobbs <jeffh@ActiveState.com>
- * license.terms: Fix DFARs note for number-adjusted rights clause
-
-2010-08-04 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tk.h: Bump to 8.5.9 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
- * README:
-
- * unix/configure: autoconf-2.59
- * win/configure:
-
- * changes: Updated for 8.5.9 release.
+ * license.terms: fix DFARs note for number-adjusted rights clause
2010-08-03 Jeff Hobbs <jeffh@ActiveState.com>
* library/button.tcl (::tk::CheckEnter): [AS Bug#87409]: Use uplevel
set instead of set :: to work with other var resolvers (itcl).
-2010-08-03 Don Porter <dgp@users.sourceforge.net>
+2010-07-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgGIF.c (StringWriteGIF): Added ability to write a GIF to
+ a string (as a byte array, of course) following comments on c.l.t by
+ Aric Bills. Also improved readability of some of the function and
+ field names in this file.
- * changes: Updated for 8.5.9 release.
+2010-07-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkDecls.h: [Tcl Bug 3029891]: Functions that don't belong in
+ the stub table (Tk part, not really removed from the stub table, just
+ disabled)
+ * generic/tkMain.c: [Bug 3027438]: Tk_Main calls Tcl_CreateInterp
+ * generic/tk.h: before Tcl_FindExecutable
2010-07-06 Andreas Kupries <andreask@activestate.com>
* doc/text.n: Fixed minor typo in the description of 'text delete', as
reported by <eee@users.sf.net> on the chat.
-2010-05-31 Joe English <jenglish@users.sourceforge.net>
+2010-07-01 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/rules.vc: [Bug 3020677]: wish can't link reg1.2
+
+2010-06-22 Anton Kovalenko <a_kovalenko@users.sf.net>
+
+ * generic/tkPlace.c: [Patch 3019624]: modify "place" command, making
+ it get main window through ClientData (like grid or pack do), instead
+ of calling Tk_MainWindow(interp).
+ * generic/tkWindow.c: modify "place" entry in commands[], turn on
+ passMainWindow flag.
+
+2010-06-22 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkGenStubs.tcl: [Bug 3019363]: "make genstubs" failure
+ * generic/ttk/ttkDecls.h: (regenerated)
+ * generic/ttk/ttkTheme.c: Unnecessary type cast
+
+2010-06-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkInt.decls: [Patch 2999889]: TkCopyAndGlobalEval obsolete
+ * generic/tkIntDecls.h
+ * generic/tkBind.c
+ * generic/tkStubInit.c
+
+2010-06-19 Joe English <jenglish@users.sourceforge.net>
+
+ * win/tkWinScrlbr.c, carbon/tkMacOSXScrlbr.c: Replace binding
+ procedures with ordinary event handlers [Patch 3009998].
+ * generic/tkBind.c, generic/tk.h, generic/tkInt.h,
+ * generic/tkInt.decls: Simplifications enabled by previous change:
+ TkCreateBindingProcedure() and associated machinery no longer needed;
+ TkBindDeadWindow() no longer needed; TK_DEFER_MODAL_LOOP and
+ associated machinery no longer needed.
+ * generic/tkTest.c, tests/bind.test: Tests related to C binding
+ procedures no longer needed.
+ * generic/tkWindow.c: TkBindDeadWindow() no longer needed.
+ * generic/tkIntDecls.h, generic/tkStubInit.c: Regenerated.
+
+2010-06-15 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/ttk.tcl: Bump dummy [package ifneeded tile] version to
+ 0.8.6; see [Bug 3016598].
+
+2010-06-15 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/text.tcl (TextCursorInSelection): [Patch 2585265]: Make it
+ so that pressing delete or backspace when the primary selection does
+ not include the insertion cursor does not cause the deletion of the
+ inserted text.
+
+2010-06-15 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkCanvArc.c: Eliminate many unnecessary (ClientData) type
+ * generic/tkCanvas.c: casts.
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvTest.c:
+ * generic/tkCanvWind.c:
+ * generic/tkRectOval.c:
+ * generic/tkScrollbar.c:
+ * generic/tkStyle.c:
+ * generic/tkTest.c:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixEvent.c:
+ * unix/tkUnixScale.c:
+ * unix/tkUnixScrlbr.c:
+ * unix/tkUnixSelect.c:
+ * unix/tkUnixWm.c:
+ * carbon/tkMacOSXDialog.c: Terminate TkEnsemble definition with NULL
+ * macosx/tkMacOSXDialog.c:
+
+2010-05-31 Joe English <jenglish@users.sourceforge.net>
* generic/tkBind.c (Tk_CreateBinding): [Bug 3006842]: Silently ignore
- empty binding scripts.
- * generic/ttk/ttkTreeview.c: [$tv tag bind $tag <...> {}] now removes
- binding.
+ empty scripts.
+
+2010-05-27 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c, tests/ttk/treeview.test:
+ [$tv tag bind $tag <...> {}] now removes binding completely.
+ Fixes [Bug 3006842] (although there's still a problem somewhere
+ in Tk_CreateBinding()).
-2010-05-31 Jan Nijtmans <nijtmans@users.sf.net>
+2010-05-26 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkMain.c: Fix CYGWIN warning: "fd_set and assiciated.macros
- have been defined in sys/types. This may cause runtime problems with
- W32"
- * win/winMain.c: Add command line processing for CYGWIN, backported
- from trunk.
+ * tests/wm.test: Fix 3 tests on Ubuntu 10.4, two of them timing
+ dependent, one wm-dependent.
+ * generic/tkText.c: Fix some gcc strict-aliasing warnings,
+ * unix/tkUnixFont.c: discovered with "-Wstrict-aliasing=2"
+ * unix/tkUnixSelect.c:
2010-05-20 Donal K. Fellows <dkf@users.sf.net>
@@ -450,15 +780,54 @@
places that generate key events zero them out first; Tk relies on that
being true for the generic parts of the fix for Bug 1924761.
-2010-05-19 Jan Nijtmans <nijtmans@users.sf.net>
+2010-05-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinDialog.c: Fix [Bug 3002230]: tk_chooseDirectory returns
+ garbage on cancel
+
+2010-05-17 Joe English <jenglish@users.sourceforge.net>
- * win/tkWinDialog.c: [Bug 3002230]: tk_chooseDirectory returns garbage
- on cancel.
+ * generic/tkBind.c: Revert [Patch 2999920], as it entails an
+ incompatible change to the C API is and is the cause of [Bug 3002768].
2010-05-17 Jan Nijtmans <nijtmans@users.sf.net>
+ * generic/tkBind.c: [Patch 2999920]: Optimize Internal Virtual event
+ string operations.
* win/tkWinDialog.c: [Bug 2987995]: Tk_getOpenFile returns garbage
- under described circumstances. Backported some formatting from trunk.
+ under described circumstances
+
+2010-05-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * doc/RestrictEv.3: Consistent use of variable names in RestrictEvent
+ * generic/tkGrab.c: API documentation and implementation: Use 'prev'
+ * unix/tkUnixDraw.c: instead of 'old', and 'arg' instead of
+ * unix/tkUnixSend.c: 'clientData' everywhere, just as in tkEvent.c.
+ * unix/tkUnixWm.c
+
+2010-05-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * doc/BindTable.3: Bring in line with actual implementation.
+ * generic/tk.decls: Change Tk_CreateBinding param name, as in doc
+ * generic/tkInt.decls: CONSTify TkCopyAndGlobalEval,
+ * generic/tkBind.c: TkpSetMainMenubar, TkpMenuNotifyToplevelCreate,
+ * generic/tkMenu.c: and TkSetWindowMenuBar
+ * generic/tkDecls.h: (regenerated)
+ * generic/tkIntDecls.h: (regenerated)
+ * carbon/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenu.c:
+ * unix/tkUnixMenu.c:
+ * win/tkWinMenu.c:
+
+2010-05-03 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump patchlevel to 8.6b1.2 to distinguish
+ * library/tk.tcl: CVS snapshots from earlier snapshots as well
+ * unix/configure.in: as the 8.6b1 and 8.6b2 releases.
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
2010-05-03 Donal K. Fellows <dkf@users.sf.net>
@@ -466,49 +835,214 @@
Apply a bit more care to ensure that things continue to work correctly
even when there is no -selectcolor defined.
+2010-04-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWin.h: Unnecessary TCL_STORAGE_CLASS re-definition
+ * win/tkWinInt.h: Make various functions MODULE_SCOPE
+ * win/tkWinButton.c: TCHAR-related fixes, making al those
+ * win/tkWinFont.c: files compile fine when TCHAR != char.
+ * win/tkWinScrlbr.c:
+ * win/tkWinWindow.c:
+ * win/tkWinWm.c:
+ * win/tkWinX.c:
+ * win/ttkWinMonitor.c:
+ * win/ttkWinXPTheme.c:
+
+2010-04-25 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPNG.c (ReadIDAT, DecodePNG): Move the check for overall
+ termination of the compressed stream until after the final IDAT has
+ been read, so that multi-segment images will work right. Reported by
+ Andy Goth on the Wiki.
+
+2010-04-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkImgGIF.c: Formatting
+ * generic/tkListbox.c: fix typo;
+ * generic/tkTrig.c: fix typo;
+ * generic/tkInt.h: fix typo; remove not existing tkDisplayList;
+ * generic/*.h: Useless re-definitions of TCL_STORAGE_CLASS
+
+2010-04-20 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkPort.h: Make sure that tkWinPort.h is always
+ * generic/tkIntXlibDecls.h: included before tcl.h, otherwise the
+ * win/tkWinPort.h: fallback for TCHAR might go off before the
+ inclusion of <tchar.h>
+ * win/tkWinDialog.c: Define OPENFILENAME_SIZE_VERSION_400 if
+ needed.
+ * compat/stdlib.h: Include <tcl.h> only when not already
+ * compat/unistd.h: done.
+ * generic/tkInt.h: tkPort.h already includes tk.h, which
+ includes tcl.h.
+ * generic/tk3d.h: Always use #include "tkInt.h", not
+ * generic/tkColor.h: <tkInt.h>
+ * xlib/xcolors.c:
+ * xlib/xgc.c:
+
2010-04-19 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinPort.h: Fix [Patch 2986105]: conditionally defining
- strcasecmp/strncasecmp
* win/tkWinDialog.c: Fix [Bug 2987995]: Tk_GetOpenFile returns garbage
- under described circumstances, minor formatting.
+ under described circumstances.
* win/tkWinDialog.c: [Patch 2898255]: Filenames limit with
Tk_GetFileName().
Assure modern style dialogs where available
+2010-04-13 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinPort.h Fix [Patch 2986105]: conditionally defining
+ strcasecmp/strncasecmp
+
+2010-04-12 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPNG.c (WriteIDAT): [Bug 2984787]: Use the correct
+ flushing semantics when handling the last data from the image. Without
+ this, many PNG readers (notably including Firefox) refuse to show the
+ image and instead complain about errors.
+ (ReadIDAT): Added sanity checks to ensure that when we've got bad data
+ of the sorts of forms we were previously generating, we detect it and
+ error out rather than silently failing.
+ (WriteExtraChunks): New function to write in some basic metadata.
+
+2010-04-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * doc/photo.n: Follow-up to [Bug 2983824]: update doc.
+
+2010-04-09 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): [Bug 2983824]: Use the file
+ extension to guess the output format to use if one isn't specified.
+
+2010-04-08 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinPort.h: Add <wchar.h> to tkWinPort.h, and
+ * win/tkWinSend.c: remove some earlier CYGWIN-related
+ * win/tkWinSendCom.c: hacks which are no longer necessary.
+
+2010-04-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: Sync with Tcl version
+ * unix/tcl.m4:
+ * win/configure: (regenerate with autoconf-2.59)
+ * unix/configure: [Bug 2982540]: configure and install* script
+ files should always have LF
+
+2010-03-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Only test for -visibility=hidden with gcc
+ (Second remark in [Bug 2976508])
+ * unix/configure: regen
+
+2010-03-29 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixRFont.c (GetFont): [Bug 2978410]: Do not use non-constant
+ initializers for structures, since HP-UX cc doesn't like it.
+
+2010-03-28 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTagSet.c, generic/ttk/ttkTheme.c,
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkTreeview.c,
+ * generic/ttk/ttkWidget.h, doc/ttk_treeview.n,
+ * tests/ttk/treetags.test: ttk::treeview widget: add 'tag names',
+ 'tag add', and 'tag remove' methods.
+
+2010-03-23 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/configure.in, unix/Makefile.in: [Bug 2965133]: Get rid of the
+ spurious NONE and some pointless quotes that were causing problems
+ with building Tk on OSX. Overall bug might not yet be solved.
+
+2010-03-17 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/entry.tcl: [Bug 2971663]: Make the <Up> and <Down> keys
+ * library/ttk/entry.tcl: explicitly do nothing, since Tk-on-Cocoa will
+ generate (invisible zero-width) characters for them otherwise. The
+ explicitly empty bindings are harmless on other platforms.
+
+2010-03-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/.cvsignore: Ignore .a and .so
+
2010-03-12 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkButton.h: [Bug 2956548]: TkpButtonSetDefaults only
- * generic/tkButton.c: initializes one button type
- * win/tkWinButton.c:
- * win/tkWinEmbed.c: Fix various gcc warnings, all
- * win/tkWinMenu.c: backported from Tk 8.6
- * win/tkWinPixmap.c:
- * win/tkWinSend.c:
- * win/tkWinTest.c:
- * win/tkWinWm.c:
- * win/tkWinX.c:
- * win/tkWinInt.h: VC6++ does not have SPI_SETKEYBOARDCUES
+ * win/rules.vc: Fix [Tcl Bug 2967340]: Static build failure
+ * win/makefile.vc:
* win/.cvsignore:
+2010-03-12 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/iconlist.tcl: Factor out some of the machinery for
+ * library/megawidget.tcl: making a megawidget framework. Not a
+ public API at the moment.
+
2010-03-11 Donal K. Fellows <dkf@users.sf.net>
* generic/tkText.c (DumpLine): [Bug 2968379]: When peers are about,
there can be unnamed marks present during a dump. Ignore them as they
will just be for the peers' insert and current marks, which aren't
very important.
+ (DumpLine): Removed lame reliance on the leading letters of the names
+ of segment types. Entailed expanding the scope of the declarations of
+ the types of embedded images and windows.
+
+2010-03-08 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkPlatDecls.h: [Bug 2965600]: Correct broken 2886635 fix.
+
+2010-03-06 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/menu.tcl: [Bug 2949774]: When using the non-ClickToFocus
+ menu mode cascade menus should popdown once the pointer moves to
+ another entry to be compatible with current X desktop usage.
+
+2010-03-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/configure.in: Don't use -fvisibility=hidden
+ * unix/tcl.m4: for cygwin.
+ * win/tkWinTest.c: Make tkTestWinProcs const
2010-03-04 Donal K. Fellows <dkf@users.sf.net>
* doc/clipboard.n: Added note about STRING vs. UTF8_STRING types.
+2010-03-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: [Tcl FRQ 2959069]: Support for -fvisibility=hidden
+ * unix/configure: (regenerated with autoconf-2.59)
+
+2010-02-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/configure.in: Use @EXEEXT@ in stead of @EXT_SUFFIX@
+ * unix/tcl.m4:
+ * unix/Makefile.in: Use -DBUILD_tk
+ * unix/configure: (regenerated)
+ * generic/tkConfig.c: Make internal Tk_ObjCustomOption const
+ * generic/tkPanedWindow.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+
2010-02-21 Donal K. Fellows <dkf@users.sf.net>
* generic/tkText.c (TextEditCmd): [Bug 1799782]: Refix this, so that
- <<Modified>> events are issued when things change.
+ <<Modified>> events are issued when things change.
+
+2010-02-20 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c: Cache the result of the last call to
+ EndPosition() to avoid quadratic-time behavior in the common cases
+ where the treeview is populated in depth-first or breadth-first
+ order.
+
+2010-02-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinColor.c: remove unused "dataKey" variable
2010-02-19 Donal K. Fellows <dkf@users.sf.net>
+ * unix/configure.in, unix/Makefile.in: [Bug 2415437]: Corrections to
+ allow installation of Tcl and Tk to different directories, especially
+ when neither is a system standard location. Also [Tcl Bug 2307398].
+
* unix/installManPage: [Tcl Bug 2954638]: Correct behaviour of manual
page installer. Also added armouring to check that assumptions about
the initial state are actually valid (e.g., look for existing input
@@ -520,32 +1054,176 @@
OpenBSD.
* configure: (regenerated).
+2010-02-18 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkButton.h: Put all Tk_OptionSpec for buttons and labels
+ * generic/tkButton.c: in const memory. With some changes to win32
+ * win/tkWinButton.c: and macosx, preventing direct writes to
+ * unix/tkUnixPort.h: read-only memory.
+ * carbon/tkMacOSXPort.h:
+ * macosx/tkMacOSXButton.c:
+
2010-02-17 Joe English <jenglish@users.sourceforge.net>
* generic/tkMenu.c: [Bug 2952745]: Defer TkMenuOptionTables cleanup to
CallWhenDeleted() time, to ensure that the record doesn't get freed
until after all widget instance commands have been deleted.
+2010-02-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tk.decls: CONSTify everything related to Tk_ConfigSpec
+ * generic/tk.h:
+ * generic/tkCanvArc.c: Many tables can now be put in const memory
+ * generic/tkCanvas.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvPs.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkOldConfig.c:
+ * generic/tkRectOval.c:
+ * generic/tkScrollbar.c:
+ * generic/tkScrollbar.h:
+ * generic/tkDecls.h: (regenerated)
+ * doc/CanvTkwin.3:
+ * doc/ConfigWidg.3:
+ * doc/CrtItemType.3:
+ * win/tkWinScrlbr.c:
+ * carbon/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXScrlbr.c:
+
2010-02-16 Jan Nijtmans <nijtmans@users.sf.net>
- * unix/tkUnixWm.c: Make TkSetTransientFor static
+ * generic/tkWindow.c: Reverted rename from tkStubs to tkConstStubs
+ * generic/tkStubInit.c: (regenerated)
+ * generic/tkArgv.c: make defaultTable const
+ * generic/tkScrollbar.c:Store default for "-with" in static non-const
+ space
+ * win/tkWinInt.h: Make tkWinProcs const, and 5 procs
+ * win/tkWinX.c: MODULE_SCOPE.
+ * win/tkWinColor.c: Make sysColors const.
+ * win/tkWinKey.c: Make keymap const.
+ * win/tkWinScrlbr.c: Simplify copying of "-with" default value.
+ * unix/tkUnixWm.c: Make TkSetTransientFor static.
+ * tests/textImage.test: textImage-1.13 depends on hash-order
+
+2010-02-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: Use -pipe for gcc on win32
+ * win/configure: (mingw/cygwin) (regenerated)
+ * unix/tkUnixColor.c: Make sure that TkpCmapStressed is exported
+ * generic/tkImgPhoto.c: Clean up unused Tk_CreatePhotoOption
+ * generic/tkBind.c: Make more internal arrays "const"
+ * generic/tkBusy.c:
+ * generic/tkButton.c:
+ * generic/tkEvent.c:
+ * generic/tkGrab.c:
+ * generic/tkImgBmap.c:
+ * generic/tkObj.c:
+ * generic/tkOption.c:
+ * generic/tkPanedWindow.c:
+ * generic/tkPointer.c:
+ * generic/tkWindow.c:
+ * generic/tkImgPhoto.c: Eliminate never used Tk_CreatePhotoOption()
-2010-02-07 Jan Nijtmans <nijtmans@users.sf.net>
+2010-02-05 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/ttk/ttkGenStubs.tcl: Backport various formatting (spacing)
- * generic/ttk/ttk.decls: changes from HEAD, so diffing
- * generic/ttk/ttkDecls.h: between 8.5.x and 8.6 shows the
- * generic/tk*.decls: real structural differences again.
- * generic/tk*Decls.h: (any signature change not backported!)
+ * carbon/tkMacOSXDialog.c: Make more internal tables "const"
+ * macosx/tkMacOSXDialog.c:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinDialog.c:
+ * generic/tkWindow.c:
+ * generic/tk*Decls.h: (regenerated with new
+ * generic/tkStubInit.c: genStubs.tcl from Tcl)
+
+2010-02-05 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/*.[ch]: Revert contravariant const qualifiers added by
+ the previous commit to keep codebase in sync with the Tile extension,
+ which must remain 8.4 compatible.
+
+2010-02-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkGenStubs.tcl: Follow-up to [2010-01-29] commit:
+ prevent space within stub table function parameters if the
+ parameter type is a pointer. Make the various stub tables and
+ hook pointers const, just as Tcl and Tk.
+ * generic/ttk/ttkDecls.h: (regenerated)
+ * generic/ttk/ttkStubInit.c: (regenerated)
+ * generic/ttk/ttk.decls: Minor formatting
+ * generic/ttk/ttkButton.c: Make more internal tables "const"
+ * generic/ttk/ttkDefaultTheme.c:
+ * generic/ttk/ttkEntry.c:
+ * generic/ttk/ttkImage.c:
+ * generic/ttk/ttkInit.c:
+ * generic/ttk/ttkLayout.c:
+ * generic/ttk/ttkNotebook.c:
+ * generic/ttk/ttkPanedWindow.c:
+ * generic/ttk/ttkProgress.c:
+ * generic/ttk/ttkStubLib.c:
+ * generic/ttk/ttkTheme.c:
+ * generic/ttk/ttkTreeview.c:
+ * generic/ttk/ttkWidget.c:
+ * generic/ttk/ttkWidget.h:
+
+2010-01-31 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkWidget.h, generic/ttk/*.c:
+ Change signature of widget subcommand procedures to match
+ Tcl_ObjCmdProc. Merge now-redundant ensemble dispatch code.
2010-01-29 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkBind.c: Fix various gcc-4.4 warnings, all
- * generic/tkListbox.c: backported from HEAD.
- * generic/tkText.c:
+ * generic/ttk/ttkGenStubs.tcl: No longer generate a space after "*"
+ and immediately after a function name, so the
+ format of function definitions in *Decls.h
+ match all other *.h header files.
+ * generic/ttk/ttkDecls.h: (re-generated)
+ * generic/tk.decls: Formatting
+ * generic/tkDecls.h: (re-generated)
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkBind.c: Little simplification
+
+2010-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkInt.h: Don't depend on <stdio.h> from tcl.h any
+ * generic/tkOldConfig.c: more.
+ * generic/ttk/ttkClamTheme.c: Fix more gcc warnings: missing
+ * generic/ttk/ttkClassicTheme.c: initializer.
+ * generic/ttk/ttkDefaultTheme.c:
+ * generic/ttk/ttkElements.c:
+ * generic/ttk/ttkEntry.c:
* generic/ttk/ttkInit.c:
+ * generic/ttk/ttkLabel.c:
+ * generic/ttk/ttkNotebook.c:
+ * generic/ttk/ttkPanedwindow.c:
+ * generic/ttk/ttkSquare.c:
+ * generic/ttk/ttkTreeview.c:
+ * win/ttkWinTheme.c:
+ * win/tkWinMenu.c: Add missing #include <string.h>
+ * win/tkWinPort.h: Fix include files for CYGWIN
+ * win/tkWinSend.c:
+ * win/tkWinSendCom.c:
+ * win/tkWinTest.c: Fix gcc warning
+ * win/winMain.c: Eliminate use of __argc and __argv for CYGWIN
+ * win/tcl.m4: Make cygwin configuration error into
+ * win/configure.in: a warning: CYGWIN compilation works
+ * win/configure: although there still are test failures.
-2010-01-20 Pat Thoyts <patthoyts@users.sourceforge.net>
+2010-01-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkCanvas.c (TagSearchScanExpr): [Bug 2931374]: Stop overflow
+ of working buffer during construction of long tag expressions.
+
+2010-01-19 Pat Thoyts <patthoyts@users.sourceforge.net>
* library/bgerror.tcl: [TIP 359]: Extended Window Manager Hints
* library/clrpick.tcl: following the freedesktop.org specification
@@ -558,15 +1236,85 @@
* tests/wm.test:
* unix/tkUnixWm.c:
-2010-01-19 Donal K. Fellows <dkf@users.sf.net>
+2010-01-18 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkCanvas.c (TagSearchScanExpr): [Bug 2931374]: Stop overflow
- of working buffer during construction of long tag expressions.
+ * generic/tkCanvArc.c: Fix more gcc warnings: missing initializer
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvPs.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCmds.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgGIF.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkImgPNG.c:
+ * generic/tkImgPPM.c:
+ * generic/tkMenu.c:
+ * generic/tkMenubutton.c:
+ * generic/tkMessage.c:
+ * generic/tkOldTest.c:
+ * generic/tkPanedWindow.c:
+ * generic/tkRectOval.c:
+ * generic/tkScrollbar.c:
+ * generic/tkSquare.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextTag.c:
+ * generic/tkTextWind.c:
+ * generic/tkTrig.c:
+ * generic/tkCanvas.c: [Patch 2932808]: Canvas items not updating
+ on widget state change.
+
+2010-01-13 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkMenubutton.h: Eliminate tkpMenubuttonClass
+ * generic/tkButton.h make tkpButtonProcs CONST
+ * generic/tkBusy.c: fix gcc warning: missing initializer
+ * generic/tkButton.c
+ * generic/tkCanvas.c
+ * generic/tkConsole.c
+ * generic/tkEntry.c
+ * generic/tkFrame.c
+ * generic/tkListbox.c
+ * generic/tkMenu.c
+ * generic/tkMenubutton.c
+ * generic/tkMessage.c
+ * generic/tkScale.c
+ * generic/tkScrollbar.h
+ * generic/tkText.c
+ * generic/ttk/ttkWidget.c
+ * carbon/tkMacOSXButton.c
+ * carbon/tkMacOSXMenubutton.c
+ * carbon/tkMacOSXScrlbr.c
+ * macosx/tkMacOSXButton.c
+ * macosx/tkMacOSXMenubutton.c
+ * macosx/tkMacOSXScrlbr.c
+ * unix/tkUnixButton.c
+ * unix/tkUnixMenubu.c
+ * unix/tkUnixScrolbr.c
+ * win/tkWinButton.c
+ * win/tkWinDialog.c
+ * win/tkWinEmbed.c
+ * win/tkWinFont.c
+ * win/tkWinInit.c
+ * win/tkWinKey.c
+ * win/tkWinScrlbr.c
+ * win/tkWinInt.h Add SPI_SETKEYBOARDCUES definition, needed for
+ original VC++ 6.0.
-2010-01-18 Jan Nijtmans <nijtmans@users.sf.net>
+2010-01-10 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkCanvas.c: [Patch 2932808]: Canvas items not
- updating on widget state change.
+ * doc/SetClassProcs.3: CONSTify Tk_SetClassProcs
+ * generic/tk.decls
+ * generic/tkInt.h
+ * generic/tkWindow.c
+ * generic/tkDecls.h: (regenerated)
+ * unix/tcl.m4 Sync with Tcl version
+ * unix/configure (regenerated)
2010-01-09 Pat Thoyts <patthoyts@users.sourceforge.net>
@@ -574,8 +1322,8 @@
* library/obsolete.tcl: the .help menu on X11.
* unix/tkUnixMenu.c:
- * library/menu.tcl: [TIP 360]: Make Tk menu activation
- * library/obsolete.tcl: follow mouse movements.
+ * library/menu.tcl: [TIP 360]: Make Tk menu activation
+ * library/obsolete.tcl: follow mouse movements.
2010-01-08 Pat Thoyts <patthoyts@users.sourceforge.net>
@@ -589,26 +1337,32 @@
odd text widget update problem that had scrollbars being unable to
cover the whole widget. Fix is to reify the range to update sooner.
-2010-01-06 Jan Nijtmans <nijtmans@users.sf.net>
-
- * unix/tcl.m4: Sync with Tcl version
- * unix/configure: (regenerated)
- * unix/Makefile.in:
- * unix/.cvsignore:
- * generic/default.h: Trivial CYGWIN fixes
- * generic/tkWindow.c:
- * doc/.cvsignore:
-
2010-01-06 Donal K. Fellows <dkf@users.sf.net>
+ * library/tk.tcl: Centralize the definition of keys that
+ * library/entry.tcl: do common movement in entry and text
+ * library/spinbox.tcl: widgets. This is because they are
+ * library/text.tcl: subtlely different on the different
+ * library/ttk/entry.tcl: platforms. Lets Tk code work more
+ * doc/event.n (PREDEFINED VIRTUAL EVENTS): correctly with platform
+ conventions "out of the box".
+
+ * generic/tkBind.c (HandleEventGenerate, DoWarp): [Bug 2926819]:
+ * generic/tkInt.h (TkDisplay): Factor out the pointer
+ * generic/tkWindow.c (GetScreen): warping code a bit
+ * carbon/tkMacOSXMouseEvent.c (TkpWarpPointer): better and extend it
+ * macosx/tkMacOSXMouseEvent.c (TkpWarpPointer): to work on OSX too.
+ * unix/tkUnixEvent.c (TkpWarpPointer):
+ * win/tkWinPointer.c (TkpWarpPointer):
+
* unix/tkUnixWm.c (TkWmMapWindow): [Bug 1163496]: Allow windows to be
* tests/wm.test (wm-transient-8.1): set to be transients for withdrawn
masters correctly.
2010-01-05 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/tkWinDialog.c: [Patch 2898255]: Enable unlimited multiple
- file selection from the open files dialog (pawlak,fellows,thoyts)
+ * win/tkWinDialog.c: [Patch 2898255]: Enable unlimited multiple file
+ selection from the open files dialog. (pawlak,fellows,thoyts)
2010-01-05 Donal K. Fellows <dkf@users.sf.net>
@@ -616,25 +1370,53 @@
menu entries if the first index to delete is explicitly after the last
index of existing entries.
+ * generic/tkFont.h (ROUND16): [Bug 2824916]: Use a correct rounding
+ * unix/tkUnixFont.c (TkpDrawAngledChars): macro for converting a
+ * unix/tkUnixRFont.c (TkpDrawAngledChars): double to a short. This
+ * win/tkWinFont.c (GetScreenFont): stops a number of small
+ visual artefacts from happening and reduces the effect of others. The
+ ROUND16 macro is now shared across all the font code (though some
+ platforms do not need it specially).
+
2010-01-04 Pat Thoyts <patthoyts@users.sourceforge.net>
- * library/dialog.tcl: Backported fix for tk_dialog <Return> binding
- * library/console.tcl: Backported fix for console keyboard menu
- activation and <<Cut>> handling from HEAD.
+ * doc/TkInitStubs.3: [Bug 2192104]: Mention USE_TK_STUBS macro.
+ * library/dialog.tcl: [Bug 2811266]: <Return> binding should invoke
+ the button with the focus.
+ * library/fontchooser.tcl: [Bug 2727476]: Fix default size of font
+ chooser dialog and assigned minimum sizes for the lists.
+ * library/console.tcl: [Bug 580361]: Fix console <<Cut>> binding.
+ * library/console.tcl: Fix keyboard access to console menu.
+ * library/demos/filebox.tcl: Make prettier using ttk.
+ * library/demos/fontchoose.tcl: Fix display of demo code.
* library/tk.tcl: Correctly handle quoted ampersands in AmpMenuArgs
+2010-01-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tcl.m4 (SC_CONFIG_CFLAGS): [Bug 1636685]: Use the configuration
+ for modern FreeBSD suggested by the FreeBSD porter.
+
2010-01-03 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkMenu.h: [Patch 2848897] Support the system keyboard
+ * generic/tkMenu.h: [Patch 2848897]: Support the system keyboard
* win/tkWinMenu.c: cues option on Windows. This system parameter
hides the underlines on menu items unless the keyboard is used to
open the menu. (kovalenko, thoyts)
+2010-01-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFont.c (Tk_TextLayoutToPostscript): Simplified the code to
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd): generate the preamble
+ * library/mkpsenc.tcl: for PS generation and
+ also simplify the code to output text following the observation that
+ it effectively only produces ASCII anyway, even when it might have the
+ option to do otherwise in theory.
+
2010-01-03 Pat Thoyts <patthoyts@users.sourceforge.net>
- * library/tearoff.tcl: tearoff menus should be transient and use the
+ * library/tearoff.tcl: Tearoff menus should be transient and use the
toolwindow style on Windows.
- * tests/menu.test: menu tests using 'tkwait visibility' are unix only
+ * tests/menu.test: Menu tests using 'tkwait visibility' are unix only.
2010-01-02 Donal K. Fellows <dkf@users.sf.net>
@@ -649,10 +1431,11 @@
* generic/tkEvent.c (CleanUpTkEvent): that we do not need to make it
* doc/HandleEvent.3 (ARGUMENTS): fresh each time, which causes
* doc/QWinEvent.3 (ARGUMENTS): trouble with some input
- * macosx/tkMacOSXKeyEvent.c (InitKeyEvent): methods. Also includes the
- * win/tkWinX.c (GenerateXEvent): factoring out of some code and
- update of documentation to describe the slightly increased constraints
- on how Tk_HandleEvent can be used.
+ * carbon/tkMacOSXKeyEvent.c (InitKeyEvent): methods. Also includes the
+ * macosx/tkMacOSXKeyEvent.c (tkProcessKeyEvent): factoring out of some
+ * win/tkWinX.c (GenerateXEvent): code and update of
+ documentation to describe the slightly increased constraints on
+ how Tk_HandleEvent can be used.
2010-01-01 Donal K. Fellows <dkf@users.sf.net>
@@ -680,31 +1463,65 @@
* win/tkWinMenu.c: [Bug 2879927]: Highlight for cascade items in
torn-off menus is incorrect on Windows.
+2009-12-25 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/utils.tcl, library/notebook.tcl: [Bugs 2917688,2546779]:
+ Reworked ActivateTab focus selection logic.
+
2009-12-25 Donal K. Fellows <dkf@users.sf.net>
* doc/option.n: [Bug 2914943]: Correct the first example.
Also define what the format of option patterns is; that's a much less
commonly known fact than it used to be.
+2009-12-22 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Sync with current Tcl version.
+ * unix/Makefile.in: Use EXE_SUFFIX for Cygwin, and install
+ libtk8.6.dll in bin directory.
+ * unix/configure: (regenerated)
+
2009-12-22 Joe English <jenglish@users.sourceforge.net>
* library/ttk/sizegrip.tcl: [Bug 2912356]: Patch to avoid bizarro
behavior under compiz.
-2009-12-22 Donal K. Fellows <dkf@users.sf.net>
-
- * library/tkfbox.tcl (ListInvoke): [Bug 2919205]: Correct ordering of
- arguments to tk_messageBox.
-
2009-12-20 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixSend.c (ServerSecure): [Patch 2917663]: Better support
for server-interpreted access control addreses.
-2009-12-16 Joe English <jenglish@users.sourceforge.net>
+2009-12-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkListbox.c: Fix gcc warning: ignoring return value of
+ "strtol", declared with attribute
+ warn_unused_result.
+ * unix/tkUnixEvent.c: Fix gcc warning: dereferencing pointer
+ "xgePtr" does break strict-aliasing rules.
+ * generic/tkInt.decls: CONSTify return values of TkKeysymToString,
+ * generic/tkBind.c TkFindStateString, TkpGetString, TkpGetChar,
+ * generic/tkIntDecls.h which are all not supposed to be modified by
+ * generic/tkUtil.c the caller. In tkUtil.c this gets rid of a
+ * carbon/tkMacOSXKeyboard.c dangerous type cast.
+ * macosx/tkMacOSXKeyboard.c
+ * unix/tkUnixKey.c
+ * win/tkWinKey.c
+
+2009-12-15 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConfig.c: Added another dimension of refCounting to the
+ * generic/tkInt.c: "option" Tcl_ObjType to improve memory troubles
+ * generic/tkObj.c: detailed in [Bug 2492179]. Also removed
+ registration of the "option" Tcl_ObjType.
+ *** POTENTIAL INCOMPATIBILITY *** for callers of
+ Tcl_GetObjType("option") which must now handle a NULL return.
+
+2009-12-15 Donal K. Fellows <dkf@users.sf.net>
- * generic/ttk/ttkNotebook.c: Don't call Tk_DeleteOptionTable()
- [Bug 2915709], backport fix for [Bug 2496162].
+ * library/demos/unicodeout.tcl (usePresentationFormsFor): Split out
+ the code to decide whether to use presentation forms for clarity, and
+ add some more languages (though only in natural uncomposed form for
+ Devanagari script).
2009-12-14 Kevin B. Kenny <kennykb@acm.org>
@@ -717,58 +1534,73 @@
2009-12-02 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkInt.decls: [Bugs 220600, 220690]: Comment that
- TkWinChildProc is exported through the stubs table since 8.5.9
+ * win/tkInt.decls: [Bugs 220600, 220690]: Comment that TkWinChildProc
+ is exported through the stubs table since 8.5.9
+
+2009-12-11 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/makefile.vc: Fix dependancies on ${TKSTUBLIB} when
+ TCL_USE_STATIC_PACKAGES is defined
+ * generic/tkWindow.c: Fix gcc warning, using gcc-4.3.4 on cygwin
+ warning: array subscript has type 'char'
2009-12-11 Donal K. Fellows <dkf@users.sf.net>
- * library/tk.tcl (tk::ScreenChanged): [Bug 2912473]: Stop problems
+ * library/tk.tcl (::tk::ScreenChanged): [Bug 2912473]: Stop problems
caused by display names with a double colon in.
2009-12-10 Donal K. Fellows <dkf@users.sf.net>
* library/demos/ttkscale.tcl: Added demo of [ttk::scale] widget.
-2009-12-09 Andreas Kupries <andreask@activestate.com>
-
- * library/safetk.tcl (::safe::loadTk): [Bug 2902573]: Fixed access to
- the cleanupHook of the safe base. The code used the old internal
- commands which have been removed since 2009-12-09. See Tcl's
- ChangeLog.
-
2009-12-09 Donal K. Fellows <dkf@users.sf.net>
* generic/tkColor.c (Tk_GetColorByValue): [Bug 2911570]: Ensure that
hash keys of color values are zeroed first, so that they hash properly
on 64-bit systems (where X structures are not tightly packed).
+ * unix/tkUnixWm.c (TkpMakeMenuWindow): Improve the determining of what
+ * generic/tkMenu.c (ConfigureMenu): EWMH hint to use so that we
+ distinguish between dropdown menus (children of menubars) and what are
+ presumably popup menus.
+
2009-12-08 Pat Thoyts <patthoyts@users.sourceforge.net>
- * unix/tkUnixWm.c: [Bug 2864685]: Backported window manager hinting
- update from HEAD
+ * unix/tkUnixWm.c: [Bug 2864685]: Apply suitable extended window
+ manager hints to the menus so that modern unix window managers can use
+ the correct animation modes.
-2009-12-06 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+2009-12-02 Jan Nijtmans <nijtmans@users.sf.net>
- * macosx/tkMacOSXFont.c (GetFontFamilyName): [Bug 2548661]: Merge fix
- from HEAD (1.44).
+ * win/configure: (regenerated)
+ * win/Makefile.in: Use tktest86.dll for all tests.
+ * win/tkWinInt.h: Mark various functions MODULE_SCOPE
+ * generic/tkInt.decls: [Bugs 220600, 220690]: Make TkWinChildProc
+ available in private stub table.
+ * generic/tkIntPlatDecls.h: (regenerated)
+ * generic/tkStubInit.c: (regenerated)
-2009-12-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+2009-11-30 Jan Nijtmans <nijtmans@users.sf.net>
- * library/ttk/xpTheme.tcl: Fix selection of treeview rows on
- * library/ttk/vistaTheme.tcl: Windows XP and Vista.
+ * win/Makefile.in: Better dependancies in case of static build.
+ Generate tktest86.dll and tktest86.lib.
-2009-12-02 Jan Nijtmans <nijtmans@users.sf.net>
+2009-11-29 Jan Nijtmans <nijtmans@users.sf.net>
- * doc/GetHINSTANCE.3: Correct mentioned header file
- * win/tkWinInt.h: [Bugs 220600, 220690]: Make TkWinChildProc
- * generic/tkInt.decls: available in private stub table.
- * generic/tkIntPlatDecls.h: (regenerated)
- * generic/tkStubInit.c: (regenerated)
+ * generic/tkInt.h: Make all internal initialization
+ * generic/tkTest.c: routines MODULE_SCOPE
+ * generic/tkOldTest.c:
+ * generic/tkSquare.c:
+ * carbon/tkMaxOSXTest.c:
+ * macosx/tkMaxOSXTest.c:
+ * win/tkWinTest.c:
+ * win/tcl.m4: (copied from Tcl 8.6)
+ * win/configure: (regenerated)
-2009-11-25 Stuart Cassoff <stwo@users.sf.net>
+2009-11-25 Stuart Cassoff <stwo@users.sf.net>
* unix/tcl.m4: [Patch 2892871]: Remove unneeded
- * AC_STRUCT_TIMEZONE.
+ AC_STRUCT_TIMEZONE.
* unix/configure: Regenerated with autoconf-2.59.
2009-11-24 Donal K. Fellows <dkf@users.sf.net>
@@ -777,40 +1609,92 @@
type for the array of data passed into X. It's wrong, but "right"
because of a mistake in the X11 specification.
+2009-11-23 Andreas Kupries <andreask@activestate.com>
+
+ * library/safetk.tcl (::safe::loadTk): [Bug 2902573]: Fixed access
+ to the cleanupHook of the safe base. The code used the old
+ internal commands which have been removed since 2009-11-05/06. See
+ Tcl's ChangeLog.
+
+2009-11-23 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/Makefile.in: Added .PHONY lines to stop make from getting
+ confused when someone makes an error in a rule.
+
2009-11-22 Pat Thoyts <patthoyts@users.sourceforge.net>
* tests/winWm.test: [Bug 2899949]: Make sure the window is still
- * win/tkWinWm.c: present when handling delayed activation
+ * win/tkWinWm.c: present when handling delayed activation.
-2009-11-13 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * win/Makefile.vc: Include tk stubs in the tktest link
- * tests/winDialog.test: [Bug 2307837]: Backported fix for running
- * win/tkWinTest.c: dialog tests on non-English locales
+2009-11-21 Donal K. Fellows <dkf@users.sf.net>
-2009-11-12 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkUtil.c: Remove some anachronistic techniques (pointless
+ casts, mixed assignments and tests, etc.)
- *** 8.5.8 TAGGED FOR RELEASE ***
+ * generic/tk3d.c, generic/tkBitmap.c, generic/tkColor.c:
+ * generic/tkCursor.c, generic/tkFont.c, generic/tkTextIndex.c:
+ [Tcl Bug 2857044]: Corrections following audit of Tcl_ObjType freeing
+ practises; the typePtr field is now cleared when an object ceases to
+ be of the type.
- * changes: Updated for 8.5.8 release.
+2009-11-19 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
-2009-11-03 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkCanvas.c: [Bug 2899685]: Fix the redraw logic of [imove]
- * generic/tk.h: Bump to 8.5.8 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
- * README:
+2009-11-19 Jan Nijtmans <nijtmans@users.sf.net>
- * unix/configure: autoconf-2.59
- * win/configure:
+ * doc/GetHINSTANCE.3: Fix mentioned header file
+ * generic/tkTest.c: Compile with Stubs
+ * generic/tkOldTest.c
+ * generic/tkSquare.c
+ * win/tcl.m4: Should have been checked in together with the
+ 2009-08-09 check in of "win/configure"
+ * win/tkWinTest.c: Don't access tkWinProcs from Tk dll any more
+ * unix/tcl.m4: [Patch 2883533]: tcl.m4 support for Haiku OS
+ * unix/configure (regenerated)
+ * unix/Makefile.in: Fix library order in X11_LIB_SWITCHES
+
+2009-11-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkCanvLine.c (LineDeleteCoords): [Bug 2900121]: Get sense of
+ test for drawing optimization correct.
+
+2009-11-15 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/ttk_treeview.n (detach): Added note that the 'move' operation
+ restores detached nodes.
+
+2009-11-12 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/button.tcl, library/ttk/combobox.tcl,
+ * library/ttk/notebook.tcl, library/ttk/treeview.tcl:
+ [update] hygiene.
- * changes: Updated for 8.5.8 release.
+ + Where possible, replace [a; update; b] with [a ; after 0 b].
+ + Where not possible, use [update idletasks] instead of full [update].
+ + Use [after 0] in favor of [after idle] for delayed work, to reduce
+ likelihood of reentrancy issues in [update idletasks].
-2009-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+2009-11-11 Don Porter <dgp@users.sourceforge.net>
- * win/tkWinWm.c: [Bug 2891541]: Permit normal behaviour on
- Windows for a grabbed toplevel when it is the main window.
+ * generic/tkPlatDecls.h: [Bug 2886635]: Restore C++
+ friendliness to the tkPlatDecls.h header file, which we insist
+ extensions #include to gain access to the Tk_*HWND*() routines.
+
+2009-11-10 Andreas Kupries <andreask@activestate.com>
+
+ * unix/Makefile.in: Partially reverted Don Porter's 2009-10-20 commit.
+ The OSX Cocoa code branch still needs tclInt.h and the internal
+ headers, thus the TCL_PLATFORM directory. See tclMacOSXNotify.c for
+ example.
+
+2009-11-09 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFileFilter.c (TkFreeFileFilters): Simplify the code in
+ this file by consolidating the deletion code together into a single
+ function rather than scattering it over four.
2009-11-01 Joe Mistachkin <joe@mistachkin.com>
@@ -819,10 +1703,34 @@
allocates storage for the default width from the heap and frees it
using an exit handler.
+2009-11-01 Joe Mistachkin <joe@mistachkin.com>
+
+ * doc/loadTk.n: Minor fix for htmlhelp target.
+
+2009-11-01 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkWidget.c, doc/ttk_widget.n: Uniform, extensible
+ syntax for [$w identify] methods: [$w identify $component $x $y]. All
+ ttk::* widgets support [$w identify element $x $y]; widgets with other
+ identifiable parts may have additional subcommands.
+ * generic/ttk/ttkNotebook.c, doc/ttk_notebook.n: Notebook widgets
+ support [$nb identify tab].
+ * generic/ttk/ttkPanedwindow.c, doc/ttk_panedwindow.n: Panedwindow
+ widgets support [$w identify sash]. Older 2-argument form [$w
+ identify $x $y] still supported, though it does different things
+ depending on the widget.
+
2009-10-29 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/tkWinFont.c: [Bug 1825353]: Backported patch for tiny
- fixed font on Russian Windows systems.
+ * win/tkWinFont.c: [Bug 1825353]: This patch reverts a previous
+ attempt to fix tiny fonts on Russian Windows. It fixes the issue by
+ requesting a suitable fixed font instead of decoding the system stock
+ font.
+
+2009-10-26 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: Remove $(PACKAGE).* and prototype from the
+ `make distclean` target. Completes 2009-10-20 commit.
2009-10-25 Donal K. Fellows <dkf@users.sf.net>
@@ -836,10 +1744,6 @@
2009-10-24 Donal K. Fellows <dkf@users.sf.net>
- * macosx/ttkMacOSXTheme.c (RangeToFactor, TrackElementDraw)
- (PbarElementDraw): [Bug 2883712]: Corrected scaling of progress bars
- and scales, and backported the fix for 64-bitness.
-
* library/button.tcl, unix/tkUnixButton.c (TkpDisplayButton):
[Patch 1530276]: Make -selectcolor handling work better for both
checkbuttons and radiobuttons when they don't have indicators.
@@ -851,35 +1755,61 @@
* generic/tkText.h: [Patch 1469210]: Corrected handling of marking as
dirty when inserting after an undo from a non-dirty state.
+ * win/tkWinDialog.c (GetFileNameA): Make the handling of the filter
+ index the same as in GetFileNameW.
+
+ * library/tkfbox.tcl (::tk::dialog::file::, Done):
* library/xmfbox.tcl (MotifFDialog_FileTypes)
(MotifFDialog_ActivateSEnt):
- * library/tkfbox.tcl (Done, ::tk::dialog::file::):
* macosx/tkMacOSXDialog.c (Tk_GetOpenFileObjCmd):
* win/tkWinDialog.c (GetFileNameW, GetFileNameA):
* doc/getOpenFile.n: [Patch 2168768]: Corrected handling of the
-typevariable option to be consistently global; it's the only way it
can work even close to the same on all platforms.
-2009-10-15 Don Porter <dgp@users.sourceforge.net>
+ * macosx/ttkMacOSXTheme.c (RangeToFactor): [Bug 2883712]: Factor out
+ some common code and make sure that it is 64-bit correct.
- * generic/tkConsole.c: Relax the runtime version requirements on Tcl
- * generic/tkMain.c: so that Tk 8.5.8 can [load] into Tcl 8.6 (and
- * generic/tkWindow.c: later 8.*) interps. [Feature Request 2794032]
- * library/tk.tcl
- * unix/Makefile.in:
- * win/Makefile.in:
- * win/makefile.vc:
+2009-10-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/Makefile.in: [Bug 2875562]: Make sure that winMain.c and
+ * win/winMain.c: tkAppInit.c are never compiled with stubs.
+ * unix/tkAppInit.c:
+
+2009-10-20 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: Compiling Tk no longer requires header files
+ * win/Makefile.in: from the TCL_PLATFORM DIR. Baby step in
+ pursuit of [Bug 1712098]. Also removed the long outdated and broken
+ targets package-* that were for building Solaris packages. Appears
+ that the pieces needed for these targets to function have never been
+ present in the current era of Tcl development and belong completely
+ to Tcl pre-history.
+
+2009-10-20 Andreas Kupries <andreask@activestate.com>
+
+ * library/msgs/pl.msg: Applied patch to Polish message catalog created
+ and submitted by Pawel Pawlak <morris@elysium.pl> (via JeffH).
+
+2009-10-18 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/menu.n: Reorganized for readability, and added a note describing
+ some subtleties of the -variable entry configuration option following
+ some discussion with Joe Mistachkin.
2009-10-10 Donal K. Fellows <dkf@users.sf.net>
- * unix/tkUnixRFont.c (InitFont,TkpGetFontFromAttributes,Tk_DrawChars):
- [Bug 1961455]: Draw underlines and overstrikes when using Xft for font
- rendering.
+ * unix/tkUnixRFont.c (InitFont, TkpGetFontFromAttributes)
+ (Tk_DrawChars, TkpDrawAngledChars): [Bug 1961455]: Draw underlines and
+ overstrikes when using Xft for font rendering.
+
+ * generic/tkFont.c (TkDrawAngledTextLayout): Optimize the zero-angle
+ case better.
2009-10-08 Donal K. Fellows <dkf@users.sf.net>
- * library/tkfbox.tcl (::tk::IconList_Create): [Patch 2870648]:
- Corrected cursor used in file/directory dialogs.
+ * library/iconlist.tcl (Create): [Patch 2870648]: Corrected cursor
+ used in file/directory dialogs.
2009-10-07 Pat Thoyts <patthoyts@users.sourceforge.net>
@@ -891,20 +1821,29 @@
* unix/tkUnixScrlbr.c (TkpComputeScrollbarGeometry): [Patch 2088597]:
Stop scrollbars from getting too small at the end.
-2009-10-05 Don Porter <dgp@users.sourceforge.net>
+2009-10-05 Pat Thoyts <patthoyts@users.sourceforge.net>
- * changes: Updated for 8.5.8 release.
+ * win/tkWinButton.c: [Bug 2860827]: Avoid 3D effects with
+ user-specified backgrounds. The default disabled text is embossed on
+ Windows. But this looks poor when a non-default background color is in
+ use. This patch disables the embossed effect for buttons and labels
+ when the background is non- standard.
-2009-10-05 Pat Thoyts <patthoyts@users.sourceforge.net>
+2009-09-30 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/tkWinButton.c: [Bug 2860827]: Backported patch avoiding 3D
- effects with user-specified background.
+ * tests/winWm.test: [Bug 2799589]: Grab on deleted window.
2009-09-25 Donal K. Fellows <dkf@users.sf.net>
* generic/tkImgPhoto.c (ImgGetPhoto): Correct generation of grayscale
data from an image. Reported by Keith Vetter on comp.lang.tcl.
+2009-09-19 Peter Spjuth <peter.spjuth@gmail.com>
+
+ * generic/tkGrid.c: [Bug 2859912]: Bug fix in grid/pack collision
+ * generic/tkPack.c: detect. Faulty slave was not properly blocked
+ * tests/packgrid.test: from slave list.
+
2009-09-14 Jeff Hobbs <jeffh@ActiveState.com>
* generic/tkMenuDraw.c (TkPostSubmenu): [Bug 873613]: Fix reposting of
@@ -913,7 +1852,7 @@
(DrawMenuEntryArrow): [Bug 873608]: Draw Win menu arrow after being
torn off.
-2009-09-10 Donal K. Fellows <dkf@users.sf.net>
+2009-09-09 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixRFont.c (InitFont): Move pattern disposal in error case
to callers so they have more options when they come to recovering from
@@ -926,6 +1865,27 @@
error beats a crash! (Issue reported on comp.lang.tcl by Denis
Berezhnoy.)
+2009-09-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkFocus.c: Fix potential null dereference flagged by clang
+ * generic/tkMenu.c: static analyzer.
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextIndex.c:
+
+ * generic/tkConsole.c: Silence false positives from clang static
+ * generic/tkTest.c: analyzer about potential null dereference.
+ * generic/tkText.c:
+ * generic/tkTextBTree.c:
+ * generic/tkTextTag.c:
+ * generic/tkVisual.c:
+
+2009-09-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkInt.h (TkDisplay): Remove fields that are never read from.
+ * generic/tkWindow.c (Tk_DestroyWindow): Remove code to write to
+ write-only fields of TkDisplay. This follows on from [Bug 2039720].
+
2009-08-25 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixSend.c (ServerSecure): [Bug 1909931]: Added some support
@@ -938,10 +1898,76 @@
2009-08-24 Daniel Steffen <das@users.sourceforge.net>
- * macosx/tkMacOSXHLEvents.c (ScriptHandler): Fix "do script" apple
- event handler issues on recent Mac OS X releases by using AE coercion
- to 'utf8' for text data and to 'fsrf' for alias data. (Reported by
- Youness Alaoui on tcl-mac)
+ * generic/tkInt.h: Annotate Tcl_Panic as noreturn for clang static
+ analyzer in PURIFY builds, replacing preprocessor/assert technique.
+
+ * generic/tkBind.c (HandleEventGenerate): Don't generate events for
+ windows that don't exist yet (fixes TkAqua testsuite crash).
+
+ * macosx/tkMacOSXWindowEvent.c: [Bug 2821084]: Allow WM_DELETE_WINDOW
+ handlers to prevent window closure by generating WM destroy event
+ earlier (from window delegate's -windowShouldClose:).
+
+ * macosx/tkMacOSXDraw.c (TkMacOSX{Setup,Restore}DrawingContext):
+ Disable window flushing during Tk drawing to avoid immediate flush of
+ NSView-based native widgets on draw. (fixes drawing performance issue
+ reported by Youness Alaoui on tcl-mac)
+
+ * macosx/tkMacOSXHLEvents.c (ScriptHandler): Fix "do script" apple
+ * carbon/tkMacOSXHLEvents.c (ScriptHandler): event handler issues
+ on recent OS X releases by using AE coercion to 'utf8' for text data
+ and to 'fsrf' for alias data. (reported by Youness Alaoui on tcl-mac)
+
+ * macosx/Wish.sdef (new file): Install and enable sdef file
+ * macosx/Wish-Info.plist.in: into Wish application bundle,
+ * macosx/Tk.xcode/project.pbxproj: describing TkAqua apple event
+ * macosx/Tk.xcodeproj/project.pbxproj: support for use by AppleScript.
+ * unix/Makefile.in: (replaces functionality of
+ * unix/configure.in: 'aete' resource removed with
+ Cocoa port & fixes AppleScript
+ issues reported on tcl-mac)
+ * unix/configure: autoconf-2.59
+
+ * carbon/Wish.xcode/project.pbxproj: Remove references to obsolete
+ * carbon/Wish.xcodeproj/project.pbxproj: prolog.ps file.
+
+2009-08-19 Peter Spjuth <peter.spjuth@gmail.com>
+
+ * generic/tk.h
+ * generic/tkGeometry.c
+ * generic/tkGrid.c
+ * generic/tkInt.h
+ * generic/tkPack.c
+ * generic/tkWindow.c
+ * tests/grid.test
+ * tests/packgrid.test
+ * tests/textIndex.test: [Patch 2475855]: Give an error if grid and
+ pack are used in the same master.
+
+2009-08-14 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDraw.c: Avoid exception in XCopyArea() when copying
+ from toplevel that has never been mapped. (Reported by Youness Alaoui
+ on tcl-mac)
+
+ * macosx/tkMacOSXWm.c: Workaround for textured windows being draggable
+ from opaque content areas. [Bug 2824538] (walzer)
+
+2009-08-10 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinPixmap.c: Eliminate more gcc warnings
+ * win/tkWinWm.c:
+ * win/tkWinTest.c
+
+2009-08-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkInit.c: Eliminate gcc warning
+ * generic/tkBind.c
+ * generic/tkText.c
+ * generic/tkUtil.c
+ * win/ttkWinXPTheme.c: Include <vssym32.h> only when available
+ * win/configure.in: check for vssym32.h, available in newer SDK's
+ * win/configure: (regenerated)
2009-08-08 Donal K. Fellows <dkf@users.sf.net>
@@ -955,17 +1981,61 @@
spaces by restricting what we break on to ASCII spaces, which is good
enough for most purposes.
+2009-08-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinClipboard.c Correct check for winNT
+ * win/tkWinDialog.c Eliminate many gcc warnings
+ * win/tkWinImage.c:
+ * win/tkWinMenu.c:
+ * win/tkWinWm.c:
+ * win/tkWinX.c:
+ * win/ttkWinXPTheme.c: Eliminate msvc warnings
+ * win/tcl.m4:
+ * win/configure
+ * win/.cvsignore: Prevent files from being checked in by accident
+
2009-08-01 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixWm.c (WmIconphotoCmd): [Bug 2830420]: Assemble the image
for the window manager in a way that doesn't assume we're on a little-
endian system.
+2009-07-27 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/GetScroll.3: Reworded and reordered so as to indicate that the
+ Tcl_Obj forms are preferred.
+
+2009-07-26 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/canvas.n: Corrected description of acceptable join styles.
+ Spotted by Emiliano Gavilan.
+
+2009-07-23 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkSelect.c (HandleTclCommand): [Bug 2441988]: Stop losing
+ reports of errors in selection handlers; that's what the background
+ error handling code is for.
+ *** POTENTIAL INCOMPATIBILITY *** if your code was relying on erroring
+ selection scripts being silent.
+ (LostSelection, Tk_SelectionObjCmd): Stop using the vastly inefficient
+ TkCopyAndGlobalEval; better to use Tcl_Obj refcount management.
+
2009-07-22 Donal K. Fellows <dkf@users.sf.net>
* generic/tkFocus.c (TkFocusDeadWindow): [Bug 2496114]: Ensure that
focus desynchronization doesn't cause a crash.
+2009-07-21 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFont.c (TkUnderlineAngledTextLayout): [Bug 2356057]:
+ Corrected drawing of rotated underlines.
+
+2009-07-21 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+
+ * generic/tkFont.c: [Bug 2328657]: Explicitly exclude hacky zero-char
+ chunks from intersection computation. Might deserve generalization to
+ other tests.
+
2009-07-20 Donal K. Fellows <dkf@users.sf.net>
* tests/clipboard.test (clipboard-6.2): [Bug 2824378]: Corrected
@@ -977,6 +2047,25 @@
incremental transfer of binary selections work get deserialized
correctly. Thanks to Emiliano Gavilan for detecting.
+2009-07-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: Define NDEBUG in optimized (non-
+ symbols) build to disable assert()s.
+
+ * macosx/tkMacOSXBitmap.c: [Bug 2821318]: Fix tk::mac::iconBitmap
+ crash due to off-by-one ckalloc error.
+
+2009-07-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/ttkMacOSXTheme.c: [Patch 2819620]: Update notebook tab
+ * library/ttk/aquaTheme.tcl: appearance to modern L&F; adjust tab &
+ notebook padding and tabmargins;
+ correct appearance of selected tree
+ header; add support for native tree
+ header sort arrows via user1 state.
+
+ * library/demos/mclist.tcl: Use native sort arrows with aqua theme
+
2009-07-15 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixSelect.c (TkSelEventProc, SelRcvIncrProc, SelCvtFromX8):
@@ -995,819 +2084,769 @@
* doc/grid.n: [Bug 2818455]: Corrected example.
-2009-06-27 Jan Nijtmans <nijtmans@users.sf.net>
-
- * generic/tkInt.decls (Tk(Orient|Smooth)(Parse|Print)Proc):
- Backport [Bug 2804935]: Expose these functions through the internal
- stub table as they are useful to existing third-party code.
-
-2009-06-23 Jan Nijtmans <nijtmans@users.sf.net>
+2009-07-02 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkCanvUtil.c: [Bug 220935]: canvas dash update problem
-
-2009-06-02 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkInt.h: Avoid using C++ reserved word in header.
- * win/tkWinWm.c: [Bug 2799589]: Backported fix for crash on
- * tests/winWm.test: delayed window activation.
+2009-06-30 Daniel Steffen <das@users.sourceforge.net>
-2009-05-21 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/tkWinMenu.c: [Bug 2794778]: Backported fix for keyboard
- traversal of the menus on Windows.
-
-2009-05-14 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkButton.c: [Bug 1923684]: Backported checkbutton fix
- for confused state when -offvalue equals -tristatevalue
-
-2009-05-14 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * doc/ttk_image.n: Backported support for the Vista theme.
- * doc/ttk_style.n: This requires the vsapi element engine,
- * doc/ttk_vsapi.n: the hover state and the theme script
- * doc/ttk_widget.n: definition.
- * generic/ttk/ttkState.c:
- * generic/ttk/ttkTheme.h:
- * generic/ttk/ttkWidget.c:
- * library/ttk/ttk.tcl:
- * library/ttk/vistaTheme.tcl:
- * library/ttk/xpTheme.tcl:
- * tests/ttk/vsapi.test:
- * win/ttkWinXPTheme.c:
+ * generic/tkInt.h: Add assert macros for clang static
+ analyzer and redefine Tcl_Panic to
+ assert after panic in clang PURIFY
+ builds.
-2009-05-13 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkImgPhInstance.c: Small fixes to make clang static
+ * generic/tkTextDisp.c: analyzer happier.
- * generic/tkFont.c: [Bug 2791352]: Backported fix and tests for
- * tests/font.test: mis-parsing of certain font descriptions.
+ * generic/tkConfig.c: Add clang assert for false positives
+ * generic/tkUndo.c: from static analyzer.
-2009-05-03 Donal K. Fellows <dkf@users.sf.net>
+2009-06-29 Daniel Steffen <das@users.sourceforge.net>
- * win/tkWinWm.c (UpdateWrapper): [Bug 2785744]: Manipulate flag bit
- correctly so that menubar updates can't smash other attributes.
+ Merge of TkAqua Cocoa port <http://github.com/das/tcltk/tree/de-carbon>
+ *** POTENTIAL INCOMPATIBILITY ***
-2009-04-30 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * macosx/tkMacOSX.h: Large-scale rewrite of TkAqua migrating
+ * macosx/tkMacOSXBitmap.c: all use of deprecated Carbon API to
+ * macosx/tkMacOSXButton.c: Cocoa API; now supports 64bit
+ * macosx/tkMacOSXClipboard.c: architecture and requires Mac OS X 10.5
+ * macosx/tkMacOSXColor.c: or later; with TkAqua enabled, all Tk
+ * macosx/tkMacOSXConfig.c: sources are now built with the
+ * macosx/tkMacOSXCursor.c: Objective-C compiler and running in
+ * macosx/tkMacOSXDebug.c: Objective-C garbage collection mode as
+ * macosx/tkMacOSXDebug.h: well as in retain-release mode is
+ * macosx/tkMacOSXDefault.h: supported; detailed development history
+ * macosx/tkMacOSXDialog.c: is available in github repository.
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXEmbed.c: There should be no script-visible
+ * macosx/tkMacOSXEntry.c: changes to existing Tk functionality,
+ * macosx/tkMacOSXEvent.c: but there are a few aqua-specific
+ * macosx/tkMacOSXEvent.h: additions, see macosx/README for
+ * macosx/tkMacOSXFont.c: details; extensions using only public
+ * macosx/tkMacOSXFont.h: Tk API should continue to work
+ * macosx/tkMacOSXHLEvents.c: unchanged but extensions that rely on
+ * macosx/tkMacOSXInit.c: platform-specific internal Tk API or
+ * macosx/tkMacOSXInt.h: make assumptions about the inner
+ * macosx/tkMacOSXKeyEvent.c: workings of TkAqua (in particular
+ * macosx/tkMacOSXKeyboard.c: presence of QuickDraw) will require
+ * macosx/tkMacOSXMenu.c: porting.
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMenus.c: Configure Tk with --enable-aqua=carbon
+ * macosx/tkMacOSXMouseEvent.c: to fallback to now-deprecated previous
+ * macosx/tkMacOSXNotify.c: TkAqua implementation in tk/carbon.
+ * macosx/tkMacOSXPort.h:
+ * macosx/tkMacOSXPrivate.h:
+ * macosx/tkMacOSXRegion.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXTest.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXWm.h:
+ * macosx/tkMacOSXXStubs.c:
+ * macosx/ttkMacOSXTheme.c:
+ * macosx/tkMacOSXCarbonEvents.c (removed):
- * win/tkWinWm.c: [Patch 2504402]: Backported change to create
- wm icons as device independent bitmaps. (cjmcdonald)
+ * macosx/tkMacOSXCursors.h (new): Move cursor data from resources
+ * macosx/tkMacOSXXCursors.h (new): to compiled-in const array;
+ * macosx/tkMacOSXCursors.r (removed): remove obsolete Rez source
+ * macosx/tkMacOSXXCursors.r (removed): files for resource data.
+ * macosx/tkAboutDlg.r (removed):
+ * macosx/tkMacOSXAETE.r (removed):
-2009-04-30 Donal K. Fellows <dkf@users.sf.net>
+ * macosx/Tk.tiff (new): Rename and update icon to blue feather;
+ * macosx/Tk.icns (new): add tiff version for about dialog.
+ * macosx/Wish.icns (removed):
- * win/tkWinPixmap.c (Tk_GetPixmap): [Bug 2080533]: Added patch that
- allows Tk to keep working even when the graphics card is stressed.
+ * macosx/Tk-Info.plist.in: Update copyright; adjust minimum system
+ * macosx/Wish-Info.plist.in: version requirement.
+ * generic/tkEntry.h:
-2009-04-28 Jeff Hobbs <jeffh@ActiveState.com>
+ * license.terms: Sync list of entities with those in the
+ tcl license.terms, add Apple Inc.
- * unix/tcl.m4, unix/configure (SC_CONFIG_CFLAGS): Harden the check
- to add _r to CC on AIX with threads.
+ * generic/tk.h: Update comment with list of source
+ files containing tk version numbers.
-2009-04-27 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tkButton.c: On aqua, recompute button geometry on
+ secondary image change to enable cache
+ of native img format in geom compute.
- * generic/tkInt.decls: [Bug 2768945]: Expose (as "private") a set of
- functions needed for easily building canvas items that work like
- existing standard ones.
+ * generic/tkGrab.c: On aqua, make all grabs global, the
+ Mac OS X windowserver forces all grabs
+ to be application-local only anyway.
-2009-04-24 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkSelect.c: Enable utf8 atom on aqua.
- * win/tkWinDialog.c (ChooseDirectoryValidateProc): No need to set
- cwd on selchange. Prevents delete of selected folder in dialog.
+ * generic/tk.decls: Replace carbon types in public and
+ * generic/tkInt.decls: internal platform stubs interfaces with
+ void* resp. generic Tk types.
-2009-04-24 Stuart Cassoff <stwo@users.sf.net>
+ * xlib/xgc.c: Add support for managing a platform-
+ specific cache appended to a GC.
- * unix/Makefile.in: [Bug 2764263]: Removed stray @ from
- Makefile.in test target. [Bug 1945073]: Don't chmod+x square demo.
- [Patch 2764272]: Adjustable demo install location.
+ * tests/dialog.test: Change name of undefined bit to avoid
+ match with OSType native bitmap name.
-2009-04-24 Stuart Cassoff <stwo@users.sf.net>
+ * doc/cursors.n: Update list of cursors mapped to native
+ cursors and add new native cursors.
- * unix/Makefile.in: [Patch 2769530]: Don't chmod/exec installManPage.
+ * doc/menu.n: Add documentation of new aqua-specific
+ .window menu, document new constraints
+ on .apple menu.
-2009-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+ * library/console.tcl: Add aqua window and help menus.
- * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): [Bug 2779910]: Enable
- the new style choosedir that has a "New Folder" button, with
- ::tk::winChooseDirFlags override for new behavior.
+ * unix/Makefile.in: Add support for TkAqua-implementation-
+ specific sources determined at
+ configure-time. Update dist target for
+ new/removed files.
-2009-04-15 Don Porter <dgp@users.sourceforge.net>
+ * unix/configure.in: Add libraries & compiler flags for
+ Cocoa and Objective-C; update build
+ support for new/removed files; add
+ support for configure-time choice of
+ TkAqua implementation.
- *** 8.5.7 TAGGED FOR RELEASE ***
+ * macosx/Tk-Common.xcconfig (new): Rename Xcode projects and
+ * macosx/Tk-Debug.xcconfig (new): related files; update for Xcode
+ * macosx/Tk-Release.xcconfig (new): 3.1 and 3.2; update for Cocoa,
+ * macosx/Tk.xcode/* (new): Objective-C & GC; update with
+ * macosx/Tk.xcodeproj/* (new): new/removed source files;
+ * macosx/Wish.xcode/* (removed): standardize on gcc 4.2; remove
+ * macosx/Wish.xcodeproj/* (removed): obsolete configurations and
+ * macosx/Wish-Debug.xcconfig (removed): pre-Xcode project.
+ * macosx/Wish-Common.xcconfig (removed):
+ * macosx/Wish-Release.xcconfig (removed):
+ * macosx/Wish.pbproj/* (removed):
- * changes: Updated for 8.5.7 release.
+ * macosx/README: Document new Cocoa-port features and
+ constraints; update project docs;
+ cleanup.
-2009-04-14 Stuart Cassoff <stwo@users.sourceforge.net>
+ * carbon/tkMacOSXInt.h: Add dummy defines for empty GC cache.
- * unix/tcl.m4: Removed -Wno-implicit-int from CFLAGS_WARNING.
+ * carbon/tkMacOSXColor.c: Update for type changes in platform
+ * carbon/tkMacOSXDraw.c: stubs interfaces.
+ * carbon/tkMacOSXHLEvents.c:
+ * carbon/tkMacOSXMouseEvent.c:
+ * carbon/tkMacOSXSubwindows.c:
+ * carbon/tkMacOSXWm.c:
-2009-04-10 Don Porter <dgp@users.sourceforge.net>
+ * carbon/tkMacOSXButton.c: Fix warning.
- * changes: Updated for 8.5.7 release.
+ * generic/tkPlatDecls.h: regen.
+ * generic/tkIntPlatDecls.h:
+ * unix/configure: autoconf-2.59
- * generic/tk.h: Bump to 8.5.7 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
- * README:
+2009-06-27 Jan Nijtmans <nijtmans@users.sf.net>
- * unix/configure: autoconf-2.59
- * win/configure:
+ * generic/tkInt.decls (added TkSmooth(Parse|Print)Proc,
+ removed TkTile(Parse|Print)Proc which don't exist):
+ Follow-up to [Bug 2804935]: Expose these functions through the
+ internal stub table as they are useful to existing third-party code.
-2009-04-10 Joe English <jenglish@users.sourceforge.net
+2009-06-26 Daniel Steffen <das@users.sourceforge.net>
- * library/palette.tcl(tk_setPalette): Don't set
- *selectColor: #b03060; this makes radio- and checkbuttons
- look wrong post-TIP#109.
+ * carbon/ (new directory): Copy of current state of 'macosx'
+ source directory, to preserve legacy TkAqua implementation based on
+ Carbon API (with support for Mac OS X releases older than 10.5).
-2009-04-10 Daniel Steffen <das@users.sourceforge.net>
+ * unix/Makefile.in: Add support for --enable-aqua=carbon
+ * unix/configure.in: configure option (legacy fallback for
+ pre-Mac OS X 10.5 releases).
- * unix/configure.in (Darwin): use Darwin SUSv3 extensions if
- available.
* unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
- * library/msgbox.tcl: don't set msgbox bitmap background on TkAqua.
- * library/demos/filebox.tcl: only show "Motif Style Dialog" checkbutton
- on X11 windowingsystem.
+2009-06-22 Jan Nijtmans <nijtmans@users.sf.net>
- * library/demos/widget: GOOBE: use ttk::cursor
+ * generic/tkCanvUtil.c: [Bug 220935]: canvas dash update problem
- * library/ttk/cursors.tcl: backport ttk::cursor from HEAD
+2009-06-12 Donal K. Fellows <dkf@users.sf.net>
- * library/demos/knightstour.tcl: fix knightstour demo not running from
- interactive wish.
-
- * library/console.tcl (::tk::ConsoleInit): remove redundant TkAqua
- Quit menu item.
+ * generic/tkInt.decls (TkOrientParseProc, TkOrientPrintProc):
+ [Bug 2804935]: Expose these functions through the internal stub table
+ as they are useful to existing third-party code.
- * generic/tkPointer.c (Tk_UpdatePointer): use all 5 buttons.
+2009-06-02 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkMenu.c (PostProcessEntry): delay call to
- TkpConfigureMenuEntry() until all menu entry attributes are setup.
+ * win/tkWinWm.c: [Bug 2799589]: Avoid setting the focus on a
+ * tests/winWm.test: deleted window during delayed activation.
- * library/menu.tcl (::tk::MbPost): fix error thrown in y position
- computation with indicatoron.
+2009-05-21 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkMenubutton.c: s/DEF_BUTTON_JUSTIFY/DEF_MENUBUTTON_JUSTIFY/
+ * win/tkWinMenu.c: [Bug 2794778]: Calls to CallWindowProc can lead to
+ other functions overwriting the event strucure. Therefore preserve a
+ local copy of the XKeyEvent while looping over the key events.
- * generic/tkTextBTree.c (TkBTreeDeleteIndexRange): add bounds check
- to startEnd array access (fixes testsuite crash).
+2009-05-17 Joe English <jenglish@users.sourceforge.net>
- * tests/unixFont.test: only use xlsfonts with X11 windowingsystem.
+ * generic/ttkNotebook.c: [Bug 1470246]: More flexible tab placement.
-2009-04-10 Donal K. Fellows <dkf@users.sf.net>
+2009-05-14 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkCanvPs.c (TkPostscriptInfo): [Bug 1466509]: Eliminate old
- and misleading comments mentioning prolog.ps.
- * generic/prolog.ps, library/prolog.ps: Remove unused files.
- * unix/Makefile.in, win/Makefile.in: Stop building distributions that
- include the removed files or trying to install them.
+ * generic/tkButton.c: [Bug 1923684]: If a checkbutton offvalue is the
+ same as the tristate value we should use the off state in
+ preference. (andrey gusev)
- * library/tk.tcl: [Bug 2116837]: Add event definitions to handle the
- standard virtual events when Caps Lock is on.
+2009-05-13 Pat Thoyts <patthoyts@users.sourceforge.net>
-2009-04-03 Joe English <jenglish@users.sourceforge.net>
+ * win/tkWinSend.c: FormatMessage should always use the ignore-inserts
+ * win/tkWinTest.c: flag when processing system errors.
- * unix/tkUnixWm.c: [Bug 1789819]: Don't Panic.
+ * generic/tkFont.c: [Bug 2791352]: Handle parsing of type 5 font
+ * tests/font.test: descriptions with hyphenated family name.
-2009-03-25 Donal K. Fellows <dkf@users.sf.net>
+2009-05-06 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/ttk/ttkTheme.c (BuildOptionMap, NewElementImpl):
- [Bug 2178820]: Ensure that zero-size allocations don't happen; some
- malloc implementations don't like it at all.
+ * library/images/lamp.svg: Added an SVG version of the Tk lamp and
+ * library/images/lamp.png: a pre-rendered PNG version.
+ * win/rc/wish.ico: Wish gets a new icon using the SVG lamp and the tk
+ * win/rc/tk.ico: dll gets the tcl rendered feather. This provides
+ improved icons for Vista/Windows 7.
- * win/wish.exe.manifest.in: [Bug 1871101]: Add magic to make Tk not be
- blurred on Vista with large fonts.
+2009-05-05 Donal K. Fellows <dkf@users.sf.net>
-2009-03-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * doc/MainWin.3 (Tk_GetNumMainWindows): [Bug 487220]: Clarified that
+ this function works per-thread, not per-process.
- * generic/tkFileFilter.c: Backported some fixes for uninitialized
- * generic/tkFont.c: variables identified by das using clang
- * generic/tkListbox.c: analysis.
-
-2009-02-27 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * doc/canvas.n (scale): [Bug 1832015]: Clarified that [$c scale] only
+ affects item coordinates.
- * generic/tkWindow.c: [Bug 2645457] check for dead windows after
- calling Tk_MakeWindowExist to avoid a crash when mapping dead windows.
+2009-05-04 Donal K. Fellows <dkf@users.sf.net>
-2009-02-23 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * doc/3DBorder.3, doc/BindTable.3, doc/CanvPsY.3, doc/Clipboard.3:
+ * doc/ConfigWidg.3, doc/CrtWindow.3, doc/GetBitmap.3:
+ * doc/GetCapStyl.3, doc/GetImage.3, doc/GetJoinStl.3, doc/GetScroll.3:
+ * doc/GetSelect.3, doc/GetVisual.3, doc/MainWin.3, doc/Name.3:
+ * doc/ParseArgv.3, doc/TextLayout.3, doc/Tk_Init.3: [Bug 2431507]:
+ Purge all mention of the now-obsolete 'interp->result'.
- * win/tkWinCursor.c: [Patch 2542828] use stock Win32 help arrow
- cursor when question_arrow requested (danckaert)
+2009-05-03 Donal K. Fellows <dkf@users.sf.net>
- * win/rc/*.cur: [Patch 2513104] fix cursor hotspots (cjmcdonald)
+ * win/tkWinWm.c (UpdateWrapper): [Bug 2785744]: Manipulate flag bit
+ correctly so that menubar updates can't smash other attributes.
- * win/tkWinMenu.c: Applied patch for menu image display bug
- [Bug 1329198, 456299] [Patch 2507419] (cjmcdonald)
+2009-05-01 Donal K. Fellows <dkf@users.sf.net>
-2009-02-17 Jeff Hobbs <jeffh@ActiveState.com>
+ * library/mkpsenc.tcl (DrawText): [Bug 2777019]: Corrected point of
+ application of rotation transform so rotation is about the anchor
+ point of the text.
- * win/tcl.m4, win/configure: Check if cl groks _WIN64 already to
- avoid CC manipulation that can screw up later configure checks.
- Use 'd'ebug runtime in 64-bit builds.
+ * generic/tkCanvPs.c (Tk_PostscriptPhoto):
+ * library/mkpsenc.tcl: Factor out the postscript code for converting
+ images into postscript so that the code bits are in the prolog and not
+ emitted at runtime if a non-thread-safe static says to...
-2009-02-16 Jeff Hobbs <jeffh@ActiveState.com>
+2009-04-30 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/configure.in, win/configure: align better with tcl
- version. Ensures finding correct CPP for Win64.
+ * win/tkWinWm.c: [Patch 2504402]: Create icon bitmaps as device
+ independent bitmaps. This ensures the icon can be drawn properly on
+ various colour depth surfaces - in particular it fixes a problem with
+ remote desktop and looks better in the vista task switching overlay.
+ (cjmcdonald)
-2008-02-06 Daniel Steffen <das@users.sourceforge.net>
+2009-04-30 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkImgPhoto.c: fix numerous leaks discovered with the
- * generic/tkMenu.c: Mac OS X Instruments.app Leaks tool.
- * generic/tkText.c:
- * generic/tkTextImage.c:
- * generic/tkTextIndex.c:
- * generic/tkUndo.c:
- * generic/ttk/ttkFrame.c:
- * macosx/tkMacOSXWm.c:
+ * win/tkWinPixmap.c (Tk_GetPixmap): [Bug 2080533]: Added patch that
+ allows Tk to keep working even when the graphics card is stressed.
-2009-01-22 Kevin B. Kenny <kennykb@acm.org>
+2009-04-28 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/tcl.m4: Corrected a typo ($(SHLIB_VERSION) should be
- ${SHLIB_VERSION}).
- * unix/configure: Autoconf 2.59
+ * unix/tcl.m4, unix/configure (SC_CONFIG_CFLAGS): Harden the check
+ to add _r to CC on AIX with threads.
-2009-01-19 Kevin B. Kenny <kennykb@acm.org>
+2009-04-27 Donal K. Fellows <dkf@users.sf.net>
- * unix/Makefile.in: Added a CONFIG_INSTALL_DIR parameter so that
- * unix/tcl.m4: distributors can control where tclConfig.sh goes.
- Made the installation of 'ldAix' conditional
- upon actually being on an AIX system. Allowed for downstream
- packagers to customize SHLIB_VERSION on BSD-derived systems.
- Thanks to Stuart Cassoff for [Patch 907924].
- * unix/configure: Autoconf 2.59
+ * generic/tkInt.decls: [Bug 2768945]: Expose (as "private") a set of
+ functions needed for easily building canvas items that work like
+ existing standard ones.
-2009-01-14 Jan Nijtmans <nijtmans@users.sf.net>
+2009-04-24 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkImgPhoto.c: fix for aMSN compatibility [tcl-Bug 2507326]
+ * win/tkWinDialog.c (ChooseDirectoryValidateProc): No need to set cwd
+ on selchange. Prevents delete of selected folder in dialog.
-2009-01-11 George Peter Staplin <georgeps@users.sourceforge.net>
+2009-04-24 Stuart Cassoff <stwo@users.sf.net>
- * generic/tkEvent.c: Backport a fix from 8.6 for a NULL pointer
- dereference in CreateXIC.
+ * unix/Makefile.in: Assorted issues:
+ [Bug 2764263]: Removed stray @ from Makefile.in test target.
+ [Bug 1945073]: Don't chmod+x square demo.
+ [Patch 2764272]: Adjustable demo install location.
-2009-01-07 Pat Thoyts <patthoyts@users.sourceforge.net>
+2009-04-24 Stuart Cassoff <stwo@users.sf.net>
- * win/tkWinWm.c: Backported fix for [Bug 1847002] to prevent the
- bypassing of grab restrictions via the taskbar on Windows.
+ * unix/Makefile.in: [Patch 2769530]: Don't chmod/exec installManPage.
-2008-12-22 Don Porter <dgp@users.sourceforge.net>
+2009-04-23 Jeff Hobbs <jeffh@ActiveState.com>
- *** 8.5.6 TAGGED FOR RELEASE ***
+ * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): [Bug 2779910]: Enable
+ the new style choosedir that has a "New Folder" button, with
+ ::tk::winChooseDirFlags override for new behavior.
- * tests/embed.test: Eliminate duplicate test names.
+2009-04-14 Donal K. Fellows <dkf@users.sf.net>
- * changes: Updates for 8.5.6 release.
+ * library/xmfbox.tcl (MotifFDialog_ActivateSEnt): Ensure that the
+ * library/tkfbox.tcl (Done): dialogs have the
+ correct levels for [upvar] for accessing the -typevariable var.
-2008-12-22 Joe English <jenglish@users.sourceforge.net>
+2009-04-13 Donal K. Fellows <dkf@users.sf.net>
- * generic/ttk/ttkWidget.c: Don't crash when
- application uses nondefault visual [Bug 2264732]
- (Backport from trunk change 2008-11-11)
- * Workaround for [Bug 2207435]
- (Backport from trunk change 2008-10-31).
+ * library/tk.tcl: Corrected another problem; can't determine the exact
+ type of OS - needed for figuring out how to guess the correct binding
+ in some circumstances - in a safe interpreter.
-2008-12-22 Donal K. Fellows <dkf@users.sf.net>
+ * library/tkfbox.tcl: [Bug 2759119]: Corrected level handling for the
+ * library/xmfbox.tcl: -typevariable option following updates to tk.tcl
+ [Patch 2739360]: Use more modern images from Tango set for the non-
+ Motif file dialog. Thanks to Emiliano for bring this to my attention.
- * generic/tkCanvPs.c (Tk_PostscriptFont,TkCanvPostscriptCmd): Backport
- of font size and reflection fix. [Bug 2107938]
+2008-04-10 Joe English <jenglish@users.sourceforge.net
-2008-12-22 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+ * library/palette.tcl (tk_setPalette): Don't set *selectColor:
+ #b03060; this makes radio- and checkbuttons look wrong post-TIP#109.
- * generic/tkCanvUtil.c: Backport of the Millipeter patch [1813597,
- * generic/tkInt.h: 2218964]
- * generic/tkObj.c:
- * generic/tkText.c:
+2009-04-10 Daniel Steffen <das@users.sourceforge.net>
-2008-12-21 Don Porter <dgp@users.sourceforge.net>
+ * unix/configure.in (Darwin): Use Darwin SUSv3 extensions if
+ available.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
- * generic/tk.h: Bump to 8.5.6 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
- * README:
+ * library/demos/filebox.tcl: Only show "Motif Style Dialog"
+ checkbutton on X11 windowingsystem.
- * unix/configure: autoconf-2.59
- * win/configure:
+ * library/demos/widget: GOOBE: use ttk::cursor
- * changes: Updates for 8.5.6 release.
+ * library/demos/knightstour.tcl: Fix knightstour demo not running from
+ interactive wish.
-2008-11-22 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/console.tcl (::tk::ConsoleInit): Remove redundant TkAqua
+ Quit menu item.
- * library/ttk/combobox.tcl: [Bug 1939129,1991930] combobox dropdown
- was drawn behind topmost toplevels.
+ * generic/tkPointer.c (Tk_UpdatePointer): Use all 5 buttons.
-2008-11-19 Jan Nijtmans <nijtmans@users.sf.net>
+ * generic/tkMenu.c (PostProcessEntry): Delay call to
+ TkpConfigureMenuEntry() until all menu entry attributes are setup.
- * generic/tkImage.c Relax the constraint that every Tk_ImageType
- * generic/tkImgPhoto.c can only be passed to this function once.
- This allows tkImg to be loaded in multiple
- interpreters in a thread-enabled build of Tk.
- [Bug 2312027]
+ * library/menu.tcl (::tk::MbPost): Fix error thrown in y position
+ computation with indicatoron.
-2008-11-15 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkMenubutton.c: s/DEF_BUTTON_JUSTIFY/DEF_MENUBUTTON_JUSTIFY/
- * generic/tk.h: The tip 125 implementation permits the
- * generic/tkFrame.c: wm manage command to manage any widget but
- * macosx/tkMacOSXWm.c: only those with Frame instance data should
- * unix/tkUnixWm.c: be permitted. We now check for the suitability
- * win/tkWinWm.c: and raise an error for non-frame widgets.
- * test/wm.test: Updated the tests and documentation.
- * doc/wm.n: See also [Bug 2239034]
+ * generic/tkUtil.c (TkBackgroundEvalObjv): Use Tcl_BackgroundException
-2008-11-12 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkTextBTree.c (TkBTreeDeleteIndexRange): Add bounds check
+ to startEnd array access (fixes testsuite crash).
- * tests/constraints.tcl: backported listbox test fix from head
- * tests/listbox.test: the default on windows is 'underline'
- * tests/winDialog.test: backported some fixes from head
- * library/text.tcl: Backported fix for bug #1777362 to have events
- * test/text.test: work with window paths that include hyphens.
+ * tests/unixFont.test: Only use xlsfonts with X11 windowingsystem.
-2008-10-23 Don Porter <dgp@users.sourceforge.net>
+2009-04-10 Donal K. Fellows <dkf@users.sf.net>
- * generic/tk.h: Bump version number to 8.5.6b1 to distinguish
- * library/tk.tcl: CVS development snapshots from the 8.5.5 and
- * unix/configure.in: 8.5.6 releases.
- * unix/tk.spec:
- * win/configure.in:
- * README:
+ * library/tk.tcl: [Bug 2116837]: Add event definitions to handle the
+ standard virtual events when Caps Lock is on.
- * unix/configure: autoconf (2.59)
- * win/configure:
+2009-04-08 Donal K. Fellows <dkf@users.sf.net>
-2008-10-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/demos/widget (addFormattedText): Stop marking demonstrations
+ as new for 8.6; that label is for wholly new demos.
- * library/ttk/scale.tcl: Backported keyboard bindings for ttk::scale
+2009-04-04 Donal K. Fellows <dkf@users.sf.net>
-2008-10-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * doc/messageBox.n: [Bug 1881896]: Reworded to be clearer on what the
+ platform restrictions really are.
- *** 8.5.5 TAGGED FOR RELEASE ***
+2009-04-03 Joe English <jenglish@users.sourceforge.net>
- * generic/tkCanvas.c (CanvasWidgetCmd): Corrected result generation.
+ * unix/tkUnixWm.c: [Bug 1789819]: Don't panic when the window manager
+ does something unexpected with the stacking order.
-2008-10-10 Don Porter <dgp@users.sourceforge.net>
+2009-04-03 Donal K. Fellows <dkf@users.sf.net>
- * generic/tk.h: Bump to 8.5.5 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
+ * doc/TextLayout.3: [Bug 974421]: Clarified description of how result
+ of lookup of a point after end of layout relates to the underlying
+ string's length.
- * unix/configure: autoconf-2.59
- * win/configure:
+2009-04-02 Pat Thoyts <patthoyts@users.sourceforge.net>
- * changes: Updates for 8.5.5 release.
+ * tests/textTag.test: Ensure the pointer begins outside the window for
+ all the tests checking Enter/Leave motion events.
- * unix/Makefile.in: Relax constraints in index script so that
- * win/Makefile.in: each Tk 8.5.* release may be [package require]d
- * win/makefile.vc: into any Tcl 8.5.* interp. [Bug 1890438].
+ * library/demos/pendulum.tcl: Use unicode labels
+ * library/demos/knightstour.tcl: Use polygon knight on x11.
-2008-10-09 Don Porter <dgp@users.sourceforge.net>
+2009-03-31 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkListbox.c: Make literal return values consistent with
- those generated by Tcl_PrintDouble().
+ * library/demos/mclist.tcl: Added support for arrow indicators to show
+ which way a column is being sorted. Corrected determination of which
+ fonts to use for measurements.
- * tests/canvText.test: Backport test updates in light of the
- * tests/entry.test: 2008-10-05 commit.
- * tests/listbox.test:
- * tests/scrollbar.test:
- * tests/spinbox.test:
- * tests/textDisp.test:
+2009-03-25 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkEntry.c: Fix missing space constructing the scroll
- command.
+ * doc/wish.1: Bring doc and demos in line with
+ * library/demos/hello: http://wiki.tcl.tk/812
+ * library/demos/rmt
+ * library/demos/square
+ * library/demos/tcolor
+ * library/demos/timer
+ * library/demos/widget
+ * win/tkWinMenu.c: Eliminate a few compiler warnings on mingw
+ * win/ttkWinXPTheme.c: Spacing
-2008-10-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2009-03-25 Donal K. Fellows <dkf@users.sf.net>
- * win/tkWinScrlbr.c: Convert 'sprintf(..."%g"...)' to the
- * macosx/tkMacOSXScrlbr.c: locale-insensitive Tcl_PrintDouble.
- * generic/tkScrollbar.c: [Bug 2112563] NOTE: Tcl_PrintDouble
- * generic/tkListbox.c: is sensitive to the value of
- * generic/tkEntry.c: ::tcl_precision.
- * generic/tkCanvText.c: *** POTENTIAL INCOMPATIBILITY ***
- * generic/tkArgv.c:
+ * generic/ttk/ttkTheme.c (BuildOptionMap, NewElementClass):
+ [Bug 2178820]: Ensure that zero-size allocations don't happen; some
+ malloc implementations don't like it at all.
-2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+ * win/wish.exe.manifest.in: [Bug 1871101]: Add magic to make Tk not be
+ blurred on Vista with large fonts.
- * library/menu.tcl: additional fix for [Bug 1023955]
+2009-03-14 Donal K. Fellows <dkf@users.sf.net>
-2008-09-08 Todd M. Helfter <tmh@users.sourceforge.net>
+ * unix/tk.pc.in (new file): [Patch 2243962] (hat0)
+ * unix/configure.in, unix/Makefile.in: Added support for reporting
+ Tk's public build configuration via the pkg-config system. TEA is
+ still the official mechanism though, in part because pkg-config is not
+ universally supported across all Tk's supported platforms.
- * doc/menu.n: fix typo in docs [Bug 2098425]
+2009-03-10 Donal K. Fellows <dkf@users.sf.net>
-2008-08-28 Don Porter <dgp@users.sourceforge.net>
+ * doc/event.n: Tidy up and improve examples.
- * unix/tkConfig.sh.in: Added @XFT_LIBS@ to the definition of TK_LIBS
- to avoid link failures when a "big wish" program links against a
- --disable-shared build of libtk. (Discovered building expectTk).
+2009-03-09 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
- * generic/tk.h: Bump version number to 8.5.5b1 to distinguish
- * library/tk.tcl: CVS development snapshots from the 8.5.4 and
- * unix/configure.in: 8.5.5 releases.
- * unix/tk.spec:
- * win/configure.in:
- * README:
+ * tkMacOSXFont.c (GetFontFamilyName): [Bug 2548661]: Handle NULL
+ return from CFStringCreate.
- * unix/configure: autoconf (2.59)
- * win/configure:
+2009-02-27 Jan Nijtmans <nijtmans@users.sf.net>
-2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+ * doc/GetBitmap.3 [Feature Request 2636558]: Tk_DefineBitmap
+ * generic/tk.decls and Tk_GetBitmapFromData signature problem
+ * generic/tkInt.decls
+ * generic/tkBitmap.c
+ * generic/tkInt.h
+ * generic/tkStubInit.c
+ * generic/tkDecls.h: (regenerated)
+ * generic/tkIntDecls.h: (regenerated)
+ * macosx/tkMacOSXBitmap.c
- * library/menu.tcl: fix typo from [Bug 1023955]
+2009-02-27 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+ * generic/tkWindow.c: [Bug 2645457]: Check for dead windows after
+ calling Tk_MakeWindowExist to avoid a crash when mapping dead windows.
- * library/menu.tcl : Do not flip to the arrow cursor on menus.
- This was a Motif convention. Current behavior is maintained if
- tk_strictMotif is enabled. [Bug 1023955]
+2009-02-23 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+ * win/rc/*.cur: [Patch 2513104]: Fix cursor hotspots (cjmcdonald)
- The patch is associated with the bug tracker id: 1936220
- library/tkfbox.tcl : fix the multiple selection error for
- tk_getOpenFile -multiple 1 which fails on all unix platforms since
- the adoption of ttk widgets.
+ * win/tkWinMenu.c: Applied patch for menu image display bug.
+ [Bug 1329198, 456299] [Patch 2507419] (cjmcdonald)
-2008-08-19 Joe English <jenglish@users.sourceforge.net>
+2009-02-22 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/ttk/ttkScroll.c: Don't use sprintf "%g" to
- format floating point numbers in -[xy]scrollcommand callbacks
- or [xy]view methods. Minor incompatibility: 0 and 1 now
- formatted as "0.0" resp "1.0".
- * tests/ttk/entry.test, tests/ttk/treeview.test: Updated
- to account for above change.
+ * win/tkWinCursor.c: Applied patch to support stock Win32 help arrow
+ cursor when question_arrow requested [Patch 2542828] (danckaert)
-2008-08-19 Daniel Steffen <das@users.sourceforge.net>
+2009-02-21 Pat Thoyts <patthoyts@users.sourceforge.net>
- * macosx/tkMacOSXFont.c (SetFontFeatures): Disable antialiasing of
- fixed-width fonts with
- size <= 10.
+ * library/ttk/vistaTheme.tcl: Correct the ttk::treeview border on
+ * win/ttkWinXpTheme.c: XP and vista.
-2008-08-14 Daniel Steffen <das@users.sourceforge.net>
+ * library/console.tcl: [Bug 2546087]: In 2004 a fix to Tcl channels
+ prevented the exposure of the internal UTF-8 representation of the
+ ASCII NUL character (\uc080). Since then strings in the console have
+ been truncated at NUL. This restores the older behaviour.
- *** 8.5.4 TAGGED FOR RELEASE ***
+2009-02-17 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/tcl.m4 (SC_PATH_X): check for libX11.dylib in addition to
- libX11.so et al.
+ * win/tcl.m4, win/configure: Check if cl groks _WIN64 already to avoid
+ CC manipulation that can screw up later configure checks. Use 'd'ebug
+ runtime in 64-bit builds.
- * unix/configure: autoconf-2.59
+2009-02-16 Jeff Hobbs <jeffh@ActiveState.com>
-2008-08-08 Don Porter <dgp@users.sourceforge.net>
+ * win/configure.in, win/configure: Align better with tcl version.
+ Ensures finding correct CPP for Win64.
- * generic/tk.h: Bump to 8.5.4 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
- * README:
+2009-02-16 Donal K. Fellows <dkf@users.sf.net>
- * unix/configure: autoconf-2.59
- * win/configure:
+ * doc/ttk_intro.n: [Bug 2604420]: Improve wording so that this page
+ feels less obviously incomplete.
- * changes: Updates for 8.5.4 release.
+2009-02-12 Donal K. Fellows <dkf@users.sf.net>
-2008-08-05 Joe English <jenglish@users.sourceforge.net>
+ * library/iconlist.tcl: Split out the IconList megawidget from
+ tkfbox.tcl into its own file so as to make it easier to maintain. Also
+ cleans up the API for the megawidget, making it more like a
+ conventional Tk widget.
- * generic/tk.h, generic/tkEvent.c: Fix for [Bug 2010422]
- "no event type or button # or keysym while executing
- "bind Listbox <MouseWheel> [...]".
+2009-02-11 Donal K. Fellows <dkf@users.sf.net>
-2008-08-01 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/demos/items.tcl, .../label.tcl, .../twind.tcl:
+ * library/demos/images/ouster.png: [Bug 2588919]: Demo GOOBE. Added
+ new image of John Ousterhout that does not look quite so massively out
+ of date, and also showed off a bit of how we can adjust PNG images
+ when loading them. Also labeled JO as the creator; it's the TCT who
+ are the proprietors now.
- * win/tkWinWm.c: Backported fixes for handling unmapped parent
- * test/wm.test: toplevels. [Bug 2009788, 2028703]
+2009-02-10 Jan Nijtmans <nijtmans@users.sf.net>
-2008-07-31 Don Porter <dgp@users.sourceforge.net>
+ * unix/tcl.m4: [Bug 2502365]: Building of head on HPUX was broken when
+ using the native CC.
+ * unix/configure (autoconf-2.59)
- * generic/tk.h: Added missing EXTERN for the Tcl_PkgInitStubsCheck
- declaration to fix inability to embed non-stub-enabled Tk on Windows.
+2009-02-08 Joe English <jenglish@users.sourceforge.net>
-2008-07-26 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/ttk/*.[ch]: Renamed several internal data structures and
+ functions: ElementImpl -> ElementClass, LayoutNode -> Element. Remove
+ more unnecessary casts. Add function Ttk_ClientRegion, common factor
+ of entry, scale, progress, and treeview widgets.
+ * generic/ttk/ttkTrack.c: Fix [Bug 2431428].
- * doc/options.n: Direct to the font manual for -font [Bug 1686012]
+2009-02-06 Daniel Steffen <das@users.sourceforge.net>
- * win/tkWinWindow.c: Check for 0x prefix in sprintf %p. Bug [2026405]
+ * generic/tkImgPhInstance.c: Fix numerous leaks discovered with the
+ * generic/tkMenu.c: Mac OS X Instruments.app Leaks tool.
+ * generic/tkText.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextIndex.c:
+ * generic/tkUndo.c:
+ * generic/tkUtil.c:
+ * generic/ttk/ttkFrame.c:
+ * macosx/tkMacOSXWm.c:
-2008-07-22 Daniel Steffen <das@users.sourceforge.net>
+2009-01-29 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkCanvArc.c - eliminate some unnessary type casts
+ * generic/tkCanvBmap.c - some internal const decorations
+ * generic/tkCanvImg.c - spacing
+ * generic/tkCanvWind.c
+ * generic/tkCmds.c
+ * generic/tkConfig.c
+ * generic/tkEntry.c
+ * generic/tkFocus.c
+ * generic/tkFont.c
+ * generic/tkFrame.c
+ * generic/tkGrab.c
+ * generic/tkGrid.c
+ * generic/tkImage.c
+ * generic/tkListbox.c
+ * generic/tkObj.c
+ * generic/tkOption.c
+ * generic/tkPack.c
+ * generic/tkPanedWindow.c
+ * generic/tkRectOval.c
+ * generic/tkSelect.c
+ * generic/tkText.c
+ * generic/tkTextMark.c
+ * generic/tkTextTag.c
- * library/ttk/aquaTheme.tcl: Use system color names and TIP145 named
- font instead of hardcoded color values and deprecated native font name.
+2009-01-28 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkCache.c: - eliminate some unnessary type casts
+ * generic/ttk/ttkLayout.c - some internal const decorations
+ * generic/ttk/ttkState.c - spacing
+ * generic/ttk/ttkTheme.c
+ * macosx/tkMacOSXMenu.c
+ * macosx/tkMacOSXPrivate.h
+ * unix/tkUnixFont.c
+ * unix/tkUnixMenu.c
+ * unix/tkUnixWm.c
+ * win/tkWinColor.c
+ * win/tkWinDialog.c
+ * win/tkWinFont.c
+ * win/tkWinMenu.c
+ * win/tkWinSend.c
+ * win/tkWinWindow.c
+ * win/tkWinWM.c
- * macosx/tkMacOSXHLEvents.c: sync with HEAD.
+2009-01-22 Kevin B. Kenny <kennykb@acm.org>
-2008-07-04 Joe English <jenglish@users.sourceforge.net>
+ * unix/tcl.m4: Corrected a typo ($(SHLIB_VERSION) should be
+ ${SHLIB_VERSION}).
+ * unix/configure: Autoconf 2.59
- * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c,
- generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c:
- Backport [Bug 2009213].
+2009-01-19 Kevin B. Kenny <kennykb@acm.org>
-2008-06-29 Don Porter <dgp@users.sourceforge.net>
+ * unix/Makefile.in: Added a CONFIG_INSTALL_DIR parameter so that
+ * unix/tcl.m4: distributors can control where tclConfig.sh goes.
+ Made the installation of 'ldAix' conditional upon actually being on an
+ AIX system. Allowed for downstream packagers to customize
+ SHLIB_VERSION on BSD-derived systems.
+ Thanks to Stuart Cassoff for [Patch 907924].
+ * unix/configure: Autoconf 2.59
- *** 8.5.3 TAGGED FOR RELEASE ***
+2009-01-16 Don Porter <dgp@users.sourceforge.net>
- * generic/tk.h: Bump to 8.5.3 for release.
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
+ * generic/tk.h: Bump patchlevel to 8.6b1.1 to distinguish
+ * library/tk.tcl: CVS snapshots from the 8.6b1 and 8.6b2
+ * unix/configure.in: releases.
* win/configure.in:
- * README:
* unix/configure: autoconf-2.59
* win/configure:
- * changes: Updates for 8.5.3 release.
-
-2008-06-26 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkPanedWindow.c (PanedWindowProxyCommand)
- (DisplayPanedWindow): Ensure that a zero width never gets fed to the
- underlying window system. [Bug 1639824] (Backport fix from dkf).
-
-2008-06-20 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/treeview.tcl: Backport fix for [Bug 1951733]
-
-2008-06-19 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for 8.5.3 release.
-
-2008-06-18 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing;
- (InstallStandardApplicationEventHandler): replace needless use of
- TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol().
-
- * macosx/tkMacOSXDebug.c: revert 2007-11-09 commit making
- * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol()
- available outside of debug builds.
-
- * macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing
- * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by
- only sending VisibilityNotify events once windows are mapped (rather
- than when they are created).
-
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): fix
- return value.
-
- * macosx/tkMacOSXInit.c: add helper to efficiently convert from
- * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj.
-
- * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): fix
- incorrect conversion to points of font sizes already in points; factor
- out retrieval of font family name from font family ID.
-
-2008-06-13 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/configure, win/configure.in (TK_WIN_VERSION): fix handling
- of interim a/b versioning for manifest usage.
-
-2008-06-12 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a
- global grab capture and to release the restrict window capture when
- releasing a button grab. Fixes segfault due to dangling reference to
- restrict window inside TkpSetCapture() implementation. [Bug 1991932]
-
- * unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
- * unix/configure: autoconf-2.59
-
- * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use UsrActivity
- instead of OverallAct (which may be ignored in some circumstances).
-
- * macosx/Wish.xcodeproj/project.pbxproj: add debug configs for 64bit,
- * macosx/Wish.xcodeproj/default.pbxuser: with gcov, and with
- corefoundation disabled; updates & cleanup for Xcode 3.1 and for
- Leopard; sync with Tcl.xcodeproj.
- * macosx/Wish.xcode/project.pbxproj: sync Wish.xcodeproj changes.
- * macosx/Wish.xcode/default.pbxuser:
- * macosx/README: document new build configs.
-
-2008-06-10 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixKey.c: tkUnixKey.c: Use Xutf8LookupString if available
- [Patch #1986818]. This should fix problems (like #1908443) where
- Xlib's idea of the system encoding does not match Tcl's.
-
-2008-05-23 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to
- Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576]
-
-2008-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/tk.tcl: Support for ttk widgets in AmpWidget
-
- * doc/button.n: Note negative widths for button [Patch #1883418]
- * doc/ttk_*: 'identify' widget command is on all ttk widgets.
-
-2008-05-04 Joe English <jenglish@users.sourceforge.net>
-
- * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments
- should not be disjoint [Bug 1942785]
-
-2008-04-17 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkCanvas.c: Fix logic that determines when canvas item
- <Enter> event should fire. Thanks to Sebastian Wangnick. [Bug 1327482]
+2009-01-14 Jan Nijtmans <nijtmans@users.sf.net>
-2008-04-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkImgPhoto.c: [Bug 2507326]: Fix for aMSN compatibility
+ * generic/tkMenu.h: CONSTify Tk(Create|Find)MenuReferences
+ * generic/tkMenu.c: various internal "const" decorations.
- * win/tkWinDialog.c: backport tk_chooseColor -title fix from head
- * win/tkWinTest.c: Added parent to testgetwininfo
- * tests/winDialog.test: Created some tk_chooseColor win tests.
+2009-01-13 Jan Nijtmans <nijtmans@users.sf.net>
-2008-04-11 Don Porter <dgp@users.sourceforge.net>
+ * unix/tcl.m4: [Bug 2502365]: Building of head on HPUX was broken when
+ using the native CC
+ * unix/configure (autoconf-2.59)
- * generic/tk.h: Bump version number to 8.5.3b1 to distinguish
- * library/tk.tcl: CVS development snapshots from the 8.5.2 and
- * unix/configure.in: 8.5.3 releases.
- * unix/tk.spec:
- * win/configure.in:
+2009-01-13 Pat Thoyts <patthoyts@users.sourceforge.net>
- * unix/configure: autoconf (2.59)
- * win/configure:
+ * tests/constraints.tcl: Made the tests more independent of the
+ * tests/*.test: presence of images in the interpreter.
-2008-04-07 Jeff Hobbs <jeffh@ActiveState.com>
+2009-01-11 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv
- * tests/main.test (main-3.*): error. [Bug 1937135]
+ * tests/bind.test: Fixed keysym bind tests for unix [Bug 2336454]
- * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny)
+2009-01-11 George Peter Staplin <georgeps@users.sourceforge.net>
-2008-04-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkEvent.c: Fix a possible segv due to a NULL pointer
+ dereference that occurs when XCreateIC fails.
- * library/ttk/xpTheme.tcl: fix the colour of labelframe in xp
+2009-01-11 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-04-01 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkStubLib.c (Tk_InitStubs): Added missing error message.
- * generic/tkWindow.c (Tk_PkgInitStubsCheck):
-
-2008-03-28 Don Porter <dgp@users.sourceforge.net>
-
- *** 8.5.2 TAGGED FOR RELEASE ***
-
- * README: Bump to 8.5.2 for release.
- * generic/tk.h:
+ * library/bgerror.tcl: Pretty up the unix tk_messageBox icons with PNG
+ * library/icons.tcl: images and grouped all the stock icons in one
+ * library/msgbox.tcl: file.
* library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf-2.59
- * win/configure:
-
- * changes: Updates for 8.5.2 release.
-
-2008-03-27 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/safetk.tcl (::safe::tkInterpInit): make sure tk_library
- and its subdirs (eg, ttk) are on the "safe" access path.
-
-2008-03-27 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166]
-
- * unix/configure: autoconf-2.59
-
-2008-03-27 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/ttk/ttkStubLib.c: ensure tcl stubs are used in libtkstub
- even in a static build of Tk.
- * generic/ttk/ttkDecls.h: fix incorrect number of arguments in
- Ttk_InitStubs macro definition.
-
-2008-03-26 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for 8.5.2 release.
-
- * unix/tkUnixCursor.c: Stop crash in [. configure -cursor] on X11.
- Thanks to emiliano gavilán. [Bug 1922466]
-
-2008-03-26 Joe English <jenglish@users.sourceforge.net>
-
- * generic/tkInt.h, generic/tkEvent.c, unix/tkUnixEvent.c,
- unix/tkUnixKey.c: XIM reorganization and cleanup; see
- [Patch 1919791] for details.
-2008-03-21 Joe English <jenglish@users.sourceforge.net>
+2009-01-11 Joe English <jenglish@users.sourceforge.net>
- * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in:
- Keep ttkStubLib.o in libtkstub instead of libtk. [Bug 1920030]
-
-2008-03-20 Donal K. Fellows <dkf@users.sf.net>
+ * generic/ttk/ttkNotebook.c (NotebookCleanup): [Bug 2496162]: Don't
+ call Tk_DeleteOptionTable(), it's unnecessary and quite possibly
+ harmful.
- * tests/wm.test: Rewrote so that tests clean up after themselves
- rather than leaving that to the following test. Makes it easier to
- catch problems where they originate. Inspired by [Bug 1852338]
+2009-01-08 Jan Nijtmans <nijtmans@users.sf.net>
-2008-03-19 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tk3d.c: CONSTify TkDebugBorder
+ * generic/tkBind.c: CONSTify TkStringToKeysym
+ * generic/tkBitmap.c: CONSTify TkDebugBitmap
+ * generic/tkColor.c: CONSTify TkDebugColor
+ * generic/tkCursor.c: CONSTify TkDebugCursor
+ * generic/tkFont.c: CONSTify TkDebugFont
+ * generic/tkInt.decls All those mods TIP #27 complient,
+ no incompatibility risks.
+ * generic/tkIntDecls.h (regenerated)
- * doc/GetClrmap.3: Documented Tk_PreserveColormap. [Bug 220809]
+2009-01-08 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-03-17 Joe English <jenglish@users.sourceforge.net>
+ * library/bgerror.tcl: Theme the bgerror dialog and make use of our
+ PNG support to improve the icon.
- * unix/Makefile.in, win/Makefile.in, win/makefile.vc: Put ttkStubLib.o
- in libtkstub instead of libtk. [Bug 1863007]
-
-2008-03-16 Donal K. Fellows <dkf@users.sf.net>
+2009-01-07 Pat Thoyts <patthoyts@users.sourceforge.net>
- * library/demos/goldberg.tcl: Made work when run twice in the same
- session. [Bug 1899664] Also made the control panel use Ttk widgets.
+ * library/tkfbox.tcl: [Bug 2473120]: Mis-ordered messagebox args.
-2008-03-13 Daniel Steffen <das@users.sourceforge.net>
+ * win/tkWinWm.c: [Bug 1847002]: Prevent grabs being bypassed on
+ Windows.
- * unix/configure.in: Use backslash-quoting instead of double-quoting
- * unix/tcl.m4: for lib paths in tkConfig.sh. [Bug 1913622]
- * unix/configure: autoconf-2.59
+2009-01-06 Jan Nijtmans <nijtmans@users.sf.net>
-2008-03-13 Don Porter <dgp@users.sourceforge.net>
+ * generic/tk.h: A few const -> CONST86 modifications,
+ * generic/tkCanvas.c: improving backwards compatibility. Change
+ * generic/tkCanvLine.c: Tk_ItemIndexProc and Tk_ItemInsertProc
+ * generic/tkCanvPoly.c: signature to have a Tcl_Obj parameter instead
+ * generic/tkCanvText.c: of a string parameter. This is binary and
+ * doc/CrtItemType.3: source compatible with previous API, it just
+ * doc/Clipboard.3: prevents the need for a type cast in the
+ * doc/ConfigWidg.3: Tk_ItemType table construction. Bring doc in
+ * doc/ParseArgv.3: line with API.
- * changes: Updates for 8.5.2 release.
+2009-01-06 Donal K. Fellows <dkf@users.sf.net>
-2008-03-12 Daniel Steffen <das@users.sourceforge.net>
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock): Optimize a common case for
+ photo image building. [Patch 1539990] (jepler)
- * macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1
- * macosx/Wish.xcodeproj/default.pbxuser: CODE_SIGN_IDENTITY and
- * macosx/Wish-Common.xcconfig: 'xcodebuild install'.
+2009-01-06 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-03-12 Joe English <jenglish@users.sourceforge.net>
+ * win/tkWinDialog.c: Use task modal for messagebox instead of system
+ modal. [Bug 2484771] (ferrieux,thoyts,mjanssen)
- * unix/tkUnixRFont.c: Try a fallback font if XftFontOpenPattern()
- fails in GetFont (workaround for [Bug 1090382]).
+2009-01-03 Donal K. Fellows <dkf@users.sf.net>
-2008-03-11 Daniel Steffen <das@users.sourceforge.net>
+ * doc/canvas.n: [Bug 1836621]: Improve the documentation of the
+ -offset and -outlineoffset item options.
- * library/demos/knightstour.tcl: Aqua GOOBE.
- * library/demos/widget:
+2009-01-03 Jan Nijtmans <nijtmans@users.sf.net>
- * macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1 and
- * macosx/Wish.xcodeproj/default.pbxuser: configs for building with
- * macosx/Wish-Common.xcconfig: gcc-4.2 and llvm-gcc-4.2.
-
- * generic/tkCanvUtil.c: Fix gcc-4.2 warnings.
-
- * macosx/GNUmakefile: Fix quoting to allow paths to
- * macosx/Wish-Common.xcconfig: ${builddir}, ${INSTALL_ROOT}
- * unix/Makefile.in: and ${TCL_BIN_DIR} to contain
- * unix/configure.in: spaces.
- * unix/install-sh:
- * unix/tcl.m4:
-
- * unix/configure: autoconf-2.59
-
- * unix/Makefile.in (install-strip): Strip non-global symbols from
- dynamic library.
-
-2008-03-10 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for 8.5.2 release.
+ * generic/tk.decls: CONSTify Tk_ClipboardAppend
+ * generic/tkClipboard.c:
+ * generic/tkDecls.h: (regenerated)
-2008-03-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2008-12-31 David Gravereaux <davygrvy@pobox.com>
- * doc/colors.n: Reworked to produce nicer HTML output.
+ * win/rules.vc: Small bug not setting SYMBOLS macro fixed.
-2008-03-06 Joe English <jenglish@users.sourceforge.net>
+2008-12-31 Joe English <jenglish@users.sourceforge.net>
- * doc/ttk_notebook.n: Move "TAB IDENTIFIERS" section above "WIDGET
- COMMAND" section. [Bug 1882011]
+ * generic/ttk/ttkDefaultTheme.c: Fix color palette for radiobutton and
+ checkbutton indicators. Fixes [Bug 2003310]; also makes "alt" theme
+ check/radiobuttons look like Windows 98, as intended.
+ * library/ttk/altTheme.tcl: Specify dark gray -bordercolor to soften
+ edges.
+ * tests/ttk/{checkbutton,radiobutton}.test: Split out of ttk.test.
-2008-02-29 Pat Thoyts <patthoyts@users.sourceforge.net>
+2008-12-28 Donal K. Fellows <dkf@users.sf.net>
- * library/demos/widget: Added a Knight's tour canvas demo.
- * library/demos/knightstour.tcl:
+ TIP #171 IMPLEMENTATION
-2008-02-27 Daniel Steffen <das@users.sourceforge.net>
+ * library/listbox.tcl, library/scrlbar.tcl, library/text.tcl: Adjust
+ users of the <MouseWheel> event to do the right thing horizontally as
+ well as vertically.
+ * win/tkWinX.c (GenerateXEvent): Redirect <MouseWheel> to the window
+ that contains the mouse.
+ * generic/tkEvent.c (InvokeFocusHandlers): Do not direct <MouseWheel>
+ through the focus mechanism.
+ *** POTENTIAL INCOMPATIBILITY *** for anyone counting on shift-wheel
+ to do something else (or nothing at all) or for the wheel events to be
+ following the keyboard on Win.
- * macosx/tkMacOSXDraw.c: workaround leak in Carbon SetPortPenPixPat()
- API [Bug 1863346]; avoid repeated PixPat allocation/deallocation.
+ * generic/tkImgPNG.c (ReadIDAT): Corrected code to transfer blocks of
+ compressed data into the Tcl_ZlibStream. Allows the reading of all
+ images from PngSuite set. Thanks to Michael Kirkham for fix/testing.
-2008-02-23 Joe English <jenglish@users.sourceforge.net>
+ TIP #244 IMPLEMENTATION
- * library/ttk/combobox.tcl, doc/ttk_combobox.n,
- * tests/ttk/combobox.test: Arrange to deliver <<ComboboxSelected>>
- event after listbox is unposted, as intended [Bug 1890211]. Clarified
- documentation.
+ * generic/tkImgPNG.c, tests/imgPNG.test, doc/photo.n: Adaptation of
+ tkpng to the Tk core, proving support for PNG image reading and
+ writing, based on Tcl's zlib support.
-2008-02-23 Joe English <jenglish@users.sourceforge.net>
+2008-12-27 Joe English <jenglish@users.sourceforge.net>
- * generic/ttk/ttkPanedWindow.c: Don't enforce minimum sash thickness
- of 5 pixels, just use 5 as a default. [FR 1898288]
+ * generic/ttk/ttkTreeview.c: [Bug 2381555]: Fix inconsistent use of
+ treeArea / headingArea. ([$tv identify] didn't work when horizontally
+ scrolled).
-2008-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2008-12-21 Donal K. Fellows <dkf@users.sf.net>
- * unix/README: Documented missing configure flags.
+ * doc/canvas.n (postscript): Regularized documentation of -channel
+ option.
-2008-02-06 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2008-12-19 Don Porter <dgp@users.sourceforge.net>
- * doc/ttk_scale.n (new file): Added basic documentation. [Bug 1881925]
+ *** 8.6b1 TAGGED FOR RELEASE ***
-2008-02-04 Don Porter <dgp@users.sourceforge.net>
+ * changes: Updates for 8.6b1 release.
- *** 8.5.1 TAGGED FOR RELEASE ***
+ * tests/clrpick.test: Eliminate duplicate test names.
+ * tests/embed.test:
+ * tests/text.test:
+ * tests/textMark.test:
- * generic/tk.h: Bump to 8.5.1 for release.
+ * README: Bump version number to 8.6b1
+ * generic/tk.h:
* library/tk.tcl:
* unix/configure.in:
* unix/tk.spec:
@@ -1816,364 +2855,544 @@
* unix/configure: autoconf-2.59
* win/configure:
-2008-02-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/MeasureChar.3, doc/FontId.3: Minor improvements (formatting,
- keywords).
-
-2008-02-02 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish-Info.plist.in: add CFBundleLocalizations key, listing
- * unix/configure.in (Darwin): all library/msgs locales.
+2008-12-18 Don Porter <dgp@users.sourceforge.net>
- * unix/configure.in (Darwin): correct Info.plist year substitution in
- non-framework builds.
+ * library/msgs/de.msg: [Patch 2442309]: Updated German messages.
+ Thanks to Ruediger Haertel.
- * unix/configure: autoconf-2.59
-
-2008-02-01 Don Porter <dgp@users.sourceforge.net>
+2008-12-17 Jan Nijtmans <nijtmans@users.sf.net>
- * changes: Updates for 8.5.1 release.
+ * generic/tk.h: VOID --> void
+ * unix/tkUnixPort.h:
+ * macosx/tkMacOSXPort.h:
-2008-02-01 Reinhard Max <max@suse.de>
+2008-12-17 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkImgGIF.c: Fixed a buffer overflow (CVE-2008-0553).
- * tests/imgPhoto.test: Added a test for the above.
+ * doc/selection.n: [Bugs 2441817,2441884]: Assorted small fixes.
-2008-01-31 Jeff Hobbs <jeffh@ActiveState.com>
+2008-12-16 Jan Nijtmans <nijtmans@users.sf.net>
- * library/msgbox.tcl (::tk::MessageBox): don't use ttk::label in
- low depth/aqua fallback, as it doesn't support -bitmap.
+ * win/tkWinDialog.c: Remove unused variables
- * win/tkWinDialog.c (Tk_MessageBoxObjCmd): pass "" instead of NULL
- when -title isn't set. [Bug 1881892]
+2008-12-15 Don Porter <dgp@users.sourceforge.net>
-2008-01-31 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ TIP #338 IMPLEMENTATION
- * doc/panedwindow.n: Added proper description of -height and -width
- options, which aren't "standard". Last of fallout from [Bug 1882495].
-
-2008-01-30 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/canvas.n, doc/listbox.n, doc/message.n: Fix erroneous listing of
- "standard" options. [Bug 1882495]
-
-2008-01-29 Joe English <jenglish@users.sourceforge.net>
+ * doc/Tk_Main.c: Removed the last two '#include "tclInt.h"'.
+ * generic/tkMain.c: Tk is now limited to Tcl's public interface.
+ * macosx/tkMacOSXInit.c:
- * library/treeview.tcl: Fix bug in Shift-ButtonPress-1 binding (error
- if no current focus item; reported on c.l.t.)
+2008-12-12 Pat Thoyts <patthoyts@users.sourceforge.net>
-2008-01-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * library/demos/fontchoose.tcl: Simple fontchooser demo.
+ * library/demos/widget:
- * doc/ttk_*.n: Adjusted handling of the standard options part of the
- Ttk manual pages so that they are documented in the correct location.
- [Bug 1876493]
+2008-12-11 Jan Nijtmans <nijtmans@users.sf.net>
-2008-01-28 Joe English <jenglish@users.sourceforge.net>
+ * generic/tk3d.c: Make error message from Tk_GetRelief the same
+ as for Tk_GetReliefFromObj.
+ * tests/canvas.test: Adapt test cases for changed error message.
+ * tests/scrollbar.test
+ * tests/textTag.test
- * unix/tkUnixRFont.c: Re-fix strict-aliasing warnings reintroduced by
- last patch.
+2008-12-11 Joe English <jenglish@users.sourceforge.net>
-2008-01-27 Joe English <jenglish@users.sourceforge.net>
+ * library/demos/*.tcl: Omit contraindicated [package require Ttk].
+ Remove logic that switches [ttk::scrollbar]s to [tk::scrollbar]s
+ based on [tk windowingsystem]; this is already handled in
+ library/ttk/scrollbar.tcl.
- * generic/ttk/ttkNotebook.c: Make sure to schedule a redisplay when
- adding and/or hiding tabs. [Bug 1878298]
+2008-12-10 Daniel Steffen <das@users.sourceforge.net>
-2008-01-27 Joe English <jenglish@users.sourceforge.net>
+ TIP #324 IMPLEMENTATION
- * unix/tkUnixRFont.c: Merged common code from InitFont() and
- TkpGetFontAttrsForChar(), factored into GetTkFontAttributes() and
- GetTkFontMetrics(). Removed write-only struct UnixFtFont member
- 'drawable'. Removed unneeded double-pointer indirections. Ensure that
- TkFontAttributes.family member is a Tk_Uid, as specified. Use
- FcTypeDouble for XFT_SIZE attribute. Finally: fix [Bug 1835848]
+ * generic/tkCmds.c: Implementation of [tk fontchooser] as
+ * generic/tkInt.h: a Ttk dialog for X11 and as a native
+ * win/tkWinDialog.c: platform dialog on Mac OS X & Windows.
+ * win/tkWinInt.h: (thoyts, vetter, robert, steffen)
+ * win/tkWinTest.c: [Patch 1477426]
+ * win/tkWinX.c:
+ * macosx/tkMacOSXCarbonEvents.c:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXEvent.h:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXFont.h:
+ * macosx/Wish.xcodeproj/project.pbxproj:
+ * library/fontchooser.tcl (new):
+ * library/tclIndex:
+ * library/msgs/de.msg:
+ * library/msgs/en.msg:
+ * tests/fontchooser.test (new):
+ * tests/winDialog.test:
+ * doc/fontchooser.n (new):
+ * doc/tk.n:
-2008-01-25 Don Porter <dgp@users.sourceforge.net>
+ * library/console.tcl: Let user select console font via
+ [tk fontchooser].
+ * library/demos/text.tcl: Add [tk fontchooser] demo.
- * changes: Updates for 8.5.1 release.
+ * generic/tkUtil.c: Add TkBackgroundEvalObjv() and
+ TkSendVirtualEvent() utility functions
+ (used by TIP #324 code).
-2008-01-08 Joe English <jenglish@users.sourceforge.net>
+ * generic/tkInt.h: Turn [tk] into an ensemble.
+ * generic/tkBusy.c: (thoyts, steffen)
+ * generic/tkCmds.c:
+ * generic/tkWindow.c:
- * generic/ttk/ttkFrame.c: BUGFIX: fix crash in [ttk::labelframe] when
- -style option specified. [Bug 1867122]
+ * macosx/tkMacOSXInit.c (TkpInit): Unconditionally show Tk console if
+ TK_CONSOLE env var is set.
-2008-01-08 Joe English <jenglish@users.sourceforge.net>
+2008-12-09 Don Porter <dgp@users.sourceforge.net>
- * win/ttkWinTheme.c: Add tristate support to checkbuttons and
- radiobuttons. [Bug 1865898]
- Fix check and radio indicator size. [Bug 1679067]
+ TIP #337 IMPLEMENTATION
-2008-01-06 Joe English <jenglish@users.sourceforge.net>
+ * generic/tkBind.c: Updated callers of Tcl_BackgroundError() to
+ * generic/tkCanvas.c: use the new routine
+ * generic/tkEntry.c: Tcl_BackgroundException() as appropriate.
+ * generic/tkImgBmap.c:
+ * generic/tkListbox.c:
+ * generic/tkSelect.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextWind.c:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * unix/tkUnixScale.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinButton.c:
+ * win/tkWinMenu.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWm.c:
- * generic/ttk/ttkWidget.c, generic/ttk/ttkWidget.h: Call
- Tk_MakeWindowExist() in widget constructor. Removed now-unnecessary
- initial ConfigureNotify processing.
+2008-12-07 Joe English <jenglish@users.sourceforge.net>
-2008-01-06 Joe English <jenglish@users.sourceforge.net>
+ * macosx/ttkMacOSXTheme.c: [Bug 2219588]: Add native aqua elements for
+ ttk::spinbox
+ * generic/ttk/ttkEntry.c, library/ttk/spinbox.tcl,
+ * tests/ttk/spinbox.test: Moved most spinbox "business logic" out of
+ ttkEntry.c into Tcl bindings.
+ * library/ttk/clamTheme.tcl: Minor spinbox appearance improvements.
+ * library/ttk/combobox.tcl, library/ttk/utils.tcl:
+ Factor out ttk::bindMouseWheel procedure.
+ * library/ttk/spinbox.tcl: Add cross-platform MouseWheel bindings.
- * library/ttk/treeview.tcl, library/ttk/utils.tcl: Fix MouseWheel
- bindings for ttk::treeview widget. [Bugs 1442006, 1821939, 1862692]
+2008-12-06 Donal K. Fellows <dkf@users.sf.net>
-2008-01-02 Don Porter <dgp@users.sourceforge.net>
+ TIP #197 IMPLEMENTATION
- * generic/tk.h: Bump version number to 8.5.1b1 to distinguish
- * library/tk.tcl: CVS development snapshots from the 8.5.0 and
- * unix/configure.in: 8.5.1 releases.
- * unix/tk.spec:
- * win/configure.in:
+ * generic/tkText.c (insertUnfocussedStrings, optionSpecs):
+ * generic/tkText.h (TkText, TkTextInsertUnfocussed):
+ * doc/text.n, tests/text.test:
+ Added definitions/tests/docs for "-insertunfocussed" field.
+ * generic/tkTextMark.c (TkTextInsertDisplayProc):
+ * generic/tkText.c (TextBlinkProc):
+ Added user-controlledrendering of insertion cursor when focus is not
+ in the text widget.
- * unix/configure: autoconf (2.59)
- * win/configure:
+2008-12-05 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-12-30 Donal K. Fellows <dkf@users.sf.net>
+ * library/ttk/ttk.tcl: Added vista theme to iron out the visual
+ * library/ttk/vistaTheme.tcl: differences between vista and XP.
+ * library/ttk/xpTheme.tcl:
+ * win/ttkWinXPTheme.c:
- * doc/canvas.n: Documented exact behaviour of items with respect to
- when they are the current item. [Bug 1774593] Also documented the
- clipping behaviour of window items.
+2008-12-05 Donal K. Fellows <dkf@users.sf.net>
- * library/demos/nl.msg: Corrected following testing "in the field" by
- Arjen Markus. [Bug 1860802]
+ * generic/tkCanvPs.c (Tk_PostscriptFont): [Bug 2107938]: Ensure that
+ font sizes can ever be negative; it triggers a really strange case
+ that is definitely not what is wanted.
+ * library/mkpsenc.tcl: Corrected and improved generation of postscript
+ * library/prolog.ps: prolog. Removed prolog.ps, which wasn't used and
+ was misleading.
-2007-12-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-12-04 Jan Nijtmans <nijtmans@users.sf.net>
- *** 8.5.0 TAGGED FOR RELEASE ***
+ * generic/tkInt.decls: [FRQ 220906]: Move 10 functions from tkText.h
+ * generic/tkText.h: to stub table.
+ * generic/tkStubInit.c (regenerated)
+ * generic/tkIntDecls.h (regenerated)
- * doc/canvas.n: Documented -outlineoffset item option. [Bug 1836621]
+2008-12-04 Donal K. Fellows <dkf@users.sf.net>
-2007-12-14 Don Porter <dgp@users.sourceforge.net>
+ * doc/ttk_button.n, doc/ttk_checkbutton.n, doc/ttk_menubutton.n:
+ * doc/ttk_radiobutton.n: Added mention of the Toolbutton style to all
+ widgets that can sensibly make use of it.
- * changes: More updates for 8.5.0 release.
+2008-12-03 Joe English <jenglish@users.sourceforge.net>
-2007-12-14 Joe English <jenglish@users.sourceforge.net>
+ * generic/ttk/ttkState.c, generic/ttk/ttkTheme.h,
+ * generic/ttk/ttkWidget.c, doc/ttk_widget.n:
+ Add new "hover" state (patch from Pat Thoyts; needed to support proper
+ visual feedback on Vista).
- * doc/ttk_treeview.n: Fix typo. [Bug 1850713]
+2008-11-29 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/ttk/altTheme.tcl: Use a styled frame around the popdown
+ * library/ttk/clamTheme.tcl: listbox so we can adjust the border
+ * library/ttk/classicTheme.tcl: for each theme as needed.
+ * library/ttk/combobox.tcl:
+ * library/ttk/defaults.tcl:
+ * library/ttk/winTheme.tcl:
+ * library/ttk/xpTheme.tcl:
+ * tests/ttk/combobox.test:
- * win/tkWinInt.h: Add in missing function definitions
- * win/tkWinButton.c: to support plain MSVC6 and use INT_PTR
- * win/tkWinScrlBar.c: rather than LONG_PTR which isn'tr defined
- * win/tkWinWm.c: in the msvc6 headers.
+2008-11-28 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
-2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * generic/tkCanvUtil.c: [Bug 1813597,2218964]: Millimeter patch.
+ * generic/tkInt.h: Eliminates the functional redundancy and
+ * generic/tkObj.c: unnecessary loss of precision of the
+ * generic/tkText.c: {pixel,mm}ObjType tandem.
- * win/nmakehlp.c: Support compilation with MSVC9 for AMD64.
- * win/makefile.vc:
+2008-11-27 Jan Nijtmans <nijtmans@users.sf.net>
-2007-12-13 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkCanvLine.c: Replace Tcl_SetResult(interp, NULL, ....)
+ * generic/tkEntry.c: calls with Tcl_ResetResult(interp)
+ * generic/tkMenu.c
+ * generic/tkOldConfig.c
+ * win/tkWinTest.c: Eliminate warning: unused variable 'tkwin'
- * generic/tkMenubutton.c (ConfigureMenuButton): trace the
- -textvariable even if an image exists as it may use -compound.
+2008-11-23 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkBind.c: [Bug 1389270]: event generate silently ignored
+ * generic/tkFocus.c: focus events. These can now be generated.
+ * generic/tkGrab.c:
+ * generic/tkInt.h:
+ * tests/bind.test: Fixed some locale dependencies in various
+ tests to reduce the noise on non-English windows systems.
- * generic/tkText.c (DeleteIndexRange, TextEditCmd, UpdateDirtyFlag):
- * tests/text.test (text-25.10.1,25.11.[12]):
- Don't require [update idle] to trigger Modified event [Bug 1809538]
- Modified virtual event should only fire on state change [Bug 1799782]
- Make sure we delete chars before triggering <<Modified>> [Bug 1737288]
+2008-11-22 Donal K. Fellows <dkf@users.sf.net>
-2007-12-12 Daniel Steffen <das@users.sourceforge.net>
+ * library/demos/ctext.tcl: Extended to show off what you can do with
+ angled text; there is now a pie selector to change the orientation.
- * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Revert 2007-10-26
- change to window class of transient toplevels that are not also
- overrideredirect. [Bug 1845899]
+2008-11-22 Pat Thoyts <patthoyts@users.sourceforge.net>
- * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Implement more
- * macosx/tkMacOSXMouseEvent.c (BringWindowForward): X11-like transient
- * macosx/tkMacOSXSubwindows.c (XDestroyWindow): behaviour by adding
- transient windows to a window group owned by the master window, this
- ensures transients always remain in front of and are collapsed with the
- master; bring master to front when selecting transient windows; restore
- default window group of transients if master destroyed. [Bug 1845899]
+ * library/ttk/combobox.tcl: [Bug 1939129,1991930]: combobox dropdown
+ was drawn behind topmost toplevels.
+ * generic/tkCanvText.c: Fixed up complaints from MSVC engendered
+ * generic/tkFont.c: by the last commit. In particular replaced
+ * win/tkWinDraw.c: round() which is a C99 function.
+ * win/tkWinFont.c:
-2007-12-12 Joe English <jenglish@users.sourceforge.net>
+2008-11-22 Donal K. Fellows <dkf@users.sf.net>
- * doc/ttk_intro.n, doc/ttk_style.n, doc/ttk_widget.n:
- Various minor updates.
+ TIP #119 IMPLEMENTATION
-2007-12-12 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkCanvText.c: Added -angle configuration option to canvas
+ * generic/tkFont.c: text items. This required reengineering the
+ * library/prolog.ps: whole text rendering engine to be able to
+ * macosx/tkMacOSXFont.c: handle an angle! No change to any external
+ * unix/tkUnixFont.c: API. Note, this feature was originally
+ * unix/tkUnixRFont.c: approved for Tk 8.5, but it has proved much
+ * win/tkWinFont.c: harder to implement than originally
+ * generic/tkInt.h: estimated. [Patch 1611359]
+ * tests/canvText.test:
- * changes: Updated for 8.5.0 release.
+2008-11-22 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-12-11 Joe English <jenglish@users.sourceforge.net>
+ * test/winDialog.test: [Bug 2307837]: Avoid some locale-dependent
+ * win/tkWinTest.c: failures by using id's or an english constraint
- * generic/ttk/ttkTheme.c(StyleElementOptionsCmd):
- Use Ttk_GetElement() to find element instead of direct
- hash table access.
+2008-11-19 Joe English <jenglish@users.sourceforge.net>
-2007-12-11 Donal K. Fellows <dkf@users.sf.net>
+ * doc/ttk_panedwindow.n: [Bug 1824996]: Remove inoperative text
+ stating that slave windows must be direct children of the master.
- * generic/tkText.c (TextReplaceCmd): Added code to rebuild the from
- index after the deletion phase so that the linePtr field is valid for
- the insertion phase. [Bug 1602537]
+2008-11-19 Jan Nijtmans <nijtmans@users.sf.net>
-2007-12-10 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tkImgPhoto.c Minor simplification in fix for [Bug 2312027]
+ no need to malloc and copy photo type name
+ because it is a constant to begin with.
+ * generic/tkOldConfig.c Convert Tcl_SetResult(......, TCL_DYNAMIC) to
+ * mac/tkMacOSXWm.c Tcl_SetResult(......, TCL_VOLATILE), in
+ * unix/tkUnixWm.c preparation for TIP #340
+ * unix/tkUnixSend.c
+ * win/tkWinWm.c
- * doc/event.n: Clarify the fact that [event info] only returns the
- names of virtual events that are bound to physical event sequences.
- This follows on from comments on comp.lang.tcl.
- http://groups.google.com/group/comp.lang.tcl/msg/935d2d226ae8a770
+2008-11-16 Joe English <jenglish@users.sourceforge.net>
-2007-12-10 Joe English <jenglish@users.sourceforge.net>
+ * generic/ttk/ttkWidget.c: [Bug 2298720]: Widget self-destruction is
+ not necessarily an error.
- * doc/AddOption.3, doc/CrtImgType.3, doc/CrtPhImgFmt.3,
- * doc/InternAtom.3, doc/TextLayout.3, doc/chooseColor.n,
- * doc/chooseDirectory.n, doc/loadTk.n, doc/palette.n,
- * doc/ttk_combobox.n: Various markup fixes (mostly: missing quotes on
- .SH arguments, extraneous .PPs)
+2008-11-16 Donal K. Fellows <dkf@users.sf.net>
- * doc/ttk_entry.n, doc/ttk_scrollbar.n, doc/ttk_treeview.n: Remove
- extra .BEs that got added by mistake somewhere.
+ * doc/wm.n: Added note about [wm overrideredirect] so that users will
+ avoid making unwarranted assumptions about how magical it is.
+ Triggered by [Bug 2282861] discussion.
-2007-12-10 Daniel Steffen <das@users.sourceforge.net>
+2008-11-14 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tk.decls: use new genstubs 'export' command to
- * generic/tkInt.decls: mark exported symbols not in stubs
- table [FR 1716117]; cleanup formatting
+ * generic/tk.h: The TIP 125 implementation permits the
+ * generic/tkFrame.c: [wm manage] command to manage any widget but
+ * macosx/tkMacOSXWm.c: only those with Frame instance data should be
+ * unix/tkUnixWm.c: permitted. We now check for the suitability and
+ * win/tkWinWm.c: raise an error for non-frame widgets. Updated
+ * test/wm.test: the tests and documentation. See also [Bug
+ * doc/wm.n: 2239034]
- * generic/tkIntDecls.h: regen with new genStubs.tcl.
- * generic/tkIntPlatDecls.h: [Tcl Bug 1834288]
- * generic/tkIntXlibDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkStubInit.c:
+2008-11-12 Joe English <jenglish@users.sourceforge.net>
-2007-12-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * generic/ttk/ttkWidget.c: Reworked widget construction and
+ destruction sequence; fixes [Bug 2207435] and several other problems
+ discovered during investigation of same.
+ * generic/ttk/ttkButton.c (CheckbuttonInitialize): Account for
+ initializeProc being called earlier in the construction sequence now.
+ * tests/ttk/ttk.test: Updated test suite.
- * tests/safe.test: Ensure list of hidden commands is correct. [Bug
- 1847925]
+2008-11-12 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-12-10 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/text.tcl: [Bug 1777362]: Handle windows with funky names by
+ * test/text.test: avoiding use of the window path for anchors.
- * win/tkWin.h: We must specify the lowest Windows version we intend to
- support. In particular the SystemParametersInfo API doesn't like to
- receive structures that are larger than it expects which affects the
- font assignements. Set to Win98 support.
+2008-11-11 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinFont.c: Handle failure to read the system parameters. This
- causes ttk/fonts.tcl to set any missing named fonts.
+ * generic/tkImgPhoto.c Fix [Bug 2265860] new test failures
- * win/ttkWinMonitor.c: Only tkWin.h should include windows.h unless
- * win/ttkWinTheme.c: we have an explicit override of the WINVER
- * tin/ttkWinXPTheme.c: macro.
+2008-11-11 Joe English <jenglish@users.sourceforge.net>
- * win/rules.vc: Handle MSVC 9 (aka: Visual Studio 2008)
+ * generic/ttk/ttkWidget.c (BeginDrawing): [Bug 2264732]: Don't crash
+ when application uses nondefault visual.
- * tests/safe.test: Update for 'unload' as a safe command (tcl 8.5b3+)
+2008-11-11 Jan Nijtmans <nijtmans@users.sf.net>
-2007-12-09 Donal K. Fellows <dkf@users.sf.net>
+ * win/tcl.m4: Reverted change from 2008-11-06 (was under the
+ impression that "-Wno-implicit-int" added an extra
+ warning)
+ * win/configure (regenerated)
+ * unix/tcl.m4: Use -O2 as gcc optimization compiler flag, and get
+ rid of -Wno-implicit-int for UNIX
+ * unix/configure (regenerated)
- * win/configure.in: Adjusted code so that running configure does not
- generate an error message when the full current directory name
- contains a space.
+ * generic/tk.decls Modify Tk_Create(Old)ImageType signature,
+ * generic/tk.h relaxing the constraint that every Tk_ImageType
+ * generic/tkImage.c can only be passed to this function once. This
+ * generic/tkImgBmap.c lets tkImg be loaded in multiple interpreters
+ * generic/tkImgPhoto.c in a thread-enabled build of Tk. [Bug 2312027]
+ * generic/tkTest.c This CONSTification complies with TIP #27. It
+ * doc/CrtImgType.3 is binary compatible with the old interface,
+ but not fully source compatible (although tkImg
+ does not suffer).
+ * generic/tkDecls.h (regenerated)
- * win/tkWinWm.c: Added set of #defs to make this file build with my
- version of the SDK (i.e. with the msys suite we distribute).
+ *** POTENTIAL INCOMPATIBILITY ***
-2007-12-07 Joe English <jenglish@users.sourceforge.net>
+2008-11-09 Joe English <jenglish@users.sourceforge.net>
- * library/ttk/altTheme.tcl, library/ttk/classicTheme.tcl:
- s/style/ttk::style/.
+ * generic/ttk/ttkWidget.c: Remove unnecessary casts.
-2007-12-07 Don Porter <dgp@users.sourceforge.net>
+ * generic/ttk/ttkWidget.h, generic/ttk/ttkWidget.c: Ttk widget
+ initializeProc()s now return void instead of a status code, and are no
+ longer allowed to fail. (Fix for [Bug 2207435] in progress).
- * unix/README: Mention the stub library created by `make` and warn
- about the effect of embedded paths in the installed binaries. Thanks
- to Larry Virden. [Tcl Bug 1794084]
+ * generic/ttk/ttkButton.c, generic/ttk/ttkEntry.c,
+ * generic/ttk/ttkFrame.c, generic/ttk/ttkNotebook.c,
+ * generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c,
+ * generic/ttk/ttkScale.c, generic/ttk/ttkScrollbar.c,
+ * generic/ttk/ttkTreeview.c: Adjustments for the above.
+
+2008-11-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkCanvas.c: Make all Tk_CustomOption tables const and
+ * generic/tkCanvBmap.c: remove unnecessary type cast.
+ * generic/tkCanvImg.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkRectOval.c:
+ * generic/tkScrollbar.c:
+ * generic/tk.decls: Two more (hopefully the last) signature
+ * generic/tkInt.h: changes in Tk_CreateSmoothMethod and
+ * generic/tkCanvLine.c: Tk_CreatePhotoImageFormat
+ * generic/tkCanvUtil.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkDecls.h: (regenerated)
+ * doc/CrtImgType.3: doc updates
+ * doc/CrtPhImgFmt.3:
-2007-12-05 Joe English <jenglish@users.sourceforge.net>
+2008-11-06 Jan Nijtmans <nijtmans@users.sf.net>
- * macosx/ttkMacOSXTheme.c: Fix TCombobox layout so as not to truncate
- long text when combobox is wider than requested. [Bug 1845164]
+ * win/tcl.m4: Add "-Wno-implicit-int" flag for gcc, as on UNIX
+ * win/configure: (regenerated)
+ * generic/default.h: Use tkUnixDefault.h under CygWin. With this
+ change, at least the X11 version of Tk can be
+ built with cygwin.
-2007-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+2008-11-06 Donal K. Fellows <dkf@users.sf.net>
- * library/demos/widget: reduce start size to 70% of screenheight from
- sh-200 for a more reasonable size.
+ * unix/configure.in: [Bug 2229999]: Work around the fact that the
+ HP-UX system compiler cannot handle 'inline'.
- * win/tkWinButton.c, win/tkWinDialog.c: use SetWindowLongPtr and
- * win/tkWinScrlbr.c, win/tkWinWm.c: GetWindowLongPtr only.
- * win/ttkWinMonitor.c:
+2008-11-05 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinInt.h: remove CS_CLASSDC (not recommended for any apps now)
- * win/tkWinX.c: and simplify WNDCLASS to one style.
- * win/tkWinWm.c: Reduce wrapper update for exStyle to toolwindow
- change only and set WS_EX_LAYERED as sticky (once set on a window, do
- not remove it) to reduce alpha transition flicker.
+ * unix/tkUnixFont.c: [Bug 2226093]: Const changes not all correct
+ * unix/tkUnixButton.c: More internal -Wwrite-strings warning fixes
+ * unix/tkUnixCursor.c:
+ * unix/tkUnixSend.c:
+ * unix/tkUnixRFont.c:
+ * generic/tkInt.h: No need to use CONST in internal header files
+ * generic/tkFont.h
+ * generic/tkInt.decls: CONSTify string and fileName parameters of
+ * generic/tkImgBmap.c: TkGetBitmapData
+ * generic/tkBitmap.c: Remove unneccessary type cast
+ * generic/tkIntDecls.h: (regenerated)
+ * doc/GetCursor.3: Fix documentation about obsolete X10 bitmaps
+ * doc/GetBitmap.3: [Bug 1866774]: Remove X10 references from docs
+
+2008-11-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/ttk/ttkEntry.c: Fix warning: unused variable `currentValue'
+ * generic/tkOldTest.c: Fix warning: assignment discards qualifiers
+ * win/tkWinTest.c: from pointer target type
+
+2008-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/winClipboard.test: testclipboard no longer returns strings
+ with embedded \r but now returns Tcl strings
+ * tests/winfo.test: Fixed embedding test broken during upgrade
+ * tests/busy.test: Default wait cursor on windows is 'wait'
+ * win/tkWinFont.c: const fixes for the windows code.
+
+2008-11-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkFont.h: More internal -Wwrite-strings warning fixes
+ * generic/tkFont.c
+ * generic/ttk/ttkTheme.h
+ * generic/ttk/ttkDefaultTheme.c
+ * generic/ttk/ttkState.c
+ * macosx/tkMacOSXFont.c
+ * unix/tkUnixFont.c
+ * win/tkWinFont.c
- * win/configure, win/tcl.m4 (LIBS_GUI): mingw needs -lole32 -loleaut32
- but not msvc for Tk's [send]. [Bug 1844749]
+2008-11-01 Donal K. Fellows <dkf@users.sf.net>
-2007-12-04 Joe English <jenglish@users.sourceforge.net>
+ TIP #97 IMPLEMENTATION
- * doc/ttk_style.n: Remove nonsense about "this manpage has not yet
- been written"; everything supported is documented.
+ * generic/tkCanvas.c (CanvasWidgetCmd): Implementation of the 'imove'
+ and 'rchars' subcommands.
+ * generic/tk.h (TK_MOVABLE_POINTS): New flag to allow items to state
+ whether they support finding and moving individual coordinates.
+ * doc/canvas.n, tests/canvas.test: Docs 'n' tests.
-2007-12-04 Donal K. Fellows <dkf@users.sf.net>
+2008-11-01 Pat Thoyts <patthoyts@users.sourceforge.net>
- * library/msgs/en.msg: Added missing messages. [Patch 1800744]
+ * generic/ttk/ttkEntry.c: Implemented the themed spinbox
+ * library/ttk/altTheme.tcl: widget.
+ * library/ttk/clamTheme.tcl:
+ * library/ttk/classicTheme.tcl:
+ * library/ttk/defaults.tcl:
+ * library/ttk/entry.tcl:
+ * library/ttk/ttk.tcl:
+ * library/ttk/winTheme.tcl:
+ * library/ttk/xpTheme.tcl:
+ * library/ttk/spinbox.tcl:
+ * win/ttkWinTheme.c:
+ * win/ttkWinXPTheme.c:
+ * doc/ttk_spinbox.n:
+ * tests/ttk/spinbox.test:
+
+2008-10-31 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/widget.c: Temporary workaround for [Bug 2207435]
+
+2008-10-30 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkAtom.c: more internal -Wwrite-strings warning fixes
+ * generic/tkBusy.c
+ * generic/tkButton.c
+ * generic/tkCanvPoly.c
+ * generic/tkCanvText.c
+ * generic/tkCmds.c
+ * generic/tkListbox.c
+ * generic/tkMenu.c
+ * generic/tkOldConfig.c
+ * generic/tkOption.c
+ * generic/tkPanedWindow.c
+ * generic/tkPlace.c
+ * generic/tkScale.c
+ * generic/tkTest.c
+ * generic/tkText.c
+ * generic/tkTextImage.c
- * library/msgs/da.msg: Added Danish messages. [Patch 1844143]. Many
- thanks to Torsten Berg <treincke@users.sf.net>.
+2008-10-30 Don Porter <dgp@users.sourceforge.net>
-2007-12-03 Jeff Hobbs <jeffh@ActiveState.com>
+ * tests/unixSelect.test: Revise the unixSelect-1.* tests so that
+ they test the ability of Tk's selection mechanism to faithfully pass
+ valid Tcl values without corruption, and stop testing details of
+ Tcl's internal encoding scheme. With this change, the Tk test suite
+ no longer uses the identity encoding or [string bytelength].
- * win/configure, win/tcl.m4 (LIBS_GUI): remove ole32.lib oleaut32.lib
- (LIBS): add ws2_32.lib for static builds with Tcl.
+2008-10-30 Jan Nijtmans <nijtmans@users.sf.net>
-2007-12-01 Joe English <jenglish@users.sourceforge.net>
+ * generic/tk.h: CONSTify return value of
+ * generic/tkInt.h Tk_OptionPrintProc, and customPtr
+ * generic/tk.decls field of Tk_ConfigSpec.
+ * generic/tkCanvArc.c See [Bug 2190619]: Warnings due to
+ * generic/tkCanvLine.c Tk_SmoothMethod name constness change
+ * generic/tkCanvUtil.c
+ * generic/tkUtil.c
+ * generic/tkDecls.h: (regenerated)
- * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h,
- * generic/ttk/ttkTheme.c, generic/ttk/ttkLayout.c,
- * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c,
- * generic/ttk/ttkTreeview.c, macosx/ttkMacOSXTheme.c,
- * win/ttkWinTheme.c, win/ttkWinXPTheme.c: Improved macrology for
- statically-initialized layout template tables.
+2008-10-29 Joe English <jenglish@users.sourceforge.net>
-2007-11-28 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkAtom.c(Tk_GetAtomName): Remove incorrect 'const' qualifier.
+ Remove useless 'register' declarations too, while we're at it.
- * unix/tkUnixPort.h: When unix/configure determines whether the
- intptr_t type is available, it has the <inttypes.h> header present.
- It's only fair that we let Tk have it too.
+2008-10-28 Jan Nijtmans <nijtmans@users.sf.net>
-2007-11-26 Kevin Kenny <kennykb@acm.org>
+ * generic/tk.h: Add "const" to a few struct member fields.
+ * generic/tkInt.h: CONSTify TkPrintPadAmount
+ * generic/tkSelect.h: Move TkSelGetSelection to tkInt.decls
+ * generic/tk.decls: CONSTify Tk_ParseArgv
+ * generic/tkInt.decls: CONSTify TkCreateFrame and TkCreateMainWindow
+ * generic/tkDecls.h: (regenerated)
+ * generic/tkIntDecls.h: (regenerated)
+ * generic/tkArgv.c:
+ * generic/tkAtom.c:
+ * generic/tkEntry.c:
+ * generic/tkFrame.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkPack.c:
+ * generic/tkSelect.c:
+ * generic/tkVisual.c:
+ * generic/tkWindow.c:
+ * win/tkWinTest.c: Fix compilation under mingw32
- * generic/tkImgPPM.c (StringReadPPM): Corrected a comparison whose
- sense was reversed that resulted in reading beyond the end of the
- input buffer on malformed PPM data. [Bug 1822391]
- * library/tkfbox.tcl (VerifyFileName): Corrected a couple of typos in
- handling of bad file names. [Bug 1822076] Thanks to Christoph Bauer
- (fridolin@users.sf.net) for the patch.
- * tests/filebox.test (filebox-7.1, filebox-7.2): Added test cases that
- exercise. [Bug 1822076]
- * tests/imgPPM.test (imgPPM-4.1): Added test case that exercises. [Bug
- 1822391]
+2008-10-28 Joe English <jenglish@users.sourceforge.net>
-2007-11-25 Joe English <jenglish@users.sourceforge.net>
+ * library/ttk/cursors.tcl, library/ttk/combobox.tcl,
+ library/ttk/entry.tcl, library/ttk/paned.tcl, library/ttk/sizegrip.tcl,
+ library/treeview.tcl:
+ [Bug 2054562]: Add correct platform-specific cursors for OSX
+ [Bug 1534835]: Expanded set of symbolic cursors. Use correct cursor
+ for ttk::entry and ttk::combobox widgets
- * generic/ttk/ttkManager.h, generic/ttk/ttkManager.c,
- * generic/ttk/ttkFrame.c, generic/ttk/ttkNotebook.c,
- * generic/ttk/ttkPanedwindow.c: Internal Ttk_Manager API updates;
- Fixed [Bug 1343984]; Added [$nb hide] method; [$nb add] on
- already-managed windows no longer throws an error, can be used to
- re-add a hidden tab.
+2008-10-28 Don Porter <dgp@users.sourceforge.net>
- * doc/ttk_notebook.n, tests/ttk/notebook.test,
- * tests/ttk/panedwindow.test: Updated docs and test suite.
+ * win/tkWinTest.c: [Bug 2191960]: Revise [testclipboard]
+ * tests/winClipboard.test: to form that handles encodings.
+ * tests/constraints.tcl: [tcltest::bytestring] no longer used.
-2007-11-23 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-10-24 Joe English <jenglish@users.sourceforge.net>
- * unix/README: General improvements.
+ * tests/ttk/ttk.test: [Bug 2175411]: Disable test ttk-6.3, it's not
+ applicable.
-2007-11-21 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * generic/ttk/ttkTheme.c: Use different Tcl_AssocData key so the tile
+ extension can be loaded into an 8.6 interp, in the off-chance that
+ anyone wants to do this.
- * library/tkfbox.tcl: Better theming in the file list area.
+2008-10-24 Donal K. Fellows <dkf@users.sf.net>
-2007-11-19 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkCanvUtil.c (TkSmoothPrintProc): [Bug 2190619]: Corrected
+ 'const'ness to quell warning.
- *** 8.5b3 TAGGED FOR RELEASE ***
+2008-10-23 Don Porter <dgp@users.sourceforge.net>
- * README: Bump version number to 8.5b3.
+ * README: Bump version number to 8.6a4
* generic/tk.h:
* library/tk.tcl:
* unix/configure.in:
@@ -2183,396 +3402,273 @@
* unix/configure: autoconf-2.59
* win/configure:
- * changes: Update changes for 8.5b3 release.
-
-2007-11-19 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/ttk/ttkTheme.c: Fix crash when 'style element create'
- * tests/ttk/ttk.test: called w/ insufficient args; add tests.
-
-2007-11-18 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkElements.c, macosx/ttkMacOSXTheme.c: Add "fill"
- element: like "background" but only erases parcel.
-
- * generic/ttk/ttkFrame.c: Use fill element in Labelframe Label
- sublayout. Also improved default labelmargins for -labelanchor w*, e*.
-
- * generic/ttk/ttkLabel.c: no longer need Labelframe hack.
-
- * library/ttk/aquaTheme.tcl: ImageTextElement no longer needed.
- TextElement no longer needs '-background' option.
-
- * generic/ttk/ttkFrame.c: Use sublayout for ttk::labelframe labels
- instead of single element.
-
- * generic/ttk/ttkLabel.c: Default -anchor for text and label elements
- is now "w" instead of "center". [Bug 1614540]
-
- * library/ttk/defaults.tcl, library/ttk/*Theme.tcl: Button styles now
- need explicit "-anchor center".
-
- * generic/ttk/ttkLayout.c (TTKInitPadding): BUGFIX:
- Ttk_GetPaddingFromObj() and Ttk_GetBorderFromObj() returned garbage
- when passed an empty list.
-
- * macosx/ttkMacOSXTheme.c: Resynchronize with Tile codebase so that
- patches can flow back and forth.
-
- * library/ttk/aquaTheme.tcl: Extra TButton -padding no longer needed.
-
-2007-11-18 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/ttkWinXPTheme.c: Add support for size information flags for
- scrollbar and combobox buttons. This handles Tile [Patches 1596647 and
- 1596657] but a bit more generically.
-
-2007-11-17 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/(tkArgv.c, tkBind.c, tkCipboard.c, tkEntry.c, tkOption.c,
- tkScale.c, tkScrollbar.c, tkTextImage.c, tkVisual.c, tkWindow.c): Tidy
- up some variable types.
-
- * generic/tkFont.c: Only check for -displayof if there are
- * test/font.test: sufficient arguments. This permits checking
- strings like -d.
-
-2007-11-17 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/scrollbar.tcl: Swap in core scrollbars for
- [ttk::scrollbar]s on OSX.
-
-2007-11-16 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
-
- * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Correct an
- oversight in the bug fix from 2007-11-11. [Bug 1824638]
-
-2007-11-15 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new chanio.test.
- * macosx/Wish.xcode/project.pbxproj:
-
-2007-11-14 Donal K. Fellows <dkf@users.sf.net>
+2008-10-22 Jan Nijtmans <nijtmans@users.sf.net>
- * library/msgs/sv.msg: Get the locale declared within the message
- catalog correct! [Bug 1831803]
+ * generic/tk.h: CONST -> const and white-spacing
+ * generic/tk.decls
+ * generic/tkInt.decls
+ * generic/tkDecls.h: (regenerated)
+ * generic/tkIntDecls.h: (regenerated)
+ * generic/tkIntPlatDecls.h: (regenerated)
+ * generic/tkIntXlibDecls.h: (regenerated)
+ * generic/tkPlatDecls.h: (regenerated)
+ * generic/ttk/tk.decls
+ * generic/ttk/ttkDecls.h (regenerated)
+ * generic/ttk/ttkGenStubs.tcl
-2007-11-11 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+2008-10-20 Donal K. Fellows <dkf@users.sf.net>
- * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Fix the case when
- TK_WHOLE_WORDS and TK_AT_LEAST_ONE are both set and maxLength is small.
- [Bug 1824638]
+ * generic/tkBusy.c, macosx/tkMacOSXEmbed.c, unix/tkUnixEmbed.c:
+ * win/tkWinWindow.c: [Bug 2180919]: Factor out the platform-specific
+ parts into the platform directories.
-2007-11-09 Daniel Steffen <das@users.sourceforge.net>
+2008-10-18 Donal K. Fellows <dkf@users.sf.net>
- * macosx/tkMacOSXCarbonEvents.c
- (InstallStandardApplicationEventHandler): on Mac OS X Leopard, replace
- the 2005-11-27 approach of installing the standard application handler
- by calling RAEL and immediately longjmping out of it from an event
- handler, as that now leads to crashes in -[NSView unlockFocus] whenever
- HIToolbox uses Cocoa in Leopard (Help menu, Nav Services, Color
- Picker). Instead call InstallStandardEventHandler() on the application
- and menubar event targets, as Leopard ISEH finally handles these
- correctly. Unfortunately need a HIToolbox-internal SPI to retrieve the
- menubar event target, no public API appears have that functionality.
+ TIP #321 IMPLEMENTATION
- * macosx/tkMacOSXDebug.c: make TkMacOSXInitNamedDebugSymbol()
- * macosx/tkMacOSXDebug.h: available outside of debug builds as
- the new Leopard ISAEH needs it.
+ * generic/tkBusy.c, doc/busy.n, tests/busy.test: [Patch 1997907]:
+ Implementation of the [tk busy] command.
- * macosx/tkMacOSXButton.c: replace HiliteControl() by modern API
- * macosx/tkMacOSXMenubutton.c: for activation and enabling;
- distinguish inactive and disabled
- look&feel; correct activation handling
- to match that of container toplevel.
+2008-10-18 Pat Thoyts <patthoyts@users.sourceforge.net>
- * macosx/tkMacOSXMenubutton.c: correct size computation of bevelbutton
- variant to match that of buttons;
- fix crash with bitmap due to NULL GC;
- delay picParams setup until needed;
- formatting cleanup. [Bug 1824521]
+ * win/tkWinFont.c: [Bug 1825353]: To fix a problem with tiny fonts on
+ Russian versions of Windows we will avoid removing the internal
+ leading for fixed width fonts.
- * library/menu.tcl: correct handling of menubutton "active"
- state on Aqua to match that of buttons.
+2008-10-15 Jan Nijtmans <nijtmans@users.sf.net>
- * macosx/tkMacOSXDefault.h: correct button & menubutton active
- foreground and background colors and
- menubutton border width.
-
- * macosx/tkMacOSXWindowEvent.c: handle kEventWindowExpanding carbon
- * macosx/tkMacOSXCarbonEvents.c: event instead of kEventWindowExpanded
- to ensure activate event arrives after
- window is remapped, also need to
- process all Tk events generated by
- remapping in the event handler to
- ensure children are remapped before
- activate event is processed.
-
- * macosx/tkMacOSXSubwindows.c: add pixmap size field to MacDrawable
- * macosx/tkMacOSXInt.h: struct; add flag for B&W pixmaps.
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXEmbed.c:
- * macosx/tkMacOSXMenu.c:
-
- * macosx/tkMacOSXPrivate.h: correct Leopard HIToolboxVersionNumber.
-
- * macosx/ttkMacOSXTheme.c: add error checking; cleanup formatting.
-
- * macosx/tkMacOSXFont.c (TkpGetFontAttrsForChar): panic on false return
- from TkMacOSXSetupDrawingContext().
-
- * macosx/tkMacOSXButton.c: sync formatting, whitespace, copyright
- * macosx/tkMacOSXDialog.c: with core-8-4-branch.
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXWm.c:
- * xlib/xgc.c
- * library/bgerror.tcl:
- * library/console.tcl:
- * library/menu.tcl:
-
-2007-11-07 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkTheme.c (Ttk_ElementSize): Fixed longstanding,
- subtle bug that caused element padding to sometimes be counted
- twice in size computations.
-
- * generic/ttk/ttkElements.c, generic/ttk/ttkClamTheme.c,
- generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkTreeview.c,
- generic/ttk/ttkImage.c, macosx/ttkMacOSXTheme.c,
- win/ttkWinTheme.c, win/ttkWinXPTheme.c: Fix ElementSizeProcs affected
- by previous change.
-
-2007-11-06 Andreas Kupries <andreask@activestate.com>
-
- * doc/CrtConsoleChan.3: Fixed markup typo and extended see also
- section per suggestions by Donal.
-
-2007-11-05 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/combobox.tcl: Set focus to listbox in <Map> binding
- instead of in Post command (see [Bug 1349811] for info).
-
-2007-11-05 Andreas Kupries <andreask@activestate.com>
-
- * doc/CrtConsoleChan.3: New file providing minimal documentation
- of 'Tk_InitConsoleChannels()'. [Bug 432435]
-
-2007-11-05 Joe English <jenglish@users.sourceforge.net>
-
- * macosx/ttkMacOSXTheme.c (TreeitemLayout): Remove focus ring
- from treeview items on OSX (problem reported by Kevin Walzer).
-
-2007-11-04 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkTreeview.c: Use null "treearea" element for
- treeview owner-draw area instead of "client", to avoid
- nameclash with Notebook.client element (this was causing
- sizing anomalies in XP theme, and introduced extraneous
- padding).
- * generic/ttk/ttkDefaultTheme.c: Treeitem.indicator element
- needs left margin now.
-
-2007-11-04 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXMenus.c: add "Run Widget Demo" menu item to the
- default Edit menu along with associated carbon event handler enabling
- the item only if demo files are installed; cleanup handling of "About"
- and "Source" menu items.
-
- * library/bgerror.tcl: fix background of detail text on Aqua.
-
- * library/console.tcl: add accelerators and fix Aqua bindings
- of the new font size menu items.
-
- * library/demos/mclist.tcl: Aqua GOOBE.
- * library/demos/tree.tcl:
- * library/demos/ttknote.tcl:
- * library/demos/widget:
-
- * doc/chooseDirectory.n: remove/correct obsolete Mac OS 9-era
- * doc/getOpenFile.n: information.
- * doc/menu.n:
-
- * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent): fix boolean arg
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new demo file.
- * macosx/Wish.xcode/project.pbxproj:
-
-2007-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/console.tcl: Add menu item and key binding to adjust font.
-
-2007-11-02 Donal K. Fellows <dkf@users.sf.net>
-
- * library/demos/mclist.tcl: Added a demo of how to do a multi-column
- sortable listbox.
-
- * library/msgbox.tcl: Made message dialog use Ttk widgets for better
- L&F.
-
- * library/tkfbox.tcl (::tk::dialog::file::CompleteEnt): Added <Tab>
- completion. [FR 805091]
- * library/tkfbox.tcl: Made file dialog use Ttk widgets for better L&F.
-
- * library/demos/sayings.tcl: Better resizing. [Bug 1822410]
-
-2007-11-01 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/demos/textpeer.tcl: Better resizing. [Bug 1822601]
-
- * doc/colors.n: Added list of Windows system colors. [Bug 945409]
-
-2007-11-01 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXColor.c (GetThemeColor): improve translation of RGB
- pixel values into RGBColor.
-
- * library/demos/widget: increase height of main window text widget to
- use more of the available vertical space.
-
- * doc/bind.n: document the Option modifier, clarify meaning
- and availability of Command & Option.
-
- * doc/console.n: clarify availability of [console] in TkAqua.
-
-2007-11-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * unix/installManPage, doc/*.n: Make documentation use the name that
- scripts use as much as possible. [Bug 1640073]
-
- * doc/text.n: Fixed mistake in [$t tag remove] docs. [Bug 1792191]
-
- * doc/bind.n: Documented the Command modifier. [Bug 1232908]
-
- * doc/console.n, doc/wish.1: Made it clearer when and why the console
- command is present. [Bug 1386955]
-
-2007-10-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/demos/entry3.tcl: Improved description/comments so that
- people better understand what is being validated, following suggestion
- from Don Porter.
-
- * library/demos/image2.tcl (loadImage): Mark non-loadable images
- as such instead of throwing a nasty dialog, following suggestion
- from Don Porter.
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock): More optimization, derived
- from [Patch 224066].
-
-2007-10-30 Joe English <jenglish@users.sourceforge.net>
+ * generic/tk.h: Add "const" to many internal const tables, so
+ * generic/tkBind.c: those will be put by the C-compiler in the
+ * generic/tkButton.c: TEXT segment instead of the DATA segment.
+ * generic/tkCanvas.c: This makes those tables as being shareable in
+ * generic/tkClipboard.c: shared libraries.
+ * generic/tkCmds.c:
+ * generic/tkConsole.c:
+ * generic/tkEntry.c:
+ * generic/tkFocus.c:
+ * generic/tkFrame.c:
+ * generic/tkGet.c:
+ * generic/tkGrab.c:
+ * generic/tkGrid.c:
+ * generic/tkImage.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgGIF.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkListbox.c:
+ * generic/tkMenu.c:
+ * generic/tkMenu.h:
+ * generic/tkMenubutton.c:
+ * generic/tkMessage.c:
+ * generic/tkOption.c:
+ * generic/tkPack.c:
+ * generic/tkPanedWindow.c:
+ * generic/tkPlace.c:
+ * generic/tkScale.c:
+ * generic/tkSelect.c:
+ * generic/tkSquare.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextMark.c:
+ * generic/tkTextTag.c:
+ * generic/tkTextWind.c:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/tkMacOSXWin.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinButton.c:
+ * win/tkWinColor.c:
+ * win/tkWinDialog.c:
+ * win/tkWinMenu.c:
+ * win/tkWinSend.c:
+ * win/tkWinWm.c:
+ * xlib/xcolors.c:
- * library/ttk/combobox.tcl (Unpost): BUGFIX: Unpost can be called with
- no preceding Post.
+2008-10-17 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-10-31 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * library/ttk/scale.tcl: Implemented keyboard bindings for ttk::scale
- * win/rules.vc: Use -fp:strict with msvc8 as -fp:precise fails on
- * generic/tkObj.c: amd64 builds. Fix the two places in Tk that
- * generic/tkTrig.c: generate errors with msvc8 when using this flag.
+2008-10-15 Jan Nijtmans <nijtmans@users.sf.net>
-2007-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkInt.h: Add "const" to many internal const tables, so
+ * generic/tk3d.c: those will be put by the C-compiler in the
+ * generic/tkBitmap.c: TEXT segment instead of the DATA segment.
+ * generic/tkColor.c: This makes those tables as being shareable in
+ * generic/tkConfig.c: shared libraries.
+ * generic/tkCursor.c:
+ * generic/tkFont.c:
+ * generic/tkObj.c:
+ * generic/tkStyle.c:
+ * generic/tkTextIndex.c:
+ * generic/tkUtil.c:
- * library/choosedir.tcl: only enable OK button when valid in
- conjunction with -mustexist. [Bug 1550528]
+2008-10-14 Donal K. Fellows <dkf@users.sf.net>
- * library/listbox.tcl (::tk::ListboxBeginSelect): ignore -takefocus
- when considering focus on <1>, it is for tab focus.
+ * generic/tkObj.c (TkNewWindowObj): Added utility function for making
+ a Tcl_Obj from a Tk_Window reference. Candidate for future exposure to
+ third-party code I suppose, but useful internal to Tk for sure.
-2007-10-30 Don Porter <dgp@users.sourceforge.net>
+2008-10-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * generic/tk.h: Bump version number to 8.5b2.1 to distinguish
- * library/tk.tcl: CVS development snapshots from the 8.5b2
- * unix/configure.in: release.
- * unix/tk.spec:
- * win/configure.in:
+ * generic/tkCanvas.c (CanvasWidgetCmd): Corrected result generation.
- * unix/configure: autoconf (2.59)
- * win/configure:
+2008-10-10 Don Porter <dgp@users.sourceforge.net>
-2007-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+ *** 8.6a3 TAGGED FOR RELEASE ***
- * doc/text.n: fix spelling of -inactiveselectbackground [Bug 1626415]
+ * changes: Updates for 8.6a3 release.
- * library/entry.tcl: don't error with Clear event. [Bug 1509288]
+2008-10-09 Don Porter <dgp@users.sourceforge.net>
- * library/ttk/fonts.tcl: use size -12 TkFixedFont (was -10) on X11
+ * generic/tkListbox.c: Make literal return values consistent with
+ those generated by Tcl_PrintDouble().
-2007-10-30 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * tests/entry.test: Restore test naming consistency with Tk 8.5.
+ * tests/listbox.test: Remove some more dependency on precision in
+ * tests/spinbox.test: test results.
- * library/demos/unicodeout.tcl: Fixed Arabic and Hebrew rendering on
- Windows. [Bug 1803723]
+2008-10-08 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tkImgPhoto.c (ImgPhotoCmd): Rename enumeration for somewhat
- simpler-to-read code. [Bug 1677613]
+ * unix/tcl.m4: [Bug 2073255]: fix
+ * unix/configure: regenerated
-2007-10-30 Joe English <jenglish@users.sourceforge.net>
+2008-10-08 Don Porter <dgp@users.sourceforge.net>
- * generic/ttk/ttkWidget.c: Split up RedisplayWidget() to factor out
- double-buffering related code.
+ * tests/textDisp.test (textDisp-16.34): Update test that tested string
+ equality of double values based on an assumption of tcl_precision==12.
+ Test now does its own formatting.
- * macosx/ttkMacOSXAquaTheme.c: Use SetThemeBackGround/
- kThemeBrushModelessDialogBackground{Active|Inactive} instead of
- ApplyThemeBackground/kThemeBackgroundWindowHeader (advice from DAS).
+ * tests/scrollbar.test: Revised testing of the cget subcommand so that
+ it tests consistency with the configure subcommand and not agreement
+ with a hardcoded value that will change as tastes in GUIs evolve.
- * library/ttk/aquaTheme.tcl: Use darker shade for inactive and
- disabled text, to match typical values of most
- kThemeXXXTextColorInactive values.
+ * tests/canvText.test (canvText-17.1): Update expected result to match
+ revised PostScript output due to more predictable formatting of
+ floating point values.
-2007-10-30 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * unix/tkUnixWm.c: [Bug 2021443]: Restored consistency of error
+ * macosx/tkMacOSXWm.c: messages from [wm iconphoto] with the test
+ * tests/unixWm.test: suite and across all platforms.
- * doc/selection.n: Clarify UTF8_STRING handling. [Bug 1778563]
+2008-10-07 Pat Thoyts <patthoyts@users.sourceforge.net>
- * doc/text.n: Clarify search subccommand docs. [Bug 1622919]
+ * tests/canvImg.test: Removed dependency on precision in results
+ * tests/canvRect.test:
+ * tests/canvText.test:
+ * tests/entry.test:
+ * tests/listbox.test:
+ * tests/scrollbar.test:
+ * tests/spinbox.test:
+ * tests/winWm.test: Fixed incorrect error strings
+ * tests/wm.test:
-2007-10-29 Jeff Hobbs <jeffh@ActiveState.com>
+2008-10-06 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/winDialog.test: Fixed tests for Vista+
+ * win/tkWinWm.c: corrected some errors from the previous commit
+
+2008-10-05 Donal K. Fellows <dkf@users.sf.net>
+
+ * win/tkWinWm.c (WmAttributesCmd, WmOverrideredirectCmd)
+ (WmStackorderCmd):
+ * win/tkWinSendCom.c (Async):
+ * win/tkWinSend.c (Tk_SendObjCmd):
+ * win/tkWinFont.c (TkpGetFontFamilies, TkpGetSubFonts):
+ * unix/tkUnixWm.c (WmOverrideredirectCmd, WmStackorderCmd):
+ * unix/tkUnixFont.c (TkpGetFontFamilies, TkpGetSubFonts):
+ * macosx/tkMacOSXWm.c (WmOverrideredirectCmd, WmStackorderCmd):
+ * generic/tkTextIndex.c (SetTextIndexFromAny):
+ * generic/tkTest.c (TrivialConfigObjCmd):
+ * generic/tkSelect.c (HandleTclCommand):
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd)
+ (PanedWindowSashCommand, PanedWindowProxyCommand):
+ * generic/tkMenubutton.c (Tk_MenubuttonObjCmd):
+ * generic/tkMenu.c (MenuWidgetObjCmd):
+ * generic/tkListbox.c (ListboxWidgetObjCmd):
+ * generic/tkImgPhoto.c (ImgPhotoCmd): (mostly)
+ * generic/tkImage.c (Tk_ImageObjCmd):
+ * generic/tkFont.c (Tk_FontObjCmd, GetAttributeInfoObj):
+ * generic/tkEntry.c (EntryWidgetObjCmd, SpinboxWidgetObjCmd):
+ * generic/tkConfig.c (SetOptionFromAny, Tk_SetOptions):
+ * generic/tkCmds.c (Tk_TkObjCmd, Tk_WinfoObjCmd, TkGetDisplayOf):
+ * generic/tkButton.c (ButtonCreate): Get rid of code that insists on
+ non-idiomatically writing to the object in the interpreter result.
+
+2008-10-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkArgv.c, generic/tkCanvText.c, generic/tkEntry.c:
+ * generic/tkListbox.c, generic/tkScrollbar.c, macosx/tkMacOSXScrlbr.c:
+ * win/tkWinScrlbr.c: [Bug 2112563]: Convert use of %g to
+ Tcl_PrintDouble to create string versions of floats so as to avoid
+ trouble with some locales.
+
+2008-10-02 Joe Mistachkin <joe@mistachkin.com>
+
+ * doc/canvas.n: Fix unmatched font change.
+ * win/buildall.vc.bat: Prefer the HtmlHelp target over the WinHelp
+ target.
+
+2008-10-01 Donal K. Fellows <dkf@users.sf.net>
+
+ TIP #236 IMPLEMENTATION
+
+ * doc/canvas.n, generic/tkCanvas.c (CanvasWidgetCmd)
+ * tests/canvMoveto.test: Added 'moveto' subcommand to canvases to
+ allow items to be easily moved to a particular place.
+
+2008-09-23 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/listbox.n (SEE ALSO): [Bug 2123813]: Redirected this to
+ ttk::treeview(n) which is far more useful (it does multicolumn listbox
+ duties).
+
+ * doc/*.n: [Bug 2118116]: Make sure that the initial line of the
+ manpage includes nothing that chokes old versions of man.
- * macosx/tkMacOSXFont.c (InitSystemFonts):
- * library/ttk/fonts.tcl: use Monaco 11 (was 9) as Aqua TkFixedFont
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
- * tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test:
- * library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl:
- * library/msgbox.tcl, library/optMenu.tcl, library/tclIndex:
- * library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt:
- * library/demos/tcolor, library/demos/text.tcl:
- * library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look
- * library/ttk/fonts.tcl: Update of Tk default look in 8.5
- * macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look
- * unix/tkUnixDefault.h: with minor modifications for Win32/Aqua.
- * win/tkWinDefault.h: Uses Tk*Font definitions throughout for
- * win/tkWinFont.c: classic widgets. [Bug 1820344]
- * library/obsolete.tcl (::tk::classic::restore): This restores
- changes made to defaults in 8.5 using the 'option' command,
- segmented into logical groups.
+ * library/menu.tcl: [Bug 1023955]: Additional fix.
- * tests/winfo.test: winfo-4.5 raise .t to above . for Windows
+2008-09-08 Todd M. Helfter <tmh@users.sourceforge.net>
- * tests/unixWm.test: note TIP#142 results and remove unnecessary
- catches.
+ * doc/menu.n: [Bug 2098425]: Fix typo in docs.
-2007-10-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2008-09-03 Don Porter <dgp@users.sourceforge.net>
- * doc/*.1, doc/*.n, doc/*.3: Lots more GOOBE work.
+ * generic/tk.h: Dropped use of _ANSI_ARGS_ macro to preserve
+ * generic/tkSelect.h: Tk's TCL_NO_DEPRECATED build.
-2007-10-28 Joe English <jenglish@users.sourceforge.net>
+2008-08-30 Ania Pawelczyk <aniap@users.sourceforge.net>
- * library/ttk/combobox.tcl: Make popdown window [wm resizable 0 0] on
- OSX, to prevent TkAqua from shrinking the scrollbar to make room for a
- grow box that isn't there.
- * macosx/ttkMacOSXTheme.c, library/ttk/aquaTheme.tcl: Reworked
- combobox layout.
+ * tests/textWind.test: Update to tcltest2
+ * tests/unixSelect.test:
+ * tests/visual_bb.test:
+ * tests/visual.test:
+ * tests/window.test:
+ * tests/winfo.test:
+ * tests/xmfbox.test:
+ * tests/winButton.test:
+ * tests/winDialog.test:
+ * tests/winFont.test:
+ * tests/winMenu.test:
+ * tests/winMsbox.test:
+ * tests/winWm.test:
-2007-10-26 Don Porter <dgp@users.sourceforge.net>
+2008-08-28 Don Porter <dgp@users.sourceforge.net>
- *** 8.5b2 TAGGED FOR RELEASE ***
+ * unix/tkConfig.sh.in: Added @XFT_LIBS@ to the definition of TK_LIBS
+ to avoid link failures when a "big wish" program links against a
+ --disable-shared build of libtk. (Discovered building expectTk.)
- * changes: Update changes for 8.5b2 release.
+ * generic/tkImgPhoto.c: Changed TclStack* calls to ck* calls so that
+ we don't create new dependencies on Tcl internals.
- * doc/*.1: Revert doc changes that broke
- * doc/*.3: `make html` so we can get the release
- * doc/*.n: out the door.
+ * unix/tkUnixPort.h: Removed #include of tclInt.h that has been
+ * win/tkWinPort.h: disabled for three years. If we needed this
+ we'd have noticed by now.
- * README: Bump version number to 8.5b2.
+ * README: Bump version number to 8.6a3
* generic/tk.h:
* library/tk.tcl:
* unix/configure.in:
@@ -2582,2620 +3678,614 @@
* unix/configure: autoconf-2.59
* win/configure:
-2007-10-26 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class
- of transient toplevels that are not also overrideredirect. [Bug
- 1816252]
-
- * macosx/tkMacOSXDialog.c: TIP#242 cleanup.
- * library/demos/filebox.tcl: demo TIP#242 -typevariable.
-
-2007-10-25 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkNotebook.c: [Bug 1817596]
-
-2007-10-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/getOpenFile.n: TIP#242 implementation of -typevariable to
- * library/tkfbox.tcl: return type of selected file in file dialogs.
- * library/xmfbox.tcl: [Bug 1156388]
- * macosx/tkMacOSXDialog.c:
- * tests/filebox.test:
- * tests/winDialog.test:
- * win/tkWinDialog.c:
-
-2007-10-25 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkPlace.c: Prevent segfault in place geometry manager.
- Thanks to Colin McDonald. [Bug 1818491]
-
-2007-10-24 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/*.c, win/{ttkWinMonitor,ttkWinTheme,ttkWinXPTheme}.c,
- * macosx/ttkMacOSXTheme.c: Move widget layout registration
- from TtkElements_Init() to widget *_Init() routines.
- Renaming/consistency: s/...ElementGeometry()/...ElementSize()/
-
-2007-10-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/*.n, doc/*.3, doc/*.1: Lots of changes to take advantage of the
- new macros.
-
-2007-10-24 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/tkWinDraw.c: Applied [Patch 1723362] for transparent bitmaps.
-
- * generic/tkWindow.c: permit wm manage of any widget (esp: ttk::frame)
+2008-08-28 Donal K. Fellows <dkf@users.sf.net>
-2007-10-23 Jeff Hobbs <jeffh@ActiveState.com>
+ * tests/imgPhoto.test: [Bug 2080587]: Fix failures.
- * library/ttk/combobox.tcl (ttk::combobox::PopdownWindow): redo wm
- transient on each drop to handle reparent-able frames. [Bug 1818441]
+2008-08-28 Ania Pawelczyk <aniap@users.sourceforge.net>
-2007-10-23 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/combobox.tcl: [namespace import ::ttk::scrollbar]
- doesn't work, since ttk::scrollbar isn't [namespace export]ed.
-
-2007-10-23 Don Porter <dgp@users.sourceforge.net>
-
- * tests/cursor.test: Make tests robust against changes in Tcl's
- rules for accepting integers in octal format.
-
-2007-10-23 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * doc/font.n: Added section on the TIP#145 fonts.
-
-2007-10-23 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/tkWinFont.c: Fixed leak in CreateNamedFont spotted by das.
-
-2007-10-23 Daniel Steffen <das@users.sourceforge.net>
-
- * library/demos/combo.tcl: Aqua GOOBE.
- * library/demos/toolbar.tcl:
- * library/demos/tree.tcl:
- * library/demos/ttknote.tcl:
- * library/demos/ttkprogress.tcl:
- * library/demos/widget:
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
- * macosx/Wish.xcode/project.pbxproj:
-
-2007-10-22 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/demos/widget: Added more demos, reorganized to make Tk and
- Ttk demos seem to be more coherent whole. Made localization a bit
- easier by reducing the amount of duplication.
- * library/demos/{combo,toolbar,tree,ttknote,ttkprogress}.tcl: New
- demos of new (mostly) Ttk widgets.
- * library/demos/ttkbut.tcl: Improvements.
-
-2007-10-22 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/combobox.tcl: ttk::combobox overhaul; fixes [Bugs
- 1814778, 1780286, 1609168, 1349586]
- * library/ttk/aquaTheme.tcl: Factored out aqua-specific combobox
- -postposition adjustments.
- * generic/ttk/ttkTrack.c: Detect [grab]s and unpress pressed
- element; combobox workaround no longer
- needed.
-
-2007-10-22 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXFont.c: register named fonts for TIP #145 fonts
- and all theme font IDs.
-
- * generic/tkFont.c (Tk{Create,Delete}NamedFont): allow NULL interp.
-
- * library/ttk/fonts.tcl: check for TIP #145 fonts on all
- platforms; correct aqua font sizes.
-
- * library/demos/ttkmenu.tcl: Aqua GOOBE.
- * library/demos/ttkpane.tcl:
- * library/demos/widget:
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
- * macosx/Wish.xcode/project.pbxproj:
-
-2007-10-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/demos/ttkmenu.tcl: Added more demos of Ttk widgets. These
- * library/demos/ttkpane.tcl: ones are of menubuttons, panedwindows and
- a progress bar (indirectly).
+ * tests/option.test: Update to tcltest2
+ * tests/place.test:
+ * tests/scale.test:
+ * tests/select.test:
+ * tests/textBTree.test:
+ * tests/textImage.test:
+ * tests/textMark.test:
+ * tests/textTag.test:
+ * tests/unixMenu.test:
-2007-10-18 Pat Thoyts <patthoyts@users.sourceforge.net>
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
- * library/ttk/fonts.tcl: Create all the TIP #145 font names on all
- platforms (mac and unix get handled in script, windows in C)
+ * library/menu.tcl: [Bug 1023955]: Fix typo.
-2007-10-17 David Gravereaux <davygrvy@pobox.com>
+2008-08-27 Peter Spjuth <peter.spjuth@gmail.com>
- * bitmaps/*.xbm: Changed CVS storage mode from -kb to -kkv as these
- are really text files, not binaries.
- * win/makefile.vc: Added $(BITMAPDIR) to the search path for the
- depend target.
+ * tests/grid.test: [Bug 2075285]: Added a "knownBug"-marked test to
+ show a problem identified in the grid implementation.
-2007-10-18 Daniel Steffen <das@users.sourceforge.net>
+2008-08-26 Donal K. Fellows <dkf@users.sf.net>
- * library/demos/widget: Aqua GOOBE, cleanup icons.
- * library/demos/ttkbut.tcl:
- * library/demos/entry3.tcl:
- * library/demos/msgbox.tcl:
+ * tests/imgPhoto.test: More style improvements.
- * library/demos/button.tcl: restore setting of button
- highlightbackground on Aqua.
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
- * macosx/ttkMacOSXTheme.c: adjust button and separator geometry.
+ * library/menu.tcl: [Bug 1023955]: Do not flip to the arrow cursor on
+ menus. This was a Motif convention. Current behavior is maintained iff
+ tk_strictMotif is enabled.
- * macosx/tkMacOSXWm.c: fix warnings.
+2008-08-25 Donal K. Fellows <dkf@users.sf.net>
- * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
- * macosx/Wish.xcode/project.pbxproj:
+ * generic/tkImgPhoto.c (ImgPhotoConfigureMaster): Ensure that uses of
+ TclStackAlloc and TclStackFree balance.
-2007-10-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
- * library/demos/ttkbut.tcl: Added demo of the basic Ttk widgets.
+ * library/tkfbox.tcl: [Bug 1936220]: Fix the multiple selection error
+ for tk_getOpenFile -multiple 1 which fails on all unix platforms since
+ the adoption of ttk widgets.
-2007-10-16 David Gravereaux <davygrvy@pobox.com>
+2008-08-25 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPhoto.c: Split the implementation of the core of
+ * generic/tkImgPhoto.h: photo images into two pieces, the photo
+ * generic/tkImgPhInstance.c: master (which manages the data model and
+ the interaction with the script level) and the photo instances (which
+ handle display).
+
+2008-08-22 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.6a2 TAGGED FOR RELEASE ***
+
+ * changes: Updates for 8.6a2 release.
+
+2008-08-21 Ania Pawelczyk <aniap@users.sourceforge.net>
+
+ * tests/menuDraw.test: Update to tcltest2
+ * tests/msgbox.test:
+ * tests/oldpack.test:
+ * tests/pack.test:
+ * tests/panedwindow.test:
+
+2008-08-21 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkOption.c (ExtendArray): Rework so that the code uses
+ ckrealloc (idiomatically) rather than its home-brewed version.
+
+2008-08-19 George Peter Staplin <georgeps@users.sourceforge.net>
+
+ [Bug 2039720]: After some discussion with Joe English and subsequently
+ the X.org developers (Keith Packard in particular), it was discovered
+ that Tk is doing management of XIDs that it shouldn't need to do. The
+ very common XC-MISC extension which has come with every version of X
+ for the last 15 years is used with Xlib now, to retrieve the
+ information about the used/unused XIDs. The public Tk_FreeXId is now a
+ no-op.
+
+ * generic/tkError.c: Remove the usage of TkpWindowWasRecentlyDeleted.
+ * generic/tkInt.decls: Update the declarations for the now unused
+ internal stubs.
+ * generic/tkIntDecls.h: Regenerated based on tkInt.decls.
+ * generic/tkIntPlatDecls.h: Regenerated based on tkInt.decls.
+ * generic/tkStubInit.c
+ * generic/tkWindow.c: Remove the calls to TkInitXId, and
+ TkFreeWindowId.
+ * macosx/tkMaxOSXPort.h: Remove TkFreeWindowId and TkInitXId macro
+ definitions.
+ * macosx/tkMacOSXXStubs.c: Remove the no-op
+ TkpWindowWasRecentlyDeleted.
+ * unix/tkUnixEvent.c: Remove call to TkFreeXId.
+ * unix/tkUnixXId.c: Remove a lot of unnecessary code (see above).
+ * win/tkWinPort.h: Remove TkFreeWindowId and TkInitXId.
+ * win/tkWinWindow.c: Remove TkpWindowWasRecentlyDeleted.
+ * tests/id.test: Remove this unnecessary test.
- * win/makefile.vc: depend target now works and builds a generated
- dependency list with $(TCLTOOLSDIR)/mkdepend.tcl
+2008-08-19 Joe English <jenglish@users.sourceforge.net>
-2007-10-16 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * generic/ttk/ttkScroll.c: Don't use sprintf "%g" to format floating
+ point numbers in -[xy]scrollcommand callbacks or [xy]view methods.
+ Minor incompatibility: 0 and 1 now formatted as "0.0" resp "1.0".
+ * tests/ttk/entry.test, tests/ttk/treeview.test: Updated to account
+ for above change.
- * library/demos/widget: Made the code for generating the contents of
- the main widget more informative. Added 'new' flagging for wholly new
- demos.
+2008-08-19 Daniel Steffen <das@users.sourceforge.net>
- * doc/text.n: Made it clearer what things are text widget invokations
- and what are not. Also some other clarity improvements.
+ * macosx/tkMacOSXFont.c (SetFontFeatures): Disable antialiasing of
+ fixed-width fonts with
+ size <= 10.
-2007-10-15 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-08-18 Ania Pawelczyk <aniap@users.sourceforge.net>
- * library/demos/widget: Use Ttk widgets for the widget demo core, for
- vastly improved look-and-feel on at least one platform (Windows).
- * library/demos/{button,check,style,twind}.tcl: Various tweaks for
- GOOBE...
- * library/demos/textpeer.tcl: New demo script to show off peering as a
- specific feature.
+ * tests/canvWind.test: Update to tcltest2
+ * tests/menubut.test:
+ * tests/raise.test:
+ * tests/unixButton.test:
+ * tests/unixEmbed.test:
+ * tests/winClipboard.test:
-2007-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+2008-08-17 Ania Pawelczyk <aniap@users.sourceforge.net>
- * generic/tkFocus.c, generic/tkFrame.c, generic/tkInt.h:
- * macosx/tkMacOSXButton.c, macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXWm.c, unix/tkUnixWm.c, win/tkWinWm.c:
- * doc/wm.n, tests/wm.test: TIP #125 implementation [Bug 998125]
- Adds [wm manage|forget] for dockable frames.
- Finished X11 and Windows code, needs OS X completion.
+ * tests/focus.test: Update to tcltest2
+ * tests/focusTcl.test:
+ * tests/geometry.test:
+ * tests/grab.test:
+ * tests/grid.test:
+ * tests/imgBmap.test:
+ * tests/imgPhoto.test:
+ * tests/imgPPM.test:
+ * tests/listbox.test:
+ * tests/safe.test:
+ * tests/tk.test:
+ * tests/util.test:
-2007-10-15 Joe English <jenglish@users.sourceforge.net>
+2008-08-15 Ania Pawelczyk <aniap@users.sourceforge.net>
- * generic/ttk/ttkTreeview.c: Store pointer to column table entry
- instead of column index in columnNames hash table. This avoids the
- need for the evil PTR2INT and INT2PTR macros, and simplifies things a
- bit.
+ * tests/clrpick.test: Update to tcltest2
+ * tests/frame.test:
+ * tests/font.test:
+ * tests/image.test:
-2007-10-15 Daniel Steffen <das@users.sourceforge.net>
+2008-08-14 Ania Pawelczyk <aniap@users.sourceforge.net>
- * generic/tkArgv.c: Fix gcc warnings about 'cast to/from
- * generic/tkCanvUtil.c: pointer from/to integer of different
- * generic/tkCanvas.c: size' on 64-bit platforms by casting
- * generic/tkCursor.c: to intermediate types
- * generic/tkInt.h: intptr_t/uintptr_t via new PTR2INT(),
- * generic/tkListbox.c: INT2PTR(), PTR2UINT() and UINT2PTR()
- * generic/tkObj.c: macros.
- * generic/tkStyle.c:
- * generic/tkTextIndex.c:
- * generic/tkUtil.c:
- * generic/ttk/ttkTheme.h:
- * generic/ttk/ttkTreeview.c:
- * unix/tkUnixMenu.c:
- * unix/configure.in:
+ * tests/event.test: Update to tcltest2
+ * tests/id.test:
+ * tests/menu.test:
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
+2008-08-14 Daniel Steffen <das@users.sourceforge.net>
- * macosx/Wish-Common.xcconfig: add 'tktest-X11' target.
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.xcode/default.pbxuser:
- * macosx/Wish.xcodeproj/default.pbxuser:
- * macosx/Wish.xcodeproj/project.pbxproj:
+ * unix/tcl.m4 (SC_PATH_X): Check for libX11.dylib in addition to
+ libX11.so et al.
- * unix/configure.in (Darwin): add support for 64-bit X11.
* unix/configure: autoconf-2.59
-2007-10-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/configure, win/configure.in (TK_WIN_VERSION): Make sure the
- patchlevel doesn't contain extra dotted pairs (eg. interim release)
-
-2007-10-12 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Mine all version information from headers.
- * win/rules.vc: Sync tcl and tk and bring extension versions
- * win/nmakehlp.c: closer together. Try and avoid using tclsh
- to do substitutions as we may cross compile.
-
- * library/console.tcl: Use TkFixedFont and ttk widgets
-
-2007-10-12 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDraw.c: replace all (internal) use of QD region
- * macosx/tkMacOSXSubwindows.c: API by HIShape API, with conversion to
- * macosx/tkMacOSXWindowEvent.c: QD regions only when required by legacy
- * macosx/tkMacOSXPrivate.h: Carbon or Tk API.
- * macosx/tkMacOSXRegion.c:
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDebug.h:
-
- * macosx/tkMacOSXInt.h: replace MacDrawable's QD RgnHandles
- * macosx/tkMacOSXEmbed.c: clipRgn, aboveClipRgn & drawRgn by
- * macosx/tkMacOSXMenu.c: HIShapeRefs visRgn & aboveVisRgn and
- * macosx/tkMacOSXSubwindows.c: CGRect drawRect.
-
- * macosx/tkMacOSXWindowEvent.c: remove use of QD port vis rgn in window
- * macosx/tkMacOSXSubwindows.c: update rgn calculation, manually excise
- * macosx/tkMacOSXWm.c: growbox from toplevel clip rgn instead.
-
- * macosx/tkMacOSXDraw.c: replace use of QD port clip rgn by new
- * macosx/tkMacOSXPrivate.h: clipRgn fld in TkMacOSXDrawingContext;
- handle QD/CG drawing mismatches in
- XCopyArea, XCopyPlane and TkPutImage;
- cleanup/speedup CGContext setup in
- TkMacOSXSetupDrawingContext().
-
- * macosx/tkMacOSXDraw.c: change TkMacOSXSetupDrawingContext() to
- * macosx/tkMacOSXEntry.c: return boolean indicating whether
- * macosx/tkMacOSXFont.c: drawing is allowed (and was setup) or
- * macosx/tkMacOSXMenu.c: not (e.g. when clipRgn is empty).
- * macosx/ttkMacOSXTheme.c:
-
- * macosx/tkMacOSXSubwindows.c: signal that drawable is a pixmap via
- * macosx/tkMacOSXInt.h: new explicit TK_IS_PIXMAP flag instead
- of a NULL cligRgn field.
-
- * macosx/tkMacOSXRegion.c: add wrappers for missing/buggy HIShape
- * macosx/tkMacOSXPrivate.h: API, and private helpers to operate on
- HIShapeRefs & convert to/from TkRegion.
-
- * macosx/tkMacOSXRegion.c: add Tkp{Retain,Release}Region() API for
- * macosx/tkMacOSXInt.h: TkRegion.
-
- * xlib/xgc.c: factor out alloc/free of GC clip_mask;
- * macosx/tkMacOSXXStubs.c: manage clip rgn lifetime with new
- Tkp{Retain,Release}Region().
+2008-08-12 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/tkMacOSXButton.c: delay picParams setup until needed.
+ * tests/choosedir.test: Update to tcltest2
+ * tests/clipboard.test:
+ * tests/embed.test:
+ * tests/main.test:
- * generic/tkTextDisp.c (CharUndisplayProc): fix textDisp.test crash.
+2008-08-12 Don Porter <dgp@users.sourceforge.net>
-2007-10-11 David Gravereaux <davygrvy@pobox.com>
-
- * win/winMain.c: Replaced incorrect comments in main() to descibe
- why the console widget does not need to be created for this
- application entry point (if used). Must have been a bad copy/paste
- of WinMain() from 10 years back.
-
-2007-10-11 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): manually constrain resize
- limitBounds to maxBounds, works around SectRect() mis-feature (return
- zero rect if input rect has zero height/width). [Bug 1810818]
-
-2007-10-09 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkImage.c: Make Ttk_GetImage safe if called with NULL
- * tests/ttk/image.test: interp. Added some tests that crash
- on Windows without this fix.
-
-2007-10-02 Don Porter <dgp@users.sourceforge.net>
-
- [core-stabilizer-branch]
-
- * README: Bump version number to 8.5.0
+ * README: Bump version number to 8.6a2
* generic/tk.h:
* library/tk.tcl:
- * unix/configure.in: Updated LOCALES.
+ * unix/configure.in:
* unix/tk.spec:
* win/configure.in:
- * unix/configure: autoconf (2.59)
+ * unix/configure: autoconf-2.59
* win/configure:
-2007-09-30 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/entry.tcl (WordBack, WordForward):
- Fix private routines accidentally defined in global namespace
- [Bug 1803836]
-
-2007-09-26 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/msgs/hu.msg: Added Hungarian message set, from Pader Reszo.
- [Patch 1800742]
-
-2007-09-20 Donal K. Fellows <dkf@users.sf.net>
-
- *** 8.5b1 TAGGED FOR RELEASE ***
-
- * generic/tkTextDisp.c (LayoutDLine): Only call callbacks that are
- * tests/textDisp.test (textDisp-32.3): not NULL. [Bug 1791052]
-
-2007-09-20 Don Porter <dgp@users.sourceforge.net>
-
- * changes: updates for 8.5b1 release.
-
-2007-09-19 Don Porter <dgp@users.sourceforge.net>
-
- * README: Bump version number to 8.5b1.
- * generic/tk.h: Merge from core-stabilizer-branch.
- * library/tk.tcl: Stabilizing toward 8.5b1 release now done
- * unix/configure.in: on the HEAD. core-stabilizer-branch is
- * unix/tk.spec: now suspended.
- * win/configure.in:
-
-2007-09-19 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkStubLib.: Replaced isdigit with internal implementation.
-
-2007-09-18 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkStubLib.c: Remove C library calls from Tk_InitStubs()
- * win/makefile.vc: so that we don't need the C library linked
- in to libtkStub.
-
-2007-09-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgGIF.c (FileReadGIF, StringReadGIF): Rewrite for greater
- clarity (more comments, saner code arrangement, etc.)
-
-2007-09-18 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * tests/all.tcl: Made ttk/all.tcl be the same as tk's all.tcl and
- * tests/ttk/all.tcl: make use of file normalize (bugs noted by
- mjanssen and GPS with msys)
-
-2007-09-17 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Add crt flags for tkStubLib now it uses C-library
- functions.
-
-2007-09-17 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable' to
- build shared libraries on current NetBSDs. [Bug 1749251]
- * unix/configure: regenerated (autoconf-2.59).
-
-2007-09-17 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Revised callers of Tcl_InitStubs() to account
- * generic/tkMain.c: for restored compatible support for the call
- * generic/tkWindow.c: Tcl_InitStubs(interp, TCL_VERSION, 1). Also
- revised Tcl_PkgRequire() call for Tcl so that, for example, a Tk
- library built against Tcl 8.5.1 headers will not refuse to [load] into
- a Tcl 8.5.0 interpreter. [Tcl Bug 1578344]
-
- * generic/tk.h: Revised Tk_InitStubs() to restore Tk 8.4
- * generic/tkStubLib.c: source compatibility with callers of
- * generic/tkWindow.c: Tk_InitStubs(interp, TK_VERSION, 1).
-
-2007-09-17 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/combobox.tcl: Try to improve combobox appearance on
- OSX + Tk 8.5. [Bug 1780286]
-
-2007-09-15 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4: replace all direct references to compiler by ${CC} to
- enable CC overriding at configure & make time; run
- check for visibility "hidden" with all compilers;
- quoting fixes from TEA tcl.m4.
- (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by
- 'cc' compiler driver.
- * unix/configure: autoconf-2.59
-
-2007-09-14 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish-Common.xcconfig: enable Tcl DTrace support.
- * macosx/Wish.xcodeproj/project.pbxproj:
-
-2007-09-12 Andreas Kupries <andreask@activestate.com>
-
- * win/Makefile.in (install-binaries): Fixed missing brace in the
- * win/makefile.vc (install-binaries): generated package index file.
- Note: unix/Makefile.in is good.
-
-2007-09-11 Reinhard Max <max@suse.de>
-
- * generic/tkImgGIF.c: Fixed a buffer overrun that got triggered by
- multi-frame interlaced GIFs that contain subsequent frames that are
- smaller than the first one.
-
- * tests/imgPhoto.test: Added a test for the above.
-
-2007-09-11 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Revised calls to Tcl_InitStubs() and
- * generic/tkMain.c: [package require Tcl] so that Tk Says What It
- * generic/tkWindow.c: Means using the new facilties of [package] in
- * library/tk.tcl: Tcl 8.5 about what version(s) of Tcl it is
- * unix/Makefile.in: willing to work with. [Bug 1578344]
- * win/Makefile.in:
- * win/makefile.vc:
-
-2007-09-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/README: typo corrections [Bug 1788682]
-
-2007-09-10 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Revise all Tcl_InitStubs() calls to restore
- * generic/tkMain.c: the traditional practice that a Tk shared
- * generic/tkWindow.c: library may [load] into a Tcl 8.5 interp at
- any patchlevel. This practice also matches the compile time checks of
- TCL_MAJOR_VERSION and TCL_MINOR_VERSION in tk.h. [Bug 1723622]
+ * changes: Updates for 8.6a2 release.
-2007-09-06 Don Porter <dgp@users.sourceforge.net>
+2008-08-11 Ania Pawelczyk <aniap@users.sourceforge.net>
- * generic/tkWindow.c (Initialize): Moved common Tk initialization
- * generic/tkInitScript.h (removed): script out of tkInitScript.h
- * macosx/tkMacOSXInit.c: and multiple TkpInit() routines and
- * unix/Makefile.in: into the common Initialize() routine in
- * unix/tkUnixInit.c: generic code. Also removed constraint on
- * win/tkWinInit.c: ability to define a custom [tkInit] before
- calling Tk_Init(). Until now the custom [tkInit] had to be a proc. Now
- it can be any command. Removal of tkInitScript.h also fixes [Bug
- 1656283].
+ * tests/canvImg.test: Update to tcltest2
+ * tests/canvRect.test:
+ * tests/canvText.test:
+ * tests/obj.test:
-2007-09-06 Daniel Steffen <das@users.sourceforge.net>
+2008-08-07 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/Wish.xcode/project.pbxproj: discontinue unmaintained support
- * macosx/Wish.xcode/default.pbxuser: for Xcode 1.5; replace by Xcode2
- project for use on Tiger (with Wish.xcodeproj to be used on Leopard).
+ * tests/canvPs.test: Update to tcltest2
+ * tests/config.test:
+ * tests/canvas.test:
- * macosx/Wish.xcodeproj/project.pbxproj: updates for Xcode 2.5 and 3.0.
- * macosx/Wish.xcodeproj/default.pbxuser:
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.xcode/default.pbxuser:
- * macosx/Wish-Common.xcconfig:
-
- * macosx/README: document project changes.
-
-2007-09-04 Joe English <jenglish@users.sourceforge.net>
-
- * generic/tkTest.c: Fix for [Bug 1788019] "tkTest.c compiler warning".
-
-2007-09-04 Don Porter <dgp@users.sourceforge.net>
-
- * unix/Makefile.in: It's unreliable to count on the release
- manager to remember to `make genstubs` before `make dist`. Let the
- Makefile remember the dependency for us.
-
- * unix/Makefile.in: Corrections to `make dist` dependencies to be
- sure that macosx/configure gets generated whenever it does not exist.
-
-2007-09-03 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/ttk/ttkInit.c (Ttk_Init): register ttk in package database
- to enable extension access to the ttkStubs table.
-
- * generic/ttk/ttkDecls.h: correct capitalization of ttk package name.
-
-2007-08-28 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- Assorted documentation improvements.
- * doc/button.n: Added examples.
- * doc/checkbutton.n: Added example.
- * doc/console.n: Standardized section ordering.
- * doc/tk.n: Added "See also".
- * doc/ttk_combobox.n: Added keywords.
-
-2007-08-27 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDialog.c (Tk_ChooseColorObjCmd): correct setting of
- interp result [Bug 1782105]; fix -initialcolor overwriting last color
- selection; style cleanup.
-
-2007-08-21 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/rules.vc: Synchronize with tcl rules.vc
- * tests/all.tcl: Fix the line-endings.
-
-2007-08-07 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in: Add support for compile flags specific to
- object files linked directly into executables.
-
- * unix/configure.in (Darwin): Only use -seg1addr flag when prebinding;
- use -mdynamic-no-pic flag for object files linked directly into exes.
-
- * unix/configure: autoconf-2.59
-
-2007-08-01 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/tkWinDialog.c: Fix [Bug 1692927] (buffer length problems)
- * win/tkWinTest.c: Added 'testfindwindow' and 'testgetwindowinfo'
- and extended 'testwinevent' for WM_COMMAND support to enable testing
- native messagebox dialogs.
- * tests/winMsgbox.test: New Windows native messagebox tests.
-
-2007-07-25 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDialog.c (NavServicesGetFile): Reset interp result on
- nav dialog cancel. [Bug 1743786]
-
-2007-07-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in: clarify what the headers installed are, and
- add ttkTheme.h and ttkDecls.h to private headers (later public).
-
-2007-07-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWindowEvent.c (Tk_MacOSXIsAppInFront): Use process mgr
- * macosx/tkMacOSXMouseEvent.c: to determine if
- app is in front instead of relying on activate/deactivate events (which
- may arrive after this info is needed, e.g. during window drag/click
- activation); replace other process mgr use to get this info with calls
- to Tk_MacOSXIsAppInFront().
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): Correct
- window click activation, titlebar click handling and background window
- dragging/growing in the presence of grabs or window-/app-modal windows;
- fix window click activation bringing all other app windows to front.
-
- * macosx/tkMacOSXDraw.c (TkPutImage): Handle non-native XImage byte and
- bit orders; reverse bits via xBitReverseTable instead of InvertByte().
-
-2007-07-06 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/aquaTheme.tcl: Set -anchor w for TMenubuttons.
- [Bug 1614540]
-
-2007-07-04 Andreas Kupries <andreask@activestate.com>
-
- * macosx/tkMacOSXXStubs.c (DestroyImage): Fixed seg.fault in release
- of image data for images coming from XGetImage. Change committed by me
- for Daniel Steffen. See 2007-06-23 for the change which introduced the
- problem.
-
-2007-07-02 Daniel Steffen <das@users.sourceforge.net>
-
- * xlib/xgc.c (XCreateGC): Correct black and white pixel values used to
- initialize GC foregrund and background fields.
-
- * macosx/tkMacOSXColor.c: Add debug messages for unknown pixel values.
-
- * macosx/tkMacOSXDraw.c (TkMacOSXRestoreDrawingContext): Don't restore
- port state if it wasn't altered by TkMacOSXSetupDrawingContext().
-
-2007-06-29 Daniel Steffen <das@users.sourceforge.net>
-
- * xlib/ximage.c: Bitmaps created from the static .xbm
- arrays always have LSBFirst bit order.
-
- * unix/configure.in: Fix flag used to weak-link libXss.
- * unix/configure: autoconf-2.59
-
- * macosx/tkMacOSXScrlbr.c: Correct int <-> dobule conversion issues
- that could lead to Carbon getting confused about scrollbar thumb size.
-
- * macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage): Use
- TkMacOSX{Setup,Restore}DrawingContext() to setup/restore clip & colors.
- (TkMacOSXSetupDrawingContext, TkMacOSXRestoreDrawingContext): Add save
- and restore of QD port clip region; factor out clip region code common
- to CG and QD branches; check for port and context validity; handle
- tkPictureIsOpen flag during QD port setup.
- (TkScrollWindow): Remove unnecessary scroll region manipulation
-
- * macosx/tkMacOSXDraw.c: Remove second global QD temp region
- * macosx/tkMacOSXInt.h: (no longer necessary) and rename
- * macosx/tkMacOSXRegion.c: remaining global QD temp region.
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
-
- * macosx/tkMacOSXDraw.c: Make useCGDrawing variable MODULE_SCOPE
- * macosx/tkMacOSXFont.c: and respect it for ATSUI font drawing.
-
- * macosx/tkMacOSXButton.c: Reduce reliance on current QD port
- * macosx/tkMacOSXColor.c: setting and remove unnecessary
- * macosx/tkMacOSXDebug.c: references to a drawable's QD port,
- * macosx/tkMacOSXDebug.h: notably replace GetWindowFromPort(
- * macosx/tkMacOSXDialog.c: TkMacOSXGetDrawablePort()) idiom by new
- * macosx/tkMacOSXDraw.c: TkMacOSXDrawableWindow() and change
- * macosx/tkMacOSXKeyEvent.c: TkMacOSXSetColorInPort() to take a port
- * macosx/tkMacOSXMenu.c: argument.
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXInt.h: Factor out macros, declarations
- * macosx/tkMacOSXPrivate.h (new): and prototypes that are purely
- internal and private to the 'macosx' sources into a new internal header
- file that does _not_ get installed into Tk.framework/PrivateHeaders.
-
- * macosx/tkMacOSXButton.c: #include new tkMacOSXPrivate.h
- * macosx/tkMacOSXCarbonEvents.c: instead of tkMacOSXInt.h.
- * macosx/tkMacOSXClipboard.c:
- * macosx/tkMacOSXColor.c:
- * macosx/tkMacOSXCursor.c:
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXHLEvents.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXNotify.c:
- * macosx/tkMacOSXRegion.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
- * macosx/ttkMacOSXTheme.c:
-
- * macosx/Wish.xcodeproj/project.pbxproj: Improve support for renamed
- * macosx/Wish.xcodeproj/default.pbxuser: tcl and tk source dirs; add
- * macosx/Wish-Common.xcconfig: 10.5 SDK build config; remove
- tclMathOp.c.
-
- * macosx/README: Document Wish.xcodeproj changes.
-
-2007-06-23 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkImgPhoto.c (ImgPhotoConfigureInstance, DisposeInstance):
- Use XDestroyImage instead of XFree to destroy XImage; replace runtime
- endianness determination by compile-time check for WORDS_BIGENDIAN.
-
- * xlib/ximage.c (XCreateBitmapFromData): Use XCreateImage and
- XDestroyImage instead of creating XImage structure manually.
-
- * macosx/tkMacOSXXStubs.c (XCreateImage, DestroyImage): Correct XImage
- bytes_per_line/bitmap_pad calculations and endianness setting; free
- image data and XImage structure at destruction; formatting cleanup.
-
- * macosx/tkMacOSXDialog.c (NavServicesGetFile): Disable app-modal
- sheet variant of nav dialog on OS versions where it causes problems.
-
-2007-06-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/ttk/ttk.tcl: Should require Tk before pseudo-providing
- tile 0.8.0.
-
-2007-06-09 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkPanedwindow.c, doc/ttk_panedwindow.n,
- * tests/ttk/panedwindow.test: Added -width and -height options. Added
- 'panes' method, return list of managed windows. 'sashpos' method is
- now documented as part of the public interface, and details clarified.
- Should be easier to set initial sash positions now. Alleviates [Bug
- 1659067].
-
-2007-06-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (WmIconphotoCmd): fix wm iconphoto RGBA issues.
- [Bug 1467997] (janssen)
-
- * win/tkWinMenu.c (TkWinHandleMenuEvent): Improve handling to allow
- for unicode char menu indices and not use CharUpper on Tcl utf
- strings. [Bug 1734223]
-
-2007-06-09 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkManager.h, generic/ttk/ttkManager.c,
- * generic/ttk/ttkNotebook.c, generic/ttk/ttkPanedwindow.c,
- * generic/ttk/ttkFrame.c: Ttk_Manager API overhaul:
- + Ttk_Manager no longer responsible for managing slave records
- + Ttk_Manager structure now opaque
- + Ttk_Slave structure now private
- + Pass Ttk_Manager* to Tk_GeomMgr hooks instead of Ttk_Slave*
-
- * generic/ttk/ttkFrame.c: Simplified -labelwidget management.
-
- * doc/ttk_panedwindow.n, library/ttk/panedwindow.tcl: Changed
- documentation of ttk::panedwindow 'identify' command to match
- implementation.
-
- * generic/ttk/ttkNotebook.c, tests/ttk/notebook.test:
- BUGFIX: ttk::noteboook 'insert' command didn't correctly maintain
- current tab.
-
-2007-06-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXColor.c: Fix issues with TK_{IF,ELSE,ENDIF} macros;
- * macosx/tkMacOSXDraw.c: implement Jaguar equivalent of unavailable
- * macosx/tkMacOSXEntry.c: kHIToolboxVersion global; panic at startup
- * macosx/tkMacOSXEvent.c: if MAC_OS_X_VERSION_MIN_REQUIRED constraint
- * macosx/tkMacOSXInit.c: is not satisfied.
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage)
- (TkMacOSXSetupDrawingContext): Factor out common code and standardize
- setup/restore of port, context and clipping; formatting cleanup.
-
- * macosx/tkMacOSXWindowEvent.c: Add error checking.
- * macosx/tkMacOSXMenu.c: Fix gcc3 warning.
- * macosx/tkMacOSXScrlbr.c: Fix testsuite crash.
- * macosx/tkMacOSXSubwindows.c: Formatting cleanup.
- * macosx/tkMacOSXRegion.c: Fix typos.
- * macosx/tkMacOSXScale.c:
-
- * macosx/tkMacOSXXStubs.c (Tk_GetUserInactiveTime): Remove superfluous
- CFRetain/CFRelease.
-
- * macosx/Wish-Release.xcconfig: Disable tktest release build stripping.
-
- * macosx/Wish.xcodeproj/project.pbxproj: Add new Tclsh-Info.plist.in.
-
-2007-06-06 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXInt.h: Use native debug message API when available.
- * macosx/Wish-Debug.xcconfig:
-
- * macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): Enable
- processing of mousewheel events in background windows.
-
- * macosx/tkMacOSXScrlbr.c: Modernize checks for active/front window.
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXWm.c:
+2008-08-05 Joe English <jenglish@users.sourceforge.net>
- * macosx/tkMacOSXColor.c: Factor out verbose #ifdef checks of
- * macosx/tkMacOSXDraw.c: MAC_OS_X_VERSION_{MAX_ALLOWED,MIN_REQUIRED}
- * macosx/tkMacOSXEntry.c: and runtime checks of kHIToolboxVersion into
- * macosx/tkMacOSXEvent.c: new TK_{IF,ELSE,ENDIF}_MAC_OS_X macros.
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXWm.c:
+ * generic/tk.h, generic/tkEvent.c: Fix for [Bug 2010422] "no event
+ type or button # or keysym while executing "bind Listbox
+ <MouseWheel> [...]".
- * macosx/tkMacOSXDraw.c: Factor out clip clearing in QD ports;
- * macosx/tkMacOSXEntry.c: Formatting cleanup.
+2008-08-03 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/Wish.xcodeproj/project.pbxproj: Add settings for Fix&Continue.
+ * tests/cmds.test: Update to tcltest2
+ * tests/dialog.test:
+ * tests/get.test:
+ * tests/text.test: Update to tcltest2; report: 33.11 fails
- * unix/configure.in (Darwin): Link the Tk and Wish plists into their
- binaries in all cases; fix 64bit arch removal in fat 32&64bit builds.
+2008-08-01 Pat Thoyts <patthoyts@users.sourceforge.net>
- * unix/tcl.m4 (Darwin): Fix CF checks in fat 32&64bit builds.
- * unix/configure: autoconf-2.59
+ * win/tkWinWm.c: [Bug 2028703]: Check wmPtr is valid in
+ * tests/wm.test: TopLevelReqProc.
-2007-06-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2008-07-31 Don Porter <dgp@users.sourceforge.net>
- * doc/photo.n: Clarified the fact that base64 support for the -data
- option is not universal. [Bug 1731348] (matzek)
+ * generic/tk.h: Added missing EXTERN for the Tcl_PkgInitStubsCheck
+ declaration to fix inability to embed non-stub-enabled Tk on Windows.
-2007-06-03 Daniel Steffen <das@users.sourceforge.net>
+2008-07-29 Ania Pawelczyk <aniap@users.sourceforge.net>
- * unix/Makefile.in: Add datarootdir to silence autoconf-2.6x warning.
+ * tests/constraints.tcl: -highlightthickness entry's option (fonts
+ constraint)
- * macosx/Wish.xcodeproj/default.pbxuser: Add ttk tests.
+2008-07-28 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/tkMacOSXMenu.c: Add error checking; whitespace cleanup.
+ * tests/cursor.test: Update to tcltest2
+ * tests/message.test:
- * macosx/tkMacOSXDraw.c: Comment formatting fixes for Xcode 3.0
- * macosx/tkMacOSXEmbed.c:
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXKeyboard.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXSend.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
+2008-07-26 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-06-02 Daniel Steffen <das@users.sourceforge.net>
+ * doc/options.n: [Bug 1686012]: Direct to the font manual for -font.
- * macosx/tkMacOSXMenu.c (TkpPostMenu): Ensure cascade menus display in
- posted menus that are not part of the menubar or attached to a
- menubutton (fixes bug reported on tcl-mac by Linus Nyberg).
+ * tests/constraints.tcl: Add a nonwin contraint.
+ * tests/listbox.test: [Bug 2024753]: Conform to testing policy.
-2007-05-31 Daniel Steffen <das@users.sourceforge.net>
+ * win/tkWinWm.c: [Bug 2009788]: Check that the parent has been mapped
+ * tests/wm.test: before calling RemapWindows.
- * macosx/tkMacOSXWindowEvent.c (GenerateUpdateEvent): Complete all
- pending idle-time redraws before newly posted Expose events are
- processed; add bounds of redrawn windows to update region to ensure
- all child windows overdrawn by parents are redrawn.
+ * win/tkWinWindow.c: [Bug 2026405]: Check for 0x prefix in sprintf %p.
- * macosx/tkMacOSXWindowEvent.c: Centralize clip and window invalidation
- * macosx/tkMacOSXSubwindows.c: after location/size changes in the
- * macosx/tkMacOSXWm.c: BoundsChanged carbon event handler;
- correct/add window invalidation after window attribute changes.
+2008-07-25 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/tkMacOSXSubwindows.c (XResizeWindow, XMoveResizeWindow)
- (XMoveWindow): Factor out common code dealing with embedded and
- non-toplevel windows; remove unnecessary clip and window invalidation.
+ * tests/bind.test: Update to tcltest2
- * macosx/tkMacOSXButton.c (TkpDisplayButton): Move clip setup closer
- to native button drawing calls.
+2008-07-24 Jan Nijtmans <nijtmans@users.sf.net>
- * macosx/tkMacOSXWm.c (TkMacOSXIsWindowZoomed, TkMacOSXZoomToplevel):
- Correct handling of gridded windows in max size calculations.
+ * generic/*.c: [Bug 2021443]: Fix inconsistant "wrong # args" messages
+ * macosx/tkMacOSXSend.c
+ * macosx/tkMacOSXWm.c
+ * unix/tkUnixSend.c
+ * unix/tkUnixWm.c
+ * tests/*.test
- * macosx/tkMacOSXEvent.c (TkMacOSXFlushWindows): Use HIWindowFlush API
- when available.
+2008-07-22 Ania Pawelczyk <aniap@users.sourceforge.net>
- * macosx/tkMacOSXColor.c: Cleanup whitespace and formatting.
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWm.c:
+ * tests/bell.test: Update to tcltest2
+ * tests/bgerror.test:
+ * tests/bitmap.test:
+ * tests/border.test:
+ * tests/button.test:
+ * tests/entry.test:
+ * tests/spinbox.test:
- * generic/tkFont.c: #ifdef out debug msg printing to stderr.
- * generic/tkTextDisp.c:
+2008-07-22 Daniel Steffen <das@users.sourceforge.net>
-2007-05-30 Don Porter <dgp@users.sourceforge.net>
+ * library/ttk/aquaTheme.tcl: Use system color names and TIP145 named
+ font instead of hardcoded color values and deprecated native font name
- * generic/tk.h: Correct placement of #include <tcl.h>. [Bug 1723812]
+ * macosx/tkMacOSXHLEvents.c: Factor out common code; formatting.
-2007-05-30 Daniel Steffen <das@users.sourceforge.net>
+2008-07-08 Pat Thoyts <patthoyts@users.sourceforge.net>
- * library/bgerror.tcl: Standardize dialog option & button size
- * library/dialog.tcl: modifications done when running on on Aqua.
- * library/msgbox.tcl:
+ * doc/*.n: Fixed broken line endings from last doc commit.
- * library/demos/button.tcl: Set button highlightbackground on Aqua.
+2008-07-04 Joe English <jenglish@users.sourceforge.net>
- * macosx/tkMacOSXMenu.c (DrawMenuSeparator): Use DrawingContext API.
+ * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c,
+ * generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c:
+ [Bug 2009213]: Audit: ensure that output arguments to Tk_Get*FromObj()
+ are initialized, in case of erroneous style specifications.
- * macosx/tkMacOSXWindowEvent.c (ClearPort): Clip to updateRgn.
+2008-07-02 Donal K. Fellows <dkf@users.sf.net>
- * macosx/tkMacOSXDebug.c: Factor out debug region flashing.
- * macosx/tkMacOSXDebug.h:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXHLEvents.c: Some tidying up of this file. Make sure
+ that failing handling callbacks get reported as background errors.
- * macosx/tkMacOSXEvent.c: Cleanup whitespace and formatting.
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXRegion.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
- * xlib/xgc.c:
+2008-06-30 Donal K. Fellows <dkf@users.sf.net>
- * macosx/Wish.xcodeproj/project.pbxproj: Delete references to removed
- * macosx/Wish.xcodeproj/default.pbxuser: ttk files.
+ * doc/*.1, doc/*.3, doc/*.n: Remove out of date changebars, make
+ formatting of typedefs consistent, other small changes.
-2007-05-28 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+2008-06-25 Don Porter <dgp@users.sourceforge.net>
- * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Fix short measures
- with flags=TK_WHOLE_WORDS|TK_AT_LEAST_ONE [Bug 1716141]. Make some
- casts unnecessary by changing variable types.
+ *** 8.6a1 TAGGED FOR RELEASE ***
-2007-05-25 Joe English <jenglish@users.sourceforge.net>
+ * changes: Updates for 8.6a1 release.
- * library/ttk/ttk.tcl: Omit ttk::dialog and dependencies.
- * library/ttk/dialog.tcl, library/ttk/icons.tcl,
- * library/ttk/keynav.tcl: Removed.
- * tests/ttk/misc.test: Removed.
- * doc/ttk_dialog.tcl: Removed.
+2008-06-24 Pat Thoyts <patthoyts@users.sourceforge.net>
-2007-05-25 Donal K. Fellows <dkf@users.sf.net>
+ * library/demos/ttkpane.tcl: Work around missing timezones
+ * doc/text.n: [Bug 1997293]: Fix documentation of text tag options.
- * doc/canvas.n: Fixed documentation of default -joinstyle option
- values for line and polygon items. [Bug 1725782]
-
-2007-05-22 Don Porter <dgp@users.sourceforge.net>
+2008-06-19 Don Porter <dgp@users.sourceforge.net>
- [core-stabilizer-branch]
+ * changes: Updates for 8.6a1 release.
- * unix/configure: autoconf-2.59 (FC6 fork)
- * win/configure:
+ * generic/tk.h: TIP 285 additions make Tk 8.6 call the new
+ * library/tk.tcl: Tcl_Canceled() routine, available only in Tcl
+ 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will no
+ longer [load] into a Tcl 8.5 interp.
- * README: Bump version number to 8.5b1
+ * README: Bump version number to 8.6a1
* generic/tk.h:
* library/tk.tcl:
* unix/configure.in:
* unix/tk.spec:
* win/configure.in:
-2007-05-18 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkEntry.c(EntrySetValue): Ensure that widget is in a
- consistent state before setting the linked -textvariable. Previously,
- it was possible for [$e index insert] to point past the end of the
- string, leading to heap corruption. [Bug 1721532]
- * tests/ttk/entry.test(entry-9.1): Add test case for the above.
-
-2007-05-18 Don Porter <dgp@users.sourceforge.net>
-
- * unix/configure: autoconf-2.59 (FC6 fork)
+ * unix/configure: autoconf-2.59
* win/configure:
- * README: Bump version number to 8.5a7
- * generic/tk.h:
- * library/tk.tcl:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * tests/ttk/treetags.test: Another bit of test suite
- SCIM-tolerance. [Bug 1609316]
-
-2007-05-17 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tk.decls: Workaround 'make checkstubs' failures from
- tkStubLib.c MODULE_SCOPE revert. [Bug 1716117]
-
- * macosx/Wish.xcodeproj/project.pbxproj: Add tkOldTest.c and remove
- tkStubImg.c.
-
-2007-05-16 Joe English <jenglish@users.sourceforge.net>
-
- * generic/tkStubLib.c: Change Tk_InitStubs(), tkStubsPtr, and the
- auxilliary stubs table pointers back to public visibility. See [Bug
- 1716117] for details.
-
- Removed TCL_STORAGE_CLASS monkey business, as it had no effect.
-
-2007-05-16 Don Porter <dgp@users.sourceforge.net>
-
- * library/choosedir.tcl: Removed uses of obsolete {expand}
- * library/comdlg.tcl: syntax; replaced with the now
- * library/tk.tcl: approved {*}. [Bug 1710633]
- * tests/canvImg.test:
- * tests/imgPhoto.test:
-
- * tests/bind.test: Make test suite more SCIM-tolerant. [Bug 1609316]
-
-2007-05-16 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Test ttk widgets.
-
-2007-05-15 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixRFont.c: Fix crash introduced by previous fix exposed
- under newer fontconfig libraries [Bug 1717830] again.
-
-2007-05-15 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkGrid.c: Stop crash due to list intrep shimmer [Bug 1677608]
-
-2007-05-15 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixRFont.c: Fix various memory leaks. [Bug 1717830], [Bug
- 800149]
-
-2007-05-14 Don Porter <dgp@users.sourceforge.net>
-
- [Tk Bug 1712081]
-
- * unix/Makefile.in: Updates to account for new and deleted files
- * win/Makefile.in: tkStubImg.c and tkOldTest.c.
- * win/makefile.bc:
- * win/makefile.vc:
-
- * generic/tkOldTest.c (new): New file used to create testing
- * generic/tkTest.c: commands for testing various Tk
- * tests/constraints.tcl: legacy interfaces where a separate
- * tests/image.test: compilation unit is needed in order to
- #define suitable macros during compilation. Only the effect of
- USE_OLD_IMAGE on Tk_CreateImageType() is currently tested, but more
- similar testing commands can be added to this same file. New
- constraint defined to detect presence of the image type provided by
- the new testing code, and a few tests added to exercise it. Having
- USE_OLD_IMAGE support tested by the default test suite should reduce
- chance of a recurrence of this bug.
-
- * doc/CrtImgType.3: Revised docs to better indicate the legacy
- * doc/CrtPhImgFmt.3: nature of the interfaces supported by
- USE_OLD_IMAGE.
-
- * generic/tkDecls.h: make genstubs
- * generic/tkStubInit.c:
-
- * generic/tk.decls: Reworked USE_OLD_IMAGE support to use
- * generic/tk.h: the same support mechanisms both with
- * generic/tkStubImg.c (deleted):and without a stub-enabled build. In
- each case, route the legacy calls to Tk_CreateImageType and
- Tk_CreatePhotoImageFormat through the Tk_CreateOldImageType and
- Tk_CreateOldPhotoImageFormat routines. Add those routines to the
- public stub table so they're available to a stub-enabled extension.
- Remove the definition of Tk_InitImageArgs() and use a macro to convert
- any calls to it in source code into a comment.
-
- * generic/tkImage.c: Removed the MODULE_SCOPE declarations that
- * generic/tkImgPhoto.c: broke USE_OLD_IMAGE support.
-
-2007-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * tests/winButton.test: Avoid font dependencies in results.
-
- * generic/tkFont.c: propagate error from TkDeleteNamedFont. [Bug
- 1716613]
-
-2007-05-09 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkFileFilter.c (AddClause): OSType endianness fixes.
-
- * library/palette.tcl (tk::RecolorTree): Handle color options with
- empty value, fixes error due to emtpy -selectforeground (reported on
- tcl-mac by Russel E. Owen).
-
- * macosx/tkMacOSXWindowEvent.c: Ensure window is brought to the front
- * macosx/tkMacOSXMouseEvent.c: at the start of a window drag (except
- * macosx/tkMacOSXInt.h: when cmd key is down); formatting and
- whitespace fixes.
-
- * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd): Add -filetypes option
- processing (fixes fileDialog-0.1, fileDialog-0.2 failures).
-
- * macosx/tkMacOSXEmbed.c (TkpMakeWindow, TkpUseWindow): Fix sending of
- Visibility event for embedded windows (fixes frame-3.9 hang).
-
- * macosx/tkMacOSXScrlbr.c (ScrollbarBindProc): Fix testsuite
- * macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): crashes by
- adding sanity checks.
-
- * macosx/Wish.xcodeproj/project.pbxproj: Add 'DebugUnthreaded' &
- * macosx/Wish.xcodeproj/default.pbxuser: 'DebugLeaks' targets and env
- var settings needed to run the 'leaks' tool.
-
- * macosx/tkMacOSXButton.c: Fix debug msg typo.
-
- * tests/constraints.tcl: Ensure 'nonUnixUserInteraction' constraint is
- set for aqua.
-
- * tests/choosedir.test: Add 'notAqua' constraints to X11-only tests;
- * tests/clrpick.test: add 'nonUnixUserInteraction' to 'unix' tests
- * tests/menuDraw.test: requiring interaction on aqua.
- * tests/unixMenu.test:
- * tests/unixWm.test:
- * tests/winMenu.test:
-
-2007-05-07 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixRFont.c: Properly cast sentinel arguments to variadic
- function (fixes "warning: missing sentinel in function call", [Bug
- 1712001])
-
-2007-05-04 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkFont.c: TIP #145 implementation -
- * generic/tkFont.h: Enhanced font handling.
- * win/tkWinDefault.h:
- * win/tkWinFont.c:
- * win/tkWinInt.h:
- * win/tkWinWm.c:
- * library/demos/widget:
- * library/ttk/fonts.tcl:
-
-2007-05-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/ttk_treeview.n, doc/ttk_panedwindow.n, doc/ttk_dialog.n:
- * doc/ttk_checkbutton.n, doc/tk.n, doc/menu.n, doc/font.n:
- * doc/canvas.n: Spelling fixes. [Bug 1686210]
-
-2007-05-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkStubLib.c (Tk_InitStubs):
- * generic/ttk/ttkLabel.c (LabelSetup):
- * unix/tkUnixSelect.c (ConvertSelection):
- * unix/tkUnixEvent.c (TkUnixDoOneXEvent):
- * generic/tkConfig.c (Tk_RestoreSavedOptions):
- * generic/tkCanvPs.c (TkCanvPostscriptCmd):
- * generic/tkOption.c (GetDefaultOptions):
- * unix/tkUnixRFont.c (TkpGetFontAttrsForChar, InitFont)
- (TkpGetFontFamilies, TkpGetSubFonts):
- * unix/tkUnixSend.c (TkpTestsendCmd, RegOpen): Squelch warnings from
- GCC type aliasing. [Bug 1711985 and others]
-
-2007-04-29 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/configure.in: Fix for default case in tk debug build detection.
- * unix/configure: autoconf-2.59
-
-2007-04-27 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkTreeview.c(TagOptionSpecs): Use TK_OPTION_STRING
- instead of TK_OPTION_FONT to avoid resource leak in tag management.
-
-2007-04-26 Joe English <jenglish@users.sourceforge.net>
-
- * macosx/ttkMacOSXTheme.c: Merged OFFSET_RECT processing into
- BoxToRect(); factored out PatternOrigin; resynchronized with Tile
- codebase.
-
-2007-04-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.5a6 TAGGED FOR RELEASE ***
-
- * unix/Makefile.in (dist): Correct tests/ttk glob inclusion
-
-2007-04-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (dist): Add tests/ttk dir to src dist
-
- * unix/tkUnixMenubu.c (TkpDisplayMenuButton): Init width/height to 0
-
-2007-04-25 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in (dist): Add macosx/*.xcconfig files to src dist;
- copy license.terms to dist macosx dir; fix autoheader bits.
-
-2007-04-24 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (dist): Add ttk bits to src dist
-
- * tests/font.test (font-46.[12]): Correct listification of result
-
-2007-04-23 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkCanvas.c: Allow -selectforeground option to be None; add
- * generic/tkCanvText.c: fallback to fgColor when selFgColor is None
- * generic/tkEntry.c: (new default on aqua to match native L&F).
- * generic/tkListbox.c:
- * generic/tkText.c:
-
- * generic/tkCanvas.c: Add support for bypassing all of Tk's double
- * generic/tkEntry.c: buffered drawing into intermediate pixmaps
- * generic/tkFrame.c: (via TK_NO_DOUBLE_BUFFERING #define), it is
- * generic/tkListbox.c: unnecessary & wasteful on aqua where all
- * generic/tkPanedWindow.c: drawing is already double-buffered by the
- * generic/tkTextDisp.c: window server. (Use of this on other
- * generic/ttk/ttkWidget.c: platforms would only require implementation
- * unix/tkUnixScale.c: of TkpClipDrawableToRect()).
- * macosx/tkMacOSXPort.h:
-
- * library/bgerror.tcl: On aqua, use moveable alert resp. modal dialog
- * library/dialog.tcl: window class and corresponding system
- background pattern; fix button padding.
-
- * library/tearoff.tcl: Correct aqua menu bar height; vertically offset
- * library/tk.tcl: aqua tearoff floating window to match menu.
-
- * library/demos/goldberg.tcl: Fix overwriting of widget demo global.
-
- * library/demos/menu.tcl: On aqua, use custom MDEF and tearoffs;
- * library/demos/menubu.tcl: correct menubutton toplevel name.
-
- * library/demos/puzzle.tcl: Fix button size & padding for aqua.
- * library/demos/radio.tcl:
-
- * macosx/tkMacOSXCarbonEvents.c: Add window event target carbon event
- * macosx/tkMacOSXEvent.c: handler for all kEventClassWindow and
- * macosx/tkMacOSXEvent.h: kEventClassMouse events; move all
- * macosx/tkMacOSXNotify.c: remaining events except for
- * macosx/tkMacOSXWindowEvent.c: kEventClassKeyboard from dispatcher to
- application event handler; pass event handler callRef downstream; fix
- debug event tracing; process all tcl event types in carbon event timer;
- delay carbon event timer first fire; add TkMacOSXTrackingLoop() to mark
- enter/exit of event tracking loop during which all tcl events but only
- carbon update events should be processed by the timer (replaces various
- calls to Tcl_SetServiceMode()); rename TkMacOSXReceiveAndProcessEvent()
- to TkMacOSXReceiveAndDispatchEvent(), move it from tkMacOSXEvent.c to
- tkMacOSXCarbonEvents.c and modify it to dequeue only update events
- during a tracking loop; add TkMacOSXRunTclEventLoop() to standardize
- the various ways in use to run the tcl event loop; add handling of
- kEventClassAppearance events (for ScrollBarVariantChanged event).
-
- * macosx/tkMacOSXDialog.c: Use new TkMacOSXTrackingLoop() around
- * macosx/tkMacOSXEvent.c: blocking API that puts up modal dialogs
- * macosx/tkMacOSXMenu.c: or when entering/exiting menu/control
- * macosx/tkMacOSXMouseEvent.c: tracking, window dragging and other
- * macosx/tkMacOSXScale.c: mouse tracking loops.
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXDialog.c: Use new TkMacOSXRunTclEventLoop()
- * macosx/tkMacOSXScale.c: instead of Tcl_DoOneEvent(),
- * macosx/tkMacOSXScrlbr.c: Tcl_ServiceAll(), TclServiceIdle()
- * macosx/tkMacOSXWindowEvent.c: and Tcl_GlobalEval("update idletasks").
-
- * macosx/tkMacOSXColor.c: Make available as Tk system colors all
- * macosx/tkMacOSXPort.h: appearance manager brushes, text colors and
- backgrounds with new and legacy names, as well as the fully transparent
- color "systemTransparent"; add TkMacOSXSetColorIn{Port,Context}() to
- directly set an X pixel color value in the current QD port resp. the
- given CG context without requiring passage through rgb representation
- (lossy for most system colors); modernize/remove Classic-era code;
- replace crufty strcmp() elseifs by Tcl_GetIndexFromObjStruct().
-
- * macosx/tkMacOSXButton.c: Use new TkMacOSXSetColorInPort()
- * macosx/tkMacOSXDraw.c: instead of setting rgb color directly
- * macosx/tkMacOSXMenubutton.c: to allow for non-rgb system colors.
-
- * macosx/tkMacOSXCursor.c: Implement "none" cursor as on other
- platforms [Patch 1615427]; add all missing appearance manager cursors.
-
- * macosx/tkMacOSXDefault.h: Set SELECT_FG_COLORs to None to match aqua
- L&F; use standard system color names; use new 'menu' system font;
- correct default scrollbar width.
-
- * macosx/tkMacOSXDraw.c: Standardize initialization, use and
- * macosx/tkMacOSXInt.h: emptying of various static temp rgns
- * macosx/tkMacOSXRegion.c: onto two global RgnHandles; in debug
- * macosx/tkMacOSXSubwindows.c: builds, verify emptiness of these temp
- * macosx/tkMacOSXWindowEvent.c: rgns before use.
-
- * macosx/tkMacOSXDraw.c: Add TkMacOSX{Setup,Restore}DrawingContext() to
- * macosx/tkMacOSXInt.h: abstract common setup & teardown of drawing
- environment (for both CG and QD); save/restore QD theme drawing state;
- handle GC clip region; add TkpClipDrawableToRect() to allow clipped
- drawing into drawable regardless of GC used; use new system color
- "systemWindowHeaderBackground" to setup background in themed toplevels;
- correct implementation of TkMacOSXMakeStippleMap().
-
- * macosx/tkMacOSXEntry.c: Use new TkMacOSXSetupDrawingContext() and
- * macosx/tkMacOSXFont.c: TkMacOSXRestoreDrawingContext() instead of
- * macosx/ttkMacOSXTheme.c: various setup/teardown procs like
- TkMacOSX{SetUp,Release}CGContext(), TkMacOSXQuarz{Start,End}Draw(),
- TkMacOSXSetUpGraphicsPort() etc.
-
- * macosx/tkMacOSXEmbed.c: Add CG context and drawable clip rgn fields
- * macosx/tkMacOSXInt.h: to MacDrawable struct.
- * macosx/tkMacOSXSubwindows.c:
-
- * macosx/tkMacOSXDialog.c: Make -parent option of tk_getOpenFile et al.
- use the sheet version of NavServices dialogs; ensure native parent win
- exists before using StandardSheet API for tk_messageBox [Bug 1677611];
- force sheets to behave like app-modal dialogs via WindowModality() API;
- use more modern ColorPicker API.
-
- * macosx/tkAboutDlg.r: Use themed movable modal dialog, fix (c) year.
-
- * macosx/tkMacOSXEntry.c: Take xOff/yOff of MacDrawable into account
- * macosx/ttkMacOSXTheme.c: when computing locations/bounds to ensure
- correct posititioning when not drawing into intermediate pixmap.
-
- * macosx/tkMacOSXFont.c: Use appearance manager API to map system font
- * macosx/tkMacOSXFont.h: names to TkFonts; add "menu" system font for
- menu item text drawing from MDEF; always draw with CG; remove QD
- dependent stippling algorithm; move most header declarations into the
- source file (as they were not used anywhere else).
-
- * macosx/tkMacOSXMenu.c: Large-scale rewrite of custom
- * macosx/tkMacOSXMenu.r (removed): MDEF and related code that
- * macosx/Wish.xcode/project.pbxproj: restores many longtime-MIA
- * macosx/Wish.xcodeproj/project.pbxproj: features to working order
- * unix/Makefile.in: (e.g. images, custom colors &
- fonts in menus etc); implement compound menu items; use Appearance Mgr
- and ThemeText APIs to mimic native MDEF as closely as possible when
- default "menu" system font is used; remove now obsolete SICN drawing
- code and resources.
-
- * macosx/tkMacOSXCarbonEvents.c: Handle additional menu carbon events
- * macosx/tkMacOSXEvent.c: in order to support <<MenuSelect>> in
- * macosx/tkMacOSXMenu.c: the menubar and in menus that are not
- * macosx/tkMacOSXMenus.c: using the custom MDEF [Bug 1620826];
- fix early and missing clearing of current Tk active menu entry; fix
- extraneous sending of <<MenuSelect>> during active menu entry clearing.
-
- * macosx/tkMacOSXMouseEvent.c: Add support for async window dragging by
- the window server; set the corresponding window attribute by default.
-
- * macosx/tkMacOSXMouseEvent.c: Rationalized handling order of
- non-mousedown events; add TkMacOSXModifierState() to retrieve the
- current key modifiers in carbon format.
-
- * macosx/tkMacOSXScrlbr.c: Use appearance manager API to retrieve
- scrollbar component metrics; add awareness of multiple possibilites for
- scrollbar arrow position in aqua and handle user changes to arrow
- position pref; handle difference in metrics of small & large scrollbar
- variants; handle aqua "jump to here" scrollbar behaviour; correct
- computation of scroll view size and position; enforce min scrollbar
- height to avoid scrollbar component overlap; erase scrollbar area
- outside of standard width; remove broken auto-adjust code; account for
- window class when leaving space for grow box; remove code to manually
- draw grow box; use modern API for thumb scroll proc; replace
- HiliteControl() by modern API; replace control mgr constants with
- appearance mgr equivalents.
-
- * macosx/tkMacOSXSubwindows.c: Use SetWindowBounds() API instead of
- SizeWindow(); invalidate clip regions after X{Map,Unmap}Window as fix
- for [Bug 940117] made them dependent on mapping state; remove unneeded
- calls to TkMacOSXInvalClipRgns() and unnecessary setting of QD port;
- use native-endian pixmap on intel; remove obsolete pixmap pix locking.
-
- * macosx/tkMacOSXWindowEvent.c: Handle only the first of a batch of
- kEventAppAvailableWindowBoundsChanged events sent per transaction;
- handle kEventWindowBoundsChanged event to support live window resizing
- and centralized sending of location/size changed ConfigureNotify
- events; ensure HIGrowBox is redrawn after bounds change; constrain
- window after dragging to ensure titlebar is not inacessible
- offscreen or under dock/menubar; handle kEventWindowGetRegion and
- kEventWindowDrawContent for transparent windows to mark resp. paint
- content region as transparent; handle kEventWindowConstrain for
- fullscreen windows to ensure bounds match new screen size; enter/exit
- fullscreen UIMode upon activation/deactivation of fullscreen window.
-
- * macosx/tkMacOSXWm.c: Use live-resize and async-drag carbon window
- * macosx/tkMacOSXWm.h: attributes for toplevels by default; implement
- new [wm attributes] -topmost, -transparent and -fullscreen; refactor
- WmAttributesCmd() parallelling the tkUnixWm.c implementation, use thus
- factored proc to set proxy icon from [wm iconbitmap]; dynamically
- determine default values for toplevel min and max sizes (similar to
- tkWinWm.c impl): min sizes depend on window class & attributes to
- ensure visibility of all titlebar widgets and grow box, max sizes
- depend on maximal window bounds for all active displays; factor out
- code that puts into effect changes to master or override_redirect; use
- RepositionWindow() API to determine staggered initial window bounds;
- correct resize limit calculations, handle gridding and use modern
- resize API in TkMacOSXGrowToplevel(); remove sending of ConfigureNotify
- after resize or zoom (now handled by BoundsChanged handler); correct
- composite carbon window attribute handling, remove currently unusable
- attributes and add new attributes in [tk::unsupported::MacWindowStyle];
- ensure validity of window class and attributes before use; apply
- changes to window class when handling carbon window attribute changes
- (if HIWindowChangeClass() API available); add debug build warning
- message when deprecated window style is used instead of window class;
- use transparent HIGrowBox for resizable windows; avoid unnecessary
- calls to window structure width API; use tcl time API in TkpGetMS();
- add TkMacOSXEnterExitFullscreen() to enter/exit UIMode with dock and
- menubar hidden; restrict wmTracing output to debug builds; remove
- unneeded calls to TkMacOSXInvalClipRgns() and unnecessary setting of QD
- port; workaround GetWindowStructureWidths() Carbon bug (bogus results
- for never-mapped floating windows).
-
- * macosx/tkMacOSXXStubs.c (TkMacOSXDisplayChanged): Add maximal window
- bounds field to Screen record (in ext_data), computed as the union of
- available window positioning bounds of all graphics devices (displays).
-
- * macosx/tkMacOSXBitmap.c: Fix macRoman encoding leak.
- * macosx/tkMacOSXCursor.c:
-
- * macosx/tkMacOSXDebug.c (TkMacOSXCarbonEventToAscii): Use static
- * macosx/tkMacOSXDebug.h: buffer to simplify callers; const fixes.
-
- * macosx/tkMacOSXBitmap.c: Use more efficient QDSwapPort() instead of
- * macosx/tkMacOSXButton.c: GetPort()/SetPort()/GetGWorld()/SetGWorld().
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXXStubs.c:
-
- * macosx/tkMacOSXColor.c: Use kHIToolboxVersionNumber for runtime OS
- * macosx/tkMacOSXEntry.c: version check rather than Gestalt() etc.
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXDraw.c: Remove obsolete and now incorrect
- * macosx/tkMacOSXInt.h: tkMenuCascadeRgn clipping code.
- * macosx/tkMacOSXMenu.c:
-
- * macosx/tkMacOSXHLEvents.c: Replace Tcl_GlobalEval() resp. Tcl_Eval()
- * macosx/tkMacOSXScrlbr.c: by Tcl_EvalEx().
- * macosx/tkMacOSXInit.c:
-
- * macosx/tkMacOSXInit.c (TkpInit): Reorder initialization steps.
-
- * macosx/tkMacOSXKeyEvent.c: Remove pre-10.2 support.
-
- * macosx/tkMacOSXMenus.c: Remove now useless call to
- TkMacOSXHandleTearoffMenu(); use \x.. quoting for non-latin1 macroman
- literar chars to allow file to be edited as utf-8.
-
- * macosx/tkMacOSXScale.c: Replace TrackControl() by modern
- * macosx/tkMacOSXScrlbr.c: HandleControlClick() API (using new
- TkMacOSXModifierState()).
-
- * macosx/tkMacOSXInt.h: Move all constant #defines needed to
- * macosx/tkMacOSXColor.c: support building on older OS X releases
- * macosx/tkMacOSXEvent.h: to a central location in tkMacOSXInt.h.
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/ttkMacOSXTheme.c:
-
- * macosx/tkMacOSXInt.h: Add ChkErr() macro to factor out
- * macosx/tkMacOSXButton.c: Carbon OSStatus return value checking
- * macosx/tkMacOSXCarbonEvents.c: and TkMacOSXDbgMsg() macro to factour
- * macosx/tkMacOSXClipboard.c: out debug message output; use these
- * macosx/tkMacOSXColor.c: macros to replace #ifdef TK_MAC_DEBUG
- * macosx/tkMacOSXCursor.c: blocks & direct printing to stderr,
- * macosx/tkMacOSXDebug.c: and to do additional OSStatus return
- * macosx/tkMacOSXDialog.c: checking, and to standardize OSStatus
- * macosx/tkMacOSXDraw.c: usage.
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXHLEvents.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
-
- * macosx/tkMacOSXSend.c: Remove duplicate/unused declarations.
- * macosx/tkMacOSXXStubs.c:
-
- * macosx/tkMacOSXDebug.c: Const fixes.
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXTest.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
-
- * macosx/Wish-Info.plist.in: Add tcl document extensions/mime types and
- LSMinimumSystemVersion, LSRequiresCarbon & NSAppleScriptEnabled keys.
-
- * macosx/Wish-Common.xcconfig: Add Wish's Info.plist as __info_plist
- section to tktest; enable more warnings.
-
- * macosx/Wish.xcodeproj/project.pbxproj: Add 'DebugMemCompile' build
- configuration that calls configure with --enable-symbols=all; disable
- configure check for __attribute__((__visibility__("hidden"))) in Debug
- configuration to restore availability of ZeroLink.
-
- * macosx/Wish-Common.xcconfig: Fix whitespace.
- * macosx/Wish-Debug.xcconfig:
- * macosx/Wish-Release.xcconfig:
- * macosx/tkMacOSXAETE.r:
- * macosx/tkMacOSXConfig.c:
- * macosx/tkMacOSXCursors.r:
- * macosx/tkMacOSXKeyboard.c:
- * macosx/tkMacOSXSend.c:
- * macosx/ttkMacOSXTheme.c:
- * macosx/tkMacOSXXCursors.r:
- * macosx/README:
-
- * macosx/GNUmakefile: Fix/add copyright and license refs.
- * macosx/Tk-Info.plist.in:
- * macosx/Wish-Info.plist.in:
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.xcodeproj/project.pbxproj:
- * macosx/tkMacOSX.h:
-
- * unix/configure.in: Install license.terms into Tk.framework; fix tk
- debug build detection.
- * unix/configure: autoconf-2.59
-
- * doc/colors.n: Document new Mac OS X system colors.
- * doc/cursors.n: Document new Mac OS X native cursors.
- * doc/font.n: Document new Mac OS X 'menu' system font.
- * doc/wm.n: Document new Mac OS X [wm attributes].
- * doc/ttk_image.n: Fix 'make html' warning.
- * doc/canvas.n: Fix nroff typo.
-
-2007-04-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXBitmap.c, macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXCarbonEvents.c, macosx/tkMacOSXClipboard.c:
- * macosx/tkMacOSXCursor.c, macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXDraw.c, macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXFont.c, macosx/tkMacOSXInit.c, macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXKeyEvent.c, macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c, macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXScale.c, macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c: Revert of commits from 2007-04-13 which broke
- the OS X build.
-
-2007-04-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * generic/tkFont.c, generic/tkListbox.c, unix/tkUnixSelect.c:
- * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c: Make
- the format of declarations much more standardized (removing K&R-isms
- and other things like that).
-
-2007-04-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * macosx/tkMacOSXInt.h (LOG_MSG, LOG_ON_ERROR): Added macros to make
- the OSX code much less #ifdef-full.
-
-2007-04-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/ttk/panedwindow.tcl (ttk::panedwindow::Press): handle Press
- triggering outside sash element boundaries.
-
-2007-04-10 Joe English <jenglish@users.sourceforge.net>
-
- * win/ttkWinMonitor.c, win/ttkWinXPTheme.c: Re-sync with Tile codebase
- so patches can flow back and forth.
-
- * win/ttkWinXPTheme.c: Skip OS version test, should work on Vista/Aero
- now as well as XP. Fixes [Bug 1687299], thanks to George Petasis for
- tracking this down.
-
-2007-03-21 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkLayout.c(Ttk_BuildLayoutTemplate): BUGFIX: Nested
- TTK_GROUP nodes did not work unless they appeared at the end of the
- layout (and only by accident then).
-
-2007-03-08 Joe English <jenglish@users.sourceforge.net>
-
- * tests/grid.test(grid-21.7): Reset wm geometry . and pack propagate .
- at end of test. 'pack propagate . 0' was causing cascading failures in
- subsequent tests. [Bug 1676770]
-
-2007-03-07 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkMain.c (Tk_MainEx): Replicate macosx-specific code from
- TkpInit() that ensures the console window appears when wish is started
- from the OS X Finder (i.e. with stdin == /dev/null), jeffh's 2006-11-24
- change rendered the corresponding code in TkpInit() ineffective in wish
- because Tk_MainEx() sets tcl_interactive before calling TkpInit().
-
- * generic/ttk/ttkGenStubs.tcl (new): Add ttk-specific genstubs.tcl from
- * unix/Makefile.in (genstubs): tile and run it from 'genstubs'
- target, restores ability to generate all of Tk's stub sources.
-
- * generic/ttk/ttkTreeview.c: #ifdef out unused declaration.
-
- * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol): Add fix for
- libraries loaded with a DYLD_IMAGE_SUFFIX.
-
- * macosx/Wish.xcodeproj/project.pbxproj: Ensure gcc version used by
- * macosx/Wish.xcodeproj/default.pbxuser: Xcode and configure/make are
- * macosx/Wish-Common.xcconfig: consistent and independent of
- gcc_select default and CC env var; fixes for Xcode 3.0.
-
- * unix/tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in macosx-version-min check.
- * unix/configure: autoconf-2.59
-
-2007-02-25 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkUtil.c: Fixed grid anchor center problem in labelframes.
- * tests/grid.test: [Bug 1545765]
-
-2007-02-23 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/ttk/notebook.tcl (ttk::notebook::enableTraversal): OS X
- needs Option instead of Alt binding
-
-2007-02-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tcl.m4: use SHLIB_SUFFIX=".so" on HP-UX ia64 arch.
- * unix/configure: autoconf-2.59
-
- * library/tkfbox.tcl (::tk::IconList_Goto): avoid goto issues in empty
- dirs. [Bug 1662959]
-
-2007-02-09 Joe Mistachkin <joe@mistachkin.com>
-
- * win/nmakehlp.c: Properly cleanup after nmakehlp, including the
- * win/makefile.vc: vcX0.pch file. Sync up fixed nmakehlp usage from
- Tcl.
-
-2007-02-06 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/ttk.tcl: Add no-op [package ifneeded] script for tile
- 0.8.0, so that existing applications that use "package require tile"
- won't fail when run under Tk 8.5.
-
-2007-02-04 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4: Use gcc4's __attribute__((__visibility__("hidden"))) if
- available to define MODULE_SCOPE effective on all platforms.
- * unix/configure.in: add caching to -pipe check.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
-2007-02-03 Joe Mistachkin <joe@mistachkin.com>
-
- * win/rules.vc: Fix platform specific file copy macros for downlevel
- Windows.
- * win/ttkWinMonitor.c: Windows portability support. Fix "noxp" build
- * win/ttkWinXPTheme.c: option handling and use GetWindowLongPtr and
- SetWindowLongPtr only when needed.
-
-2007-02-02 Pat Thoyts <patthoyts@users.sourceforge.net>
+2008-06-18 Daniel Steffen <das@users.sourceforge.net>
- * win/ttkWinXPTheme.c: Support IsAppThemed() call. This is what is
- used when theming is turned off just for an individual application.
+ * macosx/tkMacOSXCarbonEvents.c: Fix debug carbon event tracing.
+ (InstallStandardApplicationEventHandler): Replace needless use of
+ TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol().
-2007-01-28 Daniel Steffen <das@users.sourceforge.net>
+ * macosx/tkMacOSXDebug.c: Revert 2007-11-09 commit making
+ * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol()
+ available outside of debug builds.
- * macosx/Wish.xcodeproj/project.pbxproj: Extract build settings that
- * macosx/Wish.xcodeproj/default.pbxuser: were common to multiple
- * macosx/Wish-Common.xcconfig (new file): configurations into external
- * macosx/Wish-Debug.xcconfig (new file): xcconfig files; add extra
- * macosx/Wish-Release.xcconfig (new file): configurations for building
- with SDKs; convert legacy jam-based 'Tk' target to native target with
- single script phase; correct syntax of build setting references to use
- $() throughout; remove unused tcltest sources from 'tktest' target.
+ * macosx/tkMacOSXEmbed.c (TkpMakeWindow): Fix bug with missing
+ * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by
+ only sending VisibilityNotify events once windows are mapped (rather
+ than when they are created).
- * macosx/README: Document new Wish.xcodeproj configurations; other
- minor updates/corrections.
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): Fix
+ return value.
- * generic/tk.h: Update location of version numbers in macosx files.
+ * macosx/tkMacOSXInit.c: Add helper to efficiently convert from
+ * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj.
- * macosx/Wish.xcode/project.pbxproj: Restore 'tktest' target to working
- * macosx/Wish.xcode/default.pbxuser: order by replicating applicable
- changes to Wish.xcodeproj since 2006-07-20.
+ * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): Fix
+ incorrect conversion to points of font sizes already in points; factor
+ out retrieval of font family name from font family ID.
-2007-01-25 Daniel Steffen <das@users.sourceforge.net>
+2008-06-13 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/tcl.m4: Integrate CPPFLAGS into CFLAGS as late as possible and
- move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to
- avoid errors about multiple -isysroot flags from some older gcc builds.
+ * win/configure, win/configure.in (TK_WIN_VERSION): Fix handling of
+ interim a/b versioning for manifest usage.
- * unix/configure: autoconf-2.59
+2008-06-13 Joe Mistachkin <joe@mistachkin.com>
-2007-01-19 Joe Mistachkin <joe@mistachkin.com>
+ TIP #285 IMPLEMENTATION
- * win/makefile.vc: Properly build man2tcl.c for MSVC8.
+ * generic/tkCmds.c: During [tkwait] and [update], always cooperatively
+ check for script cancellation.
+ * win/makefile.vc: Added 'pdbs' option for Windows build rules to
+ * win/rules.vc: allow for non-debug builds with full symbols.
-2007-01-19 Daniel Steffen <das@users.sourceforge.net>
+2008-06-12 Daniel Steffen <das@users.sourceforge.net>
- * macosx/Wish.xcodeproj/project.pbxproj: Remove libtommath defines.
+ * generic/tkPointer.c (Tk_UpdatePointer): [Bug 1991932]: Fix failure
+ to restore a global grab capture and to release the restrict window
+ capture when releasing a button grab. Fixes segfault due to dangling
+ reference to restrict window inside TkpSetCapture() implementation.
- * unix/tcl.m4: Ensure CPPFLAGS env var is used when set. [Bug 1586861]
- (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
- present in CFLAGS to avoid discrepancies between what headers configure
- sees during preprocessing tests and compiling tests.
+ * generic/ttk/ttkTreeview.c: Fix warning.
+ * unix/tcl.m4 (SunOS-5.11): Fix 64bit amd64 support with gcc & Sun cc.
* unix/configure: autoconf-2.59
-2007-01-11 Jeff Hobbs <jeffh@activestate.com>
-
- * unix/tkUnixEvent.c, library/msgs/es.msg: s/CRLF/LF/g
-
-2007-01-11 Joe English <jenglish@users.sourceforge.net>
-
- * win/tcl.m4 (CFLAGS_WARNING): Remove "-Wconversion". This was removed
- from unix/tcl.m4 2004-07-16 but not from here.
- * win/configure: Regenerated.
-
-2007-01-11 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkManager.h, generic/ttk/ttk*.c: Revert addition of
- contravariant 'const' qualifiers, to keep in sync with Tile codebase
- (which must remain compatible with Tk 8.4).
-
-2007-01-03 Jan Nijtmans <nijtmans@users.sf.net>
-
- * doc/ManageGeom.3,
- * generic/tk.decls,
- * generic/tk.h: Add const to 2nd parameter of Tk_ManageGeometry
- * generic/tkDecls.h: regenerated
- * generic/tkInt.h,
- * generic/tk*.c,
- * generic/ttk/ttk*.c: Added many "const" specifiers in implementation.
-
-2007-01-02 Donal K. Fellows <dkf@users.sf.net>
-
- * xlib/*: Made the generic fake-X11 glue layer abide by the formatting
- rules of the core.
-
-2006-12-31 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
-
- * macosx/tkMacOSXFont.c: Fill-in TkpGetFontAttrsForChar (TIP #300).
- * macosx/ttkMacOSXTheme.c: Define a constant to make it compile on Mac
- OS X 10.3.
-
-2006-12-28 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Update wm attributes output so that tests pass after
- addition of -transparentcolor for Win32.
+ * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): Use UsrActivity
+ instead of OverallAct (which may be ignored in some circumstances).
-2006-12-26 Joe English <jenglish@users.sourceforge.net>
+ * macosx/Wish.xcodeproj/project.pbxproj: Add tclIORTrans.c; add tclOO
+ * macosx/Wish.xcodeproj/default.pbxuser: files to tktest-X11 target;
+ add debug configs for 64bit and with corefoundation disabled; updates
+ and cleanup for Xcode 3.1 and for Leopard; sync with Tcl.xcodeproj.
+ * macosx/Wish.xcode/project.pbxproj: Sync Wish.xcodeproj changes.
+ * macosx/Wish.xcode/default.pbxuser:
+ * macosx/README: Document new build configs.
- * generic/ttk/ttkLabel.c: ImageElement clientData no longer needed.
+2008-06-10 Joe English <jenglish@users.sourceforge.net>
-2006-12-22 Donal K. Fellows <dkf@users.sf.net>
+ * unix/tkUnixKey.c: [Patch 1986818]: Use Xutf8LookupString if
+ available. This should fix problems (like [Bug 1908443]) where Xlib's
+ idea of the system encoding does not match Tcl's.
- * unix/tkUnixEvent.c (TkUnixDoOneXEvent): Made correct on AMD64 and
- other similar 64-bit systems where fd_mask is not 'unsigned int' in
- effect. [Bug 1522467]
+2008-06-01 Daniel Steffen <das@users.sourceforge.net>
- * library/msgs/es_ES.msg (removed):
- * library/msgs/es.msg: Fixed translation fault that was present in all
- Spanish-speaking locales. [Bug 1111213]
+ * macosx/Wish.xcodeproj/project.pbxproj: Add new tclOO files; add
+ * macosx/README: debug configs with gcov;
+ update to Xcode 3.1.
-2006-12-19 Jeff Hobbs <jeffh@ActiveState.com>
+2008-05-27 Pat Thoyts <patthoyts@users.sourceforge.net>
- * win/tkWinButton.c (TkpDisplayButton): lint init. [Bug 1618604]
+ * generic/ttk/ttkTheme.c: [ttk::style theme use] without an argument
+ * doc/ttk_style.n: now returns the current theme.
-2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+2008-05-23 Joe English <jenglish@users.sourceforge.net>
- * unix/tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch
- flag succeeds before enabling 64bit build.
- * unix/configure: autoconf-2.59
+ * doc/ttk_treeview.n, generic/ttk/ttkTreeview.c,
+ * generic/ttk/ttkTagSet.c, generic/ttk/ttkLayout.c,
+ * generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h,
+ * generic/ttk/ttkThemeInt.h, generic/ttk/ttkWidget.h:
+ Added [$tv identify region], [$tv identify element], and [$tv identify
+ item] subcommands. Simplified bindings. Added [$tv tag has]
+ subcommand. Tag-related display improvements; setting a tag
+ -background or -foreground no longer overrides selection feedback.
-2006-12-18 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkTreeview.c, library/ttk/treeview.tcl, doc/treeview.n:
- Added column '-stretch' and '-minwidth' options. Improved column drag
- and resize behavior. Added horizontal scrolling [Bug 1518650]. Row
- height and child indent specifiable on Treeview style. Decreased
- default row height, no default -padding. Use correct heading height
- [Bug 1163349]. Apply tag settings to tree item as well as to data
- columns [NOTE: 'tag configure' still buggy]. Fix off-by-one condition
- when moving nodes forward [Bug 1618142]
- * generic/ttk/ttkScroll.c (TtkScrollTo): Prevent overscroll [Bug
- 1173434]
* library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl,
* library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl,
- * library/ttk/defaults.tcl, library/ttk/winTheme.tcl,
- * library/ttk/xpTheme.tcl: Per-theme treeview settings.
- * macosx/ttkMacOSXTheme.c: Added disclosure triangle element.
-
-2006-12-17 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/combobox.tcl, generic/ttk/ttkEntry.c,
- * doc/ttk_combobox.n: Add combobox -height option; only show scrollbar
- if the listbox needs to scroll. [Bug 1032869]
-
-2006-12-16 Mo DeJong <mdejong@users.sourceforge.net>
-
- * doc/cursors.n: Mention "none" in supported cursor list. Fix comment
- that incorrectly claims that the Win32 "no" cursor hides the cursor.
- * tests/cursor.test: Test "none" cursor.
- * unix/tkUnixCursor.c (CreateCursorFromTableOrFile)
- (TkGetCursorByName): Define a table of Tk cursors that is searched in
- addition to the X cursor table. A Tk cursor is loaded from a data
- string and works with the same options as the built in X cursors. This
- code makes it possible to use "none" as a cursor name under Unix.
- * win/rc/cursor9a.cur: Added none Win32 cursor.
- * win/rc/tk_base.rc: Define a built-in Win32 cursor named "none".
- [Patch 1615427]
-
-2006-12-14 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkButton.c, generic/ttk/ttkElements.c,
- * generic/ttk/ttkEntry.c, generic/ttk/ttkFrame.c,
- * generic/ttk/ttkImage.c, generic/ttk/ttkInit.c,
- * generic/ttk/ttkLabel.c, generic/ttk/ttkNotebook.c,
- * generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c,
- * generic/ttk/ttkScale.c, generic/ttk/ttkScrollbar.c,
- * generic/ttk/ttkSeparator.c, generic/ttk/ttkTheme.h,
- * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.h:
- Global reduction: use per-file *_Init() routines to reduce the number
- of globally-visible initialization records.
-
-2006-12-13 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (install-doc): intentionally skip ttk_dialog.n
- installation (not for public consumption)
-
- * doc/scrollbar.n, doc/button.n, doc/checkbutton.n:
- * doc/entry.n, doc/frame.n, doc/label.n, doc/labelframe.n:
- * doc/menu.n, doc/menubutton.n, doc/panedwindow.n:
- * doc/radiobutton.n, doc/scrollbar.n, doc/ttk_*: revamp ttk docs to
- use consist nroff format (not 100% consistent with classic widget
- docs). Add more man page cross-linking "SEE ALSO".
-
- * generic/ttk/ttkInit.c:
- * generic/ttk/ttkTreeview.c: make treeview exist by default
- * generic/ttk/ttkPanedwindow.c: s/TtkPaned_Init/TtkPanedwindow_Init/
+ * library/ttk/defaults.tcl, library/ttk/treeview.tcl,
+ * library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl:
+ Don't need separate 'Item', 'Cell', and 'Row' style settings anymore,
+ only the base "Treeview" style is used.
- * win/Makefile.in, unix/Makefile.in (demo): add 'demo' target
-
-2006-12-13 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/ttk.tcl: Try to straighten out theme loading and
- selection logic.
- * generic/ttk/ttkElements.c, library/ttk/defaults.tcl,
- * generic/ttk/ttkClamTheme.c, library/ttk/clamTheme.tcl:
- Provide package in C part instead of Tcl part.
-
-2006-12-12 Joe English <jenglish@users.sourceforge.net>
-
- * library/ttk/ttk.tcl, generic/ttkTheme.c: Remove nonfunctional code.
-
-2006-12-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinButton.c (InitBoxes): Call Tcl_Panic() if loading of bitmap
- resources fails. This change generates an error if Tk is unable to
- find button widget resources instead of silently failing and then
- drawing widgets incorrectly.
- * win/rc/tk_base.rc: If the user defines BASE_NO_TK_ICON then compile
- the base resources file without a "tk" icon. This change makes it
- easier to replace the default tk icon with a custom icon. [Patch
- 1614362]
-
-2006-12-11 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * unix/tkUnixWm.c (TkWmMapWindow, WmClientCmd): Added support for
- _NET_WM_PID property from the EWMH spec. This is only installed when
- the client machine is set.
- (WmProtocolCmd, UpdateWmProtocols, TkWmProtocolEventProc): Added
- support for the _NET_WM_PING protocol from the EWMH spec. Note that
- the support for this is not exposed to the script level as that would
- prevent correct handling.
+2008-05-23 Joe English <jenglish@users.sourceforge.net>
-2006-12-10 Joe English <jenglish@users.sourceforge.net>
+ * generic/ttk/ttkLabel.c: [Bug 1967576]: Avoid passing width or height
+ <= 0 to Tk_RedrawImage, as this leads to a panic on Windows.
- * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h,
- * generic/ttk/ttk.decls, generic/ttk/ttkTheme.c,
- * generic/ttk/ttkLayout.c, generic/ttk/ttkDecls.h:
- Rename typedef Ttk_Element => Ttk_ElementImpl.
+2008-05-16 Pat Thoyts <patthoyts@users.sourceforge.net>
-2006-12-09 Joe English <jenglish@users.sourceforge.net>
+ * library/ttk/xpTheme.tcl: Add correct border to combobox on Vista
- * generic/ttk/ttkButton.c, generic/ttk/ttkImage.c,
- * generic/ttk/ttkLabel.c, generic/ttk/ttkWidget.h,
- * generic/ttk/ttkTheme.h, generic/ttk/ttkNotebook.c,
- * generic/ttk/ttkTreeview.c, doc/ttk_image.n:
- Merged duplicate functionality between image element factory, image
- element, and -image option processing. Image element factory now takes
- an imageSpec argument instead of a separate image name and -map option
- * tests/ttk/image.test(image-1.1): Can catch this error earlier now.
+2008-05-15 Pat Thoyts <patthoyts@users.sourceforge.net>
-2006-12-06 Kevin Kenny <kennykb@acm.org>
+ * win/makefile.vc: We should use the thread allocator for threaded
+ * win/rules.vc: builds. Added 'tclalloc' option to disable.
- * unix/configure.in: Further changes to avoid attempting to link
- * unix/configure: against Xft libraries in a non-Xft build
- [Bug 1609616] (dgp)
+2008-05-14 Donal K. Fellows <dkf@users.sf.net>
-2006-12-04 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkPanedWindow.c (PanedWindowProxyCommand)
+ (DisplayPanedWindow): [Bug 1639824]: Ensure that a zero width never
+ gets fed to the underlying window system.
- * generic/tkListbox.c (ConfigureListboxItem): ListboxWorldChanged not
- needed - just call EventuallyRedrawRange. [Bug 1608046] (rezic)
+2008-05-13 Pat Thoyts <patthoyts@users.sourceforge.net>
-2006-12-04 Donal K. Fellows <dkf@users.sf.net>
+ * library/console.tcl: Support pixel sized font in +/- keybinding.
+ * tests/listbox.test: -activestyle default is underline on windows.
+ * tests/winDialog.test: Fixed hanging tk_chooseColor tests.
- TIP #286 IMPLEMENTATION
+2008-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkMenu.c (MenuWidgetObjCmd, MenuDoXPosition):
- * doc/menu.n, tests/menu.test: Added an [$menu xposition] subcommand
- which is useful in menubars and when menus use multiple columns. Many
- thanks to Schelte Bron for the implementation.
+ * library/tk.tcl: Support for ttk widgets in AmpWidget
+ * doc/button.n: [Patch 1883418]: Note negative widths for button.
-2006-12-01 Kevin Kenny <kennykb@acm.org>
+2008-05-09 Pat Thoyts <patthoyts@users.sourceforge.net>
- TIP #300 IMPLEMENTATION
+ * doc/ttk_*: 'identify' widget command is on all ttk widgets.
- * doc/font.n: Added a [font actual $font $char]
- * generic/tkFont.c: variant that introspects the font that
- * generic/tkFont.h: is chosen to render a given character
- * macosx/tkMacOSXFont.c: in a given nominal font. Added
- * tests/font.test: documentation and test cases for the
- * unix/tkUnixFont.c: new command syntax.
- * unix/tkUnixRFont.c:
- * win/tkWinFont.c:
+2008-05-04 Joe English <jenglish@users.sourceforge.net>
-2006-12-01 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/ttkMacOSAquaTheme.c: [Bug 1942785]: "default" and "focus"
+ adornments should not be disjoint.
- * doc/wm.n, tests/winWm.test:
- * win/tkWinWm.c: add -transparentcolor attribute for Windows.
+2008-04-27 Donal K. Fellows <dkf@users.sf.net>
-2006-12-01 Joe English <jenglish@users.sourceforge.net>
+ * */*.c: A large tranche of getting rid of pre-C89-isms; if your
+ compiler doesn't support things like proper function declarations,
+ 'void' and 'const', borrow a proper one when building Tcl. (The header
+ files allow building things that link against Tcl with really ancient
+ compilers still; the requirement is just when building Tcl itself.)
- * generic/ttk/ttkTheme.h, generic/ttk/ttkLayout.c: Dead code removal.
+2008-04-25 Joe English <jenglish@users.sourceforge.net>
-2006-11-30 Daniel Steffen <das@users.sourceforge.net>
+ * library/ttk/treeview.tcl: [Bug 1951733]: [$tv selection] takes a
+ list of items, not a single item.
- * macosx/tkMacOSXDialog.c (Tk_MessageBoxObjCmd): fix inability to use
- buttons with standard Escape key binding as -default button (reported
- on tcl-mac by Hans-Christoph Steiner).
+2008-04-20 Pat Thoyts <patthoyts@users.sourceforge.net>
- * macosx/tkMacOSXWm.c (WmAttributesCmd): fix getting [wm attr -alpha].
- [Bug 1581932]
+ * win/makefile.vc: [Bug 1900872]: Include ws2_32 in the link list.
+ * doc/menu.n: [Bug 1887169]: Minor change regarding the system menu.
+ * doc/button.n: [Bug 1926223]: Minor clarification of button flash.
-2006-11-28 Joe English <jenglish@users.sourceforge.net>
+2008-04-17 Donal K. Fellows <dkf@cspool38.cs.man.ac.uk>
- * library/ttk/fonts.tcl: Clean up temporary variables.
+ * doc/text.n: Correct description of when -relief option is ignored on
+ a tag. Thanks to emiliano for spotting.
-2006-11-27 Kevin Kenny <kennykb@acm.org>
+2008-04-17 Don Porter <dgp@users.sourceforge.net>
- * unix/configure.in: Corrected Xft configuration so that Xft actually
- does get turned on when available.
- * unix/configure: autoconf
+ * generic/tkCanvas.c: [Bug 1327482]: Fix logic that determines when
+ canvas item <Enter> event should fire. Thanks to Sebastian Wangnick.
-2006-11-26 Joe English <jenglish@users.sourceforge.net>
+2008-04-16 Daniel Steffen <das@users.sourceforge.net>
- * generic/ttk/ttkWidget.c, generic/ttk/ttkPaned.c: Fix [Bug 1603506]
- * library/ttk/button.tcl, library/ttk/combobox.tcl,
- * library/ttk/utils.tcl: Rename ttk::CopyBindings to ttk::copyBindings
- * generic/ttk/ttkTreeview.c, doc/ttk_treeview.n:
- -displaycolumns {} now means "no columns" instead of "all columns".
- Use -displaycolumns #all for "all columns". [Bug 1547622]
+ * generic/tkStubInit.c: [Patch 1938497]: Make stubs
+ * generic/tkWindow.c (Initialize): tables static const and export
+ only a module-scope pointer to to the main stubs table (for package
+ init).
-2006-11-26 Daniel Steffen <das@users.sourceforge.net>
+2008-04-14 Pat Thoyts <patthoyts@users.sourceforge.net>
- * unix/tcl.m4 (Linux): --enable-64bit support. [Patch 1597389]
- * unix/configure: autoconf-2.59 [Bug 1230558]
+ * win/tkWinDialog.c: [Bug 1941740]: Fix [tk_chooseColor -title].
+ * win/tkWinTest.c: Added parent to testgetwininfo
+ * tests/winDialog.test: Created some tk_chooseColor win tests.
-2006-11-24 Jeff Hobbs <jeffh@ActiveState.com>
+2008-04-09 Jan Nijtmans <nijtmans@users.sourceforge.net>
- * macosx/tkMacOSXInit.c (TkpInit): only set tcl_interactive 1 if it
- isn't already defined. Allows embedders to set it to 0 to prevent the
- console appearing on OS X. [Bug 1487701]
+ * generic/tkImgGIF.c: Let the GIF writer use a real LZW compressor.
- * unix/tkUnixMenu.c (DrawMenuUnderline): bound Tcl_UtfAtIndex usage
- * tests/menu.test (menu-36.1): [Bug 1599877]
+2008-04-08 Pat Thoyts <patthoyts@users.sourceforge.net>
-2006-11-24 Joe English <jenglish@users.sourceforge.net>
+ * win/ttkWinXpTheme.c: Provide a visual-styles API element engine
+ * tests/ttk/vsapi.test: to permit scripts to create any available
+ * doc/ttk_vsapi.n: windows xp/vista element. Plus basic tests.
- * library/ttk/altTheme.tcl, library/ttk/clamTheme.tcl,
- * library/ttk/defaults.tcl, library/ttk/winTheme.tcl,
- * library/ttk/xpTheme.tcl: explicitly specify -anchor w on TMenubutton
- * tests/ttk/entry.test: Fixed font dependency; test entry-3.2 should
- work on all platforms now.
- * library/classicTheme.tcl: Don't define or use TkClassicDefaultFont.
- * generic/ttk/ttkTreeview.c, generic/ttk/ttkPanedwindow.c: Handle
- missing layouts.
+2008-04-08 Daniel Steffen <das@users.sourceforge.net>
-2006-11-23 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkDecls.h: make genstubs (genStubs.tcl changes).
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
- * win/tkWinMenu.c (TkWinHandleMenuEvent, DrawMenuUnderline): Handle
- unichar underlining correctly and safely. [Bug 1599877]
+2008-04-08 Kevin Kenny <kennykb@acm.org>
-2006-11-20 Joe English <jenglish@users.sourceforge.net>
+ * tkWinEmbed.c: Removed #if 0 code. Trust the revision control
+ system, if you need it again, you can find it.
- * win/ttkWinXPTheme.c: Add support for alternate/indeterminate
- checkbutton state. Fix various spacing parameters [Bug 1596020, patch
- from Tim Baker]. Remove unused uxtheme hooks.
+ * tkWinSend.c: Added conditional compilation to silence several
+ compiler warnings.
-2006-11-16 Donal K. Fellows <dkf@users.sf.net>
+2008-04-07 Jeff Hobbs <jeffh@ActiveState.com>
- * doc/colors.n, doc/wm.n: Minor fixes, added See Also.
+ * generic/tkWindow.c (Initialize): [Bug 1937135]: Fix double-free on
+ * tests/main.test (main-3.*): Tk_ParseArgv error.
- * doc/labelframe.n: Added an example.
+ * generic/tkArgv.c: Fix -help mem explosion. [Bug 1936238] (kenny)
-2006-11-15 Donal K. Fellows <dkf@users.sf.net>
+2008-04-04 Pat Thoyts <patthoyts@users.sourceforge.net>
- * doc/label.n: Added an example and some See Also refs.
+ * library/ttk/sizegrip.tcl: Don't resize if the toplevel is not
+ resizable or the sizegrip has been disabled.
- * doc/ConfigWidg.3, doc/bind.n, doc/grid.n, doc/panedwindow.n:
- * doc/text.n, doc/ttk_Geometry.3, doc/ttk_button.n:
- * doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
- * doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n, doc/ttk_intro.n:
- * doc/ttk_label.n, doc/ttk_labelframe.n, doc/ttk_menubutton.n:
- * doc/ttk_notebook.n, doc/ttk_panedwindow.n, doc/ttk_progressbar.n:
- * doc/ttk_radiobutton.n, doc/ttk_scrollbar.n, doc/ttk_separator.n:
- * doc/ttk_sizegrip.n, doc/ttk_style.n, doc/ttk_widget.n, doc/wm.n:
- Convert \fP to \fR so that man-page scrapers have an easier time.
+2008-04-03 Pat Thoyts <patthoyts@users.sourceforge.net>
-2006-11-14 Joe English <jenglish@users.sourceforge.net>
+ * win/makefile.vc: Fixed stubs usage
+ * library/ttk/xpTheme.tcl: fix the colour of labelframe in xp
- * generic/ttk/ttkDefaultTheme.c: Fix off-by-one bug in tree indicator
- size computation [Bug 1596021, patch from Tim Baker]. Increased
- default size from 7 to 9 pixels.
+2008-04-02 Daniel Steffen <das@users.sourceforge.net>
-2006-11-12 Joe English <jenglish@users.sourceforge.net>
+ * generic/tk.decls: Remove 'export' declarations of symbols now
+ only in libtkstub and no longer in libtk.
- * generic/ttkScroll.c: *correct* fix for [Bug 1588251].
+ * generic/tkStubLib.c: [Bug 1819422]: Make symbols in libtkstub.a
+ MODULE_SCOPE to avoid exporting them from
+ libraries that link with -ltkstub; constify
+ tk*StubsPtr and stub table hook pointers.
-2006-11-12 Joe English <jenglish@users.sourceforge.net>
+ * generic/tkStubLib.c: Undef USE_TCL_STUBS before defining it
+ * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef
- * tests/ttk/ttk.test(ttk-6.9): Workaround for [Bug 1583038]
+ * generic/tkDecls.h: make genstubs
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c:
-2006-11-12 Joe English <jenglish@users.sourceforge.net>
+ * unix/configure.in (Darwin): Remove now unnecessary unexporting of
+ libtclstub symbols from libtk.
- * generic/ttkScroll.c: Reworked cleanup procedure; "self-cancelling"
- idle call is not robust, call Tcl_CancelIdleCall() in
- TtkFreeScrollHandle instead. Fixes [Bug 1588251]
+ * unix/configure: autoconf-2.59
-2006-11-10 Daniel Steffen <das@users.sourceforge.net>
+2008-04-01 Don Porter <dgp@users.sourceforge.net>
- * macosx/Wish.xcodeproj/project.pbxproj: remove tclParseExpr.c and
- bwidget.test.
+ * generic/tkStubLib.c (Tk_InitStubs): Added missing error
+ * generic/tkWindow.c (Tk_PkgInitStubsCheck): message and removed
+ needless #ifdef complexity.
- * unix/tcl.m4 (Darwin): suppress linker arch warnings when building
- universal for both 32 & 64 bit and no 64bit CoreFoundation is
- available; sync with tcl tcl.m4 change.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
-2006-11-08 Kevin Kenny <kennykb@acm.org>
-
- * unix/configure.in: Silenced warnings about missing Xft configuration
- unless --enable-xft is requested explicitly. Also added a few basic
- checks that we can actually compile and link against Xft headers and
- libraries. [Bug 1592667]
- * unix/configure: Regen.
-
-2006-11-07 Kevin Kenny <kennykb@acm.org>
-
- * unix/configure.in: Made --enable-xft the default.
- * unix/configure: Regen.
-
-2006-11-06 Joe English <jenglish@users.sourceforge.net>
-
- * generic/ttk/ttkClassicTheme.c, generic/ttk/ttkPanedwindow.c,
- * generic/ttk/ttkTheme.c, generic/ttk/ttkTreeview.c,
- * win/ttkWinXPTheme.c, library/ttk/entry.tcl,
- * library/ttk/notebook.tcl, library/ttk/panedwindow.tcl,
- * library/ttk/utils.tcl, tests/ttk/entry.test, tests/ttk/bwidget.test:
- Miscellaneous minor changes to re-sync Ttk codebase with Tile CVS: fix
- comments damaged by overzealous search-and-destroy; removed obsolete
- [style default] synonym for [ttk::style configure]; removed other dead
- code.
-
-2006-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/safetk.tcl (::safe::tkTopLevel): Theme it.
-
- * generic/ttk/ttkLayout.c: We do not want to require tkInt in all
- * generic/ttk/ttkMananager.h: the ttk files so added the definition
- * generic/ttk/ttkTheme.h: of MODULE_SCOPE to ttkTheme.h. Ensures
- * generic/ttk/ttkWinMonitor.c: everyone gets to see the definition
- from someplace.
-
- * library/ttk/fonts.tcl: In a safe interp there is no osVersion field
- in tcl_platform so work around it.
-
-2006-11-02 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/ttk/ttkBlink.c, generic/ttk/ttkButton.c:
- * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
- * generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
- * generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
- * generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
- * generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
- * generic/ttk/ttkLayout.c, generic/ttk/ttkManager.h:
- * generic/ttk/ttkNotebook.c, generic/ttk/ttkPanedwindow.c:
- * generic/ttk/ttkProgress.c, generic/ttk/ttkScale.c:
- * generic/ttk/ttkScroll.c, generic/ttk/ttkScrollbar.c:
- * generic/ttk/ttkSeparator.c, generic/ttk/ttkSquare.c:
- * generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
- * generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h:
- * generic/ttk/ttkThemeInt.h, generic/ttk/ttkTrack.c:
- * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
- * generic/ttk/ttkWidget.h, macosx/ttkMacOSXTheme.c:
- * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c: ensure
- all global Ttk symbols have Ttk or ttk prefix; declare all externally
- visible Ttk symbols not contained in stubs table as MODULE_SCOPE (or as
- static when possible); so that 'make check{exports,stubs}' once again
- complete without errors.
-
- * macosx/tkMacOSXColor.c (TkMacOSXCompareColors): ifdef out when unused
-
- * macosx/Wish.xcodeproj/project.pbxproj: check autoconf/autoheader exit
- status and stop build if they fail.
-
- * macosx/tkMacOSXWindowEvent.c (GenerateUpdateEvent): fix handling of
- Carbon Update events: the QuickDraw window update region was being
- ignored and all child TkWindows were sent an Expose XEvent even when
- they did not need to be redrawn. [Patch 1589226]
-
-2006-11-01 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDebug.c: add TkMacOSX prefix to leftover
- * macosx/tkMacOSXDebug.h: macosx-private global symbols without Tk
- * macosx/tkMacOSXEmbed.c: prefix; ifdef out currently unused debug
- * macosx/tkMacOSXEvent.c: procs.
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXCarbonEvents.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWm.c:
+ * generic/tkWindow.c: [Tcl Bug 1819422]: Revised package init so
+ * unix/Makefile.in: that "tkStubsPtr" is not present in libtk.so,
+ * win/Makefile.in: but is present only in libtkstub.a. This
+ * win/makefile.bc: tightens up the rules for users of the stubs
+ * win/makefile.vc: interfaces.
-2006-10-31 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Added ttk files to msvc build and add manifest
- * win/rules.vc: files to binaries with MSVC8.
-
-2006-10-31 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new Ttk files.
-
- * macosx/ttkMacOSXTheme.c: standardize header #includes.
-
- * unix/Makefile (checkstubs, checkexports): check ttk.decls, allow
- export of Ttk prefixed symbols.
-
- * generic/ttk/tkDefaultTheme.c: fix warnings.
-
-2006-10-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/ttk_Geometry.3, doc/ttk_Theme.3, doc/ttk_button.n:
- * doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
- * doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n:
- * doc/ttk_intro.n, doc/ttk_label.n, doc/ttk_labelframe.n:
- * doc/ttk_menubutton.n, doc/ttk_notebook.n, doc/ttk_panedwindow.n:
- * doc/ttk_progressbar.n, doc/ttk_radiobutton.n, doc/ttk_scrollbar.n:
- * doc/ttk_separator.n, doc/ttk_sizegrip.n, doc/ttk_style.n:
- * doc/ttk_treeview.n, doc/ttk_widget.n,:
- * generic/ttk/ttk.decls, generic/ttk/ttkBlink.c:
- * generic/ttk/ttkButton.c, generic/ttk/ttkCache.c:
- * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
- * generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
- * generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
- * generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
- * generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
- * generic/ttk/ttkLayout.c, generic/ttk/ttkManager.c:
- * generic/ttk/ttkManager.h, generic/ttk/ttkNotebook.c:
- * generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c:
- * generic/ttk/ttkScale.c, generic/ttk/ttkScroll.c:
- * generic/ttk/ttkScrollbar.c, generic/ttk/ttkSeparator.c:
- * generic/ttk/ttkSquare.c, generic/ttk/ttkState.c:
- * generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
- * generic/ttk/ttkTagSet.c, generic/ttk/ttkTheme.c:
- * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h:
- * generic/ttk/ttkTrace.c, generic/ttk/ttkTrack.c:
- * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
- * generic/ttk/ttkWidget.h:
- * library/demos/ttk_demo.tcl, library/demos/ttk_iconlib.tcl:
- * library/demos/ttk_repeater.tcl:
- * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl:
- * library/ttk/button.tcl, library/ttk/clamTheme.tcl:
- * library/ttk/classicTheme.tcl, library/ttk/combobox.tcl:
- * library/ttk/cursors.tcl, library/ttk/defaults.tcl:
- * library/ttk/dialog.tcl, library/ttk/entry.tcl:
- * library/ttk/fonts.tcl, library/ttk/icons.tcl:
- * library/ttk/keynav.tcl, library/ttk/menubutton.tcl:
- * library/ttk/notebook.tcl, library/ttk/panedwindow.tcl:
- * library/ttk/progress.tcl, library/ttk/scale.tcl:
- * library/ttk/scrollbar.tcl, library/ttk/sizegrip.tcl:
- * library/ttk/treeview.tcl, library/ttk/ttk.tcl:
- * library/ttk/utils.tcl, library/ttk/winTheme.tcl:
- * library/ttk/xpTheme.tcl:
- * macosx/ttkMacOSXTheme.c:
- * tests/ttk/all.tcl, tests/ttk/bwidget.test, tests/ttk/combobox.test:
- * tests/ttk/entry.test, tests/ttk/image.test:
- * tests/ttk/labelframe.test, tests/ttk/layout.test:
- * tests/ttk/misc.test, tests/ttk/notebook.test:
- * tests/ttk/panedwindow.test, tests/ttk/progressbar.test:
- * tests/ttk/scrollbar.test, tests/ttk/treetags.test:
- * tests/ttk/treeview.test, tests/ttk/ttk.test, tests/ttk/validate.test:
- * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c:
- First import of Ttk themed Tk widgets as branched from tile 0.7.8
-
- * generic/tkInt.h, generic/tkWindow.c: add Ttk_Init call, copy tk
- classic widgets to ::tk namespace.
- * library/tk.tcl: add source of ttk/ttk.tcl, define $::ttk::library.
- * unix/Makefile.in, win/Makefile.in: add Ttk build bits
- * win/configure, win/configure.in: check for uxtheme.h (XP theme).
-
-2006-10-23 Don Porter <dgp@users.sourceforge.net>
-
- * README: Bump version number to 8.5a6
+ * README: Bump version number to 8.6a0
* generic/tk.h:
* library/tk.tcl:
+ * macosx/Wish-Common.xcconfig:
* unix/configure.in:
* unix/tk.spec:
+ * win/README:
* win/configure.in:
+ * win/tcl.m4:
* unix/configure: autoconf-2.59
* win/configure:
-2006-10-19 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- *** 8.5a5 TAGGED FOR RELEASE ***
-
- * generic/tkImgBmap.c: Fixed line endings.
- * win/makefile.vc: Patched up build system to manage
- * win/rules.vc: AMD64 with MSVC8
- * win/nmakehlp.c: Ensure operation without Platform SDK.
-
-2006-10-18 Don Porter <dgp@users.sourceforge.net>
-
- * changes: 8.5a5 release date set.
-
-2006-10-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/text.n: fix docs to not correct -tabs usage case.
-
- * generic/tkTextDisp.c (SizeOfTab): fix -tabstyle wordprocessor tab
- alignment to correct tab edge case. [Bug 1578858]
-
-2006-10-17 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkText.c: Applied suggested patch from [Bug 1536735]
- * tests/text.test: Update test for above patch.
- * tests/textWind.test: Corrected test to catch all messages
- * tests/safe.test: Silence spurious win32 failure awaiting TIP150
- * tests/winDialog.test: Updated test for file name length check.
- * test/winWm.test: Corrected test expectation for menu wrapping.
-
-2006-10-16 Andreas Kupries <andreask@activestate.com>
-
- * doc/WindowId.3: Pat's commit on 2006-10-08 broke the .SH NAME
- information across several lines, breaking the cross-linking of
- manpages during installation for this one. Put everything back on a
- single line, unbreaking it.
-
-2006-10-16 Daniel Steffen <das@users.sourceforge.net>
-
- * changes: updates for 8.5a5 release.
-
- * macosx/tkMacOSXDraw.c: fix numerous issues in CG and QD drawing
- procs so that they now match X11 drawing much more closely [Bug
- 1558051]; use Tiger ellipse drawing API when available; fix comments &
- whitespace.
-
- * macosx/tkMacOSXInit.c: set default linewidth limit for CG
- antialiasing to 0 as thin horizontal/vertical lines look good now.
- * macosx/README: document CG antialiasing limit changes.
-
- * generic/tkCanvLine.c (ConfigureLine): on TkAqua, pass outline
- * generic/tkCanvPoly.c (ConfigurePolygon): linewidth in gc even for
- * generic/tkRectOval.c (ConfigureRectOval): fills (as it controls AA).
-
- * macosx/GNUmakefile: don't redo prebinding of non-prebound binaires.
-
- * library/demos/pendulum.tcl: fix incorrect setting of toplevel title.
-
-2006-10-10 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for 8.5a5 release
-
-2006-10-08 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * generic/tkWindow.c: Implemented TIP #264 - Tk_Interp function.
- * doc/WindowId.3: Documented Tk_Interp.
- * generic/tk.decls: Added to the stubs interface and
- * generic/tkDecls.h: regenerated.
- * generic/tkStubsInit.c:
-
-2006-10-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (Ucs2beToUtfProc, UtfToUcs2beProc):
- (TkpFontPkgInit, encodingAliases): Correct alignment issues in
- encoding conversion. Call ucs-2be "unicode" on big-endian systems.
- [Bug 1122671]
-
-2006-09-27 Andreas Kupries <andreask@activestate.com>
-
- * unix/Makefile.in (install-binaries): Added a second guard to the
- * win/Makefile.in: package index file to prevent older versions of Tcl
- * win/makefile.vc: from seeing version numbers which may contain a/b
- information, and then balking on them. This could otherwise happen
- when Tcl/Tk 8.4 and 8.5 are installed in the same directory, seeing
- each other. [Bug 1566418]
-
-2006-09-22 Andreas Kupries <andreask@activestate.com>
-
- * generic/tkConsole.c: TIP #268 update regarding registered package
- * generic/tkMain.c: version, now using full patchlevel instead of
- * generic/tkWindow.c: major.minor
- * library/tk.tcl:
- * unix/configure:
- * unix/Makefile.in:
- * unix/tcl.m4:
- * win/configure:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/rules.vc:
- * win/tcl.m4:
-
-2006-09-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus with
- images to avoid clipping bug. [Bug 1329198]
-
-2006-09-21 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkImgBmap.c (ImgBmapPostscript): Change 0 to NULL, since
- they are not interchangable on all platforms in all circumstances.
- [Tcl Bug 1562528]
-
-2006-09-11 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (TkMacOSXMakeRealWindowExist): revert part of
- 2006-05-16 change that had set overrideredirect windows to not become
- activated by the window manager, as this prevented interaction with
- native widgets in such windows [Bug 1472624]; apply changes to carbon
- window attributes even if native window has already been created.
-
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): fix app
- * macosx/tkMacOSXMenu.c (DrawMenuBarWhenIdle): menu item key shortcuts
- * macosx/tkMacOSXInt.h: when custom ".apple" menu is installed.
-
- * library/demos/widget: on TkAqua, don't install file menu with single
- quit menu item, as the application menu already has a quit item.
-
- * macosx/tkMacOSXColor.c: fix building on Mac OS X 10.2.
-
-2006-09-10 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXColor.c (TkSetMacColor,TkpGetColor): use AppearanceMgr
- * macosx/tkMacOSXDefault.h: to retrieve platform std colors for text
- * macosx/tkMacOSXPort.h: selections, add "systemHighlightSecondary"
- color name for standard color of inactive selections, use this color as
- default for text widget -inactiveselectbackground to implement platform
- standard look for inactive text selections.
-
- * library/text.tcl (aqua): remove focus bindings to set selection color
-
- * generic/tkTextBTree.c (TkTextIsElided): on TkAqua, don't show
- * generic/tkTextDisp.c (GetStyle): inactive text selection when
- text widget is disabled.
-
- * generic/tkEntry.c (DisplayEntry): change default TkAqua selection
- * macosx/tkMacOSXDefault.h: relief to "flat" (platform std).
-
- * generic/tkText.c (CreateWidget): fix bug leading to default text
- selection relief string DEF_TEXT_SELECT_RELIEF being ignored.
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): allow mouse
- event delivery to background windows with kWindowNoActivatesAttribute
- (e.g. overrideredirect windows), as these never come to the foreground
- they would never receive any mouse events otherwise. [Bug 1472624]
-
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): do not
- send focus events to any windows with kWindowNoActivatesAttribute.
-
- * macosx/tkMacOSXXStubs.c (XQueryColor, XQueryColors): implement basic
- XColor computation from pixel values, enough to make tkImg's window.c
- happy, fixes img::window failures reported on tcl-mac.
-
- * macosx/tkMacOSXMenu.c (DrawMenuEntryLabel): fix leak. [Bug 1554672]
-
- * macosx/GNUmakefile: workaround bug in 'cp -pRH' on Darwin 6 and
- earlier, fixes 'make embedded' failure reported on tcl-mac; fix error
- from 'make deploy' with same build tree as previous 'make embedded'.
-
- * macosx/Wish.xcodeproj/project.pbxproj: add new tclUnixCompat.c file.
-
- * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): fix typo.
-
- * unix/tcl.m4: sync with tcl/unix/tcl.m4.
- * unix/configure: autoconf-2.59
-
-2006-09-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION control
- * generic/tkInt.h: of entry/text selection display based on focus
- * generic/tkText.c: to the Tcl level, controlled by
- * generic/tkWindow.c: ::tk::AlwaysShowSelection (boolean, private).
- * library/tk.tcl: [Bug 1553691]
- * macosx/tkMacOSXDefault.h:
- * unix/tkUnixDefault.h:
- * unix/tkUnixPort.h:
- * win/tkWinDefault.h:
-
-2006-08-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinKey.c: Add WM_UNICHAR window message support (used by
- * win/tkWinX.c: virtual keyboard apps). [Bug 1518677] (petasis)
-
-2006-08-24 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXScrlbr.c (UpdateControlValues): set native scrollbar
- control bounds only once all size adjustments have been computed.
- Fixes issue with grow icon obscuring scrollbar reported on tcl-mac.
-
-2006-08-21 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXCarbonEvents.c (CarbonTimerProc): avoid starving main
- event loop: limit the number of tcl events processed per invocation.
- Fixes bug reported on tcl-mac by Kevan Hashemi.
-
-2006-08-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * tests/text.test (text-25.15): Added test suggested by Sam
- <baudinm@yahoo.com> on comp.lang.tcl
-
- * generic/tk.h, generic/tkInt.h: Stylistic improvements. No API change.
-
-2006-08-18 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
- universal builds including x86_64, for 64-bit CoreFoundation on Leopard
- and for use of -mmacosx-version-min instead of MACOSX_DEPLOYMENT_TARGET
- * unix/configure.in (Darwin): remove 64-bit arch flags from CFLAGS for
- combined 32-bit and 64-bit universal builds, as neither TkAqua nor
- TkX11 can be built for 64-bit at present.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
- * macosx/Wish.xcodeproj/project.pbxproj: switch native release targets
- to use DWARF with dSYM, Xcode 3.0 changes.
- * macosx/README: updates for x86_64 support in Tcl.
-
- * macosx/tkMacOSXInit.c (TkpInit): when available, use public
- TransformProcessType() API instead of CPSEnableForegroundOperation()
- SPI to notify the window server that we are a GUI application.
-
- * macosx/tkMacOSXWm.c (WmAttrGetTitlePath): use HIWindow API on >=Tiger
-
- * macosx/tkMacOSXMouseEvent.c (GenerateToolbarButtonEvent):
- * macosx/tkMacOSXMenus.c (GenerateEditEvent):
- * macosx/tkMacOSXMenu.c (MenuSelectEvent): bzero() the XVirtualEvent
- structure before use to ensure all fields are initialized. [Bug
- 1542205]
-
-2006-08-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXWm.c (WmAttributesCmd): correct OS X result for [wm
- attributes $top].
-
-2006-07-25 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): handle key
- shortcut for kHICommandQuit in the same way as other application menu
- item key shortcuts. [Bug 1516950]
-
-2006-07-24 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (TkWmMapWindow): fix incorrect values of wmInfo
- parentWidth/Height for toplevels by recalculating them once the window
- is mapped (i.e once the window&structure sizes are known). [Bug
- 1358663]
- (ParseGeometry): sync with ParseGeometry in tkUnixWm.c/tkWinWm.c.
-
-2006-07-21 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkBind.c (TkBindInit): for REDO_KEYSYM_LOOKUP, change
- keysym-to-string mapping hash to use first name in ks_names.h instead
- of last (if there are multiple possibilities), e.g. "F11" instead of
- "L1".
-
- * macosx/tkMacOSXKeyboard.c (TkpGetKeySym): correct keysyms for pure
- modifier key presses [Bugs 700311, 1525905]; correct keysym for Enter
- key; add keysyms for new NumLock and Fn modifiers (added 2005-08-09).
-
-2006-07-20 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support
- * unix/tkUnixSend.c (Tk_GetUserInactiveTime): for weakly
- importing symbols not available on OSX 10.2 or 10.3, enables binaires
- built on later OSX versions to run on earlier ones.
- * macosx/Wish.xcodeproj/project.pbxproj: enable weak-linking; turn on
- extra warnings.
- * macosx/README: document how to enable weak-linking; cleanup.
- * unix/configure.in: add check on Darwin-X11 for ld support of -weak-l
- * unix/tcl.m4: flag and weak-link libXss if possible as it is not
- available before OSX 10.4; enforce requirement of OSX 10.2 for TkAqua;
- move Darwin specific checks & defines that are only relevant to the tcl
- build out of tcl.m4; restrict framework option to Darwin; clean up
- quoting and help messages.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
- * macosx/GNUmakefile: enable xft for TkX11 build.
- * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw):
- verify validity of context returned from QDBeginCGContext() before use.
- * macosx/tkMacOSXKeyEvent.c: ifdef out diagnostic messages to stderr.
-
- * macosx/tkMacOSXEvent.h: standardize MAC_OS_X_VERSION_MAX_ALLOWED
- * macosx/tkMacOSXMenu.c: checks per QA1316, ensure define can be
- * macosx/tkMacOSXMenubutton.c: overridden on command line (from default
- * macosx/tkMacOSXMenus.c: of current OS version).
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXWm.c:
-
- * generic/tkImgGIF.c (ReadImage):
- * macosx/tkMacOSXCursor.c (TkMacOSXCursor):
- * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol):
- * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext):
- * macosx/tkMacOSXInit.c (Map):
- * xlib/xgc.c (XCreateGC): fix signed-with-unsigned comparison and other
- warnings from gcc4 -Wextra.
-
-2006-07-14 Andreas Kupries <andreask@activestate.com>
-
- * generic/tkWindow.c (Initialize): Modify change of 2006-05-25 (jeffh).
- Release mutex a bit earlier, to prevent lock when OS X creates its
- console windows (recursively enters Tk_Init). Patch by JeffH.
-
-2006-07-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/tkfbox.tcl: catch scrollbar use of highlightthickness
-
-2006-06-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/bgerror.tcl (::tk::dialog::error::bgerror): remove a couple
- of unnecessary hardcoded options
-
-2006-06-14 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkScale.c: Revised variable writing logic to account for
- [scale]'s design that it deals with its value as a formatted string,
- and not as a double. [Bug 891141]
-
-2006-06-14 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXSubwindows.c (TkMacOSXInvalidateWindow): ensure
- invalid clip regions are recreated via TkMacOSXUpdateClipRgn() before
- they are used; correct call order of TkMacOSXInvalidateWindow() and
- TkMacOSXInvalClipRgns() throughout. [Bug 1501922]
-
- * macosx/tkMacOSXDraw.c (TkPutImage): implement drawing of very wide
- images in slices of less than 4096 pixels to workaround CopyBits
- limitation. [Bug 950121]
-
-2006-06-09 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkMain.c: Added Tcl_Preserve() call on the master interp
- as crash protection against any Tcl_DeleteInterp() call that might
- happen.
-
-2006-06-01 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Added Tcl_RegisterChannel() calls to bump the
- refcount of channels passed to Tcl_SetStdChannel(). This prevents early
- free-ing of the channels that leads to crashes. [Bug 912571]
-
-2006-05-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinEmbed.c (TkpGetOtherWindow): Do not panic if no window is
- * unix/tkUnixEmbed.c (TkpGetOtherWindow): found; caller handles. [Bug
- * unix/tkUnixWm.c (Tk_CoordsToWindow, UpdateGeometryInfo): 1212056]
-
- * tests/entry.test (entry-22.1):
- * tests/listbox.test (listbox-6.15):
- * generic/tkListbox.c (ListboxInsertSubCmd, ListboxDeleteSubCmd):
- Ignore Tcl_SetVar2Ex failure of listVarName, similar to entry widget
- handling. [Bug 1424513]
-
-2006-05-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXButton.c (TkMacOSXDrawControl): correct redraw for
- direct transition from disabled to active state. [Bug 706446]
-
-2006-05-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinMenu.c (TkWinMenuKeyObjCmd): get eventPtr after we know the
- window is still alive. [AS bug 45987] [Bug 1236306]
-
- * generic/tkMenu.c (DeleteMenuCloneEntries): Modify entry index
- changes to work around VC6 optimization bug. [Bug 1224330]
-
- * generic/tkMessage.c (MessageWidgetObjCmd): Correct msgPtr
- preserve/release pairing. [Bug 1485750] (afredd)
-
- * generic/tkWindow.c (Initialize): Correct mutex (un)lock pairing.
- [Bug 1479587] (loewis)
-
- * generic/tkBind.c (Tk_BindEvent, TkCopyAndGlobalEval): use Tcl_EvalEx
- instead of Tcl_GlobalEval.
-
-2006-05-16 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): don't send
- focus events to windows of class help or to overrideredirect windows.
- [Bug 1472624]
-
- * macosx/tkMacOSXWm.c: set overrideredirect windows to not become
- activated by the window manager and to not receive OS activate events
- (should make them behave more like on other platforms); use modern
- window class API for overrideredirect and transient windows; set the
- default class of overrideredirect windows to 'simple' rather than
- 'plain' (i.e. no window frame); add missing Panther and Tiger window
- attributes to [::tk::unsupported::MacWindowStyle].
-
-2006-05-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Fix
- opt added 2006-03 that caused slowdown for some common cases. [Bug
- 1409140]
-
-2006-05-13 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkCanvWind.c (DisplayWinItem, WinItemRequestProc): ensure
- canvas window items are unmapped when canvas is unmapped. [Bug 940117]
-
- * macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): empty clip
- region of unmapped windows to prevent any drawing into them or into
- their children from becoming visible. [Bug 940117]
-
- * macosx/tkMacOSXInt.h: revert Jim's attempt of 2005-03-14 to
- * macosx/tkMacOSXSubwindows.c: fix Bug 940117 as it disables Map/Unmap
- event propagation to children. [Bug 1480105]
-
- * macosx/tkMacOSXDraw.c (TkPutImage): handle tkPictureIsOpen flag,
- fixes incorrect positioning of images with complex alpha on native
- buttons; actual alpha blending is still broken in this situation. [Bug
- 1155596]
-
- * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent):
- * macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): workaround carbon bug
- with key shortcut for 'Preferences' app menu item. [Bug 1481503]
-
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only check
- for HICommand menu item shortcuts in the application menu.
+ * generic/tkConsole.c: Relax Tcl_InitStubs() calls so that a Tk 8.6
+ * generic/tkMain.c: might [load] into a Tcl 8.5 interp.
+ * generic/tkWindow.c:
- * macosx/tkMacOSXInt.h: initialize keyboard layout setup in
- * macosx/tkMacOSXInit.c: TkpInit() rather than during handling of
- * macosx/tkMacOSXKeyEvent.c: first key down event.
+ * generic/tkDecls.h: make genstubs
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
- * macosx/tkMacOSXDraw.c: add optional debug code to flash clip
- * macosx/tkMacOSXSubwindows.c: regions during update or draw.
+2008-03-28 Don Porter <dgp@users.sourceforge.net>
-2006-05-04 Don Porter <dgp@users.sourceforge.net>
+ *** 8.5.2 TAGGED FOR RELEASE ***
- * README: Bump version number to 8.5a5
+ * README: Bump to 8.5.2 for release.
* generic/tk.h:
+ * library/tk.tcl:
* unix/configure.in:
* unix/tk.spec:
* win/configure.in:
@@ -5203,2007 +4293,277 @@
* unix/configure: autoconf-2.59
* win/configure:
-2006-04-28 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (TkWmMapWindow, InitialWindowBounds): fix use of
- potentially stale window position in initial configure event on first
- map of a window. [Bug 1476443]
- (TkMacOSXWindowOffset): use modern GetWindowStructureWidths API.
-
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXMouseEvent.c (TkGenerateButtonEventForXPointer): new
- internal function to generate button events for current pointer
- directly, without requiring prior call to XQueryPointer().
-
- * macosx/tkMacOSXMouseEvent.c (XQueryPointer): implement return of
- window-local pointer position.
-
- * macosx/tkMacOSXInt.h: use improvements above to avoid calls to
- * macosx/tkMacOSXKeyEvent.c: GlobalToLocal() when the current port
- * macosx/tkMacOSXMenu.c: might not be set correctly. May fix [Bug
- * macosx/tkMacOSXMenus.c: 1243318]
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
-
- * tkAboutDlg.r: update copyright.
-
- * macosx/tkMacOSXDebug.h: sync #includes with core-8-4-branch.
- * macosx/tkMacOSXEvent.h:
- * macosx/tkMacOSXFont.h:
-
-2006-04-26 Don Porter <dgp@users.sourceforge.net>
-
- *** 8.5a4 TAGGED FOR RELEASE ***
-
- * changes: Updates for next RC
-
-2006-04-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * unix/tkUnixFont.c (TkpGetFontFamilies): Fix crash caused when the
- XServer returns invalid font names. [Bug 1475865]
-
-2006-04-23 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * tests/scrollbar.test: fix to tkAqua test failures
-
-2006-04-18 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * macosx/tkMacOSXEmbed.c: fix to [Bug 1088814] test failures in
- embed.test
-
- * macosx/tkMacOSXWm.c:
- * tests/constraints.tcl:
- * tests/wm.test: fix to 'wm attributes' test for TkAqua
-
-2006-04-11 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkWindow.c (Tk_NameToWindow): Allow NULL interp to
- Tk_NameToWindow. This fixes TkGetWindowFromObj which promises to handle
- NULL but didn't.
-
- * generic/tkGrid.c: Fixed handling of out of bounds row or column.
- * tests/grid.test: [Bug 1432666]
-
-2006-04-11 Don Porter <dgp@users.sourceforge.net>
-
- * unix/Makefile.in: Updated `make dist` target to be sure the
- message catalogs for the widget demo get packaged into the source code
- distribution. [Bug 1466509]
-
-2006-04-11 Daniel Steffen <das@users.sourceforge.net>
-
- * changes: added latest aqua bug fixes.
-
- * macosx/tkMacOSXDialog.c (Tk_MessageBoxObjCmd): added standard Escape
- key binding for msgbox cancel buttons [Patch 1193614], whitespace.
-
- * macosx/tkMacOSXCarbonEvents.c: handle kEventCommandUpdateStatus
- * macosx/tkMacOSXEvent.c: carbon event to dynamically enable
- the 'Preferences' app menu item when proc [::tk::mac::ShowPreferences]
- is defined. [Bug 700316]
-
- * macosx/tkMacOSXHLEvents.c: call ::tk::mac::* procs for all
- * macosx/tkMacOSXWindowEvent.c: registered appleevents [FR 1105284],
- implement print applevent handling, style/whitespace cleanup.
-
- * macosx/tkMacOSXDraw.c (TkMacOSXInitCGDrawing): prevent multiple init.
-
- * macosx/tkMacOSXFont.c: remove #ifdef'd text measuring codepaths now
- * macosx/tkMacOSXInit.c: known to be incorrect, cleanup obsolete text
- * macosx/README: antialiasing control code, document ATSUI text
- antialiasing changes.
-
- * macosx/tkMacOSXInt.h: Implemented 'zoomed' window state
- * macosx/tkMacOSXWindowEvent.c: handling for TkAqua, via titlebar
- * macosx/tkMacOSXWm.c: widget clicks as well as [wm state].
- * doc/wm.n: [Bug 1073456]
-
-2006-04-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/tkfbox.tcl (::tk::IconList_Goto): Fix prefix searching so
- that the start location is reasonable, and the prefix matching is using
- the correct Tcl command for this. [Bug 1467938]
-
-2006-04-10 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
-
- * macosx/tkMacOSXFont.c (MeasureStringWidth): Use implementation based
- on ATSUGetGlyphBounds (TK_MAC_USE_GETGLYPHBOUNDS), so we can use
- kATSUseFractionalOrigins. This in turn corrects [Bug 1461650].
- (InitFont): Use "." and "W" instead of "i" and "w" to determine the
- "-fixed" attribute. This prevents "Apple Chancery" from being
- classified as fixed.
- (InitFontFamilies): Only get the font families once.
-
-2006-04-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (WmResizableCmd): propagate window attribute
- changes to Carbon window manager. [FR 1467004]
- (TkSetWMName, TkMacOSXMakeRealWindowExist): allow empty name for
- toplevels, remove bogus initial window name. [Bug 1450800]
-
-2006-04-07 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): fix return
- values, implement window dragging & growing in background (with Command
- key down) and by fronting clicks [Bug 934524], use correct button &
- modifier state API when application is in background (also in
- TkMacOSXButtonKeyState).
-
- * macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): ensure QD port is set
- correctly before using API relying on it.
-
-2006-04-06 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * macosx/tkMacOSXMouseEvent.c: Now that [wm attributes -titlepath]
- works correctly, add OS support for dragging proxy icons and using the
- titlepath menu.
-
-2006-04-06 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): fix errors in
- setting/removing window proxy icons via [wm attributes -titlepath] and
- [wm iconbitmap], use HIWindow API on Tiger or later. [Bug 1455241]
-
- * unix/tcl.m4: remove TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING
- define on Darwin. [Tcl Bug 1457515]
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
-2006-04-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkWindow.c (Initialize): remove impotent use of
- DeleteWindowsExitProc as a global exit handler.
-
- * generic/tkMenu.c (TkSetWindowMenuBar): remove extra TkMenuInit call
- that caused finalization panic. [Bug 1456851]
- * win/tkWinMenu.c (FreeID, TkpNewMenu, MenuExitHandler)
- (MenuThreadExitHandler, TkpMenuInit, TkpMenuThreadInit): rework Windows
- menu init/finalization to better respect per-process and per-thread
- boundaries. [Bug 1456851]
- (TkWinMenuKeyObjCmd): Do not error when unknown window is passed in.
- [Bug 1236306]
-
- * win/tkWinX.c (TkWinXInit): init default keyboard charset correctly.
- [Bug 1374119] (pajas)
-
- * win/tkWinWm.c (WmProc): pass WM_QUERYENDSESSION message to Tk as
- WM_SAVE_YOURSELF wm protocol callback.
-
- * tests/textWind.test (textWind-10.6.1): prevent infinite update loop
- in case of test failure.
-
- * tests/wm.test (wm-attributes-1.2.4): correct expected result.
-
- * tests/grid.test: fix segfault on empty or "all" index list
- * generic/tkGrid.c (GridRowColumnConfigureCommand): [Bug 1422430]
-
-2006-04-05 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c: fix to crash caused on some platforms by new tests
- introduced to check for [Bug 1414171], which destroy the text widget in
- the dump callback script.
-
-2006-03-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkOption.c (TkOptionDeadWindow): handle OptionThreadExitProc
- being called before DeleteWindowsExitProc.
-
- * win/Makefile.in: convert _NATIVE paths to use / to avoid ".\"
- path-as-escape issue.
-
-2006-03-29 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for next RC
-
- * unix/tkUnixDefault.h: Changed "Black" to "#000000" and "White" to
- "#ffffff" to work around the (broken?) X servers that do not accept
- those color names. [Bug 917433]
-
-2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tcl.m4, win/tcl.m4: []-quote AC_DEFUN functions.
-
-2006-03-26 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c:
- * tests/text.test: Fix for elaborations of [Bug 1414171] for '$text
- dump -command <script>' where script deletes large portions of the
- text widget, or even destroys the widget.
-
-2006-03-28 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.xcode/default.pbxuser: add '-singleproc 1' cli arg to
- * macosx/Wish.xcodeproj/default.pbxuser: tktest to ease test debugging.
-
- * macosx/Wish.xcode/project.pbxproj: removed $prefix/share from
- * macosx/Wish.xcodeproj/project.pbxproj: TCL_PACKAGE_PATH as per change
- to tcl/unix/configure.in of 2006-03-13.
-
- * macosx/tkMacOSXDraw.c: sync whitespace & minor changes with
- * macosx/tkMacOSXEvent.h: core-8-4-branch.
- * macosx/tkMacOSXFont.h:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXNotify.c:
-
-2006-03-27 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for next RC
-
-2006-03-27 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
-
- * generic/tkTextDisp.c (MeasureChars): Fix calculations of start and
- end of string. [Bugs 1325998, 1456157]
-
-2006-03-27 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkImgGIF.c (FileReadGIF): Stop crashes when the first GIF
- frame does not define the overall size of the image. [Bug 1458234]
-
-2006-03-26 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c:
- * generic/tkText.h:
- * generic/tkTextBTree.c:
- * tests/text.test: Fix for [Bug 1414171] for '$text dump -command
- <script>' where 'script' actually modifies the widget during the
- process.
-
-2006-03-25 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext):
- * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw):
- performance improvements, sync similar code, formatting & whitespace.
-
-2006-03-24 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkTextDisp.c: Moved #ifdef MAC_OSX_TK code added by
- * macosx/tkMacOSXColor.c: [Patch 638966] into platform specific files.
- * macosx/tkMacOSXInt.h:
-
- * macosx/tkMacOSX.h: Cleaned up & rationalized order of
- * macosx/tkMacOSXBitmap.c: #includes of tk and carbon headers.
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXCarbonEvents.c:
- * macosx/tkMacOSXClipboard.c:
- * macosx/tkMacOSXColor.c:
- * macosx/tkMacOSXConfig.c:
- * macosx/tkMacOSXCursor.c:
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXEmbed.c:
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXEvent.h:
- * macosx/tkMacOSXFont.h:
- * macosx/tkMacOSXHLEvents.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXKeyboard.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXRegion.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXSend.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXWm.h:
- * macosx/tkMacOSXXStubs.c:
-
-2006-03-23 Reinhard Max <max@tclers.tk>
-
- * unix/tkUnixRFont.c (TkpMeasureCharsInContext): Copied over from
- tkUnixFont.c to fix compiling with --enable-xft .
-
- * unix/tk.spec: Cleaned up and completed. An RPM can now be built from
- the tk source distribution with "rpmbuild -tb <tarball>".
-
-2006-03-23 Don Porter <dgp@users.sourceforge.net>
-
- * tests/textDisp.test: Updated expected error messages to match the
- standardized formats established on 2005-11-17. [Bug 1370296]
-
-2006-03-22 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for next RC
-
-2006-03-21 Daniel Steffen <das@users.sourceforge.net>
+ * changes: Updates for 8.5.2 release.
- * generic/tkFont.c: implementation of ATSUI text rendering
- * generic/tkInt.h: in TkAqua provided by Benjamin
- * generic/tkTextDisp.c: Riefenstahl. [Patch 638966]
- * library/demos/unicodeout.tcl:
- * macosx/tkMacOSXFont.h (new file):
- * macosx/tkMacOSXFont.c:
- * tests/font.test:
- * unix/tkUnixFont.c:
- * win/tkWinFont.c:
+2008-03-27 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkFont.c: moved MODULE_SCOPE declarations of font
- * generic/tkFont.h: helper procs into header files.
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXFont.h:
- * macosx/tkMacOSXMenubutton.c:
+ * library/safetk.tcl (::safe::tkInterpInit): Make sure tk_library and
+ its subdirs (eg, ttk) are on the "safe" access path.
- * macosx/Wish.xcode/project.pbxproj: add new tkMacOSXFont.h file,
- * macosx/Wish.xcodeproj/project.pbxproj: turn off dead code stripping
- as it interferes with -sectcreate (rdar://4486223).
+2008-03-27 Daniel Steffen <das@users.sourceforge.net>
- * macosx/Wish.xcode/default.pbxuser: add TCLLIBPATH=/Library/Tcl
- * macosx/Wish.xcodeproj/default.pbxuser: env var setting to tktest.
+ * unix/tcl.m4 (SunOS-5.1x): [Bug 1921166]: Fix 64bit support for Sun
+ cc.
- * unix/configure.in: fix detection of symbols build when enabling
- TkAqua debug code; filter nm output of libtclstub better to avoid
- error on intel macs. [Bug 1415789]
* unix/configure: autoconf-2.59
-2006-03-20 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Added exit handler to clean up the interp where
- the console window lives. Also added code to handle multiple calls to
- Tk_CreateConsoleWindow so that the console channels connect to the last
- console window opened, in compatibility with the previous
- implementation.
-
-2006-03-18 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c: Fix for undo/modified status of text widgets when
- empty strings are inserted and undone.
-
-2006-03-17 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/clrpick.tcl: Avoid using abbreviated sub-commands in core
- * library/palette.tcl: scripts as this can cause problems with
- * library/scale.tcl: mega-widget libraries like snit.
- * library/scrlbar.tcl: [Bug 1451587]
- * library/tkfbox.tcl:
- * library/xmfbox.tcl:
-
-2006-03-16 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c: Substantial rewrite of [console] support.
- * generic/tkInt.h: Included Obj-ification of the [console] and
- [consoleinterp] commands, and reworking of all the supporting data
- structures for cleaner sharing and lifetime management especially in
- multi-threaded configurations.
-
-2006-03-16 Donal K. Fellows <dkf@users.sf.net>
-
- * library/msgs/pt.msg: Messages for Portuguese (strictly just for
- Brazilian Portuguese, but they'll do until we get other Portuguese
- speakers localize) from Ricardo Jorge <ricardoj@users.sf.net> and Silas
- Justiano <silasj@users.sf.net>. Many thanks! [Bug 1405069]
-
- * generic/tkImgPhoto.c (ImgPhotoCmd, Tk_PhotoPutBlock)
- (Tk_PhotoPutZoomedBlock): Added hack to detect copying of a photo with
- a simple alpha channel and skip calling ToggleComplexAlphaIfNeeded.
- This should speed up many photo-to-photo copies, keeping the cost of
- the alpha channel down.
-
-2006-03-15 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Try
- to squelch performance issue with code that writes to large images by
- single pixels. Masses of thanks to George Staplin for helping to trace
- this down to the COMPLEX_ALPHA flag handling code. [Bug 1409140]
-
-2006-03-13 Don Porter <dgp@users.sourceforge.net>
-
- * tests/scrollbar.test: Corrected several broken calls to [testmetrics]
- that were crashing the test suite.
-
- * tests/constraints.tcl: Added notAqua constraint to canvPs-3.1
- * tests/canvPs.test: to stop test suite crash on Mac OSX.
- [Bug 1088807]
-
- * generic/tkCmds.c: Purged remaining references to errno,
- * macosx/tkMacOSXPort.h: and errno.h. Standardized the logic
- * macosx/tkMacOSXWm.c: for using header files from the compat
- * macosx/tkMacOSXWm.h: directory. Thanks Joe English for the
- * unix/tkUnixPort.h: patch. [Patch 1445404]
-
-2006-03-08 Don Porter <dgp@users.sourceforge.net>
-
- * unix/Makefile.in: Update `make dist` to copy the image files needed
- by the test suite into the source distro. This was overlooked in the
- 2005-10-12 commit.
-
- * changes: Update in prep. for 8.5a4 release.
-
-2006-03-07 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD, as per the other
- *BSD variants. [Bug 1334613]
- * unix/configure: Regenerated.
-
-2006-03-07 Donal K. Fellows <dkf@users.sf.net>
-
- * doc/canvas.n: Added note that stipples are not well-supported on
- non-X11 platforms. [Bug 220787] It's not a great solution, but it does
- indicate the state of affairs that has existed for years anyway; not
- much modern software uses stipples anyway.
-
-2006-03-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXDraw.c (TkPutImage): Fix endian issue on OS X x86
- displaying images. Bitmap images still have a black/white reversal
- issue, appears to be a general OS X issue (as seen in frogger demo).
-
-2006-02-27 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * generic/tkBitmap.c (Tk_GetBitmapFromData): Improve thread-safety.
- [Bug 470322]
-
- * generic/tkImgBmap.c (ImgBmapConfigureInstance): Force creation of new
- Pixmaps before deletion of old ones to prevent stupid caching problems.
- [Bug 480862]
-
-2006-02-09 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tk.decls: fix signature of TkMacOSXInvalClipRgns
- * generic/tkPlatDecls.h: to use Tk_Window instead of internal
- * macosx/tkMacOSXSubwindows.c: type TkWindow (which led to any include
- * macosx/tkMacOSXWindowEvent.c: of public header tkMacOSX.h requiring
- * macosx/tkMacOSXWm.c: prior include of tkInt.h).
-
- * generic/tk.h: move TkAqua specific REDO_KEYSYM_LOOKUP define
- * macosx/tkMacOSXPort.h: out of tk.h into platform header.
-
-2006-01-31 Donal K. Fellows <dkf@users.sf.net>
-
- * library/bgerror.tcl (::tk::dialog::error::bgerror): Finish the
- internationalization of the error dialog. [Bug 1409264]
-
-2006-01-25 Don Porter <dgp@users.sourceforge.net>
-
- * library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759]
- * library/choosedir.tcl:
- * library/comdlg.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/focus.tcl:
- * library/msgbox.tcl:
- * library/palette.tcl:
- * library/tk.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl:
-
-2006-01-23 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/configure: minor fix to Darwin specific code removing
- * unix/configure.in: 64bit flags from CFLAGS for Tk build.
-
-2006-01-20 Joe English <jenglish@users.sourceforge.net>
-
- * generic/tkEvent.c, unix/tkUnixEvent.c: XIM fixes [See 905830, patch
- tk84-xim-fixes.patch], and revert 2005-12-05 patch disabling XIM when
- SCIM in use, and make sure all X events get passed to XFilterEvent,
- including those without a corresponding Tk window.
-
-2006-01-13 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * generic/tkUndo.c (TkUndoSetDepth): Don't free TkUndoSubAtoms for
- separator entries that are deleted: there is some unpredictable garbage
- instead of subatoms.
-
- Free both 'apply' and 'revert' action chains for non-separator entries.
-
-2006-01-12 Donal K. Fellows <dkf@users.sf.net>
-
- TIP #260 IMPLEMENTATION
-
- * generic/tkCanvText.c (TextItem, CreateText, DisplayCanvText):
- * doc/canvas.n: Code, docs and tests to implement an -underline
- * tests/canvText.test: option for canvases' text items.
-
-2006-01-11 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkGrid.c: Removed a lingering error message from TIP#147
- implementation.
-
-2006-01-10 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDebug.c: add TkMacOSXGetNamedDebugSymbol() function
- * macosx/tkMacOSXDebug.h: that finds unexported symbols in loaded
- libraries by manually walking their symbol table; only to be used for
- debugging purposes, may break unexpectedly in the future. Needed to get
- access to private_extern internal debugging functions in HIToolbox.
-
- * macosx/tkMacOSXCarbonEvents.c: fix debug event tracing on Tiger.
- * macosx/tkMacOSXMenu.c: add debug menu printing during reconfigure.
- * macosx/tkMacOSXInit.c: conditionalize 64bit-unsafe dyld code.
- * macosx/GNUmakefile: add 'wish8.x' symlink to SYMROOT.
-
- * macosx/Wish.xcode/project.pbxproj: fix copy to tktest resource
- * macosx/Wish.xcodeproj/project.pbxproj: fork when zerolinked.
-
- * macosx/Wish.xcode/default.pbxuser: add widget demo as argument to
- * macosx/Wish.xcodeproj/default.pbxuser: executables (on by default).
-
- * unix/configure: add caching, use AC_CACHE_CHECK instead of
- * unix/configure.in: AC_CACHE_VAL where possible, consistent message
- * unix/tcl.m4: quoting, sync relevant tclconfig/tcl.m4 changes
- and gratuitous formatting differences, fix SC_CONFIG_MANPAGES with
- default argument, Darwin improvements to SC_LOAD_*CONFIG.
-
-2005-12-28 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkUndo.c (TkUndoSetDepth): Apply [Patch 1391939] from Ludwig
- Callewaert to fix [Bug 1380427].
-
-2005-12-14 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.xcodeproj/project.pbxproj: add new tclTomMath* files.
-
-2005-12-13 Daniel Steffen <das@users.sourceforge.net>
-
- * library/demos/cscroll.tcl: add MouseWheel bindings for aqua.
-
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent)
- (GenerateMouseWheelEvent): add support for kEventMouseScroll events
- (smooth mouse wheel scrolling from mighty mouse or scrolling trackpad)
- by handling kEventMouseWheelMoved on application target as well as on
- dispatcher, in order to pick up synthesized MouseWheel events from
- HIObject handler (c.f. QA1453); add support for horizontal scrolling
- events by generating MouseWheel XEvent with Shift modifier.
-
-2005-12-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tcl.m4, unix/configure: Fix sh quoting error reported in
- bash-3.1+ [Bug 1377619] (schafer)
-
-2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinWm.c (WinSetIcon): Don't check result of SetClassLong() or
- SetClassLongPtr() since it was generating an incorrect error and the
- MSDN docs indicate that the result need not be checked.
-
-2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/configure: Regen.
- * win/tcl.m4 (SC_CONFIG_CFLAGS): Define MACHINE for gcc builds. The
- lack of a definition of this variable in the manifest file was causing
- a runtime error in wish built with gcc.
-
-2005-12-09 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkInt.decls: Move all platform test sources from tk lib into
- * generic/tkTest.c: tktest directly, removes requirement to export
- * macosx/tkMacOSXTest.c:TkplatformtestInit from internal stubs table.
- * unix/Makefile.in:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/tkWinTest.c:
-
- * generic/tkIntPlatDecls.h:
- * generic/tkStubInit.c: regen.
-
-2005-12-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tcl.m4: Add build support for Windows-x64 builds.
- * win/configure: --enable-64bit now accepts =amd64|ia64 for
- * win/Makefile.in: Windows 64-bit build variants (default: amd64)
- * win/makefile.vc: [Bug 1369597]
- (TKOBJS): add tkWinTest.obj to regular Tk obj for TkplatformtestInit
-
- * win/configure.in: Add CE build support (some C code fixes needed)
- * win/wish.exe.manifest.in (new): manifest must map in MACHINE and
- * win/rc/wish.exe.manifest (removed): VERSION to be correct.
- * unix/Makefile.in: fix dist target for manifest dir change
-
- * generic/tkTextTag.c (TkTextTagCmd): use correct arraySize for peered
- text widgets in [$text tag names]. [Bugs 1375069, 1374935]
-
-2005-12-08 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDraw.c: Remove inclusion of tclInt.h and use of tcl
- * macosx/tkMacOSXFont.c: internals wherever possible in tk/macosx, the
- * macosx/tkMacOSXInit.c: only remaining tcl internals in TkAqua are
- * macosx/tkMacOSXNotify.c:TclServiceIdle() in tkMacOSXScrlbr.c and
- * macosx/tkMacOSXScrlbr.c:Tcl_Get/SetStartupScript() in tkMacOSXInit.c
- [RFE 1336531]
-
- * macosx/tkMacOSXInt.h: sync comments with core-8-4-branch.
-
-2005-12-07 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixEvent.c (OpenIM): remove extraneous const
-
-2005-12-06 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * doc/ConfigWidg.3 (TK_CONFIG_OPTION_SPECIFIED): Mentioned that the
- flag is deprecated because it is not thread-safe.
-
-2005-12-05 Reinhard Max <max@suse.de>
-
- * unix/tkUnixEvent.c (OpenIM): Added a workaround to allow at least
- ASCII and the Compose key when typing into text and entry widgets on a
- system that uses SCIM. This has to be taken out again once the SCIM
- problems have been fixed.
-
-2005-12-01 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
- * unix/configure: regen.
-
-2005-11-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect before
- rewrapping. [Bug 1086049]
-
- * macosx/tkMacOSXXStubs.c (TkpOpenDisplay, TkMacOSXDisplayChanged):
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent):
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
- * macosx/tkMacOSXEvent.h: Trap kEventAppAvailableWindowBoundsChanged
- * macosx/tkMacOSXInt.h: event to watch for change in display size and
- adjust internal state appropriately.
-
- * doc/checkbutton.n: fix -selectcolor docs. [Bug 1083838]
-
- * generic/tkImgGIF.c: cast calls to blockOut
-
- * win/Makefile.in: place TCL_BIN_DIR first in PATH for targets to get
- Tcl built dll first.
- Add tkWinTest.obj to tk84.dll to handle some needed test functions
- being defined in stubs (TkplatformtestInit).
-
- * tests/scrollbar.test (6.22): fix rounding-error sensitive test
-
-2005-11-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/console.tcl (::tk::ConsoleInit): improve work-around to avoid
- '% ' from tclMain.c. [Bug 1252259]
-
-2005-11-27 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
- add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to
- configure (flag can't be present twice, so can't be in both CFLAGS and
- LDFLAGS during configure), don't use -prebind when deploying on 10.4,
- define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542).
- (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete
- autoconf macros. Sync with tcl/unix/tcl.m4.
-
- * unix/configure.in: fix obsolete autoconf macros, sync gratuitous
- formatting/ordering differences with tcl/unix/configure.in.
-
- * unix/Makefile.in: add CFLAGS to wish/tktest link to make executable
- linking the same as during configure (needed to avoid loosing any
- linker relevant flags in CFLAGS, in particular flags that can't be in
- LDFLAGS). Avoid concurrent linking of wish and compiling of
- tkTestInit.o during parallel make, fix dependencies and flags for
- building tkMacOSXInit.o
- (checkstubs, checkexports): dependency and Darwin fixes
- (dist): add new macosx files.
-
- * macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent):
- * macosx/tkMacOSXEvent.h:
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
- * macosx/tkMacOSXCarbonEvents.c: install standard application event
- handler, add & call functions to start and stop carbon even timer that
- runs the tcl event loop periodically during a nested carbon event loop
- in the toolbox (e.g. during menutracking) to ensure tcl timers etc.
- continue to fire, register app event handler for menu tracking and HI
- command carbon events, move menu event handling to new handlers for
- those carbon events, no longer register for/handle appleevent carbon
- event (now dealt with by standard application event handler), event
- debugging code dynamically acquires carbon event debugging functions to
- allow use on Tiger where they are no longer exported from HIToolbox.
-
- * macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText):
- * macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout):
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXInt.h: abstract common code to dynamically acquire
- address of a named symbol (from a loaded dynamic library) into new
- function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol.
-
- * macosx/tkMacOSXMenu.c (TkpNewMenu):
- * macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
- * macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to modern
- utf-8 aware menu manager API, remove obsolete code, add error handling.
-
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants
- if necessary to allow compilation on OSX 10.2
-
- * macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
- executed.
-
- * xlib/xgc.c (XCreateGC): sync with core-8-4-branch change.
-
- * generic/tk.h: add/correct location of version numbers in macosx files
-
- * generic/tkInt.h: clarify fat compile comment.
-
- * macosx/Wish.pbproj/default.pbxuser (new):
- * macosx/Wish.pbproj/jingham.pbxuser:
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Wish.xcode/default.pbxuser:
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.xcodeproj/default.pbxuser (new):
- * macosx/Wish.xcodeproj/project.pbxproj (new): new/updated projects for
- Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with
- native tktest targets and support for universal (fat) compiles.
-
- * macosx/Tk-Info.plist (removed):
- * macosx/Wish-Info.plist (removed):
- * macosx/buildTkConfig.tcl (removed): remove obsolete build files.
-
- * macosx/README: clarification/cleanup, document new Xcode projects and
- universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).
-
- * unix/Makefile.in:
- * unix/aclocal.m4:
- * unix/configure.in:
- * macosx/configure.ac (new): add support for inclusion of
- unix/configure.in by macosx/configure.ac, allows generation of a
- config headers enabled configure script in macosx (required by Xcode
- projects).
-
- * macosx/GNUmakefile: rename from Makefile to avoid overwriting by
- configure run in tk/macosx, add support for reusing configure cache,
- build target fixes.
-
- * generic/tk3d.h:
- * generic/tkButton.h:
- * generic/tkCanvas.c:
- * generic/tkCanvas.h:
- * generic/tkColor.h:
- * generic/tkEntry.h:
- * generic/tkFileFilter.h:
- * generic/tkFont.c:
- * generic/tkFont.h:
- * generic/tkImage.c:
- * generic/tkImgPhoto.c:
- * generic/tkInt.h:
- * generic/tkMenu.c:
- * generic/tkMenu.h:
- * generic/tkMenubutton.h:
- * generic/tkScale.h:
- * generic/tkScrollbar.h:
- * generic/tkSelect.h:
- * generic/tkStubInit.c:
- * generic/tkStubLib.c:
- * generic/tkText.h:
- * generic/tkUndo.h:
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDebug.h:
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXSend.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c:
- * unix/tkUnixButton.c:
- * unix/tkUnixMenu.c:
- * xlib/xgc.c: ensure externally visible symbols not contained in stubs
- table are declared as MODULE_SCOPE (or as static if not used outside of
- own source file), #ifdef out a few Xlib and aqua functions that are
- never called. These changes allow 'make checkstubs' to complete without
- error on Darwin with gcc 4.
-
- * macosx/tkMacOSXTest.c:
- * macosx/tkMacOSXPort.h:
- * win/tkWinTest.c:
- * generic/tkInt.decls: add functions needed by tktest to internal stubs
- table, correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua
- Xlib stubs.
+2008-03-27 Daniel Steffen <das@users.sourceforge.net>
- * unix/tkUnixSend.c:
- * generic/tkText.c:
- * generic/tkTest.c: #ifdef unix only declarations.
- (TestmetricsCmd): unify win and mac implementation.
- (TestsendCmd): move to tkUnixSend.c to avoid access to global var.
- (TesttextCmd): move to tkText.c to avoid having to put all the internal
- text functions it uses into the stubs table.
+ * generic/ttk/ttkStubLib.c: Ensure tcl stubs are used in libtkstub
+ even in a static build of Tk.
+ * generic/ttk/ttkDecls.h: Fix incorrect number of arguments in
+ Ttk_InitStubs macro definition.
- * generic/tkTextDisp.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.
+2008-03-26 Don Porter <dgp@users.sourceforge.net>
- * macosx/tkMacOSXNotify.c:
- * macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.
+ * changes: Updates for 8.5.2 release.
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntXlibDecls.h:
- * generic/tkStubInit.c:
- * unix/configure:
- * unix/tkConfig.h.in: regen.
+ * unix/tkUnixCursor.c: [Bug 1922466]: Stop crash in [. configure
+ -cursor] on X11. Thanks to emiliano gavilan.
-2005-11-22 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-03-26 Joe English <jenglish@users.sourceforge.net>
- * library/tkfbox.tcl: Remove all references to data(curItem), as it is
- no longer used. [Bug 600313]
- (::tk::IconList_CurSelection): Renamed for clarity.
+ * generic/tkInt.h, generic/tkEvent.c, unix/tkUnixEvent.c,
+ * unix/tkUnixKey.c: XIM reorganization and cleanup; see
+ [Patch 1919791] for details.
- * doc/GetFont.3: Revert previous fix; a NULL interp is now legal.
- * generic/tkFont.c (ParseFontNameObj, GetAttributeInfoObj): Allow these
- functions to work with a NULL interp by making them check when
- generating error messages. [Bug 1151523]
+2008-03-21 Joe English <jenglish@users.sourceforge.net>
- * library/tkfbox.tcl (::tk::dialog::file::): Correct the quoting of the
- script used in variable traces so that widget names with spaces in will
- work. [Bug 1335485]
+ * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in:
+ [Bug 1920030]: Keep ttkStubLib.o in libtkstub instead of libtk.
-2005-11-16 Vince Darley <vincentdarley@users.sourceforge.net>
+2008-03-20 Donal K. Fellows <dkf@users.sf.net>
- * doc/text.n: clarify left to right interpretation of index modifiers,
- including the fact that validation occurs after each step. [Bug
- 1357575]
+ * tests/wm.test: Rewrote so that tests clean up after themselves
+ rather than leaving that to the following test. Makes it easier to
+ catch problems where they originate. Inspired by [Bug 1852338]
-2005-11-15 Joe English <jenglish@users.sourceforge.net>
+2008-03-19 Donal K. Fellows <dkf@users.sf.net>
- * unix/tkUnixWm.c, tests/unixWm.test, doc/wm.n: Support for [wm
- attributes] on X11. [TIP#231, Patch 1062022]
+ * doc/GetClrmap.3: [Bug 220809]: Documented Tk_PreserveColormap.
-2005-11-14 Joe English <jenglish@users.sourceforge.net>
+2008-03-17 Joe English <jenglish@users.sourceforge.net>
- * library/bgerror.tcl: Truncate error messages at 45 characters
- instead of 30. [Bug 1224235]
+ * unix/Makefile.in, win/Makefile.in, win/makefile.vc: [Bug 1863007]:
+ Put ttkStubLib.o in libtkstub instead of libtk.
-2005-11-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-03-16 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkSelect.c (TkSelDefaultSelection): Test select-9.5
- highlighted further brokenness in this function.
+ * library/demos/goldberg.tcl: [Bug 1899664]: Made work when run twice
+ in the same session. Also made the control panel use Ttk widgets.
-2005-11-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-03-13 Daniel Steffen <das@users.sourceforge.net>
- * unix/tkUnixSelect.c (SelCvtToX): Arrange for the parsing code to use
- Tcl's list parsing code, another simplification that enables testing
- of the [Bug 1353414] fix.
+ * unix/configure.in: [Bug 1913622]: Use backslash-quoting instead of
+ * unix/tcl.m4: double-quoting for lib paths in tkConfig.sh.
+ * unix/configure: autoconf-2.59
- * unix/tkUnixSelect.c (SelCvtFromX): Generate string forms of the
- advanced selection types in a Tcl_DString. This makes fixing [Bug
- 1353414] trivial, and simplifies the code at the same time.
- * tests/select.test (select-9.5): Added test for [Bug 1353414]
+2008-03-13 Don Porter <dgp@users.sourceforge.net>
-2005-11-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * changes: Updates for 8.5.2 release.
- * generic/tkBind.c (ChangeScreen): More DString fixes from
- * generic/tkTextWind.c (EmbWinLayoutProc): [Bug 1353022]
- * win/tkWinMenu.c (SetDefaults):
+2008-03-12 Daniel Steffen <das@users.sourceforge.net>
- * win/tkWinDialog.c (ConvertExternalFilename): Factored out the
- encoding conversion and de-backslash-ing code that is used in many
- places in this file.
- (GetFileNameW, GetFileNameA, ChooseDirectoryValidateProc): Make sure
- that data is freed correctly and that certain (hopefully impossible)
- failure modes won't cause crashes. [Bug 1353022]
+ * macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1
+ * macosx/Wish.xcodeproj/default.pbxuser: CODE_SIGN_IDENTITY and
+ * macosx/Wish-Common.xcconfig: 'xcodebuild install'.
-2005-11-06 Pat Thoyts <pat@zsplat.freeserve.co.uk>
+2008-03-12 Joe English <jenglish@users.sourceforge.net>
- * unix/tcl.m4: Fix SHLIB_LD_LIBS for building tclkit on OpenBSD.
- * unix/configure: regenerated
+ * unix/tkUnixRFont.c: Try a fallback font if XftFontOpenPattern()
+ fails in GetFont (workaround for [Bug 1090382]).
-2005-10-31 Vince Darley <vincentdarley@users.sourceforge.net>
+2008-03-11 Daniel Steffen <das@users.sourceforge.net>
- * generic/tkText.c
- * tests/textDisp.test: fix and test for [Bug 1333951] in '.text count
- -displaylines'.
+ * library/demos/knightstour.tcl: Aqua GOOBE.
+ * library/demos/widget:
-2005-10-18 Don Porter <dgp@users.sourceforge.net>
+ * macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1 and
+ * macosx/Wish.xcodeproj/default.pbxuser: configs for building with
+ * macosx/Wish-Common.xcconfig: gcc-4.2 and llvm-gcc-4.2.
- * generic/tkMain.c: Rewrote code that sets the ::argv value to be sure
- conversion from the system encoding is complete before any processing
- sensitive to list-special characters is done. [Bug 1328926]
+ * generic/tkCanvUtil.c: Fix gcc-4.2 warnings.
-2005-10-17 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/GNUmakefile: Fix quoting to allow paths to
+ * macosx/Wish-Common.xcconfig: ${builddir}, ${INSTALL_ROOT}
+ * unix/Makefile.in: and ${TCL_BIN_DIR} to contain
+ * unix/configure.in: spaces.
+ * unix/install-sh:
+ * unix/tcl.m4:
- * macosx/tkMacOSXScrlbr.c (UpdateControlValues): check geomMgrPtr is
- valid before checking type
+ * unix/configure: autoconf-2.59
-2005-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+ * unix/Makefile.in (install-strip): Strip non-global symbols from
+ dynamic library.
- * library/menu.tcl (::tk::MenuUnpost): remove leftover ] from string
- equal mods of 2005-07-25. (sowadsky)
+2008-03-10 Don Porter <dgp@users.sourceforge.net>
-2005-10-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * changes: Updates for 8.5.2 release.
- * win/tkWinSend.c: Avoid using tcl internal headers and fix to
- * win/tkWinSendCom.h: correctly link on all types of build (was
- * win/tkWinSendCom.c: broken in static,msvcrt builds).
+2008-03-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-2005-10-12 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * doc/colors.n: Reworked to produce nicer HTML output.
- * tests/canvPs.test, tests/canvPsBmap.tcl, tests/canvPsImg.tcl:
- * tests/imgPhoto.test, tests/menu.test: Arrange for the test suite to
- only ever refer to images in the same directory as the tests. This
- makes it possible to package the test suite itself as a starkit. Thanks
- to David Zolli for suggesting this.
+2008-03-06 Joe English <jenglish@users.sourceforge.net>
-2005-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+ * doc/ttk_notebook.n: [Bug 1882011]: Move "TAB IDENTIFIERS" section
+ above "WIDGET COMMAND" section.
- * generic/tkConfig.c (Tk_DeleteOptionTable, Tk_CreateOptionTable):
- properly alloc/delete one more option. [Bug 1319720] (melbardis)
+2008-02-29 Pat Thoyts <patthoyts@users.sourceforge.net>
- * macosx/tkMacOSXInt.h: Move MODULE_SCOPE defn to tkInt.h and add
- * generic/tkInt.h: WORDS_BIGENDIAN checks that will work with OS X
- universal binary compiles. (steffen)
+ * library/demos/widget: Added a Knight's tour canvas demo.
+ * library/demos/knightstour.tcl:
- * generic/tkMenu.c (TkSetWindowMenuBar): do not call TkMenuInit if the
- winPtr indicates TK_ALREADY_DEAD. This prevents reinit that creates a
- Tk exit handler after all exit handlers should be called. [Bug 749908,
- 1322294]
+2008-02-27 Daniel Steffen <das@users.sourceforge.net>
-2005-10-10 Vince Darley <vincentdarley@users.sourceforge.net>
+ * macosx/tkMacOSXDraw.c: Workaround leak in Carbon SetPortPenPixPat()
+ API [Bug 1863346]; avoid repeated PixPat allocation/deallocation.
- TIP #256 IMPLEMENTATION
+2008-02-23 Joe English <jenglish@users.sourceforge.net>
- * doc/text.n
- * 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
- * macosx/tkMacOSXDefault.h
- * tests/text.test
- * tests/textDisp.test
- * unix/tkUnixDefault.h
- * win/tkWinDefault.h: Implementation of TIP#256, adding a new text
- widget configuration option '-tabstyle', with new tests and
+ * library/ttk/combobox.tcl, doc/ttk_combobox.n,
+ * tests/ttk/combobox.test: Arrange to deliver <<ComboboxSelected>>
+ event after listbox is unposted, as intended [Bug 1890211]. Clarified
documentation.
- Also a fix for [Bug 1281228] (documentation and full implementation of
- -strictlimits), and [Bug 1288677] (corrected elide behaviour), again
- with more tests.
-
-2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/dialog.tcl (::tk_dialog): add tkwait visibility before grab.
- [Bug 1216775]
-
- * win/tkWinDialog.c (ChooseDirectoryValidateProc): reset stored path to
- "" if it doesn't exist and -mustexist is true. [Bug 1309218] Remove
- old-style dir chooser (no longer used).
-
- * macosx/tkMacOSXInt.h: add MODULE_SCOPE definition check for extension
- writers that access private headers on OS X and don't define it in
- configure.
-
-2005-09-28 Don Porter <dgp@users.sourceforge.net>
-
- * unix/tkUnixPort.h: Disabled inclusion of the private Tcl header
- * win/tkWinPort.h: file tclInt.h. Tk ought to have a tiny and
- shrinking number of calls of private Tcl routines. Each Tk source file
- doing this should follow the convention in the macosx port and have its
- own #include "tclInt.h".
-
- * generic/tkEvent.c: Disabled calls to private Tcl routine
- TclInExit(). See comment in TkCreateExitHandler() for full rationale.
-
-2005-09-21 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * generic/tkEvent.c (TkCreateThreadExitHandler, TkFinalizeThread)
- (TkDeleteThreadExitHandler): New internal API (from Joe Mistachkin) to
- allow Tk to finalize itself correctly in a multi-threaded
- environment. [Bug 749908]
-
-2005-09-14 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkOldConfig.c (GetCachedSpecs): Split out the code to
- manipulate the cached writable specs so that it can be reused from all
- the public Tk_Configure* functions.
- (Tk_ConfigureInfo, Tk_ConfigureWidget, Tk_ConfigureValue): Use the
- factored out code everywhere, so we always manipulate the cache
- correctly. [Bug 1288128]
-
-2005-09-13 Don Porter <dgp@users.sourceforge.net>
-
- * win/winMain.c (WishPanic): Replaced TCL_VARARGS* macros with direct
- use of stdarg.h conventions.
-
-2005-09-11 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): check if
- process is in front on MouseDown, otherwise request process activation
- from BringWindowForward() via new isFrontProcess param.
-
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents): register
- our event handler on the dispatcher target for all carbon events of
- interest to TkAqua; this replaces event processing directly from the
- event queue and thus allows to capture events that are syntesized by
- Carbon and sent directly to the dispatcher and not to the event queue.
-
- * macosx/tkMacOSXEvent.c: remove TkMacOSXCountAndProcessMacEvents(),
- rename ReceiveAndProcessEvent() to TkMacOSXReceiveAndProcessEvent().
- (TkMacOSXReceiveAndProcessEvent): remove tk event processing before
- sending events to the dispatcher, all events of interest are now
- processed in our dispatcher target event handler.
-
- * macosx/tkMacOSXNotify.c (CarbonEventsCheckProc): dispatch events
- directly via TkMacOSXReceiveAndProcessEvent(), but dispatch no more
- than four carbon events at one time to avoid starving other event
- sources.
-
- * macosx/tkMacOSXEvent.c: formatting cleanup, move XSync() to XStubs,
- * macosx/tkMacOSXEvent.h: removed obsolete kEventClassWish handling.
- * macosx/tkMacOSXXStubs.c
-
- * macosx/tkMacOSXEvent.h: declare macosx internal procs as MODULE_SCOPE
- * macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXWindowEvent.c:
-
- * macosx/tkMacOSXButton.c: conditionalize all debug message printing to
- * macosx/tkMacOSXCursor.c: stderr via TK_MAC_DEBUG define.
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDebug.h:
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXEvent.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
-
- * unix/configure.in: define TK_MAC_DEBUG on aqua when symbols enabled.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
- * library/listbox.tcl: synced aqua MouseWheel bindings with
- * library/scrlbar.tcl: core-8-4-branch.
- * library/text.tcl:
-
- * xlib/xcolors.c: fixed warning
-
-2005-08-25 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in (html): reverted/amended changes of 2005-08-23 that
- broke TkAqua 'make install'; added BUILD_HTML_FLAGS optional var like
- in tcl/unix/Makefile.in.
-
-2005-08-24 Donal K. Fellows <dkf@users.sf.net>
-
- * tests/text.test (text-8.18): Fix punctuation of error message to
- match good practice (actual message already fixed). [Bug 1267484]
-
-2005-08-23 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXDialog.c: make dialogs ignore -initialfile "" and
- -initialdir "" instead of error.
-
-2005-08-23 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWin32Dll.c (DllMain): Replace old asm SEH approach with Kenny's
- new SEH implementation. [Tcl Bug 1235544]
-
-2005-08-23 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Subst BUILD_TCLSH and TCL_EXE.
- * unix/configure: Regen.
- * unix/configure.in: Update minimum autoconf version to 2.59. Invoke
- SC_PROG_TCLSH and SC_BUILD_TCLSH.
- * unix/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH):
- * win/Makefile.in: Subst BUILD_TCLSH and TCL_EXE.
- * win/configure: Regen.
- * win/configure.in: Update minimum autoconf version to 2.59. Invoke
- SC_BUILD_TCLSH.
- * win/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH): Split confused search
- for tclsh on PATH and build and install locations into two macros.
- SC_PROG_TCLSH searches just the PATH. SC_BUILD_TCLSH determines the
- name of the tclsh executable in the Tcl build directory. [Tcl Bug
- 1160114] [Tcl Patch 1244153]
-
-2005-08-22 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXDialog.c: fix warnings.
-
-2005-08-20 Joe Mistachkin <joe@mistachkin.com>
-
- * win/tkWinX.c: Fixed bad cast. [Bug 1216006]
-
-2005-08-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * doc/GetFont.3: Reworded to reflect the truth. [Bug 1151523]
-
-2005-08-16 George Peter Staplin <GeorgePS@XMission.com>
-
- * doc/CrtItemType.3 prototypes were lacking [] after objv. Thus the man
- page was wrong about the actual prototypes. This was verified by
- studying tkCanvBmap.c.
-
-2005-08-13 Chengye Mao <chengye.geo@yahoo.com>
-
- * generic/tkOldConfig.c: Fixed [Bug 1258604]. This bug was introduced
- into the modfied Tk_ConfigureWidget. It failed to properly handle the
- specFlags' bit TK_CONFIG_OPTION_SPECIFIED.
-
-2005-08-12 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * generic/tkOldConfig.c (Tk_ConfigureWidget): Stop storing per-thread
- data in global data structures. Store it in per-interpreter data (i.e.
- per-thread data) instead. [Bug 749908]
-
-2005-08-10 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkFrame.c (CreateFrame) and others: Don't use size_t when
- working with Tcl_GetStringFromObj because it is not 64-bit clean. [Bug
- 1252702]
-
-2005-08-04 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * doc/text.n: Clarify behaviour of tab stops (as per [Bug 1247835])
-
-2005-08-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXCarbonEvents.c (AppEventHandlerProc): handle carbon
- events sent directly to application event target via the general
- TkMacOSXProcessEvent() in the same way as events posted to the event
- loop. Moved existing app event handlers to tkMacOSXWindowEvent.c.
- (TkMacOSXInitCarbonEvents): register our application event handler for
- kEventWindowExpanded events to deal with uncollapsing from the dock.
-
- * macosx/tkMacOSXEvent.h: made TkMacOSXProcessEvent() non-static, added
- * macosx/tkMacOSXEvent.c: new interp field to TkMacOSXEvent struct for
- use by app event handler.
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): retrieve
- current window, partCode, modifiers and local cursor position from
- carbon mouse event if possible. Use new static GenerateButtonEvent()
- taking a MouseEventData struct instead of TkGenerateButtonEvent() to
- avoid recomputing already known values. Move process activation on
- MouseDown into BringWindowForward() to allow clicking on window
- titlebar widgets without activating process. Move code dealing with
- clicks in window titelbar into separate function
- HandleWindowTitlebarMouseDown() to avoid code duplication. Avoid
- repeated calls to TkMacOSXGetXWindow() by storing result in
- MouseEventData struct.
- (TkMacOSXButtonKeyState, XQueryPointer): try to get button and modifier
- state from currently processed carbon event (to avoid unnecessary IPC
- with the window server), otherwise use modern carbon API to get this
- info instead of Button() and GetKeys(); only retrieve info caller asks
- for (via non-NULL ptr passed to XQueryPointer).
- (ButtonModifiers2State): new static function converting carbon button
- and modifier state into tk state, allows detection of more than 3 mouse
- buttons (tk supports up to 5) and of NumLock and Fn modifier keys
- (NumLock is mapped to Mod3 and Fn to Mod4).
-
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent):
- handle kEventWindowExpanded event to deal with window uncollapsing from
- the dock by generating tk Map event, handle kEventAppHidden and
- kEventAppShown events (moved here from tkMacOSXCarbonEvents.c).
-
- * macosx/tkMacOSXSubwindows.c (XUnmapWindow): only hide window when it
- is not iconified to avoid window flashing on collapse.
-
- * macosx/tkMacOSXWm.c: replaced Tk_DoWhenIdle() by Tcl_DoWhenIdle().
- (TkMacOSXZoomToplevel): remove call to TrackBox(), now done in
- HandleWindowTitlebarMouseDown() in tkMacOSXMouseEvent.c.
- (TkpWmSetState): avoid window flashing on collapse by unmapping after
- calling CollapseWindow(); only uncollapse window if it is collapsed.
-
- * generic/tkInt.decls: changed TkMacOSXZoomToplevel() signature.
- * generic/tkIntPlatDecls.h:
-
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only call
- GetMenuItemCommandID() on KeyDown or KeyRepeat events.
-
- * macosx/tkMacOSXMenu.c (ReconfigureMacintoshMenu): remove call to
- obsolete AppendResMenu() API.
-
- * macosx/tkMacOSXKeyEvent.c: replaced all direct uses of expensive
- * macosx/tkMacOSXMenu.c: GetMouse() and TkMacOSXButtonKeyState()
- * macosx/tkMacOSXMenus.c: APIs by calls to XQueryPointer()
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXScrlbr.c:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXDialog.c: replaced use of FrontNonFloatingWindow()
- * macosx/tkMacOSXKeyEvent.c: by ActiveNonFloatingWindow() as
- * macosx/tkMacOSXMenu.c: recommended by Carbon docs.
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXSubwindows.c:
- * macosx/tkMacOSXWm.c:
-
- * macosx/tkMacOSXDialog.c: fixed warnings
- * macosx/tkMacOSXTest.c:
-
- * macosx/tkMacOSXCarbonEvents.c: added CVS Id line to file header.
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDebug.h:
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXEvent.h:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.h:
-
- * macosx/tkMacOSXInt.h: declare macosx internal procs as MODULE_SCOPE.
- * macosx/tkMacOSXCarbonEvents.c:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXHLEvents.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXWindowEvent.c
-
- * library/bgerror.tcl: sync with core-8-4-branch changes of 2005-07-28.
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXMouseEvent.c:
-
- * generic/tkFrame.c: sync with core-8-4-branch changes of 2005-07-27.
- * generic/tkIntDecls.h:
- * generic/tkStubInit.c:
- * generic/tkFrame.c:
- * win/tkWinDraw.c:
- * unix/tkUnixDraw.c:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXSubwindows.c:
-
- * macosx/tkMacOSXButton.c: sync with core-8-4-branch.
- * macosx/tkMacOSXEntry.c:
- * macosx/tkMacOSXScale.c:
-
- * library/demos/menu.tcl: removed errant '}'.
-
-2005-08-04 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * doc/clipboard.n: Add example demonstrating custom types of clipboard
- data.
-
-2005-07-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * library/*.tcl: Updated to use more 8.4 and 8.5 features as part of
- resolving [Patch 1237759].
-
-2005-07-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinX.c: Define _WIN32_WINNT with NT SP 3 data to fix compiler
- error because SendInput was not defined. The new msys_mingw7 release is
- now needed to compile the HEAD with mingw gcc. [Bug 1210712]
-
-2005-07-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): corrected if
- expression error (use of = instead of ==).
-
-2005-07-18 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkTextMark.c: fix to segfault in "mark prev"
- * tests/textIndex.test: [Bug 1240221]
-
- * tests/textWind.test: make test more robust to avoid infinite loop
-
-2005-07-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/getOpenFile.n: correct -multiple docs (takes boolean)
-
-2005-07-05 Don Porter <dgp@users.sourceforge.net>
-
- * unix/Makefile.in: Purged use of TCLTESTARGS. [RFE 1161550]
-
-2005-06-23 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkConsole.c (TkConsolePrint): prevent potential NULL deref.
-
- * macosx/tkMacOSXDefault.h: change ENTRY_BORDER defaults to from 5 to 2
- to make default entry widgets in TkAqua look like in other aqua apps
- (and have same border dimensions as other platforms). [Bug 1176610]
-
-2005-06-21 Donal K. Fellows <dkf@users.sf.net>
-
- * doc/GetBitmap.3: Fix silly error in SYNOPSIS. [Bug 1224983]
-
-2005-06-19 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkImgGIF.c: Cleanse all static (i.e. non-thread-safe) data
- at a miniscule performance hit.
-
-2005-06-18 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Makefile: for X11 build, add -X11 suffix to unversioned wish
- symbolic link.
-
- * unix/tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to
- ensure we can always relocate binaries with install_name_tool.
-
- * unix/configure: autoconf-2.59
-
-2005-06-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- Bump patchlevel to a4 to distinguish from a3 release.
-
-2005-06-04 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.5a3 TAGGED FOR RELEASE ***
-
-2005-06-02 Jim Ingham <jingham@apple.com>
-
- * generic/tkEvent.c (InvokeFocusHandlers): On Mac OS X the scrollwheel
- events are sent to the window under the mouse, not to the focus window
-
- Another patch from M. Kirkham.
-
- * macosx/tkMacOSXScrlbr.c (ThumbActionProc, ScrollBarBindProc): Record
- the first mouse down point, and compute differences from that, rather
- than getting the mouse down each time through the loop. The old method
- would get fooled if you moved the mouse less than a text line height in
- the text widget. [Bug 1083728]
-
-2005-06-03 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Makefile: fixed 'embedded' target.
-
-2005-06-02 Reinhard Max <max@suse.de>
-
- * unix/tkUnix.c (Tk_GetUserInactiveTime): Improvements to get it
- working on Solaris, and panic if we run out of memory.
- * unix/configure.in: Rework the searching for Xss, to make it work on
- Solaris and provide more useful output. Use AC_HELP_STRING where
- appropriate.
- * unix/tcl.m4: synced from Tcl.
- * unix/configure: regenerated with autoconf 2.59.
-
-2005-06-01 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinInt.h: added private decls of Tk_GetEmbeddedMenuHWND,
- Tk_GetMenuHWND, TkWinCleanupContainerList, and TkpWmGetState to that
- are used across source files.
-
- * win/tkWinX.c (Tk_ResetUserInactiveTime): cast to squelch compiler
- warning.
-
-2005-05-31 Reinhard Max <max@suse.de>
-
- * doc/Inactive.3 (new file): C level API documentationn for
- TIP#245 (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime).
- * tests/tk.test: Added tests for the TIP#245 implementation.
-
-2005-05-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkPanedWindow.c, tests/panedwindow.test: batch of fixes to
- panedwindow from Daniel South. Improved auto-size to fit internal
- windows, fixed sash placement at edge of pane, fixed calculation of
- stretch amount for internal windows. [Bug 1124198, 1161543, 1054117,
- 1010941, 795869, 690169, 1192323]
-
- * generic/tkMenu.c (MenuCmd): create event handler earlier to ensure
- proper destruction of menu through DestroyNotify. [Bug 1159367]
-
- * library/console.tcl (::tk::ConsoleInit): print out first prompt and
- swallow the extra "% " that comes once from Tcl on Windows.
-
-2005-05-29 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXFont.c: use Tcl_Panic instead of panic.
-
- * unix/configure.in: added description of HAVE_XSS for autoheader.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in: autoheader-2.59
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Wish.xcode/project.pbxproj: added missing FRAMEWORK defines
- introduced with configure/make based build.
-
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXNotify.c: fixed warnings.
-
- * generic/tkDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkStubInit.c: ran missing 'make genstubs' for TIP245 changes
- to tk.decls
-
- * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use symbolic
- constant argument in call to UpdateSystemActivity();
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Wish.xcode/project.pbxproj:
- * unix/configure.in: added/corrected linking to IOKit.framework for
- TIP245.
-
- * unix/configure.in: skip X11 configure checks when building tk_aqua.
- * unix/configure: autoconf-2.59
-
-2005-05-28 Donal K. Fellows <dkf@users.sf.net>
-
- TIP #245 IMPLEMENTATION from Reinhard Max <max@suse.de>
-
- * doc/tk.n: Documentation of [tk inactivity].
- * win/tkWinX.c (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime):
- * unix/tkUnix.c (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime):
- * macosx/tkMacOSXXStubs.c: Implementations of the core API for
- (Tk_GetUserInactiveTime): determining how long as user's left
- (Tk_ResetUserInactiveTime): her machine alone.
- * unix/configure.in: Test for XScreenSaver support.
- * generic/tkCmds.c (Tk_TkObjCmd): Implementation of [tk inactivity].
-
-2005-05-27 Todd Helfter <tmh@users.sourceforge.net>
-
- * library/menu.tcl: correct the sticky behavior of menus posted by
- tk_popup so that they "stick" after the initial <ButtonRelease>
- following the post, that is not over an active menu entry.
-
-2005-05-26 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXInit.c (TkpInit): fixed resource file extraction from
- __tk_rsrc section to work with non-prebound .dylib and .bundle.
-
- * macosx/Makefile: corrected EMBEDDED_BUILD check, use separate Tcl and
- Tk version vars to properly support tk/x11 framework version
- overriding, rewrite tkConfig.sh when overriding tk version, corrected
- Wish.app symlink in tk build dir.
+2008-02-23 Joe English <jenglish@users.sourceforge.net>
- * unix/configure.in: corrected framework finalization to softlink stub
- library to Versions/8.x subdir instead of Versions/Current.
- * unix/configure: autoconf-2.59
+ * generic/ttk/ttkPanedWindow.c: [FRQ 1898288]: Don't enforce minimum
+ sash thickness of 5 pixels, just use 5 as a default.
-2005-05-25 Jeff Hobbs <jeffh@ActiveState.com>
+2008-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * unix/Makefile.in (install-libraries): protect possible empty list in
- for with list= trick for older shells.
+ * unix/README: Documented missing configure flags.
-2005-05-23 Jeff Hobbs <jeffh@ActiveState.com>
+2008-02-06 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * generic/tkFileFilter.c (FreeGlobPatterns): s/null/NULL/
+ * doc/ttk_scale.n (new file): [Bug 1881925]: Added basic documentation
-2005-05-24 Daniel Steffen <das@users.sourceforge.net>
+2008-02-04 Don Porter <dgp@users.sourceforge.net>
- * generic/tkTest.c: disable commands not available on TkAqua.
+ *** 8.5.1 TAGGED FOR RELEASE ***
- * macosx/Makefile:
- * macosx/README:
- * macosx/Tk-Info.plist.in (new file):
- * macosx/Wish-Info.plist.in (new file):
- * unix/Makefile.in:
+ * generic/tk.h: Bump to 8.5.1 for release.
+ * library/tk.tcl:
* unix/configure.in:
- * unix/tcl.m4:
- * unix/tkUnixInit.c: moved all Darwin framework and TkAqua build
- support from macosx/Wish.pbproj and macosx/Makefile into the standard
- unix configure/make buildsystem, the project and macosx/Makefile are no
- longer required to build Tk.framework and/or TkAqua. TkAqua is now
- enabled by the --enable-aqua configure option, and static and
- non-framework builds of TkAqua are now available via the standard
- configure switches. Tk/X11 can also be built as a framework. The
- macosx/Makefile now wraps the unix buildsystem and no longer uses the
- projects, embedded builds are still only available via this Makefile,
- but for other builds it is not longer required (but its current
- functionality is still available for backwards compatibility). The
- projects currently do not call through to the Makefile to build (unlike
- Tcl.pbproj) so project builds may differ from makefile builds. Due to
- issues with spaces in pathnames, 'Wish Shell.app' has been renamed to
- 'Wish.app', the macosx/Makefile installs backwards compatibility
- symlinks for the old name.
- * macosx/tkMacOSXInit.c (TkpInit): added support for Tk resource file
- in non-framework and static builds: the resource file is copied into a
- __tk_rsrc MachO section of the library or executable at link time and
- extracted into a temporary location at initialization.
- * unix/configure: autoconf-2.59
- * unix/tkConfig.h.in (new file): autoheader-2.59
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Tk-Info.plist:
- * macosx/Wish-Info.plist:
- * macosx/tkAboutDlg.r: updated copyright years to 2005.
-
-2005-05-22 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkFileFilter.c (TkGetFileFilters): Add all filters, not just
- the first one. [Bug 1206133]
-
-2005-05-15 Jim Ingham <jingham@apple.com>
-
- Fixes from Michael Kirkham:
-
- * macosx/tkMacOSXMenu.c (TkpConfigureMenuEntry): Thinko in clearing the
- ENTRY_ACCEL_MASK before re-parsing it. [Bug 1012852]
-
- * macosx/tkMacOSXScrlbr.c (UpdateControlValues): Don't set the control
- value BEFORE setting the min and max or the control manager will reset
- it for you. [Bug 1202181]
-
- * macosx/tkMacOSXXStubs.c (TkMacOSXXGetPixel, TkMacOSXXPutPixel):
- Restore the port to what it was before putting we were called. [Bug
- 1202223]
-
-2005-05-14 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c (ThumbActionProc): Missing Tcl_Release.
-
-2005-05-14 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXNotify.c: introduction of new tcl notifier based on
- CFRunLoop allows replacement of the custom TkAqua notifier by a
- standard tcl event source. Removes requirement of threaded tcl core
- for TkAqua, allows to stub-link TkAqua against Tcl by removing use of
- the unstubbed TclInitNotifier & TclFinalizeNotifier. [Tcl Patch
- 1202052]
-
- * macosx/Wish.xcode/project.pbxproj:
- * macosx/Wish.pbproj/project.pbxproj: stub-link TkAqua: build with
- USE_TCL_STUBS and link against libtclstub instead of Tcl.framework,
- unexport libtclstub symbols from Tk to avoid duplicate symbol warnings
- when linking with both Tcl and Tk, fixes for gcc4.0 warnings.
-
- * macosx/Wish.xcode/project.pbxproj: sync with Wish.pbproj changes
- since 2004-11-19.
- NOTE: to use this project, need to uncomment the tclConfig.h settings
- at the top of tcl/unix/configure.in, autoconf and rebuild tcl !
-
- * macosx/tkMacOSXBitmap.c:
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXHLEvents.c:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXKeyboard.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXXStubs.c: fixed gcc 4.0 warnings.
-
- * unix/tcl.m4: sync with tcl
- * unix/configure: autoconf-2.59
-
-2005-05-10 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * library/text.tcl: test and fix to TextPrevPara to avoid infinite loop
- * tests/textIndex.test: at start of widget. [Bug 1191895]
-
- * generic/tkTextDisp.c: better synchronisation between explicit and
- implicit pixel line-height calculations. [Bug 1186558]
-
-2005-05-10 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkTextDisp.c (GetXView): Improved numerical precision of
- calculation of [.t xview] return values.
- * tests/textDisp.test: Match greater precisions of [.t xview] and
- [.t yview] values in tests.
-
-2005-05-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure: regen
- * unix/configure.in: Add AC_C_BIGENDIAN check and pkg-config xft checks
- to extend xft search.
- * unix/tcl.m4: Correct Solaris 10 (5.10) check and add support for
- x86_64 Solaris cc builds.
-
-2005-04-28 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * macosx/tkMacOSXNotify.c (TkMacOSXWaitForEvent): Fix for typo in
- waitTime computation. [Bug 1191097]
- (AlertNotifier): Factor out the core of the notifier alerting code.
-
-2005-04-25 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXNotify.c: sync with tclUnixNotfy.c changes since
- 2004-06-22, added compile time check for threaded tcl core, removed
- unthreaded code paths as they are never used anyway, fixed
- TkMacOSXAlertNotifier() implementation.
-
- * unix/Makefile.in: added TCL_STUB_LIB_FILE, needed for unexporting of
- symbols from libtclstub to avoid duplicate symbol warnings.
-
- * unix/tcl.m4 (Darwin): added configure checks for recently added
- linker flags -single_module and -search_paths_first to allow building
- with older tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD
- and not just T{CL,K}_SHLIB_LD_EXTRAS, added unexporting from Tk of
- symbols from libtclstub to avoid duplicate symbol warnings, added
- PLAT_SRCS definition for Mac OS X, defined MODULE_SCOPE to
- __private_extern__.
- (SC_MISSING_POSIX_HEADERS): added caching of dirent.h check.
-
- * unix/configure: autoconf-2.59
-
-2005-04-22 George Peter Staplin <GeorgePS@XMission.com>
-
- * doc/FontId.3: I fixed a typo. "linespace" was used instead of
- "ascent". I also added a .PP before the paragraph to make the
- formatting look better for the ascent paragraph.
-
-2003-04-18 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixRFont.c(Tk_MeasureChars): Use Tcl_UtfToUnichar() for lax
- UTF-8 parsing instead of strict parsing with FcUtf8ToUcs4()
- [fix/workaround for Bug 1185640]
-
-2003-04-18 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * library/text.tcl
- * doc/text.n: corrected 'Home' and 'End' and Control-a/e handling to
- work with display lines. This was an ommission of the previous tip155
- patch. Clarified the documentation on this point.
-
-2005-04-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to avoid
- possible segv. Minimal fix for [Bug 1122671]
-
-2005-04-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/tkfbox.tcl (::tk::dialog::file::): fix typeMenuLab ref. Add
- undoc'd ::tk::dialog::file::showHiddenBtn var (default 0) that will add
- a "Show Hidden" checkbutton to tk_get*File and tk_chooseDirectory if
- set to true.
- * library/choosedir.tcl (::tk::dialog::file::chooseDir::): fix
- cancelBtn ref, add hiddenBtn ref for "Show Hidden" button.
-
-2005-04-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/README: updated requirements for OS & developer tool versions
- + other small fixes/cleanup.
-
- * macosx/tkMacOSXEntry.c (ComputeIncDecParameters): manually define
- constants present only in 10.3 headers so that we can build on 10.2.
-
- * macosx/Wish.pbproj/project.pbxproj: fixed absolute path to tkEntry.h
- that confused 10.2 PBX.
-
- * unix/tcl.m4 (Darwin): added -single_module linker flag to
- TCL_SHLIB_LD_EXTRAS and TK_SHLIB_LD_EXTRAS.
- * unix/configure: autoconf-2.59
-
-2005-04-07 Mo DeJong <mdejong@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c (TkWmStackorderToplevelWrapperMap,
- (TkWmStackorderToplevel):
- * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap,
- (TkWmStackorderToplevel):
- * win/tkWinWm.c (TkWmStackorderToplevelWrapperMap,
- (TkWmStackorderToplevel):
- Fix panic in wm stackorder when a toplevel is created on another
- display. The code now ignores toplevels that have a display that does
- not match the display of the parent window. [Bug 1152809]
-
-2005-04-06 Donal K. Fellows <dkf@users.sf.net>
-
- * doc/wm.n, doc/winfo.n, doc/tk.n, doc/send.n, doc/selection.n:
- * doc/radiobutton.n, doc/photo.n, doc/options.n, doc/menu.n:
- * doc/listbox.n, doc/getOpenFile.n, doc/font.n, doc/event.n:
- * doc/entry.n, doc/clipboard.n, doc/checkbutton.n, doc/canvas.n:
- * doc/button.n, doc/bind.n, doc/TextLayout.3, doc/MeasureChar.3:
- * doc/GetRelief.3, doc/GetPixels.3, doc/GetJustify.3, doc/GetFont.3:
- * doc/GetCursor.3, doc/GetColor.3, doc/GetBitmap.3, doc/GetAnchor.3:
- * doc/FontId.3, doc/CrtWindow.3, doc/CrtImgType.3, doc/ConfigWidg.3:
- * doc/3DBorder.3: Purge old .VS/.VE macro instances.
-
-2005-04-04 Don Porter <dgp@users.sourceforge.net>
-
- * library/comdlg.tcl: Added Macintosh file type validation to
- [::tk::FDGetFileTypes]. [Bug 1083878] (Thanks, Vince Darley)
-
-2005-04-04 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c:
- * tests/text.test: fix to elide searching problems [Bug 1174269] and
- disappearing cursor with insertofftime 0. [Bug 1169429]
-
-2005-04-03 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/grid.test:
- * generic/tkGrid.c: Fixed bug in geometry calculations for widgets that
- span multiple columns/row. Bug was introduced in 8.5a1 when fixing
- 792387. [Bug 1175092]
-
-2005-03-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tcl.m4, win/configure: do not require cygpath in macros to allow
- msys alone as an alternative.
-
-2005-03-27 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * tests/textDisp.test: added test for fix of 2005-03-15.
-
-2005-03-24 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): Dopey bug - do
- not reset the width for entry widgets - we didn't change it for them.
-
-2005-03-23 Jim Ingham <jingham@apple.com>
-
- These changes allow us to draw the Entry and Spinbox widget with a
- native look and feel on Mac OS X.
-
- * generic/tkEntry.h: New file, extracting the definitions of Entry and
- Spinbox.
- * generic/tkEntry.c (DisplayEntry): Call out to TkpDrawSpinboxButtons
- and TkpDrawEntryBorderAndFocus. Also provide default implementations
- for X11 & Win.
- * macosx/tkMacOSXEntry.c: New file, implements the entry & focus and
- spinbox button drawing.
- * tkMacOSXDefaults.h: Change the Mac OS X defaults so they fit the
- native widget shapes.
-
- This is cleanup thanks to Neil Madden <nem@cs.nott.ac.uk>.
-
- * macosx/tkMacOSXWm.c (TkMacOSXWinStyle) New function.
- (TkUnsupported1ObjCmd): New function, replaces the un-objectified
- version of the command.
- * generic/tkInt.h: Swap TkUnsupported1Cmd for TkUnsupported1ObjCmd.
- * generic/tkWindow.c (): Ditto.
-
- This adds a "-notify" flag to "wm attributes" that will bounce the
- dock icon on Mac OS X. This is from Revar Desmera <revarbat@gmail.com>
-
- * macosx/tkMacOSXWm.c (WmAttrGetNotifyStatus, WmAttrSetNotifyStatus):
- New functions.
- (WmAttributesCmd): Add the -notify.
- * doc/wm.n: Document -notify.
-
-2005-03-19 Donal K. Fellows <dkf@users.sf.net>
-
- * generic/tkConsole.c (Tk_CreateConsoleWindow,TkConsolePrint): Rewrite
- so that TkConsolePrint cannot become detached from the console when the
- [console] command is renamed. [Bug 1016385]
-
-2005-03-15 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkTextDisp.c: fix for [Bug 1143776] in adjusting displayed
- lines when running into the bottom of the window.
-
-2005-03-14 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c (ThumbActionProc): No need to use "update
- idletasks" here, TclServiceIdle will do as well and it is simpler.
-
- These changes implement a change on the Mac OS X side. When we unmap a
- window we mark all its children as unmapped (not following toplevels.
- But we preserve whether they had been mapped before, and when the
- parent is remapped, we remap the children as well. [Bug 940117]
-
- * macosx/tkMacOSXInt.h: Added TK_MAPPED_IN_PARENT
- * macosx/tkMacOSXSubwindows.c (FixMappingFlags): New function.
- (XMapWindow): Call FixMappingFlags.
- (XUnMapWindow): Ditto.
-
- * macosx/tkMacOSXSubwindows.c (XMoveResizeWindow): Update the xOff &
- yOff data in the Macdrawable even if the native window hasn't been
- created yet. [Bug 700305]
- (XMoveWindow): Ditto.
- (XResizeWindow): Ditto.
-
-2005-03-15 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * unix/tcl.m4: Updated the OpenBSD configuration and regenerated the
- * unix/configure: configure script.
-
-2005-03-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-
- * generic/tkEvent.c (InvokeClientMessageHandlers): Ensure that client
- messages are handled correctly. Thanks to George Petasis for tracking
- this down. [Bug 1162356]
-
-2005-03-11 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXButton.c (TkpDisplayButton): Set the port to the
- Button window's port BEFORE you set the clip, otherwise you are setting
- the clip on the wrong window!
- Also, a little cleanup - move x & y into the branches where they are
- used, and don't compute the TextAnchor if we are using the native
- button text, since we aren't going to use it.
- (TkMacOSXDrawControl): Call ShowControl & SetControlVisibility in a
- more logical order.
-
- * tkMacOSXInt.h: Add TkMacOSXGenerateFocusEvent.
- * tkMacOSXSubwindows.c (XDestroyWindow): We don't get Activate events
- for the remaining windows when a Floating window is destroyed. This can
- cause the focus to disappear. So catch this case when the window is
- being destroyed and move the focus here.
-
- * tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): Make this public
- (used to be GenerateFocusEvent) since we need it here and in
- tkMacOSXSubwindows.c. Then change the name everywhere it is used. [Bug
- 1124237]
-
-2005-03-10 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): In the
- inDrag section, set the GrafPort to the drag window's GrafPort before
- doing LocalToGlobal. [Bug 1160025]
-
-2005-03-09 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXInit.c (TkpInit): Check to see if the environment
- variable XCNOSTDIN is set, and if so, close stdin & stdout. This is
- necessary to make remote debugging under Xcode work properly.
-
-2005-03-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (WinSetIcon): fix GCLP_ICONSM -> GCLP_HICONSM.
-
- * win/makefile.vc: clarify necessary defined vars that can come from
- MSVC or the Platform SDK.
-
-2005-02-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinX.c (GenerateXEvent): correct %A translation on MouseWheel.
- [Bug 1118340]
-
-2005-02-24 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSX.h: fixed incorrect inclusion of internal header.
- * macosx/tkMacOSXNotify.c: corrected included headers.
-
-2005-02-22 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd, NavServicesGetFile):
- fixed encoding problems with -initialfile & -filetypes and corrected
- potential buffer overrun with -initialdir/-initialfile. [Bug 1146057]
-
-2005-02-16 Mo DeJong <mdejong@users.sourceforge.net>
-
- TIP#223 IMPLEMENTATION
-
- * doc/wm.n: Add documentation for -fullscreen attribute.
- * tests/winWm.test: Add -fullscreen to wm attribute usage message.
- * tests/wm.test: Add -fullscreen to wm attribute usage message. Add
- -fullscreen attribute test cases for Windows.
- * win/tkWinWm.c (WmInfo, UpdateWrapper, TkpWmSetFullScreen)
- (WmAttributesCmd, UpdateGeometryInfo):
- Implement TIP 223 [wm attributes -fullscreen].
-
-2005-02-14 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkText.c:
- * generic/tkText.h:
- * generic/tkTextDisp.c:
- * generic/tkTextIndex.c:
- * generic/tkTextBTree.c:
- * doc/text.n:
- * tests/textDisp.test:
- * tests/textIndex.test: fix of longstanding elide problem when eliding
- a newline without eliding the entire logical line. [Bug 443848]
-
-2005-02-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/options.n: note -cursor {} behavior. [Bug 965618]
-
-2005-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * unix/tk.spec:
+ * win/configure.in:
- * tests/all.tcl: Add a [package require Tk] so that a missing display
- causes an early failure and keeps the error trace short. Issue observed
- in [FRQ 11122147], even though that's unrelated.
+ * unix/configure: autoconf-2.59
+ * win/configure:
-2005-02-11 Jeff Hobbs <jeffh@ActiveState.com>
+2008-02-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * library/panedwindow.tcl (::tk::panedwindow::Cursor): check window
- existence on delayed call. [Bug 949792]
+ * doc/MeasureChar.3, doc/FontId.3: Minor improvements (formatting,
+ keywords).
- * doc/text.n: note 'image' key in 'dump' command. [Bug 1115907]
+2008-02-02 Daniel Steffen <das@users.sourceforge.net>
- * win/tkWinWm.c (TkWinGetIcon): fix toplevel retrieval for determining
- icon ref (potential crash). [Bug 1105738]
+ * macosx/Wish-Info.plist.in: Add CFBundleLocalizations key, listing
+ * unix/configure.in (Darwin): all library/msgs locales.
- * generic/tkCanvBmap.c (ConfigureBitmap, ComputeBitmapBbox): Fixed
- possible crash with disabled bmap and bbox handling [Bug 1119460]
- (BitmapToPostscript): made aware of various bitmap types
+ * unix/configure.in (Darwin): Correct Info.plist year substitution
+ in non-framework builds.
- * unix/Makefile.in: remove SHLIB_LD_FLAGS (only for AIX, inlined into
- * unix/tcl.m4: SHLIB_LD). Combine AIX-* and AIX-5 branches in
- * unix/configure: SC_CONFIG_CFLAGS. Correct gcc builds for AIX-4+ and
- HP-UX-11. autoconf-2.59 gen'd.
+ * unix/configure: autoconf-2.59
-2005-02-09 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-02-01 Don Porter <dgp@users.sourceforge.net>
- * tests/wm.test: Convert to use more tcltest2 features.
+ * changes: Updates for 8.5.1 release.
-2005-02-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-02-01 Reinhard Max <max@suse.de>
- * generic/tkCanvas.c (CanvasWidgetCmd): Fix stupid mistake in variable
- names, reported by Andreas Leitgeb.
+ * generic/tkImgGIF.c: Fixed a buffer overflow (CVE-2008-0553).
+ * tests/imgPhoto.test: Added a test for the above.
-2005-02-03 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+2008-01-31 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkCanvas.c (GetStaticUids): New function to manage the
- thread-specific data detailing the list of all uids in a thread.
- (typeList): Protect this (the other piece of global data) with a mutex.
- [Bug 1114977]
+ * library/msgbox.tcl (::tk::MessageBox): Don't use ttk::label in low
+ depth/aqua fallback, as it doesn't support -bitmap.
-2005-01-31 Jeff Hobbs <jeffh@ActiveState.com>
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): [Bug 1881892]: Pass ""
+ instead of NULL when -title isn't set.
- * unix/tcl.m4, unix/configure: add solaris-64 gcc build support. [Bug
- 1021871]
+2008-01-31 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-2005-01-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+ * doc/panedwindow.n: Added proper description of -height and -width
+ options, which aren't "standard". Last of fallout from [Bug 1882495].
- * generic/tkImgPhoto.c (PhotoFormatThreadExitProc): Made the comments
- in the code more relevant to the function they were documenting! [Bug
- 1110553]
+2008-01-30 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * library/msgs/es_ES.msg: Added more localization for Spanish Spanish.
- [Bug 1111213]
+ * doc/canvas.n, doc/listbox.n, doc/message.n: [Bug 1882495]: Fix
+ erroneous listing of "standard" options.
-2005-01-25 Daniel Steffen <das@users.sourceforge.net>
+2008-01-29 Joe English <jenglish@users.sourceforge.net>
- * macosx/tkMacOSXInit.c (TkpInit): set tcl_interactive to 1 to show
- console at startup instead of directly calling [console show].
+ * library/treeview.tcl: Fix bug in Shift-ButtonPress-1 binding (error
+ if no current focus item; reported on c.l.t.)
- * unix/tcl.m4 (Darwin): fixed bug with static build linking to dynamic
- library in /usr/lib etc instead of linking to static library earlier in
- search path. [Tcl Bug 956908]
- Removed obsolete references to Rhapsody.
- * unix/configure: autoconf-2.57
+2008-01-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-2005-01-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * doc/ttk_*.n: [Bug 1876493]: Adjusted handling of the standard
+ options part of the Ttk manual pages so that they are documented in
+ the correct location.
- * library/demos/menu.tcl: Reworked to make dialogs children of the
- demo widget so that they are properly visible. Issue reported by Keith
- Nash <k.j.nash@usa.net>
+2008-01-28 Joe English <jenglish@users.sourceforge.net>
-2005-01-13 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * unix/tkUnixRFont.c: Re-fix strict-aliasing warnings reintroduced by
+ last patch.
- * library/tkfbox.tcl (IconList_Selection, IconList_Create):
- (IconList_Arrange): Assorted tk_getOpenFile fixes. [part of Bug 600313]
- (IconList_ShiftMotion1): Also fix shift-drag.
+2008-01-27 Joe English <jenglish@users.sourceforge.net>
-2005-01-12 Don Porter <dgp@users.sourceforge.net>
+ * generic/ttk/ttkNotebook.c: [Bug 1878298]: Make sure to schedule a
+ redisplay when adding and/or hiding tabs.
- * unix/tcl.m4: Sync'ed to Tcl's copy.
- * unix/configure: autoconf-2.57
+2008-01-27 Joe English <jenglish@users.sourceforge.net>
-2005-01-12 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * unix/tkUnixRFont.c: Merged common code from InitFont() and
+ TkpGetFontAttrsForChar(), factored into GetTkFontAttributes() and
+ GetTkFontMetrics(). Removed write-only struct UnixFtFont member
+ 'drawable'. Removed unneeded double-pointer indirections. Ensure that
+ TkFontAttributes.family member is a Tk_Uid, as specified. Use
+ FcTypeDouble for XFT_SIZE attribute. Finally: fix [Bug 1835848]
- * doc/event.n: Added section on predefined virtual events. [Bug 608115]
+2008-01-25 Don Porter <dgp@users.sourceforge.net>
-2005-01-11 Vince Darley <vincentdarley@users.sourceforge.net>
+ * changes: Updates for 8.5.1 release.
- * generic/tkTextDisp.c: fix to scrollbar height calculations of text
- widgets containing a single very long (wrapped) line. This fixes at
- least part of [Bug 1093631].
+2008-01-08 Joe English <jenglish@users.sourceforge.net>
-2005-01-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * generic/ttk/ttkFrame.c: [Bug 1867122]: fix crash in
+ [ttk::labelframe] when -style option specified.
- * generic/tkObj.c (TkParsePadAmount):
- * generic/tkPack.c: Moved function to tkObj.c and rewrote so that it
- takes advantage of Tcl_Objs properly and cannot leave objects in an
- inconsistent state. [Bug 1098779]
+2008-01-08 Joe English <jenglish@users.sourceforge.net>
-2005-01-10 Joe English <jenglish@users.sourceforge.net>
+ * win/ttkWinTheme.c: [Bug 1865898]: Add tristate support to
+ checkbuttons and radiobuttons.
+ [Bug 1679067]: Fix check and radio indicator size.
- * unix/Makefile.in, unix/configure.in, unix/tkConfig.sh.in:
- Remove ${DBGX}, ${TK_DBGX} from Tk build system. [Patch 1081595]
- * unix/tcl.m4: re-synced with tcl/unix/tcl.m4
- * unix/configure: Regenerated.
+2008-01-06 Joe English <jenglish@users.sourceforge.net>
-2005-01-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * generic/ttk/ttkWidget.c, generic/ttk/ttkWidget.h: Call
+ Tk_MakeWindowExist() in widget constructor. Removed now-unnecessary
+ initial ConfigureNotify processing.
- * generic/tkWindow.c (GetScreen): Make sure the result is reset on all
- error paths to stop strange errors. [Bug 697915]
+2008-01-06 Joe English <jenglish@users.sourceforge.net>
-2005-01-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * library/ttk/treeview.tcl, library/ttk/utils.tcl:
+ [Bugs 1442006, 1821939, 1862692]: Fix MouseWheel bindings for
+ ttk::treeview widget.
- * doc/loadTk.n, doc/toplevel.n: Convert to other form of emacs mode
- control comment to prevent problems with old versions of man. [Bug
- 1085127]
+2008-01-02 Don Porter <dgp@users.sourceforge.net>
-2005-01-03 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tk.h: Bump version number to 8.5.1b1 to distinguish
+ * library/tk.tcl: CVS development snapshots from the 8.5.0 and
+ * unix/configure.in: 8.5.1 releases.
+ * unix/tk.spec:
+ * win/configure.in:
- * win/tkWinWm.c (TkWinWmCleanup): clean up layered window class. This
- caused crash in reinit of Tk (as seen in plugin).
+ * unix/configure: autoconf (2.59)
+ * win/configure:
******************************************************************
+ *** CHANGELOG ENTRIES FOR 2005 TO 2007 IN "ChangeLog.2007" ***
*** CHANGELOG ENTRIES FOR 2004 AND 2003 IN "ChangeLog.2004" ***
*** CHANGELOG ENTRIES FOR 2002 AND EARLIER IN "ChangeLog.2002" ***
******************************************************************
diff --git a/ChangeLog.2007 b/ChangeLog.2007
new file mode 100644
index 0000000..8c458be
--- /dev/null
+++ b/ChangeLog.2007
@@ -0,0 +1,5283 @@
+2007-12-30 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/canvas.n: Documented exact behaviour of items with respect to
+ when they are the current item. [Bug 1774593] Also documented the
+ clipping behaviour of window items.
+
+ * library/demos/nl.msg: Corrected following testing "in the field" by
+ Arjen Markus. [Bug 1860802]
+
+2007-12-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ *** 8.5.0 TAGGED FOR RELEASE ***
+
+ * doc/canvas.n: Documented -outlineoffset item option. [Bug 1836621]
+
+2007-12-14 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: More updates for 8.5.0 release.
+
+2007-12-14 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/ttk_treeview.n: Fix typo. [Bug 1850713]
+
+2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinInt.h: Add in missing function definitions
+ * win/tkWinButton.c: to support plain MSVC6 and use INT_PTR
+ * win/tkWinScrlBar.c: rather than LONG_PTR which isn'tr defined
+ * win/tkWinWm.c: in the msvc6 headers.
+
+2007-12-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/nmakehlp.c: Support compilation with MSVC9 for AMD64.
+ * win/makefile.vc:
+
+2007-12-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenubutton.c (ConfigureMenuButton): trace the
+ -textvariable even if an image exists as it may use -compound.
+
+2007-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (DeleteIndexRange, TextEditCmd, UpdateDirtyFlag):
+ * tests/text.test (text-25.10.1,25.11.[12]):
+ Don't require [update idle] to trigger Modified event [Bug 1809538]
+ Modified virtual event should only fire on state change [Bug 1799782]
+ Make sure we delete chars before triggering <<Modified>> [Bug 1737288]
+
+2007-12-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Revert 2007-10-26
+ change to window class of transient toplevels that are not also
+ overrideredirect. [Bug 1845899]
+
+ * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Implement more
+ * macosx/tkMacOSXMouseEvent.c (BringWindowForward): X11-like transient
+ * macosx/tkMacOSXSubwindows.c (XDestroyWindow): behaviour by
+ adding transient windows to a window group owned by the master window,
+ this ensures transients always remain in front of and are collapsed
+ with the master; bring master to front when selecting transient
+ windows; restore default window group of transients if master
+ destroyed. [Bug 1845899]
+
+2007-12-12 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/ttk_intro.n, doc/ttk_style.n, doc/ttk_widget.n:
+ Various minor updates.
+
+2007-12-12 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updated for 8.5.0 release.
+
+2007-12-11 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.c (StyleElementOptionsCmd): Use
+ Ttk_GetElement() to find element instead of direct hash table access.
+
+2007-12-11 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkText.c (TextReplaceCmd): Added code to rebuild the from
+ index after the deletion phase so that the linePtr field is valid for
+ the insertion phase. [Bug 1602537]
+
+2007-12-10 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/event.n: Clarify the fact that [event info] only returns the
+ names of virtual events that are bound to physical event sequences.
+ This follows on from comments on comp.lang.tcl.
+ http://groups.google.com/group/comp.lang.tcl/msg/935d2d226ae8a770
+
+2007-12-10 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/AddOption.3, doc/CrtImgType.3, doc/CrtPhImgFmt.3,
+ * doc/InternAtom.3, doc/TextLayout.3, doc/chooseColor.n,
+ * doc/chooseDirectory.n, doc/loadTk.n, doc/palette.n,
+ * doc/ttk_combobox.n: Various markup fixes (mostly: missing quotes on
+ .SH arguments, extraneous .PPs)
+
+ * doc/ttk_entry.n, doc/ttk_scrollbar.n, doc/ttk_treeview.n: Remove
+ extra .BEs that got added by mistake somewhere.
+
+2007-12-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tk.decls: use new genstubs 'export' command to
+ * generic/tkInt.decls: mark exported symbols not in stubs
+ table [FR 1716117]; cleanup formatting
+
+ * generic/tkIntDecls.h: regen with new genStubs.tcl.
+ * generic/tkIntPlatDecls.h: [Tcl Bug 1834288]
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c:
+
+2007-12-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * tests/safe.test: Ensure list of hidden commands is correct. [Bug
+ 1847925]
+
+2007-12-10 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWin.h: We must specify the lowest Windows version we intend to
+ support. In particular the SystemParametersInfo API doesn't like to
+ receive structures that are larger than it expects which affects the
+ font assignements. Set to Win98 support.
+
+ * win/tkWinFont.c: Handle failure to read the system parameters. This
+ causes ttk/fonts.tcl to set any missing named fonts.
+
+ * win/ttkWinMonitor.c: Only tkWin.h should include windows.h unless
+ * win/ttkWinTheme.c: we have an explicit override of the WINVER
+ * tin/ttkWinXPTheme.c: macro.
+
+ * win/rules.vc: Handle MSVC 9 (aka: Visual Studio 2008)
+
+ * tests/safe.test: Update for 'unload' as a safe command (tcl 8.5b3+)
+
+2007-12-09 Donal K. Fellows <dkf@users.sf.net>
+
+ * win/configure.in: Adjusted code so that running configure does not
+ generate an error message when the full current directory name
+ contains a space.
+
+ * win/tkWinWm.c: Added set of #defs to make this file build with my
+ version of the SDK (i.e. with the msys suite we distribute).
+
+2007-12-07 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/altTheme.tcl, library/ttk/classicTheme.tcl:
+ s/style/ttk::style/.
+
+2007-12-07 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/README: Mention the stub library created by `make` and warn
+ about the effect of embedded paths in the installed binaries. Thanks
+ to Larry Virden. [Tcl Bug 1794084]
+
+2007-12-05 Joe English <jenglish@users.sourceforge.net>
+
+ * macosx/ttkMacOSXTheme.c: Fix TCombobox layout so as not to truncate
+ long text when combobox is wider than requested. [Bug 1845164]
+
+2007-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/demos/widget: reduce start size to 70% of screenheight from
+ sh-200 for a more reasonable size.
+
+ * win/tkWinButton.c, win/tkWinDialog.c: use SetWindowLongPtr and
+ * win/tkWinScrlbr.c, win/tkWinWm.c: GetWindowLongPtr only.
+ * win/ttkWinMonitor.c:
+
+ * win/tkWinInt.h: remove CS_CLASSDC (not recommended for any apps now)
+ * win/tkWinX.c: and simplify WNDCLASS to one style.
+ * win/tkWinWm.c: Reduce wrapper update for exStyle to toolwindow
+ change only and set WS_EX_LAYERED as sticky (once set on a window, do
+ not remove it) to reduce alpha transition flicker.
+
+ * win/configure, win/tcl.m4 (LIBS_GUI): mingw needs -lole32 -loleaut32
+ but not msvc for Tk's [send]. [Bug 1844749]
+
+2007-12-04 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/ttk_style.n: Remove nonsense about "this manpage has not yet
+ been written"; everything supported is documented.
+
+2007-12-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/msgs/en.msg: Added missing messages. [Patch 1800744]
+
+ * library/msgs/da.msg: Added Danish messages. [Patch 1844143]. Many
+ thanks to Torsten Berg <treincke@users.sf.net>.
+
+2007-12-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure, win/tcl.m4 (LIBS_GUI): remove ole32.lib oleaut32.lib
+ (LIBS): add ws2_32.lib for static builds with Tcl.
+
+2007-12-01 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h,
+ * generic/ttk/ttkTheme.c, generic/ttk/ttkLayout.c,
+ * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c,
+ * generic/ttk/ttkTreeview.c, macosx/ttkMacOSXTheme.c,
+ * win/ttkWinTheme.c, win/ttkWinXPTheme.c: Improved macrology for
+ statically-initialized layout template tables.
+
+2007-11-28 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tkUnixPort.h: When unix/configure determines whether the
+ intptr_t type is available, it has the <inttypes.h> header present.
+ It's only fair that we let Tk have it too.
+
+2007-11-26 Kevin Kenny <kennykb@acm.org>
+
+ * generic/tkImgPPM.c (StringReadPPM): Corrected a comparison whose
+ sense was reversed that resulted in reading beyond the end of the
+ input buffer on malformed PPM data. [Bug 1822391]
+ * library/tkfbox.tcl (VerifyFileName): Corrected a couple of typos in
+ handling of bad file names. [Bug 1822076] Thanks to Christoph Bauer
+ (fridolin@users.sf.net) for the patch.
+ * tests/filebox.test (filebox-7.1, filebox-7.2): Added test cases that
+ exercise. [Bug 1822076]
+ * tests/imgPPM.test (imgPPM-4.1): Added test case that exercises. [Bug
+ 1822391]
+
+2007-11-25 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkManager.h, generic/ttk/ttkManager.c,
+ * generic/ttk/ttkFrame.c, generic/ttk/ttkNotebook.c,
+ * generic/ttk/ttkPanedwindow.c: Internal Ttk_Manager API updates;
+ Fixed [Bug 1343984]; Added [$nb hide] method; [$nb add] on
+ already-managed windows no longer throws an error, can be used to
+ re-add a hidden tab.
+
+ * doc/ttk_notebook.n, tests/ttk/notebook.test,
+ * tests/ttk/panedwindow.test: Updated docs and test suite.
+
+2007-11-23 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * unix/README: General improvements.
+
+2007-11-21 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/tkfbox.tcl: Better theming in the file list area.
+
+2007-11-19 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5b3 TAGGED FOR RELEASE ***
+
+ * README: Bump version number to 8.5b3.
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+ * changes: Update changes for 8.5b3 release.
+
+2007-11-19 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.c: Fix crash when 'style element create'
+ * tests/ttk/ttk.test: called w/ insufficient args; add tests.
+
+2007-11-18 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkElements.c, macosx/ttkMacOSXTheme.c: Add "fill"
+ element: like "background" but only erases parcel.
+
+ * generic/ttk/ttkFrame.c: Use fill element in Labelframe Label
+ sublayout. Also improved default labelmargins for -labelanchor w*, e*.
+
+ * generic/ttk/ttkLabel.c: no longer need Labelframe hack.
+
+ * library/ttk/aquaTheme.tcl: ImageTextElement no longer needed.
+ TextElement no longer needs '-background' option.
+
+ * generic/ttk/ttkFrame.c: Use sublayout for ttk::labelframe labels
+ instead of single element.
+
+ * generic/ttk/ttkLabel.c: Default -anchor for text and label elements
+ is now "w" instead of "center". [Bug 1614540]
+
+ * library/ttk/defaults.tcl, library/ttk/*Theme.tcl: Button styles now
+ need explicit "-anchor center".
+
+ * generic/ttk/ttkLayout.c (TTKInitPadding): BUGFIX:
+ Ttk_GetPaddingFromObj() and Ttk_GetBorderFromObj() returned garbage
+ when passed an empty list.
+
+ * macosx/ttkMacOSXTheme.c: Resynchronize with Tile codebase so that
+ patches can flow back and forth.
+
+ * library/ttk/aquaTheme.tcl: Extra TButton -padding no longer needed.
+
+2007-11-18 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/ttkWinXPTheme.c: Add support for size information flags for
+ scrollbar and combobox buttons. This handles Tile [Patches 1596647 and
+ 1596657] but a bit more generically.
+
+2007-11-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/(tkArgv.c, tkBind.c, tkCipboard.c, tkEntry.c, tkOption.c,
+ tkScale.c, tkScrollbar.c, tkTextImage.c, tkVisual.c, tkWindow.c): Tidy
+ up some variable types.
+
+ * generic/tkFont.c: Only check for -displayof if there are
+ * test/font.test: sufficient arguments. This permits checking
+ strings like -d.
+
+2007-11-17 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/scrollbar.tcl: Swap in core scrollbars for
+ [ttk::scrollbar]s on OSX.
+
+2007-11-16 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Correct an
+ oversight in the bug fix from 2007-11-11. [Bug 1824638]
+
+2007-11-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new chanio.test.
+ * macosx/Wish.xcode/project.pbxproj:
+
+2007-11-14 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/msgs/sv.msg: Get the locale declared within the message
+ catalog correct! [Bug 1831803]
+
+2007-11-11 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Fix the case when
+ TK_WHOLE_WORDS and TK_AT_LEAST_ONE are both set and maxLength is small.
+ [Bug 1824638]
+
+2007-11-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXCarbonEvents.c
+ (InstallStandardApplicationEventHandler): on Mac OS X Leopard, replace
+ the 2005-11-27 approach of installing the standard application handler
+ by calling RAEL and immediately longjmping out of it from an event
+ handler, as that now leads to crashes in -[NSView unlockFocus] whenever
+ HIToolbox uses Cocoa in Leopard (Help menu, Nav Services, Color
+ Picker). Instead call InstallStandardEventHandler() on the application
+ and menubar event targets, as Leopard ISEH finally handles these
+ correctly. Unfortunately need a HIToolbox-internal SPI to retrieve the
+ menubar event target, no public API appears have that functionality.
+
+ * macosx/tkMacOSXDebug.c: make TkMacOSXInitNamedDebugSymbol()
+ * macosx/tkMacOSXDebug.h: available outside of debug builds as
+ the new Leopard ISAEH needs it.
+
+ * macosx/tkMacOSXButton.c: replace HiliteControl() by modern API
+ * macosx/tkMacOSXMenubutton.c: for activation and enabling;
+ distinguish inactive and disabled
+ look&feel; correct activation handling
+ to match that of container toplevel.
+
+ * macosx/tkMacOSXMenubutton.c: correct size computation of bevelbutton
+ variant to match that of buttons;
+ fix crash with bitmap due to NULL GC;
+ delay picParams setup until needed;
+ formatting cleanup. [Bug 1824521]
+
+ * library/menu.tcl: correct handling of menubutton "active"
+ state on Aqua to match that of buttons.
+
+ * macosx/tkMacOSXDefault.h: correct button & menubutton active
+ foreground and background colors and
+ menubutton border width.
+
+ * macosx/tkMacOSXWindowEvent.c: handle kEventWindowExpanding carbon
+ * macosx/tkMacOSXCarbonEvents.c: event instead of kEventWindowExpanded
+ to ensure activate event arrives after
+ window is remapped, also need to
+ process all Tk events generated by
+ remapping in the event handler to
+ ensure children are remapped before
+ activate event is processed.
+
+ * macosx/tkMacOSXSubwindows.c: add pixmap size field to MacDrawable
+ * macosx/tkMacOSXInt.h: struct; add flag for B&W pixmaps.
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXEmbed.c:
+ * macosx/tkMacOSXMenu.c:
+
+ * macosx/tkMacOSXPrivate.h: correct Leopard HIToolboxVersionNumber.
+
+ * macosx/ttkMacOSXTheme.c: add error checking; cleanup formatting.
+
+ * macosx/tkMacOSXFont.c (TkpGetFontAttrsForChar): panic on false return
+ from TkMacOSXSetupDrawingContext().
+
+ * macosx/tkMacOSXButton.c: sync formatting, whitespace, copyright
+ * macosx/tkMacOSXDialog.c: with core-8-4-branch.
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXWm.c:
+ * xlib/xgc.c
+ * library/bgerror.tcl:
+ * library/console.tcl:
+ * library/menu.tcl:
+
+2007-11-07 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.c (Ttk_ElementSize): Fixed longstanding, subtle
+ bug that caused element padding to sometimes be counted twice in size
+ computations.
+
+ * generic/ttk/ttkElements.c, generic/ttk/ttkClamTheme.c,
+ * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkTreeview.c,
+ * generic/ttk/ttkImage.c, macosx/ttkMacOSXTheme.c,
+ * win/ttkWinTheme.c, win/ttkWinXPTheme.c:
+ Fix ElementSizeProcs affected by previous change.
+
+2007-11-06 Andreas Kupries <andreask@activestate.com>
+
+ * doc/CrtConsoleChan.3: Fixed markup typo and extended see also
+ section per suggestions by Donal.
+
+2007-11-05 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: Set focus to listbox in <Map> binding
+ instead of in Post command (see [Bug 1349811] for info).
+
+2007-11-05 Andreas Kupries <andreask@activestate.com>
+
+ * doc/CrtConsoleChan.3: New file providing minimal documentation of
+ 'Tk_InitConsoleChannels()'. [Bug 432435]
+
+2007-11-05 Joe English <jenglish@users.sourceforge.net>
+
+ * macosx/ttkMacOSXTheme.c (TreeitemLayout): Remove focus ring
+ from treeview items on OSX (problem reported by Kevin Walzer).
+
+2007-11-04 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c: Use null "treearea" element for treeview
+ owner-draw area instead of "client", to avoid nameclash with
+ Notebook.client element (this was causing sizing anomalies in XP
+ theme, and introduced extraneous padding).
+ * generic/ttk/ttkDefaultTheme.c: Treeitem.indicator element needs left
+ margin now.
+
+2007-11-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXMenus.c: add "Run Widget Demo" menu item to the
+ default Edit menu along with associated carbon event handler enabling
+ the item only if demo files are installed; cleanup handling of "About"
+ and "Source" menu items.
+
+ * library/bgerror.tcl: fix background of detail text on Aqua.
+
+ * library/console.tcl: add accelerators and fix Aqua bindings
+ of the new font size menu items.
+
+ * library/demos/mclist.tcl: Aqua GOOBE.
+ * library/demos/tree.tcl:
+ * library/demos/ttknote.tcl:
+ * library/demos/widget:
+
+ * doc/chooseDirectory.n: remove/correct obsolete Mac OS 9-era
+ * doc/getOpenFile.n: information.
+ * doc/menu.n:
+
+ * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent): fix boolean
+ arg
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new demo file.
+ * macosx/Wish.xcode/project.pbxproj:
+
+2007-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/console.tcl: Add menu item and key binding to adjust font.
+
+2007-11-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/demos/mclist.tcl: Added a demo of how to do a multi-column
+ sortable listbox.
+
+ * library/msgbox.tcl: Made message dialog use Ttk widgets for better
+ L&F.
+
+ * library/tkfbox.tcl (::tk::dialog::file::CompleteEnt): Added <Tab>
+ completion. [FR 805091]
+ * library/tkfbox.tcl: Made file dialog use Ttk widgets for better L&F.
+
+ * library/demos/sayings.tcl: Better resizing. [Bug 1822410]
+
+2007-11-01 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/textpeer.tcl: Better resizing. [Bug 1822601]
+
+ * doc/colors.n: Added list of Windows system colors. [Bug 945409]
+
+2007-11-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXColor.c (GetThemeColor): improve translation of RGB
+ pixel values into RGBColor.
+
+ * library/demos/widget: increase height of main window text widget to
+ use more of the available vertical space.
+
+ * doc/bind.n: document the Option modifier, clarify meaning
+ and availability of Command & Option.
+
+ * doc/console.n: clarify availability of [console] in TkAqua.
+
+2007-11-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * unix/installManPage, doc/*.n: Make documentation use the name that
+ scripts use as much as possible. [Bug 1640073]
+
+ * doc/text.n: Fixed mistake in [$t tag remove] docs. [Bug 1792191]
+
+ * doc/bind.n: Documented the Command modifier. [Bug 1232908]
+
+ * doc/console.n, doc/wish.1: Made it clearer when and why the console
+ command is present. [Bug 1386955]
+
+2007-10-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/entry3.tcl: Improved description/comments so that
+ people better understand what is being validated, following suggestion
+ from Don Porter.
+
+ * library/demos/image2.tcl (loadImage): Mark non-loadable images as
+ such instead of throwing a nasty dialog, following suggestion from Don
+ Porter.
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock): More optimization, derived
+ from [Patch 224066].
+
+2007-10-30 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl (Unpost): BUGFIX: Unpost can be called with
+ no preceding Post.
+
+2007-10-31 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/rules.vc: Use -fp:strict with msvc8 as -fp:precise fails on
+ * generic/tkObj.c: amd64 builds. Fix the two places in Tk that
+ * generic/tkTrig.c: generate errors with msvc8 when using this flag.
+
+2007-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/choosedir.tcl: only enable OK button when valid in
+ conjunction with -mustexist. [Bug 1550528]
+
+ * library/listbox.tcl (::tk::ListboxBeginSelect): ignore -takefocus
+ when considering focus on <1>, it is for tab focus.
+
+2007-10-30 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump version number to 8.5b2.1 to distinguish
+ * library/tk.tcl: CVS development snapshots from the 8.5b2
+ * unix/configure.in: release.
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
+2007-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n: fix spelling of -inactiveselectbackground [Bug 1626415]
+
+ * library/entry.tcl: don't error with Clear event. [Bug 1509288]
+
+ * library/ttk/fonts.tcl: use size -12 TkFixedFont (was -10) on X11
+
+2007-10-30 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/unicodeout.tcl: Fixed Arabic and Hebrew rendering on
+ Windows. [Bug 1803723]
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Rename enumeration for somewhat
+ simpler-to-read code. [Bug 1677613]
+
+2007-10-30 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkWidget.c: Split up RedisplayWidget() to factor out
+ double-buffering related code.
+
+ * macosx/ttkMacOSXAquaTheme.c: Use SetThemeBackGround/
+ kThemeBrushModelessDialogBackground{Active|Inactive} instead of
+ ApplyThemeBackground/kThemeBackgroundWindowHeader (advice from DAS).
+
+ * library/ttk/aquaTheme.tcl: Use darker shade for inactive and
+ disabled text, to match typical values of most
+ kThemeXXXTextColorInactive values.
+
+2007-10-30 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/selection.n: Clarify UTF8_STRING handling. [Bug 1778563]
+
+ * doc/text.n: Clarify search subccommand docs. [Bug 1622919]
+
+2007-10-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXFont.c (InitSystemFonts):
+ * library/ttk/fonts.tcl: use Monaco 11 (was 9) as Aqua TkFixedFont
+
+ * tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test:
+ * library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl:
+ * library/msgbox.tcl, library/optMenu.tcl, library/tclIndex:
+ * library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt:
+ * library/demos/tcolor, library/demos/text.tcl:
+ * library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look
+ * library/ttk/fonts.tcl: Update of Tk default look in 8.5
+ * macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look
+ * unix/tkUnixDefault.h: with minor modifications for Win32/Aqua.
+ * win/tkWinDefault.h: Uses Tk*Font definitions throughout for
+ * win/tkWinFont.c: classic widgets. [Bug 1820344]
+ * library/obsolete.tcl (::tk::classic::restore): This restores
+ changes made to defaults in 8.5 using the 'option' command,
+ segmented into logical groups.
+
+ * tests/winfo.test: winfo-4.5 raise .t to above . for Windows
+
+ * tests/unixWm.test: note TIP#142 results and remove unnecessary
+ catches.
+
+2007-10-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/*.1, doc/*.n, doc/*.3: Lots more GOOBE work.
+
+2007-10-28 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: Make popdown window [wm resizable 0 0] on
+ OSX, to prevent TkAqua from shrinking the scrollbar to make room for a
+ grow box that isn't there.
+ * macosx/ttkMacOSXTheme.c, library/ttk/aquaTheme.tcl: Reworked
+ combobox layout.
+
+2007-10-26 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5b2 TAGGED FOR RELEASE ***
+
+ * changes: Update changes for 8.5b2 release.
+
+ * doc/*.1: Revert doc changes that broke
+ * doc/*.3: `make html` so we can get the release
+ * doc/*.n: out the door.
+
+ * README: Bump version number to 8.5b2.
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+2007-10-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class
+ of transient toplevels that are not also overrideredirect. [Bug
+ 1816252]
+
+ * macosx/tkMacOSXDialog.c: TIP#242 cleanup.
+ * library/demos/filebox.tcl: demo TIP#242 -typevariable.
+
+2007-10-25 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkNotebook.c: [Bug 1817596]
+
+2007-10-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/getOpenFile.n: TIP#242 implementation of -typevariable to
+ * library/tkfbox.tcl: return type of selected file in file dialogs.
+ * library/xmfbox.tcl: [Bug 1156388]
+ * macosx/tkMacOSXDialog.c:
+ * tests/filebox.test:
+ * tests/winDialog.test:
+ * win/tkWinDialog.c:
+
+2007-10-25 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkPlace.c: Prevent segfault in place geometry manager.
+ Thanks to Colin McDonald. [Bug 1818491]
+
+2007-10-24 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/*.c, win/{ttkWinMonitor,ttkWinTheme,ttkWinXPTheme}.c,
+ * macosx/ttkMacOSXTheme.c: Move widget layout registration from
+ TtkElements_Init() to widget *_Init() routines. Renaming/consistency:
+ s/...ElementGeometry()/...ElementSize()/
+
+2007-10-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/*.n, doc/*.3, doc/*.1: Lots of changes to take advantage of the
+ new macros.
+
+2007-10-24 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinDraw.c: Applied [Patch 1723362] for transparent bitmaps.
+
+ * generic/tkWindow.c: permit wm manage of any widget (esp: ttk::frame)
+
+2007-10-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/ttk/combobox.tcl (ttk::combobox::PopdownWindow): redo wm
+ transient on each drop to handle reparent-able frames. [Bug 1818441]
+
+2007-10-23 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: [namespace import ::ttk::scrollbar]
+ doesn't work, since ttk::scrollbar isn't [namespace export]ed.
+
+2007-10-23 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/cursor.test: Make tests robust against changes in Tcl's
+ rules for accepting integers in octal format.
+
+2007-10-23 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * doc/font.n: Added section on the TIP#145 fonts.
+
+2007-10-23 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinFont.c: Fixed leak in CreateNamedFont spotted by das.
+
+2007-10-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/demos/combo.tcl: Aqua GOOBE.
+ * library/demos/toolbar.tcl:
+ * library/demos/tree.tcl:
+ * library/demos/ttknote.tcl:
+ * library/demos/ttkprogress.tcl:
+ * library/demos/widget:
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
+ * macosx/Wish.xcode/project.pbxproj:
+
+2007-10-22 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/widget: Added more demos, reorganized to make Tk and
+ Ttk demos seem to be more coherent whole. Made localization a bit
+ easier by reducing the amount of duplication.
+ * library/demos/{combo,toolbar,tree,ttknote,ttkprogress}.tcl: New
+ demos of new (mostly) Ttk widgets.
+ * library/demos/ttkbut.tcl: Improvements.
+
+2007-10-22 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: ttk::combobox overhaul; fixes [Bugs
+ 1814778, 1780286, 1609168, 1349586]
+ * library/ttk/aquaTheme.tcl: Factored out aqua-specific combobox
+ -postposition adjustments.
+ * generic/ttk/ttkTrack.c: Detect [grab]s and unpress pressed
+ element; combobox workaround no longer
+ needed.
+
+2007-10-22 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXFont.c: register named fonts for TIP #145 fonts
+ and all theme font IDs.
+
+ * generic/tkFont.c (Tk{Create,Delete}NamedFont): allow NULL interp.
+
+ * library/ttk/fonts.tcl: check for TIP #145 fonts on all
+ platforms; correct aqua font sizes.
+
+ * library/demos/ttkmenu.tcl: Aqua GOOBE.
+ * library/demos/ttkpane.tcl:
+ * library/demos/widget:
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
+ * macosx/Wish.xcode/project.pbxproj:
+
+2007-10-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/ttkmenu.tcl: Added more demos of Ttk widgets. These
+ * library/demos/ttkpane.tcl: ones are of menubuttons, panedwindows and
+ a progress bar (indirectly).
+
+2007-10-18 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/fonts.tcl: Create all the TIP #145 font names on all
+ platforms (mac and unix get handled in script, windows in C)
+
+2007-10-17 David Gravereaux <davygrvy@pobox.com>
+
+ * bitmaps/*.xbm: Changed CVS storage mode from -kb to -kkv as these
+ are really text files, not binaries.
+ * win/makefile.vc: Added $(BITMAPDIR) to the search path for the
+ depend target.
+
+2007-10-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/demos/widget: Aqua GOOBE, cleanup icons.
+ * library/demos/ttkbut.tcl:
+ * library/demos/entry3.tcl:
+ * library/demos/msgbox.tcl:
+
+ * library/demos/button.tcl: restore setting of button
+ highlightbackground on Aqua.
+
+ * macosx/ttkMacOSXTheme.c: adjust button and separator geometry.
+
+ * macosx/tkMacOSXWm.c: fix warnings.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new demo files.
+ * macosx/Wish.xcode/project.pbxproj:
+
+2007-10-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/ttkbut.tcl: Added demo of the basic Ttk widgets.
+
+2007-10-16 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: depend target now works and builds a generated
+ dependency list with $(TCLTOOLSDIR)/mkdepend.tcl
+
+2007-10-16 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/widget: Made the code for generating the contents of
+ the main widget more informative. Added 'new' flagging for wholly new
+ demos.
+
+ * doc/text.n: Made it clearer what things are text widget invokations
+ and what are not. Also some other clarity improvements.
+
+2007-10-15 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/widget: Use Ttk widgets for the widget demo core, for
+ vastly improved look-and-feel on at least one platform (Windows).
+ * library/demos/{button,check,style,twind}.tcl: Various tweaks for
+ GOOBE...
+ * library/demos/textpeer.tcl: New demo script to show off peering as a
+ specific feature.
+
+2007-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkFocus.c, generic/tkFrame.c, generic/tkInt.h:
+ * macosx/tkMacOSXButton.c, macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXWm.c, unix/tkUnixWm.c, win/tkWinWm.c:
+ * doc/wm.n, tests/wm.test: TIP #125 implementation. [Bug 998125]
+ Adds [wm manage|forget] for dockable frames.
+ Finished X11 and Windows code, needs OS X completion.
+
+2007-10-15 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c: Store pointer to column table entry
+ instead of column index in columnNames hash table. This avoids the
+ need for the evil PTR2INT and INT2PTR macros, and simplifies things a
+ bit.
+
+2007-10-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkArgv.c: Fix gcc warnings about 'cast to/from
+ * generic/tkCanvUtil.c: pointer from/to integer of different
+ * generic/tkCanvas.c: size' on 64-bit platforms by casting
+ * generic/tkCursor.c: to intermediate types
+ * generic/tkInt.h: intptr_t/uintptr_t via new PTR2INT(),
+ * generic/tkListbox.c: INT2PTR(), PTR2UINT() and UINT2PTR()
+ * generic/tkObj.c: macros.
+ * generic/tkStyle.c:
+ * generic/tkTextIndex.c:
+ * generic/tkUtil.c:
+ * generic/ttk/ttkTheme.h:
+ * generic/ttk/ttkTreeview.c:
+ * unix/tkUnixMenu.c:
+ * unix/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+ * macosx/Wish-Common.xcconfig: add 'tktest-X11' target.
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.xcode/default.pbxuser:
+ * macosx/Wish.xcodeproj/default.pbxuser:
+ * macosx/Wish.xcodeproj/project.pbxproj:
+
+ * unix/configure.in (Darwin): add support for 64-bit X11.
+ * unix/configure: autoconf-2.59
+
+2007-10-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure, win/configure.in (TK_WIN_VERSION): Make sure the
+ patchlevel doesn't contain extra dotted pairs (eg. interim release)
+
+2007-10-12 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Mine all version information from headers.
+ * win/rules.vc: Sync tcl and tk and bring extension versions
+ * win/nmakehlp.c: closer together. Try and avoid using tclsh
+ to do substitutions as we may cross compile.
+
+ * library/console.tcl: Use TkFixedFont and ttk widgets
+
+2007-10-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDraw.c: replace all (internal) use of QD region
+ * macosx/tkMacOSXSubwindows.c: API by HIShape API, with conversion to
+ * macosx/tkMacOSXWindowEvent.c: QD regions only when required by legacy
+ * macosx/tkMacOSXPrivate.h: Carbon or Tk API.
+ * macosx/tkMacOSXRegion.c:
+ * macosx/tkMacOSXDebug.c:
+ * macosx/tkMacOSXDebug.h:
+
+ * macosx/tkMacOSXInt.h: replace MacDrawable's QD RgnHandles
+ * macosx/tkMacOSXEmbed.c: clipRgn, aboveClipRgn & drawRgn by
+ * macosx/tkMacOSXMenu.c: HIShapeRefs visRgn & aboveVisRgn and
+ * macosx/tkMacOSXSubwindows.c: CGRect drawRect.
+
+ * macosx/tkMacOSXWindowEvent.c: remove use of QD port vis rgn in
+ * macosx/tkMacOSXSubwindows.c: window update rgn calculation,
+ * macosx/tkMacOSXWm.c: manually excise growbox from toplevel
+ clip rgn instead.
+
+ * macosx/tkMacOSXDraw.c: replace use of QD port clip rgn by new
+ * macosx/tkMacOSXPrivate.h: clipRgn fld in TkMacOSXDrawingContext;
+ handle QD/CG drawing mismatches in
+ XCopyArea, XCopyPlane and TkPutImage;
+ cleanup/speedup CGContext setup in
+ TkMacOSXSetupDrawingContext().
+
+ * macosx/tkMacOSXDraw.c: change TkMacOSXSetupDrawingContext()
+ * macosx/tkMacOSXEntry.c: to return boolean indicating whether
+ * macosx/tkMacOSXFont.c: drawing is allowed (and was setup) or
+ * macosx/tkMacOSXMenu.c: not (e.g. when clipRgn is empty).
+ * macosx/ttkMacOSXTheme.c:
+
+ * macosx/tkMacOSXSubwindows.c: signal that drawable is a pixmap via
+ * macosx/tkMacOSXInt.h: new explicit TK_IS_PIXMAP flag instead
+ of a NULL cligRgn field.
+
+ * macosx/tkMacOSXRegion.c: add wrappers for missing/buggy HIShape
+ * macosx/tkMacOSXPrivate.h: API, and private helpers to operate on
+ HIShapeRefs & convert to/from TkRegion
+
+ * macosx/tkMacOSXRegion.c: add Tkp{Retain,Release}Region() API
+ * macosx/tkMacOSXInt.h: for TkRegion.
+
+ * xlib/xgc.c: factor out alloc/free of GC clip_mask;
+ * macosx/tkMacOSXXStubs.c: manage clip rgn lifetime with new
+ Tkp{Retain,Release}Region().
+
+ * macosx/tkMacOSXButton.c: delay picParams setup until needed.
+
+ * generic/tkTextDisp.c (CharUndisplayProc): fix textDisp.test crash.
+
+2007-10-11 David Gravereaux <davygrvy@pobox.com>
+
+ * win/winMain.c: Replaced incorrect comments in main() to descibe why
+ the console widget does not need to be created for this application
+ entry point (if used). Must have been a bad copy/paste of WinMain()
+ from 10 years back.
+
+2007-10-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): manually constrain resize
+ limitBounds to maxBounds, works around SectRect() mis-feature (return
+ zero rect if input rect has zero height/width). [Bug 1810818]
+
+2007-10-09 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkImage.c: Make Ttk_GetImage safe if called with NULL
+ * tests/ttk/image.test: interp. Added some tests that crash on Windows
+ without this fix.
+
+2007-10-02 Don Porter <dgp@users.sourceforge.net>
+
+ [core-stabilizer-branch]
+
+ * README: Bump version number to 8.5.0
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in: Updated LOCALES.
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
+2007-09-30 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/entry.tcl (WordBack, WordForward):
+ Fix private routines accidentally defined in global namespace
+ [Bug 1803836]
+
+2007-09-26 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/msgs/hu.msg: Added Hungarian message set, from Pader Reszo.
+ [Patch 1800742]
+
+2007-09-20 Donal K. Fellows <dkf@users.sf.net>
+
+ *** 8.5b1 TAGGED FOR RELEASE ***
+
+ * generic/tkTextDisp.c (LayoutDLine): Only call callbacks that are
+ * tests/textDisp.test (textDisp-32.3): not NULL. [Bug 1791052]
+
+2007-09-20 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: updates for 8.5b1 release.
+
+2007-09-19 Don Porter <dgp@users.sourceforge.net>
+
+ * README: Bump version number to 8.5b1.
+ * generic/tk.h: Merge from core-stabilizer-branch.
+ * library/tk.tcl: Stabilizing toward 8.5b1 release now done
+ * unix/configure.in: on the HEAD. core-stabilizer-branch is
+ * unix/tk.spec: now suspended.
+ * win/configure.in:
+
+2007-09-19 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkStubLib.: Replaced isdigit with internal implementation.
+
+2007-09-18 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkStubLib.c: Remove C library calls from Tk_InitStubs()
+ * win/makefile.vc: so that we don't need the C library linked
+ in to libtkStub.
+
+2007-09-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgGIF.c (FileReadGIF, StringReadGIF): Rewrite for greater
+ clarity (more comments, saner code arrangement, etc.)
+
+2007-09-18 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/all.tcl: Made ttk/all.tcl be the same as tk's all.tcl and
+ * tests/ttk/all.tcl: make use of file normalize (bugs noted by
+ mjanssen and GPS with msys)
+
+2007-09-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Add crt flags for tkStubLib now it uses C-library
+ functions.
+
+2007-09-17 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable' to
+ build shared libraries on current NetBSDs. [Bug 1749251]
+ * unix/configure: regenerated (autoconf-2.59).
+
+2007-09-17 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Revised callers of Tcl_InitStubs() to account
+ * generic/tkMain.c: for restored compatible support for the call
+ * generic/tkWindow.c: Tcl_InitStubs(interp, TCL_VERSION, 1). Also
+ revised Tcl_PkgRequire() call for Tcl so that, for example, a Tk
+ library built against Tcl 8.5.1 headers will not refuse to [load] into
+ a Tcl 8.5.0 interpreter. [Tcl Bug 1578344]
+
+ * generic/tk.h: Revised Tk_InitStubs() to restore Tk 8.4
+ * generic/tkStubLib.c: source compatibility with callers of
+ * generic/tkWindow.c: Tk_InitStubs(interp, TK_VERSION, 1).
+
+2007-09-17 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: Try to improve combobox appearance on
+ OSX + Tk 8.5. [Bug 1780286]
+
+2007-09-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: replace all direct references to compiler by ${CC} to
+ enable CC overriding at configure & make time; run
+ check for visibility "hidden" with all compilers;
+ quoting fixes from TEA tcl.m4.
+ (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by
+ 'cc' compiler driver.
+ * unix/configure: autoconf-2.59
+
+2007-09-14 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish-Common.xcconfig: enable Tcl DTrace support.
+ * macosx/Wish.xcodeproj/project.pbxproj:
+
+2007-09-12 Andreas Kupries <andreask@activestate.com>
+
+ * win/Makefile.in (install-binaries): Fixed missing brace in the
+ * win/makefile.vc (install-binaries): generated package index file.
+ Note: unix/Makefile.in is good.
+
+2007-09-11 Reinhard Max <max@suse.de>
+
+ * generic/tkImgGIF.c: Fixed a buffer overrun that got triggered by
+ multi-frame interlaced GIFs that contain subsequent frames that are
+ smaller than the first one.
+
+ * tests/imgPhoto.test: Added a test for the above.
+
+2007-09-11 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Revised calls to Tcl_InitStubs() and
+ * generic/tkMain.c: [package require Tcl] so that Tk Says What It
+ * generic/tkWindow.c: Means using the new facilties of [package] in
+ * library/tk.tcl: Tcl 8.5 about what version(s) of Tcl it is
+ * unix/Makefile.in: willing to work with. [Bug 1578344]
+ * win/Makefile.in:
+ * win/makefile.vc:
+
+2007-09-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/README: typo corrections [Bug 1788682]
+
+2007-09-10 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Revise all Tcl_InitStubs() calls to restore
+ * generic/tkMain.c: the traditional practice that a Tk shared
+ * generic/tkWindow.c: library may [load] into a Tcl 8.5 interp at
+ any patchlevel. This practice also matches the compile time checks of
+ TCL_MAJOR_VERSION and TCL_MINOR_VERSION in tk.h. [Bug 1723622]
+
+2007-09-06 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkWindow.c (Initialize): Moved common Tk initialization
+ * generic/tkInitScript.h (removed): script out of tkInitScript.h
+ * macosx/tkMacOSXInit.c: and multiple TkpInit() routines and
+ * unix/Makefile.in: into the common Initialize() routine in
+ * unix/tkUnixInit.c: generic code. Also removed constraint on
+ * win/tkWinInit.c: ability to define a custom [tkInit] before
+ calling Tk_Init(). Until now the custom [tkInit] had to be a proc. Now
+ it can be any command. Removal of tkInitScript.h also fixes [Bug
+ 1656283].
+
+2007-09-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcode/project.pbxproj: discontinue unmaintained support
+ * macosx/Wish.xcode/default.pbxuser: for Xcode 1.5; replace by Xcode2
+ project for use on Tiger (with Wish.xcodeproj to be used on Leopard).
+
+ * macosx/Wish.xcodeproj/project.pbxproj: updates for Xcode 2.5 and 3.0.
+ * macosx/Wish.xcodeproj/default.pbxuser:
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.xcode/default.pbxuser:
+ * macosx/Wish-Common.xcconfig:
+
+ * macosx/README: document project changes.
+
+2007-09-04 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkTest.c: Fix for [Bug 1788019] "tkTest.c compiler warning".
+
+2007-09-04 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: It's unreliable to count on the release
+ manager to remember to `make genstubs` before `make dist`. Let the
+ Makefile remember the dependency for us.
+
+ * unix/Makefile.in: Corrections to `make dist` dependencies to be
+ sure that macosx/configure gets generated whenever it does not exist.
+
+2007-09-03 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/ttk/ttkInit.c (Ttk_Init): register ttk in package database
+ to enable extension access to the ttkStubs table.
+
+ * generic/ttk/ttkDecls.h: correct capitalization of ttk package name.
+
+2007-08-28 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ Assorted documentation improvements.
+ * doc/button.n: Added examples.
+ * doc/checkbutton.n: Added example.
+ * doc/console.n: Standardized section ordering.
+ * doc/tk.n: Added "See also".
+ * doc/ttk_combobox.n: Added keywords.
+
+2007-08-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDialog.c (Tk_ChooseColorObjCmd): correct setting of
+ interp result [Bug 1782105]; fix -initialcolor overwriting last color
+ selection; style cleanup.
+
+2007-08-21 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/rules.vc: Synchronize with tcl rules.vc
+ * tests/all.tcl: Fix the line-endings.
+
+2007-08-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: Add support for compile flags specific to
+ object files linked directly into executables.
+
+ * unix/configure.in (Darwin): Only use -seg1addr flag when prebinding;
+ use -mdynamic-no-pic flag for object files linked directly into exes.
+
+ * unix/configure: autoconf-2.59
+
+2007-08-01 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinDialog.c: Fix [Bug 1692927] (buffer length problems)
+ * win/tkWinTest.c: Added 'testfindwindow' and 'testgetwindowinfo'
+ and extended 'testwinevent' for WM_COMMAND support to enable testing
+ native messagebox dialogs.
+ * tests/winMsgbox.test: New Windows native messagebox tests.
+
+2007-07-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDialog.c (NavServicesGetFile): Reset interp result on
+ nav dialog cancel. [Bug 1743786]
+
+2007-07-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in: clarify what the headers installed are, and
+ add ttkTheme.h and ttkDecls.h to private headers (later public).
+
+2007-07-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWindowEvent.c (Tk_MacOSXIsAppInFront): Use process mgr
+ * macosx/tkMacOSXMouseEvent.c: to determine if
+ app is in front instead of relying on activate/deactivate events (which
+ may arrive after this info is needed, e.g. during window drag/click
+ activation); replace other process mgr use to get this info with calls
+ to Tk_MacOSXIsAppInFront().
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): Correct
+ window click activation, titlebar click handling and background window
+ dragging/growing in the presence of grabs or window-/app-modal windows;
+ fix window click activation bringing all other app windows to front.
+
+ * macosx/tkMacOSXDraw.c (TkPutImage): Handle non-native XImage byte and
+ bit orders; reverse bits via xBitReverseTable instead of InvertByte().
+
+2007-07-06 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/aquaTheme.tcl: Set -anchor w for TMenubuttons.
+ [Bug 1614540]
+
+2007-07-04 Andreas Kupries <andreask@activestate.com>
+
+ * macosx/tkMacOSXXStubs.c (DestroyImage): Fixed seg.fault in release
+ of image data for images coming from XGetImage. Change committed by me
+ for Daniel Steffen. See 2007-06-23 for the change which introduced the
+ problem.
+
+2007-07-02 Daniel Steffen <das@users.sourceforge.net>
+
+ * xlib/xgc.c (XCreateGC): Correct black and white pixel values used to
+ initialize GC foregrund and background fields.
+
+ * macosx/tkMacOSXColor.c: Add debug messages for unknown pixel values.
+
+ * macosx/tkMacOSXDraw.c (TkMacOSXRestoreDrawingContext): Don't restore
+ port state if it wasn't altered by TkMacOSXSetupDrawingContext().
+
+2007-06-29 Daniel Steffen <das@users.sourceforge.net>
+
+ * xlib/ximage.c: Bitmaps created from the static .xbm
+ arrays always have LSBFirst bit order.
+
+ * unix/configure.in: Fix flag used to weak-link libXss.
+ * unix/configure: autoconf-2.59
+
+ * macosx/tkMacOSXScrlbr.c: Correct int <-> dobule conversion issues
+ that could lead to Carbon getting confused about scrollbar thumb size.
+
+ * macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage): Use
+ TkMacOSX{Setup,Restore}DrawingContext() to setup/restore clip & colors.
+ (TkMacOSXSetupDrawingContext, TkMacOSXRestoreDrawingContext): Add save
+ and restore of QD port clip region; factor out clip region code common
+ to CG and QD branches; check for port and context validity; handle
+ tkPictureIsOpen flag during QD port setup.
+ (TkScrollWindow): Remove unnecessary scroll region manipulation
+
+ * macosx/tkMacOSXDraw.c: Remove second global QD temp region
+ * macosx/tkMacOSXInt.h: (no longer necessary) and rename
+ * macosx/tkMacOSXRegion.c: remaining global QD temp region.
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+
+ * macosx/tkMacOSXDraw.c: Make useCGDrawing variable MODULE_SCOPE
+ * macosx/tkMacOSXFont.c: and respect it for ATSUI font drawing.
+
+ * macosx/tkMacOSXButton.c: Reduce reliance on current QD port
+ * macosx/tkMacOSXColor.c: setting and remove unnecessary
+ * macosx/tkMacOSXDebug.c: references to a drawable's QD port,
+ * macosx/tkMacOSXDebug.h: notably replace GetWindowFromPort(
+ * macosx/tkMacOSXDialog.c: TkMacOSXGetDrawablePort()) idiom by new
+ * macosx/tkMacOSXDraw.c: TkMacOSXDrawableWindow() and change
+ * macosx/tkMacOSXKeyEvent.c: TkMacOSXSetColorInPort() to take a port
+ * macosx/tkMacOSXMenu.c: argument.
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXInt.h: Factor out macros, declarations
+ * macosx/tkMacOSXPrivate.h (new): and prototypes that are purely
+ internal and private to the 'macosx' sources into a new internal header
+ file that does _not_ get installed into Tk.framework/PrivateHeaders.
+
+ * macosx/tkMacOSXButton.c: #include new tkMacOSXPrivate.h
+ * macosx/tkMacOSXCarbonEvents.c: instead of tkMacOSXInt.h.
+ * macosx/tkMacOSXClipboard.c:
+ * macosx/tkMacOSXColor.c:
+ * macosx/tkMacOSXCursor.c:
+ * macosx/tkMacOSXDebug.c:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXNotify.c:
+ * macosx/tkMacOSXRegion.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+ * macosx/ttkMacOSXTheme.c:
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Improve support for renamed
+ * macosx/Wish.xcodeproj/default.pbxuser: tcl and tk source dirs; add
+ * macosx/Wish-Common.xcconfig: 10.5 SDK build config; remove
+ tclMathOp.c.
+
+ * macosx/README: Document Wish.xcodeproj changes.
+
+2007-06-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkImgPhoto.c (ImgPhotoConfigureInstance, DisposeInstance):
+ Use XDestroyImage instead of XFree to destroy XImage; replace runtime
+ endianness determination by compile-time check for WORDS_BIGENDIAN.
+
+ * xlib/ximage.c (XCreateBitmapFromData): Use XCreateImage and
+ XDestroyImage instead of creating XImage structure manually.
+
+ * macosx/tkMacOSXXStubs.c (XCreateImage, DestroyImage): Correct XImage
+ bytes_per_line/bitmap_pad calculations and endianness setting; free
+ image data and XImage structure at destruction; formatting cleanup.
+
+ * macosx/tkMacOSXDialog.c (NavServicesGetFile): Disable app-modal
+ sheet variant of nav dialog on OS versions where it causes problems.
+
+2007-06-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/ttk/ttk.tcl: Should require Tk before pseudo-providing
+ tile 0.8.0.
+
+2007-06-09 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkPanedwindow.c, doc/ttk_panedwindow.n,
+ * tests/ttk/panedwindow.test: Added -width and -height options. Added
+ 'panes' method, return list of managed windows. 'sashpos' method is
+ now documented as part of the public interface, and details clarified.
+ Should be easier to set initial sash positions now. Alleviates [Bug
+ 1659067].
+
+2007-06-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (WmIconphotoCmd): fix wm iconphoto RGBA issues.
+ [Bug 1467997] (janssen)
+
+ * win/tkWinMenu.c (TkWinHandleMenuEvent): Improve handling to allow
+ for unicode char menu indices and not use CharUpper on Tcl utf
+ strings. [Bug 1734223]
+
+2007-06-09 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkManager.h, generic/ttk/ttkManager.c,
+ * generic/ttk/ttkNotebook.c, generic/ttk/ttkPanedwindow.c,
+ * generic/ttk/ttkFrame.c: Ttk_Manager API overhaul:
+ + Ttk_Manager no longer responsible for managing slave records
+ + Ttk_Manager structure now opaque
+ + Ttk_Slave structure now private
+ + Pass Ttk_Manager* to Tk_GeomMgr hooks instead of Ttk_Slave*
+
+ * generic/ttk/ttkFrame.c: Simplified -labelwidget management.
+
+ * doc/ttk_panedwindow.n, library/ttk/panedwindow.tcl: Changed
+ documentation of ttk::panedwindow 'identify' command to match
+ implementation.
+
+ * generic/ttk/ttkNotebook.c, tests/ttk/notebook.test:
+ BUGFIX: ttk::noteboook 'insert' command didn't correctly maintain
+ current tab.
+
+2007-06-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXColor.c: Fix issues with TK_{IF,ELSE,ENDIF} macros;
+ * macosx/tkMacOSXDraw.c: implement Jaguar equivalent of unavailable
+ * macosx/tkMacOSXEntry.c: kHIToolboxVersion global; panic at startup
+ * macosx/tkMacOSXEvent.c: if MAC_OS_X_VERSION_MIN_REQUIRED constraint
+ * macosx/tkMacOSXInit.c: is not satisfied.
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage)
+ (TkMacOSXSetupDrawingContext): Factor out common code and standardize
+ setup/restore of port, context and clipping; formatting cleanup.
+
+ * macosx/tkMacOSXWindowEvent.c: Add error checking.
+ * macosx/tkMacOSXMenu.c: Fix gcc3 warning.
+ * macosx/tkMacOSXScrlbr.c: Fix testsuite crash.
+ * macosx/tkMacOSXSubwindows.c: Formatting cleanup.
+ * macosx/tkMacOSXRegion.c: Fix typos.
+ * macosx/tkMacOSXScale.c:
+
+ * macosx/tkMacOSXXStubs.c (Tk_GetUserInactiveTime): Remove superfluous
+ CFRetain/CFRelease.
+
+ * macosx/Wish-Release.xcconfig: Disable tktest release build stripping.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Add new Tclsh-Info.plist.in.
+
+2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXInt.h: Use native debug message API when available.
+ * macosx/Wish-Debug.xcconfig:
+
+ * macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): Enable
+ processing of mousewheel events in background windows.
+
+ * macosx/tkMacOSXScrlbr.c: Modernize checks for active/front window.
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXColor.c: Factor out verbose #ifdef checks of
+ * macosx/tkMacOSXDraw.c: MAC_OS_X_VERSION_{MAX_ALLOWED,MIN_REQUIRED}
+ * macosx/tkMacOSXEntry.c: and runtime checks of kHIToolboxVersion into
+ * macosx/tkMacOSXEvent.c: new TK_{IF,ELSE,ENDIF}_MAC_OS_X macros.
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDraw.c: Factor out clip clearing in QD ports;
+ * macosx/tkMacOSXEntry.c: Formatting cleanup.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Add settings for Fix&Continue.
+
+ * unix/configure.in (Darwin): Link the Tk and Wish plists into their
+ binaries in all cases; fix 64bit arch removal in fat 32&64bit builds.
+
+ * unix/tcl.m4 (Darwin): Fix CF checks in fat 32&64bit builds.
+ * unix/configure: autoconf-2.59
+
+2007-06-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/photo.n: Clarified the fact that base64 support for the -data
+ option is not universal. [Bug 1731348] (matzek)
+
+2007-06-03 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: Add datarootdir to silence autoconf-2.6x warning.
+
+ * macosx/Wish.xcodeproj/default.pbxuser: Add ttk tests.
+
+ * macosx/tkMacOSXMenu.c: Add error checking; whitespace cleanup.
+
+ * macosx/tkMacOSXDraw.c: Comment formatting fixes for Xcode 3.0
+ * macosx/tkMacOSXEmbed.c:
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXKeyboard.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+
+2007-06-02 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXMenu.c (TkpPostMenu): Ensure cascade menus display in
+ posted menus that are not part of the menubar or attached to a
+ menubutton (fixes bug reported on tcl-mac by Linus Nyberg).
+
+2007-05-31 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWindowEvent.c (GenerateUpdateEvent): Complete all
+ pending idle-time redraws before newly posted Expose events are
+ processed; add bounds of redrawn windows to update region to ensure
+ all child windows overdrawn by parents are redrawn.
+
+ * macosx/tkMacOSXWindowEvent.c: Centralize clip and window invalidation
+ * macosx/tkMacOSXSubwindows.c: after location/size changes in the
+ * macosx/tkMacOSXWm.c: BoundsChanged carbon event handler;
+ correct/add window invalidation after window attribute changes.
+
+ * macosx/tkMacOSXSubwindows.c (XResizeWindow, XMoveResizeWindow)
+ (XMoveWindow): Factor out common code dealing with embedded and
+ non-toplevel windows; remove unnecessary clip and window invalidation.
+
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): Move clip setup closer
+ to native button drawing calls.
+
+ * macosx/tkMacOSXWm.c (TkMacOSXIsWindowZoomed, TkMacOSXZoomToplevel):
+ Correct handling of gridded windows in max size calculations.
+
+ * macosx/tkMacOSXEvent.c (TkMacOSXFlushWindows): Use HIWindowFlush API
+ when available.
+
+ * macosx/tkMacOSXColor.c: Cleanup whitespace and formatting.
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWm.c:
+
+ * generic/tkFont.c: #ifdef out debug msg printing to stderr.
+ * generic/tkTextDisp.c:
+
+2007-05-30 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Correct placement of #include <tcl.h>. [Bug 1723812]
+
+2007-05-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/bgerror.tcl: Standardize dialog option & button size
+ * library/dialog.tcl: modifications done when running on on Aqua.
+ * library/msgbox.tcl:
+
+ * library/demos/button.tcl: Set button highlightbackground on Aqua.
+
+ * macosx/tkMacOSXMenu.c (DrawMenuSeparator): Use DrawingContext API.
+
+ * macosx/tkMacOSXWindowEvent.c (ClearPort): Clip to updateRgn.
+
+ * macosx/tkMacOSXDebug.c: Factor out debug region flashing.
+ * macosx/tkMacOSXDebug.h:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+
+ * macosx/tkMacOSXEvent.c: Cleanup whitespace and formatting.
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXRegion.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+ * xlib/xgc.c:
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Delete references to removed
+ * macosx/Wish.xcodeproj/default.pbxuser: ttk files.
+
+2007-05-28 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext): Fix short measures
+ with flags=TK_WHOLE_WORDS|TK_AT_LEAST_ONE [Bug 1716141]. Make some
+ casts unnecessary by changing variable types.
+
+2007-05-25 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/ttk.tcl: Omit ttk::dialog and dependencies.
+ * library/ttk/dialog.tcl, library/ttk/icons.tcl,
+ * library/ttk/keynav.tcl: Removed.
+ * tests/ttk/misc.test: Removed.
+ * doc/ttk_dialog.tcl: Removed.
+
+2007-05-25 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/canvas.n: Fixed documentation of default -joinstyle option
+ values for line and polygon items. [Bug 1725782]
+
+2007-05-22 Don Porter <dgp@users.sourceforge.net>
+
+ [core-stabilizer-branch]
+
+ * unix/configure: autoconf-2.59 (FC6 fork)
+ * win/configure:
+
+ * README: Bump version number to 8.5b1
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+2007-05-18 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkEntry.c(EntrySetValue): Ensure that widget is in a
+ consistent state before setting the linked -textvariable. Previously,
+ it was possible for [$e index insert] to point past the end of the
+ string, leading to heap corruption. [Bug 1721532]
+ * tests/ttk/entry.test(entry-9.1): Add test case for the above.
+
+2007-05-18 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/configure: autoconf-2.59 (FC6 fork)
+ * win/configure:
+
+ * README: Bump version number to 8.5a7
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * tests/ttk/treetags.test: Another bit of test suite
+ SCIM-tolerance. [Bug 1609316]
+
+2007-05-17 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tk.decls: Workaround 'make checkstubs' failures from
+ tkStubLib.c MODULE_SCOPE revert. [Bug 1716117]
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Add tkOldTest.c and remove
+ tkStubImg.c.
+
+2007-05-16 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkStubLib.c: Change Tk_InitStubs(), tkStubsPtr, and the
+ auxilliary stubs table pointers back to public visibility. See [Bug
+ 1716117] for details.
+
+ Removed TCL_STORAGE_CLASS monkey business, as it had no effect.
+
+2007-05-16 Don Porter <dgp@users.sourceforge.net>
+
+ * library/choosedir.tcl: Removed uses of obsolete {expand}
+ * library/comdlg.tcl: syntax; replaced with the now
+ * library/tk.tcl: approved {*}. [Bug 1710633]
+ * tests/canvImg.test:
+ * tests/imgPhoto.test:
+
+ * tests/bind.test: Make test suite more SCIM-tolerant. [Bug 1609316]
+
+2007-05-16 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Test ttk widgets.
+
+2007-05-15 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: Fix crash introduced by previous fix exposed
+ under newer fontconfig libraries [Bug 1717830] again.
+
+2007-05-15 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkGrid.c: Stop crash due to list intrep shimmer [Bug 1677608]
+
+2007-05-15 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: Fix various memory leaks. [Bug 1717830], [Bug
+ 800149]
+
+2007-05-14 Don Porter <dgp@users.sourceforge.net>
+
+ [Tk Bug 1712081]
+
+ * unix/Makefile.in: Updates to account for new and deleted files
+ * win/Makefile.in: tkStubImg.c and tkOldTest.c.
+ * win/makefile.bc:
+ * win/makefile.vc:
+
+ * generic/tkOldTest.c (new): New file used to create testing
+ * generic/tkTest.c: commands for testing various Tk
+ * tests/constraints.tcl: legacy interfaces where a separate
+ * tests/image.test: compilation unit is needed in order to
+ #define suitable macros during compilation. Only the effect of
+ USE_OLD_IMAGE on Tk_CreateImageType() is currently tested, but more
+ similar testing commands can be added to this same file. New
+ constraint defined to detect presence of the image type provided by
+ the new testing code, and a few tests added to exercise it. Having
+ USE_OLD_IMAGE support tested by the default test suite should reduce
+ chance of a recurrence of this bug.
+
+ * doc/CrtImgType.3: Revised docs to better indicate the legacy
+ * doc/CrtPhImgFmt.3: nature of the interfaces supported by
+ USE_OLD_IMAGE.
+
+ * generic/tkDecls.h: make genstubs
+ * generic/tkStubInit.c:
+
+ * generic/tk.decls: Reworked USE_OLD_IMAGE support to use
+ * generic/tk.h: the same support mechanisms both with
+ * generic/tkStubImg.c (deleted):and without a stub-enabled build. In
+ each case, route the legacy calls to Tk_CreateImageType and
+ Tk_CreatePhotoImageFormat through the Tk_CreateOldImageType and
+ Tk_CreateOldPhotoImageFormat routines. Add those routines to the
+ public stub table so they're available to a stub-enabled extension.
+ Remove the definition of Tk_InitImageArgs() and use a macro to convert
+ any calls to it in source code into a comment.
+
+ * generic/tkImage.c: Removed the MODULE_SCOPE declarations that
+ * generic/tkImgPhoto.c: broke USE_OLD_IMAGE support.
+
+2007-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/winButton.test: Avoid font dependencies in results.
+
+ * generic/tkFont.c: propagate error from TkDeleteNamedFont. [Bug
+ 1716613]
+
+2007-05-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkFileFilter.c (AddClause): OSType endianness fixes.
+
+ * library/palette.tcl (tk::RecolorTree): Handle color options with
+ empty value, fixes error due to emtpy -selectforeground (reported on
+ tcl-mac by Russel E. Owen).
+
+ * macosx/tkMacOSXWindowEvent.c: Ensure window is brought to the front
+ * macosx/tkMacOSXMouseEvent.c: at the start of a window drag (except
+ * macosx/tkMacOSXInt.h: when cmd key is down); formatting and
+ whitespace fixes.
+
+ * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd): Add -filetypes option
+ processing (fixes fileDialog-0.1, fileDialog-0.2 failures).
+
+ * macosx/tkMacOSXEmbed.c (TkpMakeWindow, TkpUseWindow): Fix sending of
+ Visibility event for embedded windows (fixes frame-3.9 hang).
+
+ * macosx/tkMacOSXScrlbr.c (ScrollbarBindProc): Fix testsuite
+ * macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): crashes by
+ adding sanity checks.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Add 'DebugUnthreaded' &
+ * macosx/Wish.xcodeproj/default.pbxuser: 'DebugLeaks' targets and env
+ var settings needed to run the 'leaks' tool.
+
+ * macosx/tkMacOSXButton.c: Fix debug msg typo.
+
+ * tests/constraints.tcl: Ensure 'nonUnixUserInteraction' constraint is
+ set for aqua.
+
+ * tests/choosedir.test: Add 'notAqua' constraints to X11-only tests;
+ * tests/clrpick.test: add 'nonUnixUserInteraction' to 'unix' tests
+ * tests/menuDraw.test: requiring interaction on aqua.
+ * tests/unixMenu.test:
+ * tests/unixWm.test:
+ * tests/winMenu.test:
+
+2007-05-07 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: Properly cast sentinel arguments to variadic
+ function (fixes "warning: missing sentinel in function call", [Bug
+ 1712001])
+
+2007-05-04 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkFont.c: TIP #145 implementation -
+ * generic/tkFont.h: Enhanced font handling.
+ * win/tkWinDefault.h:
+ * win/tkWinFont.c:
+ * win/tkWinInt.h:
+ * win/tkWinWm.c:
+ * library/demos/widget:
+ * library/ttk/fonts.tcl:
+
+2007-05-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/ttk_treeview.n, doc/ttk_panedwindow.n, doc/ttk_dialog.n:
+ * doc/ttk_checkbutton.n, doc/tk.n, doc/menu.n, doc/font.n:
+ * doc/canvas.n: Spelling fixes. [Bug 1686210]
+
+2007-05-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkStubLib.c (Tk_InitStubs):
+ * generic/ttk/ttkLabel.c (LabelSetup):
+ * unix/tkUnixSelect.c (ConvertSelection):
+ * unix/tkUnixEvent.c (TkUnixDoOneXEvent):
+ * generic/tkConfig.c (Tk_RestoreSavedOptions):
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd):
+ * generic/tkOption.c (GetDefaultOptions):
+ * unix/tkUnixRFont.c (TkpGetFontAttrsForChar, InitFont)
+ (TkpGetFontFamilies, TkpGetSubFonts):
+ * unix/tkUnixSend.c (TkpTestsendCmd, RegOpen): Squelch warnings from
+ GCC type aliasing. [Bug 1711985 and others]
+
+2007-04-29 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/configure.in: Fix for default case in tk debug build detection.
+ * unix/configure: autoconf-2.59
+
+2007-04-27 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c(TagOptionSpecs): Use TK_OPTION_STRING
+ instead of TK_OPTION_FONT to avoid resource leak in tag management.
+
+2007-04-26 Joe English <jenglish@users.sourceforge.net>
+
+ * macosx/ttkMacOSXTheme.c: Merged OFFSET_RECT processing into
+ BoxToRect(); factored out PatternOrigin; resynchronized with Tile
+ codebase.
+
+2007-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.5a6 TAGGED FOR RELEASE ***
+
+ * unix/Makefile.in (dist): Correct tests/ttk glob inclusion
+
+2007-04-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): Add tests/ttk dir to src dist
+
+ * unix/tkUnixMenubu.c (TkpDisplayMenuButton): Init width/height to 0
+
+2007-04-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in (dist): Add macosx/*.xcconfig files to src dist;
+ copy license.terms to dist macosx dir; fix autoheader bits.
+
+2007-04-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): Add ttk bits to src dist
+
+ * tests/font.test (font-46.[12]): Correct listification of result
+
+2007-04-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkCanvas.c: Allow -selectforeground option to be None; add
+ * generic/tkCanvText.c: fallback to fgColor when selFgColor is None
+ * generic/tkEntry.c: (new default on aqua to match native L&F).
+ * generic/tkListbox.c:
+ * generic/tkText.c:
+
+ * generic/tkCanvas.c: Add support for bypassing all of Tk's double
+ * generic/tkEntry.c: buffered drawing into intermediate pixmaps
+ * generic/tkFrame.c: (via TK_NO_DOUBLE_BUFFERING #define), it is
+ * generic/tkListbox.c: unnecessary & wasteful on aqua where all
+ * generic/tkPanedWindow.c: drawing is already double-buffered by the
+ * generic/tkTextDisp.c: window server. (Use of this on other
+ * generic/ttk/ttkWidget.c: platforms would only require implementation
+ * unix/tkUnixScale.c: of TkpClipDrawableToRect()).
+ * macosx/tkMacOSXPort.h:
+
+ * library/bgerror.tcl: On aqua, use moveable alert resp. modal dialog
+ * library/dialog.tcl: window class and corresponding system
+ background pattern; fix button padding.
+
+ * library/tearoff.tcl: Correct aqua menu bar height; vertically offset
+ * library/tk.tcl: aqua tearoff floating window to match menu.
+
+ * library/demos/goldberg.tcl: Fix overwriting of widget demo global.
+
+ * library/demos/menu.tcl: On aqua, use custom MDEF and tearoffs;
+ * library/demos/menubu.tcl: correct menubutton toplevel name.
+
+ * library/demos/puzzle.tcl: Fix button size & padding for aqua.
+ * library/demos/radio.tcl:
+
+ * macosx/tkMacOSXCarbonEvents.c: Add window event target carbon event
+ * macosx/tkMacOSXEvent.c: handler for all kEventClassWindow and
+ * macosx/tkMacOSXEvent.h: kEventClassMouse events; move all
+ * macosx/tkMacOSXNotify.c: remaining events except for
+ * macosx/tkMacOSXWindowEvent.c: kEventClassKeyboard from dispatcher to
+ application event handler; pass event handler callRef downstream; fix
+ debug event tracing; process all tcl event types in carbon event timer;
+ delay carbon event timer first fire; add TkMacOSXTrackingLoop() to mark
+ enter/exit of event tracking loop during which all tcl events but only
+ carbon update events should be processed by the timer (replaces various
+ calls to Tcl_SetServiceMode()); rename TkMacOSXReceiveAndProcessEvent()
+ to TkMacOSXReceiveAndDispatchEvent(), move it from tkMacOSXEvent.c to
+ tkMacOSXCarbonEvents.c and modify it to dequeue only update events
+ during a tracking loop; add TkMacOSXRunTclEventLoop() to standardize
+ the various ways in use to run the tcl event loop; add handling of
+ kEventClassAppearance events (for ScrollBarVariantChanged event).
+
+ * macosx/tkMacOSXDialog.c: Use new TkMacOSXTrackingLoop() around
+ * macosx/tkMacOSXEvent.c: blocking API that puts up modal dialogs
+ * macosx/tkMacOSXMenu.c: or when entering/exiting menu/control
+ * macosx/tkMacOSXMouseEvent.c: tracking, window dragging and other
+ * macosx/tkMacOSXScale.c: mouse tracking loops.
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDialog.c: Use new TkMacOSXRunTclEventLoop()
+ * macosx/tkMacOSXScale.c: instead of Tcl_DoOneEvent(),
+ * macosx/tkMacOSXScrlbr.c: Tcl_ServiceAll(), TclServiceIdle()
+ * macosx/tkMacOSXWindowEvent.c: and Tcl_GlobalEval("update idletasks").
+
+ * macosx/tkMacOSXColor.c: Make available as Tk system colors all
+ * macosx/tkMacOSXPort.h: appearance manager brushes, text colors and
+ backgrounds with new and legacy names, as well as the fully transparent
+ color "systemTransparent"; add TkMacOSXSetColorIn{Port,Context}() to
+ directly set an X pixel color value in the current QD port resp. the
+ given CG context without requiring passage through rgb representation
+ (lossy for most system colors); modernize/remove Classic-era code;
+ replace crufty strcmp() elseifs by Tcl_GetIndexFromObjStruct().
+
+ * macosx/tkMacOSXButton.c: Use new TkMacOSXSetColorInPort()
+ * macosx/tkMacOSXDraw.c: instead of setting rgb color directly
+ * macosx/tkMacOSXMenubutton.c: to allow for non-rgb system colors.
+
+ * macosx/tkMacOSXCursor.c: Implement "none" cursor as on other
+ platforms [Patch 1615427]; add all missing appearance manager cursors.
+
+ * macosx/tkMacOSXDefault.h: Set SELECT_FG_COLORs to None to match aqua
+ L&F; use standard system color names; use new 'menu' system font;
+ correct default scrollbar width.
+
+ * macosx/tkMacOSXDraw.c: Standardize initialization, use and
+ * macosx/tkMacOSXInt.h: emptying of various static temp rgns
+ * macosx/tkMacOSXRegion.c: onto two global RgnHandles; in debug
+ * macosx/tkMacOSXSubwindows.c: builds, verify emptiness of these temp
+ * macosx/tkMacOSXWindowEvent.c: rgns before use.
+
+ * macosx/tkMacOSXDraw.c: Add TkMacOSX{Setup,Restore}DrawingContext() to
+ * macosx/tkMacOSXInt.h: abstract common setup & teardown of drawing
+ environment (for both CG and QD); save/restore QD theme drawing state;
+ handle GC clip region; add TkpClipDrawableToRect() to allow clipped
+ drawing into drawable regardless of GC used; use new system color
+ "systemWindowHeaderBackground" to setup background in themed toplevels;
+ correct implementation of TkMacOSXMakeStippleMap().
+
+ * macosx/tkMacOSXEntry.c: Use new TkMacOSXSetupDrawingContext() and
+ * macosx/tkMacOSXFont.c: TkMacOSXRestoreDrawingContext() instead of
+ * macosx/ttkMacOSXTheme.c: various setup/teardown procs like
+ TkMacOSX{SetUp,Release}CGContext(), TkMacOSXQuarz{Start,End}Draw(),
+ TkMacOSXSetUpGraphicsPort() etc.
+
+ * macosx/tkMacOSXEmbed.c: Add CG context and drawable clip rgn fields
+ * macosx/tkMacOSXInt.h: to MacDrawable struct.
+ * macosx/tkMacOSXSubwindows.c:
+
+ * macosx/tkMacOSXDialog.c: Make -parent option of tk_getOpenFile et al.
+ use the sheet version of NavServices dialogs; ensure native parent win
+ exists before using StandardSheet API for tk_messageBox [Bug 1677611];
+ force sheets to behave like app-modal dialogs via WindowModality() API;
+ use more modern ColorPicker API.
+
+ * macosx/tkAboutDlg.r: Use themed movable modal dialog, fix (c) year.
+
+ * macosx/tkMacOSXEntry.c: Take xOff/yOff of MacDrawable into account
+ * macosx/ttkMacOSXTheme.c: when computing locations/bounds to ensure
+ correct posititioning when not drawing into intermediate pixmap.
+
+ * macosx/tkMacOSXFont.c: Use appearance manager API to map system font
+ * macosx/tkMacOSXFont.h: names to TkFonts; add "menu" system font for
+ menu item text drawing from MDEF; always draw with CG; remove QD
+ dependent stippling algorithm; move most header declarations into the
+ source file (as they were not used anywhere else).
+
+ * macosx/tkMacOSXMenu.c: Large-scale rewrite of custom
+ * macosx/tkMacOSXMenu.r (removed): MDEF and related code that
+ * macosx/Wish.xcode/project.pbxproj: restores many longtime-MIA
+ * macosx/Wish.xcodeproj/project.pbxproj: features to working order
+ * unix/Makefile.in: (e.g. images, custom colors &
+ fonts in menus etc); implement compound menu items; use Appearance Mgr
+ and ThemeText APIs to mimic native MDEF as closely as possible when
+ default "menu" system font is used; remove now obsolete SICN drawing
+ code and resources.
+
+ * macosx/tkMacOSXCarbonEvents.c: Handle additional menu carbon events
+ * macosx/tkMacOSXEvent.c: in order to support <<MenuSelect>> in
+ * macosx/tkMacOSXMenu.c: the menubar and in menus that are not
+ * macosx/tkMacOSXMenus.c: using the custom MDEF [Bug 1620826];
+ fix early and missing clearing of current Tk active menu entry; fix
+ extraneous sending of <<MenuSelect>> during active menu entry clearing.
+
+ * macosx/tkMacOSXMouseEvent.c: Add support for async window dragging by
+ the window server; set the corresponding window attribute by default.
+
+ * macosx/tkMacOSXMouseEvent.c: Rationalized handling order of
+ non-mousedown events; add TkMacOSXModifierState() to retrieve the
+ current key modifiers in carbon format.
+
+ * macosx/tkMacOSXScrlbr.c: Use appearance manager API to retrieve
+ scrollbar component metrics; add awareness of multiple possibilites for
+ scrollbar arrow position in aqua and handle user changes to arrow
+ position pref; handle difference in metrics of small & large scrollbar
+ variants; handle aqua "jump to here" scrollbar behaviour; correct
+ computation of scroll view size and position; enforce min scrollbar
+ height to avoid scrollbar component overlap; erase scrollbar area
+ outside of standard width; remove broken auto-adjust code; account for
+ window class when leaving space for grow box; remove code to manually
+ draw grow box; use modern API for thumb scroll proc; replace
+ HiliteControl() by modern API; replace control mgr constants with
+ appearance mgr equivalents.
+
+ * macosx/tkMacOSXSubwindows.c: Use SetWindowBounds() API instead of
+ SizeWindow(); invalidate clip regions after X{Map,Unmap}Window as fix
+ for [Bug 940117] made them dependent on mapping state; remove unneeded
+ calls to TkMacOSXInvalClipRgns() and unnecessary setting of QD port;
+ use native-endian pixmap on intel; remove obsolete pixmap pix locking.
+
+ * macosx/tkMacOSXWindowEvent.c: Handle only the first of a batch of
+ kEventAppAvailableWindowBoundsChanged events sent per transaction;
+ handle kEventWindowBoundsChanged event to support live window resizing
+ and centralized sending of location/size changed ConfigureNotify
+ events; ensure HIGrowBox is redrawn after bounds change; constrain
+ window after dragging to ensure titlebar is not inacessible
+ offscreen or under dock/menubar; handle kEventWindowGetRegion and
+ kEventWindowDrawContent for transparent windows to mark resp. paint
+ content region as transparent; handle kEventWindowConstrain for
+ fullscreen windows to ensure bounds match new screen size; enter/exit
+ fullscreen UIMode upon activation/deactivation of fullscreen window.
+
+ * macosx/tkMacOSXWm.c: Use live-resize and async-drag carbon window
+ * macosx/tkMacOSXWm.h: attributes for toplevels by default; implement
+ new [wm attributes] -topmost, -transparent and -fullscreen; refactor
+ WmAttributesCmd() parallelling the tkUnixWm.c implementation, use thus
+ factored proc to set proxy icon from [wm iconbitmap]; dynamically
+ determine default values for toplevel min and max sizes (similar to
+ tkWinWm.c impl): min sizes depend on window class & attributes to
+ ensure visibility of all titlebar widgets and grow box, max sizes
+ depend on maximal window bounds for all active displays; factor out
+ code that puts into effect changes to master or override_redirect; use
+ RepositionWindow() API to determine staggered initial window bounds;
+ correct resize limit calculations, handle gridding and use modern
+ resize API in TkMacOSXGrowToplevel(); remove sending of ConfigureNotify
+ after resize or zoom (now handled by BoundsChanged handler); correct
+ composite carbon window attribute handling, remove currently unusable
+ attributes and add new attributes in [tk::unsupported::MacWindowStyle];
+ ensure validity of window class and attributes before use; apply
+ changes to window class when handling carbon window attribute changes
+ (if HIWindowChangeClass() API available); add debug build warning
+ message when deprecated window style is used instead of window class;
+ use transparent HIGrowBox for resizable windows; avoid unnecessary
+ calls to window structure width API; use tcl time API in TkpGetMS();
+ add TkMacOSXEnterExitFullscreen() to enter/exit UIMode with dock and
+ menubar hidden; restrict wmTracing output to debug builds; remove
+ unneeded calls to TkMacOSXInvalClipRgns() and unnecessary setting of QD
+ port; workaround GetWindowStructureWidths() Carbon bug (bogus results
+ for never-mapped floating windows).
+
+ * macosx/tkMacOSXXStubs.c (TkMacOSXDisplayChanged): Add maximal window
+ bounds field to Screen record (in ext_data), computed as the union of
+ available window positioning bounds of all graphics devices (displays).
+
+ * macosx/tkMacOSXBitmap.c: Fix macRoman encoding leak.
+ * macosx/tkMacOSXCursor.c:
+
+ * macosx/tkMacOSXDebug.c (TkMacOSXCarbonEventToAscii): Use static
+ * macosx/tkMacOSXDebug.h: buffer to simplify callers; const fixes.
+
+ * macosx/tkMacOSXBitmap.c: Use more efficient QDSwapPort() instead of
+ * macosx/tkMacOSXButton.c: GetPort()/SetPort()/GetGWorld()/SetGWorld().
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXXStubs.c:
+
+ * macosx/tkMacOSXColor.c: Use kHIToolboxVersionNumber for runtime OS
+ * macosx/tkMacOSXEntry.c: version check rather than Gestalt() etc.
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDraw.c: Remove obsolete and now incorrect
+ * macosx/tkMacOSXInt.h: tkMenuCascadeRgn clipping code.
+ * macosx/tkMacOSXMenu.c:
+
+ * macosx/tkMacOSXHLEvents.c: Replace Tcl_GlobalEval() resp. Tcl_Eval()
+ * macosx/tkMacOSXScrlbr.c: by Tcl_EvalEx().
+ * macosx/tkMacOSXInit.c:
+
+ * macosx/tkMacOSXInit.c (TkpInit): Reorder initialization steps.
+
+ * macosx/tkMacOSXKeyEvent.c: Remove pre-10.2 support.
+
+ * macosx/tkMacOSXMenus.c: Remove now useless call to
+ TkMacOSXHandleTearoffMenu(); use \x.. quoting for non-latin1 macroman
+ literar chars to allow file to be edited as utf-8.
+
+ * macosx/tkMacOSXScale.c: Replace TrackControl() by modern
+ * macosx/tkMacOSXScrlbr.c: HandleControlClick() API (using new
+ TkMacOSXModifierState()).
+
+ * macosx/tkMacOSXInt.h: Move all constant #defines needed to
+ * macosx/tkMacOSXColor.c: support building on older OS X releases
+ * macosx/tkMacOSXEvent.h: to a central location in tkMacOSXInt.h.
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/ttkMacOSXTheme.c:
+
+ * macosx/tkMacOSXInt.h: Add ChkErr() macro to factor out
+ * macosx/tkMacOSXButton.c: Carbon OSStatus return value checking
+ * macosx/tkMacOSXCarbonEvents.c: and TkMacOSXDbgMsg() macro to factour
+ * macosx/tkMacOSXClipboard.c: out debug message output; use these
+ * macosx/tkMacOSXColor.c: macros to replace #ifdef TK_MAC_DEBUG
+ * macosx/tkMacOSXCursor.c: blocks & direct printing to stderr,
+ * macosx/tkMacOSXDebug.c: and to do additional OSStatus return
+ * macosx/tkMacOSXDialog.c: checking, and to standardize OSStatus
+ * macosx/tkMacOSXDraw.c: usage.
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+
+ * macosx/tkMacOSXSend.c: Remove duplicate/unused declarations.
+ * macosx/tkMacOSXXStubs.c:
+
+ * macosx/tkMacOSXDebug.c: Const fixes.
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXTest.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+
+ * macosx/Wish-Info.plist.in: Add tcl document extensions/mime types and
+ LSMinimumSystemVersion, LSRequiresCarbon & NSAppleScriptEnabled keys.
+
+ * macosx/Wish-Common.xcconfig: Add Wish's Info.plist as __info_plist
+ section to tktest; enable more warnings.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Add 'DebugMemCompile' build
+ configuration that calls configure with --enable-symbols=all; disable
+ configure check for __attribute__((__visibility__("hidden"))) in Debug
+ configuration to restore availability of ZeroLink.
+
+ * macosx/Wish-Common.xcconfig: Fix whitespace.
+ * macosx/Wish-Debug.xcconfig:
+ * macosx/Wish-Release.xcconfig:
+ * macosx/tkMacOSXAETE.r:
+ * macosx/tkMacOSXConfig.c:
+ * macosx/tkMacOSXCursors.r:
+ * macosx/tkMacOSXKeyboard.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/ttkMacOSXTheme.c:
+ * macosx/tkMacOSXXCursors.r:
+ * macosx/README:
+
+ * macosx/GNUmakefile: Fix/add copyright and license refs.
+ * macosx/Tk-Info.plist.in:
+ * macosx/Wish-Info.plist.in:
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.xcodeproj/project.pbxproj:
+ * macosx/tkMacOSX.h:
+
+ * unix/configure.in: Install license.terms into Tk.framework; fix tk
+ debug build detection.
+ * unix/configure: autoconf-2.59
+
+ * doc/colors.n: Document new Mac OS X system colors.
+ * doc/cursors.n: Document new Mac OS X native cursors.
+ * doc/font.n: Document new Mac OS X 'menu' system font.
+ * doc/wm.n: Document new Mac OS X [wm attributes].
+ * doc/ttk_image.n: Fix 'make html' warning.
+ * doc/canvas.n: Fix nroff typo.
+
+2007-04-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXBitmap.c, macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXCarbonEvents.c, macosx/tkMacOSXClipboard.c:
+ * macosx/tkMacOSXCursor.c, macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXDraw.c, macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXFont.c, macosx/tkMacOSXInit.c, macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXKeyEvent.c, macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c, macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXScale.c, macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c: Revert of commits from 2007-04-13 which broke
+ the OS X build.
+
+2007-04-17 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkFont.c, generic/tkListbox.c, unix/tkUnixSelect.c:
+ * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c: Make
+ the format of declarations much more standardized (removing K&R-isms
+ and other things like that).
+
+2007-04-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * macosx/tkMacOSXInt.h (LOG_MSG, LOG_ON_ERROR): Added macros to make
+ the OSX code much less #ifdef-full.
+
+2007-04-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/ttk/panedwindow.tcl (ttk::panedwindow::Press): handle Press
+ triggering outside sash element boundaries.
+
+2007-04-10 Joe English <jenglish@users.sourceforge.net>
+
+ * win/ttkWinMonitor.c, win/ttkWinXPTheme.c: Re-sync with Tile codebase
+ so patches can flow back and forth.
+
+ * win/ttkWinXPTheme.c: Skip OS version test, should work on Vista/Aero
+ now as well as XP. Fixes [Bug 1687299], thanks to George Petasis for
+ tracking this down.
+
+2007-03-21 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkLayout.c(Ttk_BuildLayoutTemplate): BUGFIX: Nested
+ TTK_GROUP nodes did not work unless they appeared at the end of the
+ layout (and only by accident then).
+
+2007-03-08 Joe English <jenglish@users.sourceforge.net>
+
+ * tests/grid.test(grid-21.7): Reset wm geometry . and pack propagate .
+ at end of test. 'pack propagate . 0' was causing cascading failures in
+ subsequent tests. [Bug 1676770]
+
+2007-03-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkMain.c (Tk_MainEx): Replicate macosx-specific code from
+ TkpInit() that ensures the console window appears when wish is started
+ from the OS X Finder (i.e. with stdin == /dev/null), jeffh's 2006-11-24
+ change rendered the corresponding code in TkpInit() ineffective in wish
+ because Tk_MainEx() sets tcl_interactive before calling TkpInit().
+
+ * generic/ttk/ttkGenStubs.tcl (new): Add ttk-specific genstubs.tcl from
+ * unix/Makefile.in (genstubs): tile and run it from 'genstubs'
+ target, restores ability to generate all of Tk's stub sources.
+
+ * generic/ttk/ttkTreeview.c: #ifdef out unused declaration.
+
+ * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol): Add fix for
+ libraries loaded with a DYLD_IMAGE_SUFFIX.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Ensure gcc version used by
+ * macosx/Wish.xcodeproj/default.pbxuser: Xcode and configure/make are
+ * macosx/Wish-Common.xcconfig: consistent and independent of
+ gcc_select default and CC env var; fixes for Xcode 3.0.
+
+ * unix/tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in macosx-version-min check.
+ * unix/configure: autoconf-2.59
+
+2007-02-25 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkUtil.c: Fixed grid anchor center problem in labelframes.
+ * tests/grid.test: [Bug 1545765]
+
+2007-02-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/ttk/notebook.tcl (ttk::notebook::enableTraversal): OS X
+ needs Option instead of Alt binding
+
+2007-02-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tcl.m4: use SHLIB_SUFFIX=".so" on HP-UX ia64 arch.
+ * unix/configure: autoconf-2.59
+
+ * library/tkfbox.tcl (::tk::IconList_Goto): avoid goto issues in empty
+ dirs. [Bug 1662959]
+
+2007-02-09 Joe Mistachkin <joe@mistachkin.com>
+
+ * win/nmakehlp.c: Properly cleanup after nmakehlp, including the
+ * win/makefile.vc: vcX0.pch file. Sync up fixed nmakehlp usage from
+ Tcl.
+
+2007-02-06 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/ttk.tcl: Add no-op [package ifneeded] script for tile
+ 0.8.0, so that existing applications that use "package require tile"
+ won't fail when run under Tk 8.5.
+
+2007-02-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: Use gcc4's __attribute__((__visibility__("hidden"))) if
+ available to define MODULE_SCOPE effective on all platforms.
+ * unix/configure.in: add caching to -pipe check.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+2007-02-03 Joe Mistachkin <joe@mistachkin.com>
+
+ * win/rules.vc: Fix platform specific file copy macros for downlevel
+ Windows.
+ * win/ttkWinMonitor.c: Windows portability support. Fix "noxp" build
+ * win/ttkWinXPTheme.c: option handling and use GetWindowLongPtr and
+ SetWindowLongPtr only when needed.
+
+2007-02-02 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/ttkWinXPTheme.c: Support IsAppThemed() call. This is what is
+ used when theming is turned off just for an individual application.
+
+2007-01-28 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Extract build settings that
+ * macosx/Wish.xcodeproj/default.pbxuser: were common to multiple
+ * macosx/Wish-Common.xcconfig (new file): configurations into external
+ * macosx/Wish-Debug.xcconfig (new file): xcconfig files; add extra
+ * macosx/Wish-Release.xcconfig (new file): configurations for building
+ with SDKs; convert legacy jam-based 'Tk' target to native target with
+ single script phase; correct syntax of build setting references to use
+ $() throughout; remove unused tcltest sources from 'tktest' target.
+
+ * macosx/README: Document new Wish.xcodeproj configurations; other
+ minor updates/corrections.
+
+ * generic/tk.h: Update location of version numbers in macosx files.
+
+ * macosx/Wish.xcode/project.pbxproj: Restore 'tktest' target to working
+ * macosx/Wish.xcode/default.pbxuser: order by replicating applicable
+ changes to Wish.xcodeproj since 2006-07-20.
+
+2007-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: Integrate CPPFLAGS into CFLAGS as late as possible and
+ move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to
+ avoid errors about multiple -isysroot flags from some older gcc builds.
+
+ * unix/configure: autoconf-2.59
+
+2007-01-19 Joe Mistachkin <joe@mistachkin.com>
+
+ * win/makefile.vc: Properly build man2tcl.c for MSVC8.
+
+2007-01-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcodeproj/project.pbxproj: Remove libtommath defines.
+
+ * unix/tcl.m4: Ensure CPPFLAGS env var is used when set. [Bug 1586861]
+ (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
+ present in CFLAGS to avoid discrepancies between what headers configure
+ sees during preprocessing tests and compiling tests.
+
+ * unix/configure: autoconf-2.59
+
+2007-01-11 Jeff Hobbs <jeffh@activestate.com>
+
+ * unix/tkUnixEvent.c, library/msgs/es.msg: s/CRLF/LF/g
+
+2007-01-11 Joe English <jenglish@users.sourceforge.net>
+
+ * win/tcl.m4 (CFLAGS_WARNING): Remove "-Wconversion". This was removed
+ from unix/tcl.m4 2004-07-16 but not from here.
+ * win/configure: Regenerated.
+
+2007-01-11 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkManager.h, generic/ttk/ttk*.c: Revert addition of
+ contravariant 'const' qualifiers, to keep in sync with Tile codebase
+ (which must remain compatible with Tk 8.4).
+
+2007-01-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * doc/ManageGeom.3,
+ * generic/tk.decls,
+ * generic/tk.h: Add const to 2nd parameter of Tk_ManageGeometry
+ * generic/tkDecls.h: regenerated
+ * generic/tkInt.h,
+ * generic/tk*.c,
+ * generic/ttk/ttk*.c: Added many "const" specifiers in implementation.
+
+2007-01-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * xlib/*: Made the generic fake-X11 glue layer abide by the formatting
+ rules of the core.
+
+2006-12-31 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c: Fill-in TkpGetFontAttrsForChar (TIP #300).
+ * macosx/ttkMacOSXTheme.c: Define a constant to make it compile on Mac
+ OS X 10.3.
+
+2006-12-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Update wm attributes output so that tests pass after
+ addition of -transparentcolor for Win32.
+
+2006-12-26 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkLabel.c: ImageElement clientData no longer needed.
+
+2006-12-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixEvent.c (TkUnixDoOneXEvent): Made correct on AMD64 and
+ other similar 64-bit systems where fd_mask is not 'unsigned int' in
+ effect. [Bug 1522467]
+
+ * library/msgs/es_ES.msg (removed):
+ * library/msgs/es.msg: Fixed translation fault that was present in all
+ Spanish-speaking locales. [Bug 1111213]
+
+2006-12-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinButton.c (TkpDisplayButton): lint init. [Bug 1618604]
+
+2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch
+ flag succeeds before enabling 64bit build.
+ * unix/configure: autoconf-2.59
+
+2006-12-18 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTreeview.c, library/ttk/treeview.tcl, doc/treeview.n:
+ Added column '-stretch' and '-minwidth' options. Improved column drag
+ and resize behavior. Added horizontal scrolling [Bug 1518650]. Row
+ height and child indent specifiable on Treeview style. Decreased
+ default row height, no default -padding. Use correct heading height
+ [Bug 1163349]. Apply tag settings to tree item as well as to data
+ columns [NOTE: 'tag configure' still buggy]. Fix off-by-one condition
+ when moving nodes forward [Bug 1618142]
+ * generic/ttk/ttkScroll.c (TtkScrollTo): Prevent overscroll [Bug
+ 1173434]
+ * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl,
+ * library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl,
+ * library/ttk/defaults.tcl, library/ttk/winTheme.tcl,
+ * library/ttk/xpTheme.tcl: Per-theme treeview settings.
+ * macosx/ttkMacOSXTheme.c: Added disclosure triangle element.
+
+2006-12-17 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl, generic/ttk/ttkEntry.c,
+ * doc/ttk_combobox.n: Add combobox -height option; only show scrollbar
+ if the listbox needs to scroll. [Bug 1032869]
+
+2006-12-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * doc/cursors.n: Mention "none" in supported cursor list. Fix comment
+ that incorrectly claims that the Win32 "no" cursor hides the cursor.
+ * tests/cursor.test: Test "none" cursor.
+ * unix/tkUnixCursor.c (CreateCursorFromTableOrFile)
+ (TkGetCursorByName): Define a table of Tk cursors that is searched in
+ addition to the X cursor table. A Tk cursor is loaded from a data
+ string and works with the same options as the built in X cursors. This
+ code makes it possible to use "none" as a cursor name under Unix.
+ * win/rc/cursor9a.cur: Added none Win32 cursor.
+ * win/rc/tk_base.rc: Define a built-in Win32 cursor named "none".
+ [Patch 1615427]
+
+2006-12-14 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkButton.c, generic/ttk/ttkElements.c,
+ * generic/ttk/ttkEntry.c, generic/ttk/ttkFrame.c,
+ * generic/ttk/ttkImage.c, generic/ttk/ttkInit.c,
+ * generic/ttk/ttkLabel.c, generic/ttk/ttkNotebook.c,
+ * generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c,
+ * generic/ttk/ttkScale.c, generic/ttk/ttkScrollbar.c,
+ * generic/ttk/ttkSeparator.c, generic/ttk/ttkTheme.h,
+ * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.h:
+ Global reduction: use per-file *_Init() routines to reduce the number
+ of globally-visible initialization records.
+
+2006-12-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (install-doc): intentionally skip ttk_dialog.n
+ installation (not for public consumption)
+
+ * doc/scrollbar.n, doc/button.n, doc/checkbutton.n:
+ * doc/entry.n, doc/frame.n, doc/label.n, doc/labelframe.n:
+ * doc/menu.n, doc/menubutton.n, doc/panedwindow.n:
+ * doc/radiobutton.n, doc/scrollbar.n, doc/ttk_*: revamp ttk docs to
+ use consist nroff format (not 100% consistent with classic widget
+ docs). Add more man page cross-linking "SEE ALSO".
+
+ * generic/ttk/ttkInit.c:
+ * generic/ttk/ttkTreeview.c: make treeview exist by default
+ * generic/ttk/ttkPanedwindow.c: s/TtkPaned_Init/TtkPanedwindow_Init/
+
+ * win/Makefile.in, unix/Makefile.in (demo): add 'demo' target
+
+2006-12-13 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/ttk.tcl: Try to straighten out theme loading and
+ selection logic.
+ * generic/ttk/ttkElements.c, library/ttk/defaults.tcl,
+ * generic/ttk/ttkClamTheme.c, library/ttk/clamTheme.tcl:
+ Provide package in C part instead of Tcl part.
+
+2006-12-12 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/ttk.tcl, generic/ttkTheme.c: Remove nonfunctional code.
+
+2006-12-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinButton.c (InitBoxes): Call Tcl_Panic() if loading of bitmap
+ resources fails. This change generates an error if Tk is unable to
+ find button widget resources instead of silently failing and then
+ drawing widgets incorrectly.
+ * win/rc/tk_base.rc: If the user defines BASE_NO_TK_ICON then compile
+ the base resources file without a "tk" icon. This change makes it
+ easier to replace the default tk icon with a custom icon. [Patch
+ 1614362]
+
+2006-12-11 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * unix/tkUnixWm.c (TkWmMapWindow, WmClientCmd): Added support for
+ _NET_WM_PID property from the EWMH spec. This is only installed when
+ the client machine is set.
+ (WmProtocolCmd, UpdateWmProtocols, TkWmProtocolEventProc): Added
+ support for the _NET_WM_PING protocol from the EWMH spec. Note that
+ the support for this is not exposed to the script level as that would
+ prevent correct handling.
+
+2006-12-10 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h,
+ * generic/ttk/ttk.decls, generic/ttk/ttkTheme.c,
+ * generic/ttk/ttkLayout.c, generic/ttk/ttkDecls.h:
+ Rename typedef Ttk_Element => Ttk_ElementImpl.
+
+2006-12-09 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkButton.c, generic/ttk/ttkImage.c,
+ * generic/ttk/ttkLabel.c, generic/ttk/ttkWidget.h,
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkNotebook.c,
+ * generic/ttk/ttkTreeview.c, doc/ttk_image.n:
+ Merged duplicate functionality between image element factory, image
+ element, and -image option processing. Image element factory now takes
+ an imageSpec argument instead of a separate image name and -map option
+ * tests/ttk/image.test(image-1.1): Can catch this error earlier now.
+
+2006-12-06 Kevin Kenny <kennykb@acm.org>
+
+ * unix/configure.in: Further changes to avoid attempting to link
+ * unix/configure: against Xft libraries in a non-Xft build
+ [Bug 1609616] (dgp)
+
+2006-12-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkListbox.c (ConfigureListboxItem): ListboxWorldChanged not
+ needed - just call EventuallyRedrawRange. [Bug 1608046] (rezic)
+
+2006-12-04 Donal K. Fellows <dkf@users.sf.net>
+
+ TIP #286 IMPLEMENTATION
+
+ * generic/tkMenu.c (MenuWidgetObjCmd, MenuDoXPosition):
+ * doc/menu.n, tests/menu.test: Added an [$menu xposition] subcommand
+ which is useful in menubars and when menus use multiple columns. Many
+ thanks to Schelte Bron for the implementation.
+
+2006-12-01 Kevin Kenny <kennykb@acm.org>
+
+ TIP #300 IMPLEMENTATION
+
+ * doc/font.n: Added a [font actual $font $char]
+ * generic/tkFont.c: variant that introspects the font that
+ * generic/tkFont.h: is chosen to render a given character
+ * macosx/tkMacOSXFont.c: in a given nominal font. Added
+ * tests/font.test: documentation and test cases for the
+ * unix/tkUnixFont.c: new command syntax.
+ * unix/tkUnixRFont.c:
+ * win/tkWinFont.c:
+
+2006-12-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/wm.n, tests/winWm.test:
+ * win/tkWinWm.c: add -transparentcolor attribute for Windows.
+
+2006-12-01 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkLayout.c: Dead code removal.
+
+2006-11-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDialog.c (Tk_MessageBoxObjCmd): fix inability to use
+ buttons with standard Escape key binding as -default button (reported
+ on tcl-mac by Hans-Christoph Steiner).
+
+ * macosx/tkMacOSXWm.c (WmAttributesCmd): fix getting [wm attr -alpha].
+ [Bug 1581932]
+
+2006-11-28 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/fonts.tcl: Clean up temporary variables.
+
+2006-11-27 Kevin Kenny <kennykb@acm.org>
+
+ * unix/configure.in: Corrected Xft configuration so that Xft actually
+ does get turned on when available.
+ * unix/configure: autoconf
+
+2006-11-26 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkWidget.c, generic/ttk/ttkPaned.c: Fix [Bug 1603506]
+ * library/ttk/button.tcl, library/ttk/combobox.tcl,
+ * library/ttk/utils.tcl: Rename ttk::CopyBindings to ttk::copyBindings
+ * generic/ttk/ttkTreeview.c, doc/ttk_treeview.n:
+ -displaycolumns {} now means "no columns" instead of "all columns".
+ Use -displaycolumns #all for "all columns". [Bug 1547622]
+
+2006-11-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Linux): --enable-64bit support. [Patch 1597389]
+ * unix/configure: autoconf-2.59 [Bug 1230558]
+
+2006-11-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXInit.c (TkpInit): only set tcl_interactive 1 if it
+ isn't already defined. Allows embedders to set it to 0 to prevent the
+ console appearing on OS X. [Bug 1487701]
+
+ * unix/tkUnixMenu.c (DrawMenuUnderline): bound Tcl_UtfAtIndex usage
+ * tests/menu.test (menu-36.1): [Bug 1599877]
+
+2006-11-24 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/altTheme.tcl, library/ttk/clamTheme.tcl,
+ * library/ttk/defaults.tcl, library/ttk/winTheme.tcl,
+ * library/ttk/xpTheme.tcl: explicitly specify -anchor w on TMenubutton
+ * tests/ttk/entry.test: Fixed font dependency; test entry-3.2 should
+ work on all platforms now.
+ * library/classicTheme.tcl: Don't define or use TkClassicDefaultFont.
+ * generic/ttk/ttkTreeview.c, generic/ttk/ttkPanedwindow.c: Handle
+ missing layouts.
+
+2006-11-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinMenu.c (TkWinHandleMenuEvent, DrawMenuUnderline): Handle
+ unichar underlining correctly and safely. [Bug 1599877]
+
+2006-11-20 Joe English <jenglish@users.sourceforge.net>
+
+ * win/ttkWinXPTheme.c: Add support for alternate/indeterminate
+ checkbutton state. Fix various spacing parameters [Bug 1596020, patch
+ from Tim Baker]. Remove unused uxtheme hooks.
+
+2006-11-16 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/colors.n, doc/wm.n: Minor fixes, added See Also.
+
+ * doc/labelframe.n: Added an example.
+
+2006-11-15 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/label.n: Added an example and some See Also refs.
+
+ * doc/ConfigWidg.3, doc/bind.n, doc/grid.n, doc/panedwindow.n:
+ * doc/text.n, doc/ttk_Geometry.3, doc/ttk_button.n:
+ * doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
+ * doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n, doc/ttk_intro.n:
+ * doc/ttk_label.n, doc/ttk_labelframe.n, doc/ttk_menubutton.n:
+ * doc/ttk_notebook.n, doc/ttk_panedwindow.n, doc/ttk_progressbar.n:
+ * doc/ttk_radiobutton.n, doc/ttk_scrollbar.n, doc/ttk_separator.n:
+ * doc/ttk_sizegrip.n, doc/ttk_style.n, doc/ttk_widget.n, doc/wm.n:
+ Convert \fP to \fR so that man-page scrapers have an easier time.
+
+2006-11-14 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkDefaultTheme.c: Fix off-by-one bug in tree indicator
+ size computation [Bug 1596021, patch from Tim Baker]. Increased
+ default size from 7 to 9 pixels.
+
+2006-11-12 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttkScroll.c: *correct* fix for [Bug 1588251].
+
+2006-11-12 Joe English <jenglish@users.sourceforge.net>
+
+ * tests/ttk/ttk.test(ttk-6.9): Workaround for [Bug 1583038]
+
+2006-11-12 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttkScroll.c: Reworked cleanup procedure; "self-cancelling"
+ idle call is not robust, call Tcl_CancelIdleCall() in
+ TtkFreeScrollHandle instead. Fixes [Bug 1588251]
+
+2006-11-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcodeproj/project.pbxproj: remove tclParseExpr.c and
+ bwidget.test.
+
+ * unix/tcl.m4 (Darwin): suppress linker arch warnings when building
+ universal for both 32 & 64 bit and no 64bit CoreFoundation is
+ available; sync with tcl tcl.m4 change.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+2006-11-08 Kevin Kenny <kennykb@acm.org>
+
+ * unix/configure.in: Silenced warnings about missing Xft configuration
+ unless --enable-xft is requested explicitly. Also added a few basic
+ checks that we can actually compile and link against Xft headers and
+ libraries. [Bug 1592667]
+ * unix/configure: Regen.
+
+2006-11-07 Kevin Kenny <kennykb@acm.org>
+
+ * unix/configure.in: Made --enable-xft the default.
+ * unix/configure: Regen.
+
+2006-11-06 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkClassicTheme.c, generic/ttk/ttkPanedwindow.c,
+ * generic/ttk/ttkTheme.c, generic/ttk/ttkTreeview.c,
+ * win/ttkWinXPTheme.c, library/ttk/entry.tcl,
+ * library/ttk/notebook.tcl, library/ttk/panedwindow.tcl,
+ * library/ttk/utils.tcl, tests/ttk/entry.test, tests/ttk/bwidget.test:
+ Miscellaneous minor changes to re-sync Ttk codebase with Tile CVS: fix
+ comments damaged by overzealous search-and-destroy; removed obsolete
+ [style default] synonym for [ttk::style configure]; removed other dead
+ code.
+
+2006-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/safetk.tcl (::safe::tkTopLevel): Theme it.
+
+ * generic/ttk/ttkLayout.c: We do not want to require tkInt in all
+ * generic/ttk/ttkMananager.h: the ttk files so added the definition
+ * generic/ttk/ttkTheme.h: of MODULE_SCOPE to ttkTheme.h. Ensures
+ * generic/ttk/ttkWinMonitor.c: everyone gets to see the definition
+ from someplace.
+
+ * library/ttk/fonts.tcl: In a safe interp there is no osVersion field
+ in tcl_platform so work around it.
+
+2006-11-02 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/ttk/ttkBlink.c, generic/ttk/ttkButton.c:
+ * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
+ * generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
+ * generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
+ * generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
+ * generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
+ * generic/ttk/ttkLayout.c, generic/ttk/ttkManager.h:
+ * generic/ttk/ttkNotebook.c, generic/ttk/ttkPanedwindow.c:
+ * generic/ttk/ttkProgress.c, generic/ttk/ttkScale.c:
+ * generic/ttk/ttkScroll.c, generic/ttk/ttkScrollbar.c:
+ * generic/ttk/ttkSeparator.c, generic/ttk/ttkSquare.c:
+ * generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
+ * generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h:
+ * generic/ttk/ttkThemeInt.h, generic/ttk/ttkTrack.c:
+ * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
+ * generic/ttk/ttkWidget.h, macosx/ttkMacOSXTheme.c:
+ * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c: ensure
+ all global Ttk symbols have Ttk or ttk prefix; declare all externally
+ visible Ttk symbols not contained in stubs table as MODULE_SCOPE (or as
+ static when possible); so that 'make check{exports,stubs}' once again
+ complete without errors.
+
+ * macosx/tkMacOSXColor.c (TkMacOSXCompareColors): ifdef out when unused
+
+ * macosx/Wish.xcodeproj/project.pbxproj: check autoconf/autoheader exit
+ status and stop build if they fail.
+
+ * macosx/tkMacOSXWindowEvent.c (GenerateUpdateEvent): fix handling of
+ Carbon Update events: the QuickDraw window update region was being
+ ignored and all child TkWindows were sent an Expose XEvent even when
+ they did not need to be redrawn. [Patch 1589226]
+
+2006-11-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDebug.c: add TkMacOSX prefix to leftover
+ * macosx/tkMacOSXDebug.h: macosx-private global symbols without Tk
+ * macosx/tkMacOSXEmbed.c: prefix; ifdef out currently unused debug
+ * macosx/tkMacOSXEvent.c: procs.
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXCarbonEvents.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWm.c:
+
+2006-10-31 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Added ttk files to msvc build and add manifest
+ * win/rules.vc: files to binaries with MSVC8.
+
+2006-10-31 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new Ttk files.
+
+ * macosx/ttkMacOSXTheme.c: standardize header #includes.
+
+ * unix/Makefile (checkstubs, checkexports): check ttk.decls, allow
+ export of Ttk prefixed symbols.
+
+ * generic/ttk/tkDefaultTheme.c: fix warnings.
+
+2006-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/ttk_Geometry.3, doc/ttk_Theme.3, doc/ttk_button.n:
+ * doc/ttk_checkbutton.n, doc/ttk_combobox.n, doc/ttk_dialog.n:
+ * doc/ttk_entry.n, doc/ttk_frame.n, doc/ttk_image.n:
+ * doc/ttk_intro.n, doc/ttk_label.n, doc/ttk_labelframe.n:
+ * doc/ttk_menubutton.n, doc/ttk_notebook.n, doc/ttk_panedwindow.n:
+ * doc/ttk_progressbar.n, doc/ttk_radiobutton.n, doc/ttk_scrollbar.n:
+ * doc/ttk_separator.n, doc/ttk_sizegrip.n, doc/ttk_style.n:
+ * doc/ttk_treeview.n, doc/ttk_widget.n,:
+ * generic/ttk/ttk.decls, generic/ttk/ttkBlink.c:
+ * generic/ttk/ttkButton.c, generic/ttk/ttkCache.c:
+ * generic/ttk/ttkClamTheme.c, generic/ttk/ttkClassicTheme.c:
+ * generic/ttk/ttkDecls.h, generic/ttk/ttkDefaultTheme.c:
+ * generic/ttk/ttkElements.c, generic/ttk/ttkEntry.c:
+ * generic/ttk/ttkFrame.c, generic/ttk/ttkImage.c:
+ * generic/ttk/ttkInit.c, generic/ttk/ttkLabel.c:
+ * generic/ttk/ttkLayout.c, generic/ttk/ttkManager.c:
+ * generic/ttk/ttkManager.h, generic/ttk/ttkNotebook.c:
+ * generic/ttk/ttkPanedwindow.c, generic/ttk/ttkProgress.c:
+ * generic/ttk/ttkScale.c, generic/ttk/ttkScroll.c:
+ * generic/ttk/ttkScrollbar.c, generic/ttk/ttkSeparator.c:
+ * generic/ttk/ttkSquare.c, generic/ttk/ttkState.c:
+ * generic/ttk/ttkStubInit.c, generic/ttk/ttkStubLib.c:
+ * generic/ttk/ttkTagSet.c, generic/ttk/ttkTheme.c:
+ * generic/ttk/ttkTheme.h, generic/ttk/ttkThemeInt.h:
+ * generic/ttk/ttkTrace.c, generic/ttk/ttkTrack.c:
+ * generic/ttk/ttkTreeview.c, generic/ttk/ttkWidget.c:
+ * generic/ttk/ttkWidget.h:
+ * library/demos/ttk_demo.tcl, library/demos/ttk_iconlib.tcl:
+ * library/demos/ttk_repeater.tcl:
+ * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl:
+ * library/ttk/button.tcl, library/ttk/clamTheme.tcl:
+ * library/ttk/classicTheme.tcl, library/ttk/combobox.tcl:
+ * library/ttk/cursors.tcl, library/ttk/defaults.tcl:
+ * library/ttk/dialog.tcl, library/ttk/entry.tcl:
+ * library/ttk/fonts.tcl, library/ttk/icons.tcl:
+ * library/ttk/keynav.tcl, library/ttk/menubutton.tcl:
+ * library/ttk/notebook.tcl, library/ttk/panedwindow.tcl:
+ * library/ttk/progress.tcl, library/ttk/scale.tcl:
+ * library/ttk/scrollbar.tcl, library/ttk/sizegrip.tcl:
+ * library/ttk/treeview.tcl, library/ttk/ttk.tcl:
+ * library/ttk/utils.tcl, library/ttk/winTheme.tcl:
+ * library/ttk/xpTheme.tcl:
+ * macosx/ttkMacOSXTheme.c:
+ * tests/ttk/all.tcl, tests/ttk/bwidget.test, tests/ttk/combobox.test:
+ * tests/ttk/entry.test, tests/ttk/image.test:
+ * tests/ttk/labelframe.test, tests/ttk/layout.test:
+ * tests/ttk/misc.test, tests/ttk/notebook.test:
+ * tests/ttk/panedwindow.test, tests/ttk/progressbar.test:
+ * tests/ttk/scrollbar.test, tests/ttk/treetags.test:
+ * tests/ttk/treeview.test, tests/ttk/ttk.test, tests/ttk/validate.test:
+ * win/ttkWinMonitor.c, win/ttkWinTheme.c, win/ttkWinXPTheme.c:
+ First import of Ttk themed Tk widgets as branched from tile 0.7.8
+
+ * generic/tkInt.h, generic/tkWindow.c: add Ttk_Init call, copy tk
+ classic widgets to ::tk namespace.
+ * library/tk.tcl: add source of ttk/ttk.tcl, define $::ttk::library.
+ * unix/Makefile.in, win/Makefile.in: add Ttk build bits
+ * win/configure, win/configure.in: check for uxtheme.h (XP theme).
+
+2006-10-23 Don Porter <dgp@users.sourceforge.net>
+
+ * README: Bump version number to 8.5a6
+ * generic/tk.h:
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+2006-10-19 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ *** 8.5a5 TAGGED FOR RELEASE ***
+
+ * generic/tkImgBmap.c: Fixed line endings.
+ * win/makefile.vc: Patched up build system to manage
+ * win/rules.vc: AMD64 with MSVC8
+ * win/nmakehlp.c: Ensure operation without Platform SDK.
+
+2006-10-18 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: 8.5a5 release date set.
+
+2006-10-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n: fix docs to not correct -tabs usage case.
+
+ * generic/tkTextDisp.c (SizeOfTab): fix -tabstyle wordprocessor tab
+ alignment to correct tab edge case. [Bug 1578858]
+
+2006-10-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkText.c: Applied suggested patch from [Bug 1536735]
+ * tests/text.test: Update test for above patch.
+ * tests/textWind.test: Corrected test to catch all messages
+ * tests/safe.test: Silence spurious win32 failure awaiting TIP150
+ * tests/winDialog.test: Updated test for file name length check.
+ * test/winWm.test: Corrected test expectation for menu wrapping.
+
+2006-10-16 Andreas Kupries <andreask@activestate.com>
+
+ * doc/WindowId.3: Pat's commit on 2006-10-08 broke the .SH NAME
+ information across several lines, breaking the cross-linking of
+ manpages during installation for this one. Put everything back on a
+ single line, unbreaking it.
+
+2006-10-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * changes: updates for 8.5a5 release.
+
+ * macosx/tkMacOSXDraw.c: fix numerous issues in CG and QD drawing
+ procs so that they now match X11 drawing much more closely [Bug
+ 1558051]; use Tiger ellipse drawing API when available; fix comments &
+ whitespace.
+
+ * macosx/tkMacOSXInit.c: set default linewidth limit for CG
+ antialiasing to 0 as thin horizontal/vertical lines look good now.
+ * macosx/README: document CG antialiasing limit changes.
+
+ * generic/tkCanvLine.c (ConfigureLine): on TkAqua, pass outline
+ * generic/tkCanvPoly.c (ConfigurePolygon): linewidth in gc even for
+ * generic/tkRectOval.c (ConfigureRectOval): fills (as it controls AA).
+
+ * macosx/GNUmakefile: don't redo prebinding of non-prebound binaires.
+
+ * library/demos/pendulum.tcl: fix incorrect setting of toplevel title.
+
+2006-10-10 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.5a5 release
+
+2006-10-08 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkWindow.c: Implemented TIP #264 - Tk_Interp function.
+ * doc/WindowId.3: Documented Tk_Interp.
+ * generic/tk.decls: Added to the stubs interface and
+ * generic/tkDecls.h: regenerated.
+ * generic/tkStubsInit.c:
+
+2006-10-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (Ucs2beToUtfProc, UtfToUcs2beProc):
+ (TkpFontPkgInit, encodingAliases): Correct alignment issues in
+ encoding conversion. Call ucs-2be "unicode" on big-endian systems.
+ [Bug 1122671]
+
+2006-09-27 Andreas Kupries <andreask@activestate.com>
+
+ * unix/Makefile.in (install-binaries): Added a second guard to the
+ * win/Makefile.in: package index file to prevent older versions of Tcl
+ * win/makefile.vc: from seeing version numbers which may contain a/b
+ information, and then balking on them. This could otherwise happen
+ when Tcl/Tk 8.4 and 8.5 are installed in the same directory, seeing
+ each other. [Bug 1566418]
+
+2006-09-22 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tkConsole.c: TIP #268 update regarding registered package
+ * generic/tkMain.c: version, now using full patchlevel instead of
+ * generic/tkWindow.c: major.minor
+ * library/tk.tcl:
+ * unix/configure:
+ * unix/Makefile.in:
+ * unix/tcl.m4:
+ * win/configure:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/rules.vc:
+ * win/tcl.m4:
+
+2006-09-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus with
+ images to avoid clipping bug. [Bug 1329198]
+
+2006-09-21 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgBmap.c (ImgBmapPostscript): Change 0 to NULL, since
+ they are not interchangable on all platforms in all circumstances.
+ [Tcl Bug 1562528]
+
+2006-09-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkMacOSXMakeRealWindowExist): revert part of
+ 2006-05-16 change that had set overrideredirect windows to not become
+ activated by the window manager, as this prevented interaction with
+ native widgets in such windows [Bug 1472624]; apply changes to carbon
+ window attributes even if native window has already been created.
+
+ * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): fix app
+ * macosx/tkMacOSXMenu.c (DrawMenuBarWhenIdle): menu item key shortcuts
+ * macosx/tkMacOSXInt.h: when custom ".apple" menu is installed.
+
+ * library/demos/widget: on TkAqua, don't install file menu with single
+ quit menu item, as the application menu already has a quit item.
+
+ * macosx/tkMacOSXColor.c: fix building on Mac OS X 10.2.
+
+2006-09-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXColor.c (TkSetMacColor,TkpGetColor): use AppearanceMgr
+ * macosx/tkMacOSXDefault.h: to retrieve platform std colors for text
+ * macosx/tkMacOSXPort.h: selections, add "systemHighlightSecondary"
+ color name for standard color of inactive selections, use this color as
+ default for text widget -inactiveselectbackground to implement platform
+ standard look for inactive text selections.
+
+ * library/text.tcl (aqua): remove focus bindings to set selection color
+
+ * generic/tkTextBTree.c (TkTextIsElided): on TkAqua, don't show
+ * generic/tkTextDisp.c (GetStyle): inactive text selection when
+ text widget is disabled.
+
+ * generic/tkEntry.c (DisplayEntry): change default TkAqua selection
+ * macosx/tkMacOSXDefault.h: relief to "flat" (platform std).
+
+ * generic/tkText.c (CreateWidget): fix bug leading to default text
+ selection relief string DEF_TEXT_SELECT_RELIEF being ignored.
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): allow mouse
+ event delivery to background windows with kWindowNoActivatesAttribute
+ (e.g. overrideredirect windows), as these never come to the foreground
+ they would never receive any mouse events otherwise. [Bug 1472624]
+
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): do not
+ send focus events to any windows with kWindowNoActivatesAttribute.
+
+ * macosx/tkMacOSXXStubs.c (XQueryColor, XQueryColors): implement basic
+ XColor computation from pixel values, enough to make tkImg's window.c
+ happy, fixes img::window failures reported on tcl-mac.
+
+ * macosx/tkMacOSXMenu.c (DrawMenuEntryLabel): fix leak. [Bug 1554672]
+
+ * macosx/GNUmakefile: workaround bug in 'cp -pRH' on Darwin 6 and
+ earlier, fixes 'make embedded' failure reported on tcl-mac; fix error
+ from 'make deploy' with same build tree as previous 'make embedded'.
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add new tclUnixCompat.c file.
+
+ * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): fix typo.
+
+ * unix/tcl.m4: sync with tcl/unix/tcl.m4.
+ * unix/configure: autoconf-2.59
+
+2006-09-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION control
+ * generic/tkInt.h: of entry/text selection display based on focus
+ * generic/tkText.c: to the Tcl level, controlled by
+ * generic/tkWindow.c: ::tk::AlwaysShowSelection (boolean, private).
+ * library/tk.tcl: [Bug 1553691]
+ * macosx/tkMacOSXDefault.h:
+ * unix/tkUnixDefault.h:
+ * unix/tkUnixPort.h:
+ * win/tkWinDefault.h:
+
+2006-08-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinKey.c: Add WM_UNICHAR window message support (used by
+ * win/tkWinX.c: virtual keyboard apps). [Bug 1518677] (petasis)
+
+2006-08-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXScrlbr.c (UpdateControlValues): set native scrollbar
+ control bounds only once all size adjustments have been computed.
+ Fixes issue with grow icon obscuring scrollbar reported on tcl-mac.
+
+2006-08-21 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXCarbonEvents.c (CarbonTimerProc): avoid starving main
+ event loop: limit the number of tcl events processed per invocation.
+ Fixes bug reported on tcl-mac by Kevan Hashemi.
+
+2006-08-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * tests/text.test (text-25.15): Added test suggested by Sam
+ <baudinm@yahoo.com> on comp.lang.tcl
+
+ * generic/tk.h, generic/tkInt.h: Stylistic improvements. No API change.
+
+2006-08-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
+ universal builds including x86_64, for 64-bit CoreFoundation on Leopard
+ and for use of -mmacosx-version-min instead of MACOSX_DEPLOYMENT_TARGET
+ * unix/configure.in (Darwin): remove 64-bit arch flags from CFLAGS for
+ combined 32-bit and 64-bit universal builds, as neither TkAqua nor
+ TkX11 can be built for 64-bit at present.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+ * macosx/Wish.xcodeproj/project.pbxproj: switch native release targets
+ to use DWARF with dSYM, Xcode 3.0 changes.
+ * macosx/README: updates for x86_64 support in Tcl.
+
+ * macosx/tkMacOSXInit.c (TkpInit): when available, use public
+ TransformProcessType() API instead of CPSEnableForegroundOperation()
+ SPI to notify the window server that we are a GUI application.
+
+ * macosx/tkMacOSXWm.c (WmAttrGetTitlePath): use HIWindow API on >=Tiger
+
+ * macosx/tkMacOSXMouseEvent.c (GenerateToolbarButtonEvent):
+ * macosx/tkMacOSXMenus.c (GenerateEditEvent):
+ * macosx/tkMacOSXMenu.c (MenuSelectEvent): bzero() the XVirtualEvent
+ structure before use to ensure all fields are initialized. [Bug
+ 1542205]
+
+2006-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXWm.c (WmAttributesCmd): correct OS X result for [wm
+ attributes $top].
+
+2006-07-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): handle key
+ shortcut for kHICommandQuit in the same way as other application menu
+ item key shortcuts. [Bug 1516950]
+
+2006-07-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkWmMapWindow): fix incorrect values of wmInfo
+ parentWidth/Height for toplevels by recalculating them once the window
+ is mapped (i.e once the window&structure sizes are known). [Bug
+ 1358663]
+ (ParseGeometry): sync with ParseGeometry in tkUnixWm.c/tkWinWm.c.
+
+2006-07-21 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindInit): for REDO_KEYSYM_LOOKUP, change
+ keysym-to-string mapping hash to use first name in ks_names.h instead
+ of last (if there are multiple possibilities), e.g. "F11" instead of
+ "L1".
+
+ * macosx/tkMacOSXKeyboard.c (TkpGetKeySym): correct keysyms for pure
+ modifier key presses [Bugs 700311, 1525905]; correct keysym for Enter
+ key; add keysyms for new NumLock and Fn modifiers (added 2005-08-09).
+
+2006-07-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support
+ * unix/tkUnixSend.c (Tk_GetUserInactiveTime): for weakly
+ importing symbols not available on OSX 10.2 or 10.3, enables binaires
+ built on later OSX versions to run on earlier ones.
+ * macosx/Wish.xcodeproj/project.pbxproj: enable weak-linking; turn on
+ extra warnings.
+ * macosx/README: document how to enable weak-linking; cleanup.
+ * unix/configure.in: add check on Darwin-X11 for ld support of -weak-l
+ * unix/tcl.m4: flag and weak-link libXss if possible as it is not
+ available before OSX 10.4; enforce requirement of OSX 10.2 for TkAqua;
+ move Darwin specific checks & defines that are only relevant to the tcl
+ build out of tcl.m4; restrict framework option to Darwin; clean up
+ quoting and help messages.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+ * macosx/GNUmakefile: enable xft for TkX11 build.
+ * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw):
+ verify validity of context returned from QDBeginCGContext() before use.
+ * macosx/tkMacOSXKeyEvent.c: ifdef out diagnostic messages to stderr.
+
+ * macosx/tkMacOSXEvent.h: standardize MAC_OS_X_VERSION_MAX_ALLOWED
+ * macosx/tkMacOSXMenu.c: checks per QA1316, ensure define can be
+ * macosx/tkMacOSXMenubutton.c: overridden on command line (from default
+ * macosx/tkMacOSXMenus.c: of current OS version).
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXWm.c:
+
+ * generic/tkImgGIF.c (ReadImage):
+ * macosx/tkMacOSXCursor.c (TkMacOSXCursor):
+ * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol):
+ * macosx/tkMacOSXFont.c (TkpMeasureCharsInContext):
+ * macosx/tkMacOSXInit.c (Map):
+ * xlib/xgc.c (XCreateGC): fix signed-with-unsigned comparison and other
+ warnings from gcc4 -Wextra.
+
+2006-07-14 Andreas Kupries <andreask@activestate.com>
+
+ * generic/tkWindow.c (Initialize): Modify change of 2006-05-25 (jeffh).
+ Release mutex a bit earlier, to prevent lock when OS X creates its
+ console windows (recursively enters Tk_Init). Patch by JeffH.
+
+2006-07-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/tkfbox.tcl: catch scrollbar use of highlightthickness
+
+2006-06-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/bgerror.tcl (::tk::dialog::error::bgerror): remove a couple
+ of unnecessary hardcoded options
+
+2006-06-14 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkScale.c: Revised variable writing logic to account for
+ [scale]'s design that it deals with its value as a formatted string,
+ and not as a double. [Bug 891141]
+
+2006-06-14 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXSubwindows.c (TkMacOSXInvalidateWindow): ensure
+ invalid clip regions are recreated via TkMacOSXUpdateClipRgn() before
+ they are used; correct call order of TkMacOSXInvalidateWindow() and
+ TkMacOSXInvalClipRgns() throughout. [Bug 1501922]
+
+ * macosx/tkMacOSXDraw.c (TkPutImage): implement drawing of very wide
+ images in slices of less than 4096 pixels to workaround CopyBits
+ limitation. [Bug 950121]
+
+2006-06-09 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c: Added Tcl_Preserve() call on the master interp
+ as crash protection against any Tcl_DeleteInterp() call that might
+ happen.
+
+2006-06-01 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Added Tcl_RegisterChannel() calls to bump the
+ refcount of channels passed to Tcl_SetStdChannel(). This prevents early
+ free-ing of the channels that leads to crashes. [Bug 912571]
+
+2006-05-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinEmbed.c (TkpGetOtherWindow): Do not panic if no window is
+ * unix/tkUnixEmbed.c (TkpGetOtherWindow): found; caller handles. [Bug
+ * unix/tkUnixWm.c (Tk_CoordsToWindow, UpdateGeometryInfo): 1212056]
+
+ * tests/entry.test (entry-22.1):
+ * tests/listbox.test (listbox-6.15):
+ * generic/tkListbox.c (ListboxInsertSubCmd, ListboxDeleteSubCmd):
+ Ignore Tcl_SetVar2Ex failure of listVarName, similar to entry widget
+ handling. [Bug 1424513]
+
+2006-05-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXButton.c (TkMacOSXDrawControl): correct redraw for
+ direct transition from disabled to active state. [Bug 706446]
+
+2006-05-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinMenu.c (TkWinMenuKeyObjCmd): get eventPtr after we know the
+ window is still alive. [AS bug 45987] [Bug 1236306]
+
+ * generic/tkMenu.c (DeleteMenuCloneEntries): Modify entry index
+ changes to work around VC6 optimization bug. [Bug 1224330]
+
+ * generic/tkMessage.c (MessageWidgetObjCmd): Correct msgPtr
+ preserve/release pairing. [Bug 1485750] (afredd)
+
+ * generic/tkWindow.c (Initialize): Correct mutex (un)lock pairing.
+ [Bug 1479587] (loewis)
+
+ * generic/tkBind.c (Tk_BindEvent, TkCopyAndGlobalEval): use Tcl_EvalEx
+ instead of Tcl_GlobalEval.
+
+2006-05-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): don't send
+ focus events to windows of class help or to overrideredirect windows.
+ [Bug 1472624]
+
+ * macosx/tkMacOSXWm.c: set overrideredirect windows to not become
+ activated by the window manager and to not receive OS activate events
+ (should make them behave more like on other platforms); use modern
+ window class API for overrideredirect and transient windows; set the
+ default class of overrideredirect windows to 'simple' rather than
+ 'plain' (i.e. no window frame); add missing Panther and Tiger window
+ attributes to [::tk::unsupported::MacWindowStyle].
+
+2006-05-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Fix
+ opt added 2006-03 that caused slowdown for some common cases. [Bug
+ 1409140]
+
+2006-05-13 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkCanvWind.c (DisplayWinItem, WinItemRequestProc): ensure
+ canvas window items are unmapped when canvas is unmapped. [Bug 940117]
+
+ * macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): empty clip
+ region of unmapped windows to prevent any drawing into them or into
+ their children from becoming visible. [Bug 940117]
+
+ * macosx/tkMacOSXInt.h: revert Jim's attempt of 2005-03-14 to
+ * macosx/tkMacOSXSubwindows.c: fix Bug 940117 as it disables Map/Unmap
+ event propagation to children. [Bug 1480105]
+
+ * macosx/tkMacOSXDraw.c (TkPutImage): handle tkPictureIsOpen flag,
+ fixes incorrect positioning of images with complex alpha on native
+ buttons; actual alpha blending is still broken in this situation. [Bug
+ 1155596]
+
+ * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent):
+ * macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): workaround carbon bug
+ with key shortcut for 'Preferences' app menu item. [Bug 1481503]
+
+ * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only check
+ for HICommand menu item shortcuts in the application menu.
+
+ * macosx/tkMacOSXInt.h: initialize keyboard layout setup in
+ * macosx/tkMacOSXInit.c: TkpInit() rather than during handling of
+ * macosx/tkMacOSXKeyEvent.c: first key down event.
+
+ * macosx/tkMacOSXDraw.c: add optional debug code to flash clip
+ * macosx/tkMacOSXSubwindows.c: regions during update or draw.
+
+2006-05-04 Don Porter <dgp@users.sourceforge.net>
+
+ * README: Bump version number to 8.5a5
+ * generic/tk.h:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+2006-04-28 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkWmMapWindow, InitialWindowBounds): fix use of
+ potentially stale window position in initial configure event on first
+ map of a window. [Bug 1476443]
+ (TkMacOSXWindowOffset): use modern GetWindowStructureWidths API.
+
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXMouseEvent.c (TkGenerateButtonEventForXPointer): new
+ internal function to generate button events for current pointer
+ directly, without requiring prior call to XQueryPointer().
+
+ * macosx/tkMacOSXMouseEvent.c (XQueryPointer): implement return of
+ window-local pointer position.
+
+ * macosx/tkMacOSXInt.h: use improvements above to avoid calls to
+ * macosx/tkMacOSXKeyEvent.c: GlobalToLocal() when the current port
+ * macosx/tkMacOSXMenu.c: might not be set correctly. May fix [Bug
+ * macosx/tkMacOSXMenus.c: 1243318]
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+
+ * tkAboutDlg.r: update copyright.
+
+ * macosx/tkMacOSXDebug.h: sync #includes with core-8-4-branch.
+ * macosx/tkMacOSXEvent.h:
+ * macosx/tkMacOSXFont.h:
+
+2006-04-26 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5a4 TAGGED FOR RELEASE ***
+
+ * changes: Updates for next RC
+
+2006-04-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * unix/tkUnixFont.c (TkpGetFontFamilies): Fix crash caused when the
+ XServer returns invalid font names. [Bug 1475865]
+
+2006-04-23 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/scrollbar.test: fix to tkAqua test failures
+
+2006-04-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXEmbed.c: fix to [Bug 1088814] test failures in
+ embed.test
+
+ * macosx/tkMacOSXWm.c:
+ * tests/constraints.tcl:
+ * tests/wm.test: fix to 'wm attributes' test for TkAqua
+
+2006-04-11 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkWindow.c (Tk_NameToWindow): Allow NULL interp to
+ Tk_NameToWindow. This fixes TkGetWindowFromObj which promises to handle
+ NULL but didn't.
+
+ * generic/tkGrid.c: Fixed handling of out of bounds row or column.
+ * tests/grid.test: [Bug 1432666]
+
+2006-04-11 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: Updated `make dist` target to be sure the
+ message catalogs for the widget demo get packaged into the source code
+ distribution. [Bug 1466509]
+
+2006-04-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * changes: added latest aqua bug fixes.
+
+ * macosx/tkMacOSXDialog.c (Tk_MessageBoxObjCmd): added standard Escape
+ key binding for msgbox cancel buttons [Patch 1193614], whitespace.
+
+ * macosx/tkMacOSXCarbonEvents.c: handle kEventCommandUpdateStatus
+ * macosx/tkMacOSXEvent.c: carbon event to dynamically enable
+ the 'Preferences' app menu item when proc [::tk::mac::ShowPreferences]
+ is defined. [Bug 700316]
+
+ * macosx/tkMacOSXHLEvents.c: call ::tk::mac::* procs for all
+ * macosx/tkMacOSXWindowEvent.c: registered appleevents [FR 1105284],
+ implement print applevent handling, style/whitespace cleanup.
+
+ * macosx/tkMacOSXDraw.c (TkMacOSXInitCGDrawing): prevent multiple init
+
+ * macosx/tkMacOSXFont.c: remove #ifdef'd text measuring codepaths now
+ * macosx/tkMacOSXInit.c: known to be incorrect, cleanup obsolete text
+ * macosx/README: antialiasing control code, document ATSUI
+ text antialiasing changes.
+
+ * macosx/tkMacOSXInt.h: Implemented 'zoomed' window state
+ * macosx/tkMacOSXWindowEvent.c: handling for TkAqua, via titlebar
+ * macosx/tkMacOSXWm.c: widget clicks as well as [wm state].
+ * doc/wm.n: [Bug 1073456]
+
+2006-04-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/tkfbox.tcl (::tk::IconList_Goto): Fix prefix searching so
+ that the start location is reasonable, and the prefix matching is
+ using the correct Tcl command for this. [Bug 1467938]
+
+2006-04-10 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c (MeasureStringWidth): Use implementation based
+ on ATSUGetGlyphBounds (TK_MAC_USE_GETGLYPHBOUNDS), so we can use
+ kATSUseFractionalOrigins. This in turn corrects [Bug 1461650].
+ (InitFont): Use "." and "W" instead of "i" and "w" to determine the
+ "-fixed" attribute. This prevents "Apple Chancery" from being
+ classified as fixed.
+ (InitFontFamilies): Only get the font families once.
+
+2006-04-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (WmResizableCmd): propagate window attribute
+ changes to Carbon window manager. [FR 1467004]
+ (TkSetWMName, TkMacOSXMakeRealWindowExist): allow empty name for
+ toplevels, remove bogus initial window name. [Bug 1450800]
+
+2006-04-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): fix return
+ values, implement window dragging & growing in background (with Command
+ key down) and by fronting clicks [Bug 934524], use correct button &
+ modifier state API when application is in background (also in
+ TkMacOSXButtonKeyState).
+
+ * macosx/tkMacOSXWm.c (TkMacOSXGrowToplevel): ensure QD port is set
+ correctly before using API relying on it.
+
+2006-04-06 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXMouseEvent.c: Now that [wm attributes -titlepath]
+ works correctly, add OS support for dragging proxy icons and using the
+ titlepath menu.
+
+2006-04-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): fix errors in
+ setting/removing window proxy icons via [wm attributes -titlepath] and
+ [wm iconbitmap], use HIWindow API on Tiger or later. [Bug 1455241]
+
+ * unix/tcl.m4: remove TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING
+ define on Darwin. [Tcl Bug 1457515]
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+2006-04-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkWindow.c (Initialize): remove impotent use of
+ DeleteWindowsExitProc as a global exit handler.
+
+ * generic/tkMenu.c (TkSetWindowMenuBar): remove extra TkMenuInit call
+ that caused finalization panic. [Bug 1456851]
+ * win/tkWinMenu.c (FreeID, TkpNewMenu, MenuExitHandler)
+ (MenuThreadExitHandler, TkpMenuInit, TkpMenuThreadInit): rework Windows
+ menu init/finalization to better respect per-process and per-thread
+ boundaries. [Bug 1456851]
+ (TkWinMenuKeyObjCmd): Do not error when unknown window is passed in.
+ [Bug 1236306]
+
+ * win/tkWinX.c (TkWinXInit): init default keyboard charset correctly.
+ [Bug 1374119] (pajas)
+
+ * win/tkWinWm.c (WmProc): pass WM_QUERYENDSESSION message to Tk as
+ WM_SAVE_YOURSELF wm protocol callback.
+
+ * tests/textWind.test (textWind-10.6.1): prevent infinite update loop
+ in case of test failure.
+
+ * tests/wm.test (wm-attributes-1.2.4): correct expected result.
+
+ * tests/grid.test: fix segfault on empty or "all" index list
+ * generic/tkGrid.c (GridRowColumnConfigureCommand): [Bug 1422430]
+
+2006-04-05 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c: fix to crash caused on some platforms by new tests
+ introduced to check for [Bug 1414171], which destroy the text widget in
+ the dump callback script.
+
+2006-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkOption.c (TkOptionDeadWindow): handle OptionThreadExitProc
+ being called before DeleteWindowsExitProc.
+
+ * win/Makefile.in: convert _NATIVE paths to use / to avoid ".\"
+ path-as-escape issue.
+
+2006-03-29 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for next RC
+
+ * unix/tkUnixDefault.h: Changed "Black" to "#000000" and "White" to
+ "#ffffff" to work around the (broken?) X servers that do not accept
+ those color names. [Bug 917433]
+
+2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tcl.m4, win/tcl.m4: []-quote AC_DEFUN functions.
+
+2006-03-26 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c:
+ * tests/text.test: Fix for elaborations of [Bug 1414171] for '$text
+ dump -command <script>' where script deletes large portions of the
+ text widget, or even destroys the widget.
+
+2006-03-28 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcode/default.pbxuser: add '-singleproc 1' cli arg to
+ * macosx/Wish.xcodeproj/default.pbxuser: tktest to ease test debugging.
+
+ * macosx/Wish.xcode/project.pbxproj: removed $prefix/share from
+ * macosx/Wish.xcodeproj/project.pbxproj: TCL_PACKAGE_PATH as per change
+ to tcl/unix/configure.in of 2006-03-13.
+
+ * macosx/tkMacOSXDraw.c: sync whitespace & minor changes with
+ * macosx/tkMacOSXEvent.h: core-8-4-branch.
+ * macosx/tkMacOSXFont.h:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXNotify.c:
+
+2006-03-27 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for next RC
+
+2006-03-27 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * generic/tkTextDisp.c (MeasureChars): Fix calculations of start and
+ end of string. [Bugs 1325998, 1456157]
+
+2006-03-27 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgGIF.c (FileReadGIF): Stop crashes when the first GIF
+ frame does not define the overall size of the image. [Bug 1458234]
+
+2006-03-26 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextBTree.c:
+ * tests/text.test: Fix for [Bug 1414171] for '$text dump -command
+ <script>' where 'script' actually modifies the widget during the
+ process.
+
+2006-03-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext):
+ * macosx/tkMacOSXFont.c (TkMacOSXQuarzStartDraw, TkMacOSXQuarzEndDraw):
+ performance improvements, sync similar code, formatting & whitespace.
+
+2006-03-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkTextDisp.c: Moved #ifdef MAC_OSX_TK code added by
+ * macosx/tkMacOSXColor.c: [Patch 638966] into platform specific files.
+ * macosx/tkMacOSXInt.h:
+
+ * macosx/tkMacOSX.h: Cleaned up & rationalized order of
+ * macosx/tkMacOSXBitmap.c: #includes of tk and carbon headers.
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXCarbonEvents.c:
+ * macosx/tkMacOSXClipboard.c:
+ * macosx/tkMacOSXColor.c:
+ * macosx/tkMacOSXConfig.c:
+ * macosx/tkMacOSXCursor.c:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXEmbed.c:
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXEvent.h:
+ * macosx/tkMacOSXFont.h:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXKeyboard.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXRegion.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXWm.h:
+ * macosx/tkMacOSXXStubs.c:
+
+2006-03-23 Reinhard Max <max@tclers.tk>
+
+ * unix/tkUnixRFont.c (TkpMeasureCharsInContext): Copied over from
+ tkUnixFont.c to fix compiling with --enable-xft .
+
+ * unix/tk.spec: Cleaned up and completed. An RPM can now be built from
+ the tk source distribution with "rpmbuild -tb <tarball>".
+
+2006-03-23 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/textDisp.test: Updated expected error messages to match the
+ standardized formats established on 2005-11-17. [Bug 1370296]
+
+2006-03-22 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for next RC
+
+2006-03-21 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkFont.c: implementation of ATSUI text rendering
+ * generic/tkInt.h: in TkAqua provided by Benjamin
+ * generic/tkTextDisp.c: Riefenstahl. [Patch 638966]
+ * library/demos/unicodeout.tcl:
+ * macosx/tkMacOSXFont.h (new file):
+ * macosx/tkMacOSXFont.c:
+ * tests/font.test:
+ * unix/tkUnixFont.c:
+ * win/tkWinFont.c:
+
+ * generic/tkFont.c: moved MODULE_SCOPE declarations of font
+ * generic/tkFont.h: helper procs into header files.
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXFont.h:
+ * macosx/tkMacOSXMenubutton.c:
+
+ * macosx/Wish.xcode/project.pbxproj: add new tkMacOSXFont.h file,
+ * macosx/Wish.xcodeproj/project.pbxproj: turn off dead code stripping
+ as it interferes with -sectcreate (rdar://4486223).
+
+ * macosx/Wish.xcode/default.pbxuser: add TCLLIBPATH=/Library/Tcl
+ * macosx/Wish.xcodeproj/default.pbxuser: env var setting to tktest.
+
+ * unix/configure.in: fix detection of symbols build when enabling
+ TkAqua debug code; filter nm output of libtclstub better to avoid
+ error on intel macs. [Bug 1415789]
+ * unix/configure: autoconf-2.59
+
+2006-03-20 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Added exit handler to clean up the interp where
+ the console window lives. Also added code to handle multiple calls to
+ Tk_CreateConsoleWindow so that the console channels connect to the last
+ console window opened, in compatibility with the previous
+ implementation.
+
+2006-03-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c: Fix for undo/modified status of text widgets when
+ empty strings are inserted and undone.
+
+2006-03-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/clrpick.tcl: Avoid using abbreviated sub-commands in core
+ * library/palette.tcl: scripts as this can cause problems with
+ * library/scale.tcl: mega-widget libraries like snit.
+ * library/scrlbar.tcl: [Bug 1451587]
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+
+2006-03-16 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c: Substantial rewrite of [console] support.
+ * generic/tkInt.h: Included Obj-ification of the [console] and
+ [consoleinterp] commands, and reworking of all the supporting data
+ structures for cleaner sharing and lifetime management especially in
+ multi-threaded configurations.
+
+2006-03-16 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/msgs/pt.msg: Messages for Portuguese (strictly just for
+ Brazilian Portuguese, but they'll do until we get other Portuguese
+ speakers localize) from Ricardo Jorge <ricardoj@users.sf.net> and Silas
+ Justiano <silasj@users.sf.net>. Many thanks! [Bug 1405069]
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd, Tk_PhotoPutBlock)
+ (Tk_PhotoPutZoomedBlock): Added hack to detect copying of a photo with
+ a simple alpha channel and skip calling ToggleComplexAlphaIfNeeded.
+ This should speed up many photo-to-photo copies, keeping the cost of
+ the alpha channel down.
+
+2006-03-15 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Try
+ to squelch performance issue with code that writes to large images by
+ single pixels. Masses of thanks to George Staplin for helping to trace
+ this down to the COMPLEX_ALPHA flag handling code. [Bug 1409140]
+
+2006-03-13 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/scrollbar.test: Corrected several broken calls to [testmetrics]
+ that were crashing the test suite.
+
+ * tests/constraints.tcl: Added notAqua constraint to canvPs-3.1
+ * tests/canvPs.test: to stop test suite crash on Mac OSX.
+ [Bug 1088807]
+
+ * generic/tkCmds.c: Purged remaining references to errno,
+ * macosx/tkMacOSXPort.h: and errno.h. Standardized the logic
+ * macosx/tkMacOSXWm.c: for using header files from the compat
+ * macosx/tkMacOSXWm.h: directory. Thanks Joe English for the
+ * unix/tkUnixPort.h: patch. [Patch 1445404]
+
+2006-03-08 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: Update `make dist` to copy the image files needed
+ by the test suite into the source distro. This was overlooked in the
+ 2005-10-12 commit.
+
+ * changes: Update in prep. for 8.5a4 release.
+
+2006-03-07 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD, as per the other
+ *BSD variants. [Bug 1334613]
+ * unix/configure: Regenerated.
+
+2006-03-07 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/canvas.n: Added note that stipples are not well-supported on
+ non-X11 platforms. [Bug 220787] It's not a great solution, but it does
+ indicate the state of affairs that has existed for years anyway; not
+ much modern software uses stipples anyway.
+
+2006-03-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXDraw.c (TkPutImage): Fix endian issue on OS X x86
+ displaying images. Bitmap images still have a black/white reversal
+ issue, appears to be a general OS X issue (as seen in frogger demo).
+
+2006-02-27 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkBitmap.c (Tk_GetBitmapFromData): Improve thread-safety.
+ [Bug 470322]
+
+ * generic/tkImgBmap.c (ImgBmapConfigureInstance): Force creation of new
+ Pixmaps before deletion of old ones to prevent stupid caching problems.
+ [Bug 480862]
+
+2006-02-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tk.decls: fix signature of TkMacOSXInvalClipRgns
+ * generic/tkPlatDecls.h: to use Tk_Window instead of internal
+ * macosx/tkMacOSXSubwindows.c: type TkWindow (which led to any include
+ * macosx/tkMacOSXWindowEvent.c: of public header tkMacOSX.h requiring
+ * macosx/tkMacOSXWm.c: prior include of tkInt.h).
+
+ * generic/tk.h: move TkAqua specific REDO_KEYSYM_LOOKUP define
+ * macosx/tkMacOSXPort.h: out of tk.h into platform header.
+
+2006-01-31 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/bgerror.tcl (::tk::dialog::error::bgerror): Finish the
+ internationalization of the error dialog. [Bug 1409264]
+
+2006-01-25 Don Porter <dgp@users.sourceforge.net>
+
+ * library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759]
+ * library/choosedir.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/focus.tcl:
+ * library/msgbox.tcl:
+ * library/palette.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+
+2006-01-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/configure: minor fix to Darwin specific code removing
+ * unix/configure.in: 64bit flags from CFLAGS for Tk build.
+
+2006-01-20 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkEvent.c, unix/tkUnixEvent.c: XIM fixes [See 905830, patch
+ tk84-xim-fixes.patch], and revert 2005-12-05 patch disabling XIM when
+ SCIM in use, and make sure all X events get passed to XFilterEvent,
+ including those without a corresponding Tk window.
+
+2006-01-13 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * generic/tkUndo.c (TkUndoSetDepth): Don't free TkUndoSubAtoms for
+ separator entries that are deleted: there is some unpredictable garbage
+ instead of subatoms.
+
+ Free both 'apply' and 'revert' action chains for non-separator entries.
+
+2006-01-12 Donal K. Fellows <dkf@users.sf.net>
+
+ TIP #260 IMPLEMENTATION
+
+ * generic/tkCanvText.c (TextItem, CreateText, DisplayCanvText):
+ * doc/canvas.n: Code, docs and tests to implement an -underline
+ * tests/canvText.test: option for canvases' text items.
+
+2006-01-11 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkGrid.c: Removed a lingering error message from TIP#147
+ implementation.
+
+2006-01-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDebug.c: add TkMacOSXGetNamedDebugSymbol() function
+ * macosx/tkMacOSXDebug.h: that finds unexported symbols in loaded
+ libraries by manually walking their symbol table; only to be used for
+ debugging purposes, may break unexpectedly in the future. Needed to get
+ access to private_extern internal debugging functions in HIToolbox.
+
+ * macosx/tkMacOSXCarbonEvents.c: fix debug event tracing on Tiger.
+ * macosx/tkMacOSXMenu.c: add debug menu printing during reconfigure.
+ * macosx/tkMacOSXInit.c: conditionalize 64bit-unsafe dyld code.
+ * macosx/GNUmakefile: add 'wish8.x' symlink to SYMROOT.
+
+ * macosx/Wish.xcode/project.pbxproj: fix copy to tktest resource
+ * macosx/Wish.xcodeproj/project.pbxproj: fork when zerolinked.
+
+ * macosx/Wish.xcode/default.pbxuser: add widget demo as argument to
+ * macosx/Wish.xcodeproj/default.pbxuser: executables (on by default).
+
+ * unix/configure: add caching, use AC_CACHE_CHECK instead of
+ * unix/configure.in: AC_CACHE_VAL where possible, consistent message
+ * unix/tcl.m4: quoting, sync relevant tclconfig/tcl.m4 changes
+ and gratuitous formatting differences, fix SC_CONFIG_MANPAGES with
+ default argument, Darwin improvements to SC_LOAD_*CONFIG.
+
+2005-12-28 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkUndo.c (TkUndoSetDepth): Apply [Patch 1391939] from Ludwig
+ Callewaert to fix [Bug 1380427].
+
+2005-12-14 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.xcodeproj/project.pbxproj: add new tclTomMath* files.
+
+2005-12-13 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/demos/cscroll.tcl: add MouseWheel bindings for aqua.
+
+ * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent)
+ (GenerateMouseWheelEvent): add support for kEventMouseScroll events
+ (smooth mouse wheel scrolling from mighty mouse or scrolling trackpad)
+ by handling kEventMouseWheelMoved on application target as well as on
+ dispatcher, in order to pick up synthesized MouseWheel events from
+ HIObject handler (c.f. QA1453); add support for horizontal scrolling
+ events by generating MouseWheel XEvent with Shift modifier.
+
+2005-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tcl.m4, unix/configure: Fix sh quoting error reported in
+ bash-3.1+ [Bug 1377619] (schafer)
+
+2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinWm.c (WinSetIcon): Don't check result of SetClassLong() or
+ SetClassLongPtr() since it was generating an incorrect error and the
+ MSDN docs indicate that the result need not be checked.
+
+2005-12-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): Define MACHINE for gcc builds. The
+ lack of a definition of this variable in the manifest file was causing
+ a runtime error in wish built with gcc.
+
+2005-12-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkInt.decls: Move all platform test sources from tk lib into
+ * generic/tkTest.c: tktest directly, removes requirement to export
+ * macosx/tkMacOSXTest.c:TkplatformtestInit from internal stubs table.
+ * unix/Makefile.in:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/tkWinTest.c:
+
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c: regen.
+
+2005-12-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tcl.m4: Add build support for Windows-x64 builds.
+ * win/configure: --enable-64bit now accepts =amd64|ia64 for
+ * win/Makefile.in: Windows 64-bit build variants (default: amd64)
+ * win/makefile.vc: [Bug 1369597]
+ (TKOBJS): add tkWinTest.obj to regular Tk obj for TkplatformtestInit
+
+ * win/configure.in: Add CE build support (some C code fixes needed)
+ * win/wish.exe.manifest.in (new): manifest must map in MACHINE and
+ * win/rc/wish.exe.manifest (removed): VERSION to be correct.
+ * unix/Makefile.in: fix dist target for manifest dir change
+
+ * generic/tkTextTag.c (TkTextTagCmd): use correct arraySize for peered
+ text widgets in [$text tag names]. [Bugs 1375069, 1374935]
+
+2005-12-08 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDraw.c: Remove inclusion of tclInt.h and use of tcl
+ * macosx/tkMacOSXFont.c: internals wherever possible in tk/macosx, the
+ * macosx/tkMacOSXInit.c: only remaining tcl internals in TkAqua are
+ * macosx/tkMacOSXNotify.c:TclServiceIdle() in tkMacOSXScrlbr.c and
+ * macosx/tkMacOSXScrlbr.c:Tcl_Get/SetStartupScript() in tkMacOSXInit.c
+ [RFE 1336531]
+
+ * macosx/tkMacOSXInt.h: sync comments with core-8-4-branch.
+
+2005-12-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixEvent.c (OpenIM): remove extraneous const
+
+2005-12-06 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * doc/ConfigWidg.3 (TK_CONFIG_OPTION_SPECIFIED): Mentioned that the
+ flag is deprecated because it is not thread-safe.
+
+2005-12-05 Reinhard Max <max@suse.de>
+
+ * unix/tkUnixEvent.c (OpenIM): Added a workaround to allow at least
+ ASCII and the Compose key when typing into text and entry widgets on a
+ system that uses SCIM. This has to be taken out again once the SCIM
+ problems have been fixed.
+
+2005-12-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
+ * unix/configure: regen.
+
+2005-11-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect before
+ rewrapping. [Bug 1086049]
+
+ * macosx/tkMacOSXXStubs.c (TkpOpenDisplay, TkMacOSXDisplayChanged):
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent):
+ * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
+ * macosx/tkMacOSXEvent.h: Trap kEventAppAvailableWindowBoundsChanged
+ * macosx/tkMacOSXInt.h: event to watch for change in display size and
+ adjust internal state appropriately.
+
+ * doc/checkbutton.n: fix -selectcolor docs. [Bug 1083838]
+
+ * generic/tkImgGIF.c: cast calls to blockOut
+
+ * win/Makefile.in: place TCL_BIN_DIR first in PATH for targets to get
+ Tcl built dll first.
+ Add tkWinTest.obj to tk84.dll to handle some needed test functions
+ being defined in stubs (TkplatformtestInit).
+
+ * tests/scrollbar.test (6.22): fix rounding-error sensitive test
+
+2005-11-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/console.tcl (::tk::ConsoleInit): improve work-around to avoid
+ '% ' from tclMain.c. [Bug 1252259]
+
+2005-11-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
+ add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to
+ configure (flag can't be present twice, so can't be in both CFLAGS and
+ LDFLAGS during configure), don't use -prebind when deploying on 10.4,
+ define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542).
+ (SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete
+ autoconf macros. Sync with tcl/unix/tcl.m4.
+
+ * unix/configure.in: fix obsolete autoconf macros, sync gratuitous
+ formatting/ordering differences with tcl/unix/configure.in.
+
+ * unix/Makefile.in: add CFLAGS to wish/tktest link to make executable
+ linking the same as during configure (needed to avoid loosing any
+ linker relevant flags in CFLAGS, in particular flags that can't be in
+ LDFLAGS). Avoid concurrent linking of wish and compiling of
+ tkTestInit.o during parallel make, fix dependencies and flags for
+ building tkMacOSXInit.o
+ (checkstubs, checkexports): dependency and Darwin fixes
+ (dist): add new macosx files.
+
+ * macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent):
+ * macosx/tkMacOSXEvent.h:
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
+ * macosx/tkMacOSXCarbonEvents.c: install standard application event
+ handler, add & call functions to start and stop carbon even timer that
+ runs the tcl event loop periodically during a nested carbon event loop
+ in the toolbox (e.g. during menutracking) to ensure tcl timers etc.
+ continue to fire, register app event handler for menu tracking and HI
+ command carbon events, move menu event handling to new handlers for
+ those carbon events, no longer register for/handle appleevent carbon
+ event (now dealt with by standard application event handler), event
+ debugging code dynamically acquires carbon event debugging functions to
+ allow use on Tiger where they are no longer exported from HIToolbox.
+
+ * macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText):
+ * macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout):
+ * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXInt.h: abstract common code to dynamically acquire
+ address of a named symbol (from a loaded dynamic library) into new
+ function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol.
+
+ * macosx/tkMacOSXMenu.c (TkpNewMenu):
+ * macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
+ * macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to modern
+ utf-8 aware menu manager API, remove obsolete code, add error handling.
+
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants
+ if necessary to allow compilation on OSX 10.2
+
+ * macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
+ executed.
+
+ * xlib/xgc.c (XCreateGC): sync with core-8-4-branch change.
+
+ * generic/tk.h: add/correct location of version numbers in macosx files
+
+ * generic/tkInt.h: clarify fat compile comment.
+
+ * macosx/Wish.pbproj/default.pbxuser (new):
+ * macosx/Wish.pbproj/jingham.pbxuser:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Wish.xcode/default.pbxuser:
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.xcodeproj/default.pbxuser (new):
+ * macosx/Wish.xcodeproj/project.pbxproj (new): new/updated projects for
+ Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with
+ native tktest targets and support for universal (fat) compiles.
+
+ * macosx/Tk-Info.plist (removed):
+ * macosx/Wish-Info.plist (removed):
+ * macosx/buildTkConfig.tcl (removed): remove obsolete build files.
+
+ * macosx/README: clarification/cleanup, document new Xcode projects and
+ universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).
+
+ * unix/Makefile.in:
+ * unix/aclocal.m4:
+ * unix/configure.in:
+ * macosx/configure.ac (new): add support for inclusion of
+ unix/configure.in by macosx/configure.ac, allows generation of a
+ config headers enabled configure script in macosx (required by Xcode
+ projects).
+
+ * macosx/GNUmakefile: rename from Makefile to avoid overwriting by
+ configure run in tk/macosx, add support for reusing configure cache,
+ build target fixes.
+
+ * generic/tk3d.h:
+ * generic/tkButton.h:
+ * generic/tkCanvas.c:
+ * generic/tkCanvas.h:
+ * generic/tkColor.h:
+ * generic/tkEntry.h:
+ * generic/tkFileFilter.h:
+ * generic/tkFont.c:
+ * generic/tkFont.h:
+ * generic/tkImage.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkInt.h:
+ * generic/tkMenu.c:
+ * generic/tkMenu.h:
+ * generic/tkMenubutton.h:
+ * generic/tkScale.h:
+ * generic/tkScrollbar.h:
+ * generic/tkSelect.h:
+ * generic/tkStubInit.c:
+ * generic/tkStubLib.c:
+ * generic/tkText.h:
+ * generic/tkUndo.h:
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXDebug.c:
+ * macosx/tkMacOSXDebug.h:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXSend.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixMenu.c:
+ * xlib/xgc.c: ensure externally visible symbols not contained in stubs
+ table are declared as MODULE_SCOPE (or as static if not used outside of
+ own source file), #ifdef out a few Xlib and aqua functions that are
+ never called. These changes allow 'make checkstubs' to complete without
+ error on Darwin with gcc 4.
+
+ * macosx/tkMacOSXTest.c:
+ * macosx/tkMacOSXPort.h:
+ * win/tkWinTest.c:
+ * generic/tkInt.decls: add functions needed by tktest to internal stubs
+ table, correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua
+ Xlib stubs.
+
+ * unix/tkUnixSend.c:
+ * generic/tkText.c:
+ * generic/tkTest.c: #ifdef unix only declarations.
+ (TestmetricsCmd): unify win and mac implementation.
+ (TestsendCmd): move to tkUnixSend.c to avoid access to global var.
+ (TesttextCmd): move to tkText.c to avoid having to put all the internal
+ text functions it uses into the stubs table.
+
+ * generic/tkTextDisp.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.
+
+ * macosx/tkMacOSXNotify.c:
+ * macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.
+
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkStubInit.c:
+ * unix/configure:
+ * unix/tkConfig.h.in: regen.
+
+2005-11-22 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/tkfbox.tcl: Remove all references to data(curItem), as it is
+ no longer used. [Bug 600313]
+ (::tk::IconList_CurSelection): Renamed for clarity.
+
+ * doc/GetFont.3: Revert previous fix; a NULL interp is now legal.
+ * generic/tkFont.c (ParseFontNameObj, GetAttributeInfoObj): Allow these
+ functions to work with a NULL interp by making them check when
+ generating error messages. [Bug 1151523]
+
+ * library/tkfbox.tcl (::tk::dialog::file::): Correct the quoting of the
+ script used in variable traces so that widget names with spaces in will
+ work. [Bug 1335485]
+
+2005-11-16 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * doc/text.n: clarify left to right interpretation of index modifiers,
+ including the fact that validation occurs after each step. [Bug
+ 1357575]
+
+2005-11-15 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c, tests/unixWm.test, doc/wm.n: Support for [wm
+ attributes] on X11. [TIP#231, Patch 1062022]
+
+2005-11-14 Joe English <jenglish@users.sourceforge.net>
+
+ * library/bgerror.tcl: Truncate error messages at 45 characters
+ instead of 30. [Bug 1224235]
+
+2005-11-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkSelect.c (TkSelDefaultSelection): Test select-9.5
+ highlighted further brokenness in this function.
+
+2005-11-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * unix/tkUnixSelect.c (SelCvtToX): Arrange for the parsing code to use
+ Tcl's list parsing code, another simplification that enables testing
+ of the [Bug 1353414] fix.
+
+ * unix/tkUnixSelect.c (SelCvtFromX): Generate string forms of the
+ advanced selection types in a Tcl_DString. This makes fixing [Bug
+ 1353414] trivial, and simplifies the code at the same time.
+ * tests/select.test (select-9.5): Added test for [Bug 1353414]
+
+2005-11-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkBind.c (ChangeScreen): More DString fixes from
+ * generic/tkTextWind.c (EmbWinLayoutProc): [Bug 1353022]
+ * win/tkWinMenu.c (SetDefaults):
+
+ * win/tkWinDialog.c (ConvertExternalFilename): Factored out the
+ encoding conversion and de-backslash-ing code that is used in many
+ places in this file.
+ (GetFileNameW, GetFileNameA, ChooseDirectoryValidateProc): Make sure
+ that data is freed correctly and that certain (hopefully impossible)
+ failure modes won't cause crashes. [Bug 1353022]
+
+2005-11-06 Pat Thoyts <pat@zsplat.freeserve.co.uk>
+
+ * unix/tcl.m4: Fix SHLIB_LD_LIBS for building tclkit on OpenBSD.
+ * unix/configure: regenerated
+
+2005-10-31 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c
+ * tests/textDisp.test: fix and test for [Bug 1333951] in '.text count
+ -displaylines'.
+
+2005-10-18 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c: Rewrote code that sets the ::argv value to be sure
+ conversion from the system encoding is complete before any processing
+ sensitive to list-special characters is done. [Bug 1328926]
+
+2005-10-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXScrlbr.c (UpdateControlValues): check geomMgrPtr is
+ valid before checking type
+
+2005-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/menu.tcl (::tk::MenuUnpost): remove leftover ] from string
+ equal mods of 2005-07-25. (sowadsky)
+
+2005-10-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinSend.c: Avoid using tcl internal headers and fix to
+ * win/tkWinSendCom.h: correctly link on all types of build (was
+ * win/tkWinSendCom.c: broken in static,msvcrt builds).
+
+2005-10-12 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/canvPs.test, tests/canvPsBmap.tcl, tests/canvPsImg.tcl:
+ * tests/imgPhoto.test, tests/menu.test: Arrange for the test suite to
+ only ever refer to images in the same directory as the tests. This
+ makes it possible to package the test suite itself as a starkit. Thanks
+ to David Zolli for suggesting this.
+
+2005-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkConfig.c (Tk_DeleteOptionTable, Tk_CreateOptionTable):
+ properly alloc/delete one more option. [Bug 1319720] (melbardis)
+
+ * macosx/tkMacOSXInt.h: Move MODULE_SCOPE defn to tkInt.h and add
+ * generic/tkInt.h: WORDS_BIGENDIAN checks that will work with OS X
+ universal binary compiles. (steffen)
+
+ * generic/tkMenu.c (TkSetWindowMenuBar): do not call TkMenuInit if the
+ winPtr indicates TK_ALREADY_DEAD. This prevents reinit that creates a
+ Tk exit handler after all exit handlers should be called. [Bug 749908,
+ 1322294]
+
+2005-10-10 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ TIP #256 IMPLEMENTATION
+
+ * doc/text.n
+ * 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
+ * macosx/tkMacOSXDefault.h
+ * tests/text.test
+ * tests/textDisp.test
+ * unix/tkUnixDefault.h
+ * win/tkWinDefault.h: Implementation of TIP#256, adding a new text
+ widget configuration option '-tabstyle', with new tests and
+ documentation.
+
+ Also a fix for [Bug 1281228] (documentation and full implementation of
+ -strictlimits), and [Bug 1288677] (corrected elide behaviour), again
+ with more tests.
+
+2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/dialog.tcl (::tk_dialog): add tkwait visibility before grab.
+ [Bug 1216775]
+
+ * win/tkWinDialog.c (ChooseDirectoryValidateProc): reset stored path to
+ "" if it doesn't exist and -mustexist is true. [Bug 1309218] Remove
+ old-style dir chooser (no longer used).
+
+ * macosx/tkMacOSXInt.h: add MODULE_SCOPE definition check for extension
+ writers that access private headers on OS X and don't define it in
+ configure.
+
+2005-09-28 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tkUnixPort.h: Disabled inclusion of the private Tcl header
+ * win/tkWinPort.h: file tclInt.h. Tk ought to have a tiny and
+ shrinking number of calls of private Tcl routines. Each Tk source file
+ doing this should follow the convention in the macosx port and have its
+ own #include "tclInt.h".
+
+ * generic/tkEvent.c: Disabled calls to private Tcl routine
+ TclInExit(). See comment in TkCreateExitHandler() for full rationale.
+
+2005-09-21 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkEvent.c (TkCreateThreadExitHandler, TkFinalizeThread)
+ (TkDeleteThreadExitHandler): New internal API (from Joe Mistachkin) to
+ allow Tk to finalize itself correctly in a multi-threaded
+ environment. [Bug 749908]
+
+2005-09-14 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkOldConfig.c (GetCachedSpecs): Split out the code to
+ manipulate the cached writable specs so that it can be reused from all
+ the public Tk_Configure* functions.
+ (Tk_ConfigureInfo, Tk_ConfigureWidget, Tk_ConfigureValue): Use the
+ factored out code everywhere, so we always manipulate the cache
+ correctly. [Bug 1288128]
+
+2005-09-13 Don Porter <dgp@users.sourceforge.net>
+
+ * win/winMain.c (WishPanic): Replaced TCL_VARARGS* macros with direct
+ use of stdarg.h conventions.
+
+2005-09-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): check if
+ process is in front on MouseDown, otherwise request process activation
+ from BringWindowForward() via new isFrontProcess param.
+
+ * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents): register
+ our event handler on the dispatcher target for all carbon events of
+ interest to TkAqua; this replaces event processing directly from the
+ event queue and thus allows to capture events that are syntesized by
+ Carbon and sent directly to the dispatcher and not to the event queue.
+
+ * macosx/tkMacOSXEvent.c: remove TkMacOSXCountAndProcessMacEvents(),
+ rename ReceiveAndProcessEvent() to TkMacOSXReceiveAndProcessEvent().
+ (TkMacOSXReceiveAndProcessEvent): remove tk event processing before
+ sending events to the dispatcher, all events of interest are now
+ processed in our dispatcher target event handler.
+
+ * macosx/tkMacOSXNotify.c (CarbonEventsCheckProc): dispatch events
+ directly via TkMacOSXReceiveAndProcessEvent(), but dispatch no more
+ than four carbon events at one time to avoid starving other event
+ sources.
+
+ * macosx/tkMacOSXEvent.c: formatting cleanup, move XSync() to XStubs,
+ * macosx/tkMacOSXEvent.h: removed obsolete kEventClassWish handling.
+ * macosx/tkMacOSXXStubs.c
+
+ * macosx/tkMacOSXEvent.h: declare macosx internal procs as MODULE_SCOPE
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXWindowEvent.c:
+
+ * macosx/tkMacOSXButton.c: conditionalize all debug message printing to
+ * macosx/tkMacOSXCursor.c: stderr via TK_MAC_DEBUG define.
+ * macosx/tkMacOSXDebug.c:
+ * macosx/tkMacOSXDebug.h:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.c:
+
+ * unix/configure.in: define TK_MAC_DEBUG on aqua when symbols enabled.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+ * library/listbox.tcl: synced aqua MouseWheel bindings with
+ * library/scrlbar.tcl: core-8-4-branch.
+ * library/text.tcl:
+
+ * xlib/xcolors.c: fixed warning
+
+2005-08-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in (html): reverted/amended changes of 2005-08-23 that
+ broke TkAqua 'make install'; added BUILD_HTML_FLAGS optional var like
+ in tcl/unix/Makefile.in.
+
+2005-08-24 Donal K. Fellows <dkf@users.sf.net>
+
+ * tests/text.test (text-8.18): Fix punctuation of error message to
+ match good practice (actual message already fixed). [Bug 1267484]
+
+2005-08-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXDialog.c: make dialogs ignore -initialfile "" and
+ -initialdir "" instead of error.
+
+2005-08-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWin32Dll.c (DllMain): Replace old asm SEH approach with Kenny's
+ new SEH implementation. [Tcl Bug 1235544]
+
+2005-08-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Subst BUILD_TCLSH and TCL_EXE.
+ * unix/configure: Regen.
+ * unix/configure.in: Update minimum autoconf version to 2.59. Invoke
+ SC_PROG_TCLSH and SC_BUILD_TCLSH.
+ * unix/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH):
+ * win/Makefile.in: Subst BUILD_TCLSH and TCL_EXE.
+ * win/configure: Regen.
+ * win/configure.in: Update minimum autoconf version to 2.59. Invoke
+ SC_BUILD_TCLSH.
+ * win/tcl.m4 (SC_PROG_TCLSH, SC_BUILD_TCLSH): Split confused search
+ for tclsh on PATH and build and install locations into two macros.
+ SC_PROG_TCLSH searches just the PATH. SC_BUILD_TCLSH determines the
+ name of the tclsh executable in the Tcl build directory. [Tcl Bug
+ 1160114] [Tcl Patch 1244153]
+
+2005-08-22 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXDialog.c: fix warnings.
+
+2005-08-20 Joe Mistachkin <joe@mistachkin.com>
+
+ * win/tkWinX.c: Fixed bad cast. [Bug 1216006]
+
+2005-08-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * doc/GetFont.3: Reworded to reflect the truth. [Bug 1151523]
+
+2005-08-16 George Peter Staplin <GeorgePS@XMission.com>
+
+ * doc/CrtItemType.3 prototypes were lacking [] after objv. Thus the man
+ page was wrong about the actual prototypes. This was verified by
+ studying tkCanvBmap.c.
+
+2005-08-13 Chengye Mao <chengye.geo@yahoo.com>
+
+ * generic/tkOldConfig.c: Fixed [Bug 1258604]. This bug was introduced
+ into the modfied Tk_ConfigureWidget. It failed to properly handle the
+ specFlags' bit TK_CONFIG_OPTION_SPECIFIED.
+
+2005-08-12 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkOldConfig.c (Tk_ConfigureWidget): Stop storing per-thread
+ data in global data structures. Store it in per-interpreter data (i.e.
+ per-thread data) instead. [Bug 749908]
+
+2005-08-10 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFrame.c (CreateFrame) and others: Don't use size_t when
+ working with Tcl_GetStringFromObj because it is not 64-bit clean. [Bug
+ 1252702]
+
+2005-08-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * doc/text.n: Clarify behaviour of tab stops (as per [Bug 1247835])
+
+2005-08-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXCarbonEvents.c (AppEventHandlerProc): handle carbon
+ events sent directly to application event target via the general
+ TkMacOSXProcessEvent() in the same way as events posted to the event
+ loop. Moved existing app event handlers to tkMacOSXWindowEvent.c.
+ (TkMacOSXInitCarbonEvents): register our application event handler for
+ kEventWindowExpanded events to deal with uncollapsing from the dock.
+
+ * macosx/tkMacOSXEvent.h: made TkMacOSXProcessEvent() non-static, added
+ * macosx/tkMacOSXEvent.c: new interp field to TkMacOSXEvent struct for
+ use by app event handler.
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): retrieve
+ current window, partCode, modifiers and local cursor position from
+ carbon mouse event if possible. Use new static GenerateButtonEvent()
+ taking a MouseEventData struct instead of TkGenerateButtonEvent() to
+ avoid recomputing already known values. Move process activation on
+ MouseDown into BringWindowForward() to allow clicking on window
+ titlebar widgets without activating process. Move code dealing with
+ clicks in window titelbar into separate function
+ HandleWindowTitlebarMouseDown() to avoid code duplication. Avoid
+ repeated calls to TkMacOSXGetXWindow() by storing result in
+ MouseEventData struct.
+ (TkMacOSXButtonKeyState, XQueryPointer): try to get button and modifier
+ state from currently processed carbon event (to avoid unnecessary IPC
+ with the window server), otherwise use modern carbon API to get this
+ info instead of Button() and GetKeys(); only retrieve info caller asks
+ for (via non-NULL ptr passed to XQueryPointer).
+ (ButtonModifiers2State): new static function converting carbon button
+ and modifier state into tk state, allows detection of more than 3 mouse
+ buttons (tk supports up to 5) and of NumLock and Fn modifier keys
+ (NumLock is mapped to Mod3 and Fn to Mod4).
+
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent):
+ handle kEventWindowExpanded event to deal with window uncollapsing from
+ the dock by generating tk Map event, handle kEventAppHidden and
+ kEventAppShown events (moved here from tkMacOSXCarbonEvents.c).
+
+ * macosx/tkMacOSXSubwindows.c (XUnmapWindow): only hide window when it
+ is not iconified to avoid window flashing on collapse.
+
+ * macosx/tkMacOSXWm.c: replaced Tk_DoWhenIdle() by Tcl_DoWhenIdle().
+ (TkMacOSXZoomToplevel): remove call to TrackBox(), now done in
+ HandleWindowTitlebarMouseDown() in tkMacOSXMouseEvent.c.
+ (TkpWmSetState): avoid window flashing on collapse by unmapping after
+ calling CollapseWindow(); only uncollapse window if it is collapsed.
+
+ * generic/tkInt.decls: changed TkMacOSXZoomToplevel() signature.
+ * generic/tkIntPlatDecls.h:
+
+ * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): only call
+ GetMenuItemCommandID() on KeyDown or KeyRepeat events.
+
+ * macosx/tkMacOSXMenu.c (ReconfigureMacintoshMenu): remove call to
+ obsolete AppendResMenu() API.
+
+ * macosx/tkMacOSXKeyEvent.c: replaced all direct uses of expensive
+ * macosx/tkMacOSXMenu.c: GetMouse() and TkMacOSXButtonKeyState()
+ * macosx/tkMacOSXMenus.c: APIs by calls to XQueryPointer()
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXScale.c:
+ * macosx/tkMacOSXScrlbr.c:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDialog.c: replaced use of FrontNonFloatingWindow()
+ * macosx/tkMacOSXKeyEvent.c: by ActiveNonFloatingWindow() as
+ * macosx/tkMacOSXMenu.c: recommended by Carbon docs.
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWm.c:
+
+ * macosx/tkMacOSXDialog.c: fixed warnings
+ * macosx/tkMacOSXTest.c:
+
+ * macosx/tkMacOSXCarbonEvents.c: added CVS Id line to file header.
+ * macosx/tkMacOSXDebug.c:
+ * macosx/tkMacOSXDebug.h:
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXEvent.h:
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXMouseEvent.c:
+ * macosx/tkMacOSXWindowEvent.c:
+ * macosx/tkMacOSXWm.h:
+
+ * macosx/tkMacOSXInt.h: declare macosx internal procs as MODULE_SCOPE.
+ * macosx/tkMacOSXCarbonEvents.c:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXWindowEvent.c
+
+ * library/bgerror.tcl: sync with core-8-4-branch changes of 2005-07-28.
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXMouseEvent.c:
+
+ * generic/tkFrame.c: sync with core-8-4-branch changes of 2005-07-27.
+ * generic/tkIntDecls.h:
+ * generic/tkStubInit.c:
+ * generic/tkFrame.c:
+ * win/tkWinDraw.c:
+ * unix/tkUnixDraw.c:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXSubwindows.c:
+
+ * macosx/tkMacOSXButton.c: sync with core-8-4-branch.
+ * macosx/tkMacOSXEntry.c:
+ * macosx/tkMacOSXScale.c:
+
+ * library/demos/menu.tcl: removed errant '}'.
+
+2005-08-04 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * doc/clipboard.n: Add example demonstrating custom types of clipboard
+ data.
+
+2005-07-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/*.tcl: Updated to use more 8.4 and 8.5 features as part of
+ resolving [Patch 1237759].
+
+2005-07-22 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinX.c: Define _WIN32_WINNT with NT SP 3 data to fix compiler
+ error because SendInput was not defined. The new msys_mingw7 release is
+ now needed to compile the HEAD with mingw gcc. [Bug 1210712]
+
+2005-07-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): corrected if
+ expression error (use of = instead of ==).
+
+2005-07-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextMark.c: fix to segfault in "mark prev"
+ * tests/textIndex.test: [Bug 1240221]
+
+ * tests/textWind.test: make test more robust to avoid infinite loop
+
+2005-07-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/getOpenFile.n: correct -multiple docs (takes boolean)
+
+2005-07-05 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/Makefile.in: Purged use of TCLTESTARGS. [RFE 1161550]
+
+2005-06-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkConsole.c (TkConsolePrint): prevent potential NULL deref.
+
+ * macosx/tkMacOSXDefault.h: change ENTRY_BORDER defaults to from 5 to 2
+ to make default entry widgets in TkAqua look like in other aqua apps
+ (and have same border dimensions as other platforms). [Bug 1176610]
+
+2005-06-21 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/GetBitmap.3: Fix silly error in SYNOPSIS. [Bug 1224983]
+
+2005-06-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkImgGIF.c: Cleanse all static (i.e. non-thread-safe) data
+ at a miniscule performance hit.
+
+2005-06-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: for X11 build, add -X11 suffix to unversioned wish
+ symbolic link.
+
+ * unix/tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to
+ ensure we can always relocate binaries with install_name_tool.
+
+ * unix/configure: autoconf-2.59
+
+2005-06-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ Bump patchlevel to a4 to distinguish from a3 release.
+
+2005-06-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.5a3 TAGGED FOR RELEASE ***
+
+2005-06-02 Jim Ingham <jingham@apple.com>
+
+ * generic/tkEvent.c (InvokeFocusHandlers): On Mac OS X the scrollwheel
+ events are sent to the window under the mouse, not to the focus window
+
+ Another patch from M. Kirkham.
+
+ * macosx/tkMacOSXScrlbr.c (ThumbActionProc, ScrollBarBindProc): Record
+ the first mouse down point, and compute differences from that, rather
+ than getting the mouse down each time through the loop. The old method
+ would get fooled if you moved the mouse less than a text line height in
+ the text widget. [Bug 1083728]
+
+2005-06-03 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: fixed 'embedded' target.
+
+2005-06-02 Reinhard Max <max@suse.de>
+
+ * unix/tkUnix.c (Tk_GetUserInactiveTime): Improvements to get it
+ working on Solaris, and panic if we run out of memory.
+ * unix/configure.in: Rework the searching for Xss, to make it work on
+ Solaris and provide more useful output. Use AC_HELP_STRING where
+ appropriate.
+ * unix/tcl.m4: synced from Tcl.
+ * unix/configure: regenerated with autoconf 2.59.
+
+2005-06-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinInt.h: added private decls of Tk_GetEmbeddedMenuHWND,
+ Tk_GetMenuHWND, TkWinCleanupContainerList, and TkpWmGetState to that
+ are used across source files.
+
+ * win/tkWinX.c (Tk_ResetUserInactiveTime): cast to squelch compiler
+ warning.
+
+2005-05-31 Reinhard Max <max@suse.de>
+
+ * doc/Inactive.3 (new file): C level API documentationn for
+ TIP#245 (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime).
+ * tests/tk.test: Added tests for the TIP#245 implementation.
+
+2005-05-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPanedWindow.c, tests/panedwindow.test: batch of fixes to
+ panedwindow from Daniel South. Improved auto-size to fit internal
+ windows, fixed sash placement at edge of pane, fixed calculation of
+ stretch amount for internal windows. [Bug 1124198, 1161543, 1054117,
+ 1010941, 795869, 690169, 1192323]
+
+ * generic/tkMenu.c (MenuCmd): create event handler earlier to ensure
+ proper destruction of menu through DestroyNotify. [Bug 1159367]
+
+ * library/console.tcl (::tk::ConsoleInit): print out first prompt and
+ swallow the extra "% " that comes once from Tcl on Windows.
+
+2005-05-29 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXFont.c: use Tcl_Panic instead of panic.
+
+ * unix/configure.in: added description of HAVE_XSS for autoheader.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Wish.xcode/project.pbxproj: added missing FRAMEWORK defines
+ introduced with configure/make based build.
+
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXNotify.c: fixed warnings.
+
+ * generic/tkDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c: ran missing 'make genstubs' for TIP245 changes
+ to tk.decls
+
+ * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use symbolic
+ constant argument in call to UpdateSystemActivity();
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Wish.xcode/project.pbxproj:
+ * unix/configure.in: added/corrected linking to IOKit.framework for
+ TIP245.
+
+ * unix/configure.in: skip X11 configure checks when building tk_aqua.
+ * unix/configure: autoconf-2.59
+
+2005-05-28 Donal K. Fellows <dkf@users.sf.net>
+
+ TIP #245 IMPLEMENTATION from Reinhard Max <max@suse.de>
+
+ * doc/tk.n: Documentation of [tk inactivity].
+ * win/tkWinX.c (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime):
+ * unix/tkUnix.c (Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime):
+ * macosx/tkMacOSXXStubs.c: Implementations of the core API for
+ (Tk_GetUserInactiveTime): determining how long as user's left
+ (Tk_ResetUserInactiveTime): her machine alone.
+ * unix/configure.in: Test for XScreenSaver support.
+ * generic/tkCmds.c (Tk_TkObjCmd): Implementation of [tk inactivity].
+
+2005-05-27 Todd Helfter <tmh@users.sourceforge.net>
+
+ * library/menu.tcl: correct the sticky behavior of menus posted by
+ tk_popup so that they "stick" after the initial <ButtonRelease>
+ following the post, that is not over an active menu entry.
+
+2005-05-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXInit.c (TkpInit): fixed resource file extraction from
+ __tk_rsrc section to work with non-prebound .dylib and .bundle.
+
+ * macosx/Makefile: corrected EMBEDDED_BUILD check, use separate Tcl and
+ Tk version vars to properly support tk/x11 framework version
+ overriding, rewrite tkConfig.sh when overriding tk version, corrected
+ Wish.app symlink in tk build dir.
+
+ * unix/configure.in: corrected framework finalization to softlink stub
+ library to Versions/8.x subdir instead of Versions/Current.
+ * unix/configure: autoconf-2.59
+
+2005-05-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (install-libraries): protect possible empty list in
+ for with list= trick for older shells.
+
+2005-05-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkFileFilter.c (FreeGlobPatterns): s/null/NULL/
+
+2005-05-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkTest.c: disable commands not available on TkAqua.
+
+ * macosx/Makefile:
+ * macosx/README:
+ * macosx/Tk-Info.plist.in (new file):
+ * macosx/Wish-Info.plist.in (new file):
+ * unix/Makefile.in:
+ * unix/configure.in:
+ * unix/tcl.m4:
+ * unix/tkUnixInit.c: moved all Darwin framework and TkAqua build
+ support from macosx/Wish.pbproj and macosx/Makefile into the standard
+ unix configure/make buildsystem, the project and macosx/Makefile are no
+ longer required to build Tk.framework and/or TkAqua. TkAqua is now
+ enabled by the --enable-aqua configure option, and static and
+ non-framework builds of TkAqua are now available via the standard
+ configure switches. Tk/X11 can also be built as a framework. The
+ macosx/Makefile now wraps the unix buildsystem and no longer uses the
+ projects, embedded builds are still only available via this Makefile,
+ but for other builds it is not longer required (but its current
+ functionality is still available for backwards compatibility). The
+ projects currently do not call through to the Makefile to build (unlike
+ Tcl.pbproj) so project builds may differ from makefile builds. Due to
+ issues with spaces in pathnames, 'Wish Shell.app' has been renamed to
+ 'Wish.app', the macosx/Makefile installs backwards compatibility
+ symlinks for the old name.
+ * macosx/tkMacOSXInit.c (TkpInit): added support for Tk resource file
+ in non-framework and static builds: the resource file is copied into a
+ __tk_rsrc MachO section of the library or executable at link time and
+ extracted into a temporary location at initialization.
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in (new file): autoheader-2.59
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Tk-Info.plist:
+ * macosx/Wish-Info.plist:
+ * macosx/tkAboutDlg.r: updated copyright years to 2005.
+
+2005-05-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkFileFilter.c (TkGetFileFilters): Add all filters, not just
+ the first one. [Bug 1206133]
+
+2005-05-15 Jim Ingham <jingham@apple.com>
+
+ Fixes from Michael Kirkham:
+
+ * macosx/tkMacOSXMenu.c (TkpConfigureMenuEntry): Thinko in clearing the
+ ENTRY_ACCEL_MASK before re-parsing it. [Bug 1012852]
+
+ * macosx/tkMacOSXScrlbr.c (UpdateControlValues): Don't set the control
+ value BEFORE setting the min and max or the control manager will reset
+ it for you. [Bug 1202181]
+
+ * macosx/tkMacOSXXStubs.c (TkMacOSXXGetPixel, TkMacOSXXPutPixel):
+ Restore the port to what it was before putting we were called. [Bug
+ 1202223]
+
+2005-05-14 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c (ThumbActionProc): Missing Tcl_Release.
+
+2005-05-14 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXNotify.c: introduction of new tcl notifier based on
+ CFRunLoop allows replacement of the custom TkAqua notifier by a
+ standard tcl event source. Removes requirement of threaded tcl core
+ for TkAqua, allows to stub-link TkAqua against Tcl by removing use of
+ the unstubbed TclInitNotifier & TclFinalizeNotifier. [Tcl Patch
+ 1202052]
+
+ * macosx/Wish.xcode/project.pbxproj:
+ * macosx/Wish.pbproj/project.pbxproj: stub-link TkAqua: build with
+ USE_TCL_STUBS and link against libtclstub instead of Tcl.framework,
+ unexport libtclstub symbols from Tk to avoid duplicate symbol warnings
+ when linking with both Tcl and Tk, fixes for gcc4.0 warnings.
+
+ * macosx/Wish.xcode/project.pbxproj: sync with Wish.pbproj changes
+ since 2004-11-19.
+ NOTE: to use this project, need to uncomment the tclConfig.h settings
+ at the top of tcl/unix/configure.in, autoconf and rebuild tcl !
+
+ * macosx/tkMacOSXBitmap.c:
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXHLEvents.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXKeyboard.c:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXMenubutton.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c: fixed gcc 4.0 warnings.
+
+ * unix/tcl.m4: sync with tcl
+ * unix/configure: autoconf-2.59
+
+2005-05-10 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * library/text.tcl: test and fix to TextPrevPara to avoid infinite loop
+ * tests/textIndex.test: at start of widget. [Bug 1191895]
+
+ * generic/tkTextDisp.c: better synchronisation between explicit and
+ implicit pixel line-height calculations. [Bug 1186558]
+
+2005-05-10 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkTextDisp.c (GetXView): Improved numerical precision of
+ calculation of [.t xview] return values.
+ * tests/textDisp.test: Match greater precisions of [.t xview] and
+ [.t yview] values in tests.
+
+2005-05-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen
+ * unix/configure.in: Add AC_C_BIGENDIAN check and pkg-config xft checks
+ to extend xft search.
+ * unix/tcl.m4: Correct Solaris 10 (5.10) check and add support for
+ x86_64 Solaris cc builds.
+
+2005-04-28 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * macosx/tkMacOSXNotify.c (TkMacOSXWaitForEvent): Fix for typo in
+ waitTime computation. [Bug 1191097]
+ (AlertNotifier): Factor out the core of the notifier alerting code.
+
+2005-04-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXNotify.c: sync with tclUnixNotfy.c changes since
+ 2004-06-22, added compile time check for threaded tcl core, removed
+ unthreaded code paths as they are never used anyway, fixed
+ TkMacOSXAlertNotifier() implementation.
+
+ * unix/Makefile.in: added TCL_STUB_LIB_FILE, needed for unexporting of
+ symbols from libtclstub to avoid duplicate symbol warnings.
+
+ * unix/tcl.m4 (Darwin): added configure checks for recently added
+ linker flags -single_module and -search_paths_first to allow building
+ with older tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD
+ and not just T{CL,K}_SHLIB_LD_EXTRAS, added unexporting from Tk of
+ symbols from libtclstub to avoid duplicate symbol warnings, added
+ PLAT_SRCS definition for Mac OS X, defined MODULE_SCOPE to
+ __private_extern__.
+ (SC_MISSING_POSIX_HEADERS): added caching of dirent.h check.
+
+ * unix/configure: autoconf-2.59
+
+2005-04-22 George Peter Staplin <GeorgePS@XMission.com>
+
+ * doc/FontId.3: I fixed a typo. "linespace" was used instead of
+ "ascent". I also added a .PP before the paragraph to make the
+ formatting look better for the ascent paragraph.
+
+2003-04-18 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c(Tk_MeasureChars): Use Tcl_UtfToUnichar() for lax
+ UTF-8 parsing instead of strict parsing with FcUtf8ToUcs4()
+ [fix/workaround for Bug 1185640]
+
+2003-04-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * library/text.tcl
+ * doc/text.n: corrected 'Home' and 'End' and Control-a/e handling to
+ work with display lines. This was an ommission of the previous tip155
+ patch. Clarified the documentation on this point.
+
+2005-04-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to avoid
+ possible segv. Minimal fix for [Bug 1122671]
+
+2005-04-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/tkfbox.tcl (::tk::dialog::file::): fix typeMenuLab ref. Add
+ undoc'd ::tk::dialog::file::showHiddenBtn var (default 0) that will add
+ a "Show Hidden" checkbutton to tk_get*File and tk_chooseDirectory if
+ set to true.
+ * library/choosedir.tcl (::tk::dialog::file::chooseDir::): fix
+ cancelBtn ref, add hiddenBtn ref for "Show Hidden" button.
+
+2005-04-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/README: updated requirements for OS & developer tool versions
+ + other small fixes/cleanup.
+
+ * macosx/tkMacOSXEntry.c (ComputeIncDecParameters): manually define
+ constants present only in 10.3 headers so that we can build on 10.2.
+
+ * macosx/Wish.pbproj/project.pbxproj: fixed absolute path to tkEntry.h
+ that confused 10.2 PBX.
+
+ * unix/tcl.m4 (Darwin): added -single_module linker flag to
+ TCL_SHLIB_LD_EXTRAS and TK_SHLIB_LD_EXTRAS.
+ * unix/configure: autoconf-2.59
+
+2005-04-07 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c (TkWmStackorderToplevelWrapperMap,
+ (TkWmStackorderToplevel):
+ * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap,
+ (TkWmStackorderToplevel):
+ * win/tkWinWm.c (TkWmStackorderToplevelWrapperMap,
+ (TkWmStackorderToplevel):
+ Fix panic in wm stackorder when a toplevel is created on another
+ display. The code now ignores toplevels that have a display that does
+ not match the display of the parent window. [Bug 1152809]
+
+2005-04-06 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/wm.n, doc/winfo.n, doc/tk.n, doc/send.n, doc/selection.n:
+ * doc/radiobutton.n, doc/photo.n, doc/options.n, doc/menu.n:
+ * doc/listbox.n, doc/getOpenFile.n, doc/font.n, doc/event.n:
+ * doc/entry.n, doc/clipboard.n, doc/checkbutton.n, doc/canvas.n:
+ * doc/button.n, doc/bind.n, doc/TextLayout.3, doc/MeasureChar.3:
+ * doc/GetRelief.3, doc/GetPixels.3, doc/GetJustify.3, doc/GetFont.3:
+ * doc/GetCursor.3, doc/GetColor.3, doc/GetBitmap.3, doc/GetAnchor.3:
+ * doc/FontId.3, doc/CrtWindow.3, doc/CrtImgType.3, doc/ConfigWidg.3:
+ * doc/3DBorder.3: Purge old .VS/.VE macro instances.
+
+2005-04-04 Don Porter <dgp@users.sourceforge.net>
+
+ * library/comdlg.tcl: Added Macintosh file type validation to
+ [::tk::FDGetFileTypes]. [Bug 1083878] (Thanks, Vince Darley)
+
+2005-04-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c:
+ * tests/text.test: fix to elide searching problems [Bug 1174269] and
+ disappearing cursor with insertofftime 0. [Bug 1169429]
+
+2005-04-03 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/grid.test:
+ * generic/tkGrid.c: Fixed bug in geometry calculations for widgets that
+ span multiple columns/row. Bug was introduced in 8.5a1 when fixing
+ 792387. [Bug 1175092]
+
+2005-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tcl.m4, win/configure: do not require cygpath in macros to allow
+ msys alone as an alternative.
+
+2005-03-27 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/textDisp.test: added test for fix of 2005-03-15.
+
+2005-03-24 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): Dopey bug - do
+ not reset the width for entry widgets - we didn't change it for them.
+
+2005-03-23 Jim Ingham <jingham@apple.com>
+
+ These changes allow us to draw the Entry and Spinbox widget with a
+ native look and feel on Mac OS X.
+
+ * generic/tkEntry.h: New file, extracting the definitions of Entry and
+ Spinbox.
+ * generic/tkEntry.c (DisplayEntry): Call out to TkpDrawSpinboxButtons
+ and TkpDrawEntryBorderAndFocus. Also provide default implementations
+ for X11 & Win.
+ * macosx/tkMacOSXEntry.c: New file, implements the entry & focus and
+ spinbox button drawing.
+ * tkMacOSXDefaults.h: Change the Mac OS X defaults so they fit the
+ native widget shapes.
+
+ This is cleanup thanks to Neil Madden <nem@cs.nott.ac.uk>.
+
+ * macosx/tkMacOSXWm.c (TkMacOSXWinStyle) New function.
+ (TkUnsupported1ObjCmd): New function, replaces the un-objectified
+ version of the command.
+ * generic/tkInt.h: Swap TkUnsupported1Cmd for TkUnsupported1ObjCmd.
+ * generic/tkWindow.c (): Ditto.
+
+ This adds a "-notify" flag to "wm attributes" that will bounce the
+ dock icon on Mac OS X. This is from Revar Desmera <revarbat@gmail.com>
+
+ * macosx/tkMacOSXWm.c (WmAttrGetNotifyStatus, WmAttrSetNotifyStatus):
+ New functions.
+ (WmAttributesCmd): Add the -notify.
+ * doc/wm.n: Document -notify.
+
+2005-03-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkConsole.c (Tk_CreateConsoleWindow,TkConsolePrint): Rewrite
+ so that TkConsolePrint cannot become detached from the console when the
+ [console] command is renamed. [Bug 1016385]
+
+2005-03-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c: fix for [Bug 1143776] in adjusting displayed
+ lines when running into the bottom of the window.
+
+2005-03-14 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c (ThumbActionProc): No need to use "update
+ idletasks" here, TclServiceIdle will do as well and it is simpler.
+
+ These changes implement a change on the Mac OS X side. When we unmap a
+ window we mark all its children as unmapped (not following toplevels.
+ But we preserve whether they had been mapped before, and when the
+ parent is remapped, we remap the children as well. [Bug 940117]
+
+ * macosx/tkMacOSXInt.h: Added TK_MAPPED_IN_PARENT
+ * macosx/tkMacOSXSubwindows.c (FixMappingFlags): New function.
+ (XMapWindow): Call FixMappingFlags.
+ (XUnMapWindow): Ditto.
+
+ * macosx/tkMacOSXSubwindows.c (XMoveResizeWindow): Update the xOff &
+ yOff data in the Macdrawable even if the native window hasn't been
+ created yet. [Bug 700305]
+ (XMoveWindow): Ditto.
+ (XResizeWindow): Ditto.
+
+2005-03-15 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * unix/tcl.m4: Updated the OpenBSD configuration and regenerated the
+ * unix/configure: configure script.
+
+2005-03-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkEvent.c (InvokeClientMessageHandlers): Ensure that client
+ messages are handled correctly. Thanks to George Petasis for tracking
+ this down. [Bug 1162356]
+
+2005-03-11 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): Set the port to the
+ Button window's port BEFORE you set the clip, otherwise you are setting
+ the clip on the wrong window!
+ Also, a little cleanup - move x & y into the branches where they are
+ used, and don't compute the TextAnchor if we are using the native
+ button text, since we aren't going to use it.
+ (TkMacOSXDrawControl): Call ShowControl & SetControlVisibility in a
+ more logical order.
+
+ * tkMacOSXInt.h: Add TkMacOSXGenerateFocusEvent.
+ * tkMacOSXSubwindows.c (XDestroyWindow): We don't get Activate events
+ for the remaining windows when a Floating window is destroyed. This can
+ cause the focus to disappear. So catch this case when the window is
+ being destroyed and move the focus here.
+
+ * tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): Make this public
+ (used to be GenerateFocusEvent) since we need it here and in
+ tkMacOSXSubwindows.c. Then change the name everywhere it is used. [Bug
+ 1124237]
+
+2005-03-10 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): In the
+ inDrag section, set the GrafPort to the drag window's GrafPort before
+ doing LocalToGlobal. [Bug 1160025]
+
+2005-03-09 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXInit.c (TkpInit): Check to see if the environment
+ variable XCNOSTDIN is set, and if so, close stdin & stdout. This is
+ necessary to make remote debugging under Xcode work properly.
+
+2005-03-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (WinSetIcon): fix GCLP_ICONSM -> GCLP_HICONSM.
+
+ * win/makefile.vc: clarify necessary defined vars that can come from
+ MSVC or the Platform SDK.
+
+2005-02-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinX.c (GenerateXEvent): correct %A translation on MouseWheel.
+ [Bug 1118340]
+
+2005-02-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSX.h: fixed incorrect inclusion of internal header.
+ * macosx/tkMacOSXNotify.c: corrected included headers.
+
+2005-02-22 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd, NavServicesGetFile):
+ fixed encoding problems with -initialfile & -filetypes and corrected
+ potential buffer overrun with -initialdir/-initialfile. [Bug 1146057]
+
+2005-02-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ TIP#223 IMPLEMENTATION
+
+ * doc/wm.n: Add documentation for -fullscreen attribute.
+ * tests/winWm.test: Add -fullscreen to wm attribute usage message.
+ * tests/wm.test: Add -fullscreen to wm attribute usage message. Add
+ -fullscreen attribute test cases for Windows.
+ * win/tkWinWm.c (WmInfo, UpdateWrapper, TkpWmSetFullScreen)
+ (WmAttributesCmd, UpdateGeometryInfo):
+ Implement TIP 223 [wm attributes -fullscreen].
+
+2005-02-14 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextDisp.c:
+ * generic/tkTextIndex.c:
+ * generic/tkTextBTree.c:
+ * doc/text.n:
+ * tests/textDisp.test:
+ * tests/textIndex.test: fix of longstanding elide problem when eliding
+ a newline without eliding the entire logical line. [Bug 443848]
+
+2005-02-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/options.n: note -cursor {} behavior. [Bug 965618]
+
+2005-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/all.tcl: Add a [package require Tk] so that a missing display
+ causes an early failure and keeps the error trace short. Issue observed
+ in [FRQ 11122147], even though that's unrelated.
+
+2005-02-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/panedwindow.tcl (::tk::panedwindow::Cursor): check window
+ existence on delayed call. [Bug 949792]
+
+ * doc/text.n: note 'image' key in 'dump' command. [Bug 1115907]
+
+ * win/tkWinWm.c (TkWinGetIcon): fix toplevel retrieval for determining
+ icon ref (potential crash). [Bug 1105738]
+
+ * generic/tkCanvBmap.c (ConfigureBitmap, ComputeBitmapBbox): Fixed
+ possible crash with disabled bmap and bbox handling [Bug 1119460]
+ (BitmapToPostscript): made aware of various bitmap types
+
+ * unix/Makefile.in: remove SHLIB_LD_FLAGS (only for AIX, inlined into
+ * unix/tcl.m4: SHLIB_LD). Combine AIX-* and AIX-5 branches in
+ * unix/configure: SC_CONFIG_CFLAGS. Correct gcc builds for AIX-4+ and
+ HP-UX-11. autoconf-2.59 gen'd.
+
+2005-02-09 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * tests/wm.test: Convert to use more tcltest2 features.
+
+2005-02-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkCanvas.c (CanvasWidgetCmd): Fix stupid mistake in variable
+ names, reported by Andreas Leitgeb.
+
+2005-02-03 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkCanvas.c (GetStaticUids): New function to manage the
+ thread-specific data detailing the list of all uids in a thread.
+ (typeList): Protect this (the other piece of global data) with a mutex.
+ [Bug 1114977]
+
+2005-01-31 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tcl.m4, unix/configure: add solaris-64 gcc build support. [Bug
+ 1021871]
+
+2005-01-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * generic/tkImgPhoto.c (PhotoFormatThreadExitProc): Made the comments
+ in the code more relevant to the function they were documenting! [Bug
+ 1110553]
+
+ * library/msgs/es_ES.msg: Added more localization for Spanish Spanish.
+ [Bug 1111213]
+
+2005-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXInit.c (TkpInit): set tcl_interactive to 1 to show
+ console at startup instead of directly calling [console show].
+
+ * unix/tcl.m4 (Darwin): fixed bug with static build linking to dynamic
+ library in /usr/lib etc instead of linking to static library earlier in
+ search path. [Tcl Bug 956908]
+ Removed obsolete references to Rhapsody.
+ * unix/configure: autoconf-2.57
+
+2005-01-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/menu.tcl: Reworked to make dialogs children of the
+ demo widget so that they are properly visible. Issue reported by Keith
+ Nash <k.j.nash@usa.net>
+
+2005-01-13 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/tkfbox.tcl (IconList_Selection, IconList_Create):
+ (IconList_Arrange): Assorted tk_getOpenFile fixes. [part of Bug 600313]
+ (IconList_ShiftMotion1): Also fix shift-drag.
+
+2005-01-12 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tcl.m4: Sync'ed to Tcl's copy.
+ * unix/configure: autoconf-2.57
+
+2005-01-12 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/event.n: Added section on predefined virtual events. [Bug 608115]
+
+2005-01-11 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c: fix to scrollbar height calculations of text
+ widgets containing a single very long (wrapped) line. This fixes at
+ least part of [Bug 1093631].
+
+2005-01-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkObj.c (TkParsePadAmount):
+ * generic/tkPack.c: Moved function to tkObj.c and rewrote so that it
+ takes advantage of Tcl_Objs properly and cannot leave objects in an
+ inconsistent state. [Bug 1098779]
+
+2005-01-10 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/Makefile.in, unix/configure.in, unix/tkConfig.sh.in:
+ Remove ${DBGX}, ${TK_DBGX} from Tk build system. [Patch 1081595]
+ * unix/tcl.m4: re-synced with tcl/unix/tcl.m4
+ * unix/configure: Regenerated.
+
+2005-01-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkWindow.c (GetScreen): Make sure the result is reset on all
+ error paths to stop strange errors. [Bug 697915]
+
+2005-01-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/loadTk.n, doc/toplevel.n: Convert to other form of emacs mode
+ control comment to prevent problems with old versions of man. [Bug
+ 1085127]
+
+2005-01-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (TkWinWmCleanup): clean up layered window class. This
+ caused crash in reinit of Tk (as seen in plugin).
+
+ ******************************************************************
+ *** CHANGELOG ENTRIES FOR 2004 AND 2003 IN "ChangeLog.2004" ***
+ *** CHANGELOG ENTRIES FOR 2002 AND EARLIER IN "ChangeLog.2002" ***
+ ******************************************************************
diff --git a/README b/README
index 64bdebc..ff13f01 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
README: Tk
- This is the Tk 8.5.10 source distribution.
+ This is the Tk 8.6b2 source distribution.
http://tcl.sourceforge.net/
You can get any source release of Tcl from the file distributions
link at the above URL.
@@ -11,9 +11,9 @@ 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.5 Web page at
+this release, see the Tcl/Tk 8.6 Web page at
- http://www.tcl.tk/software/tcltk/8.5.html
+ http://www.tcl.tk/software/tcltk/8.6.html
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
diff --git a/carbon/GNUmakefile b/carbon/GNUmakefile
new file mode 100644
index 0000000..6a4e9b8
--- /dev/null
+++ b/carbon/GNUmakefile
@@ -0,0 +1,314 @@
+########################################################################################################
+#
+# Makefile wrapper to build tk on Mac OS X in a way compatible with the tk/carbon Xcode buildsystem
+# uses the standard unix build system in tk/unix (which can be used directly instead of this
+# if you are not using the tk/carbon projects).
+#
+# Copyright (c) 2002-2008 Daniel A. Steffen <das@users.sourceforge.net>
+#
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+########################################################################################################
+
+#-------------------------------------------------------------------------------------------------------
+# customizable settings
+
+DESTDIR ?=
+INSTALL_ROOT ?= ${DESTDIR}
+
+BUILD_DIR ?= ${CURDIR}/../../build
+SYMROOT ?= ${BUILD_DIR}/${PROJECT}
+OBJROOT ?= ${SYMROOT}
+
+EXTRA_CONFIGURE_ARGS ?=
+EXTRA_MAKE_ARGS ?=
+
+INSTALL_PATH ?= /Library/Frameworks
+APPLICATION_INSTALL_PATH ?= /Applications/Utilities
+PREFIX ?= /usr/local
+BINDIR ?= ${PREFIX}/bin
+LIBDIR ?= ${INSTALL_PATH}
+MANDIR ?= ${PREFIX}/man
+
+# tcl build directory (containing tclConfig.sh and Makefile)
+TCL_BUILD_DIR ?= ${BUILD_DIR}/tcl/${BUILD_STYLE}
+# location of installed tcl, only used if tcl in TCL_BUILD_DIR can't be found
+TCL_FRAMEWORK_DIR ?= /Library/Frameworks
+TCLSH_DIR ?= ${PREFIX}
+
+# set to non-empty value to install manpages in addition to html help:
+INSTALL_MANPAGES ?=
+
+# set to non-empty value to build TkX11 instead of TkAqua:
+TK_X11 ?=
+
+#-------------------------------------------------------------------------------------------------------
+# meta targets
+
+meta := all install embedded install-embedded clean distclean test
+
+styles := develop deploy
+
+all := ${styles}
+all : ${all}
+
+install := ${styles:%=install-%}
+install : ${install}
+install-%: action := install-
+
+embedded := ${styles:%=embedded-%}
+embedded : embedded-deploy
+install-embedded := ${embedded:%=install-%}
+install-embedded : install-embedded-deploy
+
+clean := ${styles:%=clean-%}
+clean : ${clean}
+clean-%: action := clean-
+distclean := ${styles:%=distclean-%}
+distclean : ${distclean}
+distclean-%: action := distclean-
+
+test := ${styles:%=test-%}
+test : ${test}
+test-%: action := test-
+
+targets := $(foreach v,${meta},${$v})
+
+#-------------------------------------------------------------------------------------------------------
+# build styles
+
+BUILD_STYLE =
+CONFIGURE_ARGS =
+OBJ_DIR = ${OBJROOT}/${BUILD_STYLE}
+
+empty :=
+space := ${empty} ${empty}
+objdir = $(subst ${space},\ ,${OBJ_DIR})
+
+develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols
+deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip
+embedded_make_args := EMBEDDED_BUILD=1
+install_make_args := INSTALL_BUILD=1
+
+${targets}:
+ ${MAKE} ${action}${PROJECT} \
+ $(foreach s,${styles} embedded install,$(if $(findstring $s,$@),${${s}_make_args}))
+
+#-------------------------------------------------------------------------------------------------------
+# project specific settings
+
+PROJECT := tk
+PRODUCT_NAME := Tk
+
+UNIX_DIR := ${CURDIR}/../unix
+VERSION := $(shell awk -F= '/^TK_VERSION/ {print $$2; nextfile}' ${UNIX_DIR}/configure.in)
+TCL_VERSION := ${VERSION}
+wish := wish
+WISH = wish${VERSION}
+
+BUILD_TARGET := all tktest
+INSTALL_TARGET := install
+
+ifneq ($(wildcard $(subst ${space},\ ,${TCL_BUILD_DIR})/tclConfig.sh),)
+TCL_DIR := ${TCL_BUILD_DIR}
+TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/..
+MAKE_VARS :=
+else
+TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework
+TCL_EXE := ${TCLSH_DIR}/tclsh${TCL_VERSION}
+MAKE_VARS := TCL_EXE
+export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR}
+endif
+
+export CPPROG := cp -p
+
+ifeq (${TK_X11},)
+override CONFIGURE_ARGS := ${CONFIGURE_ARGS} --enable-aqua=carbon
+else
+override CONFIGURE_ARGS := ${CONFIGURE_ARGS} --enable-xft
+VERSION := ${VERSION}-X11
+wish := ${wish}-X11
+override EMBEDDED_BUILD :=
+endif
+
+INSTALL_TARGETS = install-binaries install-libraries
+ifeq (${EMBEDDED_BUILD},)
+INSTALL_TARGETS += install-private-headers install-demos
+endif
+ifeq (${INSTALL_BUILD}_${EMBEDDED_BUILD}_${BUILD_STYLE},1__Deployment)
+INSTALL_TARGETS += html-tk
+ifneq (${INSTALL_MANPAGES},)
+INSTALL_TARGETS += install-doc
+endif
+endif
+
+MAKE_VARS += INSTALL_ROOT INSTALL_TARGETS VERSION
+MAKE_ARGS_V = $(foreach v,${MAKE_VARS},$v='${$v}')
+
+build-${PROJECT}: target = ${BUILD_TARGET}
+install-${PROJECT}: target = ${INSTALL_TARGET}
+clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \
+ target = $*
+
+DO_MAKE = +${MAKE} -C "${OBJ_DIR}" ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
+
+#-------------------------------------------------------------------------------------------------------
+# locations for custom tk install actions
+
+ifeq (${INSTALL_BUILD},1)
+TOP_DIR := ${INSTALL_ROOT}/
+APP_DIR := ${APPLICATION_INSTALL_PATH}
+FMWK_DIR := ${LIBDIR}
+else
+TOP_DIR := ${SYMROOT}
+APP_DIR := .
+FMWK_DIR := .
+endif
+
+TCL_FMWK_DIR := ${FMWK_DIR}/Tcl.framework/Versions/${TCL_VERSION}
+TK_FMWK_DIR := ${FMWK_DIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}
+
+#-------------------------------------------------------------------------------------------------------
+# build rules
+
+${PROJECT}:
+ ${MAKE} install-${PROJECT} INSTALL_ROOT="${OBJ_DIR}/"
+
+${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \
+ ${UNIX_DIR}/tkConfig.sh.in Tk-Info.plist.in Wish-Info.plist.in
+ mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \
+ if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \
+ --prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \
+ --mandir="${MANDIR}" --enable-threads --enable-framework \
+ --with-tcl="${TCL_DIR}" \
+ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi
+ifneq (${VERSION},${TCL_VERSION})
+ @cd "${OBJ_DIR}" && sed -e 's#/Versions/${TCL_VERSION}#/Versions/${VERSION}#' \
+ tkConfig.sh > tkConfig.sh.1 && mv -f tkConfig.sh.1 tkConfig.sh
+endif
+
+build-${PROJECT}: ${objdir}/Makefile
+ ${DO_MAKE}
+ifeq (${INSTALL_BUILD},)
+# symolic link hackery to trick
+# 'make install INSTALL_ROOT=${OBJ_DIR}'
+# into building Tk.framework and wish in ${SYMROOT}
+ @cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,./${LIBDIR})) $(dir $(subst ${space},\ ,./${BINDIR})) "${SYMROOT}" && \
+ rm -rf "./${LIBDIR}" "./${BINDIR}" && ln -fs "${SYMROOT}" "./${LIBDIR}" && \
+ ln -fs "${SYMROOT}" "./${BINDIR}" && ln -fs "${OBJ_DIR}/tktest" "${SYMROOT}"
+ifeq (${TK_X11},)
+ @rm -f "${OBJ_DIR}/${BINDIR}" && \
+ ln -fs Wish.app/Contents/MacOS/Wish "${SYMROOT}/${WISH}"
+endif
+# Create symbolic link to Tcl.framework in ${SYMROOT}if necessary
+ @cd "${SYMROOT}" && if [ ! -e Tcl.framework -o -L Tcl.framework ]; then \
+ rm -f Tcl.framework && ln -s "${TCL_FRAMEWORK_DIR}/Tcl.framework" . ; fi
+endif
+
+install-${PROJECT}: build-${PROJECT}
+ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_)
+ @echo "Cannot install-embedded with empty INSTALL_ROOT !" && false
+endif
+ifeq (${EMBEDDED_BUILD},1)
+ @rm -rf "${INSTALL_ROOT}/${LIBDIR}/Tk.framework"
+endif
+ ${DO_MAKE}
+ifeq (${EMBEDDED_BUILD}_${TK_X11},1_)
+# workaround bug with 'cp -pRH' on Darwin 6 and earlier
+ @if [ "`uname -r | awk -F. '{print $$1}'`" -lt 7 ]; then \
+ mkdir -p "${TOP_DIR}"/{"${TCL_FMWK_DIR}","${TK_FMWK_DIR}"}/PrivateHeaders; fi
+endif
+ifeq (${INSTALL_BUILD},1)
+ifeq (${EMBEDDED_BUILD},1)
+# if we are embedding frameworks, don't install wish
+ @rm -f "${INSTALL_ROOT}${BINDIR}/${WISH}" && \
+ rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true
+else
+# redo prebinding (when not building for Mac OS X 10.4 or later only)
+ @if [ "`echo "$${MACOSX_DEPLOYMENT_TARGET}" | \
+ awk -F '10\\.' '{print int($$2)}'`" -lt 4 -a "`echo "$${CFLAGS}" | \
+ awk -F '-mmacosx-version-min=10\\.' '{print int($$2)}'`" -lt 4 ]; \
+ then cd ${INSTALL_ROOT}/; \
+ if [ ! -d usr/lib ]; then mkdir -p usr && ln -fs /usr/lib usr/ && RM_USRLIB=1; fi; \
+ if [ -n "${TK_X11}" -a ! -d usr/X11R6 ]; then mkdir -p usr && ln -fs /usr/X11R6 usr/ && RM_USRX11=1; fi; \
+ if [ ! -d System ]; then ln -fs /System . && RM_SYSTEM=1; fi; \
+ if [ ! -d "./${LIBDIR}/Tcl.framework" ]; then ln -fs "${TCL_FRAMEWORK_DIR}/Tcl.framework" "./${LIBDIR}"; RM_TCL=1; fi; \
+ redo_prebinding -r . "./${TK_FMWK_DIR}/${PRODUCT_NAME}"; \
+ if [ -z "${TK_X11}" ]; then redo_prebinding -r . "./${TK_FMWK_DIR}/Resources/Wish.app/Contents/MacOS/Wish"; \
+ else redo_prebinding -r . "./${BINDIR}/${WISH}"; fi; \
+ if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rmdir -p usr 2>&-; fi; \
+ if [ -n "$${RM_USRX11:-}" ]; then rm -f usr/X11R6; rmdir -p usr 2>&-; fi; \
+ if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; \
+ if [ -n "$${RM_TCL:-}" ]; then rm -f "./${LIBDIR}/Tcl.framework"; fi; fi
+# install wish symbolic link
+ @ln -fs ${WISH} "${INSTALL_ROOT}${BINDIR}/${wish}"
+endif
+endif
+ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_)
+# keep copy of debug library around, so that
+# Deployment build can be installed on top
+# of Development build without overwriting
+# the debug library
+ @cd "${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}" && \
+ ln -f "${PRODUCT_NAME}" "${PRODUCT_NAME}_debug"
+endif
+ifeq (${TK_X11},)
+ifeq (${EMBEDDED_BUILD},)
+# install Wish.app link in APPLICATION_INSTALL_PATH and setup 'Wish Shell' compatibility links
+ @cd "${TOP_DIR}" && if [ -n "${APP_DIR}" ]; then mkdir -p "./${APP_DIR}" && rm -rf "./${APP_DIR}/Wish.app" && \
+ ln -fsh "./$$(echo "${APP_DIR}" | sed -e 's#/[^/][^/]*#/..#g')/${FMWK_DIR}/${PRODUCT_NAME}.framework/Resources/Wish.app" "./${APP_DIR}" && \
+ ln -fsh Wish.app "./${APP_DIR}/Wish Shell.app"; fi && \
+ ln -fsh Wish.app "./${TK_FMWK_DIR}/Resources/Wish Shell.app" && \
+ ln -fsh Wish "./${TK_FMWK_DIR}/Resources/Wish.app/Contents/MacOS/Wish Shell"
+else
+# if we are embedding frameworks, move them into the app and fix their install names
+ @cd "${TOP_DIR}" && \
+ rm -rf "./${APP_DIR}/Wish.app" && mkdir -p "./${APP_DIR}" && \
+ mv -f "./${TK_FMWK_DIR}/Resources/Wish.app" "./${APP_DIR}" && \
+ ln -fsh Wish.app "./${APP_DIR}/Wish Shell.app" && \
+ rm -rf "./${APP_DIR}/Wish.app/Contents/Frameworks" && \
+ mkdir -p "./${APP_DIR}/Wish.app/Contents/Frameworks" && \
+ ${CPPROG} -RH "./${FMWK_DIR}"/T{cl,k}.framework "./${APP_DIR}/Wish.app/Contents/Frameworks" && \
+ cd "./${APP_DIR}/Wish.app/Contents" && \
+ rm -rf Frameworks/Tcl.framework/{,/Versions/${TCL_VERSION}}/{Headers,PrivateHeaders,*_debug,lib*.a,*Config.sh} && \
+ rm -rf Frameworks/Tk.framework/{,/Versions/${VERSION}}/{Headers,PrivateHeaders,*_debug,lib*.a,*Config.sh} && \
+ fix_install_id ( ) { \
+ chmod -RH a+w "$$1"; \
+ install_name_tool -id $$(otool -L "$$1" | awk "/$$2\.framework.*[^:]\$$/ {sub(\"^.*/Frameworks\",\"@executable_path/../Frameworks\",\$$1); print \$$1}") "$$1"; \
+ chmod -RH a-w "$$1"; \
+ } && \
+ fix_install_name ( ) { \
+ chmod -RH a+w "$$1"; \
+ install_name_tool -change $$(otool -L "$$1" | awk "/$$2\.framework.*[^:]\$$/ {print \$$1; sub(\"^.*/Frameworks\",\"@executable_path/../Frameworks\",\$$1); print \$$1}") "$$1"; \
+ chmod -RH a-w "$$1"; \
+ } && \
+ fix_install_id Frameworks/Tcl.framework/Tcl Tcl && fix_install_id Frameworks/Tk.framework/Tk Tk && \
+ fix_install_name MacOS/Wish Tcl && fix_install_name MacOS/Wish Tk
+ifeq (${INSTALL_BUILD},1)
+ @cd "${TOP_DIR}" && rm -rf "./${FMWK_DIR}"/T{cl,k}.framework && rmdir -p "./${FMWK_DIR}" 2>&- || true
+endif
+endif
+endif
+
+clean-${PROJECT}: %-${PROJECT}:
+ ${DO_MAKE}
+ rm -rf "${SYMROOT}"/{${PRODUCT_NAME}.framework,${WISH},tktest}
+ rm -f "${OBJ_DIR}"{"${LIBDIR}","${BINDIR}"} && \
+ rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${LIBDIR})) 2>&- || true && \
+ rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${BINDIR})) 2>&- || true
+
+distclean-${PROJECT}: %-${PROJECT}: clean-${PROJECT}
+ ${DO_MAKE}
+ rm -rf "${OBJ_DIR}"
+
+test-${PROJECT}: %-${PROJECT}: build-${PROJECT}
+ ${DO_MAKE}
+
+#-------------------------------------------------------------------------------------------------------
+
+.PHONY: ${meta} ${targets} ${PROJECT} build-${PROJECT} install-${PROJECT} \
+ clean-${PROJECT} distclean-${PROJECT}
+
+.NOTPARALLEL:
+
+#-------------------------------------------------------------------------------------------------------
diff --git a/carbon/README b/carbon/README
new file mode 100644
index 0000000..85452c4
--- /dev/null
+++ b/carbon/README
@@ -0,0 +1,339 @@
+Tcl/TkAqua Carbon Mac OS X README
+---------------------------------
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! This is the README for tk/carbon, the legacy version of TkAqua based on the !
+! Carbon API. This version of TkAqua is deprecated and no longer actively !
+! supported, it will be removed in a future release of Tk. It is only useful !
+! for users requiring support of Mac OS X releases older than 10.5. !
+! The supported version of TkAqua is located in tk/macosx and is based on the !
+! Cocoa API. It requires Mac OS X 10.5 or later. !
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+1. Where to go for support
+--------------------------
+
+- The tcl-mac mailing list on sourceforge is the best place to ask questions
+specific to Tcl & Tk on Mac OS X:
+ http://lists.sourceforge.net/lists/listinfo/tcl-mac
+(this page also has a link to searchable archives of the list, please check them
+before asking on the list, many questions have already been answered).
+
+- For general Tcl/Tk questions, the newsgroup comp.lang.tcl is your best bet:
+ http://groups.google.com/group/comp.lang.tcl/
+
+- The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see
+ http://wiki.tcl.tk/references/3753!
+ http://wiki.tcl.tk/references/8361!
+
+- Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers:
+ Tcl: http://sf.net/tracker/?func=add&group_id=10894&atid=110894
+ Tk: http://sf.net/tracker/?func=add&group_id=12997&atid=112997
+please make sure that your report Tk specific bugs to the tktoolkit project bug
+tracker rather than the tcl project bug tracker.
+Mac OS X specific bugs should usually be assigned to 'das' or 'wolfsuit'.
+
+
+2. Using Tcl/Tk on Mac OS X
+---------------------------
+
+- There are two versions of Tk available on Mac OS X: TkAqua using the native
+aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets.
+TkX11 requires an X11 server to be installed, such as Apple's X11 (which is
+available as an optional install on recent Mac OS X retail disks).
+TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem].
+
+- At a minimum, Mac OS X 10.1 is required to run Tcl and TkX11, and OS X 10.2 is
+required to run TkAqua. However OS X 10.3 or higher is recommended (certain
+[file] operations behave incorrectly on earlier releases).
+
+- Unless weak-linking is used, Tcl/Tk built on Mac OS X 10.x will not run on
+10.y with y < x; on the other hand Tcl/Tk built on 10.y will always run on 10.x
+with y <= x (but without any of the fixes and optimizations that would be
+available in a binary built on 10.x).
+Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl/Tk
+built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2).
+
+- Wish checks the Resources/Scripts directory in its application bundle for a
+file called AppMain.tcl, if found it is used as the startup script and the
+Scripts folder is added to the auto_path. This can be used to emulate the old
+OS9 TclTk droplets.
+
+- If standard input is a special file of zero length (e.g. /dev/null), Wish
+brings up the Tk console window at startup. This is the case when double
+clicking Wish in the Finder (or using 'open Wish.app' from the Terminal).
+
+- Tcl extensions can be installed in any of:
+ $HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl
+ $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks
+ /System/Library/Frameworks (searched in that order).
+Given a potential package directory $pkg, Tcl on OSX checks for the file
+$pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl.
+This allows building extensions as frameworks with all script files contained in
+the Resources/Scripts directory of the framework.
+
+- [load]able binary extensions can linked as either ordinary shared libraries
+(.dylib) or as MachO bundles (since 8.4.10/8.5a3); only bundles can be unloaded,
+and bundles are also loaded more efficiently from VFS (no temporary copy to the
+native filesystem required).
+
+- The 'deploy' target of carbon/GNUmakefile installs the html manpages into the
+standard documentation location in the Tcl/Tk frameworks:
+ Tcl.framework/Resources/Documentation/Reference/Tcl
+ Tk.framework/Resources/Documentation/Reference/Tk
+No nroff manpages are installed by default by the GNUmakefiles.
+
+- The Tcl and Tk frameworks can be installed in any of the system's standard
+framework directories:
+ $HOME/Library/Frameworks /Library/Frameworks
+ /Network/Library/Frameworks /System/Library/Frameworks
+
+- /usr/bin/wish8.x is a script that calls a copy of 'Wish' contained in
+ Tk.framework/Resources
+
+- if 'Wish' is started from the Finder or via 'open', $argv contains a
+"-psn_XXXX" argument. This is the Wish's carbon process serial number, you may
+need to filter it out for cross platform compatibility of your scripts.
+
+- the env array is different when Wish is started from the Finder (i.e. via
+LaunchServices) than when it (or tclsh) is invoked from the Terminal, in
+particular PATH may not be what you expect. (Wish started by LaunchServices
+inherits loginwindow's environment variables, which are essentially those set in
+$HOME/.MacOSX/environment.plist, and are unrelated to those set in your shell).
+
+- As of Tk 8.4.7, TkAqua has a version of the low-level drawing primitives using
+the CoreGraphics routines - the code is primarily due to James Tittle. There
+were numerous problems with the QD version, mostly due to the different drawing
+model of QD & Tk. CG also trivially supports dashed lines, and the various end
+caps & miters. The old QD code is retained for now, just in case there are any
+compatibility problems. To switch back to the QD drawing, put
+ set tk::mac::useCGDrawing 0
+in your script before you do drawing.
+All CG drawing is antialiased by default, but (outline) linewidth can be used to
+control whether a line/shape is drawn antialiased. The antialiasing threshold is
+0 by default (i.e. antialias everything), it can be changed by setting
+ set tk::mac::CGAntialiasLimit <limit>
+in your script before drawing, in which case lines (or shapes with outlines)
+thinner than <limit> pixels will not be antialiased.
+
+- ATSUI text antialiasing by default uses the standard OS antialising settings.
+Setting the global variable '::tk::mac::antialiasedtext' allows to control text
+antialiasing from Tcl: a value of 1 enables AA, 0 disables AA and -1 restores
+the default behaviour of respecting the OS settings.
+
+- Scrollbars: There are two scrollbar variants in Aqua, normal & small. The
+normal scrollbar has a small dimension of 15, the small variant 11. Access to
+the small variant was added in Tk 8.4.2.
+
+- Cursors: You can now put up and spin the Classic MacOS spinner, and the
+counting hands and watch cursor. The way this is done is each of the spinners
+have a base name:
+ spinning: The circular B&W circular spinner
+ countinguphand: The counting up hand
+ countingdownhand: The counting down hand
+ countingupanddownhand: The counting up then down hand
+ watch: The watch cursor
+Then to get the sequential variants, add an integer to the end of the base name.
+So, for instance this code will spin the spinner:
+ proc spinCursor {widget count} {
+ $widget configure -cursor spinning$count
+ after 100 spinCursor [incr count]
+ }
+This was added in Tk 8.4.2
+
+- If you want to use Remote Debugging with Xcode 1.5 or 2.2, you need to set the
+environment variable XCNOSTDIN to 1 in the Executable editor for Wish. That will
+cause us to force closing stdin & stdout. Otherwise, given how Xcode launches
+Wish remotely, they will be left open and then Wish & gdb will fight for stdin.
+
+
+3. Building Tcl/Tk on Mac OS X
+------------------------------
+
+- At least Mac OS X 10.1 is required to build Tcl and TkX11 and OS X 10.2 is
+required to build TkAqua. Apple's Developer Tools need to be installed (only the
+most recent version matching your OS release is supported). The Developer Tools
+installer is available on Mac OS X retail disks or is present in
+/Applications/Installers on Macs that came with OS X preinstalled. The most
+recent version can be downloaded from the ADC website http://connect.apple.com
+(after you register for free ADC membership).
+
+- Tcl/Tk are most easily built as Mac OS X frameworks via GNUmakefile in
+tcl/macosx and tk/carbon (see below for details), but can also be built with the
+standard unix configure and make buildsystem in tcl/unix resp. tk/unix as on any
+other unix platform (indeed, the GNUmakefiles are just wrappers around the unix
+buildsystem).
+The Mac OS X specific configure flags are --enable-aqua, --enable-framework and
+--disable-corefoundation (which disables CF and notably reverts to the standard
+select based notifier). Note that --enable-aqua is incompatible with
+--disable-corefoundation (for both Tcl and Tk configure).
+
+- It is also possible to build with Apple's IDE via the projects in tk/carbon,
+take care to only use the project matching your DevTools and OS version:
+ * Wish.xcode for Xcode 2.4 on 10.4 and Xcode 2.5 on 10.4 and later, this has
+ a 'Tk' target that simply calls through to the tcl/macosx/GNUMakefile.
+ It requires a build of the 'Tcl' target of tcl/macosx/Tcl.xcode.
+ Additionally this has native 'tktest' and 'tktest-X11' targets for
+ debugging, these targets' 'Debug' build configuration has ZeroLink and
+ Fix&Continue enabled, use the 'DebugNoFixZL' build configuration if you
+ need a debug build without these features. The following build
+ configurations are available:
+ 'DebugUnthreaded': debug build with threading turned off.
+ 'DebugNoCF': debug build with corefoundation turned off
+ (for 'tktest-X11' only).
+ 'DebugNoCFUnthreaded': debug build with corefoundation turned off
+ (for 'tktest-X11' only) and with threading turned off.
+ 'DebugMemCompile': debug build with memory and bytecode debugging on.
+ 'DebugLeaks': debug build with PURIFY defined.
+ 'DebugGCov': debug build with generation of gcov data files enabled.
+ 'ReleaseUniversal': builds the targets as universal binaries for the
+ ppc and i386 architectures.
+ 'ReleaseUniversal10.4uSDK': same as 'ReleaseUniversal' but builds
+ against the 10.4u SDK, required to build universal binaries on
+ PowerPC Tiger (where the system libraries are not universal).
+ 'ReleasePPC10.3.9SDK': builds for PowerPC against the 10.3.9 SDK, useful
+ for verifying on Tiger that building on Panther would succeed.
+ 'ReleasePPC10.2.8SDK': builds for PowerPC with gcc-3.3 against the
+ 10.2.8 SDK, useful to verify on Tiger that building on Jaguar
+ would succeed.
+ * Wish.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following
+ additional build configurations:
+ 'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds
+ against the 10.5 SDK on Leopard (with 10.5 deployment target).
+ 'Debug gcc42': same as 'Debug' but builds with gcc 4.2.
+ 'Debug llvmgcc42': same as 'Debug' but builds with llvm-gcc 4.2.
+ 'ReleaseUniversal gcc42': same as 'ReleaseUniversal' but builds with
+ gcc 4.2.
+ 'ReleaseUniversal llvmgcc42': same as 'ReleaseUniversal' but builds
+ with llvm-gcc 4.2.
+ 'Debug64bit': builds the 'tktest-X11' target as 64bit with debugging
+ enabled (requires a 64bit capable processor).
+ Note that all non-SDK configurations have 10.5 deployment target and
+ that all Universal configurations build the 'tktest-X11' target
+ also for the ppc64 and x86_64 architectures.
+
+Notes about the native targets of the Xcode projects:
+ * the Xcode projects refer to the toplevel tcl and tk source dirs through
+ the TCL_SRCROOT and TK_SRCROOT user build settings, by default these are
+ set to the project-relative paths '../../tcl' and '../../tk', if your
+ source directories are named differently, e.g. '../../tcl8.5', you'll
+ need to manually change the TCL_SRCROOT and TK_SRCROOT settings by
+ editing your ${USER}.pbxuser file (located inside the Wish.xcodeproj
+ bundle directory) with a text editor.
+ * the native targets need a version of the unix configure scripts with config
+ headers enabled, this is automatically generated as tcl/macosx/configure
+ and tk/carbon/configure by the project but that requires 2.59 versions
+ of autoconf & autoheader. These are not available on Mac OS X 10.5 by
+ default and need to be installed manually. By default they are assumed
+ to be installed as /usr/local/bin/autoconf-2.59 and
+ /usr/local/bin/autoheader-2.59, set the AUTOCONF and AUTOHEADER build
+ settings in ${USER}.pbxuser to their true locations if necessary.
+
+- To build universal binaries outside of Wish.xcodeproj, set CFLAGS as follows:
+ export CFLAGS="-arch ppc -arch i386 \
+ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
+This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on any
+of the architectures (the -isysroot flag is only required on PowerPC Tiger).
+Note that configure requires CFLAGS to contain a least one architecture that can
+be run on the build machine (i.e. ppc on PowerPC, ppc or i386 on Intel).
+Universal builds of Tk TEA extensions are also possible with CFLAGS set as
+above, they will be [load]able by universal as well as thin binaries of Tk.
+Note that while Tcl can be built for 64-bit architectures, neither TkAqua nor
+TkX11 can be built for 64-bit as the corresponding GUI libraries are not
+available for 64bit at present. However, linking a universal 'ppc i386' Tk
+binary against a universal 'ppc ppc64 i386 x86_64' Tcl binary works just fine.
+The Tk configure script automatically removes the 64-bit -arch flags from CFLAGS
+to facilitate universal building of both Tcl and Tk with the same CFLAGS; the
+same happens with configure in Tk extensions based on TEA 3.5 or later.
+
+- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
+to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g:
+ export MACOSX_DEPLOYMENT_TARGET=10.2
+This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set
+CFLAGS instead:
+ export CFLAGS="-mmacosx-version-min=10.2"
+The Wish.xcode project is setup to produce binaries that can run on 10.2 or
+later (except for the Universal and SDK configurations).
+Support for weak-linking was added to the code for 8.4.14/8.5a5.
+
+Detailed Instructions for building with carbon/GNUmakefile
+----------------------------------------------------------
+
+- Unpack the Tcl and Tk source release archives and place the tcl and tk source
+trees in a common parent directory.
+[ If you don't want have the two source trees in one directory, you'll need to ]
+[ create the following symbolic link for the build to work as setup by default ]
+[ ln -fs /path_to_tcl/build /path_to_tk/build ]
+[ (where /path_to_{tcl,tk} is the directory containing the tcl resp. tk tree) ]
+[ or you can pass an argument of BUILD_DIR=/somewhere to the tcl and tk make. ]
+
+- The following instructions assume the Tcl and Tk source trees are named
+"tcl${ver}" and "tk${ver}", respectively, where ${ver} is a shell variable
+containing the Tcl and Tk version number (for example '8.4.12').
+Setup the shell variable as follows:
+ set ver="8.4.12" ;: if your shell is csh
+ ver="8.4.12" ;: if your shell is sh
+The source trees will be named this way only if you are building from a release
+archive, if you are building from CVS, the version numbers will be missing; so
+set ${ver} to the empty string instead:
+ set ver="" ;: if your shell is csh
+ ver="" ;: if your shell is sh
+
+- The following steps will build Tcl and Tk from the Terminal, assuming you are
+located in the directory containing the tcl and tk source trees:
+ make -C tcl${ver}/macosx
+ make -C tk${ver}/carbon
+and the following will then install Tcl and Tk onto the root volume (admin
+password required):
+ sudo make -C tcl${ver}/macosx install
+ sudo make -C tk${ver}/carbon install
+if you don't have the admin password, you can install into your home directory,
+instead by passing an INSTALL_ROOT argument to make:
+ make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/"
+ make -C tk${ver}/carbon install INSTALL_ROOT="${HOME}/"
+
+- The default GNUmakefile targets will build _both_ debug and optimized versions
+of the Tcl and Tk frameworks with the standard convention of naming the debug
+library Tcl.framework/Tcl_debug resp. Tk.framework/Tk_debug.
+This allows switching to the debug libraries at runtime by setting
+ export DYLD_IMAGE_SUFFIX=_debug
+(c.f. man dyld for more details)
+
+If you only want to build and install the debug or optimized build, use the
+'develop' or 'deploy' target variants of the GNUmakefiles, respectively.
+For example, to build and install only the optimized versions:
+ make -C tcl${ver}/macosx deploy
+ make -C tk${ver}/carbon deploy
+ sudo make -C tcl${ver}/macosx install-deploy
+ sudo make -C tk${ver}/carbon install-deploy
+
+- The GNUmakefiles can also build a version of 'Wish' that has the Tcl and Tk
+frameworks embedded in its application package. This allows for standalone
+deployment of the application with no installation required, e.g. from read-only
+media. To build & install in this manner, use the 'embedded' target variants of
+the GNUmakefiles. For example, to build a standalone 'Wish.app'
+in ./embedded/Applications/Utilities:
+ make -C tcl${ver}/macosx embedded
+ make -C tk${ver}/carbon embedded
+ sudo make -C tcl${ver}/macosx install-embedded INSTALL_ROOT=`pwd`/embedded/
+ sudo make -C tk${ver}/carbon install-embedded INSTALL_ROOT=`pwd`/embedded/
+Notes:
+ * if you've already built standard TclTkAqua, building embedded does not
+ require any new compiling or linking, so you can skip the first two makes.
+ (making relinking unnecessary was added in 8.4.2)
+ * the embedded frameworks include only optimized builds and no documentation.
+ * the standalone Wish has the directory Wish.app/Contents/lib in its
+ auto_path. Thus you can place tcl extensions in this directory (i.e. embed
+ them in the app package) and load them with [package require].
+
+- It is possible to build Tk against an installed Tcl.framework; but you will
+still need a tcl sourcetree in the location specified in TCL_SRC_DIR in
+Tcl.framework/tclConfig.sh. Also, linking with Tcl.framework has to work exactly
+as indicated in TCL_LIB_SPEC in Tcl.framework/tclConfig.sh.
+If you used non-default install locations for Tcl.framework, specify them as
+make overrides to the tk/carbon GNUmakefile, e.g.
+ make -C tk${ver}/carbon \
+ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin
+ sudo make -C tk${ver}/carbon install \
+ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin
+The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added in Tk 8.4.3.
diff --git a/carbon/Tk-Info.plist.in b/carbon/Tk-Info.plist.in
new file mode 100644
index 0000000..1705a98
--- /dev/null
+++ b/carbon/Tk-Info.plist.in
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+
+ See the file "license.terms" for information on usage and redistribution of
+ this file, and for a DISCLAIMER OF ALL WARRANTIES.
+-->
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>@TK_LIB_FILE@</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@@TK_PATCH_LEVEL@,
+Copyright © 1989-@TK_YEAR@ Tcl Core Team,
+Copyright © 2002-@TK_YEAR@ Daniel A. Steffen,
+Copyright © 2001-2002 Apple Inc.,
+Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.tcltk.tklibrary</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@TK_VERSION@@TK_PATCH_LEVEL@</string>
+ <key>CFBundleSignature</key>
+ <string>Tk </string>
+ <key>CFBundleVersion</key>
+ <string>@TK_VERSION@@TK_PATCH_LEVEL@</string>
+</dict>
+</plist>
diff --git a/macosx/Wish-Common.xcconfig b/carbon/Wish-Common.xcconfig
index d9646a9..0c0ddc0 100644
--- a/macosx/Wish-Common.xcconfig
+++ b/carbon/Wish-Common.xcconfig
@@ -24,7 +24,7 @@ GCC = $(DEVELOPER_DIR)/usr/bin/gcc
GCC_VERSION = 4.0
CC = $(GCC)-$(GCC_VERSION)
LD = $(CC)
-WARNING_CFLAGS_GCC3 = -Wall -Wno-implicit-int -Wno-unused-parameter -Wno-deprecated-declarations
+WARNING_CFLAGS_GCC3 = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
WARNING_CFLAGS = -Wextra -Wno-missing-field-initializers -Winit-self -Wpointer-arith -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS_GCC3) $(WARNING_CFLAGS)
REZ_RESOURCE_MAP_READ_ONLY = YES
APPLICATION_INSTALL_PATH = /Applications/Utilities
@@ -45,4 +45,4 @@ TCL_PACKAGE_PATH = "$(LIBDIR)"
TCL_DEFS = HAVE_TCL_CONFIG_H
TK_LIBRARY = $(LIBDIR)/tk$(VERSION)
TK_DEFS = HAVE_TK_CONFIG_H TCL_NO_DEPRECATED
-VERSION = 8.5
+VERSION = 8.6
diff --git a/macosx/Wish-Debug.xcconfig b/carbon/Wish-Debug.xcconfig
index 09def97..09def97 100644
--- a/macosx/Wish-Debug.xcconfig
+++ b/carbon/Wish-Debug.xcconfig
diff --git a/carbon/Wish-Info.plist.in b/carbon/Wish-Info.plist.in
new file mode 100644
index 0000000..85b0b08
--- /dev/null
+++ b/carbon/Wish-Info.plist.in
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+
+ See the file "license.terms" for information on usage and redistribution of
+ this file, and for a DISCLAIMER OF ALL WARRANTIES.
+-->
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>tcl</string>
+ <string>TCL</string>
+ <string>*</string>
+ </array>
+ <key>CFBundleTypeMIMETypes</key>
+ <array>
+ <string>application/x-tcl</string>
+ <string>text/plain</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>NSStringPboardType</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>TEXT</string>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>Wish</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@,
+Copyright © 1989-@TK_YEAR@ Tcl Core Team,
+Copyright © 2002-@TK_YEAR@ Daniel A. Steffen,
+Copyright © 2001-2002 Apple Inc.,
+Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
+ <key>CFBundleIconFile</key>
+ <string>Wish.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.tcltk.wish</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleLocalizations</key>
+ <array>
+ @CFBUNDLELOCALIZATIONS@
+ </array>
+ <key>CFBundleName</key>
+ <string>Wish</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@TK_VERSION@@TK_PATCH_LEVEL@</string>
+ <key>CFBundleSignature</key>
+ <string>WiSH</string>
+ <key>CFBundleVersion</key>
+ <string>@TK_VERSION@@TK_PATCH_LEVEL@</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.2.0</string>
+ <key>LSRequiresCarbon</key>
+ <true/>
+ <key>NSAppleScriptEnabled</key>
+ <true/>
+</dict>
+</plist>
diff --git a/macosx/Wish-Release.xcconfig b/carbon/Wish-Release.xcconfig
index d843341..d843341 100644
--- a/macosx/Wish-Release.xcconfig
+++ b/carbon/Wish-Release.xcconfig
diff --git a/macosx/Wish.icns b/carbon/Wish.icns
index 060bfbd..060bfbd 100644
--- a/macosx/Wish.icns
+++ b/carbon/Wish.icns
Binary files differ
diff --git a/macosx/Wish.xcode/default.pbxuser b/carbon/Wish.xcode/default.pbxuser
index c832f6b..c832f6b 100644
--- a/macosx/Wish.xcode/default.pbxuser
+++ b/carbon/Wish.xcode/default.pbxuser
diff --git a/macosx/Wish.xcode/project.pbxproj b/carbon/Wish.xcode/project.pbxproj
index 24c0a82..8fe9214 100644
--- a/macosx/Wish.xcode/project.pbxproj
+++ b/carbon/Wish.xcode/project.pbxproj
@@ -8,6 +8,23 @@
/* Begin PBXBuildFile section */
F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
@@ -591,22 +608,70 @@
F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; };
F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; };
F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; };
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8DD76FB20486AB0100D96B5E /* tktest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tktest; sourceTree = BUILT_PRODUCTS_DIR; };
F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = "<group>"; };
F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = "<group>"; };
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBusy.c; sourceTree = "<group>"; };
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchoose.tcl; sourceTree = "<group>"; };
+ F915432A0EF201CF0032D1E8 /* zlib.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = zlib.test; sourceTree = "<group>"; };
+ F915432D0EF201EE0032D1E8 /* zlib.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = zlib.n; sourceTree = "<group>"; };
+ F9183E640EFC80CD0030B814 /* throw.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = throw.n; sourceTree = "<group>"; };
+ F9183E650EFC80D70030B814 /* try.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = try.n; sourceTree = "<group>"; };
+ F9183E6A0EFC81560030B814 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F9183E8F0EFC817B0030B814 /* tdbc */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tdbc; sourceTree = "<group>"; };
+ F91DC23C0E44C51B002CB8D1 /* nre.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = nre.test; sourceTree = "<group>"; };
+ F91DC23D0E44C530002CB8D1 /* unsupported.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = unsupported.test; sourceTree = "<group>"; };
F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = "<group>"; };
F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = "<group>"; };
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = "<group>"; };
+ F92D7F140DE777670033A13A /* tsdPerf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsdPerf.c; sourceTree = "<group>"; };
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhInstance.c; sourceTree = "<group>"; };
+ F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = "<group>"; };
+ F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = "<group>"; };
+ F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = "<group>"; };
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = "<group>"; };
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = "<group>"; };
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = "<group>"; };
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = "<group>"; };
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = "<group>"; };
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = "<group>"; };
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = "<group>"; };
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = "<group>"; };
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = "<group>"; };
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = "<group>"; };
+ F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = "<group>"; };
+ F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = "<group>"; };
+ F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = "<group>"; };
+ F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = "<group>"; };
+ F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = "<group>"; };
+ F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = "<group>"; };
+ F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = "<group>"; };
+ F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = "<group>"; };
+ F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = "<group>"; };
+ F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = "<group>"; };
F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = "<group>"; };
F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = "<group>"; };
F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = "<group>"; };
F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = "<group>"; };
F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = "<group>"; };
F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
+ F96437C90EF0D4B2003F468E /* tclZlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclZlib.c; sourceTree = "<group>"; };
+ F96437E60EF0D652003F468E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
@@ -768,7 +833,6 @@
F966BAA408F27A38005CB29B /* wm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wm.n; sourceTree = "<group>"; };
F966BAA608F27A38005CB29B /* default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default.h; sourceTree = "<group>"; };
F966BAA708F27A38005CB29B /* ks_names.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ks_names.h; sourceTree = "<group>"; };
- F966BAA808F27A38005CB29B /* prolog.ps */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = prolog.ps; sourceTree = "<group>"; };
F966BAA908F27A39005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
F966BAAA08F27A39005CB29B /* tk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.decls; sourceTree = "<group>"; };
F966BAAB08F27A39005CB29B /* tk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk.h; sourceTree = "<group>"; };
@@ -945,7 +1009,6 @@
F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; };
F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; };
F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
- F966BB8A08F27A3B005CB29B /* prolog.ps */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = prolog.ps; sourceTree = "<group>"; };
F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; };
F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; };
@@ -1053,7 +1116,6 @@
F966BC2F08F27A3C005CB29B /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
F966BC3008F27A3C005CB29B /* grab.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grab.test; sourceTree = "<group>"; };
F966BC3108F27A3C005CB29B /* grid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grid.test; sourceTree = "<group>"; };
- F966BC3208F27A3C005CB29B /* id.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = id.test; sourceTree = "<group>"; };
F966BC3308F27A3C005CB29B /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
F966BC3408F27A3C005CB29B /* imgBmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgBmap.test; sourceTree = "<group>"; };
F966BC3508F27A3C005CB29B /* imgPhoto.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPhoto.test; sourceTree = "<group>"; };
@@ -1837,7 +1899,6 @@
F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = "<group>"; };
F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = "<group>"; };
F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = "<group>"; };
- F96D437E08F272B6004A47F5 /* ioUtil.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioUtil.test; sourceTree = "<group>"; };
F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = "<group>"; };
F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = "<group>"; };
F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = "<group>"; };
@@ -2029,16 +2090,21 @@
F96D449808F272BA004A47F5 /* tclWinThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinThrd.c; sourceTree = "<group>"; };
F96D449908F272BA004A47F5 /* tclWinThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinThrd.h; sourceTree = "<group>"; };
F96D449A08F272BA004A47F5 /* tclWinTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTime.c; sourceTree = "<group>"; };
+ F973E5960EE99384001A648E /* vistaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vistaTheme.tcl; sourceTree = "<group>"; };
F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPrivate.h; sourceTree = "<group>"; };
F97AE7F10B65C1E900310EA2 /* Wish-Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Common.xcconfig"; sourceTree = "<group>"; };
F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Release.xcconfig"; sourceTree = "<group>"; };
F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Debug.xcconfig"; sourceTree = "<group>"; };
F9903CAF094FAADA004613E9 /* tclTomMath.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclTomMath.decls; sourceTree = "<group>"; };
F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMathDecls.h; sourceTree = "<group>"; };
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.tcl; sourceTree = "<group>"; };
+ F99388950EE02D980065FE6B /* fontchooser.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.test; sourceTree = "<group>"; };
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TclZlib.3; sourceTree = "<group>"; };
F9A3082D08F2D4AB00BAE1AB /* Tk.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F9A3084B08F2D4CE00BAE1AB /* Wish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wish.app; sourceTree = BUILT_PRODUCTS_DIR; };
F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F9A493240CEBF38300B78AE2 /* chanio.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chanio.test; sourceTree = "<group>"; };
+ F9C888C20EEF6571003F63AD /* fontchooser.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fontchooser.n; sourceTree = "<group>"; };
F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mclist.tcl; sourceTree = "<group>"; };
F9ECB1120B26521500A28025 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
F9ECB1130B26521500A28025 /* platform.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.tcl; sourceTree = "<group>"; };
@@ -2065,6 +2131,7 @@
buildActionMask = 2147483647;
files = (
F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */,
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */,
F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */,
F966C07908F28233005CB29B /* IOKit.framework in Frameworks */,
);
@@ -2075,6 +2142,7 @@
buildActionMask = 2147483647;
files = (
F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */,
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */,
F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */,
F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */,
F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */,
@@ -2113,6 +2181,15 @@
name = Products;
sourceTree = "<group>";
};
+ F9183E690EFC81560030B814 /* pkgs */ = {
+ isa = PBXGroup;
+ children = (
+ F9183E6A0EFC81560030B814 /* README */,
+ F9183E8F0EFC817B0030B814 /* tdbc */,
+ );
+ path = pkgs;
+ sourceTree = "<group>";
+ };
F966BA0308F27A37005CB29B /* bitmaps */ = {
isa = PBXGroup;
children = (
@@ -2176,6 +2253,7 @@
F966BA3908F27A37005CB29B /* focus.n */,
F966BA3A08F27A37005CB29B /* focusNext.n */,
F966BA3B08F27A37005CB29B /* font.n */,
+ F9C888C20EEF6571003F63AD /* fontchooser.n */,
F966BA3C08F27A37005CB29B /* FontId.3 */,
F966BA3D08F27A37005CB29B /* frame.n */,
F966BA3E08F27A37005CB29B /* FreeXId.3 */,
@@ -2311,7 +2389,6 @@
children = (
F966BAA608F27A38005CB29B /* default.h */,
F966BAA708F27A38005CB29B /* ks_names.h */,
- F966BAA808F27A38005CB29B /* prolog.ps */,
F966BAA908F27A39005CB29B /* README */,
F966BAAA08F27A39005CB29B /* tk.decls */,
F966BAAB08F27A39005CB29B /* tk.h */,
@@ -2321,6 +2398,7 @@
F966BAAF08F27A39005CB29B /* tkAtom.c */,
F966BAB008F27A39005CB29B /* tkBind.c */,
F966BAB108F27A39005CB29B /* tkBitmap.c */,
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */,
F966BAB208F27A39005CB29B /* tkButton.c */,
F966BAB308F27A39005CB29B /* tkButton.h */,
F966BAB408F27A39005CB29B /* tkCanvArc.c */,
@@ -2360,6 +2438,7 @@
F966BAD708F27A39005CB29B /* tkImage.c */,
F966BAD808F27A39005CB29B /* tkImgBmap.c */,
F966BAD908F27A39005CB29B /* tkImgGIF.c */,
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */,
F966BADA08F27A39005CB29B /* tkImgPhoto.c */,
F966BADB08F27A39005CB29B /* tkImgPPM.c */,
F966BADC08F27A39005CB29B /* tkImgUtil.c */,
@@ -2432,6 +2511,7 @@
F966BB6208F27A3A005CB29B /* dialog.tcl */,
F966BB6308F27A3A005CB29B /* entry.tcl */,
F966BB6408F27A3A005CB29B /* focus.tcl */,
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */,
F966BB7308F27A3A005CB29B /* listbox.tcl */,
F966BB7408F27A3A005CB29B /* menu.tcl */,
F966BB7508F27A3A005CB29B /* mkpsenc.tcl */,
@@ -2440,7 +2520,6 @@
F966BB8708F27A3A005CB29B /* optMenu.tcl */,
F966BB8808F27A3A005CB29B /* palette.tcl */,
F966BB8908F27A3B005CB29B /* panedwindow.tcl */,
- F966BB8A08F27A3B005CB29B /* prolog.ps */,
F966BB8B08F27A3B005CB29B /* safetk.tcl */,
F966BB8C08F27A3B005CB29B /* scale.tcl */,
F966BB8D08F27A3B005CB29B /* scrlbar.tcl */,
@@ -2480,6 +2559,7 @@
F966BB2C08F27A39005CB29B /* entry3.tcl */,
F966BB2D08F27A39005CB29B /* filebox.tcl */,
F966BB2E08F27A39005CB29B /* floor.tcl */,
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */,
F966BB2F08F27A39005CB29B /* form.tcl */,
F966BB3008F27A39005CB29B /* goldberg.tcl */,
F966BB3108F27A39005CB29B /* hello */,
@@ -2532,7 +2612,7 @@
path = demos;
sourceTree = "<group>";
};
- F966BB9708F27A3B005CB29B /* macosx */ = {
+ F966BB9708F27A3B005CB29B /* carbon */ = {
isa = PBXGroup;
children = (
F966BBBA08F27A3B005CB29B /* configure.ac */,
@@ -2591,7 +2671,7 @@
F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */,
F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */,
);
- path = macosx;
+ path = carbon;
sourceTree = "<group>";
};
F966BC0408F27A3C005CB29B /* tests */ = {
@@ -2637,12 +2717,12 @@
F966BC2A08F27A3C005CB29B /* focus.test */,
F966BC2B08F27A3C005CB29B /* focusTcl.test */,
F966BC2C08F27A3C005CB29B /* font.test */,
+ F99388950EE02D980065FE6B /* fontchooser.test */,
F966BC2D08F27A3C005CB29B /* frame.test */,
F966BC2E08F27A3C005CB29B /* geometry.test */,
F966BC2F08F27A3C005CB29B /* get.test */,
F966BC3008F27A3C005CB29B /* grab.test */,
F966BC3108F27A3C005CB29B /* grid.test */,
- F966BC3208F27A3C005CB29B /* id.test */,
F966BC3308F27A3C005CB29B /* image.test */,
F966BC3408F27A3C005CB29B /* imgBmap.test */,
F966BC3508F27A3C005CB29B /* imgPhoto.test */,
@@ -2849,6 +2929,7 @@
isa = PBXGroup;
children = (
F966C07408F2820D005CB29B /* CoreFoundation.framework */,
+ F96437E60EF0D652003F468E /* libz.dylib */,
F966C07608F2821B005CB29B /* Carbon.framework */,
F966C07808F28233005CB29B /* IOKit.framework */,
F9FD32140CC1AF170073837D /* libX11.dylib */,
@@ -2929,6 +3010,7 @@
F968884C0AF787B3000797B5 /* ttk.tcl */,
F968884D0AF787B3000797B5 /* utils.tcl */,
F968884E0AF787B3000797B5 /* winTheme.tcl */,
+ F973E5960EE99384001A648E /* vistaTheme.tcl */,
F968884F0AF787B3000797B5 /* xpTheme.tcl */,
);
path = ttk;
@@ -2968,6 +3050,7 @@
F96D434408F272B5004A47F5 /* tests */,
F96D3DFC08F272A4004A47F5 /* doc */,
F96D43D008F272B8004A47F5 /* tools */,
+ F9183E690EFC81560030B814 /* pkgs */,
F96D3DFA08F272A4004A47F5 /* ChangeLog */,
F96D3DFB08F272A4004A47F5 /* changes */,
F96D434308F272B5004A47F5 /* README */,
@@ -2980,7 +3063,7 @@
isa = PBXGroup;
children = (
F966BAA508F27A38005CB29B /* generic */,
- F966BB9708F27A3B005CB29B /* macosx */,
+ F966BB9708F27A3B005CB29B /* carbon */,
F966BC6B08F27A3D005CB29B /* unix */,
F966BD1908F27A3F005CB29B /* xlib */,
F966BA0308F27A37005CB29B /* bitmaps */,
@@ -3022,12 +3105,15 @@
F96D3E1108F272A5004A47F5 /* cd.n */,
F96D3E1208F272A5004A47F5 /* chan.n */,
F96D3E1308F272A5004A47F5 /* ChnlStack.3 */,
+ F93599CF0DF1F87F00E04F67 /* Class.3 */,
+ F93599D00DF1F89E00E04F67 /* class.n */,
F96D3E1408F272A5004A47F5 /* clock.n */,
F96D3E1508F272A5004A47F5 /* close.n */,
F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */,
F96D3E1708F272A5004A47F5 /* Concat.3 */,
F96D3E1808F272A5004A47F5 /* concat.n */,
F96D3E1908F272A5004A47F5 /* continue.n */,
+ F93599D20DF1F8DF00E04F67 /* copy.n */,
F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */,
F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */,
F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */,
@@ -3040,6 +3126,7 @@
F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */,
F96D3E2408F272A5004A47F5 /* CrtTrace.3 */,
F96D3E2508F272A5004A47F5 /* dde.n */,
+ F93599D30DF1F8F500E04F67 /* define.n */,
F96D3E2608F272A5004A47F5 /* DetachPids.3 */,
F96D3E2708F272A5004A47F5 /* dict.n */,
F96D3E2808F272A5004A47F5 /* DictObj.3 */,
@@ -3117,11 +3204,15 @@
F96D3E7008F272A6004A47F5 /* man.macros */,
F96D3E7108F272A6004A47F5 /* mathfunc.n */,
F96D3E7208F272A6004A47F5 /* memory.n */,
+ F93599D40DF1F91900E04F67 /* Method.3 */,
F96D3E7308F272A6004A47F5 /* msgcat.n */,
+ F93599D50DF1F93700E04F67 /* my.n */,
F96D3E7408F272A6004A47F5 /* Namespace.3 */,
F96D3E7508F272A6004A47F5 /* namespace.n */,
+ F93599D60DF1F95000E04F67 /* next.n */,
F96D3E7608F272A6004A47F5 /* Notifier.3 */,
F96D3E7708F272A6004A47F5 /* Object.3 */,
+ F93599D70DF1F96800E04F67 /* object.n */,
F96D3E7808F272A6004A47F5 /* ObjectType.3 */,
F96D3E7908F272A6004A47F5 /* open.n */,
F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */,
@@ -3155,6 +3246,7 @@
F96D3E9408F272A6004A47F5 /* SaveResult.3 */,
F96D3E9508F272A6004A47F5 /* scan.n */,
F96D3E9608F272A6004A47F5 /* seek.n */,
+ F93599D80DF1F98300E04F67 /* self.n */,
F96D3E9708F272A6004A47F5 /* set.n */,
F96D3E9808F272A6004A47F5 /* SetChanErr.3 */,
F96D3E9908F272A6004A47F5 /* SetErrno.3 */,
@@ -3178,6 +3270,7 @@
F96D3EAB08F272A7004A47F5 /* SubstObj.3 */,
F96D3EAC08F272A7004A47F5 /* switch.n */,
F96D3EAD08F272A7004A47F5 /* Tcl.n */,
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */,
F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */,
F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */,
F96D3EB008F272A7004A47F5 /* tclsh.1 */,
@@ -3185,6 +3278,7 @@
F96D3EB208F272A7004A47F5 /* tclvars.n */,
F96D3EB308F272A7004A47F5 /* tell.n */,
F96D3EB408F272A7004A47F5 /* Thread.3 */,
+ F9183E640EFC80CD0030B814 /* throw.n */,
F96D3EB508F272A7004A47F5 /* time.n */,
F96D3EB608F272A7004A47F5 /* tm.n */,
F96D3EB708F272A7004A47F5 /* ToUpper.3 */,
@@ -3192,6 +3286,7 @@
F96D3EB908F272A7004A47F5 /* TraceCmd.3 */,
F96D3EBA08F272A7004A47F5 /* TraceVar.3 */,
F96D3EBB08F272A7004A47F5 /* Translate.3 */,
+ F9183E650EFC80D70030B814 /* try.n */,
F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */,
F96D3EBD08F272A7004A47F5 /* unknown.n */,
F96D3EBE08F272A7004A47F5 /* unload.n */,
@@ -3205,6 +3300,7 @@
F96D3EC608F272A7004A47F5 /* vwait.n */,
F96D3EC708F272A7004A47F5 /* while.n */,
F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */,
+ F915432D0EF201EE0032D1E8 /* zlib.n */,
);
path = doc;
sourceTree = "<group>";
@@ -3269,6 +3365,7 @@
F96D3F0008F272A7004A47F5 /* tclIOCmd.c */,
F96D3F0108F272A7004A47F5 /* tclIOGT.c */,
F96D3F0208F272A7004A47F5 /* tclIORChan.c */,
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */,
F96D3F0308F272A7004A47F5 /* tclIOSock.c */,
F96D3F0408F272A7004A47F5 /* tclIOUtil.c */,
F96D3F0508F272A7004A47F5 /* tclLink.c */,
@@ -3280,6 +3377,19 @@
F96D3F0B08F272A7004A47F5 /* tclNamesp.c */,
F96D3F0C08F272A7004A47F5 /* tclNotify.c */,
F96D3F0D08F272A7004A47F5 /* tclObj.c */,
+ F93599B20DF1F75400E04F67 /* tclOO.c */,
+ F93599B40DF1F75900E04F67 /* tclOO.decls */,
+ F93599B50DF1F75D00E04F67 /* tclOO.h */,
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */,
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */,
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */,
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */,
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */,
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */,
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */,
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */,
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */,
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */,
F96D3F0E08F272A7004A47F5 /* tclPanic.c */,
F96D3F0F08F272A7004A47F5 /* tclParse.c */,
F96D3F1108F272A7004A47F5 /* tclPathObj.c */,
@@ -3318,6 +3428,7 @@
F96D3F3408F272A7004A47F5 /* tclUtf.c */,
F96D3F3508F272A7004A47F5 /* tclUtil.c */,
F96D3F3608F272A7004A47F5 /* tclVar.c */,
+ F96437C90EF0D4B2003F468E /* tclZlib.c */,
F96D3F3708F272A7004A47F5 /* tommath.h */,
);
path = generic;
@@ -3618,7 +3729,6 @@
F96D437B08F272B6004A47F5 /* io.test */,
F96D437C08F272B6004A47F5 /* ioCmd.test */,
F96D437D08F272B6004A47F5 /* iogt.test */,
- F96D437E08F272B6004A47F5 /* ioUtil.test */,
F96D437F08F272B6004A47F5 /* join.test */,
F96D438008F272B6004A47F5 /* lindex.test */,
F96D438108F272B6004A47F5 /* link.test */,
@@ -3642,7 +3752,9 @@
F96D439108F272B6004A47F5 /* namespace-old.test */,
F96D439208F272B7004A47F5 /* namespace.test */,
F96D439308F272B7004A47F5 /* notify.test */,
+ F91DC23C0E44C51B002CB8D1 /* nre.test */,
F96D439408F272B7004A47F5 /* obj.test */,
+ F93599C80DF1F81900E04F67 /* oo.test */,
F96D439508F272B7004A47F5 /* opt.test */,
F96D439608F272B7004A47F5 /* package.test */,
F96D439708F272B7004A47F5 /* parse.test */,
@@ -3688,6 +3800,7 @@
F96D43BF08F272B7004A47F5 /* unixNotfy.test */,
F96D43C008F272B7004A47F5 /* unknown.test */,
F96D43C108F272B7004A47F5 /* unload.test */,
+ F91DC23D0E44C530002CB8D1 /* unsupported.test */,
F96D43C208F272B7004A47F5 /* uplevel.test */,
F96D43C308F272B7004A47F5 /* upvar.test */,
F96D43C408F272B7004A47F5 /* utf.test */,
@@ -3702,6 +3815,7 @@
F96D43CD08F272B7004A47F5 /* winNotify.test */,
F96D43CE08F272B7004A47F5 /* winPipe.test */,
F96D43CF08F272B7004A47F5 /* winTime.test */,
+ F915432A0EF201CF0032D1E8 /* zlib.test */,
);
path = tests;
sourceTree = "<group>";
@@ -3734,6 +3848,8 @@
F96D443708F272B9004A47F5 /* tclmin.wse */,
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
+ F92D7F140DE777670033A13A /* tsdPerf.c */,
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */,
F96D443B08F272B9004A47F5 /* uniClass.tcl */,
F96D443C08F272B9004A47F5 /* uniParse.tcl */,
);
@@ -3976,7 +4092,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
+ shellScript = "gnumake -C \"${TK_SRCROOT}/carbon\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
};
F9A5C5F508F651A2008AE941 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -4005,7 +4121,7 @@
files = (
);
inputPaths = (
- "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/carbon/configure.ac",
"$(TK_SRCROOT)/unix/configure.in",
"$(TK_SRCROOT)/unix/tcl.m4",
"$(TK_SRCROOT)/unix/aclocal.m4",
@@ -4016,7 +4132,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/carbon &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/carbon\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/carbon/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n \"${TK_SRCROOT}\"/carbon/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua=carbon --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
};
F9FD30B40CC1AD070073837D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -4045,7 +4161,7 @@
files = (
);
inputPaths = (
- "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/carbon/configure.ac",
"$(TK_SRCROOT)/unix/configure.in",
"$(TK_SRCROOT)/unix/tcl.m4",
"$(TK_SRCROOT)/unix/aclocal.m4",
@@ -4056,7 +4172,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/carbon &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/carbon\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/carbon/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/carbon/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
};
/* End PBXShellScriptBuildPhase section */
@@ -4099,6 +4215,7 @@
F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */,
F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */,
F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */,
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */,
F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */,
F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */,
F96D45A408F272BC004A47F5 /* tclLink.c in Sources */,
@@ -4109,6 +4226,14 @@
F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */,
F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */,
F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */,
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */,
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */,
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */,
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */,
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */,
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */,
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */,
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */,
F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */,
F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */,
F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */,
@@ -4136,6 +4261,7 @@
F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */,
F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */,
F96D45D508F272BC004A47F5 /* tclVar.c in Sources */,
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */,
F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */,
F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */,
F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */,
@@ -4217,6 +4343,7 @@
F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */,
F966BDD308F27A3F005CB29B /* tkBind.c in Sources */,
F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */,
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */,
F966BDD508F27A3F005CB29B /* tkButton.c in Sources */,
F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */,
F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */,
@@ -4249,6 +4376,7 @@
F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */,
F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */,
F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */,
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */,
F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */,
F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */,
F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */,
@@ -4400,6 +4528,7 @@
F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */,
F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */,
F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */,
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */,
F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */,
F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */,
F9FD30E00CC1AD070073837D /* tclLink.c in Sources */,
@@ -4410,6 +4539,14 @@
F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */,
F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */,
F9FD30E70CC1AD070073837D /* tclObj.c in Sources */,
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */,
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */,
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */,
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */,
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */,
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */,
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */,
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */,
F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */,
F9FD30E90CC1AD070073837D /* tclParse.c in Sources */,
F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */,
@@ -4437,6 +4574,7 @@
F9FD31000CC1AD070073837D /* tclUtf.c in Sources */,
F9FD31010CC1AD070073837D /* tclUtil.c in Sources */,
F9FD31020CC1AD070073837D /* tclVar.c in Sources */,
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */,
F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */,
F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */,
F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */,
@@ -4518,6 +4656,7 @@
F9FD31510CC1AD070073837D /* tkAtom.c in Sources */,
F9FD31520CC1AD070073837D /* tkBind.c in Sources */,
F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */,
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */,
F9FD31540CC1AD070073837D /* tkButton.c in Sources */,
F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */,
F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */,
@@ -4550,6 +4689,7 @@
F9FD31710CC1AD070073837D /* tkImage.c in Sources */,
F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */,
F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */,
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */,
F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */,
F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */,
F9FD31760CC1AD070073837D /* tkListbox.c in Sources */,
diff --git a/macosx/Wish.xcodeproj/default.pbxuser b/carbon/Wish.xcodeproj/default.pbxuser
index cd9a9a6..cd9a9a6 100644
--- a/macosx/Wish.xcodeproj/default.pbxuser
+++ b/carbon/Wish.xcodeproj/default.pbxuser
diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/carbon/Wish.xcodeproj/project.pbxproj
index fe78b0b..9c0a84c 100644
--- a/macosx/Wish.xcodeproj/project.pbxproj
+++ b/carbon/Wish.xcodeproj/project.pbxproj
@@ -8,6 +8,23 @@
/* Begin PBXBuildFile section */
F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
@@ -292,6 +309,8 @@
F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446708F272B9004A47F5 /* tclUnixSock.c */; };
F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446908F272B9004A47F5 /* tclUnixThrd.c */; };
F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446B08F272B9004A47F5 /* tclUnixTime.c */; };
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
F9E61D28090A481F002B3151 /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */; };
F9E61D29090A486C002B3151 /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A208F272B3004A47F5 /* bn_mp_neg.c */; };
F9E61D2A090A4891002B3151 /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */; };
@@ -593,22 +612,70 @@
F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; };
F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; };
F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; };
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
8DD76FB20486AB0100D96B5E /* tktest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tktest; sourceTree = BUILT_PRODUCTS_DIR; };
F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = "<group>"; };
F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = "<group>"; };
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBusy.c; sourceTree = "<group>"; };
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchoose.tcl; sourceTree = "<group>"; };
+ F915432A0EF201CF0032D1E8 /* zlib.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = zlib.test; sourceTree = "<group>"; };
+ F915432D0EF201EE0032D1E8 /* zlib.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = zlib.n; sourceTree = "<group>"; };
+ F9183E640EFC80CD0030B814 /* throw.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = throw.n; sourceTree = "<group>"; };
+ F9183E650EFC80D70030B814 /* try.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = try.n; sourceTree = "<group>"; };
+ F9183E6A0EFC81560030B814 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F9183E8F0EFC817B0030B814 /* tdbc */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tdbc; sourceTree = "<group>"; };
+ F91DC23C0E44C51B002CB8D1 /* nre.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = nre.test; sourceTree = "<group>"; };
+ F91DC23D0E44C530002CB8D1 /* unsupported.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = unsupported.test; sourceTree = "<group>"; };
F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = "<group>"; };
F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = "<group>"; };
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = "<group>"; };
+ F92D7F140DE777670033A13A /* tsdPerf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsdPerf.c; sourceTree = "<group>"; };
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhInstance.c; sourceTree = "<group>"; };
+ F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = "<group>"; };
+ F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = "<group>"; };
+ F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = "<group>"; };
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = "<group>"; };
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = "<group>"; };
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = "<group>"; };
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = "<group>"; };
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = "<group>"; };
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = "<group>"; };
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = "<group>"; };
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = "<group>"; };
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = "<group>"; };
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = "<group>"; };
+ F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = "<group>"; };
+ F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = "<group>"; };
+ F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = "<group>"; };
+ F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = "<group>"; };
+ F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = "<group>"; };
+ F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = "<group>"; };
+ F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = "<group>"; };
+ F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = "<group>"; };
+ F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = "<group>"; };
+ F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = "<group>"; };
F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = "<group>"; };
F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = "<group>"; };
F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = "<group>"; };
F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = "<group>"; };
F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = "<group>"; };
F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
+ F96437C90EF0D4B2003F468E /* tclZlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclZlib.c; sourceTree = "<group>"; };
+ F96437E60EF0D652003F468E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
@@ -770,7 +837,6 @@
F966BAA408F27A38005CB29B /* wm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wm.n; sourceTree = "<group>"; };
F966BAA608F27A38005CB29B /* default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default.h; sourceTree = "<group>"; };
F966BAA708F27A38005CB29B /* ks_names.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ks_names.h; sourceTree = "<group>"; };
- F966BAA808F27A38005CB29B /* prolog.ps */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = prolog.ps; sourceTree = "<group>"; };
F966BAA908F27A39005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
F966BAAA08F27A39005CB29B /* tk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.decls; sourceTree = "<group>"; };
F966BAAB08F27A39005CB29B /* tk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk.h; sourceTree = "<group>"; };
@@ -947,7 +1013,6 @@
F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; };
F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; };
F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
- F966BB8A08F27A3B005CB29B /* prolog.ps */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = prolog.ps; sourceTree = "<group>"; };
F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; };
F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; };
@@ -1055,7 +1120,6 @@
F966BC2F08F27A3C005CB29B /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
F966BC3008F27A3C005CB29B /* grab.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grab.test; sourceTree = "<group>"; };
F966BC3108F27A3C005CB29B /* grid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grid.test; sourceTree = "<group>"; };
- F966BC3208F27A3C005CB29B /* id.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = id.test; sourceTree = "<group>"; };
F966BC3308F27A3C005CB29B /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
F966BC3408F27A3C005CB29B /* imgBmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgBmap.test; sourceTree = "<group>"; };
F966BC3508F27A3C005CB29B /* imgPhoto.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPhoto.test; sourceTree = "<group>"; };
@@ -1839,7 +1903,6 @@
F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = "<group>"; };
F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = "<group>"; };
F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = "<group>"; };
- F96D437E08F272B6004A47F5 /* ioUtil.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioUtil.test; sourceTree = "<group>"; };
F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = "<group>"; };
F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = "<group>"; };
F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = "<group>"; };
@@ -2031,17 +2094,26 @@
F96D449808F272BA004A47F5 /* tclWinThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinThrd.c; sourceTree = "<group>"; };
F96D449908F272BA004A47F5 /* tclWinThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinThrd.h; sourceTree = "<group>"; };
F96D449A08F272BA004A47F5 /* tclWinTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTime.c; sourceTree = "<group>"; };
+ F973E5960EE99384001A648E /* vistaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vistaTheme.tcl; sourceTree = "<group>"; };
F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPrivate.h; sourceTree = "<group>"; };
F97AE7F10B65C1E900310EA2 /* Wish-Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Common.xcconfig"; sourceTree = "<group>"; };
F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Release.xcconfig"; sourceTree = "<group>"; };
F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Wish-Debug.xcconfig"; sourceTree = "<group>"; };
+ F98383650F0FA43900171CA6 /* checkbutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkbutton.test; sourceTree = "<group>"; };
+ F98383680F0FA44700171CA6 /* radiobutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = radiobutton.test; sourceTree = "<group>"; };
F9903CAF094FAADA004613E9 /* tclTomMath.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclTomMath.decls; sourceTree = "<group>"; };
F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMathDecls.h; sourceTree = "<group>"; };
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.tcl; sourceTree = "<group>"; };
+ F99388950EE02D980065FE6B /* fontchooser.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.test; sourceTree = "<group>"; };
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TclZlib.3; sourceTree = "<group>"; };
F9A3082D08F2D4AB00BAE1AB /* Tk.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F9A3084B08F2D4CE00BAE1AB /* Wish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wish.app; sourceTree = BUILT_PRODUCTS_DIR; };
F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F9A493240CEBF38300B78AE2 /* chanio.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chanio.test; sourceTree = "<group>"; };
+ F9C888C20EEF6571003F63AD /* fontchooser.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fontchooser.n; sourceTree = "<group>"; };
F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mclist.tcl; sourceTree = "<group>"; };
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPNG.c; sourceTree = "<group>"; };
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPNG.test; sourceTree = "<group>"; };
F9ECB1120B26521500A28025 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
F9ECB1130B26521500A28025 /* platform.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.tcl; sourceTree = "<group>"; };
F9ECB1140B26521500A28025 /* shell.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = shell.tcl; sourceTree = "<group>"; };
@@ -2068,6 +2140,7 @@
buildActionMask = 2147483647;
files = (
F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */,
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */,
F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */,
F966C07908F28233005CB29B /* IOKit.framework in Frameworks */,
);
@@ -2078,6 +2151,7 @@
buildActionMask = 2147483647;
files = (
F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */,
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */,
F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */,
F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */,
F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */,
@@ -2116,6 +2190,15 @@
name = Products;
sourceTree = "<group>";
};
+ F9183E690EFC81560030B814 /* pkgs */ = {
+ isa = PBXGroup;
+ children = (
+ F9183E6A0EFC81560030B814 /* README */,
+ F9183E8F0EFC817B0030B814 /* tdbc */,
+ );
+ path = pkgs;
+ sourceTree = "<group>";
+ };
F966BA0308F27A37005CB29B /* bitmaps */ = {
isa = PBXGroup;
children = (
@@ -2179,6 +2262,7 @@
F966BA3908F27A37005CB29B /* focus.n */,
F966BA3A08F27A37005CB29B /* focusNext.n */,
F966BA3B08F27A37005CB29B /* font.n */,
+ F9C888C20EEF6571003F63AD /* fontchooser.n */,
F966BA3C08F27A37005CB29B /* FontId.3 */,
F966BA3D08F27A37005CB29B /* frame.n */,
F966BA3E08F27A37005CB29B /* FreeXId.3 */,
@@ -2314,7 +2398,6 @@
children = (
F966BAA608F27A38005CB29B /* default.h */,
F966BAA708F27A38005CB29B /* ks_names.h */,
- F966BAA808F27A38005CB29B /* prolog.ps */,
F966BAA908F27A39005CB29B /* README */,
F966BAAA08F27A39005CB29B /* tk.decls */,
F966BAAB08F27A39005CB29B /* tk.h */,
@@ -2324,6 +2407,7 @@
F966BAAF08F27A39005CB29B /* tkAtom.c */,
F966BAB008F27A39005CB29B /* tkBind.c */,
F966BAB108F27A39005CB29B /* tkBitmap.c */,
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */,
F966BAB208F27A39005CB29B /* tkButton.c */,
F966BAB308F27A39005CB29B /* tkButton.h */,
F966BAB408F27A39005CB29B /* tkCanvArc.c */,
@@ -2363,7 +2447,9 @@
F966BAD708F27A39005CB29B /* tkImage.c */,
F966BAD808F27A39005CB29B /* tkImgBmap.c */,
F966BAD908F27A39005CB29B /* tkImgGIF.c */,
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */,
F966BADA08F27A39005CB29B /* tkImgPhoto.c */,
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */,
F966BADB08F27A39005CB29B /* tkImgPPM.c */,
F966BADC08F27A39005CB29B /* tkImgUtil.c */,
F966BADE08F27A39005CB29B /* tkInt.decls */,
@@ -2435,6 +2521,7 @@
F966BB6208F27A3A005CB29B /* dialog.tcl */,
F966BB6308F27A3A005CB29B /* entry.tcl */,
F966BB6408F27A3A005CB29B /* focus.tcl */,
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */,
F966BB7308F27A3A005CB29B /* listbox.tcl */,
F966BB7408F27A3A005CB29B /* menu.tcl */,
F966BB7508F27A3A005CB29B /* mkpsenc.tcl */,
@@ -2443,7 +2530,6 @@
F966BB8708F27A3A005CB29B /* optMenu.tcl */,
F966BB8808F27A3A005CB29B /* palette.tcl */,
F966BB8908F27A3B005CB29B /* panedwindow.tcl */,
- F966BB8A08F27A3B005CB29B /* prolog.ps */,
F966BB8B08F27A3B005CB29B /* safetk.tcl */,
F966BB8C08F27A3B005CB29B /* scale.tcl */,
F966BB8D08F27A3B005CB29B /* scrlbar.tcl */,
@@ -2483,6 +2569,7 @@
F966BB2C08F27A39005CB29B /* entry3.tcl */,
F966BB2D08F27A39005CB29B /* filebox.tcl */,
F966BB2E08F27A39005CB29B /* floor.tcl */,
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */,
F966BB2F08F27A39005CB29B /* form.tcl */,
F966BB3008F27A39005CB29B /* goldberg.tcl */,
F966BB3108F27A39005CB29B /* hello */,
@@ -2535,7 +2622,7 @@
path = demos;
sourceTree = "<group>";
};
- F966BB9708F27A3B005CB29B /* macosx */ = {
+ F966BB9708F27A3B005CB29B /* carbon */ = {
isa = PBXGroup;
children = (
F966BBBA08F27A3B005CB29B /* configure.ac */,
@@ -2594,7 +2681,7 @@
F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */,
F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */,
);
- path = macosx;
+ path = carbon;
sourceTree = "<group>";
};
F966BC0408F27A3C005CB29B /* tests */ = {
@@ -2640,15 +2727,16 @@
F966BC2A08F27A3C005CB29B /* focus.test */,
F966BC2B08F27A3C005CB29B /* focusTcl.test */,
F966BC2C08F27A3C005CB29B /* font.test */,
+ F99388950EE02D980065FE6B /* fontchooser.test */,
F966BC2D08F27A3C005CB29B /* frame.test */,
F966BC2E08F27A3C005CB29B /* geometry.test */,
F966BC2F08F27A3C005CB29B /* get.test */,
F966BC3008F27A3C005CB29B /* grab.test */,
F966BC3108F27A3C005CB29B /* grid.test */,
- F966BC3208F27A3C005CB29B /* id.test */,
F966BC3308F27A3C005CB29B /* image.test */,
F966BC3408F27A3C005CB29B /* imgBmap.test */,
F966BC3508F27A3C005CB29B /* imgPhoto.test */,
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */,
F966BC3608F27A3C005CB29B /* imgPPM.test */,
F966BC3708F27A3C005CB29B /* listbox.test */,
F966BC3808F27A3C005CB29B /* main.test */,
@@ -2852,6 +2940,7 @@
isa = PBXGroup;
children = (
F966C07408F2820D005CB29B /* CoreFoundation.framework */,
+ F96437E60EF0D652003F468E /* libz.dylib */,
F966C07608F2821B005CB29B /* Carbon.framework */,
F966C07808F28233005CB29B /* IOKit.framework */,
F9FD32140CC1AF170073837D /* libX11.dylib */,
@@ -2932,6 +3021,7 @@
F968884C0AF787B3000797B5 /* ttk.tcl */,
F968884D0AF787B3000797B5 /* utils.tcl */,
F968884E0AF787B3000797B5 /* winTheme.tcl */,
+ F973E5960EE99384001A648E /* vistaTheme.tcl */,
F968884F0AF787B3000797B5 /* xpTheme.tcl */,
);
path = ttk;
@@ -2941,6 +3031,7 @@
isa = PBXGroup;
children = (
F96888540AF7880C000797B5 /* all.tcl */,
+ F98383650F0FA43900171CA6 /* checkbutton.test */,
F96888560AF7880C000797B5 /* combobox.test */,
F96888570AF7880C000797B5 /* entry.test */,
F96888580AF7880C000797B5 /* image.test */,
@@ -2949,6 +3040,7 @@
F968885C0AF7880C000797B5 /* notebook.test */,
F968885D0AF7880C000797B5 /* panedwindow.test */,
F968885E0AF7880C000797B5 /* progressbar.test */,
+ F98383680F0FA44700171CA6 /* radiobutton.test */,
F968885F0AF7880C000797B5 /* scrollbar.test */,
F96888600AF7880C000797B5 /* treetags.test */,
F96888610AF7880C000797B5 /* treeview.test */,
@@ -2971,6 +3063,7 @@
F96D434408F272B5004A47F5 /* tests */,
F96D3DFC08F272A4004A47F5 /* doc */,
F96D43D008F272B8004A47F5 /* tools */,
+ F9183E690EFC81560030B814 /* pkgs */,
F96D3DFA08F272A4004A47F5 /* ChangeLog */,
F96D3DFB08F272A4004A47F5 /* changes */,
F96D434308F272B5004A47F5 /* README */,
@@ -2983,7 +3076,7 @@
isa = PBXGroup;
children = (
F966BAA508F27A38005CB29B /* generic */,
- F966BB9708F27A3B005CB29B /* macosx */,
+ F966BB9708F27A3B005CB29B /* carbon */,
F966BC6B08F27A3D005CB29B /* unix */,
F966BD1908F27A3F005CB29B /* xlib */,
F966BA0308F27A37005CB29B /* bitmaps */,
@@ -3025,12 +3118,15 @@
F96D3E1108F272A5004A47F5 /* cd.n */,
F96D3E1208F272A5004A47F5 /* chan.n */,
F96D3E1308F272A5004A47F5 /* ChnlStack.3 */,
+ F93599CF0DF1F87F00E04F67 /* Class.3 */,
+ F93599D00DF1F89E00E04F67 /* class.n */,
F96D3E1408F272A5004A47F5 /* clock.n */,
F96D3E1508F272A5004A47F5 /* close.n */,
F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */,
F96D3E1708F272A5004A47F5 /* Concat.3 */,
F96D3E1808F272A5004A47F5 /* concat.n */,
F96D3E1908F272A5004A47F5 /* continue.n */,
+ F93599D20DF1F8DF00E04F67 /* copy.n */,
F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */,
F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */,
F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */,
@@ -3043,6 +3139,7 @@
F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */,
F96D3E2408F272A5004A47F5 /* CrtTrace.3 */,
F96D3E2508F272A5004A47F5 /* dde.n */,
+ F93599D30DF1F8F500E04F67 /* define.n */,
F96D3E2608F272A5004A47F5 /* DetachPids.3 */,
F96D3E2708F272A5004A47F5 /* dict.n */,
F96D3E2808F272A5004A47F5 /* DictObj.3 */,
@@ -3120,11 +3217,15 @@
F96D3E7008F272A6004A47F5 /* man.macros */,
F96D3E7108F272A6004A47F5 /* mathfunc.n */,
F96D3E7208F272A6004A47F5 /* memory.n */,
+ F93599D40DF1F91900E04F67 /* Method.3 */,
F96D3E7308F272A6004A47F5 /* msgcat.n */,
+ F93599D50DF1F93700E04F67 /* my.n */,
F96D3E7408F272A6004A47F5 /* Namespace.3 */,
F96D3E7508F272A6004A47F5 /* namespace.n */,
+ F93599D60DF1F95000E04F67 /* next.n */,
F96D3E7608F272A6004A47F5 /* Notifier.3 */,
F96D3E7708F272A6004A47F5 /* Object.3 */,
+ F93599D70DF1F96800E04F67 /* object.n */,
F96D3E7808F272A6004A47F5 /* ObjectType.3 */,
F96D3E7908F272A6004A47F5 /* open.n */,
F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */,
@@ -3158,6 +3259,7 @@
F96D3E9408F272A6004A47F5 /* SaveResult.3 */,
F96D3E9508F272A6004A47F5 /* scan.n */,
F96D3E9608F272A6004A47F5 /* seek.n */,
+ F93599D80DF1F98300E04F67 /* self.n */,
F96D3E9708F272A6004A47F5 /* set.n */,
F96D3E9808F272A6004A47F5 /* SetChanErr.3 */,
F96D3E9908F272A6004A47F5 /* SetErrno.3 */,
@@ -3181,6 +3283,7 @@
F96D3EAB08F272A7004A47F5 /* SubstObj.3 */,
F96D3EAC08F272A7004A47F5 /* switch.n */,
F96D3EAD08F272A7004A47F5 /* Tcl.n */,
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */,
F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */,
F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */,
F96D3EB008F272A7004A47F5 /* tclsh.1 */,
@@ -3188,6 +3291,7 @@
F96D3EB208F272A7004A47F5 /* tclvars.n */,
F96D3EB308F272A7004A47F5 /* tell.n */,
F96D3EB408F272A7004A47F5 /* Thread.3 */,
+ F9183E640EFC80CD0030B814 /* throw.n */,
F96D3EB508F272A7004A47F5 /* time.n */,
F96D3EB608F272A7004A47F5 /* tm.n */,
F96D3EB708F272A7004A47F5 /* ToUpper.3 */,
@@ -3195,6 +3299,7 @@
F96D3EB908F272A7004A47F5 /* TraceCmd.3 */,
F96D3EBA08F272A7004A47F5 /* TraceVar.3 */,
F96D3EBB08F272A7004A47F5 /* Translate.3 */,
+ F9183E650EFC80D70030B814 /* try.n */,
F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */,
F96D3EBD08F272A7004A47F5 /* unknown.n */,
F96D3EBE08F272A7004A47F5 /* unload.n */,
@@ -3208,6 +3313,7 @@
F96D3EC608F272A7004A47F5 /* vwait.n */,
F96D3EC708F272A7004A47F5 /* while.n */,
F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */,
+ F915432D0EF201EE0032D1E8 /* zlib.n */,
);
path = doc;
sourceTree = "<group>";
@@ -3273,6 +3379,7 @@
F96D3F0008F272A7004A47F5 /* tclIOCmd.c */,
F96D3F0108F272A7004A47F5 /* tclIOGT.c */,
F96D3F0208F272A7004A47F5 /* tclIORChan.c */,
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */,
F96D3F0308F272A7004A47F5 /* tclIOSock.c */,
F96D3F0408F272A7004A47F5 /* tclIOUtil.c */,
F96D3F0508F272A7004A47F5 /* tclLink.c */,
@@ -3284,6 +3391,19 @@
F96D3F0B08F272A7004A47F5 /* tclNamesp.c */,
F96D3F0C08F272A7004A47F5 /* tclNotify.c */,
F96D3F0D08F272A7004A47F5 /* tclObj.c */,
+ F93599B20DF1F75400E04F67 /* tclOO.c */,
+ F93599B40DF1F75900E04F67 /* tclOO.decls */,
+ F93599B50DF1F75D00E04F67 /* tclOO.h */,
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */,
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */,
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */,
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */,
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */,
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */,
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */,
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */,
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */,
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */,
F96D3F0E08F272A7004A47F5 /* tclPanic.c */,
F96D3F0F08F272A7004A47F5 /* tclParse.c */,
F96D3F1108F272A7004A47F5 /* tclPathObj.c */,
@@ -3322,6 +3442,7 @@
F96D3F3408F272A7004A47F5 /* tclUtf.c */,
F96D3F3508F272A7004A47F5 /* tclUtil.c */,
F96D3F3608F272A7004A47F5 /* tclVar.c */,
+ F96437C90EF0D4B2003F468E /* tclZlib.c */,
F96D3F3708F272A7004A47F5 /* tommath.h */,
);
path = generic;
@@ -3622,7 +3743,6 @@
F96D437B08F272B6004A47F5 /* io.test */,
F96D437C08F272B6004A47F5 /* ioCmd.test */,
F96D437D08F272B6004A47F5 /* iogt.test */,
- F96D437E08F272B6004A47F5 /* ioUtil.test */,
F96D437F08F272B6004A47F5 /* join.test */,
F96D438008F272B6004A47F5 /* lindex.test */,
F96D438108F272B6004A47F5 /* link.test */,
@@ -3646,7 +3766,9 @@
F96D439108F272B6004A47F5 /* namespace-old.test */,
F96D439208F272B7004A47F5 /* namespace.test */,
F96D439308F272B7004A47F5 /* notify.test */,
+ F91DC23C0E44C51B002CB8D1 /* nre.test */,
F96D439408F272B7004A47F5 /* obj.test */,
+ F93599C80DF1F81900E04F67 /* oo.test */,
F96D439508F272B7004A47F5 /* opt.test */,
F96D439608F272B7004A47F5 /* package.test */,
F96D439708F272B7004A47F5 /* parse.test */,
@@ -3692,6 +3814,7 @@
F96D43BF08F272B7004A47F5 /* unixNotfy.test */,
F96D43C008F272B7004A47F5 /* unknown.test */,
F96D43C108F272B7004A47F5 /* unload.test */,
+ F91DC23D0E44C530002CB8D1 /* unsupported.test */,
F96D43C208F272B7004A47F5 /* uplevel.test */,
F96D43C308F272B7004A47F5 /* upvar.test */,
F96D43C408F272B7004A47F5 /* utf.test */,
@@ -3706,6 +3829,7 @@
F96D43CD08F272B7004A47F5 /* winNotify.test */,
F96D43CE08F272B7004A47F5 /* winPipe.test */,
F96D43CF08F272B7004A47F5 /* winTime.test */,
+ F915432A0EF201CF0032D1E8 /* zlib.test */,
);
path = tests;
sourceTree = "<group>";
@@ -3738,6 +3862,8 @@
F96D443708F272B9004A47F5 /* tclmin.wse */,
F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
+ F92D7F140DE777670033A13A /* tsdPerf.c */,
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */,
F96D443B08F272B9004A47F5 /* uniClass.tcl */,
F96D443C08F272B9004A47F5 /* uniParse.tcl */,
);
@@ -3985,7 +4111,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
+ shellScript = "gnumake -C \"${TK_SRCROOT}/carbon\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
showEnvVarsInLog = 0;
};
F9A5C5F508F651A2008AE941 /* ShellScript */ = {
@@ -4016,7 +4142,7 @@
files = (
);
inputPaths = (
- "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/carbon/configure.ac",
"$(TK_SRCROOT)/unix/configure.in",
"$(TK_SRCROOT)/unix/tcl.m4",
"$(TK_SRCROOT)/unix/aclocal.m4",
@@ -4027,7 +4153,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/carbon &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/carbon\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/carbon/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n \"${TK_SRCROOT}\"/carbon/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua=carbon --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
showEnvVarsInLog = 0;
};
F9FD30B40CC1AD070073837D /* ShellScript */ = {
@@ -4058,7 +4184,7 @@
files = (
);
inputPaths = (
- "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/carbon/configure.ac",
"$(TK_SRCROOT)/unix/configure.in",
"$(TK_SRCROOT)/unix/tcl.m4",
"$(TK_SRCROOT)/unix/aclocal.m4",
@@ -4069,7 +4195,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/carbon &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/carbon\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/carbon/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/carbon/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -4113,6 +4239,7 @@
F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */,
F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */,
F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */,
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */,
F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */,
F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */,
F96D45A408F272BC004A47F5 /* tclLink.c in Sources */,
@@ -4123,6 +4250,14 @@
F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */,
F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */,
F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */,
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */,
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */,
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */,
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */,
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */,
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */,
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */,
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */,
F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */,
F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */,
F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */,
@@ -4150,6 +4285,7 @@
F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */,
F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */,
F96D45D508F272BC004A47F5 /* tclVar.c in Sources */,
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */,
F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */,
F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */,
F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */,
@@ -4232,6 +4368,7 @@
F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */,
F966BDD308F27A3F005CB29B /* tkBind.c in Sources */,
F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */,
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */,
F966BDD508F27A3F005CB29B /* tkButton.c in Sources */,
F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */,
F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */,
@@ -4264,7 +4401,9 @@
F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */,
F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */,
F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */,
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */,
F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */,
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */,
F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */,
F966BE0808F27A3F005CB29B /* tkMacWinMenu.c in Sources */,
@@ -4415,6 +4554,7 @@
F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */,
F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */,
F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */,
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */,
F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */,
F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */,
F9FD30E00CC1AD070073837D /* tclLink.c in Sources */,
@@ -4425,6 +4565,14 @@
F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */,
F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */,
F9FD30E70CC1AD070073837D /* tclObj.c in Sources */,
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */,
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */,
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */,
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */,
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */,
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */,
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */,
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */,
F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */,
F9FD30E90CC1AD070073837D /* tclParse.c in Sources */,
F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */,
@@ -4452,6 +4600,7 @@
F9FD31000CC1AD070073837D /* tclUtf.c in Sources */,
F9FD31010CC1AD070073837D /* tclUtil.c in Sources */,
F9FD31020CC1AD070073837D /* tclVar.c in Sources */,
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */,
F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */,
F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */,
F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */,
@@ -4534,6 +4683,7 @@
F9FD31510CC1AD070073837D /* tkAtom.c in Sources */,
F9FD31520CC1AD070073837D /* tkBind.c in Sources */,
F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */,
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */,
F9FD31540CC1AD070073837D /* tkButton.c in Sources */,
F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */,
F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */,
@@ -4566,7 +4716,9 @@
F9FD31710CC1AD070073837D /* tkImage.c in Sources */,
F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */,
F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */,
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */,
F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */,
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */,
F9FD31760CC1AD070073837D /* tkListbox.c in Sources */,
F9FD31770CC1AD070073837D /* tkMacWinMenu.c in Sources */,
diff --git a/carbon/configure.ac b/carbon/configure.ac
new file mode 100644
index 0000000..229af64
--- /dev/null
+++ b/carbon/configure.ac
@@ -0,0 +1,11 @@
+#! /bin/bash -norc
+dnl This file is an input file used by the GNU "autoconf" program to
+dnl generate the file "configure", which is run during Tk installation
+dnl to configure the system for the local environment.
+
+dnl Ensure that the config (auto)headers support is used, then just
+dnl include the configure sources from ../unix:
+
+m4_include(../unix/aclocal.m4)
+m4_define(SC_USE_CONFIG_HEADERS)
+m4_include(../unix/configure.in)
diff --git a/macosx/tkAboutDlg.r b/carbon/tkAboutDlg.r
index 1492b90..1492b90 100644
--- a/macosx/tkAboutDlg.r
+++ b/carbon/tkAboutDlg.r
diff --git a/carbon/tkMacOSX.h b/carbon/tkMacOSX.h
new file mode 100644
index 0000000..a2a35a5
--- /dev/null
+++ b/carbon/tkMacOSX.h
@@ -0,0 +1,36 @@
+/*
+ * tkMacOSX.h --
+ *
+ * Declarations of Macintosh specific exported variables and procedures.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _TKMAC
+#define _TKMAC
+
+#ifndef _TK
+#include "tk.h"
+#endif
+
+#include <Carbon/Carbon.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/macosx/tkMacOSXAETE.r b/carbon/tkMacOSXAETE.r
index 54bb8cc..54bb8cc 100644
--- a/macosx/tkMacOSXAETE.r
+++ b/carbon/tkMacOSXAETE.r
diff --git a/carbon/tkMacOSXBitmap.c b/carbon/tkMacOSXBitmap.c
new file mode 100644
index 0000000..0f569f0
--- /dev/null
+++ b/carbon/tkMacOSXBitmap.c
@@ -0,0 +1,268 @@
+/*
+ * tkMacOSXBitmap.c --
+ *
+ * This file handles the implementation of native bitmaps.
+ *
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXInt.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 {
+ const 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},
+ {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(void)
+{
+ Tcl_HashTable *tablePtr = TkGetBitmapPredefTable();
+ BuiltInIcon *builtInPtr;
+
+ for (builtInPtr = builtInIcons; builtInPtr->name != NULL; builtInPtr++) {
+ Tcl_HashEntry *predefHashPtr;
+ const char * name;
+ int isNew;
+
+ name = Tk_GetUid(builtInPtr->name);
+ predefHashPtr = Tcl_CreateHashEntry(tablePtr, name, &isNew);
+ if (isNew) {
+ TkPredefBitmap *predefPtr = ckalloc(sizeof(TkPredefBitmap));
+ NativeIcon *nativeIconPtr = ckalloc(sizeof(NativeIcon));
+
+ nativeIconPtr->id = builtInPtr->id;
+ nativeIconPtr->type = builtInPtr->type;
+ predefPtr->source = 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 void *source) /* Info about the icon to build. */
+{
+ Pixmap pix;
+ Rect destRect;
+ CGrafPtr savePort;
+ Boolean portChanged;
+ const NativeIcon *nativeIconPtr;
+
+ pix = Tk_GetPixmap(display, None, 32, 32, 0);
+ portChanged = QDSwapPort(TkMacOSXGetDrawablePort(pix), &savePort);
+
+ nativeIconPtr = (const 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) {
+ Handle icon = GetIcon(nativeIconPtr->id);
+
+ if (icon != NULL) {
+ RGBColor black = {0, 0, 0};
+
+ RGBForeColor(&black);
+ PlotIcon(&destRect, icon);
+ ReleaseResource(icon);
+ }
+ }
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ 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 savePort;
+ Boolean portChanged;
+ Rect destRect;
+ Handle resource;
+ int type = -1, destWrote;
+ Str255 nativeName;
+ Tcl_Encoding encoding;
+
+ /*
+ * macRoman is the encoding that the resource fork uses.
+ */
+
+ encoding = Tcl_GetEncoding(NULL, "macRoman");
+ Tcl_UtfToExternal(NULL, encoding, name, strlen(name), 0, NULL,
+ (char *) &nativeName[1], 255, NULL, &destWrote, NULL);
+ nativeName[0] = destWrote;
+ Tcl_FreeEncoding(encoding);
+
+ resource = GetNamedResource('cicn', nativeName);
+ if (resource != NULL) {
+ type = TYPE3;
+ } else {
+ resource = GetNamedResource('ICON', nativeName);
+ if (resource != NULL) {
+ type = TYPE2;
+ }
+ }
+
+ if (resource == NULL) {
+ return (Pixmap) NULL;
+ }
+
+ pix = Tk_GetPixmap(display, None, 32, 32, 0);
+ portChanged = QDSwapPort(TkMacOSXGetDrawablePort(pix), &savePort);
+
+ 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;
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ return pix;
+}
diff --git a/carbon/tkMacOSXButton.c b/carbon/tkMacOSXButton.c
new file mode 100644
index 0000000..b39696d
--- /dev/null
+++ b/carbon/tkMacOSXButton.c
@@ -0,0 +1,1621 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkButton.h"
+#include "tkMacOSXFont.h"
+#include "tkMacOSXDebug.h"
+
+#define DEFAULT_USE_TK_TEXT 0
+
+#define CONTROL_INITIALIZED 1
+#define FIRST_DRAW 2
+#define ACTIVE 4
+
+#define MAX_VALUE 2
+
+/*
+ * Default insets for controls
+ */
+
+#define DEF_INSET_LEFT 2
+#define DEF_INSET_RIGHT 2
+#define DEF_INSET_TOP 2
+#define DEF_INSET_BOTTOM 4
+
+/*
+ * 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;
+ unsigned long 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.
+ */
+ ControlButtonContentInfo bevelButtonContent;
+ OpenCPicParams picParams;
+} MacButton;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static OSStatus SetUserPaneDrawProc(ControlRef control,
+ ControlUserPaneDrawProcPtr upp);
+static OSStatus SetUserPaneSetUpSpecialBackgroundProc(ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp);
+static void UserPaneDraw(ControlRef control, ControlPartCode cpc);
+static void UserPaneBackgroundProc(ControlHandle,
+ ControlBackgroundPtr info);
+
+static void ButtonEventProc(ClientData clientData, XEvent *eventPtr);
+static int UpdateControlColors(MacButton *mbPtr);
+static void TkMacOSXComputeControlParams(TkButton *butPtr,
+ MacControlParams *paramsPtr);
+static int TkMacOSXComputeDrawParams(TkButton *butPtr, DrawParams *dpPtr);
+static void TkMacOSXDrawControl(MacButton *butPtr, GWorldPtr destPort, GC gc,
+ Pixmap pixmap);
+static void SetupBevelButton(MacButton *butPtr, ControlRef controlHandle,
+ GWorldPtr destPort, GC gc, Pixmap pixmap);
+
+/*
+ * The class procedure table for the button widgets.
+ */
+
+const Tk_ClassProcs tkpButtonProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkButtonWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
+};
+
+static int bCount;
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 = ckalloc(sizeof(MacButton));
+
+ Tk_CreateEventHandler(tkwin, ActivateMask,
+ ButtonEventProc, (ClientData) macButtonPtr);
+ macButtonPtr->id = bCount++;
+ macButtonPtr->usingControl = 0;
+ macButtonPtr->flags = 0;
+ macButtonPtr->userPaneBackground = PIXEL_MAGIC << 24;
+ macButtonPtr->userPane = NULL;
+ macButtonPtr->control = NULL;
+ macButtonPtr->controlTitle[0] = 0;
+ macButtonPtr->controlTitle[1] = 0;
+ 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;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ Pixmap pixmap;
+ int width, height, fullWidth, fullHeight, textXOffset, textYOffset;
+ int borderWidth = 0, wasUsingControl;
+ int haveImage = 0, haveText = 0, imageWidth = 0, imageHeight = 0;
+ int imageXOffset = 0, imageYOffset = 0; /* image information that will
+ * be used to restrict disabled
+ * pixmap as well */
+ 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;
+ if (butPtr->type == TYPE_BUTTON) {
+ macButtonPtr->useTkText = 0;
+ } else {
+ macButtonPtr->useTkText = 1;
+ }
+ } else {
+ macButtonPtr->usingControl = 0;
+ macButtonPtr->useTkText = 1;
+ }
+
+ /*
+ * 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);
+ }
+ }
+
+ /*
+ * Set up clipping region. Make sure the we are using the port
+ * for this button, or we will set the wrong window's clip.
+ */
+
+ destPort = TkMacOSXGetDrawablePort(pixmap);
+ portChanged = QDSwapPort(destPort, &savePort);
+ TkMacOSXSetUpClippingRgn(pixmap);
+
+ /*
+ * 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;
+ 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) {
+ goto applyStipple;
+ }
+
+ 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;
+ }
+ imageWidth = width;
+ imageHeight = height;
+
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ int x, y;
+
+ 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;
+ }
+ imageXOffset += x;
+ imageYOffset += y;
+ if (butPtr->image != NULL) {
+ if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) &&
+ (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ }
+ } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc, imageXOffset,
+ imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
+ 0, 0, width, height, imageXOffset, 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) {
+ int x = 0, y;
+
+ 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;
+ }
+ imageXOffset += x;
+ imageYOffset += y;
+ if (butPtr->image != NULL) {
+ if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) &&
+ (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width, height,
+ pixmap, imageXOffset, imageYOffset);
+ }
+ } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc, x, y);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
+ 0, 0, width, height, x, y, 1);
+ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
+ }
+ y += height/2;
+ } else if (macButtonPtr->useTkText) {
+ int x = 0, y;
+
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + butPtr->textWidth,
+ butPtr->textHeight, &x, &y);
+ x += butPtr->indicatorSpace;
+ Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc,
+ butPtr->textLayout, x, y, 0, -1);
+ }
+
+ /*
+ * 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 so the stippling is the right color.
+ */
+
+ applyStipple:
+ 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->stippleGC,
+ Tk_3DBorderColor(butPtr->selectBorder)->pixel);
+ }
+
+ /*
+ * Stipple the whole button if no disabledFg was specified,
+ * otherwise restrict stippling only to displayed image
+ */
+
+ if (butPtr->disabledFg == NULL) {
+ XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC,
+ 0, 0, (unsigned) Tk_Width(tkwin),
+ (unsigned) Tk_Height(tkwin));
+ } else {
+ XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC,
+ imageXOffset, imageYOffset,
+ (unsigned) imageWidth, (unsigned) imageHeight);
+ }
+ if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
+ && (butPtr->selectBorder != NULL)) {
+ XSetForeground(butPtr->display, butPtr->stippleGC,
+ 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,
+ borderWidth, dpPtr->relief);
+ }
+ }
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, 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) {
+ butPtr->inset = butPtr->borderWidth;
+ } else 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;
+ }
+ }
+
+ 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
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TkMacOSXInitControl(
+ MacButton *mbPtr, /* Mac button. */
+ GWorldPtr destPort,
+ GC gc,
+ Pixmap pixmap,
+ Rect *paneRect,
+ Rect *cntrRect)
+{
+ TkButton *butPtr = (TkButton *) mbPtr;
+ ControlRef rootControl;
+ SInt16 procID, initialValue, minValue, maxValue;
+ Boolean initiallyVisible;
+ SInt32 controlReference;
+
+ rootControl = TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
+ mbPtr->windowRef = TkMacOSXDrawableWindow(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) {
+ TkMacOSXDbgMsg("Failed to create user pane control");
+ return 1;
+ }
+ if (ChkErr(EmbedControl, mbPtr->userPane,rootControl) != noErr) {
+ 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) {
+ TkMacOSXDbgMsg("Failed to create control of type %d\n", procID);
+ return 1;
+ }
+ if (ChkErr(EmbedControl, mbPtr->control,mbPtr->userPane) != noErr ) {
+ return 1;
+ }
+
+ mbPtr->flags |= (CONTROL_INITIALIZED | FIRST_DRAW);
+ if (IsWindowActive(mbPtr->windowRef)) {
+ mbPtr->flags |= ACTIVE;
+ }
+ 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;
+ TkWindow *winPtr;
+ Rect paneRect, cntrRect;
+ int active, enabled;
+ int rebuild;
+
+ 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
+ */
+#ifdef TK_REBUILD_TOPLEVEL
+ rebuild = (winPtr->flags & TK_REBUILD_TOPLEVEL);
+ winPtr->flags &= ~TK_REBUILD_TOPLEVEL;
+#else
+ rebuild = 0;
+#endif
+ if (mbPtr->flags) {
+ MacControlParams params;
+
+ TkMacOSXComputeControlParams(butPtr, &params);
+ if (rebuild || 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 & CONTROL_INITIALIZED)) {
+ 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;
+
+ if (((mbPtr->info.image == NULL) && (mbPtr->info.bitmap == None))
+ || (mbPtr->info.compound != COMPOUND_NONE)) {
+ len = TkFontGetFirstTextLayout(butPtr->textLayout,
+ &font, (char*) controlTitle);
+ controlTitle[len] = 0;
+ } else {
+ len = 0;
+ controlTitle[0] = 0;
+ }
+ if (rebuild || bcmp(mbPtr->controlTitle, controlTitle, len+1)) {
+ CFStringRef cf = CFStringCreateWithCString(NULL,
+ (char*) 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)) ) {
+ ChkErr(SetControlFontStyle, mbPtr->control, &fontStyle);
+ 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 if (butPtr->flags & TRISTATED) {
+ SetControlValue(mbPtr->control, 2);
+ } else {
+ SetControlValue(mbPtr->control, 0);
+ }
+
+ active = ((mbPtr->flags & ACTIVE) != 0);
+ if (active != IsControlActive(mbPtr->control)) {
+ if (active) {
+ ChkErr(ActivateControl, mbPtr->control);
+ } else {
+ ChkErr(DeactivateControl, mbPtr->control);
+ }
+ }
+ enabled = !(butPtr->state == STATE_DISABLED);
+ if (enabled != IsControlEnabled(mbPtr->control)) {
+ if (enabled) {
+ ChkErr(EnableControl, mbPtr->control);
+ } else {
+ ChkErr(DisableControl, mbPtr->control);
+ }
+ }
+ if (active && enabled) {
+ 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 && !mbPtr->params.isBevel) {
+ Boolean isDefault;
+
+ if (butPtr->defaultState == STATE_ACTIVE) {
+ isDefault = true;
+ } else {
+ isDefault = false;
+ }
+ ChkErr(SetControlData, mbPtr->control, kControlNoPart,
+ kControlPushButtonDefaultTag, sizeof(isDefault), &isDefault);
+ }
+
+ if (mbPtr->flags & FIRST_DRAW) {
+ ShowControl(mbPtr->userPane);
+ ShowControl(mbPtr->control);
+ mbPtr->flags ^= FIRST_DRAW;
+ } else {
+ SetControlVisibility(mbPtr->control, true, true);
+ Draw1Control(mbPtr->userPane);
+ }
+
+ if (mbPtr->params.isBevel) {
+ if (mbPtr->bevelButtonContent.contentType ==
+ kControlContentPictHandle) {
+ 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. */
+{
+ TkButton *butPtr = (TkButton *) mbPtr;
+ int height, width;
+ ControlButtonGraphicAlignment theAlignment;
+ CGrafPtr savePort;
+ Boolean portChanged = false;
+
+ 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;
+ }
+
+ {
+ portChanged = QDSwapPort(destPort, &savePort);
+ mbPtr->picParams.version = -2;
+ mbPtr->picParams.hRes = 0x00480000;
+ mbPtr->picParams.vRes = 0x00480000;
+ mbPtr->picParams.srcRect.top = 0;
+ mbPtr->picParams.srcRect.left = 0;
+ mbPtr->picParams.srcRect.bottom = height;
+ mbPtr->picParams.srcRect.right = width;
+ mbPtr->picParams.reserved1 = 0;
+ mbPtr->picParams.reserved2 = 0;
+ mbPtr->bevelButtonContent.contentType = kControlContentPictHandle;
+ mbPtr->bevelButtonContent.u.picture = OpenCPicture(&mbPtr->picParams);
+ if (!mbPtr->bevelButtonContent.u.picture) {
+ TkMacOSXDbgMsg("OpenCPicture failed");
+ }
+ 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->tristateImage != NULL && (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 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, width,
+ height, 0, 0, 1);
+ }
+
+ {
+ ClosePicture();
+ tkPictureIsOpen = 0;
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ }
+ ChkErr(SetControlData, controlHandle, kControlButtonPart,
+ kControlBevelButtonContentTag,
+ sizeof(ControlButtonContentInfo),
+ (char *) &mbPtr->bevelButtonContent);
+
+ 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;
+ }
+ ChkErr(SetControlData, controlHandle, kControlButtonPart,
+ kControlBevelButtonGraphicAlignTag,
+ sizeof(ControlButtonGraphicAlignment), (char *) &theAlignment);
+
+ if (butPtr->compound != COMPOUND_NONE) {
+ ControlButtonTextPlacement thePlacement =
+ kControlBevelButtonPlaceNormally;
+
+ if (butPtr->compound == COMPOUND_TOP) {
+ thePlacement = kControlBevelButtonPlaceBelowGraphic;
+ } else if (butPtr->compound == COMPOUND_BOTTOM) {
+ thePlacement = kControlBevelButtonPlaceAboveGraphic;
+ } else if (butPtr->compound == COMPOUND_LEFT) {
+ thePlacement = kControlBevelButtonPlaceToRightOfGraphic;
+ } else if (butPtr->compound == COMPOUND_RIGHT) {
+ thePlacement = kControlBevelButtonPlaceToLeftOfGraphic;
+ }
+ ChkErr(SetControlData, controlHandle, kControlButtonPart,
+ kControlBevelButtonTextPlaceTag,
+ sizeof(ControlButtonTextPlacement), (char *) &thePlacement);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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.
+ *
+ *--------------------------------------------------------------
+ */
+
+OSStatus
+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.
+ *
+ *--------------------------------------------------------------
+ */
+
+OSStatus
+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)
+{
+ MacButton *mbPtr = (MacButton *)(intptr_t)GetControlReference(control);
+ Rect contrlRect;
+ CGrafPtr port;
+
+ GetPort(&port);
+ GetControlBounds(control,&contrlRect);
+ TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
+ 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 = (MacButton *)(intptr_t)GetControlReference(control);
+
+ if (info->colorDevice) {
+ CGrafPtr port;
+
+ GetPort(&port);
+ TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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);
+ }
+ mbPtr->userPaneBackground = xcolor->pixel;
+
+ 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;
+ MacButton *mbPtr = (MacButton *) clientData;
+
+ if (eventPtr->type == ActivateNotify
+ || eventPtr->type == DeactivateNotify) {
+ if ((buttonPtr->tkwin == NULL) || (!Tk_IsMapped(buttonPtr->tkwin))) {
+ return;
+ }
+ if (eventPtr->type == ActivateNotify) {
+ mbPtr->flags |= ACTIVE;
+ } else {
+ mbPtr->flags &= ~ACTIVE;
+ }
+ 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 = MAX_VALUE;
+ paramsPtr->procID = kControlRadioButtonProc;
+ } else {
+ paramsPtr->initialValue = 0;
+ paramsPtr->minValue = kControlBehaviorOffsetContents |
+ kControlBehaviorSticky | kControlContentPictHandle;
+ paramsPtr->maxValue = MAX_VALUE;
+ 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 = MAX_VALUE;
+ paramsPtr->procID = kControlCheckBoxProc;
+ } else {
+ paramsPtr->initialValue = 0;
+ paramsPtr->minValue = kControlBehaviorOffsetContents |
+ kControlBehaviorSticky | kControlContentPictHandle;
+ paramsPtr->maxValue = MAX_VALUE;
+ 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/macosx/tkMacOSXCarbonEvents.c b/carbon/tkMacOSXCarbonEvents.c
index 1a71cbb..1f60eaf 100644
--- a/macosx/tkMacOSXCarbonEvents.c
+++ b/carbon/tkMacOSXCarbonEvents.c
@@ -209,6 +209,8 @@ TkMacOSXInitCarbonEvents(
{kEventClassApplication, kEventAppShown},
{kEventClassApplication, kEventAppAvailableWindowBoundsChanged},
{kEventClassAppearance, kEventAppearanceScrollBarVariantChanged},
+ {kEventClassFont, kEventFontPanelClosed},
+ {kEventClassFont, kEventFontSelection},
};
carbonEventHandlerUPP = NewEventHandlerUPP(CarbonEventHandlerProc);
@@ -586,7 +588,8 @@ TkMacOSXStopTclEventLoopCarbonTimer(void)
*/
MODULE_SCOPE void
-TkMacOSXTrackingLoop(int tracking)
+TkMacOSXTrackingLoop(
+ int tracking)
{
static int previousServiceMode = TCL_SERVICE_NONE;
diff --git a/carbon/tkMacOSXClipboard.c b/carbon/tkMacOSXClipboard.c
new file mode 100644
index 0000000..07fc925
--- /dev/null
+++ b/carbon/tkMacOSXClipboard.c
@@ -0,0 +1,371 @@
+/*
+ * tkMacOSXClipboard.c --
+ *
+ * This file manages the clipboard for the Tk toolkit.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkSelect.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;
+ OSStatus 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 = ChkErr(GetCurrentScrap, &scrapRef);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetCurrentScrap failed.", NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Try UNICODE first
+ */
+
+ err = ChkErr(GetScrapFlavorSize, scrapRef, kScrapFlavorTypeUnicode,
+ &length);
+ if (err == noErr && length > 0) {
+ Tcl_DString ds;
+ char *data;
+
+ buf = ckalloc(length + 2);
+ buf[length] = 0;
+ buf[length+1] = 0; /* 2-byte unicode null */
+ err = ChkErr(GetScrapFlavorData, scrapRef, kScrapFlavorTypeUnicode,
+ &length, buf);
+ if (err == noErr) {
+ Tcl_DStringInit(&ds);
+ Tcl_UniCharToUtfDString((Tcl_UniChar *) buf,
+ Tcl_UniCharLen((Tcl_UniChar *) buf), &ds);
+ for (data = Tcl_DStringValue(&ds); *data != '\0'; data++) {
+ if (*data == '\r') {
+ *data = '\n';
+ }
+ }
+ result = proc(clientData, interp, Tcl_DStringValue(&ds));
+ Tcl_DStringFree(&ds);
+ ckfree(buf);
+ return result;
+ }
+ }
+
+ err = ChkErr(GetScrapFlavorSize, scrapRef, 'TEXT', &length);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetScrapFlavorSize failed.", NULL);
+ return TCL_ERROR;
+ }
+ if (length > 0) {
+ Tcl_DString encodedText;
+ char *data;
+
+ buf = ckalloc(length + 1);
+ buf[length] = 0;
+ err = ChkErr(GetScrapFlavorData, scrapRef, 'TEXT', &length, buf);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetScrapFlavorData failed.", NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Tcl expects '\n' not '\r' as the line break character.
+ */
+
+ for (data = buf; *data != '\0'; data++) {
+ if (*data == '\r') {
+ *data = '\n';
+ }
+ }
+
+ 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", 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(void)
+{
+ 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, unicodedText;
+
+ 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);
+
+ /*
+ * Also put unicode data on scrap.
+ */
+
+ Tcl_DStringInit(&unicodedText);
+ Tcl_UtfToUniCharDString(buffer, length, &unicodedText);
+ PutScrapFlavor(scrapRef, kScrapFlavorTypeUnicode, 0,
+ Tcl_DStringLength(&unicodedText),
+ Tcl_DStringValue(&unicodedText));
+ Tcl_DStringFree(&unicodedText);
+
+ 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;
+}
+
+/*
+ * Local Variables:
+ * fill-column: 78
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/carbon/tkMacOSXColor.c b/carbon/tkMacOSXColor.c
new file mode 100644
index 0000000..3217c69
--- /dev/null
+++ b/carbon/tkMacOSXColor.c
@@ -0,0 +1,736 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkColor.h"
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+/* Undocumented CG API for creating CGPattern from CGImage */
+extern CGPatternRef CGPatternCreateWithImage(CGImageRef img, int i) WEAK_IMPORT_ATTRIBUTE;
+#endif
+
+struct SystemColorMapEntry {
+ const char *name;
+ ThemeBrush brush;
+ ThemeTextColor textColor;
+ ThemeBackgroundKind background;
+}; /* unsigned char pixelCode; */
+
+/*
+ * Array of system color definitions: the array index is required to equal the
+ * color's (pixelCode - MIN_PIXELCODE), i.e. the array order needs to be kept
+ * in sync with the public pixel code values in tkMacOSXPort.h !
+ */
+
+#define MIN_PIXELCODE 30
+static const struct SystemColorMapEntry systemColorMap[] = {
+ { "Transparent", 0, 0, 0 }, /* 30: TRANSPARENT_PIXEL */
+ { "Highlight", kThemeBrushPrimaryHighlightColor, 0, 0 }, /* 31: HIGHLIGHT_PIXEL */
+ { "HighlightSecondary", kThemeBrushSecondaryHighlightColor, 0, 0 }, /* 32: HIGHLIGHT_SECONDARY_PIXEL */
+ { "HighlightText", kThemeBrushBlack, 0, 0 }, /* 33: HIGHLIGHT_TEXT_PIXEL */
+ { "HighlightAlternate", kThemeBrushAlternatePrimaryHighlightColor, 0, 0 }, /* 34: HIGHLIGHT_ALTERNATE_PIXEL */
+ { "ButtonText", 0, kThemeTextColorPushButtonActive, 0 }, /* 35: CONTROL_TEXT_PIXEL */
+ { "PrimaryHighlightColor", kThemeBrushPrimaryHighlightColor, 0, 0 }, /* 36 */
+ { "ButtonFace", kThemeBrushButtonFaceActive, 0, 0 }, /* 37: CONTROL_BODY_PIXEL */
+ { "SecondaryHighlightColor", kThemeBrushSecondaryHighlightColor, 0, 0 }, /* 38 */
+ { "ButtonFrame", kThemeBrushButtonFrameActive, 0, 0 }, /* 39: CONTROL_FRAME_PIXEL */
+ { "AlternatePrimaryHighlightColor", kThemeBrushAlternatePrimaryHighlightColor, 0, 0 }, /* 40 */
+ { "WindowBody", kThemeBrushDocumentWindowBackground, 0, 0 }, /* 41: WINDOW_BODY_PIXEL */
+ { "SheetBackground", kThemeBrushSheetBackground, 0, 0 }, /* 42 */
+ { "MenuActive", kThemeBrushMenuBackgroundSelected, 0, 0 }, /* 43: MENU_ACTIVE_PIXEL */
+ { "Black", kThemeBrushBlack, 0, 0 }, /* 44 */
+ { "MenuActiveText", 0, kThemeTextColorMenuItemSelected, 0 }, /* 45: MENU_ACTIVE_TEXT_PIXEL */
+ { "White", kThemeBrushWhite, 0, 0 }, /* 46 */
+ { "Menu", kThemeBrushMenuBackground, 0, 0 }, /* 47: MENU_BACKGROUND_PIXEL */
+ { "DialogBackgroundActive", kThemeBrushDialogBackgroundActive, 0, 0 }, /* 48 */
+ { "MenuDisabled", 0, kThemeTextColorMenuItemDisabled, 0 }, /* 49: MENU_DISABLED_PIXEL */
+ { "DialogBackgroundInactive", kThemeBrushDialogBackgroundInactive, 0, 0 }, /* 50 */
+ { "MenuText", 0, kThemeTextColorMenuItemActive, 0 }, /* 51: MENU_TEXT_PIXEL */
+ { "AppearanceColor", 0, 0, 0 }, /* 52: APPEARANCE_PIXEL */
+ { "AlertBackgroundActive", kThemeBrushAlertBackgroundActive, 0, 0 }, /* 53 */
+ { "AlertBackgroundInactive", kThemeBrushAlertBackgroundInactive, 0, 0 }, /* 54 */
+ { "ModelessDialogBackgroundActive", kThemeBrushModelessDialogBackgroundActive, 0, 0 }, /* 55 */
+ { "ModelessDialogBackgroundInactive", kThemeBrushModelessDialogBackgroundInactive, 0, 0 }, /* 56 */
+ { "UtilityWindowBackgroundActive", kThemeBrushUtilityWindowBackgroundActive, 0, 0 }, /* 57 */
+ { "UtilityWindowBackgroundInactive", kThemeBrushUtilityWindowBackgroundInactive, 0, 0 }, /* 58 */
+ { "ListViewSortColumnBackground", kThemeBrushListViewSortColumnBackground, 0, 0 }, /* 59 */
+ { "ListViewBackground", kThemeBrushListViewBackground, 0, 0 }, /* 60 */
+ { "IconLabelBackground", kThemeBrushIconLabelBackground, 0, 0 }, /* 61 */
+ { "ListViewSeparator", kThemeBrushListViewSeparator, 0, 0 }, /* 62 */
+ { "ChasingArrows", kThemeBrushChasingArrows, 0, 0 }, /* 63 */
+ { "DragHilite", kThemeBrushDragHilite, 0, 0 }, /* 64 */
+ { "DocumentWindowBackground", kThemeBrushDocumentWindowBackground, 0, 0 }, /* 65 */
+ { "FinderWindowBackground", kThemeBrushFinderWindowBackground, 0, 0 }, /* 66 */
+ { "ScrollBarDelimiterActive", kThemeBrushScrollBarDelimiterActive, 0, 0 }, /* 67 */
+ { "ScrollBarDelimiterInactive", kThemeBrushScrollBarDelimiterInactive, 0, 0 }, /* 68 */
+ { "FocusHighlight", kThemeBrushFocusHighlight, 0, 0 }, /* 69 */
+ { "PopupArrowActive", kThemeBrushPopupArrowActive, 0, 0 }, /* 70 */
+ { "PopupArrowPressed", kThemeBrushPopupArrowPressed, 0, 0 }, /* 71 */
+ { "PopupArrowInactive", kThemeBrushPopupArrowInactive, 0, 0 }, /* 72 */
+ { "AppleGuideCoachmark", kThemeBrushAppleGuideCoachmark, 0, 0 }, /* 73 */
+ { "IconLabelBackgroundSelected", kThemeBrushIconLabelBackgroundSelected, 0, 0 }, /* 74 */
+ { "StaticAreaFill", kThemeBrushStaticAreaFill, 0, 0 }, /* 75 */
+ { "ActiveAreaFill", kThemeBrushActiveAreaFill, 0, 0 }, /* 76 */
+ { "ButtonFrameActive", kThemeBrushButtonFrameActive, 0, 0 }, /* 77 */
+ { "ButtonFrameInactive", kThemeBrushButtonFrameInactive, 0, 0 }, /* 78 */
+ { "ButtonFaceActive", kThemeBrushButtonFaceActive, 0, 0 }, /* 79 */
+ { "ButtonFaceInactive", kThemeBrushButtonFaceInactive, 0, 0 }, /* 80 */
+ { "ButtonFacePressed", kThemeBrushButtonFacePressed, 0, 0 }, /* 81 */
+ { "ButtonActiveDarkShadow", kThemeBrushButtonActiveDarkShadow, 0, 0 }, /* 82 */
+ { "ButtonActiveDarkHighlight", kThemeBrushButtonActiveDarkHighlight, 0, 0 }, /* 83 */
+ { "ButtonActiveLightShadow", kThemeBrushButtonActiveLightShadow, 0, 0 }, /* 84 */
+ { "ButtonActiveLightHighlight", kThemeBrushButtonActiveLightHighlight, 0, 0 }, /* 85 */
+ { "ButtonInactiveDarkShadow", kThemeBrushButtonInactiveDarkShadow, 0, 0 }, /* 86 */
+ { "ButtonInactiveDarkHighlight", kThemeBrushButtonInactiveDarkHighlight, 0, 0 }, /* 87 */
+ { "ButtonInactiveLightShadow", kThemeBrushButtonInactiveLightShadow, 0, 0 }, /* 88 */
+ { "ButtonInactiveLightHighlight", kThemeBrushButtonInactiveLightHighlight, 0, 0 }, /* 89 */
+ { "ButtonPressedDarkShadow", kThemeBrushButtonPressedDarkShadow, 0, 0 }, /* 90 */
+ { "ButtonPressedDarkHighlight", kThemeBrushButtonPressedDarkHighlight, 0, 0 }, /* 91 */
+ { "ButtonPressedLightShadow", kThemeBrushButtonPressedLightShadow, 0, 0 }, /* 92 */
+ { "ButtonPressedLightHighlight", kThemeBrushButtonPressedLightHighlight, 0, 0 }, /* 93 */
+ { "BevelActiveLight", kThemeBrushBevelActiveLight, 0, 0 }, /* 94 */
+ { "BevelActiveDark", kThemeBrushBevelActiveDark, 0, 0 }, /* 95 */
+ { "BevelInactiveLight", kThemeBrushBevelInactiveLight, 0, 0 }, /* 96 */
+ { "BevelInactiveDark", kThemeBrushBevelInactiveDark, 0, 0 }, /* 97 */
+ { "NotificationWindowBackground", kThemeBrushNotificationWindowBackground, 0, 0 }, /* 98 */
+ { "MovableModalBackground", kThemeBrushMovableModalBackground, 0, 0 }, /* 99 */
+ { "SheetBackgroundOpaque", kThemeBrushSheetBackgroundOpaque, 0, 0 }, /* 100 */
+ { "DrawerBackground", kThemeBrushDrawerBackground, 0, 0 }, /* 101 */
+ { "ToolbarBackground", kThemeBrushToolbarBackground, 0, 0 }, /* 102 */
+ { "SheetBackgroundTransparent", kThemeBrushSheetBackgroundTransparent, 0, 0 }, /* 103 */
+ { "MenuBackground", kThemeBrushMenuBackground, 0, 0 }, /* 104 */
+ { "Pixel", 0, 0, 0 }, /* 105: PIXEL_MAGIC */
+ { "MenuBackgroundSelected", kThemeBrushMenuBackgroundSelected, 0, 0 }, /* 106 */
+ { "ListViewOddRowBackground", kThemeBrushListViewOddRowBackground, 0, 0 }, /* 107 */
+ { "ListViewEvenRowBackground", kThemeBrushListViewEvenRowBackground, 0, 0 }, /* 108 */
+ { "ListViewColumnDivider", kThemeBrushListViewColumnDivider, 0, 0 }, /* 109 */
+ { "BlackText", 0, kThemeTextColorBlack, 0 }, /* 110 */
+ { "DialogActiveText", 0, kThemeTextColorDialogActive, 0 }, /* 111 */
+ { "DialogInactiveText", 0, kThemeTextColorDialogInactive, 0 }, /* 112 */
+ { "AlertActiveText", 0, kThemeTextColorAlertActive, 0 }, /* 113 */
+ { "AlertInactiveText", 0, kThemeTextColorAlertInactive, 0 }, /* 114 */
+ { "ModelessDialogActiveText", 0, kThemeTextColorModelessDialogActive, 0 }, /* 115 */
+ { "ModelessDialogInactiveText", 0, kThemeTextColorModelessDialogInactive, 0 }, /* 116 */
+ { "WindowHeaderActiveText", 0, kThemeTextColorWindowHeaderActive, 0 }, /* 117 */
+ { "WindowHeaderInactiveText", 0, kThemeTextColorWindowHeaderInactive, 0 }, /* 118 */
+ { "PlacardActiveText", 0, kThemeTextColorPlacardActive, 0 }, /* 119 */
+ { "PlacardInactiveText", 0, kThemeTextColorPlacardInactive, 0 }, /* 120 */
+ { "PlacardPressedText", 0, kThemeTextColorPlacardPressed, 0 }, /* 121 */
+ { "PushButtonActiveText", 0, kThemeTextColorPushButtonActive, 0 }, /* 122 */
+ { "PushButtonInactiveText", 0, kThemeTextColorPushButtonInactive, 0 }, /* 123 */
+ { "PushButtonPressedText", 0, kThemeTextColorPushButtonPressed, 0 }, /* 124 */
+ { "BevelButtonActiveText", 0, kThemeTextColorBevelButtonActive, 0 }, /* 125 */
+ { "BevelButtonInactiveText", 0, kThemeTextColorBevelButtonInactive, 0 }, /* 126 */
+ { "BevelButtonPressedText", 0, kThemeTextColorBevelButtonPressed, 0 }, /* 127 */
+ { "PopupButtonActiveText", 0, kThemeTextColorPopupButtonActive, 0 }, /* 128 */
+ { "PopupButtonInactiveText", 0, kThemeTextColorPopupButtonInactive, 0 }, /* 129 */
+ { "PopupButtonPressedText", 0, kThemeTextColorPopupButtonPressed, 0 }, /* 130 */
+ { "IconLabelText", 0, kThemeTextColorIconLabel, 0 }, /* 131 */
+ { "ListViewText", 0, kThemeTextColorListView, 0 }, /* 132 */
+ { "DocumentWindowTitleActiveText", 0, kThemeTextColorDocumentWindowTitleActive, 0 }, /* 133 */
+ { "DocumentWindowTitleInactiveText", 0, kThemeTextColorDocumentWindowTitleInactive, 0 }, /* 134 */
+ { "MovableModalWindowTitleActiveText", 0, kThemeTextColorMovableModalWindowTitleActive, 0 }, /* 135 */
+ { "MovableModalWindowTitleInactiveText",0, kThemeTextColorMovableModalWindowTitleInactive, 0 }, /* 136 */
+ { "UtilityWindowTitleActiveText", 0, kThemeTextColorUtilityWindowTitleActive, 0 }, /* 137 */
+ { "UtilityWindowTitleInactiveText", 0, kThemeTextColorUtilityWindowTitleInactive, 0 }, /* 138 */
+ { "PopupWindowTitleActiveText", 0, kThemeTextColorPopupWindowTitleActive, 0 }, /* 139 */
+ { "PopupWindowTitleInactiveText", 0, kThemeTextColorPopupWindowTitleInactive, 0 }, /* 140 */
+ { "RootMenuActiveText", 0, kThemeTextColorRootMenuActive, 0 }, /* 141 */
+ { "RootMenuSelectedText", 0, kThemeTextColorRootMenuSelected, 0 }, /* 142 */
+ { "RootMenuDisabledText", 0, kThemeTextColorRootMenuDisabled, 0 }, /* 143 */
+ { "MenuItemActiveText", 0, kThemeTextColorMenuItemActive, 0 }, /* 144 */
+ { "MenuItemSelectedText", 0, kThemeTextColorMenuItemSelected, 0 }, /* 145 */
+ { "MenuItemDisabledText", 0, kThemeTextColorMenuItemDisabled, 0 }, /* 146 */
+ { "PopupLabelActiveText", 0, kThemeTextColorPopupLabelActive, 0 }, /* 147 */
+ { "PopupLabelInactiveText", 0, kThemeTextColorPopupLabelInactive, 0 }, /* 148 */
+ { "TabFrontActiveText", 0, kThemeTextColorTabFrontActive, 0 }, /* 149 */
+ { "TabNonFrontActiveText", 0, kThemeTextColorTabNonFrontActive, 0 }, /* 150 */
+ { "TabNonFrontPressedText", 0, kThemeTextColorTabNonFrontPressed, 0 }, /* 151 */
+ { "TabFrontInactiveText", 0, kThemeTextColorTabFrontInactive, 0 }, /* 152 */
+ { "TabNonFrontInactiveText", 0, kThemeTextColorTabNonFrontInactive, 0 }, /* 153 */
+ { "IconLabelSelectedText", 0, kThemeTextColorIconLabelSelected, 0 }, /* 154 */
+ { "BevelButtonStickyActiveText", 0, kThemeTextColorBevelButtonStickyActive, 0 }, /* 155 */
+ { "BevelButtonStickyInactiveText", 0, kThemeTextColorBevelButtonStickyInactive, 0 }, /* 156 */
+ { "NotificationText", 0, kThemeTextColorNotification, 0 }, /* 157 */
+ { "SystemDetailText", 0, kThemeTextColorSystemDetail, 0 }, /* 158 */
+ { "WhiteText", 0, kThemeTextColorWhite, 0 }, /* 159 */
+ { "TabPaneBackground", 0, 0, kThemeBackgroundTabPane }, /* 160 */
+ { "PlacardBackground", 0, 0, kThemeBackgroundPlacard }, /* 161 */
+ { "WindowHeaderBackground", 0, 0, kThemeBackgroundWindowHeader }, /* 162 */
+ { "ListViewWindowHeaderBackground", 0, 0, kThemeBackgroundListViewWindowHeader }, /* 163 */
+ { "SecondaryGroupBoxBackground", 0, 0, kThemeBackgroundSecondaryGroupBox }, /* 164 */
+ { "MetalBackground", 0, 0, kThemeBackgroundMetal }, /* 165 */
+ { NULL, 0, 0, 0 }
+};
+#define MAX_PIXELCODE 165
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetThemeFromPixelCode --
+ *
+ * When given a pixel code corresponding to a theme system color,
+ * set one of brush, textColor or background to the corresponding
+ * Appearance Mgr theme constant.
+ *
+ * Results:
+ * Returns false if not a real pixel, true otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetThemeFromPixelCode(
+ unsigned char code,
+ ThemeBrush *brush,
+ ThemeTextColor *textColor,
+ ThemeBackgroundKind *background)
+{
+ if (code >= MIN_PIXELCODE && code <= MAX_PIXELCODE && code != PIXEL_MAGIC) {
+ *brush = systemColorMap[code - MIN_PIXELCODE].brush;
+ *textColor = systemColorMap[code - MIN_PIXELCODE].textColor;
+ *background = systemColorMap[code - MIN_PIXELCODE].background;
+ } else {
+ *brush = 0;
+ *textColor = 0;
+ *background = 0;
+ }
+ if (!*brush && !*textColor && !*background && code != PIXEL_MAGIC) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetThemeColor --
+ *
+ * Get RGB color for a given system color or pixel value.
+ *
+ * Results:
+ * OSStatus
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSStatus
+GetThemeColor(
+ unsigned long pixel,
+ ThemeBrush brush,
+ ThemeTextColor textColor,
+ ThemeBackgroundKind background,
+ RGBColor *c)
+{
+ OSStatus err = noErr;
+
+ if (brush) {
+ err = ChkErr(GetThemeBrushAsColor,
+ brush == kThemeBrushMenuBackgroundSelected ?
+ kThemeBrushFocusHighlight : brush, 32, true, c);
+ } else if (textColor) {
+ err = ChkErr(GetThemeTextColor, textColor, 32, true, c);
+ } else {
+ c->red = (pixel >> 16) & 0xff;
+ c->green = (pixel >> 8) & 0xff;
+ c->blue = (pixel ) & 0xff;
+ c->red |= c->red << 8;
+ c->green |= c->green << 8;
+ c->blue |= c->blue << 8;
+ }
+ return err;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+ void *macColor) /* Mac color struct to modify. */
+{
+ OSStatus err = -1;
+ ThemeBrush brush;
+ ThemeTextColor textColor;
+ ThemeBackgroundKind background;
+
+ if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
+ &background)) {
+ err = ChkErr(GetThemeColor, pixel, brush, textColor, background,
+ macColor);
+ }
+ return (err == noErr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetColorInPort --
+ *
+ * Sets fore or back color in the given QD port from an X pixel
+ * value, and if the pixel code indicates a system color, sets
+ * the corresponding brush, textColor or background via
+ * Appearance mgr APIs.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If penPat is non-NULL it is set to the forground color/pattern.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetColorInPort(
+ unsigned long pixel,
+ int fg,
+ PixPatHandle penPat,
+ CGrafPtr port)
+{
+ OSStatus err;
+ RGBColor c;
+ ThemeBrush brush;
+ ThemeTextColor textColor;
+ ThemeBackgroundKind background;
+ int setPenPat = 0;
+
+ if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
+ &background)) {
+ CGrafPtr savePort;
+ Boolean portChanged;
+
+ portChanged = QDSwapPort(port, &savePort);
+ err = ChkErr(GetThemeColor, pixel, brush, textColor, background, &c);
+ if (err == noErr) {
+ if (fg) {
+ RGBForeColor(&c);
+ if (penPat) {
+ MakeRGBPat(penPat, &c);
+ setPenPat = 1;
+ }
+ } else {
+ RGBBackColor(&c);
+ }
+ }
+ err = -1;
+ if (brush) {
+ err = ChkErr(SetThemeBackground,
+ brush == kThemeBrushMenuBackgroundSelected ?
+ kThemeBrushFocusHighlight : brush, 32, true);
+ } else if (textColor && fg) {
+ err = ChkErr(SetThemeTextColor, textColor, 32, true);
+ } else if (background) {
+ Rect bounds;
+
+ GetPortBounds(port, &bounds);
+ err = ChkErr(ApplyThemeBackground, background, &bounds,
+ kThemeStateActive, 32, true);
+ }
+ if (penPat && err == noErr && (brush || background)) {
+ GetPortBackPixPat(port, penPat);
+ setPenPat = 1;
+ }
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ } else {
+ TkMacOSXDbgMsg("Ignored unknown pixel value 0x%lx", pixel);
+ }
+ if (penPat && !setPenPat) {
+ GetPortBackPixPat(port, penPat);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetColorInContext --
+ *
+ * Sets fill and stroke color in the given CG context from an X
+ * pixel value, or if the pixel code indicates a system color,
+ * sets the corresponding brush, textColor or background via
+ * HITheme APIs if available or Appearance mgr APIs.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetColorInContext(
+ unsigned long pixel,
+ CGContextRef context)
+{
+ OSStatus err = -1;
+ RGBColor c;
+ ThemeBrush brush;
+ ThemeTextColor textColor;
+ ThemeBackgroundKind background;
+
+ if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
+ &background)) {
+ if (brush) {
+ TK_IF_MAC_OS_X_API (4, HIThemeSetFill,
+ err = ChkErr(HIThemeSetFill, brush, NULL, context,
+ kHIThemeOrientationNormal);
+ TK_IF_MAC_OS_X_API_COND (4, HIThemeSetFill, err == noErr,
+ err = ChkErr(HIThemeSetStroke, brush, NULL, context,
+ kHIThemeOrientationNormal);
+ ) TK_ENDIF
+ ) TK_ENDIF
+ } else if (textColor) {
+ TK_IF_MAC_OS_X_API (4, HIThemeSetTextFill,
+ err = ChkErr(HIThemeSetTextFill, textColor, NULL, context,
+ kHIThemeOrientationNormal);
+ ) TK_ENDIF
+ } else if (background) {
+ TK_IF_MAC_OS_X_API (3, CGContextGetClipBoundingBox,
+ CGRect rect = CGContextGetClipBoundingBox(context);
+ HIThemeBackgroundDrawInfo info = { 0, kThemeStateActive,
+ background };
+
+ TK_IF_MAC_OS_X_API (3, HIThemeApplyBackground,
+ TK_IF_HI_TOOLBOX (3, /* c.f. QA1377 */
+ err = ChkErr(HIThemeApplyBackground, &rect, &info,
+ context, kHIThemeOrientationNormal);
+ ) TK_ENDIF
+ ) TK_ENDIF
+ ) TK_ENDIF
+ }
+ if (err == noErr) {
+ return;
+ }
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+ /*
+ * Convert Appearance theme pattern to CGPattern:
+ */
+ if ((brush || background) && CGPatternCreateWithImage != NULL) {
+ static PixPatHandle pixpat = NULL;
+ static GWorldPtr patGWorld = NULL;
+ static uint32_t bitmapInfo = 0;
+ const short patDim = 16;
+ const Rect bounds = {0, 0, patDim, patDim};
+ CGrafPtr savePort;
+ Boolean portChanged;
+ PixMapHandle pixmap;
+ long rowbytes;
+ CGImageRef img;
+ CGColorSpaceRef rgbCspace;
+ CGDataProviderRef provider;
+
+ if (!pixpat) {
+ pixpat = NewPixPat();
+ err = ChkErr(NewGWorld, &patGWorld, 32, &bounds, NULL, NULL, 0
+#ifdef __LITTLE_ENDIAN__
+ | kNativeEndianPixMap
+#endif
+ );
+ if (!pixpat || err != noErr || !patGWorld) {
+ Tcl_Panic("TkMacOSXSetColorInContext(): "
+ "pattern initialization failed !");
+ }
+ TK_IF_HI_TOOLBOX (4,
+ bitmapInfo = kCGBitmapByteOrder32Host;
+ ) TK_ENDIF
+ }
+ portChanged = QDSwapPort(patGWorld, &savePort);
+ TkMacOSXSetColorInPort(pixel, 1, pixpat, patGWorld);
+#ifdef TK_MAC_DEBUG
+ Rect patBounds;
+ GetPixBounds((**pixpat).patMap, &patBounds);
+ if (patBounds.right > patDim || patBounds.bottom > patDim) {
+ Tcl_Panic("TkMacOSXSetColorInContext(): "
+ "pattern larger than expected !");
+ }
+#endif /* TK_MAC_DEBUG */
+ FillCRect(&bounds, pixpat);
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ pixmap = GetPortPixMap(patGWorld);
+ rowbytes = GetPixRowBytes(pixmap);
+ provider = CGDataProviderCreateWithData(&patGWorld,
+ GetPixBaseAddr(pixmap), rowbytes * patDim, NULL);
+ rgbCspace = CGColorSpaceCreateDeviceRGB();
+ img = CGImageCreate(patDim, patDim, 8, 32,
+ rowbytes, rgbCspace, kCGImageAlphaFirst | bitmapInfo,
+ provider, NULL, 0, kCGRenderingIntentDefault);
+ CGColorSpaceRelease(rgbCspace);
+ CGDataProviderRelease(provider);
+ if (img) {
+ CGPatternRef pat = CGPatternCreateWithImage(img, 2);
+ CGColorSpaceRef patCSpace = CGColorSpaceCreatePattern(NULL);
+ const float alpha = 1;
+
+ CGContextSetFillColorSpace(context, patCSpace);
+ CGContextSetFillPattern(context, pat, &alpha);
+ CGContextSetStrokeColorSpace(context, patCSpace);
+ CGContextSetStrokePattern(context, pat, &alpha);
+ CGColorSpaceRelease(patCSpace);
+ CGPatternRelease(pat);
+ CGImageRelease(img);
+ return;
+ }
+ }
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1040 */
+ err = ChkErr(GetThemeColor, pixel, brush, textColor, background, &c);
+ if (err == noErr) {
+ double r = c.red / 65535.0;
+ double g = c.green / 65535.0;
+ double b = c.blue / 65535.0;
+
+ CGContextSetRGBFillColor(context, r, g, b, 1.0);
+ CGContextSetRGBStrokeColor(context, r, g, b, 1.0);
+ }
+ } else if (((pixel >> 24) & 0xff) == TRANSPARENT_PIXEL) {
+ CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 0.0);
+ CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 0.0);
+ } else {
+ TkMacOSXDbgMsg("Ignored unknown pixel value 0x%lx", pixel);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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) {
+ Tcl_Obj *strPtr = Tcl_NewStringObj(name+6, -1);
+ int idx, result;
+
+ result = Tcl_GetIndexFromObjStruct(NULL, strPtr, systemColorMap,
+ sizeof(struct SystemColorMapEntry), NULL, TCL_EXACT, &idx);
+ Tcl_DecrRefCount(strPtr);
+ if (result == TCL_OK) {
+ OSStatus err;
+ RGBColor c;
+ unsigned char pixelCode = idx + MIN_PIXELCODE;
+ ThemeBrush brush = systemColorMap[idx].brush;
+ ThemeTextColor textColor = systemColorMap[idx].textColor;
+ ThemeBackgroundKind background = systemColorMap[idx].background;
+
+ err = ChkErr(GetThemeColor, 0, brush, textColor, background, &c);
+ if (err == noErr) {
+ color.red = c.red;
+ color.green = c.green;
+ color.blue = c.blue;
+ color.pixel = ((((((pixelCode << 8)
+ | ((color.red >> 8) & 0xff)) << 8)
+ | ((color.green >> 8) & 0xff)) << 8)
+ | ((color.blue >> 8) & 0xff));
+ goto validXColor;
+ }
+ }
+ }
+
+ if (XParseColor(display, colormap, name, &color) == 0) {
+ return NULL;
+ }
+
+ validXColor:
+ tkColPtr = 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 = 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;
+}
+
+#if !TK_DRAW_IN_CONTEXT
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXCompareColors --
+ *
+ * On Mac, color codes may specify symbolic values like "highlight
+ * foreground", but we really need the actual values to compare.
+ * Maybe see also: "TIP #154: Add Named Colors to Tk".
+ *
+ * Results:
+ * Returns true if both colors are the same, false otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXCompareColors(
+ unsigned long c1,
+ unsigned long c2)
+{
+ RGBColor col1, col2;
+ return TkSetMacColor(c1,&col1) &&
+ TkSetMacColor(c1,&col2) &&
+ !memcmp(&col1,&col2,sizeof(col1));
+}
+#endif /* !TK_DRAW_IN_CONTEXT */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ */
+}
diff --git a/carbon/tkMacOSXConfig.c b/carbon/tkMacOSXConfig.c
new file mode 100644
index 0000000..82d3104
--- /dev/null
+++ b/carbon/tkMacOSXConfig.c
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+#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/carbon/tkMacOSXCursor.c b/carbon/tkMacOSXCursor.c
new file mode 100644
index 0000000..c465764
--- /dev/null
+++ b/carbon/tkMacOSXCursor.c
@@ -0,0 +1,487 @@
+/*
+ * tkMacOSXCursor.c --
+ *
+ * This file contains Macintosh specific cursor related routines.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+
+/*
+ * There are three different ways to set the cursor on the Mac. The default
+ * theme cursors (listed in cursorNames below), color resource cursors, &
+ * normal cursors.
+ */
+
+#define NONE -1 /* Hidden cursor */
+#define THEME 0 /* Theme cursors */
+#define ANIMATED 1 /* Animated theme cursors */
+#define COLOR 2 /* Cursors of type crsr. */
+#define NORMAL 3 /* 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. For
+ * theme cursors, this is -1. */
+ int type; /* Type of Mac cursor: for theme cursors this
+ * is the theme cursor constant, otherwise one
+ * of crsr or CURS. */
+ int count; /* For animating cursors, the count for the
+ * cursor. */
+} TkMacOSXCursor;
+
+/*
+ * The table below is used to map from the name of a predefined cursor
+ * to its resource identifier.
+ */
+
+struct CursorName {
+ const char *name;
+ int id;
+};
+
+static struct CursorName noneCursorName = {"none", 0};
+
+static struct CursorName themeCursorNames[] = {
+ {"arrow", kThemeArrowCursor},
+ {"copyarrow", kThemeCopyArrowCursor},
+ {"aliasarrow", kThemeAliasArrowCursor},
+ {"contextualmenuarrow", kThemeContextualMenuArrowCursor},
+ {"ibeam", kThemeIBeamCursor},
+ {"text", kThemeIBeamCursor},
+ {"xterm", kThemeIBeamCursor},
+ {"cross", kThemeCrossCursor},
+ {"crosshair", kThemeCrossCursor},
+ {"cross-hair", kThemeCrossCursor},
+ {"plus", kThemePlusCursor},
+ {"closedhand", kThemeClosedHandCursor},
+ {"openhand", kThemeOpenHandCursor},
+ {"pointinghand", kThemePointingHandCursor},
+ {"resizeleft", kThemeResizeLeftCursor},
+ {"resizeright", kThemeResizeRightCursor},
+ {"resizeleftright", kThemeResizeLeftRightCursor},
+ {"resizeup", kThemeResizeUpCursor},
+ {"resizedown", kThemeResizeDownCursor},
+ {"resizeupdown", kThemeResizeUpDownCursor},
+ {"notallowed", kThemeNotAllowedCursor},
+ {"poof", kThemePoofCursor},
+ {NULL, 0}
+};
+
+static struct CursorName animatedThemeCursorNames[] = {
+ {"watch", kThemeWatchCursor},
+ {"countinguphand", kThemeCountingUpHandCursor},
+ {"countingdownhand", kThemeCountingDownHandCursor},
+ {"countingupanddownhand", kThemeCountingUpAndDownHandCursor},
+ {"spinning", kThemeSpinningCursor},
+ {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(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;
+ Tcl_Encoding encoding;
+
+ inCurLen = strlen(string);
+ if (inCurLen > 255) {
+ return;
+ }
+
+ /*
+ * macRoman is the encoding that the resource fork uses.
+ */
+
+ encoding = Tcl_GetEncoding(NULL, "macRoman");
+ Tcl_UtfToExternal(NULL, encoding, string, inCurLen, 0, NULL,
+ (char *) &curName[1], 255, NULL, &destWrote, NULL);
+ curName[0] = destWrote;
+ Tcl_FreeEncoding(encoding);
+
+ resource = GetNamedResource('crsr', curName);
+ if (resource) {
+ short id;
+ Str255 theName;
+ ResType theType;
+
+ GetResInfo(resource, &id, &theType, theName);
+ macCursorPtr->macCursor = (Handle) GetCCursor(id);
+ macCursorPtr->type = COLOR;
+ } else {
+ 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;
+ int count = -1;
+
+ macCursorPtr = 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.
+ */
+
+ if (strcmp(noneCursorName.name, string) == 0) {
+ namePtr = &noneCursorName;
+ macCursorPtr->type = NONE;
+ } else {
+ for (namePtr = themeCursorNames; namePtr->name != NULL; namePtr++) {
+ if (strcmp(namePtr->name, string) == 0) {
+ macCursorPtr->type = THEME;
+ break;
+ }
+ }
+ }
+
+ if (namePtr->name == NULL) {
+ for (namePtr = animatedThemeCursorNames;
+ namePtr->name != NULL; namePtr++) {
+ int namelen = strlen(namePtr->name);
+
+ if (strncmp(namePtr->name, string, namelen) == 0) {
+ const char *numPtr = string + namelen;
+
+ if (*numPtr) {
+ int result = Tcl_GetInt(NULL, numPtr, &count);
+
+ if (result != TCL_OK) {
+ continue;
+ }
+ }
+ macCursorPtr->type = ANIMATED;
+ break;
+ }
+ }
+ }
+
+ if (namePtr->name != NULL) {
+ macCursorPtr->macCursor = (Handle) namePtr;
+ macCursorPtr->count = count;
+ } else {
+ FindCursorByName(macCursorPtr, string);
+
+ if (macCursorPtr->macCursor == NULL) {
+ const char **argv;
+ int argc;
+
+ /*
+ * 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.
+ */
+
+ if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK ) {
+ if (argc > 1) {
+ FindCursorByName(macCursorPtr, argv[0]);
+ }
+ ckfree(argv);
+ }
+ }
+ }
+
+ if (macCursorPtr->macCursor == NULL) {
+ ckfree(macCursorPtr);
+ Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
+ return NULL;
+ }
+ 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;
+ static unsigned int cursorStep = 0;
+ static int cursorHidden = 0;
+ int cursorNone = 0;
+
+ gResizeOverride = resizeOverride;
+
+ if (resizeOverride) {
+ cursor = (CursHandle) GetNamedResource('CURS', "\presize");
+ if (cursor) {
+ SetCursor(*cursor);
+ } else {
+ TkMacOSXDbgMsg("Resize cursor failed: %d", ResError());
+ }
+ } else if (macCursorPtr == NULL) {
+ SetThemeCursor(kThemeArrowCursor);
+ } else {
+ struct CursorName *namePtr;
+
+ switch (macCursorPtr->type) {
+ case NONE:
+ if (!cursorHidden) {
+ cursorHidden = 1;
+ HideCursor();
+ }
+ cursorNone = 1;
+ break;
+ case THEME:
+ namePtr = (struct CursorName *) macCursorPtr->macCursor;
+ SetThemeCursor(namePtr->id);
+ break;
+ case ANIMATED:
+ namePtr = (struct CursorName *) macCursorPtr->macCursor;
+ if (macCursorPtr->count == -1) {
+ SetAnimatedThemeCursor(namePtr->id, cursorStep++);
+ } else {
+ SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count);
+ }
+ break;
+ case COLOR:
+ ccursor = (CCrsrHandle) macCursorPtr->macCursor;
+ SetCCursor(ccursor);
+ break;
+ case NORMAL:
+ cursor = (CursHandle) macCursorPtr->macCursor;
+ SetCursor(*cursor);
+ break;
+ }
+ }
+ if (cursorHidden && !cursorNone) {
+ cursorHidden = 0;
+ ShowCursor();
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetCursor --
+ *
+ * Set the current cursor and install it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the current cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetCursor(
+ TkpCursor cursor)
+{
+ int cursorChanged = 1;
+
+ if (!gTkOwnsCursor) {
+ return;
+ }
+
+ if (cursor == None) {
+ /*
+ * This is a little tricky. We can't really tell whether
+ * gCurrentCursor is NULL because it was NULL last time around or
+ * because we just freed the current cursor. So if the input cursor is
+ * NULL, we always need to reset it, we can't trust the cursorChanged
+ * logic.
+ */
+
+ gCurrentCursor = NULL;
+ } else {
+ if (gCurrentCursor == (TkMacOSXCursor *) cursor) {
+ cursorChanged = 0;
+ }
+ gCurrentCursor = (TkMacOSXCursor *) cursor;
+ }
+
+ if (Tk_MacOSXIsAppInFront() && cursorChanged) {
+ 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/macosx/tkMacOSXCursors.r b/carbon/tkMacOSXCursors.r
index f947ddf..f947ddf 100644
--- a/macosx/tkMacOSXCursors.r
+++ b/carbon/tkMacOSXCursors.r
diff --git a/carbon/tkMacOSXDebug.c b/carbon/tkMacOSXDebug.c
new file mode 100644
index 0000000..e007a01
--- /dev/null
+++ b/carbon/tkMacOSXDebug.c
@@ -0,0 +1,643 @@
+/*
+ * tkMacOSXDebug.c --
+ *
+ * Implementation of Macintosh specific functions for debugging MacOS
+ * events, regions, etc...
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXPrivate.h"
+#include "tkMacOSXDebug.h"
+
+#ifdef TK_MAC_DEBUG
+
+typedef struct {
+ EventKind kind;
+ const 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}
+};
+
+#ifdef TK_MACOSXDEBUG_UNUSED
+static 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 }
+};
+#endif /* TK_MACOSXDEBUG_UNUSED */
+
+MODULE_SCOPE char *
+TkMacOSXCarbonEventToAscii(
+ EventRef eventRef)
+{
+ EventClass eventClass;
+ EventKind eventKind;
+ MyEventNameList * list = eventNameList;
+ MyEventName * names = NULL;
+ static char str[256];
+ char *buf = str;
+ int *iPtr = (int*)str;
+ 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++;
+ }
+ }
+ while (names && names->name) {
+ if (eventKind == names->kind) {
+ snprintf(buf, 250, "%-20s", names->name);
+ break;
+ } else {
+ names++;
+ }
+ }
+ if (!found) {
+ snprintf(buf, 250, "%-20d", eventKind);
+ }
+ return str;
+}
+
+#ifdef TK_MACOSXDEBUG_UNUSED
+MODULE_SCOPE char *
+TkMacOSXCarbonEventKindToAscii(
+ 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;
+}
+
+MODULE_SCOPE char *
+TkMacOSXClassicEventToAscii(
+ 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;
+}
+
+MODULE_SCOPE void
+TkMacOSXPrintPoint(
+ char *tag,
+ Point *p)
+{
+ TkMacOSXDbgMsg("%s %4d %4d", tag,p->h,p->v );
+}
+
+MODULE_SCOPE void
+TkMacOSXPrintRect(
+ char *tag,
+ Rect *r)
+{
+ TkMacOSXDbgMsg("%s %4d %4d %4d %4d (%dx%d)",
+ tag, r->left, r->top, r->right, r->bottom,
+ r->right - r->left + 1, r->bottom - r->top + 1);
+}
+
+MODULE_SCOPE void
+TkMacOSXPrintRegion(
+ char *tag,
+ RgnHandle rgn)
+{
+ Rect r;
+
+ GetRegionBounds(rgn,&r);
+ TkMacOSXPrintRect(tag,&r);
+}
+
+MODULE_SCOPE void
+TkMacOSXPrintWindowTitle(
+ char *tag,
+ WindowRef window)
+{
+ Str255 title;
+
+ GetWTitle(window, title);
+ title[title[0] + 1] = 0;
+ TkMacOSXDbgMsg("%s %s", tag, title+1);
+}
+
+typedef struct {
+ int msg;
+ char *name;
+} MsgName;
+
+static MsgName msgNames [] = {
+ { kMenuDrawMsg, "Draw"},
+ { kMenuSizeMsg, "Size"},
+ { kMenuPopUpMsg, "PopUp"},
+ { kMenuCalcItemMsg, "CalcItem" },
+ { kMenuThemeSavvyMsg, "ThemeSavvy"},
+ { kMenuInitMsg, "Init" },
+ { kMenuDisposeMsg, "Dispose" },
+ { kMenuFindItemMsg, "FindItem" },
+ { kMenuHiliteItemMsg, "HiliteItem" },
+ { kMenuDrawItemsMsg, "DrawItems" },
+ { -1, NULL }
+};
+
+MODULE_SCOPE char *
+TkMacOSXMenuMessageToAscii(
+ int msg,
+ char *s)
+{
+ MsgName *msgNamePtr;
+
+ for (msgNamePtr=msgNames ; msgNamePtr->name ; msgNamePtr++) {
+ if (msgNamePtr->msg == msg) {
+ strcpy(s,msgNamePtr->name);
+ return s;
+ }
+ }
+ sprintf(s, "unknown : %d", msg);
+ return s;
+}
+
+static MsgName trackingNames [] = {
+ { kMouseTrackingMousePressed , "MousePressed " },
+ { kMouseTrackingMouseReleased , "MouseReleased " },
+ { kMouseTrackingMouseExited , "MouseExited " },
+ { kMouseTrackingMouseEntered , "MouseEntered " },
+ { kMouseTrackingMouseMoved , "MouseMoved " },
+ { kMouseTrackingKeyModifiersChanged, "KeyModifiersChanged" },
+ { kMouseTrackingUserCancelled , "UserCancelled " },
+ { kMouseTrackingTimedOut , "TimedOut " },
+ { -1, NULL }
+};
+
+MODULE_SCOPE char *
+TkMacOSXMouseTrackingResultToAscii(
+ MouseTrackingResult r,
+ char *buf)
+{
+ 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;
+}
+#endif /* TK_MACOSXDEBUG_UNUSED */
+
+MODULE_SCOPE void
+TkMacOSXDebugFlashRegion(
+ Drawable d,
+ HIShapeRef rgn)
+{
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, int, QDDebugFlashRegion,
+ CGrafPtr port, RgnHandle region);
+ CFShow(rgn);
+ if (d && rgn && QDDebugFlashRegion && !HIShapeIsEmpty(rgn)) {
+ CGrafPtr port = TkMacOSXGetDrawablePort(d);
+
+ if (port) {
+ static RgnHandle qdRgn = NULL;
+
+ if (!qdRgn) {
+ qdRgn = NewRgn();
+ }
+ ChkErr(HIShapeGetAsQDRgn, rgn, qdRgn);
+
+ /*
+ * Carbon-internal region flashing SPI (c.f. Technote 2124)
+ */
+
+ QDDebugFlashRegion(port, qdRgn);
+ SetEmptyRgn(qdRgn);
+ }
+ }
+}
+
+#include <mach-o/dyld.h>
+#include <mach-o/nlist.h>
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNamedDebugSymbol --
+ *
+ * Dynamically acquire address of a named symbol from a loaded dynamic
+ * library, so that we can use API that may not be available on all OS
+ * versions. For debugging purposes, if we cannot find the symbol with
+ * the usual dynamic library APIs, we manually walk the symbol table of
+ * the loaded library. This allows access to unexported symbols such as
+ * private_extern internal debugging functions. If module is NULL or the
+ * empty string, search all loaded libraries (could be very expensive and
+ * should be avoided).
+ *
+ * THIS FUCTION IS ONLY TO BE USED FOR DEBUGGING PURPOSES, IT MAY BREAK
+ * UNEXPECTEDLY IN THE FUTURE!
+ *
+ * Results:
+ * Address of given symbol or NULL if unavailable.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void *
+TkMacOSXGetNamedDebugSymbol(
+ const char *module,
+ const char *symbol)
+{
+ void *addr = TkMacOSXGetNamedSymbol(module, symbol);
+
+#ifndef __LP64__
+ if (!addr) {
+ const struct mach_header *mh = NULL;
+ uint32_t i, n = _dyld_image_count();
+ size_t module_len = 0;
+
+ if (module && *module) {
+ module_len = strlen(module);
+ }
+ for (i = 0; i < n; i++) {
+ if (module && *module) {
+ /* Find image with given module name */
+ char *name;
+ const char *path = _dyld_get_image_name(i);
+
+ if (!path) {
+ continue;
+ }
+ name = strrchr(path, '/') + 1;
+ if (strncmp(name, module, module_len) != 0) {
+ continue;
+ }
+ }
+ mh = _dyld_get_image_header(i);
+ if (mh) {
+ struct load_command *lc;
+ struct symtab_command *st = NULL;
+ struct segment_command *sg = NULL;
+ uint32_t j, m, nsect = 0, txtsectx = 0;
+
+ lc = (struct load_command*)((const char*) mh +
+ sizeof(struct mach_header));
+ m = mh->ncmds;
+ for (j = 0; j < m; j++) {
+ /* Find symbol table and index of __text section */
+ if (lc->cmd == LC_SEGMENT) {
+ /* Find last segment before symbol table */
+ sg = (struct segment_command*) lc;
+ if (!txtsectx) {
+ /* Count total sections until (__TEXT, __text) */
+ uint32_t k, ns = sg->nsects;
+
+ if (strcmp(sg->segname, SEG_TEXT) == 0) {
+ struct section *s = (struct section *)(
+ (char *)sg +
+ sizeof(struct segment_command));
+
+ for(k = 0; k < ns; k++) {
+ if (strcmp(s->sectname, SECT_TEXT) == 0) {
+ txtsectx = nsect+k+1;
+ break;
+ }
+ s++;
+ }
+ }
+ nsect += ns;
+ }
+ } else if (!st && lc->cmd == LC_SYMTAB) {
+ st = (struct symtab_command *) lc;
+ break;
+ }
+ lc = (struct load_command *)((char *) lc + lc->cmdsize);
+ }
+ if (st && sg && txtsectx) {
+ intptr_t base, slide = _dyld_get_image_vmaddr_slide(i);
+ char *strings;
+ struct nlist *sym;
+ uint32_t strsize = st->strsize;
+ int32_t strx;
+
+ /*
+ * Offset file positions by difference to actual position
+ * in memory of last segment before symbol table:
+ */
+
+ base = (intptr_t) sg->vmaddr + slide - sg->fileoff;
+ strings = (char *) (base + st->stroff);
+ sym = (struct nlist *) (base + st->symoff);
+ m = st->nsyms;
+ for (j = 0; j < m; j++) {
+ /* Find symbol with given name in __text section */
+ strx = sym->n_un.n_strx;
+ if ((sym->n_type & N_TYPE) == N_SECT &&
+ sym->n_sect == txtsectx &&
+ strx > 0 && (uint32_t) strx < strsize &&
+ strcmp(strings + strx, symbol) == 0) {
+ addr = (char*) sym->n_value + slide;
+ break;
+ }
+ sym++;
+ }
+ }
+ }
+ if (module && *module) {
+ /* If given a module name, only search corresponding image */
+ break;
+ }
+ }
+ }
+#endif /* __LP64__ */
+ return addr;
+}
+#endif /* TK_MAC_DEBUG */
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/carbon/tkMacOSXDebug.h b/carbon/tkMacOSXDebug.h
new file mode 100644
index 0000000..8dc8109
--- /dev/null
+++ b/carbon/tkMacOSXDebug.h
@@ -0,0 +1,96 @@
+/*
+ * tkMacOSXDebug.h --
+ *
+ * Declarations of Macintosh specific functions for debugging MacOS events,
+ * regions, etc...
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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
+
+#ifndef _TKMACINT
+#include "tkMacOSXInt.h"
+#endif
+
+#ifdef TK_MAC_DEBUG
+
+MODULE_SCOPE char* TkMacOSXCarbonEventToAscii(EventRef eventRef);
+
+#ifdef TK_MACOSXDEBUG_UNUSED
+MODULE_SCOPE char* TkMacOSXCarbonEventKindToAscii(EventRef eventRef, char * buf );
+MODULE_SCOPE char* TkMacOSXClassicEventToAscii(EventRecord * eventPtr, char * buf );
+
+MODULE_SCOPE void TkMacOSXPrintRect(char * tag, Rect * r );
+MODULE_SCOPE void TkMacOSXPrintPoint(char * tag, Point * p );
+
+MODULE_SCOPE void TkMacOSXPrintRegion(char * tag, RgnHandle rgn );
+MODULE_SCOPE void TkMacOSXPrintWindowTitle(char * tag, WindowRef window );
+MODULE_SCOPE char* TkMacOSXMenuMessageToAscii(int msg, char * s);
+
+MODULE_SCOPE char* TkMacOSXMouseTrackingResultToAscii(MouseTrackingResult r, char * buf );
+#endif
+
+MODULE_SCOPE void TkMacOSXDebugFlashRegion(Drawable d, HIShapeRef rgn);
+
+MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
+
+/* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
+#define TkMacOSXInitNamedDebugSymbol(module, ret, symbol, ...) \
+ static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
+ if (symbol == (void*)(-1L)) { \
+ symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\
+ }
+
+#endif /* TK_MAC_DEBUG */
+
+#endif
diff --git a/carbon/tkMacOSXDefault.h b/carbon/tkMacOSXDefault.h
new file mode 100644
index 0000000..0cb57da
--- /dev/null
+++ b/carbon/tkMacOSXDefault.h
@@ -0,0 +1,555 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#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 "systemButtonFacePressed"
+#define ACTIVE_FG "systemPushButtonPressedText"
+#define SELECT_BG "systemHighlight"
+#define SELECT_FG None
+#define INACTIVE_SELECT_BG "systemHighlightSecondary"
+#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 ACTIVE_BG
+#define DEF_BUTTON_ACTIVE_BG_MONO BLACK
+#define DEF_BUTTON_ACTIVE_FG_COLOR ACTIVE_FG
+#define DEF_CHKRAD_ACTIVE_FG_COLOR DEF_BUTTON_ACTIVE_FG_COLOR
+#define DEF_BUTTON_ACTIVE_FG_MONO WHITE
+/* #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 ""
+#define DEF_BUTTON_FG "systemButtonText"
+#define DEF_CHKRAD_FG DEF_BUTTON_FG
+#define DEF_BUTTON_FONT "TkDefaultFont"
+#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_TRISTATE_VALUE ""
+#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 SELECT_FG
+#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:
+ */
+
+/*
+ * I test the following two values in TkpDrawEntryBorderAndFocus
+ * to determine whether to use the native entry widget. So if
+ * you change the defaults to be different from these, then you
+ * won't get the native widget by default.
+ */
+
+#define MAC_OSX_FOCUS_WIDTH 3
+#define MAC_OSX_ENTRY_BORDER 2
+#define MAC_OSX_ENTRY_RELIEF TK_RELIEF_SUNKEN
+#define MAC_OSX_ENTRY_SELECT_RELIEF TK_RELIEF_FLAT
+
+#define DEF_ENTRY_BG_COLOR NORMAL_BG
+#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 "TkTextFont"
+#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 "3"
+#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 "TkDefaultFont"
+#define DEF_LABELFRAME_TEXT ""
+#define DEF_LABELFRAME_LABELANCHOR "nw"
+
+/*
+ * Defaults for listboxes:
+ */
+
+#define DEF_LISTBOX_ACTIVE_STYLE "dotbox"
+#define DEF_LISTBOX_BG_COLOR WHITE
+#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 "TkTextFont"
+#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 "menu" /* special: see tkMacOSXMenu.c */
+#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"
+
+/*
+ * FIXME: Turn the default back to 1 when we make tearoff menus work again.
+ */
+
+#define DEF_MENU_TEAROFF "0"
+#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 ACTIVE_FG
+#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 "TkDefaultFont"
+#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 "1"
+#define DEF_MESSAGE_CURSOR ""
+#define DEF_MESSAGE_FG BLACK
+#define DEF_MESSAGE_FONT "TkDefaultFont"
+#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 "1"
+#define DEF_PANEDWINDOW_CURSOR ""
+#define DEF_PANEDWINDOW_HANDLEPAD "8"
+#define DEF_PANEDWINDOW_HANDLESIZE "8"
+#define DEF_PANEDWINDOW_HEIGHT ""
+#define DEF_PANEDWINDOW_OPAQUERESIZE "1"
+#define DEF_PANEDWINDOW_ORIENT "horizontal"
+#define DEF_PANEDWINDOW_RELIEF "flat"
+#define DEF_PANEDWINDOW_SASHCURSOR ""
+#define DEF_PANEDWINDOW_SASHPAD "0"
+#define DEF_PANEDWINDOW_SASHRELIEF "flat"
+#define DEF_PANEDWINDOW_SASHWIDTH "3"
+#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 ""
+#define DEF_PANEDWINDOW_PANE_HIDE "0"
+#define DEF_PANEDWINDOW_PANE_STRETCH "last"
+
+/*
+ * 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 "1"
+#define DEF_SCALE_COMMAND ""
+#define DEF_SCALE_CURSOR ""
+#define DEF_SCALE_DIGITS "0"
+#define DEF_SCALE_FONT "TkDefaultFont"
+#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 "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 "0"
+#define DEF_SCROLLBAR_JUMP "0"
+#define DEF_SCROLLBAR_ORIENT "vertical"
+#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"
+
+/*
+ * 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_BLOCK_CURSOR "0"
+#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 "TkFixedFont"
+#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_UNFOCUSSED "none"
+#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_INACTIVE_SELECT_COLOR INACTIVE_SELECT_BG
+#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 "flat"
+#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_TABSTYLE "tabular"
+#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 "TkDefaultFont"
+
+/*
+ * 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 ""
+
+/*
+ * Defaults for busy windows (not really used yet):
+ */
+
+#define DEF_BUSY_CURSOR "watch"
+
+#endif /* _TKMACDEFAULT */
diff --git a/carbon/tkMacOSXDialog.c b/carbon/tkMacOSXDialog.c
new file mode 100644
index 0000000..8097f2c
--- /dev/null
+++ b/carbon/tkMacOSXDialog.c
@@ -0,0 +1,2316 @@
+/*
+ * tkMacOSXDialog.c --
+ *
+ * Contains the Mac implementation of the common dialog boxes.
+ *
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkFileFilter.h"
+
+#ifndef StrLength
+#define StrLength(s) (*((unsigned char *) (s)))
+#endif
+#ifndef StrBody
+#define StrBody(s) ((char *) (s) + 1)
+#endif
+
+#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 structures are used in the GetFileName() function. They store
+ * 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 initialType; /* Type to use initially */
+ short popupItem; /* Item number of the popup in the dialog. */
+ short usePopup; /* True if we show the popup menu (this */
+ /* is an open operation and the */
+ /* -filetypes option is set). */
+} OpenFileData;
+
+typedef struct NavHandlerUserData {
+ OpenFileData *ofdPtr;
+ NavReplyRecord reply;
+ OSStatus err;
+ CFStringRef saveNameRef;
+ int sheet;
+ WindowRef dialogWindow, origUnavailWindow;
+ WindowModality origModality;
+} NavHandlerUserData;
+
+/*
+ * The following structure is used in the tk_messageBox implementation.
+ */
+
+typedef struct {
+ int buttonIndex;
+ WindowRef dialogWindow, origUnavailWindow;
+ WindowModality origModality;
+ EventHandlerRef handlerRef;
+} AlertHandlerUserData;
+
+
+static OSStatus AlertHandler(EventHandlerCallRef callRef,
+ EventRef eventRef, void *userData);
+static Boolean MatchOneType(StringPtr fileNamePtr, OSType fileType,
+ OpenFileData *myofdPtr, FileFilter *filterPtr);
+static pascal Boolean OpenFileFilterProc(AEDesc* theItem, void* info,
+ NavCallBackUserData callBackUD,
+ NavFilterModes filterMode);
+static pascal void OpenEventProc(NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr callBackParms,
+ NavCallBackUserData callBackUD);
+static void InitFileDialogs(void);
+static int NavServicesGetFile(Tcl_Interp *interp,
+ OpenFileData *ofd, AEDesc *initialDescPtr,
+ char *initialFile, AEDescList *selectDescPtr,
+ CFStringRef title, CFStringRef message,
+ const char *initialType, int multiple,
+ int confirmOverwrite, int isOpen,
+ Tk_Window parent);
+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.
+ */
+
+static NavObjectFilterUPP openFileFilterUPP;
+static 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. */
+{
+ OSStatus err;
+ int result = TCL_ERROR;
+ Tk_Window parent, tkwin = clientData;
+ const char *title;
+ int i, srcRead, dstWrote;
+ CMProfileRef prof;
+ NColorPickerInfo cpinfo;
+ static RGBColor color = {0xffff, 0xffff, 0xffff};
+ static const char *const optionStrings[] = {
+ "-initialcolor", "-parent", "-title", NULL
+ };
+ enum options {
+ COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
+ };
+
+ title = "Choose a color:";
+ bzero(&cpinfo, sizeof(cpinfo));
+ cpinfo.theColor.color.rgb.red = color.red;
+ cpinfo.theColor.color.rgb.green = color.green;
+ cpinfo.theColor.color.rgb.blue = color.blue;
+
+ for (i = 1; i < objc; i += 2) {
+ int index;
+ const char *option, *value;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ option = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", option, "\" missing",
+ NULL);
+ goto end;
+ }
+ value = Tcl_GetString(objv[i + 1]);
+
+ switch ((enum options) index) {
+ case COLOR_INITIAL: {
+ XColor *colorPtr;
+
+ colorPtr = Tk_GetColor(interp, tkwin, value);
+ if (colorPtr == NULL) {
+ goto end;
+ }
+ cpinfo.theColor.color.rgb.red = colorPtr->red;
+ cpinfo.theColor.color.rgb.green = colorPtr->green;
+ cpinfo.theColor.color.rgb.blue = colorPtr->blue;
+ Tk_FreeColor(colorPtr);
+ break;
+ }
+ case COLOR_PARENT: {
+ parent = Tk_NameToWindow(interp, value, tkwin);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ }
+ case COLOR_TITLE: {
+ title = value;
+ break;
+ }
+ }
+ }
+
+ ChkErr(CMGetDefaultProfileBySpace, cmRGBData, &prof);
+ cpinfo.theColor.profile = prof;
+ cpinfo.dstProfile = prof;
+ cpinfo.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal;
+ cpinfo.placeWhere = kCenterOnMainScreen;
+ /* Currently, this does not actually change the colorpicker title */
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, title, -1, 0, NULL,
+ StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL);
+ StrLength(cpinfo.prompt) = (unsigned char) dstWrote;
+
+ TkMacOSXTrackingLoop(1);
+ err = ChkErr(NPickColor, &cpinfo);
+ TkMacOSXTrackingLoop(0);
+ ChkErr(CMCloseProfile, prof);
+ if ((err == noErr) && (cpinfo.newColorChosen != 0)) {
+ char colorstr[8];
+
+ color.red = cpinfo.theColor.color.rgb.red;
+ color.green = cpinfo.theColor.color.rgb.green;
+ color.blue = cpinfo.theColor.color.rgb.blue;
+ snprintf(colorstr, 8, "#%02x%02x%02x", color.red >> 8,
+ color.green >> 8, color.blue >> 8);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(colorstr, 7));
+ } else {
+ Tcl_ResetResult(interp);
+ }
+ result = TCL_OK;
+
+ end:
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 = TCL_ERROR, multiple = 0;
+ OpenFileData ofd;
+ Tk_Window parent = NULL;
+ CFStringRef message = NULL, title = NULL;
+ AEDesc initialDesc = {typeNull, NULL};
+ FSRef dirRef;
+ AEDesc *initialPtr = NULL;
+ AEDescList selectDesc = {typeNull, NULL};
+ char *initialFile = NULL, *initialDir = NULL;
+ Tcl_Obj *typeVariablePtr = NULL;
+ const char *initialtype = NULL;
+ static const char *const openOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-message", "-multiple", "-parent", "-title", "-typevariable", NULL
+ };
+ enum openOptions {
+ OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, OPEN_INITFILE,
+ OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE,
+ OPEN_TYPEVARIABLE,
+ };
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+ TkInitFileFilters(&ofd.fl);
+ ofd.curType = 0;
+ ofd.initialType = -1;
+ ofd.popupItem = OPEN_POPUP_ITEM;
+ ofd.usePopup = 1;
+
+ for (i = 1; i < objc; i += 2) {
+ char *choice;
+ int index, choiceLen;
+ char *string;
+ Tcl_Obj *types;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], openOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ NULL);
+ goto end;
+ }
+
+ switch (index) {
+ case OPEN_DEFAULT:
+ break;
+ case OPEN_FILETYPES:
+ types = objv[i + 1];
+ if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case OPEN_INITDIR:
+ initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialDir = NULL;
+ }
+ break;
+ case OPEN_INITFILE:
+ initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialFile = NULL;
+ }
+ break;
+ case OPEN_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (message) {
+ CFRelease(message);
+ }
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case OPEN_MULTIPLE:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
+ &multiple) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case OPEN_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case OPEN_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (title) {
+ CFRelease(title);
+ }
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case OPEN_TYPEVARIABLE:
+ typeVariablePtr = objv[i + 1];
+ break;
+ }
+ }
+
+ if (HandleInitialDirectory(interp, initialFile, initialDir, &dirRef,
+ &selectDesc, &initialDesc) != TCL_OK) {
+ goto end;
+ }
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ if (typeVariablePtr) {
+ initialtype = Tcl_GetVar(interp, Tcl_GetString(typeVariablePtr), 0);
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, &selectDesc,
+ title, message, initialtype, multiple, false, OPEN_FILE, parent);
+
+ if (typeVariablePtr) {
+ FileFilter *filterPtr = ofd.fl.filters;
+ int i = ofd.curType;
+
+ while (filterPtr && i-- > 0) {
+ filterPtr = filterPtr->next;
+ }
+ Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr ?
+ filterPtr->name : "", 0);
+ }
+
+ end:
+ TkFreeFileFilters(&ofd.fl);
+ if (initialDesc.dataHandle) {
+ ChkErr(AEDisposeDesc, &initialDesc);
+ }
+ if (selectDesc.dataHandle) {
+ ChkErr(AEDisposeDesc, &selectDesc);
+ }
+ if (title) {
+ CFRelease(title);
+ }
+ if (message) {
+ CFRelease(message);
+ }
+ 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 = TCL_ERROR;
+ int confirmOverwrite = 1;
+ char *initialFile = NULL;
+ Tk_Window parent = NULL;
+ AEDesc initialDesc = {typeNull, NULL};
+ AEDesc *initialPtr = NULL;
+ FSRef dirRef;
+ CFStringRef title = NULL, message = NULL;
+ OpenFileData ofd;
+ static const char *const saveOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-message", "-parent", "-title", "-typevariable",
+ "-confirmoverwrite", NULL
+ };
+ enum saveOptions {
+ SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE,
+ SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE,
+ SAVE_CONFIRMOW
+ };
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+
+ TkInitFileFilters(&ofd.fl);
+ ofd.curType = 0;
+ ofd.usePopup = 0;
+
+ for (i = 1; i < objc; i += 2) {
+ char *choice, *string;
+ int index, choiceLen;
+ Tcl_Obj *types;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], saveOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ NULL);
+ goto end;
+ }
+ switch (index) {
+ case SAVE_DEFAULT:
+ break;
+ case SAVE_FILETYPES:
+ types = objv[i + 1];
+ if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case SAVE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
+ &dirRef, NULL, &initialDesc) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case SAVE_INITFILE:
+ initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialFile = NULL;
+ }
+ break;
+ case SAVE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (message) {
+ CFRelease(message);
+ }
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case SAVE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, (Tk_Window) clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case SAVE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (title) {
+ CFRelease(title);
+ }
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case SAVE_CONFIRMOW:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &confirmOverwrite)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ }
+ }
+
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL,
+ title, message, NULL, false, confirmOverwrite, SAVE_FILE, parent);
+ TkFreeFileFilters(&ofd.fl);
+ end:
+ if (initialDesc.dataHandle) {
+ ChkErr(AEDisposeDesc, &initialDesc);
+ }
+ if (title) {
+ CFRelease(title);
+ }
+ if (message) {
+ CFRelease(message);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_ChooseDirectoryObjCmd --
+ *
+ * This procedure implements the "tk_chooseDirectory" dialog box for the
+ * MacOS X platform. See the user documentation for details on what it
+ * does.
+ *
+ * Results:
+ * See user documentation.
+ *
+ * Side effects:
+ * A modal dialog window is created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_ChooseDirectoryObjCmd(
+ 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 = TCL_ERROR;
+ Tk_Window parent = NULL;
+ AEDesc initialDesc = {typeNull, NULL}, *initialPtr = NULL;
+ FSRef dirRef;
+ CFStringRef message = NULL, title = NULL;
+ OpenFileData ofd;
+ static const char *const chooseOptionStrings[] = {
+ "-initialdir", "-message", "-mustexist", "-parent", "-title", NULL
+ };
+ enum chooseOptions {
+ CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST, CHOOSE_PARENT,
+ CHOOSE_TITLE
+ };
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+
+ for (i = 1; i < objc; i += 2) {
+ char *string, *choice;
+ int index, choiceLen;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ NULL);
+ goto end;
+ }
+ switch (index) {
+ case CHOOSE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
+ &dirRef, NULL, &initialDesc) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case CHOOSE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (message) {
+ CFRelease(message);
+ }
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case CHOOSE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case CHOOSE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (title) {
+ CFRelease(title);
+ }
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ }
+ }
+
+ TkInitFileFilters(&ofd.fl);
+ ofd.usePopup = 0;
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL, title,
+ message, NULL, false, false, CHOOSE_FOLDER, parent);
+ TkFreeFileFilters(&ofd.fl);
+ end:
+ if (initialDesc.dataHandle) {
+ ChkErr(AEDisposeDesc, &initialDesc);
+ }
+ if (title) {
+ CFRelease(title);
+ }
+ if (message) {
+ CFRelease(message);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleInitialDirectory --
+ *
+ * Helper for -initialdir setup.
+ *
+ * Results:
+ * Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+HandleInitialDirectory(
+ Tcl_Interp *interp,
+ char *initialFile,
+ char *initialDir,
+ FSRef *dirRef,
+ AEDescList *selectDescPtr,
+ AEDesc *dirDescPtr)
+{
+ Tcl_DString ds;
+ OSStatus err;
+ Boolean isDirectory;
+ char *dirName = NULL;
+ int result = TCL_ERROR;
+
+ if (initialDir) {
+ dirName = Tcl_TranslateFileName(interp, initialDir, &ds);
+ if (dirName == NULL) {
+ goto end;
+ }
+ err = ChkErr(FSPathMakeRef, (unsigned char *) dirName, dirRef,
+ &isDirectory);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"",
+ NULL);
+ goto end;
+ }
+ if (!isDirectory) {
+ Tcl_AppendResult(interp, "-intialdir \"", initialDir, "\""
+ " is a file, not a directory.", NULL);
+ goto end;
+ }
+ ChkErr(AECreateDesc, typeFSRef, dirRef, sizeof(*dirRef), dirDescPtr);
+ }
+
+ if (initialFile && selectDescPtr) {
+ FSRef fileRef;
+ AEDesc fileDesc;
+ char *namePtr;
+
+ if (initialDir) {
+ Tcl_DStringAppend(&ds, "/", 1);
+ Tcl_DStringAppend(&ds, initialFile, -1);
+ namePtr = Tcl_DStringValue(&ds);
+ } else {
+ namePtr = initialFile;
+ }
+
+ ChkErr(AECreateList, NULL, 0, false, selectDescPtr);
+
+ err = ChkErr(FSPathMakeRef, (unsigned char *) namePtr, &fileRef,
+ &isDirectory);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, "bad initialfile \"", initialFile,
+ "\" file does not exist.", NULL);
+ goto end;
+ }
+ ChkErr(AECreateDesc, typeFSRef, &fileRef, sizeof(fileRef), &fileDesc);
+ ChkErr(AEPutDesc, selectDescPtr, 1, &fileDesc);
+ ChkErr(AEDisposeDesc, &fileDesc);
+ }
+ result = TCL_OK;
+ end:
+ if (dirName) {
+ Tcl_DStringFree(&ds);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitFileDialogs --
+ *
+ * Initialize file dialog subsystem.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+InitFileDialogs(void)
+{
+ fileDlgInited = 1;
+ openFileFilterUPP = NewNavObjectFilterUPP(OpenFileFilterProc);
+ openFileEventUPP = NewNavEventUPP(OpenEventProc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NavServicesGetFile --
+ *
+ * Common wrapper for NavServices API.
+ *
+ * Results:
+ * Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+NavServicesGetFile(
+ Tcl_Interp *interp,
+ OpenFileData *ofdPtr,
+ AEDesc *initialDescPtr,
+ char *initialFile,
+ AEDescList *selectDescPtr,
+ CFStringRef title,
+ CFStringRef message,
+ const char *initialtype,
+ int multiple,
+ int confirmOverwrite,
+ int isOpen,
+ Tk_Window parent)
+{
+ NavHandlerUserData data;
+ NavDialogCreationOptions options;
+ NavDialogRef dialogRef = NULL;
+ CFStringRef *menuItemNames = NULL;
+ OSStatus err;
+ Tcl_Obj *theResult = NULL;
+ int result = TCL_ERROR;
+
+ bzero(&data, sizeof(data));
+ err = NavGetDefaultDialogCreationOptions(&options);
+ if (err != noErr) {
+ return result;
+ }
+ options.optionFlags = kNavDontAutoTranslate | kNavDontAddTranslateItems
+ | kNavSupportPackages | kNavAllFilesInPopup;
+ if (multiple) {
+ options.optionFlags |= kNavAllowMultipleFiles;
+ }
+ if (!confirmOverwrite) {
+ options.optionFlags |= kNavDontConfirmReplacement;
+ }
+ options.modality = kWindowModalityAppModal;
+ if (parent && ((TkWindow *) parent)->window != None &&
+ TkMacOSXHostToplevelExists(parent)) {
+ options.parentWindow = TkMacOSXDrawableWindow(Tk_WindowId(parent));
+ TK_IF_HI_TOOLBOX (5,
+ /*
+ * Impossible to modify dialog modality with the Cocoa-based
+ * NavServices implementation.
+ */
+ ) TK_ELSE_HI_TOOLBOX (5,
+ if (options.parentWindow) {
+ options.modality = kWindowModalityWindowModal;
+ data.sheet = 1;
+ }
+ ) TK_ENDIF
+ }
+
+ /*
+ * Now process the selection list. We have to use the popupExtension
+ * to fill the menu.
+ */
+
+ if (ofdPtr && ofdPtr->usePopup) {
+ FileFilter *filterPtr = ofdPtr->fl.filters;
+
+ if (filterPtr == NULL) {
+ ofdPtr->usePopup = 0;
+ }
+ }
+ if (ofdPtr && ofdPtr->usePopup) {
+ FileFilter *filterPtr;
+ int index = 0;
+ ofdPtr->curType = 0;
+
+ menuItemNames =
+ ckalloc(ofdPtr->fl.numFilters * sizeof(CFStringRef));
+
+ for (filterPtr = ofdPtr->fl.filters; filterPtr != NULL;
+ filterPtr = filterPtr->next, index++) {
+ menuItemNames[index] = CFStringCreateWithCString(NULL,
+ filterPtr->name, kCFStringEncodingUTF8);
+ if (initialtype && strcmp(filterPtr->name, initialtype) == 0) {
+ ofdPtr->initialType = index;
+ }
+ }
+ options.popupExtension = CFArrayCreate(NULL,
+ (const void **) menuItemNames, ofdPtr->fl.numFilters, NULL);
+ } else {
+ options.optionFlags |= kNavNoTypePopup;
+ options.popupExtension = NULL;
+ }
+ options.clientName = CFSTR("Wish");
+ options.message = message;
+ options.windowTitle = title;
+ if (initialFile) {
+ options.saveFileName = CFStringCreateWithCString(NULL, initialFile,
+ kCFStringEncodingUTF8);
+ } else {
+ options.saveFileName = NULL;
+ }
+ if (isOpen == OPEN_FILE) {
+ data.ofdPtr = ofdPtr;
+ err = ChkErr(NavCreateGetFileDialog, &options, NULL,
+ openFileEventUPP, NULL, openFileFilterUPP, &data, &dialogRef);
+ } else if (isOpen == SAVE_FILE) {
+ err = ChkErr(NavCreatePutFileDialog, &options, 'TEXT', 'WIsH',
+ openFileEventUPP, &data, &dialogRef);
+ } else if (isOpen == CHOOSE_FOLDER) {
+ err = ChkErr(NavCreateChooseFolderDialog, &options,
+ openFileEventUPP, openFileFilterUPP, &data, &dialogRef);
+ }
+ if (err == noErr && dialogRef) {
+ if (initialDescPtr) {
+ ChkErr(NavCustomControl, dialogRef, kNavCtlSetLocation,
+ initialDescPtr);
+ }
+ if (selectDescPtr && selectDescPtr->descriptorType != typeNull) {
+ ChkErr(NavCustomControl, dialogRef, kNavCtlSetSelection,
+ selectDescPtr);
+ }
+ TkMacOSXTrackingLoop(1);
+ err = ChkErr(NavDialogRun, dialogRef);
+ if (err == noErr) {
+ if (data.sheet) {
+ data.dialogWindow = NavDialogGetWindow(dialogRef);
+ ChkErr(GetWindowModality, data.dialogWindow,
+ &data.origModality, &data.origUnavailWindow);
+ ChkErr(SetWindowModality, data.dialogWindow,
+ kWindowModalityAppModal, NULL);
+ ChkErr(RunAppModalLoopForWindow, data.dialogWindow);
+ }
+ err = data.err;
+ }
+ TkMacOSXTrackingLoop(0);
+ }
+
+ /*
+ * 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 (err == noErr && data.reply.validRecord) {
+ AEDesc resultDesc;
+ long count, i;
+ FSRef fsRef;
+ char pathPtr[PATH_MAX + 1];
+ char saveName[PATH_MAX + 1];
+
+ err = ChkErr(AECountItems, &data.reply.selection, &count);
+ if (err != noErr) {
+ /*
+ * There was an error when counting the items? Treat as if no
+ * items were chosen.
+ */
+
+ goto installResult;
+ }
+
+ /*
+ * Process the chosen files. This will be one unless -multiple was
+ * specified.
+ */
+
+ for (i = 1; i <= count; i++) {
+ /*
+ * Get the name of the selected file.
+ */
+
+ err = ChkErr(AEGetNthDesc, &data.reply.selection, i,
+ typeFSRef, NULL, &resultDesc);
+ if (err != noErr) {
+ continue;
+ }
+ err = ChkErr(AEGetDescData, &resultDesc, &fsRef, sizeof(fsRef));
+ if (err != noErr) {
+ goto nextFilename;
+ }
+ err = ChkErr(FSRefMakePath, &fsRef, (unsigned char *) pathPtr,
+ PATH_MAX + 1);
+ if (err != noErr) {
+ goto nextFilename;
+ }
+
+ /*
+ * If we're saving the file, we're creating a new filename and
+ * must therefore check whether it is a legal filename (not
+ * exceeding path length limits, etc.)
+ */
+
+ if (isOpen == SAVE_FILE) {
+ if (!data.saveNameRef) {
+ TkMacOSXDbgMsg("NavDialogGetSaveFileName failed");
+ goto nextFilename;
+ }
+
+ if (!CFStringGetCString(data.saveNameRef, saveName,
+ PATH_MAX + 1, kCFStringEncodingUTF8)) {
+ TkMacOSXDbgMsg("CFStringGetCString failed");
+ goto nextFilename;
+ }
+
+ if (strlen(pathPtr) + strlen(saveName) >= PATH_MAX) {
+ TkMacOSXDbgMsg("Path name too long");
+ goto nextFilename;
+ }
+
+ strcat(pathPtr, "/");
+ strcat(pathPtr, saveName);
+ }
+
+ /*
+ * Got a valid file name; put it in the result object.
+ */
+
+ if (multiple) {
+ Tcl_ListObjAppendElement(interp, theResult,
+ Tcl_NewStringObj(pathPtr, -1));
+ } else {
+ Tcl_SetStringObj(theResult, pathPtr, -1);
+ }
+
+ nextFilename:
+ ChkErr(AEDisposeDesc, &resultDesc);
+ }
+
+ installResult:
+ Tcl_SetObjResult(interp, theResult);
+ result = TCL_OK;
+ } else if (err == userCanceledErr) {
+ Tcl_ResetResult(interp);
+ result = TCL_OK;
+ }
+
+ /*
+ * Clean up any allocated memory.
+ */
+
+ if (data.reply.validRecord) {
+ ChkErr(NavDisposeReply, &data.reply);
+ }
+ if (data.saveNameRef) {
+ CFRelease(data.saveNameRef);
+ }
+ if (options.saveFileName) {
+ CFRelease(options.saveFileName);
+ }
+ if (options.clientName) {
+ CFRelease(options.clientName);
+ }
+ if (menuItemNames) {
+ int i;
+
+ for (i = 0; i < ofdPtr->fl.numFilters; i++) {
+ CFRelease(menuItemNames[i]);
+ }
+ ckfree(menuItemNames);
+ }
+ if (options.popupExtension) {
+ CFRelease(options.popupExtension);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * OpenEventProc --
+ *
+ * NavServices event handling callback.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+pascal void
+OpenEventProc(
+ NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr callBackParams,
+ NavCallBackUserData callBackUD)
+{
+ NavHandlerUserData *data = (NavHandlerUserData*) callBackUD;
+ OpenFileData *ofd = data->ofdPtr;
+
+ switch (callBackSelector) {
+ case kNavCBStart:
+ if (ofd && ofd->initialType >= 0) {
+ /* Select initial filter */
+ FileFilter *filterPtr = ofd->fl.filters;
+ int i = ofd->initialType;
+
+ while (filterPtr && i-- > 0) {
+ filterPtr = filterPtr->next;
+ }
+ if (filterPtr) {
+ NavMenuItemSpec selectItem;
+
+ selectItem.version = kNavMenuItemSpecVersion;
+ selectItem.menuCreator = 0;
+ selectItem.menuType = ofd->initialType;
+ selectItem.menuItemName[0] = strlen(filterPtr->name);
+ strncpy((char *) &selectItem.menuItemName[1],
+ filterPtr->name, 255);
+ ChkErr(NavCustomControl, callBackParams->context,
+ kNavCtlSelectCustomType, &selectItem);
+ }
+ }
+ break;
+ case kNavCBPopupMenuSelect:
+ ofd->curType = ((NavMenuItemSpec *)
+ callBackParams->eventData.eventDataParms.param)->menuType;
+ break;
+ case kNavCBAccept:
+ case kNavCBCancel:
+ if (data->sheet) {
+ ChkErr(QuitAppModalLoopForWindow, data->dialogWindow);
+ ChkErr(SetWindowModality, data->dialogWindow,
+ data->origModality, data->origUnavailWindow);
+ }
+ break;
+ case kNavCBUserAction:
+ if (data->reply.validRecord) {
+ ChkErr(NavDisposeReply, &data->reply);
+ data->reply.validRecord = 0;
+ }
+ data->err = NavDialogGetReply(callBackParams->context,
+ &data->reply);
+ if (callBackParams->userAction == kNavUserActionSaveAs) {
+ data->saveNameRef = NavDialogGetSaveFileName(
+ callBackParams->context);
+ if (data->saveNameRef) {
+ CFRetain(data->saveNameRef);
+ }
+ }
+ break;
+ case kNavCBTerminate:
+ NavDialogDispose(callBackParams->context);
+ break;
+ case kNavCBEvent:
+ TkMacOSXRunTclEventLoop();
+ break;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * OpenFileFilterProc --
+ *
+ * NavServices file filter callback.
+ *
+ * Results:
+ * Whether to use the file in question.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+pascal Boolean
+OpenFileFilterProc(
+ AEDesc *theItem,
+ void *info,
+ NavCallBackUserData callBackUD,
+ NavFilterModes filterMode)
+{
+ OpenFileData *ofdPtr = ((NavHandlerUserData *) callBackUD)->ofdPtr;
+ int result = MATCHED;
+
+ if (ofdPtr && ofdPtr->usePopup && ofdPtr->fl.numFilters > 0 &&
+ ((theItem->descriptorType == typeFSS)
+ || (theItem->descriptorType == typeFSRef))) {
+ NavFileOrFolderInfo *theInfo = info;
+ char fileName[256];
+ OSType fileType;
+ StringPtr fileNamePtr = NULL;
+ Tcl_DString fileNameDString;
+ int i;
+ FileFilter *filterPtr;
+
+ if (!theInfo->isFolder) {
+ fileType = theInfo->fileAndFolder.fileInfo.finderInfo.fdType;
+ Tcl_DStringInit(&fileNameDString);
+
+ if (theItem->descriptorType == typeFSS) {
+ int len;
+
+ fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name;
+ len = fileNamePtr[0];
+ strncpy(fileName, (char *) fileNamePtr + 1, len);
+ fileName[len] = '\0';
+ fileNamePtr = (unsigned char *) fileName;
+ } else if ((theItem->descriptorType == typeFSRef)) {
+ OSStatus err;
+ FSRef *theRef = (FSRef *) *theItem->dataHandle;
+ HFSUniStr255 uniFileName;
+
+ err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone,
+ NULL, &uniFileName, NULL, NULL);
+
+ if (err == noErr) {
+ Tcl_UniCharToUtfDString((Tcl_UniChar *)uniFileName.unicode,
+ uniFileName.length, &fileNameDString);
+ fileNamePtr = (unsigned char *)
+ Tcl_DStringValue(&fileNameDString);
+ }
+ }
+ 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 = UNMATCHED;
+ }
+ } 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;
+ }
+ }
+ }
+ Tcl_DStringFree(&fileNameDString);
+ }
+ }
+ return (result == MATCHED);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+ *
+ *----------------------------------------------------------------------
+ */
+
+Boolean
+MatchOneType(
+ StringPtr fileNamePtr, /* Name of the file */
+ OSType fileType, /* Type of the file, 0 means there was no
+ * specified type. */
+ 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 *q, *ext;
+
+ if (fileNamePtr == NULL) {
+ continue;
+ }
+ ext = globPtr->pattern;
+
+ if (ext[0] == '\0') {
+ /*
+ * We don't want any extensions: OK if the filename doesn't
+ * have "." in it
+ */
+
+ for (q = (char*) fileNamePtr; *q; q++) {
+ if (*q == '.') {
+ goto glob_unmatched;
+ }
+ }
+ goto glob_matched;
+ }
+
+ if (Tcl_StringMatch((char*) fileNamePtr, ext)) {
+ goto glob_matched;
+ }
+ glob_unmatched:
+ continue;
+
+ glob_matched:
+ globMatched = 1;
+ break;
+ }
+
+ for (mfPtr = clausePtr->macTypes; mfPtr; mfPtr = mfPtr->next) {
+ if (fileType == mfPtr->type) {
+ macMatched = 1;
+ break;
+ }
+ }
+
+ /*
+ * On Mac OS X, it is not uncommon for files to have NO file type. But
+ * folks with Tcl code on Classic MacOS pretty much assume that a
+ * generic file will have type TEXT. So if we were strict about
+ * matching types when the source file had NO type set, they would
+ * have to add another rule always with no fileType. To avoid that, we
+ * pass the macMatch side of the test if no fileType is set.
+ */
+
+ if (globMatched && (macMatched || (fileType == 0))) {
+ 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(void)
+{
+ DialogPtr aboutDlog;
+ WindowRef windowRef;
+ short itemHit = -9;
+
+ aboutDlog = GetNewDialog(TK_DEFAULT_ABOUT, NULL, (void *) (-1));
+ if (!aboutDlog) {
+ return;
+ }
+ windowRef = GetDialogWindow(aboutDlog);
+ SelectWindow(windowRef);
+ TkMacOSXTrackingLoop(1);
+ while (itemHit != 1) {
+ ModalDialog(NULL, &itemHit);
+ }
+ TkMacOSXTrackingLoop(0);
+ DisposeDialog(aboutDlog);
+ SelectWindow(ActiveNonFloatingWindow());
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MessageBoxObjCmd --
+ *
+ * Implements the tk_messageBox in native Mac OS X style.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * none
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_MessageBoxObjCmd(
+ 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 = clientData;
+ AlertStdCFStringAlertParamRec paramCFStringRec;
+ AlertType alertType;
+ DialogRef dialogRef;
+ CFStringRef messageTextCF = NULL, finemessageTextCF = NULL;
+ OSStatus err;
+ SInt16 itemHit;
+ Boolean haveDefaultOption = false, haveParentOption = false;
+ char *str;
+ int index, defaultButtonIndex;
+ int defaultNativeButtonIndex; /* 1, 2, 3: right to left */
+ int typeIndex, i, indexDefaultOption = 0, result = TCL_ERROR;
+
+ static const char *const movableAlertStrings[] = {
+ "-default", "-detail", "-icon", "-message", "-parent", "-title",
+ "-type", NULL
+ };
+ static const char *const movableTypeStrings[] = {
+ "abortretryignore", "ok", "okcancel", "retrycancel", "yesno",
+ "yesnocancel", NULL
+ };
+ static const char *const movableButtonStrings[] = {
+ "abort", "retry", "ignore", "ok", "cancel", "yes", "no", NULL
+ };
+ static const char *const movableIconStrings[] = {
+ "error", "info", "question", "warning", NULL
+ };
+ enum movableAlertOptions {
+ ALERT_DEFAULT, ALERT_DETAIL, ALERT_ICON, ALERT_MESSAGE, ALERT_PARENT,
+ ALERT_TITLE, ALERT_TYPE
+ };
+ enum movableTypeOptions {
+ TYPE_ABORTRETRYIGNORE, TYPE_OK, TYPE_OKCANCEL, TYPE_RETRYCANCEL,
+ TYPE_YESNO, TYPE_YESNOCANCEL
+ };
+ enum movableButtonOptions {
+ TEXT_ABORT, TEXT_RETRY, TEXT_IGNORE, TEXT_OK, TEXT_CANCEL, TEXT_YES,
+ TEXT_NO
+ };
+ enum movableIconOptions {
+ ICON_ERROR, ICON_INFO, ICON_QUESTION, ICON_WARNING
+ };
+
+ /*
+ * Need to map from 'movableButtonStrings' and its corresponding integer,
+ * index to the native button index, which is 1, 2, 3, from right to left.
+ * This is necessary to do for each separate '-type' of button sets.
+ */
+
+ short buttonIndexAndTypeToNativeButtonIndex[][7] = {
+ /* abort retry ignore ok cancel yes no */
+ {1, 2, 3, 0, 0, 0, 0}, /* abortretryignore */
+ {0, 0, 0, 1, 0, 0, 0}, /* ok */
+ {0, 0, 0, 1, 2, 0, 0}, /* okcancel */
+ {0, 1, 0, 0, 2, 0, 0}, /* retrycancel */
+ {0, 0, 0, 0, 0, 1, 2}, /* yesno */
+ {0, 0, 0, 0, 3, 1, 2}, /* yesnocancel */
+ };
+
+ /*
+ * Need also the inverse mapping, from native button (1, 2, 3) to the
+ * descriptive button text string index.
+ */
+
+ short nativeButtonIndexAndTypeToButtonIndex[][4] = {
+ {-1, 0, 1, 2}, /* abortretryignore */
+ {-1, 3, 0, 0}, /* ok */
+ {-1, 3, 4, 0}, /* okcancel */
+ {-1, 1, 4, 0}, /* retrycancel */
+ {-1, 5, 6, 0}, /* yesno */
+ {-1, 5, 6, 4}, /* yesnocancel */
+ };
+
+ alertType = kAlertPlainAlert;
+ typeIndex = TYPE_OK;
+
+ ChkErr(GetStandardAlertDefaultParams, &paramCFStringRec,
+ kStdCFStringAlertVersionOne);
+ paramCFStringRec.movable = true;
+ paramCFStringRec.helpButton = false;
+ paramCFStringRec.defaultButton = kAlertStdAlertOKButton;
+ paramCFStringRec.cancelButton = kAlertStdAlertCancelButton;
+
+ for (i = 1; i < objc; i += 2) {
+ int iconIndex;
+ char *string;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], movableAlertStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ NULL);
+ goto end;
+ }
+
+ switch (index) {
+ case ALERT_DEFAULT:
+ /*
+ * Need to postpone processing of this option until we are sure to
+ * know the '-type' as well.
+ */
+
+ haveDefaultOption = true;
+ indexDefaultOption = i;
+ break;
+
+ case ALERT_DETAIL:
+ str = Tcl_GetString(objv[i + 1]);
+ if (finemessageTextCF) {
+ CFRelease(finemessageTextCF);
+ }
+ finemessageTextCF = CFStringCreateWithCString(NULL, str,
+ kCFStringEncodingUTF8);
+ break;
+
+ case ALERT_ICON:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableIconStrings,
+ "value", TCL_EXACT, &iconIndex) != TCL_OK) {
+ goto end;
+ }
+ switch (iconIndex) {
+ case ICON_ERROR:
+ alertType = kAlertStopAlert;
+ break;
+ case ICON_INFO:
+ alertType = kAlertNoteAlert;
+ break;
+ case ICON_QUESTION:
+ alertType = kAlertCautionAlert;
+ break;
+ case ICON_WARNING:
+ alertType = kAlertCautionAlert;
+ break;
+ }
+ break;
+
+ case ALERT_MESSAGE:
+ str = Tcl_GetString(objv[i + 1]);
+ if (messageTextCF) {
+ CFRelease(messageTextCF);
+ }
+ messageTextCF = CFStringCreateWithCString(NULL, str,
+ kCFStringEncodingUTF8);
+ break;
+
+ case ALERT_PARENT:
+ str = Tcl_GetString(objv[i + 1]);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (tkwin == NULL) {
+ goto end;
+ }
+ if (((TkWindow *) tkwin)->window != None &&
+ TkMacOSXHostToplevelExists(tkwin)) {
+ haveParentOption = true;
+ }
+ break;
+
+ case ALERT_TITLE:
+ /* TODO: message box title missing? */
+ break;
+
+ case ALERT_TYPE:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableTypeStrings,
+ "value", TCL_EXACT, &typeIndex) != TCL_OK) {
+ goto end;
+ }
+ switch (typeIndex) {
+ case TYPE_ABORTRETRYIGNORE:
+ paramCFStringRec.defaultText = CFSTR("Abort");
+ paramCFStringRec.cancelText = CFSTR("Retry");
+ paramCFStringRec.otherText = CFSTR("Ignore");
+ paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
+ break;
+ case TYPE_OK:
+ paramCFStringRec.defaultText = CFSTR("OK");
+ break;
+ case TYPE_OKCANCEL:
+ paramCFStringRec.defaultText = CFSTR("OK");
+ paramCFStringRec.cancelText = CFSTR("Cancel");
+ break;
+ case TYPE_RETRYCANCEL:
+ paramCFStringRec.defaultText = CFSTR("Retry");
+ paramCFStringRec.cancelText = CFSTR("Cancel");
+ break;
+ case TYPE_YESNO:
+ paramCFStringRec.defaultText = CFSTR("Yes");
+ paramCFStringRec.cancelText = CFSTR("No");
+ break;
+ case TYPE_YESNOCANCEL:
+ paramCFStringRec.defaultText = CFSTR("Yes");
+ paramCFStringRec.cancelText = CFSTR("No");
+ paramCFStringRec.otherText = CFSTR("Cancel");
+ paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
+ break;
+ }
+ break;
+ }
+ }
+
+ if (haveDefaultOption) {
+ /*
+ * Any '-default' option needs to know the '-type' option, which is why
+ * we do this here.
+ */
+
+ if (Tcl_GetIndexFromObj(interp, objv[indexDefaultOption + 1],
+ movableButtonStrings, "value", TCL_EXACT, &defaultButtonIndex)
+ != TCL_OK) {
+ goto end;
+ }
+
+ /*
+ * Need to map from "ok" etc. to 1, 2, 3, right to left.
+ */
+
+ defaultNativeButtonIndex =
+ buttonIndexAndTypeToNativeButtonIndex[typeIndex][defaultButtonIndex];
+ if (defaultNativeButtonIndex == 0) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("Illegal default option", -1));
+ goto end;
+ }
+ paramCFStringRec.defaultButton = defaultNativeButtonIndex;
+ if (paramCFStringRec.cancelButton == defaultNativeButtonIndex) {
+ paramCFStringRec.cancelButton = 0;
+ }
+ }
+ ChkErr(SetThemeCursor, kThemeArrowCursor);
+
+ if (haveParentOption) {
+ AlertHandlerUserData data;
+ static EventHandlerUPP handler = NULL;
+ WindowRef windowRef;
+ const EventTypeSpec kEvents[] = {
+ {kEventClassCommand, kEventProcessCommand}
+ };
+
+ bzero(&data, sizeof(data));
+ if (!handler) {
+ handler = NewEventHandlerUPP(AlertHandler);
+ }
+ windowRef = TkMacOSXDrawableWindow(Tk_WindowId(tkwin));
+ if (!windowRef) {
+ goto end;
+ }
+ err = ChkErr(CreateStandardSheet, alertType, messageTextCF,
+ finemessageTextCF, &paramCFStringRec, NULL, &dialogRef);
+ if(err != noErr) {
+ goto end;
+ }
+ data.dialogWindow = GetDialogWindow(dialogRef);
+ err = ChkErr(ShowSheetWindow, data.dialogWindow, windowRef);
+ if(err != noErr) {
+ DisposeDialog(dialogRef);
+ goto end;
+ }
+ ChkErr(GetWindowModality, data.dialogWindow, &data.origModality,
+ &data.origUnavailWindow);
+ ChkErr(SetWindowModality, data.dialogWindow, kWindowModalityAppModal,
+ NULL);
+ ChkErr(InstallEventHandler, GetWindowEventTarget(data.dialogWindow),
+ handler, GetEventTypeCount(kEvents), kEvents, &data,
+ &data.handlerRef);
+ TkMacOSXTrackingLoop(1);
+ ChkErr(RunAppModalLoopForWindow, data.dialogWindow);
+ TkMacOSXTrackingLoop(0);
+ itemHit = data.buttonIndex;
+ } else {
+ err = ChkErr(CreateStandardAlert, alertType, messageTextCF,
+ finemessageTextCF, &paramCFStringRec, &dialogRef);
+ if(err != noErr) {
+ goto end;
+ }
+ TkMacOSXTrackingLoop(1);
+ err = ChkErr(RunStandardAlert, dialogRef, NULL, &itemHit);
+ TkMacOSXTrackingLoop(0);
+ if (err != noErr) {
+ goto end;
+ }
+ }
+ if (err == noErr) {
+ /*
+ * Map 'itemHit' (1, 2, 3) to descriptive text string.
+ */
+
+ int ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit];
+
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(movableButtonStrings[ind],
+ -1));
+ result = TCL_OK;
+ }
+
+ end:
+ if (finemessageTextCF) {
+ CFRelease(finemessageTextCF);
+ }
+ if (messageTextCF) {
+ CFRelease(messageTextCF);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AlertHandler --
+ *
+ * Carbon event handler for the Standard Sheet dialog.
+ *
+ * Results:
+ * OSStatus if event handled or not.
+ *
+ * Side effects:
+ * May set userData.
+ *
+ *----------------------------------------------------------------------
+ */
+
+OSStatus
+AlertHandler(
+ EventHandlerCallRef callRef,
+ EventRef eventRef,
+ void *userData)
+{
+ AlertHandlerUserData *data = userData;
+ HICommand cmd;
+
+ ChkErr(GetEventParameter,eventRef, kEventParamDirectObject, typeHICommand,
+ NULL, sizeof(cmd), NULL, &cmd);
+ switch (cmd.commandID) {
+ case kHICommandOK:
+ data->buttonIndex = 1;
+ break;
+ case kHICommandCancel:
+ data->buttonIndex = 2;
+ break;
+ case kHICommandOther:
+ data->buttonIndex = 3;
+ break;
+ }
+ if (data->buttonIndex) {
+ ChkErr(QuitAppModalLoopForWindow, data->dialogWindow);
+ ChkErr(RemoveEventHandler, data->handlerRef);
+ ChkErr(SetWindowModality, data->dialogWindow,
+ data->origModality, data->origUnavailWindow);
+ }
+ return eventNotHandledErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ */
+#pragma mark [tk fontchooser] implementation (TIP 324)
+/*
+ *----------------------------------------------------------------------
+ */
+
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXFont.h"
+
+typedef struct FontchooserData {
+ Tcl_Obj *titleObj;
+ Tcl_Obj *cmdObj;
+ Tk_Window parent;
+} FontchooserData;
+
+static Tcl_Obj *FontchooserCget(FontchooserData *fcdPtr, int optionIndex);
+static int FontchooserConfigureCmd(ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
+static int FontchooserShowCmd(ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
+static int FontchooserHideCmd(ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
+static void FontchooserParentEventHandler(ClientData clientData,
+ XEvent *eventPtr);
+static void DeleteFontchooserData(ClientData clientData, Tcl_Interp *interp);
+
+MODULE_SCOPE const TkEnsemble tkFontchooserEnsemble[];
+const TkEnsemble tkFontchooserEnsemble[] = {
+ { "configure", FontchooserConfigureCmd, NULL },
+ { "show", FontchooserShowCmd, NULL },
+ { "hide", FontchooserHideCmd, NULL },
+ { NULL, NULL, NULL }
+};
+
+static Tcl_Interp *fontchooserInterp = NULL;
+static FMFontFamily fontPanelFontFamily = kInvalidFontFamily;
+static FMFontStyle fontPanelFontStyle = -1;
+static FMFontSize fontPanelFontSize = 0;
+static FMFont fontPanelFontID = kInvalidFont;
+
+static const char *const fontchooserOptionStrings[] = {
+ "-parent", "-title", "-font", "-command",
+ "-visible", NULL
+};
+enum FontchooserOption {
+ FontchooserParent, FontchooserTitle, FontchooserFont, FontchooserCmd,
+ FontchooserVisible
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessFontEvent --
+ *
+ * This processes events generated by user interaction with the
+ * font panel.
+ *
+ * Results:
+ * True if Tk events are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessFontEvent(
+ TkMacOSXEvent * eventPtr,
+ MacEventStatus * statusPtr)
+{
+ OSStatus err;
+ int eventGenerated = 0;
+ FontchooserData *fcdPtr;
+
+ switch (eventPtr->eKind) {
+ case kEventFontPanelClosed:
+ case kEventFontSelection:
+ break;
+ default:
+ goto done;
+ }
+ if (!fontchooserInterp) {
+ goto done;
+ }
+ fcdPtr = Tcl_GetAssocData(fontchooserInterp, "::tk::fontchooser", NULL);
+ switch (eventPtr->eKind) {
+ case kEventFontPanelClosed:
+ if (!FPIsFontPanelVisible() && fcdPtr->parent != None) {
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility");
+ fontchooserInterp = NULL;
+ eventGenerated = 1;
+ }
+ break;
+ case kEventFontSelection: {
+ Tcl_Obj *fontObj = NULL;
+
+ fontPanelFontFamily = kInvalidFontFamily;
+ fontPanelFontStyle = -1;
+ fontPanelFontSize = 0;
+ fontPanelFontID = kInvalidFont;
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamFMFontFamily, typeFMFontFamily, NULL,
+ sizeof(FMFontFamily), NULL, &fontPanelFontFamily);
+ err |= ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamFMFontStyle, typeFMFontStyle, NULL,
+ sizeof(FMFontStyle), NULL, &fontPanelFontStyle);
+ err |= ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamFMFontSize, typeFMFontSize, NULL,
+ sizeof(FMFontSize), NULL, &fontPanelFontSize);
+ if (err != noErr) {
+ /*
+ * No/incomplete QD font spec, use ATSUI font ID
+ */
+ Fixed fontFixedSize;
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamATSUFontID, typeATSUFontID, NULL,
+ sizeof(ATSUFontID), NULL, &fontPanelFontID);
+ if (err == noErr) {
+ ChkErr(FMGetFontFamilyInstanceFromFont, fontPanelFontID,
+ &fontPanelFontFamily, &fontPanelFontStyle);
+ }
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamATSUFontSize, typeATSUSize, NULL,
+ sizeof(Fixed), NULL, &fontFixedSize);
+ if (err == noErr) {
+ fontPanelFontSize = FixedToInt(fontFixedSize);
+ }
+ }
+ fontObj = TkMacOSXFontDescriptionForFMFontInfo(
+ fontPanelFontFamily, fontPanelFontStyle,
+ fontPanelFontSize, fontPanelFontID);
+ if (fontObj) {
+ if (fcdPtr->cmdObj) {
+ int objc, result;
+ Tcl_Obj **objv, **tmpv;
+
+ result = Tcl_ListObjGetElements(fontchooserInterp,
+ fcdPtr->cmdObj, &objc, &objv);
+ if (result == TCL_OK) {
+ tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
+ tmpv[objc] = fontObj;
+ result = TkBackgroundEvalObjv(fontchooserInterp,
+ objc + 1, tmpv, TCL_EVAL_GLOBAL);
+ ckfree(tmpv);
+ }
+ }
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged");
+ }
+ break;
+ }
+ }
+done:
+ return eventGenerated;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FontchooserCget --
+ *
+ * Helper for the FontchooserConfigure command to return the
+ * current value of any of the options (which may be NULL in
+ * the structure)
+ *
+ * Results:
+ * Tcl object of option value.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+FontchooserCget(
+ FontchooserData *fcdPtr,
+ int optionIndex)
+{
+ Tcl_Obj *resObj = NULL;
+
+ switch(optionIndex) {
+ case FontchooserParent: {
+ if (fcdPtr->parent != None) {
+ resObj = Tcl_NewStringObj(
+ ((TkWindow*)fcdPtr->parent)->pathName, -1);
+ } else {
+ resObj = Tcl_NewStringObj(".", 1);
+ }
+ break;
+ }
+ case FontchooserTitle: {
+ if (fcdPtr->titleObj) {
+ resObj = fcdPtr->titleObj;
+ } else {
+ resObj = Tcl_NewObj();
+ }
+ break;
+ }
+ case FontchooserFont: {
+ resObj = TkMacOSXFontDescriptionForFMFontInfo(
+ fontPanelFontFamily, fontPanelFontStyle,
+ fontPanelFontSize, fontPanelFontID);
+ if (!resObj) {
+ resObj = Tcl_NewObj();
+ }
+ break;
+ }
+ case FontchooserCmd: {
+ if (fcdPtr->cmdObj) {
+ resObj = fcdPtr->cmdObj;
+ } else {
+ resObj = Tcl_NewObj();
+ }
+ break;
+ }
+ case FontchooserVisible: {
+ resObj = Tcl_NewBooleanObj(FPIsFontPanelVisible());
+ break;
+ }
+ default: {
+ resObj = Tcl_NewObj();
+ }
+ }
+ return resObj;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserConfigureCmd --
+ *
+ * Implementation of the 'tk fontchooser configure' ensemble command.
+ * See the user documentation for what it does.
+ *
+ * Results:
+ * See the user documentation.
+ *
+ * Side effects:
+ * Per-interp data structure may be modified
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserConfigureCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tk_Window tkwin = (Tk_Window)clientData;
+ FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser",
+ NULL);
+ int i, r = TCL_OK;
+
+ /*
+ * With no arguments we return all the options in a dict
+ */
+
+ if (objc == 1) {
+ Tcl_Obj *keyObj, *valueObj;
+ Tcl_Obj *dictObj = Tcl_NewDictObj();
+ for (i = 0; r == TCL_OK && fontchooserOptionStrings[i] != NULL; ++i) {
+ keyObj = Tcl_NewStringObj(fontchooserOptionStrings[i], -1);
+ valueObj = FontchooserCget(fcdPtr, i);
+ r = Tcl_DictObjPut(interp, dictObj, keyObj, valueObj);
+ }
+ if (r == TCL_OK) {
+ Tcl_SetObjResult(interp, dictObj);
+ }
+ return r;
+ }
+
+ for (i = 1; i < objc; i += 2) {
+ int optionIndex, len;
+ if (Tcl_GetIndexFromObj(interp, objv[i], fontchooserOptionStrings,
+ "option", 0, &optionIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ /* With one option and no arg, return the current value */
+ Tcl_SetObjResult(interp, FontchooserCget(fcdPtr, optionIndex));
+ return TCL_OK;
+ }
+ if (i + 1 == objc) {
+ Tcl_AppendResult(interp, "value for \"",
+ Tcl_GetString(objv[i]), "\" missing", NULL);
+ return TCL_ERROR;
+ }
+ switch (optionIndex) {
+ case FontchooserVisible: {
+ const char *msg = "cannot change read-only option "
+ "\"-visible\": use the show or hide command";
+
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, sizeof(msg)-1));
+ return TCL_ERROR;
+ }
+ case FontchooserParent: {
+ Tk_Window parent = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[i+1]), tkwin);
+ if (parent == None) {
+ return TCL_ERROR;
+ }
+ if (fcdPtr->parent) {
+ Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ }
+ fcdPtr->parent = parent;
+ Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ break;
+ }
+ case FontchooserTitle:
+ if (fcdPtr->titleObj) {
+ Tcl_DecrRefCount(fcdPtr->titleObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ fcdPtr->titleObj = objv[i+1];
+ if (Tcl_IsShared(fcdPtr->titleObj)) {
+ fcdPtr->titleObj = Tcl_DuplicateObj(fcdPtr->titleObj);
+ }
+ Tcl_IncrRefCount(fcdPtr->titleObj);
+ } else {
+ fcdPtr->titleObj = NULL;
+ }
+ break;
+ case FontchooserFont: {
+
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ Tk_Font f = Tk_AllocFontFromObj(interp, tkwin, objv[i+1]);
+ if (f) {
+ ATSUStyle atsuStyle;
+
+ TkMacOSXFMFontInfoForFont(f, &fontPanelFontFamily,
+ &fontPanelFontStyle, &fontPanelFontSize,
+ &atsuStyle);
+ ChkErr(SetFontInfoForSelection,
+ kFontSelectionATSUIType, 1, &atsuStyle, NULL);
+ Tk_FreeFont(f);
+ } else {
+ return TCL_ERROR;
+ }
+ } else {
+ fontPanelFontFamily = kInvalidFontFamily;
+ ChkErr(SetFontInfoForSelection,
+ kFontSelectionATSUIType, 0, NULL, NULL);
+ }
+ if (FPIsFontPanelVisible()) {
+ TkSendVirtualEvent(fcdPtr->parent,
+ "TkFontchooserFontChanged");
+ }
+ break;
+ }
+ case FontchooserCmd:
+ if (fcdPtr->cmdObj) {
+ Tcl_DecrRefCount(fcdPtr->cmdObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ fcdPtr->cmdObj = objv[i+1];
+ if (Tcl_IsShared(fcdPtr->cmdObj)) {
+ fcdPtr->cmdObj = Tcl_DuplicateObj(fcdPtr->cmdObj);
+ }
+ Tcl_IncrRefCount(fcdPtr->cmdObj);
+ } else {
+ fcdPtr->cmdObj = NULL;
+ }
+ break;
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserShowCmd --
+ *
+ * Implements the 'tk fontchooser show' ensemble command. The
+ * per-interp configuration data for the dialog is held in an interp
+ * associated structure.
+ *
+ * Results:
+ * See the user documentation.
+ *
+ * Side effects:
+ * Font Panel may be shown.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserShowCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser",
+ NULL);
+
+ if (fcdPtr->parent == None) {
+ fcdPtr->parent = (Tk_Window) clientData;
+ Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ }
+ if (!FPIsFontPanelVisible()) {
+ ChkErr(FPShowHideFontPanel);
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility");
+ }
+ fontchooserInterp = interp;
+
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserHideCmd --
+ *
+ * Implementation of the 'tk fontchooser hide' ensemble. See the
+ * user documentation for details.
+ *
+ * Results:
+ * See the user documentation.
+ *
+ * Side effects:
+ * Font Panel may be hidden.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserHideCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ if (FPIsFontPanelVisible()) {
+ ChkErr(FPShowHideFontPanel);
+ }
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserParentEventHandler --
+ *
+ * Event handler for StructureNotify events on the font chooser's
+ * parent window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Font chooser parent info is cleared and font panel is hidden.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static void
+FontchooserParentEventHandler(
+ ClientData clientData,
+ XEvent *eventPtr)
+{
+ FontchooserData *fcdPtr = clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ fcdPtr->parent = None;
+ if (FPIsFontPanelVisible()) {
+ ChkErr(FPShowHideFontPanel);
+ }
+ }
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * DeleteFontchooserData --
+ *
+ * Clean up the font chooser configuration data when the interp
+ * is destroyed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * per-interp configuration data is destroyed.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static void
+DeleteFontchooserData(
+ ClientData clientData,
+ Tcl_Interp *interp)
+{
+ FontchooserData *fcdPtr = clientData;
+
+ if (fcdPtr->titleObj) {
+ Tcl_DecrRefCount(fcdPtr->titleObj);
+ }
+ if (fcdPtr->cmdObj) {
+ Tcl_DecrRefCount(fcdPtr->cmdObj);
+ }
+ ckfree(fcdPtr);
+
+ if (fontchooserInterp == interp) {
+ fontchooserInterp = NULL;
+ }
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * TkInitFontchooser --
+ *
+ * Associate the font chooser configuration data with the Tcl
+ * interpreter. There is one font chooser per interp.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * per-interp configuration data is destroyed.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkInitFontchooser(
+ Tcl_Interp *interp,
+ ClientData clientData)
+{
+ FontchooserData *fcdPtr = ckalloc(sizeof(FontchooserData));
+
+ bzero(fcdPtr, sizeof(FontchooserData));
+ Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteFontchooserData,
+ fcdPtr);
+ return TCL_OK;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXDraw.c b/carbon/tkMacOSXDraw.c
new file mode 100644
index 0000000..e028e45
--- /dev/null
+++ b/carbon/tkMacOSXDraw.c
@@ -0,0 +1,2118 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXDebug.h"
+#include "xbytes.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_DRAWING
+#endif
+*/
+
+#define radians(d) ((d) * (M_PI/180.0))
+
+/*
+ * Non-antialiased CG drawing looks better and more like X11 drawing when using
+ * very fine lines, so decrease all linewidths by the following constant.
+ */
+#define NON_AA_CG_OFFSET .999
+
+/*
+ * Temporary region that can be reused.
+ */
+
+RgnHandle tkMacOSXtmpQdRgn = NULL;
+
+int tkMacOSXUseCGDrawing = 1;
+
+int tkPictureIsOpen;
+
+static PixPatHandle penPat = NULL, tmpPixPat = NULL;
+
+static int cgAntiAliasLimit = 0;
+#define notAA(w) ((w) < cgAntiAliasLimit)
+
+static int useThemedToplevel = 0;
+static int useThemedFrame = 0;
+
+/*
+ * Prototypes for functions used only in this file.
+ */
+
+static void ClipToGC(Drawable d, GC gc, HIShapeRef *clipRgnPtr);
+static void NoQDClip(CGrafPtr port);
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitCGDrawing --
+ *
+ * Initializes link vars that control CG drawing.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXInitCGDrawing(
+ Tcl_Interp *interp,
+ int enable,
+ int limit)
+{
+ static Boolean initialized = FALSE;
+
+ if (!initialized) {
+ initialized = TRUE;
+
+ if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) {
+ Tcl_ResetResult(interp);
+ }
+ if (Tcl_LinkVar(interp, "::tk::mac::useCGDrawing",
+ (char *) &tkMacOSXUseCGDrawing, TCL_LINK_BOOLEAN) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+ tkMacOSXUseCGDrawing = enable;
+
+ if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit",
+ (char *) &cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+ cgAntiAliasLimit = limit;
+
+ /*
+ * Piggy-back the themed drawing var init here.
+ */
+
+ if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel",
+ (char *) &useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+ if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame",
+ (char *) &useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+
+ if (tkMacOSXtmpQdRgn == NULL) {
+ tkMacOSXtmpQdRgn = NewRgn();
+ }
+ }
+#ifdef TK_MAC_DEBUG_DRAWING
+ TkMacOSXInitNamedDebugSymbol(QD, void, QD_DebugPrint, char*);
+ if (QD_DebugPrint) {
+ ; /* gdb: b *QD_DebugPrint */
+ }
+#endif /* TK_MAC_DEBUG_WINDOWS */
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, /* that will be copied. */
+ unsigned int height,
+ int dest_x, /* Dest X & Y on dest rect. */
+ int dest_y)
+{
+ TkMacOSXDrawingContext dc;
+ MacDrawable *srcDraw = (MacDrawable *) src, *dstDraw = (MacDrawable *) dst;
+
+ display->request++;
+ if (!width || !height) {
+ /* TkMacOSXDbgMsg("Drawing of emtpy area requested"); */
+ return;
+ }
+ {
+ CGrafPtr srcPort;
+
+ srcPort = TkMacOSXGetDrawablePort(src);
+ if (srcPort) {
+ Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
+ const BitMap *srcBit, *dstBit;
+ RGBColor black = {0, 0, 0}, white = {0xffff, 0xffff, 0xffff};
+
+ if (!TkMacOSXSetupDrawingContext(dst, gc, 0, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ TkMacOSXDbgMsg("Ignored CG drawing of QD drawable");
+ goto end;
+ }
+ if (!dc.port) {
+ TkMacOSXDbgMsg("Invalid destination drawable");
+ goto end;
+ }
+ srcBit = GetPortBitMapForCopyBits(srcPort);
+ dstBit = GetPortBitMapForCopyBits(dc.port);
+ SetRect(srcPtr, srcDraw->xOff + src_x, srcDraw->yOff + src_y,
+ srcDraw->xOff + src_x + width,
+ srcDraw->yOff + src_y + height);
+ if (tkPictureIsOpen) {
+ dstPtr = srcPtr;
+ } else {
+ SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
+ dstDraw->xOff + dest_x + width,
+ dstDraw->yOff + dest_y + height);
+ }
+ RGBForeColor(&black);
+ RGBBackColor(&white);
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, srcCopy, NULL);
+end:
+ TkMacOSXRestoreDrawingContext(&dc);
+ } else {
+ TkMacOSXDbgMsg("Invalid source drawable");
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, /* GC to use. */
+ int src_x, /* X & Y, width & height */
+ int src_y, /* define the source rectangle */
+ unsigned int width, /* that will be copied. */
+ unsigned int height,
+ int dest_x, /* Dest X & Y on dest rect. */
+ int dest_y,
+ unsigned long plane) /* Which plane to copy. */
+{
+ TkMacOSXDrawingContext dc;
+ MacDrawable *srcDraw = (MacDrawable *) src, *dstDraw = (MacDrawable *) dst;
+
+ display->request++;
+ if (!width || !height) {
+ /* TkMacOSXDbgMsg("Drawing of emtpy area requested"); */
+ return;
+ }
+ if (plane != 1) {
+ Tcl_Panic("Unexpected plane specified for XCopyPlane");
+ }
+ {
+ CGrafPtr srcPort;
+
+ srcPort = TkMacOSXGetDrawablePort(src);
+ if (srcPort) {
+ Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
+ const BitMap *srcBit, *dstBit;
+ TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask;
+
+ if (!TkMacOSXSetupDrawingContext(dst, gc, 0, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ TkMacOSXDbgMsg("Ignored CG drawing of QD drawable");
+ goto end;
+ }
+ if (!dc.port) {
+ TkMacOSXDbgMsg("Invalid destination drawable");
+ goto end;
+ }
+ srcBit = GetPortBitMapForCopyBits(srcPort);
+ dstBit = GetPortBitMapForCopyBits(dc.port);
+ SetRect(srcPtr, srcDraw->xOff + src_x, srcDraw->yOff + src_y,
+ srcDraw->xOff + src_x + width,
+ srcDraw->yOff + src_y + height);
+ if (tkPictureIsOpen) {
+ dstPtr = srcPtr;
+ } else {
+ SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
+ dstDraw->xOff + dest_x + width,
+ dstDraw->yOff + dest_y + height);
+ }
+ TkMacOSXSetColorInPort(gc->foreground, 1, NULL, dc.port);
+ if (!clipPtr || clipPtr->type == TKP_CLIP_REGION) {
+ /*
+ * Opaque bitmaps.
+ */
+
+ TkMacOSXSetColorInPort(gc->background, 0, NULL, dc.port);
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, srcCopy, NULL);
+ } else if (clipPtr->type == TKP_CLIP_PIXMAP) {
+ if (clipPtr->value.pixmap == src) {
+ /*
+ * Transparent bitmaps. If it's color ignore the forecolor.
+ */
+ short tmode = GetPixDepth(GetPortPixMap(srcPort)) == 1 ?
+ srcOr : transparent;
+
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, tmode, NULL);
+ } else {
+ /*
+ * Two arbitrary bitmaps.
+ */
+
+ CGrafPtr mskPort = TkMacOSXGetDrawablePort(
+ clipPtr->value.pixmap);
+ const BitMap *mskBit = GetPortBitMapForCopyBits(mskPort);
+
+ CopyDeepMask(srcBit, mskBit, dstBit, srcPtr, srcPtr,
+ dstPtr, srcCopy, NULL);
+ }
+ }
+end:
+ TkMacOSXRestoreDrawingContext(&dc);
+ } else {
+ TkMacOSXDbgMsg("Invalid source drawable");
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+{
+ TkMacOSXDrawingContext dc;
+ MacDrawable *dstDraw = (MacDrawable *) d;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ TkMacOSXDbgMsg("Ignored CG drawing of XImage");
+ } else {
+ Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
+ const BitMap *dstBit;
+ RGBColor black = {0, 0, 0}, white = {0xffff, 0xffff, 0xffff};
+ int i, j;
+ char *newData = NULL;
+ char *dataPtr, *newPtr, *oldPtr;
+ int rowBytes = image->bytes_per_line, sliceRowBytes, lastSliceRowBytes;
+ int slices, sliceWidth, lastSliceWidth;
+
+ dstBit = GetPortBitMapForCopyBits(dc.port);
+ SetRect(srcPtr, src_x, src_y, src_x + width, src_y + height);
+ if (tkPictureIsOpen) {
+ dstPtr = srcPtr;
+ } else {
+ SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
+ dstDraw->xOff + dest_x + width,
+ dstDraw->yOff + dest_y + height);
+ }
+ RGBForeColor(&black);
+ RGBBackColor(&white);
+ if (image->obdata) {
+ /*
+ * Image from XGetImage, copy from containing GWorld directly.
+ */
+
+ CopyBits(GetPortBitMapForCopyBits(TkMacOSXGetDrawablePort(
+ (Drawable)image->obdata)), dstBit,
+ srcPtr, dstPtr, srcCopy, NULL);
+ } else if (image->depth == 1) {
+ /*
+ * BW image
+ */
+
+ const int maxRowBytes = 0x3ffe;
+ BitMap bitmap;
+ int odd;
+
+ if (rowBytes > maxRowBytes) {
+ slices = rowBytes / maxRowBytes;
+ sliceRowBytes = maxRowBytes;
+ lastSliceRowBytes = rowBytes - (slices * maxRowBytes);
+ if (!lastSliceRowBytes) {
+ slices--;
+ lastSliceRowBytes = maxRowBytes;
+ }
+ sliceWidth = (long) image->width * maxRowBytes / rowBytes;
+ lastSliceWidth = image->width - (sliceWidth * slices);
+ } else {
+ slices = 0;
+ sliceRowBytes = lastSliceRowBytes = rowBytes;
+ sliceWidth = lastSliceWidth = image->width;
+ }
+ bitmap.bounds.top = bitmap.bounds.left = 0;
+ bitmap.bounds.bottom = (short) image->height;
+ dataPtr = image->data + image->xoffset;
+ do {
+ if (slices) {
+ bitmap.bounds.right = bitmap.bounds.left + sliceWidth;
+ } else {
+ sliceRowBytes = lastSliceRowBytes;
+ bitmap.bounds.right = bitmap.bounds.left + lastSliceWidth;
+ }
+ oldPtr = dataPtr;
+ odd = sliceRowBytes % 2;
+ if (!newData) {
+ newData = ckalloc(image->height * (sliceRowBytes+odd));
+ }
+ newPtr = newData;
+ if (image->bitmap_bit_order != MSBFirst) {
+ for (i = 0; i < image->height; i++) {
+ for (j = 0; j < sliceRowBytes; j++) {
+ *newPtr = xBitReverseTable[(unsigned char)*oldPtr];
+ newPtr++; oldPtr++;
+ }
+ if (odd) {
+ *newPtr++ = 0;
+ }
+ oldPtr += rowBytes - sliceRowBytes;
+ }
+ } else {
+ for (i = 0; i < image->height; i++) {
+ memcpy(newPtr, oldPtr, sliceRowBytes);
+ newPtr += sliceRowBytes;
+ if (odd) {
+ *newPtr++ = 0;
+ }
+ oldPtr += rowBytes;
+ }
+ }
+ bitmap.baseAddr = newData;
+ bitmap.rowBytes = sliceRowBytes + odd;
+ CopyBits(&bitmap, dstBit, srcPtr, dstPtr, srcCopy, NULL);
+ if (slices) {
+ bitmap.bounds.left = bitmap.bounds.right;
+ dataPtr += sliceRowBytes;
+ }
+ } while (slices--);
+ ckfree(newData);
+ } else {
+ /*
+ * Color image
+ */
+
+ const int maxRowBytes = 0x3ffc;
+ PixMap pixmap;
+
+ pixmap.bounds.left = 0;
+ pixmap.bounds.top = 0;
+ pixmap.bounds.bottom = (short) image->height;
+ pixmap.pixelType = RGBDirect;
+ pixmap.pmVersion = baseAddr32; /* 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 = image->byte_order == MSBFirst ?
+ k32ARGBPixelFormat : k32BGRAPixelFormat;
+ pixmap.pmTable = NULL;
+ pixmap.pmExt = 0;
+ if (rowBytes > maxRowBytes) {
+ slices = rowBytes / maxRowBytes;
+ sliceRowBytes = maxRowBytes;
+ lastSliceRowBytes = rowBytes - (slices * maxRowBytes);
+ if (!lastSliceRowBytes) {
+ slices--;
+ lastSliceRowBytes = maxRowBytes;
+ }
+ sliceWidth = (long) image->width * maxRowBytes / rowBytes;
+ lastSliceWidth = image->width - (sliceWidth * slices);
+ dataPtr = image->data + image->xoffset;
+ newData = ckalloc(image->height * sliceRowBytes);
+ do {
+ if (slices) {
+ pixmap.bounds.right = pixmap.bounds.left + sliceWidth;
+ } else {
+ sliceRowBytes = lastSliceRowBytes;
+ pixmap.bounds.right = pixmap.bounds.left + lastSliceWidth;
+ }
+ oldPtr = dataPtr;
+ newPtr = newData;
+ for (i = 0; i < image->height; i++) {
+ memcpy(newPtr, oldPtr, sliceRowBytes);
+ oldPtr += rowBytes;
+ newPtr += sliceRowBytes;
+ }
+ pixmap.baseAddr = newData;
+ pixmap.rowBytes = sliceRowBytes | 0x8000;
+ CopyBits((BitMap*) &pixmap, dstBit, srcPtr, dstPtr, srcCopy,
+ NULL);
+ if (slices) {
+ pixmap.bounds.left = pixmap.bounds.right;
+ dataPtr += sliceRowBytes;
+ }
+ } while (slices--);
+ ckfree(newData);
+ } else {
+ pixmap.bounds.right = (short) image->width;
+ pixmap.baseAddr = image->data + image->xoffset;
+ pixmap.rowBytes = rowBytes | 0x8000;
+ CopyBits((BitMap*) &pixmap, dstBit, srcPtr, dstPtr, srcCopy, NULL);
+ }
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ TkMacOSXDrawingContext dc;
+ int i, lw = gc->line_width;
+
+ if (npoints < 2) {
+ /*
+ * TODO: generate BadValue error.
+ */
+
+ return;
+ }
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ double prevx, prevy;
+ double o = (lw % 2) ? .5 : 0;
+
+ CGContextBeginPath(dc.context);
+ prevx = macWin->xOff + points[0].x + o;
+ prevy = macWin->yOff + points[0].y + o;
+ CGContextMoveToPoint(dc.context, prevx, prevy);
+ for (i = 1; i < npoints; i++) {
+ if (mode == CoordModeOrigin) {
+ CGContextAddLineToPoint(dc.context,
+ macWin->xOff + points[i].x + o,
+ macWin->yOff + points[i].y + o);
+ } else {
+ prevx += points[i].x;
+ prevy += points[i].y;
+ CGContextAddLineToPoint(dc.context, prevx, prevy);
+ }
+ }
+ CGContextStrokePath(dc.context);
+ } else {
+ int o = -lw/2;
+
+ /* This is broken for fat lines, it is not possible to correctly
+ * imitate X11 drawing of oblique fat lines with QD line drawing,
+ * we should draw a filled polygon instead. */
+
+ MoveTo((short) (macWin->xOff + points[0].x + o),
+ (short) (macWin->yOff + points[0].y + o));
+ for (i = 1; i < npoints; i++) {
+ if (mode == CoordModeOrigin) {
+ LineTo((short) (macWin->xOff + points[i].x + o),
+ (short) (macWin->yOff + points[i].y + o));
+ } else {
+ Line((short) points[i].x, (short) points[i].y);
+ }
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawSegments --
+ *
+ * Draw unconnected lines.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Renders a series of unconnected lines.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDrawSegments(
+ Display *display,
+ Drawable d,
+ GC gc,
+ XSegment *segments,
+ int nsegments)
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ TkMacOSXDrawingContext dc;
+ int i, lw = gc->line_width;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ double o = (lw % 2) ? .5 : 0;
+
+ for (i = 0; i < nsegments; i++) {
+ CGContextBeginPath(dc.context);
+ CGContextMoveToPoint(dc.context,
+ macWin->xOff + segments[i].x1 + o,
+ macWin->yOff + segments[i].y1 + o);
+ CGContextAddLineToPoint(dc.context,
+ macWin->xOff + segments[i].x2 + o,
+ macWin->yOff + segments[i].y2 + o);
+ CGContextStrokePath(dc.context);
+ }
+ } else {
+ int o = -lw/2;
+
+ /* This is broken for fat lines, it is not possible to correctly
+ * imitate X11 drawing of oblique fat lines with QD line drawing,
+ * we should draw a filled polygon instead. */
+
+ for (i = 0; i < nsegments; i++) {
+ MoveTo((short) (macWin->xOff + segments[i].x1 + o),
+ (short) (macWin->yOff + segments[i].y1 + o));
+ LineTo((short) (macWin->xOff + segments[i].x2 + o),
+ (short) (macWin->yOff + segments[i].y2 + o));
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ TkMacOSXDrawingContext dc;
+ int i;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ double prevx, prevy;
+ double o = (gc->line_width % 2) ? .5 : 0;
+
+ CGContextBeginPath(dc.context);
+ prevx = macWin->xOff + points[0].x + o;
+ prevy = macWin->yOff + points[0].y + o;
+ CGContextMoveToPoint(dc.context, prevx, prevy);
+ for (i = 1; i < npoints; i++) {
+ if (mode == CoordModeOrigin) {
+ CGContextAddLineToPoint(dc.context,
+ macWin->xOff + points[i].x + o,
+ macWin->yOff + points[i].y + o);
+ } else {
+ prevx += points[i].x;
+ prevy += points[i].y;
+ CGContextAddLineToPoint(dc.context, prevx, prevy);
+ }
+ }
+ CGContextEOFillPath(dc.context);
+ } else {
+ PolyHandle polygon;
+
+ polygon = OpenPoly();
+ 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) points[i].x, (short) points[i].y);
+ }
+ }
+ ClosePoly();
+ FillCPoly(polygon, dc.penPat);
+ KillPoly(polygon);
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, int y, /* Upper left corner. */
+ unsigned int width, /* Width & height of rect. */
+ unsigned int height)
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ TkMacOSXDrawingContext dc;
+ int lw = gc->line_width;
+
+ if (width == 0 || height == 0) {
+ return;
+ }
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0;
+
+ rect = CGRectMake(
+ macWin->xOff + x + o,
+ macWin->yOff + y + o,
+ width, height);
+ CGContextStrokeRect(dc.context, rect);
+ } else {
+ Rect theRect;
+ int o = -lw/2;
+
+ theRect.left = (short) (macWin->xOff + x + o);
+ theRect.top = (short) (macWin->yOff + y + o);
+ theRect.right = (short) (theRect.left + width + lw);
+ theRect.bottom = (short) (theRect.top + height + lw);
+ FrameRect(&theRect);
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+#ifdef TK_MACOSXDRAW_UNUSED
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ TkMacOSXDrawingContext dc;
+ XRectangle * rectPtr;
+ int i, lw = gc->line_width;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0;
+
+ for (i = 0, rectPtr = rectArr; i < nRects; i++, rectPtr++) {
+ if (rectPtr->width == 0 || rectPtr->height == 0) {
+ continue;
+ }
+ rect = CGRectMake(
+ macWin->xOff + rectPtr->x + o,
+ macWin->yOff + rectPtr->y + o,
+ rectPtr->width, rectPtr->height);
+ CGContextStrokeRect(dc.context, rect);
+ }
+ } else {
+ Rect theRect;
+ int o = -lw/2;
+
+ for (i = 0, rectPtr = rectArr; i < nRects;i++, rectPtr++) {
+ theRect.left = (short) (macWin->xOff + rectPtr->x + o);
+ theRect.top = (short) (macWin->yOff + rectPtr->y + o);
+ theRect.right = (short) (theRect.left + rectPtr->width + lw);
+ theRect.bottom = (short) (theRect.top + rectPtr->height + lw);
+ FrameRect(&theRect);
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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_rectangles) /* Number of rectangles. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ TkMacOSXDrawingContext dc;
+ XRectangle * rectPtr;
+ int i;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+
+ for (i = 0, rectPtr = rectangles; i < n_rectangles; i++, rectPtr++) {
+ if (rectPtr->width == 0 || rectPtr->height == 0) {
+ continue;
+ }
+ rect = CGRectMake(
+ macWin->xOff + rectPtr->x,
+ macWin->yOff + rectPtr->y,
+ rectPtr->width, rectPtr->height);
+ CGContextFillRect(dc.context, rect);
+ }
+ } else {
+ Rect theRect;
+
+ for (i = 0, rectPtr = rectangles; i < n_rectangles; i++, rectPtr++) {
+ theRect.left = (short) (macWin->xOff + rectPtr->x);
+ theRect.top = (short) (macWin->yOff + rectPtr->y);
+ theRect.right = (short) (theRect.left + rectPtr->width);
+ theRect.bottom = (short) (theRect.top + rectPtr->height);
+ FillCRect(&theRect, dc.penPat);
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, int y, /* Upper left of bounding rect. */
+ unsigned int width, /* Width & height. */
+ unsigned int height,
+ int angle1, /* Staring angle of arc. */
+ int angle2) /* Extent of arc. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ TkMacOSXDrawingContext dc;
+ int lw = gc->line_width;
+
+ if (width == 0 || height == 0 || angle2 == 0) {
+ return;
+ }
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0;
+
+ rect = CGRectMake(
+ macWin->xOff + x + o,
+ macWin->yOff + y + o,
+ width, height);
+ TK_IF_MAC_OS_X_API_COND (4, CGContextStrokeEllipseInRect,
+ angle1 == 0 && angle2 == 23040,
+ CGContextStrokeEllipseInRect(dc.context, rect);
+ ) TK_ELSE (
+ CGMutablePathRef p = CGPathCreateMutable();
+ CGAffineTransform t = CGAffineTransformIdentity;
+ CGPoint c = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
+ double w = CGRectGetWidth(rect);
+
+ if (width != height) {
+ t = CGAffineTransformMakeScale(1.0, CGRectGetHeight(rect)/w);
+ c = CGPointApplyAffineTransform(c, CGAffineTransformInvert(t));
+ }
+ CGPathAddArc(p, &t, c.x, c.y, w/2, radians(-angle1/64.0),
+ radians(-(angle1 + angle2)/64.0), angle2 > 0);
+ CGContextAddPath(dc.context, p);
+ CGPathRelease(p);
+ CGContextStrokePath(dc.context);
+ ) TK_ENDIF
+ } else {
+ Rect theRect;
+ short start, extent;
+ int o = -lw/2;
+
+ theRect.left = (short) (macWin->xOff + x + o);
+ theRect.top = (short) (macWin->yOff + y + o);
+ theRect.right = (short) (theRect.left + width + lw);
+ theRect.bottom = (short) (theRect.top + height + lw);
+ start = (short) (90 - (angle1/64));
+ extent = (short) (-(angle2/64));
+ FrameArc(&theRect, start, extent);
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+#ifdef TK_MACOSXDRAW_UNUSED
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ TkMacOSXDrawingContext dc;
+ XArc *arcPtr;
+ int i, lw = gc->line_width;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0;
+
+ for (i=0, arcPtr = arcArr; i < nArcs; i++, arcPtr++) {
+ if (arcPtr->width == 0 || arcPtr->height == 0
+ || arcPtr->angle2 == 0) {
+ continue;
+ }
+ rect = CGRectMake(
+ macWin->xOff + arcPtr->x + o,
+ macWin->yOff + arcPtr->y + o,
+ arcPtr->width, arcPtr->height);
+
+ TK_IF_MAC_OS_X_API_COND (4, CGContextStrokeEllipseInRect,
+ arcPtr->angle1 == 0 && arcPtr->angle2 == 23040,
+ CGContextStrokeEllipseInRect(dc.context, rect);
+ ) TK_ELSE (
+ CGMutablePathRef p = CGPathCreateMutable();
+ CGAffineTransform t = CGAffineTransformIdentity;
+ CGPoint c = CGPointMake(CGRectGetMidX(rect),
+ CGRectGetMidY(rect));
+ double w = CGRectGetWidth(rect);
+
+ if (arcPtr->width != arcPtr->height) {
+ t = CGAffineTransformMakeScale(1, CGRectGetHeight(rect)/w);
+ c = CGPointApplyAffineTransform(c,
+ CGAffineTransformInvert(t));
+ }
+ CGPathAddArc(p, &t, c.x, c.y, w/2,
+ radians(-arcPtr->angle1/64.0),
+ radians(-(arcPtr->angle1 + arcPtr->angle2)/64.0),
+ arcPtr->angle2 > 0);
+ CGContextAddPath(dc.context, p);
+ CGPathRelease(p);
+ CGContextStrokePath(dc.context);
+ ) TK_ENDIF
+ }
+ } else {
+ Rect theRect;
+ short start, extent;
+ int o = -lw/2;
+
+ for (i = 0, arcPtr = arcArr;i < nArcs;i++, arcPtr++) {
+ theRect.left = (short) (macWin->xOff + arcPtr->x + o);
+ theRect.top = (short) (macWin->yOff + arcPtr->y + o);
+ theRect.right = (short) (theRect.left + arcPtr->width + lw);
+ theRect.bottom = (short) (theRect.top + arcPtr->height + lw);
+ start = (short) (90 - (arcPtr->angle1/64));
+ extent = (short) (-(arcPtr->angle2/64));
+ FrameArc(&theRect, start, extent);
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, int y, /* Upper left of bounding rect. */
+ unsigned int width, /* Width & height. */
+ unsigned int height,
+ int angle1, /* Staring angle of arc. */
+ int angle2) /* Extent of arc. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ TkMacOSXDrawingContext dc;
+ int lw = gc->line_width;
+
+ if (width == 0 || height == 0 || angle2 == 0) {
+ return;
+ }
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0, u = 0;
+
+ if (notAA(lw)) {
+ o += NON_AA_CG_OFFSET/2;
+ u += NON_AA_CG_OFFSET;
+ }
+ rect = CGRectMake(
+ macWin->xOff + x + o,
+ macWin->yOff + y + o,
+ width - u, height - u);
+
+ TK_IF_MAC_OS_X_API_COND (4, CGContextFillEllipseInRect,
+ angle1 == 0 && angle2 == 23040,
+ CGContextFillEllipseInRect(dc.context, rect);
+ ) TK_ELSE (
+ CGMutablePathRef p = CGPathCreateMutable();
+ CGAffineTransform t = CGAffineTransformIdentity;
+ CGPoint c = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
+ double w = CGRectGetWidth(rect);
+
+ if (width != height) {
+ t = CGAffineTransformMakeScale(1, CGRectGetHeight(rect)/w);
+ c = CGPointApplyAffineTransform(c, CGAffineTransformInvert(t));
+ }
+ if (gc->arc_mode == ArcPieSlice) {
+ CGPathMoveToPoint(p, &t, c.x, c.y);
+ }
+ CGPathAddArc(p, &t, c.x, c.y, w/2, radians(-angle1/64.0),
+ radians(-(angle1 + angle2)/64.0), angle2 > 0);
+ CGPathCloseSubpath(p);
+ CGContextAddPath(dc.context, p);
+ CGPathRelease(p);
+ CGContextFillPath(dc.context);
+ ) TK_ENDIF
+ } else {
+ Rect theRect;
+ short start, extent;
+ int o = -lw/2;
+ PolyHandle polygon;
+ double sin1, cos1, sin2, cos2, angle;
+ double boxWidth, boxHeight;
+ double vertex[2], center1[2], center2[2];
+
+ theRect.left = (short) (macWin->xOff + x + o);
+ theRect.top = (short) (macWin->yOff + y + o);
+ theRect.right = (short) (theRect.left + width + lw);
+ theRect.bottom = (short) (theRect.top + height + lw);
+ 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 = radians(-angle1/64.0);
+ sin1 = sin(angle);
+ cos1 = cos(angle);
+ angle -= radians(angle2/64.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] + .5), (short) (center1[1] + .5));
+ LineTo((short) (center2[0] + .5), (short) (center2[1] + .5));
+ ClosePoly();
+ FillCArc(&theRect, start, extent, dc.penPat);
+ FillCPoly(polygon, dc.penPat);
+ KillPoly(polygon);
+ } else {
+ FillCArc(&theRect, start, extent, dc.penPat);
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+#ifdef TK_MACOSXDRAW_UNUSED
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ TkMacOSXDrawingContext dc;
+ XArc * arcPtr;
+ int i, lw = gc->line_width;
+
+ display->request++;
+ if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGRect rect;
+ double o = (lw % 2) ? .5 : 0, u = 0;
+
+ if (notAA(lw)) {
+ o += NON_AA_CG_OFFSET/2;
+ u += NON_AA_CG_OFFSET;
+ }
+ for (i = 0, arcPtr = arcArr; i < nArcs; i++, arcPtr++) {
+ if (arcPtr->width == 0 || arcPtr->height == 0
+ || arcPtr->angle2 == 0) {
+ continue;
+ }
+ rect = CGRectMake(
+ macWin->xOff + arcPtr->x + o,
+ macWin->yOff + arcPtr->y + o,
+ arcPtr->width - u, arcPtr->height - u);
+ TK_IF_MAC_OS_X_API_COND (4, CGContextFillEllipseInRect,
+ arcPtr->angle1 == 0 && arcPtr->angle2 == 23040,
+ CGContextFillEllipseInRect(dc.context, rect);
+ ) TK_ELSE (
+ CGMutablePathRef p = CGPathCreateMutable();
+ CGAffineTransform t = CGAffineTransformIdentity;
+ CGPoint c = CGPointMake(CGRectGetMidX(rect),
+ CGRectGetMidY(rect));
+ double w = CGRectGetWidth(rect);
+
+ if (arcPtr->width != arcPtr->height) {
+ t = CGAffineTransformMakeScale(1, CGRectGetHeight(rect)/w);
+ c = CGPointApplyAffineTransform(c,
+ CGAffineTransformInvert(t));
+ }
+ if (gc->arc_mode == ArcPieSlice) {
+ CGPathMoveToPoint(p, &t, c.x, c.y);
+ }
+ CGPathAddArc(p, &t, c.x, c.y, w/2,
+ radians(-arcPtr->angle1/64.0),
+ radians(-(arcPtr->angle1 + arcPtr->angle2)/64.0),
+ arcPtr->angle2 > 0);
+ CGPathCloseSubpath(p);
+ CGContextAddPath(dc.context, p);
+ CGPathRelease(p);
+ CGContextFillPath(dc.context);
+ ) TK_ENDIF
+ }
+ } else {
+ Rect theRect;
+ short start, extent;
+ int o = -lw/2;
+ PolyHandle polygon;
+ double sin1, cos1, sin2, cos2, angle;
+ double boxWidth, boxHeight;
+ double vertex[2], center1[2], center2[2];
+
+ for (i = 0, arcPtr = arcArr;i<nArcs;i++, arcPtr++) {
+ theRect.left = (short) (macWin->xOff + arcPtr->x + o);
+ theRect.top = (short) (macWin->yOff + arcPtr->y + o);
+ theRect.right = (short) (theRect.left + arcPtr->width + lw);
+ theRect.bottom = (short) (theRect.top + arcPtr->height + lw);
+ start = (short) (90 - (arcPtr->angle1/64));
+ extent = (short) (- (arcPtr->angle2/64));
+
+ if (gc->arc_mode == ArcChord) {
+ boxWidth = theRect.right - theRect.left;
+ boxHeight = theRect.bottom - theRect.top;
+ angle = radians(-arcPtr->angle1/64.0);
+ sin1 = sin(angle);
+ cos1 = cos(angle);
+ angle -= radians(arcPtr->angle2/64.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] + .5), (short) (center1[1] + .5));
+ LineTo((short) (center2[0] + .5), (short) (center2[1] + .5));
+ ClosePoly();
+ FillCArc(&theRect, start, extent, dc.penPat);
+ FillCPoly(polygon, dc.penPat);
+ KillPoly(polygon);
+ } else {
+ FillCArc(&theRect, start, extent, dc.penPat);
+ }
+ }
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+#endif
+
+#ifdef TK_MACOSXDRAW_UNUSED
+/*
+ *----------------------------------------------------------------------
+ *
+ * XMaxRequestSize --
+ *
+ *----------------------------------------------------------------------
+ */
+
+long
+XMaxRequestSize(
+ Display *display)
+{
+ return (SHRT_MAX / 4);
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, int y, /* Position rectangle to be scrolled. */
+ int width, int height,
+ int dx, int dy, /* Distance rectangle should be moved. */
+ TkRegion damageRgn) /* Region to accumulate damage in. */
+{
+ MacDrawable *destDraw = (MacDrawable *) Tk_WindowId(tkwin);
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ Rect scrollRect;
+ int result;
+ HIShapeRef dmgRgn;
+
+ /*
+ * 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.
+ */
+
+ scrollRect.left = destDraw->xOff + x;
+ scrollRect.top = destDraw->yOff + y;
+ scrollRect.right = scrollRect.left + width;
+ scrollRect.bottom = scrollRect.top + height;
+ if (dx < 0) {
+ scrollRect.left += dx;
+ } else {
+ scrollRect.right += dx;
+ }
+ if (dy < 0) {
+ scrollRect.top += dy;
+ } else {
+ scrollRect.bottom += dy;
+ }
+
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+ TkMacOSXCheckTmpQdRgnEmpty();
+ portChanged = QDSwapPort(destPort, &savePort);
+ ScrollRect(&scrollRect, dx, dy, tkMacOSXtmpQdRgn);
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+
+ /*
+ * Fortunately, the region returned by ScrollRect is semantically
+ * 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.
+ */
+
+ dmgRgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
+ SetEmptyRgn(tkMacOSXtmpQdRgn);
+ TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
+ result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;
+ CFRelease(dmgRgn);
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetUpGraphicsPort --
+ *
+ * Set up the graphics port from the given GC.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The current port is adjusted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetUpGraphicsPort(
+ GC gc, /* GC to apply to current port. */
+ void *destPort)
+{
+ CGrafPtr savePort;
+ Boolean portChanged;
+
+ portChanged = QDSwapPort(destPort, &savePort);
+ PenNormal();
+ if (gc) {
+ if (!penPat) {
+ if (!tmpPixPat) {
+ penPat = NewPixPat();
+ } else {
+ penPat = tmpPixPat;
+ tmpPixPat = NULL;
+ }
+ }
+ TkMacOSXSetColorInPort(gc->foreground, 1, penPat, destPort);
+ PenPixPat(penPat);
+ if(gc->function == GXxor) {
+ PenMode(patXor);
+ }
+ if (gc->line_width > 1) {
+ PenSize(gc->line_width, gc->line_width);
+ }
+ if (gc->line_style != LineSolid) {
+ /*
+ * FIXME: Here the dash pattern should be set in the drawing
+ * environment. This is not possible with QuickDraw line drawing.
+ */
+ }
+ }
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetUpDrawingContext --
+ *
+ * Set up a drawing context for the given drawable and GC.
+ *
+ * Results:
+ * Boolean indicating whether it is ok to draw; if false, drawing
+ * context was not setup, so do not attempt to draw and do not call
+ * TkMacOSXRestoreDrawingContext().
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXSetupDrawingContext(
+ Drawable d,
+ GC gc,
+ int useCG, /* advisory only ! */
+ TkMacOSXDrawingContext *dcPtr)
+{
+ MacDrawable *macDraw = ((MacDrawable*)d);
+ int dontDraw = 0;
+ TkMacOSXDrawingContext dc = {NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ {SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX}, false};
+
+ if (tkPictureIsOpen) {
+ if (useCG) {
+ TkMacOSXDbgMsg("Ignored CG Drawing with QD Picture open");
+ dontDraw = 1;
+ }
+ } else {
+ dc.clipRgn = TkMacOSXGetClipRgn(d);
+ }
+ if (!dontDraw) {
+ ClipToGC(d, gc, &dc.clipRgn);
+ dontDraw = dc.clipRgn ? HIShapeIsEmpty(dc.clipRgn) : 0;
+ }
+ if (dontDraw) {
+ if (dc.clipRgn) {
+ CFRelease(dc.clipRgn);
+ dc.clipRgn = NULL;
+ }
+ goto end;
+ }
+ if (useCG) {
+ dc.context = macDraw->context;
+ }
+ if (!dc.context || !(macDraw->flags & TK_IS_PIXMAP)) {
+ dc.port = TkMacOSXGetDrawablePort(d);
+ if (dc.port) {
+ GetPortBounds(dc.port, &dc.portBounds);
+ }
+ }
+ if (dc.context) {
+ if (!dc.port) {
+ CGRect r;
+
+ TK_IF_MAC_OS_X_API (3, CGContextGetClipBoundingBox,
+ r = CGContextGetClipBoundingBox(dc.context);
+ ) TK_ELSE_MAC_OS_X (3,
+ r.origin = CGPointZero;
+ r.size = macDraw->size;
+ ) TK_ENDIF
+ SetRect(&dc.portBounds, r.origin.x + macDraw->xOff,
+ r.origin.y + macDraw->yOff,
+ r.origin.x + r.size.width + macDraw->xOff,
+ r.origin.y + r.size.height + macDraw->yOff);
+ }
+ CGContextSaveGState(dc.context);
+ dc.saveState = (void*)1;
+ dc.port = NULL;
+ } else if (dc.port) {
+ dc.portChanged = QDSwapPort(dc.port, &dc.savePort);
+ if (useCG && ChkErr(QDBeginCGContext, dc.port, &dc.context) == noErr) {
+ SyncCGContextOriginWithPort(dc.context, dc.port);
+ } else {
+ dc.context = NULL;
+ }
+ } else {
+ Tcl_Panic("TkMacOSXSetupDrawingContext(): "
+ "no port or context to draw into !");
+ }
+ if (dc.context) {
+ CGContextConcatCTM(dc.context, CGAffineTransformMake(1.0, 0.0, 0.0,
+ -1.0, 0.0, dc.portBounds.bottom - dc.portBounds.top));
+ if (dc.clipRgn) {
+#ifdef TK_MAC_DEBUG_DRAWING
+ CGContextSaveGState(dc.context);
+ ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
+ CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.2);
+ CGContextEOFillPath(dc.context);
+ CGContextRestoreGState(dc.context);
+#endif /* TK_MAC_DEBUG_DRAWING */
+ ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
+ CGContextEOClip(dc.context);
+ }
+ if (gc) {
+ static const CGLineCap cgCap[] = {
+ [CapNotLast] = kCGLineCapButt,
+ [CapButt] = kCGLineCapButt,
+ [CapRound] = kCGLineCapRound,
+ [CapProjecting] = kCGLineCapSquare,
+ };
+ static const CGLineJoin cgJoin[] = {
+ [JoinMiter] = kCGLineJoinMiter,
+ [JoinRound] = kCGLineJoinRound,
+ [JoinBevel] = kCGLineJoinBevel,
+ };
+ bool shouldAntialias;
+ double w = gc->line_width;
+
+ TkMacOSXSetColorInContext(gc->foreground, dc.context);
+ if (dc.port) {
+ CGContextSetPatternPhase(dc.context, CGSizeMake(
+ dc.portBounds.right - dc.portBounds.left,
+ dc.portBounds.bottom - dc.portBounds.top));
+ }
+ if(gc->function != GXcopy) {
+ TkMacOSXDbgMsg("Logical functions other than GXcopy are "
+ "not supported for CG drawing!");
+ }
+ /* When should we antialias? */
+ shouldAntialias = !notAA(gc->line_width);
+ if (!shouldAntialias) {
+ /* Make non-antialiased CG drawing look more like X11 */
+ w -= (gc->line_width ? NON_AA_CG_OFFSET : 0);
+ }
+ CGContextSetShouldAntialias(dc.context, shouldAntialias);
+ CGContextSetLineWidth(dc.context, w);
+ if (gc->line_style != LineSolid) {
+ int num = 0;
+ char *p = &(gc->dashes);
+ double dashOffset = gc->dash_offset;
+ float lengths[10];
+
+ while (p[num] != '\0' && num < 10) {
+ lengths[num] = p[num];
+ num++;
+ }
+ CGContextSetLineDash(dc.context, dashOffset, lengths, num);
+ }
+ if ((unsigned)gc->cap_style < sizeof(cgCap)/sizeof(CGLineCap)) {
+ CGContextSetLineCap(dc.context,
+ cgCap[(unsigned)gc->cap_style]);
+ }
+ if ((unsigned)gc->join_style < sizeof(cgJoin)/sizeof(CGLineJoin)) {
+ CGContextSetLineJoin(dc.context,
+ cgJoin[(unsigned)gc->join_style]);
+ }
+ }
+ } else if (dc.port) {
+ PixPatHandle savePat = penPat;
+
+ ChkErr(GetThemeDrawingState, &dc.saveState);
+ penPat = NULL;
+ TkMacOSXSetUpGraphicsPort(gc, dc.port);
+ dc.penPat = penPat;
+ penPat = savePat;
+ dc.saveClip = NewRgn();
+ GetPortClipRegion(dc.port, dc.saveClip);
+ if (dc.clipRgn) {
+ ChkErr(HIShapeSetQDClip, dc.clipRgn, dc.port);
+ } else {
+ NoQDClip(dc.port);
+ }
+ if (!tkPictureIsOpen) {
+ ShowPen();
+ }
+ }
+end:
+ *dcPtr = dc;
+ return !dontDraw;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXRestoreDrawingContext --
+ *
+ * Restore drawing context.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXRestoreDrawingContext(
+ TkMacOSXDrawingContext *dcPtr)
+{
+ if (dcPtr->context) {
+ CGContextSynchronize(dcPtr->context);
+ if (dcPtr->saveState) {
+ CGContextRestoreGState(dcPtr->context);
+ }
+ if (dcPtr->port) {
+ ChkErr(QDEndCGContext, dcPtr->port, &(dcPtr->context));
+ }
+ } else if (dcPtr->port) {
+ if (!tkPictureIsOpen) {
+ HidePen();
+ }
+ PenNormal();
+ if (dcPtr->saveClip) {
+ SetPortClipRegion(dcPtr->port, dcPtr->saveClip);
+ DisposeRgn(dcPtr->saveClip);
+ }
+ if (dcPtr->penPat) {
+ if (!tmpPixPat) {
+ tmpPixPat = dcPtr->penPat;
+ } else {
+ DisposePixPat(dcPtr->penPat);
+ }
+ }
+ if (dcPtr->saveState) {
+ ChkErr(SetThemeDrawingState, dcPtr->saveState, true);
+ }
+ }
+ if (dcPtr->clipRgn) {
+ CFRelease(dcPtr->clipRgn);
+ }
+ if (dcPtr->portChanged) {
+ QDSwapPort(dcPtr->savePort, NULL);
+ }
+#ifdef TK_MAC_DEBUG
+ bzero(dcPtr, sizeof(TkMacOSXDrawingContext));
+#endif /* TK_MAC_DEBUG */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetClipRgn --
+ *
+ * Get the clipping region needed to restrict drawing to the given
+ * drawable.
+ *
+ * Results:
+ * Clipping region. If non-NULL, CFRelease it when done.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+HIShapeRef
+TkMacOSXGetClipRgn(
+ Drawable drawable) /* Drawable. */
+{
+ MacDrawable *macDraw = (MacDrawable *) drawable;
+ HIShapeRef clipRgn = NULL;
+ CGRect r;
+
+ if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(macDraw->winPtr);
+#ifdef TK_MAC_DEBUG_DRAWING
+ TkMacOSXDbgMsg("%s visRgn ", macDraw->winPtr->pathName);
+ TkMacOSXDebugFlashRegion(drawable, macDraw->visRgn);
+#endif /* TK_MAC_DEBUG_DRAWING */
+ }
+
+ if (macDraw->flags & TK_CLIPPED_DRAW) {
+ r = CGRectOffset(macDraw->drawRect, macDraw->xOff, macDraw->yOff);
+ }
+ if (macDraw->visRgn) {
+ if (macDraw->flags & TK_CLIPPED_DRAW) {
+ HIShapeRef rgn = HIShapeCreateWithRect(&r);
+
+ clipRgn = HIShapeCreateIntersection(macDraw->visRgn, rgn);
+ CFRelease(rgn);
+ } else {
+ clipRgn = HIShapeCreateCopy(macDraw->visRgn);
+ }
+ } else if (macDraw->flags & TK_CLIPPED_DRAW) {
+ clipRgn = HIShapeCreateWithRect(&r);
+ }
+#ifdef TK_MAC_DEBUG_DRAWING
+ TkMacOSXDbgMsg("%s clipRgn ", macDraw->winPtr->pathName);
+ TkMacOSXDebugFlashRegion(drawable, clipRgn);
+#endif /* TK_MAC_DEBUG_DRAWING */
+
+ return clipRgn;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+{
+ CGrafPtr port = TkMacOSXGetDrawablePort(drawable);
+
+ if (port) {
+ HIShapeRef clipRgn = TkMacOSXGetClipRgn(drawable);
+
+ if (clipRgn) {
+ ChkErr(HIShapeSetQDClip, clipRgn, port);
+ CFRelease(clipRgn);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpClipDrawableToRect --
+ *
+ * Clip all drawing into the drawable d to the given rectangle.
+ * If width and height are negative, reset to no clipping.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Subsequent drawing into d is offset and clipped as specified.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpClipDrawableToRect(
+ Display *display,
+ Drawable d,
+ int x, int y,
+ int width, int height)
+{
+ MacDrawable *macDraw = (MacDrawable *) d;
+
+ if (width < 0 && height < 0) {
+ macDraw->drawRect = CGRectNull;
+ macDraw->flags &= ~TK_CLIPPED_DRAW;
+ } else {
+ macDraw->drawRect = CGRectMake(x, y, width, height);
+ macDraw->flags |= TK_CLIPPED_DRAW;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ClipToGC --
+ *
+ * Helper function to intersect given region with gc clip region.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ClipToGC(
+ Drawable d,
+ GC gc,
+ HIShapeRef *clipRgnPtr) /* must point to initialized variable */
+{
+ if (gc && gc->clip_mask &&
+ ((TkpClipMask*)gc->clip_mask)->type == TKP_CLIP_REGION) {
+ TkRegion gcClip = ((TkpClipMask*)gc->clip_mask)->value.region;
+ int xOffset = ((MacDrawable *) d)->xOff + gc->clip_x_origin;
+ int yOffset = ((MacDrawable *) d)->yOff + gc->clip_y_origin;
+ HIShapeRef clipRgn = *clipRgnPtr, gcClipRgn;
+
+ if (!tkPictureIsOpen) {
+ TkMacOSXOffsetRegion(gcClip, xOffset, yOffset);
+ }
+ gcClipRgn = TkMacOSXGetNativeRegion(gcClip);
+ if (clipRgn) {
+ *clipRgnPtr = HIShapeCreateIntersection(gcClipRgn, clipRgn);
+ CFRelease(clipRgn);
+ } else {
+ *clipRgnPtr = HIShapeCreateCopy(gcClipRgn);
+ }
+ CFRelease(gcClipRgn);
+ if (!tkPictureIsOpen) {
+ TkMacOSXOffsetRegion(gcClip, -xOffset, -yOffset);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NoQDClip --
+ *
+ * Helper function to setup a QD port to not clip anything.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+NoQDClip(
+ CGrafPtr port)
+{
+ static RgnHandle noClipRgn = NULL;
+
+ if (!noClipRgn) {
+ noClipRgn = NewRgn();
+ SetRectRgn(noClipRgn, SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX);
+ }
+ SetPortClipRegion(port, noClipRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void *
+TkMacOSXMakeStippleMap(
+ Drawable drawable, /* Window to apply stipple. */
+ Drawable stipple) /* The stipple pattern. */
+{
+ CGrafPtr stipplePort;
+ BitMapPtr bitmapPtr;
+ const BitMap *stippleBitmap;
+ Rect portRect;
+ int width, height, stippleHeight, stippleWidth, i, j;
+ Rect bounds;
+
+ GetPortBounds(TkMacOSXGetDrawablePort(drawable), &portRect);
+ width = portRect.right - portRect.left;
+ height = portRect.bottom - portRect.top;
+ bitmapPtr = ckalloc(sizeof(BitMap));
+ bitmapPtr->bounds.top = bitmapPtr->bounds.left = 0;
+ bitmapPtr->bounds.right = (short) width;
+ bitmapPtr->bounds.bottom = (short) height;
+ bitmapPtr->rowBytes = (width / 8) + 1;
+ bitmapPtr->baseAddr = ckalloc(height * bitmapPtr->rowBytes);
+
+ stipplePort = TkMacOSXGetDrawablePort(stipple);
+ stippleBitmap = GetPortBitMapForCopyBits(stipplePort);
+ GetPortBounds(stipplePort, &portRect);
+ 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(stippleBitmap, bitmapPtr, &portRect, &bounds, srcCopy,
+ NULL);
+ }
+ }
+ return bitmapPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDrawHighlightBorder --
+ *
+ * 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);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDrawFrame --
+ *
+ * This procedure draws the rectangular frame area. If the user
+ * has request themeing, it draws with a the background theme.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws inside the tkwin area.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDrawFrame(
+ Tk_Window tkwin,
+ Tk_3DBorder border,
+ int highlightWidth,
+ int borderWidth,
+ int relief)
+{
+ if (useThemedToplevel && Tk_IsTopLevel(tkwin)) {
+ static Tk_3DBorder themedBorder = NULL;
+
+ if (!themedBorder) {
+ themedBorder = Tk_Get3DBorder(NULL, tkwin,
+ "systemWindowHeaderBackground");
+ }
+ if (themedBorder) {
+ border = themedBorder;
+ }
+ }
+ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin),
+ border, highlightWidth, highlightWidth,
+ Tk_Width(tkwin) - 2 * highlightWidth,
+ Tk_Height(tkwin) - 2 * highlightWidth,
+ borderWidth, relief);
+}
diff --git a/carbon/tkMacOSXEmbed.c b/carbon/tkMacOSXEmbed.c
new file mode 100644
index 0000000..ad9e3da
--- /dev/null
+++ b/carbon/tkMacOSXEmbed.c
@@ -0,0 +1,1181 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXInt.h"
+#include "tkBusy.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 *tkMacOSXEmbedHandler = NULL;
+
+/*
+ * Prototypes for static procedures defined in this file:
+ */
+
+static void ContainerEventProc(ClientData clientData, XEvent *eventPtr);
+static void EmbeddedEventProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedActivateProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedFocusProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedGeometryRequest(Container *containerPtr, int width,
+ int height);
+static void EmbedSendConfigure(Container *containerPtr);
+static void EmbedStructureProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedWindowDeleted(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 (tkMacOSXEmbedHandler == NULL) {
+ tkMacOSXEmbedHandler = ckalloc(sizeof(TkMacOSXEmbedHandler));
+ }
+ tkMacOSXEmbedHandler->registerWinProc = registerWinProc;
+ tkMacOSXEmbedHandler->getPortProc = getPortProc;
+ tkMacOSXEmbedHandler->containerExistProc = containerExistProc;
+ tkMacOSXEmbedHandler->getClipProc = getClipProc;
+ tkMacOSXEmbedHandler->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;
+
+ /*
+ * If this window is marked as embedded then the window structure should
+ * have already been created in the TkpUseWindow function.
+ */
+
+ if (Tk_IsEmbedded(winPtr)) {
+ macWin = winPtr->privatePtr;
+ } else {
+ /*
+ * Allocate sub window
+ */
+
+ macWin = ckalloc(sizeof(MacDrawable));
+ if (macWin == NULL) {
+ winPtr->privatePtr = NULL;
+ return None;
+ }
+ macWin->winPtr = winPtr;
+ winPtr->privatePtr = macWin;
+ macWin->visRgn = NULL;
+ macWin->aboveVisRgn = NULL;
+ macWin->drawRect = CGRectNull;
+ macWin->referenceCount = 0;
+ macWin->flags = TK_CLIP_INVALID;
+ macWin->grafPtr = NULL;
+ macWin->context = NULL;
+ macWin->size = CGSizeZero;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ /*
+ * This will be set when we are mapped.
+ */
+
+ macWin->xOff = 0;
+ macWin->yOff = 0;
+ macWin->toplevel = macWin;
+ } else {
+ 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++;
+ }
+ 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;
+ TkWindow *usePtr;
+ MacDrawable *parent, *macWin;
+ Container *containerPtr;
+
+ if (winPtr->window != None) {
+ Tcl_AppendResult(interp, "can't modify container after widget is "
+ "created", NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * 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, (int*) &parent) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, (Window) parent);
+ if (usePtr != NULL) {
+ if (!(usePtr->flags & TK_CONTAINER)) {
+ Tcl_AppendResult(interp, "window \"", usePtr->pathName,
+ "\" doesn't have -container option set", NULL);
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * The code below can probably be simplified given we have already
+ * discovered 'usePtr' above.
+ */
+
+ /*
+ * 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 = 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->context = NULL;
+ macWin->size = CGSizeZero;
+ macWin->visRgn = NULL;
+ macWin->aboveVisRgn = NULL;
+ macWin->drawRect = CGRectNull;
+ 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 (tkMacOSXEmbedHandler == NULL ||
+ tkMacOSXEmbedHandler->registerWinProc((int) parent,
+ (Tk_Window) winPtr) != TCL_OK) {
+ Tcl_AppendResult(interp, "The window ID ", string,
+ " does not correspond to a valid Tk Window.", NULL);
+ return TCL_ERROR;
+ } else {
+ containerPtr = 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,
+ winPtr);
+ }
+
+ 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 = 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, winPtr);
+ Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbedStructureProc,
+ containerPtr);
+ Tk_CreateEventHandler(tkwin, ActivateMask, EmbedActivateProc,
+ containerPtr);
+ Tk_CreateEventHandler(tkwin, FocusChangeMask, EmbedFocusProc,
+ 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(
+ 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;
+ }
+ }
+ Tcl_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;
+ }
+ contWinPtr = TkpGetOtherWindow(topWinPtr);
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+
+ if (contWinPtr == NULL) {
+ return None;
+ }
+ return TkMacOSXGetHostToplevel(contWinPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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). */
+{
+ /* TODO: Implement this or decide it definitely needs no implementation */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 clientData, /* Token for container window. */
+ XEvent *eventPtr) /* ResizeRequest event. */
+{
+ TkWindow *winPtr = 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 clientData, /* Token for container window. */
+ XEvent *eventPtr) /* ResizeRequest event. */
+{
+ TkWindow *winPtr = 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, NULL, NULL);
+
+ /*
+ * Find the Container structure associated with the parent window.
+ */
+
+ for (containerPtr = firstContainerPtr;
+ containerPtr->parent != eventPtr->xmaprequest.parent;
+ containerPtr = containerPtr->nextPtr) {
+ if (containerPtr == NULL) {
+ Tcl_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 clientData, /* Token for container window. */
+ XEvent *eventPtr) /* ResizeRequest event. */
+{
+ Container *containerPtr = 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, NULL, NULL);
+ Tk_MoveResizeWindow((Tk_Window) containerPtr->embeddedPtr, 0, 0,
+ (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr),
+ (unsigned) 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 clientData, /* Token for container window. */
+ XEvent *eventPtr) /* ResizeRequest event. */
+{
+ Container *containerPtr = 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 clientData, /* Token for container window. */
+ XEvent *eventPtr) /* ResizeRequest event. */
+{
+ Container *containerPtr = 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(
+ Container *containerPtr, /* Information about the embedding. */
+ int width, int 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(
+ 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(
+ 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(containerPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpShowBusyWindow, TkpHideBusyWindow, TkpMakeTransparentWindowExist,
+ * TkpCreateBusy --
+ *
+ * Portability layer for busy windows. Holds platform-specific gunk for
+ * the [tk busy] command, which is currently a dummy implementation for
+ * OSX/Aqua. The individual functions are supposed to do the following:
+ *
+ * TkpShowBusyWindow --
+ * Make the busy window appear.
+ *
+ * TkpHideBusyWindow --
+ * Make the busy window go away.
+ *
+ * TkpMakeTransparentWindowExist --
+ * Actually make a transparent window.
+ *
+ * TkpCreateBusy --
+ * Creates the platform-specific part of a busy window structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpShowBusyWindow(
+ TkBusy busy)
+{
+}
+
+void
+TkpHideBusyWindow(
+ TkBusy busy)
+{
+}
+
+void
+TkpMakeTransparentWindowExist(
+ Tk_Window tkwin, /* Token for window. */
+ Window parent) /* Parent window. */
+{
+}
+
+void
+TkpCreateBusy(
+ Tk_FakeWin *winPtr,
+ Tk_Window tkRef,
+ Window* parentPtr,
+ Tk_Window tkParent,
+ TkBusy busy)
+{
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/carbon/tkMacOSXEntry.c b/carbon/tkMacOSXEntry.c
new file mode 100644
index 0000000..0c4211e
--- /dev/null
+++ b/carbon/tkMacOSXEntry.c
@@ -0,0 +1,324 @@
+/*
+ * tkMacOSXEntry.c --
+ *
+ * This file implements the native aqua entry widget.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXPrivate.h"
+#include "tkMacOSXDefault.h"
+#include "tkEntry.h"
+
+static ThemeButtonKind ComputeIncDecParameters(int height, int *width);
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ComputeIncDecParameters --
+ *
+ * This procedure figures out which of the kThemeIncDec buttons to use.
+ * It also sets width to the width of the IncDec button.
+ *
+ * Results:
+ * The ThemeButtonKind of the button we should use.
+ *
+ * Side effects:
+ * May draw the entry border into pixmap.
+ *
+ *--------------------------------------------------------------
+ */
+
+static ThemeButtonKind
+ComputeIncDecParameters(
+ int height,
+ int *width)
+{
+ ThemeButtonKind kind;
+
+ TK_IF_HI_TOOLBOX (3,
+ if (height < 11 || height > 28) {
+ *width = 0;
+ kind = (ThemeButtonKind) 0;
+ } else {
+ if (height >= 21) {
+ *width = 13;
+ kind = kThemeIncDecButton;
+ } else if (height >= 18) {
+ *width = 12;
+ kind = kThemeIncDecButtonSmall;
+ } else {
+ *width = 11;
+ kind = kThemeIncDecButtonMini;
+ }
+ }
+ ) TK_ELSE_HI_TOOLBOX (3,
+ if (height < 21 || height > 28) {
+ *width = 0;
+ kind = (ThemeButtonKind) 0;
+ } else {
+ *width = 13;
+ kind = kThemeIncDecButton;
+ }
+ ) TK_ENDIF
+
+ return kind;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpDrawEntryBorderAndFocus --
+ *
+ * This procedure redraws the border of an entry window. It overrides the
+ * generic border drawing code if the entry widget parameters are such
+ * that the native widget drawing is a good fit. This version just
+ * returns 1, so platforms that don't do special native drawing don't
+ * have to implement it.
+ *
+ * Results:
+ * 1 if it has drawn the border, 0 if not.
+ *
+ * Side effects:
+ * May draw the entry border into pixmap.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+TkpDrawEntryBorderAndFocus(
+ Entry *entryPtr,
+ Drawable d,
+ int isSpinbox)
+{
+ Rect bounds;
+ TkMacOSXDrawingContext dc;
+ GC bgGC;
+ Tk_Window tkwin = entryPtr->tkwin;
+ ThemeDrawState drawState;
+ int oldWidth = 0;
+ MacDrawable *macDraw = (MacDrawable *) d;
+
+ /*
+ * I use 6 as the borderwidth. 2 of the 5 go into the actual frame the 3
+ * are because the Mac OS Entry widgets leave more space around the Text
+ * than Tk does on X11.
+ */
+
+ if (entryPtr->borderWidth != MAC_OSX_ENTRY_BORDER
+ || entryPtr->highlightWidth != MAC_OSX_FOCUS_WIDTH
+ || entryPtr->relief != MAC_OSX_ENTRY_RELIEF) {
+ return 0;
+ }
+
+ /*
+ * For the spinbox, we have to make the entry part smaller by the size of
+ * the buttons. We also leave 2 pixels to the left (as per the HIG) and
+ * space for one pixel to the right, 'cause it makes the buttons look
+ * nicer.
+ */
+
+ if (isSpinbox) {
+ ThemeButtonKind buttonKind;
+ int incDecWidth;
+
+ oldWidth = Tk_Width(tkwin);
+
+ buttonKind = ComputeIncDecParameters(Tk_Height(tkwin)
+ - 2 * MAC_OSX_FOCUS_WIDTH, &incDecWidth);
+ Tk_Width(tkwin) -= incDecWidth + 1;
+ }
+
+ /*
+ * The focus ring is drawn with an Alpha at the outside part of the ring,
+ * so we have to draw over the edges of the ring before drawing the focus
+ * or the text will peep through.
+ */
+
+ bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, d);
+ TkDrawInsetFocusHighlight(entryPtr->tkwin, bgGC, MAC_OSX_FOCUS_WIDTH, d, 0);
+
+ /*
+ * Inset the entry Frame by the maximum width of the focus rect, which is
+ * 3 according to the Carbon docs.
+ */
+
+ bounds.left = macDraw->xOff + MAC_OSX_FOCUS_WIDTH;
+ bounds.top = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
+ bounds.right = macDraw->xOff + Tk_Width(tkwin) - MAC_OSX_FOCUS_WIDTH;
+ bounds.bottom = macDraw->yOff + Tk_Height(tkwin) - MAC_OSX_FOCUS_WIDTH;
+ if (entryPtr->state == STATE_DISABLED) {
+ drawState = kThemeStateInactive;
+ } else {
+ drawState = kThemeStateActive;
+ }
+ if (!TkMacOSXSetupDrawingContext(d, NULL, 0, &dc)) {
+ return 0;
+ }
+ DrawThemeEditTextFrame(&bounds, drawState);
+ if (entryPtr->flags & GOT_FOCUS) {
+ /*
+ * Don't call this if we don't have the focus, because then it erases
+ * the focus rect to white, but we've already drawn the
+ * highlightbackground above.
+ */
+
+ DrawThemeFocusRect(&bounds, (entryPtr->flags & GOT_FOCUS) != 0);
+ }
+ if (isSpinbox) {
+ Tk_Width(tkwin) = oldWidth;
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+ return 1;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpDrawSpinboxButtons --
+ *
+ * This procedure redraws the buttons of an spinbox widget. It overrides
+ * the generic button drawing code if the spinbox widget parameters are
+ * such that the native widget drawing is a good fit. This version just
+ * returns 0, so platforms that don't do special native drawing don't
+ * have to implement it.
+ *
+ * Results:
+ * 1 if it has drawn the border, 0 if not.
+ *
+ * Side effects:
+ * May draw the entry border into pixmap.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+TkpDrawSpinboxButtons(
+ Spinbox *sbPtr,
+ Drawable d)
+{
+ Rect inBounds;
+ ThemeButtonKind inKind;
+ ThemeButtonDrawInfo inNewInfo;
+ ThemeButtonDrawInfo * inPrevInfo = NULL;
+ ThemeEraseUPP inEraseProc = NULL;
+ ThemeButtonDrawUPP inLabelProc = NULL;
+ UInt32 inUserData = 0;
+ Tk_Window tkwin = sbPtr->entry.tkwin;
+ int height = Tk_Height(tkwin);
+ int buttonHeight = height - 2 * MAC_OSX_FOCUS_WIDTH;
+ int incDecWidth;
+ TkMacOSXDrawingContext dc;
+ XRectangle rects[1];
+ GC bgGC;
+ MacDrawable *macDraw = (MacDrawable *) d;
+
+ /*
+ * FIXME: RAISED really makes more sense
+ */
+
+ if (sbPtr->buRelief != TK_RELIEF_FLAT) {
+ return 0;
+ }
+
+ /*
+ * The actual sizes of the IncDec button are 21 for the normal, 18 for the
+ * small and 15 for the mini. But the spinbox still looks okay if the
+ * entry is a little bigger than this, so we give it a little slop.
+ */
+
+ inKind = ComputeIncDecParameters(buttonHeight, &incDecWidth);
+ if (inKind == (ThemeButtonKind) 0) {
+ return 0;
+ }
+
+ if (sbPtr->entry.state == STATE_DISABLED) {
+ inNewInfo.state = kThemeStateInactive;
+ inNewInfo.value = kThemeButtonOff;
+ } else if (sbPtr->selElement == SEL_BUTTONUP) {
+ inNewInfo.state = kThemeStatePressedUp;
+ inNewInfo.value = kThemeButtonOn;
+ } else if (sbPtr->selElement == SEL_BUTTONDOWN) {
+ inNewInfo.state = kThemeStatePressedDown;
+ inNewInfo.value = kThemeButtonOn;
+ } else {
+ inNewInfo.state = kThemeStateActive;
+ inNewInfo.value = kThemeButtonOff;
+ }
+
+ inNewInfo.adornment = kThemeAdornmentNone;
+
+ inBounds.left = macDraw->xOff + Tk_Width(tkwin) - incDecWidth - 1;
+ inBounds.right = macDraw->xOff + Tk_Width(tkwin) - 1;
+ inBounds.top = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
+ inBounds.bottom = macDraw->yOff + Tk_Height(tkwin) - MAC_OSX_FOCUS_WIDTH;
+
+ /*
+ * We had to make the entry part of the window smaller so that we wouldn't
+ * overdraw the spin buttons with the focus highlight. So now we have to
+ * draw the highlightbackground.
+ */
+
+ bgGC = Tk_GCForColor(sbPtr->entry.highlightBgColorPtr, d);
+ rects[0].x = inBounds.left;
+ rects[0].y = 0;
+ rects[0].width = Tk_Width(tkwin);
+ rects[0].height = Tk_Height(tkwin);
+ XFillRectangles(Tk_Display(tkwin), d, bgGC, rects, 1);
+
+ if (!TkMacOSXSetupDrawingContext(d, NULL, 0, &dc)) {
+ return 0;
+ }
+ ChkErr(DrawThemeButton, &inBounds, inKind, &inNewInfo, inPrevInfo,
+ inEraseProc, inLabelProc, inUserData);
+ TkMacOSXRestoreDrawingContext(&dc);
+ return 1;
+}
diff --git a/carbon/tkMacOSXEvent.c b/carbon/tkMacOSXEvent.c
new file mode 100644
index 0000000..d39a347
--- /dev/null
+++ b/carbon/tkMacOSXEvent.c
@@ -0,0 +1,294 @@
+/*
+ * tkMacOSXEvent.c --
+ *
+ * This file contains the basic Mac OS X Event handling routines.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXFlushWindows --
+ *
+ * This routine flushes all the Carbon windows of the application. It is
+ * called by XSync().
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Flushes all Carbon windows
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void
+TkMacOSXFlushWindows(void)
+{
+ WindowRef wRef = GetWindowList();
+
+ while (wRef) {
+ TK_IF_MAC_OS_X_API (3, HIWindowFlush,
+ ChkErr(HIWindowFlush, wRef);
+ ) TK_ELSE_MAC_OS_X (3,
+ CGrafPtr portPtr = GetWindowPort(wRef);
+
+ if (QDIsPortBuffered(portPtr)) {
+ QDFlushPortBuffer(portPtr, NULL);
+ }
+ ) TK_ENDIF
+ wRef = GetNextWindow(wRef);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessEvent --
+ *
+ * This dispatches a filtered Carbon event to the appropriate handler
+ *
+ * Note on MacEventStatus.stopProcessing: Please be conservative in the
+ * individual handlers and don't assume the event is fully handled unless
+ * you *really* need to ensure that other handlers don't see the event
+ * anymore. Some OS manager or library might be interested in events even
+ * after they are already handled on the Tk level.
+ *
+ * Results:
+ * 0 on success
+ * -1 on failure
+ *
+ * Side effects:
+ * Converts a Carbon event to a Tk event
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE 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 kEventClassAppearance:
+ TkMacOSXProcessAppearanceEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassMenu:
+ TkMacOSXProcessMenuEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassCommand:
+ TkMacOSXProcessCommandEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassFont:
+ TkMacOSXProcessFontEvent(eventPtr, statusPtr);
+ break;
+ default: {
+ TkMacOSXDbgMsg("Unrecognised event: %s",
+ TkMacOSXCarbonEventToAscii(eventPtr->eventRef));
+ break;
+ }
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessMenuEvent --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessMenuEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ int menuContext;
+ OSStatus err;
+ MenuRef menu;
+ MenuItemIndex index;
+
+ switch (eventPtr->eKind) {
+ case kEventMenuBeginTracking:
+ case kEventMenuEndTracking:
+ case kEventMenuOpening:
+ case kEventMenuTargetItem:
+ break;
+ default:
+ return 0;
+ }
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMenuContext, typeUInt32, NULL, sizeof(menuContext),
+ NULL, &menuContext);
+ if (err != noErr) {
+ return 0;
+ }
+
+ if ((menuContext & kMenuContextMenuBarTracking) ||
+ (menuContext & kMenuContextPopUpTracking)) {
+ switch (eventPtr->eKind) {
+ case kEventMenuBeginTracking:
+ TkMacOSXClearMenubarActive();
+
+ /*
+ * Handle -postcommand
+ */
+
+ TkMacOSXPreprocessMenu();
+ TkMacOSXTrackingLoop(1);
+ break;
+ case kEventMenuEndTracking:
+ TkMacOSXTrackingLoop(0);
+ break;
+ case kEventMenuOpening:
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamDirectObject, typeMenuRef, NULL, sizeof(menu),
+ NULL, &menu);
+ if (err != noErr) {
+ return 0;
+ }
+ TkMacOSXClearActiveMenu(menu);
+ return TkMacOSXGenerateParentMenuSelectEvent(menu);
+ case kEventMenuTargetItem:
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamDirectObject, typeMenuRef, NULL, sizeof(menu),
+ NULL, &menu);
+ if (err != noErr) {
+ return 0;
+ }
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMenuItemIndex, typeMenuItemIndex, NULL,
+ sizeof(index), NULL, &index);
+ if (err != noErr) {
+ return 0;
+ }
+ return TkMacOSXGenerateMenuSelectEvent(menu, index);
+ }
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessCommandEvent --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessCommandEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ HICommand command;
+ int menuContext;
+ OSStatus err;
+
+ switch (eventPtr->eKind) {
+ case kEventCommandProcess:
+ case kEventCommandUpdateStatus:
+ break;
+ default:
+ return 0;
+ }
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamDirectObject, typeHICommand, NULL, sizeof(command),
+ NULL, &command);
+ if (err != noErr) {
+ return 0;
+ }
+
+ if (command.attributes & kHICommandFromMenu) {
+ if (eventPtr->eKind == kEventCommandProcess) {
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMenuContext, typeUInt32, NULL,
+ sizeof(menuContext), NULL, &menuContext);
+ if (err != noErr) {
+ return 0;
+ }
+
+ if ((menuContext & kMenuContextMenuBar) &&
+ (menuContext & kMenuContextMenuBarTracking)) {
+ TkMacOSXHandleMenuSelect(GetMenuID(command.menu.menuRef),
+ command.menu.menuItemIndex,
+ (GetCurrentEventKeyModifiers() & optionKey) != 0);
+ return 1;
+ }
+ } else {
+ Tcl_CmdInfo dummy;
+
+ if (command.commandID == kHICommandPreferences
+ && eventPtr->interp != NULL) {
+ if (Tcl_GetCommandInfo(eventPtr->interp,
+ "::tk::mac::ShowPreferences", &dummy)) {
+ if (!IsMenuItemEnabled(command.menu.menuRef,
+ command.menu.menuItemIndex)) {
+ EnableMenuItem(command.menu.menuRef,
+ command.menu.menuItemIndex);
+ }
+ } else {
+ if (IsMenuItemEnabled(command.menu.menuRef,
+ command.menu.menuItemIndex)) {
+ DisableMenuItem(command.menu.menuRef,
+ command.menu.menuItemIndex);
+ }
+ }
+ statusPtr->stopProcessing = 1;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/carbon/tkMacOSXEvent.h b/carbon/tkMacOSXEvent.h
new file mode 100644
index 0000000..dc87b5f
--- /dev/null
+++ b/carbon/tkMacOSXEvent.h
@@ -0,0 +1,107 @@
+/*
+ * tkMacOSXEvent.h --
+ *
+ * Declarations of Macintosh specific functions for implementing the
+ * Mac OS X Notifier.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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
+
+#ifndef _TKMACINT
+#include "tkMacOSXInt.h"
+#endif
+
+typedef struct {
+ int stopProcessing;
+ 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 */
+ Tcl_Interp *interp; /* Interp to handle events in */
+ EventHandlerCallRef callRef;
+} TkMacOSXEvent;
+
+MODULE_SCOPE void TkMacOSXFlushWindows(void);
+MODULE_SCOPE int TkMacOSXProcessEvent(TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessMouseEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessWindowEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessKeyboardEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessApplicationEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessAppearanceEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessMenuEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessCommandEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXProcessFontEvent(TkMacOSXEvent *e,
+ MacEventStatus *statusPtr);
+MODULE_SCOPE int TkMacOSXKeycodeToUnicode(
+ UniChar * uniChars, int maxChars,
+ EventKind eKind,
+ UInt32 keycode, UInt32 modifiers,
+ UInt32 * deadKeyStatePtr);
+
+#endif
diff --git a/carbon/tkMacOSXFont.c b/carbon/tkMacOSXFont.c
new file mode 100644
index 0000000..7933fe3
--- /dev/null
+++ b/carbon/tkMacOSXFont.c
@@ -0,0 +1,2678 @@
+/*
+ * tkMacOSXFont.c --
+ *
+ * Contains the Macintosh implementation of the platform-independant
+ * font package interface. This version uses ATSU instead of Quickdraw.
+ *
+ * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * Some functions were originally copied verbatim from the QuickDraw version
+ * of tkMacOSXFont.c, which had these copyright notices:
+ *
+ * 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.
+ *
+ * Todos:
+ *
+ * - Get away from Font Manager and Quickdraw functions as much as possible,
+ * replace with ATS functions instead.
+ *
+ * - Use Font Manager functions to translate ids from ATS to Font Manager
+ * instead of just assuming that they are the same.
+ *
+ * - Get a second font register going for fonts that are not assigned to a
+ * font family by the OS. On my system I have 27 fonts of that type,
+ * Hebrew, Arabic and Hindi fonts that actually come with the system.
+ * FMGetFontFamilyInstanceFromFont() returns -981 (kFMInvalidFontFamilyErr)
+ * for these and they are not listed when enumerating families, but they
+ * are when enumerating fonts directly. The problem that the OS sees may
+ * be that at least some of them do not contain any Latin characters. Note
+ * that such fonts can not be used for controls, because controls
+ * definitely require a family id (this assertion needs testing).
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXFont.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_FONTS
+#endif
+*/
+
+/*
+ * Problem: The sum of two parts is not the same as the whole. In particular
+ * the width of two separately measured strings will usually be larger than
+ * the width of them pasted together. Tk has a design bug here, because it
+ * generally assumes that this kind of arithmetic works.
+ * To workaround this, #define TK_MAC_COALESCE_LINE to 1 below, we then avoid
+ * lines that tremble and shiver while the cursor passes through them by
+ * undercutting the system and behind the scenes pasting strings together that
+ * look like they are on the same line and adjacent and that are drawn with
+ * the same font. To do this we need some global data.
+ */
+#define TK_MAC_COALESCE_LINE 0
+
+/*
+ * The following structure represents our Macintosh-specific implementation
+ * of a font object.
+ */
+
+typedef struct {
+ TkFont font; /* Stuff used by generic font package. Must
+ * be first in structure. */
+
+ /*
+ * The ATSU view of the font and other text properties. Used for drawing
+ * and measuring.
+ */
+
+ ATSUFontID atsuFontId; /* == FMFont. */
+ ATSUTextLayout atsuLayout; /* ATSU layout object, representing the whole
+ * text that ATSU sees with some option
+ * bits. */
+ ATSUStyle atsuStyle; /* ATSU style object, representing a run of
+ * text with the same properties. */
+
+ /*
+ * The QuickDraw view of the font. Used to configure controls.
+ */
+
+ FMFontFamily qdFont; /* == FMFontFamilyId, Carbon replacement for
+ * QD face numbers. */
+ short qdSize; /* Font size in points. */
+ short qdStyle; /* QuickDraw style bits. */
+} MacFont;
+
+/*
+ * Information about font families, initialized at startup time. Font
+ * families are described by a mapping from UTF-8 names to MacOS font family
+ * IDs. The whole list is kept as the sorted array "familyList", allocated
+ * with ckrealloc().
+ *
+ * Note: This would have been easier, if we could just have used Tcl hash
+ * arrays. Unfortunately there seems to be no pre-packaged
+ * non-case-sensitive version of that available.
+ */
+
+typedef struct {
+ const char * name;
+ FMFontFamily familyId;
+} MacFontFamily;
+
+static MacFontFamily * familyList = NULL;
+static int
+ familyListNextFree = 0, /* The next free slot in familyList. */
+ familyListMaxValid = 0, /* The top of the sorted area. */
+ familyListSize = 0; /* The size of the whole array. */
+
+/*
+ * A simple one-shot sub-allocator for fast and efficient allocation of
+ * strings. Used by the familyList array for the names. These strings are
+ * only allocated once at startup and never freed. If you ever need to
+ * re-initialize this, you can just ckfree() all the StringBlocks in the list
+ * and start over.
+ */
+
+#define STRING_BLOCK_MAX (1024-8) /* Make sizeof(StringBlock) ==
+ * 1024. */
+typedef struct StringBlock {
+ struct StringBlock *next; /* Starting from "stringMemory" these
+ * blocks form a linked list. */
+ int nextFree; /* Top of the used area in the
+ * "strings" member. */
+ char strings[STRING_BLOCK_MAX]; /* The actual memory managed here. */
+} StringBlock;
+
+static StringBlock *stringMemory = NULL;
+
+#if TK_MAC_COALESCE_LINE
+static Tcl_DString currentLine; /* The current line as seen so far. This
+ * contains a Tcl_UniChar DString. */
+static int
+ currentY = -1, /* The Y position (row in pixels) of the
+ * current line. */
+ currentLeft = -1, /* The left edge (pixels) of the current
+ * line. */
+ currentRight = -1; /* The right edge (pixels) of the current
+ * line. */
+static const MacFont *currentFontPtr = NULL;
+ /* The font of the current line. */
+#endif /* TK_MAC_COALESCE_LINE */
+
+static int antialiasedTextEnabled;
+
+/*
+ * The names for our "native" fonts.
+ */
+
+#define SYSTEMFONT_NAME "system"
+#define APPLFONT_NAME "application"
+#define MENUITEMFONT_NAME "menu"
+
+struct SystemFontMapEntry {
+ const ThemeFontID id;
+ const char *systemName;
+ const char *tkName;
+ const char *tkName1;
+};
+
+#define ThemeFont(n, ...) { kTheme##n##Font, "system" #n "Font", ##__VA_ARGS__ }
+static const struct SystemFontMapEntry systemFontMap[] = {
+ ThemeFont(System, "TkDefaultFont", "TkIconFont"),
+ ThemeFont(EmphasizedSystem, "TkCaptionFont"),
+ ThemeFont(SmallSystem, "TkHeadingFont", "TkTooltipFont"),
+ ThemeFont(SmallEmphasizedSystem),
+ ThemeFont(Application, "TkTextFont"),
+ ThemeFont(Label, "TkSmallCaptionFont"),
+ ThemeFont(Views),
+ ThemeFont(MenuTitle),
+ ThemeFont(MenuItem, "TkMenuFont"),
+ ThemeFont(MenuItemMark),
+ ThemeFont(MenuItemCmdKey),
+ ThemeFont(WindowTitle),
+ ThemeFont(PushButton),
+ ThemeFont(UtilityWindowTitle),
+ ThemeFont(AlertHeader),
+ ThemeFont(Toolbar),
+ ThemeFont(MiniSystem),
+ { kThemeSystemFontDetail, "systemDetailSystemFont" },
+ { kThemeSystemFontDetailEmphasized, "systemDetailEmphasizedSystemFont" },
+ { -1, NULL }
+};
+#undef ThemeFont
+
+/*
+ * Procedures used only in this file.
+ */
+
+static void LayoutSetString(const MacFont *fontPtr,
+ const TkMacOSXDrawingContext *drawingContextPtr,
+ const UniChar * uchars, int ulen);
+
+/*
+ * The actual workers.
+ */
+
+static int MeasureStringWidth(const MacFont *fontPtr, int start, int end);
+
+#if TK_MAC_COALESCE_LINE
+static const Tcl_UniChar *UpdateLineBuffer(const MacFont *fontPtr,
+ const TkMacOSXDrawingContext *drawingContextPtr, const char *source,
+ int numBytes, int x, int y, int * offset);
+#endif /* TK_MAC_COALESCE_LINE */
+
+/*
+ * Initialization and setup of a font data structure.
+ */
+
+static const char *FamilyNameForFamilyID(FMFontFamily familyId);
+static void InitFont(FMFontFamily familyId, const char *familyName,
+ int size, int qdStyle, MacFont *fontPtr);
+static void InitATSUObjects(FMFontFamily familyId, short qdsize, short qdStyle,
+ ATSUFontID *fontIdPtr, ATSUTextLayout *layoutPtr, ATSUStyle *stylePtr);
+static void InitATSUStyle(ATSUFontID fontId, short ptSize, short qdStyle,
+ ATSUStyle style);
+static void SetFontFeatures(ATSUFontID fontId, int fixed, short size,
+ ATSUStyle style);
+static void AdjustFontHeight(MacFont *fontPtr);
+static void InitATSULayout(const TkMacOSXDrawingContext *drawingContextPtr,
+ ATSUTextLayout layout, int fixed);
+static void ReleaseFont(MacFont *fontPtr);
+
+/*
+ * Finding fonts by name.
+ */
+
+static const MacFontFamily *FindFontFamilyOrAlias(const char *name);
+static const MacFontFamily *FindFontFamilyOrAliasOrFallback(const char *name);
+
+/*
+ * Doing interesting things with font families and fonts.
+ */
+
+static void InitFontFamilies(void);
+static OSStatus GetFontFamilyName(FMFontFamily fontFamily, char *name,
+ int numBytes);
+
+/*
+ * Accessor functions and internal utilities for the font family list.
+ */
+
+static const MacFontFamily *AddFontFamily(const char *name,
+ FMFontFamily familyId);
+static const MacFontFamily *FindFontFamily(const char *name);
+static Tcl_Obj *EnumFontFamilies(void);
+
+static OSStatus FontFamilyEnumCallback(ATSFontFamilyRef family, void *refCon);
+static void SortFontFamilies(void);
+static int CompareFontFamilies(const void *vp1, const void *vp2);
+static const char *AddString(const char *in);
+
+static OSStatus GetThemeFontAndFamily(const ThemeFontID themeFontId,
+ FMFontFamily *fontFamily, unsigned char *fontName, SInt16 *fontSize,
+ Style *fontStyle);
+static void InitSystemFonts(TkMainInfo *mainPtr);
+static int CreateNamedSystemFont(Tcl_Interp *interp, Tk_Window tkwin,
+ const char* name, TkFontAttributes *faPtr);
+static void DrawCharsInContext(Display *display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ const char *source, int numBytes, int rangeStart,
+ int rangeLength, int x, int y, double angle);
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * 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:
+ * Initialization of variables local to this file.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+TkpFontPkgInit(
+ TkMainInfo *mainPtr) /* The application being created. */
+{
+ InitFontFamilies();
+ InitSystemFonts(mainPtr);
+
+#if TK_MAC_COALESCE_LINE
+ Tcl_DStringInit(&currentLine);
+#endif
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * InitSystemFonts --
+ *
+ * Initialize named system fonts.
+ *
+ * Results:
+ *
+ * None.
+ *
+ * Side effects:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+InitSystemFonts(
+ TkMainInfo *mainPtr)
+{
+ Tcl_Interp *interp = mainPtr->interp;
+ Tk_Window tkwin = (Tk_Window) mainPtr->winPtr;
+ const struct SystemFontMapEntry *systemFont = systemFontMap;
+ TkFontAttributes fa;
+
+ /* force this for now */
+ if (!mainPtr->winPtr->mainPtr) {
+ mainPtr->winPtr->mainPtr = mainPtr;
+ }
+ TkInitFontAttributes(&fa);
+ while (systemFont->systemName) {
+ Str255 fontName;
+ SInt16 fontSize;
+ Style fontStyle;
+
+ if (GetThemeFont(systemFont->id, smSystemScript, fontName,
+ &fontSize, &fontStyle) == noErr) {
+ CopyPascalStringToC(fontName, (char*)fontName);
+ fa.family = Tk_GetUid((char*)fontName);
+ fa.size = fontSize;
+ fa.weight = (fontStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
+ fa.slant = (fontStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
+ fa.underline = ((fontStyle & underline) != 0);
+ CreateNamedSystemFont(interp, tkwin, systemFont->systemName, &fa);
+ if (systemFont->tkName) {
+ CreateNamedSystemFont(interp, tkwin, systemFont->tkName, &fa);
+ }
+ if (systemFont->tkName1) {
+ CreateNamedSystemFont(interp, tkwin, systemFont->tkName1, &fa);
+ }
+ }
+ systemFont++;
+ }
+ fa.family = Tk_GetUid("monaco");
+ fa.size = 11;
+ fa.weight = TK_FW_NORMAL;
+ fa.slant = TK_FS_ROMAN;
+ fa.underline = 0;
+ CreateNamedSystemFont(interp, tkwin, "TkFixedFont", &fa);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * CreateNamedSystemFont --
+ *
+ * Register a system font with the Tk named font mechanism.
+ *
+ * Results:
+ *
+ * Result from TkCreateNamedFont().
+ *
+ * Side effects:
+ *
+ * A new named font is added to the Tk font registry.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+CreateNamedSystemFont(
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ const char* name,
+ TkFontAttributes *faPtr)
+{
+ TkDeleteNamedFont(NULL, tkwin, name);
+ return TkCreateNamedFont(interp, tkwin, name, faPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * GetThemeFontAndFamily --
+ *
+ * Wrapper around the GetThemeFont and FMGetFontFamilyFromName APIs.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+OSStatus
+GetThemeFontAndFamily(
+ const ThemeFontID themeFontId,
+ FMFontFamily* fontFamily,
+ unsigned char *fontName,
+ SInt16 *fontSize,
+ Style *fontStyle)
+{
+ OSStatus err = ChkErr(GetThemeFont, themeFontId, smSystemScript, fontName,
+ fontSize, fontStyle);
+
+ if (err == noErr) {
+ *fontFamily = FMGetFontFamilyFromName(fontName);
+ if (*fontFamily == kInvalidFontFamily) {
+ err = kFMInvalidFontFamilyErr;
+ TkMacOSXDbgMsg("FMGetFontFamilyFromName failed.");
+ }
+ }
+
+ return err;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * 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. */
+{
+ ThemeFontID themeFontId;
+ FMFontFamily fontFamily;
+ Str255 fontName;
+ SInt16 fontSize;
+ Style fontStyle;
+ MacFont *fontPtr;
+
+ if (strcmp(name, SYSTEMFONT_NAME) == 0) {
+ themeFontId = kThemeSystemFont;
+ } else if (strcmp(name, APPLFONT_NAME) == 0) {
+ themeFontId = kThemeApplicationFont;
+ } else if (strcmp(name, MENUITEMFONT_NAME) == 0) {
+ themeFontId = kThemeMenuItemFont;
+ } else {
+ return NULL;
+ }
+ if (GetThemeFontAndFamily(themeFontId, &fontFamily, fontName, &fontSize,
+ &fontStyle) != noErr) {
+ return NULL;
+ }
+ CopyPascalStringToC(fontName, (char*)fontName);
+
+ fontPtr = ckalloc(sizeof(MacFont));
+ InitFont(fontFamily, (char*)fontName, fontSize, fontStyle, 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 qdStyle;
+ FMFontFamily familyId;
+ const char *name;
+ const MacFontFamily *familyPtr;
+ MacFont *fontPtr;
+
+ familyId = GetAppFont();
+ name = NULL;
+ qdStyle = 0;
+
+ if (faPtr->family != NULL) {
+ familyPtr = FindFontFamilyOrAliasOrFallback(faPtr->family);
+ if (familyPtr != NULL) {
+ name = familyPtr->name;
+ familyId = familyPtr->familyId;
+ }
+ }
+
+ if (faPtr->weight != TK_FW_NORMAL) {
+ qdStyle |= bold;
+ }
+ if (faPtr->slant != TK_FS_ROMAN) {
+ qdStyle |= italic;
+ }
+ if (faPtr->underline) {
+ qdStyle |= underline;
+ }
+ if (tkFontPtr == NULL) {
+ fontPtr = ckalloc(sizeof(MacFont));
+ } else {
+ fontPtr = (MacFont *) tkFontPtr;
+ ReleaseFont(fontPtr);
+ }
+ InitFont(familyId, name, TkFontGetPoints(tkwin, faPtr->size),
+ qdStyle, 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:
+ * TkFont is deallocated.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkpDeleteFont(
+ TkFont *tkFontPtr) /* Token of font to be deleted. */
+{
+ ReleaseFont((MacFont *) tkFontPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * 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. */
+{
+ Tcl_SetObjResult(interp, EnumFontFamilies());
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * 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(
+ Tcl_Interp *interp, /* Interp to hold result. */
+ Tk_Font tkfont) /* Font object to query. */
+{
+ /* We don't know much about our fallback fonts, ATSU does all that for
+ * us. We could use ATSUMatchFont to implement this function. But as
+ * the information is only used for testing, such an effort seems not
+ * very useful. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetFontAttrsForChar --
+ *
+ * Retrieve the font attributes of the actual font used to render a
+ * given character.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The font attributes are stored in *faPtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpGetFontAttrsForChar(
+ Tk_Window tkwin, /* Window on the font's display */
+ Tk_Font tkfont, /* Font to query */
+ Tcl_UniChar c, /* Character of interest */
+ TkFontAttributes* faPtr) /* Output: Font attributes */
+{
+ const MacFont * fontPtr = (const MacFont *) tkfont;
+ UniChar uchar = c;
+ TkMacOSXDrawingContext drawingContext;
+ OSStatus err;
+ ATSUFontID fontId;
+ UniCharArrayOffset changedOffset;
+ UniCharCount changedLength;
+
+ /*
+ * Most of the attributes are just copied from the base font. This
+ * assumes that all fonts can have all attributes.
+ */
+
+ *faPtr = fontPtr->font.fa;
+
+ /*
+ * But the name of the actual font may still differ, so we activate the
+ * string as an ATSU layout and ask ATSU about the fallback.
+ */
+ if (!TkMacOSXSetupDrawingContext(Tk_WindowId(tkwin), NULL, 1,
+ &drawingContext)) {
+ Tcl_Panic("TkpGetFontAttrsForChar: drawingContext not setup");
+ }
+
+ LayoutSetString(fontPtr, &drawingContext, &uchar, 1);
+
+ fontId = fontPtr->atsuFontId;
+ err = ATSUMatchFontsToText(
+ fontPtr->atsuLayout, 0, 1,
+ &fontId, &changedOffset, &changedLength);
+ if (err != kATSUFontsMatched && err != noErr) {
+ TkMacOSXDbgMsg("Can't match \\u%04X", (unsigned) c);
+ }
+
+ if (err == kATSUFontsMatched) {
+ /*
+ * A fallback was used and the actual font is in fontId. Determine
+ * the name.
+ */
+
+ FMFontFamily fontFamilyId;
+ FMFontStyle fontStyle;
+ int i;
+
+ err = ChkErr(FMGetFontFamilyInstanceFromFont, fontId, &fontFamilyId,
+ &fontStyle);
+ if (err == noErr) {
+ /*
+ * Find the canonical name in our global list.
+ */
+
+ for (i=0; i<familyListMaxValid; ++i) {
+ if (fontFamilyId == familyList[i].familyId) {
+ faPtr->family = familyList[i].name;
+ break;
+ }
+ }
+ if (i >= familyListMaxValid) {
+ TkMacOSXDbgMsg("Can't find font %d for \\u%04X", fontFamilyId,
+ (unsigned) c);
+ }
+ }
+ }
+
+ TkMacOSXRestoreDrawingContext(&drawingContext);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * 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.
+ *
+ * With ATSUI we need the line context to do this right, so we have the
+ * actual implementation in TkpMeasureCharsInContext().
+ *
+ * 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.
+ *
+ * Todo:
+ * Effects of the "flags" parameter are untested.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+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. */
+{
+ return TkpMeasureCharsInContext(tkfont, source, numBytes, 0, numBytes,
+ maxLength, flags, lengthPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpMeasureCharsInContext --
+ *
+ * Determine the number of bytes from the string that will fit in the
+ * given horizontal span. The measurement is done under the assumption
+ * that TkpDrawCharsInContext() will be used to actually display the
+ * characters.
+ *
+ * This one is almost the same as Tk_MeasureChars(), but with access to
+ * all the characters on the line for context.
+ *
+ * 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
+TkpMeasureCharsInContext(
+ 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 in all. */
+ int rangeStart, /* Index of first byte to measure. */
+ int rangeLength, /* Length of range to measure in bytes. */
+ 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 fits 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. If TK_WHOLE_WORDS
+ * and TK_AT_LEAST_ONE are set and the first
+ * word doesn't fit, we return at least one
+ * character or whatever characters fit into
+ * maxLength. TK_ISOLATE_END means that the
+ * last character should not be considered in
+ * context with the rest of the string (used
+ * for breaking lines). */
+ int *lengthPtr) /* Filled with x-location just after the
+ * terminating character. */
+{
+ const MacFont *fontPtr = (const MacFont *) tkfont;
+ int curX = -1, curByte = 0;
+ UniChar *uchars;
+ int ulen;
+ UniCharArrayOffset urstart, urlen, urend;
+ Tcl_DString ucharBuffer;
+ int forceCharacterMode = 0;
+
+ /*
+ * Sanity checks.
+ */
+
+ if (rangeStart < 0 || (rangeStart+rangeLength) > numBytes) {
+ TkMacOSXDbgMsg("Bad parameters");
+ *lengthPtr = 0;
+ return 0;
+ }
+
+ /*
+ * Get simple no-brainers out of the way.
+ */
+
+ if (rangeLength == 0 || (maxLength == 0 && !(flags & TK_AT_LEAST_ONE))) {
+ *lengthPtr = 0;
+ return 0;
+ }
+
+ Tcl_DStringInit(&ucharBuffer);
+ uchars = Tcl_UtfToUniCharDString(source, numBytes, &ucharBuffer);
+ ulen = Tcl_DStringLength(&ucharBuffer) / sizeof(Tcl_UniChar);
+ LayoutSetString(fontPtr, NULL, uchars, ulen);
+
+ urstart = Tcl_NumUtfChars(source, rangeStart);
+ urlen = Tcl_NumUtfChars(source+rangeStart,rangeLength);
+ urend = urstart + urlen;
+
+ if (maxLength < 0) {
+ curX = MeasureStringWidth(fontPtr, urstart, urend);
+ curByte = rangeLength;
+ } else {
+ UniCharArrayOffset offset = 0;
+ OSStatus err;
+
+ /*
+ * Have some upper limit on the size actually used.
+ */
+
+ if (maxLength > 32767) {
+ maxLength = 32767;
+ }
+
+ offset = urstart;
+ err = noErr;
+
+ if (maxLength > 1) {
+ /*
+ * Let the system do some work by calculating a line break.
+ *
+ * Somehow ATSUBreakLine seems to assume that it needs at least
+ * one pixel padding. So we add one to the limit. Note also
+ * that ATSUBreakLine sometimes runs into an endless loop when
+ * the third parameter is equal or less than IntToFixed(2), so we
+ * need at least IntToFixed(3) (at least that's the current state
+ * of my knowledge).
+ */
+
+ err = ATSUBreakLine(fontPtr->atsuLayout, urstart,
+ IntToFixed(maxLength+1), false, /* !iUseAsSoftLineBreak */
+ &offset);
+
+ /*
+ * There is no way to signal an error from this routine, so we
+ * use predefined offset=urstart and otherwise ignore the
+ * possibility.
+ */
+
+ if ((err != noErr) && (err != kATSULineBreakInWord)) {
+ TkMacOSXDbgMsg("ATSUBreakLine failed: %ld for '%.*s'", err,
+ rangeLength, source+rangeStart);
+ }
+
+#ifdef TK_MAC_DEBUG_FONTS
+ TkMacOSXDbgMsg("measure: '%.*s', break offset=%ld, errcode=%ld",
+ rangeLength, source+rangeStart, offset, err);
+#endif
+
+ /*
+ * ATSUBreakLine includes the whitespace that separates words,
+ * but we don't want that. Besides, ATSUBreakLine thinks that
+ * spaces don't occupy pixels at the end of the break, which is
+ * also something we like to decide for ourself.
+ */
+
+ while ((offset > urstart) && (uchars[offset-1] == ' ')) {
+ offset--;
+ }
+ }
+
+ /*
+ * Fix up left-overs for the TK_WHOLE_WORDS case.
+ */
+
+ if (flags & TK_WHOLE_WORDS) {
+ if ((flags & TK_AT_LEAST_ONE) && ((offset == urstart)
+ || ((offset != urend) && (uchars[offset] != ' ')))) {
+ /*
+ * With TK_AT_LEAST_ONE, if we are the the start of the
+ * range, we need to add at least one character. If we are
+ * not at the end of a word, we must be in the middle of the
+ * first word still and we want to just use what we have so
+ * far. In both cases we still need to find the right
+ * character boundary, so we set a flag that gets us into the
+ * code for character mode below.
+ */
+
+ forceCharacterMode = 1;
+
+ } else {
+ /*
+ * If we are not at the end of a word, we must be in the
+ * middle of the first word still. Return 0.
+ */
+
+ if ((offset != urend) && (uchars[offset] != ' ')) {
+ offset = urstart;
+ curX = 0;
+ }
+ }
+ }
+
+ if (offset > urend) {
+ offset = urend;
+ }
+
+ /*
+ * If "flags" says that we don't actually want a word break, we need
+ * to find the next character break ourself, as ATSUBreakLine will
+ * only give us word breaks. Do a simple linear search.
+ *
+ * Even do this, if ATSUBreakLine returned kATSULineBreakInWord,
+ * because we have not accounted correctly for all of the flags yet,
+ * like TK_AT_LEAST_ONE.
+ */
+
+ if ((!(flags & TK_WHOLE_WORDS) || forceCharacterMode) && (offset <= urend)) {
+ UniCharArrayOffset lastOffset = offset;
+ UniCharArrayOffset nextoffset;
+ int lastX = -1;
+ int wantonemorechar = -1; /* undecided */
+
+ while (offset <= urend) {
+ if (flags & TK_ISOLATE_END) {
+ LayoutSetString(fontPtr, NULL, uchars, offset);
+ }
+ curX = MeasureStringWidth(fontPtr, urstart, offset);
+
+#ifdef TK_MAC_DEBUG_FONTS
+ TkMacOSXDbgMsg("measure: '%.*s', try until=%ld, width=%d",
+ rangeLength, source+rangeStart, offset, curX);
+#endif
+
+ if (curX > maxLength) {
+ /*
+ * Even if we are over the limit, we may want another
+ * character in some situations. Than we keep looking
+ * for one more character.
+ */
+
+ if (wantonemorechar == -1) {
+ wantonemorechar = ((flags & TK_AT_LEAST_ONE) &&
+ (lastOffset == urstart)) ||
+ ((flags & TK_PARTIAL_OK) &&
+ (lastX != maxLength));
+ if (!wantonemorechar) {
+ break;
+ }
+ lastX = curX;
+ }
+
+ /*
+ * There may belong combining marks to this character.
+ * Wait for a new curX to collect them all.
+ */
+
+ if (lastX != curX) {
+ break;
+ }
+ }
+
+ /*
+ * Save this position, so we can come back to it.
+ */
+
+ lastX = curX;
+ lastOffset = offset;
+
+ /*
+ * Increment offset by one character, taking combining marks
+ * into account.
+ */
+
+ if (offset >= urend) {
+ break;
+ }
+ nextoffset = 0;
+ if (flags & TK_ISOLATE_END) {
+ LayoutSetString(fontPtr, NULL, uchars, ulen);
+ }
+ err = ChkErr(ATSUNextCursorPosition, fontPtr->atsuLayout,
+ offset, kATSUByCluster, &nextoffset);
+ if (err != noErr) {
+ break;
+ }
+ if (nextoffset <= offset) {
+#ifdef TK_MAC_DEBUG_FONTS
+ TkMacOSXDbgMsg("ATSUNextCursorPosition: Can't move further"
+ " (shouldn't happen, bad data?)");
+#endif
+ break;
+ }
+
+ offset = nextoffset;
+ }
+
+ /*
+ * We have overshot one character, so backup one position.
+ */
+
+ curX = lastX;
+ offset = lastOffset;
+ }
+
+ if (curX < 0) {
+ if (flags & TK_ISOLATE_END) {
+ LayoutSetString(fontPtr, NULL, uchars, offset);
+ }
+ curX = MeasureStringWidth(fontPtr, urstart, offset);
+ }
+
+ curByte = Tcl_UtfAtIndex(source, offset) - source;
+ curByte -= rangeStart;
+ }
+
+ Tcl_DStringFree(&ucharBuffer);
+
+#ifdef TK_MAC_DEBUG_FONTS
+ TkMacOSXDbgMsg("measure: '%.*s', maxLength=%d, flags=%s%s%s%s "
+ "-> width=%d, bytes=%d",
+ rangeLength, source+rangeStart, maxLength,
+ flags & TK_PARTIAL_OK ? "partialOk " : "",
+ flags & TK_WHOLE_WORDS ? "wholeWords " : "",
+ flags & TK_AT_LEAST_ONE ? "atLeastOne " : "",
+ flags & TK_ISOLATE_END ? "isolateEnd " : "",
+ curX, curByte);
+#endif
+
+ *lengthPtr = curX;
+ return curByte;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_DrawChars --
+ *
+ * Draw a string of characters on the screen.
+ *
+ * With ATSUI we need the line context to do this right, so we have the
+ * actual implementation in TkpDrawCharsInContext().
+ *
+ * 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 the
+ * string when drawing. */
+{
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ 0, numBytes, x, y, 0.0);
+}
+
+void
+TkDrawAngledChars(
+ 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. */
+ double x, double y, /* Coordinates at which to place origin of
+ * string when drawing. */
+ double angle) /* What angle to put text at, in degrees. */
+{
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ 0, numBytes, x, y, angle);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpDrawCharsInContext --
+ *
+ * Draw a string of characters on the screen like Tk_DrawChars(), with
+ * access to all the characters on the line for context.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Information gets drawn on the screen.
+ *
+ * Todo:
+ * Stippled text drawing.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkpDrawCharsInContext(
+ 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 rangeStart, /* Index of first byte to draw. */
+ int rangeLength, /* Length of range to draw in bytes. */
+ int x, int y) /* Coordinates at which to place origin of the
+ * whole (not just the range) string when
+ * drawing. */
+{
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ rangeStart, rangeLength, x, y, 0.0);
+}
+
+static void
+DrawCharsInContext(
+ 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 rangeStart, /* Index of first byte to draw. */
+ int rangeLength, /* Length of range to draw in bytes. */
+ int x, int y, /* Coordinates at which to place origin of the
+ * whole (not just the range) string when
+ * drawing. */
+ double angle)
+{
+ const MacFont * fontPtr = (const MacFont *) tkfont;
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ Fixed fx, fy;
+ int ulen, urstart, urlen;
+ const UniChar * uchars;
+ int lineOffset;
+ TkMacOSXDrawingContext drawingContext;
+#if !TK_MAC_COALESCE_LINE
+ Tcl_DString runString;
+#endif
+
+ if (!TkMacOSXSetupDrawingContext(drawable, gc, tkMacOSXUseCGDrawing,
+ &drawingContext)) {
+ return;
+ }
+
+#if 0
+ /*
+ * TODO: implement stippled text drawing
+ */
+
+ if ((gc->fill_style == FillStippled
+ || gc->fill_style == FillOpaqueStippled)
+ && gc->stipple != None) {
+ #error Stippling not implemented
+ }
+#endif
+
+ x += macWin->xOff;
+ y += macWin->yOff;
+ /* Turn the y coordinate upside-down for Quarz drawing. */
+ if (drawingContext.context) {
+ CGContextConcatCTM(drawingContext.context, CGAffineTransformMake(1.0,
+ 0.0, 0.0, -1.0, 0.0, drawingContext.portBounds.bottom -
+ drawingContext.portBounds.top));
+ y = drawingContext.portBounds.bottom -
+ drawingContext.portBounds.top - y;
+ }
+ fy = IntToFixed(y);
+
+#if TK_MAC_COALESCE_LINE
+ UpdateLineBuffer(
+ fontPtr, &drawingContext, source, numBytes, x, y, &lineOffset);
+
+ fx = IntToFixed(currentLeft);
+
+ uchars = (const Tcl_UniChar*) Tcl_DStringValue(&currentLine);
+ ulen = Tcl_DStringLength(&currentLine) / sizeof(uchars[0]);
+#else
+ lineOffset = 0;
+ fx = IntToFixed(x);
+
+ Tcl_DStringInit(&runString);
+ uchars = Tcl_UtfToUniCharDString(source, numBytes, &runString);
+ ulen = Tcl_DStringLength(&runString) / sizeof(uchars[0]);
+
+ LayoutSetString(fontPtr, &drawingContext, uchars, ulen);
+#endif
+
+ urstart = Tcl_NumUtfChars(source, rangeStart);
+ urlen = Tcl_NumUtfChars(source+rangeStart,rangeLength);
+
+ /*
+ * Rotate the coordinate system for Quarz drawing.
+ */
+
+ if (drawingContext.context && angle != 0.0) {
+ CGContextConcatCTM(drawingContext.context, CGAffineTransformTranslate(
+ CGAffineTransformRotate(CGAffineTransformMakeTranslation(
+ x, y), angle * PI/180.0), -x, -y));
+ }
+
+ ChkErr(ATSUDrawText, fontPtr->atsuLayout, lineOffset+urstart, urlen, fx,
+ fy);
+
+#if !TK_MAC_COALESCE_LINE
+ Tcl_DStringFree(&runString);
+#endif
+
+ TkMacOSXRestoreDrawingContext(&drawingContext);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * MeasureStringWidth --
+ *
+ * Low-level measuring of strings.
+ *
+ * Results:
+ * The width of the string in pixels.
+ *
+ * Side effects:
+ * None.
+ *
+ * Assumptions:
+ * fontPtr->atsuLayout is setup with the actual string data to measure.
+ *
+ *---------------------------------------------------------------------------
+ */
+static int
+MeasureStringWidth(
+ const MacFont *fontPtr, /* Contains font, ATSU layout and string data
+ * to measure. */
+ int start, int end) /* Start and end positions to measure in that
+ * string. */
+{
+ /*
+ * This implementation of measuring via ATSUGetGlyphBounds() does not
+ * quite conform with the specification given for [font measure]:
+ *
+ * The return value is the total width in pixels of text, not
+ * including the extra pixels used by highly exagerrated characters
+ * such as cursive "f".
+ *
+ * Instead the result of ATSUGetGlyphBounds() *does* include these
+ * "extra pixels".
+ */
+
+ ATSTrapezoid bounds;
+ ItemCount numBounds;
+
+ if (end <= start) {
+ return 0;
+ }
+
+ bounds.upperRight.x = bounds.upperLeft.x = 0;
+ ChkErr(ATSUGetGlyphBounds, fontPtr->atsuLayout, 0, 0, start, end-start,
+ kATSUseFractionalOrigins, 1, &bounds, &numBounds);
+#ifdef TK_MAC_DEBUG_FONTS
+ if (numBounds < 1 || numBounds > 1) {
+ TkMacOSXDbgMsg("ATSUGetGlyphBounds: %s output",
+ numBounds < 1 ? "No " : "More");
+ }
+#endif
+
+ return FixedToInt(bounds.upperRight.x - bounds.upperLeft.x);
+}
+
+#if TK_MAC_COALESCE_LINE
+/*
+ *-------------------------------------------------------------------------
+ *
+ * UpdateLineBuffer --
+ *
+ * See the general dicussion of TK_MAC_COALESCE_LINE on the header
+ * pages. This function maintains the data for this feature.
+ *
+ * Results:
+ *
+ * The Tcl_UniChar string of the whole line as seen so far.
+ *
+ * Side effects:
+ * "*offset" is filled with the index of the first new character in
+ * "currentLine". The globals currentLine, currentY, currentLeft,
+ * currentRight and currentFontPtr are updated as necessary.
+ *
+ * The currentLine string is set as the current text in
+ * fontPtr->atsuLayout (see LayoutSetString()).
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static const Tcl_UniChar *
+UpdateLineBuffer(
+ const MacFont *fontPtr, /* The font to be used for the new piece of
+ * text. */
+ const TkMacOSXDrawingContext *drawingContextPtr,
+ /* The Quarz drawing parameters. Needed for
+ * measuring the new piece. */
+ const char *source, /* A new piece of line to be added. */
+ int numBytes, /* Length of the new piece. */
+ int x, int y, /* Position of the new piece in the window. */
+ int *offset) /* Filled with the offset of the new piece in
+ * currentLine. */
+{
+ const Tcl_UniChar * uchars;
+ int ulen;
+
+ if (y != currentY
+ || x < currentRight-1 || x > currentRight+2
+ || currentFontPtr != fontPtr) {
+ Tcl_DStringFree(&currentLine);
+ Tcl_DStringInit(&currentLine);
+ currentY = y;
+ currentLeft = x;
+ currentFontPtr = fontPtr;
+ *offset = 0;
+ } else {
+ *offset = Tcl_DStringLength(&currentLine) / 2;
+ }
+
+ Tcl_UtfToUniCharDString(source, numBytes, &currentLine);
+ uchars = (const Tcl_UniChar*) Tcl_DStringValue(&currentLine);
+ ulen = Tcl_DStringLength(&currentLine) / sizeof(*uchars);
+ LayoutSetString(fontPtr, drawingContextPtr, uchars, ulen);
+ currentRight = x + MeasureStringWidth(fontPtr, *offset, ulen);
+
+ return uchars;
+}
+#endif /* TK_MAC_COALESCE_LINE */
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FamilyNameForFamilyID --
+ *
+ * Helper for InitFont() and TkMacOSXFontDescriptionForFMFontInfo().
+ * Retrieves font family names for a given font family ID.
+ *
+ * Results:
+ * Font family name or NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static const char *
+FamilyNameForFamilyID(
+ FMFontFamily familyId)
+{
+ OSStatus err;
+ char name[256] = "";
+ const MacFontFamily * familyPtr = NULL;
+
+ err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name));
+ if (err == noErr) {
+ /*
+ * We find the canonical font name, so we can avoid unnecessary
+ * memory management.
+ */
+
+ familyPtr = FindFontFamily(name);
+#ifdef TK_MAC_DEBUG_FONTS
+ if (!familyPtr) {
+ TkMacOSXDbgMsg("Font family '%s' not found", name);
+ }
+#endif
+ }
+ return familyPtr ? familyPtr->name : NULL;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * 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(
+ FMFontFamily familyId, /* The font family to initialize for. */
+ const char * familyName, /* The font family name, if known. Otherwise
+ * this can be NULL. */
+ int size, /* Point size for the font. */
+ int qdStyle, /* QuickDraw style bits. */
+ MacFont * fontPtr) /* Filled with information constructed from the
+ * above arguments. */
+{
+ FontInfo fi;
+ TkFontAttributes * faPtr;
+ TkFontMetrics * fmPtr;
+ int periodWidth, wWidth;
+
+ if (size == 0) {
+ size = GetDefFontSize();
+ }
+ ChkErr(FetchFontInfo, familyId, size, qdStyle, &fi);
+ if (!familyName) {
+ familyName = FamilyNameForFamilyID(familyId);
+ }
+
+ fontPtr->font.fid = (Font) fontPtr;
+
+ faPtr = &fontPtr->font.fa;
+ faPtr->family = familyName;
+ faPtr->size = size;
+ faPtr->weight = (qdStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
+ faPtr->slant = (qdStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
+ faPtr->underline = ((qdStyle & underline) != 0);
+ faPtr->overstrike = 0;
+
+ fmPtr = &fontPtr->font.fm;
+
+ /*
+ * Note: Macs measure the line height as ascent + descent +
+ * leading. Leading as a separate entity does not exist in X11
+ * and Tk. We add it to the ascent at the moment, because adding
+ * it to the descent, as the Mac docs would indicate, would change
+ * the position of self-drawn underlines.
+ */
+
+ fmPtr->ascent = fi.ascent + fi.leading;
+ fmPtr->descent = fi.descent;
+ fmPtr->maxWidth = fi.widMax;
+
+ fontPtr->qdFont = familyId;
+ fontPtr->qdSize = size;
+ fontPtr->qdStyle = (short) qdStyle;
+
+ InitATSUObjects(familyId, size, qdStyle, &fontPtr->atsuFontId,
+ &fontPtr->atsuLayout, &fontPtr->atsuStyle);
+
+ Tk_MeasureChars((Tk_Font)fontPtr, ".", 1, -1, 0, &periodWidth);
+ Tk_MeasureChars((Tk_Font)fontPtr, "W", 1, -1, 0, &wWidth);
+ fmPtr->fixed = periodWidth == wWidth;
+
+ SetFontFeatures(fontPtr->atsuFontId, fmPtr->fixed, size,
+ fontPtr->atsuStyle);
+
+ AdjustFontHeight(fontPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitATSUObjects --
+ *
+ * Helper for InitFont(). Initializes the ATSU data handles for a
+ * MacFont.
+ *
+ * Results:
+ * Sets up all we know and can do at this point in time in fontIdPtr,
+ * layoutPtr and stylePtr.
+ *
+ * Side effects:
+ * Allocates data structures inside of ATSU.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitATSUObjects(
+ FMFontFamily familyId, /* The font family to use. */
+ short ptSize, short qdStyles,
+ /* The additional font parameters. */
+ ATSUFontID *fontIdPtr, /* Filled with the font id. */
+ ATSUTextLayout *layoutPtr, /* Filled with the ATSU layout handle. */
+ ATSUStyle *stylePtr) /* Filled with the ATSU style handle,
+ * configured with all parameters. */
+{
+ FMFontStyle stylesDone, stylesLeft;
+
+ /*
+ * Defaults in case of error.
+ */
+
+ *fontIdPtr = GetAppFont();
+ *stylePtr = 0;
+ *layoutPtr = 0;
+
+ /*
+ * Generate a font id from family id and QD style bits.
+ */
+
+ ChkErr(FMGetFontFromFontFamilyInstance, familyId, qdStyles, fontIdPtr,
+ &stylesDone);
+
+ /*
+ * We see what style bits are left and tell ATSU to synthesize what's
+ * left like QD does it.
+ */
+
+ stylesLeft = qdStyles & ~(unsigned)stylesDone;
+
+ /*
+ * Create the style and set its attributes.
+ */
+
+ ChkErr(ATSUCreateStyle, stylePtr);
+ InitATSUStyle(*fontIdPtr, ptSize, stylesLeft, *stylePtr);
+
+ /*
+ * Create the layout. Note: We can't set the layout attributes here,
+ * because the text and the style must be set first.
+ */
+
+ ChkErr(ATSUCreateTextLayout, layoutPtr);
+ /*InitATSULayout(*layoutPtr);*/
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitATSUStyle --
+ *
+ * Helper for InitATSUObjects(). Initializes the ATSU style for a
+ * MacFont.
+ *
+ * Results:
+ * Sets up all parameters needed for an ATSU style.
+ *
+ * Side effects:
+ * Allocates data structures for the style inside of ATSU.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitATSUStyle(
+ ATSUFontID fontId, /* The font id to use. */
+ short ptSize, short qdStyles,
+ /* Additional font parameters. */
+ ATSUStyle style) /* The style handle to configure. */
+{
+ /*
+ * Attributes for the style.
+ */
+
+ Fixed fsize = IntToFixed(ptSize);
+ Boolean
+ isBold = (qdStyles&bold) != 0,
+ isUnderline = (qdStyles&underline) != 0,
+ isItalic = (qdStyles&italic) != 0;
+
+ ATSStyleRenderingOptions options =
+ antialiasedTextEnabled == -1 ? kATSStyleNoOptions :
+ antialiasedTextEnabled == 0 ? kATSStyleNoAntiAliasing :
+ kATSStyleApplyAntiAliasing;
+
+ static const ATSUAttributeTag styleTags[] = {
+ kATSUFontTag, kATSUSizeTag,
+ kATSUQDBoldfaceTag, kATSUQDItalicTag, kATSUQDUnderlineTag,
+ kATSUStyleRenderingOptionsTag,
+ };
+ static const ByteCount styleSizes[] = {
+ sizeof(ATSUFontID), sizeof(Fixed),
+ sizeof(Boolean), sizeof(Boolean), sizeof(Boolean),
+ sizeof(ATSStyleRenderingOptions),
+ };
+ const ATSUAttributeValuePtr styleValues[] = {
+ &fontId, &fsize,
+ &isBold, &isItalic, &isUnderline,
+ &options,
+ };
+
+ ChkErr(ATSUSetAttributes, style, sizeof(styleTags)/sizeof(styleTags[0]),
+ styleTags, styleSizes, styleValues);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * SetFontFeatures --
+ *
+ * Helper for InitFont(). Request specific font features of the ATSU
+ * style object for a MacFont.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Specific font features are enabled on the ATSU style object.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+SetFontFeatures(
+ ATSUFontID fontId, /* The font id to use. */
+ int fixed, /* Is this a fixed font? */
+ short size, /* Size of the font */
+ ATSUStyle style) /* The style handle to configure. */
+{
+ /*
+ * Don't use the standard latin ligatures, if this is determined to be a
+ * fixed-width font.
+ */
+
+ static const ATSUFontFeatureType fixed_featureTypes[] = {
+ kLigaturesType, kLigaturesType
+ };
+ static const ATSUFontFeatureSelector fixed_featureSelectors[] = {
+ kCommonLigaturesOffSelector, kRareLigaturesOffSelector
+ };
+
+ if (fixed) {
+ ChkErr(ATSUSetFontFeatures, style, sizeof(fixed_featureTypes) /
+ sizeof(fixed_featureTypes[0]), fixed_featureTypes,
+ fixed_featureSelectors);
+ if (size <= 10) {
+ /*
+ * Disable antialiasing of fixed-width fonts with sizes <= 10
+ */
+
+ const ATSStyleRenderingOptions options = kATSStyleNoAntiAliasing;
+ const ATSUAttributeTag styleTag = kATSUStyleRenderingOptionsTag;
+ const ByteCount styleSize = sizeof(ATSStyleRenderingOptions);
+ const ConstATSUAttributeValuePtr styleValue = &options;
+
+ ChkErr(ATSUSetAttributes, style, 1, &styleTag, &styleSize,
+ (ATSUAttributeValuePtr*) &styleValue);
+ }
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * AdjustFontHeight --
+ *
+ * Helper for InitFont(). Check font height against some real world
+ * examples.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The metrics in fontPtr->font.fm are adjusted so that typical combined
+ * characters fit into ascent+descent.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+AdjustFontHeight(
+ MacFont * fontPtr)
+{
+ /*
+ * The standard values for ascent, descent and leading as determined in
+ * InitFont do not take composition into account, they are designed for
+ * plain ASCII characters. This code measures the actual size of some
+ * typical composed characters from the Latin-1 range and corrects these
+ * factors, especially the ascent.
+ *
+ * A font requested with a pixel size may thus have a larger line height
+ * than requested.
+ *
+ * An alternative would be to instruct ATSU to shrink oversized combined
+ * characters. I think I have seen that feature somewhere, but I can't
+ * find it now [BR].
+ */
+
+ static const UniChar chars[]
+ /* Auml, Aacute, Acirc, Atilde, Ccedilla */
+ = {0x00C4, 0x00C1, 0x00C2, 0x00C3, 0x00C7};
+ static const int charslen = sizeof(chars) / sizeof(chars[0]);
+ Rect size;
+ OSStatus err;
+
+ LayoutSetString(fontPtr, NULL, chars, charslen);
+
+ size.top = size.bottom = 0;
+ err = ChkErr(ATSUMeasureTextImage, fontPtr->atsuLayout, 0, charslen, 0, 0,
+ &size);
+
+ if (err == noErr) {
+ TkFontMetrics * fmPtr = &fontPtr->font.fm;
+ int ascent = -size.top;
+ int descent = size.bottom;
+
+ if (ascent > fmPtr->ascent) {
+ fmPtr->ascent = ascent;
+ }
+ if (descent > fmPtr->descent) {
+ fmPtr->descent = descent;
+ }
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitATSULayout --
+ *
+ * Helper for LayoutSetString(). Initializes the ATSU layout
+ * object for a MacFont and a specific string.
+ *
+ * Results:
+ * Sets up all parameters needed for an ATSU layout object.
+ *
+ * Side effects:
+ * Allocates data structures for the layout object inside of ATSU.
+ *
+ * Assumptions:
+ * The actual string data and style information is already set by
+ * ATSUSetTextPointerLocation() and ATSUSetRunStyle() (see
+ * LayoutSetString()).
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitATSULayout(
+ const TkMacOSXDrawingContext *drawingContextPtr,
+ /* Specifies the CGContext to use. */
+ ATSUTextLayout layout, /* The layout object to configure. */
+ int fixed) /* Is this a fixed font? */
+{
+ /*
+ * Attributes for the layout.
+ */
+
+ ATSLineLayoutOptions layoutOptions = 0
+#if TK_MAC_COALESCE_LINE
+ /*
+ * Options to use unconditionally when we try to do coalescing.
+ */
+ | kATSLineDisableAllLayoutOperations
+ | kATSLineFractDisable
+ | kATSLineUseDeviceMetrics
+#endif
+ ;
+ CGContextRef context = drawingContextPtr ?
+ drawingContextPtr->context : NULL;
+
+ static const ATSUAttributeTag layoutTags[] = {
+ kATSUCGContextTag,
+ kATSULineLayoutOptionsTag,
+ };
+ static const ByteCount layoutSizes[] = {
+ sizeof(CGContextRef),
+ sizeof(ATSLineLayoutOptions),
+ };
+ const ATSUAttributeValuePtr layoutValues[] = {
+ &context,
+ &layoutOptions,
+ };
+
+ /*
+ * Ensure W(abcdefg) == W(a)*7 for fixed fonts (Latin scripts only).
+ */
+
+ if (fixed) {
+ layoutOptions |= kATSLineFractDisable | kATSLineUseDeviceMetrics;
+ }
+
+ ChkErr(ATSUSetLayoutControls, layout, sizeof(layoutTags) /
+ sizeof(layoutTags[0]), layoutTags, layoutSizes, layoutValues);
+ ChkErr(ATSUSetTransientFontMatching, layout, true);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * LayoutSetString --
+ *
+ * Setup the MacFont for a specific string.
+ *
+ * Results:
+ * Sets up all parameters so that ATSU can work with the objects in
+ * MacFont.
+ *
+ * Side effects:
+ * Sets parameters on the layout object fontPtr->atsuLayout.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+LayoutSetString(
+ const MacFont *fontPtr, /* The fontPtr to configure. */
+ const TkMacOSXDrawingContext *drawingContextPtr,
+ /* For the CGContext to be used.*/
+ const UniChar *uchars, int ulen)
+ /* The UniChar string to set into
+ * fontPtr->atsuLayout. */
+{
+ ChkErr(ATSUSetTextPointerLocation, fontPtr->atsuLayout, uchars,
+ kATSUFromTextBeginning, ulen, ulen);
+
+ /*
+ * Styles can only be set after the text is set.
+ */
+
+ ChkErr(ATSUSetRunStyle, fontPtr->atsuLayout, fontPtr->atsuStyle,
+ kATSUFromTextBeginning, kATSUToTextEnd);
+
+ /*
+ * Layout attributes can only be set after the styles are set.
+ */
+
+ InitATSULayout(drawingContextPtr, fontPtr->atsuLayout,
+ fontPtr->font.fm.fixed);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * 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. */
+{
+ ATSUDisposeTextLayout(fontPtr->atsuLayout);
+ ATSUDisposeStyle(fontPtr->atsuStyle);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FindFontFamilyOrAlias, FindFontFamilyOrAliasOrFallback --
+ *
+ * Determine 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.
+ *
+ * FindFontFamilyOrAlias also considers font aliases as determined by
+ * TkFontGetAliasList().
+ *
+ * FindFontFamilyOrAliasOrFallback also considers font aliases as
+ * determined by TkFontGetFallbacks().
+ *
+ * The overall algorithm to get the closest font to the one requested is
+ * this:
+ *
+ * try fontname
+ * try all aliases for fontname
+ * foreach fallback for fontname
+ * try the fallback
+ * try all aliases for the fallback
+ *
+ * Results:
+ *
+ * The return value is NULL if the specified font family does not exist,
+ * a valid MacFontFamily* otherwise.
+ *
+ * Side effects:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static const MacFontFamily *
+FindFontFamilyOrAlias(
+ const char *name) /* Name or alias name of the font to find. */
+{
+ const MacFontFamily * familyPtr;
+ const char *const * aliases;
+ int i;
+
+ familyPtr = FindFontFamily(name);
+ if (familyPtr != NULL) {
+ return familyPtr;
+ }
+
+ aliases = TkFontGetAliasList(name);
+ if (aliases != NULL) {
+ for (i = 0; aliases[i] != NULL; i++) {
+ familyPtr = FindFontFamily(aliases[i]);
+ if (familyPtr != NULL) {
+ return familyPtr;
+ }
+ }
+ }
+ return NULL;
+}
+
+static const MacFontFamily *
+FindFontFamilyOrAliasOrFallback(
+ const char *name) /* Name or alias name of the font to find. */
+{
+ const MacFontFamily * familyPtr;
+ const char * fallback;
+ const char *const *const * fallbacks;
+ int i, j;
+
+ familyPtr = FindFontFamilyOrAlias(name);
+ if (familyPtr != NULL) {
+ return familyPtr;
+ }
+ fallbacks = TkFontGetFallbacks();
+ for (i = 0; fallbacks[i] != NULL; i++) {
+ for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
+ if (strcasecmp(name, fallback) == 0) {
+ for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
+ familyPtr = FindFontFamilyOrAlias(fallback);
+ if (familyPtr != NULL) {
+ return familyPtr;
+ }
+ }
+ }
+ break; /* benny: This "break" is a carry-over from
+ * tkMacOSXFont.c, but what is actually its purpose
+ * ???? */
+ }
+ }
+
+
+ /*
+ * FIXME: We would have liked to recover by re-enumerating fonts. But
+ * that doesn't work, because Carbon seems to cache the inital list of
+ * fonts. Fonts newly installed don't show up with
+ * FMCreateFontFamilyIterator()/FMGetNextFontFamily() without a restart
+ * of the app. Similar problem with fonts removed.
+ */
+
+#ifdef TK_MAC_DEBUG_FONTS
+ TkMacOSXDbgMsg("Font family '%s' not found", name);
+#endif
+
+ return NULL;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * InitFontFamilies --
+ *
+ * Helper to TkpFontPkgInit. Use the Font Manager to fill in the
+ * familyList global array.
+ *
+ * Results:
+ *
+ * None.
+ *
+ * Side effects:
+ *
+ * Allocates memory.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+InitFontFamilies(void)
+{
+ FMFontFamily fontFamily;
+ Str255 fontName;
+ SInt16 fontSize;
+ Style fontStyle;
+
+ /*
+ * Has this been called before?
+ */
+
+ if (familyListNextFree > 0) {
+ return;
+ }
+
+ ChkErr(ATSFontFamilyApplyFunction, FontFamilyEnumCallback,NULL);
+
+ if (GetThemeFontAndFamily(kThemeSystemFont, &fontFamily, fontName,
+ &fontSize, &fontStyle) == noErr) {
+ AddFontFamily(SYSTEMFONT_NAME, fontFamily);
+ }
+ if (GetThemeFontAndFamily(kThemeApplicationFont, &fontFamily, fontName,
+ &fontSize, &fontStyle) == noErr) {
+ AddFontFamily(APPLFONT_NAME, fontFamily);
+ }
+ if (GetThemeFontAndFamily(kThemeMenuItemFont, &fontFamily, fontName,
+ &fontSize, &fontStyle) == noErr) {
+ AddFontFamily(MENUITEMFONT_NAME, fontFamily);
+ }
+
+ SortFontFamilies();
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FontFamilyEnumCallback --
+ *
+ * Callback for ATSFontFamilyApplyFunction().
+ *
+ * Results:
+ *
+ * noErr.
+ *
+ * Side effects:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static OSStatus
+FontFamilyEnumCallback(
+ ATSFontFamilyRef family,
+ void *refCon)
+{
+ OSStatus err;
+ char name[260] = "";
+
+ (void) refCon;
+
+ err = ChkErr(GetFontFamilyName, family, name, sizeof(name));
+ if (err == noErr) {
+ AddFontFamily(name, family);
+ }
+
+ return noErr;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * GetFontFamilyName --
+ *
+ * Use the Font Manager to get the name of a given FMFontfamily. This
+ * currently gets the standard, non-localized QuickDraw name. Other
+ * names would be possible, see docs for ATSUFindFontName for a
+ * selection. The MacOSX font selector seems to use the localized
+ * family name given by ATSUFindFontName(kFontFamilyName), but that API
+ * doesn't give us a name at all for some fonts.
+ *
+ * Results:
+ * An OS error code, noErr on success. name is filled with the
+ * resulting name.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static OSStatus
+GetFontFamilyName(
+ FMFontFamily fontFamily, /* The font family for which to find the
+ * name. */
+ char * name, int numBytes) /* Filled with the result. */
+{
+ OSStatus err;
+ Str255 nativeName;
+ CFStringRef cfString;
+ TextEncoding encoding;
+ ScriptCode nameencoding;
+
+ nativeName[0] = 0;
+ name[0] = 0;
+ err = ChkErr(FMGetFontFamilyName, fontFamily, nativeName);
+ if (err != noErr) {
+ return err;
+ }
+
+ /*
+ * QuickDraw font names are encoded with the script that the font uses.
+ * So we determine that encoding and than we reencode the name. We
+ * pre-set the encoding with the default value, so we do not need to
+ * check result codes here.
+ */
+
+ encoding = kTextEncodingMacRoman;
+ ChkErr(FMGetFontFamilyTextEncoding, fontFamily, &encoding);
+ nameencoding = encoding;
+ ChkErr(RevertTextEncodingToScriptInfo, encoding, &nameencoding, NULL,
+ NULL);
+
+ /*
+ * Note: We could use Tcl facilities to do the re-encoding here. We'd
+ * have to maintain tables to map OS encoding codes to Tcl encoding names
+ * like tkMacOSXFont.c did. Using native re-encoding directly instead is
+ * a lot easier and future-proof than that. There is one snag, though: I
+ * have seen CFStringGetCString() crash with invalid encoding ids. But
+ * than if that happens it would be a bug in
+ * FMGetFontFamilyTextEncoding() or RevertTextEncodingToScriptInfo().
+ * Another problem is that users have seen CFStringCreate return null
+ * (Bug #2548661). This is due to font names with a bad encoding.
+ */
+
+ cfString = CFStringCreateWithPascalStringNoCopy(
+ NULL, nativeName, nameencoding, kCFAllocatorNull);
+ if (cfString == NULL) {
+ TkMacOSXDbgMsg("CFStringCreate: "
+ "'%.*s' could not be decoded with encoding %d",
+ nativeName[0], nativeName+1, (int) nameencoding);
+ return kTextMalformedInputErr;
+ }
+
+ CFStringGetCString(cfString, name, numBytes, kCFStringEncodingUTF8);
+ CFRelease(cfString);
+
+ return noErr;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FindFontFamily --
+ *
+ * Find the font family with the given name in the global familyList.
+ * Uses bsearch() for convenient access. Comparision is done
+ * non-case-sensitively with CompareFontFamilies() which see.
+ *
+ * Results:
+ *
+ * MacFontFamily: A pair of family id and the actual name registered for
+ * the font.
+ *
+ * Side effects:
+ *
+ * None.
+ *
+ * Assumption:
+ *
+ * Requires the familyList array to be sorted.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static const MacFontFamily *
+FindFontFamily(
+ const char *name) /* The family name. Note: Names are compared
+ * non-case-sensitive. */
+{
+ const MacFontFamily key = {name,-1};
+
+ if(familyListMaxValid <= 0) {
+ return NULL;
+ }
+
+ return bsearch(&key, familyList, familyListMaxValid, sizeof(*familyList),
+ CompareFontFamilies);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * EnumFontFamilies --
+ *
+ * Create a Tcl list with the registered names in the global familyList.
+ *
+ * Results:
+ * A Tcl list of names.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+EnumFontFamilies(void)
+{
+ int i;
+ Tcl_Obj * tclList;
+
+ tclList = Tcl_NewListObj(0, NULL);
+ for (i=0; i<familyListMaxValid; ++i) {
+ Tcl_ListObjAppendElement(NULL, tclList,
+ Tcl_NewStringObj(familyList[i].name, -1));
+ }
+
+ return tclList;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * AddFontFamily --
+ *
+ * Register a font family in familyList. Until SortFontFamilies() is
+ * called, this is not actually available for FindFontFamily().
+ *
+ * Results:
+ *
+ * MacFontFamily: The new pair of family id and the actual name
+ * registered for the font.
+ *
+ * Side effects:
+ *
+ * New entry in familyList and familyListNextFree updated.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static const MacFontFamily *
+AddFontFamily(
+ const char *name, /* Font family name to register. */
+ FMFontFamily familyId) /* Font family id to register. */
+{
+ MacFontFamily * familyPtr;
+
+ if (familyListNextFree >= familyListSize) {
+ familyListSize += 100;
+ familyList = ckrealloc(familyList,
+ familyListSize * sizeof(*familyList));
+ }
+
+ familyPtr = familyList + familyListNextFree;
+ ++familyListNextFree;
+
+ familyPtr->name = AddString(name);
+ familyPtr->familyId = familyId;
+
+ return familyPtr;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * SortFontFamilies --
+ *
+ * Sort the entries in familyList. Only after calling
+ * SortFontFamilies(), the new families registered with AddFontFamily()
+ * are actually available for FindFontFamily(), because FindFontFamily()
+ * requires the array to be sorted.
+ *
+ * Results:
+ *
+ * None.
+ *
+ * Side effects:
+ *
+ * familyList is sorted and familyListMaxValid is updated.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+SortFontFamilies(void)
+{
+ if (familyListNextFree > 0) {
+ qsort(familyList, familyListNextFree, sizeof(*familyList),
+ CompareFontFamilies);
+ }
+ familyListMaxValid = familyListNextFree;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * CompareFontFamilies --
+ *
+ * Comparison function used by SortFontFamilies() and FindFontFamily().
+ *
+ * Results:
+ * Result as required to generate a stable sort order for bsearch() and
+ * qsort(). The ordering is not case-sensitive as far as
+ * Tcl_UtfNcasecmp() (which see) can provide that.
+ *
+ * Note: It would be faster to compare first the length and the actual
+ * strings only as a tie-breaker, but than the ordering wouldn't look so
+ * pretty in [font families] ;-).
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+CompareFontFamilies(
+ const void * vp1,
+ const void * vp2)
+{
+ const char * name1;
+ const char * name2;
+ int len1, len2, diff;
+
+ name1 = ((const MacFontFamily *) vp1)->name;
+ name2 = ((const MacFontFamily *) vp2)->name;
+
+ len1 = Tcl_NumUtfChars(name1, -1);
+ len2 = Tcl_NumUtfChars(name2, -1);
+
+ diff = Tcl_UtfNcasecmp(name1, name2, len1<len2 ? len1 : len2);
+
+ return diff == 0 ? len1-len2 : diff;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * AddString --
+ *
+ * Helper for AddFontFamily(). Allocates a string in the one-shot
+ * allocator.
+ *
+ * Results:
+ * A duplicated string in the one-shot allocator.
+ *
+ * Side effects:
+ * May allocate a new memory block.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static const char *
+AddString(
+ const char *in) /* String to add, zero-terminated. */
+{
+ int len;
+ char *result;
+
+ len = strlen(in) +1;
+
+ if (stringMemory == NULL
+ || (stringMemory->nextFree+len) > STRING_BLOCK_MAX) {
+ StringBlock *newblock = ckalloc(sizeof(StringBlock));
+
+ newblock->next = stringMemory;
+ newblock->nextFree = 0;
+ stringMemory = newblock;
+ }
+
+ result = stringMemory->strings + stringMemory->nextFree;
+ stringMemory->nextFree += len;
+
+ memcpy(result, in, len);
+
+ return result;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkMacOSXIsCharacterMissing --
+ *
+ * Given a tkFont and a character determine whether the character has
+ * a glyph defined in the font 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. */
+{
+ /* Background: This function is private and only used in
+ * tkMacOSXMenu.c:FindMarkCharacter().
+ *
+ * We could use ATSUMatchFont() to implement. We'd have to change the
+ * definition of the encoding of the parameter searchChar from MacRoman
+ * to UniChar for that.
+ *
+ * The system uses font fallback for controls, so we don't really need
+ * this. */
+
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitControlFontStyle --
+ *
+ * This procedure sets up the appropriate ControlFontStyleRec
+ * for a Mac control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitControlFontStyle(
+ Tk_Font tkfont, /* Tk font object to use for the control. */
+ ControlFontStylePtr fsPtr) /* The style object to configure. */
+{
+ const MacFont * fontPtr = (MacFont *) tkfont;
+
+ fsPtr->flags = kControlUseFontMask | kControlUseSizeMask |
+ kControlUseFaceMask | kControlUseJustMask;
+ fsPtr->font = fontPtr->qdFont;
+ fsPtr->size = fontPtr->qdSize;
+ fsPtr->style = fontPtr->qdStyle;
+ fsPtr->just = teCenter;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXFMFontInfoForFont --
+ *
+ * Retrieve FontManager/ATSUI font information for a Tk font.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void
+TkMacOSXFMFontInfoForFont(
+ Tk_Font tkfont,
+ FMFontFamily *fontFamilyPtr,
+ FMFontStyle *fontStylePtr,
+ FMFontSize *fontSizePtr,
+ ATSUStyle *fontATSUStylePtr)
+{
+ const MacFont * fontPtr = (MacFont *) tkfont;
+
+ if (fontFamilyPtr) {
+ *fontFamilyPtr = fontPtr->qdFont;
+ }
+ if (fontStylePtr) {
+ *fontStylePtr = fontPtr->qdStyle;
+ }
+ if (fontSizePtr) {
+ *fontSizePtr = fontPtr->qdSize;
+ }
+ if (fontATSUStylePtr) {
+ *fontATSUStylePtr = fontPtr->atsuStyle;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXFontDescriptionForFMFontInfo --
+ *
+ * Get text description of a font specified by FontManager info.
+ *
+ * Results:
+ * List object or NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE Tcl_Obj *
+TkMacOSXFontDescriptionForFMFontInfo(
+ FMFontFamily fontFamily,
+ FMFontStyle fontStyle,
+ FMFontSize fontSize,
+ FMFont fontID)
+{
+ Tcl_Obj *objv[6];
+ int i = 0;
+
+ if (fontFamily != kInvalidFontFamily && fontStyle != -1) {
+ const char *familyName = FamilyNameForFamilyID(fontFamily);
+
+ if (familyName) {
+ objv[i++] = Tcl_NewStringObj(familyName, -1);
+ objv[i++] = Tcl_NewIntObj(fontSize);
+#define S(s) Tcl_NewStringObj(STRINGIFY(s),(int)(sizeof(STRINGIFY(s))-1))
+ objv[i++] = (fontStyle & bold) ? S(bold) : S(normal);
+ objv[i++] = (fontStyle & italic) ? S(italic) : S(roman);
+ if (fontStyle & underline) objv[i++] = S(underline);
+ /*if (fontStyle & overstrike) objv[i++] = S(overstrike);*/
+#undef S
+ }
+ } else if (fontID != kInvalidFont) {
+ CFStringRef fontName = NULL;
+ Tcl_Obj *fontNameObj = NULL;
+
+ ChkErr(ATSFontGetName, FMGetATSFontRefFromFont(fontID),
+ kATSOptionFlagsDefault, &fontName);
+ if (fontName) {
+ fontNameObj = TkMacOSXGetStringObjFromCFString(fontName);
+ CFRelease(fontName);
+ }
+ if (fontNameObj) {
+ objv[i++] = fontNameObj;
+ objv[i++] = Tcl_NewIntObj(fontSize);
+ }
+ }
+ return i ? Tcl_NewListObj(i, objv) : NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXUseAntialiasedText --
+ *
+ * Enables or disables application-wide use of antialiased text (where
+ * available). Sets up a linked Tcl global variable to allow
+ * disabling of antialiased text from tcl.
+ * The possible values for this variable are:
+ *
+ * -1 - Use system default as configurable in "System Prefs" -> "General".
+ * 0 - Unconditionally disable antialiasing.
+ * 1 - Unconditionally enable antialiasing.
+ *
+ * Results:
+ *
+ * TCL_OK.
+ *
+ * Side effects:
+ *
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXUseAntialiasedText(
+ Tcl_Interp * interp, /* The Tcl interpreter to receive the
+ * variable.*/
+ int enable) /* Initial value. */
+{
+ static Boolean initialized = FALSE;
+
+ if (!initialized) {
+ initialized = TRUE;
+
+ if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) {
+ Tcl_ResetResult(interp);
+ }
+ if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext",
+ (char *) &antialiasedTextEnabled,
+ TCL_LINK_INT) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ }
+ }
+ antialiasedTextEnabled = enable;
+ return TCL_OK;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXFont.h b/carbon/tkMacOSXFont.h
new file mode 100644
index 0000000..e932fb7
--- /dev/null
+++ b/carbon/tkMacOSXFont.h
@@ -0,0 +1,38 @@
+/*
+ * tkMacOSXFont.h --
+ *
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef TKMACOSXFONT_H
+#define TKMACOSXFONT_H 1
+
+#include "tkFont.h"
+
+#ifndef _TKMACINT
+#include "tkMacOSXInt.h"
+#endif
+
+/*
+ * Function prototypes
+ */
+
+MODULE_SCOPE void TkMacOSXInitControlFontStyle(Tk_Font tkfont,
+ ControlFontStylePtr fsPtr);
+MODULE_SCOPE void TkMacOSXFMFontInfoForFont(Tk_Font tkfont,
+ FMFontFamily *fontFamilyPtr, FMFontStyle *fontStylePtr,
+ FMFontSize *fontSizePtr, ATSUStyle *fontATSUStylePtr);
+MODULE_SCOPE Tcl_Obj * TkMacOSXFontDescriptionForFMFontInfo(
+ FMFontFamily fontFamily, FMFontStyle fontStyle, FMFontSize fontSize,
+ FMFont fontID);
+
+#endif /*TKMACOSXFONT_H*/
diff --git a/carbon/tkMacOSXHLEvents.c b/carbon/tkMacOSXHLEvents.c
new file mode 100644
index 0000000..1ab050f
--- /dev/null
+++ b/carbon/tkMacOSXHLEvents.c
@@ -0,0 +1,691 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+
+/*
+ * This is a Tcl_Event structure that the Quit AppleEvent handler uses to
+ * schedule the ReallyKillMe 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 RappHandler(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(const AppleEvent *theEvent);
+static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
+static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+{
+ AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP;
+ AEEventHandlerUPP PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP;
+ AEEventHandlerUPP PrefsHandlerUPP;
+ static Boolean initialized = FALSE;
+
+ if (!initialized) {
+ initialized = TRUE;
+
+ /*
+ * Install event handlers for the core apple events.
+ */
+
+ QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEQuitApplication,
+ QuitHandlerUPP, (long) interp, false);
+
+ OappHandlerUPP = NewAEEventHandlerUPP(OappHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenApplication,
+ OappHandlerUPP, (long) interp, false);
+
+ RappHandlerUPP = NewAEEventHandlerUPP(RappHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEReopenApplication,
+ RappHandlerUPP, (long) interp, false);
+
+ OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenDocuments,
+ OdocHandlerUPP, (long) interp, false);
+
+ PrintHandlerUPP = NewAEEventHandlerUPP(PrintHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEPrintDocuments,
+ PrintHandlerUPP, (long) interp, false);
+
+ PrefsHandlerUPP = NewAEEventHandlerUPP(PrefsHandler);
+ ChkErr(AEInstallEventHandler, kCoreEventClass, kAEShowPreferences,
+ PrefsHandlerUPP, (long) interp, false);
+
+ if (interp) {
+ ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler);
+ ChkErr(AEInstallEventHandler, kAEMiscStandards, kAEDoScript,
+ ScriptHandlerUPP, (long) interp, false);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDoHLEvent --
+ *
+ * Dispatch incomming highlevel events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Depends on the incoming event.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXDoHLEvent(
+ void *theEvent)
+{
+ return AEProcessAppleEvent(theEvent);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * QuitHandler --
+ *
+ * This is the 'quit' core Apple event handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+QuitHandler(
+ const AppleEvent *event,
+ AppleEvent *reply,
+ long handlerRefcon)
+{
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ KillEvent *eventPtr;
+
+ if (interp) {
+ /*
+ * 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 = ckalloc(sizeof(KillEvent));
+ eventPtr->header.proc = ReallyKillMe;
+ eventPtr->interp = interp;
+
+ Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_HEAD);
+ }
+ return noErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * OappHandler --
+ *
+ * This is the 'oapp' core Apple event handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+OappHandler(
+ const AppleEvent *event,
+ AppleEvent *reply,
+ long handlerRefcon)
+{
+ Tcl_CmdInfo dummy;
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+
+ if (interp &&
+ Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){
+ int code = Tcl_GlobalEval(interp, "::tk::mac::OpenApplication");
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
+ }
+ }
+ return noErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RappHandler --
+ *
+ * This is the 'rapp' core Apple event handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+RappHandler(
+ const AppleEvent *event,
+ AppleEvent *reply,
+ long handlerRefcon)
+{
+ Tcl_CmdInfo dummy;
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ ProcessSerialNumber thePSN = {0, kCurrentProcess};
+ OSStatus err = ChkErr(SetFrontProcess, &thePSN);
+
+ if (interp && Tcl_GetCommandInfo(interp,
+ "::tk::mac::ReopenApplication", &dummy)) {
+ int code = Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication");
+ if (code != TCL_OK){
+ Tcl_BackgroundException(interp, code);
+ }
+ }
+ return err;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PrefsHandler --
+ *
+ * This is the 'pref' core Apple event handler. Called when the user
+ * selects 'Preferences...' in MacOS X
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+PrefsHandler(
+ const AppleEvent *event,
+ AppleEvent *reply,
+ long handlerRefcon)
+{
+ Tcl_CmdInfo dummy;
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+
+ if (interp &&
+ Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){
+ int code = Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences");
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
+ }
+ }
+ return noErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * OdocHandler --
+ *
+ * This is the 'odoc' core Apple event handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+OdocHandler(
+ const AppleEvent *event,
+ AppleEvent *reply,
+ long handlerRefcon)
+{
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ AEDescList fileSpecList;
+ FSRef file;
+ DescType type;
+ Size actual;
+ long count, index;
+ AEKeyword keyword;
+ Tcl_DString command, pathName;
+ Tcl_CmdInfo dummy;
+ int code;
+
+ /*
+ * Don't bother if we don't have an interp or the open document procedure
+ * doesn't exist.
+ */
+
+ if (!interp ||
+ !Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) {
+ return noErr;
+ }
+
+ /*
+ * If we get any errors while retrieving our parameters we just return with
+ * no error.
+ */
+
+ if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList,
+ &fileSpecList) != noErr) {
+ return noErr;
+ }
+ if (MissedAnyParameters(event) != noErr) {
+ return noErr;
+ }
+ if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) {
+ return noErr;
+ }
+
+ /*
+ * Convert our parameters into a script to evaluate, skipping things that
+ * we can't handle right.
+ */
+
+ Tcl_DStringInit(&command);
+ Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1);
+ for (index = 1; index <= count; index++) {
+ if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword,
+ &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) {
+ continue;
+ }
+
+ if (ChkErr(FSRefToDString, &file, &pathName) == noErr) {
+ Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName));
+ Tcl_DStringFree(&pathName);
+ }
+ }
+
+ /*
+ * Now handle the event by evaluating a script.
+ */
+
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command),
+ Tcl_DStringLength(&command), TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
+ }
+ Tcl_DStringFree(&command);
+ return noErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PrintHandler --
+ *
+ * This is the 'pdoc' core Apple event handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+PrintHandler(
+ const AppleEvent * event,
+ AppleEvent * reply,
+ long handlerRefcon)
+{
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ AEDescList fileSpecList;
+ FSRef file;
+ DescType type;
+ Size actual;
+ long count, index;
+ AEKeyword keyword;
+ Tcl_DString command, pathName;
+ Tcl_CmdInfo dummy;
+ int code;
+
+ /*
+ * Don't bother if we don't have an interp or the print document procedure
+ * doesn't exist.
+ */
+
+ if (!interp ||
+ !Tcl_GetCommandInfo(interp, "::tk::mac::PrintDocument", &dummy)) {
+ return noErr;
+ }
+
+ /*
+ * If we get any errors while retrieving our parameters we just return with
+ * no error.
+ */
+
+ if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList,
+ &fileSpecList) != noErr) {
+ return noErr;
+ }
+ if (ChkErr(MissedAnyParameters, event) != noErr) {
+ return noErr;
+ }
+ if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) {
+ return noErr;
+ }
+
+ Tcl_DStringInit(&command);
+ Tcl_DStringAppend(&command, "::tk::mac::PrintDocument", -1);
+ for (index = 1; index <= count; index++) {
+ if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword,
+ &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) {
+ continue;
+ }
+
+ if (ChkErr(FSRefToDString, &file, &pathName) == noErr) {
+ Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName));
+ Tcl_DStringFree(&pathName);
+ }
+ }
+
+ /*
+ * Now handle the event by evaluating a script.
+ */
+
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command),
+ Tcl_DStringLength(&command), TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
+ }
+ Tcl_DStringFree(&command);
+ 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)
+{
+ OSStatus theErr;
+ AEDescList theDesc;
+ Size size;
+ int tclErr = -1;
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ char errString[128];
+
+ /*
+ * 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",
+ (int)theErr);
+ theErr = AEPutParamPtr(reply, keyErrorString, typeChar, errString,
+ strlen(errString));
+ } else if (MissedAnyParameters(event)) {
+ /*
+ * Return error if parameter is missing.
+ */
+
+ sprintf(errString, "AEDoScriptHandler: extra parameters");
+ AEPutParamPtr(reply, keyErrorString, typeChar, errString,
+ strlen(errString));
+ theErr = -1771;
+ } else if (theDesc.descriptorType == (DescType) typeAlias &&
+ AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, NULL,
+ 0, &size) == noErr && size == sizeof(FSRef)) {
+ /*
+ * We've had a file sent to us. Source it.
+ */
+
+ FSRef file;
+ theErr = AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, &file,
+ size, NULL);
+ if (theErr == noErr) {
+ Tcl_DString scriptName;
+
+ theErr = FSRefToDString(&file, &scriptName);
+ if (theErr == noErr) {
+ tclErr = Tcl_EvalFile(interp, Tcl_DStringValue(&scriptName));
+ Tcl_DStringFree(&scriptName);
+ } else {
+ sprintf(errString, "AEDoScriptHandler: file not found");
+ AEPutParamPtr(reply, keyErrorString, typeChar, errString,
+ strlen(errString));
+ }
+ }
+ } else if (AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, NULL,
+ 0, &size) == noErr && size) {
+ /*
+ * We've had some data sent to us. Evaluate it.
+ */
+
+ char *data = ckalloc(size + 1);
+ theErr = AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, data,
+ size, NULL);
+ if (theErr == noErr) {
+ tclErr = Tcl_EvalEx(interp, data, size, TCL_EVAL_GLOBAL);
+ }
+ } else {
+ /*
+ * Umm, don't recognize what we've got...
+ */
+
+ sprintf(errString, "AEDoScriptHandler: invalid script type '%-4.4s', "
+ "must be 'alis' or coercable to 'utf8'",
+ (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) {
+ int reslen;
+ const char *result =
+ Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen);
+
+ if (tclErr == TCL_OK) {
+ AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen);
+ } else {
+ AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen);
+ AEPutParamPtr(reply, keyErrorNumber, typeSInt32, (Ptr) &tclErr,
+ sizeof(int));
+ }
+ }
+
+ AEDisposeDesc(&theDesc);
+ return theErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReallyKillMe --
+ *
+ * This proc tries to kill the shell by running exit, called from an
+ * event scheduled by the "Quit" AppleEvent handler.
+ *
+ * Results:
+ * Runs the "exit" command which might kill the shell.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReallyKillMe(
+ Tcl_Event *eventPtr,
+ int flags)
+{
+ Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp;
+ Tcl_CmdInfo dummy;
+ int quit = Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy);
+ int code = Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit");
+
+ if (code != TCL_OK) {
+ /*
+ * Should be never reached...
+ */
+
+ Tcl_BackgroundException(interp, code);
+ }
+ 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;
+ OSStatus err;
+
+ err = AEGetAttributePtr(theEvent, keyMissedKeywordAttr,
+ typeWildCard, &returnedType, NULL, 0, &actualSize);
+
+ return (err != errAEDescNotFound);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FSRefToDString --
+ *
+ * Get a POSIX path from an FSRef.
+ *
+ * Results:
+ * In the parameter ds.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSStatus
+FSRefToDString(
+ const FSRef *fsref,
+ Tcl_DString *ds)
+{
+ UInt8 fileName[PATH_MAX+1];
+ OSStatus err;
+
+ err = ChkErr(FSRefMakePath, fsref, fileName, sizeof(fileName));
+ if (err == noErr) {
+ Tcl_ExternalToUtfDString(NULL, (char*) fileName, -1, ds);
+ }
+ return err;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/carbon/tkMacOSXInit.c b/carbon/tkMacOSXInit.c
new file mode 100644
index 0000000..7e5803d
--- /dev/null
+++ b/carbon/tkMacOSXInit.c
@@ -0,0 +1,599 @@
+/*
+ * tkMacOSXInit.c --
+ *
+ * This file contains Mac OS X -specific interpreter initialization
+ * functions.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+
+#include <sys/stat.h>
+#include <sys/utsname.h>
+#include <mach-o/dyld.h>
+#include <mach-o/getsect.h>
+
+/*
+ * Define the following to 0 to not attempt to use an undocumented SPI to
+ * notify the window server that an unbundled executable is a full GUI
+ * application after loading Tk.
+ */
+
+#ifndef MAC_OSX_TK_USE_CPS_SPI
+#define MAC_OSX_TK_USE_CPS_SPI 1
+#endif
+
+/*
+ * 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 {
+ CFStringEncoding numKey;
+ const 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"},
+ {0, NULL}
+};
+
+Tcl_Encoding TkMacOSXCarbonEncoding = NULL;
+
+/*
+ * If the App is in an App package, then we want to add the Scripts directory
+ * to the auto_path.
+ */
+
+static char scriptPath[PATH_MAX + 1] = "";
+
+float tkMacOSXToolboxVersionNumber = 0;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ Tcl_Interp *interp)
+{
+ static char tkLibPath[PATH_MAX + 1];
+ static int initialized = 0;
+
+ Tk_MacOSXSetupTkNotifier();
+
+ /*
+ * Since it is possible for TkInit to be called multiple times and we
+ * don't want to do the following initialization multiple times we protect
+ * against doing it more than once.
+ */
+
+ if (!initialized) {
+ int bundledExecutable = 0;
+ CFBundleRef bundleRef;
+ CFURLRef bundleUrl = NULL;
+ CFStringEncoding encoding;
+ const char *encodingStr = NULL;
+ int i;
+ struct utsname name;
+ long osVersion = 0;
+ struct stat st;
+
+ initialized = 1;
+
+ /*
+ * Initialize/check OS version variable for runtime checks.
+ */
+
+ if (!uname(&name)) {
+ osVersion = strtol(name.release, NULL, 10) - 4;
+ }
+ if (osVersion && osVersion < (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10) {
+ Tcl_Panic("Mac OS X 10.%d or later required !",
+ (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10);
+ }
+ TK_IF_MAC_OS_X_API (3, &kHIToolboxVersionNumber,
+ tkMacOSXToolboxVersionNumber = kHIToolboxVersionNumber;
+ ) TK_ELSE_MAC_OS_X (3,
+ if (osVersion > 5) {
+ tkMacOSXToolboxVersionNumber = INFINITY;
+ } else if (osVersion >= 3) {
+ static const float tbVersions[3] = {
+ kHIToolboxVersionNumber10_3,
+ kHIToolboxVersionNumber10_4,
+ kHIToolboxVersionNumber10_5,
+ };
+
+ tkMacOSXToolboxVersionNumber = tbVersions[osVersion-3];
+ }
+ ) TK_ENDIF
+
+ /*
+ * 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?
+ */
+
+#ifdef TK_FRAMEWORK
+ if (Tcl_MacOSXOpenVersionedBundleResources(interp,
+ "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 1, PATH_MAX,
+ tkLibPath) != TCL_OK)
+#endif
+ {
+ /* Tk.framework not found, check if resource file is open */
+ Handle rsrc = Get1NamedResource('CURS', "\phand");
+ if (rsrc) {
+ ReleaseResource(rsrc);
+ } else {
+#ifndef __LP64__
+ const struct mach_header *image;
+ char *data = NULL;
+ uint32_t size;
+ int fd = -1;
+ char fileName[L_tmpnam + 15];
+ uint32_t i, n;
+
+ /* Get resource data from __tk_rsrc section of tk dylib file*/
+ n = _dyld_image_count();
+ for (i = 0; i < n; i++) {
+ image = _dyld_get_image_header(i);
+ if (image) {
+ data = getsectdatafromheader(image, SEG_TEXT,
+ "__tk_rsrc", (void *) &size);
+ if (data) {
+ data += _dyld_get_image_vmaddr_slide(i);
+ break;
+ }
+ }
+ }
+ while (data) {
+ FSRef ref;
+ SInt16 refNum;
+
+ /*
+ * Write resource data to temporary file and open it.
+ */
+
+ strcpy(fileName, P_tmpdir);
+ if (fileName[strlen(fileName) - 1] != '/') {
+ strcat(fileName, "/");
+ }
+ strcat(fileName, "tkMacOSX_XXXXXX");
+ fd = mkstemp(fileName);
+ if (fd == -1) {
+ break;
+ }
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ if (write(fd, data, size) == -1) {
+ break;
+ }
+ if(ChkErr(FSPathMakeRef, (unsigned char *) fileName, &ref,
+ NULL) != noErr) {
+ break;
+ }
+ ChkErr(FSOpenResourceFile, &ref, 0, NULL, fsRdPerm,
+ &refNum);
+ break;
+ }
+ if (fd != -1) {
+ unlink(fileName);
+ close(fd);
+ }
+#endif /* __LP64__ */
+ }
+ }
+
+ /*
+ * If we are loaded into an executable that is not a bundled
+ * application, the window server does not let us come to the
+ * foreground. For such an executable, notify the window server that
+ * we are now a full GUI application.
+ */
+
+ /* Check whether we are a bundled executable: */
+ bundleRef = CFBundleGetMainBundle();
+ if (bundleRef) {
+ bundleUrl = CFBundleCopyBundleURL(bundleRef);
+ }
+ if (bundleUrl) {
+ /*
+ * A bundled executable is two levels down from its main bundle
+ * directory (e.g. Wish.app/Contents/MacOS/Wish), whereas an
+ * unbundled executable's main bundle directory is just the
+ * directory containing the executable. So to check whether we are
+ * bundled, we delete the last three path components of the
+ * executable's url and compare the resulting url with the main
+ * bundle url.
+ */
+
+ int j = 3;
+ CFURLRef url = CFBundleCopyExecutableURL(bundleRef);
+
+ while (url && j--) {
+ CFURLRef parent =
+ CFURLCreateCopyDeletingLastPathComponent(NULL, url);
+
+ CFRelease(url);
+ url = parent;
+ }
+ if (url) {
+ bundledExecutable = CFEqual(bundleUrl, url);
+ CFRelease(url);
+ }
+ CFRelease(bundleUrl);
+ }
+
+ /*
+ * If we are not a bundled executable, notify the window server that
+ * we are a foregroundable app.
+ */
+
+ if (!bundledExecutable) {
+ OSStatus err = procNotFound;
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+
+ TK_IF_MAC_OS_X_API (3, TransformProcessType,
+ err = ChkErr(TransformProcessType, &psn,
+ kProcessTransformToForegroundApplication);
+ ) TK_ENDIF
+#if MAC_OSX_TK_USE_CPS_SPI
+ if (err != noErr) {
+ /*
+ * When building or running on 10.2 or when the above fails,
+ * attempt to use undocumented CPS SPI to notify the window
+ * server. Load the SPI symbol dynamically, so that we don't
+ * break if it ever disappears or changes its name.
+ */
+
+ TkMacOSXInitNamedSymbol(CoreGraphics, OSStatus,
+ CPSEnableForegroundOperation, ProcessSerialNumberPtr);
+ if (CPSEnableForegroundOperation) {
+ ChkErr(CPSEnableForegroundOperation, &psn);
+ }
+ }
+#endif /* MAC_OSX_TK_USE_CPS_SPI */
+ }
+
+ TkMacOSXInitAppleEvents(interp);
+ TkMacOSXInitCarbonEvents(interp);
+ TkMacOSXInitMenus(interp);
+ TkMacOSXUseAntialiasedText(interp, -1);
+ TkMacOSXInitCGDrawing(interp, TRUE, 0);
+ TkMacOSXInitKeyboard(interp);
+
+ 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);
+ }
+
+ /*
+ * FIXME: Close stdin & stdout for remote debugging otherwise we will
+ * fight with gdb for stdin & stdout
+ */
+
+ if (getenv("XCNOSTDIN") != NULL) {
+ close(0);
+ close(1);
+ }
+
+ /*
+ * If we don't have a TTY and stdin is a special character file of
+ * length 0, (e.g. /dev/null, which is what Finder sets when double
+ * clicking Wish) then use the Tk based console interpreter.
+ */
+
+ if (getenv("TK_CONSOLE") ||
+ (!isatty(0) && (fstat(0, &st) ||
+ (S_ISCHR(st.st_mode) && st.st_blocks == 0)))) {
+ Tk_InitConsoleChannels(interp);
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDIN));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDOUT));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDERR));
+
+ /*
+ * Only show the console if we don't have a startup script
+ * and tcl_interactive hasn't been set already.
+ */
+
+ if (Tcl_GetStartupScript(NULL) == NULL) {
+ const char *intvar = Tcl_GetVar(interp,
+ "tcl_interactive", TCL_GLOBAL_ONLY);
+
+ if (intvar == NULL) {
+ Tcl_SetVar(interp, "tcl_interactive", "1",
+ TCL_GLOBAL_ONLY);
+ }
+ }
+ if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ }
+ }
+
+ if (tkLibPath[0] != '\0') {
+ Tcl_SetVar(interp, "tk_library", tkLibPath, TCL_GLOBAL_ONLY);
+ }
+
+ if (scriptPath[0] != '\0') {
+ Tcl_SetVar(interp, "auto_path", scriptPath,
+ TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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(
+ 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);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDefaultStartupScript --
+ *
+ * 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.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Tcl_SetStartupScript() called when AppMain.tcl found.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void
+TkMacOSXDefaultStartupScript(void)
+{
+ CFBundleRef bundleRef;
+
+ bundleRef = CFBundleGetMainBundle();
+
+ if (bundleRef != NULL) {
+ CFURLRef appMainURL = CFBundleCopyResourceURL(bundleRef,
+ CFSTR("AppMain"), CFSTR("tcl"), CFSTR("Scripts"));
+
+ if (appMainURL != NULL) {
+ CFURLRef scriptFldrURL;
+ char startupScript[PATH_MAX + 1];
+
+ if (CFURLGetFileSystemRepresentation (appMainURL, true,
+ (unsigned char *) startupScript, PATH_MAX)) {
+ Tcl_SetStartupScript(Tcl_NewStringObj(startupScript,-1), NULL);
+ scriptFldrURL = CFURLCreateCopyDeletingLastPathComponent(NULL,
+ appMainURL);
+ if (scriptFldrURL != NULL) {
+ CFURLGetFileSystemRepresentation(scriptFldrURL, true,
+ (unsigned char *) scriptPath, PATH_MAX);
+ CFRelease(scriptFldrURL);
+ }
+ }
+ CFRelease(appMainURL);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNamedSymbol --
+ *
+ * Dynamically acquire address of a named symbol from a loaded dynamic
+ * library, so that we can use API that may not be available on all OS
+ * versions. If module is non-NULL and not the empty string, use twolevel
+ * namespace lookup.
+ *
+ * Results:
+ * Address of given symbol or NULL if unavailable.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void*
+TkMacOSXGetNamedSymbol(
+ const char* module,
+ const char* symbol)
+{
+ NSSymbol nsSymbol = NULL;
+
+ if (module && *module) {
+ if (NSIsSymbolNameDefinedWithHint(symbol, module)) {
+ nsSymbol = NSLookupAndBindSymbolWithHint(symbol, module);
+ }
+ } else {
+ if (NSIsSymbolNameDefined(symbol)) {
+ nsSymbol = NSLookupAndBindSymbol(symbol);
+ }
+ }
+
+ if (!nsSymbol) {
+ return NULL;
+ }
+ return NSAddressOfSymbol(nsSymbol);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetStringObjFromCFString --
+ *
+ * Get a string object from a CFString as efficiently as possible.
+ *
+ * Results:
+ * New string object or NULL if conversion failed.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE Tcl_Obj*
+TkMacOSXGetStringObjFromCFString(
+ CFStringRef str)
+{
+ Tcl_Obj *obj = NULL;
+ const char *c = CFStringGetCStringPtr(str, kCFStringEncodingUTF8);
+
+ if (c) {
+ obj = Tcl_NewStringObj(c, -1);
+ } else {
+ CFRange all = CFRangeMake(0, CFStringGetLength(str));
+ CFIndex len;
+
+ if (CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false, NULL,
+ 0, &len) > 0 && len < INT_MAX) {
+ obj = Tcl_NewObj();
+ Tcl_SetObjLength(obj, len);
+ CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false,
+ (UInt8*) obj->bytes, len, NULL);
+ }
+ }
+ return obj;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXInt.h b/carbon/tkMacOSXInt.h
new file mode 100644
index 0000000..48635c8
--- /dev/null
+++ b/carbon/tkMacOSXInt.h
@@ -0,0 +1,186 @@
+/*
+ * tkMacOSXInt.h --
+ *
+ * Declarations of Macintosh specific shared variables and procedures.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _TKMACINT
+#define _TKMACINT
+
+#ifndef _TKINT
+#include "tkInt.h"
+#endif
+
+#define TextStyle MacTextStyle
+#include <Carbon/Carbon.h>
+#undef TextStyle
+
+/*
+ * Include platform specific public interfaces.
+ */
+
+#ifndef _TKMAC
+#include "tkMacOSX.h"
+#endif
+
+struct TkWindowPrivate {
+ TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
+ CGrafPtr grafPtr;
+ CGContextRef context;
+ ControlRef rootControl;
+ int xOff; /* X offset from toplevel window */
+ int yOff; /* Y offset from toplevel window */
+ CGSize size;
+ HIShapeRef visRgn; /* Visible region of window */
+ HIShapeRef aboveVisRgn; /* Visible region of window & its children */
+ CGRect drawRect; /* Clipped drawing rect */
+ 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 0x01
+#define TK_CLIP_INVALID 0x02
+#define TK_HOST_EXISTS 0x04
+#define TK_DRAWN_UNDER_MENU 0x08
+#define TK_CLIPPED_DRAW 0x10
+#define TK_IS_PIXMAP 0x20
+#define TK_IS_BW_PIXMAP 0x40
+
+/*
+ * 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 tkMacOSX.h.
+ */
+
+typedef struct {
+ Tk_MacOSXEmbedRegisterWinProc *registerWinProc;
+ Tk_MacOSXEmbedGetGrafPortProc *getPortProc;
+ Tk_MacOSXEmbedMakeContainerExistProc *containerExistProc;
+ Tk_MacOSXEmbedGetClipProc *getClipProc;
+ Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc;
+} TkMacOSXEmbedHandler;
+
+MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler;
+
+/*
+ * Defines for zero-sized GC cache
+ */
+
+typedef struct {} TkpGCCache;
+#define TkpInitGCCache(gc)
+#define TkpFreeGCCache(gc)
+
+/*
+ * 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
+
+/*
+ * Defines for tkTextDisp.c
+ */
+
+#define TK_LAYOUT_WITH_BASE_CHUNKS 1
+#define TK_DRAW_IN_CONTEXT 1
+
+#if !TK_DRAW_IN_CONTEXT
+MODULE_SCOPE int TkMacOSXCompareColors(unsigned long c1, unsigned long c2);
+#endif
+
+/*
+ * Globals shared among TkAqua.
+ */
+
+MODULE_SCOPE MenuHandle tkCurrentAppleMenu; /* Handle to current Apple Menu */
+MODULE_SCOPE MenuHandle tkAppleMenu; /* Handle to default Apple Menu */
+MODULE_SCOPE MenuHandle tkFileMenu; /* Handles to menus */
+MODULE_SCOPE MenuHandle tkEditMenu; /* Handles to menus */
+MODULE_SCOPE 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
+ */
+MODULE_SCOPE TkMacOSXWindowList *tkMacOSXWindowListPtr; /* List of toplevels */
+MODULE_SCOPE Tcl_Encoding TkMacOSXCarbonEncoding;
+
+/*
+ * Prototypes of internal procs not in the stubs table.
+ */
+
+MODULE_SCOPE void TkMacOSXDefaultStartupScript(void);
+#if 0
+MODULE_SCOPE int XSetClipRectangles(Display *d, GC gc, int clip_x_origin,
+ int clip_y_origin, XRectangle* rectangles, int n, int ordering);
+#endif
+MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x,
+ int y, int width, int height);
+MODULE_SCOPE void TkpRetainRegion(TkRegion r);
+MODULE_SCOPE void TkpReleaseRegion(TkRegion r);
+
+/*
+ * Include the stubbed internal platform-specific API.
+ */
+
+#include "tkIntPlatDecls.h"
+
+#endif /* _TKMACINT */
diff --git a/carbon/tkMacOSXKeyEvent.c b/carbon/tkMacOSXKeyEvent.c
new file mode 100644
index 0000000..d801f68
--- /dev/null
+++ b/carbon/tkMacOSXKeyEvent.c
@@ -0,0 +1,1168 @@
+/*
+ * tkMacOSXKeyEvent.c --
+ *
+ * This file implements functions that decode & handle keyboard events on
+ * MacOS X.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXPrivate.h"
+#include "tkMacOSXEvent.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_KEYBOARD
+#endif
+*/
+
+typedef struct {
+ WindowRef whichWindow;
+ int global_x, global_y;
+ int local_x, local_y;
+ unsigned int state;
+ UInt32 keyCode;
+ UInt32 keyModifiers;
+ UInt32 message;
+ unsigned char ch;
+} KeyEventData;
+
+static Tk_Window grabWinPtr = NULL;
+ /* Current grab window, NULL if no grab. */
+static Tk_Window keyboardGrabWinPtr = NULL;
+ /* Current keyboard grab window. */
+static UInt32 deadKeyStateUp = 0;
+ /* The deadkey state for the current sequence
+ * of keyup events or 0 if not in a deadkey
+ * sequence */
+static UInt32 deadKeyStateDown = 0;
+ /* Ditto for keydown */
+
+/*
+ * Declarations for functions used only in this file.
+ */
+
+static int GenerateKeyEvent(UInt32 eKind, KeyEventData *e,
+ UInt32 savedKeyCode, UInt32 savedModifiers,
+ const UniChar *chars, int numChars);
+static TextEncoding GetKCHREncoding(ScriptCode script, SInt32 layoutid);
+static int GetKeyboardLayout(Ptr *resourcePtr,
+ TextEncoding *encodingPtr);
+static int InitKeyData(KeyEventData *keyEventDataPtr);
+static int InitKeyEvent(XEvent *eventPtr, KeyEventData *e,
+ UInt32 savedKeyCode, UInt32 savedModifiers);
+static int KeycodeToUnicodeViaKCHRResource(UniChar *uniChars,
+ int maxChars, Ptr kchr, TextEncoding encoding,
+ EventKind eKind, UInt32 keycode, UInt32 modifiers,
+ UInt32 *deadKeyStatePtr);
+static int KeycodeToUnicodeViaUnicodeResource(UniChar *uniChars,
+ int maxChars, Ptr uchr, EventKind eKind,
+ UInt32 keycode, UInt32 modifiers,
+ UInt32 *deadKeyStatePtr);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessKeyboardEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ static UInt32 savedKeyCode = 0;
+ static UInt32 savedModifiers = 0;
+ static UniChar savedChar = 0;
+ OSStatus err;
+ KeyEventData keyEventData;
+ MenuRef menuRef;
+ MenuItemIndex menuItemIndex;
+ int eventGenerated;
+ UniChar uniChars[5]; /* make this larger, if needed */
+ UInt32 uniCharsLen = 0;
+
+ if (!InitKeyData(&keyEventData)) {
+ statusPtr->err = 1;
+ return false;
+ }
+
+ /*
+ * Because of the way that Tk operates, we can't in general funnel menu
+ * accelerators through IsMenuKeyEvent. Tk treats accelerators as mere
+ * decoration, and the user has to install bindings to get them to fire.
+ *
+ * However, the only way to trigger the Hide & Hide Others functions is by
+ * invoking the Menu command for Hide. So there is no nice way to provide a
+ * Tk command to hide the app which would be available for a binding. So I
+ * am going to hijack Command-H and Command-Shift-H here, and run the menu
+ * commands. Since the HI Guidelines explicitly reserve these for Hide,
+ * this isn't such a bad thing. Also, if you do rebind Command-H to another
+ * menu item, Hide will lose its binding.
+ *
+ * Note that I don't really do anything at this point, I just mark
+ * stopProcessing as 0 and return, and then the RecieveAndProcessEvent code
+ * will dispatch the event to the default handler.
+ */
+
+ if ((eventPtr->eKind == kEventRawKeyDown
+ || eventPtr->eKind == kEventRawKeyRepeat)
+ && IsMenuKeyEvent(tkCurrentAppleMenu, eventPtr->eventRef,
+ kMenuEventQueryOnly, &menuRef, &menuItemIndex)) {
+ MenuCommand menuCmd;
+
+ GetMenuItemCommandID (menuRef, menuItemIndex, &menuCmd);
+ switch (menuCmd) {
+ case kHICommandHide:
+ case kHICommandHideOthers:
+ case kHICommandShowAll:
+ case kHICommandPreferences:
+ case kHICommandQuit:
+ statusPtr->stopProcessing = 0;
+
+ /*
+ * TODO: may not be on event on queue.
+ */
+
+ return 0;
+ default:
+ break;
+ }
+ }
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamKeyMacCharCodes, typeChar, NULL,
+ sizeof(keyEventData.ch), NULL, &keyEventData.ch);
+ if (err != noErr) {
+ statusPtr->err = 1;
+ return false;
+ }
+ err = ChkErr(GetEventParameter, eventPtr->eventRef, kEventParamKeyCode,
+ typeUInt32, NULL, sizeof(keyEventData.keyCode), NULL,
+ &keyEventData.keyCode);
+ if (err != noErr) {
+ statusPtr->err = 1;
+ return false;
+ }
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamKeyModifiers, typeUInt32, NULL,
+ sizeof(keyEventData.keyModifiers), NULL,
+ &keyEventData.keyModifiers);
+ if (err != noErr) {
+ statusPtr->err = 1;
+ return false;
+ }
+
+ switch (eventPtr->eKind) {
+ case kEventRawKeyUp:
+ case kEventRawKeyDown:
+ case kEventRawKeyRepeat: {
+ UInt32 *deadKeyStatePtr;
+
+ if (kEventRawKeyDown == eventPtr->eKind) {
+ deadKeyStatePtr = &deadKeyStateDown;
+ } else {
+ deadKeyStatePtr = &deadKeyStateUp;
+ }
+
+ uniCharsLen = TkMacOSXKeycodeToUnicode(uniChars,
+ sizeof(uniChars)/sizeof(*uniChars), eventPtr->eKind,
+ keyEventData.keyCode, keyEventData.keyModifiers,
+ deadKeyStatePtr);
+ break;
+ }
+ }
+
+ if (kEventRawKeyUp == eventPtr->eKind) {
+ /*
+ * For some reason the deadkey processing for KeyUp doesn't work
+ * sometimes, so we fudge and use the last detected KeyDown.
+ */
+
+ if ((0 == uniCharsLen) && (0 != savedChar)) {
+ uniChars[0] = savedChar;
+ uniCharsLen = 1;
+ }
+
+ /*
+ * Suppress keyup events while we have a deadkey sequence on keydown.
+ * We still *do* want to collect deadkey state in this situation if
+ * the system provides it, that's why we do this only after
+ * TkMacOSXKeycodeToUnicode().
+ */
+
+ if (0 != deadKeyStateDown) {
+ uniCharsLen = 0;
+ }
+ }
+
+ keyEventData.message = keyEventData.ch|(keyEventData.keyCode << 8);
+
+ eventGenerated = GenerateKeyEvent(eventPtr->eKind, &keyEventData,
+ savedKeyCode, savedModifiers, uniChars, uniCharsLen);
+
+ savedModifiers = keyEventData.keyModifiers;
+
+ if ((kEventRawKeyDown == eventPtr->eKind) && (uniCharsLen > 0)) {
+ savedChar = uniChars[0];
+ } else {
+ savedChar = 0;
+ }
+
+ statusPtr->stopProcessing = 1;
+
+ if (eventGenerated == 0) {
+ savedKeyCode = keyEventData.message;
+ return false;
+ }
+ if (eventGenerated == -1) {
+ savedKeyCode = 0;
+ statusPtr->stopProcessing = 0;
+ return false;
+ }
+ savedKeyCode = 0;
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateKeyEvent --
+ *
+ * Given Macintosh keyUp, keyDown & autoKey events (in their "raw" form)
+ * and a list of unicode characters this function generates the
+ * appropriate X key events.
+ *
+ * Parameter eKind is a raw keyboard event. e contains the data sent with
+ * the event. savedKeyCode and savedModifiers contain the values from the
+ * last event that came before (see TkMacOSXProcessKeyboardEvent()).
+ * chars/numChars has the Unicode characters for which we want to create
+ * events.
+ *
+ * Results:
+ * 1 if an event was generated, -1 for any error.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GenerateKeyEvent(
+ UInt32 eKind,
+ KeyEventData * e,
+ UInt32 savedKeyCode,
+ UInt32 savedModifiers,
+ const UniChar * chars,
+ int numChars)
+{
+ XEvent event;
+ int i;
+
+ if (-1 == InitKeyEvent(&event, e, savedKeyCode, savedModifiers)) {
+ return -1;
+ }
+
+ if (kEventRawKeyModifiersChanged == eKind) {
+ 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);
+ } else {
+ for (i = 0; i < numChars; ++i) {
+ /*
+ * Encode one char in the trans_chars array that was already
+ * introduced for MS Windows. Don't encode the string, if it is a
+ * control character but was not generated with a real control
+ * modifier. Such control characters get generated by KeyTrans()
+ * for special keys, but we rather want to identify those by their
+ * KeySyms.
+ */
+
+ event.xkey.trans_chars[0] = 0;
+ if ((controlKey & e->keyModifiers) || (chars[i] >= ' ')) {
+ int done = Tcl_UniCharToUtf(chars[i],event.xkey.trans_chars);
+
+ event.xkey.trans_chars[done] = 0;
+ }
+
+ 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;
+ default:
+ TkMacOSXDbgMsg("Invalid parameter eKind %ld", eKind);
+ return -1;
+ }
+ }
+ }
+
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitKeyData --
+ *
+ * This routine initializes a KeyEventData structure by asking the OS and
+ * Tk for all the global information needed here.
+ *
+ * Results:
+ * True if the current front window can be found in Tk data structures,
+ * false otherwise.
+ *
+ * Side Effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InitKeyData(
+ KeyEventData *keyEventDataPtr)
+{
+ memset(keyEventDataPtr, 0, sizeof(*keyEventDataPtr));
+
+ keyEventDataPtr->whichWindow = ActiveNonFloatingWindow();
+ if (keyEventDataPtr->whichWindow == NULL) {
+ return false;
+ }
+
+ XQueryPointer(NULL, None, NULL, NULL, &keyEventDataPtr->global_x,
+ &keyEventDataPtr->global_y, &keyEventDataPtr->local_x,
+ &keyEventDataPtr->local_y, &keyEventDataPtr->state);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitKeyEvent --
+ *
+ * Initialize an XEvent structure by asking Tk for global information.
+ * Also uses a KeyEventData structure and other current state.
+ *
+ * Results:
+ * 1 on success, -1 for any error.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+/*
+ * We have a general 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). OTOH Option-d actually produces a real character
+ * on MacOS, namely a mathematical delta.
+ *
+ * The current behaviour is that a binding goes by the combinations of
+ * modifiers and base keysym, that is Option-d. The string value of the event
+ * is the mathematical delta character, so if no binding calls [break], the
+ * text widget will insert that character.
+ *
+ * Note that this is similar to control combinations on all platforms. They
+ * also generate events that have the base character as keysym and a real
+ * control character as character value. So Ctrl+C gets us the keysym XK_C, the
+ * modifier Control (so you can bind <Control-C>) and a string value as
+ * "\u0003".
+ *
+ * For a different solutions we may want for the event to contain keysyms for
+ * *both* the 'Opt-d' side of things and the mathematical delta. Then a binding
+ * on Opt-d will trigger, but a binding on mathematical delta would also
+ * trigger. This would require changes in the core, though.
+ */
+
+static int
+InitKeyEvent(
+ XEvent * eventPtr,
+ KeyEventData * e,
+ UInt32 savedKeyCode,
+ UInt32 savedModifiers)
+{
+ Window window;
+ Tk_Window tkwin;
+ 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.
+ */
+
+ window = TkMacOSXGetXWindow(e->whichWindow);
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+
+ if (!tkwin) {
+ TkMacOSXDbgMsg("tkwin == NULL");
+ return -1;
+ }
+
+ tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ if (!tkwin) {
+ TkMacOSXDbgMsg("tkwin == NULL");
+ return -1;
+ }
+
+ memset(eventPtr, 0, sizeof(XEvent));
+ eventPtr->xany.send_event = false;
+ eventPtr->xany.serial = Tk_Display(tkwin)->request;
+
+ eventPtr->xkey.same_screen = true;
+ eventPtr->xkey.subwindow = None;
+ eventPtr->xkey.time = TkpGetMS();
+ eventPtr->xkey.x_root = e->global_x;
+ eventPtr->xkey.y_root = e->global_y;
+ eventPtr->xkey.window = Tk_WindowId(tkwin);
+ eventPtr->xkey.display = Tk_Display(tkwin);
+ eventPtr->xkey.root = XRootWindow(Tk_Display(tkwin), 0);
+ eventPtr->xkey.state = e->state;
+ eventPtr->xkey.trans_chars[0] = 0;
+
+ Tk_TopCoordsToWindow(tkwin, e->local_x, e->local_y, &eventPtr->xkey.x,
+ &eventPtr->xkey.y);
+
+ eventPtr->xkey.keycode = e->ch | ((savedKeyCode & charCodeMask) << 8) |
+ ((e->message&keyCodeMask) << 8);
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetKeyboardLayout --
+ *
+ * Queries the OS for a pointer to a keyboard resource.
+ *
+ * This function works with the keyboard layout switch menu. It uses
+ * Keyboard Layout Services, where available.
+ *
+ * Results:
+ * 1 if there is returned a Unicode 'uchr' resource in *resourcePtr, 0 if
+ * it is a classic 'KCHR' resource. A pointer to the actual resource data
+ * goes into *resourcePtr. If the resource is a 'KCHR' resource, the
+ * corresponding Mac encoding goes into *encodingPtr.
+ *
+ * Side effects:
+ * Sets some internal static variables.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetKeyboardLayout(
+ Ptr *resourcePtr,
+ TextEncoding *encodingPtr)
+{
+ static KeyboardLayoutRef lastLayout = NULL;
+ static SInt32 lastLayoutId;
+ static TextEncoding lastEncoding = kTextEncodingMacRoman;
+ static Ptr uchr = NULL;
+ static Ptr KCHR = NULL;
+ int hasLayoutChanged = false;
+ KeyboardLayoutRef currentLayout = NULL;
+ SInt32 currentLayoutId = 0;
+ ScriptCode currentKeyScript;
+
+ currentKeyScript = GetScriptManagerVariable(smKeyScript);
+
+ /*
+ * Use the Keyboard Layout Services.
+ */
+
+ KLGetCurrentKeyboardLayout(&currentLayout);
+
+ if (currentLayout != NULL) {
+ /*
+ * The layout pointer could in theory be the same for different
+ * layouts, only the id gives us the information that the
+ * keyboard has actually changed. OTOH the layout object can
+ * also change and it could still be the same layoutid.
+ */
+
+ KLGetKeyboardLayoutProperty(currentLayout, kKLIdentifier,
+ (const void **) &currentLayoutId);
+
+ if ((lastLayout != currentLayout)
+ || (lastLayoutId != currentLayoutId)) {
+#ifdef TK_MAC_DEBUG_KEYBOARD
+ TkMacOSXDbgMsg("Use KLS");
+#endif
+ hasLayoutChanged = true;
+
+ /*
+ * Reinitialize all relevant variables.
+ */
+
+ lastLayout = currentLayout;
+ lastLayoutId = currentLayoutId;
+ uchr = NULL;
+ KCHR = NULL;
+
+ if ((KLGetKeyboardLayoutProperty(currentLayout,
+ kKLuchrData, (const void **) &uchr) == noErr)
+ && (uchr != NULL)) {
+ /* done */
+ } else if ((KLGetKeyboardLayoutProperty(currentLayout,
+ kKLKCHRData, (const void**)&KCHR) == noErr)
+ && (KCHR != NULL)) {
+ /* done */
+ }
+ }
+ }
+
+ if (hasLayoutChanged) {
+#ifdef TK_MAC_DEBUG_KEYBOARD
+ if (KCHR) {
+ TkMacOSXDbgMsg("New 'KCHR' layout %ld", currentLayoutId);
+ } else if (uchr) {
+ TkMacOSXDbgMsg("New 'uchr' layout %ld", currentLayoutId);
+ } else {
+ TkMacOSXDbgMsg("Use cached layout (should have been %ld)",
+ currentLayoutId);
+ }
+#endif
+
+ deadKeyStateUp = deadKeyStateDown = 0;
+
+ /*
+ * If we did get a new 'KCHR', compute its encoding and put it into
+ * lastEncoding.
+ *
+ * If we didn't get a new 'KCHR' and if we have no 'uchr' either, get
+ * some 'KCHR' from the OS cache and leave lastEncoding at its current
+ * value. This should better not happen, it doesn't really work.
+ */
+
+ if (KCHR) {
+ lastEncoding = GetKCHREncoding(currentKeyScript, currentLayoutId);
+#ifdef TK_MAC_DEBUG_KEYBOARD
+ TkMacOSXDbgMsg("New 'KCHR' encoding %lu (%lu + 0x%lX)",
+ lastEncoding, lastEncoding & 0xFFFFL,
+ lastEncoding & ~0xFFFFL);
+#endif
+ } else if (!uchr) {
+ KCHR = (Ptr)(intptr_t) GetScriptManagerVariable(smKCHRCache);
+ }
+ }
+
+ if (uchr) {
+ *resourcePtr = uchr;
+ return 1;
+ }
+ *resourcePtr = KCHR;
+ *encodingPtr = lastEncoding;
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetKCHREncoding --
+ *
+ * Upgrade a WorldScript code to a TEC encoding based on the keyboard
+ * layout id.
+ *
+ * Results:
+ * The TEC code that corresponds best to the combination of WorldScript
+ * code and 'KCHR' id.
+ *
+ * Side effects:
+ * None.
+ *
+ * Rationale and Notes:
+ * WorldScript codes are sometimes not unique encodings. E.g. Icelandic
+ * uses script smRoman (0), but the actual encoding is
+ * kTextEncodingMacIcelandic (37). ftp://ftp.unicode.org/Public
+ * /MAPPINGS/VENDORS/APPLE/README.TXT has a good summary of these
+ * variants. So we need to upgrade the script to an encoding with
+ * GetTextEncodingFromScriptInfo().
+ *
+ * 'KCHR' ids are usually region codes (see the comments in Script.h).
+ * Where they are not, we get a paramErr from the OS function and have
+ * appropriate fallbacks.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static TextEncoding
+GetKCHREncoding(
+ ScriptCode script,
+ SInt32 layoutid)
+{
+ RegionCode region = layoutid;
+ TextEncoding encoding = script;
+
+ if (GetTextEncodingFromScriptInfo(script, kTextLanguageDontCare, region,
+ &encoding) == noErr) {
+ return encoding;
+ }
+
+ /*
+ * GetTextEncodingFromScriptInfo() doesn't know about more exotic layouts.
+ * This provides a fallback for good measure. In an ideal world, exotic
+ * layouts would always provide a 'uchr' resource anyway, so we wouldn't
+ * need this.
+ *
+ * We can add more keyboard layouts, if we get actual complaints. Farsi or
+ * other Celtic/Gaelic layouts would be candidates.
+ */
+
+ switch (layoutid) {
+ /*
+ * Icelandic and Faroese (planned). These layouts are sold by Apple
+ * Iceland for legacy applications.
+ */
+
+ case 1800: case 1821:
+ return kTextEncodingMacIcelandic;
+
+ /*
+ * Irish and Welsh. These layouts are mentioned in <Script.h>.
+ *
+ * FIXME: This may have to be kTextEncodingMacGaelic instead, but I
+ * can't locate layouts of this type for testing.
+ */
+
+ case 581: case 779:
+ return kTextEncodingMacCeltic;
+ }
+
+ /*
+ * The valid script codes are also the valid default encoding codes, so if
+ * nothing else helps, fall back on those.
+ */
+
+ return script;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * KeycodeToUnicodeViaUnicodeResource --
+ *
+ * Given MacOS key event data this function generates the Unicode
+ * characters. It does this using a 'uchr' and the UCKeyTranslate API.
+ *
+ * The parameter deadKeyStatePtr can be NULL, if no deadkey handling is
+ * needed.
+ *
+ * Tested and known to work with US, Hebrew, Greek and Russian layouts as
+ * well as "Unicode Hex Input".
+ *
+ * Results:
+ * The number of characters generated if any, 0 if we are waiting for
+ * another byte of a dead-key sequence. Fills in the uniChars array with a
+ * Unicode string.
+ *
+ * Side Effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+KeycodeToUnicodeViaUnicodeResource(
+ UniChar *uniChars,
+ int maxChars,
+ Ptr uchr,
+ EventKind eKind,
+ UInt32 keycode,
+ UInt32 modifiers,
+ UInt32 *deadKeyStatePtr)
+{
+ int action;
+ unsigned long keyboardType;
+ OptionBits options = 0;
+ UInt32 dummy_state;
+ UniCharCount actuallength;
+ OSStatus err;
+
+ keycode &= 0xFF;
+ modifiers = (modifiers >> 8) & 0xFF;
+ keyboardType = LMGetKbdType();
+
+ if (NULL==deadKeyStatePtr) {
+ options = kUCKeyTranslateNoDeadKeysMask;
+ dummy_state = 0;
+ deadKeyStatePtr = &dummy_state;
+ }
+
+ switch(eKind) {
+ case kEventRawKeyDown:
+ action = kUCKeyActionDown;
+ break;
+ case kEventRawKeyUp:
+ action = kUCKeyActionUp;
+ break;
+ case kEventRawKeyRepeat:
+ action = kUCKeyActionAutoKey;
+ break;
+ default:
+ TkMacOSXDbgMsg("Invalid parameter eKind %d", eKind);
+ return 0;
+ }
+
+ err = ChkErr(UCKeyTranslate, (const UCKeyboardLayout *) uchr, keycode,
+ action, modifiers, keyboardType, options, deadKeyStatePtr,
+ maxChars, &actuallength, uniChars);
+
+ if ((0 == actuallength) && (0 != *deadKeyStatePtr)) {
+ /*
+ * More data later
+ */
+
+ return 0;
+ }
+
+ /*
+ * Some IMEs leave residue. :-(
+ */
+
+ *deadKeyStatePtr = 0;
+
+ if (err != noErr) {
+ actuallength = 0;
+ }
+
+ return actuallength;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * KeycodeToUnicodeViaKCHRResource --
+ *
+ * Given MacOS key event data this function generates the Unicode
+ * characters. It does this using a 'KCHR' and the KeyTranslate API.
+ *
+ * The parameter deadKeyStatePtr can be NULL, if no deadkey handling is
+ * needed.
+ *
+ * Results:
+ * The number of characters generated if any, 0 if we are waiting for
+ * another byte of a dead-key sequence. Fills in the uniChars array with a
+ * Unicode string.
+ *
+ * Side Effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+KeycodeToUnicodeViaKCHRResource(
+ UniChar *uniChars,
+ int maxChars,
+ Ptr kchr,
+ TextEncoding encoding,
+ EventKind eKind,
+ UInt32 keycode,
+ UInt32 modifiers,
+ UInt32 *deadKeyStatePtr)
+{
+ UInt32 result;
+ char macBuff[3];
+ char *macStr;
+ int macStrLen, uniStrLen;
+ UInt32 dummy_state = 0;
+ CFStringRef cfString;
+
+ if (NULL == deadKeyStatePtr) {
+ deadKeyStatePtr = &dummy_state;
+ }
+
+ keycode |= modifiers;
+ result = KeyTranslate(kchr, keycode, deadKeyStatePtr);
+
+ if ((0 == result) && (0 != dummy_state)) {
+ /*
+ * 'dummy_state' gets only filled if the caller did not want deadkey
+ * processing (deadKeyStatePtr was NULL originally), but we still have
+ * a deadkey. We just push the keycode for the space bar to get the
+ * real key value.
+ */
+
+ result = KeyTranslate(kchr, 0x31, deadKeyStatePtr);
+ *deadKeyStatePtr = 0;
+ }
+
+ if ((0 == result) && (0 != *deadKeyStatePtr)) {
+ /*
+ * More data later
+ */
+
+ return 0;
+ }
+
+ macBuff[0] = (char) (result >> 16);
+ macBuff[1] = (char) result;
+ macBuff[2] = 0;
+
+ if (0 != macBuff[0]) {
+ /*
+ * If the first byte is valid, the second is too.
+ */
+
+ macStr = macBuff;
+ macStrLen = 2;
+ } else if (0 != macBuff[1]) {
+ /*
+ * Only the second is valid.
+ */
+
+ macStr = macBuff+1;
+ macStrLen = 1;
+ } else {
+ /*
+ * No valid bytes at all -- shouldn't happen.
+ */
+
+ macStr = NULL;
+ macStrLen = 0;
+ }
+
+ if (macStrLen <= 0) {
+ return 0;
+ }
+
+ /*
+ * Use the CFString conversion routines. This is the easiest and most
+ * compatible way to get from an 8-bit string and a MacOS script code to a
+ * Unicode string.
+ *
+ * FIXME: The system ships with an Irish 'KCHR' but without the
+ * corresponding macCeltic encoding, which triggers the error below. Tcl
+ * doesn't have the macCeltic encoding either right now, so until we get
+ * that, we can just as well stick to this code. The right fix would be to
+ * use the Tcl encodings and add macCeltic and probably others
+ * there. Suitable Unicode data files for the missing encodings are
+ * available from www.evertype.com.
+ */
+
+ cfString = CFStringCreateWithCStringNoCopy(NULL, macStr, encoding,
+ kCFAllocatorNull);
+ if (cfString == NULL) {
+ TkMacOSXDbgMsg("CFString: Can't convert with encoding %ld", encoding);
+ return 0;
+ }
+
+ uniStrLen = CFStringGetLength(cfString);
+ if (uniStrLen > maxChars) {
+ uniStrLen = maxChars;
+ }
+ CFStringGetCharacters(cfString, CFRangeMake(0,uniStrLen), uniChars);
+ CFRelease(cfString);
+
+ return uniStrLen;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXKeycodeToUnicode --
+ *
+ * Given MacOS key event data this function generates the Unicode
+ * characters. It does this using OS resources and APIs.
+ *
+ * The parameter deadKeyStatePtr can be NULL, if no deadkey handling is
+ * needed.
+ *
+ * This function is called from XKeycodeToKeysym() in tkMacOSKeyboard.c.
+ *
+ * Results:
+ * The number of characters generated if any, 0 if we are waiting for
+ * another byte of a dead-key sequence. Fills in the uniChars array with a
+ * Unicode string.
+ *
+ * Side Effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXKeycodeToUnicode(
+ UniChar *uniChars,
+ int maxChars,
+ EventKind eKind,
+ UInt32 keycode,
+ UInt32 modifiers,
+ UInt32 *deadKeyStatePtr)
+{
+ Ptr resource = NULL;
+ TextEncoding encoding;
+
+ if (GetKeyboardLayout(&resource, &encoding)) {
+ return KeycodeToUnicodeViaUnicodeResource(uniChars, maxChars,
+ resource, eKind, keycode, modifiers, deadKeyStatePtr);
+ } else {
+ return KeycodeToUnicodeViaKCHRResource(uniChars, maxChars, resource,
+ encoding, eKind, keycode, modifiers, deadKeyStatePtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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)
+{
+ keyboardGrabWinPtr = 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)
+{
+ keyboardGrabWinPtr = NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetCapture --
+ *
+ * Results:
+ * Returns the current grab window
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tk_Window
+TkMacOSXGetCapture(void)
+{
+ return grabWinPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 && !Tk_IsTopLevel(winPtr)) {
+ winPtr = winPtr->parentPtr;
+ }
+#if 0
+ {
+ TkWindow *w = NULL;
+ WindowModality m;
+
+ if (winPtr) {
+ w = winPtr;
+ m = kWindowModalityAppModal;
+ } else if (grabWinPtr) {
+ w = (TkWindow *) grabWinPtr;
+ m = kWindowModalityNone;
+ }
+
+ if (w && w->window != None && TkMacOSXHostToplevelExists(w)) {
+ ChkErr(SetWindowModality, TkMacOSXDrawableWindow(w->window), m,
+ NULL);
+ }
+ }
+#endif
+ grabWinPtr = (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(
+ Tk_Window tkwin,
+ int x,
+ int y,
+ int height)
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitKeyboard --
+ *
+ * This procedure initializes the keyboard layout.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE void
+TkMacOSXInitKeyboard(
+ Tcl_Interp *interp)
+{
+ Ptr resource;
+ TextEncoding encoding;
+
+ GetKeyboardLayout(&resource, &encoding);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXKeyboard.c b/carbon/tkMacOSXKeyboard.c
new file mode 100644
index 0000000..4e35db6
--- /dev/null
+++ b/carbon/tkMacOSXKeyboard.c
@@ -0,0 +1,840 @@
+/*
+ * tkMacOSXKeyboard.c --
+ *
+ * Routines to support keyboard events on the Macintosh.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXInt.h"
+#include "tkMacOSXEvent.h" /* for TkMacOSXKeycodeToUnicode()
+ * FIXME: That function should probably move
+ * here. */
+
+/*
+ * A couple of simple definitions to make code a bit more self-explaining.
+ *
+ * For the assignments of Mod1==meta==command and Mod2==alt==option, see also
+ * tkMacOSXMouseEvent.c.
+ */
+
+#define LATIN1_MAX 255
+#define MAC_KEYCODE_MAX 0x7F
+#define MAC_KEYCODE_MASK 0x7F
+#define COMMAND_MASK Mod1Mask
+#define OPTION_MASK Mod2Mask
+
+
+/*
+ * Tables enumerating the special keys defined on Mac keyboards. These are
+ * necessary for correct keysym mappings for all keys where the keysyms are
+ * not identical with their ASCII or Latin-1 code points.
+ */
+
+typedef struct {
+ int keycode; /* Macintosh keycode. */
+ KeySym keysym; /* X windows keysym. */
+} KeyInfo;
+
+/*
+ * Notes on keyArray:
+ *
+ * 0x34, XK_Return - Powerbooks use this and some keymaps define it.
+ *
+ * 0x4C, XK_Return - XFree86 and Apple's X11 call this one XK_KP_Enter.
+ *
+ * 0x47, XK_Clear - This key is NumLock when used on PCs, but Mac
+ * applications don't use it like that, nor does Apple's X11.
+ *
+ * All other keycodes are taken from the published ADB keyboard layouts.
+ */
+
+static KeyInfo keyArray[] = {
+ {0x24, XK_Return},
+ {0x30, XK_Tab},
+ {0x33, XK_BackSpace},
+ {0x34, XK_Return},
+ {0x35, XK_Escape},
+
+ {0x47, XK_Clear},
+ {0x4C, XK_KP_Enter},
+
+ {0x72, XK_Help},
+ {0x73, XK_Home},
+ {0x74, XK_Page_Up},
+ {0x75, XK_Delete},
+ {0x77, XK_End},
+ {0x79, XK_Page_Down},
+
+ {0x7B, XK_Left},
+ {0x7C, XK_Right},
+ {0x7D, XK_Down},
+ {0x7E, XK_Up},
+
+ {0, 0}
+};
+
+static KeyInfo virtualkeyArray[] = {
+ {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; /* virtualkeyArray hashed by virtual
+ * keycode value. */
+
+static int latin1Table[LATIN1_MAX+1]; /* Reverse mapping table for
+ * controls, ASCII and Latin-1. */
+
+/*
+ * Prototypes for static functions used in this file.
+ */
+
+static void InitKeyMaps (void);
+static void InitLatin1Table(Display *display);
+static int XKeysymToMacKeycode(Display *display, KeySym keysym);
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitKeyMaps --
+ *
+ * Creates hash tables used by some of the functions in this file.
+ *
+ * FIXME: As keycodes are defined to be in the limited range 0-127, it
+ * would be easier and more efficient to use directly initialized plain
+ * arrays and drop this function.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Allocates memory & creates some hash tables.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+InitKeyMaps(void)
+{
+ 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 = virtualkeyArray; kPtr->keycode != 0; kPtr++) {
+ hPtr = Tcl_CreateHashEntry(&vkeyTable, (char *) kPtr->keycode,
+ &dummy);
+ Tcl_SetHashValue(hPtr, kPtr->keysym);
+ }
+ initialized = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitLatin1Table --
+ *
+ * Creates a simple table to be used for mapping from keysyms to keycodes.
+ * Always needs to be called before using latin1Table, because the
+ * keyboard layout may have changed, and than the table must be
+ * re-computed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the global latin1Table.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+InitLatin1Table(
+ Display *display)
+{
+ static Boolean latin1_initialized = false;
+ static SInt16 lastKeyLayoutID = -1;
+
+ SInt16 keyScript;
+ SInt16 keyLayoutID;
+
+ keyScript = GetScriptManagerVariable(smKeyScript);
+ keyLayoutID = GetScriptVariable(keyScript,smScriptKeys);
+
+ if (!latin1_initialized || (lastKeyLayoutID != keyLayoutID)) {
+ int keycode;
+ KeySym keysym;
+ int state;
+ int modifiers;
+
+ latin1_initialized = true;
+ lastKeyLayoutID = keyLayoutID;
+
+ memset(latin1Table, 0, sizeof(latin1Table));
+
+ /*
+ * In the common X11 implementations, a keymap has four columns
+ * "plain", "Shift", "Mode_switch" and "Mode_switch + Shift". We don't
+ * use "Mode_switch", but we use "Option" instead. (This is similar to
+ * Apple's X11 implementation, where "Mode_switch" is used as an alias
+ * for "Option".)
+ *
+ * So here we go through all 4 columns of the keymap and find all
+ * Latin-1 compatible keycodes. We go through the columns back-to-front
+ * from the more exotic columns to the more simple, so that simple
+ * keycode-modifier combinations are preferred in the resulting table.
+ */
+
+ for (state = 3; state >= 0; state--) {
+ modifiers = 0;
+ if (state & 1) {
+ modifiers |= shiftKey;
+ }
+ if (state & 2) {
+ modifiers |= optionKey;
+ }
+
+ for (keycode = 0; keycode <= MAC_KEYCODE_MAX; keycode++) {
+ keysym = XKeycodeToKeysym(display,keycode<<16,state);
+ if (keysym <= LATIN1_MAX) {
+ latin1Table[keysym] = keycode | modifiers;
+ }
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 newKeycode;
+ UniChar newChar;
+
+ (void) display; /*unused*/
+
+ if (!initialized) {
+ InitKeyMaps();
+ }
+
+ /*
+ * 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 ASCII and
+ * Latin-1 chars.
+ */
+
+ newKeycode = keycode >> 16;
+
+ if ((keycode & 0xFFFF) == 0x10) {
+ hPtr = Tcl_FindHashEntry(&vkeyTable, (char *) newKeycode);
+ if (hPtr != NULL) {
+ return (KeySym) Tcl_GetHashValue(hPtr);
+ }
+ }
+ hPtr = Tcl_FindHashEntry(&keycodeTable, (char *) newKeycode);
+ if (hPtr != NULL) {
+ return (KeySym) Tcl_GetHashValue(hPtr);
+ }
+
+ /*
+ * Add in the Mac modifier flags for shift and option.
+ */
+
+ if (index & 1) {
+ newKeycode |= shiftKey;
+ }
+ if (index & 2) {
+ newKeycode |= optionKey;
+ }
+
+ newChar = 0;
+ TkMacOSXKeycodeToUnicode(&newChar, 1, kEventRawKeyDown,
+ newKeycode & 0x00FF, newKeycode & 0xFF00, NULL);
+
+ /*
+ * X11 keysyms are identical to Unicode for ASCII and Latin-1. Give up for
+ * other characters for now.
+ */
+
+ if ((newChar >= XK_space) && (newChar <= LATIN1_MAX)) {
+ return newChar;
+ }
+
+ return NoSymbol;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetString --
+ *
+ * Retrieve the string equivalent for the given keyboard event.
+ *
+ * Results:
+ * Returns the UTF string.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+const 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. */
+{
+ (void) winPtr; /*unused*/
+ Tcl_DStringInit(dsPtr);
+ return Tcl_DStringAppend(dsPtr, eventPtr->xkey.trans_chars, -1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ (void) display; /*unused*/
+
+ /*
+ * MacOSX doesn't use the key codes for the modifiers for anything, and we
+ * don't generate them either. So there is no modifier map.
+ */
+
+ modmap = 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(modmap->modifiermap);
+ }
+ ckfree(modmap);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeysymToString, XStringToKeysym --
+ *
+ * These X window functions map keysyms to strings & strings to keysyms.
+ * However, Tk already does this for the most common keysyms. Therefore,
+ * 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeysymToMacKeycode --
+ *
+ * An internal function like XKeysymToKeycode but only generating the Mac
+ * specific keycode plus the modifiers Shift and Option.
+ *
+ * Results:
+ * A Mac keycode with the actual keycode in the low byte and Mac-style
+ * modifier bits in the high byte.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+XKeysymToMacKeycode(
+ Display *display,
+ KeySym keysym)
+{
+ KeyInfo *kPtr;
+
+ if (keysym <= LATIN1_MAX) {
+ /*
+ * Handle keysyms in the Latin-1 range where keysym and Unicode
+ * character code point are the same.
+ */
+
+ InitLatin1Table(display);
+ return latin1Table[keysym];
+ }
+
+ /*
+ * Handle special keys from our exception tables. Don't mind if this is
+ * slow, neither the test suite nor [event generate] need to be optimized
+ * (we hope).
+ */
+
+ for (kPtr = keyArray; kPtr->keycode != 0; kPtr++) {
+ if (kPtr->keysym == keysym) {
+ return kPtr->keycode;
+ }
+ }
+ for (kPtr = virtualkeyArray; kPtr->keycode != 0; kPtr++) {
+ if (kPtr->keysym == keysym) {
+ return kPtr->keycode;
+ }
+ }
+
+ /*
+ * For other keysyms (not Latin-1 and not special keys), we'd need a
+ * generic keysym-to-unicode table. We don't have that, so we give up here.
+ */
+
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeysymToKeycode --
+ *
+ * The function XKeysymToKeycode takes an X11 keysym and converts it into
+ * a Mac keycode. It is in the stubs table for compatibility but not used
+ * anywhere in the core.
+ *
+ * Results:
+ * A 32 bit keycode with the the mac keycode (without modifiers) in the
+ * higher 16 bits of the keycode and the ASCII or Latin-1 code in the
+ * lower 8 bits of the keycode.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+KeyCode
+XKeysymToKeycode(
+ Display* display,
+ KeySym keysym)
+{
+ int macKeycode = XKeysymToMacKeycode(display, keysym);
+ KeyCode result;
+
+ /*
+ * See also TkpSetKeycodeAndState. The 0x0010 magic is used in
+ * XKeycodeToKeysym. For special keys like XK_Return the lower 8 bits of
+ * the keysym are usually a related ASCII control code.
+ */
+
+ if ((keysym >= XK_F1) && (keysym <= XK_F35)) {
+ result = 0x0010;
+ } else {
+ result = 0x00FF & keysym;
+ }
+ result |= (macKeycode & MAC_KEYCODE_MASK) << 16;
+
+ return result;
+}
+
+/*
+NB: Keep this commented code for a moment for reference.
+
+ 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;
+*/
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetKeycodeAndState --
+ *
+ * The function TkpSetKeycodeAndState takes a keysym and fills in the
+ * appropriate members of an XEvent. It is similar to XKeysymToKeycode,
+ * but it also sets the modifier mask in the XEvent. It is used by [event
+ * generate] and it is in the stubs table.
+ *
+ * Results:
+ * Fills an XEvent, sets the member xkey.keycode with a keycode
+ * formatted the same as XKeysymToKeycode and the member xkey.state with
+ * the modifiers implied by the keysym. Also fills in xkey.trans_chars,
+ * so that the actual characters can be retrieved later.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetKeycodeAndState(
+ Tk_Window tkwin,
+ KeySym keysym,
+ XEvent *eventPtr)
+{
+ if (keysym == NoSymbol) {
+ eventPtr->xkey.keycode = 0;
+ } else {
+ Display *display = Tk_Display(tkwin);
+ int macKeycode = XKeysymToMacKeycode(display, keysym);
+
+ /*
+ * See also XKeysymToKeycode.
+ */
+
+ if ((keysym >= XK_F1) && (keysym <= XK_F35)) {
+ eventPtr->xkey.keycode = 0x0010;
+ } else {
+ eventPtr->xkey.keycode = 0x00FF & keysym;
+ }
+ eventPtr->xkey.keycode |= (macKeycode & MAC_KEYCODE_MASK) << 16;
+
+ if (shiftKey & macKeycode) {
+ eventPtr->xkey.state |= ShiftMask;
+ }
+ if (optionKey & macKeycode) {
+ eventPtr->xkey.state |= OPTION_MASK;
+ }
+
+ if (keysym <= LATIN1_MAX) {
+ int done = Tcl_UniCharToUtf(keysym, eventPtr->xkey.trans_chars);
+
+ eventPtr->xkey.trans_chars[done] = 0;
+ } else {
+ eventPtr->xkey.trans_chars[0] = 0;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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);
+ }
+
+ /*
+ * Handle pure modifier keys specially. We use -1 as a signal for
+ * this.
+ */
+
+ if (eventPtr->xany.send_event == -1) {
+ int modifier = eventPtr->xkey.keycode;
+
+ if (modifier == cmdKey) {
+ return XK_Meta_L;
+ } else if (modifier == shiftKey) {
+ return XK_Shift_L;
+ } else if (modifier == alphaLock) {
+ return XK_Caps_Lock;
+ } else if (modifier == optionKey) {
+ return XK_Alt_L;
+ } else if (modifier == controlKey) {
+ return XK_Control_L;
+ } else if (modifier == kEventKeyModifierNumLockMask) {
+ return XK_Num_Lock;
+ } else if (modifier == kEventKeyModifierFnMask) {
+ return XK_Super_L;
+ } else if (modifier == rightShiftKey) {
+ return XK_Shift_R;
+ } else if (modifier == rightOptionKey) {
+ return XK_Alt_R;
+ } else if (modifier == rightControlKey) {
+ return XK_Control_R;
+ } else {
+ /*
+ * If we get here, we probably need to implement something new.
+ */
+
+ return NoSymbol;
+ }
+ }
+
+ /*
+ * 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. (Note: We use "Option" in keymap columns 2 and 3 where other
+ * implementations have "Mode_switch".)
+ */
+
+ index = 0;
+
+ /*
+ * We want Option key combinations to use their base chars as keysyms, so
+ * we ignore the option modifier here.
+ */
+
+#if 0
+ if (eventPtr->xkey.state & OPTION_MASK) {
+ index |= 2;
+ }
+#endif
+
+ if ((eventPtr->xkey.state & ShiftMask)
+ || (/* (dispPtr->lockUsage != LU_IGNORE)
+ && */ (eventPtr->xkey.state & LockMask))) {
+ index |= 1;
+ }
+
+ /*
+ * First try of the actual translation.
+ */
+
+ 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)*/ ) {
+ /*
+ * FIXME: Keysyms are only identical to Unicode for ASCII and Latin-1,
+ * so we can't use Tcl_UniCharIsUpper() for keysyms outside that range.
+ * This may be a serious problem here.
+ */
+
+ if ((sym == NoSymbol) || (sym > LATIN1_MAX)
+ || !Tcl_UniCharIsUpper(sym)) {
+ 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 the "Mode_switch" keysym.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Keymap-related information in dispPtr is updated.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpInitKeymapInfo(
+ TkDisplay *dispPtr) /* Display for which to recompute keymap
+ * information. */
+{
+ dispPtr->bindInfoStale = 0;
+
+ /*
+ * Behaviours that are variable on X11 are defined constant on MacOSX.
+ * lockUsage is only used above in TkpGetKeySym(), nowhere else currently.
+ * There is no offical "Mode_switch" key.
+ */
+
+ dispPtr->lockUsage = LU_CAPS;
+ dispPtr->modeModMask = 0;
+
+#if 0
+ /*
+ * With this, <Alt> and <Meta> become synonyms for <Command> and <Option>
+ * in bindings like they are (and always have been) in the keysyms that
+ * are reported by KeyPress events. But the init scripts like text.tcl
+ * have some disabling bindings for <Meta>, so we don't want this without
+ * some changes in those scripts. See also bug #700311.
+ */
+
+ dispPtr->altModMask = OPTION_MASK;
+ dispPtr->metaModMask = COMMAND_MASK;
+#else
+ dispPtr->altModMask = 0;
+ dispPtr->metaModMask = 0;
+#endif
+
+ /*
+ * MacOSX doesn't use the keycodes for the modifiers for anything, and we
+ * don't generate them either (the keycodes actually given in the simulated
+ * modifier events are bogus). So there is no modifier map. If we ever want
+ * to simulate real modifier keycodes, the list will be constant in the
+ * Carbon implementation.
+ */
+
+ if (dispPtr->modKeyCodes != NULL) {
+ ckfree(dispPtr->modKeyCodes);
+ }
+ dispPtr->numModKeyCodes = 0;
+ dispPtr->modKeyCodes = NULL;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXMenu.c b/carbon/tkMacOSXMenu.c
new file mode 100644
index 0000000..31bb20e
--- /dev/null
+++ b/carbon/tkMacOSXMenu.c
@@ -0,0 +1,4743 @@
+/*
+ * 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.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMenubutton.h"
+#include "tkMenu.h"
+#include "tkColor.h"
+#include "tkFont.h"
+#include "tkMacOSXDebug.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_MENUS
+#endif
+*/
+
+#define USE_TK_MDEF
+
+typedef struct MacMenu {
+ MenuRef menuHdl; /* The Menu Manager data structure. */
+#ifdef USE_TK_MDEF
+ int useMDEF; /* true if this menu uses the MDEF */
+#endif
+} MacMenu;
+
+typedef struct MenuEntryUserData {
+ Drawable mdefDrawable;
+ TkMenuEntry *mePtr;
+ Tk_Font tkfont;
+ Tk_FontMetrics *fmPtr;
+} MenuEntryUserData;
+
+/*
+ * 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)
+#define MODIFIER_NUM 4
+
+/*
+ * 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. */
+ int modifierNum; /* Number of modifiers */
+ Tcl_UniChar modifierUniChars[MODIFIER_NUM];
+ /* Modifiers in unicode */
+ char accelGlyph; /* Accelerator glyph, if any */
+} 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 MENUBAR_REDRAW_PENDING 1
+
+static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as
+ * the flag that Tk is not to draw any
+ * menus. */
+
+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 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 int menuBarFlags; /* Used for whether the menu bar needs
+ * redrawing or not. */
+
+struct MenuCommandHandlerData { /* This is the ClientData we pass to */
+ TkMenu *menuPtr; /* Tcl_DoWhenIdle to move handling */
+ int index; /* menu commands to the event loop. */
+};
+
+static TopLevelMenubarList *windowListPtr;
+ /* A list of windows that have menubars set. */
+
+/*
+ * Array of unicode, charcode and utf representations of the most common
+ * special menu symbols.
+ */
+
+typedef struct MenuSymbol {
+ const Tcl_UniChar unicode;
+ const char charCode;
+ /* char padding; */
+ int utfLen, width;
+ char utf[TCL_UTF_MAX + 1];
+} MenuSymbol;
+
+static MenuSymbol menuSymbols[] = {
+ {kCommandUnicode, kCommandCharCode},
+ {kOptionUnicode, kMenuOptionGlyph},
+ {kControlUnicode, kMenuControlGlyph},
+ {kShiftUnicode, kMenuShiftGlyph},
+ {kCheckUnicode, kCheckCharCode},
+ {kDiamondUnicode, kDiamondCharCode},
+ {kBulletUnicode, kBulletCharCode},
+ {0x2026, kNullCharCode},
+ {0, 0},
+};
+
+enum MenuSymbolIdx {
+ COMMAND_SYMBOL,
+ OPTION_SYMBOL,
+ CONTROL_SYMBOL,
+ SHIFT_SYMBOL,
+ CHECK_SYMBOL,
+ DIAMDOND_SYMBOL,
+ BULLET_SYMBOL,
+ ELLIPSIS_SYMBOL,
+};
+
+MenuRef tkCurrentAppleMenu = NULL;
+
+static SInt32 menuMarkColumnWidth = 0, menuMarkIndent = 0;
+static SInt32 menuTextLeadingEdgeMargin = 0, menuTextTrailingEdgeMargin = 0;
+static SInt16 menuItemExtraHeight = 0, menuItemExtraWidth = 0;
+static SInt16 menuSeparatorHeight = 0;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+MODULE_SCOPE int TkMacOSXGetNewMenuID(Tcl_Interp *interp,
+ TkMenu *menuInstPtr, int cascade,
+ short *menuIDPtr);
+MODULE_SCOPE void TkMacOSXFreeMenuID(short menuID);
+
+static void CompleteIdlers(TkMenu *menuPtr);
+static void DrawMenuBarWhenIdle(ClientData clientData);
+static void DrawMenuEntryAccelerator(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(TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Drawable d,
+ Tk_3DBorder activeBorder, Tk_3DBorder bgBorder,
+ int x, int y, int width, int heigth);
+static void DrawMenuEntryIndicator(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(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(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(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 EventuallyInvokeMenu(ClientData data);
+static void GetEntryText(TkMenuEntry *mePtr,
+ Tcl_DString *dStringPtr);
+static void GetMenuAccelGeometry(TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ const Tk_FontMetrics *fmPtr, int *modWidthPtr,
+ int *textWidthPtr, int *heightPtr);
+static void GetMenuLabelGeometry(TkMenuEntry *mePtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
+ int *widthPtr, int *heightPtr);
+static void GetMenuIndicatorGeometry(TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ const Tk_FontMetrics *fmPtr, int *widthPtr,
+ int *heightPtr);
+static void GetMenuSeparatorGeometry(TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ const Tk_FontMetrics *fmPtr, int *widthPtr,
+ int *heightPtr);
+static TkMenuEntry * GetParentMenuEntry(TkMenu *menuPtr);
+static void GetTearoffEntryGeometry(TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ const Tk_FontMetrics *fmPtr, int *widthPtr,
+ int *heightPtr);
+static char FindMarkCharacter(TkMenuEntry *mePtr);
+static int GetUtfMarkCharacter(char markChar,
+ const char **markUtfPtr);
+static TkMenu * MenuPtrForMenuRef(MenuRef menu);
+static int ParseAccelerators(const char **accelStringPtr,
+ int *modifierNumPtr,
+ Tcl_UniChar *modifierUniChars,
+ int *modifierWidth);
+static void MenuSelectEvent(TkMenu *menuPtr);
+static void ReconfigureIndividualMenu(TkMenu *menuPtr,
+ MenuHandle macMenuHdl, int base);
+static void ReconfigureMacintoshMenu(ClientData clientData);
+static void RecursivelyClearActiveMenu(TkMenu *menuPtr);
+static void RecursivelyDeleteMenu(TkMenu *menuPtr);
+static void RecursivelyInsertMenu(TkMenu *menuPtr);
+static void SetDefaultMenubar(void);
+static int SetMenuCascade(TkMenu *menuPtr);
+
+#ifdef USE_TK_MDEF
+#define SCREEN_MARGIN 5
+static MacDrawable macMDEFDrawable;
+ /* Drawable for use by MDEF code */
+static int MDEFScrollFlag = 0; /* Used so that popups don't scroll too
+ * soon. */
+static MenuItemDrawingUPP tkThemeMenuItemDrawingUPP;
+ /* Points to the UPP for theme Item
+ * drawing. */
+static Tcl_Obj *useMDEFVar;
+
+static void DrawMenuBackground(TkMenu *menuPtr, Rect *menuRectPtr,
+ Drawable d);
+static void MenuDefProc(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 HandleMenuFindItemMsg(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 AppearanceEntryDrawWrapper(TkMenuEntry *mePtr,
+ Rect *menuRectPtr, MenuTrackingData *mtdPtr,
+ Drawable d, Tk_FontMetrics *fmPtr, Tk_Font tkfont,
+ int erase);
+static pascal void ThemeMenuItemDrawingProc(const Rect *inBounds,
+ SInt16 inDepth, Boolean inIsColorDevice,
+ SInt32 inUserData);
+#else /* USE_TK_MDEF */
+# define useMDEF 0
+#endif /* USE_TK_MDEF */
+
+#define IS_THEME_MENU_FONT(tkfont) (strcmp(Tk_NameOfFont(tkfont), "menu") == 0)
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawThemeText --
+ *
+ * Wrapper for DrawThemeTextBox API.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawThemeText(
+ Drawable d,
+ GC gc,
+ CFStringRef string,
+ ThemeFontID font,
+ ThemeDrawState drawState,
+ const Rect* bounds,
+ int baseline,
+ int just)
+{
+ TkMacOSXDrawingContext dc;
+ Rect adjustedBounds;
+
+ /*
+ * Menu item text drawn with the .Keyboard font (used for
+ * kThemeMenuItemCmdKeyFont) won't always have the same ascent and
+ * baseline as text drawn with the regular menu item font, since the
+ * glyphs in the .Keyboard font may have a different height. Therefore, we
+ * first determine the baseline of the text and then adjust the bounds
+ * rect so the baseline aligns with the overall baseline of the menu item.
+ */
+
+ if (font == kThemeMenuItemCmdKeyFont) {
+ Point size;
+ SInt16 cmdKeyBaseline;
+
+ GetThemeTextDimensions(string, font, drawState, false, &size,
+ &cmdKeyBaseline);
+ adjustedBounds = *bounds;
+ OffsetRect(&adjustedBounds, 0, baseline - bounds->top - size.v -
+ cmdKeyBaseline);
+ bounds = &adjustedBounds;
+ }
+ if (TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
+ ChkErr(DrawThemeTextBox, string, font, drawState, false, bounds, just,
+ dc.context);
+ TkMacOSXRestoreDrawingContext(&dc);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MeasureThemeText --
+ *
+ * Wrapper for GetThemeTextDimensions API.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+MeasureThemeText(
+ CFStringRef string,
+ ThemeFontID font)
+{
+ Point pt;
+
+ ChkErr(GetThemeTextDimensions, string, font, kThemeStateActive, false, &pt,
+ NULL);
+ return pt.h;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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) {
+ return TCL_ERROR;
+ }
+ Tcl_SetHashValue(commandEntryPtr, NULL);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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_ResetResult(interp);
+ Tcl_AppendResult(interp, "No more menus can be allocated.", NULL);
+ return TCL_ERROR;
+ }
+ Tcl_SetHashValue(commandEntryPtr, menuPtr);
+ *menuIDPtr = returnID;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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*)(intptr_t)menuID);
+
+ if (entryPtr != NULL) {
+ Tcl_DeleteHashEntry(entryPtr);
+ }
+ if (menuID == currentAppleMenuID) {
+ currentAppleMenuID = 0;
+ }
+ if (menuID == currentHelpMenuID) {
+ currentHelpMenuID = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MenuPtrForMenuRef --
+ *
+ * Returns a pointer to the TkMenu corresponding to a given Carbon
+ * MenuRef.
+ *
+ * Results:
+ * Returns a pointer to a TkMenu or NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkMenu *
+MenuPtrForMenuRef(
+ MenuRef menu)
+{
+ TkMenu *menuPtr = NULL;
+ MenuID menuID = GetMenuID(menu);
+ Tcl_HashEntry *commandEntryPtr =
+ Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
+
+ if (commandEntryPtr) {
+ menuPtr = Tcl_GetHashValue(commandEntryPtr);
+ }
+ return menuPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetParentMenuEntry --
+ *
+ * Returns a pointer to the parent's TkMenuEntry of a given TkMenu.
+ *
+ * Results:
+ * Returns a pointer to a TkMenuEntry or NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkMenuEntry*
+GetParentMenuEntry(
+ TkMenu *menuPtr)
+{
+ TkMenuEntry *cascadeEntryPtr;
+
+ for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr;
+ cascadeEntryPtr != NULL;
+ cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
+ const char *name = (cascadeEntryPtr->namePtr == NULL) ? ""
+ : Tcl_GetString(cascadeEntryPtr->namePtr);
+
+ if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) {
+ break;
+ }
+ }
+ return cascadeEntryPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ MenuRef macMenuHdl;
+#ifdef USE_TK_MDEF
+ MenuDefSpec menuDefSpec;
+ Tcl_Obj *useMDEFObjPtr;
+ int useMDEF = 1;
+#endif
+ int error = TCL_OK;
+ OSStatus err;
+ CFStringRef cfStr;
+
+ error = TkMacOSXGetNewMenuID(menuPtr->interp, menuPtr, 0, &menuID);
+ if (error != TCL_OK) {
+ return error;
+ }
+ err = ChkErr(CreateNewMenu, menuID, kMenuAttrDoNotUseUserCommandKeys,
+ &macMenuHdl);
+ if (err != noErr) {
+ Tcl_AppendResult(menuPtr->interp, "CreateNewMenu failed.", NULL);
+ return TCL_ERROR;
+ }
+ cfStr = CFStringCreateWithCString(NULL, Tk_PathName(menuPtr->tkwin),
+ kCFStringEncodingUTF8);
+ if (!cfStr) {
+ Tcl_AppendResult(menuPtr->interp, "CFStringCreateWithCString failed.",
+ NULL);
+ return TCL_ERROR;
+ }
+ err = ChkErr(SetMenuTitleWithCFString, macMenuHdl, cfStr);
+ CFRelease(cfStr);
+ if (err != noErr) {
+ Tcl_AppendResult(menuPtr->interp, "SetMenuTitleWithCFString failed.",
+ NULL);
+ return TCL_ERROR;
+ }
+
+ menuPtr->platformData = ckalloc(sizeof(MacMenu));
+ ((MacMenu *) menuPtr->platformData)->menuHdl = macMenuHdl;
+
+#ifdef USE_TK_MDEF
+ /*
+ * 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;
+ ChkErr(SetMenuDefinition, macMenuHdl, &menuDefSpec);
+ }
+ ((MacMenu *) menuPtr->platformData)->useMDEF = useMDEF;
+#endif /* USE_TK_MDEF */
+
+ 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, NULL);
+ menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ }
+ }
+ }
+ }
+
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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, 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 = helpIndex; i <= count; i++) {
+ DeleteMenuItem(helpMenuHdl, helpIndex);
+ }
+ }
+ currentHelpMenuID = 0;
+ }
+ if (menuPtr->platformData != NULL) {
+ MenuID menuID = GetMenuID(macMenuHdl);
+
+ DeleteMenu(menuID);
+ TkMacOSXFreeMenuID(menuID);
+ DisposeMenu(macMenuHdl);
+ ckfree(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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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(mePtr->platformEntryData);
+ if ((menuPtr->platformData != NULL)
+ && !(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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. */
+{
+#ifdef USE_TK_MDEF
+ const int useMDEF = ((MacMenu *) mePtr->menuPtr->platformData)->useMDEF;
+#endif
+ int noLabel = (mePtr->labelPtr == NULL || mePtr->labelLength == 0);
+
+ Tcl_DStringInit(dStringPtr);
+ if (mePtr->type == TEAROFF_ENTRY && (useMDEF || noLabel)) {
+ Tcl_DStringAppend(dStringPtr, "(Tear-off)", -1);
+ } else if (mePtr->imagePtr != NULL && (useMDEF || noLabel) &&
+ mePtr->compound == COMPOUND_NONE) {
+ Tcl_DStringAppend(dStringPtr, "(Image)", -1);
+ } else if (mePtr->bitmapPtr != NULL && (useMDEF || noLabel) &&
+ mePtr->compound == COMPOUND_NONE) {
+ Tcl_DStringAppend(dStringPtr, "(Pixmap)", -1);
+ } else if (noLabel) {
+ /*
+ * 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) == '.') && (*(text+2) == '.')) {
+ Tcl_DStringAppend(dStringPtr, menuSymbols[ELLIPSIS_SYMBOL].utf,
+ menuSymbols[ELLIPSIS_SYMBOL].utfLen);
+ i += menuSymbols[ELLIPSIS_SYMBOL].utfLen - 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.
+ *
+ * Results:
+ * Mark char.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char
+FindMarkCharacter(
+ TkMenuEntry *mePtr) /* The entry we are finding the character
+ * for. */
+{
+ static const char markChars[] = {kCheckCharCode, kDiamondCharCode,
+ kBulletCharCode, '-', kCheckCharCode};
+ const char *markChar = markChars;
+ int i = sizeof(markChars);
+ Tk_Font tkfont;
+
+ tkfont = Tk_GetFontFromObj(mePtr->menuPtr->tkwin,
+ (mePtr->fontPtr == NULL) ? mePtr->menuPtr->fontPtr
+ : mePtr->fontPtr);
+
+ while (--i) {
+ if (!TkMacOSXIsCharacterMissing(tkfont, *markChar)) {
+ break;
+ }
+ markChar++;
+ }
+ return *markChar;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetUtfMarkCharacter --
+ *
+ * Get the utf8 string for the given mark character, taking into account
+ * the special menu font char codes.
+ *
+ * Results:
+ * Length of returned utf8 string.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+GetUtfMarkCharacter(
+ char markChar,
+ const char **markUtfPtr)
+{
+ const MenuSymbol *ms = menuSymbols;
+ int len = 0;
+
+ while (ms->unicode) {
+ if (ms->charCode && ms->charCode == markChar) {
+ *markUtfPtr = ms->utf;
+ len = ms->utfLen;
+ break;
+ }
+ ms++;
+ }
+ if (!len) {
+ static char markUtf[TCL_UTF_MAX + 1];
+
+ Tcl_ExternalToUtf(NULL, TkMacOSXCarbonEncoding, &markChar, 1, 0, NULL,
+ markUtf, TCL_UTF_MAX + 1, NULL, &len, NULL);
+ *markUtfPtr = markUtf;
+ }
+ return len;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ParseAccelerators --
+ *
+ * Parse menu accelerator string.
+ *
+ * Results:
+ * Accelerator flags.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+ParseAccelerators(
+ const char **accelStringPtr,
+ int *modifierNumPtr,
+ Tcl_UniChar *modifierUniChars,
+ int *modifierWidth)
+{
+ struct Modif {
+ const char *name;
+ const size_t len;
+ const int flag, symbol;
+ };
+#define MODIF(n, f) { #n, sizeof(#n)-1, ENTRY_##f##_ACCEL, f##_SYMBOL }
+ static const struct Modif modifs[] = {
+ MODIF(Control, CONTROL),
+ MODIF(Ctrl, CONTROL),
+ MODIF(Option, OPTION),
+ MODIF(Opt, OPTION),
+ MODIF(Alt, OPTION),
+ MODIF(Shift, SHIFT),
+ MODIF(Command, COMMAND),
+ MODIF(Cmd, COMMAND),
+ MODIF(Meta, COMMAND),
+ { NULL, 0, 0, 0}
+ };
+#undef MODIF
+ const char *accelString = *accelStringPtr;
+ int flags = 0, num = 0, seen = 0, width = 0;
+ const struct Modif *m;
+
+ while (1) {
+ m = modifs;
+ while (m->name) {
+ int l = m->len;
+
+ if (!strncasecmp(accelString, m->name, l) &&
+ (accelString[l] == '-' || accelString[l] == '+')) {
+ flags |= m->flag;
+ accelString += l+1;
+ break;
+ }
+ m++;
+ }
+ if (!m->name || !*accelString) {
+ break;
+ }
+ }
+ m = modifs;
+ while (m->name && num < MODIFIER_NUM) {
+ if (flags & m->flag && !(seen & m->flag)) {
+ modifierUniChars[num++] = menuSymbols[m->symbol].unicode;
+ width += menuSymbols[m->symbol].width;
+ seen |= m->flag;
+ }
+ m++;
+ }
+ *accelStringPtr = accelString;
+ *modifierNumPtr = num;
+ *modifierWidth = width;
+ 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;
+ EntryGeometry *geometryPtr = (EntryGeometry *) mePtr->platformEntryData;
+
+ /*
+ * 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) {
+ CFStringRef cfStr = CFStringCreateWithCString(NULL,
+ (!(mePtr->labelPtr) ? "" :
+ Tcl_GetString(mePtr->labelPtr)),
+ kCFStringEncodingUTF8);
+
+ if (cfStr) {
+ SetMenuTitleWithCFString(childMenuHdl, cfStr);
+ CFRelease(cfStr);
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * 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) {
+ geometryPtr->accelTextStart = -1;
+ } else {
+ const char *accelString = (mePtr->accelPtr == NULL) ? ""
+ : Tcl_GetString(mePtr->accelPtr);
+ const char *accelStart = accelString;
+
+ mePtr->entryFlags &= ~ENTRY_ACCEL_MASK;
+ mePtr->entryFlags |= ParseAccelerators(&accelString,
+ &geometryPtr->modifierNum, geometryPtr->modifierUniChars,
+ &geometryPtr->modifierWidth);
+ geometryPtr->accelTextStart = (ptrdiff_t)(accelString - accelStart);
+ }
+
+ if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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
+ *
+ *----------------------------------------------------------------------
+ */
+
+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; # of system help menu
+ * items for help menus. */
+{
+ int count;
+ int index;
+ TkMenuEntry *mePtr;
+ int parentDisabled = 0;
+
+#ifdef TK_MAC_DEBUG_MENUS
+ /*
+ * Carbon-internal menu debugging (c.f. Technote 2124)
+ */
+
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, void, DebugPrintMenu,
+ MenuRef menu);
+ if (DebugPrintMenu) {
+ DebugPrintMenu(macMenuHdl);
+ }
+#endif
+
+ mePtr = GetParentMenuEntry(menuPtr);
+ if (mePtr && mePtr->state == ENTRY_DISABLED) {
+ parentDisabled = 1;
+ }
+
+ /*
+ * 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) {
+ AppendMenuItemTextWithCFString(macMenuHdl, NULL,
+ kMenuItemAttrSeparator | kMenuItemAttrDisabled, 0, NULL);
+ } else {
+ Tcl_DString itemTextDString;
+ CFStringRef cfStr;
+
+ GetEntryText(mePtr, &itemTextDString);
+ cfStr = CFStringCreateWithCString(NULL,
+ Tcl_DStringValue(&itemTextDString), kCFStringEncodingUTF8);
+ if (cfStr) {
+ AppendMenuItemTextWithCFString(macMenuHdl, cfStr, 0, 0, NULL);
+ CFRelease(cfStr);
+ } else {
+ AppendMenuItemTextWithCFString(macMenuHdl, CFSTR ("<Error>"),
+ 0, 0, NULL);
+ }
+ 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) {
+ ChkErr(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,
+ mePtr->childMenuRefPtr->menuPtr);
+ }
+ }
+ }
+
+ if ((mePtr->type != CASCADE_ENTRY) && (mePtr->accelPtr != NULL)) {
+ int accelLen, modifiers = 0, hasCmd = 0;
+ EntryGeometry *geometryPtr = (EntryGeometry *)
+ mePtr->platformEntryData;
+ int offset = geometryPtr->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 {
+ /*
+ * Convert from accelerator names to Carbon menu glyphs.
+ */
+
+ struct Glyph {
+ const char *name;
+ const size_t len;
+ const char glyph;
+ };
+#define GLYPH(n, g) { #n, sizeof(#n)-1, kMenu##g##Glyph }
+ static const struct Glyph glyphs[] = {
+ GLYPH(PageUp, PageUp),
+ GLYPH(PageDown, PageDown),
+ GLYPH(Left, LeftArrow),
+ GLYPH(Right, RightArrow),
+ GLYPH(Up, UpArrow),
+ GLYPH(Down, DownArrow),
+ GLYPH(Escape, Escape),
+ GLYPH(Clear, Clear),
+ GLYPH(Enter, Enter),
+ GLYPH(Backspace,DeleteLeft),
+ GLYPH(Space, Space),
+ GLYPH(Tab, TabRight),
+ GLYPH(Delete, DeleteRight),
+ GLYPH(Home, NorthwestArrow),
+ GLYPH(End, SoutheastArrow),
+ GLYPH(Return, Return),
+ GLYPH(Help, Help),
+ GLYPH(Power, Power),
+ { NULL, 0, 0}
+ };
+#undef GLYPH
+ const struct Glyph *g = glyphs;
+ char glyph = 0;
+
+ if (accel[0] == 'F' && accelLen < 4 &&
+ (accel[1] > '0' && accel[1] <= '9')) {
+ int fkey = accel[1] - '0';
+
+ if (accelLen == 3) {
+ if (accel[2] >= '0' && accel[2] <= '9') {
+ fkey = 10 * fkey + (accel[2] - '0');
+ } else {
+ fkey = 0;
+ }
+ }
+ if (fkey >= 1 && fkey <= 12) {
+ glyph = kMenuF1Glyph + fkey - 1;
+ } else if (fkey >= 13 && fkey <= 15) {
+ glyph = kMenuF13Glyph + fkey - 13;
+ }
+ } else while (g->name) {
+ if (accel[0] == g->name[0] &&
+ (size_t)accelLen == g->len &&
+ !strncasecmp(accel, g->name, g->len)) {
+ glyph = g->glyph;
+ break;
+ }
+ g++;
+ }
+ if (glyph) {
+ ChkErr(SetMenuItemKeyGlyph, macMenuHdl, base + index,
+ glyph);
+ if (!hasCmd) {
+ modifiers |= kMenuNoCommandModifier;
+ }
+ geometryPtr->accelGlyph = glyph;
+ }
+ }
+ ChkErr(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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+ReconfigureMacintoshMenu(
+ ClientData clientData) /* Information about menu entry; may or may
+ * not already have values for some fields. */
+{
+ TkMenu *menuPtr = clientData;
+ MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ MenuHandle helpMenuHdl = NULL;
+
+ menuPtr->menuFlags &= ~MENU_RECONFIGURE_PENDING;
+
+ if (NULL == macMenuHdl) {
+ return;
+ }
+
+ ReconfigureIndividualMenu(menuPtr, macMenuHdl, 0);
+
+ if (GetMenuID(macMenuHdl) == currentHelpMenuID) {
+ MenuItemIndex helpIndex;
+
+ HMGetHelpMenu(&helpMenuHdl,&helpIndex);
+ if (helpMenuHdl != NULL) {
+ ReconfigureIndividualMenu(menuPtr, helpMenuHdl, helpIndex - 1);
+ }
+ }
+
+ if (menuPtr->menuType == MENUBAR) {
+ if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DrawMenuBarWhenIdle, 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+CompleteIdlers(
+ TkMenu *menuPtr) /* The menu we are completing. */
+{
+ int i;
+
+ if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
+ Tcl_CancelIdleCall(ReconfigureMacintoshMenu, menuPtr);
+ ReconfigureMacintoshMenu(menuPtr);
+ }
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ if ((menuPtr->entries[i]->type == CASCADE_ENTRY) &&
+ (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;
+
+ if (inPostMenu > 0) {
+ Tcl_AppendResult(interp,
+ "Cannot call post menu while already posting menu", NULL);
+ result = TCL_ERROR;
+ } else {
+ short menuID;
+ Window window;
+ int oldWidth = menuPtr->totalWidth;
+
+ inPostMenu++;
+ result = TkPreprocessMenu(menuPtr);
+
+ /*
+ * The post commands could have deleted the menu, which means we are
+ * dead and should go away.
+ */
+
+ if (result != TCL_OK || !menuPtr->tkwin) {
+ goto endPostMenu;
+ }
+
+ CompleteIdlers(menuPtr);
+ if (menuBarFlags & MENUBAR_REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DrawMenuBarWhenIdle, NULL);
+ DrawMenuBarWhenIdle(NULL);
+ }
+ RecursivelyInsertMenu(menuPtr);
+
+ TkMacOSXTrackingLoop(1);
+ popUpResult = PopUpMenuSelect(macMenuHdl, y, x, menuPtr->active);
+ TkMacOSXTrackingLoop(0);
+ menuPtr->totalWidth = oldWidth;
+
+ /*
+ * Simulate the mouse up.
+ */
+
+ window = Tk_WindowId(menuPtr->tkwin);
+ TkGenerateButtonEventForXPointer(window);
+
+ /*
+ * Dispatch the command.
+ */
+
+ menuID = HiWord(popUpResult);
+ if (menuID != 0) {
+ result = TkMacOSXDispatchMenuEvent(menuID, LoWord(popUpResult));
+ }
+
+endPostMenu:
+ 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 = ckalloc(sizeof(EntryGeometry));
+ TkMenu *menuPtr = mePtr->menuPtr;
+
+ geometryPtr->accelTextStart = 0;
+ geometryPtr->accelTextWidth = 0;
+ geometryPtr->nonAccelMargin = 0;
+ geometryPtr->modifierWidth = 0;
+ geometryPtr->modifierNum = 0;
+ geometryPtr->accelGlyph = 0;
+ mePtr->platformEntryData = (TkMenuPlatformEntryData) geometryPtr;
+ if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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(void)
+{
+ gNoTkMenus = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuBarWhenIdle --
+ *
+ * Update the menu bar next time there is an idle event.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Menu bar is redrawn.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+DrawMenuBarWhenIdle(
+ ClientData clientData) /* ignored here */
+{
+ TkMenuReferences *menuRefPtr;
+ TkMenu *appleMenuPtr, *helpMenuPtr, *menuBarPtr = NULL;
+ 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*)(intptr_t)currentAppleMenuID);
+ appleMenuPtr = Tcl_GetHashValue(hashEntryPtr);
+ TkpDestroyMenu(appleMenuPtr);
+ TkpNewMenu(appleMenuPtr);
+ appleMenuPtr->menuFlags &= ~MENU_APPLE_MENU;
+ appleMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, appleMenuPtr);
+ }
+
+ if (currentHelpMenuID != 0) {
+ hashEntryPtr = Tcl_FindHashEntry(&commandTable,
+ (char*)(intptr_t)currentHelpMenuID);
+ helpMenuPtr = Tcl_GetHashValue(hashEntryPtr);
+ TkpDestroyMenu(helpMenuPtr);
+ TkpNewMenu(helpMenuPtr);
+ helpMenuPtr->menuFlags &= ~MENU_HELP_MENU;
+ helpMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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) {
+ TkMenu *menuPtr;
+ TkMenu *cascadeMenuPtr;
+ char *appleMenuName, *helpMenuName;
+ int appleIndex = -1, helpIndex = -1, 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) {
+ 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;
+ tkCurrentAppleMenu = tkAppleMenu;
+ } else {
+ short appleID;
+
+ appleMenuPtr = menuBarPtr->entries[appleIndex]
+ ->childMenuRefPtr->menuPtr;
+ TkpDestroyMenu(appleMenuPtr);
+ TkMacOSXGetNewMenuID(appleMenuPtr->interp, appleMenuPtr, 0,
+ &appleID);
+ macMenuHdl = NewMenu(appleID, "\p\024");
+ appleMenuPtr->platformData = ckalloc(sizeof(MacMenu));
+ ((MacMenu *)appleMenuPtr->platformData)->menuHdl
+ = macMenuHdl;
+ appleMenuPtr->menuFlags |= MENU_APPLE_MENU;
+ if (!(appleMenuPtr->menuFlags
+ & MENU_RECONFIGURE_PENDING)) {
+ appleMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, appleMenuPtr);
+ }
+ InsertMenu(macMenuHdl, 0);
+ RecursivelyInsertMenu(appleMenuPtr);
+ currentAppleMenuID = appleID;
+ tkCurrentAppleMenu = macMenuHdl;
+ }
+ 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;
+
+ if (helpMenuPtr == NULL) {
+ continue;
+ }
+ helpMenuPtr->menuFlags |= MENU_HELP_MENU;
+ if (!(helpMenuPtr->menuFlags
+ & MENU_RECONFIGURE_PENDING)) {
+ helpMenuPtr->menuFlags
+ |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, 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);
+ }
+ }
+ }
+ }
+ }
+ }
+ if (!menuRefPtr || !menuBarPtr) {
+ 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+RecursivelyDeleteMenu(
+ TkMenu *menuPtr) /* All of the cascade items in this menu will
+ * be deleted from 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));
+ RecursivelyDeleteMenu(cascadeMenuPtr);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetDefaultMenubar --
+ *
+ * Puts the Apple, File and Edit menus into the Macintosh menubar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menubar is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+SetDefaultMenubar(void)
+{
+ 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, 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 */
+ const char *menuName) /* The name of the menu to put in front. If
+ * NULL, use the default menu bar. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ WindowRef macWindowPtr;
+ WindowRef frontNonFloating;
+
+ macWindowPtr = TkMacOSXDrawableWindow(winPtr->window);
+
+ frontNonFloating = ActiveNonFloatingWindow();
+ 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) {
+ searchWindow = menuPtr->masterMenuPtr->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, 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(listPtr);
+ }
+
+ if (menuPtr != NULL) {
+ listPtr = ckalloc(sizeof(TopLevelMenubarList));
+ listPtr->nextPtr = windowListPtr;
+ windowListPtr = listPtr;
+ listPtr->tkwin = tkwin;
+ listPtr->menuPtr = menuPtr;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EventuallyInvokeMenu --
+ *
+ * This IdleTime callback actually invokes the menu command scheduled in
+ * TkMacOSXDispatchMenuEvent.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands get executed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+EventuallyInvokeMenu (
+ ClientData data)
+{
+ struct MenuCommandHandlerData *realData = data;
+ int code;
+
+ code = TkInvokeMenu(realData->menuPtr->interp, realData->menuPtr,
+ realData->index);
+
+ if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) {
+ Tcl_AddErrorInfo(realData->menuPtr->interp, "\n (menu invoke)");
+ Tcl_BackgroundException(realData->menuPtr->interp, code);
+ }
+
+ if (realData->menuPtr->tkwin) {
+ RecursivelyClearActiveMenu(realData->menuPtr);
+ }
+ TkMacOSXClearMenubarActive();
+
+ Tcl_Release(realData->menuPtr->interp);
+ Tcl_Release(realData->menuPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDispatchMenuEvent --
+ *
+ * Given a menu id and an item, dispatches the command associated with
+ * it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands for the event are scheduled for execution at idle time.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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)) {
+ MenuRef outHelpMenu;
+ MenuItemIndex itemIndex;
+ int newIndex;
+
+ HMGetHelpMenu(&outHelpMenu, &itemIndex);
+ newIndex = index - itemIndex;
+ result = TkInvokeMenu(currentMenuBarInterp,
+ helpMenuRef->menuPtr, newIndex);
+ }
+ }
+ } else {
+ Tcl_HashEntry *commandEntryPtr =
+ Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
+ if (commandEntryPtr != NULL) {
+ TkMenu *menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
+
+ if ((currentAppleMenuID == menuID)
+ && (index > menuPtr->numEntries + 1)) {
+ /*
+ * We don't need to do anything here, the standard
+ * Application event handler will open the built-in Apple
+ * menu item for us.
+ */
+
+ result = TCL_OK;
+ } else {
+ struct MenuCommandHandlerData *data =
+ ckalloc(sizeof(struct MenuCommandHandlerData));
+
+ Tcl_Preserve(menuPtr->interp);
+ Tcl_Preserve(menuPtr);
+ data->menuPtr = menuPtr;
+ data->index = index - 1;
+ Tcl_DoWhenIdle(EventuallyInvokeMenu, data);
+ /* 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 */
+{
+ *heightPtr = fmPtr->linespace + menuItemExtraHeight;
+ if (IS_THEME_MENU_FONT(tkfont)) {
+ *widthPtr = menuMarkColumnWidth;
+ } else {
+ const char markChar = FindMarkCharacter(mePtr);
+ const char *markUtf = NULL;
+ int len;
+
+ len = GetUtfMarkCharacter(markChar, &markUtf);
+ *widthPtr = Tk_TextWidth(tkfont, markUtf, len) + 2*menuMarkIndent;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuAccelGeometry --
+ *
+ * Gets the width and height of the accelerator area of a menu.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 + menuItemExtraHeight;
+ *modWidthPtr = menuSymbols[COMMAND_SYMBOL].width;
+ *textWidthPtr = 0;
+ if (mePtr->type != CASCADE_ENTRY && mePtr->accelLength > 0) {
+ const char *accel = (mePtr->accelPtr == NULL) ? ""
+ : Tcl_GetString(mePtr->accelPtr);
+ EntryGeometry *geometryPtr = (EntryGeometry*)mePtr->platformEntryData;
+
+ if (IS_THEME_MENU_FONT(tkfont)) {
+ CFStringRef cfStr;
+ int width = 0;
+ int maxWidth = ((TkFont *)tkfont)->fm.maxWidth;
+
+ if (geometryPtr->accelGlyph) {
+ cfStr = CFStringCreateWithBytes(NULL,
+ (UInt8*)&geometryPtr->accelGlyph, 1,
+ kTextEncodingMacKeyboardGlyphs, false);
+ if (cfStr) {
+ width = MeasureThemeText(cfStr, kThemeMenuItemCmdKeyFont);
+ CFRelease(cfStr);
+ }
+ }
+ if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ if (!geometryPtr->accelGlyph) {
+ width = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ }
+ *textWidthPtr = maxWidth;
+ if (width < maxWidth) {
+ *modWidthPtr = 0;
+ } else {
+ *modWidthPtr = width - maxWidth;
+ }
+ } else {
+ if (!geometryPtr->accelGlyph) {
+ width = Tk_TextWidth(tkfont, accel +
+ geometryPtr->accelTextStart, mePtr->accelLength -
+ geometryPtr->accelTextStart);
+ }
+ if (width < maxWidth) {
+ *textWidthPtr = maxWidth;
+ } else {
+ *textWidthPtr = width;
+ }
+ if (geometryPtr->modifierNum) {
+ *modWidthPtr = geometryPtr->modifierWidth;
+ }
+ }
+ } else {
+ *textWidthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetTearoffEntryGeometry --
+ *
+ * Gets the width and height of of a tearoff entry.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 */
+{
+#ifdef USE_TK_MDEF
+ const int useMDEF = ((MacMenu *) menuPtr->platformData)->useMDEF;
+#endif
+ if (useMDEF && menuPtr->menuType != TEAROFF_MENU) {
+ *heightPtr = fmPtr->linespace + menuItemExtraHeight;
+ *widthPtr = menuPtr->totalWidth;
+ } else {
+ *widthPtr = *heightPtr = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuSeparatorGeometry --
+ *
+ * Gets the width and height of menu separator.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 */
+{
+ *widthPtr = 0;
+ *heightPtr = menuSeparatorHeight;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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)) {
+ short mark;
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent)/2;
+
+ GetItemMark(((MacMenu *) menuPtr->platformData)->menuHdl,
+ mePtr->index + 1, &mark);
+ if (IS_THEME_MENU_FONT(tkfont)) {
+ ThemeFontID font = kThemeMenuItemMarkFont;
+ TextEncoding encoding = GetApplicationTextEncoding();
+ CFStringRef cfStr;
+ ThemeDrawState drawState;
+ Rect bounds = {y, x + menuMarkIndent, y + height, x + width};
+
+ if (mark < kSpaceCharCode) {
+ font = kThemeMenuItemCmdKeyFont;
+ encoding = kTextEncodingMacKeyboardGlyphs;
+ }
+ switch (mePtr->state) {
+ case ENTRY_ACTIVE:
+ drawState = kThemeStatePressed;
+ break;
+ case ENTRY_DISABLED:
+ drawState = kThemeStateInactive;
+ break;
+ default:
+ drawState = kThemeStateActive;
+ break;
+ }
+ cfStr = CFStringCreateWithBytes(NULL, (UInt8*)&mark, 1,
+ encoding, false);
+ if (cfStr) {
+ DrawThemeText(d, gc, cfStr, font, drawState, &bounds,
+ baseline, teFlushDefault);
+ CFRelease(cfStr);
+ }
+ } else if (mark != 0) {
+ const char *markUtf = NULL;
+ int len;
+
+ len = GetUtfMarkCharacter(mark, &markUtf);
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, markUtf, len,
+ x + menuMarkIndent, baseline);
+ }
+ }
+ }
+}
+
+#ifdef USE_TK_MDEF
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+DrawMenuBackground(
+ TkMenu *menuPtr,
+ Rect *menuRectPtr, /* The menu rect */
+ Drawable d) /* What we are drawing into */
+{
+ Tk_3DBorder border;
+
+ EraseMenuBackground(((MacMenu *) menuPtr->platformData)->menuHdl,
+ menuRectPtr, ((MacDrawable*)d)->context);
+ border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
+ Tk_Fill3DRectangle(menuPtr->tkwin, d, border,
+ menuRectPtr->left, menuRectPtr->top,
+ menuRectPtr->right - menuRectPtr->left,
+ menuRectPtr->bottom - menuRectPtr->top, 0, TK_RELIEF_FLAT);
+}
+#endif /* USE_TK_MDEF */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuEntryAccelerator --
+ *
+ * This procedure draws the accelerator part of a menu.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 */
+{
+ if (mePtr->type != CASCADE_ENTRY && mePtr->accelLength > 0) {
+ const char *accel = (mePtr->accelPtr == NULL) ? ""
+ : Tcl_GetString(mePtr->accelPtr);
+ EntryGeometry *geometryPtr = (EntryGeometry*)mePtr->platformEntryData;
+ int leftEdge = x + width - geometryPtr->accelTextWidth;
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
+
+ if (IS_THEME_MENU_FONT(tkfont)) {
+ CFStringRef cfStr;
+ ThemeDrawState drawState;
+
+ switch (mePtr->state) {
+ case ENTRY_ACTIVE:
+ drawState = kThemeStatePressed;
+ break;
+ case ENTRY_DISABLED:
+ drawState = kThemeStateInactive;
+ break;
+ default:
+ drawState = kThemeStateActive;
+ break;
+ }
+ if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ leftEdge -= geometryPtr->modifierWidth;
+ }
+ if (geometryPtr->accelGlyph) {
+ Rect bounds = {y, leftEdge, y + height, leftEdge +
+ geometryPtr->accelTextWidth};
+
+ cfStr = CFStringCreateWithBytes(NULL,
+ (UInt8*)&geometryPtr->accelGlyph, 1,
+ kTextEncodingMacKeyboardGlyphs, false);
+ if (cfStr) {
+ DrawThemeText(d, gc, cfStr, kThemeMenuItemCmdKeyFont,
+ drawState, &bounds, baseline, teFlushDefault);
+ CFRelease(cfStr);
+ }
+ } else {
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel +
+ geometryPtr->accelTextStart, mePtr->accelLength -
+ geometryPtr->accelTextStart, leftEdge, baseline);
+ }
+ if (geometryPtr->modifierNum) {
+ Rect bounds = {y, leftEdge - geometryPtr->modifierWidth,
+ y + height, leftEdge};
+
+ cfStr = CFStringCreateWithCharacters(NULL,
+ geometryPtr->modifierUniChars,
+ geometryPtr->modifierNum);
+ if (cfStr) {
+ DrawThemeText(d, gc, cfStr, kThemeMenuItemCmdKeyFont,
+ drawState, &bounds, baseline, teFlushDefault);
+ CFRelease(cfStr);
+ }
+ }
+ } else {
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
+ mePtr->accelLength, leftEdge, baseline);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuSeparator --
+ *
+ * The menu separator is drawn.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 */
+{
+ TkMacOSXDrawingContext dc;
+ Rect r;
+
+ r.top = y;
+ r.left = x;
+ r.bottom = y + height;
+ r.right = x + width;
+ if (TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
+ ChkErr(DrawThemeMenuSeparator, &r);
+ TkMacOSXRestoreDrawingContext(&dc);
+ }
+}
+
+#ifdef USE_TK_MDEF
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+AppearanceEntryDrawWrapper(
+ TkMenuEntry *mePtr,
+ Rect *menuRectPtr,
+ MenuTrackingData *mtdPtr,
+ Drawable d,
+ Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont,
+ int erase)
+{
+ MenuEntryUserData meData;
+ Rect itemRect;
+ ThemeMenuState theState;
+ ThemeMenuItemType theType;
+ Tk_FontMetrics entryMetrics;
+
+ meData.mePtr = mePtr;
+ meData.mdefDrawable = d;
+ if (mePtr->fontPtr == NULL) {
+ meData.fmPtr = fmPtr;
+ meData.tkfont = tkfont;
+ } else {
+ meData.tkfont = Tk_GetFontFromObj(mePtr->menuPtr->tkwin,
+ mePtr->fontPtr);
+ Tk_GetFontMetrics(meData.tkfont, &entryMetrics);
+ fmPtr = &entryMetrics;
+ }
+ itemRect.left = menuRectPtr->left + mePtr->x;
+ itemRect.top = mtdPtr->virtualMenuTop + mePtr->y;
+ itemRect.right = mePtr->entryFlags & ENTRY_LAST_COLUMN ?
+ menuRectPtr->right : itemRect.left + mePtr->width;
+ itemRect.bottom = itemRect.top + mePtr->height;
+
+ 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;
+ }
+ if (erase) {
+ DisableScreenUpdates();
+ DrawMenuBackground(mePtr->menuPtr, &itemRect, d);
+ }
+ DrawThemeMenuItem(menuRectPtr, &itemRect,
+ mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom, theState,
+ theType | kThemeMenuItemNoBackground, tkThemeMenuItemDrawingUPP,
+ (unsigned long) &meData);
+ if (erase) {
+ EnableScreenUpdates();
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ThemeMenuItemDrawingProc --
+ *
+ * This routine is called from the Appearance DrawThemeMenuEntry
+ *
+ * Results:
+ * A menu entry is drawn
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+pascal void
+ThemeMenuItemDrawingProc(
+ 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 + menuItemExtraWidth, inBounds->bottom -
+ inBounds->top + menuItemExtraHeight, 0, 1);
+}
+#endif /* USE_TK_MDEF */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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)
+{
+ /*
+ * Obsolete: Nothing to do.
+ */
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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(
+ 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(
+ TkMenu *menuPtr) /* Structure describing menu. */
+{
+ TkpComputeStandardMenuGeometry(menuPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawTearoffEntry --
+ *
+ * This procedure draws a tearoff entry.
+ *
+ * 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->linespace/2;
+ points[0].x = x;
+ points[0].y = y + height/2;
+ points[1].y = points[0].y;
+ segmentWidth = 6;
+ maxX = x + menuPtr->totalWidth - 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.
+ * NB. Nobody uses this any more, since you can get the number of system
+ * help items from HMGetHelpMenu trivially. But it is in the stubs
+ * table...
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Nothing.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetHelpMenuItemCount(void)
+{
+ /*
+ * Obsolete: Nothing to do.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXMenuClick --
+ *
+ * Prepares a menubar for MenuSelect or MenuKey.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Any pending configurations of the menubar are completed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXMenuClick(void)
+{
+ 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, NULL);
+ DrawMenuBarWhenIdle(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 *parentEntryPtr = GetParentMenuEntry(menuPtr);
+
+ if (((parentEntryPtr && parentEntryPtr->state == ENTRY_DISABLED) ||
+ (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;
+ int haveAccel = 0;
+
+ 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 = maxWidth = lastColumnBreak = 0;
+ maxModifierWidth = 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->type == CASCADE_ENTRY || mePtr->accelLength > 0) {
+ haveAccel = 1;
+ break;
+ }
+ }
+
+ 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;
+ }
+ /*geometryPtr = (EntryGeometry *) mePtr->platformEntryData;*/ /* dead code */
+
+ 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;
+
+ nonAccelMargin = 0;
+ if (mePtr->type == CASCADE_ENTRY) {
+ GetMenuAccelGeometry(menuPtr, mePtr, tkfont, fmPtr,
+ &modifierWidth, &accelWidth, &height);
+ } else if (mePtr->accelLength == 0) {
+ if (haveAccel && !mePtr->hideMargin) {
+ if (IS_THEME_MENU_FONT(tkfont)) {
+ nonAccelMargin = menuSymbols[COMMAND_SYMBOL].width;
+ } else {
+ nonAccelMargin = Tk_TextWidth(tkfont,
+ menuSymbols[COMMAND_SYMBOL].utf,
+ menuSymbols[COMMAND_SYMBOL].utfLen);
+ }
+ }
+ accelWidth = modifierWidth = 0;
+ } else {
+ GetMenuAccelGeometry(menuPtr, mePtr, tkfont,
+ fmPtr, &modifierWidth, &accelWidth, &height);
+ if (height > mePtr->height) {
+ mePtr->height = height;
+ }
+ }
+
+ 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;
+ 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 imageWidth, imageHeight, textWidth = 0, textHeight = 0;
+ int indicatorSpace = mePtr->indicatorSpace;
+ int leftEdge = x + indicatorSpace;
+ int haveImage = 0, haveText = 0;
+ int imageXOffset = 0, imageYOffset = 0;
+ int textXOffset = 0, textYOffset = 0;
+ Pixmap bitmap = (Pixmap) NULL;
+ Tcl_DString itemTextDString;
+
+ /*
+ * 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) {
+ 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) {
+ GetEntryText(mePtr, &itemTextDString);
+ if (mePtr->compound != COMPOUND_NONE) {
+ textWidth = Tk_TextWidth(tkfont,
+ Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString)) +
+ menuTextLeadingEdgeMargin + menuTextTrailingEdgeMargin;
+ textHeight = fmPtr->linespace;
+ }
+ haveText = 1;
+ }
+ }
+
+ /*
+ * Now work out what the relative positions are.
+ */
+
+ if (haveImage && haveText && (mePtr->compound != COMPOUND_NONE)) {
+ 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:
+ /*
+ * Position image in the indicator space to the left of the
+ * entries, unless this entry is a radio|check button because then
+ * the indicator space will be used.
+ */
+
+ textXOffset = imageWidth + 2 - menuTextLeadingEdgeMargin;
+ if ((mePtr->type != CHECK_BUTTON_ENTRY)
+ && (mePtr->type != RADIO_BUTTON_ENTRY)) {
+ textXOffset -= indicatorSpace;
+ imageXOffset = -indicatorSpace;
+ }
+ if (textXOffset < 0) {
+ textXOffset = 0;
+ }
+ break;
+ case COMPOUND_RIGHT:
+ imageXOffset = textWidth + 2 - menuTextTrailingEdgeMargin;
+ break;
+ case COMPOUND_CENTER:
+ textXOffset = (fullWidth - textWidth)/2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ break;
+ case COMPOUND_NONE:
+ /*
+ * Never reached.
+ */
+ break;
+ }
+ }
+
+ /*
+ * 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 + imageXOffset,
+ y + (mePtr->height - imageHeight)/2 + imageYOffset);
+ } else {
+ Tk_RedrawImage(mePtr->image, 0, 0, imageWidth, imageHeight,
+ d, leftEdge + imageXOffset,
+ y + (mePtr->height - imageHeight)/2 + imageYOffset);
+ }
+ } else if (mePtr->bitmapPtr != NULL) {
+ XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, imageWidth,
+ imageHeight, leftEdge + imageXOffset,
+ y + (mePtr->height - imageHeight)/2 + imageYOffset, 1);
+ }
+ if (haveText) {
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent)/2;
+
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont,
+ Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString),
+ leftEdge + menuTextLeadingEdgeMargin + textXOffset,
+ baseline + textYOffset);
+ Tcl_DStringFree(&itemTextDString);
+ }
+
+ if (mePtr->state == ENTRY_DISABLED) {
+ if (menuPtr->disabledFgPtr == NULL) {
+ /* XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
+ width, height); */
+ } else if ((mePtr->image != NULL)
+ && (menuPtr->disabledImageGC != None)) {
+ XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
+ leftEdge + imageXOffset,
+ y + (mePtr->height - imageHeight)/2 + imageYOffset,
+ imageWidth, 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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;
+ int haveImage = 0, tornOff = (menuPtr->menuType == TEAROFF_MENU);
+#ifdef USE_TK_MDEF
+ const int useMDEF = ((MacMenu *) menuPtr->platformData)->useMDEF;
+#endif
+
+ if (mePtr->image != NULL && (useMDEF || tornOff)) {
+ Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
+ haveImage = 1;
+ } else if (mePtr->bitmapPtr != NULL && (useMDEF || tornOff)) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
+ haveImage = 1;
+ }
+ if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
+ int textWidth = 0, textHeight = fmPtr->linespace;
+
+ if (mePtr->labelPtr != NULL) {
+ Tcl_DString itemTextDString;
+
+ GetEntryText(mePtr, &itemTextDString);
+ textWidth = Tk_TextWidth(tkfont,
+ Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString)) +
+ menuTextLeadingEdgeMargin + menuTextTrailingEdgeMargin;
+ Tcl_DStringFree(&itemTextDString);
+
+ if (haveImage && (mePtr->compound != COMPOUND_NONE)) {
+ switch ((enum compound) mePtr->compound) {
+ int margin;
+
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM:
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ *heightPtr += textHeight + 2;
+ break;
+ case COMPOUND_LEFT:
+ margin = *widthPtr + 2;
+ if (margin > menuTextLeadingEdgeMargin) {
+ margin = menuTextLeadingEdgeMargin;
+ }
+ *widthPtr += textWidth + 2 - margin;
+ if (textHeight > *heightPtr) {
+ *heightPtr = textHeight;
+ }
+ break;
+ case COMPOUND_RIGHT:
+ margin = menuTextTrailingEdgeMargin;
+ *widthPtr += textWidth + 2 - margin;
+ if (textHeight > *heightPtr) {
+ *heightPtr = textHeight;
+ }
+ break;
+ case COMPOUND_CENTER:
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ if (textHeight > *heightPtr) {
+ *heightPtr = textHeight;
+ }
+ break;
+ case COMPOUND_NONE:
+ /*
+ * Never reached.
+ */
+ break;
+ }
+ goto labelGeomDone;
+ }
+ }
+ *widthPtr = textWidth;
+ *heightPtr = textHeight;
+ }
+
+ labelGeomDone:
+ *heightPtr += menuItemExtraHeight;
+ *widthPtr += menuItemExtraWidth;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGenerateParentMenuSelectEvent --
+ *
+ * Respond to a hierarchical menu being opened.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Places a virtual event on the event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXGenerateParentMenuSelectEvent(
+ MenuRef menu)
+{
+ TkMenu *menuPtr = MenuPtrForMenuRef(menu);
+
+ if (menuPtr) {
+ TkMenuEntry *parentEntryPtr = GetParentMenuEntry(menuPtr);
+
+ if (parentEntryPtr && (menuPtr = parentEntryPtr->menuPtr)) {
+ TkActivateMenuEntry(menuPtr, parentEntryPtr->index);
+ MenuSelectEvent(menuPtr);
+ Tcl_ServiceAll();
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGenerateMenuSelectEvent --
+ *
+ * Respond to a menu item being selected.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Places a virtual event on the event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXGenerateMenuSelectEvent(
+ MenuRef menu,
+ MenuItemIndex index)
+{
+ TkMenu *menuPtr = MenuPtrForMenuRef(menu);
+ int item = index - 1;
+
+ if (menuPtr) {
+ if (item < 0 || item >= menuPtr->numEntries ||
+ (menuPtr->entries[item])->state == ENTRY_DISABLED) {
+ TkActivateMenuEntry(menuPtr, -1);
+ } else {
+ TkActivateMenuEntry(menuPtr, item);
+ MenuSelectEvent(menuPtr);
+ Tcl_ServiceAll();
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+MenuSelectEvent(
+ TkMenu *menuPtr) /* the menu we have selected. */
+{
+ XVirtualEvent event;
+
+ bzero(&event, sizeof(XVirtualEvent));
+ 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();
+
+ XQueryPointer(NULL, None, NULL, NULL, &event.x_root, &event.y_root, NULL,
+ NULL, &event.state);
+ event.same_screen = true;
+ event.name = Tk_GetUid("MenuSelect");
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXClearActiveMenu --
+ *
+ * Clears Tk's active entry for the given MenuRef.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates <<MenuSelect>> virtual events.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXClearActiveMenu(
+ MenuRef menu)
+{
+ TkMenu *menuPtr = MenuPtrForMenuRef(menu);
+
+ if (menuPtr) {
+ RecursivelyClearActiveMenu(menuPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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);
+ 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);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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);
+ }
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+ const 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)
+{
+ MenuSymbol *ms = menuSymbols;
+ CFStringRef cfStr;
+
+ lastMenuID = 256;
+ Tcl_InitHashTable(&commandTable, TCL_ONE_WORD_KEYS);
+ currentMenuBarOwner = NULL;
+ currentAppleMenuID = 0;
+ currentHelpMenuID = 0;
+ currentMenuBarInterp = NULL;
+ currentMenuBarName = NULL;
+ windowListPtr = NULL;
+
+#ifdef USE_TK_MDEF
+ tkThemeMenuItemDrawingUPP
+ = NewMenuItemDrawingUPP(ThemeMenuItemDrawingProc);
+ useMDEFVar = Tcl_NewStringObj("::tk::mac::useCustomMDEF", -1);
+ macMDEFDrawable.winPtr = NULL;
+ macMDEFDrawable.xOff = 0;
+ macMDEFDrawable.yOff = 0;
+ macMDEFDrawable.visRgn = NULL;
+ macMDEFDrawable.aboveVisRgn = NULL;
+ macMDEFDrawable.drawRect = CGRectNull;
+ macMDEFDrawable.referenceCount = 0;
+ macMDEFDrawable.toplevel = NULL;
+ macMDEFDrawable.flags = 0;
+ macMDEFDrawable.grafPtr = NULL;
+ macMDEFDrawable.context = NULL;
+ macMDEFDrawable.size = CGSizeZero;
+#endif
+
+ ChkErr(GetThemeMetric, kThemeMetricMenuMarkColumnWidth,
+ &menuMarkColumnWidth);
+ ChkErr(GetThemeMetric, kThemeMetricMenuMarkIndent, &menuMarkIndent);
+ ChkErr(GetThemeMetric, kThemeMetricMenuTextLeadingEdgeMargin,
+ &menuTextLeadingEdgeMargin);
+ ChkErr(GetThemeMetric, kThemeMetricMenuTextTrailingEdgeMargin,
+ &menuTextTrailingEdgeMargin);
+ ChkErr(GetThemeMenuItemExtra, kThemeMenuItemPlain, &menuItemExtraHeight,
+ &menuItemExtraWidth);
+ ChkErr(GetThemeMenuSeparatorHeight, &menuSeparatorHeight);
+
+ while (ms->unicode) {
+ ms->utfLen = Tcl_UniCharToUtf(ms->unicode, ms->utf);
+ ms->utf[ms->utfLen] = 0;
+ cfStr = CFStringCreateWithCharacters(NULL, &ms->unicode, 1);
+ if (cfStr) {
+ ms->width = MeasureThemeText(cfStr, kThemeMenuItemCmdKeyFont);
+ CFRelease(cfStr);
+ }
+ ms++;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMenuThreadInit --
+ *
+ * Does platform-specific initialization of thread-specific menu state.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMenuThreadInit(void)
+{
+ /*
+ * 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(void)
+{
+ if ((currentMenuBarName != NULL) && (currentMenuBarInterp != NULL)) {
+ TkMenuReferences *mbRefPtr =
+ TkFindMenuReferences(currentMenuBarInterp,currentMenuBarName);
+
+ if ((mbRefPtr != NULL) && (mbRefPtr->menuPtr != NULL)) {
+ int code;
+
+ Tcl_Preserve(currentMenuBarInterp);
+ code = TkPreprocessMenu(mbRefPtr->menuPtr->masterMenuPtr);
+ if ((code != TCL_OK) && (code != TCL_CONTINUE)
+ && (code != TCL_BREAK)) {
+ Tcl_AddErrorInfo(currentMenuBarInterp,
+ "\n (menu preprocess)");
+ Tcl_BackgroundException(currentMenuBarInterp, code);
+ }
+ Tcl_Release(currentMenuBarInterp);
+ }
+ }
+}
+
+#ifdef USE_TK_MDEF
+#pragma mark MDEF
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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;
+ MenuID menuID;
+
+ menuID = GetMenuID(menu);
+ commandEntryPtr = Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
+ if (!commandEntryPtr) return;
+ menuPtr = Tcl_GetHashValue(commandEntryPtr);
+
+ 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:
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: DrawItemsMsg");
+#endif
+ /*
+ * We do nothing here, because we don't support the Menu Managers
+ * dynamic item groups
+ */
+
+ break;
+ case kMenuThemeSavvyMsg:
+ *whichItem = kThemeSavvyMenuResponse;
+ break;
+ case kMenuSizeMsg:
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: SizeMsg %d, %d", hitPt.h, hitPt.v);
+#endif
+ SetMenuWidth(menu, hitPt.h < menuPtr->totalWidth ? hitPt.h :
+ menuPtr->totalWidth);
+ SetMenuHeight(menu, hitPt.v < menuPtr->totalHeight ? hitPt.v :
+ menuPtr->totalHeight);
+ break;
+ case kMenuDrawMsg:
+ HandleMenuDrawMsg(menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ case kMenuFindItemMsg:
+ HandleMenuFindItemMsg(menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ case kMenuPopUpMsg:
+ HandleMenuPopUpMsg(menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuHiliteMsg --
+ *
+ * Handles the MenuDefProc's hilite message.
+ *
+ * Results:
+ * A menu entry is drawn
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+HandleMenuHiliteMsg(
+ MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ OSStatus err;
+ Tk_Font tkfont;
+ Tk_FontMetrics fontMetrics;
+ MDEFHiliteItemData *hidPtr = (MDEFHiliteItemData *) whichItem;
+ int oldItem = hidPtr->previousItem - 1;
+ int newItem = hidPtr->newItem - 1;
+ MenuTrackingData mtd, *mtdPtr = &mtd;
+
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: HiliteMsg %d -> %d", hidPtr->previousItem,
+ hidPtr->newItem);
+#endif
+ GetPort(&macMDEFDrawable.grafPtr);
+ macMDEFDrawable.context = (CGContextRef) hidPtr->context;
+
+ err = ChkErr(GetMenuTrackingData, menu, mtdPtr);
+ if (err != noErr) {
+ return;
+ }
+
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(tkfont, &fontMetrics);
+ if (oldItem >= 0) {
+ AppearanceEntryDrawWrapper(menuPtr->entries[oldItem], menuRectPtr,
+ mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics, tkfont, 1);
+ }
+ if (newItem >= 0) {
+ AppearanceEntryDrawWrapper(menuPtr->entries[newItem], menuRectPtr,
+ mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics, tkfont, 0);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuDrawMsg --
+ *
+ * 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 menuFont;
+ Tk_FontMetrics fontMetrics;
+ TkMenuEntry *mePtr;
+ int i;
+ Rect menuClipRect, bounds;
+ MDEFDrawData *ddPtr = (MDEFDrawData *) whichItem;
+ MenuTrackingData *mtdPtr = &(ddPtr->trackingData);
+ TkWindow *winPtr = (TkWindow *) menuPtr->tkwin;
+
+ GetPort(&macMDEFDrawable.grafPtr);
+ GetPortBounds(macMDEFDrawable.grafPtr, &bounds);
+ macMDEFDrawable.context = (CGContextRef) ddPtr->context;
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: DrawMsg %d - %d; %d - %d", menuRectPtr->top,
+ menuRectPtr->bottom, bounds.top, bounds.bottom);
+#endif
+ winPtr->changes.x = menuRectPtr->left;
+ winPtr->changes.y = menuRectPtr->top;
+ winPtr->changes.width = menuRectPtr->right - menuRectPtr->left;
+ winPtr->changes.height = menuRectPtr->bottom - menuRectPtr->top;
+ TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
+ 0, 0, -1, -1);
+#if 0
+ if (menuPtr->menuRefPtr->topLevelListPtr != NULL) {
+ menuType = kThemeMenuTypePullDown;
+ } else if (menuPtr->menuRefPtr->parentEntryPtr != NULL) {
+ menuType = kThemeMenuTypeHierarchical;
+ } else {
+ menuType = kThemeMenuTypePopUp;
+ }
+#endif
+ DrawMenuBackground(menuPtr, menuRectPtr, (Drawable) &macMDEFDrawable);
+ menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(menuFont, &fontMetrics);
+ menuClipRect = *menuRectPtr;
+ mtdPtr->virtualMenuBottom = mtdPtr->virtualMenuTop + menuPtr->totalHeight;
+
+ /*
+ * Next, figure out scrolling information.
+ */
+
+ if ((menuRectPtr->bottom - menuRectPtr->top) < menuPtr->totalHeight) {
+ short arrowHeight = fontMetrics.linespace + 1;
+ Rect arrowRect, eraseRect;
+ ThemeMenuState menuState = IsMenuItemEnabled(menu, 0) ?
+ kThemeMenuActive : kThemeMenuDisabled;
+
+ if (mtdPtr->virtualMenuTop < menuRectPtr->top) {
+ arrowRect = bounds;
+ /*arrowRect.top += 1;*/
+ arrowRect.bottom = arrowRect.top + arrowHeight;
+ eraseRect = arrowRect;
+ eraseRect.top = menuRectPtr->top;
+ menuClipRect.top = arrowRect.bottom;
+ ChkErr(EraseMenuBackground, menu, &eraseRect,
+ macMDEFDrawable.context);
+ ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
+ mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom,
+ menuState, kThemeMenuItemScrollUpArrow, NULL, 0);
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("upArrow: %d - %d, %d - %d", arrowRect.top,
+ arrowRect.bottom, arrowRect.left, arrowRect.right);
+#endif
+ }
+ if (mtdPtr->virtualMenuBottom > menuRectPtr->bottom) {
+ arrowRect = bounds;
+ arrowRect.bottom -= 1;
+ arrowRect.top = arrowRect.bottom - arrowHeight;
+ eraseRect = arrowRect;
+ eraseRect.bottom = menuRectPtr->bottom;
+ menuClipRect.bottom = arrowRect.top;
+ ChkErr(EraseMenuBackground, menu, &eraseRect,
+ macMDEFDrawable.context);
+ ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
+ mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom,
+ menuState, kThemeMenuItemScrollDownArrow, NULL, 0);
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("downArrow: %d - %d, %d - %d", arrowRect.top,
+ arrowRect.bottom, arrowRect.left, arrowRect.right);
+#endif
+ }
+ TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
+ menuClipRect.left, menuClipRect.top, menuClipRect.right -
+ menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
+ }
+
+ /*
+ * 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.
+ */
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height <
+ menuClipRect.top || mtdPtr->virtualMenuTop + mePtr->y >
+ menuClipRect.bottom) {
+ continue;
+ }
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, &fontMetrics, menuFont, 0);
+ }
+ MDEFScrollFlag = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuFindItemMsg --
+ *
+ * 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
+HandleMenuFindItemMsg(
+ MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ Tk_Font menuFont;
+ Tk_FontMetrics fontMetrics;
+ TkMenuEntry *mePtr;
+ int i, newItem = -1, itemUnderMouse = -1;
+ Rect itemRect = {0, 0, 0, 0}, menuClipRect, bounds;
+ int hasTopScroll, hasBottomScroll;
+ MDEFFindItemData *fiPtr = (MDEFFindItemData *)whichItem;
+ MenuTrackingData *mtdPtr = &(fiPtr->trackingData), topMtd;
+ enum {
+ DONT_SCROLL, DOWN_SCROLL, UP_SCROLL
+ } scrollDirection;
+ short arrowHeight;
+
+#ifdef TK_MAC_DEBUG_MENUS
+ static Point lastHitPt = {0, 0};
+
+ if (hitPt.h != lastHitPt.h || hitPt.v != lastHitPt.v) {
+ lastHitPt = hitPt;
+ TkMacOSXDbgMsg("MDEF: FindItemMsg: %d, %d", hitPt.h, hitPt.v);
+ }
+#endif
+
+ GetPort(&macMDEFDrawable.grafPtr);
+ GetPortBounds(macMDEFDrawable.grafPtr, &bounds);
+ macMDEFDrawable.context = (CGContextRef) fiPtr->context;
+
+ /*
+ * Now we need to take care of scrolling the menu.
+ */
+
+ menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(menuFont, &fontMetrics);
+ arrowHeight = fontMetrics.linespace + 1;
+ menuClipRect = *menuRectPtr;
+ hasTopScroll = mtdPtr->virtualMenuTop < menuRectPtr->top;
+ hasBottomScroll = mtdPtr->virtualMenuBottom > menuRectPtr->bottom;
+ scrollDirection = DONT_SCROLL;
+ if (hasTopScroll) {
+ menuClipRect.top = bounds.top + arrowHeight;
+ if (hitPt.v < menuClipRect.top) {
+ newItem = -1;
+ scrollDirection = DOWN_SCROLL;
+ }
+ }
+ if (hasBottomScroll) {
+ menuClipRect.bottom = bounds.bottom - 1 - arrowHeight;
+ if (hitPt.v > menuClipRect.bottom) {
+ newItem = -1;
+ scrollDirection = UP_SCROLL;
+ }
+ }
+ if (MDEFScrollFlag) {
+ scrollDirection = DONT_SCROLL;
+ MDEFScrollFlag = 0;
+ }
+ /*
+ * Don't scroll if there are other menus open above us
+ */
+ ChkErr(GetMenuTrackingData, NULL, &topMtd);
+ if (menu != topMtd.menu) {
+ scrollDirection = DONT_SCROLL;
+ }
+ if (scrollDirection == DONT_SCROLL) {
+ /*
+ * 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;
+ itemRect.right = mePtr->entryFlags & ENTRY_LAST_COLUMN ?
+ menuRectPtr->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 *parentEntryPtr =
+ GetParentMenuEntry(menuPtr);
+
+ if (parentEntryPtr &&
+ parentEntryPtr->state == ENTRY_DISABLED) {
+ newItem = -1;
+ itemUnderMouse = i;
+ } else {
+ newItem = i;
+ itemUnderMouse = i;
+ }
+ }
+ break;
+ }
+ }
+ }
+ } else {
+ short scrollAmt;
+ unsigned long scrollDelay;
+ Rect arrowRect, eraseRect, scrolledMenuClipRect;
+ ThemeMenuState menuState = IsMenuItemEnabled(menu, 0) ?
+ kThemeMenuActive : kThemeMenuDisabled;
+ int oldItem = mtdPtr->itemSelected - 1;
+ short d;
+
+ TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
+ 0, 0, -1, -1);
+ scrollAmt = fontMetrics.linespace + menuItemExtraHeight;
+ if (scrollDirection == UP_SCROLL) {
+ scrollAmt = -scrollAmt;
+ d = hitPt.v - bounds.bottom;
+ } else {
+ d = bounds.top - hitPt.v;
+ }
+ scrollDelay = (d >= scrollAmt/2) ? 1 : 10;
+ menuClipRect = *menuRectPtr;
+ if (mtdPtr->virtualMenuTop + scrollAmt < menuRectPtr->top) {
+ arrowRect = bounds;
+ /*arrowRect.top += 1;*/
+ arrowRect.bottom = arrowRect.top + arrowHeight;
+ eraseRect = arrowRect;
+ eraseRect.top = menuRectPtr->top;
+ menuClipRect.top = arrowRect.bottom;
+ if (!hasTopScroll) {
+ ChkErr(EraseMenuBackground, menu, &eraseRect,
+ macMDEFDrawable.context);
+ ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
+ mtdPtr->virtualMenuTop + scrollAmt,
+ mtdPtr->virtualMenuBottom + scrollAmt,
+ menuState, kThemeMenuItemScrollUpArrow, NULL, 0);
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("upArrow: %d - %d, %d - %d", arrowRect.top,
+ arrowRect.bottom, arrowRect.left, arrowRect.right);
+#endif
+ }
+ }
+ if (mtdPtr->virtualMenuBottom + scrollAmt > menuRectPtr->bottom) {
+ arrowRect = bounds;
+ arrowRect.bottom -= 1;
+ arrowRect.top = arrowRect.bottom - arrowHeight;
+ eraseRect = arrowRect;
+ eraseRect.bottom = menuRectPtr->bottom;
+ menuClipRect.bottom = arrowRect.top;
+ if (!hasBottomScroll) {
+ ChkErr(EraseMenuBackground, menu, &eraseRect,
+ macMDEFDrawable.context);
+ ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
+ mtdPtr->virtualMenuTop + scrollAmt,
+ mtdPtr->virtualMenuBottom + scrollAmt,
+ menuState, kThemeMenuItemScrollDownArrow, NULL, 0);
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("downArrow: %d - %d, %d - %d", arrowRect.top,
+ arrowRect.bottom, arrowRect.left, arrowRect.right);
+#endif
+ }
+ }
+ TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
+ menuClipRect.left, menuClipRect.top, menuClipRect.right -
+ menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
+ TkActivateMenuEntry(menuPtr, -1);
+ if (oldItem >= 0) {
+ AppearanceEntryDrawWrapper(menuPtr->entries[oldItem], menuRectPtr,
+ mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics,
+ menuFont, 1);
+ }
+ ChkErr(ScrollMenuImage, menu, &menuClipRect, 0, scrollAmt,
+ macMDEFDrawable.context);
+ mtdPtr->virtualMenuTop += scrollAmt;
+ mtdPtr->virtualMenuBottom += scrollAmt;
+ scrolledMenuClipRect = menuClipRect;
+ OffsetRect(&scrolledMenuClipRect, 0, scrollAmt);
+ menuClipRect = bounds;
+ if (mtdPtr->virtualMenuTop < menuRectPtr->top) {
+ menuClipRect.top += arrowHeight;
+ }
+ if (mtdPtr->virtualMenuBottom > menuRectPtr->bottom) {
+ menuClipRect.bottom -= arrowHeight;
+ }
+ TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
+ menuClipRect.left, menuClipRect.top, menuClipRect.right -
+ menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
+ if (scrolledMenuClipRect.bottom < menuClipRect.bottom) {
+ menuClipRect.top = scrolledMenuClipRect.bottom;
+ } else if (scrolledMenuClipRect.top < menuClipRect.top) {
+ menuClipRect.bottom = scrolledMenuClipRect.top;
+ }
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height <
+ menuClipRect.top || mtdPtr->virtualMenuTop + mePtr->y >
+ menuClipRect.bottom) {
+ continue;
+ }
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("Drawing item %i", i);
+#endif
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, &fontMetrics, menuFont, 1);
+ }
+ Delay(scrollDelay, NULL);
+ }
+ mtdPtr->itemSelected = newItem + 1;
+ mtdPtr->itemUnderMouse = itemUnderMouse + 1;
+ mtdPtr->itemRect = itemRect;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuPopUpMsg --
+ *
+ * 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;
+ static SInt16 menuBarHeight = 0;
+
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: PopUpMsg");
+#endif
+
+ if (!menuBarHeight) {
+ ChkErr(GetThemeMenuBarHeight, &menuBarHeight);
+ }
+ GetQDGlobalsScreenBits(&screenBits);
+
+ /*
+ * Note that for some oddball reason, h and v are reversed in the point
+ * given to us by the MDEF.
+ */
+
+ oldItem = *whichItem;
+ if (oldItem >= menuPtr->numEntries) {
+ oldItem = -1;
+ }
+ portRect.top = 0;
+ portRect.bottom = 1280;
+ maxMenuHeight = screenBits.bounds.bottom - screenBits.bounds.top
+ - menuBarHeight - SCREEN_MARGIN;
+ if (menuPtr->totalHeight > maxMenuHeight) {
+ menuRectPtr->top = menuBarHeight;
+ } else {
+ int delta;
+
+ menuRectPtr->top = hitPt.h;
+ if (oldItem >= 0) {
+ menuRectPtr->top -= menuPtr->entries[oldItem]->y;
+ }
+
+ if (menuRectPtr->top < menuBarHeight) {
+ /*
+ * Displace downward if the menu would stick off the top of the
+ * screen.
+ */
+
+ menuRectPtr->top = menuBarHeight + 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 == menuBarHeight) {
+ *whichItem = hitPt.h;
+ } else {
+ *whichItem = menuRectPtr->top;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuCalcItemMsg --
+ *
+ * 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;
+ OSStatus err;
+ int virtualTop, item = *whichItem-1;
+
+ err = ChkErr(GetMenuTrackingData, menu, mtdPtr);
+ if (err == noErr) {
+ virtualTop = mtdPtr->virtualMenuTop;
+ } else {
+ virtualTop = 0;
+ }
+
+ if (item >= 0 && item < menuPtr->numEntries) {
+ mePtr = menuPtr->entries[item];
+ 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;
+ }
+#ifdef TK_MAC_DEBUG_MENUS
+ TkMacOSXDbgMsg("MDEF: CalcItemMsg %d: %d, %d", *whichItem,
+ menuRectPtr->left, menuRectPtr->top);
+#endif
+}
+#endif /* USE_TK_MDEF */
+
+/*
+ * Local Variables:
+ * fill-column: 78
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/carbon/tkMacOSXMenubutton.c b/carbon/tkMacOSXMenubutton.c
new file mode 100644
index 0000000..9846d13
--- /dev/null
+++ b/carbon/tkMacOSXMenubutton.c
@@ -0,0 +1,950 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMenu.h"
+#include "tkMenubutton.h"
+#include "tkMacOSXFont.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 */
+
+#define FIRST_DRAW 2
+#define ACTIVE 4
+
+MODULE_SCOPE int TkMacOSXGetNewMenuID(Tcl_Interp *interp, TkMenu *menuInstPtr,
+ int cascade, short *menuIDPtr);
+MODULE_SCOPE void TkMacOSXFreeMenuID(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;
+ unsigned long userPaneBackground;
+ int flags;
+ MenuButtonControlParams params;
+ ControlTitleParams titleParams;
+ ControlButtonContentInfo bevelButtonContent;
+ OpenCPicParams picParams;
+} MacMenuButton;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static OSStatus SetUserPaneDrawProc(ControlRef control,
+ ControlUserPaneDrawProcPtr upp);
+static OSStatus 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 void MenuButtonEventProc(ClientData clientData, XEvent *eventPtr);
+static int UpdateControlColors(MacMenuButton *mbPtr);
+static void ComputeMenuButtonControlParams(TkMenuButton *mbPtr,
+ MenuButtonControlParams * paramsPtr);
+static void ComputeControlTitleParams(TkMenuButton *mbPtr,
+ ControlTitleParams *paramsPtr);
+static void CompareControlTitleParams(ControlTitleParams *p1Ptr,
+ ControlTitleParams *p2Ptr, int *titleChanged, int *styleChanged);
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 = ckalloc(sizeof(MacMenuButton));
+
+ Tk_CreateEventHandler(tkwin, ActivateMask,
+ MenuButtonEventProc, (ClientData) mbPtr);
+ mbPtr->flags = 0;
+ mbPtr->userPaneBackground = PIXEL_MAGIC << 24;
+ mbPtr->userPane = NULL;
+ mbPtr->control = NULL;
+ 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;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged = false;
+ int hasImageOrBitmap = 0, width, height;
+ OSStatus err;
+ ControlButtonGraphicAlignment theAlignment;
+ Rect paneRect, cntrRect;
+ int active, enabled;
+
+ butPtr->flags &= ~REDRAW_PENDING;
+ if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ return;
+ }
+ pixmap = (Pixmap) Tk_WindowId(tkwin);
+ 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);
+ 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;
+
+ if (mbPtr->userPane) {
+ MenuButtonControlParams params;
+ bzero(&params, sizeof(params));
+ ComputeMenuButtonControlParams(butPtr, &params);
+ if (
+#ifdef TK_REBUILD_TOPLEVEL
+ (winPtr->flags & TK_REBUILD_TOPLEVEL) ||
+#endif
+ 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)) {
+ TkMacOSXDbgMsg("Init Control failed");
+ return;
+ }
+ }
+ SetControlBounds(mbPtr->userPane, &paneRect);
+ SetControlBounds(mbPtr->control, &cntrRect);
+
+ 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;
+ }
+
+ /*
+ * We need to cache the title and its style
+ */
+
+ if (!(mbPtr->flags & FIRST_DRAW)) {
+ ControlTitleParams titleParams;
+ int titleChanged;
+ int styleChanged;
+
+ ComputeControlTitleParams(butPtr, &titleParams);
+ CompareControlTitleParams(&titleParams, &mbPtr->titleParams,
+ &titleChanged, &styleChanged);
+ if (titleChanged) {
+ CFStringRef cf = CFStringCreateWithCString(NULL,
+ (char*) 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) {
+ err = ChkErr(SetControlFontStyle, mbPtr->control,
+ &titleParams.style);
+ if (err != noErr) {
+ return;
+ }
+ }
+ bcopy(&titleParams.style, &mbPtr->titleParams.style,
+ sizeof(titleParams.style));
+ }
+ }
+ if (hasImageOrBitmap) {
+ {
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ portChanged = QDSwapPort(destPort, &savePort);
+ mbPtr->picParams.version = -2;
+ mbPtr->picParams.hRes = 0x00480000;
+ mbPtr->picParams.vRes = 0x00480000;
+ mbPtr->picParams.srcRect.top = 0;
+ mbPtr->picParams.srcRect.left = 0;
+ mbPtr->picParams.srcRect.bottom = height;
+ mbPtr->picParams.srcRect.right = width;
+ mbPtr->picParams.reserved1 = 0;
+ mbPtr->picParams.reserved2 = 0;
+ mbPtr->bevelButtonContent.contentType = kControlContentPictHandle;
+ mbPtr->bevelButtonContent.u.picture = OpenCPicture(&mbPtr->picParams);
+ if (!mbPtr->bevelButtonContent.u.picture) {
+ TkMacOSXDbgMsg("OpenCPicture failed");
+ }
+ 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->image != NULL) {
+ Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, 0, 0);
+ } else {
+ GC gc;
+
+ if (butPtr->state == STATE_DISABLED) {
+ gc = butPtr->disabledGC;
+ } else if (butPtr->state == STATE_ACTIVE) {
+ gc = butPtr->activeTextGC;
+ } else {
+ gc = butPtr->normalTextGC;
+ }
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0,
+ width, height, 0, 0, 1);
+ }
+ {
+ ClosePicture();
+ tkPictureIsOpen = 0;
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ }
+ ChkErr(SetControlData, mbPtr->control, kControlButtonPart,
+ kControlBevelButtonContentTag,
+ sizeof(ControlButtonContentInfo),
+ (char *) &mbPtr->bevelButtonContent);
+ 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;
+ }
+
+ ChkErr(SetControlData, mbPtr->control, kControlButtonPart,
+ kControlBevelButtonGraphicAlignTag,
+ sizeof(ControlButtonGraphicAlignment), (char *) &theAlignment);
+ }
+ active = ((mbPtr->flags & ACTIVE) != 0);
+ if (active != IsControlActive(mbPtr->control)) {
+ if (active) {
+ ChkErr(ActivateControl, mbPtr->control);
+ } else {
+ ChkErr(DeactivateControl, mbPtr->control);
+ }
+ }
+ enabled = !(butPtr->state == STATE_DISABLED);
+ if (enabled != IsControlEnabled(mbPtr->control)) {
+ if (enabled) {
+ ChkErr(EnableControl, mbPtr->control);
+ } else {
+ ChkErr(DisableControl, mbPtr->control);
+ }
+ }
+ if (active && enabled) {
+ if (butPtr->state == STATE_ACTIVE) {
+ if (hasImageOrBitmap) {
+ HiliteControl(mbPtr->control, kControlButtonPart);
+ } else {
+ HiliteControl(mbPtr->control, kControlLabelPart);
+ }
+ } else {
+ HiliteControl(mbPtr->control, kControlNoPart);
+ }
+ }
+ UpdateControlColors(mbPtr);
+ if (mbPtr->flags & FIRST_DRAW) {
+ ShowControl(mbPtr->control);
+ ShowControl(mbPtr->userPane);
+ mbPtr->flags ^= FIRST_DRAW;
+ } else {
+ SetControlVisibility(mbPtr->control, true, true);
+ Draw1Control(mbPtr->userPane);
+ }
+ if (hasImageOrBitmap) {
+ if (mbPtr->bevelButtonContent.contentType ==
+ kControlContentPictHandle) {
+ KillPicture(mbPtr->bevelButtonContent.u.picture);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 = 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(
+ register TkMenuButton *mbPtr) /* Widget record for menu button. */
+{
+ int width, height;
+ int hasImageOrBitmap = 0;
+
+ mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;
+ if (mbPtr->image != None) {
+ Tk_SizeOfImage(mbPtr->image, &width, &height);
+ hasImageOrBitmap = 1;
+ } else if (mbPtr->bitmap != None) {
+ Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &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 (hasImageOrBitmap) {
+ if (mbPtr->width > 0) {
+ width = mbPtr->width;
+ }
+ if (mbPtr->height > 0) {
+ height = mbPtr->height;
+ }
+ mbPtr->inset = mbPtr->highlightWidth + 2;
+ width += (2 * mbPtr->borderWidth + 4);
+ height += (2 * mbPtr->borderWidth + 4);
+ } else {
+ width += TK_POPUP_OFFSET;
+ }
+ if (mbPtr->indicatorOn) {
+ mbPtr->indicatorHeight = kTriangleHeight;
+ mbPtr->indicatorWidth = kTriangleWidth + kTriangleMargin;
+ width += mbPtr->indicatorWidth;
+ } else {
+ mbPtr->indicatorHeight = 0;
+ mbPtr->indicatorWidth = 0;
+ }
+
+ Tk_GeometryRequest(mbPtr->tkwin, (int) (width + 2*mbPtr->inset),
+ (int) (height + 2*mbPtr->inset));
+ Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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,
+ (char*) 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)
+{
+ OSStatus err;
+ TkMenuButton *butPtr = (TkMenuButton *) mbPtr;
+ SInt16 procID, initialValue, minValue, maxValue;
+ Boolean initiallyVisible;
+ SInt32 controlReference;
+ short menuID;
+ ControlRef rootControl =
+ TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
+
+ mbPtr->windowRef = TkMacOSXDrawableWindow(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) {
+ TkMacOSXDbgMsg("Failed to create user pane control");
+ return 1;
+ }
+ err = ChkErr(EmbedControl, mbPtr->userPane, rootControl);
+ if (err != noErr) {
+ 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) {
+ TkMacOSXDbgMsg("Failed to create control of type %d",
+ mbPtr->params.procID);
+ return 1;
+ }
+ err = ChkErr(EmbedControl, mbPtr->control, mbPtr->userPane);
+ if (err != noErr ) {
+ return 1;
+ }
+ if (mbPtr->params.isBevel) {
+ CFStringRef cf = CFStringCreateWithCString(NULL,
+ (char*) mbPtr->titleParams.title, kCFStringEncodingUTF8);
+
+ SetControlTitleWithCFString(mbPtr->control, cf);
+ CFRelease(cf);
+ if (mbPtr->titleParams.len) {
+ err = ChkErr(SetControlFontStyle, mbPtr->control,
+ &mbPtr->titleParams.style);
+ if (err != noErr) {
+ return 1;
+ }
+ }
+ } else {
+ CFStringRef cfStr;
+
+ err = TkMacOSXGetNewMenuID(mbPtr->info.interp, (TkMenu *) mbPtr, 0,
+ &menuID);
+ if (err != TCL_OK) {
+ return 1;
+ }
+ err = ChkErr(CreateNewMenu, menuID, kMenuAttrDoNotUseUserCommandKeys,
+ &(mbPtr->menuRef));
+ if (err != noErr) {
+ return 1;
+ }
+ cfStr = CFStringCreateWithCString(NULL, Tk_PathName(mbPtr->info.tkwin),
+ kCFStringEncodingUTF8);
+ if (!cfStr) {
+ TkMacOSXDbgMsg("CFStringCreateWithCString failed");
+ return 1;
+ }
+ err = ChkErr(SetMenuTitleWithCFString, mbPtr->menuRef, cfStr);
+ CFRelease(cfStr);
+ if (err != noErr) {
+ return 1;
+ }
+ cfStr = CFStringCreateWithCString(NULL,
+ (char*) mbPtr->titleParams.title, kCFStringEncodingUTF8);
+ AppendMenuItemText(mbPtr->menuRef, "\px");
+ if (cfStr) {
+ SetMenuItemTextWithCFString(mbPtr->menuRef, 1, cfStr);
+ CFRelease(cfStr);
+ }
+ ChkErr(SetControlData, mbPtr->control, kControlNoPart,
+ kControlPopupButtonMenuRefTag, sizeof(mbPtr->menuRef),
+ &mbPtr->menuRef);
+ SetControlMinimum(mbPtr->control, 1);
+ SetControlMaximum(mbPtr->control, 1);
+ SetControlValue(mbPtr->control, 1);
+ }
+ mbPtr->flags |= FIRST_DRAW;
+ if (IsWindowActive(mbPtr->windowRef)) {
+ mbPtr->flags |= ACTIVE;
+ }
+ 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.
+ *
+ *--------------------------------------------------------------
+ */
+OSStatus
+SetUserPaneDrawProc(
+ ControlRef control,
+ ControlUserPaneDrawProcPtr upp)
+{
+ ControlUserPaneDrawUPP 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.
+ *
+ *--------------------------------------------------------------
+ */
+
+OSStatus
+SetUserPaneSetUpSpecialBackgroundProc(
+ ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp)
+{
+ ControlUserPaneBackgroundUPP 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 =
+ (MacMenuButton *)(intptr_t)GetControlReference(control);
+ CGrafPtr port;
+
+ GetPort(&port);
+ GetControlBounds(control,&contrlRect);
+ TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
+ 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 =
+ (MacMenuButton *)(intptr_t)GetControlReference(control);
+
+ if (info->colorDevice) {
+ CGrafPtr port;
+
+ GetPort(&port);
+ TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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);
+ mbPtr->userPaneBackground = xcolor->pixel;
+
+ return false;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * MenuButtonEventProc --
+ *
+ * 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
+MenuButtonEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
+{
+ TkMenuButton *buttonPtr = (TkMenuButton *) clientData;
+ MacMenuButton *mbPtr = (MacMenuButton *) clientData;
+
+ if (eventPtr->type == ActivateNotify
+ || eventPtr->type == DeactivateNotify) {
+ if ((buttonPtr->tkwin == NULL) || (!Tk_IsMapped(buttonPtr->tkwin))) {
+ return;
+ }
+ if (eventPtr->type == ActivateNotify) {
+ mbPtr->flags |= ACTIVE;
+ } else {
+ mbPtr->flags &= ~ACTIVE;
+ }
+ if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) buttonPtr);
+ buttonPtr->flags |= REDRAW_PENDING;
+ }
+ }
+}
diff --git a/carbon/tkMacOSXMenus.c b/carbon/tkMacOSXMenus.c
new file mode 100644
index 0000000..8509f8c
--- /dev/null
+++ b/carbon/tkMacOSXMenus.c
@@ -0,0 +1,406 @@
+/*
+ * tkMacOSXMenus.c --
+ *
+ * These calls set up and manage the menubar for the Macintosh version of
+ * Tk.
+ *
+ * Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright (c) 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+
+#define kAppleMenu 256
+#define kAppleAboutItem 1
+#define kFileMenu 2
+#define kEditMenu 3
+
+#define kSourceItem 1
+#define kDemoItem 2
+#define kCloseItem 3
+
+#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 = NULL; /* Standard menu interpreter. */
+static EventHandlerRef menuEventHandlerRef = NULL;
+
+static void GenerateEditEvent(int flag);
+static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
+static OSStatus MenuEventHandlerProc(EventHandlerCallRef callRef,
+ EventRef event, void *userData);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetWidgetDemoPath --
+ *
+ * Get path to the widget demo.
+ *
+ * Results:
+ * pathObj with ref count 0.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+GetWidgetDemoPath(
+ Tcl_Interp *interp)
+{
+ Tcl_Obj *libpath, *result = NULL;
+
+ libpath = Tcl_GetVar2Ex(gInterp, "tk_library", NULL, TCL_GLOBAL_ONLY);
+ if (libpath) {
+ Tcl_Obj *demo[2] = { Tcl_NewStringObj("demos", 5),
+ Tcl_NewStringObj("widget", 6) };
+
+ Tcl_IncrRefCount(libpath);
+ result = Tcl_FSJoinToPath(libpath, 2, demo);
+ Tcl_DecrRefCount(libpath);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXHandleMenuSelect --
+ *
+ * Handles events that occur in the Menu bar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXHandleMenuSelect(
+ MenuID theMenu,
+ MenuItemIndex theItem,
+ int optionKeyPressed)
+{
+ Tk_Window tkwin;
+ Window window;
+ TkDisplay *dispPtr;
+ Tcl_CmdInfo dummy;
+ int code;
+
+ if (theItem == 0) {
+ TkMacOSXClearMenubarActive();
+ return;
+ }
+
+ switch (theMenu) {
+ case kAppleMenu:
+ switch (theItem) {
+ case kAppleAboutItem:
+ if (optionKeyPressed || gInterp == NULL ||
+ Tcl_GetCommandInfo(gInterp, "tkAboutDialog", &dummy) == 0) {
+ TkAboutDlg();
+ } else {
+ code = Tcl_EvalEx(gInterp, "tkAboutDialog", -1,
+ TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(gInterp, code);
+ }
+ Tcl_ResetResult(gInterp);
+ }
+ break;
+ }
+ break;
+ case kFileMenu:
+ switch (theItem) {
+ case kSourceItem:
+ if (gInterp) {
+ if (Tcl_EvalEx(gInterp, "tk_getOpenFile -filetypes {"
+ "{{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}",
+ -1, TCL_EVAL_GLOBAL) == TCL_OK) {
+ Tcl_Obj *path = Tcl_GetObjResult(gInterp);
+ int len;
+
+ Tcl_GetStringFromObj(path, &len);
+ if (len) {
+ Tcl_IncrRefCount(path);
+ code = Tcl_FSEvalFile(gInterp, path);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(gInterp, code);
+ }
+ Tcl_DecrRefCount(path);
+ }
+ }
+ Tcl_ResetResult(gInterp);
+ }
+ break;
+ case kDemoItem:
+ if (gInterp) {
+ Tcl_Obj *path = GetWidgetDemoPath(gInterp);
+
+ if (path) {
+ Tcl_IncrRefCount(path);
+ code = Tcl_FSEvalFile(gInterp, path);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(gInterp, code);
+ }
+ Tcl_DecrRefCount(path);
+ Tcl_ResetResult(gInterp);
+ }
+ }
+ break;
+ case kCloseItem:
+ /* Send close event */
+ window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ TkGenWMDestroyEvent(tkwin);
+ break;
+ }
+ break;
+ case kEditMenu:
+ /*
+ * This implementation just send the keysyms Tk thinks are associated
+ * with function keys that do Cut, Copy & Paste on a Sun keyboard.
+ */
+
+ GenerateEditEvent(theItem);
+ break;
+ default:
+ TkMacOSXDispatchMenuEvent(theMenu, theItem);
+ break;
+ }
+
+ /*
+ * Finally we unhighlight the menu.
+ */
+
+ HiliteMenu(0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MenuEventHandlerProc --
+ *
+ * One-time handler of kEventMenuEnableItems for the edit menu.
+ *
+ * Results:
+ * OS status code.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSStatus
+MenuEventHandlerProc(
+ EventHandlerCallRef callRef,
+ EventRef event,
+ void *userData)
+{
+ OSStatus result = eventNotHandledErr, err;
+ int menuContext;
+
+ err = ChkErr(GetEventParameter, event, kEventParamMenuContext, typeUInt32,
+ NULL, sizeof(menuContext), NULL, &menuContext);
+ if (err == noErr && (menuContext & kMenuContextMenuBarTracking)) {
+ if (gInterp) {
+ Tcl_Obj *path = GetWidgetDemoPath(gInterp);
+
+ if (path) {
+ Tcl_IncrRefCount(path);
+ if (Tcl_FSAccess(path, R_OK) == 0) {
+ EnableMenuItem(tkFileMenu, kDemoItem);
+ }
+ Tcl_DecrRefCount(path);
+ }
+ }
+ ChkErr(RemoveEventHandler, menuEventHandlerRef);
+ menuEventHandlerRef = NULL;
+ result = noErr;
+ }
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitMenus --
+ *
+ * This procedure initializes the Macintosh menu bar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitMenus(
+ Tcl_Interp *interp)
+{
+ OSStatus err;
+ EventHandlerUPP menuEventHandlerUPP;
+ const EventTypeSpec menuEventTypes[] = {
+ {kEventClassMenu, kEventMenuEnableItems},
+ };
+
+ gInterp = interp;
+ if (TkMacOSXUseMenuID(kAppleMenu) != TCL_OK) {
+ Tcl_Panic("Menu ID %d is already in use!", kAppleMenu);
+ }
+ err = ChkErr(CreateNewMenu, kAppleMenu, kMenuAttrDoNotUseUserCommandKeys,
+ &tkAppleMenu);
+ if (err != noErr) {
+ Tcl_Panic("CreateNewMenu failed !");
+ }
+ SetMenuTitle(tkAppleMenu, "\p\024");
+ InsertMenu(tkAppleMenu, 0);
+ AppendMenu(tkAppleMenu, "\pAbout Tcl & Tk\xc9");
+ AppendMenu(tkAppleMenu, "\p(-");
+
+ if (TkMacOSXUseMenuID(kFileMenu) != TCL_OK) {
+ Tcl_Panic("Menu ID %d is already in use!", kFileMenu);
+ }
+ err = ChkErr(CreateNewMenu, kFileMenu, kMenuAttrDoNotUseUserCommandKeys,
+ &tkFileMenu);
+ if (err != noErr) {
+ Tcl_Panic("CreateNewMenu failed !");
+ }
+ SetMenuTitle(tkFileMenu, "\pFile");
+ InsertMenu(tkFileMenu, 0);
+ InsertMenuItem(tkFileMenu, "\pSource\xc9", kSourceItem - 1);
+ InsertMenuItem(tkFileMenu, "\pRun Widget Demo", kDemoItem - 1);
+ InsertMenuItem(tkFileMenu, "\pClose/W", kCloseItem - 1);
+ DisableMenuItem(tkFileMenu, kDemoItem);
+ menuEventHandlerUPP = NewEventHandlerUPP(MenuEventHandlerProc);
+ ChkErr(InstallEventHandler, GetMenuEventTarget(tkFileMenu),
+ menuEventHandlerUPP, GetEventTypeCount(menuEventTypes),
+ menuEventTypes, NULL, &menuEventHandlerRef);
+ DisposeEventHandlerUPP(menuEventHandlerUPP);
+
+ if (TkMacOSXUseMenuID(kEditMenu) != TCL_OK) {
+ Tcl_Panic("Menu ID %d is already in use!", kEditMenu);
+ }
+ err = ChkErr(CreateNewMenu, kEditMenu, kMenuAttrDoNotUseUserCommandKeys,
+ &tkEditMenu);
+ if (err != noErr) {
+ Tcl_Panic("CreateNewMenu failed !");
+ }
+ SetMenuTitle(tkEditMenu, "\pEdit");
+ InsertMenu(tkEditMenu, 0);
+ AppendMenu(tkEditMenu, "\pCut/X");
+ AppendMenu(tkEditMenu, "\pCopy/C");
+ AppendMenu(tkEditMenu, "\pPaste/V");
+ AppendMenu(tkEditMenu, "\pClear");
+ if (TkMacOSXUseMenuID(kHMHelpMenuID) != TCL_OK) {
+ Tcl_Panic("Help menu ID %s is already in use!", kHMHelpMenuID);
+ }
+
+ /*
+ * Workaround a Carbon bug with kHICommandPreferences: the first call to
+ * IsMenuKeyEvent returns false for the preferences menu item key shorcut
+ * event (even if the corresponding menu item is dynamically enabled by a
+ * kEventCommandUpdateStatus handler), unless the kHICommandPreferences
+ * menu item has previously been enabled manually. [Bug 1481503]
+ */
+
+ EnableMenuCommand(NULL, kHICommandPreferences);
+
+ DrawMenuBar();
+ 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;
+ int x, y;
+ Tk_Window tkwin;
+ Window window;
+ TkDisplay *dispPtr;
+
+ window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ if (tkwin == NULL) {
+ return;
+ }
+
+ bzero(&event, sizeof(XVirtualEvent));
+ 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();
+
+ XQueryPointer(NULL, None, NULL, NULL,
+ &event.x_root, &event.y_root, &x, &y, &event.state);
+ Tk_TopCoordsToWindow(tkwin, x, y, &event.x, &event.y);
+ 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);
+}
+
+/*
+ * Local Variables:
+ * fill-column: 78
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/carbon/tkMacOSXMouseEvent.c b/carbon/tkMacOSXMouseEvent.c
new file mode 100644
index 0000000..697e00d
--- /dev/null
+++ b/carbon/tkMacOSXMouseEvent.c
@@ -0,0 +1,1190 @@
+/*
+ * tkMacOSXMouseEvent.c --
+ *
+ * This file implements functions that decode & handle mouse events on
+ * MacOS X.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXPrivate.h"
+#include "tkMacOSXWm.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+typedef struct {
+ WindowRef whichWin;
+ WindowRef activeNonFloating;
+ WindowPartCode windowPart;
+ unsigned int state;
+ long delta;
+ Window window;
+ Point global;
+ Point local;
+} 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(WindowRef wRef, int isFrontProcess,
+ int frontWindowOnly);
+static int GeneratePollingEvents(MouseEventData *medPtr);
+static int GenerateMouseWheelEvent(MouseEventData *medPtr);
+static int GenerateButtonEvent(MouseEventData *medPtr);
+static int GenerateToolbarButtonEvent(MouseEventData *medPtr);
+static int HandleWindowTitlebarMouseDown(MouseEventData *medPtr,
+ Tk_Window tkwin);
+static unsigned int ButtonModifiers2State(UInt32 buttonState,
+ UInt32 keyModifiers);
+static Tk_Window GetGrabWindowForWindow(Tk_Window tkwin);
+static int TkMacOSXGetEatButtonUp(void);
+static 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessMouseEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ Tk_Window tkwin;
+ Point where, where2;
+ int result;
+ TkDisplay *dispPtr;
+ OSStatus err;
+ MouseEventData mouseEventData, *medPtr = &mouseEventData;
+ int isFrontProcess;
+
+ switch (eventPtr->eKind) {
+ case kEventMouseDown:
+ case kEventMouseUp:
+ case kEventMouseMoved:
+ case kEventMouseDragged:
+ case kEventMouseWheelMoved:
+ break;
+ default:
+ return false;
+ }
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMouseLocation, typeQDPoint, NULL, sizeof(where), NULL,
+ &where);
+ if (err != noErr) {
+ GetGlobalMouse(&where);
+ }
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef, kEventParamWindowRef,
+ typeWindowRef, NULL, sizeof(WindowRef), NULL, &medPtr->whichWin);
+ if (err == noErr) {
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamWindowPartCode, typeWindowPartCode, NULL,
+ sizeof(WindowPartCode), NULL, &medPtr->windowPart);
+ }
+ if (err != noErr) {
+ medPtr->windowPart = FindWindow(where, &medPtr->whichWin);
+ }
+ medPtr->window = TkMacOSXGetXWindow(medPtr->whichWin);
+ if (medPtr->whichWin != NULL && medPtr->window == None) {
+ return false;
+ }
+ if (eventPtr->eKind == kEventMouseDown) {
+ if (IsWindowActive(medPtr->whichWin) && IsWindowPathSelectEvent(
+ medPtr->whichWin, eventPtr->eventRef)) {
+ ChkErr(WindowPathSelect, medPtr->whichWin, NULL, NULL);
+ return false;
+ }
+ if (medPtr->windowPart == inProxyIcon) {
+ TkMacOSXTrackingLoop(1);
+ err = ChkErr(TrackWindowProxyDrag, medPtr->whichWin, where);
+ TkMacOSXTrackingLoop(0);
+ if (err == errUserWantsToDragWindow) {
+ medPtr->windowPart = inDrag;
+ } else {
+ return false;
+ }
+ }
+ }
+ isFrontProcess = Tk_MacOSXIsAppInFront();
+ if (isFrontProcess) {
+ medPtr->state = ButtonModifiers2State(GetCurrentEventButtonState(),
+ GetCurrentEventKeyModifiers());
+ } else {
+ medPtr->state = ButtonModifiers2State(GetCurrentButtonState(),
+ GetCurrentKeyModifiers());
+ }
+ medPtr->global = where;
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamWindowMouseLocation, typeQDPoint, NULL,
+ sizeof(Point), NULL, &medPtr->local);
+ if (err == noErr) {
+ if (medPtr->whichWin) {
+ Rect widths;
+
+ GetWindowStructureWidths(medPtr->whichWin, &widths);
+ medPtr->local.h -= widths.left;
+ medPtr->local.v -= widths.top;
+ }
+ } else {
+ medPtr->local = where;
+ if (medPtr->whichWin) {
+ QDGlobalToLocalPoint(GetWindowPort(medPtr->whichWin),
+ &medPtr->local);
+ }
+ }
+ medPtr->activeNonFloating = ActiveNonFloatingWindow();
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
+
+ if (eventPtr->eKind != kEventMouseDown) {
+ int res = false;
+
+ switch (eventPtr->eKind) {
+ case kEventMouseUp:
+ /*
+ * 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 (TkMacOSXGetEatButtonUp()) {
+ TkMacOSXSetEatButtonUp(false);
+ } else {
+ res = GenerateButtonEvent(medPtr);
+ }
+ break;
+ case kEventMouseWheelMoved:
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMouseWheelDelta, typeLongInteger, NULL,
+ sizeof(long), NULL, &medPtr->delta);
+ if (err != noErr ) {
+ statusPtr->err = 1;
+ } else {
+ EventMouseWheelAxis axis;
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamMouseWheelAxis, typeMouseWheelAxis, NULL,
+ sizeof(EventMouseWheelAxis), NULL, &axis);
+ if (err == noErr && axis == kEventMouseWheelAxisX) {
+ medPtr->state |= ShiftMask;
+ }
+ res = GenerateMouseWheelEvent(medPtr);
+ }
+ break;
+ case kEventMouseMoved:
+ case kEventMouseDragged:
+ res = GeneratePollingEvents(medPtr);
+ break;
+ default:
+ Tcl_Panic("Unknown mouse event !");
+ }
+ if (res) {
+ statusPtr->stopProcessing = 1;
+ }
+ return res;
+ }
+
+ TkMacOSXSetEatButtonUp(false);
+ if (!medPtr->whichWin) {
+ return false;
+ }
+
+ /*
+ * We got a mouse down in a window, so 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
+ || !isFrontProcess)) {
+ int frontWindowOnly = 1;
+ int cmdDragGrow = ((medPtr->windowPart == inDrag ||
+ medPtr->windowPart == inGrow) && medPtr->state & Mod1Mask);
+
+ if (!cmdDragGrow) {
+ Tk_Window grabWin = GetGrabWindowForWindow(tkwin);
+
+ frontWindowOnly = !grabWin;
+ if (grabWin && grabWin != tkwin) {
+ TkMacOSXSetEatButtonUp(true);
+ BringWindowForward(TkMacOSXDrawableWindow(
+ ((TkWindow *) grabWin)->window), isFrontProcess,
+ frontWindowOnly);
+ return false;
+ }
+ }
+
+ /*
+ * Clicks in the titlebar widgets are handled without bringing the
+ * window forward.
+ */
+
+ result = HandleWindowTitlebarMouseDown(medPtr, tkwin);
+ if (result != -1) {
+ statusPtr->stopProcessing = 1;
+ return result;
+ }
+
+ /*
+ * Only windows with the kWindowNoActivatesAttribute can receive mouse
+ * events in the background.
+ */
+
+ if (!(((TkWindow *)tkwin)->wmInfoPtr->attributes &
+ kWindowNoActivatesAttribute)) {
+ /*
+ * Allow background window dragging & growing with Command down.
+ */
+
+ if (!cmdDragGrow) {
+ TkMacOSXSetEatButtonUp(true);
+ BringWindowForward(medPtr->whichWin, isFrontProcess,
+ frontWindowOnly);
+ }
+
+ /*
+ * Allow dragging & growing of windows that were/are in the
+ * background.
+ */
+
+ if (!(medPtr->windowPart == inDrag ||
+ medPtr->windowPart == inGrow)) {
+ return false;
+ }
+ }
+ } else {
+ result = HandleWindowTitlebarMouseDown(medPtr, tkwin);
+ if (result != -1) {
+ statusPtr->stopProcessing = 1;
+ return result;
+ }
+ }
+
+ switch (medPtr->windowPart) {
+ case inDrag: {
+ WindowAttributes attributes;
+
+ GetWindowAttributes(medPtr->whichWin, &attributes);
+ if (!(attributes & kWindowAsyncDragAttribute)) {
+ TkMacOSXTrackingLoop(1);
+ DragWindow(medPtr->whichWin, where, NULL);
+ TkMacOSXTrackingLoop(0);
+ where2.h = where2.v = 0;
+ QDLocalToGlobalPoint(GetWindowPort(medPtr->whichWin), &where2);
+ return (EqualPt(where, where2)) ? false : true;
+ }
+ 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!
+ */
+
+ XPoint p = {where.h, where.v};
+ if (TkMacOSXGrowToplevel(medPtr->whichWin, p) == true) {
+ statusPtr->stopProcessing = 1;
+ return true;
+ }
+ }
+ case inContent:
+ return GenerateButtonEvent(medPtr);
+ }
+ return false;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleWindowTitlebarMouseDown --
+ *
+ * Handle clicks in window titlebar.
+ *
+ * Results:
+ * 1 if event was handled, 0 if event was not handled, -1 if MouseDown
+ * was not in window titlebar.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+HandleWindowTitlebarMouseDown(
+ MouseEventData *medPtr,
+ Tk_Window tkwin)
+{
+ int result = INT_MAX;
+
+ switch (medPtr->windowPart) {
+ case inGoAway:
+ case inCollapseBox:
+ case inZoomIn:
+ case inZoomOut:
+ case inToolbarButton:
+ if (!IsWindowActive(medPtr->whichWin)) {
+ WindowRef frontWindow = FrontNonFloatingWindow();
+ WindowModality frontWindowModality = kWindowModalityNone;
+
+ if (frontWindow && frontWindow != medPtr->whichWin) {
+ ChkErr(GetWindowModality, frontWindow,
+ &frontWindowModality, NULL);
+ }
+ if (frontWindowModality == kWindowModalityAppModal) {
+ result = 0;
+ }
+ }
+ break;
+ default:
+ result = -1;
+ break;
+ }
+
+ if (result == INT_MAX) {
+ result = 0;
+ TkMacOSXTrackingLoop(1);
+ switch (medPtr->windowPart) {
+ case inGoAway:
+ if (TrackGoAway(medPtr->whichWin, medPtr->global) && tkwin) {
+ TkGenWMDestroyEvent(tkwin);
+ result = 1;
+ }
+ break;
+ case inCollapseBox:
+ if (TrackBox(medPtr->whichWin, medPtr->global,
+ medPtr->windowPart) && tkwin) {
+ TkpWmSetState((TkWindow *) tkwin, IconicState);
+ result = 1;
+ }
+ break;
+ case inZoomIn:
+ case inZoomOut:
+ if (TrackBox(medPtr->whichWin, medPtr->global,
+ medPtr->windowPart)) {
+ result = TkMacOSXZoomToplevel(medPtr->whichWin,
+ medPtr->windowPart);
+ }
+ break;
+ case inToolbarButton:
+ if (TrackBox(medPtr->whichWin, medPtr->global,
+ medPtr->windowPart)) {
+ result = GenerateToolbarButtonEvent(medPtr);
+ }
+ break;
+ }
+ TkMacOSXTrackingLoop(0);
+ }
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ int local_x, local_y;
+ TkDisplay *dispPtr;
+
+ grabWin = TkMacOSXGetCapture();
+
+ if ((!TkpIsWindowFloating(medPtr->whichWin)
+ && (medPtr->activeNonFloating != medPtr->whichWin))) {
+ /*
+ * If the window for this event is not floating, and is not the active
+ * non-floating window, don't generate polling events. We don't send
+ * events to backgrounded windows. So either send it to the grabWin,
+ * or NULL if there is no grabWin.
+ */
+
+ tkwin = grabWin;
+ } else {
+ /*
+ * First check whether the toplevel containing this mouse event is the
+ * grab window. If not, then send the event to the grab window.
+ * Otherwise, set tkWin to the subwindow which most closely contains
+ * the mouse event.
+ */
+
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
+ if ((rootwin == NULL)
+ || ((grabWin != NULL) && (rootwin != grabWin))) {
+ tkwin = grabWin;
+ } 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.
+ */
+
+ Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v,
+ medPtr->state);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BringWindowForward --
+ *
+ * Bring this background window to the front.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window is brought forward.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+BringWindowForward(
+ WindowRef wRef,
+ int isFrontProcess,
+ int frontWindowOnly)
+{
+ if (wRef && !TkpIsWindowFloating(wRef) && IsValidWindowPtr(wRef)) {
+ WindowRef frontWindow = FrontNonFloatingWindow();
+ WindowModality frontWindowModality = kWindowModalityNone;
+
+ if (frontWindow && frontWindow != wRef) {
+ ChkErr(GetWindowModality, frontWindow, &frontWindowModality, NULL);
+ }
+ if (frontWindowModality != kWindowModalityAppModal) {
+ Window window = TkMacOSXGetXWindow(wRef);
+
+ if (window != None) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ TkWindow *winPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, window);
+
+ if (winPtr && winPtr->wmInfoPtr &&
+ winPtr->wmInfoPtr->master != None) {
+ TkWindow *masterWinPtr = (TkWindow *)Tk_IdToWindow(
+ dispPtr->display, winPtr->wmInfoPtr->master);
+
+ if (masterWinPtr && masterWinPtr->window != None &&
+ TkMacOSXHostToplevelExists(masterWinPtr)) {
+ WindowRef masterMacWin =
+ TkMacOSXDrawableWindow(masterWinPtr->window);
+
+ if (masterMacWin) {
+ BringToFront(masterMacWin);
+ }
+ }
+ }
+ }
+ SelectWindow(wRef);
+ } else {
+ frontWindowOnly = 0;
+ }
+ }
+ if (!isFrontProcess) {
+ ProcessSerialNumber ourPsn = {0, kCurrentProcess};
+
+ ChkErr(SetFrontProcessWithOptions, &ourPsn,
+ frontWindowOnly ? kSetFrontProcessFrontWindowOnly : 0);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXBringWindowForward --
+ *
+ * Bring this window to the front in response to a mouse click. If a grab
+ * is in effect, bring the grab window to the front instead.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window is brought forward.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXBringWindowForward(
+ WindowRef wRef)
+{
+ TkDisplay *dispPtr = TkGetDisplayList();
+ Tk_Window tkwin =
+ Tk_IdToWindow(dispPtr->display, TkMacOSXGetXWindow(wRef));
+ Tk_Window grabWin = GetGrabWindowForWindow(tkwin);
+
+ if (grabWin && grabWin != tkwin) {
+ wRef = TkMacOSXDrawableWindow(((TkWindow *) grabWin)->window);
+ }
+ TkMacOSXSetEatButtonUp(true);
+ BringWindowForward(wRef, Tk_MacOSXIsAppInFront(), !grabWin);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetGrabWindowForWindow --
+ *
+ * Get the grab window for the given window, if any.
+ *
+ * Results:
+ * Grab Tk_Window or None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tk_Window
+GetGrabWindowForWindow(
+ Tk_Window tkwin)
+{
+ Tk_Window grabWin = TkMacOSXGetCapture();
+
+ if (!grabWin) {
+ int grabState = TkGrabState((TkWindow *) tkwin);
+
+ if (grabState != TK_GRAB_NONE && grabState != TK_GRAB_IN_TREE) {
+ grabWin = (Tk_Window) (((TkWindow *) tkwin)->dispPtr->grabWinPtr);
+ }
+ }
+
+ return grabWin;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateMouseWheelEvent --
+ *
+ * Generates a "MouseWheel" Tk event.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Places a mousewheel event on the event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GenerateMouseWheelEvent(
+ MouseEventData *medPtr)
+{
+ Tk_Window tkwin, rootwin;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+ XEvent xEvent;
+
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
+ if (rootwin == NULL) {
+ tkwin = NULL;
+ } else {
+ tkwin = Tk_TopCoordsToWindow(rootwin, medPtr->local.h,
+ medPtr->local.v, &xEvent.xbutton.x, &xEvent.xbutton.y);
+ }
+
+ /*
+ * The following call will generate the appropiate X events and adjust any
+ * state that Tk must remember.
+ */
+
+ if (!tkwin) {
+ tkwin = TkMacOSXGetCapture();
+ }
+ if (!tkwin) {
+ return false;
+ }
+
+ winPtr = (TkWindow *) tkwin;
+ xEvent.type = MouseWheelEvent;
+ xEvent.xkey.keycode = medPtr->delta;
+ xEvent.xbutton.x_root = medPtr->global.h;
+ xEvent.xbutton.y_root = medPtr->global.v;
+ xEvent.xbutton.state = medPtr->state;
+ 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:
+ * Return the flag indicating if we need to eat the next mouse up event.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXGetEatButtonUp(void)
+{
+ 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXKeyModifiers --
+ *
+ * Returns the current state of the modifier keys.
+ *
+ * Results:
+ * An OS Modifier state.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+EventModifiers
+TkMacOSXModifierState(void)
+{
+ UInt32 keyModifiers;
+ int isFrontProcess = (GetCurrentEvent() && Tk_MacOSXIsAppInFront());
+
+ keyModifiers = isFrontProcess ? GetCurrentEventKeyModifiers() :
+ GetCurrentKeyModifiers();
+
+ return (EventModifiers) (keyModifiers & USHRT_MAX);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+unsigned int
+TkMacOSXButtonKeyState(void)
+{
+ UInt32 buttonState = 0, keyModifiers;
+ int isFrontProcess = (GetCurrentEvent() && Tk_MacOSXIsAppInFront());
+
+ if (!TkMacOSXGetEatButtonUp()) {
+ buttonState = isFrontProcess ? GetCurrentEventButtonState() :
+ GetCurrentButtonState();
+ }
+ keyModifiers = isFrontProcess ? GetCurrentEventKeyModifiers() :
+ GetCurrentKeyModifiers();
+
+ return ButtonModifiers2State(buttonState, keyModifiers);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ButtonModifiers2State --
+ *
+ * Converts Carbon mouse button state and modifier values into a Tk
+ * button/modifier state.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static unsigned int
+ButtonModifiers2State(
+ UInt32 buttonState,
+ UInt32 keyModifiers)
+{
+ unsigned int state;
+
+ /*
+ * Tk supports at most 5 buttons.
+ */
+
+ state = (buttonState & ((1<<5) - 1)) << 8;
+
+ if (keyModifiers & alphaLock) {
+ state |= LockMask;
+ }
+ if (keyModifiers & shiftKey) {
+ state |= ShiftMask;
+ }
+ if (keyModifiers & controlKey) {
+ state |= ControlMask;
+ }
+ if (keyModifiers & cmdKey) {
+ state |= Mod1Mask; /* command key */
+ }
+ if (keyModifiers & optionKey) {
+ state |= Mod2Mask; /* option key */
+ }
+ if (keyModifiers & kEventKeyModifierNumLockMask) {
+ state |= Mod3Mask;
+ }
+ if (keyModifiers & kEventKeyModifierFnMask) {
+ state |= Mod4Mask;
+ }
+
+ 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)
+{
+ int getGlobal = (root_x_return && root_y_return);
+ int getLocal = (win_x_return && win_y_return);
+
+ if (getGlobal || getLocal) {
+ Point where, local;
+ OSStatus err = noErr;
+ int gotMouseLoc = 0;
+ EventRef ev = GetCurrentEvent();
+
+ if (ev && getLocal) {
+ err = ChkErr(GetEventParameter, ev, kEventParamWindowMouseLocation,
+ typeQDPoint, NULL, sizeof(Point), NULL, &local);
+ gotMouseLoc = (err == noErr);
+ }
+ if (getGlobal || !gotMouseLoc) {
+ if (ev) {
+ err = ChkErr(GetEventParameter, ev, kEventParamMouseLocation,
+ typeQDPoint, NULL, sizeof(Point), NULL, &where);
+ }
+ if (!ev || err != noErr) {
+ GetGlobalMouse(&where);
+ }
+ }
+ if (getLocal) {
+ WindowRef whichWin;
+
+ if (ev) {
+ err = ChkErr(GetEventParameter, ev, kEventParamWindowRef,
+ typeWindowRef, NULL, sizeof(WindowRef), NULL,
+ &whichWin);
+ }
+ if (!ev || err != noErr) {
+ FindWindow(where, &whichWin);
+ }
+ if (gotMouseLoc) {
+ if (whichWin) {
+ Rect widths;
+
+ ChkErr(GetWindowStructureWidths, whichWin, &widths);
+ local.h -= widths.left;
+ local.v -= widths.top;
+ }
+ } else {
+ local = where;
+ if (whichWin) {
+ QDGlobalToLocalPoint(GetWindowPort(whichWin), &local);
+ }
+ }
+ }
+ if (getGlobal) {
+ *root_x_return = where.h;
+ *root_y_return = where.v;
+ }
+ if (getLocal) {
+ *win_x_return = local.h;
+ *win_y_return = local.v;
+ }
+ }
+ if (mask_return) {
+ *mask_return = TkMacOSXButtonKeyState();
+ }
+ return True;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGenerateButtonEventForXPointer --
+ *
+ * This procedure generates an X button event for the current pointer
+ * state as reported by XQueryPointer().
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkGenerateButtonEventForXPointer(
+ Window window) /* X Window containing button event. */
+{
+ MouseEventData med;
+ int global_x, global_y, local_x, local_y;
+
+ bzero(&med, sizeof(MouseEventData));
+ XQueryPointer(NULL, None, NULL, NULL, &global_x, &global_y,
+ &local_x, &local_y, &med.state);
+ med.global.h = global_x;
+ med.global.v = global_y;
+ med.local.h = local_x;
+ med.local.v = local_y;
+ med.window = window;
+ med.activeNonFloating = ActiveNonFloatingWindow();
+
+ return GenerateButtonEvent(&med);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+{
+ MouseEventData med;
+
+ bzero(&med, sizeof(MouseEventData));
+ med.state = state;
+ med.window = window;
+ med.global.h = x;
+ med.global.v = y;
+ FindWindow(med.global, &med.whichWin);
+ med.activeNonFloating = ActiveNonFloatingWindow();
+ med.local = med.global;
+ QDGlobalToLocalPoint(GetWindowPort(med.whichWin), &med.local);
+
+ return GenerateButtonEvent(&med);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateButtonEvent --
+ *
+ * Generate an X button event from a MouseEventData structure. 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GenerateButtonEvent(
+ MouseEventData *medPtr)
+{
+ Tk_Window tkwin;
+ int dummy;
+ TkDisplay *dispPtr;
+
+#if UNUSED
+ /*
+ * 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.
+ */
+
+ if ((medPtr->activeNonFloating == NULL)
+ || ((!(TkpIsWindowFloating(medPtr->whichWin))
+ && (medPtr->activeNonFloating != medPtr->whichWin))
+ && TkMacOSXGetCapture() == NULL)) {
+ return false;
+ }
+#endif
+
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
+
+ if (tkwin != NULL) {
+ tkwin = Tk_TopCoordsToWindow(tkwin, medPtr->local.h, medPtr->local.v,
+ &dummy, &dummy);
+ }
+
+ Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v, medPtr->state);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateToolbarButtonEvent --
+ *
+ * Generates a "ToolbarButton" virtual event. This can be used to manage
+ * disappearing toolbars.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Places a virtual event on the event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GenerateToolbarButtonEvent(
+ MouseEventData *medPtr)
+{
+ Tk_Window rootwin, tkwin = NULL;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+ XVirtualEvent event;
+
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
+ if (rootwin) {
+ tkwin = Tk_TopCoordsToWindow(rootwin,
+ medPtr->local.h, medPtr->local.v, &event.x, &event.y);
+ }
+ if (!tkwin) {
+ return true;
+ }
+ winPtr = (TkWindow *) tkwin;
+
+ bzero(&event, sizeof(XVirtualEvent));
+ event.type = VirtualEvent;
+ event.serial = LastKnownRequestProcessed(winPtr->display);
+ event.send_event = false;
+ event.display = winPtr->display;
+ event.event = winPtr->window;
+ event.root = XRootWindow(winPtr->display, 0);
+ event.subwindow = None;
+ event.time = TkpGetMS();
+ event.x_root = medPtr->global.h;
+ event.y_root = medPtr->global.v;
+ event.state = medPtr->state;
+ event.same_screen = true;
+ event.name = Tk_GetUid("ToolbarButton");
+
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+ return true;
+}
+
+void
+TkpWarpPointer(
+ TkDisplay *dispPtr)
+{
+ CGPoint pt;
+ UInt32 buttonState;
+
+ if (dispPtr->warpWindow) {
+ int x, y;
+
+ Tk_GetRootCoords(dispPtr->warpWindow, &x, &y);
+ pt.x = x + dispPtr->warpX;
+ pt.y = y + dispPtr->warpY;
+ } else {
+ pt.x = dispPtr->warpX;
+ pt.y = dispPtr->warpY;
+ }
+
+ /*
+ * Tell the OSX core to generate the events to make it happen. This is
+ * fairly ugly, but means that under most circumstances we'll register all
+ * the events that would normally be generated correctly. If we use
+ * CGWarpMouseCursorPosition instead, strange things happen.
+ */
+
+ buttonState = (GetCurrentEvent() && Tk_MacOSXIsAppInFront())
+ ? GetCurrentEventButtonState() : GetCurrentButtonState();
+
+ CGPostMouseEvent(pt, 1 /* generate motion events */, 5,
+ buttonState&1 ? 1 : 0, buttonState&2 ? 1 : 0,
+ buttonState&4 ? 1 : 0, buttonState&8 ? 1 : 0,
+ buttonState&16 ? 1 : 0);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXNotify.c b/carbon/tkMacOSXNotify.c
new file mode 100644
index 0000000..fdd5afd
--- /dev/null
+++ b/carbon/tkMacOSXNotify.c
@@ -0,0 +1,196 @@
+/*
+ * tkMacOSXNotify.c --
+ *
+ * This file contains the implementation of a tcl event source
+ * for the Carbon event loop.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXEvent.h"
+#include <pthread.h>
+
+/*
+ * The following static indicates whether this module has been initialized
+ * in the current thread.
+ */
+
+typedef struct ThreadSpecificData {
+ int initialized;
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
+
+static void TkMacOSXNotifyExitHandler(ClientData clientData);
+static void CarbonEventsSetupProc(ClientData clientData, int flags);
+static void CarbonEventsCheckProc(ClientData clientData, int flags);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MacOSXSetupTkNotifier --
+ *
+ * This procedure is called during Tk initialization to create
+ * the event source for Carbon events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A new event source is created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_MacOSXSetupTkNotifier(void)
+{
+ ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey,
+ sizeof(ThreadSpecificData));
+
+ if (!tsdPtr->initialized) {
+ /* 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.
+ */
+ GetMainEventQueue();
+
+ tsdPtr->initialized = 1;
+
+ /*
+ * Install Carbon events event source in main event loop thread.
+ */
+
+ if (GetCurrentEventLoop() == GetMainEventLoop()) {
+ if (!pthread_main_np()) {
+ /*
+ * Panic if the Carbon main event loop thread (i.e. the thread
+ * where HIToolbox was first loaded) is not the main
+ * application thread, as Carbon does not support this
+ * properly.
+ */
+
+ Tcl_Panic("Tk_MacOSXSetupTkNotifier: %s",
+ "first [load] of TkAqua has to occur in the main thread!");
+ }
+ Tcl_CreateEventSource(CarbonEventsSetupProc,
+ CarbonEventsCheckProc, GetMainEventQueue());
+ TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXNotifyExitHandler --
+ *
+ * This function is called during finalization to clean up the
+ * TkMacOSXNotify module.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkMacOSXNotifyExitHandler(
+ ClientData clientData) /* Not used. */
+{
+ ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey,
+ sizeof(ThreadSpecificData));
+
+ Tcl_DeleteEventSource(CarbonEventsSetupProc,
+ CarbonEventsCheckProc, GetMainEventQueue());
+ tsdPtr->initialized = 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CarbonEventsSetupProc --
+ *
+ * This procedure implements the setup part of the Carbon Events event
+ * source. It is invoked by Tcl_DoOneEvent before entering the notifier
+ * to check for events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If Carbon events are queued, then the maximum block time will be set
+ * to 0 to ensure that the notifier returns control to Tcl.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+CarbonEventsSetupProc(
+ ClientData clientData,
+ int flags)
+{
+ static Tcl_Time blockTime = { 0, 0 };
+
+ if (!(flags & TCL_WINDOW_EVENTS)) {
+ return;
+ }
+
+ if (GetNumEventsInQueue((EventQueueRef) clientData)) {
+ Tcl_SetMaxBlockTime(&blockTime);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CarbonEventsCheckProc --
+ *
+ * This procedure processes events sitting in the Carbon event queue.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Moves applicable queued Carbon events onto the Tcl event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+CarbonEventsCheckProc(
+ ClientData clientData,
+ int flags)
+{
+ int numFound;
+ OSStatus err = noErr;
+
+ if (!(flags & TCL_WINDOW_EVENTS)) {
+ return;
+ }
+
+ numFound = GetNumEventsInQueue((EventQueueRef) clientData);
+
+ /*
+ * Avoid starving other event sources:
+ */
+
+ if (numFound > 4) {
+ numFound = 4;
+ }
+ while (numFound > 0 && err == noErr) {
+ err = TkMacOSXReceiveAndDispatchEvent();
+ numFound--;
+ }
+}
diff --git a/carbon/tkMacOSXPort.h b/carbon/tkMacOSXPort.h
new file mode 100644
index 0000000..b5bfcde
--- /dev/null
+++ b/carbon/tkMacOSXPort.h
@@ -0,0 +1,187 @@
+/*
+ * 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.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _TKMACPORT
+#define _TKMACPORT
+
+#include <stdio.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <math.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/file.h>
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <sys/stat.h>
+#ifndef _TCL
+# include <tcl.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#include <unistd.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"
+
+/*
+ * The following macro defines the type of the mask arguments to
+ * select:
+ */
+
+#ifndef NO_FD_SET
+# define SELECT_MASK fd_set
+#else
+# ifndef _AIX
+ typedef long fd_mask;
+# endif
+# if defined(_IBMR2)
+# define SELECT_MASK void
+# else
+# define SELECT_MASK int
+# endif
+#endif
+
+/*
+ * The following macro defines the number of fd_masks in an fd_set:
+ */
+
+#ifndef FD_SETSIZE
+# ifdef OPEN_MAX
+# define FD_SETSIZE OPEN_MAX
+# else
+# define FD_SETSIZE 256
+# endif
+#endif
+#if !defined(howmany)
+# define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#ifndef NFDBITS
+# define NFDBITS NBBY*sizeof(fd_mask)
+#endif
+#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
+
+/*
+ * Define "NBBY" (number of bits per byte) if it's not already defined.
+ */
+
+#ifndef NBBY
+# define NBBY 8
+#endif
+
+/*
+ * The following define causes Tk to use its internal keysym hash table
+ */
+
+#define REDO_KEYSYM_LOOKUP
+
+/*
+ * 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 XVisualIDFromVisual(visual) (visual->visualid)
+
+/*
+ * The following functions are not used on the Mac, so we stub them out.
+ */
+
+#define TkpButtonSetDefaults() {}
+#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))
+
+/*
+ * Turn off Tk double-buffering as Aqua windows are already double-buffered.
+ */
+
+#define TK_NO_DOUBLE_BUFFERING 1
+
+/*
+ * Magic pixel code values for system colors.
+ *
+ * NOTE: values must be kept in sync with indices into the
+ * systemColorMap array in tkMacOSXColor.c !
+ */
+
+#define TRANSPARENT_PIXEL 30
+#define HIGHLIGHT_PIXEL 31
+#define HIGHLIGHT_SECONDARY_PIXEL 32
+#define HIGHLIGHT_TEXT_PIXEL 33
+#define HIGHLIGHT_ALTERNATE_PIXEL 34
+#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/carbon/tkMacOSXPrivate.h b/carbon/tkMacOSXPrivate.h
new file mode 100644
index 0000000..72b418e
--- /dev/null
+++ b/carbon/tkMacOSXPrivate.h
@@ -0,0 +1,352 @@
+/*
+ * tkMacOSXPrivate.h --
+ *
+ * Macros and declarations that are purely internal & private to TkAqua.
+ *
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#ifndef _TKMACPRIV
+#define _TKMACPRIV
+
+#ifndef _TKMACINT
+#include "tkMacOSXInt.h"
+#endif
+
+/* Define constants only available on Mac OS X 10.3 or later */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+# define kEventAppAvailableWindowBoundsChanged 110
+# define kEventParamTransactionID 'trns'
+# define kEventParamWindowPartCode 'wpar'
+# define typeWindowPartCode 'wpar'
+# define kMenuAttrDoNotUseUserCommandKeys (1 << 7)
+# define kSimpleWindowClass 18
+# define kWindowDoesNotCycleAttribute (1L << 15)
+# define kWindowAsyncDragAttribute (1L << 23)
+# define kThemeBrushAlternatePrimaryHighlightColor -5
+# define kThemeResizeUpCursor 19
+# define kThemeResizeDownCursor 19
+# define kThemeResizeUpDownCursor 19
+# define kThemePoofCursor 19
+# define kThemeBackgroundMetal 6
+# define kThemeIncDecButtonSmall 21
+# define kThemeIncDecButtonMini 22
+# define kThemeComboBox 16
+# define kThemeMiniSystemFont 109
+# define kAppearancePartUpButton 20
+# define kAppearancePartDownButton 21
+# define kAppearancePartPageUpArea 22
+# define kAppearancePartPageDownArea 23
+# define kAppearancePartIndicator 129
+# define kUIModeAllSuppressed 4
+# define FixedToInt(a) ((short)(((Fixed)(a) + fixed1/2) >> 16))
+# define IntToFixed(a) ((Fixed)(a) << 16)
+#endif
+/* Define constants only available on Mac OS X 10.4 or later */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
+# define kWindowNoTitleBarAttribute (1L << 9)
+# define kWindowMetalNoContentSeparatorAttribute (1L << 11)
+# define kThemeDisclosureTriangle 6
+# define kThemeBrushListViewOddRowBackground 56
+# define kThemeBrushListViewEvenRowBackground 57
+# define kThemeBrushListViewColumnDivider 58
+# define kThemeMetricScrollBarMinThumbHeight 132
+# define kThemeMetricSmallScrollBarMinThumbHeight 134
+# define kThemeScrollBarMedium kThemeMediumScrollBar
+# define kThemeScrollBarSmall kThemeSmallScrollBar
+# ifdef __BIG_ENDIAN__
+# define kCGBitmapByteOrder32Host (4 << 12)
+# else
+# define kCGBitmapByteOrder32Host (2 << 12)
+# endif
+#endif
+/* Define constants only available on Mac OS X 10.5 or later */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+# define kWindowUnifiedTitleAndToolbarAttribute (1L << 7)
+# define kWindowTexturedSquareCornersAttribute (1L << 10)
+#endif
+/* HIToolbox version constants */
+#ifndef kHIToolboxVersionNumber10_3
+# define kHIToolboxVersionNumber10_3 (145)
+#endif
+#ifndef kHIToolboxVersionNumber10_4
+# define kHIToolboxVersionNumber10_4 (219)
+#endif
+#ifndef kHIToolboxVersionNumber10_5
+# define kHIToolboxVersionNumber10_5 (343)
+#endif
+/* Macros for HIToolbox runtime version checking */
+MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
+#define TK_IF_HI_TOOLBOX(vers, ...) \
+ tk_if_mac_os_x_min_10_##vers(tkMacOSXToolboxVersionNumber >= \
+ kHIToolboxVersionNumber10_##vers, 1, __VA_ARGS__)
+#define TK_ELSE_HI_TOOLBOX(vers, ...) \
+ tk_else_mac_os_x_min_10_##vers(__VA_ARGS__)
+/* Macros for Mac OS X API availability checking */
+#define TK_IF_MAC_OS_X_API(vers, symbol, ...) \
+ tk_if_mac_os_x_10_##vers(symbol != NULL, 1, __VA_ARGS__)
+#define TK_ELSE_MAC_OS_X(vers, ...) \
+ tk_else_mac_os_x_10_##vers(__VA_ARGS__)
+#define TK_IF_MAC_OS_X_API_COND(vers, symbol, cond, ...) \
+ tk_if_mac_os_x_10_##vers(symbol != NULL, cond, __VA_ARGS__)
+#define TK_ELSE(...) \
+ } else { __VA_ARGS__
+#define TK_ENDIF \
+ }
+/* Private macros that implement the checking macros above */
+#define tk_if_mac_os_x_yes(chk, cond, ...) \
+ if (cond) { __VA_ARGS__
+#define tk_else_mac_os_x_yes(...) \
+ } else {
+#define tk_if_mac_os_x_chk(chk, cond, ...) \
+ if ((chk) && (cond)) { __VA_ARGS__
+#define tk_else_mac_os_x_chk(...) \
+ } else { __VA_ARGS__
+#define tk_if_mac_os_x_no(chk, cond, ...) \
+ if (0) {
+#define tk_else_mac_os_x_no(...) \
+ } else { __VA_ARGS__
+/* Private mapping macros defined according to Mac OS X version requirements */
+/* 10.3 Panther */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1030
+#define tk_if_mac_os_x_min_10_3 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_min_10_3 tk_else_mac_os_x_yes
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_yes
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#else /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#define tk_if_mac_os_x_min_10_3 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_min_10_3 tk_else_mac_os_x_chk
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_chk
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_no
+#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_no
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+/* 10.4 Tiger */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1040
+#define tk_if_mac_os_x_min_10_4 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_min_10_4 tk_else_mac_os_x_yes
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_yes
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#else /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#define tk_if_mac_os_x_min_10_4 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_min_10_4 tk_else_mac_os_x_chk
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_chk
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
+#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_no
+#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_no
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+/* 10.5 Leopard */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+#define tk_if_mac_os_x_min_10_5 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_min_10_5 tk_else_mac_os_x_yes
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+#define tk_if_mac_os_x_10_5 tk_if_mac_os_x_yes
+#define tk_else_mac_os_x_10_5 tk_else_mac_os_x_yes
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#else /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#define tk_if_mac_os_x_min_10_5 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_min_10_5 tk_else_mac_os_x_chk
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+#define tk_if_mac_os_x_10_5 tk_if_mac_os_x_chk
+#define tk_else_mac_os_x_10_5 tk_else_mac_os_x_chk
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+#define tk_if_mac_os_x_10_5 tk_if_mac_os_x_no
+#define tk_else_mac_os_x_10_5 tk_else_mac_os_x_no
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
+
+/*
+ * Macros for DEBUG_ASSERT_MESSAGE et al from Debugging.h.
+ */
+
+#undef kComponentSignatureString
+#undef COMPONENT_SIGNATURE
+#define kComponentSignatureString "TkMacOSX"
+#define COMPONENT_SIGNATURE 'Tk '
+
+/*
+ * Macros abstracting checks only active in a debug build.
+ */
+
+#ifdef TK_MAC_DEBUG
+/*
+ * Macro to do debug message output.
+ */
+#define TkMacOSXDbgMsg(m, ...) \
+ do { \
+ fprintf(stderr, "%s:%d: %s(): " m "\n", strrchr(__FILE__, '/')+1, \
+ __LINE__, __func__, ##__VA_ARGS__); \
+ } while (0)
+
+/*
+ * Macro to do debug API failure message output.
+ */
+#if !defined(DEBUGLEVEL) || !DEBUGLEVEL
+#define TkMacOSXDbgOSErr(f, err) \
+ do { \
+ TkMacOSXDbgMsg("%s failed: %ld", #f, err); \
+ } while (0)
+#else
+#define TkMacOSXDbgOSErr(f, err) \
+ do { \
+ DEBUG_ASSERT_MESSAGE(kComponentSignatureString, #f " failed:", \
+ __func__, 0, strrchr(__FILE__, '/')+1, __LINE__, err); \
+ } while (0)
+#endif
+
+/*
+ * Macro to do very common check for noErr return from given API and output
+ * debug message in case of failure.
+ */
+#define ChkErr(f, ...) ({ \
+ OSStatus err = f(__VA_ARGS__); \
+ if (err != noErr) { \
+ TkMacOSXDbgOSErr(f, err); \
+ } \
+ err;})
+
+/*
+ * Macro to check emptyness of shared QD tmp region before use in debug builds.
+ */
+#define TkMacOSXCheckTmpQdRgnEmpty() \
+ do { \
+ if (!EmptyRgn(tkMacOSXtmpQdRgn)) { \
+ Tcl_Panic("tkMacOSXtmpQdRgn nonempty"); \
+ } \
+ } while(0)
+#else /* TK_MAC_DEBUG */
+#define TkMacOSXDbgMsg(m, ...)
+#define TkMacOSXDbgOSErr(f, err)
+#define ChkErr(f, ...) ({f(__VA_ARGS__);})
+#define TkMacOSXCheckTmpQdRgnEmpty()
+#endif /* TK_MAC_DEBUG */
+
+/*
+ * Macro abstracting use of TkMacOSXGetNamedSymbol to init named symbols.
+ */
+
+#define TkMacOSXInitNamedSymbol(module, ret, symbol, ...) \
+ static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
+ if (symbol == (void*)(-1L)) { \
+ symbol = TkMacOSXGetNamedSymbol(STRINGIFY(module), \
+ STRINGIFY(_##symbol)); \
+ }
+
+/*
+ * Structure encapsulating current drawing environment.
+ */
+
+typedef struct TkMacOSXDrawingContext {
+ CGContextRef context;
+ CGrafPtr port, savePort;
+ ThemeDrawingState saveState;
+ RgnHandle saveClip;
+ HIShapeRef clipRgn;
+ PixPatHandle penPat;
+ Rect portBounds;
+ Boolean portChanged;
+} TkMacOSXDrawingContext;
+
+/*
+ * Variables internal to TkAqua.
+ */
+
+MODULE_SCOPE RgnHandle tkMacOSXtmpQdRgn;
+MODULE_SCOPE int tkMacOSXUseCGDrawing;
+
+/*
+ * Prototypes for TkMacOSXRegion.c.
+ */
+
+#if 0
+MODULE_SCOPE void TkMacOSXEmtpyRegion(TkRegion r);
+MODULE_SCOPE int TkMacOSXIsEmptyRegion(TkRegion r);
+#endif
+MODULE_SCOPE HIShapeRef TkMacOSXGetNativeRegion(TkRegion r);
+MODULE_SCOPE void TkMacOSXSetWithNativeRegion(TkRegion r,
+ HIShapeRef rgn);
+MODULE_SCOPE void TkMacOSXOffsetRegion(TkRegion r, short dx, short dy);
+MODULE_SCOPE HIShapeRef TkMacOSXHIShapeCreateEmpty(void);
+MODULE_SCOPE HIMutableShapeRef TkMacOSXHIShapeCreateMutableWithRect(
+ const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithShape(
+ HIMutableShapeRef inDestShape,
+ HIShapeRef inSrcShape);
+#if 0
+MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithRect(HIMutableShapeRef inShape,
+ const CGRect *inRect);
+#endif
+MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect(
+ HIMutableShapeRef inShape, const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSHIShapeUnionWithRect(HIMutableShapeRef inShape,
+ const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSHIShapeUnion(HIShapeRef inShape1,
+ HIShapeRef inShape2, HIMutableShapeRef outResult);
+
+/*
+ * Prototypes of TkAqua internal procs.
+ */
+
+MODULE_SCOPE void * TkMacOSXGetNamedSymbol(const char *module,
+ const char *symbol);
+MODULE_SCOPE void TkMacOSXDisplayChanged(Display *display);
+MODULE_SCOPE void TkMacOSXInitScrollbarMetrics(void);
+MODULE_SCOPE int TkMacOSXUseAntialiasedText(Tcl_Interp *interp,
+ int enable);
+MODULE_SCOPE void TkMacOSXInitCarbonEvents(Tcl_Interp *interp);
+MODULE_SCOPE int TkMacOSXInitCGDrawing(Tcl_Interp *interp, int enable,
+ int antiAlias);
+MODULE_SCOPE void TkMacOSXInitKeyboard(Tcl_Interp *interp);
+MODULE_SCOPE int TkMacOSXGenerateFocusEvent(Window window,
+ int activeFlag);
+MODULE_SCOPE int TkMacOSXGenerateParentMenuSelectEvent(MenuRef menu);
+MODULE_SCOPE int TkMacOSXGenerateMenuSelectEvent(MenuRef menu,
+ MenuItemIndex index);
+MODULE_SCOPE void TkMacOSXClearActiveMenu(MenuRef menu);
+MODULE_SCOPE WindowClass TkMacOSXWindowClass(TkWindow *winPtr);
+MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr);
+MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window);
+MODULE_SCOPE EventModifiers TkMacOSXModifierState(void);
+MODULE_SCOPE int TkMacOSXSetupDrawingContext(Drawable d, GC gc,
+ int useCG, TkMacOSXDrawingContext *dcPtr);
+MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
+ TkMacOSXDrawingContext *dcPtr);
+MODULE_SCOPE void TkMacOSXSetColorInPort(unsigned long pixel, int fg,
+ PixPatHandle penPat, CGrafPtr port);
+MODULE_SCOPE void TkMacOSXSetColorInContext(unsigned long pixel,
+ CGContextRef context);
+MODULE_SCOPE int TkMacOSXRunTclEventLoop(void);
+MODULE_SCOPE OSStatus TkMacOSXStartTclEventLoopCarbonTimer(void);
+MODULE_SCOPE OSStatus TkMacOSXStopTclEventLoopCarbonTimer(void);
+MODULE_SCOPE void TkMacOSXTrackingLoop(int tracking);
+MODULE_SCOPE OSStatus TkMacOSXReceiveAndDispatchEvent(void);
+MODULE_SCOPE void TkMacOSXInstallWindowCarbonEventHandler(
+ Tcl_Interp *interp, WindowRef window);
+MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr,
+ WindowRef window, int fullscreen,
+ Tcl_Interp *interp);
+MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr,
+ int active);
+MODULE_SCOPE void TkMacOSXBringWindowForward(WindowRef wRef);
+MODULE_SCOPE WindowRef TkMacOSXDrawableWindow(Drawable drawable);
+MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
+MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
+MODULE_SCOPE Tcl_Obj * TkMacOSXGetStringObjFromCFString(CFStringRef str);
+
+#endif /* _TKMACPRIV */
diff --git a/carbon/tkMacOSXRegion.c b/carbon/tkMacOSXRegion.c
new file mode 100644
index 0000000..e2faab0
--- /dev/null
+++ b/carbon/tkMacOSXRegion.c
@@ -0,0 +1,644 @@
+/*
+ * tkMacOSXRegion.c --
+ *
+ * Implements X window calls for manipulating regions
+ *
+ * Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkCreateRegion --
+ *
+ * Implements the equivelent of the X window function XCreateRegion. See
+ * Xwindow documentation for more details.
+ *
+ * Results:
+ * Returns an allocated region handle.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkRegion
+TkCreateRegion(void)
+{
+ return (TkRegion) HIShapeCreateMutable();
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkDestroyRegion --
+ *
+ * Implements the equivelent of the X window function XDestroyRegion. See
+ * Xwindow documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory is freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkDestroyRegion(
+ TkRegion r)
+{
+ if (r) {
+ CFRelease(r);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkIntersectRegion --
+ *
+ * Implements the equivalent of the X window function XIntersectRegion.
+ * See Xwindow documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkIntersectRegion(
+ TkRegion sra,
+ TkRegion srb,
+ TkRegion dr_return)
+{
+ ChkErr(HIShapeIntersect, (HIShapeRef) sra, (HIShapeRef) srb,
+ (HIMutableShapeRef) dr_return);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSubtractRegion --
+ *
+ * Implements the equivalent 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)
+{
+ ChkErr(HIShapeDifference, (HIShapeRef) sra, (HIShapeRef) srb,
+ (HIMutableShapeRef) dr_return);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkUnionRectWithRegion --
+ *
+ * Implements the equivelent of the X window function
+ * XUnionRectWithRegion. See Xwindow documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkUnionRectWithRegion(
+ XRectangle* rectangle,
+ TkRegion src_region,
+ TkRegion dest_region_return)
+{
+ const CGRect r = CGRectMake(rectangle->x, rectangle->y,
+ rectangle->width, rectangle->height);
+
+ if (src_region == dest_region_return) {
+ ChkErr(TkMacOSHIShapeUnionWithRect,
+ (HIMutableShapeRef) dest_region_return, &r);
+ } else {
+ HIShapeRef rectRgn = HIShapeCreateWithRect(&r);
+
+ ChkErr(TkMacOSHIShapeUnion, rectRgn, (HIShapeRef) src_region,
+ (HIMutableShapeRef) dest_region_return);
+ CFRelease(rectRgn);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkRectInRegion --
+ *
+ * Implements the equivelent of the X window function XRectInRegion. See
+ * Xwindow documentation for more details.
+ *
+ * Results:
+ * Returns RectanglePart or RectangleOut. Note that this is not a
+ * complete implementation since it doesn't test for RectangleIn.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkRectInRegion(
+ TkRegion region,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height)
+{
+ int result;
+ const CGRect r = CGRectMake(x, y, width, height);
+
+ TK_IF_MAC_OS_X_API (4, HIShapeIntersectsRect,
+ result = HIShapeIntersectsRect((HIShapeRef) region, &r) ?
+ RectanglePart : RectangleOut;
+ ) TK_ELSE_MAC_OS_X (4,
+ HIShapeRef rectRgn = HIShapeCreateWithRect(&r);
+ HIShapeRef sectRgn = HIShapeCreateIntersection((HIShapeRef) region,
+ rectRgn);
+
+#if 1
+ result = !HIShapeIsEmpty(sectRgn) ? RectanglePart : RectangleOut;
+#else
+ /*
+ * More expensive full implementation that tests for RectangleIn,
+ * unused by Tk at present.
+ */
+
+ if (!HIShapeIsEmpty(sectRgn)) {
+ HIShapeRef diffRgn = HIShapeCreateDifference(rectRgn, sectRgn);
+
+ if (HIShapeIsEmpty(diffRgn)) {
+ result = RectangleIn;
+ } else {
+ result = RectanglePart;
+ }
+ CFRelease(diffRgn);
+ } else {
+ result = RectangleOut;
+ }
+#endif
+ CFRelease(sectRgn);
+ CFRelease(rectRgn);
+ ) TK_ENDIF;
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkClipBox --
+ *
+ * Implements the equivelent of the X window function XClipBox. See
+ * Xwindow documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkClipBox(
+ TkRegion r,
+ XRectangle* rect_return)
+{
+ CGRect rect;
+
+ HIShapeGetBounds((HIShapeRef) r, &rect);
+ rect_return->x = rect.origin.x;
+ rect_return->y = rect.origin.y;
+ rect_return->width = rect.size.width;
+ rect_return->height = rect.size.height;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpBuildRegionFromAlphaData --
+ *
+ * Set up a rectangle of the given region based on the supplied alpha
+ * data.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * The region is updated, with extra pixels added to it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpBuildRegionFromAlphaData(
+ TkRegion region, /* Region to update. */
+ unsigned int x, /* Where in region to update. */
+ unsigned int y, /* Where in region to update. */
+ unsigned int width, /* Size of rectangle to update. */
+ unsigned int height, /* Size of rectangle to update. */
+ unsigned char *dataPtr, /* Data to read from. */
+ unsigned int pixelStride, /* num bytes from one piece of alpha
+ * data to the next in the line. */
+ unsigned int lineStride) /* num bytes from one line of alpha
+ * data to the next line. */
+{
+ unsigned char *lineDataPtr;
+ unsigned int x1, y1, end;
+ XRectangle rect;
+
+ for (y1 = 0; y1 < height; y1++) {
+ lineDataPtr = dataPtr;
+ for (x1 = 0; x1 < width; x1 = end) {
+ /*
+ * Search for first non-transparent pixel.
+ */
+
+ while ((x1 < width) && !*lineDataPtr) {
+ x1++;
+ lineDataPtr += pixelStride;
+ }
+ end = x1;
+
+ /*
+ * Search for first transparent pixel.
+ */
+
+ while ((end < width) && *lineDataPtr) {
+ end++;
+ lineDataPtr += pixelStride;
+ }
+ if (end > x1) {
+ rect.x = x + x1;
+ rect.y = y + y1;
+ rect.width = end - x1;
+ rect.height = 1;
+ TkUnionRectWithRegion(&rect, region, region);
+ }
+ }
+ dataPtr += lineStride;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpRetainRegion --
+ *
+ * Increases reference count of region.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpRetainRegion(
+ TkRegion r)
+{
+ CFRetain(r);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpReleaseRegion --
+ *
+ * Decreases reference count of region.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May free memory.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpReleaseRegion(
+ TkRegion r)
+{
+ CFRelease(r);
+}
+#if 0
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXEmtpyRegion --
+ *
+ * Set region to emtpy.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXEmtpyRegion(
+ TkRegion r)
+{
+ ChkErr(HIShapeSetEmpty, (HIMutableShapeRef) r);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXIsEmptyRegion --
+ *
+ * Return native region for given tk region.
+ *
+ * Results:
+ * 1 if empty, 0 otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXIsEmptyRegion(
+ TkRegion r)
+{
+ return HIShapeIsEmpty((HIMutableShapeRef) r) ? 1 : 0;
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNativeRegion --
+ *
+ * Return native region for given tk region.
+ *
+ * Results:
+ * Native region, CFRelease when done.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+HIShapeRef
+TkMacOSXGetNativeRegion(
+ TkRegion r)
+{
+ return (HIShapeRef) CFRetain(r);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetWithNativeRegion --
+ *
+ * Set region to the native region.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetWithNativeRegion(
+ TkRegion r,
+ HIShapeRef rgn)
+{
+ ChkErr(TkMacOSXHIShapeSetWithShape, (HIMutableShapeRef) r, rgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXOffsetRegion --
+ *
+ * Offsets region by given distances.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXOffsetRegion(
+ TkRegion r,
+ short dx,
+ short dy)
+{
+ ChkErr(HIShapeOffset, (HIMutableShapeRef) r, dx, dy);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXHIShapeCreateEmpty, TkMacOSXHIShapeCreateMutableWithRect,
+ * TkMacOSXHIShapeSetWithShape, TkMacOSXHIShapeSetWithRect,
+ * TkMacOSHIShapeDifferenceWithRect, TkMacOSHIShapeUnionWithRect,
+ * TkMacOSHIShapeUnion --
+ *
+ * Wrapper functions for missing/buggy HIShape API
+ *
+ *----------------------------------------------------------------------
+ */
+
+HIShapeRef
+TkMacOSXHIShapeCreateEmpty(void)
+{
+ HIShapeRef result;
+
+ TK_IF_MAC_OS_X_API (4, HIShapeCreateEmpty,
+ result = HIShapeCreateEmpty();
+ ) TK_ELSE_MAC_OS_X (4,
+ static HIShapeRef emptyRgn = NULL;
+
+ if (!emptyRgn) {
+ HIMutableShapeRef rgn = HIShapeCreateMutable();
+
+ emptyRgn = HIShapeCreateCopy(rgn);
+ CFRelease(rgn);
+ }
+ result = HIShapeCreateCopy(emptyRgn);
+ ) TK_ENDIF;
+
+ return result;
+}
+
+HIMutableShapeRef
+TkMacOSXHIShapeCreateMutableWithRect(
+ const CGRect *inRect)
+{
+ HIMutableShapeRef result;
+
+ TK_IF_MAC_OS_X_API (5, HIShapeCreateMutableWithRect,
+ result = HIShapeCreateMutableWithRect(inRect);
+ ) TK_ELSE_MAC_OS_X (5,
+ HIShapeRef rgn = HIShapeCreateWithRect(inRect);
+
+ result = HIShapeCreateMutableCopy(rgn);
+ CFRelease(rgn);
+ ) TK_ENDIF;
+
+ return result;
+}
+
+OSStatus
+TkMacOSXHIShapeSetWithShape(
+ HIMutableShapeRef inDestShape,
+ HIShapeRef inSrcShape)
+{
+ OSStatus result;
+
+ TK_IF_MAC_OS_X_API (5, HIShapeSetWithShape,
+ result = HIShapeSetWithShape(inDestShape, inSrcShape);
+ ) TK_ELSE_MAC_OS_X (5,
+ result = HIShapeSetEmpty(inDestShape);
+ if (result == noErr) {
+ result = HIShapeDifference(inSrcShape, inDestShape, inDestShape);
+ }
+ ) TK_ENDIF;
+
+ return result;
+}
+
+#if 0
+OSStatus
+TkMacOSXHIShapeSetWithRect(
+ HIMutableShapeRef inShape,
+ const CGRect *inRect)
+{
+ OSStatus result;
+ HIShapeRef rgn = HIShapeCreateWithRect(inRect);
+
+ result = TkMacOSXHIShapeSetWithShape(inShape, rgn);
+ CFRelease(rgn);
+
+ return result;
+}
+#endif
+
+OSStatus
+TkMacOSHIShapeDifferenceWithRect(
+ HIMutableShapeRef inShape,
+ const CGRect *inRect)
+{
+ OSStatus result;
+ HIShapeRef rgn = HIShapeCreateWithRect(inRect);
+
+ result = HIShapeDifference(inShape, rgn, inShape);
+ CFRelease(rgn);
+
+ return result;
+}
+
+OSStatus
+TkMacOSHIShapeUnionWithRect(
+ HIMutableShapeRef inShape,
+ const CGRect *inRect)
+{
+ OSStatus result;
+
+ TK_IF_MAC_OS_X_API (5, HIShapeUnionWithRect,
+ result = HIShapeUnionWithRect(inShape, inRect);
+ ) TK_ELSE_MAC_OS_X (5,
+ HIShapeRef rgn = HIShapeCreateWithRect(inRect);
+
+ result = TkMacOSHIShapeUnion(rgn, inShape, inShape);
+ CFRelease(rgn);
+ ) TK_ENDIF;
+
+ return result;
+}
+
+OSStatus
+TkMacOSHIShapeUnion(
+ HIShapeRef inShape1,
+ HIShapeRef inShape2,
+ HIMutableShapeRef outResult)
+{
+ OSStatus result;
+
+ TK_IF_HI_TOOLBOX (4,
+ result = HIShapeUnion(inShape1, inShape2, outResult);
+ ) TK_ELSE_HI_TOOLBOX (4,
+ /*
+ * Workaround HIShapeUnion bug in 10.3 and earlier.
+ */
+
+ HIShapeRef rgn = HIShapeCreateCopy(outResult);
+
+ result = HIShapeUnion(inShape1, inShape2, (HIMutableShapeRef) rgn);
+ if (result == noErr) {
+ result = HIShapeSetEmpty(outResult);
+ if (result == noErr) {
+ result = HIShapeDifference(rgn, outResult, outResult);
+ }
+ }
+ CFRelease(rgn);
+ ) TK_ENDIF;
+
+ return result;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXScale.c b/carbon/tkMacOSXScale.c
new file mode 100644
index 0000000..bc46596
--- /dev/null
+++ b/carbon/tkMacOSXScale.c
@@ -0,0 +1,482 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkScale.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_SCALE
+#endif
+*/
+
+/*
+ * 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(ClientData clientData, XEvent *eventPtr);
+static pascal void ScaleActionProc(ControlRef theControl,
+ ControlPartCode partCode);
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateScale --
+ *
+ * Allocate a new TkScale structure.
+ *
+ * Results:
+ * Returns a newly allocated TkScale structure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkScale *
+TkpCreateScale(
+ Tk_Window tkwin)
+{
+ MacScale *macScalePtr = 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(
+ 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) /* 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, savePort;
+ Boolean portChanged;
+ MacDrawable *macDraw;
+ SInt32 initialValue, minValue, maxValue;
+ UInt16 numTicks;
+
+#ifdef TK_MAC_DEBUG_SCALE
+ TkMacOSXDbgMsg("TkpDisplayScale");
+#endif
+ 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, NULL);
+ if (result != TCL_OK) {
+ Tcl_AddErrorInfo(interp, "\n (command executed by scale)");
+ Tcl_BackgroundException(interp, result);
+ }
+ 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 = 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 = TkMacOSXDrawableWindow(Tk_WindowId(tkwin));
+ portChanged = QDSwapPort(destPort, &savePort);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ /*
+ * Create Macintosh control.
+ */
+
+#define MAC_OSX_SCROLL_WIDTH 10
+
+ if (scalePtr->orient == ORIENT_HORIZONTAL) {
+ int offset = (Tk_Height(tkwin) - MAC_OSX_SCROLL_WIDTH)/2;
+
+ if (offset < 0) {
+ offset = 0;
+ }
+
+ r.left = macDraw->xOff + scalePtr->inset;
+ r.top = macDraw->yOff + offset;
+ r.right = macDraw->xOff+Tk_Width(tkwin) - scalePtr->inset;
+ r.bottom = macDraw->yOff + offset + MAC_OSX_SCROLL_WIDTH/2;
+ } else {
+ int offset = (Tk_Width(tkwin) - MAC_OSX_SCROLL_WIDTH)/2;
+
+ if (offset < 0) {
+ offset = 0;
+ }
+
+ r.left = macDraw->xOff + offset;
+ r.top = macDraw->yOff + scalePtr->inset;
+ r.right = macDraw->xOff + offset + MAC_OSX_SCROLL_WIDTH/2;
+ r.bottom = macDraw->yOff+Tk_Height(tkwin) - scalePtr->inset;
+ }
+
+ if (macScalePtr->scaleHandle == NULL) {
+#ifdef TK_MAC_DEBUG_SCALE
+ TkMacOSXDbgMsg("Initialising scale");
+#endif
+ initialValue = scalePtr->value;
+ if (scalePtr->orient == ORIENT_HORIZONTAL) {
+ minValue = scalePtr->fromValue;
+ maxValue = scalePtr->toValue;
+ } else {
+ minValue = scalePtr->fromValue;
+ maxValue = scalePtr->toValue;
+ }
+
+ if (scalePtr->tickInterval == 0) {
+ numTicks = 0;
+ } else {
+ numTicks = (maxValue - minValue)/scalePtr->tickInterval;
+ }
+
+ CreateSliderControl(windowRef, &r, initialValue, minValue, maxValue,
+ kControlSliderPointsDownOrRight, numTicks, 1, scaleActionProc,
+ &(macScalePtr->scaleHandle));
+ SetControlReference(macScalePtr->scaleHandle, (UInt32) scalePtr);
+
+ if (IsWindowActive(windowRef)) {
+ macScalePtr->flags |= ACTIVE;
+ }
+ } else {
+ SetControlBounds(macScalePtr->scaleHandle, &r);
+ SetControl32BitValue(macScalePtr->scaleHandle, scalePtr->value);
+ SetControl32BitMinimum(macScalePtr->scaleHandle, scalePtr->fromValue);
+ SetControl32BitMaximum(macScalePtr->scaleHandle, scalePtr->toValue);
+ }
+
+ /*
+ * Finally draw the control.
+ */
+
+ SetControlVisibility(macScalePtr->scaleHandle,true,true);
+ HiliteControl(macScalePtr->scaleHandle,0);
+ Draw1Control(macScalePtr->scaleHandle);
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+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(
+ TkScale *scalePtr, /* Widget record for scale. */
+ int x, int y) /* Coordinates within scalePtr's window. */
+{
+ MacScale *macScalePtr = (MacScale *) scalePtr;
+ ControlPartCode part;
+ Point where;
+ Rect bounds;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+
+#ifdef TK_MAC_DEBUG_SCALE
+ TkMacOSXDbgMsg("TkpScaleElement");
+#endif
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(scalePtr->tkwin));
+ portChanged = QDSwapPort(destPort, &savePort);
+
+ /*
+ * 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);
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+
+#ifdef TK_MAC_DEBUG_SCALE
+ fprintf (stderr,"ScalePart %d, pos ( %d %d )\n", part, where.h, where.v );
+#endif
+
+ 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 clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
+{
+ MacScale *macScalePtr = (MacScale *) clientData;
+ Point where;
+ Rect bounds;
+ int part;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+
+#ifdef TK_MAC_DEBUG_SCALE
+ fprintf(stderr,"MacScaleEventProc\n" );
+#endif
+
+ /*
+ * 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));
+ portChanged = QDSwapPort(destPort, &savePort);
+ 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;
+#ifdef TK_MAC_DEBUG_SCALE
+ TkMacOSXDbgMsg("calling TestControl");
+#endif
+ part = TestControl(macScalePtr->scaleHandle, where);
+ if (part == 0) {
+ return;
+ }
+
+ TkMacOSXTrackingLoop(1);
+ part = HandleControlClick(macScalePtr->scaleHandle, where,
+ TkMacOSXModifierState(), scaleActionProc);
+ TkMacOSXTrackingLoop(0);
+
+ /*
+ * Update the value for the widget.
+ */
+
+ macScalePtr->info.value = GetControlValue(macScalePtr->scaleHandle);
+ /* TkScaleSetValue(&macScalePtr->info, macScalePtr->info.value, 1, 0); */
+
+ /*
+ * The HandleControlClick call will "eat" the ButtonUp event. We now
+ * generate a ButtonUp event so Tk will unset implicit grabs etc.
+ */
+
+ TkGenerateButtonEventForXPointer(Tk_WindowId(macScalePtr->info.tkwin));
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScaleActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * HandleControlClick. 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, /* Handle to scrollbat control */
+ ControlPartCode partCode) /* Part of scrollbar that was "hit" */
+{
+ int value;
+ TkScale *scalePtr = (TkScale *) GetControlReference(theControl);
+
+#ifdef TK_MAC_DEBUG_SCALE
+ TkMacOSXDbgMsg("ScaleActionProc");
+#endif
+ value = GetControlValue(theControl);
+ TkScaleSetValue(scalePtr, value, 1, 1);
+ Tcl_Preserve((ClientData) scalePtr);
+ TkMacOSXRunTclEventLoop();
+ Tcl_Release((ClientData) scalePtr);
+}
+
diff --git a/carbon/tkMacOSXScrlbr.c b/carbon/tkMacOSXScrlbr.c
new file mode 100644
index 0000000..c991c88
--- /dev/null
+++ b/carbon/tkMacOSXScrlbr.c
@@ -0,0 +1,1017 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkScrollbar.h"
+#include "tkMacOSXDebug.h"
+
+#define MIN_SCROLLBAR_VALUE 0
+#define SCROLLBAR_SCALING_VALUE ((double)(LONG_MAX>>1))
+
+/*
+ * Declaration of Mac specific scrollbar structure.
+ */
+
+typedef struct MacScrollbar {
+ TkScrollbar info; /* Generic scrollbar info */
+ ControlRef sbHandle; /* Scrollbar control */
+ int macFlags; /* Various flags; see below */
+ Rect eraseRect; /* Rect to erase before drawing control */
+} MacScrollbar;
+
+/*
+ * 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).
+ */
+
+#define ALREADY_DEAD 1
+#define IN_MODAL_LOOP 2
+#define ACTIVE 4
+
+/*
+ * Globals uses locally in this file.
+ */
+static ControlActionUPP scrollActionProc = NULL; /* Pointer to func. */
+static ControlActionUPP thumbActionProc = NULL; /* Pointer to func. */
+static Point mouseDownPoint; /* Used to store the coordinates where the
+ * mouse was first pressed to begin dragging
+ * the thumb, because ThumbActionProc can't
+ * take any args. */
+
+typedef struct ScrollbarMetrics {
+ SInt32 width, minHeight, minThumbHeight;
+ short topArrowHeight, bottomArrowHeight;
+ ControlSize size;
+} ScrollbarMetrics;
+
+static ScrollbarMetrics metrics[2] = {
+ {15, 54, 26, 14, 14, kControlSizeNormal}, /* kThemeScrollBarMedium */
+ {11, 40, 20, 10, 10, kControlSizeSmall}, /* kThemeScrollBarSmall */
+};
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static pascal void ScrollbarActionProc(ControlRef theControl,
+ ControlPartCode partCode);
+static pascal void ThumbActionProc(ControlRef theControl,
+ ControlPartCode partCode);
+static int ScrollbarPress(MacScrollbar *, XEvent *);
+static void ScrollbarEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void UpdateControlValues(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.
+ */
+
+const Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ NULL, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitScrollbarMetrics --
+ *
+ * This function initializes the current system metrics for a scrollbar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Updates the geometry cache info for all scrollbars.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitScrollbarMetrics(void)
+{
+ const short height = 100, width = 50;
+ ThemeTrackDrawInfo info = {0, {0, 0, height, width}, 0, 1, 0, 0,
+ kThemeTrackShowThumb, kThemeTrackActive, 0, {{1, 0}}};
+ Rect bounds;
+
+ ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &metrics[0].width);
+ ChkErr(GetThemeMetric, kThemeMetricScrollBarMinThumbHeight,
+ &metrics[0].minThumbHeight);
+ info.kind = kThemeScrollBarMedium;
+ ChkErr(GetThemeTrackDragRect, &info, &bounds);
+ metrics[0].topArrowHeight = bounds.top;
+ metrics[0].bottomArrowHeight = height - bounds.bottom;
+ metrics[0].minHeight = metrics[0].minThumbHeight +
+ metrics[0].topArrowHeight + metrics[0].bottomArrowHeight;
+ ChkErr(GetThemeMetric, kThemeMetricSmallScrollBarWidth, &metrics[1].width);
+ ChkErr(GetThemeMetric, kThemeMetricSmallScrollBarMinThumbHeight,
+ &metrics[1].minThumbHeight);
+ info.kind = kThemeScrollBarSmall;
+ ChkErr(GetThemeTrackDragRect, &info, &bounds);
+ metrics[1].topArrowHeight = bounds.top;
+ metrics[1].bottomArrowHeight = height - bounds.bottom;
+ metrics[1].minHeight = metrics[1].minThumbHeight +
+ metrics[1].topArrowHeight + metrics[1].bottomArrowHeight;
+
+ sprintf(tkDefScrollbarWidth, "%ld", metrics[0].width);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateScrollbar --
+ *
+ * Allocate a new TkScrollbar structure.
+ *
+ * Results:
+ * Returns a newly allocated TkScrollbar structure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkScrollbar *
+TkpCreateScrollbar(
+ Tk_Window tkwin) /* New Tk Window. */
+{
+ static int initialized = 0;
+ MacScrollbar * macScrollPtr;
+
+ if (scrollActionProc == NULL) {
+ scrollActionProc = NewControlActionUPP(ScrollbarActionProc);
+ thumbActionProc = NewControlActionUPP(ThumbActionProc);
+ }
+ if (!initialized) {
+ TkMacOSXInitScrollbarMetrics();
+ initialized = 1;
+ }
+ macScrollPtr = ckalloc(sizeof(MacScrollbar));
+ macScrollPtr->sbHandle = NULL;
+ macScrollPtr->macFlags = 0;
+ SetRect(&macScrollPtr->eraseRect, 0, 0, 0, 0);
+
+ Tk_CreateEventHandler(tkwin, ActivateMask|ExposureMask|
+ StructureNotifyMask|FocusChangeMask|ButtonPressMask,
+ ScrollbarEventProc, (ClientData) macScrollPtr);
+
+ 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;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ 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);
+
+ if (macScrollPtr->sbHandle == NULL) {
+ Rect r = {0, 0, 1, 1};
+
+ windowRef = TkMacOSXDrawableWindow(Tk_WindowId(tkwin));
+ CreateScrollBarControl(windowRef, &r, 0, 0, 0, 0, true, NULL,
+ &(macScrollPtr->sbHandle));
+ SetControlReference(macScrollPtr->sbHandle, (SInt32) scrollPtr);
+
+ if (IsWindowActive(windowRef)) {
+ macScrollPtr->macFlags |= ACTIVE;
+ }
+ }
+
+ /*
+ * Update the control values before we draw.
+ */
+
+ UpdateControlValues(macScrollPtr);
+
+ /*
+ * Set up port for drawing Macintosh control.
+ */
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ portChanged = QDSwapPort(destPort, &savePort);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ /*
+ * Scrollbars do not erase the complete control bounds if they are wider
+ * than the standard width, so manually erase the extra space.
+ */
+
+ if (!EmptyRect(&macScrollPtr->eraseRect)) {
+ EraseRect(&macScrollPtr->eraseRect);
+ }
+
+ Draw1Control(macScrollPtr->sbHandle);
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+
+ 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(
+ 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. */
+{
+ int variant, fieldLength;
+
+ if (scrollPtr->highlightWidth < 0) {
+ scrollPtr->highlightWidth = 0;
+ }
+ scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth;
+ variant = ((scrollPtr->vertical ? Tk_Width(scrollPtr->tkwin) :
+ Tk_Height(scrollPtr->tkwin)) - 2 * scrollPtr->inset
+ < metrics[0].width) ? 1 : 0;
+ scrollPtr->arrowLength = (metrics[variant].topArrowHeight +
+ metrics[variant].bottomArrowHeight) / 2;
+ 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 +
+ metrics[variant].minThumbHeight)) {
+ scrollPtr->sliderLast = scrollPtr->sliderFirst +
+ metrics[variant].minThumbHeight;
+ }
+ if (scrollPtr->sliderLast > fieldLength) {
+ scrollPtr->sliderLast = fieldLength;
+ }
+ scrollPtr->sliderFirst += scrollPtr->inset +
+ metrics[variant].topArrowHeight;
+ scrollPtr->sliderLast += scrollPtr->inset +
+ metrics[variant].bottomArrowHeight;
+
+ /*
+ * 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) {
+ Tk_GeometryRequest(scrollPtr->tkwin, scrollPtr->width +
+ 2 * scrollPtr->inset, 2 * (scrollPtr->arrowLength +
+ scrollPtr->borderWidth + scrollPtr->inset) +
+ metrics[variant].minThumbHeight);
+ } else {
+ Tk_GeometryRequest(scrollPtr->tkwin, 2 * (scrollPtr->arrowLength +
+ scrollPtr->borderWidth + scrollPtr->inset) +
+ metrics[variant].minThumbHeight, scrollPtr->width +
+ 2 * scrollPtr->inset);
+ }
+ 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;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ int inactive = 0;
+ ControlPartCode part;
+ Point where = {y, x};
+ Rect bounds;
+
+ if ((x < scrollPtr->inset) || (x >= (Tk_Width(scrollPtr->tkwin) -
+ scrollPtr->inset)) || (y < scrollPtr->inset) ||
+ (y >= (Tk_Height(scrollPtr->tkwin) - 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));
+ portChanged = QDSwapPort(destPort, &savePort);
+ UpdateControlValues(macScrollPtr);
+ if (!IsControlActive(macScrollPtr->sbHandle)) {
+ inactive = true;
+ ActivateControl(macScrollPtr->sbHandle);
+ }
+ TkMacOSXWinBounds((TkWindow *) scrollPtr->tkwin, &bounds);
+ where.h += bounds.left;
+ where.v += bounds.top;
+ part = TestControl(((MacScrollbar *) scrollPtr)->sbHandle, where);
+ if (inactive) {
+ DeactivateControl(macScrollPtr->sbHandle);
+ }
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ switch (part) {
+ case kAppearancePartUpButton:
+ return TOP_ARROW;
+ case kAppearancePartPageUpArea:
+ return TOP_GAP;
+ case kAppearancePartIndicator:
+ return SLIDER;
+ case kAppearancePartPageDownArea:
+ return BOTTOM_GAP;
+ case kAppearancePartDownButton:
+ return BOTTOM_ARROW;
+ default:
+ return OUTSIDE;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ThumbActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * HandleControlClick. 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(
+ ControlRef theControl,
+ ControlPartCode partCode)
+{
+ TkScrollbar *scrollPtr = (TkScrollbar *)(intptr_t)
+ GetControlReference(theControl);
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
+ Tcl_DString cmdString;
+ /*int origValue;*/ /* dead code */
+ int variant;
+ short trackBarSize;
+ double oldFirstFraction, newFirstFraction;
+ char valueString[40];
+ Point currentPoint = { 0, 0 };
+ Rect trackRect;
+ Tcl_Interp *interp;
+ MouseTrackingResult trackingResult;
+ OSStatus err;
+
+ if (scrollPtr == NULL) {
+ return;
+ }
+
+ Tcl_DStringInit(&cmdString);
+ /*origValue = GetControl32BitValue(macScrollPtr->sbHandle);*/ /* dead code */
+ GetControlBounds(macScrollPtr->sbHandle, &trackRect);
+
+ if (scrollPtr->vertical) {
+ variant = (trackRect.right - trackRect.left) < metrics[0].width ? 1 : 0;
+ trackBarSize = trackRect.bottom - trackRect.top -
+ metrics[variant].topArrowHeight -
+ metrics[variant].bottomArrowHeight;
+ InsetRect(&trackRect, -25, -113);
+ } else {
+ variant = (trackRect.bottom - trackRect.top) < metrics[0].width ? 1 : 0;
+ trackBarSize = trackRect.right - trackRect.left -
+ metrics[variant].topArrowHeight -
+ metrics[variant].bottomArrowHeight;
+ 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. Since the mouse may move a distance too small to cause a
+ * change to the first fraction, each calculation must be done versus what
+ * the first fraction was when the mouse button was initially pressed.
+ * Otherwise, moving the mouse too slowly will cause the calculated
+ * fraction delta to be zero and the scrollbar won't respond.
+ */
+
+ oldFirstFraction = scrollPtr->firstFraction;
+
+ TkMacOSXTrackingLoop(1);
+ do {
+ err = ChkErr(TrackMouseLocationWithOptions, NULL,
+ kTrackMouseLocationOptionDontConsumeMouseUp,
+ kEventDurationForever, &currentPoint, NULL, &trackingResult);
+ if ((err == noErr) && ((trackingResult == kMouseTrackingMouseDragged)
+ || (trackingResult == kMouseTrackingMouseMoved))) {
+ /*
+ * Calculate where the scrollbar should move to, based on where the
+ * mouse button was pressed and where the scrollbar initially was
+ * at that time. Note that PtInRect() will return false if
+ * currentPoint or trackRect are not in is not in current graphics
+ * port, which may happen if any of the waiting idle events change
+ * the port (e.g. with SetPort()) but fail to restore it before
+ * returning and the scrollbar will lock in place.
+ */
+
+ newFirstFraction = oldFirstFraction;
+ if (PtInRect(currentPoint, &trackRect)) {
+ short pixDiff;
+
+ if (scrollPtr->vertical) {
+ pixDiff = currentPoint.v - mouseDownPoint.v;
+ } else {
+ pixDiff = currentPoint.h - mouseDownPoint.h;
+ }
+ newFirstFraction += (double)pixDiff / trackBarSize;
+ if (newFirstFraction > 1.0) {
+ newFirstFraction = 1.0;
+ } else if (newFirstFraction < 0.0) {
+ newFirstFraction = 0.0;
+ }
+ }
+
+ /*
+ * Move the scrollbar thumb to the new first fraction given its
+ * position when initially pressed and how far the mouse has
+ * moved. Process waiting idle tasks afterward to allow for the
+ * display to update.
+ */
+
+ Tcl_PrintDouble(NULL, newFirstFraction, valueString);
+ Tcl_DStringSetLength(&cmdString, 0);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ scrollPtr->commandSize);
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+ interp = scrollPtr->interp;
+ Tcl_Preserve(interp);
+ Tcl_EvalEx(interp, Tcl_DStringValue(&cmdString),
+ Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
+ Tcl_Release(interp);
+ TkMacOSXRunTclEventLoop();
+ }
+ } while ((err == noErr) && trackingResult != kMouseTrackingMouseReleased);
+ TkMacOSXTrackingLoop(0);
+ Tcl_DStringFree(&cmdString);
+ return;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScrollbarActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * HandleControlClick. 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 *)(intptr_t)
+ GetControlReference(theControl);
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
+ Tcl_DString cmdString;
+
+ Tcl_DStringInit(&cmdString);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ scrollPtr->commandSize);
+
+ if ( partCode == kAppearancePartUpButton ||
+ partCode == kAppearancePartDownButton ) {
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (partCode == kAppearancePartUpButton) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "unit");
+ } else if (partCode == kAppearancePartPageUpArea ||
+ partCode == kAppearancePartPageDownArea ) {
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (partCode == kAppearancePartPageUpArea) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "page");
+ } else if (partCode == kAppearancePartIndicator) {
+ char valueString[TCL_DOUBLE_SPACE];
+
+ Tcl_PrintDouble(NULL, (GetControl32BitValue(macScrollPtr->sbHandle) -
+ MIN_SCROLLBAR_VALUE) / SCROLLBAR_SCALING_VALUE, valueString);
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+ }
+ Tcl_Preserve(scrollPtr->interp);
+ Tcl_EvalEx(scrollPtr->interp, Tcl_DStringValue(&cmdString),
+ Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
+ Tcl_Release(scrollPtr->interp);
+ Tcl_DStringFree(&cmdString);
+ TkMacOSXRunTclEventLoop();
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScrollbarPress --
+ *
+ * This procedure is invoked in response to <ButtonPress> events.
+ * Enters a modal loop to handle scrollbar interactions.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+ScrollbarPress(MacScrollbar *macScrollPtr, XEvent *eventPtr)
+{
+ TkScrollbar *scrollPtr = &macScrollPtr->info;
+ Point where;
+ Rect bounds;
+ ControlPartCode part;
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ Window window;
+
+ Tcl_Preserve(scrollPtr);
+ macScrollPtr->macFlags |= IN_MODAL_LOOP;
+
+ /*
+ * 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));
+ portChanged = QDSwapPort(destPort, &savePort);
+ 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);
+ TkMacOSXTrackingLoop(1);
+ if (part == kAppearancePartIndicator && 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.
+ */
+
+ mouseDownPoint.h = where.h;
+ mouseDownPoint.v = where.v;
+ HandleControlClick(macScrollPtr->sbHandle, where,
+ TkMacOSXModifierState(), thumbActionProc);
+ } else if (part == kAppearancePartIndicator) {
+ /*
+ * Case 2: in thumb with jump scrolling. Call HandleControlClick
+ * with a NULL action proc. Use the new value of the control to
+ * set update the control.
+ */
+
+ part = HandleControlClick(macScrollPtr->sbHandle, where,
+ TkMacOSXModifierState(), NULL);
+ if (part == kAppearancePartIndicator) {
+ Tcl_Interp *interp = scrollPtr->interp;
+ Tcl_DString cmdString;
+ char valueString[TCL_DOUBLE_SPACE];
+
+ Tcl_PrintDouble(NULL,
+ (GetControl32BitValue(macScrollPtr->sbHandle) -
+ MIN_SCROLLBAR_VALUE) / SCROLLBAR_SCALING_VALUE,
+ valueString);
+ Tcl_DStringInit(&cmdString);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ strlen(scrollPtr->command));
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+
+ Tcl_Preserve(interp);
+ Tcl_EvalEx(interp, Tcl_DStringValue(&cmdString),
+ Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
+ Tcl_Release(interp);
+ Tcl_DStringFree(&cmdString);
+ TkMacOSXRunTclEventLoop();
+ }
+ } else if (part != 0) {
+ /*
+ * Case 3: in any other part of the scrollbar. We call
+ * HandleControlClick with the scrollActionProc which will do most
+ * all the work.
+ */
+
+ HandleControlClick(macScrollPtr->sbHandle, where,
+ TkMacOSXModifierState(), scrollActionProc);
+
+ /*
+ * Workaround for Carbon bug where the scrollbar down arrow
+ * sometimes gets "stuck" after the mousebutton has been released.
+ */
+
+ if (scrollPtr->tkwin) {
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(scrollPtr->tkwin));
+ }
+ Draw1Control(macScrollPtr->sbHandle);
+ }
+ TkMacOSXTrackingLoop(0);
+
+ /*
+ * The HandleControlClick call will "eat" the ButtonUp event. We now
+ * generate a ButtonUp event so Tk will unset implicit grabs etc.
+ */
+
+ if (scrollPtr->tkwin) {
+ window = Tk_WindowId(scrollPtr->tkwin);
+ TkGenerateButtonEventForXPointer(window);
+ }
+
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+
+ if (macScrollPtr->sbHandle && (macScrollPtr->macFlags & ALREADY_DEAD)) {
+ DisposeControl(macScrollPtr->sbHandle);
+ macScrollPtr->sbHandle = NULL;
+ }
+ macScrollPtr->macFlags &= ~IN_MODAL_LOOP;
+ Tcl_Release(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 if (eventPtr->type == ButtonPress) {
+ ScrollbarPress(macScrollPtr, eventPtr);
+ } 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);
+ double dViewSize;
+ Rect contrlRect, portRect;
+ int variant, active;
+ short width, height;
+
+ 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;
+
+ GetPortBounds(GetWindowPort(GetControlOwner(macScrollPtr->sbHandle)),
+ &portRect);
+
+ /*
+ * If the scrollbar is flush against the bottom right hand corner then we
+ * leave space to draw the grow region for the window.
+ */
+
+ if (portRect.bottom == contrlRect.bottom &&
+ portRect.right == contrlRect.right) {
+ TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, true);
+ if (macDraw->toplevel &&
+ TkMacOSXResizable(macDraw->toplevel->winPtr)) {
+ int growSize;
+
+ switch (TkMacOSXWindowClass(macDraw->toplevel->winPtr)) {
+ case kFloatingWindowClass:
+ case kUtilityWindowClass:
+ growSize = metrics[1].width - 1;
+ break;
+ case kDocumentWindowClass:
+ case kMovableAlertWindowClass:
+ case kMovableModalWindowClass:
+ default:
+ growSize = metrics[0].width - 1;
+ break;
+ }
+ if (scrollPtr->vertical) {
+ contrlRect.bottom -= growSize;
+ } else {
+ contrlRect.right -= growSize;
+ }
+ }
+ } else {
+ TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, false);
+ }
+
+ if (IsControlVisible (macScrollPtr->sbHandle)) {
+ SetControlVisibility(macScrollPtr->sbHandle, false, false);
+ }
+
+ if (scrollPtr->vertical) {
+ width = contrlRect.right - contrlRect.left;
+ height = contrlRect.bottom - contrlRect.top;
+ } else {
+ width = contrlRect.bottom - contrlRect.top;
+ height = contrlRect.right - contrlRect.left;
+ }
+ variant = width < metrics[0].width ? 1 : 0;
+ SetControlData(macScrollPtr->sbHandle, kControlEntireControl,
+ kControlSizeTag, sizeof(ControlSize),
+ &(metrics[variant].size));
+
+ macScrollPtr->eraseRect = contrlRect;
+ if (scrollPtr->vertical) {
+ macScrollPtr->eraseRect.left += metrics[variant].width;
+ } else {
+ macScrollPtr->eraseRect.top += metrics[variant].width;
+ }
+
+ /*
+ * Ensure we set scrollbar control bounds only once all size adjustments
+ * have been computed.
+ */
+
+ SetControlBounds(macScrollPtr->sbHandle, &contrlRect);
+
+ /*
+ * Given the Tk parameters for the fractions of the start and end of the
+ * thumb, the following calculation determines the location for the
+ * Macintosh thumb. The Aqua scroll control works as follows. The
+ * scrollbar's value is the position of the left (or top) side of the view
+ * area in the content area being scrolled. The maximum value of the
+ * control is therefore the dimension of the content area less the size of
+ * the view area. Since these values are all integers, and Tk gives the
+ * thumb position as fractions, we have introduced a scaling factor.
+ */
+
+ dViewSize = (scrollPtr->lastFraction - scrollPtr->firstFraction)
+ * SCROLLBAR_SCALING_VALUE;
+ SetControl32BitMinimum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE);
+ SetControl32BitMaximum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE +
+ SCROLLBAR_SCALING_VALUE - dViewSize);
+ SetControlViewSize(macScrollPtr->sbHandle, dViewSize);
+ SetControl32BitValue(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE +
+ SCROLLBAR_SCALING_VALUE * scrollPtr->firstFraction);
+
+ if((scrollPtr->firstFraction <= 0.0 && scrollPtr->lastFraction >= 1.0)
+ || height <= metrics[variant].minHeight) {
+ /* Disable scrollbar */
+ SetControl32BitMaximum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE);
+ }
+ active = ((macScrollPtr->macFlags & ACTIVE) != 0);
+ if (active != IsControlActive(macScrollPtr->sbHandle)) {
+ if (active) {
+ ActivateControl(macScrollPtr->sbHandle);
+ } else {
+ DeactivateControl(macScrollPtr->sbHandle);
+ }
+ }
+ SetControlVisibility(macScrollPtr->sbHandle, true, false);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/carbon/tkMacOSXSend.c b/carbon/tkMacOSXSend.c
new file mode 100644
index 0000000..df6b2af
--- /dev/null
+++ b/carbon/tkMacOSXSend.c
@@ -0,0 +1,506 @@
+/*
+ * 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.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXInt.h"
+
+/*
+ * 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.
+ */
+
+/*
+ * 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(Tcl_Interp *interp);
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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 (result != TCL_OK || interpNamePtr == NULL) {
+ break;
+ }
+ interpName = Tcl_GetString(interpNamePtr);
+ 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 = ckalloc(sizeof(RegisteredInterp));
+ riPtr->interp = interp;
+ riPtr->name = ckalloc(strlen(actualName) + 1);
+ riPtr->nextPtr = interpListPtr;
+ interpListPtr = riPtr;
+ strcpy(riPtr->name, actualName);
+
+ /*
+ * TODO: DeleteProc
+ */
+
+ Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd, riPtr, NULL);
+ 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 *const sendOptions[] = {"-async", "-displayof", "-", NULL};
+ char *stringRep, *destName;
+ /*int async = 0;*/
+ int i, index, firstArg;
+ RegisteredInterp *riPtr;
+ Tcl_Obj *listObjPtr;
+ int result = TCL_OK;
+
+ for (i = 1; i < (objc - 1); ) {
+ stringRep = Tcl_GetString(objv[i]);
+ 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,
+ "?-option value ...? interpName arg ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ destName = Tcl_GetString(objv[i]);
+ firstArg = i + 1;
+
+ /*
+ * 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(riPtr);
+ localInterp = riPtr->interp;
+ Tcl_Preserve(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, 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", 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(riPtr);
+ Tcl_Release(localInterp);
+ } else {
+ /*
+ * TODO: This is a non-local request. Send the script to the server
+ * and poll it for a result.
+ */
+ }
+
+ 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, 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/carbon/tkMacOSXSubwindows.c b/carbon/tkMacOSXSubwindows.c
new file mode 100644
index 0000000..23e73ff
--- /dev/null
+++ b/carbon/tkMacOSXSubwindows.c
@@ -0,0 +1,1469 @@
+/*
+ * tkMacOSXSubwindows.c --
+ *
+ * Implements subwindows for the macintosh version of Tk.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXDebug.h"
+#include "tkMacOSXWm.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_CLIP_REGIONS
+#endif
+*/
+
+/*
+ * Prototypes for functions used only in this file.
+ */
+
+static void MoveResizeWindow(MacDrawable *macWin);
+static void GenerateConfigureNotify(TkWindow *winPtr,
+ int includeWin);
+static void UpdateOffsets(TkWindow *winPtr, int deltaX,
+ int deltaY);
+static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AllocGWorld --
+ * Simplifies the allocation of new drawable ports.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline void
+AllocGWorld(
+ int width,
+ int height,
+ int mono,
+ CGrafPtr *grafPtrPtr)
+{
+ Rect bounds = {0, 0, height, width};
+
+#ifdef __LITTLE_ENDIAN__
+ ChkErr(NewGWorld, grafPtrPtr, mono ? 1 : 0, &bounds, NULL, NULL,
+ kNativeEndianPixMap);
+#else
+ ChkErr(NewGWorld, grafPtrPtr, mono ? 1 : 0, &bounds, NULL, NULL, 0);
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ WindowRef winRef;
+
+ /*
+ * 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)) {
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ if (macWin->winPtr->parentPtr != NULL) {
+ TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
+ }
+ if (macWin->visRgn) {
+ CFRelease(macWin->visRgn);
+ }
+ if (macWin->aboveVisRgn) {
+ CFRelease(macWin->aboveVisRgn);
+ }
+
+ if (macWin->toplevel->referenceCount == 0) {
+ ckfree(macWin->toplevel);
+ }
+ ckfree(macWin);
+ return;
+ }
+
+ /*
+ * We are relying on the Activate Mac OS event to pass the focus away from
+ * a window that is getting Destroyed to the Front non-floating window. BUT
+ * we don't get activate events when a floating window is destroyed, since
+ * the front non-floating window doesn't in fact get activated... So maybe
+ * we can check here and if we are destroying a floating window, we can
+ * pass the focus back to the front non-floating window...
+ */
+
+ if (macWin->grafPtr != NULL) {
+ TkWindow *focusPtr = TkGetFocusWin(macWin->winPtr);
+
+ if (focusPtr == NULL
+ || (focusPtr->mainPtr->winPtr == macWin->winPtr)) {
+ winRef = TkMacOSXDrawableWindow(window);
+ if (TkpIsWindowFloating (winRef)) {
+ Window window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
+
+ if (window != None) {
+ TkMacOSXGenerateFocusEvent(window, 1);
+ }
+ }
+ }
+ }
+ if (macWin->visRgn) {
+ CFRelease(macWin->visRgn);
+ }
+ if (macWin->aboveVisRgn) {
+ CFRelease(macWin->aboveVisRgn);
+ }
+
+ /*
+ * 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)) {
+ WindowRef winRef = TkMacOSXDrawableWindow(window);
+
+ if (winRef) {
+ TkMacOSXWindowList *listPtr, *prevPtr;
+ WindowGroupRef group;
+
+ if (GetWindowProperty(winRef, 'Tk ', 'TsGp', sizeof(group), NULL,
+ &group) == noErr) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ ItemCount i = CountWindowGroupContents(group,
+ kWindowGroupContentsReturnWindows);
+ WindowRef macWin;
+ WindowGroupRef newGroup;
+ Window window;
+
+ while (i > 0) {
+ ChkErr(GetIndexedWindow, group, i--, 0, &macWin);
+ if (!macWin) {
+ continue;
+ }
+
+ window = TkMacOSXGetXWindow(macWin);
+ newGroup = NULL;
+ if (window != None) {
+ TkWindow *winPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, window);
+
+ if (winPtr && winPtr->wmInfoPtr) {
+ newGroup = GetWindowGroupOfClass(
+ winPtr->wmInfoPtr->macClass);
+ }
+ }
+ if (!newGroup) {
+ newGroup =
+ GetWindowGroupOfClass(kDocumentWindowClass);
+ }
+ ChkErr(SetWindowGroup, macWin, newGroup);
+ }
+ ChkErr(SetWindowGroupOwner, group, NULL);
+ ChkErr(ReleaseWindowGroup, group);
+ }
+ 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(listPtr);
+ break;
+ }
+ }
+ }
+ }
+
+ macWin->grafPtr = NULL;
+
+ /*
+ * Delay deletion of a toplevel data structure untill all children have
+ * been deleted.
+ */
+
+ if (macWin->toplevel->referenceCount == 0) {
+ ckfree(macWin->toplevel);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ /*
+ * 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);
+ }
+
+ display->request++;
+ macWin->winPtr->flags |= TK_MAPPED;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ /*
+ * XXX This should be ShowSheetWindow for kSheetWindowClass
+ * XXX windows that have a wmPtr->master parent set.
+ */
+
+ WindowRef wRef = TkMacOSXDrawableWindow(window);
+
+ if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
+ && (macWin->winPtr->wmInfoPtr->master != None)) {
+ ShowSheetWindow(wRef, TkMacOSXDrawableWindow(
+ macWin->winPtr->wmInfoPtr->master));
+ } else {
+ ShowWindow(wRef);
+ }
+ }
+ TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr);
+
+ /*
+ * 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 {
+ /*
+ * Generate damage for that area of the window.
+ */
+
+ TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ }
+
+ /*
+ * Generate VisibilityNotify events for window and all mapped children.
+ */
+
+ event.xany.send_event = False;
+ event.xany.display = display;
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.state = VisibilityUnobscured;
+ NotifyVisibility(macWin->winPtr, &event);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NotifyVisibility --
+ *
+ * Recursively called helper proc for XMapWindow().
+
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * VisibilityNotify events are queued.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+NotifyVisibility(
+ TkWindow *winPtr,
+ XEvent *eventPtr)
+{
+ if (winPtr->atts.event_mask & VisibilityChangeMask) {
+ eventPtr->xany.serial = LastKnownRequestProcessed(winPtr->display);
+ eventPtr->xvisibility.window = winPtr->window;
+ Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL);
+ }
+ for (winPtr = winPtr->childList; winPtr != NULL;
+ winPtr = winPtr->nextPtr) {
+ if (winPtr->flags & TK_MAPPED) {
+ NotifyVisibility(winPtr, eventPtr);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ display->request++;
+ macWin->winPtr->flags &= ~TK_MAPPED;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsEmbedded(macWin->winPtr) &&
+ macWin->winPtr->wmInfoPtr->hints.initial_state!=IconicState) {
+ /*
+ * XXX This should be HideSheetWindow for kSheetWindowClass
+ * XXX windows that have a wmPtr->master parent set.
+ */
+
+ WindowRef wref = TkMacOSXDrawableWindow(window);
+
+ if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
+ && (macWin->winPtr->wmInfoPtr->master != None)) {
+ HideSheetWindow(wref);
+ } else {
+ HideWindow(wref);
+ }
+ }
+ TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr);
+
+ /*
+ * 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.
+ */
+
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ TkMacOSXInvalClipRgns((Tk_Window) 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;
+
+ display->request++;
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ WindowRef w = TkMacOSXDrawableWindow(window);
+
+ if (w) {
+ Rect bounds;
+
+ ChkErr(GetWindowBounds, w, kWindowContentRgn, &bounds);
+ bounds.right = bounds.left + width;
+ bounds.bottom = bounds.top + height;
+ ChkErr(SetWindowBounds, w, kWindowContentRgn, &bounds);
+ }
+ } else {
+ MoveResizeWindow(macWin);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ display->request++;
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ WindowRef w = TkMacOSXDrawableWindow(window);
+
+ if (w) {
+ Rect bounds;
+
+ bounds.left = x + macWin->winPtr->wmInfoPtr->xInParent;
+ bounds.right = bounds.left + width;
+ bounds.top = y + macWin->winPtr->wmInfoPtr->yInParent;
+ bounds.bottom = bounds.top + height;
+ ChkErr(SetWindowBounds, w, kWindowContentRgn, &bounds);
+ }
+ } else {
+ MoveResizeWindow(macWin);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ display->request++;
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ WindowRef w = TkMacOSXDrawableWindow(window);
+
+ if (w) {
+ ChkErr(MoveWindowStructure, w, x, y);
+ }
+ } else {
+ MoveResizeWindow(macWin);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MoveResizeWindow --
+ *
+ * Helper proc for XResizeWindow, XMoveResizeWindow and XMoveWindow.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+MoveResizeWindow(
+ MacDrawable *macWin)
+{
+ int deltaX = 0, deltaY = 0, parentBorderwidth = 0;
+ MacDrawable *macParent = NULL;
+ CGrafPtr destPort = TkMacOSXGetDrawablePort((Drawable) macWin);
+
+ /*
+ * Find the Parent window, for an embedded window it will be its container.
+ */
+
+ if (Tk_IsEmbedded(macWin->winPtr)) {
+ TkWindow *contWinPtr = TkpGetOtherWindow(macWin->winPtr);
+
+ if (contWinPtr) {
+ macParent = contWinPtr->privatePtr;
+ } else {
+ /*
+ * Here we should handle out of process embedding. 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.
+ */
+ }
+ } else {
+ /*
+ * TODO: update all xOff & yOffs
+ */
+
+ macParent = macWin->winPtr->parentPtr->privatePtr;
+ parentBorderwidth = macWin->winPtr->parentPtr->changes.border_width;
+ }
+
+ if (macParent) {
+ deltaX = macParent->xOff + parentBorderwidth +
+ macWin->winPtr->changes.x - macWin->xOff;
+ deltaY = macParent->yOff + parentBorderwidth +
+ macWin->winPtr->changes.y - macWin->yOff;
+ }
+ if (destPort) {
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ if (macParent) {
+ TkMacOSXInvalClipRgns((Tk_Window) macParent->winPtr);
+ }
+ }
+ UpdateOffsets(macWin->winPtr, deltaX, deltaY);
+ if (destPort) {
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ }
+ GenerateConfigureNotify(macWin->winPtr, 0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateConfigureNotify --
+ *
+ * Generates ConfigureNotify events for all the child widgets of the
+ * widget passed in the winPtr parameter. If includeWin is true, also
+ * generates ConfigureNotify event for the widget itself.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * ConfigureNotify events will be posted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GenerateConfigureNotify(
+ TkWindow *winPtr,
+ int includeWin)
+{
+ TkWindow *childPtr;
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) {
+ continue;
+ }
+ GenerateConfigureNotify(childPtr, 1);
+ }
+ if (includeWin) {
+ TkDoConfigureNotify(winPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+ */
+ }
+}
+
+#if 0
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+ */
+ }
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 actually 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;
+ WindowRef wRef = TkMacOSXDrawableWindow(w);
+
+ if (wRef) {
+ TkMacOSXInvalClipRgns((Tk_Window) winPtr->parentPtr);
+ TkMacOSXWinBounds(winPtr, &bounds);
+ InvalWindowRect(wRef, &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)
+{
+ MacDrawable *macWin;
+
+ if (winPtr == NULL) {
+ return;
+ }
+ macWin = winPtr->privatePtr;
+ if (macWin && macWin->flags & TK_CLIP_INVALID) {
+ TkWindow *win2Ptr;
+
+ if (Tk_IsMapped(winPtr)) {
+ int rgnChanged = 0;
+ CGRect bounds;
+ HIMutableShapeRef rgn;
+
+ /*
+ * Start with a region defined by the window bounds.
+ */
+
+ TkMacOSXWinCGBounds(winPtr, &bounds);
+ rgn = TkMacOSXHIShapeCreateMutableWithRect(&bounds);
+
+ /*
+ * Clip away the area of any windows that may obscure this window.
+ * For a non-toplevel window, first, clip to the parents visible
+ * 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);
+ if (winPtr->parentPtr) {
+ ChkErr(HIShapeIntersect,
+ winPtr->parentPtr->privatePtr->aboveVisRgn,
+ rgn, rgn);
+ }
+ win2Ptr = winPtr;
+ while ((win2Ptr = win2Ptr->nextPtr)) {
+ if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ continue;
+ }
+ TkMacOSXWinCGBounds(win2Ptr, &bounds);
+ ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds);
+ }
+ } else if (Tk_IsEmbedded(winPtr)) {
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr) {
+ TkMacOSXUpdateClipRgn(win2Ptr);
+ ChkErr(HIShapeIntersect,
+ win2Ptr->privatePtr->aboveVisRgn, rgn, rgn);
+ } else if (tkMacOSXEmbedHandler != NULL) {
+ HIShapeRef visRgn;
+
+ TkMacOSXCheckTmpQdRgnEmpty();
+ tkMacOSXEmbedHandler->getClipProc((Tk_Window) winPtr,
+ tkMacOSXtmpQdRgn);
+ visRgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
+ SetEmptyRgn(tkMacOSXtmpQdRgn);
+ ChkErr(HIShapeIntersect, visRgn, rgn, rgn);
+ }
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+ } else if (winPtr->wmInfoPtr->attributes &
+ kWindowResizableAttribute) {
+ HIViewRef growBoxView;
+ OSErr err = HIViewFindByID(HIViewGetRoot(
+ TkMacOSXDrawableWindow(winPtr->window)),
+ kHIViewWindowGrowBoxID, &growBoxView);
+
+ if (err == noErr) {
+ ChkErr(HIViewGetFrame, growBoxView, &bounds);
+ bounds = CGRectOffset(bounds,
+ -winPtr->wmInfoPtr->xInParent,
+ -winPtr->wmInfoPtr->yInParent);
+ ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds);
+ }
+ }
+ macWin->aboveVisRgn = HIShapeCreateCopy(rgn);
+
+ /*
+ * The final clip region is the aboveVis region (or visible region)
+ * minus all the children of this window. If the window is a
+ * container, we must also subtract the region of the embedded
+ * window.
+ */
+
+ win2Ptr = winPtr->childList;
+ while (win2Ptr) {
+ if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ win2Ptr = win2Ptr->nextPtr;
+ continue;
+ }
+ TkMacOSXWinCGBounds(win2Ptr, &bounds);
+ ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds);
+ rgnChanged = 1;
+ win2Ptr = win2Ptr->nextPtr;
+ }
+
+ if (Tk_IsContainer(winPtr)) {
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr) {
+ if (Tk_IsMapped(win2Ptr)) {
+ TkMacOSXWinCGBounds(win2Ptr, &bounds);
+ ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds);
+ rgnChanged = 1;
+ }
+ }
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+ }
+
+ if (rgnChanged) {
+ HIShapeRef diffRgn = HIShapeCreateDifference(
+ macWin->aboveVisRgn, rgn);
+
+ if (!HIShapeIsEmpty(diffRgn)) {
+ macWin->visRgn = HIShapeCreateCopy(rgn);
+ }
+ CFRelease(diffRgn);
+ }
+ CFRelease(rgn);
+ } else {
+ /*
+ * An unmapped window has empty clip regions to prevent any
+ * (erroneous) drawing into it or its children from becoming
+ * visible. [Bug 940117]
+ */
+
+ if (!Tk_IsTopLevel(winPtr)) {
+ TkMacOSXUpdateClipRgn(winPtr->parentPtr);
+ } else if (Tk_IsEmbedded(winPtr)) {
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr) {
+ TkMacOSXUpdateClipRgn(win2Ptr);
+ }
+ }
+ macWin->aboveVisRgn = TkMacOSXHIShapeCreateEmpty();
+ }
+ if (!macWin->visRgn) {
+ macWin->visRgn = HIShapeCreateCopy(macWin->aboveVisRgn);
+ }
+ macWin->flags &= ~TK_CLIP_INVALID;
+
+#ifdef TK_MAC_DEBUG_CLIP_REGIONS
+ TkMacOSXDebugFlashRegion((Drawable) macWin, macWin->visRgn);
+#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXVisableClipRgn --
+ *
+ * This function returnd the Macintosh cliping region for the given
+ * window. A NULL Rgn means the window is not visible.
+ *
+ * Results:
+ * The region.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkRegion
+TkMacOSXVisableClipRgn(
+ TkWindow *winPtr)
+{
+ if (winPtr->privatePtr->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(winPtr);
+ }
+ return (TkRegion)HIShapeCreateMutableCopy(winPtr->privatePtr->visRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ HIShapeRef rgn;
+
+ windowRef = TkMacOSXDrawableWindow((Drawable)macWin);
+ if (macWin->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(macWin->winPtr);
+ }
+ rgn = (flag == TK_WINDOW_ONLY) ? macWin->visRgn : macWin->aboveVisRgn;
+ if (!HIShapeIsEmpty(rgn)) {
+ TkMacOSXCheckTmpQdRgnEmpty();
+ ChkErr(HIShapeGetAsQDRgn, rgn, tkMacOSXtmpQdRgn);
+ InvalWindowRgn(windowRef, tkMacOSXtmpQdRgn);
+ SetEmptyRgn(tkMacOSXtmpQdRgn);
+ }
+#ifdef TK_MAC_DEBUG_CLIP_REGIONS
+ TkMacOSXDebugFlashRegion((Drawable) macWin, rgn);
+#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetDrawableWindow --
+ *
+ * This function returns the WindowRef for a given X drawable.
+ *
+ * Results:
+ * A WindowRef, or NULL for off screen pixmaps.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+WindowRef
+TkMacOSXDrawableWindow(
+ Drawable drawable)
+{
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ WindowRef result = NULL;
+
+ if (!macWin || macWin->flags & TK_IS_PIXMAP) {
+ result = NULL;
+ } else {
+ result = GetWindowFromPort(TkMacOSXGetDrawablePort(drawable));
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void *
+TkMacOSXGetDrawablePort(
+ Drawable drawable)
+{
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ CGrafPtr resultPort = NULL;
+
+ if (!macWin) {
+ return NULL;
+ }
+
+ /*
+ * Handle toplevel windows.
+ */
+
+ if (macWin->toplevel) {
+ TkWindow *contWinPtr;
+
+ if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
+ return macWin->toplevel->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.
+ */
+
+ contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+
+ resultPort = NULL;
+ if (contWinPtr != NULL) {
+ resultPort = TkMacOSXGetDrawablePort((Drawable)
+ contWinPtr->privatePtr);
+ } else if (tkMacOSXEmbedHandler != NULL) {
+ resultPort = tkMacOSXEmbedHandler->getPortProc((Tk_Window)
+ macWin->winPtr);
+ }
+
+ if (!resultPort) {
+ /*
+ * 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.
+ */
+
+ TkMacOSXDbgMsg("Couldn't find container");
+ }
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+
+ return resultPort;
+ }
+
+ if ((macWin->flags & TK_IS_PIXMAP) && !macWin->grafPtr) {
+ AllocGWorld(macWin->size.width, macWin->size.height,
+ macWin->flags & TK_IS_BW_PIXMAP, &macWin->grafPtr);
+ }
+ return macWin->grafPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetRootControl --
+ *
+ * This function returns the Root Control for a given X drawable.
+ *
+ * Results:
+ * A ControlRef .
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void *
+TkMacOSXGetRootControl(
+ Drawable drawable)
+{
+ /*
+ * will probably need to fix this up for embedding
+ */
+
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ TkWindow *contWinPtr;
+
+ if (macWin == NULL) {
+ return NULL;
+ }
+
+ if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
+ return macWin->toplevel->rootControl;
+ }
+
+ contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+ if (contWinPtr == NULL) {
+ return NULL;
+ }
+
+ return TkMacOSXGetRootControl((Drawable) contWinPtr->privatePtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 affect 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(
+ Tk_Window tkwin)
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *childPtr;
+ MacDrawable *macWin = winPtr->privatePtr;
+
+ /*
+ * If already marked we can stop because all descendants will also already
+ * be marked.
+ */
+
+ if (!macWin || macWin->flags & TK_CLIP_INVALID) {
+ return;
+ }
+
+ macWin->flags |= TK_CLIP_INVALID;
+ if (macWin->visRgn) {
+ CFRelease(macWin->visRgn);
+ macWin->visRgn = NULL;
+ }
+ if (macWin->aboveVisRgn) {
+ CFRelease(macWin->aboveVisRgn);
+ macWin->aboveVisRgn = NULL;
+ }
+
+ /*
+ * Invalidate clip regions for all children & their descendants, unless the
+ * child is a toplevel.
+ */
+
+ childPtr = winPtr->childList;
+ while (childPtr) {
+ if (!Tk_IsTopLevel(childPtr)) {
+ TkMacOSXInvalClipRgns((Tk_Window) childPtr);
+ }
+ childPtr = childPtr->nextPtr;
+ }
+
+ /*
+ * Also, if the window is a container, mark its embedded window.
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+
+ if (childPtr) {
+ TkMacOSXInvalClipRgns((Tk_Window) childPtr);
+ }
+
+ /*
+ * TODO: 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,
+ void *b)
+{
+ Rect *bounds = b;
+ bounds->left = winPtr->privatePtr->xOff;
+ bounds->top = winPtr->privatePtr->yOff;
+ bounds->right = bounds->left + winPtr->changes.width;
+ bounds->bottom = bounds->top + winPtr->changes.height;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXWinCGBounds --
+ *
+ * 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
+TkMacOSXWinCGBounds(
+ TkWindow *winPtr,
+ CGRect *bounds)
+{
+ bounds->origin.x = winPtr->privatePtr->xOff;
+ bounds->origin.y = winPtr->privatePtr->yOff;
+ bounds->size.width = winPtr->changes.width;
+ bounds->size.height = 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 haven'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);
+ }
+
+ /*
+ * TODO: 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. */
+{
+ MacDrawable *macPix;
+
+ if (display != NULL) {
+ display->request++;
+ }
+ macPix = ckalloc(sizeof(MacDrawable));
+ macPix->winPtr = NULL;
+ macPix->xOff = 0;
+ macPix->yOff = 0;
+ macPix->visRgn = NULL;
+ macPix->aboveVisRgn = NULL;
+ macPix->drawRect = CGRectNull;
+ macPix->referenceCount = 0;
+ macPix->toplevel = NULL;
+ macPix->flags = TK_IS_PIXMAP | (depth == 1 ? TK_IS_BW_PIXMAP : 0);
+ macPix->grafPtr = NULL;
+ macPix->context = NULL;
+ macPix->size = CGSizeMake(width, height);
+ AllocGWorld(width, height, depth==1, &macPix->grafPtr);
+
+ 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;
+
+ display->request++;
+ if (macPix->grafPtr) {
+ DisposeGWorld(macPix->grafPtr);
+ }
+ if (macPix->context) {
+ TkMacOSXDbgMsg("Cannot free CG backed Pixmap");
+ }
+ ckfree(macPix);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/carbon/tkMacOSXTest.c b/carbon/tkMacOSXTest.c
new file mode 100644
index 0000000..d8e8aca
--- /dev/null
+++ b/carbon/tkMacOSXTest.c
@@ -0,0 +1,80 @@
+/*
+ * tkMacOSXTest.c --
+ *
+ * Contains commands for platform specific tests for
+ * the Macintosh platform.
+ *
+ * Copyright (c) 1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXInt.h"
+
+/*
+ * Forward declarations of procedures defined later in this file:
+ */
+
+static int DebuggerCmd (ClientData dummy, Tcl_Interp *interp,
+ int argc, const 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. */
+ const char **argv) /* Not used. */
+{
+ Debugger();
+ return TCL_OK;
+}
diff --git a/carbon/tkMacOSXWindowEvent.c b/carbon/tkMacOSXWindowEvent.c
new file mode 100644
index 0000000..2f46026
--- /dev/null
+++ b/carbon/tkMacOSXWindowEvent.c
@@ -0,0 +1,985 @@
+/*
+ * tkMacOSXWindowEvent.c --
+ *
+ * This file defines the routines for both creating and handling Window
+ * Manager class events for Tk.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXPrivate.h"
+#include "tkMacOSXWm.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_CLIP_REGIONS
+#endif
+*/
+
+/*
+ * Declaration of functions used only in this file
+ */
+
+static int GenerateUpdateEvent(Window window);
+static int GenerateUpdates(HIMutableShapeRef updateRgn,
+ CGRect *updateBounds, TkWindow *winPtr);
+static int GenerateActivateEvents(Window window, int activeFlag);
+static void ClearPort(CGrafPtr port, HIShapeRef updateRgn);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessApplicationEvent --
+ *
+ * This processes Application level events, mainly activate and
+ * deactivate.
+ *
+ * Results:
+ * 0.
+ *
+ * Side effects:
+ * Hide or reveal floating windows.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessApplicationEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ Tcl_CmdInfo dummy;
+
+ /*
+ * This is a bit of a hack. We get "show" events both when we come back
+ * from being hidden, and whenever we are activated. I only want to run
+ * the "show" proc when we have been hidden already, not as a substitute
+ * for <Activate>. So I use this toggle...
+ */
+
+ static int toggleHide = 0;
+
+ switch (eventPtr->eKind) {
+ case kEventAppActivated:
+ ShowFloatingWindows();
+ break;
+ case kEventAppDeactivated:
+ TkSuspendClipboard();
+ HideFloatingWindows();
+ break;
+ case kEventAppQuit:
+ statusPtr->stopProcessing = 1;
+ break;
+ case kEventAppHidden:
+ if (toggleHide == 0) {
+ toggleHide = 1;
+ if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp,
+ "::tk::mac::OnHide", &dummy)) {
+ Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnHide");
+ }
+ }
+ statusPtr->stopProcessing = 1;
+ break;
+ case kEventAppShown:
+ if (toggleHide == 1) {
+ toggleHide = 0;
+ if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp,
+ "::tk::mac::OnShow", &dummy)) {
+ Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnShow");
+ }
+ }
+ statusPtr->stopProcessing = 1;
+ break;
+ case kEventAppAvailableWindowBoundsChanged: {
+ static UInt32 prevId = 0;
+ UInt32 id;
+ OSStatus err;
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamTransactionID, typeUInt32, NULL, sizeof(id), NULL,
+ &id);
+ if (err != noErr || id != prevId) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+
+ prevId = id;
+ TkMacOSXDisplayChanged(dispPtr->display);
+ }
+ /*
+ * Should we call ::tk::mac::OnDisplayChanged?
+ */
+ break;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessAppearanceEvent --
+ *
+ * This processes Appearance events.
+ *
+ * Results:
+ * 0.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessAppearanceEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ switch (eventPtr->eKind) {
+ case kEventAppearanceScrollBarVariantChanged:
+ TkMacOSXInitScrollbarMetrics();
+ break;
+ default:
+ 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXProcessWindowEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ OSStatus err;
+ WindowRef whichWindow;
+ Window window;
+ int eventFound = false;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+
+ switch (eventPtr->eKind) {
+ case kEventWindowActivated:
+ case kEventWindowDeactivated:
+ case kEventWindowUpdate:
+ case kEventWindowExpanding:
+ case kEventWindowBoundsChanged:
+ case kEventWindowDragStarted:
+ case kEventWindowDragCompleted:
+ case kEventWindowConstrain:
+ case kEventWindowGetRegion:
+ case kEventWindowDrawContent:
+ break;
+ default:
+ return 0;
+ break;
+ }
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamDirectObject, typeWindowRef, NULL, sizeof(whichWindow),
+ NULL, &whichWindow);
+ if (err != noErr) {
+ return 0;
+ }
+
+ window = TkMacOSXGetXWindow(whichWindow);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+
+ switch (eventPtr->eKind) {
+ case kEventWindowActivated:
+ case kEventWindowDeactivated:
+ if (window != None) {
+ int activate = (eventPtr->eKind == kEventWindowActivated);
+
+ eventFound |= GenerateActivateEvents(window, activate);
+ eventFound |= TkMacOSXGenerateFocusEvent(window, activate);
+ if (winPtr) {
+ TkMacOSXEnterExitFullscreen(winPtr, activate);
+ }
+ statusPtr->stopProcessing = 1;
+ }
+ break;
+ case kEventWindowUpdate:
+ if (window != None && GenerateUpdateEvent(window)) {
+ eventFound = true;
+ statusPtr->stopProcessing = 1;
+ }
+ break;
+ case kEventWindowExpanding:
+ if (winPtr) {
+ winPtr->wmInfoPtr->hints.initial_state =
+ TkMacOSXIsWindowZoomed(winPtr) ? ZoomState : NormalState;
+ Tk_MapWindow((Tk_Window) winPtr);
+
+ /*
+ * Need to process all Tk events generated by Tk_MapWindow()
+ * before returning to ensure all children are mapped, as
+ * otherwise the Activate event that follows Expanding would not
+ * be processed by any unmapped children.
+ */
+
+ while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {/*empty body*/};
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {/*empty body*/};
+ }
+ break;
+ case kEventWindowBoundsChanged:
+ if (winPtr) {
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ UInt32 attr;
+ Rect bounds;
+ int x = -1, y = -1, width = -1, height = -1, flags = 0;
+
+ ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamAttributes, typeUInt32, NULL, sizeof(attr),
+ NULL, &attr);
+ ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamCurrentBounds, typeQDRectangle, NULL,
+ sizeof(bounds), NULL, &bounds);
+ if (attr & kWindowBoundsChangeOriginChanged) {
+ x = bounds.left - wmPtr->xInParent;
+ y = bounds.top - wmPtr->yInParent;
+ flags |= TK_LOCATION_CHANGED;
+ }
+ if (attr & kWindowBoundsChangeSizeChanged) {
+ width = bounds.right - bounds.left;
+ height = bounds.bottom - bounds.top;
+ flags |= TK_SIZE_CHANGED;
+ }
+ TkMacOSXInvalClipRgns((Tk_Window) winPtr);
+ TkMacOSXInvalidateWindow((MacDrawable*) window, TK_PARENT_WINDOW);
+ TkGenWMConfigureEvent((Tk_Window)winPtr, x, y, width, height,
+ flags);
+ if (attr & kWindowBoundsChangeUserResize ||
+ attr & kWindowBoundsChangeUserDrag) {
+ TkMacOSXRunTclEventLoop();
+ }
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ HIViewRef growBoxView;
+
+ err = HIViewFindByID(HIViewGetRoot(whichWindow),
+ kHIViewWindowGrowBoxID, &growBoxView);
+ if (err == noErr) {
+ ChkErr(HIViewSetNeedsDisplay, growBoxView, true);
+ }
+ }
+ }
+ break;
+ case kEventWindowDragStarted:
+ if (!(TkMacOSXModifierState() & cmdKey)) {
+ TkMacOSXBringWindowForward(whichWindow);
+ }
+ TkMacOSXTrackingLoop(1);
+ break;
+ case kEventWindowDragCompleted: {
+ Rect maxBounds, bounds, strWidths;
+ int h = 0, v = 0;
+
+ TkMacOSXTrackingLoop(0);
+ ChkErr(GetWindowGreatestAreaDevice, whichWindow, kWindowDragRgn, NULL,
+ &maxBounds);
+ ChkErr(GetWindowBounds, whichWindow, kWindowStructureRgn, &bounds);
+ ChkErr(GetWindowStructureWidths, whichWindow, &strWidths);
+ if (bounds.left > maxBounds.right - strWidths.left) {
+ h = maxBounds.right - (strWidths.left ? strWidths.left : 40)
+ - bounds.left;
+ } else if (bounds.right < maxBounds.left + strWidths.right) {
+ h = maxBounds.left + (strWidths.right ? strWidths.right : 40)
+ - bounds.right;
+ }
+ if (bounds.top > maxBounds.bottom - strWidths.top) {
+ v = maxBounds.bottom - (strWidths.top ? strWidths.top : 40)
+ - bounds.top;
+ } else if (bounds.bottom < maxBounds.top + strWidths.bottom) {
+ v = maxBounds.top + (strWidths.bottom ? strWidths.bottom : 40)
+ - bounds.bottom;
+ } else if (strWidths.top && bounds.top < maxBounds.top) {
+ v = maxBounds.top - bounds.top;
+ }
+ if (h || v) {
+ OffsetRect(&bounds, h, v);
+ ChkErr(SetWindowBounds, whichWindow, kWindowStructureRgn,&bounds);
+ }
+ break;
+ }
+ case kEventWindowConstrain:
+ if (winPtr && (winPtr->wmInfoPtr->flags & WM_FULLSCREEN) &&
+ TkMacOSXMakeFullscreen(winPtr,whichWindow,1,NULL) == TCL_OK) {
+ statusPtr->stopProcessing = 1;
+ }
+ break;
+ case kEventWindowGetRegion:
+ if (winPtr && (winPtr->wmInfoPtr->flags & WM_TRANSPARENT)) {
+ WindowRegionCode code;
+
+ statusPtr->stopProcessing = (CallNextEventHandler(
+ eventPtr->callRef, eventPtr->eventRef) == noErr);
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamWindowRegionCode, typeWindowRegionCode, NULL,
+ sizeof(code), NULL, &code);
+ if (err == noErr && code == kWindowOpaqueRgn) {
+ RgnHandle rgn;
+
+ err = ChkErr(GetEventParameter, eventPtr->eventRef,
+ kEventParamRgnHandle, typeQDRgnHandle, NULL,
+ sizeof(rgn), NULL, &rgn);
+ if (err == noErr) {
+ SetEmptyRgn(rgn);
+ statusPtr->stopProcessing = 1;
+ }
+ }
+ }
+ break;
+ case kEventWindowDrawContent:
+ if (winPtr && (winPtr->wmInfoPtr->flags & WM_TRANSPARENT)) {
+ CGrafPtr port;
+
+ GetPort(&port);
+ ClearPort(port, NULL);
+ }
+ break;
+ }
+
+ return eventFound;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateUpdateEvent --
+ *
+ * Given a Macintosh window update event this function generates all the
+ * Expose XEvents 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;
+ int result = 0;
+ CGRect updateBounds;
+ HIShapeRef rgn;
+ HIMutableShapeRef updateRgn;
+ int dx, dy;
+
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
+
+ if (winPtr ==NULL ){
+ return result;
+ }
+ macWindow = TkMacOSXDrawableWindow(window);
+ TK_IF_MAC_OS_X_API (5, HIWindowCopyShape,
+ ChkErr(HIWindowCopyShape, macWindow, kWindowUpdateRgn,
+ kHICoordSpaceWindow, &rgn);
+ dx = -winPtr->wmInfoPtr->xInParent;
+ dy = -winPtr->wmInfoPtr->yInParent;
+ ) TK_ELSE_MAC_OS_X (5,
+ Rect bounds;
+
+ TkMacOSXCheckTmpQdRgnEmpty();
+ ChkErr(GetWindowRegion, macWindow, kWindowUpdateRgn, tkMacOSXtmpQdRgn);
+ rgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
+ SetEmptyRgn(tkMacOSXtmpQdRgn);
+ ChkErr(GetWindowBounds, macWindow, kWindowContentRgn, &bounds);
+ dx = -bounds.left;
+ dy = -bounds.top;
+ ) TK_ENDIF;
+
+ updateRgn = HIShapeCreateMutableCopy(rgn);
+ CFRelease(rgn);
+ ChkErr(HIShapeOffset, updateRgn, dx, dy);
+ HIShapeGetBounds(updateRgn, &updateBounds);
+#ifdef TK_MAC_DEBUG_CLIP_REGIONS
+ TkMacOSXDebugFlashRegion(window, updateRgn);
+#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
+ BeginUpdate(macWindow);
+ if (winPtr->wmInfoPtr->flags & WM_TRANSPARENT) {
+ ClearPort(TkMacOSXGetDrawablePort(window), updateRgn);
+ }
+ result = GenerateUpdates(updateRgn, &updateBounds, winPtr);
+ EndUpdate(macWindow);
+ CFRelease(updateRgn);
+ if (result) {
+ /*
+ * Ensure there are no pending idle-time redraws that could prevent
+ * the just posted Expose events from generating new redraws.
+ */
+
+ Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT);
+ }
+ return result;
+ }
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateUpdates --
+ *
+ * Given a Macintosh update region and a Tk window this function geneates
+ * a X Expose event for the window if it is within the update region. The
+ * function will then recursivly have each damaged window generate Expose
+ * events for its child windows.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GenerateUpdates(
+ HIMutableShapeRef updateRgn,
+ CGRect *updateBounds,
+ TkWindow *winPtr)
+{
+ TkWindow *childPtr;
+ XEvent event;
+ CGRect bounds, damageBounds;
+ HIShapeRef boundsRgn, damageRgn;
+
+ TkMacOSXWinCGBounds(winPtr, &bounds);
+ if (!CGRectIntersectsRect(bounds, *updateBounds)) {
+ return 0;
+ }
+ TK_IF_MAC_OS_X_API (4, HIShapeIntersectsRect,
+ if (!HIShapeIntersectsRect(updateRgn, &bounds)) {
+ return 0;
+ }
+ ) TK_ENDIF
+
+ /*
+ * Compute the bounding box of the area that the damage occured in.
+ */
+
+ boundsRgn = HIShapeCreateWithRect(&bounds);
+ damageRgn = HIShapeCreateIntersection(updateRgn, boundsRgn);
+ if (HIShapeIsEmpty(damageRgn)) {
+ CFRelease(damageRgn);
+ CFRelease(boundsRgn);
+ return 0;
+ }
+ HIShapeGetBounds(damageRgn, &damageBounds);
+ ChkErr(TkMacOSHIShapeUnion, boundsRgn, updateRgn, updateRgn);
+ HIShapeGetBounds(updateRgn, updateBounds);
+ CFRelease(damageRgn);
+ CFRelease(boundsRgn);
+
+ 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;
+ event.xexpose.x = damageBounds.origin.x - bounds.origin.x;
+ event.xexpose.y = damageBounds.origin.y - bounds.origin.y;
+ event.xexpose.width = damageBounds.size.width;
+ event.xexpose.height = damageBounds.size.height;
+ 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, updateBounds, childPtr);
+ }
+
+ /*
+ * Generate updates for any contained windows
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+ if (childPtr != NULL && Tk_IsMapped(childPtr)) {
+ GenerateUpdates(updateRgn, updateBounds, childPtr);
+ }
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+ }
+
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGenerateFocusEvent --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXGenerateFocusEvent(
+ 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;
+ }
+
+ /*
+ * Don't send focus events to windows of class help or to windows with the
+ * kWindowNoActivatesAttribute.
+ */
+
+ if (((TkWindow *)tkwin)->wmInfoPtr->macClass == kHelpWindowClass ||
+ ((TkWindow *)tkwin)->wmInfoPtr->attributes &
+ kWindowNoActivatesAttribute) {
+ 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)) {
+ x = Tk_X(tkwin);
+ y = Tk_Y(tkwin);
+ }
+ if (!(flags & TK_SIZE_CHANGED)) {
+ width = Tk_Width(tkwin);
+ height = Tk_Height(tkwin);
+ }
+ event.xconfigure.x = x;
+ event.xconfigure.y = y;
+ event.xconfigure.width = width;
+ event.xconfigure.height = height;
+
+ 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) && !(wmPtr->flags & WM_SYNC_PENDING) &&
+ ((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
+ * visible to the subwindow.
+ */
+
+ winPtr->changes.x = x;
+ winPtr->changes.y = y;
+ winPtr->changes.width = width;
+ winPtr->changes.height = height;
+ TkMacOSXInvalClipRgns(tkwin);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(protPtr);
+ interp = protPtr->interp;
+ Tcl_Preserve(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)");
+ Tcl_BackgroundException(interp, result);
+ }
+ Tcl_Release(interp);
+ Tcl_Release(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)
+{
+ OSStatus err;
+ ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess};
+ Boolean isFrontProcess = true;
+
+ err = ChkErr(GetFrontProcess, &frontPsn);
+ if (err == noErr) {
+ ChkErr(SameProcess, &frontPsn, &ourPsn, &isFrontProcess);
+ }
+
+ return (isFrontProcess == true);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ClearPort --
+ *
+ * Clear (i.e. fill with transparent color) the given port.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ClearPort(
+ CGrafPtr port,
+ HIShapeRef updateRgn)
+{
+ CGContextRef context;
+ Rect bounds;
+ CGRect rect;
+
+ GetPortBounds(port, &bounds);
+ QDBeginCGContext(port, &context);
+ SyncCGContextOriginWithPort(context, port);
+ CGContextConcatCTM(context, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0,
+ bounds.bottom - bounds.top));
+ if (updateRgn) {
+ ChkErr(HIShapeReplacePathInCGContext, updateRgn, context);
+ CGContextEOClip(context);
+ }
+ rect = CGRectMake(0, 0, bounds.right, bounds.bottom);
+ CGContextClearRect(context, rect);
+ QDEndCGContext(port, &context);
+}
+
+/*
+ * Local Variables:
+ * fill-column: 78
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/carbon/tkMacOSXWm.c b/carbon/tkMacOSXWm.c
new file mode 100644
index 0000000..0ec8d74
--- /dev/null
+++ b/carbon/tkMacOSXWm.c
@@ -0,0 +1,6495 @@
+/*
+ * 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.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkScrollbar.h"
+#include "tkMacOSXWm.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_WINDOWS
+#endif
+*/
+
+/*
+ * Data for [wm attributes] command:
+ */
+typedef enum {
+ WMATT_ALPHA, WMATT_FULLSCREEN, WMATT_MODIFIED, WMATT_NOTIFY,
+ WMATT_TITLEPATH, WMATT_TOPMOST, WMATT_TRANSPARENT,
+ _WMATT_LAST_ATTRIBUTE
+} WmAttribute;
+
+static const char *const WmAttributeNames[] = {
+ "-alpha", "-fullscreen", "-modified", "-notify",
+ "-titlepath", "-topmost", "-transparent",
+ NULL
+};
+
+/*
+ * 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(ClientData dummy, Tk_Window tkwin);
+
+static const Tk_GeomMgr wmMgrType = {
+ "wm", /* name */
+ TopLevelReqProc, /* requestProc */
+ NULL, /* lostSlaveProc */
+};
+
+/*
+ * The following keeps state for Aqua dock icon bounce notification.
+ */
+
+static int tkMacOSXWmAttrNotifyVal = 0;
+
+/*
+ * 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(TkWindow *winPtr,
+ WindowRef macWindow, Rect *geometry);
+static int ParseGeometry(Tcl_Interp *interp, char *string,
+ TkWindow *winPtr);
+static void TopLevelEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void WmStackorderToplevelWrapperMap(TkWindow *winPtr,
+ Display *display, Tcl_HashTable *table);
+static void UpdateGeometryInfo(ClientData clientData);
+static void UpdateSizeHints(TkWindow *winPtr);
+static void UpdateVRootGeometry(WmInfo *wmPtr);
+static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmColormapwindowsCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmOverrideredirectCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr);
+static int WmWinStyle(Tcl_Interp *interp, TkWindow *winPtr,
+ int objc, Tcl_Obj *const objv[]);
+static void ApplyWindowClassAttributeChanges(TkWindow *winPtr,
+ WindowRef macWindow, WindowClass oldClass,
+ WindowAttributes oldAttributes, int create);
+static void ApplyMasterOverrideChanges(TkWindow *winPtr,
+ WindowRef macWindow);
+static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr);
+static void GetMinSize(TkWindow *winPtr, int *minWidthPtr,
+ int *minHeightPtr);
+static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr,
+ int *maxHeightPtr);
+static void RemapWindows(TkWindow *winPtr,
+ MacDrawable *parentWin);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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 = 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;
+ 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;
+ 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->configX = 0;
+ wmPtr->configY = 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
+ | kWindowLiveResizeAttribute;
+ 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, 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;
+
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ wmPtr->flags &= ~WM_NEVER_MAPPED;
+
+ /*
+ * Create the underlying Mac window for this Tk window.
+ */
+
+ if (!TkMacOSXHostToplevelExists(winPtr)) {
+ TkMacOSXMakeRealWindowExist(winPtr);
+ }
+
+ /*
+ * Generate configure event when we first map the window.
+ */
+
+ TkGenWMConfigureEvent((Tk_Window) winPtr, wmPtr->x, wmPtr->y, -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, winPtr);
+ }
+ UpdateGeometryInfo(winPtr);
+ wmPtr->flags &= ~WM_ABOUT_TO_MAP;
+
+ /*
+ * Map the window.
+ */
+
+ XMapWindow(winPtr->display, winPtr->window);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
+ 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(protPtr, TCL_DYNAMIC);
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree(wmPtr->cmdArgv);
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree(wmPtr->clientMachine);
+ }
+ if (wmPtr->flags & WM_UPDATE_PENDING) {
+ Tk_CancelIdleCall(UpdateGeometryInfo, winPtr);
+ }
+ ckfree(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 *const optionStrings[] = {
+ "aspect", "attributes", "client", "colormapwindows",
+ "command", "deiconify", "focusmodel", "forget",
+ "frame", "geometry", "grid", "group",
+ "iconbitmap", "iconify", "iconmask", "iconname",
+ "iconphoto", "iconposition", "iconwindow",
+ "manage", "maxsize", "minsize", "overrideredirect",
+ "positionfrom", "protocol", "resizable", "sizefrom",
+ "stackorder", "state", "title", "transient",
+ "withdraw", NULL };
+ enum options {
+ WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET,
+ WMOPT_FRAME, WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP,
+ WMOPT_ICONBITMAP, WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME,
+ WMOPT_ICONPHOTO, WMOPT_ICONPOSITION, WMOPT_ICONWINDOW,
+ WMOPT_MANAGE, 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)
+ && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't a top-level window", 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_FORGET:
+ return WmForgetCmd(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_ICONPHOTO:
+ return WmIconphotoCmd(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_MANAGE:
+ return WmManageCmd(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(
+ 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmSetAttribute --
+ *
+ * Helper routine for WmAttributesCmd. Sets the value of the specified
+ * attribute.
+ *
+ * Returns:
+ *
+ * TCL_OK if successful, TCL_ERROR otherwise. In case of an error, leaves
+ * a message in the interpreter's result.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WmSetAttribute(
+ TkWindow *winPtr, /* Toplevel to work with */
+ WindowRef macWindow,
+ Tcl_Interp *interp, /* Current interpreter */
+ WmAttribute attribute, /* Code of attribute to set */
+ Tcl_Obj *value) /* New value */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int boolean;
+
+ switch (attribute) {
+ case WMATT_ALPHA: {
+ double dval;
+
+ if (Tcl_GetDoubleFromObj(interp, value, &dval) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * The user should give (transparent) 0 .. 1.0 (opaque)
+ */
+
+ if (dval < 0.0) {
+ dval = 0.0;
+ } else if (dval > 1.0) {
+ dval = 1.0;
+ }
+ ChkErr(SetWindowAlpha, macWindow, dval);
+ break;
+ }
+ case WMATT_FULLSCREEN:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_FULLSCREEN) != 0)) {
+ if (TkMacOSXMakeFullscreen(winPtr, macWindow, boolean, interp)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ }
+ break;
+ case WMATT_MODIFIED:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != IsWindowModified(macWindow)) {
+ ChkErr(SetWindowModified, macWindow, boolean);
+ }
+ break;
+ case WMATT_NOTIFY:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean == !tkMacOSXWmAttrNotifyVal) {
+ static NMRec notifyRec;
+
+ if (boolean) {
+ bzero(&notifyRec, sizeof(notifyRec));
+ notifyRec.qType = nmType;
+ notifyRec.nmMark = 1;
+ ChkErr(NMInstall, &notifyRec);
+ } else {
+ ChkErr(NMRemove, &notifyRec);
+ }
+ tkMacOSXWmAttrNotifyVal = boolean;
+ }
+ break;
+ case WMATT_TITLEPATH: {
+ const char *path = Tcl_FSGetNativePath(value);
+ OSStatus err;
+
+ if (path && *path) {
+ FSRef ref;
+ Boolean d;
+
+ err = ChkErr(FSPathMakeRef, (const unsigned char*)path, &ref, &d);
+ if (err == noErr) {
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
+ err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref);
+ ) TK_ELSE_MAC_OS_X (4,
+ AliasHandle alias;
+
+ err = ChkErr(FSNewAlias, NULL, &ref, &alias);
+ if (err == noErr) {
+ err = ChkErr(SetWindowProxyAlias, macWindow, alias);
+ DisposeHandle((Handle) alias);
+ }
+ ) TK_ENDIF
+ }
+ } else {
+ int len;
+
+ Tcl_GetStringFromObj(value, &len);
+ if (!len) {
+ err = ChkErr(RemoveWindowProxy, macWindow);
+ } else {
+ err = fnfErr;
+ }
+ }
+ if (err != noErr) {
+ return TCL_ERROR;
+ }
+ break;
+ }
+ case WMATT_TOPMOST:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) {
+ WindowGroupRef group;
+
+ if (boolean) {
+ wmPtr->flags |= WM_TOPMOST;
+ } else {
+ wmPtr->flags &= ~WM_TOPMOST;
+ }
+ group = WmGetWindowGroup(winPtr);
+ if (group && group != GetWindowGroup(macWindow)) {
+ ChkErr(SetWindowGroup, macWindow, group);
+ }
+ }
+ break;
+ case WMATT_TRANSPARENT:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
+ WindowAttributes oldAttributes = wmPtr->attributes;
+
+ if (boolean) {
+ wmPtr->flags |= WM_TRANSPARENT;
+ wmPtr->attributes |= kWindowNoShadowAttribute;
+ TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures,
+ UInt32 features;
+
+ ChkErr(GetWindowFeatures, macWindow, &features);
+ if (features & kWindowIsOpaque) {
+ ChkErr(HIWindowChangeFeatures, macWindow, 0,
+ kWindowIsOpaque);
+ }
+ ) TK_ENDIF
+ } else {
+ wmPtr->flags &= ~WM_TRANSPARENT;
+ wmPtr->attributes &= ~kWindowNoShadowAttribute;
+ }
+ ApplyWindowClassAttributeChanges(winPtr, macWindow,
+ wmPtr->macClass, oldAttributes, 1);
+ ChkErr(ReshapeCustomWindow, macWindow);
+ TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
+ TK_PARENT_WINDOW);
+ }
+ break;
+ case _WMATT_LAST_ATTRIBUTE:
+ default:
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGetAttribute --
+ *
+ * Helper routine for WmAttributesCmd. Returns the current value of the
+ * specified attribute.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+WmGetAttribute(
+ TkWindow *winPtr, /* Toplevel to work with */
+ WindowRef macWindow,
+ WmAttribute attribute) /* Code of attribute to get */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tcl_Obj *result = NULL;
+
+ switch (attribute) {
+ case WMATT_ALPHA: {
+ float fval = 1.0;
+
+ ChkErr(GetWindowAlpha, macWindow, &fval);
+ result = Tcl_NewDoubleObj(fval);
+ break;
+ }
+ case WMATT_FULLSCREEN:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN);
+ break;
+ case WMATT_MODIFIED:
+ result = Tcl_NewBooleanObj(IsWindowModified(macWindow));
+ break;
+ case WMATT_NOTIFY:
+ result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal);
+ break;
+ case WMATT_TITLEPATH: {
+ FSRef ref;
+ UInt8 path[PATH_MAX+1];
+ OSStatus err;
+
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
+ err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref);
+ ) TK_ELSE_MAC_OS_X (4,
+ Boolean wasChanged;
+ AliasHandle alias;
+
+ err = ChkErr(GetWindowProxyAlias, macWindow, &alias);
+ if (err == noErr) {
+ err = ChkErr(FSResolveAlias, NULL, alias, &ref, &wasChanged);
+ }
+ ) TK_ENDIF
+ if (err == noErr) {
+ err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX);
+ }
+ if (err != noErr) {
+ *path = 0;
+ }
+ result = Tcl_NewStringObj((char*) path, -1);
+ break;
+ }
+ case WMATT_TOPMOST:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST);
+ break;
+ case WMATT_TRANSPARENT:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT);
+ break;
+ case _WMATT_LAST_ATTRIBUTE:
+ default:
+ break;
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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 attribute = 0;
+ WindowRef macWindow;
+
+ if (winPtr->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ }
+ if (!TkMacOSXHostToplevelExists(winPtr)) {
+ TkMacOSXMakeRealWindowExist(winPtr);
+ }
+ macWindow = TkMacOSXDrawableWindow(winPtr->window);
+
+ if (objc == 3) { /* wm attributes $win */
+ Tcl_Obj *result = Tcl_NewListObj(0,0);
+
+ for (attribute = 0; attribute < _WMATT_LAST_ATTRIBUTE; ++attribute) {
+ Tcl_ListObjAppendElement(interp, result,
+ Tcl_NewStringObj(WmAttributeNames[attribute], -1));
+ Tcl_ListObjAppendElement(interp, result,
+ WmGetAttribute(winPtr, macWindow, attribute));
+ }
+ Tcl_SetObjResult(interp, result);
+ } else if (objc == 4) { /* wm attributes $win -attribute */
+ if (Tcl_GetIndexFromObj(interp, objv[3], WmAttributeNames,
+ "attribute", 0, &attribute) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, WmGetAttribute(winPtr, macWindow, attribute));
+ } else if ((objc - 3) % 2 == 0) { /* wm attributes $win -att value... */
+ int i;
+
+ for (i = 3; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], WmAttributeNames,
+ "attribute", 0, &attribute) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (WmSetAttribute(winPtr, macWindow, interp, attribute, objv[i+1])
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ }
+ } else {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-attribute ?value ...??");
+ 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(
+ 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(wmPtr->clientMachine);
+ wmPtr->clientMachine = NULL;
+ }
+ return TCL_OK;
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree(wmPtr->clientMachine);
+ }
+ wmPtr->clientMachine = ckalloc(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(
+ 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 = ckalloc((windowObjc+1) * sizeof(TkWindow*));
+ for (i = 0; i < windowObjc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
+ (Tk_Window *) &winPtr2) != TCL_OK) {
+ ckfree(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(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(
+ 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) {
+ argv3 = Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv);
+ Tcl_SetResult(interp, argv3, TCL_VOLATILE);
+ ckfree(argv3);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (argv3[0] == 0) {
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree(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(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(
+ 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), NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
+ ": it is an embedded window", NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, TkMacOSXIsWindowZoomed(winPtr) ?
+ ZoomState : 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(
+ 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 *const optionStrings[] = {
+ "active", "passive", 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmForgetCmd --
+ *
+ * This procedure is invoked to process the "wm forget" 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
+WmForgetCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+#if 1
+ Tcl_AppendResult(interp, "wm forget is not yet supported", NULL);
+ return TCL_ERROR;
+#else
+ register Tk_Window frameWin = (Tk_Window)winPtr;
+ char *oldClass = (char*)Tk_Class(frameWin);
+
+ if (Tk_IsTopLevel(frameWin)) {
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+ CGrafPtr destPort = TkMacOSXGetDrawablePort(winPtr->window);
+
+ TkFocusJoin(winPtr);
+ Tk_UnmapWindow(frameWin);
+
+ if (destPort != NULL) {
+ WindowRef winRef = GetWindowFromPort(destPort);
+
+ TkMacOSXUnregisterMacWindow(winRef);
+ DisposeWindow(winRef);
+ }
+ macWin->grafPtr = NULL;
+ macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
+ macWin->flags &= ~TK_HOST_EXISTS;
+
+ RemapWindows(winPtr, macWin);
+ TkWmDeadWindow(winPtr);
+ winPtr->flags &=
+ ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+
+ TkMapTopFrame(frameWin);
+ } else {
+ /* Already not managed by wm - ignore it */
+ }
+ return TCL_OK;
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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) 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(
+ 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(
+ 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(
+ 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(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(
+ 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 *str;
+ int len;
+
+ 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;
+ }
+ str = Tcl_GetStringFromObj(objv[3], &len);
+ if (winPtr->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ }
+ if (!TkMacOSXHostToplevelExists(winPtr)) {
+ TkMacOSXMakeRealWindowExist(winPtr);
+ }
+ if (WmSetAttribute(winPtr, TkMacOSXDrawableWindow(winPtr->window), interp,
+ WMATT_TITLEPATH, objv[3]) == TCL_OK) {
+ if (!len) {
+ 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(str));
+ 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(
+ 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", NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->master != None) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", 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), NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an embedded window", 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(
+ 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(
+ 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) {
+ if (wmPtr->iconName != NULL) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(wmPtr->iconName, -1));
+ }
+ return TCL_OK;
+ }
+
+ if (wmPtr->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc(length + 1);
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconphotoCmd --
+ *
+ * This procedure is invoked to process the "wm iconphoto" Tcl command.
+ * See the user documentation for details on what it does. Not yet
+ * implemented for OS X.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WmIconphotoCmd(
+ 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. */
+{
+ Tk_PhotoHandle photo;
+ int i, width, height, isDefault = 0;
+
+ if (objc < 4) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?-default? image1 ?image2 ...?");
+ return TCL_ERROR;
+ }
+ if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) {
+ isDefault = 1;
+ if (objc == 4) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?-default? image1 ?image2 ...?");
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * Iterate over all images to retrieve their sizes, in order to allocate a
+ * buffer large enough to hold all images.
+ */
+
+ for (i = 3 + isDefault; i < objc; i++) {
+ photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i]));
+ if (photo == NULL) {
+ Tcl_AppendResult(interp, "can't use \"", Tcl_GetString(objv[i]),
+ "\" as iconphoto: not a photo image", NULL);
+ return TCL_ERROR;
+ }
+ Tk_PhotoGetSize(photo, &width, &height);
+ }
+
+ /*
+ * TODO: This requires implementation for OS X, but we silently return for
+ * now.
+ */
+
+ 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(
+ 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(
+ 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", 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), 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmManageCmd --
+ *
+ * This procedure is invoked to process the "wm manage" 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
+WmManageCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+#if 1
+ Tcl_AppendResult(interp, "wm manage is not yet supported", NULL);
+ return TCL_ERROR;
+#else
+ register Tk_Window frameWin = (Tk_Window)winPtr;
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *oldClass = (char*)Tk_Class(frameWin);
+
+ if (!Tk_IsTopLevel(frameWin)) {
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+
+ if (!Tk_IsManageable(frameWin)) {
+ Tcl_AppendResult(interp, "window \"",
+ Tk_PathName(frameWin), "\" is not manageable: must be "
+ "a frame, labelframe or toplevel", NULL);
+ return TCL_ERROR;
+ }
+ TkFocusSplit(winPtr);
+ Tk_UnmapWindow(frameWin);
+ if (wmPtr == NULL) {
+ TkWmNewWindow(winPtr);
+ if (winPtr->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ macWin = (MacDrawable *) winPtr->window;
+ }
+ TkWmMapWindow(winPtr);
+ Tk_UnmapWindow(frameWin);
+ }
+ wmPtr = winPtr->wmInfoPtr;
+ winPtr->flags &= ~TK_MAPPED;
+ macWin->grafPtr = NULL;
+ macWin->toplevel = macWin;
+ RemapWindows(winPtr, macWin);
+ winPtr->flags |=
+ (TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+ TkMapTopFrame(frameWin);
+ } else if (Tk_IsTopLevel(frameWin)) {
+ /* Already managed by wm - ignore it */
+ }
+ return TCL_OK;
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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(winPtr, &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(
+ 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(winPtr, &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;
+ 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(
+ 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;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ 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);
+ ApplyMasterOverrideChanges(winPtr, NULL);
+ 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(
+ 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 *const optionStrings[] = {
+ "program", "user", 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(
+ 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(protPtr, TCL_DYNAMIC);
+ break;
+ }
+ }
+ cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ if (cmdLength > 0) {
+ protPtr = 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(
+ 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;
+ WindowAttributes oldAttributes = wmPtr->attributes;
+
+ 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;
+ wmPtr->attributes |= kWindowHorizontalZoomAttribute;
+ } else {
+ wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ wmPtr->attributes &= ~kWindowHorizontalZoomAttribute;
+ }
+ if (height) {
+ wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
+ wmPtr->attributes |= kWindowVerticalZoomAttribute;
+ } else {
+ wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ wmPtr->attributes &= ~kWindowVerticalZoomAttribute;
+ }
+ if (width || height) {
+ wmPtr->attributes |= kWindowResizableAttribute;
+ } else {
+ wmPtr->attributes &= ~kWindowResizableAttribute;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (wmPtr->scrollWinPtr != NULL) {
+ TkScrollbarEventuallyRedraw((TkScrollbar *)
+ wmPtr->scrollWinPtr->instanceData);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ ApplyWindowClassAttributeChanges(winPtr, NULL, wmPtr->macClass,
+ oldAttributes, 1);
+ 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(
+ 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 *const optionStrings[] = {
+ "program", "user", 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(
+ 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 *const optionStrings[] = {
+ "isabove", "isbelow", 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) {
+ Tcl_Panic("TkWmStackorderToplevel failed");
+ }
+
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree(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", NULL);
+ return TCL_ERROR;
+ }
+
+ if (!Tk_IsMapped(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't mapped", NULL);
+ return TCL_ERROR;
+ }
+
+ if (!Tk_IsMapped(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't mapped", 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", NULL);
+ return TCL_ERROR;
+ }
+
+ 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) {
+ Tcl_Panic("winPtr window not found");
+ }
+ if (index2 == -1) {
+ Tcl_Panic("winPtr2 window not found");
+ }
+
+ ckfree(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_SetObjResult(interp, Tcl_NewBooleanObj(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(
+ 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 *const optionStrings[] = {
+ "normal", "iconic", "withdrawn", "zoomed", 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), NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ winPtr->pathName, ": it is an embedded window", 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", NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->master != None) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", 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 {
+ if (wmPtr->hints.initial_state == NormalState ||
+ wmPtr->hints.initial_state == ZoomState) {
+ wmPtr->hints.initial_state = (TkMacOSXIsWindowZoomed(winPtr) ?
+ ZoomState : NormalState);
+ }
+ 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(
+ 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;
+ }
+ 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(
+ 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;
+ } 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), 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), NULL);
+ return TCL_ERROR;
+ }
+
+ if ((TkWindow *) master == winPtr) {
+ Tcl_AppendResult(interp, "can't make \"", Tk_PathName(winPtr),
+ "\" its own master", NULL);
+ return TCL_ERROR;
+ }
+
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->master = Tk_WindowId(master);
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree(wmPtr->masterWindowName);
+ }
+ wmPtr->masterWindowName = ckalloc(length+1);
+ strcpy(wmPtr->masterWindowName, argv3);
+ }
+ ApplyMasterOverrideChanges(winPtr, NULL);
+ 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(
+ 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), 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(
+ WmInfo *wmPtr,
+ TkWindow *winPtr)
+{
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tcl_DoWhenIdle(UpdateGeometryInfo, 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;
+
+ /*
+ * Ensure widthInc and heightInc are greater than 0
+ */
+
+ if (widthInc <= 0) {
+ widthInc = 1;
+ }
+ if (heightInc <= 0) {
+ heightInc = 1;
+ }
+
+ /*
+ * 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))) {
+ Tcl_DoWhenIdle(UpdateGeometryInfo, 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))) {
+ Tcl_DoWhenIdle(UpdateGeometryInfo, 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 = clientData;
+
+ winPtr->wmInfoPtr->flags |= WM_VROOT_OFFSET_STALE;
+ if (eventPtr->type == DestroyNotify) {
+ 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.
+ */
+
+ Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display,
+ -1, -1, -1, NULL, NULL);
+
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ Tk_DeleteErrorHandler(handler);
+ }
+ if (wmTracing) {
+ TkMacOSXDbgMsg("TopLevelEventProc: %s deleted", winPtr->pathName);
+ }
+ } else if (eventPtr->type == ReparentNotify) {
+ Tcl_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))) {
+ Tcl_DoWhenIdle(UpdateGeometryInfo, 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 = clientData;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y, width, height, min, max;
+
+ wmPtr->flags &= ~WM_UPDATE_PENDING;
+
+ if (wmPtr->flags & WM_FULLSCREEN) {
+ return;
+ }
+
+ /*
+ * 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;
+ }
+
+ /*
+ * Account for window max/min width
+ */
+
+ if (wmPtr->gridWin != NULL) {
+ min = winPtr->reqWidth
+ + (wmPtr->minWidth - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ if (wmPtr->maxWidth > 0) {
+ max = winPtr->reqWidth
+ + (wmPtr->maxWidth - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ } else {
+ max = 0;
+ }
+ } else {
+ min = wmPtr->minWidth;
+ max = wmPtr->maxWidth;
+ }
+ if (width < min) {
+ width = min;
+ } else if ((max > 0) && (width > max)) {
+ width = max;
+ }
+
+ 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;
+ }
+
+ /*
+ * Account for window max/min height
+ */
+
+ if (wmPtr->gridWin != NULL) {
+ min = winPtr->reqHeight
+ + (wmPtr->minHeight - wmPtr->reqGridHeight)*wmPtr->heightInc;
+ if (wmPtr->maxHeight > 0) {
+ max = winPtr->reqHeight
+ + (wmPtr->maxHeight-wmPtr->reqGridHeight)*wmPtr->heightInc;
+ } else {
+ max = 0;
+ }
+ } else {
+ min = wmPtr->minHeight;
+ max = wmPtr->maxHeight;
+ }
+ if (height < min) {
+ height = min;
+ } else if ((max > 0) && (height > max)) {
+ height = max;
+ }
+
+ /*
+ * 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 = TkpGetOtherWindow(winPtr);
+
+ /*
+ * TODO: 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;
+ }
+ if (wmPtr->flags & WM_MOVE_PENDING) {
+ wmPtr->configWidth = width;
+ wmPtr->configHeight = height;
+ if (wmTracing) {
+ TkMacOSXDbgMsg("Moving to %d %d, resizing to %d x %d", x, y,
+ width, height);
+ }
+ wmPtr->flags |= WM_SYNC_PENDING;
+ XMoveResizeWindow(winPtr->display, winPtr->window, x, y,
+ (unsigned) width, (unsigned) height);
+ wmPtr->flags &= ~WM_SYNC_PENDING;
+ } else if ((width != wmPtr->configWidth)
+ || (height != wmPtr->configHeight)) {
+ wmPtr->configWidth = width;
+ wmPtr->configHeight = height;
+ if (wmTracing) {
+ TkMacOSXDbgMsg("Resizing to %d x %d\n", width, height);
+ }
+ wmPtr->flags |= WM_SYNC_PENDING;
+ XResizeWindow(winPtr->display, winPtr->window, (unsigned) width,
+ (unsigned) height);
+ wmPtr->flags &= ~WM_SYNC_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+
+ wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ }
+ p++;
+ if (!isdigit(UCHAR(*p)) && (*p != '-')) {
+ goto error;
+ }
+ x = strtol(p, &end, 10);
+ p = end;
+ if (*p == '-') {
+ flags |= WM_NEGATIVE_Y;
+ } else if (*p != '+') {
+ goto error;
+ }
+ p++;
+ if (!isdigit(UCHAR(*p)) && (*p != '-')) {
+ goto error;
+ }
+ y = strtol(p, &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)))) {
+ if (wmPtr->flags & WM_FULLSCREEN) {
+ wmPtr->configX = x;
+ wmPtr->configY = y;
+ } else {
+ wmPtr->x = x;
+ wmPtr->y = y;
+ }
+ flags |= WM_MOVE_PENDING;
+ }
+ wmPtr->flags = flags;
+
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+ return TCL_OK;
+
+ error:
+ Tcl_AppendResult(interp, "bad geometry specifier \"", string, "\"", 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) {
+ TkWindow *otherPtr;
+
+ if (!(Tk_IsEmbedded(winPtr))) {
+ x += winPtr->wmInfoPtr->xInParent;
+ y += winPtr->wmInfoPtr->yInParent;
+ break;
+ }
+
+ otherPtr = TkpGetOtherWindow(winPtr);
+ if (otherPtr == NULL) {
+ if (tkMacOSXEmbedHandler->getOffsetProc != NULL) {
+ Point theOffset;
+
+ /*
+ * 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;
+
+ tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr,
+ &theOffset);
+
+ x += theOffset.h;
+ y += theOffset.v;
+ }
+ break;
+ }
+
+ /*
+ * 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;
+ }
+ 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;
+ }
+ }
+ }
+
+ /*
+ * TODO: 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;
+ }
+ }
+
+ /*
+ * TODO: 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, NULL, NULL);
+ status = XGetGeometry(winPtr->display, wmPtr->vRoot,
+ &dummy2, &wmPtr->vRootX, &wmPtr->vRootY,
+ &wmPtr->vRootWidth, &wmPtr->vRootHeight, &bd, &dummy);
+ if (wmTracing) {
+ TkMacOSXDbgMsg("x = %d, y = %d, width = %d, height = %d, status = %d",
+ wmPtr->vRootX, wmPtr->vRootY, wmPtr->vRootWidth,
+ 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)) {
+ Tcl_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, winPtr);
+ }
+ UpdateGeometryInfo(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 = TkMacOSXDrawableWindow(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 = TkMacOSXDrawableWindow(otherPtr->window);
+ } else {
+ otherMacWindow = NULL;
+ }
+
+ frontWindow = ActiveNonFloatingWindow();
+
+ 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 visible 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) {
+ tmpWindow = GetNextWindow(macWindow);
+ if (tmpWindow != 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 = ckalloc((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(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, **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. */
+{
+ XQueryPointer(NULL, None, NULL, NULL, xPtr, yPtr, NULL, NULL, NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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. */
+ WindowRef macWindow,
+ Rect *geometry) /* On return the initial bounds. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (!(wmPtr->sizeHintsFlags & (USPosition | PPosition))) {
+ WindowRef parent;
+
+ parent = GetFrontWindowOfClass(wmPtr->macClass, false);
+ if (parent && parent == macWindow) {
+ parent = GetNextWindowOfClass(parent, wmPtr->macClass, false);
+ }
+ if (parent && parent != macWindow) {
+ Rect bounds;
+
+ ChkErr(RepositionWindow, macWindow, parent,
+ kWindowCascadeOnParentWindowScreen);
+ ChkErr(GetWindowBounds, macWindow, kWindowStructureRgn, &bounds);
+ wmPtr->x = bounds.left;
+ wmPtr->y = bounds.top;
+ } else {
+ static SInt16 menuBarHeight = 0;
+
+ if (!menuBarHeight) {
+ ChkErr(GetThemeMenuBarHeight, &menuBarHeight);
+ }
+ wmPtr->x = 5;
+ wmPtr->y = menuBarHeight + 5;
+ }
+ }
+
+ geometry->left = wmPtr->x;
+ geometry->top = wmPtr->y;
+ geometry->right = wmPtr->x + winPtr->changes.width;
+ geometry->bottom = wmPtr->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(
+ void *whichWindow,
+ XPoint s)
+{
+ Point start = {s.y, s.x};
+ Point where = start;
+ TkDisplay *dispPtr;
+ Rect portRect;
+ CGrafPtr destPort = GetWindowPort(whichWindow);
+
+ QDGlobalToLocalPoint(destPort, &where);
+ GetPortBounds(destPort, &portRect);
+ if (where.h > (portRect.right - 16) &&
+ where.v > (portRect.bottom - 16)) {
+ Window window;
+ TkWindow *winPtr;
+ WmInfo *wmPtr;
+ int minWidth, minHeight, maxWidth, maxHeight;
+ Rect limits, bounds, *maxBounds;
+ Boolean resizeResult;
+
+ window = TkMacOSXGetXWindow(whichWindow);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ wmPtr = winPtr->wmInfoPtr;
+ maxBounds = (Rect*)(dispPtr->display->screens->ext_data);
+
+ if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
+ return false;
+ }
+ GetMinSize(winPtr, &minWidth, &minHeight);
+ GetMaxSize(winPtr, &maxWidth, &maxHeight);
+ if (wmPtr->gridWin != NULL) {
+ int base = winPtr->reqWidth - (wmPtr->reqGridWidth
+ * wmPtr->widthInc);
+
+ if (base < 0) {
+ base = 0;
+ }
+ limits.left = base + (minWidth * wmPtr->widthInc);
+ limits.right = base + (maxWidth * wmPtr->widthInc);
+ base = winPtr->reqHeight - (wmPtr->reqGridHeight
+ * wmPtr->heightInc);
+ if (base < 0) {
+ base = 0;
+ }
+ limits.top = base + (minHeight * wmPtr->heightInc);
+ limits.bottom = base + (maxHeight * wmPtr->heightInc);
+ } else {
+ limits.left = minWidth;
+ limits.right = maxWidth;
+ limits.top = minHeight;
+ limits.bottom = maxHeight;
+ }
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ limits.left = limits.right = winPtr->changes.width;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ limits.top = limits.bottom = winPtr->changes.height;
+ }
+ if (PtInRect(start, maxBounds)) {
+ Rect strBounds, strWidths, limitBounds;
+
+ ChkErr(GetWindowBounds, whichWindow, kWindowStructureRgn,
+ &strBounds);
+ ChkErr(GetWindowStructureWidths, whichWindow, &strWidths);
+
+ limitBounds.left = limits.left + (strBounds.left + strWidths.left);
+ limitBounds.right = limits.right +
+ (strBounds.left + strWidths.left + strWidths.right);
+ limitBounds.top = limits.top + (strBounds.top + strWidths.top);
+ limitBounds.bottom = limits.bottom +
+ (strBounds.top + strWidths.top + strWidths.bottom);
+ if (limitBounds.left < maxBounds->left) {
+ limitBounds.left = maxBounds->left;
+ }
+ if (limitBounds.right > maxBounds->right) {
+ limitBounds.right = maxBounds->right;
+ }
+ if (limitBounds.top < maxBounds->top) {
+ limitBounds.top = maxBounds->top;
+ }
+ if (limitBounds.bottom > maxBounds->bottom) {
+ limitBounds.bottom = maxBounds->bottom;
+ }
+ limits.left = limitBounds.left - (strBounds.left + strWidths.left);
+ limits.right = limitBounds.right -
+ (strBounds.left + strWidths.left + strWidths.right);
+ limits.top = limitBounds.top - (strBounds.top + strWidths.top);
+ limits.bottom = limitBounds.bottom -
+ (strBounds.top + strWidths.top + strWidths.bottom);
+ }
+ TkMacOSXTrackingLoop(1);
+ resizeResult = ResizeWindow(whichWindow, start, &limits, &bounds);
+ TkMacOSXTrackingLoop(0);
+ if (resizeResult) {
+ return true;
+ }
+ }
+ 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)
+{
+ CFStringRef title;
+
+ if (Tk_IsEmbedded(winPtr)) {
+ return;
+ }
+
+ title = CFStringCreateWithBytes(NULL, (const unsigned char *) titleUid,
+ strlen(titleUid), kCFStringEncodingUTF8, false);
+ if (title) {
+ WindowRef macWin = TkMacOSXDrawableWindow(winPtr->window);
+
+ SetWindowTitleWithCFString(macWin, title);
+ CFRelease(title);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ void *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);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXIsWindowZoomed --
+ *
+ * Ask Carbon if the given window is in the zoomed out state. Because
+ * dragging & growing a window can change the Carbon zoom state, we
+ * cannot rely on wmInfoPtr->hints.initial_state for this information.
+ *
+ * Results:
+ * True if window is zoomed out, false otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE int
+TkMacOSXIsWindowZoomed(
+ TkWindow *winPtr)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int maxWidth, maxHeight;
+ Point idealSize;
+
+ if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
+ return false;
+ }
+ GetMaxSize(winPtr, &maxWidth, &maxHeight);
+ if (wmPtr->gridWin != NULL) {
+ int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
+
+ if (base < 0) {
+ base = 0;
+ }
+ maxWidth = base + (maxWidth * wmPtr->widthInc);
+ base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
+ if (base < 0) {
+ base = 0;
+ }
+ maxHeight = base + (maxHeight * wmPtr->heightInc);
+ }
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ idealSize.h = winPtr->changes.width;
+ } else {
+ idealSize.h = maxWidth;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ idealSize.v = winPtr->changes.height;
+ } else {
+ idealSize.v = maxHeight;
+ }
+
+ return IsWindowInStandardState(TkMacOSXDrawableWindow(winPtr->window),
+ &idealSize, NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXZoomToplevel --
+ *
+ * The function is invoked when the user clicks in the zoom region of a
+ * Tk window or when the window state is set/unset to "zoomed" manually.
+ * If the window is to be zoomed (in or out), 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(
+ void *whichWindow, /* The Macintosh window to zoom. */
+ short zoomPart) /* Either inZoomIn or inZoomOut */
+{
+ Window window;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+ WmInfo *wmPtr;
+ Point idealSize;
+ int maxWidth, maxHeight;
+ OSStatus err;
+
+ window = TkMacOSXGetXWindow(whichWindow);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ wmPtr = winPtr->wmInfoPtr;
+
+ if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
+ return false;
+ }
+ GetMaxSize(winPtr, &maxWidth, &maxHeight);
+ if (wmPtr->gridWin != NULL) {
+ int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
+
+ if (base < 0) {
+ base = 0;
+ }
+ maxWidth = base + (maxWidth * wmPtr->widthInc);
+ base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
+ if (base < 0) {
+ base = 0;
+ }
+ maxHeight = base + (maxHeight * wmPtr->heightInc);
+ }
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ idealSize.h = winPtr->changes.width;
+ } else {
+ idealSize.h = maxWidth;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ idealSize.v = winPtr->changes.height;
+ } else {
+ idealSize.v = maxHeight;
+ }
+
+ /*
+ * Do nothing if already in desired zoom state.
+ */
+
+ if (!IsWindowInStandardState(whichWindow, &idealSize, NULL) ==
+ (zoomPart == inZoomIn)) {
+ return false;
+ }
+
+ err = ChkErr(ZoomWindowIdeal, whichWindow, zoomPart, &idealSize);
+ if (err != noErr) {
+ return false;
+ }
+ wmPtr->hints.initial_state =
+ (zoomPart == inZoomIn ? NormalState : ZoomState);
+ 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
+TkUnsupported1ObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+ static const char *const subcmds[] = {
+ "style", NULL
+ };
+ enum SubCmds {
+ TKMWS_STYLE
+ };
+ Tk_Window tkwin = clientData;
+ TkWindow *winPtr;
+ int index;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ winPtr = (TkWindow *)
+ Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (winPtr == NULL) {
+ return TCL_ERROR;
+ }
+ if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't a top-level window", NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (((enum SubCmds) index) == TKMWS_STYLE) {
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?class attributes?");
+ return TCL_ERROR;
+ }
+ return WmWinStyle(interp, winPtr, objc, objv);
+ }
+ /* won't be reached */
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmWinStyle --
+ *
+ * This procedure is invoked to process the
+ * "::tk::unsupported::MacWindowStyle style" subcommand. 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WmWinStyle(
+ Tcl_Interp *interp, /* Current interpreter. */
+ TkWindow *winPtr, /* Window to be manipulated. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj * const objv[]) /* Argument objects. */
+{
+ struct StrIntMap {
+ const char *strValue;
+ UInt32 intValue;
+ };
+ static const struct StrIntMap styleMap[] = {
+ { "documentProc", documentProc },
+ { "noGrowDocProc", documentProc },
+ { "dBoxProc", dBoxProc },
+ { "plainDBox", plainDBox },
+ { "altDBoxProc", altDBoxProc },
+ { "movableDBoxProc", movableDBoxProc },
+ { "zoomDocProc", zoomDocProc },
+ { "zoomNoGrow", zoomNoGrow },
+ { "floatProc", floatGrowProc },
+ { "floatGrowProc", floatGrowProc },
+ { "floatZoomProc", floatZoomGrowProc },
+ { "floatZoomGrowProc", floatZoomGrowProc },
+ { "floatSideProc", floatSideGrowProc },
+ { "floatSideGrowProc", floatSideGrowProc },
+ { "floatSideZoomProc", floatSideZoomGrowProc },
+ { "floatSideZoomGrowProc", floatSideZoomGrowProc },
+ { NULL, 0 }
+ };
+ static const struct StrIntMap classMap[] = {
+ { "alert", kAlertWindowClass },
+ { "moveableAlert", kMovableAlertWindowClass },
+ { "modal", kModalWindowClass },
+ { "moveableModal", kMovableModalWindowClass },
+ { "floating", kFloatingWindowClass },
+ { "document", kDocumentWindowClass },
+ { "utility", kUtilityWindowClass },
+ { "help", kHelpWindowClass },
+ { "sheet", kSheetWindowClass },
+ { "toolbar", kToolbarWindowClass },
+ { "plain", kPlainWindowClass },
+ { "overlay", kOverlayWindowClass },
+ { "sheetAlert", kSheetAlertWindowClass },
+ { "altPlain", kAltPlainWindowClass },
+ { "simple", kSimpleWindowClass },
+ { "drawer", kDrawerWindowClass },
+ { NULL, 0 }
+ };
+ static const struct StrIntMap compositeAttrMap[] = {
+ { "none", kWindowNoAttributes },
+ { "standardDocument", kWindowStandardDocumentAttributes },
+ { "standardFloating", kWindowStandardFloatingAttributes },
+ { "fullZoom", kWindowFullZoomAttribute },
+ { NULL, 0 }
+ };
+ static const struct StrIntMap attrMap[] = {
+ { "closeBox", kWindowCloseBoxAttribute },
+ { "horizontalZoom", kWindowHorizontalZoomAttribute },
+ { "verticalZoom", kWindowVerticalZoomAttribute },
+ { "collapseBox", kWindowCollapseBoxAttribute },
+ { "resizable", kWindowResizableAttribute },
+ { "sideTitlebar", kWindowSideTitlebarAttribute },
+ { "toolbarButton", kWindowToolbarButtonAttribute },
+ { "unifiedTitleAndToolbar", kWindowUnifiedTitleAndToolbarAttribute },
+ { "metal", kWindowMetalAttribute },
+ { "noTitleBar", kWindowNoTitleBarAttribute },
+ { "texturedSquareCorners", kWindowTexturedSquareCornersAttribute },
+ { "metalNoContentSeparator", kWindowMetalNoContentSeparatorAttribute },
+ { "doesNotCycle", kWindowDoesNotCycleAttribute },
+ { "noUpdates", kWindowNoUpdatesAttribute },
+ { "noActivates", kWindowNoActivatesAttribute },
+ { "opaqueForEvents", kWindowOpaqueForEventsAttribute },
+ { "noShadow", kWindowNoShadowAttribute },
+ { "hideOnSuspend", kWindowHideOnSuspendAttribute },
+ { "hideOnFullScreen", kWindowHideOnFullScreenAttribute },
+ { "inWindowMenu", kWindowInWindowMenuAttribute },
+ { "liveResize", kWindowLiveResizeAttribute },
+ { "ignoreClicks", kWindowIgnoreClicksAttribute },
+ { "noConstrain", kWindowNoConstrainAttribute },
+ { NULL, 0 }
+ };
+ int index, i;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc == 3) {
+ if (wmPtr->style != -1) {
+ for (i = 0; styleMap[i].strValue != NULL; i++) {
+ if (wmPtr->style == (short) styleMap[i].intValue) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(styleMap[i].strValue, -1));
+ return TCL_OK;
+ }
+ }
+ Tcl_Panic("invalid style");
+ } else {
+ Tcl_Obj *attributeList, *newResult = NULL;
+ WindowAttributes attributes;
+
+ for (i = 0; classMap[i].strValue != NULL; i++) {
+ if (wmPtr->macClass == classMap[i].intValue) {
+ newResult = Tcl_NewStringObj(classMap[i].strValue, -1);
+ break;
+ }
+ }
+ if (newResult == NULL) {
+ Tcl_Panic("invalid class");
+ }
+
+ attributeList = Tcl_NewListObj(0, NULL);
+ attributes = wmPtr->attributes;
+
+ for (i = 0; compositeAttrMap[i].strValue != NULL; i++) {
+ UInt32 intValue = compositeAttrMap[i].intValue;
+
+ if (intValue && (attributes & intValue) == intValue) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj(compositeAttrMap[i].strValue,
+ -1));
+ attributes &= ~intValue;
+ break;
+ }
+ }
+ for (i = 0; attrMap[i].strValue != NULL; i++) {
+ if (attributes & attrMap[i].intValue) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj(attrMap[i].strValue, -1));
+ }
+ }
+ Tcl_ListObjAppendElement(interp, newResult, attributeList);
+ Tcl_SetObjResult(interp, newResult);
+ }
+ } else if (objc == 4) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[3], styleMap,
+ sizeof(struct StrIntMap), "style", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ wmPtr->style = styleMap[index].intValue;
+ } else if (objc == 5) {
+ int attrObjc;
+ Tcl_Obj **attrObjv = NULL;
+ WindowClass oldClass = wmPtr->macClass;
+ WindowAttributes oldAttributes = wmPtr->attributes;
+
+ if (Tcl_GetIndexFromObjStruct(interp, objv[3], classMap,
+ sizeof(struct StrIntMap), "class", 0, &index) != TCL_OK) {
+ goto badClassAttrs;
+ }
+ wmPtr->macClass = classMap[index].intValue;
+ if (!IsValidWindowClass(wmPtr->macClass)) {
+ goto badClassAttrs;
+ }
+ if (Tcl_ListObjGetElements(interp, objv[4], &attrObjc, &attrObjv)
+ != TCL_OK) {
+ goto badClassAttrs;
+ }
+ wmPtr->attributes = kWindowNoAttributes;
+ for (i = 0; i < attrObjc; i++) {
+ if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
+ compositeAttrMap, sizeof(struct StrIntMap),
+ "attribute", 0, &index) == TCL_OK) {
+ wmPtr->attributes |= compositeAttrMap[index].intValue;
+ } else if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
+ attrMap, sizeof(struct StrIntMap),
+ "attribute", 0, &index) == TCL_OK) {
+ Tcl_ResetResult(interp);
+ wmPtr->attributes |= attrMap[index].intValue;
+ } else {
+ goto badClassAttrs;
+ }
+ }
+ ApplyWindowClassAttributeChanges(winPtr, NULL, oldClass, oldAttributes,
+ 0);
+ wmPtr->style = -1;
+ return TCL_OK;
+
+ badClassAttrs:
+ wmPtr->macClass = oldClass;
+ wmPtr->attributes = oldAttributes;
+ 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. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ if (transient) {
+ winPtr->wmInfoPtr->macClass = kSimpleWindowClass;
+ winPtr->wmInfoPtr->attributes = kWindowNoActivatesAttribute;
+ } else {
+ winPtr->wmInfoPtr->macClass = kFloatingWindowClass;
+ winPtr->wmInfoPtr->attributes = kWindowStandardFloatingAttributes;
+ winPtr->wmInfoPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ winPtr->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 initialBounds = {42, 0, 43, 1}, geometry, strWidths;
+ short structureW, structureH;
+ TkMacOSXWindowList *listPtr;
+ OSStatus err;
+
+ 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 = TkpGetOtherWindow(winPtr);
+
+ if (contWinPtr != NULL) {
+ TkMacOSXMakeRealWindowExist(
+ contWinPtr->privatePtr->toplevel->winPtr);
+ macWin->flags |= TK_HOST_EXISTS;
+ return;
+ }
+
+ if (tkMacOSXEmbedHandler == NULL) {
+ Tcl_Panic("TkMacOSXMakeRealWindowExist could not find container");
+ }
+ if (tkMacOSXEmbedHandler->containerExistProc &&
+ tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr)
+ != TCL_OK) {
+ Tcl_Panic("ContainerExistProc could not make container");
+ }
+ return;
+
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
+ }
+
+ if (wmPtr->style == -1) {
+ if (!IsValidWindowClass(wmPtr->macClass)) {
+ TkMacOSXDbgMsg("Invalid window class: %ld", wmPtr->macClass);
+ wmPtr->macClass = kPlainWindowClass;
+ }
+ wmPtr->attributes = (wmPtr->attributes | kWindowAsyncDragAttribute) &
+ GetAvailableWindowAttributes(wmPtr->macClass);
+ err = ChkErr(CreateNewWindow, wmPtr->macClass, wmPtr->attributes,
+ &initialBounds, &newWindow);
+ if (err != noErr) {
+ newWindow = NULL;
+ }
+ } else {
+ TkMacOSXDbgMsg("Window creation via NewCWindow API is deprecated, "
+ "use a window class instead of style %d", wmPtr->style);
+ newWindow = NewCWindow(NULL, &initialBounds, "\p", false,
+ wmPtr->style, (WindowRef) -1, true, 0);
+ }
+
+ if (newWindow == NULL) {
+ Tcl_Panic("couldn't allocate new Mac window");
+ }
+
+ ChkErr(GetWindowStructureWidths, newWindow, &strWidths);
+ if (wmPtr->macClass == kFloatingWindowClass) {
+ /*
+ * Workaround GetWindowStructureWidths() Carbon bug:
+ */
+
+ strWidths.top = 16;
+ }
+ wmPtr->xInParent = strWidths.left;
+ wmPtr->yInParent = strWidths.top;
+ structureW = strWidths.left + strWidths.right;
+ structureH = strWidths.top + strWidths.bottom;
+ wmPtr->parentWidth = winPtr->changes.width + structureW;
+ wmPtr->parentHeight = winPtr->changes.height + structureH;
+ InitialWindowBounds(winPtr, newWindow, &geometry);
+ geometry.right += structureW;
+ geometry.bottom += structureH;
+ ChkErr(SetWindowBounds, newWindow, kWindowStructureRgn, &geometry);
+
+ TkMacOSXInstallWindowCarbonEventHandler(NULL, newWindow);
+ if (ChkErr(CreateRootControl, newWindow, &rootControl) != noErr ) {
+ Tcl_Panic("couldn't create root control for new Mac window");
+ }
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ HIViewRef growBoxView;
+
+ err = HIViewFindByID(HIViewGetRoot(newWindow),
+ kHIViewWindowGrowBoxID, &growBoxView);
+ if (err == noErr && !HIGrowBoxViewIsTransparent(growBoxView)) {
+ ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true);
+ }
+ }
+
+ /*
+ * Add this window to the list of toplevel windows.
+ */
+
+ listPtr = ckalloc(sizeof(TkMacOSXWindowList));
+ listPtr->nextPtr = tkMacOSXWindowListPtr;
+ listPtr->winPtr = winPtr;
+ tkMacOSXWindowListPtr = listPtr;
+
+ macWin->grafPtr = GetWindowPort(newWindow);
+ macWin->rootControl = rootControl;
+
+ if (wmPtr->master != None || winPtr->atts.override_redirect) {
+ ApplyMasterOverrideChanges(winPtr, newWindow);
+ }
+ SetWindowModified(newWindow, false);
+ TkMacOSXRegisterOffScreenWindow((Window) macWin, (GWorldPtr) newWindow);
+ macWin->flags |= TK_HOST_EXISTS;
+ ChkErr(GetWindowClass, newWindow, &(wmPtr->macClass));
+ ChkErr(GetWindowAttributes, newWindow, &(wmPtr->attributes));
+
+#ifdef TK_MAC_DEBUG_WINDOWS
+ TkMacOSXInitNamedDebugSymbol(HIToolbox, void, DebugPrintWindow, WindowRef);
+ if (DebugPrintWindow) {
+ DebugPrintWindow(newWindow);
+ }
+#endif /* TK_MAC_DEBUG_WINDOWS */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXRegisterOffScreenWindow --
+ *
+ * This function adds the passed in Off Screen Port to the hash table
+ * that maps Mac windows to root X windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * An entry is added to the windowTable hash table.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXRegisterOffScreenWindow(
+ Window window, /* Window structure. */
+ void *portPtr) /* Pointer to a Mac GWorld. */
+{
+ Tcl_HashEntry *valueHashPtr;
+ int isNew;
+
+ if (!windowHashInit) {
+ Tcl_InitHashTable(&windowTable, TCL_ONE_WORD_KEYS);
+ windowHashInit = true;
+ }
+ valueHashPtr = Tcl_CreateHashEntry(&windowTable, (char *) portPtr, &isNew);
+ if (!isNew) {
+ Tcl_Panic("Same macintosh window allocated twice!");
+ }
+ Tcl_SetHashValue(valueHashPtr, window);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ void *macWinPtr) /* Reference to a Mac Window */
+{
+ Tcl_HashEntry *entryPtr;
+
+ if (!windowHashInit) {
+ Tcl_Panic("TkMacOSXUnregisterMacWindow: unmapping before inited");
+ }
+ entryPtr = Tcl_FindHashEntry(&windowTable,(char *) macWinPtr);
+ if (!entryPtr) {
+ TkMacOSXDbgMsg("Failed to find window %08x", (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(
+ 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 = TkMacOSXDrawableWindow(winPtr->window);
+
+ if (state == WithdrawnState) {
+ Tk_UnmapWindow((Tk_Window) winPtr);
+ } else if (state == IconicState) {
+ /*
+ * The window always gets unmapped. If we can show the icon version of
+ * the window we also collapse it.
+ */
+
+ if (IsWindowCollapsable(macWin) && !IsWindowCollapsed(macWin)) {
+ CollapseWindow(macWin, true);
+ }
+ Tk_UnmapWindow((Tk_Window) winPtr);
+ } else if (state == NormalState) {
+ Tk_MapWindow((Tk_Window) winPtr);
+ if (IsWindowCollapsable(macWin) && IsWindowCollapsed(macWin)) {
+ CollapseWindow(macWin, false);
+ }
+ TkMacOSXZoomToplevel(macWin, inZoomIn);
+ } else if (state == ZoomState) {
+ Tk_MapWindow((Tk_Window) winPtr);
+ if (IsWindowCollapsable(macWin) && IsWindowCollapsed(macWin)) {
+ CollapseWindow(macWin, false);
+ }
+ TkMacOSXZoomToplevel(macWin, inZoomOut);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ void *wRef)
+{
+ WindowClass class;
+
+ if (wRef == NULL) {
+ return 0;
+ }
+
+ GetWindowClass(wRef, &class);
+ return (class == kFloatingWindowClass);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXWindowClass --
+ *
+ * Returns OS X window class of window
+ *
+ * Results:
+ * 1 or 0 depending on window's floating attribute.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE WindowClass
+TkMacOSXWindowClass(
+ TkWindow *winPtr)
+{
+ return winPtr->wmInfoPtr->macClass;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkMacOSXWindowOffset --
+ *
+ * Determines the x and y offset from the orgin of the toplevel window
+ * dressing (the structure region, i.e. title bar) and the orgin of the
+ * content area.
+ *
+ * Results:
+ * The x & y offset in pixels.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXWindowOffset(
+ void *wRef,
+ int *xOffset,
+ int *yOffset)
+{
+ Window window;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+
+ window = TkMacOSXGetXWindow(wRef);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ *xOffset = winPtr->wmInfoPtr->xInParent;
+ *yOffset = winPtr->wmInfoPtr->yInParent;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(void)
+{
+ Tcl_Time now;
+
+ Tcl_GetTime(&now);
+ return (long) now.sec * 1000 + now.usec / 1000;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ 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);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStackorderToplevelWrapperMap --
+ *
+ * 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
+WmStackorderToplevelWrapperMap(
+ TkWindow *winPtr, /* TkWindow to recurse on */
+ Display *display, /* X display of parent window */
+ Tcl_HashTable *table) /* Maps mac window to TkWindow */
+{
+ TkWindow *childPtr;
+ Tcl_HashEntry *hPtr;
+ WindowRef macWindow;
+ int newEntry;
+
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr)
+ && (winPtr->display == display)) {
+ macWindow = TkMacOSXDrawableWindow(winPtr->window);
+
+ hPtr = Tcl_CreateHashEntry(table,
+ (const char *) macWindow, &newEntry);
+ Tcl_SetHashValue(hPtr, winPtr);
+ }
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ WmStackorderToplevelWrapperMap(childPtr, display, 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(
+ 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);
+ WmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
+
+ windows = 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] = Tcl_GetHashValue(hPtr);
+ windows[1] = NULL;
+ goto done;
+ }
+
+ frontWindow = GetFrontWindowOfClass(kAllWindowClasses, false);
+ if (frontWindow == NULL) {
+ ckfree(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 = Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
+ }
+ frontWindow = GetNextWindow(frontWindow);
+ }
+ if (window_ptr != (windows-1)) {
+ Tcl_Panic("num matched toplevel windows does not equal num "
+ "children");
+ }
+ }
+
+ done:
+ Tcl_DeleteHashTable(&table);
+ return windows;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ApplyWindowClassAttributeChanges --
+ *
+ * This procedure applies carbon window class and attribute changes.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ApplyWindowClassAttributeChanges(
+ TkWindow *winPtr,
+ WindowRef macWindow,
+ WindowClass oldClass,
+ WindowAttributes oldAttributes,
+ int create)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WindowAttributes newAttributes = wmPtr->attributes |
+ kWindowAsyncDragAttribute;
+
+ if (wmPtr->macClass != oldClass || newAttributes != oldAttributes) {
+ Rect strWidths;
+
+ if (!macWindow) {
+ if (winPtr->window == None) {
+ if (create) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ } else {
+ return;
+ }
+ }
+ if (!TkMacOSXHostToplevelExists(winPtr)) {
+ if (create) {
+ TkMacOSXMakeRealWindowExist(winPtr);
+ } else {
+ return;
+ }
+ }
+ macWindow = TkMacOSXDrawableWindow(winPtr->window);
+ }
+ if (wmPtr->macClass != oldClass) {
+ TK_IF_MAC_OS_X_API (4, HIWindowChangeClass,
+ ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass);
+ ) TK_ENDIF
+ ChkErr(GetWindowClass, macWindow, &(wmPtr->macClass));
+ }
+ if (newAttributes != oldAttributes) {
+ newAttributes &= GetAvailableWindowAttributes(wmPtr->macClass);
+ ChkErr(ChangeWindowAttributes, macWindow,
+ newAttributes & (newAttributes ^ oldAttributes),
+ oldAttributes & (newAttributes ^ oldAttributes));
+ }
+ ChkErr(GetWindowAttributes, macWindow, &(wmPtr->attributes));
+ if ((wmPtr->attributes ^ oldAttributes) & kWindowResizableAttribute) {
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ HIViewRef growBoxView;
+ OSStatus err = HIViewFindByID(HIViewGetRoot(macWindow),
+ kHIViewWindowGrowBoxID, &growBoxView);
+
+ if (err == noErr && !HIGrowBoxViewIsTransparent(growBoxView)) {
+ ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true);
+ }
+ }
+ TkMacOSXInvalClipRgns((Tk_Window) winPtr);
+ TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
+ TK_PARENT_WINDOW);
+ }
+
+ /*
+ * The change of window class/attributes might have changed the window
+ * structure widths:
+ */
+
+ GetWindowStructureWidths(macWindow, &strWidths);
+ wmPtr->xInParent = strWidths.left;
+ wmPtr->yInParent = strWidths.top;
+ wmPtr->parentWidth = winPtr->changes.width + strWidths.left
+ + strWidths.right;
+ wmPtr->parentHeight = winPtr->changes.height + strWidths.top
+ + strWidths.bottom;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ApplyMasterOverrideChanges --
+ *
+ * This procedure applies changes to override_redirect or master.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ApplyMasterOverrideChanges(
+ TkWindow *winPtr,
+ WindowRef macWindow)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WindowClass oldClass = wmPtr->macClass;
+ WindowAttributes oldAttributes = wmPtr->attributes;
+
+ /*
+ * FIX: We need an UpdateWrapper equivalent to make this 100% correct
+ */
+
+ if (winPtr->atts.override_redirect) {
+ if (oldClass == kDocumentWindowClass) {
+ wmPtr->macClass = kSimpleWindowClass;
+ wmPtr->attributes = kWindowNoAttributes;
+ }
+ wmPtr->attributes |= kWindowNoActivatesAttribute;
+ } else {
+ if (oldClass == kSimpleWindowClass &&
+ oldAttributes == kWindowNoActivatesAttribute) {
+ wmPtr->macClass = kDocumentWindowClass;
+ wmPtr->attributes = kWindowStandardDocumentAttributes
+ | kWindowLiveResizeAttribute;
+ }
+ wmPtr->attributes &= ~kWindowNoActivatesAttribute;
+ }
+ if (!macWindow && winPtr->window != None &&
+ TkMacOSXHostToplevelExists(winPtr)) {
+ macWindow = TkMacOSXDrawableWindow(winPtr->window);
+ }
+ if (macWindow) {
+ WindowGroupRef group;
+
+ ApplyWindowClassAttributeChanges(winPtr, macWindow, oldClass,
+ oldAttributes, 0);
+
+ if (winPtr->atts.override_redirect && wmPtr->master != None) {
+ wmPtr->flags |= WM_TOPMOST;
+ } else {
+ wmPtr->flags &= ~WM_TOPMOST;
+ }
+ group = WmGetWindowGroup(winPtr);
+ if (group && group != GetWindowGroup(macWindow)) {
+ ChkErr(SetWindowGroup, macWindow, group);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGetWindowGroup --
+ *
+ * Gets the window group a toplevel should be placed in.
+ *
+ * Results:
+ * A WindowGroupRef.
+ *
+ * Side effects:
+ * A transient window group for the master (if any) may be created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static WindowGroupRef
+WmGetWindowGroup(
+ TkWindow *winPtr)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WindowGroupRef group = NULL;
+
+ if (wmPtr->flags & WM_TOPMOST) {
+ group = GetWindowGroupOfClass(kUtilityWindowClass);
+ } else if (wmPtr->master != None) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ TkWindow *masterWinPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, wmPtr->master);
+
+ if (masterWinPtr && masterWinPtr->window != None &&
+ TkMacOSXHostToplevelExists(masterWinPtr)) {
+ WindowRef masterMacWin =
+ TkMacOSXDrawableWindow(masterWinPtr->window);
+
+ if (masterMacWin && GetWindowProperty(masterMacWin, 'Tk ', 'TsGp',
+ sizeof(group), NULL, &group) != noErr) {
+ ChkErr(CreateWindowGroup, 0, &group);
+ if (group) {
+ ChkErr(SetWindowGroupParent, group,
+ GetWindowGroup(masterMacWin));
+ ChkErr(SetWindowGroupOwner, group, masterMacWin);
+ ChkErr(SetWindowProperty, masterMacWin, 'Tk ', 'TsGp',
+ sizeof(group), &group);
+ }
+ }
+ }
+ }
+ if (!group) {
+ group = GetWindowGroupOfClass(wmPtr->macClass);
+ }
+ return group;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXMakeFullscreen --
+ *
+ * This procedure sets a fullscreen window to the size of the screen.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXMakeFullscreen(
+ TkWindow *winPtr,
+ WindowRef window,
+ int fullscreen,
+ Tcl_Interp *interp)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN);
+
+ if (fullscreen) {
+ int screenWidth = WidthOfScreen(Tk_Screen(winPtr));
+ int screenHeight = HeightOfScreen(Tk_Screen(winPtr));
+
+ /*
+ * Check max width and height if set by the user.
+ */
+
+ if ((wmPtr->maxWidth > 0 && wmPtr->maxWidth < screenWidth)
+ || (wmPtr->maxHeight > 0 && wmPtr->maxHeight < screenHeight)) {
+ if (interp) {
+ Tcl_AppendResult(interp,
+ "can't set fullscreen attribute for \"",
+ winPtr->pathName,
+ "\": max width/height is too small", NULL);
+ }
+ result = TCL_ERROR;
+ wmPtr->flags &= ~WM_FULLSCREEN;
+ } else {
+ Rect bounds, screenBounds = {0, 0, screenHeight, screenWidth};
+
+ ChkErr(GetWindowBounds, window, kWindowContentRgn, &bounds);
+ if (!EqualRect(&bounds, &screenBounds)) {
+ if (!wasFullscreen) {
+ wmPtr->configX = wmPtr->x;
+ wmPtr->configY = wmPtr->y;
+ wmPtr->configAttributes = wmPtr->attributes;
+ wmPtr->attributes &= ~kWindowResizableAttribute;
+ ApplyWindowClassAttributeChanges(winPtr, window,
+ wmPtr->macClass, wmPtr->configAttributes, 0);
+ }
+ wmPtr->flags |= WM_SYNC_PENDING;
+ ChkErr(SetWindowBounds, window, kWindowContentRgn,
+ &screenBounds);
+ wmPtr->flags &= ~WM_SYNC_PENDING;
+ }
+ wmPtr->flags |= WM_FULLSCREEN;
+ }
+ } else {
+ wmPtr->flags &= ~WM_FULLSCREEN;
+ }
+ if (wasFullscreen && !(wmPtr->flags & WM_FULLSCREEN)) {
+ WindowAttributes oldAttributes = wmPtr->attributes;
+ Rect bounds = {wmPtr->configY, wmPtr->configX,
+ wmPtr->configY + wmPtr->yInParent + wmPtr->configHeight,
+ wmPtr->configX + wmPtr->xInParent + wmPtr->configWidth};
+
+ wmPtr->attributes |= wmPtr->configAttributes &
+ kWindowResizableAttribute;
+ ApplyWindowClassAttributeChanges(winPtr, window, wmPtr->macClass,
+ oldAttributes, 0);
+ wmPtr->flags |= WM_SYNC_PENDING;
+ ChkErr(SetWindowBounds, window, kWindowStructureRgn, &bounds);
+ wmPtr->flags &= ~WM_SYNC_PENDING;
+ }
+ TkMacOSXEnterExitFullscreen(winPtr, IsWindowActive(window));
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXEnterExitFullscreen --
+ *
+ * This procedure enters or exits fullscreen mode if required.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXEnterExitFullscreen(
+ TkWindow *winPtr,
+ int active)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ SystemUIMode mode;
+ SystemUIOptions options;
+
+ GetSystemUIMode(&mode, &options);
+ if (wmPtr->flags & WM_FULLSCREEN && active) {
+ static SystemUIMode fullscreenMode = 0;
+ static SystemUIOptions fullscreenOptions = 0;
+
+ if (!fullscreenMode) {
+ TK_IF_HI_TOOLBOX (3,
+ fullscreenMode = kUIModeAllSuppressed;
+ ) TK_ELSE_HI_TOOLBOX (3,
+ fullscreenMode = kUIModeAllHidden;
+ fullscreenOptions = kUIOptionAutoShowMenuBar;
+ ) TK_ENDIF
+ }
+ if (mode != fullscreenMode) {
+ ChkErr(SetSystemUIMode, fullscreenMode, fullscreenOptions);
+ }
+ } else {
+ if (mode != kUIModeNormal) {
+ ChkErr(SetSystemUIMode, kUIModeNormal, 0);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMinSize --
+ *
+ * This function computes the current minWidth and minHeight values for a
+ * window, taking into account the possibility that they may be
+ * defaulted.
+ *
+ * Results:
+ * The values at *minWidthPtr and *minHeightPtr are filled in with the
+ * minimum allowable dimensions of wmPtr's window, in grid units. If the
+ * requested minimum is smaller than the system required minimum, then
+ * this function computes the smallest size that will satisfy both the
+ * system and the grid constraints.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMinSize(
+ TkWindow *winPtr, /* Toplevel window to operate on. */
+ int *minWidthPtr, /* Where to store the current minimum width of
+ * the window. */
+ int *minHeightPtr) /* Where to store the current minimum height
+ * of the window. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int minWidth = 1, minHeight = 1;
+
+ /*
+ * Compute the minimum width & height by taking the default client size and
+ * rounding it up to the nearest grid unit. Return the greater of the
+ * default minimum and the specified minimum.
+ */
+
+ switch (wmPtr->macClass) {
+ case kDocumentWindowClass:
+ case kMovableAlertWindowClass:
+ case kMovableModalWindowClass:
+ minWidth = 72;
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minHeight = 15;
+ }
+ if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
+ minWidth += 29;
+ }
+ break;
+ case kFloatingWindowClass:
+ case kUtilityWindowClass:
+ minWidth = 59;
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minHeight = 11;
+ }
+ if (wmPtr->attributes & kWindowSideTitlebarAttribute) {
+ int tmp = minWidth;
+
+ minWidth = minHeight;
+ minHeight = tmp;
+ } else if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
+ minWidth += 29;
+ }
+ break;
+ default:
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minWidth = 15;
+ minHeight = 15;
+ }
+ break;
+ }
+
+ if (wmPtr->gridWin != NULL) {
+ int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
+
+ if (base < 0) {
+ base = 0;
+ }
+ minWidth = ((minWidth - base) + wmPtr->widthInc-1)/wmPtr->widthInc;
+ base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
+ if (base < 0) {
+ base = 0;
+ }
+ minHeight = ((minHeight - base) + wmPtr->heightInc-1)/wmPtr->heightInc;
+ }
+ if (minWidth < wmPtr->minWidth) {
+ minWidth = wmPtr->minWidth;
+ }
+ if (minHeight < wmPtr->minHeight) {
+ minHeight = wmPtr->minHeight;
+ }
+ *minWidthPtr = minWidth;
+ *minHeightPtr = minHeight;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMaxSize --
+ *
+ * This function computes the current maxWidth and maxHeight values for a
+ * window, taking into account the possibility that they may be
+ * defaulted.
+ *
+ * Results:
+ * The values at *maxWidthPtr and *maxHeightPtr are filled in with the
+ * maximum allowable dimensions of wmPtr's window, in grid units. If no
+ * maximum has been specified for the window, then this function computes
+ * the largest sizes that will fit on the screen.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMaxSize(
+ TkWindow *winPtr, /* Toplevel window to operate on. */
+ int *maxWidthPtr, /* Where to store the current maximum width of
+ * the window. */
+ int *maxHeightPtr) /* Where to store the current maximum height
+ * of the window. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Rect *maxBounds = (Rect*)(winPtr->display->screens->ext_data);
+
+ if (wmPtr->maxWidth > 0) {
+ *maxWidthPtr = wmPtr->maxWidth;
+ } else {
+ int maxWidth = maxBounds->right - maxBounds->left - wmPtr->xInParent;
+
+ if (wmPtr->gridWin != NULL) {
+ maxWidth = wmPtr->reqGridWidth
+ + (maxWidth - winPtr->reqWidth)/wmPtr->widthInc;
+ }
+ *maxWidthPtr = maxWidth;
+ }
+ if (wmPtr->maxHeight > 0) {
+ *maxHeightPtr = wmPtr->maxHeight;
+ } else {
+ int maxHeight = maxBounds->bottom - maxBounds->top - wmPtr->yInParent;
+
+ if (wmPtr->gridWin != NULL) {
+ maxHeight = wmPtr->reqGridHeight
+ + (maxHeight - winPtr->reqHeight)/wmPtr->heightInc;
+ }
+ *maxHeightPtr = maxHeight;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RemapWindows
+ *
+ * Adjust parent/child relation ships of the given window hierarchy.
+ *
+ * Results:
+ * none
+ *
+ * Side effects:
+ * keeps windowing system (X11) happy
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+RemapWindows(
+ TkWindow *winPtr,
+ MacDrawable *parentWin)
+{
+ TkWindow *childPtr;
+
+ /*
+ * Remove the OS specific window. It will get rebuilt when the window gets
+ * Mapped.
+ */
+
+ if (winPtr->window != None) {
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+
+ macWin->grafPtr = NULL;
+ macWin->toplevel = parentWin->toplevel;
+ winPtr->flags &= ~TK_MAPPED;
+#ifdef TK_REBUILD_TOPLEVEL
+ winPtr->flags |= TK_REBUILD_TOPLEVEL;
+#endif
+ }
+
+ /* Repeat for all the children */
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ RemapWindows(childPtr, (MacDrawable *) winPtr->window);
+ }
+}
+
+/*
+ * Local Variables:
+ * fill-column: 78
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/carbon/tkMacOSXWm.h b/carbon/tkMacOSXWm.h
new file mode 100644
index 0000000..ce4bede
--- /dev/null
+++ b/carbon/tkMacOSXWm.h
@@ -0,0 +1,304 @@
+/*
+ * tkMacOSXWm.h --
+ *
+ * Declarations of Macintosh specific window manager structures.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * 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 "tkMacOSXInt.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 configX, configY; /* x,y position of toplevel when window is
+ * switched into fullscreen state, */
+ 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.
+ */
+ WindowClass macClass;
+ WindowAttributes attributes, configAttributes;
+ TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */
+ short style; /* Legacy window style. */
+} 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 0x0001
+#define WM_UPDATE_PENDING 0x0002
+#define WM_NEGATIVE_X 0x0004
+#define WM_NEGATIVE_Y 0x0008
+#define WM_UPDATE_SIZE_HINTS 0x0010
+#define WM_SYNC_PENDING 0x0020
+#define WM_VROOT_OFFSET_STALE 0x0040
+#define WM_ABOUT_TO_MAP 0x0080
+#define WM_MOVE_PENDING 0x0100
+#define WM_COLORMAPS_EXPLICIT 0x0200
+#define WM_ADDED_TOPLEVEL_COLORMAP 0x0400
+#define WM_WIDTH_NOT_RESIZABLE 0x0800
+#define WM_HEIGHT_NOT_RESIZABLE 0x1000
+#define WM_TOPMOST 0x2000
+#define WM_FULLSCREEN 0x4000
+#define WM_TRANSPARENT 0x8000
+
+#endif
+
diff --git a/macosx/tkMacOSXXCursors.r b/carbon/tkMacOSXXCursors.r
index 81d2c00..81d2c00 100644
--- a/macosx/tkMacOSXXCursors.r
+++ b/carbon/tkMacOSXXCursors.r
diff --git a/carbon/tkMacOSXXStubs.c b/carbon/tkMacOSXXStubs.c
new file mode 100644
index 0000000..33f20c4
--- /dev/null
+++ b/carbon/tkMacOSXXStubs.c
@@ -0,0 +1,1283 @@
+/*
+ * 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
+ * their 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.
+ * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXEvent.h"
+
+#include <IOKit/IOKitLib.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 const char *macScreenName = ":0";
+ /* Default name of macintosh display. */
+
+/*
+ * Forward declarations of procedures used in this file.
+ */
+
+static XID MacXIdAlloc(Display *display);
+static int DefaultErrorHandler(Display *display,
+ XErrorEvent *err_evt);
+
+/*
+ * Other declarations
+ */
+
+static int DestroyImage(XImage *image);
+static unsigned long ImageGetPixel(XImage *image, int x, int y);
+static int PutPixel(XImage *image, int x, int y,
+ unsigned long pixel);
+#if 0
+static XImage * SubImage(XImage *image, int x, int y,
+ unsigned int width, unsigned int height);
+static int AddPixel(XImage *image, long value);
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDisplayChanged --
+ *
+ * Called to set up initial screen info or when an event indicated
+ * display (screen) change.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May change info regarding the screen.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXDisplayChanged(
+ Display *display)
+{
+ GDHandle graphicsDevice;
+ Screen *screen;
+ Rect bounds = {0, 0, 0, 0}, *maxBounds;
+
+ if (display == NULL || display->screens == NULL) {
+ return;
+ }
+ screen = display->screens;
+
+ graphicsDevice = GetMainDevice();
+ 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;
+
+ maxBounds = (Rect *) screen->ext_data;
+ *maxBounds = bounds;
+ graphicsDevice = GetDeviceList();
+ while (graphicsDevice) {
+ OSStatus err;
+
+ err = ChkErr(GetAvailableWindowPositioningBounds, graphicsDevice,
+ &bounds);
+ if (err == noErr) {
+ UnionRect(&bounds, maxBounds, maxBounds);
+ }
+ graphicsDevice = GetNextDevice(graphicsDevice);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+ int fd = 0;
+ static Rect maxBounds = {0, 0, 0, 0};
+
+ if (gMacDisplay != NULL) {
+ if (strcmp(gMacDisplay->display->display_name, display_name) == 0) {
+ return gMacDisplay;
+ } else {
+ return NULL;
+ }
+ }
+
+ display = ckalloc(sizeof(Display));
+ screen = ckalloc(sizeof(Screen));
+ bzero(display, sizeof(Display));
+ bzero(screen, sizeof(Screen));
+
+ display->resource_alloc = MacXIdAlloc;
+ display->request = 0;
+ display->qlen = 0;
+ display->fd = fd;
+ display->screens = screen;
+ display->nscreens = 1;
+ display->default_screen = 0;
+ display->display_name = (char *) macScreenName;
+
+ Gestalt(gestaltQuickdrawVersion, (long *) &display->proto_minor_version);
+ display->proto_major_version = 10;
+ display->proto_minor_version -= gestaltMacOSXQD;
+ display->vendor = (char*) "Apple";
+ Gestalt(gestaltSystemVersion, (long *) &display->release);
+
+ /*
+ * These screen bits never change
+ */
+ screen->root = ROOT_ID;
+ screen->display = display;
+ screen->black_pixel = 0x00000000 | PIXEL_MAGIC << 24;
+ screen->white_pixel = 0x00FFFFFF | PIXEL_MAGIC << 24;
+ screen->ext_data = (XExtData *) &maxBounds;
+
+ screen->root_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 = 256;
+
+ /*
+ * Initialize screen bits that may change
+ */
+
+ TkMacOSXDisplayChanged(display);
+
+ gMacDisplay = 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) {
+ Tcl_Panic("TkpCloseDisplay: tried to call TkpCloseDisplay on bad display");
+ }
+
+ gMacDisplay = NULL;
+ if (display->screens != NULL) {
+ if (display->screens->root_visual != NULL) {
+ ckfree(display->screens->root_visual);
+ }
+ ckfree(display->screens);
+ }
+ ckfree(display);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(
+ TkDisplay *dispPtr) /* display associated with clipboard */
+{
+ /*
+ * Make sure that the local scrap is transfered to the global scrap if
+ * needed.
+ */
+
+ TkSuspendClipboard();
+
+ 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(dispPtr->clipWindow);
+ dispPtr->clipWindow = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ */
+
+ Tcl_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;
+}
+
+int
+XGetGeometry(
+ 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)
+{
+ TkWindow *winPtr = ((MacDrawable *) d)->winPtr;
+
+ display->request++;
+ *root_return = ROOT_ID;
+ if (winPtr) {
+ *x_return = Tk_X(winPtr);
+ *y_return = Tk_Y(winPtr);
+ *width_return = Tk_Width(winPtr);
+ *height_return = Tk_Height(winPtr);
+ *border_width_return = winPtr->changes.border_width;
+ *depth_return = Tk_Depth(winPtr);
+ } else {
+ Rect boundsRect;
+ CGrafPtr destPort = TkMacOSXGetDrawablePort(d);
+
+ GetPortBounds(destPort, &boundsRect);
+ *x_return = boundsRect.left;
+ *y_return = boundsRect.top;
+ *width_return = boundsRect.right - boundsRect.left;
+ *height_return = boundsRect.bottom - boundsRect.top;
+ *border_width_return = 0;
+ *depth_return = 32;
+ }
+ return 1;
+}
+
+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);
+}
+
+#if 0
+void
+XSetWMNormalHints(
+ Display* display,
+ Window w,
+ XSizeHints* hints)
+{
+ /*
+ * Do nothing. Shouldn't even be called.
+ */
+}
+
+XSizeHints *
+XAllocSizeHints(void)
+{
+ /*
+ * Always return NULL. Tk code checks to see if NULL is returned & does
+ * nothing if it is.
+ */
+
+ return NULL;
+}
+#endif
+
+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)
+{
+ unsigned long p;
+ unsigned char r, g, b;
+ XColor *d = def_in_out;
+
+ p = d->pixel;
+ r = (p & 0x00FF0000) >> 16;
+ g = (p & 0x0000FF00) >> 8;
+ b = (p & 0x000000FF);
+ d->red = (r << 8) | r;
+ d->green = (g << 8) | g;
+ d->blue = (b << 8) | b;
+ d->flags = DoRed|DoGreen|DoBlue;
+ d->pad = 0;
+}
+
+void
+XQueryColors(
+ Display* display,
+ Colormap colormap,
+ XColor* defs_in_out,
+ int ncolors)
+{
+ int i;
+ unsigned long p;
+ unsigned char r, g, b;
+ XColor *d = defs_in_out;
+
+ for (i = 0; i < ncolors; i++, d++) {
+ p = d->pixel;
+ r = (p & 0x00FF0000) >> 16;
+ g = (p & 0x0000FF00) >> 8;
+ b = (p & 0x000000FF);
+ d->red = (r << 8) | r;
+ d->green = (g << 8) | g;
+ d->blue = (b << 8) | b;
+ d->flags = DoRed|DoGreen|DoBlue;
+ d->pad = 0;
+ }
+}
+
+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. */
+}
+
+int
+XSync(
+ Display *display,
+ Bool flag)
+{
+ TkMacOSXFlushWindows();
+ display->request++;
+ return 0;
+}
+
+#if 0
+int
+XSetClipRectangles(
+ Display *d,
+ GC gc,
+ int clip_x_origin,
+ int clip_y_origin,
+ XRectangle* rectangles,
+ int n,
+ int ordering)
+{
+ TkRegion clipRgn = TkCreateRegion();
+
+ while (n--) {
+ XRectangle rect = *rectangles;
+
+ rect.x += clip_x_origin;
+ rect.y += clip_y_origin;
+ TkUnionRectWithRegion(&rect, clipRgn, clipRgn);
+ rectangles++;
+ }
+ TkSetRegion(d, gc, clipRgn);
+ TkDestroyRegion(clipRgn);
+ return 1;
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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, "QD%dR%x ", ProtocolVersion(Tk_Display(tkwin)),
+ ProtocolRevision(Tk_Display(tkwin)));
+ sprintf(buffer2, " %x", VendorRelease(Tk_Display(tkwin)));
+ Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)),
+ buffer2, NULL);
+}
+
+#pragma mark XImage handling
+/*
+ *----------------------------------------------------------------------
+ *
+ * XCreateImage --
+ *
+ * Allocates storage for a new XImage.
+ *
+ * Results:
+ * Returns a newly allocated XImage.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+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 = ckalloc(sizeof(XImage));
+
+ ximage->height = height;
+ ximage->width = width;
+ ximage->depth = depth;
+ ximage->xoffset = offset;
+ ximage->format = format;
+ ximage->data = data;
+
+ if (format == ZPixmap) {
+ ximage->bits_per_pixel = 32;
+ ximage->bitmap_unit = 32;
+ } else {
+ ximage->bits_per_pixel = 1;
+ ximage->bitmap_unit = 8;
+ }
+ if (bitmap_pad) {
+ ximage->bitmap_pad = bitmap_pad;
+ } else {
+ /* Use 16 byte alignment for best Quartz perfomance */
+ ximage->bitmap_pad = 128;
+ }
+ if (bytes_per_line) {
+ ximage->bytes_per_line = bytes_per_line;
+ } else {
+ ximage->bytes_per_line = ((width * ximage->bits_per_pixel +
+ (ximage->bitmap_pad - 1)) >> 3) &
+ ~((ximage->bitmap_pad >> 3) - 1);
+ }
+#ifdef WORDS_BIGENDIAN
+ ximage->byte_order = MSBFirst;
+ ximage->bitmap_bit_order = MSBFirst;
+#else
+ ximage->byte_order = LSBFirst;
+ ximage->bitmap_bit_order = LSBFirst;
+#endif
+ ximage->red_mask = 0x00FF0000;
+ ximage->green_mask = 0x0000FF00;
+ ximage->blue_mask = 0x000000FF;
+ ximage->obdata = NULL;
+ ximage->f.create_image = NULL;
+ ximage->f.destroy_image = DestroyImage;
+ ximage->f.get_pixel = ImageGetPixel;
+ ximage->f.put_pixel = PutPixel;
+ ximage->f.sub_image = NULL;
+ ximage->f.add_pixel = NULL;
+
+ return ximage;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XGetImage --
+ *
+ * This function copies data from a pixmap or window into an XImage.
+ *
+ * Results:
+ * Returns a newly allocated image containing the data from the given
+ * rectangle of the given drawable.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+XImage *
+XGetImage(
+ Display *display,
+ Drawable d,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height,
+ unsigned long plane_mask,
+ int format)
+{
+ XImage * imagePtr = NULL;
+ Pixmap pixmap = (Pixmap) NULL;
+ Tk_Window win = (Tk_Window) ((MacDrawable *) d)->winPtr;
+ GC gc;
+ int depth = 32;
+ int offset = 0;
+ int bitmap_pad = 32;
+ int bytes_per_line = 0;
+
+ if (TkMacOSXGetDrawablePort(d)) {
+ if (format == ZPixmap) {
+ if (width > 0 && height > 0) {
+ /*
+ * Tk_GetPixmap fails for zero width or height.
+ */
+
+ pixmap = Tk_GetPixmap(display, d, width, height, depth);
+ }
+ if (win) {
+ XGCValues values;
+
+ gc = Tk_GetGC(win, 0, &values);
+ } else {
+ gc = XCreateGC(display, pixmap, 0, NULL);
+ }
+ if (pixmap) {
+ XCopyArea(display, d, pixmap, gc, x, y, width, height, 0, 0);
+ }
+ imagePtr = XCreateImage(display, NULL, depth, format, offset,
+ (char *) TkMacOSXGetDrawablePort(pixmap),
+ width, height, bitmap_pad, bytes_per_line);
+
+ /*
+ * Track Pixmap underlying the XImage in the unused obdata field
+ * so that we can treat XImages coming from XGetImage specially.
+ */
+
+ imagePtr->obdata = (XPointer) pixmap;
+ if (!win) {
+ XFreeGC(display, gc);
+ }
+ } else {
+ TkpDisplayWarning(
+ "XGetImage: only ZPixmap types are implemented",
+ "XGetImage Failure");
+ }
+ }
+ return imagePtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DestroyImage --
+ *
+ * Destroys storage associated with an image.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Deallocates the image.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+DestroyImage(
+ XImage *image)
+{
+ if (image) {
+ if (image->obdata) {
+ Tk_FreePixmap((Display*) gMacDisplay, (Pixmap) image->obdata);
+ } else if (image->data) {
+ ckfree(image->data);
+ }
+ ckfree(image);
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ImageGetPixel --
+ *
+ * Get a single pixel from an image.
+ *
+ * Results:
+ * Returns the 32 bit pixel value.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static unsigned long
+ImageGetPixel(
+ XImage *image,
+ int x,
+ int y)
+{
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ RGBColor cPix;
+ unsigned long r, g, b, c;
+
+ destPort = (CGrafPtr) image->data;
+ portChanged = QDSwapPort(destPort, &savePort);
+ GetCPixel(x, y, &cPix);
+ if (image->obdata) {
+ /*
+ * Image from XGetImage, 16 bit color values.
+ */
+
+ r = (cPix . red) >> 8;
+ g = (cPix . green) >> 8;
+ b = (cPix . blue) >> 8;
+ } else {
+ r = cPix . red;
+ g = cPix . green;
+ b = cPix . blue;
+ }
+ c = (r<<16)|(g<<8)|(b);
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ return c;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PutPixel --
+ *
+ * Set a single pixel in an image.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+PutPixel(
+ XImage *image,
+ int x,
+ int y,
+ unsigned long pixel)
+{
+ CGrafPtr destPort, savePort;
+ Boolean portChanged;
+ RGBColor cPix;
+ unsigned long r, g, b;
+
+ destPort = (CGrafPtr)image->data;
+ portChanged = QDSwapPort(destPort, &savePort);
+ r = (pixel & image->red_mask)>>16;
+ g = (pixel & image->green_mask)>>8;
+ b = (pixel & image->blue_mask);
+ if (image->obdata) {
+ /*
+ * Image from XGetImage, 16 bit color values.
+ */
+
+ cPix.red = r << 8;
+ cPix.green = g << 8;
+ cPix.blue = b << 8;
+ } else {
+ cPix.red = r;
+ cPix.green = g;
+ cPix.blue = b;
+ }
+ SetCPixel(x, y, &cPix);
+ if (portChanged) {
+ QDSwapPort(savePort, NULL);
+ }
+ return 0;
+}
+
+#if 0
+static XImage *
+SubImage(
+ XImage *image,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height)
+{
+ Debugger();
+ return NULL;
+}
+
+static int
+AddPixel(
+ XImage *image,
+ long value)
+{
+ Debugger();
+ return 0;
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XChangeWindowAttributes, XSetWindowBackground,
+ * XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap,
+ * XSetWindowBorderWidth, XSetWindowColormap
+ *
+ * These functions are all no-ops. They all have equivalent 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;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetUserInactiveTime --
+ *
+ * Return the number of milliseconds the user was inactive.
+ *
+ * Results:
+ * The number of milliseconds the user has been inactive, or -1 if
+ * querying the inactive time is not supported.
+ *
+ * Side effects:
+ * None.
+ *----------------------------------------------------------------------
+ */
+
+long
+Tk_GetUserInactiveTime(
+ Display *dpy)
+{
+ io_registry_entry_t regEntry;
+ CFMutableDictionaryRef props = NULL;
+ CFTypeRef timeObj;
+ long ret = -1l;
+ uint64_t time;
+ IOReturn result;
+
+ regEntry = IOServiceGetMatchingService(kIOMasterPortDefault,
+ IOServiceMatching("IOHIDSystem"));
+
+ if (regEntry == 0) {
+ return -1l;
+ }
+
+ result = IORegistryEntryCreateCFProperties(regEntry, &props,
+ kCFAllocatorDefault, 0);
+ IOObjectRelease(regEntry);
+
+ if (result != KERN_SUCCESS || props == NULL) {
+ return -1l;
+ }
+
+ timeObj = CFDictionaryGetValue(props, CFSTR("HIDIdleTime"));
+
+ if (timeObj) {
+ CFTypeID type = CFGetTypeID(timeObj);
+
+ if (type == CFDataGetTypeID()) { /* Jaguar */
+ CFDataGetBytes((CFDataRef) timeObj,
+ CFRangeMake(0, sizeof(time)), (UInt8 *) &time);
+ /* Convert nanoseconds to milliseconds. */
+ /* ret /= kMillisecondScale; */
+ ret = (long) (time/kMillisecondScale);
+ } else if (type == CFNumberGetTypeID()) { /* Panther+ */
+ CFNumberGetValue((CFNumberRef)timeObj,
+ kCFNumberSInt64Type, &time);
+ /* Convert nanoseconds to milliseconds. */
+ /* ret /= kMillisecondScale; */
+ ret = (long) (time/kMillisecondScale);
+ } else {
+ ret = -1l;
+ }
+ }
+ /* Cleanup */
+ CFRelease(props);
+
+ return ret;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_ResetUserInactiveTime --
+ *
+ * Reset the user inactivity timer
+ *
+ * Results:
+ * none
+ *
+ * Side effects:
+ * The user inactivity timer of the underlaying windowing system is reset
+ * to zero.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_ResetUserInactiveTime(
+ Display *dpy)
+{
+ UpdateSystemActivity(UsrActivity);
+}
diff --git a/carbon/ttkMacOSXTheme.c b/carbon/ttkMacOSXTheme.c
new file mode 100644
index 0000000..5a895aa
--- /dev/null
+++ b/carbon/ttkMacOSXTheme.c
@@ -0,0 +1,1132 @@
+/*
+ * ttkMacOSXTheme.c --
+ *
+ * Tk theme engine for Mac OSX, using the Appearance Manager API.
+ *
+ * Copyright (c) 2004 Joe English
+ * Copyright (c) 2005 Neil Madden
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * See also:
+ *
+ * <URL: http://developer.apple.com/documentation/Carbon/Reference/
+ * Appearance_Manager/appearance_manager/APIIndex.html >
+ *
+ * Notes:
+ * "Active" means different things in Mac and Tk terminology --
+ * On Aqua, widgets are "Active" if they belong to the foreground window,
+ * "Inactive" if they are in a background window.
+ * Tk uses the term "active" to mean that the mouse cursor
+ * is over a widget; aka "hover", "prelight", or "hot-tracked".
+ * Aqua doesn't use this kind of feedback.
+ *
+ * The QuickDraw/Carbon coordinate system is relative to the
+ * top-level window, not to the Tk_Window. BoxToRect()
+ * accounts for this.
+ */
+
+#include "tkMacOSXPrivate.h"
+#include "ttk/ttkTheme.h"
+
+#if !defined(BUILD_tile)
+/*
+ * Use this version in the core:
+ */
+#define BEGIN_DRAWING(d) { \
+ TkMacOSXDrawingContext dc; \
+ if (!TkMacOSXSetupDrawingContext((d), NULL, 0, &dc)) {return;}
+#define END_DRAWING \
+ TkMacOSXRestoreDrawingContext(&dc); }
+#else /* BUILD_tile */
+/*
+ * TkMacOSXSetupDrawingContext is not available to extensions,
+ * need to do this the hard way in Tile:
+ */
+#define BEGIN_DRAWING(d) { \
+ CGrafPtr saveWorld; GDHandle saveDevice; \
+ GetGWorld(&saveWorld, &saveDevice); \
+ SetGWorld(TkMacOSXGetDrawablePort(d), 0); \
+ TkMacOSXSetUpClippingRgn(d);
+#define END_DRAWING \
+ SetGWorld(saveWorld,saveDevice); }
+#endif /* defined(BUILD_TILE) */
+
+/*----------------------------------------------------------------------
+ * +++ Utilities.
+ */
+
+/*
+ * BoxToRect --
+ * Convert a Ttk_Box in Tk coordinates relative to the given Drawable
+ * to a native Rect relative to the containing port.
+ */
+static inline Rect BoxToRect(Drawable d, Ttk_Box b)
+{
+ MacDrawable *md = (MacDrawable*)d;
+ Rect rect;
+
+ rect.top = b.y + md->yOff;
+ rect.left = b.x + md->xOff;
+ rect.bottom = rect.top + b.height;
+ rect.right = rect.left + b.width;
+
+ return rect;
+}
+
+/*
+ * PatternOrigin --
+ * Compute brush pattern origin for a Drawable relative to a Tk_Window.
+ *
+ * Notes: This will only be nonzero if the Drawable is an off-screen pixmap.
+ * See also SF bug #1157739.
+ */
+static Point PatternOrigin(Tk_Window tkwin, Drawable d)
+{
+ MacDrawable *md = (MacDrawable*)d;
+ Rect bounds;
+ Point origin;
+
+ TkMacOSXWinBounds((TkWindow *) tkwin, &bounds);
+ origin.h = md->xOff - bounds.left;
+ origin.v = md->yOff - bounds.top;
+
+ return origin;
+}
+
+/*
+ * DontErase --
+ * No-op ThemeEraseProc, can be passed to DrawThemeButton &c.
+ */
+static void DontErase(
+ const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev)
+{ }
+
+/*
+ * Table mapping Tk states to Appearance manager ThemeStates
+ */
+
+static Ttk_StateTable ThemeStateTable[] = {
+ {kThemeStateUnavailable, TTK_STATE_DISABLED, 0},
+ {kThemeStatePressed, TTK_STATE_PRESSED, 0},
+ {kThemeStateInactive, TTK_STATE_BACKGROUND, 0},
+ {kThemeStateActive, 0, 0}
+/* Others: Not sure what these are supposed to mean.
+ Up/Down have something to do with "little arrow" increment controls...
+ Dunno what a "Rollover" is.
+ NEM: Rollover is TTK_STATE_ACTIVE... but we don't handle that yet, by the
+ looks of things
+ {kThemeStateRollover, 0, 0},
+ {kThemeStateUnavailableInactive, 0, 0}
+ {kThemeStatePressedUp, 0, 0},
+ {kThemeStatePressedDown, 0, 0}
+*/
+};
+
+/*----------------------------------------------------------------------
+ * +++ Button element: Used for elements drawn with DrawThemeButton.
+ */
+
+/*
+ * Extra margins to account for drop shadow.
+ */
+static Ttk_Padding ButtonMargins = {2,2,2,2};
+
+#define NoThemeMetric 0xFFFFFFFF
+
+typedef struct {
+ ThemeButtonKind kind;
+ ThemeMetric heightMetric;
+} ThemeButtonParms;
+
+static ThemeButtonParms
+ PushButtonParms = { kThemePushButton, kThemeMetricPushButtonHeight },
+ CheckBoxParms = { kThemeCheckBox, kThemeMetricCheckBoxHeight },
+ RadioButtonParms = { kThemeRadioButton, kThemeMetricRadioButtonHeight },
+ BevelButtonParms = { kThemeBevelButton, NoThemeMetric },
+ PopupButtonParms = { kThemePopupButton, kThemeMetricPopupButtonHeight },
+ DisclosureParms = { kThemeDisclosureButton, kThemeMetricDisclosureTriangleHeight },
+ ListHeaderParms = { kThemeListHeaderButton, kThemeMetricListHeaderHeight };
+
+static Ttk_StateTable ButtonValueTable[] = {
+ { kThemeButtonMixed, TTK_STATE_ALTERNATE, 0 },
+ { kThemeButtonOn, TTK_STATE_SELECTED, 0 },
+ { kThemeButtonOff, 0, 0 }
+/* Others: kThemeDisclosureRight, kThemeDisclosureDown, kThemeDisclosureLeft */
+};
+
+static Ttk_StateTable ButtonAdornmentTable[] = {
+ { kThemeAdornmentDefault| kThemeAdornmentFocus,
+ TTK_STATE_ALTERNATE| TTK_STATE_FOCUS, 0 },
+ { kThemeAdornmentDefault, TTK_STATE_ALTERNATE, 0 },
+ { kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 },
+ { kThemeAdornmentNone, 0, 0 }
+};
+
+/*
+ * computeButtonDrawInfo --
+ * Fill in an appearance manager ThemeButtonDrawInfo record.
+ */
+static ThemeButtonDrawInfo computeButtonDrawInfo(
+ ThemeButtonParms *parms, Ttk_State state)
+{
+ ThemeButtonDrawInfo info;
+
+ info.state = Ttk_StateTableLookup(ThemeStateTable, state);
+ info.value = Ttk_StateTableLookup(ButtonValueTable, state);
+ info.adornment = Ttk_StateTableLookup(ButtonAdornmentTable, state);
+ return info;
+}
+
+static void ButtonElementSizeNoPadding(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ ThemeButtonParms *parms = clientData;
+
+ if (parms->heightMetric != NoThemeMetric) {
+ SInt32 height;
+
+ ChkErr(GetThemeMetric, parms->heightMetric, &height);
+ *heightPtr = height;
+ }
+}
+
+static void ButtonElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ ThemeButtonParms *parms = clientData;
+ ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, 0);
+ static const Rect scratchBounds = {0, 0, 100, 100};
+ Rect contentBounds;
+
+ ButtonElementSizeNoPadding(
+ clientData, elementRecord, tkwin,
+ widthPtr, heightPtr, paddingPtr);
+
+ /*
+ * To compute internal padding, query the appearance manager
+ * for the content bounds of a dummy rectangle, then use
+ * the difference as the padding.
+ */
+ ChkErr(GetThemeButtonContentBounds,
+ &scratchBounds, parms->kind, &info, &contentBounds);
+
+ paddingPtr->left = contentBounds.left;
+ paddingPtr->top = contentBounds.top;
+ paddingPtr->right = scratchBounds.right - contentBounds.right + 1;
+ paddingPtr->bottom = scratchBounds.bottom - contentBounds.bottom;
+
+ /*
+ * Now add a little extra padding to account for drop shadows.
+ * @@@ SHOULD: call GetThemeButtonBackgroundBounds() instead.
+ */
+
+ *paddingPtr = Ttk_AddPadding(*paddingPtr, ButtonMargins);
+ *widthPtr += Ttk_PaddingWidth(ButtonMargins);
+ *heightPtr += Ttk_PaddingHeight(ButtonMargins);
+}
+
+static void ButtonElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ ThemeButtonParms *parms = clientData;
+ ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, state);
+ Rect bounds = BoxToRect(d, Ttk_PadBox(b, ButtonMargins));
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeButton, &bounds, parms->kind, &info, NULL, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec ButtonElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ ButtonElementSize,
+ ButtonElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Notebook elements.
+ */
+
+static Ttk_StateTable TabStyleTable[] = {
+ { kThemeTabFrontInactive, TTK_STATE_SELECTED|TTK_STATE_BACKGROUND, 0 },
+ { kThemeTabNonFrontInactive, TTK_STATE_BACKGROUND, 0 },
+ { kThemeTabFrontUnavailable, TTK_STATE_DISABLED|TTK_STATE_SELECTED, 0 },
+ { kThemeTabNonFrontUnavailable, TTK_STATE_DISABLED, 0 },
+ { kThemeTabFront, TTK_STATE_SELECTED, 0 },
+ { kThemeTabNonFrontPressed, TTK_STATE_PRESSED, 0 },
+ { kThemeTabNonFront, 0,0 }
+};
+
+/*
+ * Quoth DrawThemeTab() reference manual:
+ * "Small tabs have a height of 16 pixels large tabs have a height of
+ * 21 pixels. (The widths of tabs are variable.) Additionally, the
+ * distance that the tab overlaps the pane must be included in the tab
+ * rectangle this overlap distance is always 3 pixels, although the
+ * 3-pixel overlap is only drawn for the front tab."
+ */
+static const int TAB_HEIGHT = 21;
+static const int TAB_OVERLAP = 3;
+
+static void TabElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *heightPtr = TAB_HEIGHT + TAB_OVERLAP - 1;
+}
+
+static void TabElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeTabStyle tabStyle = Ttk_StateTableLookup(TabStyleTable, state);
+
+ bounds.bottom += TAB_OVERLAP;
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeTab, &bounds, tabStyle, kThemeTabNorth, 0, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec TabElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ TabElementSize,
+ TabElementDraw
+};
+
+/*
+ * Notebook panes:
+ */
+static void PaneElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ /* Padding determined by trial-and-error */
+ *paddingPtr = Ttk_MakePadding(2, 8, 2, 2);
+}
+
+static void PaneElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeTabPane, &bounds, drawState);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec PaneElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ PaneElementSize,
+ PaneElementDraw
+};
+
+/*
+ * Labelframe borders:
+ * Use "primary group box ..."
+ * Quoth DrawThemePrimaryGroup reference:
+ * "The primary group box frame is drawn inside the specified
+ * rectangle and is a maximum of 2 pixels thick."
+ *
+ * "Maximum of 2 pixels thick" is apparently a lie;
+ * looks more like 4 to me with shading.
+ */
+static void GroupElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *paddingPtr = Ttk_UniformPadding(4);
+}
+
+static void GroupElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemePrimaryGroup, &bounds, drawState);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec GroupElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ GroupElementSize,
+ GroupElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Entry element --
+ * 3 pixels padding for focus rectangle
+ * 2 pixels padding for EditTextFrame
+ */
+
+typedef struct {
+ Tcl_Obj *backgroundObj;
+} EntryElement;
+
+static Ttk_ElementOptionSpec EntryElementOptions[] = {
+ { "-background", TK_OPTION_BORDER,
+ Tk_Offset(EntryElement,backgroundObj), "white" },
+ {0}
+};
+
+static void EntryElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *paddingPtr = Ttk_UniformPadding(5);
+}
+
+static void EntryElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ EntryElement *e = elementRecord;
+ Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin,e->backgroundObj);
+ Ttk_Box inner = Ttk_PadBox(b, Ttk_UniformPadding(3));
+ Rect bounds = BoxToRect(d, inner);
+ ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+
+ /*
+ * Erase w/background color:
+ */
+ XFillRectangle(Tk_Display(tkwin), d,
+ Tk_3DBorderGC(tkwin, backgroundPtr, TK_3D_FLAT_GC),
+ inner.x,inner.y, inner.width, inner.height);
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeEditTextFrame, &bounds, drawState);
+ if (state & TTK_STATE_FOCUS) {
+ ChkErr(DrawThemeFocusRect, &bounds, 1);
+ }
+ END_DRAWING
+}
+
+static Ttk_ElementSpec EntryElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(EntryElement),
+ EntryElementOptions,
+ EntryElementSize,
+ EntryElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Combobox:
+ *
+ * NOTES:
+ * kThemeMetricComboBoxLargeDisclosureWidth -> 17
+ * Padding and margins guesstimated by trial-and-error.
+ */
+
+static Ttk_Padding ComboboxPadding = { 2, 3, 17, 1 };
+static Ttk_Padding ComboboxMargins = { 3, 3, 4, 4 };
+
+static void ComboboxElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *widthPtr = 0;
+ *heightPtr = 0;
+ *paddingPtr = Ttk_AddPadding(ComboboxMargins, ComboboxPadding);
+}
+
+static void ComboboxElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ ThemeButtonParms *parms = clientData;
+ ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, state);
+ Rect bounds = BoxToRect(d, Ttk_PadBox(b, ComboboxMargins));
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeButton,
+ &bounds, kThemeComboBox, &info, NULL, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec ComboboxElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ ComboboxElementSize,
+ ComboboxElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Spinbuttons.
+ *
+ * From Apple HIG, part III, section "Controls", "The Stepper Control":
+ * there should be 2 pixels of space between the stepper control
+ * (AKA IncDecButton, AKA "little arrows") and the text field it modifies.
+ */
+
+static Ttk_Padding SpinbuttonMargins = {2,0,2,0};
+static void SpinButtonElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ SInt32 s;
+
+ ChkErr(GetThemeMetric, kThemeMetricLittleArrowsWidth, &s);
+ *widthPtr = s + Ttk_PaddingWidth(SpinbuttonMargins);
+ ChkErr(GetThemeMetric, kThemeMetricLittleArrowsHeight, &s);
+ *heightPtr = s + Ttk_PaddingHeight(SpinbuttonMargins);
+}
+
+static void SpinButtonElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, Ttk_PadBox(b, SpinbuttonMargins));
+ ThemeButtonDrawInfo info;
+
+ /* @@@ can't currently distinguish PressedUp (== Pressed) from PressedDown;
+ * ignore this bit for now [see #2219588]
+ */
+ info.state = Ttk_StateTableLookup(ThemeStateTable,
+ state & ~TTK_STATE_PRESSED);
+ info.value = Ttk_StateTableLookup(ButtonValueTable, state);
+ info.adornment = kThemeAdornmentNone;
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeButton,
+ &bounds, kThemeIncDecButton, &info, NULL, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec SpinButtonElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ SpinButtonElementSize,
+ SpinButtonElementDraw
+};
+
+
+/*----------------------------------------------------------------------
+ * +++ DrawThemeTrack-based elements --
+ * Progress bars and scales. (See also: <<NOTE-TRACKS>>)
+ */
+
+static Ttk_StateTable ThemeTrackEnableTable[] = {
+ { kThemeTrackDisabled, TTK_STATE_DISABLED, 0 },
+ { kThemeTrackInactive, TTK_STATE_BACKGROUND, 0 },
+ { kThemeTrackActive, 0, 0 }
+ /* { kThemeTrackNothingToScroll, ?, ? }, */
+};
+
+typedef struct { /* TrackElement client data */
+ ThemeTrackKind kind;
+ SInt32 thicknessMetric;
+} TrackElementData;
+
+static TrackElementData ScaleData = {
+ kThemeSlider, kThemeMetricHSliderHeight
+};
+
+typedef struct {
+ Tcl_Obj *fromObj; /* minimum value */
+ Tcl_Obj *toObj; /* maximum value */
+ Tcl_Obj *valueObj; /* current value */
+ Tcl_Obj *orientObj; /* horizontal / vertical */
+} TrackElement;
+
+static Ttk_ElementOptionSpec TrackElementOptions[] = {
+ { "-from", TK_OPTION_DOUBLE, Tk_Offset(TrackElement,fromObj) },
+ { "-to", TK_OPTION_DOUBLE, Tk_Offset(TrackElement,toObj) },
+ { "-value", TK_OPTION_DOUBLE, Tk_Offset(TrackElement,valueObj) },
+ { "-orient", TK_OPTION_STRING, Tk_Offset(TrackElement,orientObj) },
+ {0,0,0}
+};
+
+static void TrackElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ TrackElementData *data = clientData;
+ SInt32 size = 24; /* reasonable default ... */
+
+ ChkErr(GetThemeMetric, data->thicknessMetric, &size);
+ *widthPtr = *heightPtr = size;
+}
+
+static void TrackElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ TrackElementData *data = clientData;
+ TrackElement *elem = elementRecord;
+ double from = 0, to = 100, value = 0;
+ int orientation = TTK_ORIENT_HORIZONTAL;
+ ThemeTrackDrawInfo info;
+
+ Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from);
+ Tcl_GetDoubleFromObj(NULL, elem->toObj, &to);
+ Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value);
+ Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation);
+
+ /* @@@ BUG: min, max, and value should account for resolution:
+ * @@@ if finer than 1.0, conversion to int breaks.
+ */
+ info.kind = data->kind;
+ info.bounds = BoxToRect(d, b);
+ info.min = (int) from; /* @@@ */
+ info.max = (int) to; /* @@@ */
+ info.value = (int) value; /* @@@ */
+
+ info.attributes = orientation == TTK_ORIENT_HORIZONTAL
+ ? kThemeTrackHorizontal : 0;
+ info.attributes |= kThemeTrackShowThumb;
+ info.enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state);
+
+ switch (data->kind) {
+ case kThemeProgressBar:
+ info.trackInfo.progress.phase = 0; /* 1-4: animation phase */
+ break;
+ case kThemeSlider:
+ info.trackInfo.slider.pressState = 0; /* @@@ fill this in */
+ info.trackInfo.slider.thumbDir = kThemeThumbPlain;
+ /* kThemeThumbUpward, kThemeThumbDownward, kThemeThumbPlain */
+ break;
+ }
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeTrack, &info, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec TrackElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(TrackElement),
+ TrackElementOptions,
+ TrackElementSize,
+ TrackElementDraw
+};
+
+/*
+ * Slider element -- <<NOTE-TRACKS>>
+ * Has geometry only. The Scale widget adjusts the position of this element,
+ * and uses it for hit detection. In the Aqua theme, the slider is actually
+ * drawn as part of the trough element.
+ *
+ * Also buggy: The geometry here is a Wild-Assed-Guess; I can't
+ * figure out how to get the Appearance Manager to tell me the
+ * slider size.
+ */
+static void SliderElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *widthPtr = *heightPtr = 24;
+}
+
+static Ttk_ElementSpec SliderElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ SliderElementSize,
+ TtkNullElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Progress bar element (new):
+ *
+ * @@@ NOTE: According to an older revision of the Aqua reference docs,
+ * @@@ the 'phase' field is between 0 and 4. Newer revisions say
+ * @@@ that it can be any UInt8 value.
+ */
+
+typedef struct {
+ Tcl_Obj *orientObj; /* horizontal / vertical */
+ Tcl_Obj *valueObj; /* current value */
+ Tcl_Obj *maximumObj; /* maximum value */
+ Tcl_Obj *phaseObj; /* animation phase */
+ Tcl_Obj *modeObj; /* progress bar mode */
+} PbarElement;
+
+static Ttk_ElementOptionSpec PbarElementOptions[] = {
+ { "-orient", TK_OPTION_STRING,
+ Tk_Offset(PbarElement,orientObj), "horizontal" },
+ { "-value", TK_OPTION_DOUBLE,
+ Tk_Offset(PbarElement,valueObj), "0" },
+ { "-maximum", TK_OPTION_DOUBLE,
+ Tk_Offset(PbarElement,maximumObj), "100" },
+ { "-phase", TK_OPTION_INT,
+ Tk_Offset(PbarElement,phaseObj), "0" },
+ { "-mode", TK_OPTION_STRING,
+ Tk_Offset(PbarElement,modeObj), "determinate" },
+ {0,0,0,0}
+};
+
+static void PbarElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ SInt32 size = 24; /* @@@ Check HIG for correct default */
+
+ ChkErr(GetThemeMetric, kThemeMetricLargeProgressBarThickness, &size);
+ *widthPtr = *heightPtr = size;
+}
+
+static void PbarElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ PbarElement *pbar = elementRecord;
+ int orientation = TTK_ORIENT_HORIZONTAL;
+ double value = 0, maximum = 100;
+ int phase = 0;
+ ThemeTrackDrawInfo info;
+
+ Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation);
+ Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
+ Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum);
+ Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
+
+ if (!strcmp("indeterminate", Tcl_GetString(pbar->modeObj)) && value) {
+ info.kind = kThemeIndeterminateBar;
+ } else {
+ info.kind = kThemeProgressBar;
+ }
+ info.bounds = BoxToRect(d, b);
+ info.min = 0;
+ info.max = (int) maximum; /* @@@ See note above */
+ info.value = (int) value;
+ info.attributes = orientation == TTK_ORIENT_HORIZONTAL
+ ? kThemeTrackHorizontal : 0;
+ info.attributes |= kThemeTrackShowThumb;
+ info.enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state);
+ info.trackInfo.progress.phase = phase;
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeTrack, &info, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec PbarElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(PbarElement),
+ PbarElementOptions,
+ PbarElementSize,
+ PbarElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Separator element.
+ *
+ * DrawThemeSeparator() guesses the orientation of the line from
+ * the width and height of the rectangle, so the same element can
+ * can be used for horizontal, vertical, and general separators.
+ */
+
+static void SeparatorElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ *widthPtr = *heightPtr = 1;
+}
+
+static void SeparatorElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, unsigned int state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeDrawState drawState;
+
+ /*
+ * DrawThemeSeparator only supports kThemeStateActive / kThemeStateInactive
+ */
+ state &= TTK_STATE_BACKGROUND;
+ drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeSeparator, &bounds, drawState);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec SeparatorElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ SeparatorElementSize,
+ SeparatorElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Size grip element.
+ */
+static const ThemeGrowDirection sizegripGrowDirection
+ = kThemeGrowRight|kThemeGrowDown;
+
+static void SizegripElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ Point origin = {0, 0};
+ Rect bounds;
+
+ ChkErr(GetThemeStandaloneGrowBoxBounds,
+ origin, sizegripGrowDirection, false, &bounds);
+ *widthPtr = bounds.right - bounds.left;
+ *heightPtr = bounds.bottom - bounds.top;
+}
+
+static void SizegripElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, unsigned int state)
+{
+ Rect bounds = BoxToRect(d, b);
+ Point origin = {bounds.top, bounds.left};
+
+ /* Grow box only supports kThemeStateActive, kThemeStateInactive */
+ state &= TTK_STATE_BACKGROUND;
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeStandaloneGrowBox,
+ origin, sizegripGrowDirection, false,
+ Ttk_StateTableLookup(ThemeStateTable, state));
+ END_DRAWING
+}
+
+static Ttk_ElementSpec SizegripElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ SizegripElementSize,
+ SizegripElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Background and fill elements.
+ *
+ * This isn't quite right: In Aqua, the correct background for
+ * a control depends on what kind of container it belongs to,
+ * and the type of the top-level window.
+ *
+ * Also: patterned backgrounds should be aligned with the coordinate
+ * system of the top-level window. If we're drawing into an
+ * off-screen graphics port this leads to alignment glitches.
+ */
+
+static void FillElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeBrush brush = (state & TTK_STATE_BACKGROUND)
+ ? kThemeBrushModelessDialogBackgroundInactive
+ : kThemeBrushModelessDialogBackgroundActive;
+
+ BEGIN_DRAWING(d)
+ ChkErr(SetThemeBackground, brush, 32, true);
+ QDSetPatternOrigin(PatternOrigin(tkwin, d));
+ EraseRect(&bounds);
+ END_DRAWING
+}
+
+static void BackgroundElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, unsigned int state)
+{
+ FillElementDraw(
+ clientData, elementRecord, tkwin,
+ d, Ttk_WinBox(tkwin), state);
+}
+
+static Ttk_ElementSpec FillElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ TtkNullElementSize,
+ FillElementDraw
+};
+
+static Ttk_ElementSpec BackgroundElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ TtkNullElementSize,
+ BackgroundElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ ToolbarBackground element -- toolbar style for frames.
+ *
+ * This is very similar to the normal background element, but uses a
+ * different ThemeBrush in order to get the lighter pinstripe effect
+ * used in toolbars. We use SetThemeBackground() rather than
+ * ApplyThemeBackground() in order to get the right style.
+ *
+ * <URL: http://developer.apple.com/documentation/Carbon/Reference/
+ * Appearance_Manager/appearance_manager/constant_7.html#/
+ * /apple_ref/doc/uid/TP30000243/C005321>
+ *
+ */
+static void ToolbarBackgroundElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ ThemeBrush brush = kThemeBrushToolbarBackground;
+ Rect bounds = BoxToRect(d, Ttk_WinBox(tkwin));
+
+ BEGIN_DRAWING(d)
+ ChkErr(SetThemeBackground, brush, 32, true);
+ QDSetPatternOrigin(PatternOrigin(tkwin, d));
+ EraseRect(&bounds);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec ToolbarBackgroundElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ TtkNullElementSize,
+ ToolbarBackgroundElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Treeview header
+ * Redefine the header to use a kThemeListHeaderButton.
+ */
+
+static Ttk_StateTable TreeHeaderAdornmentTable[] = {
+ { kThemeAdornmentHeaderButtonSortUp, TTK_STATE_ALTERNATE, 0 },
+ { kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 },
+ { kThemeAdornmentNone, 0, 0 }
+};
+
+static void TreeHeaderElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ ThemeButtonParms *parms = clientData;
+ Rect bounds = BoxToRect(d, b);
+ ThemeButtonDrawInfo info;
+
+ info.state = Ttk_StateTableLookup(ThemeStateTable, state);
+ info.value = Ttk_StateTableLookup(ButtonValueTable, state);
+ info.adornment = Ttk_StateTableLookup(TreeHeaderAdornmentTable, state);
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeButton, &bounds, parms->kind, &info, NULL, NULL, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec TreeHeaderElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ ButtonElementSizeNoPadding,
+ TreeHeaderElementDraw
+};
+
+/*
+ * Disclosure triangle:
+ */
+#define TTK_TREEVIEW_STATE_OPEN TTK_STATE_USER1
+#define TTK_TREEVIEW_STATE_LEAF TTK_STATE_USER2
+static Ttk_StateTable DisclosureValueTable[] = {
+ { kThemeDisclosureDown, TTK_TREEVIEW_STATE_OPEN, 0 },
+ { kThemeDisclosureRight, 0, 0 },
+};
+
+static void DisclosureElementSize(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
+{
+ SInt32 s;
+
+ ChkErr(GetThemeMetric, kThemeMetricDisclosureTriangleWidth, &s);
+ *widthPtr = s;
+ ChkErr(GetThemeMetric, kThemeMetricDisclosureTriangleHeight, &s);
+ *heightPtr = s;
+}
+
+static void DisclosureElementDraw(
+ void *clientData, void *elementRecord, Tk_Window tkwin,
+ Drawable d, Ttk_Box b, Ttk_State state)
+{
+ Rect bounds = BoxToRect(d, b);
+ ThemeButtonDrawInfo info;
+
+ if (state & TTK_TREEVIEW_STATE_LEAF) {
+ return;
+ }
+
+ info.state = Ttk_StateTableLookup(ThemeStateTable, state);
+ info.value = Ttk_StateTableLookup(DisclosureValueTable, state);
+ info.adornment = kThemeAdornmentDrawIndicatorOnly;
+
+ BEGIN_DRAWING(d)
+ ChkErr(DrawThemeButton,
+ &bounds, kThemeDisclosureTriangle, &info, NULL, DontErase, NULL, 0);
+ END_DRAWING
+}
+
+static Ttk_ElementSpec DisclosureElementSpec = {
+ TK_STYLE_VERSION_2,
+ sizeof(NullElement),
+ TtkNullElementOptions,
+ DisclosureElementSize,
+ DisclosureElementDraw
+};
+
+/*----------------------------------------------------------------------
+ * +++ Widget layouts.
+ */
+
+TTK_BEGIN_LAYOUT_TABLE(LayoutTable)
+
+TTK_LAYOUT("Toolbar",
+ TTK_NODE("Toolbar.background", TTK_FILL_BOTH))
+
+TTK_LAYOUT("TButton",
+ TTK_GROUP("Button.button", TTK_FILL_BOTH,
+ TTK_GROUP("Button.padding", TTK_FILL_BOTH,
+ TTK_NODE("Button.label", TTK_FILL_BOTH))))
+
+TTK_LAYOUT("TRadiobutton",
+ TTK_GROUP("Radiobutton.button", TTK_FILL_BOTH,
+ TTK_GROUP("Radiobutton.padding", TTK_FILL_BOTH,
+ TTK_NODE("Radiobutton.label", TTK_PACK_LEFT))))
+
+TTK_LAYOUT("TCheckbutton",
+ TTK_GROUP("Checkbutton.button", TTK_FILL_BOTH,
+ TTK_GROUP("Checkbutton.padding", TTK_FILL_BOTH,
+ TTK_NODE("Checkbutton.label", TTK_PACK_LEFT))))
+
+TTK_LAYOUT("TMenubutton",
+ TTK_GROUP("Menubutton.button", TTK_FILL_BOTH,
+ TTK_GROUP("Menubutton.padding", TTK_FILL_BOTH,
+ TTK_NODE("Menubutton.label", TTK_PACK_LEFT))))
+
+TTK_LAYOUT("TCombobox",
+ TTK_GROUP("Combobox.button", TTK_PACK_TOP|TTK_FILL_X,
+ TTK_GROUP("Combobox.padding", TTK_FILL_BOTH,
+ TTK_NODE("Combobox.textarea", TTK_FILL_X))))
+
+/* Notebook tabs -- no focus ring */
+TTK_LAYOUT("Tab",
+ TTK_GROUP("Notebook.tab", TTK_FILL_BOTH,
+ TTK_GROUP("Notebook.padding", TTK_EXPAND|TTK_FILL_BOTH,
+ TTK_NODE("Notebook.label", TTK_EXPAND|TTK_FILL_BOTH))))
+
+/* Progress bars -- track only */
+TTK_LAYOUT("TSpinbox",
+ TTK_NODE("Spinbox.spinbutton", TTK_PACK_RIGHT|TTK_STICK_E)
+ TTK_GROUP("Spinbox.field", TTK_EXPAND|TTK_FILL_X,
+ TTK_NODE("Spinbox.textarea", TTK_EXPAND|TTK_FILL_X)))
+
+TTK_LAYOUT("TProgressbar",
+ TTK_NODE("Progressbar.track", TTK_EXPAND|TTK_FILL_BOTH))
+
+/* Tree heading -- no border, fixed height */
+TTK_LAYOUT("Heading",
+ TTK_NODE("Treeheading.cell", TTK_FILL_X)
+ TTK_NODE("Treeheading.image", TTK_PACK_RIGHT)
+ TTK_NODE("Treeheading.text", 0))
+
+/* Tree items -- omit focus ring */
+TTK_LAYOUT("Item",
+ TTK_GROUP("Treeitem.padding", TTK_FILL_BOTH,
+ TTK_NODE("Treeitem.indicator", TTK_PACK_LEFT)
+ TTK_NODE("Treeitem.image", TTK_PACK_LEFT)
+ TTK_NODE("Treeitem.text", TTK_PACK_LEFT)))
+
+TTK_END_LAYOUT_TABLE
+
+/*----------------------------------------------------------------------
+ * +++ Initialization.
+ */
+
+static int AquaTheme_Init(Tcl_Interp *interp)
+{
+ Ttk_Theme themePtr = Ttk_CreateTheme(interp, "aqua", NULL);
+
+ if (!themePtr) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Elements:
+ */
+ Ttk_RegisterElementSpec(themePtr, "background", &BackgroundElementSpec, 0);
+ Ttk_RegisterElementSpec(themePtr, "fill", &FillElementSpec, 0);
+ Ttk_RegisterElementSpec(themePtr, "Toolbar.background",
+ &ToolbarBackgroundElementSpec, 0);
+
+ Ttk_RegisterElementSpec(themePtr, "Button.button",
+ &ButtonElementSpec, &PushButtonParms);
+ Ttk_RegisterElementSpec(themePtr, "Checkbutton.button",
+ &ButtonElementSpec, &CheckBoxParms);
+ Ttk_RegisterElementSpec(themePtr, "Radiobutton.button",
+ &ButtonElementSpec, &RadioButtonParms);
+ Ttk_RegisterElementSpec(themePtr, "Toolbutton.border",
+ &ButtonElementSpec, &BevelButtonParms);
+ Ttk_RegisterElementSpec(themePtr, "Menubutton.button",
+ &ButtonElementSpec, &PopupButtonParms);
+ Ttk_RegisterElementSpec(themePtr, "Spinbox.spinbutton",
+ &SpinButtonElementSpec, 0);
+ Ttk_RegisterElementSpec(themePtr, "Combobox.button",
+ &ComboboxElementSpec, 0);
+ Ttk_RegisterElementSpec(themePtr, "Treeitem.indicator",
+ &DisclosureElementSpec, &DisclosureParms);
+ Ttk_RegisterElementSpec(themePtr, "Treeheading.cell",
+ &TreeHeaderElementSpec, &ListHeaderParms);
+
+ Ttk_RegisterElementSpec(themePtr, "Notebook.tab", &TabElementSpec, 0);
+ Ttk_RegisterElementSpec(themePtr, "Notebook.client", &PaneElementSpec, 0);
+
+ Ttk_RegisterElementSpec(themePtr, "Labelframe.border",&GroupElementSpec,0);
+ Ttk_RegisterElementSpec(themePtr, "Entry.field",&EntryElementSpec,0);
+ Ttk_RegisterElementSpec(themePtr, "Spinbox.field",&EntryElementSpec,0);
+
+ Ttk_RegisterElementSpec(themePtr, "separator",&SeparatorElementSpec,0);
+ Ttk_RegisterElementSpec(themePtr, "hseparator",&SeparatorElementSpec,0);
+ Ttk_RegisterElementSpec(themePtr, "vseparator",&SeparatorElementSpec,0);
+
+ Ttk_RegisterElementSpec(themePtr, "sizegrip",&SizegripElementSpec,0);
+
+ /*
+ * <<NOTE-TRACKS>>
+ * The Progressbar widget adjusts the size of the pbar element.
+ * In the Aqua theme, the appearance manager computes the bar geometry;
+ * we do all the drawing in the ".track" element and leave the .pbar out.
+ */
+ Ttk_RegisterElementSpec(themePtr,"Scale.trough",
+ &TrackElementSpec, &ScaleData);
+ Ttk_RegisterElementSpec(themePtr,"Scale.slider",&SliderElementSpec,0);
+ Ttk_RegisterElementSpec(themePtr,"Progressbar.track", &PbarElementSpec, 0);
+
+ /*
+ * Layouts:
+ */
+ Ttk_RegisterLayouts(themePtr, LayoutTable);
+
+ Tcl_PkgProvide(interp, "ttk::theme::aqua", TTK_VERSION);
+ return TCL_OK;
+}
+
+MODULE_SCOPE
+int Ttk_MacOSXPlatformInit(Tcl_Interp *interp)
+{
+ return AquaTheme_Init(interp);
+}
+
diff --git a/changes b/changes
index 400073b..984807a 100644
--- a/changes
+++ b/changes
@@ -6500,12 +6500,23 @@ Several documentation and release notes improvements
--- Released 8.5.2, March 28, 2008 --- See ChangeLog for details ---
+2008-04-01 (interface)[1819422] tkStubsPtr no longer in libtk (porter)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2008-04-02 (interface)[1819422] libtkstub symbols MODULE_SCOPE (steffen)
+
2008-04-07 (bug fix)[1937135] Tk_ParseArgv() double free crash (hobbs)
2008-04-07 (bug fix)[1936238] wish -h mem explosion (bachmann,kenny)
+2008-04-08 (new feature) Win: visual-styles API element engine (thoyts)
+
+2008-04-09 (enhancement) real LZW compression in GIF writer (nijtmans)
+
2008-04-14 (bug fix)[1941740] [tk_chooseColor -title] (thoyts)
+2008-04-16 (interface)[1938497] make stubs tables 'static const' (steffen)
+
2008-04-17 (bug fix)[1327482] canvas item <Enter> events (wangnick)
2008-05-23 (bug fix)[1967576] ttk::label height or width 0 panic (lawlor)
@@ -6516,12 +6527,17 @@ Several documentation and release notes improvements
2008-06-12 (platform support) Solaris/amd64 gcc 64bit support (steffen)
+2008-06-13 (new feature)[TIP 285] [tkwait] and [update] are now
+[interp cancel]able (mistachkin)
+
2008-06-18 (bug fix) Aqua: missing focus on first map (steffen)
---- Released 8.5.3, June 30, 2008 --- See ChangeLog for details ---
+--- Released 8.6a1, June 25, 2008 --- See ChangeLog for details ---
2008-07-04 (bug fix)[2009213] crash in [ttk::scale] (polo,english)
+2008-07-24 (bug fix)[2021443] consistent "wrong # args" messages (nijtmans)
+
2008-07-26 (bug fix)[2026405] portability of [winfo id] (uchida,thoyts)
2008-07-31 (bug fix) export Tk_PkgInitStubsCheck; fixes Tk embed on Windows
@@ -6531,12 +6547,15 @@ Several documentation and release notes improvements
2008-08-05 (bug fix)[2010422] Tk header files revised to accommodate
incompatible changes in recent X.org releases of X11 headers. (jenglish)
---- Released 8.5.4, August 15, 2008 --- See ChangeLog for details ---
+2008-08-19 (bug fix) revised number format in -[xy]scrollcommand callbacks
+and [xy]view methods (jenglish)
+ *** POTENTIAL INCOMPATIBILITY ***
-2008-08-19 (behavior change) arguments passed to -[xy]scrollcommand
-callbacks, and values returned by [xy]view methods are explicitly
-formatted as doubles. (english)
- *** POTENTIAL INCOMPATIBILITY ***
+2008-08-19 (enhancement) removed obsolete XID management code (staplin)
+
+Test suite modernization by Ania Pawelczyk.
+
+--- Released 8.6a2, August 25, 2008 --- See ChangeLog for details ---
2008-08-25 (bug fix)[1936220] fix [tk_getOpenFile -multiple 1] on unix (helfter)
@@ -6544,48 +6563,100 @@ formatted as doubles. (english)
2008-08-28 (bug fix) correct TK_LIBS value to include Xft (porter)
+2008-09-03 (support) Dropped support for pre-ANSI compilers. (porter)
+
+2008-10-01 (new feature)[TIP 236] [$canvas moveto] (mckay,fellows)
+
2008-10-05 (bug fix)[2112563] format double values explicitly in double
format, avoiding sensitivity to locale setting. (fellows)
- *** POTENTIAL INCOMPATIBILITY ***
-
-2008-10-10 (bug fix)[1894038] [package require] any Tk 8.5.* in any Tcl 8.5.*
-(porter)
+ *** POTENTIAL INCOMPATIBILITY ***
---- Released 8.5.5, October 15, 2008 --- See ChangeLog for details ---
+--- Released 8.6a3, October 10, 2008 --- See ChangeLog for details ---
2008-10-17 (enhancement) keyboard bindings for ttk::scale (thoyts)
+2008-10-18 (bug fix)[1825353] Russian Windows tiny fonts problem (thoyts)
+
+2008-10-18 (new feature)[TIP 321] [tk busy] (decoster,fellows)
+
+2008-10-28 (bug fix)[1534835,2054562] use of more correct cursors (english)
+
+2008-11-01 (new feature) New [ttk::spinbox] widget (thoyts)
+
+2008-11-01 (new feature)[TIP 97] [$canvas imove] [$canvas rchars] (fellows)
+
+2008-11-09 (bug fix)[2207435] [ttk::entry .t -textvar ::noexist::x] (english)
+
+2008-11-11 (bug fix)[2312027] Tk_Create*ImageType() thread safety (nijtmans)
+
+2008-11-11 (bug fix)[2264732] crash using nondefault visual (english)
+
2008-11-12 (bug fix)[1777362] permit [text] names containing "-" (thoyts)
-2008-11-15 (bug fix)[2239034] limit [wm manage] to Frames (thoyts)
+2008-11-14 (bug fix)[2239034] limit [wm manage] to Frames (thoyts)
-2008-11-19 (bug fix)[2312027] Tk_Create*ImageType() thread safety (nijtmans)
+2008-11-22 (new feature)[TIP 119] -angle option for canvas text items (fellows)
2008-11-22 (bug fix)[1939129,1991930] combobox behind other windows (thoyts)
-2008-12-22 (bug fix)[1813597,2218964] eliminate unnecessary units conversion
+2008-11-22 (new feature) Demo ctext.tcl now demos angled text (fellows)
+
+2008-11-23 (bug fix)[1389270] made [event generate <Focus*>] work (thoyts)
+
+2008-11-28 (bug fix)[1813597,2218964] eliminate unnecessary units conversion
in screen distances, reducing precision loss (ferrieux)
-2008-12-22 (bug fix)[2107938] no negative font size in PS (fellows)
+2008-12-03 (enhancement) new "hover" state for proper Vista visuals (thoyts)
+
+2008-12-05 (bug fix)[2107938] no negative font size in PS (fellows)
+
+2008-12-05 (enhancement) new "vista" theme (thoyts)
+
+2008-12-06 (new feature)[TIP 197] [$text -insertunfocussed] (edwards,fellows)
+
+2008-12-06 (new feature)[TIP 337] handle non-error bg exceptions (porter)
-2008-12-22 (bug fix)[2264732] crash using nondefault visual (english)
+2008-12-10 (new feature)[TIP 324] [tk fontchooser](thoyts,vetter,robert,steffen)
-2008-12-22 (bug fix)[2207435] [ttk::entry .t -textvar ::noexist::x] (english)
+2008-12-12 (new feature) Demo fontchoose.tcl demos [tk fontchooser] (thoyts)
+
+2008-12-18 (enhancement)[24442309] Updated German messages (haertel)
+
+--- Released 8.6b1, December 19, 2008 --- See ChangeLog for details ---
+
+2008-12-27 (bug fix)[2381555] horiz. scroll [$treeview identify] (english)
+
+2008-12-28 (new feature)[TIP 244] PNG photo format support (fellows)
+
+2008-12-28 (new feature)[TIP 171] <MouseWheel> event handling (fellows)
+ *** POTENTIAL INCOMPATIBILITY ***
---- Released 8.5.6, December 23, 2008 --- See ChangeLog for details ---
+2008-12-31 (bug fix)[2003310] radio|check button indicator color (english)
+
+2009-01-06 (bug fix)[2484771] messagebox: system to task modal (ferrieux,thoyts,mjanssen)
+
+2009-01-06 (enhancement)[1539990] optimize photo building (jepler)
+
+2009-01-07 (bug fix)[2473120] chooseDir syntax error (bron)
2009-01-07 (bug fix)[1847002] Win: prevent grab bypass (thoyts)
+2009-01-11 (bug fix)[2496162] crash calling Tk_DeleteOptionTable() (english)
+
2009-01-11 (bug fix) crash on XCreateIC failure (staplin)
2009-01-14 (bug fix)[2507326] Restore aMSN compat (nijtmans)
-2009-01-19 (new feature) CONFIG_INSTALL_DIR - where tclConfig.sh goes (cassoff)
+2009-01-19 (new feature) CONFIG_INSTALL_DIR - where tkConfig.sh goes (cassoff)
2009-01-19 (platform support) better tools for BSD ports (cassoff)
+2009-02-08 (bug fix)[2431428] panic computing layout on active widget (english)
+
2009-02-17 (platform support) MSVC and _WIN64 (hobbs)
+2009-02-21 (bug fix)[2546087] [console] display of true UTF-8 \0 (thoyts)
+
2009-02-23 (bug fix)[1329198,456299,2507419] menu image display (mcdonald)
2009-02-23 (bug fix)[2513104] fix cursor hotspots (mcdonald)
@@ -6594,13 +6665,23 @@ in screen distances, reducing precision loss (ferrieux)
2009-02-27 (bug fix)[2645457] crash in Tk_MakeWindowExist() (thoyts)
+2009-03-09 (bug fix)[2548661] crash in GetFontFamilyName (riefenstahl)
+
2009-03-25 (bug fix)[2178820] stop zero-size allocs in ttk (fellows)
2009-03-25 (bug fix)[1871101] blurry large fonts on Vista (garvey,fellows)
+2009-04-03 (bug fix)[1789819] stop panic on unexpected wm stack order (english)
+
2009-04-10 (bug fix)[2116837] std virtual events with Caps Lock (fellows)
---- Released 8.5.7, April 15, 2009 --- See ChangeLog for details ---
+2009-04-10 (platform) sse Darwin SUSv3 extensions if available (steffen)
+
+2009-04-10 (bug fix) Motif checkbutton on X11 only (steffen)
+
+2009-04-10 (bug fix) remove TkAqua Quit menu item on [console] (steffen)
+
+2009-04-10 (bug fix) crash deleting char range from [text] (steffen)
2009-04-23 (bug fix)[2779910] updated Win chooseDir (hobbs)
@@ -6610,6 +6691,8 @@ in screen distances, reducing precision loss (ferrieux)
2009-04-30 (bug fix)[2504402] iconphoto on non-32-bit displays (mcdonald,thoyts)
+2009-05-01 (bug fix)[2777019] anchor for text rotation (gavilan,fellows)
+
2009-05-03 (bug fix)[2785744] broken flag twiddling (baker,fellows)
2009-05-13 (bug fix)[2791352] XLFD parsing error (thoyts)
@@ -6618,20 +6701,42 @@ in screen distances, reducing precision loss (ferrieux)
2009-05-14 (bug fix)[1923684] confused checkbutton state (thoyts)
+2009-05-17 (new feature)[1470246] notebook tab orientation control (english)
+
2009-05-21 (bug fix)[2794778] Win menu keyboard traversal (thoyts)
2009-06-02 (bug fix)[2799589] crash on delayed window activation (thoyts)
2009-06-23 (bug fix)[220935] canvas dash update problem (nijtmans)
+2009-06-23 (platform) new subdir 'carbon' preserved for OSX 10.4-
+use --enable-aqua=carbon option to unix/configure to enable (steffen)
+
+2009-06-29 (new feature) source in `macosx` now built on Cocoa (steffen)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2009-06-30 (platform support) clang static analyzer macros (steffen)
+
2009-07-15 (bug fix)[2821962] photo image copy/paste (rib,fellows)
+2009-07-21 (bug fix)[2356057] rotated underlined text (fellows)
+
2009-07-22 (bug fix)[2496114] focus in dead window crash (griffin,fellows)
+2009-07-23 (bug fix)[2441988] report errors in selection handlers (fellows)
+ *** POTENTIAL INCOMPATIBILITY ***
+
2009-08-01 (bug fix)[2830420] X iconphoto for big endian (misch,fellows)
2009-08-04 (bug fix) [text] word-wrap of non-breaking space (fellows)
+2009-08-14 (bug fix) copy from unmapped toplevel crash (alaoui,steffen)
+
+2009-08-19 (bug fix)[2475855] prevent grid & pack on same master (spjuth)
+
+2009-08-24 (bug fix)[2821084] Cocoa: let WM_DELETE_WINDOW handler stop window
+deletion (walzer,steffen)
+
2009-08-24 (bug fix) tk::MessageBox bindings for ttk::buttons (steiner,fellows)
2009-08-25 (bug fix)[1909931] [send] update for Fedora 8 (fellows)
@@ -6652,13 +6757,13 @@ in screen distances, reducing precision loss (ferrieux)
2009-10-10 (feature)[1961455] underline, overstrike Xft fonts (caffin,fellows)
-2009-10-15 (feature)[2794032] permit [load] into Tcl 8.6+ interps (porter)
+2009-10-20 (enhancement) Updates to Polish messages (pawlak)
2009-10-22 (bug fix)[2168768] file dialog -typevariable scope (danckaert)
2009-10-22 (bug fix)[1469210] [text] modified error (danckaert)
-2009-10-24 (bug fix)[2883712] 64-bit Aqua progress bar (haffner)
+2009-10-22 (bug fix)[2883712] 64-bit Aqua progress bar (haffner)
2009-10-24 (bug fix)[1530276] X checkbutton -selectcolor (danckaert)
@@ -6668,36 +6773,39 @@ in screen distances, reducing precision loss (ferrieux)
2009-10-29 (bug fix)[1825353] Russian Windows tiny fonts problem (thoyts)
-2009-11-03 (bug fix)[2891541] fix grab behaviour for main window (thoyts)
+2009-11-01 (new feature) Ttk: [$w identify] now an ensemble (jenglish)
---- Released 8.5.8, November 16, 2009 --- See ChangeLog for details ---
+2009-11-19 (bug fix)[2899685] fix [imove] redraw logic (schekin,ferrieux)
2009-11-22 (bug fix)[2899949] crash on widget destroy (meier,thoyts)
-2009-11-24 (bug fix)[2902814] fix [wm iconphoto] on LP64 systems (fellows)
-
-2009-12-06 (bug fix)[2548661] crash in GetFontFamilyName (riefenstahl)
+2009-11-23 (bug fix)[2902573] Update Safe Tk to new Safe Base (kurpies)
-2009-12-06 (bug fix)[2864685] Compiz menu item animation (gavilan,thoyts)
+2009-11-24 (bug fix)[2902814] fix [wm iconphoto] on LP64 systems (fellows)
-2009-12-09 (bug fix)[2902573] Update Safe Tk to new Safe Base (kurpies)
+2009-12-08 (bug fix)[2864685] Compiz menu item animation (gavilan,thoyts)
2009-12-11 (bug fix)[2912473] accept :: in DISPLAY name (fellows)
-2009-12-16 (bug fix)[2496162] crash calling Tk_DeleteOptionTable() (english)
-
+2009-12-15 (bug fix)[2492179] Tcl_ObjType "option" no longer registered (porter)
+ *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("option") ***
+
2009-12-20 (bug fix)[2917663] [send] accept SI:* on auth list (fellows)
-2009-12-22 (bug fix)[2919205] syntax bug in [tk_messageBox] (zaroo)
-
2009-12-22 (bug fix)[2912356] [ttk::sizegrip] accommodate Compiz (english)
+2009-12-25 (bug fix)[2977688,2546779] tab selection focus (english)
+
2009-12-27 (bug fix)[2879927] Win: cascade menu highlight (pawlak,thoyts)
2010-01-01 (bug fix)[1924761] stop [event generate] / XIM conflict (fellows)
2010-01-03 (bug fix)[2848897] ODS_NOACCEL flag support (kovalenko,thoyts)
+2010-01-04 (bug fix)[2811266] <Return> binding in [tk_dialog] (thoyts)
+
+2010-01-04 (bug fix)[2727476] font dialog appearance (thoyts)
+
2010-01-05 (bug fix)[220950] [$menu delete] bounds check (fellows)
2010-01-05 [2898255] unlimited multi-file select (pawlak,fellows,thoyts)
@@ -6708,44 +6816,93 @@ in screen distances, reducing precision loss (ferrieux)
2010-01-18 (bug fix)[2932808] canvas update on state change (mcdonald,nijtmans)
-2010-01-19 (bug fix)[2931374] overflow in complex tag search (schmitz)
-
2010-01-19 (new feature)[TIP 359] Extended Window Manager Hint Support (thoyts)
+2010-01-19 (bug fix)[2931374] overflow in complex tag search (schmitz)
+
2010-02-17 (bug fix)[2952745] crash in menu deletion (english)
+2010-02-20 (performance) treeview stop quadratic common case (english)
+
+2010-03-02 (enhancement) -fvisibility-hidden build support (nijtmans)
+
+2010-03-06 (bug fix)[2949774] cascade menu unpost (thoyts)
+
2010-03-11 (bug fix)[2968379] crash in peer text dump (fellows)
+2010-03-17 (bug fix)[2971663] Cocoa entry <Up>, <Down> (goddard,fellows)
+
+2010-03-28 (new feature) [$treeview tag names|add|remove] (english)
+
+2010-04-09 (new feature)[2983824] [$image write -file] use extension of file
+name to select image format (fellows)
+
+2010-04-19 [2898255] unlimited multi-file select (pawlak,fellows,thoyts)
+
2010-05-31 (bug fix)[3006842] crash on empty bind scripts (english)
+2010-06-15 (bug fix)[2585265] text <Delete>,<Backspace> note selection (fellows)
+
+2010-06-15 (new package)[3016598] Tk now provides "tile 0.8.6" (english)
+
+2010-07-19 (new feature) [$photo data -format GIF] (fellows)
+
2010-08-03 (bug fix) entry validation compat with Itcl scope (hobbs)
-2010-08-12 (bug fix)[2585265] text <Delete>,<Backspace> note selection (fellows)
+2010-08-11 (platform) Drop pre-aix 4.2 support, ldAix (hobbs)
+
+2010-08-21 (patch)[3034251] genStubs steal features of ttkGenStubs (nijtmans)
-2010-08-25 (feature)[3053320] update Ttk to tile 0.8.6 feature set (hobbs)
+2010-08-26 (bug fix)[1230554] configure, OSF-1 problems, windows manifest issues (hobbs)
---- Released 8.5.9, September 6, 2010 --- See ChangeLog for details ---
+2010-08-31 fixed manifest handling on windows (hobbs, kupries)
2010-09-02 (bug fix)[3057573] specify combobox text fg color (english)
+2010-09-05 (enhancement)[3046742,3046750] Improved error dialog UI (fellows)
+
2010-09-08 (bug fix)[2829363] [$tv see] open item -> sched display (english)
+2010-09-13 (platform) limit support to Win2000+ (nijtmans)
+
+2010-10-01 (bug fix)[3078902] no hang operating on zero-size subimages (fellows)
+
+2010-10-05 (bug fix)[3080953] corrupt multibyte char in %A subst (nijtmans)
+
2010-10-11 (bug fix)[3085489] crash in [tag add/remove] (english)
-2010-11-04 (enhancement) Updated German messages. (haertel,nijtmans)
+2010-10-11 (enhancement)[491789] Unicode command line support on Win (nijtmans)
+
+2010-11-03 windows build with -UNICODE (nijtmans)
+
+2010-11-05 Message catalogs reworked to use unicode copyright char (nijtmans)
+
+2010-11-06 Message catalogs resorted, updates to NL (nijtmans)
2010-11-16 (platform) VS 2005 SP1 MSVC compiler (nijtmans)
2010-11-24 (bug fix)[3071836] crash in tk_getSaveFile (twylite)
+2010-12-03 (enhancement)[3116490] mingw x-compile improvements (nijtmans)
+
2010-12-12 (platform) OpenBSD build improvements (cassoff)
2010-12-17 (platform) Revisions to support rpm 4.4.2 (cassoff)
+2011-01-06 (bug fix)[2857300] Cocoa: correct text width rounding (walzer)
+
+2011-01-06 (bug fix)[3086887] Cocoa: textured bg windows (walzer)
+
2011-01-13 (bug fix)[3154705] tk_messageBox close button disabled (skylera)
2011-01-22 (enhancement) add [ttk::entry validate] (schelte,english)
+2011-01-24 (bug fix)[2907388] OSX: composite character entry crash (berg,walzer)
+
+2011-03-02 (new doc) tk_mac.n: OS X specific functions (walzer)
+
+2011-03-03 (bug fix)[3175610] incomplete line item refresh (ferrieux)
+
2011-03-10 (bug fix)[3205260] crash in [wm manage] (boudaillier, thoyts)
2011-03-16 (bug fix)[3181181] tearoff submenu fix (menez, thoyts)
@@ -6767,17 +6924,17 @@ in screen distances, reducing precision loss (ferrieux)
2011-04-22 (bug fix)[3291543] mem corrupt when [$canvas dchars] removes all
coords of a polygon (rogers,spjuth)
-2011-04-30 (bug fix)[2949774] cascade menu unpost (thoyts)
+2011-04-29 (platform support) [wm forget|manage] on OS X (walzer)
2011-06-06 (bug fix)[2546087] [console] treatment of '\0' (porter)
2011-06-07 (bug fix)[2358545] Restore "08" in spinbox configured with -from
and -to (porter)
-2011-06-07 (bug fix)[2484771] modal dialog settings (hoff, thoyts)
-
-2011-06-10 (bug fix)[3175610] incomplete line item refresh (ferrieux)
+2011-06-10 (bug fix)[3315731] fix [$entry -invcmd] (porter)
2011-06-17 (bug fix)[3062331] crash in unset traces (macdonald,porter)
---- Released 8.5.10, June 23, 2011 --- See ChangeLog for details ---
+2011-08-03 (bug fix)[2891541] fix grab behaviour for main window (thoyts)
+
+--- Released 8.6b2, August 8, 2011 --- See ChangeLog for details ---
diff --git a/compat/stdlib.h b/compat/stdlib.h
index 4d1a386..2c64890 100644
--- a/compat/stdlib.h
+++ b/compat/stdlib.h
@@ -1,43 +1,40 @@
/*
* stdlib.h --
*
- * Declares facilities exported by the "stdlib" portion of
- * the C library. This file isn't complete in the ANSI-C
- * sense; it only declares things that are needed by Tcl.
- * This file is needed even on many systems with their own
- * stdlib.h (e.g. SunOS) because not all stdlib.h files
- * declare all the procedures needed here (such as strtod).
+ * Declares facilities exported by the "stdlib" portion of the C library.
+ * This file isn't complete in the ANSI-C sense; it only declares things
+ * that are needed by Tk. This file is needed even on many systems with
+ * their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
+ * all the procedures needed here (such as strtod).
*
* Copyright (c) 1991 The Regents of the University of California.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _STDLIB
#define _STDLIB
-#include <tcl.h>
+#ifndef _TCL
+# include <tcl.h>
+#endif
-extern void abort _ANSI_ARGS_((void));
-extern double atof _ANSI_ARGS_((CONST char *string));
-extern int atoi _ANSI_ARGS_((CONST char *string));
-extern long atol _ANSI_ARGS_((CONST char *string));
-extern char * calloc _ANSI_ARGS_((unsigned int numElements,
- unsigned int size));
-extern void exit _ANSI_ARGS_((int status));
-extern int free _ANSI_ARGS_((char *blockPtr));
-extern char * getenv _ANSI_ARGS_((CONST char *name));
-extern char * malloc _ANSI_ARGS_((unsigned int numBytes));
-extern void qsort _ANSI_ARGS_((VOID *base, int n, int size,
- int (*compar)(CONST VOID *element1, CONST VOID
- *element2)));
-extern char * realloc _ANSI_ARGS_((char *ptr, unsigned int numBytes));
-extern double strtod _ANSI_ARGS_((CONST char *string, char **endPtr));
-extern long strtol _ANSI_ARGS_((CONST char *string, char **endPtr,
- int base));
-extern unsigned long strtoul _ANSI_ARGS_((CONST char *string,
- char **endPtr, int base));
+extern void abort(void);
+extern double atof(const char *string);
+extern int atoi(const char *string);
+extern long atol(const char *string);
+extern char * calloc(unsigned int numElements, unsigned int size);
+extern void exit(int status);
+extern int free(char *blockPtr);
+extern char * getenv(const char *name);
+extern char * malloc(unsigned int numBytes);
+extern void qsort(void *base, int n, int size, int (*compar)(
+ const void *element1, const void *element2));
+extern char * realloc(char *ptr, unsigned int numBytes);
+extern double strtod(const char *string, char **endPtr);
+extern long strtol(const char *string, char **endPtr, int base);
+extern unsigned long strtoul(const char *string, char **endPtr, int base);
#endif /* _STDLIB */
diff --git a/compat/unistd.h b/compat/unistd.h
index 1a40e90..9064b06 100644
--- a/compat/unistd.h
+++ b/compat/unistd.h
@@ -1,16 +1,14 @@
/*
* unistd.h --
*
- * Macros, CONSTants and prototypes for Posix conformance.
+ * Macros, constants and prototypes for Posix conformance.
*
- * Copyright 1989 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
+ * Copyright 1989 Regents of the University of California Permission to use,
+ * copy, modify, and distribute this software and its documentation for any
+ * purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies. The University of California makes
+ * no representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
*/
#ifndef _UNISTD
@@ -18,7 +16,7 @@
#include <sys/types.h>
#ifndef _TCL
-# include "tcl.h"
+# include <tcl.h>
#endif
#ifndef NULL
@@ -26,56 +24,56 @@
#endif
/*
- * Strict POSIX stuff goes here. Extensions go down below, in the
- * ifndef _POSIX_SOURCE section.
+ * Strict POSIX stuff goes here. Extensions go down below, in the ifndef
+ * _POSIX_SOURCE section.
*/
-extern void _exit _ANSI_ARGS_((int status));
-extern int access _ANSI_ARGS_((CONST char *path, int mode));
-extern int chdir _ANSI_ARGS_((CONST char *path));
-extern int chown _ANSI_ARGS_((CONST char *path, uid_t owner, gid_t group));
-extern int close _ANSI_ARGS_((int fd));
-extern int dup _ANSI_ARGS_((int oldfd));
-extern int dup2 _ANSI_ARGS_((int oldfd, int newfd));
-extern int execl _ANSI_ARGS_((CONST char *path, ...));
-extern int execle _ANSI_ARGS_((CONST char *path, ...));
-extern int execlp _ANSI_ARGS_((CONST char *file, ...));
-extern int execv _ANSI_ARGS_((CONST char *path, char **argv));
-extern int execve _ANSI_ARGS_((CONST char *path, char **argv, char **envp));
-extern int execvp _ANSI_ARGS_((CONST char *file, char **argv));
-extern pid_t fork _ANSI_ARGS_((void));
-extern char *getcwd _ANSI_ARGS_((char *buf, size_t size));
-extern gid_t getegid _ANSI_ARGS_((void));
-extern uid_t geteuid _ANSI_ARGS_((void));
-extern gid_t getgid _ANSI_ARGS_((void));
-extern int getgroups _ANSI_ARGS_((int bufSize, int *buffer));
-extern pid_t getpid _ANSI_ARGS_((void));
-extern uid_t getuid _ANSI_ARGS_((void));
-extern int isatty _ANSI_ARGS_((int fd));
-extern long lseek _ANSI_ARGS_((int fd, long offset, int whence));
-extern int pipe _ANSI_ARGS_((int *fildes));
-extern int read _ANSI_ARGS_((int fd, char *buf, size_t size));
-extern int setgid _ANSI_ARGS_((gid_t group));
-extern int setuid _ANSI_ARGS_((uid_t user));
-extern unsigned sleep _ANSI_ARGS_ ((unsigned seconds));
-extern char *ttyname _ANSI_ARGS_((int fd));
-extern int unlink _ANSI_ARGS_((CONST char *path));
-extern int write _ANSI_ARGS_((int fd, CONST char *buf, size_t size));
+extern void _exit(int status);
+extern int access(const char *path, int mode);
+extern int chdir(const char *path);
+extern int chown(const char *path, uid_t owner, gid_t group);
+extern int close(int fd);
+extern int dup(int oldfd);
+extern int dup2(int oldfd, int newfd);
+extern int execl(const char *path, ...);
+extern int execle(const char *path, ...);
+extern int execlp(const char *file, ...);
+extern int execv(const char *path, char **argv);
+extern int execve(const char *path, char **argv, char **envp);
+extern int execvp(const char *file, char **argv);
+extern pid_t fork(void);
+extern char * getcwd(char *buf, size_t size);
+extern gid_t getegid(void);
+extern uid_t geteuid(void);
+extern gid_t getgid(void);
+extern int getgroups(int bufSize, int *buffer);
+extern pid_t getpid(void);
+extern uid_t getuid(void);
+extern int isatty(int fd);
+extern long lseek(int fd, long offset, int whence);
+extern int pipe(int *fildes);
+extern int read(int fd, char *buf, size_t size);
+extern int setgid(gid_t group);
+extern int setuid(uid_t user);
+extern unsigned sleep(unsigned seconds);
+extern char * ttyname(int fd);
+extern int unlink(const char *path);
+extern int write(int fd, const char *buf, size_t size);
#ifndef _POSIX_SOURCE
-extern char *crypt _ANSI_ARGS_((CONST char *, CONST char *));
-extern int fchown _ANSI_ARGS_((int fd, uid_t owner, gid_t group));
-extern int flock _ANSI_ARGS_((int fd, int operation));
-extern int ftruncate _ANSI_ARGS_((int fd, unsigned long length));
-extern int ioctl _ANSI_ARGS_((int fd, int request, ...));
-extern int readlink _ANSI_ARGS_((CONST char *path, char *buf, int bufsize));
-extern int setegid _ANSI_ARGS_((gid_t group));
-extern int seteuid _ANSI_ARGS_((uid_t user));
-extern int setreuid _ANSI_ARGS_((int ruid, int euid));
-extern int symlink _ANSI_ARGS_((CONST char *, CONST char *));
-extern int ttyslot _ANSI_ARGS_((void));
-extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length));
-extern int vfork _ANSI_ARGS_((void));
+extern char * crypt(const char *, const char *);
+extern int fchown(int fd, uid_t owner, gid_t group);
+extern int flock(int fd, int operation);
+extern int ftruncate(int fd, unsigned long length);
+extern int ioctl(int fd, int request, ...);
+extern int readlink(const char *path, char *buf, int bufsize);
+extern int setegid(gid_t group);
+extern int seteuid(uid_t user);
+extern int setreuid(int ruid, int euid);
+extern int symlink(const char *, const char *);
+extern int ttyslot(void);
+extern int truncate(const char *path, unsigned long length);
+extern int vfork(void);
#endif /* _POSIX_SOURCE */
#endif /* _UNISTD */
diff --git a/doc/3DBorder.3 b/doc/3DBorder.3
index 01b359b..ba0881b 100644
--- a/doc/3DBorder.3
+++ b/doc/3DBorder.3
@@ -134,7 +134,6 @@ it forms the bottom side.
Specifies which of the border's graphics contexts is desired.
Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR.
.BE
-
.SH DESCRIPTION
.PP
These procedures provide facilities for drawing window borders in a
@@ -153,7 +152,8 @@ darker than \fIobjPtr\fR.
\fBTk_Alloc3DBorderFromObj\fR returns a token that may be used in later calls
to \fBTk_Draw3DRectangle\fR. If an error occurs in allocating information
for the border (e.g. a bogus color name was given)
-then NULL is returned and an error message is left in \fIinterp->result\fR.
+then NULL is returned and an error message is left as the result of
+interpreter \fIinterp\fR.
If it returns successfully, \fBTk_Alloc3DBorderFromObj\fR caches
information about the return value in \fIobjPtr\fR, which speeds up
future calls to \fBTk_Alloc3DBorderFromObj\fR with the same \fIobjPtr\fR
@@ -290,6 +290,5 @@ with the Tk_3DBorder token for the border.
There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or
\fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR
or \fBTk_Get3DBorder\fR.
-
.SH KEYWORDS
3D, background, border, color, depressed, illumination, object, polygon, raised, shadow, three-dimensional effect
diff --git a/doc/AddOption.3 b/doc/AddOption.3
index 09a6d9e..fe6107b 100644
--- a/doc/AddOption.3
+++ b/doc/AddOption.3
@@ -23,7 +23,6 @@ Value of option.
.AP int priority in
Overall priority level to use for option.
.BE
-
.SH DESCRIPTION
.PP
This procedure is invoked to add an option to the database
@@ -47,6 +46,5 @@ user-specific startup files.
.IP 80
Used for options specified interactively after the application starts
running.
-
.SH KEYWORDS
class, name, option, add
diff --git a/doc/BindTable.3 b/doc/BindTable.3
index 223c37b..24f8af5 100644
--- a/doc/BindTable.3
+++ b/doc/BindTable.3
@@ -45,7 +45,7 @@ call to \fBTk_CreateBindingTable\fR.
Identifies object with which binding is associated.
.AP "const char" *eventString in
String describing event sequence.
-.AP char *script in
+.AP "const char" *script in
Tcl script to invoke when binding triggers.
.AP int append in
Non-zero means append \fIscript\fR to existing script for binding,
@@ -61,7 +61,6 @@ Number of object identifiers pointed to by \fIobjectPtr\fR.
Points to an array of object identifiers: bindings will be considered
for each of these objects in order from first to last.
.BE
-
.SH DESCRIPTION
.PP
These procedures provide a general-purpose mechanism for creating
@@ -112,25 +111,25 @@ select relevant events, or to disallow the use of certain events
in bindings.
If an error occurred while creating the binding (e.g., \fIeventString\fR
refers to a non-existent event), then 0 is returned and an error
-message is left in \fIinterp->result\fR.
+message is left as the result of interpreter \fIinterp\fR.
.PP
\fBTk_DeleteBinding\fR removes from \fIbindingTable\fR the
binding given by \fIobject\fR and \fIeventString\fR, if
such a binding exists.
\fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR.
-In some cases it may reset \fIinterp->result\fR to the default
+In some cases it may reset the interpreter result to the default
empty value.
.PP
\fBTk_GetBinding\fR returns a pointer to the script associated
with \fIeventString\fR and \fIobject\fR in \fIbindingTable\fR.
If no such binding exists then NULL is returned and an error
-message is left in \fIinterp->result\fR.
+message is left as the result of interpreter \fIinterp\fR.
.PP
-\fBTk_GetAllBindings\fR returns in \fIinterp->result\fR a list
+\fBTk_GetAllBindings\fR returns in \fIinterp\fR's result a list
of all the event strings for which there are bindings in
\fIbindingTable\fR associated with \fIobject\fR.
-If there are no bindings for \fIobject\fR then an empty
-string is returned in \fIinterp->result\fR.
+If there are no bindings for \fIobject\fR, the result will be an empty
+string.
.PP
\fBTk_DeleteAllBindings\fR deletes all of the bindings in
\fIbindingTable\fR that are associated with \fIobject\fR.
@@ -150,6 +149,5 @@ the object is skipped.
\fBTk_BindEvent\fR continues through all of the objects, handling
exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as
described in the documentation for \fBbind\fR.
-
.SH KEYWORDS
binding, event, object, script
diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3
index 08b17a4..342ddb3 100644
--- a/doc/CanvPsY.3
+++ b/doc/CanvPsY.3
@@ -61,7 +61,6 @@ and so on.
.AP int numPoints in
Number of points at \fIcoordPtr\fR.
.BE
-
.SH DESCRIPTION
.PP
These procedures are called by canvas type managers to carry out
@@ -83,38 +82,40 @@ transformation.
of a bitmap.
The Postscript is generated in proper image data format for Postscript,
i.e., as data between angle brackets, one bit per pixel.
-The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned
-unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
-\fIinterp->result\fR is overwritten with an error message.
+The Postscript is appended to the result of interpreter \fIinterp\fR
+and \fBTCL_OK\fR is returned unless an error occurs, in which case
+\fBTCL_ERROR\fR is returned and the interpreter result is overwritten
+with an error message.
.PP
\fBTk_CanvasPsColor\fR generates Postscript to set the current color
to correspond to its \fIcolorPtr\fR argument, taking into account any
color map specified in the \fBpostscript\fR command.
-It appends the Postscript to \fIinterp->result\fR and returns
-\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
-\fIinterp->result\fR is overwritten with an error message.
+It appends the Postscript to the interpreter \fIinterp\fR's result and returns
+\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is
+returned and the interpreter's result is overwritten with an error message.
.PP
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
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.
-It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR
-unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
-\fIinterp->result\fR is overwritten with an error message.
+It appends the Postscript to interpreter \fIinterp\fR's result and
+returns \fBTCL_OK\fR unless an error occurs, in which case
+\fBTCL_ERROR\fR is returned and the interpreter's result is
+overwritten with an error message.
.PP
\fBTk_CanvasPsPath\fR generates Postscript to set the current path
to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
-It appends the resulting Postscript to \fIinterp->result\fR.
+It appends the resulting Postscript to the result of interpreter \fIinterp\fR.
.PP
\fBTk_CanvasPsStipple\fR generates Postscript that will fill the
current path in stippled fashion.
It uses \fIbitmap\fR as the stipple pattern and the current Postscript
color; ones in the stipple bitmap are drawn in the current color, and
zeroes are not drawn at all.
-The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is
-returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and
-\fIinterp->result\fR is overwritten with an error message.
-
+The Postscript is appended to interpreter \fIinterp\fR's result and
+\fBTCL_OK\fR is returned, unless an error occurs, in which case
+\fBTCL_ERROR\fR is returned and the interpreter's result is
+overwritten with an error message.
.SH KEYWORDS
bitmap, canvas, color, font, path, Postscript, stipple
diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3
index 14db15e..1ddaa6b 100644
--- a/doc/CanvTkwin.3
+++ b/doc/CanvTkwin.3
@@ -71,7 +71,6 @@ the left of this coordinate need to be redisplayed.
Bottom edge of the region that needs redisplay. Only pixels above
this coordinate need to be redisplayed.
.BE
-
.SH DESCRIPTION
.PP
These procedures are called by canvas type managers to perform various
@@ -86,7 +85,7 @@ canvas coordinate.
If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR
stores the corresponding canvas coordinate at *\fIdoublePtr\fR
and returns \fBTCL_OK\fR.
-Otherwise it stores an error message in \fIinterp->result\fR and
+Otherwise it stores an error message in the interpreter result and
returns \fBTCL_ERROR\fR.
.PP
\fBTk_CanvasDrawableCoords\fR is called by type managers during
@@ -142,18 +141,18 @@ The code of a canvas type manager will not call these procedures
directly, but will use their addresses to create a \fBTk_CustomOption\fR
structure for the \fB\-tags\fR option. The code typically looks
like this:
+.PP
.CS
-static Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
+static const Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
Tk_CanvasTagsPrintProc, (ClientData) NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
...
- {TK_CONFIG_CUSTOM, "\-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
+ {TK_CONFIG_CUSTOM, "\-tags", NULL, NULL,
+ NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
...
};
.CE
-
.SH KEYWORDS
canvas, focus, item type, redisplay, selection, type manager
diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3
index 58bf6e1..fbfa913 100644
--- a/doc/CanvTxtInfo.3
+++ b/doc/CanvTxtInfo.3
@@ -20,7 +20,6 @@ Tk_CanvasTextInfo *
.AP Tk_Canvas canvas in
A token that identifies a particular canvas widget.
.BE
-
.SH DESCRIPTION
.PP
Textual canvas items are somewhat more complicated to manage than
@@ -47,7 +46,7 @@ typedef struct Tk_CanvasTextInfo {
Tk_Item *\fIfocusItemPtr\fR;
int \fIgotFocus\fR;
int \fIcursorOn\fR;
-} Tk_CanvasTextInfo;
+} \fBTk_CanvasTextInfo\fR;
.CE
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
used for drawing the background under selected text.
@@ -97,6 +96,5 @@ anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR).
If all of the selected text in the item is deleted, the item should
set \fIselItemPtr\fR to NULL to indicate that there is no longer a
selection.
-
.SH KEYWORDS
canvas, focus, insertion cursor, selection, selection anchor, text
diff --git a/doc/Clipboard.3 b/doc/Clipboard.3
index 6555290..e06fae5 100644
--- a/doc/Clipboard.3
+++ b/doc/Clipboard.3
@@ -31,10 +31,9 @@ Conversion type for this clipboard item; has same meaning as
.AP Atom format in
Representation to use when data is retrieved; has same meaning as
\fIformat\fR argument to \fBTk_CreateSelHandler\fR.
-.AP char *buffer in
+.AP "const char" *buffer in
Null terminated string containing the data to be appended to the clipboard.
.BE
-
.SH DESCRIPTION
.PP
These two procedures manage the clipboard for Tk.
@@ -43,9 +42,10 @@ once, then calling \fBTk_ClipboardAppend\fR to add data for any
number of targets.
.PP
\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any
-data items previously stored on the clipboard in this application.
+data items previously stored on the clipboard in this application.
It normally returns \fBTCL_OK\fR, but if an error occurs it returns
-\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR.
+\fBTCL_ERROR\fR and leaves an error message in interpreter
+\fIinterp\fR's result.
\fBTk_ClipboardClear\fR must be called before a sequence of
\fBTk_ClipboardAppend\fR calls can be issued.
.PP
@@ -60,8 +60,8 @@ currently owned by the application, either
because \fBTk_ClipboardClear\fR has not been called or because
ownership of the clipboard has changed since the last call to
\fBTk_ClipboardClear\fR,
-\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in
-\fIinterp->result\fR.
+\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error
+message in the result of interpreter \fIinterp\fR.
.PP
In order to guarantee atomicity, no event handling should occur
between \fBTk_ClipboardClear\fR and the following
@@ -73,6 +73,5 @@ this application).
Tcl scripts, as a result of losing the CLIPBOARD selection, so
any calling function should take care to be reentrant at the point
\fBTk_ClipboardClear\fR is invoked.
-
.SH KEYWORDS
append, clipboard, clear, format, type
diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3
index 961f2d7..545e63c 100644
--- a/doc/ClrSelect.3
+++ b/doc/ClrSelect.3
@@ -23,10 +23,9 @@ window.
.AP Atom selection in
The name of selection to be cleared.
.BE
-
.SH DESCRIPTION
.PP
-\fBTk_ClearSelection\fR cancels the selection specified by the atom
+\fBTk_ClearSelection\fR cancels the selection specified by the atom
\fIselection\fR for the display containing \fItkwin\fR.
The selection need not be in \fItkwin\fR itself or even in
\fItkwin\fR's application.
@@ -35,6 +34,5 @@ owns \fIselection\fR, the window will be notified and the
selection will be cleared.
If there is no owner for \fIselection\fR on the display, then the
procedure has no effect.
-
.SH KEYWORDS
clear, selection
diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3
index 6a3e41a..9b83898 100644
--- a/doc/ConfigWidg.3
+++ b/doc/ConfigWidg.3
@@ -25,12 +25,12 @@ int
.sp
\fBTk_FreeOptions(\fIspecs, widgRec, display, flags\fB)\fR
.SH ARGUMENTS
-.AS Tk_ConfigSpec *widgRec in/out
+.AS char *widgRec in/out
.AP Tcl_Interp *interp in
Interpreter to use for returning error messages.
.AP Tk_Window tkwin in
Window used to represent widget (needed to set up X resources).
-.AP Tk_ConfigSpec *specs in
+.AP "const Tk_ConfigSpec" *specs in
Pointer to table specifying legal configuration options for this
widget.
.AP int argc in
@@ -61,7 +61,7 @@ Display containing widget whose record is being freed; needed in
order to free up resources.
.BE
.SH DESCRIPTION
-.PP
+.PP
Note: \fBTk_ConfigureWidget\fR should be replaced with the new
\fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is
retained for backward compatibility.
@@ -89,7 +89,7 @@ to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
case it does not modify \fIinterp\fR.
If an error
occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
-leave an error message in \fIinterp->result\fR in the standard Tcl
+leave an error message in interpreter \fIinterp\fR's result in the standard Tcl
fashion.
In the event of an error return, some of the fields of \fIwidgRec\fR
could already have been set, if configuration information for them
@@ -103,14 +103,14 @@ option and has the following structure:
.CS
typedef struct {
int \fItype\fR;
- char *\fIargvName\fR;
- char *\fIdbName\fR;
- char *\fIdbClass\fR;
- char *\fIdefValue\fR;
+ const char *\fIargvName\fR;
+ const char *\fIdbName\fR;
+ const char *\fIdbClass\fR;
+ const char *\fIdefValue\fR;
int \fIoffset\fR;
int \fIspecFlags\fR;
- Tk_CustomOption *\fIcustomPtr\fR;
-} Tk_ConfigSpec;
+ const Tk_CustomOption *\fIcustomPtr\fR;
+} \fBTk_ConfigSpec\fR;
.CE
The \fItype\fR field indicates what type of configuration option this is
(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
@@ -356,7 +356,6 @@ is an empty string then the target will be set to NULL.
\fBTK_CONFIG_WINDOW\fR
The value must be a window path name. It is translated to a
\fBTk_Window\fR token and the token is stored in the target.
-
.SH "GROUPED ENTRIES"
.PP
In some cases it is useful to generate multiple resources from
@@ -374,7 +373,6 @@ Each of the entries after the first must have a NULL value in its
\fIargvName\fR field; this indicates that the entry is to be grouped
with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR
fields are used from these follow-on entries.
-
.SH "FLAGS"
.PP
The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used
@@ -434,13 +432,11 @@ once, save the value, and provide it before calling
.TP
\fBTK_CONFIG_OPTION_SPECIFIED\fR
This bit is
-.VS 8.5
deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR
so that callers could detect what entries were specified in
\fIargv\fR, but it was removed because it was inherently
thread-unsafe. Code that wishes to detect what options were specified
should use \fBTk_SetOptions\fR instead.
-.VE 8.5
.PP
The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
used to specify different default values for
@@ -473,7 +469,6 @@ for which this entry is valid. When calling \fBTk_ConfigureWidget\fR,
\fIflags\fR will have a single one of these bits set to select the
entries for the desired widget type. For a working example of
this feature, see the code in tkButton.c.
-
.SH TK_OFFSET
.PP
The \fBTk_Offset\fR macro is provided as a safe way of generating
@@ -481,7 +476,6 @@ the \fIoffset\fR values for entries in Tk_ConfigSpec structures.
It takes two arguments: the name of a type of record, and the
name of a field in that record. It returns the byte offset of
the named field in records of the given type.
-
.SH TK_CONFIGUREINFO
.PP
The \fBTk_ConfigureInfo\fR procedure may be used to obtain
@@ -492,12 +486,12 @@ pointer to a widget record containing the current information for
a widget (\fIwidgRec\fR), and a NULL \fIargvName\fR argument,
\fBTk_ConfigureInfo\fR generates a string describing all of the
configuration options for the window. The string is placed
-in \fIinterp->result\fR. Under normal circumstances
+in interpreter \fIinterp\fR's result. Under normal circumstances
it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
-and \fIinterp->result\fR contains an error message.
+and the interpreter's result will contain an error message.
.PP
If \fIargvName\fR is NULL, then the value left in
-\fIinterp->result\fR by \fBTk_ConfigureInfo\fR
+the interpreter's result by \fBTk_ConfigureInfo\fR
consists of a list of one or more entries, each of which describes
one configuration option (i.e. one entry in \fIspecs\fR). Each
entry in the list will contain either two or five values. If the
@@ -510,27 +504,25 @@ field of \fIwidgRec\fR by calling procedures like \fBTk_NameOfColor\fR.
.PP
If the \fIargvName\fR argument to \fBTk_ConfigureInfo\fR is non-NULL,
then it indicates a single option, and information is returned only
-for that option. The string placed in \fIinterp->result\fR will be
+for that option. The string placed in the interpreter's result will be
a list containing two or five values as described above; this will
be identical to the corresponding sublist that would have been returned
if \fIargvName\fR had been NULL.
.PP
The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict
the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
-
.SH TK_CONFIGUREVALUE
.PP
\fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR;
instead of returning a list of values, it just returns the current value
of the option given by \fIargvName\fR (\fIargvName\fR must not be NULL).
-The value is returned in \fIinterp->result\fR and \fBTCL_OK\fR is
+The value is returned in interpreter \fIinterp\fR's result and \fBTCL_OK\fR is
normally returned as the procedure's result.
If an error occurs in \fBTk_ConfigureValue\fR (e.g., \fIargvName\fR is
not a valid option name), \fBTCL_ERROR\fR is returned and an error message
-is left in \fIinterp->result\fR.
+is left in the interpreter's result.
This procedure is typically called to implement \fBcget\fR widget
commands.
-
.SH TK_FREEOPTIONS
.PP
The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
@@ -543,7 +535,6 @@ it contains a null pointer) then no resource is freed for that
entry.
After freeing a resource, \fBTk_FreeOptions\fR sets the
corresponding field of the widget record to null.
-
.SH "CUSTOM OPTION TYPES"
.PP
Applications can extend the built-in configuration types with additional
@@ -554,22 +545,22 @@ typedef struct Tk_CustomOption {
Tk_OptionParseProc *\fIparseProc\fR;
Tk_OptionPrintProc *\fIprintProc\fR;
ClientData \fIclientData\fR;
-} Tk_CustomOption;
+} \fBTk_CustomOption\fR;
-typedef int Tk_OptionParseProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- Tk_Window \fItkwin\fR,
- char *\fIvalue\fR,
- char *\fIwidgRec\fR,
- int \fIoffset\fR);
+typedef int \fBTk_OptionParseProc\fR(
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIvalue\fR,
+ char *\fIwidgRec\fR,
+ int \fIoffset\fR);
-typedef char *Tk_OptionPrintProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\fR,
- char *\fIwidgRec\fR,
- int \fIoffset\fR,
- Tcl_FreeProc **\fIfreeProcPtr\fR);
+typedef const char *\fBTk_OptionPrintProc\fR(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIwidgRec\fR,
+ int \fIoffset\fR,
+ Tcl_FreeProc **\fIfreeProcPtr\fR);
.CE
The Tk_CustomOption structure contains three fields, which are pointers
to the two procedures and a \fIclientData\fR value to be passed to those
@@ -599,7 +590,7 @@ be placed. The procedure should translate the string to whatever
form is appropriate for the option and store the value in the widget
record. It should normally return \fBTCL_OK\fR, but if an error occurs
in translating the string to a value then it should return \fBTCL_ERROR\fR
-and store an error message in \fIinterp->result\fR.
+and store an error message in interpreter \fIinterp\fR's result.
.PP
The \fIprintProc\fR procedure is called
by \fBTk_ConfigureInfo\fR to produce a string value describing an
@@ -622,7 +613,6 @@ Tk_CustomOption structure has been created for them, options of this
new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR
fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
to the Tk_CustomOption structure.
-
.SH EXAMPLES
.PP
Although the explanation of \fBTk_ConfigureWidget\fR is fairly
@@ -633,10 +623,8 @@ The library implementation of frames
(tkFrame.c) has a simple configuration table, and the library
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,
diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3
index f984f8e..4e4eb66 100644
--- a/doc/CoordToWin.3
+++ b/doc/CoordToWin.3
@@ -25,7 +25,6 @@ Y-coordinate (in root window coordinates).
.AP Tk_Window tkwin in
Token for window that identifies application.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CoordsToWindow\fR locates the window that contains a given point.
@@ -44,6 +43,5 @@ which window contains the mouse cursor: if a parent and a child both
contain the point then the child gets preference, and if two siblings
both contain the point then the highest one in the stacking order
(i.e. the one that's visible on the screen) gets preference.
-
.SH KEYWORDS
containing, coordinates, root window
diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3
index f8c72e5..05616fb 100644
--- a/doc/CrtCmHdlr.3
+++ b/doc/CrtCmHdlr.3
@@ -20,10 +20,8 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced
.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 is not handled by
\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
@@ -39,9 +37,9 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\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);
+typedef int \fBTk_ClientMessageProc\fR(
+ 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.
@@ -62,6 +60,5 @@ 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/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3
index a75414e..acbd9f6 100644
--- a/doc/CrtErrHdlr.3
+++ b/doc/CrtErrHdlr.3
@@ -72,9 +72,9 @@ made when the handler was active (see below for more information).
\fIProc\fR should have arguments and result that match the
following type:
.CS
-typedef int Tk_ErrorProc(
- ClientData \fIclientData\fR,
- XErrorEvent *\fIerrEventPtr\fR);
+typedef int \fBTk_ErrorProc\fR(
+ ClientData \fIclientData\fR,
+ XErrorEvent *\fIerrEventPtr\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTcl_CreateErrorHandler\fR when the callback
@@ -136,6 +136,5 @@ handlers deleted before the \fBXSync\fR call.
For the Tk error handling mechanism to work properly, it is essential
that application code never calls \fBXSetErrorHandler\fR directly;
applications should use only \fBTk_CreateErrorHandler\fR.
-
.SH KEYWORDS
callback, error, event, handler
diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3
index a1bc637..68a2cd8 100644
--- a/doc/CrtGenHdlr.3
+++ b/doc/CrtGenHdlr.3
@@ -24,7 +24,6 @@ Procedure to invoke whenever any X event occurs on any display.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be
@@ -45,9 +44,9 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\fIProc\fR should have arguments and result that match the
type \fBTk_GenericProc\fR:
.CS
-typedef int Tk_GenericProc(
- ClientData \fIclientData\fR,
- XEvent *\fIeventPtr\fR);
+typedef int \fBTk_GenericProc\fR(
+ ClientData \fIclientData\fR,
+ XEvent *\fIeventPtr\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTk_CreateGenericHandler\fR when the callback
diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3
index da083e0..d93f4b4 100644
--- a/doc/CrtImgType.3
+++ b/doc/CrtImgType.3
@@ -21,11 +21,12 @@ ClientData
.sp
\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR)
.SH ARGUMENTS
-.AS Tk_ImageType *typePtrPtr
-.AP Tk_ImageType *typePtr in
+.AS "const Tk_ImageType" *typePtrPtr
+.AP "const Tk_ImageType" *typePtr in
Structure that defines the new type of image.
-Must be static: a
+For Tk 8.4 and earlier this must be static: a
pointer to this structure is retained by the image code.
+In Tk 8.5, this limitation was relaxed.
.AP Tcl_Interp *interp in
Interpreter in which image was created.
.AP "const char" *name in
@@ -38,7 +39,6 @@ Number of arguments
.AP char ***argvPtr in/out
Pointer to argument list
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreateImageType\fR is invoked to define a new kind of image.
@@ -59,13 +59,13 @@ the name of the image type and pointers to five procedures provided
by the image manager to deal with images of this type:
.CS
typedef struct Tk_ImageType {
- char *\fIname\fR;
+ const char *\fIname\fR;
Tk_ImageCreateProc *\fIcreateProc\fR;
Tk_ImageGetProc *\fIgetProc\fR;
Tk_ImageDisplayProc *\fIdisplayProc\fR;
Tk_ImageFreeProc *\fIfreeProc\fR;
Tk_ImageDeleteProc *\fIdeleteProc\fR;
-} Tk_ImageType;
+} \fBTk_ImageType\fR;
.CE
The fields of this structure will be described in later subsections
of this entry.
@@ -92,7 +92,6 @@ option specified for a widget or canvas item.
.PP
The following subsections describe the fields of a Tk_ImageType
in more detail.
-
.SS NAME
.PP
\fItypePtr->name\fR provides a name for the image type.
@@ -101,21 +100,21 @@ in \fBimage create\fR commands to create images of the new
type.
If there already existed an image type by this name then
the new image type replaces the old one.
-
.SS CREATEPROC
+.PP
\fItypePtr->createProc\fR provides the address of a procedure for
Tk to call whenever \fBimage create\fR is invoked to create
an image of the new type.
\fItypePtr->createProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageCreateProc(
- Tcl_Interp *\fIinterp\fR,
- char *\fIname\fR,
- int \fIobjc\fR,
- Tcl_Obj *const \fIobjv\fR[],
- Tk_ImageType *\fItypePtr\fR,
- Tk_ImageMaster \fImaster\fR,
- ClientData *\fImasterDataPtr\fR);
+typedef int \fBTk_ImageCreateProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ const char *\fIname\fR,
+ int \fIobjc\fR,
+ Tcl_Obj *const \fIobjv\fR[],
+ const Tk_ImageType *\fItypePtr\fR,
+ Tk_ImageMaster \fImaster\fR,
+ ClientData *\fImasterDataPtr\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the \fBimage\fR
command was invoked, and \fIname\fR is the name for the new image,
@@ -141,16 +140,15 @@ it should return \fBTCL_OK\fR.
.PP
\fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the
size of the image and request an initial redisplay.
-
.SS GETPROC
.PP
\fItypePtr->getProc\fR is invoked by Tk whenever a widget
calls \fBTk_GetImage\fR to use a particular image.
This procedure must match the following prototype:
.CS
-typedef ClientData Tk_ImageGetProc(
- Tk_Window \fItkwin\fR,
- ClientData \fImasterData\fR);
+typedef ClientData \fBTk_ImageGetProc\fR(
+ Tk_Window \fItkwin\fR,
+ ClientData \fImasterData\fR);
.CE
The \fItkwin\fR argument identifies the window in which the
image will be used and \fImasterData\fR is the value
@@ -162,23 +160,22 @@ display the image in the given window.
is typically the address of the instance data structure.
Tk will pass this value back to the image manager when invoking
its \fIdisplayProc\fR and \fIfreeProc\fR procedures.
-
.SS DISPLAYPROC
.PP
\fItypePtr->displayProc\fR is invoked by Tk whenever an image needs
to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR).
\fIdisplayProc\fR must match the following prototype:
.CS
-typedef void Tk_ImageDisplayProc(
- ClientData \fIinstanceData\fR,
- Display *\fIdisplay\fR,
- Drawable \fIdrawable\fR,
- int \fIimageX\fR,
- int \fIimageY\fR,
- int \fIwidth\fR,
- int \fIheight\fR,
- int \fIdrawableX\fR,
- int \fIdrawableY\fR);
+typedef void \fBTk_ImageDisplayProc\fR(
+ ClientData \fIinstanceData\fR,
+ Display *\fIdisplay\fR,
+ Drawable \fIdrawable\fR,
+ int \fIimageX\fR,
+ int \fIimageY\fR,
+ int \fIwidth\fR,
+ int \fIheight\fR,
+ int \fIdrawableX\fR,
+ int \fIdrawableY\fR);
.CE
The \fIinstanceData\fR will be the same as the value returned by
\fIgetProc\fR when the instance was created.
@@ -195,7 +192,6 @@ as specified in the most recent call to \fBTk_ImageChanged\fR.
the image should be displayed; \fIdisplayProc\fR should display
the given region of the image so that point (\fIimageX\fR, \fIimageY\fR)
in the image appears at (\fIdrawableX\fR, \fIdrawableY\fR) in \fIdrawable\fR.
-
.SS FREEPROC
.PP
\fItypePtr->freeProc\fR contains the address of a procedure that
@@ -206,16 +202,15 @@ in a canvas is deleted, or when the image displayed in a widget or
canvas item is changed.
\fIfreeProc\fR must match the following prototype:
.CS
-typedef void Tk_ImageFreeProc(
- ClientData \fIinstanceData\fR,
- Display *\fIdisplay\fR);
+typedef void \fBTk_ImageFreeProc\fR(
+ ClientData \fIinstanceData\fR,
+ Display *\fIdisplay\fR);
.CE
The \fIinstanceData\fR will be the same as the value returned by
\fIgetProc\fR when the instance was created, and \fIdisplay\fR
is the display containing the window for the instance.
\fIfreeProc\fR should release any resources associated with the
image instance, since the instance will never be used again.
-
.SS DELETEPROC
.PP
\fItypePtr->deleteProc\fR is a procedure that Tk invokes when an
@@ -225,15 +220,14 @@ Before invoking \fIdeleteProc\fR Tk will invoke \fIfreeProc\fR for
each of the image's instances.
\fIdeleteProc\fR must match the following prototype:
.CS
-typedef void Tk_ImageDeleteProc(
- ClientData \fImasterData\fR);
+typedef void \fBTk_ImageDeleteProc\fR(
+ ClientData \fImasterData\fR);
.CE
The \fImasterData\fR argument will be the same as the value
stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the
image was created.
\fIdeleteProc\fR should release any resources associated with
the image.
-
.SH TK_GETIMAGEMASTERDATA
.PP
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
@@ -247,19 +241,19 @@ and the return value is the ClientData value returned by the
\fIcreateProc\fR when the image was created (this is typically a
pointer to the image master data structure). If no such image exists
then NULL is returned and NULL is stored at \fI*typePtrPtr\fR.
-
.SH "LEGACY INTERFACE SUPPORT"
+.PP
In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR
was incompatibly different, with the following prototype:
.CS
-typedef int Tk_ImageCreateProc(
- Tcl_Interp *\fIinterp\fR,
- char *\fIname\fR,
- int \fIargc\fR,
- char **\fIargv\fR,
- Tk_ImageType *\fItypePtr\fR,
- Tk_ImageMaster \fImaster\fR,
- ClientData *\fImasterDataPtr\fR);
+typedef int \fBTk_ImageCreateProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ char *\fIname\fR,
+ int \fIargc\fR,
+ char **\fIargv\fR,
+ Tk_ImageType *\fItypePtr\fR,
+ Tk_ImageMaster \fImaster\fR,
+ ClientData *\fImasterDataPtr\fR);
.CE
Legacy programs and libraries dating from those days may still
contain code that defines extended Tk image types using the old
@@ -283,9 +277,7 @@ use Tk 8.4 headers and stub libraries to do so.
.PP
Any new code written today should not make use of the legacy
interfaces. Expect their support to go away in Tk 9.
-
.SH "SEE ALSO"
Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
-
.SH KEYWORDS
image manager, image type, instance, master
diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3
index 4f06438..bc034a7 100644
--- a/doc/CrtItemType.3
+++ b/doc/CrtItemType.3
@@ -44,7 +44,7 @@ NULL \fInextPtr\fR.
.PP
You may find it easier to understand the rest of this manual entry
by looking at the code for an existing canvas item type such as
-bitmap (file tkCanvBmap.c) or text (tkCanvText.c).
+bitmap (in the file tkCanvBmap.c) or text (tkCanvText.c).
The easiest way to create a new type manager is to copy the code
for an existing type and modify it for the new type.
.PP
@@ -60,12 +60,13 @@ structures.
The first data structure is a Tk_ItemType; it contains
information such as the name of the type and pointers to
the standard procedures implemented by the type manager:
+.PP
.CS
typedef struct Tk_ItemType {
- char *\fIname\fR;
+ const char *\fIname\fR;
int \fIitemSize\fR;
Tk_ItemCreateProc *\fIcreateProc\fR;
- Tk_ConfigSpec *\fIconfigSpecs\fR;
+ const Tk_ConfigSpec *\fIconfigSpecs\fR;
Tk_ItemConfigureProc *\fIconfigProc\fR;
Tk_ItemCoordProc *\fIcoordProc\fR;
Tk_ItemDeleteProc *\fIdeleteProc\fR;
@@ -82,7 +83,7 @@ typedef struct Tk_ItemType {
Tk_ItemInsertProc *\fIinsertProc\fR;
Tk_ItemDCharsProc *\fIdCharsProc\fR;
Tk_ItemType *\fInextPtr\fR;
-} Tk_ItemType;
+} \fBTk_ItemType\fR;
.CE
.PP
The fields of a Tk_ItemType structure are described in more detail
@@ -92,7 +93,7 @@ argument must point to a structure with all of the fields initialized
except \fInextPtr\fR, which Tk sets to link all the types together
into a list.
The structure must be in permanent memory (either statically
-allocated or dynamically allocated but never freed); Tk retains
+allocated or dynamically allocated but never freed); Tk retains
a pointer to this structure.
.PP
The second data structure manipulated by a type manager is an
@@ -102,11 +103,12 @@ All of the items of a given type generally have item records with
the same structure, but different types usually have different
formats for their item records.
The first part of each item record is a header with a standard structure
-defined by Tk via the type Tk_Item; the rest of the item
+defined by Tk via the type Tk_Item; the rest of the item
record is defined by the type manager.
A type manager must define its item records with a Tk_Item as
the first field.
For example, the item record for bitmap items is defined as follows:
+.PP
.CS
typedef struct BitmapItem {
Tk_Item \fIheader\fR;
@@ -116,8 +118,9 @@ typedef struct BitmapItem {
XColor *\fIfgColor\fR;
XColor *\fIbgColor\fR;
GC \fIgc\fR;
-} BitmapItem;
+} \fBBitmapItem\fR;
.CE
+.PP
The \fIheader\fR substructure contains information used by Tk
to manage the item, such as its identifier, its tags, its type,
and its bounding box.
@@ -127,7 +130,7 @@ The type manager should not need to read or write any of the
fields in the header except for four fields
whose names are \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
These fields give a bounding box for the items using integer
-canvas coordinates: the item should not cover any pixels
+canvas coordinates: the item should not cover any pixels
with x-coordinate lower than \fIx1\fR or y-coordinate
lower than \fIy1\fR, nor should it cover any pixels with
x-coordinate greater than or equal to \fIx2\fR or y-coordinate
@@ -137,12 +140,12 @@ date as the item is moved and reconfigured.
.PP
Whenever Tk calls a procedure in a type manager it passes in a pointer
to an item record.
-The argument is always passed as a pointer to a Tk_Item; the type
+The argument is always passed as a pointer to a Tk_Item; the type
manager will typically cast this into a pointer to its own specific
type, such as BitmapItem.
.PP
The third data structure used by type managers has type
-Tk_Canvas; it serves as an opaque handle for the canvas widget
+Tk_Canvas; it serves as an opaque handle for the canvas widget
as a whole.
Type managers need not know anything about the contents of this
structure.
@@ -150,6 +153,7 @@ A Tk_Canvas handle is typically passed in to the
procedures of a type manager, and the type manager can pass the
handle back to library procedures such as Tk_CanvasTkwin
to fetch information about the canvas.
+.SH "TK_ITEMTYPE FIELDS"
.SS NAME
.PP
This section and the ones that follow describe each of the fields
@@ -160,8 +164,37 @@ in \fBcreate\fR widget commands to create items of the new
type.
If there already existed an item type by this name then
the new item type replaces the old one.
+.SS "FLAGS (IN ALWAYSREDRAW)"
+.PP
+The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons)
+contains a collection of flag bits that modify how the canvas core interacts
+with the item. The following bits are defined:
+.TP
+\fB1\fR
+.
+Indicates that the item should always be redrawn when any part of the canvas
+is redrawn, rather than only when the bounding box of the item overlaps the
+area being redrawn. This is used by window items, for example, which need to
+unmap subwindows that are not on the screen.
+.TP
+\fBTK_CONFIG_OBJS\fR
+.
+Indicates that operations which would otherwise take a string (or array of
+strings) actually take a Tcl_Obj reference (or an array of such references).
+The operations to which this applies are the \fIconfigProc\fR, the
+\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the
+\fIinsertProc\fR.
+.TP
+\fBTK_MOVABLE_POINTS\fR
+.VS 8.6
+Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and
+\fIinsertProc\fR with the same semantics as Tk's built-in line and polygon
+types, and that hence individual coordinate points can be moved. Must not be
+set if any of the above methods is NULL.
+.VE 8.6
.SS ITEMSIZE
-\fItypePtr->itemSize\fR gives the size in bytes of item records
+.PP
+\fItypePtr\->itemSize\fR gives the size in bytes of item records
of this type, including the Tk_Item header.
Tk uses this size to allocate memory space for items of the type.
All of the item records for a given type must have the same size.
@@ -170,31 +203,38 @@ of points for a polygon), the type manager can allocate a separate
object of variable length and keep a pointer to it in the item record.
.SS CREATEPROC
.PP
-\fItypePtr->createProc\fR points to a procedure for
+\fItypePtr\->createProc\fR points to a procedure for
Tk to call whenever a new item of this type is created.
-\fItypePtr->createProc\fR must match the following prototype:
+\fItypePtr\->createProc\fR must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemCreateProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIobjc\fR,
- Tcl_Obj* const \fIobjv\fR[]);
+typedef int \fBTk_ItemCreateProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIobjc\fR,
+ Tcl_Obj *const \fIobjv\fR[]);
.CE
+.PP
The \fIinterp\fR argument is the interpreter in which the canvas's
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
handle for the canvas widget.
\fIitemPtr\fR is a pointer to a newly-allocated item of
-size \fItypePtr->itemSize\fR.
+size \fItypePtr\->itemSize\fR.
Tk has already initialized the item's header (the first
\fBsizeof(Tk_ItemType)\fR bytes).
The \fIobjc\fR and \fIobjv\fR arguments describe all of the
arguments to the \fBcreate\fR command after the \fItype\fR
argument.
-For example, in the widget command
+Note that if \fBTK_CONFIG_OBJS\fR is not set in the
+\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
+contain a pointer to an array of constant strings.
+For example, in the widget command:
+.PP
.CS
\fB\&.c create rectangle 10 20 50 50 \-fill black\fR
.CE
+.PP
\fIobjc\fR will be \fB6\fR and \fIobjv\fR[0] will contain the
integer object \fB10\fR.
.PP
@@ -202,7 +242,7 @@ integer object \fB10\fR.
the type-specific parts of the item record and set an initial value
for the bounding box in the item's header.
It should return a standard Tcl completion code and leave an
-error message in \fIinterp->result\fR if an error occurs.
+error message in the interpreter result if an error occurs.
If an error occurs Tk will free the item record, so \fIcreateProc\fR
must be sure to leave the item record in a clean state if it returns an error
(e.g., it must free any additional memory that it allocated for
@@ -212,70 +252,84 @@ the item).
Each type manager must provide a standard table describing its
configuration options, in a form suitable for use with
\fBTk_ConfigureWidget\fR.
-This table will normally be used by \fItypePtr->createProc\fR
-and \fItypePtr->configProc\fR, but Tk also uses it directly
+This table will normally be used by \fItypePtr\->createProc\fR
+and \fItypePtr\->configProc\fR, but Tk also uses it directly
to retrieve option information in the \fBitemcget\fR and
\fBitemconfigure\fR widget commands.
-\fItypePtr->configSpecs\fR must point to the configuration table
+\fItypePtr\->configSpecs\fR must point to the configuration table
for this type.
Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
-for implementing the \fB\-tags\fR option; see an existing type
+for implementing the \fB\-tags\fR option; see an existing type
manager for an example of how to use it in \fIconfigSpecs\fR.
.SS CONFIGPROC
.PP
-\fItypePtr->configProc\fR is called by Tk whenever the
+\fItypePtr\->configProc\fR is called by Tk whenever the
\fBitemconfigure\fR widget command is invoked to change the
configuration options for a canvas item.
This procedure must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemConfigureProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIobjc\fR,
- Tcl_Obj* const \fIobjv\fR[],
- int \fIflags\fR);
+typedef int \fBTk_ItemConfigureProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIobjc\fR,
+ Tcl_Obj *const \fIobjv\fR[],
+ int \fIflags\fR);
.CE
-The \fIinterp\fR objument identifies the interpreter in which the
-widget command was invoked, \fIcanvas\fR is a handle for the canvas
+.PP
+The \fIinterp\fR argument identifies the interpreter in which the
+widget command was invoked, \fIcanvas\fR is a handle for the canvas
widget, and \fIitemPtr\fR is a pointer to the item being configured.
-\fIobjc\fR and \fIobjv\fR contain the configuration options. For
-example, if the following command is invoked:
+\fIobjc\fR and \fIobjv\fR contain the configuration options.
+Note that if \fBTK_CONFIG_OBJS\fR is not set in the
+\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
+contain a pointer to an array of constant strings.
+For example, if the following command is invoked:
+.PP
.CS
\fB\&.c itemconfigure 2 \-fill red \-outline black\fR
.CE
+.PP
\fIobjc\fR is \fB4\fR and \fIobjv\fR contains the string objects \fB\-fill\fR
through \fBblack\fR.
\fIobjc\fR will always be an even value.
-The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
+The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk
-invokes \fItypePtr->configProc\fR, but the type manager's \fIcreateProc\fR
+invokes \fItypePtr\->configProc\fR, but the type manager's \fIcreateProc\fR
procedure will usually invoke \fIconfigProc\fR with different flag values.
.PP
-\fItypePtr->configProc\fR returns a standard Tcl completion code and
-leaves an error message in \fIinterp->result\fR if an error occurs.
+\fItypePtr\->configProc\fR returns a standard Tcl completion code and
+leaves an error message in the interpreter result if an error occurs.
It must update the item's bounding box to reflect the new configuration
options.
.SS COORDPROC
.PP
-\fItypePtr->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
+\fItypePtr\->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
widget command for an item.
It must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemCoordProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIobjc\fR,
- Tcl_Obj* const \fIobjv\fR[]);
+typedef int \fBTk_ItemCoordProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIobjc\fR,
+ Tcl_Obj *const \fIobjv\fR[]);
.CE
+.PP
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
describe the coordinate arguments.
+Note that if \fBTK_CONFIG_OBJS\fR is not set in the
+\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually
+contain a pointer to an array of constant strings.
For example, if the following widget command is invoked:
+.PP
.CS
\fB\&.c coords 2 30 90\fR
.CE
+.PP
\fIobjc\fR will be \fB2\fR and \fBobjv\fR will contain the integer objects
\fB30\fR and \fB90\fR.
.PP
@@ -284,41 +338,45 @@ update the item appropriately (e.g., it must reset the bounding
box in the item's header), and return a standard Tcl completion
code.
If an error occurs, \fIcoordProc\fR must leave an error message in
-\fIinterp->result\fR.
+the interpreter result.
.SS DELETEPROC
.PP
-\fItypePtr->deleteProc\fR is invoked by Tk to delete an item
+\fItypePtr\->deleteProc\fR is invoked by Tk to delete an item
and free any resources allocated to it.
It must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemDeleteProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- Display *\fIdisplay\fR);
+typedef void \fBTk_ItemDeleteProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ Display *\fIdisplay\fR);
.CE
+.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
interpretations, and \fIdisplay\fR identifies the X display containing
the canvas.
\fIdeleteProc\fR must free up any resources allocated for the item,
so that Tk can free the item record.
-\fIdeleteProc\fR should not actually free the item record; this will
+\fIdeleteProc\fR should not actually free the item record; this will
be done by Tk when \fIdeleteProc\fR returns.
-.SS "DISPLAYPROC AND ALWAYSREDRAW"
+.SS "DISPLAYPROC"
.PP
-\fItypePtr->displayProc\fR is invoked by Tk to redraw an item
+\fItypePtr\->displayProc\fR is invoked by Tk to redraw an item
on the screen.
It must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemDisplayProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- Display *\fIdisplay\fR,
- Drawable \fIdst\fR,
- int \fIx\fR,
- int \fIy\fR,
- int \fIwidth\fR,
- int \fIheight\fR);
+typedef void \fBTk_ItemDisplayProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ Display *\fIdisplay\fR,
+ Drawable \fIdst\fR,
+ int \fIx\fR,
+ int \fIy\fR,
+ int \fIwidth\fR,
+ int \fIheight\fR);
.CE
+.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIdisplay\fR identifies the display containing the canvas, and
\fIdst\fR specifies a drawable in which the item should be rendered;
@@ -340,25 +398,28 @@ of \fIdst\fR.
.PP
Normally an item's \fIdisplayProc\fR is only invoked if the item
overlaps the area being displayed.
-However, if \fItypePtr->alwaysRedraw\fR has a non-zero value, then
-\fIdisplayProc\fR is invoked during every redisplay operation,
-even if the item does not overlap the area of redisplay.
-\fIalwaysRedraw\fR should normally be set to 0; it is only
-set to 1 in special cases such as window items that need to be
-unmapped when they are off-screen.
+However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1,
+(i.e.\|
+.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" )
+then \fIdisplayProc\fR is invoked during every redisplay operation,
+even if the item does not overlap the area of redisplay; this is useful for
+cases such as window items, where the subwindow needs to be unmapped when it
+is off the screen.
.SS POINTPROC
.PP
-\fItypePtr->pointProc\fR is invoked by Tk to find out how close
+\fItypePtr\->pointProc\fR is invoked by Tk to find out how close
a given point is to a canvas item.
Tk uses this procedure for purposes such as locating the item
under the mouse or finding the closest item to a given point.
The procedure must match the following prototype:
+.PP
.CS
-typedef double Tk_ItemPointProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double *\fIpointPtr\fR);
+typedef double \fBTk_ItemPointProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double *\fIpointPtr\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIpointPtr\fR points to an array of two numbers giving
the x and y coordinates of a point.
@@ -367,15 +428,17 @@ from the point to the item, or 0 if the point lies inside
the item.
.SS AREAPROC
.PP
-\fItypePtr->areaProc\fR is invoked by Tk to find out the relationship
+\fItypePtr\->areaProc\fR is invoked by Tk to find out the relationship
between an item and a rectangular area.
It must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemAreaProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double *\fIrectPtr\fR);
+typedef int \fBTk_ItemAreaProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double *\fIrectPtr\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIrectPtr\fR points to an array of four real numbers;
the first two give the x and y coordinates of the upper left
@@ -386,26 +449,28 @@ the given area, 0 if it lies partially inside and partially
outside the area, and 1 if it lies entirely inside the area.
.SS POSTSCRIPTPROC
.PP
-\fItypePtr->postscriptProc\fR is invoked by Tk to generate
+\fItypePtr\->postscriptProc\fR is invoked by Tk to generate
Postscript for an item during the \fBpostscript\fR widget command.
If the type manager is not capable of generating Postscript then
-\fItypePtr->postscriptProc\fR should be NULL.
+\fItypePtr\->postscriptProc\fR should be NULL.
The procedure must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemPostscriptProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIprepass\fR);
+typedef int \fBTk_ItemPostscriptProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIprepass\fR);
.CE
+.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have
-standard meanings; \fIprepass\fR will be described below.
+standard meanings; \fIprepass\fR will be described below.
If \fIpostscriptProc\fR completes successfully, it should append
-Postscript for the item to the information in \fIinterp->result\fR
+Postscript for the item to the information in the interpreter result
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
and return \fBTCL_OK\fR.
If an error occurs, \fIpostscriptProc\fR should clear the result
-and replace its contents with an error message; then it should
+and replace its contents with an error message; then it should
return \fBTCL_ERROR\fR.
.PP
Tk provides a collection of utility procedures to simplify
@@ -427,26 +492,29 @@ In order to generate Postscript that complies with the Adobe Document
Structuring Conventions, Tk actually generates Postscript in two passes.
It calls each item's \fIpostscriptProc\fR in each pass.
The only purpose of the first pass is to collect font information
-(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
+(which is done by \fBTk_CanvasPsFont\fR); the actual Postscript is
discarded.
Tk sets the \fIprepass\fR argument to \fIpostscriptProc\fR to 1
-during the first pass; the type manager can use \fIprepass\fR to skip
+during the first pass; the type manager can use \fIprepass\fR to skip
all Postscript generation except for calls to \fBTk_CanvasPsFont\fR.
During the second pass \fIprepass\fR will be 0, so the type manager
must generate complete Postscript.
.SS SCALEPROC
-\fItypePtr->scaleProc\fR is invoked by Tk to rescale a canvas item
+.PP
+\fItypePtr\->scaleProc\fR is invoked by Tk to rescale a canvas item
during the \fBscale\fR widget command.
The procedure must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemScaleProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double \fIoriginX\fR,
- double \fIoriginY\fR,
- double \fIscaleX\fR,
- double \fIscaleY\fR);
+typedef void \fBTk_ItemScaleProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double \fIoriginX\fR,
+ double \fIoriginY\fR,
+ double \fIscaleX\fR,
+ double \fIscaleY\fR);
.CE
+.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which
the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the
@@ -454,146 +522,171 @@ x and y scale factors.
The item should adjust its coordinates so that a point in the item
that used to have coordinates \fIx\fR and \fIy\fR will have new
coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
+.PP
.CS
-\fIx\(fm = originX + scaleX*(x-originX)
-y\(fm = originY + scaleY*(y-originY)\fR
+\fIx\(fm\fR = \fIoriginX\fR + \fIscaleX\fR \(mu (\fIx\fR \(mi \fIoriginX\fR)
+\fIy\(fm\fR = \fIoriginY\fR + \fIscaleY\fR \(mu (\fIy\fR \(mi \fIoriginY\fR)
.CE
+.PP
\fIscaleProc\fR must also update the bounding box in the item's
header.
.SS TRANSLATEPROC
-\fItypePtr->translateProc\fR is invoked by Tk to translate a canvas item
+.PP
+\fItypePtr\->translateProc\fR is invoked by Tk to translate a canvas item
during the \fBmove\fR widget command.
The procedure must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemTranslateProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double \fIdeltaX\fR,
- double \fIdeltaY\fR);
+typedef void \fBTk_ItemTranslateProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double \fIdeltaX\fR,
+ double \fIdeltaY\fR);
.CE
+.PP
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning,
and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be
added to each x and y coordinate within the item.
The type manager should adjust the item's coordinates and
update the bounding box in the item's header.
.SS INDEXPROC
-\fItypePtr->indexProc\fR is invoked by Tk to translate a string
+.PP
+\fItypePtr\->indexProc\fR is invoked by Tk to translate a string
index specification into a numerical index, for example during the
\fBindex\fR widget command.
-It is only relevant for item types that support indexable text;
-\fItypePtr->indexProc\fR may be specified as NULL for non-textual
-item types.
+It is only relevant for item types that support indexable text or coordinates;
+\fItypePtr\->indexProc\fR may be specified as NULL for non-textual
+item types if they do not support detailed coordinate addressing.
The procedure must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemIndexProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- char \fIindexString\fR,
- int *\fIindexPtr\fR);
+typedef int \fBTk_ItemIndexProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ Tcl_Obj *\fIindexObj\fR,
+ int *\fIindexPtr\fR);
.CE
+.PP
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
have the usual meaning.
-\fIindexString\fR contains a textual description of an index,
+\fIindexObj\fR contains a textual description of an index,
and \fIindexPtr\fR points to an integer value that should be
filled in with a numerical index.
+Note that if \fBTK_CONFIG_OBJS\fR is not set in the
+\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will
+actually contain a pointer to a constant string.
It is up to the type manager to decide what forms of index
-are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
+are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR,
\fBend\fR, etc.).
\fIindexProc\fR should return a Tcl completion code and set
-\fIinterp->result\fR in the event of an error.
+the interpreter result in the event of an error.
.SS ICURSORPROC
.PP
-\fItypePtr->icursorProc\fR is invoked by Tk during
+\fItypePtr\->icursorProc\fR is invoked by Tk during
the \fBicursor\fR widget command to set the position of the
insertion cursor in a textual item.
It is only relevant for item types that support an insertion cursor;
-\fItypePtr->icursorProc\fR may be specified as NULL for item types
+\fItypePtr\->icursorProc\fR may be specified as NULL for item types
that do not support an insertion cursor.
The procedure must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemCursorProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIindex\fR);
+typedef void \fBTk_ItemCursorProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIindex\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
\fIindex\fR is an index into the item's text, as returned by a
-previous call to \fItypePtr->insertProc\fR.
+previous call to \fItypePtr\->insertProc\fR.
The type manager should position the insertion cursor in the
item just before the character given by \fIindex\fR.
Whether or not to actually display the insertion cursor is
determined by other information provided by \fBTk_CanvasGetTextInfo\fR.
.SS SELECTIONPROC
.PP
-\fItypePtr->selectionProc\fR is invoked by Tk during selection
-retrievals; it must return part or all of the selected text in
+\fItypePtr\->selectionProc\fR is invoked by Tk during selection
+retrievals; it must return part or all of the selected text in
the item (if any).
It is only relevant for item types that support text;
-\fItypePtr->selectionProc\fR may be specified as NULL for non-textual
+\fItypePtr\->selectionProc\fR may be specified as NULL for non-textual
item types.
The procedure must match the following prototype:
+.PP
.CS
-typedef int Tk_ItemSelectionProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIoffset\fR,
- char *\fIbuffer\fR,
- int \fImaxBytes\fR);
+typedef int \fBTk_ItemSelectionProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIoffset\fR,
+ char *\fIbuffer\fR,
+ int \fImaxBytes\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIoffset\fR is an offset in bytes into the selection where 0 refers
-to the first byte of the selection; it identifies
+to the first byte of the selection; it identifies
the first character that is to be returned in this call.
\fIbuffer\fR points to an area of memory in which to store the
requested bytes, and \fImaxBytes\fR specifies the maximum number
of bytes to return.
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters
-from the selection and copy them to \fImaxBytes\fR; it should
+from the selection and copy them to \fImaxBytes\fR; it should
return a count of the number of bytes actually copied, which may
be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
in the selection.
.SS INSERTPROC
.PP
-\fItypePtr->insertProc\fR is invoked by Tk during
-the \fBinsert\fR widget command to insert new text into a
+\fItypePtr\->insertProc\fR is invoked by Tk during
+the \fBinsert\fR widget command to insert new text or coordinates into a
canvas item.
-It is only relevant for item types that support text;
-\fItypePtr->insertProc\fR may be specified as NULL for non-textual
+It is only relevant for item types that support the \fBinsert\fR method;
+\fItypePtr\->insertProc\fR may be specified as NULL for other
item types.
The procedure must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemInsertProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIindex\fR,
- char *\fIstring\fR);
+typedef void \fBTk_ItemInsertProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIindex\fR,
+ Tcl_Obj *\fIobj\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIindex\fR is an index into the item's text, as returned by a
-previous call to \fItypePtr->insertProc\fR, and \fIstring\fR
+previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR
contains new text to insert just before the character given
by \fIindex\fR.
+Note that if \fBTK_CONFIG_OBJS\fR is not set in the
+\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will
+actually contain a pointer to a constant string to be inserted.
+If the item supports modification of the coordinates list by this
+.PP
The type manager should insert the text and recompute the bounding
box in the item's header.
.SS DCHARSPROC
.PP
-\fItypePtr->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
-widget command to delete a range of text from a canvas item.
+\fItypePtr\->dCharsProc\fR is invoked by Tk during the \fBdchars\fR
+widget command to delete a range of text from a canvas item or a range of
+coordinates from a pathed item.
It is only relevant for item types that support text;
-\fItypePtr->dCharsProc\fR may be specified as NULL for non-textual
-item types.
+\fItypePtr\->dCharsProc\fR may be specified as NULL for non-textual
+item types that do not want to support coordinate deletion.
The procedure must match the following prototype:
+.PP
.CS
-typedef void Tk_ItemDCharsProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIfirst\fR,
- int \fIlast\fR);
+typedef void \fBTk_ItemDCharsProc\fR(
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIfirst\fR,
+ int \fIlast\fR);
.CE
+.PP
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIfirst\fR and \fIlast\fR give the indices of the first and last bytes
-to be deleted, as returned by previous calls to \fItypePtr->indexProc\fR.
+to be deleted, as returned by previous calls to \fItypePtr\->indexProc\fR.
The type manager should delete the specified characters and update
the bounding box in the item's header.
.SH "SEE ALSO"
diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3
index 0575d40..68c9c56 100644
--- a/doc/CrtPhImgFmt.3
+++ b/doc/CrtPhImgFmt.3
@@ -20,11 +20,10 @@ Tk_CreatePhotoImageFormat \- define new file format for photo images
.sp
\fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR)
.SH ARGUMENTS
-.AS Tk_PhotoImageFormat *formatPtr
-.AP Tk_PhotoImageFormat *formatPtr in
+.AS "const Tk_PhotoImageFormat" *formatPtr
+.AP "const Tk_PhotoImageFormat" *formatPtr in
Structure that defines the new file format.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format
@@ -46,14 +45,14 @@ handler to deal with files and strings in this format. The
Tk_PhotoImageFormat structure contains the following fields:
.CS
typedef struct Tk_PhotoImageFormat {
- char *\fIname\fR;
+ const char *\fIname\fR;
Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
Tk_ImageFileReadProc *\fIfileReadProc\fR;
Tk_ImageStringReadProc *\fIstringReadProc\fR;
Tk_ImageFileWriteProc *\fIfileWriteProc\fR;
Tk_ImageStringWriteProc *\fIstringWriteProc\fR;
-} Tk_PhotoImageFormat;
+} \fBTk_PhotoImageFormat\fR;
.CE
.PP
The handler need not provide implementations of all six procedures.
@@ -65,8 +64,7 @@ structure should be set to NULL. The handler must provide the
\fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR
procedure, and the \fIstringMatchProc\fR procedure if it provides the
\fIstringReadProc\fR procedure.
-
-.SH NAME
+.SS NAME
.PP
\fIformatPtr->name\fR provides a name for the image type.
Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used
@@ -77,20 +75,20 @@ the \fB\-format\fR option. The first character of \fIformatPtr->name\fR
must not be an uppercase character from the ASCII character set
(that is, one of the characters \fBA\fR-\fBZ\fR). Such names are used
only for legacy interface support (see below).
-
-.SH FILEMATCHPROC
+.SS FILEMATCHPROC
+.PP
\fIformatPtr->fileMatchProc\fR provides the address of a procedure for
Tk to call when it is searching for an image file format handler
suitable for reading data in a given file.
\fIformatPtr->fileMatchProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageFileMatchProc(
- Tcl_Channel \fIchan\fR,
- const char *\fIfileName\fR,
- Tcl_Obj *\fIformat\fR,
- int *\fIwidthPtr\fR,
- int *\fIheightPtr\fR,
- Tcl_Interp *\fIinterp\fR);
+typedef int \fBTk_ImageFileMatchProc\fR(
+ Tcl_Channel \fIchan\fR,
+ const char *\fIfileName\fR,
+ Tcl_Obj *\fIformat\fR,
+ int *\fIwidthPtr\fR,
+ int *\fIheightPtr\fR,
+ Tcl_Interp *\fIinterp\fR);
.CE
The \fIfileName\fR argument is the name of the file containing the
image data, which is open for reading as \fIchan\fR. The
@@ -100,19 +98,19 @@ If the data in the file appears to be in the format supported by this
handler, the \fIformatPtr->fileMatchProc\fR procedure should store the
width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR
respectively, and return 1. Otherwise it should return 0.
-
-.SH STRINGMATCHPROC
+.SS STRINGMATCHPROC
+.PP
\fIformatPtr->stringMatchProc\fR provides the address of a procedure for
Tk to call when it is searching for an image file format handler for
suitable for reading data from a given string.
\fIformatPtr->stringMatchProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageStringMatchProc(
- Tcl_Obj *\fIdata\fR,
- Tcl_Obj *\fIformat\fR,
- int *\fIwidthPtr\fR,
- int *\fIheightPtr\fR,
- Tcl_Interp *\fIinterp\fR);
+typedef int \fBTk_ImageStringMatchProc\fR(
+ Tcl_Obj *\fIdata\fR,
+ Tcl_Obj *\fIformat\fR,
+ int *\fIwidthPtr\fR,
+ int *\fIheightPtr\fR,
+ Tcl_Interp *\fIinterp\fR);
.CE
The \fIdata\fR argument points to the object containing the image
data. The \fIformat\fR argument contains the value given for
@@ -122,21 +120,21 @@ this handler, the \fIformatPtr->stringMatchProc\fR procedure should
store the width and height of the image in *\fIwidthPtr\fR and
*\fIheightPtr\fR respectively, and return 1. Otherwise it should
return 0.
-
-.SH FILEREADPROC
+.SS FILEREADPROC
+.PP
\fIformatPtr->fileReadProc\fR provides the address of a procedure for
Tk to call to read data from an image file into a photo image.
\fIformatPtr->fileReadProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageFileReadProc(
- Tcl_Interp *\fIinterp\fR,
- Tcl_Channel \fIchan\fR,
- const char *\fIfileName\fR,
- Tcl_Obj *\fIformat\fR,
- PhotoHandle \fIimageHandle\fR,
- int \fIdestX\fR, int \fIdestY\fR,
- int \fIwidth\fR, int \fIheight\fR,
- int \fIsrcX\fR, int \fIsrcY\fR);
+typedef int \fBTk_ImageFileReadProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tcl_Channel \fIchan\fR,
+ const char *\fIfileName\fR,
+ Tcl_Obj *\fIformat\fR,
+ PhotoHandle \fIimageHandle\fR,
+ int \fIdestX\fR, int \fIdestY\fR,
+ int \fIwidth\fR, int \fIheight\fR,
+ int \fIsrcX\fR, int \fIsrcY\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the command was
invoked to read the image; it should be used for reporting errors.
@@ -151,20 +149,20 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
image with its top-left corner at coordinates
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
The return value is a standard Tcl return value.
-
-.SH STRINGREADPROC
+.SS STRINGREADPROC
+.PP
\fIformatPtr->stringReadProc\fR provides the address of a procedure for
Tk to call to read data from a string into a photo image.
\fIformatPtr->stringReadProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageStringReadProc(
- Tcl_Interp *\fIinterp\fR,
- Tcl_Obj *\fIdata\fR,
- Tcl_Obj *\fIformat\fR,
- PhotoHandle \fIimageHandle\fR,
- int \fIdestX\fR, int \fIdestY\fR,
- int \fIwidth\fR, int \fIheight\fR,
- int \fIsrcX\fR, int \fIsrcY\fR);
+typedef int \fBTk_ImageStringReadProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tcl_Obj *\fIdata\fR,
+ Tcl_Obj *\fIformat\fR,
+ PhotoHandle \fIimageHandle\fR,
+ int \fIdestX\fR, int \fIdestY\fR,
+ int \fIwidth\fR, int \fIheight\fR,
+ int \fIsrcX\fR, int \fIsrcY\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the command was
invoked to read the image; it should be used for reporting errors.
@@ -179,17 +177,17 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo
image with its top-left corner at coordinates
(\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure.
The return value is a standard Tcl return value.
-
-.SH FILEWRITEPROC
+.SS FILEWRITEPROC
+.PP
\fIformatPtr->fileWriteProc\fR provides the address of a procedure for
Tk to call to write data from a photo image to a file.
\fIformatPtr->fileWriteProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageFileWriteProc(
- Tcl_Interp *\fIinterp\fR,
- const char *\fIfileName\fR,
- Tcl_Obj *\fIformat\fR,
- Tk_PhotoImageBlock *\fIblockPtr\fR);
+typedef int \fBTk_ImageFileWriteProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ const char *\fIfileName\fR,
+ Tcl_Obj *\fIformat\fR,
+ Tk_PhotoImageBlock *\fIblockPtr\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the command was
invoked to write the image; it should be used for reporting errors.
@@ -204,16 +202,16 @@ after the name of the format. If appropriate, the
\fIformatPtr->fileWriteProc\fR procedure may interpret these
characters to specify further details about the image file.
The return value is a standard Tcl return value.
-
-.SH STRINGWRITEPROC
+.SS STRINGWRITEPROC
+.PP
\fIformatPtr->stringWriteProc\fR provides the address of a procedure for
Tk to call to translate image data from a photo image into a string.
\fIformatPtr->stringWriteProc\fR must match the following prototype:
.CS
-typedef int Tk_ImageStringWriteProc(
- Tcl_Interp *\fIinterp\fR,
- Tcl_Obj *\fIformat\fR,
- Tk_PhotoImageBlock *\fIblockPtr\fR);
+typedef int \fBTk_ImageStringWriteProc\fR(
+ Tcl_Interp *\fIinterp\fR,
+ Tcl_Obj *\fIformat\fR,
+ Tk_PhotoImageBlock *\fIblockPtr\fR);
.CE
The \fIinterp\fR argument is the interpreter in which the command was
invoked to convert the image; it should be used for reporting errors.
@@ -228,8 +226,8 @@ after the name of the format. If appropriate, the
\fIformatPtr->stringWriteProc\fR procedure may interpret these
characters to specify further details about the image file.
The return value is a standard Tcl return value.
-
.SH "LEGACY INTERFACE SUPPORT"
+.PP
In Tk 8.2 and earlier, the definition of all the function pointer
types stored in fields of a \fBTk_PhotoImageFormat\fR struct were
incompatibly different. Legacy programs and libraries dating from
@@ -266,9 +264,7 @@ use Tk 8.4 headers and stub libraries to do so.
.PP
Any new code written today should not make use of the legacy
interfaces. Expect their support to go away in Tk 9.
-
.SH "SEE ALSO"
Tk_FindPhoto, Tk_PhotoPutBlock
-
.SH KEYWORDS
photo image, image file
diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3
index c081c71..b7758df 100644
--- a/doc/CrtSelHdlr.3
+++ b/doc/CrtSelHdlr.3
@@ -54,11 +54,11 @@ the selection. The most common form is STRING.
\fIProc\fR should have arguments and result that match the
type \fBTk_SelectionProc\fR:
.CS
-typedef int Tk_SelectionProc(
- ClientData \fIclientData\fR,
- int \fIoffset\fR,
- char *\fIbuffer\fR,
- int \fImaxBytes\fR);
+typedef int \fBTk_SelectionProc\fR(
+ ClientData \fIclientData\fR,
+ int \fIoffset\fR,
+ char *\fIbuffer\fR,
+ int \fImaxBytes\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.
@@ -112,6 +112,5 @@ existing handler is replaced with a new one.
\fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR,
\fIselection\fR, and \fItarget\fR, if such a handler exists.
If there is no such handler then it has no effect.
-
.SH KEYWORDS
format, handler, selection, target
diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3
index 8e36cb0..4a67f80 100644
--- a/doc/CrtWindow.3
+++ b/doc/CrtWindow.3
@@ -58,8 +58,8 @@ 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
library. If the window could not be created successfully, then NULL
-is returned and \fIinterp->result\fR is modified to hold an error
-message.
+is returned and the result of interpreter \fIinterp\fR is modified to
+hold an error message.
.PP
Tk supports two different kinds of windows: internal
windows and top-level windows.
@@ -141,7 +141,6 @@ but has not been mapped, so no X window exists, it is
possible to force the creation of the X window by
calling \fBTk_MakeWindowExist\fR. This procedure issues
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/doc/DeleteImg.3 b/doc/DeleteImg.3
index 2b9288e..5cde9e7 100644
--- a/doc/DeleteImg.3
+++ b/doc/DeleteImg.3
@@ -21,13 +21,11 @@ Interpreter for which the image was created.
.AP "const char" *name in
Name of the image.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR
and \fIname\fR, if there is one. All instances of that image
will redisplay as empty regions. If the given image does not
exist then the procedure has no effect.
-
.SH KEYWORDS
delete image, image manager
diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3
index 688cfdb..cfe5ddd 100644
--- a/doc/DrawFocHlt.3
+++ b/doc/DrawFocHlt.3
@@ -27,12 +27,10 @@ Width of the highlight ring, in pixels.
Drawable in which to draw the highlight; usually an offscreen
pixmap for double buffering.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the
traversal highlight ring for a widget.
It is typically invoked by widgets during redisplay.
-
.SH KEYWORDS
focus, traversal highlight
diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3
index 2ea04ae..8da777d 100644
--- a/doc/EventHndlr.3
+++ b/doc/EventHndlr.3
@@ -30,7 +30,6 @@ in the window given by \fItkwin\fR.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be
@@ -45,9 +44,9 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
\fIProc\fR should have arguments and result that match the
type \fBTk_EventProc\fR:
.CS
-typedef void Tk_EventProc(
- ClientData \fIclientData\fR,
- XEvent *\fIeventPtr\fR);
+typedef void \fBTk_EventProc\fR(
+ ClientData \fIclientData\fR,
+ XEvent *\fIeventPtr\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR
argument given to \fBTk_CreateEventHandler\fR when the callback
@@ -72,6 +71,5 @@ automatically; in this case there is no need to call
If multiple handlers are declared for the same type of X event
on the same window, then the handlers will be invoked in the
order they were created.
-
.SH KEYWORDS
bind, callback, event, handler
diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3
index 08e0221..950d208 100644
--- a/doc/FindPhoto.3
+++ b/doc/FindPhoto.3
@@ -21,7 +21,6 @@ Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_Pho
Tk_PhotoHandle
\fBTk_FindPhoto\fR(\fIinterp, imageName\fR)
.sp
-.VS 8.5
int
\fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
compRule\fR)
@@ -29,7 +28,6 @@ compRule\fR)
int
\fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
-.VE 8.5
.sp
int
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
@@ -37,18 +35,14 @@ int
void
\fBTk_PhotoBlank\fR(\fIhandle\fR)
.sp
-.VS 8.5
int
\fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR)
-.VE 8.5
.sp
void
\fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR)
.sp
-.VS 8.5
int
\fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR)
-.VE 8.5
.SH ARGUMENTS
.AS Tk_PhotoImageBlock window_path
.AP Tcl_Interp *interp in
@@ -99,7 +93,6 @@ being written to the photo image.
Specifies the zoom factor to be applied in the Y direction to pixels
being written to the photo image.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_FindPhoto\fR returns an opaque handle that is used to identify a
@@ -128,8 +121,8 @@ typedef struct {
int \fIheight\fR;
int \fIpitch\fR;
int \fIpixelSize\fR;
- int \fIoffset[4]\fR;
-} Tk_PhotoImageBlock;
+ int \fIoffset\fR[4];
+} \fBTk_PhotoImageBlock\fR;
.CE
The \fIpixelPtr\fR field points to the first pixel, that is, the
top-left pixel in the block.
@@ -161,12 +154,10 @@ given are replicated (in a tiled fashion) to fill the specified area.
These rules operate independently in the horizontal and vertical
directions.
.PP
-.VS 8.5
\fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result.
-.VE 8.5
.PP
\fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that
the image can be reduced or enlarged for display. The
@@ -207,12 +198,10 @@ are being supplied in many small blocks, it is more efficient to use
allowing the image to expand in many small increments as image blocks
are supplied.
.PP
-.VS 8.5
\fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result.
-.VE 8.5
.PP
\fBTk_PhotoSetSize\fR specifies the size of the image, as if the user
had specified the given \fIwidth\fR and \fIheight\fR values to the
@@ -222,16 +211,13 @@ or height, but allows the width or height to be changed by subsequent
calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or
\fBTk_PhotoExpand\fR.
.PP
-.VS 8.5
\fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot
allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is
returned instead and, if the \fIinterp\fR argument is non-NULL, an
error message is placed in the interpreter's result.
-.VE 8.5
.PP
\fBTk_PhotoGetSize\fR returns the dimensions of the image in
*\fIwidthPtr\fR and *\fIheightPtr\fR.
-
.SH PORTABILITY
.PP
In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
@@ -241,7 +227,6 @@ 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.
.PP
-.VS 8.5
In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR,
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an
\fIinterp\fR argument or return any result code. If insufficient
@@ -249,12 +234,9 @@ memory was available for an image, Tk would panic. This behaviour is
still supported if you compile your extension with the additional flag
-DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against
older versions of Tk will continue to work.
-.VE 8.5
-
.SH CREDITS
.PP
The code for the photo image type was developed by Paul Mackerras,
based on his earlier photo widget code.
-
.SH KEYWORDS
photo, image
diff --git a/doc/FontId.3 b/doc/FontId.3
index 60905a7..69991fd 100644
--- a/doc/FontId.3
+++ b/doc/FontId.3
@@ -65,6 +65,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.
.SH "DATA STRUCTURES"
+.PP
The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
return information about a font and is defined as follows:
.CS
@@ -72,7 +73,7 @@ typedef struct Tk_FontMetrics {
int \fIascent\fR;
int \fIdescent\fR;
int \fIlinespace\fR;
-} Tk_FontMetrics;
+} \fBTk_FontMetrics\fR;
.CE
.PP
The \fIascent\fR field is the amount in pixels that the tallest
diff --git a/doc/GeomReq.3 b/doc/GeomReq.3
index 4d8e788..ed447b9 100644
--- a/doc/GeomReq.3
+++ b/doc/GeomReq.3
@@ -44,7 +44,6 @@ 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
.PP
\fBTk_GeometryRequest\fR is called by widget code to indicate its
@@ -89,6 +88,5 @@ The information specified in calls to \fBTk_GeometryRequest\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/doc/GetAnchor.3 b/doc/GetAnchor.3
index 8698353..2ed7627 100644
--- a/doc/GetAnchor.3
+++ b/doc/GetAnchor.3
@@ -28,17 +28,20 @@ const char *
Interpreter to use for error reporting, or NULL.
.AP Tcl_Obj *objPtr in/out
String value contains name of anchor point:
-.QW n ,
-.QW ne ,
-.QW e ,
-.QW se ,
-.QW s ,
-.QW sw ,
-.QW w ,
-.QW nw ,
+.QW \fBn\fR ,
+.QW \fBne\fR ,
+.QW \fBe\fR ,
+.QW \fBse\fR ,
+.QW \fBs\fR ,
+.QW \fBsw\fR ,
+.QW \fBw\fR ,
+.QW \fBnw\fR ,
or
-.QW center ;
-internal rep will be modified to cache corresponding Tk_Anchor.
+.QW \fBcenter\fR ;
+internal rep will be modified to cache corresponding Tk_Anchor. In the
+case of
+.QW \fBcenter\fR
+on input, a non-empty abbreviation of it may also be used on input.
.AP "const char" *string in
Same as \fIobjPtr\fR except description of anchor point is passed as
a string.
diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3
index a9bd2c2..d5482f6 100644
--- a/doc/GetBitmap.3
+++ b/doc/GetBitmap.3
@@ -49,7 +49,7 @@ Same as \fIobjPtr\fR except description of bitmap is passed as a string and
resulting Pixmap is not cached.
.AP "const char" *name in
Name for new bitmap to be defined.
-.AP "const char" *source in
+.AP "const void" *source in
Data for bitmap, in standard bitmap format.
Must be stored in static memory whose value will never change.
.AP "int" width in
@@ -66,7 +66,6 @@ Display for which \fIbitmap\fR was allocated.
Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR.
.BE
-
.SH DESCRIPTION
.PP
These procedures manage a collection of bitmaps (one-plane pixmaps)
@@ -82,7 +81,7 @@ of the following forms:
.TP 20
\fB@\fIfileName\fR
\fIFileName\fR must be the name of a file containing a bitmap
-description in the standard X11 or X10 format.
+description in the standard X11 format.
.TP 20
\fIname\fR
\fIName\fR must be the name of a bitmap defined previously with
@@ -210,7 +209,7 @@ describe the bitmap.
\fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs
(e.g. a bitmap named \fInameId\fR has already been defined) then
\fBTCL_ERROR\fR is returned and an error message is left in
-\fIinterp->result\fR.
+interpreter \fIinterp\fR's result.
Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
a private copy of this memory, but uses the bytes pointed to
@@ -282,8 +281,8 @@ with its Pixmap token.
There should be exactly one call to \fBTk_FreeBitmapFromObj\fR
or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR.
-
.SH BUGS
+.PP
In determining whether an existing bitmap can be used to satisfy
a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR
consider only the immediate value of the string description. For
@@ -293,6 +292,5 @@ bitmap created from the same file name: it will not check to
see whether the file itself has changed, or whether the current
directory has changed, thereby causing the name to refer to
a different file.
-
.SH KEYWORDS
bitmap, pixmap
diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3
index 5463f12..3c9dbb0 100644
--- a/doc/GetCapStyl.3
+++ b/doc/GetCapStyl.3
@@ -24,18 +24,18 @@ const char *
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP "const char" *string in
-String containing name of cap style: one of
-.QW butt ,
-.QW projecting ,
+String containing name of cap style \- one of
+.QW \fBbutt\fR ,
+.QW \fBprojecting\fR ,
or
-.QW round .
+.QW \fBround\fR
+\- or a unique abbreviation of one.
.AP int *capPtr out
Pointer to location in which to store X cap style corresponding to
\fIstring\fR.
.AP int cap in
Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetCapStyle\fR places in \fI*capPtr\fR the X cap style
@@ -51,7 +51,7 @@ Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
If \fIstring\fR does not contain a valid cap style
or an abbreviation of one of these names, then an error message is
-stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
+stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
\fI*capPtr\fR is unmodified.
.PP
\fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR.
@@ -60,6 +60,5 @@ statically-allocated string corresponding to \fIcap\fR.
If \fIcap\fR is not a legal cap style, then
.QW "unknown cap style"
is returned.
-
.SH KEYWORDS
butt, cap style, projecting, round
diff --git a/doc/GetColor.3 b/doc/GetColor.3
index b5416af..f41a87a 100644
--- a/doc/GetColor.3
+++ b/doc/GetColor.3
@@ -58,7 +58,6 @@ call to \fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR or
Drawable in which the result graphics context will be used. Must have
same screen and depth as the window for which the color was allocated.
.BE
-
.SH DESCRIPTION
.PP
These procedures manage the colors being used by a Tk application.
diff --git a/doc/GetCursor.3 b/doc/GetCursor.3
index 953252b..3946105 100644
--- a/doc/GetCursor.3
+++ b/doc/GetCursor.3
@@ -67,7 +67,6 @@ Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must
have been returned by some previous call to \fBTk_GetCursor\fR or
\fBTk_GetCursorFromData\fR.
.BE
-
.SH DESCRIPTION
.PP
These procedures manage a collection of cursors
@@ -118,7 +117,7 @@ in preference to black and white cursors.
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
In this form, \fIsourceName\fR and \fImaskName\fR are the names of
files describing cursors for the cursor's source bits and mask.
-Each file must be in standard X11 or X10 cursor format.
+Each file must be in standard X11 cursor format.
\fIFgColor\fR and \fIbgColor\fR
indicate the colors to use for the
cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This
@@ -213,8 +212,8 @@ with its Tk_Cursor token.
There should be exactly one call to \fBTk_FreeCursor\fR for
each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
or \fBTk_GetCursorFromData\fR.
-
.SH BUGS
+.PP
In determining whether an existing cursor can be used to satisfy
a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
and \fBTk_GetCursorFromData\fR
@@ -228,6 +227,5 @@ a different file. Similarly, \fBTk_GetCursorFromData\fR assumes
that if the same \fIsource\fR pointer is used in two different calls,
then the pointers refer to the same data; it does not check to
see if the actual data values have changed.
-
.SH KEYWORDS
cursor
diff --git a/doc/GetDash.3 b/doc/GetDash.3
index cc54c5a..a0a4c81 100644
--- a/doc/GetDash.3
+++ b/doc/GetDash.3
@@ -13,28 +13,30 @@ Tk_GetDash \- convert from string to valid dash structure.
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
-.sp
+
int
\fBTk_GetDash\fR(\fIinterp, string, dashPtr\fR)
+.fi
.SH ARGUMENTS
.AS Tk_Dash *dashPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP "const char *" string in
+.AP "const char" *string in
Textual value to be converted.
.AP Tk_Dash *dashPtr out
Points to place to store the dash pattern
-value converted from \fIstring\fR.
+value converted from \fIstring\fR. Must not be NULL.
.BE
-
.SH DESCRIPTION
.PP
These procedure parses the string and fills in the result in the
Tk_Dash structure. The string can be a list of integers or a
character string containing only
-.QW \fB.,\-_\fR
-or spaces. If all
-goes well, \fBTCL_OK\fR is returned. If \fIstring\fR does not have the
+.QW \fB.,-_\fR
+and spaces. If all
+goes well, \fBTCL_OK\fR is returned and a dash descriptor is stored
+in the variable pointed to by \fIdashPtr\fR.
+If \fIstring\fR does not have the
proper syntax then \fBTCL_ERROR\fR is returned, an error message is left
in the interpreter's result, and nothing is stored at *\fIdashPtr\fR.
.PP
@@ -46,33 +48,35 @@ color. The other segments are drawn transparent.
.PP
The second possible syntax is a character list containing only
5 possible characters
-.QW "\fB.,\-_ \fR" .
+.QW "\fB.,-_ \fR" .
The space can be used
to enlarge the space between other line elements, and can not
-occur as the first position in the string. Some examples:
+occur in the first position of the string. Some examples:
+.PP
.CS
\-dash . = \-dash {2 4}
- \-dash \- = \-dash {6 4}
- \-dash \-. = \-dash {6 4 2 4}
- \-dash \-.. = \-dash {6 4 2 4 2 4}
+ \-dash - = \-dash {6 4}
+ \-dash -. = \-dash {6 4 2 4}
+ \-dash -.. = \-dash {6 4 2 4 2 4}
\-dash {. } = \-dash {2 8}
\-dash , = \-dash {4 4}
.CE
.PP
-The main difference of this syntax with the previous is that it
+The main difference between this syntax and the numeric is that it
is shape-conserving. This means that all values in the dash
list will be multiplied by the line width before display. This
-assures that
+ensures that
.QW .
will always be displayed as a dot and
-.QW \-
+.QW -
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.
-
+above examples are available; the last 2 examples will be
+displayed identically to the first one.
+.SH "SEE ALSO"
+canvas(n), Tk_CreateItemType(3)
.SH KEYWORDS
dash, conversion
diff --git a/doc/GetFont.3 b/doc/GetFont.3
index 2ca1395..572b94f 100644
--- a/doc/GetFont.3
+++ b/doc/GetFont.3
@@ -31,7 +31,6 @@ Tk_Font
.sp
void
\fBTk_FreeFont(\fItkfont\fB)\fR
-
.SH ARGUMENTS
.AS "const char" *tkfont
.AP "Tcl_Interp" *interp in
@@ -105,7 +104,6 @@ with the same information used to create it; for
with its Tk_Font token. There should be
exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR
for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR.
-
.SH "SEE ALSO"
Tk_FontId(3)
.SH KEYWORDS
diff --git a/doc/GetGC.3 b/doc/GetGC.3
index 146b527..4c6f9ff 100644
--- a/doc/GetGC.3
+++ b/doc/GetGC.3
@@ -34,7 +34,6 @@ Display for which \fIgc\fR was allocated.
X identifier for graphics context that is no longer needed.
Must have been allocated by \fBTk_GetGC\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts
@@ -67,6 +66,5 @@ each call to \fBTk_GetGC\fR.
When a graphics context is no longer in use anywhere (i.e. it has
been freed as many times as it has been gotten) \fBTk_FreeGC\fR
will release it to the X server and delete it from the database.
-
.SH KEYWORDS
graphics context
diff --git a/doc/GetHWND.3 b/doc/GetHWND.3
index 06bdf37..c78df98 100644
--- a/doc/GetHWND.3
+++ b/doc/GetHWND.3
@@ -32,6 +32,5 @@ window given by \fIwindow\fR.
\fBTk_AttachHWND\fR binds the Windows HWND identifier to the
specified Tk_Window given by \fItkwin\fR. It returns an X Windows
window that encapsulates the HWND.
-
.SH KEYWORDS
identifier, window
diff --git a/doc/GetImage.3 b/doc/GetImage.3
index fb6e4c8..59232aa 100644
--- a/doc/GetImage.3
+++ b/doc/GetImage.3
@@ -63,7 +63,6 @@ Store width of \fIimage\fR (in pixels) here.
.AP "int" heightPtr out
Store height of \fIimage\fR (in pixels) here.
.BE
-
.SH DESCRIPTION
.PP
These procedures are invoked by widgets that wish to display images.
@@ -74,7 +73,7 @@ identifies the window where the image will be displayed.
\fBTk_GetImage\fR looks up the image in the table of existing
images and returns a token for a new instance of the image.
If the image does not exist then \fBTk_GetImage\fR returns NULL
-and leaves an error message in \fIinterp->result\fR.
+and leaves an error message in interpreter \fIinterp\fR's result.
.PP
When a widget wishes to actually display an image it must
call \fBTk_RedrawImage\fR, identifying the image (\fIimage\fR),
@@ -106,14 +105,14 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to
\fIchangeProc\fR will be called by Tk whenever a change occurs
in the image; it must match the following prototype:
.CS
-typedef void Tk_ImageChangedProc(
- ClientData \fIclientData\fR,
- int \fIx\fR,
- int \fIy\fR,
- int \fIwidth\fR,
- int \fIheight\fR,
- int \fIimageWidth\fR,
- int \fIimageHeight\fR);
+typedef void \fBTk_ImageChangedProc\fR(
+ ClientData \fIclientData\fR,
+ int \fIx\fR,
+ int \fIy\fR,
+ int \fIwidth\fR,
+ int \fIheight\fR,
+ int \fIimageWidth\fR,
+ int \fIimageHeight\fR);
.CE
The \fIclientData\fR argument to \fIchangeProc\fR is the same as the
\fIclientData\fR argument to \fBTk_GetImage\fR.
@@ -125,9 +124,7 @@ they are specified in pixels measured from the upper-left
corner of the image.
The arguments \fIimageWidth\fR and \fIimageHeight\fR give
the image's (new) size.
-
.SH "SEE ALSO"
Tk_CreateImageType
-
.SH KEYWORDS
images, redisplay
diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3
index 1af1a06..5e527de 100644
--- a/doc/GetJoinStl.3
+++ b/doc/GetJoinStl.3
@@ -24,18 +24,18 @@ const char *
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP "const char" *string in
-String containing name of join style: one of
-.QW bevel ,
-.QW miter ,
+String containing name of join style \- one of
+.QW \fBbevel\fR ,
+.QW \fBmiter\fR ,
or
-.QW round .
+.QW \fBround\fR
+\- or a unique abbreviation of one.
.AP int *joinPtr out
Pointer to location in which to store X join style corresponding to
\fIstring\fR.
.AP int join in
Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetJoinStyle\fR places in \fI*joinPtr\fR the X join style
@@ -50,7 +50,7 @@ Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
If \fIstring\fR does not contain a valid join style
or an abbreviation of one of these names, then an error message is
-stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
+stored in interpreter \fIinterp\fR's result, \fBTCL_ERROR\fR is returned, and
\fI*joinPtr\fR is unmodified.
.PP
\fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR.
@@ -59,6 +59,5 @@ statically-allocated string corresponding to \fIjoin\fR.
If \fIjoin\fR is not a legal join style, then
.QW "unknown join style"
is returned.
-
.SH KEYWORDS
bevel, join style, miter, round
diff --git a/doc/GetJustify.3 b/doc/GetJustify.3
index e8535e7..e9d59e9 100644
--- a/doc/GetJustify.3
+++ b/doc/GetJustify.3
@@ -27,11 +27,12 @@ const char *
.AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL.
.AP Tcl_Obj *objPtr in/out
-String value contains name of justification style, one of
-.QW left ,
-.QW right ,
+String value contains name of justification style \- one of
+.QW \fBleft\fR ,
+.QW \fBright\fR ,
or
-.QW center .
+.QW \fBcenter\fR
+\- or a unique abbreviation of one.
The internal rep will be modified to cache corresponding justify value.
.AP "const char" *string in
Same as \fIobjPtr\fR except description of justification style is passed as
@@ -82,6 +83,5 @@ corresponding to \fIjustify\fR.
If \fIjustify\fR is not a legal justify value, then
.QW "unknown justification style"
is returned.
-
.SH KEYWORDS
center, fill, justification, string
diff --git a/doc/GetOption.3 b/doc/GetOption.3
index 79817b7..4e13b9b 100644
--- a/doc/GetOption.3
+++ b/doc/GetOption.3
@@ -26,7 +26,6 @@ Name of desired option.
Class of desired option. Null means there is no class for
this option; do lookup based on name only.
.BE
-
.SH DESCRIPTION
.PP
This procedure is invoked to retrieve an option from the database
@@ -39,6 +38,5 @@ is returned. If no option matches, then NULL is returned.
\fBTk_GetOption\fR caches options related to \fItkwin\fR so that
successive calls for the same \fItkwin\fR will execute much more
quickly than successive calls for different windows.
-
.SH KEYWORDS
class, name, option, retrieve
diff --git a/doc/GetPixels.3 b/doc/GetPixels.3
index 814c4eb..287e734 100644
--- a/doc/GetPixels.3
+++ b/doc/GetPixels.3
@@ -43,7 +43,6 @@ Pointer to location in which to store converted distance in pixels.
.AP double *doublePtr out
Pointer to location in which to store converted distance in millimeters.
.BE
-
.SH DESCRIPTION
.PP
These procedures take as argument a specification of distance on
@@ -85,13 +84,12 @@ value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except
that the screen distance is specified with a string instead
of an object. This prevents \fBTk_GetPixels\fR from caching the
-return value, so \fBTk_GetAnchor\fR is less efficient than
+return value, so \fBTk_GetPixels\fR is less efficient than
\fBTk_GetPixelsFromObj\fR.
.PP
\fBTk_GetMMFromObj\fR and \fBTk_GetScreenMM\fR are similar to
\fBTk_GetPixelsFromObj\fR and \fBTk_GetPixels\fR (respectively) except
that they convert the screen distance to millimeters and
store a double-precision floating-point result at \fI*doublePtr\fR.
-
.SH KEYWORDS
centimeters, convert, inches, millimeters, pixels, points, screen units
diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3
index 9e9628a..63d7d62 100644
--- a/doc/GetPixmap.3
+++ b/doc/GetPixmap.3
@@ -33,7 +33,6 @@ Number of bits per pixel in pixmap.
.AP Pixmap pixmap in
Pixmap to destroy.
.BE
-
.SH DESCRIPTION
.PP
These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR
@@ -49,6 +48,5 @@ with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR,
and returns its identifier.
\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes
its resource identifier available for reuse.
-
.SH KEYWORDS
pixmap, resource identifier
diff --git a/doc/GetRelief.3 b/doc/GetRelief.3
index b97a615..858c128 100644
--- a/doc/GetRelief.3
+++ b/doc/GetRelief.3
@@ -28,13 +28,14 @@ const char *
Interpreter to use for error reporting.
.AP Tcl_Obj *objPtr in/out
String value contains name of relief, one of
-.QW flat ,
-.QW groove ,
-.QW raised ,
-.QW ridge ,
-.QW solid ,
+.QW \fBflat\fR ,
+.QW \fBgroove\fR ,
+.QW \fBraised\fR ,
+.QW \fBridge\fR ,
+.QW \fBsolid\fR ,
or
-.QW sunken ;
+.QW \fBsunken\fR
+(or any unique abbreviation thereof on input);
the internal rep will be modified to cache corresponding relief value.
.AP char *string in
Same as \fIobjPtr\fR except description of relief is passed as
diff --git a/doc/GetScroll.3 b/doc/GetScroll.3
index 43fbab8..9c10450 100644
--- a/doc/GetScroll.3
+++ b/doc/GetScroll.3
@@ -9,46 +9,45 @@
.TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_GetScrollInfo, Tk_GetScrollInfoObj \- parse arguments for scrolling commands
+Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
int
-\fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR
+\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR
.sp
int
-\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR
+\fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR
.SH ARGUMENTS
-.AS "Tcl_Interp" *dblPtr
+.AS "Tcl_Interp" *fractionPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP int argc in
-Number of strings in \fIargv\fR array.
-.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.
.AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP "Tcl_Obj *const" objv[] in
Argument objects. 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.
-.AP double *dblPtr out
+.AP int argc in
+Number of strings in \fIargv\fR array.
+.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.
+.AP double *fractionPtr out
Filled in with fraction from \fBmoveto\fR option, if any.
-.AP int *intPtr out
+.AP int *stepsPtr out
Filled in with line or page count from \fBscroll\fR option, if any.
The value may be negative.
.BE
-
.SH DESCRIPTION
.PP
-\fBTk_GetScrollInfo\fR parses the arguments expected by widget
+\fBTk_GetScrollInfoObj\fR parses the arguments expected by widget
scrolling commands such as \fBxview\fR and \fByview\fR.
It receives the entire list of words that make up a widget command
-and parses the words starting with \fIargv\fR[2].
-The words starting with \fIargv\fR[2] must have one of the following forms:
+and parses the words starting with \fIobjv\fR[2].
+The words starting with \fIobjv\fR[2] must have one of the following forms:
.CS
\fBmoveto \fIfraction\fR
\fBscroll \fInumber\fB units\fR
@@ -57,20 +56,20 @@ The words starting with \fIargv\fR[2] must have one of the following forms:
.LP
Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR
keywords may be abbreviated.
-If \fIargv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
-is returned as result and \fI*dblPtr\fR is filled in with the
+If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
+is returned as result and \fI*fractionPtr\fR is filled in with the
\fIfraction\fR argument to the command, which must be a proper real
value.
-If \fIargv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
-or \fBTK_SCROLL_PAGES\fR is returned and \fI*intPtr\fR is filled
+If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
+or \fBTK_SCROLL_PAGES\fR is returned and \fI*stepsPtr\fR is filled
in with the \fInumber\fR value, which must be a proper integer.
If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR
-is returned and an error message is left in \fIinterp->result\fR.
+is returned and an error message is left in interpreter
+\fIinterp\fR's result.
.PP
-\fBTk_GetScrollInfoObj\fR is identical in function to
-\fBTk_GetScrollInfo\fR. However, \fBTk_GetScrollInfoObj\fR accepts
-Tcl_Obj style arguments, making it more appropriate for use with new
-development.
-
+\fBTk_GetScrollInfo\fR is identical in function to
+\fBTk_GetScrollInfoObj\fR. However, \fBTk_GetScrollInfo\fR accepts
+string arguments, making it more appropriate for use with legacy
+widgets.
.SH KEYWORDS
parse, scrollbar, scrolling command, xview, yview
diff --git a/doc/GetSelect.3 b/doc/GetSelect.3
index 4f8fa8d..63f655a 100644
--- a/doc/GetSelect.3
+++ b/doc/GetSelect.3
@@ -33,7 +33,6 @@ are retrieved.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetSelection\fR retrieves the selection specified by the atom
@@ -42,13 +41,15 @@ selection may actually be retrieved in several pieces; as each piece
is retrieved, \fIproc\fR is called to process the piece. \fIProc\fR
should have arguments and result that match the type
\fBTk_GetSelProc\fR:
+.PP
.CS
-typedef int Tk_GetSelProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- char *\fIportion\fR);
+typedef int \fBTk_GetSelProc\fR(
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ char *\fIportion\fR);
.CE
-The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
+.PP
+The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
will be copies of the corresponding arguments to
\fBTk_GetSelection\fR. \fIPortion\fR will be a pointer to
a string containing part or all of the selection. For large
@@ -68,10 +69,10 @@ been completely retrieved and processed by \fIproc\fR, or when a
fatal error has occurred (e.g. the selection owner did not respond
promptly). \fBTk_GetSelection\fR normally returns \fBTCL_OK\fR; if
an error occurs, it returns \fBTCL_ERROR\fR and leaves an error message
-in \fIinterp->result\fR. \fIProc\fR should also return either
-\fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in dealing with the
-selection, it should leave an error message in \fIinterp->result\fR
-and return \fBTCL_ERROR\fR; this will abort the selection retrieval.
-
+in interpreter \fIinterp\fR's result. \fIProc\fR should also return either
+\fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in
+dealing with the selection, it should leave an error message in the
+interpreter result and return \fBTCL_ERROR\fR; this will abort the
+selection retrieval.
.SH KEYWORDS
format, get, selection retrieval
diff --git a/doc/GetUid.3 b/doc/GetUid.3
index 32d4cbf..677bbaa 100644
--- a/doc/GetUid.3
+++ b/doc/GetUid.3
@@ -21,7 +21,6 @@ Tk_Uid
String for which the corresponding unique identifier is
desired.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetUid\fR returns the unique identifier corresponding
@@ -42,6 +41,5 @@ Tk_Uid may be compared directly (x == y) without having to call
\fBstrcmp\fR.
In addition, the return value from \fBTk_GetUid\fR will have the
same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
-
.SH KEYWORDS
atom, unique identifier
diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3
index d95f3ee..7311e3b 100644
--- a/doc/GetVRoot.3
+++ b/doc/GetVRoot.3
@@ -28,7 +28,6 @@ Points to word in which to store width of virtual root.
.AP "int" heightPtr out
Points to word in which to store height of virtual root.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetVRootGeometry\fR returns geometry information about the virtual
@@ -43,6 +42,5 @@ If \fItkwin\fR is not associated with a virtual root (e.g.
because the window manager does not use virtual roots) then *\fIxPtr\fR and
*\fIyPtr\fR will be set to 0 and *\fIwidthPtr\fR and *\fIheightPtr\fR
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/doc/GetVisual.3 b/doc/GetVisual.3
index 2796660..8e022c0 100644
--- a/doc/GetVisual.3
+++ b/doc/GetVisual.3
@@ -39,7 +39,7 @@ It returns a pointer to the X Visual structure for the visual
and stores the number of bits per pixel for it at \fI*depthPtr\fR.
If \fIstring\fR is unrecognizable or if no suitable visual could
be found, then NULL is returned and \fBTk_GetVisual\fR leaves
-an error message in \fIinterp->result\fR.
+an error message in interpreter \fIinterp\fR's result.
If \fIcolormap\fR is non-NULL then \fBTk_GetVisual\fR
also locates an appropriate colormap for use with the result visual
and stores its X identifier at \fI*colormapPtr\fR.
diff --git a/doc/Grab.3 b/doc/Grab.3
index 6bf1b69..8c99fd5 100644
--- a/doc/Grab.3
+++ b/doc/Grab.3
@@ -16,7 +16,6 @@ int
.sp
void
\fBTk_Ungrab\fR(\fItkwin\fR)
-
.SH ARGUMENTS
.AP Tcl_Interp *interp in
Interpreter to use for error reporting
@@ -25,7 +24,6 @@ Window on whose behalf the pointer is to be grabbed or released
.AP int grabGlobal in
Boolean indicating whether the grab is global or application local
.BE
-
.SH DESCRIPTION
.PP
These functions are used to set or release a global or
@@ -39,7 +37,6 @@ intended for windows in other applications) will be redirected to
\fItkwin\fR. If the grab is application local, only mouse and
keyboard events intended for a windows within the same application
(but outside the tree rooted at \fItkwin\fR) will be redirected.
-
.PP
\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR
specifies the window on whose behalf the pointer is to be grabbed.
@@ -52,12 +49,10 @@ successfully, no window outside the tree rooted at \fItkwin\fR will
receive pointer- or keyboard-related events until the next call to
Tk_Ungrab. If a previous grab was in effect within the application,
then it is replaced with a new one.
-
.PP
-\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if
+\fBTk_Ungrab\fR releases a grab on the mouse pointer and keyboard, if
there is one set on the window given by \fItkwin\fR. Once a grab is
released, pointer and keyboard events will start being delivered to
other windows again.
-
.SH KEYWORDS
grab, window
diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3
index 0478d78..684a4e7 100644
--- a/doc/HWNDToWindow.3
+++ b/doc/HWNDToWindow.3
@@ -17,12 +17,10 @@ Tk_Window
.AP HWND hwnd in
Windows handle for the window.
.BE
-
.SH DESCRIPTION
.PP
Given a Windows HWND window identifier, this procedure returns the
corresponding Tk_Window handle. If there is no Tk_Window corresponding
to \fIhwnd\fR then NULL is returned.
-
.SH KEYWORDS
Windows window id
diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3
index 4d24c14..7824c5c 100644
--- a/doc/HandleEvent.3
+++ b/doc/HandleEvent.3
@@ -21,12 +21,11 @@ Tk_HandleEvent \- invoke event handlers for window system events
Pointer to X event to dispatch to relevant handler(s). It is important
that all unused fields of the structure be set to zero.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_HandleEvent\fR is a lower-level procedure that deals with window
events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by
-\fBTcl_DoOneEvent\fR), and in a few other cases within Tk.
+\fBTk_DoOneEvent\fR), and in a few other cases within Tk.
It makes callbacks to any window event
handlers (created by calls to \fBTk_CreateEventHandler\fR)
that match \fIeventPtr\fR and then returns. In some cases
@@ -43,6 +42,5 @@ as when a
notifier has been popped up and an application wishes to
wait for the user to click a button in the notifier before
doing anything else.
-
.SH KEYWORDS
callback, event, handler, window
diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3
index a913661..e04c290 100644
--- a/doc/IdToWindow.3
+++ b/doc/IdToWindow.3
@@ -22,13 +22,11 @@ X display containing the window.
.AP Window window in
X id for window.
.BE
-
.SH DESCRIPTION
.PP
Given an X window identifier and the X display it corresponds to,
this procedure returns the corresponding Tk_Window handle.
If there is no Tk_Window corresponding to \fIwindow\fR then
NULL is returned.
-
.SH KEYWORDS
X window id
diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3
index 3d6e823..55b24d4 100644
--- a/doc/ImgChanged.3
+++ b/doc/ImgChanged.3
@@ -35,7 +35,6 @@ Current width of image, in pixels.
.AP "int" imageHeight in
Current height of image, in pixels.
.BE
-
.SH DESCRIPTION
.PP
An image manager calls \fBTk_ImageChanged\fR for an image
@@ -59,9 +58,7 @@ that changed.
If the size of the image should change, then \fBTk_ImageChanged\fR
must be called to indicate the new size, even if no pixels
need to be redisplayed.
-
.SH "SEE ALSO"
Tk_CreateImageType
-
.SH KEYWORDS
images, redisplay, image size changes
diff --git a/doc/Inactive.3 b/doc/Inactive.3
index 8f37553..825fd8b 100644
--- a/doc/Inactive.3
+++ b/doc/Inactive.3
@@ -21,7 +21,6 @@ long
The display on which the user inactivity timer is to be queried or
reset.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetUserInactiveTime\fR returns the number of milliseconds that
@@ -31,6 +30,5 @@ support querying the user inactiviy time, \fB\-1\fR is returned.
\fBTk_GetUserInactiveTime\fR resets the user inactivity timer of the
given display to zero. On windowing systems that do not support
multiple displays \fIdisplay\fR can be passed as \fBNULL\fR.
-
.SH KEYWORDS
idle, inactive
diff --git a/doc/InternAtom.3 b/doc/InternAtom.3
index a4ca96c..37a6c3c 100644
--- a/doc/InternAtom.3
+++ b/doc/InternAtom.3
@@ -28,7 +28,6 @@ String name for which atom is desired.
.AP Atom atom in
Atom for which corresponding string name is desired.
.BE
-
.SH DESCRIPTION
.PP
These procedures are similar to the Xlib procedures
@@ -52,6 +51,5 @@ for the same information can be serviced from the cache without
contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
are generally much faster than their Xlib counterparts, and they
should be used in place of the Xlib procedures.
-
.SH KEYWORDS
atom, cache, display
diff --git a/doc/MainLoop.3 b/doc/MainLoop.3
index 8653c17..ae38d6c 100644
--- a/doc/MainLoop.3
+++ b/doc/MainLoop.3
@@ -16,7 +16,6 @@ Tk_MainLoop \- loop for events until all windows are deleted
.sp
\fBTk_MainLoop\fR()
.BE
-
.SH DESCRIPTION
.PP
\fBTk_MainLoop\fR is a procedure that loops repeatedly calling
@@ -25,6 +24,5 @@ left in this process (i.e. no main windows exist anymore). Most
windowing applications will call \fBTk_MainLoop\fR after
initialization; the main execution of the application will consist
entirely of callbacks invoked via \fBTcl_DoOneEvent\fR.
-
.SH KEYWORDS
application, event, main loop
diff --git a/doc/MainWin.3 b/doc/MainWin.3
index 14acec7..536679a 100644
--- a/doc/MainWin.3
+++ b/doc/MainWin.3
@@ -9,8 +9,7 @@
.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main
-window information
+Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main window information
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -20,13 +19,11 @@ Tk_Window
.sp
int
\fBTk_GetNumMainWindows\fR()
-
.SH ARGUMENTS
.AS Tcl_Interp *pathName
.AP Tcl_Interp *interp in/out
Interpreter associated with the application.
.BE
-
.SH DESCRIPTION
.PP
A main window is a special kind of toplevel window used as the
@@ -35,10 +32,9 @@ outermost window in an application.
If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR
returns the application's main window. If there is no Tk application
associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and
-leaves an error message in \fIinterp->result\fR.
+leaves an error message in interpreter \fIinterp\fR's result.
.PP
\fBTk_GetNumMainWindows\fR returns a count of the number of main
-windows currently open in the process.
-
+windows currently open in the current thread.
.SH KEYWORDS
application, main window
diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3
index c96a646..13e35fe 100644
--- a/doc/MaintGeom.3
+++ b/doc/MaintGeom.3
@@ -36,7 +36,6 @@ Desired width for \fIslave\fR, in pixels.
.AP int height in
Desired height for \fIslave\fR, in pixels.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_MaintainGeometry\fR and \fBTk_UnmaintainGeometry\fR make it
diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3
index 5dcf688..2c6c534 100644
--- a/doc/ManageGeom.3
+++ b/doc/ManageGeom.3
@@ -45,7 +45,7 @@ typedef struct {
const char *\fIname\fR;
Tk_GeomRequestProc *\fIrequestProc\fR;
Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR;
-} Tk_GeomMgr;
+} \fBTk_GeomMgr\fR;
.CE
The \fIname\fR field is the textual name for the geometry manager,
such as \fBpack\fR or \fBplace\fR; this value will be returned
@@ -57,9 +57,9 @@ slave to change its desired geometry.
\fIrequestProc\fR should have arguments and results that match the
type \fBTk_GeomRequestProc\fR:
.CS
-typedef void Tk_GeomRequestProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\fR);
+typedef void \fBTk_GeomRequestProc\fR(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR);
.CE
The parameters to \fIrequestProc\fR will be identical to the
corresponding parameters passed to \fBTk_ManageGeometry\fR.
@@ -80,12 +80,11 @@ is the same as the window's current geometry manager.
\fIlostSlaveProc\fR should have
arguments and results that match the following prototype:
.CS
-typedef void Tk_GeomLostSlaveProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\fR);
+typedef void \fBTk_GeomLostSlaveProc\fR(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR);
.CE
The parameters to \fIlostSlaveProc\fR will be identical to the
corresponding parameters passed to \fBTk_ManageGeometry\fR.
-
.SH KEYWORDS
callback, geometry, managed, request, unmanaged
diff --git a/doc/MapWindow.3 b/doc/MapWindow.3
index 25d7ff5..f876d24 100644
--- a/doc/MapWindow.3
+++ b/doc/MapWindow.3
@@ -23,7 +23,6 @@ Tk_Window
.AP Tk_Window tkwin in
Token for window.
.BE
-
.SH DESCRIPTION
.PP
These procedures may be used to map and unmap windows
@@ -46,6 +45,5 @@ These procedures should be used in place of the X procedures
Tk's local data structure for \fItkwin\fR. Applications
using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR
directly.
-
.SH KEYWORDS
map, unmap, window
diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3
index 24653ab..4cd39e2 100644
--- a/doc/MoveToplev.3
+++ b/doc/MoveToplev.3
@@ -28,7 +28,6 @@ New y-coordinate for the top-left pixel of \fItkwin\fR's border, or the
top-left pixel of the decorative border supplied for \fItkwin\fR by the
window manager, if there is one.
.BE
-
.SH DESCRIPTION
.PP
In general, a window should never set its own position; this should be
@@ -48,6 +47,5 @@ When \fBTk_MoveToplevelWindow\fR is called it does not immediately
pass on the new desired location to the window manager; it defers
this action until all other outstanding work has been completed,
using the \fBTk_DoWhenIdle\fR mechanism.
-
.SH KEYWORDS
position, top-level window, window manager
diff --git a/doc/Name.3 b/doc/Name.3
index 73b09b1..697eae3 100644
--- a/doc/Name.3
+++ b/doc/Name.3
@@ -31,7 +31,6 @@ Interpreter to use for error reporting.
.AP "const char" *pathName in
Character string containing path name of window.
.BE
-
.SH DESCRIPTION
.PP
Each window managed by Tk has two names, a short name that identifies
@@ -49,8 +48,7 @@ as a Tk_Uid, which may be used just like a string pointer but also has
the properties of a unique identifier (see the manual entry for
\fBTk_GetUid\fR for details).
.PP
-The \fBTk_PathName\fR macro returns a
-hierarchical name for \fItkwin\fR.
+The \fBTk_PathName\fR macro returns a hierarchical name for \fItkwin\fR.
Path names have a structure similar to file names in Unix but with
dots between elements instead of slashes: the main window for
an application has the path name
@@ -75,7 +73,8 @@ The procedure \fBTk_NameToWindow\fR returns the token for a window
given its path name (the \fIpathName\fR argument) and another window
belonging to the same main window (\fItkwin\fR). It normally
returns a token for the named window, but if no such window exists
-\fBTk_NameToWindow\fR leaves an error message in \fIinterp->result\fR
+\fBTk_NameToWindow\fR leaves an error message in interpreter
+\fIinterp\fR's result
and returns NULL. The \fItkwin\fR argument to \fBTk_NameToWindow\fR
is needed because path names are only unique within a single
application hierarchy. If, for example, a single process has opened
@@ -83,6 +82,5 @@ two main windows, each will have a separate naming hierarchy and the
same path name might appear in each of the hierarchies. Normally
\fItkwin\fR is the main window of the desired hierarchy, but this
need not be the case: any window in the desired hierarchy may be used.
-
.SH KEYWORDS
name, path name, token, window
diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3
index a1a69a8..5461262 100644
--- a/doc/NameOfImg.3
+++ b/doc/NameOfImg.3
@@ -21,12 +21,10 @@ const char *
Token for image, which was passed to image manager's \fIcreateProc\fR when
the image was created.
.BE
-
.SH DESCRIPTION
.PP
This procedure is invoked by image managers to find out the name
of an image. Given the token for the image, it returns the
string name for the image.
-
.SH KEYWORDS
image manager, image name
diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3
index cf2559d..b0da542 100644
--- a/doc/OwnSelect.3
+++ b/doc/OwnSelect.3
@@ -26,7 +26,6 @@ Procedure to invoke when \fItkwin\fR loses selection ownership later.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the
@@ -39,12 +38,12 @@ invoked so that the window can clean itself up (e.g. by
unhighlighting the selection). \fIProc\fR should have arguments and
result that match the type \fBTk_LostSelProc\fR:
.CS
-typedef void Tk_LostSelProc(ClientData \fIclientData\fR);
+typedef void \fBTk_LostSelProc\fR(
+ ClientData \fIclientData\fR);
.CE
The \fIclientData\fR parameter to \fIproc\fR is a copy of the
\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is
usually a pointer to a data structure containing application-specific
information about \fItkwin\fR.
-
.SH KEYWORDS
own, selection owner
diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3
index b7592b7..1681305 100644
--- a/doc/ParseArgv.3
+++ b/doc/ParseArgv.3
@@ -60,8 +60,8 @@ elements of \fIargv\fR.
.PP
\fBTk_ParseArgv\fR normally returns the value \fBTCL_OK\fR. If an error
occurs while parsing the arguments, then \fBTCL_ERROR\fR is returned and
-\fBTk_ParseArgv\fR will leave an error message in \fIinterp->result\fR
-in the standard Tcl fashion. In
+\fBTk_ParseArgv\fR will leave an error message in the result of
+interpreter \fIinterp\fR in the standard Tcl fashion. In
the event of an error return, \fI*argvPtr\fR will not have been
modified, but \fIargv\fR could have been partially modified. The
possible causes of errors are explained below.
@@ -70,12 +70,12 @@ The \fIargTable\fR array specifies the kinds of arguments that are
expected; each of its entries has the following structure:
.CS
typedef struct {
- char *\fIkey\fR;
+ const char *\fIkey\fR;
int \fItype\fR;
char *\fIsrc\fR;
char *\fIdst\fR;
- char *\fIhelp\fR;
-} Tk_ArgvInfo;
+ const char *\fIhelp\fR;
+} \fBTk_ArgvInfo\fR;
.CE
The \fIkey\fR field is a string such as
.QW \-display
@@ -186,7 +186,8 @@ specifiers of this type are ignored (as if they did not exist).
\fBTK_ARGV_HELP\fR
When this kind of option is encountered, \fBTk_ParseArgv\fR uses the
\fIhelp\fR fields of \fIargTable\fR to format a message describing
-all the valid arguments. The message is placed in \fIinterp->result\fR
+all the valid arguments. The message is placed in interpreter
+\fIinterp\fR's result
and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the
caller normally prints the help message and aborts. If the \fIkey\fR
field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will
@@ -259,11 +260,12 @@ then return any that are left by compacting them to the beginning of
\fIargv\fR (starting at \fIargv\fR[0]). \fIGenfunc\fR
should return a count of how many arguments are left in \fIargv\fR;
\fBTk_ParseArgv\fR will process them. If \fIgenfunc\fR encounters
-an error then it should leave an error message in \fIinterp->result\fR,
+an error then it should leave an error message in interpreter
+\fIinterp\fR's result,
in the usual Tcl fashion, and return \-1; when this happens
\fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR.
.RE
-.SH "FLAGS"
+.SS "FLAGS"
.TP
\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
\fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program
@@ -329,7 +331,7 @@ main(argc, argv)
\&...
if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) {
- fprintf(stderr, "%s\en", interp->result);
+ fprintf(stderr, "%s\en", Tcl_GetString(Tcl_GetObjResult(interp)));
exit(1);
}
diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3
index 5eada22..f98d29b 100644
--- a/doc/QWinEvent.3
+++ b/doc/QWinEvent.3
@@ -30,7 +30,6 @@ that all unused fields of the structure be set to zero.
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event
@@ -47,6 +46,5 @@ returns the previous value for collapse behavior on the \fIdisplay\fR.
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, events
diff --git a/doc/Restack.3 b/doc/Restack.3
index a9a6c3a..49876b0 100644
--- a/doc/Restack.3
+++ b/doc/Restack.3
@@ -28,7 +28,6 @@ must be \fBAbove\fR or \fBBelow\fR.
Must be a sibling of \fItkwin\fR or a descendant of a sibling.
If NULL then \fItkwin\fR is restacked above or below all siblings.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative
@@ -42,6 +41,5 @@ just above or below \fIother\fR.
The \fIaboveBelow\fR argument must have one of the symbolic values
\fBAbove\fR or \fBBelow\fR.
Both of these values are defined by the include file <X11/Xlib.h>.
-
.SH KEYWORDS
above, below, obscure, stacking order
diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3
index da8b822..d208955 100644
--- a/doc/RestrictEv.3
+++ b/doc/RestrictEv.3
@@ -15,18 +15,17 @@ Tk_RestrictEvents \- filter and selectively delay X events
\fB#include <tk.h>\fR
.sp
Tk_RestrictProc *
-\fBTk_RestrictEvents\fR(\fIproc, clientData, prevClientDataPtr\fR)
+\fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR)
.SH ARGUMENTS
-.AS Tk_RestrictProc **prevClientDataPtr
+.AS Tk_RestrictProc **prevArgPtr
.AP Tk_RestrictProc *proc in
Predicate procedure to call to filter incoming X events.
NULL means do not restrict events at all.
-.AP ClientData clientData in
+.AP ClientData arg in
Arbitrary argument to pass to \fIproc\fR.
-.AP ClientData *prevClientDataPtr out
+.AP ClientData *prevArgPtr out
Pointer to place to save argument to previous restrict procedure.
.BE
-
.SH DESCRIPTION
.PP
This procedure is useful in certain situations where applications
@@ -40,11 +39,11 @@ later time (e.g. when the event restriction is lifted), or discarded.
is a procedure with arguments and result that match
the type \fBTk_RestrictProc\fR:
.CS
-typedef Tk_RestrictAction Tk_RestrictProc(
- ClientData \fIclientData\fR,
- XEvent *\fIeventPtr\fR);
+typedef Tk_RestrictAction \fBTk_RestrictProc\fR(
+ ClientData \fIarg\fR,
+ XEvent *\fIeventPtr\fR);
.CE
-The \fIclientData\fR argument is a copy of the \fIclientData\fR passed
+The \fIarg\fR argument is a copy of the \fIarg\fR passed
to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
information it needs to filter events. The \fIeventPtr\fR points to
an event under consideration. \fIProc\fR returns a restrict action
@@ -56,7 +55,7 @@ left on the event queue for later processing. If the return value is
\fBTK_DISCARD_EVENT\fR, then the event will be removed from the event
queue and discarded without being processed.
.PP
-\fBTk_RestrictEvents\fR uses its return value and \fIprevClientDataPtr\fR
+\fBTk_RestrictEvents\fR uses its return value and \fIprevArgPtr\fR
to return information about the current event restriction procedure
(a NULL return value means there are currently no restrictions).
These values may be used to restore the previous restriction state
diff --git a/doc/SetAppName.3 b/doc/SetAppName.3
index b2df656..60ac14f 100644
--- a/doc/SetAppName.3
+++ b/doc/SetAppName.3
@@ -24,7 +24,6 @@ application.
.AP "const char" *name in
Name under which to register the application.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_SetAppName\fR associates a name with a given application and
@@ -59,6 +58,5 @@ so applications do not normally need to call it explicitly.
.PP
The command \fBtk appname\fR provides Tcl-level access to the
functionality of \fBTk_SetAppName\fR.
-
.SH KEYWORDS
application, name, register, send command
diff --git a/doc/SetCaret.3 b/doc/SetCaret.3
index 210cb21..5fd4f1f 100644
--- a/doc/SetCaret.3
+++ b/doc/SetCaret.3
@@ -25,7 +25,6 @@ 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
@@ -33,6 +32,5 @@ 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/doc/SetClass.3 b/doc/SetClass.3
index a457777..46f3c1b 100644
--- a/doc/SetClass.3
+++ b/doc/SetClass.3
@@ -25,7 +25,6 @@ Token for window.
.AP char *class in
New class name for window.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_SetClass\fR is called to associate a class with a particular
@@ -54,6 +53,5 @@ the properties of a unique identifier (see the manual entry for
\fBTk_GetUid\fR for details).
If \fItkwin\fR has not yet been given a class, then
\fBTk_Class\fR will return NULL.
-
.SH KEYWORDS
class, unique identifier, window, window manager
diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3
index e8820b6..e0398f5 100644
--- a/doc/SetClassProcs.3
+++ b/doc/SetClassProcs.3
@@ -18,14 +18,13 @@ Tk_SetClassProcs \- register widget specific procedures
.AS Tk_ClassProc instanceData
.AP Tk_Window tkwin in
Token for window to modify.
-.AP Tk_ClassProcs *procs in
+.AP "const 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
@@ -38,7 +37,7 @@ typedef struct Tk_ClassProcs {
Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
Tk_ClassCreateProc *\fIcreateProc\fR;
Tk_ClassModalProc *\fImodalProc\fR;
-} Tk_ClassProcs;
+} \fBTk_ClassProcs\fR;
.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.
@@ -50,8 +49,8 @@ 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);
+typedef void \fBTk_ClassWorldChangedProc\fR(
+ ClientData \fIinstanceData\fR);
.CE
The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
will be identical to the \fIinstanceData\fR parameter passed to
@@ -61,10 +60,10 @@ will be identical to the \fIinstanceData\fR parameter passed to
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);
+typedef Window \fBTk_ClassCreateProc\fR(
+ 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
@@ -76,14 +75,13 @@ created window.
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);
+typedef void \fBTk_ClassModalProc\fR(
+ 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/doc/SetGrid.3 b/doc/SetGrid.3
index c304ba2..5fe4509 100644
--- a/doc/SetGrid.3
+++ b/doc/SetGrid.3
@@ -32,7 +32,6 @@ Width of one grid unit, in pixels.
.AP int heightInc in
Height of one grid unit, in pixels.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's
@@ -60,6 +59,5 @@ toplevel, the calls for the new window have no effect.
.PP
See the \fBwm\fR manual entry for additional information on gridded geometry
management.
-
.SH KEYWORDS
grid, window, window manager
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3
index 6ce3db0..e9758ce 100644
--- a/doc/SetOptions.3
+++ b/doc/SetOptions.3
@@ -243,7 +243,6 @@ The \fBTk_Offset\fR macro is provided as a safe way of generating the
Tk_OptionSpec structures. It takes two arguments: the name of a type
of record, and the name of a field in that record. It returns the byte
offset of the named field in records of the given type.
-
.SH "TEMPLATES"
.PP
The array of Tk_OptionSpec structures passed to \fBTk_CreateOptionTable\fR
@@ -262,7 +261,7 @@ typedef struct {
int \fIflags\fR;
ClientData \fIclientData\fR;
int \fItypeMask\fR;
-} Tk_OptionSpec;
+} \fBTk_OptionSpec\fR;
.CE
The \fItype\fR field indicates what kind of configuration option this is
(e.g. \fBTK_OPTION_COLOR\fR for a color value, or \fBTK_OPTION_INT\fR for
@@ -434,7 +433,7 @@ suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must
be one of the strings in the table, or a unique abbreviation of
one of the strings. The internal form is an integer giving the index
into the table of the matching string, like the return value
-from \fBTcl_GetStringFromObj\fR.
+from \fBTcl_GetStringFromObj\fR.
.TP
\fBTK_OPTION_SYNONYM\fR
This type is used to provide alternative names for an option (for
@@ -450,7 +449,6 @@ The value must be a window path name. The internal form is a
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR (in order to identify the application),
and it supports the \fBTK_OPTION_NULL_OK\fR flag.
-
.SH "STORAGE MANAGEMENT ISSUES"
.PP
If a field of a widget record has its offset stored in the \fIobjOffset\fR
@@ -474,7 +472,6 @@ However, the widget code is responsible for storing NULL or \fBNone\fR in
all pointer and token fields before invoking \fBTk_InitOptions\fR.
This is needed to allow proper cleanup in the rare case where
an error occurs in \fBTk_InitOptions\fR.
-
.SH "OBJOFFSET VS. INTERNALOFFSET"
.PP
In most cases it is simplest to use the \fIinternalOffset\fR field of
@@ -505,7 +502,6 @@ To implement a new type of option, you can use \fBTK_OPTION_STRING\fR 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
@@ -520,34 +516,34 @@ typedef struct Tk_ObjCustomOption {
Tk_CustomOptionRestoreProc *\fIrestoreProc\fR;
Tk_CustomOptionFreeProc *\fIfreeProc\fR;
ClientData \fIclientData\fR;
-} Tk_ObjCustomOption;
+} \fBTk_ObjCustomOption\fR;
-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 int \fBTk_CustomOptionSetProc\fR(
+ 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 Tcl_Obj *\fBTk_CustomOptionGetProc\fR(
+ 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 \fBTk_CustomOptionRestoreProc\fR(
+ 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);
+typedef void \fBTk_CustomOptionFreeProc\fR(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIinternalPtr\fR);
.CE
.PP
The Tk_ObjCustomOption structure contains six fields: a name
@@ -645,8 +641,6 @@ structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to
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,
diff --git a/doc/SetVisual.3 b/doc/SetVisual.3
index 2082220..e902ed4 100644
--- a/doc/SetVisual.3
+++ b/doc/SetVisual.3
@@ -28,7 +28,6 @@ Number of bits per pixel desired for \fItkwin\fR.
New colormap for \fItkwin\fR, which must be compatible with
\fIvisual\fR and \fIdepth\fR.
.BE
-
.SH DESCRIPTION
.PP
When Tk creates a new window it assigns it the default visual
@@ -47,6 +46,5 @@ completed successfully.
Note: \fBTk_SetWindowVisual\fR should not be called if you just want
to change a window's colormap without changing its visual or depth;
call \fBTk_SetWindowColormap\fR instead.
-
.SH KEYWORDS
colormap, depth, visual
diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3
index 770b335..4e898fd 100644
--- a/doc/StrictMotif.3
+++ b/doc/StrictMotif.3
@@ -20,7 +20,6 @@ int
.AP Tk_Window tkwin in
Token for window.
.BE
-
.SH DESCRIPTION
.PP
This procedure returns the current value of the \fBtk_strictMotif\fR
@@ -35,6 +34,5 @@ is good enough, and extra features are welcome.
This procedure uses a link to the Tcl variable to provide much
faster access to the variable's value than could be had by calling
\fBTcl_GetVar\fR.
-
.SH KEYWORDS
Motif compliance, tk_strictMotif variable
diff --git a/doc/TextLayout.3 b/doc/TextLayout.3
index 6c4da60..706eaf5 100644
--- a/doc/TextLayout.3
+++ b/doc/TextLayout.3
@@ -39,7 +39,6 @@ int
.sp
void
\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR
-
.SH ARGUMENTS
.AS Tk_TextLayout "*xPtr, *yPtr"
.AP Tk_Font tkfont in
@@ -124,9 +123,8 @@ Specifies the width and height, in pixels, of the rectangular area to
compare for intersection against the text layout.
.AP Tcl_Interp *interp out
Postscript code that will print the text layout is appended to
-\fIinterp->result\fR.
+the result of interpreter \fIinterp\fR.
.BE
-
.SH DESCRIPTION
.PP
These routines are for measuring and displaying single-font, multi-line,
@@ -184,9 +182,11 @@ whose \fIx\fR-value is less than 0 will be considered closest to the first
character on that line; any point whose \fIx\fR-value is greater than the
width of the text layout will be considered closest to the last character on
that line. The return value is the index of the character that was closest
-to the point. Given a \fIlayout\fR with no characters, the value 0 will
-always be returned, referring to a hypothetical zero-width placeholder
-character.
+to the point, or one more than the index of any character (to indicate that
+the point was after the end of the string and that the corresponding caret
+would be at the end of the string). Given a \fIlayout\fR with no characters,
+the value 0 will always be returned, referring to a hypothetical zero-width
+placeholder character.
.PP
\fBTk_CharBbox\fR uses the information in \fIlayout\fR to return the
bounding box for the character specified by \fIindex\fR. The width of the
@@ -231,8 +231,9 @@ array of strings that represent the individual lines in \fIlayout\fR. It
is the responsibility of the caller to take the Postscript array of
strings and add some Postscript function operate on the array to render
each of the lines. The code that represents the Postscript array of
-strings is appended to \fIinterp->result\fR.
+strings is appended to interpreter \fIinterp\fR's result.
.SH "DISPLAY MODEL"
+.PP
When measuring a text layout, space characters that occur at the end of a
line are ignored. The space characters still exist and the insertion point
can be positioned amongst them, but their additional width is ignored when
diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3
index 3806f95..79b7116 100644
--- a/doc/TkInitStubs.3
+++ b/doc/TkInitStubs.3
@@ -48,15 +48,19 @@ Tcl functions.
Call \fBTk_InitStubs\fR if the extension before calling any other
Tk functions.
.IP 2) 5
-Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
-\fB\-DUSE_TCL_STUBS\fR flag when compiling the extension.
+Define the \fBUSE_TCL_STUBS\fR and the \fBUSE_TK_STUBS\fR
+symbols. Typically, you would include the \fB\-DUSE_TCL_STUBS\fR and
+the \fB\-DUSE_TK_STUBS\fR flags when compiling the extension.
.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.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).
+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.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows
+platforms, the library names are \fItclstub84.lib\fR and
+\fItkstub84.lib\fR. Adjust the library names with appropriate version
+number but note that the extension may only be used with versions of
+Tcl/Tk that have that version number or higher.
.SH DESCRIPTION
+.PP
\fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers
and ensure that the correct version of Tk is loaded. In addition
to an interpreter handle, it accepts as arguments a version number
diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3
index 65e2d0a..cf93e58 100644
--- a/doc/Tk_Init.3
+++ b/doc/Tk_Init.3
@@ -23,7 +23,6 @@ int
Interpreter in which to load Tk. Tk should not already be loaded
in this interpreter.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_Init\fR is the package initialization procedure for Tk.
@@ -34,7 +33,7 @@ and creates a new Tk application, including its main window.
If the initialization is successful \fBTk_Init\fR returns
\fBTCL_OK\fR; if there is an error it returns \fBTCL_ERROR\fR.
\fBTk_Init\fR also leaves a result or error message
-in \fIinterp->result\fR.
+in interpreter \fIinterp\fR's result.
.PP
If there is a variable \fBargv\fR in \fIinterp\fR, \fBTk_Init\fR
treats the contents of this variable as a list of options for the
@@ -82,6 +81,5 @@ from the user.
\fBwm\fR
If toplevels are ever allowed, wm can be used to remove decorations,
move windows around, etc.
-
.SH KEYWORDS
safe, application, initialization, load, main window
diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3
index e67cf00..5db887b 100644
--- a/doc/Tk_Main.3
+++ b/doc/Tk_Main.3
@@ -20,12 +20,12 @@ Tk_Main \- main program for Tk-based applications
.AP int argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
-Array of strings containing command-line arguments.
+Array of strings containing command-line arguments. On Windows, when
+using -DUNICODE, the parameter type changes to wchar_t *.
.AP Tcl_AppInitProc *appInitProc in
Address of an application-specific initialization procedure.
The value for this argument is usually \fBTcl_AppInit\fR.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_Main\fR acts as the main program for most Tk-based applications.
@@ -50,11 +50,21 @@ for the application to perform its own initialization, such as defining
application-specific commands. The procedure must have an interface
that matches the type \fBTcl_AppInitProc\fR:
.CS
-typedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR);
+typedef int \fBTcl_AppInitProc\fR(
+ Tcl_Interp *\fIinterp\fR);
.CE
\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR;
for more details on this procedure, see the documentation
for \fBTcl_AppInit\fR.
-
+.PP
+\fBTk_Main\fR functions much the same as \fBTcl_Main\fR. In particular,
+\fBTk_Main\fR supports both an interactive mode and a startup script
+mode, with the file name and encoding of a startup script under the
+control of the \fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
+routines. However it calls \fBTk_MainLoop\fR after processing any
+supplied script, and in interactive uses events registered with
+\fBTcl_CreateFileHandler\fR to process user input.
+.SH "SEE ALSO"
+Tcl_DoOneEvent(3)
.SH KEYWORDS
application-specific initialization, command-line arguments, main program
diff --git a/doc/WindowId.3 b/doc/WindowId.3
index efa326d..30f80a3 100644
--- a/doc/WindowId.3
+++ b/doc/WindowId.3
@@ -102,7 +102,6 @@ Tcl_Interp *
.AP Tk_Window tkwin in
Token for window.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_WindowId\fR and the other names listed above are
@@ -183,7 +182,6 @@ and \fBTk_Colormap\fR returns the current
colormap for the window. The visual characteristics are
normally set from the defaults for the window's screen, but
they may be overridden by calling \fBTk_SetWindowVisual\fR.
-
.SH KEYWORDS
attributes, colormap, depth, display, height, geometry manager,
identifier, mapped, requested size, screen, top-level,
diff --git a/doc/bell.n b/doc/bell.n
index c9861bf..94d1545 100644
--- a/doc/bell.n
+++ b/doc/bell.n
@@ -15,7 +15,6 @@ bell \- Ring a display's bell
.SH SYNOPSIS
\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR?
.BE
-
.SH DESCRIPTION
.PP
This command rings the bell on the display for \fIwindow\fR and
@@ -28,6 +27,8 @@ may be modified with programs such as \fBxset\fR.
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
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/bind.n b/doc/bind.n
index cd556e7..bccd6c8 100644
--- a/doc/bind.n
+++ b/doc/bind.n
@@ -151,7 +151,6 @@ requirement.
The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR
resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys.
.PP
-.VS 8.5
The \fBExtended\fR modifier is, at present, specific to Windows. It
appears on events that are associated with the keys on the
.QW "extended keyboard" .
@@ -160,7 +159,6 @@ and \fBControl\fR keys at the right of the keyboard, the cursor keys
in the cluster to the left of the numeric pad, the \fBNumLock\fR key,
the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and
\fBEnter\fR keys in the numeric keypad.
-.VE 8.5
.SS "EVENT TYPES"
.PP
The \fItype\fR field may be any of the standard X event types, with a
@@ -429,10 +427,7 @@ The \fIcount\fR field from the event. Valid only for \fBExpose\fR events.
Indicates that there are \fIcount\fR pending \fBExpose\fR events which have not
yet been delivered to the window.
.IP \fB%d\fR 5
-The \fIdetail\fR
-.VS 8.5
-or \fIuser_data\fR
-.VE 8.5
+The \fIdetail\fR or \fIuser_data\fR
field from the event. The \fB%d\fR is replaced by
a string identifying the detail. For \fBEnter\fR,
\fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events,
@@ -452,13 +447,11 @@ For \fBConfigureRequest\fR events, the string will be one of:
\fBBelow\fR \fBNone\fR
\fBBottomIf\fR \fBTopIf\fR
.DE
-.VS 8.5
For virtual events, the string will be whatever value is stored in the
\fIuser_data\fR field when the event was created (typically with
\fBevent generate\fR), or the empty string if the field is NULL.
Virtual events corresponding to key sequence presses (see \fBevent
add\fR for details) set the \fIuser_data\fR to NULL.
-.VE 8.5
For events other than these, the substituted string is undefined.
.RE
.IP \fB%f\fR 5
@@ -701,6 +694,7 @@ If an error occurs in executing the script for a binding then the
The \fBbgerror\fR command will be executed at global level
(outside the context of any Tcl procedure).
.SH "EXAMPLES"
+.PP
Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked:
.CS
@@ -722,3 +716,6 @@ pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
.SH KEYWORDS
binding, event
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/bindtags.n b/doc/bindtags.n
index c5cf71b..74bd638 100644
--- a/doc/bindtags.n
+++ b/doc/bindtags.n
@@ -14,7 +14,6 @@ bindtags \- Determine which bindings apply to a window, and order of evaluation
.SH SYNOPSIS
\fBbindtags \fIwindow \fR?\fItagList\fR?
.BE
-
.SH DESCRIPTION
.PP
When a binding is created with the \fBbind\fR command, it is
@@ -73,6 +72,7 @@ associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR,
but any bindings associated with \fBTrickyButton\fR (perhaps some
new button behavior) will apply.
.SH EXAMPLE
+.PP
If you have a set of nested \fBframe\fR widgets and you want events
sent to a \fBbutton\fR widget to also be delivered to all the widgets
up to the current \fBtoplevel\fR (in contrast to Tk's default
@@ -93,9 +93,10 @@ proc setupBindtagsForTreeDelivery {widget} {
\fBbindtags\fR $widget $tags
}
.CE
-
.SH "SEE ALSO"
bind(n)
-
.SH KEYWORDS
binding, event, tag
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/bitmap.n b/doc/bitmap.n
index 0dde8d5..968e6ea 100644
--- a/doc/bitmap.n
+++ b/doc/bitmap.n
@@ -12,9 +12,13 @@
.SH NAME
bitmap \- Images that display two colors
.SH SYNOPSIS
+.nf
\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR?
-.BE
+\fIimageName \fBcget\fR \fIoption\fR
+\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.fi
+.BE
.SH DESCRIPTION
.PP
A bitmap is an image whose pixels can display either of two colors
@@ -30,7 +34,6 @@ producing a transparent effect.
For other pixels, the image displays the foreground color if
the source data is one and the background color if the source
data is zero.
-
.SH "CREATING BITMAPS"
.PP
Like all images, bitmaps are created using the \fBimage create\fR
@@ -38,6 +41,7 @@ command.
Bitmaps support the following \fIoptions\fR:
.TP
\fB\-background \fIcolor\fR
+.
Specifies a background color for the image in any of the standard
ways accepted by Tk. If this option is set to an empty string
then the background pixels will be transparent. This effect
@@ -45,6 +49,7 @@ is achieved by using the source bitmap as the mask bitmap, ignoring
any \fB\-maskdata\fR or \fB\-maskfile\fR options.
.TP
\fB\-data \fIstring\fR
+.
Specifies the contents of the source bitmap as a string.
The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
@@ -52,16 +57,19 @@ If both the \fB\-data\fR and \fB\-file\fR options are specified,
the \fB\-data\fR option takes precedence.
.TP
\fB\-file \fIname\fR
+.
\fIname\fR gives the name of a file whose contents define the
source bitmap.
The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
.TP
\fB\-foreground \fIcolor\fR
+.
Specifies a foreground color for the image in any of the standard
ways accepted by Tk.
.TP
\fB\-maskdata \fIstring\fR
+.
Specifies the contents of the mask as a string.
The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
@@ -69,11 +77,11 @@ If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified,
the \fB\-maskdata\fR option takes precedence.
.TP
\fB\-maskfile \fIname\fR
+.
\fIname\fR gives the name of a file whose contents define the
mask.
The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
-
.SH "IMAGE COMMAND"
.PP
When a bitmap image is created, Tk also creates a new command
@@ -89,12 +97,14 @@ determine the exact behavior of the command. The following
commands are possible for bitmap images:
.TP
\fIimageName \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
-\fBimage create bitmap\fR command.
+\fBimage create\fR \fBbitmap\fR command.
.TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options for the image.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
@@ -106,7 +116,9 @@ 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.
\fIOption\fR may have any of the values accepted by the
-\fBimage create bitmap\fR command.
-
+\fBimage create\fR \fBbitmap\fR command.
.SH KEYWORDS
bitmap, image
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/busy.n b/doc/busy.n
new file mode 100644
index 0000000..0584027
--- /dev/null
+++ b/doc/busy.n
@@ -0,0 +1,267 @@
+'\"
+'\" Copyright (c) 1993-1998 Lucent Technologies, Inc.
+'\" Copyright (c) 2008 Jos Decoster
+'\"
+'\" Permission to use, copy, modify, and distribute this software and its
+'\" documentation for any purpose and without fee is hereby granted, provided
+'\" that the above copyright notice appear in all copies and that both that
+'\" the copyright notice and warranty disclaimer appear in supporting
+'\" documentation, and that the names of Lucent Technologies any of their
+'\" entities not be used in advertising or publicity pertaining to
+'\" distribution of the software without specific, written prior permission.
+'\"
+'\" Lucent Technologies disclaims all warranties with regard to this software,
+'\" including all implied warranties of merchantability and fitness. In no
+'\" event shall Lucent Technologies be liable for any special, indirect or
+'\" consequential damages or any damages whatsoever resulting from loss of
+'\" use, data or profits, whether in an action of contract, negligence or
+'\" other tortuous action, arising out of or in connection with the use or
+'\" performance of this software.
+'\"
+'\" BLT::busy command created by George Howlett.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.so man.macros
+.TH busy n "" Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+busy \- confine pointer and keyboard events to a window sub-tree
+.SH SYNOPSIS
+\fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
+.sp
+\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR?
+.sp
+\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
+.sp
+\fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?...
+.sp
+\fBtk busy current\fR ?\fIpattern\fR?
+.sp
+\fBtk busy status \fIwindow\fR
+.BE
+.SH DESCRIPTION
+.PP
+The \fBtk busy\fR command provides a simple means to block keyboard, button,
+and pointer events from Tk widgets, while overriding the widget's cursor with
+a configurable busy cursor.
+.SH INTRODUCTION
+.PP
+There are many times in applications where you want to temporarily restrict
+what actions the user can take. For example, an application could have a
+.QW Run
+button that when pressed causes some processing to occur. But while the
+application is busy processing, you probably don't want the the user to be
+able to click the
+.QW Run
+button again. You may also want restrict the user from other tasks such as
+clicking a
+.QW Print
+button.
+.PP
+The \fBtk busy\fR command lets you make Tk widgets busy. This means that user
+interactions such as button clicks, moving the mouse, typing at the keyboard,
+etc.\0are ignored by the widget. You can set a special cursor (like a watch)
+that overrides the widget's normal cursor, providing feedback that the
+application (widget) is temporarily busy.
+.PP
+When a widget is made busy, the widget and all of its descendents will ignore
+events. It's easy to make an entire panel of widgets busy. You can simply make
+the toplevel widget (such as
+.QW . )
+busy. This is easier and far much more efficient than recursively traversing
+the widget hierarchy, disabling each widget and re-configuring its cursor.
+.PP
+Often, the \fBtk busy\fR command can be used instead of Tk's \fBgrab\fR
+command. Unlike \fBgrab\fR which restricts all user interactions to one
+widget, with the \fBtk busy\fR command you can have more than one widget
+active (for example, a
+.QW Cancel
+dialog and a
+.QW Help
+button).
+.SS EXAMPLE
+.PP
+You can make several widgets busy by simply making its ancestor widget busy
+using the \fBhold\fR operation.
+.PP
+.CS
+frame .top
+button .top.button; canvas .top.canvas
+pack .top.button .top.canvas
+pack .top
+# . . .
+\fBtk busy\fR hold .top
+update
+.CE
+.PP
+All the widgets within \fB.top\fR (including \fB.top\fR) are now busy. Using
+\fBupdate\fR insures that \fBtk busy\fR command will take effect before any
+other user events can occur.
+.PP
+When the application is no longer busy processing, you can allow user
+interactions again and free any resources it allocated by the \fBforget\fR
+operation.
+.PP
+.CS
+\fBtk busy\fR forget .top
+.CE
+.PP
+The busy window has a configurable cursor. You can change the busy cursor
+using the \fBconfigure\fR operation.
+.PP
+.CS
+\fBtk busy\fR configure .top \-cursor "watch"
+.CE
+.PP
+Destroying the widget will also clean up any resources allocated by the \fBtk
+busy\fR command.
+.PP
+.SH OPERATIONS
+.PP
+The following operations are available for the \fBtk busy\fR command:
+.TP
+\fBtk busy \fIwindow\fR ?\fIoption value\fR?...
+.
+Shortcut for \fBtk busy hold\fR command.
+.TP
+\fBtk busy hold \fIwindow\fR ?\fIoption value\fR?...
+.
+Makes the specified \fIwindow\fR (and its descendants in the Tk window
+hierarchy) appear busy. \fIWindow\fR must be a valid path name of a Tk widget.
+A transparent window is put in front of the specified window. This transparent
+window is mapped the next time idle tasks are processed, and the specified
+window and its descendants will be blocked from user interactions. Normally
+\fBupdate\fR should be called immediately afterward to insure that the hold
+operation is in effect before the application starts its processing. The
+following configuration options are valid:
+.RS
+.TP
+\fB\-cursor \fIcursorName\fR
+.
+Specifies the cursor to be displayed when the widget is made busy.
+\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The
+default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms.
+.RE
+.TP
+\fBtk busy cget \fIwindow\fR \fIoption\fR
+.
+Queries the \fBtk busy\fR command configuration options for \fIwindow\fR.
+\fIWindow\fR must be the path name of a widget previously made busy by the
+\fBhold\fR operation. The command returns the present value of the specified
+\fIoption\fR. \fIOption\fR may have any of the values accepted by the
+\fBhold\fR operation.
+.TP
+\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
+.
+Queries or modifies the \fBtk busy\fR command configuration options for
+\fIwindow\fR. \fIWindow\fR must be the path name of a widget previously made
+busy by the \fBhold\fR operation. If no options are specified, a list
+describing all of the available options for \fIwindow\fR (see
+\fBTk_ConfigureInfo\fR for information on the format of this list) is
+returned. If \fIoption\fR is specified with no \fIvalue\fR, then the command
+returns a list describing the one named option (this list will be identical to
+the corresponding sublist of the value returned if no \fIoption\fR is
+specified). If one or more \fIoption\-value\fR pairs are specified, then the
+command modifies the given widget option(s) to have the given value(s); in
+this case the command returns the empty string. \fIOption\fR may have any of
+the values accepted by the \fBhold\fR operation.
+.RS
+.PP
+Please note that the option database is referenced through \fIwindow\fR. For
+example, if the widget \fB.frame\fR is to be made busy, the busy cursor can be
+specified for it by either \fBoption\fR command:
+.PP
+.CS
+option add *frame.busyCursor gumby
+option add *Frame.BusyCursor gumby
+.CE
+.RE
+.TP
+\fBtk busy forget \fIwindow\fR ?\fIwindow\fR?...
+.
+Releases resources allocated by the \fBtk busy\fR command for \fIwindow\fR,
+including the transparent window. User events will again be received by
+\fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed.
+\fIWindow\fR must be the name of a widget specified in the \fBhold\fR
+operation, otherwise an error is reported.
+.TP
+\fBtk busy current \fR?\fIpattern\fR?
+.
+Returns the pathnames of all widgets that are currently busy. If a
+\fIpattern\fR is given, only the path names of busy widgets matching
+\fIpattern\fR are returned.
+.TP
+\fBtk busy status \fIwindow\fR
+.
+Returns the status of a widget \fIwindow\fR. If \fIwindow\fR presently can not
+receive user interactions, \fB1\fR is returned, otherwise \fB0\fR.
+.SH "EVENT HANDLING"
+.SS BINDINGS
+.PP
+The event blocking feature is implemented by creating and mapping a
+transparent window that completely covers the widget. When the busy window is
+mapped, it invisibly shields the widget and its hierarchy from all events that
+may be sent. Like Tk widgets, busy windows have widget names in the Tk window
+hierarchy. This means that you can use the \fBbind\fR command, to handle
+events in the busy window.
+.PP
+.CS
+\fBtk busy\fR hold .frame.canvas
+bind .frame.canvas_Busy <Enter> { ... }
+.CE
+.PP
+Normally the busy window is a sibling of the widget. The name of the busy
+window is
+.QW \fIwidget\fB_Busy\fR
+where \fIwidget\fR is the name of the widget to be made busy. In the previous
+example, the pathname of the busy window is
+.QW \fB.frame.canvas_Busy\fR .
+The exception is when the widget is a toplevel widget (such as
+.QW . )
+where the busy window can't be made a sibling. The busy window is then a child
+of the widget named
+.QW \fIwidget\fB._Busy\fR
+where \fIwidget\fR is the name of the toplevel widget. In the following
+example, the pathname of the busy window is
+.QW \fB._Busy\fR .
+.PP
+.CS
+\fBtk busy\fR hold .
+bind ._Busy <Enter> { ... }
+.CE
+.SS "ENTER/LEAVE EVENTS"
+.PP
+Mapping and unmapping busy windows generates Enter/Leave events for all
+widgets they cover. Please note this if you are tracking Enter/Leave events in
+widgets.
+.SS "KEYBOARD EVENTS"
+.PP
+When a widget is made busy, the widget is prevented from gaining the keyboard
+focus by the busy window. But if the widget already had focus, it still may
+received keyboard events. To prevent this, you must move focus to another
+window.
+.PP
+.CS
+\fBtk busy\fR hold .frame
+label .dummy
+focus .dummy
+update
+.CE
+.PP
+The above example moves the focus from .frame immediately after invoking the
+\fBhold\fR so that no keyboard events will be sent to \fB.frame\fR or any of
+its descendants.
+.SH PORTABILITY
+.PP
+Note that the \fBtk busy\fR command does not currently have any effect on OSX
+when Tk is built using Aqua support.
+.SH "SEE ALSO"
+grab(n)
+.SH KEYWORDS
+busy, keyboard events, pointer events, window
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/button.n b/doc/button.n
index 4b655a4..d4f1af3 100644
--- a/doc/button.n
+++ b/doc/button.n
@@ -57,14 +57,14 @@ The empty string is the default value.
.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
-\fBforeground\fR and \fBbackground\fR options. The active state is
+\fB\-foreground\fR and \fB\-background\fR options. The active state is
typically used when the pointer is over the button. In active state
-the button is displayed using the \fBactiveForeground\fR and
-\fBactiveBackground\fR options. Disabled state means that the button
+the button is displayed using the \fB\-activeforeground\fR and
+\fB\-activebackground\fR options. Disabled state means that the button
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
-In this state the \fBdisabledForeground\fR and
-\fBbackground\fR options determine how the button is displayed.
+In this state the \fB\-disabledforeground\fR and
+\fB\-background\fR options determine how the button is displayed.
.OP \-width width Width
Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in
@@ -75,7 +75,6 @@ If the width is negative then this specifies a minimum width.
If this option is not specified, the button's desired width is computed
from the size of the image or bitmap or text being displayed in it.
.BE
-
.SH DESCRIPTION
.PP
The \fBbutton\fR command creates a new window (given by the
@@ -92,18 +91,17 @@ there must not exist a window named \fIpathName\fR, but
A button is a widget that displays a textual string, bitmap or image.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
-or if wrapping occurs because of the \fBwrapLength\fR option) and
+or if wrapping occurs because of the \fB\-wraplength\fR option) and
one of the characters may optionally be underlined using the
-\fBunderline\fR option.
+\fB\-underline\fR option.
It can display itself in either of three different ways, according
to
-the \fBstate\fR option;
+the \fB\-state\fR option;
it can be made to appear raised, sunken, or flat;
and it can be made to flash. When a user invokes the
button (by pressing mouse button 1 with the cursor over the
button), then the Tcl command specified in the \fB\-command\fR
option is invoked.
-
.SH "WIDGET COMMAND"
.PP
The \fBbutton\fR command creates a new Tcl command whose
@@ -139,9 +137,9 @@ command.
.TP
\fIpathName \fBflash\fR
Flash the button. This is accomplished by redisplaying the button
-several times, alternating between active and normal colors. At
-the end of the flash the button is left in the same normal/active
-state as when the command was invoked.
+several times, alternating between the configured activebackground
+and background colors. At the end of the flash the button is left
+in the same normal/active state as when the command was invoked.
This command is ignored if the button's state is \fBdisabled\fR.
.TP
\fIpathName \fBinvoke\fR
@@ -149,7 +147,6 @@ Invoke the Tcl command associated with the button, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the button.
This command is ignored if the button's state is \fBdisabled\fR.
-
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for buttons that give them
@@ -176,27 +173,38 @@ actions occur: the button is completely non-responsive.
.PP
The behavior of buttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "PLATFORM NOTES"
+.PP
+On Aqua/Mac OS X, some configuration options are ignored for the purpose of
+drawing of the widget because they would otherwise conflict with platform
+guidelines. The \fBconfigure\fR and \fBcget\fR subcommands can still
+manipulate the values, but do not cause any variation to the look of the
+widget. The options affected notably include \fB\-background\fR and
+\fB\-relief\fR.
.SH EXAMPLES
+.PP
This is the classic Tk
.QW "Hello, World!"
demonstration:
.PP
.CS
- \fBbutton\fR .b \-text "Hello, World!" \-command exit
- pack .b
+\fBbutton\fR .b \-text "Hello, World!" \-command exit
+pack .b
.CE
.PP
This example demonstrates how to handle button accelerators:
.PP
.CS
- \fBbutton\fR .b1 \-text Hello \-underline 0
- \fBbutton\fR .b2 \-text World \-underline 0
- bind . <Key\-h> {.b1 flash; .b1 invoke}
- bind . <Key\-w> {.b2 flash; .b2 invoke}
- pack .b1 .b2
+\fBbutton\fR .b1 \-text Hello \-underline 0
+\fBbutton\fR .b2 \-text World \-underline 0
+bind . <Key\-h> {.b1 flash; .b1 invoke}
+bind . <Key\-w> {.b2 flash; .b2 invoke}
+pack .b1 .b2
.CE
.SH "SEE ALSO"
ttk::button(n)
.SH KEYWORDS
button, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/canvas.n b/doc/canvas.n
index bdf1e62..0df3f39 100644
--- a/doc/canvas.n
+++ b/doc/canvas.n
@@ -36,7 +36,7 @@ Defaults to true, which means that the view will
be constrained within the scroll region.
.OP \-height height Height
Specifies a desired window height that the canvas widget should request from
-its geometry manager. The value may be specified in any
+its geometry manager. The value may be specified in any
of the forms described in the \fBCOORDINATES\fR section below.
.OP \-scrollregion scrollRegion ScrollRegion
Specifies a list with four coordinates describing the left, top, right, and
@@ -49,34 +49,34 @@ in any of the forms given in the \fBCOORDINATES\fR section below.
Modifies the default state of the canvas where \fIstate\fR may be set to
one of: \fBnormal\fR, \fBdisabled\fR, or \fBhidden\fR. Individual canvas
objects all have their own state option which may override the default
-state. Many options can take separate specifications such that the
+state. Many options can take separate specifications such that the
appearance of the item can be different in different situations. The
options that start with \fBactive\fR control the appearance when the mouse
pointer is over it, while the option starting with \fBdisabled\fR controls
-the appearance when the state is disabled. Canvas items which are
+the appearance when the state is disabled. Canvas items which are
\fBdisabled\fR will not react to canvas bindings.
.OP \-width width width
Specifies a desired window width that the canvas widget should request from
-its geometry manager. The value may be specified in any
+its geometry manager. The value may be specified in any
of the forms described in the \fBCOORDINATES\fR section below.
.OP \-xscrollincrement xScrollIncrement ScrollIncrement
Specifies an increment for horizontal scrolling, in any of the usual forms
-permitted for screen distances. If the value of this option is greater
+permitted for screen distances. If the value of this option is greater
than zero, the horizontal view in the window will be constrained so that
the canvas x coordinate at the left edge of the window is always an even
-multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling
+multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling
(e.g., the change in view when the left and right arrows of a scrollbar
-are selected) will also be \fBxScrollIncrement\fR. If the value of
+are selected) will also be \fBxScrollIncrement\fR. If the value of
this option is less than or equal to zero, then horizontal scrolling
is unconstrained.
.OP \-yscrollincrement yScrollIncrement ScrollIncrement
Specifies an increment for vertical scrolling, in any of the usual forms
-permitted for screen distances. If the value of this option is greater
+permitted for screen distances. If the value of this option is greater
than zero, the vertical view in the window will be constrained so that
the canvas y coordinate at the top edge of the window is always an even
-multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling
+multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling
(e.g., the change in view when the top and bottom arrows of a scrollbar
-are selected) will also be \fByScrollIncrement\fR. If the value of
+are selected) will also be \fByScrollIncrement\fR. If the value of
this option is less than or equal to zero, then vertical scrolling
is unconstrained.
.BE
@@ -88,7 +88,7 @@ Additional options, described above, may be specified on the
command line or in the option database
to configure aspects of the canvas such as its colors and 3-D relief.
The \fBcanvas\fR command returns its
-\fIpathName\fR argument. At the time this command is invoked,
+\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
@@ -97,7 +97,7 @@ A canvas displays any number of \fIitems\fR, which may be things like
rectangles, circles, lines, and text.
Items may be manipulated (e.g. moved or re-colored) and commands may
be associated with items in much the same way that the \fBbind\fR
-command allows commands to be bound to widgets. For example,
+command allows commands to be bound to widgets. For example,
a particular command may be associated with the <Button-1> event
so that the command is invoked whenever button 1 is pressed with
the mouse cursor over an item.
@@ -117,22 +117,22 @@ display list, on top of everything else.
Widget commands may be used to re-arrange the order of the
display list.
.PP
-Window items are an exception to the above rules. The underlying
+Window items are an exception to the above rules. The underlying
window systems require them always to be drawn on top of other items.
In addition, the stacking order of window items
is not affected by any of the canvas widget commands; you must use
-the \fBraise\fR and \fBlower\fR Tk commands instead.
+the Tk \fBraise\fR command and \fBlower\fR command instead.
.SH "ITEM IDS AND TAGS"
.PP
Items in a canvas widget may be named in either of two ways:
by id or by tag.
Each item has a unique identifying number, which is assigned to
-that item when it is created. The id of an item never changes
+that item when it is created. The id of an item never changes
and id numbers are never re-used within the lifetime of a
canvas widget.
.PP
Each item may also have any number of \fItags\fR associated
-with it. A tag is just a string of characters, and it may
+with it. A tag is just a string of characters, and it may
take any form except that of an integer.
For example,
.QW x123
@@ -141,11 +141,11 @@ is OK but
is not.
The same tag may be associated with many different items.
This is commonly done to group items in various interesting
-ways; for example, all selected items might be given the tag
+ways; for example, all selected items might be given the tag
.QW selected .
.PP
The tag \fBall\fR is implicitly associated with every item
-in the canvas; it may be used to invoke operations on
+in the canvas; it may be used to invoke operations on
all the items in the canvas.
.PP
The tag \fBcurrent\fR is managed automatically by Tk;
@@ -172,7 +172,7 @@ tags by using operators:
.QW \fB||\fR ,
.QW \fB^\fR ,
.QW \fB!\fR ,
-and parenthesized subexpressions. For example:
+and parenthesized subexpressions. For example:
.CS
.c find withtag {(a&&!b)||(!a&&b)}
.CE
@@ -187,7 +187,7 @@ or
tags, but not both.
.PP
Some widget commands only operate on a single item at a
-time; if \fItagOrId\fR is specified in a way that
+time; if \fItagOrId\fR is specified in a way that
names multiple items, then the normal behavior is for
the command to use the first (lowest) of these items in
the display list that is suitable for the command.
@@ -202,9 +202,9 @@ which are floating-point numbers optionally followed
by one of several letters.
If no letter is supplied then the distance is in pixels.
If the letter is \fBm\fR then the distance is in millimeters on
-the screen; if it is \fBc\fR then the distance is in centimeters;
+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
+Larger y-coordinates refer to points lower on the screen; larger
x-coordinates refer to points farther to the right.
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
@@ -215,7 +215,7 @@ Normally the origin of the canvas coordinate system is at the
upper-left corner of the window containing the canvas.
It is possible to adjust the origin of the canvas
coordinate system relative to the origin of the window using the
-\fBxview\fR and \fByview\fR widget commands; this is typically used
+\fBxview\fR and \fByview\fR widget commands; this is typically used
for scrolling.
Canvases do not support scaling or rotation of the canvas coordinate
system relative to the window coordinate system.
@@ -227,7 +227,7 @@ Note that the default origin of the canvas's visible area is
coincident with the origin for the whole window as that makes bindings
using the mouse position easier to work with; you only need to use the
\fBcanvasx\fR and \fBcanvasy\fR widget commands if you adjust the
-origin of the visible area. However, this also means that any focus
+origin of the visible area. However, this also means that any focus
ring (as controlled by the \fB\-highlightthickness\fR option) and
window border (as controlled by the \fB\-borderwidth\fR option) must
be taken into account before you get to the visible area of the
@@ -243,17 +243,18 @@ a range of characters or coordinates, and setting the insertion
cursor position. An index may be specified in any of a number
of ways, and different types of items may support different forms
for specifying indices.
-Text items support the following forms for an index; if you
+Text items support the following forms for an index; if you
define new types of text-like items, it would be advisable to
support as many of these forms as practical.
Note that it is possible to refer to the character just after
-the last one in the text item; this is necessary for such
+the last one in the text item; this is necessary for such
tasks as inserting new text at the end of the item.
Lines and Polygons do not support the insertion cursor
and the selection. Their indices are supposed to be even
always, because coordinates always appear in pairs.
.TP 10
\fInumber\fR
+.
A decimal number giving the position of the desired character
within the text item.
0 refers to the first character, 1 to the next character, and
@@ -268,23 +269,28 @@ the length until the result is between zero and the length,
inclusive.
.TP 10
\fBend\fR
+.
Refers to the character or coordinate just after the last one
in the item (same as the number of characters or coordinates
in the item).
.TP 10
\fBinsert\fR
+.
Refers to the character just before which the insertion cursor
is drawn in this item. Not valid for lines and polygons.
.TP 10
\fBsel.first\fR
+.
Refers to the first selected character in the item.
If the selection is not in this item then this form is illegal.
.TP 10
\fBsel.last\fR
+.
Refers to the last selected character in the item.
If the selection is not in this item then this form is illegal.
.TP 10
\fB@\fIx,y\fR
+.
Refers to the character or coordinate at the point given by \fIx\fR and
\fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate
system of the canvas.
@@ -303,15 +309,15 @@ color. The other segments are drawn transparent.
.PP
The second possible syntax is a character list containing only
5 possible characters
-.QW "\fB.,\-_ \fR" .
+.QW "\fB.,-_ \fR" .
The space can be used
to enlarge the space between other line elements, and cannot
occur as the first position in the string. Some examples:
.CS
\-dash . \(-> \-dash {2 4}
-\-dash \- \(-> \-dash {6 4}
-\-dash \-. \(-> \-dash {6 4 2 4}
-\-dash \-.. \(-> \-dash {6 4 2 4 2 4}
+\-dash - \(-> \-dash {6 4}
+\-dash -. \(-> \-dash {6 4 2 4}
+\-dash -.. \(-> \-dash {6 4 2 4 2 4}
\-dash {. } \(-> \-dash {2 8}
\-dash , \(-> \-dash {4 4}
.CE
@@ -322,20 +328,20 @@ list will be multiplied by the line width before display. This
assures that
.QW .
will always be displayed as a dot and
-.QW \-
+.QW -
always as a dash regardless of the line width.
.PP
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
+available. The last 2 examples will be displayed identically to the first
one.
.SH "WIDGET COMMAND"
.PP
The \fBcanvas\fR command creates a new Tcl command whose
-name is \fIpathName\fR. This
+name is \fIpathName\fR. This
command may be used to invoke various
-operations on the widget. It has the following general form:
+operations on the widget. It has the following general form:
.CS
\fIpathName option \fR?\fIarg arg ...\fR?
.CE
@@ -344,6 +350,7 @@ determine the exact behavior of the command.
The following widget commands are possible for canvas widgets:
.TP
\fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg arg ...\fR?
+.
For each item that meets the constraints specified by
\fIsearchSpec\fR and the \fIarg\fRs, add
\fItag\fR to the list of tags associated with the item if it
@@ -357,21 +364,25 @@ forms:
.RS
.TP
\fBabove \fItagOrId\fR
+.
Selects the item just after (above) the one given by \fItagOrId\fR
in the display list.
If \fItagOrId\fR denotes more than one item, then the last (topmost)
of these items in the display list is used.
.TP
\fBall\fR
+.
Selects all the items in the canvas.
.TP
\fBbelow \fItagOrId\fR
+.
Selects the item just before (below) the one given by \fItagOrId\fR
in the display list.
If \fItagOrId\fR denotes more than one item, then the first (lowest)
of these items in the display list is used.
.TP
\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?
+.
Selects the item closest to the point given by \fIx\fR and \fIy\fR.
If more than one item is at the same closest distance (e.g. two
items overlap the point), then the top-most of these items (the
@@ -387,16 +398,18 @@ If \fIstart\fR is specified, it names an item using a tag or id
the given tag).
Instead of selecting the topmost closest item, this form will
select the topmost closest item that is below \fIstart\fR in
-the display list; if no such item exists, then the selection
+the display list; if no such item exists, then the selection
behaves as if the \fIstart\fR argument had not been specified.
.TP
\fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
+.
Selects all the items completely enclosed within the rectangular
region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be
no greater than \fIy2\fR.
.TP
\fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
+.
Selects all the items that overlap or are enclosed within the
rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR,
and \fIy2\fR.
@@ -404,10 +417,12 @@ and \fIy2\fR.
no greater than \fIy2\fR.
.TP
\fBwithtag \fItagOrId\fR
+.
Selects all the items given by \fItagOrId\fR.
.RE
.TP
\fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR?
+.
Returns a list with four elements giving an approximate bounding box
for all the items named by the \fItagOrId\fR arguments.
The list has the form
@@ -424,6 +439,7 @@ to display)
then an empty string is returned.
.TP
\fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR?
+.
This command associates \fIcommand\fR with all the items given by
\fItagOrId\fR such that whenever the event sequence given by
\fIsequence\fR occurs for one of the items the command will
@@ -451,13 +467,13 @@ The only events for which bindings may be specified are those related to
the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events.
The handling of events in canvases uses the current item defined in
-\fBITEM IDS AND TAGS\fR above. \fBEnter\fR and \fBLeave\fR events
+\fBITEM IDS AND TAGS\fR above. \fBEnter\fR and \fBLeave\fR events
trigger for an
item when it becomes the current item or ceases to be the current item;
note that these events are different than \fBEnter\fR and \fBLeave\fR
-events for windows. Mouse-related events are directed to the current
-item, if any. Keyboard-related events are directed to the focus item, if
-any (see the \fBfocus\fR widget command below for more on this). If a
+events for windows. Mouse-related events are directed to the current
+item, if any. Keyboard-related events are directed to the focus item, if
+any (see the \fBfocus\fR widget command below for more on this). If a
virtual event is used in a binding, that binding can trigger only if the
virtual event is defined by an underlying mouse-related or
keyboard-related event.
@@ -484,33 +500,37 @@ for the window as a whole.
.RE
.TP
\fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR?
+.
Given a window x-coordinate in the canvas \fIscreenx\fR, this command returns
the canvas x-coordinate that is displayed at that location.
If \fIgridspacing\fR is specified, then the canvas coordinate is
rounded to the nearest multiple of \fIgridspacing\fR units.
.TP
\fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR?
+.
Given a window y-coordinate in the canvas \fIscreeny\fR this command returns
the canvas y-coordinate that is displayed at that location.
If \fIgridspacing\fR is specified, then the canvas coordinate is
rounded to the nearest multiple of \fIgridspacing\fR units.
.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 \fBcanvas\fR
command.
.TP
\fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption 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
+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
+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
+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 \fBcanvas\fR
command.
@@ -518,6 +538,7 @@ command.
\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
@@ -530,9 +551,10 @@ the first one in the display list is used.
\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
+The exact format of the arguments after \fItype\fR depends
+on \fItype\fR, but usually they consist of the coordinates for
one or more points, followed by specifications for zero or
more item options.
See the subsections on individual item types below for more
@@ -540,21 +562,24 @@ on the syntax of this command.
This command returns the id for the new item.
.TP
\fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR?
+.
For each item given by \fItagOrId\fR, delete the characters, or coordinates,
in the range given by \fIfirst\fR and \fIlast\fR, inclusive.
If some of the items given by \fItagOrId\fR do not support
-indexing operations then they ignore dchars.
+indexing operations then they ignore this operation.
Text items interpret \fIfirst\fR and \fIlast\fR as indices to a character,
-line and polygon items interpret them indices to a coordinate (an x,y pair).
+line and polygon items interpret them as indices to a coordinate (an x,y pair).
Indices are described in \fBINDICES\fR above.
If \fIlast\fR is omitted, it defaults to \fIfirst\fR.
This command returns an empty string.
.TP
\fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR?
+.
Delete each of the items given by each \fItagOrId\fR, and return
an empty string.
.TP
\fIpathName \fBdtag \fItagOrId \fR?\fItagToDelete\fR?
+.
For each of the items given by \fItagOrId\fR, delete the
tag given by \fItagToDelete\fR from the list of those
associated with the item.
@@ -564,6 +589,7 @@ If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR.
This command returns an empty string.
.TP
\fIpathName \fBfind \fIsearchCommand \fR?\fIarg arg ...\fR?
+.
This command returns a list consisting of all the items that
meet the constraints specified by \fIsearchCommand\fR and
\fIarg\fR's.
@@ -572,6 +598,7 @@ accepted by the \fBaddtag\fR command.
The items are returned in stacking order, with the lowest item first.
.TP
\fIpathName \fBfocus \fR?\fItagOrId\fR?
+.
Set the keyboard focus for the canvas widget to the item given by
\fItagOrId\fR.
If \fItagOrId\fR refers to several items, then the focus is set
@@ -600,6 +627,7 @@ the canvas (if it was not there already).
.RE
.TP
\fIpathName \fBgettags\fR \fItagOrId\fR
+.
Return a list whose elements are the tags associated with the
item given by \fItagOrId\fR.
If \fItagOrId\fR refers to more than one item, then the tags
@@ -608,24 +636,35 @@ If \fItagOrId\fR does not refer to any items, or if the item
contains no tags, then an empty string is returned.
.TP
\fIpathName \fBicursor \fItagOrId index\fR
+.
Set the position of the insertion cursor for the item(s) given by \fItagOrId\fR
to just before the character whose position is given by \fIindex\fR.
If some or all of the items given by \fItagOrId\fR do not support
an insertion cursor then this command has no effect on them.
See \fBINDICES\fR above for a description of the
legal forms for \fIindex\fR.
-Note: the insertion cursor is only displayed in an item if
-that item currently has the keyboard focus (see the widget
-command \fBfocus\fR, below), but the cursor position may
+Note: the insertion cursor is only displayed in an item if
+that item currently has the keyboard focus (see the \fBfocus\fR widget
+command, above), but the cursor position may
be set even when the item does not have the focus.
This command returns an empty string.
.TP
+\fIpathName \fBimove \fItagOrId index x y\fR
+.VS 8.6
+This command causes the \fIindex\fR'th coordinate of each of the items
+indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR).
+Each item interprets \fIindex\fR independently according to the rules
+described in \fBINDICES\fR above. Out of the standard set of items, only line
+and polygon items may have their coordinates relocated this way.
+.VE 8.6
+.TP
\fIpathName \fBindex \fItagOrId index\fR
+.
This command returns a decimal string giving the numerical index
within \fItagOrId\fR corresponding to \fIindex\fR.
\fIIndex\fR gives a textual description of the desired position
as described in \fBINDICES\fR above.
-Text items interpret \fIindex\fR as an index to a character,
+Text items interpret \fIindex\fR as an index to a character,
line and polygon items interpret it as an index to a coordinate (an x,y pair).
The return value is guaranteed to lie between 0 and the number
of characters, or coordinates, within the item, inclusive.
@@ -634,10 +673,11 @@ is processed in the first of these items that supports indexing
operations (in display list order).
.TP
\fIpathName \fBinsert \fItagOrId beforeThis string\fR
+.
For each of the items given by \fItagOrId\fR, if the item supports
text or coordinate, insertion then \fIstring\fR is inserted into the item's
text just before the character, or coordinate, whose index is \fIbeforeThis\fR.
-Text items interpret \fIbeforeThis\fR as an index to a character,
+Text items interpret \fIbeforeThis\fR as an index to a character,
line and polygon items interpret it as an index to a coordinate (an x,y pair).
For lines and polygons the \fIstring\fR must be a valid coordinate
sequence.
@@ -646,6 +686,7 @@ for \fIbeforeThis\fR.
This command returns an empty string.
.TP
\fIpathName \fBitemcget\fR \fItagOrId\fR \fIoption\fR
+.
Returns the current value of the configuration option for the
item given by \fItagOrId\fR whose name is \fIoption\fR.
This command is similar to the \fBcget\fR widget command except that
@@ -656,6 +697,7 @@ If \fItagOrId\fR is a tag that refers to more than one item,
the first (lowest) such item is used.
.TP
\fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
+.
This command is similar to the \fBconfigure\fR widget command except
that it modifies item-specific options for the items given by
\fItagOrId\fR instead of modifying options for the overall
@@ -663,13 +705,13 @@ canvas widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for the first item given by \fItagOrId\fR
(see \fBTk_ConfigureInfo\fR for
-information on the format of this list). If \fIoption\fR is specified
+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
+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
-each of the items given by \fItagOrId\fR; in
+each of the items given by \fItagOrId\fR; in
this case the command returns an empty string.
The \fIoption\fRs and \fIvalue\fRs are the same as those permissible
in the \fBcreate\fR widget command when the item(s) were created;
@@ -677,30 +719,45 @@ see the sections describing individual item types below for details
on the legal options.
.TP
\fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR?
+.
Move all of the items given by \fItagOrId\fR to a new position
in the display list just before the item given by \fIbelowThis\fR.
If \fItagOrId\fR refers to more than one item then all are moved
but the relative order of the moved items will not be changed.
-\fIBelowThis\fR is a tag or id; if it refers to more than one
+\fIBelowThis\fR is a tag or id; if it refers to more than one
item then the first (lowest) of these items in the display list is used
as the destination location for the moved items.
-Note: this command has no effect on window items. Window items always
+Note: this command has no effect on window items. Window items always
obscure other item types, and the stacking order of window items is
-determined by the \fBraise\fR and \fBlower\fR commands, not the
-\fBraise\fR and \fBlower\fR widget commands for canvases.
+determined by the \fBraise\fR command and \fBlower\fR command, not the
+\fBraise\fR widget command and \fBlower\fR widget command for canvases.
This command returns an empty string.
.TP
\fIpathName \fBmove \fItagOrId xAmount yAmount\fR
+.
Move each of the items given by \fItagOrId\fR in the canvas coordinate
space by adding \fIxAmount\fR to the x-coordinate of each point
associated with the item and \fIyAmount\fR to the y-coordinate of
each point associated with the item.
This command returns an empty string.
.TP
+\fIpathName \fBmoveto \fItagOrId xPos yPos\fR
+.VS 8.6
+Move the items given by \fItagOrId\fR in the canvas coordinate
+space so that the first coordinate pair of the bottommost item with
+tag \fItagOrId\fR is located at
+position (\fIxPos\fR,\fIyPos\fR). \fIxPos\fR and \fIyPos\fR may be
+the empty string, in which case the corresponding coordinate
+will be unchanged. All items matching
+\fItagOrId\fR remain in the same positions relative to each other.
+This command returns an empty string.
+.VE 8.6
+.TP
\fIpathName \fBpostscript \fR?\fIoption value option value ...\fR?
+.
Generate a Postscript representation for part or all of the canvas.
If the \fB\-file\fR option is specified then the Postscript is written
-to a file and an empty string is returned; otherwise the Postscript
+to a file and an empty string is returned; otherwise the Postscript
is returned as the result of the command.
If the interpreter that owns the canvas is marked as safe, the operation
will fail because safe interpreters are not allowed to write files.
@@ -711,18 +768,26 @@ of the operation.
The Postscript is created in Encapsulated Postscript form using
version 3.0 of the Document Structuring Conventions.
Note: by default Postscript is only generated for information that
-appears in the canvas's window on the screen. If the canvas is
+appears in the canvas's window on the screen. If the canvas is
freshly created it may still have its initial size of 1x1 pixel
-so nothing will appear in the Postscript. To get around this problem
+so nothing will appear in the Postscript. To get around this problem
either invoke the \fBupdate\fR command to wait for the canvas window
to reach its final size, or else use the \fB\-width\fR and \fB\-height\fR
options to specify the area of the canvas to print.
The \fIoption\fR\-\fIvalue\fR argument pairs provide additional
-information to control the generation of Postscript. The following
+information to control the generation of Postscript. The following
options are supported:
.RS
.TP
+\fB\-channel \fIchannelName\fR
+.
+Specifies the name of the channel to which to write the Postscript.
+If this option and the \fB\-file\fR option are
+not specified then the Postscript is returned as the
+result of the command.
+.TP
\fB\-colormap \fIvarName\fR
+.
\fIVarName\fR must be the name of an array variable
that specifies a color mapping to use in the Postscript.
Each element of \fIvarName\fR must consist of Postscript
@@ -738,17 +803,21 @@ in \fIvarName\fR for a given color, then Tk uses the red, green,
and blue intensities from the X color.
.TP
\fB\-colormode \fImode\fR
-Specifies how to output color information. \fIMode\fR must be either
+.
+Specifies how to output color information. \fIMode\fR must be either
\fBcolor\fR (for full color output), \fBgray\fR (convert all colors
to their gray-scale equivalents) or \fBmono\fR (convert all colors
to black or white).
.TP
\fB\-file \fIfileName\fR
+.
Specifies the name of the file in which to write the Postscript.
-If this option is not specified then the Postscript is returned as the
-result of the command instead of being written to a file.
+If this option and the \fB\-channel\fR option are
+not specified then the Postscript is returned as the
+result of the command.
.TP
\fB\-fontmap \fIvarName\fR
+.
\fIVarName\fR must be the name of an array variable
that specifies a font mapping to use in the Postscript.
Each element of \fIvarName\fR must consist of a Tcl list with
@@ -763,14 +832,16 @@ Tk's guesses generally only work for well-known fonts such as
Times and Helvetica and Courier, and only if the X font name does not
omit any dashes up through the point size.
For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but
-\fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to
+\fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to
parse the font name).
.TP
\fB\-height \fIsize\fR
+.
Specifies the height of the area of the canvas to print.
Defaults to the height of the canvas window.
.TP
\fB\-pageanchor \fIanchor\fR
+.
Specifies which point of the printed area of the canvas should appear over
the positioning point on the page (which is given by the \fB\-pagex\fR
and \fB\-pagey\fR options).
@@ -779,6 +850,7 @@ area of the canvas being printed (as it appears in the canvas window)
should be over the positioning point. Defaults to \fBcenter\fR.
.TP
\fB\-pageheight \fIsize\fR
+.
Specifies that the Postscript should be scaled in both x and y so
that the printed area is \fIsize\fR high on the Postscript page.
\fISize\fR consists of a floating-point number followed by
@@ -790,15 +862,17 @@ the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
is not implemented).
.TP
\fB\-pagewidth \fIsize\fR
+.
Specifies that the Postscript should be scaled in both x and y so
that the printed area is \fIsize\fR wide on the Postscript page.
\fISize\fR has the same form as for \fB\-pageheight\fR.
Defaults to the width of the printed area on the screen.
If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
-the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
+the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling
is not implemented).
.TP
\fB\-pagex \fIposition\fR
+.
\fIPosition\fR gives the x-coordinate of the positioning point on
the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options
@@ -806,6 +880,7 @@ to determine where the printed area appears on the Postscript page.
Defaults to the center of the page.
.TP
\fB\-pagey \fIposition\fR
+.
\fIPosition\fR gives the y-coordinate of the positioning point on
the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options
@@ -813,26 +888,30 @@ to determine where the printed area appears on the Postscript page.
Defaults to the center of the page.
.TP
\fB\-rotate \fIboolean\fR
+.
\fIBoolean\fR specifies whether the printed area is to be rotated 90
degrees.
In non-rotated output the x-axis of the printed area runs along
the short dimension of the page
-.PQ portrait orientation ;
+.PQ portrait " orientation" ;
in rotated output the x-axis runs along the long dimension of the page
-.PQ landscape orientation .
+.PQ landscape " orientation" .
Defaults to non-rotated.
.TP
\fB\-width \fIsize\fR
+.
Specifies the width of the area of the canvas to print.
Defaults to the width of the canvas window.
.TP
\fB\-x \fIposition\fR
+.
Specifies the x-coordinate of the left edge of the area of the
canvas that is to be printed, in canvas coordinates, not window
coordinates.
Defaults to the coordinate of the left edge of the window.
.TP
\fB\-y \fIposition\fR
+.
Specifies the y-coordinate of the top edge of the area of the
canvas that is to be printed, in canvas coordinates, not window
coordinates.
@@ -840,22 +919,39 @@ Defaults to the coordinate of the top edge of the window.
.RE
.TP
\fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR?
+.
Move all of the items given by \fItagOrId\fR to a new position
in the display list just after the item given by \fIaboveThis\fR.
If \fItagOrId\fR refers to more than one item then all are moved
but the relative order of the moved items will not be changed.
-\fIAboveThis\fR is a tag or id; if it refers to more than one
+\fIAboveThis\fR is a tag or id; if it refers to more than one
item then the last (topmost) of these items in the display list is used
as the destination location for the moved items.
-Note: this command has no effect on window items. Window items always
-obscure other item types, and the stacking order of window items is
-determined by the \fBraise\fR and \fBlower\fR commands, not the
-\fBraise\fR and \fBlower\fR widget commands for canvases.
This command returns an empty string.
+.RS
+.PP
+Note: this command has no effect on window items. Window items always
+obscure other item types, and the stacking order of window items is
+determined by the \fBraise\fR command and \fBlower\fR command, not the
+\fBraise\fR widget command and \fBlower\fR widget command for canvases.
+.RE
+.TP
+\fIpathName \fBrchars \fItagOrId first last string\fR
+.VS 8.6
+This command causes the text or coordinates between \fIfirst\fR and \fIlast\fR
+for each of the items indicated by \fItagOrId\fR to be replaced by
+\fIstring\fR. Each item interprets \fIfirst\fR and \fIlast\fR independently
+according to the rules described in \fBINDICES\fR above. Out of the standard
+set of items, text items support this operation by altering their text as
+directed, and line and polygon items support this operation by altering their
+coordinate list (in which case \fIstring\fR should be a list of coordinates to
+use as a replacement). The other items ignore this operation.
+.VE 8.6
.TP
\fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR
-Rescale all of the items given by \fItagOrId\fR in canvas coordinate
-space.
+.
+Rescale the coordinates of all of the items given by \fItagOrId\fR in canvas
+coordinate space.
\fIXOrigin\fR and \fIyOrigin\fR identify the origin for the scaling
operation and \fIxScale\fR and \fIyScale\fR identify the scale
factors for x- and y-coordinates, respectively (a scale factor of
@@ -866,20 +962,29 @@ of \fIxScale\fR.
Similarly, each y-coordinate is adjusted to change the distance
from \fIyOrigin\fR by a factor of \fIyScale\fR.
This command returns an empty string.
+.RS
+.PP
+Note that some items have only a single pair of coordinates (e.g., text,
+images and windows) and so scaling of them by this command can only move them
+around.
+.RE
.TP
\fIpathName \fBscan\fR \fIoption args\fR
-This command is used to implement scanning on canvases. It has
+.
+This command is used to implement scanning on canvases. It has
two forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the canvas's current view; used
+.
+Records \fIx\fR and \fIy\fR and the canvas's current view; used
in conjunction with later \fBscan dragto\fR commands.
Typically this command is associated with a mouse button press in
the widget and \fIx\fR and \fIy\fR are the coordinates of the
-mouse. It returns an empty string.
+mouse. It returns an empty string.
.TP
-\fIpathName \fBscan dragto \fIx y ?gain?\fR.
+\fIpathName \fBscan dragto \fIx y ?gain?\fR
+.
This command computes the difference between its \fIx\fR and \fIy\fR
arguments (which are typically mouse coordinates) and the \fIx\fR and
\fIy\fR arguments to the last \fBscan mark\fR command for the widget.
@@ -887,16 +992,17 @@ It then adjusts the view by \fIgain\fR times the
difference in coordinates, where \fIgain\fR defaults to 10.
This command is typically associated
with mouse motion events in the widget, to produce the effect of
-dragging the canvas at high speed through its window. The return
+dragging the canvas at high speed through its window. The return
value is an empty string.
.RE
.TP
\fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR?
+.
Manipulates the selection in one of several ways, depending on
\fIoption\fR.
The command may take any of the forms described below.
In all of the descriptions below, \fItagOrId\fR must refer to
-an item that supports indexing and selection; if it refers to
+an item that supports indexing and selection; if it refers to
multiple items then the first of
these that supports indexing and the selection is used.
\fIIndex\fR gives a textual description of a position
@@ -904,6 +1010,7 @@ within \fItagOrId\fR, as described in \fBINDICES\fR above.
.RS
.TP
\fIpathName \fBselect adjust \fItagOrId index\fR
+.
Locate the end of the selection in \fItagOrId\fR nearest
to the character given by \fIindex\fR, and adjust that
end of the selection to be at \fIindex\fR (i.e. including
@@ -916,27 +1023,31 @@ command.
Returns an empty string.
.TP
\fIpathName \fBselect clear\fR
+.
Clear the selection if it is in this widget.
If the selection is not in this widget then the command
has no effect.
Returns an empty string.
.TP
\fIpathName \fBselect from \fItagOrId index\fR
+.
Set the selection anchor point for the widget to be just
before the character
given by \fIindex\fR in the item given by \fItagOrId\fR.
-This command does not change the selection; it just sets
+This command does not change the selection; it just sets
the fixed end of the selection for future \fBselect to\fR
commands.
Returns an empty string.
.TP
\fIpathName \fBselect item\fR
+.
Returns the id of the selected item, if the selection is in an
item in this canvas.
If the selection is not in this canvas then an empty string
is returned.
.TP
\fIpathName \fBselect to \fItagOrId index\fR
+.
Set the selection to consist of those characters of \fItagOrId\fR
between the selection anchor point and
\fIindex\fR.
@@ -952,6 +1063,7 @@ Returns an empty string.
.RE
.TP
\fIpathName \fBtype\fI tagOrId\fR
+.
Returns the type of the item given by \fItagOrId\fR, such as
\fBrectangle\fR or \fBtext\fR.
If \fItagOrId\fR refers to more than one item, then the type
@@ -959,15 +1071,17 @@ of the first item in the display list is returned.
If \fItagOrId\fR does not refer to any items at all then
an empty string is returned.
.TP
-\fIpathName \fBxview \fR?\fIargs\fR?
+\fIpathName \fBxview \fR?\fIargs\fR?
+.
This command is used to query and change the horizontal position of the
information displayed in the canvas'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
+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 canvas's area (as defined by the \fB\-scrollregion\fR option)
@@ -977,11 +1091,13 @@ These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
+.
Adjusts the view in the window so that \fIfraction\fR of the
total width of the canvas is off-screen to the left.
\fIFraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
+.
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
@@ -993,19 +1109,21 @@ or in units of one-tenth the window's width otherwise.
If \fIwhat is \fBpages\fR then the view
adjusts in units of nine-tenths the window's width.
If \fInumber\fR is negative then information farther to the left
-becomes visible; if it is positive then information farther to the right
+becomes visible; if it is positive then information farther to the right
becomes visible.
.RE
.TP
\fIpathName \fByview \fI?args\fR?
+.
This command is used to query and change the vertical position of the
information displayed in the canvas's window.
It can take any of the following forms:
.RS
.TP
\fIpathName \fByview\fR
+.
Returns a list containing two elements.
-Each element is a real fraction between 0 and 1; together they describe
+Each element is a real fraction between 0 and 1; together they describe
the vertical span that is visible in the window.
For example, if the first element is .6 and the second element is 1.0,
the lowest 40% of the canvas's area (as defined by the \fB\-scrollregion\fR
@@ -1014,11 +1132,13 @@ These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
option.
.TP
\fIpathName \fByview moveto\fI fraction\fR
+.
Adjusts the view in the window so that \fIfraction\fR of the canvas's
area is off-screen to the top.
\fIFraction\fR is a fraction between 0 and 1.
.TP
\fIpathName \fByview scroll \fInumber what\fR
+.
This command adjusts the view in the window up or down according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
@@ -1029,15 +1149,15 @@ or in units of one-tenth the window's height otherwise.
If \fIwhat\fR is \fBpages\fR then
the view adjusts in units of nine-tenths the window's height.
If \fInumber\fR is negative then higher information becomes
-visible; if it is positive then lower information
+visible; if it is positive then lower information
becomes visible.
.RE
.SH "OVERVIEW OF ITEM TYPES"
.PP
The sections below describe the various types of items supported
-by canvas widgets. Each item type is characterized by two things:
+by canvas widgets. Each item type is characterized by two things:
first, the form of the \fBcreate\fR command used to create
-instances of the type; and second, a set of configuration options
+instances of the type; and second, a set of configuration options
for items of that type, which may be used in the
\fBcreate\fR and \fBitemconfigure\fR widget commands.
Most items do not support indexing or selection or the commands
@@ -1049,15 +1169,25 @@ For lines and polygons the indexing facility is used to manipulate
the coordinates of the item.
.SS "COMMON ITEM OPTIONS"
.PP
-Many items share a common set of options. These options are
+Many items share a common set of options. These options are
explained here, and then referred to be each widget type for brevity.
-.PP
+.TP
+\fB\-anchor \fIanchorPos\fR
+.
+\fIAnchorPos\fR tells how to position the item relative to the
+positioning point for the item; it may have any of the forms
+accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
+is \fBcenter\fR then the item is centered on the point; if
+\fIanchorPos\fR is \fBn\fR then the item will be drawn so that
+its top center point is at the positioning point.
+This option defaults to \fBcenter\fR.
.TP
\fB\-dash \fIpattern\fR
.TP
\fB\-activedash \fIpattern\fR
.TP
\fB\-disableddash \fIpattern\fR
+.
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.
@@ -1065,9 +1195,10 @@ If the dash options are omitted then the default is a solid outline.
See \fBDASH PATTERNS\fR for more information.
.TP
\fB\-dashoffset \fIoffset\fR
+.
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
+\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 \fBCOORDINATES\fR section above.
.TP
\fB\-fill \fIcolor\fR
@@ -1075,6 +1206,7 @@ in the \fBCOORDINATES\fR section above.
\fB\-activefill \fIcolor\fR
.TP
\fB\-disabledfill \fIcolor\fR
+.
Specifies the color to be used to fill item's area.
in its normal, active, and disabled states,
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
@@ -1088,29 +1220,33 @@ For the text item, it specifies the foreground color of the text.
\fB\-activeoutline \fIcolor\fR
.TP
\fB\-disabledoutline \fIcolor\fR
+.
This option specifies the color that should be used to draw the
outline of the item in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
-This option defaults to \fBblack\fR. If \fIcolor\fR is specified
+This option defaults to \fBblack\fR. If \fIcolor\fR is specified
as an empty string then no outline is drawn for the item.
.TP
\fB\-offset \fIoffset\fR
-Specifies the offset of stipples. The offset value can be of the form
-\fBx,y\fR or \fBside\fR, where side can be \fBn\fR, \fBne\fR, \fBe\fR,
+.
+Specifies the offset of stipples. The offset value can be of the form
+\fBx,y\fR or \fIside\fR, where side can be \fBn\fR, \fBne\fR, \fBe\fR,
\fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. In the
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 instead. For canvas objects, the \fB\-offset\fR option is
-used for stippling as well. For the line and polygon canvas items you can
+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.
+of the coordinate points of the line/polygon. Note that stipple offsets are
+\fIonly supported on X11\fR; they are silently ignored on other platforms.
.TP
\fB\-outlinestipple \fIbitmap\fR
.TP
\fB\-activeoutlinestipple \fIbitmap\fR
.TP
\fB\-disabledoutlinestipple \fIbitmap\fR
+.
This option specifies stipple patterns that should be used to draw the
outline of the item in its normal, active and disabled states.
Indicates that the outline for the item should be drawn with a stipple pattern;
@@ -1125,20 +1261,16 @@ use X11 as their drawing API.\fR
.TP
\fB\-outlineoffset \fIoffset\fR
.
-Specifies the offset of the stipple pattern used for outlines. The
-offset value can be of the form
-.QW \fIx\fB,\fIy\fR
-or the description of a side (one of \fBn\fR, \fBne\fR, \fBe\fR,
-\fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR). This
-option only has an effect when the outline is drawn as a stipple
-pattern, and is only supported under X11.
-.\" TODO: What does this actually do? What do the acceptable forms mean?!
+Specifies the offset of the stipple pattern used for outlines, in the same way
+that the \fB\-outline\fR option controls fill stipples. (See the
+\fB\-outline\fR option for a description of the syntax of \fIoffset\fR.)
.TP
\fB\-stipple \fIbitmap\fR
.TP
\fB\-activestipple \fIbitmap\fR
.TP
\fB\-disabledstipple \fIbitmap\fR
+.
This option specifies stipple patterns that should be used to fill
the item in its normal, active and disabled states.
\fIbitmap\fR specifies the stipple pattern to use, in any of the
@@ -1152,29 +1284,33 @@ For the text item, it affects the actual text.
use X11 as their drawing API.\fR
.TP
\fB\-state \fIstate\fR
+.
This allows an item to override the canvas widget's global \fIstate\fR
-option. It takes the same values:
+option. It takes the same values:
\fInormal\fR, \fIdisabled\fR or \fIhidden\fR.
.TP
\fB\-tags \fItagList\fR
+.
Specifies a set of tags to apply to the item.
\fITagList\fR consists of a list of tag names, which replace any
-existing tags for the item. \fITagList\fR may be an empty list.
+existing tags for the item. \fITagList\fR may be an empty list.
.TP
\fB\-width \fIoutlineWidth\fR
.TP
\fB\-activewidth \fIoutlineWidth\fR
.TP
\fB\-disabledwidth \fIoutlineWidth\fR
+.
Specifies the width of the outline to be drawn around
the item's region, in its normal, active and disabled states.
\fIoutlineWidth\fR may be in any of the forms described in the
\fBCOORDINATES\fR section above.
If the \fB\-outline\fR option has been specified as an empty string then
-this option has no effect. This option defaults to 1.0.
+this option has no effect. This option defaults to 1.0.
For arcs, wide outlines will be drawn centered on the edges of the
arc's region.
-.SH "ARC ITEMS"
+.SH "STANDARD ITEM TYPES"
+.SS "ARC ITEMS"
.PP
Items of type \fBarc\fR appear on the display as arc-shaped regions.
An arc is a section of an oval delimited by two angles (specified
@@ -1182,46 +1318,36 @@ by the \fB\-start\fR and \fB\-extent\fR options) and displayed in
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?
+\fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate arc \fIcoordList\fR ?\fIoption value ...\fR?
.CE
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
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. An arc item becomes the current item when the mouse pointer is
over any part that is painted or (when fully transparent) that would be
painted if both the \fB\-fill\fR and \fB\-outline\fR options were non-empty.
.PP
The following standard options are supported by arcs:
-.CS
-\-dash
-\-activedash
-\-disableddash
-\-dashoffset
-\-fill
-\-activefill
-\-disabledfill
-\-offset
-\-outline
-\-activeoutline
-\-disabledoutline
-\-outlineoffset
-\-outlinestipple
-\-activeoutlinestipple
-\-disabledoutlinestipple
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-\-width
-\-activewidth
-\-disabledwidth
-.CE
+.DS
+.ta 3i
+\fB\-dash\fR \fB\-activedash\fR
+\fB\-disableddash\fR \fB\-dashoffset\fR
+\fB\-fill\fR \fB\-activefill\fR
+\fB\-disabledfill\fR \fB\-offset\fR
+\fB\-outline\fR \fB\-activeoutline\fR
+\fB\-disabledoutline\fR \fB\-outlineoffset\fR
+\fB\-outlinestipple\fR \fB\-activeoutlinestipple\fR
+\fB\-disabledoutlinestipple\fR \fB\-stipple\fR
+\fB\-activestipple\fR \fB\-disabledstipple\fR
+\fB\-state\fR \fB\-tags\fR
+\fB\-width\fR \fB\-activewidth\fR
+\fB\-disabledwidth\fR
+.DE
The following extra options are supported for arcs:
.TP
\fB\-extent \fIdegrees\fR
@@ -1236,10 +1362,10 @@ modulo 360 is used as the extent.
Specifies the beginning of the angular range occupied by the
arc.
\fIDegrees\fR is given in units of degrees measured counter-clockwise
-from the 3-o'clock position; it may be either positive or negative.
+from the 3-o'clock position; it may be either positive or negative.
.TP
\fB\-style \fItype\fR
-Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR
+Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR
(the default) then the arc's region is defined by a section
of the oval's perimeter plus two line segments, one between the center
of the oval and each end of the perimeter section.
@@ -1249,42 +1375,34 @@ connecting the two end points of the perimeter section.
If \fItype\fR is \fBarc\fR then the arc's region consists of
a section of the perimeter alone.
In this last case the \fB\-fill\fR option is ignored.
-.SH "BITMAP ITEMS"
+.SS "BITMAP ITEMS"
.PP
Items of type \fBbitmap\fR appear on the display as images with
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?
+\fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate bitmap \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two
elements) 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).
+point used to position the bitmap on the display, as controlled by the
+\fB\-anchor\fR option.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. A bitmap item becomes the current item when the mouse pointer
is over any part of its bounding box.
.PP
The following standard options are supported by bitmaps:
-.CS
-\-state
-\-tags
-.CE
+.DS
+.ta 3i
+\fB\-anchor\fR \fB\-state\fR
+\fB\-tags\fR
+.DE
The following extra options are supported for bitmaps:
.TP
-\fB\-anchor \fIanchorPos\fR
-\fIAnchorPos\fR tells how to position the bitmap relative to the
-positioning point for the item; it may have any of the forms
-accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
-is \fBcenter\fR then the bitmap is centered on the point; if
-\fIanchorPos\fR is \fBn\fR then the bitmap will be drawn so that
-its top center point is at the positioning point.
-This option defaults to \fBcenter\fR.
-.TP
\fB\-background \fIcolor\fR
.TP
\fB\-activebackground \fIbitmap\fR
@@ -1295,7 +1413,7 @@ Specifies the color to use for each of the bitmap's
valued pixels in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
If this option is not specified, or if it is specified as an empty
-string, then nothing is displayed where the bitmap pixels are 0; this
+string, then nothing is displayed where the bitmap pixels are 0; this
produces a transparent effect.
.TP
\fB\-bitmap \fIbitmap\fR
@@ -1317,41 +1435,33 @@ Specifies the color to use for each of the bitmap's
valued pixels in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR and
defaults to \fBblack\fR.
-.SH "IMAGE ITEMS"
+.SS "IMAGE ITEMS"
.PP
Items of type \fBimage\fR are used to display images on a
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?
+\fIpathName \fBcreate image \fIx y \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate image \fIcoordList\fR ?\fIoption value ...\fR?
.CE
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).
+point used to position the image on the display, as controlled by the
+\fB\-anchor\fR option.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. An image item becomes the current item when the mouse pointer
is over any part of its bounding box.
.PP
The following standard options are supported by images:
-.CS
-\-state
-\-tags
-.CE
+.DS
+.ta 3i
+\fB\-anchor\fR \fB\-state\fR
+\fB\-tags\fR
+.DE
The following extra options are supported for images:
.TP
-\fB\-anchor \fIanchorPos\fR
-\fIAnchorPos\fR tells how to position the image relative to the
-positioning point for the item; it may have any of the forms
-accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
-is \fBcenter\fR then the image is centered on the point; if
-\fIanchorPos\fR is \fBn\fR then the image will be drawn so that
-its top center point is at the positioning point.
-This option defaults to \fBcenter\fR.
-.TP
\fB\-image \fIname\fR
.TP
\fB\-activeimage \fIname\fR
@@ -1361,46 +1471,40 @@ Specifies the name of the images to display in the item in is normal,
active and disabled states.
This image must have been created previously with the
\fBimage create\fR command.
-.SH "LINE ITEMS"
+.SS "LINE ITEMS"
.PP
Items of type \fBline\fR appear on the display as one or more connected
line segments or curves.
-Line items support coordinate indexing operations using the canvas
-widget commands: \fBdchars, index, insert.\fR
+Line items support coordinate indexing operations using the \fBdchars\fR,
+\fBindex\fR and \fBinsert\fR widget commands.
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?
+\fIpathName \fBcreate line \fIx1 y1... xn yn \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate line \fIcoordList\fR ?\fIoption value ...\fR?
.CE
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
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. A line item is the current item whenever the mouse pointer is
over any segment of the line, whether drawn or not and whether or not the line
is smoothed.
.PP
The following standard options are supported by lines:
-.CS
-\-dash
-\-activedash
-\-disableddash
-\-dashoffset
-\-fill
-\-activefill
-\-disabledfill
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-\-width
-\-activewidth
-\-disabledwidth
-.CE
+.DS
+.ta 3i
+\fB\-dash\fR \fB\-activedash\fR
+\fB\-disableddash\fR \fB\-dashoffset\fR
+\fB\-fill\fR \fB\-activefill\fR
+\fB\-disabledfill\fR \fB\-stipple\fR
+\fB\-activestipple\fR \fB\-disabledstipple\fR
+\fB\-state\fR \fB\-tags\fR
+\fB\-width\fR \fB\-activewidth\fR
+\fB\-disabledwidth\fR
+.DE
The following extra options are supported for lines:
.TP
\fB\-arrow \fIwhere\fR
@@ -1438,7 +1542,7 @@ Where arrowheads are drawn the cap style is ignored.
\fB\-joinstyle \fIstyle\fR
Specifies the ways in which joints are to be drawn at the vertices
of the line.
-\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
+\fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR
(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
If this option is not specified then it defaults to \fBround\fR.
If the line only contains two points then this option is
@@ -1447,40 +1551,38 @@ irrelevant.
\fB\-smooth \fIsmoothMethod\fR
\fIsmoothMethod\fR must have one of the forms accepted by
\fBTcl_GetBoolean\fR or a line smoothing method.
-.VS 8.5
Only \fBtrue\fR and \fBraw\fR are
-supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean
-false value or empty string is given, no smoothing is applied. A boolean
+supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), 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 assumes \fBtrue\fR smoothing.
If the smoothing method is \fBtrue\fR, this indicates that the line
should be drawn as a curve, rendered as a set of quadratic splines: one spline
is drawn for the first and second line segments, one for the second
-and third, and so on. Straight-line segments can be generated within
+and third, and so on. Straight-line segments can be generated within
a curve by duplicating the end-points of the desired line segment.
If the smoothing method is \fBraw\fR, this indicates that the line
should also be drawn as a curve but where the list of coordinates is
such that the first coordinate pair (and every third coordinate pair
thereafter) is a knot point on a cubic Bezier curve, and the other
-coordinates are control points on the cubic Bezier curve. Straight
+coordinates are control points on the cubic Bezier curve. Straight
line segments can be generated within a curve by making control points
-equal to their neighbouring knot points. If the last point is a
+equal to their neighbouring knot points. If the last point is a
control point and not a knot point, the point is repeated (one or two
times) so that it also becomes a knot point.
-.VE 8.5
.TP
\fB\-splinesteps \fInumber\fR
-Specifies the degree of smoothness desired for curves: each spline
-will be approximated with \fInumber\fR line segments. This
+Specifies the degree of smoothness desired for curves: each spline
+will be approximated with \fInumber\fR line segments. This
option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR.
-.SH "OVAL ITEMS"
+.SS "OVAL ITEMS"
.PP
Items of type \fBoval\fR appear as circular or oval regions on
-the display. Each oval may have an outline, a fill, or
-both. Ovals are created with widget commands of the
+the display. Each oval may have an outline, a fill, or
+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?
+\fIpathName \fBcreate oval \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate oval \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give
the coordinates of two diagonally opposite corners of a
@@ -1491,48 +1593,39 @@ If the region is square then the resulting oval is circular;
otherwise it is elongated in shape.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. An oval item becomes the current item when the mouse pointer is
over any part that is painted or (when fully transparent) that would be
painted if both the \fB\-fill\fR and \fB\-outline\fR options were non-empty.
.PP
The following standard options are supported by ovals:
-.CS
-\-dash
-\-activedash
-\-disableddash
-\-dashoffset
-\-fill
-\-activefill
-\-disabledfill
-\-offset
-\-outline
-\-activeoutline
-\-disabledoutline
-\-outlineoffset
-\-outlinestipple
-\-activeoutlinestipple
-\-disabledoutlinestipple
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-\-width
-\-activewidth
-\-disabledwidth
-.CE
-.SH "POLYGON ITEMS"
+.DS
+.ta 3i
+\fB\-dash\fR \fB\-activedash\fR
+\fB\-disableddash\fR \fB\-dashoffset\fR
+\fB\-fill\fR \fB\-activefill\fR
+\fB\-disabledfill\fR \fB\-offset\fR
+\fB\-outline\fR \fB\-activeoutline\fR
+\fB\-disabledoutline\fR \fB\-outlineoffset\fR
+\fB\-outlinestipple\fR \fB\-activeoutlinestipple\fR
+\fB\-disabledoutlinestipple\fR \fB\-stipple\fR
+\fB\-activestipple\fR \fB\-disabledstipple\fR
+\fB\-state\fR \fB\-tags\fR
+\fB\-width\fR \fB\-activewidth\fR
+\fB\-disabledwidth\fR
+.DE
+There are no oval-specific options.
+.SS "POLYGON ITEMS"
.PP
Items of type \fBpolygon\fR appear as polygonal or curved filled regions
on the display.
-Polygon items support coordinate indexing operations using the canvas
-widget commands: \fBdchars, index, insert.\fR
+Polygon items support coordinate indexing operations using the \fBdchars\fR,
+\fBindex\fR and \fBinsert\fR widget commands.
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?
+\fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for
three or more points that define a polygon.
@@ -1541,73 +1634,62 @@ close the shape; Tk will automatically close the periphery between
the first and last points.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. A polygon item is the current item whenever the mouse pointer
is over any part of the polygon, whether drawn or not and whether or not the
outline is smoothed.
.PP
The following standard options are supported by polygons:
-.CS
-\-dash
-\-activedash
-\-disableddash
-\-dashoffset
-\-fill
-\-activefill
-\-disabledfill
-\-offset
-\-outline
-\-activeoutline
-\-disabledoutline
-\-outlinestipple
-\-activeoutlinestipple
-\-disabledoutlinestipple
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-\-width
-\-activewidth
-\-disabledwidth
-.CE
+.DS
+.ta 3i
+\fB\-dash\fR \fB\-activedash\fR
+\fB\-disableddash\fR \fB\-dashoffset\fR
+\fB\-fill\fR \fB\-activefill\fR
+\fB\-disabledfill\fR \fB\-offset\fR
+\fB\-outline\fR \fB\-activeoutline\fR
+\fB\-disabledoutline\fR \fB\-outlineoffset\fR
+\fB\-outlinestipple\fR \fB\-activeoutlinestipple\fR
+\fB\-disabledoutlinestipple\fR \fB\-stipple\fR
+\fB\-activestipple\fR \fB\-disabledstipple\fR
+\fB\-state\fR \fB\-tags\fR
+\fB\-width\fR \fB\-activewidth\fR
+\fB\-disabledwidth\fR
+.DE
The following extra options are supported for polygons:
.TP
\fB\-joinstyle \fIstyle\fR
Specifies the ways in which joints are to be drawn at the vertices
of the outline.
-\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
+\fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR
(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
If this option is not specified then it defaults to \fBround\fR.
.TP
\fB\-smooth \fIboolean\fR
\fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR
-.VS 8.5
or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are
-supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean
-false value or empty string is given, no smoothing is applied. A boolean
+supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), 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 assumes \fBtrue\fR smoothing.
If the smoothing method is \fBtrue\fR, this indicates that the polygon
should be drawn as a curve, rendered as a set of quadratic splines: one spline
is drawn for the first and second line segments, one for the second
-and third, and so on. Straight-line segments can be generated within
+and third, and so on. Straight-line segments can be generated within
a curve by duplicating the end-points of the desired line segment.
If the smoothing method is \fBraw\fR, this indicates that the polygon
should also be drawn as a curve but where the list of coordinates is
such that the first coordinate pair (and every third coordinate pair
thereafter) is a knot point on a cubic Bezier curve, and the other
-coordinates are control points on the cubic Bezier curve. Straight
+coordinates are control points on the cubic Bezier curve. Straight
line segments can be venerated within a curve by making control points
-equal to their neighbouring knot points. If the last point is not the
+equal to their neighbouring knot points. If the last point is not the
second point of a pair of control points, the point is repeated (one or two
times) so that it also becomes the second point of a pair of control
points (the associated knot point will be the first control point).
-.VE 8.5
.TP
\fB\-splinesteps \fInumber\fR
-Specifies the degree of smoothness desired for curves: each spline
-will be approximated with \fInumber\fR line segments. This
+Specifies the degree of smoothness desired for curves: each spline
+will be approximated with \fInumber\fR line segments. This
option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR.
.PP
Polygon items are different from other items such as rectangles, ovals
@@ -1617,18 +1699,18 @@ a polygon (e.g. for purposes of the \fBfind closest\fR and
\fBfind overlapping\fR widget commands) even if it is not filled.
For most other item types, an
interior point is considered to be inside the item only if the item
-is filled or if it has neither a fill nor an outline. If you would
+is filled or if it has neither a fill nor an outline. If you would
like an unfilled polygon whose interior points are not considered
to be inside the polygon, use a line item instead.
-.SH "RECTANGLE ITEMS"
+.SS "RECTANGLE ITEMS"
.PP
Items of type \fBrectangle\fR appear as rectangular regions on
-the display. Each rectangle may have an outline, a fill, or
-both. Rectangles are created with widget commands of the
+the display. Each rectangle may have an outline, a fill, or
+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?
+\fIpathName \fBcreate rectangle \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate rectangle \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR
(which must have four elements) give
@@ -1637,7 +1719,7 @@ the coordinates of two diagonally opposite corners of the rectangle
its lower or right edges).
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. A rectangle item becomes the current item when the mouse
pointer is over any part that is painted or (when fully transparent) that
@@ -1645,44 +1727,35 @@ would be painted if both the \fB\-fill\fR and \fB\-outline\fR options were
non-empty.
.PP
The following standard options are supported by rectangles:
-.CS
-\-dash
-\-activedash
-\-disableddash
-\-dashoffset
-\-fill
-\-activefill
-\-disabledfill
-\-offset
-\-outline
-\-activeoutline
-\-disabledoutline
-\-outlineoffset
-\-outlinestipple
-\-activeoutlinestipple
-\-disabledoutlinestipple
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-\-width
-\-activewidth
-\-disabledwidth
-.CE
-.SH "TEXT ITEMS"
+.DS
+.ta 3i
+\fB\-dash\fR \fB\-activedash\fR
+\fB\-disableddash\fR \fB\-dashoffset\fR
+\fB\-fill\fR \fB\-activefill\fR
+\fB\-disabledfill\fR \fB\-offset\fR
+\fB\-outline\fR \fB\-activeoutline\fR
+\fB\-disabledoutline\fR \fB\-outlineoffset\fR
+\fB\-outlinestipple\fR \fB\-activeoutlinestipple\fR
+\fB\-disabledoutlinestipple\fR \fB\-stipple\fR
+\fB\-activestipple\fR \fB\-disabledstipple\fR
+\fB\-state\fR \fB\-tags\fR
+\fB\-width\fR \fB\-activewidth\fR
+\fB\-disabledwidth\fR
+.DE
+There are no rectangle-specific options.
+.SS "TEXT ITEMS"
.PP
A text item displays a string of characters on the screen in one
or more lines.
-Text items support indexing and selection, along with the
-following text-related canvas widget commands: \fBdchars\fR,
-\fBfocus\fR, \fBicursor\fR, \fBindex\fR, \fBinsert\fR,
-\fBselect\fR.
+Text items support indexing, editing and selection through the \fBdchars\fR
+widget command, the \fBfocus\fR widget command, the \fBicursor\fR widget
+command, the \fBindex\fR widget command, the \fBinsert\fR widget command, and
+the \fBselect\fR widget command.
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?
+\fIpathName \fBcreate text \fIx y \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate text \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two
elements) specify the coordinates of a
@@ -1690,33 +1763,30 @@ 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
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. A text item becomes the current item when the mouse pointer
is over any part of its bounding box.
.PP
The following standard options are supported by text items:
-.CS
-\-fill
-\-activefill
-\-disabledfill
-\-stipple
-\-activestipple
-\-disabledstipple
-\-state
-\-tags
-.CE
+.DS
+.ta 3i
+\fB\-anchor\fR \fB\-fill\fR
+\fB\-activefill\fR \fB\-disabledfill\fR
+\fB\-stipple\fR \fB\-activestipple\fR
+\fB\-disabledstipple\fR \fB\-state\fR
+\fB\-tags\fR
+.DE
The following extra options are supported for text items:
.TP
-\fB\-anchor \fIanchorPos\fR
-\fIAnchorPos\fR tells how to position the text relative to the
-positioning point for the text; it may have any of the forms
-accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
-is \fBcenter\fR then the text is centered on the point; if
-\fIanchorPos\fR is \fBn\fR then the text will be drawn such that
-the top center point of the rectangular region occupied by the
-text will be at the positioning point.
-This option defaults to \fBcenter\fR.
+\fB\-angle \fIrotationDegrees\fR
+.VS 8.6
+\fIRotationDegrees\fR tells how many degrees to rotate the text anticlockwise
+about the positioning point for the text; it may have any floating-point value
+from 0.0 to 360.0. For example, if \fIrotationDegrees\fR is \fB90\fR, then the
+text will be drawn vertically from bottom to top.
+This option defaults to \fB0.0\fR.
+.VE 8.6
.TP
\fB\-font \fIfontName\fR
Specifies the font to use for the text item.
@@ -1738,7 +1808,6 @@ Newline characters cause line breaks.
The characters in the item may also be changed with the
\fBinsert\fR and \fBdelete\fR widget commands.
This option defaults to an empty string.
-.VS 8.5
.TP
\fB\-underline \fI\fR
Specifies the integer index of a character within the text to be
@@ -1746,7 +1815,6 @@ underlined. 0 corresponds to the first character of the text
displayed, 1 to the next character, and so on. \-1 means that no
underline should be drawn (if the whole text item is to be underlined,
the appropriate font should be used instead).
-.VE 8.5
.TP
\fB\-width \fIlineLength\fR
Specifies a maximum line length for the text, in any of the forms
@@ -1755,25 +1823,25 @@ If this option is zero (the default) the text is broken into
lines only at newline characters.
However, if this option is non-zero then any line that would
be longer than \fIlineLength\fR is broken just before a space
-character to make the line shorter than \fIlineLength\fR; the
+character to make the line shorter than \fIlineLength\fR; the
space character is treated as if it were a newline
character.
-.SH "WINDOW ITEMS"
+.SS "WINDOW ITEMS"
.PP
Items of type \fBwindow\fR cause a particular window to be displayed
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?
+\fIpathName \fBcreate window \fIx y \fR?\fIoption value ...\fR?
+\fIpathName \fBcreate window \fIcoordList\fR ?\fIoption value ...\fR?
.CE
The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR (which must have two
elements) 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).
+point used to position the window on the display, as controlled by the
+\fB\-anchor\fR option.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
pairs, each of which sets one of the configuration options
-for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
+for the item. These same \fIoption\fR\-\fIvalue\fR pairs may be
used in \fBitemconfigure\fR widget commands to change the item's
configuration. Theoretically, a window item becomes the current item when the
mouse pointer is over any part of its bounding box, but in practice this
@@ -1781,22 +1849,13 @@ typically does not happen because the mouse pointer ceases to be over the
canvas at that point.
.PP
The following standard options are supported by window items:
-.CS
-\-state
-\-tags
-.CE
+.DS
+.ta 3i
+\fB\-anchor\fR \fB\-state\fR
+\fB\-tags\fR
+.DE
The following extra options are supported for window items:
.TP
-\fB\-anchor \fIanchorPos\fR
-.
-\fIAnchorPos\fR tells how to position the window relative to the
-positioning point for the item; it may have any of the forms
-accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR
-is \fBcenter\fR then the window is centered on the point; if
-\fIanchorPos\fR is \fBn\fR then the window will be drawn so that
-its top center point is at the positioning point.
-This option defaults to \fBcenter\fR.
-.TP
\fB\-height \fIpixels\fR
.
Specifies the height to assign to the item's window.
@@ -1820,9 +1879,9 @@ The window specified by \fIpathName\fR must either be a child of
the canvas widget or a child of some ancestor of the canvas widget.
\fIPathName\fR may not refer to a top-level window.
.PP
-Note: due to restrictions in the ways that windows are managed, it is not
+Note: due to restrictions in the ways that windows are managed, it is not
possible to draw other graphical items (such as lines and images) on top
-of window items. A window item always obscures any graphics that
+of window items. A window item always obscures any graphics that
overlap it, regardless of their order in the display list. Also note that
window items, unlike other canvas items, are not clipped for display by their
containing canvas's border, and are instead clipped by the parent widget of
@@ -1836,16 +1895,20 @@ See the documentation for \fBTk_CreateItemType\fR.
.SH BINDINGS
.PP
In the current implementation, new canvases are not given any
-default behavior: you will have to execute explicit Tcl commands
+default behavior: you will have to execute explicit Tcl commands
to give the canvas its behavior.
.SH CREDITS
.PP
Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's
-\fIezd\fR program. \fIEzd\fR provides structured graphics in a Scheme
-environment and preceded canvases by a year or two. Its simple
+\fIezd\fR program. \fIEzd\fR provides structured graphics in a Scheme
+environment and preceded canvases by a year or two. Its simple
mechanisms for placing and animating graphical objects inspired the
functions of canvases.
.SH "SEE ALSO"
bind(n), font(n), image(n), scrollbar(n)
.SH KEYWORDS
canvas, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" fill-column: 78
+'\" End:
diff --git a/doc/checkbutton.n b/doc/checkbutton.n
index 1e05c96..4d06c68 100644
--- a/doc/checkbutton.n
+++ b/doc/checkbutton.n
@@ -38,7 +38,7 @@ If this option is not specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
.OP \-indicatoron indicatorOn IndicatorOn
Specifies whether or not the indicator should be drawn. Must be a
-proper boolean value. If false, the \fBrelief\fR option is
+proper boolean value. If false, the \fB\-relief\fR option is
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
.OP \-offrelief offRelief OffRelief
@@ -79,34 +79,30 @@ whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
.OP \-selectimage selectImage SelectImage
-Specifies an image to display (in place of the \fBimage\fR option)
+Specifies an image to display (in place of the \fB\-image\fR option)
when the checkbutton is selected.
-This option is ignored unless the \fBimage\fR option has been
+This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-state state State
Specifies one of three states for the checkbutton: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the checkbutton is displayed using the
-\fBforeground\fR and \fBbackground\fR options. The active state is
+\fB\-foreground\fR and \fB\-background\fR options. The active state is
typically used when the pointer is over the checkbutton. In active state
-the checkbutton is displayed using the \fBactiveForeground\fR and
-\fBactiveBackground\fR options. Disabled state means that the checkbutton
+the checkbutton is displayed using the \fB\-activeforeground\fR and
+\fB\-activebackground\fR options. Disabled state means that the checkbutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
-In this state the \fBdisabledForeground\fR and
-\fBbackground\fR options determine how the checkbutton is displayed.
+In this state the \fB\-disabledforeground\fR and
+\fB\-background\fR options determine how the checkbutton is displayed.
.OP \-tristateimage tristateImage TristateImage
-.VS 8.5
-Specifies an image to display (in place of the \fBimage\fR option)
+Specifies an image to display (in place of the \fB\-image\fR option)
when the checkbutton is in tri-state mode.
-This option is ignored unless the \fBimage\fR option has been
+This option is ignored unless the \fB\-image\fR option has been
specified.
-.VE 8.5
.OP \-tristatevalue tristateValue Value
-.VS 8.5
-Specifies the value that causes the checkbutton to display the multi-value
+Specifies the value that causes the checkbutton to display the multi-value
selection, also known as the tri-state mode. Defaults to
.QW "" .
-.VE 8.5
.OP \-variable variable Variable
Specifies the name of a global variable to set to indicate whether
or not this button is selected. Defaults to the name of the
@@ -138,13 +134,13 @@ that displays a textual string, bitmap or image
and a square called an \fIindicator\fR.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
-or if wrapping occurs because of the \fBwrapLength\fR option) and
+or if wrapping occurs because of the \fB\-wraplength\fR option) and
one of the characters may optionally be underlined using the
-\fBunderline\fR option.
+\fB\-underline\fR option.
A checkbutton has
all of the behavior of a simple button, including the
following: it can display itself in either of three different
-ways, according to the \fBstate\fR option;
+ways, according to the \fB\-state\fR option;
it can be made to appear
raised, sunken, or flat; it can be made to flash; and it invokes
a Tcl command whenever mouse button 1 is clicked over the
@@ -155,17 +151,16 @@ If a checkbutton is selected then the indicator is normally
drawn with a selected appearance, and
a Tcl variable associated with the checkbutton is set to a particular
value (normally 1).
-.VS 8.5
The indicator is drawn with a check mark inside.
If the checkbutton is not selected, then the indicator is drawn with a
deselected appearance, and the associated variable is
set to a different value (typically 0).
-The indicator is drawn without a check mark inside. In the special case
-where the variable (if specified) has a value that matches the tristatevalue,
-the indicator is drawn with a tri-state appearance and is in the tri-state
-mode indicating mixed or multiple values. (This is used when the check
+The indicator is drawn without a check mark inside. In the special case
+where the variable (if specified) has a value that matches the tristatevalue,
+the indicator is drawn with a tri-state appearance and is in the tri-state
+mode indicating mixed or multiple values. (This is used when the check
box represents the state of multiple items.)
-The indicator is drawn in a platform dependent manner. Under Unix and
+The indicator is drawn in a platform dependent manner. Under Unix and
Windows, the background interior of the box is
.QW grayed .
Under Mac, the indicator is drawn with a dash mark inside.
@@ -190,7 +185,6 @@ changes to and from the button's
and
.QW tristate
values.
-.VE 8.5
.SH "WIDGET COMMAND"
.PP
The \fBcheckbutton\fR command creates a new Tcl command whose
@@ -270,7 +264,8 @@ invoked, if there is one).
.IP [3]
When a checkbutton has the input focus, the space key causes the checkbutton
to be invoked. Under Windows, there are additional key bindings; plus
-(+) and equal (=) select the button, and minus (\-) deselects the button.
+(\fB+\fR) and equal (\fB=\fR) select the button, and minus (\fB\-\fR)
+deselects the button.
.PP
If the checkbutton's state is \fBdisabled\fR then none of the above
actions occur: the checkbutton is completely non-responsive.
@@ -278,17 +273,21 @@ actions occur: the checkbutton is completely non-responsive.
The behavior of checkbuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH EXAMPLE
+.PP
This example shows a group of uncoupled checkbuttons.
.PP
.CS
- labelframe .lbl \-text "Steps:"
- \fBcheckbutton\fR .c1 \-text Lights \-variable lights
- \fBcheckbutton\fR .c2 \-text Cameras \-variable cameras
- \fBcheckbutton\fR .c3 \-text Action! \-variable action
- pack .c1 .c2 .c3 \-in .lbl
- pack .lbl
+labelframe .lbl \-text "Steps:"
+\fBcheckbutton\fR .c1 \-text Lights \-variable lights
+\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras
+\fBcheckbutton\fR .c3 \-text Action! \-variable action
+pack .c1 .c2 .c3 \-in .lbl
+pack .lbl
.CE
.SH "SEE ALSO"
button(n), options(n), radiobutton(n), ttk::checkbutton(n)
.SH KEYWORDS
checkbutton, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/chooseColor.n b/doc/chooseColor.n
index 565934c..645b9c1 100644
--- a/doc/chooseColor.n
+++ b/doc/chooseColor.n
@@ -13,7 +13,6 @@ tk_chooseColor \- pops up a dialog box for the user to select a color.
.SH SYNOPSIS
\fBtk_chooseColor \fR?\fIoption value ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The procedure \fBtk_chooseColor\fR pops up a dialog box for the
@@ -38,9 +37,12 @@ name of the color in a form acceptable to \fBTk_GetColor\fR. If the
user cancels the operation, both commands will return the empty
string.
.SH EXAMPLE
+.PP
.CS
button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"]
.CE
-
.SH KEYWORDS
-color selection dialog
+color, color selection, dialog
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n
index c380ccf..2d96825 100644
--- a/doc/chooseDirectory.n
+++ b/doc/chooseDirectory.n
@@ -38,6 +38,7 @@ turns the file dialog into a sheet attached to the parent window.
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.
.SH EXAMPLE
+.PP
.CS
set dir [\fBtk_chooseDirectory\fR \e
\-initialdir ~ \-title "Choose a directory"]
@@ -47,8 +48,10 @@ if {$dir eq ""} {
label .l \-text "Selected $dir"
}
.CE
-
.SH "SEE ALSO"
tk_getOpenFile(n), tk_getSaveFile(n)
.SH KEYWORDS
directory, selection, dialog, platform-specific
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/clipboard.n b/doc/clipboard.n
index b689328..c987b38 100644
--- a/doc/clipboard.n
+++ b/doc/clipboard.n
@@ -14,7 +14,6 @@ clipboard \- Manipulate Tk clipboard
.SH SYNOPSIS
\fBclipboard \fIoption\fR ?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
This command provides a Tcl interface to the Tk clipboard,
@@ -28,15 +27,9 @@ appends should be completed before returning to the event loop.
The first argument to \fBclipboard\fR determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
-.PP
-.TP
-\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR?
-Claims ownership of the clipboard on \fIwindow\fR's display and removes
-any previous contents. \fIWindow\fR defaults to
-.QW . .
-Returns an empty string.
.TP
\fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR
+.
Appends \fIdata\fR to the clipboard on \fIwindow\fR's
display in the form given by \fItype\fR with the representation given
by \fIformat\fR and claims ownership of the clipboard on \fIwindow\fR's
@@ -47,15 +40,15 @@ display.
(the desired
.QW target
for conversion, in ICCCM terminology), and
-should be an atom name such as STRING or FILE_NAME; see the
+should be an atom name such as \fBSTRING\fR or \fBFILE_NAME\fR; see the
Inter-Client Communication Conventions Manual for complete details.
-\fIType\fR defaults to STRING.
+\fIType\fR defaults to \fBSTRING\fR.
.PP
The \fIformat\fR argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
-Table 2 of the ICCCM), and defaults to STRING. If \fIformat\fR is
-STRING, the selection is transmitted as 8-bit ASCII characters. If
-\fIformat\fR is ATOM, then the \fIdata\fR is
+Table 2 of the ICCCM), and defaults to \fBSTRING\fR. If \fIformat\fR is
+\fBSTRING\fR, the selection is transmitted as 8-bit ASCII characters. If
+\fIformat\fR is \fBATOM\fR, then the \fIdata\fR is
divided into fields separated by white space; each field is converted
to its atom value, and the 32-bit atom value is transmitted instead of
the atom name. For any other \fIformat\fR, \fIdata\fR is divided
@@ -69,8 +62,8 @@ boundaries. All items appended to the clipboard with the same
.PP
The \fIformat\fR argument is needed only for compatibility with
clipboard requesters that do not use Tk. If the Tk toolkit is being
-used to retrieve the CLIPBOARD selection then the value is converted back to
-a string at the requesting end, so \fIformat\fR is
+used to retrieve the \fBCLIPBOARD\fR selection then the value is
+converted back to a string at the requesting end, so \fIformat\fR is
irrelevant.
.PP
A \fB\-\|\-\fR argument may be specified to mark the end of options: the
@@ -79,21 +72,30 @@ This feature may be convenient if, for example, \fIdata\fR starts
with a \fB\-\fR.
.RE
.TP
+\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR?
+.
+Claims ownership of the clipboard on \fIwindow\fR's display and removes
+any previous contents. \fIWindow\fR defaults to
+.QW . .
+Returns an empty string.
+.TP
\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR?
+.
Retrieve data from the clipboard on \fIwindow\fR's display.
\fIWindow\fR defaults to
.QW . .
\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
+the data is to be returned and should be an atom name such as \fBSTRING\fR
+or \fBFILE_NAME\fR. \fIType\fR defaults to \fBSTRING\fR. This command is
equivalent to
-.QW "\fBselection get \-selection CLIPBOARD\fR" .
+.QW "\fBselection get\fR \fB\-selection CLIPBOARD\fR" .
.RS
.PP
Note that on modern X11 systems, the most useful type to retrieve for
transferred strings is not \fBSTRING\fR, but rather \fBUTF8_STRING\fR.
.RE
.SH EXAMPLES
+.PP
Get the current contents of the clipboard.
.CS
if {[catch {\fBclipboard get\fR} contents]} {
@@ -146,9 +148,10 @@ bind $c <<Paste>> {
}
}
.CE
-
.SH "SEE ALSO"
interp(n), selection(n)
-
.SH KEYWORDS
clear, format, clipboard, append, selection, type
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/colors.n b/doc/colors.n
index 4b8cda1..80567c3 100644
--- a/doc/colors.n
+++ b/doc/colors.n
@@ -3,6 +3,8 @@
'\" Copyright (c) 2003 ActiveState Corporation.
'\" Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
'\" Copyright (c) 2008 Donal K. Fellows
+'\"
+'\"
'\"
.so man.macros
.TH colors n 8.3 Tk "Tk Built-In Commands"
@@ -944,3 +946,6 @@ GrayText WindowText
options(n), Tk_GetColor(3)
.SH KEYWORDS
color, option
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/console.n b/doc/console.n
index 8e0691c..bce765d 100644
--- a/doc/console.n
+++ b/doc/console.n
@@ -129,6 +129,7 @@ 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 EXAMPLE
+.PP
Not all platforms have the \fBconsole\fR command, so debugging code
often has the following code fragment in it so output produced by
\fBputs\fR can be seen while during development:
@@ -139,3 +140,6 @@ catch {\fBconsole show\fR}
destroy(n), fconfigure(n), history(n), interp(n), puts(n), text(n), wm(n)
.SH KEYWORDS
console, interpreter, window, interactive, output channels
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/cursors.n b/doc/cursors.n
index 8bc2a8f..57b1399 100644
--- a/doc/cursors.n
+++ b/doc/cursors.n
@@ -135,12 +135,13 @@ On Mac OS X systems, the following cursors are mapped to native cursors:
.RS
.CS
arrow
+top_left_arrow
+left_ptr
cross
crosshair
+tcross
ibeam
none
-plus
-watch
xterm
.CE
And the following additional native cursors are available:
@@ -148,24 +149,43 @@ And the following additional native cursors are available:
copyarrow
aliasarrow
contextualmenuarrow
+movearrow
text
cross-hair
-closedhand
+hand
openhand
+closedhand
+fist
pointinghand
+resize
resizeleft
resizeright
resizeleftright
resizeup
resizedown
resizeupdown
+resizebottomleft
+resizetopleft
+resizebottomright
+resizetopright
notallowed
poof
+wait
countinguphand
countingdownhand
countingupanddownhand
spinning
+help
+bucket
+cancel
+eyedrop
+eyedrop-full
+zoom-in
+zoom-out
.CE
.RE
.SH KEYWORDS
cursor, option
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/destroy.n b/doc/destroy.n
index 93aedd5..ee56754 100644
--- a/doc/destroy.n
+++ b/doc/destroy.n
@@ -27,6 +27,7 @@ in destroying a window the command aborts without destroying the
remaining windows.
No error is returned if \fIwindow\fR does not exist.
.SH EXAMPLE
+.PP
Destroy all checkbuttons that are direct children of the given widget:
.CS
proc killCheckbuttonChildren {parent} {
@@ -37,6 +38,8 @@ proc killCheckbuttonChildren {parent} {
}
}
.CE
-
.SH KEYWORDS
application, destroy, window
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/dialog.n b/doc/dialog.n
index e72cbac..bd40321 100644
--- a/doc/dialog.n
+++ b/doc/dialog.n
@@ -14,7 +14,6 @@ tk_dialog \- Create modal dialog and wait for response
.SH SYNOPSIS
\fBtk_dialog \fIwindow title text bitmap default string string ...\fR
.BE
-
.SH DESCRIPTION
.PP
This procedure is part of the Tk script library.
@@ -31,7 +30,8 @@ Text to appear in the window manager's title bar for the dialog.
Message to appear in the top portion of the dialog box.
.TP
\fIbitmap\fR
-If non-empty, specifies a bitmap to display in the top portion of
+If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap)
+to display in the top portion of
the dialog, to the left of the text.
If this is an empty string then no bitmap is displayed in the dialog.
.TP
@@ -59,13 +59,15 @@ While waiting for the user to respond, \fBtk_dialog\fR sets a local
grab. This prevents the user from interacting with the application
in any way except to invoke the dialog box.
.SH EXAMPLE
+.PP
.CS
set reply [\fBtk_dialog\fR .foo "The Title" "Do you want to say yes?" \e
questhead 0 Yes No "I'm not sure"]
.CE
-
.SH "SEE ALSO"
tk_messageBox(n)
-
.SH KEYWORDS
bitmap, dialog, modal
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/entry.n b/doc/entry.n
index 58c5d64..b115268 100644
--- a/doc/entry.n
+++ b/doc/entry.n
@@ -32,9 +32,9 @@ this option is the empty string, the normal background color is used.
Specifies the foreground color to use when the entry is disabled. If
this option is the empty string, the normal foreground color is used.
.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
-Specifies a script to eval when \fBvalidateCommand\fR returns 0.
+Specifies a script to eval when \fB\-validatecommand\fR returns 0.
Setting it to {} disables this feature (the default). The best use
-of this option is to set it to \fIbell\fR. See \fBValidation\fR
+of this option is to set it to \fIbell\fR. See \fBVALIDATION\fR
below for more information.
.OP \-readonlybackground readonlyBackground ReadonlyBackground
Specifies the background color to use when the entry is readonly. If
@@ -64,15 +64,15 @@ be displayed in a different color, depending on the values of the
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.
+state which mode you wish to use. See \fBVALIDATION\fR below for more.
.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
Specifies a script to eval when you want to validate the input into
the entry widget. Setting it to {} disables this feature (the default).
This command must return a valid Tcl boolean value. If it returns 0 (or
the valid Tcl boolean equivalent) then it means you reject the new edition
-and it will not occur and the \fBinvalidCommand\fR will be evaluated if it
+and it will not occur and the \fB\-invalidcommand\fR will be evaluated if it
is set. If it returns 1, then the new edition occurs.
-See \fBValidation\fR below for more information.
+See \fBVALIDATION\fR below for more information.
.OP \-width width Width
Specifies an integer value indicating the desired width of the entry window,
in average-size characters of the widget's font.
@@ -96,7 +96,7 @@ allows that string to be edited using widget commands described below, which
are typically bound to keystrokes and mouse actions.
When first created, an entry's string is empty.
A portion of the entry may be selected as described below.
-If an entry is exporting its selection (see the \fBexportSelection\fR
+If an entry is exporting its selection (see the \fB\-exportselection\fR
option), then it will observe the standard X11 protocols for handling the
selection; entry selections are available as type \fBSTRING\fR.
Entries also observe the standard Tk rules for dealing with the
@@ -108,31 +108,31 @@ Entries 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. Entries use
-the standard \fBxScrollCommand\fR mechanism for interacting with
-scrollbars (see the description of the \fBxScrollCommand\fR option
+the standard \fB\-xscrollcommand\fR mechanism for interacting with
+scrollbars (see the description of the \fB\-xscrollcommand\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:
+Validation works by setting the \fB\-validatecommand\fR option to a
+script (\fIvalidateCommand\fR) which will be evaluated according to
+the \fB\-validate\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 entry receives or
+\fIvalidateCommand\fR will be called when the entry receives or
loses focus.
.IP \fBfocusin\fR 10
-\fBvalidateCommand\fR will be called when the entry receives focus.
+\fIvalidateCommand\fR will be called when the entry receives focus.
.IP \fBfocusout\fR 10
-\fBvalidateCommand\fR will be called when the entry loses focus.
+\fIvalidateCommand\fR will be called when the entry loses focus.
.IP \fBkey\fR 10
-\fBvalidateCommand\fR will be called when the entry is edited.
+\fIvalidateCommand\fR will be called when the entry is edited.
.IP \fBall\fR 10
-\fBvalidateCommand\fR will be called for all above conditions.
+\fIvalidateCommand\fR will be called for all above conditions.
.PP
-It is possible to perform percent substitutions on the \fBvalidateCommand\fR
-and \fBinvalidCommand\fR,
+It is possible to perform percent substitutions on the value of the
+\fB\-validatecommand\fR and \fB\-invalidcommand\fR options,
just as you would in a \fBbind\fR script. The following substitutions
are recognized:
.PP
@@ -157,32 +157,32 @@ The type of validation that triggered the callback
.IP \fB%W\fR 5
The name of the entry widget.
.PP
-In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
+In general, the \fB\-textvariable\fR and \fB\-validatecommand\fR options 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 entry widget. Using the \fBtextVariable\fR for read-only purposes will
+\fB\-validatecommand\fR will not interfere with the traditional behavior of
+the entry widget. Using the \fB\-textvariable\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.
+\fB\-textvariable\fR to something that the \fB\-validatecommand\fR would not
+accept, which causes \fB\-validate\fR to become \fInone\fR (the
+\fB\-invalidcommand\fR will not be triggered). The same happens
+when an error occurs evaluating the \fB\-validatecommand\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
-entry widget from within either the \fBvalidateCommand\fR or the
-\fBinvalidCommand\fR. Such editions will override the one that was being
+Primarily, an error will occur when the \fB\-validatecommand\fR or
+\fB\-invalidcommand\fR encounters an error in its script while evaluating or
+\fB\-validatecommand\fR does not return a valid Tcl boolean value. The
+\fB\-validate\fR option will also set itself to \fBnone\fR when you edit the
+entry widget from within either the \fB\-validatecommand\fR or the
+\fB\-invalidcommand\fR. Such editions will override the one that was being
validated. If you wish to edit the entry widget (for example set it to {})
-during validation and still have the \fBvalidate\fR option set, you should
+during validation and still have the \fB\-validate\fR option set, you should
include the command
.CS
after idle {%W config \-validate %v}
.CE
-in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
+in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you
were editing the entry widget from). It is also recommended to not set an
-associated \fBtextVariable\fR during validation, as that can cause the
-entry widget to become out of sync with the \fBtextVariable\fR.
+associated \fB\-textvariable\fR during validation, as that can cause the
+entry widget to become out of sync with the \fB\-textvariable\fR.
.SH "WIDGET COMMAND"
.PP
The \fBentry\fR command creates a new Tcl command whose
@@ -369,9 +369,9 @@ Returns an empty string.
.RE
.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.
+This command is used to force an evaluation of the \fB\-validatecommand\fR
+independent of the conditions specified by the \fB\-validate\fR option.
+This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR.
It returns 0 or 1.
.TP
\fIpathName \fBxview \fIargs\fR
@@ -534,3 +534,6 @@ individual widgets or by redefining the class bindings.
ttk::entry(n)
.SH KEYWORDS
entry, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/event.n b/doc/event.n
index 69f336a..df77385 100644
--- a/doc/event.n
+++ b/doc/event.n
@@ -108,13 +108,11 @@ Corresponds to the \fB%b\fR substitution for binding scripts.
\fINumber\fR must be an integer; it specifies the \fIcount\fR field
for the event. Valid for \fBExpose\fR events.
Corresponds to the \fB%c\fR substitution for binding scripts.
-.VS 8.5
.TP
\fB\-data\fI string\fR
\fIString\fR may be any value; it specifies the \fIuser_data\fR field
for the event. Only valid for virtual events. Corresponds to the
\fB%d\fR substitution for virtual events in binding scripts.
-.VE 8.5
.TP
\fB\-delta\fI number\fR
\fINumber\fR must be an integer; it specifies the \fIdelta\fR field
@@ -308,6 +306,7 @@ Any options that are not specified when generating an event are filled
with the value 0, except for \fIserial\fR, which is filled with the
next X event serial number.
.SH "PREDEFINED VIRTUAL EVENTS"
+.PP
Tk defines the following virtual events for the purposes of
notification:
.TP
@@ -359,6 +358,26 @@ Copy the currently selected widget contents to the clipboard.
\fB<<Cut>>\fR
Move the currently selected widget contents to the clipboard.
.TP
+\fB<<LineEnd>>\fR
+.
+Move to the end of the line in the current widget while deselecting any
+selected contents.
+.TP
+\fB<<LineStart>>\fR
+.
+Move to the start of the line in the current widget while deselecting any
+selected contents.
+.TP
+\fB<<NextChar>>\fR
+.
+Move to the next item (i.e., visible character) in the current widget while
+deselecting any selected contents.
+.TP
+\fB<<NextWord>>\fR
+.
+Move to the next group of items (i.e., visible word) in the current widget
+while deselecting any selected contents.
+.TP
\fB<<Paste>>\fR
Replace the currently selected widget contents with the contents of
the clipboard.
@@ -367,32 +386,80 @@ the clipboard.
Insert the contents of the selection at the mouse location. (This
event has meaningful \fB%x\fR and \fB%y\fR substitutions).
.TP
+\fB<<PrevChar>>\fR
+.
+Move to the previous item (i.e., visible character) in the current widget
+while deselecting any selected contents.
+.TP
\fB<<PrevWindow>>\fR
Traverse to the previous window.
.TP
+\fB<<PrevWord>>\fR
+.
+Move to the previous group of items (i.e., visible word) in the current widget
+while deselecting any selected contents.
+.TP
\fB<<Redo>>\fR
Redo one undone action.
.TP
+\fB<<SelectLineEnd>>\fR
+.
+Move to the end of the line in the current widget while extending the range
+of selected contents.
+.TP
+\fB<<SelectLineStart>>\fR
+.
+Move to the start of the line in the current widget while extending the range
+of selected contents.
+.TP
+\fB<<SelectNextChar>>\fR
+.
+Move to the next item (i.e., visible character) in the current widget while
+extending the range of selected contents.
+.TP
+\fB<<SelectNextWord>>\fR
+.
+Move to the next group of items (i.e., visible word) in the current widget
+while extending the range of selected contents.
+.TP
+\fB<<SelectPrevChar>>\fR
+.
+Move to the previous item (i.e., visible character) in the current widget
+while extending the range of selected contents.
+.TP
+\fB<<SelectPrevWord>>\fR
+.
+Move to the previous group of items (i.e., visible word) in the current widget
+while extending the range of selected contents.
+.TP
\fB<<Undo>>\fR
Undo the last action.
-.SH "VIRTUAL EVENT EXAMPLES"
+.SH EXAMPLES
+.SS "MAPPING KEYS TO VIRTUAL EVENTS"
.PP
In order for a virtual event binding to trigger, two things must
happen. First, the virtual event must be defined with the
\fBevent add\fR command. Second, a binding must be created for
the virtual event with the \fBbind\fR command.
Consider the following virtual event definitions:
+.PP
.CS
-event add <<Paste>> <Control-y>
-event add <<Paste>> <Button-2>
-event add <<Save>> <Control-X><Control-S>
-event add <<Save>> <Shift-F12>
+\fBevent add\fR <<Paste>> <Control-y>
+\fBevent add\fR <<Paste>> <Button-2>
+\fBevent add\fR <<Save>> <Control-X><Control-S>
+\fBevent add\fR <<Save>> <Shift-F12>
+if {[tk windowingsystem] eq "aqua"} {
+ \fBevent add\fR <<Save>> <Command-s>
+}
.CE
+.PP
In the \fBbind\fR command, a virtual event can be bound like any other
builtin event type as follows:
+.PP
.CS
bind Entry <<Paste>> {%W insert [selection get]}
.CE
+.PP
The double angle brackets are used to specify that a virtual event is being
bound. If the user types Control-y or presses button 2, or if
a \fB<<Paste>>\fR virtual event is synthesized with \fBevent generate\fR,
@@ -401,11 +468,13 @@ then the \fB<<Paste>>\fR binding will be invoked.
If a virtual binding has the exact same sequence as a separate
physical binding, then the physical binding will take precedence.
Consider the following example:
+.PP
.CS
-event add <<Paste>> <Control-y> <Meta-Control-y>
+\fBevent add\fR <<Paste>> <Control-y> <Meta-Control-y>
bind Entry <Control-y> {puts Control-y}
bind Entry <<Paste>> {puts Paste}
.CE
+.PP
When the user types Control-y the \fB<Control-y>\fR binding
will be invoked, because a physical event is considered
more specific than a virtual event, all other things being equal.
@@ -423,18 +492,41 @@ ungeneratable.
When a definition of a virtual event changes at run time, all windows
will respond immediately to the new definition.
Starting from the preceding example, if the following code is executed:
+.PP
.CS
-bind <Entry> <Control-y> {}
-event add <<Paste>> <Key-F6>
+bind Entry <Control-y> {}
+\fBevent add\fR <<Paste>> <Key-F6>
.CE
+.PP
the behavior will change such in two ways. First, the shadowed
\fB<<Paste>>\fR binding will emerge.
Typing Control-y will no longer invoke the \fB<Control-y>\fR binding,
but instead invoke the virtual event \fB<<Paste>>\fR. Second,
pressing the F6 key will now also invoke the \fB<<Paste>>\fR binding.
-
+.SS "MOVING THE MOUSE POINTER"
+.PP
+Sometimes it is useful to be able to really move the mouse pointer. For
+example, if you have some software that is capable of demonstrating directly
+to the user how to use the program. To do this, you need to
+.QW warp
+the mouse around by using \fBevent generate\fR, like this:
+.PP
+.CS
+for {set xy 0} {$xy < 200} {incr xy} {
+ \fBevent generate\fR . <Motion> -x $xy -y $xy -warp 1
+ update
+ after 50
+}
+.CE
+.PP
+Note that it is usually considered bad style to move the mouse pointer for the
+user because it removes control from them. Therefore this technique should be
+used with caution. Also note that it is not guaranteed to function on all
+platforms.
.SH "SEE ALSO"
bind(n)
-
.SH KEYWORDS
event, binding, define, handle, virtual event
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/focus.n b/doc/focus.n
index f37e1cd..576db30 100644
--- a/doc/focus.n
+++ b/doc/focus.n
@@ -18,7 +18,6 @@ focus \- Manage the input focus
\fBfocus \fIoption\fR ?\fIarg arg ...\fR?
.fi
.BE
-
.SH DESCRIPTION
.PP
The \fBfocus\fR command is used to manage the Tk input focus.
@@ -106,6 +105,7 @@ number of problems that would occur if the X focus were actually moved;
the fact that the X focus is on the top-level is invisible unless
you use C code to query the X server directly.
.SH "EXAMPLE"
+.PP
To make a window that only participates in the focus traversal ring
when a variable is set, add the following bindings to the widgets
\fIbefore\fR and \fIafter\fR it in that focus ring:
@@ -130,6 +130,8 @@ bind .after <Shift\-Tab> {
}
\fBfocus\fR .before
.CE
-
.SH KEYWORDS
events, focus, keyboard, top-level, window manager
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/focusNext.n b/doc/focusNext.n
index ede496f..cef5ce2 100644
--- a/doc/focusNext.n
+++ b/doc/focusNext.n
@@ -18,7 +18,6 @@ tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for manag
.sp
\fBtk_focusFollowsMouse\fR
.BE
-
.SH DESCRIPTION
.PP
\fBtk_focusNext\fR is a utility procedure used for keyboard traversal.
@@ -54,6 +53,8 @@ Note: at present there is no built-in support for returning the
application to an explicit focus model; to do this you will have
to write a script that deletes the bindings created by
\fBtk_focusFollowsMouse\fR.
-
.SH KEYWORDS
focus, keyboard traversal, top-level
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/font.n b/doc/font.n
index 124fc43..763b63e 100644
--- a/doc/font.n
+++ b/doc/font.n
@@ -50,6 +50,14 @@ then the command modifies the given named font to have the given values; in
this case, all widgets using that font will redisplay themselves using the
new attributes for the font. See \fBFONT OPTIONS\fR below for a list of the
possible attributes.
+.RS
+.PP
+Note that on Aqua/Mac OS X, the system fonts (see
+\fBPLATFORM SPECIFIC FONTS\fR below) may not be actually altered because they
+are implemented by the system theme. To achieve the effect of modification,
+use \fBfont actual\fR to get their configuration and \fBfont create\fR to
+synthesize a copy of the font which can be modified.
+.RE
.TP
\fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR?
.
@@ -102,7 +110,7 @@ below for a list of the possible metrics.
.TP
\fBfont names\fR
The return value is a list of all the named fonts that are currently defined.
-.SH "FONT DESCRIPTION"
+.SH "FONT DESCRIPTIONS"
.PP
The following formats are accepted as a font description anywhere
\fIfont\fR is specified as an argument above; these same forms are also
@@ -123,7 +131,7 @@ The platform-specific name of a font, interpreted by the graphics server.
This also includes, under X, an XLFD (see [4]) for which a single
.QW \fB*\fR
character was used to elide more than one field in the middle of the
-name. See \fBPLATFORM-SPECIFIC\fR issues for a list of the system fonts.
+name. See \fBPLATFORM SPECIFIC FONTS\fR for a list of the system fonts.
.TP
[3] \fIfamily \fR?\fIsize\fR? ?\fIstyle\fR? ?\fIstyle ...\fR?
.
@@ -181,7 +189,7 @@ a garbage value); in that case, some system-dependent default font is
chosen. If the font description does not match any of the above patterns,
an error is generated.
.SH "FONT METRICS"
-.
+.PP
The following options are used by the \fBfont metrics\fR command to query
font-specific data determined when the font was created. These properties are
for the whole font itself and not for individual characters drawn in that
@@ -223,6 +231,7 @@ individual characters have different widths. The widths of control
characters, tab characters, and other non-printing characters are not
included when calculating this value.
.SH "FONT OPTIONS"
+.PP
The following options are supported on all platforms, and are used when
constructing a named font or when specifying a font using style [5] as
above:
@@ -286,7 +295,7 @@ The value is a boolean flag that specifies whether a horizontal line should
be drawn through the middle of characters in this font. The default value
for overstrike is \fBfalse\fR.
.SH "STANDARD FONTS"
-.LP
+.PP
The following named fonts are supported on all systems, and default to values
that match appropriate system defaults.
.TP
@@ -329,7 +338,7 @@ This font should be used for tooltip windows (transient information windows).
It is \fInot\fR advised to change these fonts, as they may be modified by Tk
itself in response to system changes. Instead, make a copy of the font and
modify that.
-.SH "PLATFORM-SPECIFIC FONTS"
+.SH "PLATFORM SPECIFIC FONTS"
.PP
The following system fonts are supported:
.TP
@@ -373,6 +382,7 @@ theme fonts:
.DE
.RE
.SH EXAMPLE
+.PP
Fill a text widget with lots of font demonstrators, one for every font
family installed on your system:
.CS
@@ -390,9 +400,10 @@ foreach family [lsort \-dictionary [\fBfont families\fR]] {
}
}
.CE
-
.SH "SEE ALSO"
options(n)
-
.SH KEYWORDS
font
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/fontchooser.n b/doc/fontchooser.n
new file mode 100644
index 0000000..310ba1a
--- /dev/null
+++ b/doc/fontchooser.n
@@ -0,0 +1,181 @@
+'\"
+'\" Copyright (c) 2008 Daniel A. Steffen <das@users.sourceforge.net>
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.so man.macros
+.TH fontchooser n "" Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+fontchooser \- control font selection dialog
+.SH SYNOPSIS
+\fBtk fontchooser\fR \fBconfigure\fR ?\fI\-option value \-option value ...\fR?
+.sp
+\fBtk fontchooser\fR \fBshow\fR
+.sp
+\fBtk fontchooser\fR \fBhide\fR
+.BE
+.SH DESCRIPTION
+.PP
+The \fBtk fontchooser\fR command controls the Tk font selection dialog. It uses
+the native platform font selection dialog where available, or a dialog
+implemented in Tcl otherwise.
+.PP
+Unlike most of the other Tk dialog commands, \fBtk fontchooser\fR does not
+return an immediate result, as on some platforms (Mac OS X) the standard font
+dialog is modeless while on others (Windows) it is modal. To accommodate this
+difference, all user interaction with the dialog will be communicated to the
+caller via callbacks or virtual events.
+.PP
+The \fBtk fontchooser\fR command can have one of the following forms:
+.TP
+\fBtk fontchooser\fR \fBconfigure \fR?\fI\-option value \-option value ...\fR?
+.
+Set or query one or more of the configurations options below (analogous to Tk
+widget configuration).
+.TP
+\fBtk fontchooser\fR \fBshow\fR
+.
+Show the font selection dialog. Depending on the platform, may return
+immediately or only once the dialog has been withdrawn.
+.TP
+\fBtk fontchooser\fR \fBhide\fR
+.
+Hide the font selection dialog if it is visible and cause any pending
+\fBtk fontchooser\fR \fBshow\fR command to return.
+.PP
+.SH "CONFIGURATION OPTIONS"
+.TP
+\fB\-parent\fR
+Specifies/returns the logical parent window of the font selection dialog
+(similar to the \fB\-parent\fR option to other dialogs). The font selection
+dialog is hidden if it is visible when the parent window is destroyed.
+.TP
+\fB\-title\fR
+Specifies/returns the title of the dialog. Has no effect on platforms where the
+font selection dialog does not support titles.
+.TP
+\fB\-font\fR
+Specifies/returns the font that is currently selected in the dialog if it is
+visible, or that will be initially selected when the dialog is shown (if
+supported by the platform). Can be set to the empty string to indicate that no
+font should be selected. Fonts can be specified in any form given by the "FONT
+DESCRIPTION" section in the \fBfont\fR manual page.
+.TP
+\fB\-command\fR
+Specifies/returns the command prefix to be called when a font selection has
+been made by the user. The command prefix is evaluated at the global level
+after having the specification of the selected font appended. On platforms
+where the font selection dialog offers the user control of further font
+attributes (such as color), additional key/value pairs may be appended before
+evaluation. Can be set to the empty string to indicate that no callback should
+be invoked. Fonts are specified by a list of form [3] of the "FONT DESCRIPTION"
+section in the \fBfont\fR manual page (i.e. a list of the form
+\fI{family size style ?style ...?}\fR).
+.TP
+\fB\-visible\fR
+Read-only option that returns a boolean indicating whether the font selection
+dialog is currently visible. Attempting to set this option results in an error.
+
+.PP
+.SH "VIRTUAL EVENTS"
+.TP
+\fB<<TkFontchooserVisibility>>\fR
+Sent to the dialog parent whenever the visibility of the font selection dialog
+changes, both as a result of user action (e.g. disposing of the dialog via
+OK/Cancel button or close box) and of the \fBtk fontchooser\fR
+\fBshow\fR/\fBhide\fR commands being called. Binding scripts can determine the
+current visibility of the dialog by querying the \fB\-visible\fR configuration
+option.
+.TP
+\fB<<TkFontchooserFontChanged>>\fR
+Sent to the dialog parent whenever the font selection dialog is visible and the
+selected font changes, both as a result of user action and of the \fB\-font\fR
+configuration option being set. Binding scripts can determine the currently
+selected font by querying the \fB\-font\fR configuration option.
+.PP
+.SH NOTES
+.PP
+Callers should not expect a result from \fBtk fontchooser\fR \fBshow\fR and may
+not assume that the dialog has been withdrawn or closed when the command
+returns. All user interaction with the dialog is communicated to the caller via
+the \fB\-command\fR callback and the \fB<<TkFontchooser*>>\fR virtual events.
+It is implementation dependent which exact user actions result in the callback
+being called resp. the virtual events being sent. Where an Apply or OK button
+is present in the dialog, that button will trigger the \fB\-command\fR callback
+and \fB<<TkFontchooserFontChanged>>\fR virtual event. On some implementations
+other user actions may also have that effect; on Mac OS X for instance, the
+standard font selection dialog immediately reflects all user choices to the
+caller.
+.PP
+In the presence of multiple widgets intended to be influenced by the font
+selection dialog, care needs to be taken to correctly handle focus changes: the
+font selected in the dialog should always match the current font of the widget
+with the focus, and the \fB\-command\fR callback should only act on the widget
+with the focus. The recommended practice is to set font dialog \fB\-font\fR and
+\fB\-command\fR configuration options in per\-widget \fB<FocusIn>\fR handlers
+(and if necessary to unset them \- i.e. set to the empty string \- in
+corresponding \fB<FocusOut>\fR handlers). This is particularly important for
+implementors of library code using the font selection dialog, to avoid
+conflicting with application code that may also want to use the dialog.
+.PP
+Because the font selection dialog is application-global, in the presence of
+multiple interpreters calling \fBtk fontchooser\fR, only the \fB\-command\fR
+callback set by the interpreter that most recently called \fBtk fontchooser\fR
+\fBconfigure\fR or \fBtk fontchooser\fR \fBshow\fR will be invoked in response
+to user action and only the \fB\-parent\fR set by that interpreter will receive
+\fB<<TkFontchooser*>>\fR virtual events.
+.PP
+The font dialog implementation may only store (and return) \fBfont\fR
+\fBactual\fR data as the value of the \fB\-font\fR configuration option. This
+can be an issue when \fB\-font\fR is set to a named font, if that font is
+subsequently changed, the font dialog \fB\-font\fR option needs to be set again
+to ensure its selected font matches the new value of the named font.
+.PP
+.SH EXAMPLE
+.PP
+.CS
+proc fontchooserDemo {} {
+ wm title . "Font Chooser Demo"
+ \fBtk fontchooser\fR \fBconfigure\fR \-parent .
+ button .b \-command fontchooserToggle \-takefocus 0
+ fontchooserVisibility .b
+ bind . \fB<<TkFontchooserVisibility>>\fR \\
+ [list fontchooserVisibility .b]
+ foreach w {.t1 .t2} {
+ text $w \-width 20 \-height 4 \-borderwidth 1 \-relief solid
+ bind $w <FocusIn> [list fontchooserFocus $w]
+ $w insert end "Text Widget $w"
+ }
+ .t1 configure \-font {Courier 14}
+ .t2 configure \-font {Times 16}
+ pack .b .t1 .t2; focus .t1
+}
+proc fontchooserToggle {} {
+ \fBtk fontchooser\fR [expr {
+ [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ "\fBhide\fR" : "\fBshow\fR"}]
+}
+proc fontchooserVisibility {w} {
+ $w configure \-text [expr {
+ [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ "Hide Font Dialog" : "Show Font Dialog"}]
+}
+proc fontchooserFocus {w} {
+ \fBtk fontchooser\fR \fBconfigure\fR \-font [$w cget \-font] \\
+ \-command [list fontchooserFontSelection $w]
+}
+proc fontchooserFontSelection {w font args} {
+ $w configure \-font [font actual $font]
+}
+fontchooserDemo
+.CE
+.SH "SEE ALSO"
+font(n), tk(n)
+.SH KEYWORDS
+dialog, font, font selection, font chooser, font panel
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/frame.n b/doc/frame.n
index 208e414..6bf4a1b 100644
--- a/doc/frame.n
+++ b/doc/frame.n
@@ -20,7 +20,7 @@ frame \- Create and manipulate frame widgets
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
-This option is the same as the standard \fBbackground\fR option
+This option is the same as the standard \fB\-background\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
@@ -30,7 +30,7 @@ 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
+The \fB\-class\fR option may not be changed with the \fBconfigure\fR
widget command.
.OP \-colormap colormap Colormap
Specifies a colormap to use for the window.
@@ -39,7 +39,7 @@ 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
+If the \fB\-colormap\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.
@@ -52,7 +52,7 @@ 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.
-Note that \fB-borderwidth\fR, \fB-padx\fR and \fB-pady\fR are ignored when
+Note that \fB\-borderwidth\fR, \fB\-padx\fR and \fB\-pady\fR are ignored when
configured as a container since a container has no border.
.OP \-height height Height
Specifies the desired height for the window in any of the forms
@@ -67,7 +67,7 @@ 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
+The \fB\-visual\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
@@ -134,3 +134,6 @@ frames are not intended to be interactive.
labelframe(n), toplevel(n), ttk::frame(n)
.SH KEYWORDS
frame, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n
index 8162078..7ebae67 100644
--- a/doc/getOpenFile.n
+++ b/doc/getOpenFile.n
@@ -42,6 +42,7 @@ confirmation dialog be presented to the user. A false value requests
that the overwrite take place without confirmation. Default value is true.
.TP
\fB\-defaultextension\fR \fIextension\fR
+.
Specifies a string that will be appended to the filename if the user
enters a filename without an extension. The default value is the empty
string, which means no extension will be appended to the filename in
@@ -51,6 +52,7 @@ and the UNIX implementation guesses reasonable values for this from
the \fB\-filetypes\fR option when this is not supplied.
.TP
\fB\-filetypes\fR \fIfilePatternList\fR
+.
If a \fBFile types\fR listbox exists in the file dialog on the particular
platform, this option gives the \fIfiletype\fRs in this listbox. When
the user choose a filetype in the listbox, only the files of that type
@@ -61,6 +63,7 @@ types. See the section \fBSPECIFYING FILE PATTERNS\fR below for a
discussion on the contents of \fIfilePatternList\fR.
.TP
\fB\-initialdir\fR \fIdirectory\fR
+.
Specifies that the files in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified, then
the files in the current working directory are displayed. If the
@@ -68,25 +71,31 @@ parameter specifies a relative path, the return value will convert the
relative path to an absolute path.
.TP
\fB\-initialfile\fR \fIfilename\fR
+.
Specifies a filename to be displayed in the dialog when it pops up.
.TP
\fB\-message\fR \fIstring\fR
+.
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
.TP
\fB\-multiple\fR \fIboolean\fR
+.
Allows the user to choose multiple files from the Open dialog.
.TP
\fB\-parent\fR \fIwindow\fR
+.
Makes \fIwindow\fR the logical parent of the file dialog. The file
dialog is displayed on top of its parent window. On Mac OS X, this
turns the file dialog into a sheet attached to the parent window.
.TP
\fB\-title\fR \fItitleString\fR
+.
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title is displayed.
.TP
\fB\-typevariable\fR \fIvariableName\fR
+.
The global variable \fIvariableName\fR is used to preselect which filter is
used from \fIfilterList\fR when the dialog box is opened and is
updated when the dialog box is closed, to the last selected
@@ -163,6 +172,7 @@ Extensions without a full stop character (e.g.
.QW ~ )
are allowed but may not work on all platforms.
.SH EXAMPLE
+.PP
.CS
set types {
{{Text Files} {.txt} }
@@ -182,3 +192,6 @@ if {$filename != ""} {
tk_chooseDirectory
.SH KEYWORDS
file selection dialog
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/grab.n b/doc/grab.n
index 2f7e2f1..1b4857e 100644
--- a/doc/grab.n
+++ b/doc/grab.n
@@ -16,7 +16,6 @@ grab \- Confine pointer and keyboard events to a window sub-tree
.sp
\fBgrab \fIoption \fR?\fIarg arg \fR...?
.BE
-
.SH DESCRIPTION
.PP
This command implements simple pointer and keyboard grabs for Tk.
@@ -102,6 +101,7 @@ Returns \fBnone\fR if no grab is currently set on \fIwindow\fR,
\fBlocal\fR if a local grab is set on \fIwindow\fR, and
\fBglobal\fR if a global grab is set.
.SH WARNING
+.PP
It is very easy to use global grabs to render a display completely
unusable (e.g. by setting a grab on a widget which does not respond to
events and not providing any mechanism for releasing the grab). Take
@@ -121,6 +121,7 @@ only one of those applications can have a local grab for a given
display at any given time. If the applications are in different
processes, this restriction does not exist.
.SH EXAMPLE
+.PP
Set a grab so that only one button may be clicked out of a group. The
other buttons are unresponsive to the mouse until the middle button is
clicked.
@@ -130,6 +131,10 @@ pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}]
pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}]
\fBgrab\fR .b2
.CE
-
+.SH "SEE ALSO"
+busy(n)
.SH KEYWORDS
grab, keyboard events, pointer events, window
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/grid.n b/doc/grid.n
index 5c1c3ba..aa949c5 100644
--- a/doc/grid.n
+++ b/doc/grid.n
@@ -22,44 +22,44 @@ 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 suitable as the first slave
argument to \fBgrid configure\fR, either a window name (any value
-starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR
+starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR
(see the \fBRELATIVE PLACEMENT\fR section below), then the command is
processed in the same way as \fBgrid configure\fR.
-.VS 8.5
.TP
\fBgrid anchor \fImaster\fR ?\fIanchor\fR?
+.
The anchor value controls how to place the grid within the master
when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below
for further details. The default \fIanchor\fR is \fInw\fR.
-.VE 8.5
.TP
\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
-With no arguments,
+.
+With no arguments,
the bounding box (in pixels) of the grid is returned.
The return value consists of 4 integers. The first two are the pixel
offset from the master window (x then y) of the top-left corner of the
grid, and the second two integers are the width and height of the grid,
-also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on
+also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on
the command line, then the bounding box for that cell is returned, where the
top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR
arguments are specified, then the bounding box spanning the rows and columns
indicated is returned.
.TP
\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR?
-Query or set the column properties of the \fIindex\fR column of the
+.
+Query or set the column properties of the \fIindex\fR column of the
geometry master, \fImaster\fR.
The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR
and \fB\-pad\fR.
-If one or more options are provided, then \fIindex\fR may be given as
+If one or more options are provided, then \fIindex\fR may be given as
a list of column indices to which the configuration options will operate on.
-.VS 8.5
Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR
the options apply to all columns currently occupied be slave windows. For
a window name, that window must be a slave of this master and the options
apply to all columns currently occupied be the slave.
-.VE 8.5
The \fB\-minsize\fR option sets the minimum size, in screen units,
that will be permitted for this column.
The \fB\-weight\fR option (an integer value)
@@ -86,10 +86,11 @@ are returned in a list of
pairs.
.TP
\fBgrid configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?
+.
The arguments consist of the names of one or more slave windows
followed by pairs of arguments that specify how
to manage the slaves.
-The characters \fB\-\fR, \fBx\fR and \fB^\fR,
+The characters \fB\-\fR, \fBx\fR and \fB^\fR,
can be specified instead of a window name to alter the default
location of a \fIslave\fR, as described in the \fBRELATIVE PLACEMENT\fR
section, below.
@@ -97,6 +98,7 @@ The following options are supported:
.RS
.TP
\fB\-column \fIn\fR
+.
Insert the slave so that it occupies the \fIn\fRth column in the grid.
Column numbers start with 0. If this option is not supplied, then the
slave is arranged just to the right of previous slave specified on this
@@ -108,17 +110,20 @@ is incremented by one. Thus the \fBx\fR represents a blank column
for this row in the grid.
.TP
\fB\-columnspan \fIn\fR
+.
Insert the slave so that it occupies \fIn\fR columns in the grid.
The default is one column, unless the window name is followed by a
\fB\-\fR, in which case the columnspan is incremented once for each immediately
following \fB\-\fR.
.TP
\fB\-in \fIother\fR
+.
Insert the slave(s) in the master
window given by \fIother\fR. The default is the first slave's
parent window.
.TP
\fB\-ipadx \fIamount\fR
+.
The \fIamount\fR specifies how much horizontal internal padding to
leave on each side of the slave(s). This is space is added
inside the slave(s) border.
@@ -126,12 +131,14 @@ The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
It defaults to 0.
.TP
\fB\-ipady \fIamount\fR
+.
The \fIamount\fR specifies how much vertical internal padding to
leave on the top and bottom of the slave(s).
This space is added inside the slave(s) border.
The \fIamount\fR defaults to 0.
.TP
\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
@@ -140,6 +147,7 @@ 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
@@ -148,12 +156,14 @@ The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border.
.TP
\fB\-row \fIn\fR
+.
Insert the slave so that it occupies the \fIn\fRth row in the grid.
Row numbers start with 0. If this option is not supplied, then the
slave is arranged on the same row as the previous slave specified on this
call to \fBgrid\fR, or the first unoccupied row if this is the first slave.
.TP
\fB\-rowspan \fIn\fR
+.
Insert the slave so that it occupies \fIn\fR rows in the grid.
The default is one row. If the next \fBgrid\fR command contains
\fB^\fR characters instead of \fIslaves\fR that line up with the columns
@@ -161,6 +171,7 @@ of this \fIslave\fR, then the \fBrowspan\fR of this \fIslave\fR is
extended by one.
.TP
\fB\-sticky \fIstyle\fR
+.
If a slave's cell is larger than its requested dimensions, this
option may be used to position (or stretch) the slave within its cell.
\fIStyle\fR is a string that contains zero or more of the characters
@@ -171,7 +182,7 @@ east, or west) that the slave will
.QW stick
to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are
specified, the slave will be stretched to fill the entire
-height (or width) of its cavity. The \fBsticky\fR option subsumes the
+height (or width) of its cavity. The \fB\-sticky\fR option subsumes the
combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR.
The default is
.QW "" ,
@@ -183,6 +194,7 @@ than receiving default values.
.RE
.TP
\fBgrid forget \fIslave \fR?\fIslave ...\fR?
+.
Removes each of the \fIslave\fRs from grid for its
master and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager.
@@ -191,6 +203,7 @@ slave is managed once more by the grid geometry manager, the initial
default settings are used.
.TP
\fBgrid info \fIslave\fR
+.
Returns a list whose elements are the current configuration state of
the slave given by \fIslave\fR in the same option-value form that
might be specified to \fBgrid configure\fR.
@@ -199,12 +212,14 @@ The first two elements of the list are
where \fImaster\fR is the slave's master.
.TP
\fBgrid location \fImaster x y\fR
-Given \fIx\fR and \fIy\fR values in screen units relative to the master window,
+.
+Given \fIx\fR and \fIy\fR values in screen units relative to the master window,
the column and row number at that \fIx\fR and \fIy\fR location is returned.
For locations that are above or to the left of the grid, \fB\-1\fR is
returned.
.TP
\fBgrid propagate \fImaster\fR ?\fIboolean\fR?
+.
If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
then propagation is enabled for \fImaster\fR, which must be a window
name (see \fBGEOMETRY PROPAGATION\fR below).
@@ -217,18 +232,17 @@ for \fImaster\fR.
Propagation is enabled by default.
.TP
\fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR?
-Query or set the row properties of the \fIindex\fR row of the
+.
+Query or set the row properties of the \fIindex\fR row of the
geometry master, \fImaster\fR.
The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR
and \fB\-pad\fR.
-If one or more options are provided, then \fIindex\fR may be given as
+If one or more options are provided, then \fIindex\fR may be given as
a list of row indices to which the configuration options will operate on.
-.VS 8.5
Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR
the options apply to all rows currently occupied be slave windows. For
a window name, that window must be a slave of this master and the options
apply to all rows currently occupied be the slave.
-.VE 8.5
The \fB\-minsize\fR option sets the minimum size, in screen units,
that will be permitted for this row.
The \fB\-weight\fR option (an integer value)
@@ -255,6 +269,7 @@ are returned in a list of
pairs.
.TP
\fBgrid remove \fIslave \fR?\fIslave ...\fR?
+.
Removes each of the \fIslave\fRs from grid for its
master and unmaps their windows.
The slaves will no longer be managed by the grid geometry manager.
@@ -264,12 +279,14 @@ slave is managed once more by the grid geometry manager, the previous
values are retained.
.TP
\fBgrid size \fImaster\fR
+.
Returns the size of the grid (in columns then rows) for \fImaster\fR.
The size is determined either by the \fIslave\fR occupying the largest
-row or column, or the largest column or row with a \fBminsize\fR,
-\fBweight\fR, or \fBpad\fR that is non-zero.
+row or column, or the largest column or row with a \fB\-minsize\fR,
+\fB\-weight\fR, or \fB\-pad\fR that is non-zero.
.TP
\fBgrid slaves \fImaster\fR ?\fI\-option value\fR?
+.
If no options are supplied, a list of all of the slaves in \fImaster\fR
are returned, most recently manages first.
\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which
@@ -278,13 +295,13 @@ to be returned.
.SH "RELATIVE PLACEMENT"
.PP
The \fBgrid\fR command contains a limited set of capabilities that
-permit layouts to be created without specifying the row and column
-information for each slave. This permits slaves to be rearranged,
+permit layouts to be created without specifying the row and column
+information for each slave. This permits slaves to be rearranged,
added, or removed without the need to explicitly specify row and
column information.
-When no column or row information is specified for a \fIslave\fR,
+When no column or row information is specified for a \fIslave\fR,
default values are chosen for
-\fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\fR
+\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR
at the time the \fIslave\fR is managed. The values are chosen
based upon the current layout of the grid, the position of the \fIslave\fR
relative to other \fIslave\fRs in the same grid command, and the presence
@@ -293,17 +310,20 @@ command where \fIslave\fR names are normally expected.
.RS
.TP
\fB\-\fR
-This increases the columnspan of the \fIslave\fR to the left. Several
-\fB\-\fR's in a row will successively increase the columnspan. A \fB\-\fR
+.
+This increases the \fB\-columnspan\fR of the \fIslave\fR to the left. Several
+\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR
may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIslave\fR
argument to \fBgrid configure\fR.
.TP
\fBx\fR
+.
This leaves an empty column between the \fIslave\fR on the left and
the \fIslave\fR on the right.
.TP
\fB^\fR
-This extends the \fBrowspan\fR of the \fIslave\fR above the \fB^\fR's
+.
+This extends the \fB\-rowspan\fR of the \fIslave\fR above the \fB^\fR's
in the grid. The number of \fB^\fR's in a row must match the number of
columns spanned by the \fIslave\fR above it.
.RE
@@ -320,12 +340,12 @@ For the final step, each slave is positioned in its row(s) and column(s)
based on the setting of its \fIsticky\fR flag.
.PP
To compute the minimum size of a layout, the grid geometry manager
-first looks at all slaves whose columnspan and rowspan values are one,
+first looks at all slaves whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one,
and computes the nominal size of each row or column to be either the
\fIminsize\fR for that row or column, or the sum of the \fIpad\fRding
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
+the slaves whose row-spans or column-spans 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\fR. For each
@@ -337,9 +357,9 @@ 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\fR will have exactly the same
size as any other row or column configured with \fB\-weight 1 \-uniform
-a\fR. A row or column configured with \fB\-weight 2 \-uniform b\fR will
+a\fR. 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\fR.
+\-uniform b\fR.
.PP
More technically, each row or column in the group will have a size
equal to \fIk*weight\fR for some constant \fIk\fR. The constant
@@ -348,18 +368,16 @@ 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
-.VS 8.5
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 placed within its master according to
the \fIanchor\fR value.
For masters whose size is smaller than the requested layout, space is taken
-away from columns and rows according to their weights. However, once a
+away from columns and rows according to their weights. However, once a
column or row shrinks to its minsize, its weight is taken to be zero.
If more space needs to be removed from a layout than would be permitted, as
when all the rows or columns are at their minimum sizes, the layout is
placed and clipped according to the \fIanchor\fR value.
-.VE 8.5
.SH "GEOMETRY PROPAGATION"
.PP
The grid geometry manager normally computes how large a master must be to
@@ -397,7 +415,9 @@ The \fBgrid\fR command is based on ideas taken from the \fIGridBag\fR
geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry
manager, written by George Howlett.
.SH EXAMPLES
+.PP
A toplevel window containing a text widget and two scrollbars:
+.PP
.CS
# Make the widgets
toplevel .t
@@ -417,6 +437,7 @@ scrollbar .t.h \-orient horizontal \-command {.t.txt xview}
Three widgets of equal width, despite their different
.QW natural
widths:
+.PP
.CS
button .b \-text "Foo"
entry .e \-variable foo
@@ -429,3 +450,6 @@ label .l \-text "This is a fairly long piece of text"
pack(n), place(n)
.SH KEYWORDS
geometry manager, location, grid, cell, propagation, size, pack
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/image.n b/doc/image.n
index e536916..ef547b9 100644
--- a/doc/image.n
+++ b/doc/image.n
@@ -14,7 +14,6 @@ image \- Create and manipulate images
.SH SYNOPSIS
\fBimage\fR \fIoption \fR?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBimage\fR command is used to create, delete, and query images.
@@ -94,9 +93,10 @@ See the \fBbitmap\fR manual entry for more information.
Displays a variety of full-color images, using dithering to
approximate colors on displays with limited color capabilities.
See the \fBphoto\fR manual entry for more information.
-
.SH "SEE ALSO"
bitmap(n), options(n), photo(n)
-
.SH KEYWORDS
height, image, types of images, width
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/keysyms.n b/doc/keysyms.n
index bab9d16..e85da8c 100644
--- a/doc/keysyms.n
+++ b/doc/keysyms.n
@@ -9,11 +9,11 @@
.SH NAME
keysyms \- keysyms recognized by Tk
.BE
-
.SH DESCRIPTION
.PP
-Tk recognizes many keysyms when specifying key bindings (e.g.
-\fBbind . <Key-\fR\fIkeysym\fR\fB>\fR). The following list enumerates the
+Tk recognizes many keysyms when specifying key bindings (e.g.,
+.QW "\fBbind\fR \fB. <Key-\fR\fIkeysym\fR\fB>\fR" ).
+The following list enumerates the
keysyms that will be recognized by Tk. Note that not all keysyms will
be valid on all platforms. For example, on Unix systems, the presence
of a particular keysym is dependant on the configuration of the
@@ -919,9 +919,10 @@ Hyper_L 65517 0xffed
Hyper_R 65518 0xffee
Delete 65535 0xffff
.CE
-
.SH "SEE ALSO"
-bind
-
+bind(n), event(n)
.SH KEYWORDS
-keysym, bind, binding
+bind, binding, event, keysym
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/label.n b/doc/label.n
index 5e1139a..7d768f5 100644
--- a/doc/label.n
+++ b/doc/label.n
@@ -34,10 +34,10 @@ from the size of the image or bitmap or text being displayed in it.
.OP \-state state State
Specifies one of three states for the label: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the button is displayed using the
-\fBforeground\fR and \fBbackground\fR options. In active state
-the label is displayed using the \fBactiveForeground\fR and
-\fBactiveBackground\fR options. In the disabled state the
-\fBdisabledForeground\fR and \fBbackground\fR options determine how
+\fB\-foreground\fR and \fB\-background\fR options. In active state
+the label is displayed using the \fB\-activeforeground\fR and
+\fB\-activebackground\fR options. In the disabled state the
+\fB\-disabledforeground\fR and \fB\-background\fR options determine how
the button is displayed.
.OP \-width width Width
Specifies a desired width for the label.
@@ -63,9 +63,9 @@ there must not exist a window named \fIpathName\fR, but
A label is a widget that displays a textual string, bitmap or image.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
-or if wrapping occurs because of the \fBwrapLength\fR option) and
+or if wrapping occurs because of the \fB\-wraplength\fR option) and
one of the characters may optionally be underlined using the
-\fBunderline\fR option.
+\fB\-underline\fR option.
The label can be manipulated in a few simple ways, such as
changing its relief or text, using the commands described below.
.SH "WIDGET COMMAND"
@@ -105,6 +105,7 @@ command.
When a new label is created, it has no default event bindings:
labels are not intended to be interactive.
.SH EXAMPLE
+.PP
.CS
# Make the widgets
\fBlabel\fR .t \-text "This widget is at the top" \-bg red
@@ -124,3 +125,6 @@ pack .mid \-expand 1 \-fill both
labelframe(n), button(n), ttk::label(n)
.SH KEYWORDS
label, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/labelframe.n b/doc/labelframe.n
index 70d04cb..2bb865d 100644
--- a/doc/labelframe.n
+++ b/doc/labelframe.n
@@ -21,7 +21,7 @@ labelframe \- Create and manipulate labelframe widgets
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
-This option is the same as the standard \fBbackground\fR option
+This option is the same as the standard \fB\-background\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
@@ -31,7 +31,7 @@ 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
+The \fB\-class\fR option may not be changed with the \fBconfigure\fR
widget command.
.OP \-colormap colormap Colormap
Specifies a colormap to use for the window.
@@ -40,7 +40,7 @@ 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
+If the \fB\-colormap\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.
@@ -66,7 +66,7 @@ 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
+The \fB\-visual\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
@@ -126,6 +126,7 @@ command.
When a new labelframe is created, it has no default event bindings:
labelframes are not intended to be interactive.
.SH EXAMPLE
+.PP
This shows how to build part of a GUI for a hamburger vendor. The
\fBlabelframe\fR widgets are used to organize the available choices by
the kinds of things that the choices are being made over.
@@ -169,3 +170,6 @@ set pickle none
frame(n), label(n), ttk::labelframe(n)
.SH KEYWORDS
labelframe, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/listbox.n b/doc/listbox.n
index 341ce9a..709b702 100644
--- a/doc/listbox.n
+++ b/doc/listbox.n
@@ -75,7 +75,7 @@ When first created, a new listbox has no elements.
Elements may be added or deleted using widget commands described
below. In addition, one or more elements may be selected as described
below.
-If a listbox is exporting its selection (see \fBexportSelection\fR
+If a listbox is exporting its selection (see \fB\-exportselection\fR
option), then it will observe the standard X11 protocols
for handling the selection.
Listbox selections are available as type \fBSTRING\fR;
@@ -85,8 +85,8 @@ newlines separating the elements.
It is not necessary for all the elements to be
displayed in the listbox window at once; commands described below
may be used to change the view in the window. Listboxes allow
-scrolling in both directions using the standard \fBxScrollCommand\fR
-and \fByScrollCommand\fR options.
+scrolling in both directions using the standard \fB\-xscrollcommand\fR
+and \fB\-yscrollcommand\fR options.
They also support scanning, as described below.
.SH "INDICES"
.PP
@@ -96,20 +96,24 @@ An index specifies a particular element of the listbox, in any of
the following ways:
.TP 12
\fInumber\fR
+.
Specifies the element as a numerical index, where 0 corresponds
to the first element in the listbox.
.TP 12
\fBactive\fR
+.
Indicates the element that has the location cursor. This element
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
+.
Indicates the anchor point for the selection, which is set with the
\fBselection anchor\fR widget command.
.TP 12
\fBend\fR
+.
Indicates the end of the listbox.
For most commands this refers to the last element in the listbox,
but for a few commands such as \fBindex\fR and \fBinsert\fR
@@ -138,6 +142,7 @@ determine the exact behavior of the command. The following
commands are possible for listbox widgets:
.TP
\fIpathName \fBactivate\fR \fIindex\fR
+.
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.
@@ -146,6 +151,7 @@ widget has the input focus, and its index may be retrieved with the
index \fBactive\fR.
.TP
\fIpathName \fBbbox\fR \fIindex\fR
+.
Returns a list of four numbers describing the bounding box of
the text in the element given by \fIindex\fR.
The first two elements of the list give the x and y coordinates
@@ -160,12 +166,14 @@ partially visible, the result gives the full area of the element,
including any parts that are not visible.
.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 \fBlistbox\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
@@ -180,18 +188,21 @@ this case the command returns an empty string.
command.
.TP
\fIpathName \fBcurselection\fR
+.
Returns a list containing the numerical indices of
all of the elements in the listbox that are currently selected.
If there are no elements selected in the listbox then an empty
string is returned.
.TP
\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
+.
Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR
are indices specifying the first and last elements in the range
to delete. If \fIlast\fR is not specified it defaults to
\fIfirst\fR, i.e. a single element is deleted.
.TP
\fIpathName \fBget \fIfirst\fR ?\fIlast\fR?
+.
If \fIlast\fR is omitted, returns the contents of the listbox
element indicated by \fIfirst\fR,
or an empty string if \fIfirst\fR refers to a non-existent element.
@@ -202,22 +213,26 @@ Both \fIfirst\fR and \fIlast\fR may have any of the standard
forms for indices.
.TP
\fIpathName \fBindex \fIindex\fR
+.
Returns the integer index value that corresponds to \fIindex\fR.
If \fIindex\fR is \fBend\fR the return value is a count of the number
of elements in the listbox (not the index of the last element).
.TP
\fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR?
+.
Inserts zero or more new elements in the list just before the
element given by \fIindex\fR. If \fIindex\fR is specified as
\fBend\fR then the new elements are added to the end of the
list. Returns an empty string.
.TP
\fIpathName \fBitemcget \fIindex option\fR
+.
Returns the current value of the item configuration option given
by \fIoption\fR. \fIOption\fR may have any of the values accepted
-by the \fBlistbox itemconfigure\fR command.
+by the \fBitemconfigure\fR command.
.TP
\fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
+.
Query or modify the configuration options of an item in the listbox.
If no \fIoption\fR is specified, returns a list describing all of
the available options for the item (see \fBTk_ConfigureInfo\fR for
@@ -232,40 +247,48 @@ are currently supported for items:
.RS
.TP
\fB\-background \fIcolor\fR
+.
\fIColor\fR specifies the background color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-foreground \fIcolor\fR
+.
\fIColor\fR specifies the foreground color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-selectbackground \fIcolor\fR
+.
\fIcolor\fR specifies the background color to use when displaying the
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.TP
\fB\-selectforeground \fIcolor\fR
+.
\fIcolor\fR specifies the foreground color to use when displaying the
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.RE
.TP
\fIpathName \fBnearest \fIy\fR
+.
Given a y-coordinate within the listbox window, this command returns
the index of the (visible) listbox element nearest to that y-coordinate.
.TP
\fIpathName \fBscan\fR \fIoption args\fR
+.
This command is used to implement scanning on listboxes. It has
two forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx y\fR
+.
Records \fIx\fR and \fIy\fR and the current view in the listbox
window; used in conjunction with later \fBscan dragto\fR commands.
Typically this command is associated with a mouse button press in
the widget. It returns an empty string.
.TP
\fIpathName \fBscan dragto \fIx y\fR.
+.
This command computes the difference between its \fIx\fR and \fIy\fR
arguments and the \fIx\fR and \fIy\fR arguments to the last
\fBscan mark\fR command for the widget.
@@ -277,6 +300,7 @@ value is an empty string.
.RE
.TP
\fIpathName \fBsee \fIindex\fR
+.
Adjust the view in the listbox so that the element given by \fIindex\fR
is visible.
If the element is already visible then the command has no effect;
@@ -285,11 +309,13 @@ scrolls to bring the element into view at the edge; otherwise
the listbox scrolls to center the element.
.TP
\fIpathName \fBselection \fIoption arg\fR
+.
This command is used to adjust the selection within a listbox. It
has several forms, depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBselection anchor \fIindex\fR
+.
Sets the selection anchor to the element given by \fIindex\fR.
If \fIindex\fR refers to a non-existent element, then the closest
element is used.
@@ -299,32 +325,38 @@ The index \fBanchor\fR may be used to refer to the anchor
element.
.TP
\fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR?
+.
If any of the elements between \fIfirst\fR and \fIlast\fR
(inclusive) are selected, they are deselected.
The selection state is not changed for elements outside
this range.
.TP
\fIpathName \fBselection includes \fIindex\fR
+.
Returns 1 if the element indicated by \fIindex\fR is currently
selected, 0 if it is not.
.TP
\fIpathName \fBselection set \fIfirst \fR?\fIlast\fR?
+.
Selects all of the elements in the range between
\fIfirst\fR and \fIlast\fR, inclusive, without affecting
the selection state of elements outside that range.
.RE
.TP
\fIpathName \fBsize\fR
+.
Returns a decimal string indicating the total number of elements
in the listbox.
.TP
-\fIpathName \fBxview \fIargs\fR
+\fIpathName \fBxview \fR?\fIargs\fR
+.
This command is used to query and change the horizontal position of the
information in the widget's window. It can take any of the following
forms:
.RS
.TP
\fIpathName \fBxview\fR
+.
Returns a list containing two elements.
Each element is a real fraction between 0 and 1; together they describe
the horizontal span that is visible in the window.
@@ -334,17 +366,20 @@ 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
+\fIpathName \fBxview \fIindex\fR
+.
Adjusts the view in the window so that the character position given by
\fIindex\fR is displayed at the left edge of the window.
Character positions are defined by the width of the character \fB0\fR.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
+.
Adjusts the view in the window so that \fIfraction\fR of the
total width of the listbox text is off-screen to the left.
\fIfraction\fR must be a fraction between 0 and 1.
.TP
\fIpathName \fBxview scroll \fInumber what\fR
+.
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
@@ -359,7 +394,8 @@ become visible; if it is positive then characters farther to the right
become visible.
.RE
.TP
-\fIpathName \fByview \fI?args\fR?
+\fIpathName \fByview \fR?\fIargs\fR?
+.
This command is used to query and change the vertical position of the
text in the widget's window.
It can take any of the following forms:
@@ -376,11 +412,13 @@ the last one in the window, relative to the listbox as a whole.
These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
option.
.TP
-\fIpathName \fByview\fR \fIindex\fR
+\fIpathName \fByview \fIindex\fR
+.
Adjusts the view in the window so that the element given by
\fIindex\fR is displayed at the top of the window.
.TP
\fIpathName \fByview moveto\fI fraction\fR
+.
Adjusts the view in the window so that the element given by \fIfraction\fR
appears at the top of the window.
\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
@@ -388,6 +426,7 @@ element in the listbox, 0.33 indicates the element one-third the
way through the listbox, and so on.
.TP
\fIpathName \fByview scroll \fInumber what\fR
+.
This command adjusts the view in the window up or down according to
\fInumber\fR and \fIwhat\fR.
\fINumber\fR must be an integer.
@@ -403,7 +442,7 @@ become visible.
.PP
Tk automatically creates class bindings for listboxes that give them
Motif-like behavior. Much of the behavior of a listbox is determined
-by its \fBselectMode\fR option, which selects one of four ways
+by its \fB\-selectmode\fR option, which selects one of four ways
of dealing with the selection.
.PP
If the selection mode is \fBsingle\fR or \fBbrowse\fR, at most one
@@ -412,10 +451,8 @@ In both modes, clicking button 1 on an element selects
it and deselects any other selected item.
In \fBbrowse\fR mode it is also possible to drag the selection
with button 1.
-.VS 8.5
On button 1, the listbox will also take focus if it has a \fBnormal\fR
state and \fB\-takefocus\fR is true.
-.VE 8.5
.PP
If the selection mode is \fBmultiple\fR or \fBextended\fR,
any number of elements may be selected at once, including discontiguous
@@ -533,6 +570,9 @@ a selection.
The behavior of listboxes can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH "SEE ALSO"
-ttk_treeview(n)
+ttk::treeview(n)
.SH KEYWORDS
listbox, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/loadTk.n b/doc/loadTk.n
index e1fecf6..6d4b070 100644
--- a/doc/loadTk.n
+++ b/doc/loadTk.n
@@ -9,73 +9,61 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-loadTk \- Load Tk into a safe interpreter.
+safe::loadTk \- Load Tk into a safe interpreter.
.SH SYNOPSIS
-\fB::safe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR?
+\fBsafe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR?
.BE
.SH DESCRIPTION
-Safe Tk is based on Safe Tcl, which provides a mechanism
-that allows restricted and mediated
-access to auto-loading and packages for safe interpreters.
-Safe Tk adds the ability to configure the interpreter
-for safe Tk operations and load Tk into safe
-interpreters.
.PP
-The \fB::safe::loadTk\fR command initializes the required data structures
-in the named safe interpreter and then loads Tk into it.
-The interpreter must have been created with \fB::safe::interpCreate\fR
-or have been initialized with \fB::safe::interpInit\fR.
-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
+Safe Tk is based on Safe Tcl, which provides a mechanism that allows
+restricted and mediated access to auto-loading and packages for safe
+interpreters. Safe Tk adds the ability to configure the interpreter for safe
+Tk operations and load Tk into safe interpreters.
+.PP
+The \fBsafe::loadTk\fR command initializes the required data structures in
+the named safe interpreter and then loads Tk into it. The interpreter must
+have been created with \fBsafe::interpCreate\fR or have been initialized
+with \fBsafe::interpInit\fR. 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
.QW .
-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 (e.g. \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
+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
+(e.g.,
+.QW \fB.x.y\fR )
+instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR).
+When \fB\-use\fR is not specified, a new toplevel window is created for the
.QW .
-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.
-
+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"
.PP
Please read the \fBsafe\fR manual page for Tcl to learn about the basic
security considerations for Safe Tcl.
.PP
-\fB::safe::loadTk\fR adds the value of \fBtk_library\fR taken from the master
+\fBsafe::loadTk\fR adds the value of \fBtk_library\fR taken from the master
interpreter to the virtual access path of the safe interpreter so that
auto-loading will work in the safe interpreter.
.PP
+Tk initialization is now safe with respect to not trusting the slave's state
+for startup. \fBsafe::loadTk\fR registers the slave's name so when the Tk
+initialization (\fBTk_SafeInit\fR) is called and in turn calls the master's
+\fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent
+(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.)
.PP
-Tk initialization is now safe with respect to not trusting
-the slave's state for startup. \fB::safe::loadTk\fR
-registers the slave's name so
-when the Tk initialization (\fBTk_SafeInit\fR) is called
-and in turn calls the master's \fB::safe::InitTk\fR it will
-return the desired \fBargv\fR equivalent (\fB\-use\fR
-\fIwindowId\fR, correct \fB\-display\fR, etc.)
-.PP
-When \fB\-use\fR is not used, the new toplevel created is specially
-decorated so the user is always aware that the user interface presented comes
-from a potentially unsafe code and can easily delete the corresponding
-interpreter.
+When \fB\-use\fR is not used, the new toplevel created is specially decorated
+so the user is always aware that the user interface presented comes from a
+potentially unsafe code and can easily delete the corresponding interpreter.
.PP
-On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely
-to generate a fatal X error.
-
+On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely to generate a
+fatal X error.
.SH "SEE ALSO"
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
+alias, auto-loading, auto_mkindex, load, master interpreter, safe
interpreter, slave interpreter, source
-
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/doc/lower.n b/doc/lower.n
index be8ca4e..0d8f252 100644
--- a/doc/lower.n
+++ b/doc/lower.n
@@ -14,7 +14,6 @@ lower \- Change a window's position in the stacking order
.SH SYNOPSIS
\fBlower \fIwindow \fR?\fIbelowThis\fR?
.BE
-
.SH DESCRIPTION
.PP
If the \fIbelowThis\fR argument is omitted then the command lowers
@@ -28,9 +27,14 @@ In this case the \fBlower\fR command will insert
\fIwindow\fR into the stacking order just below \fIbelowThis\fR
(or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR);
this could end up either raising or lowering \fIwindow\fR.
-
+.PP
+All \fBtoplevel\fR windows may be restacked with respect to each
+other, whatever their relative path names, but the window manager is
+not obligated to strictly honor requests to restack.
.SH "SEE ALSO"
raise
-
.SH KEYWORDS
lower, obscure, stacking order
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/menu.n b/doc/menu.n
index 7a92002..1d13404 100644
--- a/doc/menu.n
+++ b/doc/menu.n
@@ -40,6 +40,8 @@ top. If so, it will exist as entry 0 of the menu and the other
entries will number starting at 1. The default
menu bindings arrange for the menu to be torn off when the tear-off
entry is invoked.
+This option is ignored under Aqua/Mac OS X, where menus cannot
+be torn off.
.OP \-tearoffcommand tearOffCommand TearOffCommand
If this option has a non-empty value, then it specifies a Tcl command
to invoke whenever the menu is torn off. The actual command will
@@ -52,6 +54,8 @@ and menu \fB.x.y\fR is torn off to
create a new menu \fB.x.tearoff1\fR, then the command
.QW "\fBa b .x.y .x.tearoff1\fR"
will be invoked.
+This option is ignored under Aqua/Mac OS X, where menus cannot
+be torn off.
.OP \-title title Title
The string will be used to title the window created when this menu is
torn off. If the title is NULL, then the window will have the title
@@ -203,7 +207,7 @@ supported on Windows.
.SS "TEAR-OFF ENTRIES"
.PP
A tear-off entry appears at the top of the menu if enabled with the
-\fBtearOff\fR option. It is not like other menu entries in that
+\fB\-tearoff\fR option. It is not like other menu entries in that
it cannot be created with the \fBadd\fR widget command and
cannot be deleted with the \fBdelete\fR widget command.
When a tear-off entry is created it appears as a dashed line at
@@ -228,31 +232,43 @@ menubars, they may not be drawn with indicators on some platforms, due
to system restrictions.
.SS "SPECIAL MENUS IN MENUBARS"
.PP
-Certain menus in a menubar will be treated specially. On the
-Macintosh, access to the special Application and Help menus is
-provided. On Windows, access to the Windows System menu in each window
-is provided. On X Windows, a special right-justified help menu may be
-provided if Motif menu compatibility is enabled. In all cases, these
-menus must be created with the command name of the menubar menu
-concatenated with the special name. So for a menubar named .menubar,
-on the Macintosh, the special menus would be .menubar.apple
-and .menubar.help; on Windows, the special menu would be .menubar.system;
-on X Windows, the help menu would be .menubar.help.
-.PP
-When Tk sees a .menubar.apple menu on the Macintosh, that menu's contents
-make up the first items of the Application menu whenever the window
-containing the menubar is in front.
+Certain menus in a menubar will be treated specially. On the Macintosh,
+access to the special Application, Window and Help menus is provided. On
+Windows, access to the Windows System menu in each window is provided.
+On X Windows, a special right-justified help menu may be provided if
+Motif menu compatibility is enabled. In all
+cases, these menus must be created with the command name of the menubar
+menu concatenated with the special name. So for a menubar named
+\.menubar, on the Macintosh, the special menus would be .menubar.apple,
+\.menubar.window and .menubar.help; on Windows, the special menu would be
+\.menubar.system; on X Windows, the help menu would be .menubar.help.
+.PP
+When Tk sees a .menubar.apple menu as the first menu in a menubar on the
+Macintosh, that menu's contents make up the first items of the
+Application menu whenever the window containing the menubar is in front.
After all of the Tk-defined items, the menu will have a separator,
followed by all standard Application menu items.
+Such a .apple menu must be present in a menu when that menu is first
+configured as a toplevel's menubar, otherwise a default application menu
+(hidden from Tk) will be inserted into the menubar at that time and
+subsequent addition of a .apple menu will no longer result in it
+becoming the Application menu.
+.PP
+When Tk sees a .menubar.window menu on the Macintosh, the menu's
+contents are inserted into the standard Window menu of the user's
+menubar whenever the window's menubar is in front. The first items in
+the menu are provided by Mac OS X, and the names of the current
+toplevels are automatically appended after all the Tk-defined items and
+a separator.
.PP
-When Tk sees a Help menu on the Macintosh, the menu's contents are
-appended to the standard Help menu on the right of the user's menubar
-whenever the window's menubar is in front. The first items in the menu
+When Tk sees a .menubar.help menu on the Macintosh, the menu's contents
+are appended to the standard Help menu of the user's menubar whenever
+the window's menubar is in front. The first items in the menu
are provided by Mac OS X.
.PP
When Tk sees a System menu on Windows, its items are appended to the
-system menu that the menubar is attached to. This menu has an icon
-representing a spacebar, and can be invoked with the mouse or by typing
+system menu that the menubar is attached to. This menu is tied to the
+application icon and can be invoked with the mouse or by typing
Alt+Spacebar. Due to limitations in the Windows API, any font changes,
colors, images, bitmaps, or tearoff images will not appear in the
system menu.
@@ -290,24 +306,29 @@ indicators are called \fIindex\fRes and may be specified in
any of the following forms:
.TP 12
\fInumber\fR
+.
Specifies the entry numerically, where 0 corresponds
to the top-most entry of the menu, 1 to the entry below it, and
so on.
.TP 12
\fBactive\fR
+.
Indicates the entry that is currently active. If no entry is
active then this form is equivalent to \fBnone\fR. This form may
not be abbreviated.
.TP 12
\fBend\fR
+.
Indicates the bottommost entry in the menu. If there are no
entries in the menu then this form is equivalent to \fBnone\fR.
This form may not be abbreviated.
.TP 12
\fBlast\fR
+.
Same as \fBend\fR.
.TP 12
\fBnone\fR
+.
Indicates
.QW "no entry at all" ;
this is used most commonly with
@@ -317,6 +338,7 @@ nothing to happen in the widget command.
This form may not be abbreviated.
.TP 12
\fB@\fInumber\fR
+.
In this form, \fInumber\fR is treated as a y-coordinate in the
menu's window; the entry closest to that y-coordinate is used.
For example,
@@ -324,15 +346,17 @@ For example,
indicates the top-most entry in the window.
.TP 12
\fIpattern\fR
+.
If the index does not satisfy one of the above forms then this
form is used. \fIPattern\fR is pattern-matched against the label of
each entry in the menu, in order from the top down, until a
-matching entry is found. The rules of \fBTcl_StringMatch\fR
+matching entry is found. The rules of \fBstring match\fR
are used.
.PP
The following widget commands are possible for menu widgets:
.TP
\fIpathName \fBactivate \fIindex\fR
+.
Change the state of the entry indicated by \fIindex\fR to \fBactive\fR
and redisplay it using its active colors.
Any previously-active entry is deactivated. If \fIindex\fR
@@ -341,44 +365,185 @@ disabled, then the menu ends up with no active entry.
Returns an empty string.
.TP
\fIpathName \fBadd \fItype \fR?\fIoption value option value ...\fR?
+.
Add a new entry to the bottom of the menu. The new entry's type
is given by \fItype\fR and must be one of \fBcascade\fR,
\fBcheckbutton\fR, \fBcommand\fR, \fBradiobutton\fR, or \fBseparator\fR,
or a unique abbreviation of one of the above. If additional arguments
-are present, they specify any of the following options:
-.RS
+are present, they specify the options listed in the \fBMENU ENTRY OPTIONS\fR
+section below.
+The \fBadd\fR widget command returns an empty string.
+.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 \fBmenu\fR
+command.
+.TP
+\fIpathName \fBclone \fInewPathname\fR ?\fIcloneType\fR?
+.
+Makes a clone of the current menu named \fInewPathName\fR. This clone
+is a menu in its own right, but any changes to the clone are
+propagated to the original menu and vice versa. \fIcloneType\fR can be
+\fBnormal\fR, \fBmenubar\fR, or \fBtearoff\fR. Should not normally be
+called outside of the Tk library. See the \fBCLONES\fR section for
+more information.
+.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 \fBmenu\fR
+command.
+.TP
+\fIpathName \fBdelete \fIindex1\fR ?\fIindex2\fR?
+.
+Delete all of the menu entries between \fIindex1\fR and
+\fIindex2\fR inclusive.
+If \fIindex2\fR is omitted then it defaults to \fIindex1\fR.
+Attempts to delete a tear-off menu entry are ignored (instead, you
+should change the \fB\-tearoff\fR option to remove the tear-off entry).
+.TP
+\fIpathName \fBentrycget \fIindex option\fR
+.
+Returns the current value of a configuration option for
+the entry given by \fIindex\fR.
+\fIOption\fR may have any of the names described in the
+\fBMENU ENTRY OPTIONS\fR section below.
+.TP
+\fIpathName \fBentryconfigure \fIindex \fR?\fIoptions...\fR?
+.
+This command is similar to the \fBconfigure\fR command, except that
+it applies to the options for an individual entry, whereas \fBconfigure\fR
+applies to the options for the menu as a whole.
+\fIOptions\fR may have any of the values described in the
+\fBMENU ENTRY OPTIONS\fR
+section below. If \fIoptions\fR are specified, options are
+modified as indicated in the command and the command returns an empty string.
+If no \fIoptions\fR are specified, returns a list describing
+the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for
+information on the format of this list).
+.TP
+\fIpathName \fBindex \fIindex\fR
+.
+Returns the numerical index corresponding to \fIindex\fR, or
+\fBnone\fR if \fIindex\fR was specified as \fBnone\fR.
+.TP
+\fIpathName \fBinsert \fIindex type \fR?\fIoption value option value ...\fR?
+.
+Same as the \fBadd\fR widget command except that it inserts the new
+entry just before the entry given by \fIindex\fR, instead of appending
+to the end of the menu. The \fItype\fR, \fIoption\fR, and \fIvalue\fR
+arguments have the same interpretation as for the \fBadd\fR widget
+command. It is not possible to insert new menu entries before the
+tear-off entry, if the menu has one.
+.TP
+\fIpathName \fBinvoke \fIindex\fR
+.
+Invoke the action of the menu entry. See the sections on the
+individual entries above for details on what happens. If the
+menu entry is disabled then nothing happens. If the
+entry has a command associated with it then the result of that
+command is returned as the result of the \fBinvoke\fR widget
+command. Otherwise the result is an empty string. Note: invoking
+a menu entry does not automatically unpost the menu; the default
+bindings normally take care of this before invoking the \fBinvoke\fR
+widget command.
+.TP
+\fIpathName \fBpost \fIx y\fR
+.
+Arrange for the menu to be displayed on the screen at the root-window
+coordinates given by \fIx\fR and \fIy\fR. These coordinates are
+adjusted if necessary to guarantee that the entire menu is visible on
+the screen. This command normally returns an empty string.
+If the \fB\-postcommand\fR option has been specified, then its value is
+executed as a Tcl script before posting the menu and the result of
+that script is returned as the result of the \fBpost\fR widget
+command.
+If an error returns while executing the command, then the error is
+returned without posting the menu.
+.TP
+\fIpathName \fBpostcascade \fIindex\fR
+.
+Posts the submenu associated with the cascade entry given by
+\fIindex\fR, and unposts any previously posted submenu.
+If \fIindex\fR does not correspond to a cascade entry,
+or if \fIpathName\fR is not posted,
+the command has no effect except to unpost any currently posted
+submenu.
+.TP
+\fIpathName \fBtype \fIindex\fR
+.
+Returns the type of the menu entry given by \fIindex\fR.
+This is the \fItype\fR argument passed to the \fBadd\fR or \fBinsert\fR widget
+command when the entry was created, such as \fBcommand\fR
+or \fBseparator\fR, or \fBtearoff\fR for a tear-off entry.
+.TP
+\fIpathName \fBunpost\fR
+.
+Unmap the window so that it is no longer displayed. If a
+lower-level cascaded menu is posted, unpost that menu. Returns an
+empty string. This subcommand does not work on Windows and the
+Macintosh, as those platforms have their own way of unposting menus.
+.TP
+\fIpathName \fBxposition \fIindex\fR
+.
+Returns a decimal string giving the x-coordinate within the menu
+window of the leftmost pixel in the entry specified by \fIindex\fR.
+.TP
+\fIpathName \fByposition \fIindex\fR
+.
+Returns a decimal string giving the y-coordinate within the menu
+window of the topmost pixel in the entry specified by \fIindex\fR.
+.SH "MENU ENTRY OPTIONS"
+The following options are allowed on menu entries. Most options are not
+supported by all entry types.
.TP
\fB\-activebackground \fIvalue\fR
+.
Specifies a background color to use for displaying this entry when it
is active.
If this option is specified as an empty string (the default), then the
-\fBactiveBackground\fR option for the overall menu is used.
+\fB\-activebackground\fR option for the overall menu is used.
If the \fBtk_strictMotif\fR variable has been set to request strict
Motif compliance, then this option is ignored and the \fB\-background\fR
option is used in its place.
This option is not available for separator or tear-off entries.
.TP
\fB\-activeforeground \fIvalue\fR
+.
Specifies a foreground color to use for displaying this entry when it
is active.
If this option is specified as an empty string (the default), then the
-\fBactiveForeground\fR option for the overall menu is used.
+\fB\-activeforeground\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-accelerator \fIvalue\fR
+.
Specifies a string to display at the right side of the menu entry.
Normally describes an accelerator keystroke sequence that may be
typed to invoke the same function as the menu entry. This option
is not available for separator or tear-off entries.
.TP
\fB\-background \fIvalue\fR
+.
Specifies a background color to use for displaying this entry when it
is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the
-\fBbackground\fR option for the overall menu is used.
+\fB\-background\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-bitmap \fIvalue\fR
+.
Specifies a bitmap to display in the menu instead of a textual
label, in any of the forms accepted by \fBTk_GetBitmap\fR.
This option overrides the \fB\-label\fR option
@@ -390,15 +555,20 @@ If a \fB\-image\fR option has been specified, it overrides
This option is not available for separator or tear-off entries.
.TP
\fB\-columnbreak \fIvalue\fR
+.
When this option is zero, the entry appears below the previous entry. When
this option is one, the entry appears at the top of a new column in the
menu.
+This option is ignored on Aqua/Mac OS X, where menus are always a single
+column.
.TP
\fB\-command \fIvalue\fR
+.
Specifies a Tcl command to execute when the menu entry is invoked.
Not available for separator or tear-off entries.
.TP
\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,
@@ -408,26 +578,30 @@ text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
options.
.TP
\fB\-font \fIvalue\fR
+.
Specifies the font to use when drawing the label or accelerator
string in this entry.
If this option is specified as an empty string (the default) then
-the \fBfont\fR option for the overall menu is used.
+the \fB\-font\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-foreground \fIvalue\fR
+.
Specifies a foreground color to use for displaying this entry when it
is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the
-\fBforeground\fR option for the overall menu is used.
+\fB\-foreground\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-hidemargin \fIvalue\fR
+.
Specifies whether the standard margins should be drawn for this menu
entry. This is useful when creating palette with images in them, i.e.,
color palettes, pattern palettes, etc. 1 indicates that the margin for
the entry is hidden; 0 means that the margin is used.
.TP
\fB\-image \fIvalue\fR
+.
Specifies an image to display in the menu instead of a text string
or bitmap.
The image must have been created by some previous invocation of
@@ -439,36 +613,43 @@ bitmap label to be displayed.
This option is not available for separator or tear-off entries.
.TP
\fB\-indicatoron \fIvalue\fR
+.
Available only for checkbutton and radiobutton entries.
\fIValue\fR is a boolean that determines whether or not the
indicator should be displayed.
.TP
\fB\-label \fIvalue\fR
+.
Specifies a string to display as an identifying label in the menu
entry. Not available for separator or tear-off entries.
.TP
\fB\-menu \fIvalue\fR
+.
Available only for cascade entries. Specifies the path name of
the submenu associated with this entry.
The submenu must be a child of the menu.
.TP
\fB\-offvalue \fIvalue\fR
+.
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is
deselected.
.TP
\fB\-onvalue \fIvalue\fR
+.
Available only for checkbutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
.TP
\fB\-selectcolor \fIvalue\fR
+.
Available only for checkbutton and radiobutton entries.
Specifies the color to display in the indicator when the entry is
selected.
-If the value is an empty string (the default) then the \fBselectColor\fR
+If the value is an empty string (the default) then the \fB\-selectcolor\fR
option for the menu determines the indicator color.
.TP
\fB\-selectimage \fIvalue\fR
+.
Available only for checkbutton and radiobutton entries.
Specifies an image to display in the entry (in place of
the \fB\-image\fR option) when it is selected.
@@ -478,22 +659,24 @@ This option is ignored unless the \fB\-image\fR option has
been specified.
.TP
\fB\-state \fIvalue\fR
+.
Specifies one of three states for the entry: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the entry is displayed using the
-\fBforeground\fR option for the menu and the \fBbackground\fR
+\fB\-foreground\fR option for the menu and the \fB\-background\fR
option from the entry or the menu.
The active state is typically used when the pointer is over the entry.
-In active state the entry is displayed using the \fBactiveForeground\fR
-option for the menu along with the \fBactivebackground\fR option from
+In active state the entry is displayed using the \fB\-activeforeground\fR
+option for the menu along with the \fB\-activebackground\fR option from
the entry. Disabled state means that the entry
should be insensitive: the default bindings will refuse to activate
or invoke the entry.
In this state the entry is displayed according to the
-\fBdisabledForeground\fR option for the menu and the
-\fBbackground\fR option from the entry.
+\fB\-disabledforeground\fR option for the menu and the
+\fB\-background\fR option from the entry.
This option is not available for separator entries.
.TP
\fB\-underline \fIvalue\fR
+.
Specifies the integer index of a character to underline in the entry.
This option is also queried by the default bindings and used to
implement keyboard traversal.
@@ -503,143 +686,32 @@ If a bitmap or image is displayed in the entry then this option is ignored.
This option is not available for separator or tear-off entries.
.TP
\fB\-value \fIvalue\fR
+.
Available only for radiobutton entries. Specifies the value to
store in the entry's associated variable when the entry is selected.
If an empty string is specified, then the \fB\-label\fR option
for the entry as the value to store in the variable.
.TP
\fB\-variable \fIvalue\fR
+.
Available only for checkbutton and radiobutton entries. Specifies
the name of a global variable to set when the entry is selected.
For checkbutton entries the variable is also set when the entry
is deselected. For radiobutton entries, changing the variable
causes the currently-selected entry to deselect itself.
-.LP
-The \fBadd\fR widget command returns an empty string.
+.RS
+.PP
+For checkbutton entries, the default value of this option is taken from the
+\fB\-label\fR option, and for radiobutton entries a single fixed value is
+used. It is recommended that you always set the \fB\-variable\fR option when
+creating either a checkbutton or a radiobutton.
.RE
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-Returns the current value of the configuration option given
-by \fIoption\fR.
-\fIOption\fR may have any of the values accepted by the \fBmenu\fR
-command.
-.TP
-\fIpathName\fR \fBclone\fR \fInewPathname ?cloneType?\fR
-Makes a clone of the current menu named \fInewPathName\fR. This clone
-is a menu in its own right, but any changes to the clone are
-propagated to the original menu and vice versa. \fIcloneType\fR can be
-\fBnormal\fR, \fBmenubar\fR, or \fBtearoff\fR. Should not normally be
-called outside of the Tk library. See the \fBCLONES\fR section for
-more information.
-.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 \fBmenu\fR
-command.
-.TP
-\fIpathName \fBdelete \fIindex1\fR ?\fIindex2\fR?
-Delete all of the menu entries between \fIindex1\fR and
-\fIindex2\fR inclusive.
-If \fIindex2\fR is omitted then it defaults to \fIindex1\fR.
-Attempts to delete a tear-off menu entry are ignored (instead, you
-should change the \fBtearOff\fR option to remove the tear-off entry).
-.TP
-\fIpathName \fBentrycget\fR \fIindex option\fR
-Returns the current value of a configuration option for
-the entry given by \fIindex\fR.
-\fIOption\fR may have any of the values accepted by the \fBadd\fR
-widget command.
-.TP
-\fIpathName \fBentryconfigure \fIindex \fR?\fIoptions\fR?
-This command is similar to the \fBconfigure\fR command, except that
-it applies to the options for an individual entry, whereas \fBconfigure\fR
-applies to the options for the menu as a whole.
-\fIOptions\fR may have any of the values accepted by the \fBadd\fR
-widget command. If \fIoptions\fR are specified, options are modified
-as indicated
-in the command and the command returns an empty string.
-If no \fIoptions\fR are specified, returns a list describing
-the current options for entry \fIindex\fR (see \fBTk_ConfigureInfo\fR for
-information on the format of this list).
-.TP
-\fIpathName \fBindex \fIindex\fR
-Returns the numerical index corresponding to \fIindex\fR, or
-\fBnone\fR if \fIindex\fR was specified as \fBnone\fR.
-.TP
-\fIpathName \fBinsert \fIindex\fR \fItype \fR?\fIoption value option value ...\fR?
-Same as the \fBadd\fR widget command except that it inserts the new
-entry just before the entry given by \fIindex\fR, instead of appending
-to the end of the menu. The \fItype\fR, \fIoption\fR, and \fIvalue\fR
-arguments have the same interpretation as for the \fBadd\fR widget
-command. It is not possible to insert new menu entries before the
-tear-off entry, if the menu has one.
-.TP
-\fIpathName \fBinvoke \fIindex\fR
-Invoke the action of the menu entry. See the sections on the
-individual entries above for details on what happens. If the
-menu entry is disabled then nothing happens. If the
-entry has a command associated with it then the result of that
-command is returned as the result of the \fBinvoke\fR widget
-command. Otherwise the result is an empty string. Note: invoking
-a menu entry does not automatically unpost the menu; the default
-bindings normally take care of this before invoking the \fBinvoke\fR
-widget command.
-.TP
-\fIpathName \fBpost \fIx y\fR
-Arrange for the menu to be displayed on the screen at the root-window
-coordinates given by \fIx\fR and \fIy\fR. These coordinates are
-adjusted if necessary to guarantee that the entire menu is visible on
-the screen. This command normally returns an empty string.
-If the \fBpostCommand\fR option has been specified, then its value is
-executed as a Tcl script before posting the menu and the result of
-that script is returned as the result of the \fBpost\fR widget
-command.
-If an error returns while executing the command, then the error is
-returned without posting the menu.
-.TP
-\fIpathName \fBpostcascade \fIindex\fR
-Posts the submenu associated with the cascade entry given by
-\fIindex\fR, and unposts any previously posted submenu.
-If \fIindex\fR does not correspond to a cascade entry,
-or if \fIpathName\fR is not posted,
-the command has no effect except to unpost any currently posted
-submenu.
-.TP
-\fIpathName \fBtype \fIindex\fR
-Returns the type of the menu entry given by \fIindex\fR.
-This is the \fItype\fR argument passed to the \fBadd\fR widget
-command when the entry was created, such as \fBcommand\fR
-or \fBseparator\fR, or \fBtearoff\fR for a tear-off entry.
-.TP
-\fIpathName \fBunpost\fR
-Unmap the window so that it is no longer displayed. If a
-lower-level cascaded menu is posted, unpost that menu. Returns an
-empty string. This subcommand does not work on Windows and the
-Macintosh, as those platforms have their own way of unposting menus.
-.TP
-\fIpathName \fBxposition \fIindex\fR
-.VS 8.5
-Returns a decimal string giving the x-coordinate within the menu
-window of the leftmost pixel in the entry specified by \fIindex\fR.
-.VE 8.5
-.TP
-\fIpathName \fByposition \fIindex\fR
-Returns a decimal string giving the y-coordinate within the menu
-window of the topmost pixel in the entry specified by \fIindex\fR.
.SH "MENU CONFIGURATIONS"
.PP
The default bindings support four different ways of using menus:
.TP
\fBPulldown Menus in Menubar\fR
+.
This is the most common case. You create a menu widget that will become the
menu bar. You then add cascade entries to this menu, specifying the
pull down menus you wish to use in your menu bar. You then create all
@@ -648,6 +720,7 @@ of the pulldowns. Once you have done this, specify the menu using the
\fBtoplevel\fR manual entry for details.
.TP
\fBPulldown Menus in Menu Buttons\fR
+.
This is the compatible way to do menu bars. You create one menubutton
widget for each top-level menu, and typically you arrange a series of
menubuttons in a row in a menubar window. You also create the top-level menus
@@ -659,12 +732,14 @@ will allow users to traverse and invoke the tree of menus via its
menubutton; see the \fBmenubutton\fR manual entry for details.
.TP
\fBPopup Menus\fR
+.
Popup menus typically post in response to a mouse button press or
keystroke. You create the popup menus and any cascaded submenus,
then you call the \fBtk_popup\fR procedure at the appropriate time
to post the top-level menu.
.TP
\fBOption Menus\fR
+.
An option menu consists of a menubutton with an associated menu
that allows you to select one of several values. The current value
is displayed in the menubutton and is also stored in a global
@@ -672,6 +747,7 @@ variable. Use the \fBtk_optionMenu\fR procedure to create option
menubuttons and their menus.
.TP
\fBTorn-off Menus\fR
+.
You create a torn-off menu by invoking the tear-off entry at
the top of an existing menu. The default bindings will create a new menu
that is a copy of the original menu and leave it permanently
@@ -746,3 +822,6 @@ entries.
bind(n), menubutton(n), ttk::menubutton(n), toplevel(n)
.SH KEYWORDS
menu, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/menubar.n b/doc/menubar.n
index 34fd2e7..0f6dd83 100644
--- a/doc/menubar.n
+++ b/doc/menubar.n
@@ -16,7 +16,6 @@ tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars
.sp
\fBtk_bindForTraversal \fIarg arg ... \fR
.BE
-
.SH DESCRIPTION
.PP
These procedures were used in Tk 3.6 and earlier releases to help
@@ -30,9 +29,10 @@ procedures will go away.
From Tk 8.0 onwards, you should instead construct your menubar as a
normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your
choice using the \fB\-menu\fR option of that widget.
-
.SH "SEE ALSO"
menu(n), toplevel(n)
-
.SH KEYWORDS
keyboard traversal, menu, menu bar, post
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/menubutton.n b/doc/menubutton.n
index ade9523..c8b0958 100644
--- a/doc/menubutton.n
+++ b/doc/menubutton.n
@@ -53,12 +53,12 @@ Specifies one of three states for the menubutton: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the menubutton is displayed using the
\fBforeground\fR and \fBbackground\fR options. The active state is
typically used when the pointer is over the menubutton. In active state
-the menubutton is displayed using the \fBactiveForeground\fR and
-\fBactiveBackground\fR options. Disabled state means that the menubutton
+the menubutton is displayed using the \fB\-activeforeground\fR and
+\fB\-activebackground\fR options. Disabled state means that the menubutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
-In this state the \fBdisabledForeground\fR and
-\fBbackground\fR options determine how the button is displayed.
+In this state the \fB\-disabledforeground\fR and
+\fB\-background\fR options determine how the button is displayed.
.OP \-width width Width
Specifies a desired width for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
@@ -84,9 +84,9 @@ A menubutton is a widget that displays a textual string, bitmap, or image
and is associated with a menu widget.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
-or if wrapping occurs because of the \fBwrapLength\fR option) and
+or if wrapping occurs because of the \fB\-wraplength\fR option) and
one of the characters may optionally be underlined using the
-\fBunderline\fR option. In normal usage, pressing
+\fB\-underline\fR option. In normal usage, pressing
mouse button 1 over the menubutton causes the associated menu to
be posted just underneath the menubutton. If the mouse is moved over
the menu before releasing the mouse button, the button release
@@ -117,7 +117,7 @@ operations on the widget. It has the following general form:
determine the exact behavior of the command. The following
commands are possible for menubutton widgets:
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\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 \fBmenubutton\fR
@@ -168,7 +168,7 @@ When a menubutton is posted, its associated menu claims the input
focus to allow keyboard traversal of the menu and its submenus.
See the \fBmenu\fR manual entry for details on these bindings.
.IP [7]
-If the \fBunderline\fR option has been specified for a menubutton
+If the \fB\-underline\fR option has been specified for a menubutton
then keyboard traversal may be used to post the menubutton:
Alt+\fIx\fR, where \fIx\fR is the underlined character (or its
lower-case or upper-case equivalent), may be typed in any window
@@ -189,3 +189,6 @@ individual widgets or by redefining the class bindings.
ttk::menubutton(n), menu(n)
.SH KEYWORDS
menubutton, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/message.n b/doc/message.n
index 92434f0..61be2f0 100644
--- a/doc/message.n
+++ b/doc/message.n
@@ -28,37 +28,37 @@ aspect ratio for the text. The aspect ratio is specified as
be as wide as it is tall, 200 means the text should
be twice as wide as it is tall, 50 means the text should
be twice as tall as it is wide, and so on.
-Used to choose line length for text if \fBwidth\fR option
+Used to choose line length for text if \fB\-width\fR option
is not specified.
Defaults to 150.
.OP \-justify justify Justify
Specifies how to justify lines of text.
Must be one of \fBleft\fR, \fBcenter\fR, or \fBright\fR. Defaults
to \fBleft\fR.
-This option works together with the \fBanchor\fR, \fBaspect\fR,
-\fBpadX\fR, \fBpadY\fR, and \fBwidth\fR options to provide a variety
+This option works together with the \fB\-anchor\fR, \fB\-aspect\fR,
+\fB\-padx\fR, \fB\-pady\fR, and \fB\-width\fR options to provide a variety
of arrangements of the text within the window.
-The \fBaspect\fR and \fBwidth\fR options determine the amount of
+The \fB\-aspect\fR and \fB\-width\fR options determine the amount of
screen space needed to display the text.
-The \fBanchor\fR, \fBpadX\fR, and \fBpadY\fR options determine where this
+The \fB\-anchor\fR, \fB\-padx\fR, and \fB\-pady\fR options determine where this
rectangular area is displayed within the widget's window, and the
-\fBjustify\fR option determines how each line is displayed within that
+\fB\-justify\fR option determines how each line is displayed within that
rectangular region.
-For example, suppose \fBanchor\fR is \fBe\fR and \fBjustify\fR is
+For example, suppose \fB\-anchor\fR is \fBe\fR and \fB\-justify\fR is
\fBleft\fR, and that the message window is much larger than needed
for the text.
The text will be displayed so that the left edges of all the lines
-line up and the right edge of the longest line is \fBpadX\fR from
+line up and the right edge of the longest line is \fB\-padx\fR from
the right side of the window; the entire text block will be centered
in the vertical span of the window.
.OP \-width width Width
Specifies the length of lines in the window.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
-If this option has a value greater than zero then the \fBaspect\fR
-option is ignored and the \fBwidth\fR option determines the line
+If this option has a value greater than zero then the \fB\-aspect\fR
+option is ignored and the \fB\-width\fR option determines the line
length.
If this option has a value less than or equal to zero, then
-the \fBaspect\fR option determines the line length.
+the \fB\-aspect\fR option determines the line length.
.BE
.SH DESCRIPTION
.PP
@@ -111,7 +111,7 @@ operations on the widget. It has the following general form:
determine the exact behavior of the command. The following
commands are possible for message widgets:
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\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 \fBmessage\fR
@@ -142,3 +142,6 @@ The most common result is that the line is justified wrong.
label(n)
.SH KEYWORDS
message, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/messageBox.n b/doc/messageBox.n
index 5cdd26e..db24f76 100644
--- a/doc/messageBox.n
+++ b/doc/messageBox.n
@@ -13,7 +13,6 @@ tk_messageBox \- pops up a message window and waits for user response.
.SH SYNOPSIS
\fBtk_messageBox \fR?\fIoption value ...\fR?
.BE
-
.SH DESCRIPTION
.PP
This procedure creates and displays a message window with an
@@ -22,70 +21,84 @@ the buttons in the message window is identified by a unique symbolic
name (see the \fB\-type\fR options). After the message window is
popped up, \fBtk_messageBox\fR waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
-
+.PP
The following option-value pairs are supported:
.TP
\fB\-default\fR \fIname\fR
+.
\fIName\fR gives the symbolic name of the default button for
this message window (
.QW ok ,
.QW cancel ,
-and so on). See \fB\-type\fR
+and so on). See \fB\-type\fR
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\-detail\fR \fIstring\fR
-.VS 8.5
+.
Specifies an auxiliary message to the main message given by the
-\fB\-message\fR option. Where supported by the underlying OS, the
-message detail will be presented in a less emphasized font than the
+\fB\-message\fR option. The message detail will be presented beneath the main
+message and, where supported by the OS, in a less emphasized font than the
main message.
-.VE 8.5
.TP
\fB\-icon\fR \fIiconImage\fR
+.
Specifies an icon to display. \fIIconImage\fR must be one of the
following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or
\fBwarning\fR. If this option is not specified, then the info icon will be
displayed.
.TP
\fB\-message\fR \fIstring\fR
-Specifies the message to display in this message box.
+.
+Specifies the message to display in this message box. This option is ignored
+on Mac OS X, where platform guidelines forbid the use of a title on this kind
+of dialog.
.TP
\fB\-parent\fR \fIwindow\fR
+.
Makes \fIwindow\fR the logical parent of the message box. The message
box is displayed on top of its parent window.
.TP
\fB\-title\fR \fItitleString\fR
+.
Specifies a string to display as the title of the message box. The
default value is an empty string.
.TP
\fB\-type\fR \fIpredefinedType\fR
+.
Arranges for a predefined set of buttons to be displayed. The
following values are possible for \fIpredefinedType\fR:
.RS
.TP 18
\fBabortretryignore\fR
+.
Displays three buttons whose symbolic names are \fBabort\fR,
\fBretry\fR and \fBignore\fR.
.TP 18
\fBok\fR
+.
Displays one button whose symbolic name is \fBok\fR.
.TP 18
\fBokcancel\fR
+.
Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR.
.TP 18
\fBretrycancel\fR
+.
Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR.
.TP 18
\fByesno\fR
+.
Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR.
.TP 18
\fByesnocancel\fR
+.
Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR
and \fBcancel\fR.
.RE
.PP
.SH EXAMPLE
+.PP
.CS
set answer [\fBtk_messageBox\fR \-message "Really quit?" \e
\-icon question \-type yesno \e
@@ -96,6 +109,8 @@ switch \-\- $answer {
\-type ok}
}
.CE
-
.SH KEYWORDS
message box
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/option.n b/doc/option.n
index b7342e2..4b9a5a7 100644
--- a/doc/option.n
+++ b/doc/option.n
@@ -26,8 +26,8 @@ database or to retrieve options from the database. The \fBadd\fR
form of the command adds a new option to the database.
\fIPattern\fR contains
the option being specified, and consists of names and/or classes
-separated by asterisks or dots, in the usual X format (see \fBPATTERN
-FORMAT\fR). \fIValue\fR
+separated by asterisks or dots, in the usual X format (see
+\fBPATTERN FORMAT\fR). \fIValue\fR
contains a text string to associate with \fIpattern\fR; this is the
value that will be returned in calls to \fBTk_GetOption\fR or by
invocations of the \fBoption get\fR command. If \fIpriority\fR
@@ -63,22 +63,18 @@ The \fIpriority\fR arguments to the \fBoption\fR command are
normally specified symbolically using one of the following values:
.TP
\fBwidgetDefault\fR
-.
Level 20. Used for default values hard-coded into widgets.
.TP
\fBstartupFile\fR
-.
Level 40. Used for options specified in application-specific
startup files.
.TP
\fBuserDefault\fR
-.
Level 60. Used for options specified in user-specific defaults
files, such as \fB.Xdefaults\fR, resource databases loaded into
the X server, or user-specific startup files.
.TP
\fBinteractive\fR
-.
Level 80. Used for options specified interactively after the application
starts running. If \fIpriority\fR is not specified, it defaults to
this level.
@@ -113,8 +109,10 @@ first word of the pattern is matched against the name and class of the
.QW \fB.\fR
\fBtoplevel\fR, which are usually set by options to \fBwish\fR.
.SH EXAMPLES
+.PP
Instruct every button in the application to have red text on it unless
-explicitly overridden (note that on some platforms the option is ignored):
+explicitly overridden, by setting the \fBforeground\fR for the \fBButton\fR
+class (note that on some platforms the option is ignored):
.CS
\fBoption add\fR *Button.foreground red startupFile
.CE
diff --git a/doc/optionMenu.n b/doc/optionMenu.n
index 1f9f831..1c01eb0 100644
--- a/doc/optionMenu.n
+++ b/doc/optionMenu.n
@@ -33,9 +33,13 @@ The return value from \fBtk_optionMenu\fR is the name of the menu
associated with \fIpathName\fR, so that the caller can change its
configuration options or manipulate it in other ways.
.SH EXAMPLE
+.PP
.CS
tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble
pack .foo
.CE
.SH KEYWORDS
option menu
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/options.n b/doc/options.n
index 25b0c9d..456e1fd 100644
--- a/doc/options.n
+++ b/doc/options.n
@@ -12,8 +12,8 @@
.SH NAME
options \- Standard options supported by widgets
.BE
-
.SH DESCRIPTION
+.PP
This manual entry describes the common configuration options supported
by widgets in the Tk toolkit. Every widget does not necessarily support
every option (see the manual entries for individual widgets for a list
@@ -72,18 +72,18 @@ widget.
Specifies a bitmap to display in the widget, in any of the forms
acceptable to \fBTk_GetBitmap\fR.
The exact way in which the bitmap is displayed may be affected by
-other options such as \fBanchor\fR or \fBjustify\fR.
+other options such as \fB\-anchor\fR or \fB\-justify\fR.
Typically, if this option is specified then it overrides other
options that specify a textual value to display in the widget
-but this is controlled by the \fBcompound\fR option;
-the \fBbitmap\fR option may be reset to an empty string to re-enable
+but this is controlled by the \fB\-compound\fR option;
+the \fB\-bitmap\fR option may be reset to an empty string to re-enable
a text display.
-In widgets that support both \fBbitmap\fR and \fBimage\fR options,
-\fBimage\fR will usually override \fBbitmap\fR.
+In widgets that support both \fB\-bitmap\fR and \fB\-image\fR options,
+\fB\-image\fR will usually override \fB\-bitmap\fR.
.OP "\-borderwidth or \-bd" borderWidth BorderWidth
Specifies a non-negative value indicating the width
of the 3-D border to draw around the outside of the widget (if such a
-border is being drawn; the \fBrelief\fR option typically determines
+border is being drawn; the \fB\-relief\fR option typically determines
this). The value may also be used when drawing 3-D effects in the
interior of the widget.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
@@ -139,10 +139,10 @@ If the value is zero, no focus highlight is drawn around the widget.
.OP \-image image Image
Specifies an image to display in the widget, which must have been
created with the \fBimage create\fR command.
-Typically, if the \fBimage\fR option is specified then it overrides other
+Typically, if the \fB\-image\fR option is specified then it overrides other
options that specify a bitmap or textual value to display in the
-widget, though this is controlled by the \fBcompound\fR option;
-the \fBimage\fR option may be reset to an empty string to re-enable
+widget, though this is controlled by the \fB\-compound\fR option;
+the \fB\-image\fR option may be reset to an empty string to re-enable
a bitmap or text display.
.OP \-insertbackground insertBackground Foreground
Specifies the color to use as background in the area covered by the
@@ -169,8 +169,8 @@ in each blink cycle.
Specifies a value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
If a border has been specified for the insertion
-cursor (using the \fBinsertBorderWidth\fR option), the border
-will be drawn inside the width specified by the \fBinsertWidth\fR
+cursor (using the \fB\-insertborderwidth\fR option), the border
+will be drawn inside the width specified by the \fB\-insertwidth\fR
option.
.OP \-jump jump Jump
For widgets with a slider that can be dragged to adjust a value,
@@ -235,7 +235,7 @@ Specifies the number of milliseconds a button or key must be held
down before it begins to auto-repeat. Used, for example, on the
up- and down-arrows in scrollbars.
.OP \-repeatinterval repeatInterval RepeatInterval
-Used in conjunction with \fBrepeatDelay\fR: once auto-repeat
+Used in conjunction with \fB\-repeatdelay\fR: once auto-repeat
begins, this option determines the number of milliseconds between
auto-repeats.
.OP \-selectbackground selectBackground Foreground
@@ -255,7 +255,7 @@ This option is typically used in text widgets, where the information
in the widget has a natural size (the size of a character) and it makes
sense for the window's dimensions to be integral numbers of these units.
These natural window sizes form a grid.
-If the \fBsetGrid\fR option is set to true then the widget will
+If the \fB\-setgrid\fR option is set to true then the widget will
communicate with the window manager so that when the user interactively
resizes the top-level window that contains the widget, the dimensions of
the window will be displayed to the user in grid units and the window
@@ -266,7 +266,7 @@ entry for more details.
Determines whether the window accepts the focus during keyboard
traversal (e.g., Tab and Shift-Tab).
Before setting the focus to a window, the traversal scripts
-consult the value of the \fBtakeFocus\fR option.
+consult the value of the \fB\-takefocus\fR option.
A value of \fB0\fR means that the window should be skipped entirely
during keyboard traversal.
\fB1\fR means that the window should receive the input
@@ -289,14 +289,14 @@ redefine the keyboard traversal scripts.
.OP \-text text Text
Specifies a string to be displayed inside the widget. The way in which
the string is displayed depends on the particular widget and may be
-determined by other options, such as \fBanchor\fR or \fBjustify\fR.
+determined by other options, such as \fB\-anchor\fR or \fB\-justify\fR.
.OP \-textvariable textVariable Variable
Specifies the name of a global variable. The value of the variable is a text
string to be displayed inside the widget; if the variable value changes
then the widget will automatically update itself to reflect the new value.
The way in which the string is displayed in the widget depends on the
particular widget and may be determined by other options, such as
-\fBanchor\fR or \fBjustify\fR.
+\fB\-anchor\fR or \fB\-justify\fR.
.OP \-troughcolor troughColor Background
Specifies the color to use for the rectangular trough areas
in widgets such as scrollbars and scales. This option is ignored for
@@ -334,7 +334,7 @@ that is visible in the window, and the second fraction indicates
the information just after the last portion that is visible.
The command is
then passed to the Tcl interpreter for execution. Typically the
-\fBxScrollCommand\fR option consists of the path name of a scrollbar
+\fB\-xscrollcommand\fR option consists of the path name of a scrollbar
widget followed by
.QW set ,
e.g.
@@ -345,13 +345,14 @@ If this option is not specified, then no command will be executed.
.OP \-yscrollcommand yScrollCommand ScrollCommand
Specifies the prefix for a command used to communicate with vertical
scrollbars. This option is treated in the same way as the
-\fBxScrollCommand\fR option, except that it is used for vertical
+\fB\-xscrollcommand\fR option, except that it is used for vertical
scrollbars and is provided by widgets that support vertical scrolling.
-See the description of \fBxScrollCommand\fR for details
+See the description of \fB\-xscrollcommand\fR for details
on how this option is used.
-
.SH "SEE ALSO"
colors, cursors, font
-
.SH KEYWORDS
class, name, standard option, switch
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/pack-old.n b/doc/pack-old.n
index 532b4ae..a027b1f 100644
--- a/doc/pack-old.n
+++ b/doc/pack-old.n
@@ -20,7 +20,6 @@ pack-old \- Obsolete syntax for packer geometry manager
.sp
\fBpack unpack \fIwindow\fR
.BE
-
.SH DESCRIPTION
.PP
\fINote: this manual entry describes the syntax for the \fBpack\fI
@@ -189,6 +188,8 @@ The packer makes geometry requests on behalf of the parent windows
it manages. For each parent window it requests a size large enough
to accommodate all the options specified by all the packed children,
such that zero space would be leftover for \fBexpand\fR options.
-
.SH KEYWORDS
geometry manager, location, packer, parcel, size
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/pack.n b/doc/pack.n
index 0809337..4df48f2 100644
--- a/doc/pack.n
+++ b/doc/pack.n
@@ -14,7 +14,6 @@ pack \- Geometry manager that packs around edges of cavity
.SH SYNOPSIS
\fBpack \fIoption arg \fR?\fIarg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBpack\fR command is used to communicate with the packer,
@@ -259,6 +258,7 @@ will be highest in the stacking order.
Or, you can use the \fBraise\fR and \fBlower\fR commands to change
the stacking order of either the master or the slave.
.SH EXAMPLE
+.PP
.CS
# Make the widgets
label .t \-text "This widget is at the top" \-bg red
@@ -274,9 +274,10 @@ text .mid
\fBpack\fR .r \-side right \-fill y
\fBpack\fR .mid \-expand 1 \-fill both
.CE
-
.SH "SEE ALSO"
grid(n), place(n)
-
.SH KEYWORDS
geometry manager, location, packer, parcel, propagation, size
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/palette.n b/doc/palette.n
index 4b1dcff..d654959 100644
--- a/doc/palette.n
+++ b/doc/palette.n
@@ -17,7 +17,6 @@ tk_setPalette, tk_bisque \- Modify the Tk color palette
.sp
\fBtk_bisque\fR
.BE
-
.SH DESCRIPTION
.PP
The \fBtk_setPalette\fR procedure changes the color scheme for Tk.
@@ -67,6 +66,8 @@ The procedure \fBtk_bisque\fR is provided for backward compatibility:
it restores the application's colors to the light brown
.PQ bisque
color scheme used in Tk 3.6 and earlier versions.
-
.SH KEYWORDS
bisque, color, palette
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/panedwindow.n b/doc/panedwindow.n
index ccc87e7..17d5730 100644
--- a/doc/panedwindow.n
+++ b/doc/panedwindow.n
@@ -81,7 +81,8 @@ 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
+\fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption 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.
@@ -89,11 +90,13 @@ followed by pairs of arguments that specify how to manage the windows.
\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
+\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
@@ -106,11 +109,13 @@ 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
+\fIpathName \fBforget \fIwindow \fR?\fIwindow ...\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
@@ -118,53 +123,63 @@ 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
+\fIpathName \fBproxy \fR?\fIargs\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
+\fIpathName \fBsash \fR?\fIargs\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.
.TP
\fIpathName \fBsash dragto \fIindex x y\fR
+.
This command computes the difference between the given coordinates and the
coordinates given to the last \fBsash mark\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 \fBsash dragto\fR 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
+\fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue 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
@@ -179,14 +194,17 @@ 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
@@ -195,13 +213,13 @@ 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\-hide \fIboolean\fR
-.VS 8.5
+.
Controls the visibility of a pane. When the \fIboolean\fR is true
(according to \fBTcl_GetBoolean\fR) the pane will not be visible, but
it will still be maintained in the list of panes.
-.VE 8.5
.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 \(em the x dimension for horizontal panedwindows, the y
@@ -209,16 +227,19 @@ 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
@@ -232,7 +253,7 @@ are specified, the window will be stretched to fill the entire height
(or width) of its cavity.
.TP
\fB\-stretch \fIwhen\fR
-.VS 8.5
+.
Controls how extra space is allocated to each of the panes.
\fIWhen\fR is one of \fBalways\fR, \fBfirst\fR, \fBlast\fR,
\fBmiddle\fR, and \fBnever\fR.
@@ -244,25 +265,30 @@ definition:
.RS
.TP
\fBalways\fR
+.
This pane will always stretch.
.TP
\fBfirst\fR
-Only if this pane is the first pane (left-most or top-most) will it
+.
+Only if this pane is the first pane (left-most or top-most) will it
stretch.
.TP
\fBlast\fR
-Only if this pane is the last pane (right-most or bottom-most) will it
+.
+Only if this pane is the last pane (right-most or bottom-most) will it
stretch. This is the default value.
.TP
\fBmiddle\fR
+.
Only if this pane is not the first or last pane will it stretch.
.TP
\fBnever\fR
+.
This pane will never stretch.
.RE
-.VE 8.5
.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
@@ -272,8 +298,10 @@ 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"
+.PP
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
@@ -287,3 +315,6 @@ fill, and the containing toplevel is resized), space is added to the final
ttk::panedwindow(n)
.SH KEYWORDS
panedwindow, widget, geometry management
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/photo.n b/doc/photo.n
index c14abe3..f54dc2e 100644
--- a/doc/photo.n
+++ b/doc/photo.n
@@ -16,9 +16,22 @@
.SH NAME
photo \- Full-color images
.SH SYNOPSIS
+.nf
\fBimage create photo \fR?\fIname\fR? ?\fIoptions\fR?
-.BE
+\fIimageName \fBblank\fR
+\fIimageName \fBcget \fIoption\fR
+\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+\fIimageName \fBcopy \fIsourceImage\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBdata\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBget \fIx y\fR
+\fIimageName \fBput \fIdata\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBread \fIfilename\fR ?\fIoption value(s) ...\fR?
+\fIimageName \fBredither\fR
+\fIimageName \fBtransparency \fIsubcommand \fR?\fIarg arg ...\fR?
+\fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR?
+.fi
+.BE
.SH DESCRIPTION
.PP
A photo is an image whose pixels can display any color or be
@@ -26,7 +39,11 @@ transparent. A photo image is stored internally in full color (32
bits per pixel), and is displayed using dithering if necessary. Image
data for a photo image can be obtained from a file or a string, or it
can be supplied from
-C code through a procedural interface. At present, only GIF and PPM/PGM
+C code through a procedural interface. At present, only
+.VS 8.6
+PNG,
+.VE 8.6
+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
@@ -39,24 +56,29 @@ command.
Photos support the following \fIoptions\fR:
.TP
\fB\-data \fIstring\fR
+.
Specifies the contents of the image as a string. The string should
contain binary data or, for some formats, base64-encoded data (this is
-currently guaranteed to be supported for GIF images). The format of the
+currently guaranteed to be supported for PNG and GIF images). The
+format of the
string must be one of those for which there is an image file format
handler that will accept string data. If both the \fB\-data\fR
and \fB\-file\fR options are specified, the \fB\-file\fR option takes
precedence.
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the name of the file format for the data specified with the
\fB\-data\fR or \fB\-file\fR option.
.TP
\fB\-file \fIname\fR
+.
\fIname\fR gives the name of a file that is to be read to supply data
for the photo image. The file format must be one of those for which
there is an image file format handler that can read data.
.TP
\fB\-gamma \fIvalue\fR
+.
Specifies that the colors allocated for displaying this image in a
window should be corrected for a non-linear display with the specified
gamma exponent value. (The intensity produced by most
@@ -68,12 +90,14 @@ will make the image lighter, and values less than one will make it
darker.
.TP
\fB\-height \fInumber\fR
+.
Specifies the height of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
image to expand or shrink vertically to fit the data stored in it.
.TP
\fB\-palette \fIpalette-spec\fR
+.
Specifies the resolution of the color cube to be allocated for
displaying this image, and thus the number of colors used from the
colormaps of the windows where it is displayed. The
@@ -85,6 +109,7 @@ number) is used, the image will be displayed in monochrome (i.e.,
grayscale).
.TP
\fB\-width \fInumber\fR
+.
Specifies the width of the image, in pixels. This option is useful
primarily in situations where the user wishes to build up the contents
of the image piece by piece. A value of zero (the default) allows the
@@ -112,17 +137,20 @@ changed.
The following commands are possible for photo images:
.TP
\fIimageName \fBblank\fR
+.
Blank the image; that is, set the entire image to have no data, so it
will be displayed as transparent, and the background of whatever
window it is displayed in will show through.
.TP
\fIimageName \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
-\fBimage create photo\fR command.
+\fBimage create\fR \fBphoto\fR command.
.TP
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options for the image.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
@@ -134,9 +162,10 @@ 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.
\fIOption\fR may have any of the values accepted by the
-\fBimage create photo\fR command.
+\fBimage create\fR \fBphoto\fR command.
.TP
\fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR?
+.
Copies a region from the image called \fIsourceImage\fR (which must
be a photo image) to the image called \fIimageName\fR, possibly with
pixel zooming and/or subsampling. If no options are specified, this
@@ -146,6 +175,7 @@ options may be specified:
.RS
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the source image to be copied.
(\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite corners of
the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the
@@ -155,6 +185,7 @@ rectangle but not the bottom or right edges. If the \fB\-from\fR
option is not given, the default is the whole source image.
.TP
\fB\-to \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the destination image to be
affected. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite
corners of the rectangle. If \fIx2\fR and \fIy2\fR are not specified,
@@ -164,6 +195,7 @@ region (after subsampling and zooming, if specified). If \fIx2\fR and
necessary to fill the destination region in a tiled fashion.
.TP
\fB\-shrink\fR
+.
Specifies that the size of the destination image should be reduced, if
necessary, so that the region being copied into is at the bottom-right
corner of the image. This option will not affect the width or height
@@ -171,6 +203,7 @@ of the image if the user has specified a non-zero value for the
\fB\-width\fR or \fB\-height\fR configuration option, respectively.
.TP
\fB\-zoom \fIx y\fR
+.
Specifies that the source region should be magnified by a factor of
\fIx\fR in the X direction and \fIy\fR in the Y direction. If \fIy\fR
is not given, the default value is the same as \fIx\fR. With this
@@ -179,6 +212,7 @@ of \fIx\fR x \fIy\fR pixels in the destination image, all the same
color. \fIx\fR and \fIy\fR must be greater than 0.
.TP
\fB\-subsample \fIx y\fR
+.
Specifies that the source image should be reduced in size by using
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
@@ -186,6 +220,7 @@ 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
+.
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
@@ -196,17 +231,20 @@ the source image is used as-is. The default compositing rule is
\fIoverlay\fR.
.RE
.TP
-\fIimageName \fBdata ?\fIoption value(s) ...\fR?
+\fIimageName \fBdata\fR ?\fIoption value(s) ...\fR?
+.
Returns image data in the form of a string. The following options
may be specified:
.RS
.TP
\fB\-background\fI color\fR
+.
If the color is specified, the data will not contain any transparency
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.
Specifically, this subcommand searches
for the first handler whose name matches an initial substring of
@@ -220,6 +258,7 @@ format (where \fIrr\fR is a pair of hexadecimal digits for the red
channel, \fIgg\fR for green, and \fIbb\fR for blue).
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
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
@@ -229,16 +268,19 @@ 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
information. All pixel data will be transformed into grayscale.
.RE
.TP
\fIimageName \fBget\fR \fIx y\fR
+.
Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the
image as a list of three integers between 0 and 255, representing the
red, green and blue components respectively.
.TP
\fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR?
+.
Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR.
This command first searches the list of image file format handlers for
a handler that can interpret the data in \fIdata\fR, and then reads
@@ -253,12 +295,14 @@ that color. The following options may be specified:
.RS
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the format of the image data in \fIdata\fR.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
.TP
\fB\-to \fIx1 y1\fR ?\fIx2 y2\fR?
+.
Specifies the coordinates of the top-left corner (\fIx1\fR,\fIy1\fR)
of the region of \fIimageName\fR into which the image data will be
copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given
@@ -270,6 +314,7 @@ represented by (\fIx2\fR,\fIy2\fR) will be filled with that color.
.RE
.TP
\fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR?
+.
Reads image data from the file named \fIfilename\fR into the image.
This command first searches the list of
image file format handlers for a handler that can interpret the data
@@ -279,12 +324,14 @@ specified:
.RS
.TP
\fB\-format \fIformat-name\fR
+.
Specifies the format of the image data in \fIfilename\fR.
Specifically, only image file format handlers whose names begin with
\fIformat-name\fR will be used while searching for an image data
format handler to read the data.
.TP
\fB\-from \fIx1 y1 x2 y2\fR
+.
Specifies a rectangular sub-region of the image file data to be copied
to the destination image. If only \fIx1\fR and \fIy1\fR are
specified, the region extends from (\fIx1,y1\fR) to the bottom-right
@@ -294,6 +341,7 @@ The default, if this option is not specified, is the whole of the
image in the image file.
.TP
\fB\-shrink\fR
+.
If this option, the size of \fIimageName\fR will be reduced, if
necessary, so that the region into which the image file data are read
is at the bottom-right corner of the \fIimageName\fR. This option
@@ -302,12 +350,14 @@ specified a non-zero value for the \fB\-width\fR or \fB\-height\fR
configuration option, respectively.
.TP
\fB\-to \fIx y\fR
+.
Specifies the coordinates of the top-left corner of the region of
\fIimageName\fR into which data from \fIfilename\fR are to be read.
The default is (0,0).
.RE
.TP
\fIimageName \fBredither\fR
+.
The dithering algorithm used in displaying photo images propagates
quantization errors from one pixel to its neighbors.
If the image data for \fIimageName\fR is supplied in pieces, the
@@ -316,39 +366,47 @@ 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
+\fIimageName \fBtransparency \fIsubcommand \fR?\fIarg arg ...\fR?
+.
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.
.TP
\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
.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:
.RS
.TP
\fB\-background\fI color\fR
+.
If the color is specified, the data will not contain any transparency
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
for the first handler whose name matches an 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.
+file. If this option is not given, the format is guessed from
+the file extension. If that cannot be determined, this subcommand
+uses the first handler that has the capability to write an image file.
.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
extends from \fI(x1,y1)\fR to the bottom-right corner of
@@ -357,6 +415,7 @@ diagonally opposite corners of the rectangular region. 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
information. All pixel data will be transformed into grayscale.
.RE
@@ -366,8 +425,8 @@ The photo image code is structured to allow handlers for additional
image file formats to be added easily. The photo image code maintains
a list of these handlers. Handlers are added to the list by
registering them with a call to \fBTk_CreatePhotoImageFormat\fR. The
-standard Tk distribution comes with handlers for PPM/PGM and GIF formats,
-which are automatically registered on initialization.
+standard Tk distribution comes with handlers for PPM/PGM, PNG and GIF
+formats, which are automatically registered on initialization.
.PP
When reading an image file or processing
string data specified with the \fB\-data\fR configuration option, the
@@ -391,6 +450,27 @@ that, which the handler can use, for example, to specify which variant
to use of the formats supported by the handler.
Note that not all image handlers may support writing transparency data
to a file, even where the target image format does.
+.SS "FORMAT SUBOPTIONS"
+.PP
+.VS 8.6
+Some image formats support sub-options, which are specified at the time that
+the image is loaded using additional words in the \fB\-format\fR option. At
+the time of writing, the following are supported:
+.TP
+\fBgif \-index\fI indexValue\fR
+.
+When parsing a multi-part GIF image, Tk normally only accesses the first
+image. By giving the \fB\-index\fR sub-option, the \fIindexValue\fR'th value
+may be used instead. The \fIindexValue\fR must be an integer from 0 up to the
+number of image parts in the GIF data.
+.TP
+\fBpng \-alpha\fI alphaValue\fR
+.
+An additional alpha filtering for the overall image, which allows the
+background on which the image is displayed to show through. This usually also
+has the effect of desaturating the image. The \fIalphaValue\fR must be between
+0.0 and 1.0.
+.VE 8.6
.SH "COLOR ALLOCATION"
.PP
When a photo image is displayed in a window, the photo image code
@@ -426,8 +506,10 @@ The photo image type was designed and implemented by Paul Mackerras,
based on his earlier photo widget and some suggestions from
John Ousterhout.
.SH EXAMPLE
+.PP
Load an image from a file and tile it to the size of a window, which
is useful for producing a tiled background:
+.PP
.CS
# These lines should be called once
\fBimage create photo\fR untiled \-file "theFile.ppm"
@@ -439,9 +521,23 @@ set width [winfo width .someWidget]
set height [winfo height .someWidget]
tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink
.CE
-
+.PP
+.VS 8.6
+The PNG image loader allows the application of an additional alpha factor
+during loading, which is useful for generating images suitable for disabled
+buttons:
+.PP
+.CS
+\fBimage create photo\fR icon \-file "icon.png"
+\fBimage create photo\fR iconDisabled \-file "icon.png" \e
+ \-format "png \-alpha 0.5"
+button .b \-image icon \-disabledimage iconDisabled
+.CE
+.VE 8.6
.SH "SEE ALSO"
image(n)
-
.SH KEYWORDS
photo, image, color
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/place.n b/doc/place.n
index fc7e0fb..af1ea43 100644
--- a/doc/place.n
+++ b/doc/place.n
@@ -14,7 +14,6 @@ place \- Geometry manager for fixed or rubber-sheet placement
.SH SYNOPSIS
\fBplace \fIoption arg \fR?\fIarg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The placer is a geometry manager for Tk.
@@ -48,9 +47,9 @@ 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
+.PP
+The following \fIoption\-value\fR pairs are supported:
.TP
\fB\-anchor \fIwhere\fR
\fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
@@ -73,7 +72,8 @@ 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.
-
+.RS
+.PP
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
@@ -83,6 +83,7 @@ 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.
+.RE
.TP
\fB\-height \fIsize\fR
\fISize\fR specifies the height for \fIwindow\fR in screen units
@@ -238,15 +239,17 @@ set their requested sizes).
To control the sizes of these windows, make them windows like
frames and canvases that provide configuration options for this purpose.
.SH EXAMPLE
+.PP
Make the label occupy the middle bit of the toplevel, no matter how it
is resized:
.CS
label .l \-text "In the\enMiddle!" \-bg black \-fg white
\fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35
.CE
-
.SH "SEE ALSO"
grid(n), pack(n)
-
.SH KEYWORDS
geometry manager, height, location, master, place, rubber sheet, slave, width
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/popup.n b/doc/popup.n
index 7b7d69f..2dea83f 100644
--- a/doc/popup.n
+++ b/doc/popup.n
@@ -13,7 +13,6 @@ tk_popup \- Post a popup menu
.SH SYNOPSIS
\fBtk_popup \fImenu x y \fR?\fIentry\fR?
.BE
-
.SH DESCRIPTION
.PP
This procedure posts a menu at a given position on the screen and
@@ -27,6 +26,7 @@ Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and
the menu will be positioned so that the entry is positioned over
the given point.
.SH EXAMPLE
+.PP
How to attach a simple popup menu to a widget.
.CS
# Create a menu
@@ -40,9 +40,10 @@ pack [label .l \-text "Click me!"]
# Arrange for the menu to pop up when the label is clicked
bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y}
.CE
-
.SH "SEE ALSO"
bind(n), menu(n), tk_optionMenu(n)
-
.SH KEYWORDS
menu, popup
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/radiobutton.n b/doc/radiobutton.n
index 29c2eec..983b43e 100644
--- a/doc/radiobutton.n
+++ b/doc/radiobutton.n
@@ -38,16 +38,16 @@ If this option is not specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
.OP \-indicatoron indicatorOn IndicatorOn
Specifies whether or not the indicator should be drawn. Must be a
-proper boolean value. If false, the \fBrelief\fR option is
+proper boolean value. If false, the \fB\-relief\fR option is
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
.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.
+If \fB\-indicatoron\fR is true then the color applies to the indicator.
Under Windows, this color is used as the background for the indicator
regardless of the select state.
-If \fBindicatorOn\fR is false, this color is used as the background
-for the entire widget, in place of \fBbackground\fR or \fBactiveBackground\fR,
+If \fB\-indicatoron\fR is false, this color is used as the background
+for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\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.
@@ -72,34 +72,30 @@ 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.
.OP \-selectimage selectImage SelectImage
-Specifies an image to display (in place of the \fBimage\fR option)
+Specifies an image to display (in place of the \fB\-image\fR option)
when the radiobutton is selected.
-This option is ignored unless the \fBimage\fR option has been
+This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-state state State
Specifies one of three states for the radiobutton: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the radiobutton is displayed using the
-\fBforeground\fR and \fBbackground\fR options. The active state is
+\fB\-foreground\fR and \fB\-background\fR options. The active state is
typically used when the pointer is over the radiobutton. In active state
-the radiobutton is displayed using the \fBactiveForeground\fR and
-\fBactiveBackground\fR options. Disabled state means that the radiobutton
+the radiobutton is displayed using the \fB\-activeforeground\fR and
+\fB\-activebackground\fR options. Disabled state means that the radiobutton
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
-In this state the \fBdisabledForeground\fR and
-\fBbackground\fR options determine how the radiobutton is displayed.
+In this state the \fB\-disabledforeground\fR and
+\fB\-background\fR options determine how the radiobutton is displayed.
.OP \-tristateimage tristateImage TristateImage
-.VS 8.5
-Specifies an image to display (in place of the \fBimage\fR option)
+Specifies an image to display (in place of the \fB\-image\fR option)
when the radiobutton is selected.
-This option is ignored unless the \fBimage\fR option has been
+This option is ignored unless the \fB\-image\fR option has been
specified.
-.VE 8.5
.OP \-tristatevalue tristateValue Value
-.VS 8.5
-Specifies the value that causes the radiobutton to display the multi-value
+Specifies the value that causes the radiobutton to display the multi-value
selection, also known as the tri-state mode. Defaults to
.QW "" .
-.VE 8.5
.OP \-value value Value
Specifies value to store in the button's associated variable whenever
this button is selected.
@@ -133,11 +129,11 @@ A radiobutton is a widget that displays a textual string, bitmap or image
and a diamond or circle called an \fIindicator\fR.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
-or if wrapping occurs because of the \fBwrapLength\fR option) and
+or if wrapping occurs because of the \fB\-wraplength\fR option) and
one of the characters may optionally be underlined using the
-\fBunderline\fR option. A radiobutton has
+\fB\-underline\fR option. A radiobutton has
all of the behavior of a simple button: it can display itself in either
-of three different ways, according to the \fBstate\fR option;
+of three different ways, according to the \fB\-state\fR option;
it can be made to appear
raised, sunken, or flat; it can be made to flash; and it invokes
a Tcl command whenever mouse button 1 is clicked over the
@@ -160,12 +156,10 @@ When a radiobutton is selected it sets the value of the variable to
indicate that fact; each radiobutton also monitors the value of
the variable and automatically selects and deselects itself when the
variable's value changes.
-.VS 8.5
-If the variable's value matches the \fBtristateValue\fR, then the radiobutton is
-drawn using the tri-state mode. This mode is used to indicate mixed or
-multiple values. (This is used when the radiobutton represents the state
+If the variable's value matches the \fB\-tristatevalue\fR, then the radiobutton
+is drawn using the tri-state mode. This mode is used to indicate mixed or
+multiple values. (This is used when the radiobutton represents the state
of multiple items.)
-.VE 8.5
By default the variable \fBselectedButton\fR
is used; its contents give the name of the button that is
selected, or the empty string if no button associated with that
@@ -190,12 +184,14 @@ determine the exact behavior of the command. The following
commands are possible for radiobutton 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 \fBradiobutton\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
@@ -210,12 +206,14 @@ this case the command returns an empty string.
command.
.TP
\fIpathName \fBdeselect\fR
+.
Deselects the radiobutton and sets the associated variable to an
empty string.
If this radiobutton was not currently selected, the command has
no effect.
.TP
\fIpathName \fBflash\fR
+.
Flashes the radiobutton. This is accomplished by redisplaying the radiobutton
several times, alternating between active and normal colors. At
the end of the flash the radiobutton is left in the same normal/active
@@ -223,6 +221,7 @@ state as when the command was invoked.
This command is ignored if the radiobutton's state is \fBdisabled\fR.
.TP
\fIpathName \fBinvoke\fR
+.
Does just what would have happened if the user invoked the radiobutton
with the mouse: selects the button and invokes
its associated Tcl command, if there is one.
@@ -231,6 +230,7 @@ empty string if there is no command associated with the radiobutton.
This command is ignored if the radiobutton's state is \fBdisabled\fR.
.TP
\fIpathName \fBselect\fR
+.
Selects the radiobutton and sets the associated variable to the
value corresponding to this widget.
.SH BINDINGS
@@ -261,3 +261,6 @@ individual widgets or by redefining the class bindings.
checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n)
.SH KEYWORDS
radiobutton, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/raise.n b/doc/raise.n
index 02f805f..b2856c1 100644
--- a/doc/raise.n
+++ b/doc/raise.n
@@ -14,7 +14,6 @@ raise \- Change a window's position in the stacking order
.SH SYNOPSIS
\fBraise \fIwindow \fR?\fIaboveThis\fR?
.BE
-
.SH DESCRIPTION
.PP
If the \fIaboveThis\fR argument is omitted then the command raises
@@ -28,7 +27,12 @@ In this case the \fBraise\fR command will insert
\fIwindow\fR into the stacking order just above \fIaboveThis\fR
(or the ancestor of \fIaboveThis\fR that is a sibling of \fIwindow\fR);
this could end up either raising or lowering \fIwindow\fR.
+.PP
+All \fBtoplevel\fR windows may be restacked with respect to each
+other, whatever their relative path names, but the window manager is
+not obligated to strictly honor requests to restack.
.SH EXAMPLE
+.PP
Make a button appear to be in a sibling frame that was created after
it. This is is often necessary when building GUIs in the style where
you create your activity widgets first before laying them out on the
@@ -41,9 +45,10 @@ pack .b \-in .f
pack [label .f.l2 \-text "This is below"]
\fBraise\fR .b
.CE
-
.SH "SEE ALSO"
lower(n)
-
.SH KEYWORDS
obscure, raise, stacking order
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/scale.n b/doc/scale.n
index e750fdd..c8e722a 100644
--- a/doc/scale.n
+++ b/doc/scale.n
@@ -74,7 +74,7 @@ Specifies one of three states for the scale: \fBnormal\fR,
If the scale is disabled then the value may not be changed and the scale
will not activate.
If the scale is active, the slider is displayed using the color
-specified by the \fBactiveBackground\fR option.
+specified by the \fB\-activebackground\fR option.
.OP \-tickinterval tickInterval TickInterval
Must be a real value.
Determines the spacing between numerical
@@ -83,7 +83,7 @@ If 0, no tick marks will be displayed.
.OP \-to to To
Specifies a real value corresponding
to the right or bottom end of the scale.
-This value may be either less than or greater than the \fBfrom\fR option.
+This value may be either less than or greater than the \fB\-from\fR option.
.OP \-variable variable Variable
Specifies the name of a global variable to link to the scale. Whenever the
value of the variable changes, the scale will update to reflect this
@@ -96,7 +96,6 @@ Specifies the desired narrow dimension of the trough in screen units
For vertical scales this is the trough's width; for horizontal scales
this is the trough's height.
.BE
-
.SH DESCRIPTION
.PP
The \fBscale\fR command creates a new window (given by the
@@ -112,16 +111,16 @@ there must not exist a window named \fIpathName\fR, but
.PP
A scale is a widget that displays a rectangular \fItrough\fR and a
small \fIslider\fR. The trough corresponds to a range
-of real values (determined by the \fBfrom\fR, \fBto\fR, and
-\fBresolution\fR options),
+of real values (determined by the \fB\-from\fR, \fB\-to\fR, and
+\fB\-resolution\fR options),
and the position of the slider selects a particular real value.
The slider's position (and hence the scale's value) may be adjusted
with the mouse or keyboard as described in the \fBBINDINGS\fR
section below. Whenever the scale's value is changed, a Tcl
-command is invoked (using the \fBcommand\fR option) to notify
+command is invoked (using the \fB\-command\fR option) to notify
other interested widgets of the change.
In addition, the value
-of the scale can be linked to a Tcl variable (using the \fBvariable\fR
+of the scale can be linked to a Tcl variable (using the \fB\-variable\fR
option), so that changes in either are reflected in the other.
.PP
Three annotations may be displayed in a scale widget: a label
@@ -146,12 +145,14 @@ determine the exact behavior of the command. The following
commands are possible for scale 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 \fBscale\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
@@ -166,12 +167,14 @@ this case the command returns an empty string.
command.
.TP
\fIpathName \fBcoords \fR?\fIvalue\fR?
+.
Returns a list whose elements are the x and y coordinates of
the point along the centerline of the trough that corresponds
to \fIvalue\fR.
If \fIvalue\fR is omitted then the scale's current value is used.
.TP
\fIpathName \fBget\fR ?\fIx y\fR?
+.
If \fIx\fR and \fIy\fR are omitted, returns the current value
of the scale. If \fIx\fR and \fIy\fR are specified, they give
pixel coordinates within the widget; the command returns
@@ -179,7 +182,8 @@ the scale value corresponding to the given pixel.
Only one of \fIx\fR or \fIy\fR is used: for horizontal scales
\fIy\fR is ignored, and for vertical scales \fIx\fR is ignored.
.TP
-\fIpathName \fBidentify\fR \fIx y\fR
+\fIpathName \fBidentify \fIx y\fR
+.
Returns a string indicating what part of the scale lies under
the coordinates given by \fIx\fR and \fIy\fR.
A return value of \fBslider\fR means that the point is over
@@ -190,7 +194,8 @@ of the slider below or to the right of the slider.
If the point is not over one of these elements, an empty string
is returned.
.TP
-\fIpathName \fBset\fR \fIvalue\fR
+\fIpathName \fBset \fIvalue\fR
+.
This command is invoked to change the current value of the scale,
and hence the position at which the slider is displayed. \fIValue\fR
gives the new value for the scale.
@@ -203,7 +208,7 @@ Where the behavior is different for vertical and horizontal scales,
the horizontal behavior is described in parentheses.
.IP [1]
If button 1 is pressed in the trough, the scale's value will
-be incremented or decremented by the value of the \fBresolution\fR
+be incremented or decremented by the value of the \fB\-resolution\fR
option so that the slider moves in the direction of the cursor.
If the button is held down, the action auto-repeats.
.IP [2]
@@ -219,26 +224,30 @@ position. If the mouse is dragged with button 2 down, the scale's
value changes with the drag.
.IP [5]
The Up and Left keys move the slider up (left) by the value
-of the \fBresolution\fR option.
+of the \fB\-resolution\fR option.
.IP [6]
The Down and Right keys move the slider down (right) by the value
-of the \fBresolution\fR option.
+of the \fB\-resolution\fR option.
.IP [7]
Control-Up and Control-Left move the slider up (left) by the
-value of the \fBbigIncrement\fR option.
+value of the \fB\-bigincrement\fR option.
.IP [8]
Control-Down and Control-Right move the slider down (right) by the
-value of the \fBbigIncrement\fR option.
+value of the \fB\-bigincrement\fR option.
.IP [9]
Home moves the slider to the top (left) end of its range.
.IP [10]
End moves the slider to the bottom (right) end of its range.
.PP
-If the scale is disabled using the \fBstate\fR option then
+If the scale is disabled using the \fB\-state\fR option then
none of the above bindings have any effect.
.PP
The behavior of scales can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "SEE ALSO"
+ttk::scale(n)
.SH KEYWORDS
scale, slider, trough, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/scrollbar.n b/doc/scrollbar.n
index a13574b..74fb977 100644
--- a/doc/scrollbar.n
+++ b/doc/scrollbar.n
@@ -42,7 +42,7 @@ as described in \fBSCROLLING COMMANDS\fR below.
Specifies the width of borders drawn around the internal elements
of the scrollbar (the two arrows and the slider). The value may
have any of the forms acceptable to \fBTk_GetPixels\fR.
-If this value is less than zero, the value of the \fBborderWidth\fR
+If this value is less than zero, the value of the \fB\-borderwidth\fR
option is used in its place.
.OP \-width width Width
Specifies the desired narrow dimension of the scrollbar window,
@@ -110,9 +110,10 @@ determine the exact behavior of the command. The following
commands are possible for scrollbar widgets:
.TP
\fIpathName \fBactivate \fR?\fIelement\fR?
+.
Marks the element indicated by \fIelement\fR as active, which
-causes it to be displayed as specified by the \fBactiveBackground\fR
-and \fBactiveRelief\fR options.
+causes it to be displayed as specified by the \fB\-activebackground\fR
+and \fB\-activerelief\fR options.
The only element values understood by this command are \fBarrow1\fR,
\fBslider\fR, or \fBarrow2\fR.
If any other value is specified then no element of the scrollbar
@@ -121,13 +122,15 @@ If \fIelement\fR is not specified, the command returns
the name of the element that is currently active, or an empty string
if no element is active.
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\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 \fBscrollbar\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
@@ -142,6 +145,7 @@ this case the command returns an empty string.
command.
.TP
\fIpathName \fBdelta \fIdeltaX deltaY\fR
+.
Returns a real number indicating the fractional change in
the scrollbar setting that corresponds to a given change
in slider position. For example, if the scrollbar is horizontal,
@@ -153,6 +157,7 @@ scrollbar setting must change to move the slider \fIdeltaY\fR pixels
down. The arguments and the result may be zero or negative.
.TP
\fIpathName \fBfraction \fIx y\fR
+.
Returns a real number between 0 and 1 indicating where the point
given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar.
The value 0 corresponds to the top or left of the trough, the
@@ -164,17 +169,20 @@ If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest
point in the trough is used.
.TP
\fIpathName \fBget\fR
+.
Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent \fBset\fR widget command.
.TP
-\fIpathName \fBidentify\fR \fIx y\fR
+\fIpathName \fBidentify \fIx y\fR
+.
Returns the name of the element under the point given by \fIx\fR and
\fIy\fR (such as \fBarrow1\fR), or an empty string if the point does
not lie in any element of the scrollbar.
\fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar
widget.
.TP
-\fIpathName \fBset\fR \fIfirst last\fR
+\fIpathName \fBset \fIfirst last\fR
+.
This command is invoked by the scrollbar's associated widget to
tell the scrollbar about the current view in the widget.
The command takes two arguments, each of which is a real fraction
@@ -194,9 +202,11 @@ The scrollbar makes the notification by evaluating a Tcl command
generated from the scrollbar's \fB\-command\fR option.
The command may take any of the following forms.
In each case, \fIprefix\fR is the contents of the
-\fB\-command\fR option, which usually has a form like \fB.t yview\fR
+\fB\-command\fR option, which usually has a form like
+.QW \fB.t yview\fR .
.TP
\fIprefix \fBmoveto \fIfraction\fR
+.
\fIFraction\fR is a real number between 0 and 1.
The widget should adjust its view so that the point given
by \fIfraction\fR appears at the beginning of the widget.
@@ -206,6 +216,7 @@ refers to a point one-third of the way through the document,
and so on.
.TP
\fIprefix \fBscroll \fInumber \fBunits\fR
+.
The widget should adjust its view by \fInumber\fR units.
The units are defined in whatever way makes sense for the widget,
such as characters or lines in a text widget.
@@ -214,6 +225,7 @@ the top or left of the window, or \-1, which means that one unit
should scroll off the bottom or right of the window.
.TP
\fIprefix \fBscroll \fInumber \fBpages\fR
+.
The widget should adjust its view by \fInumber\fR pages.
It is up to the widget to define the meaning of a page; typically
it is slightly less than what fits in the window, so that there
@@ -230,7 +242,7 @@ is deprecated.
In the old command syntax, the \fBset\fR widget command has the
following form:
.TP
-\fIpathName \fBset\fR \fItotalUnits windowUnits firstUnit lastUnit\fR
+\fIpathName \fBset \fItotalUnits windowUnits firstUnit lastUnit\fR
In this form the arguments are all integers.
\fITotalUnits\fR gives the total size of the object being displayed in the
associated widget. The meaning of one unit depends on the associated
@@ -262,6 +274,7 @@ If it is given two real arguments then the new syntax will be
used in the future, and if it is given four integer arguments then
the old syntax will be used.
.SH BINDINGS
+.PP
Tk automatically creates class bindings for scrollbars that give them
the following default behavior.
If the behavior is different for vertical and horizontal scrollbars,
@@ -328,6 +341,7 @@ The Home key adjusts the view to the top (left edge) of the document.
.IP [14]
The End key adjusts the view to the bottom (right edge) of the document.
.SH EXAMPLE
+.PP
Create a window with a scrollable \fBtext\fR widget:
.CS
toplevel .tl
@@ -341,3 +355,6 @@ grid rowconfigure .tl 0 \-weight 1
ttk:scrollbar(n)
.SH KEYWORDS
scrollbar, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/selection.n b/doc/selection.n
index 8aee321..69f6245 100644
--- a/doc/selection.n
+++ b/doc/selection.n
@@ -14,65 +14,66 @@ selection \- Manipulate the X selection
.SH SYNOPSIS
\fBselection \fIoption\fR ?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
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
+Note that for management of the \fBCLIPBOARD\fR 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:
-.PP
.TP
\fBselection clear\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR?
+.
If \fIselection\fR exists anywhere on \fIwindow\fR's display, clear it
so that no window owns the selection anymore. \fISelection\fR
specifies the X selection that should be cleared, and should be an
-atom name such as PRIMARY or CLIPBOARD; see the Inter-Client
+atom name such as \fBPRIMARY\fR or \fBCLIPBOARD\fR; see the Inter-Client
Communication Conventions Manual for complete details.
-\fISelection\fR defaults to PRIMARY and \fIwindow\fR defaults to
+\fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to
.QW . .
Returns an empty string.
.TP
\fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR?
+.
Retrieves the value of \fIselection\fR from \fIwindow\fR's display and
-returns it as a result. \fISelection\fR defaults to PRIMARY and
+returns it as a result. \fISelection\fR defaults to \fBPRIMARY\fR and
\fIwindow\fR defaults to
.QW . .
\fIType\fR specifies the form in which the selection is to be returned
(the desired
.QW target
for conversion, in ICCCM terminology), and
-should be an atom name such as STRING or FILE_NAME; see the
+should be an atom name such as \fBSTRING\fR or \fBFILE_NAME\fR; see the
Inter-Client Communication Conventions Manual for complete details.
-\fIType\fR defaults to STRING. The selection owner may choose to
+\fIType\fR defaults to \fBSTRING\fR. The selection owner may choose to
return the selection in any of several different representation
-formats, such as STRING, UTF8_STRING, ATOM, INTEGER, etc. (this format
-is different
+formats, such as \fBSTRING\fR, \fBUTF8_STRING\fR, \fBATOM\fR,
+\fBINTEGER\fR, etc. (this format is different
than the selection type; see the ICCCM for all the confusing details).
-If the selection is returned in a non-string format, such as INTEGER
-or ATOM, the \fBselection\fR command converts it to string format as a
+If the selection is returned in a non-string format, such as \fBINTEGER\fR
+or \fBATOM\fR, the \fBselection\fR command converts it to string format as a
collection of fields separated by spaces: atoms are converted to their
textual names, and anything else is converted to hexadecimal integers.
Note that \fBselection get\fR does not retrieve the selection in the
-UTF8_STRING format unless told to.
+\fBUTF8_STRING\fR format unless told to.
.TP
\fBselection handle\fR ?\fB\-selection\fR \fIs\fR? ?\fB\-type\fR \fIt\fR? ?\fB\-format\fR \fIf\fR? \fIwindow command\fR
+.
Creates a handler for selection requests, such that \fIcommand\fR will
be executed whenever selection \fIs\fR is owned by \fIwindow\fR and
someone attempts to retrieve it in the form given by type \fIt\fR
(e.g. \fIt\fR is specified in the \fBselection get\fR command).
-\fIS\fR defaults to PRIMARY, \fIt\fR defaults to STRING, and
-\fIf\fR defaults to STRING. If \fIcommand\fR is an empty string
+\fIS\fR defaults to \fBPRIMARY\fR, \fIt\fR defaults to \fBSTRING\fR, and
+\fIf\fR defaults to \fBSTRING\fR. If \fIcommand\fR is an empty string
then any existing handler for \fIwindow\fR, \fIt\fR, and
\fIs\fR is removed.
-Note that when the selection is handled as type STRING it is also
-automatically handled as type UTF8_STRING as well.
+Note that when the selection is handled as type \fBSTRING\fR it is also
+automatically handled as type \fBUTF8_STRING\fR as well.
.RS
.PP
When \fIselection\fR is requested, \fIwindow\fR is the selection owner,
@@ -99,12 +100,12 @@ just as if the selection did not exist at all.
.PP
The \fIformat\fR argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
-Table 2 of the ICCCM), and defaults to STRING. If \fIformat\fR is
-STRING, the selection is transmitted as 8-bit ASCII characters (i.e.
+Table 2 of the ICCCM), and defaults to \fBSTRING\fR. If \fIformat\fR is
+\fBSTRING\fR, the selection is transmitted as 8-bit ASCII characters (i.e.
just in the form returned by \fIcommand\fR, in the system \fBencoding\fR;
-the UTF8_STRING format always uses UTF-8 as its encoding).
+the \fBUTF8_STRING\fR format always uses UTF-8 as its encoding).
If \fIformat\fR is
-ATOM, then the return value from \fIcommand\fR is divided into fields
+\fBATOM\fR, then the return value from \fIcommand\fR is divided into fields
separated by white space; each field is converted to its atom value,
and the 32-bit atom value is transmitted instead of the atom name.
For any other \fIformat\fR, the return value from \fIcommand\fR is
@@ -122,12 +123,14 @@ irrelevant.
\fBselection own\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR?
.TP
\fBselection own\fR ?\fB\-command\fR \fIcommand\fR? ?\fB\-selection\fR \fIselection\fR? \fIwindow\fR
+.
The first form of \fBselection own\fR returns the path name of the
window in this application that owns \fIselection\fR on the display
containing \fIwindow\fR, or an empty string if no window in this
-application owns the selection. \fISelection\fR defaults to PRIMARY and
+application owns the selection. \fISelection\fR defaults to \fBPRIMARY\fR and
\fIwindow\fR defaults to
.QW . .
+.RS
.PP
The second form of \fBselection own\fR causes \fIwindow\fR to become
the new owner of \fIselection\fR on \fIwindow\fR's display, returning
@@ -136,16 +139,20 @@ that it has lost the selection.
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.
+.RE
.SH EXAMPLES
+.PP
On X11 platforms, one of the standard selections available is the
-SECONDARY selection. Hardly anything uses it, but here is how to read
+\fBSECONDARY\fR selection. Hardly anything uses it, but here is how to read
it using Tk:
+.PP
.CS
set selContents [\fBselection get\fR \-selection SECONDARY]
.CE
.PP
Many different types of data may be available for a selection; the
-special type TARGETS allows you to get a list of available types:
+special type \fBTARGETS\fR allows you to get a list of available types:
+.PP
.CS
foreach type [\fBselection get\fR \-type TARGETS] {
puts "Selection PRIMARY supports type $type"
@@ -153,14 +160,14 @@ foreach type [\fBselection get\fR \-type TARGETS] {
.CE
.PP
To claim the selection, you must first set up a handler to supply the
-data for the selection. Then you have to claim the selection...
+data for the selection. Then you have to claim the selection...
.CS
# Set up the data handler ready for incoming requests
set foo "This is a string with some data in it... blah blah"
\fBselection handle\fR \-selection SECONDARY . getData
proc getData {offset maxChars} {
puts "Retrieving selection starting at $offset"
- return [string range $::foo $offset [expr {$offset+$maxChars}]]
+ return [string range $::foo $offset [expr {$offset+$maxChars-1}]]
}
# Now we grab the selection itself
@@ -174,3 +181,6 @@ proc lost {} {
clipboard(n)
.SH KEYWORDS
clear, format, handler, ICCCM, own, selection, target, type
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/send.n b/doc/send.n
index 3b2a714..3af170f 100644
--- a/doc/send.n
+++ b/doc/send.n
@@ -14,7 +14,6 @@ send \- Execute a command in a different application
.SH SYNOPSIS
\fBsend ?\fIoptions\fR? \fIapp cmd \fR?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
This command arranges for \fIcmd\fR (and \fIarg\fRs) to be executed in the
@@ -50,23 +49,20 @@ Serves no purpose except to terminate the list of options. This
option is needed only if \fIapp\fR could contain a leading
.QW \-
character.
-
.SH "APPLICATION NAMES"
.PP
The name of an application is set initially from the name of the
program or script that created the application.
You can query and change the name of an application with the
\fBtk appname\fR command.
-
.SH "DISABLING SENDS"
.PP
If the \fBsend\fR command is removed from an application (e.g.
-with the command \fBrename send {}\fR) then the application
+with the command \fBrename\fR \fBsend {}\fR) then the application
will not respond to incoming send requests anymore, nor will it
be able to issue outgoing requests.
Communication can be reenabled by invoking the \fBtk appname\fR
command.
-
.SH SECURITY
.PP
The \fBsend\fR command is potentially a serious security loophole. On Unix,
@@ -89,6 +85,7 @@ such as that provide by \fBxauth\fR.
Under Windows, \fBsend\fR is currently disabled. Most of the
functionality is provided by the \fBdde\fR command instead.
.SH EXAMPLE
+.PP
This script fragment can be used to make an application that only runs
once on a particular display.
.CS
@@ -107,3 +104,6 @@ proc RemoteStart args {
.CE
.SH KEYWORDS
application, dde, name, remote execution, security, send
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/spinbox.n b/doc/spinbox.n
index dc98251..e88aea6 100644
--- a/doc/spinbox.n
+++ b/doc/spinbox.n
@@ -57,9 +57,9 @@ 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
+Specifies a script to eval when \fB\-validatecommand\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
+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
@@ -89,16 +89,16 @@ If \fB\-values\fR is specified, it supercedes this option.
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.
+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
+change and the \fB\-invalidcommand\fR will be evaluated if it is set. If it
returns 1, then value will be changed.
-See \fBValidation\fR below for more information.
+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
@@ -129,7 +129,7 @@ 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
+If a spinbox is exporting its selection (see the \fB\-exportselection\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
@@ -141,31 +141,31 @@ 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
+the standard \fB\-xscrollcommand\fR mechanism for interacting with
+scrollbars (see the description of the \fB\-xscrollcommand\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
+Validation works by setting the \fB\-validatecommand\fR
+option to a script which will be evaluated according to the \fB\-validate\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
+The \fB\-validatecommand\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.
+The \fB\-validatecommand\fR will be called when the spinbox receives focus.
.IP \fBfocusout\fR 10
-\fBvalidateCommand\fR will be called when the spinbox loses focus.
+The \fB\-validatecommand\fR will be called when the spinbox loses focus.
.IP \fBkey\fR 10
-\fBvalidateCommand\fR will be called when the spinbox is edited.
+The \fB\-validatecommand\fR will be called when the spinbox is edited.
.IP \fBall\fR 10
-\fBvalidateCommand\fR will be called for all above conditions.
+The \fB\-validatecommand\fR will be called for all above conditions.
.PP
-It is possible to perform percent substitutions on the \fBvalidateCommand\fR
-and \fBinvalidCommand\fR, just as you would in a \fBbind\fR script. The
+It is possible to perform percent substitutions on the \fB\-validatecommand\fR
+and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The
following substitutions are recognized:
.PP
.IP \fB%d\fR 5
@@ -190,32 +190,32 @@ The type of validation that triggered the callback
.IP \fB%W\fR 5
The name of the spinbox widget.
.PP
-In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
+In general, the \fB\-textvariable\fR and \fB\-validatecommand\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
+\fB\-validatecommand\fR will not interfere with the traditional behavior of
+the spinbox widget. Using the \fB\-textvariable\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.
+\fB\-textvariable\fR to something that the \fB\-validatecommand\fR would not
+accept, which causes \fB\-validate\fR to become \fInone\fR (the
+\fB\-invalidcommand\fR will not be triggered). The same happens
+when an error occurs evaluating the \fB\-validatecommand\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
+Primarily, an error will occur when the \fB\-validatecommand\fR or
+\fB\-invalidcommand\fR encounters an error in its script while evaluating or
+\fB\-validatecommand\fR does not return a valid Tcl boolean value. The
+\fB\-validate\fR option will also set itself to \fBnone\fR when you edit the
+spinbox widget from within either the \fB\-validatecommand\fR or the
+\fB\-invalidcommand\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
+during validation and still have the \fB\-validate\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
+in the \fB\-validatecommand\fR or \fB\-invalidcommand\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.
+associated \fB\-textvariable\fR during validation, as that can cause the
+spinbox widget to become out of sync with the \fB\-textvariable\fR.
.SH "WIDGET COMMAND"
.PP
The \fBspinbox\fR command creates a new Tcl command whose
@@ -392,7 +392,7 @@ Returns an empty string.
Returns 1 if there is are characters selected in the spinbox,
0 if nothing is selected.
.TP
-\fIpathName \fBselection range \fIstart\fR \fIend\fR
+\fIpathName \fBselection range \fIstart end\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.
@@ -420,9 +420,9 @@ 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.
+This command is used to force an evaluation of the \fB\-validatecommand\fR
+independent of the conditions specified by the \fB\-validate\fR option.
+This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR.
It returns 0 or 1.
.TP
\fIpathName \fBxview \fIargs\fR
@@ -441,7 +441,7 @@ 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
+\fIpathName \fBxview \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
@@ -463,7 +463,6 @@ 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
@@ -580,6 +579,10 @@ take place.
.PP
The behavior of spinboxes can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "SEE ALSO"
+ttk::spinbox(n)
.SH KEYWORDS
spinbox, entry, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/text.n b/doc/text.n
index 69f7ac2..8aa53ba 100644
--- a/doc/text.n
+++ b/doc/text.n
@@ -8,7 +8,7 @@
.so man.macros
.TH text n 8.5 Tk "Tk Built-In Commands"
.BS
-'\" Note: do not modify the .SH NAME line immediately below!
+'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widgets
.SH SYNOPSIS
@@ -29,1574 +29,1414 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widget
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-autoseparators autoSeparators AutoSeparators
-Specifies a boolean that says whether separators are automatically
-inserted in the undo stack. Only meaningful when the \fB\-undo\fR
-option is true.
+Specifies a boolean that says whether separators are automatically inserted in
+the undo stack. Only meaningful when the \fB\-undo\fR option is true.
.OP \-blockcursor blockCursor BlockCursor
-.VS 8.5
-Specifies a boolean that says whether the blinking insertion cursor
-should be drawn as a character-sized rectangular block. If false
-(the default) a thin vertical line is used for the insertion cursor.
-.VE 8.5
+Specifies a boolean that says whether the blinking insertion cursor should be
+drawn as a character-sized rectangular block. If false (the default) a thin
+vertical line is used for the insertion cursor.
.OP \-endline endLine EndLine
-.VS 8.5
-Specifies an integer line index representing the last line of the
-underlying textual data store that should be contained in the widget.
-This allows a text widget to reflect only a portion of a larger piece
-of text. Instead of an integer, the empty string can be provided to
-this configuration option, which will configure the widget to end
-at the very last line in the textual data store.
-.VE 8.5
+Specifies an integer line index representing the last line of the underlying
+textual data store that should be contained in the widget. This allows a text
+widget to reflect only a portion of a larger piece of text. Instead of an
+integer, the empty string can be provided to this configuration option, which
+will configure the widget to end at the very last line in the textual data
+store.
.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.
+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 \-inactiveselectbackground inactiveSelectBackground Foreground
-.VS 8.5
-Specifies the colour to use for the selection (the \fBsel\fR tag) when
-the window does not have the input focus. If empty, \fB{}\fR, then no
-selection is shown when the window does not have the focus.
-.VE 8.5
+Specifies the colour to use for the selection (the \fBsel\fR tag) when the
+window does not have the input focus. If empty, \fB{}\fR, then no selection is
+shown when the window does not have the focus.
+.OP \-insertunfocussed insertUnfocussed InsertUnfocussed
+.VS 8.6
+Specifies how to display the insertion cursor when the widget does not have
+the focus. Must be \fBnone\fR (the default) which means to not display the
+cursor, \fBhollow\fR which means to display a hollow box, or \fBsolid\fR which
+means to display a solid box. Note that \fBhollow\fR and \fBsolid\fR will
+appear very similar when the \fB\-blockcursor\fR option is false.
+.VE 8.6
.OP \-maxundo maxUndo MaxUndo
-Specifies the maximum number of compound undo actions on the undo
-stack. A zero or a negative value imply an unlimited undo stack.
+Specifies the maximum number of compound undo actions on the undo stack. A
+zero or a negative value imply an unlimited undo stack.
.OP \-spacing1 spacing1 Spacing1
-Requests additional space above each text line in the widget,
-using any of the standard forms for screen distances.
-If a line wraps, this option only applies to the first line
-on the display.
-This option may be overridden with \fB\-spacing1\fR options in
-tags.
+Requests additional space above each text line in the widget, using any of the
+standard forms for screen distances. If a line wraps, this option only applies
+to the first line on the display. This option may be overridden with
+\fB\-spacing1\fR options in tags.
.OP \-spacing2 spacing2 Spacing2
-For lines that wrap (so that they cover more than one line on the
-display) this option specifies additional space to provide between
-the display lines that represent a single line of text.
-The value may have any of the standard forms for screen distances.
-This option may be overridden with \fB\-spacing2\fR options in
-tags.
+For lines that wrap (so that they cover more than one line on the display)
+this option specifies additional space to provide between the display lines
+that represent a single line of text. The value may have any of the standard
+forms for screen distances. This option may be overridden with
+\fB\-spacing2\fR options in tags.
.OP \-spacing3 spacing3 Spacing3
-Requests additional space below each text line in the widget,
-using any of the standard forms for screen distances.
-If a line wraps, this option only applies to the last line
-on the display.
-This option may be overridden with \fB\-spacing3\fR options in
-tags.
+Requests additional space below each text line in the widget, using any of the
+standard forms for screen distances. If a line wraps, this option only applies
+to the last line on the display. This option may be overridden with
+\fB\-spacing3\fR options in tags.
.OP \-startline startLine StartLine
-.VS 8.5
-Specifies an integer line index representing the first line of the
-underlying textual data store that should be contained in the widget.
-This allows a text widget to reflect only a portion of a larger piece
-of text. Instead of an integer, the empty string can be provided to
-this configuration option, which will configure the widget to start
-at the very first line in the textual data store.
-.VE 8.5
+Specifies an integer line index representing the first line of the underlying
+textual data store that should be contained in the widget. This allows a text
+widget to reflect only a portion of a larger piece of text. Instead of an
+integer, the empty string can be provided to this configuration option, which
+will configure the widget to start at the very first line in the textual data
+store.
.OP \-state state State
-Specifies one of two states for the text: \fBnormal\fR or \fBdisabled\fR.
-If the text is disabled then characters may not be inserted or deleted
-and no insertion cursor will be displayed, even if the input focus is
-in the widget.
+Specifies one of two states for the text: \fBnormal\fR or \fBdisabled\fR. If
+the text is disabled then characters may not be inserted or deleted and no
+insertion cursor will be displayed, even if the input focus is in the widget.
.OP \-tabs tabs Tabs
-Specifies a set of tab stops for the window. The option's value consists
-of a list of screen distances giving the positions of the tab stops,
-each of which is a distance relative to the left edge of the widget
-(excluding borders, padding, etc). Each
-position may optionally be followed in the next list element
-by one of the keywords \fBleft\fR, \fBright\fR, \fBcenter\fR,
-or \fBnumeric\fR, which specifies how to justify
-text relative to the tab stop. \fBLeft\fR is the default; it causes
-the text following the tab character to be positioned with its left edge
-at the tab position. \fBRight\fR means that the right edge of the text
-following the tab character is positioned at the tab position, and
-\fBcenter\fR means that the text is centered at the tab position.
-\fBNumeric\fR means that the decimal point in the text is positioned
-at the tab position; if there is no decimal point then the least
-significant digit of the number is positioned just to the left of the
-tab position; if there is no number in the text then the text is
-right-justified at the tab position.
-For example,
+Specifies a set of tab stops for the window. The option's value consists of a
+list of screen distances giving the positions of the tab stops, each of which
+is a distance relative to the left edge of the widget (excluding borders,
+padding, etc). Each position may optionally be followed in the next list
+element by one of the keywords \fBleft\fR, \fBright\fR, \fBcenter\fR, or
+\fBnumeric\fR, which specifies how to justify text relative to the tab stop.
+\fBLeft\fR is the default; it causes the text following the tab character to
+be positioned with its left edge at the tab position. \fBRight\fR means that
+the right edge of the text following the tab character is positioned at the
+tab position, and \fBcenter\fR means that the text is centered at the tab
+position. \fBNumeric\fR means that the decimal point in the text is positioned
+at the tab position; if there is no decimal point then the least significant
+digit of the number is positioned just to the left of the tab position; if
+there is no number in the text then the text is right-justified at the tab
+position. For example,
.QW "\fB\-tabs {2c left 4c 6c center}\fR"
-creates three tab stops at two-centimeter intervals; the first two use left
+creates three tab stops at two-centimeter intervals; the first two use left
justification and the third uses center justification.
.RS
.PP
-If the list of tab stops does not have enough elements to cover all
-of the tabs in a text line, then Tk extrapolates new tab stops using
-the spacing and alignment from the last tab stop in the list. Tab
-distances must be strictly positive, and must always increase from one
-tab stop to the next (if not, an error is thrown).
-The value of the \fBtabs\fR option may be overridden by \fB\-tabs\fR
-options in tags.
-.PP
-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. To achieve a different standard spacing,
-for example every 4 characters, simply configure the widget with
+If the list of tab stops does not have enough elements to cover all of the
+tabs in a text line, then Tk extrapolates new tab stops using the spacing and
+alignment from the last tab stop in the list. Tab distances must be strictly
+positive, and must always increase from one tab stop to the next (if not, an
+error is thrown). The value of the \fB\-tabs\fR option may be overridden by
+\fB\-tabs\fR options in tags.
+.PP
+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.
+To achieve a different standard spacing, for example every 4 characters,
+simply configure the widget with
.QW "\fB\-tabs \N'34'[expr {4 * [font measure $font 0]}] left\N'34' \-tabstyle wordprocessor\fR" .
.RE
.OP \-tabstyle tabStyle TabStyle
-Specifies how to interpret the relationship between tab stops on a line
-and tabs in the text of that line. The value must be \fBtabular\fR (the
-default) or \fBwordprocessor\fR. Note that tabs are interpreted as they
-are encountered in the text. If the tab style is \fBtabular\fR then the
-\fIn\fR'th tab character in the line's text will be associated with
-the \fIn\fR'th
-tab stop defined for that line. If the tab character's x coordinate
-falls to the right of the \fIn\fR'th tab stop, then a gap of a single space
-will be inserted as a fallback. If the tab style is \fBwordprocessor\fR
-then any tab character being laid out will use (and be defined by) the
-first tab stop to the right of the preceding characters already laid out
-on that line. The value of the \fBtabstyle\fR option may be overridden
-by \fB\-tabstyle\fR options in tags.
+Specifies how to interpret the relationship between tab stops on a line and
+tabs in the text of that line. The value must be \fBtabular\fR (the default)
+or \fBwordprocessor\fR. Note that tabs are interpreted as they are encountered
+in the text. If the tab style is \fBtabular\fR then the \fIn\fR'th tab
+character in the line's text will be associated with the \fIn\fR'th tab stop
+defined for that line. If the tab character's x coordinate falls to the right
+of the \fIn\fR'th tab stop, then a gap of a single space will be inserted as a
+fallback. If the tab style is \fBwordprocessor\fR then any tab character being
+laid out will use (and be defined by) the first tab stop to the right of the
+preceding characters already laid out on that line. The value of the
+\fB\-tabstyle\fR option may be overridden by \fB\-tabstyle\fR options in tags.
.OP \-undo undo Undo
-Specifies a boolean that says whether the undo mechanism is active or
-not.
+Specifies a boolean that says whether the undo mechanism is active or not.
.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.
-If the font does not have a uniform width then the width of the character
+Specifies the desired width for the window in units of characters in the font
+given by the \fB\-font\fR option. If the font does not have a uniform width
+then the width of the character
.QW 0
is used in translating from character units to screen units.
.OP \-wrap wrap Wrap
-Specifies how to handle lines in the text that are too long to be
-displayed in a single line of the text's window.
-The value must be \fBnone\fR or \fBchar\fR or \fBword\fR.
-A wrap mode of \fBnone\fR means that each line of text appears as
-exactly one line on the screen; extra characters that do not fit
-on the screen are not displayed.
-In the other modes each line of text will be broken up into several
-screen lines if necessary to keep all the characters visible.
-In \fBchar\fR mode a screen line break may occur after any character;
-in \fBword\fR mode a line break will only be made at word boundaries.
+Specifies how to handle lines in the text that are too long to be displayed in
+a single line of the text's window. The value must be \fBnone\fR or \fBchar\fR
+or \fBword\fR. A wrap mode of \fBnone\fR means that each line of text appears
+as exactly one line on the screen; extra characters that do not fit on the
+screen are not displayed. In the other modes each line of text will be broken
+up into several screen lines if necessary to keep all the characters visible.
+In \fBchar\fR mode a screen line break may occur after any character; in
+\fBword\fR mode a line break will only be made at word boundaries.
.BE
-
.SH DESCRIPTION
.PP
-The \fBtext\fR command creates a new window (given by the
-\fIpathName\fR argument) and makes it into a text widget.
-Additional
-options, described above, may be specified on the command line
-or in the option database
-to configure aspects of the text such as its default background color
-and relief. The \fBtext\fR command returns the
-path name of the new window.
-.PP
-A text widget displays one or more lines of text and allows that
-text to be edited.
-Text widgets support four different kinds of annotations on the
-text, called tags, marks, embedded windows or embedded images.
-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
-that scripts are invoked when particular actions such as keystrokes
-and mouse button presses occur in particular ranges of the text.
-See \fBTAGS\fR below for more details.
-.PP
-The second form of annotation consists of floating markers in the text
-called
+The \fBtext\fR command creates a new window (given by the \fIpathName\fR
+argument) and makes it into a text widget. Additional options, described
+above, may be specified on the command line or in the option database to
+configure aspects of the text such as its default background color and relief.
+The \fBtext\fR command returns the path name of the new window.
+.PP
+A text widget displays one or more lines of text and allows that text to be
+edited. Text widgets support four different kinds of annotations on the text,
+called tags, marks, embedded windows or embedded images. 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 that scripts are invoked
+when particular actions such as keystrokes and mouse button presses occur in
+particular ranges of the text. See \fBTAGS\fR below for more details.
+.PP
+The second form of annotation consists of floating markers in the text called
.QW marks .
-Marks are used to keep track of various interesting positions in the
-text as it is edited.
-See \fBMARKS\fR below for more details.
+Marks are used to keep track of various interesting positions in the text as
+it is edited. See \fBMARKS\fR below for more details.
.PP
-The third form of annotation allows arbitrary windows to be
-embedded in a text widget.
-See \fBEMBEDDED WINDOWS\fR below for more details.
+The third form of annotation allows arbitrary windows to be embedded in a text
+widget. See \fBEMBEDDED WINDOWS\fR below for more details.
.PP
The fourth form of annotation allows Tk images to be embedded in a text
-widget.
-See \fBEMBEDDED IMAGES\fR below for more details.
+widget. See \fBEMBEDDED IMAGES\fR below for more details.
.PP
-The text widget also has a built-in undo/redo mechanism.
-See \fBTHE UNDO MECHANISM\fR below for more details.
+The text widget also has a built-in undo/redo mechanism. See
+\fBTHE UNDO MECHANISM\fR below for more details.
.PP
-.VS 8.5
-The text widget allows for the creation of peer widgets. These are
-other text widgets which share the same underlying data (text, marks,
-tags, images, etc). See \fBPEER WIDGETS\fR below for more details.
-.VE 8.5
+The text widget allows for the creation of peer widgets. These are other text
+widgets which share the same underlying data (text, marks, tags, images, etc).
+See \fBPEER WIDGETS\fR below for more details.
.SH INDICES
.PP
-Many of the widget commands for texts take one or more indices
-as arguments.
-An index is a string used to indicate a particular place within
-a text, such as a place to insert characters or one endpoint of a
-range of characters to delete.
-Indices have the syntax
+Many of the widget commands for texts take one or more indices as arguments.
+An index is a string used to indicate a particular place within a text, such
+as a place to insert characters or one endpoint of a range of characters to
+delete. Indices have the syntax
.CS
\fIbase modifier modifier modifier ...\fR
.CE
-Where \fIbase\fR gives a starting point and the \fImodifier\fRs
-adjust the index from the starting point (e.g. move forward or
-backward one character). Every index must contain a \fIbase\fR,
-but the \fImodifier\fRs are optional.
-.VS 8.5
-Most modifiers (as documented below) allow
-an optional submodifier. Valid submodifiers are \fBany\fR
-and \fBdisplay\fR. If the submodifier is abbreviated, then it must be
-followed by whitespace, but otherwise there need be no space between the
-submodifier and the following \fImodifier\fR. Typically the \fBdisplay\fR
-submodifier adjusts the meaning of the following \fImodifier\fR to make
-it refer to visual or non-elided units rather than logical units, but
-this is explained for each relevant case below. Lastly, where \fIcount\fR
-is used as part of a modifier, it can be positive or negative, so
+Where \fIbase\fR gives a starting point and the \fImodifier\fRs adjust the
+index from the starting point (e.g. move forward or backward one character).
+Every index must contain a \fIbase\fR, but the \fImodifier\fRs are optional.
+Most modifiers (as documented below) allow an optional submodifier. Valid
+submodifiers are \fBany\fR and \fBdisplay\fR. If the submodifier is
+abbreviated, then it must be followed by whitespace, but otherwise there need
+be no space between the submodifier and the following \fImodifier\fR.
+Typically the \fBdisplay\fR submodifier adjusts the meaning of the following
+\fImodifier\fR to make it refer to visual or non-elided units rather than
+logical units, but this is explained for each relevant case below. Lastly,
+where \fIcount\fR is used as part of a modifier, it can be positive or
+negative, so
.QW "\fIbase\fR \- \-3 lines"
is perfectly valid (and equivalent to
.QW "\fIbase\fR +3lines" ).
-.VE 8.5
.PP
The \fIbase\fR for an index must have one of the following forms:
.TP 12
\fIline\fB.\fIchar\fR
-Indicates \fIchar\fR'th character on line \fIline\fR.
-Lines are numbered from 1 for consistency with other UNIX programs
-that use this numbering scheme.
-Within a line, characters are numbered from 0.
-If \fIchar\fR is \fBend\fR then it refers to the newline character
-that ends the line.
+.
+Indicates \fIchar\fR'th character on line \fIline\fR. Lines are numbered from
+1 for consistency with other UNIX programs that use this numbering scheme.
+Within a line, characters are numbered from 0. If \fIchar\fR is \fBend\fR then
+it refers to the newline character that ends the line.
.TP 12
\fB@\fIx\fB,\fIy\fR
-Indicates the character that covers the pixel whose x and y coordinates
-within the text's window are \fIx\fR and \fIy\fR.
+.
+Indicates the character that covers the pixel whose x and y coordinates within
+the text's window are \fIx\fR and \fIy\fR.
.TP 12
\fBend\fR
-Indicates the end of the text (the character just after the last
-newline).
+.
+Indicates the end of the text (the character just after the last newline).
.TP 12
\fImark\fR
+.
Indicates the character just after the mark whose name is \fImark\fR.
.TP 12
\fItag\fB.first\fR
-Indicates the first character in the text that has been tagged with
+.
+Indicates the first character in the text that has been tagged with \fItag\fR.
+This form generates an error if no characters are currently tagged with
\fItag\fR.
-This form generates an error if no characters are currently tagged
-with \fItag\fR.
.TP 12
\fItag\fB.last\fR
-Indicates the character just after the last one in the text that has
-been tagged with \fItag\fR.
-This form generates an error if no characters are currently tagged
-with \fItag\fR.
+.
+Indicates the character just after the last one in the text that has been
+tagged with \fItag\fR. This form generates an error if no characters are
+currently tagged with \fItag\fR.
.TP 12
\fIpathName\fR
-Indicates the position of the embedded window whose name is
-\fIpathName\fR.
-This form generates an error if there is no embedded window
-by the given name.
+.
+Indicates the position of the embedded window whose name is \fIpathName\fR.
+This form generates an error if there is no embedded window by the given name.
.TP 12
\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.
-.PP
-If the \fIbase\fR could match more than one of the above forms, such
-as a \fImark\fR and \fIimageName\fR both having the same value, then
-the form earlier in the above list takes precedence.
-If modifiers follow the base index, each one of them must have one
-of the forms listed below. Keywords such as \fBchars\fR and \fBwordend\fR
-may be abbreviated as long as the abbreviation is unambiguous.
+.
+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.
+.PP
+If the \fIbase\fR could match more than one of the above forms, such as a
+\fImark\fR and \fIimageName\fR both having the same value, then the form
+earlier in the above list takes precedence. If modifiers follow the base
+index, each one of them must have one of the forms listed below. Keywords such
+as \fBchars\fR and \fBwordend\fR may be abbreviated as long as the
+abbreviation is unambiguous.
.TP
\fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBchars\fR
-.VS 8.5
-Adjust the index forward by \fIcount\fR characters, moving to later lines
-in the text if necessary. If there are fewer than \fIcount\fR characters
-in the text after the current index, then set the index to the last index
-in the text. Spaces on either side of \fIcount\fR are optional. If the
-\fBdisplay\fR submodifier is given, elided characters are skipped over
-without being counted. If \fBany\fR is given, then all characters are
-counted. For historical reasons, if neither modifier is given then the
-count actually takes place in units of index positions (see \fBindices\fR
-for details). This behaviour may be changed in a future major release,
-so if you need an index count, you are encouraged to use \fBindices\fR
-instead wherever possible.
-.VE 8.5
+.
+Adjust the index forward by \fIcount\fR characters, moving to later lines in
+the text if necessary. If there are fewer than \fIcount\fR characters in the
+text after the current index, then set the index to the last index in the
+text. Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR
+submodifier is given, elided characters are skipped over without being
+counted. If \fBany\fR is given, then all characters are counted. For
+historical reasons, if neither modifier is given then the count actually takes
+place in units of index positions (see \fBINDICES\fR for details). This
+behaviour may be changed in a future major release, so if you need an index
+count, you are encouraged to use \fBindices\fR instead wherever possible.
.TP
\fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBchars\fR
-Adjust the index backward by \fIcount\fR characters, moving to earlier
-lines in the text if necessary. If there are fewer than \fIcount\fR
-characters in the text before the current index, then set the index to
-.VS 8.5
-the first index in the text (1.0). Spaces on either side of \fIcount\fR
-are optional. If the \fBdisplay\fR submodifier is given, elided
-characters are skipped over without being counted. If \fBany\fR is
-given, then all characters are counted. For historical reasons, if
-neither modifier is given then the count actually takes place in units of
-index positions (see \fBindices\fR for details). This behaviour may be
-changed in a future major release, so if you need an index count, you are
-encouraged to use \fBindices\fR instead wherever possible.
-.VE 8.5
+.
+Adjust the index backward by \fIcount\fR characters, moving to earlier lines
+in the text if necessary. If there are fewer than \fIcount\fR characters in
+the text before the current index, then set the index to the first index in
+the text (1.0). Spaces on either side of \fIcount\fR are optional. If the
+\fBdisplay\fR submodifier is given, elided characters are skipped over without
+being counted. If \fBany\fR is given, then all characters are counted. For
+historical reasons, if neither modifier is given then the count actually takes
+place in units of index positions (see \fBINDICES\fR for details). This
+behavior may be changed in a future major release, so if you need an index
+count, you are encouraged to use \fBindices\fR instead wherever possible.
.TP
\fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBindices\fR
-.VS 8.5
-Adjust the index forward by \fIcount\fR index positions, moving to later
-lines in the text if necessary. If there are fewer than \fIcount\fR
-index positions in the text after the current index, then set the index
-to the last index position in the text. Spaces on either side of
-\fIcount\fR are optional. Note that an index position is either a single
-character or a single embedded image or embedded window. If the
-\fBdisplay\fR submodifier is given, elided indices are skipped over
-without being counted. If \fBany\fR is given, then all indices are
-counted; this is also the default behaviour if no modifier is given.
-.VE 8.5
+.
+Adjust the index forward by \fIcount\fR index positions, moving to later lines
+in the text if necessary. If there are fewer than \fIcount\fR index positions
+in the text after the current index, then set the index to the last index
+position in the text. Spaces on either side of \fIcount\fR are optional. Note
+that an index position is either a single character or a single embedded image
+or embedded window. If the \fBdisplay\fR submodifier is given, elided indices
+are skipped over without being counted. If \fBany\fR is given, then all
+indices are counted; this is also the default behaviour if no modifier is
+given.
.TP
\fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBindices\fR
-.VS 8.5
-Adjust the index backward by \fIcount\fR index positions, moving to
-earlier lines in the text if necessary. If there are fewer than
-\fIcount\fR index positions in the text before the current index, then
-set the index to the first index position (1.0) in the text. Spaces on
-either side of \fIcount\fR are optional. If the \fBdisplay\fR
-submodifier is given, elided indices are skipped over without being
-counted. If \fBany\fR is given, then all indices are counted; this is
-also the default behaviour if no modifier is given.
-.VE 8.5
+.
+Adjust the index backward by \fIcount\fR index positions, moving to earlier
+lines in the text if necessary. If there are fewer than \fIcount\fR index
+positions in the text before the current index, then set the index to the
+first index position (1.0) in the text. Spaces on either side of \fIcount\fR
+are optional. If the \fBdisplay\fR submodifier is given, elided indices are
+skipped over without being counted. If \fBany\fR is given, then all indices
+are counted; this is also the default behaviour if no modifier is given.
.TP
\fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBlines\fR
-.VS 8.5
-Adjust the index forward by \fIcount\fR lines, retaining the same
-character position within the line. If there are fewer than \fIcount\fR
-lines after the line containing the current index, then set the index to
-refer to the same character position on the last line of the text. Then,
-if the line is not long enough to contain a character at the indicated
-character position, adjust the character position to refer to the last
-character of the line (the newline). Spaces on either side of
-\fIcount\fR are optional. If the \fBdisplay\fR submodifier is given,
-then each visual display line is counted separately. Otherwise, if
-\fBany\fR (or no modifier) is given, then each logical line (no matter
-how many times it is visually wrapped) counts just once. If the relevant
-lines are not wrapped, then these two methods of counting are equivalent.
-.VE 8.5
+.
+Adjust the index forward by \fIcount\fR lines, retaining the same character
+position within the line. If there are fewer than \fIcount\fR lines after the
+line containing the current index, then set the index to refer to the same
+character position on the last line of the text. Then, if the line is not long
+enough to contain a character at the indicated character position, adjust the
+character position to refer to the last character of the line (the newline).
+Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR
+submodifier is given, then each visual display line is counted separately.
+Otherwise, if \fBany\fR (or no modifier) is given, then each logical line (no
+matter how many times it is visually wrapped) counts just once. If the
+relevant lines are not wrapped, then these two methods of counting are
+equivalent.
.TP
\fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBlines\fR
-.VS 8.5
-Adjust the index backward by \fIcount\fR logical lines, retaining the
-same character position within the line. If there are fewer than
-\fIcount\fR lines before the line containing the current index, then set
-the index to refer to the same character position on the first line of
-the text. Then, if the line is not long enough to contain a character at
-the indicated character position, adjust the character position to refer
-to the last character of the line (the newline). Spaces on either side
-of \fIcount\fR are optional. If the \fBdisplay\fR submodifier is given,
-then each visual display line is counted separately. Otherwise, if
-\fBany\fR (or no modifier) is given, then each logical line (no matter
-how many times it is visually wrapped) counts just once. If the relevant
-lines are not wrapped, then these two methods of counting are equivalent.
-.VE 8.5
+.
+Adjust the index backward by \fIcount\fR logical lines, retaining the same
+character position within the line. If there are fewer than \fIcount\fR lines
+before the line containing the current index, then set the index to refer to
+the same character position on the first line of the text. Then, if the line
+is not long enough to contain a character at the indicated character position,
+adjust the character position to refer to the last character of the line (the
+newline). Spaces on either side of \fIcount\fR are optional. If the
+\fBdisplay\fR submodifier is given, then each visual display line is counted
+separately. Otherwise, if \fBany\fR (or no modifier) is given, then each
+logical line (no matter how many times it is visually wrapped) counts just
+once. If the relevant lines are not wrapped, then these two methods of
+counting are equivalent.
.TP
?\fIsubmodifier\fR? \fBlinestart\fR
-.VS 8.5
-Adjust the index to refer to the first index on the line. If the
-\fBdisplay\fR submodifier is given, this is the first index on the
-display line, otherwise on the logical line.
-.VE 8.5
+.
+Adjust the index to refer to the first index on the line. If the \fBdisplay\fR
+submodifier is given, this is the first index on the display line, otherwise
+on the logical line.
.TP
?\fIsubmodifier\fR? \fBlineend\fR
-.VS 8.5
-Adjust the index to refer to the last index on the line (the
-newline). If the \fBdisplay\fR submodifier is given, this is the last
-index on the display line, otherwise on the logical line.
-.VE 8.5
+.
+Adjust the index to refer to the last index on the line (the newline). If the
+\fBdisplay\fR submodifier is given, this is the last index on the display
+line, otherwise on the logical line.
.TP
?\fIsubmodifier\fR? \fBwordstart\fR
-.VS 8.5
-Adjust the index to refer to the first character of the word containing
-the current index. A word consists of any number of adjacent characters
-that are letters, digits, or underscores, or a single character that is
-not one of these. If the \fBdisplay\fR submodifier is given, this only
-examines non-elided characters, otherwise all characters (elided or not)
-are examined.
-.VE 8.5
+.
+Adjust the index to refer to the first character of the word containing the
+current index. A word consists of any number of adjacent characters that are
+letters, digits, or underscores, or a single character that is not one of
+these. If the \fBdisplay\fR submodifier is given, this only examines
+non-elided characters, otherwise all characters (elided or not) are examined.
.TP
?\fIsubmodifier\fR? \fBwordend\fR
-.VS 8.5
-Adjust the index to refer to the character just after the last one of the
-word containing the current index. If the current index refers to the
-last character of the text then it is not modified. If the \fBdisplay\fR
-submodifier is given, this only examines non-elided characters, otherwise
-all characters (elided or not) are examined.
-.PP
-If more than one modifier is present then they are applied in
-left-to-right order. For example, the index
+.
+Adjust the index to refer to the character just after the last one of the word
+containing the current index. If the current index refers to the last
+character of the text then it is not modified. If the \fBdisplay\fR
+submodifier is given, this only examines non-elided characters, otherwise all
+characters (elided or not) are examined.
+.PP
+If more than one modifier is present then they are applied in left-to-right
+order. For example, the index
.QW "\fBend \- 1 chars\fR"
refers to the next-to-last character in the text and
.QW "\fBinsert wordstart \- 1 c\fR"
-refers to the character just before
-the first one in the word containing the insertion cursor. Modifiers
-are applied one by one in this left to right order, and after each step
-the resulting index is constrained to be a valid index in the text
-widget. So, for example, the index
+refers to the character just before the first one in the word containing the
+insertion cursor. Modifiers are applied one by one in this left to right
+order, and after each step the resulting index is constrained to be a valid
+index in the text widget. So, for example, the index
.QW "\fB1.0 \-1c +1c\fR"
refers to the index
.QW \fB2.0\fR .
.PP
-Where modifiers result in index changes by display lines, display chars
-or display indices, and the \fIbase\fR refers to an index inside an
-elided tag,
+Where modifiers result in index changes by display lines, display chars or
+display indices, and the \fIbase\fR refers to an index inside an elided tag,
that base index is considered to be equivalent to the first following
non-elided index.
-.VE 8.5
.SH TAGS
.PP
-The first form of annotation in text widgets is a tag.
-A tag is a textual string that is associated with some of the characters
-in a text.
-Tags may contain arbitrary characters, but it is probably best to
-avoid using the characters
+The first form of annotation in text widgets is a tag. A tag is a textual
+string that is associated with some of the characters in a text. Tags may
+contain arbitrary characters, but it is probably best to avoid using the
+characters
.QW " "
-(space), \fB+\fR, or \fB\-\fR:
-these characters have special meaning in indices, so tags containing
-them cannot be used as indices.
-There may be any number of tags associated with characters in a
-text.
-Each tag may refer to a single character, a range of characters, or
-several ranges of characters.
-An individual character may have any number of tags associated with it.
-.PP
-A priority order is defined among tags, and this order is used in
-implementing some of the tag-related functions described below.
-When a tag is defined (by associating it with characters or setting
-its display options or binding commands to it), it is given
-a priority higher than any existing tag.
-The priority order of tags may be redefined using the
+(space), \fB+\fR, or \fB\-\fR: these characters have special meaning in
+indices, so tags containing them cannot be used as indices. There may be any
+number of tags associated with characters in a text. Each tag may refer to a
+single character, a range of characters, or several ranges of characters. An
+individual character may have any number of tags associated with it.
+.PP
+A priority order is defined among tags, and this order is used in implementing
+some of the tag-related functions described below. When a tag is defined (by
+associating it with characters or setting its display options or binding
+commands to it), it is given a priority higher than any existing tag. The
+priority order of tags may be redefined using the
.QW "\fIpathName \fBtag raise\fR"
and
.QW "\fIpathName \fBtag lower\fR"
widget commands.
.PP
-Tags serve three purposes in text widgets.
-First, they control the way information is displayed on the screen.
-By default, characters are displayed as determined by the
-\fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR options for the
-text widget.
-However, display options may be associated with individual tags
-using the
+Tags serve three purposes in text widgets. First, they control the way
+information is displayed on the screen. By default, characters are displayed
+as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR
+options for the text widget. However, display options may be associated with
+individual tags using the
.QW "\fIpathName \fBtag configure\fR"
-widget command.
-If a character has been tagged, then the display options associated
-with the tag override the default display style.
-The following options are currently supported for tags:
+widget command. If a character has been tagged, then the display options
+associated with the tag override the default display style. The following
+options are currently supported for tags:
.TP
\fB\-background \fIcolor\fR
-\fIColor\fR specifies the background color to use for characters
-associated with the tag.
-It may have any of the forms accepted by \fBTk_GetColor\fR.
+.
+\fIColor\fR specifies the background color to use for characters associated
+with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-bgstipple \fIbitmap\fR
-\fIBitmap\fR specifies a bitmap that is used as a stipple pattern
-for the background.
-It may have any of the forms accepted by \fBTk_GetBitmap\fR.
-If \fIbitmap\fR has not been specified, or if it is specified
-as an empty string, then a solid fill will be used for the
-background.
+.
+\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the
+background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If
+\fIbitmap\fR has not been specified, or if it is specified as an empty string,
+then a solid fill will be used for the background.
.TP
\fB\-borderwidth \fIpixels\fR
-\fIPixels\fR specifies the width of a 3-D border to draw around
-the background.
-It may have any of the forms accepted by \fBTk_GetPixels\fR.
-This option is used in conjunction with the \fB\-relief\fR
-option to give a 3-D appearance to the background for characters;
-it is ignored unless the \fB\-background\fR option
-has been set for the tag.
+.
+\fIPixels\fR specifies the width of a border to draw around the tag using any
+of the forms accepted by \fBTk_GetPixels\fR. This option should be used in
+conjuction with the \fB\-relief\fR option to provide the desired border.
.TP
\fB\-elide \fIboolean\fR
-\fIElide\fR specifies whether the data should
-be elided. Elided data (characters, images, embedded windows, etc) is
-not displayed and takes no space on screen, but further on behaves just
-as normal data.
+.
+\fIElide\fR specifies whether the data should be elided. Elided data
+(characters, images, embedded windows, etc.) is not displayed and takes no
+space on screen, but further on behaves just as normal data.
.TP
\fB\-fgstipple \fIbitmap\fR
-\fIBitmap\fR specifies a bitmap that is used as a stipple pattern
-when drawing text and other foreground information such as
-underlines.
-It may have any of the forms accepted by \fBTk_GetBitmap\fR.
-If \fIbitmap\fR has not been specified, or if it is specified
-as an empty string, then a solid fill will be used.
+.
+\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing
+text and other foreground information such as underlines. It may have any of
+the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been
+specified, or if it is specified 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_GetFont\fR.
+.
+\fIFontName\fR is the name of a font to use for drawing characters. 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
-foreground information such as underlines.
-It may have any of the forms accepted by \fBTk_GetColor\fR.
+.
+\fIColor\fR specifies the color to use when drawing text and other foreground
+information such as underlines. It may have any of the forms accepted by
+\fBTk_GetColor\fR.
.TP
\fB\-justify \fIjustify\fR
+.
If the first non-elided character of a display line has a tag for which this
-option has been specified, then \fIjustify\fR determines how to
-justify the line.
-It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR.
-If a line wraps, then the justification for each line on the
-display is determined by the first non-elided character of that display line.
+option has been specified, then \fIjustify\fR determines how to justify the
+line. It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. If a line
+wraps, then the justification for each line on the display is determined by
+the first non-elided character of that display line.
.TP
\fB\-lmargin1 \fIpixels\fR
+.
If the first non-elided character of a text line has a tag for which this
-option has been specified, then \fIpixels\fR specifies how
-much the line should be indented from the left edge of the
-window.
-\fIPixels\fR may have any of the standard forms for screen
-distances.
-If a line of text wraps, this option only applies to the
-first line on the display; the \fB\-lmargin2\fR option controls
-the indentation for subsequent lines.
+option has been specified, then \fIpixels\fR specifies how much the line
+should be indented from the left edge of the window. \fIPixels\fR may have any
+of the standard forms for screen distances. If a line of text wraps, this
+option only applies to the first line on the display; the \fB\-lmargin2\fR
+option controls the indentation for subsequent lines.
.TP
\fB\-lmargin2 \fIpixels\fR
+.
If the first non-elided character of a display line has a tag for which this
-option has been specified, and if the display line is not the
-first for its text line (i.e., the text line has wrapped), then
-\fIpixels\fR specifies how much the line should be indented from
-the left edge of the window.
-\fIPixels\fR may have any of the standard forms for screen
-distances.
-This option is only used when wrapping is enabled, and it only
-applies to the second and later display lines for a text line.
+option has been specified, and if the display line is not the first for its
+text line (i.e., the text line has wrapped), then \fIpixels\fR specifies how
+much the line should be indented from the left edge of the window.
+\fIPixels\fR may have any of the standard forms for screen distances. This
+option is only used when wrapping is enabled, and it only applies to the
+second and later display lines for a text line.
.TP
\fB\-offset \fIpixels\fR
-\fIPixels\fR specifies an amount by which the text's baseline
-should be offset vertically from the baseline of the overall
-line, in pixels.
-For example, a positive offset can be used for superscripts
-and a negative offset can be used for subscripts.
-\fIPixels\fR may have any of the standard forms for screen
+.
+\fIPixels\fR specifies an amount by which the text's baseline should be offset
+vertically from the baseline of the overall line, in pixels. For example, a
+positive offset can be used for superscripts and a negative offset can be used
+for subscripts. \fIPixels\fR may have any of the standard forms for screen
distances.
.TP
\fB\-overstrike \fIboolean\fR
-Specifies whether or not to draw a horizontal rule through
-the middle of characters.
-\fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR.
+.
+Specifies whether or not to draw a horizontal rule through the middle of
+characters. \fIBoolean\fR may have any of the forms accepted by
+\fBTcl_GetBoolean\fR.
.TP
\fB\-relief \fIrelief\fR
-\fIRelief\fR specifies the 3-D relief to use for drawing backgrounds,
-in any of the forms accepted by \fBTk_GetRelief\fR.
-This option is used in conjunction with the \fB\-borderwidth\fR
-option to give a 3-D appearance to the background for characters;
-it is ignored unless the \fB\-background\fR option
-has been set for the tag.
+.
+\fIRelief\fR specifies the relief style to use for drawing the border, in any
+of the forms accepted by \fBTk_GetRelief\fR. This option is used in
+conjunction with the \fB\-borderwidth\fR option to enable to the desired
+border appearance.
.TP
\fB\-rmargin \fIpixels\fR
+.
If the first non-elided character of a display line has a tag for which this
-option has been specified, then \fIpixels\fR specifies how wide
-a margin to leave between the end of the line and the right
-edge of the window.
-\fIPixels\fR may have any of the standard forms for screen
-distances.
-This option is only used when wrapping is enabled.
-If a text line wraps, the right margin for each line on the
-display is determined by the first non-elided character of that display
-line.
+option has been specified, then \fIpixels\fR specifies how wide a margin to
+leave between the end of the line and the right edge of the window.
+\fIPixels\fR may have any of the standard forms for screen distances. This
+option is only used when wrapping is enabled. If a text line wraps, the right
+margin for each line on the display is determined by the first non-elided
+character of that display line.
.TP
\fB\-spacing1 \fIpixels\fR
-\fIPixels\fR specifies how much additional space should be
-left above each text line, using any of the standard forms for
-screen distances.
-If a line wraps, this option only applies to the first
-line on the display.
+.
+\fIPixels\fR specifies how much additional space should be left above each
+text line, using any of the standard forms for screen distances. If a line
+wraps, this option only applies to the first line on the display.
.TP
\fB\-spacing2 \fIpixels\fR
-For lines that wrap, this option specifies how much additional
-space to leave between the display lines for a single text line.
-\fIPixels\fR may have any of the standard forms for screen
-distances.
+.
+For lines that wrap, this option specifies how much additional space to leave
+between the display lines for a single text line. \fIPixels\fR may have any of
+the standard forms for screen distances.
.TP
\fB\-spacing3 \fIpixels\fR
-\fIPixels\fR specifies how much additional space should be
-left below each text line, using any of the standard forms for
-screen distances.
-If a line wraps, this option only applies to the last
-line on the display.
+.
+\fIPixels\fR specifies how much additional space should be left below each
+text line, using any of the standard forms for screen distances. If a line
+wraps, this option only applies to the last line on the display.
.TP
\fB\-tabs \fItabList\fR
-\fITabList\fR specifies a set of tab stops in the same form
-as for the \fB\-tabs\fR option for the text widget. This
-option only applies to a display line if it applies to the
-first non-elided character on that display line.
-If this option is specified as an empty string, it cancels
-the option, leaving it unspecified for the tag (the default).
-If the option is specified as a non-empty string that is
-an empty list, such as \fB\-tags\0{\0}\fR, then it requests
-default 8-character tabs as described for the \fB\-tags\fR
-widget option.
+.
+\fITabList\fR specifies a set of tab stops in the same form as for the
+\fB\-tabs\fR option for the text widget. This option only applies to a display
+line if it applies to the first non-elided character on that display line. If
+this option is specified as an empty string, it cancels the option, leaving it
+unspecified for the tag (the default). If the option is specified as a
+non-empty string that is an empty list, such as \fB\-tags\0{\0}\fR, then it
+requests default 8-character tabs as described for the \fB\-tags\fR widget
+option.
.TP
\fB\-tabstyle \fIstyle\fR
-\fIStyle\fR specifies either the \fItabular\fR or
-\fIwordprocessor\fR style of tabbing to use for the text widget.
-This option only applies to a display line if it applies to the
-first non-elided character on that display line.
-If this option is specified as an empty string, it cancels
-the option, leaving it unspecified for the tag (the default).
+.
+\fIStyle\fR specifies either the \fItabular\fR or \fIwordprocessor\fR style of
+tabbing to use for the text widget. This option only applies to a display line
+if it applies to the first non-elided character on that display line. If this
+option is specified as an empty string, it cancels the option, leaving it
+unspecified for the tag (the default).
.TP
\fB\-underline \fIboolean\fR
+.
\fIBoolean\fR specifies whether or not to draw an underline underneath
-characters.
-It may have any of the forms accepted by \fBTcl_GetBoolean\fR.
+characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR.
.TP
\fB\-wrap \fImode\fR
-\fIMode\fR specifies how to handle lines that are wider than the
-text's window.
-It has the same legal values as the \fB\-wrap\fR option
-for the text widget: \fBnone\fR, \fBchar\fR, or \fBword\fR.
-If this tag option is specified, it overrides the \fB\-wrap\fR option
-for the text widget.
-.PP
-If a character has several tags associated with it, and if their
-display options conflict, then the options of the highest priority
-tag are used.
-If a particular display option has not been specified for a
-particular tag, or if it is specified as an empty string, then
-that option will never be used; the next-highest-priority
-tag's option will used instead.
-If no tag specifies a particular display option, then the default
-style for the widget will be used.
-.PP
-The second purpose for tags is event bindings.
-You can associate bindings with a tag in much the same way you can
-associate bindings with a widget class: whenever particular X
-events occur on characters with the given tag, a given
-Tcl command will be executed.
-Tag bindings can be used to give behaviors to ranges of characters;
-among other things, this allows hypertext-like
-features to be implemented.
-For details, see the description of the
+.
+\fIMode\fR specifies how to handle lines that are wider than the text's
+window. It has the same legal values as the \fB\-wrap\fR option for the text
+widget: \fBnone\fR, \fBchar\fR, or \fBword\fR. If this tag option is
+specified, it overrides the \fB\-wrap\fR option for the text widget.
+.PP
+If a character has several tags associated with it, and if their display
+options conflict, then the options of the highest priority tag are used. If a
+particular display option has not been specified for a particular tag, or if
+it is specified as an empty string, then that option will never be used; the
+next-highest-priority tag's option will used instead. If no tag specifies a
+particular display option, then the default style for the widget will be used.
+.PP
+The second purpose for tags is event bindings. You can associate bindings with
+a tag in much the same way you can associate bindings with a widget class:
+whenever particular X events occur on characters with the given tag, a given
+Tcl command will be executed. Tag bindings can be used to give behaviors to
+ranges of characters; among other things, this allows hypertext-like features
+to be implemented. For details, see the description of the
.QW "\fIpathName \fBtag bind\fR"
-widget command below.
-.VS 8.5
-Tag bindings are shared between all peer widgets
+widget command below. Tag bindings are shared between all peer widgets
(including any bindings for the special \fBsel\fR tag).
-.VE 8.5
-.PP
-The third use for tags is in managing the selection.
-See \fBTHE SELECTION\fR below.
-.VS 8.5
-With the exception of the special \fBsel\fR
-tag, all tags are shared between peer text widgets, and may be
-manipulated on an equal basis from any such widget. The \fBsel\fR
-tag exists separately and independently in each peer text widget (but
-any tag bindings to \fBsel\fR are shared).
-.VE 8.5
+.PP
+The third use for tags is in managing the selection. See \fBTHE SELECTION\fR
+below. With the exception of the special \fBsel\fR tag, all tags are shared
+between peer text widgets, and may be manipulated on an equal basis from any
+such widget. The \fBsel\fR tag exists separately and independently in each
+peer text widget (but any tag bindings to \fBsel\fR are shared).
.SH MARKS
.PP
-The second form of annotation in text widgets is a mark.
-Marks are used for remembering particular places in a text.
-They are something like tags, in that they have names and
-they refer to places in the file, but a mark is not associated
-with particular characters.
-Instead, a mark is associated with the gap between two characters.
-Only a single position may be associated with a mark at any given
-time.
-If the characters around a mark are deleted the mark will still
-remain; it will just have new neighbor characters.
-In contrast, if the characters containing a tag are deleted then
-the tag will no longer have an association with characters in
-the file.
-Marks may be manipulated with the
+The second form of annotation in text widgets is a mark. Marks are used for
+remembering particular places in a text. They are something like tags, in that
+they have names and they refer to places in the file, but a mark is not
+associated with particular characters. Instead, a mark is associated with the
+gap between two characters. Only a single position may be associated with a
+mark at any given time. If the characters around a mark are deleted the mark
+will still remain; it will just have new neighbor characters. In contrast, if
+the characters containing a tag are deleted then the tag will no longer have
+an association with characters in the file. Marks may be manipulated with the
.QW "\fIpathName \fBmark\fR"
-widget
-command, and their current locations may be determined by using the
+widget command, and their current locations may be determined by using the
mark name as an index in widget commands.
.PP
Each mark also has a
.QW gravity ,
-which is either \fBleft\fR or \fBright\fR.
-The gravity for a mark specifies what happens to the mark when
-text is inserted at the point of the mark.
-If a mark has left gravity, then the mark is treated as if it
-were attached to the character on its left, so the mark will
-remain to the left of any text inserted at the mark position.
-If the mark has right gravity, new text inserted at the mark
-position will appear to the left of the mark (so that the mark
-remains rightmost). The gravity for a mark defaults to \fBright\fR.
-.PP
-The name space for marks is different from that for tags: the
-same name may be used for both a mark and a tag, but they will refer
-to different things.
-.PP
-Two marks have special significance.
-First, the mark \fBinsert\fR is associated with the insertion cursor,
-as described under \fBTHE INSERTION CURSOR\fR below.
-Second, the mark \fBcurrent\fR is associated with the character
-closest to the mouse and is adjusted automatically to track the
-mouse position and any changes to the text in the widget (one
-exception: \fBcurrent\fR is not updated in response to mouse
-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.
-.VS 8.5
-With the exception of
-these two special marks, all marks are shared between peer text
-widgets, and may be manipulated on an equal basis from any peer.
-.VE 8.5
+which is either \fBleft\fR or \fBright\fR. The gravity for a mark specifies
+what happens to the mark when text is inserted at the point of the mark. If a
+mark has left gravity, then the mark is treated as if it were attached to the
+character on its left, so the mark will remain to the left of any text
+inserted at the mark position. If the mark has right gravity, new text
+inserted at the mark position will appear to the left of the mark (so that the
+mark remains rightmost). The gravity for a mark defaults to \fBright\fR.
+.PP
+The name space for marks is different from that for tags: the same name may be
+used for both a mark and a tag, but they will refer to different things.
+.PP
+Two marks have special significance. First, the mark \fBinsert\fR is
+associated with the insertion cursor, as described under
+\fBTHE INSERTION CURSOR\fR
+below. Second, the mark \fBcurrent\fR is associated with the
+character closest to the mouse and is adjusted automatically to track the
+mouse position and any changes to the text in the widget (one exception:
+\fBcurrent\fR is not updated in response to mouse 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. With the exception of these two
+special marks, all marks are shared between peer text widgets, and may be
+manipulated on an equal basis from any peer.
.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
-at a particular point in the text.
-There may be any number of embedded windows in a text widget,
-and any widget may be used as an embedded window (subject to the
-usual rules for geometry management, which require the text window
-to be the parent of the embedded window or a descendant of its
-parent).
-The embedded window's position on the screen will be updated as the
-text is modified or scrolled, and it will be mapped and unmapped as
-it moves into and out of the visible area of the text widget.
-Each embedded window occupies one
-.VS 8.5
-unit's
-.VE 8.5
-worth of index space
-in the text widget, and it may be referred to either by the name
-of its embedded window or by its position in the widget's
-index space.
-If the range of text containing the embedded window is deleted then
-the window is destroyed.
-.VS 8.5
-Similarly if the text widget as a whole is deleted, then the window is
-destroyed.
-.VE 8.5
-.PP
-When an embedded window is added to a text widget with the
-\fIpathName \fBwindow create\fR widget command, several configuration
-options may be associated with it.
-These options may be modified later with the \fIpathName \fBwindow configure\fR
-widget command.
-The following options are currently supported:
+The third form of annotation in text widgets is an embedded window. Each
+embedded window annotation causes a window to be displayed at a particular
+point in the text. There may be any number of embedded windows in a text
+widget, and any widget may be used as an embedded window (subject to the usual
+rules for geometry management, which require the text window to be the parent
+of the embedded window or a descendant of its parent). The embedded window's
+position on the screen will be updated as the text is modified or scrolled,
+and it will be mapped and unmapped as it moves into and out of the visible
+area of the text widget. Each embedded window occupies one unit's worth of
+index space in the text widget, and it may be referred to either by the name
+of its embedded window or by its position in the widget's index space. If the
+range of text containing the embedded window is deleted then the window is
+destroyed. Similarly if the text widget as a whole is deleted, then the window
+is destroyed.
+.PP
+When an embedded window is added to a text widget with the \fIpathName
+\fBwindow create\fR widget command, several configuration options may be
+associated with it. These options may be modified later with the \fIpathName
+\fBwindow configure\fR widget command. The following options are currently
+supported:
.TP
\fB\-align \fIwhere\fR
-If the window is not as tall as the line in which it is displayed,
-this option determines where the window is displayed in the line.
-\fIWhere\fR must have one of the values \fBtop\fR (align the top of the window
-with the top of the line), \fBcenter\fR (center the window
-within the range of the line), \fBbottom\fR (align the bottom of the
-window with the bottom of the line's area),
-or \fBbaseline\fR (align the bottom of the window with the baseline
-of the line).
+.
+If the window is not as tall as the line in which it is displayed, this option
+determines where the window is displayed in the line. \fIWhere\fR must have
+one of the values \fBtop\fR (align the top of the window with the top of the
+line), \fBcenter\fR (center the window within the range of the line),
+\fBbottom\fR (align the bottom of the window with the bottom of the line's
+area), or \fBbaseline\fR (align the bottom of the window with the baseline of
+the line).
.TP
\fB\-create \fIscript\fR
-Specifies a Tcl script that may be evaluated to create the window
-for the annotation.
-If no \fB\-window\fR option has been specified for the annotation
-this script will be evaluated when the annotation is about to
-be displayed on the screen.
-\fIScript\fR must create a window for the annotation and return
-the name of that window as its result.
-.VS 8.5
-Two substitutions will be performed in \fIscript\fR before evaluation.
-\fI%W\fR will be substituted by the name of the parent text widget,
-and \fI%%\fR will be substituted by a single \fI%\fR.
-.VE 8.5
-If the annotation's window should ever be deleted, \fIscript\fR
-will be evaluated again the next time the annotation is displayed.
+.
+Specifies a Tcl script that may be evaluated to create the window for the
+annotation. If no \fB\-window\fR option has been specified for the annotation
+this script will be evaluated when the annotation is about to be displayed on
+the screen. \fIScript\fR must create a window for the annotation and return
+the name of that window as its result. Two substitutions will be performed in
+\fIscript\fR before evaluation. \fI%W\fR will be substituted by the name of
+the parent text widget, and \fI%%\fR will be substituted by a single \fI%\fR.
+If the annotation's window should ever be deleted, \fIscript\fR will be
+evaluated again the next time the annotation is displayed.
.TP
\fB\-padx \fIpixels\fR
-\fIPixels\fR specifies the amount of extra space to leave on
-each side of the embedded window.
-It may have any of the usual forms defined for a screen distance.
+.
+\fIPixels\fR specifies the amount of extra space to leave on each side of the
+embedded window. It may have any of the usual forms defined for a screen
+distance.
.TP
\fB\-pady \fIpixels\fR
-\fIPixels\fR specifies the amount of extra space to leave on
-the top and on the bottom of the embedded window.
-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 window. It may have any of the usual forms defined
+for a screen distance.
.TP
\fB\-stretch \fIboolean\fR
-If the requested height of the embedded window is less than the
-height of the line in which it is displayed, this option can be
-used to specify whether the window should be stretched vertically
-to fill its line.
-If the \fB\-pady\fR option has been specified as well, then the
-requested padding will be retained even if the window is
-stretched.
+.
+If the requested height of the embedded window is less than the height of the
+line in which it is displayed, this option can be used to specify whether the
+window should be stretched vertically to fill its line. If the \fB\-pady\fR
+option has been specified as well, then the requested padding will be retained
+even if the window is stretched.
.TP
\fB\-window \fIpathName\fR
-Specifies the name of a window to display in the annotation.
-.VS 8.5
-Note that if a \fIpathName\fR has been set, then later configuring a
-window to the empty string will not delete the widget corresponding to
-the old \fIpathName\fR. Rather it will remove the association between
-the old \fIpathName\fR and the text widget. If multiple peer widgets
-are in use, it is usually simpler to use the \fB\-create\fR option if
-embedded windows are desired in each peer.
-.VE 8.5
+.
+Specifies the name of a window to display in the annotation. Note that if a
+\fIpathName\fR has been set, then later configuring a window to the empty
+string will not delete the widget corresponding to the old \fIpathName\fR.
+Rather it will remove the association between the old \fIpathName\fR and the
+text widget. If multiple peer widgets are in use, it is usually simpler to use
+the \fB\-create\fR option if embedded windows are desired in each peer.
.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
-at a particular point in the text.
-There may be any number of embedded images in a text widget,
-and a particular image may be embedded in multiple places in the same
-text widget.
-The embedded image's position on the screen will be updated as the
-text is modified or scrolled.
-Each embedded image occupies one
-.VS 8.5
-unit's
-.VE 8.5
-worth of index space
-in the text widget, and it may be referred to either by
-its position in the widget's index space, or the name it is assigned
-when the image is inserted into the text widget with \fIpathName \fBimage create\fR.
-If the range of text containing the embedded image is deleted then
-that copy of the image is removed from the screen.
+The final form of annotation in text widgets is an embedded image. Each
+embedded image annotation causes an image to be displayed at a particular
+point in the text. There may be any number of embedded images in a text
+widget, and a particular image may be embedded in multiple places in the same
+text widget. The embedded image's position on the screen will be updated as
+the text is modified or scrolled. Each embedded image occupies one unit's
+worth of index space in the text widget, and it may be referred to either by
+its position in the widget's index space, or the name it is assigned when the
+image is inserted into the text widget with \fIpathName \fBimage create\fR. If
+the range of text containing the embedded image is deleted then that copy of
+the image is removed from the screen.
+.PP
+When an embedded image is added to a text widget with the \fIpathName \fBimage
+create\fR widget command, a name unique to this instance of the image is
+returned. This name may then be used to refer to this image instance. The name
+is taken to be the value of the \fB\-name\fR option (described below). If the
+\fB\-name\fR option is not provided, the \fB\-image\fR name is used instead.
+If the \fIimageName\fR is already in use in the text widget, then \fB#\fInn\fR
+is added to the end of the \fIimageName\fR, where \fInn\fR is an arbitrary
+integer. This insures the \fIimageName\fR is unique. Once this name is
+assigned to this instance of the image, it does not change, even though the
+\fB\-image\fR or \fB\-name\fR values can be changed with \fIpathName \fBimage
+configure\fR.
.PP
When an embedded image is added to a text widget with the \fIpathName \fBimage
-create\fR widget command, a name unique to this instance of the image
-is returned. This name may then be used to refer to this image
-instance. The name is taken to be the value of the \fB\-name\fR option
-(described below). If the \fB\-name\fR option is not provided, the
-\fB\-image\fR name is used instead. If the \fIimageName\fR is already
-in use in the text widget, then \fB#\fInn\fR is added to the end of the
-\fIimageName\fR, where \fInn\fR is an arbitrary integer. This insures
-the \fIimageName\fR is unique.
-Once this name is assigned to this instance of the image, it does not
-change, even though the \fB\-image\fR or \fB\-name\fR values can be changed
-with \fIpathName \fBimage configure\fR.
-.PP
-When an embedded image is added to a text widget with the
-\fIpathName \fBimage create\fR widget command, several configuration
-options may be associated with it.
-These options may be modified later with the \fIpathName \fBimage configure\fR
-widget command.
-The following options are currently supported:
+create\fR widget command, several configuration options may be associated with
+it. These options may be modified later with the \fIpathName \fBimage
+configure\fR widget command. The following options are currently supported:
.TP
\fB\-align \fIwhere\fR
-If the image is not as tall as the line in which it is displayed,
-this option determines where the image is displayed in the line.
-\fIWhere\fR must have one of the values \fBtop\fR (align the top of the image
-with the top of the line), \fBcenter\fR (center the image
-within the range of the line), \fBbottom\fR (align the bottom of the
-image with the bottom of the line's area),
-or \fBbaseline\fR (align the bottom of the image with the baseline
-of the line).
+.
+If the image is not as tall as the line in which it is displayed, this option
+determines where the image is displayed in the line. \fIWhere\fR must have one
+of the values \fBtop\fR (align the top of the image with the top of the line),
+\fBcenter\fR (center the image within the range of the line), \fBbottom\fR
+(align the bottom of the image with the bottom of the line's area), or
+\fBbaseline\fR (align the bottom of the image with the baseline of the line).
.TP
\fB\-image \fIimage\fR
-Specifies the name of the Tk image to display in the annotation.
-If \fIimage\fR is not a valid Tk image, then an error is returned.
+.
+Specifies the name of the Tk image to display in the annotation. If
+\fIimage\fR is not a valid Tk image, then an error is returned.
.TP
\fB\-name \fIImageName\fR
-Specifies the name by which this image instance may be referenced in
-the text widget. If \fIImageName\fR is not supplied, then the
-name of the Tk image is used instead.
-If the \fIimageName\fR is already in use, \fI#nn\fR is appended to
-the end of the name as described above.
+.
+Specifies the name by which this image instance may be referenced in the text
+widget. If \fIImageName\fR is not supplied, then the name of the Tk image is
+used instead. If the \fIimageName\fR is already in use, \fI#nn\fR is appended
+to the end of the name as described above.
.TP
\fB\-padx \fIpixels\fR
-\fIPixels\fR specifies the amount of extra space to leave on
-each side of the embedded image.
-It may have any of the usual forms defined for a screen distance.
+.
+\fIPixels\fR specifies the amount of extra space to leave on each side of the
+embedded image. It may have any of the usual forms defined for a screen
+distance.
.TP
\fB\-pady \fIpixels\fR
-\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.
+.
+\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.
.SH "THE SELECTION"
.PP
-Selection support is implemented via tags.
-If the \fBexportSelection\fR option for the text widget is true
-then the \fBsel\fR tag will be associated with the selection:
+Selection support is implemented via tags. If the \fB\-exportselection\fR option
+for the text widget is true then the \fBsel\fR tag will be associated with the
+selection:
.IP [1]
-Whenever characters are tagged with \fBsel\fR the text widget
-will claim ownership of the selection.
+Whenever characters are tagged with \fBsel\fR the text widget will claim
+ownership of the selection.
.IP [2]
-Attempts to retrieve the
-selection will be serviced by the text widget, returning all the
-characters with the \fBsel\fR tag.
+Attempts to retrieve the selection will be serviced by the text widget,
+returning all the characters with the \fBsel\fR tag.
.IP [3]
-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.
+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.
+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
+The \fBsel\fR tag is automatically defined when a text widget is created, and
+it may not be deleted with the
.QW "\fIpathName \fBtag delete\fR"
-widget command. Furthermore, the \fBselectBackground\fR,
-\fBselectBorderWidth\fR, and \fBselectForeground\fR options for
-the text widget are tied to the \fB\-background\fR,
-\fB\-borderwidth\fR, and \fB\-foreground\fR options for the \fBsel\fR
-tag: changes in either will automatically be reflected in the
-other.
-.VS 8.5
-Also the
-\fB\-inactiveselectbackground\fR option for the text widget is used
-instead of \fB\-selectbackground\fR when the text widget does not have
-the focus. This allows programmatic control over the visualization of
-the \fBsel\fR tag for foreground and background windows, or to have
-\fBsel\fR not shown at all (when \fB\-inactiveselectbackground\fR is
-empty) for background windows. Each peer text widget has its own
-\fBsel\fR tag which can be separately configured and set.
-.VE 8.5
+widget command. Furthermore, the \fB\-selectbackground\fR,
+\fB\-selectborderwidth\fR, and \fB\-selectforeground\fR options for the text
+widget are tied to the \fB\-background\fR, \fB\-borderwidth\fR, and
+\fB\-foreground\fR options for the \fBsel\fR tag: changes in either will
+automatically be reflected in the other. Also the
+\fB\-inactiveselectbackground\fR option for the text widget is used instead of
+\fB\-selectbackground\fR when the text widget does not have the focus. This
+allows programmatic control over the visualization of the \fBsel\fR tag for
+foreground and background windows, or to have \fBsel\fR not shown at all (when
+\fB\-inactiveselectbackground\fR is empty) for background windows. Each peer
+text widget has its own \fBsel\fR tag which can be separately configured and
+set.
.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
-may not be unset with the
+The mark named \fBinsert\fR has special significance in text widgets. It is
+defined automatically when a text widget is created and it may not be unset
+with the
.QW "\fIpathName \fBmark unset\fR"
-widget command.
-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.
+widget command. 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 programmatically
-as well. Whenever the flag changes state a \fB<<Modified>>\fR virtual
-event is generated. See the \fIpathName \fBedit modified\fR widget command for
-more details.
+.PP
+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 programmatically as well. Whenever the
+flag changes state a \fB<<Modified>>\fR virtual event is generated. See the
+\fIpathName \fBedit modified\fR widget command for more details.
.SH "THE UNDO MECHANISM"
.PP
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.
+\fB\-undo\fR widget option is true) which records every insert and delete
+action on a stack.
.PP
Boundaries (called
.QW separators )
-are inserted between edit actions. The
-purpose of these separators is to group inserts, deletes and replaces
-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 programmatically 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.
+are inserted between edit actions. The purpose of these separators is to group
+inserts, deletes and replaces 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 programmatically 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 \fIpathName \fBedit\fR widget command that controls the undo
mechanism.
.SH "PEER WIDGETS"
.PP
-.VS 8.5
-The text widget has a separate store of all its data concerning each
-line's textual contents, marks, tags, images and windows, and the undo
-stack.
+The text widget has a separate store of all its data concerning each line's
+textual contents, marks, tags, images and windows, and the undo stack.
.PP
-While this data store cannot be accessed directly (i.e. without a text
-widget as an intermediary), multiple text widgets can be created, each
-of which present different views on the same underlying data. Such
-text widgets are known as peer text widgets.
+While this data store cannot be accessed directly (i.e. without a text widget
+as an intermediary), multiple text widgets can be created, each of which
+present different views on the same underlying data. Such text widgets are
+known as peer text widgets.
.PP
As text is added, deleted, edited and coloured in any one widget, and as
-images, marks, tags are adjusted, all such changes will be reflected in
-all peers.
-.PP
-All data and markup is shared, except for a few small details. First,
-the \fBsel\fR tag may be set and configured (in its display style)
-differently for each peer. Second, each peer has its own \fBinsert\fR
-and \fBcurrent\fR mark positions (but all other marks are shared).
-Third, embedded windows, which are arbitrary other widgets, cannot be
-shared between peers. This means the \fB\-window\fR option of embedded
-windows is independently set for each peer (it is advisable to use
-the \fB\-create\fR script capabilities to allow each peer to create its
-own embedded windows as needed). Fourth, all of the configuration
-options of each peer (e.g. \fB\-font\fR, etc) can be set independently,
-with the exception of \fB\-undo\fR, \fB\-maxUndo\fR, \fB\-autoSeparators\fR
-(i.e. all undo, redo and modified state issues are shared).
-.PP
-Finally any single peer need not contain all lines from the underlying
-data store. When creating a peer, a contiguous range of lines (e.g.
-only lines 52 through 125) may be specified. This allows a peer to
-contain just a small portion of the overall text. The range of lines
-will expand and contract as text is inserted or deleted. The peer will
-only ever display complete lines of text (one cannot share just part of
-a line). If the peer's contents contracts to nothing (i.e. all complete
-lines in the peer widget have been deleted from another widget), then it
-is impossible for new lines to be inserted. The peer will simply become
-an empty shell on which the background can be configured, but which will
-never show any content (without manual reconfiguration of the start and
-end lines). Note that a peer which does not contain all of the
+images, marks, tags are adjusted, all such changes will be reflected in all
+peers.
+.PP
+All data and markup is shared, except for a few small details. First, the
+\fBsel\fR tag may be set and configured (in its display style) differently for
+each peer. Second, each peer has its own \fBinsert\fR and \fBcurrent\fR mark
+positions (but all other marks are shared). Third, embedded windows, which are
+arbitrary other widgets, cannot be shared between peers. This means the
+\fB\-window\fR option of embedded windows is independently set for each peer
+(it is advisable to use the \fB\-create\fR script capabilities to allow each
+peer to create its own embedded windows as needed). Fourth, all of the
+configuration options of each peer (e.g. \fB\-font\fR, etc) can be set
+independently, with the exception of \fB\-undo\fR, \fB\-maxundo\fR,
+\fB\-autoseparators\fR (i.e. all undo, redo and modified state issues are
+shared).
+.PP
+Finally any single peer need not contain all lines from the underlying data
+store. When creating a peer, a contiguous range of lines (e.g. only lines 52
+through 125) may be specified. This allows a peer to contain just a small
+portion of the overall text. The range of lines will expand and contract as
+text is inserted or deleted. The peer will only ever display complete lines of
+text (one cannot share just part of a line). If the peer's contents contracts
+to nothing (i.e. all complete lines in the peer widget have been deleted from
+another widget), then it is impossible for new lines to be inserted. The peer
+will simply become an empty shell on which the background can be configured,
+but which will never show any content (without manual reconfiguration of the
+start and end lines). Note that a peer which does not contain all of the
underlying data store still has indices numbered from
.QW 1.0
to
.QW end .
-It is simply that those indices reflect a subset of the total data, and
-data outside the contained range is not accessible to the peer. This
-means that the command \fIpeerName \fBindex end\fR may return quite different
-values in different peers. Similarly, commands like \fIpeerName \fBtag
-ranges\fR will not return index ranges outside that which is meaningful
-to the peer. The configuration options \fB\-startline\fR and
-\fB\-endline\fR may be used to control how much of the underlying data is
-contained in any given text widget.
-.PP
-Note that peers are really peers. Deleting the
+It is simply that those indices reflect a subset of the total data, and data
+outside the contained range is not accessible to the peer. This means that the
+command \fIpeerName \fBindex end\fR may return quite different values in
+different peers. Similarly, commands like \fIpeerName \fBtag ranges\fR will
+not return index ranges outside that which is meaningful to the peer. The
+configuration options \fB\-startline\fR and \fB\-endline\fR may be used to
+control how much of the underlying data is contained in any given text widget.
+.PP
+Note that peers are really peers. Deleting the
.QW original
text widget will not cause any other peers to be deleted, or otherwise
affected.
.PP
See below for the \fIpathName \fBpeer\fR widget command that controls the
creation of peer widgets.
-.VE 8.5
.SH "WIDGET COMMAND"
.PP
-The \fBtext\fR command creates a new Tcl command whose
-name is the same as the path name of the text's window. This
-command may be used to invoke various
-operations on the widget. It has the following general form:
+The \fBtext\fR command creates a new Tcl command whose name is the same as the
+path name of the text'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 text widget's path name. \fIOption\fR and the \fIarg\fRs
-determine the exact behavior of the command. The following
-commands are possible for text widgets:
+\fIPathName\fR is the name of the command, which is the same as the text
+widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact
+behavior of the command. The following commands are possible for text widgets:
.TP
\fIpathName \fBbbox \fIindex\fR
-Returns a list of four elements describing the screen area
-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 area occupied by the
-character, and the last two elements give the width and height
-of the area.
-If the character is only partially visible on the screen, then
-the return value reflects just the visible part.
-If the character is not visible on the screen then the return
-value is an empty list.
+.
+Returns a list of four elements describing the screen area 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 area occupied by the character,
+and the last two elements give the width and height of the area. If the
+character is only partially visible on the screen, then the return value
+reflects just the visible part. If the character is not visible on the screen
+then the return value is an empty list.
.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 \fBtext\fR
-command.
+.
+Returns the current value of the configuration option given by \fIoption\fR.
+\fIOption\fR may have any of the values accepted by the \fBtext\fR command.
.TP
\fIpathName \fBcompare\fR \fIindex1 op index2\fR
-Compares the indices given by \fIindex1\fR and \fIindex2\fR according
-to the relational operator given by \fIop\fR, and returns 1 if
-the relationship is satisfied and 0 if it is not.
-\fIOp\fR must be one of the operators <, <=, ==, >=, >, or !=.
-If \fIop\fR is == then 1 is returned if the two indices refer to
-the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR
-refers to an earlier character in the text than \fIindex2\fR, and
-so on.
+.
+Compares the indices given by \fIindex1\fR and \fIindex2\fR according to the
+relational operator given by \fIop\fR, and returns 1 if the relationship is
+satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==,
+>=, >, or !=. If \fIop\fR is == then 1 is returned if the two indices refer to
+the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers
+to an earlier character in the text than \fIindex2\fR, and so on.
.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 \fBtext\fR
-command.
-.VS 8.5
+.
+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 \fBtext\fR command.
.TP
\fIpathName \fBcount\fR \fI?options\fR? \fIindex1 index2\fR
-Counts the number of relevant things between the two indices.
-If \fIindex1\fR is after \fIindex2\fR, the result will be a negative number
-(and this holds for each of the possible options).
-The actual items which are counted depend on the
-options given. The result is a list of integers, one for the result of
-each counting option given. Valid counting options are \fB\-chars\fR,
+.
+Counts the number of relevant things between the two indices. If \fIindex1\fR
+is after \fIindex2\fR, the result will be a negative number (and this holds
+for each of the possible options). The actual items which are counted depend
+on the options given. The result is a list of integers, one for the result of
+each counting option given. Valid counting options are \fB\-chars\fR,
\fB\-displaychars\fR, \fB\-displayindices\fR, \fB\-displaylines\fR,
\fB\-indices\fR, \fB\-lines\fR, \fB\-xpixels\fR and \fB\-ypixels\fR. The
default value, if no option is specified, is \fB\-indices\fR. There is an
-additional possible option \fB\-update\fR which is a modifier. If given,
-then all subsequent options ensure that any possible out of date
-information is recalculated. This currently only has any effect for the
-\fI\-ypixels\fR count (which, if \fB\-update\fR is not given, will use the text
-widget's current cached value for each line). The count options are
-interpreted as follows:
+additional possible option \fB\-update\fR which is a modifier. If given, then
+all subsequent options ensure that any possible out of date information is
+recalculated. This currently only has any effect for the \fB\-ypixels\fR count
+(which, if \fB\-update\fR is not given, will use the text widget's current
+cached value for each line). The count options are interpreted as follows:
.RS
.IP \fB\-chars\fR
-count all characters, whether elided or not. Do not count
-embedded windows or images.
+count all characters, whether elided or not. Do not count embedded windows or
+images.
.IP \fB\-displaychars\fR
count all non-elided characters.
.IP \fB\-displayindices\fR
count all non-elided characters, windows and images.
.IP \fB\-displaylines\fR
-count all display lines (i.e. counting one for each
-time a line wraps) from the line of the first index up to, but not
-including the display line of the second index. Therefore if they are
-both on the same display line, zero will be returned. By definition
-displaylines are visible and therefore this only counts portions of
-actual visible lines.
+count all display lines (i.e. counting one for each time a line wraps) from
+the line of the first index up to, but not including the display line of the
+second index. Therefore if they are both on the same display line, zero will
+be returned. By definition displaylines are visible and therefore this only
+counts portions of actual visible lines.
.IP \fB\-indices\fR
-count all characters and embedded windows or images (i.e.
-everything which counts in text-widget index space), whether they are
-elided or not.
+count all characters and embedded windows or images (i.e. everything which
+counts in text-widget index space), whether they are elided or not.
.IP \fB\-lines\fR
-count all logical lines (irrespective of wrapping) from
-the line of the first index up to, but not including the line of the
-second index. Therefore if they are both on the same line, zero will be
-returned. Logical lines are counted whether they are currently visible
-(non-elided) or not.
+count all logical lines (irrespective of wrapping) from the line of the first
+index up to, but not including the line of the second index. Therefore if they
+are both on the same line, zero will be returned. Logical lines are counted
+whether they are currently visible (non-elided) or not.
.IP \fB\-xpixels\fR
-count the number of horizontal pixels from the first
-pixel of the first index to (but not including) the first pixel of the
-second index. To count the total desired width of the text widget
-(assuming wrapping is not enabled), first find the longest line and then
-use
+count the number of horizontal pixels from the first pixel of the first index
+to (but not including) the first pixel of the second index. To count the total
+desired width of the text widget (assuming wrapping is not enabled), first
+find the longest line and then use
.QW ".text count \-xpixels \N'34'${line}.0\N'34' \N'34'${line}.0 lineend\N'34'" .
.IP \fB\-ypixels\fR
-count the number of vertical pixels from the first pixel
-of the first index to (but not including) the first pixel of the second
-index. If both indices are on the same display line, zero will be
-returned. To count the total number of vertical pixels in the text
-widget, use
+count the number of vertical pixels from the first pixel of the first index to
+(but not including) the first pixel of the second index. If both indices are
+on the same display line, zero will be returned. To count the total number of
+vertical pixels in the text widget, use
.QW ".text count \-ypixels 1.0 end" ,
and to ensure this is up to date, use
.QW ".text count \-update \-ypixels 1.0 end" .
.PP
-The command returns a positive or negative integer corresponding to the
-number of items counted between the two indices. One such integer is
-returned for each counting option given, so a list is returned if more
-than one option was supplied. For example
+The command returns a positive or negative integer corresponding to the number
+of items counted between the two indices. One such integer is returned for
+each counting option given, so a list is returned if more than one option was
+supplied. For example
.QW ".text count \-xpixels \-ypixels 1.3 4.5"
is perfectly valid and will return a list of two elements.
.RE
-.VE 8.5
.TP
\fIpathName \fBdebug \fR?\fIboolean\fR?
-If \fIboolean\fR is specified, then it must have one of the true or
-false values accepted by Tcl_GetBoolean.
-If the value is a true one then internal consistency checks will be
-turned on in the B-tree code associated with text widgets.
-If \fIboolean\fR has a false value then the debugging checks will
-be turned off.
-In either case the command returns an empty string.
-If \fIboolean\fR is not specified then the command returns \fBon\fR
-or \fBoff\fR to indicate whether or not debugging is turned on.
-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.
+.
+If \fIboolean\fR is specified, then it must have one of the true or false
+values accepted by Tcl_GetBoolean. If the value is a true one then internal
+consistency checks will be turned on in the B-tree code associated with text
+widgets. If \fIboolean\fR has a false value then the debugging checks will be
+turned off. In either case the command returns an empty string. If
+\fIboolean\fR is not specified then the command returns \fBon\fR or \fBoff\fR
+to indicate whether or not debugging is turned on. 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.
.RS
.PP
-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.
+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.
.RE
.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
-and stopping just before \fIindex2\fR (i.e. the character at
-\fIindex2\fR is not deleted).
-If \fIindex2\fR does not specify a position later in the text
-than \fIindex1\fR then no characters are deleted.
-If \fIindex2\fR is not specified then the single character at
-\fIindex1\fR is deleted.
-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.
-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 so deleted text does not cause an 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.
+.
+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 and stopping just before \fIindex2\fR (i.e. the
+character at \fIindex2\fR is not deleted). If \fIindex2\fR does not specify a
+position later in the text than \fIindex1\fR then no characters are deleted.
+If \fIindex2\fR is not specified then the single character at \fIindex1\fR is
+deleted. 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. 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 so
+deleted text does not cause an 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.
.TP
\fIpathName \fBdlineinfo \fIindex\fR
-Returns a list with five elements describing the area occupied
-by the display line containing \fIindex\fR.
-The first two elements of the list give the x and y coordinates
-of the upper-left corner of the area occupied by the
-line, the third and fourth elements give the width and height
-of the area, and the fifth element gives the position of the baseline
-for the line, measured down from the top of the area.
-All of this information is measured in pixels.
-If the current wrap mode is \fBnone\fR and the line extends beyond
-the boundaries of the window,
-the area returned reflects the entire area of the line, including the
-portions that are out of the window.
-If the line is shorter than the full width of the window then the
-area returned reflects just the portion of the line that is occupied
-by characters and embedded windows.
-If the display line containing \fIindex\fR is not visible on
-the screen then the return value is an empty list.
+.
+Returns a list with five elements describing the area occupied by the display
+line containing \fIindex\fR. The first two elements of the list give the x and
+y coordinates of the upper-left corner of the area occupied by the line, the
+third and fourth elements give the width and height of the area, and the fifth
+element gives the position of the baseline for the line, measured down from
+the top of the area. All of this information is measured in pixels. If the
+current wrap mode is \fBnone\fR and the line extends beyond the boundaries of
+the window, the area returned reflects the entire area of the line, including
+the portions that are out of the window. If the line is shorter than the full
+width of the window then the area returned reflects just the portion of the
+line that is occupied by characters and embedded windows. If the display line
+containing \fIindex\fR is not visible on the screen then the return value is
+an empty list.
.TP
\fIpathName \fBdump \fR?\fIswitches\fR? \fIindex1 \fR?\fIindex2\fR?
-Return the contents of the text widget from \fIindex1\fR up to,
-but not including \fIindex2\fR,
-including the text and
-information about marks, tags, and embedded windows.
-If \fIindex2\fR is not specified, then it defaults to
-one character past \fIindex1\fR. The information is returned
-in the following format:
+.
+Return the contents of the text widget from \fIindex1\fR up to, but not
+including \fIindex2\fR, including the text and information about marks, tags,
+and embedded windows. If \fIindex2\fR is not specified, then it defaults to
+one character past \fIindex1\fR. The information is returned in the following
+format:
.LP
.RS
\fIkey1 value1 index1 key2 value2 index2\fR ...
.LP
-The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR,
-\fBtagon\fR, \fBtagoff\fR, \fBimage\fR, and \fBwindow\fR. The corresponding
-\fIvalue\fR is the text, mark name, tag name, image name, or window name.
-The \fIindex\fR information is the index of the
-start of the text, mark, tag transition, image or window.
-One or more of the following switches (or abbreviations thereof)
+The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR, \fBtagon\fR,
+\fBtagoff\fR, \fBimage\fR, and \fBwindow\fR. The corresponding \fIvalue\fR is
+the text, mark name, tag name, image name, or window name. The \fIindex\fR
+information is the index of the start of the text, mark, tag transition, image
+or window. One or more of the following switches (or abbreviations thereof)
may be specified to control the dump:
.TP
\fB\-all\fR
+.
Return information about all elements: text, marks, tags, images and windows.
This is the default.
.TP
\fB\-command \fIcommand\fR
+.
Instead of returning the information as the result of the dump operation,
invoke the \fIcommand\fR on each element of the text widget within the range.
-The command has three arguments appended to it before it is evaluated:
-the \fIkey\fR, \fIvalue\fR, and \fIindex\fR.
+The command has three arguments appended to it before it is evaluated: the
+\fIkey\fR, \fIvalue\fR, and \fIindex\fR.
.TP
\fB\-image\fR
+.
Include information about images in the dump results.
.TP
\fB\-mark\fR
+.
Include information about marks in the dump results.
.TP
\fB\-tag\fR
-Include information about tag transitions in the dump results. Tag
-information is returned as \fBtagon\fR and \fBtagoff\fR elements that
-indicate the begin and end of each range of each tag, respectively.
+.
+Include information about tag transitions in the dump results. Tag information
+is returned as \fBtagon\fR and \fBtagoff\fR elements that indicate the begin
+and end of each range of each tag, respectively.
.TP
\fB\-text\fR
-Include information about text in the dump results. The value is the
-text up to the next element or the end of range indicated by \fIindex2\fR.
-A text element does not span newlines. A multi-line block of text that
-contains no marks or tag transitions will still be dumped as a set
-of text segments that each end with a newline. The newline is part
-of the value.
+.
+Include information about text in the dump results. The value is the text up
+to the next element or the end of range indicated by \fIindex2\fR. A text
+element does not span newlines. A multi-line block of text that contains no
+marks or tag transitions will still be dumped as a set of text segments that
+each end with a newline. The newline is part of the value.
.TP
\fB\-window\fR
-Include information about embedded windows in the dump results.
-The value of a window is its Tk pathname, unless the window
-has not been created yet. (It must have a create script.)
-In this case an empty string is returned, and you must query the
-window by its index position to get more information.
+.
+Include information about embedded windows in the dump results. The value of a
+window is its Tk pathname, unless the window has not been created yet. (It
+must have a create script.) 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 \fBedit \fIoption \fR?\fIarg arg ...\fR?
-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:
+.
+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.
+\fIpathName \fBedit modified \fR?\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.
+.
+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.
+.
+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.
+.
+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
.TP
-\fIpathName \fBget\fR \fI?\-displaychars?\fR \fI\-\- index1\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
-the one whose index is \fIindex2\fR (the character at \fIindex2\fR
-will not be returned).
-If \fIindex2\fR is omitted then the single character at \fIindex1\fR
-is returned.
-If there are no characters in the specified range (e.g. \fIindex1\fR
-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.
-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 \fIpathName \fBget\fR.
-.VS 8.5
-If the \fB\-displaychars\fR option is given, then, within each range,
-only those characters which are not elided will be returned. This may
-have the effect that some of the returned ranges are empty strings.
-.VE 8.5
+\fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \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 the one whose index is \fIindex2\fR (the character at
+\fIindex2\fR will not be returned). If \fIindex2\fR is omitted then the single
+character at \fIindex1\fR is returned. If there are no characters in the
+specified range (e.g. \fIindex1\fR 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. 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 \fIpathName \fBget\fR. If the \fB\-displaychars\fR option is
+given, then, within each range, only those characters which are not elided
+will be returned. This may have the effect that some of the returned ranges
+are empty strings.
.TP
\fIpathName \fBimage \fIoption \fR?\fIarg arg ...\fR?
-This command is used to manipulate embedded images.
-The behavior of the command depends on the \fIoption\fR argument
-that follows the \fBtag\fR argument.
-The following forms of the command are currently supported:
+.
+This command is used to manipulate embedded images. The behavior of the
+command depends on the \fIoption\fR argument that follows the \fBtag\fR
+argument. The following forms of the command are currently supported:
.RS
.TP
-\fIpathName \fBimage cget\fR \fIindex option\fR
-Returns the value of a configuration option for an embedded image.
-\fIIndex\fR identifies the embedded image, and \fIoption\fR
-specifies a particular configuration option, which must be one of
-the ones listed in the section \fBEMBEDDED IMAGES\fR.
+\fIpathName \fBimage cget \fIindex option\fR
+.
+Returns the value of a configuration option for an embedded image. \fIIndex\fR
+identifies the embedded image, and \fIoption\fR specifies a particular
+configuration option, which must be one of the ones listed in the section
+\fBEMBEDDED IMAGES\fR.
.TP
\fIpathName \fBimage configure \fIindex\fR ?\fIoption value ...\fR?
-Query or modify the configuration options for an embedded image.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for the embedded image at \fIindex\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 option(s) to have the given value(s); in
-this case the command returns an empty string.
-See \fBEMBEDDED IMAGES\fR for information on the options that
-are supported.
+.
+Query or modify the configuration options for an embedded image. If no
+\fIoption\fR is specified, returns a list describing all of the available
+options for the embedded image at \fIindex\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 option(s) to have the
+given value(s); in this case the command returns an empty string. See
+\fBEMBEDDED IMAGES\fR for information on the options that are supported.
.TP
\fIpathName \fBimage create \fIindex\fR ?\fIoption value ...\fR?
-This command creates a new image annotation, which will appear
-in the text at the position given by \fIindex\fR.
-Any number of \fIoption\-value\fR pairs may be specified to
-configure the annotation.
-Returns a unique identifier that may be used as an index to refer to
-this image.
-See \fBEMBEDDED IMAGES\fR for information on the options that
-are supported, and a description of the identifier returned.
+.
+This command creates a new image annotation, which will appear in the text at
+the position given by \fIindex\fR. Any number of \fIoption\-value\fR pairs may
+be specified to configure the annotation. Returns a unique identifier that may
+be used as an index to refer to this image. See \fBEMBEDDED IMAGES\fR for
+information on the options that are supported, and a description of the
+identifier returned.
.TP
\fIpathName \fBimage names\fR
+.
Returns a list whose elements are the names of all image instances currently
embedded in \fIwindow\fR.
.RE
.TP
\fIpathName \fBindex \fIindex\fR
-Returns the position corresponding to \fIindex\fR in the form
-\fIline.char\fR where \fIline\fR is the line number and \fIchar\fR
-is the character number.
+.
+Returns the position corresponding to \fIindex\fR in the form \fIline.char\fR
+where \fIline\fR is the line number and \fIchar\fR is the character number.
\fIIndex\fR may have any of the forms described under \fBINDICES\fR above.
.TP
\fIpathName \fBinsert \fIindex chars \fR?\fItagList chars tagList ...\fR?
+.
Inserts all of the \fIchars\fR arguments just before the character at
-\fIindex\fR.
-If \fIindex\fR refers to the end of the text (the character after
-the last newline) then the new text is inserted just before the
-last newline instead.
-If there is a single \fIchars\fR argument and no \fItagList\fR, then
-the new text will receive any tags that are present on both the
-character before and the character after the insertion point; if a tag
-is present on only one of these characters then it will not be
-applied to the new text.
-If \fItagList\fR is specified then it consists of a list of
-tag names; the new characters will receive all of the tags in
-this list and no others, regardless of the tags present around
-the insertion point.
-If multiple \fIchars\fR\-\fItagList\fR argument pairs are present,
-they produce the same effect as if a separate \fIpathName \fBinsert\fR widget
-command had been issued for each pair, in order.
-The last \fItagList\fR argument may be omitted.
+\fIindex\fR. If \fIindex\fR refers to the end of the text (the character after
+the last newline) then the new text is inserted just before the last newline
+instead. If there is a single \fIchars\fR argument and no \fItagList\fR, then
+the new text will receive any tags that are present on both the character
+before and the character after the insertion point; if a tag is present on
+only one of these characters then it will not be applied to the new text. If
+\fItagList\fR is specified then it consists of a list of tag names; the new
+characters will receive all of the tags in this list and no others, regardless
+of the tags present around the insertion point. If multiple
+\fIchars\fR\-\fItagList\fR argument pairs are present, they produce the same
+effect as if a separate \fIpathName \fBinsert\fR widget command had been
+issued for each pair, in order. The last \fItagList\fR argument may be
+omitted.
.TP
\fIpathName \fBmark \fIoption \fR?\fIarg arg ...\fR?
-This command is used to manipulate marks. The exact behavior of
-the command depends on the \fIoption\fR argument that follows
-the \fBmark\fR argument. The following forms of the command
-are currently supported:
+.
+This command is used to manipulate marks. The exact behavior of the command
+depends on the \fIoption\fR argument that follows the \fBmark\fR argument. The
+following forms of the command are currently supported:
.RS
.TP
\fIpathName \fBmark gravity \fImarkName\fR ?\fIdirection\fR?
-If \fIdirection\fR is not specified, returns \fBleft\fR or \fBright\fR
-to indicate which of its adjacent characters \fImarkName\fR is attached
-to.
-If \fIdirection\fR is specified, it must be \fBleft\fR or \fBright\fR;
-the gravity of \fImarkName\fR is set to the given value.
+.
+If \fIdirection\fR is not specified, returns \fBleft\fR or \fBright\fR to
+indicate which of its adjacent characters \fImarkName\fR is attached to. If
+\fIdirection\fR is specified, it must be \fBleft\fR or \fBright\fR; the
+gravity of \fImarkName\fR is set to the given value.
.TP
\fIpathName \fBmark names\fR
-Returns a list whose elements are the names of all the marks that
-are currently set.
+.
+Returns a list whose elements are the names of all the marks that are
+currently set.
.TP
\fIpathName \fBmark next \fIindex\fR
-Returns the name of the next mark at or after \fIindex\fR.
-If \fIindex\fR is specified in numerical form, then the search for
-the next mark begins at that index.
-If \fIindex\fR is the name of a mark, then the search for
-the next mark begins immediately after that mark.
-This can still return a mark at the same position if
-there are multiple marks at the same index.
-These semantics mean that the \fBmark next\fR operation can be used to
-step through all the marks in a text widget in the same order
-as the mark information returned by the \fIpathName \fBdump\fR operation.
-If a mark has been set to the special \fBend\fR index,
-then it appears to be \fIafter\fR \fBend\fR with respect to the \fIpathName \fBmark next\fR operation.
-An empty string is returned if there are no marks after \fIindex\fR.
+.
+Returns the name of the next mark at or after \fIindex\fR. If \fIindex\fR is
+specified in numerical form, then the search for the next mark begins at that
+index. If \fIindex\fR is the name of a mark, then the search for the next mark
+begins immediately after that mark. This can still return a mark at the same
+position if there are multiple marks at the same index. These semantics mean
+that the \fBmark next\fR operation can be used to step through all the marks
+in a text widget in the same order as the mark information returned by the
+\fIpathName \fBdump\fR operation. If a mark has been set to the special
+\fBend\fR index, then it appears to be \fIafter\fR \fBend\fR with respect to
+the \fIpathName \fBmark next\fR operation. An empty string is returned if
+there are no marks after \fIindex\fR.
.TP
\fIpathName \fBmark previous \fIindex\fR
-Returns the name of the mark at or before \fIindex\fR.
-If \fIindex\fR is specified in numerical form, then the search for
-the previous mark begins with the character just before that index.
-If \fIindex\fR is the name of a mark, then the search for
-the next mark begins immediately before that mark.
-This can still return a mark at the same position if
-there are multiple marks at the same index.
-These semantics mean that the \fIpathName \fBmark previous\fR operation can be used to
-step through all the marks in a text widget in the reverse order
-as the mark information returned by the \fIpathName \fBdump\fR operation.
-An empty string is returned if there are no marks before \fIindex\fR.
+.
+Returns the name of the mark at or before \fIindex\fR. If \fIindex\fR is
+specified in numerical form, then the search for the previous mark begins with
+the character just before that index. If \fIindex\fR is the name of a mark,
+then the search for the next mark begins immediately before that mark. This
+can still return a mark at the same position if there are multiple marks at
+the same index. These semantics mean that the \fIpathName \fBmark previous\fR
+operation can be used to step through all the marks in a text widget in the
+reverse order as the mark information returned by the \fIpathName \fBdump\fR
+operation. An empty string is returned if there are no marks before
+\fIindex\fR.
.TP
\fIpathName \fBmark set \fImarkName index\fR
-Sets the mark named \fImarkName\fR to a position just before the
-character at \fIindex\fR.
-If \fImarkName\fR already exists, it is moved from its old position;
-if it does not exist, a new mark is created.
-This command returns an empty string.
+.
+Sets the mark named \fImarkName\fR to a position just before the character at
+\fIindex\fR. If \fImarkName\fR already exists, it is moved from its old
+position; if it does not exist, a new mark is created. This command returns an
+empty string.
.TP
\fIpathName \fBmark unset \fImarkName \fR?\fImarkName markName ...\fR?
-Remove the mark corresponding to each of the \fImarkName\fR arguments.
-The removed marks will not be usable in indices and will not be
-returned by future calls to
+.
+Remove the mark corresponding to each of the \fImarkName\fR arguments. The
+removed marks will not be usable in indices and will not be returned by future
+calls to
.QW "\fIpathName \fBmark names\fR" .
This command returns an empty string.
.RE
.TP
-\fIpathName \fBpeer\fR \fIoption args\fR
-.VS 8.5
-This command is used to create and query widget peers. It has
-two forms, depending on \fIoption\fR:
+\fIpathName \fBpeer \fIoption args\fR
+.
+This command is used to create and query widget peers. It has two forms,
+depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBpeer create \fInewPathName\fR ?\fIoptions\fR?
-Creates a peer text widget with the given \fInewPathName\fR, and any
-optional standard configuration options (as for the \fItext\fR command).
-By default the peer will have the same start and end line as the
-parent widget, but these can be overridden with the standard
-configuration options.
+.
+Creates a peer text widget with the given \fInewPathName\fR, and any optional
+standard configuration options (as for the \fItext\fR command). By default the
+peer will have the same start and end line as the parent widget, but these can
+be overridden with the standard configuration options.
.TP
\fIpathName \fBpeer names\fR
+.
Returns a list of peers of this widget (this does not include the widget
-itself). The order within this list is undefined.
+itself). The order within this list is undefined.
.RE
.TP
-\fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR?
-Replaces the range of characters between \fIindex1\fR and \fIindex2\fR
-with the given characters and tags. See the section on \fIpathName
-\fBinsert\fR for an explanation of the handling of the \fItagList...\fR
-arguments, and the section on \fIpathName
-\fBdelete\fR for an explanation of the handling of the indices. If
-\fIindex2\fR corresponds to an index earlier in the text than
+\fIpathName \fBreplace \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR?
+.
+Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with
+the given characters and tags. See the section on \fIpathName \fBinsert\fR for
+an explanation of the handling of the \fItagList...\fR arguments, and the
+section on \fIpathName \fBdelete\fR for an explanation of the handling of the
+indices. If \fIindex2\fR corresponds to an index earlier in the text than
\fIindex1\fR, an error will be generated.
.RS
.PP
-The deletion and insertion are arranged so that no unnecessary
-scrolling of the window or movement of insertion cursor occurs. In
-addition the undo/redo stack are correctly modified, if undo operations
-are active in the text widget. The command returns an empty string.
+The deletion and insertion are arranged so that no unnecessary scrolling of
+the window or movement of insertion cursor occurs. In addition the undo/redo
+stack are correctly modified, if undo operations are active in the text
+widget. The command returns an empty string.
.RE
-.VE 8.5
.TP
-\fIpathName \fBscan\fR \fIoption args\fR
-This command is used to implement scanning on texts. It has
-two forms, depending on \fIoption\fR:
+\fIpathName \fBscan \fIoption args\fR
+.
+This command is used to implement scanning on texts. It has two forms,
+depending on \fIoption\fR:
.RS
.TP
\fIpathName \fBscan mark \fIx y\fR
-Records \fIx\fR and \fIy\fR and the current view in the text window,
-for use in conjunction with later \fIpathName \fBscan dragto\fR commands.
-Typically this command is associated with a mouse button press in
-the widget. It returns an empty string.
+.
+Records \fIx\fR and \fIy\fR and the current view in the text window, for use
+in conjunction with later \fIpathName \fBscan dragto\fR commands. Typically
+this command is associated with a mouse button press in the widget. It returns
+an empty string.
.TP
\fIpathName \fBscan dragto \fIx y\fR
-This command computes the difference between its \fIx\fR and \fIy\fR
-arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fIpathName \fBscan mark\fR command for the widget.
-It then adjusts the view by 10 times the difference in coordinates.
-This command is typically associated
-with mouse motion events in the widget, to produce the effect of
-dragging the text at high speed through the window. The return
-value is an empty string.
+.
+This command computes the difference between its \fIx\fR and \fIy\fR arguments
+and the \fIx\fR and \fIy\fR arguments to the last \fIpathName \fBscan mark\fR
+command for the widget. It then adjusts the view by 10 times the difference in
+coordinates. This command is typically associated with mouse motion events in
+the widget, to produce the effect of dragging the text at high speed through
+the window. The return value is an empty string.
.RE
.TP
\fIpathName \fBsearch \fR?\fIswitches\fR? \fIpattern index \fR?\fIstopIndex\fR?
-Searches the text in \fIpathName\fR starting at \fIindex\fR for a range
-of characters that matches \fIpattern\fR.
-If a match is found, the index of the first character in the match is
-returned as result; otherwise an empty string is returned.
-One or more of the following switches (or abbreviations thereof)
+.
+Searches the text in \fIpathName\fR starting at \fIindex\fR for a range of
+characters that matches \fIpattern\fR. If a match is found, the index of the
+first character in the match is returned as result; otherwise an empty string
+is returned. One or more of the following switches (or abbreviations thereof)
may be specified to control the search:
.RS
.TP
\fB\-forwards\fR
-The search will proceed forward through the text, finding the first
-matching range starting at or after the position given by \fIindex\fR.
-This is the default.
+.
+The search will proceed forward through the text, finding the first matching
+range starting at or after the position given by \fIindex\fR. This is the
+default.
.TP
\fB\-backwards\fR
-The search will proceed backward through the text, finding the
-matching range closest to \fIindex\fR whose first character
-is before \fIindex\fR
-.VS 8.5
-(it is not allowed to be at \fIindex\fR). Note that, for a variety of
-reasons, backwards searches can be substantially slower than forwards
-searches (particularly when using \fB\-regexp\fR), so it is recommended
-that performance-critical code use forward searches.
-.VE 8.5
+.
+The search will proceed backward through the text, finding the matching range
+closest to \fIindex\fR whose first character is before \fIindex\fR (it is not
+allowed to be at \fIindex\fR). Note that, for a variety of reasons, backwards
+searches can be substantially slower than forwards searches (particularly when
+using \fB\-regexp\fR), so it is recommended that performance-critical code use
+forward searches.
.TP
\fB\-exact\fR
-Use exact matching: the characters in the matching range must be
-identical to those in \fIpattern\fR.
-This is the default.
+.
+Use exact matching: the characters in the matching range must be identical to
+those in \fIpattern\fR. This is the default.
.TP
\fB\-regexp\fR
-Treat \fIpattern\fR as a regular expression and match it against
-the text using the rules for regular expressions (see the \fBregexp\fR
-command for details).
-.VS 8.5
-The default matching automatically passes
-both the \fB\-lineanchor\fR and \fB\-linestop\fR options
-to the regexp engine (unless \fB\-nolinestop\fR is used), so that
-\fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR
-sequences will never match the newline character \fI\en\fR.
-.VE 8.5
+.
+Treat \fIpattern\fR as a regular expression and match it against the text
+using the rules for regular expressions (see the \fBregexp\fR command
+and the \fBre_syntax\fR page for
+details). The default matching automatically passes both the
+\fB\-lineanchor\fR and \fB\-linestop\fR options to the regexp engine (unless
+\fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line,
+and \fI.\fR, \fI[^\fR sequences will never match the newline character
+\fI\en\fR.
.TP
\fB\-nolinestop\fR
-.VS 8.5
-This allows \fI.\fR and \fI[^\fR sequences to match the newline
-character \fI\en\fR, which they will otherwise not do (see the \fBregexp\fR
-command for details). This option is only meaningful if \fB\-regexp\fR
-is also given, and an error will be thrown otherwise. For example,
-to match the entire text, use
+.
+This allows \fI.\fR and \fI[^\fR sequences to match the newline character
+\fI\en\fR, which they will otherwise not do (see the \fBregexp\fR command for
+details). This option is only meaningful if \fB\-regexp\fR is also given, and
+an error will be thrown otherwise. For example, to match the entire text, use
.QW "\fIpathName \fBsearch \-nolinestop \-regexp\fR \N'34'.*\N'34' 1.0" .
-.VE 8.5
.TP
\fB\-nocase\fR
+.
Ignore case differences between the pattern and the text.
.TP
\fB\-count\fI varName\fR
-The argument following \fB\-count\fR gives the name of a variable;
-if a match is found, the number of index positions between beginning and
-end of the matching range will be stored in the variable. If there are no
-embedded images or windows in the matching range (and there are no
-elided characters if \fB\-elide\fR is not given), this is equivalent to the
-number of characters matched. In either case, the range \fImatchIdx\fR to
-\fImatchIdx + $count chars\fR will return the entire matched text.
+.
+The argument following \fB\-count\fR gives the name of a variable; if a match
+is found, the number of index positions between beginning and end of the
+matching range will be stored in the variable. If there are no embedded images
+or windows in the matching range (and there are no elided characters if
+\fB\-elide\fR is not given), this is equivalent to the number of characters
+matched. In either case, the range \fImatchIdx\fR to \fImatchIdx + $count
+chars\fR will return the entire matched text.
.TP
\fB\-all\fR
-.VS 8.5
-Find all matches in the given range and return a list of the indices of
-the first character of each match. If a \fB\-count\fI varName\fR switch is
-given, then \fIvarName\fR is also set to a list containing one element
-for each successful match. Note that, even for exact searches, the
-elements of this list may be different, if there are embedded images,
-windows or hidden text. Searches with \fB\-all\fR behave very
-similarly to the Tcl command \fBregexp \-all\fR, in that overlapping
-matches are not normally returned. For example, applying an
-\fB\-all\fR search of the pattern
+.
+Find all matches in the given range and return a list of the indices of the
+first character of each match. If a \fB\-count\fI varName\fR switch is given,
+then \fIvarName\fR is also set to a list containing one element for each
+successful match. Note that, even for exact searches, the elements of this
+list may be different, if there are embedded images, windows or hidden text.
+Searches with \fB\-all\fR behave very similarly to the Tcl command \fBregexp
+\-all\fR, in that overlapping matches are not normally returned. For example,
+applying an \fB\-all\fR search of the pattern
.QW \ew+
against
.QW "hello there"
@@ -1605,621 +1445,556 @@ will just match twice, once for each word, and matching
against
.QW ZooZooZoo
will just match once.
-.VE 8.5
.TP
\fB\-overlap\fR
-.VS 8.5
-When performing \fB\-all\fR searches, the normal behaviour is that
-matches which overlap an already-found match will not be returned. This
-switch changes that behaviour so that all matches which are not totally
-enclosed within another match are returned. For example, applying an
-\fB\-overlap\fR search of the pattern
+.
+When performing \fB\-all\fR searches, the normal behaviour is that matches
+which overlap an already-found match will not be returned. This switch changes
+that behaviour so that all matches which are not totally enclosed within
+another match are returned. For example, applying an \fB\-overlap\fR search of
+the pattern
.QW \ew+
against
.QW "hello there"
-will just match twice (i.e. no different to just \fB\-all\fR),
-but matching
+will just match twice (i.e. no different to just \fB\-all\fR), but matching
.QW Z[a\-z]+Z
against
.QW ZooZooZoo
-will now match twice.
-An error will be thrown if this switch is used without \fB\-all\fR.
-.VE 8.5
+will now match twice. An error will be thrown if this switch is used without
+\fB\-all\fR.
.TP
\fB\-strictlimits\fR
-.VS 8.5
-When performing any search, the normal behaviour is that
-the start and stop limits are checked with respect to the
-start of the matching text. With the \fB\-strictlimits\fR flag,
-the entire matching range must lie inside the start and stop
-limits specified for the match to be valid.
-.VE 8.5
+.
+When performing any search, the normal behaviour is that the start and stop
+limits are checked with respect to the start of the matching text. With the
+\fB\-strictlimits\fR flag, the entire matching range must lie inside the start
+and stop limits specified for the match to be valid.
.TP
\fB\-elide\fR
-Find elided (hidden) text as well. By default only displayed text is
-searched.
+.
+Find elided (hidden) text as well. By default only displayed text is searched.
.TP
\fB\-\|\-\fR
-This switch has no effect except to terminate the list of switches:
-the next argument will be treated as \fIpattern\fR even if it starts
-with \fB\-\fR.
-.PP
-.VS 8.5
-The matching range may be within a single line of text, or run across
-multiple lines (if parts of the pattern can match a new-line). For
-regular expression matching one can use the various newline-matching
-features such as \fB$\fR to match the end of a line, \fB^\fR to match
-the beginning of a line, and to control
-whether \fB.\fR is allowed to match a new-line.
-.VE 8.5
-If \fIstopIndex\fR is specified, the search stops at that index:
-for forward searches, no match at or after \fIstopIndex\fR will
-be considered; for backward searches, no match earlier in the
-text than \fIstopIndex\fR will be considered.
-If \fIstopIndex\fR is omitted, the entire text will be searched:
-when the beginning or end of the text is reached, the search
-continues at the other end until the starting location is reached
-again; if \fIstopIndex\fR is specified, no wrap-around will occur.
-This means that, for example, if the search is \fB\-forwards\fR
-but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR,
-nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of
-minor limitations of the \fIpathName \fBsearch\fR command.
+.
+This switch has no effect except to terminate the list of switches: the next
+argument will be treated as \fIpattern\fR even if it starts with \fB\-\fR.
+.PP
+The matching range may be within a single line of text, or run across multiple
+lines (if parts of the pattern can match a new-line). For regular expression
+matching one can use the various newline-matching features such as \fB$\fR to
+match the end of a line, \fB^\fR to match the beginning of a line, and to
+control whether \fB.\fR is allowed to match a new-line. If \fIstopIndex\fR is
+specified, the search stops at that index: for forward searches, no match at
+or after \fIstopIndex\fR will be considered; for backward searches, no match
+earlier in the text than \fIstopIndex\fR will be considered. If
+\fIstopIndex\fR is omitted, the entire text will be searched: when the
+beginning or end of the text is reached, the search continues at the other end
+until the starting location is reached again; if \fIstopIndex\fR is specified,
+no wrap-around will occur. This means that, for example, if the search is
+\fB\-forwards\fR but \fIstopIndex\fR is earlier in the text than
+\fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a
+number of minor limitations of the \fIpathName \fBsearch\fR command.
.RE
.TP
\fIpathName \fBsee \fIindex\fR
-Adjusts the view in the window so that the character given by \fIindex\fR
-is completely visible.
-If \fIindex\fR is already visible then the command does nothing.
-If \fIindex\fR is a short distance out of view, the command
-adjusts the view just enough to make \fIindex\fR visible at the
-edge of the window.
-If \fIindex\fR is far out of view, then the command centers
-\fIindex\fR in the window.
+.
+Adjusts the view in the window so that the character given by \fIindex\fR is
+completely visible. If \fIindex\fR is already visible then the command does
+nothing. If \fIindex\fR is a short distance out of view, the command adjusts
+the view just enough to make \fIindex\fR visible at the edge of the window.
+If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the
+window.
.TP
\fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR?
-This command is used to manipulate tags. The exact behavior of the
-command depends on the \fIoption\fR argument that follows the
-\fBtag\fR argument. The following forms of the command are currently
-supported:
+.
+This command is used to manipulate tags. The exact behavior of the command
+depends on the \fIoption\fR argument that follows the \fBtag\fR argument. The
+following forms of the command are currently supported:
.RS
.TP
\fIpathName \fBtag add \fItagName index1 \fR?\fIindex2 index1 index2 ...\fR?
-Associate the tag \fItagName\fR with all of the characters starting
-with \fIindex1\fR and ending just before
-\fIindex2\fR (the character at \fIindex2\fR is not tagged).
-A single command may contain any number of \fIindex1\fR\-\fIindex2\fR
-pairs.
-If the last \fIindex2\fR is omitted then the single character at
-\fIindex1\fR is tagged.
-If there are no characters in the specified range (e.g. \fIindex1\fR
-is past the end of the file or \fIindex2\fR is less than or equal
-to \fIindex1\fR) then the command has no effect.
+.
+Associate the tag \fItagName\fR with all of the characters starting with
+\fIindex1\fR and ending just before \fIindex2\fR (the character at
+\fIindex2\fR is not tagged). A single command may contain any number of
+\fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the
+single character at \fIindex1\fR is tagged. If there are no characters in the
+specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR
+is less than or equal to \fIindex1\fR) then the command has no effect.
.TP
\fIpathName \fBtag bind \fItagName\fR ?\fIsequence\fR? ?\fIscript\fR?
-This command associates \fIscript\fR with the tag given by
-\fItagName\fR.
-Whenever the event sequence given by \fIsequence\fR occurs for a
-character that has been tagged with \fItagName\fR,
-the script will be invoked.
-This widget command is similar to the \fBbind\fR command except that
-it operates on characters in a text rather than entire widgets.
-See the \fBbind\fR manual entry for complete details
-on the syntax of \fIsequence\fR and the substitutions performed
-on \fIscript\fR before invoking it.
-If all arguments are specified then a new binding is created, replacing
-any existing binding for the same \fIsequence\fR and \fItagName\fR
-(if the first character of \fIscript\fR is
+.
+This command associates \fIscript\fR with the tag given by \fItagName\fR.
+Whenever the event sequence given by \fIsequence\fR occurs for a character
+that has been tagged with \fItagName\fR, the script will be invoked. This
+widget command is similar to the \fBbind\fR command except that it operates on
+characters in a text rather than entire widgets. See the \fBbind\fR manual
+entry for complete details on the syntax of \fIsequence\fR and the
+substitutions performed on \fIscript\fR before invoking it. If all arguments
+are specified then a new binding is created, replacing any existing binding
+for the same \fIsequence\fR and \fItagName\fR (if the first character of
+\fIscript\fR is
.QW +
-then \fIscript\fR augments an existing binding rather than replacing it).
-In this case the return value is an empty string.
-If \fIscript\fR is omitted then the command returns the \fIscript\fR
-associated with \fItagName\fR and \fIsequence\fR (an error occurs
-if there is no such binding).
-If both \fIscript\fR and \fIsequence\fR are omitted then the command
-returns a list of all the sequences for which bindings have been
-defined for \fItagName\fR.
+then \fIscript\fR augments an existing binding rather than replacing it). In
+this case the return value is an empty string. If \fIscript\fR is omitted then
+the command returns the \fIscript\fR associated with \fItagName\fR and
+\fIsequence\fR (an error occurs if there is no such binding). If both
+\fIscript\fR and \fIsequence\fR are omitted then the command returns a list of
+all the sequences for which bindings have been defined for \fItagName\fR.
.RS
.PP
-The only events for which bindings may be specified are those related
-to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
-\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events.
-Event bindings for a text widget use the \fBcurrent\fR mark described
-under \fBMARKS\fR above. An \fBEnter\fR event triggers for a tag when the tag
-first becomes present on the current character, and a \fBLeave\fR event
-triggers for a tag when it ceases to be present on the current character.
-\fBEnter\fR and \fBLeave\fR events can happen either because the
-\fBcurrent\fR mark moved or because the character at that position
-changed. Note that these events are different than \fBEnter\fR and
-\fBLeave\fR events for windows. Mouse and keyboard events are directed
-to the current character. If a virtual event is used in a binding, that
-binding can trigger only if the virtual event is defined by an underlying
+The only events for which bindings may be specified are those related to the
+mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR, \fBButtonPress\fR,
+\fBMotion\fR, and \fBKeyPress\fR) or virtual events. Event bindings for a text
+widget use the \fBcurrent\fR mark described under \fBMARKS\fR above. An
+\fBEnter\fR event triggers for a tag when the tag first becomes present on the
+current character, and a \fBLeave\fR event triggers for a tag when it ceases
+to be present on the current character. \fBEnter\fR and \fBLeave\fR events can
+happen either because the \fBcurrent\fR mark moved or because the character at
+that position changed. Note that these events are different than \fBEnter\fR
+and \fBLeave\fR events for windows. Mouse and keyboard events are directed to
+the current character. If a virtual event is used in a binding, that binding
+can trigger only if the virtual event is defined by an underlying
mouse-related or keyboard-related event.
.PP
-It is possible for the current character to have multiple tags,
-and for each of them to have a binding for a particular event
-sequence.
-When this occurs, one binding is invoked for each tag, in order
-from lowest-priority to highest priority.
-If there are multiple matching bindings for a single tag, then
-the most specific binding is chosen (see the manual entry for
-the \fBbind\fR command for details).
-\fBcontinue\fR and \fBbreak\fR commands within binding scripts
-are processed in the same way as for bindings created with
-the \fBbind\fR command.
-.PP
-If bindings are created for the widget as a whole using the
-\fBbind\fR command, then those bindings will supplement the
-tag bindings.
-The tag bindings will be invoked first, followed by bindings
-for the window as a whole.
+It is possible for the current character to have multiple tags, and for each
+of them to have a binding for a particular event sequence. When this occurs,
+one binding is invoked for each tag, in order from lowest-priority to highest
+priority. If there are multiple matching bindings for a single tag, then the
+most specific binding is chosen (see the manual entry for the \fBbind\fR
+command for details). \fBcontinue\fR and \fBbreak\fR commands within binding
+scripts are processed in the same way as for bindings created with the
+\fBbind\fR command.
+.PP
+If bindings are created for the widget as a whole using the \fBbind\fR
+command, then those bindings will supplement the tag bindings. The tag
+bindings will be invoked first, followed by bindings for the window as a
+whole.
.RE
.TP
-\fIpathName \fBtag cget\fR \fItagName option\fR
+\fIpathName \fBtag cget \fItagName option\fR
+.
This command returns the current value of the option named \fIoption\fR
-associated with the tag given by \fItagName\fR.
-\fIOption\fR may have any of the values accepted by the \fIpathName \fBtag
-configure\fR widget command.
+associated with the tag given by \fItagName\fR. \fIOption\fR may have any of
+the values accepted by the \fIpathName \fBtag configure\fR widget command.
.TP
\fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
-This command is similar to the \fIpathName \fBconfigure\fR widget command except
-that it modifies options associated with the tag given by \fItagName\fR
-instead of modifying options for the overall text widget.
-If no \fIoption\fR is specified, the command returns a list describing
-all of the available options for \fItagName\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 option(s) to have the given value(s) in \fItagName\fR;
-in this case the command returns an empty string.
+.
+This command is similar to the \fIpathName \fBconfigure\fR widget command
+except that it modifies options associated with the tag given by \fItagName\fR
+instead of modifying options for the overall text widget. If no \fIoption\fR
+is specified, the command returns a list describing all of the available
+options for \fItagName\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 option(s) to have the given
+value(s) in \fItagName\fR; in this case the command returns an empty string.
See \fBTAGS\fR above for details on the options available for tags.
.TP
\fIpathName \fBtag delete \fItagName \fR?\fItagName ...\fR?
-Deletes all tag information for each of the \fItagName\fR
-arguments.
-The command removes the tags from all characters in the file
-and also deletes any other information associated with the tags,
-such as bindings and display information.
-The command returns an empty string.
+.
+Deletes all tag information for each of the \fItagName\fR arguments. The
+command removes the tags from all characters in the file and also deletes any
+other information associated with the tags, such as bindings and display
+information. The command returns an empty string.
.TP
\fIpathName\fB tag lower \fItagName \fR?\fIbelowThis\fR?
-Changes the priority of tag \fItagName\fR so that it is just lower
-in priority than the tag whose name is \fIbelowThis\fR.
-If \fIbelowThis\fR is omitted, then \fItagName\fR's priority
-is changed to make it lowest priority of all tags.
+.
+Changes the priority of tag \fItagName\fR so that it is just lower in priority
+than the tag whose name is \fIbelowThis\fR. If \fIbelowThis\fR is omitted,
+then \fItagName\fR's priority is changed to make it lowest priority of all
+tags.
.TP
\fIpathName \fBtag names \fR?\fIindex\fR?
-Returns a list whose elements are the names of all the tags that
-are active at the character position given by \fIindex\fR.
-If \fIindex\fR is omitted, then the return value will describe
-all of the tags that exist for the text (this includes all tags
-that have been named in a
+.
+Returns a list whose elements are the names of all the tags that are active at
+the character position given by \fIindex\fR. If \fIindex\fR is omitted, then
+the return value will describe all of the tags that exist for the text (this
+includes all tags that have been named in a
.QW "\fIpathName \fBtag\fR"
widget command but have not been deleted by a
.QW "\fIpathName \fBtag delete\fR"
-widget command, even if no characters are currently marked with the tag).
-The list will be sorted in order from lowest priority to highest
-priority.
+widget command, even if no characters are currently marked with the tag). The
+list will be sorted in order from lowest priority to highest priority.
.TP
\fIpathName \fBtag nextrange \fItagName index1 \fR?\fIindex2\fR?
-This command searches the text for a range of characters tagged
-with \fItagName\fR where the first character of the range is
-no earlier than the character at \fIindex1\fR and no later than
-the character just before \fIindex2\fR (a range starting at
-\fIindex2\fR will not be considered).
-If several matching ranges exist, the first one is chosen.
-The command's return value is a list containing
-two elements, which are the index of the first character of the
-range and the index of the character just after the last one in
-the range.
-If no matching range is found then the return value is an
-empty string.
-If \fIindex2\fR is not given then it defaults to the end of the text.
+.
+This command searches the text for a range of characters tagged with
+\fItagName\fR where the first character of the range is no earlier than the
+character at \fIindex1\fR and no later than the character just before
+\fIindex2\fR (a range starting at \fIindex2\fR will not be considered). If
+several matching ranges exist, the first one is chosen. The command's return
+value is a list containing two elements, which are the index of the first
+character of the range and the index of the character just after the last one
+in the range. If no matching range is found then the return value is an empty
+string. If \fIindex2\fR is not given then it defaults to the end of the text.
.TP
\fIpathName \fBtag prevrange \fItagName index1 \fR?\fIindex2\fR?
-This command searches the text for a range of characters tagged
-with \fItagName\fR where the first character of the range is
-before the character at \fIindex1\fR and no earlier than
-the character at \fIindex2\fR (a range starting at
-\fIindex2\fR will be considered).
-If several matching ranges exist, the one closest to \fIindex1\fR is chosen.
-The command's return value is a list containing
-two elements, which are the index of the first character of the
-range and the index of the character just after the last one in
-the range.
-If no matching range is found then the return value is an
-empty string.
+.
+This command searches the text for a range of characters tagged with
+\fItagName\fR where the first character of the range is before the character
+at \fIindex1\fR and no earlier than the character at \fIindex2\fR (a range
+starting at \fIindex2\fR will be considered). If several matching ranges
+exist, the one closest to \fIindex1\fR is chosen. The command's return value
+is a list containing two elements, which are the index of the first character
+of the range and the index of the character just after the last one in the
+range. If no matching range is found then the return value is an empty string.
If \fIindex2\fR is not given then it defaults to the beginning of the text.
.TP
\fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR?
-Changes the priority of tag \fItagName\fR so that it is just higher
-in priority than the tag whose name is \fIaboveThis\fR.
-If \fIaboveThis\fR is omitted, then \fItagName\fR's priority
-is changed to make it highest priority of all tags.
+.
+Changes the priority of tag \fItagName\fR so that it is just higher in
+priority than the tag whose name is \fIaboveThis\fR. If \fIaboveThis\fR is
+omitted, then \fItagName\fR's priority is changed to make it highest priority
+of all tags.
.TP
\fIpathName \fBtag ranges \fItagName\fR
-Returns a list describing all of the ranges of text that have been
-tagged with \fItagName\fR.
-The first two elements of the list describe the first tagged range
-in the text, the next two elements describe the second range, and
-so on.
-The first element of each pair contains the index of the first
-character of the range, and the second element of the pair contains
-the index of the character just after the last one in the
-range.
-If there are no characters tagged with \fItag\fR then an
-empty string is returned.
+.
+Returns a list describing all of the ranges of text that have been tagged with
+\fItagName\fR. The first two elements of the list describe the first tagged
+range in the text, the next two elements describe the second range, and so on.
+The first element of each pair contains the index of the first character of
+the range, and the second element of the pair contains the index of the
+character just after the last one in the range. If there are no characters
+tagged with \fItag\fR then an empty string is returned.
.TP
\fIpathName \fBtag remove \fItagName index1 \fR?\fIindex2 index1 index2 ...\fR?
-Remove the tag \fItagName\fR from all of the characters starting
-at \fIindex1\fR and ending just before
-\fIindex2\fR (the character at \fIindex2\fR is not affected).
-A single command may contain any number of \fIindex1\fR\-\fIindex2\fR
-pairs.
-If the last \fIindex2\fR is omitted then the tag is removed from the
-single character at \fIindex1\fR.
-If there are no characters in the specified range (e.g. \fIindex1\fR
-is past the end of the file or \fIindex2\fR is less than or equal
-to \fIindex1\fR) then the command has no effect.
-This command returns an empty string.
+.
+Remove the tag \fItagName\fR from all of the characters starting at
+\fIindex1\fR and ending just before \fIindex2\fR (the character at
+\fIindex2\fR is not affected). A single command may contain any number of
+\fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the
+tag is removed from the single character at \fIindex1\fR. If there are no
+characters in the specified range (e.g. \fIindex1\fR is past the end of the
+file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command
+has no effect. This command returns an empty string.
.RE
.TP
\fIpathName \fBwindow \fIoption \fR?\fIarg arg ...\fR?
-This command is used to manipulate embedded windows.
-The behavior of the command depends on the \fIoption\fR argument
-that follows the \fBtag\fR argument.
-The following forms of the command are currently supported:
+.
+This command is used to manipulate embedded windows. The behavior of the
+command depends on the \fIoption\fR argument that follows the \fBwindow\fR
+argument. The following forms of the command are currently supported:
.RS
.TP
-\fIpathName \fBwindow cget\fR \fIindex option\fR
+\fIpathName \fBwindow cget \fIindex option\fR
+.
Returns the value of a configuration option for an embedded window.
-\fIIndex\fR identifies the embedded window, and \fIoption\fR
-specifies a particular configuration option, which must be one of
-the ones listed in the section \fBEMBEDDED WINDOWS\fR.
+\fIIndex\fR identifies the embedded window, and \fIoption\fR specifies a
+particular configuration option, which must be one of the ones listed in the
+section \fBEMBEDDED WINDOWS\fR.
.TP
\fIpathName \fBwindow configure \fIindex\fR ?\fIoption value ...\fR?
-Query or modify the configuration options for an embedded window.
-If no \fIoption\fR is specified, returns a list describing all of
-the available options for the embedded window at \fIindex\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 option(s) to have the given value(s); in
-this case the command returns an empty string.
-See \fBEMBEDDED WINDOWS\fR for information on the options that
-are supported.
+.
+Query or modify the configuration options for an embedded window. If no
+\fIoption\fR is specified, returns a list describing all of the available
+options for the embedded window at \fIindex\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 option(s) to have the
+given value(s); in this case the command returns an empty string. See
+\fBEMBEDDED WINDOWS\fR for information on the options that are supported.
.TP
\fIpathName \fBwindow create \fIindex\fR ?\fIoption value ...\fR?
-This command creates a new window annotation, which will appear
-in the text at the position given by \fIindex\fR.
-Any number of \fIoption\-value\fR pairs may be specified to
-configure the annotation.
-See \fBEMBEDDED WINDOWS\fR for information on the options that
-are supported.
-Returns an empty string.
+.
+This command creates a new window annotation, which will appear in the text at
+the position given by \fIindex\fR. Any number of \fIoption\-value\fR pairs may
+be specified to configure the annotation. See \fBEMBEDDED WINDOWS\fR for
+information on the options that are supported. Returns an empty string.
.TP
\fIpathName \fBwindow names\fR
-Returns a list whose elements are the names of all windows currently
-embedded in \fIwindow\fR.
+.
+Returns a list whose elements are the names of all windows currently embedded
+in \fIwindow\fR.
.RE
.TP
\fIpathName \fBxview \fIoption args\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:
+.
+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 portion of the document's 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 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.
-The fractions refer only to the lines that are actually visible in the
-window: if the lines in the window are all very short, so that they
-are entirely visible, the returned fractions will be 0 and 1,
-even if there are other lines in the text that are
-much wider than the window.
+.
+Returns a list containing two elements. Each element is a real fraction
+between 0 and 1; together they describe the portion of the document's
+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 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. The fractions refer only to the lines that are
+actually visible in the window: if the lines in the window are all very short,
+so that they are entirely visible, the returned fractions will be 0 and 1,
+even if there are other lines in the text that are much wider than the window.
These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
option.
.TP
\fIpathName \fBxview moveto\fI fraction\fR
-Adjusts the view in the window so that \fIfraction\fR of the horizontal
-span of the text is off-screen to the left.
-\fIFraction\fR is a fraction between 0 and 1.
+.
+Adjusts the view in the window so that \fIfraction\fR of the horizontal span
+of the text is off-screen to the left. \fIFraction\fR is 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.
-\fIWhat\fR must be \fBunits\fR, \fBpages\fR or \fBpixels\fR.
-.VS 8.5
-If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR must be an
-integer, otherwise number may be specified in any of the forms acceptable
-to \fBTk_GetPixels\fR, such as
+\fInumber\fR and \fIwhat\fR. \fIWhat\fR must be \fBunits\fR, \fBpages\fR or
+\fBpixels\fR. If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR
+must be an integer, otherwise number may be specified in any of the forms
+acceptable to \fBTk_GetPixels\fR, such as
.QW 2.0c
or
.QW 1i
-(the result is rounded
-to the nearest integer value. If no units are given, pixels are
-assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
-\fInumber\fR average-width characters on the display; if it is
+(the result is rounded to the nearest integer value. If no units are given,
+pixels are assumed). 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 it is
-\fBpixels\fR then the view adjusts by \fInumber\fR pixels. If
-.VE 8.5
-\fInumber\fR is negative then characters farther to the left become
-visible; if it is positive then characters farther to the right become
-visible.
+\fBpixels\fR then the view adjusts by \fInumber\fR pixels. If \fInumber\fR is
+negative then characters farther to the left become visible; if it is positive
+then characters farther to the right become visible.
.RE
.TP
-\fIpathName \fByview \fI?args\fR?
-This command is used to query and change the vertical position of the
-text in the widget's window.
-It can take any of the following forms:
+\fIpathName \fByview \fR?\fIargs\fR?
+.
+This command is used to query and change the vertical position of the text in
+the widget's window. It can take any of the following forms:
.RS
.TP
\fIpathName \fByview\fR
+.
Returns a list containing two elements, both of which are real fractions
-between 0 and 1.
-The first element gives the position of the first visible pixel of the
-first character (or image, etc) in the
-top line in the window, relative to the text as a whole (0.5 means
-it is halfway through the text, for example).
-The second element gives the position of the first pixel just after the
-last visible one in the bottom line of the window,
-relative to the text as a whole.
-These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR
-option.
+between 0 and 1. The first element gives the position of the first visible
+pixel of the first character (or image, etc) in the top line in the window,
+relative to the text as a whole (0.5 means it is halfway through the text, for
+example). The second element gives the position of the first pixel just after
+the last visible one in the bottom line of the window, relative to the text as
+a whole. These are the same values passed to scrollbars via the
+\fB\-yscrollcommand\fR option.
.TP
\fIpathName \fByview moveto\fI fraction\fR
+.
Adjusts the view in the window so that the pixel given by \fIfraction\fR
-appears at the top of the top line of the window.
-\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first
-pixel of the first character in the text, 0.33 indicates the pixel that is
-one-third the way through the text; and so on.
-.VS 8.5
-Values close to 1 will
-indicate values close to the last pixel in the text (1 actually refers
-to one pixel beyond the last pixel), but in such cases the widget will
-never scroll beyond the last pixel, and so a value of 1 will effectively
-be rounded back to whatever fraction ensures the last pixel is at the
-bottom of the window, and some other pixel is at the top.
-.VE 8.5
+appears at the top of the top line of the window. \fIFraction\fR is a fraction
+between 0 and 1; 0 indicates the first pixel of the first character in the
+text, 0.33 indicates the pixel that is one-third the way through the text; and
+so on. Values close to 1 will indicate values close to the last pixel in the
+text (1 actually refers to one pixel beyond the last pixel), but in such cases
+the widget will never scroll beyond the last pixel, and so a value of 1 will
+effectively be rounded back to whatever fraction ensures the last pixel is at
+the bottom of the window, and some other pixel is at the top.
.TP
\fIpathName \fByview scroll \fInumber what\fR
+.
This command adjust the view in the window up or down according to
-\fInumber\fR and \fIwhat\fR.
-\fIWhat\fR must be \fBunits\fR, \fBpages\fR or \fBpixels\fR.
-.VS 8.5
-If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR must be an
-integer, otherwise number may be specified in any of the forms acceptable
-to \fBTk_GetPixels\fR, such as
+\fInumber\fR and \fIwhat\fR. \fIWhat\fR must be \fBunits\fR, \fBpages\fR or
+\fBpixels\fR. If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR
+must be an integer, otherwise number may be specified in any of the forms
+acceptable to \fBTk_GetPixels\fR, such as
.QW 2.0c
or
.QW 1i
-(the result is rounded
-to the nearest integer value. If no units are given, pixels are
-assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
-\fInumber\fR lines on the display; if it is \fBpages\fR then the view
+(the result is rounded to the nearest integer value. If no units are given,
+pixels are assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts up or down
+by \fInumber\fR lines on the display; if it is \fBpages\fR then the view
adjusts by \fInumber\fR screenfuls; if it is \fBpixels\fR then the view
-adjusts by \fInumber\fR pixels.
-.VE 8.5
-If \fInumber\fR is negative then earlier positions in the text
-become visible; if it is positive then later positions in the text
-become visible.
+adjusts by \fInumber\fR pixels. If \fInumber\fR is negative then earlier
+positions in the text become visible; if it is positive then later positions
+in the text become visible.
.TP
\fIpathName \fByview \fR?\fB\-pickplace\fR? \fIindex\fR
-Changes the view in the widget's window to make \fIindex\fR visible.
-If the \fB\-pickplace\fR option is not specified then \fIindex\fR will
-appear at the top of the window.
-If \fB\-pickplace\fR is specified then the widget chooses where
-\fIindex\fR appears in the window:
+.
+Changes the view in the widget's window to make \fIindex\fR visible. If the
+\fB\-pickplace\fR option is not specified then \fIindex\fR will appear at the
+top of the window. If \fB\-pickplace\fR is specified then the widget chooses
+where \fIindex\fR appears in the window:
.RS
.IP [1]
-If \fIindex\fR is already visible somewhere in the window then the
-command does nothing.
+If \fIindex\fR is already visible somewhere in the window then the command
+does nothing.
.IP [2]
-If \fIindex\fR is only a few lines off-screen above the window then
-it will be positioned at the top of the window.
+If \fIindex\fR is only a few lines off-screen above the window then it will be
+positioned at the top of the window.
.IP [3]
-If \fIindex\fR is only a few lines off-screen below the window then
-it will be positioned at the bottom of the window.
+If \fIindex\fR is only a few lines off-screen below the window then it will be
+positioned at the bottom of the window.
.IP [4]
Otherwise, \fIindex\fR will be centered in the window.
-.LP
-The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR widget
-command (\fIpathName \fBsee\fR handles both x- and y-motion to make a location
-visible, whereas the \fB\-pickplace\fR mode only handles motion in y).
+.PP
+The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR
+widget command (\fIpathName \fBsee\fR handles both x- and y-motion to make a
+location visible, whereas the \fB\-pickplace\fR mode only handles motion in
+y).
.RE
.TP
\fIpathName \fByview \fInumber\fR
-This command makes the first character on the line after
-the one given by \fInumber\fR visible at the top of the window.
-\fINumber\fR must be an integer.
-This command used to be used for scrolling, but now it is obsolete.
+.
+This command makes the first character on the line after the one given by
+\fInumber\fR visible at the top of the window. \fINumber\fR must be an
+integer. This command used to be used for scrolling, but now it is obsolete.
.RE
.SH BINDINGS
.PP
-Tk automatically creates class bindings for texts that give them
-the following default behavior.
-In the descriptions below,
+Tk automatically creates class bindings for texts that give them the following
+default behavior. In the descriptions below,
.QW word
-is dependent on the value of
-the \fBtcl_wordchars\fR variable. See \fBtclvars\fR(n).
+is dependent on the value of the \fBtcl_wordchars\fR variable. See
+\fBtclvars\fR(n).
.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.
+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 start of the word.
-Dragging after a double click will stroke out a selection consisting
-of whole words.
+Double-clicking with mouse button 1 selects the word under the mouse and
+positions the insertion cursor at the start 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 the line under the mouse
-and positions the insertion cursor at the start of the line.
-Dragging after a triple click will stroke out a selection consisting
-of whole lines.
+Triple-clicking with mouse button 1 selects the line under the mouse and
+positions the insertion cursor at the start of the line. Dragging after a
+triple click will stroke out a selection consisting of whole lines.
.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; if it is triple-clicked
-then the selection will be adjusted in units of whole lines.
+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; if it is triple-clicked then the selection will be adjusted in
+units of whole lines.
.IP [5]
Clicking mouse button 1 with the Control key down will reposition the
insertion cursor without affecting the selection.
.IP [6]
-If any normal printing characters are typed, they are
-inserted at the point of the insertion cursor.
-.IP [7]
-The view in the widget 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 text at the position of the mouse cursor.
-The Insert key also inserts the selection, but at the position of
+If any normal printing characters are typed, they are inserted at the point of
the insertion cursor.
+.IP [7]
+The view in the widget 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 text at the position of the mouse cursor. The Insert key also inserts
+the selection, but at the position of the insertion cursor.
.IP [8]
-If the mouse is dragged out of the widget
-while button 1 is pressed, the entry will automatically scroll to
-make more text visible (if there is more text off-screen on the side
-where the mouse left the window).
+If the mouse is dragged out of the widget while button 1 is pressed, the entry
+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 text.
-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.
+The Left and Right keys move the insertion cursor one character to the left or
+right; they also clear any selection in the text. 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 Up and Down keys move the insertion cursor one line up or
-down and clear any selection in the text.
-If Up 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-Up and Control-Down move the insertion cursor by paragraphs (groups
-of lines separated by blank lines), and
-Control-Shift-Up and Control-Shift-Down move the insertion cursor
-by paragraphs and also extend the selection.
-Control-p and Control-n behave the same as Up and Down, respectively.
+The Up and Down keys move the insertion cursor one line up or down and clear
+any selection in the text. If Up 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-Up and Control-Down move the insertion cursor by
+paragraphs (groups of lines separated by blank lines), and Control-Shift-Up
+and Control-Shift-Down move the insertion cursor by paragraphs and also extend
+the selection. Control-p and Control-n behave the same as Up and Down,
+respectively.
.IP [11]
-The Next and Prior keys move the insertion cursor forward or backwards
-by one screenful and clear any selection in the text.
-If the Shift key is held down while Next or Prior is typed, then
-the selection is extended to include the new character.
+The Next and Prior keys move the insertion cursor forward or backwards by one
+screenful and clear any selection in the text. If the Shift key is held down
+while Next or Prior is typed, then the selection is extended to include the
+new character.
.IP [12]
Control-Next and Control-Prior scroll the view right or left by one page
without moving the insertion cursor or affecting the selection.
.IP [13]
-Home and Control-a move the insertion cursor to the
-beginning of its display line and clear any selection in the widget.
-Shift-Home moves the insertion cursor to the beginning of the display line
-and also extends the selection to that point.
+Home and Control-a move the insertion cursor to the beginning of its display
+line and clear any selection in the widget. Shift-Home moves the insertion
+cursor to the beginning of the display line and also extends the selection to
+that point.
.IP [14]
-End and Control-e move the insertion cursor to the
-end of the display line and clear any selection in the widget.
-Shift-End moves the cursor to the end of the display line and extends
-the selection to that point.
+End and Control-e move the insertion cursor to the end of the display line and
+clear any selection in the widget. Shift-End moves the cursor to the end of
+the display line and extends the selection to that point.
.IP [15]
-Control-Home and Meta-< move the insertion cursor to the beginning of
-the text and clear any selection in the widget.
-Control-Shift-Home moves the insertion cursor to the beginning of the text
-and also extends the selection to that point.
+Control-Home and Meta-< move the insertion cursor to the beginning of the text
+and clear any selection in the widget. Control-Shift-Home moves the insertion
+cursor to the beginning of the text and also extends the selection to that
+point.
.IP [16]
-Control-End and Meta-> move the insertion cursor to the end of the
-text and clear any selection in the widget.
-Control-Shift-End moves the cursor to the end of the text and extends
-the selection to that point.
+Control-End and Meta-> move the insertion cursor to the end of the text and
+clear any selection in the widget. Control-Shift-End moves the cursor to the
+end of the text and extends the selection to that point.
.IP [17]
-The Select key and Control-Space set the selection anchor to the position
-of the insertion cursor. They do not 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.
+The Select key and Control-Space set the selection anchor to the position of
+the insertion cursor. They do not 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 [18]
Control-/ selects the entire contents of the widget.
.IP [19]
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.
-This action is carried out by the command \fBtk_textCopy\fR.
+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. This
+action is carried out by the command \fBtk_textCopy\fR.
.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.
-This action is carried out by the command \fBtk_textCut\fR.
-If there is no selection in the widget then these keys have no effect.
+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. This
+action is carried out by the command \fBtk_textCut\fR. 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.
-This action is carried out by the command \fBtk_textPaste\fR.
+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. This action
+is carried out by the command \fBtk_textPaste\fR.
.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
-the insertion cursor.
+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 the insertion
+cursor.
.IP [24]
-Backspace and Control-h delete the selection, if there is one
-in the widget.
-If there is no selection, they delete the character to the left of
-the insertion cursor.
+Backspace and Control-h delete the selection, if there is one in the widget.
+If there is no selection, they delete the character to the left of the
+insertion cursor.
.IP [25]
Control-d deletes the character to the right of the insertion cursor.
.IP [26]
Meta-d deletes the word to the right of the insertion cursor.
.IP [27]
-Control-k deletes from the insertion cursor to the end of its line;
-if the insertion cursor is already at the end of a line, then
-Control-k deletes the newline character.
+Control-k deletes from the insertion cursor to the end of its line; if the
+insertion cursor is already at the end of a line, then Control-k deletes the
+newline character.
.IP [28]
-Control-o opens a new line by inserting a newline character in
-front of the insertion cursor without moving the insertion cursor.
+Control-o opens a new line by inserting a newline character in front of the
+insertion cursor without moving the insertion cursor.
.IP [29]
-Meta-backspace and Meta-Delete delete the word to the left of the
-insertion cursor.
+Meta-backspace and Meta-Delete delete the word to the left of the insertion
+cursor.
.IP [30]
-Control-x deletes whatever is selected in the text widget
-after copying it to the clipboard.
+Control-x deletes whatever is selected in the text widget after copying it to
+the clipboard.
.IP [31]
-Control-t reverses the order of the two characters to the right of
-the insertion cursor.
+Control-t reverses the order of the two characters to the right of the
+insertion cursor.
.IP [32]
-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.
+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.
+Control-Z (or Control-y on Windows) reapplies the last undone edit action if
+the \fB\-undo\fR option is true. Does nothing otherwise.
.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,
-but no insertion cursor will be displayed and no text modifications will
-take place.
+If the widget is disabled using the \fB\-state\fR option, then its view can
+still be adjusted and text can still be selected, but no insertion cursor will
+be displayed and no text modifications will take place.
.PP
-The behavior of texts can be changed by defining new bindings for
-individual widgets or by redefining the class bindings.
+The behavior of texts can be changed by defining new bindings for individual
+widgets or by redefining the class bindings.
.SH "KNOWN ISSUES"
.SS "ISSUES CONCERNING CHARS AND INDICES"
-.VS 8.5
.PP
Before Tk 8.5, the widget used the string
.QW chars
-to refer to index positions (which included characters, embedded
-windows and embedded images). As of Tk 8.5 the text widget deals
-separately and correctly with
+to refer to index positions (which included characters, embedded windows and
+embedded images). As of Tk 8.5 the text widget deals separately and correctly
+with
.QW chars
and
.QW indices .
@@ -2227,89 +2002,78 @@ For backwards compatibility, however, the index modifiers
.QW "+N chars"
and
.QW "\-N chars"
-continue to refer to indices.
-One must use any of the full forms
+continue to refer to indices. One must use any of the full forms
.QW "+N any chars"
or
.QW "\-N any chars"
-etc. to refer to actual character indices. This confusion may be fixed in a
+etc. to refer to actual character indices. This confusion may be fixed in a
future release by making the widget correctly interpret
.QW "+N chars"
as a synonym for
.QW "+N any chars" .
-.VE 8.5
.SS "PERFORMANCE ISSUES"
.PP
-Text widgets should run efficiently under a variety
-of conditions. The text widget uses about 2-3 bytes of
-main memory for each byte of text, so texts containing a megabyte
-or more should be practical on most workstations.
-Text is represented internally with a modified B-tree structure
-that makes operations relatively efficient even with large texts.
-Tags are included in the B-tree structure in a way that allows
-tags to span large ranges or have many disjoint smaller ranges
-without loss of efficiency.
-Marks are also implemented in a way that allows large numbers of
-marks.
-In most cases it is fine to have large numbers of unique tags,
-or a tag that has many distinct ranges.
-.PP
-One performance problem can arise if you have hundreds or thousands
-of different tags that all have the following characteristics:
-the first and last ranges of each tag are near the beginning and
-end of the text, respectively,
-or a single tag range covers most of the text widget.
-The cost of adding and deleting tags like this is proportional
-to the number of other tags with the same properties.
-In contrast, there is no problem with having thousands of distinct
-tags if their overall ranges are localized and spread uniformly throughout
-the text.
-.PP
-Very long text lines can be expensive,
-especially if they have many marks and tags within them.
-.PP
-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\fR attribute to 0 avoid this.
+Text widgets should run efficiently under a variety of conditions. The text
+widget uses about 2-3 bytes of main memory for each byte of text, so texts
+containing a megabyte or more should be practical on most workstations. Text
+is represented internally with a modified B-tree structure that makes
+operations relatively efficient even with large texts. Tags are included in
+the B-tree structure in a way that allows tags to span large ranges or have
+many disjoint smaller ranges without loss of efficiency. Marks are also
+implemented in a way that allows large numbers of marks. In most cases it is
+fine to have large numbers of unique tags, or a tag that has many distinct
+ranges.
+.PP
+One performance problem can arise if you have hundreds or thousands of
+different tags that all have the following characteristics: the first and last
+ranges of each tag are near the beginning and end of the text, respectively,
+or a single tag range covers most of the text widget. The cost of adding and
+deleting tags like this is proportional to the number of other tags with the
+same properties. In contrast, there is no problem with having thousands of
+distinct tags if their overall ranges are localized and spread uniformly
+throughout the text.
+.PP
+Very long text lines can be expensive, especially if they have many marks and
+tags within them.
+.PP
+The display line with the insert cursor is redrawn each time the cursor
+blinks, which causes a steady stream of graphics traffic. Set the
+\fB\-insertofftime\fR attribute to 0 avoid this.
.SS "KNOWN BUGS"
-.VS 8.5
-.PP
-The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform sophisticated
-regexp matching across multiple lines in an efficient fashion (since Tk
-8.5), examining each line individually, and then in small groups of lines,
-whether searching forwards or backwards. Under certain conditions the
-search result might differ from that obtained by applying the same regexp
-to the entire text from the widget in one go. For example, when
-searching with a greedy regexp, the widget will continue to attempt to
-add extra lines to the match as long as one of two conditions are true:
-either Tcl's regexp library returns a code to indicate a longer match is
-possible (but there are known bugs in Tcl which mean this code is not
-always correctly returned); or if each extra line added results in at
-least a partial match with the pattern. This means in the case where the
-first extra line added results in no match and Tcl's regexp system
-returns the incorrect code and adding a second extra line would actually
-match, the text widget will return the wrong result. In practice this is
-a rare problem, but it can occur, for example:
+.PP
+The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform
+sophisticated regexp matching across multiple lines in an efficient fashion
+(since Tk 8.5), examining each line individually, and then in small groups of
+lines, whether searching forwards or backwards. Under certain conditions the
+search result might differ from that obtained by applying the same regexp to
+the entire text from the widget in one go. For example, when searching with a
+greedy regexp, the widget will continue to attempt to add extra lines to the
+match as long as one of two conditions are true: either Tcl's regexp library
+returns a code to indicate a longer match is possible (but there are known
+bugs in Tcl which mean this code is not always correctly returned); or if each
+extra line added results in at least a partial match with the pattern. This
+means in the case where the first extra line added results in no match and
+Tcl's regexp system returns the incorrect code and adding a second extra line
+would actually match, the text widget will return the wrong result. In
+practice this is a rare problem, but it can occur, for example:
.CS
-pack [text .t]
+pack [\fBtext\fR .t]
\.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en"
\.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0
.CE
-will not find a match when one exists of 19
-characters starting from the first
+will not find a match when one exists of 19 characters starting from the first
.QW b .
.PP
-Whenever one possible match is fully enclosed in another, the search
-command will attempt to ensure only the larger match is returned.
-When performing backwards regexp searches it is possible that Tcl
-will not always achieve this, in the case where a match is preceded by
-one or more short, non-overlapping matches, all of which are preceded
-by a large match which actually encompasses all of them. The search
-algorithm used by the widget does not look back arbitrarily far for a
-possible match which might cover large portions of the widget.
-For example:
+Whenever one possible match is fully enclosed in another, the search command
+will attempt to ensure only the larger match is returned. When performing
+backwards regexp searches it is possible that Tcl will not always achieve
+this, in the case where a match is preceded by one or more short,
+non-overlapping matches, all of which are preceded by a large match which
+actually encompasses all of them. The search algorithm used by the widget does
+not look back arbitrarily far for a possible match which might cover large
+portions of the widget. For example:
.CS
-pack [text .t]
+pack [\fBtext\fR .t]
\.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n"
\.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end
.CE
@@ -2326,8 +2090,10 @@ and
when really it should only match at
.QW 1.0
since that match encloses all the others.
-.VE 8.5
.SH "SEE ALSO"
entry(n), scrollbar(n)
.SH KEYWORDS
text, widget, tkvars
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/tk.n b/doc/tk.n
index 377aa91..815af84 100644
--- a/doc/tk.n
+++ b/doc/tk.n
@@ -14,7 +14,6 @@ tk \- Manipulate Tk internal state
.SH SYNOPSIS
\fBtk\fR \fIoption \fR?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBtk\fR command provides access to miscellaneous
@@ -46,7 +45,14 @@ If sends have been disabled by deleting the \fBsend\fR command,
this command will reenable them and recreate the \fBsend\fR
command.
.TP
-\fBtk caret window \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
+\fBtk busy \fIsubcommand\fR ...
+.
+This command controls the marking of window hierarchies as
+.QW busy ,
+rendering them non-interactive while some other operation is proceeding. For
+more details see the \fBbusy\fR manual page.
+.TP
+\fBtk caret \fIwindow \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
@@ -54,17 +60,39 @@ 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
+format. \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and
+\fB\-height\fR is the height of the current cursor location, or the height
of the specified \fIwindow\fR if none is given.
.TP
+\fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR?
+.
+Returns a positive integer, the number of milliseconds since the last
+time the user interacted with the system. If the \fB\-displayof\fR
+option is given then the return value refers to the display of
+\fIwindow\fR; otherwise it refers to the display of the application's
+main window.
+.RS
+.PP
+\fBtk inactive\fR will return \-1, if querying the user inactive time
+is not supported by the system, and in safe interpreters.
+.PP
+If the literal string \fBreset\fR is given as an additional argument,
+the timer is reset and an empty string is returned. Resetting the
+inactivity time is forbidden in safe interpreters and will throw an
+error if tried.
+.RE
+.TP
+\fBtk fontchooser \fIsubcommand\fR ...
+Controls the Tk font selection dialog. For more details see the
+\fBfontchooser\fR manual page.
+.TP
\fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
.
Sets and queries the current scaling factor used by Tk to convert between
physical units (for example, points, inches, or millimeters) and pixels. The
\fInumber\fR argument is a floating point number that specifies the number of
pixels per point on \fIwindow\fR's display. If the \fIwindow\fR argument is
-omitted, it defaults to the main window. If the \fInumber\fR argument is
+omitted, it defaults to the main window. If the \fInumber\fR argument is
omitted, the current value of the scaling factor is returned.
.RS
.PP
@@ -83,24 +111,6 @@ is undefined whether existing widgets will resize themselves dynamically to
accommodate the new scaling factor.
.RE
.TP
-\fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR?
-.
-Returns a positive integer, the number of milliseconds since the last
-time the user interacted with the system. If the \fB\-displayof\fR
-option is given then the return value refers to the display of
-\fIwindow\fR; otherwise it refers to the display of the application's
-main window.
-.RS
-.PP
-\fBtk inactive\fR will return \-1, if querying the user inactive time
-is not supported by the system, and in safe interpreters.
-.PP
-If the literal string \fBreset\fR is given as an additional argument,
-the timer is reset and an empty string is returned. Resetting the
-inactivity time is forbidden in safe interpreters and will throw and
-error if tried.
-.RE
-.TP
\fBtk useinputmethods \fR?\fB\-displayof \fIwindow\fR? ?\fIboolean\fR?
.
Sets and queries the state of whether Tk should use XIM (X Input Methods)
@@ -117,6 +127,9 @@ Returns the current Tk windowing system, one of
\fBx11\fR (X11-based), \fBwin32\fR (MS Windows),
or \fBaqua\fR (Mac OS X Aqua).
.SH "SEE ALSO"
-send(n), winfo(n)
+busy(n), fontchooser(n), send(n), winfo(n)
.SH KEYWORDS
application name, send
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/tk_mac.n b/doc/tk_mac.n
new file mode 100644
index 0000000..bf683f8
--- /dev/null
+++ b/doc/tk_mac.n
@@ -0,0 +1,237 @@
+'\"
+'\" Copyright (c) 2011 Kevin Walzer.
+'\" Copyright (c) 2011 Donal K. Fellows.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.so man.macros
+.TH tk::mac n 8.6 Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+tk::mac \- Access Mac-Specific Functionality on OS X from Tk
+.SH SYNOPSIS
+.nf
+\fB::tk::mac::ShowPreferences\fR
+\fB::tk::mac::OpenApplication\fR
+\fB::tk::mac::ReopenApplication\fR
+\fB::tk::mac::OpenDocument \fIfile...\fR
+\fB::tk::mac::PrintDocument \fIfile...\fR
+\fB::tk::mac::Quit\fR
+\fB::tk::mac::OnHide\fR
+\fB::tk::mac::OnShow\fR
+\fB::tk::mac::ShowHelp\fR
+
+\fB::tk::mac::standardAboutPanel\fR
+
+\fB::tk::mac::useCompatibilityMetrics \fIboolean\fR
+\fB::tk::mac::CGAntialiasLimit \fIlimit\fR
+\fB::tk::mac::antialiasedtext \fInumber\fR
+\fB::tk::mac::useThemedToplevel \fIboolean\fR
+
+\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR
+.fi
+.BE
+.SH "EVENT HANDLER CALLBACKS"
+.PP
+The Aqua/Mac OS X application environment defines a number of additional
+events that applications should respond to. These events are mapped by Tk to
+calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if
+the command is absent, no action will be taken.
+.TP
+\fB::tk::mac::ShowPreferences\fR
+.
+The default Apple Event handler for kAEShowPreferences,
+.QW pref .
+The application menu
+.QW "Preferences"
+menu item is only enabled when this proc is defined. Typically this command is
+used to wrap a specific own preferences command, which pops up a preferences
+window. Something like:
+.RS
+.PP
+.CS
+proc ::tk::mac::ShowPreferences {} {
+ setPref
+}
+.CE
+.RE
+.TP
+\fB::tk::mac::OpenApplication\fR
+.
+If a proc of this name is defined, this proc fill fire when your application
+is intially opened. It is the default Apple Event handler for
+kAEOpenApplication,
+.QW oapp .
+.TP
+\fB::tk::mac::ReopenApplication\fR
+.
+If a proc of this name is defined it is the default Apple Event handler for
+kAEReopenApplication,
+.QW rapp ,
+the Apple Event sent when your application is opened when it is already
+running (e.g. by clicking its icon in the Dock). Here is a sample that raises
+a minimized window when the Dock icon is clicked:
+.RS
+.PP
+.CS
+proc ::tk::mac::ReopenApplication {} {
+ if {[wm state .] eq "withdrawn"} {
+ wm state . normal
+ } else {
+ wm deiconify .
+ }
+ raise .
+}
+.CE
+.RE
+.TP
+\fB::tk::mac::OpenDocument \fIfile...\fR
+.
+If a proc of this name is defined it is the default Apple Event handler for
+kAEOpenDocuments,
+.QW odoc ,
+the Apple Event sent when your application is asked to open one or more
+documents (e.g., by drag & drop onto the app or by opening a document of a
+type associated to the app). The proc should take as arguments paths to the
+files to be opened, like so:
+.RS
+.PP
+.CS
+proc ::tk::mac::OpenDocument {args} {
+ foreach f $args {my_open_document $f}
+}
+.CE
+.RE
+.TP
+\fB::tk::mac::PrintDocument \fIfile...\fR
+.
+If a proc of this name is defined it is the default Apple Event handler for
+kAEPrintDocuments,
+.QW pdoc ,
+the Apple Event sent when your application is asked to print one or more
+documents (e.g., via the Print menu item in the Finder). It works the same
+way as \fBtk::mac::OpenDocument\fR in terms of arguments.
+.TP
+\fB::tk::mac::Quit\fR
+.
+If a proc of this name is defined it is the default Apple Event handler for
+kAEQuitApplication,
+.QW quit ,
+the Apple Event sent when your application is asked to be quit, e.g. via the
+quit menu item in the application menu, the quit menu item in the Dock menu,
+or during a logout/restart/shutdown etc. If this is not defined, \fBexit\fR is
+called instead.
+.TP
+\fB::tk::mac::OnHide\fR
+.
+If defined, this is called when your application receives a kEventAppHidden
+event, e.g. via the hide menu item in the application or Dock menus.
+.TP
+\fB::tk::mac::OnShow\fR
+.
+If defined, this is called when your application receives a kEventAppShown
+event, e.g. via the show all menu item in the application menu, or by clicking
+the Dock icon of a hidden application.
+.TP
+\fB::tk::mac::ShowHelp\fR
+.
+Customizes behavior of Apple Help menu; if this procedure is not defined, the
+platform-specific standard Help menu item
+.QW "YourApp Help"
+performs the default Cocoa action of showing the Help Book configured in the
+application's Info.plist (or displaying an alert if no Help Book is set).
+.SH "ADDITIONAL DIALOGS"
+.PP
+The Aqua/Mac OS X defines additional dialogs that applications should
+support.
+.TP
+\fB::tk::mac::standardAboutPanel\fR
+.
+Brings the standard Cocoa about panel to the front, with all its information
+filled in from your application bundle files (standard about panel with no
+options specified). See Apple Technote TN2179 and the AppKit documentation for
+-[NSApplication orderFrontStandardAboutPanelWithOptions:] for details on the
+Info.plist keys and app bundle files used by the about panel.
+.SH "SYSTEM CONFIGURATION"
+.PP
+There are a number of additional global configuration options that control the
+details of how Tk renders by default.
+.TP
+\fB::tk::mac::useCompatibilityMetrics \fIboolean\fR
+.
+Preserves compatibility with older Tk/Aqua metrics; set to \fBfalse\fR for
+more native spacing.
+.TP
+\fB::tk::mac::CGAntialiasLimit \fIlimit\fR
+.
+Sets the antialiasing limit; lines thinner that \fIlimit\fR pixels will not be
+antialiased. Integer, set to 0 by default, making all lines be antialiased.
+.TP
+\fB::tk::mac::antialiasedtext \fInumber\fR
+.
+Sets anti-aliased text. Controls text antialiasing, possible values for
+\fInumber\fR are -1 (default, use system default for text AA), 0 (no text AA),
+1 (use text AA).
+.TP
+\fB::tk::mac::useThemedToplevel \fIboolean\fR
+.
+Sets toplevel windows to draw with the modern grayish/ pinstripe Mac
+background. Equivalent to configuring the toplevel with
+.QW "\fB\-background systemWindowHeaderBackground\fR" ,
+or to using a \fBttk::frame\fR.
+.SH "SUPPORT COMMANDS"
+.TP
+\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR
+.
+Renders native icons and bitmpas in Tk applications (including any image file
+readable by NSImage). A native bitmap name is interpreted as follows (in
+order):
+.RS
+.IP \(bu 3
+predefined builtin 32x32 icon name (\fBstop\fR, \fBcaution\fR, \fBdocument\fR,
+etc.)
+.IP \(bu 3
+\fIname\fR, as defined by \fBtk::mac::iconBitmap\fR
+.IP \(bu 3
+NSImage named image name
+.IP \(bu 3
+NSImage url string
+.IP \(bu 3
+4-char OSType of IconServices icon
+.PP
+The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define
+the dimensions of the image to create, and \fI\-kind\fR must be one of:
+.TP
+\fB\-file\fR
+.
+icon of file at given path
+.TP
+\fB\-fileType\fR
+.
+icon of given file type
+.TP
+\fB\-osType\fR
+.
+icon of given 4-char OSType file type
+.TP
+\fB\-systemType\fR
+.
+icon for given IconServices 4-char OSType
+.TP
+\fB\-namedImage\fR
+.
+named NSImage for given name
+.TP
+\fB\-imageFile\fR
+.
+image at given path
+.RE
+.SH "SEE ALSO"
+bind(n), wm(n)
+.SH KEYWORDS
+about dialog, antialiasing, Apple event, icon, NSImage
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/tkerror.n b/doc/tkerror.n
index b75dcfe..8d45ad2 100644
--- a/doc/tkerror.n
+++ b/doc/tkerror.n
@@ -14,7 +14,6 @@ tkerror \- Command invoked to process background errors
.SH SYNOPSIS
\fBtkerror \fImessage\fR
.BE
-
.SH DESCRIPTION
.PP
Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to
@@ -31,6 +30,8 @@ to the user. If you want your own error management you should
directly override \fBbgerror\fR instead of \fBtkerror\fR.
Documentation for \fBbgerror\fR is available as part of Tcl's
documentation.
-
.SH KEYWORDS
background error, reporting
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/tkvars.n b/doc/tkvars.n
index 9971698..e44cf35 100644
--- a/doc/tkvars.n
+++ b/doc/tkvars.n
@@ -10,20 +10,22 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-tkvars \- Variables used or set by Tk
+geometry, tk_library, tk_patchLevel, tk_strictMotif, tk_version \- Variables used or set by Tk
.BE
-
.SH DESCRIPTION
.PP
The following Tcl variables are either set or used by Tk at various times
in its execution:
.TP 15
\fBtk_library\fR
+.
This variable holds the file name for a directory containing a library
of Tcl scripts related to Tk. These scripts include an initialization
file that is normally processed whenever a Tk application starts up,
plus other files containing procedures that implement default behaviors
for widgets.
+.RS
+.PP
The initial value of \fBtcl_library\fR is set when Tk is added to
an interpreter; this is done by searching several different directories
until one is found that contains an appropriate Tk startup script.
@@ -34,36 +36,34 @@ directory, then Tk checks several other directories based on a
compiled-in default location, the location of the Tcl library directory,
the location of the binary containing the application, and the current
working directory.
+.PP
The variable can be modified by an application to switch to a different
library.
+.RE
.TP
\fBtk_patchLevel\fR
-Contains a decimal integer giving the current patch level for Tk.
+.
+Contains a dot-separated sequence of decimal integers 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
-\fBtk::Priv\fR
-This variable is an array containing several pieces of information
-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.
+.RS
+.PP
+This value is normally the same as the result of
+.QW "\fBpackage require\fR \fBTk\fR" .
+.RE
.TP
\fBtk_strictMotif\fR
+.
This variable is set to zero by default.
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.
+Modern applications should not normally set this variable.
.TP 15
\fBtk_version\fR
+.
Tk sets this variable in the interpreter for each application.
The variable holds the current version number of the Tk
library in the form \fImajor\fR.\fIminor\fR. \fIMajor\fR and
@@ -73,6 +73,38 @@ any Tk release that includes changes that are not backward compatible
work with the new release). The minor version number increases with
each new release of Tk, except that it resets to zero whenever the
major version number changes.
-
+.SS "INTERNAL AND DEBUGGING VARIABLES"
+.PP
+These variables should not normally be set by user code.
+.TP
+\fBtk::Priv\fR
+.
+This variable is an array containing several pieces of information
+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
+\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.
+.SH "OTHER GLOBAL VARIABLES"
+The following variables are only guaranteed to exist in \fBwish\fR
+executables; the Tk library does not define them itself but many Tk
+environments do.
+.TP 6
+\fBgeometry\fR
+.
+If set, contains the user-supplied geometry specification to use for
+the main Tk window.
+.SH "SEE ALSO"
+package(n), tclvars(n), wish(1)
.SH KEYWORDS
-variables, version, text
+environment, text, variables, version
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/tkwait.n b/doc/tkwait.n
index 32bfb44..83586f6 100644
--- a/doc/tkwait.n
+++ b/doc/tkwait.n
@@ -18,7 +18,6 @@ tkwait \- Wait for variable to change or window to be destroyed
.sp
\fBtkwait window \fIname\fR
.BE
-
.SH DESCRIPTION
.PP
The \fBtkwait\fR command waits for one of several things to happen,
@@ -44,6 +43,10 @@ the normal fashion, so the application will continue to respond
to user interactions.
If an event handler invokes \fBtkwait\fR again, the nested call
to \fBtkwait\fR must complete before the outer call can complete.
-
+.SH "SEE ALSO"
+bind(n), vwait(n)
.SH KEYWORDS
variable, visibility, wait, window
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/toplevel.n b/doc/toplevel.n
index e02eb35..7d5b53c 100644
--- a/doc/toplevel.n
+++ b/doc/toplevel.n
@@ -20,7 +20,7 @@ toplevel \- Create and manipulate toplevel widgets
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
-This option is the same as the standard \fBbackground\fR option
+This option is the same as the standard \fB\-background\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
@@ -30,7 +30,7 @@ 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
+The \fB\-class\fR option may not be changed with the \fBconfigure\fR
widget command.
.OP \-colormap colormap Colormap
Specifies a colormap to use for the window.
@@ -39,7 +39,7 @@ 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
+If the \fB\-colormap\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.
@@ -86,7 +86,7 @@ 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 default
visual for its screen.
-The \fBvisual\fR option may not be modified with the \fBconfigure\fR
+The \fB\-visual\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
@@ -94,7 +94,6 @@ 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 \fBtoplevel\fR command creates a new toplevel widget (given
@@ -112,7 +111,6 @@ purpose of a toplevel is to serve as a container for dialog boxes
and other collections of widgets. The only visible features
of a toplevel are its background color and an optional 3-D border
to make the toplevel appear raised or sunken.
-
.SH "WIDGET COMMAND"
.PP
The \fBtoplevel\fR command creates a new Tcl command whose
@@ -127,7 +125,7 @@ the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for toplevel widgets:
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\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 \fBtoplevel\fR
@@ -146,18 +144,14 @@ 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 \fBtoplevel\fR
command.
-
.SH BINDINGS
.PP
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
-
'\" Local Variables:
'\" mode: nroff
'\" End:
diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n
index b42bd31..42335d8 100644
--- a/doc/ttk_entry.n
+++ b/doc/ttk_entry.n
@@ -39,7 +39,7 @@ requests when it has a selection.
.\" MAYBE: .OP \-insertbackground insertBackground Foreground
.\" MAYBE: .OP \-insertwidth insertWidth InsertWidth
.OP \-invalidcommand invalidCommand InvalidCommand
-A script template to evaluate whenever the \fBvalidateCommand\fR returns 0.
+A script template to evaluate whenever the \fB\-validatecommand\fR returns 0.
See \fBVALIDATION\fR below for more information.
.OP \-justify justify Justify
Specifies how the text is aligned within the entry widget.
@@ -87,7 +87,7 @@ in average-size characters of the widget's font.
.SH NOTES
.PP
A portion of the entry may be selected as described below.
-If an entry is exporting its selection (see the \fBexportSelection\fR
+If an entry is exporting its selection (see the \fB\-exportselection\fR
option), then it will observe the standard X11 protocols for handling the
selection; entry selections are available as type \fBSTRING\fR.
Entries also observe the standard Tk rules for dealing with the
@@ -99,8 +99,8 @@ Entries 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. Entries use
-the standard \fBxScrollCommand\fR mechanism for interacting with
-scrollbars (see the description of the \fBxScrollCommand\fR option
+the standard \fB\-xscrollcommand\fR mechanism for interacting with
+scrollbars (see the description of the \fB\-xscrollcommand\fR option
for details).
.SH "INDICES"
.PP
diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n
index d6c33d3..456b796 100644
--- a/doc/ttk_notebook.n
+++ b/doc/ttk_notebook.n
@@ -100,7 +100,7 @@ which returns the number of tabs
.QW "\fIpathname \fBindex\fR" ).
.SH "WIDGET COMMAND"
.TP
-\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR?
+\fIpathname \fBadd \fIwindow\fR ?\fIoptions...\fR?
Adds a new tab to the notebook.
See \fBTAB OPTIONS\fR for the list of available \fIoptions\fR.
If \fIwindow\fR is currently managed by the notebook but hidden,
@@ -109,38 +109,38 @@ it is restored to its previous position.
\fIpathname \fBconfigure\fR ?\fIoptions\fR?
See \fIttk::widget(n)\fR.
.TP
-\fIpathname \fBcget\fR \fIoption\fR
+\fIpathname \fBcget \fIoption\fR
See \fIttk::widget(n)\fR.
.TP
-\fIpathname \fBforget\fR \fItabid\fR
+\fIpathname \fBforget \fItabid\fR
Removes the tab specified by \fItabid\fR,
unmaps and unmanages the associated window.
.TP
-\fIpathname \fBhide\fR \fItabid\fR
+\fIpathname \fBhide \fItabid\fR
Hides the tab specified by \fItabid\fR.
The tab will not be displayed, but the associated window
remains managed by the notebook and its configuration remembered.
Hidden tabs may be restored with the \fBadd\fR command.
.TP
-\fIpathname \fBidentify\fR \fIcomponent\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify\fI component x y\fR
Returns the name of the element under the point given by \fIx\fR and \fIy\fR,
or the empty string if no component is present at that location.
The following subcommands are supported:
.RS
.TP
-\fIpathname \fBidentify\fR \fBelement\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify element\fR \fIx y\fR
Returns the name of the element at the specified location.
.TP
-\fIpathname \fBidentify\fR \fBtab\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify tab\fR \fIx y\fR
Returns the index of the tab at the specified location.
.RE
.TP
-\fIpathname \fBindex\fR \fItabid\fR
+\fIpathname \fBindex \fItabid\fR
Returns the numeric index of the tab specified by \fItabid\fR,
or the total number of tabs if \fItabid\fR is the string
.QW \fBend\fR .
.TP
-\fIpathname \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\fR
+\fIpathname \fBinsert \fIpos subwindow options...\fR
Inserts a pane at the specified position.
\fIpos\fR is either the string \fBend\fR, an integer index,
or the name of a managed subwindow.
@@ -148,7 +148,7 @@ If \fIsubwindow\fR is already managed by the notebook,
moves it to the specified position.
See \fBTAB OPTIONS\fR for the list of available options.
.TP
-\fIpathname \fBinstate\fR \fIstatespec \fR?\fIscript...\fR?
+\fIpathname \fBinstate \fIstatespec \fR?\fIscript...\fR?
See \fIttk::widget(n)\fR.
.TP
\fIpathname \fBselect\fR ?\fItabid\fR?
@@ -161,7 +161,7 @@ currently selected pane.
\fIpathname \fBstate\fR ?\fIstatespec\fR?
See \fIttk::widget(n)\fR.
.TP
-\fIpathname \fBtab\fR \fItabid\fR ?\fI\-option \fR?\fIvalue ...\fR
+\fIpathname \fBtab \fItabid\fR ?\fI\-option \fR?\fIvalue ...\fR
Query or modify the options of the specific tab.
If no \fI\-option\fR is specified,
returns a dictionary of the tab option values.
@@ -186,7 +186,7 @@ containing the notebook as follows:
.IP \(bu
\fBShift-Control-Tab\fR selects the tab preceding the currently selected one.
.IP \(bu
-\fBAlt-K\fR, where \fBK\fR is the mnemonic (underlined) character
+\fBAlt-\fIK\fR, where \fIK\fR is the mnemonic (underlined) character
of any tab, will select that tab.
.PP
Multiple notebooks in a single toplevel may be enabled for traversal,
diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n
index c5851c3..3b80ac8 100644
--- a/doc/ttk_panedwindow.n
+++ b/doc/ttk_panedwindow.n
@@ -5,7 +5,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH ttk::panedwindow n 8.5.9 Tk "Tk Themed Widget"
+.TH ttk::panedwindow n 8.5 Tk "Tk Themed Widget"
.BS
.SH NAME
ttk::panedwindow \- Multi-pane container window
@@ -52,29 +52,29 @@ Supports the standard \fBconfigure\fR, \fBcget\fR, \fBstate\fR,
and \fBinstate\fR commands; see \fIttk::widget(n)\fR for details.
Additional commands:
.TP
-\fIpathname\fR \fBadd\fR \fIsubwindow\fR \fIoptions...\fR
+\fIpathname \fBadd \fIsubwindow options...\fR
Adds a new pane to the window.
See \fBPANE OPTIONS\fR for the list of available options.
.TP
-\fIpathname\fR \fBforget\fR \fIpane\fR
+\fIpathname \fBforget \fIpane\fR
Removes the specified subpane from the widget.
\fIpane\fR is either an integer index or the name of a managed subwindow.
.TP
-\fIpathname\fR \fBidentify\fR \fIcomponent\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify \fIcomponent x y\fR
Returns the name of the element under the point given by \fIx\fR and \fIy\fR,
or the empty string if no component is present at that location.
If \fIcomponent\fR is omitted, it defaults to \fBsash\fR.
The following subcommands are supported:
.RS
.TP
-\fIpathname\fR \fBidentify\fR \fBelement\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify element \fIx y\fR
Returns the name of the element at the specified location.
.TP
-\fIpathname\fR \fBidentify\fR \fBsash\fR \fIx\fR \fIy\fR
+\fIpathname \fBidentify sash \fIx y\fR
Returns the index of the sash at the specified location.
.RE
.TP
-\fIpathname\fR \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\fR
+\fIpathname \fBinsert \fIpos subwindow options...\fR
Inserts a pane at the specified position.
\fIpos\fR is either the string \fBend\fR, an integer index,
or the name of a managed subwindow.
@@ -82,7 +82,7 @@ If \fIsubwindow\fR is already managed by the paned window,
moves it to the specified position.
See \fBPANE OPTIONS\fR for the list of available options.
.TP
-\fIpathname\fR \fBpane\fR \fIpane \-option \fR?\fIvalue \fR?\fI\-option value...\fR
+\fIpathname \fBpane \fIpane \-option \fR?\fIvalue \fR?\fI\-option value...\fR
Query or modify the options of the specified \fIpane\fR,
where \fIpane\fR is either an integer index or the name of a managed subwindow.
If no \fI\-option\fR is specified, returns a dictionary of the pane
@@ -90,10 +90,10 @@ option values.
If one \fI\-option\fR is specified, returns the value of that \fIoption\fR.
Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs.
.TP
-\fIpathname\fR \fBpanes\fR
+\fIpathname \fBpanes\fR
Returns the list of all windows managed by the widget.
.TP
-\fIpathname\fR \fBsashpos\fR \fIindex\fR ?\fInewpos\fR?
+\fIpathname \fBsashpos \fIindex\fR ?\fInewpos\fR?
If \fInewpos\fR is specified, sets the position
of sash number \fIindex\fR.
May adjust the positions of adjacent sashes
diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n
index 9381c61..b29f88d 100644
--- a/doc/ttk_progressbar.n
+++ b/doc/ttk_progressbar.n
@@ -57,13 +57,13 @@ to provide additional animation effects.
.SH "WIDGET COMMAND"
.PP
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget \fIoption\fR
Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR.
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
Modify or query widget options; see \fIttk::widget(n)\fR.
.TP
-\fIpathName \fBidentify\fR \fIx y\fR
+\fIpathName \fBidentify \fIx y\fR
Returns the name of the element at position \fIx\fR, \fIy\fR.
See \fIttk::widget(n)\fR.
.TP
diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n
index cbea359..afbd8c2 100644
--- a/doc/ttk_radiobutton.n
+++ b/doc/ttk_radiobutton.n
@@ -29,7 +29,7 @@ it sets the variable to its associated value.
.OP \-command command Command
A Tcl script to evaluate whenever the widget is invoked.
.OP \-value Value Value
-The value to store in the associated \fI\-variable\fR
+The value to store in the associated \fB\-variable\fR
when the widget is selected.
.OP \-variable variable Variable
The name of a global variable whose value is linked to the widget.
diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n
index 2fd485b..c84461e 100644
--- a/doc/ttk_scale.n
+++ b/doc/ttk_scale.n
@@ -39,7 +39,7 @@ or vertically. Must be either \fBhorizontal\fR or \fBvertical\fR or an
abbreviation of one of these.
.OP \-to to To
Specifies a real value corresponding to the right or bottom end of the scale.
-This value may be either less than or greater than the \fBfrom\fR option.
+This value may be either less than or greater than the \fB\-from\fR option.
.OP \-value value Value
Specifies the current floating-point value of the variable.
.OP \-variable variable Variable
@@ -65,7 +65,7 @@ Get the current value of the \fB\-value\fR option, or the value corresponding
to the coordinates \fIx,y\fR if they are specified. \fIX\fR and \fIy\fR are
pixel coordinates relative to the scale widget origin.
.TP
-\fIpathName \fBidentify\fR \fIx y\fR
+\fIpathName \fBidentify \fIx y\fR
Returns the name of the element at position \fIx\fR, \fIy\fR.
See \fIttk::widget(n)\fR.
.TP
diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n
index ce9eeed..b406339 100644
--- a/doc/ttk_scrollbar.n
+++ b/doc/ttk_scrollbar.n
@@ -48,7 +48,7 @@ Specifies the orientation of the scrollbar.
.SH "WIDGET COMMAND"
.PP
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget \fIoption\fR
Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR.
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
@@ -58,14 +58,14 @@ Modify or query widget options; see \fIttk::widget(n)\fR.
Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent \fBset\fR widget command.
.TP
-\fIpathName \fBidentify\fR \fIx y\fR
+\fIpathName \fBidentify \fIx y\fR
Returns the name of the element at position \fIx\fR, \fIy\fR.
See \fIttk::widget(n)\fR.
.TP
\fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR?
Test the widget state; see \fIttk::widget(n)\fR.
.TP
-\fIpathName \fBset\fR \fIfirst last\fR
+\fIpathName \fBset \fIfirst last\fR
This command is normally invoked by the scrollbar's associated widget
from an \fB\-xscrollcommand\fR or \fB\-yscrollcommand\fR callback.
Specifies the visible range to be displayed.
diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n
index fefd287..2933ae7 100644
--- a/doc/ttk_spinbox.n
+++ b/doc/ttk_spinbox.n
@@ -5,7 +5,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH ttk::spinbox n 8.5.9 Tk "Tk Themed Widget"
+.TH ttk::spinbox n 8.5 Tk "Tk Themed Widget"
.BS
.SH NAME
ttk::spinbox \- Selecting text field widget
@@ -30,11 +30,11 @@ to a Tcl variable.
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-from from From
A floating\-point value specifying the lowest value for the spinbox. This is
-used in conjunction with \fI\-to\fR and \fI\-increment\fR to set a numerical
+used in conjunction with \fB\-to\fR and \fB\-increment\fR to set a numerical
range.
.OP \-to to To
A floating\-point value specifying the highest permissible value for the
-widget. See also \fI\-from\fR and \fI\-increment\fR.
+widget. See also \fB\-from\fR and \fB\-increment\fR.
range.
.OP \-increment increment Increment
A floating\-point value specifying the change in value to be applied each
@@ -42,8 +42,8 @@ time one of the widget spin buttons is pressed. The up button applies a
positive increment, the down button applies a negative increment.
.OP \-values values Values
This must be a Tcl list of values. If this option is set then this will
-override any range set using the \fI\-from\fR, \fI\-to\fR and
-\fI\-increment\fR options. The widget will instead use the values
+override any range set using the \fB\-from\fR, \fB\-to\fR and
+\fB\-increment\fR options. The widget will instead use the values
specified beginning with the first value.
.OP \-wrap wrap Wrap
Must be a proper boolean value. If on, the spinbox will wrap around the
@@ -61,7 +61,7 @@ See the \fBttk::entry\fR manual for information about indexing characters.
.SH "VALIDATION"
.PP
See the \fBttk::entry\fR manual for information about using the
-\fI\-validate\fR and \fI\-validatecommand\fR options.
+\fB\-validate\fR and \fB\-validatecommand\fR options.
.SH "WIDGET COMMAND"
.PP
The following subcommands are possible for spinbox widgets in addition to
@@ -73,9 +73,9 @@ the commands described for the \fBttk::entry\fR widget:
Returns the spinbox's current value.
.TP
\fIpathName \fBset \fIvalue\fR
-Set the spinbox string to \fIvalue\fR. If a \fI\-format\fR option has
+Set the spinbox string to \fIvalue\fR. If a \fB\-format\fR option has
been configured then this format will be applied. If formatting fails
-or is not set or the \fI\-values\fR option has been used then the value
+or is not set or the \fB\-values\fR option has been used then the value
is set directly.
.SH "SEE ALSO"
ttk::widget(n), ttk::entry(n), spinbox(n)
diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n
index 33cca55..d414f5a 100644
--- a/doc/ttk_treeview.n
+++ b/doc/ttk_treeview.n
@@ -5,7 +5,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH ttk::treeview n 8.5.9 Tk "Tk Themed Widget"
+.TH ttk::treeview n 8.5 Tk "Tk Themed Widget"
.BS
.SH NAME
ttk::treeview \- hierarchical multicolumn data display widget
@@ -380,16 +380,16 @@ the specified tag.
\fIpathName \fBtag names\fR
Returns a list of all tags used by the widget.
.TP
-\fIpathName \fBtag add\fR \fItag\fR \fIitems\fR
+\fIpathName \fBtag add \fItag items\fR
Adds the specified \fItag\fR to each of the listed \fIitems\fR.
If \fItag\fR is already present for a particular item,
-then the \fB-tags\fR for that item are unchanged.
+then the \fB\-tags\fR for that item are unchanged.
.TP
-\fIpathName \fBtag remove\fR \fItag\fR ?\fIitems\fR?
+\fIpathName \fBtag remove \fItag\fR ?\fIitems\fR?
Removes the specified \fItag\fR from each of the listed \fIitems\fR.
If \fIitems\fR is omitted, removes \fItag\fR from each item in the tree.
If \fItag\fR is not present for a particular item,
-then the \fB-tags\fR for that item are unchanged.
+then the \fB\-tags\fR for that item are unchanged.
.RE
.TP
\fIpathName \fBxview \fIargs\fR
diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n
index 7506ec4..e47c8b4 100644
--- a/doc/ttk_vsapi.n
+++ b/doc/ttk_vsapi.n
@@ -14,42 +14,46 @@ ttk_vsapi \- Define a Microsoft Visual Styles element
.BE
.SH DESCRIPTION
.PP
-The \fIvsapi\fR element factory creates a new element
+The \fBvsapi\fR element factory creates a new element
in the current theme whose visual appearance is drawn using the
Microsoft Visual Styles API which is reponsible for the themed styles
on Windows XP and Vista. This factory permits any of the Visual
-Styles parts to be declared as ttk elements that can then be
-included in a style layout to modify the appearance of ttk widgets.
+Styles parts to be declared as Ttk elements that can then be
+included in a style layout to modify the appearance of Ttk widgets.
.PP
\fIclassName\fR and \fIpartId\fR are required parameters and specify
the Visual Styles class and part as given in the Microsoft
-documentation. The \fIstateMap\fR may be provided to map ttk states to
+documentation. The \fIstateMap\fR may be provided to map Ttk states to
Visual Styles API states (see \fBSTATE MAP\fR).
.SH "OPTIONS"
.PP
Valid \fIoptions\fR are:
.TP
-\fB\-padding\fR \fIpadding\fR
+\fB\-padding \fIpadding\fR
+.
Specify the element's interior padding.
\fIpadding\fR is a list of up to four integers specifying
the left, top, right and bottom padding quantities respectively.
This option may not be mixed with any other options.
.TP
-\fB\-margins\fR \fIpadding\fR
+\fB\-margins \fIpadding\fR
+.
Specifies the elements exterior padding.
\fIpadding\fR is a list of up to four integers specifying
the left, top, right and bottom padding quantities respectively.
This option may not be mixed with any other options.
.TP
-\fB\-width\fR \fIwidth\fR
+\fB\-width \fIwidth\fR
+.
Specifies the height for the element. If this option is set then
the Visual Styles API will not be queried for the recommended
-size or the part. If this option is set then \fI-height\fR should
-also be set. The \fI-width\fR and \fI-height\fR options cannot
-be mixed with the \fI-padding\fR or \fI-margins\fR options.
+size or the part. If this option is set then \fB\-height\fR should
+also be set. The \fB\-width\fR and \fB\-height\fR options cannot
+be mixed with the \fB\-padding\fR or \fB\-margins\fR options.
.TP
-\fB\-height\fR \fIheight\fR
-Specifies the height of the element. See the comments for \fI-width\fR.
+\fB\-height \fIheight\fR
+.
+Specifies the height of the element. See the comments for \fB\-width\fR.
.SH "STATE MAP"
.PP
The \fIstateMap\fR parameter is a list of ttk states and the
@@ -61,7 +65,7 @@ last pair in the list should be the default state and is typically and
empty list and 1. Unfortunately all the Visual Styles parts have
different state values and these must be looked up either in the
Microsoft documentation or more likely in the header files. The
-original header to use was \fItmschema.h\fR but in more recent
+original header to use was \fItmschema.h\fR, but in more recent
versions of the Windows Development Kit this is \fIvssym32.h\fR.
.PP
If no \fIstateMap\fR parameter is given there is an implicit default
@@ -73,7 +77,7 @@ a \fBttk::button\fR(n). This uses the WINDOW part WP_SMALLCLOSEBUTTON
and as documented the states CBS_DISABLED, CBS_HOT, CBS_NORMAL and
CBS_PUSHED are mapped from ttk states.
.CS
-ttk::style element create smallclose vsapi WINDOW 19 \\
+ttk::style element create smallclose \fBvsapi\fR WINDOW 19 \\
{disabled 4 pressed 3 active 2 {} 1}
ttk::style layout CloseButton {CloseButton.smallclose -sticky news}
pack [ttk::button .close -style CloseButton]
@@ -82,7 +86,7 @@ pack [ttk::button .close -style CloseButton]
Change the appearence of a \fBttk::checkbutton\fR(n) to use the
Explorer pin part EBP_HEADERPIN.
.CS
-ttk::style element create pin vsapi EXPLORERBAR 3 {
+ttk::style element create pin \fBvsapi\fR EXPLORERBAR 3 {
{pressed !selected} 3
{active !selected} 2
{pressed selected} 6
diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n
index 98968ad..e7f7154 100644
--- a/doc/ttk_widget.n
+++ b/doc/ttk_widget.n
@@ -5,7 +5,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH ttk::widget n 8.5.9 Tk "Tk Themed Widget"
+.TH ttk::widget n 8.5 Tk "Tk Themed Widget"
.BS
.SH NAME
ttk::widget \- Standard options and commands supported by Tk themed widgets
@@ -54,7 +54,7 @@ The first fraction indicates the first information in the widget
that is visible in the window, and the second fraction indicates
the information just after the last portion that is visible.
.PP
-Typically the \fBxScrollCommand\fR option consists of the path name
+Typically the \fB\-xscrollcommand\fR option consists of the path name
of a \fBscrollbar\fR widget followed by
.QW set ,
e.g.
@@ -123,11 +123,13 @@ but the \fBstate\fR widget command
does not affect the \fB\-state\fR option.
.SH COMMANDS
.TP
-\fIpathName \fBcget\fR \fIoption\fR
+\fIpathName \fBcget \fIoption\fR
+.
Returns the current value of the configuration option given
by \fIoption\fR.
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+.
Query or modify the configuration options of the widget.
If one or more \fIoption\-value\fR pairs are specified,
then the command modifies the given widget option(s)
@@ -142,14 +144,16 @@ and current value.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR.
.TP
-\fIpathName \fBidentify\fR \fBelement\fR \fIx y\fR
+\fIpathName \fBidentify element \fIx y\fR
+.
Returns the name of the element under the point given
by \fIx\fR and \fIy\fR, or an empty string if the point does
not lie within any element.
\fIx\fR and \fIy\fR are pixel coordinates relative to the widget.
Some widgets accept other \fBidentify\fR subcommands.
.TP
-\fIpathName \fBinstate\fR \fIstatespec\fR ?\fIscript\fR?
+\fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR?
+.
Test the widget's state.
If \fIscript\fR is not specified, returns 1 if
the widget state matches \fIstatespec\fR and 0 otherwise.
@@ -159,6 +163,7 @@ if {[\fIpathName\fR instate \fIstateSpec\fR]} \fIscript\fR
.CE
.TP
\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+.
Modify or inquire widget state.
If \fIstateSpec\fR is present, sets the widget state:
for each flag in \fIstateSpec\fR, sets the corresponding flag
@@ -178,6 +183,7 @@ The widget state is a bitmap of independent state flags.
Widget state flags include:
.TP
\fBactive\fR
+.
The mouse cursor is over the widget
and pressing a mouse button will cause some action to occur. (aka
.QW prelight
@@ -187,19 +193,23 @@ and pressing a mouse button will cause some action to occur. (aka
.QW hover ).
.TP
\fBdisabled\fR
+.
Widget is disabled under program control (aka
.QW unavailable ,
-.QW inactive )
+.QW inactive ).
.TP
\fBfocus\fR
-Widget has keyboard focus
+.
+Widget has keyboard focus.
.TP
\fBpressed\fR
+.
Widget is being pressed (aka
.QW armed
in Motif).
.TP
\fBselected\fR
+.
.QW On ,
.QW true ,
or
@@ -207,6 +217,7 @@ or
for things like checkbuttons and radiobuttons.
.TP
\fBbackground\fR
+.
Windows and the Mac have a notion of an
.QW active
or foreground window.
@@ -214,9 +225,11 @@ The \fBbackground\fR state is set for widgets in a background window,
and cleared for those in the foreground window.
.TP
\fBreadonly\fR
+.
Widget should not allow user modification.
.TP
\fBalternate\fR
+.
A widget-specific alternate display format.
For example, used for checkbuttons and radiobuttons in the
.QW tristate
@@ -225,11 +238,13 @@ or
state, and for buttons with \fB\-default active\fR.
.TP
\fBinvalid\fR
+.
The widget's value is invalid.
(Potential uses: scale widget value out of bounds,
entry widget value failed validation.)
.TP
\fBhover\fR
+.
The mouse cursor is within the widget.
This is similar to the \fBactive\fP state;
it is used in some themes for widgets that
@@ -245,13 +260,13 @@ indicating that the bit is off.
set b [ttk::button .b]
# Disable the widget:
-$b state disabled
+$b \fBstate\fR disabled
# Invoke the widget only if it is currently pressed and enabled:
-$b instate {pressed !disabled} { .b invoke }
+$b \fBinstate\fR {pressed !disabled} { .b invoke }
# Reenable widget:
-$b state !disabled
+$b \fBstate\fR !disabled
.CE
.SH "SEE ALSO"
ttk::intro(n), ttk::style(n)
diff --git a/doc/winfo.n b/doc/winfo.n
index 4b75eb9..4196bce 100644
--- a/doc/winfo.n
+++ b/doc/winfo.n
@@ -14,7 +14,6 @@ winfo \- Return window-related information
.SH SYNOPSIS
\fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBwinfo\fR command is used to retrieve information about windows
@@ -335,6 +334,7 @@ parent, of the
upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
has no border).
.SH EXAMPLE
+.PP
Print where the mouse pointer is and what window it is currently over:
.CS
lassign [\fBwinfo pointerxy\fR .] x y
@@ -346,7 +346,9 @@ if {$win eq ""} {
puts "over $win"
}
.CE
-
.SH KEYWORDS
atom, children, class, geometry, height, identifier, information, interpreters,
mapped, parent, path name, screen, virtual root, width, window
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/wish.1 b/doc/wish.1
index ca62120..2bae675 100644
--- a/doc/wish.1
+++ b/doc/wish.1
@@ -15,10 +15,8 @@ wish \- Simple windowing shell
\fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg arg ...\fR?
.SH OPTIONS
.IP "\fB\-encoding \fIname\fR" 20
-.VS 8.5
Specifies the encoding of the text stored in \fIfileName\fR.
This option is only recognized prior to the \fIfileName\fR argument.
-.VE 8.5
.IP "\fB\-colormap \fInew\fR" 20
Specifies that the window should have a new private colormap instead of
using the default colormap for the screen.
@@ -63,7 +61,7 @@ language, the Tk toolkit, and a main program that reads commands
from standard input or from a file.
It creates a main window and then processes Tcl commands.
If \fBwish\fR is invoked with arguments, then the first few
-arguments, ?\fB\-encoding \fIname\fR? ?\fIfileName\fR? specify the
+arguments, ?\fB\-encoding \fIname\fR? ?\fIfileName\fR?, specify the
name of a script file, and, optionally, the
encoding of the text data stored in that script file. A value
for \fIfileName\fR is recognized if the appropriate argument
@@ -166,7 +164,7 @@ following three lines:
.CS
\fB#!/bin/sh
# the next line restarts using wish \e
-exec wish "$0" "$@"\fR
+exec wish "$0" ${1+"$@"}\fR
.CE
This approach has three advantages over the approach in the previous
paragraph. First, the location of the \fBwish\fR binary does not have
@@ -213,5 +211,8 @@ The variable \fBtcl_prompt2\fR is used in a similar way when
a newline is typed but the current command is not yet complete;
if \fBtcl_prompt2\fR is not set then no prompt is output for
incomplete commands.
+.SH "SEE ALSO"
+tclsh(1), toplevel(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3)
.SH KEYWORDS
-shell, toolkit
+application, argument, interpreter, prompt, script file, shell,
+toolkit, toplevel
diff --git a/doc/wm.n b/doc/wm.n
index 93858ef..58e4334 100644
--- a/doc/wm.n
+++ b/doc/wm.n
@@ -27,6 +27,7 @@ top-level window.
The legal forms for the \fBwm\fR command are:
.TP
\fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR?
+.
If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
are all specified, then they will be passed to the window manager
and the window manager should use them to enforce a range of
@@ -47,6 +48,7 @@ returned).
\fBwm attributes \fIwindow\fR ?\fBoption\fR?
.TP
\fBwm attributes \fIwindow\fR ?\fBoption value option value...\fR?
+.
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
@@ -57,82 +59,162 @@ values are as follows:
All platforms support the following attributes (though X11 users
should see the notes below):
.TP
+\fB\-alpha\fR
+.
+Specifies the alpha transparency level of the toplevel. It accepts a value
+from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that
+range will be constrained. Where not supported, the \fB\-alpha\fR value
+remains at \fB1.0\fR.
+.TP
\fB\-fullscreen\fR
+.
Places the window in a mode that takes up the entire screen, has no
borders, and covers the general use area (i.e. Start menu and taskbar on
Windows, dock and menubar on OSX, general window decorations on X11).
.TP
\fB\-topmost\fR
+.
Specifies whether this is a topmost window (displays above all other windows).
.PP
On Windows, the following attributes may be set.
.TP
-\fB\-alpha\fR
-.VS 8.5
-Specifies the alpha transparency level of the toplevel.
-It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR
-(opaque). Values outside that range will be constrained. This is
-supported on Windows 2000/XP+. Where not supported, the \fB\-alpha\fR
-value remains at \fB1.0\fR.
-.VE 8.5
-.TP
\fB\-disabled\fR
+.
Specifies whether the window is in a disabled state.
.TP
\fB\-toolwindow\fR
+.
Specifies a toolwindow style window (as defined in the MSDN).
.TP
\fB\-transparentcolor\fR
-.VS 8.5
+.
Specifies the transparent color index of the toplevel. It takes any color
value accepted by \fBTk_GetColor\fR. If the empty string is specified
(default), no transparent color is used. This is supported on Windows
2000/XP+. Where not supported, the \fB\-transparentcolor\fR value remains
at \fB{}\fR.
-.VE 8.5
.PP
On Mac OS X, the following attributes may be set.
.TP
-\fB\-alpha\fR
-Specifies the alpha transparency level of the window.
-It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque),
-values outside that range will be constrained.
-.TP
\fB\-modified\fR
+.
Specifies the modification state of the window (determines whether the
window close widget contains the modification indicator and whether the
proxy icon is draggable).
.TP
\fB\-notify\fR
+.
Specifies process notification state (bouncing of the application dock icon).
.TP
\fB\-titlepath\fR
+.
Specifies the path of the file referenced as the window proxy icon (which
can be dragged and dropped in lieu of the file's finder icon).
.TP
\fB\-transparent\fR
+.
Makes the window content area transparent and turns off the window shadow. For
the transparency to be effecive, the toplevel background needs to be set to a
color with some alpha, e.g.
.QW systemTransparent .
.PP
-On X11, the following attributes may be set.
-These are not supported by all window managers,
-and will have no effect under older WMs.
+On X11, the following attributes may be set. These are not supported by all
+window managers, and will have no effect under older WMs.
.\" See http://www.freedesktop.org/Standards/wm-spec
.TP
+\fB\-type\fR
+.VS 8.6
+Requests that the window should be interpreted by the window manager as being
+of the specified type(s). This may cause the window to be decorated in a
+different way or otherwise managed differently, though exactly what happens is
+entirely up to the window manager. A list of types may be used, in order of preferance. The following values are mapped to
+constants defined in the EWMH specification (using others is possible, but not
+advised):
+.RS
+.TP
+\fBdesktop\fR
+.
+indicates a desktop feature,
+.TP
+\fBdock\fR
+.
+indicates a dock/panel feature,
+.TP
+\fBtoolbar\fR
+.
+indicates a toolbar window that should be acting on behalf of another window,
+as indicated with \fBwm transient\fR,
+.TP
+\fBmenu\fR
+.
+indicates a torn-off menu that should be acting on behalf of another window,
+as indicated with \fBwm transient\fR,
+.TP
+\fButility\fR
+.
+indicates a utility window (e.g., palette or toolbox) that should be acting on
+behalf of another window, as indicated with \fBwm transient\fR,
+.TP
+\fBsplash\fR
+.
+indicates a splash screen, displayed during application start up,
+.TP
+\fBdialog\fR
+.
+indicates a general dialog window, that should be acting on behalf of another
+window, as indicated with \fBwm transient\fR,
+.TP
+\fBdropdown_menu\fR
+.
+indicates a menu summoned from a menu bar, which should usually also be set to
+be override-redirected (with \fBwm overrideredirect\fR),
+.TP
+\fBpopup_menu\fR
+.
+indicates a popup menu, which should usually also be set to be
+override-redirected (with \fBwm overrideredirect\fR),
+.TP
+\fBtooltip\fR
+.
+indicates a tooltip window, which should usually also be set to be
+override-redirected (with \fBwm overrideredirect\fR),
+.TP
+\fBnotification\fR
+.
+indicates a window that provides a background notification of some event,
+which should usually also be set to be override-redirected (with \fBwm
+overrideredirect\fR),
+.TP
+\fBcombo\fR
+.
+indicates the drop-down list of a combobox widget, which should usually also
+be set to be override-redirected (with \fBwm overrideredirect\fR),
+.TP
+\fBdnd\fR
+.
+indicates a window that represents something being dragged, which should
+usually also be set to be override-redirected (with
+\fBwm overrideredirect\fR),
+.TP
+\fBnormal\fR
+.
+indicates a window that has no special interpretation.
+.RE
+.VE 8.6
+.TP
\fB\-zoomed\fR
-Requests that the window should be maximized.
-This is the same as \fBwm state zoomed\fR on Windows and Mac OS X.
+.
+Requests that the window should be maximized. This is the same as \fBwm state
+zoomed\fR on Windows and Mac OS X.
.PP
-On X11, changes to window attributes are performed asynchronously.
-Querying the value of an attribute returns the current state,
-which will not be the same as the value most recently set
-if the window manager has not yet processed the request
-or if it does not support the attribute.
+On X11, changes to window attributes are performed asynchronously. Querying
+the value of an attribute returns the current state, which will not be the
+same as the value most recently set if the window manager has not yet
+processed the request or if it does not support the attribute.
.RE
.TP
\fBwm client \fIwindow\fR ?\fIname\fR?
+.
If \fIname\fR is specified, this command stores \fIname\fR (which
should be the name of
the host on which the application is executing) in \fIwindow\fR's
@@ -145,6 +227,7 @@ If \fIname\fR is specified as an empty string, the command deletes the
\fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR.
.TP
\fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR?
+.
This command is used to manipulate the \fBWM_COLORMAP_WINDOWS\fR
property, which provides information to the window managers about
windows that have private colormaps.
@@ -175,6 +258,7 @@ See the ICCCM documentation for more information on the
.RE
.TP
\fBwm command \fIwindow\fR ?\fIvalue\fR?
+.
If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's
\fBWM_COMMAND\fR property for use by the window manager or
session manager and returns an empty string.
@@ -186,6 +270,7 @@ If \fIvalue\fR is specified as an empty string, the command
deletes the \fBWM_COMMAND\fR property from \fIwindow\fR.
.TP
\fBwm deiconify \fIwindow\fR
+.
Arrange for \fIwindow\fR to be displayed in normal (non-iconified) form.
This is done by mapping the window. If the window has never been
mapped then this command will not map the window, but it will ensure
@@ -195,6 +280,7 @@ raised and be given the focus (made the active window).
Returns an empty string.
.TP
\fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR?
+.
If \fBactive\fR or \fBpassive\fR is supplied as an optional argument
to the command, then it specifies the focus model for \fIwindow\fR.
In this case the command returns an empty string. If no additional
@@ -214,6 +300,7 @@ assumes a passive model of focusing.
.RE
.TP
\fBwm forget \fIwindow\fR
+.
The \fIwindow\fR will be unmapped from the screen and will no longer
be managed by \fBwm\fR. Windows created with the \fBtoplevel\fR
command will be treated like \fBframe\fR windows once they are no
@@ -221,6 +308,7 @@ longer managed by \fBwm\fR, however, the \fB\-menu\fR configuration will be
remembered and the menus will return once the widget is managed again.
.TP
\fBwm frame \fIwindow\fR
+.
If \fIwindow\fR has been reparented by the window manager into a
decorative frame, the command returns the platform specific window
identifier for the outermost frame that contains \fIwindow\fR (the
@@ -229,6 +317,7 @@ has not been reparented by the window manager then the command returns
the platform specific window identifier for \fIwindow\fR.
.TP
\fBwm geometry \fIwindow\fR ?\fInewGeometry\fR?
+.
If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR
is changed and an empty string is returned. Otherwise the current
geometry for \fIwindow\fR is returned (this is the most recent
@@ -263,6 +352,7 @@ widgets.
.RE
.TP
\fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR?
+.
This command indicates that \fIwindow\fR is to be managed as a
gridded window.
It also specifies the relationship between grid units and pixel units.
@@ -298,6 +388,7 @@ provide easier access to the same functionality.
.RE
.TP
\fBwm group \fIwindow\fR ?\fIpathName\fR?
+.
If \fIpathName\fR is specified, it gives the path name for the leader of
a group of related windows. The window manager may use this information,
for example, to unmap all of the windows in a group when the group's
@@ -308,6 +399,7 @@ returns the path name of \fIwindow\fR's current group leader, or an empty
string if \fIwindow\fR is not part of any group.
.TP
\fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR?
+.
If \fIbitmap\fR is specified, then it names a bitmap in the standard
forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
This bitmap is passed to the window manager to be displayed in
@@ -318,10 +410,11 @@ 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. On the Windows operating
-system, an additional flag is supported:
+system, an additional flag is supported:
.RS
.TP
\fBwm iconbitmap \fIwindow\fR ?\fB\-default\fR? ?\fIimage\fR?
+.
If the \fB\-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.
@@ -335,11 +428,13 @@ a bitmap.
.RE
.TP
\fBwm iconify \fIwindow\fR
+.
Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR has not
yet been mapped for the first time, this command will arrange for
it to appear in the iconified state when it is eventually mapped.
.TP
\fBwm iconmask \fIwindow\fR ?\fIbitmap\fR?
+.
If \fIbitmap\fR is specified, then it names a bitmap in the standard
forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details).
This bitmap is passed to the window manager to be used as a mask
@@ -354,6 +449,7 @@ returns the name of the current icon mask associated with
\fIwindow\fR, or an empty string if no mask is in effect.
.TP
\fBwm iconname \fIwindow\fR ?\fInewName\fR?
+.
If \fInewName\fR is specified, then it is passed to the window
manager; the window manager should display \fInewName\fR inside
the icon associated with \fIwindow\fR. In this case an empty
@@ -362,9 +458,9 @@ then the command returns the current icon name for \fIwindow\fR,
or an empty string if no icon name has been specified (in this
case the window manager will normally display the window's title,
as specified with the \fBwm title\fR command).
-.VS 8.5
.TP
\fBwm iconphoto \fIwindow\fR ?\fB\-default\fR? \fIimage1\fR ?\fIimage2 ...\fR?
+.
Sets the titlebar icon for \fIwindow\fR based on the named photo images.
If \fB\-default\fR is specified, this is applied to all future created
toplevels as well. The data in the images is taken as a snapshot at the
@@ -384,10 +480,10 @@ simultaneously. It is recommended to use not more than 2 icons, placing
the larger icon first.
.PP
On Macintosh, this currently does nothing.
-.VE 8.5
.RE
.TP
\fBwm iconposition \fIwindow\fR ?\fIx y\fR?
+.
If \fIx\fR and \fIy\fR are specified, they are passed to the window
manager as a hint about where to position the icon for \fIwindow\fR.
In this case an empty string is returned. If \fIx\fR and \fIy\fR are
@@ -397,6 +493,7 @@ a Tcl list containing two values, which are the current icon position
hints (if no hints are in effect then an empty string is returned).
.TP
\fBwm iconwindow \fIwindow\fR ?\fIpathName\fR?
+.
If \fIpathName\fR is specified, it is the path name for a window to
use as icon for \fIwindow\fR: when \fIwindow\fR is iconified then
\fIpathName\fR will be mapped to serve as icon, and when \fIwindow\fR
@@ -414,6 +511,7 @@ those events.
Note: not all window managers support the notion of an icon window.
.TP
\fBwm manage \fIwidget\fR
+.
The \fIwidget\fR specified will become a stand alone top-level window. The
window will be decorated with the window managers title bar, etc. Only
\fIframe\fR, \fIlabelframe\fR and \fItoplevel\fR widgets can be used
@@ -422,6 +520,7 @@ an error. Attempting to manage a \fItoplevel\fR widget is benign and
achieves nothing. See also \fBGEOMETRY MANAGEMENT\fR.
.TP
\fBwm maxsize \fIwindow\fR ?\fIwidth height\fR?
+.
If \fIwidth\fR and \fIheight\fR are specified, they give
the maximum permissible dimensions for \fIwindow\fR.
For gridded windows the dimensions are specified in
@@ -436,6 +535,7 @@ The maximum size defaults to the size of the screen.
See the sections on geometry management below for more information.
.TP
\fBwm minsize \fIwindow\fR ?\fIwidth height\fR?
+.
If \fIwidth\fR and \fIheight\fR are specified, they give the
minimum permissible dimensions for \fIwindow\fR.
For gridded windows the dimensions are specified in
@@ -450,6 +550,7 @@ The minimum size defaults to one pixel in each dimension.
See the sections on geometry management below for more information.
.TP
\fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR?
+.
If \fIboolean\fR is specified, it must have a proper boolean form and
the override-redirect flag for \fIwindow\fR is set to that value.
If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is
@@ -460,8 +561,16 @@ it to be ignored by the window manager; among other things, this means
that the window will not be reparented from the root window into a
decorative frame and the user will not be able to manipulate the
window using the normal window manager mechanisms.
+.RS
+.PP
+Note that the override-redirect flag is only guaranteed to be taken notice of
+when the window is first mapped or when mapped after the state is changed from
+withdrawn to normal. Some, but not all, platforms will take notice at
+additional times.
+.RE
.TP
\fBwm positionfrom \fIwindow\fR ?\fIwho\fR?
+.
If \fIwho\fR is specified, it must be either \fBprogram\fR or
\fBuser\fR, or an abbreviation of one of these two. It indicates
whether \fIwindow\fR's current position was requested by the
@@ -482,6 +591,7 @@ when a \fBwm geometry\fR command is invoked, unless the source has
been set explicitly to \fBprogram\fR.
.TP
\fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR?
+.
This command is used to manage window manager protocols such as
\fBWM_DELETE_WINDOW\fR.
\fIName\fR is the name of an atom corresponding to a window manager
@@ -515,6 +625,7 @@ which it was received.
.RE
.TP
\fBwm resizable \fIwindow\fR ?\fIwidth height\fR?
+.
This command controls whether or not the user may interactively
resize a top-level window. If \fIwidth\fR and \fIheight\fR are
specified, they are boolean values that determine whether the
@@ -530,6 +641,7 @@ command. If there has been no such operation then
the window's natural size will be used.
.TP
\fBwm sizefrom \fIwindow\fR ?\fIwho\fR?
+.
If \fIwho\fR is specified, it must be either \fBprogram\fR or
\fBuser\fR, or an abbreviation of one of these two. It indicates
whether \fIwindow\fR's current size was requested by the
@@ -547,6 +659,7 @@ no source has been specified yet. Most window managers interpret
as equivalent to \fBprogram\fR.
.TP
\fBwm stackorder \fIwindow\fR ?\fBisabove\fR|\fBisbelow \fIwindow\fR?
+.
The \fBstackorder\fR 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
@@ -560,6 +673,7 @@ 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
\fBnormal\fR, \fBiconic\fR, \fBwithdrawn\fR, \fBicon\fR, or (Windows and Mac
@@ -571,6 +685,7 @@ purpose is to serve as the icon for some other window (via the \fBwm
iconwindow\fR command). The \fBicon\fR state cannot be set.
.TP
\fBwm title \fIwindow\fR ?\fIstring\fR?
+.
If \fIstring\fR is specified, then it will be passed to the window
manager for use as the title for \fIwindow\fR (the window manager
should display this string in \fIwindow\fR's title bar). In this
@@ -579,6 +694,7 @@ specified then the command returns the current title for the
\fIwindow\fR. The title for a window defaults to its name.
.TP
\fBwm transient \fIwindow\fR ?\fImaster\fR?
+.
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
@@ -590,8 +706,12 @@ empty string if \fIwindow\fR is not 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.
+The window manager may also decorate a transient window differently, removing
+some features normally present (e.g., minimize and maximize buttons) though
+this is entirely at the discretion of the window manager.
.TP
\fBwm withdraw \fIwindow\fR
+.
Arranges for \fIwindow\fR to be withdrawn from the screen. This
causes the window to be unmapped and forgotten about by the window
manager. If the window
@@ -684,6 +804,7 @@ operation of the \fBwm\fR command. For example, some changes will not
take effect if the window is already active: the window will have
to be withdrawn and de-iconified in order to make the change happen.
.SH EXAMPLES
+.PP
A fixed-size window that says that it is fixed-size too:
.CS
toplevel .fixed
@@ -718,3 +839,6 @@ set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}]
toplevel(n), winfo(n)
.SH KEYWORDS
aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/generic/tk.decls b/generic/tk.decls
index 9037e75..f37be47 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -20,891 +20,892 @@ library tk
interface tk
hooks {tkPlat tkInt tkIntPlat tkIntXlib}
+scspec EXTERN
# Declare each of the functions in the public Tk interface. Note that
# the an index should never be reused for a different function in order
# to preserve backwards compatibility.
-declare 0 generic {
+declare 0 {
void Tk_MainLoop(void)
}
-declare 1 generic {
+declare 1 {
XColor *Tk_3DBorderColor(Tk_3DBorder border)
}
-declare 2 generic {
+declare 2 {
GC Tk_3DBorderGC(Tk_Window tkwin, Tk_3DBorder border,
int which)
}
-declare 3 generic {
+declare 3 {
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 {
+declare 4 {
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, CONST char *name,
- CONST char *value, int priority)
+declare 5 {
+ void Tk_AddOption(Tk_Window tkwin, const char *name,
+ const char *value, int priority)
}
-declare 6 generic {
+declare 6 {
void Tk_BindEvent(Tk_BindingTable bindingTable,
XEvent *eventPtr, Tk_Window tkwin, int numObjects,
ClientData *objectPtr)
}
-declare 7 generic {
+declare 7 {
void Tk_CanvasDrawableCoords(Tk_Canvas canvas,
double x, double y, short *drawableXPtr,
short *drawableYPtr)
}
-declare 8 generic {
+declare 8 {
void Tk_CanvasEventuallyRedraw(Tk_Canvas canvas, int x1, int y1,
int x2, int y2)
}
-declare 9 generic {
+declare 9 {
int Tk_CanvasGetCoord(Tcl_Interp *interp,
- Tk_Canvas canvas, CONST char *str, double *doublePtr)
+ Tk_Canvas canvas, const char *str, double *doublePtr)
}
-declare 10 generic {
+declare 10 {
Tk_CanvasTextInfo *Tk_CanvasGetTextInfo(Tk_Canvas canvas)
}
-declare 11 generic {
+declare 11 {
int Tk_CanvasPsBitmap(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap, int x, int y,
int width, int height)
}
-declare 12 generic {
+declare 12 {
int Tk_CanvasPsColor(Tcl_Interp *interp,
Tk_Canvas canvas, XColor *colorPtr)
}
-declare 13 generic {
+declare 13 {
int Tk_CanvasPsFont(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Font font)
}
-declare 14 generic {
+declare 14 {
void Tk_CanvasPsPath(Tcl_Interp *interp,
Tk_Canvas canvas, double *coordPtr, int numPoints)
}
-declare 15 generic {
+declare 15 {
int Tk_CanvasPsStipple(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap)
}
-declare 16 generic {
+declare 16 {
double Tk_CanvasPsY(Tk_Canvas canvas, double y)
}
-declare 17 generic {
+declare 17 {
void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc)
}
-declare 18 generic {
+declare 18 {
int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 19 generic {
- char *Tk_CanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 19 {
+ CONST86 char *Tk_CanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 20 generic {
+declare 20 {
Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas)
}
-declare 21 generic {
+declare 21 {
void Tk_CanvasWindowCoords(Tk_Canvas canvas, double x, double y,
short *screenXPtr, short *screenYPtr)
}
-declare 22 generic {
+declare 22 {
void Tk_ChangeWindowAttributes(Tk_Window tkwin, unsigned long valueMask,
XSetWindowAttributes *attsPtr)
}
-declare 23 generic {
+declare 23 {
int Tk_CharBbox(Tk_TextLayout layout, int index, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr)
}
-declare 24 generic {
+declare 24 {
void Tk_ClearSelection(Tk_Window tkwin, Atom selection)
}
-declare 25 generic {
+declare 25 {
int Tk_ClipboardAppend(Tcl_Interp *interp, Tk_Window tkwin,
- Atom target, Atom format, char *buffer)
+ Atom target, Atom format, const char *buffer)
}
-declare 26 generic {
+declare 26 {
int Tk_ClipboardClear(Tcl_Interp *interp, Tk_Window tkwin)
}
-declare 27 generic {
+declare 27 {
int Tk_ConfigureInfo(Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specs,
- char *widgRec, CONST char *argvName, int flags)
+ Tk_Window tkwin, const Tk_ConfigSpec *specs,
+ char *widgRec, const char *argvName, int flags)
}
-declare 28 generic {
+declare 28 {
int Tk_ConfigureValue(Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specs,
- char *widgRec, CONST char *argvName, int flags)
+ Tk_Window tkwin, const Tk_ConfigSpec *specs,
+ char *widgRec, const char *argvName, int flags)
}
-declare 29 generic {
+declare 29 {
int Tk_ConfigureWidget(Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specs,
+ Tk_Window tkwin, const Tk_ConfigSpec *specs,
int argc, CONST84 char **argv, char *widgRec,
int flags)
}
-declare 30 generic {
+declare 30 {
void Tk_ConfigureWindow(Tk_Window tkwin,
unsigned int valueMask, XWindowChanges *valuePtr)
}
-declare 31 generic {
+declare 31 {
Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font,
- CONST char *str, int numChars, int wrapLength,
+ const char *str, int numChars, int wrapLength,
Tk_Justify justify, int flags, int *widthPtr,
int *heightPtr)
}
-declare 32 generic {
+declare 32 {
Tk_Window Tk_CoordsToWindow(int rootX, int rootY, Tk_Window tkwin)
}
-declare 33 generic {
+declare 33 {
unsigned long Tk_CreateBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
- CONST char *eventStr, CONST char *command, int append)
+ const char *eventStr, const char *script, int append)
}
-declare 34 generic {
+declare 34 {
Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp)
}
-declare 35 generic {
+declare 35 {
Tk_ErrorHandler Tk_CreateErrorHandler(Display *display,
int errNum, int request, int minorCode,
Tk_ErrorProc *errorProc, ClientData clientData)
}
-declare 36 generic {
+declare 36 {
void Tk_CreateEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
-declare 37 generic {
+declare 37 {
void Tk_CreateGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
-declare 38 generic {
- void Tk_CreateImageType(Tk_ImageType *typePtr)
+declare 38 {
+ void Tk_CreateImageType(const Tk_ImageType *typePtr)
}
-declare 39 generic {
+declare 39 {
void Tk_CreateItemType(Tk_ItemType *typePtr)
}
-declare 40 generic {
- void Tk_CreatePhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
+declare 40 {
+ void Tk_CreatePhotoImageFormat(const Tk_PhotoImageFormat *formatPtr)
}
-declare 41 generic {
+declare 41 {
void Tk_CreateSelHandler(Tk_Window tkwin,
Atom selection, Atom target,
Tk_SelectionProc *proc, ClientData clientData,
Atom format)
}
-declare 42 generic {
+declare 42 {
Tk_Window Tk_CreateWindow(Tcl_Interp *interp,
- Tk_Window parent, CONST char *name, CONST char *screenName)
+ Tk_Window parent, const char *name, const char *screenName)
}
-declare 43 generic {
+declare 43 {
Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *pathName, CONST char *screenName)
+ const char *pathName, const char *screenName)
}
-declare 44 generic {
- int Tk_DefineBitmap(Tcl_Interp *interp, CONST char *name,
- CONST char *source, int width, int height)
+declare 44 {
+ int Tk_OldDefineBitmap(Tcl_Interp *interp, const char *name,
+ const char *source, int width, int height)
}
-declare 45 generic {
+declare 45 {
void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor)
}
-declare 46 generic {
+declare 46 {
void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, ClientData object)
}
-declare 47 generic {
+declare 47 {
int Tk_DeleteBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
- CONST char *eventStr)
+ const char *eventStr)
}
-declare 48 generic {
+declare 48 {
void Tk_DeleteBindingTable(Tk_BindingTable bindingTable)
}
-declare 49 generic {
+declare 49 {
void Tk_DeleteErrorHandler(Tk_ErrorHandler handler)
}
-declare 50 generic {
+declare 50 {
void Tk_DeleteEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
-declare 51 generic {
+declare 51 {
void Tk_DeleteGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
-declare 52 generic {
- void Tk_DeleteImage(Tcl_Interp *interp, CONST char *name)
+declare 52 {
+ void Tk_DeleteImage(Tcl_Interp *interp, const char *name)
}
-declare 53 generic {
+declare 53 {
void Tk_DeleteSelHandler(Tk_Window tkwin, Atom selection, Atom target)
}
-declare 54 generic {
+declare 54 {
void Tk_DestroyWindow(Tk_Window tkwin)
}
-declare 55 generic {
+declare 55 {
CONST84_RETURN char *Tk_DisplayName(Tk_Window tkwin)
}
-declare 56 generic {
+declare 56 {
int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x, int y)
}
-declare 57 generic {
+declare 57 {
void Tk_Draw3DPolygon(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border,
XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
-declare 58 generic {
+declare 58 {
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 {
+declare 59 {
void Tk_DrawChars(Display *display, Drawable drawable, GC gc,
- Tk_Font tkfont, CONST char *source, int numBytes, int x, int y)
+ Tk_Font tkfont, const char *source, int numBytes, int x, int y)
}
-declare 60 generic {
+declare 60 {
void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width,
Drawable drawable)
}
-declare 61 generic {
+declare 61 {
void Tk_DrawTextLayout(Display *display,
Drawable drawable, GC gc, Tk_TextLayout layout,
int x, int y, int firstChar, int lastChar)
}
-declare 62 generic {
+declare 62 {
void Tk_Fill3DPolygon(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border,
XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
-declare 63 generic {
+declare 63 {
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, CONST char *imageName)
+declare 64 {
+ Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp, const char *imageName)
}
-declare 65 generic {
+declare 65 {
Font Tk_FontId(Tk_Font font)
}
-declare 66 generic {
+declare 66 {
void Tk_Free3DBorder(Tk_3DBorder border)
}
-declare 67 generic {
+declare 67 {
void Tk_FreeBitmap(Display *display, Pixmap bitmap)
}
-declare 68 generic {
+declare 68 {
void Tk_FreeColor(XColor *colorPtr)
}
-declare 69 generic {
+declare 69 {
void Tk_FreeColormap(Display *display, Colormap colormap)
}
-declare 70 generic {
+declare 70 {
void Tk_FreeCursor(Display *display, Tk_Cursor cursor)
}
-declare 71 generic {
+declare 71 {
void Tk_FreeFont(Tk_Font f)
}
-declare 72 generic {
+declare 72 {
void Tk_FreeGC(Display *display, GC gc)
}
-declare 73 generic {
+declare 73 {
void Tk_FreeImage(Tk_Image image)
}
-declare 74 generic {
- void Tk_FreeOptions(Tk_ConfigSpec *specs,
+declare 74 {
+ void Tk_FreeOptions(const Tk_ConfigSpec *specs,
char *widgRec, Display *display, int needFlags)
}
-declare 75 generic {
+declare 75 {
void Tk_FreePixmap(Display *display, Pixmap pixmap)
}
-declare 76 generic {
+declare 76 {
void Tk_FreeTextLayout(Tk_TextLayout textLayout)
}
-declare 77 generic {
+declare 77 {
void Tk_FreeXId(Display *display, XID xid)
}
-declare 78 generic {
+declare 78 {
GC Tk_GCForColor(XColor *colorPtr, Drawable drawable)
}
-declare 79 generic {
+declare 79 {
void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight)
}
-declare 80 generic {
+declare 80 {
Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid colorName)
}
-declare 81 generic {
+declare 81 {
void Tk_GetAllBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object)
}
-declare 82 generic {
+declare 82 {
int Tk_GetAnchor(Tcl_Interp *interp,
- CONST char *str, Tk_Anchor *anchorPtr)
+ const char *str, Tk_Anchor *anchorPtr)
}
-declare 83 generic {
+declare 83 {
CONST84_RETURN char *Tk_GetAtomName(Tk_Window tkwin, Atom atom)
}
-declare 84 generic {
+declare 84 {
CONST84_RETURN char *Tk_GetBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
- CONST char *eventStr)
+ const char *eventStr)
}
-declare 85 generic {
- Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)
+declare 85 {
+ Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char *str)
}
-declare 86 generic {
- Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *source, int width, int height)
+declare 86 {
+ Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp,
+ Tk_Window tkwin, const char *source, int width, int height)
}
-declare 87 generic {
- int Tk_GetCapStyle(Tcl_Interp *interp, CONST char *str, int *capPtr)
+declare 87 {
+ int Tk_GetCapStyle(Tcl_Interp *interp, const char *str, int *capPtr)
}
-declare 88 generic {
+declare 88 {
XColor *Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)
}
-declare 89 generic {
+declare 89 {
XColor *Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr)
}
-declare 90 generic {
+declare 90 {
Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str)
+ const char *str)
}
-declare 91 generic {
+declare 91 {
Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid str)
}
-declare 92 generic {
+declare 92 {
Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *source, CONST char *mask,
+ 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 {
+declare 93 {
Tk_Font Tk_GetFont(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *str)
+ Tk_Window tkwin, const char *str)
}
-declare 94 generic {
+declare 94 {
Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 95 generic {
+declare 95 {
void Tk_GetFontMetrics(Tk_Font font, Tk_FontMetrics *fmPtr)
}
-declare 96 generic {
+declare 96 {
GC Tk_GetGC(Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr)
}
-declare 97 generic {
- Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, CONST char *name,
+declare 97 {
+ Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, const char *name,
Tk_ImageChangedProc *changeProc, ClientData clientData)
}
-declare 98 generic {
+declare 98 {
ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
- CONST char *name, Tk_ImageType **typePtrPtr)
+ const char *name, CONST86 Tk_ImageType **typePtrPtr)
}
-declare 99 generic {
+declare 99 {
Tk_ItemType *Tk_GetItemTypes(void)
}
-declare 100 generic {
- int Tk_GetJoinStyle(Tcl_Interp *interp, CONST char *str, int *joinPtr)
+declare 100 {
+ int Tk_GetJoinStyle(Tcl_Interp *interp, const char *str, int *joinPtr)
}
-declare 101 generic {
+declare 101 {
int Tk_GetJustify(Tcl_Interp *interp,
- CONST char *str, Tk_Justify *justifyPtr)
+ const char *str, Tk_Justify *justifyPtr)
}
-declare 102 generic {
+declare 102 {
int Tk_GetNumMainWindows(void)
}
-declare 103 generic {
- Tk_Uid Tk_GetOption(Tk_Window tkwin, CONST char *name,
- CONST char *className)
+declare 103 {
+ Tk_Uid Tk_GetOption(Tk_Window tkwin, const char *name,
+ const char *className)
}
-declare 104 generic {
+declare 104 {
int Tk_GetPixels(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *str, int *intPtr)
+ Tk_Window tkwin, const char *str, int *intPtr)
}
-declare 105 generic {
+declare 105 {
Pixmap Tk_GetPixmap(Display *display, Drawable d,
int width, int height, int depth)
}
-declare 106 generic {
- int Tk_GetRelief(Tcl_Interp *interp, CONST char *name, int *reliefPtr)
+declare 106 {
+ int Tk_GetRelief(Tcl_Interp *interp, const char *name, int *reliefPtr)
}
-declare 107 generic {
+declare 107 {
void Tk_GetRootCoords(Tk_Window tkwin, int *xPtr, int *yPtr)
}
-declare 108 generic {
+declare 108 {
int Tk_GetScrollInfo(Tcl_Interp *interp,
int argc, CONST84 char **argv, double *dblPtr, int *intPtr)
}
-declare 109 generic {
+declare 109 {
int Tk_GetScreenMM(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *str, double *doublePtr)
+ Tk_Window tkwin, const char *str, double *doublePtr)
}
-declare 110 generic {
+declare 110 {
int Tk_GetSelection(Tcl_Interp *interp,
Tk_Window tkwin, Atom selection, Atom target,
Tk_GetSelProc *proc, ClientData clientData)
}
-declare 111 generic {
- Tk_Uid Tk_GetUid(CONST char *str)
+declare 111 {
+ Tk_Uid Tk_GetUid(const char *str)
}
-declare 112 generic {
+declare 112 {
Visual *Tk_GetVisual(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *str, int *depthPtr,
+ Tk_Window tkwin, const char *str, int *depthPtr,
Colormap *colormapPtr)
}
-declare 113 generic {
+declare 113 {
void Tk_GetVRootGeometry(Tk_Window tkwin,
int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)
}
-declare 114 generic {
+declare 114 {
int Tk_Grab(Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)
}
-declare 115 generic {
+declare 115 {
void Tk_HandleEvent(XEvent *eventPtr)
}
-declare 116 generic {
+declare 116 {
Tk_Window Tk_IdToWindow(Display *display, Window window)
}
-declare 117 generic {
+declare 117 {
void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
-declare 118 generic {
+declare 118 {
int Tk_Init(Tcl_Interp *interp)
}
-declare 119 generic {
- Atom Tk_InternAtom(Tk_Window tkwin, CONST char *name)
+declare 119 {
+ Atom Tk_InternAtom(Tk_Window tkwin, const char *name)
}
-declare 120 generic {
+declare 120 {
int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y,
int width, int height)
}
-declare 121 generic {
+declare 121 {
void Tk_MaintainGeometry(Tk_Window slave,
Tk_Window master, int x, int y, int width, int height)
}
-declare 122 generic {
+declare 122 {
Tk_Window Tk_MainWindow(Tcl_Interp *interp)
}
-declare 123 generic {
+declare 123 {
void Tk_MakeWindowExist(Tk_Window tkwin)
}
-declare 124 generic {
+declare 124 {
void Tk_ManageGeometry(Tk_Window tkwin,
- CONST Tk_GeomMgr *mgrPtr, ClientData clientData)
+ const Tk_GeomMgr *mgrPtr, ClientData clientData)
}
-declare 125 generic {
+declare 125 {
void Tk_MapWindow(Tk_Window tkwin)
}
-declare 126 generic {
+declare 126 {
int Tk_MeasureChars(Tk_Font tkfont,
- CONST char *source, int numBytes, int maxPixels,
+ const char *source, int numBytes, int maxPixels,
int flags, int *lengthPtr)
}
-declare 127 generic {
+declare 127 {
void Tk_MoveResizeWindow(Tk_Window tkwin,
int x, int y, int width, int height)
}
-declare 128 generic {
+declare 128 {
void Tk_MoveWindow(Tk_Window tkwin, int x, int y)
}
-declare 129 generic {
+declare 129 {
void Tk_MoveToplevelWindow(Tk_Window tkwin, int x, int y)
}
-declare 130 generic {
+declare 130 {
CONST84_RETURN char *Tk_NameOf3DBorder(Tk_3DBorder border)
}
-declare 131 generic {
+declare 131 {
CONST84_RETURN char *Tk_NameOfAnchor(Tk_Anchor anchor)
}
-declare 132 generic {
+declare 132 {
CONST84_RETURN char *Tk_NameOfBitmap(Display *display, Pixmap bitmap)
}
-declare 133 generic {
+declare 133 {
CONST84_RETURN char *Tk_NameOfCapStyle(int cap)
}
-declare 134 generic {
+declare 134 {
CONST84_RETURN char *Tk_NameOfColor(XColor *colorPtr)
}
-declare 135 generic {
+declare 135 {
CONST84_RETURN char *Tk_NameOfCursor(Display *display, Tk_Cursor cursor)
}
-declare 136 generic {
+declare 136 {
CONST84_RETURN char *Tk_NameOfFont(Tk_Font font)
}
-declare 137 generic {
+declare 137 {
CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster imageMaster)
}
-declare 138 generic {
+declare 138 {
CONST84_RETURN char *Tk_NameOfJoinStyle(int join)
}
-declare 139 generic {
+declare 139 {
CONST84_RETURN char *Tk_NameOfJustify(Tk_Justify justify)
}
-declare 140 generic {
+declare 140 {
CONST84_RETURN char *Tk_NameOfRelief(int relief)
}
-declare 141 generic {
+declare 141 {
Tk_Window Tk_NameToWindow(Tcl_Interp *interp,
- CONST char *pathName, Tk_Window tkwin)
+ const char *pathName, Tk_Window tkwin)
}
-declare 142 generic {
+declare 142 {
void Tk_OwnSelection(Tk_Window tkwin,
Atom selection, Tk_LostSelProc *proc,
ClientData clientData)
}
-declare 143 generic {
+declare 143 {
int Tk_ParseArgv(Tcl_Interp *interp,
Tk_Window tkwin, int *argcPtr, CONST84 char **argv,
- Tk_ArgvInfo *argTable, int flags)
+ const Tk_ArgvInfo *argTable, int flags)
}
-declare 144 generic {
+declare 144 {
void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height)
}
-declare 145 generic {
+declare 145 {
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)
}
-declare 146 generic {
+declare 146 {
int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)
}
-declare 147 generic {
+declare 147 {
void Tk_PhotoBlank(Tk_PhotoHandle handle)
}
-declare 148 generic {
+declare 148 {
void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height )
}
-declare 149 generic {
+declare 149 {
void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)
}
-declare 150 generic {
+declare 150 {
void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height)
}
-declare 151 generic {
+declare 151 {
int Tk_PointToChar(Tk_TextLayout layout, int x, int y)
}
-declare 152 generic {
+declare 152 {
int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr)
}
-declare 153 generic {
+declare 153 {
void Tk_PreserveColormap(Display *display, Colormap colormap)
}
-declare 154 generic {
+declare 154 {
void Tk_QueueWindowEvent(XEvent *eventPtr, Tcl_QueuePosition position)
}
-declare 155 generic {
+declare 155 {
void Tk_RedrawImage(Tk_Image image, int imageX,
int imageY, int width, int height,
Drawable drawable, int drawableX, int drawableY)
}
-declare 156 generic {
+declare 156 {
void Tk_ResizeWindow(Tk_Window tkwin, int width, int height)
}
-declare 157 generic {
+declare 157 {
int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other)
}
-declare 158 generic {
+declare 158 {
Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc,
ClientData arg, ClientData *prevArgPtr)
}
-declare 159 generic {
+declare 159 {
int Tk_SafeInit(Tcl_Interp *interp)
}
-declare 160 generic {
- CONST char *Tk_SetAppName(Tk_Window tkwin, CONST char *name)
+declare 160 {
+ const char *Tk_SetAppName(Tk_Window tkwin, const char *name)
}
-declare 161 generic {
+declare 161 {
void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border)
}
-declare 162 generic {
- void Tk_SetClass(Tk_Window tkwin, CONST char *className)
+declare 162 {
+ void Tk_SetClass(Tk_Window tkwin, const char *className)
}
-declare 163 generic {
+declare 163 {
void Tk_SetGrid(Tk_Window tkwin, int reqWidth, int reqHeight,
int gridWidth, int gridHeight)
}
-declare 164 generic {
+declare 164 {
void Tk_SetInternalBorder(Tk_Window tkwin, int width)
}
-declare 165 generic {
+declare 165 {
void Tk_SetWindowBackground(Tk_Window tkwin, unsigned long pixel)
}
-declare 166 generic {
+declare 166 {
void Tk_SetWindowBackgroundPixmap(Tk_Window tkwin, Pixmap pixmap)
}
-declare 167 generic {
+declare 167 {
void Tk_SetWindowBorder(Tk_Window tkwin, unsigned long pixel)
}
-declare 168 generic {
+declare 168 {
void Tk_SetWindowBorderWidth(Tk_Window tkwin, int width)
}
-declare 169 generic {
+declare 169 {
void Tk_SetWindowBorderPixmap(Tk_Window tkwin, Pixmap pixmap)
}
-declare 170 generic {
+declare 170 {
void Tk_SetWindowColormap(Tk_Window tkwin, Colormap colormap)
}
-declare 171 generic {
+declare 171 {
int Tk_SetWindowVisual(Tk_Window tkwin, Visual *visual, int depth,
Colormap colormap)
}
-declare 172 generic {
+declare 172 {
void Tk_SizeOfBitmap(Display *display, Pixmap bitmap, int *widthPtr,
int *heightPtr)
}
-declare 173 generic {
+declare 173 {
void Tk_SizeOfImage(Tk_Image image, int *widthPtr, int *heightPtr)
}
-declare 174 generic {
+declare 174 {
int Tk_StrictMotif(Tk_Window tkwin)
}
-declare 175 generic {
+declare 175 {
void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout)
}
-declare 176 generic {
- int Tk_TextWidth(Tk_Font font, CONST char *str, int numBytes)
+declare 176 {
+ int Tk_TextWidth(Tk_Font font, const char *str, int numBytes)
}
-declare 177 generic {
+declare 177 {
void Tk_UndefineCursor(Tk_Window window)
}
-declare 178 generic {
+declare 178 {
void Tk_UnderlineChars(Display *display,
Drawable drawable, GC gc, Tk_Font tkfont,
- CONST char *source, int x, int y, int firstByte,
+ const char *source, int x, int y, int firstByte,
int lastByte)
}
-declare 179 generic {
+declare 179 {
void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc,
Tk_TextLayout layout, int x, int y,
int underline)
}
-declare 180 generic {
+declare 180 {
void Tk_Ungrab(Tk_Window tkwin)
}
-declare 181 generic {
+declare 181 {
void Tk_UnmaintainGeometry(Tk_Window slave, Tk_Window master)
}
-declare 182 generic {
+declare 182 {
void Tk_UnmapWindow(Tk_Window tkwin)
}
-declare 183 generic {
+declare 183 {
void Tk_UnsetGrid(Tk_Window tkwin)
}
-declare 184 generic {
+declare 184 {
void Tk_UpdatePointer(Tk_Window tkwin, int x, int y, int state)
}
# new functions for 8.1
-declare 185 generic {
+declare 185 {
Pixmap Tk_AllocBitmapFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-declare 186 generic {
+declare 186 {
Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-declare 187 generic {
+declare 187 {
XColor *Tk_AllocColorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-declare 188 generic {
+declare 188 {
Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-declare 189 generic {
+declare 189 {
Tk_Font Tk_AllocFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-declare 190 generic {
+declare 190 {
Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
- CONST Tk_OptionSpec *templatePtr)
+ const Tk_OptionSpec *templatePtr)
}
-declare 191 generic {
+declare 191 {
void Tk_DeleteOptionTable(Tk_OptionTable optionTable)
}
-declare 192 generic {
+declare 192 {
void Tk_Free3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 193 generic {
+declare 193 {
void Tk_FreeBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 194 generic {
+declare 194 {
void Tk_FreeColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 195 generic {
+declare 195 {
void Tk_FreeConfigOptions(char *recordPtr, Tk_OptionTable optionToken,
Tk_Window tkwin)
}
-declare 196 generic {
+declare 196 {
void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr)
}
-declare 197 generic {
+declare 197 {
void Tk_FreeCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 198 generic {
+declare 198 {
void Tk_FreeFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 199 generic {
+declare 199 {
Tk_3DBorder Tk_Get3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 200 generic {
+declare 200 {
int Tk_GetAnchorFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
Tk_Anchor *anchorPtr)
}
-declare 201 generic {
+declare 201 {
Pixmap Tk_GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 202 generic {
+declare 202 {
XColor *Tk_GetColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 203 generic {
+declare 203 {
Tk_Cursor Tk_GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-declare 204 generic {
+declare 204 {
Tcl_Obj *Tk_GetOptionInfo(Tcl_Interp *interp,
char *recordPtr, Tk_OptionTable optionTable,
Tcl_Obj *namePtr, Tk_Window tkwin)
}
-declare 205 generic {
+declare 205 {
Tcl_Obj *Tk_GetOptionValue(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)
}
-declare 206 generic {
+declare 206 {
int Tk_GetJustifyFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tk_Justify *justifyPtr)
}
-declare 207 generic {
+declare 207 {
int Tk_GetMMFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr)
}
-declare 208 generic {
+declare 208 {
int Tk_GetPixelsFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr)
}
-declare 209 generic {
+declare 209 {
int Tk_GetReliefFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *resultPtr)
}
-declare 210 generic {
+declare 210 {
int Tk_GetScrollInfoObj(Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr)
+ int objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr)
}
-declare 211 generic {
+declare 211 {
int Tk_InitOptions(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin)
}
-declare 212 generic {
+declare 212 {
void Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp)
}
-declare 213 generic {
+declare 213 {
void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr)
}
-declare 214 generic {
+declare 214 {
int Tk_SetOptions(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, int objc,
- Tcl_Obj *CONST objv[], Tk_Window tkwin,
+ Tcl_Obj *const objv[], Tk_Window tkwin,
Tk_SavedOptions *savePtr, int *maskPtr)
}
-declare 215 generic {
+declare 215 {
void Tk_InitConsoleChannels(Tcl_Interp *interp)
}
-declare 216 generic {
+declare 216 {
int Tk_CreateConsoleWindow(Tcl_Interp *interp)
}
-declare 217 generic {
- void Tk_CreateSmoothMethod(Tcl_Interp *interp, Tk_SmoothMethod *method)
+declare 217 {
+ void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method)
}
-#declare 218 generic {
-# void Tk_CreateCanvasVisitor(Tcl_Interp *interp, VOID *typePtr)
+#declare 218 {
+# void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr)
#}
-#declare 219 generic {
-# VOID *Tk_GetCanvasVisitor(Tcl_Interp *interp, CONST char *name)
+#declare 219 {
+# void *Tk_GetCanvasVisitor(Tcl_Interp *interp, const char *name)
#}
-declare 220 generic {
- int Tk_GetDash(Tcl_Interp *interp, CONST char *value, Tk_Dash *dash)
+declare 220 {
+ int Tk_GetDash(Tcl_Interp *interp, const char *value, Tk_Dash *dash)
}
-declare 221 generic {
+declare 221 {
void Tk_CreateOutline(Tk_Outline *outline)
}
-declare 222 generic {
+declare 222 {
void Tk_DeleteOutline(Display *display, Tk_Outline *outline)
}
-declare 223 generic {
+declare 223 {
int Tk_ConfigOutlineGC(XGCValues *gcValues, Tk_Canvas canvas,
Tk_Item *item, Tk_Outline *outline)
}
-declare 224 generic {
+declare 224 {
int Tk_ChangeOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
-declare 225 generic {
+declare 225 {
int Tk_ResetOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
-declare 226 generic {
+declare 226 {
int Tk_CanvasPsOutline(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
-declare 227 generic {
+declare 227 {
void Tk_SetTSOrigin(Tk_Window tkwin, GC gc, int x, int y)
}
-declare 228 generic {
+declare 228 {
int Tk_CanvasGetCoordFromObj(Tcl_Interp *interp, Tk_Canvas canvas,
Tcl_Obj *obj, double *doublePtr)
}
-declare 229 generic {
+declare 229 {
void Tk_CanvasSetOffset(Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)
}
-declare 230 generic {
+declare 230 {
void Tk_DitherPhoto(Tk_PhotoHandle handle, int x, int y, int width,
int height)
}
-declare 231 generic {
+declare 231 {
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 {
+declare 232 {
int Tk_PostscriptColor(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
XColor *colorPtr)
}
-declare 233 generic {
+declare 233 {
int Tk_PostscriptFont(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
Tk_Font font)
}
-declare 234 generic {
+declare 234 {
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 {
+declare 235 {
void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
double *coordPtr, int numPoints)
}
-declare 236 generic {
+declare 236 {
int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin,
Tk_PostscriptInfo psInfo, Pixmap bitmap)
}
-declare 237 generic {
+declare 237 {
double Tk_PostscriptY(double y, Tk_PostscriptInfo psInfo)
}
-declare 238 generic {
+declare 238 {
int Tk_PostscriptPhoto(Tcl_Interp *interp,
Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo,
int width, int height)
@@ -912,146 +913,146 @@ declare 238 generic {
# New in 8.4a1
#
-declare 239 generic {
+declare 239 {
void Tk_CreateClientMessageHandler(Tk_ClientMessageProc *proc)
}
-declare 240 generic {
+declare 240 {
void Tk_DeleteClientMessageHandler(Tk_ClientMessageProc *proc)
}
# New in 8.4a2
#
-declare 241 generic {
+declare 241 {
Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp,
- Tk_Window parent, CONST char *screenName)
+ Tk_Window parent, const char *screenName)
}
-declare 242 generic {
+declare 242 {
void Tk_SetClassProcs(Tk_Window tkwin,
- Tk_ClassProcs *procs, ClientData instanceData)
+ const Tk_ClassProcs *procs, ClientData instanceData)
}
# New in 8.4a4
#
-declare 243 generic {
+declare 243 {
void Tk_SetInternalBorderEx(Tk_Window tkwin, int left, int right,
int top, int bottom)
}
-declare 244 generic {
+declare 244 {
void Tk_SetMinimumRequestSize(Tk_Window tkwin,
int minWidth, int minHeight)
}
# New in 8.4a5
#
-declare 245 generic {
+declare 245 {
void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
}
-declare 246 generic {
+declare 246 {
void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int compRule)
}
-declare 247 generic {
+declare 247 {
void Tk_PhotoPutZoomedBlock_Panic(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 {
+declare 248 {
int Tk_CollapseMotionEvents(Display *display, int collapse)
}
# Style engine
-declare 249 generic {
- Tk_StyleEngine Tk_RegisterStyleEngine(CONST char *name,
+declare 249 {
+ Tk_StyleEngine Tk_RegisterStyleEngine(const char *name,
Tk_StyleEngine parent)
}
-declare 250 generic {
- Tk_StyleEngine Tk_GetStyleEngine(CONST char *name)
+declare 250 {
+ Tk_StyleEngine Tk_GetStyleEngine(const char *name)
}
-declare 251 generic {
+declare 251 {
int Tk_RegisterStyledElement(Tk_StyleEngine engine,
Tk_ElementSpec *templatePtr)
}
-declare 252 generic {
- int Tk_GetElementId(CONST char *name)
+declare 252 {
+ int Tk_GetElementId(const char *name)
}
-declare 253 generic {
- Tk_Style Tk_CreateStyle(CONST char *name, Tk_StyleEngine engine,
+declare 253 {
+ 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 254 {
+ Tk_Style Tk_GetStyle(Tcl_Interp *interp, const char *name)
}
-declare 255 generic {
+declare 255 {
void Tk_FreeStyle(Tk_Style style)
}
-declare 256 generic {
- CONST char *Tk_NameOfStyle(Tk_Style style)
+declare 256 {
+ const char *Tk_NameOfStyle(Tk_Style style)
}
-declare 257 generic {
+declare 257 {
Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
}
-declare 258 generic {
+declare 258 {
Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr)
}
-declare 259 generic {
+declare 259 {
void Tk_FreeStyleFromObj(Tcl_Obj *objPtr)
}
-declare 260 generic {
+declare 260 {
Tk_StyledElement Tk_GetStyledElement(Tk_Style style, int elementId,
Tk_OptionTable optionTable)
}
-declare 261 generic {
+declare 261 {
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 {
+declare 262 {
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 {
+declare 263 {
int Tk_GetElementBorderWidth(Tk_Style style, Tk_StyledElement element,
char *recordPtr, Tk_Window tkwin)
}
-declare 264 generic {
+declare 264 {
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)
}
# TIP#116
-declare 265 generic {
+declare 265 {
int Tk_PhotoExpand(Tcl_Interp *interp, Tk_PhotoHandle handle,
int width, int height)
}
-declare 266 generic {
+declare 266 {
int Tk_PhotoPutBlock(Tcl_Interp *interp, Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height,
int compRule)
}
-declare 267 generic {
+declare 267 {
int Tk_PhotoPutZoomedBlock(Tcl_Interp *interp, 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 268 generic {
+declare 268 {
int Tk_PhotoSetSize(Tcl_Interp *interp, Tk_PhotoHandle handle,
int width, int height)
}
# TIP#245
-declare 269 generic {
+declare 269 {
long Tk_GetUserInactiveTime(Display *dpy)
}
-declare 270 generic {
+declare 270 {
void Tk_ResetUserInactiveTime(Display *dpy)
}
# TIP #264
-declare 271 generic {
+declare 271 {
Tcl_Interp *Tk_Interp(Tk_Window tkwin)
}
@@ -1065,11 +1066,22 @@ declare 271 generic {
# It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!).
# Developers who need to produce a file [load]able into legacy interps must
# build against legacy sources.
-declare 272 generic {
- void Tk_CreateOldImageType(Tk_ImageType *typePtr)
+declare 272 {
+ void Tk_CreateOldImageType(const Tk_ImageType *typePtr)
+}
+declare 273 {
+ void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr)
}
-declare 273 generic {
- void Tk_CreateOldPhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
+
+# See [Enhancement request 2636558] Tk_DefineBitmap and
+# Tk_GetBitmapFromData signature problem
+declare 274 {
+ int Tk_DefineBitmap(Tcl_Interp *interp, const char *name,
+ const void *source, int width, int height)
+}
+declare 275 {
+ Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
+ Tk_Window tkwin, const void *source, int width, int height)
}
# Define the platform specific public Tk interface. These functions are
@@ -1135,10 +1147,10 @@ declare 6 aqua {
void TkMacOSXInvalClipRgns(Tk_Window tkwin)
}
declare 7 aqua {
- GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable)
+ void *TkMacOSXGetDrawablePort(Drawable drawable)
}
declare 8 aqua {
- ControlRef TkMacOSXGetRootControl(Drawable drawable)
+ void *TkMacOSXGetRootControl(Drawable drawable)
}
declare 9 aqua {
void Tk_MacOSXSetupTkNotifier(void)
@@ -1152,28 +1164,6 @@ declare 10 aqua {
# Public functions that are not accessible via the stubs table.
export {
- CONST char *Tk_InitStubs(Tcl_Interp *interp, CONST char *version,
+ const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version,
int exact)
}
-export {
- CONST char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version,
- int exact)
-}
-
-# Global variables that need to be exported from the tcl shared library.
-
-export {
- TkStubs *tkStubsPtr (fool checkstubs)
-}
-export {
- TkPlatStubs *tkPlatStubsPtr (fool checkstubs)
-}
-export {
- TkIntStubs *tkIntStubsPtr (fool checkstubs)
-}
-export {
- TkIntPlatStubs *tkIntPlatStubsPtr (fool checkstubs)
-}
-export {
- TkIntXlibStubs *tkIntXlibStubsPtr (fool checkstubs)
-}
diff --git a/generic/tk.h b/generic/tk.h
index 638ec2a..a9b96e3 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -17,10 +17,10 @@
#define _TK
#include <tcl.h>
-#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 5)
-# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5
+#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6)
+# error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better
#endif
-
+
/*
* For C++ compilers, use extern "C"
*/
@@ -33,12 +33,11 @@ extern "C" {
* When version numbers change here, you must also go into the following files
* and update the version numbers:
*
- * library/tk.tcl (2 LOC patch)
+ * library/tk.tcl (1 LOC patch)
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
* win/configure.in (as above)
* README (sections 0 and 1)
- * macosx/Wish.xcode/project.pbxproj (not patchlevel) 1 LOC
- * macosx/Wish-Common.xcconfig (not patchlevel) 1 LOC
+ * macosx/Tk-Common.xcconfig (not patchlevel) 1 LOC
* win/README (not patchlevel)
* unix/README (not patchlevel)
* unix/tk.spec (1 LOC patch)
@@ -49,13 +48,13 @@ extern "C" {
*/
#define TK_MAJOR_VERSION 8
-#define TK_MINOR_VERSION 5
-#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
-#define TK_RELEASE_SERIAL 10
-
-#define TK_VERSION "8.5"
-#define TK_PATCH_LEVEL "8.5.10"
+#define TK_MINOR_VERSION 6
+#define TK_RELEASE_LEVEL TCL_BETA_RELEASE
+#define TK_RELEASE_SERIAL 2
+#define TK_VERSION "8.6"
+#define TK_PATCH_LEVEL "8.6b2"
+
/*
* A special definition used to allow this header file to be included from
* windows or mac resource files so that they can obtain version information.
@@ -69,11 +68,9 @@ extern "C" {
#ifndef RC_INVOKED
#ifndef _XLIB_H
-# if defined(MAC_OSX_TK)
-# include <X11/Xlib.h>
+# include <X11/Xlib.h>
+# ifdef MAC_OSX_TK
# include <X11/X.h>
-# else
-# include <X11/Xlib.h>
# endif
#endif
#ifdef __STDC__
@@ -81,18 +78,20 @@ extern "C" {
#endif
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
#endif
-
+
/*
+ *----------------------------------------------------------------------
+ *
* Decide whether or not to use input methods.
*/
#ifdef XNQueryInputStyle
#define TK_USE_INPUT_METHODS
#endif
-
+
/*
* Dummy types that are used by clients:
*/
@@ -118,8 +117,10 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement;
*/
typedef const char *Tk_Uid;
-
+
/*
+ *----------------------------------------------------------------------
+ *
* The enum below defines the valid types for Tk configuration options as
* implemented by Tk_InitOptions, Tk_SetOptions, etc.
*/
@@ -206,18 +207,18 @@ typedef struct Tk_OptionSpec {
* option config code to handle a custom option.
*/
-typedef int (Tk_CustomOptionSetProc) _ANSI_ARGS_((ClientData clientData,
+typedef int (Tk_CustomOptionSetProc) (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));
+ int offset, char *saveInternalPtr, int flags);
+typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData,
+ Tk_Window tkwin, char *widgRec, int offset);
+typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData,
+ Tk_Window tkwin, char *internalPtr, char *saveInternalPtr);
+typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin,
+ char *internalPtr);
typedef struct Tk_ObjCustomOption {
- const char *name; /* Name of the custom option. */
+ const char *name; /* Name of the custom option. */
Tk_CustomOptionSetProc *setProc;
/* Function to use to set a record's option
* value from a Tcl_Obj */
@@ -293,7 +294,7 @@ typedef struct Tk_SavedOptions {
* old values in a single structure. NULL
* means no more structures. */
} Tk_SavedOptions;
-
+
/*
* Structure used to describe application-specific configuration options:
* indicates procedures to call to parse an option and to return a text string
@@ -308,12 +309,10 @@ typedef struct Tk_SavedOptions {
#ifndef __NO_OLD_CONFIG
-typedef int (Tk_OptionParseProc) _ANSI_ARGS_((ClientData clientData,
- 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,
- Tcl_FreeProc **freeProcPtr));
+typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST84 char *value, char *widgRec, int offset);
+typedef CONST86 char *(Tk_OptionPrintProc) (ClientData clientData,
+ Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr);
typedef struct Tk_CustomOption {
Tk_OptionParseProc *parseProc;
@@ -338,7 +337,7 @@ typedef struct Tk_ConfigSpec {
int type; /* Type of option, such as TK_CONFIG_COLOR;
* see definitions below. Last option in table
* must have type TK_CONFIG_END. */
- char *argvName; /* Switch used to specify option in argv. NULL
+ CONST86 char *argvName; /* Switch used to specify option in argv. NULL
* means this spec is part of a group. */
Tk_Uid dbName; /* Name for option in option database. */
Tk_Uid dbClass; /* Class for option in database. */
@@ -350,7 +349,8 @@ typedef struct Tk_ConfigSpec {
int specFlags; /* Any combination of the values defined
* below; other bits are used internally by
* tkConfig.c. */
- Tk_CustomOption *customPtr; /* If type is TK_CONFIG_CUSTOM then this is a
+ CONST86 Tk_CustomOption *customPtr;
+ /* If type is TK_CONFIG_CUSTOM then this is a
* pointer to info about how to parse and
* print the option. Otherwise it is
* irrelevant. */
@@ -392,20 +392,20 @@ typedef enum {
#define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
#define TK_CONFIG_USER_BIT 0x100
#endif /* __NO_OLD_CONFIG */
-
+
/*
* Structure used to specify how to handle argv options.
*/
typedef struct {
- char *key; /* The key string that flags the option in the
+ CONST86 char *key; /* The key string that flags the option in the
* argv array. */
int type; /* Indicates option type; see below. */
char *src; /* Value to be used in setting dst; usage
* depends on type. */
char *dst; /* Address of value to be modified; usage
* depends on type. */
- char *help; /* Documentation message describing this
+ CONST86 char *help; /* Documentation message describing this
* option. */
} Tk_ArgvInfo;
@@ -436,7 +436,7 @@ typedef struct {
#define TK_ARGV_NO_LEFTOVERS 0x2
#define TK_ARGV_NO_ABBREV 0x4
#define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8
-
+
/*
* Enumerated type for describing actions to be taken in response to a
* restrictProc established by Tk_RestrictEvents.
@@ -494,7 +494,7 @@ typedef enum {
TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW,
TK_ANCHOR_CENTER
} Tk_Anchor;
-
+
/*
* Enumerated type for describing a style of justification:
*/
@@ -538,17 +538,16 @@ typedef struct Tk_FontMetrics {
#define TK_IGNORE_TABS 8
#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 Window (Tk_ClassCreateProc) (Tk_Window tkwin, Window parent,
+ ClientData instanceData);
+typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData);
+typedef void (Tk_ClassModalProc) (Tk_Window tkwin, XEvent *eventPtr);
typedef struct Tk_ClassProcs {
unsigned int size;
@@ -582,17 +581,15 @@ typedef struct Tk_ClassProcs {
#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.
*/
-typedef void (Tk_GeomRequestProc) _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
-typedef void (Tk_GeomLostSlaveProc) _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
+typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin);
+typedef void (Tk_GeomLostSlaveProc) (ClientData clientData, Tk_Window tkwin);
typedef struct Tk_GeomMgr {
const char *name; /* Name of the geometry manager (command used
@@ -616,13 +613,13 @@ typedef struct Tk_GeomMgr {
#define TK_SCROLL_PAGES 2
#define TK_SCROLL_UNITS 3
#define TK_SCROLL_ERROR 4
-
+
/*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Extensions to the X event set
*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define VirtualEvent (MappingNotify + 1)
@@ -681,12 +678,12 @@ typedef XActivateDeactivateEvent XActivateEvent;
typedef XActivateDeactivateEvent XDeactivateEvent;
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Macros for querying Tk_Window structures. See the manual entries for
* documentation.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
@@ -791,6 +788,7 @@ typedef struct Tk_FakeWin {
int internalBorderBottom;
int minReqWidth;
int minReqHeight;
+ char *dummy20; /* geometryMaster */
} Tk_FakeWin;
/*
@@ -833,9 +831,6 @@ typedef struct Tk_FakeWin {
* embedded application), and both the containing
* and embedded halves are associated with
* windows in this particular process.
- * TK_DEFER_MODAL: 1 means that this window has deferred a modal
- * loop until all of the bindings for the current
- * event have been invoked.
* TK_WRAPPER: 1 means that this window is the extra wrapper
* window created around a toplevel to hold the
* menubar under Unix. See tkUnixWm.c for more
@@ -872,7 +867,6 @@ typedef struct Tk_FakeWin {
#define TK_EMBEDDED 0x100
#define TK_CONTAINER 0x200
#define TK_BOTH_HALVES 0x400
-#define TK_DEFER_MODAL 0x800
#define TK_WRAPPER 0x1000
#define TK_REPARENTED 0x2000
#define TK_ANONYMOUS_WINDOW 0x4000
@@ -883,11 +877,11 @@ typedef struct Tk_FakeWin {
#define TK_WM_MANAGEABLE 0x80000
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for defining new canvas items:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
typedef enum {
@@ -896,13 +890,11 @@ typedef enum {
} Tk_State;
typedef struct Tk_SmoothMethod {
- char *name;
- int (*coordProc) _ANSI_ARGS_((Tk_Canvas canvas,
- double *pointPtr, int numPoints, int numSteps,
- XPoint xPoints[], double dblPoints[]));
- void (*postscriptProc) _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, double *coordPtr,
- int numPoints, int numSteps));
+ CONST86 char *name;
+ int (*coordProc) (Tk_Canvas canvas, double *pointPtr, int numPoints,
+ int numSteps, XPoint xPoints[], double dblPoints[]);
+ void (*postscriptProc) (Tcl_Interp *interp, Tk_Canvas canvas,
+ double *coordPtr, int numPoints, int numSteps);
} Tk_SmoothMethod;
/*
@@ -971,66 +963,69 @@ typedef struct Tk_Item {
*/
#ifdef USE_OLD_CANVAS
-typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- char **argv));
-typedef int Tk_ItemConfigureProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- char **argv, int flags));
-typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- char **argv));
+typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, char **argv);
+typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, char **argv, int flags);
+typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, char **argv);
#else
-typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *const objv[]));
-typedef int Tk_ItemConfigureProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *const objv[], int flags));
-typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *const argv[]));
-#endif
-typedef void Tk_ItemDeleteProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-typedef void Tk_ItemDisplayProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-typedef double Tk_ItemPointProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *pointPtr));
-typedef int Tk_ItemAreaProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-typedef int Tk_ItemPostscriptProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-typedef void Tk_ItemScaleProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-typedef void Tk_ItemTranslateProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
-typedef int Tk_ItemIndexProc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, char *indexString,
- int *indexPtr));
-typedef void Tk_ItemCursorProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int index));
-typedef int Tk_ItemSelectionProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int offset, char *buffer,
- int maxBytes));
-typedef void Tk_ItemInsertProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int beforeThis, char *string));
-typedef void Tk_ItemDCharsProc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int first, int last));
+typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[]);
+typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[],
+ int flags);
+typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int argc, Tcl_Obj *const argv[]);
+#endif /* USE_OLD_CANVAS */
+typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ Display *display);
+typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ Display *display, Drawable dst, int x, int y, int width,
+ int height);
+typedef double (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ double *pointPtr);
+typedef int (Tk_ItemAreaProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ double *rectPtr);
+typedef int (Tk_ItemPostscriptProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, int prepass);
+typedef void (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ double originX, double originY, double scaleX,
+ double scaleY);
+typedef void (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ double deltaX, double deltaY);
+#ifdef USE_OLD_CANVAS
+typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, char *indexString, int *indexPtr);
+#else
+typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
+ Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr);
+#endif /* USE_OLD_CANVAS */
+typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ int index);
+typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ int offset, char *buffer, int maxBytes);
+#ifdef USE_OLD_CANVAS
+typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ int beforeThis, char *string);
+#else
+typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ int beforeThis, Tcl_Obj *string);
+#endif /* USE_OLD_CANVAS */
+typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
+ int first, int last);
#ifndef __NO_OLD_CONFIG
typedef struct Tk_ItemType {
- char *name; /* The name of this type of item, such as
+ CONST86 char *name; /* The name of this type of item, such as
* "line". */
int itemSize; /* Total amount of space needed for item's
* record. */
Tk_ItemCreateProc *createProc;
/* Procedure to create a new item of this
* type. */
- Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for
+ CONST86 Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for
* this type. Used for returning configuration
* info. */
Tk_ItemConfigureProc *configProc;
@@ -1079,7 +1074,14 @@ typedef struct Tk_ItemType {
char *reserved4;
} Tk_ItemType;
-#endif
+/*
+ * Flag (used in the alwaysRedraw field) to say whether an item supports
+ * point-level manipulation like the line and polygon items.
+ */
+
+#define TK_MOVABLE_POINTS 2
+
+#endif /* __NO_OLD_CONFIG */
/*
* The following structure provides information about the selection and the
@@ -1124,7 +1126,7 @@ typedef struct Tk_CanvasTextInfo {
* should be displayed in focusItemPtr.
* Read-only to items.*/
} Tk_CanvasTextInfo;
-
+
/*
* Structures used for Dashing and Outline.
*/
@@ -1165,9 +1167,9 @@ typedef struct Tk_Outline {
Tk_Dash dash; /* Dash pattern. */
Tk_Dash activeDash; /* Dash pattern if state is active. */
Tk_Dash disabledDash; /* Dash pattern if state is disabled. */
- VOID *reserved1; /* Reserved for future expansion. */
- VOID *reserved2;
- VOID *reserved3;
+ void *reserved1; /* Reserved for future expansion. */
+ void *reserved2;
+ void *reserved3;
Tk_TSOffset tsoffset; /* Stipple offset for outline. */
XColor *color; /* Outline color. */
XColor *activeColor; /* Outline color if state is active. */
@@ -1180,37 +1182,34 @@ typedef struct Tk_Outline {
} Tk_Outline;
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for managing images:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
typedef struct Tk_ImageType Tk_ImageType;
#ifdef USE_OLD_IMAGE
-typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, int argc, char **argv, Tk_ImageType *typePtr,
- Tk_ImageMaster master, ClientData *masterDataPtr));
+typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
+ char **argv, Tk_ImageType *typePtr, Tk_ImageMaster master,
+ ClientData *masterDataPtr);
#else
-typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, int objc, Tcl_Obj *const objv[], Tk_ImageType *typePtr,
- Tk_ImageMaster master, ClientData *masterDataPtr));
-#endif
-typedef ClientData (Tk_ImageGetProc) _ANSI_ARGS_((Tk_Window tkwin,
- ClientData masterData));
-typedef void (Tk_ImageDisplayProc) _ANSI_ARGS_((ClientData instanceData,
- Display *display, Drawable drawable, int imageX, int imageY,
- int width, int height, int drawableX, int drawableY));
-typedef void (Tk_ImageFreeProc) _ANSI_ARGS_((ClientData instanceData,
- Display *display));
-typedef void (Tk_ImageDeleteProc) _ANSI_ARGS_((ClientData masterData));
-typedef void (Tk_ImageChangedProc) _ANSI_ARGS_((ClientData clientData,
- int x, int y, int width, int height, int imageWidth,
- int imageHeight));
-typedef int (Tk_ImagePostscriptProc) _ANSI_ARGS_((ClientData clientData,
+typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc,
+ Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster master,
+ ClientData *masterDataPtr);
+#endif /* USE_OLD_IMAGE */
+typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData masterData);
+typedef void (Tk_ImageDisplayProc) (ClientData instanceData, Display *display,
+ Drawable drawable, int imageX, int imageY, int width, int height,
+ int drawableX, int drawableY);
+typedef void (Tk_ImageFreeProc) (ClientData instanceData, Display *display);
+typedef void (Tk_ImageDeleteProc) (ClientData masterData);
+typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y,
+ int width, int height, int imageWidth, int imageHeight);
+typedef int (Tk_ImagePostscriptProc) (ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo,
- int x, int y, int width, int height, int prepass));
+ int x, int y, int width, int height, int prepass);
/*
* The following structure represents a particular type of image (bitmap, xpm
@@ -1221,7 +1220,7 @@ typedef int (Tk_ImagePostscriptProc) _ANSI_ARGS_((ClientData clientData,
*/
struct Tk_ImageType {
- char *name; /* Name of image type. */
+ CONST86 char *name; /* Name of image type. */
Tk_ImageCreateProc *createProc;
/* Procedure to call to create a new image of
* this type. */
@@ -1247,13 +1246,13 @@ struct Tk_ImageType {
* manager. */
char *reserved; /* reserved for future expansion */
};
-
+
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Additional definitions used to manage images of type "photo".
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
/*
@@ -1295,41 +1294,36 @@ typedef struct Tk_PhotoImageBlock {
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_((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,
- 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));
-typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_DString *dataPtr, char *formatString,
- Tk_PhotoImageBlock *blockPtr));
+typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName,
+ char *formatString, int *widthPtr, int *heightPtr);
+typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString,
+ int *widthPtr, int *heightPtr);
+typedef int (Tk_ImageFileReadProc) (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) (Tcl_Interp *interp, char *string,
+ char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY,
+ int width, int height, int srcX, int srcY);
+typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName,
+ char *formatString, Tk_PhotoImageBlock *blockPtr);
+typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp,
+ Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr);
#else
-typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan,
- const char *fileName, Tcl_Obj *format, int *widthPtr,
- int *heightPtr, Tcl_Interp *interp));
-typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((Tcl_Obj *dataObj,
- Tcl_Obj *format, int *widthPtr, int *heightPtr,
- Tcl_Interp *interp));
-typedef int (Tk_ImageFileReadProc) _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));
-typedef int (Tk_ImageStringReadProc) _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *dataObj, Tcl_Obj *format, Tk_PhotoHandle imageHandle,
- int destX, int destY, int width, int height, int srcX, int srcY));
-typedef int (Tk_ImageFileWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
- const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr));
-typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr));
-#endif
+typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName,
+ Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp);
+typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format,
+ int *widthPtr, int *heightPtr, Tcl_Interp *interp);
+typedef int (Tk_ImageFileReadProc) (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);
+typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj,
+ Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY,
+ int width, int height, int srcX, int srcY);
+typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName,
+ Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
+typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr);
+#endif /* USE_OLD_IMAGE */
/*
* The following structure represents a particular file format for storing
@@ -1338,7 +1332,7 @@ typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
*/
struct Tk_PhotoImageFormat {
- char *name; /* Name of image file format */
+ CONST86 char *name; /* Name of image file format */
Tk_ImageFileMatchProc *fileMatchProc;
/* Procedure to call to determine whether an
* image file matches this format. */
@@ -1363,18 +1357,13 @@ struct Tk_PhotoImageFormat {
* currently known. Filled in by Tk, not by
* image format handler. */
};
-
-#ifdef USE_OLD_IMAGE
-#define Tk_CreateImageType Tk_CreateOldImageType
-#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
-#endif
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Procedure prototypes and structures used for managing styles:
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
/*
@@ -1389,41 +1378,41 @@ struct Tk_PhotoImageFormat {
* 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 void (Tk_GetElementSizeProc) (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) (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) (ClientData clientData,
+ char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin);
+typedef void (Tk_DrawElementProc) (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. */
+ 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. */
+ 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. */
+ /* List of required options. Last one's name
+ * must be NULL. */
Tk_GetElementSizeProc *getSize;
- /* Compute the external (resp. internal) size
- * of the element from its desired internal
- * (resp. external) size. */
+ /* 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. */
+ /* Compute the inscribed or bounding boxes
+ * within a given area. */
Tk_GetElementBorderWidthProc *getBorderWidth;
- /* Return the element's internal border width.
- * Mostly useful for widgets. */
+ /* Return the element's internal border width.
+ * Mostly useful for widgets. */
Tk_DrawElementProc *draw; /* Draw the element in the given bounding
* box. */
} Tk_ElementSpec;
@@ -1438,13 +1427,13 @@ typedef struct Tk_ElementSpec {
#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.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#define TK_READABLE TCL_READABLE
@@ -1482,59 +1471,65 @@ typedef struct Tk_ElementSpec {
#define Tk_Release Tcl_Release
/* Removed Tk_Main, use macro instead */
-#define Tk_Main(argc, argv, proc) \
- Tk_MainEx(argc, argv, proc, Tcl_CreateInterp())
-
-const char * Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
- const char *version, int exact));
-EXTERN const char * Tk_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp,
- const char *version, int exact));
+#ifdef _WIN32
+#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
+ (Tcl_FindExecutable(0), (Tcl_CreateInterp)()))
+#else
+#define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
+ (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
+#endif
+const char * Tk_InitStubs(Tcl_Interp *interp, const char *version,
+ int exact);
+EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp,
+ const char *version, int exact);
#ifndef USE_TK_STUBS
-
#define Tk_InitStubs(interp, version, exact) \
Tk_PkgInitStubsCheck(interp, version, exact)
-
-#endif
+#endif /* USE_TK_STUBS */
#define Tk_InitImageArgs(interp, argc, argv) /**/
-
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Additional procedure types defined by Tk.
*
- *--------------------------------------------------------------
- */
-
-typedef int (Tk_ErrorProc) _ANSI_ARGS_((ClientData clientData,
- XErrorEvent *errEventPtr));
-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));
-typedef Tk_RestrictAction (Tk_RestrictProc) _ANSI_ARGS_((
- ClientData clientData, XEvent *eventPtr));
-typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
- int offset, char *buffer, int maxBytes));
-
+ *----------------------------------------------------------------------
+ */
+
+typedef int (Tk_ErrorProc) (ClientData clientData, XErrorEvent *errEventPtr);
+typedef void (Tk_EventProc) (ClientData clientData, XEvent *eventPtr);
+typedef int (Tk_GenericProc) (ClientData clientData, XEvent *eventPtr);
+typedef int (Tk_ClientMessageProc) (Tk_Window tkwin, XEvent *eventPtr);
+typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp,
+ CONST86 char *portion);
+typedef void (Tk_LostSelProc) (ClientData clientData);
+typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData,
+ XEvent *eventPtr);
+typedef int (Tk_SelectionProc) (ClientData clientData, int offset,
+ char *buffer, int maxBytes);
+
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
- * Platform independant exported procedures and variables.
+ * Platform independent exported procedures and variables.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
#include "tkDecls.h"
+
+#ifdef USE_OLD_IMAGE
+#undef Tk_CreateImageType
+#define Tk_CreateImageType Tk_CreateOldImageType
+#undef Tk_CreatePhotoImageFormat
+#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
+#endif /* USE_OLD_IMAGE */
/*
+ *----------------------------------------------------------------------
+ *
* Allow users to say that they don't want to alter their source to add extra
* arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK.
*
@@ -1574,11 +1569,7 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
# endif
# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic
#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
-
-/*
- * Tcl commands exported by Tk:
- */
-
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tk3d.c b/generic/tk3d.c
index caa40dd..2920c76 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -19,7 +19,7 @@
* by Tk_GetReliefFromObj.
*/
-static CONST char *reliefStrings[] = {
+static const char *const reliefStrings[] = {
"flat", "groove", "raised", "ridge", "solid", "sunken", NULL
};
@@ -30,6 +30,7 @@ static CONST char *reliefStrings[] = {
static void BorderInit(TkDisplay *dispPtr);
static void DupBorderObjProc(Tcl_Obj *srcObjPtr,
Tcl_Obj *dupObjPtr);
+static void FreeBorderObj(Tcl_Obj *objPtr);
static void FreeBorderObjProc(Tcl_Obj *objPtr);
static int Intersect(XPoint *a1Ptr, XPoint *a2Ptr,
XPoint *b1Ptr, XPoint *b2Ptr, XPoint *iPtr);
@@ -45,7 +46,7 @@ static void ShiftLine(XPoint *p1Ptr, XPoint *p2Ptr,
* is set.
*/
-Tcl_ObjType tkBorderObjType = {
+const Tcl_ObjType tkBorderObjType = {
"border", /* name */
FreeBorderObjProc, /* freeIntRepProc */
DupBorderObjProc, /* dupIntRepProc */
@@ -71,8 +72,8 @@ Tcl_ObjType tkBorderObjType = {
* Side effects:
* The border is added to an internal database with a reference count.
* For each call to this function, there should eventually be a call to
- * FreeBorderObjProc so that the database is cleaned up when borders
- * aren't in use anymore.
+ * FreeBorderObj so that the database is cleaned up when borders aren't
+ * in use anymore.
*
*----------------------------------------------------------------------
*/
@@ -89,7 +90,7 @@ Tk_Alloc3DBorderFromObj(
if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr);
}
- borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
+ borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
/*
* If the object currently points to a TkBorder, see if it's the one we
@@ -103,7 +104,7 @@ Tk_Alloc3DBorderFromObj(
* longer in use. Clear the reference.
*/
- FreeBorderObjProc(objPtr);
+ FreeBorderObj(objPtr);
borderPtr = NULL;
} else if ((Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
@@ -116,9 +117,7 @@ Tk_Alloc3DBorderFromObj(
* The object didn't point to the border that we wanted. Search the list
* of borders with the same name to see if one of the others is the right
* one.
- */
-
- /*
+ *
* If the cached value is NULL, either the object type was not a color
* going in, or the object is a color type but had previously been freed.
*
@@ -128,16 +127,16 @@ Tk_Alloc3DBorderFromObj(
*/
if (borderPtr != NULL) {
- TkBorder *firstBorderPtr =
- (TkBorder *) Tcl_GetHashValue(borderPtr->hashPtr);
- FreeBorderObjProc(objPtr);
+ TkBorder *firstBorderPtr = Tcl_GetHashValue(borderPtr->hashPtr);
+
+ FreeBorderObj(objPtr);
for (borderPtr = firstBorderPtr ; borderPtr != NULL;
borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen)
- && (Tk_Colormap(tkwin) == borderPtr->colormap)) {
+ && (Tk_Colormap(tkwin) == borderPtr->colormap)) {
borderPtr->resourceRefCount++;
borderPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
return (Tk_3DBorder) borderPtr;
}
}
@@ -149,7 +148,7 @@ Tk_Alloc3DBorderFromObj(
borderPtr = (TkBorder *) Tk_Get3DBorder(interp, tkwin,
Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
if (borderPtr != NULL) {
borderPtr->objRefCount++;
}
@@ -201,7 +200,7 @@ Tk_Get3DBorder(
hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew);
if (!isNew) {
- existingBorderPtr = (TkBorder *) Tcl_GetHashValue(hashPtr);
+ existingBorderPtr = Tcl_GetHashValue(hashPtr);
for (borderPtr = existingBorderPtr; borderPtr != NULL;
borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen)
@@ -318,7 +317,7 @@ Tk_Draw3DRectangle(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOf3DBorder(
Tk_3DBorder border) /* Token for border. */
{
@@ -426,7 +425,7 @@ Tk_Free3DBorder(
return;
}
- prevPtr = (TkBorder *) Tcl_GetHashValue(borderPtr->hashPtr);
+ prevPtr = Tcl_GetHashValue(borderPtr->hashPtr);
TkpFreeBorder(borderPtr);
if (borderPtr->bgColorPtr != NULL) {
Tk_FreeColor(borderPtr->bgColorPtr);
@@ -462,7 +461,7 @@ Tk_Free3DBorder(
prevPtr->nextPtr = borderPtr->nextPtr;
}
if (borderPtr->objRefCount == 0) {
- ckfree((char *) borderPtr);
+ ckfree(borderPtr);
}
}
@@ -494,13 +493,13 @@ Tk_Free3DBorderFromObj(
Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
Tk_Free3DBorder(Tk_Get3DBorderFromObj(tkwin, objPtr));
- FreeBorderObjProc(objPtr);
+ FreeBorderObj(objPtr);
}
/*
*---------------------------------------------------------------------------
*
- * FreeBorderObjProc --
+ * FreeBorderObjProc, FreeBorderObj --
*
* This proc is called to release an object reference to a border. Called
* when the object's internal rep is released or when the cached
@@ -520,13 +519,21 @@ static void
FreeBorderObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkBorder *borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
+ FreeBorderObj(objPtr);
+ objPtr->typePtr = NULL;
+}
+
+static void
+FreeBorderObj(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
+{
+ TkBorder *borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (borderPtr != NULL) {
borderPtr->objRefCount--;
if ((borderPtr->objRefCount == 0)
&& (borderPtr->resourceRefCount == 0)) {
- ckfree((char *) borderPtr);
+ ckfree(borderPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -555,10 +562,10 @@ DupBorderObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkBorder *borderPtr = (TkBorder *) srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkBorder *borderPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
if (borderPtr != NULL) {
borderPtr->objRefCount++;
@@ -643,7 +650,7 @@ Tk_GetReliefFromObj(
int
Tk_GetRelief(
Tcl_Interp *interp, /* For error messages. */
- CONST char *name, /* Name of a relief type. */
+ const char *name, /* Name of a relief type. */
int *reliefPtr) /* Where to store converted relief. */
{
char c;
@@ -655,12 +662,12 @@ Tk_GetRelief(
*reliefPtr = TK_RELIEF_FLAT;
} else if ((c == 'g') && (strncmp(name, "groove", length) == 0)
&& (length >= 2)) {
- *reliefPtr = TK_RELIEF_GROOVE;
+ *reliefPtr = TK_RELIEF_GROOVE;
} else if ((c == 'r') && (strncmp(name, "raised", length) == 0)
&& (length >= 2)) {
*reliefPtr = TK_RELIEF_RAISED;
} else if ((c == 'r') && (strncmp(name, "ridge", length) == 0)) {
- *reliefPtr = TK_RELIEF_RIDGE;
+ *reliefPtr = TK_RELIEF_RIDGE;
} else if ((c == 's') && (strncmp(name, "solid", length) == 0)) {
*reliefPtr = TK_RELIEF_SOLID;
} else if ((c == 's') && (strncmp(name, "sunken", length) == 0)) {
@@ -668,7 +675,7 @@ Tk_GetRelief(
} else {
char buf[200];
- sprintf(buf, "bad relief type \"%.50s\": must be %s",
+ sprintf(buf, "bad relief \"%.50s\": must be %s",
name, "flat, groove, raised, ridge, solid, or sunken");
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
@@ -692,7 +699,7 @@ Tk_GetRelief(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfRelief(
int relief) /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED, or
* TK_RELIEF_SUNKEN. */
@@ -768,9 +775,8 @@ Tk_Draw3DPolygon(
*/
if ((leftRelief == TK_RELIEF_GROOVE) || (leftRelief == TK_RELIEF_RIDGE)) {
- int halfWidth;
+ int halfWidth = borderWidth/2;
- halfWidth = borderWidth/2;
Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
halfWidth, (leftRelief == TK_RELIEF_GROOVE) ? TK_RELIEF_RAISED
: TK_RELIEF_SUNKEN);
@@ -980,8 +986,8 @@ Tk_Fill3DRectangle(
if ((width > doubleBorder) && (height > doubleBorder)) {
XFillRectangle(Tk_Display(tkwin), drawable, borderPtr->bgGC,
x + borderWidth, y + borderWidth,
- (unsigned int) (width - doubleBorder),
- (unsigned int) (height - doubleBorder));
+ (unsigned) (width - doubleBorder),
+ (unsigned) (height - doubleBorder));
}
if (borderWidth) {
Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width,
@@ -1083,19 +1089,18 @@ ShiftLine(
XPoint *p3Ptr) /* Store coords of point on new line here. */
{
int dx, dy, dxNeg, dyNeg;
-
- /*
- * The table below is used for a quick approximation in computing the new
- * point. An index into the table is 128 times the slope of the original
- * line (the slope must always be between 0 and 1). The value of the table
- * entry is 128 times the amount to displace the new line in y for each
- * unit of perpendicular distance. In other words, the table maps from the
- * tangent of an angle to the inverse of its cosine. If the slope of the
- * original line is greater than 1, then the displacement is done in x
- * rather than in y.
- */
-
- static int shiftTable[129];
+ static int shiftTable[129]; /* Used for a quick approximation in computing
+ * the new point. An index into the table is
+ * 128 times the slope of the original line
+ * (the slope must always be between 0 and 1).
+ * The value of the table entry is 128 times
+ * the amount to displace the new line in y
+ * for each unit of perpendicular distance. In
+ * other words, the table maps from the
+ * tangent of an angle to the inverse of its
+ * cosine. If the slope of the original line
+ * is greater than 1, then the displacement is
+ * done in x rather than in y. */
/*
* Initialize the table if this is the first time it is used.
@@ -1249,7 +1254,7 @@ Tk_Get3DBorderFromObj(
* cached in the internal representation of the Tcl_Obj. Check it out...
*/
- borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
+ borderPtr = objPtr->internalRep.twoPtrValue.ptr1;
if ((borderPtr != NULL)
&& (borderPtr->resourceRefCount > 0)
&& (Tk_Screen(tkwin) == borderPtr->screen)
@@ -1277,12 +1282,12 @@ Tk_Get3DBorderFromObj(
if (hashPtr == NULL) {
goto error;
}
- for (borderPtr = (TkBorder *) Tcl_GetHashValue(hashPtr);
- (borderPtr != NULL); borderPtr = borderPtr->nextPtr) {
+ for (borderPtr = Tcl_GetHashValue(hashPtr); borderPtr != NULL;
+ borderPtr = borderPtr->nextPtr) {
if ((Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
- FreeBorderObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
+ FreeBorderObj(objPtr);
+ objPtr->internalRep.twoPtrValue.ptr1 = borderPtr;
borderPtr->objRefCount++;
return (Tk_3DBorder) borderPtr;
}
@@ -1329,7 +1334,7 @@ InitBorderObj(
Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &tkBorderObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
@@ -1358,22 +1363,23 @@ Tcl_Obj *
TkDebugBorder(
Tk_Window tkwin, /* The window in which the border will be used
* (not currently used). */
- char *name) /* Name of the desired color. */
+ const char *name) /* Name of the desired color. */
{
- TkBorder *borderPtr;
Tcl_HashEntry *hashPtr;
- Tcl_Obj *resultPtr, *objPtr;
+ Tcl_Obj *resultPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, name);
if (hashPtr != NULL) {
- borderPtr = (TkBorder *) Tcl_GetHashValue(hashPtr);
+ TkBorder *borderPtr = Tcl_GetHashValue(hashPtr);
+
if (borderPtr == NULL) {
Tcl_Panic("TkDebugBorder found empty hash table entry");
}
for ( ; (borderPtr != NULL); borderPtr = borderPtr->nextPtr) {
- objPtr = Tcl_NewObj();
+ Tcl_Obj *objPtr = Tcl_NewObj();
+
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(borderPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
diff --git a/generic/tk3d.h b/generic/tk3d.h
index 5e0a0cf..891e927 100644
--- a/generic/tk3d.h
+++ b/generic/tk3d.h
@@ -12,12 +12,7 @@
#ifndef _TK3D
#define _TK3D
-#include <tkInt.h>
-
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
+#include "tkInt.h"
/*
* One of the following data structures is allocated for each 3-D border
@@ -40,9 +35,8 @@ typedef struct TkBorder {
* no longer valid and it isn't present in
* borderTable: it is being kept around only
* because there are objects referring to it.
- * The structure is freed when
- * resourceRefCount and objRefCount are both
- * 0. */
+ * The structure is freed when objRefCount and
+ * resourceRefCount are both 0. */
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
XColor *bgColorPtr; /* Background color (intensity between
@@ -88,7 +82,4 @@ MODULE_SCOPE TkBorder *TkpGetBorder(void);
MODULE_SCOPE void TkpGetShadows(TkBorder *borderPtr, Tk_Window tkwin);
MODULE_SCOPE void TkpFreeBorder(TkBorder *borderPtr);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TK3D */
diff --git a/generic/tkArgv.c b/generic/tkArgv.c
index a338e45..3f235ad 100644
--- a/generic/tkArgv.c
+++ b/generic/tkArgv.c
@@ -18,7 +18,7 @@
* every application.
*/
-static Tk_ArgvInfo defaultTable[] = {
+static const Tk_ArgvInfo defaultTable[] = {
{"-help", TK_ARGV_HELP, NULL, NULL,
"Print summary of command-line options and abort"},
{NULL, TK_ARGV_END, NULL, NULL, NULL}
@@ -28,7 +28,7 @@ static Tk_ArgvInfo defaultTable[] = {
* Forward declarations for functions defined in this file:
*/
-static void PrintUsage(Tcl_Interp *interp, Tk_ArgvInfo *argTable,
+static void PrintUsage(Tcl_Interp *interp, const Tk_ArgvInfo *argTable,
int flags);
/*
@@ -61,17 +61,17 @@ Tk_ParseArgv(
* means ignore Tk option specs. */
int *argcPtr, /* Number of arguments in argv. Modified to
* hold # args left in argv at end. */
- CONST char **argv, /* Array of arguments. Modified to hold those
+ const char **argv, /* Array of arguments. Modified to hold those
* that couldn't be processed here. */
- Tk_ArgvInfo *argTable, /* Array of option descriptions */
+ const Tk_ArgvInfo *argTable, /* Array of option descriptions */
int flags) /* Or'ed combination of various flag bits,
* such as TK_ARGV_NO_DEFAULTS. */
{
- register Tk_ArgvInfo *infoPtr;
+ register const Tk_ArgvInfo *infoPtr;
/* Pointer to the current entry in the table
* of argument descriptions. */
- Tk_ArgvInfo *matchPtr; /* Descriptor that matches current argument. */
- CONST char *curArg; /* Current argument */
+ const Tk_ArgvInfo *matchPtr; /* Descriptor that matches 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 be
@@ -193,7 +193,7 @@ Tk_ParseArgv(
if (argc == 0) {
goto missingArg;
}
- *((CONST char **)infoPtr->dst) = argv[srcIndex];
+ *((const char **)infoPtr->dst) = argv[srcIndex];
srcIndex++;
argc--;
break;
@@ -226,22 +226,22 @@ Tk_ParseArgv(
}
break;
case TK_ARGV_FUNC: {
- typedef int (ArgvFunc)(char *, char *, CONST char *);
+ typedef int (ArgvFunc)(char *, const char *, const char *);
ArgvFunc *handlerProc = (ArgvFunc *) infoPtr->src;
- if ((*handlerProc)(infoPtr->dst, infoPtr->key, argv[srcIndex])) {
+ if (handlerProc(infoPtr->dst, infoPtr->key, argv[srcIndex])) {
srcIndex++;
argc--;
}
break;
}
case TK_ARGV_GENFUNC: {
- typedef int (ArgvGenFunc)(char *, Tcl_Interp *, char *, int,
- CONST char **);
+ typedef int (ArgvGenFunc)(char *, Tcl_Interp *, const char *, int,
+ const char **);
ArgvGenFunc *handlerProc = (ArgvGenFunc *) infoPtr->src;
- argc = (*handlerProc)(infoPtr->dst, interp, infoPtr->key,
- argc, argv+srcIndex);
+ argc = handlerProc(infoPtr->dst, interp, infoPtr->key, argc,
+ argv+srcIndex);
if (argc < 0) {
return TCL_ERROR;
}
@@ -328,13 +328,13 @@ static void
PrintUsage(
Tcl_Interp *interp, /* Place information in this interp's result
* area. */
- Tk_ArgvInfo *argTable, /* Array of command-specific argument
+ const Tk_ArgvInfo *argTable, /* Array of command-specific argument
* descriptions. */
int flags) /* If the TK_ARGV_NO_DEFAULTS bit is set in
* this word, then don't generate information
* for default options. */
{
- register Tk_ArgvInfo *infoPtr;
+ register const Tk_ArgvInfo *infoPtr;
size_t width, i, numSpaces;
char tmp[TCL_DOUBLE_SPACE];
diff --git a/generic/tkAtom.c b/generic/tkAtom.c
index 54d3598..2491fb2 100644
--- a/generic/tkAtom.c
+++ b/generic/tkAtom.c
@@ -20,7 +20,7 @@
* those found in xatom.h
*/
-static char * atomNameArray[] = {
+static const char *const atomNameArray[] = {
"PRIMARY", "SECONDARY", "ARC",
"ATOM", "BITMAP", "CARDINAL",
"COLORMAP", "CURSOR", "CUT_BUFFER0",
@@ -76,10 +76,10 @@ Atom
Tk_InternAtom(
Tk_Window tkwin, /* Window token; map name to atom for this
* window's display. */
- CONST char *name) /* Name to turn into atom. */
+ const char *name) /* Name to turn into atom. */
{
- register TkDisplay *dispPtr;
- register Tcl_HashEntry *hPtr;
+ TkDisplay *dispPtr;
+ Tcl_HashEntry *hPtr;
int isNew;
dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -97,7 +97,7 @@ Tk_InternAtom(
hPtr2 = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew);
Tcl_SetHashValue(hPtr2, Tcl_GetHashKey(&dispPtr->nameTable, hPtr));
}
- return (Atom) PTR2INT(Tcl_GetHashValue(hPtr));
+ return (Atom)PTR2INT(Tcl_GetHashValue(hPtr));
}
/*
@@ -121,14 +121,14 @@ Tk_InternAtom(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_GetAtomName(
Tk_Window tkwin, /* Window token; map atom to name relative to
* this window's display. */
Atom atom) /* Atom whose name is wanted. */
{
- register TkDisplay *dispPtr;
- register Tcl_HashEntry *hPtr;
+ TkDisplay *dispPtr;
+ Tcl_HashEntry *hPtr;
dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (!dispPtr->atomInit) {
@@ -137,23 +137,22 @@ Tk_GetAtomName(
hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, INT2PTR(atom));
if (hPtr == NULL) {
- char *name;
+ const char *name;
Tk_ErrorHandler handler;
- int isNew, mustFree;
+ int isNew;
+ char *mustFree = NULL;
handler = Tk_CreateErrorHandler(dispPtr->display, BadAtom, -1, -1,
- NULL, (ClientData) NULL);
- name = XGetAtomName(dispPtr->display, atom);
- mustFree = 1;
+ NULL, NULL);
+ name = mustFree = XGetAtomName(dispPtr->display, atom);
if (name == NULL) {
name = "?bad atom?";
- mustFree = 0;
}
Tk_DeleteErrorHandler(handler);
hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew);
Tcl_SetHashValue(hPtr, INT2PTR(atom));
if (mustFree) {
- XFree(name);
+ XFree(mustFree);
}
name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr);
hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew);
@@ -180,7 +179,7 @@ Tk_GetAtomName(
static void
AtomInit(
- register TkDisplay *dispPtr)/* Display to initialize. */
+ TkDisplay *dispPtr)/* Display to initialize. */
{
Tcl_HashEntry *hPtr;
Atom atom;
@@ -190,7 +189,7 @@ AtomInit(
Tcl_InitHashTable(&dispPtr->atomTable, TCL_ONE_WORD_KEYS);
for (atom = 1; atom <= XA_LAST_PREDEFINED; atom++) {
- char *name;
+ const char *name;
int isNew;
hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, INT2PTR(atom));
diff --git a/generic/tkBind.c b/generic/tkBind.c
index cf8ed1d..53a2046 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -29,13 +29,10 @@
*
* Init/Free this package.
*
- * Tcl "bind" command (actually located in tkCmds.c).
- * "bind" command implementation.
- * "bind" implementation helpers.
+ * Tcl "bind" command (actually located in tkCmds.c) core implementation, plus
+ * helpers.
*
- * Tcl "event" command.
- * "event" command implementation.
- * "event" implementation helpers.
+ * Tcl "event" command implementation, plus helpers.
*
* Package-specific common helpers.
*
@@ -79,7 +76,7 @@ typedef union {
*/
#define EVENT_BUFFER_SIZE 30
-typedef struct BindingTable {
+typedef struct Tk_BindingTable_ {
XEvent eventRing[EVENT_BUFFER_SIZE];
/* Circular queue of recent events (higher
* indices are for more recent events). */
@@ -108,12 +105,12 @@ typedef struct BindingTable {
*
* A virtual event is usually never part of the event stream, but instead is
* synthesized inline by matching low-level events. However, a virtual event
- * may be generated by platform-specific code or by Tcl scripts. In that case,
+ * may be generated by platform-specific code or by Tcl commands. In that case,
* no lookup of the virtual event will need to be done using this table,
* because the virtual event is actually in the event stream.
*/
-typedef struct VirtualEventTable {
+typedef struct {
Tcl_HashTable patternTable; /* Used to map from a physical event to a list
* of patterns that may match that event. Keys
* are PatternTableKey structs, values are
@@ -140,7 +137,7 @@ typedef struct VirtualEventTable {
* tables and virtual event tables.
*/
-typedef struct PatternTableKey {
+typedef struct {
ClientData object; /* For binding table, identifies the binding
* tag of the object (or class of objects)
* relative to which the event occurred. For
@@ -156,7 +153,7 @@ typedef struct PatternTableKey {
* events as part of the process of converting X events into Tcl commands.
*/
-typedef struct Pattern {
+typedef struct {
int eventType; /* Type of X event, e.g. ButtonPress. */
int needMods; /* Mask of modifiers that must be present (0
* means no modifiers are required). */
@@ -193,21 +190,10 @@ typedef struct Pattern {
typedef struct PatSeq {
int numPats; /* Number of patterns in sequence (usually
* 1). */
- TkBindEvalProc *eventProc; /* The function that will be invoked on the
- * clientData when this pattern sequence
- * matches. */
- TkBindFreeProc *freeProc; /* The function that will be invoked to
- * release the clientData when this pattern
- * sequence is freed. */
- ClientData clientData; /* Arbitray data passed to eventProc and
- * freeProc when sequence matches. */
+ char *script; /* Binding script to evaluate when sequence
+ * matches (ckalloc()ed) */
int flags; /* Miscellaneous flag values; see below for
* definitions. */
- int refCount; /* Number of times that this binding is in the
- * midst of executing. If greater than 1, then
- * a recursive invocation is happening. Only
- * when this is zero can the binding actually
- * be freed. */
struct PatSeq *nextSeqPtr; /* Next in list of all pattern sequences that
* have the same initial pattern. NULL means
* end of list. */
@@ -238,16 +224,9 @@ typedef struct PatSeq {
* must occur with nearby X and Y mouse coordinates and
* close in time. This is typically used to restrict
* multiple button presses.
- * MARKED_DELETED 1 means that this binding has been marked as deleted
- * and removed from the binding table, but its memory
- * could not be released because it was already queued
- * for execution. When the binding is actually about to
- * be executed, this flag will be checked and the binding
- * skipped if set.
*/
#define PAT_NEARBY 0x1
-#define MARKED_DELETED 0x2
/*
* Constants that define how close together two events must be in milliseconds
@@ -275,7 +254,7 @@ typedef struct VirtualOwners {
* to associate a virtual event with all the physical events that can trigger
* it.
*/
-typedef struct PhysicalsOwned {
+typedef struct {
int numOwned; /* Number of physical events owned. */
PatSeq *patSeqs[1]; /* Array of pointers to physical event
* patterns. Enough space will actually be
@@ -285,7 +264,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
+ * command can be invoked whenever the display/screen changes (the command does
* things like point tk::Priv at a display-specific structure).
*/
@@ -298,44 +277,17 @@ typedef struct {
} ScreenInfo;
/*
- * The following structure is used to keep track of all the C bindings that
- * are awaiting invocation and whether the window they refer to has been
- * destroyed. If the window is destroyed, then all pending callbacks for that
- * window will be cancelled. The Tcl bindings will still all be invoked,
- * however.
- */
-
-typedef struct PendingBinding {
- struct PendingBinding *nextPtr;
- /* Next in chain of pending bindings, in case
- * a recursive binding evaluation is in
- * progress. */
- Tk_Window tkwin; /* The window that the following bindings
- * depend upon. */
- int deleted; /* Set to non-zero by window cleanup code if
- * tkwin is deleted. */
- PatSeq *matchArray[5]; /* Array of pending C bindings. The actual
- * size of this depends on how many C bindings
- * matched the event passed to Tk_BindEvent.
- * THIS FIELD MUST BE THE LAST IN THE
- * STRUCTURE. */
-} PendingBinding;
-
-/*
* The following structure keeps track of all the information local to the
* binding package on a per interpreter basis.
*/
-typedef struct BindInfo {
+typedef struct TkBindInfo_ {
VirtualEventTable virtualEventTable;
/* The virtual events that exist in this
* interpreter. */
ScreenInfo screenInfo; /* Keeps track of the current display and
* screen, so it can be restored after a
* binding has executed. */
- PendingBinding *pendingList;/* The list of pending C bindings, kept in
- * case a C or Tcl binding causes the target
- * window to be deleted. */
int deleted; /* 1 the application has been deleted but the
* structure has been preserved. */
} BindInfo;
@@ -352,10 +304,10 @@ typedef struct BindInfo {
#ifdef REDO_KEYSYM_LOOKUP
typedef struct {
- char *name; /* Name of keysym. */
+ const char *name; /* Name of keysym. */
KeySym value; /* Numeric identifier for keysym. */
} KeySymInfo;
-static KeySymInfo keyArray[] = {
+static const KeySymInfo keyArray[] = {
#ifndef lint
#include "ks_names.h"
#endif
@@ -381,7 +333,7 @@ TCL_DECLARE_MUTEX(bindMutex)
*/
typedef struct {
- char *name; /* Name of modifier. */
+ const char *name; /* Name of modifier. */
int mask; /* Button/modifier mask value, such as
* Button1Mask. */
int flags; /* Various flags; see below for
@@ -405,7 +357,7 @@ typedef struct {
#define QUADRUPLE 4
#define MULT_CLICKS 7
-static ModInfo modArray[] = {
+static const ModInfo modArray[] = {
{"Control", ControlMask, 0},
{"Shift", ShiftMask, 0},
{"Lock", LockMask, 0},
@@ -450,7 +402,7 @@ static Tcl_HashTable modTable;
*/
typedef struct {
- char *name; /* Name of event. */
+ const char *name; /* Name of event. */
int type; /* Event type for X, such as ButtonPress. */
int eventMask; /* Mask bits (for XSelectInput) for this event
* type. */
@@ -463,7 +415,7 @@ typedef struct {
* unless you've asked about button events.
*/
-static EventInfo eventArray[] = {
+static const EventInfo eventArray[] = {
{"Key", KeyPress, KeyPressMask},
{"KeyPress", KeyPress, KeyPressMask},
{"KeyRelease", KeyRelease, KeyPressMask|KeyReleaseMask},
@@ -535,7 +487,7 @@ static Tcl_HashTable eventTable;
#define KEY_BUTTON_MOTION_VIRTUAL (KEY|BUTTON|MOTION|VIRTUAL)
#define KEY_BUTTON_MOTION_CROSSING (KEY|BUTTON|MOTION|VIRTUAL|CROSSING)
-static int flagArray[TK_LASTEVENT] = {
+static const int flagArray[TK_LASTEVENT] = {
/* Not used */ 0,
/* Not used */ 0,
/* KeyPress */ KEY,
@@ -654,14 +606,13 @@ static void ChangeScreen(Tcl_Interp *interp, char *dispName,
int screenIndex);
static int CreateVirtualEvent(Tcl_Interp *interp,
VirtualEventTable *vetPtr, char *virtString,
- char *eventString);
+ const char *eventString);
static int DeleteVirtualEvent(Tcl_Interp *interp,
VirtualEventTable *vetPtr, char *virtString,
- char *eventString);
+ const char *eventString);
static void DeleteVirtualEventTable(VirtualEventTable *vetPtr);
static void ExpandPercents(TkWindow *winPtr, const char *before,
XEvent *eventPtr,KeySym keySym,Tcl_DString *dsPtr);
-static void FreeTclBinding(ClientData clientData);
static PatSeq * FindSequence(Tcl_Interp *interp,
Tcl_HashTable *patternTablePtr, ClientData object,
const char *eventString, int create,
@@ -671,7 +622,7 @@ static void GetAllVirtualEvents(Tcl_Interp *interp,
static char * GetField(char *p, char *copy, int size);
static void GetPatternString(PatSeq *psPtr, Tcl_DString *dsPtr);
static int GetVirtualEvent(Tcl_Interp *interp,
- VirtualEventTable *vetPtr, char *virtString);
+ VirtualEventTable *vetPtr, Tcl_Obj *virtName);
static Tk_Uid GetVirtualEventUid(Tcl_Interp *interp,
char *virtString);
static int HandleEventGenerate(Tcl_Interp *interp, Tk_Window main,
@@ -687,15 +638,6 @@ static int ParseEventDescription(Tcl_Interp *interp,
const char **eventStringPtr, Pattern *patPtr,
unsigned long *eventMaskPtr);
static void DoWarp(ClientData clientData);
-
-/*
- * The following define is used as a short circuit for the callback function
- * to evaluate a TclBinding. The actual evaluation of the binding is handled
- * inline, because special things have to be done with a Tcl binding before
- * evaluation time.
- */
-
-#define EvalTclBinding ((TkBindEvalProc *) 1)
/*
*---------------------------------------------------------------------------
@@ -734,11 +676,11 @@ TkBindInit(
Tcl_MutexLock(&bindMutex);
if (!initialized) {
Tcl_HashEntry *hPtr;
- ModInfo *modPtr;
- EventInfo *eiPtr;
+ const ModInfo *modPtr;
+ const EventInfo *eiPtr;
int newEntry;
#ifdef REDO_KEYSYM_LOOKUP
- KeySymInfo *kPtr;
+ const KeySymInfo *kPtr;
Tcl_InitHashTable(&keySymTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&nameTable, TCL_ONE_WORD_KEYS);
@@ -771,14 +713,13 @@ TkBindInit(
mainPtr->bindingTable = Tk_CreateBindingTable(mainPtr->interp);
- bindInfoPtr = (BindInfo *) ckalloc(sizeof(BindInfo));
+ bindInfoPtr = ckalloc(sizeof(BindInfo));
InitVirtualEventTable(&bindInfoPtr->virtualEventTable);
bindInfoPtr->screenInfo.curDispPtr = NULL;
bindInfoPtr->screenInfo.curScreenIndex = -1;
bindInfoPtr->screenInfo.bindingDepth = 0;
- bindInfoPtr->pendingList = NULL;
bindInfoPtr->deleted = 0;
- mainPtr->bindInfo = (TkBindInfo) bindInfoPtr;
+ mainPtr->bindInfo = bindInfoPtr;
TkpInitializeMenuBindings(mainPtr->interp, mainPtr->bindingTable);
}
@@ -809,10 +750,10 @@ TkBindFree(
Tk_DeleteBindingTable(mainPtr->bindingTable);
mainPtr->bindingTable = NULL;
- bindInfoPtr = (BindInfo *) mainPtr->bindInfo;
+ bindInfoPtr = mainPtr->bindInfo;
DeleteVirtualEventTable(&bindInfoPtr->virtualEventTable);
bindInfoPtr->deleted = 1;
- Tcl_EventuallyFree((ClientData) bindInfoPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(bindInfoPtr, TCL_DYNAMIC);
mainPtr->bindInfo = NULL;
}
@@ -839,14 +780,13 @@ Tk_CreateBindingTable(
* table: commands are executed in this
* interpreter. */
{
- BindingTable *bindPtr;
+ BindingTable *bindPtr = ckalloc(sizeof(BindingTable));
int i;
/*
* Create and initialize a new binding table.
*/
- bindPtr = (BindingTable *) ckalloc(sizeof(BindingTable));
for (i = 0; i < EVENT_BUFFER_SIZE; i++) {
bindPtr->eventRing[i].type = -1;
}
@@ -855,7 +795,7 @@ Tk_CreateBindingTable(
sizeof(PatternTableKey)/sizeof(int));
Tcl_InitHashTable(&bindPtr->objectTable, TCL_ONE_WORD_KEYS);
bindPtr->interp = interp;
- return (Tk_BindingTable) bindPtr;
+ return bindPtr;
}
/*
@@ -877,10 +817,8 @@ Tk_CreateBindingTable(
void
Tk_DeleteBindingTable(
- Tk_BindingTable bindingTable)
- /* Token for the binding table to destroy. */
+ Tk_BindingTable bindPtr) /* Token for the binding table to destroy. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr, *nextPtr;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
@@ -891,16 +829,10 @@ Tk_DeleteBindingTable(
for (hPtr = Tcl_FirstHashEntry(&bindPtr->patternTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
- psPtr != NULL; psPtr = nextPtr) {
+ for (psPtr = Tcl_GetHashValue(hPtr); psPtr != NULL; psPtr = nextPtr) {
nextPtr = psPtr->nextSeqPtr;
- psPtr->flags |= MARKED_DELETED;
- if (psPtr->refCount == 0) {
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- ckfree((char *) psPtr);
- }
+ ckfree(psPtr->script);
+ ckfree(psPtr);
}
}
@@ -910,7 +842,7 @@ Tk_DeleteBindingTable(
Tcl_DeleteHashTable(&bindPtr->patternTable);
Tcl_DeleteHashTable(&bindPtr->objectTable);
- ckfree((char *) bindPtr);
+ ckfree(bindPtr);
}
/*
@@ -940,13 +872,12 @@ Tk_DeleteBindingTable(
unsigned long
Tk_CreateBinding(
Tcl_Interp *interp, /* Used for error reporting. */
- Tk_BindingTable bindingTable,
- /* Table in which to create binding. */
+ Tk_BindingTable bindPtr, /* Table in which to create binding. */
ClientData object, /* Token for object with which binding is
* associated. */
const char *eventString, /* String describing event sequence that
* triggers binding. */
- const char *command, /* Contains Tcl command to execute when
+ const char *script, /* Contains Tcl script to execute when
* binding triggers. */
int append) /* 0 means replace any existing binding for
* eventString; 1 means append to that
@@ -955,12 +886,11 @@ Tk_CreateBinding(
* string, the existing binding will always be
* replaced. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
unsigned long eventMask;
char *newStr, *oldStr;
- if (!*command) {
+ if (!*script) {
/* Silently ignore empty scripts -- see SF#3006842 */
return 1;
}
@@ -969,7 +899,7 @@ Tk_CreateBinding(
if (psPtr == NULL) {
return 0;
}
- if (psPtr->eventProc == NULL) {
+ if (psPtr->script == NULL) {
int isNew;
Tcl_HashEntry *hPtr;
@@ -984,120 +914,29 @@ Tk_CreateBinding(
if (isNew) {
psPtr->nextObjPtr = NULL;
} else {
- psPtr->nextObjPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
+ psPtr->nextObjPtr = Tcl_GetHashValue(hPtr);
}
Tcl_SetHashValue(hPtr, psPtr);
- } else if (psPtr->eventProc != EvalTclBinding) {
- /*
- * Free existing procedural binding.
- */
-
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- psPtr->clientData = NULL;
- append = 0;
}
- oldStr = (char *) psPtr->clientData;
+ oldStr = psPtr->script;
if ((append != 0) && (oldStr != NULL)) {
- size_t length;
+ size_t length1 = strlen(oldStr), length2 = strlen(script);
- length = strlen(oldStr) + strlen(command) + 2;
- newStr = (char *) ckalloc((unsigned) length);
- sprintf(newStr, "%s\n%s", oldStr, command);
+ newStr = ckalloc(length1 + length2 + 2);
+ memcpy(newStr, oldStr, length1);
+ newStr[length1] = '\n';
+ memcpy(newStr+length1+1, script, length2+1);
} else {
- newStr = (char *) ckalloc((unsigned) strlen(command) + 1);
- strcpy(newStr, command);
+ size_t length = strlen(script);
+
+ newStr = ckalloc(length + 1);
+ memcpy(newStr, script, length+1);
}
if (oldStr != NULL) {
ckfree(oldStr);
}
- psPtr->eventProc = EvalTclBinding;
- psPtr->freeProc = FreeTclBinding;
- psPtr->clientData = (ClientData) newStr;
- return eventMask;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkCreateBindingProcedure --
- *
- * Add a C binding to a binding table, so that future calls to
- * Tk_BindEvent may callback the function in the binding.
- *
- * Results:
-
- * The return value is 0 if an error occurred while setting up the
- * binding. In this case, an error message will be left in the interp's
- * result. If all went well then the return value is a mask of the event
- * types that must be made available to Tk_BindEvent in order to properly
- * detect when this binding triggers. This value can be used to determine
- * what events to select for in a window, for example.
- *
- * Side effects:
- * Any existing binding on the same event sequence will be replaced.
- *
- *---------------------------------------------------------------------------
- */
-
-unsigned long
-TkCreateBindingProcedure(
- Tcl_Interp *interp, /* Used for error reporting. */
- Tk_BindingTable bindingTable,
- /* Table in which to create binding. */
- ClientData object, /* Token for object with which binding is
- * associated. */
- const char *eventString, /* String describing event sequence that
- * triggers binding. */
- TkBindEvalProc *eventProc, /* Function to invoke when binding triggers.
- * Must not be NULL. */
- TkBindFreeProc *freeProc, /* Function to invoke when binding is freed.
- * May be NULL for no function. */
- ClientData clientData) /* Arbitrary ClientData to pass to eventProc
- * and freeProc. */
-{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
- PatSeq *psPtr;
- unsigned long eventMask;
-
- psPtr = FindSequence(interp, &bindPtr->patternTable, object, eventString,
- 1, 1, &eventMask);
- if (psPtr == NULL) {
- return 0;
- }
- if (psPtr->eventProc == NULL) {
- int isNew;
- Tcl_HashEntry *hPtr;
-
- /*
- * This pattern sequence was just created. Link the pattern into the
- * list associated with the object, so that if the object goes away,
- * these bindings will all automatically be deleted.
- */
-
- hPtr = Tcl_CreateHashEntry(&bindPtr->objectTable, (char *) object,
- &isNew);
- if (isNew) {
- psPtr->nextObjPtr = NULL;
- } else {
- psPtr->nextObjPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
- }
- Tcl_SetHashValue(hPtr, psPtr);
- } else {
- /*
- * Free existing callback.
- */
-
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- }
-
- psPtr->eventProc = eventProc;
- psPtr->freeProc = freeProc;
- psPtr->clientData = clientData;
+ psPtr->script = newStr;
return eventMask;
}
@@ -1122,14 +961,12 @@ TkCreateBindingProcedure(
int
Tk_DeleteBinding(
Tcl_Interp *interp, /* Used for error reporting. */
- Tk_BindingTable bindingTable,
- /* Table in which to delete binding. */
+ Tk_BindingTable bindPtr, /* Table in which to delete binding. */
ClientData object, /* Token for object with which binding is
* associated. */
const char *eventString) /* String describing event sequence that
* triggers binding. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr, *prevPtr;
unsigned long eventMask;
Tcl_HashEntry *hPtr;
@@ -1150,7 +987,7 @@ Tk_DeleteBinding(
if (hPtr == NULL) {
Tcl_Panic("Tk_DeleteBinding couldn't find object table entry");
}
- prevPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
+ prevPtr = Tcl_GetHashValue(hPtr);
if (prevPtr == psPtr) {
Tcl_SetHashValue(hPtr, psPtr->nextObjPtr);
} else {
@@ -1164,7 +1001,7 @@ Tk_DeleteBinding(
}
}
}
- prevPtr = (PatSeq *) Tcl_GetHashValue(psPtr->hPtr);
+ prevPtr = Tcl_GetHashValue(psPtr->hPtr);
if (prevPtr == psPtr) {
if (psPtr->nextSeqPtr == NULL) {
Tcl_DeleteHashEntry(psPtr->hPtr);
@@ -1183,13 +1020,8 @@ Tk_DeleteBinding(
}
}
- psPtr->flags |= MARKED_DELETED;
- if (psPtr->refCount == 0) {
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- ckfree((char *) psPtr);
- }
+ ckfree(psPtr->script);
+ ckfree(psPtr);
return TCL_OK;
}
@@ -1198,10 +1030,10 @@ Tk_DeleteBinding(
*
* Tk_GetBinding --
*
- * Return the command associated with a given event string.
+ * Return the script associated with a given event string.
*
* Results:
- * The return value is a pointer to the command string associated with
+ * The return value is a pointer to the script associated with
* eventString for object in the domain given by bindingTable. If there
* is no binding for eventString, or if eventString is improperly formed,
* then NULL is returned and an error message is left in the interp's
@@ -1217,14 +1049,12 @@ Tk_DeleteBinding(
const char *
Tk_GetBinding(
Tcl_Interp *interp, /* Interpreter for error reporting. */
- Tk_BindingTable bindingTable,
- /* Table in which to look for binding. */
+ Tk_BindingTable bindPtr, /* Table in which to look for binding. */
ClientData object, /* Token for object with which binding is
* associated. */
const char *eventString) /* String describing event sequence that
* triggers binding. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
unsigned long eventMask;
@@ -1233,10 +1063,7 @@ Tk_GetBinding(
if (psPtr == NULL) {
return NULL;
}
- if (psPtr->eventProc == EvalTclBinding) {
- return (const char *) psPtr->clientData;
- }
- return "";
+ return psPtr->script;
}
/*
@@ -1262,11 +1089,9 @@ Tk_GetBinding(
void
Tk_GetAllBindings(
Tcl_Interp *interp, /* Interpreter returning result or error. */
- Tk_BindingTable bindingTable,
- /* Table in which to look for bindings. */
+ Tk_BindingTable bindPtr, /* Table in which to look for bindings. */
ClientData object) /* Token for object. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
Tcl_HashEntry *hPtr;
Tcl_DString ds;
@@ -1276,7 +1101,7 @@ Tk_GetAllBindings(
return;
}
Tcl_DStringInit(&ds);
- for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
+ for (psPtr = Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = psPtr->nextObjPtr) {
/*
* For each binding, output information about each of the patterns in
@@ -1309,11 +1134,9 @@ Tk_GetAllBindings(
void
Tk_DeleteAllBindings(
- Tk_BindingTable bindingTable,
- /* Table in which to delete bindings. */
+ Tk_BindingTable bindPtr, /* Table in which to delete bindings. */
ClientData object) /* Token for object. */
{
- BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr, *prevPtr;
PatSeq *nextPtr;
Tcl_HashEntry *hPtr;
@@ -1322,7 +1145,7 @@ Tk_DeleteAllBindings(
if (hPtr == NULL) {
return;
}
- for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
+ for (psPtr = Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = nextPtr) {
nextPtr = psPtr->nextObjPtr;
@@ -1332,7 +1155,7 @@ Tk_DeleteAllBindings(
* hash entry too.
*/
- prevPtr = (PatSeq *) Tcl_GetHashValue(psPtr->hPtr);
+ prevPtr = Tcl_GetHashValue(psPtr->hPtr);
if (prevPtr == psPtr) {
if (psPtr->nextSeqPtr == NULL) {
Tcl_DeleteHashEntry(psPtr->hPtr);
@@ -1350,14 +1173,8 @@ Tk_DeleteAllBindings(
}
}
}
- psPtr->flags |= MARKED_DELETED;
-
- if (psPtr->refCount == 0) {
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- ckfree((char *) psPtr);
- }
+ ckfree(psPtr->script);
+ ckfree(psPtr);
}
Tcl_DeleteHashEntry(hPtr);
}
@@ -1377,27 +1194,19 @@ Tk_DeleteAllBindings(
* None.
*
* Side effects:
- * Depends on the command associated with the matching binding.
+ * Depends on the script associated with the matching binding.
*
- * All Tcl bindings scripts for each object are accumulated before the
+ * All Tcl binding scripts for each object are accumulated before the
* first binding is evaluated. If the action of a Tcl binding is to
* change or delete a binding, or delete the window associated with the
* binding, all the original Tcl binding scripts will still fire.
- * Contrast this with C binding functions. If a pending C binding (one
- * that hasn't fired yet, but is queued to be fired for this window) is
- * deleted, it will not be called, and if it is changed, then the new
- * binding function will be called. If the window itself is deleted, no
- * further C binding functions will be called for this window. When both
- * Tcl binding scripts and C binding functions are interleaved, the above
- * rules still apply.
*
*---------------------------------------------------------------------------
*/
void
Tk_BindEvent(
- Tk_BindingTable bindingTable,
- /* Table in which to look for bindings. */
+ Tk_BindingTable bindPtr, /* Table in which to look for bindings. */
XEvent *eventPtr, /* What actually happened. */
Tk_Window tkwin, /* Window on display where event occurred
* (needed in order to locate display
@@ -1406,23 +1215,19 @@ Tk_BindEvent(
ClientData *objectPtr) /* Array of one or more objects to check for a
* matching binding. */
{
- BindingTable *bindPtr;
TkDisplay *dispPtr;
ScreenInfo *screenPtr;
BindInfo *bindInfoPtr;
TkDisplay *oldDispPtr;
XEvent *ringPtr;
PatSeq *vMatchDetailList, *vMatchNoDetailList;
- int flags, oldScreen, i, deferModal;
- unsigned int matchCount, matchSpace;
+ int flags, oldScreen;
Tcl_Interp *interp;
Tcl_DString scripts, savedResult;
Detail detail;
char *p, *end;
- PendingBinding staticPending, *pendingPtr;
TkWindow *winPtr = (TkWindow *) tkwin;
PatternTableKey key;
- Tk_ClassModalProc *modalProc;
/*
* Ignore events on windows that don't have names: these are windows like
@@ -1453,9 +1258,8 @@ Tk_BindEvent(
}
}
- bindPtr = (BindingTable *) bindingTable;
dispPtr = ((TkWindow *) tkwin)->dispPtr;
- bindInfoPtr = (BindInfo *) winPtr->mainPtr->bindInfo;
+ bindInfoPtr = winPtr->mainPtr->bindInfo;
/*
* Add the new event to the ring of saved events for the binding table.
@@ -1515,7 +1319,7 @@ Tk_BindEvent(
}
}
ringPtr = &bindPtr->eventRing[bindPtr->curEvent];
- memcpy((void *) ringPtr, (void *) eventPtr, sizeof(XEvent));
+ memcpy(ringPtr, eventPtr, sizeof(XEvent));
detail.clientData = 0;
flags = flagArray[ringPtr->type];
if (flags & KEY) {
@@ -1549,14 +1353,14 @@ Tk_BindEvent(
hPtr = Tcl_FindHashEntry(veptPtr, (char *) &key);
if (hPtr != NULL) {
- vMatchDetailList = (PatSeq *) Tcl_GetHashValue(hPtr);
+ vMatchDetailList = Tcl_GetHashValue(hPtr);
}
if (key.detail.clientData != 0) {
key.detail.clientData = 0;
hPtr = Tcl_FindHashEntry(veptPtr, (char *) &key);
if (hPtr != NULL) {
- vMatchNoDetailList = (PatSeq *) Tcl_GetHashValue(hPtr);
+ vMatchNoDetailList = Tcl_GetHashValue(hPtr);
}
}
}
@@ -1565,13 +1369,9 @@ Tk_BindEvent(
* Loop over all the binding tags, finding the binding script or callback
* for each one. Append all of the binding scripts, with %-sequences
* expanded, to "scripts", with null characters separating the scripts for
- * each object. Append all the callbacks to the array of pending
- * callbacks.
+ * each object.
*/
- pendingPtr = &staticPending;
- matchCount = 0;
- matchSpace = sizeof(staticPending.matchArray) / sizeof(PatSeq *);
Tcl_DStringInit(&scripts);
for ( ; numObjects > 0; numObjects--, objectPtr++) {
@@ -1591,9 +1391,8 @@ Tk_BindEvent(
key.detail = detail;
hPtr = Tcl_FindHashEntry(&bindPtr->patternTable, (char *) &key);
if (hPtr != NULL) {
- matchPtr = MatchPatterns(dispPtr, bindPtr,
- (PatSeq *) Tcl_GetHashValue(hPtr), matchPtr, NULL,
- &sourcePtr);
+ matchPtr = MatchPatterns(dispPtr, bindPtr, Tcl_GetHashValue(hPtr),
+ matchPtr, NULL, &sourcePtr);
}
if (vMatchDetailList != NULL) {
@@ -1611,47 +1410,18 @@ Tk_BindEvent(
hPtr = Tcl_FindHashEntry(&bindPtr->patternTable, (char *) &key);
if (hPtr != NULL) {
matchPtr = MatchPatterns(dispPtr, bindPtr,
- (PatSeq *) Tcl_GetHashValue(hPtr), matchPtr, NULL,
- &sourcePtr);
+ Tcl_GetHashValue(hPtr), matchPtr, NULL, &sourcePtr);
}
if (vMatchNoDetailList != NULL) {
matchPtr = MatchPatterns(dispPtr, bindPtr, vMatchNoDetailList,
matchPtr, objectPtr, &sourcePtr);
}
-
}
if (matchPtr != NULL) {
- if (sourcePtr->eventProc == NULL) {
- Tcl_Panic("Tk_BindEvent: missing command");
- }
- if (sourcePtr->eventProc == EvalTclBinding) {
- ExpandPercents(winPtr, (char *) sourcePtr->clientData,
- eventPtr, detail.keySym, &scripts);
- } else {
- if (matchCount >= matchSpace) {
- PendingBinding *newPtr;
- unsigned int oldSize, newSize;
-
- oldSize = sizeof(staticPending)
- - sizeof(staticPending.matchArray)
- + matchSpace * sizeof(PatSeq*);
- matchSpace *= 2;
- newSize = sizeof(staticPending)
- - sizeof(staticPending.matchArray)
- + matchSpace * sizeof(PatSeq*);
- newPtr = (PendingBinding *) ckalloc(newSize);
- memcpy((void *) newPtr, (void *) pendingPtr, oldSize);
- if (pendingPtr != &staticPending) {
- ckfree((char *) pendingPtr);
- }
- pendingPtr = newPtr;
- }
- sourcePtr->refCount++;
- pendingPtr->matchArray[matchCount] = sourcePtr;
- matchCount++;
- }
+ ExpandPercents(winPtr, sourcePtr->script, eventPtr,
+ detail.keySym, &scripts);
/*
* A "" is added to the scripts string to separate the various
@@ -1701,31 +1471,8 @@ Tk_BindEvent(
ChangeScreen(interp, dispPtr->name, screenPtr->curScreenIndex);
}
- if (matchCount > 0) {
- /*
- * Remember the list of pending C binding callbacks, so we can mark
- * them as deleted and not call them if the act of evaluating a C or
- * Tcl binding deletes a C binding callback or even the whole window.
- */
-
- pendingPtr->nextPtr = bindInfoPtr->pendingList;
- pendingPtr->tkwin = tkwin;
- pendingPtr->deleted = 0;
- bindInfoPtr->pendingList = pendingPtr;
- }
-
- /*
- * Save the current value of the TK_DEFER_MODAL flag so we can restore it
- * at the end of the loop. Clear the flag so we can detect any recursive
- * requests for a modal loop.
- */
-
- flags = winPtr->flags;
- winPtr->flags &= ~TK_DEFER_MODAL;
-
p = Tcl_DStringValue(&scripts);
end = p + Tcl_DStringLength(&scripts);
- i = 0;
/*
* Be carefule when dereferencing screenPtr or bindInfoPtr. If we evaluate
@@ -1733,8 +1480,9 @@ Tk_BindEvent(
* can tell that by first checking to see if winPtr->mainPtr == NULL.
*/
- Tcl_Preserve((ClientData) bindInfoPtr);
+ Tcl_Preserve(bindInfoPtr);
while (p < end) {
+ int len = (int) strlen(p);
int code;
if (!bindInfoPtr->deleted) {
@@ -1742,31 +1490,8 @@ Tk_BindEvent(
}
Tcl_AllowExceptions(interp);
- if (*p == '\0') {
- PatSeq *psPtr;
-
- psPtr = pendingPtr->matchArray[i];
- i++;
- code = TCL_OK;
- if ((pendingPtr->deleted == 0)
- && ((psPtr->flags & MARKED_DELETED) == 0)) {
- code = (*psPtr->eventProc)(psPtr->clientData, interp, eventPtr,
- tkwin, detail.keySym);
- }
- psPtr->refCount--;
- if ((psPtr->refCount == 0) && (psPtr->flags & MARKED_DELETED)) {
- if (psPtr->freeProc != NULL) {
- (*psPtr->freeProc)(psPtr->clientData);
- }
- ckfree((char *) psPtr);
- }
- } else {
- int len = (int) strlen(p);
-
- code = Tcl_EvalEx(interp, p, len, TCL_EVAL_GLOBAL);
- p += len;
- }
- p++;
+ code = Tcl_EvalEx(interp, p, len, TCL_EVAL_GLOBAL);
+ p += len + 1;
if (!bindInfoPtr->deleted) {
screenPtr->bindingDepth--;
@@ -1780,29 +1505,12 @@ Tk_BindEvent(
break;
} else {
Tcl_AddErrorInfo(interp, "\n (command bound to event)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
break;
}
}
}
- if (matchCount > 0 && !pendingPtr->deleted) {
- /*
- * Restore the original modal flag value and invoke the modal loop if
- * needed.
- */
-
- deferModal = winPtr->flags & TK_DEFER_MODAL;
- winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL)
- | (flags & TK_DEFER_MODAL);
- if (deferModal) {
- modalProc = Tk_GetClassProc(winPtr->classProcsPtr, modalProc);
- if (modalProc != NULL) {
- (*modalProc)(tkwin, eventPtr);
- }
- }
- }
-
if (!bindInfoPtr->deleted && (screenPtr->bindingDepth != 0)
&& ((oldDispPtr != screenPtr->curDispPtr)
|| (oldScreen != screenPtr->curScreenIndex))) {
@@ -1818,71 +1526,7 @@ Tk_BindEvent(
Tcl_DStringResult(interp, &savedResult);
Tcl_DStringFree(&scripts);
- if (matchCount > 0) {
- if (!bindInfoPtr->deleted) {
- /*
- * Delete the pending list from the list of pending scripts for
- * this window.
- */
-
- PendingBinding **curPtrPtr;
-
- for (curPtrPtr = &bindInfoPtr->pendingList; ; ) {
- if (*curPtrPtr == pendingPtr) {
- *curPtrPtr = pendingPtr->nextPtr;
- break;
- }
- curPtrPtr = &(*curPtrPtr)->nextPtr;
- }
- }
- if (pendingPtr != &staticPending) {
- ckfree((char *) pendingPtr);
- }
- }
- Tcl_Release((ClientData) bindInfoPtr);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * TkBindDeadWindow --
- *
- * This function is invoked when it is determined that a window is dead.
- * It cleans up bind-related information about the window
- *
- * Results:
- * None.
- *
- * Side effects:
- * Any pending C bindings for this window are cancelled.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-TkBindDeadWindow(
- TkWindow *winPtr) /* The window that is being deleted. */
-{
- 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) {
- if (curPtr->tkwin == (Tk_Window) winPtr) {
- curPtr->deleted = 1;
- }
- curPtr = curPtr->nextPtr;
- }
+ Tcl_Release(bindInfoPtr);
}
/*
@@ -1921,6 +1565,7 @@ TkBindDeadWindow(
*
*----------------------------------------------------------------------
*/
+
static PatSeq *
MatchPatterns(
TkDisplay *dispPtr, /* Display from which the event came. */
@@ -2144,7 +1789,7 @@ MatchPatterns(
* virtual event's definition.
*/
- PatSeq *virtMatchPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
+ PatSeq *virtMatchPtr = Tcl_GetHashValue(hPtr);
if ((virtMatchPtr->numPats != 1)
|| (virtMatchPtr->nextSeqPtr != NULL)) {
@@ -2533,7 +2178,7 @@ ExpandPercents(
goto doNumber;
case 'K':
if (flags & KEY) {
- char *name = TkKeysymToString(keySym);
+ const char *name = TkKeysymToString(keySym);
if (name != NULL) {
string = name;
@@ -2662,23 +2307,18 @@ ChangeScreen(
char *dispName, /* Name of new display. */
int screenIndex) /* Index of new screen. */
{
- Tcl_DString cmd;
+ Tcl_Obj *cmdObj = Tcl_ObjPrintf("::tk::ScreenChanged %s.%d",
+ dispName, screenIndex);
int code;
- char screen[TCL_INTEGER_SPACE];
-
- Tcl_DStringInit(&cmd);
- Tcl_DStringAppend(&cmd, "tk::ScreenChanged ", 18);
- Tcl_DStringAppend(&cmd, dispName, -1);
- sprintf(screen, ".%d", screenIndex);
- Tcl_DStringAppend(&cmd, screen, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd),
- TCL_EVAL_GLOBAL);
- Tcl_DStringFree(&cmd);
+
+ Tcl_IncrRefCount(cmdObj);
+ code = Tcl_GlobalEvalObj(interp, cmdObj);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (changing screen in event binding)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
+ Tcl_DecrRefCount(cmdObj);
}
/*
@@ -2705,11 +2345,13 @@ Tk_EventObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int index;
- Tk_Window tkwin;
- VirtualEventTable *vetPtr;
- TkBindInfo bindInfo;
- static const char *optionStrings[] = {
+ int index, i;
+ char *name;
+ const char *event;
+ Tk_Window tkwin = clientData;
+ TkBindInfo bindInfo = ((TkWindow *) tkwin)->mainPtr->bindInfo;
+ VirtualEventTable *vetPtr = &bindInfo->virtualEventTable;
+ static const char *const optionStrings[] = {
"add", "delete", "generate", "info",
NULL
};
@@ -2717,9 +2359,6 @@ Tk_EventObjCmd(
EVENT_ADD, EVENT_DELETE, EVENT_GENERATE, EVENT_INFO
};
- tkwin = (Tk_Window) clientData;
- bindInfo = ((TkWindow *) tkwin)->mainPtr->bindInfo;
- vetPtr = &((BindInfo *) bindInfo)->virtualEventTable;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?");
@@ -2731,10 +2370,7 @@ Tk_EventObjCmd(
}
switch ((enum options) index) {
- case EVENT_ADD: {
- int i;
- char *name, *event;
-
+ case EVENT_ADD:
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
"virtual sequence ?sequence ...?");
@@ -2748,14 +2384,9 @@ Tk_EventObjCmd(
}
}
break;
- }
- case EVENT_DELETE: {
- int i;
- char *name, *event;
-
+ case EVENT_DELETE:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "virtual ?sequence sequence ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "virtual ?sequence ...?");
return TCL_ERROR;
}
name = Tcl_GetString(objv[2]);
@@ -2769,10 +2400,10 @@ Tk_EventObjCmd(
}
}
break;
- }
case EVENT_GENERATE:
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "window event ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window event ?-option value ...?");
return TCL_ERROR;
}
return HandleEventGenerate(interp, tkwin, objc - 2, objv + 2);
@@ -2781,7 +2412,7 @@ Tk_EventObjCmd(
GetAllVirtualEvents(interp, vetPtr);
return TCL_OK;
} else if (objc == 3) {
- return GetVirtualEvent(interp, vetPtr, Tcl_GetString(objv[2]));
+ return GetVirtualEvent(interp, vetPtr, objv[2]);
} else {
Tcl_WrongNumArgs(interp, 2, objv, "?virtual?");
return TCL_ERROR;
@@ -2844,18 +2475,18 @@ DeleteVirtualEventTable(
hPtr = Tcl_FirstHashEntry(&vetPtr->patternTable, &search);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- psPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
+ psPtr = Tcl_GetHashValue(hPtr);
for ( ; psPtr != NULL; psPtr = nextPtr) {
nextPtr = psPtr->nextSeqPtr;
- ckfree((char *) psPtr->voPtr);
- ckfree((char *) psPtr);
+ ckfree(psPtr->voPtr);
+ ckfree(psPtr);
}
}
Tcl_DeleteHashTable(&vetPtr->patternTable);
hPtr = Tcl_FirstHashEntry(&vetPtr->nameTable, &search);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- ckfree((char *) Tcl_GetHashValue(hPtr));
+ ckfree(Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(&vetPtr->nameTable);
}
@@ -2885,7 +2516,7 @@ CreateVirtualEvent(
Tcl_Interp *interp, /* Used for error reporting. */
VirtualEventTable *vetPtr, /* Table in which to augment virtual event. */
char *virtString, /* Name of new virtual event. */
- char *eventString) /* String describing physical event that
+ const char *eventString) /* String describing physical event that
* triggers virtual event. */
{
PatSeq *psPtr;
@@ -2921,9 +2552,9 @@ CreateVirtualEvent(
* Make virtual event own the physical event.
*/
- poPtr = (PhysicalsOwned *) Tcl_GetHashValue(vhPtr);
+ poPtr = Tcl_GetHashValue(vhPtr);
if (poPtr == NULL) {
- poPtr = (PhysicalsOwned *) ckalloc(sizeof(PhysicalsOwned));
+ poPtr = ckalloc(sizeof(PhysicalsOwned));
poPtr->numOwned = 0;
} else {
/*
@@ -2938,10 +2569,10 @@ CreateVirtualEvent(
return TCL_OK;
}
}
- poPtr = (PhysicalsOwned *) ckrealloc((char *) poPtr,
- sizeof(PhysicalsOwned) + poPtr->numOwned * sizeof(PatSeq *));
+ poPtr = ckrealloc(poPtr, sizeof(PhysicalsOwned)
+ + poPtr->numOwned * sizeof(PatSeq *));
}
- Tcl_SetHashValue(vhPtr, (ClientData) poPtr);
+ Tcl_SetHashValue(vhPtr, poPtr);
poPtr->patSeqs[poPtr->numOwned] = psPtr;
poPtr->numOwned++;
@@ -2951,11 +2582,10 @@ CreateVirtualEvent(
voPtr = psPtr->voPtr;
if (voPtr == NULL) {
- voPtr = (VirtualOwners *) ckalloc(sizeof(VirtualOwners));
+ voPtr = ckalloc(sizeof(VirtualOwners));
voPtr->numOwners = 0;
} else {
- voPtr = (VirtualOwners *) ckrealloc((char *) voPtr,
- sizeof(VirtualOwners)
+ voPtr = ckrealloc(voPtr, sizeof(VirtualOwners)
+ voPtr->numOwners * sizeof(Tcl_HashEntry *));
}
psPtr->voPtr = voPtr;
@@ -2994,7 +2624,7 @@ DeleteVirtualEvent(
VirtualEventTable *vetPtr, /* Table in which to delete event. */
char *virtString, /* String describing event sequence that
* triggers binding. */
- char *eventString) /* The event sequence that should be deleted,
+ const char *eventString) /* The event sequence that should be deleted,
* or NULL to delete all event sequences for
* the entire virtual event. */
{
@@ -3013,7 +2643,7 @@ DeleteVirtualEvent(
if (vhPtr == NULL) {
return TCL_OK;
}
- poPtr = (PhysicalsOwned *) Tcl_GetHashValue(vhPtr);
+ poPtr = Tcl_GetHashValue(vhPtr);
eventPSPtr = NULL;
if (eventString != NULL) {
@@ -3062,7 +2692,7 @@ DeleteVirtualEvent(
* from physical->virtual map.
*/
- PatSeq *prevPtr = (PatSeq *) Tcl_GetHashValue(psPtr->hPtr);
+ PatSeq *prevPtr = Tcl_GetHashValue(psPtr->hPtr);
if (prevPtr == psPtr) {
if (psPtr->nextSeqPtr == NULL) {
@@ -3082,8 +2712,8 @@ DeleteVirtualEvent(
}
}
}
- ckfree((char *) psPtr->voPtr);
- ckfree((char *) psPtr);
+ ckfree(psPtr->voPtr);
+ ckfree(psPtr);
} else {
/*
* This physical event still triggers some other virtual
@@ -3120,7 +2750,7 @@ DeleteVirtualEvent(
* itself should be deleted.
*/
- ckfree((char *) poPtr);
+ ckfree(poPtr);
Tcl_DeleteHashEntry(vhPtr);
}
return TCL_OK;
@@ -3152,7 +2782,7 @@ static int
GetVirtualEvent(
Tcl_Interp *interp, /* Interpreter for reporting. */
VirtualEventTable *vetPtr, /* Table in which to look for event. */
- char *virtString) /* String describing virtual event. */
+ Tcl_Obj *virtName) /* String describing virtual event. */
{
Tcl_HashEntry *vhPtr;
Tcl_DString ds;
@@ -3160,7 +2790,7 @@ GetVirtualEvent(
PhysicalsOwned *poPtr;
Tk_Uid virtUid;
- virtUid = GetVirtualEventUid(interp, virtString);
+ virtUid = GetVirtualEventUid(interp, Tcl_GetString(virtName));
if (virtUid == NULL) {
return TCL_ERROR;
}
@@ -3172,7 +2802,7 @@ GetVirtualEvent(
Tcl_DStringInit(&ds);
- poPtr = (PhysicalsOwned *) Tcl_GetHashValue(vhPtr);
+ poPtr = Tcl_GetHashValue(vhPtr);
for (iPhys = 0; iPhys < poPtr->numOwned; iPhys++) {
Tcl_DStringSetLength(&ds, 0);
GetPatternString(poPtr->patSeqs[iPhys], &ds);
@@ -3268,7 +2898,7 @@ HandleEventGenerate(
{
union {XEvent general; XVirtualEvent virtual;} event;
const char *p;
- char *name, *windowName;
+ const char *name, *windowName;
int count, flags, synch, i, number, warp;
Tcl_QueuePosition pos;
Pattern pat;
@@ -3276,7 +2906,8 @@ HandleEventGenerate(
TkWindow *mainPtr;
unsigned long eventMask;
Tcl_Obj *userDataObj;
- static const char *fieldStrings[] = {
+
+ static const char *const fieldStrings[] = {
"-when", "-above", "-borderwidth", "-button",
"-count", "-data", "-delta", "-detail",
"-focus", "-height",
@@ -3332,7 +2963,7 @@ HandleEventGenerate(
return TCL_ERROR;
}
- memset((void *) &event, 0, sizeof(event));
+ memset(&event, 0, sizeof(event));
event.general.xany.type = pat.eventType;
event.general.xany.serial = NextRequest(Tk_Display(tkwin));
event.general.xany.send_event = False;
@@ -3372,6 +3003,11 @@ HandleEventGenerate(
event.general.xkey.y_root = -1;
}
+ if (event.general.xany.type == FocusIn
+ || event.general.xany.type == FocusOut) {
+ event.general.xany.send_event = GENERATED_FOCUS_EVENT_MAGIC;
+ }
+
/*
* Process the remaining arguments to fill in additional fields of the
* event.
@@ -3536,7 +3172,7 @@ HandleEventGenerate(
break;
case EVENT_KEYSYM: {
KeySym keysym;
- char *value;
+ const char *value;
value = Tcl_GetString(valuePtr);
keysym = TkStringToKeysym(value);
@@ -3724,7 +3360,7 @@ HandleEventGenerate(
if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
return TCL_ERROR;
}
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
event.general.xkey.x = number;
/*
@@ -3782,8 +3418,16 @@ HandleEventGenerate(
Tcl_GetString(optionPtr), "\" option", NULL);
return TCL_ERROR;
}
+
+ /*
+ * Don't generate events for windows that don't exist yet.
+ */
+
+ if (!event.general.xany.window) {
+ goto done;
+ }
+
if (userDataObj != NULL) {
- XVirtualEvent *vePtr = (XVirtualEvent *) &event;
/*
* Must be virtual event to set that variable to non-NULL. Now we want
@@ -3792,7 +3436,7 @@ HandleEventGenerate(
* refcount will be decremented once the event has been processed.
*/
- vePtr->user_data = userDataObj;
+ event.virtual.user_data = userDataObj;
Tcl_IncrRefCount(userDataObj);
}
@@ -3815,13 +3459,17 @@ HandleEventGenerate(
TkDisplay *dispPtr = TkGetDisplay(event.general.xmotion.display);
if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) {
- Tcl_DoWhenIdle(DoWarp, (ClientData) dispPtr);
+ Tcl_DoWhenIdle(DoWarp, dispPtr);
dispPtr->flags |= TK_DISPLAY_IN_WARP;
}
- dispPtr->warpWindow = event.general.xany.window;
- dispPtr->warpX = event.general.xkey.x;
- dispPtr->warpY = event.general.xkey.y;
+ dispPtr->warpWindow = Tk_IdToWindow(Tk_Display(mainWin),
+ event.general.xmotion.window);
+ dispPtr->warpMainwin = mainWin;
+ dispPtr->warpX = event.general.xmotion.x;
+ dispPtr->warpY = event.general.xmotion.y;
}
+
+ done:
Tcl_ResetResult(interp);
return TCL_OK;
}
@@ -3833,32 +3481,36 @@ NameToWindow(
Tcl_Obj *objPtr, /* Contains name or id string of window. */
Tk_Window *tkwinPtr) /* Filled with token for window. */
{
- char *name;
+ const char *name = Tcl_GetString(objPtr);
Tk_Window tkwin;
- Window id;
- name = Tcl_GetString(objPtr);
if (name[0] == '.') {
tkwin = Tk_NameToWindow(interp, name, mainWin);
if (tkwin == NULL) {
return TCL_ERROR;
}
- *tkwinPtr = tkwin;
} else {
+ Window id;
+
/*
* 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, "\"", NULL);
- return TCL_ERROR;
+ if (TkpScanWindowId(NULL, name, &id) != TCL_OK) {
+ goto badWindow;
+ }
+ tkwin = Tk_IdToWindow(Tk_Display(mainWin), id);
+ if (tkwin == NULL) {
+ goto badWindow;
}
}
+ *tkwinPtr = tkwin;
return TCL_OK;
+
+ badWindow:
+ Tcl_AppendResult(interp, "bad window name/identifier \"",name,"\"", NULL);
+ return TCL_ERROR;
}
/*
@@ -3876,14 +3528,14 @@ NameToWindow(
*
*-------------------------------------------------------------------------
*/
+
static void
DoWarp(
ClientData clientData)
{
- TkDisplay *dispPtr = (TkDisplay *) clientData;
+ TkDisplay *dispPtr = clientData;
- XWarpPointer(dispPtr->display, (Window) None, (Window) dispPtr->warpWindow,
- 0, 0, 0, 0, (int) dispPtr->warpX, (int) dispPtr->warpY);
+ TkpWarpPointer(dispPtr);
XForceScreenSaver(dispPtr->display, ScreenSaverReset);
dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}
@@ -4058,12 +3710,11 @@ FindSequence(
hPtr = Tcl_CreateHashEntry(patternTablePtr, (char *) &key, &isNew);
sequenceSize = numPats*sizeof(Pattern);
if (!isNew) {
- for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
+ for (psPtr = Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = psPtr->nextSeqPtr) {
if ((numPats == psPtr->numPats)
&& ((flags & PAT_NEARBY) == (psPtr->flags & PAT_NEARBY))
- && (memcmp((char *) patPtr, (char *) psPtr->pats,
- sequenceSize) == 0)) {
+ && (memcmp(patPtr, psPtr->pats, sequenceSize) == 0)) {
goto done;
}
}
@@ -4083,21 +3734,17 @@ FindSequence(
return NULL;
}
- psPtr = (PatSeq *) ckalloc((unsigned) (sizeof(PatSeq)
- + (numPats-1)*sizeof(Pattern)));
+ psPtr = ckalloc(sizeof(PatSeq) + (numPats-1)*sizeof(Pattern));
psPtr->numPats = numPats;
- psPtr->eventProc = NULL;
- psPtr->freeProc = NULL;
- psPtr->clientData = NULL;
+ psPtr->script = NULL;
psPtr->flags = flags;
- psPtr->refCount = 0;
- psPtr->nextSeqPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
+ psPtr->nextSeqPtr = Tcl_GetHashValue(hPtr);
psPtr->hPtr = hPtr;
psPtr->voPtr = NULL;
psPtr->nextObjPtr = NULL;
Tcl_SetHashValue(hPtr, psPtr);
- memcpy((void *) psPtr->pats, (void *) patPtr, sequenceSize);
+ memcpy(psPtr->pats, patPtr, sequenceSize);
done:
*maskPtr = eventMask;
@@ -4169,10 +3816,8 @@ ParseEventDescription(
if (isprint(UCHAR(*p))) {
patPtr->detail.keySym = *p;
} else {
- char buf[64];
-
- sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "bad ASCII character 0x%x", UCHAR(*p)));
count = 0;
goto done;
}
@@ -4251,7 +3896,7 @@ ParseEventDescription(
if (hPtr == NULL) {
break;
}
- modPtr = (ModInfo *) Tcl_GetHashValue(hPtr);
+ modPtr = Tcl_GetHashValue(hPtr);
patPtr->needMods |= modPtr->mask;
if (modPtr->flags & MULT_CLICKS) {
int i = modPtr->flags & MULT_CLICKS;
@@ -4269,7 +3914,7 @@ ParseEventDescription(
eventFlags = 0;
hPtr = Tcl_FindHashEntry(&eventTable, field);
if (hPtr != NULL) {
- EventInfo *eiPtr = (EventInfo *) Tcl_GetHashValue(hPtr);
+ const EventInfo *eiPtr = Tcl_GetHashValue(hPtr);
patPtr->eventType = eiPtr->type;
eventFlags = flagArray[eiPtr->type];
@@ -4412,8 +4057,8 @@ GetPatternString(
Pattern *patPtr;
char c, buffer[TCL_INTEGER_SPACE];
int patsLeft, needMods;
- ModInfo *modPtr;
- EventInfo *eiPtr;
+ const ModInfo *modPtr;
+ const EventInfo *eiPtr;
/*
* The order of the patterns in the sequence is backwards from the order
@@ -4458,22 +4103,21 @@ GetPatternString(
Tcl_DStringAppend(dsPtr, "<", 1);
if ((psPtr->flags & PAT_NEARBY) && (patsLeft > 1)
- && (memcmp((char *) patPtr, (char *) (patPtr-1),
- sizeof(Pattern)) == 0)) {
+ && (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) {
patsLeft--;
patPtr--;
- if ((patsLeft > 1) && (memcmp((char *) patPtr,
- (char *) (patPtr-1), sizeof(Pattern)) == 0)) {
+ if ((patsLeft > 1) &&
+ (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) {
patsLeft--;
patPtr--;
- if ((patsLeft > 1) && (memcmp((char *) patPtr,
- (char *) (patPtr-1), sizeof(Pattern)) == 0)) {
- patsLeft--;
- patPtr--;
- Tcl_DStringAppend(dsPtr, "Quadruple-", 10);
- } else {
- Tcl_DStringAppend(dsPtr, "Triple-", 7);
- }
+ if ((patsLeft > 1) &&
+ (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) {
+ patsLeft--;
+ patPtr--;
+ Tcl_DStringAppend(dsPtr, "Quadruple-", 10);
+ } else {
+ Tcl_DStringAppend(dsPtr, "Triple-", 7);
+ }
} else {
Tcl_DStringAppend(dsPtr, "Double-", 7);
}
@@ -4501,7 +4145,8 @@ GetPatternString(
if (patPtr->detail.clientData != 0) {
if ((patPtr->eventType == KeyPress)
|| (patPtr->eventType == KeyRelease)) {
- char *string = TkKeysymToString(patPtr->detail.keySym);
+ const char *string = TkKeysymToString(patPtr->detail.keySym);
+
if (string != NULL) {
Tcl_DStringAppend(dsPtr, string, -1);
}
@@ -4516,31 +4161,6 @@ GetPatternString(
}
/*
- *---------------------------------------------------------------------------
- *
- * EvalTclBinding --
- *
- * The function that is invoked by Tk_BindEvent when a Tcl binding is
- * fired.
- *
- * Results:
- * A standard Tcl result code, the result of globally evaluating the
- * percent-substitued binding string.
- *
- * Side effects:
- * Normal side effects due to eval.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-FreeTclBinding(
- ClientData clientData)
-{
- ckfree((char *) clientData);
-}
-
-/*
*----------------------------------------------------------------------
*
* TkStringToKeysym --
@@ -4559,7 +4179,7 @@ FreeTclBinding(
KeySym
TkStringToKeysym(
- char *name) /* Name of a keysym. */
+ const char *name) /* Name of a keysym. */
{
#ifdef REDO_KEYSYM_LOOKUP
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&keySymTable, name);
@@ -4595,7 +4215,7 @@ TkStringToKeysym(
*----------------------------------------------------------------------
*/
-char *
+const char *
TkKeysymToString(
KeySym keysym)
{
@@ -4603,7 +4223,7 @@ TkKeysymToString(
Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&nameTable, (char *)keysym);
if (hPtr != NULL) {
- return (char *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
#endif /* REDO_KEYSYM_LOOKUP */
@@ -4613,41 +4233,6 @@ TkKeysymToString(
/*
*----------------------------------------------------------------------
*
- * TkCopyAndGlobalEval --
- *
- * This function makes a copy of a script then calls Tcl_GlobalEval to
- * evaluate it. It's used in situations where the execution of a command
- * may cause the original command string to be reallocated.
- *
- * Results:
- * Returns the result of evaluating script, including both a standard Tcl
- * completion code and a string in the interp's result.
- *
- * Side effects:
- * Any; depends on script.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkCopyAndGlobalEval(
- Tcl_Interp *interp, /* Interpreter in which to evaluate script. */
- char *script) /* Script to evaluate. */
-{
- Tcl_DString buffer;
- int code;
-
- Tcl_DStringInit(&buffer);
- Tcl_DStringAppend(&buffer, script, -1);
- code = Tcl_EvalEx(interp, Tcl_DStringValue(&buffer),
- Tcl_DStringLength(&buffer), TCL_EVAL_GLOBAL);
- Tcl_DStringFree(&buffer);
- return code;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkpGetBindingXEvent --
*
* This function returns the XEvent associated with the currently
@@ -4669,7 +4254,7 @@ TkpGetBindingXEvent(
Tcl_Interp *interp) /* Interpreter. */
{
TkWindow *winPtr = (TkWindow *) Tk_MainWindow(interp);
- BindingTable *bindPtr = (BindingTable *) winPtr->mainPtr->bindingTable;
+ BindingTable *bindPtr = winPtr->mainPtr->bindingTable;
return &(bindPtr->eventRing[bindPtr->curEvent]);
}
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 09545d6..675a42a 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -108,6 +108,7 @@ static void BitmapInit(TkDisplay *dispPtr);
static void DupBitmapObjProc(Tcl_Obj *srcObjPtr,
Tcl_Obj *dupObjPtr);
static void FreeBitmap(TkBitmap *bitmapPtr);
+static void FreeBitmapObj(Tcl_Obj *objPtr);
static void FreeBitmapObjProc(Tcl_Obj *objPtr);
static TkBitmap * GetBitmap(Tcl_Interp *interp, Tk_Window tkwin,
const char *name);
@@ -120,7 +121,7 @@ static void InitBitmapObj(Tcl_Obj *objPtr);
* field of the Tcl_Obj points to a TkBitmap object.
*/
-Tcl_ObjType tkBitmapObjType = {
+const Tcl_ObjType tkBitmapObjType = {
"bitmap", /* name */
FreeBitmapObjProc, /* freeIntRepProc */
DupBitmapObjProc, /* dupIntRepProc */
@@ -166,7 +167,7 @@ Tk_AllocBitmapFromObj(
if (objPtr->typePtr != &tkBitmapObjType) {
InitBitmapObj(objPtr);
}
- bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
+ bitmapPtr = objPtr->internalRep.twoPtrValue.ptr1;
/*
* If the object currently points to a TkBitmap, see if it's the one we
@@ -180,7 +181,7 @@ Tk_AllocBitmapFromObj(
* longer in use. Clear the reference.
*/
- FreeBitmapObjProc(objPtr);
+ FreeBitmapObj(objPtr);
bitmapPtr = NULL;
} else if ((Tk_Display(tkwin) == bitmapPtr->display)
&& (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum)) {
@@ -196,16 +197,16 @@ Tk_AllocBitmapFromObj(
*/
if (bitmapPtr != NULL) {
- TkBitmap *firstBitmapPtr = (TkBitmap *)
- Tcl_GetHashValue(bitmapPtr->nameHashPtr);
- FreeBitmapObjProc(objPtr);
+ TkBitmap *firstBitmapPtr = Tcl_GetHashValue(bitmapPtr->nameHashPtr);
+
+ FreeBitmapObj(objPtr);
for (bitmapPtr = firstBitmapPtr; bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
if ((Tk_Display(tkwin) == bitmapPtr->display) &&
(Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum)) {
bitmapPtr->resourceRefCount++;
bitmapPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = bitmapPtr;
return bitmapPtr->bitmap;
}
}
@@ -216,7 +217,7 @@ Tk_AllocBitmapFromObj(
*/
bitmapPtr = GetBitmap(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = bitmapPtr;
if (bitmapPtr == NULL) {
return None;
}
@@ -306,7 +307,7 @@ GetBitmap(
Pixmap bitmap;
int isNew, width, height, dummy2;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!dispPtr->bitmapInit) {
@@ -316,11 +317,11 @@ GetBitmap(
nameHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapNameTable, string,
&isNew);
if (!isNew) {
- existingBitmapPtr = (TkBitmap *) Tcl_GetHashValue(nameHashPtr);
+ existingBitmapPtr = Tcl_GetHashValue(nameHashPtr);
for (bitmapPtr = existingBitmapPtr; bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
- if ( (Tk_Display(tkwin) == bitmapPtr->display) &&
- (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum) ) {
+ if ((Tk_Display(tkwin) == bitmapPtr->display) &&
+ (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum)) {
bitmapPtr->resourceRefCount++;
return bitmapPtr;
}
@@ -389,7 +390,7 @@ GetBitmap(
goto error;
}
} else {
- predefPtr = (TkPredefBitmap *) Tcl_GetHashValue(predefHashPtr);
+ predefPtr = Tcl_GetHashValue(predefHashPtr);
width = predefPtr->width;
height = predefPtr->height;
if (predefPtr->native) {
@@ -410,7 +411,7 @@ GetBitmap(
* Add information about this bitmap to our database.
*/
- bitmapPtr = (TkBitmap *) ckalloc(sizeof(TkBitmap));
+ bitmapPtr = ckalloc(sizeof(TkBitmap));
bitmapPtr->bitmap = bitmap;
bitmapPtr->width = width;
bitmapPtr->height = height;
@@ -457,7 +458,7 @@ GetBitmap(
*/
int
-Tk_DefineBitmap(
+Tk_OldDefineBitmap(
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. */
@@ -465,10 +466,22 @@ Tk_DefineBitmap(
int width, /* Width of bitmap. */
int height) /* Height of bitmap. */
{
+ return Tk_DefineBitmap(interp, name, source, width, height);
+}
+
+int
+Tk_DefineBitmap(
+ 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. */
+ const void *source, /* Address of bits for bitmap. */
+ int width, /* Width of bitmap. */
+ int height) /* Height of bitmap. */
+{
int isNew;
Tcl_HashEntry *predefHashPtr;
TkPredefBitmap *predefPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -490,7 +503,7 @@ Tk_DefineBitmap(
NULL);
return TCL_ERROR;
}
- predefPtr = (TkPredefBitmap *) ckalloc(sizeof(TkPredefBitmap));
+ predefPtr = ckalloc(sizeof(TkPredefBitmap));
predefPtr->source = source;
predefPtr->width = width;
predefPtr->height = height;
@@ -533,7 +546,7 @@ Tk_NameOfBitmap(
if (idHashPtr == NULL) {
goto unknown;
}
- bitmapPtr = (TkBitmap *) Tcl_GetHashValue(idHashPtr);
+ bitmapPtr = Tcl_GetHashValue(idHashPtr);
return bitmapPtr->nameHashPtr->key.string;
}
@@ -575,7 +588,7 @@ Tk_SizeOfBitmap(
if (idHashPtr == NULL) {
goto unknownBitmap;
}
- bitmapPtr = (TkBitmap *) Tcl_GetHashValue(idHashPtr);
+ bitmapPtr = Tcl_GetHashValue(idHashPtr);
*widthPtr = bitmapPtr->width;
*heightPtr = bitmapPtr->height;
}
@@ -612,7 +625,7 @@ FreeBitmap(
Tk_FreePixmap(bitmapPtr->display, bitmapPtr->bitmap);
Tcl_DeleteHashEntry(bitmapPtr->idHashPtr);
- prevPtr = (TkBitmap *) Tcl_GetHashValue(bitmapPtr->nameHashPtr);
+ prevPtr = Tcl_GetHashValue(bitmapPtr->nameHashPtr);
if (prevPtr == bitmapPtr) {
if (bitmapPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(bitmapPtr->nameHashPtr);
@@ -626,7 +639,7 @@ FreeBitmap(
prevPtr->nextPtr = bitmapPtr->nextPtr;
}
if (bitmapPtr->objRefCount == 0) {
- ckfree((char *) bitmapPtr);
+ ckfree(bitmapPtr);
}
}
@@ -664,7 +677,7 @@ Tk_FreeBitmap(
if (idHashPtr == NULL) {
Tcl_Panic("Tk_FreeBitmap received unknown bitmap argument");
}
- FreeBitmap((TkBitmap *) Tcl_GetHashValue(idHashPtr));
+ FreeBitmap(Tcl_GetHashValue(idHashPtr));
}
/*
@@ -700,7 +713,7 @@ Tk_FreeBitmapFromObj(
/*
*---------------------------------------------------------------------------
*
- * FreeBitmapObjProc --
+ * FreeBitmapObjProc, FreeBitmapObj --
*
* This proc is called to release an object reference to a bitmap.
* Called when the object's internal rep is released or when the cached
@@ -720,13 +733,21 @@ static void
FreeBitmapObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkBitmap *bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
+ FreeBitmapObj(objPtr);
+ objPtr->typePtr = NULL;
+}
+
+static void
+FreeBitmapObj(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
+{
+ TkBitmap *bitmapPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (bitmapPtr != NULL) {
bitmapPtr->objRefCount--;
if ((bitmapPtr->objRefCount == 0)
&& (bitmapPtr->resourceRefCount == 0)) {
- ckfree((char *) bitmapPtr);
+ ckfree(bitmapPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -755,10 +776,10 @@ DupBitmapObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkBitmap *bitmapPtr = (TkBitmap *) srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkBitmap *bitmapPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = bitmapPtr;
if (bitmapPtr != NULL) {
bitmapPtr->objRefCount++;
@@ -793,19 +814,29 @@ DupBitmapObjProc(
/* ARGSUSED */
Pixmap
-Tk_GetBitmapFromData(
+Tk_OldGetBitmapFromData(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which bitmap will be used. */
const char *source, /* Bitmap data for bitmap shape. */
int width, int height) /* Dimensions of bitmap. */
{
+ return Tk_GetBitmapFromData(interp, tkwin, source, width, height);
+}
+
+Pixmap
+Tk_GetBitmapFromData(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ Tk_Window tkwin, /* Window in which bitmap will be used. */
+ const void *source, /* Bitmap data for bitmap shape. */
+ int width, int height) /* Dimensions of bitmap. */
+{
DataKey nameKey;
Tcl_HashEntry *dataHashPtr;
int isNew;
char string[16 + TCL_INTEGER_SPACE];
char *name;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
@@ -818,7 +849,7 @@ Tk_GetBitmapFromData(
dataHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapDataTable,
(char *) &nameKey, &isNew);
if (!isNew) {
- name = (char *) Tcl_GetHashValue(dataHashPtr);
+ name = Tcl_GetHashValue(dataHashPtr);
} else {
dispPtr->bitmapAutoNumber++;
sprintf(string, "_tk%d", dispPtr->bitmapAutoNumber);
@@ -896,14 +927,14 @@ GetBitmapFromObj(
InitBitmapObj(objPtr);
}
- bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
+ bitmapPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (bitmapPtr != NULL) {
if ((bitmapPtr->resourceRefCount > 0)
&& (Tk_Display(tkwin) == bitmapPtr->display)) {
return bitmapPtr;
}
hashPtr = bitmapPtr->nameHashPtr;
- FreeBitmapObjProc(objPtr);
+ FreeBitmapObj(objPtr);
} else {
hashPtr = Tcl_FindHashEntry(&dispPtr->bitmapNameTable,
Tcl_GetString(objPtr));
@@ -917,10 +948,10 @@ GetBitmapFromObj(
* more TkBitmap structures. See if any of them will work.
*/
- for (bitmapPtr = (TkBitmap *) Tcl_GetHashValue(hashPtr);
- bitmapPtr != NULL; bitmapPtr = bitmapPtr->nextPtr) {
+ for (bitmapPtr = Tcl_GetHashValue(hashPtr); bitmapPtr != NULL;
+ bitmapPtr = bitmapPtr->nextPtr) {
if (Tk_Display(tkwin) == bitmapPtr->display) {
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = bitmapPtr;
bitmapPtr->objRefCount++;
return bitmapPtr;
}
@@ -965,7 +996,7 @@ InitBitmapObj(
Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &tkBitmapObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
@@ -997,7 +1028,7 @@ BitmapInit(
* or NULL if unavailable. */
{
Tcl_Interp *dummy;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1010,25 +1041,25 @@ BitmapInit(
dummy = Tcl_CreateInterp();
Tcl_InitHashTable(&tsdPtr->predefBitmapTable, TCL_STRING_KEYS);
- Tk_DefineBitmap(dummy, "error", (char *) error_bits,
+ Tk_DefineBitmap(dummy, "error", error_bits,
error_width, error_height);
- Tk_DefineBitmap(dummy, "gray75", (char *) gray75_bits,
+ Tk_DefineBitmap(dummy, "gray75", gray75_bits,
gray75_width, gray75_height);
- Tk_DefineBitmap(dummy, "gray50", (char *) gray50_bits,
+ Tk_DefineBitmap(dummy, "gray50", gray50_bits,
gray50_width, gray50_height);
- Tk_DefineBitmap(dummy, "gray25", (char *) gray25_bits,
+ Tk_DefineBitmap(dummy, "gray25", gray25_bits,
gray25_width, gray25_height);
- Tk_DefineBitmap(dummy, "gray12", (char *) gray12_bits,
+ Tk_DefineBitmap(dummy, "gray12", gray12_bits,
gray12_width, gray12_height);
- Tk_DefineBitmap(dummy, "hourglass", (char *) hourglass_bits,
+ Tk_DefineBitmap(dummy, "hourglass", hourglass_bits,
hourglass_width, hourglass_height);
- Tk_DefineBitmap(dummy, "info", (char *) info_bits,
+ Tk_DefineBitmap(dummy, "info", info_bits,
info_width, info_height);
- Tk_DefineBitmap(dummy, "questhead", (char *) questhead_bits,
+ Tk_DefineBitmap(dummy, "questhead", questhead_bits,
questhead_width, questhead_height);
- Tk_DefineBitmap(dummy, "question", (char *) question_bits,
+ Tk_DefineBitmap(dummy, "question", question_bits,
question_width, question_height);
- Tk_DefineBitmap(dummy, "warning", (char *) warning_bits,
+ Tk_DefineBitmap(dummy, "warning", warning_bits,
warning_width, warning_height);
TkpDefineNativeBitmaps();
@@ -1089,7 +1120,7 @@ TkReadBitmapFile(
{
char *data;
- data = TkGetBitmapData(NULL, NULL, (char *) filename,
+ data = TkGetBitmapData(NULL, NULL, filename,
(int *) width_return, (int *) height_return, x_hot_return,
y_hot_return);
if (data == NULL) {
@@ -1125,7 +1156,7 @@ Tcl_Obj *
TkDebugBitmap(
Tk_Window tkwin, /* The window in which the bitmap will be used
* (not currently used). */
- char *name) /* Name of the desired color. */
+ const char *name) /* Name of the desired color. */
{
TkBitmap *bitmapPtr;
Tcl_HashEntry *hashPtr;
@@ -1135,7 +1166,7 @@ TkDebugBitmap(
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->bitmapNameTable, name);
if (hashPtr != NULL) {
- bitmapPtr = (TkBitmap *) Tcl_GetHashValue(hashPtr);
+ bitmapPtr = Tcl_GetHashValue(hashPtr);
if (bitmapPtr == NULL) {
Tcl_Panic("TkDebugBitmap found empty hash table entry");
}
@@ -1175,7 +1206,7 @@ TkDebugBitmap(
Tcl_HashTable *
TkGetBitmapPredefTable(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return &tsdPtr->predefBitmapTable;
diff --git a/generic/tkBusy.c b/generic/tkBusy.c
new file mode 100644
index 0000000..fc7f6ab
--- /dev/null
+++ b/generic/tkBusy.c
@@ -0,0 +1,926 @@
+/*
+ * tkBusy.c --
+ *
+ * This file provides functions that implement busy for Tk.
+ *
+ * Copyright 1993-1998 Lucent Technologies, Inc.
+ *
+ * The "busy" command was created by George Howlett. Adapted for
+ * integration into Tk by Jos Decoster and Donal K. Fellows.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkInt.h"
+#include "tkBusy.h"
+#include "default.h"
+
+/*
+ * Things about the busy system that may be configured. Note that currently on
+ * OSX/Aqua, that's nothing at all.
+ */
+
+static const Tk_OptionSpec busyOptionSpecs[] = {
+#ifndef MAC_OSX_TK
+ {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
+ DEF_BUSY_CURSOR, -1, Tk_Offset(Busy, cursor),
+ TK_OPTION_NULL_OK, 0, 0},
+#endif
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
+};
+
+/*
+ * Forward declarations of functions defined in this file.
+ */
+
+static void BusyEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void BusyGeometryProc(ClientData clientData,
+ Tk_Window tkwin);
+static void BusyCustodyProc(ClientData clientData,
+ Tk_Window tkwin);
+static int ConfigureBusy(Tcl_Interp *interp, Busy *busyPtr,
+ int objc, Tcl_Obj *const objv[]);
+static Busy * CreateBusy(Tcl_Interp *interp, Tk_Window tkRef);
+static void DestroyBusy(char *dataPtr);
+static void DoConfigureNotify(Tk_FakeWin *winPtr);
+static inline Tk_Window FirstChild(Tk_Window parent);
+static Busy * GetBusy(Tcl_Interp *interp,
+ Tcl_HashTable *busyTablePtr,
+ Tcl_Obj *const windowObj);
+static int HoldBusy(Tcl_HashTable *busyTablePtr,
+ Tcl_Interp *interp, Tcl_Obj *const windowObj,
+ int configObjc, Tcl_Obj *const configObjv[]);
+static void MakeTransparentWindowExist(Tk_Window tkwin,
+ Window parent);
+static inline Tk_Window NextChild(Tk_Window tkwin);
+static void RefWinEventProc(ClientData clientData,
+ register XEvent *eventPtr);
+static inline void SetWindowInstanceData(Tk_Window tkwin,
+ ClientData instanceData);
+
+/*
+ * The "busy" geometry manager definition.
+ */
+
+static Tk_GeomMgr busyMgrInfo = {
+ "busy", /* Name of geometry manager used by winfo */
+ BusyGeometryProc, /* Procedure to for new geometry requests */
+ BusyCustodyProc, /* Procedure when window is taken away */
+};
+
+/*
+ * Helper functions, need to check if a Tcl/Tk alternative already exists.
+ */
+
+static inline Tk_Window
+FirstChild(
+ Tk_Window parent)
+{
+ struct TkWindow *parentPtr = (struct TkWindow *) parent;
+
+ return (Tk_Window) parentPtr->childList;
+}
+
+static inline Tk_Window
+NextChild(
+ Tk_Window tkwin)
+{
+ struct TkWindow *winPtr = (struct TkWindow *) tkwin;
+
+ if (winPtr == NULL) {
+ return NULL;
+ }
+ return (Tk_Window) winPtr->nextPtr;
+}
+
+static inline void
+SetWindowInstanceData(
+ Tk_Window tkwin,
+ ClientData instanceData)
+{
+ struct TkWindow *winPtr = (struct TkWindow *) tkwin;
+
+ winPtr->instanceData = instanceData;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BusyCustodyProc --
+ *
+ * This procedure is invoked when the busy window has been stolen by
+ * another geometry manager. The information and memory associated with
+ * the busy window is released. I don't know why anyone would try to pack
+ * a busy window, but this should keep everything sane, if it is.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Busy structure is freed at the next idle point.
+ *
+ *----------------------------------------------------------------------
+ */
+
+/* ARGSUSED */
+static void
+BusyCustodyProc(
+ ClientData clientData, /* Information about the busy window. */
+ Tk_Window tkwin) /* Not used. */
+{
+ Busy *busyPtr = clientData;
+
+ Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask, BusyEventProc,
+ busyPtr);
+ TkpHideBusyWindow(busyPtr);
+ busyPtr->tkBusy = NULL;
+ Tcl_EventuallyFree(busyPtr, DestroyBusy);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BusyGeometryProc --
+ *
+ * This procedure is invoked by Tk_GeometryRequest for busy windows.
+ * Busy windows never request geometry, so it's unlikely that this
+ * function will ever be called;it exists simply as a place holder for
+ * the GeomProc in the Geometry Manager structure.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+/* ARGSUSED */
+static void
+BusyGeometryProc(
+ ClientData clientData, /* Information about window that got new
+ * preferred geometry. */
+ Tk_Window tkwin) /* Other Tk-related information about the
+ * window. */
+{
+ /* Should never get here */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DoConfigureNotify --
+ *
+ * Generate a ConfigureNotify event describing the current configuration
+ * of a window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * An event is generated and processed by Tk_HandleEvent.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DoConfigureNotify(
+ Tk_FakeWin *winPtr) /* Window whose configuration was just
+ * changed. */
+{
+ XEvent event;
+
+ event.type = ConfigureNotify;
+ event.xconfigure.serial = LastKnownRequestProcessed(winPtr->display);
+ event.xconfigure.send_event = False;
+ event.xconfigure.display = winPtr->display;
+ event.xconfigure.event = winPtr->window;
+ event.xconfigure.window = winPtr->window;
+ event.xconfigure.x = winPtr->changes.x;
+ event.xconfigure.y = winPtr->changes.y;
+ event.xconfigure.width = winPtr->changes.width;
+ event.xconfigure.height = winPtr->changes.height;
+ event.xconfigure.border_width = winPtr->changes.border_width;
+ if (winPtr->changes.stack_mode == Above) {
+ event.xconfigure.above = winPtr->changes.sibling;
+ } else {
+ event.xconfigure.above = None;
+ }
+ event.xconfigure.override_redirect = winPtr->atts.override_redirect;
+ Tk_HandleEvent(&event);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RefWinEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for the following
+ * events on the reference window. If the reference and parent windows
+ * are the same, only the first event is important.
+ *
+ * 1) ConfigureNotify The reference window has been resized or
+ * moved. Move and resize the busy window to be
+ * the same size and position of the reference
+ * window.
+ *
+ * 2) DestroyNotify The reference window was destroyed. Destroy
+ * the busy window and the free resources used.
+ *
+ * 3) MapNotify The reference window was (re)shown. Map the
+ * busy window again.
+ *
+ * 4) UnmapNotify The reference window was hidden. Unmap the
+ * busy window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When the reference window gets deleted, internal structures get
+ * cleaned up. When it gets resized, the busy window is resized
+ * accordingly. If it's displayed, the busy window is displayed. And when
+ * it's hidden, the busy window is unmapped.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+RefWinEventProc(
+ ClientData clientData, /* Busy window record */
+ register XEvent *eventPtr) /* Event which triggered call to routine */
+{
+ register Busy *busyPtr = clientData;
+
+ switch (eventPtr->type) {
+ case ReparentNotify:
+ case DestroyNotify:
+ /*
+ * Arrange for the busy structure to be removed at a proper time.
+ */
+
+ Tcl_EventuallyFree(busyPtr, DestroyBusy);
+ break;
+
+ case ConfigureNotify:
+ if ((busyPtr->width != Tk_Width(busyPtr->tkRef)) ||
+ (busyPtr->height != Tk_Height(busyPtr->tkRef)) ||
+ (busyPtr->x != Tk_X(busyPtr->tkRef)) ||
+ (busyPtr->y != Tk_Y(busyPtr->tkRef))) {
+ int x, y;
+
+ busyPtr->width = Tk_Width(busyPtr->tkRef);
+ busyPtr->height = Tk_Height(busyPtr->tkRef);
+ busyPtr->x = Tk_X(busyPtr->tkRef);
+ busyPtr->y = Tk_Y(busyPtr->tkRef);
+
+ x = y = 0;
+
+ if (busyPtr->tkParent != busyPtr->tkRef) {
+ Tk_Window tkwin;
+
+ for (tkwin = busyPtr->tkRef; (tkwin != NULL) &&
+ (!Tk_IsTopLevel(tkwin)); tkwin = Tk_Parent(tkwin)) {
+ if (tkwin == busyPtr->tkParent) {
+ break;
+ }
+ x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
+ y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
+ }
+ }
+ if (busyPtr->tkBusy != NULL) {
+ Tk_MoveResizeWindow(busyPtr->tkBusy, x, y, busyPtr->width,
+ busyPtr->height);
+ TkpShowBusyWindow(busyPtr);
+ }
+ }
+ break;
+
+ case MapNotify:
+ if (busyPtr->tkParent != busyPtr->tkRef) {
+ TkpShowBusyWindow(busyPtr);
+ }
+ break;
+
+ case UnmapNotify:
+ if (busyPtr->tkParent != busyPtr->tkRef) {
+ TkpHideBusyWindow(busyPtr);
+ }
+ break;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DestroyBusy --
+ *
+ * This procedure is called from the Tk event dispatcher. It releases X
+ * resources and memory used by the busy window and updates the internal
+ * hash table.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory and resources are released and the Tk event handler is removed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DestroyBusy(
+ char *data) /* Busy window structure record */
+{
+ register Busy *busyPtr = (Busy *) data;
+
+ if (busyPtr->hashPtr != NULL) {
+ Tcl_DeleteHashEntry(busyPtr->hashPtr);
+ }
+ Tk_DeleteEventHandler(busyPtr->tkRef, StructureNotifyMask,
+ RefWinEventProc, busyPtr);
+
+ if (busyPtr->tkBusy != NULL) {
+ Tk_FreeConfigOptions(data, busyPtr->optionTable, busyPtr->tkBusy);
+ Tk_DeleteEventHandler(busyPtr->tkBusy, StructureNotifyMask,
+ BusyEventProc, busyPtr);
+ Tk_ManageGeometry(busyPtr->tkBusy, NULL, busyPtr);
+ Tk_DestroyWindow(busyPtr->tkBusy);
+ }
+ ckfree(data);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BusyEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for events on the busy
+ * window itself. We're only concerned with destroy events.
+ *
+ * It might be necessary (someday) to watch resize events. Right now, I
+ * don't think there's any point in it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When a busy window is destroyed, all internal structures associated
+ * with it released at the next idle point.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+BusyEventProc(
+ ClientData clientData, /* Busy window record */
+ XEvent *eventPtr) /* Event which triggered call to routine */
+{
+ Busy *busyPtr = clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ busyPtr->tkBusy = NULL;
+ Tcl_EventuallyFree(busyPtr, DestroyBusy);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MakeTransparentWindowExist --
+ *
+ * Similar to Tk_MakeWindowExist but instead creates a transparent window
+ * to block for user events from sibling windows.
+ *
+ * Differences from Tk_MakeWindowExist.
+ *
+ * 1. This is always a "busy" window. There's never a platform-specific
+ * class procedure to execute instead.
+ * 2. The window is transparent and never will contain children, so
+ * colormap information is irrelevant.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When the procedure returns, the internal window associated with tkwin
+ * is guaranteed to exist. This may require the window's ancestors to be
+ * created too.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+MakeTransparentWindowExist(
+ Tk_Window tkwin, /* Token for window. */
+ Window parent) /* Parent window. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ Tcl_HashEntry *hPtr;
+ int notUsed;
+ TkDisplay *dispPtr;
+
+ if (winPtr->window != None) {
+ return; /* Window already exists. */
+ }
+
+ /*
+ * Create a transparent window and put it on top.
+ */
+
+ TkpMakeTransparentWindowExist(tkwin, parent);
+
+ dispPtr = winPtr->dispPtr;
+ hPtr = Tcl_CreateHashEntry(&dispPtr->winTable, (char *) winPtr->window,
+ &notUsed);
+ Tcl_SetHashValue(hPtr, winPtr);
+ winPtr->dirtyAtts = 0;
+ winPtr->dirtyChanges = 0;
+
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
+ TkWindow *winPtr2;
+
+ /*
+ * If any siblings higher up in the stacking order have already been
+ * created then move this window to its rightful position in the
+ * stacking order.
+ *
+ * NOTE: this code ignores any changes anyone might have made to the
+ * sibling and stack_mode field of the window's attributes, so it
+ * really isn't safe for these to be manipulated except by calling
+ * Tk_RestackWindow.
+ */
+
+ for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
+ winPtr2 = winPtr2->nextPtr) {
+ if ((winPtr2->window != None) &&
+ !(winPtr2->flags & (TK_TOP_HIERARCHY|TK_REPARENTED))) {
+ XWindowChanges changes;
+
+ changes.sibling = winPtr2->window;
+ changes.stack_mode = Below;
+ XConfigureWindow(winPtr->display, winPtr->window,
+ CWSibling | CWStackMode, &changes);
+ break;
+ }
+ }
+ }
+
+ /*
+ * Issue a ConfigureNotify event if there were deferred configuration
+ * changes (but skip it if the window is being deleted; the
+ * ConfigureNotify event could cause problems if we're being called from
+ * Tk_DestroyWindow under some conditions).
+ */
+
+ if ((winPtr->flags & TK_NEED_CONFIG_NOTIFY)
+ && !(winPtr->flags & TK_ALREADY_DEAD)) {
+ winPtr->flags &= ~TK_NEED_CONFIG_NOTIFY;
+ DoConfigureNotify((Tk_FakeWin *) tkwin);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateBusy --
+ *
+ * Creates a child transparent window that obscures its parent window
+ * thereby effectively blocking device events. The size and position of
+ * the busy window is exactly that of the reference window.
+ *
+ * We want to create sibling to the window to be blocked. If the busy
+ * window is a child of the window to be blocked, Enter/Leave events can
+ * sneak through. Futhermore under WIN32, messages of transparent windows
+ * are sent directly to the parent. The only exception to this are
+ * toplevels, since we can't make a sibling. Fortunately, toplevel
+ * windows rarely receive events that need blocking.
+ *
+ * Results:
+ * Returns a pointer to the new busy window structure.
+ *
+ * Side effects:
+ * When the busy window is eventually displayed, it will screen device
+ * events (in the area of the reference window) from reaching its parent
+ * window and its children. User feed back can be achieved by changing
+ * the cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Busy *
+CreateBusy(
+ Tcl_Interp *interp, /* Interpreter to report error to */
+ Tk_Window tkRef) /* Window hosting the busy window */
+{
+ Busy *busyPtr;
+ int length, x, y;
+ const char *fmt;
+ char *name;
+ Tk_Window tkBusy, tkChild, tkParent;
+ Window parent;
+ Tk_FakeWin *winPtr;
+
+ busyPtr = ckalloc(sizeof(Busy));
+ x = y = 0;
+ length = strlen(Tk_Name(tkRef));
+ name = ckalloc(length + 6);
+ if (Tk_IsTopLevel(tkRef)) {
+ fmt = "_Busy"; /* Child */
+ tkParent = tkRef;
+ } else {
+ Tk_Window tkwin;
+
+ fmt = "%s_Busy"; /* Sibling */
+ tkParent = Tk_Parent(tkRef);
+ for (tkwin = tkRef; (tkwin != NULL) && !Tk_IsTopLevel(tkwin);
+ tkwin = Tk_Parent(tkwin)) {
+ if (tkwin == tkParent) {
+ break;
+ }
+ x += Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
+ y += Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
+ }
+ }
+ for (tkChild = FirstChild(tkParent); tkChild != NULL;
+ tkChild = NextChild(tkChild)) {
+ Tk_MakeWindowExist(tkChild);
+ }
+ sprintf(name, fmt, Tk_Name(tkRef));
+ tkBusy = Tk_CreateWindow(interp, tkParent, name, NULL);
+ ckfree(name);
+
+ if (tkBusy == NULL) {
+ return NULL;
+ }
+ Tk_MakeWindowExist(tkRef);
+ busyPtr->display = Tk_Display(tkRef);
+ busyPtr->interp = interp;
+ busyPtr->tkRef = tkRef;
+ busyPtr->tkParent = tkParent;
+ busyPtr->tkBusy = tkBusy;
+ busyPtr->width = Tk_Width(tkRef);
+ busyPtr->height = Tk_Height(tkRef);
+ busyPtr->x = Tk_X(tkRef);
+ busyPtr->y = Tk_Y(tkRef);
+ busyPtr->cursor = None;
+ Tk_SetClass(tkBusy, "Busy");
+ busyPtr->optionTable = Tk_CreateOptionTable(interp, busyOptionSpecs);
+ if (Tk_InitOptions(interp, (char *) busyPtr, busyPtr->optionTable,
+ tkBusy) != TCL_OK) {
+ Tk_DestroyWindow(tkBusy);
+ return NULL;
+ }
+ SetWindowInstanceData(tkBusy, busyPtr);
+ winPtr = (Tk_FakeWin *) tkRef;
+
+ TkpCreateBusy(winPtr, tkRef, &parent, tkParent, busyPtr);
+
+ MakeTransparentWindowExist(tkBusy, parent);
+
+ Tk_MoveResizeWindow(tkBusy, x, y, busyPtr->width, busyPtr->height);
+
+ /*
+ * Only worry if the busy window is destroyed.
+ */
+
+ Tk_CreateEventHandler(tkBusy, StructureNotifyMask, BusyEventProc,
+ busyPtr);
+
+ /*
+ * Indicate that the busy window's geometry is being managed. This will
+ * also notify us if the busy window is ever packed.
+ */
+
+ Tk_ManageGeometry(tkBusy, &busyMgrInfo, busyPtr);
+ if (busyPtr->cursor != None) {
+ Tk_DefineCursor(tkBusy, busyPtr->cursor);
+ }
+
+ /*
+ * Track the reference window to see if it is resized or destroyed.
+ */
+
+ Tk_CreateEventHandler(tkRef, StructureNotifyMask, RefWinEventProc,
+ busyPtr);
+ return busyPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ConfigureBusy --
+ *
+ * This procedure is called from the Tk event dispatcher. It releases X
+ * resources and memory used by the busy window and updates the internal
+ * hash table.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory and resources are released and the Tk event handler is removed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ConfigureBusy(
+ Tcl_Interp *interp,
+ Busy *busyPtr,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tk_Cursor oldCursor = busyPtr->cursor;
+
+ if (Tk_SetOptions(interp, (char *) busyPtr, busyPtr->optionTable, objc,
+ objv, busyPtr->tkBusy, NULL, NULL) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (busyPtr->cursor != oldCursor) {
+ if (busyPtr->cursor == None) {
+ Tk_UndefineCursor(busyPtr->tkBusy);
+ } else {
+ Tk_DefineCursor(busyPtr->tkBusy, busyPtr->cursor);
+ }
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetBusy --
+ *
+ * Returns the busy window structure associated with the reference
+ * window, keyed by its path name. The clientData argument is the main
+ * window of the interpreter, used to search for the reference window in
+ * its own window hierarchy.
+ *
+ * Results:
+ * If path name represents a reference window with a busy window, a
+ * pointer to the busy window structure is returned. Otherwise, NULL is
+ * returned and an error message is left in interp->result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Busy *
+GetBusy(
+ Tcl_Interp *interp, /* Interpreter to look up main window of. */
+ Tcl_HashTable *busyTablePtr,/* Busy hash table */
+ Tcl_Obj *const windowObj) /* Path name of parent window */
+{
+ Tcl_HashEntry *hPtr;
+ Tk_Window tkwin;
+
+ if (TkGetWindowFromObj(interp, Tk_MainWindow(interp), windowObj,
+ &tkwin) != TCL_OK) {
+ return NULL;
+ }
+ hPtr = Tcl_FindHashEntry(busyTablePtr, (char *) tkwin);
+ if (hPtr == NULL) {
+ Tcl_AppendResult(interp, "can't find busy window \"",
+ Tcl_GetString(windowObj), "\"", NULL);
+ return NULL;
+ }
+ return Tcl_GetHashValue(hPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HoldBusy --
+ *
+ * Creates (if necessary) and maps a busy window, thereby preventing
+ * device events from being be received by the parent window and its
+ * children.
+ *
+ * Results:
+ * Returns a standard TCL result. If path name represents a busy window,
+ * it is unmapped and TCL_OK is returned. Otherwise, TCL_ERROR is
+ * returned and an error message is left in interp->result.
+ *
+ * Side effects:
+ * The busy window is created and displayed, blocking events from the
+ * parent window and its children.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+HoldBusy(
+ Tcl_HashTable *busyTablePtr,/* Busy hash table. */
+ Tcl_Interp *interp, /* Interpreter to report errors to. */
+ Tcl_Obj *const windowObj, /* Window name. */
+ int configObjc, /* Option pairs. */
+ Tcl_Obj *const configObjv[])
+{
+ Tk_Window tkwin;
+ Tcl_HashEntry *hPtr;
+ Busy *busyPtr;
+ int isNew, result;
+
+ if (TkGetWindowFromObj(interp, Tk_MainWindow(interp), windowObj,
+ &tkwin) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ hPtr = Tcl_CreateHashEntry(busyTablePtr, (char *) tkwin, &isNew);
+ if (isNew) {
+ busyPtr = CreateBusy(interp, tkwin);
+ if (busyPtr == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_SetHashValue(hPtr, busyPtr);
+ busyPtr->hashPtr = hPtr;
+ } else {
+ busyPtr = Tcl_GetHashValue(hPtr);
+ }
+
+ busyPtr->tablePtr = busyTablePtr;
+ result = ConfigureBusy(interp, busyPtr, configObjc, configObjv);
+
+ /*
+ * Don't map the busy window unless the reference window is also currently
+ * displayed.
+ */
+
+ if (Tk_IsMapped(busyPtr->tkRef)) {
+ TkpShowBusyWindow(busyPtr);
+ } else {
+ TkpHideBusyWindow(busyPtr);
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_BusyObjCmd --
+ *
+ * This function is invoked to process the "tk busy" 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_BusyObjCmd(
+ 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 = clientData;
+ Tcl_HashTable *busyTablePtr = &((TkWindow *) tkwin)->mainPtr->busyTable;
+ Busy *busyPtr;
+ Tcl_Obj *objPtr;
+ int index, result = TCL_OK;
+ static const char *const optionStrings[] = {
+ "cget", "configure", "current", "forget", "hold", "status", NULL
+ };
+ enum options {
+ BUSY_CGET, BUSY_CONFIGURE, BUSY_CURRENT, BUSY_FORGET, BUSY_HOLD,
+ BUSY_STATUS
+ };
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "options ?arg arg ...?");
+ return TCL_ERROR;
+ }
+
+ /*
+ * [tk busy <window>] command shortcut.
+ */
+
+ if (Tcl_GetString(objv[1])[0] == '.') {
+ if (objc%2 == 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?option value ...?");
+ return TCL_ERROR;
+ }
+ return HoldBusy(busyTablePtr, interp, objv[1], objc-2, objv+2);
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ switch ((enum options) index) {
+ case BUSY_CGET:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window option");
+ return TCL_ERROR;
+ }
+ busyPtr = GetBusy(interp, busyTablePtr, objv[2]);
+ if (busyPtr == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_Preserve(busyPtr);
+ objPtr = Tk_GetOptionValue(interp, (char *) busyPtr,
+ busyPtr->optionTable, objv[3], busyPtr->tkBusy);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ Tcl_Release(busyPtr);
+ return result;
+
+ case BUSY_CONFIGURE:
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?option? ?value ...?");
+ return TCL_ERROR;
+ }
+ busyPtr = GetBusy(interp, busyTablePtr, objv[2]);
+ if (busyPtr == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_Preserve(busyPtr);
+ if (objc <= 4) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) busyPtr,
+ busyPtr->optionTable, (objc == 4) ? objv[3] : NULL,
+ busyPtr->tkBusy);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ } else {
+ result = ConfigureBusy(interp, busyPtr, objc-3, objv+3);
+ }
+ Tcl_Release(busyPtr);
+ return result;
+
+ case BUSY_CURRENT: {
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch cursor;
+ const char *pattern = (objc == 3 ? Tcl_GetString(objv[2]) : NULL);
+
+ objPtr = Tcl_NewObj();
+ for (hPtr = Tcl_FirstHashEntry(busyTablePtr, &cursor); hPtr != NULL;
+ hPtr = Tcl_NextHashEntry(&cursor)) {
+ busyPtr = Tcl_GetHashValue(hPtr);
+ if (pattern == NULL ||
+ Tcl_StringMatch(Tk_PathName(busyPtr->tkRef), pattern)) {
+ Tcl_ListObjAppendElement(interp, objPtr,
+ TkNewWindowObj(busyPtr->tkRef));
+ }
+ }
+ Tcl_SetObjResult(interp, objPtr);
+ return TCL_OK;
+ }
+
+ case BUSY_FORGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ busyPtr = GetBusy(interp, busyTablePtr, objv[2]);
+ if (busyPtr == NULL) {
+ return TCL_ERROR;
+ }
+ TkpHideBusyWindow(busyPtr);
+ Tcl_EventuallyFree(busyPtr, DestroyBusy);
+ return TCL_OK;
+
+ case BUSY_HOLD:
+ if (objc < 3 || objc%2 != 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?option value ...?");
+ return TCL_ERROR;
+ }
+ return HoldBusy(busyTablePtr, interp, objv[2], objc-3, objv+3);
+
+ case BUSY_STATUS:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ GetBusy(interp, busyTablePtr, objv[2]) != NULL));
+ return TCL_OK;
+ }
+
+ Tcl_Panic("unhandled option: %d", index);
+ return TCL_ERROR; /* Unreachable */
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkBusy.h b/generic/tkBusy.h
new file mode 100644
index 0000000..9e6b69b
--- /dev/null
+++ b/generic/tkBusy.h
@@ -0,0 +1,41 @@
+/*
+ * tkBusy.h --
+ *
+ * This file defines the type of the structure describing a busy window.
+ *
+ * Copyright 1993-1998 Lucent Technologies, Inc.
+ *
+ * The "busy" command was created by George Howlett. Adapted for
+ * integration into Tk by Jos Decoster and Donal K. Fellows.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+typedef struct Busy {
+ Display *display; /* Display of busy window */
+ Tcl_Interp *interp; /* Interpreter where "busy" command was
+ * created. It's used to key the searches in
+ * the window hierarchy. See the "windows"
+ * command. */
+ Tk_Window tkBusy; /* Busy window: Transparent window used to
+ * block delivery of events to windows
+ * underneath it. */
+ Tk_Window tkParent; /* Parent window of the busy window. It may be
+ * the reference window (if the reference is a
+ * toplevel) or a mutual ancestor of the
+ * reference window */
+ Tk_Window tkRef; /* Reference window of the busy window. It is
+ * used to manage the size and position of the
+ * busy window. */
+ int x, y; /* Position of the reference window */
+ int width, height; /* Size of the reference window. Retained to
+ * know if the reference window has been
+ * reconfigured to a new size. */
+ int menuBar; /* Menu bar flag. */
+ Tk_Cursor cursor; /* Cursor for the busy window. */
+ Tcl_HashEntry *hashPtr; /* Used the delete the busy window entry out
+ * of the global hash table. */
+ Tcl_HashTable *tablePtr;
+ Tk_OptionTable optionTable;
+} Busy;
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 4e3c06c..190165d 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -26,14 +26,14 @@ static Tcl_ThreadDataKey dataKey;
* tkButton.h.
*/
-static const char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"};
+static const char *const classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"};
/*
* The following table defines the legal values for the -default option. It is
* used together with the "enum defaultValue" declaration in tkButton.h.
*/
-static const char *defaultStrings[] = {
+static const char *const defaultStrings[] = {
"active", "disabled", "normal", NULL
};
@@ -42,7 +42,7 @@ static const char *defaultStrings[] = {
* It is used together with the "enum state" declaration in tkButton.h.
*/
-static const char *stateStrings[] = {
+static const char *const stateStrings[] = {
"active", "disabled", "normal", NULL
};
@@ -51,18 +51,24 @@ static const char *stateStrings[] = {
* It is used with the "enum compound" declaration in tkButton.h
*/
-static const char *compoundStrings[] = {
+static const char *const compoundStrings[] = {
"bottom", "center", "left", "none", "right", "top", NULL
};
+char tkDefButtonHighlightWidth[TCL_INTEGER_SPACE] = DEF_BUTTON_HIGHLIGHT_WIDTH;
+char tkDefButtonPadx[TCL_INTEGER_SPACE] = DEF_BUTTON_PADX;
+char tkDefButtonPady[TCL_INTEGER_SPACE] = DEF_BUTTON_PADY;
char tkDefButtonBorderWidth[TCL_INTEGER_SPACE] = DEF_BUTTON_BORDER_WIDTH;
+char tkDefLabelHighlightWidth[TCL_INTEGER_SPACE] = DEF_LABEL_HIGHLIGHT_WIDTH;
+char tkDefLabelPadx[TCL_INTEGER_SPACE] = DEF_LABCHKRAD_PADX;
+char tkDefLabelPady[TCL_INTEGER_SPACE] = DEF_LABCHKRAD_PADY;
/*
* Information used for parsing configuration options. There is a
* separate table for each of the four widget classes.
*/
-static Tk_OptionSpec labelOptionSpecs[] = {
+static const Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -110,7 +116,7 @@ static Tk_OptionSpec labelOptionSpecs[] = {
DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr),
0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_LABEL_HIGHLIGHT_WIDTH,
+ "HighlightThickness", tkDefLabelHighlightWidth,
Tk_Offset(TkButton, highlightWidthPtr),
Tk_Offset(TkButton, highlightWidth), 0, 0, 0},
{TK_OPTION_STRING, "-image", "image", "Image",
@@ -119,10 +125,10 @@ static Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
- DEF_LABCHKRAD_PADX, Tk_Offset(TkButton, padXPtr),
+ tkDefLabelPadx, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
{TK_OPTION_PIXELS, "-pady", "padY", "Pad",
- DEF_LABCHKRAD_PADY, Tk_Offset(TkButton, padYPtr),
+ tkDefLabelPady, Tk_Offset(TkButton, padYPtr),
Tk_Offset(TkButton, padY), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0},
@@ -144,10 +150,10 @@ static Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr),
Tk_Offset(TkButton, wrapLength), 0, 0, 0},
- {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
-static Tk_OptionSpec buttonOptionSpecs[] = {
+static const Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -201,7 +207,7 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr),
0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_BUTTON_HIGHLIGHT_WIDTH,
+ "HighlightThickness", tkDefButtonHighlightWidth,
Tk_Offset(TkButton, highlightWidthPtr),
Tk_Offset(TkButton, highlightWidth), 0, 0, 0},
{TK_OPTION_STRING, "-image", "image", "Image",
@@ -213,10 +219,10 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
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),
+ tkDefButtonPadx, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
{TK_OPTION_PIXELS, "-pady", "padY", "Pad",
- DEF_BUTTON_PADY, Tk_Offset(TkButton, padYPtr),
+ tkDefButtonPady, 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),
@@ -248,7 +254,7 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
-static Tk_OptionSpec checkbuttonOptionSpecs[] = {
+static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -299,7 +305,7 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr),
0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_BUTTON_HIGHLIGHT_WIDTH,
+ "HighlightThickness", tkDefButtonHighlightWidth,
Tk_Offset(TkButton, highlightWidthPtr),
Tk_Offset(TkButton, highlightWidth), 0, 0, 0},
{TK_OPTION_STRING, "-image", "image", "Image",
@@ -319,10 +325,10 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
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),
+ tkDefLabelPadx, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
{TK_OPTION_PIXELS, "-pady", "padY", "Pad",
- DEF_LABCHKRAD_PADY, Tk_Offset(TkButton, padYPtr),
+ tkDefLabelPady, Tk_Offset(TkButton, padYPtr),
Tk_Offset(TkButton, padY), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0},
@@ -361,7 +367,7 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
-static Tk_OptionSpec radiobuttonOptionSpecs[] = {
+static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
@@ -412,7 +418,7 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr),
0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_BUTTON_HIGHLIGHT_WIDTH,
+ "HighlightThickness", tkDefButtonHighlightWidth,
Tk_Offset(TkButton, highlightWidthPtr),
Tk_Offset(TkButton, highlightWidth), 0, 0, 0},
{TK_OPTION_STRING, "-image", "image", "Image",
@@ -429,10 +435,10 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
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),
+ tkDefLabelPadx, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
{TK_OPTION_PIXELS, "-pady", "padY", "Pad",
- DEF_LABCHKRAD_PADY, Tk_Offset(TkButton, padYPtr),
+ tkDefLabelPady, Tk_Offset(TkButton, padYPtr),
Tk_Offset(TkButton, padY), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0},
@@ -478,7 +484,7 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
* such as TYPE_LABEL, to the option template for that class of widgets.
*/
-static Tk_OptionSpec * const optionSpecs[] = {
+static const Tk_OptionSpec *const optionSpecs[] = {
labelOptionSpecs,
buttonOptionSpecs,
checkbuttonOptionSpecs,
@@ -491,7 +497,7 @@ static Tk_OptionSpec * const optionSpecs[] = {
* enumerated type used to dispatch the widget command.
*/
-static const char *commandNames[][8] = {
+static const char *const commandNames[][8] = {
{"cget", "configure", NULL},
{"cget", "configure", "flash", "invoke", NULL},
{"cget", "configure", "deselect", "flash", "invoke", "select",
@@ -502,7 +508,7 @@ enum command {
COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DESELECT, COMMAND_FLASH,
COMMAND_INVOKE, COMMAND_SELECT, COMMAND_TOGGLE
};
-static enum command map[][8] = {
+static const enum command map[][8] = {
{COMMAND_CGET, COMMAND_CONFIGURE},
{COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_FLASH, COMMAND_INVOKE},
{COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DESELECT, COMMAND_FLASH,
@@ -633,16 +639,16 @@ ButtonCreate(
TkButton *butPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->defaultsInitialized) {
- TkpButtonSetDefaults(optionSpecs[type]);
+ TkpButtonSetDefaults();
tsdPtr->defaultsInitialized = 1;
}
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -666,7 +672,7 @@ ButtonCreate(
Tk_SetClass(tkwin, classNames[type]);
butPtr = TkpCreateButton(tkwin);
- Tk_SetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr);
+ Tk_SetClassProcs(tkwin, &tkpButtonProcs, butPtr);
/*
* Initialize the data structure for the button.
@@ -676,7 +682,7 @@ ButtonCreate(
butPtr->display = Tk_Display(tkwin);
butPtr->interp = interp;
butPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(tkwin),
- ButtonWidgetObjCmd, (ClientData) butPtr, ButtonCmdDeletedProc);
+ ButtonWidgetObjCmd, butPtr, ButtonCmdDeletedProc);
butPtr->type = type;
butPtr->optionTable = optionTable;
butPtr->textPtr = NULL;
@@ -741,7 +747,7 @@ ButtonCreate(
Tk_CreateEventHandler(butPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- ButtonEventProc, (ClientData) butPtr);
+ ButtonEventProc, butPtr);
if (Tk_InitOptions(interp, (char *) butPtr, optionTable, tkwin)
!= TCL_OK) {
@@ -753,8 +759,7 @@ ButtonCreate(
return TCL_ERROR;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(butPtr->tkwin),
- -1);
+ Tcl_SetObjResult(interp, TkNewWindowObj(butPtr->tkwin));
return TCL_OK;
}
@@ -783,13 +788,13 @@ ButtonWidgetObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument values. */
{
- TkButton *butPtr = (TkButton *) clientData;
+ TkButton *butPtr = clientData;
int index;
int result;
Tcl_Obj *objPtr;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
result = Tcl_GetIndexFromObj(interp, objv[1], commandNames[butPtr->type],
@@ -797,7 +802,7 @@ ButtonWidgetObjCmd(
if (result != TCL_OK) {
return result;
}
- Tcl_Preserve((ClientData) butPtr);
+ Tcl_Preserve(butPtr);
switch (map[butPtr->type][index]) {
case COMMAND_CGET:
@@ -809,9 +814,8 @@ ButtonWidgetObjCmd(
butPtr->optionTable, objv[2], butPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case COMMAND_CONFIGURE:
@@ -821,9 +825,8 @@ ButtonWidgetObjCmd(
butPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
result = ConfigureButton(interp, butPtr, objc-2, objv+2);
}
@@ -866,7 +869,7 @@ ButtonWidgetObjCmd(
Tk_SetBackgroundFromBorder(butPtr->tkwin,
butPtr->normalBorder);
}
- TkpDisplayButton((ClientData) butPtr);
+ TkpDisplayButton(butPtr);
/*
* Special note: must cancel any existing idle handler for
@@ -874,7 +877,7 @@ ButtonWidgetObjCmd(
* TkpDisplayButton cleared the REDRAW_PENDING flag.
*/
- Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_CancelIdleCall(TkpDisplayButton, butPtr);
XFlush(butPtr->display);
Tcl_Sleep(50);
}
@@ -916,11 +919,11 @@ ButtonWidgetObjCmd(
}
break;
}
- Tcl_Release((ClientData) butPtr);
+ Tcl_Release(butPtr);
return result;
error:
- Tcl_Release((ClientData) butPtr);
+ Tcl_Release(butPtr);
return TCL_ERROR;
}
@@ -949,7 +952,7 @@ DestroyButton(
TkpDestroyButton(butPtr);
if (butPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_CancelIdleCall(TkpDisplayButton, butPtr);
}
/*
@@ -961,7 +964,7 @@ DestroyButton(
if (butPtr->textVarNamePtr != NULL) {
Tcl_UntraceVar(butPtr->interp, Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonTextVarProc, (ClientData) butPtr);
+ ButtonTextVarProc, butPtr);
}
if (butPtr->image != NULL) {
Tk_FreeImage(butPtr->image);
@@ -996,12 +999,12 @@ DestroyButton(
if (butPtr->selVarNamePtr != NULL) {
Tcl_UntraceVar(butPtr->interp, Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonVarProc, (ClientData) butPtr);
+ ButtonVarProc, butPtr);
}
Tk_FreeConfigOptions((char *) butPtr, butPtr->optionTable,
butPtr->tkwin);
butPtr->tkwin = NULL;
- Tcl_EventuallyFree((ClientData) butPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(butPtr, TCL_DYNAMIC);
}
/*
@@ -1044,12 +1047,12 @@ ConfigureButton(
if (butPtr->textVarNamePtr != NULL) {
Tcl_UntraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonTextVarProc, (ClientData) butPtr);
+ ButtonTextVarProc, butPtr);
}
if (butPtr->selVarNamePtr != NULL) {
Tcl_UntraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonVarProc, (ClientData) butPtr);
+ ButtonVarProc, butPtr);
}
/*
@@ -1181,7 +1184,7 @@ ConfigureButton(
if (butPtr->imagePtr != NULL) {
image = Tk_GetImage(butPtr->interp, butPtr->tkwin,
Tcl_GetString(butPtr->imagePtr), ButtonImageProc,
- (ClientData) butPtr);
+ butPtr);
if (image == NULL) {
continue;
}
@@ -1195,7 +1198,7 @@ ConfigureButton(
if (butPtr->selectImagePtr != NULL) {
image = Tk_GetImage(butPtr->interp, butPtr->tkwin,
Tcl_GetString(butPtr->selectImagePtr),
- ButtonSelectImageProc, (ClientData) butPtr);
+ ButtonSelectImageProc, butPtr);
if (image == NULL) {
continue;
}
@@ -1209,7 +1212,7 @@ ConfigureButton(
if (butPtr->tristateImagePtr != NULL) {
image = Tk_GetImage(butPtr->interp, butPtr->tkwin,
Tcl_GetString(butPtr->tristateImagePtr),
- ButtonTristateImageProc, (ClientData) butPtr);
+ ButtonTristateImageProc, butPtr);
if (image == NULL) {
continue;
}
@@ -1296,15 +1299,15 @@ ConfigureButton(
if (butPtr->textVarNamePtr != NULL) {
Tcl_TraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonTextVarProc, (ClientData) butPtr);
+ ButtonTextVarProc, butPtr);
}
if (butPtr->selVarNamePtr != NULL) {
Tcl_TraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ButtonVarProc, (ClientData) butPtr);
+ ButtonVarProc, butPtr);
}
- TkButtonWorldChanged((ClientData) butPtr);
+ TkButtonWorldChanged(butPtr);
if (error) {
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
@@ -1339,9 +1342,7 @@ TkButtonWorldChanged(
XGCValues gcValues;
GC newGC;
unsigned long mask;
- TkButton *butPtr;
-
- butPtr = (TkButton *) instanceData;
+ TkButton *butPtr = instanceData;
/*
* Recompute GCs.
@@ -1424,7 +1425,7 @@ TkButtonWorldChanged(
*/
if (Tk_IsMapped(butPtr->tkwin) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
}
@@ -1452,7 +1453,7 @@ ButtonEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkButton *butPtr = (TkButton *) clientData;
+ TkButton *butPtr = clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
goto redraw;
} else if (eventPtr->type == ConfigureNotify) {
@@ -1483,7 +1484,7 @@ ButtonEventProc(
redraw:
if ((butPtr->tkwin != NULL) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
}
@@ -1510,7 +1511,7 @@ static void
ButtonCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkButton *butPtr = (TkButton *) clientData;
+ TkButton *butPtr = clientData;
/*
* This function could be invoked either because the window was destroyed
@@ -1605,22 +1606,19 @@ ButtonVarProc(
const char *name2, /* Second part of variable name. */
int flags) /* Information about what happened. */
{
- register TkButton *butPtr = (TkButton *) clientData;
- char *name, *value;
+ register TkButton *butPtr = clientData;
+ const char *value;
Tcl_Obj *valuePtr;
- name = Tcl_GetString(butPtr->selVarNamePtr);
-
/*
* If the variable is being unset, then just re-establish the trace unless
* the whole interpreter is going away.
*/
if (flags & TCL_TRACE_UNSETS) {
- butPtr->flags &= ~SELECTED;
- butPtr->flags &= ~TRISTATED;
+ butPtr->flags &= ~(SELECTED | TRISTATED);
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_TraceVar(interp, name,
+ Tcl_TraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonVarProc, clientData);
}
@@ -1632,7 +1630,8 @@ ButtonVarProc(
* button.
*/
- valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY);
+ valuePtr = Tcl_ObjGetVar2(interp, butPtr->selVarNamePtr, NULL,
+ TCL_GLOBAL_ONLY);
if (valuePtr == NULL) {
value = Tcl_GetString(butPtr->tristateValuePtr);
} else {
@@ -1665,7 +1664,7 @@ ButtonVarProc(
redisplay:
if ((butPtr->tkwin != NULL) && Tk_IsMapped(butPtr->tkwin)
&& !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
return NULL;
@@ -1697,16 +1696,13 @@ ButtonTextVarProc(
const char *name2, /* Not used. */
int flags) /* Information about what happened. */
{
- TkButton *butPtr = (TkButton *) clientData;
- char *name;
+ TkButton *butPtr = clientData;
Tcl_Obj *valuePtr;
if (butPtr->flags & BUTTON_DELETED) {
return NULL;
}
- name = Tcl_GetString(butPtr->textVarNamePtr);
-
/*
* If the variable is unset, then immediately recreate it unless the whole
* interpreter is going away.
@@ -1714,16 +1710,17 @@ ButtonTextVarProc(
if (flags & TCL_TRACE_UNSETS) {
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_SetVar2Ex(interp, name, NULL, butPtr->textPtr,
- TCL_GLOBAL_ONLY);
- Tcl_TraceVar(interp, name,
+ Tcl_ObjSetVar2(interp, butPtr->textVarNamePtr, NULL,
+ butPtr->textPtr, TCL_GLOBAL_ONLY);
+ Tcl_TraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonTextVarProc, clientData);
}
return NULL;
}
- valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY);
+ valuePtr = Tcl_ObjGetVar2(interp, butPtr->textVarNamePtr, NULL,
+ TCL_GLOBAL_ONLY);
if (valuePtr == NULL) {
valuePtr = Tcl_NewObj();
}
@@ -1734,7 +1731,7 @@ ButtonTextVarProc(
if ((butPtr->tkwin != NULL) && Tk_IsMapped(butPtr->tkwin)
&& !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
return NULL;
@@ -1767,12 +1764,12 @@ ButtonImageProc(
* <= 0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkButton *butPtr = (TkButton *) clientData;
+ register TkButton *butPtr = clientData;
if (butPtr->tkwin != NULL) {
TkpComputeButtonGeometry(butPtr);
if (Tk_IsMapped(butPtr->tkwin) && !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
}
@@ -1805,16 +1802,22 @@ ButtonSelectImageProc(
* <= 0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkButton *butPtr = (TkButton *) clientData;
+ register TkButton *butPtr = clientData;
+#ifdef MAC_OSX_TK
+ if (butPtr->tkwin != NULL) {
+ TkpComputeButtonGeometry(butPtr);
+ }
+#else
/*
* Don't recompute geometry: it's controlled by the primary image.
*/
+#endif
if ((butPtr->flags & SELECTED) && (butPtr->tkwin != NULL)
&& Tk_IsMapped(butPtr->tkwin)
&& !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
}
@@ -1846,16 +1849,22 @@ ButtonTristateImageProc(
* <= 0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkButton *butPtr = (TkButton *) clientData;
+ register TkButton *butPtr = clientData;
+#ifdef MAC_OSX_TK
+ if (butPtr->tkwin != NULL) {
+ TkpComputeButtonGeometry(butPtr);
+ }
+#else
/*
* Don't recompute geometry: it's controlled by the primary image.
*/
+#endif
if ((butPtr->flags & TRISTATED) && (butPtr->tkwin != NULL)
&& Tk_IsMapped(butPtr->tkwin)
&& !(butPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ Tcl_DoWhenIdle(TkpDisplayButton, butPtr);
butPtr->flags |= REDRAW_PENDING;
}
}
diff --git a/generic/tkButton.h b/generic/tkButton.h
index 4fde4c1..7ed464f 100644
--- a/generic/tkButton.h
+++ b/generic/tkButton.h
@@ -17,11 +17,6 @@
#include "tkInt.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Legal values for the "compound" field of TkButton records.
*/
@@ -293,18 +288,25 @@ typedef struct {
#define TRISTATED (1 << 4)
/*
- * Declaration of variables shared between the files in the button module.
+ * Declaration of button class functions structure
+ * and button/label defaults, for use in optionSpecs.
*/
-MODULE_SCOPE Tk_ClassProcs tkpButtonProcs;
+MODULE_SCOPE const Tk_ClassProcs tkpButtonProcs;
+MODULE_SCOPE char tkDefButtonHighlightWidth[TCL_INTEGER_SPACE];
+MODULE_SCOPE char tkDefButtonPadx[TCL_INTEGER_SPACE];
+MODULE_SCOPE char tkDefButtonPady[TCL_INTEGER_SPACE];
MODULE_SCOPE char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
+MODULE_SCOPE char tkDefLabelHighlightWidth[TCL_INTEGER_SPACE];
+MODULE_SCOPE char tkDefLabelPadx[TCL_INTEGER_SPACE];
+MODULE_SCOPE char tkDefLabelPady[TCL_INTEGER_SPACE];
/*
* Declaration of functions used in the implementation of the button widget.
*/
#ifndef TkpButtonSetDefaults
-MODULE_SCOPE void TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
+MODULE_SCOPE void TkpButtonSetDefaults();
#endif
MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData);
MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr);
@@ -317,7 +319,4 @@ MODULE_SCOPE void TkpDisplayButton(ClientData clientData);
#endif
MODULE_SCOPE int TkInvokeButton(TkButton *butPtr);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKBUTTON */
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index ecd57b8..6cbc89b 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -79,48 +78,42 @@ typedef struct ArcItem {
*/
static int StyleParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value,
+ Tk_Window tkwin, const char *value,
char *widgRec, int offset);
-static char * StylePrintProc(ClientData clientData, Tk_Window tkwin,
+static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr);
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption styleOption = {
- (Tk_OptionParseProc *) StyleParseProc,
- StylePrintProc, (ClientData) NULL
+static const Tk_CustomOption styleOption = {
+ StyleParseProc, StylePrintProc, NULL
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_CustomOption dashOption = {
- (Tk_OptionParseProc *) TkCanvasDashParseProc,
- TkCanvasDashPrintProc, (ClientData) NULL
+static const Tk_CustomOption dashOption = {
+ TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc, (ClientData) (TK_OFFSET_RELATIVE)
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE)
};
-static Tk_CustomOption pixelOption = {
- (Tk_OptionParseProc *) TkPixelParseProc,
- TkPixelPrintProc, (ClientData) NULL
+static const Tk_CustomOption pixelOption = {
+ TkPixelParseProc, TkPixelPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
NULL, Tk_Offset(ArcItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-activefill", NULL, NULL,
- NULL, Tk_Offset(ArcItem, activeFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, activeFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-activeoutline", NULL, NULL,
- NULL, Tk_Offset(ArcItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, outline.activeStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, activeFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(ArcItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
@@ -128,41 +121,41 @@ static Tk_ConfigSpec configSpecs[] = {
NULL, Tk_Offset(ArcItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
- "0", Tk_Offset(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT},
+ "0", Tk_Offset(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
NULL, Tk_Offset(ArcItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
- NULL, Tk_Offset(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL,
- NULL, Tk_Offset(ArcItem, outline.disabledColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, outline.disabledStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, disabledFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(ArcItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
{TK_CONFIG_DOUBLE, "-extent", NULL, NULL,
- "90", Tk_Offset(ArcItem, extent), TK_CONFIG_DONT_SET_DEFAULT},
+ "90", Tk_Offset(ArcItem, extent), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- NULL, Tk_Offset(ArcItem, fillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, fillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(ArcItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_COLOR, "-outline", NULL, NULL,
- "black", Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK},
+ "black", Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(ArcItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, outline.stipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, outline.stipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_DOUBLE, "-start", NULL, NULL,
- "0", Tk_Offset(ArcItem, start), TK_CONFIG_DONT_SET_DEFAULT},
+ "0", Tk_Offset(ArcItem, start), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_BITMAP, "-stipple", NULL, NULL,
- NULL, Tk_Offset(ArcItem, fillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ArcItem, fillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-style", NULL, NULL,
NULL, Tk_Offset(ArcItem, style), TK_CONFIG_DONT_SET_DEFAULT,
&styleOption},
@@ -171,7 +164,7 @@ static Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-width", NULL, NULL,
"1.0", Tk_Offset(ArcItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT,
&pixelOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -181,17 +174,17 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeArcBbox(Tk_Canvas canvas, ArcItem *arcPtr);
static int ConfigureArc(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int CreateArc(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteArc(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayArc(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
int x, int y, int width, int height);
static int ArcCoords(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
static int ArcToArea(Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr);
static double ArcToPoint(Tk_Canvas canvas,
@@ -239,11 +232,8 @@ Tk_ItemType tkArcType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
-
-#ifndef PI
-#define PI 3.14159265358979323846
-#endif
/*
*--------------------------------------------------------------
@@ -271,13 +261,13 @@ CreateArc(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing arc. */
+ Tcl_Obj *const objv[]) /* Arguments describing arc. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -307,7 +297,7 @@ CreateArc(
*/
for (i = 1; i < objc; i++) {
- char *arg = Tcl_GetString(objv[i]);
+ const char *arg = Tcl_GetString(objv[i]);
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
@@ -349,7 +339,7 @@ ArcCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -424,7 +414,7 @@ ConfigureArc(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Arc item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -440,7 +430,7 @@ ConfigureArc(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -501,7 +491,7 @@ ConfigureArc(
arcPtr->outline.gc = newGC;
if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (state==TK_STATE_HIDDEN) {
ComputeArcBbox(canvas, arcPtr);
@@ -510,7 +500,7 @@ ConfigureArc(
color = arcPtr->fillColor;
stipple = arcPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (arcPtr->activeFillColor!=NULL) {
color = arcPtr->activeFillColor;
}
@@ -598,7 +588,7 @@ DeleteArc(
Tk_DeleteOutline(display, &(arcPtr->outline));
if (arcPtr->numOutlinePoints != 0) {
- ckfree((char *) arcPtr->outlinePtr);
+ ckfree(arcPtr->outlinePtr);
}
if (arcPtr->fillColor != NULL) {
Tk_FreeColor(arcPtr->fillColor);
@@ -651,7 +641,7 @@ ComputeArcBbox(
Tk_State state = arcPtr->header.state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = arcPtr->outline.width;
@@ -662,7 +652,7 @@ ComputeArcBbox(
arcPtr->header.x1 = arcPtr->header.x2 =
arcPtr->header.y1 = arcPtr->header.y2 = -1;
return;
- } else if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *) arcPtr) {
+ } else if (Canvas(canvas)->currentItemPtr == (Tk_Item *) arcPtr) {
if (arcPtr->outline.activeWidth>width) {
width = arcPtr->outline.activeWidth;
}
@@ -794,7 +784,7 @@ DisplayArc(
Pixmap stipple;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
lineWidth = arcPtr->outline.width;
if (lineWidth < 1.0) {
@@ -802,7 +792,7 @@ DisplayArc(
}
dashnumber = arcPtr->outline.dash.number;
stipple = arcPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (arcPtr->outline.activeWidth>lineWidth) {
lineWidth = arcPtr->outline.activeWidth;
}
@@ -970,11 +960,11 @@ ArcToPoint(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = (double) arcPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (arcPtr->outline.activeWidth>width) {
width = (double) arcPtr->outline.activeWidth;
}
@@ -1146,10 +1136,10 @@ ArcToArea(
Tk_State state = itemPtr->state;
if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = (double) arcPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (arcPtr->outline.activeWidth>width) {
width = (double) arcPtr->outline.activeWidth;
}
@@ -1461,14 +1451,13 @@ ComputeArcOutline(
*/
if (arcPtr->numOutlinePoints == 0) {
- arcPtr->outlinePtr = (double *) ckalloc((unsigned)
- (26 * sizeof(double)));
+ arcPtr->outlinePtr = ckalloc(26 * sizeof(double));
arcPtr->numOutlinePoints = 22;
}
outlinePtr = arcPtr->outlinePtr;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
/*
@@ -1526,7 +1515,7 @@ ComputeArcOutline(
*/
width = arcPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *) arcPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) arcPtr) {
if (arcPtr->outline.activeWidth>arcPtr->outline.width) {
width = arcPtr->outline.activeWidth;
}
@@ -1852,13 +1841,13 @@ ArcToPostscript(
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
color = arcPtr->outline.color;
stipple = arcPtr->outline.stipple;
fillColor = arcPtr->fillColor;
fillStipple = arcPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (arcPtr->outline.activeColor!=NULL) {
color = arcPtr->outline.activeColor;
}
@@ -2002,7 +1991,7 @@ StyleParseProc(
ClientData clientData, /* some flags.*/
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */
- CONST char *value, /* Value of option. */
+ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */
{
@@ -2059,7 +2048,7 @@ StyleParseProc(
*--------------------------------------------------------------
*/
-static char *
+static const char *
StylePrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Ignored. */
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 30aa429..ea16a29 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -41,45 +40,43 @@ typedef struct BitmapItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_COLOR, "-activebackground", NULL, NULL,
- NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activebitmap", NULL, NULL,
- NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-activeforeground", NULL, NULL,
- NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
- "center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
+ "center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_COLOR, "-background", NULL, NULL,
- NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-bitmap", NULL, NULL,
- NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-disabledbackground", NULL, NULL,
NULL, Tk_Offset(BitmapItem, disabledBgColor),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledbitmap", NULL, NULL,
NULL, Tk_Offset(BitmapItem, disabledBitmap),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-disabledforeground", NULL, NULL,
NULL, Tk_Offset(BitmapItem, disabledFgColor),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-foreground", NULL, NULL,
- "black", Tk_Offset(BitmapItem, fgColor), 0},
+ "black", Tk_Offset(BitmapItem, fgColor), 0, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
&stateOption},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -88,7 +85,7 @@ static Tk_ConfigSpec configSpecs[] = {
static int BitmapCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int BitmapToArea(Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr);
static double BitmapToPoint(Tk_Canvas canvas,
@@ -99,10 +96,10 @@ static void ComputeBitmapBbox(Tk_Canvas canvas,
BitmapItem *bmapPtr);
static int ConfigureBitmap(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int TkcCreateBitmap(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteBitmap(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayBitmap(Tk_Canvas canvas,
@@ -140,6 +137,7 @@ Tk_ItemType tkBitmapType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -168,13 +166,13 @@ TkcCreateBitmap(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
+ Tcl_Obj *const objv[]) /* Arguments describing rectangle. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -201,7 +199,7 @@ TkcCreateBitmap(
if (objc == 1) {
i = 1;
} else {
- char *arg = Tcl_GetString(objv[1]);
+ const char *arg = Tcl_GetString(objv[1]);
i = 2;
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
@@ -244,7 +242,7 @@ BitmapCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -310,7 +308,7 @@ ConfigureBitmap(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Bitmap item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -325,7 +323,7 @@ ConfigureBitmap(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -345,7 +343,7 @@ ConfigureBitmap(
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (state == TK_STATE_HIDDEN) {
ComputeBitmapBbox(canvas, bmapPtr);
@@ -354,7 +352,7 @@ ConfigureBitmap(
fgColor = bmapPtr->fgColor;
bgColor = bmapPtr->bgColor;
bitmap = bmapPtr->bitmap;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (bmapPtr->activeFgColor!=NULL) {
fgColor = bmapPtr->activeFgColor;
}
@@ -486,10 +484,10 @@ ComputeBitmapBbox(
Tk_State state = bmapPtr->header.state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
bitmap = bmapPtr->bitmap;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)bmapPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *)bmapPtr) {
if (bmapPtr->activeBitmap!=None) {
bitmap = bmapPtr->activeBitmap;
}
@@ -596,10 +594,10 @@ DisplayBitmap(
*/
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
bitmap = bmapPtr->bitmap;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (bmapPtr->activeBitmap!=None) {
bitmap = bmapPtr->activeBitmap;
}
@@ -862,12 +860,12 @@ BitmapToPostscript(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
fgColor = bmapPtr->fgColor;
bgColor = bmapPtr->bgColor;
bitmap = bmapPtr->bitmap;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (bmapPtr->activeFgColor!=NULL) {
fgColor = bmapPtr->activeFgColor;
}
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 9e928c7..880070b 100644
--- a/generic/tkCanvImg.c
+++ b/generic/tkCanvImg.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -44,29 +43,27 @@ typedef struct ImageItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_STRING, "-activeimage", NULL, NULL,
- NULL, Tk_Offset(ImageItem, activeImageString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ImageItem, activeImageString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
- "center", Tk_Offset(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
+ "center", Tk_Offset(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_STRING, "-disabledimage", NULL, NULL,
- NULL, Tk_Offset(ImageItem, disabledImageString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ImageItem, disabledImageString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_STRING, "-image", NULL, NULL,
- NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -78,7 +75,7 @@ static void ImageChangedProc(ClientData clientData,
int imgHeight);
static int ImageCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]);
+ Tcl_Obj *const argv[]);
static int ImageToArea(Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr);
static double ImageToPoint(Tk_Canvas canvas,
@@ -88,10 +85,10 @@ static int ImageToPostscript(Tcl_Interp *interp,
static void ComputeImageBbox(Tk_Canvas canvas, ImageItem *imgPtr);
static int ConfigureImage(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags);
+ Tcl_Obj *const argv[], int flags);
static int CreateImage(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]);
+ int argc, Tcl_Obj *const argv[]);
static void DeleteImage(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayImage(Tk_Canvas canvas,
@@ -129,6 +126,7 @@ Tk_ItemType tkImageType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -157,13 +155,13 @@ CreateImage(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
+ Tcl_Obj *const objv[]) /* Arguments describing rectangle. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -187,7 +185,7 @@ CreateImage(
if (objc == 1) {
i = 1;
} else {
- char *arg = Tcl_GetString(objv[1]);
+ const char *arg = Tcl_GetString(objv[1]);
i = 2;
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
@@ -229,7 +227,7 @@ ImageCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -294,7 +292,7 @@ ConfigureImage(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Image item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -303,7 +301,7 @@ ConfigureImage(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -321,7 +319,7 @@ ConfigureImage(
}
if (imgPtr->imageString != NULL) {
image = Tk_GetImage(interp, tkwin, imgPtr->imageString,
- ImageChangedProc, (ClientData) imgPtr);
+ ImageChangedProc, imgPtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -334,7 +332,7 @@ ConfigureImage(
imgPtr->image = image;
if (imgPtr->activeImageString != NULL) {
image = Tk_GetImage(interp, tkwin, imgPtr->activeImageString,
- ImageChangedProc, (ClientData) imgPtr);
+ ImageChangedProc, imgPtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -347,7 +345,7 @@ ConfigureImage(
imgPtr->activeImage = image;
if (imgPtr->disabledImageString != NULL) {
image = Tk_GetImage(interp, tkwin, imgPtr->disabledImageString,
- ImageChangedProc, (ClientData) imgPtr);
+ ImageChangedProc, imgPtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -437,10 +435,10 @@ ComputeImageBbox(
Tk_State state = imgPtr->header.state;
if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
image = imgPtr->image;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)imgPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *)imgPtr) {
if (imgPtr->activeImage != NULL) {
image = imgPtr->activeImage;
}
@@ -540,11 +538,11 @@ DisplayImage(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
image = imgPtr->image;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (imgPtr->activeImage != NULL) {
image = imgPtr->activeImage;
}
@@ -697,7 +695,7 @@ ImageToPostscript(
* information; 0 means final Postscript is
* being created.*/
{
- ImageItem *imgPtr = (ImageItem *)itemPtr;
+ ImageItem *imgPtr = (ImageItem *) itemPtr;
Tk_Window canvasWin = Tk_CanvasTkwin(canvas);
char buffer[256];
@@ -707,11 +705,11 @@ ImageToPostscript(
Tk_State state = itemPtr->state;
if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
image = imgPtr->image;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (imgPtr->activeImage != NULL) {
image = imgPtr->activeImage;
}
@@ -851,7 +849,7 @@ ImageChangedProc(
* 0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- ImageItem *imgPtr = (ImageItem *) clientData;
+ ImageItem *imgPtr = clientData;
/*
* If the image's size changed and it's not anchored at its northwest
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index cce3460..20a391e 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -23,7 +22,7 @@ typedef enum {
ARROWS_NONE, ARROWS_FIRST, ARROWS_LAST, ARROWS_BOTH
} Arrows;
-typedef struct LineItem {
+typedef struct LineItem {
Tk_Item header; /* Generic stuff that's the same for all
* types. MUST BE FIRST IN STRUCTURE. */
Tk_Outline outline; /* Outline structure */
@@ -59,7 +58,7 @@ typedef struct LineItem {
* point in line (PTS_IN_ARROW points, first
* of which is tip). Malloc'ed. NULL means no
* arrowhead at last point. */
- Tk_SmoothMethod *smooth; /* Non-zero means draw line smoothed (i.e.
+ const Tk_SmoothMethod *smooth; /* Non-zero means draw line smoothed (i.e.
* with Bezier splines). */
int splineSteps; /* Number of steps in each spline segment. */
} LineItem;
@@ -80,11 +79,11 @@ static int ArrowheadPostscript(Tcl_Interp *interp,
static void ComputeLineBbox(Tk_Canvas canvas, LineItem *linePtr);
static int ConfigureLine(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int ConfigureArrows(Tk_Canvas canvas, LineItem *linePtr);
static int CreateLine(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteLine(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayLine(Tk_Canvas canvas,
@@ -95,7 +94,7 @@ static int GetLineIndex(Tcl_Interp *interp,
Tcl_Obj *obj, int *indexPtr);
static int LineCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void LineDeleteCoords(Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last);
static void LineInsert(Tk_Canvas canvas,
@@ -108,14 +107,14 @@ static int LineToPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
static int ArrowParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *recordPtr, int offset);
-static char * ArrowPrintProc(ClientData clientData,
+ const char *value, char *recordPtr, int offset);
+static const char * ArrowPrintProc(ClientData clientData,
Tk_Window tkwin, char *recordPtr, int offset,
Tcl_FreeProc **freeProcPtr);
static int ParseArrowShape(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *recordPtr, int offset);
-static char * PrintArrowShape(ClientData clientData,
+ const char *value, char *recordPtr, int offset);
+static const char * PrintArrowShape(ClientData clientData,
Tk_Window tkwin, char *recordPtr, int offset,
Tcl_FreeProc **freeProcPtr);
static void ScaleLine(Tk_Canvas canvas,
@@ -123,84 +122,77 @@ static void ScaleLine(Tk_Canvas canvas,
double scaleX, double scaleY);
static void TranslateLine(Tk_Canvas canvas,
Tk_Item *itemPtr, double deltaX, double deltaY);
-
+
/*
* Information used for parsing configuration specs. If you change any of the
* default strings, be sure to change the corresponding default values in
* CreateLine.
*/
-static Tk_CustomOption arrowShapeOption = {
- (Tk_OptionParseProc *) ParseArrowShape,
- PrintArrowShape, (ClientData) NULL
+static const Tk_CustomOption arrowShapeOption = {
+ ParseArrowShape, PrintArrowShape, NULL
};
-static Tk_CustomOption arrowOption = {
- (Tk_OptionParseProc *) ArrowParseProc,
- ArrowPrintProc, (ClientData) NULL
+static const Tk_CustomOption arrowOption = {
+ ArrowParseProc, ArrowPrintProc, NULL
};
-static Tk_CustomOption smoothOption = {
- (Tk_OptionParseProc *) TkSmoothParseProc,
- TkSmoothPrintProc, (ClientData) NULL
+static const Tk_CustomOption smoothOption = {
+ TkSmoothParseProc, TkSmoothPrintProc, NULL
};
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_CustomOption dashOption = {
- (Tk_OptionParseProc *) TkCanvasDashParseProc,
- TkCanvasDashPrintProc, (ClientData) NULL
+static const Tk_CustomOption dashOption = {
+ TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc,
- (ClientData) (TK_OFFSET_RELATIVE|TK_OFFSET_INDEX)
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc,
+ INT2PTR(TK_OFFSET_RELATIVE|TK_OFFSET_INDEX)
};
-static Tk_CustomOption pixelOption = {
- (Tk_OptionParseProc *) TkPixelParseProc,
- TkPixelPrintProc, (ClientData) NULL
+static const Tk_CustomOption pixelOption = {
+ TkPixelParseProc, TkPixelPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
NULL, Tk_Offset(LineItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-activefill", NULL, NULL,
- NULL, Tk_Offset(LineItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(LineItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
- NULL, Tk_Offset(LineItem, outline.activeStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(LineItem, outline.activeStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(LineItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
{TK_CONFIG_CUSTOM, "-arrow", NULL, NULL,
- "none", Tk_Offset(LineItem, arrow), TK_CONFIG_DONT_SET_DEFAULT, &arrowOption},
+ "none", Tk_Offset(LineItem, arrow),
+ TK_CONFIG_DONT_SET_DEFAULT, &arrowOption},
{TK_CONFIG_CUSTOM, "-arrowshape", NULL, NULL,
"8 10 3", Tk_Offset(LineItem, arrowShapeA),
TK_CONFIG_DONT_SET_DEFAULT, &arrowShapeOption},
{TK_CONFIG_CAP_STYLE, "-capstyle", NULL, NULL,
- "butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT},
+ "butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- "black", Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK},
+ "black", Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-dash", NULL, NULL,
NULL, Tk_Offset(LineItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
- "0", Tk_Offset(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT},
+ "0", Tk_Offset(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
NULL, Tk_Offset(LineItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
- NULL, Tk_Offset(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
- NULL, Tk_Offset(LineItem, outline.disabledStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(LineItem, outline.disabledStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(LineItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
{TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
- "round", Tk_Offset(LineItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT},
+ "round", Tk_Offset(LineItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(LineItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
@@ -208,17 +200,17 @@ static Tk_ConfigSpec configSpecs[] = {
"0", Tk_Offset(LineItem, smooth),
TK_CONFIG_DONT_SET_DEFAULT, &smoothOption},
{TK_CONFIG_INT, "-splinesteps", NULL, NULL,
- "12", Tk_Offset(LineItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT},
+ "12", Tk_Offset(LineItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_BITMAP, "-stipple", NULL, NULL,
- NULL, Tk_Offset(LineItem, outline.stipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(LineItem, outline.stipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
{TK_CONFIG_CUSTOM, "-width", NULL, NULL,
"1.0", Tk_Offset(LineItem, outline.width),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -235,18 +227,19 @@ Tk_ItemType tkLineType = {
LineCoords, /* coordProc */
DeleteLine, /* deleteProc */
DisplayLine, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
LineToPoint, /* pointProc */
LineToArea, /* areaProc */
LineToPostscript, /* postscriptProc */
ScaleLine, /* scaleProc */
TranslateLine, /* translateProc */
- (Tk_ItemIndexProc *) GetLineIndex, /* indexProc */
+ GetLineIndex, /* indexProc */
NULL, /* icursorProc */
NULL, /* selectionProc */
- (Tk_ItemInsertProc *) LineInsert, /* insertProc */
+ LineInsert, /* insertProc */
LineDeleteCoords, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -283,13 +276,13 @@ CreateLine(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing line. */
+ Tcl_Obj *const objv[]) /* Arguments describing line. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -297,7 +290,7 @@ CreateLine(
* proper cleanup after errors during the the remainder of this function.
*/
- Tk_CreateOutline(&(linePtr->outline));
+ Tk_CreateOutline(&linePtr->outline);
linePtr->canvas = canvas;
linePtr->numPoints = 0;
linePtr->coordPtr = NULL;
@@ -320,7 +313,7 @@ CreateLine(
*/
for (i = 1; i < objc; i++) {
- char *arg = Tcl_GetString(objv[i]);
+ const char *arg = Tcl_GetString(objv[i]);
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
@@ -362,7 +355,7 @@ LineCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i, numPoints;
@@ -413,21 +406,20 @@ LineCoords(
} else {
numPoints = objc/2;
if (linePtr->numPoints != numPoints) {
- coordPtr = (double *)
- ckalloc((unsigned) (sizeof(double) * objc));
+ coordPtr = ckalloc(sizeof(double) * objc);
if (linePtr->coordPtr != NULL) {
- ckfree((char *) linePtr->coordPtr);
+ ckfree(linePtr->coordPtr);
}
linePtr->coordPtr = coordPtr;
linePtr->numPoints = numPoints;
}
coordPtr = linePtr->coordPtr;
- for (i = 0; i <objc; i++) {
+ for (i = 0; i < objc ; i++) {
if (Tk_CanvasGetCoordFromObj(interp, canvas, objv[i],
coordPtr++) != TCL_OK) {
- return TCL_ERROR;
- }
- }
+ return TCL_ERROR;
+ }
+ }
/*
* Update arrowheads by throwing away any existing arrow-head
@@ -435,11 +427,11 @@ LineCoords(
*/
if (linePtr->firstArrowPtr != NULL) {
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
linePtr->firstArrowPtr = NULL;
}
if (linePtr->lastArrowPtr != NULL) {
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
@@ -474,8 +466,8 @@ ConfigureLine(
Tcl_Interp *interp, /* Used for error reporting. */
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Line item to reconfigure. */
- int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* 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;
@@ -487,7 +479,7 @@ ConfigureLine(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -498,8 +490,8 @@ ConfigureLine(
state = itemPtr->state;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
if (linePtr->outline.activeWidth > linePtr->outline.width ||
@@ -510,8 +502,7 @@ ConfigureLine(
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
}
- mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr,
- &(linePtr->outline));
+ mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr, &linePtr->outline);
if (mask) {
if (linePtr->arrow == ARROWS_NONE) {
gcValues.cap_style = linePtr->capStyle;
@@ -522,9 +513,10 @@ ConfigureLine(
newGC = Tk_GetGC(tkwin, mask, &gcValues);
#ifdef MAC_OSX_TK
/*
- * Mac OS X CG drawing needs access to linewidth even for
- * arrow fills (as linewidth controls antialiasing).
+ * Mac OS X CG drawing needs access to linewidth even for arrow fills
+ * (as linewidth controls antialiasing).
*/
+
mask |= GCLineWidth;
#else
gcValues.line_width = 0;
@@ -552,7 +544,7 @@ ConfigureLine(
linePtr->splineSteps = 100;
}
- if ((!linePtr->numPoints) || (state==TK_STATE_HIDDEN)) {
+ if ((!linePtr->numPoints) || (state == TK_STATE_HIDDEN)) {
ComputeLineBbox(canvas, linePtr);
return TCL_OK;
}
@@ -566,7 +558,7 @@ ConfigureLine(
&& (linePtr->arrow != ARROWS_BOTH)) {
linePtr->coordPtr[0] = linePtr->firstArrowPtr[0];
linePtr->coordPtr[1] = linePtr->firstArrowPtr[1];
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
linePtr->firstArrowPtr = NULL;
}
if ((linePtr->lastArrowPtr != NULL) && (linePtr->arrow != ARROWS_LAST)
@@ -576,7 +568,7 @@ ConfigureLine(
i = 2*(linePtr->numPoints-1);
linePtr->coordPtr[i] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1];
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
@@ -617,18 +609,18 @@ DeleteLine(
{
LineItem *linePtr = (LineItem *) itemPtr;
- Tk_DeleteOutline(display, &(linePtr->outline));
+ Tk_DeleteOutline(display, &linePtr->outline);
if (linePtr->coordPtr != NULL) {
- ckfree((char *) linePtr->coordPtr);
+ ckfree(linePtr->coordPtr);
}
if (linePtr->arrowGC != None) {
Tk_FreeGC(display, linePtr->arrowGC);
}
if (linePtr->firstArrowPtr != NULL) {
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
}
if (linePtr->lastArrowPtr != NULL) {
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
}
}
@@ -660,11 +652,11 @@ ComputeLineBbox(
Tk_State state = linePtr->header.state;
Tk_TSOffset *tsoffset;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
- if (!(linePtr->numPoints) || (state==TK_STATE_HIDDEN)) {
+ if (!(linePtr->numPoints) || (state == TK_STATE_HIDDEN)) {
linePtr->header.x1 = -1;
linePtr->header.x2 = -1;
linePtr->header.y1 = -1;
@@ -673,18 +665,18 @@ ComputeLineBbox(
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *)linePtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
}
coordPtr = linePtr->coordPtr;
- linePtr->header.x1 = linePtr->header.x2 = (int) *coordPtr;
+ linePtr->header.x1 = linePtr->header.x2 = (int) coordPtr[0];
linePtr->header.y1 = linePtr->header.y2 = (int) coordPtr[1];
/*
@@ -692,8 +684,8 @@ ComputeLineBbox(
* all directions by the line's width to take care of butting or rounded
* corners and projecting or rounded caps. This expansion is an
* overestimate (worst-case is square root of two over two) but it's
- * simple. eDon't do anything special for curves. This causes an
- * additional overestimate in the bounding box, but is faster.
+ * simple. Don't do anything special for curves. This causes an additional
+ * overestimate in the bounding box, but is faster.
*/
for (i = 1, coordPtr = linePtr->coordPtr+2; i < linePtr->numPoints;
@@ -715,16 +707,20 @@ ComputeLineBbox(
tsoffset = &linePtr->outline.tsoffset;
if (tsoffset->flags & TK_OFFSET_INDEX) {
- double *coordPtr = linePtr->coordPtr + (tsoffset->flags & ~TK_OFFSET_INDEX);
+ double *coordPtr = linePtr->coordPtr
+ + (tsoffset->flags & ~TK_OFFSET_INDEX);
+
if (tsoffset->flags <= 0) {
coordPtr = linePtr->coordPtr;
- if ((linePtr->arrow == ARROWS_FIRST) || (linePtr->arrow == ARROWS_BOTH)) {
+ if ((linePtr->arrow == ARROWS_FIRST)
+ || (linePtr->arrow == ARROWS_BOTH)) {
coordPtr = linePtr->firstArrowPtr;
}
}
if (tsoffset->flags > (linePtr->numPoints * 2)) {
coordPtr = linePtr->coordPtr + (linePtr->numPoints * 2);
- if ((linePtr->arrow == ARROWS_LAST) || (linePtr->arrow == ARROWS_BOTH)) {
+ if ((linePtr->arrow == ARROWS_LAST)
+ || (linePtr->arrow == ARROWS_BOTH)) {
coordPtr = linePtr->lastArrowPtr;
}
}
@@ -753,7 +749,7 @@ ComputeLineBbox(
linePtr->header.y1 -= intWidth;
linePtr->header.y2 += intWidth;
- if (linePtr->numPoints==1) {
+ if (linePtr->numPoints == 1) {
linePtr->header.x1 -= 1;
linePtr->header.x2 += 1;
linePtr->header.y1 -= 1;
@@ -846,19 +842,19 @@ DisplayLine(
int numPoints;
Tk_State state = itemPtr->state;
- if ((!linePtr->numPoints)||(linePtr->outline.gc==None)) {
+ if ((!linePtr->numPoints) || (linePtr->outline.gc == None)) {
return;
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
linewidth = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (linePtr->outline.activeWidth != linewidth) {
linewidth = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (linePtr->outline.disabledWidth != linewidth) {
linewidth = linePtr->outline.disabledWidth;
}
@@ -880,14 +876,14 @@ DisplayLine(
if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints;
} else {
- pointPtr = (XPoint *)ckalloc((unsigned)(numPoints * 3*sizeof(XPoint)));
+ pointPtr = ckalloc(numPoints * 3 * sizeof(XPoint));
}
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, pointPtr, NULL);
} else {
- numPoints = TkCanvTranslatePath((TkCanvas*)canvas, numPoints,
+ numPoints = TkCanvTranslatePath((TkCanvas *) canvas, numPoints,
linePtr->coordPtr, 0, pointPtr);
}
@@ -898,23 +894,25 @@ DisplayLine(
* read-only.
*/
- if (Tk_ChangeOutlineGC(canvas, itemPtr, &(linePtr->outline))) {
- Tk_CanvasSetOffset(canvas, linePtr->arrowGC, &linePtr->outline.tsoffset);
+ if (Tk_ChangeOutlineGC(canvas, itemPtr, &linePtr->outline)) {
+ Tk_CanvasSetOffset(canvas, linePtr->arrowGC,
+ &linePtr->outline.tsoffset);
}
- if (numPoints>1) {
+ if (numPoints > 1) {
XDrawLines(display, drawable, linePtr->outline.gc, pointPtr, numPoints,
- CoordModeOrigin);
+ CoordModeOrigin);
} else {
int intwidth = (int) (linewidth + 0.5);
- if (intwidth<1) {
- intwidth=1;
+
+ if (intwidth < 1) {
+ intwidth = 1;
}
XFillArc(display, drawable, linePtr->outline.gc,
pointPtr->x - intwidth/2, pointPtr->y - intwidth/2,
- (unsigned int)intwidth+1, (unsigned int)intwidth+1, 0, 64*360);
+ (unsigned) intwidth+1, (unsigned) intwidth+1, 0, 64*360);
}
if (pointPtr != staticPoints) {
- ckfree((char *) pointPtr);
+ ckfree(pointPtr);
}
/*
@@ -929,7 +927,7 @@ DisplayLine(
TkFillPolygon(canvas, linePtr->lastArrowPtr, PTS_IN_ARROW,
display, drawable, linePtr->arrowGC, NULL);
}
- if (Tk_ResetOutlineGC(canvas, itemPtr, &(linePtr->outline))) {
+ if (Tk_ResetOutlineGC(canvas, itemPtr, &linePtr->outline)) {
XSetTSOrigin(display, linePtr->arrowGC, 0, 0);
}
}
@@ -965,7 +963,7 @@ LineInsert(
Tcl_Obj **objv;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK)
@@ -987,16 +985,15 @@ LineInsert(
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
}
- newCoordPtr = (double *)
- ckalloc(sizeof(double) * (unsigned)(length + objc));
+ newCoordPtr = ckalloc(sizeof(double) * (length + objc));
for (i=0; i<beforeThis; i++) {
newCoordPtr[i] = linePtr->coordPtr[i];
}
for (i=0; i<objc; i++) {
if (Tcl_GetDoubleFromObj(NULL, objv[i],
&newCoordPtr[i + beforeThis]) != TCL_OK) {
- Tcl_ResetResult(((TkCanvas *)canvas)->interp);
- ckfree((char *) newCoordPtr);
+ Tcl_ResetResult(Canvas(canvas)->interp);
+ ckfree(newCoordPtr);
return;
}
}
@@ -1005,13 +1002,13 @@ LineInsert(
newCoordPtr[i+objc] = linePtr->coordPtr[i];
}
if (linePtr->coordPtr) {
- ckfree((char *) linePtr->coordPtr);
+ ckfree(linePtr->coordPtr);
}
linePtr->coordPtr = newCoordPtr;
- length += objc;
+ length += objc ;
linePtr->numPoints = length / 2;
- if ((length>3) && (state != TK_STATE_HIDDEN)) {
+ if ((length > 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 with
@@ -1023,19 +1020,25 @@ LineInsert(
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
- if (beforeThis>0) {beforeThis -= 2; objc+=2; }
- if ((beforeThis+objc)<length) objc+=2;
+ if (beforeThis > 0) {
+ beforeThis -= 2;
+ objc += 2;
+ }
+ if (beforeThis+objc < length) {
+ objc += 2;
+ }
if (linePtr->smooth) {
- if(beforeThis>0) {
- beforeThis-=2; objc+=2;
+ if (beforeThis > 0) {
+ beforeThis -= 2;
+ objc += 2;
}
- if((beforeThis+objc+2)<length) {
- objc+=2;
+ if (beforeThis+objc+2 < length) {
+ objc += 2;
}
}
itemPtr->x1 = itemPtr->x2 = (int) linePtr->coordPtr[beforeThis];
itemPtr->y1 = itemPtr->y2 = (int) linePtr->coordPtr[beforeThis+1];
- if ((linePtr->firstArrowPtr != NULL) && (beforeThis<1)) {
+ if ((linePtr->firstArrowPtr != NULL) && (beforeThis < 1)) {
/*
* Include old first arrow.
*/
@@ -1045,7 +1048,7 @@ LineInsert(
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+objc)>=length)) {
+ if ((linePtr->lastArrowPtr != NULL) && (beforeThis+objc >= length)) {
/*
* Include old last arrow.
*/
@@ -1055,18 +1058,18 @@ LineInsert(
TkIncludePoint(itemPtr, coordPtr);
}
}
- coordPtr = linePtr->coordPtr+beforeThis+2;
+ coordPtr = linePtr->coordPtr + beforeThis + 2;
for (i=2; i<objc; i+=2) {
TkIncludePoint(itemPtr, coordPtr);
- coordPtr+=2;
+ coordPtr += 2;
}
}
if (linePtr->firstArrowPtr != NULL) {
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
linePtr->firstArrowPtr = NULL;
}
if (linePtr->lastArrowPtr != NULL) {
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
@@ -1077,7 +1080,7 @@ LineInsert(
double width;
int intWidth;
- if ((linePtr->firstArrowPtr != NULL) && (beforeThis>2)) {
+ if ((linePtr->firstArrowPtr != NULL) && (beforeThis > 2)) {
/*
* Include new first arrow.
*/
@@ -1098,12 +1101,12 @@ LineInsert(
}
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
}
@@ -1111,8 +1114,10 @@ LineInsert(
if (intWidth < 1) {
intWidth = 1;
}
- itemPtr->x1 -= intWidth; itemPtr->y1 -= intWidth;
- itemPtr->x2 += intWidth; itemPtr->y2 += intWidth;
+ itemPtr->x1 -= intWidth;
+ itemPtr->y1 -= intWidth;
+ itemPtr->x2 += intWidth;
+ itemPtr->y2 += intWidth;
Tk_CanvasEventuallyRedraw(canvas, itemPtr->x1, itemPtr->y1,
itemPtr->x2, itemPtr->y2);
}
@@ -1151,7 +1156,7 @@ LineDeleteCoords(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
first &= -2;
@@ -1191,7 +1196,7 @@ LineDeleteCoords(
}
}
- if (!(first1 < 2) && (last1 >= length-2)) {
+ if ((first1 >= 2) || (last1 < length-2)) {
/*
* This is some optimizing code that will result that only the part of
* the line that changed (and the objects that are overlapping with
@@ -1237,11 +1242,11 @@ LineDeleteCoords(
}
linePtr->numPoints -= count/2;
if (linePtr->firstArrowPtr != NULL) {
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
linePtr->firstArrowPtr = NULL;
}
if (linePtr->lastArrowPtr != NULL) {
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
@@ -1272,11 +1277,11 @@ LineDeleteCoords(
}
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
@@ -1340,17 +1345,17 @@ LineToPoint(
* which to do the check.
*/
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
}
@@ -1361,8 +1366,7 @@ LineToPoint(
if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace;
} else {
- linePoints = (double *) ckalloc((unsigned)
- (2*numPoints*sizeof(double)));
+ linePoints = ckalloc(2 * numPoints * sizeof(double));
}
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
@@ -1375,12 +1379,14 @@ LineToPoint(
width = 1.0;
}
- if (!numPoints || itemPtr->state==TK_STATE_HIDDEN) {
+ if (!numPoints || itemPtr->state == TK_STATE_HIDDEN) {
return bestDist;
} else if (numPoints == 1) {
bestDist = hypot(linePoints[0]-pointPtr[0], linePoints[1]-pointPtr[1])
- width/2.0;
- if (bestDist < 0) bestDist = 0;
+ if (bestDist < 0) {
+ bestDist = 0;
+ }
return bestDist;
}
@@ -1519,7 +1525,7 @@ LineToPoint(
done:
if ((linePoints != staticSpace) && (linePoints != linePtr->coordPtr)) {
- ckfree((char *) linePoints);
+ ckfree(linePoints);
}
return bestDist;
}
@@ -1556,23 +1562,23 @@ LineToArea(
double radius, width;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
}
radius = (width+1.0)/2.0;
- if ((state==TK_STATE_HIDDEN) || !linePtr->numPoints) {
+ if ((state == TK_STATE_HIDDEN) || !linePtr->numPoints) {
return -1;
} else if (linePtr->numPoints == 1) {
double oval[4];
@@ -1595,8 +1601,7 @@ LineToArea(
if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace;
} else {
- linePoints = (double *) ckalloc((unsigned)
- (2*numPoints*sizeof(double)));
+ linePoints = ckalloc(2 * numPoints * sizeof(double));
}
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
@@ -1609,13 +1614,12 @@ LineToArea(
* Check the segments of the line.
*/
- if (width < 1.0) {
+ if (width < 1.0) {
width = 1.0;
}
- result = TkThickPolyLineToArea(linePoints, numPoints,
- width, linePtr->capStyle, linePtr->joinStyle,
- rectPtr);
+ result = TkThickPolyLineToArea(linePoints, numPoints, width,
+ linePtr->capStyle, linePtr->joinStyle, rectPtr);
if (result == 0) {
goto done;
}
@@ -1643,7 +1647,7 @@ LineToArea(
done:
if ((linePoints != staticSpace) && (linePoints != linePtr->coordPtr)) {
- ckfree((char *) linePoints);
+ ckfree(linePoints);
}
return result;
}
@@ -1688,7 +1692,7 @@ ScaleLine(
if (linePtr->firstArrowPtr != NULL) {
linePtr->coordPtr[0] = linePtr->firstArrowPtr[0];
linePtr->coordPtr[1] = linePtr->firstArrowPtr[1];
- ckfree((char *) linePtr->firstArrowPtr);
+ ckfree(linePtr->firstArrowPtr);
linePtr->firstArrowPtr = NULL;
}
if (linePtr->lastArrowPtr != NULL) {
@@ -1697,7 +1701,7 @@ ScaleLine(
i = 2*(linePtr->numPoints-1);
linePtr->coordPtr[i] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[i+1] = linePtr->lastArrowPtr[1];
- ckfree((char *) linePtr->lastArrowPtr);
+ ckfree(linePtr->lastArrowPtr);
linePtr->lastArrowPtr = NULL;
}
for (i = 0, coordPtr = linePtr->coordPtr; i < linePtr->numPoints;
@@ -1742,7 +1746,7 @@ GetLineIndex(
{
LineItem *linePtr = (LineItem *) itemPtr;
int length;
- char *string = Tcl_GetStringFromObj(obj, &length);
+ const char *string = Tcl_GetStringFromObj(obj, &length);
if (string[0] == 'e') {
if (strncmp(string, "end", (unsigned) length) == 0) {
@@ -1754,14 +1758,15 @@ GetLineIndex(
*/
badIndex:
- Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
return TCL_ERROR;
}
} else if (string[0] == '@') {
int i;
- double x ,y, bestDist, dist, *coordPtr;
- char *end, *p;
+ double x, y, bestDist, dist, *coordPtr;
+ char *end;
+ const char *p;
p = string+1;
x = strtod(p, &end);
@@ -1776,9 +1781,9 @@ GetLineIndex(
bestDist = 1.0e36;
coordPtr = linePtr->coordPtr;
*indexPtr = 0;
- for(i=0; i<linePtr->numPoints; i++) {
+ for (i=0; i<linePtr->numPoints; i++) {
dist = hypot(coordPtr[0] - x, coordPtr[1] - y);
- if (dist<bestDist) {
+ if (dist < bestDist) {
bestDist = dist;
*indexPtr = 2*i;
}
@@ -1788,7 +1793,7 @@ GetLineIndex(
if (Tcl_GetIntFromObj(interp, obj, indexPtr) != TCL_OK) {
goto badIndex;
}
- *indexPtr &= -2; /* if index is odd, make it even */
+ *indexPtr &= -2; /* If index is odd, make it even. */
if (*indexPtr < 0){
*indexPtr = 0;
} else if (*indexPtr > (2*linePtr->numPoints)) {
@@ -1873,7 +1878,7 @@ ParseArrowShape(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Used for error reporting. */
Tk_Window tkwin, /* Not used. */
- CONST char *value, /* Textual specification of arrow shape. */
+ const char *value, /* Textual specification of arrow shape. */
char *recordPtr, /* Pointer to item record in which to store
* arrow information. */
int offset) /* Offset of shape information in widget
@@ -1882,7 +1887,7 @@ ParseArrowShape(
LineItem *linePtr = (LineItem *) recordPtr;
double a, b, c;
int argc;
- CONST char **argv = NULL;
+ const char **argv = NULL;
if (offset != Tk_Offset(LineItem, arrowShapeA)) {
Tcl_Panic("ParseArrowShape received bogus offset");
@@ -1894,7 +1899,7 @@ ParseArrowShape(
Tcl_AppendResult(interp, "bad arrow shape \"", value,
"\": must be list with three numbers", NULL);
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
return TCL_ERROR;
}
@@ -1908,10 +1913,10 @@ ParseArrowShape(
!= TCL_OK)) {
goto syntaxError;
}
- linePtr->arrowShapeA = (float)a;
- linePtr->arrowShapeB = (float)b;
- linePtr->arrowShapeC = (float)c;
- ckfree((char *) argv);
+ linePtr->arrowShapeA = (float) a;
+ linePtr->arrowShapeB = (float) b;
+ linePtr->arrowShapeC = (float) c;
+ ckfree(argv);
return TCL_OK;
}
@@ -1933,7 +1938,7 @@ ParseArrowShape(
*/
/* ARGSUSED */
-static char *
+static const char *
PrintArrowShape(
ClientData clientData, /* Not used. */
Tk_Window tkwin, /* Window associated with linePtr's widget. */
@@ -1944,16 +1949,14 @@ PrintArrowShape(
* string here. */
{
LineItem *linePtr = (LineItem *) recordPtr;
- char *buffer;
+ char *buffer = ckalloc(120);
- buffer = (char *) ckalloc(120);
sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA,
linePtr->arrowShapeB, linePtr->arrowShapeC);
*freeProcPtr = TCL_DYNAMIC;
return buffer;
}
-
/*
*--------------------------------------------------------------
*
@@ -1977,7 +1980,7 @@ ArrowParseProc(
ClientData clientData, /* some flags.*/
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */
- CONST char *value, /* Value of option. */
+ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */
{
@@ -1986,7 +1989,7 @@ ArrowParseProc(
register Arrows *arrowPtr = (Arrows *) (widgRec + offset);
- if(value == NULL || *value == 0) {
+ if (value == NULL || *value == 0) {
*arrowPtr = ARROWS_NONE;
return TCL_OK;
}
@@ -2038,7 +2041,7 @@ ArrowParseProc(
*--------------------------------------------------------------
*/
-static char *
+static const char *
ArrowPrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -2102,21 +2105,21 @@ ConfigureArrows(
double width;
Tk_State state = linePtr->header.state;
- if (linePtr->numPoints <2) {
+ if (linePtr->numPoints < 2) {
return TCL_OK;
}
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = linePtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *)linePtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
}
@@ -2143,8 +2146,7 @@ ConfigureArrows(
if (linePtr->arrow != ARROWS_LAST) {
poly = linePtr->firstArrowPtr;
if (poly == NULL) {
- poly = (double *) ckalloc((unsigned)
- (2*PTS_IN_ARROW*sizeof(double)));
+ poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double));
poly[0] = poly[10] = linePtr->coordPtr[0];
poly[1] = poly[11] = linePtr->coordPtr[1];
linePtr->firstArrowPtr = poly;
@@ -2188,8 +2190,7 @@ ConfigureArrows(
coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2);
poly = linePtr->lastArrowPtr;
if (poly == NULL) {
- poly = (double *)
- ckalloc((unsigned) (2*PTS_IN_ARROW*sizeof(double)));
+ poly = ckalloc(2 * PTS_IN_ARROW * sizeof(double));
poly[0] = poly[10] = coordPtr[2];
poly[1] = poly[11] = coordPtr[3];
linePtr->lastArrowPtr = poly;
@@ -2252,51 +2253,51 @@ LineToPostscript(
{
LineItem *linePtr = (LineItem *) itemPtr;
char buffer[64 + TCL_INTEGER_SPACE];
- char *style;
+ const char *style;
double width;
XColor *color;
Pixmap stipple;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = linePtr->outline.width;
color = linePtr->outline.color;
stipple = linePtr->outline.stipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (linePtr->outline.activeWidth > width) {
width = linePtr->outline.activeWidth;
}
- if (linePtr->outline.activeColor!=NULL) {
+ if (linePtr->outline.activeColor != NULL) {
color = linePtr->outline.activeColor;
}
- if (linePtr->outline.activeStipple!=None) {
+ if (linePtr->outline.activeStipple != None) {
stipple = linePtr->outline.activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (linePtr->outline.disabledWidth > 0) {
width = linePtr->outline.disabledWidth;
}
- if (linePtr->outline.disabledColor!=NULL) {
+ if (linePtr->outline.disabledColor != NULL) {
color = linePtr->outline.disabledColor;
}
- if (linePtr->outline.disabledStipple!=None) {
+ if (linePtr->outline.disabledStipple != None) {
stipple = linePtr->outline.disabledStipple;
}
}
- if (color == NULL || linePtr->numPoints<1 || linePtr->coordPtr==NULL) {
+ if (color == NULL || linePtr->numPoints < 1 || linePtr->coordPtr == NULL){
return TCL_OK;
}
- if (linePtr->numPoints==1) {
+ if (linePtr->numPoints == 1) {
sprintf(buffer, "%.15g %.15g translate %.15g %.15g",
linePtr->coordPtr[0], Tk_CanvasPsY(canvas, linePtr->coordPtr[1]),
width/2.0, width/2.0);
- Tcl_AppendResult(interp, "matrix currentmatrix\n",buffer,
+ Tcl_AppendResult(interp, "matrix currentmatrix\n", buffer,
" scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", NULL);
if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) {
return TCL_ERROR;
@@ -2318,37 +2319,33 @@ LineToPostscript(
if ((!linePtr->smooth) || (linePtr->numPoints < 3)) {
Tk_CanvasPsPath(interp, canvas, linePtr->coordPtr, linePtr->numPoints);
+ } else if ((stipple == None) && linePtr->smooth->postscriptProc) {
+ linePtr->smooth->postscriptProc(interp, canvas, linePtr->coordPtr,
+ linePtr->numPoints, linePtr->splineSteps);
} else {
- if ((stipple == None) && linePtr->smooth->postscriptProc) {
- linePtr->smooth->postscriptProc(interp, canvas,
- linePtr->coordPtr, linePtr->numPoints, linePtr->splineSteps);
- } else {
- /*
- * Special hack: Postscript printers don't appear to be able to
- * turn a path drawn with "curveto"s into a clipping path without
- * exceeding resource limits, so TkMakeBezierPostscript won't work
- * for stippled curves. Instead, generate all of the intermediate
- * points here and output them into the Postscript file with
- * "lineto"s instead.
- */
+ /*
+ * Special hack: Postscript printers don't appear to be able to turn a
+ * path drawn with "curveto"s into a clipping path without exceeding
+ * resource limits, so TkMakeBezierPostscript won't work for stippled
+ * curves. Instead, generate all of the intermediate points here and
+ * output them into the Postscript file with "lineto"s instead.
+ */
- double staticPoints[2*MAX_STATIC_POINTS];
- double *pointPtr;
- int numPoints;
+ double staticPoints[2*MAX_STATIC_POINTS];
+ double *pointPtr;
+ int numPoints;
- numPoints = linePtr->smooth->coordProc(canvas, NULL,
- linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
- pointPtr = staticPoints;
- if (numPoints > MAX_STATIC_POINTS) {
- pointPtr = (double *) ckalloc((unsigned)
- (numPoints * 2 * sizeof(double)));
- }
- numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
- linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr);
- Tk_CanvasPsPath(interp, canvas, pointPtr, numPoints);
- if (pointPtr != staticPoints) {
- ckfree((char *) pointPtr);
- }
+ numPoints = linePtr->smooth->coordProc(canvas, NULL,
+ linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
+ pointPtr = staticPoints;
+ if (numPoints > MAX_STATIC_POINTS) {
+ pointPtr = ckalloc(numPoints * 2 * sizeof(double));
+ }
+ numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
+ linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr);
+ Tk_CanvasPsPath(interp, canvas, pointPtr, numPoints);
+ if (pointPtr != staticPoints) {
+ ckfree(pointPtr);
}
}
@@ -2371,7 +2368,7 @@ LineToPostscript(
}
Tcl_AppendResult(interp, style, NULL);
- if (Tk_CanvasPsOutline(canvas, itemPtr, &(linePtr->outline)) != TCL_OK) {
+ if (Tk_CanvasPsOutline(canvas, itemPtr, &linePtr->outline) != TCL_OK) {
return TCL_ERROR;
}
@@ -2432,16 +2429,16 @@ ArrowheadPostscript(
Pixmap stipple;
Tk_State state = linePtr->header.state;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
stipple = linePtr->outline.stipple;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) linePtr) {
if (linePtr->outline.activeStipple!=None) {
stipple = linePtr->outline.activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (linePtr->outline.activeStipple!=None) {
stipple = linePtr->outline.disabledStipple;
}
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index b86bc63..943ef0b 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -44,7 +43,7 @@ typedef struct PolygonItem {
Pixmap disabledFillStipple; /* Stipple bitmap for filling polygon if state
* is disabled. */
GC fillGC; /* Graphics context for filling polygon. */
- Tk_SmoothMethod *smooth; /* Non-zero means draw shape smoothed (i.e.
+ const Tk_SmoothMethod *smooth; /* Non-zero means draw shape smoothed (i.e.
* with Bezier splines). */
int splineSteps; /* Number of steps in each spline segment. */
int autoClosed; /* Zero means the given polygon was closed,
@@ -55,45 +54,39 @@ typedef struct PolygonItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption smoothOption = {
- (Tk_OptionParseProc *) TkSmoothParseProc,
- TkSmoothPrintProc, (ClientData) NULL
+static const Tk_CustomOption smoothOption = {
+ TkSmoothParseProc, TkSmoothPrintProc, NULL
};
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_CustomOption dashOption = {
- (Tk_OptionParseProc *) TkCanvasDashParseProc,
- TkCanvasDashPrintProc, (ClientData) NULL
+static const Tk_CustomOption dashOption = {
+ TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc,
- (ClientData) (TK_OFFSET_RELATIVE|TK_OFFSET_INDEX)
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc,
+ INT2PTR(TK_OFFSET_RELATIVE|TK_OFFSET_INDEX)
};
-static Tk_CustomOption pixelOption = {
- (Tk_OptionParseProc *) TkPixelParseProc,
- TkPixelPrintProc, (ClientData) NULL
+static const Tk_CustomOption pixelOption = {
+ TkPixelParseProc, TkPixelPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
NULL, Tk_Offset(PolygonItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-activefill", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, activeFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, activeFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-activeoutline", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL,
NULL, Tk_Offset(PolygonItem, outline.activeStipple),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, activeFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
@@ -102,52 +95,52 @@ static Tk_ConfigSpec configSpecs[] = {
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
"0", Tk_Offset(PolygonItem, outline.offset),
- TK_CONFIG_DONT_SET_DEFAULT},
+ TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
NULL, Tk_Offset(PolygonItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL,
NULL, Tk_Offset(PolygonItem, outline.disabledColor),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL,
NULL, Tk_Offset(PolygonItem, outline.disabledStipple),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, disabledFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- "black", Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK},
+ "black", Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
- "round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT},
+ "round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
{TK_CONFIG_COLOR, "-outline", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, outline.tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
{TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, outline.stipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, outline.stipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-smooth", NULL, NULL,
"0", Tk_Offset(PolygonItem, smooth),
TK_CONFIG_DONT_SET_DEFAULT, &smoothOption},
{TK_CONFIG_INT, "-splinesteps", NULL, NULL,
- "12", Tk_Offset(PolygonItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT},
+ "12", Tk_Offset(PolygonItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_BITMAP, "-stipple", NULL, NULL,
- NULL, Tk_Offset(PolygonItem, fillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PolygonItem, fillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
{TK_CONFIG_CUSTOM, "-width", NULL, NULL,
"1.0", Tk_Offset(PolygonItem, outline.width),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -158,10 +151,10 @@ static void ComputePolygonBbox(Tk_Canvas canvas,
PolygonItem *polyPtr);
static int ConfigurePolygon(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int CreatePolygon(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeletePolygon(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayPolygon(Tk_Canvas canvas,
@@ -172,7 +165,7 @@ static int GetPolygonIndex(Tcl_Interp *interp,
Tcl_Obj *obj, int *indexPtr);
static int PolygonCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void PolygonDeleteCoords(Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last);
static void PolygonInsert(Tk_Canvas canvas,
@@ -203,18 +196,19 @@ Tk_ItemType tkPolygonType = {
PolygonCoords, /* coordProc */
DeletePolygon, /* deleteProc */
DisplayPolygon, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
+ TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */
PolygonToPoint, /* pointProc */
PolygonToArea, /* areaProc */
PolygonToPostscript, /* postscriptProc */
ScalePolygon, /* scaleProc */
TranslatePolygon, /* translateProc */
- (Tk_ItemIndexProc *) GetPolygonIndex,/* indexProc */
+ GetPolygonIndex, /* indexProc */
NULL, /* icursorProc */
NULL, /* selectionProc */
- (Tk_ItemInsertProc *) PolygonInsert,/* insertProc */
+ PolygonInsert, /* insertProc */
PolygonDeleteCoords, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -251,13 +245,13 @@ CreatePolygon(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing polygon. */
+ Tcl_Obj *const objv[]) /* Arguments describing polygon. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -265,7 +259,7 @@ CreatePolygon(
* errors during the the remainder of this function.
*/
- Tk_CreateOutline(&(polyPtr->outline));
+ Tk_CreateOutline(&polyPtr->outline);
polyPtr->numPoints = 0;
polyPtr->pointsAllocated = 0;
polyPtr->coordPtr = NULL;
@@ -291,7 +285,8 @@ CreatePolygon(
*/
for (i = 0; i < objc; i++) {
- char *arg = Tcl_GetString(objv[i]);
+ const char *arg = Tcl_GetString(objv[i]);
+
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
}
@@ -334,7 +329,7 @@ PolygonCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i, numPoints;
@@ -361,50 +356,48 @@ PolygonCoords(
}
}
if (objc & 1) {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "wrong # coordinates: expected an even number, got %d",
- objc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "wrong # coordinates: expected an even number, got %d",
+ objc));
return TCL_ERROR;
- } else {
- numPoints = objc/2;
- if (polyPtr->pointsAllocated <= numPoints) {
- if (polyPtr->coordPtr != NULL) {
- ckfree((char *) polyPtr->coordPtr);
- }
-
- /*
- * One extra point gets allocated here, because we always add
- * another point to close the polygon.
- */
+ }
- polyPtr->coordPtr = (double *) ckalloc((unsigned)
- (sizeof(double) * (objc+2)));
- polyPtr->pointsAllocated = numPoints+1;
- }
- for (i = objc-1; i >= 0; i--) {
- if (Tk_CanvasGetCoordFromObj(interp, canvas, objv[i],
- &polyPtr->coordPtr[i]) != TCL_OK) {
- return TCL_ERROR;
- }
+ numPoints = objc/2;
+ if (polyPtr->pointsAllocated <= numPoints) {
+ if (polyPtr->coordPtr != NULL) {
+ ckfree(polyPtr->coordPtr);
}
- polyPtr->numPoints = numPoints;
- polyPtr->autoClosed = 0;
/*
- * Close the polygon if it isn't already closed.
+ * One extra point gets allocated here, because we always add
+ * another point to close the polygon.
*/
- if (objc>2 && ((polyPtr->coordPtr[objc-2] != polyPtr->coordPtr[0])
- || (polyPtr->coordPtr[objc-1] != polyPtr->coordPtr[1]))) {
- polyPtr->autoClosed = 1;
- polyPtr->numPoints++;
- polyPtr->coordPtr[objc] = polyPtr->coordPtr[0];
- polyPtr->coordPtr[objc+1] = polyPtr->coordPtr[1];
+ polyPtr->coordPtr = ckalloc(sizeof(double) * (objc+2));
+ polyPtr->pointsAllocated = numPoints+1;
+ }
+ for (i = objc-1; i >= 0; i--) {
+ if (Tk_CanvasGetCoordFromObj(interp, canvas, objv[i],
+ &polyPtr->coordPtr[i]) != TCL_OK) {
+ return TCL_ERROR;
}
- ComputePolygonBbox(canvas, polyPtr);
}
+ polyPtr->numPoints = numPoints;
+ polyPtr->autoClosed = 0;
+
+ /*
+ * Close the polygon if it isn't already closed.
+ */
+
+ if (objc>2 && ((polyPtr->coordPtr[objc-2] != polyPtr->coordPtr[0])
+ || (polyPtr->coordPtr[objc-1] != polyPtr->coordPtr[1]))) {
+ polyPtr->autoClosed = 1;
+ polyPtr->numPoints++;
+ polyPtr->coordPtr[objc] = polyPtr->coordPtr[0];
+ polyPtr->coordPtr[objc+1] = polyPtr->coordPtr[1];
+ }
+
+ ComputePolygonBbox(canvas, polyPtr);
return TCL_OK;
}
@@ -433,7 +426,7 @@ ConfigurePolygon(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Polygon item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
@@ -447,7 +440,7 @@ ConfigurePolygon(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -469,15 +462,15 @@ ConfigurePolygon(
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
}
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
- if (state==TK_STATE_HIDDEN) {
+ if (state == TK_STATE_HIDDEN) {
ComputePolygonBbox(canvas, polyPtr);
return TCL_OK;
}
- mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr, &(polyPtr->outline));
+ mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr, &polyPtr->outline);
if (mask) {
gcValues.cap_style = CapRound;
gcValues.join_style = polyPtr->joinStyle;
@@ -493,18 +486,18 @@ ConfigurePolygon(
color = polyPtr->fillColor;
stipple = polyPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->activeFillColor!=NULL) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (polyPtr->activeFillColor != NULL) {
color = polyPtr->activeFillColor;
}
- if (polyPtr->activeFillStipple!=None) {
+ if (polyPtr->activeFillStipple != None) {
stipple = polyPtr->activeFillStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->disabledFillColor!=NULL) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->disabledFillColor != NULL) {
color = polyPtr->disabledFillColor;
}
- if (polyPtr->disabledFillStipple!=None) {
+ if (polyPtr->disabledFillStipple != None) {
stipple = polyPtr->disabledFillStipple;
}
}
@@ -524,7 +517,7 @@ ConfigurePolygon(
* Mac OS X CG drawing needs access to the outline linewidth
* even for fills (as linewidth controls antialiasing).
*/
- gcValues.line_width = polyPtr->outline.gc != None ?
+ gcValues.line_width = polyPtr->outline.gc != None ?
polyPtr->outline.gc->line_width : 0;
mask |= GCLineWidth;
#endif
@@ -574,9 +567,9 @@ DeletePolygon(
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
- Tk_DeleteOutline(display,&(polyPtr->outline));
+ Tk_DeleteOutline(display, &polyPtr->outline);
if (polyPtr->coordPtr != NULL) {
- ckfree((char *) polyPtr->coordPtr);
+ ckfree(polyPtr->coordPtr);
}
if (polyPtr->fillColor != NULL) {
Tk_FreeColor(polyPtr->fillColor);
@@ -629,21 +622,22 @@ ComputePolygonBbox(
Tk_State state = polyPtr->header.state;
Tk_TSOffset *tsoffset;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = polyPtr->outline.width;
- if (polyPtr->coordPtr == NULL || (polyPtr->numPoints < 1) || (state==TK_STATE_HIDDEN)) {
+ if (polyPtr->coordPtr == NULL || (polyPtr->numPoints < 1)
+ || (state == TK_STATE_HIDDEN)) {
polyPtr->header.x1 = polyPtr->header.x2 =
- polyPtr->header.y1 = polyPtr->header.y2 = -1;
+ polyPtr->header.y1 = polyPtr->header.y2 = -1;
return;
}
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)polyPtr) {
- if (polyPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) polyPtr) {
+ if (polyPtr->outline.activeWidth > width) {
width = polyPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->outline.disabledWidth > 0.0) {
width = polyPtr->outline.disabledWidth;
}
}
@@ -669,6 +663,7 @@ ComputePolygonBbox(
tsoffset = &polyPtr->tsoffset;
if (tsoffset->flags & TK_OFFSET_INDEX) {
int index = tsoffset->flags & ~TK_OFFSET_INDEX;
+
if (tsoffset->flags == INT_MAX) {
index = (polyPtr->numPoints - polyPtr->autoClosed) * 2;
if (index < 0) {
@@ -676,7 +671,7 @@ ComputePolygonBbox(
}
}
index %= (polyPtr->numPoints - polyPtr->autoClosed) * 2;
- if (index <0) {
+ if (index < 0) {
index += (polyPtr->numPoints - polyPtr->autoClosed) * 2;
}
tsoffset->xoffset = (int) (polyPtr->coordPtr[index] + 0.5);
@@ -708,7 +703,7 @@ ComputePolygonBbox(
index = (polyPtr->numPoints - 1) * 2;
}
index %= (polyPtr->numPoints - 1) * 2;
- if (index <0) {
+ if (index < 0) {
index += (polyPtr->numPoints - 1) * 2;
}
tsoffset->xoffset = (int) (polyPtr->coordPtr[index] + 0.5);
@@ -717,21 +712,23 @@ ComputePolygonBbox(
if (tsoffset->flags & TK_OFFSET_LEFT) {
tsoffset->xoffset = polyPtr->header.x1;
} else if (tsoffset->flags & TK_OFFSET_CENTER) {
- tsoffset->xoffset = (polyPtr->header.x1 + polyPtr->header.x2)/2;
+ tsoffset->xoffset =
+ (polyPtr->header.x1 + polyPtr->header.x2) / 2;
} else if (tsoffset->flags & TK_OFFSET_RIGHT) {
tsoffset->xoffset = polyPtr->header.x2;
}
if (tsoffset->flags & TK_OFFSET_TOP) {
tsoffset->yoffset = polyPtr->header.y1;
} else if (tsoffset->flags & TK_OFFSET_MIDDLE) {
- tsoffset->yoffset = (polyPtr->header.y1 + polyPtr->header.y2)/2;
+ tsoffset->yoffset =
+ (polyPtr->header.y1 + polyPtr->header.y2) / 2;
} else if (tsoffset->flags & TK_OFFSET_BOTTOM) {
tsoffset->yoffset = polyPtr->header.y2;
}
}
}
- i = (int) ((width+1.5)/2.0);
+ i = (int) ((width+1.5) / 2.0);
polyPtr->header.x1 -= i;
polyPtr->header.x2 += i;
polyPtr->header.y1 -= i;
@@ -748,19 +745,17 @@ ComputePolygonBbox(
int j;
coordPtr = polyPtr->coordPtr;
- if (polyPtr->numPoints>3) {
+ if (polyPtr->numPoints > 3) {
if (TkGetMiterPoints(coordPtr+2*(polyPtr->numPoints-2),
- coordPtr, coordPtr+2, width,
- miter, miter+2)) {
+ coordPtr, coordPtr+2, width, miter, miter+2)) {
for (j = 0; j < 4; j += 2) {
TkIncludePoint((Tk_Item *) polyPtr, miter+j);
}
}
- }
+ }
for (i = polyPtr->numPoints ; i >= 3; i--, coordPtr += 2) {
-
- if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
- width, miter, miter+2)) {
+ if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4, width,
+ miter, miter+2)) {
for (j = 0; j < 4; j += 2) {
TkIncludePoint((Tk_Item *) polyPtr, miter+j);
}
@@ -827,7 +822,7 @@ TkFillPolygon(
if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints;
} else {
- pointPtr = (XPoint *) ckalloc((unsigned) (numPoints * sizeof(XPoint)));
+ pointPtr = ckalloc(numPoints * sizeof(XPoint));
}
for (i=0, pPtr=pointPtr ; i<numPoints; i+=1, coordPtr+=2, pPtr++) {
@@ -840,16 +835,16 @@ TkFillPolygon(
* allocated.
*/
- if (gc != None && numPoints>3) {
+ if (gc != None && numPoints > 3) {
XFillPolygon(display, drawable, gc, pointPtr, numPoints, Complex,
CoordModeOrigin);
}
if (outlineGC != None) {
- XDrawLines(display, drawable, outlineGC, pointPtr,
- numPoints, CoordModeOrigin);
+ XDrawLines(display, drawable, outlineGC, pointPtr, numPoints,
+ CoordModeOrigin);
}
if (pointPtr != staticPoints) {
- ckfree((char *) pointPtr);
+ ckfree(pointPtr);
}
}
@@ -892,17 +887,17 @@ DisplayPolygon(
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->outline.activeWidth>linewidth) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (polyPtr->outline.activeWidth > linewidth) {
linewidth = polyPtr->outline.activeWidth;
}
if (polyPtr->activeFillStipple != None) {
stipple = polyPtr->activeFillStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->outline.disabledWidth > 0.0) {
linewidth = polyPtr->outline.disabledWidth;
}
if (polyPtr->disabledFillStipple != None) {
@@ -917,10 +912,11 @@ DisplayPolygon(
if ((stipple != None) && (polyPtr->fillGC != None)) {
Tk_TSOffset *tsoffset = &polyPtr->tsoffset;
- int w=0; int h=0;
+ int w = 0, h = 0;
int flags = tsoffset->flags;
- if (!(flags & TK_OFFSET_INDEX) && (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) {
+ if (!(flags & TK_OFFSET_INDEX)
+ && (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) {
Tk_SizeOfBitmap(display, stipple, &w, &h);
if (flags & TK_OFFSET_CENTER) {
w /= 2;
@@ -939,20 +935,20 @@ DisplayPolygon(
tsoffset->xoffset += w;
tsoffset->yoffset += h;
}
- Tk_ChangeOutlineGC(canvas, itemPtr, &(polyPtr->outline));
+ Tk_ChangeOutlineGC(canvas, itemPtr, &polyPtr->outline);
- if(polyPtr->numPoints < 3) {
- short x,y;
+ if (polyPtr->numPoints < 3) {
+ short x, y;
int intLineWidth = (int) (linewidth + 0.5);
if (intLineWidth < 1) {
intLineWidth = 1;
}
Tk_CanvasDrawableCoords(canvas, polyPtr->coordPtr[0],
- polyPtr->coordPtr[1], &x,&y);
+ polyPtr->coordPtr[1], &x, &y);
XFillArc(display, drawable, polyPtr->outline.gc,
x - intLineWidth/2, y - intLineWidth/2,
- (unsigned int)intLineWidth+1, (unsigned int)intLineWidth+1,
+ (unsigned) intLineWidth+1, (unsigned) intLineWidth+1,
0, 64*360);
} else if (!polyPtr->smooth || polyPtr->numPoints < 4) {
TkFillPolygon(canvas, polyPtr->coordPtr, polyPtr->numPoints,
@@ -972,8 +968,7 @@ DisplayPolygon(
if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints;
} else {
- pointPtr = (XPoint *) ckalloc((unsigned)
- (numPoints * sizeof(XPoint)));
+ pointPtr = ckalloc(numPoints * sizeof(XPoint));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL);
@@ -986,10 +981,10 @@ DisplayPolygon(
numPoints, CoordModeOrigin);
}
if (pointPtr != staticPoints) {
- ckfree((char *) pointPtr);
+ ckfree(pointPtr);
}
}
- Tk_ResetOutlineGC(canvas, itemPtr, &(polyPtr->outline));
+ Tk_ResetOutlineGC(canvas, itemPtr, &polyPtr->outline);
if ((stipple != None) && (polyPtr->fillGC != None)) {
XSetTSOrigin(display, polyPtr->fillGC, 0, 0);
}
@@ -1026,7 +1021,7 @@ PolygonInsert(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK)
@@ -1034,21 +1029,20 @@ PolygonInsert(
return;
}
length = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- while (beforeThis>length) {
+ while (beforeThis > length) {
beforeThis -= length;
}
- while (beforeThis<0) {
+ while (beforeThis < 0) {
beforeThis += length;
}
- newCoordPtr = (double *)
- ckalloc(sizeof(double) * (unsigned)(length + 2 + objc));
+ newCoordPtr = ckalloc(sizeof(double) * (length + 2 + objc));
for (i=0; i<beforeThis; i++) {
newCoordPtr[i] = polyPtr->coordPtr[i];
}
for (i=0; i<objc; i++) {
if (Tcl_GetDoubleFromObj(NULL, objv[i],
&newCoordPtr[i+beforeThis]) != TCL_OK){
- ckfree((char *) newCoordPtr);
+ ckfree(newCoordPtr);
return;
}
}
@@ -1057,7 +1051,7 @@ PolygonInsert(
newCoordPtr[i+objc] = polyPtr->coordPtr[i];
}
if (polyPtr->coordPtr) {
- ckfree((char *) polyPtr->coordPtr);
+ ckfree(polyPtr->coordPtr);
}
length += objc;
polyPtr->coordPtr = newCoordPtr;
@@ -1084,7 +1078,7 @@ PolygonInsert(
newCoordPtr[length] = newCoordPtr[0];
newCoordPtr[length+1] = newCoordPtr[1];
- if (((length-objc)>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 with
@@ -1096,6 +1090,7 @@ PolygonInsert(
double width;
int j;
+
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
/*
@@ -1107,10 +1102,11 @@ PolygonInsert(
itemPtr->x1 = itemPtr->x2 = (int) polyPtr->coordPtr[beforeThis];
itemPtr->y1 = itemPtr->y2 = (int) polyPtr->coordPtr[beforeThis+1];
- beforeThis-=2; objc+=4;
+ beforeThis -= 2;
+ objc += 4;
if (polyPtr->smooth) {
- beforeThis-=2;
- objc+=4;
+ beforeThis -= 2;
+ objc += 4;
}
/*
@@ -1119,25 +1115,27 @@ PolygonInsert(
for (i=beforeThis; i<beforeThis+objc; i+=2) {
j = i;
- if (j<0) {
+ if (j < 0) {
j += length;
- } else if (j>=length) {
+ } else if (j >= length) {
j -= length;
}
TkIncludePoint(itemPtr, polyPtr->coordPtr+j);
}
width = polyPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (polyPtr->outline.activeWidth > width) {
width = polyPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (polyPtr->outline.disabledWidth > 0.0) {
width = polyPtr->outline.disabledWidth;
}
}
- itemPtr->x1 -= (int) width; itemPtr->y1 -= (int) width;
- itemPtr->x2 += (int) width; itemPtr->y2 += (int) width;
+ itemPtr->x1 -= (int) width;
+ itemPtr->y1 -= (int) width;
+ itemPtr->x2 += (int) width;
+ itemPtr->y2 += (int) width;
Tk_CanvasEventuallyRedraw(canvas,
itemPtr->x1, itemPtr->y1, itemPtr->x2, itemPtr->y2);
}
@@ -1173,16 +1171,16 @@ PolygonDeleteCoords(
int count, i;
int length = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- while (first>=length) {
+ while (first >= length) {
first -= length;
}
- while (first<0) {
+ while (first < 0) {
first += length;
}
- while (last>=length) {
+ while (last >= length) {
last -= length;
}
- while (last<0) {
+ while (last < 0) {
last += length;
}
@@ -1190,26 +1188,26 @@ PolygonDeleteCoords(
last &= -2;
count = last + 2 - first;
- if (count<=0) {
+ if (count <= 0) {
count += length;
}
if (count >= length) {
polyPtr->numPoints = 0;
if (polyPtr->coordPtr != NULL) {
- ckfree((char *) polyPtr->coordPtr);
+ ckfree(polyPtr->coordPtr);
polyPtr->coordPtr = NULL;
}
ComputePolygonBbox(canvas, polyPtr);
return;
}
- if (last>=first) {
- for(i=last+2; i<length; i++) {
+ if (last >= first) {
+ for (i=last+2; i<length; i++) {
polyPtr->coordPtr[i-count] = polyPtr->coordPtr[i];
}
} else {
- for(i=last; i<=first; i++) {
+ for (i=last; i<=first; i++) {
polyPtr->coordPtr[i-last] = polyPtr->coordPtr[i];
}
}
@@ -1262,15 +1260,15 @@ PolygonToPoint(
bestDist = 1.0e36;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = polyPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (polyPtr->outline.activeWidth > width) {
width = polyPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->outline.disabledWidth > 0.0) {
width = polyPtr->outline.disabledWidth;
}
}
@@ -1281,26 +1279,23 @@ PolygonToPoint(
* against which to do the check.
*/
- if ((polyPtr->smooth) && (polyPtr->numPoints>2)) {
+ if ((polyPtr->smooth) && (polyPtr->numPoints > 2)) {
numPoints = polyPtr->smooth->coordProc(canvas, NULL,
- polyPtr->numPoints, polyPtr->splineSteps, NULL,
- NULL);
+ polyPtr->numPoints, polyPtr->splineSteps, NULL, NULL);
if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace;
} else {
- polyPoints = (double *) ckalloc((unsigned)
- (2*numPoints*sizeof(double)));
+ polyPoints = ckalloc(2 * numPoints * sizeof(double));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
- polyPtr->numPoints, polyPtr->splineSteps, NULL,
- polyPoints);
+ polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints);
} else {
numPoints = polyPtr->numPoints;
polyPoints = polyPtr->coordPtr;
}
bestDist = TkPolygonToPoint(polyPoints, numPoints, pointPtr);
- if (bestDist<=0.0) {
+ if (bestDist <= 0.0) {
goto donepoint;
}
if ((polyPtr->outline.gc != None) && (polyPtr->joinStyle == JoinRound)) {
@@ -1350,16 +1345,16 @@ PolygonToPoint(
*/
if (count == numPoints) {
- TkGetButtPoints(coordPtr+2, coordPtr, (double) width,
- 0, poly, poly+2);
+ TkGetButtPoints(coordPtr+2, coordPtr, (double) width, 0, poly,
+ poly+2);
} else if ((polyPtr->joinStyle == JoinMiter) && !changedMiterToBevel) {
poly[0] = poly[6];
poly[1] = poly[7];
poly[2] = poly[4];
poly[3] = poly[5];
} else {
- TkGetButtPoints(coordPtr+2, coordPtr, (double) width, 0,
- poly, poly+2);
+ TkGetButtPoints(coordPtr+2, coordPtr, (double) width, 0, poly,
+ poly+2);
/*
* If this line uses beveled joints, then check the distance to a
@@ -1382,8 +1377,8 @@ PolygonToPoint(
}
}
if (count == 2) {
- TkGetButtPoints(coordPtr, coordPtr+2, (double) width,
- 0, poly+4, poly+6);
+ TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0, poly+4,
+ poly+6);
} else if (polyPtr->joinStyle == JoinMiter) {
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
(double) width, poly+4, poly+6) == 0) {
@@ -1392,8 +1387,8 @@ PolygonToPoint(
poly+4, poly+6);
}
} else {
- TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0,
- poly+4, poly+6);
+ TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0, poly+4,
+ poly+6);
}
poly[8] = poly[0];
poly[9] = poly[1];
@@ -1407,8 +1402,8 @@ PolygonToPoint(
}
donepoint:
- if ((polyPoints != staticSpace) && polyPoints != polyPtr->coordPtr) {
- ckfree((char *) polyPoints);
+ if (polyPoints != staticSpace && polyPoints != polyPtr->coordPtr) {
+ ckfree(polyPoints);
}
return bestDist;
}
@@ -1459,16 +1454,16 @@ PolygonToArea(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = polyPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (polyPtr->outline.activeWidth > width) {
width = polyPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->outline.disabledWidth > 0.0) {
width = polyPtr->outline.disabledWidth;
}
}
@@ -1476,9 +1471,9 @@ PolygonToArea(
radius = width/2.0;
inside = -1;
- if ((state==TK_STATE_HIDDEN) || polyPtr->numPoints<2) {
+ if ((state == TK_STATE_HIDDEN) || polyPtr->numPoints < 2) {
return -1;
- } else if (polyPtr->numPoints <3) {
+ } else if (polyPtr->numPoints < 3) {
double oval[4];
oval[0] = polyPtr->coordPtr[0]-radius;
@@ -1499,8 +1494,7 @@ PolygonToArea(
if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace;
} else {
- polyPoints = (double *)
- ckalloc((unsigned) (2*numPoints*sizeof(double)));
+ polyPoints = ckalloc(2 * numPoints * sizeof(double));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints);
@@ -1516,7 +1510,7 @@ PolygonToArea(
*/
inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
- if (inside==0) {
+ if (inside == 0) {
goto donearea;
}
@@ -1585,8 +1579,8 @@ PolygonToArea(
if (count == 2) {
TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6);
} else if (polyPtr->joinStyle == JoinMiter) {
- if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
- width, poly+4, poly+6) == 0) {
+ if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4, width,
+ poly+4, poly+6) == 0) {
changedMiterToBevel = 1;
TkGetButtPoints(coordPtr, coordPtr+2, width,0, poly+4, poly+6);
}
@@ -1603,7 +1597,7 @@ PolygonToArea(
donearea:
if ((polyPoints != staticSpace) && (polyPoints != polyPtr->coordPtr)) {
- ckfree((char *) polyPoints);
+ ckfree(polyPoints);
}
return inside;
}
@@ -1679,26 +1673,18 @@ GetPolygonIndex(
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int length;
- char *string = Tcl_GetStringFromObj(obj, &length);
+ const char *string = Tcl_GetStringFromObj(obj, &length);
if (string[0] == 'e') {
- if (strncmp(string, "end", (unsigned)length) == 0) {
- *indexPtr = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- } else {
- /*
- * Some of the paths here leave messages in interp->result, so we
- * have to clear it out before storing our own message.
- */
-
- badIndex:
- Tcl_SetResult(interp, NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
- return TCL_ERROR;
+ if (strncmp(string, "end", (unsigned)length) != 0) {
+ goto badIndex;
}
+ *indexPtr = 2*(polyPtr->numPoints - polyPtr->autoClosed);
} else if (string[0] == '@') {
int i;
- double x ,y, bestDist, dist, *coordPtr;
- char *end, *p;
+ double x, y, bestDist, dist, *coordPtr;
+ char *end;
+ const char *p;
p = string+1;
x = strtod(p, &end);
@@ -1713,9 +1699,9 @@ GetPolygonIndex(
bestDist = 1.0e36;
coordPtr = polyPtr->coordPtr;
*indexPtr = 0;
- for(i=0; i<(polyPtr->numPoints-1); i++) {
+ for (i=0; i<polyPtr->numPoints-1; i++) {
dist = hypot(coordPtr[0] - x, coordPtr[1] - y);
- if (dist<bestDist) {
+ if (dist < bestDist) {
bestDist = dist;
*indexPtr = 2*i;
}
@@ -1728,17 +1714,24 @@ GetPolygonIndex(
goto badIndex;
}
*indexPtr &= -2; /* if odd, make it even */
- if (count) {
- if (*indexPtr > 0) {
- *indexPtr = ((*indexPtr - 2) % count) + 2;
- } else {
- *indexPtr = -((-(*indexPtr)) % count);
- }
- } else {
+ if (!count) {
*indexPtr = 0;
+ } else if (*indexPtr > 0) {
+ *indexPtr = ((*indexPtr - 2) % count) + 2;
+ } else {
+ *indexPtr = -((-(*indexPtr)) % count);
}
}
return TCL_OK;
+
+ /*
+ * Some of the paths here leave messages in interp->result, so we have to
+ * clear it out before storing our own message.
+ */
+
+ badIndex:
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
+ return TCL_ERROR;
}
/*
@@ -1806,7 +1799,7 @@ PolygonToPostscript(
* being created. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
- char *style;
+ const char *style;
XColor *color;
XColor *fillColor;
Pixmap stipple;
@@ -1814,62 +1807,76 @@ PolygonToPostscript(
Tk_State state = itemPtr->state;
double width;
- if (polyPtr->numPoints<2 || polyPtr->coordPtr==NULL) {
+ if (polyPtr->numPoints < 2 || polyPtr->coordPtr == NULL) {
return TCL_OK;
}
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
width = polyPtr->outline.width;
color = polyPtr->outline.color;
stipple = polyPtr->fillStipple;
fillColor = polyPtr->fillColor;
fillStipple = polyPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (polyPtr->outline.activeWidth > width) {
width = polyPtr->outline.activeWidth;
}
- if (polyPtr->outline.activeColor!=NULL) {
+ if (polyPtr->outline.activeColor != NULL) {
color = polyPtr->outline.activeColor;
}
- if (polyPtr->outline.activeStipple!=None) {
+ if (polyPtr->outline.activeStipple != None) {
stipple = polyPtr->outline.activeStipple;
}
- if (polyPtr->activeFillColor!=NULL) {
+ if (polyPtr->activeFillColor != NULL) {
fillColor = polyPtr->activeFillColor;
}
- if (polyPtr->activeFillStipple!=None) {
+ if (polyPtr->activeFillStipple != None) {
fillStipple = polyPtr->activeFillStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (polyPtr->outline.disabledWidth > 0.0) {
width = polyPtr->outline.disabledWidth;
}
- if (polyPtr->outline.disabledColor!=NULL) {
+ if (polyPtr->outline.disabledColor != NULL) {
color = polyPtr->outline.disabledColor;
}
- if (polyPtr->outline.disabledStipple!=None) {
+ if (polyPtr->outline.disabledStipple != None) {
stipple = polyPtr->outline.disabledStipple;
}
- if (polyPtr->disabledFillColor!=NULL) {
+ if (polyPtr->disabledFillColor != NULL) {
fillColor = polyPtr->disabledFillColor;
}
- if (polyPtr->disabledFillStipple!=None) {
+ if (polyPtr->disabledFillStipple != None) {
fillStipple = polyPtr->disabledFillStipple;
}
}
- if (polyPtr->numPoints==2) {
- char string[128];
+ if (polyPtr->numPoints == 2) {
if (color == NULL) {
return TCL_OK;
}
- sprintf(string, "%.15g %.15g translate %.15g %.15g",
- polyPtr->coordPtr[0], Tk_CanvasPsY(canvas, polyPtr->coordPtr[1]),
- width/2.0, width/2.0);
- Tcl_AppendResult(interp, "matrix currentmatrix\n",string,
- " scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", NULL);
+ /*
+ * Create a point by using a small circle. (Printer pixels are too
+ * tiny to be used directly...)
+ */
+
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "matrix currentmatrix\n" /* save state */
+ "%.15g %.15g translate " /* go to drawing location */
+ "%.15g %.15g scale " /* scale the drawing */
+ "1 0 moveto " /* correct for origin */
+ "0 0 1 0 360 arc\n" /* make the circle */
+ "setmatrix\n", /* restore state */
+ polyPtr->coordPtr[0],
+ Tk_CanvasPsY(canvas, polyPtr->coordPtr[1]),
+ width/2.0, width/2.0));
+
+ /*
+ * Color it in.
+ */
+
if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) {
return TCL_ERROR;
}
@@ -1888,7 +1895,7 @@ PolygonToPostscript(
* Fill the area of the polygon.
*/
- if (fillColor != NULL && polyPtr->numPoints>3) {
+ if (fillColor != NULL && polyPtr->numPoints > 3) {
if (!polyPtr->smooth || !polyPtr->smooth->postscriptProc) {
Tk_CanvasPsPath(interp, canvas, polyPtr->coordPtr,
polyPtr->numPoints);
@@ -1932,9 +1939,8 @@ PolygonToPostscript(
} else {
style = "0";
}
- Tcl_AppendResult(interp, style," setlinejoin 1 setlinecap\n", NULL);
- if (Tk_CanvasPsOutline(canvas, itemPtr,
- &(polyPtr->outline)) != TCL_OK) {
+ Tcl_AppendResult(interp, style, " setlinejoin 1 setlinecap\n", NULL);
+ if (Tk_CanvasPsOutline(canvas, itemPtr, &polyPtr->outline) != TCL_OK){
return TCL_ERROR;
}
}
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index ac8f105..eafc07f 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -41,7 +41,6 @@ typedef struct TkColormapData { /* Hold color information for a window */
*/
typedef struct TkPostscriptInfo {
- Tk_Window tkwin; /* The canvas being printed. */
int x, y, width, height; /* Area to print, in canvas pixel
* coordinates. */
int x2, y2; /* x+width and y+height. */
@@ -72,7 +71,7 @@ typedef struct TkPostscriptInfo {
* NULL means return Postscript info as
* result. Malloc'ed. */
char *channelName; /* If -channel is specified, the name of the
- * channel to use. */
+ * channel to use. */
Tcl_Channel chan; /* Open channel corresponding to fileName. */
Tcl_HashTable fontTable; /* Hash table containing names of all font
* families used in output. The hash table
@@ -81,7 +80,11 @@ typedef struct TkPostscriptInfo {
* pre-pass that collects font information, so
* the Postscript generated isn't relevant. */
int prolog; /* Non-zero means output should contain the
- * prolog definitions in the header. */
+ * standard prolog in the header. Generated in
+ * library/mkpsenc.tcl, stored in the variable
+ * ::tk::ps_preamable [sic]. */
+ Tk_Window tkwin; /* Window to get font pixel/point transform
+ * from. */
} TkPostscriptInfo;
/*
@@ -89,40 +92,40 @@ typedef struct TkPostscriptInfo {
* canvas "postscript" command and fill in TkPostscriptInfo structures.
*/
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_STRING, "-colormap", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, colorVar), 0},
+ "", Tk_Offset(TkPostscriptInfo, colorVar), 0, NULL},
{TK_CONFIG_STRING, "-colormode", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, colorMode), 0},
+ "", Tk_Offset(TkPostscriptInfo, colorMode), 0, NULL},
{TK_CONFIG_STRING, "-file", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, fileName), 0},
+ "", Tk_Offset(TkPostscriptInfo, fileName), 0, NULL},
{TK_CONFIG_STRING, "-channel", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, channelName), 0},
+ "", Tk_Offset(TkPostscriptInfo, channelName), 0, NULL},
{TK_CONFIG_STRING, "-fontmap", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, fontVar), 0},
+ "", Tk_Offset(TkPostscriptInfo, fontVar), 0, NULL},
{TK_CONFIG_PIXELS, "-height", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, height), 0},
+ "", Tk_Offset(TkPostscriptInfo, height), 0, NULL},
{TK_CONFIG_ANCHOR, "-pageanchor", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, pageAnchor), 0},
+ "", Tk_Offset(TkPostscriptInfo, pageAnchor), 0, NULL},
{TK_CONFIG_STRING, "-pageheight", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, pageHeightString), 0},
+ "", Tk_Offset(TkPostscriptInfo, pageHeightString), 0, NULL},
{TK_CONFIG_STRING, "-pagewidth", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, pageWidthString), 0},
+ "", Tk_Offset(TkPostscriptInfo, pageWidthString), 0, NULL},
{TK_CONFIG_STRING, "-pagex", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, pageXString), 0},
+ "", Tk_Offset(TkPostscriptInfo, pageXString), 0, NULL},
{TK_CONFIG_STRING, "-pagey", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, pageYString), 0},
+ "", Tk_Offset(TkPostscriptInfo, pageYString), 0, NULL},
{TK_CONFIG_BOOLEAN, "-prolog", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, prolog), 0},
+ "", Tk_Offset(TkPostscriptInfo, prolog), 0, NULL},
{TK_CONFIG_BOOLEAN, "-rotate", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, rotate), 0},
+ "", Tk_Offset(TkPostscriptInfo, rotate), 0, NULL},
{TK_CONFIG_PIXELS, "-width", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, width), 0},
+ "", Tk_Offset(TkPostscriptInfo, width), 0, NULL},
{TK_CONFIG_PIXELS, "-x", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, x), 0},
+ "", Tk_Offset(TkPostscriptInfo, x), 0, NULL},
{TK_CONFIG_PIXELS, "-y", NULL, NULL,
- "", Tk_Offset(TkPostscriptInfo, y), 0},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ "", Tk_Offset(TkPostscriptInfo, y), 0, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -156,7 +159,7 @@ TkCanvPostscriptCmd(
TkCanvas *canvasPtr, /* Information about canvas widget. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. Caller has already parsed
+ const char **argv) /* Argument strings. Caller has already parsed
* this command enough to know that argv[1] is
* "postscript". */
{
@@ -166,14 +169,14 @@ TkCanvPostscriptCmd(
Tk_Item *itemPtr;
#define STRING_LENGTH 400
char string[STRING_LENGTH+1];
- CONST char *p;
+ const char *p;
time_t now;
size_t length;
Tk_Window tkwin = canvasPtr->tkwin;
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
Tcl_DString buffer;
- char psenccmd[] = "::tk::ensure_psenc_is_loaded";
+ Tcl_Obj *preambleObj;
int deltaX = 0, deltaY = 0; /* Offset of lower-left corner of area to be
* marked up, measured in canvas units from
* the positioning point on the page (reflects
@@ -181,17 +184,30 @@ TkCanvPostscriptCmd(
* only to stop compiler warnings. */
/*
- * Initialize the data structure describing Postscript generation, then
- * process all the arguments to fill the data structure in.
+ * Get the generic preamble. We only ever bother with the ASCII encoding;
+ * the others just make life too complicated and never actually worked as
+ * such.
*/
- result = Tcl_EvalEx(interp,psenccmd,-1,TCL_EVAL_GLOBAL);
+ result = Tcl_Eval(interp, "::tk::ensure_psenc_is_loaded");
if (result != TCL_OK) {
- return result;
+ return result;
}
+ preambleObj = Tcl_GetVar2Ex(interp, "::tk::ps_preamble", NULL,
+ TCL_LEAVE_ERR_MSG);
+ if (preambleObj == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_IncrRefCount(preambleObj);
+ Tcl_ResetResult(interp);
+
+ /*
+ * Initialize the data structure describing Postscript generation, then
+ * process all the arguments to fill the data structure in.
+ */
+
oldInfoPtr = canvasPtr->psInfo;
canvasPtr->psInfo = (Tk_PostscriptInfo) psInfoPtr;
- psInfo.tkwin = canvasPtr->tkwin;
psInfo.x = canvasPtr->xOrigin;
psInfo.y = canvasPtr->yOrigin;
psInfo.width = -1;
@@ -214,6 +230,7 @@ TkCanvPostscriptCmd(
psInfo.chan = NULL;
psInfo.prepass = 0;
psInfo.prolog = 1;
+ psInfo.tkwin = tkwin;
Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS);
result = Tk_ConfigureWidget(interp, tkwin, configSpecs, argc-2, argv+2,
(char *) &psInfo, TK_CONFIG_ARGV_ONLY);
@@ -311,28 +328,28 @@ TkCanvPostscriptCmd(
}
if (psInfo.fileName != NULL) {
- /*
- * Check that -file and -channel are not both specified.
- */
-
- if (psInfo.channelName != NULL) {
- Tcl_AppendResult(interp, "can't specify both -file",
- " and -channel", NULL);
- result = TCL_ERROR;
- goto cleanup;
- }
-
- /*
- * Check that we are not in a safe interpreter. If we are, disallow
- * the -file specification.
- */
-
- if (Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't specify -file in a",
- " safe interpreter", NULL);
- result = TCL_ERROR;
- goto cleanup;
- }
+ /*
+ * Check that -file and -channel are not both specified.
+ */
+
+ if (psInfo.channelName != NULL) {
+ Tcl_AppendResult(interp, "can't specify both -file",
+ " and -channel", NULL);
+ result = TCL_ERROR;
+ goto cleanup;
+ }
+
+ /*
+ * Check that we are not in a safe interpreter. If we are, disallow
+ * the -file specification.
+ */
+
+ if (Tcl_IsSafe(interp)) {
+ Tcl_AppendResult(interp, "can't specify -file in a",
+ " safe interpreter", NULL);
+ result = TCL_ERROR;
+ goto cleanup;
+ }
p = Tcl_TranslateFileName(interp, psInfo.fileName, &buffer);
if (p == NULL) {
@@ -346,24 +363,24 @@ TkCanvPostscriptCmd(
}
if (psInfo.channelName != NULL) {
- int mode;
-
- /*
- * Check that the channel is found in this interpreter and that it is
- * open for writing.
- */
-
- psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode);
- if (psInfo.chan == (Tcl_Channel) NULL) {
- result = TCL_ERROR;
- goto cleanup;
- }
- if ((mode & TCL_WRITABLE) == 0) {
- Tcl_AppendResult(interp, "channel \"", psInfo.channelName,
+ int mode;
+
+ /*
+ * Check that the channel is found in this interpreter and that it is
+ * open for writing.
+ */
+
+ psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode);
+ if (psInfo.chan == (Tcl_Channel) NULL) {
+ result = TCL_ERROR;
+ goto cleanup;
+ }
+ if ((mode & TCL_WRITABLE) == 0) {
+ Tcl_AppendResult(interp, "channel \"", psInfo.channelName,
"\" wasn't opened for writing", NULL);
- result = TCL_ERROR;
- goto cleanup;
- }
+ result = TCL_ERROR;
+ goto cleanup;
+ }
}
/*
@@ -384,7 +401,7 @@ TkCanvPostscriptCmd(
if (itemPtr->typePtr->postscriptProc == NULL) {
continue;
}
- result = (*itemPtr->typePtr->postscriptProc)(interp,
+ result = itemPtr->typePtr->postscriptProc(interp,
(Tk_Canvas) canvasPtr, itemPtr, 1);
Tcl_ResetResult(interp);
if (result != TCL_OK) {
@@ -394,6 +411,7 @@ TkCanvPostscriptCmd(
* can happen later that don't happen now, so we still have to
* check for errors later anyway).
*/
+
break;
}
}
@@ -454,8 +472,7 @@ TkCanvPostscriptCmd(
* Insert the prolog
*/
- Tcl_AppendResult(interp, Tcl_GetVar(interp,"::tk::ps_preamable",
- TCL_GLOBAL_ONLY), NULL);
+ Tcl_AppendResult(interp, Tcl_GetString(preambleObj), NULL);
if (psInfo.chan != NULL) {
Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
@@ -528,7 +545,7 @@ TkCanvPostscriptCmd(
continue;
}
Tcl_AppendResult(interp, "gsave\n", NULL);
- result = (*itemPtr->typePtr->postscriptProc)(interp,
+ result = itemPtr->typePtr->postscriptProc(interp,
(Tk_Canvas) canvasPtr, itemPtr, 0);
if (result != TCL_OK) {
char msg[64 + TCL_INTEGER_SPACE];
@@ -592,10 +609,11 @@ TkCanvPostscriptCmd(
Tcl_Close(interp, psInfo.chan);
}
if (psInfo.channelName != NULL) {
- ckfree(psInfo.channelName);
+ ckfree(psInfo.channelName);
}
Tcl_DeleteHashTable(&psInfo.fontTable);
canvasPtr->psInfo = (Tk_PostscriptInfo) oldInfoPtr;
+ Tcl_DecrRefCount(preambleObj);
return result;
}
@@ -641,7 +659,7 @@ Tk_PostscriptColor(
*/
if (psInfoPtr->colorVar != NULL) {
- CONST char *cmdString;
+ const char *cmdString;
cmdString = Tcl_GetVar2(interp, psInfoPtr->colorVar,
Tk_NameOfColor(colorPtr), 0);
@@ -716,18 +734,18 @@ Tk_PostscriptFont(
*/
if (psInfoPtr->fontVar != NULL) {
- CONST char *name = Tk_NameOfFont(tkfont);
+ const char *name = Tk_NameOfFont(tkfont);
Tcl_Obj **objv;
int objc;
double size;
Tcl_Obj *list = Tcl_GetVar2Ex(interp, psInfoPtr->fontVar, name, 0);
if (list != NULL) {
- CONST char *fontname;
+ const char *fontname;
if (Tcl_ListObjGetElements(interp, list, &objc, &objv) != TCL_OK
|| objc != 2
- || Tcl_GetString(objv[0])[0]=='\0'
+ || Tcl_GetString(objv[0])[0] == '\0'
|| Tcl_GetDoubleFromObj(interp, objv[1], &size) != TCL_OK
|| size <= 0) {
Tcl_ResetResult(interp);
@@ -737,7 +755,7 @@ Tk_PostscriptFont(
}
fontname = Tcl_GetString(objv[0]);
- sprintf(pointString, "%d", (int)size);
+ sprintf(pointString, "%d", (int) size);
Tcl_AppendResult(interp, "/", fontname, " findfont ",
pointString, " scalefont ", NULL);
@@ -1200,7 +1218,7 @@ TkPostscriptImage(
*/
ncolors = visual->map_entries;
- cdata.colors = (XColor *) ckalloc(sizeof(XColor) * ncolors);
+ cdata.colors = ckalloc(sizeof(XColor) * ncolors);
cdata.ncolors = ncolors;
if (visual->class == DirectColor || visual->class == TrueColor) {
@@ -1249,7 +1267,7 @@ TkPostscriptImage(
* monochrome screen, use gray or monochrome mode instead.
*/
- if (!cdata.color && level == 2) {
+ if (!cdata.color && level >= 2) {
level = 1;
}
@@ -1266,7 +1284,7 @@ TkPostscriptImage(
switch (level) {
case 0: bytesPerLine = (width + 7) / 8; maxWidth = 240000; break;
case 1: bytesPerLine = width; maxWidth = 60000; break;
- case 2: bytesPerLine = 3 * width; maxWidth = 20000; break;
+ default: bytesPerLine = 3 * width; maxWidth = 20000; break;
}
if (bytesPerLine > 60000) {
@@ -1275,7 +1293,7 @@ TkPostscriptImage(
"Can't generate Postscript for images more than %d pixels wide",
maxWidth);
Tcl_AppendResult(interp, buffer, NULL);
- ckfree((char *) cdata.colors);
+ ckfree(cdata.colors);
return TCL_ERROR;
}
@@ -1294,7 +1312,7 @@ TkPostscriptImage(
sprintf(buffer, "%d %d 8 matrix {\n<", width, rows);
Tcl_AppendResult(interp, buffer, NULL);
break;
- case 2:
+ default:
sprintf(buffer, "%d %d 8 matrix {\n<", width, rows);
Tcl_AppendResult(interp, buffer, NULL);
break;
@@ -1356,7 +1374,7 @@ TkPostscriptImage(
}
}
break;
- case 2:
+ default:
/*
* Finally, color mode. Here, just output the red, green, and
* blue values directly.
@@ -1382,14 +1400,14 @@ TkPostscriptImage(
switch (level) {
case 0: case 1:
sprintf(buffer, ">\n} image\n"); break;
- case 2:
+ default:
sprintf(buffer, ">\n} false 3 colorimage\n"); break;
}
Tcl_AppendResult(interp, buffer, NULL);
sprintf(buffer, "0 %d translate\n", rows);
Tcl_AppendResult(interp, buffer, NULL);
}
- ckfree((char *) cdata.colors);
+ ckfree(cdata.colors);
return TCL_OK;
}
@@ -1423,153 +1441,32 @@ Tk_PostscriptPhoto(
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
int colorLevel = psInfoPtr->colorLevel;
- static int codeIncluded = 0;
-
+ const char *displayOperation;
unsigned char *pixelPtr;
char buffer[256], cspace[40], decode[40];
- int bpc;
- int xx, yy, lineLen;
+ int bpc, xx, yy, lineLen, alpha;
float red, green, blue;
- int alpha;
int bytesPerLine=0, maxWidth=0;
-
unsigned char opaque = 255;
unsigned char *alphaPtr;
int alphaOffset, alphaPitch, alphaIncr;
if (psInfoPtr->prepass) {
- codeIncluded = 0;
return TCL_OK;
}
- /*
- * Define the "TkPhoto" function, which is a modified version of the
- * original "transparentimage" function posted by ian@five-d.com (Ian
- * Kemmish) to comp.lang.postscript. For a monochrome colorLevel this is a
- * slightly different version that uses the imagemask command instead of
- * image.
- */
-
- if (!codeIncluded && (colorLevel != 0)) {
+ if (colorLevel != 0) {
/*
* Color and gray-scale code.
*/
- codeIncluded = !0;
- Tcl_AppendResult(interp,
- "/TkPhoto { \n",
- " gsave \n",
- " 32 dict begin \n",
- " /tinteger exch def \n",
- " /transparent 1 string def \n",
- " transparent 0 tinteger put \n",
- " /olddict exch def \n",
- " olddict /DataSource get dup type /filetype ne { \n",
- " olddict /DataSource 3 -1 roll \n",
- " 0 () /SubFileDecode filter put \n",
- " } { \n",
- " pop \n",
- " } ifelse \n",
- " /newdict olddict maxlength dict def \n",
- " olddict newdict copy pop \n",
- " /w newdict /Width get def \n",
- " /crpp newdict /Decode get length 2 idiv def \n",
- " /str w string def \n",
- " /pix w crpp mul string def \n",
- " /substrlen 2 w log 2 log div floor exp cvi def \n",
- " /substrs [ \n",
- " { \n",
- " substrlen string \n",
- " 0 1 substrlen 1 sub { \n",
- " 1 index exch tinteger put \n",
- " } for \n",
- " /substrlen substrlen 2 idiv def \n",
- " substrlen 0 eq {exit} if \n",
- " } loop \n",
- " ] def \n",
- " /h newdict /Height get def \n",
- " 1 w div 1 h div matrix scale \n",
- " olddict /ImageMatrix get exch matrix concatmatrix \n",
- " matrix invertmatrix concat \n",
- " newdict /Height 1 put \n",
- " newdict /DataSource pix put \n",
- " /mat [w 0 0 h 0 0] def \n",
- " newdict /ImageMatrix mat put \n",
- " 0 1 h 1 sub { \n",
- " mat 5 3 -1 roll neg put \n",
- " olddict /DataSource get str readstring pop pop \n",
- " /tail str def \n",
- " /x 0 def \n",
- " olddict /DataSource get pix readstring pop pop \n",
- " { \n",
- " tail transparent search dup /done exch not def \n",
- " {exch pop exch pop} if \n",
- " /w1 exch length def \n",
- " w1 0 ne { \n",
- " newdict /DataSource ",
- " pix x crpp mul w1 crpp mul getinterval put \n",
- " newdict /Width w1 put \n",
- " mat 4 x neg put \n",
- " /x x w1 add def \n",
- " newdict image \n",
- " /tail tail w1 tail length w1 sub getinterval def \n",
- " } if \n",
- " done {exit} if \n",
- " tail substrs { \n",
- " anchorsearch {pop} if \n",
- " } forall \n",
- " /tail exch def \n",
- " tail length 0 eq {exit} if \n",
- " /x w tail length sub def \n",
- " } loop \n",
- " } for \n",
- " end \n",
- " grestore \n",
- "} bind def \n\n\n", NULL);
- } else if (!codeIncluded && (colorLevel == 0)) {
+ displayOperation = "TkPhotoColor";
+ } else {
/*
* Monochrome-only code
*/
- codeIncluded = !0;
- Tcl_AppendResult(interp,
- "/TkPhoto { \n",
- " gsave \n",
- " 32 dict begin \n",
- " /dummyInteger exch def \n",
- " /olddict exch def \n",
- " olddict /DataSource get dup type /filetype ne { \n",
- " olddict /DataSource 3 -1 roll \n",
- " 0 () /SubFileDecode filter put \n",
- " } { \n",
- " pop \n",
- " } ifelse \n",
- " /newdict olddict maxlength dict def \n",
- " olddict newdict copy pop \n",
- " /w newdict /Width get def \n",
- " /pix w 7 add 8 idiv string def \n",
- " /h newdict /Height get def \n",
- " 1 w div 1 h div matrix scale \n",
- " olddict /ImageMatrix get exch matrix concatmatrix \n",
- " matrix invertmatrix concat \n",
- " newdict /Height 1 put \n",
- " newdict /DataSource pix put \n",
- " /mat [w 0 0 h 0 0] def \n",
- " newdict /ImageMatrix mat put \n",
- " 0 1 h 1 sub { \n",
- " mat 5 3 -1 roll neg put \n",
- " 0.000 0.000 0.000 setrgbcolor \n",
- " olddict /DataSource get pix readstring pop pop \n",
- " newdict /DataSource pix put \n",
- " newdict imagemask \n",
- " 1.000 1.000 1.000 setrgbcolor \n",
- " olddict /DataSource get pix readstring pop pop \n",
- " newdict /DataSource pix put \n",
- " newdict imagemask \n",
- " } for \n",
- " end \n",
- " grestore \n",
- "} bind def \n\n\n", NULL);
+ displayOperation = "TkPhotoMono";
}
/*
@@ -1581,7 +1478,7 @@ Tk_PostscriptPhoto(
switch (colorLevel) {
case 0: bytesPerLine = (width + 7) / 8; maxWidth = 240000; break;
case 1: bytesPerLine = width; maxWidth = 60000; break;
- case 2: bytesPerLine = 3 * width; maxWidth = 20000; break;
+ default: bytesPerLine = 3 * width; maxWidth = 20000; break;
}
if (bytesPerLine > 60000) {
Tcl_ResetResult(interp);
@@ -1623,8 +1520,8 @@ Tk_PostscriptPhoto(
" /DataSource currentfile /ASCIIHexDecode filter\n", NULL);
sprintf(buffer, " /ImageMatrix [1 0 0 -1 0 %d]\n", height);
- Tcl_AppendResult(interp, buffer, " /Decode ", decode,
- "\n>>\n1 TkPhoto\n", NULL);
+ Tcl_AppendResult(interp, buffer, " /Decode ", decode, "\n>>\n1 ",
+ displayOperation, "\n", NULL);
/*
* Check the PhotoImageBlock information. We assume that:
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 24c3c7f..0861a21 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
#include "default.h"
@@ -55,6 +54,8 @@ typedef struct TextItem {
* means no word-wrap. */
int underline; /* Index of character to put underline beneath
* or -1 for no underlining. */
+ double angle; /* What angle, in degrees, to draw the text
+ * at. */
/*
* Fields whose values are derived from the current values of the
@@ -64,70 +65,69 @@ typedef struct TextItem {
int numChars; /* Length of text in characters. */
int numBytes; /* Length of text in bytes. */
Tk_TextLayout textLayout; /* Cached text layout information. */
- int leftEdge; /* Pixel location of the left edge of the text
- * item; where the left border of the text
- * layout is drawn. */
- int rightEdge; /* Pixel just to right of right edge of area
- * of text item. Used for selecting up to end
- * of line. */
+ int actualWidth; /* Width of text as computed. Used to make
+ * selections of wrapped text display
+ * right. */
+ double drawOrigin[2]; /* Where we start drawing from. */
GC gc; /* Graphics context for drawing text. */
GC selTextGC; /* Graphics context for selected text. */
GC cursorOffGC; /* If not None, this gives a graphics context
* to use to draw the insertion cursor when
* it's off. Used if the selection and
* insertion cursor colors are the same. */
+ double sine; /* Sine of angle field. */
+ double cosine; /* Cosine of angle field. */
} TextItem;
/*
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc, (ClientData) (TK_OFFSET_RELATIVE)
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE)
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_COLOR, "-activefill", NULL, NULL,
- NULL, Tk_Offset(TextItem, activeColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(TextItem, activeColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
- NULL, Tk_Offset(TextItem, activeStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(TextItem, activeStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
- "center", Tk_Offset(TextItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
+ "center", Tk_Offset(TextItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL},
+ {TK_CONFIG_DOUBLE, "-angle", NULL, NULL,
+ "0.0", Tk_Offset(TextItem, angle), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
- NULL, Tk_Offset(TextItem, disabledColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(TextItem, disabledColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
- NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- "black", Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK},
+ "black", Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_FONT, "-font", NULL, NULL,
- DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0},
+ DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0, NULL},
{TK_CONFIG_JUSTIFY, "-justify", NULL, NULL,
- "left", Tk_Offset(TextItem, justify), TK_CONFIG_DONT_SET_DEFAULT},
+ "left", Tk_Offset(TextItem, justify), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(TextItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_BITMAP, "-stipple", NULL, NULL,
- NULL, Tk_Offset(TextItem, stipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(TextItem, stipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
{TK_CONFIG_STRING, "-text", NULL, NULL,
- "", Tk_Offset(TextItem, text), 0},
+ "", Tk_Offset(TextItem, text), 0, NULL},
{TK_CONFIG_INT, "-underline", NULL, NULL,
- "-1", Tk_Offset(TextItem, underline), 0},
+ "-1", Tk_Offset(TextItem, underline), 0, NULL},
{TK_CONFIG_PIXELS, "-width", NULL, NULL,
- "0", Tk_Offset(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ "0", Tk_Offset(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -137,10 +137,10 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeTextBbox(Tk_Canvas canvas, TextItem *textPtr);
static int ConfigureText(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int CreateText(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST objv[]);
+ int argc, Tcl_Obj *const objv[]);
static void DeleteText(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayCanvText(Tk_Canvas canvas,
@@ -159,11 +159,11 @@ static void SetTextCursor(Tk_Canvas canvas,
Tk_Item *itemPtr, int index);
static int TextCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST objv[]);
+ int argc, Tcl_Obj *const objv[]);
static void TextDeleteChars(Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last);
static void TextInsert(Tk_Canvas canvas,
- Tk_Item *itemPtr, int beforeThis, char *string);
+ Tk_Item *itemPtr, int beforeThis, Tcl_Obj *obj);
static int TextToArea(Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr);
static double TextToPoint(Tk_Canvas canvas,
@@ -193,13 +193,16 @@ Tk_ItemType tkTextType = {
TextToPostscript, /* postscriptProc */
ScaleText, /* scaleProc */
TranslateText, /* translateProc */
- (Tk_ItemIndexProc *) GetTextIndex,/* indexProc */
+ GetTextIndex, /* indexProc */
SetTextCursor, /* icursorProc */
GetSelText, /* selectionProc */
TextInsert, /* insertProc */
TextDeleteChars, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
+
+#define ROUND(d) ((int) floor((d) + 0.5))
/*
*--------------------------------------------------------------
@@ -226,13 +229,13 @@ CreateText(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
+ Tcl_Obj *const objv[]) /* Arguments describing rectangle. */
{
TextItem *textPtr = (TextItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -259,15 +262,18 @@ CreateText(
textPtr->text = NULL;
textPtr->width = 0;
textPtr->underline = -1;
+ textPtr->angle = 0.0;
textPtr->numChars = 0;
textPtr->numBytes = 0;
textPtr->textLayout = NULL;
- textPtr->leftEdge = 0;
- textPtr->rightEdge = 0;
+ textPtr->actualWidth = 0;
+ textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0;
textPtr->gc = None;
textPtr->selTextGC = None;
textPtr->cursorOffGC = None;
+ textPtr->sine = 0.0;
+ textPtr->cosine = 1.0;
/*
* Process the arguments to fill in the item record. Only 1 (list) or 2 (x
@@ -277,7 +283,7 @@ CreateText(
if (objc == 1) {
i = 1;
} else {
- char *arg = Tcl_GetString(objv[1]);
+ const char *arg = Tcl_GetString(objv[1]);
i = 2;
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
@@ -320,28 +326,26 @@ TextCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
TextItem *textPtr = (TextItem *) itemPtr;
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 (objc < 3) {
- if (objc==1) {
+ if (objc == 1) {
if (Tcl_ListObjGetElements(interp, objv[0], &objc,
(Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
} else if (objc != 2) {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "wrong # coordinates: expected 2, got %d", objc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "wrong # coordinates: expected 2, got %d", objc));
return TCL_ERROR;
}
}
@@ -353,10 +357,8 @@ TextCoords(
}
ComputeTextBbox(canvas, textPtr);
} else {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "wrong # coordinates: expected 0 or 2, got %d", objc));
return TCL_ERROR;
}
return TCL_OK;
@@ -387,7 +389,7 @@ ConfigureText(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Rectangle item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
TextItem *textPtr = (TextItem *) itemPtr;
@@ -403,7 +405,7 @@ ConfigureText(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -420,24 +422,24 @@ ConfigureText(
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
}
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
color = textPtr->color;
stipple = textPtr->stipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (textPtr->activeColor!=NULL) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (textPtr->activeColor != NULL) {
color = textPtr->activeColor;
}
- if (textPtr->activeStipple!=None) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (textPtr->disabledColor!=NULL) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple!=None) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
@@ -493,7 +495,6 @@ ConfigureText(
}
textPtr->cursorOffGC = newGC;
-
/*
* If the text was changed, move the selection and insertion indices to
* keep them inside the item.
@@ -519,6 +520,22 @@ ConfigureText(
textPtr->insertPos = textPtr->numChars;
}
+ /*
+ * Restrict so that 0.0 <= angle < 360.0, and then recompute the cached
+ * sine and cosine of the angle. Note that fmod() can produce negative
+ * results, and we try to avoid negative zero as well.
+ */
+
+ textPtr->angle = fmod(textPtr->angle, 360.0);
+ if (textPtr->angle < 0.0) {
+ textPtr->angle += 360.0;
+ }
+ if (textPtr->angle == 0.0) {
+ textPtr->angle = 0.0;
+ }
+ textPtr->sine = sin(textPtr->angle * PI/180.0);
+ textPtr->cosine = cos(textPtr->angle * PI/180.0);
+
ComputeTextBbox(canvas, textPtr);
return TCL_OK;
}
@@ -609,11 +626,12 @@ ComputeTextBbox(
TextItem *textPtr) /* Item whose bbox is to be recomputed. */
{
Tk_CanvasTextInfo *textInfoPtr;
- int leftX, topY, width, height, fudge;
+ int leftX, topY, width, height, fudge, i;
Tk_State state = textPtr->header.state;
+ double x[4], y[4], dx[4], dy[4], sinA, cosA, tmp;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
Tk_FreeTextLayout(textPtr->textLayout);
@@ -630,8 +648,11 @@ ComputeTextBbox(
* bounding box for the text item.
*/
- leftX = (int) floor(textPtr->x + 0.5);
- topY = (int) floor(textPtr->y + 0.5);
+ leftX = ROUND(textPtr->x);
+ topY = ROUND(textPtr->y);
+ for (i=0 ; i<4 ; i++) {
+ dx[i] = dy[i] = 0.0;
+ }
switch (textPtr->anchor) {
case TK_ANCHOR_NW:
case TK_ANCHOR_N:
@@ -642,12 +663,18 @@ ComputeTextBbox(
case TK_ANCHOR_CENTER:
case TK_ANCHOR_E:
topY -= height / 2;
+ for (i=0 ; i<4 ; i++) {
+ dy[i] = -height / 2;
+ }
break;
case TK_ANCHOR_SW:
case TK_ANCHOR_S:
case TK_ANCHOR_SE:
topY -= height;
+ for (i=0 ; i<4 ; i++) {
+ dy[i] = -height;
+ }
break;
}
switch (textPtr->anchor) {
@@ -660,17 +687,27 @@ ComputeTextBbox(
case TK_ANCHOR_CENTER:
case TK_ANCHOR_S:
leftX -= width / 2;
+ for (i=0 ; i<4 ; i++) {
+ dx[i] = -width / 2;
+ }
break;
case TK_ANCHOR_NE:
case TK_ANCHOR_E:
case TK_ANCHOR_SE:
leftX -= width;
+ for (i=0 ; i<4 ; i++) {
+ dx[i] = -width;
+ }
break;
}
- textPtr->leftEdge = leftX;
- textPtr->rightEdge = leftX + width;
+ textPtr->actualWidth = width;
+
+ sinA = textPtr->sine;
+ cosA = textPtr->cosine;
+ textPtr->drawOrigin[0] = textPtr->x + dx[0]*cosA + dy[0]*sinA;
+ textPtr->drawOrigin[1] = textPtr->y + dy[0]*cosA - dx[0]*sinA;
/*
* Last of all, update the bounding box for the item. The item's bounding
@@ -683,10 +720,50 @@ ComputeTextBbox(
if (textInfoPtr->selBorderWidth > fudge) {
fudge = textInfoPtr->selBorderWidth;
}
- textPtr->header.x1 = leftX - fudge;
- textPtr->header.y1 = topY;
- textPtr->header.x2 = leftX + width + fudge;
- textPtr->header.y2 = topY + height;
+
+ /*
+ * Apply the rotation before computing the bounding box.
+ */
+
+ dx[0] -= fudge;
+ dx[1] += width + fudge;
+ dx[2] += width + fudge;
+ dy[2] += height;
+ dx[3] -= fudge;
+ dy[3] += height;
+ for (i=0 ; i<4 ; i++) {
+ x[i] = textPtr->x + dx[i] * cosA + dy[i] * sinA;
+ y[i] = textPtr->y + dy[i] * cosA - dx[i] * sinA;
+ }
+
+ /*
+ * Convert to a rectilinear bounding box.
+ */
+
+ for (i=1,tmp=x[0] ; i<4 ; i++) {
+ if (x[i] < tmp) {
+ tmp = x[i];
+ }
+ }
+ textPtr->header.x1 = ROUND(tmp);
+ for (i=1,tmp=y[0] ; i<4 ; i++) {
+ if (y[i] < tmp) {
+ tmp = y[i];
+ }
+ }
+ textPtr->header.y1 = ROUND(tmp);
+ for (i=1,tmp=x[0] ; i<4 ; i++) {
+ if (x[i] > tmp) {
+ tmp = x[i];
+ }
+ }
+ textPtr->header.x2 = ROUND(tmp);
+ for (i=1,tmp=y[0] ; i<4 ; i++) {
+ if (y[i] > tmp) {
+ tmp = y[i];
+ }
+ }
+ textPtr->header.y2 = ROUND(tmp);
}
/*
@@ -726,16 +803,16 @@ DisplayCanvText(
textPtr = (TextItem *) itemPtr;
textInfoPtr = textPtr->textInfoPtr;
- if(state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ if (state == TK_STATE_NULL) {
+ state = Canvas(canvas)->canvas_state;
}
stipple = textPtr->stipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (textPtr->activeStipple!=None) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (textPtr->disabledStipple!=None) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
@@ -756,6 +833,8 @@ DisplayCanvText(
selFirstChar = -1;
selLastChar = 0; /* lint. */
+ Tk_CanvasDrawableCoords(canvas, textPtr->drawOrigin[0],
+ textPtr->drawOrigin[1], &drawableX, &drawableY);
if (textInfoPtr->selItemPtr == itemPtr) {
selFirstChar = textInfoPtr->selectFirst;
@@ -786,20 +865,30 @@ DisplayCanvText(
x = xFirst;
height = hFirst;
for (y = yFirst ; y <= yLast; y += height) {
+ int dx1, dy1, dx2, dy2;
+ double s = textPtr->sine, c = textPtr->cosine;
+ XPoint points[4];
+
if (y == yLast) {
width = xLast + wLast - x;
} else {
- width = textPtr->rightEdge - textPtr->leftEdge - x;
+ width = textPtr->actualWidth - x;
}
- Tk_CanvasDrawableCoords(canvas,
- (double) (textPtr->leftEdge + x
- - textInfoPtr->selBorderWidth),
- (double) (textPtr->header.y1 + y),
- &drawableX, &drawableY);
- Tk_Fill3DRectangle(Tk_CanvasTkwin(canvas), drawable,
- textInfoPtr->selBorder, drawableX, drawableY,
- width + 2 * textInfoPtr->selBorderWidth,
- height, textInfoPtr->selBorderWidth, TK_RELIEF_RAISED);
+ dx1 = x - textInfoPtr->selBorderWidth;
+ dy1 = y;
+ dx2 = width + 2 * textInfoPtr->selBorderWidth;
+ dy2 = height;
+ points[0].x = (short)(drawableX + dx1*c + dy1*s);
+ points[0].y = (short)(drawableY + dy1*c - dx1*s);
+ points[1].x = (short)(drawableX + (dx1+dx2)*c + dy1*s);
+ points[1].y = (short)(drawableY + dy1*c - (dx1+dx2)*s);
+ points[2].x = (short)(drawableX + (dx1+dx2)*c + (dy1+dy2)*s);
+ points[2].y = (short)(drawableY + (dy1+dy2)*c - (dx1+dx2)*s);
+ points[3].x = (short)(drawableX + dx1*c + (dy1+dy2)*s);
+ points[3].y = (short)(drawableY + (dy1+dy2)*c - dx1*s);
+ Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable,
+ textInfoPtr->selBorder, points, 4,
+ textInfoPtr->selBorderWidth, TK_RELIEF_RAISED);
x = 0;
}
}
@@ -817,18 +906,28 @@ DisplayCanvText(
if ((textInfoPtr->focusItemPtr == itemPtr) && (textInfoPtr->gotFocus)) {
if (Tk_CharBbox(textPtr->textLayout, textPtr->insertPos,
&x, &y, NULL, &height)) {
- Tk_CanvasDrawableCoords(canvas,
- (double) (textPtr->leftEdge + x
- - (textInfoPtr->insertWidth / 2)),
- (double) (textPtr->header.y1 + y),
- &drawableX, &drawableY);
- Tk_SetCaretPos(Tk_CanvasTkwin(canvas), drawableX, drawableY,
+ int dx1, dy1, dx2, dy2;
+ double s = textPtr->sine, c = textPtr->cosine;
+ XPoint points[4];
+
+ dx1 = x - (textInfoPtr->insertWidth / 2);
+ dy1 = y;
+ dx2 = textInfoPtr->insertWidth;
+ dy2 = height;
+ points[0].x = (short)(drawableX + dx1*c + dy1*s);
+ points[0].y = (short)(drawableY + dy1*c - dx1*s);
+ points[1].x = (short)(drawableX + (dx1+dx2)*c + dy1*s);
+ points[1].y = (short)(drawableY + dy1*c - (dx1+dx2)*s);
+ points[2].x = (short)(drawableX + (dx1+dx2)*c + (dy1+dy2)*s);
+ points[2].y = (short)(drawableY + (dy1+dy2)*c - (dx1+dx2)*s);
+ points[3].x = (short)(drawableX + dx1*c + (dy1+dy2)*s);
+ points[3].y = (short)(drawableY + (dy1+dy2)*c - dx1*s);
+
+ Tk_SetCaretPos(Tk_CanvasTkwin(canvas), points[0].x, points[0].y,
height);
if (textInfoPtr->cursorOn) {
- Tk_Fill3DRectangle(Tk_CanvasTkwin(canvas), drawable,
- textInfoPtr->insertBorder,
- drawableX, drawableY,
- textInfoPtr->insertWidth, height,
+ Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable,
+ textInfoPtr->insertBorder, points, 4,
textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED);
} else if (textPtr->cursorOffGC != None) {
/*
@@ -838,10 +937,8 @@ DisplayCanvText(
* where both may be drawn in the same color.
*/
- XFillRectangle(display, drawable, textPtr->cursorOffGC,
- drawableX, drawableY,
- (unsigned) textInfoPtr->insertWidth,
- (unsigned) height);
+ XFillPolygon(display, drawable, textPtr->cursorOffGC,
+ points, 4, Convex, CoordModeOrigin);
}
}
}
@@ -856,23 +953,24 @@ DisplayCanvText(
* anti-aliasing colors would blend together.
*/
- Tk_CanvasDrawableCoords(canvas, (double) textPtr->leftEdge,
- (double) textPtr->header.y1, &drawableX, &drawableY);
-
if ((selFirstChar >= 0) && (textPtr->selTextGC != textPtr->gc)) {
- Tk_DrawTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
- drawableX, drawableY, 0, selFirstChar);
- Tk_DrawTextLayout(display, drawable, textPtr->selTextGC,
- textPtr->textLayout, drawableX, drawableY, selFirstChar,
- selLastChar + 1);
- Tk_DrawTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
- drawableX, drawableY, selLastChar + 1, -1);
+ TkDrawAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ 0, selFirstChar);
+ TkDrawAngledTextLayout(display, drawable, textPtr->selTextGC,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ selFirstChar, selLastChar + 1);
+ TkDrawAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ selLastChar + 1, -1);
} else {
- Tk_DrawTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
- drawableX, drawableY, 0, -1);
+ TkDrawAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ 0, -1);
}
- Tk_UnderlineTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
- drawableX, drawableY, textPtr->underline);
+ TkUnderlineAngledTextLayout(display, drawable, textPtr->gc,
+ textPtr->textLayout, drawableX, drawableY, textPtr->angle,
+ textPtr->underline);
if (stipple != None) {
XSetTSOrigin(display, textPtr->gc, 0, 0);
@@ -880,7 +978,7 @@ DisplayCanvText(
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TextInsert --
*
@@ -893,7 +991,7 @@ DisplayCanvText(
* The text in the given item is modified. The cursor and selection
* positions are also modified to reflect the insertion.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
@@ -902,14 +1000,15 @@ TextInsert(
Tk_Item *itemPtr, /* Text item to be modified. */
int index, /* Character index before which string is to
* be inserted. */
- char *string) /* New characters to be inserted. */
+ Tcl_Obj *obj) /* New characters to be inserted. */
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteIndex, byteCount, charsAdded;
char *newStr, *text;
+ const char *string;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
- string = Tcl_GetStringFromObj((Tcl_Obj *) string, &byteCount);
+ string = Tcl_GetStringFromObj(obj, &byteCount);
text = textPtr->text;
@@ -925,7 +1024,7 @@ TextInsert(
return;
}
- newStr = (char *) ckalloc((unsigned) textPtr->numBytes + byteCount + 1);
+ newStr = ckalloc(textPtr->numBytes + byteCount + 1);
memcpy(newStr, text, (size_t) byteIndex);
strcpy(newStr + byteIndex, string);
strcpy(newStr + byteIndex + byteCount, text + byteIndex);
@@ -1006,7 +1105,7 @@ TextDeleteChars(
byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved)
- (text + byteIndex);
- newStr = (char *) ckalloc((unsigned) (textPtr->numBytes + 1 - byteCount));
+ newStr = ckalloc(textPtr->numBytes + 1 - byteCount);
memcpy(newStr, text, (size_t) byteIndex);
strcpy(newStr + byteIndex, text + byteIndex + byteCount);
@@ -1082,15 +1181,17 @@ TextToPoint(
{
TextItem *textPtr;
Tk_State state = itemPtr->state;
- double value;
+ double value, px, py;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
textPtr = (TextItem *) itemPtr;
+ px = pointPtr[0] - textPtr->drawOrigin[0];
+ py = pointPtr[1] - textPtr->drawOrigin[1];
value = (double) Tk_DistanceToTextLayout(textPtr->textLayout,
- (int) pointPtr[0] - textPtr->leftEdge,
- (int) pointPtr[1] - textPtr->header.y1);
+ (int) (px*textPtr->cosine - py*textPtr->sine),
+ (int) (py*textPtr->cosine + px*textPtr->sine));
if ((state == TK_STATE_HIDDEN) || (textPtr->color == NULL) ||
(textPtr->text == NULL) || (*textPtr->text == 0)) {
@@ -1130,15 +1231,16 @@ TextToArea(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
textPtr = (TextItem *) itemPtr;
- return Tk_IntersectTextLayout(textPtr->textLayout,
- (int) (rectPtr[0] + 0.5) - textPtr->leftEdge,
- (int) (rectPtr[1] + 0.5) - textPtr->header.y1,
+ return TkIntersectAngledTextLayout(textPtr->textLayout,
+ (int) ((rectPtr[0] + 0.5) - textPtr->drawOrigin[0]),
+ (int) ((rectPtr[1] + 0.5) - textPtr->drawOrigin[1]),
(int) (rectPtr[2] - rectPtr[0] + 0.5),
- (int) (rectPtr[3] - rectPtr[1] + 0.5));
+ (int) (rectPtr[3] - rectPtr[1] + 0.5),
+ textPtr->angle);
}
/*
@@ -1242,7 +1344,7 @@ GetTextIndex(
int c;
TkCanvas *canvasPtr = (TkCanvas *) canvas;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
- char *string = Tcl_GetStringFromObj(obj, &length);
+ const char *string = Tcl_GetStringFromObj(obj, &length);
c = string[0];
@@ -1267,8 +1369,9 @@ GetTextIndex(
*indexPtr = textInfoPtr->selectLast;
} else if (c == '@') {
int x, y;
- double tmp;
- char *end, *p;
+ double tmp, c = textPtr->cosine, s = textPtr->sine;
+ char *end;
+ const char *p;
p = string+1;
tmp = strtod(p, &end);
@@ -1282,11 +1385,12 @@ GetTextIndex(
goto badIndex;
}
y = (int) ((tmp < 0) ? tmp - 0.5 : tmp + 0.5);
+ x += canvasPtr->scrollX1 - (int) textPtr->drawOrigin[0];
+ y += canvasPtr->scrollY1 - (int) textPtr->drawOrigin[1];
*indexPtr = Tk_PointToChar(textPtr->textLayout,
- x + canvasPtr->scrollX1 - textPtr->leftEdge,
- y + canvasPtr->scrollY1 - textPtr->header.y1);
+ (int) (x*c - y*s), (int) (y*c + x*s));
} else if (Tcl_GetIntFromObj(NULL, obj, indexPtr) == TCL_OK) {
- if (*indexPtr < 0){
+ if (*indexPtr < 0) {
*indexPtr = 0;
} else if (*indexPtr > textPtr->numChars) {
*indexPtr = textPtr->numChars;
@@ -1298,8 +1402,7 @@ GetTextIndex(
*/
badIndex:
- Tcl_SetResult(interp, NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
return TCL_ERROR;
}
return TCL_OK;
@@ -1375,7 +1478,7 @@ GetSelText(
TextItem *textPtr = (TextItem *) itemPtr;
int byteCount;
char *text;
- CONST char *selStart, *selEnd;
+ const char *selStart, *selEnd;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
if ((textInfoPtr->selectFirst < 0) ||
@@ -1427,34 +1530,33 @@ TextToPostscript(
* being created. */
{
TextItem *textPtr = (TextItem *) itemPtr;
- int x, y;
+ double x, y;
Tk_FontMetrics fm;
- char *justify;
- char buffer[500];
+ const char *justify;
XColor *color;
Pixmap stipple;
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
color = textPtr->color;
stipple = textPtr->stipple;
if (state == TK_STATE_HIDDEN || textPtr->color == NULL ||
textPtr->text == NULL || *textPtr->text == 0) {
return TCL_OK;
- } else if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (textPtr->activeColor!=NULL) {
+ } else if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (textPtr->activeColor != NULL) {
color = textPtr->activeColor;
}
- if (textPtr->activeStipple!=None) {
+ if (textPtr->activeStipple != None) {
stipple = textPtr->activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
- if (textPtr->disabledColor!=NULL) {
+ } else if (state == TK_STATE_DISABLED) {
+ if (textPtr->disabledColor != NULL) {
color = textPtr->disabledColor;
}
- if (textPtr->disabledStipple!=None) {
+ if (textPtr->disabledStipple != None) {
stipple = textPtr->disabledStipple;
}
}
@@ -1474,9 +1576,8 @@ TextToPostscript(
Tcl_AppendResult(interp, "} bind def\n", NULL);
}
- sprintf(buffer, "%.15g %.15g [\n", textPtr->x,
- Tk_CanvasPsY(canvas, textPtr->y));
- Tcl_AppendResult(interp, buffer, NULL);
+ Tcl_AppendPrintfToObj(Tcl_GetObjResult(interp), "%.15g %.15g %.15g [\n",
+ textPtr->angle, textPtr->x, Tk_CanvasPsY(canvas, textPtr->y));
Tk_TextLayoutToPostscript(interp, textPtr->textLayout);
@@ -1499,15 +1600,10 @@ TextToPostscript(
}
Tk_GetFontMetrics(textPtr->tkfont, &fm);
- sprintf(buffer, "] %d ", fm.linespace);
- Tcl_AppendResult(interp, buffer, NULL);
- Tcl_PrintDouble(NULL, x / -2.0, buffer);
- Tcl_AppendResult(interp, buffer, NULL);
- Tcl_PrintDouble(NULL, y / 2.0, buffer);
- Tcl_AppendResult(interp, " ", buffer, NULL);
- sprintf(buffer, " %s %s DrawText\n",
- justify, ((stipple == None) ? "false" : "true"));
- Tcl_AppendResult(interp, buffer, NULL);
+ Tcl_AppendPrintfToObj(Tcl_GetObjResult(interp),
+ "] %d %g %g %s %s DrawText\n",
+ fm.linespace, x / -2.0, y / 2.0, justify,
+ ((stipple == None) ? "false" : "true"));
return TCL_OK;
}
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index eca3789..1a6a8c4 100644
--- a/generic/tkCanvUtil.c
+++ b/generic/tkCanvUtil.c
@@ -25,13 +25,13 @@ typedef struct SmoothAssocData {
* option. */
} SmoothAssocData;
-Tk_SmoothMethod tkBezierSmoothMethod = {
+const Tk_SmoothMethod tkBezierSmoothMethod = {
"true",
TkMakeBezierCurve,
(void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
int numPoints, int numSteps)) TkMakeBezierPostscript,
};
-static Tk_SmoothMethod tkRawSmoothMethod = {
+static const Tk_SmoothMethod tkRawSmoothMethod = {
"raw",
TkMakeRawCurve,
(void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
@@ -45,7 +45,7 @@ static Tk_SmoothMethod tkRawSmoothMethod = {
static void SmoothMethodCleanupProc(ClientData clientData,
Tcl_Interp *interp);
static SmoothAssocData *InitSmoothMethods(Tcl_Interp *interp);
-static int DashConvert(char *l, CONST char *p, int n,
+static int DashConvert(char *l, const char *p, int n,
double width);
static void TranslateAndAppendCoords(TkCanvas *canvPtr,
double x, double y, XPoint *outArr, int numOut);
@@ -73,8 +73,7 @@ Tk_Window
Tk_CanvasTkwin(
Tk_Canvas canvas) /* Token for the canvas. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
- return canvasPtr->tkwin;
+ return Canvas(canvas)->tkwin;
}
/*
@@ -106,10 +105,9 @@ Tk_CanvasDrawableCoords(
short *drawableXPtr, /* Screen coordinates are stored here. */
short *drawableYPtr)
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
double tmp;
- tmp = x - canvasPtr->drawableXOrigin;
+ tmp = x - Canvas(canvas)->drawableXOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -123,7 +121,7 @@ Tk_CanvasDrawableCoords(
*drawableXPtr = (short) tmp;
}
- tmp = y - canvasPtr->drawableYOrigin;
+ tmp = y - Canvas(canvas)->drawableYOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -166,10 +164,9 @@ Tk_CanvasWindowCoords(
short *screenXPtr, /* Screen coordinates are stored here. */
short *screenYPtr)
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
double tmp;
- tmp = x - canvasPtr->xOrigin;
+ tmp = x - Canvas(canvas)->xOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -183,7 +180,7 @@ Tk_CanvasWindowCoords(
*screenXPtr = (short) tmp;
}
- tmp = y - canvasPtr->yOrigin;
+ tmp = y - Canvas(canvas)->yOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -222,17 +219,15 @@ int
Tk_CanvasGetCoord(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Canvas canvas, /* Canvas to which coordinate applies. */
- CONST char *string, /* Describes coordinate (any screen coordinate
+ const char *string, /* Describes coordinate (any screen coordinate
* form may be used here). */
double *doublePtr) /* Place to store converted coordinate. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
-
- if (Tk_GetScreenMM(canvasPtr->interp, canvasPtr->tkwin, string,
+ if (Tk_GetScreenMM(Canvas(canvas)->interp, Canvas(canvas)->tkwin, string,
doublePtr) != TCL_OK) {
return TCL_ERROR;
}
- *doublePtr *= canvasPtr->pixelsPerMM;
+ *doublePtr *= Canvas(canvas)->pixelsPerMM;
return TCL_OK;
}
@@ -264,9 +259,7 @@ Tk_CanvasGetCoordFromObj(
* form may be used here). */
double *doublePtr) /* Place to store converted coordinate. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
-
- return Tk_GetDoublePixelsFromObj(canvasPtr->interp, canvasPtr->tkwin, obj, doublePtr);
+ return Tk_GetDoublePixelsFromObj(Canvas(canvas)->interp, Canvas(canvas)->tkwin, obj, doublePtr);
}
/*
@@ -294,10 +287,9 @@ Tk_CanvasSetStippleOrigin(
* to draw a stippled pattern as part of
* redisplaying the canvas. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
-
- XSetTSOrigin(canvasPtr->display, gc, -canvasPtr->drawableXOrigin,
- -canvasPtr->drawableYOrigin);
+ XSetTSOrigin(Canvas(canvas)->display, gc,
+ -Canvas(canvas)->drawableXOrigin,
+ -Canvas(canvas)->drawableYOrigin);
}
/*
@@ -326,7 +318,7 @@ Tk_CanvasSetOffset(
* redisplaying the canvas. */
Tk_TSOffset *offset) /* Offset (may be NULL pointer)*/
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
+ register TkCanvas *canvasPtr = Canvas(canvas);
int flags = 0;
int x = - canvasPtr->drawableXOrigin;
int y = - canvasPtr->drawableYOrigin;
@@ -370,7 +362,7 @@ Tk_CanvasTextInfo *
Tk_CanvasGetTextInfo(
Tk_Canvas canvas) /* Token for the canvas widget. */
{
- return &((TkCanvas *) canvas)->textInfo;
+ return &Canvas(canvas)->textInfo;
}
/*
@@ -396,13 +388,13 @@ Tk_CanvasTagsParseProc(
ClientData clientData, /* Not used.*/
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */
- CONST char *value, /* Value of option (list of tag names). */
+ 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;
- CONST char **argv;
+ const char **argv;
Tk_Uid *newPtr;
/*
@@ -418,12 +410,12 @@ Tk_CanvasTagsParseProc(
*/
if (itemPtr->tagSpace < argc) {
- newPtr = (Tk_Uid *) ckalloc((unsigned) (argc * sizeof(Tk_Uid)));
+ newPtr = ckalloc(argc * sizeof(Tk_Uid));
for (i = itemPtr->numTags-1; i >= 0; i--) {
newPtr[i] = itemPtr->tagPtr[i];
}
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
- ckfree((char *) itemPtr->tagPtr);
+ ckfree(itemPtr->tagPtr);
}
itemPtr->tagPtr = newPtr;
itemPtr->tagSpace = argc;
@@ -432,7 +424,7 @@ Tk_CanvasTagsParseProc(
for (i = 0; i < argc; i++) {
itemPtr->tagPtr[i] = Tk_GetUid(argv[i]);
}
- ckfree((char *) argv);
+ ckfree(argv);
return TCL_OK;
}
@@ -458,7 +450,7 @@ Tk_CanvasTagsParseProc(
*--------------------------------------------------------------
*/
-char *
+const char *
Tk_CanvasTagsPrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -476,10 +468,10 @@ Tk_CanvasTagsPrintProc(
}
if (itemPtr->numTags == 1) {
*freeProcPtr = NULL;
- return (char *) itemPtr->tagPtr[0];
+ return (const char *) itemPtr->tagPtr[0];
}
*freeProcPtr = TCL_DYNAMIC;
- return Tcl_Merge(itemPtr->numTags, (CONST char **) itemPtr->tagPtr);
+ return Tcl_Merge(itemPtr->numTags, (const char **) itemPtr->tagPtr);
}
/*
@@ -505,11 +497,11 @@ TkCanvasDashParseProc(
ClientData clientData, /* Not used.*/
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */
- CONST char *value, /* Value of option. */
+ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */
{
- return Tk_GetDash(interp, value, (Tk_Dash *)(widgRec+offset));
+ return Tk_GetDash(interp, value, (Tk_Dash *) (widgRec+offset));
}
/*
@@ -534,7 +526,7 @@ TkCanvasDashParseProc(
*--------------------------------------------------------------
*/
-char *
+const char *
TkCanvasDashPrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -545,14 +537,13 @@ TkCanvasDashPrintProc(
* for return string. */
{
Tk_Dash *dash = (Tk_Dash *) (widgRec+offset);
- char *buffer;
- char *p;
+ char *buffer, *p;
int i = dash->number;
if (i < 0) {
i = -i;
*freeProcPtr = TCL_DYNAMIC;
- buffer = (char *) ckalloc((unsigned int) (i+1));
+ buffer = ckalloc(i + 1);
p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
memcpy(buffer, p, (unsigned int) i);
buffer[i] = 0;
@@ -561,12 +552,12 @@ TkCanvasDashPrintProc(
*freeProcPtr = NULL;
return "";
}
- buffer = (char *)ckalloc((unsigned int) (4*i));
+ buffer = ckalloc(4 * i);
*freeProcPtr = TCL_DYNAMIC;
p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
sprintf(buffer, "%d", *p++ & 0xff);
- while(--i) {
+ while (--i) {
sprintf(buffer+strlen(buffer), " %d", *p++ & 0xff);
}
return buffer;
@@ -597,21 +588,18 @@ InitSmoothMethods(
{
SmoothAssocData *methods, *ptr;
- methods = (SmoothAssocData *) ckalloc(sizeof(SmoothAssocData));
+ methods = ckalloc(sizeof(SmoothAssocData));
methods->smooth.name = tkRawSmoothMethod.name;
methods->smooth.coordProc = tkRawSmoothMethod.coordProc;
methods->smooth.postscriptProc = tkRawSmoothMethod.postscriptProc;
- methods->nextPtr = (SmoothAssocData *) ckalloc(sizeof(SmoothAssocData));
-
- ptr = methods->nextPtr;
+ ptr = methods->nextPtr = ckalloc(sizeof(SmoothAssocData));
ptr->smooth.name = tkBezierSmoothMethod.name;
ptr->smooth.coordProc = tkBezierSmoothMethod.coordProc;
ptr->smooth.postscriptProc = tkBezierSmoothMethod.postscriptProc;
ptr->nextPtr = NULL;
- Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc,
- (ClientData) methods);
+ Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc,methods);
return methods;
}
@@ -636,11 +624,10 @@ InitSmoothMethods(
void
Tk_CreateSmoothMethod(
Tcl_Interp *interp,
- Tk_SmoothMethod *smooth)
+ const Tk_SmoothMethod *smooth)
{
SmoothAssocData *methods, *typePtr2, *prevPtr, *ptr;
- methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod",
- NULL);
+ methods = Tcl_GetAssocData(interp, "smoothMethod", NULL);
/*
* Initialize if we were not previously initialized.
@@ -662,17 +649,16 @@ Tk_CreateSmoothMethod(
} else {
prevPtr->nextPtr = typePtr2->nextPtr;
}
- ckfree((char *) typePtr2);
+ ckfree(typePtr2);
break;
}
}
- ptr = (SmoothAssocData *) ckalloc(sizeof(SmoothAssocData));
+ ptr = ckalloc(sizeof(SmoothAssocData));
ptr->smooth.name = smooth->name;
ptr->smooth.coordProc = smooth->coordProc;
ptr->smooth.postscriptProc = smooth->postscriptProc;
ptr->nextPtr = methods;
- Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc,
- (ClientData) ptr);
+ Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc, ptr);
}
/*
@@ -698,11 +684,12 @@ SmoothMethodCleanupProc(
* interpreter. */
Tcl_Interp *interp) /* Interpreter that is being deleted. */
{
- SmoothAssocData *ptr, *methods = (SmoothAssocData *) clientData;
+ SmoothAssocData *ptr, *methods = clientData;
while (methods != NULL) {
- methods = (ptr = methods)->nextPtr;
- ckfree((char *) ptr);
+ ptr = methods;
+ methods = methods->nextPtr;
+ ckfree(ptr);
}
}
/*
@@ -725,16 +712,16 @@ SmoothMethodCleanupProc(
int
TkSmoothParseProc(
- ClientData clientData, /* some flags.*/
+ ClientData clientData, /* Ignored. */
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_Window tkwin, /* Window containing canvas widget. */
- CONST char *value, /* Value of option. */
+ const char *value, /* Value of option. */
char *widgRec, /* Pointer to record for item. */
int offset) /* Offset into item. */
{
- register Tk_SmoothMethod **smoothPtr =
- (Tk_SmoothMethod **) (widgRec + offset);
- Tk_SmoothMethod *smooth = NULL;
+ register const Tk_SmoothMethod **smoothPtr =
+ (const Tk_SmoothMethod **) (widgRec + offset);
+ const Tk_SmoothMethod *smooth = NULL;
int b;
size_t length;
SmoothAssocData *methods;
@@ -744,8 +731,7 @@ TkSmoothParseProc(
return TCL_OK;
}
length = strlen(value);
- methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod",
- NULL);
+ methods = Tcl_GetAssocData(interp, "smoothMethod", NULL);
/*
* Not initialized yet; fix that now.
@@ -814,7 +800,7 @@ TkSmoothParseProc(
*--------------------------------------------------------------
*/
-char *
+const char *
TkSmoothPrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -824,10 +810,10 @@ TkSmoothPrintProc(
* information about how to reclaim storage
* for return string. */
{
- register Tk_SmoothMethod **smoothPtr =
- (Tk_SmoothMethod **) (widgRec + offset);
+ register const Tk_SmoothMethod *smoothPtr =
+ * (Tk_SmoothMethod **) (widgRec + offset);
- return (*smoothPtr) ? (*smoothPtr)->name : "0";
+ return smoothPtr ? smoothPtr->name : "0";
}
/*
*--------------------------------------------------------------
@@ -850,15 +836,15 @@ TkSmoothPrintProc(
int
Tk_GetDash(
Tcl_Interp *interp, /* Used for error reporting. */
- CONST char *value, /* Textual specification of dash list. */
+ const char *value, /* Textual specification of dash list. */
Tk_Dash *dash) /* Pointer to record in which to store dash
* information. */
{
int argc, i;
- CONST char **largv, **argv = NULL;
+ const char **largv, **argv = NULL;
char *pt;
- if ((value==NULL) || (*value==0) ) {
+ if ((value == NULL) || (*value == '\0')) {
dash->number = 0;
return TCL_OK;
}
@@ -870,17 +856,16 @@ Tk_GetDash(
switch (*value) {
case '.': case ',': case '-': case '_':
i = DashConvert(NULL, value, -1, 0.0);
- if (i>0) {
- i = strlen(value);
- } else {
+ if (i <= 0) {
goto badDashList;
}
- if (i > (int)sizeof(char *)) {
- dash->pattern.pt = pt = (char *) ckalloc(strlen(value));
+ i = strlen(value);
+ if (i > (int) sizeof(char *)) {
+ dash->pattern.pt = pt = ckalloc(strlen(value));
} else {
pt = dash->pattern.array;
}
- memcpy(pt,value, (unsigned int) i);
+ memcpy(pt, value, (unsigned) i);
dash->number = -i;
return TCL_OK;
}
@@ -890,11 +875,11 @@ Tk_GetDash(
goto badDashList;
}
- if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
- ckfree((char *) dash->pattern.pt);
+ if ((unsigned) ABS(dash->number) > sizeof(char *)) {
+ ckfree(dash->pattern.pt);
}
if (argc > (int)sizeof(char *)) {
- dash->pattern.pt = pt = (char *) ckalloc((unsigned int) argc);
+ dash->pattern.pt = pt = ckalloc(argc);
} else {
pt = dash->pattern.array;
}
@@ -915,7 +900,7 @@ Tk_GetDash(
}
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
return TCL_OK;
@@ -925,14 +910,13 @@ Tk_GetDash(
badDashList:
Tcl_AppendResult(interp, "bad dash list \"", value,
- "\": must be a list of integers or a format like \"-..\"",
- NULL);
+ "\": must be a list of integers or a format like \"-..\"", NULL);
syntaxError:
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
- if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
- ckfree((char *) dash->pattern.pt);
+ if ((unsigned) ABS(dash->number) > sizeof(char *)) {
+ ckfree(dash->pattern.pt);
}
dash->number = 0;
return TCL_ERROR;
@@ -1003,14 +987,14 @@ Tk_DeleteOutline(
if (outline->gc != None) {
Tk_FreeGC(display, outline->gc);
}
- if ((unsigned int)ABS(outline->dash.number) > sizeof(char *)) {
- ckfree((char *) outline->dash.pattern.pt);
+ if ((unsigned) ABS(outline->dash.number) > sizeof(char *)) {
+ ckfree(outline->dash.pattern.pt);
}
- if ((unsigned int)ABS(outline->activeDash.number) > sizeof(char *)) {
- ckfree((char *) outline->activeDash.pattern.pt);
+ if ((unsigned) ABS(outline->activeDash.number) > sizeof(char *)) {
+ ckfree(outline->activeDash.pattern.pt);
}
- if ((unsigned int)ABS(outline->disabledDash.number) > sizeof(char *)) {
- ckfree((char *) outline->disabledDash.pattern.pt);
+ if ((unsigned) ABS(outline->disabledDash.number) > sizeof(char *)) {
+ ckfree(outline->disabledDash.pattern.pt);
}
if (outline->color != NULL) {
Tk_FreeColor(outline->color);
@@ -1087,9 +1071,9 @@ Tk_ConfigOutlineGC(
color = outline->color;
stipple = outline->stipple;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
- if (((TkCanvas *)canvas)->currentItemPtr == item) {
+ if (Canvas(canvas)->currentItemPtr == item) {
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
@@ -1168,7 +1152,7 @@ Tk_ChangeOutlineGC(
Tk_Item *item,
Tk_Outline *outline)
{
- CONST char *p;
+ const char *p;
double width;
Tk_Dash *dash;
XColor *color;
@@ -1183,9 +1167,9 @@ Tk_ChangeOutlineGC(
color = outline->color;
stipple = outline->stipple;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
- if (((TkCanvas *)canvas)->currentItemPtr == item) {
+ if (Canvas(canvas)->currentItemPtr == item) {
if (outline->activeWidth > width) {
width = outline->activeWidth;
}
@@ -1222,25 +1206,25 @@ Tk_ChangeOutlineGC(
int i = -dash->number;
p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
- q = (char *) ckalloc(2*(unsigned int)i);
+ q = ckalloc(2 * i);
i = DashConvert(q, p, i, width);
- XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
- outline->offset, q, i);
+ XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, q,i);
ckfree(q);
} else if (dash->number>2 || (dash->number==2 &&
(dash->pattern.array[0]!=dash->pattern.array[1]))) {
- p = (dash->number > (int)sizeof(char *))
+ p = (dash->number > (int) sizeof(char *))
? dash->pattern.pt : dash->pattern.array;
- XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
- outline->offset, p, dash->number);
+ XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, p,
+ dash->number);
}
if (stipple!=None) {
- int w=0; int h=0;
+ int w = 0; int h = 0;
Tk_TSOffset *tsoffset = &outline->tsoffset;
int flags = tsoffset->flags;
+
if (!(flags & TK_OFFSET_INDEX) &&
(flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) {
- Tk_SizeOfBitmap(((TkCanvas *)canvas)->display, stipple, &w, &h);
+ Tk_SizeOfBitmap(Canvas(canvas)->display, stipple, &w, &h);
if (flags & TK_OFFSET_CENTER) {
w /= 2;
} else {
@@ -1268,7 +1252,7 @@ Tk_ChangeOutlineGC(
*
* Tk_ResetOutlineGC
*
- * Restores the GC to the situation before Tk_ChangeDashGC() was called.
+ * Restores the GC to the situation before Tk_ChangeOutlineGC() was called.
* This function should be called just after the dashed item is drawn,
* because the GC is supposed to be read-only.
*
@@ -1302,9 +1286,9 @@ Tk_ResetOutlineGC(
color = outline->color;
stipple = outline->stipple;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
- if (((TkCanvas *)canvas)->currentItemPtr == item) {
+ if (Canvas(canvas)->currentItemPtr == item) {
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
@@ -1338,16 +1322,16 @@ Tk_ResetOutlineGC(
if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 &&
(dash->pattern.array[0] != dash->pattern.array[1])) ||
((dash->number == -1) && (dash->pattern.array[0] != ','))) {
- if (dash->number > 0) {
+ if (dash->number > 0) {
dashList = dash->pattern.array[0];
} else {
dashList = (char) (4 * width + 0.5);
}
- XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
- outline->offset, &dashList , 1);
+ XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset,
+ &dashList , 1);
}
if (stipple != None) {
- XSetTSOrigin(((TkCanvas *)canvas)->display, outline->gc, 0, 0);
+ XSetTSOrigin(Canvas(canvas)->display, outline->gc, 0, 0);
return 1;
}
return 0;
@@ -1377,28 +1361,21 @@ Tk_CanvasPsOutline(
Tk_Item *item,
Tk_Outline *outline)
{
- char string[41];
- char pattern[11];
+ char string[41], pattern[11];
int i;
- char *ptr;
- char *str = string;
- char *lptr = pattern;
- Tcl_Interp *interp = ((TkCanvas *)canvas)->interp;
- double width;
- Tk_Dash *dash;
- XColor *color;
- Pixmap stipple;
+ char *ptr, *str = string, *lptr = pattern;
+ Tcl_Interp *interp = Canvas(canvas)->interp;
+ double width = outline->width;
+ Tk_Dash *dash = &outline->dash;
+ XColor *color = outline->color;
+ Pixmap stipple = outline->stipple;
Tk_State state = item->state;
- width = outline->width;
- dash = &(outline->dash);
- color = outline->color;
- stipple = outline->stipple;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
- if (((TkCanvas *)canvas)->currentItemPtr == item) {
+ if (Canvas(canvas)->currentItemPtr == item) {
if (outline->activeWidth > width) {
width = outline->activeWidth;
}
@@ -1429,12 +1406,12 @@ Tk_CanvasPsOutline(
Tcl_AppendResult(interp, string, NULL);
if (dash->number > 10) {
- str = (char *)ckalloc((unsigned int) (1 + 4*dash->number));
+ str = ckalloc(1 + 4*dash->number);
} else if (dash->number < -5) {
- str = (char *)ckalloc((unsigned int) (1 - 8*dash->number));
- lptr = (char *)ckalloc((unsigned int) (1 - 2*dash->number));
+ str = ckalloc(1 - 8*dash->number);
+ lptr = ckalloc(1 - 2*dash->number);
}
- ptr = ((unsigned int)ABS(dash->number) > sizeof(char *)) ?
+ ptr = ((unsigned) ABS(dash->number) > sizeof(char *)) ?
dash->pattern.pt : dash->pattern.array;
if (dash->number > 0) {
char *ptr0 = ptr;
@@ -1512,7 +1489,7 @@ static int
DashConvert(
char *l, /* Must be at least 2*n chars long, or NULL to
* indicate "just check syntax". */
- CONST char *p, /* String to parse. */
+ const char *p, /* String to parse. */
int n, /* Length of string to parse, or -1 to
* indicate that strlen() should be used. */
double width) /* Width of line. */
@@ -1520,7 +1497,7 @@ DashConvert(
int result = 0;
int size, intWidth;
- if (n<0) {
+ if (n < 0) {
n = strlen(p);
}
intWidth = (int) (width + 0.5);
@@ -1660,8 +1637,6 @@ TkCanvTranslatePath(
double *a, *b, *t; /* Pointers to parts of the temporary
* storage */
int i, j; /* Loop counters */
- int maxOutput; /* Maximum number of outputs that we will
- * allow */
double limit[4]; /* Boundries at which clipping occurs */
double staticSpace[480]; /* Temp space from the stack */
@@ -1702,7 +1677,7 @@ TkCanvTranslatePath(
double x, y;
x = coordArr[i*2];
- y = coordArr[i*2+1];
+ y = coordArr[i*2 + 1];
if (x<lft || x>rgh || y<top || y>btm) {
break;
}
@@ -1720,10 +1695,10 @@ TkCanvTranslatePath(
* b[]. Initialize a[] to be equal to coordArr[].
*/
- if (numVertex*12 <= (int)(sizeof(staticSpace)/sizeof(staticSpace[0]))) {
+ if (numVertex*12 <= (int) (sizeof(staticSpace) / sizeof(double))) {
tempArr = staticSpace;
} else {
- tempArr = (double *)ckalloc(numVertex*12*sizeof(tempArr[0]));
+ tempArr = ckalloc(numVertex * 12 * sizeof(double));
}
for (i=0; i<numVertex*2; i++){
tempArr[i] = coordArr[i];
@@ -1756,10 +1731,9 @@ TkCanvTranslatePath(
* This is the loop that makes the four passes through the data.
*/
- maxOutput = numVertex*3;
for (j=0; j<4; j++){
double xClip = limit[j];
- int inside = a[0]<xClip;
+ int inside = a[0] < xClip;
double priorY = a[1];
numOutput = 0;
@@ -1770,7 +1744,7 @@ TkCanvTranslatePath(
for (i=0; i<numVertex; i++){
double x = a[i*2];
- double y = a[i*2+1];
+ double y = a[i*2 + 1];
if (x >= xClip) {
/*
@@ -1788,13 +1762,13 @@ TkCanvTranslatePath(
double x0, y0, yN;
assert(i > 0);
- x0 = a[i*2-2];
- y0 = a[i*2-1];
+ x0 = a[i*2 - 2];
+ y0 = a[i*2 - 1];
yN = y0 + (y - y0)*(xClip-x0)/(x-x0);
b[numOutput*2] = -yN;
- b[numOutput*2+1] = xClip;
+ b[numOutput*2 + 1] = xClip;
numOutput++;
- assert(numOutput <= maxOutput);
+ assert(numOutput <= numVertex*3);
priorY = yN;
inside = 0;
} else if (i == 0) {
@@ -1813,8 +1787,10 @@ TkCanvTranslatePath(
/*
* The current vertex is to the left of xClip
*/
+
if (!inside) {
- /* If the current vertex is on the left of xClip and one
+ /*
+ * If the current vertex is on the left of xClip and one
* or more prior vertices where to the right, then we have
* to draw a line segment along xClip that extends from
* the spot where we first crossed from left to right to
@@ -1824,21 +1800,21 @@ TkCanvTranslatePath(
double x0, y0, yN;
assert(i > 0);
- x0 = a[i*2-2];
- y0 = a[i*2-1];
+ x0 = a[i*2 - 2];
+ y0 = a[i*2 - 1];
yN = y0 + (y - y0)*(xClip-x0)/(x-x0);
if (yN != priorY) {
b[numOutput*2] = -yN;
- b[numOutput*2+1] = xClip;
+ b[numOutput*2 + 1] = xClip;
numOutput++;
- assert(numOutput <= maxOutput);
+ assert(numOutput <= numVertex*3);
}
inside = 1;
}
b[numOutput*2] = -y;
- b[numOutput*2+1] = x;
+ b[numOutput*2 + 1] = x;
numOutput++;
- assert(numOutput <= maxOutput);
+ assert(numOutput <= numVertex*3);
}
}
@@ -1861,7 +1837,7 @@ TkCanvTranslatePath(
TranslateAndAppendCoords(canvPtr, a[i*2], a[i*2+1], outArr, i);
}
if (tempArr != staticSpace) {
- ckfree((char *) tempArr);
+ ckfree(tempArr);
}
return numOutput;
}
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index b62859c..f2cce7d 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -38,29 +37,27 @@ typedef struct WindowItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
- "center", Tk_Offset(WindowItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
+ "center", Tk_Offset(WindowItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_PIXELS, "-height", NULL, NULL,
- "0", Tk_Offset(WindowItem, height), TK_CONFIG_DONT_SET_DEFAULT},
+ "0", Tk_Offset(WindowItem, height), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
{TK_CONFIG_PIXELS, "-width", NULL, NULL,
- "0", Tk_Offset(WindowItem, width), TK_CONFIG_DONT_SET_DEFAULT},
+ "0", Tk_Offset(WindowItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_WINDOW, "-window", NULL, NULL,
- NULL, Tk_Offset(WindowItem, tkwin), TK_CONFIG_NULL_OK},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ NULL, Tk_Offset(WindowItem, tkwin), TK_CONFIG_NULL_OK, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -71,10 +68,10 @@ static void ComputeWindowBbox(Tk_Canvas canvas,
WindowItem *winItemPtr);
static int ConfigureWinItem(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[], int flags);
+ Tcl_Obj *const objv[], int flags);
static int CreateWinItem(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteWinItem(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayWinItem(Tk_Canvas canvas,
@@ -87,7 +84,7 @@ static void TranslateWinItem(Tk_Canvas canvas,
Tk_Item *itemPtr, double deltaX, double deltaY);
static int WinItemCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void WinItemLostSlaveProc(ClientData clientData,
Tk_Window tkwin);
static void WinItemRequestProc(ClientData clientData,
@@ -133,6 +130,7 @@ Tk_ItemType tkWindowType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -172,13 +170,13 @@ CreateWinItem(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing window. */
+ Tcl_Obj *const objv[]) /* Arguments describing window. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -199,7 +197,8 @@ CreateWinItem(
if (objc == 1) {
i = 1;
} else {
- char *arg = Tcl_GetString(objv[1]);
+ const char *arg = Tcl_GetString(objv[1]);
+
i = 2;
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
@@ -242,7 +241,7 @@ WinItemCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -306,7 +305,7 @@ ConfigureWinItem(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Window item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -316,7 +315,7 @@ ConfigureWinItem(
oldWindow = winItemPtr->tkwin;
canvasTkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc,
- (CONST char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -327,8 +326,8 @@ ConfigureWinItem(
if (oldWindow != winItemPtr->tkwin) {
if (oldWindow != NULL) {
Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
- WinItemStructureProc, (ClientData) winItemPtr);
- Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL);
+ WinItemStructureProc, winItemPtr);
+ Tk_ManageGeometry(oldWindow, NULL, NULL);
Tk_UnmaintainGeometry(oldWindow, canvasTkwin);
Tk_UnmapWindow(oldWindow);
}
@@ -348,25 +347,19 @@ ConfigureWinItem(
if (ancestor == parent) {
break;
}
- if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) {
- badWindow:
- Tcl_AppendResult(interp, "can't use ",
- Tk_PathName(winItemPtr->tkwin),
- " in a window item of this canvas", NULL);
- winItemPtr->tkwin = NULL;
- return TCL_ERROR;
+ if (((Tk_FakeWin *) ancestor)->flags & TK_TOP_HIERARCHY) {
+ goto badWindow;
}
}
- if (((Tk_FakeWin *) (winItemPtr->tkwin))->flags & TK_TOP_HIERARCHY) {
+ if (((Tk_FakeWin *) winItemPtr->tkwin)->flags & TK_TOP_HIERARCHY){
goto badWindow;
}
if (winItemPtr->tkwin == canvasTkwin) {
goto badWindow;
}
Tk_CreateEventHandler(winItemPtr->tkwin, StructureNotifyMask,
- WinItemStructureProc, (ClientData) winItemPtr);
- Tk_ManageGeometry(winItemPtr->tkwin, &canvasGeomType,
- (ClientData) winItemPtr);
+ WinItemStructureProc, winItemPtr);
+ Tk_ManageGeometry(winItemPtr->tkwin, &canvasGeomType, winItemPtr);
}
}
if ((winItemPtr->tkwin != NULL)
@@ -379,8 +372,13 @@ ConfigureWinItem(
}
ComputeWindowBbox(canvas, winItemPtr);
-
return TCL_OK;
+
+ badWindow:
+ Tcl_AppendResult(interp, "can't use ", Tk_PathName(winItemPtr->tkwin),
+ " in a window item of this canvas", NULL);
+ winItemPtr->tkwin = NULL;
+ return TCL_ERROR;
}
/*
@@ -411,9 +409,8 @@ DeleteWinItem(
if (winItemPtr->tkwin != NULL) {
Tk_DeleteEventHandler(winItemPtr->tkwin, StructureNotifyMask,
- WinItemStructureProc, (ClientData) winItemPtr);
- Tk_ManageGeometry(winItemPtr->tkwin, NULL,
- (ClientData) NULL);
+ WinItemStructureProc, winItemPtr);
+ Tk_ManageGeometry(winItemPtr->tkwin, NULL, NULL);
if (canvasTkwin != Tk_Parent(winItemPtr->tkwin)) {
Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin);
}
@@ -451,7 +448,7 @@ ComputeWindowBbox(
y = (int) (winItemPtr->y + ((winItemPtr->y >= 0) ? 0.5 : - 0.5));
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if ((winItemPtr->tkwin == NULL) || (state == TK_STATE_HIDDEN)) {
/*
@@ -576,7 +573,7 @@ DisplayWinItem(
return;
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
/*
@@ -757,8 +754,7 @@ xerrorhandler(
{
return 0;
}
-#endif
-
+#endif /* X_GetImage */
/*
*--------------------------------------------------------------
@@ -788,8 +784,7 @@ WinItemToPostscript(
* information; 0 means final Postscript is
* being created. */
{
- WindowItem *winItemPtr = (WindowItem *)itemPtr;
-
+ WindowItem *winItemPtr = (WindowItem *) itemPtr;
double x, y;
int width, height;
Tk_Window tkwin = winItemPtr->tkwin;
@@ -879,7 +874,7 @@ CanvasPsWindow(
#ifdef X_GetImage
handle = Tk_CreateErrorHandler(Tk_Display(tkwin), BadMatch,
- X_GetImage, -1, xerrorhandler, (ClientData) tkwin);
+ X_GetImage, -1, xerrorhandler, tkwin);
#endif
/*
@@ -888,7 +883,7 @@ CanvasPsWindow(
*/
ximage = XGetImage(Tk_Display(tkwin), Tk_WindowId(tkwin), 0, 0,
- (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap);
+ (unsigned) width, (unsigned) height, AllPlanes, ZPixmap);
#ifdef X_GetImage
Tk_DeleteErrorHandler(handle);
@@ -898,8 +893,8 @@ CanvasPsWindow(
return TCL_OK;
}
- result = TkPostscriptImage(interp, tkwin,
- ((TkCanvas *)canvas)->psInfo, ximage, 0, 0, width, height);
+ result = TkPostscriptImage(interp, tkwin, Canvas(canvas)->psInfo, ximage,
+ 0, 0, width, height);
XDestroyImage(ximage);
return result;
@@ -1000,7 +995,7 @@ WinItemStructureProc(
ClientData clientData, /* Pointer to record describing window item. */
XEvent *eventPtr) /* Describes what just happened. */
{
- WindowItem *winItemPtr = (WindowItem *) clientData;
+ WindowItem *winItemPtr = clientData;
if (eventPtr->type == DestroyNotify) {
winItemPtr->tkwin = NULL;
@@ -1030,7 +1025,7 @@ WinItemRequestProc(
ClientData clientData, /* Pointer to record for window item. */
Tk_Window tkwin) /* Window that changed its desired size. */
{
- WindowItem *winItemPtr = (WindowItem *) clientData;
+ WindowItem *winItemPtr = clientData;
ComputeWindowBbox(winItemPtr->canvas, winItemPtr);
@@ -1067,11 +1062,11 @@ WinItemLostSlaveProc(
* was stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- WindowItem *winItemPtr = (WindowItem *) clientData;
+ WindowItem *winItemPtr = clientData;
Tk_Window canvasTkwin = Tk_CanvasTkwin(winItemPtr->canvas);
Tk_DeleteEventHandler(winItemPtr->tkwin, StructureNotifyMask,
- WinItemStructureProc, (ClientData) winItemPtr);
+ WinItemStructureProc, winItemPtr);
if (canvasTkwin != Tk_Parent(winItemPtr->tkwin)) {
Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin);
}
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 253b184..f244aad 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -75,7 +75,7 @@ typedef struct TagSearch {
* return NULL. */
int type; /* Search type (see #defs below) */
int id; /* Item id for searches by id */
- char *string; /* Tag expression string */
+ const char *string; /* Tag expression string */
int stringIndex; /* Current position in string scan */
int stringLength; /* Length of tag expression string */
char *rewritebuffer; /* Tag string (after removing escapes) */
@@ -100,112 +100,109 @@ typedef struct TagSearch {
* Custom option for handling "-state" and "-offset"
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc,
- (ClientData) NULL /* only "normal" and "disabled" */
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc,
+ NULL /* Only "normal" and "disabled". */
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc,
- (ClientData) TK_OFFSET_RELATIVE
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE)
};
/*
* Information used for argv parsing.
*/
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_CANVAS_BG_COLOR, Tk_Offset(TkCanvas, bgBorder),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_CANVAS_BG_MONO, Tk_Offset(TkCanvas, bgBorder),
- TK_CONFIG_MONO_ONLY},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0},
- {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0},
+ TK_CONFIG_MONO_ONLY, NULL},
+ {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL},
+ {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL},
{TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_CANVAS_BORDER_WIDTH, Tk_Offset(TkCanvas, borderWidth), 0},
+ DEF_CANVAS_BORDER_WIDTH, Tk_Offset(TkCanvas, borderWidth), 0, NULL},
{TK_CONFIG_DOUBLE, "-closeenough", "closeEnough", "CloseEnough",
- DEF_CANVAS_CLOSE_ENOUGH, Tk_Offset(TkCanvas, closeEnough), 0},
+ DEF_CANVAS_CLOSE_ENOUGH, Tk_Offset(TkCanvas, closeEnough), 0, NULL},
{TK_CONFIG_BOOLEAN, "-confine", "confine", "Confine",
- DEF_CANVAS_CONFINE, Tk_Offset(TkCanvas, confine), 0},
+ DEF_CANVAS_CONFINE, Tk_Offset(TkCanvas, confine), 0, NULL},
{TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_CANVAS_CURSOR, Tk_Offset(TkCanvas, cursor), TK_CONFIG_NULL_OK},
+ DEF_CANVAS_CURSOR, Tk_Offset(TkCanvas, cursor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-height", "height", "Height",
- DEF_CANVAS_HEIGHT, Tk_Offset(TkCanvas, height), 0},
+ DEF_CANVAS_HEIGHT, Tk_Offset(TkCanvas, height), 0, NULL},
{TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_CANVAS_HIGHLIGHT_BG,
- Tk_Offset(TkCanvas, highlightBgColorPtr), 0},
+ Tk_Offset(TkCanvas, highlightBgColorPtr), 0, NULL},
{TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_CANVAS_HIGHLIGHT, Tk_Offset(TkCanvas, highlightColorPtr), 0},
+ DEF_CANVAS_HIGHLIGHT, Tk_Offset(TkCanvas, highlightColorPtr), 0, NULL},
{TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
"HighlightThickness",
- DEF_CANVAS_HIGHLIGHT_WIDTH, Tk_Offset(TkCanvas, highlightWidth), 0},
+ DEF_CANVAS_HIGHLIGHT_WIDTH, Tk_Offset(TkCanvas, highlightWidth), 0, NULL},
{TK_CONFIG_BORDER, "-insertbackground", "insertBackground", "Foreground",
- DEF_CANVAS_INSERT_BG, Tk_Offset(TkCanvas, textInfo.insertBorder), 0},
+ DEF_CANVAS_INSERT_BG, Tk_Offset(TkCanvas, textInfo.insertBorder), 0, NULL},
{TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth",
DEF_CANVAS_INSERT_BD_COLOR,
- Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY},
+ Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth",
DEF_CANVAS_INSERT_BD_MONO,
- Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY},
+ Tk_Offset(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_INT, "-insertofftime", "insertOffTime", "OffTime",
- DEF_CANVAS_INSERT_OFF_TIME, Tk_Offset(TkCanvas, insertOffTime), 0},
+ DEF_CANVAS_INSERT_OFF_TIME, Tk_Offset(TkCanvas, insertOffTime), 0, NULL},
{TK_CONFIG_INT, "-insertontime", "insertOnTime", "OnTime",
- DEF_CANVAS_INSERT_ON_TIME, Tk_Offset(TkCanvas, insertOnTime), 0},
+ DEF_CANVAS_INSERT_ON_TIME, Tk_Offset(TkCanvas, insertOnTime), 0, NULL},
{TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
- DEF_CANVAS_INSERT_WIDTH, Tk_Offset(TkCanvas, textInfo.insertWidth), 0},
+ DEF_CANVAS_INSERT_WIDTH, Tk_Offset(TkCanvas, textInfo.insertWidth), 0, NULL},
{TK_CONFIG_CUSTOM, "-offset", "offset", "Offset", "0,0",
Tk_Offset(TkCanvas, tsoffset),TK_CONFIG_DONT_SET_DEFAULT,
&offsetOption},
{TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_CANVAS_RELIEF, Tk_Offset(TkCanvas, relief), 0},
+ DEF_CANVAS_RELIEF, Tk_Offset(TkCanvas, relief), 0, NULL},
{TK_CONFIG_STRING, "-scrollregion", "scrollRegion", "ScrollRegion",
DEF_CANVAS_SCROLL_REGION, Tk_Offset(TkCanvas, regionString),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground",
DEF_CANVAS_SELECT_COLOR, Tk_Offset(TkCanvas, textInfo.selBorder),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground",
DEF_CANVAS_SELECT_MONO, Tk_Offset(TkCanvas, textInfo.selBorder),
- TK_CONFIG_MONO_ONLY},
+ TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth",
DEF_CANVAS_SELECT_BD_COLOR,
- Tk_Offset(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY},
+ Tk_Offset(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth",
DEF_CANVAS_SELECT_BD_MONO, Tk_Offset(TkCanvas, textInfo.selBorderWidth),
- TK_CONFIG_MONO_ONLY},
+ TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_CANVAS_SELECT_FG_COLOR, Tk_Offset(TkCanvas, textInfo.selFgColorPtr),
- TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK},
+ TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_CANVAS_SELECT_FG_MONO, Tk_Offset(TkCanvas, textInfo.selFgColorPtr),
- TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK},
+ TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-state", "state", "State",
"normal", Tk_Offset(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT,
&stateOption},
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_CANVAS_TAKE_FOCUS, Tk_Offset(TkCanvas, takeFocus),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-width", "width", "Width",
- DEF_CANVAS_WIDTH, Tk_Offset(TkCanvas, width), 0},
+ DEF_CANVAS_WIDTH, Tk_Offset(TkCanvas, width), 0, NULL},
{TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
DEF_CANVAS_X_SCROLL_CMD, Tk_Offset(TkCanvas, xScrollCmd),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-xscrollincrement", "xScrollIncrement",
"ScrollIncrement",
DEF_CANVAS_X_SCROLL_INCREMENT, Tk_Offset(TkCanvas, xScrollIncrement),
- 0},
+ 0, NULL},
{TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
DEF_CANVAS_Y_SCROLL_CMD, Tk_Offset(TkCanvas, yScrollCmd),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-yscrollincrement", "yScrollIncrement",
"ScrollIncrement",
DEF_CANVAS_Y_SCROLL_INCREMENT, Tk_Offset(TkCanvas, yScrollIncrement),
- 0},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ 0, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -213,8 +210,9 @@ static Tk_ConfigSpec configSpecs[] = {
* protected by typeListMutex.
*/
-static Tk_ItemType *typeList = NULL; /* NULL means initialization hasn't
- * been done yet. */
+static Tk_ItemType *typeList = NULL;
+ /* NULL means initialization hasn't been done
+ * yet. */
TCL_DECLARE_MUTEX(typeListMutex)
#ifndef USE_OLD_TAG_SEARCH
@@ -264,32 +262,31 @@ static void CanvasSetOrigin(TkCanvas *canvasPtr,
static void CanvasUpdateScrollbars(TkCanvas *canvasPtr);
static int CanvasWidgetCmd(ClientData clientData,
Tcl_Interp *interp, int argc,
- Tcl_Obj *CONST *argv);
-static void CanvasWorldChanged(
- ClientData instanceData);
+ Tcl_Obj *const *argv);
+static void CanvasWorldChanged(ClientData instanceData);
static int ConfigureCanvas(Tcl_Interp *interp,
TkCanvas *canvasPtr, int argc,
- Tcl_Obj *CONST *argv, int flags);
+ Tcl_Obj *const *argv, int flags);
static void DestroyCanvas(char *memPtr);
static void DisplayCanvas(ClientData clientData);
static void DoItem(Tcl_Interp *interp,
Tk_Item *itemPtr, Tk_Uid tag);
-static void EventuallyRedrawItem(Tk_Canvas canvas,
+static void EventuallyRedrawItem(TkCanvas *canvasPtr,
Tk_Item *itemPtr);
#ifdef USE_OLD_TAG_SEARCH
static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
- int argc, Tcl_Obj *CONST *argv,
+ int argc, Tcl_Obj *const *argv,
Tcl_Obj *newTagObj, int first);
#else /* USE_OLD_TAG_SEARCH */
static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
- int argc, Tcl_Obj *CONST *argv,
+ int argc, Tcl_Obj *const *argv,
Tcl_Obj *newTagObj, int first,
TagSearch **searchPtrPtr);
#endif /* USE_OLD_TAG_SEARCH */
static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr,
- Tcl_Obj *CONST *argv, Tk_Uid uid, int enclosed);
+ Tcl_Obj *const *argv, Tk_Uid uid, int enclosed);
static double GridAlign(double coord, double spacing);
-static CONST char** TkGetStringsFromObjs(int argc, Tcl_Obj *CONST *objv);
+static const char** TkGetStringsFromObjs(int argc, Tcl_Obj *const *objv);
static void InitCanvas(void);
#ifdef USE_OLD_TAG_SEARCH
static Tk_Item * NextItem(TagSearch *searchPtr);
@@ -323,9 +320,11 @@ static Tk_Item * TagSearchNext(TagSearch *searchPtr);
* that can be invoked from generic window code.
*/
-static Tk_ClassProcs canvasClass = {
+static const Tk_ClassProcs canvasClass = {
sizeof(Tk_ClassProcs), /* size */
CanvasWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -338,6 +337,10 @@ static Tk_ClassProcs canvasClass = {
#define FOR_EVERY_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
for ((itemPtr) = StartTagSearch(canvasPtr, (objPtr), &search); \
(itemPtr) != NULL; (itemPtr) = NextItem(&search))
+#define FIND_ITEMS(objPtr, n) \
+ FindItems(interp, canvasPtr, objc, objv, (objPtr), (n))
+#define RELINK_ITEMS(objPtr, itemPtr) \
+ RelinkItems(canvasPtr, (objPtr), (itemPtr))
#else /* USE_OLD_TAG_SEARCH */
#define FIRST_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
if ((result=TagSearchScan(canvasPtr,(objPtr),(searchPtrPtr))) != TCL_OK){ \
@@ -350,8 +353,266 @@ static Tk_ClassProcs canvasClass = {
} \
for (itemPtr = TagSearchFirst(*(searchPtrPtr)); \
itemPtr != NULL; itemPtr = TagSearchNext(*(searchPtrPtr)))
+#define FIND_ITEMS(objPtr, n) \
+ FindItems(interp, canvasPtr, objc, objv, (objPtr), (n), &searchPtr)
+#define RELINK_ITEMS(objPtr, itemPtr) \
+ result = RelinkItems(canvasPtr, (objPtr), (itemPtr), &searchPtr)
#endif /* USE_OLD_TAG_SEARCH */
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * AlwaysRedraw, ItemConfigure, ItemCoords, etc. --
+ *
+ * Helper functions that make access to canvas item functions simpler.
+ * Note that these are all inline functions.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static inline int
+AlwaysRedraw(
+ Tk_Item *itemPtr)
+{
+ return itemPtr->typePtr->alwaysRedraw & 1;
+}
+
+static inline int
+ItemConfigure(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_Interp *interp = canvasPtr->interp;
+ int result;
+
+ if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
+ result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY);
+ } else {
+ const char **args = TkGetStringsFromObjs(objc, objv);
+
+ result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY);
+ if (args != NULL) {
+ ckfree(args);
+ }
+ }
+ return result;
+}
+
+static inline int
+ItemConfigInfo(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ Tcl_Obj *fieldName)
+{
+ return Tk_ConfigureInfo(canvasPtr->interp, canvasPtr->tkwin,
+ itemPtr->typePtr->configSpecs, (char *) itemPtr,
+ (fieldName ? Tcl_GetString(fieldName) : NULL), 0);
+}
+
+static inline int
+ItemConfigValue(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ Tcl_Obj *fieldName)
+{
+ return Tk_ConfigureValue(canvasPtr->interp, canvasPtr->tkwin,
+ itemPtr->typePtr->configSpecs, (char *) itemPtr,
+ Tcl_GetString(fieldName), 0);
+}
+
+static inline int
+ItemCoords(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_Interp *interp = canvasPtr->interp;
+ int result;
+
+ if (itemPtr->typePtr->coordProc == NULL) {
+ result = TCL_OK;
+ } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
+ result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, objv);
+ } else {
+ const char **args = TkGetStringsFromObjs(objc, objv);
+
+ result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc, (Tcl_Obj **) args);
+ if (args != NULL) {
+ ckfree(args);
+ }
+ }
+ return result;
+}
+
+static inline int
+ItemCreate(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr, /* Warning: incomplete! typePtr field must be
+ * set by this point. */
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_Interp *interp = canvasPtr->interp;
+ int result;
+
+ if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
+ result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc-3, objv+3);
+ } else {
+ const char **args = TkGetStringsFromObjs(objc-3, objv+3);
+
+ result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objc-3, (Tcl_Obj **) args);
+ if (args != NULL) {
+ ckfree(args);
+ }
+ }
+ return result;
+}
+
+static inline void
+ItemCursor(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int index)
+{
+ itemPtr->typePtr->icursorProc((Tk_Canvas) canvasPtr, itemPtr, index);
+}
+
+static inline void
+ItemDelChars(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int first,
+ int last)
+{
+ itemPtr->typePtr->dCharsProc((Tk_Canvas) canvasPtr, itemPtr, first, last);
+}
+
+static inline void
+ItemDelete(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr)
+{
+ itemPtr->typePtr->deleteProc((Tk_Canvas) canvasPtr, itemPtr,
+ canvasPtr->display);
+}
+
+static inline void
+ItemDisplay(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ Pixmap pixmap,
+ int screenX1, int screenY1,
+ int width, int height)
+{
+ itemPtr->typePtr->displayProc((Tk_Canvas) canvasPtr, itemPtr,
+ canvasPtr->display, pixmap, screenX1, screenY1, width, height);
+}
+
+static inline int
+ItemIndex(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ Tcl_Obj *objPtr,
+ int *indexPtr)
+{
+ Tcl_Interp *interp = canvasPtr->interp;
+
+ if (itemPtr->typePtr->indexProc == NULL) {
+ return TCL_OK;
+ } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
+ return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, objPtr, indexPtr);
+ } else {
+ return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
+ itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr);
+ }
+}
+
+static inline void
+ItemInsert(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int beforeThis,
+ Tcl_Obj *toInsert)
+{
+ if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
+ itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
+ beforeThis, toInsert);
+ } else {
+ itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr,
+ beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert));
+ }
+}
+
+static inline int
+ItemOverlap(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ double rect[])
+{
+ return itemPtr->typePtr->areaProc((Tk_Canvas) canvasPtr, itemPtr, rect);
+}
+
+static inline double
+ItemPoint(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ double coords[],
+ double halo)
+{
+ double dist;
+ dist = itemPtr->typePtr->pointProc((Tk_Canvas) canvasPtr, itemPtr,
+ coords) - halo;
+ return (dist < 0.0) ? 0.0 : dist;
+}
+
+static inline void
+ItemScale(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ double xOrigin, double yOrigin,
+ double xScale, double yScale)
+{
+ itemPtr->typePtr->scaleProc((Tk_Canvas) canvasPtr, itemPtr,
+ xOrigin, yOrigin, xScale, yScale);
+}
+
+static inline int
+ItemSelection(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ int offset,
+ char *buffer,
+ int maxBytes)
+{
+ if (itemPtr == NULL || itemPtr->typePtr->selectionProc == NULL) {
+ return -1;
+ }
+
+ return itemPtr->typePtr->selectionProc((Tk_Canvas) canvasPtr, itemPtr,
+ offset, buffer, maxBytes);
+}
+
+static inline void
+ItemTranslate(
+ TkCanvas *canvasPtr,
+ Tk_Item *itemPtr,
+ double xDelta,
+ double yDelta)
+{
+ itemPtr->typePtr->translateProc((Tk_Canvas) canvasPtr, itemPtr,
+ xDelta, yDelta);
+}
/*
*--------------------------------------------------------------
@@ -375,9 +636,9 @@ Tk_CanvasObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- Tcl_Obj *CONST argv[]) /* Argument objects. */
+ Tcl_Obj *const argv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
TkCanvas *canvasPtr;
Tk_Window newWin;
@@ -386,7 +647,7 @@ Tk_CanvasObjCmd(
}
if (argc < 2) {
- Tcl_WrongNumArgs(interp, 1, argv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, argv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -401,13 +662,13 @@ Tk_CanvasObjCmd(
* pointers).
*/
- canvasPtr = (TkCanvas *) ckalloc(sizeof(TkCanvas));
+ canvasPtr = ckalloc(sizeof(TkCanvas));
canvasPtr->tkwin = newWin;
canvasPtr->display = Tk_Display(newWin);
canvasPtr->interp = interp;
canvasPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(canvasPtr->tkwin), CanvasWidgetCmd,
- (ClientData) canvasPtr, CanvasCmdDeletedProc);
+ Tk_PathName(canvasPtr->tkwin), CanvasWidgetCmd, canvasPtr,
+ CanvasCmdDeletedProc);
canvasPtr->firstItemPtr = NULL;
canvasPtr->lastItemPtr = NULL;
canvasPtr->borderWidth = 0;
@@ -480,21 +741,21 @@ Tk_CanvasObjCmd(
Tcl_InitHashTable(&canvasPtr->idTable, TCL_ONE_WORD_KEYS);
Tk_SetClass(canvasPtr->tkwin, "Canvas");
- Tk_SetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr);
+ Tk_SetClassProcs(canvasPtr->tkwin, &canvasClass, canvasPtr);
Tk_CreateEventHandler(canvasPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- CanvasEventProc, (ClientData) canvasPtr);
+ CanvasEventProc, canvasPtr);
Tk_CreateEventHandler(canvasPtr->tkwin, KeyPressMask|KeyReleaseMask
|ButtonPressMask|ButtonReleaseMask|EnterWindowMask
|LeaveWindowMask|PointerMotionMask|VirtualEventMask,
- CanvasBindProc, (ClientData) canvasPtr);
+ CanvasBindProc, canvasPtr);
Tk_CreateSelHandler(canvasPtr->tkwin, XA_PRIMARY, XA_STRING,
- CanvasFetchSelection, (ClientData) canvasPtr, XA_STRING);
+ CanvasFetchSelection, canvasPtr, XA_STRING);
if (ConfigureCanvas(interp, canvasPtr, argc-2, argv+2, 0) != TCL_OK) {
goto error;
}
- Tcl_SetResult(interp, Tk_PathName(canvasPtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(canvasPtr->tkwin));
return TCL_OK;
error:
@@ -525,9 +786,9 @@ CanvasWidgetCmd(
ClientData clientData, /* Information about canvas widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
int c, result;
Tk_Item *itemPtr = NULL; /* Initialization needed only to prevent
* compiler warning. */
@@ -539,15 +800,16 @@ CanvasWidgetCmd(
#endif /* USE_OLD_TAG_SEARCH */
int index;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"addtag", "bbox", "bind", "canvasx",
"canvasy", "cget", "configure", "coords",
"create", "dchars", "delete", "dtag",
"find", "focus", "gettags", "icursor",
- "index", "insert", "itemcget", "itemconfigure",
- "lower", "move", "postscript", "raise",
- "scale", "scan", "select", "type",
- "xview", "yview",
+ "imove", "index", "insert", "itemcget",
+ "itemconfigure",
+ "lower", "move", "moveto", "postscript",
+ "raise", "rchars", "scale", "scan",
+ "select", "type", "xview", "yview",
NULL
};
enum options {
@@ -555,35 +817,32 @@ CanvasWidgetCmd(
CANV_CANVASY, CANV_CGET, CANV_CONFIGURE, CANV_COORDS,
CANV_CREATE, CANV_DCHARS, CANV_DELETE, CANV_DTAG,
CANV_FIND, CANV_FOCUS, CANV_GETTAGS, CANV_ICURSOR,
- CANV_INDEX, CANV_INSERT, CANV_ITEMCGET, CANV_ITEMCONFIGURE,
- CANV_LOWER, CANV_MOVE, CANV_POSTSCRIPT,CANV_RAISE,
- CANV_SCALE, CANV_SCAN, CANV_SELECT, CANV_TYPE,
- CANV_XVIEW, CANV_YVIEW
+ CANV_IMOVE, CANV_INDEX, CANV_INSERT, CANV_ITEMCGET,
+ CANV_ITEMCONFIGURE,
+ CANV_LOWER, CANV_MOVE, CANV_MOVETO, CANV_POSTSCRIPT,
+ CANV_RAISE, CANV_RCHARS, CANV_SCALE, CANV_SCAN,
+ CANV_SELECT, CANV_TYPE, CANV_XVIEW, CANV_YVIEW
};
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) canvasPtr);
+ Tcl_Preserve(canvasPtr);
result = TCL_OK;
switch ((enum options) index) {
case CANV_ADDTAG:
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg ...?");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- result = FindItems(interp, canvasPtr, objc, objv, objv[2], 3);
-#else /* USE_OLD_TAG_SEARCH */
- result = FindItems(interp, canvasPtr, objc, objv, objv[2], 3, &searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ result = FIND_ITEMS(objv[2], 3);
break;
case CANV_BBOX: {
@@ -627,10 +886,13 @@ CanvasWidgetCmd(
}
}
if (gotAny) {
- char buf[TCL_INTEGER_SPACE * 4];
+ Tcl_Obj *resultObjs[4];
- sprintf(buf, "%d %d %d %d", x1, y1, x2, y2);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ resultObjs[0] = Tcl_NewIntObj(x1);
+ resultObjs[1] = Tcl_NewIntObj(y1);
+ resultObjs[2] = Tcl_NewIntObj(x2);
+ resultObjs[3] = Tcl_NewIntObj(y2);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(4, resultObjs));
}
break;
}
@@ -648,7 +910,7 @@ CanvasWidgetCmd(
* tag).
*/
- object = 0;
+ object = NULL;
#ifdef USE_OLD_TAG_SEARCH
if (isdigit(UCHAR(Tcl_GetString(objv[2])[0]))) {
int id;
@@ -661,19 +923,19 @@ CanvasWidgetCmd(
}
entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char *) id);
if (entryPtr != NULL) {
- itemPtr = (Tk_Item *) Tcl_GetHashValue(entryPtr);
- object = (ClientData) itemPtr;
+ itemPtr = Tcl_GetHashValue(entryPtr);
+ object = itemPtr;
}
- if (object == 0) {
+ if (object == NULL) {
Tcl_AppendResult(interp, "item \"", Tcl_GetString(objv[2]),
"\" doesn't exist", NULL);
result = TCL_ERROR;
goto done;
}
} else {
- bindByTag:
- object = (ClientData) Tk_GetUid(Tcl_GetString(objv[2]));
+ bindByTag:
+ object = Tk_GetUid(Tcl_GetString(objv[2]));
}
#else /* USE_OLD_TAG_SEARCH */
result = TagSearchScan(canvasPtr, objv[2], &searchPtr);
@@ -686,8 +948,8 @@ CanvasWidgetCmd(
entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable,
(char *) INT2PTR(searchPtr->id));
if (entryPtr != NULL) {
- itemPtr = (Tk_Item *) Tcl_GetHashValue(entryPtr);
- object = (ClientData) itemPtr;
+ itemPtr = Tcl_GetHashValue(entryPtr);
+ object = itemPtr;
}
if (object == 0) {
@@ -712,7 +974,7 @@ CanvasWidgetCmd(
if (objc == 5) {
int append = 0;
unsigned long mask;
- char* argv4 = Tcl_GetString(objv[4]);
+ const char *argv4 = Tcl_GetString(objv[4]);
if (argv4[0] == 0) {
result = Tk_DeleteBinding(interp, canvasPtr->bindingTable,
@@ -770,20 +1032,18 @@ CanvasWidgetCmd(
object, Tcl_GetString(objv[3]));
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "requested illegal events; ",
- "only key, button, motion, enter, leave, and virtual ",
- "events may be used", NULL);
+ "only key, button, motion, enter, leave, and virtual",
+ " events may be used", NULL);
result = TCL_ERROR;
goto done;
}
} else if (objc == 4) {
- CONST char *command;
+ const char *command;
command = Tk_GetBinding(interp, canvasPtr->bindingTable,
object, Tcl_GetString(objv[3]));
if (command == NULL) {
- CONST char *string;
-
- string = Tcl_GetStringResult(interp);
+ const char *string = Tcl_GetStringResult(interp);
/*
* Ignore missing binding errors. This is a special hack that
@@ -794,11 +1054,10 @@ CanvasWidgetCmd(
if (string[0] != '\0') {
result = TCL_ERROR;
goto done;
- } else {
- Tcl_ResetResult(interp);
}
+ Tcl_ResetResult(interp);
} else {
- Tcl_SetResult(interp, (char *) command, TCL_STATIC);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(command, -1));
}
} else {
Tk_GetAllBindings(interp, canvasPtr->bindingTable, object);
@@ -808,20 +1067,20 @@ CanvasWidgetCmd(
case CANV_CANVASX: {
int x;
double grid;
- char buf[TCL_DOUBLE_SPACE];
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "screenx ?gridspacing?");
result = TCL_ERROR;
goto done;
}
- if (Tk_GetPixelsFromObj(interp, canvasPtr->tkwin, objv[2], &x) != TCL_OK) {
+ if (Tk_GetPixelsFromObj(interp, canvasPtr->tkwin, objv[2],
+ &x) != TCL_OK) {
result = TCL_ERROR;
goto done;
}
if (objc == 4) {
- if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[3],
- &grid) != TCL_OK) {
+ if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[3], &grid) != TCL_OK) {
result = TCL_ERROR;
goto done;
}
@@ -829,21 +1088,20 @@ CanvasWidgetCmd(
grid = 0.0;
}
x += canvasPtr->xOrigin;
- Tcl_PrintDouble(interp, GridAlign((double) x, grid), buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(GridAlign((double)x,grid)));
break;
}
case CANV_CANVASY: {
int y;
double grid;
- char buf[TCL_DOUBLE_SPACE];
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "screeny ?gridspacing?");
result = TCL_ERROR;
goto done;
}
- if (Tk_GetPixelsFromObj(interp, canvasPtr->tkwin, objv[2], &y) != TCL_OK) {
+ if (Tk_GetPixelsFromObj(interp, canvasPtr->tkwin, objv[2],
+ &y) != TCL_OK) {
result = TCL_ERROR;
goto done;
}
@@ -857,8 +1115,7 @@ CanvasWidgetCmd(
grid = 0.0;
}
y += canvasPtr->yOrigin;
- Tcl_PrintDouble(interp, GridAlign((double) y, grid), buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(GridAlign((double)y,grid)));
break;
}
case CANV_CGET:
@@ -891,78 +1148,149 @@ CanvasWidgetCmd(
FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
if (objc != 3) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
- }
- if (itemPtr->typePtr->coordProc != NULL) {
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = (*itemPtr->typePtr->coordProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3);
- } else {
- CONST char **args = TkGetStringsFromObjs(objc-3, objv+3);
- result = (*itemPtr->typePtr->coordProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3,
- (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree((char *) args);
- }
- }
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
+ result = ItemCoords(canvasPtr, itemPtr, objc-3, objv+3);
if (objc != 3) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
}
break;
+ case CANV_IMOVE: {
+ double ignored;
+ Tcl_Obj *tmpObj;
+
+ if (objc != 6) {
+ Tcl_WrongNumArgs(interp, 2, objv, "tagOrId index x y");
+ result = TCL_ERROR;
+ goto done;
+ }
+ if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[4], &ignored) != TCL_OK
+ || Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[5], &ignored) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+
+ /*
+ * Make a temporary object here that we can reuse for all the
+ * modifications in the loop.
+ */
+
+ tmpObj = Tcl_NewListObj(2, objv+4);
+
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto doneImove) {
+ int index;
+ int x1,x2,y1,y2;
+ int dontRedraw1,dontRedraw2;
+
+ /*
+ * The TK_MOVABLE_POINTS flag should only be set for types that
+ * support the same semantics of index, dChars and insert methods
+ * as lines and canvases.
+ */
+
+ if (itemPtr == NULL ||
+ !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) {
+ continue;
+ }
+
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &index);
+ if (result != TCL_OK) {
+ break;
+ }
+
+ /*
+ * Redraw both item's old and new areas: it's possible that a
+ * replace could result in a new area larger than the old area.
+ * Except if the dCharsProc or insertProc sets the
+ * TK_ITEM_DONT_REDRAW flag, nothing more needs to be done.
+ */
+
+ x1 = itemPtr->x1; y1 = itemPtr->y1;
+ x2 = itemPtr->x2; y2 = itemPtr->y2;
+
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+ ItemDelChars(canvasPtr, itemPtr, index, index);
+ dontRedraw1=itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
+
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+ ItemInsert(canvasPtr, itemPtr, index, tmpObj);
+ dontRedraw2=itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW;
+
+ if (!(dontRedraw1 && dontRedraw2)) {
+ Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
+ x1, y1, x2, y2);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ }
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+ }
+
+ doneImove:
+ Tcl_DecrRefCount(tmpObj);
+ break;
+ }
case CANV_CREATE: {
Tk_ItemType *typePtr;
Tk_ItemType *matchPtr = NULL;
Tk_Item *itemPtr;
- char buf[TCL_INTEGER_SPACE];
int isNew = 0;
Tcl_HashEntry *entryPtr;
- char *arg;
+ const char *arg;
int length;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg ...?");
result = TCL_ERROR;
goto done;
}
arg = Tcl_GetStringFromObj(objv[2], &length);
c = arg[0];
+
+ /*
+ * Lock because the list of types is a global resource that could be
+ * updated by another thread. That's fairly unlikely, but not
+ * impossible.
+ */
+
Tcl_MutexLock(&typeListMutex);
- for (typePtr = typeList; typePtr != NULL; typePtr = typePtr->nextPtr) {
+ for (typePtr = typeList; typePtr != NULL; typePtr = typePtr->nextPtr){
if ((c == typePtr->name[0])
- && (strncmp(arg, typePtr->name, (unsigned)length) == 0)) {
+ && (!strncmp(arg, typePtr->name, (unsigned)length))) {
if (matchPtr != NULL) {
Tcl_MutexUnlock(&typeListMutex);
- badType:
- Tcl_AppendResult(interp,
- "unknown or ambiguous item type \"",arg,"\"",NULL);
- result = TCL_ERROR;
- goto done;
+ goto badType;
}
matchPtr = typePtr;
}
}
+
/*
- * Can unlock now because we no longer look at the fields of
- * the matched item type that are potentially modified by
- * other threads.
+ * Can unlock now because we no longer look at the fields of the
+ * matched item type that are potentially modified by other threads.
*/
+
Tcl_MutexUnlock(&typeListMutex);
if (matchPtr == NULL) {
- goto badType;
+ badType:
+ Tcl_AppendResult(interp,
+ "unknown or ambiguous item type \"", arg, "\"", NULL);
+ result = TCL_ERROR;
+ goto done;
}
if (objc < 4) {
/*
* Allow more specific error return.
*/
- Tcl_WrongNumArgs(interp, 3, objv, "coords ?arg arg ...?");
+
+ Tcl_WrongNumArgs(interp, 3, objv, "coords ?arg ...?");
result = TCL_ERROR;
goto done;
}
+
typePtr = matchPtr;
- itemPtr = (Tk_Item *) ckalloc((unsigned) typePtr->itemSize);
+ itemPtr = ckalloc(typePtr->itemSize);
itemPtr->id = canvasPtr->nextId;
canvasPtr->nextId++;
itemPtr->tagPtr = itemPtr->staticTagSpace;
@@ -971,22 +1299,13 @@ CanvasWidgetCmd(
itemPtr->typePtr = typePtr;
itemPtr->state = TK_STATE_NULL;
itemPtr->redraw_flags = 0;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc-3, objv+3);
- } else {
- CONST char **args = TkGetStringsFromObjs(objc-3, objv+3);
- result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
- itemPtr, objc-3, (Tcl_Obj **) args);
- if (args != NULL) {
- ckfree((char *) args);
- }
- }
- if (result != TCL_OK) {
- ckfree((char *) itemPtr);
+
+ if (ItemCreate(canvasPtr, itemPtr, objc, objv) != TCL_OK) {
+ ckfree(itemPtr);
result = TCL_ERROR;
goto done;
}
+
itemPtr->nextPtr = NULL;
entryPtr = Tcl_CreateHashEntry(&canvasPtr->idTable,
(char *) INT2PTR(itemPtr->id), &isNew);
@@ -1001,10 +1320,9 @@ CanvasWidgetCmd(
}
canvasPtr->lastItemPtr = itemPtr;
itemPtr->redraw_flags |= FORCE_REDRAW;
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
canvasPtr->flags |= REPICK_NEEDED;
- sprintf(buf, "%d", itemPtr->id);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(itemPtr->id));
break;
}
case CANV_DCHARS: {
@@ -1021,28 +1339,12 @@ CanvasWidgetCmd(
|| (itemPtr->typePtr->dCharsProc == NULL)) {
continue;
}
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
- &first);
- } else {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[3]),
- &first);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &first);
if (result != TCL_OK) {
goto done;
}
if (objc == 5) {
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[4],
- &last);
- } else {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr,
- Tcl_GetString(objv[4]), &last);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[4], &last);
if (result != TCL_OK) {
goto done;
}
@@ -1060,12 +1362,11 @@ CanvasWidgetCmd(
x1 = itemPtr->x1; y1 = itemPtr->y1;
x2 = itemPtr->x2; y2 = itemPtr->y2;
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
- (*itemPtr->typePtr->dCharsProc)((Tk_Canvas) canvasPtr,
- itemPtr, first, last);
+ ItemDelChars(canvasPtr, itemPtr, first, last);
if (!(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW)) {
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
x1, y1, x2, y2);
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
}
@@ -1077,15 +1378,13 @@ CanvasWidgetCmd(
for (i = 2; i < objc; i++) {
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[i], &searchPtr, goto done) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
if (canvasPtr->bindingTable != NULL) {
- Tk_DeleteAllBindings(canvasPtr->bindingTable,
- (ClientData) itemPtr);
+ Tk_DeleteAllBindings(canvasPtr->bindingTable, itemPtr);
}
- (*itemPtr->typePtr->deleteProc)((Tk_Canvas) canvasPtr, itemPtr,
- canvasPtr->display);
+ ItemDelete(canvasPtr, itemPtr);
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
- ckfree((char *) itemPtr->tagPtr);
+ ckfree(itemPtr->tagPtr);
}
entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable,
(char *) INT2PTR(itemPtr->id));
@@ -1105,7 +1404,7 @@ CanvasWidgetCmd(
if (canvasPtr->lastItemPtr == itemPtr) {
canvasPtr->lastItemPtr = itemPtr->prevPtr;
}
- ckfree((char *) itemPtr);
+ ckfree(itemPtr);
if (itemPtr == canvasPtr->currentItemPtr) {
canvasPtr->currentItemPtr = NULL;
canvasPtr->flags |= REPICK_NEEDED;
@@ -1154,16 +1453,11 @@ CanvasWidgetCmd(
}
case CANV_FIND:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "searchCommand ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "searchCommand ?arg ...?");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- result = FindItems(interp, canvasPtr, objc, objv, NULL, 2);
-#else /* USE_OLD_TAG_SEARCH */
- result = FindItems(interp, canvasPtr, objc, objv, NULL, 2,
- &searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ result = FIND_ITEMS(NULL, 2);
break;
case CANV_FOCUS:
if (objc > 3) {
@@ -1174,15 +1468,12 @@ CanvasWidgetCmd(
itemPtr = canvasPtr->textInfo.focusItemPtr;
if (objc == 2) {
if (itemPtr != NULL) {
- char buf[TCL_INTEGER_SPACE];
-
- sprintf(buf, "%d", itemPtr->id);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(itemPtr->id));
}
goto done;
}
- if ((itemPtr != NULL) && (canvasPtr->textInfo.gotFocus)) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ if (canvasPtr->textInfo.gotFocus) {
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
if (Tcl_GetString(objv[2])[0] == 0) {
canvasPtr->textInfo.focusItemPtr = NULL;
@@ -1198,7 +1489,7 @@ CanvasWidgetCmd(
}
canvasPtr->textInfo.focusItemPtr = itemPtr;
if (canvasPtr->textInfo.gotFocus) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
break;
case CANV_GETTAGS:
@@ -1228,30 +1519,20 @@ CanvasWidgetCmd(
|| (itemPtr->typePtr->icursorProc == NULL)) {
goto done;
}
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
- &index);
- } else {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[3]),
- &index);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &index);
if (result != TCL_OK) {
goto done;
}
- (*itemPtr->typePtr->icursorProc)((Tk_Canvas) canvasPtr, itemPtr,
- index);
+ ItemCursor(canvasPtr, itemPtr, index);
if ((itemPtr == canvasPtr->textInfo.focusItemPtr)
&& (canvasPtr->textInfo.cursorOn)) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
}
break;
}
case CANV_INDEX: {
int index;
- char buf[TCL_INTEGER_SPACE];
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId string");
@@ -1269,18 +1550,11 @@ CanvasWidgetCmd(
result = TCL_ERROR;
goto done;
}
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, (char *) objv[3], &index);
- } else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetString(objv[3]), &index);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &index);
if (result != TCL_OK) {
goto done;
}
- sprintf(buf, "%d", index);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
break;
}
case CANV_INSERT: {
@@ -1297,15 +1571,7 @@ CanvasWidgetCmd(
|| (itemPtr->typePtr->insertProc == NULL)) {
continue;
}
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
- &beforeThis);
- } else {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[3]),
- &beforeThis);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &beforeThis);
if (result != TCL_OK) {
goto done;
}
@@ -1320,17 +1586,11 @@ CanvasWidgetCmd(
x1 = itemPtr->x1; y1 = itemPtr->y1;
x2 = itemPtr->x2; y2 = itemPtr->y2;
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- (*itemPtr->typePtr->insertProc)((Tk_Canvas) canvasPtr,
- itemPtr, beforeThis, (char *) objv[4]);
- } else {
- (*itemPtr->typePtr->insertProc)((Tk_Canvas) canvasPtr,
- itemPtr, beforeThis, Tcl_GetString(objv[4]));
- }
+ ItemInsert(canvasPtr, itemPtr, beforeThis, objv[4]);
if (!(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW)) {
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
x1, y1, x2, y2);
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
}
@@ -1344,42 +1604,24 @@ CanvasWidgetCmd(
}
FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
- result = Tk_ConfigureValue(canvasPtr->interp, canvasPtr->tkwin,
- itemPtr->typePtr->configSpecs, (char *) itemPtr,
- Tcl_GetString(objv[3]), 0);
+ result = ItemConfigValue(canvasPtr, itemPtr, objv[3]);
}
break;
case CANV_ITEMCONFIGURE:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?option value ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?-option value ...?");
result = TCL_ERROR;
goto done;
}
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if (objc == 3) {
- result = Tk_ConfigureInfo(canvasPtr->interp, canvasPtr->tkwin,
- itemPtr->typePtr->configSpecs, (char *) itemPtr,
- NULL, 0);
+ result = ItemConfigInfo(canvasPtr, itemPtr, NULL);
} else if (objc == 4) {
- result = Tk_ConfigureInfo(canvasPtr->interp, canvasPtr->tkwin,
- itemPtr->typePtr->configSpecs, (char *) itemPtr,
- Tcl_GetString(objv[3]), 0);
+ result = ItemConfigInfo(canvasPtr, itemPtr, objv[3]);
} else {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = (*itemPtr->typePtr->configProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3,
- TK_CONFIG_ARGV_ONLY);
- } else {
- CONST char **args = TkGetStringsFromObjs(objc-3, objv+3);
- result = (*itemPtr->typePtr->configProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3,
- (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY);
- if (args != NULL) {
- ckfree((char *) args);
- }
- }
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ result = ItemConfigure(canvasPtr, itemPtr, objc-3, objv+3);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
canvasPtr->flags |= REPICK_NEEDED;
}
if ((result != TCL_OK) || (objc < 5)) {
@@ -1411,11 +1653,7 @@ CanvasWidgetCmd(
}
itemPtr = itemPtr->prevPtr;
}
-#ifdef USE_OLD_TAG_SEARCH
- RelinkItems(canvasPtr, objv[2], itemPtr);
-#else /* USE_OLD_TAG_SEARCH */
- result = RelinkItems(canvasPtr, objv[2], itemPtr, &searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ RELINK_ITEMS(objv[2], itemPtr);
break;
}
case CANV_MOVE: {
@@ -1433,20 +1671,82 @@ CanvasWidgetCmd(
goto done;
}
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
- (void) (*itemPtr->typePtr->translateProc)((Tk_Canvas) canvasPtr,
- itemPtr, xAmount, yAmount);
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ ItemTranslate(canvasPtr, itemPtr, xAmount, yAmount);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
canvasPtr->flags |= REPICK_NEEDED;
}
break;
}
+ case CANV_MOVETO: {
+ int xBlank, yBlank;
+ double xAmount, yAmount;
+ double oldX = 0, oldY = 0, newX, newY;
+
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "tagOrId x y");
+ result = TCL_ERROR;
+ goto done;
+ }
+
+ xBlank = 0;
+ if (Tcl_GetString(objv[3])[0] == '\0') {
+ xBlank = 1;
+ } else if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[3], &newX) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+
+ yBlank = 0;
+ if (Tcl_GetString(objv[4])[0] == '\0') {
+ yBlank = 1;
+ } else if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[4], &newY) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+
+ FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
+ if (itemPtr != NULL) {
+ oldX = itemPtr->x1;
+ oldY = itemPtr->y1;
+
+ /*
+ * Calculate the displacement.
+ */
+
+ if (xBlank) {
+ xAmount = 0;
+ } else {
+ xAmount = newX - oldX;
+ }
+
+ if (yBlank) {
+ yAmount = 0;
+ } else {
+ yAmount = newY - oldY;
+ }
+
+ /*
+ * Move the object(s).
+ */
+
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ ItemTranslate(canvasPtr, itemPtr, xAmount, yAmount);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ canvasPtr->flags |= REPICK_NEEDED;
+ }
+ }
+ break;
+ }
case CANV_POSTSCRIPT: {
- CONST char **args = TkGetStringsFromObjs(objc, objv);
+ const char **args = TkGetStringsFromObjs(objc, objv);
result = TkCanvPostscriptCmd(canvasPtr, interp, objc, args);
if (args != NULL) {
- ckfree((char *) args);
+ ckfree(args);
}
break;
}
@@ -1477,18 +1777,62 @@ CanvasWidgetCmd(
goto done;
}
}
-#ifdef USE_OLD_TAG_SEARCH
- RelinkItems(canvasPtr, objv[2], prevPtr);
-#else /* USE_OLD_TAG_SEARCH */
- result = RelinkItems(canvasPtr, objv[2], prevPtr, &searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ RELINK_ITEMS(objv[2], prevPtr);
+ break;
+ }
+ case CANV_RCHARS: {
+ int first, last;
+ int x1,x2,y1,y2;
+
+ if (objc != 6) {
+ Tcl_WrongNumArgs(interp, 2, objv, "tagOrId first last string");
+ result = TCL_ERROR;
+ goto done;
+ }
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
+ if ((itemPtr->typePtr->indexProc == NULL)
+ || (itemPtr->typePtr->dCharsProc == NULL)
+ || (itemPtr->typePtr->insertProc == NULL)) {
+ continue;
+ }
+ result = ItemIndex(canvasPtr, itemPtr, objv[3], &first);
+ if (result != TCL_OK) {
+ goto done;
+ }
+ result = ItemIndex(canvasPtr, itemPtr, objv[4], &last);
+ if (result != TCL_OK) {
+ goto done;
+ }
+
+ /*
+ * Redraw both item's old and new areas: it's possible that a
+ * replace could result in a new area larger than the old area.
+ * Except if the dCharsProc or insertProc sets the
+ * TK_ITEM_DONT_REDRAW flag, nothing more needs to be done.
+ */
+
+ x1 = itemPtr->x1; y1 = itemPtr->y1;
+ x2 = itemPtr->x2; y2 = itemPtr->y2;
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+
+ ItemDelChars(canvasPtr, itemPtr, first, last);
+ ItemInsert(canvasPtr, itemPtr, first, objv[5]);
+
+ if (!(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW)) {
+ Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
+ x1, y1, x2, y2);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ }
+ itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
+ }
break;
}
case CANV_SCALE: {
double xOrigin, yOrigin, xScale, yScale;
if (objc != 7) {
- Tcl_WrongNumArgs(interp, 2, objv, "tagOrId xOrigin yOrigin xScale yScale");
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "tagOrId xOrigin yOrigin xScale yScale");
result = TCL_ERROR;
goto done;
}
@@ -1496,8 +1840,8 @@ CanvasWidgetCmd(
objv[3], &xOrigin) != TCL_OK)
|| (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
objv[4], &yOrigin) != TCL_OK)
- || (Tcl_GetDoubleFromObj(interp, objv[5], &xScale) != TCL_OK)
- || (Tcl_GetDoubleFromObj(interp, objv[6], &yScale) != TCL_OK)) {
+ || (Tcl_GetDoubleFromObj(interp, objv[5], &xScale)!=TCL_OK)
+ || (Tcl_GetDoubleFromObj(interp, objv[6], &yScale)!=TCL_OK)) {
result = TCL_ERROR;
goto done;
}
@@ -1507,17 +1851,16 @@ CanvasWidgetCmd(
goto done;
}
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
- (void) (*itemPtr->typePtr->scaleProc)((Tk_Canvas) canvasPtr,
- itemPtr, xOrigin, yOrigin, xScale, yScale);
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
+ ItemScale(canvasPtr, itemPtr, xOrigin, yOrigin, xScale, yScale);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
canvasPtr->flags |= REPICK_NEEDED;
}
break;
}
case CANV_SCAN: {
int x, y, gain = 10;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"mark", "dragto", NULL
};
@@ -1561,7 +1904,7 @@ CanvasWidgetCmd(
}
case CANV_SELECT: {
int index, optionindex;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"adjust", "clear", "from", "item", "to", NULL
};
enum options {
@@ -1589,15 +1932,7 @@ CanvasWidgetCmd(
}
}
if (objc == 5) {
- if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[4],
- &index);
- } else {
- result = itemPtr->typePtr->indexProc(interp,
- (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[4]),
- &index);
- }
+ result = ItemIndex(canvasPtr, itemPtr, objv[4], &index);
if (result != TCL_OK) {
goto done;
}
@@ -1632,12 +1967,8 @@ CanvasWidgetCmd(
result = TCL_ERROR;
goto done;
}
- if (canvasPtr->textInfo.selItemPtr != NULL) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->textInfo.selItemPtr);
- canvasPtr->textInfo.selItemPtr = NULL;
- }
- goto done;
+ EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.selItemPtr);
+ canvasPtr->textInfo.selItemPtr = NULL;
break;
case CANV_FROM:
if (objc != 5) {
@@ -1678,13 +2009,14 @@ CanvasWidgetCmd(
}
FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
- Tcl_SetResult(interp, itemPtr->typePtr->name, TCL_STATIC);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(itemPtr->typePtr->name, -1));
}
break;
case CANV_XVIEW: {
int count, type;
- int newX = 0; /* Initialization needed only to prevent
- * gcc warnings. */
+ int newX = 0; /* Initialization needed only to prevent gcc
+ * warnings. */
double fraction;
if (objc == 2) {
@@ -1694,10 +2026,11 @@ CanvasWidgetCmd(
- canvasPtr->inset, canvasPtr->scrollX1,
canvasPtr->scrollX2));
} else {
- CONST char **args = TkGetStringsFromObjs(objc, objv);
+ const char **args = TkGetStringsFromObjs(objc, objv);
+
type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
if (args != NULL) {
- ckfree((char *) args);
+ ckfree(args);
}
switch (type) {
case TK_SCROLL_ERROR:
@@ -1729,8 +2062,8 @@ CanvasWidgetCmd(
}
case CANV_YVIEW: {
int count, type;
- int newY = 0; /* Initialization needed only to prevent
- * gcc warnings. */
+ int newY = 0; /* Initialization needed only to prevent gcc
+ * warnings. */
double fraction;
if (objc == 2) {
@@ -1740,10 +2073,11 @@ CanvasWidgetCmd(
- canvasPtr->inset,
canvasPtr->scrollY1, canvasPtr->scrollY2));
} else {
- CONST char **args = TkGetStringsFromObjs(objc, objv);
+ const char **args = TkGetStringsFromObjs(objc, objv);
+
type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
if (args != NULL) {
- ckfree((char *) args);
+ ckfree(args);
}
switch (type) {
case TK_SCROLL_ERROR:
@@ -1780,7 +2114,7 @@ CanvasWidgetCmd(
#ifndef USE_OLD_TAG_SEARCH
TagSearchDestroy(searchPtr);
#endif /* not USE_OLD_TAG_SEARCH */
- Tcl_Release((ClientData) canvasPtr);
+ Tcl_Release(canvasPtr);
return result;
}
@@ -1819,12 +2153,11 @@ DestroyCanvas(
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = canvasPtr->firstItemPtr) {
canvasPtr->firstItemPtr = itemPtr->nextPtr;
- (*itemPtr->typePtr->deleteProc)((Tk_Canvas) canvasPtr, itemPtr,
- canvasPtr->display);
+ ItemDelete(canvasPtr, itemPtr);
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
- ckfree((char *) itemPtr->tagPtr);
+ ckfree(itemPtr->tagPtr);
}
- ckfree((char *) itemPtr);
+ ckfree(itemPtr);
}
/*
@@ -1850,7 +2183,7 @@ DestroyCanvas(
}
Tk_FreeOptions(configSpecs, (char *) canvasPtr, canvasPtr->display, 0);
canvasPtr->tkwin = NULL;
- ckfree((char *) canvasPtr);
+ ckfree(canvasPtr);
}
/*
@@ -1879,7 +2212,7 @@ ConfigureCanvas(
TkCanvas *canvasPtr, /* 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[], /* Argument objects. */
+ Tcl_Obj *const objv[], /* Argument objects. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
XGCValues gcValues;
@@ -1887,7 +2220,7 @@ ConfigureCanvas(
Tk_State old_canvas_state=canvasPtr->canvas_state;
if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
- objc, (CONST char **) objv, (char *) canvasPtr,
+ objc, (const char **) objv, (char *) canvasPtr,
flags|TK_CONFIG_OBJS) != TCL_OK) {
return TCL_ERROR;
}
@@ -1935,7 +2268,7 @@ ConfigureCanvas(
}
}
- /*
+ /*
* Reset the desired dimensions for the window.
*/
@@ -1961,7 +2294,7 @@ ConfigureCanvas(
canvasPtr->scrollY2 = 0;
if (canvasPtr->regionString != NULL) {
int argc2;
- CONST char **argv2;
+ const char **argv2;
if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString,
&argc2, &argv2) != TCL_OK) {
@@ -1970,9 +2303,9 @@ ConfigureCanvas(
if (argc2 != 4) {
Tcl_AppendResult(interp, "bad scrollRegion \"",
canvasPtr->regionString, "\"", NULL);
- badRegion:
+ badRegion:
ckfree(canvasPtr->regionString);
- ckfree((char *) argv2);
+ ckfree(argv2);
canvasPtr->regionString = NULL;
return TCL_ERROR;
}
@@ -1986,7 +2319,7 @@ ConfigureCanvas(
argv2[3], &canvasPtr->scrollY2) != TCL_OK)) {
goto badRegion;
}
- ckfree((char *) argv2);
+ ckfree(argv2);
}
flags = canvasPtr->tsoffset.flags;
@@ -2020,7 +2353,7 @@ ConfigureCanvas(
}
/*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* CanvasWorldChanged --
*
@@ -2036,24 +2369,19 @@ ConfigureCanvas(
* side effect of causing all the items to recompute their geometry and
* to be redisplayed.
*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
CanvasWorldChanged(
ClientData instanceData) /* Information about widget. */
{
- TkCanvas *canvasPtr;
+ TkCanvas *canvasPtr = instanceData;
Tk_Item *itemPtr;
- int result;
- canvasPtr = (TkCanvas *) instanceData;
itemPtr = canvasPtr->firstItemPtr;
for ( ; itemPtr != NULL; itemPtr = itemPtr->nextPtr) {
- result = (*itemPtr->typePtr->configProc)(canvasPtr->interp,
- (Tk_Canvas) canvasPtr, itemPtr, 0, NULL,
- TK_CONFIG_ARGV_ONLY);
- if (result != TCL_OK) {
+ if (ItemConfigure(canvasPtr, itemPtr, 0, NULL) != TCL_OK) {
Tcl_ResetResult(canvasPtr->interp);
}
}
@@ -2065,7 +2393,7 @@ CanvasWorldChanged(
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* DisplayCanvas --
*
@@ -2079,14 +2407,14 @@ CanvasWorldChanged(
* Side effects:
* Information appears on the screen.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
DisplayCanvas(
ClientData clientData) /* Information about widget. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
Tk_Window tkwin = canvasPtr->tkwin;
Tk_Item *itemPtr;
Pixmap pixmap;
@@ -2106,11 +2434,11 @@ DisplayCanvas(
*/
while (canvasPtr->flags & REPICK_NEEDED) {
- Tcl_Preserve((ClientData) canvasPtr);
+ Tcl_Preserve(canvasPtr);
canvasPtr->flags &= ~REPICK_NEEDED;
PickCurrentItem(canvasPtr, &canvasPtr->pickEvent);
tkwin = canvasPtr->tkwin;
- Tcl_Release((ClientData) canvasPtr);
+ Tcl_Release(canvasPtr);
if (tkwin == NULL) {
return;
}
@@ -2123,13 +2451,14 @@ DisplayCanvas(
*/
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
- itemPtr = itemPtr->nextPtr) {
+ itemPtr = itemPtr->nextPtr) {
if (itemPtr->redraw_flags & FORCE_REDRAW) {
itemPtr->redraw_flags &= ~FORCE_REDRAW;
- EventuallyRedrawItem((Tk_Canvas)canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
itemPtr->redraw_flags &= ~FORCE_REDRAW;
}
}
+
/*
* Compute the intersection between the area that needs redrawing and the
* area that's visible on the screen.
@@ -2227,7 +2556,7 @@ DisplayCanvas(
|| (itemPtr->y1 >= screenY2)
|| (itemPtr->x2 < screenX1)
|| (itemPtr->y2 < screenY1)) {
- if (!(itemPtr->typePtr->alwaysRedraw & 1)
+ if (!AlwaysRedraw(itemPtr)
|| (itemPtr->x1 >= canvasPtr->redrawX2)
|| (itemPtr->y1 >= canvasPtr->redrawY2)
|| (itemPtr->x2 < canvasPtr->redrawX1)
@@ -2236,12 +2565,11 @@ DisplayCanvas(
}
}
if (itemPtr->state == TK_STATE_HIDDEN ||
- (itemPtr->state == TK_STATE_NULL &&
- canvasPtr->canvas_state == TK_STATE_HIDDEN)) {
+ (itemPtr->state == TK_STATE_NULL &&
+ canvasPtr->canvas_state == TK_STATE_HIDDEN)) {
continue;
}
- (*itemPtr->typePtr->displayProc)((Tk_Canvas) canvasPtr, itemPtr,
- canvasPtr->display, pixmap, screenX1, screenY1, width,
+ ItemDisplay(canvasPtr, itemPtr, pixmap, screenX1, screenY1, width,
height);
}
@@ -2305,7 +2633,7 @@ DisplayCanvas(
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* CanvasEventProc --
*
@@ -2316,10 +2644,10 @@ DisplayCanvas(
* None.
*
* Side effects:
- * When the window gets deleted, internal structures get cleaned up.
- * When it gets exposed, it is redisplayed.
+ * When the window gets deleted, internal structures get cleaned up. When
+ * it gets exposed, it is redisplayed.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
@@ -2327,7 +2655,7 @@ CanvasEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
if (eventPtr->type == Expose) {
int x, y;
@@ -2352,10 +2680,9 @@ CanvasEventProc(
canvasPtr->widgetCmd);
}
if (canvasPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayCanvas, (ClientData) canvasPtr);
+ Tcl_CancelIdleCall(DisplayCanvas, canvasPtr);
}
- Tcl_EventuallyFree((ClientData) canvasPtr,
- (Tcl_FreeProc *) DestroyCanvas);
+ Tcl_EventuallyFree(canvasPtr, (Tcl_FreeProc *) DestroyCanvas);
} else if (eventPtr->type == ConfigureNotify) {
canvasPtr->flags |= UPDATE_SCROLLBARS;
@@ -2389,9 +2716,8 @@ CanvasEventProc(
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = itemPtr->nextPtr) {
- if (itemPtr->typePtr->alwaysRedraw & 1) {
- (*itemPtr->typePtr->displayProc)((Tk_Canvas) canvasPtr,
- itemPtr, canvasPtr->display, None, 0, 0, 0, 0);
+ if (AlwaysRedraw(itemPtr)) {
+ ItemDisplay(canvasPtr, itemPtr, None, 0, 0, 0, 0);
}
}
}
@@ -2419,7 +2745,7 @@ static void
CanvasCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
Tk_Window tkwin = canvasPtr->tkwin;
/*
@@ -2436,7 +2762,7 @@ CanvasCmdDeletedProc(
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_CanvasEventuallyRedraw --
*
@@ -2449,7 +2775,7 @@ CanvasCmdDeletedProc(
* Side effects:
* The screen will eventually be refreshed.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
@@ -2460,7 +2786,7 @@ Tk_CanvasEventuallyRedraw(
int x2, int y2) /* Lower right corner of area to redraw.
* Pixels on edge are not redrawn. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
+ TkCanvas *canvasPtr = Canvas(canvas);
/*
* If tkwin is NULL, the canvas has been destroyed, so we can't really
@@ -2498,13 +2824,13 @@ Tk_CanvasEventuallyRedraw(
canvasPtr->flags |= BBOX_NOT_EMPTY;
}
if (!(canvasPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayCanvas, (ClientData) canvasPtr);
+ Tcl_DoWhenIdle(DisplayCanvas, canvasPtr);
canvasPtr->flags |= REDRAW_PENDING;
}
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* EventuallyRedrawItem --
*
@@ -2517,21 +2843,24 @@ Tk_CanvasEventuallyRedraw(
* Side effects:
* The screen will eventually be refreshed.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
EventuallyRedrawItem(
- Tk_Canvas canvas, /* Information about widget. */
- Tk_Item *itemPtr) /* Item to be redrawn. */
+ TkCanvas *canvasPtr, /* Information about widget. */
+ Tk_Item *itemPtr) /* Item to be redrawn. May be NULL, in which
+ * case nothing happens. */
{
- TkCanvas *canvasPtr = (TkCanvas *) canvas;
+ if (itemPtr == NULL) {
+ return;
+ }
if ((itemPtr->x1 >= itemPtr->x2) || (itemPtr->y1 >= itemPtr->y2) ||
(itemPtr->x2 < canvasPtr->xOrigin) ||
(itemPtr->y2 < canvasPtr->yOrigin) ||
- (itemPtr->x1 >= canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin)) ||
- (itemPtr->y1 >= canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin))) {
- if (!(itemPtr->typePtr->alwaysRedraw & 1)) {
+ (itemPtr->x1 >= canvasPtr->xOrigin+Tk_Width(canvasPtr->tkwin)) ||
+ (itemPtr->y1 >= canvasPtr->yOrigin+Tk_Height(canvasPtr->tkwin))) {
+ if (!AlwaysRedraw(itemPtr)) {
return;
}
}
@@ -2559,13 +2888,13 @@ EventuallyRedrawItem(
itemPtr->redraw_flags |= FORCE_REDRAW;
}
if (!(canvasPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayCanvas, (ClientData) canvasPtr);
+ Tcl_DoWhenIdle(DisplayCanvas, canvasPtr);
canvasPtr->flags |= REDRAW_PENDING;
}
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_CreateItemType --
*
@@ -2581,7 +2910,7 @@ EventuallyRedrawItem(
* commands). If there was already a type with the same name as in
* typePtr, it is replaced with the new type.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
@@ -2721,11 +3050,8 @@ StartTagSearch(
Tk_Uid uid;
char *tag = Tcl_GetString(tagObj);
int count;
- TkWindow *tkwin;
- TkDisplay *dispPtr;
-
- tkwin = (TkWindow *) canvasPtr->tkwin;
- dispPtr = tkwin->dispPtr;
+ TkWindow *tkwin = (TkWindow *) canvasPtr->tkwin;
+ TkDisplay *dispPtr = tkwin->dispPtr;
/*
* Initialize the search.
@@ -2753,9 +3079,9 @@ StartTagSearch(
if ((itemPtr == NULL) || (itemPtr->id != id) || (lastPtr == NULL)
|| (lastPtr->nextPtr != itemPtr)) {
dispPtr->numSlowSearches++;
- entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char *) id);
+ entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char*) id);
if (entryPtr != NULL) {
- itemPtr = (Tk_Item *)Tcl_GetHashValue(entryPtr);
+ itemPtr = Tcl_GetHashValue(entryPtr);
lastPtr = itemPtr->prevPtr;
} else {
lastPtr = itemPtr = NULL;
@@ -2911,7 +3237,7 @@ NextItem(
static SearchUids *
GetStaticUids(void)
{
- SearchUids *searchUids = (SearchUids *)
+ SearchUids *searchUids =
Tcl_GetThreadData(&dataKey, sizeof(SearchUids));
if (searchUids->allUid == NULL) {
@@ -2947,10 +3273,10 @@ static void
TagSearchExprInit(
TagSearchExpr **exprPtrPtr)
{
- TagSearchExpr* expr = *exprPtrPtr;
+ TagSearchExpr *expr = *exprPtrPtr;
- if (! expr) {
- expr = (TagSearchExpr *) ckalloc(sizeof(TagSearchExpr));
+ if (expr == NULL) {
+ expr = ckalloc(sizeof(TagSearchExpr));
expr->allocated = 0;
expr->uids = NULL;
expr->next = NULL;
@@ -2979,11 +3305,11 @@ static void
TagSearchExprDestroy(
TagSearchExpr *expr)
{
- if (expr) {
+ if (expr != NULL) {
if (expr->uids) {
- ckfree((char *)expr->uids);
+ ckfree(expr->uids);
}
- ckfree((char *)expr);
+ ckfree(expr);
}
}
@@ -3016,7 +3342,7 @@ TagSearchScan(
TagSearch **searchPtrPtr) /* Record describing tag search; will be
* initialized here. */
{
- char *tag = Tcl_GetString(tagObj);
+ const char *tag = Tcl_GetString(tagObj);
int i;
TagSearch *searchPtr;
@@ -3024,14 +3350,14 @@ TagSearchScan(
* Initialize the search.
*/
- if (*searchPtrPtr) {
+ if (*searchPtrPtr != NULL) {
searchPtr = *searchPtrPtr;
} else {
/*
* Allocate primary search struct on first call.
*/
- *searchPtrPtr = searchPtr = (TagSearch *) ckalloc(sizeof(TagSearch));
+ *searchPtrPtr = searchPtr = ckalloc(sizeof(TagSearch));
searchPtr->expr = NULL;
/*
@@ -3041,7 +3367,7 @@ TagSearchScan(
searchPtr->rewritebufferAllocated = 100;
searchPtr->rewritebuffer = ckalloc(searchPtr->rewritebufferAllocated);
}
- TagSearchExprInit(&(searchPtr->expr));
+ TagSearchExprInit(&searchPtr->expr);
/*
* How long is the tagOrId?
@@ -3053,7 +3379,7 @@ TagSearchScan(
* Make sure there is enough buffer to hold rewritten tags.
*/
- if ((unsigned int)searchPtr->stringLength >=
+ if ((unsigned) searchPtr->stringLength >=
searchPtr->rewritebufferAllocated) {
searchPtr->rewritebufferAllocated = searchPtr->stringLength + 100;
searchPtr->rewritebuffer =
@@ -3091,6 +3417,7 @@ TagSearchScan(
* kept forever, but this should be thought of as a cache rather than as a
* memory leak.
*/
+
searchPtr->expr->uid = Tk_GetUid(tag);
/*
@@ -3102,8 +3429,8 @@ TagSearchScan(
}
/*
- * Pre-scan tag for at least one unquoted "&&" "||" "^" "!"
- * if not found then use string as simple tag
+ * Pre-scan tag for at least one unquoted "&&" "||" "^" "!"; if not found
+ * then use string as simple tag.
*/
for (i = 0; i < searchPtr->stringLength ; i++) {
@@ -3180,12 +3507,12 @@ TagSearchScan(
static void
TagSearchDestroy(
- TagSearch *searchPtr) /* Record describing tag search */
+ TagSearch *searchPtr) /* Record describing tag search. */
{
if (searchPtr) {
TagSearchExprDestroy(searchPtr->expr);
- ckfree((char *)searchPtr->rewritebuffer);
- ckfree((char *)searchPtr);
+ ckfree(searchPtr->rewritebuffer);
+ ckfree(searchPtr);
}
}
@@ -3211,15 +3538,15 @@ TagSearchDestroy(
static int
TagSearchScanExpr(
Tcl_Interp *interp, /* Current interpreter. */
- TagSearch *searchPtr, /* Search data */
- TagSearchExpr *expr) /* compiled expression result */
+ TagSearch *searchPtr, /* Search data. */
+ TagSearchExpr *expr) /* Compiled expression result. */
{
int looking_for_tag; /* When true, scanner expects next char(s) to
- * be a tag, else operand expected */
- int found_tag; /* One or more tags found */
- int found_endquote; /* For quoted tag string parsing */
- int negate_result; /* Pending negation of next tag value */
- char *tag; /* Tag from tag expression string */
+ * be a tag, else operand expected. */
+ int found_tag; /* One or more tags found. */
+ int found_endquote; /* For quoted tag string parsing. */
+ int negate_result; /* Pending negation of next tag value. */
+ char *tag; /* Tag from tag expression string. */
char c;
SearchUids *searchUids; /* Collection of uids for basic search
* expression terms. */
@@ -3238,36 +3565,32 @@ TagSearchScanExpr(
if (expr->index >= expr->allocated-1) {
expr->allocated += 15;
if (expr->uids) {
- expr->uids = (Tk_Uid *)
- ckrealloc((char *)(expr->uids),
- (expr->allocated)*sizeof(Tk_Uid));
+ expr->uids = ckrealloc(expr->uids,
+ expr->allocated * sizeof(Tk_Uid));
} else {
- expr->uids = (Tk_Uid *)
- ckalloc((expr->allocated)*sizeof(Tk_Uid));
+ expr->uids = ckalloc(expr->allocated * sizeof(Tk_Uid));
}
}
if (looking_for_tag) {
-
switch (c) {
- case ' ': /* ignore unquoted whitespace */
+ case ' ': /* Ignore unquoted whitespace */
case '\t':
case '\n':
case '\r':
break;
- case '!': /* negate next tag or subexpr */
+ case '!': /* Negate next tag or subexpr */
if (looking_for_tag > 1) {
Tcl_AppendResult(interp,
- "Too many '!' in tag search expression",
- NULL);
+ "Too many '!' in tag search expression", NULL);
return TCL_ERROR;
}
looking_for_tag++;
negate_result = 1;
break;
- case '(': /* scan (negated) subexpr recursively */
+ case '(': /* Scan (negated) subexpr recursively */
if (negate_result) {
expr->uids[expr->index++] = searchUids->negparenUid;
negate_result = 0;
@@ -3286,7 +3609,7 @@ TagSearchScanExpr(
found_tag = 1;
break;
- case '"': /* quoted tag string */
+ case '"': /* Quoted tag string */
if (negate_result) {
expr->uids[expr->index++] = searchUids->negtagvalUid;
negate_result = 0;
@@ -3306,13 +3629,13 @@ TagSearchScanExpr(
}
*tag++ = c;
}
- if (! found_endquote) {
+ if (!found_endquote) {
Tcl_AppendResult(interp,
"Missing endquote in tag search expression",
NULL);
return TCL_ERROR;
}
- if (! (tag - searchPtr->rewritebuffer)) {
+ if (!(tag - searchPtr->rewritebuffer)) {
Tcl_AppendResult(interp,
"Null quoted tag string in tag search expression",
NULL);
@@ -3325,7 +3648,7 @@ TagSearchScanExpr(
found_tag = 1;
break;
- case '&': /* illegal chars when looking for tag */
+ case '&': /* Illegal chars when looking for tag */
case '|':
case '^':
case ')':
@@ -3334,7 +3657,7 @@ TagSearchScanExpr(
NULL);
return TCL_ERROR;
- default: /* unquoted tag string */
+ default: /* Unquoted tag string */
if (negate_result) {
expr->uids[expr->index++] = searchUids->negtagvalUid;
negate_result = 0;
@@ -3381,48 +3704,46 @@ TagSearchScanExpr(
found_tag = 1;
}
- } else { /* ! looking_for_tag */
+ } else { /* ! looking_for_tag */
switch (c) {
- case ' ': /* ignore whitespace */
+ case ' ': /* Ignore whitespace */
case '\t':
case '\n':
case '\r':
break;
- case '&': /* AND operator */
+ case '&': /* AND operator */
c = searchPtr->string[searchPtr->stringIndex++];
if (c != '&') {
Tcl_AppendResult(interp,
- "Singleton '&' in tag search expression",
- NULL);
+ "Singleton '&' in tag search expression", NULL);
return TCL_ERROR;
}
expr->uids[expr->index++] = searchUids->andUid;
looking_for_tag = 1;
break;
- case '|': /* OR operator */
+ case '|': /* OR operator */
c = searchPtr->string[searchPtr->stringIndex++];
if (c != '|') {
Tcl_AppendResult(interp,
- "Singleton '|' in tag search expression",
- NULL);
+ "Singleton '|' in tag search expression", NULL);
return TCL_ERROR;
}
expr->uids[expr->index++] = searchUids->orUid;
looking_for_tag = 1;
break;
- case '^' : /* XOR operator */
+ case '^': /* XOR operator */
expr->uids[expr->index++] = searchUids->xorUid;
looking_for_tag = 1;
break;
- case ')' : /* end subexpression */
+ case ')': /* End subexpression */
expr->uids[expr->index++] = searchUids->endparenUid;
goto breakwhile;
- default: /* syntax error */
+ default: /* syntax error */
Tcl_AppendResult(interp,
"Invalid boolean operator in tag search expression",
NULL);
@@ -3432,7 +3753,7 @@ TagSearchScanExpr(
}
breakwhile:
- if (found_tag && ! looking_for_tag) {
+ if (found_tag && !looking_for_tag) {
return TCL_OK;
}
Tcl_AppendResult(interp, "Missing tag in tag search expression", NULL);
@@ -3472,7 +3793,7 @@ TagSearchEvalExpr(
* expression terms. */
searchUids = GetStaticUids();
- result = 0; /* just to keep the compiler quiet */
+ result = 0; /* Just to keep the compiler quiet. */
negate_result = 0;
looking_for_tag = 1;
@@ -3507,7 +3828,7 @@ TagSearchEvalExpr(
result = 0;
/*
- * set result 1 if tag is found in item's tags
+ * set result 1 if tag is found in item's tags.
*/
for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
@@ -3520,30 +3841,26 @@ TagSearchEvalExpr(
} else if (uid == searchUids->parenUid) {
/*
- * Evaluate subexpressions with recursion
+ * Evaluate subexpressions with recursion.
*/
result = TagSearchEvalExpr(expr, itemPtr);
} else if (uid == searchUids->negparenUid) {
- negate_result = ! negate_result;
+ negate_result = !negate_result;
/*
- * Evaluate subexpressions with recursion
+ * Evaluate subexpressions with recursion.
*/
result = TagSearchEvalExpr(expr, itemPtr);
-/*
- * } else {
- * assert(0);
- */
}
if (negate_result) {
result = ! result;
negate_result = 0;
}
looking_for_tag = 0;
- } else { /* ! looking_for_tag */
+ } else { /* ! looking_for_tag */
if (((uid == searchUids->andUid) && (!result)) ||
((uid == searchUids->orUid) && result)) {
/*
@@ -3585,16 +3902,12 @@ TagSearchEvalExpr(
} else if (uid == searchUids->endparenUid) {
return result;
-/*
- * } else {
- * assert(0);
- */
}
looking_for_tag = 1;
}
}
/*
- * assert(! looking_for_tag);
+ * assert(!looking_for_tag);
*/
return result;
}
@@ -3653,7 +3966,7 @@ TagSearchFirst(
entryPtr = Tcl_FindHashEntry(&searchPtr->canvasPtr->idTable,
(char *) INT2PTR(searchPtr->id));
if (entryPtr != NULL) {
- itemPtr = (Tk_Item *)Tcl_GetHashValue(entryPtr);
+ itemPtr = Tcl_GetHashValue(entryPtr);
lastPtr = itemPtr->prevPtr;
} else {
lastPtr = itemPtr = NULL;
@@ -3683,7 +3996,7 @@ TagSearchFirst(
uid = searchPtr->expr->uid;
for (lastPtr = NULL, itemPtr = searchPtr->canvasPtr->firstItemPtr;
- itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
+ itemPtr != NULL; lastPtr=itemPtr, itemPtr=itemPtr->nextPtr) {
for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
count > 0; tagPtr++, count--) {
if (*tagPtr == uid) {
@@ -3694,7 +4007,6 @@ TagSearchFirst(
}
}
} else {
-
/*
* None of the above. Search for an item matching the tag expression.
*/
@@ -3876,12 +4188,11 @@ DoItem(
Tk_Uid *newTagPtr;
itemPtr->tagSpace += 5;
- newTagPtr = (Tk_Uid *)
- ckalloc((unsigned) (itemPtr->tagSpace * sizeof(Tk_Uid)));
+ newTagPtr = ckalloc(itemPtr->tagSpace * sizeof(Tk_Uid));
memcpy((void *) newTagPtr, itemPtr->tagPtr,
itemPtr->numTags * sizeof(Tk_Uid));
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
- ckfree((char *) itemPtr->tagPtr);
+ ckfree(itemPtr->tagPtr);
}
itemPtr->tagPtr = newTagPtr;
tagPtr = &itemPtr->tagPtr[itemPtr->numTags];
@@ -3924,7 +4235,7 @@ FindItems(
TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */
int objc, /* Number of entries in argv. Must be greater
* than zero. */
- Tcl_Obj *CONST *objv, /* Arguments that describe what items to
+ Tcl_Obj *const *objv, /* Arguments that describe what items to
* search for (see user doc on "find" and
* "addtag" options). */
Tcl_Obj *newTag, /* If non-NULL, gives new tag to set on all
@@ -3945,7 +4256,7 @@ FindItems(
Tk_Item *itemPtr;
Tk_Uid uid;
int index, result;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"above", "all", "below", "closest",
"enclosed", "overlapping", "withtag", NULL
};
@@ -4015,14 +4326,15 @@ FindItems(
Tcl_WrongNumArgs(interp, first+1, objv, "x y ?halo? ?start?");
return TCL_ERROR;
}
- if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[first+1],
- &coords[0]) != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp,
- (Tk_Canvas) canvasPtr, objv[first+2], &coords[1]) != TCL_OK)) {
+ if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[first+1], &coords[0]) != TCL_OK
+ || Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[first+2], &coords[1]) != TCL_OK) {
return TCL_ERROR;
}
if (objc > first+3) {
- if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[first+3],
- &halo) != TCL_OK) {
+ if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr,
+ objv[first+3], &halo) != TCL_OK) {
return TCL_ERROR;
}
if (halo < 0.0) {
@@ -4064,11 +4376,7 @@ FindItems(
if (itemPtr == NULL) {
return TCL_OK;
}
- closestDist = (*itemPtr->typePtr->pointProc)((Tk_Canvas) canvasPtr,
- itemPtr, coords) - halo;
- if (closestDist < 0.0) {
- closestDist = 0.0;
- }
+ closestDist = ItemPoint(canvasPtr, itemPtr, coords, halo);
while (1) {
double newDist;
@@ -4107,11 +4415,7 @@ FindItems(
|| (itemPtr->y1 >= y2) || (itemPtr->y2 <= y1)) {
continue;
}
- newDist = (*itemPtr->typePtr->pointProc)((Tk_Canvas) canvasPtr,
- itemPtr, coords) - halo;
- if (newDist < 0.0) {
- newDist = 0.0;
- }
+ newDist = ItemPoint(canvasPtr, itemPtr, coords, halo);
if (newDist <= closestDist) {
closestDist = newDist;
break;
@@ -4172,7 +4476,7 @@ FindArea(
Tcl_Interp *interp, /* Interpreter for error reporting and result
* storing. */
TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */
- Tcl_Obj *CONST *objv, /* Array of four arguments that give the
+ Tcl_Obj *const *objv, /* Array of four arguments that give the
* coordinates of the rectangular area to
* search. */
Tk_Uid uid, /* If non-NULL, gives new tag to set on all
@@ -4188,11 +4492,11 @@ FindArea(
if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[0],
&rect[0]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[1],
+ || (Tk_CanvasGetCoordFromObj(interp,(Tk_Canvas)canvasPtr,objv[1],
&rect[1]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[2],
+ || (Tk_CanvasGetCoordFromObj(interp,(Tk_Canvas)canvasPtr,objv[2],
&rect[2]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[3],
+ || (Tk_CanvasGetCoordFromObj(interp,(Tk_Canvas)canvasPtr,objv[3],
&rect[3]) != TCL_OK)) {
return TCL_ERROR;
}
@@ -4208,22 +4512,22 @@ FindArea(
* item-specific code except for items that are close.
*/
- x1 = (int) (rect[0]-1.0);
- y1 = (int) (rect[1]-1.0);
- x2 = (int) (rect[2]+1.0);
- y2 = (int) (rect[3]+1.0);
+ x1 = (int) (rect[0] - 1.0);
+ y1 = (int) (rect[1] - 1.0);
+ x2 = (int) (rect[2] + 1.0);
+ y2 = (int) (rect[3] + 1.0);
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = itemPtr->nextPtr) {
- if (itemPtr->state == TK_STATE_HIDDEN || (itemPtr->state == TK_STATE_NULL &&
- canvasPtr->canvas_state == TK_STATE_HIDDEN)) {
+ if (itemPtr->state == TK_STATE_HIDDEN ||
+ (itemPtr->state == TK_STATE_NULL
+ && canvasPtr->canvas_state == TK_STATE_HIDDEN)) {
continue;
}
if ((itemPtr->x1 >= x2) || (itemPtr->x2 <= x1)
|| (itemPtr->y1 >= y2) || (itemPtr->y2 <= y1)) {
continue;
}
- if ((*itemPtr->typePtr->areaProc)((Tk_Canvas) canvasPtr, itemPtr, rect)
- >= enclosed) {
+ if (ItemOverlap(canvasPtr, itemPtr, rect) >= enclosed) {
DoItem(interp, itemPtr, uid);
}
}
@@ -4315,7 +4619,7 @@ RelinkItems(
lastMovePtr->nextPtr = itemPtr;
}
lastMovePtr = itemPtr;
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
canvasPtr->flags |= REPICK_NEEDED;
}
@@ -4378,9 +4682,10 @@ CanvasBindProc(
ClientData clientData, /* Pointer to canvas structure. */
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
+ int mask;
- Tcl_Preserve((ClientData) canvasPtr);
+ Tcl_Preserve(canvasPtr);
/*
* This code below keeps track of the current modifier state in
@@ -4388,9 +4693,9 @@ CanvasBindProc(
* current item while buttons are down.
*/
- if ((eventPtr->type == ButtonPress) || (eventPtr->type == ButtonRelease)) {
- int mask;
-
+ switch (eventPtr->type) {
+ case ButtonPress:
+ case ButtonRelease:
switch (eventPtr->xbutton.button) {
case Button1:
mask = Button1Mask;
@@ -4444,20 +4749,21 @@ CanvasBindProc(
PickCurrentItem(canvasPtr, eventPtr);
eventPtr->xbutton.state ^= mask;
}
- goto done;
- } else if ((eventPtr->type == EnterNotify)
- || (eventPtr->type == LeaveNotify)) {
+ break;
+ case EnterNotify:
+ case LeaveNotify:
canvasPtr->state = eventPtr->xcrossing.state;
PickCurrentItem(canvasPtr, eventPtr);
- goto done;
- } else if (eventPtr->type == MotionNotify) {
+ break;
+ case MotionNotify:
canvasPtr->state = eventPtr->xmotion.state;
PickCurrentItem(canvasPtr, eventPtr);
+ /* fallthrough */
+ default:
+ CanvasDoEvent(canvasPtr, eventPtr);
}
- CanvasDoEvent(canvasPtr, eventPtr);
- done:
- Tcl_Release((ClientData) canvasPtr);
+ Tcl_Release(canvasPtr);
}
/*
@@ -4539,11 +4845,11 @@ PickCurrentItem(
canvasPtr->pickEvent.xcrossing.y_root = eventPtr->xmotion.y_root;
canvasPtr->pickEvent.xcrossing.mode = NotifyNormal;
canvasPtr->pickEvent.xcrossing.detail = NotifyNonlinear;
- canvasPtr->pickEvent.xcrossing.same_screen
- = eventPtr->xmotion.same_screen;
+ canvasPtr->pickEvent.xcrossing.same_screen =
+ eventPtr->xmotion.same_screen;
canvasPtr->pickEvent.xcrossing.focus = False;
canvasPtr->pickEvent.xcrossing.state = eventPtr->xmotion.state;
- } else {
+ } else {
canvasPtr->pickEvent = *eventPtr;
}
}
@@ -4575,7 +4881,7 @@ PickCurrentItem(
if ((canvasPtr->newCurrentPtr == canvasPtr->currentItemPtr)
&& !(canvasPtr->flags & LEFT_GRABBED_ITEM)) {
/*
- * Nothing to do: the current item hasn't changed.
+ * Nothing to do: the current item hasn't changed.
*/
return;
@@ -4638,7 +4944,7 @@ PickCurrentItem(
* deleted.
*/
}
- if ((canvasPtr->newCurrentPtr != canvasPtr->currentItemPtr) && buttonDown) {
+ if ((canvasPtr->newCurrentPtr!=canvasPtr->currentItemPtr) && buttonDown) {
canvasPtr->flags |= LEFT_GRABBED_ITEM;
return;
}
@@ -4654,10 +4960,8 @@ PickCurrentItem(
canvasPtr->currentItemPtr = canvasPtr->newCurrentPtr;
if (prevItemPtr != NULL && prevItemPtr != canvasPtr->currentItemPtr &&
(prevItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT)) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, prevItemPtr);
- (*prevItemPtr->typePtr->configProc)(canvasPtr->interp,
- (Tk_Canvas) canvasPtr, prevItemPtr, 0, NULL,
- TK_CONFIG_ARGV_ONLY);
+ EventuallyRedrawItem(canvasPtr, prevItemPtr);
+ ItemConfigure(canvasPtr, prevItemPtr, 0, NULL);
}
if (canvasPtr->currentItemPtr != NULL) {
XEvent event;
@@ -4666,14 +4970,11 @@ PickCurrentItem(
DoItem(NULL, canvasPtr->currentItemPtr, Tk_GetUid("current"));
#else /* USE_OLD_TAG_SEARCH */
DoItem(NULL, canvasPtr->currentItemPtr, searchUids->currentUid);
-#endif /* USE_OLD_TAG_SEA */
- if ((canvasPtr->currentItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT &&
- prevItemPtr != canvasPtr->currentItemPtr)) {
- (*canvasPtr->currentItemPtr->typePtr->configProc)(canvasPtr->interp,
- (Tk_Canvas) canvasPtr, canvasPtr->currentItemPtr, 0, NULL,
- TK_CONFIG_ARGV_ONLY);
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->currentItemPtr);
+#endif /* USE_OLD_TAG_SEARCH */
+ if ((canvasPtr->currentItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT
+ && prevItemPtr != canvasPtr->currentItemPtr)) {
+ ItemConfigure(canvasPtr, canvasPtr->currentItemPtr, 0, NULL);
+ EventuallyRedrawItem(canvasPtr, canvasPtr->currentItemPtr);
}
event = canvasPtr->pickEvent;
event.type = EnterNotify;
@@ -4719,8 +5020,10 @@ CanvasFindClosest(
bestPtr = NULL;
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = itemPtr->nextPtr) {
- if (itemPtr->state == TK_STATE_HIDDEN || itemPtr->state==TK_STATE_DISABLED ||
- (itemPtr->state == TK_STATE_NULL && (canvasPtr->canvas_state == TK_STATE_HIDDEN ||
+ if (itemPtr->state == TK_STATE_HIDDEN ||
+ itemPtr->state==TK_STATE_DISABLED ||
+ (itemPtr->state == TK_STATE_NULL &&
+ (canvasPtr->canvas_state == TK_STATE_HIDDEN ||
canvasPtr->canvas_state == TK_STATE_DISABLED))) {
continue;
}
@@ -4728,8 +5031,7 @@ CanvasFindClosest(
|| (itemPtr->y1 > y2) || (itemPtr->y2 < y1)) {
continue;
}
- if ((*itemPtr->typePtr->pointProc)((Tk_Canvas) canvasPtr,
- itemPtr, coords) <= canvasPtr->closeEnough) {
+ if (ItemPoint(canvasPtr,itemPtr,coords,0) <= canvasPtr->closeEnough) {
bestPtr = itemPtr;
}
}
@@ -4826,8 +5128,7 @@ CanvasDoEvent(
if (numObjects <= NUM_STATIC) {
objectPtr = staticObjects;
} else {
- objectPtr = (ClientData *) ckalloc((unsigned)
- (numObjects * sizeof(ClientData)));
+ objectPtr = ckalloc(numObjects * sizeof(ClientData));
}
#ifdef USE_OLD_TAG_SEARCH
objectPtr[0] = (ClientData) Tk_GetUid("all");
@@ -4837,7 +5138,7 @@ CanvasDoEvent(
for (i = itemPtr->numTags-1; i >= 0; i--) {
objectPtr[i+1] = (ClientData) itemPtr->tagPtr[i];
}
- objectPtr[itemPtr->numTags+1] = (ClientData) itemPtr;
+ objectPtr[itemPtr->numTags+1] = itemPtr;
#ifndef USE_OLD_TAG_SEARCH
/*
@@ -4864,7 +5165,7 @@ CanvasDoEvent(
numObjects, objectPtr);
}
if (objectPtr != staticObjects) {
- ckfree((char *) objectPtr);
+ ckfree(objectPtr);
}
}
@@ -4890,7 +5191,7 @@ static void
CanvasBlinkProc(
ClientData clientData) /* Pointer to record describing entry. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
if (!canvasPtr->textInfo.gotFocus || (canvasPtr->insertOffTime == 0)) {
return;
@@ -4898,18 +5199,13 @@ CanvasBlinkProc(
if (canvasPtr->textInfo.cursorOn) {
canvasPtr->textInfo.cursorOn = 0;
canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- canvasPtr->insertOffTime, CanvasBlinkProc,
- (ClientData) canvasPtr);
+ canvasPtr->insertOffTime, CanvasBlinkProc, canvasPtr);
} else {
canvasPtr->textInfo.cursorOn = 1;
canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- canvasPtr->insertOnTime, CanvasBlinkProc,
- (ClientData) canvasPtr);
- }
- if (canvasPtr->textInfo.focusItemPtr != NULL) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->textInfo.focusItemPtr);
+ canvasPtr->insertOnTime, CanvasBlinkProc, canvasPtr);
}
+ EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.focusItemPtr);
}
/*
@@ -4942,22 +5238,18 @@ CanvasFocusProc(
canvasPtr->textInfo.cursorOn = 1;
if (canvasPtr->insertOffTime != 0) {
canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- canvasPtr->insertOffTime, CanvasBlinkProc,
- (ClientData) canvasPtr);
+ canvasPtr->insertOffTime, CanvasBlinkProc, canvasPtr);
}
} else {
canvasPtr->textInfo.gotFocus = 0;
canvasPtr->textInfo.cursorOn = 0;
canvasPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
}
- if (canvasPtr->textInfo.focusItemPtr != NULL) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->textInfo.focusItemPtr);
- }
+ EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.focusItemPtr);
if (canvasPtr->highlightWidth > 0) {
canvasPtr->flags |= REDRAW_BORDERS;
if (!(canvasPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayCanvas, (ClientData) canvasPtr);
+ Tcl_DoWhenIdle(DisplayCanvas, canvasPtr);
canvasPtr->flags |= REDRAW_PENDING;
}
}
@@ -5000,10 +5292,9 @@ CanvasSelectTo(
if (canvasPtr->textInfo.selItemPtr == NULL) {
Tk_OwnSelection(canvasPtr->tkwin, XA_PRIMARY, CanvasLostSelection,
- (ClientData) canvasPtr);
+ canvasPtr);
} else if (canvasPtr->textInfo.selItemPtr != itemPtr) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->textInfo.selItemPtr);
+ EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.selItemPtr);
}
canvasPtr->textInfo.selItemPtr = itemPtr;
@@ -5021,7 +5312,7 @@ CanvasSelectTo(
if ((canvasPtr->textInfo.selectFirst != oldFirst)
|| (canvasPtr->textInfo.selectLast != oldLast)
|| (itemPtr != oldSelPtr)) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
+ EventuallyRedrawItem(canvasPtr, itemPtr);
}
}
@@ -5056,16 +5347,9 @@ CanvasFetchSelection(
* not including terminating NULL
* character. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
- if (canvasPtr->textInfo.selItemPtr == NULL) {
- return -1;
- }
- if (canvasPtr->textInfo.selItemPtr->typePtr->selectionProc == NULL) {
- return -1;
- }
- return (*canvasPtr->textInfo.selItemPtr->typePtr->selectionProc)(
- (Tk_Canvas) canvasPtr, canvasPtr->textInfo.selItemPtr, offset,
+ return ItemSelection(canvasPtr, canvasPtr->textInfo.selItemPtr, offset,
buffer, maxBytes);
}
@@ -5091,12 +5375,9 @@ static void
CanvasLostSelection(
ClientData clientData) /* Information about entry widget. */
{
- TkCanvas *canvasPtr = (TkCanvas *) clientData;
+ TkCanvas *canvasPtr = clientData;
- if (canvasPtr->textInfo.selItemPtr != NULL) {
- EventuallyRedrawItem((Tk_Canvas) canvasPtr,
- canvasPtr->textInfo.selItemPtr);
- }
+ EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.selItemPtr);
canvasPtr->textInfo.selItemPtr = NULL;
}
@@ -5220,14 +5501,14 @@ CanvasUpdateScrollbars(
*/
interp = canvasPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
xScrollCmd = canvasPtr->xScrollCmd;
if (xScrollCmd != NULL) {
- Tcl_Preserve((ClientData) xScrollCmd);
+ Tcl_Preserve(xScrollCmd);
}
yScrollCmd = canvasPtr->yScrollCmd;
if (yScrollCmd != NULL) {
- Tcl_Preserve((ClientData) yScrollCmd);
+ Tcl_Preserve(yScrollCmd);
}
xOrigin = canvasPtr->xOrigin;
yOrigin = canvasPtr->yOrigin;
@@ -5242,29 +5523,31 @@ CanvasUpdateScrollbars(
if (canvasPtr->xScrollCmd != NULL) {
Tcl_Obj *fractions = ScrollFractions(xOrigin + inset,
xOrigin + width - inset, scrollX1, scrollX2);
- result = Tcl_VarEval(interp, xScrollCmd, " ", Tcl_GetString(fractions),
+
+ result = Tcl_VarEval(interp, xScrollCmd," ",Tcl_GetString(fractions),
NULL);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_ResetResult(interp);
- Tcl_Release((ClientData) xScrollCmd);
+ Tcl_Release(xScrollCmd);
}
if (yScrollCmd != NULL) {
Tcl_Obj *fractions = ScrollFractions(yOrigin + inset,
yOrigin + height - inset, scrollY1, scrollY2);
- result = Tcl_VarEval(interp, yScrollCmd, " ", Tcl_GetString(fractions),
+
+ result = Tcl_VarEval(interp, yScrollCmd," ",Tcl_GetString(fractions),
NULL);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_ResetResult(interp);
- Tcl_Release((ClientData) yScrollCmd);
+ Tcl_Release(yScrollCmd);
}
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -5330,11 +5613,11 @@ CanvasSetOrigin(
* Adjust the origin if necessary to keep as much as possible of the
* canvas in the view. The variables left, right, etc. keep track of how
* much extra space there is on each side of the view before it will stick
- * out past the scroll region. If one side sticks out past the edge of
- * the scroll region, adjust the view to bring that side back to the edge
- * of the scrollregion (but don't move it so much that the other side
- * sticks out now). If scroll increments are in effect, be sure to adjust
- * only by full increments.
+ * out past the scroll region. If one side sticks out past the edge of the
+ * scroll region, adjust the view to bring that side back to the edge of
+ * the scrollregion (but don't move it so much that the other side sticks
+ * out now). If scroll increments are in effect, be sure to adjust only by
+ * full increments.
*/
if ((canvasPtr->confine) && (canvasPtr->regionString != NULL)) {
@@ -5413,17 +5696,18 @@ CanvasSetOrigin(
*/
/* ARGSUSED */
-static CONST char **
+static const char **
TkGetStringsFromObjs(
int objc,
- Tcl_Obj *CONST objv[])
+ Tcl_Obj *const objv[])
{
register int i;
- CONST char **argv;
+ const char **argv;
+
if (objc <= 0) {
return NULL;
}
- argv = (CONST char **) ckalloc((objc+1) * sizeof(char *));
+ argv = ckalloc((objc+1) * sizeof(char *));
for (i = 0; i < objc; i++) {
argv[i] = Tcl_GetString(objv[i]);
}
@@ -5459,8 +5743,7 @@ Tk_CanvasPsColor(
Tk_Canvas canvas, /* Information about canvas. */
XColor *colorPtr) /* Information about color. */
{
- return Tk_PostscriptColor(interp, ((TkCanvas *) canvas)->psInfo,
- colorPtr);
+ return Tk_PostscriptColor(interp, Canvas(canvas)->psInfo, colorPtr);
}
/*
@@ -5493,7 +5776,7 @@ Tk_CanvasPsFont(
Tk_Font tkfont) /* Information about font in which text is to
* be printed. */
{
- return Tk_PostscriptFont(interp, ((TkCanvas *) canvas)->psInfo, tkfont);
+ return Tk_PostscriptFont(interp, Canvas(canvas)->psInfo, tkfont);
}
/*
@@ -5526,9 +5809,8 @@ Tk_CanvasPsBitmap(
* rectangular region to output. */
int width, int height) /* Size of rectangular region. */
{
- return Tk_PostscriptBitmap(interp, ((TkCanvas *) canvas)->tkwin,
- ((TkCanvas *) canvas)->psInfo, bitmap, startX, startY,
- width, height);
+ return Tk_PostscriptBitmap(interp, Canvas(canvas)->tkwin,
+ Canvas(canvas)->psInfo, bitmap, startX, startY, width, height);
}
/*
@@ -5560,8 +5842,8 @@ Tk_CanvasPsStipple(
Tk_Canvas canvas, /* Information about canvas. */
Pixmap bitmap) /* Bitmap to use for stippling. */
{
- return Tk_PostscriptStipple(interp, ((TkCanvas *) canvas)->tkwin,
- ((TkCanvas *) canvas)->psInfo, bitmap);
+ return Tk_PostscriptStipple(interp, Canvas(canvas)->tkwin,
+ Canvas(canvas)->psInfo, bitmap);
}
/*
@@ -5587,7 +5869,7 @@ Tk_CanvasPsY(
* is being generated. */
double y) /* Y-coordinate in canvas coords. */
{
- return Tk_PostscriptY(y, ((TkCanvas *) canvas)->psInfo);
+ return Tk_PostscriptY(y, Canvas(canvas)->psInfo);
}
/*
@@ -5617,8 +5899,7 @@ Tk_CanvasPsPath(
* coordinates giving points for path. */
int numPoints) /* Number of points at *coordPtr. */
{
- Tk_PostscriptPath(interp, ((TkCanvas *) canvas)->psInfo,
- coordPtr, numPoints);
+ Tk_PostscriptPath(interp, Canvas(canvas)->psInfo, coordPtr, numPoints);
}
/*
diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h
index d009cfa..b8b1b46 100644
--- a/generic/tkCanvas.h
+++ b/generic/tkCanvas.h
@@ -291,7 +291,7 @@ typedef struct TkCanvas {
*/
MODULE_SCOPE int TkCanvPostscriptCmd(TkCanvas *canvasPtr,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
MODULE_SCOPE int TkCanvTranslatePath(TkCanvas *canvPtr,
int numVertex, double *coordPtr, int closed,
XPoint *outPtr);
@@ -303,4 +303,10 @@ MODULE_SCOPE Tk_ItemType tkArcType, tkBitmapType, tkImageType, tkLineType;
MODULE_SCOPE Tk_ItemType tkOvalType, tkPolygonType;
MODULE_SCOPE Tk_ItemType tkRectangleType, tkTextType, tkWindowType;
+/*
+ * Convenience macro.
+ */
+
+#define Canvas(canvas) ((TkCanvas *) (canvas))
+
#endif /* _TKCANVAS */
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c
index 9428894..e153064 100644
--- a/generic/tkClipboard.c
+++ b/generic/tkClipboard.c
@@ -27,7 +27,7 @@ static int ClipboardWindowHandler(ClientData clientData,
int offset, char *buffer, int maxBytes);
static void ClipboardLostSel(ClientData clientData);
static int ClipboardGetProc(ClientData clientData,
- Tcl_Interp *interp, char *portion);
+ Tcl_Interp *interp, const char *portion);
/*
*----------------------------------------------------------------------
@@ -56,7 +56,7 @@ ClipboardHandler(
char *buffer, /* Place to store converted selection. */
int maxBytes) /* Maximum # of bytes to store at buffer. */
{
- TkClipboardTarget *targetPtr = (TkClipboardTarget*) clientData;
+ TkClipboardTarget *targetPtr = clientData;
TkClipboardBuffer *cbPtr;
char *srcPtr, *destPtr;
size_t count = 0;
@@ -134,9 +134,9 @@ ClipboardAppHandler(
char *buffer, /* Place to store converted selection. */
int maxBytes) /* Maximum # of bytes to store at buffer. */
{
- TkDisplay *dispPtr = (TkDisplay *) clientData;
+ TkDisplay *dispPtr = clientData;
size_t length;
- CONST char *p;
+ const char *p;
p = dispPtr->clipboardAppPtr->winPtr->nameUid;
length = strlen(p);
@@ -205,7 +205,7 @@ static void
ClipboardLostSel(
ClientData clientData) /* Pointer to TkDisplay structure. */
{
- TkDisplay *dispPtr = (TkDisplay*) clientData;
+ TkDisplay *dispPtr = clientData;
dispPtr->clipboardActive = 0;
}
@@ -267,12 +267,12 @@ Tk_ClipboardClear(
cbPtr = nextCbPtr) {
ckfree(cbPtr->buffer);
nextCbPtr = cbPtr->nextPtr;
- ckfree((char *) cbPtr);
+ ckfree(cbPtr);
}
nextTargetPtr = targetPtr->nextPtr;
Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
targetPtr->type);
- ckfree((char *) targetPtr);
+ ckfree(targetPtr);
}
dispPtr->clipTargetPtr = NULL;
@@ -282,7 +282,7 @@ Tk_ClipboardClear(
if (!dispPtr->clipboardActive) {
Tk_OwnSelection(dispPtr->clipWindow, dispPtr->clipboardAtom,
- ClipboardLostSel, (ClientData) dispPtr);
+ ClipboardLostSel, dispPtr);
dispPtr->clipboardActive = 1;
}
dispPtr->clipboardAppPtr = winPtr->mainPtr;
@@ -324,7 +324,7 @@ Tk_ClipboardAppend(
* clipboard item, e.g. STRING or LENGTH. */
Atom format, /* Format in which the selection information
* should be returned to the requestor. */
- char* buffer) /* NULL terminated string containing the data
+ const char *buffer) /* NULL terminated string containing the data
* to be added to the clipboard. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -341,7 +341,7 @@ Tk_ClipboardAppend(
Tk_ClipboardClear(interp, tkwin);
} else if (!dispPtr->clipboardActive) {
Tk_OwnSelection(dispPtr->clipWindow, dispPtr->clipboardAtom,
- ClipboardLostSel, (ClientData) dispPtr);
+ ClipboardLostSel, dispPtr);
dispPtr->clipboardActive = 1;
}
@@ -358,14 +358,14 @@ Tk_ClipboardAppend(
}
}
if (targetPtr == NULL) {
- targetPtr = (TkClipboardTarget*) ckalloc(sizeof(TkClipboardTarget));
+ targetPtr = ckalloc(sizeof(TkClipboardTarget));
targetPtr->type = type;
targetPtr->format = format;
targetPtr->firstBufferPtr = targetPtr->lastBufferPtr = NULL;
targetPtr->nextPtr = dispPtr->clipTargetPtr;
dispPtr->clipTargetPtr = targetPtr;
Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
- type, ClipboardHandler, (ClientData) targetPtr, format);
+ type, ClipboardHandler, targetPtr, format);
} else if (targetPtr->format != format) {
Tcl_AppendResult(interp, "format \"", Tk_GetAtomName(tkwin, format),
"\" does not match current format \"",
@@ -378,7 +378,7 @@ Tk_ClipboardAppend(
* Append a new buffer to the buffer chain.
*/
- cbPtr = (TkClipboardBuffer*) ckalloc(sizeof(TkClipboardBuffer));
+ cbPtr = ckalloc(sizeof(TkClipboardBuffer));
cbPtr->nextPtr = NULL;
if (targetPtr->lastBufferPtr != NULL) {
targetPtr->lastBufferPtr->nextPtr = cbPtr;
@@ -388,10 +388,10 @@ Tk_ClipboardAppend(
targetPtr->lastBufferPtr = cbPtr;
cbPtr->length = strlen(buffer);
- cbPtr->buffer = (char *) ckalloc((unsigned) (cbPtr->length + 1));
+ cbPtr->buffer = ckalloc(cbPtr->length + 1);
strcpy(cbPtr->buffer, buffer);
- TkSelUpdateClipboard((TkWindow*)(dispPtr->clipWindow), targetPtr);
+ TkSelUpdateClipboard((TkWindow *) dispPtr->clipWindow, targetPtr);
return TCL_OK;
}
@@ -418,17 +418,17 @@ Tk_ClipboardObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- char *path = NULL;
+ const char *path = NULL;
Atom selection;
- static CONST char *optionStrings[] = { "append", "clear", "get", NULL };
+ static const char *const optionStrings[] = { "append", "clear", "get", NULL };
enum options { CLIPBOARD_APPEND, CLIPBOARD_CLEAR, CLIPBOARD_GET };
int index, i;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -440,10 +440,10 @@ Tk_ClipboardObjCmd(
switch ((enum options) index) {
case CLIPBOARD_APPEND: {
Atom target, format;
- char *targetName = NULL;
- char *formatName = NULL;
- char *string;
- static CONST char *appendOptionStrings[] = {
+ const char *targetName = NULL;
+ const char *formatName = NULL;
+ const char *string;
+ static const char *const appendOptionStrings[] = {
"-displayof", "-format", "-type", NULL
};
enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE };
@@ -491,7 +491,7 @@ Tk_ClipboardObjCmd(
}
}
if (objc - i != 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options? data");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? data");
return TCL_ERROR;
}
if (path != NULL) {
@@ -514,7 +514,7 @@ Tk_ClipboardObjCmd(
Tcl_GetString(objv[i]));
}
case CLIPBOARD_CLEAR: {
- static CONST char *clearOptionStrings[] = { "-displayof", NULL };
+ static const char *const clearOptionStrings[] = { "-displayof", NULL };
enum clearOptions { CLEAR_DISPLAYOF };
int subIndex;
@@ -542,11 +542,11 @@ Tk_ClipboardObjCmd(
}
case CLIPBOARD_GET: {
Atom target;
- char *targetName = NULL;
+ const char *targetName = NULL;
Tcl_DString selBytes;
int result;
- char *string;
- static CONST char *getOptionStrings[] = {
+ const char *string;
+ static const char *const getOptionStrings[] = {
"-displayof", "-type", NULL
};
enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE };
@@ -585,7 +585,7 @@ Tk_ClipboardObjCmd(
selection = Tk_InternAtom(tkwin, "CLIPBOARD");
if (objc - i > 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?");
return TCL_ERROR;
} else if (objc - i == 1) {
target = Tk_InternAtom(tkwin, Tcl_GetString(objv[i]));
@@ -597,7 +597,7 @@ Tk_ClipboardObjCmd(
Tcl_DStringInit(&selBytes);
result = Tk_GetSelection(interp, tkwin, selection, target,
- ClipboardGetProc, (ClientData) &selBytes);
+ ClipboardGetProc, &selBytes);
if (result == TCL_OK) {
Tcl_DStringResult(interp, &selBytes);
} else {
@@ -645,12 +645,12 @@ TkClipInit(
* and set up an event handler for it.
*/
- dispPtr->clipWindow = Tk_CreateWindow(interp, (Tk_Window) NULL,
- "_clip", DisplayString(dispPtr->display));
+ dispPtr->clipWindow = Tk_CreateWindow(interp, NULL, "_clip",
+ DisplayString(dispPtr->display));
if (dispPtr->clipWindow == NULL) {
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) dispPtr->clipWindow);
+ Tcl_Preserve(dispPtr->clipWindow);
atts.override_redirect = True;
Tk_ChangeWindowAttributes(dispPtr->clipWindow, CWOverrideRedirect, &atts);
Tk_MakeWindowExist(dispPtr->clipWindow);
@@ -671,11 +671,9 @@ TkClipInit(
*/
Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
- dispPtr->applicationAtom, ClipboardAppHandler,
- (ClientData) dispPtr, XA_STRING);
+ dispPtr->applicationAtom, ClipboardAppHandler, dispPtr,XA_STRING);
Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
- dispPtr->windowAtom, ClipboardWindowHandler,
- (ClientData) dispPtr, XA_STRING);
+ dispPtr->windowAtom, ClipboardWindowHandler, dispPtr, XA_STRING);
return TCL_OK;
}
@@ -704,7 +702,7 @@ ClipboardGetProc(
* selection. */
Tcl_Interp *interp, /* Interpreter used for error reporting (not
* used). */
- char *portion) /* New information to be appended. */
+ const char *portion) /* New information to be appended. */
{
Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1);
return TCL_OK;
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index a86ef84..63f626e 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -34,6 +34,42 @@ static void WaitVisibilityProc(ClientData clientData,
XEvent *eventPtr);
static void WaitWindowProc(ClientData clientData,
XEvent *eventPtr);
+static int AppnameCmd(ClientData dummy, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const *objv);
+static int CaretCmd(ClientData dummy, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const *objv);
+static int InactiveCmd(ClientData dummy, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const *objv);
+static int ScalingCmd(ClientData dummy, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const *objv);
+static int UseinputmethodsCmd(ClientData dummy,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const *objv);
+static int WindowingsystemCmd(ClientData dummy,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const *objv);
+
+#if defined(__WIN32__) || defined(MAC_OSX_TK)
+MODULE_SCOPE const TkEnsemble tkFontchooserEnsemble[];
+#else
+#define tkFontchooserEnsemble NULL
+#endif
+
+/*
+ * Table of tk subcommand names and implementations.
+ */
+
+static const TkEnsemble tkCmdMap[] = {
+ {"appname", AppnameCmd, NULL },
+ {"busy", Tk_BusyObjCmd, NULL },
+ {"caret", CaretCmd, NULL },
+ {"inactive", InactiveCmd, NULL },
+ {"scaling", ScalingCmd, NULL },
+ {"useinputmethods", UseinputmethodsCmd, NULL },
+ {"windowingsystem", WindowingsystemCmd, NULL },
+ {"fontchooser", NULL, tkFontchooserEnsemble},
+ {NULL, NULL, NULL}
+};
/*
*----------------------------------------------------------------------
@@ -59,11 +95,11 @@ Tk_BellObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- static const char *bellOptions[] = {
+ static const char *const bellOptions[] = {
"-displayof", "-nice", NULL
};
enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE };
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
int i, index, nice = 0;
if (objc > 4) {
@@ -124,10 +160,10 @@ Tk_BindObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
TkWindow *winPtr;
ClientData object;
- char *string;
+ const char *string;
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "window ?pattern? ?command?");
@@ -148,7 +184,7 @@ Tk_BindObjCmd(
}
object = (ClientData) winPtr->pathName;
} else {
- winPtr = (TkWindow *) clientData;
+ winPtr = clientData;
object = (ClientData) Tk_GetUid(string);
}
@@ -162,9 +198,8 @@ Tk_BindObjCmd(
if (objc == 4) {
int append = 0;
unsigned long mask;
- char *sequence, *script;
- sequence = Tcl_GetString(objv[2]);
- script = Tcl_GetString(objv[3]);
+ const char *sequence = Tcl_GetString(objv[2]);
+ const char *script = Tcl_GetString(objv[3]);
/*
* If the script is null, just delete the binding.
@@ -232,7 +267,7 @@ TkBindEventProc(
ClientData objects[MAX_OBJS], *objPtr;
TkWindow *topLevPtr;
int i, count;
- char *p;
+ const char *p;
Tcl_HashEntry *hPtr;
if ((winPtr->mainPtr == NULL) || (winPtr->mainPtr->bindingTable == NULL)) {
@@ -247,11 +282,10 @@ TkBindEventProc(
*/
if (winPtr->numTags > MAX_OBJS) {
- objPtr = (ClientData *) ckalloc((unsigned)
- (winPtr->numTags * sizeof(ClientData)));
+ objPtr = ckalloc(winPtr->numTags * sizeof(ClientData));
}
for (i = 0; i < winPtr->numTags; i++) {
- p = (char *) winPtr->tagPtr[i];
+ p = winPtr->tagPtr[i];
if (*p == '.') {
hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->nameTable, p);
if (hPtr != NULL) {
@@ -282,7 +316,7 @@ TkBindEventProc(
Tk_BindEvent(winPtr->mainPtr->bindingTable, eventPtr, (Tk_Window) winPtr,
count, objPtr);
if (objPtr != objects) {
- ckfree((char *) objPtr);
+ ckfree(objPtr);
}
}
@@ -310,10 +344,10 @@ Tk_BindtagsObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
TkWindow *winPtr, *winPtr2;
int i, length;
- char *p;
+ const char *p;
Tcl_Obj *listPtr, **tags;
if ((objc < 2) || (objc > 3)) {
@@ -364,8 +398,7 @@ Tk_BindtagsObjCmd(
}
winPtr->numTags = length;
- winPtr->tagPtr = (ClientData *) ckalloc((unsigned)
- (length * sizeof(ClientData)));
+ winPtr->tagPtr = ckalloc(length * sizeof(ClientData));
for (i = 0; i < length; i++) {
p = Tcl_GetString(tags[i]);
if (p[0] == '.') {
@@ -378,7 +411,7 @@ Tk_BindtagsObjCmd(
* is one.
*/
- copy = (char *) ckalloc((unsigned) (strlen(p) + 1));
+ copy = ckalloc(strlen(p) + 1);
strcpy(copy, p);
winPtr->tagPtr[i] = (ClientData) copy;
} else {
@@ -411,10 +444,10 @@ TkFreeBindingTags(
TkWindow *winPtr) /* Window whose tags are to be released. */
{
int i;
- char *p;
+ const char *p;
for (i = 0; i < winPtr->numTags; i++) {
- p = (char *) (winPtr->tagPtr[i]);
+ p = winPtr->tagPtr[i];
if (*p == '.') {
/*
* Names starting with "." are malloced rather than Uids, so they
@@ -424,7 +457,7 @@ TkFreeBindingTags(
ckfree(p);
}
}
- ckfree((char *) winPtr->tagPtr);
+ ckfree(winPtr->tagPtr);
winPtr->numTags = 0;
winPtr->tagPtr = NULL;
}
@@ -454,7 +487,7 @@ Tk_DestroyObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window window;
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
int i;
for (i = 1; i < objc; i++) {
@@ -501,7 +534,7 @@ Tk_LowerObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window mainwin = (Tk_Window) clientData;
+ Tk_Window mainwin = clientData;
Tk_Window tkwin, other;
if ((objc != 2) && (objc != 3)) {
@@ -555,7 +588,7 @@ Tk_RaiseObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window mainwin = (Tk_Window) clientData;
+ Tk_Window mainwin = clientData;
Tk_Window tkwin, other;
if ((objc != 2) && (objc != 3)) {
@@ -585,12 +618,41 @@ Tk_RaiseObjCmd(
}
/*
+ * ----------------------------------------------------------------------
+ *
+ * TkInitTkCmd --
+ *
+ * Set up the tk ensemble.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+int
+TkInitTkCmd(
+ Tcl_Interp *interp,
+ ClientData clientData)
+{
+ TkMakeEnsemble(interp, "::", "tk", clientData, tkCmdMap);
+#if defined(__WIN32__) || defined(MAC_OSX_TK)
+ TkInitFontchooser(interp, clientData);
+#endif
+ return TCL_OK;
+}
+
+/*
*----------------------------------------------------------------------
*
- * Tk_TkObjCmd --
+ * AppnameCmd, CaretCmd, ScalingCmd, UseinputmethodsCmd,
+ * WindowingsystemCmd, InactiveCmd --
*
- * This function is invoked to process the "tk" Tcl command. See the user
- * documentation for details on what it does.
+ * These functions are invoked to process the "tk" ensemble subcommands.
+ * See the user documentation for details on what they do.
*
* Results:
* A standard Tcl result.
@@ -602,286 +664,298 @@ Tk_RaiseObjCmd(
*/
int
-Tk_TkObjCmd(
+AppnameCmd(
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 = clientData;
+ TkWindow *winPtr;
+ const 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 > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ string = Tcl_GetString(objv[1]);
+ winPtr->nameUid = Tk_GetUid(Tk_SetAppName(tkwin, string));
+ }
+ Tcl_AppendResult(interp, winPtr->nameUid, NULL);
+ return TCL_OK;
+}
+
+int
+CaretCmd(
+ 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 = clientData;
int index;
- Tk_Window tkwin;
- static const char *optionStrings[] = {
- "appname", "caret", "scaling", "useinputmethods",
- "windowingsystem", "inactive", NULL
+ Tcl_Obj *objPtr;
+ TkCaret *caretPtr;
+ Tk_Window window;
+ static const char *const caretStrings[] = {
+ "-x", "-y", "-height", NULL
};
- enum options {
- TK_APPNAME, TK_CARET, TK_SCALING, TK_USE_IM,
- TK_WINDOWINGSYSTEM, TK_INACTIVE
+ enum caretOptions {
+ TK_CARET_X, TK_CARET_Y, TK_CARET_HEIGHT
};
- tkwin = (Tk_Window) clientData;
-
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?");
+ if ((objc < 2) || ((objc > 3) && !!(objc & 1))) {
+ Tcl_WrongNumArgs(interp, 1, objv,
+ "window ?-x x? ?-y y? ?-height height?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), tkwin);
+ if (window == NULL) {
return TCL_ERROR;
}
+ caretPtr = &(((TkWindow *) window)->dispPtr->caret);
+ if (objc == 2) {
+ /*
+ * Return all the current values
+ */
- switch ((enum options) index) {
- case TK_APPNAME: {
- TkWindow *winPtr;
- char *string;
-
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "appname not accessible in a safe interpreter",
- TCL_STATIC);
- return TCL_ERROR;
- }
+ 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 == 3) {
+ int value;
- winPtr = (TkWindow *) tkwin;
+ /*
+ * Return the current value of the selected option
+ */
- if (objc > 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?newName?");
+ if (Tcl_GetIndexFromObj(interp, objv[2], caretStrings,
+ "caret option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
- if (objc == 3) {
- string = Tcl_GetString(objv[2]);
- winPtr->nameUid = Tk_GetUid(Tk_SetAppName(tkwin, string));
+ 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_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
- */
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(value));
+ } else {
+ int i, value, x = 0, y = 0, height = -1;
- if (Tcl_GetIndexFromObj(interp, objv[3], caretStrings,
- "caret option", 0, &index) != TCL_OK) {
+ for (i = 2; 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) {
- value = caretPtr->x;
+ x = value;
} else if (index == TK_CARET_Y) {
- value = caretPtr->y;
+ y = value;
} else /* if (index == TK_CARET_HEIGHT) -- last case */ {
- value = caretPtr->height;
+ height = value;
}
- 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;
+ if (height < 0) {
+ height = Tk_Height(window);
+ }
+ Tk_SetCaretPos(window, x, y, height);
}
- case TK_SCALING: {
- Screen *screenPtr;
- int skip, width, height;
- double d;
+ return TCL_OK;
+}
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "scaling not accessible in a safe interpreter",
- TCL_STATIC);
- return TCL_ERROR;
- }
+int
+ScalingCmd(
+ 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 = clientData;
+ 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;
+ }
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
+ skip = TkGetDisplayOf(interp, objc - 1, objv + 1, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ screenPtr = Tk_Screen(tkwin);
+ if (objc - skip == 1) {
+ d = 25.4 / 72;
+ d *= WidthOfScreen(screenPtr);
+ d /= WidthMMOfScreen(screenPtr);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(d));
+ } else if (objc - skip == 2) {
+ if (Tcl_GetDoubleFromObj(interp, objv[1+skip], &d) != TCL_OK) {
return TCL_ERROR;
}
- screenPtr = Tk_Screen(tkwin);
- if (objc - skip == 2) {
- d = 25.4 / 72;
- d *= WidthOfScreen(screenPtr);
- d /= WidthMMOfScreen(screenPtr);
- Tcl_SetDoubleObj(Tcl_GetObjResult(interp), d);
- } else if (objc - skip == 3) {
- if (Tcl_GetDoubleFromObj(interp, objv[2+skip], &d) != TCL_OK) {
- return TCL_ERROR;
- }
- d = (25.4 / 72) / d;
- width = (int) (d * WidthOfScreen(screenPtr) + 0.5);
- if (width <= 0) {
- width = 1;
- }
- height = (int) (d * HeightOfScreen(screenPtr) + 0.5);
- if (height <= 0) {
- height = 1;
- }
- WidthMMOfScreen(screenPtr) = width;
- HeightMMOfScreen(screenPtr) = height;
- } else {
- Tcl_WrongNumArgs(interp, 2, objv,
- "?-displayof window? ?factor?");
- return TCL_ERROR;
+ d = (25.4 / 72) / d;
+ width = (int) (d * WidthOfScreen(screenPtr) + 0.5);
+ if (width <= 0) {
+ width = 1;
}
- break;
+ height = (int) (d * HeightOfScreen(screenPtr) + 0.5);
+ if (height <= 0) {
+ height = 1;
+ }
+ WidthMMOfScreen(screenPtr) = width;
+ HeightMMOfScreen(screenPtr) = height;
+ } else {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?factor?");
+ return TCL_ERROR;
}
- case TK_USE_IM: {
- TkDisplay *dispPtr;
- int skip;
+ return TCL_OK;
+}
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "useinputmethods not accessible in a safe interpreter",
- TCL_STATIC);
- return TCL_ERROR;
- }
+int
+UseinputmethodsCmd(
+ 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 = clientData;
+ TkDisplay *dispPtr;
+ int skip;
- skip = TkGetDisplayOf(interp, objc-2, objv+2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if ((objc - skip) == 3) {
- /*
- * In the case where TK_USE_INPUT_METHODS is not defined, this
- * will be ignored and we will always return 0. That will indicate
- * to the user that input methods are just not available.
- */
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "useinputmethods not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
- int boolVal;
+ skip = TkGetDisplayOf(interp, objc-1, objv+1, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ if ((objc - skip) == 2) {
+ /*
+ * In the case where TK_USE_INPUT_METHODS is not defined, this
+ * will be ignored and we will always return 0. That will indicate
+ * to the user that input methods are just not available.
+ */
- if (Tcl_GetBooleanFromObj(interp, objv[2+skip],
- &boolVal) != TCL_OK) {
- return TCL_ERROR;
- }
-#ifdef TK_USE_INPUT_METHODS
- 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,
- "?-displayof window? ?boolean?");
+ int boolVal;
+
+ if (Tcl_GetBooleanFromObj(interp, objv[1+skip],
+ &boolVal) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- (int) (dispPtr->flags & TK_DISPLAY_USE_IM));
- break;
+#ifdef TK_USE_INPUT_METHODS
+ if (boolVal) {
+ dispPtr->flags |= TK_DISPLAY_USE_IM;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_USE_IM;
+ }
+#endif /* TK_USE_INPUT_METHODS */
+ } else if ((objc - skip) != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv,
+ "?-displayof window? ?boolean?");
+ return TCL_ERROR;
}
- case TK_WINDOWINGSYSTEM: {
- const char *windowingsystem;
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(dispPtr->flags & TK_DISPLAY_USE_IM));
+ return TCL_OK;
+}
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- return TCL_ERROR;
- }
+int
+WindowingsystemCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+ const char *windowingsystem;
+
+ if (objc != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
#if defined(WIN32)
- windowingsystem = "win32";
+ windowingsystem = "win32";
#elif defined(MAC_OSX_TK)
- windowingsystem = "aqua";
+ windowingsystem = "aqua";
#else
- windowingsystem = "x11";
+ windowingsystem = "x11";
#endif
- Tcl_SetStringObj(Tcl_GetObjResult(interp), windowingsystem, -1);
- break;
- }
- case TK_INACTIVE: {
- int skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(windowingsystem, -1));
+ return TCL_OK;
+}
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip == 2) {
- long inactive;
+int
+InactiveCmd(
+ 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 = clientData;
+ int skip = TkGetDisplayOf(interp, objc - 1, objv + 1, &tkwin);
- inactive = (Tcl_IsSafe(interp) ? -1 :
- Tk_GetUserInactiveTime(Tk_Display(tkwin)));
- Tcl_SetObjResult(interp, Tcl_NewLongObj(inactive));
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ if (objc - skip == 1) {
+ long inactive;
- } else if (objc - skip == 3) {
- char *string;
+ inactive = (Tcl_IsSafe(interp) ? -1 :
+ Tk_GetUserInactiveTime(Tk_Display(tkwin)));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(inactive));
- string = Tcl_GetString(objv[objc-1]);
- if (strcmp(string, "reset") != 0) {
- Tcl_Obj *msg = Tcl_NewStringObj("bad option \"", -1);
+ } else if (objc - skip == 2) {
+ const char *string;
- Tcl_AppendStringsToObj(msg, string, "\": must be reset", NULL);
- Tcl_SetObjResult(interp, msg);
- return TCL_ERROR;
- }
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "resetting the user inactivity timer "
- "is not allowed in a safe interpreter", TCL_STATIC);
- return TCL_ERROR;
- }
- Tk_ResetUserInactiveTime(Tk_Display(tkwin));
- Tcl_ResetResult(interp);
- } else {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? ?reset?");
+ string = Tcl_GetString(objv[objc-1]);
+ if (strcmp(string, "reset") != 0) {
+ Tcl_Obj *msg = Tcl_NewStringObj("bad option \"", -1);
+
+ Tcl_AppendStringsToObj(msg, string, "\": must be reset", NULL);
+ Tcl_SetObjResult(interp, msg);
return TCL_ERROR;
}
- break;
- }
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "resetting the user inactivity timer "
+ "is not allowed in a safe interpreter", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ Tk_ResetUserInactiveTime(Tk_Display(tkwin));
+ Tcl_ResetResult(interp);
+ } else {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?reset?");
+ return TCL_ERROR;
}
return TCL_OK;
}
@@ -911,9 +985,10 @@ Tk_TkwaitObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
int done, index;
- static const char *optionStrings[] = {
+ int code = TCL_OK;
+ static const char *const optionStrings[] = {
"variable", "visibility", "window", NULL
};
enum options {
@@ -934,16 +1009,20 @@ Tk_TkwaitObjCmd(
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) {
+ WaitVariableProc, &done) != TCL_OK) {
return TCL_ERROR;
}
done = 0;
while (!done) {
+ if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
+ code = TCL_ERROR;
+ break;
+ }
Tcl_DoOneEvent(0);
}
Tcl_UntraceVar(interp, Tcl_GetString(objv[2]),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- WaitVariableProc, (ClientData) &done);
+ WaitVariableProc, &done);
break;
case TKWAIT_VISIBILITY: {
@@ -955,12 +1034,16 @@ Tk_TkwaitObjCmd(
}
Tk_CreateEventHandler(window,
VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
+ WaitVisibilityProc, &done);
done = 0;
while (!done) {
+ if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
+ code = TCL_ERROR;
+ break;
+ }
Tcl_DoOneEvent(0);
}
- if (done != 1) {
+ if ((done != 0) && (done != 1)) {
/*
* Note that we do not delete the event handler because it was
* deleted automatically when the window was destroyed.
@@ -973,7 +1056,7 @@ Tk_TkwaitObjCmd(
}
Tk_DeleteEventHandler(window,
VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
+ WaitVisibilityProc, &done);
break;
}
@@ -985,28 +1068,40 @@ Tk_TkwaitObjCmd(
return TCL_ERROR;
}
Tk_CreateEventHandler(window, StructureNotifyMask,
- WaitWindowProc, (ClientData) &done);
+ WaitWindowProc, &done);
done = 0;
while (!done) {
+ if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
+ code = TCL_ERROR;
+ break;
+ }
Tcl_DoOneEvent(0);
}
/*
- * Note: there's no need to delete the event handler. It was deleted
- * automatically when the window was destroyed.
+ * Note: normally there's no need to delete the event handler. It was
+ * deleted automatically when the window was destroyed; however, if
+ * the wait operation was canceled, we need to delete it.
*/
+ if (done == 0) {
+ Tk_DeleteEventHandler(window, StructureNotifyMask,
+ WaitWindowProc, &done);
+ }
break;
}
}
/*
* Clear out the interpreter's result, since it may have been set by event
- * handlers.
+ * handlers. This is skipped if an error occurred above, such as the wait
+ * operation being canceled.
*/
+ if (code == TCL_OK)
Tcl_ResetResult(interp);
- return TCL_OK;
+
+ return code;
}
/* ARGSUSED */
@@ -1018,7 +1113,7 @@ WaitVariableProc(
const char *name2, /* Second part of variable name. */
int flags) /* Information about what happened. */
{
- int *donePtr = (int *) clientData;
+ int *donePtr = clientData;
*donePtr = 1;
return NULL;
@@ -1030,7 +1125,7 @@ WaitVisibilityProc(
ClientData clientData, /* Pointer to integer to set to 1. */
XEvent *eventPtr) /* Information about event (not used). */
{
- int *donePtr = (int *) clientData;
+ int *donePtr = clientData;
if (eventPtr->type == VisibilityNotify) {
*donePtr = 1;
@@ -1045,7 +1140,7 @@ WaitWindowProc(
ClientData clientData, /* Pointer to integer to set to 1. */
XEvent *eventPtr) /* Information about event. */
{
- int *donePtr = (int *) clientData;
+ int *donePtr = clientData;
if (eventPtr->type == DestroyNotify) {
*donePtr = 1;
@@ -1077,9 +1172,10 @@ Tk_UpdateObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- static const char *updateOptions[] = {"idletasks", NULL};
+ static const char *const updateOptions[] = {"idletasks", NULL};
int flags, index;
TkDisplay *dispPtr;
+ int code = TCL_OK;
if (objc == 1) {
flags = TCL_DONT_WAIT;
@@ -1104,12 +1200,35 @@ Tk_UpdateObjCmd(
while (1) {
while (Tcl_DoOneEvent(flags) != 0) {
- /* Empty loop body */
+ if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
+ code = TCL_ERROR;
+ break;
+ }
}
+
+ /*
+ * If event processing was canceled proceed no further.
+ */
+
+ if (code == TCL_ERROR)
+ break;
+
for (dispPtr = TkGetDisplayList(); dispPtr != NULL;
dispPtr = dispPtr->nextPtr) {
XSync(dispPtr->display, False);
}
+
+ /*
+ * Check again if event processing has been canceled because the inner
+ * loop (above) may not have checked (i.e. no events were processed and
+ * the loop body was skipped).
+ */
+
+ if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
+ code = TCL_ERROR;
+ break;
+ }
+
if (Tcl_DoOneEvent(flags) == 0) {
break;
}
@@ -1117,11 +1236,14 @@ Tk_UpdateObjCmd(
/*
* Must clear the interpreter's result because event handlers could have
- * executed commands.
+ * executed commands. This is skipped if an error occurred above, such as
+ * the wait operation being canceled.
*/
+ if (code == TCL_OK)
Tcl_ResetResult(interp);
- return TCL_OK;
+
+ return code;
}
/*
@@ -1149,10 +1271,9 @@ Tk_WinfoObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int index, x, y, width, height, useX, useY, class, skip;
- char *string;
+ const char *string;
TkWindow *winPtr;
- Tk_Window tkwin;
- Tcl_Obj *resultPtr;
+ Tk_Window tkwin = clientData;
static const TkStateMap visualMap[] = {
{PseudoColor, "pseudocolor"},
@@ -1163,7 +1284,7 @@ Tk_WinfoObjCmd(
{StaticGray, "staticgray"},
{-1, NULL}
};
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"cells", "children", "class", "colormapfull",
"depth", "geometry", "height", "id",
"ismapped", "manager", "name", "parent",
@@ -1202,8 +1323,6 @@ Tk_WinfoObjCmd(
WIN_VISUALSAVAILABLE
};
- tkwin = (Tk_Window) clientData;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?");
return TCL_ERROR;
@@ -1225,14 +1344,14 @@ Tk_WinfoObjCmd(
}
}
winPtr = (TkWindow *) tkwin;
- resultPtr = Tcl_GetObjResult(interp);
switch ((enum options) index) {
case WIN_CELLS:
- Tcl_SetIntObj(resultPtr, Tk_Visual(tkwin)->map_entries);
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(Tk_Visual(tkwin)->map_entries));
break;
case WIN_CHILDREN: {
- Tcl_Obj *strPtr;
+ Tcl_Obj *strPtr, *resultPtr = Tcl_NewObj();
winPtr = winPtr->childList;
for ( ; winPtr != NULL; winPtr = winPtr->nextPtr) {
@@ -1241,57 +1360,50 @@ Tk_WinfoObjCmd(
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
}
+ Tcl_SetObjResult(interp, resultPtr);
break;
}
case WIN_CLASS:
- Tcl_SetStringObj(resultPtr, Tk_Class(tkwin), -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_Class(tkwin), -1));
break;
case WIN_COLORMAPFULL:
- Tcl_SetBooleanObj(resultPtr,
- TkpCmapStressed(tkwin, Tk_Colormap(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(TkpCmapStressed(tkwin,Tk_Colormap(tkwin))));
break;
case WIN_DEPTH:
- Tcl_SetIntObj(resultPtr, Tk_Depth(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_Depth(tkwin)));
break;
- case WIN_GEOMETRY: {
- char buf[16 + TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "%dx%d+%d+%d", Tk_Width(tkwin), Tk_Height(tkwin),
- Tk_X(tkwin), Tk_Y(tkwin));
- Tcl_SetStringObj(resultPtr, buf, -1);
+ case WIN_GEOMETRY:
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%dx%d+%d+%d",
+ Tk_Width(tkwin), Tk_Height(tkwin), Tk_X(tkwin), Tk_Y(tkwin)));
break;
- }
case WIN_HEIGHT:
- Tcl_SetIntObj(resultPtr, Tk_Height(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_Height(tkwin)));
break;
case WIN_ID: {
char buf[TCL_INTEGER_SPACE];
Tk_MakeWindowExist(tkwin);
TkpPrintWindowId(buf, Tk_WindowId(tkwin));
-
- /*
- * interp result may have changed, refetch it
- */
-
- resultPtr = Tcl_GetObjResult(interp);
- Tcl_SetStringObj(resultPtr, buf, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
break;
}
case WIN_ISMAPPED:
- Tcl_SetBooleanObj(resultPtr, (int) Tk_IsMapped(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(Tk_IsMapped(tkwin)));
break;
case WIN_MANAGER:
if (winPtr->geomMgrPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->geomMgrPtr->name, -1);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(winPtr->geomMgrPtr->name, -1));
}
break;
case WIN_NAME:
- Tcl_SetStringObj(resultPtr, Tk_Name(tkwin), -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_Name(tkwin), -1));
break;
case WIN_PARENT:
if (winPtr->parentPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->parentPtr->pathName, -1);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(winPtr->parentPtr->pathName, -1));
}
break;
case WIN_POINTERX:
@@ -1315,54 +1427,58 @@ Tk_WinfoObjCmd(
TkGetPointerCoords((Tk_Window) winPtr, &x, &y);
}
if (useX & useY) {
- char buf[TCL_INTEGER_SPACE * 2];
+ Tcl_Obj *xyObj[2];
- sprintf(buf, "%d %d", x, y);
- Tcl_SetStringObj(resultPtr, buf, -1);
+ xyObj[0] = Tcl_NewIntObj(x);
+ xyObj[1] = Tcl_NewIntObj(y);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, xyObj));
} else if (useX) {
- Tcl_SetIntObj(resultPtr, x);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(x));
} else {
- Tcl_SetIntObj(resultPtr, y);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(y));
}
break;
case WIN_REQHEIGHT:
- Tcl_SetIntObj(resultPtr, Tk_ReqHeight(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_ReqHeight(tkwin)));
break;
case WIN_REQWIDTH:
- Tcl_SetIntObj(resultPtr, Tk_ReqWidth(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_ReqWidth(tkwin)));
break;
case WIN_ROOTX:
Tk_GetRootCoords(tkwin, &x, &y);
- Tcl_SetIntObj(resultPtr, x);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(x));
break;
case WIN_ROOTY:
Tk_GetRootCoords(tkwin, &x, &y);
- Tcl_SetIntObj(resultPtr, y);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(y));
break;
- case WIN_SCREEN: {
- char buf[TCL_INTEGER_SPACE];
-
- sprintf(buf, "%d", Tk_ScreenNumber(tkwin));
- Tcl_AppendStringsToObj(resultPtr, Tk_DisplayName(tkwin),".",buf, NULL);
+ case WIN_SCREEN:
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s.%d",
+ Tk_DisplayName(tkwin), Tk_ScreenNumber(tkwin)));
break;
- }
case WIN_SCREENCELLS:
- Tcl_SetIntObj(resultPtr, CellsOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(CellsOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENDEPTH:
- Tcl_SetIntObj(resultPtr, DefaultDepthOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(DefaultDepthOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENHEIGHT:
- Tcl_SetIntObj(resultPtr, HeightOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(HeightOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENWIDTH:
- Tcl_SetIntObj(resultPtr, WidthOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(WidthOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENMMHEIGHT:
- Tcl_SetIntObj(resultPtr, HeightMMOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(HeightMMOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENMMWIDTH:
- Tcl_SetIntObj(resultPtr, WidthMMOfScreen(Tk_Screen(tkwin)));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(WidthMMOfScreen(Tk_Screen(tkwin))));
break;
case WIN_SCREENVISUAL:
class = DefaultVisualOfScreen(Tk_Screen(tkwin))->class;
@@ -1373,7 +1489,7 @@ Tk_WinfoObjCmd(
case WIN_TOPLEVEL:
winPtr = GetTopHierarchy(tkwin);
if (winPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->pathName, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(winPtr->pathName, -1));
}
break;
case WIN_VIEWABLE: {
@@ -1389,7 +1505,7 @@ Tk_WinfoObjCmd(
}
}
- Tcl_SetBooleanObj(resultPtr, viewable);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(viewable));
break;
}
case WIN_VISUAL:
@@ -1400,40 +1516,36 @@ Tk_WinfoObjCmd(
if (string == NULL) {
string = "unknown";
}
- Tcl_SetStringObj(resultPtr, string, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(string, -1));
break;
- case WIN_VISUALID: {
- char buf[TCL_INTEGER_SPACE];
-
- sprintf(buf, "0x%x",
- (unsigned int) XVisualIDFromVisual(Tk_Visual(tkwin)));
- Tcl_SetStringObj(resultPtr, buf, -1);
+ case WIN_VISUALID:
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", (unsigned)
+ XVisualIDFromVisual(Tk_Visual(tkwin))));
break;
- }
case WIN_VROOTHEIGHT:
Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, height);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(height));
break;
case WIN_VROOTWIDTH:
Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, width);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(width));
break;
case WIN_VROOTX:
Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, x);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(x));
break;
case WIN_VROOTY:
Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, y);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(y));
break;
case WIN_WIDTH:
- Tcl_SetIntObj(resultPtr, Tk_Width(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_Width(tkwin)));
break;
case WIN_X:
- Tcl_SetIntObj(resultPtr, Tk_X(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_X(tkwin)));
break;
case WIN_Y:
- Tcl_SetIntObj(resultPtr, Tk_Y(tkwin));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(Tk_Y(tkwin)));
break;
/*
@@ -1451,7 +1563,8 @@ Tk_WinfoObjCmd(
}
objv += skip;
string = Tcl_GetString(objv[2]);
- Tcl_SetLongObj(resultPtr, (long) Tk_InternAtom(tkwin, string));
+ Tcl_SetObjResult(interp,
+ Tcl_NewLongObj((long) Tk_InternAtom(tkwin, string)));
break;
case WIN_ATOMNAME: {
const char *name;
@@ -1471,12 +1584,11 @@ Tk_WinfoObjCmd(
}
name = Tk_GetAtomName(tkwin, (Atom) id);
if (strcmp(name, "?bad atom?") == 0) {
- string = Tcl_GetString(objv[2]);
- Tcl_AppendStringsToObj(resultPtr,
- "no atom exists with id \"", string, "\"", NULL);
+ Tcl_AppendResult(interp, "no atom exists with id \"",
+ Tcl_GetString(objv[2]), "\"", NULL);
return TCL_ERROR;
}
- Tcl_SetStringObj(resultPtr, name, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(name, -1));
break;
}
case WIN_CONTAINING:
@@ -1500,12 +1612,10 @@ Tk_WinfoObjCmd(
}
tkwin = Tk_CoordsToWindow(x, y, tkwin);
if (tkwin != NULL) {
- Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(tkwin),-1));
}
break;
- case WIN_INTERPS: {
- int result;
-
+ case WIN_INTERPS:
skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
if (skip < 0) {
return TCL_ERROR;
@@ -1514,9 +1624,7 @@ Tk_WinfoObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
return TCL_ERROR;
}
- result = TkGetInterpNames(interp, tkwin);
- return result;
- }
+ return TkGetInterpNames(interp, tkwin);
case WIN_PATHNAME: {
Window id;
@@ -1532,10 +1640,10 @@ Tk_WinfoObjCmd(
if (TkpScanWindowId(interp, string, &id) != TCL_OK) {
return TCL_ERROR;
}
- winPtr = (TkWindow *)Tk_IdToWindow(Tk_Display(tkwin), id);
+ winPtr = (TkWindow *) Tk_IdToWindow(Tk_Display(tkwin), id);
if ((winPtr == NULL) ||
(winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr)) {
- Tcl_AppendStringsToObj(resultPtr, "window id \"", string,
+ Tcl_AppendResult(interp, "window id \"", string,
"\" doesn't exist in this application", NULL);
return TCL_ERROR;
}
@@ -1548,7 +1656,7 @@ Tk_WinfoObjCmd(
tkwin = (Tk_Window) winPtr;
if (Tk_PathName(tkwin) != NULL) {
- Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(tkwin),-1));
}
break;
}
@@ -1567,13 +1675,12 @@ Tk_WinfoObjCmd(
string = Tcl_GetString(objv[2]);
winPtr = (TkWindow *) Tk_NameToWindow(interp, string, tkwin);
Tcl_ResetResult(interp);
- resultPtr = Tcl_GetObjResult(interp);
alive = 1;
if ((winPtr == NULL) || (winPtr->flags & TK_ALREADY_DEAD)) {
alive = 0;
}
- Tcl_SetBooleanObj(resultPtr, alive);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(alive));
break;
}
case WIN_FPIXELS: {
@@ -1583,9 +1690,7 @@ Tk_WinfoObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window number");
return TCL_ERROR;
}
- string = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) {
return TCL_ERROR;
}
string = Tcl_GetString(objv[3]);
@@ -1594,7 +1699,7 @@ Tk_WinfoObjCmd(
}
pixels = mm * WidthOfScreen(Tk_Screen(tkwin))
/ WidthMMOfScreen(Tk_Screen(tkwin));
- Tcl_SetDoubleObj(resultPtr, pixels);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(pixels));
break;
}
case WIN_PIXELS: {
@@ -1604,47 +1709,40 @@ Tk_WinfoObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window number");
return TCL_ERROR;
}
- string = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) {
return TCL_ERROR;
}
string = Tcl_GetString(objv[3]);
if (Tk_GetPixels(interp, tkwin, string, &pixels) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_SetIntObj(resultPtr, pixels);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(pixels));
break;
}
case WIN_RGB: {
XColor *colorPtr;
- char buf[TCL_INTEGER_SPACE * 3];
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window colorName");
return TCL_ERROR;
}
- string = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) {
return TCL_ERROR;
}
- string = Tcl_GetString(objv[3]);
- colorPtr = Tk_GetColor(interp, tkwin, string);
+ colorPtr = Tk_GetColor(interp, tkwin, Tcl_GetString(objv[3]));
if (colorPtr == NULL) {
return TCL_ERROR;
}
- sprintf(buf, "%d %d %d", colorPtr->red, colorPtr->green,
- colorPtr->blue);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d",
+ colorPtr->red, colorPtr->green, colorPtr->blue));
Tk_FreeColor(colorPtr);
- Tcl_SetStringObj(resultPtr, buf, -1);
break;
}
case WIN_VISUALSAVAILABLE: {
XVisualInfo template, *visInfoPtr;
int count, i;
int includeVisualId;
- Tcl_Obj *strPtr;
+ Tcl_Obj *strPtr, *resultPtr;
char buf[16 + TCL_INTEGER_SPACE];
char visualIdString[TCL_INTEGER_SPACE];
@@ -1658,9 +1756,7 @@ Tk_WinfoObjCmd(
return TCL_ERROR;
}
- string = Tcl_GetString(objv[2]);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) {
return TCL_ERROR;
}
@@ -1668,10 +1764,11 @@ Tk_WinfoObjCmd(
visInfoPtr = XGetVisualInfo(Tk_Display(tkwin), VisualScreenMask,
&template, &count);
if (visInfoPtr == NULL) {
- Tcl_SetStringObj(resultPtr,
- "can't find any visuals for screen", -1);
+ Tcl_SetResult(interp, "can't find any visuals for screen",
+ TCL_STATIC);
return TCL_ERROR;
}
+ resultPtr = Tcl_NewObj();
for (i = 0; i < count; i++) {
string = TkFindStateString(visualMap, visInfoPtr[i].class);
if (string == NULL) {
@@ -1681,12 +1778,13 @@ Tk_WinfoObjCmd(
}
if (includeVisualId) {
sprintf(visualIdString, " 0x%x",
- (unsigned int) visInfoPtr[i].visualid);
+ (unsigned) visInfoPtr[i].visualid);
strcat(buf, visualIdString);
}
strPtr = Tcl_NewStringObj(buf, -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
+ Tcl_SetObjResult(interp, resultPtr);
XFree((char *) visInfoPtr);
break;
}
@@ -1723,7 +1821,7 @@ Tk_WmObjCmd(
Tk_Window tkwin;
TkWindow *winPtr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"aspect", "client", "command", "deiconify",
"focusmodel", "frame", "geometry", "grid",
"group", "iconbitmap", "iconify", "iconmask",
@@ -1903,7 +2001,7 @@ Tk_WmObjCmd(
updateGeom:
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
return TCL_OK;
@@ -1950,7 +2048,7 @@ TkGetDisplayOf(
* unmodified if "-displayof" argument was not
* present. */
{
- char *string;
+ const char *string;
int length;
if (objc < 1) {
@@ -1960,8 +2058,8 @@ TkGetDisplayOf(
if ((length >= 2) &&
(strncmp(string, "-displayof", (unsigned) length) == 0)) {
if (objc < 2) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "value for \"-displayof\" missing", -1);
+ Tcl_SetResult(interp, "value for \"-displayof\" missing",
+ TCL_STATIC);
return -1;
}
*tkwinPtr = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), *tkwinPtr);
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 6836c52..168664c 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -42,6 +42,7 @@ static Tcl_ThreadDataKey dataKey;
static void ColorInit(TkDisplay *dispPtr);
static void DupColorObjProc(Tcl_Obj *srcObjPtr,Tcl_Obj *dupObjPtr);
+static void FreeColorObj(Tcl_Obj *objPtr);
static void FreeColorObjProc(Tcl_Obj *objPtr);
static void InitColorObj(Tcl_Obj *objPtr);
@@ -51,7 +52,7 @@ static void InitColorObj(Tcl_Obj *objPtr);
* of the Tcl_Obj points to a TkColor object.
*/
-Tcl_ObjType tkColorObjType = {
+const Tcl_ObjType tkColorObjType = {
"color", /* name */
FreeColorObjProc, /* freeIntRepProc */
DupColorObjProc, /* dupIntRepProc */
@@ -111,7 +112,7 @@ Tk_AllocColorFromObj(
* longer in use. Clear the reference.
*/
- FreeColorObjProc(objPtr);
+ FreeColorObj(objPtr);
tkColPtr = NULL;
} else if ((Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
@@ -129,14 +130,14 @@ Tk_AllocColorFromObj(
if (tkColPtr != NULL) {
TkColor *firstColorPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
- FreeColorObjProc(objPtr);
+ FreeColorObj(objPtr);
for (tkColPtr = firstColorPtr; tkColPtr != NULL;
tkColPtr = tkColPtr->nextPtr) {
if ((Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
tkColPtr->resourceRefCount++;
tkColPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr;
return (XColor *) tkColPtr;
}
}
@@ -147,7 +148,7 @@ Tk_AllocColorFromObj(
*/
tkColPtr = (TkColor *) Tk_GetColor(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr;
if (tkColPtr != NULL) {
tkColPtr->objRefCount++;
}
@@ -356,7 +357,7 @@ Tk_GetColorByValue(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfColor(
XColor *colorPtr) /* Color whose name is desired. */
{
@@ -365,7 +366,7 @@ Tk_NameOfColor(
if (tkColPtr->magic==COLOR_MAGIC && tkColPtr->type==TK_COLOR_BY_NAME) {
return tkColPtr->hashPtr->key.string;
} else {
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
@@ -416,8 +417,8 @@ Tk_GCForColor(
if (tkColPtr->gc == None) {
gcValues.foreground = tkColPtr->color.pixel;
- tkColPtr->gc = XCreateGC(DisplayOfScreen(tkColPtr->screen),
- drawable, GCForeground, &gcValues);
+ tkColPtr->gc = XCreateGC(DisplayOfScreen(tkColPtr->screen), drawable,
+ GCForeground, &gcValues);
}
return tkColPtr->gc;
}
@@ -496,7 +497,7 @@ Tk_FreeColor(
*/
if (tkColPtr->objRefCount == 0) {
- ckfree((char *) tkColPtr);
+ ckfree(tkColPtr);
}
}
@@ -528,13 +529,13 @@ Tk_FreeColorFromObj(
Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
Tk_FreeColor(Tk_GetColorFromObj(tkwin, objPtr));
- FreeColorObjProc(objPtr);
+ FreeColorObj(objPtr);
}
/*
*---------------------------------------------------------------------------
*
- * FreeColorObjProc --
+ * FreeColorObjProc, FreeColorObj --
*
* This proc is called to release an object reference to a color. Called
* when the object's internal rep is released or when the cached tkColPtr
@@ -554,13 +555,21 @@ static void
FreeColorObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkColor *tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
+ FreeColorObj(objPtr);
+ objPtr->typePtr = NULL;
+}
+
+static void
+FreeColorObj(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
+{
+ TkColor *tkColPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (tkColPtr != NULL) {
tkColPtr->objRefCount--;
if ((tkColPtr->objRefCount == 0)
&& (tkColPtr->resourceRefCount == 0)) {
- ckfree((char *) tkColPtr);
+ ckfree(tkColPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -589,10 +598,10 @@ DupColorObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkColor *tkColPtr = (TkColor *) srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkColor *tkColPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = tkColPtr;
if (tkColPtr != NULL) {
tkColPtr->objRefCount++;
@@ -639,7 +648,7 @@ Tk_GetColorFromObj(
* map. If it is, we are done.
*/
- tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
+ tkColPtr = objPtr->internalRep.twoPtrValue.ptr1;
if ((tkColPtr != NULL)
&& (tkColPtr->resourceRefCount > 0)
&& (Tk_Screen(tkwin) == tkColPtr->screen)
@@ -669,8 +678,8 @@ Tk_GetColorFromObj(
(tkColPtr != NULL); tkColPtr = tkColPtr->nextPtr) {
if ((Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
- FreeColorObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
+ FreeColorObj(objPtr);
+ objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr;
tkColPtr->objRefCount++;
return (XColor *) tkColPtr;
}
@@ -715,7 +724,7 @@ InitColorObj(
Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &tkColorObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
@@ -772,7 +781,7 @@ Tcl_Obj *
TkDebugColor(
Tk_Window tkwin, /* The window in which the color will be used
* (not currently used). */
- char *name) /* Name of the desired color. */
+ const char *name) /* Name of the desired color. */
{
Tcl_HashEntry *hashPtr;
Tcl_Obj *resultPtr;
diff --git a/generic/tkColor.h b/generic/tkColor.h
index d4679cf..05ef295 100644
--- a/generic/tkColor.h
+++ b/generic/tkColor.h
@@ -12,12 +12,7 @@
#ifndef _TKCOLOR
#define _TKCOLOR
-#include <tkInt.h>
-
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
+#include "tkInt.h"
/*
* One of the following data structures is used to keep track of each color
@@ -77,7 +72,4 @@ MODULE_SCOPE void TkpFreeColor(TkColor *tkColPtr);
MODULE_SCOPE TkColor * TkpGetColor(Tk_Window tkwin, Tk_Uid name);
MODULE_SCOPE TkColor * TkpGetColorByValue(Tk_Window tkwin, XColor *colorPtr);
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKCOLOR */
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index ed47210..5262f58 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -48,7 +48,7 @@
*/
typedef struct TkOption {
- CONST Tk_OptionSpec *specPtr;
+ const Tk_OptionSpec *specPtr;
/* The original spec from the template passed
* to Tk_CreateOptionTable.*/
Tk_Uid dbNameUID; /* The Uid form of the option database
@@ -63,7 +63,7 @@ typedef struct TkOption {
struct TkOption *synonymPtr;
/* For synonym options, this points to the
* master entry. */
- struct Tk_ObjCustomOption *custom;
+ const struct Tk_ObjCustomOption *custom;
/* For TK_OPTION_CUSTOM. */
} extra;
int flags; /* Miscellaneous flag values; see below for
@@ -100,6 +100,8 @@ typedef struct OptionTable {
* chain. */
int numOptions; /* The number of items in the options array
* below. */
+ int refCount2; /* Reference counter for controlling the freeing
+ * of the memory occupied by this OptionTable */
Option options[1]; /* Information about the individual options in
* the table. This must be the last field in
* the structure: the actual size of the array
@@ -121,10 +123,11 @@ static Tcl_Obj * GetConfigList(char *recordPtr,
Option *optionPtr, Tk_Window tkwin);
static Tcl_Obj * GetObjectForOption(char *recordPtr,
Option *optionPtr, Tk_Window tkwin);
-static Option * GetOption(CONST char *name, OptionTable *tablePtr);
+static Option * GetOption(const char *name, OptionTable *tablePtr);
static Option * GetOptionFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, OptionTable *tablePtr);
static int ObjectIsEmpty(Tcl_Obj *objPtr);
+static void FreeOptionInternalRep(Tcl_Obj *objPtr);
static int SetOptionFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
/*
@@ -134,9 +137,9 @@ static int SetOptionFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
* the internalPtr2 field points to the entry that matched.
*/
-Tcl_ObjType tkOptionObjType = {
+static const Tcl_ObjType optionObjType = {
"option", /* name */
- NULL, /* freeIntRepProc */
+ FreeOptionInternalRep, /* freeIntRepProc */
NULL, /* dupIntRepProc */
NULL, /* updateStringProc */
SetOptionFromAny /* setFromAnyProc */
@@ -164,7 +167,7 @@ Tk_OptionTable
Tk_CreateOptionTable(
Tcl_Interp *interp, /* Interpreter associated with the application
* in which this table will be used. */
- CONST Tk_OptionSpec *templatePtr)
+ const Tk_OptionSpec *templatePtr)
/* Static information about the configuration
* options. */
{
@@ -172,7 +175,7 @@ Tk_CreateOptionTable(
Tcl_HashEntry *hashEntryPtr;
int newEntry;
OptionTable *tablePtr;
- CONST Tk_OptionSpec *specPtr, *specPtr2;
+ const Tk_OptionSpec *specPtr, *specPtr2;
Option *optionPtr;
int numOptions, i;
@@ -186,13 +189,12 @@ Tk_CreateOptionTable(
* doesn't already exist.
*/
- hashTablePtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, OPTION_HASH_KEY,
- NULL);
+ hashTablePtr = Tcl_GetAssocData(interp, OPTION_HASH_KEY, NULL);
if (hashTablePtr == NULL) {
- hashTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
+ hashTablePtr = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(hashTablePtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, OPTION_HASH_KEY, DestroyOptionHashTable,
- (ClientData) hashTablePtr);
+ hashTablePtr);
}
/*
@@ -217,9 +219,9 @@ Tk_CreateOptionTable(
for (specPtr = templatePtr; specPtr->type != TK_OPTION_END; specPtr++) {
numOptions++;
}
- tablePtr = (OptionTable *) (ckalloc(sizeof(OptionTable)
- + (numOptions * sizeof(Option))));
+ tablePtr = ckalloc(sizeof(OptionTable) + (numOptions * sizeof(Option)));
tablePtr->refCount = 1;
+ tablePtr->refCount2 = 1;
tablePtr->hashEntryPtr = hashEntryPtr;
tablePtr->nextPtr = NULL;
tablePtr->numOptions = numOptions;
@@ -268,7 +270,7 @@ Tk_CreateOptionTable(
|| (specPtr->type == TK_OPTION_BORDER))
&& (specPtr->clientData != NULL)) {
optionPtr->extra.monoColorPtr =
- Tcl_NewStringObj((char *) specPtr->clientData, -1);
+ Tcl_NewStringObj(specPtr->clientData, -1);
Tcl_IncrRefCount(optionPtr->extra.monoColorPtr);
}
@@ -276,8 +278,8 @@ Tk_CreateOptionTable(
/*
* Get the custom parsing, etc., functions.
*/
- optionPtr->extra.custom =
- (Tk_ObjCustomOption *) specPtr->clientData;
+
+ optionPtr->extra.custom = specPtr->clientData;
}
}
if (((specPtr->type == TK_OPTION_STRING)
@@ -301,8 +303,8 @@ Tk_CreateOptionTable(
*/
if (specPtr->clientData != NULL) {
- tablePtr->nextPtr = (OptionTable *) Tk_CreateOptionTable(interp,
- (Tk_OptionSpec *) specPtr->clientData);
+ tablePtr->nextPtr = (OptionTable *)
+ Tk_CreateOptionTable(interp, specPtr->clientData);
}
return (Tk_OptionTable) tablePtr;
@@ -355,7 +357,10 @@ Tk_DeleteOptionTable(
}
}
Tcl_DeleteHashEntry(tablePtr->hashEntryPtr);
- ckfree((char *) tablePtr);
+ tablePtr->refCount2--;
+ if (tablePtr->refCount2 <= 0) {
+ ckfree(tablePtr);
+ }
}
/*
@@ -383,7 +388,7 @@ DestroyOptionHashTable(
ClientData clientData, /* The hash table we are destroying */
Tcl_Interp *interp) /* The interpreter we are destroying */
{
- Tcl_HashTable *hashTablePtr = (Tcl_HashTable *) clientData;
+ Tcl_HashTable *hashTablePtr = clientData;
Tcl_HashSearch search;
Tcl_HashEntry *hashEntryPtr;
OptionTable *tablePtr;
@@ -408,7 +413,7 @@ DestroyOptionHashTable(
Tk_DeleteOptionTable((Tk_OptionTable) tablePtr);
}
Tcl_DeleteHashTable(hashTablePtr);
- ckfree((char *) hashTablePtr);
+ ckfree(hashTablePtr);
}
/*
@@ -632,7 +637,7 @@ DoObjConfig(
Tk_SavedOption internal; /* Used to save the old internal
* representation of the value if
* savedOptionPtr is NULL. */
- CONST Tk_OptionSpec *specPtr;
+ const Tk_OptionSpec *specPtr;
int nullOK;
/*
@@ -710,7 +715,8 @@ DoObjConfig(
break;
}
case TK_OPTION_STRING: {
- char *newStr, *value;
+ char *newStr;
+ const char *value;
int length;
if (nullOK && ObjectIsEmpty(valuePtr)) {
@@ -719,7 +725,7 @@ DoObjConfig(
if (internalPtr != NULL) {
if (valuePtr != NULL) {
value = Tcl_GetStringFromObj(valuePtr, &length);
- newStr = ckalloc((unsigned) (length + 1));
+ newStr = ckalloc(length + 1);
strcpy(newStr, value);
} else {
newStr = NULL;
@@ -733,7 +739,7 @@ DoObjConfig(
int newValue;
if (Tcl_GetIndexFromObj(interp, valuePtr,
- (CONST char **) optionPtr->specPtr->clientData,
+ optionPtr->specPtr->clientData,
optionPtr->specPtr->optionName+1, 0, &newValue) != TCL_OK) {
return TCL_ERROR;
}
@@ -930,7 +936,7 @@ DoObjConfig(
break;
}
case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ const Tk_ObjCustomOption *custom = optionPtr->extra.custom;
if (custom->setProc(custom->clientData, interp, tkwin,
&valuePtr, recordPtr, optionPtr->specPtr->internalOffset,
@@ -1028,13 +1034,13 @@ ObjectIsEmpty(
static Option *
GetOption(
- CONST char *name, /* String balue to be looked up in the option
+ 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;
- CONST char *p1, *p2;
+ const char *p1, *p2;
int count;
/*
@@ -1121,13 +1127,13 @@ GetOptionFromObj(
OptionTable *tablePtr) /* Table in which to look up objPtr. */
{
Option *bestPtr;
- char *name;
+ const char *name;
/*
* First, check to see if the object already has the answer cached.
*/
- if (objPtr->typePtr == &tkOptionObjType) {
+ if (objPtr->typePtr == &optionObjType) {
if (objPtr->internalRep.twoPtrValue.ptr1 == (void *) tablePtr) {
return (Option *) objPtr->internalRep.twoPtrValue.ptr2;
}
@@ -1149,7 +1155,8 @@ GetOptionFromObj(
}
objPtr->internalRep.twoPtrValue.ptr1 = (void *) tablePtr;
objPtr->internalRep.twoPtrValue.ptr2 = (void *) bestPtr;
- objPtr->typePtr = &tkOptionObjType;
+ objPtr->typePtr = &optionObjType;
+ tablePtr->refCount2++;
return bestPtr;
error:
@@ -1182,9 +1189,9 @@ GetOptionFromObj(
*----------------------------------------------------------------------
*/
-CONST Tk_OptionSpec *
+const Tk_OptionSpec *
TkGetOptionSpec(
- CONST char *name, /* String value to be looked up. */
+ const char *name, /* String value to be looked up. */
Tk_OptionTable optionTable) /* Table in which to look up name. */
{
Option *optionPtr;
@@ -1221,11 +1228,46 @@ SetOptionFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
register Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_AppendToObj(Tcl_GetObjResult(interp),
+ Tcl_AppendResult(interp,
"can't convert value to option except via GetOptionFromObj API",
- -1);
+ NULL);
return TCL_ERROR;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FreeOptionInternalRep --
+ *
+ * Part of the option Tcl object type implementation. Frees the storage
+ * associated with a option object's internal representation unless it
+ * is still in use.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The option object's internal rep is marked invalid and its memory
+ * gets freed unless it is still in use somewhere. In that case the
+ * cleanup is delayed until the last reference goes away.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FreeOptionInternalRep(
+ register Tcl_Obj *objPtr) /* Object whose internal rep to free. */
+{
+ register OptionTable *tablePtr = (OptionTable *) objPtr->internalRep.twoPtrValue.ptr1;
+
+ tablePtr->refCount2--;
+ if (tablePtr->refCount2 <= 0) {
+ ckfree(tablePtr);
+ }
+ objPtr->typePtr = NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
+ objPtr->internalRep.twoPtrValue.ptr2 = NULL;
+}
/*
*--------------------------------------------------------------
@@ -1260,7 +1302,7 @@ Tk_SetOptions(
char *recordPtr, /* The record to configure. */
Tk_OptionTable optionTable, /* Describes valid options. */
int objc, /* The number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Contains one or more name-value pairs. */
+ Tcl_Obj *const objv[], /* Contains one or more name-value pairs. */
Tk_Window tkwin, /* Window associated with the thing being
* configured; needed for some options (such
* as colors). */
@@ -1304,9 +1346,8 @@ Tk_SetOptions(
if (objc < 2) {
if (interp != NULL) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "value for \"", Tcl_GetStringFromObj(*objv, NULL),
- "\" missing", NULL);
+ Tcl_AppendResult(interp, "value for \"",
+ Tcl_GetStringFromObj(*objv, NULL), "\" missing",NULL);
goto error;
}
}
@@ -1317,7 +1358,7 @@ Tk_SetOptions(
* more space.
*/
- newSavePtr = (Tk_SavedOptions *) ckalloc(sizeof(Tk_SavedOptions));
+ newSavePtr = ckalloc(sizeof(Tk_SavedOptions));
newSavePtr->recordPtr = recordPtr;
newSavePtr->tkwin = tkwin;
newSavePtr->numItems = 0;
@@ -1383,7 +1424,7 @@ Tk_RestoreSavedOptions(
* record. */
char *internalPtr; /* Points to internal value of option in
* record. */
- CONST Tk_OptionSpec *specPtr;
+ const Tk_OptionSpec *specPtr;
/*
* Be sure to restore the options in the opposite order they were set.
@@ -1393,7 +1434,7 @@ Tk_RestoreSavedOptions(
if (savePtr->nextPtr != NULL) {
Tk_RestoreSavedOptions(savePtr->nextPtr);
- ckfree((char *) savePtr->nextPtr);
+ ckfree(savePtr->nextPtr);
savePtr->nextPtr = NULL;
}
for (i = savePtr->numItems - 1; i >= 0; i--) {
@@ -1433,6 +1474,7 @@ Tk_RestoreSavedOptions(
if (specPtr->internalOffset >= 0) {
register char *ptr = (char *) &savePtr->items[i].internalForm;
+ CLANG_ASSERT(internalPtr);
switch (specPtr->type) {
case TK_OPTION_BOOLEAN:
*((int *) internalPtr) = *((int *) ptr);
@@ -1484,7 +1526,7 @@ Tk_RestoreSavedOptions(
*((Tk_Window *) internalPtr) = *((Tk_Window *) ptr);
break;
case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ const Tk_ObjCustomOption *custom = optionPtr->extra.custom;
if (custom->restoreProc != NULL) {
custom->restoreProc(custom->clientData, savePtr->tkwin,
@@ -1527,7 +1569,7 @@ Tk_FreeSavedOptions(
if (savePtr->nextPtr != NULL) {
Tk_FreeSavedOptions(savePtr->nextPtr);
- ckfree((char *) savePtr->nextPtr);
+ ckfree(savePtr->nextPtr);
}
for (count = savePtr->numItems,
savedOptionPtr = &savePtr->items[savePtr->numItems-1];
@@ -1573,7 +1615,7 @@ Tk_FreeConfigOptions(
int count;
Tcl_Obj **oldPtrPtr, *oldPtr;
char *oldInternalPtr;
- CONST Tk_OptionSpec *specPtr;
+ const Tk_OptionSpec *specPtr;
for (tablePtr = (OptionTable *) optionTable; tablePtr != NULL;
tablePtr = tablePtr->nextPtr) {
@@ -1709,7 +1751,7 @@ FreeResources(
}
break;
case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ const Tk_ObjCustomOption *custom = optionPtr->extra.custom;
if (internalFormExists && custom->freeProc != NULL) {
custom->freeProc(custom->clientData, tkwin, internalPtr);
}
@@ -2000,7 +2042,7 @@ GetObjectForOption(
break;
}
case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ const Tk_ObjCustomOption *custom = optionPtr->extra.custom;
objPtr = custom->getProc(custom->clientData, tkwin, recordPtr,
optionPtr->specPtr->internalOffset);
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index b10aaaf..a59092e 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -11,7 +11,7 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tk.h"
+#include "tkInt.h"
/*
* Each console is associated with an instance of the ConsoleInfo struct.
@@ -46,25 +46,25 @@ typedef struct ChannelData {
static int ConsoleClose(ClientData instanceData, Tcl_Interp *interp);
static void ConsoleDeleteProc(ClientData clientData);
static void ConsoleEventProc(ClientData clientData, XEvent *eventPtr);
-static int ConsoleHandle(ClientData instanceData,
- int direction, ClientData *handlePtr);
-static int ConsoleInput(ClientData instanceData,
- char *buf, int toRead, int *errorCode);
+static int ConsoleHandle(ClientData instanceData, int direction,
+ ClientData *handlePtr);
+static int ConsoleInput(ClientData instanceData, char *buf, int toRead,
+ int *errorCode);
static int ConsoleObjCmd(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
-static int ConsoleOutput(ClientData instanceData,
- CONST char *buf, int toWrite, int *errorCode);
+ int objc, Tcl_Obj *const objv[]);
+static int ConsoleOutput(ClientData instanceData, const char *buf,
+ int toWrite, int *errorCode);
static void ConsoleWatch(ClientData instanceData, int mask);
static void DeleteConsoleInterp(ClientData clientData);
static void InterpDeleteProc(ClientData clientData, Tcl_Interp *interp);
static int InterpreterObjCmd(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
/*
* This structure describes the channel type structure for file based IO:
*/
-static Tcl_ChannelType consoleChannelType = {
+static const Tcl_ChannelType consoleChannelType = {
"console", /* Type name. */
TCL_CHANNEL_VERSION_4, /* v4 channel */
ConsoleClose, /* Close proc. */
@@ -166,7 +166,7 @@ ShouldUseConsoleChannel(
*/
if (fileType == FILE_TYPE_CHAR) {
- dcb.DCBlength = sizeof( DCB ) ;
+ dcb.DCBlength = sizeof(DCB);
if (!GetConsoleMode(handle, &consoleParams) &&
!GetCommState(handle, &dcb)) {
/*
@@ -220,7 +220,7 @@ Tk_InitConsoleChannels(
Tcl_Channel consoleChannel;
/*
- * Ensure that we are getting the matching version of Tcl. This is really
+ * Ensure that we are getting a compatible version of Tcl. This is really
* only an issue when Tk is loaded dynamically.
*/
@@ -228,9 +228,12 @@ Tk_InitConsoleChannels(
return;
}
- consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int)sizeof(int));
+ consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int));
if (*consoleInitPtr) {
- /* We've already initialized console channels in this thread. */
+ /*
+ * We've already initialized console channels in this thread.
+ */
+
return;
}
*consoleInitPtr = 1;
@@ -241,74 +244,69 @@ Tk_InitConsoleChannels(
if (!(doIn || doOut || doErr)) {
/*
- * No std channels should be tied to the console;
- * Thus, no need to create the console
+ * No std channels should be tied to the console; thus, no need to
+ * create the console.
*/
+
return;
}
/*
- * At least one std channel wants to be tied to the console,
- * so create the interp for it to live in.
+ * At least one std channel wants to be tied to the console, so create the
+ * interp for it to live in.
*/
- info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo));
+ info = ckalloc(sizeof(ConsoleInfo));
info->consoleInterp = NULL;
info->interp = NULL;
info->refCount = 0;
if (doIn) {
- ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData));
+ ChannelData *data = ckalloc(sizeof(ChannelData));
+
data->info = info;
data->info->refCount++;
data->type = TCL_STDIN;
consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console0",
- (ClientData) data, TCL_READABLE);
+ data, TCL_READABLE);
if (consoleChannel != NULL) {
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-translation", "lf");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-buffering", "none");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-encoding", "utf-8");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8");
}
Tcl_SetStdChannel(consoleChannel, TCL_STDIN);
Tcl_RegisterChannel(NULL, consoleChannel);
}
if (doOut) {
- ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData));
+ ChannelData *data = ckalloc(sizeof(ChannelData));
+
data->info = info;
data->info->refCount++;
data->type = TCL_STDOUT;
consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console1",
- (ClientData) data, TCL_WRITABLE);
+ data, TCL_WRITABLE);
if (consoleChannel != NULL) {
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-translation", "lf");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-buffering", "none");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-encoding", "utf-8");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8");
}
Tcl_SetStdChannel(consoleChannel, TCL_STDOUT);
Tcl_RegisterChannel(NULL, consoleChannel);
}
if (doErr) {
- ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData));
+ ChannelData *data = ckalloc(sizeof(ChannelData));
+
data->info = info;
data->info->refCount++;
data->type = TCL_STDERR;
consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console2",
- (ClientData) data, TCL_WRITABLE);
+ data, TCL_WRITABLE);
if (consoleChannel != NULL) {
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-translation", "lf");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-buffering", "none");
- Tcl_SetChannelOption(NULL, consoleChannel,
- "-encoding", "utf-8");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none");
+ Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8");
}
Tcl_SetStdChannel(consoleChannel, TCL_STDERR);
Tcl_RegisterChannel(NULL, consoleChannel);
@@ -369,55 +367,60 @@ Tk_CreateConsoleWindow(
}
if (haveConsoleChannel) {
- ChannelData *data = (ChannelData *)Tcl_GetChannelInstanceData(chan);
+ ChannelData *data = (ChannelData *) Tcl_GetChannelInstanceData(chan);
info = data->info;
if (info->consoleInterp) {
- /* New ConsoleInfo for a new console window */
- info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo));
+ /*
+ * New ConsoleInfo for a new console window.
+ */
+
+ info = ckalloc(sizeof(ConsoleInfo));
info->refCount = 0;
- /* Update any console channels to make use of the new console */
+ /*
+ * Update any console channels to make use of the new console.
+ */
+
if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDIN))
== &consoleChannelType) {
- data = (ChannelData *)Tcl_GetChannelInstanceData(chan);
+ data = (ChannelData *) Tcl_GetChannelInstanceData(chan);
data->info->refCount--;
data->info = info;
data->info->refCount++;
}
if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDOUT))
== &consoleChannelType) {
- data = (ChannelData *)Tcl_GetChannelInstanceData(chan);
+ data = (ChannelData *) Tcl_GetChannelInstanceData(chan);
data->info->refCount--;
data->info = info;
data->info->refCount++;
}
if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDERR))
== &consoleChannelType) {
- data = (ChannelData *)Tcl_GetChannelInstanceData(chan);
+ data = (ChannelData *) Tcl_GetChannelInstanceData(chan);
data->info->refCount--;
data->info = info;
data->info->refCount++;
}
}
} else {
- info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo));
+ info = ckalloc(sizeof(ConsoleInfo));
info->refCount = 0;
}
info->consoleInterp = consoleInterp;
info->interp = interp;
- Tcl_CallWhenDeleted(consoleInterp, InterpDeleteProc, (ClientData) info);
+ Tcl_CallWhenDeleted(consoleInterp, InterpDeleteProc, info);
info->refCount++;
- Tcl_CreateThreadExitHandler(DeleteConsoleInterp,
- (ClientData) consoleInterp);
+ Tcl_CreateThreadExitHandler(DeleteConsoleInterp, consoleInterp);
/*
* Add console commands to the interp
*/
- token = Tcl_CreateObjCommand(interp, "console", ConsoleObjCmd,
- (ClientData) info, ConsoleDeleteProc);
+ token = Tcl_CreateObjCommand(interp, "console", ConsoleObjCmd, info,
+ ConsoleDeleteProc);
info->refCount++;
/*
@@ -426,38 +429,38 @@ Tk_CreateConsoleWindow(
* handler takes care of us.
*/
Tcl_CreateObjCommand(consoleInterp, "consoleinterp", InterpreterObjCmd,
- (ClientData) info, NULL);
+ info, NULL);
mainWindow = Tk_MainWindow(interp);
if (mainWindow) {
Tk_CreateEventHandler(mainWindow, StructureNotifyMask,
- ConsoleEventProc, (ClientData) info);
+ ConsoleEventProc, info);
info->refCount++;
}
- Tcl_Preserve((ClientData) consoleInterp);
+ Tcl_Preserve(consoleInterp);
result = Tcl_GlobalEval(consoleInterp, "source $tk_library/console.tcl");
if (result == TCL_ERROR) {
Tcl_SetReturnOptions(interp,
Tcl_GetReturnOptions(consoleInterp, result));
Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp));
}
- Tcl_Release((ClientData) consoleInterp);
+ Tcl_Release(consoleInterp);
if (result == TCL_ERROR) {
Tcl_DeleteCommandFromToken(interp, token);
mainWindow = Tk_MainWindow(interp);
if (mainWindow) {
Tk_DeleteEventHandler(mainWindow, StructureNotifyMask,
- ConsoleEventProc, (ClientData) info);
+ ConsoleEventProc, info);
if (--info->refCount <= 0) {
- ckfree((char *) info);
+ ckfree(info);
}
}
goto error;
}
return TCL_OK;
- error:
+ error:
Tcl_AddErrorInfo(interp, "\n (creating console window)");
if (!Tcl_InterpDeleted(consoleInterp)) {
Tcl_DeleteInterp(consoleInterp);
@@ -486,11 +489,11 @@ Tk_CreateConsoleWindow(
static int
ConsoleOutput(
ClientData instanceData, /* Indicates which device to use. */
- CONST 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. */
{
- ChannelData *data = (ChannelData *)instanceData;
+ ChannelData *data = instanceData;
ConsoleInfo *info = data->info;
*errorCode = 0;
@@ -585,16 +588,19 @@ ConsoleClose(
ClientData instanceData, /* Unused. */
Tcl_Interp *interp) /* Unused. */
{
- ChannelData *data = (ChannelData *)instanceData;
+ ChannelData *data = instanceData;
ConsoleInfo *info = data->info;
if (info) {
if (--info->refCount <= 0) {
- /* Assuming the Tcl_Interp * fields must already be NULL */
- ckfree((char *) info);
+ /*
+ * Assuming the Tcl_Interp * fields must already be NULL.
+ */
+
+ ckfree(info);
}
}
- ckfree((char *) data);
+ ckfree(data);
return 0;
}
@@ -677,13 +683,14 @@ ConsoleObjCmd(
ClientData clientData, /* Access to the console interp */
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
- Tcl_Obj *CONST objv[]) /* Argument objects */
+ Tcl_Obj *const objv[]) /* Argument objects */
{
int index, result;
- static CONST char *options[] = {"eval", "hide", "show", "title", NULL};
+ static const char *const options[] = {
+ "eval", "hide", "show", "title", NULL};
enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE};
Tcl_Obj *cmd = NULL;
- ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ConsoleInfo *info = clientData;
Tcl_Interp *consoleInterp = info->consoleInterp;
if (objc < 2) {
@@ -727,16 +734,18 @@ ConsoleObjCmd(
Tcl_ListObjAppendElement(NULL, cmd, objv[2]);
}
break;
+ default:
+ CLANG_ASSERT(0);
}
Tcl_IncrRefCount(cmd);
if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) {
- Tcl_Preserve((ClientData) consoleInterp);
+ Tcl_Preserve(consoleInterp);
result = Tcl_GlobalEvalObj(consoleInterp, cmd);
Tcl_SetReturnOptions(interp,
Tcl_GetReturnOptions(consoleInterp, result));
Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp));
- Tcl_Release((ClientData) consoleInterp);
+ Tcl_Release(consoleInterp);
} else {
Tcl_AppendResult(interp, "no active console interp", NULL);
result = TCL_ERROR;
@@ -764,12 +773,12 @@ InterpreterObjCmd(
ClientData clientData, /* */
Tcl_Interp *interp, /* Current interpreter */
int objc, /* Number of arguments */
- Tcl_Obj *CONST objv[]) /* Argument objects */
+ Tcl_Obj *const objv[]) /* Argument objects */
{
int index, result = TCL_OK;
- static CONST char *options[] = {"eval", "record", NULL};
+ static const char *const options[] = {"eval", "record", NULL};
enum option {OTHER_EVAL, OTHER_RECORD};
- ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ConsoleInfo *info = clientData;
Tcl_Interp *otherInterp = info->interp;
if (objc < 2) {
@@ -791,28 +800,32 @@ InterpreterObjCmd(
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) otherInterp);
+ Tcl_Preserve(otherInterp);
switch ((enum option) index) {
case OTHER_EVAL:
result = Tcl_GlobalEvalObj(otherInterp, objv[2]);
+
/*
* TODO: Should exceptions be filtered here?
*/
+
Tcl_SetReturnOptions(interp,
Tcl_GetReturnOptions(otherInterp, result));
Tcl_SetObjResult(interp, Tcl_GetObjResult(otherInterp));
break;
case OTHER_RECORD:
Tcl_RecordAndEvalObj(otherInterp, objv[2], TCL_EVAL_GLOBAL);
+
/*
- * By not setting result, we discard any exceptions or errors here
- * and always return TCL_OK. All the caller wants is the
- * interp result to display, whether that's result or error message.
+ * By not setting result, we discard any exceptions or errors here and
+ * always return TCL_OK. All the caller wants is the interp result to
+ * display, whether that's result or error message.
*/
+
Tcl_SetObjResult(interp, Tcl_GetObjResult(otherInterp));
break;
}
- Tcl_Release((ClientData) otherInterp);
+ Tcl_Release(otherInterp);
return result;
}
@@ -821,8 +834,8 @@ InterpreterObjCmd(
*
* DeleteConsoleInterp --
*
- * Thread exit handler to destroy a console interp when the
- * thread it lives in gets torn down.
+ * Thread exit handler to destroy a console interp when the thread it
+ * lives in gets torn down.
*
*----------------------------------------------------------------------
*/
@@ -831,7 +844,8 @@ static void
DeleteConsoleInterp(
ClientData clientData)
{
- Tcl_Interp *interp = (Tcl_Interp *)clientData;
+ Tcl_Interp *interp = clientData;
+
Tcl_DeleteInterp(interp);
}
@@ -840,8 +854,8 @@ DeleteConsoleInterp(
*
* InterpDeleteProc --
*
- * React when the interp in which the console is displayed is deleted
- * for any reason.
+ * React when the interp in which the console is displayed is deleted for
+ * any reason.
*
* Results:
* None.
@@ -857,15 +871,14 @@ InterpDeleteProc(
ClientData clientData,
Tcl_Interp *interp)
{
- ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ConsoleInfo *info = clientData;
if (info->consoleInterp == interp) {
- Tcl_DeleteThreadExitHandler(DeleteConsoleInterp,
- (ClientData) info->consoleInterp);
+ Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, info->consoleInterp);
info->consoleInterp = NULL;
}
if (--info->refCount <= 0) {
- ckfree((char *) info);
+ ckfree(info);
}
}
@@ -890,13 +903,13 @@ static void
ConsoleDeleteProc(
ClientData clientData)
{
- ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ConsoleInfo *info = clientData;
if (info->consoleInterp) {
Tcl_DeleteInterp(info->consoleInterp);
}
if (--info->refCount <= 0) {
- ckfree((char *) info);
+ ckfree(info);
}
}
@@ -925,7 +938,7 @@ ConsoleEventProc(
XEvent *eventPtr)
{
if (eventPtr->type == DestroyNotify) {
- ConsoleInfo *info = (ConsoleInfo *) clientData;
+ ConsoleInfo *info = clientData;
Tcl_Interp *consoleInterp = info->consoleInterp;
if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) {
@@ -933,7 +946,7 @@ ConsoleEventProc(
}
if (--info->refCount <= 0) {
- ckfree((char *) info);
+ ckfree(info);
}
}
}
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index 606a349..54184b3 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -23,8 +23,8 @@
*/
typedef struct {
- CONST char *source; /* Cursor bits. */
- CONST 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. */
@@ -40,9 +40,10 @@ static void CursorInit(TkDisplay *dispPtr);
static void DupCursorObjProc(Tcl_Obj *srcObjPtr,
Tcl_Obj *dupObjPtr);
static void FreeCursor(TkCursor *cursorPtr);
+static void FreeCursorObj(Tcl_Obj *objPtr);
static void FreeCursorObjProc(Tcl_Obj *objPtr);
-static TkCursor * TkcGetCursor(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *name);
+static TkCursor * TkcGetCursor(Tcl_Interp *interp, Tk_Window tkwin,
+ const char *name);
static TkCursor * GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
static void InitCursorObj(Tcl_Obj *objPtr);
@@ -54,7 +55,7 @@ static void InitCursorObj(Tcl_Obj *objPtr);
* option is set.
*/
-Tcl_ObjType tkCursorObjType = {
+Tcl_ObjType const tkCursorObjType = {
"cursor", /* name */
FreeCursorObjProc, /* freeIntRepProc */
DupCursorObjProc, /* dupIntRepProc */
@@ -99,7 +100,7 @@ Tk_AllocCursorFromObj(
if (objPtr->typePtr != &tkCursorObjType) {
InitCursorObj(objPtr);
}
- cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
+ cursorPtr = objPtr->internalRep.twoPtrValue.ptr1;
/*
* If the object currently points to a TkCursor, see if it's the one we
@@ -113,7 +114,7 @@ Tk_AllocCursorFromObj(
* longer in use. Clear the reference.
*/
- FreeCursorObjProc(objPtr);
+ FreeCursorObj(objPtr);
cursorPtr = NULL;
} else if (Tk_Display(tkwin) == cursorPtr->display) {
cursorPtr->resourceRefCount++;
@@ -128,15 +129,15 @@ Tk_AllocCursorFromObj(
*/
if (cursorPtr != NULL) {
- TkCursor *firstCursorPtr = (TkCursor *)
- Tcl_GetHashValue(cursorPtr->hashPtr);
- FreeCursorObjProc(objPtr);
+ TkCursor *firstCursorPtr = Tcl_GetHashValue(cursorPtr->hashPtr);
+
+ FreeCursorObj(objPtr);
for (cursorPtr = firstCursorPtr; cursorPtr != NULL;
cursorPtr = cursorPtr->nextPtr) {
if (Tk_Display(tkwin) == cursorPtr->display) {
cursorPtr->resourceRefCount++;
cursorPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr;
return cursorPtr->cursor;
}
}
@@ -147,7 +148,7 @@ Tk_AllocCursorFromObj(
*/
cursorPtr = TkcGetCursor(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr;
if (cursorPtr == NULL) {
return None;
}
@@ -187,6 +188,7 @@ Tk_GetCursor(
* details on legal syntax. */
{
TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string);
+
if (cursorPtr == NULL) {
return None;
}
@@ -223,7 +225,7 @@ static TkCursor *
TkcGetCursor(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which cursor will be used. */
- CONST char *string) /* Description of cursor. See manual entry for
+ const char *string) /* Description of cursor. See manual entry for
* details on legal syntax. */
{
Tcl_HashEntry *nameHashPtr;
@@ -237,9 +239,9 @@ TkcGetCursor(
}
nameHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorNameTable,
- string, &isNew);
+ string, &isNew);
if (!isNew) {
- existingCursorPtr = (TkCursor *) Tcl_GetHashValue(nameHashPtr);
+ existingCursorPtr = Tcl_GetHashValue(nameHashPtr);
for (cursorPtr = existingCursorPtr; cursorPtr != NULL;
cursorPtr = cursorPtr->nextPtr) {
if (Tk_Display(tkwin) == cursorPtr->display) {
@@ -271,7 +273,7 @@ TkcGetCursor(
cursorPtr->hashPtr = nameHashPtr;
cursorPtr->nextPtr = existingCursorPtr;
cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
- (char *) cursorPtr->cursor, &isNew);
+ (char *) cursorPtr->cursor, &isNew);
if (!isNew) {
Tcl_Panic("cursor already registered in Tk_GetCursor");
}
@@ -309,8 +311,8 @@ Tk_Cursor
Tk_GetCursorFromData(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
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. */
+ 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. */
Tk_Uid fg, /* Foreground color for cursor. */
@@ -337,9 +339,9 @@ Tk_GetCursorFromData(
dataKey.bg = bg;
dataKey.display = Tk_Display(tkwin);
dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable,
- (char *) &dataKey, &isNew);
+ (char *) &dataKey, &isNew);
if (!isNew) {
- cursorPtr = (TkCursor *) Tcl_GetHashValue(dataHashPtr);
+ cursorPtr = Tcl_GetHashValue(dataHashPtr);
cursorPtr->resourceRefCount++;
return cursorPtr->cursor;
}
@@ -370,7 +372,7 @@ Tk_GetCursorFromData(
cursorPtr->hashPtr = dataHashPtr;
cursorPtr->objRefCount = 0;
cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
- (char *) cursorPtr->cursor, &isNew);
+ (char *) cursorPtr->cursor, &isNew);
cursorPtr->nextPtr = NULL;
if (!isNew) {
@@ -405,7 +407,7 @@ Tk_GetCursorFromData(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfCursor(
Display *display, /* Display for which cursor was allocated. */
Tk_Cursor cursor) /* Identifier for cursor whose name is
@@ -426,7 +428,7 @@ Tk_NameOfCursor(
if (idHashPtr == NULL) {
goto printid;
}
- cursorPtr = (TkCursor *) Tcl_GetHashValue(idHashPtr);
+ cursorPtr = Tcl_GetHashValue(idHashPtr);
if (cursorPtr->otherTable != &dispPtr->cursorNameTable) {
goto printid;
}
@@ -463,7 +465,7 @@ FreeCursor(
}
Tcl_DeleteHashEntry(cursorPtr->idHashPtr);
- prevPtr = (TkCursor *) Tcl_GetHashValue(cursorPtr->hashPtr);
+ prevPtr = Tcl_GetHashValue(cursorPtr->hashPtr);
if (prevPtr == cursorPtr) {
if (cursorPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(cursorPtr->hashPtr);
@@ -478,7 +480,7 @@ FreeCursor(
}
TkpFreeCursor(cursorPtr);
if (cursorPtr->objRefCount == 0) {
- ckfree((char *) cursorPtr);
+ ckfree(cursorPtr);
}
}
@@ -516,7 +518,7 @@ Tk_FreeCursor(
if (idHashPtr == NULL) {
Tcl_Panic("Tk_FreeCursor received unknown cursor argument");
}
- FreeCursor((TkCursor *) Tcl_GetHashValue(idHashPtr));
+ FreeCursor(Tcl_GetHashValue(idHashPtr));
}
/*
@@ -547,13 +549,13 @@ Tk_FreeCursorFromObj(
Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
FreeCursor(GetCursorFromObj(tkwin, objPtr));
- FreeCursorObjProc(objPtr);
+ FreeCursorObj(objPtr);
}
/*
*---------------------------------------------------------------------------
*
- * FreeCursorFromObjProc --
+ * FreeCursorObjProc, FreeCursorObj --
*
* This proc is called to release an object reference to a cursor.
* Called when the object's internal rep is released or when the cached
@@ -573,13 +575,21 @@ static void
FreeCursorObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkCursor *cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
+ FreeCursorObj(objPtr);
+ objPtr->typePtr = NULL;
+}
+
+static void
+FreeCursorObj(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
+{
+ TkCursor *cursorPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (cursorPtr != NULL) {
cursorPtr->objRefCount--;
if ((cursorPtr->objRefCount == 0)
&& (cursorPtr->resourceRefCount == 0)) {
- ckfree((char *) cursorPtr);
+ ckfree(cursorPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
@@ -608,10 +618,10 @@ DupCursorObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkCursor *cursorPtr = (TkCursor *) srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkCursor *cursorPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = cursorPtr;
if (cursorPtr != NULL) {
cursorPtr->objRefCount++;
@@ -693,7 +703,7 @@ GetCursorFromObj(
* cached is the one that is needed.
*/
- cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
+ cursorPtr = objPtr->internalRep.twoPtrValue.ptr1;
if ((cursorPtr != NULL) && (Tk_Display(tkwin) == cursorPtr->display)) {
return cursorPtr;
}
@@ -708,11 +718,11 @@ GetCursorFromObj(
if (hashPtr == NULL) {
goto error;
}
- for (cursorPtr = (TkCursor *) Tcl_GetHashValue(hashPtr);
+ for (cursorPtr = Tcl_GetHashValue(hashPtr);
cursorPtr != NULL; cursorPtr = cursorPtr->nextPtr) {
if (Tk_Display(tkwin) == cursorPtr->display) {
- FreeCursorObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
+ FreeCursorObj(objPtr);
+ objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr;
cursorPtr->objRefCount++;
return cursorPtr;
}
@@ -757,7 +767,7 @@ InitCursorObj(
Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &tkCursorObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
@@ -830,7 +840,7 @@ Tcl_Obj *
TkDebugCursor(
Tk_Window tkwin, /* The window in which the cursor will be used
* (not currently used). */
- char *name) /* Name of the desired color. */
+ const char *name) /* Name of the desired color. */
{
TkCursor *cursorPtr;
Tcl_HashEntry *hashPtr;
@@ -843,7 +853,7 @@ TkDebugCursor(
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->cursorNameTable, name);
if (hashPtr != NULL) {
- cursorPtr = (TkCursor *) Tcl_GetHashValue(hashPtr);
+ cursorPtr = Tcl_GetHashValue(hashPtr);
if (cursorPtr == NULL) {
Tcl_Panic("TkDebugCursor found empty hash table entry");
}
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index d06df4b..fb949b2 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -29,1673 +29,867 @@
* Exported function declarations:
*/
-#ifndef Tk_MainLoop_TCL_DECLARED
-#define Tk_MainLoop_TCL_DECLARED
/* 0 */
EXTERN void Tk_MainLoop(void);
-#endif
-#ifndef Tk_3DBorderColor_TCL_DECLARED
-#define Tk_3DBorderColor_TCL_DECLARED
/* 1 */
EXTERN XColor * Tk_3DBorderColor(Tk_3DBorder border);
-#endif
-#ifndef Tk_3DBorderGC_TCL_DECLARED
-#define Tk_3DBorderGC_TCL_DECLARED
/* 2 */
EXTERN GC Tk_3DBorderGC(Tk_Window tkwin, Tk_3DBorder border,
int which);
-#endif
-#ifndef Tk_3DHorizontalBevel_TCL_DECLARED
-#define Tk_3DHorizontalBevel_TCL_DECLARED
/* 3 */
EXTERN 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);
-#endif
-#ifndef Tk_3DVerticalBevel_TCL_DECLARED
-#define Tk_3DVerticalBevel_TCL_DECLARED
/* 4 */
EXTERN void Tk_3DVerticalBevel(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border, int x,
int y, int width, int height, int leftBevel,
int relief);
-#endif
-#ifndef Tk_AddOption_TCL_DECLARED
-#define Tk_AddOption_TCL_DECLARED
/* 5 */
-EXTERN void Tk_AddOption(Tk_Window tkwin, CONST char *name,
- CONST char *value, int priority);
-#endif
-#ifndef Tk_BindEvent_TCL_DECLARED
-#define Tk_BindEvent_TCL_DECLARED
+EXTERN void Tk_AddOption(Tk_Window tkwin, const char *name,
+ const char *value, int priority);
/* 6 */
EXTERN void Tk_BindEvent(Tk_BindingTable bindingTable,
XEvent *eventPtr, Tk_Window tkwin,
int numObjects, ClientData *objectPtr);
-#endif
-#ifndef Tk_CanvasDrawableCoords_TCL_DECLARED
-#define Tk_CanvasDrawableCoords_TCL_DECLARED
/* 7 */
EXTERN void Tk_CanvasDrawableCoords(Tk_Canvas canvas, double x,
double y, short *drawableXPtr,
short *drawableYPtr);
-#endif
-#ifndef Tk_CanvasEventuallyRedraw_TCL_DECLARED
-#define Tk_CanvasEventuallyRedraw_TCL_DECLARED
/* 8 */
EXTERN void Tk_CanvasEventuallyRedraw(Tk_Canvas canvas, int x1,
int y1, int x2, int y2);
-#endif
-#ifndef Tk_CanvasGetCoord_TCL_DECLARED
-#define Tk_CanvasGetCoord_TCL_DECLARED
/* 9 */
EXTERN int Tk_CanvasGetCoord(Tcl_Interp *interp,
- Tk_Canvas canvas, CONST char *str,
+ Tk_Canvas canvas, const char *str,
double *doublePtr);
-#endif
-#ifndef Tk_CanvasGetTextInfo_TCL_DECLARED
-#define Tk_CanvasGetTextInfo_TCL_DECLARED
/* 10 */
EXTERN Tk_CanvasTextInfo * Tk_CanvasGetTextInfo(Tk_Canvas canvas);
-#endif
-#ifndef Tk_CanvasPsBitmap_TCL_DECLARED
-#define Tk_CanvasPsBitmap_TCL_DECLARED
/* 11 */
EXTERN int Tk_CanvasPsBitmap(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap, int x,
int y, int width, int height);
-#endif
-#ifndef Tk_CanvasPsColor_TCL_DECLARED
-#define Tk_CanvasPsColor_TCL_DECLARED
/* 12 */
EXTERN int Tk_CanvasPsColor(Tcl_Interp *interp,
Tk_Canvas canvas, XColor *colorPtr);
-#endif
-#ifndef Tk_CanvasPsFont_TCL_DECLARED
-#define Tk_CanvasPsFont_TCL_DECLARED
/* 13 */
EXTERN int Tk_CanvasPsFont(Tcl_Interp *interp, Tk_Canvas canvas,
Tk_Font font);
-#endif
-#ifndef Tk_CanvasPsPath_TCL_DECLARED
-#define Tk_CanvasPsPath_TCL_DECLARED
/* 14 */
EXTERN void Tk_CanvasPsPath(Tcl_Interp *interp, Tk_Canvas canvas,
double *coordPtr, int numPoints);
-#endif
-#ifndef Tk_CanvasPsStipple_TCL_DECLARED
-#define Tk_CanvasPsStipple_TCL_DECLARED
/* 15 */
EXTERN int Tk_CanvasPsStipple(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap);
-#endif
-#ifndef Tk_CanvasPsY_TCL_DECLARED
-#define Tk_CanvasPsY_TCL_DECLARED
/* 16 */
EXTERN double Tk_CanvasPsY(Tk_Canvas canvas, double y);
-#endif
-#ifndef Tk_CanvasSetStippleOrigin_TCL_DECLARED
-#define Tk_CanvasSetStippleOrigin_TCL_DECLARED
/* 17 */
EXTERN void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc);
-#endif
-#ifndef Tk_CanvasTagsParseProc_TCL_DECLARED
-#define Tk_CanvasTagsParseProc_TCL_DECLARED
/* 18 */
EXTERN int Tk_CanvasTagsParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef Tk_CanvasTagsPrintProc_TCL_DECLARED
-#define Tk_CanvasTagsPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 19 */
-EXTERN char * Tk_CanvasTagsPrintProc(ClientData clientData,
+EXTERN CONST86 char * Tk_CanvasTagsPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef Tk_CanvasTkwin_TCL_DECLARED
-#define Tk_CanvasTkwin_TCL_DECLARED
/* 20 */
EXTERN Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas);
-#endif
-#ifndef Tk_CanvasWindowCoords_TCL_DECLARED
-#define Tk_CanvasWindowCoords_TCL_DECLARED
/* 21 */
EXTERN void Tk_CanvasWindowCoords(Tk_Canvas canvas, double x,
double y, short *screenXPtr,
short *screenYPtr);
-#endif
-#ifndef Tk_ChangeWindowAttributes_TCL_DECLARED
-#define Tk_ChangeWindowAttributes_TCL_DECLARED
/* 22 */
EXTERN void Tk_ChangeWindowAttributes(Tk_Window tkwin,
unsigned long valueMask,
XSetWindowAttributes *attsPtr);
-#endif
-#ifndef Tk_CharBbox_TCL_DECLARED
-#define Tk_CharBbox_TCL_DECLARED
/* 23 */
EXTERN int Tk_CharBbox(Tk_TextLayout layout, int index,
int *xPtr, int *yPtr, int *widthPtr,
int *heightPtr);
-#endif
-#ifndef Tk_ClearSelection_TCL_DECLARED
-#define Tk_ClearSelection_TCL_DECLARED
/* 24 */
EXTERN void Tk_ClearSelection(Tk_Window tkwin, Atom selection);
-#endif
-#ifndef Tk_ClipboardAppend_TCL_DECLARED
-#define Tk_ClipboardAppend_TCL_DECLARED
/* 25 */
EXTERN int Tk_ClipboardAppend(Tcl_Interp *interp,
Tk_Window tkwin, Atom target, Atom format,
- char *buffer);
-#endif
-#ifndef Tk_ClipboardClear_TCL_DECLARED
-#define Tk_ClipboardClear_TCL_DECLARED
+ const char *buffer);
/* 26 */
EXTERN int Tk_ClipboardClear(Tcl_Interp *interp,
Tk_Window tkwin);
-#endif
-#ifndef Tk_ConfigureInfo_TCL_DECLARED
-#define Tk_ConfigureInfo_TCL_DECLARED
/* 27 */
EXTERN int Tk_ConfigureInfo(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_ConfigSpec *specs, char *widgRec,
- CONST char *argvName, int flags);
-#endif
-#ifndef Tk_ConfigureValue_TCL_DECLARED
-#define Tk_ConfigureValue_TCL_DECLARED
+ const Tk_ConfigSpec *specs, char *widgRec,
+ const char *argvName, int flags);
/* 28 */
EXTERN int Tk_ConfigureValue(Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specs,
- char *widgRec, CONST char *argvName,
+ Tk_Window tkwin, const Tk_ConfigSpec *specs,
+ char *widgRec, const char *argvName,
int flags);
-#endif
-#ifndef Tk_ConfigureWidget_TCL_DECLARED
-#define Tk_ConfigureWidget_TCL_DECLARED
/* 29 */
EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specs,
+ Tk_Window tkwin, const Tk_ConfigSpec *specs,
int argc, CONST84 char **argv, char *widgRec,
int flags);
-#endif
-#ifndef Tk_ConfigureWindow_TCL_DECLARED
-#define Tk_ConfigureWindow_TCL_DECLARED
/* 30 */
EXTERN void Tk_ConfigureWindow(Tk_Window tkwin,
unsigned int valueMask,
XWindowChanges *valuePtr);
-#endif
-#ifndef Tk_ComputeTextLayout_TCL_DECLARED
-#define Tk_ComputeTextLayout_TCL_DECLARED
/* 31 */
-EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, CONST char *str,
+EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, const char *str,
int numChars, int wrapLength,
Tk_Justify justify, int flags, int *widthPtr,
int *heightPtr);
-#endif
-#ifndef Tk_CoordsToWindow_TCL_DECLARED
-#define Tk_CoordsToWindow_TCL_DECLARED
/* 32 */
EXTERN Tk_Window Tk_CoordsToWindow(int rootX, int rootY,
Tk_Window tkwin);
-#endif
-#ifndef Tk_CreateBinding_TCL_DECLARED
-#define Tk_CreateBinding_TCL_DECLARED
/* 33 */
EXTERN unsigned long Tk_CreateBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable,
- ClientData object, CONST char *eventStr,
- CONST char *command, int append);
-#endif
-#ifndef Tk_CreateBindingTable_TCL_DECLARED
-#define Tk_CreateBindingTable_TCL_DECLARED
+ ClientData object, const char *eventStr,
+ const char *script, int append);
/* 34 */
EXTERN Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp);
-#endif
-#ifndef Tk_CreateErrorHandler_TCL_DECLARED
-#define Tk_CreateErrorHandler_TCL_DECLARED
/* 35 */
EXTERN Tk_ErrorHandler Tk_CreateErrorHandler(Display *display, int errNum,
int request, int minorCode,
Tk_ErrorProc *errorProc,
ClientData clientData);
-#endif
-#ifndef Tk_CreateEventHandler_TCL_DECLARED
-#define Tk_CreateEventHandler_TCL_DECLARED
/* 36 */
EXTERN void Tk_CreateEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData);
-#endif
-#ifndef Tk_CreateGenericHandler_TCL_DECLARED
-#define Tk_CreateGenericHandler_TCL_DECLARED
/* 37 */
EXTERN void Tk_CreateGenericHandler(Tk_GenericProc *proc,
ClientData clientData);
-#endif
-#ifndef Tk_CreateImageType_TCL_DECLARED
-#define Tk_CreateImageType_TCL_DECLARED
/* 38 */
-EXTERN void Tk_CreateImageType(Tk_ImageType *typePtr);
-#endif
-#ifndef Tk_CreateItemType_TCL_DECLARED
-#define Tk_CreateItemType_TCL_DECLARED
+EXTERN void Tk_CreateImageType(const Tk_ImageType *typePtr);
/* 39 */
EXTERN void Tk_CreateItemType(Tk_ItemType *typePtr);
-#endif
-#ifndef Tk_CreatePhotoImageFormat_TCL_DECLARED
-#define Tk_CreatePhotoImageFormat_TCL_DECLARED
/* 40 */
EXTERN void Tk_CreatePhotoImageFormat(
- Tk_PhotoImageFormat *formatPtr);
-#endif
-#ifndef Tk_CreateSelHandler_TCL_DECLARED
-#define Tk_CreateSelHandler_TCL_DECLARED
+ const Tk_PhotoImageFormat *formatPtr);
/* 41 */
EXTERN void Tk_CreateSelHandler(Tk_Window tkwin, Atom selection,
Atom target, Tk_SelectionProc *proc,
ClientData clientData, Atom format);
-#endif
-#ifndef Tk_CreateWindow_TCL_DECLARED
-#define Tk_CreateWindow_TCL_DECLARED
/* 42 */
EXTERN Tk_Window Tk_CreateWindow(Tcl_Interp *interp, Tk_Window parent,
- CONST char *name, CONST char *screenName);
-#endif
-#ifndef Tk_CreateWindowFromPath_TCL_DECLARED
-#define Tk_CreateWindowFromPath_TCL_DECLARED
+ const char *name, const char *screenName);
/* 43 */
EXTERN Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *pathName,
- CONST char *screenName);
-#endif
-#ifndef Tk_DefineBitmap_TCL_DECLARED
-#define Tk_DefineBitmap_TCL_DECLARED
+ Tk_Window tkwin, const char *pathName,
+ const char *screenName);
/* 44 */
-EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, CONST char *name,
- CONST char *source, int width, int height);
-#endif
-#ifndef Tk_DefineCursor_TCL_DECLARED
-#define Tk_DefineCursor_TCL_DECLARED
+EXTERN int Tk_OldDefineBitmap(Tcl_Interp *interp,
+ const char *name, const char *source,
+ int width, int height);
/* 45 */
EXTERN void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor);
-#endif
-#ifndef Tk_DeleteAllBindings_TCL_DECLARED
-#define Tk_DeleteAllBindings_TCL_DECLARED
/* 46 */
EXTERN void Tk_DeleteAllBindings(Tk_BindingTable bindingTable,
ClientData object);
-#endif
-#ifndef Tk_DeleteBinding_TCL_DECLARED
-#define Tk_DeleteBinding_TCL_DECLARED
/* 47 */
EXTERN int Tk_DeleteBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable,
- ClientData object, CONST char *eventStr);
-#endif
-#ifndef Tk_DeleteBindingTable_TCL_DECLARED
-#define Tk_DeleteBindingTable_TCL_DECLARED
+ ClientData object, const char *eventStr);
/* 48 */
EXTERN void Tk_DeleteBindingTable(Tk_BindingTable bindingTable);
-#endif
-#ifndef Tk_DeleteErrorHandler_TCL_DECLARED
-#define Tk_DeleteErrorHandler_TCL_DECLARED
/* 49 */
EXTERN void Tk_DeleteErrorHandler(Tk_ErrorHandler handler);
-#endif
-#ifndef Tk_DeleteEventHandler_TCL_DECLARED
-#define Tk_DeleteEventHandler_TCL_DECLARED
/* 50 */
EXTERN void Tk_DeleteEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData);
-#endif
-#ifndef Tk_DeleteGenericHandler_TCL_DECLARED
-#define Tk_DeleteGenericHandler_TCL_DECLARED
/* 51 */
EXTERN void Tk_DeleteGenericHandler(Tk_GenericProc *proc,
ClientData clientData);
-#endif
-#ifndef Tk_DeleteImage_TCL_DECLARED
-#define Tk_DeleteImage_TCL_DECLARED
/* 52 */
-EXTERN void Tk_DeleteImage(Tcl_Interp *interp, CONST char *name);
-#endif
-#ifndef Tk_DeleteSelHandler_TCL_DECLARED
-#define Tk_DeleteSelHandler_TCL_DECLARED
+EXTERN void Tk_DeleteImage(Tcl_Interp *interp, const char *name);
/* 53 */
EXTERN void Tk_DeleteSelHandler(Tk_Window tkwin, Atom selection,
Atom target);
-#endif
-#ifndef Tk_DestroyWindow_TCL_DECLARED
-#define Tk_DestroyWindow_TCL_DECLARED
/* 54 */
EXTERN void Tk_DestroyWindow(Tk_Window tkwin);
-#endif
-#ifndef Tk_DisplayName_TCL_DECLARED
-#define Tk_DisplayName_TCL_DECLARED
/* 55 */
EXTERN CONST84_RETURN char * Tk_DisplayName(Tk_Window tkwin);
-#endif
-#ifndef Tk_DistanceToTextLayout_TCL_DECLARED
-#define Tk_DistanceToTextLayout_TCL_DECLARED
/* 56 */
EXTERN int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x,
int y);
-#endif
-#ifndef Tk_Draw3DPolygon_TCL_DECLARED
-#define Tk_Draw3DPolygon_TCL_DECLARED
/* 57 */
EXTERN void Tk_Draw3DPolygon(Tk_Window tkwin, Drawable drawable,
Tk_3DBorder border, XPoint *pointPtr,
int numPoints, int borderWidth,
int leftRelief);
-#endif
-#ifndef Tk_Draw3DRectangle_TCL_DECLARED
-#define Tk_Draw3DRectangle_TCL_DECLARED
/* 58 */
EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border, int x,
int y, int width, int height,
int borderWidth, int relief);
-#endif
-#ifndef Tk_DrawChars_TCL_DECLARED
-#define Tk_DrawChars_TCL_DECLARED
/* 59 */
EXTERN void Tk_DrawChars(Display *display, Drawable drawable,
- GC gc, Tk_Font tkfont, CONST char *source,
+ GC gc, Tk_Font tkfont, const char *source,
int numBytes, int x, int y);
-#endif
-#ifndef Tk_DrawFocusHighlight_TCL_DECLARED
-#define Tk_DrawFocusHighlight_TCL_DECLARED
/* 60 */
EXTERN void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc,
int width, Drawable drawable);
-#endif
-#ifndef Tk_DrawTextLayout_TCL_DECLARED
-#define Tk_DrawTextLayout_TCL_DECLARED
/* 61 */
EXTERN void Tk_DrawTextLayout(Display *display,
Drawable drawable, GC gc,
Tk_TextLayout layout, int x, int y,
int firstChar, int lastChar);
-#endif
-#ifndef Tk_Fill3DPolygon_TCL_DECLARED
-#define Tk_Fill3DPolygon_TCL_DECLARED
/* 62 */
EXTERN void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable,
Tk_3DBorder border, XPoint *pointPtr,
int numPoints, int borderWidth,
int leftRelief);
-#endif
-#ifndef Tk_Fill3DRectangle_TCL_DECLARED
-#define Tk_Fill3DRectangle_TCL_DECLARED
/* 63 */
EXTERN void Tk_Fill3DRectangle(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border, int x,
int y, int width, int height,
int borderWidth, int relief);
-#endif
-#ifndef Tk_FindPhoto_TCL_DECLARED
-#define Tk_FindPhoto_TCL_DECLARED
/* 64 */
EXTERN Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp,
- CONST char *imageName);
-#endif
-#ifndef Tk_FontId_TCL_DECLARED
-#define Tk_FontId_TCL_DECLARED
+ const char *imageName);
/* 65 */
EXTERN Font Tk_FontId(Tk_Font font);
-#endif
-#ifndef Tk_Free3DBorder_TCL_DECLARED
-#define Tk_Free3DBorder_TCL_DECLARED
/* 66 */
EXTERN void Tk_Free3DBorder(Tk_3DBorder border);
-#endif
-#ifndef Tk_FreeBitmap_TCL_DECLARED
-#define Tk_FreeBitmap_TCL_DECLARED
/* 67 */
EXTERN void Tk_FreeBitmap(Display *display, Pixmap bitmap);
-#endif
-#ifndef Tk_FreeColor_TCL_DECLARED
-#define Tk_FreeColor_TCL_DECLARED
/* 68 */
EXTERN void Tk_FreeColor(XColor *colorPtr);
-#endif
-#ifndef Tk_FreeColormap_TCL_DECLARED
-#define Tk_FreeColormap_TCL_DECLARED
/* 69 */
EXTERN void Tk_FreeColormap(Display *display, Colormap colormap);
-#endif
-#ifndef Tk_FreeCursor_TCL_DECLARED
-#define Tk_FreeCursor_TCL_DECLARED
/* 70 */
EXTERN void Tk_FreeCursor(Display *display, Tk_Cursor cursor);
-#endif
-#ifndef Tk_FreeFont_TCL_DECLARED
-#define Tk_FreeFont_TCL_DECLARED
/* 71 */
EXTERN void Tk_FreeFont(Tk_Font f);
-#endif
-#ifndef Tk_FreeGC_TCL_DECLARED
-#define Tk_FreeGC_TCL_DECLARED
/* 72 */
EXTERN void Tk_FreeGC(Display *display, GC gc);
-#endif
-#ifndef Tk_FreeImage_TCL_DECLARED
-#define Tk_FreeImage_TCL_DECLARED
/* 73 */
EXTERN void Tk_FreeImage(Tk_Image image);
-#endif
-#ifndef Tk_FreeOptions_TCL_DECLARED
-#define Tk_FreeOptions_TCL_DECLARED
/* 74 */
-EXTERN void Tk_FreeOptions(Tk_ConfigSpec *specs, char *widgRec,
- Display *display, int needFlags);
-#endif
-#ifndef Tk_FreePixmap_TCL_DECLARED
-#define Tk_FreePixmap_TCL_DECLARED
+EXTERN void Tk_FreeOptions(const Tk_ConfigSpec *specs,
+ char *widgRec, Display *display,
+ int needFlags);
/* 75 */
EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap);
-#endif
-#ifndef Tk_FreeTextLayout_TCL_DECLARED
-#define Tk_FreeTextLayout_TCL_DECLARED
/* 76 */
EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout);
-#endif
-#ifndef Tk_FreeXId_TCL_DECLARED
-#define Tk_FreeXId_TCL_DECLARED
/* 77 */
EXTERN void Tk_FreeXId(Display *display, XID xid);
-#endif
-#ifndef Tk_GCForColor_TCL_DECLARED
-#define Tk_GCForColor_TCL_DECLARED
/* 78 */
EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable);
-#endif
-#ifndef Tk_GeometryRequest_TCL_DECLARED
-#define Tk_GeometryRequest_TCL_DECLARED
/* 79 */
EXTERN void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth,
int reqHeight);
-#endif
-#ifndef Tk_Get3DBorder_TCL_DECLARED
-#define Tk_Get3DBorder_TCL_DECLARED
/* 80 */
EXTERN Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid colorName);
-#endif
-#ifndef Tk_GetAllBindings_TCL_DECLARED
-#define Tk_GetAllBindings_TCL_DECLARED
/* 81 */
EXTERN void Tk_GetAllBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable,
ClientData object);
-#endif
-#ifndef Tk_GetAnchor_TCL_DECLARED
-#define Tk_GetAnchor_TCL_DECLARED
/* 82 */
-EXTERN int Tk_GetAnchor(Tcl_Interp *interp, CONST char *str,
+EXTERN int Tk_GetAnchor(Tcl_Interp *interp, const char *str,
Tk_Anchor *anchorPtr);
-#endif
-#ifndef Tk_GetAtomName_TCL_DECLARED
-#define Tk_GetAtomName_TCL_DECLARED
/* 83 */
EXTERN CONST84_RETURN char * Tk_GetAtomName(Tk_Window tkwin, Atom atom);
-#endif
-#ifndef Tk_GetBinding_TCL_DECLARED
-#define Tk_GetBinding_TCL_DECLARED
/* 84 */
EXTERN CONST84_RETURN char * Tk_GetBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable,
- ClientData object, CONST char *eventStr);
-#endif
-#ifndef Tk_GetBitmap_TCL_DECLARED
-#define Tk_GetBitmap_TCL_DECLARED
+ ClientData object, const char *eventStr);
/* 85 */
EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str);
-#endif
-#ifndef Tk_GetBitmapFromData_TCL_DECLARED
-#define Tk_GetBitmapFromData_TCL_DECLARED
+ const char *str);
/* 86 */
-EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *source,
+EXTERN Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp,
+ Tk_Window tkwin, const char *source,
int width, int height);
-#endif
-#ifndef Tk_GetCapStyle_TCL_DECLARED
-#define Tk_GetCapStyle_TCL_DECLARED
/* 87 */
-EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, CONST char *str,
+EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, const char *str,
int *capPtr);
-#endif
-#ifndef Tk_GetColor_TCL_DECLARED
-#define Tk_GetColor_TCL_DECLARED
/* 88 */
EXTERN XColor * Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid name);
-#endif
-#ifndef Tk_GetColorByValue_TCL_DECLARED
-#define Tk_GetColorByValue_TCL_DECLARED
/* 89 */
EXTERN XColor * Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr);
-#endif
-#ifndef Tk_GetColormap_TCL_DECLARED
-#define Tk_GetColormap_TCL_DECLARED
/* 90 */
EXTERN Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str);
-#endif
-#ifndef Tk_GetCursor_TCL_DECLARED
-#define Tk_GetCursor_TCL_DECLARED
+ const char *str);
/* 91 */
EXTERN Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid str);
-#endif
-#ifndef Tk_GetCursorFromData_TCL_DECLARED
-#define Tk_GetCursorFromData_TCL_DECLARED
/* 92 */
EXTERN Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *source,
- CONST char *mask, int width, int height,
+ Tk_Window tkwin, const char *source,
+ const char *mask, int width, int height,
int xHot, int yHot, Tk_Uid fg, Tk_Uid bg);
-#endif
-#ifndef Tk_GetFont_TCL_DECLARED
-#define Tk_GetFont_TCL_DECLARED
/* 93 */
EXTERN Tk_Font Tk_GetFont(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str);
-#endif
-#ifndef Tk_GetFontFromObj_TCL_DECLARED
-#define Tk_GetFontFromObj_TCL_DECLARED
+ const char *str);
/* 94 */
EXTERN Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetFontMetrics_TCL_DECLARED
-#define Tk_GetFontMetrics_TCL_DECLARED
/* 95 */
EXTERN void Tk_GetFontMetrics(Tk_Font font,
Tk_FontMetrics *fmPtr);
-#endif
-#ifndef Tk_GetGC_TCL_DECLARED
-#define Tk_GetGC_TCL_DECLARED
/* 96 */
EXTERN GC Tk_GetGC(Tk_Window tkwin, unsigned long valueMask,
XGCValues *valuePtr);
-#endif
-#ifndef Tk_GetImage_TCL_DECLARED
-#define Tk_GetImage_TCL_DECLARED
/* 97 */
EXTERN Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *name,
+ const char *name,
Tk_ImageChangedProc *changeProc,
ClientData clientData);
-#endif
-#ifndef Tk_GetImageMasterData_TCL_DECLARED
-#define Tk_GetImageMasterData_TCL_DECLARED
/* 98 */
EXTERN ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
- CONST char *name, Tk_ImageType **typePtrPtr);
-#endif
-#ifndef Tk_GetItemTypes_TCL_DECLARED
-#define Tk_GetItemTypes_TCL_DECLARED
+ const char *name,
+ CONST86 Tk_ImageType **typePtrPtr);
/* 99 */
EXTERN Tk_ItemType * Tk_GetItemTypes(void);
-#endif
-#ifndef Tk_GetJoinStyle_TCL_DECLARED
-#define Tk_GetJoinStyle_TCL_DECLARED
/* 100 */
-EXTERN int Tk_GetJoinStyle(Tcl_Interp *interp, CONST char *str,
+EXTERN int Tk_GetJoinStyle(Tcl_Interp *interp, const char *str,
int *joinPtr);
-#endif
-#ifndef Tk_GetJustify_TCL_DECLARED
-#define Tk_GetJustify_TCL_DECLARED
/* 101 */
-EXTERN int Tk_GetJustify(Tcl_Interp *interp, CONST char *str,
+EXTERN int Tk_GetJustify(Tcl_Interp *interp, const char *str,
Tk_Justify *justifyPtr);
-#endif
-#ifndef Tk_GetNumMainWindows_TCL_DECLARED
-#define Tk_GetNumMainWindows_TCL_DECLARED
/* 102 */
EXTERN int Tk_GetNumMainWindows(void);
-#endif
-#ifndef Tk_GetOption_TCL_DECLARED
-#define Tk_GetOption_TCL_DECLARED
/* 103 */
-EXTERN Tk_Uid Tk_GetOption(Tk_Window tkwin, CONST char *name,
- CONST char *className);
-#endif
-#ifndef Tk_GetPixels_TCL_DECLARED
-#define Tk_GetPixels_TCL_DECLARED
+EXTERN Tk_Uid Tk_GetOption(Tk_Window tkwin, const char *name,
+ const char *className);
/* 104 */
EXTERN int Tk_GetPixels(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str, int *intPtr);
-#endif
-#ifndef Tk_GetPixmap_TCL_DECLARED
-#define Tk_GetPixmap_TCL_DECLARED
+ const char *str, int *intPtr);
/* 105 */
EXTERN Pixmap Tk_GetPixmap(Display *display, Drawable d, int width,
int height, int depth);
-#endif
-#ifndef Tk_GetRelief_TCL_DECLARED
-#define Tk_GetRelief_TCL_DECLARED
/* 106 */
-EXTERN int Tk_GetRelief(Tcl_Interp *interp, CONST char *name,
+EXTERN int Tk_GetRelief(Tcl_Interp *interp, const char *name,
int *reliefPtr);
-#endif
-#ifndef Tk_GetRootCoords_TCL_DECLARED
-#define Tk_GetRootCoords_TCL_DECLARED
/* 107 */
EXTERN void Tk_GetRootCoords(Tk_Window tkwin, int *xPtr,
int *yPtr);
-#endif
-#ifndef Tk_GetScrollInfo_TCL_DECLARED
-#define Tk_GetScrollInfo_TCL_DECLARED
/* 108 */
EXTERN int Tk_GetScrollInfo(Tcl_Interp *interp, int argc,
CONST84 char **argv, double *dblPtr,
int *intPtr);
-#endif
-#ifndef Tk_GetScreenMM_TCL_DECLARED
-#define Tk_GetScreenMM_TCL_DECLARED
/* 109 */
EXTERN int Tk_GetScreenMM(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str, double *doublePtr);
-#endif
-#ifndef Tk_GetSelection_TCL_DECLARED
-#define Tk_GetSelection_TCL_DECLARED
+ const char *str, double *doublePtr);
/* 110 */
EXTERN int Tk_GetSelection(Tcl_Interp *interp, Tk_Window tkwin,
Atom selection, Atom target,
Tk_GetSelProc *proc, ClientData clientData);
-#endif
-#ifndef Tk_GetUid_TCL_DECLARED
-#define Tk_GetUid_TCL_DECLARED
/* 111 */
-EXTERN Tk_Uid Tk_GetUid(CONST char *str);
-#endif
-#ifndef Tk_GetVisual_TCL_DECLARED
-#define Tk_GetVisual_TCL_DECLARED
+EXTERN Tk_Uid Tk_GetUid(const char *str);
/* 112 */
EXTERN Visual * Tk_GetVisual(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *str, int *depthPtr,
+ const char *str, int *depthPtr,
Colormap *colormapPtr);
-#endif
-#ifndef Tk_GetVRootGeometry_TCL_DECLARED
-#define Tk_GetVRootGeometry_TCL_DECLARED
/* 113 */
EXTERN void Tk_GetVRootGeometry(Tk_Window tkwin, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr);
-#endif
-#ifndef Tk_Grab_TCL_DECLARED
-#define Tk_Grab_TCL_DECLARED
/* 114 */
EXTERN int Tk_Grab(Tcl_Interp *interp, Tk_Window tkwin,
int grabGlobal);
-#endif
-#ifndef Tk_HandleEvent_TCL_DECLARED
-#define Tk_HandleEvent_TCL_DECLARED
/* 115 */
EXTERN void Tk_HandleEvent(XEvent *eventPtr);
-#endif
-#ifndef Tk_IdToWindow_TCL_DECLARED
-#define Tk_IdToWindow_TCL_DECLARED
/* 116 */
EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window);
-#endif
-#ifndef Tk_ImageChanged_TCL_DECLARED
-#define Tk_ImageChanged_TCL_DECLARED
/* 117 */
EXTERN void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth,
int imageHeight);
-#endif
-#ifndef Tk_Init_TCL_DECLARED
-#define Tk_Init_TCL_DECLARED
/* 118 */
EXTERN int Tk_Init(Tcl_Interp *interp);
-#endif
-#ifndef Tk_InternAtom_TCL_DECLARED
-#define Tk_InternAtom_TCL_DECLARED
/* 119 */
-EXTERN Atom Tk_InternAtom(Tk_Window tkwin, CONST char *name);
-#endif
-#ifndef Tk_IntersectTextLayout_TCL_DECLARED
-#define Tk_IntersectTextLayout_TCL_DECLARED
+EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name);
/* 120 */
EXTERN int Tk_IntersectTextLayout(Tk_TextLayout layout, int x,
int y, int width, int height);
-#endif
-#ifndef Tk_MaintainGeometry_TCL_DECLARED
-#define Tk_MaintainGeometry_TCL_DECLARED
/* 121 */
EXTERN void Tk_MaintainGeometry(Tk_Window slave,
Tk_Window master, int x, int y, int width,
int height);
-#endif
-#ifndef Tk_MainWindow_TCL_DECLARED
-#define Tk_MainWindow_TCL_DECLARED
/* 122 */
EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp);
-#endif
-#ifndef Tk_MakeWindowExist_TCL_DECLARED
-#define Tk_MakeWindowExist_TCL_DECLARED
/* 123 */
EXTERN void Tk_MakeWindowExist(Tk_Window tkwin);
-#endif
-#ifndef Tk_ManageGeometry_TCL_DECLARED
-#define Tk_ManageGeometry_TCL_DECLARED
/* 124 */
EXTERN void Tk_ManageGeometry(Tk_Window tkwin,
- CONST Tk_GeomMgr *mgrPtr,
+ const Tk_GeomMgr *mgrPtr,
ClientData clientData);
-#endif
-#ifndef Tk_MapWindow_TCL_DECLARED
-#define Tk_MapWindow_TCL_DECLARED
/* 125 */
EXTERN void Tk_MapWindow(Tk_Window tkwin);
-#endif
-#ifndef Tk_MeasureChars_TCL_DECLARED
-#define Tk_MeasureChars_TCL_DECLARED
/* 126 */
-EXTERN int Tk_MeasureChars(Tk_Font tkfont, CONST char *source,
+EXTERN int Tk_MeasureChars(Tk_Font tkfont, const char *source,
int numBytes, int maxPixels, int flags,
int *lengthPtr);
-#endif
-#ifndef Tk_MoveResizeWindow_TCL_DECLARED
-#define Tk_MoveResizeWindow_TCL_DECLARED
/* 127 */
EXTERN void Tk_MoveResizeWindow(Tk_Window tkwin, int x, int y,
int width, int height);
-#endif
-#ifndef Tk_MoveWindow_TCL_DECLARED
-#define Tk_MoveWindow_TCL_DECLARED
/* 128 */
EXTERN void Tk_MoveWindow(Tk_Window tkwin, int x, int y);
-#endif
-#ifndef Tk_MoveToplevelWindow_TCL_DECLARED
-#define Tk_MoveToplevelWindow_TCL_DECLARED
/* 129 */
EXTERN void Tk_MoveToplevelWindow(Tk_Window tkwin, int x, int y);
-#endif
-#ifndef Tk_NameOf3DBorder_TCL_DECLARED
-#define Tk_NameOf3DBorder_TCL_DECLARED
/* 130 */
EXTERN CONST84_RETURN char * Tk_NameOf3DBorder(Tk_3DBorder border);
-#endif
-#ifndef Tk_NameOfAnchor_TCL_DECLARED
-#define Tk_NameOfAnchor_TCL_DECLARED
/* 131 */
EXTERN CONST84_RETURN char * Tk_NameOfAnchor(Tk_Anchor anchor);
-#endif
-#ifndef Tk_NameOfBitmap_TCL_DECLARED
-#define Tk_NameOfBitmap_TCL_DECLARED
/* 132 */
EXTERN CONST84_RETURN char * Tk_NameOfBitmap(Display *display, Pixmap bitmap);
-#endif
-#ifndef Tk_NameOfCapStyle_TCL_DECLARED
-#define Tk_NameOfCapStyle_TCL_DECLARED
/* 133 */
EXTERN CONST84_RETURN char * Tk_NameOfCapStyle(int cap);
-#endif
-#ifndef Tk_NameOfColor_TCL_DECLARED
-#define Tk_NameOfColor_TCL_DECLARED
/* 134 */
EXTERN CONST84_RETURN char * Tk_NameOfColor(XColor *colorPtr);
-#endif
-#ifndef Tk_NameOfCursor_TCL_DECLARED
-#define Tk_NameOfCursor_TCL_DECLARED
/* 135 */
EXTERN CONST84_RETURN char * Tk_NameOfCursor(Display *display,
Tk_Cursor cursor);
-#endif
-#ifndef Tk_NameOfFont_TCL_DECLARED
-#define Tk_NameOfFont_TCL_DECLARED
/* 136 */
EXTERN CONST84_RETURN char * Tk_NameOfFont(Tk_Font font);
-#endif
-#ifndef Tk_NameOfImage_TCL_DECLARED
-#define Tk_NameOfImage_TCL_DECLARED
/* 137 */
EXTERN CONST84_RETURN char * Tk_NameOfImage(Tk_ImageMaster imageMaster);
-#endif
-#ifndef Tk_NameOfJoinStyle_TCL_DECLARED
-#define Tk_NameOfJoinStyle_TCL_DECLARED
/* 138 */
EXTERN CONST84_RETURN char * Tk_NameOfJoinStyle(int join);
-#endif
-#ifndef Tk_NameOfJustify_TCL_DECLARED
-#define Tk_NameOfJustify_TCL_DECLARED
/* 139 */
EXTERN CONST84_RETURN char * Tk_NameOfJustify(Tk_Justify justify);
-#endif
-#ifndef Tk_NameOfRelief_TCL_DECLARED
-#define Tk_NameOfRelief_TCL_DECLARED
/* 140 */
EXTERN CONST84_RETURN char * Tk_NameOfRelief(int relief);
-#endif
-#ifndef Tk_NameToWindow_TCL_DECLARED
-#define Tk_NameToWindow_TCL_DECLARED
/* 141 */
EXTERN Tk_Window Tk_NameToWindow(Tcl_Interp *interp,
- CONST char *pathName, Tk_Window tkwin);
-#endif
-#ifndef Tk_OwnSelection_TCL_DECLARED
-#define Tk_OwnSelection_TCL_DECLARED
+ const char *pathName, Tk_Window tkwin);
/* 142 */
EXTERN void Tk_OwnSelection(Tk_Window tkwin, Atom selection,
Tk_LostSelProc *proc, ClientData clientData);
-#endif
-#ifndef Tk_ParseArgv_TCL_DECLARED
-#define Tk_ParseArgv_TCL_DECLARED
/* 143 */
EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin,
int *argcPtr, CONST84 char **argv,
- Tk_ArgvInfo *argTable, int flags);
-#endif
-#ifndef Tk_PhotoPutBlock_NoComposite_TCL_DECLARED
-#define Tk_PhotoPutBlock_NoComposite_TCL_DECLARED
+ const Tk_ArgvInfo *argTable, int flags);
/* 144 */
EXTERN void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height);
-#endif
-#ifndef Tk_PhotoPutZoomedBlock_NoComposite_TCL_DECLARED
-#define Tk_PhotoPutZoomedBlock_NoComposite_TCL_DECLARED
/* 145 */
EXTERN 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);
-#endif
-#ifndef Tk_PhotoGetImage_TCL_DECLARED
-#define Tk_PhotoGetImage_TCL_DECLARED
/* 146 */
EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr);
-#endif
-#ifndef Tk_PhotoBlank_TCL_DECLARED
-#define Tk_PhotoBlank_TCL_DECLARED
/* 147 */
EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle);
-#endif
-#ifndef Tk_PhotoExpand_Panic_TCL_DECLARED
-#define Tk_PhotoExpand_Panic_TCL_DECLARED
/* 148 */
EXTERN void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle,
int width, int height);
-#endif
-#ifndef Tk_PhotoGetSize_TCL_DECLARED
-#define Tk_PhotoGetSize_TCL_DECLARED
/* 149 */
EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr,
int *heightPtr);
-#endif
-#ifndef Tk_PhotoSetSize_Panic_TCL_DECLARED
-#define Tk_PhotoSetSize_Panic_TCL_DECLARED
/* 150 */
EXTERN void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle,
int width, int height);
-#endif
-#ifndef Tk_PointToChar_TCL_DECLARED
-#define Tk_PointToChar_TCL_DECLARED
/* 151 */
EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y);
-#endif
-#ifndef Tk_PostscriptFontName_TCL_DECLARED
-#define Tk_PostscriptFontName_TCL_DECLARED
/* 152 */
EXTERN int Tk_PostscriptFontName(Tk_Font tkfont,
Tcl_DString *dsPtr);
-#endif
-#ifndef Tk_PreserveColormap_TCL_DECLARED
-#define Tk_PreserveColormap_TCL_DECLARED
/* 153 */
EXTERN void Tk_PreserveColormap(Display *display,
Colormap colormap);
-#endif
-#ifndef Tk_QueueWindowEvent_TCL_DECLARED
-#define Tk_QueueWindowEvent_TCL_DECLARED
/* 154 */
EXTERN void Tk_QueueWindowEvent(XEvent *eventPtr,
Tcl_QueuePosition position);
-#endif
-#ifndef Tk_RedrawImage_TCL_DECLARED
-#define Tk_RedrawImage_TCL_DECLARED
/* 155 */
EXTERN void Tk_RedrawImage(Tk_Image image, int imageX,
int imageY, int width, int height,
Drawable drawable, int drawableX,
int drawableY);
-#endif
-#ifndef Tk_ResizeWindow_TCL_DECLARED
-#define Tk_ResizeWindow_TCL_DECLARED
/* 156 */
EXTERN void Tk_ResizeWindow(Tk_Window tkwin, int width,
int height);
-#endif
-#ifndef Tk_RestackWindow_TCL_DECLARED
-#define Tk_RestackWindow_TCL_DECLARED
/* 157 */
EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow,
Tk_Window other);
-#endif
-#ifndef Tk_RestrictEvents_TCL_DECLARED
-#define Tk_RestrictEvents_TCL_DECLARED
/* 158 */
EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc,
ClientData arg, ClientData *prevArgPtr);
-#endif
-#ifndef Tk_SafeInit_TCL_DECLARED
-#define Tk_SafeInit_TCL_DECLARED
/* 159 */
EXTERN int Tk_SafeInit(Tcl_Interp *interp);
-#endif
-#ifndef Tk_SetAppName_TCL_DECLARED
-#define Tk_SetAppName_TCL_DECLARED
/* 160 */
-EXTERN CONST char * Tk_SetAppName(Tk_Window tkwin, CONST char *name);
-#endif
-#ifndef Tk_SetBackgroundFromBorder_TCL_DECLARED
-#define Tk_SetBackgroundFromBorder_TCL_DECLARED
+EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name);
/* 161 */
EXTERN void Tk_SetBackgroundFromBorder(Tk_Window tkwin,
Tk_3DBorder border);
-#endif
-#ifndef Tk_SetClass_TCL_DECLARED
-#define Tk_SetClass_TCL_DECLARED
/* 162 */
-EXTERN void Tk_SetClass(Tk_Window tkwin, CONST char *className);
-#endif
-#ifndef Tk_SetGrid_TCL_DECLARED
-#define Tk_SetGrid_TCL_DECLARED
+EXTERN void Tk_SetClass(Tk_Window tkwin, const char *className);
/* 163 */
EXTERN void Tk_SetGrid(Tk_Window tkwin, int reqWidth,
int reqHeight, int gridWidth, int gridHeight);
-#endif
-#ifndef Tk_SetInternalBorder_TCL_DECLARED
-#define Tk_SetInternalBorder_TCL_DECLARED
/* 164 */
EXTERN void Tk_SetInternalBorder(Tk_Window tkwin, int width);
-#endif
-#ifndef Tk_SetWindowBackground_TCL_DECLARED
-#define Tk_SetWindowBackground_TCL_DECLARED
/* 165 */
EXTERN void Tk_SetWindowBackground(Tk_Window tkwin,
unsigned long pixel);
-#endif
-#ifndef Tk_SetWindowBackgroundPixmap_TCL_DECLARED
-#define Tk_SetWindowBackgroundPixmap_TCL_DECLARED
/* 166 */
EXTERN void Tk_SetWindowBackgroundPixmap(Tk_Window tkwin,
Pixmap pixmap);
-#endif
-#ifndef Tk_SetWindowBorder_TCL_DECLARED
-#define Tk_SetWindowBorder_TCL_DECLARED
/* 167 */
EXTERN void Tk_SetWindowBorder(Tk_Window tkwin,
unsigned long pixel);
-#endif
-#ifndef Tk_SetWindowBorderWidth_TCL_DECLARED
-#define Tk_SetWindowBorderWidth_TCL_DECLARED
/* 168 */
EXTERN void Tk_SetWindowBorderWidth(Tk_Window tkwin, int width);
-#endif
-#ifndef Tk_SetWindowBorderPixmap_TCL_DECLARED
-#define Tk_SetWindowBorderPixmap_TCL_DECLARED
/* 169 */
EXTERN void Tk_SetWindowBorderPixmap(Tk_Window tkwin,
Pixmap pixmap);
-#endif
-#ifndef Tk_SetWindowColormap_TCL_DECLARED
-#define Tk_SetWindowColormap_TCL_DECLARED
/* 170 */
EXTERN void Tk_SetWindowColormap(Tk_Window tkwin,
Colormap colormap);
-#endif
-#ifndef Tk_SetWindowVisual_TCL_DECLARED
-#define Tk_SetWindowVisual_TCL_DECLARED
/* 171 */
EXTERN int Tk_SetWindowVisual(Tk_Window tkwin, Visual *visual,
int depth, Colormap colormap);
-#endif
-#ifndef Tk_SizeOfBitmap_TCL_DECLARED
-#define Tk_SizeOfBitmap_TCL_DECLARED
/* 172 */
EXTERN void Tk_SizeOfBitmap(Display *display, Pixmap bitmap,
int *widthPtr, int *heightPtr);
-#endif
-#ifndef Tk_SizeOfImage_TCL_DECLARED
-#define Tk_SizeOfImage_TCL_DECLARED
/* 173 */
EXTERN void Tk_SizeOfImage(Tk_Image image, int *widthPtr,
int *heightPtr);
-#endif
-#ifndef Tk_StrictMotif_TCL_DECLARED
-#define Tk_StrictMotif_TCL_DECLARED
/* 174 */
EXTERN int Tk_StrictMotif(Tk_Window tkwin);
-#endif
-#ifndef Tk_TextLayoutToPostscript_TCL_DECLARED
-#define Tk_TextLayoutToPostscript_TCL_DECLARED
/* 175 */
EXTERN void Tk_TextLayoutToPostscript(Tcl_Interp *interp,
Tk_TextLayout layout);
-#endif
-#ifndef Tk_TextWidth_TCL_DECLARED
-#define Tk_TextWidth_TCL_DECLARED
/* 176 */
-EXTERN int Tk_TextWidth(Tk_Font font, CONST char *str,
+EXTERN int Tk_TextWidth(Tk_Font font, const char *str,
int numBytes);
-#endif
-#ifndef Tk_UndefineCursor_TCL_DECLARED
-#define Tk_UndefineCursor_TCL_DECLARED
/* 177 */
EXTERN void Tk_UndefineCursor(Tk_Window window);
-#endif
-#ifndef Tk_UnderlineChars_TCL_DECLARED
-#define Tk_UnderlineChars_TCL_DECLARED
/* 178 */
EXTERN void Tk_UnderlineChars(Display *display,
Drawable drawable, GC gc, Tk_Font tkfont,
- CONST char *source, int x, int y,
+ const char *source, int x, int y,
int firstByte, int lastByte);
-#endif
-#ifndef Tk_UnderlineTextLayout_TCL_DECLARED
-#define Tk_UnderlineTextLayout_TCL_DECLARED
/* 179 */
EXTERN void Tk_UnderlineTextLayout(Display *display,
Drawable drawable, GC gc,
Tk_TextLayout layout, int x, int y,
int underline);
-#endif
-#ifndef Tk_Ungrab_TCL_DECLARED
-#define Tk_Ungrab_TCL_DECLARED
/* 180 */
EXTERN void Tk_Ungrab(Tk_Window tkwin);
-#endif
-#ifndef Tk_UnmaintainGeometry_TCL_DECLARED
-#define Tk_UnmaintainGeometry_TCL_DECLARED
/* 181 */
EXTERN void Tk_UnmaintainGeometry(Tk_Window slave,
Tk_Window master);
-#endif
-#ifndef Tk_UnmapWindow_TCL_DECLARED
-#define Tk_UnmapWindow_TCL_DECLARED
/* 182 */
EXTERN void Tk_UnmapWindow(Tk_Window tkwin);
-#endif
-#ifndef Tk_UnsetGrid_TCL_DECLARED
-#define Tk_UnsetGrid_TCL_DECLARED
/* 183 */
EXTERN void Tk_UnsetGrid(Tk_Window tkwin);
-#endif
-#ifndef Tk_UpdatePointer_TCL_DECLARED
-#define Tk_UpdatePointer_TCL_DECLARED
/* 184 */
EXTERN void Tk_UpdatePointer(Tk_Window tkwin, int x, int y,
int state);
-#endif
-#ifndef Tk_AllocBitmapFromObj_TCL_DECLARED
-#define Tk_AllocBitmapFromObj_TCL_DECLARED
/* 185 */
EXTERN Pixmap Tk_AllocBitmapFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_Alloc3DBorderFromObj_TCL_DECLARED
-#define Tk_Alloc3DBorderFromObj_TCL_DECLARED
/* 186 */
EXTERN Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_AllocColorFromObj_TCL_DECLARED
-#define Tk_AllocColorFromObj_TCL_DECLARED
/* 187 */
EXTERN XColor * Tk_AllocColorFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_AllocCursorFromObj_TCL_DECLARED
-#define Tk_AllocCursorFromObj_TCL_DECLARED
/* 188 */
EXTERN Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_AllocFontFromObj_TCL_DECLARED
-#define Tk_AllocFontFromObj_TCL_DECLARED
/* 189 */
EXTERN Tk_Font Tk_AllocFontFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_CreateOptionTable_TCL_DECLARED
-#define Tk_CreateOptionTable_TCL_DECLARED
/* 190 */
EXTERN Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
- CONST Tk_OptionSpec *templatePtr);
-#endif
-#ifndef Tk_DeleteOptionTable_TCL_DECLARED
-#define Tk_DeleteOptionTable_TCL_DECLARED
+ const Tk_OptionSpec *templatePtr);
/* 191 */
EXTERN void Tk_DeleteOptionTable(Tk_OptionTable optionTable);
-#endif
-#ifndef Tk_Free3DBorderFromObj_TCL_DECLARED
-#define Tk_Free3DBorderFromObj_TCL_DECLARED
/* 192 */
EXTERN void Tk_Free3DBorderFromObj(Tk_Window tkwin,
Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_FreeBitmapFromObj_TCL_DECLARED
-#define Tk_FreeBitmapFromObj_TCL_DECLARED
/* 193 */
EXTERN void Tk_FreeBitmapFromObj(Tk_Window tkwin,
Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_FreeColorFromObj_TCL_DECLARED
-#define Tk_FreeColorFromObj_TCL_DECLARED
/* 194 */
EXTERN void Tk_FreeColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_FreeConfigOptions_TCL_DECLARED
-#define Tk_FreeConfigOptions_TCL_DECLARED
/* 195 */
EXTERN void Tk_FreeConfigOptions(char *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin);
-#endif
-#ifndef Tk_FreeSavedOptions_TCL_DECLARED
-#define Tk_FreeSavedOptions_TCL_DECLARED
/* 196 */
EXTERN void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr);
-#endif
-#ifndef Tk_FreeCursorFromObj_TCL_DECLARED
-#define Tk_FreeCursorFromObj_TCL_DECLARED
/* 197 */
EXTERN void Tk_FreeCursorFromObj(Tk_Window tkwin,
Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_FreeFontFromObj_TCL_DECLARED
-#define Tk_FreeFontFromObj_TCL_DECLARED
/* 198 */
EXTERN void Tk_FreeFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_Get3DBorderFromObj_TCL_DECLARED
-#define Tk_Get3DBorderFromObj_TCL_DECLARED
/* 199 */
EXTERN Tk_3DBorder Tk_Get3DBorderFromObj(Tk_Window tkwin,
Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetAnchorFromObj_TCL_DECLARED
-#define Tk_GetAnchorFromObj_TCL_DECLARED
/* 200 */
EXTERN int Tk_GetAnchorFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tk_Anchor *anchorPtr);
-#endif
-#ifndef Tk_GetBitmapFromObj_TCL_DECLARED
-#define Tk_GetBitmapFromObj_TCL_DECLARED
/* 201 */
EXTERN Pixmap Tk_GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetColorFromObj_TCL_DECLARED
-#define Tk_GetColorFromObj_TCL_DECLARED
/* 202 */
EXTERN XColor * Tk_GetColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetCursorFromObj_TCL_DECLARED
-#define Tk_GetCursorFromObj_TCL_DECLARED
/* 203 */
EXTERN Tk_Cursor Tk_GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetOptionInfo_TCL_DECLARED
-#define Tk_GetOptionInfo_TCL_DECLARED
/* 204 */
EXTERN Tcl_Obj * Tk_GetOptionInfo(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, Tcl_Obj *namePtr,
Tk_Window tkwin);
-#endif
-#ifndef Tk_GetOptionValue_TCL_DECLARED
-#define Tk_GetOptionValue_TCL_DECLARED
/* 205 */
EXTERN Tcl_Obj * Tk_GetOptionValue(Tcl_Interp *interp,
char *recordPtr, Tk_OptionTable optionTable,
Tcl_Obj *namePtr, Tk_Window tkwin);
-#endif
-#ifndef Tk_GetJustifyFromObj_TCL_DECLARED
-#define Tk_GetJustifyFromObj_TCL_DECLARED
/* 206 */
EXTERN int Tk_GetJustifyFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tk_Justify *justifyPtr);
-#endif
-#ifndef Tk_GetMMFromObj_TCL_DECLARED
-#define Tk_GetMMFromObj_TCL_DECLARED
/* 207 */
EXTERN int Tk_GetMMFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr, double *doublePtr);
-#endif
-#ifndef Tk_GetPixelsFromObj_TCL_DECLARED
-#define Tk_GetPixelsFromObj_TCL_DECLARED
/* 208 */
EXTERN int Tk_GetPixelsFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr,
int *intPtr);
-#endif
-#ifndef Tk_GetReliefFromObj_TCL_DECLARED
-#define Tk_GetReliefFromObj_TCL_DECLARED
/* 209 */
EXTERN int Tk_GetReliefFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *resultPtr);
-#endif
-#ifndef Tk_GetScrollInfoObj_TCL_DECLARED
-#define Tk_GetScrollInfoObj_TCL_DECLARED
/* 210 */
EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], double *dblPtr,
+ Tcl_Obj *const objv[], double *dblPtr,
int *intPtr);
-#endif
-#ifndef Tk_InitOptions_TCL_DECLARED
-#define Tk_InitOptions_TCL_DECLARED
/* 211 */
EXTERN int Tk_InitOptions(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin);
-#endif
-#ifndef Tk_MainEx_TCL_DECLARED
-#define Tk_MainEx_TCL_DECLARED
/* 212 */
EXTERN void Tk_MainEx(int argc, char **argv,
Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp);
-#endif
-#ifndef Tk_RestoreSavedOptions_TCL_DECLARED
-#define Tk_RestoreSavedOptions_TCL_DECLARED
/* 213 */
EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr);
-#endif
-#ifndef Tk_SetOptions_TCL_DECLARED
-#define Tk_SetOptions_TCL_DECLARED
/* 214 */
EXTERN int Tk_SetOptions(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, int objc,
- Tcl_Obj *CONST objv[], Tk_Window tkwin,
+ Tcl_Obj *const objv[], Tk_Window tkwin,
Tk_SavedOptions *savePtr, int *maskPtr);
-#endif
-#ifndef Tk_InitConsoleChannels_TCL_DECLARED
-#define Tk_InitConsoleChannels_TCL_DECLARED
/* 215 */
EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp);
-#endif
-#ifndef Tk_CreateConsoleWindow_TCL_DECLARED
-#define Tk_CreateConsoleWindow_TCL_DECLARED
/* 216 */
EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
-#endif
-#ifndef Tk_CreateSmoothMethod_TCL_DECLARED
-#define Tk_CreateSmoothMethod_TCL_DECLARED
/* 217 */
EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp,
- Tk_SmoothMethod *method);
-#endif
+ const Tk_SmoothMethod *method);
/* Slot 218 is reserved */
/* Slot 219 is reserved */
-#ifndef Tk_GetDash_TCL_DECLARED
-#define Tk_GetDash_TCL_DECLARED
/* 220 */
-EXTERN int Tk_GetDash(Tcl_Interp *interp, CONST char *value,
+EXTERN int Tk_GetDash(Tcl_Interp *interp, const char *value,
Tk_Dash *dash);
-#endif
-#ifndef Tk_CreateOutline_TCL_DECLARED
-#define Tk_CreateOutline_TCL_DECLARED
/* 221 */
EXTERN void Tk_CreateOutline(Tk_Outline *outline);
-#endif
-#ifndef Tk_DeleteOutline_TCL_DECLARED
-#define Tk_DeleteOutline_TCL_DECLARED
/* 222 */
EXTERN void Tk_DeleteOutline(Display *display,
Tk_Outline *outline);
-#endif
-#ifndef Tk_ConfigOutlineGC_TCL_DECLARED
-#define Tk_ConfigOutlineGC_TCL_DECLARED
/* 223 */
EXTERN int Tk_ConfigOutlineGC(XGCValues *gcValues,
Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline);
-#endif
-#ifndef Tk_ChangeOutlineGC_TCL_DECLARED
-#define Tk_ChangeOutlineGC_TCL_DECLARED
/* 224 */
EXTERN int Tk_ChangeOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline);
-#endif
-#ifndef Tk_ResetOutlineGC_TCL_DECLARED
-#define Tk_ResetOutlineGC_TCL_DECLARED
/* 225 */
EXTERN int Tk_ResetOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline);
-#endif
-#ifndef Tk_CanvasPsOutline_TCL_DECLARED
-#define Tk_CanvasPsOutline_TCL_DECLARED
/* 226 */
EXTERN int Tk_CanvasPsOutline(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline);
-#endif
-#ifndef Tk_SetTSOrigin_TCL_DECLARED
-#define Tk_SetTSOrigin_TCL_DECLARED
/* 227 */
EXTERN void Tk_SetTSOrigin(Tk_Window tkwin, GC gc, int x, int y);
-#endif
-#ifndef Tk_CanvasGetCoordFromObj_TCL_DECLARED
-#define Tk_CanvasGetCoordFromObj_TCL_DECLARED
/* 228 */
EXTERN int Tk_CanvasGetCoordFromObj(Tcl_Interp *interp,
Tk_Canvas canvas, Tcl_Obj *obj,
double *doublePtr);
-#endif
-#ifndef Tk_CanvasSetOffset_TCL_DECLARED
-#define Tk_CanvasSetOffset_TCL_DECLARED
/* 229 */
EXTERN void Tk_CanvasSetOffset(Tk_Canvas canvas, GC gc,
Tk_TSOffset *offset);
-#endif
-#ifndef Tk_DitherPhoto_TCL_DECLARED
-#define Tk_DitherPhoto_TCL_DECLARED
/* 230 */
EXTERN void Tk_DitherPhoto(Tk_PhotoHandle handle, int x, int y,
int width, int height);
-#endif
-#ifndef Tk_PostscriptBitmap_TCL_DECLARED
-#define Tk_PostscriptBitmap_TCL_DECLARED
/* 231 */
EXTERN int Tk_PostscriptBitmap(Tcl_Interp *interp,
Tk_Window tkwin, Tk_PostscriptInfo psInfo,
Pixmap bitmap, int startX, int startY,
int width, int height);
-#endif
-#ifndef Tk_PostscriptColor_TCL_DECLARED
-#define Tk_PostscriptColor_TCL_DECLARED
/* 232 */
EXTERN int Tk_PostscriptColor(Tcl_Interp *interp,
Tk_PostscriptInfo psInfo, XColor *colorPtr);
-#endif
-#ifndef Tk_PostscriptFont_TCL_DECLARED
-#define Tk_PostscriptFont_TCL_DECLARED
/* 233 */
EXTERN int Tk_PostscriptFont(Tcl_Interp *interp,
Tk_PostscriptInfo psInfo, Tk_Font font);
-#endif
-#ifndef Tk_PostscriptImage_TCL_DECLARED
-#define Tk_PostscriptImage_TCL_DECLARED
/* 234 */
EXTERN 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);
-#endif
-#ifndef Tk_PostscriptPath_TCL_DECLARED
-#define Tk_PostscriptPath_TCL_DECLARED
/* 235 */
EXTERN void Tk_PostscriptPath(Tcl_Interp *interp,
Tk_PostscriptInfo psInfo, double *coordPtr,
int numPoints);
-#endif
-#ifndef Tk_PostscriptStipple_TCL_DECLARED
-#define Tk_PostscriptStipple_TCL_DECLARED
/* 236 */
EXTERN int Tk_PostscriptStipple(Tcl_Interp *interp,
Tk_Window tkwin, Tk_PostscriptInfo psInfo,
Pixmap bitmap);
-#endif
-#ifndef Tk_PostscriptY_TCL_DECLARED
-#define Tk_PostscriptY_TCL_DECLARED
/* 237 */
EXTERN double Tk_PostscriptY(double y, Tk_PostscriptInfo psInfo);
-#endif
-#ifndef Tk_PostscriptPhoto_TCL_DECLARED
-#define Tk_PostscriptPhoto_TCL_DECLARED
/* 238 */
EXTERN int Tk_PostscriptPhoto(Tcl_Interp *interp,
Tk_PhotoImageBlock *blockPtr,
Tk_PostscriptInfo psInfo, int width,
int height);
-#endif
-#ifndef Tk_CreateClientMessageHandler_TCL_DECLARED
-#define Tk_CreateClientMessageHandler_TCL_DECLARED
/* 239 */
EXTERN void Tk_CreateClientMessageHandler(
Tk_ClientMessageProc *proc);
-#endif
-#ifndef Tk_DeleteClientMessageHandler_TCL_DECLARED
-#define Tk_DeleteClientMessageHandler_TCL_DECLARED
/* 240 */
EXTERN void Tk_DeleteClientMessageHandler(
Tk_ClientMessageProc *proc);
-#endif
-#ifndef Tk_CreateAnonymousWindow_TCL_DECLARED
-#define Tk_CreateAnonymousWindow_TCL_DECLARED
/* 241 */
EXTERN Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp,
- Tk_Window parent, CONST char *screenName);
-#endif
-#ifndef Tk_SetClassProcs_TCL_DECLARED
-#define Tk_SetClassProcs_TCL_DECLARED
+ Tk_Window parent, const char *screenName);
/* 242 */
EXTERN void Tk_SetClassProcs(Tk_Window tkwin,
- Tk_ClassProcs *procs,
+ const Tk_ClassProcs *procs,
ClientData instanceData);
-#endif
-#ifndef Tk_SetInternalBorderEx_TCL_DECLARED
-#define Tk_SetInternalBorderEx_TCL_DECLARED
/* 243 */
EXTERN void Tk_SetInternalBorderEx(Tk_Window tkwin, int left,
int right, int top, int bottom);
-#endif
-#ifndef Tk_SetMinimumRequestSize_TCL_DECLARED
-#define Tk_SetMinimumRequestSize_TCL_DECLARED
/* 244 */
EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin,
int minWidth, int minHeight);
-#endif
-#ifndef Tk_SetCaretPos_TCL_DECLARED
-#define Tk_SetCaretPos_TCL_DECLARED
/* 245 */
EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y,
int height);
-#endif
-#ifndef Tk_PhotoPutBlock_Panic_TCL_DECLARED
-#define Tk_PhotoPutBlock_Panic_TCL_DECLARED
/* 246 */
EXTERN void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int compRule);
-#endif
-#ifndef Tk_PhotoPutZoomedBlock_Panic_TCL_DECLARED
-#define Tk_PhotoPutZoomedBlock_Panic_TCL_DECLARED
/* 247 */
EXTERN void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int zoomX, int zoomY,
int subsampleX, int subsampleY, int compRule);
-#endif
-#ifndef Tk_CollapseMotionEvents_TCL_DECLARED
-#define Tk_CollapseMotionEvents_TCL_DECLARED
/* 248 */
EXTERN int Tk_CollapseMotionEvents(Display *display,
int collapse);
-#endif
-#ifndef Tk_RegisterStyleEngine_TCL_DECLARED
-#define Tk_RegisterStyleEngine_TCL_DECLARED
/* 249 */
-EXTERN Tk_StyleEngine Tk_RegisterStyleEngine(CONST char *name,
+EXTERN Tk_StyleEngine Tk_RegisterStyleEngine(const char *name,
Tk_StyleEngine parent);
-#endif
-#ifndef Tk_GetStyleEngine_TCL_DECLARED
-#define Tk_GetStyleEngine_TCL_DECLARED
/* 250 */
-EXTERN Tk_StyleEngine Tk_GetStyleEngine(CONST char *name);
-#endif
-#ifndef Tk_RegisterStyledElement_TCL_DECLARED
-#define Tk_RegisterStyledElement_TCL_DECLARED
+EXTERN Tk_StyleEngine Tk_GetStyleEngine(const char *name);
/* 251 */
EXTERN int Tk_RegisterStyledElement(Tk_StyleEngine engine,
Tk_ElementSpec *templatePtr);
-#endif
-#ifndef Tk_GetElementId_TCL_DECLARED
-#define Tk_GetElementId_TCL_DECLARED
/* 252 */
-EXTERN int Tk_GetElementId(CONST char *name);
-#endif
-#ifndef Tk_CreateStyle_TCL_DECLARED
-#define Tk_CreateStyle_TCL_DECLARED
+EXTERN int Tk_GetElementId(const char *name);
/* 253 */
-EXTERN Tk_Style Tk_CreateStyle(CONST char *name,
+EXTERN Tk_Style Tk_CreateStyle(const char *name,
Tk_StyleEngine engine, ClientData clientData);
-#endif
-#ifndef Tk_GetStyle_TCL_DECLARED
-#define Tk_GetStyle_TCL_DECLARED
/* 254 */
-EXTERN Tk_Style Tk_GetStyle(Tcl_Interp *interp, CONST char *name);
-#endif
-#ifndef Tk_FreeStyle_TCL_DECLARED
-#define Tk_FreeStyle_TCL_DECLARED
+EXTERN Tk_Style Tk_GetStyle(Tcl_Interp *interp, const char *name);
/* 255 */
EXTERN void Tk_FreeStyle(Tk_Style style);
-#endif
-#ifndef Tk_NameOfStyle_TCL_DECLARED
-#define Tk_NameOfStyle_TCL_DECLARED
/* 256 */
-EXTERN CONST char * Tk_NameOfStyle(Tk_Style style);
-#endif
-#ifndef Tk_AllocStyleFromObj_TCL_DECLARED
-#define Tk_AllocStyleFromObj_TCL_DECLARED
+EXTERN const char * Tk_NameOfStyle(Tk_Style style);
/* 257 */
EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetStyleFromObj_TCL_DECLARED
-#define Tk_GetStyleFromObj_TCL_DECLARED
/* 258 */
EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_FreeStyleFromObj_TCL_DECLARED
-#define Tk_FreeStyleFromObj_TCL_DECLARED
/* 259 */
EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr);
-#endif
-#ifndef Tk_GetStyledElement_TCL_DECLARED
-#define Tk_GetStyledElement_TCL_DECLARED
/* 260 */
EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style, int elementId,
Tk_OptionTable optionTable);
-#endif
-#ifndef Tk_GetElementSize_TCL_DECLARED
-#define Tk_GetElementSize_TCL_DECLARED
/* 261 */
EXTERN void Tk_GetElementSize(Tk_Style style,
Tk_StyledElement element, char *recordPtr,
Tk_Window tkwin, int width, int height,
int inner, int *widthPtr, int *heightPtr);
-#endif
-#ifndef Tk_GetElementBox_TCL_DECLARED
-#define Tk_GetElementBox_TCL_DECLARED
/* 262 */
EXTERN 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);
-#endif
-#ifndef Tk_GetElementBorderWidth_TCL_DECLARED
-#define Tk_GetElementBorderWidth_TCL_DECLARED
/* 263 */
EXTERN int Tk_GetElementBorderWidth(Tk_Style style,
Tk_StyledElement element, char *recordPtr,
Tk_Window tkwin);
-#endif
-#ifndef Tk_DrawElement_TCL_DECLARED
-#define Tk_DrawElement_TCL_DECLARED
/* 264 */
EXTERN 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);
-#endif
-#ifndef Tk_PhotoExpand_TCL_DECLARED
-#define Tk_PhotoExpand_TCL_DECLARED
/* 265 */
EXTERN int Tk_PhotoExpand(Tcl_Interp *interp,
Tk_PhotoHandle handle, int width, int height);
-#endif
-#ifndef Tk_PhotoPutBlock_TCL_DECLARED
-#define Tk_PhotoPutBlock_TCL_DECLARED
/* 266 */
EXTERN int Tk_PhotoPutBlock(Tcl_Interp *interp,
Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int compRule);
-#endif
-#ifndef Tk_PhotoPutZoomedBlock_TCL_DECLARED
-#define Tk_PhotoPutZoomedBlock_TCL_DECLARED
/* 267 */
EXTERN int Tk_PhotoPutZoomedBlock(Tcl_Interp *interp,
Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int zoomX, int zoomY,
int subsampleX, int subsampleY, int compRule);
-#endif
-#ifndef Tk_PhotoSetSize_TCL_DECLARED
-#define Tk_PhotoSetSize_TCL_DECLARED
/* 268 */
EXTERN int Tk_PhotoSetSize(Tcl_Interp *interp,
Tk_PhotoHandle handle, int width, int height);
-#endif
-#ifndef Tk_GetUserInactiveTime_TCL_DECLARED
-#define Tk_GetUserInactiveTime_TCL_DECLARED
/* 269 */
EXTERN long Tk_GetUserInactiveTime(Display *dpy);
-#endif
-#ifndef Tk_ResetUserInactiveTime_TCL_DECLARED
-#define Tk_ResetUserInactiveTime_TCL_DECLARED
/* 270 */
EXTERN void Tk_ResetUserInactiveTime(Display *dpy);
-#endif
-#ifndef Tk_Interp_TCL_DECLARED
-#define Tk_Interp_TCL_DECLARED
/* 271 */
EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin);
-#endif
-#ifndef Tk_CreateOldImageType_TCL_DECLARED
-#define Tk_CreateOldImageType_TCL_DECLARED
/* 272 */
-EXTERN void Tk_CreateOldImageType(Tk_ImageType *typePtr);
-#endif
-#ifndef Tk_CreateOldPhotoImageFormat_TCL_DECLARED
-#define Tk_CreateOldPhotoImageFormat_TCL_DECLARED
+EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr);
/* 273 */
EXTERN void Tk_CreateOldPhotoImageFormat(
- Tk_PhotoImageFormat *formatPtr);
-#endif
+ const Tk_PhotoImageFormat *formatPtr);
+/* 274 */
+EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name,
+ const void *source, int width, int height);
+/* 275 */
+EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
+ Tk_Window tkwin, const void *source,
+ int width, int height);
typedef struct TkStubHooks {
- struct TkPlatStubs *tkPlatStubs;
- struct TkIntStubs *tkIntStubs;
- struct TkIntPlatStubs *tkIntPlatStubs;
- struct TkIntXlibStubs *tkIntXlibStubs;
+ const struct TkPlatStubs *tkPlatStubs;
+ const struct TkIntStubs *tkIntStubs;
+ const struct TkIntPlatStubs *tkIntPlatStubs;
+ const struct TkIntXlibStubs *tkIntXlibStubs;
} TkStubHooks;
typedef struct TkStubs {
int magic;
- struct TkStubHooks *hooks;
+ const struct TkStubHooks *hooks;
void (*tk_MainLoop) (void); /* 0 */
XColor * (*tk_3DBorderColor) (Tk_3DBorder border); /* 1 */
GC (*tk_3DBorderGC) (Tk_Window tkwin, Tk_3DBorder border, int which); /* 2 */
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); /* 3 */
void (*tk_3DVerticalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief); /* 4 */
- void (*tk_AddOption) (Tk_Window tkwin, CONST char *name, CONST char *value, int priority); /* 5 */
+ void (*tk_AddOption) (Tk_Window tkwin, const char *name, const char *value, int priority); /* 5 */
void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, int numObjects, ClientData *objectPtr); /* 6 */
void (*tk_CanvasDrawableCoords) (Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr); /* 7 */
void (*tk_CanvasEventuallyRedraw) (Tk_Canvas canvas, int x1, int y1, int x2, int y2); /* 8 */
- int (*tk_CanvasGetCoord) (Tcl_Interp *interp, Tk_Canvas canvas, CONST char *str, double *doublePtr); /* 9 */
+ int (*tk_CanvasGetCoord) (Tcl_Interp *interp, Tk_Canvas canvas, const char *str, double *doublePtr); /* 9 */
Tk_CanvasTextInfo * (*tk_CanvasGetTextInfo) (Tk_Canvas canvas); /* 10 */
int (*tk_CanvasPsBitmap) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height); /* 11 */
int (*tk_CanvasPsColor) (Tcl_Interp *interp, Tk_Canvas canvas, XColor *colorPtr); /* 12 */
@@ -1704,53 +898,53 @@ typedef struct TkStubs {
int (*tk_CanvasPsStipple) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); /* 15 */
double (*tk_CanvasPsY) (Tk_Canvas canvas, double y); /* 16 */
void (*tk_CanvasSetStippleOrigin) (Tk_Canvas canvas, GC gc); /* 17 */
- int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 18 */
- char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 19 */
+ int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 18 */
+ CONST86 char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 19 */
Tk_Window (*tk_CanvasTkwin) (Tk_Canvas canvas); /* 20 */
void (*tk_CanvasWindowCoords) (Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr); /* 21 */
void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */
int (*tk_CharBbox) (Tk_TextLayout layout, int index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 23 */
void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */
- int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, char *buffer); /* 25 */
+ int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */
int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */
- int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, char *widgRec, CONST char *argvName, int flags); /* 27 */
- int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, char *widgRec, CONST char *argvName, int flags); /* 28 */
- int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specs, int argc, CONST84 char **argv, char *widgRec, int flags); /* 29 */
+ int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 27 */
+ int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 28 */
+ int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, int argc, CONST84 char **argv, char *widgRec, int flags); /* 29 */
void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */
- Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, CONST char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */
+ Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */
Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */
- unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr, CONST char *command, int append); /* 33 */
+ unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *script, int append); /* 33 */
Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */
Tk_ErrorHandler (*tk_CreateErrorHandler) (Display *display, int errNum, int request, int minorCode, Tk_ErrorProc *errorProc, ClientData clientData); /* 35 */
void (*tk_CreateEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 36 */
void (*tk_CreateGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 37 */
- void (*tk_CreateImageType) (Tk_ImageType *typePtr); /* 38 */
+ void (*tk_CreateImageType) (const Tk_ImageType *typePtr); /* 38 */
void (*tk_CreateItemType) (Tk_ItemType *typePtr); /* 39 */
- void (*tk_CreatePhotoImageFormat) (Tk_PhotoImageFormat *formatPtr); /* 40 */
+ void (*tk_CreatePhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 40 */
void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format); /* 41 */
- Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, CONST char *name, CONST char *screenName); /* 42 */
- Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *pathName, CONST char *screenName); /* 43 */
- int (*tk_DefineBitmap) (Tcl_Interp *interp, CONST char *name, CONST char *source, int width, int height); /* 44 */
+ Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); /* 42 */
+ Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 43 */
+ int (*tk_OldDefineBitmap) (Tcl_Interp *interp, const char *name, const char *source, int width, int height); /* 44 */
void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */
void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */
- int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr); /* 47 */
+ int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 47 */
void (*tk_DeleteBindingTable) (Tk_BindingTable bindingTable); /* 48 */
void (*tk_DeleteErrorHandler) (Tk_ErrorHandler handler); /* 49 */
void (*tk_DeleteEventHandler) (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData); /* 50 */
void (*tk_DeleteGenericHandler) (Tk_GenericProc *proc, ClientData clientData); /* 51 */
- void (*tk_DeleteImage) (Tcl_Interp *interp, CONST char *name); /* 52 */
+ void (*tk_DeleteImage) (Tcl_Interp *interp, const char *name); /* 52 */
void (*tk_DeleteSelHandler) (Tk_Window tkwin, Atom selection, Atom target); /* 53 */
void (*tk_DestroyWindow) (Tk_Window tkwin); /* 54 */
CONST84_RETURN char * (*tk_DisplayName) (Tk_Window tkwin); /* 55 */
int (*tk_DistanceToTextLayout) (Tk_TextLayout layout, int x, int y); /* 56 */
void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 57 */
void (*tk_Draw3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 58 */
- void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char *source, int numBytes, int x, int y); /* 59 */
+ void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, int x, int y); /* 59 */
void (*tk_DrawFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable); /* 60 */
void (*tk_DrawTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar); /* 61 */
void (*tk_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 62 */
void (*tk_Fill3DRectangle) (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) (Tcl_Interp *interp, CONST char *imageName); /* 64 */
+ Tk_PhotoHandle (*tk_FindPhoto) (Tcl_Interp *interp, const char *imageName); /* 64 */
Font (*tk_FontId) (Tk_Font font); /* 65 */
void (*tk_Free3DBorder) (Tk_3DBorder border); /* 66 */
void (*tk_FreeBitmap) (Display *display, Pixmap bitmap); /* 67 */
@@ -1760,7 +954,7 @@ typedef struct TkStubs {
void (*tk_FreeFont) (Tk_Font f); /* 71 */
void (*tk_FreeGC) (Display *display, GC gc); /* 72 */
void (*tk_FreeImage) (Tk_Image image); /* 73 */
- void (*tk_FreeOptions) (Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags); /* 74 */
+ void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, char *widgRec, Display *display, int needFlags); /* 74 */
void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */
void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */
void (*tk_FreeXId) (Display *display, XID xid); /* 77 */
@@ -1768,51 +962,51 @@ typedef struct TkStubs {
void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */
Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid colorName); /* 80 */
void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object); /* 81 */
- int (*tk_GetAnchor) (Tcl_Interp *interp, CONST char *str, Tk_Anchor *anchorPtr); /* 82 */
+ int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */
CONST84_RETURN char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */
- CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventStr); /* 84 */
- Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str); /* 85 */
- Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *source, int width, int height); /* 86 */
- int (*tk_GetCapStyle) (Tcl_Interp *interp, CONST char *str, int *capPtr); /* 87 */
+ CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 84 */
+ Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */
+ Pixmap (*tk_OldGetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, int width, int height); /* 86 */
+ int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */
XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name); /* 88 */
XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */
- Colormap (*tk_GetColormap) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str); /* 90 */
+ Colormap (*tk_GetColormap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 90 */
Tk_Cursor (*tk_GetCursor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid str); /* 91 */
- 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); /* 92 */
- Tk_Font (*tk_GetFont) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str); /* 93 */
+ 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); /* 92 */
+ Tk_Font (*tk_GetFont) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 93 */
Tk_Font (*tk_GetFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 94 */
void (*tk_GetFontMetrics) (Tk_Font font, Tk_FontMetrics *fmPtr); /* 95 */
GC (*tk_GetGC) (Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr); /* 96 */
- Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *name, Tk_ImageChangedProc *changeProc, ClientData clientData); /* 97 */
- ClientData (*tk_GetImageMasterData) (Tcl_Interp *interp, CONST char *name, Tk_ImageType **typePtrPtr); /* 98 */
+ Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, ClientData clientData); /* 97 */
+ ClientData (*tk_GetImageMasterData) (Tcl_Interp *interp, const char *name, CONST86 Tk_ImageType **typePtrPtr); /* 98 */
Tk_ItemType * (*tk_GetItemTypes) (void); /* 99 */
- int (*tk_GetJoinStyle) (Tcl_Interp *interp, CONST char *str, int *joinPtr); /* 100 */
- int (*tk_GetJustify) (Tcl_Interp *interp, CONST char *str, Tk_Justify *justifyPtr); /* 101 */
+ int (*tk_GetJoinStyle) (Tcl_Interp *interp, const char *str, int *joinPtr); /* 100 */
+ int (*tk_GetJustify) (Tcl_Interp *interp, const char *str, Tk_Justify *justifyPtr); /* 101 */
int (*tk_GetNumMainWindows) (void); /* 102 */
- Tk_Uid (*tk_GetOption) (Tk_Window tkwin, CONST char *name, CONST char *className); /* 103 */
- int (*tk_GetPixels) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, int *intPtr); /* 104 */
+ Tk_Uid (*tk_GetOption) (Tk_Window tkwin, const char *name, const char *className); /* 103 */
+ int (*tk_GetPixels) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *intPtr); /* 104 */
Pixmap (*tk_GetPixmap) (Display *display, Drawable d, int width, int height, int depth); /* 105 */
- int (*tk_GetRelief) (Tcl_Interp *interp, CONST char *name, int *reliefPtr); /* 106 */
+ int (*tk_GetRelief) (Tcl_Interp *interp, const char *name, int *reliefPtr); /* 106 */
void (*tk_GetRootCoords) (Tk_Window tkwin, int *xPtr, int *yPtr); /* 107 */
int (*tk_GetScrollInfo) (Tcl_Interp *interp, int argc, CONST84 char **argv, double *dblPtr, int *intPtr); /* 108 */
- int (*tk_GetScreenMM) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, double *doublePtr); /* 109 */
+ int (*tk_GetScreenMM) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, double *doublePtr); /* 109 */
int (*tk_GetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 110 */
- Tk_Uid (*tk_GetUid) (CONST char *str); /* 111 */
- Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */
+ Tk_Uid (*tk_GetUid) (const char *str); /* 111 */
+ Visual * (*tk_GetVisual) (Tcl_Interp *interp, Tk_Window tkwin, const char *str, int *depthPtr, Colormap *colormapPtr); /* 112 */
void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */
int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */
void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */
Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */
void (*tk_ImageChanged) (Tk_ImageMaster master, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */
int (*tk_Init) (Tcl_Interp *interp); /* 118 */
- Atom (*tk_InternAtom) (Tk_Window tkwin, CONST char *name); /* 119 */
+ Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */
int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */
void (*tk_MaintainGeometry) (Tk_Window slave, Tk_Window master, int x, int y, int width, int height); /* 121 */
Tk_Window (*tk_MainWindow) (Tcl_Interp *interp); /* 122 */
void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */
- void (*tk_ManageGeometry) (Tk_Window tkwin, CONST Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */
+ void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */
void (*tk_MapWindow) (Tk_Window tkwin); /* 125 */
- int (*tk_MeasureChars) (Tk_Font tkfont, CONST char *source, int numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */
+ int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, int numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */
void (*tk_MoveResizeWindow) (Tk_Window tkwin, int x, int y, int width, int height); /* 127 */
void (*tk_MoveWindow) (Tk_Window tkwin, int x, int y); /* 128 */
void (*tk_MoveToplevelWindow) (Tk_Window tkwin, int x, int y); /* 129 */
@@ -1827,9 +1021,9 @@ typedef struct TkStubs {
CONST84_RETURN char * (*tk_NameOfJoinStyle) (int join); /* 138 */
CONST84_RETURN char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */
CONST84_RETURN char * (*tk_NameOfRelief) (int relief); /* 140 */
- Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, CONST char *pathName, Tk_Window tkwin); /* 141 */
+ Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */
void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, ClientData clientData); /* 142 */
- int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, CONST84 char **argv, Tk_ArgvInfo *argTable, int flags); /* 143 */
+ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, CONST84 char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */
void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */
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); /* 145 */
int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */
@@ -1846,9 +1040,9 @@ typedef struct TkStubs {
int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */
Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, ClientData arg, ClientData *prevArgPtr); /* 158 */
int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */
- CONST char * (*tk_SetAppName) (Tk_Window tkwin, CONST char *name); /* 160 */
+ const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */
void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */
- void (*tk_SetClass) (Tk_Window tkwin, CONST char *className); /* 162 */
+ void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */
void (*tk_SetGrid) (Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight); /* 163 */
void (*tk_SetInternalBorder) (Tk_Window tkwin, int width); /* 164 */
void (*tk_SetWindowBackground) (Tk_Window tkwin, unsigned long pixel); /* 165 */
@@ -1862,9 +1056,9 @@ typedef struct TkStubs {
void (*tk_SizeOfImage) (Tk_Image image, int *widthPtr, int *heightPtr); /* 173 */
int (*tk_StrictMotif) (Tk_Window tkwin); /* 174 */
void (*tk_TextLayoutToPostscript) (Tcl_Interp *interp, Tk_TextLayout layout); /* 175 */
- int (*tk_TextWidth) (Tk_Font font, CONST char *str, int numBytes); /* 176 */
+ int (*tk_TextWidth) (Tk_Font font, const char *str, int numBytes); /* 176 */
void (*tk_UndefineCursor) (Tk_Window window); /* 177 */
- void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char *source, int x, int y, int firstByte, int lastByte); /* 178 */
+ void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, int firstByte, int lastByte); /* 178 */
void (*tk_UnderlineTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline); /* 179 */
void (*tk_Ungrab) (Tk_Window tkwin); /* 180 */
void (*tk_UnmaintainGeometry) (Tk_Window slave, Tk_Window master); /* 181 */
@@ -1876,7 +1070,7 @@ typedef struct TkStubs {
XColor * (*tk_AllocColorFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 187 */
Tk_Cursor (*tk_AllocCursorFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 188 */
Tk_Font (*tk_AllocFontFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 189 */
- Tk_OptionTable (*tk_CreateOptionTable) (Tcl_Interp *interp, CONST Tk_OptionSpec *templatePtr); /* 190 */
+ Tk_OptionTable (*tk_CreateOptionTable) (Tcl_Interp *interp, const Tk_OptionSpec *templatePtr); /* 190 */
void (*tk_DeleteOptionTable) (Tk_OptionTable optionTable); /* 191 */
void (*tk_Free3DBorderFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 192 */
void (*tk_FreeBitmapFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 193 */
@@ -1896,17 +1090,17 @@ typedef struct TkStubs {
int (*tk_GetMMFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 207 */
int (*tk_GetPixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr); /* 208 */
int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */
- int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr); /* 210 */
+ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */
int (*tk_InitOptions) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */
void (*tk_MainEx) (int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */
void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */
- 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); /* 214 */
+ 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); /* 214 */
void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */
int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */
- void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, Tk_SmoothMethod *method); /* 217 */
- VOID *reserved218;
- VOID *reserved219;
- int (*tk_GetDash) (Tcl_Interp *interp, CONST char *value, Tk_Dash *dash); /* 220 */
+ void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */
+ void (*reserved218)(void);
+ void (*reserved219)(void);
+ int (*tk_GetDash) (Tcl_Interp *interp, const char *value, Tk_Dash *dash); /* 220 */
void (*tk_CreateOutline) (Tk_Outline *outline); /* 221 */
void (*tk_DeleteOutline) (Display *display, Tk_Outline *outline); /* 222 */
int (*tk_ConfigOutlineGC) (XGCValues *gcValues, Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 223 */
@@ -1927,22 +1121,22 @@ typedef struct TkStubs {
int (*tk_PostscriptPhoto) (Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, int width, int height); /* 238 */
void (*tk_CreateClientMessageHandler) (Tk_ClientMessageProc *proc); /* 239 */
void (*tk_DeleteClientMessageHandler) (Tk_ClientMessageProc *proc); /* 240 */
- Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, CONST char *screenName); /* 241 */
- void (*tk_SetClassProcs) (Tk_Window tkwin, Tk_ClassProcs *procs, ClientData instanceData); /* 242 */
+ Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */
+ void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, ClientData instanceData); /* 242 */
void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */
void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */
void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */
void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */
void (*tk_PhotoPutZoomedBlock_Panic) (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) (Display *display, int collapse); /* 248 */
- Tk_StyleEngine (*tk_RegisterStyleEngine) (CONST char *name, Tk_StyleEngine parent); /* 249 */
- Tk_StyleEngine (*tk_GetStyleEngine) (CONST char *name); /* 250 */
+ Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */
+ Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */
int (*tk_RegisterStyledElement) (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr); /* 251 */
- int (*tk_GetElementId) (CONST char *name); /* 252 */
- Tk_Style (*tk_CreateStyle) (CONST char *name, Tk_StyleEngine engine, ClientData clientData); /* 253 */
- Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, CONST char *name); /* 254 */
+ int (*tk_GetElementId) (const char *name); /* 252 */
+ Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, ClientData clientData); /* 253 */
+ Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, const char *name); /* 254 */
void (*tk_FreeStyle) (Tk_Style style); /* 255 */
- CONST char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */
+ const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */
Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */
Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */
void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */
@@ -1958,1121 +1152,594 @@ typedef struct TkStubs {
long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */
void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */
Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */
- void (*tk_CreateOldImageType) (Tk_ImageType *typePtr); /* 272 */
- void (*tk_CreateOldPhotoImageFormat) (Tk_PhotoImageFormat *formatPtr); /* 273 */
+ void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */
+ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */
+ int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 274 */
+ Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 275 */
} TkStubs;
#ifdef __cplusplus
extern "C" {
#endif
-extern TkStubs *tkStubsPtr;
+extern const TkStubs *tkStubsPtr;
#ifdef __cplusplus
}
#endif
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+#if defined(USE_TK_STUBS)
/*
* Inline function declarations:
*/
-#ifndef Tk_MainLoop
#define Tk_MainLoop \
(tkStubsPtr->tk_MainLoop) /* 0 */
-#endif
-#ifndef Tk_3DBorderColor
#define Tk_3DBorderColor \
(tkStubsPtr->tk_3DBorderColor) /* 1 */
-#endif
-#ifndef Tk_3DBorderGC
#define Tk_3DBorderGC \
(tkStubsPtr->tk_3DBorderGC) /* 2 */
-#endif
-#ifndef Tk_3DHorizontalBevel
#define Tk_3DHorizontalBevel \
(tkStubsPtr->tk_3DHorizontalBevel) /* 3 */
-#endif
-#ifndef Tk_3DVerticalBevel
#define Tk_3DVerticalBevel \
(tkStubsPtr->tk_3DVerticalBevel) /* 4 */
-#endif
-#ifndef Tk_AddOption
#define Tk_AddOption \
(tkStubsPtr->tk_AddOption) /* 5 */
-#endif
-#ifndef Tk_BindEvent
#define Tk_BindEvent \
(tkStubsPtr->tk_BindEvent) /* 6 */
-#endif
-#ifndef Tk_CanvasDrawableCoords
#define Tk_CanvasDrawableCoords \
(tkStubsPtr->tk_CanvasDrawableCoords) /* 7 */
-#endif
-#ifndef Tk_CanvasEventuallyRedraw
#define Tk_CanvasEventuallyRedraw \
(tkStubsPtr->tk_CanvasEventuallyRedraw) /* 8 */
-#endif
-#ifndef Tk_CanvasGetCoord
#define Tk_CanvasGetCoord \
(tkStubsPtr->tk_CanvasGetCoord) /* 9 */
-#endif
-#ifndef Tk_CanvasGetTextInfo
#define Tk_CanvasGetTextInfo \
(tkStubsPtr->tk_CanvasGetTextInfo) /* 10 */
-#endif
-#ifndef Tk_CanvasPsBitmap
#define Tk_CanvasPsBitmap \
(tkStubsPtr->tk_CanvasPsBitmap) /* 11 */
-#endif
-#ifndef Tk_CanvasPsColor
#define Tk_CanvasPsColor \
(tkStubsPtr->tk_CanvasPsColor) /* 12 */
-#endif
-#ifndef Tk_CanvasPsFont
#define Tk_CanvasPsFont \
(tkStubsPtr->tk_CanvasPsFont) /* 13 */
-#endif
-#ifndef Tk_CanvasPsPath
#define Tk_CanvasPsPath \
(tkStubsPtr->tk_CanvasPsPath) /* 14 */
-#endif
-#ifndef Tk_CanvasPsStipple
#define Tk_CanvasPsStipple \
(tkStubsPtr->tk_CanvasPsStipple) /* 15 */
-#endif
-#ifndef Tk_CanvasPsY
#define Tk_CanvasPsY \
(tkStubsPtr->tk_CanvasPsY) /* 16 */
-#endif
-#ifndef Tk_CanvasSetStippleOrigin
#define Tk_CanvasSetStippleOrigin \
(tkStubsPtr->tk_CanvasSetStippleOrigin) /* 17 */
-#endif
-#ifndef Tk_CanvasTagsParseProc
#define Tk_CanvasTagsParseProc \
(tkStubsPtr->tk_CanvasTagsParseProc) /* 18 */
-#endif
-#ifndef Tk_CanvasTagsPrintProc
#define Tk_CanvasTagsPrintProc \
(tkStubsPtr->tk_CanvasTagsPrintProc) /* 19 */
-#endif
-#ifndef Tk_CanvasTkwin
#define Tk_CanvasTkwin \
(tkStubsPtr->tk_CanvasTkwin) /* 20 */
-#endif
-#ifndef Tk_CanvasWindowCoords
#define Tk_CanvasWindowCoords \
(tkStubsPtr->tk_CanvasWindowCoords) /* 21 */
-#endif
-#ifndef Tk_ChangeWindowAttributes
#define Tk_ChangeWindowAttributes \
(tkStubsPtr->tk_ChangeWindowAttributes) /* 22 */
-#endif
-#ifndef Tk_CharBbox
#define Tk_CharBbox \
(tkStubsPtr->tk_CharBbox) /* 23 */
-#endif
-#ifndef Tk_ClearSelection
#define Tk_ClearSelection \
(tkStubsPtr->tk_ClearSelection) /* 24 */
-#endif
-#ifndef Tk_ClipboardAppend
#define Tk_ClipboardAppend \
(tkStubsPtr->tk_ClipboardAppend) /* 25 */
-#endif
-#ifndef Tk_ClipboardClear
#define Tk_ClipboardClear \
(tkStubsPtr->tk_ClipboardClear) /* 26 */
-#endif
-#ifndef Tk_ConfigureInfo
#define Tk_ConfigureInfo \
(tkStubsPtr->tk_ConfigureInfo) /* 27 */
-#endif
-#ifndef Tk_ConfigureValue
#define Tk_ConfigureValue \
(tkStubsPtr->tk_ConfigureValue) /* 28 */
-#endif
-#ifndef Tk_ConfigureWidget
#define Tk_ConfigureWidget \
(tkStubsPtr->tk_ConfigureWidget) /* 29 */
-#endif
-#ifndef Tk_ConfigureWindow
#define Tk_ConfigureWindow \
(tkStubsPtr->tk_ConfigureWindow) /* 30 */
-#endif
-#ifndef Tk_ComputeTextLayout
#define Tk_ComputeTextLayout \
(tkStubsPtr->tk_ComputeTextLayout) /* 31 */
-#endif
-#ifndef Tk_CoordsToWindow
#define Tk_CoordsToWindow \
(tkStubsPtr->tk_CoordsToWindow) /* 32 */
-#endif
-#ifndef Tk_CreateBinding
#define Tk_CreateBinding \
(tkStubsPtr->tk_CreateBinding) /* 33 */
-#endif
-#ifndef Tk_CreateBindingTable
#define Tk_CreateBindingTable \
(tkStubsPtr->tk_CreateBindingTable) /* 34 */
-#endif
-#ifndef Tk_CreateErrorHandler
#define Tk_CreateErrorHandler \
(tkStubsPtr->tk_CreateErrorHandler) /* 35 */
-#endif
-#ifndef Tk_CreateEventHandler
#define Tk_CreateEventHandler \
(tkStubsPtr->tk_CreateEventHandler) /* 36 */
-#endif
-#ifndef Tk_CreateGenericHandler
#define Tk_CreateGenericHandler \
(tkStubsPtr->tk_CreateGenericHandler) /* 37 */
-#endif
-#ifndef Tk_CreateImageType
#define Tk_CreateImageType \
(tkStubsPtr->tk_CreateImageType) /* 38 */
-#endif
-#ifndef Tk_CreateItemType
#define Tk_CreateItemType \
(tkStubsPtr->tk_CreateItemType) /* 39 */
-#endif
-#ifndef Tk_CreatePhotoImageFormat
#define Tk_CreatePhotoImageFormat \
(tkStubsPtr->tk_CreatePhotoImageFormat) /* 40 */
-#endif
-#ifndef Tk_CreateSelHandler
#define Tk_CreateSelHandler \
(tkStubsPtr->tk_CreateSelHandler) /* 41 */
-#endif
-#ifndef Tk_CreateWindow
#define Tk_CreateWindow \
(tkStubsPtr->tk_CreateWindow) /* 42 */
-#endif
-#ifndef Tk_CreateWindowFromPath
#define Tk_CreateWindowFromPath \
(tkStubsPtr->tk_CreateWindowFromPath) /* 43 */
-#endif
-#ifndef Tk_DefineBitmap
-#define Tk_DefineBitmap \
- (tkStubsPtr->tk_DefineBitmap) /* 44 */
-#endif
-#ifndef Tk_DefineCursor
+#define Tk_OldDefineBitmap \
+ (tkStubsPtr->tk_OldDefineBitmap) /* 44 */
#define Tk_DefineCursor \
(tkStubsPtr->tk_DefineCursor) /* 45 */
-#endif
-#ifndef Tk_DeleteAllBindings
#define Tk_DeleteAllBindings \
(tkStubsPtr->tk_DeleteAllBindings) /* 46 */
-#endif
-#ifndef Tk_DeleteBinding
#define Tk_DeleteBinding \
(tkStubsPtr->tk_DeleteBinding) /* 47 */
-#endif
-#ifndef Tk_DeleteBindingTable
#define Tk_DeleteBindingTable \
(tkStubsPtr->tk_DeleteBindingTable) /* 48 */
-#endif
-#ifndef Tk_DeleteErrorHandler
#define Tk_DeleteErrorHandler \
(tkStubsPtr->tk_DeleteErrorHandler) /* 49 */
-#endif
-#ifndef Tk_DeleteEventHandler
#define Tk_DeleteEventHandler \
(tkStubsPtr->tk_DeleteEventHandler) /* 50 */
-#endif
-#ifndef Tk_DeleteGenericHandler
#define Tk_DeleteGenericHandler \
(tkStubsPtr->tk_DeleteGenericHandler) /* 51 */
-#endif
-#ifndef Tk_DeleteImage
#define Tk_DeleteImage \
(tkStubsPtr->tk_DeleteImage) /* 52 */
-#endif
-#ifndef Tk_DeleteSelHandler
#define Tk_DeleteSelHandler \
(tkStubsPtr->tk_DeleteSelHandler) /* 53 */
-#endif
-#ifndef Tk_DestroyWindow
#define Tk_DestroyWindow \
(tkStubsPtr->tk_DestroyWindow) /* 54 */
-#endif
-#ifndef Tk_DisplayName
#define Tk_DisplayName \
(tkStubsPtr->tk_DisplayName) /* 55 */
-#endif
-#ifndef Tk_DistanceToTextLayout
#define Tk_DistanceToTextLayout \
(tkStubsPtr->tk_DistanceToTextLayout) /* 56 */
-#endif
-#ifndef Tk_Draw3DPolygon
#define Tk_Draw3DPolygon \
(tkStubsPtr->tk_Draw3DPolygon) /* 57 */
-#endif
-#ifndef Tk_Draw3DRectangle
#define Tk_Draw3DRectangle \
(tkStubsPtr->tk_Draw3DRectangle) /* 58 */
-#endif
-#ifndef Tk_DrawChars
#define Tk_DrawChars \
(tkStubsPtr->tk_DrawChars) /* 59 */
-#endif
-#ifndef Tk_DrawFocusHighlight
#define Tk_DrawFocusHighlight \
(tkStubsPtr->tk_DrawFocusHighlight) /* 60 */
-#endif
-#ifndef Tk_DrawTextLayout
#define Tk_DrawTextLayout \
(tkStubsPtr->tk_DrawTextLayout) /* 61 */
-#endif
-#ifndef Tk_Fill3DPolygon
#define Tk_Fill3DPolygon \
(tkStubsPtr->tk_Fill3DPolygon) /* 62 */
-#endif
-#ifndef Tk_Fill3DRectangle
#define Tk_Fill3DRectangle \
(tkStubsPtr->tk_Fill3DRectangle) /* 63 */
-#endif
-#ifndef Tk_FindPhoto
#define Tk_FindPhoto \
(tkStubsPtr->tk_FindPhoto) /* 64 */
-#endif
-#ifndef Tk_FontId
#define Tk_FontId \
(tkStubsPtr->tk_FontId) /* 65 */
-#endif
-#ifndef Tk_Free3DBorder
#define Tk_Free3DBorder \
(tkStubsPtr->tk_Free3DBorder) /* 66 */
-#endif
-#ifndef Tk_FreeBitmap
#define Tk_FreeBitmap \
(tkStubsPtr->tk_FreeBitmap) /* 67 */
-#endif
-#ifndef Tk_FreeColor
#define Tk_FreeColor \
(tkStubsPtr->tk_FreeColor) /* 68 */
-#endif
-#ifndef Tk_FreeColormap
#define Tk_FreeColormap \
(tkStubsPtr->tk_FreeColormap) /* 69 */
-#endif
-#ifndef Tk_FreeCursor
#define Tk_FreeCursor \
(tkStubsPtr->tk_FreeCursor) /* 70 */
-#endif
-#ifndef Tk_FreeFont
#define Tk_FreeFont \
(tkStubsPtr->tk_FreeFont) /* 71 */
-#endif
-#ifndef Tk_FreeGC
#define Tk_FreeGC \
(tkStubsPtr->tk_FreeGC) /* 72 */
-#endif
-#ifndef Tk_FreeImage
#define Tk_FreeImage \
(tkStubsPtr->tk_FreeImage) /* 73 */
-#endif
-#ifndef Tk_FreeOptions
#define Tk_FreeOptions \
(tkStubsPtr->tk_FreeOptions) /* 74 */
-#endif
-#ifndef Tk_FreePixmap
#define Tk_FreePixmap \
(tkStubsPtr->tk_FreePixmap) /* 75 */
-#endif
-#ifndef Tk_FreeTextLayout
#define Tk_FreeTextLayout \
(tkStubsPtr->tk_FreeTextLayout) /* 76 */
-#endif
-#ifndef Tk_FreeXId
#define Tk_FreeXId \
(tkStubsPtr->tk_FreeXId) /* 77 */
-#endif
-#ifndef Tk_GCForColor
#define Tk_GCForColor \
(tkStubsPtr->tk_GCForColor) /* 78 */
-#endif
-#ifndef Tk_GeometryRequest
#define Tk_GeometryRequest \
(tkStubsPtr->tk_GeometryRequest) /* 79 */
-#endif
-#ifndef Tk_Get3DBorder
#define Tk_Get3DBorder \
(tkStubsPtr->tk_Get3DBorder) /* 80 */
-#endif
-#ifndef Tk_GetAllBindings
#define Tk_GetAllBindings \
(tkStubsPtr->tk_GetAllBindings) /* 81 */
-#endif
-#ifndef Tk_GetAnchor
#define Tk_GetAnchor \
(tkStubsPtr->tk_GetAnchor) /* 82 */
-#endif
-#ifndef Tk_GetAtomName
#define Tk_GetAtomName \
(tkStubsPtr->tk_GetAtomName) /* 83 */
-#endif
-#ifndef Tk_GetBinding
#define Tk_GetBinding \
(tkStubsPtr->tk_GetBinding) /* 84 */
-#endif
-#ifndef Tk_GetBitmap
#define Tk_GetBitmap \
(tkStubsPtr->tk_GetBitmap) /* 85 */
-#endif
-#ifndef Tk_GetBitmapFromData
-#define Tk_GetBitmapFromData \
- (tkStubsPtr->tk_GetBitmapFromData) /* 86 */
-#endif
-#ifndef Tk_GetCapStyle
+#define Tk_OldGetBitmapFromData \
+ (tkStubsPtr->tk_OldGetBitmapFromData) /* 86 */
#define Tk_GetCapStyle \
(tkStubsPtr->tk_GetCapStyle) /* 87 */
-#endif
-#ifndef Tk_GetColor
#define Tk_GetColor \
(tkStubsPtr->tk_GetColor) /* 88 */
-#endif
-#ifndef Tk_GetColorByValue
#define Tk_GetColorByValue \
(tkStubsPtr->tk_GetColorByValue) /* 89 */
-#endif
-#ifndef Tk_GetColormap
#define Tk_GetColormap \
(tkStubsPtr->tk_GetColormap) /* 90 */
-#endif
-#ifndef Tk_GetCursor
#define Tk_GetCursor \
(tkStubsPtr->tk_GetCursor) /* 91 */
-#endif
-#ifndef Tk_GetCursorFromData
#define Tk_GetCursorFromData \
(tkStubsPtr->tk_GetCursorFromData) /* 92 */
-#endif
-#ifndef Tk_GetFont
#define Tk_GetFont \
(tkStubsPtr->tk_GetFont) /* 93 */
-#endif
-#ifndef Tk_GetFontFromObj
#define Tk_GetFontFromObj \
(tkStubsPtr->tk_GetFontFromObj) /* 94 */
-#endif
-#ifndef Tk_GetFontMetrics
#define Tk_GetFontMetrics \
(tkStubsPtr->tk_GetFontMetrics) /* 95 */
-#endif
-#ifndef Tk_GetGC
#define Tk_GetGC \
(tkStubsPtr->tk_GetGC) /* 96 */
-#endif
-#ifndef Tk_GetImage
#define Tk_GetImage \
(tkStubsPtr->tk_GetImage) /* 97 */
-#endif
-#ifndef Tk_GetImageMasterData
#define Tk_GetImageMasterData \
(tkStubsPtr->tk_GetImageMasterData) /* 98 */
-#endif
-#ifndef Tk_GetItemTypes
#define Tk_GetItemTypes \
(tkStubsPtr->tk_GetItemTypes) /* 99 */
-#endif
-#ifndef Tk_GetJoinStyle
#define Tk_GetJoinStyle \
(tkStubsPtr->tk_GetJoinStyle) /* 100 */
-#endif
-#ifndef Tk_GetJustify
#define Tk_GetJustify \
(tkStubsPtr->tk_GetJustify) /* 101 */
-#endif
-#ifndef Tk_GetNumMainWindows
#define Tk_GetNumMainWindows \
(tkStubsPtr->tk_GetNumMainWindows) /* 102 */
-#endif
-#ifndef Tk_GetOption
#define Tk_GetOption \
(tkStubsPtr->tk_GetOption) /* 103 */
-#endif
-#ifndef Tk_GetPixels
#define Tk_GetPixels \
(tkStubsPtr->tk_GetPixels) /* 104 */
-#endif
-#ifndef Tk_GetPixmap
#define Tk_GetPixmap \
(tkStubsPtr->tk_GetPixmap) /* 105 */
-#endif
-#ifndef Tk_GetRelief
#define Tk_GetRelief \
(tkStubsPtr->tk_GetRelief) /* 106 */
-#endif
-#ifndef Tk_GetRootCoords
#define Tk_GetRootCoords \
(tkStubsPtr->tk_GetRootCoords) /* 107 */
-#endif
-#ifndef Tk_GetScrollInfo
#define Tk_GetScrollInfo \
(tkStubsPtr->tk_GetScrollInfo) /* 108 */
-#endif
-#ifndef Tk_GetScreenMM
#define Tk_GetScreenMM \
(tkStubsPtr->tk_GetScreenMM) /* 109 */
-#endif
-#ifndef Tk_GetSelection
#define Tk_GetSelection \
(tkStubsPtr->tk_GetSelection) /* 110 */
-#endif
-#ifndef Tk_GetUid
#define Tk_GetUid \
(tkStubsPtr->tk_GetUid) /* 111 */
-#endif
-#ifndef Tk_GetVisual
#define Tk_GetVisual \
(tkStubsPtr->tk_GetVisual) /* 112 */
-#endif
-#ifndef Tk_GetVRootGeometry
#define Tk_GetVRootGeometry \
(tkStubsPtr->tk_GetVRootGeometry) /* 113 */
-#endif
-#ifndef Tk_Grab
#define Tk_Grab \
(tkStubsPtr->tk_Grab) /* 114 */
-#endif
-#ifndef Tk_HandleEvent
#define Tk_HandleEvent \
(tkStubsPtr->tk_HandleEvent) /* 115 */
-#endif
-#ifndef Tk_IdToWindow
#define Tk_IdToWindow \
(tkStubsPtr->tk_IdToWindow) /* 116 */
-#endif
-#ifndef Tk_ImageChanged
#define Tk_ImageChanged \
(tkStubsPtr->tk_ImageChanged) /* 117 */
-#endif
-#ifndef Tk_Init
#define Tk_Init \
(tkStubsPtr->tk_Init) /* 118 */
-#endif
-#ifndef Tk_InternAtom
#define Tk_InternAtom \
(tkStubsPtr->tk_InternAtom) /* 119 */
-#endif
-#ifndef Tk_IntersectTextLayout
#define Tk_IntersectTextLayout \
(tkStubsPtr->tk_IntersectTextLayout) /* 120 */
-#endif
-#ifndef Tk_MaintainGeometry
#define Tk_MaintainGeometry \
(tkStubsPtr->tk_MaintainGeometry) /* 121 */
-#endif
-#ifndef Tk_MainWindow
#define Tk_MainWindow \
(tkStubsPtr->tk_MainWindow) /* 122 */
-#endif
-#ifndef Tk_MakeWindowExist
#define Tk_MakeWindowExist \
(tkStubsPtr->tk_MakeWindowExist) /* 123 */
-#endif
-#ifndef Tk_ManageGeometry
#define Tk_ManageGeometry \
(tkStubsPtr->tk_ManageGeometry) /* 124 */
-#endif
-#ifndef Tk_MapWindow
#define Tk_MapWindow \
(tkStubsPtr->tk_MapWindow) /* 125 */
-#endif
-#ifndef Tk_MeasureChars
#define Tk_MeasureChars \
(tkStubsPtr->tk_MeasureChars) /* 126 */
-#endif
-#ifndef Tk_MoveResizeWindow
#define Tk_MoveResizeWindow \
(tkStubsPtr->tk_MoveResizeWindow) /* 127 */
-#endif
-#ifndef Tk_MoveWindow
#define Tk_MoveWindow \
(tkStubsPtr->tk_MoveWindow) /* 128 */
-#endif
-#ifndef Tk_MoveToplevelWindow
#define Tk_MoveToplevelWindow \
(tkStubsPtr->tk_MoveToplevelWindow) /* 129 */
-#endif
-#ifndef Tk_NameOf3DBorder
#define Tk_NameOf3DBorder \
(tkStubsPtr->tk_NameOf3DBorder) /* 130 */
-#endif
-#ifndef Tk_NameOfAnchor
#define Tk_NameOfAnchor \
(tkStubsPtr->tk_NameOfAnchor) /* 131 */
-#endif
-#ifndef Tk_NameOfBitmap
#define Tk_NameOfBitmap \
(tkStubsPtr->tk_NameOfBitmap) /* 132 */
-#endif
-#ifndef Tk_NameOfCapStyle
#define Tk_NameOfCapStyle \
(tkStubsPtr->tk_NameOfCapStyle) /* 133 */
-#endif
-#ifndef Tk_NameOfColor
#define Tk_NameOfColor \
(tkStubsPtr->tk_NameOfColor) /* 134 */
-#endif
-#ifndef Tk_NameOfCursor
#define Tk_NameOfCursor \
(tkStubsPtr->tk_NameOfCursor) /* 135 */
-#endif
-#ifndef Tk_NameOfFont
#define Tk_NameOfFont \
(tkStubsPtr->tk_NameOfFont) /* 136 */
-#endif
-#ifndef Tk_NameOfImage
#define Tk_NameOfImage \
(tkStubsPtr->tk_NameOfImage) /* 137 */
-#endif
-#ifndef Tk_NameOfJoinStyle
#define Tk_NameOfJoinStyle \
(tkStubsPtr->tk_NameOfJoinStyle) /* 138 */
-#endif
-#ifndef Tk_NameOfJustify
#define Tk_NameOfJustify \
(tkStubsPtr->tk_NameOfJustify) /* 139 */
-#endif
-#ifndef Tk_NameOfRelief
#define Tk_NameOfRelief \
(tkStubsPtr->tk_NameOfRelief) /* 140 */
-#endif
-#ifndef Tk_NameToWindow
#define Tk_NameToWindow \
(tkStubsPtr->tk_NameToWindow) /* 141 */
-#endif
-#ifndef Tk_OwnSelection
#define Tk_OwnSelection \
(tkStubsPtr->tk_OwnSelection) /* 142 */
-#endif
-#ifndef Tk_ParseArgv
#define Tk_ParseArgv \
(tkStubsPtr->tk_ParseArgv) /* 143 */
-#endif
-#ifndef Tk_PhotoPutBlock_NoComposite
#define Tk_PhotoPutBlock_NoComposite \
(tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */
-#endif
-#ifndef Tk_PhotoPutZoomedBlock_NoComposite
#define Tk_PhotoPutZoomedBlock_NoComposite \
(tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */
-#endif
-#ifndef Tk_PhotoGetImage
#define Tk_PhotoGetImage \
(tkStubsPtr->tk_PhotoGetImage) /* 146 */
-#endif
-#ifndef Tk_PhotoBlank
#define Tk_PhotoBlank \
(tkStubsPtr->tk_PhotoBlank) /* 147 */
-#endif
-#ifndef Tk_PhotoExpand_Panic
#define Tk_PhotoExpand_Panic \
(tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */
-#endif
-#ifndef Tk_PhotoGetSize
#define Tk_PhotoGetSize \
(tkStubsPtr->tk_PhotoGetSize) /* 149 */
-#endif
-#ifndef Tk_PhotoSetSize_Panic
#define Tk_PhotoSetSize_Panic \
(tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */
-#endif
-#ifndef Tk_PointToChar
#define Tk_PointToChar \
(tkStubsPtr->tk_PointToChar) /* 151 */
-#endif
-#ifndef Tk_PostscriptFontName
#define Tk_PostscriptFontName \
(tkStubsPtr->tk_PostscriptFontName) /* 152 */
-#endif
-#ifndef Tk_PreserveColormap
#define Tk_PreserveColormap \
(tkStubsPtr->tk_PreserveColormap) /* 153 */
-#endif
-#ifndef Tk_QueueWindowEvent
#define Tk_QueueWindowEvent \
(tkStubsPtr->tk_QueueWindowEvent) /* 154 */
-#endif
-#ifndef Tk_RedrawImage
#define Tk_RedrawImage \
(tkStubsPtr->tk_RedrawImage) /* 155 */
-#endif
-#ifndef Tk_ResizeWindow
#define Tk_ResizeWindow \
(tkStubsPtr->tk_ResizeWindow) /* 156 */
-#endif
-#ifndef Tk_RestackWindow
#define Tk_RestackWindow \
(tkStubsPtr->tk_RestackWindow) /* 157 */
-#endif
-#ifndef Tk_RestrictEvents
#define Tk_RestrictEvents \
(tkStubsPtr->tk_RestrictEvents) /* 158 */
-#endif
-#ifndef Tk_SafeInit
#define Tk_SafeInit \
(tkStubsPtr->tk_SafeInit) /* 159 */
-#endif
-#ifndef Tk_SetAppName
#define Tk_SetAppName \
(tkStubsPtr->tk_SetAppName) /* 160 */
-#endif
-#ifndef Tk_SetBackgroundFromBorder
#define Tk_SetBackgroundFromBorder \
(tkStubsPtr->tk_SetBackgroundFromBorder) /* 161 */
-#endif
-#ifndef Tk_SetClass
#define Tk_SetClass \
(tkStubsPtr->tk_SetClass) /* 162 */
-#endif
-#ifndef Tk_SetGrid
#define Tk_SetGrid \
(tkStubsPtr->tk_SetGrid) /* 163 */
-#endif
-#ifndef Tk_SetInternalBorder
#define Tk_SetInternalBorder \
(tkStubsPtr->tk_SetInternalBorder) /* 164 */
-#endif
-#ifndef Tk_SetWindowBackground
#define Tk_SetWindowBackground \
(tkStubsPtr->tk_SetWindowBackground) /* 165 */
-#endif
-#ifndef Tk_SetWindowBackgroundPixmap
#define Tk_SetWindowBackgroundPixmap \
(tkStubsPtr->tk_SetWindowBackgroundPixmap) /* 166 */
-#endif
-#ifndef Tk_SetWindowBorder
#define Tk_SetWindowBorder \
(tkStubsPtr->tk_SetWindowBorder) /* 167 */
-#endif
-#ifndef Tk_SetWindowBorderWidth
#define Tk_SetWindowBorderWidth \
(tkStubsPtr->tk_SetWindowBorderWidth) /* 168 */
-#endif
-#ifndef Tk_SetWindowBorderPixmap
#define Tk_SetWindowBorderPixmap \
(tkStubsPtr->tk_SetWindowBorderPixmap) /* 169 */
-#endif
-#ifndef Tk_SetWindowColormap
#define Tk_SetWindowColormap \
(tkStubsPtr->tk_SetWindowColormap) /* 170 */
-#endif
-#ifndef Tk_SetWindowVisual
#define Tk_SetWindowVisual \
(tkStubsPtr->tk_SetWindowVisual) /* 171 */
-#endif
-#ifndef Tk_SizeOfBitmap
#define Tk_SizeOfBitmap \
(tkStubsPtr->tk_SizeOfBitmap) /* 172 */
-#endif
-#ifndef Tk_SizeOfImage
#define Tk_SizeOfImage \
(tkStubsPtr->tk_SizeOfImage) /* 173 */
-#endif
-#ifndef Tk_StrictMotif
#define Tk_StrictMotif \
(tkStubsPtr->tk_StrictMotif) /* 174 */
-#endif
-#ifndef Tk_TextLayoutToPostscript
#define Tk_TextLayoutToPostscript \
(tkStubsPtr->tk_TextLayoutToPostscript) /* 175 */
-#endif
-#ifndef Tk_TextWidth
#define Tk_TextWidth \
(tkStubsPtr->tk_TextWidth) /* 176 */
-#endif
-#ifndef Tk_UndefineCursor
#define Tk_UndefineCursor \
(tkStubsPtr->tk_UndefineCursor) /* 177 */
-#endif
-#ifndef Tk_UnderlineChars
#define Tk_UnderlineChars \
(tkStubsPtr->tk_UnderlineChars) /* 178 */
-#endif
-#ifndef Tk_UnderlineTextLayout
#define Tk_UnderlineTextLayout \
(tkStubsPtr->tk_UnderlineTextLayout) /* 179 */
-#endif
-#ifndef Tk_Ungrab
#define Tk_Ungrab \
(tkStubsPtr->tk_Ungrab) /* 180 */
-#endif
-#ifndef Tk_UnmaintainGeometry
#define Tk_UnmaintainGeometry \
(tkStubsPtr->tk_UnmaintainGeometry) /* 181 */
-#endif
-#ifndef Tk_UnmapWindow
#define Tk_UnmapWindow \
(tkStubsPtr->tk_UnmapWindow) /* 182 */
-#endif
-#ifndef Tk_UnsetGrid
#define Tk_UnsetGrid \
(tkStubsPtr->tk_UnsetGrid) /* 183 */
-#endif
-#ifndef Tk_UpdatePointer
#define Tk_UpdatePointer \
(tkStubsPtr->tk_UpdatePointer) /* 184 */
-#endif
-#ifndef Tk_AllocBitmapFromObj
#define Tk_AllocBitmapFromObj \
(tkStubsPtr->tk_AllocBitmapFromObj) /* 185 */
-#endif
-#ifndef Tk_Alloc3DBorderFromObj
#define Tk_Alloc3DBorderFromObj \
(tkStubsPtr->tk_Alloc3DBorderFromObj) /* 186 */
-#endif
-#ifndef Tk_AllocColorFromObj
#define Tk_AllocColorFromObj \
(tkStubsPtr->tk_AllocColorFromObj) /* 187 */
-#endif
-#ifndef Tk_AllocCursorFromObj
#define Tk_AllocCursorFromObj \
(tkStubsPtr->tk_AllocCursorFromObj) /* 188 */
-#endif
-#ifndef Tk_AllocFontFromObj
#define Tk_AllocFontFromObj \
(tkStubsPtr->tk_AllocFontFromObj) /* 189 */
-#endif
-#ifndef Tk_CreateOptionTable
#define Tk_CreateOptionTable \
(tkStubsPtr->tk_CreateOptionTable) /* 190 */
-#endif
-#ifndef Tk_DeleteOptionTable
#define Tk_DeleteOptionTable \
(tkStubsPtr->tk_DeleteOptionTable) /* 191 */
-#endif
-#ifndef Tk_Free3DBorderFromObj
#define Tk_Free3DBorderFromObj \
(tkStubsPtr->tk_Free3DBorderFromObj) /* 192 */
-#endif
-#ifndef Tk_FreeBitmapFromObj
#define Tk_FreeBitmapFromObj \
(tkStubsPtr->tk_FreeBitmapFromObj) /* 193 */
-#endif
-#ifndef Tk_FreeColorFromObj
#define Tk_FreeColorFromObj \
(tkStubsPtr->tk_FreeColorFromObj) /* 194 */
-#endif
-#ifndef Tk_FreeConfigOptions
#define Tk_FreeConfigOptions \
(tkStubsPtr->tk_FreeConfigOptions) /* 195 */
-#endif
-#ifndef Tk_FreeSavedOptions
#define Tk_FreeSavedOptions \
(tkStubsPtr->tk_FreeSavedOptions) /* 196 */
-#endif
-#ifndef Tk_FreeCursorFromObj
#define Tk_FreeCursorFromObj \
(tkStubsPtr->tk_FreeCursorFromObj) /* 197 */
-#endif
-#ifndef Tk_FreeFontFromObj
#define Tk_FreeFontFromObj \
(tkStubsPtr->tk_FreeFontFromObj) /* 198 */
-#endif
-#ifndef Tk_Get3DBorderFromObj
#define Tk_Get3DBorderFromObj \
(tkStubsPtr->tk_Get3DBorderFromObj) /* 199 */
-#endif
-#ifndef Tk_GetAnchorFromObj
#define Tk_GetAnchorFromObj \
(tkStubsPtr->tk_GetAnchorFromObj) /* 200 */
-#endif
-#ifndef Tk_GetBitmapFromObj
#define Tk_GetBitmapFromObj \
(tkStubsPtr->tk_GetBitmapFromObj) /* 201 */
-#endif
-#ifndef Tk_GetColorFromObj
#define Tk_GetColorFromObj \
(tkStubsPtr->tk_GetColorFromObj) /* 202 */
-#endif
-#ifndef Tk_GetCursorFromObj
#define Tk_GetCursorFromObj \
(tkStubsPtr->tk_GetCursorFromObj) /* 203 */
-#endif
-#ifndef Tk_GetOptionInfo
#define Tk_GetOptionInfo \
(tkStubsPtr->tk_GetOptionInfo) /* 204 */
-#endif
-#ifndef Tk_GetOptionValue
#define Tk_GetOptionValue \
(tkStubsPtr->tk_GetOptionValue) /* 205 */
-#endif
-#ifndef Tk_GetJustifyFromObj
#define Tk_GetJustifyFromObj \
(tkStubsPtr->tk_GetJustifyFromObj) /* 206 */
-#endif
-#ifndef Tk_GetMMFromObj
#define Tk_GetMMFromObj \
(tkStubsPtr->tk_GetMMFromObj) /* 207 */
-#endif
-#ifndef Tk_GetPixelsFromObj
#define Tk_GetPixelsFromObj \
(tkStubsPtr->tk_GetPixelsFromObj) /* 208 */
-#endif
-#ifndef Tk_GetReliefFromObj
#define Tk_GetReliefFromObj \
(tkStubsPtr->tk_GetReliefFromObj) /* 209 */
-#endif
-#ifndef Tk_GetScrollInfoObj
#define Tk_GetScrollInfoObj \
(tkStubsPtr->tk_GetScrollInfoObj) /* 210 */
-#endif
-#ifndef Tk_InitOptions
#define Tk_InitOptions \
(tkStubsPtr->tk_InitOptions) /* 211 */
-#endif
-#ifndef Tk_MainEx
#define Tk_MainEx \
(tkStubsPtr->tk_MainEx) /* 212 */
-#endif
-#ifndef Tk_RestoreSavedOptions
#define Tk_RestoreSavedOptions \
(tkStubsPtr->tk_RestoreSavedOptions) /* 213 */
-#endif
-#ifndef Tk_SetOptions
#define Tk_SetOptions \
(tkStubsPtr->tk_SetOptions) /* 214 */
-#endif
-#ifndef Tk_InitConsoleChannels
#define Tk_InitConsoleChannels \
(tkStubsPtr->tk_InitConsoleChannels) /* 215 */
-#endif
-#ifndef Tk_CreateConsoleWindow
#define Tk_CreateConsoleWindow \
(tkStubsPtr->tk_CreateConsoleWindow) /* 216 */
-#endif
-#ifndef Tk_CreateSmoothMethod
#define Tk_CreateSmoothMethod \
(tkStubsPtr->tk_CreateSmoothMethod) /* 217 */
-#endif
/* Slot 218 is reserved */
/* Slot 219 is reserved */
-#ifndef Tk_GetDash
#define Tk_GetDash \
(tkStubsPtr->tk_GetDash) /* 220 */
-#endif
-#ifndef Tk_CreateOutline
#define Tk_CreateOutline \
(tkStubsPtr->tk_CreateOutline) /* 221 */
-#endif
-#ifndef Tk_DeleteOutline
#define Tk_DeleteOutline \
(tkStubsPtr->tk_DeleteOutline) /* 222 */
-#endif
-#ifndef Tk_ConfigOutlineGC
#define Tk_ConfigOutlineGC \
(tkStubsPtr->tk_ConfigOutlineGC) /* 223 */
-#endif
-#ifndef Tk_ChangeOutlineGC
#define Tk_ChangeOutlineGC \
(tkStubsPtr->tk_ChangeOutlineGC) /* 224 */
-#endif
-#ifndef Tk_ResetOutlineGC
#define Tk_ResetOutlineGC \
(tkStubsPtr->tk_ResetOutlineGC) /* 225 */
-#endif
-#ifndef Tk_CanvasPsOutline
#define Tk_CanvasPsOutline \
(tkStubsPtr->tk_CanvasPsOutline) /* 226 */
-#endif
-#ifndef Tk_SetTSOrigin
#define Tk_SetTSOrigin \
(tkStubsPtr->tk_SetTSOrigin) /* 227 */
-#endif
-#ifndef Tk_CanvasGetCoordFromObj
#define Tk_CanvasGetCoordFromObj \
(tkStubsPtr->tk_CanvasGetCoordFromObj) /* 228 */
-#endif
-#ifndef Tk_CanvasSetOffset
#define Tk_CanvasSetOffset \
(tkStubsPtr->tk_CanvasSetOffset) /* 229 */
-#endif
-#ifndef Tk_DitherPhoto
#define Tk_DitherPhoto \
(tkStubsPtr->tk_DitherPhoto) /* 230 */
-#endif
-#ifndef Tk_PostscriptBitmap
#define Tk_PostscriptBitmap \
(tkStubsPtr->tk_PostscriptBitmap) /* 231 */
-#endif
-#ifndef Tk_PostscriptColor
#define Tk_PostscriptColor \
(tkStubsPtr->tk_PostscriptColor) /* 232 */
-#endif
-#ifndef Tk_PostscriptFont
#define Tk_PostscriptFont \
(tkStubsPtr->tk_PostscriptFont) /* 233 */
-#endif
-#ifndef Tk_PostscriptImage
#define Tk_PostscriptImage \
(tkStubsPtr->tk_PostscriptImage) /* 234 */
-#endif
-#ifndef Tk_PostscriptPath
#define Tk_PostscriptPath \
(tkStubsPtr->tk_PostscriptPath) /* 235 */
-#endif
-#ifndef Tk_PostscriptStipple
#define Tk_PostscriptStipple \
(tkStubsPtr->tk_PostscriptStipple) /* 236 */
-#endif
-#ifndef Tk_PostscriptY
#define Tk_PostscriptY \
(tkStubsPtr->tk_PostscriptY) /* 237 */
-#endif
-#ifndef Tk_PostscriptPhoto
#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_Panic
#define Tk_PhotoPutBlock_Panic \
(tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */
-#endif
-#ifndef Tk_PhotoPutZoomedBlock_Panic
#define Tk_PhotoPutZoomedBlock_Panic \
(tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 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
-#ifndef Tk_PhotoExpand
#define Tk_PhotoExpand \
(tkStubsPtr->tk_PhotoExpand) /* 265 */
-#endif
-#ifndef Tk_PhotoPutBlock
#define Tk_PhotoPutBlock \
(tkStubsPtr->tk_PhotoPutBlock) /* 266 */
-#endif
-#ifndef Tk_PhotoPutZoomedBlock
#define Tk_PhotoPutZoomedBlock \
(tkStubsPtr->tk_PhotoPutZoomedBlock) /* 267 */
-#endif
-#ifndef Tk_PhotoSetSize
#define Tk_PhotoSetSize \
(tkStubsPtr->tk_PhotoSetSize) /* 268 */
-#endif
-#ifndef Tk_GetUserInactiveTime
#define Tk_GetUserInactiveTime \
(tkStubsPtr->tk_GetUserInactiveTime) /* 269 */
-#endif
-#ifndef Tk_ResetUserInactiveTime
#define Tk_ResetUserInactiveTime \
(tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */
-#endif
-#ifndef Tk_Interp
#define Tk_Interp \
(tkStubsPtr->tk_Interp) /* 271 */
-#endif
-#ifndef Tk_CreateOldImageType
#define Tk_CreateOldImageType \
(tkStubsPtr->tk_CreateOldImageType) /* 272 */
-#endif
-#ifndef Tk_CreateOldPhotoImageFormat
#define Tk_CreateOldPhotoImageFormat \
(tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */
-#endif
+#define Tk_DefineBitmap \
+ (tkStubsPtr->tk_DefineBitmap) /* 274 */
+#define Tk_GetBitmapFromData \
+ (tkStubsPtr->tk_GetBitmapFromData) /* 275 */
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
+#endif /* defined(USE_TK_STUBS) */
/* !END!: Do not edit above this line. */
+/* Functions that don't belong in the stub table */
+#undef Tk_MainEx
+#undef Tk_Init
+#undef Tk_SafeInit
+#undef Tk_CreateConsoleWindow
+
+#if defined(_WIN32) && defined(UNICODE)
+# define Tk_MainEx Tk_MainExW
+ EXTERN void Tk_MainExW(int argc, wchar_t **argv,
+ Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
+#endif
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKDECLS */
-
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 8f181cd..f32a03b 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -35,7 +35,7 @@
#define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL)
-static char *stateStrings[] = {
+static const char *const stateStrings[] = {
"disabled", "normal", "readonly", NULL
};
@@ -43,7 +43,7 @@ static char *stateStrings[] = {
* Definitions for -validate option values:
*/
-static char *validateStrings[] = {
+static const char *const validateStrings[] = {
"all", "key", "focus", "focusin", "focusout", "none", NULL
};
enum validateType {
@@ -317,7 +317,7 @@ static const Tk_OptionSpec sbOptSpec[] = {
* dispatch the entry widget command.
*/
-static CONST char *entryCmdNames[] = {
+static const char *const entryCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "index",
"insert", "scan", "selection", "validate", "xview", NULL
};
@@ -328,7 +328,7 @@ enum entryCmd {
COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW
};
-static CONST char *selCmdNames[] = {
+static const char *const selCmdNames[] = {
"adjust", "clear", "from", "present", "range", "to", NULL
};
@@ -343,7 +343,7 @@ enum selCmd {
* dispatch the spinbox widget command.
*/
-static CONST char *sbCmdNames[] = {
+static const char *const sbCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "identify",
"index", "insert", "invoke", "scan", "selection", "set",
"validate", "xview", NULL
@@ -356,7 +356,7 @@ enum sbCmd {
SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW
};
-static CONST char *sbSelCmdNames[] = {
+static const char *const sbSelCmdNames[] = {
"adjust", "clear", "element", "from", "present", "range", "to", NULL
};
@@ -374,7 +374,7 @@ enum sbselCmd {
* modify them, you must modify the strings here.
*/
-static CONST char *selElementNames[] = {
+static const char *const selElementNames[] = {
"none", "buttondown", "buttonup", NULL, "entry"
};
@@ -390,7 +390,7 @@ static CONST char *selElementNames[] = {
*/
static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr,
- int objc, Tcl_Obj *CONST objv[], int flags);
+ int objc, Tcl_Obj *const objv[], int flags);
static void DeleteChars(Entry *entryPtr, int index, int count);
static void DestroyEntry(char *memPtr);
static void DisplayEntry(ClientData clientData);
@@ -405,29 +405,29 @@ static int EntryFetchSelection(ClientData clientData, int offset,
static void EntryLostSelection(ClientData clientData);
static void EventuallyRedraw(Entry *entryPtr);
static void EntryScanTo(Entry *entryPtr, int y);
-static void EntrySetValue(Entry *entryPtr, CONST char *value);
+static void EntrySetValue(Entry *entryPtr, const char *value);
static void EntrySelectTo(Entry *entryPtr, int index);
static char * EntryTextVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static void EntryUpdateScrollbar(Entry *entryPtr);
static int EntryValidate(Entry *entryPtr, char *cmd);
-static int EntryValidateChange(Entry *entryPtr, char *change,
- CONST char *newStr, int index, int type);
-static void ExpandPercents(Entry *entryPtr, CONST char *before,
- CONST char *change, CONST char *newStr, int index,
+static int EntryValidateChange(Entry *entryPtr, const char *change,
+ const char *newStr, int index, int type);
+static void ExpandPercents(Entry *entryPtr, const char *before,
+ const char *change, const char *newStr, int index,
int type, Tcl_DString *dsPtr);
static void EntryValueChanged(Entry *entryPtr,
- CONST char *newValue);
+ const char *newValue);
static void EntryVisibleRange(Entry *entryPtr,
double *firstPtr, double *lastPtr);
static int EntryWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void EntryWorldChanged(ClientData instanceData);
static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr,
- char *string, int *indexPtr);
-static void InsertChars(Entry *entryPtr, int index, char *string);
+ const char *string, int *indexPtr);
+static void InsertChars(Entry *entryPtr, int index, const char *string);
/*
* These forward declarations are the spinbox specific ones:
@@ -435,7 +435,7 @@ static void InsertChars(Entry *entryPtr, int index, char *string);
static int SpinboxWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int GetSpinboxElement(Spinbox *sbPtr, int x, int y);
static int SpinboxInvoke(Tcl_Interp *interp, Spinbox *sbPtr,
int element);
@@ -446,11 +446,12 @@ static int ComputeFormat(Spinbox *sbPtr);
* that can be invoked from generic window code.
*/
-static Tk_ClassProcs entryClass = {
+static const Tk_ClassProcs entryClass = {
sizeof(Tk_ClassProcs), /* size */
EntryWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
-
/*
*--------------------------------------------------------------
@@ -474,7 +475,7 @@ Tk_EntryObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Entry *entryPtr;
Tk_OptionTable optionTable;
@@ -482,7 +483,7 @@ Tk_EntryObjCmd(
char *tmp;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -506,18 +507,18 @@ Tk_EntryObjCmd(
* initialized as memset covers the rest.
*/
- entryPtr = (Entry *) ckalloc(sizeof(Entry));
+ entryPtr = ckalloc(sizeof(Entry));
memset(entryPtr, 0, sizeof(Entry));
entryPtr->tkwin = tkwin;
entryPtr->display = Tk_Display(tkwin);
entryPtr->interp = interp;
entryPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(entryPtr->tkwin), EntryWidgetObjCmd,
- (ClientData) entryPtr, EntryCmdDeletedProc);
+ Tk_PathName(entryPtr->tkwin), EntryWidgetObjCmd, entryPtr,
+ EntryCmdDeletedProc);
entryPtr->optionTable = optionTable;
entryPtr->type = TK_ENTRY;
- tmp = (char *) ckalloc(1);
+ tmp = ckalloc(1);
tmp[0] = '\0';
entryPtr->string = tmp;
entryPtr->selectFirst = -1;
@@ -541,15 +542,15 @@ Tk_EntryObjCmd(
* otherwise Tk might free it while we still need it.
*/
- Tcl_Preserve((ClientData) entryPtr->tkwin);
+ Tcl_Preserve(entryPtr->tkwin);
Tk_SetClass(entryPtr->tkwin, "Entry");
- Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
+ Tk_SetClassProcs(entryPtr->tkwin, &entryClass, entryPtr);
Tk_CreateEventHandler(entryPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- EntryEventProc, (ClientData) entryPtr);
+ EntryEventProc, entryPtr);
Tk_CreateSelHandler(entryPtr->tkwin, XA_PRIMARY, XA_STRING,
- EntryFetchSelection, (ClientData) entryPtr, XA_STRING);
+ EntryFetchSelection, entryPtr, XA_STRING);
if ((Tk_InitOptions(interp, (char *) entryPtr, optionTable, tkwin)
!= TCL_OK) ||
@@ -558,7 +559,7 @@ Tk_EntryObjCmd(
return TCL_ERROR;
}
- Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(entryPtr->tkwin));
return TCL_OK;
}
@@ -585,14 +586,14 @@ EntryWidgetObjCmd(
ClientData clientData, /* Information about entry widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
int cmdIndex, selIndex, result;
Tcl_Obj *objPtr;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -601,17 +602,16 @@ EntryWidgetObjCmd(
* valid command names.
*/
- result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames,
- "option", 0, &cmdIndex);
+ result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames, "option", 0,
+ &cmdIndex);
if (result != TCL_OK) {
return result;
}
- Tcl_Preserve((ClientData) entryPtr);
+ Tcl_Preserve(entryPtr);
switch ((enum entryCmd) cmdIndex) {
case COMMAND_BBOX: {
int index, x, y, width, height;
- char buf[TCL_INTEGER_SPACE * 4];
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "index");
@@ -625,9 +625,8 @@ EntryWidgetObjCmd(
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d %d",
+ x + entryPtr->layoutX, y + entryPtr->layoutY, width, height));
break;
}
@@ -641,9 +640,8 @@ EntryWidgetObjCmd(
entryPtr->optionTable, objv[2], entryPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case COMMAND_CONFIGURE:
@@ -654,9 +652,8 @@ EntryWidgetObjCmd(
entryPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
}
@@ -690,7 +687,7 @@ EntryWidgetObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, NULL);
goto error;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(entryPtr->string, -1));
break;
case COMMAND_ICURSOR:
@@ -739,7 +736,7 @@ EntryWidgetObjCmd(
case COMMAND_SCAN: {
int x;
- char *minorCmd;
+ const char *minorCmd;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
@@ -880,7 +877,7 @@ EntryWidgetObjCmd(
if (!(entryPtr->flags & GOT_SELECTION)
&& (entryPtr->exportSelection)) {
Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
- EntryLostSelection, (ClientData) entryPtr);
+ EntryLostSelection, entryPtr);
entryPtr->flags |= GOT_SELECTION;
}
EventuallyRedraw(entryPtr);
@@ -980,11 +977,11 @@ EntryWidgetObjCmd(
}
done:
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
return result;
error:
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
return TCL_ERROR;
}
@@ -1017,11 +1014,11 @@ DestroyEntry(
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar(entryPtr->interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- EntryTextVarProc, (ClientData) entryPtr);
+ EntryTextVarProc, entryPtr);
entryPtr->flags &= ~ENTRY_VAR_TRACED;
}
if (entryPtr->textGC != None) {
@@ -1032,7 +1029,7 @@ DestroyEntry(
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
- ckfree((char *)entryPtr->displayString);
+ ckfree(entryPtr->displayString);
}
if (entryPtr->type == TK_SPINBOX) {
Spinbox *sbPtr = (Spinbox *) entryPtr;
@@ -1048,10 +1045,10 @@ DestroyEntry(
Tk_FreeTextLayout(entryPtr->textLayout);
Tk_FreeConfigOptions((char *) entryPtr, entryPtr->optionTable,
entryPtr->tkwin);
- Tcl_Release((ClientData) entryPtr->tkwin);
+ Tcl_Release(entryPtr->tkwin);
entryPtr->tkwin = NULL;
- ckfree((char *) entryPtr);
+ ckfree(entryPtr);
}
/*
@@ -1080,7 +1077,7 @@ ConfigureEntry(
Entry *entryPtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
+ Tcl_Obj *const objv[], /* Argument objects. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
@@ -1105,7 +1102,7 @@ ConfigureEntry(
&& (entryPtr->flags & ENTRY_VAR_TRACED)) {
Tcl_UntraceVar(interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- EntryTextVarProc, (ClientData) entryPtr);
+ EntryTextVarProc, entryPtr);
entryPtr->flags &= ~ENTRY_VAR_TRACED;
}
@@ -1114,12 +1111,12 @@ ConfigureEntry(
* value.
*/
- oldExport = entryPtr->exportSelection;
+ oldExport = entryPtr->exportSelection;
if (entryPtr->type == TK_SPINBOX) {
- oldValues = sbPtr->valueStr;
- oldFormat = sbPtr->reqFormat;
- oldFrom = sbPtr->fromValue;
- oldTo = sbPtr->toValue;
+ oldValues = sbPtr->valueStr;
+ oldFormat = sbPtr->reqFormat;
+ oldFrom = sbPtr->fromValue;
+ oldTo = sbPtr->toValue;
}
for (error = 0; error <= 1; error++) {
@@ -1266,7 +1263,7 @@ ConfigureEntry(
&& (entryPtr->selectFirst != -1)
&& !(entryPtr->flags & GOT_SELECTION)) {
Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection,
- (ClientData) entryPtr);
+ entryPtr);
entryPtr->flags |= GOT_SELECTION;
}
@@ -1294,7 +1291,7 @@ ConfigureEntry(
*/
if (entryPtr->textVarName != NULL) {
- CONST char *value;
+ const char *value;
value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
@@ -1333,12 +1330,10 @@ ConfigureEntry(
if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) {
/* Scan failure */
dvalue = sbPtr->fromValue;
- } else {
- if (dvalue > sbPtr->toValue) {
- dvalue = sbPtr->toValue;
- } else if (dvalue < sbPtr->fromValue) {
- 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);
@@ -1354,11 +1349,11 @@ ConfigureEntry(
&& !(entryPtr->flags & ENTRY_VAR_TRACED)) {
Tcl_TraceVar(interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- EntryTextVarProc, (ClientData) entryPtr);
+ EntryTextVarProc, entryPtr);
entryPtr->flags |= ENTRY_VAR_TRACED;
}
- EntryWorldChanged((ClientData) entryPtr);
+ EntryWorldChanged(entryPtr);
if (error) {
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
@@ -1395,7 +1390,7 @@ EntryWorldChanged(
unsigned long mask;
Tk_3DBorder border;
XColor *colorPtr;
- Entry *entryPtr = (Entry *) instanceData;
+ Entry *entryPtr = instanceData;
entryPtr->avgWidth = Tk_TextWidth(entryPtr->tkfont, "0", 1);
if (entryPtr->avgWidth == 0) {
@@ -1419,8 +1414,8 @@ EntryWorldChanged(
* the background may be overridden.
*/
- border = entryPtr->normalBorder;
- colorPtr = entryPtr->fgColorPtr;
+ border = entryPtr->normalBorder;
+ colorPtr = entryPtr->fgColorPtr;
switch (entryPtr->state) {
case STATE_DISABLED:
if (entryPtr->disabledBorder != NULL) {
@@ -1547,7 +1542,7 @@ static void
DisplayEntry(
ClientData clientData) /* Information about window. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
Tk_Window tkwin = entryPtr->tkwin;
int baseY, selStartX, selEndX, cursorX;
int showSelection, xBound;
@@ -1574,14 +1569,14 @@ DisplayEntry(
* side-effect of destroying or unmapping the entry widget.
*/
- Tcl_Preserve((ClientData) entryPtr);
+ Tcl_Preserve(entryPtr);
EntryUpdateScrollbar(entryPtr);
if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(tkwin)) {
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
return;
}
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
}
#ifndef TK_NO_DOUBLE_BUFFERING
@@ -1652,7 +1647,7 @@ DisplayEntry(
baseY - fm.ascent - entryPtr->selBorderWidth,
(selEndX - selStartX) + 2*entryPtr->selBorderWidth,
(fm.ascent + fm.descent) + 2*entryPtr->selBorderWidth,
- entryPtr->selBorderWidth,
+ entryPtr->selBorderWidth,
#ifndef MAC_OSX_TK
TK_RELIEF_RAISED
#else
@@ -1876,7 +1871,7 @@ EntryComputeGeometry(
char *p;
if (entryPtr->displayString != entryPtr->string) {
- ckfree((char *)entryPtr->displayString);
+ ckfree(entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
@@ -1902,7 +1897,7 @@ EntryComputeGeometry(
size = Tcl_UniCharToUtf(ch, buf);
entryPtr->numDisplayBytes = entryPtr->numChars * size;
- p = (char *) ckalloc((unsigned) (entryPtr->numDisplayBytes + 1));
+ p = ckalloc(entryPtr->numDisplayBytes + 1);
entryPtr->displayString = p;
for (i = entryPtr->numChars; --i >= 0; ) {
@@ -1966,12 +1961,10 @@ EntryComputeGeometry(
height = fm.linespace + 2*entryPtr->inset + 2*(YPAD-XPAD);
if (entryPtr->prefWidth > 0) {
width = entryPtr->prefWidth*entryPtr->avgWidth + 2*entryPtr->inset;
+ } else if (totalLength == 0) {
+ width = entryPtr->avgWidth + 2*entryPtr->inset;
} else {
- if (totalLength == 0) {
- width = entryPtr->avgWidth + 2*entryPtr->inset;
- } else {
- width = totalLength + 2*entryPtr->inset;
- }
+ width = totalLength + 2*entryPtr->inset;
}
/*
@@ -2004,13 +1997,13 @@ InsertChars(
Entry *entryPtr, /* Entry that is to get the new elements. */
int index, /* Add the new elements before this character
* index. */
- char *value) /* New characters to add (NULL-terminated
+ const char *value) /* New characters to add (NULL-terminated
* string). */
{
ptrdiff_t byteIndex;
size_t byteCount, newByteCount;
int oldChars, charsAdded;
- CONST char *string;
+ const char *string;
char *newStr;
string = entryPtr->string;
@@ -2021,7 +2014,7 @@ InsertChars(
}
newByteCount = entryPtr->numBytes + byteCount + 1;
- newStr = (char *) ckalloc((unsigned) newByteCount);
+ newStr = ckalloc(newByteCount);
memcpy(newStr, string, byteIndex);
strcpy(newStr + byteIndex, value);
strcpy(newStr + byteIndex + byteCount, string + byteIndex);
@@ -2034,7 +2027,7 @@ InsertChars(
return;
}
- ckfree((char *)string);
+ ckfree(string);
entryPtr->string = newStr;
/*
@@ -2106,7 +2099,7 @@ DeleteChars(
int count) /* How many characters to delete. */
{
int byteIndex, byteCount, newByteCount;
- CONST char *string;
+ const char *string;
char *newStr, *toDelete;
if ((index + count) > entryPtr->numChars) {
@@ -2121,11 +2114,11 @@ DeleteChars(
byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string+byteIndex);
newByteCount = entryPtr->numBytes + 1 - byteCount;
- newStr = (char *) ckalloc((unsigned) newByteCount);
+ newStr = ckalloc(newByteCount);
memcpy(newStr, string, (size_t) byteIndex);
strcpy(newStr + byteIndex, string + byteIndex + byteCount);
- toDelete = (char *) ckalloc((unsigned) (byteCount + 1));
+ toDelete = ckalloc(byteCount + 1);
memcpy(toDelete, string + byteIndex, (size_t) byteCount);
toDelete[byteCount] = '\0';
@@ -2139,7 +2132,7 @@ DeleteChars(
}
ckfree(toDelete);
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
@@ -2218,7 +2211,7 @@ DeleteChars(
static void
EntryValueChanged(
Entry *entryPtr, /* Entry whose value just changed. */
- CONST char *newValue) /* If this value is not NULL, we first force
+ const char *newValue) /* If this value is not NULL, we first force
* the value of the entry to this. */
{
if (newValue != NULL) {
@@ -2278,9 +2271,9 @@ EntryValueChanged(
static void
EntrySetValue(
Entry *entryPtr, /* Entry whose value is to be changed. */
- CONST char *value) /* New text to display in entry. */
+ const char *value) /* New text to display in entry. */
{
- CONST char *oldSource;
+ const char *oldSource;
int valueLen, malloced = 0;
if (strcmp(value, entryPtr->string) == 0) {
@@ -2297,7 +2290,7 @@ EntrySetValue(
* during validation
*/
- char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+ char *tmp = ckalloc(valueLen + 1);
strcpy(tmp, value);
value = tmp;
@@ -2315,18 +2308,18 @@ EntrySetValue(
if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
- ckfree((char *)value);
+ ckfree(value);
return;
}
}
oldSource = entryPtr->string;
- ckfree((char *)entryPtr->string);
+ ckfree(entryPtr->string);
if (malloced) {
entryPtr->string = value;
} else {
- char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+ char *tmp = ckalloc(valueLen + 1);
strcpy(tmp, value);
entryPtr->string = tmp;
@@ -2386,10 +2379,10 @@ EntryEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
if ((entryPtr->type == TK_SPINBOX) && (eventPtr->type == MotionNotify)) {
- Spinbox *sbPtr = (Spinbox *) clientData;
+ Spinbox *sbPtr = clientData;
int elem;
elem = GetSpinboxElement(sbPtr, eventPtr->xmotion.x,
@@ -2430,11 +2423,11 @@ EntryEventProc(
}
break;
case ConfigureNotify:
- Tcl_Preserve((ClientData) entryPtr);
+ Tcl_Preserve(entryPtr);
entryPtr->flags |= UPDATE_SCROLLBAR;
EntryComputeGeometry(entryPtr);
EventuallyRedraw(entryPtr);
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
break;
case FocusIn:
case FocusOut:
@@ -2467,7 +2460,7 @@ static void
EntryCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
/*
* This function could be invoked either because the window was destroyed
@@ -2506,45 +2499,35 @@ GetEntryIndex(
Tcl_Interp *interp, /* For error messages. */
Entry *entryPtr, /* Entry for which the index is being
* specified. */
- char *string, /* Specifies character in entryPtr. */
+ const char *string, /* Specifies character in entryPtr. */
int *indexPtr) /* Where to store converted character index */
{
size_t length;
length = strlen(string);
- if (string[0] == 'a') {
- if (strncmp(string, "anchor", length) == 0) {
- *indexPtr = entryPtr->selectAnchor;
- } else {
- badIndex:
-
- /*
- * Some of the paths here leave messages in the interp's result,
- * so we have to clear it out before storing our own message.
- */
-
- Tcl_SetResult(interp, NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad ",
- (entryPtr->type == TK_ENTRY) ? "entry" : "spinbox",
- " index \"", string, "\"", NULL);
- return TCL_ERROR;
+ switch (string[0]) {
+ case 'a':
+ if (strncmp(string, "anchor", length) != 0) {
+ goto badIndex;
}
- } else if (string[0] == 'e') {
- if (strncmp(string, "end", length) == 0) {
- *indexPtr = entryPtr->numChars;
- } else {
+ *indexPtr = entryPtr->selectAnchor;
+ break;
+ case 'e':
+ if (strncmp(string, "end", length) != 0) {
goto badIndex;
}
- } else if (string[0] == 'i') {
- if (strncmp(string, "insert", length) == 0) {
- *indexPtr = entryPtr->insertPos;
- } else {
+ *indexPtr = entryPtr->numChars;
+ break;
+ case 'i':
+ if (strncmp(string, "insert", length) != 0) {
goto badIndex;
}
- } else if (string[0] == 's') {
+ *indexPtr = entryPtr->insertPos;
+ break;
+ case 's':
if (entryPtr->selectFirst < 0) {
- Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "selection isn't in widget ",
Tk_PathName(entryPtr->tkwin), NULL);
return TCL_ERROR;
@@ -2559,7 +2542,8 @@ GetEntryIndex(
} else {
goto badIndex;
}
- } else if (string[0] == '@') {
+ break;
+ case '@': {
int x, roundUp, maxWidth;
if (Tcl_GetInt(interp, string + 1, &x) != TCL_OK) {
@@ -2570,7 +2554,7 @@ GetEntryIndex(
}
roundUp = 0;
maxWidth = Tk_Width(entryPtr->tkwin) - entryPtr->inset
- - entryPtr->xWidth - 1;
+ - entryPtr->xWidth - 1;
if (x > maxWidth) {
x = maxWidth;
roundUp = 1;
@@ -2588,7 +2572,9 @@ GetEntryIndex(
if (roundUp && (*indexPtr < entryPtr->numChars)) {
*indexPtr += 1;
}
- } else {
+ break;
+ }
+ default:
if (Tcl_GetInt(interp, string, indexPtr) != TCL_OK) {
goto badIndex;
}
@@ -2599,6 +2585,11 @@ GetEntryIndex(
}
}
return TCL_OK;
+
+ badIndex:
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad %s index \"%s\"",
+ (entryPtr->type == TK_ENTRY) ? "entry" : "spinbox", string));
+ return TCL_ERROR;
}
/*
@@ -2690,7 +2681,7 @@ EntrySelectTo(
if (!(entryPtr->flags & GOT_SELECTION) && (entryPtr->exportSelection)) {
Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection,
- (ClientData) entryPtr);
+ entryPtr);
entryPtr->flags |= GOT_SELECTION;
}
@@ -2750,10 +2741,10 @@ EntryFetchSelection(
int maxBytes) /* Maximum number of bytes to place at buffer,
* not including terminating NUL character. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
int byteCount;
- CONST char *string;
- CONST char *selStart, *selEnd;
+ const char *string;
+ const char *selStart, *selEnd;
if ((entryPtr->selectFirst < 0) || !(entryPtr->exportSelection)) {
return -1;
@@ -2773,7 +2764,7 @@ EntryFetchSelection(
buffer[byteCount] = '\0';
return byteCount;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -2796,7 +2787,7 @@ static void
EntryLostSelection(
ClientData clientData) /* Information about entry widget. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
entryPtr->flags &= ~GOT_SELECTION;
@@ -2850,7 +2841,7 @@ EventuallyRedraw(
if (!(entryPtr->flags & REDRAW_PENDING)) {
entryPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayEntry, (ClientData) entryPtr);
+ Tcl_DoWhenIdle(DisplayEntry, entryPtr);
}
}
@@ -2937,7 +2928,7 @@ EntryUpdateScrollbar(
}
interp = entryPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
EntryVisibleRange(entryPtr, &first, &last);
Tcl_PrintDouble(NULL, first, firstStr);
Tcl_PrintDouble(NULL, last, lastStr);
@@ -2948,10 +2939,10 @@ EntryUpdateScrollbar(
"\n (horizontal scrolling command executed by ");
Tcl_AddErrorInfo(interp, Tk_PathName(entryPtr->tkwin));
Tcl_AddErrorInfo(interp, ")");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
- Tcl_SetResult(interp, NULL, TCL_STATIC);
- Tcl_Release((ClientData) interp);
+ Tcl_ResetResult(interp);
+ Tcl_Release(interp);
}
/*
@@ -2976,7 +2967,7 @@ static void
EntryBlinkProc(
ClientData clientData) /* Pointer to record describing entry. */
{
- Entry *entryPtr = (Entry *) clientData;
+ Entry *entryPtr = clientData;
if ((entryPtr->state == STATE_DISABLED) ||
(entryPtr->state == STATE_READONLY) ||
@@ -2986,11 +2977,11 @@ EntryBlinkProc(
if (entryPtr->flags & CURSOR_ON) {
entryPtr->flags &= ~CURSOR_ON;
entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- entryPtr->insertOffTime, EntryBlinkProc, (ClientData) entryPtr);
+ entryPtr->insertOffTime, EntryBlinkProc, entryPtr);
} else {
entryPtr->flags |= CURSOR_ON;
entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- entryPtr->insertOnTime, EntryBlinkProc, (ClientData) entryPtr);
+ entryPtr->insertOnTime, EntryBlinkProc, entryPtr);
}
EventuallyRedraw(entryPtr);
}
@@ -3024,23 +3015,22 @@ EntryFocusProc(
entryPtr->flags |= GOT_FOCUS | CURSOR_ON;
if (entryPtr->insertOffTime != 0) {
entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- entryPtr->insertOnTime, EntryBlinkProc,
- (ClientData) entryPtr);
+ entryPtr->insertOnTime, EntryBlinkProc, entryPtr);
}
if (entryPtr->validate == VALIDATE_ALL ||
- entryPtr->validate == VALIDATE_FOCUS ||
- entryPtr->validate == VALIDATE_FOCUSIN) {
- EntryValidateChange(entryPtr, NULL,
- entryPtr->string, -1, VALIDATE_FOCUSIN);
+ entryPtr->validate == VALIDATE_FOCUS ||
+ entryPtr->validate == VALIDATE_FOCUSIN) {
+ EntryValidateChange(entryPtr, NULL, entryPtr->string, -1,
+ VALIDATE_FOCUSIN);
}
} else {
entryPtr->flags &= ~(GOT_FOCUS | CURSOR_ON);
- entryPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
+ entryPtr->insertBlinkHandler = NULL;
if (entryPtr->validate == VALIDATE_ALL ||
- entryPtr->validate == VALIDATE_FOCUS ||
- entryPtr->validate == VALIDATE_FOCUSOUT) {
- EntryValidateChange(entryPtr, NULL,
- entryPtr->string, -1, VALIDATE_FOCUSOUT);
+ entryPtr->validate == VALIDATE_FOCUS ||
+ entryPtr->validate == VALIDATE_FOCUSOUT) {
+ EntryValidateChange(entryPtr, NULL, entryPtr->string, -1,
+ VALIDATE_FOCUSOUT);
}
}
EventuallyRedraw(entryPtr);
@@ -3068,12 +3058,12 @@ static char *
EntryTextVarProc(
ClientData clientData, /* Information about button. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Not used. */
- CONST char *name2, /* Not used. */
+ const char *name1, /* Not used. */
+ const char *name2, /* Not used. */
int flags) /* Information about what happened. */
{
- Entry *entryPtr = (Entry *) clientData;
- CONST char *value;
+ Entry *entryPtr = clientData;
+ const char *value;
if (entryPtr->flags & ENTRY_DELETED) {
/*
@@ -3150,10 +3140,10 @@ EntryValidate(
*/
if (code != TCL_OK && code != TCL_RETURN) {
- Tcl_AddErrorInfo(interp, "\n\t(in validation command executed by ");
- Tcl_AddErrorInfo(interp, Tk_PathName(entryPtr->tkwin));
- Tcl_AddErrorInfo(interp, ")");
- Tcl_BackgroundError(interp);
+ Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
+ "\n\t(in validation command executed by %s)",
+ Tk_PathName(entryPtr->tkwin)));
+ Tcl_BackgroundException(interp, code);
return TCL_ERROR;
}
@@ -3166,11 +3156,11 @@ EntryValidate(
Tcl_AddErrorInfo(interp,
"\nvalid boolean not returned by validation command");
Tcl_BackgroundError(interp);
- Tcl_SetResult(interp, NULL, 0);
+ Tcl_ResetResult(interp);
return TCL_ERROR;
}
- Tcl_SetResult(interp, NULL, 0);
+ Tcl_ResetResult(interp);
return (bool ? TCL_OK : TCL_BREAK);
}
@@ -3196,9 +3186,9 @@ EntryValidate(
static int
EntryValidateChange(
register Entry *entryPtr, /* Entry that needs validation. */
- char *change, /* Characters to be added/deleted
+ const char *change, /* Characters to be added/deleted
* (NUL-terminated string). */
- CONST char *newValue, /* Potential new value of entry string */
+ const char *newValue, /* Potential new value of entry string */
int index, /* index of insert/delete, -1 otherwise */
int type) /* forced, delete, insert, focusin or
* focusout */
@@ -3279,16 +3269,19 @@ EntryValidateChange(
if (varValidate) {
entryPtr->validate = VALIDATE_NONE;
} else if (entryPtr->invalidCmd != NULL) {
+ int result;
+
Tcl_DStringInit(&script);
ExpandPercents(entryPtr, entryPtr->invalidCmd,
change, newValue, index, type, &script);
Tcl_DStringAppend(&script, "", 1);
p = Tcl_DStringValue(&script);
- if (Tcl_EvalEx(entryPtr->interp, p, -1,
- TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT) != TCL_OK) {
+ result = Tcl_EvalEx(entryPtr->interp, p, -1,
+ TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
+ if (result != TCL_OK) {
Tcl_AddErrorInfo(entryPtr->interp,
"\n\t(in invalidcommand executed by entry)");
- Tcl_BackgroundError(entryPtr->interp);
+ Tcl_BackgroundException(entryPtr->interp, result);
code = TCL_ERROR;
entryPtr->validate = VALIDATE_NONE;
}
@@ -3332,12 +3325,12 @@ EntryValidateChange(
static void
ExpandPercents(
register Entry *entryPtr, /* Entry that needs validation. */
- register CONST char *before,
+ register const char *before,
/* Command containing percent expressions to
* be replaced. */
- CONST char *change, /* Characters to added/deleted (NUL-terminated
+ const char *change, /* Characters to added/deleted (NUL-terminated
* string). */
- CONST char *newValue, /* Potential new value of entry string */
+ const char *newValue, /* 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 new
@@ -3346,7 +3339,7 @@ ExpandPercents(
int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl
* list element. */
int number, length;
- register CONST char *string;
+ register const char *string;
Tcl_UniChar ch;
char numStorage[2*TCL_INTEGER_SPACE];
@@ -3499,7 +3492,7 @@ Tk_SpinboxObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Entry *entryPtr;
register Spinbox *sbPtr;
@@ -3508,7 +3501,7 @@ Tk_SpinboxObjCmd(
char *tmp;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -3532,7 +3525,7 @@ Tk_SpinboxObjCmd(
* initialized as memset covers the rest.
*/
- sbPtr = (Spinbox *) ckalloc(sizeof(Spinbox));
+ sbPtr = ckalloc(sizeof(Spinbox));
entryPtr = (Entry *) sbPtr;
memset(sbPtr, 0, sizeof(Spinbox));
@@ -3540,11 +3533,11 @@ Tk_SpinboxObjCmd(
entryPtr->display = Tk_Display(tkwin);
entryPtr->interp = interp;
entryPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(entryPtr->tkwin), SpinboxWidgetObjCmd,
- (ClientData) sbPtr, EntryCmdDeletedProc);
+ Tk_PathName(entryPtr->tkwin), SpinboxWidgetObjCmd, sbPtr,
+ EntryCmdDeletedProc);
entryPtr->optionTable = optionTable;
entryPtr->type = TK_SPINBOX;
- tmp = (char *) ckalloc(1);
+ tmp = ckalloc(1);
tmp[0] = '\0';
entryPtr->string = tmp;
entryPtr->selectFirst = -1;
@@ -3571,7 +3564,7 @@ Tk_SpinboxObjCmd(
sbPtr->fromValue = 0.0;
sbPtr->toValue = 100.0;
sbPtr->increment = 1.0;
- sbPtr->formatBuf = (char *) ckalloc(TCL_DOUBLE_SPACE);
+ sbPtr->formatBuf = ckalloc(TCL_DOUBLE_SPACE);
sbPtr->bdRelief = TK_RELIEF_FLAT;
sbPtr->buRelief = TK_RELIEF_FLAT;
@@ -3580,15 +3573,15 @@ Tk_SpinboxObjCmd(
* otherwise Tk might free it while we still need it.
*/
- Tcl_Preserve((ClientData) entryPtr->tkwin);
+ Tcl_Preserve(entryPtr->tkwin);
Tk_SetClass(entryPtr->tkwin, "Spinbox");
- Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
+ Tk_SetClassProcs(entryPtr->tkwin, &entryClass, entryPtr);
Tk_CreateEventHandler(entryPtr->tkwin,
PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask,
- EntryEventProc, (ClientData) entryPtr);
+ EntryEventProc, entryPtr);
Tk_CreateSelHandler(entryPtr->tkwin, XA_PRIMARY, XA_STRING,
- EntryFetchSelection, (ClientData) entryPtr, XA_STRING);
+ EntryFetchSelection, entryPtr, XA_STRING);
if (Tk_InitOptions(interp, (char *) sbPtr, optionTable, tkwin)
!= TCL_OK) {
@@ -3602,7 +3595,7 @@ Tk_SpinboxObjCmd(
Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC);
return TCL_OK;
- error:
+ error:
Tk_DestroyWindow(entryPtr->tkwin);
return TCL_ERROR;
}
@@ -3630,15 +3623,15 @@ SpinboxWidgetObjCmd(
ClientData clientData, /* Information about spinbox widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Entry *entryPtr = (Entry *) clientData;
- Spinbox *sbPtr = (Spinbox *) clientData;
+ Entry *entryPtr = clientData;
+ Spinbox *sbPtr = clientData;
int cmdIndex, selIndex, result;
Tcl_Obj *objPtr;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -3653,11 +3646,10 @@ SpinboxWidgetObjCmd(
return result;
}
- Tcl_Preserve((ClientData) entryPtr);
+ Tcl_Preserve(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");
@@ -3670,11 +3662,9 @@ SpinboxWidgetObjCmd(
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);
+ Tk_CharBbox(entryPtr->textLayout, index, &x, &y, &width, &height);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d %d",
+ x + entryPtr->layoutX, y + entryPtr->layoutY, width, height));
break;
}
@@ -3688,22 +3678,19 @@ SpinboxWidgetObjCmd(
entryPtr->optionTable, objv[2], entryPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case SB_CMD_CONFIGURE:
if (objc <= 3) {
objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
- entryPtr->optionTable,
- (objc == 3) ? objv[2] : NULL,
+ entryPtr->optionTable, (objc == 3) ? objv[2] : NULL,
entryPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
}
@@ -3739,7 +3726,7 @@ SpinboxWidgetObjCmd(
Tcl_WrongNumArgs(interp, 2, objv, NULL);
goto error;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(entryPtr->string, -1));
break;
case SB_CMD_ICURSOR:
@@ -3767,8 +3754,8 @@ SpinboxWidgetObjCmd(
}
elem = GetSpinboxElement(sbPtr, x, y);
if (elem != SEL_NONE) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- selElementNames[elem], -1);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(selElementNames[elem], -1));
}
break;
}
@@ -3824,7 +3811,7 @@ SpinboxWidgetObjCmd(
case SB_CMD_SCAN: {
int x;
- char *minorCmd;
+ const char *minorCmd;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
@@ -3963,9 +3950,9 @@ SpinboxWidgetObjCmd(
entryPtr->selectLast = index2;
}
if (!(entryPtr->flags & GOT_SELECTION)
- && (entryPtr->exportSelection)) {
+ && entryPtr->exportSelection) {
Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
- EntryLostSelection, (ClientData) entryPtr);
+ EntryLostSelection, entryPtr);
entryPtr->flags |= GOT_SELECTION;
}
EventuallyRedraw(entryPtr);
@@ -3989,8 +3976,8 @@ SpinboxWidgetObjCmd(
goto error;
}
if (objc == 3) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- selElementNames[sbPtr->selElement], -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ selElementNames[sbPtr->selElement], -1));
} else {
int lastElement = sbPtr->selElement;
@@ -4016,7 +4003,7 @@ SpinboxWidgetObjCmd(
if (objc == 3) {
EntryValueChanged(entryPtr, Tcl_GetString(objv[2]));
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(entryPtr->string, -1));
break;
case SB_CMD_VALIDATE: {
@@ -4033,7 +4020,8 @@ SpinboxWidgetObjCmd(
if (entryPtr->validate != VALIDATE_NONE) {
entryPtr->validate = selIndex;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
+
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(code == TCL_OK));
break;
}
@@ -4099,11 +4087,11 @@ SpinboxWidgetObjCmd(
}
done:
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
return result;
error:
- Tcl_Release((ClientData) entryPtr);
+ Tcl_Release(entryPtr);
return TCL_ERROR;
}
@@ -4172,7 +4160,7 @@ SpinboxInvoke(
* "down" button. */
{
Entry *entryPtr = (Entry *) sbPtr;
- char *type;
+ const char *type;
int code, up;
Tcl_DString script;
@@ -4202,7 +4190,7 @@ SpinboxInvoke(
*/
int i, listc, elemLen, length = entryPtr->numChars;
- char *bytes;
+ const char *bytes;
Tcl_Obj **listv;
Tcl_ListObjGetElements(interp, sbPtr->listObj, &listc, &listv);
@@ -4297,7 +4285,7 @@ SpinboxInvoke(
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp, "\n\t(in command executed by spinbox)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
/*
* Yes, it's an error, but a bg one, so we return OK
@@ -4306,7 +4294,7 @@ SpinboxInvoke(
return TCL_OK;
}
- Tcl_SetResult(interp, NULL, 0);
+ Tcl_ResetResult(interp);
}
return TCL_OK;
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index 7f8aa1f..52535c8 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -6,7 +6,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * Copyright (c) 2002 Apple Computer, Inc.
+ * Copyright (c) 2002 Apple Inc.
*/
#ifndef _TKENTRY
@@ -16,11 +16,6 @@
#include "tkInt.h"
#endif
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
enum EntryType {
TK_ENTRY, TK_SPINBOX
};
@@ -48,7 +43,7 @@ typedef struct {
* Fields that are set by widget commands other than "configure".
*/
- CONST 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. */
@@ -138,7 +133,7 @@ typedef struct {
* configuration settings above.
*/
- CONST char *displayString; /* String to use when displaying. This may be
+ 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
@@ -300,7 +295,4 @@ MODULE_SCOPE int TkpDrawEntryBorderAndFocus(Entry *entryPtr,
Drawable d, int isSpinbox);
MODULE_SCOPE int TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d);
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKENTRY */
diff --git a/generic/tkError.c b/generic/tkError.c
index 6617c37..fc223e6 100644
--- a/generic/tkError.c
+++ b/generic/tkError.c
@@ -107,7 +107,7 @@ Tk_CreateErrorHandler(
* Create the handler record.
*/
- errorPtr = (TkErrorHandler *) ckalloc(sizeof(TkErrorHandler));
+ errorPtr = ckalloc(sizeof(TkErrorHandler));
errorPtr->dispPtr = dispPtr;
errorPtr->firstRequest = NextRequest(display);
errorPtr->lastRequest = (unsigned) -1;
@@ -182,7 +182,7 @@ Tk_DeleteErrorHandler(
} else {
prevPtr->nextPtr = nextPtr;
}
- ckfree((char *) errorPtr);
+ ckfree(errorPtr);
continue;
}
prevPtr = errorPtr;
@@ -246,8 +246,8 @@ ErrorProc(
&& (errorPtr->lastRequest < errEventPtr->serial))) {
continue;
}
- if (errorPtr->errorProc == NULL || (*errorPtr->errorProc)(
- errorPtr->clientData, errEventPtr) == 0) {
+ if (errorPtr->errorProc == NULL ||
+ errorPtr->errorProc(errorPtr->clientData, errEventPtr) == 0) {
return 0;
}
}
@@ -269,8 +269,7 @@ ErrorProc(
if (errEventPtr->error_code == BadWindow) {
Window w = (Window) errEventPtr->resourceid;
- if (Tk_IdToWindow(display, w) != NULL
- || TkpWindowWasRecentlyDeleted(w, dispPtr)) {
+ if (Tk_IdToWindow(display, w) != NULL) {
return 0;
}
}
@@ -280,7 +279,7 @@ ErrorProc(
*/
couldntHandle:
- return (*defaultHandler)(display, errEventPtr);
+ return defaultHandler(display, errEventPtr);
}
/*
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 7c41c22..dfa46ff 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -73,7 +73,7 @@ typedef struct TkWindowEvent {
* Array of event masks corresponding to each X event:
*/
-static unsigned long realEventMasks[MappingNotify+1] = {
+static const unsigned long realEventMasks[MappingNotify+1] = {
0,
0,
KeyPressMask, /* KeyPress */
@@ -114,7 +114,7 @@ static unsigned long realEventMasks[MappingNotify+1] = {
0 /* Mapping Notify */
};
-static unsigned long virtualEventMasks[TK_LASTEVENT-VirtualEvent] = {
+static const unsigned long virtualEventMasks[TK_LASTEVENT-VirtualEvent] = {
VirtualEventMask, /* VirtualEvents */
ActivateMask, /* ActivateNotify */
ActivateMask, /* DeactivateNotify */
@@ -245,16 +245,10 @@ InvokeFocusHandlers(
}
/*
- * MouseWheel events are not focus specific on Mac OS X.
+ * Only key-related events are directed according to the focus.
*/
-#ifdef MAC_OSX_TK
-#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask)
-#else
-#define FOCUS_DIRECTED_EVENT_MASK (KeyPressMask|KeyReleaseMask|MouseWheelMask)
-#endif
-
- if (mask & FOCUS_DIRECTED_EVENT_MASK) {
+ if (mask & (KeyPressMask|KeyReleaseMask)) {
(*winPtrPtr)->dispPtr->lastEventTime = eventPtr->xkey.time;
*winPtrPtr = TkFocusKeyEvent(*winPtrPtr, eventPtr);
if (*winPtrPtr == NULL) {
@@ -326,7 +320,7 @@ InvokeMouseHandlers(
*----------------------------------------------------------------------
*/
-#if defined(TK_USE_INPUT_METHODS)
+#ifdef TK_USE_INPUT_METHODS
static void
CreateXIC(
TkWindow *winPtr)
@@ -357,10 +351,10 @@ CreateXIC(
XFree(preedit_attlist);
}
-
+
if (winPtr->inputContext == NULL) {
/* XCreateIC failed. */
- return;
+ return;
}
/*
@@ -668,7 +662,7 @@ InvokeClientMessageHandlers(
if (tmpPtr == NULL) {
tsdPtr->lastCmPtr = prevPtr;
}
- (void) ckfree((char *) curPtr);
+ ckfree(curPtr);
curPtr = tmpPtr;
continue;
}
@@ -730,7 +724,7 @@ InvokeGenericHandlers(
if (tmpPtr == NULL) {
tsdPtr->lastGenericPtr = prevPtr;
}
- (void) ckfree((char *) curPtr);
+ ckfree(curPtr);
curPtr = tmpPtr;
continue;
}
@@ -738,7 +732,7 @@ InvokeGenericHandlers(
int done;
tsdPtr->handlersActive++;
- done = (*curPtr->proc)(curPtr->clientData, eventPtr);
+ done = curPtr->proc(curPtr->clientData, eventPtr);
tsdPtr->handlersActive--;
if (done) {
return done;
@@ -794,7 +788,7 @@ Tk_CreateEventHandler(
* No event handlers defined at all, so must create.
*/
- handlerPtr = (TkEventHandler *) ckalloc(sizeof(TkEventHandler));
+ handlerPtr = ckalloc(sizeof(TkEventHandler));
winPtr->handlerList = handlerPtr;
} else {
int found = 0;
@@ -825,8 +819,7 @@ Tk_CreateEventHandler(
* No event handler matched, so create a new one.
*/
- handlerPtr->nextPtr = (TkEventHandler *)
- ckalloc(sizeof(TkEventHandler));
+ handlerPtr->nextPtr = ckalloc(sizeof(TkEventHandler));
handlerPtr = handlerPtr->nextPtr;
}
@@ -873,7 +866,7 @@ Tk_DeleteEventHandler(
register InProgress *ipPtr;
TkEventHandler *prevPtr;
register TkWindow *winPtr = (TkWindow *) token;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -912,7 +905,7 @@ Tk_DeleteEventHandler(
} else {
prevPtr->nextPtr = handlerPtr->nextPtr;
}
- ckfree((char *) handlerPtr);
+ ckfree(handlerPtr);
/*
* No need to call XSelectInput: Tk always selects on all events for all
@@ -945,10 +938,10 @@ Tk_CreateGenericHandler(
ClientData clientData) /* One-word value to pass to proc. */
{
GenericHandler *handlerPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler));
+ handlerPtr = ckalloc(sizeof(GenericHandler));
handlerPtr->proc = proc;
handlerPtr->clientData = clientData;
@@ -986,7 +979,7 @@ Tk_DeleteGenericHandler(
ClientData clientData)
{
GenericHandler * handler;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (handler=tsdPtr->genericList ; handler ; handler=handler->nextPtr) {
@@ -1019,7 +1012,7 @@ Tk_CreateClientMessageHandler(
Tk_ClientMessageProc *proc) /* Function to call on event. */
{
GenericHandler *handlerPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1027,7 +1020,7 @@ Tk_CreateClientMessageHandler(
* with an extra clientData field we'll never use.
*/
- handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler));
+ handlerPtr = ckalloc(sizeof(GenericHandler));
handlerPtr->proc = (Tk_GenericProc *) proc;
handlerPtr->clientData = NULL; /* never used */
@@ -1065,7 +1058,7 @@ Tk_DeleteClientMessageHandler(
Tk_ClientMessageProc *proc)
{
GenericHandler * handler;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (handler=tsdPtr->cmList ; handler!=NULL ; handler=handler->nextPtr) {
@@ -1096,7 +1089,7 @@ Tk_DeleteClientMessageHandler(
void
TkEventInit(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->handlersActive = 0;
@@ -1131,9 +1124,8 @@ TkXErrorHandler(
ClientData clientData, /* Pointer to flag we set. */
XErrorEvent *errEventPtr) /* X error info. */
{
- int *error;
+ int *error = clientData;
- error = (int *) clientData;
*error = 1;
return 0;
}
@@ -1174,7 +1166,7 @@ ParentXId(
gotXError = 0;
handler = Tk_CreateErrorHandler(display, -1, -1, -1,
- TkXErrorHandler, (ClientData) (&gotXError));
+ TkXErrorHandler, &gotXError);
/*
* Get the parent window.
@@ -1224,7 +1216,7 @@ Tk_HandleEvent(
unsigned long mask;
InProgress ip;
Tcl_Interp *interp = NULL;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
UpdateButtonEventState(eventPtr);
@@ -1278,7 +1270,7 @@ Tk_HandleEvent(
* code.
*/
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
result = ((InvokeFocusHandlers(&winPtr, mask, eventPtr))
|| (InvokeMouseHandlers(winPtr, mask, eventPtr)));
@@ -1307,7 +1299,7 @@ Tk_HandleEvent(
XSetICFocus(winPtr->inputContext);
}
}
-#endif
+#endif /*TK_USE_INPUT_METHODS*/
/*
* For events where it hasn't already been done, update the current time
@@ -1338,7 +1330,7 @@ Tk_HandleEvent(
Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS")) {
TkWmProtocolEventProc(winPtr, eventPtr);
} else {
- InvokeClientMessageHandlers(tsdPtr, (Tk_Window)winPtr,
+ InvokeClientMessageHandlers(tsdPtr, (Tk_Window) winPtr,
eventPtr);
}
}
@@ -1346,7 +1338,7 @@ Tk_HandleEvent(
for (handlerPtr = winPtr->handlerList; handlerPtr != NULL; ) {
if ((handlerPtr->mask & mask) != 0) {
ip.nextHandler = handlerPtr->nextPtr;
- (*(handlerPtr->proc))(handlerPtr->clientData, eventPtr);
+ handlerPtr->proc(handlerPtr->clientData, eventPtr);
handlerPtr = ip.nextHandler;
} else {
handlerPtr = handlerPtr->nextPtr;
@@ -1380,7 +1372,7 @@ Tk_HandleEvent(
releaseInterpreter:
if (interp != NULL) {
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -1418,7 +1410,7 @@ TkEventDeadWindow(
{
register TkEventHandler *handlerPtr;
register InProgress *ipPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1439,7 +1431,7 @@ TkEventDeadWindow(
ipPtr->winPtr = None;
}
}
- ckfree((char *) handlerPtr);
+ ckfree(handlerPtr);
}
}
@@ -1467,7 +1459,7 @@ TkCurrentTime(
TkDisplay *dispPtr) /* Display for which the time is desired. */
{
register XEvent *eventPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->pendingPtr == NULL) {
@@ -1521,7 +1513,7 @@ Tk_RestrictEvents(
* argument. */
{
Tk_RestrictProc *prev;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
prev = tsdPtr->restrictProc;
@@ -1614,7 +1606,7 @@ Tk_QueueWindowEvent(
*/
if (!(dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS)) {
- wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent));
+ wevPtr = ckalloc(sizeof(TkWindowEvent));
wevPtr->header.proc = WindowEventProc;
wevPtr->event = *eventPtr;
Tcl_QueueEvent(&wevPtr->header, position);
@@ -1642,11 +1634,11 @@ Tk_QueueWindowEvent(
Tcl_QueueEvent(&dispPtr->delayedMotionPtr->header, position);
dispPtr->delayedMotionPtr = NULL;
- Tcl_CancelIdleCall(DelayedMotionProc, (ClientData) dispPtr);
+ Tcl_CancelIdleCall(DelayedMotionProc, dispPtr);
}
}
- wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent));
+ wevPtr = ckalloc(sizeof(TkWindowEvent));
wevPtr->header.proc = WindowEventProc;
wevPtr->event = *eventPtr;
if ((eventPtr->type == MotionNotify) && (position == TCL_QUEUE_TAIL)) {
@@ -1660,7 +1652,7 @@ Tk_QueueWindowEvent(
Tcl_Panic("Tk_QueueWindowEvent found unexpected delayed motion event");
}
dispPtr->delayedMotionPtr = wevPtr;
- Tcl_DoWhenIdle(DelayedMotionProc, (ClientData) dispPtr);
+ Tcl_DoWhenIdle(DelayedMotionProc, dispPtr);
} else {
Tcl_QueueEvent(&wevPtr->header, position);
}
@@ -1736,14 +1728,14 @@ WindowEventProc(
{
TkWindowEvent *wevPtr = (TkWindowEvent *) evPtr;
Tk_RestrictAction result;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!(flags & TCL_WINDOW_EVENTS)) {
return 0;
}
if (tsdPtr->restrictProc != NULL) {
- result = (*tsdPtr->restrictProc)(tsdPtr->restrictArg, &wevPtr->event);
+ result = tsdPtr->restrictProc(tsdPtr->restrictArg, &wevPtr->event);
if (result != TK_PROCESS_EVENT) {
if (result == TK_DEFER_EVENT) {
return 0;
@@ -1835,7 +1827,7 @@ DelayedMotionProc(
ClientData clientData) /* Pointer to display containing a delayed
* motion event to be serviced. */
{
- TkDisplay *dispPtr = (TkDisplay *) clientData;
+ TkDisplay *dispPtr = clientData;
if (dispPtr->delayedMotionPtr == NULL) {
Tcl_Panic("DelayedMotionProc found no delayed mouse motion event");
@@ -1867,7 +1859,7 @@ TkCreateExitHandler(
{
ExitHandler *exitPtr;
- exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler));
+ exitPtr = ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
Tcl_MutexLock(&exitMutex);
@@ -1932,7 +1924,7 @@ TkDeleteExitHandler(
} else {
prevPtr->nextPtr = exitPtr->nextPtr;
}
- ckfree((char *) exitPtr);
+ ckfree(exitPtr);
break;
}
}
@@ -1963,10 +1955,10 @@ TkCreateThreadExitHandler(
ClientData clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler));
+ exitPtr = ckalloc(sizeof(ExitHandler));
exitPtr->proc = proc;
exitPtr->clientData = clientData;
@@ -2004,7 +1996,7 @@ TkDeleteThreadExitHandler(
ClientData clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr, *prevPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (prevPtr = NULL, exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL;
@@ -2016,7 +2008,7 @@ TkDeleteThreadExitHandler(
} else {
prevPtr->nextPtr = exitPtr->nextPtr;
}
- ckfree((char *) exitPtr);
+ ckfree(exitPtr);
return;
}
}
@@ -2059,8 +2051,8 @@ TkFinalize(
firstExitPtr = exitPtr->nextPtr;
Tcl_MutexUnlock(&exitMutex);
- (*exitPtr->proc)(exitPtr->clientData);
- ckfree((char *) exitPtr);
+ exitPtr->proc(exitPtr->clientData);
+ ckfree(exitPtr);
Tcl_MutexLock(&exitMutex);
}
firstExitPtr = NULL;
@@ -2092,7 +2084,7 @@ TkFinalizeThread(
ClientData clientData) /* Arbitrary value to pass to proc. */
{
ExitHandler *exitPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DeleteThreadExitHandler(TkFinalizeThread, NULL);
@@ -2109,8 +2101,8 @@ TkFinalizeThread(
*/
tsdPtr->firstExitPtr = exitPtr->nextPtr;
- (*exitPtr->proc)(exitPtr->clientData);
- ckfree((char *) exitPtr);
+ exitPtr->proc(exitPtr->clientData);
+ ckfree(exitPtr);
}
}
}
diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c
index 547dd9b..fba570b 100644
--- a/generic/tkFileFilter.c
+++ b/generic/tkFileFilter.c
@@ -13,13 +13,10 @@
#include "tkInt.h"
#include "tkFileFilter.h"
-static int AddClause(Tcl_Interp *interp,
- FileFilter *filterPtr, Tcl_Obj *patternsObj,
- Tcl_Obj *ostypesObj, int isWindows);
-static void FreeClauses(FileFilter *filterPtr);
-static void FreeGlobPatterns(FileFilterClause *clausePtr);
-static void FreeMacFileTypes(FileFilterClause *clausePtr);
-static FileFilter * GetFilter(FileFilterList *flistPtr, CONST char *name);
+static int AddClause(Tcl_Interp *interp, FileFilter *filterPtr,
+ Tcl_Obj *patternsObj, Tcl_Obj *ostypesObj,
+ int isWindows);
+static FileFilter * GetFilter(FileFilterList *flistPtr, const char *name);
/*
*----------------------------------------------------------------------
@@ -87,7 +84,7 @@ TkGetFileFilters(
int i;
if (types == NULL) {
- return TCL_OK;
+ return TCL_OK;
}
if (Tcl_ListObjGetElements(interp, types, &listObjc,
@@ -103,6 +100,7 @@ TkGetFileFilters(
* the -filefilters option may have been used more than once in the
* command line.
*/
+
TkFreeFileFilters(flistPtr);
for (i = 0; i<listObjc; i++) {
@@ -160,15 +158,47 @@ void
TkFreeFileFilters(
FileFilterList *flistPtr) /* List of file filters to free */
{
- FileFilter *filterPtr, *toFree;
+ FileFilter *filterPtr;
+ FileFilterClause *clausePtr;
+ GlobPattern *globPtr;
+ MacFileType *mfPtr;
+ register void *toFree; /* A pointer that we are about to free. */
+
+ for (filterPtr = flistPtr->filters; filterPtr != NULL; ) {
+ for (clausePtr = filterPtr->clauses; clausePtr != NULL; ) {
+ /*
+ * Squelch each of the glob patterns.
+ */
+
+ for (globPtr = clausePtr->patterns; globPtr != NULL; ) {
+ ckfree(globPtr->pattern);
+ toFree = globPtr;
+ globPtr = globPtr->next;
+ ckfree(toFree);
+ }
+
+ /*
+ * Squelch each of the Mac file type codes.
+ */
+
+ for (mfPtr = clausePtr->macTypes; mfPtr != NULL; ) {
+ toFree = mfPtr;
+ mfPtr = mfPtr->next;
+ ckfree(toFree);
+ }
+ toFree = clausePtr;
+ clausePtr = clausePtr->next;
+ ckfree(toFree);
+ }
+
+ /*
+ * Squelch the name of the filter and the overall structure.
+ */
- filterPtr=flistPtr->filters;
- while (filterPtr != NULL) {
+ ckfree(filterPtr->name);
toFree = filterPtr;
filterPtr = filterPtr->next;
- FreeClauses(toFree);
- ckfree((char*)toFree->name);
- ckfree((char*)toFree);
+ ckfree(toFree);
}
flistPtr->filters = NULL;
}
@@ -231,7 +261,7 @@ AddClause(
for (i=0; i<ostypeCount; i++) {
int len;
- CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
+ const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
/*
* If len is < 4, it is definitely an error. If equal or longer,
@@ -271,10 +301,10 @@ AddClause(
* Add the clause into the list of clauses
*/
- clausePtr = (FileFilterClause*)ckalloc(sizeof(FileFilterClause));
- clausePtr->patterns = NULL;
+ clausePtr = ckalloc(sizeof(FileFilterClause));
+ clausePtr->patterns = NULL;
clausePtr->patternsTail = NULL;
- clausePtr->macTypes = NULL;
+ clausePtr->macTypes = NULL;
clausePtr->macTypesTail = NULL;
if (filterPtr->clauses == NULL) {
@@ -287,39 +317,38 @@ AddClause(
if (globCount > 0 && globList != NULL) {
for (i=0; i<globCount; i++) {
- GlobPattern *globPtr = (GlobPattern*)ckalloc(sizeof(GlobPattern));
+ GlobPattern *globPtr = ckalloc(sizeof(GlobPattern));
int len;
+ const char *str = Tcl_GetStringFromObj(globList[i], &len);
- CONST char *str = Tcl_GetStringFromObj(globList[i], &len);
len = (len + 1) * sizeof(char);
-
if (str[0] && str[0] != '*') {
/*
* Prepend a "*" to patterns that do not have a leading "*"
*/
- globPtr->pattern = (char*)ckalloc((unsigned int) len+1);
+ globPtr->pattern = ckalloc(len + 1);
globPtr->pattern[0] = '*';
strcpy(globPtr->pattern+1, str);
} else if (isWindows) {
if (strcmp(str, "*") == 0) {
- globPtr->pattern = (char*)ckalloc(4 * sizeof(char));
+ globPtr->pattern = ckalloc(4);
strcpy(globPtr->pattern, "*.*");
} else if (strcmp(str, "") == 0) {
/*
* An empty string means "match all files with no
* extensions"
- * BUG: "*." actually matches with all files on Win95
+ * TODO: "*." actually matches with all files on Win95
*/
- globPtr->pattern = (char *) ckalloc(3 * sizeof(char));
+ globPtr->pattern = ckalloc(3);
strcpy(globPtr->pattern, "*.");
} else {
- globPtr->pattern = (char *) ckalloc((unsigned int) len);
+ globPtr->pattern = ckalloc(len);
strcpy(globPtr->pattern, str);
}
} else {
- globPtr->pattern = (char *) ckalloc((unsigned int) len);
+ globPtr->pattern = ckalloc(len);
strcpy(globPtr->pattern, str);
}
@@ -343,8 +372,8 @@ AddClause(
for (i=0; i<ostypeCount; i++) {
Tcl_DString osTypeDS;
int len;
- MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType));
- CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
+ MacFileType *mfPtr = ckalloc(sizeof(MacFileType));
+ const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
char *string;
/*
@@ -399,11 +428,12 @@ static FileFilter *
GetFilter(
FileFilterList *flistPtr, /* The FileFilterList that contains the newly
* created filter */
- CONST 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. */
{
FileFilter *filterPtr = flistPtr->filters;
+ size_t len;
for (; filterPtr; filterPtr=filterPtr->next) {
if (strcmp(filterPtr->name, name) == 0) {
@@ -411,11 +441,12 @@ GetFilter(
}
}
- filterPtr = (FileFilter *) ckalloc(sizeof(FileFilter));
+ filterPtr = ckalloc(sizeof(FileFilter));
filterPtr->clauses = NULL;
filterPtr->clausesTail = NULL;
- filterPtr->name = (char *) ckalloc((strlen(name)+1) * sizeof(char));
- strcpy(filterPtr->name, name);
+ len = strlen(name) + 1;
+ filterPtr->name = ckalloc(len);
+ memcpy(filterPtr->name, name, len);
if (flistPtr->filters == NULL) {
flistPtr->filters = flistPtr->filtersTail = filterPtr;
@@ -430,103 +461,6 @@ GetFilter(
}
/*
- *----------------------------------------------------------------------
- *
- * FreeClauses --
- *
- * Frees the malloc'ed file type clause
- *
- * Results:
- * None.
- *
- * Side effects:
- * The list of clauses in filterPtr->clauses are freed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FreeClauses(
- FileFilter *filterPtr) /* FileFilter whose clauses are to be freed */
-{
- FileFilterClause *clausePtr = filterPtr->clauses;
-
- while (clausePtr != NULL) {
- FileFilterClause *toFree = clausePtr;
- clausePtr = clausePtr->next;
-
- FreeGlobPatterns(toFree);
- FreeMacFileTypes(toFree);
- ckfree((char *) toFree);
- }
- filterPtr->clauses = NULL;
- filterPtr->clausesTail = NULL;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * FreeGlobPatterns --
- *
- * Frees the malloc'ed glob patterns in a clause
- *
- * Results:
- * None.
- *
- * Side effects:
- * The list of glob patterns in clausePtr->patterns are freed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FreeGlobPatterns(
- FileFilterClause *clausePtr)/* The clause whose patterns are to be freed*/
-{
- GlobPattern *globPtr = clausePtr->patterns;
-
- while (globPtr != NULL) {
- GlobPattern *toFree = globPtr;
- globPtr = globPtr->next;
-
- ckfree((char *) toFree->pattern);
- ckfree((char *) toFree);
- }
- clausePtr->patterns = NULL;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * FreeMacFileTypes --
- *
- * Frees the malloc'ed Mac file types in a clause
- *
- * Results:
- * None.
- *
- * Side effects:
- * The list of Mac file types in clausePtr->macTypes are freed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FreeMacFileTypes(
- FileFilterClause *clausePtr)/* The clause whose mac types are to be
- * freed */
-{
- MacFileType *mfPtr = clausePtr->macTypes;
-
- while (mfPtr != NULL) {
- MacFileType *toFree = mfPtr;
- mfPtr = mfPtr->next;
- ckfree((char *) toFree);
- }
- clausePtr->macTypes = NULL;
-}
-
-/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/generic/tkFileFilter.h b/generic/tkFileFilter.h
index 24002df..131e423 100644
--- a/generic/tkFileFilter.h
+++ b/generic/tkFileFilter.h
@@ -15,11 +15,6 @@
#define OSType long
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
typedef struct GlobPattern {
struct GlobPattern *next; /* Chains to the next glob pattern in a glob
* pattern list */
@@ -80,6 +75,4 @@ MODULE_SCOPE int TkGetFileFilters(Tcl_Interp *interp,
FileFilterList *flistPtr, Tcl_Obj *valuePtr,
int isWindows);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-#endif
+#endif /* _TK_FILE_FILTER */
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index 42d8be3..5f68d8b 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -68,14 +68,6 @@ typedef struct TkDisplayFocusInfo {
} DisplayFocusInfo;
/*
- * The following magic value is stored in the "send_event" field of FocusIn
- * and FocusOut events that are generated in this file. This allows us to
- * separate "real" events coming from the server from those that we generated.
- */
-
-#define GENERATED_EVENT_MAGIC ((Bool) 0x547321ac)
-
-/*
* Debugging support...
*/
@@ -116,16 +108,16 @@ Tk_FocusObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *focusOptions[] = {
+ static const char *const focusOptions[] = {
"-displayof", "-force", "-lastfor", NULL
};
- Tk_Window tkwin = (Tk_Window) clientData;
- TkWindow *winPtr = (TkWindow *) clientData;
+ Tk_Window tkwin = clientData;
+ TkWindow *winPtr = clientData;
TkWindow *newPtr, *focusWinPtr, *topLevelPtr;
ToplevelFocusInfo *tlFocusPtr;
- char *windowName;
+ const char *windowName;
int index;
/*
@@ -214,7 +206,7 @@ Tk_FocusObjCmd(
return TCL_ERROR;
}
for (topLevelPtr = newPtr; topLevelPtr != NULL;
- topLevelPtr = topLevelPtr->parentPtr) {
+ topLevelPtr = topLevelPtr->parentPtr) {
if (!(topLevelPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
@@ -288,7 +280,7 @@ TkFocusFilterEvent(
* pass the event through to Tk bindings.
*/
- if (eventPtr->xfocus.send_event == GENERATED_EVENT_MAGIC) {
+ if (eventPtr->xfocus.send_event == GENERATED_FOCUS_EVENT_MAGIC) {
eventPtr->xfocus.send_event = 0;
return 1;
}
@@ -391,7 +383,7 @@ TkFocusFilterEvent(
* tree, then ignore the event.
*/
- if (TkGrabState(winPtr) == TK_GRAB_EXCLUDED) {
+ if (TkGrabState(winPtr) == TK_GRAB_EXCLUDED) {
return retValue;
}
@@ -424,7 +416,7 @@ TkFocusFilterEvent(
}
}
if (tlFocusPtr == NULL) {
- tlFocusPtr = (ToplevelFocusInfo *) ckalloc(sizeof(ToplevelFocusInfo));
+ tlFocusPtr = ckalloc(sizeof(ToplevelFocusInfo));
tlFocusPtr->topLevelPtr = tlFocusPtr->focusWinPtr = winPtr;
tlFocusPtr->nextPtr = winPtr->mainPtr->tlFocusPtr;
winPtr->mainPtr->tlFocusPtr = tlFocusPtr;
@@ -498,14 +490,14 @@ TkFocusFilterEvent(
} else if (eventPtr->type == LeaveNotify) {
/*
* If the pointer just left a window for which we automatically
- * claimed the focus on enter, move the focus back to the root
- * window, where it was before we claimed it above. Note:
+ * claimed the focus on enter, move the focus back to the root window,
+ * where it was before we claimed it above. Note:
* dispPtr->implicitWinPtr may not be the same as
- * displayFocusPtr->focusWinPtr (e.g. because the "focus" command
- * was used to redirect the focus after it arrived at
- * dispPtr->implicitWinPtr)!! In addition, we generate events
- * because the window manager won't give us a FocusOut event when
- * we focus on the root.
+ * displayFocusPtr->focusWinPtr (e.g. because the "focus" command was
+ * used to redirect the focus after it arrived at
+ * dispPtr->implicitWinPtr)!! In addition, we generate events because
+ * the window manager won't give us a FocusOut event when we focus on
+ * the root.
*/
if ((dispPtr->implicitWinPtr != NULL)
@@ -571,7 +563,7 @@ TkSetFocusWin(
*/
allMapped = 1;
- for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) {
+ for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) {
if (topLevelPtr == NULL) {
/*
* The window is being deleted. No point in worrying about giving
@@ -597,16 +589,14 @@ TkSetFocusWin(
*/
if (displayFocusPtr->focusOnMapPtr != NULL) {
- Tk_DeleteEventHandler(
- (Tk_Window) displayFocusPtr->focusOnMapPtr,
+ Tk_DeleteEventHandler((Tk_Window) displayFocusPtr->focusOnMapPtr,
StructureNotifyMask, FocusMapProc,
- (ClientData) displayFocusPtr->focusOnMapPtr);
+ displayFocusPtr->focusOnMapPtr);
displayFocusPtr->focusOnMapPtr = NULL;
}
if (!allMapped) {
- Tk_CreateEventHandler((Tk_Window) winPtr,
- VisibilityChangeMask, FocusMapProc,
- (ClientData) winPtr);
+ Tk_CreateEventHandler((Tk_Window) winPtr, VisibilityChangeMask,
+ FocusMapProc, winPtr);
displayFocusPtr->focusOnMapPtr = winPtr;
displayFocusPtr->forceFocus = force;
return;
@@ -619,7 +609,7 @@ TkSetFocusWin(
}
}
if (tlFocusPtr == NULL) {
- tlFocusPtr = (ToplevelFocusInfo *) ckalloc(sizeof(ToplevelFocusInfo));
+ tlFocusPtr = ckalloc(sizeof(ToplevelFocusInfo));
tlFocusPtr->topLevelPtr = topLevelPtr;
tlFocusPtr->nextPtr = winPtr->mainPtr->tlFocusPtr;
winPtr->mainPtr->tlFocusPtr = tlFocusPtr;
@@ -845,7 +835,7 @@ TkFocusDeadWindow(
} else {
prevPtr->nextPtr = tlFocusPtr->nextPtr;
}
- ckfree((char *) tlFocusPtr);
+ ckfree(tlFocusPtr);
break;
} else if (winPtr == tlFocusPtr->focusWinPtr) {
/*
@@ -918,7 +908,7 @@ GenerateFocusEvents(
}
event.xfocus.serial = LastKnownRequestProcessed(winPtr->display);
- event.xfocus.send_event = GENERATED_EVENT_MAGIC;
+ event.xfocus.send_event = GENERATED_FOCUS_EVENT_MAGIC;
event.xfocus.display = winPtr->display;
event.xfocus.mode = NotifyNormal;
TkInOutEvents(&event, sourcePtr, destPtr, FocusOut, FocusIn,
@@ -951,7 +941,7 @@ FocusMapProc(
ClientData clientData, /* Toplevel window. */
XEvent *eventPtr) /* Information about event. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
DisplayFocusInfo *displayFocusPtr;
if (eventPtr->type == VisibilityNotify) {
@@ -1005,7 +995,7 @@ FindDisplayFocusInfo(
* The record doesn't exist yet. Make a new one.
*/
- displayFocusPtr = (DisplayFocusInfo *) ckalloc(sizeof(DisplayFocusInfo));
+ displayFocusPtr = ckalloc(sizeof(DisplayFocusInfo));
displayFocusPtr->dispPtr = dispPtr;
displayFocusPtr->focusWinPtr = NULL;
displayFocusPtr->focusOnMapPtr = NULL;
@@ -1041,13 +1031,13 @@ TkFocusFree(
DisplayFocusInfo *displayFocusPtr = mainPtr->displayFocusPtr;
mainPtr->displayFocusPtr = mainPtr->displayFocusPtr->nextPtr;
- ckfree((char *) displayFocusPtr);
+ ckfree(displayFocusPtr);
}
while (mainPtr->tlFocusPtr != NULL) {
ToplevelFocusInfo *tlFocusPtr = mainPtr->tlFocusPtr;
mainPtr->tlFocusPtr = mainPtr->tlFocusPtr->nextPtr;
- ckfree((char *) tlFocusPtr);
+ ckfree(tlFocusPtr);
}
}
@@ -1056,8 +1046,8 @@ TkFocusFree(
*
* TkFocusSplit --
*
- * Adjust focus window for a newly managed toplevel, thus splitting
- * the toplevel into two toplevels.
+ * Adjust focus window for a newly managed toplevel, thus splitting the
+ * toplevel into two toplevels.
*
* Results:
* None.
@@ -1069,29 +1059,29 @@ TkFocusFree(
*/
void
-TkFocusSplit(winPtr)
- TkWindow *winPtr; /* Window is the new toplevel
- * Any focus point at or below window
- * must be moved to this new toplevel */
+TkFocusSplit(
+ TkWindow *winPtr) /* Window is the new toplevel. Any focus point
+ * at or below window must be moved to this
+ * new toplevel. */
{
ToplevelFocusInfo *tlFocusPtr;
- TkWindow *topLevelPtr;
- TkWindow *subWinPtr;
+ TkWindow *topLevelPtr, *subWinPtr;
FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
/*
- * Find the top-level window for winPtr, then find (or create)
- * a record for the top-level. Also see whether winPtr and all its
- * ancestors are mapped.
+ * Find the top-level window for winPtr, then find (or create) a record
+ * for the top-level. Also see whether winPtr and all its ancestors are
+ * mapped.
*/
- for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) {
+ for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) {
if (topLevelPtr == NULL) {
/*
- * The window is being deleted. No point in worrying about
- * giving it the focus.
+ * The window is being deleted. No point in worrying about giving
+ * it the focus.
*/
+
return;
}
if (topLevelPtr->flags & TK_TOP_HIERARCHY) {
@@ -1099,37 +1089,57 @@ TkFocusSplit(winPtr)
}
}
- /* Search all focus records to find child windows of winPtr */
+ /*
+ * Search all focus records to find child windows of winPtr.
+ */
+
for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL;
- tlFocusPtr = tlFocusPtr->nextPtr) {
+ tlFocusPtr = tlFocusPtr->nextPtr) {
if (tlFocusPtr->topLevelPtr == topLevelPtr) {
break;
}
}
if (tlFocusPtr == NULL) {
- /* No focus record for this toplevel, nothing to do. */
+ /*
+ * No focus record for this toplevel, nothing to do.
+ */
+
return;
}
- /* See if current focusWin is child of the new toplevel */
- for (subWinPtr = tlFocusPtr->focusWinPtr;
- subWinPtr && subWinPtr != winPtr && subWinPtr != topLevelPtr;
- subWinPtr = subWinPtr->parentPtr) {}
+ /*
+ * See if current focusWin is child of the new toplevel.
+ */
+
+ for (subWinPtr = tlFocusPtr->focusWinPtr;
+ subWinPtr && subWinPtr != winPtr && subWinPtr != topLevelPtr;
+ subWinPtr = subWinPtr->parentPtr) {
+ /* EMPTY */
+ }
if (subWinPtr == winPtr) {
- /* Move focus to new toplevel */
- ToplevelFocusInfo *newTlFocusPtr;
+ /*
+ * Move focus to new toplevel.
+ */
+
+ ToplevelFocusInfo *newTlFocusPtr = ckalloc(sizeof(ToplevelFocusInfo));
- newTlFocusPtr = (ToplevelFocusInfo *) ckalloc(sizeof(ToplevelFocusInfo));
newTlFocusPtr->topLevelPtr = winPtr;
newTlFocusPtr->focusWinPtr = tlFocusPtr->focusWinPtr;
newTlFocusPtr->nextPtr = winPtr->mainPtr->tlFocusPtr;
winPtr->mainPtr->tlFocusPtr = newTlFocusPtr;
- /* Move old toplevel's focus to the toplevel itself */
+
+ /*
+ * Move old toplevel's focus to the toplevel itself.
+ */
+
tlFocusPtr->focusWinPtr = topLevelPtr;
}
- /* If it's not, then let focus progress naturally */
+
+ /*
+ * If it's not, then let focus progress naturally.
+ */
}
/*
@@ -1149,28 +1159,28 @@ TkFocusSplit(winPtr)
*/
void
-TkFocusJoin(winPtr)
- TkWindow *winPtr; /* Window is no longer a toplevel */
+TkFocusJoin(
+ TkWindow *winPtr) /* Window is no longer a toplevel. */
{
- ToplevelFocusInfo *tlFocusPtr;
- ToplevelFocusInfo *tmpPtr;
+ ToplevelFocusInfo *tlFocusPtr, *tmpPtr;
/*
* Remove old toplevel record
*/
+
if (winPtr && winPtr->mainPtr && winPtr->mainPtr->tlFocusPtr
- && winPtr->mainPtr->tlFocusPtr->topLevelPtr == winPtr) {
+ && winPtr->mainPtr->tlFocusPtr->topLevelPtr == winPtr) {
tmpPtr = winPtr->mainPtr->tlFocusPtr;
winPtr->mainPtr->tlFocusPtr = tmpPtr->nextPtr;
- ckfree((char *)tmpPtr);
- } else {
+ ckfree(tmpPtr);
+ } else if (winPtr && winPtr->mainPtr) {
for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL;
- tlFocusPtr = tlFocusPtr->nextPtr) {
+ tlFocusPtr = tlFocusPtr->nextPtr) {
if (tlFocusPtr->nextPtr &&
- tlFocusPtr->nextPtr->topLevelPtr == winPtr) {
+ tlFocusPtr->nextPtr->topLevelPtr == winPtr) {
tmpPtr = tlFocusPtr->nextPtr;
tlFocusPtr->nextPtr = tmpPtr->nextPtr;
- ckfree((char *)tmpPtr);
+ ckfree(tmpPtr);
break;
}
}
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 1a6474f..32d0589 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -163,7 +163,7 @@ static const TkStateMap xlfdSetwidthMap[] = {
* configuring a set of font attributes.
*/
-static const char *fontOpt[] = {
+static const char *const fontOpt[] = {
"-family",
"-size",
"-weight",
@@ -188,27 +188,27 @@ static const char *fontOpt[] = {
* the alias list are also automatically tried.
*/
-static char *timesAliases[] = {
+static const char *const timesAliases[] = {
"Times", /* Unix. */
"Times New Roman", /* Windows. */
"New York", /* Mac. */
NULL
};
-static char *helveticaAliases[] = {
+static const char *const helveticaAliases[] = {
"Helvetica", /* Unix. */
"Arial", /* Windows. */
"Geneva", /* Mac. */
NULL
};
-static char *courierAliases[] = {
+static const char *const courierAliases[] = {
"Courier", /* Unix and Mac. */
"Courier New", /* Windows. */
NULL
};
-static char *minchoAliases[] = {
+static const char *const minchoAliases[] = {
"mincho", /* Unix. */
"\357\274\255\357\274\263 \346\230\216\346\234\235",
/* Windows (MS mincho). */
@@ -217,7 +217,7 @@ static char *minchoAliases[] = {
NULL
};
-static char *gothicAliases[] = {
+static const char *const gothicAliases[] = {
"gothic", /* Unix. */
"\357\274\255\357\274\263 \343\202\264\343\202\267\343\203\203\343\202\257",
/* Windows (MS goshikku). */
@@ -226,7 +226,7 @@ static char *gothicAliases[] = {
NULL
};
-static char *dingbatsAliases[] = {
+static const char *const dingbatsAliases[] = {
"dingbats", "zapfdingbats", "itc zapfdingbats",
/* Unix. */
/* Windows. */
@@ -234,7 +234,7 @@ static char *dingbatsAliases[] = {
NULL
};
-static char **fontAliases[] = {
+static const char *const *const fontAliases[] = {
timesAliases,
helveticaAliases,
courierAliases,
@@ -250,7 +250,7 @@ static char **fontAliases[] = {
* be examined also.
*/
-static char *systemClass[] = {
+static const char *const systemClass[] = {
"fixed", /* Unix. */
/* Windows. */
"chicago", "osaka", "sistemny",
@@ -258,7 +258,7 @@ static char *systemClass[] = {
NULL
};
-static char *serifClass[] = {
+static const char *const serifClass[] = {
"times", "palatino", "mincho",
/* All platforms. */
"song ti", /* Unix. */
@@ -268,7 +268,7 @@ static char *serifClass[] = {
NULL
};
-static char *sansClass[] = {
+static const char *const sansClass[] = {
"helvetica", "gothic", /* All platforms. */
/* Unix. */
"ms sans serif", "traditional arabic",
@@ -277,7 +277,7 @@ static char *sansClass[] = {
NULL
};
-static char *monoClass[] = {
+static const char *const monoClass[] = {
"courier", "gothic", /* All platforms. */
"fangsong ti", /* Unix. */
"simplified arabic fixed", /* Windows. */
@@ -285,11 +285,11 @@ static char *monoClass[] = {
NULL
};
-static char *symbolClass[] = {
+static const char *const symbolClass[] = {
"symbol", "dingbats", "wingdings", NULL
};
-static char **fontFallbacks[] = {
+static const char *const *const fontFallbacks[] = {
systemClass,
serifClass,
sansClass,
@@ -304,7 +304,7 @@ static char **fontFallbacks[] = {
* found, all font families in the system are examined.
*/
-static char *globalFontClass[] = {
+static const char *const globalFontClass[] = {
"symbol", /* All platforms. */
/* Unix. */
"lucida sans unicode", /* Windows. */
@@ -325,6 +325,7 @@ static int ConfigAttributesObj(Tcl_Interp *interp,
TkFontAttributes *faPtr);
static void DupFontObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr);
static int FieldSpecified(const char *field);
+static void FreeFontObj(Tcl_Obj *objPtr);
static void FreeFontObjProc(Tcl_Obj *objPtr);
static int GetAttributeInfoObj(Tcl_Interp *interp,
const TkFontAttributes *faPtr, Tcl_Obj *objPtr);
@@ -345,7 +346,7 @@ static void UpdateDependentFonts(TkFontInfo *fiPtr,
* font object points to the TkFont structure for the font, or NULL.
*/
-Tcl_ObjType tkFontObjType = {
+const Tcl_ObjType tkFontObjType = {
"font", /* name */
FreeFontObjProc, /* freeIntRepProc */
DupFontObjProc, /* dupIntRepProc */
@@ -376,9 +377,8 @@ void
TkFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = ckalloc(sizeof(TkFontInfo));
- fiPtr = (TkFontInfo *) ckalloc(sizeof(TkFontInfo));
Tcl_InitHashTable(&fiPtr->fontCache, TCL_STRING_KEYS);
Tcl_InitHashTable(&fiPtr->namedTable, TCL_STRING_KEYS);
fiPtr->mainPtr = mainPtr;
@@ -410,14 +410,11 @@ void
TkFontPkgFree(
TkMainInfo *mainPtr) /* The application being deleted. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = mainPtr->fontInfoPtr;
Tcl_HashEntry *hPtr, *searchPtr;
Tcl_HashSearch search;
- int fontsLeft;
+ int fontsLeft = 0;
- fiPtr = mainPtr->fontInfoPtr;
-
- fontsLeft = 0;
for (searchPtr = Tcl_FirstHashEntry(&fiPtr->fontCache, &search);
searchPtr != NULL;
searchPtr = Tcl_NextHashEntry(&search)) {
@@ -438,14 +435,14 @@ TkFontPkgFree(
hPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
while (hPtr != NULL) {
- ckfree((char *) Tcl_GetHashValue(hPtr));
+ ckfree(Tcl_GetHashValue(hPtr));
hPtr = Tcl_NextHashEntry(&search);
}
Tcl_DeleteHashTable(&fiPtr->namedTable);
if (fiPtr->updatePending != 0) {
- Tcl_CancelIdleCall(TheWorldHasChanged, (ClientData) fiPtr);
+ Tcl_CancelIdleCall(TheWorldHasChanged, fiPtr);
}
- ckfree((char *) fiPtr);
+ ckfree(fiPtr);
}
/*
@@ -473,9 +470,9 @@ Tk_FontObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int index;
- Tk_Window tkwin;
- TkFontInfo *fiPtr;
- static const char *optionStrings[] = {
+ Tk_Window tkwin = clientData;
+ TkFontInfo *fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
+ static const char *const optionStrings[] = {
"actual", "configure", "create", "delete",
"families", "measure", "metrics", "names",
NULL
@@ -485,9 +482,6 @@ Tk_FontObjCmd(
FONT_FAMILIES, FONT_MEASURE, FONT_METRICS, FONT_NAMES
};
- tkwin = (Tk_Window) clientData;
- fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?");
return TCL_ERROR;
@@ -528,7 +522,7 @@ Tk_FontObjCmd(
s = Tcl_GetString(objv[n]);
if (s[0] == '-' && s[1] != '-') {
optPtr = objv[n];
- ++n;
+ n++;
} else {
optPtr = NULL;
}
@@ -540,7 +534,7 @@ Tk_FontObjCmd(
if (n < objc) {
if (!strcmp(Tcl_GetString(objv[n]), "--")) {
- ++n;
+ n++;
}
}
@@ -550,7 +544,7 @@ Tk_FontObjCmd(
if (n < objc) {
charPtr = objv[n];
- ++n;
+ n++;
}
/*
@@ -606,20 +600,20 @@ Tk_FontObjCmd(
}
case FONT_CONFIGURE: {
int result;
- char *string;
+ const char *string;
Tcl_Obj *objPtr;
NamedFont *nfPtr;
Tcl_HashEntry *namedHashPtr;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "fontname ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "fontname ?-option value ...?");
return TCL_ERROR;
}
string = Tcl_GetString(objv[2]);
namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, string);
nfPtr = NULL; /* lint. */
if (namedHashPtr != NULL) {
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ nfPtr = Tcl_GetHashValue(namedHashPtr);
}
if ((namedHashPtr == NULL) || (nfPtr->deletePending != 0)) {
Tcl_AppendResult(interp, "named font \"", string,
@@ -639,13 +633,12 @@ Tk_FontObjCmd(
return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr);
}
case FONT_CREATE: {
- int skip, i;
- char *name;
+ int skip = 3, i;
+ const char *name;
char buf[16 + TCL_INTEGER_SPACE];
TkFontAttributes fa;
Tcl_HashEntry *namedHashPtr;
- skip = 3;
if (objc < 3) {
name = NULL;
} else {
@@ -682,7 +675,7 @@ Tk_FontObjCmd(
}
case FONT_DELETE: {
int i, result = TCL_OK;
- char *string;
+ const char *string;
/*
* Delete the named font. If there are still widgets using this font,
@@ -700,9 +693,8 @@ Tk_FontObjCmd(
return result;
}
case FONT_FAMILIES: {
- int skip;
+ int skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
if (skip < 0) {
return TCL_ERROR;
}
@@ -714,10 +706,9 @@ Tk_FontObjCmd(
break;
}
case FONT_MEASURE: {
- char *string;
+ const char *string;
Tk_Font tkfont;
int length = 0, skip = 0;
- Tcl_Obj *resultPtr;
if (objc > 4) {
skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
@@ -726,7 +717,8 @@ Tk_FontObjCmd(
}
}
if (objc - skip != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "font ?-displayof window? text");
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "font ?-displayof window? text");
return TCL_ERROR;
}
tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
@@ -734,8 +726,8 @@ Tk_FontObjCmd(
return TCL_ERROR;
}
string = Tcl_GetStringFromObj(objv[3 + skip], &length);
- resultPtr = Tcl_GetObjResult(interp);
- Tcl_SetIntObj(resultPtr, Tk_TextWidth(tkfont, string, length));
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(Tk_TextWidth(tkfont, string, length)));
Tk_FreeFont(tkfont);
break;
}
@@ -743,7 +735,7 @@ Tk_FontObjCmd(
Tk_Font tkfont;
int skip, index, i;
const TkFontMetrics *fmPtr;
- static const char *switches[] = {
+ static const char *const switches[] = {
"-ascent", "-descent", "-linespace", "-fixed", NULL
};
@@ -764,12 +756,10 @@ Tk_FontObjCmd(
objv += skip;
fmPtr = GetFontMetrics(tkfont);
if (objc == 3) {
- char buf[64 + TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "-ascent %d -descent %d -linespace %d -fixed %d",
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "-ascent %d -descent %d -linespace %d -fixed %d",
fmPtr->ascent, fmPtr->descent,
- fmPtr->ascent + fmPtr->descent, fmPtr->fixed);
- Tcl_AppendResult(interp, buf, NULL);
+ fmPtr->ascent + fmPtr->descent, fmPtr->fixed));
} else {
if (Tcl_GetIndexFromObj(interp, objv[3], switches, "metric", 0,
&index) != TCL_OK) {
@@ -783,33 +773,35 @@ Tk_FontObjCmd(
case 2: i = fmPtr->ascent + fmPtr->descent; break;
case 3: i = fmPtr->fixed; break;
}
- Tcl_SetIntObj(Tcl_GetObjResult(interp), i);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(i));
}
Tk_FreeFont(tkfont);
break;
}
case FONT_NAMES: {
- char *string;
- NamedFont *nfPtr;
Tcl_HashSearch search;
Tcl_HashEntry *namedHashPtr;
- Tcl_Obj *strPtr, *resultPtr;
+ Tcl_Obj *resultPtr;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "names");
return TCL_ERROR;
}
- resultPtr = Tcl_GetObjResult(interp);
+ resultPtr = Tcl_NewObj();
namedHashPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
while (namedHashPtr != NULL) {
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ NamedFont *nfPtr = Tcl_GetHashValue(namedHashPtr);
+
if (nfPtr->deletePending == 0) {
- string = Tcl_GetHashKey(&fiPtr->namedTable, namedHashPtr);
- strPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ char *string = Tcl_GetHashKey(&fiPtr->namedTable,
+ namedHashPtr);
+
+ Tcl_ListObjAppendElement(NULL, resultPtr,
+ Tcl_NewStringObj(string, -1));
}
namedHashPtr = Tcl_NextHashEntry(&search);
}
+ Tcl_SetObjResult(interp, resultPtr);
break;
}
}
@@ -844,9 +836,8 @@ UpdateDependentFonts(
Tcl_HashEntry *cacheHashPtr;
Tcl_HashSearch search;
TkFont *fontPtr;
- NamedFont *nfPtr;
+ NamedFont *nfPtr = Tcl_GetHashValue(namedHashPtr);
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
if (nfPtr->refCount == 0) {
/*
* Well nobody's using this named font, so don't have to tell any
@@ -858,13 +849,13 @@ UpdateDependentFonts(
cacheHashPtr = Tcl_FirstHashEntry(&fiPtr->fontCache, &search);
while (cacheHashPtr != NULL) {
- for (fontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr);
+ for (fontPtr = Tcl_GetHashValue(cacheHashPtr);
fontPtr != NULL; fontPtr = fontPtr->nextPtr) {
if (fontPtr->namedHashPtr == namedHashPtr) {
TkpGetFontFromAttributes(fontPtr, tkwin, &nfPtr->fa);
if (fiPtr->updatePending == 0) {
fiPtr->updatePending = 1;
- Tcl_DoWhenIdle(TheWorldHasChanged, (ClientData) fiPtr);
+ Tcl_DoWhenIdle(TheWorldHasChanged, fiPtr);
}
}
}
@@ -876,11 +867,9 @@ static void
TheWorldHasChanged(
ClientData clientData) /* Info about application's fonts. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = clientData;
- fiPtr = (TkFontInfo *) clientData;
fiPtr->updatePending = 0;
-
RecomputeWidgets(fiPtr->mainPtr->winPtr);
}
@@ -888,10 +877,11 @@ static void
RecomputeWidgets(
TkWindow *winPtr) /* Window to which command is sent. */
{
- Tk_ClassWorldChangedProc *proc;
- proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
+ Tk_ClassWorldChangedProc *proc =
+ Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
+
if (proc != NULL) {
- (*proc)(winPtr->instanceData);
+ proc(winPtr->instanceData);
}
/*
@@ -949,17 +939,14 @@ TkCreateNamedFont(
const char *name, /* Name for the new named font. */
TkFontAttributes *faPtr) /* Attributes for the new named font. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
Tcl_HashEntry *namedHashPtr;
int isNew;
NamedFont *nfPtr;
- fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
-
namedHashPtr = Tcl_CreateHashEntry(&fiPtr->namedTable, name, &isNew);
-
if (!isNew) {
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ nfPtr = Tcl_GetHashValue(namedHashPtr);
if (nfPtr->deletePending == 0) {
if (interp) {
Tcl_AppendResult(interp, "named font \"", name,
@@ -980,7 +967,7 @@ TkCreateNamedFont(
return TCL_OK;
}
- nfPtr = (NamedFont *) ckalloc(sizeof(NamedFont));
+ nfPtr = ckalloc(sizeof(NamedFont));
nfPtr->deletePending = 0;
Tcl_SetHashValue(namedHashPtr, nfPtr);
nfPtr->fa = *faPtr;
@@ -1004,14 +991,12 @@ int
TkDeleteNamedFont(
Tcl_Interp *interp, /* Interp for error return (can be NULL). */
Tk_Window tkwin, /* A window associated with interp. */
- CONST char *name) /* Name for the new named font. */
+ const char *name) /* Name for the new named font. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
NamedFont *nfPtr;
Tcl_HashEntry *namedHashPtr;
- fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
-
namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, name);
if (namedHashPtr == NULL) {
if (interp) {
@@ -1020,12 +1005,12 @@ TkDeleteNamedFont(
}
return TCL_ERROR;
}
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ nfPtr = Tcl_GetHashValue(namedHashPtr);
if (nfPtr->refCount != 0) {
nfPtr->deletePending = 1;
} else {
Tcl_DeleteHashEntry(namedHashPtr);
- ckfree((char *) nfPtr);
+ ckfree(nfPtr);
}
return TCL_OK;
}
@@ -1062,7 +1047,7 @@ Tk_GetFont(
Tk_Font tkfont;
Tcl_Obj *strPtr;
- strPtr = Tcl_NewStringObj((char *) string, -1);
+ strPtr = Tcl_NewStringObj(string, -1);
Tcl_IncrRefCount(strPtr);
tkfont = Tk_AllocFontFromObj(interp, tkwin, strPtr);
Tcl_DecrRefCount(strPtr);
@@ -1098,19 +1083,17 @@ Tk_AllocFontFromObj(
Tcl_Obj *objPtr) /* Object describing font, as: named font,
* native format, or parseable string. */
{
- TkFontInfo *fiPtr;
+ TkFontInfo *fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
Tcl_HashEntry *cacheHashPtr, *namedHashPtr;
TkFont *fontPtr, *firstFontPtr, *oldFontPtr;
int isNew, descent;
NamedFont *nfPtr;
- fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
if (objPtr->typePtr != &tkFontObjType) {
SetFontFromAny(interp, objPtr);
}
- oldFontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1;
-
+ oldFontPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (oldFontPtr != NULL) {
if (oldFontPtr->resourceRefCount == 0) {
/*
@@ -1118,7 +1101,7 @@ Tk_AllocFontFromObj(
* longer in use. Clear the reference.
*/
- FreeFontObjProc(objPtr);
+ FreeFontObj(objPtr);
oldFontPtr = NULL;
} else if (Tk_Screen(tkwin) == oldFontPtr->screen) {
oldFontPtr->resourceRefCount++;
@@ -1134,18 +1117,18 @@ Tk_AllocFontFromObj(
isNew = 0;
if (oldFontPtr != NULL) {
cacheHashPtr = oldFontPtr->cacheHashPtr;
- FreeFontObjProc(objPtr);
+ FreeFontObj(objPtr);
} else {
cacheHashPtr = Tcl_CreateHashEntry(&fiPtr->fontCache,
Tcl_GetString(objPtr), &isNew);
}
- firstFontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr);
+ firstFontPtr = Tcl_GetHashValue(cacheHashPtr);
for (fontPtr = firstFontPtr; (fontPtr != NULL);
fontPtr = fontPtr->nextPtr) {
if (Tk_Screen(tkwin) == fontPtr->screen) {
fontPtr->resourceRefCount++;
fontPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = fontPtr;
return (Tk_Font) fontPtr;
}
}
@@ -1161,7 +1144,7 @@ Tk_AllocFontFromObj(
* Construct a font based on a named font.
*/
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ nfPtr = Tcl_GetHashValue(namedHashPtr);
nfPtr->refCount++;
fontPtr = TkpGetFontFromAttributes(NULL, tkwin, &nfPtr->fa);
@@ -1253,7 +1236,7 @@ Tk_AllocFontFromObj(
}
}
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = fontPtr;
return (Tk_Font) fontPtr;
}
@@ -1278,7 +1261,8 @@ Tk_AllocFontFromObj(
Tk_Font
Tk_GetFontFromObj(
- Tk_Window tkwin, /* The window that the font will be used in. */
+ Tk_Window tkwin, /* The window that the font will be used
+ * in. */
Tcl_Obj *objPtr) /* The object from which to get the font. */
{
TkFontInfo *fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
@@ -1289,8 +1273,7 @@ Tk_GetFontFromObj(
SetFontFromAny(NULL, objPtr);
}
- fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1;
-
+ fontPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (fontPtr != NULL) {
if (fontPtr->resourceRefCount == 0) {
/*
@@ -1298,7 +1281,7 @@ Tk_GetFontFromObj(
* longer in use. Clear the reference.
*/
- FreeFontObjProc(objPtr);
+ FreeFontObj(objPtr);
fontPtr = NULL;
} else if (Tk_Screen(tkwin) == fontPtr->screen) {
return (Tk_Font) fontPtr;
@@ -1312,16 +1295,16 @@ Tk_GetFontFromObj(
if (fontPtr != NULL) {
hashPtr = fontPtr->cacheHashPtr;
- FreeFontObjProc(objPtr);
+ FreeFontObj(objPtr);
} else {
hashPtr = Tcl_FindHashEntry(&fiPtr->fontCache, Tcl_GetString(objPtr));
}
if (hashPtr != NULL) {
- for (fontPtr = (TkFont *) Tcl_GetHashValue(hashPtr); fontPtr != NULL;
+ for (fontPtr = Tcl_GetHashValue(hashPtr); fontPtr != NULL;
fontPtr = fontPtr->nextPtr) {
if (Tk_Screen(tkwin) == fontPtr->screen) {
fontPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = fontPtr;
return (Tk_Font) fontPtr;
}
}
@@ -1363,7 +1346,7 @@ SetFontFromAny(
Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &tkFontObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
@@ -1394,9 +1377,8 @@ const char *
Tk_NameOfFont(
Tk_Font tkfont) /* Font whose name is desired. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
- fontPtr = (TkFont *) tkfont;
return fontPtr->cacheHashPtr->key.string;
}
@@ -1421,13 +1403,12 @@ void
Tk_FreeFont(
Tk_Font tkfont) /* Font to be released. */
{
- TkFont *fontPtr, *prevPtr;
+ TkFont *fontPtr = (TkFont *) tkfont, *prevPtr;
NamedFont *nfPtr;
- if (tkfont == NULL) {
+ if (fontPtr == NULL) {
return;
}
- fontPtr = (TkFont *) tkfont;
fontPtr->resourceRefCount--;
if (fontPtr->resourceRefCount > 0) {
return;
@@ -1438,15 +1419,15 @@ Tk_FreeFont(
* the named font and free it if no-one else is using it.
*/
- nfPtr = (NamedFont *) Tcl_GetHashValue(fontPtr->namedHashPtr);
+ nfPtr = Tcl_GetHashValue(fontPtr->namedHashPtr);
nfPtr->refCount--;
if ((nfPtr->refCount == 0) && (nfPtr->deletePending != 0)) {
Tcl_DeleteHashEntry(fontPtr->namedHashPtr);
- ckfree((char *) nfPtr);
+ ckfree(nfPtr);
}
}
- prevPtr = (TkFont *) Tcl_GetHashValue(fontPtr->cacheHashPtr);
+ prevPtr = Tcl_GetHashValue(fontPtr->cacheHashPtr);
if (prevPtr == fontPtr) {
if (fontPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(fontPtr->cacheHashPtr);
@@ -1462,7 +1443,7 @@ Tk_FreeFont(
TkpDeleteFont(fontPtr);
if (fontPtr->objRefCount == 0) {
- ckfree((char *) fontPtr);
+ ckfree(fontPtr);
}
}
@@ -1496,7 +1477,7 @@ Tk_FreeFontFromObj(
/*
*---------------------------------------------------------------------------
*
- * FreeFontObjProc --
+ * FreeFontObjProc, FreeFontObj --
*
* This proc is called to release an object reference to a font. Called
* when the object's internal rep is released or when the cached fontPtr
@@ -1516,12 +1497,20 @@ static void
FreeFontObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- TkFont *fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1;
+ FreeFontObj(objPtr);
+ objPtr->typePtr = NULL;
+}
+
+static void
+FreeFontObj(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
+{
+ TkFont *fontPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (fontPtr != NULL) {
fontPtr->objRefCount--;
if ((fontPtr->resourceRefCount == 0) && (fontPtr->objRefCount == 0)) {
- ckfree((char *) fontPtr);
+ ckfree(fontPtr);
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
@@ -1550,10 +1539,10 @@ DupFontObjProc(
Tcl_Obj *srcObjPtr, /* The object we are copying from. */
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
- TkFont *fontPtr = (TkFont *) srcObjPtr->internalRep.twoPtrValue.ptr1;
+ TkFont *fontPtr = srcObjPtr->internalRep.twoPtrValue.ptr1;
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = fontPtr;
if (fontPtr != NULL) {
fontPtr->objRefCount++;
@@ -1584,9 +1573,8 @@ Tk_FontId(
Tk_Font tkfont) /* Font that is going to be selected into
* GC. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
- fontPtr = (TkFont *) tkfont;
return fontPtr->fid;
}
@@ -1617,9 +1605,8 @@ Tk_GetFontMetrics(
Tk_FontMetrics *fmPtr) /* Pointer to structure in which font metrics
* for tkfont will be stored. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
- fontPtr = (TkFont *) tkfont;
fmPtr->ascent = fontPtr->fm.ascent;
fmPtr->descent = fontPtr->fm.descent;
fmPtr->linespace = fontPtr->fm.ascent + fontPtr->fm.descent;
@@ -1659,13 +1646,12 @@ Tk_PostscriptFontName(
* which the name of the Postscript font that
* corresponds to tkfont will be appended. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
Tk_Uid family, weightString, slantString;
char *src, *dest;
int upper, len;
len = Tcl_DStringLength(dsPtr);
- fontPtr = (TkFont *) tkfont;
/*
* Convert the case-insensitive Tk_Font family name to the case-sensitive
@@ -1891,19 +1877,17 @@ TkUnderlineCharsInContext(
int lastByte) /* Index of first byte after the last
* character. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
int startX, endX;
- fontPtr = (TkFont *) tkfont;
-
TkpMeasureCharsInContext(tkfont, string, numBytes, 0, firstByte, -1, 0,
&startX);
TkpMeasureCharsInContext(tkfont, string, numBytes, 0, lastByte, -1, 0,
&endX);
XFillRectangle(display, drawable, gc, x + startX,
- y + fontPtr->underlinePos, (unsigned int) (endX - startX),
- (unsigned int) fontPtr->underlineHeight);
+ y + fontPtr->underlinePos, (unsigned) (endX - startX),
+ (unsigned) fontPtr->underlineHeight);
}
/*
@@ -1954,7 +1938,7 @@ Tk_ComputeTextLayout(
int *widthPtr, /* Filled with width of string. */
int *heightPtr) /* Filled with height of string. */
{
- TkFont *fontPtr;
+ TkFont *fontPtr = (TkFont *) tkfont;
const char *start, *end, *special;
int n, y, bytesThisChunk, maxChunks, curLine, layoutHeight;
int baseline, height, curX, newX, maxWidth, *lineLengths;
@@ -1965,7 +1949,6 @@ Tk_ComputeTextLayout(
Tcl_DStringInit(&lineBuffer);
- fontPtr = (TkFont *) tkfont;
if ((fontPtr == NULL) || (string == NULL)) {
if (widthPtr != NULL) {
*widthPtr = 0;
@@ -1989,8 +1972,8 @@ Tk_ComputeTextLayout(
maxChunks = 1;
- layoutPtr = (TextLayout *)
- ckalloc(sizeof(TextLayout) + (maxChunks-1) * sizeof(LayoutChunk));
+ layoutPtr = ckalloc(sizeof(TextLayout)
+ + (maxChunks-1) * sizeof(LayoutChunk));
layoutPtr->tkfont = tkfont;
layoutPtr->string = string;
layoutPtr->numChunks = 0;
@@ -2243,11 +2226,10 @@ void
Tk_FreeTextLayout(
Tk_TextLayout textLayout) /* The text layout to be released. */
{
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr = (TextLayout *) textLayout;
- layoutPtr = (TextLayout *) textLayout;
if (layoutPtr != NULL) {
- ckfree((char *) layoutPtr);
+ ckfree(layoutPtr);
}
}
@@ -2275,7 +2257,8 @@ void
Tk_DrawTextLayout(
Display *display, /* Display on which to draw. */
Drawable drawable, /* Window or pixmap in which to draw. */
- GC gc, /* Graphics context to use for drawing text. */
+ GC gc, /* Graphics context to use for drawing
+ * text. */
Tk_TextLayout layout, /* Layout information, from a previous call to
* Tk_ComputeTextLayout(). */
int x, int y, /* Upper-left hand corner of rectangle in
@@ -2287,13 +2270,11 @@ Tk_DrawTextLayout(
* draw from the given text item. A number < 0
* means to draw all characters. */
{
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr = (TextLayout *) layout;
int i, numDisplayChars, drawX;
- const char *firstByte;
- const char *lastByte;
+ const char *firstByte, *lastByte;
LayoutChunk *chunkPtr;
- layoutPtr = (TextLayout *) layout;
if (layoutPtr == NULL) {
return;
}
@@ -2318,9 +2299,78 @@ Tk_DrawTextLayout(
numDisplayChars = lastChar;
}
lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars);
- Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont,
- firstByte, lastByte - firstByte,
- x + chunkPtr->x + drawX, y + chunkPtr->y);
+ Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, firstByte,
+ lastByte - firstByte, x+chunkPtr->x+drawX, y+chunkPtr->y);
+ }
+ firstChar -= chunkPtr->numChars;
+ lastChar -= chunkPtr->numChars;
+ if (lastChar <= 0) {
+ break;
+ }
+ chunkPtr++;
+ }
+}
+
+void
+TkDrawAngledTextLayout(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context to use for drawing
+ * text. */
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y, /* Upper-left hand corner of rectangle in
+ * which to draw (pixels). */
+ double angle,
+ int firstChar, /* The index of the first character to draw
+ * from the given text item. 0 specfies the
+ * beginning. */
+ int lastChar) /* The index just after the last character to
+ * draw from the given text item. A number < 0
+ * means to draw all characters. */
+{
+ TextLayout *layoutPtr = (TextLayout *) layout;
+ int i, numDisplayChars, drawX;
+ const char *firstByte, *lastByte;
+ LayoutChunk *chunkPtr;
+ double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
+
+ if (layoutPtr == NULL) {
+ return;
+ }
+
+ if (lastChar < 0) {
+ lastChar = 100000000;
+ }
+ chunkPtr = layoutPtr->chunks;
+ for (i = 0; i < layoutPtr->numChunks; i++) {
+ numDisplayChars = chunkPtr->numDisplayChars;
+ if ((numDisplayChars > 0) && (firstChar < numDisplayChars)) {
+ double dx, dy;
+
+ if (firstChar <= 0) {
+ drawX = 0;
+ firstChar = 0;
+ firstByte = chunkPtr->start;
+ } else {
+ firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar);
+ Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start,
+ firstByte - chunkPtr->start, -1, 0, &drawX);
+ }
+ if (lastChar < numDisplayChars) {
+ numDisplayChars = lastChar;
+ }
+ lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars);
+ dx = cosA * (chunkPtr->x + drawX) + sinA * (chunkPtr->y);
+ dy = -sinA * (chunkPtr->x + drawX) + cosA * (chunkPtr->y);
+ if (angle == 0.0) {
+ Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont,
+ firstByte, lastByte - firstByte,
+ (int)(x + dx), (int)(y + dy));
+ } else {
+ TkDrawAngledChars(display, drawable, gc, layoutPtr->tkfont,
+ firstByte, lastByte - firstByte, x+dx, y+dy, angle);
+ }
}
firstChar -= chunkPtr->numChars;
lastChar -= chunkPtr->numChars;
@@ -2366,18 +2416,79 @@ Tk_UnderlineTextLayout(
int underline) /* Index of the single character to underline,
* or -1 for no underline. */
{
- TextLayout *layoutPtr;
- TkFont *fontPtr;
int xx, yy, width, height;
if ((Tk_CharBbox(layout, underline, &xx, &yy, &width, &height) != 0)
&& (width != 0)) {
- layoutPtr = (TextLayout *) layout;
- fontPtr = (TkFont *) layoutPtr->tkfont;
+ TextLayout *layoutPtr = (TextLayout *) layout;
+ TkFont *fontPtr = (TkFont *) layoutPtr->tkfont;
XFillRectangle(display, drawable, gc, x + xx,
y + yy + fontPtr->fm.ascent + fontPtr->underlinePos,
- (unsigned int) width, (unsigned int) fontPtr->underlineHeight);
+ (unsigned) width, (unsigned) fontPtr->underlineHeight);
+ }
+}
+
+void
+TkUnderlineAngledTextLayout(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context to use for drawing
+ * text. */
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y, /* Upper-left hand corner of rectangle in
+ * which to draw (pixels). */
+ double angle,
+ int underline) /* Index of the single character to underline,
+ * or -1 for no underline. */
+{
+ int xx, yy, width, height;
+
+ if (angle == 0.0) {
+ Tk_UnderlineTextLayout(display, drawable, gc, layout, x,y, underline);
+ return;
+ }
+
+ if ((Tk_CharBbox(layout, underline, &xx, &yy, &width, &height) != 0)
+ && (width != 0)) {
+ TextLayout *layoutPtr = (TextLayout *) layout;
+ TkFont *fontPtr = (TkFont *) layoutPtr->tkfont;
+ double sinA = sin(angle*PI/180), cosA = cos(angle*PI/180);
+ double dy = yy + fontPtr->fm.ascent + fontPtr->underlinePos;
+ XPoint points[5];
+
+ /*
+ * Note that we're careful to only round a double value once, which
+ * minimizes roundoff errors.
+ */
+
+ points[0].x = x + ROUND16(xx*cosA + dy*sinA);
+ points[0].y = y + ROUND16(dy*cosA - xx*sinA);
+ points[1].x = x + ROUND16(xx*cosA + dy*sinA + width*cosA);
+ points[1].y = y + ROUND16(dy*cosA - xx*sinA - width*sinA);
+ if (fontPtr->underlineHeight == 1) {
+ /*
+ * Thin underlines look better when rotated when drawn as a line
+ * rather than a rectangle; the rasterizer copes better.
+ */
+
+ XDrawLines(display, drawable, gc, points, 2, CoordModeOrigin);
+ } else {
+ points[2].x = x + ROUND16(xx*cosA + dy*sinA + width*cosA
+ + fontPtr->underlineHeight*sinA);
+ points[2].y = y + ROUND16(dy*cosA - xx*sinA - width*sinA
+ + fontPtr->underlineHeight*cosA);
+ points[3].x = x + ROUND16(xx*cosA + dy*sinA
+ + fontPtr->underlineHeight*sinA);
+ points[3].y = y + ROUND16(dy*cosA - xx*sinA
+ + fontPtr->underlineHeight*cosA);
+ points[4].x = points[0].x;
+ points[4].y = points[0].y;
+ XFillPolygon(display, drawable, gc, points, 5, Complex,
+ CoordModeOrigin);
+ XDrawLines(display, drawable, gc, points, 5, CoordModeOrigin);
+ }
}
}
@@ -2421,7 +2532,7 @@ Tk_PointToChar(
* to the upper-left corner of the text
* layout. */
{
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr = (TextLayout *) layout;
LayoutChunk *chunkPtr, *lastPtr;
TkFont *fontPtr;
int i, n, dummy, baseline, pos, numChars;
@@ -2439,7 +2550,6 @@ Tk_PointToChar(
* Find which line contains the point.
*/
- layoutPtr = (TextLayout *) layout;
fontPtr = (TkFont *) layoutPtr->tkfont;
lastPtr = chunkPtr = layoutPtr->chunks;
numChars = 0;
@@ -2486,8 +2596,7 @@ Tk_PointToChar(
return numChars;
}
n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start,
- chunkPtr->numBytes, x - chunkPtr->x,
- 0, &dummy);
+ chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy);
return numChars + Tcl_NumUtfChars(chunkPtr->start, n);
}
numChars += chunkPtr->numChars;
@@ -2570,7 +2679,7 @@ Tk_CharBbox(
* bounding box for the character specified by
* index, if non-NULL. */
{
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr = (TextLayout *) layout;
LayoutChunk *chunkPtr;
int i, x = 0, w;
Tk_Font tkfont;
@@ -2581,7 +2690,6 @@ Tk_CharBbox(
return 0;
}
- layoutPtr = (TextLayout *) layout;
chunkPtr = layoutPtr->chunks;
tkfont = layoutPtr->tkfont;
fontPtr = (TkFont *) tkfont;
@@ -2682,11 +2790,10 @@ Tk_DistanceToTextLayout(
* (in pixels). */
{
int i, x1, x2, y1, y2, xDiff, yDiff, dist, minDist, ascent, descent;
+ TextLayout *layoutPtr = (TextLayout *) layout;
LayoutChunk *chunkPtr;
- TextLayout *layoutPtr;
TkFont *fontPtr;
- layoutPtr = (TextLayout *) layout;
fontPtr = (TkFont *) layoutPtr->tkfont;
ascent = fontPtr->fm.ascent;
descent = fontPtr->fm.descent;
@@ -2770,7 +2877,7 @@ Tk_IntersectTextLayout(
* rectangular area, in pixels. */
{
int result, i, x1, y1, x2, y2;
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr = (TextLayout *) layout;
LayoutChunk *chunkPtr;
TkFont *fontPtr;
int left, top, right, bottom;
@@ -2782,7 +2889,6 @@ Tk_IntersectTextLayout(
* and see if they were all inside or all outside.
*/
- layoutPtr = (TextLayout *) layout;
chunkPtr = layoutPtr->chunks;
fontPtr = (TkFont *) layoutPtr->tkfont;
@@ -2793,10 +2899,11 @@ Tk_IntersectTextLayout(
result = 0;
for (i = 0; i < layoutPtr->numChunks; i++) {
- if (chunkPtr->start[0] == '\n') {
+ if ((chunkPtr->start[0] == '\n') || (chunkPtr->numBytes==0)) {
/*
- * Newline characters are not counted when computing area
- * intersection (but tab characters would still be considered).
+ * Newline characters and empty chunks are not counted when
+ * computing area intersection (but tab characters would still be
+ * considered).
*/
chunkPtr++;
@@ -2830,6 +2937,263 @@ Tk_IntersectTextLayout(
/*
*---------------------------------------------------------------------------
*
+ * TkIntersectAngledTextLayout --
+ *
+ * Determines whether a text layout that has been turned by an angle
+ * about its top-left coordinae lies entirely inside, entirely outside,
+ * or overlaps a given rectangle. Non-displaying space characters that
+ * occur at the end of individual lines in the text layout are ignored
+ * for intersection calculations.
+ *
+ * Results:
+ * The return value is -1 if the text layout is entirely outside of the
+ * rectangle, 0 if it overlaps, and 1 if it is entirely inside of the
+ * rectangle.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static inline int
+PointInQuadrilateral(
+ double qx[],
+ double qy[],
+ double x,
+ double y)
+{
+ int i;
+
+ for (i=0 ; i<4 ; i++) {
+ double sideDX = qx[(i+1)%4] - qx[i];
+ double sideDY = qy[(i+1)%4] - qy[i];
+ double dx = x - qx[i];
+ double dy = y - qy[i];
+
+ if (sideDX*dy < sideDY*dx) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static inline int
+sign(
+ double value)
+{
+ return (value < 0.0) ? -1 : (value > 0.0) ? 1 : 0;
+}
+
+static inline int
+SidesIntersect(
+ double ax1, double ay1, double ax2, double ay2,
+ double bx1, double by1, double bx2, double by2)
+{
+#if 0
+/* http://www.freelunchdesign.com/cgi-bin/codwiki.pl?DiscussionTopics/CollideMeUpBaby */
+
+ double a1, b1, c1, a2, b2, c2, r1, r2, r3, r4, denom;
+
+ a1 = ay2 - ay1;
+ b1 = ax1 - ax2;
+ c1 = (ax2 * ay1) - (ax1 * ay2);
+ r3 = (a1 * bx1) + (b1 * by1) + c1;
+ r4 = (a1 * bx2) + (b1 * by2) + c1;
+ if ((r3 != 0.0) && (r4 != 0.0) && (r3*r4 > 0.0)) {
+ return 0;
+ }
+
+ a2 = by2 - by1;
+ b2 = bx1 - bx2;
+ c2 = (bx2 * by1) - (bx1 * by2);
+ r1 = (a2 * ax1) + (b2 * ay1) + c2;
+ r2 = (a2 * ax2) + (b2 * ay2) + c2;
+ if ((r1 != 0.0) && (r2 != 0.0) && (r1*r2 > 0.0)) {
+ return 0;
+ }
+
+ denom = (a1 * b2) - (a2 * b1);
+ return (denom != 0.0);
+#else
+ /*
+ * A more efficient version. Two line segments intersect if, when seen
+ * from the perspective of one line, the two endpoints of the other
+ * segment lie on opposite sides of the line, and vice versa. "Lie on
+ * opposite sides" is computed by taking the cross products and seeing if
+ * they are of opposite signs.
+ */
+
+ double dx, dy, dx1, dy1;
+
+ dx = ax2 - ax1;
+ dy = ay2 - ay1;
+ dx1 = bx1 - ax1;
+ dy1 = by1 - ay1;
+ if ((dx*dy1-dy*dx1 > 0.0) == (dx*(by2-ay1)-dy*(bx2-ax1) > 0.0)) {
+ return 0;
+ }
+ dx = bx2 - bx1;
+ dy = by2 - by1;
+ if ((dy*dx1-dx*dy1 > 0.0) == (dx*(ay2-by1)-dy*(ax2-bx1) > 0.0)) {
+ return 0;
+ }
+ return 1;
+#endif
+}
+
+int
+TkIntersectAngledTextLayout(
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y, /* Upper-left hand corner, in pixels, of
+ * rectangular area to compare with text
+ * layout. Coordinates are with respect to the
+ * upper-left hand corner of the text layout
+ * itself. */
+ int width, int height, /* The width and height of the above
+ * rectangular area, in pixels. */
+ double angle)
+{
+ int i, x1, y1, x2, y2;
+ TextLayout *layoutPtr;
+ LayoutChunk *chunkPtr;
+ TkFont *fontPtr;
+ double c = cos(angle * PI/180.0), s = sin(angle * PI/180.0);
+ double rx[4], ry[4];
+
+ if (angle == 0.0) {
+ return Tk_IntersectTextLayout(layout, x, y, width, height);
+ }
+
+ /*
+ * Compute the coordinates of the rectangle, rotated into text layout
+ * space.
+ */
+
+ rx[0] = x*c - y*s;
+ ry[0] = y*c + x*s;
+ rx[1] = (x+width)*c - y*s;
+ ry[1] = y*c + (x+width)*s;
+ rx[2] = (x+width)*c - (y+height)*s;
+ ry[2] = (y+height)*c + (x+width)*s;
+ rx[3] = x*c - (y+height)*s;
+ ry[3] = (y+height)*c + x*s;
+
+ /*
+ * Want to know if all chunks are inside the rectangle, or if there is any
+ * overlap. First, we check to see if all chunks are inside; if and only
+ * if they are, we're in the "inside" case.
+ */
+
+ layoutPtr = (TextLayout *) layout;
+ chunkPtr = layoutPtr->chunks;
+ fontPtr = (TkFont *) layoutPtr->tkfont;
+
+ for (i=0 ; i<layoutPtr->numChunks ; i++,chunkPtr++) {
+ if (chunkPtr->start[0] == '\n') {
+ /*
+ * Newline characters are not counted when computing area
+ * intersection (but tab characters would still be considered).
+ */
+
+ continue;
+ }
+
+ x1 = chunkPtr->x;
+ y1 = chunkPtr->y - fontPtr->fm.ascent;
+ x2 = chunkPtr->x + chunkPtr->displayWidth;
+ y2 = chunkPtr->y + fontPtr->fm.descent;
+ if ( !PointInQuadrilateral(rx, ry, x1, y1) ||
+ !PointInQuadrilateral(rx, ry, x2, y1) ||
+ !PointInQuadrilateral(rx, ry, x2, y2) ||
+ !PointInQuadrilateral(rx, ry, x1, y2)) {
+ goto notInside;
+ }
+ }
+ return 1;
+
+ /*
+ * Next, check to see if all the points of the rectangle are inside a
+ * single chunk; if they are, we're in an "overlap" case.
+ */
+
+ notInside:
+ chunkPtr = layoutPtr->chunks;
+
+ for (i=0 ; i<layoutPtr->numChunks ; i++,chunkPtr++) {
+ double cx[4], cy[4];
+
+ if (chunkPtr->start[0] == '\n') {
+ /*
+ * Newline characters are not counted when computing area
+ * intersection (but tab characters would still be considered).
+ */
+
+ continue;
+ }
+
+ cx[0] = cx[3] = chunkPtr->x;
+ cy[0] = cy[1] = chunkPtr->y - fontPtr->fm.ascent;
+ cx[1] = cx[2] = chunkPtr->x + chunkPtr->displayWidth;
+ cy[2] = cy[3] = chunkPtr->y + fontPtr->fm.descent;
+ if ( !PointInQuadrilateral(cx, cy, rx[0], ry[0]) ||
+ !PointInQuadrilateral(cx, cy, rx[1], ry[1]) ||
+ !PointInQuadrilateral(cx, cy, rx[2], ry[2]) ||
+ !PointInQuadrilateral(cx, cy, rx[3], ry[3])) {
+ goto notReverseInside;
+ }
+ }
+ return 0;
+
+ /*
+ * If we're overlapping now, we must be partially in and out of at least
+ * one chunk. If that is the case, there must be one line segment of the
+ * rectangle that is touching or crossing a line segment of a chunk.
+ */
+
+ notReverseInside:
+ chunkPtr = layoutPtr->chunks;
+
+ for (i=0 ; i<layoutPtr->numChunks ; i++,chunkPtr++) {
+ int j;
+
+ if (chunkPtr->start[0] == '\n') {
+ /*
+ * Newline characters are not counted when computing area
+ * intersection (but tab characters would still be considered).
+ */
+
+ continue;
+ }
+
+ x1 = chunkPtr->x;
+ y1 = chunkPtr->y - fontPtr->fm.ascent;
+ x2 = chunkPtr->x + chunkPtr->displayWidth;
+ y2 = chunkPtr->y + fontPtr->fm.descent;
+
+ for (j=0 ; j<4 ; j++) {
+ int k = (j+1) % 4;
+
+ if ( SidesIntersect(rx[j],ry[j], rx[k],ry[k], x1,y1, x2,y1) ||
+ SidesIntersect(rx[j],ry[j], rx[k],ry[k], x2,y1, x2,y2) ||
+ SidesIntersect(rx[j],ry[j], rx[k],ry[k], x2,y2, x1,y2) ||
+ SidesIntersect(rx[j],ry[j], rx[k],ry[k], x1,y2, x1,y1)) {
+ return 0;
+ }
+ }
+ }
+
+ /*
+ * They must be wholly non-overlapping.
+ */
+
+ return -1;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
* Tk_TextLayoutToPostscript --
*
* Outputs the contents of a text layout in Postscript format. The set of
@@ -2870,16 +3234,14 @@ Tk_TextLayoutToPostscript(
Tcl_Interp *interp, /* Filled with Postscript code. */
Tk_TextLayout layout) /* The layout to be rendered. */
{
+ TextLayout *layoutPtr = (TextLayout *) layout;
#define MAXUSE 128
- char buf[MAXUSE+30], uindex[5] = "\0\0\0\0", one_char[5];
+ char buf[MAXUSE+30];
LayoutChunk *chunkPtr;
- int i, j, used, c, baseline, charsize;
+ int i, j, used, baseline, charsize;
Tcl_UniChar ch;
- const char *p, *last_p, *glyphname;
- TextLayout *layoutPtr;
- int bytecount=0;
+ const char *p, *glyphname;
- layoutPtr = (TextLayout *) layout;
chunkPtr = layoutPtr->chunks;
baseline = chunkPtr->y;
used = 0;
@@ -2903,54 +3265,66 @@ Tk_TextLayoutToPostscript(
p = chunkPtr->start;
for (j = 0; j < chunkPtr->numDisplayChars; j++) {
/*
- * INTL: For now we just treat the characters as binary data
- * and display the lower byte. Eventually this should be
- * revised to handle international postscript fonts.
+ * INTL: We only handle symbols that have an encoding as a
+ * flyph from the standard set defined by Adobe. The rest get
+ * punted. Eventually this should be revised to handle more
+ * sophsticiated 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.
- */
+ charsize = Tcl_UtfToUniChar(p, &ch);
+ p += charsize;
- sprintf(buf + used, "\\%03o", c);
- used += 4;
- } else {
- buf[used++] = c;
- }
+ if ((ch == '(') || (ch == ')') || (ch == '\\')
+ || (ch < 0x20)) {
+ /*
+ * 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", ch);
+ used += 4;
+ } else if (ch <= 0x7f) {
+ /*
+ * Normal ASCII character.
+ */
+
+ buf[used++] = (char) ch;
} else {
+ char uindex[5];
+
/*
- * This character doesn't belong to system character set.
- * So, we must use full glyph name.
+ * This character doesn't belong to the ASCII character
+ * set, so we use the full glyph name.
*/
sprintf(uindex, "%04X", ch); /* endianness? */
- glyphname = Tcl_GetVar2(interp,"::tk::psglyphs",uindex,0);
+ glyphname = Tcl_GetVar2(interp, "::tk::psglyphs", uindex,
+ 0);
if (glyphname) {
- if (used > 0 && buf [used-1] == '(') {
- --used;
+ if (used > 0 && buf[used-1] == '(') {
+ used--;
} else {
buf[used++] = ')';
}
buf[used++] = '/';
- while ((*glyphname) && (used < (MAXUSE+27))) {
- buf[used++] = *glyphname++ ;
+ while ((*glyphname) && (used < MAXUSE+27)) {
+ buf[used++] = *glyphname++;
}
buf[used++] = '(';
- }
+ } else {
+ /*
+ * No known mapping for the character into the space
+ * of PostScript glyphs. Ignore it. :-(
+ */
+#ifdef TK_DEBUG_POSTSCRIPT_OUTPUT
+ fprintf(stderr, "Warning: no mapping to PostScript "
+ "glyphs for \\u%04x\n", ch);
+#endif
+ }
}
if (used >= MAXUSE) {
buf[used] = '\0';
@@ -3011,7 +3385,7 @@ ConfigAttributesObj(
{
int i, n, index;
Tcl_Obj *optionPtr, *valuePtr;
- char *value;
+ const char *value;
for (i = 0; i < objc; i += 2) {
optionPtr = objv[i];
@@ -3110,9 +3484,7 @@ GetAttributeInfoObj(
{
int i, index, start, end;
const char *str;
- Tcl_Obj *optionPtr, *valuePtr, *resultPtr;
-
- resultPtr = Tcl_GetObjResult(interp);
+ Tcl_Obj *valuePtr, *resultPtr = NULL;
start = 0;
end = FONT_NUMFIELDS;
@@ -3126,6 +3498,9 @@ GetAttributeInfoObj(
}
valuePtr = NULL;
+ if (objPtr == NULL) {
+ resultPtr = Tcl_NewObj();
+ }
for (i = start; i < end; i++) {
switch (i) {
case FONT_FAMILY:
@@ -3159,10 +3534,11 @@ GetAttributeInfoObj(
Tcl_SetObjResult(interp, valuePtr);
return TCL_OK;
}
- optionPtr = Tcl_NewStringObj(fontOpt[i], -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, optionPtr);
+ Tcl_ListObjAppendElement(NULL, resultPtr,
+ Tcl_NewStringObj(fontOpt[i], -1));
Tcl_ListObjAppendElement(NULL, resultPtr, valuePtr);
}
+ Tcl_SetObjResult(interp, resultPtr);
return TCL_OK;
}
@@ -3204,7 +3580,7 @@ ParseFontNameObj(
char *dash;
int objc, result, i, n;
Tcl_Obj **objv;
- char *string;
+ const char *string;
TkInitFontAttributes(faPtr);
@@ -3367,7 +3743,7 @@ NewChunk(
if (layoutPtr->numChunks == maxChunks) {
maxChunks *= 2;
s = sizeof(TextLayout) + ((maxChunks - 1) * sizeof(LayoutChunk));
- layoutPtr = (TextLayout *) ckrealloc((char *) layoutPtr, s);
+ layoutPtr = ckrealloc(layoutPtr, s);
*layoutPtrPtr = layoutPtr;
*maxPtr = maxChunks;
@@ -3439,7 +3815,7 @@ TkFontParseXLFD(
}
Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, (char *) str, -1);
+ Tcl_DStringAppend(&ds, str, -1);
src = Tcl_DStringValue(&ds);
field[0] = src;
@@ -3710,7 +4086,7 @@ TkFontGetPoints(
*-------------------------------------------------------------------------
*/
-char **
+const char *const *
TkFontGetAliasList(
const char *faceName) /* Font name to test for aliases. */
{
@@ -3743,7 +4119,7 @@ TkFontGetAliasList(
*-------------------------------------------------------------------------
*/
-char ***
+const char *const *const *
TkFontGetFallbacks(void)
{
return fontFallbacks;
@@ -3768,7 +4144,7 @@ TkFontGetFallbacks(void)
*-------------------------------------------------------------------------
*/
-char **
+const char *const *
TkFontGetGlobalClass(void)
{
return globalFontClass;
@@ -3791,7 +4167,7 @@ TkFontGetGlobalClass(void)
*-------------------------------------------------------------------------
*/
-char **
+const char *const *
TkFontGetSymbolClass(void)
{
return symbolClass;
@@ -3819,7 +4195,7 @@ Tcl_Obj *
TkDebugFont(
Tk_Window tkwin, /* The window in which the font will be used
* (not currently used). */
- char *name) /* Name of the desired color. */
+ const char *name) /* Name of the desired color. */
{
TkFont *fontPtr;
Tcl_HashEntry *hashPtr;
@@ -3829,7 +4205,7 @@ TkDebugFont(
hashPtr = Tcl_FindHashEntry(
&((TkWindow *) tkwin)->mainPtr->fontInfoPtr->fontCache, name);
if (hashPtr != NULL) {
- fontPtr = (TkFont *) Tcl_GetHashValue(hashPtr);
+ fontPtr = Tcl_GetHashValue(hashPtr);
if (fontPtr == NULL) {
Tcl_Panic("TkDebugFont found empty hash table entry");
}
@@ -3875,7 +4251,7 @@ TkFontGetFirstTextLayout(
LayoutChunk *chunkPtr;
int numBytesInChunk;
- layoutPtr = (TextLayout *)layout;
+ layoutPtr = (TextLayout *) layout;
if ((layoutPtr==NULL) || (layoutPtr->numChunks==0)
|| (layoutPtr->chunks->numDisplayChars <= 0)) {
dst[0] = '\0';
diff --git a/generic/tkFont.h b/generic/tkFont.h
index ef6336c..b8de885 100644
--- a/generic/tkFont.h
+++ b/generic/tkFont.h
@@ -14,11 +14,6 @@
#ifndef _TKFONT
#define _TKFONT
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* The following structure keeps track of the attributes of a font. It can be
* used to keep track of either the desired attributes or the actual
@@ -187,24 +182,30 @@ typedef struct TkXLFDAttributes {
#define XLFD_NUMFIELDS 13 /* Number of fields in XLFD. */
/*
+ * Helper macro. How to correctly round a double to a short.
+ */
+
+#define ROUND16(x) ((short) floor((x) + 0.5))
+
+/*
* Low-level API exported by generic code to platform-specific code.
*/
#define TkInitFontAttributes(fa) memset((fa), 0, sizeof(TkFontAttributes));
#define TkInitXLFDAttributes(xa) memset((xa), 0, sizeof(TkXLFDAttributes));
-MODULE_SCOPE int TkFontParseXLFD(CONST char *string,
+MODULE_SCOPE int TkFontParseXLFD(const char *string,
TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr);
-MODULE_SCOPE char ** TkFontGetAliasList(CONST char *faceName);
-MODULE_SCOPE char *** TkFontGetFallbacks(void);
+MODULE_SCOPE const char *const * TkFontGetAliasList(const char *faceName);
+MODULE_SCOPE const char *const *const * TkFontGetFallbacks(void);
MODULE_SCOPE int TkFontGetPixels(Tk_Window tkwin, int size);
MODULE_SCOPE int TkFontGetPoints(Tk_Window tkwin, int size);
-MODULE_SCOPE char ** TkFontGetGlobalClass(void);
-MODULE_SCOPE char ** TkFontGetSymbolClass(void);
+MODULE_SCOPE const char *const * TkFontGetGlobalClass(void);
+MODULE_SCOPE const char *const * TkFontGetSymbolClass(void);
MODULE_SCOPE int TkCreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *name, TkFontAttributes *faPtr);
+ const char *name, TkFontAttributes *faPtr);
MODULE_SCOPE int TkDeleteNamedFont(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *name);
+ Tk_Window tkwin, const char *name);
MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout,
Tk_Font *font, char *dst);
@@ -215,12 +216,9 @@ MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout,
MODULE_SCOPE void TkpDeleteFont(TkFont *tkFontPtr);
MODULE_SCOPE void TkpFontPkgInit(TkMainInfo *mainPtr);
MODULE_SCOPE TkFont * TkpGetFontFromAttributes(TkFont *tkFontPtr,
- Tk_Window tkwin, CONST TkFontAttributes *faPtr);
+ Tk_Window tkwin, const TkFontAttributes *faPtr);
MODULE_SCOPE void TkpGetFontFamilies(Tcl_Interp *interp,
Tk_Window tkwin);
-MODULE_SCOPE TkFont * TkpGetNativeFont(Tk_Window tkwin, CONST char *name);
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
+MODULE_SCOPE TkFont * TkpGetNativeFont(Tk_Window tkwin, const char *name);
#endif /* _TKFONT */
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 8662dd3..c7544a6 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -162,7 +162,7 @@ enum labelanchor {
LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS
};
-static char *labelAnchorStrings[] = {
+static const char *const labelAnchorStrings[] = {
"e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws",
NULL
};
@@ -285,14 +285,14 @@ static const Tk_OptionSpec labelframeOptSpec[] = {
* Class names for widgets, indexed by FrameType.
*/
-static char *classNames[] = {"Frame", "Toplevel", "Labelframe"};
+static const char *const classNames[] = {"Frame", "Toplevel", "Labelframe"};
/*
* The following table maps from FrameType to the option template for that
* class of widgets.
*/
-static const Tk_OptionSpec * const optionSpecs[] = {
+static const Tk_OptionSpec *const optionSpecs[] = {
frameOptSpec,
toplevelOptSpec,
labelframeOptSpec,
@@ -304,10 +304,10 @@ static const Tk_OptionSpec * const optionSpecs[] = {
static void ComputeFrameGeometry(Frame *framePtr);
static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int CreateFrame(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST argv[],
- enum FrameType type, char *appName);
+ int objc, Tcl_Obj *const argv[],
+ enum FrameType type, const char *appName);
static void DestroyFrame(char *memPtr);
static void DestroyFramePartly(Frame *framePtr);
static void DisplayFrame(ClientData clientData);
@@ -322,7 +322,7 @@ static void FrameStructureProc(ClientData clientData,
XEvent *eventPtr);
static int FrameWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void FrameWorldChanged(ClientData instanceData);
static void MapFrame(ClientData clientData);
@@ -331,9 +331,11 @@ static void MapFrame(ClientData clientData);
* can be invoked from generic window code.
*/
-static Tk_ClassProcs frameClass = {
+static const Tk_ClassProcs frameClass = {
sizeof(Tk_ClassProcs), /* size */
- FrameWorldChanged /* worldChangedProc */
+ FrameWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -371,7 +373,7 @@ Tk_FrameObjCmd(
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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL);
}
@@ -381,7 +383,7 @@ Tk_ToplevelObjCmd(
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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL);
}
@@ -391,7 +393,7 @@ Tk_LabelframeObjCmd(
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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL);
}
@@ -420,16 +422,16 @@ TkCreateFrame(
ClientData clientData, /* Either NULL or pointer to option table. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- char **argv, /* Argument strings. */
+ const char *const *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 there is no main
+ const 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;
- Tcl_Obj **objv = (Tcl_Obj **) ckalloc((argc+1) * sizeof(Tcl_Obj **));
+ Tcl_Obj **objv = ckalloc((argc+1) * sizeof(Tcl_Obj **));
for (i=0; i<argc; i++) {
objv[i] = Tcl_NewStringObj(argv[i], -1);
@@ -441,7 +443,7 @@ TkCreateFrame(
for (i=0; i<argc; i++) {
Tcl_DecrRefCount(objv[i]);
}
- ckfree((char *) objv);
+ ckfree(objv);
return result;
}
@@ -450,9 +452,9 @@ CreateFrame(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
+ Tcl_Obj *const objv[], /* Argument objects. */
enum FrameType type, /* What widget type to create. */
- char *appName) /* Should only be non-NULL if there are no
+ const 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. */
@@ -461,14 +463,15 @@ CreateFrame(
Frame *framePtr;
Tk_OptionTable optionTable;
Tk_Window newWin;
- CONST char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
+ const char *className, *screenName, *visualName, *colormapName;
+ const char *arg, *useOption;
int i, c, length, depth;
unsigned int mask;
Colormap colormap;
Visual *visual;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -621,18 +624,18 @@ CreateFrame(
*/
if (type == TYPE_LABELFRAME) {
- framePtr = (Frame *) ckalloc(sizeof(Labelframe));
- memset((void *) framePtr, 0, (sizeof(Labelframe)));
+ framePtr = ckalloc(sizeof(Labelframe));
+ memset(framePtr, 0, sizeof(Labelframe));
} else {
- framePtr = (Frame *) ckalloc(sizeof(Frame));
- memset((void *) framePtr, 0, (sizeof(Frame)));
+ framePtr = ckalloc(sizeof(Frame));
+ memset(framePtr, 0, sizeof(Frame));
}
framePtr->tkwin = newWin;
framePtr->display = Tk_Display(newWin);
framePtr->interp = interp;
framePtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(newWin), FrameWidgetObjCmd,
- (ClientData) framePtr, FrameCmdDeletedProc);
+ Tk_PathName(newWin), FrameWidgetObjCmd, framePtr,
+ FrameCmdDeletedProc);
framePtr->optionTable = optionTable;
framePtr->type = type;
framePtr->colormap = colormap;
@@ -641,6 +644,7 @@ CreateFrame(
if (framePtr->type == TYPE_LABELFRAME) {
Labelframe *labelframePtr = (Labelframe *) framePtr;
+
labelframePtr->labelAnchor = LABELANCHOR_NW;
labelframePtr->textGC = None;
}
@@ -649,13 +653,13 @@ CreateFrame(
* Store backreference to frame widget in window structure.
*/
- Tk_SetClassProcs(newWin, &frameClass, (ClientData) framePtr);
+ Tk_SetClassProcs(newWin, &frameClass, framePtr);
mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
if (type == TYPE_TOPLEVEL) {
mask |= ActivateMask;
}
- Tk_CreateEventHandler(newWin, mask, FrameEventProc, (ClientData) framePtr);
+ Tk_CreateEventHandler(newWin, mask, FrameEventProc, framePtr);
if ((Tk_InitOptions(interp, (char *) framePtr, optionTable, newWin)
!= TCL_OK) ||
(ConfigureFrame(interp, framePtr, objc-2, objv+2) != TCL_OK)) {
@@ -671,9 +675,9 @@ CreateFrame(
}
}
if (type == TYPE_TOPLEVEL) {
- Tcl_DoWhenIdle(MapFrame, (ClientData) framePtr);
+ Tcl_DoWhenIdle(MapFrame, framePtr);
}
- Tcl_SetResult(interp, Tk_PathName(newWin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(newWin));
return TCL_OK;
error:
@@ -706,28 +710,28 @@ FrameWidgetObjCmd(
ClientData clientData, /* Information about frame widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *frameOptions[] = {
+ static const char *const frameOptions[] = {
"cget", "configure", NULL
};
enum options {
FRAME_CGET, FRAME_CONFIGURE
};
- register Frame *framePtr = (Frame *) clientData;
+ register Frame *framePtr = clientData;
int result = TCL_OK, index;
int c, i, length;
Tcl_Obj *objPtr;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], frameOptions, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) framePtr);
+ Tcl_Preserve(framePtr);
switch ((enum options) index) {
case FRAME_CGET:
if (objc != 3) {
@@ -740,22 +744,19 @@ FrameWidgetObjCmd(
if (objPtr == NULL) {
result = TCL_ERROR;
goto done;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case FRAME_CONFIGURE:
if (objc <= 3) {
objPtr = Tk_GetOptionInfo(interp, (char *) framePtr,
- framePtr->optionTable,
- (objc == 3) ? objv[2] : NULL,
+ framePtr->optionTable, (objc == 3) ? objv[2] : NULL,
framePtr->tkwin);
if (objPtr == NULL) {
result = TCL_ERROR;
goto done;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
/*
* Don't allow the options -class, -colormap, -container, -screen,
@@ -763,7 +764,7 @@ FrameWidgetObjCmd(
*/
for (i = 2; i < objc; i++) {
- char *arg = Tcl_GetStringFromObj(objv[i], &length);
+ const char *arg = Tcl_GetStringFromObj(objv[i], &length);
if (length < 2) {
continue;
}
@@ -781,9 +782,9 @@ FrameWidgetObjCmd(
|| ((c == 'v')
&& (strncmp(arg, "-visual", (unsigned)length) == 0))) {
- #ifdef SUPPORT_CONFIG_EMBEDDED
+#ifdef SUPPORT_CONFIG_EMBEDDED
if (c == 'u') {
- CONST char *string = Tcl_GetString(objv[i+1]);
+ const char *string = Tcl_GetString(objv[i+1]);
if (TkpUseWindow(interp, framePtr->tkwin,
string) != TCL_OK) {
result = TCL_ERROR;
@@ -795,12 +796,12 @@ FrameWidgetObjCmd(
result = TCL_ERROR;
goto done;
}
- #else
+#else
Tcl_AppendResult(interp, "can't modify ", arg,
" option after widget is created", NULL);
result = TCL_ERROR;
goto done;
- #endif
+#endif
}
}
result = ConfigureFrame(interp, framePtr, objc-2, objv+2);
@@ -809,7 +810,7 @@ FrameWidgetObjCmd(
}
done:
- Tcl_Release((ClientData) framePtr);
+ Tcl_Release(framePtr);
return result;
}
@@ -847,7 +848,7 @@ DestroyFrame(
if (framePtr->colormap != None) {
Tk_FreeColormap(framePtr->display, framePtr->colormap);
}
- ckfree((char *) framePtr);
+ ckfree(framePtr);
}
/*
@@ -876,8 +877,8 @@ DestroyFramePartly(
if (framePtr->type == TYPE_LABELFRAME && labelframePtr->labelWin != NULL) {
Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
- FrameStructureProc, (ClientData) framePtr);
- Tk_ManageGeometry(labelframePtr->labelWin, NULL, (ClientData) NULL);
+ FrameStructureProc, framePtr);
+ Tk_ManageGeometry(labelframePtr->labelWin, NULL, NULL);
if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) {
Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin);
}
@@ -915,7 +916,7 @@ ConfigureFrame(
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. */
+ Tcl_Obj *const objv[]) /* Arguments. */
{
Tk_SavedOptions savedOptions;
char *oldMenuName;
@@ -943,9 +944,8 @@ ConfigureFrame(
ckfree(oldMenuName);
}
return TCL_ERROR;
- } else {
- Tk_FreeSavedOptions(&savedOptions);
}
+ Tk_FreeSavedOptions(&savedOptions);
/*
* A few of the options require additional processing.
@@ -955,7 +955,7 @@ ConfigureFrame(
|| ((oldMenuName != NULL) && (framePtr->menuName == NULL))
|| ((oldMenuName != NULL) && (framePtr->menuName != NULL)
&& strcmp(oldMenuName, framePtr->menuName) != 0))
- && framePtr->type == TYPE_TOPLEVEL) {
+ && framePtr->type == TYPE_TOPLEVEL) {
TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName,
framePtr->menuName);
}
@@ -989,8 +989,8 @@ ConfigureFrame(
if (oldWindow != labelframePtr->labelWin) {
if (oldWindow != NULL) {
Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
- FrameStructureProc, (ClientData) framePtr);
- Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL);
+ FrameStructureProc, framePtr);
+ Tk_ManageGeometry(oldWindow, NULL, NULL);
Tk_UnmaintainGeometry(oldWindow, framePtr->tkwin);
Tk_UnmapWindow(oldWindow);
}
@@ -1011,7 +1011,7 @@ ConfigureFrame(
}
sibling = ancestor;
if (Tk_IsTopLevel(ancestor)) {
- badWindow:
+ badWindow:
Tcl_AppendResult(interp, "can't use ",
Tk_PathName(labelframePtr->labelWin),
" as label in this frame", NULL);
@@ -1026,10 +1026,9 @@ ConfigureFrame(
goto badWindow;
}
Tk_CreateEventHandler(labelframePtr->labelWin,
- StructureNotifyMask, FrameStructureProc,
- (ClientData) framePtr);
+ StructureNotifyMask, FrameStructureProc, framePtr);
Tk_ManageGeometry(labelframePtr->labelWin, &frameGeomType,
- (ClientData) framePtr);
+ framePtr);
/*
* If the frame is not parent to the label, make sure the
@@ -1043,8 +1042,7 @@ ConfigureFrame(
}
}
- FrameWorldChanged((ClientData) framePtr);
-
+ FrameWorldChanged(framePtr);
return TCL_OK;
}
@@ -1070,14 +1068,14 @@ static void
FrameWorldChanged(
ClientData instanceData) /* Information about widget. */
{
- Frame *framePtr = (Frame *) instanceData;
- Labelframe *labelframePtr = (Labelframe *) framePtr;
+ Frame *framePtr = instanceData;
+ Labelframe *labelframePtr = instanceData;
Tk_Window tkwin = framePtr->tkwin;
XGCValues gcValues;
GC gc;
int anyTextLabel, anyWindowLabel;
int bWidthLeft, bWidthRight, bWidthTop, bWidthBottom;
- char *labelText;
+ const char *labelText;
anyTextLabel = (framePtr->type == TYPE_LABELFRAME) &&
(labelframePtr->textPtr != NULL) &&
@@ -1110,14 +1108,17 @@ FrameWorldChanged(
if (anyTextLabel) {
labelText = Tcl_GetString(labelframePtr->textPtr);
Tk_FreeTextLayout(labelframePtr->textLayout);
- labelframePtr->textLayout = Tk_ComputeTextLayout(labelframePtr->tkfont,
+ labelframePtr->textLayout =
+ Tk_ComputeTextLayout(labelframePtr->tkfont,
labelText, -1, 0, TK_JUSTIFY_CENTER, 0,
- &labelframePtr->labelReqWidth, &labelframePtr->labelReqHeight);
+ &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);
+ labelframePtr->labelReqHeight =
+ Tk_ReqHeight(labelframePtr->labelWin);
}
/*
@@ -1210,7 +1211,7 @@ FrameWorldChanged(
if (Tk_IsMapped(tkwin)) {
if (!(framePtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr);
+ Tcl_DoWhenIdle(DisplayFrame, framePtr);
}
framePtr->flags |= REDRAW_PENDING;
}
@@ -1247,7 +1248,9 @@ ComputeFrameGeometry(
* We have nothing to do here unless there is a label.
*/
- if (framePtr->type != TYPE_LABELFRAME) return;
+ if (framePtr->type != TYPE_LABELFRAME) {
+ return;
+ }
if (labelframePtr->textPtr == NULL && labelframePtr->labelWin == NULL) {
return;
}
@@ -1273,10 +1276,14 @@ ComputeFrameGeometry(
if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
(labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
maxWidth -= padding;
- if (maxWidth < 1) maxWidth = 1;
+ if (maxWidth < 1) {
+ maxWidth = 1;
+ }
} else {
maxHeight -= padding;
- if (maxHeight < 1) maxHeight = 1;
+ if (maxHeight < 1) {
+ maxHeight = 1;
+ }
}
if (labelframePtr->labelBox.width > maxWidth) {
labelframePtr->labelBox.width = maxWidth;
@@ -1379,7 +1386,7 @@ static void
DisplayFrame(
ClientData clientData) /* Information about widget. */
{
- register Frame *framePtr = (Frame *) clientData;
+ register Frame *framePtr = clientData;
register Tk_Window tkwin = framePtr->tkwin;
int bdX1, bdY1, bdX2, bdY2, hlWidth;
Pixmap pixmap;
@@ -1416,7 +1423,9 @@ DisplayFrame(
* If -background is set to "", no interior is drawn.
*/
- if (framePtr->border == NULL) return;
+ if (framePtr->border == NULL) {
+ return;
+ }
if (framePtr->type != TYPE_LABELFRAME) {
/*
@@ -1547,7 +1556,8 @@ DisplayFrame(
|| (labelframePtr->labelBox.height !=
Tk_Height(labelframePtr->labelWin))) {
Tk_MoveResizeWindow(labelframePtr->labelWin,
- labelframePtr->labelBox.x, labelframePtr->labelBox.y,
+ labelframePtr->labelBox.x,
+ labelframePtr->labelBox.y,
labelframePtr->labelBox.width,
labelframePtr->labelBox.height);
}
@@ -1560,7 +1570,6 @@ DisplayFrame(
}
}
-
#ifndef TK_NO_DOUBLE_BUFFERING
/*
* Everything's been redisplayed; now copy the pixmap onto the screen
@@ -1602,7 +1611,7 @@ FrameEventProc(
ClientData clientData, /* Information about window. */
register XEvent *eventPtr) /* Information about event. */
{
- register Frame *framePtr = (Frame *) clientData;
+ register Frame *framePtr = clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
goto redraw;
@@ -1636,15 +1645,15 @@ FrameEventProc(
Tk_DeleteEventHandler(framePtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- FrameEventProc, (ClientData) framePtr);
+ FrameEventProc, framePtr);
framePtr->tkwin = NULL;
Tcl_DeleteCommandFromToken(framePtr->interp, framePtr->widgetCmd);
}
if (framePtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayFrame, (ClientData) framePtr);
+ Tcl_CancelIdleCall(DisplayFrame, framePtr);
}
- Tcl_CancelIdleCall(MapFrame, (ClientData) framePtr);
- Tcl_EventuallyFree((ClientData) framePtr, DestroyFrame);
+ Tcl_CancelIdleCall(MapFrame, framePtr);
+ Tcl_EventuallyFree(framePtr, DestroyFrame);
} else if (eventPtr->type == FocusIn) {
if (eventPtr->xfocus.detail != NotifyInferior) {
framePtr->flags |= GOT_FOCUS;
@@ -1667,7 +1676,7 @@ FrameEventProc(
redraw:
if ((framePtr->tkwin != NULL) && !(framePtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr);
+ Tcl_DoWhenIdle(DisplayFrame, framePtr);
framePtr->flags |= REDRAW_PENDING;
}
}
@@ -1694,7 +1703,7 @@ static void
FrameCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- Frame *framePtr = (Frame *) clientData;
+ Frame *framePtr = clientData;
Tk_Window tkwin = framePtr->tkwin;
if (framePtr->menuName != NULL) {
@@ -1745,7 +1754,7 @@ static void
MapFrame(
ClientData clientData) /* Pointer to frame structure. */
{
- Frame *framePtr = (Frame *) clientData;
+ Frame *framePtr = clientData;
/*
* Wait for all other background events to be processed before mapping
@@ -1754,7 +1763,7 @@ MapFrame(
* doesn't get a false idea of its desired geometry.
*/
- Tcl_Preserve((ClientData) framePtr);
+ Tcl_Preserve(framePtr);
while (1) {
if (Tcl_DoOneEvent(TCL_IDLE_EVENTS) == 0) {
break;
@@ -1766,12 +1775,12 @@ MapFrame(
*/
if (framePtr->tkwin == NULL) {
- Tcl_Release((ClientData) framePtr);
+ Tcl_Release(framePtr);
return;
}
}
Tk_MapWindow(framePtr->tkwin);
- Tcl_Release((ClientData) framePtr);
+ Tcl_Release(framePtr);
}
/*
@@ -1800,8 +1809,8 @@ TkInstallFrameMenu(
TkWindow *winPtr = (TkWindow *) tkwin;
if (winPtr->mainPtr != NULL) {
- Frame *framePtr;
- framePtr = (Frame*) winPtr->instanceData;
+ Frame *framePtr = winPtr->instanceData;
+
if (framePtr == NULL) {
Tcl_Panic("TkInstallFrameMenu couldn't get frame pointer");
}
@@ -1833,7 +1842,7 @@ FrameStructureProc(
ClientData clientData, /* Pointer to record describing frame. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Labelframe *labelframePtr = (Labelframe *) clientData;
+ Labelframe *labelframePtr = clientData;
if (eventPtr->type == DestroyNotify) {
/*
@@ -1843,7 +1852,7 @@ FrameStructureProc(
if (labelframePtr->frame.type == TYPE_LABELFRAME) {
labelframePtr->labelWin = NULL;
- FrameWorldChanged((ClientData) labelframePtr);
+ FrameWorldChanged(labelframePtr);
}
}
}
@@ -1871,9 +1880,9 @@ FrameRequestProc(
ClientData clientData, /* Pointer to record for frame. */
Tk_Window tkwin) /* Window that changed its desired size. */
{
- Frame *framePtr = (Frame *) clientData;
+ Frame *framePtr = clientData;
- FrameWorldChanged((ClientData) framePtr);
+ FrameWorldChanged(framePtr);
}
/*
@@ -1899,8 +1908,8 @@ FrameLostSlaveProc(
* stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- Frame *framePtr = (Frame *) clientData;
- Labelframe *labelframePtr = (Labelframe *) clientData;
+ Frame *framePtr = clientData;
+ Labelframe *labelframePtr = clientData;
/*
* This should only happen in a labelframe but it doesn't hurt to be
@@ -1909,40 +1918,47 @@ FrameLostSlaveProc(
if (labelframePtr->frame.type == TYPE_LABELFRAME) {
Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
- FrameStructureProc, (ClientData) labelframePtr);
+ FrameStructureProc, labelframePtr);
if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) {
Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin);
}
Tk_UnmapWindow(labelframePtr->labelWin);
labelframePtr->labelWin = NULL;
}
- FrameWorldChanged((ClientData) framePtr);
+ FrameWorldChanged(framePtr);
}
void
-TkMapTopFrame (tkwin)
- Tk_Window tkwin;
+TkMapTopFrame(
+ Tk_Window tkwin)
{
- Frame *framePtr = ((TkWindow*)tkwin)->instanceData;
+ Frame *framePtr = ((TkWindow *) tkwin)->instanceData;
Tk_OptionTable optionTable;
+
if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) {
framePtr->type = TYPE_TOPLEVEL;
- Tcl_DoWhenIdle(MapFrame, (ClientData)framePtr);
+ Tcl_DoWhenIdle(MapFrame, framePtr);
if (framePtr->menuName != NULL) {
TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL,
- framePtr->menuName);
+ framePtr->menuName);
}
} else if (!Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_TOPLEVEL) {
framePtr->type = TYPE_FRAME;
} else {
- /* Not a frame or toplevel, skip it */
+ /*
+ * Not a frame or toplevel, skip it.
+ */
+
return;
}
+
/*
- * The option table has already been created so
- * the cached pointer will be returned.
+ * The option table has already been created so the cached pointer will be
+ * returned.
*/
- optionTable = Tk_CreateOptionTable(framePtr->interp, optionSpecs[framePtr->type]);
+
+ optionTable = Tk_CreateOptionTable(framePtr->interp,
+ optionSpecs[framePtr->type]);
framePtr->optionTable = optionTable;
}
@@ -1969,7 +1985,7 @@ TkMapTopFrame (tkwin)
Tk_Window
TkToplevelWindowForCommand(
Tcl_Interp *interp,
- CONST char *cmdName)
+ const char *cmdName)
{
Tcl_CmdInfo cmdInfo;
Frame *framePtr;
@@ -1980,7 +1996,7 @@ TkToplevelWindowForCommand(
if (cmdInfo.objProc != FrameWidgetObjCmd) {
return NULL;
}
- framePtr = (Frame *) cmdInfo.objClientData;
+ framePtr = cmdInfo.objClientData;
if (framePtr->type != TYPE_TOPLEVEL) {
return NULL;
}
diff --git a/generic/tkGC.c b/generic/tkGC.c
index 800e4d3..5663ede 100644
--- a/generic/tkGC.c
+++ b/generic/tkGC.c
@@ -218,7 +218,7 @@ Tk_GetGC(
valueHashPtr = Tcl_CreateHashEntry(&dispPtr->gcValueTable,
(char *) &valueKey, &isNew);
if (!isNew) {
- gcPtr = (TkGC *) Tcl_GetHashValue(valueHashPtr);
+ gcPtr = Tcl_GetHashValue(valueHashPtr);
gcPtr->refCount++;
return gcPtr->gc;
}
@@ -228,7 +228,7 @@ Tk_GetGC(
* and add a new structure to the database.
*/
- gcPtr = (TkGC *) ckalloc(sizeof(TkGC));
+ gcPtr = ckalloc(sizeof(TkGC));
/*
* Find or make a drawable to use to specify the screen and depth of the
@@ -311,14 +311,14 @@ Tk_FreeGC(
if (idHashPtr == NULL) {
Tcl_Panic("Tk_FreeGC received unknown gc argument");
}
- gcPtr = (TkGC *) Tcl_GetHashValue(idHashPtr);
+ gcPtr = Tcl_GetHashValue(idHashPtr);
gcPtr->refCount--;
if (gcPtr->refCount == 0) {
Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
XFreeGC(gcPtr->display, gcPtr->gc);
Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
Tcl_DeleteHashEntry(idHashPtr);
- ckfree((char *) gcPtr);
+ ckfree(gcPtr);
}
}
@@ -349,7 +349,7 @@ TkGCCleanup(
for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search);
entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
- gcPtr = (TkGC *) Tcl_GetHashValue(entryPtr);
+ gcPtr = Tcl_GetHashValue(entryPtr);
/*
* This call is not needed, as it is only used on Unix to restore the
@@ -360,7 +360,7 @@ TkGCCleanup(
XFreeGC(gcPtr->display, gcPtr->gc);
Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
Tcl_DeleteHashEntry(entryPtr);
- ckfree((char *) gcPtr);
+ ckfree(gcPtr);
}
Tcl_DeleteHashTable(&dispPtr->gcValueTable);
Tcl_DeleteHashTable(&dispPtr->gcIdTable);
diff --git a/generic/tkGeometry.c b/generic/tkGeometry.c
index 4c8e4f8..2c6c113 100644
--- a/generic/tkGeometry.c
+++ b/generic/tkGeometry.c
@@ -84,7 +84,7 @@ void
Tk_ManageGeometry(
Tk_Window tkwin, /* Window whose geometry is to be managed by
* proc. */
- CONST Tk_GeomMgr *mgrPtr, /* Static structure describing the geometry
+ const Tk_GeomMgr *mgrPtr, /* Static structure describing the geometry
* manager. This structure must never go
* away. */
ClientData clientData) /* Arbitrary one-word argument to pass to
@@ -96,7 +96,7 @@ Tk_ManageGeometry(
&& ((winPtr->geomMgrPtr != mgrPtr)
|| (winPtr->geomData != clientData))
&& (winPtr->geomMgrPtr->lostSlaveProc != NULL)) {
- (*winPtr->geomMgrPtr->lostSlaveProc)(winPtr->geomData, tkwin);
+ winPtr->geomMgrPtr->lostSlaveProc(winPtr->geomData, tkwin);
}
winPtr->geomMgrPtr = mgrPtr;
@@ -152,7 +152,7 @@ Tk_GeometryRequest(
winPtr->reqHeight = reqHeight;
if ((winPtr->geomMgrPtr != NULL)
&& (winPtr->geomMgrPtr->requestProc != NULL)) {
- (*winPtr->geomMgrPtr->requestProc)(winPtr->geomData, tkwin);
+ winPtr->geomMgrPtr->requestProc(winPtr->geomData, tkwin);
}
}
@@ -304,6 +304,85 @@ Tk_SetMinimumRequestSize(
/*
*----------------------------------------------------------------------
*
+ * TkSetGeometryMaster --
+ *
+ * Set a geometry master for this window. Only one master may own
+ * a window at any time.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * The geometry master is recorded for the window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkSetGeometryMaster(
+ Tcl_Interp *interp, /* Current interpreter, for error. */
+ Tk_Window tkwin, /* Window that will have geometry master set. */
+ const char *master) /* The master identity. */
+{
+ register TkWindow *winPtr = (TkWindow *) tkwin;
+
+ if (winPtr->geometryMaster != NULL &&
+ strcmp(winPtr->geometryMaster, master) == 0) {
+ return TCL_OK;
+ }
+ if (winPtr->geometryMaster != NULL) {
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "cannot use geometry manager ", master,
+ " inside ", Tk_PathName(tkwin),
+ " which already has slaves managed by ",
+ winPtr->geometryMaster, NULL);
+ }
+ return TCL_ERROR;
+ }
+
+ winPtr->geometryMaster = ckalloc(strlen(master) + 1);
+ strcpy(winPtr->geometryMaster, master);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFreeGeometryMaster --
+ *
+ * Remove a geometry master for this window. Only one master may own
+ * a window at any time.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The geometry master is cleared for the window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFreeGeometryMaster(
+ Tk_Window tkwin, /* Window that will have geometry master cleared. */
+ const char *master) /* The master identity. */
+{
+ register TkWindow *winPtr = (TkWindow *) tkwin;
+
+ if (winPtr->geometryMaster != NULL &&
+ strcmp(winPtr->geometryMaster, master) != 0) {
+ Tcl_Panic("Trying to free %s from geometry manager %s",
+ winPtr->geometryMaster, master);
+ }
+ if (winPtr->geometryMaster != NULL) {
+ ckfree(winPtr->geometryMaster);
+ winPtr->geometryMaster = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_MaintainGeometry --
*
* This procedure is invoked by geometry managers to handle slaves whose
@@ -379,9 +458,9 @@ Tk_MaintainGeometry(
hPtr = Tcl_CreateHashEntry(&dispPtr->maintainHashTable,
(char *) master, &isNew);
if (!isNew) {
- masterPtr = (MaintainMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
} else {
- masterPtr = (MaintainMaster *) ckalloc(sizeof(MaintainMaster));
+ masterPtr = ckalloc(sizeof(MaintainMaster));
masterPtr->ancestor = master;
masterPtr->checkScheduled = 0;
masterPtr->slavePtr = NULL;
@@ -399,13 +478,13 @@ Tk_MaintainGeometry(
goto gotSlave;
}
}
- slavePtr = (MaintainSlave *) ckalloc(sizeof(MaintainSlave));
+ slavePtr = ckalloc(sizeof(MaintainSlave));
slavePtr->slave = slave;
slavePtr->master = master;
slavePtr->nextPtr = masterPtr->slavePtr;
masterPtr->slavePtr = slavePtr;
Tk_CreateEventHandler(slave, StructureNotifyMask, MaintainSlaveProc,
- (ClientData) slavePtr);
+ slavePtr);
/*
* Make sure that there are event handlers registered for all the windows
@@ -418,7 +497,7 @@ Tk_MaintainGeometry(
ancestor = Tk_Parent(ancestor)) {
if (ancestor == masterPtr->ancestor) {
Tk_CreateEventHandler(ancestor, StructureNotifyMask,
- MaintainMasterProc, (ClientData) masterPtr);
+ MaintainMasterProc, masterPtr);
masterPtr->ancestor = Tk_Parent(ancestor);
}
}
@@ -509,7 +588,7 @@ Tk_UnmaintainGeometry(
if (hPtr == NULL) {
return;
}
- masterPtr = (MaintainMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
slavePtr = masterPtr->slavePtr;
if (slavePtr->slave == slave) {
masterPtr->slavePtr = slavePtr->nextPtr;
@@ -526,23 +605,23 @@ Tk_UnmaintainGeometry(
}
}
Tk_DeleteEventHandler(slavePtr->slave, StructureNotifyMask,
- MaintainSlaveProc, (ClientData) slavePtr);
- ckfree((char *) slavePtr);
+ MaintainSlaveProc, slavePtr);
+ ckfree(slavePtr);
if (masterPtr->slavePtr == NULL) {
if (masterPtr->ancestor != NULL) {
for (ancestor = master; ; ancestor = Tk_Parent(ancestor)) {
Tk_DeleteEventHandler(ancestor, StructureNotifyMask,
- MaintainMasterProc, (ClientData) masterPtr);
+ MaintainMasterProc, masterPtr);
if (ancestor == masterPtr->ancestor) {
break;
}
}
}
if (masterPtr->checkScheduled) {
- Tcl_CancelIdleCall(MaintainCheckProc, (ClientData) masterPtr);
+ Tcl_CancelIdleCall(MaintainCheckProc, masterPtr);
}
Tcl_DeleteHashEntry(hPtr);
- ckfree((char *) masterPtr);
+ ckfree(masterPtr);
}
}
@@ -573,7 +652,7 @@ MaintainMasterProc(
* master window. */
XEvent *eventPtr) /* Describes what just happened. */
{
- MaintainMaster *masterPtr = (MaintainMaster *) clientData;
+ MaintainMaster *masterPtr = clientData;
MaintainSlave *slavePtr;
int done;
@@ -582,7 +661,7 @@ MaintainMasterProc(
|| (eventPtr->type == UnmapNotify)) {
if (!masterPtr->checkScheduled) {
masterPtr->checkScheduled = 1;
- Tcl_DoWhenIdle(MaintainCheckProc, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(MaintainCheckProc, masterPtr);
}
} else if (eventPtr->type == DestroyNotify) {
/*
@@ -627,7 +706,7 @@ MaintainSlaveProc(
* master-slave pair. */
XEvent *eventPtr) /* Describes what just happened. */
{
- MaintainSlave *slavePtr = (MaintainSlave *) clientData;
+ MaintainSlave *slavePtr = clientData;
if (eventPtr->type == DestroyNotify) {
Tk_UnmaintainGeometry(slavePtr->slave, slavePtr->master);
@@ -659,7 +738,7 @@ MaintainCheckProc(
ClientData clientData) /* Pointer to MaintainMaster structure for the
* master window. */
{
- MaintainMaster *masterPtr = (MaintainMaster *) clientData;
+ MaintainMaster *masterPtr = clientData;
MaintainSlave *slavePtr;
Tk_Window ancestor, parent;
int x, y, map;
diff --git a/generic/tkGet.c b/generic/tkGet.c
index 9fc0d50..bd63971 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.c
@@ -35,10 +35,10 @@ static void FreeUidThreadExitProc(ClientData clientData);
* used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj.
*/
-static CONST char *anchorStrings[] = {
+static const char *const anchorStrings[] = {
"n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL
};
-static CONST char *justifyStrings[] = {
+static const char *const justifyStrings[] = {
"left", "right", "center", NULL
};
@@ -101,7 +101,7 @@ Tk_GetAnchorFromObj(
int
Tk_GetAnchor(
Tcl_Interp *interp, /* Use this for error reporting. */
- CONST char *string, /* String describing a direction. */
+ const char *string, /* String describing a direction. */
Tk_Anchor *anchorPtr) /* Where to store Tk_Anchor corresponding to
* string. */
{
@@ -173,7 +173,7 @@ Tk_GetAnchor(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfAnchor(
Tk_Anchor anchor) /* Anchor for which identifying string is
* desired. */
@@ -214,7 +214,7 @@ Tk_NameOfAnchor(
int
Tk_GetJoinStyle(
Tcl_Interp *interp, /* Use this for error reporting. */
- CONST 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. */
{
@@ -258,7 +258,7 @@ Tk_GetJoinStyle(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfJoinStyle(
int join) /* Join style for which identifying string is
* desired. */
@@ -293,7 +293,7 @@ Tk_NameOfJoinStyle(
int
Tk_GetCapStyle(
Tcl_Interp *interp, /* Use this for error reporting. */
- CONST 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. */
{
@@ -337,7 +337,7 @@ Tk_GetCapStyle(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfCapStyle(
int cap) /* Cap style for which identifying string is
* desired. */
@@ -409,7 +409,7 @@ Tk_GetJustifyFromObj(
int
Tk_GetJustify(
Tcl_Interp *interp, /* Use this for error reporting. */
- CONST 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. */
{
@@ -454,7 +454,7 @@ Tk_GetJustify(
*--------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfJustify(
Tk_Justify justify) /* Justification style for which identifying
* string is desired. */
@@ -487,8 +487,9 @@ static void
FreeUidThreadExitProc(
ClientData clientData) /* Not used. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
Tcl_DeleteHashTable(&tsdPtr->uidTable);
tsdPtr->initialized = 0;
}
@@ -517,10 +518,10 @@ FreeUidThreadExitProc(
Tk_Uid
Tk_GetUid(
- CONST char *string) /* String to convert. */
+ const char *string) /* String to convert. */
{
int dummy;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashTable *tablePtr = &tsdPtr->uidTable;
@@ -559,7 +560,7 @@ Tk_GetScreenMM(
Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST char *string, /* String describing a screen distance. */
+ const char *string, /* String describing a screen distance. */
double *doublePtr) /* Place to store converted result. */
{
char *end;
@@ -633,7 +634,7 @@ Tk_GetPixels(
Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST 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;
@@ -658,7 +659,6 @@ Tk_GetPixels(
* string.
*
* Results:
-
* The return value is a standard Tcl return result. If TCL_OK is
* returned, then everything went well and the pixel distance is stored
* at *doublePtr; otherwise TCL_ERROR is returned and an error message is
@@ -676,7 +676,7 @@ TkGetDoublePixels(
Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST char *string, /* String describing a number of pixels. */
+ const char *string, /* String describing a number of pixels. */
double *doublePtr) /* Place to store converted result. */
{
char *end;
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 57f8614..835beac 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -130,7 +130,7 @@ typedef struct NewGrabWinEvent {
* we generated.
*/
-#define GENERATED_EVENT_MAGIC ((Bool) 0x147321ac)
+#define GENERATED_GRAB_EVENT_MAGIC ((Bool) 0x147321ac)
/*
* Mask that selects any of the state bits corresponding to buttons, plus
@@ -139,7 +139,7 @@ typedef struct NewGrabWinEvent {
#define ALL_BUTTONS \
(Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
-static unsigned int buttonStates[] = {
+static const unsigned int buttonStates[] = {
Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
};
@@ -150,7 +150,7 @@ static unsigned int buttonStates[] = {
static void EatGrabEvents(TkDisplay *dispPtr, unsigned int serial);
static TkWindow * FindCommonAncestor(TkWindow *winPtr1,
TkWindow *winPtr2, int *countPtr1, int *countPtr2);
-static Tk_RestrictAction GrabRestrictProc(ClientData arg, XEvent *eventPtr);
+static Tk_RestrictProc GrabRestrictProc;
static int GrabWinEventProc(Tcl_Event *evPtr, int flags);
static void MovePointer2(TkWindow *sourcePtr, TkWindow *destPtr,
int mode, int leaveEvents, int EnterEvents);
@@ -181,18 +181,18 @@ Tk_GrabObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int globalGrab;
Tk_Window tkwin;
TkDisplay *dispPtr;
- char *arg;
+ const char *arg;
int index;
int len;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"current", "release", "set", "status", NULL
};
- static CONST char *flagStrings[] = {
+ static const char *const flagStrings[] = {
"-global", NULL
};
enum options {
@@ -203,8 +203,8 @@ Tk_GrabObjCmd(
/*
* 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 ...?"
+ * wrong # args: should be "cmd ?-global? window" or "cmd option
+ * ?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.
@@ -212,7 +212,7 @@ Tk_GrabObjCmd(
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetString(objv[0]), " ?-global? window\" or \"",
- Tcl_GetString(objv[0]), " option ?arg arg ...?\"", NULL);
+ Tcl_GetString(objv[0]), " option ?arg ...?\"", NULL);
return TCL_ERROR;
}
@@ -227,7 +227,7 @@ Tk_GrabObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "?-global? window");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, arg, (Tk_Window) clientData);
+ tkwin = Tk_NameToWindow(interp, arg, clientData);
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -243,8 +243,7 @@ Tk_GrabObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "?-global? window");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- (Tk_Window) clientData);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), clientData);
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -270,7 +269,7 @@ Tk_GrabObjCmd(
}
if (objc == 3) {
tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- (Tk_Window) clientData);
+ clientData);
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -296,8 +295,7 @@ Tk_GrabObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "release window");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- (Tk_Window) clientData);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), clientData);
if (tkwin == NULL) {
Tcl_ResetResult(interp);
} else {
@@ -314,7 +312,7 @@ Tk_GrabObjCmd(
if (objc == 3) {
globalGrab = 0;
tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- (Tk_Window) clientData);
+ clientData);
} else {
globalGrab = 1;
@@ -330,7 +328,7 @@ Tk_GrabObjCmd(
return TCL_ERROR;
}
tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[3]),
- (Tk_Window) clientData);
+ clientData);
}
if (tkwin == NULL) {
return TCL_ERROR;
@@ -346,7 +344,7 @@ Tk_GrabObjCmd(
return TCL_ERROR;
}
winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- (Tk_Window) clientData);
+ clientData);
if (winPtr == NULL) {
return TCL_ERROR;
}
@@ -419,7 +417,12 @@ Tk_Grab(
}
Tk_MakeWindowExist(tkwin);
- if (!grabGlobal) {
+#ifndef MAC_OSX_TK
+ if (!grabGlobal)
+#else
+ if (0)
+#endif
+ {
Window dummy1, dummy2;
int dummy3, dummy4, dummy5, dummy6;
unsigned int state;
@@ -722,7 +725,7 @@ TkPointerEvent(
* serverWinPtr.
*/
- if (eventPtr->xcrossing.send_event != GENERATED_EVENT_MAGIC) {
+ if (eventPtr->xcrossing.send_event != GENERATED_GRAB_EVENT_MAGIC) {
if ((eventPtr->type == LeaveNotify) &&
(winPtr->flags & TK_TOP_HIERARCHY)) {
dispPtr->serverWinPtr = NULL;
@@ -1151,7 +1154,7 @@ MovePointer2(
}
event.xcrossing.serial = LastKnownRequestProcessed(winPtr->display);
- event.xcrossing.send_event = GENERATED_EVENT_MAGIC;
+ event.xcrossing.send_event = GENERATED_GRAB_EVENT_MAGIC;
event.xcrossing.display = winPtr->display;
event.xcrossing.root = RootWindow(winPtr->display, winPtr->screenNum);
event.xcrossing.time = TkCurrentTime(winPtr->dispPtr);
@@ -1237,17 +1240,18 @@ EatGrabEvents(
unsigned int serial) /* Only discard events that have a serial
* number at least this great. */
{
- Tk_RestrictProc *oldProc;
+ Tk_RestrictProc *prevProc;
GrabInfo info;
- ClientData oldArg, dummy;
+ ClientData prevArg;
info.display = dispPtr->display;
info.serial = serial;
TkpSync(info.display);
- oldProc = Tk_RestrictEvents(GrabRestrictProc, (ClientData)&info, &oldArg);
+ prevProc = Tk_RestrictEvents(GrabRestrictProc, &info, &prevArg);
while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {
+ /* EMPTY */
}
- Tk_RestrictEvents(oldProc, oldArg, &dummy);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
}
/*
@@ -1274,7 +1278,7 @@ GrabRestrictProc(
ClientData arg,
XEvent *eventPtr)
{
- GrabInfo *info = (GrabInfo *) arg;
+ GrabInfo *info = arg;
int mode, diff;
/*
@@ -1332,7 +1336,7 @@ QueueGrabWindowChange(
{
NewGrabWinEvent *grabEvPtr;
- grabEvPtr = (NewGrabWinEvent *) ckalloc(sizeof(NewGrabWinEvent));
+ grabEvPtr = ckalloc(sizeof(NewGrabWinEvent));
grabEvPtr->header.proc = GrabWinEventProc;
grabEvPtr->dispPtr = dispPtr;
if (grabWinPtr == NULL) {
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index c6a00d5..70d463e 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -241,10 +241,13 @@ typedef struct UniformGroup {
* size. 0 means if this window is a master then
* Tk will set its requested size to fit the
* needs of its slaves.
+ * ALLOCED_MASTER 1 means that Grid has allocated itself as
+ * geometry master for this window.
*/
#define REQUESTED_RELAYOUT 1
#define DONT_PROPAGATE 2
+#define ALLOCED_MASTER 4
/*
* Prototypes for procedures used only in this file:
@@ -258,31 +261,31 @@ static void ArrangeGrid(ClientData clientData);
static int CheckSlotData(Gridder *masterPtr, int slot,
int slotType, int checkOnly);
static int ConfigureSlaves(Tcl_Interp *interp, Tk_Window tkwin,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DestroyGrid(char *memPtr);
static Gridder * GetGrid(Tk_Window tkwin);
static int GridAnchorCommand(Tk_Window tkwin, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int GridBboxCommand(Tk_Window tkwin, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int GridForgetRemoveCommand(Tk_Window tkwin,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int GridInfoCommand(Tk_Window tkwin, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int GridLocationCommand(Tk_Window tkwin,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int GridPropagateCommand(Tk_Window tkwin,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int GridRowColumnConfigureCommand(Tk_Window tkwin,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int GridSizeCommand(Tk_Window tkwin, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int GridSlavesCommand(Tk_Window tkwin, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void GridStructureProc(ClientData clientData,
XEvent *eventPtr);
static void GridLostSlaveProc(ClientData clientData,
@@ -299,7 +302,7 @@ static int SetSlaveColumn(Tcl_Interp *interp, Gridder *slavePtr,
static int SetSlaveRow(Tcl_Interp *interp, Gridder *slavePtr,
int row, int numRows);
static void StickyToString(int flags, char *result);
-static int StringToSticky(char *string);
+static int StringToSticky(const char *string);
static void Unlink(Gridder *gridPtr);
static const Tk_GeomMgr gridMgrType = {
@@ -330,10 +333,10 @@ Tk_GridObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
- static CONST char *optionStrings[] = {
+ Tk_Window tkwin = clientData;
+ static const char *const optionStrings[] = {
"anchor", "bbox", "columnconfigure", "configure",
"forget", "info", "location", "propagate", "remove",
"rowconfigure", "size", "slaves", NULL
@@ -346,7 +349,7 @@ Tk_GridObjCmd(
int index;
if (objc >= 2) {
- char *argv1 = Tcl_GetString(objv[1]);
+ const char *argv1 = Tcl_GetString(objv[1]);
if ((argv1[0] == '.') || (argv1[0] == REL_SKIP) ||
(argv1[0] == REL_VERT)) {
@@ -425,7 +428,7 @@ GridAnchorCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr;
@@ -466,7 +469,7 @@ GridAnchorCommand(
}
if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
}
return TCL_OK;
@@ -493,7 +496,7 @@ GridBboxCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr; /* master grid record */
@@ -623,12 +626,12 @@ GridForgetRemoveCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window slave;
Gridder *slavePtr;
int i;
- char *string = Tcl_GetString(objv[1]);
+ const char *string = Tcl_GetString(objv[1]);
char c = string[0];
for (i = 2; i < objc; i++) {
@@ -659,7 +662,7 @@ GridForgetRemoveCommand(
}
slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
if (slavePtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);
+ Tcl_CancelIdleCall(ArrangeGrid, slavePtr);
}
slavePtr->flags = 0;
slavePtr->sticky = 0;
@@ -679,7 +682,7 @@ GridForgetRemoveCommand(
Tcl_IncrRefCount(slavePtr->in);
}
}
- Tk_ManageGeometry(slave, NULL, (ClientData) NULL);
+ Tk_ManageGeometry(slave, NULL, NULL);
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
Tk_UnmaintainGeometry(slavePtr->tkwin,
slavePtr->masterPtr->tkwin);
@@ -713,7 +716,7 @@ GridInfoCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Gridder *slavePtr;
Tk_Window slave;
@@ -769,7 +772,7 @@ GridLocationCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr; /* Master grid record. */
@@ -809,8 +812,8 @@ GridLocationCommand(
*/
while (masterPtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);
- ArrangeGrid((ClientData) masterPtr);
+ Tcl_CancelIdleCall(ArrangeGrid, masterPtr);
+ ArrangeGrid(masterPtr);
}
SetGridSize(masterPtr);
endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
@@ -862,7 +865,7 @@ GridPropagateCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr;
@@ -893,8 +896,22 @@ GridPropagateCommand(
old = !(masterPtr->flags & DONT_PROPAGATE);
if (propagate != old) {
if (propagate) {
+ /*
+ * If we have slaves, we need to register as geometry master.
+ */
+
+ if (masterPtr->slavePtr != NULL) {
+ if (TkSetGeometryMaster(interp, master, "grid") != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr->flags |= ALLOCED_MASTER;
+ }
masterPtr->flags &= ~DONT_PROPAGATE;
} else {
+ if (masterPtr->flags & ALLOCED_MASTER) {
+ TkFreeGeometryMaster(master, "grid");
+ masterPtr->flags &= ~ALLOCED_MASTER;
+ }
masterPtr->flags |= DONT_PROPAGATE;
}
@@ -908,7 +925,7 @@ GridPropagateCommand(
}
if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
}
return TCL_OK;
@@ -936,7 +953,7 @@ GridRowColumnConfigureCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master, slave;
Gridder *masterPtr, *slavePtr;
@@ -948,8 +965,8 @@ GridRowColumnConfigureCommand(
Tcl_Obj **lObjv; /* array of indices */
int ok; /* temporary TCL result code */
int i, j, first, last;
- char *string;
- static CONST char *optionStrings[] = {
+ const char *string;
+ static const char *const optionStrings[] = {
"-minsize", "-pad", "-uniform", "-weight", NULL
};
enum options {
@@ -959,7 +976,7 @@ GridRowColumnConfigureCommand(
Tcl_Obj *listCopy;
if (((objc % 2 != 0) && (objc > 6)) || (objc < 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "master index ?-option value...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "master index ?-option value ...?");
return TCL_ERROR;
}
@@ -1135,7 +1152,7 @@ GridRowColumnConfigureCommand(
Tcl_GetString(objv[1]), ": \"",
Tcl_GetString(lObjv[j]),
"\" is out of range", NULL);
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
slotPtr = (slotType == COLUMN) ?
@@ -1150,13 +1167,13 @@ GridRowColumnConfigureCommand(
for (i = 4; i < objc; i += 2) {
if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
"option", 0, &index) != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
if (index == ROWCOL_MINSIZE) {
if (Tk_GetPixelsFromObj(interp, master, objv[i+1],
&size) != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
} else {
slotPtr[slot].minSize = size;
@@ -1165,13 +1182,13 @@ GridRowColumnConfigureCommand(
int wt;
if (Tcl_GetIntFromObj(interp,objv[i+1],&wt)!=TCL_OK) {
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
} else if (wt < 0) {
Tcl_AppendResult(interp, "invalid arg \"",
Tcl_GetString(objv[i]),
"\": should be non-negative", NULL);
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
} else {
slotPtr[slot].weight = wt;
@@ -1186,13 +1203,13 @@ GridRowColumnConfigureCommand(
} else if (index == ROWCOL_PAD) {
if (Tk_GetPixelsFromObj(interp, master, objv[i+1],
&size) != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
} else if (size < 0) {
Tcl_AppendResult(interp, "invalid arg \"",
Tcl_GetString(objv[i]),
"\": should be non-negative", NULL);
- Tcl_DecrRefCount(listCopy);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
} else {
slotPtr[slot].pad = size;
@@ -1239,7 +1256,7 @@ GridRowColumnConfigureCommand(
}
if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
return TCL_OK;
}
@@ -1266,7 +1283,7 @@ GridSizeCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr;
@@ -1317,21 +1334,21 @@ GridSlavesCommand(
Tk_Window tkwin, /* Main window of the application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window master;
Gridder *masterPtr; /* master grid record */
Gridder *slavePtr;
int i, value, index;
int row = -1, column = -1;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-column", "-row", NULL
};
enum options { SLAVES_COLUMN, SLAVES_ROW };
Tcl_Obj *res;
if ((objc < 3) || ((objc % 2) == 0)) {
- Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value ...?");
return TCL_ERROR;
}
@@ -1371,8 +1388,7 @@ GridSlavesCommand(
slavePtr->row+slavePtr->numRows-1 < row)) {
continue;
}
- Tcl_ListObjAppendElement(interp, res,
- Tcl_NewStringObj(Tk_PathName(slavePtr->tkwin), -1));
+ Tcl_ListObjAppendElement(interp,res, TkNewWindowObj(slavePtr->tkwin));
}
Tcl_SetObjResult(interp, res);
return TCL_OK;
@@ -1403,12 +1419,12 @@ GridReqProc(
Tk_Window tkwin) /* Other Tk-related information about the
* window. */
{
- register Gridder *gridPtr = (Gridder *) clientData;
+ register Gridder *gridPtr = clientData;
gridPtr = gridPtr->masterPtr;
if (gridPtr && !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, gridPtr);
}
}
@@ -1435,7 +1451,7 @@ GridLostSlaveProc(
* stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- register Gridder *slavePtr = (Gridder *) clientData;
+ register Gridder *slavePtr = clientData;
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin);
@@ -1693,7 +1709,7 @@ ArrangeGrid(
ClientData clientData) /* Structure describing master whose slaves
* are to be re-layed out. */
{
- register Gridder *masterPtr = (Gridder *) clientData;
+ register Gridder *masterPtr = clientData;
register Gridder *slavePtr;
GridMaster *slotPtr = masterPtr->masterDataPtr;
int abort;
@@ -1729,7 +1745,7 @@ ArrangeGrid(
}
masterPtr->abortPtr = &abort;
abort = 0;
- Tcl_Preserve((ClientData) masterPtr);
+ Tcl_Preserve(masterPtr);
/*
* Call the constraint engine to fill in the row and column offsets.
@@ -1756,10 +1772,10 @@ ArrangeGrid(
Tk_GeometryRequest(masterPtr->tkwin, width, height);
if (width>1 && height>1) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
masterPtr->abortPtr = NULL;
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
return;
}
@@ -1845,7 +1861,7 @@ ArrangeGrid(
}
masterPtr->abortPtr = NULL;
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
}
/*
@@ -1928,8 +1944,7 @@ ResolveConstraints(
gridCount = MAX(constraintCount, slotCount);
if (gridCount >= TYPICAL_SIZE) {
- layoutPtr = (GridLayout *)
- ckalloc(sizeof(GridLayout) * (1+gridCount));
+ layoutPtr = ckalloc(sizeof(GridLayout) * (1+gridCount));
} else {
layoutPtr = layoutData;
}
@@ -2051,12 +2066,12 @@ ResolveConstraints(
* sizeof(UniformGroup);
size_t newSize = (uniformGroupsAlloced + UNIFORM_PREALLOC)
* sizeof(UniformGroup);
- UniformGroup *newUG = (UniformGroup *) ckalloc(newSize);
+ UniformGroup *newUG = ckalloc(newSize);
UniformGroup *oldUG = uniformGroupPtr;
memcpy(newUG, oldUG, oldSize);
if (oldUG != uniformPre) {
- ckfree((char *) oldUG);
+ ckfree(oldUG);
}
uniformGroupPtr = newUG;
uniformGroupsAlloced += UNIFORM_PREALLOC;
@@ -2096,7 +2111,7 @@ ResolveConstraints(
}
if (uniformGroupPtr != uniformPre) {
- ckfree((char *) uniformGroupPtr);
+ ckfree(uniformGroupPtr);
}
/*
@@ -2366,7 +2381,7 @@ ResolveConstraints(
--layoutPtr;
if (layoutPtr != layoutData) {
- ckfree((char *) layoutPtr);
+ ckfree(layoutPtr);
}
return requiredSize;
}
@@ -2412,9 +2427,9 @@ GetGrid(
hPtr = Tcl_CreateHashEntry(&dispPtr->gridHashTable, (char*) tkwin, &isNew);
if (!isNew) {
- return (Gridder *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
- gridPtr = (Gridder *) ckalloc(sizeof(Gridder));
+ gridPtr = ckalloc(sizeof(Gridder));
gridPtr->tkwin = tkwin;
gridPtr->masterPtr = NULL;
gridPtr->masterDataPtr = NULL;
@@ -2433,7 +2448,7 @@ GetGrid(
gridPtr->padTop = 0;
gridPtr->iPadX = 0;
gridPtr->iPadY = 0;
- gridPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
+ gridPtr->doubleBw = 2 * Tk_Changes(tkwin)->border_width;
gridPtr->abortPtr = NULL;
gridPtr->flags = 0;
gridPtr->sticky = 0;
@@ -2442,7 +2457,7 @@ GetGrid(
gridPtr->masterDataPtr = NULL;
Tcl_SetHashValue(hPtr, gridPtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask,
- GridStructureProc, (ClientData) gridPtr);
+ GridStructureProc, gridPtr);
return gridPtr;
}
@@ -2622,14 +2637,14 @@ CheckSlotData(
int newNumSlot = slot + PREALLOC;
size_t oldSize = numSlot * sizeof(SlotInfo);
size_t newSize = newNumSlot * sizeof(SlotInfo);
- SlotInfo *newSI = (SlotInfo *) ckalloc(newSize);
+ SlotInfo *newSI = ckalloc(newSize);
SlotInfo *oldSI = (slotType == ROW)
? masterPtr->masterDataPtr->rowPtr
: masterPtr->masterDataPtr->columnPtr;
memcpy(newSI, oldSI, oldSize);
memset(newSI+numSlot, 0, newSize - oldSize);
- ckfree((char *) oldSI);
+ ckfree(oldSI);
if (slotType == ROW) {
masterPtr->masterDataPtr->rowPtr = newSI;
masterPtr->masterDataPtr->rowSpace = newNumSlot;
@@ -2672,17 +2687,17 @@ InitMasterData(
Gridder *masterPtr)
{
if (masterPtr->masterDataPtr == NULL) {
- GridMaster *gridPtr = masterPtr->masterDataPtr = (GridMaster *)
+ GridMaster *gridPtr = masterPtr->masterDataPtr =
ckalloc(sizeof(GridMaster));
size_t size = sizeof(SlotInfo) * TYPICAL_SIZE;
gridPtr->columnEnd = 0;
gridPtr->columnMax = 0;
- gridPtr->columnPtr = (SlotInfo *) ckalloc(size);
+ gridPtr->columnPtr = ckalloc(size);
gridPtr->columnSpace = TYPICAL_SIZE;
gridPtr->rowEnd = 0;
gridPtr->rowMax = 0;
- gridPtr->rowPtr = (SlotInfo *) ckalloc(size);
+ gridPtr->rowPtr = ckalloc(size);
gridPtr->rowSpace = TYPICAL_SIZE;
gridPtr->startX = 0;
gridPtr->startY = 0;
@@ -2736,7 +2751,7 @@ Unlink(
}
if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
@@ -2744,6 +2759,16 @@ Unlink(
SetGridSize(slavePtr->masterPtr);
slavePtr->masterPtr = NULL;
+
+ /*
+ * If we have emptied this master from slaves it means we are no longer
+ * handling it and should mark it as free.
+ */
+
+ if ((masterPtr->slavePtr == NULL) && (masterPtr->flags & ALLOCED_MASTER)) {
+ TkFreeGeometryMaster(masterPtr->tkwin, "grid");
+ masterPtr->flags &= ~ALLOCED_MASTER;
+ }
}
/*
@@ -2774,17 +2799,17 @@ DestroyGrid(
if (gridPtr->masterDataPtr != NULL) {
if (gridPtr->masterDataPtr->rowPtr != NULL) {
- ckfree((char *) gridPtr->masterDataPtr -> rowPtr);
+ ckfree(gridPtr->masterDataPtr -> rowPtr);
}
if (gridPtr->masterDataPtr->columnPtr != NULL) {
- ckfree((char *) gridPtr->masterDataPtr -> columnPtr);
+ ckfree(gridPtr->masterDataPtr -> columnPtr);
}
- ckfree((char *) gridPtr->masterDataPtr);
+ ckfree(gridPtr->masterDataPtr);
}
if (gridPtr->in != NULL) {
Tcl_DecrRefCount(gridPtr->in);
}
- ckfree((char *) gridPtr);
+ ckfree(gridPtr);
}
/*
@@ -2811,21 +2836,21 @@ GridStructureProc(
* eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- register Gridder *gridPtr = (Gridder *) clientData;
+ register Gridder *gridPtr = clientData;
TkDisplay *dispPtr = ((TkWindow *) gridPtr->tkwin)->dispPtr;
if (eventPtr->type == ConfigureNotify) {
if ((gridPtr->slavePtr != NULL)
&& !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, gridPtr);
}
if ((gridPtr->masterPtr != NULL) &&
(gridPtr->doubleBw != 2*Tk_Changes(gridPtr->tkwin)->border_width)) {
if (!(gridPtr->masterPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->doubleBw = 2*Tk_Changes(gridPtr->tkwin)->border_width;
gridPtr->masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr->masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, gridPtr->masterPtr);
}
}
} else if (eventPtr->type == DestroyNotify) {
@@ -2844,15 +2869,15 @@ GridStructureProc(
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->gridHashTable,
(char *) gridPtr->tkwin));
if (gridPtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, (ClientData) gridPtr);
+ Tcl_CancelIdleCall(ArrangeGrid, gridPtr);
}
gridPtr->tkwin = NULL;
- Tcl_EventuallyFree((ClientData) gridPtr, DestroyGrid);
+ Tcl_EventuallyFree(gridPtr, DestroyGrid);
} else if (eventPtr->type == MapNotify) {
if ((gridPtr->slavePtr != NULL)
&& !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, gridPtr);
}
} else if (eventPtr->type == UnmapNotify) {
register Gridder *gridPtr2;
@@ -2890,7 +2915,7 @@ ConfigureSlaves(
Tk_Window tkwin, /* Any window in application containing
* slaves. Used to look up slave names. */
int objc, /* Number of elements in argv. */
- Tcl_Obj *CONST objv[]) /* Argument objects: contains one or more
+ 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 window name. */
@@ -2904,10 +2929,10 @@ ConfigureSlaves(
int defaultRow = -1;
int defaultColumn = 0; /* Default column number */
int defaultColumnSpan = 1; /* Default number of columns */
- char *lastWindow; /* Use this window to base current row/col
+ const char *lastWindow; /* Use this window to base current row/col
* on */
int numSkip; /* Number of 'x' found */
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-column", "-columnspan", "-in", "-ipadx", "-ipady",
"-padx", "-pady", "-row", "-rowspan", "-sticky", NULL
};
@@ -2915,7 +2940,7 @@ ConfigureSlaves(
CONF_COLUMN, CONF_COLUMNSPAN, CONF_IN, CONF_IPADX, CONF_IPADY,
CONF_PADX, CONF_PADY, CONF_ROW, CONF_ROWSPAN, CONF_STICKY };
int index;
- char *string;
+ const char *string;
char firstChar;
int positionGiven;
@@ -3079,7 +3104,7 @@ ConfigureSlaves(
for (defaultColumnSpan = 1; j + defaultColumnSpan < numWindows;
defaultColumnSpan++) {
- char *string = Tcl_GetString(objv[j + defaultColumnSpan]);
+ const char *string = Tcl_GetString(objv[j + defaultColumnSpan]);
if (*string != REL_HORIZ) {
break;
@@ -3174,7 +3199,7 @@ ConfigureSlaves(
"positive screen distance", NULL);
return TCL_ERROR;
}
- slavePtr->iPadX = tmp*2;
+ slavePtr->iPadX = tmp * 2;
break;
case CONF_IPADY:
if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1],
@@ -3184,7 +3209,7 @@ ConfigureSlaves(
"positive screen distance", NULL);
return TCL_ERROR;
}
- slavePtr->iPadY = tmp*2;
+ slavePtr->iPadY = tmp * 2;
break;
case CONF_PADX:
if (TkParsePadAmount(interp, tkwin, objv[i+1],
@@ -3299,7 +3324,17 @@ ConfigureSlaves(
return TCL_ERROR;
}
- Tk_ManageGeometry(slave, &gridMgrType, (ClientData) slavePtr);
+ Tk_ManageGeometry(slave, &gridMgrType, slavePtr);
+
+ if (!(masterPtr->flags & DONT_PROPAGATE)) {
+ if (TkSetGeometryMaster(interp, masterPtr->tkwin, "grid")
+ != TCL_OK) {
+ Tk_ManageGeometry(slave, NULL, NULL);
+ Unlink(slavePtr);
+ return TCL_ERROR;
+ }
+ masterPtr->flags |= ALLOCED_MASTER;
+ }
/*
* Assign default position information.
@@ -3332,7 +3367,7 @@ ConfigureSlaves(
}
if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangeGrid, masterPtr);
}
}
@@ -3371,7 +3406,7 @@ ConfigureSlaves(
*/
for (width = 1; width + j < numWindows; width++) {
- char *string = Tcl_GetString(objv[j+width]);
+ const char *string = Tcl_GetString(objv[j+width]);
if (*string != REL_VERT) {
break;
@@ -3425,6 +3460,17 @@ ConfigureSlaves(
return TCL_ERROR;
}
SetGridSize(masterPtr);
+
+ /*
+ * If we have emptied this master from slaves it means we are no longer
+ * handling it and should mark it as free.
+ */
+
+ if (masterPtr->slavePtr == NULL && masterPtr->flags & ALLOCED_MASTER) {
+ TkFreeGeometryMaster(masterPtr->tkwin, "grid");
+ masterPtr->flags &= ~ALLOCED_MASTER;
+ }
+
return TCL_OK;
}
@@ -3490,7 +3536,7 @@ StickyToString(
static int
StringToSticky(
- char *string)
+ const char *string)
{
int sticky = 0;
char c;
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 6c7c9cd..5fa3671 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -15,8 +15,8 @@
/*
* Each call to Tk_GetImage returns a pointer to one of the following
- * structures, which is used as a token by clients (widgets) that
- * display images.
+ * structures, which is used as a token by clients (widgets) that display
+ * images.
*/
typedef struct Image {
@@ -106,22 +106,22 @@ static void
ImageTypeThreadExitProc(
ClientData clientData) /* not used */
{
- Tk_ImageType *freePtr;
+ Tk_ImageType *freePtr;
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
while (tsdPtr->oldImageTypeList != NULL) {
freePtr = tsdPtr->oldImageTypeList;
tsdPtr->oldImageTypeList = tsdPtr->oldImageTypeList->nextPtr;
- ckfree((char *) freePtr);
+ ckfree(freePtr);
}
while (tsdPtr->imageTypeList != NULL) {
freePtr = tsdPtr->imageTypeList;
tsdPtr->imageTypeList = tsdPtr->imageTypeList->nextPtr;
- ckfree((char *) freePtr);
+ ckfree(freePtr);
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -143,11 +143,12 @@ ImageTypeThreadExitProc(
void
Tk_CreateOldImageType(
- Tk_ImageType *typePtr) /* Structure describing the type. All of the
+ const Tk_ImageType *typePtr)
+ /* Structure describing the type. All of the
* fields except "nextPtr" must be filled in
* by caller. */
{
- Tk_ImageType *copyPtr;
+ Tk_ImageType *copyPtr;
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -155,7 +156,7 @@ Tk_CreateOldImageType(
tsdPtr->initialized = 1;
Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL);
}
- copyPtr = (Tk_ImageType *) ckalloc(sizeof(Tk_ImageType));
+ copyPtr = ckalloc(sizeof(Tk_ImageType));
*copyPtr = *typePtr;
copyPtr->nextPtr = tsdPtr->oldImageTypeList;
tsdPtr->oldImageTypeList = copyPtr;
@@ -163,11 +164,12 @@ Tk_CreateOldImageType(
void
Tk_CreateImageType(
- Tk_ImageType *typePtr) /* Structure describing the type. All of the
+ const Tk_ImageType *typePtr)
+ /* Structure describing the type. All of the
* fields except "nextPtr" must be filled in
* by caller. */
{
- Tk_ImageType *copyPtr;
+ Tk_ImageType *copyPtr;
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -175,7 +177,7 @@ Tk_CreateImageType(
tsdPtr->initialized = 1;
Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL);
}
- copyPtr = (Tk_ImageType *) ckalloc(sizeof(Tk_ImageType));
+ copyPtr = ckalloc(sizeof(Tk_ImageType));
*copyPtr = *typePtr;
copyPtr->nextPtr = tsdPtr->imageTypeList;
tsdPtr->imageTypeList = copyPtr;
@@ -203,9 +205,9 @@ Tk_ImageObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
- static CONST char *imageOptions[] = {
+ static const char *const imageOptions[] = {
"create", "delete", "height", "inuse", "names", "type", "types",
"width", NULL
};
@@ -213,7 +215,7 @@ Tk_ImageObjCmd(
IMAGE_CREATE, IMAGE_DELETE, IMAGE_HEIGHT, IMAGE_INUSE, IMAGE_NAMES,
IMAGE_TYPE, IMAGE_TYPES, IMAGE_WIDTH
};
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
int i, isNew, firstOption, index;
Tk_ImageType *typePtr;
ImageMaster *masterPtr;
@@ -222,8 +224,8 @@ Tk_ImageObjCmd(
Tcl_HashSearch search;
char idString[16 + TCL_INTEGER_SPACE];
TkDisplay *dispPtr = winPtr->dispPtr;
- char *arg, *name;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ const char *arg, *name;
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (objc < 2) {
@@ -239,8 +241,10 @@ Tk_ImageObjCmd(
case IMAGE_CREATE: {
Tcl_Obj **args;
int oldimage = 0;
+
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "type ?name? ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "type ?name? ?-option value ...?");
return TCL_ERROR;
}
@@ -278,6 +282,7 @@ Tk_ImageObjCmd(
if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) {
Tcl_CmdInfo dummy;
+
do {
dispPtr->imageId++;
sprintf(idString, "image%d", dispPtr->imageId);
@@ -311,7 +316,7 @@ Tk_ImageObjCmd(
hPtr = Tcl_CreateHashEntry(&winPtr->mainPtr->imageTable, name, &isNew);
if (isNew) {
- masterPtr = (ImageMaster *) ckalloc(sizeof(ImageMaster));
+ masterPtr = ckalloc(sizeof(ImageMaster));
masterPtr->typePtr = NULL;
masterPtr->masterData = NULL;
masterPtr->width = masterPtr->height = 1;
@@ -320,7 +325,7 @@ Tk_ImageObjCmd(
masterPtr->instancePtr = NULL;
masterPtr->deleted = 0;
masterPtr->winPtr = winPtr->mainPtr->winPtr;
- Tcl_Preserve((ClientData) masterPtr->winPtr);
+ Tcl_Preserve(masterPtr->winPtr);
Tcl_SetHashValue(hPtr, masterPtr);
} else {
/*
@@ -328,17 +333,17 @@ Tk_ImageObjCmd(
* from the master.
*/
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->typePtr != NULL) {
for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
- (*masterPtr->typePtr->freeProc)(imagePtr->instanceData,
+ masterPtr->typePtr->freeProc(imagePtr->instanceData,
imagePtr->display);
- (*imagePtr->changeProc)(imagePtr->widgetClientData,
- 0, 0, masterPtr->width, masterPtr->height,
+ imagePtr->changeProc(imagePtr->widgetClientData, 0, 0,
+ masterPtr->width, masterPtr->height,
masterPtr->width, masterPtr->height);
}
- (*masterPtr->typePtr->deleteProc)(masterPtr->masterData);
+ masterPtr->typePtr->deleteProc(masterPtr->masterData);
masterPtr->typePtr = NULL;
}
masterPtr->deleted = 0;
@@ -356,30 +361,30 @@ Tk_ImageObjCmd(
if (oldimage) {
int i;
- args = (Tcl_Obj **) ckalloc((objc+1) * sizeof(char *));
+ args = ckalloc((objc+1) * sizeof(char *));
for (i = 0; i < objc; i++) {
args[i] = (Tcl_Obj *) Tcl_GetString(objv[i]);
}
args[objc] = NULL;
}
- Tcl_Preserve((ClientData) masterPtr);
- if ((*typePtr->createProc)(interp, name, objc, args, typePtr,
- (Tk_ImageMaster)masterPtr, &masterPtr->masterData) != TCL_OK) {
+ Tcl_Preserve(masterPtr);
+ if (typePtr->createProc(interp, name, objc, args, typePtr,
+ (Tk_ImageMaster)masterPtr, &masterPtr->masterData) != TCL_OK){
EventuallyDeleteImage(masterPtr, 0);
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
if (oldimage) {
- ckfree((char *) args);
+ ckfree(args);
}
return TCL_ERROR;
}
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
if (oldimage) {
- ckfree((char *) args);
+ ckfree(args);
}
masterPtr->typePtr = typePtr;
for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
- imagePtr->instanceData = (*typePtr->getProc)(imagePtr->tkwin,
+ imagePtr->instanceData = typePtr->getProc(imagePtr->tkwin,
masterPtr->masterData);
}
Tcl_SetResult(interp,
@@ -394,7 +399,7 @@ Tk_ImageObjCmd(
if (hPtr == NULL) {
goto alreadyDeleted;
}
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->deleted) {
goto alreadyDeleted;
}
@@ -408,7 +413,7 @@ Tk_ImageObjCmd(
}
hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->deleted) {
continue;
}
@@ -451,7 +456,7 @@ Tk_ImageObjCmd(
if (hPtr == NULL) {
goto alreadyDeleted;
}
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->deleted) {
goto alreadyDeleted;
}
@@ -462,19 +467,20 @@ Tk_ImageObjCmd(
switch ((enum options) index) {
case IMAGE_HEIGHT:
- Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->height);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(masterPtr->height));
break;
case IMAGE_INUSE:
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- masterPtr->typePtr!=NULL && masterPtr->instancePtr!=NULL);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ masterPtr->typePtr && masterPtr->instancePtr));
break;
case IMAGE_TYPE:
if (masterPtr->typePtr != NULL) {
- Tcl_SetResult(interp, masterPtr->typePtr->name, TCL_STATIC);
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(masterPtr->typePtr->name, -1));
}
break;
case IMAGE_WIDTH:
- Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->width);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(masterPtr->width));
break;
default:
Tcl_Panic("can't happen");
@@ -527,8 +533,8 @@ Tk_ImageChanged(
masterPtr->height = imageHeight;
for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
- (*imagePtr->changeProc)(imagePtr->widgetClientData, x, y,
- width, height, imageWidth, imageHeight);
+ imagePtr->changeProc(imagePtr->widgetClientData, x, y, width, height,
+ imageWidth, imageHeight);
}
}
@@ -549,7 +555,7 @@ Tk_ImageChanged(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfImage(
Tk_ImageMaster imageMaster) /* Token for image. */
{
@@ -589,7 +595,7 @@ Tk_GetImage(
* be found. */
Tk_Window tkwin, /* Token for window in which image will be
* used. */
- CONST char *name, /* Name of desired image. */
+ const char *name, /* Name of desired image. */
Tk_ImageChangedProc *changeProc,
/* Function to invoke when redisplay is needed
* because image's pixels or size changed. */
@@ -603,19 +609,19 @@ Tk_GetImage(
if (hPtr == NULL) {
goto noSuchImage;
}
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->typePtr == NULL) {
goto noSuchImage;
}
if (masterPtr->deleted) {
goto noSuchImage;
}
- imagePtr = (Image *) ckalloc(sizeof(Image));
+ imagePtr = ckalloc(sizeof(Image));
imagePtr->tkwin = tkwin;
imagePtr->display = Tk_Display(tkwin);
imagePtr->masterPtr = masterPtr;
imagePtr->instanceData =
- (*masterPtr->typePtr->getProc)(tkwin, masterPtr->masterData);
+ masterPtr->typePtr->getProc(tkwin, masterPtr->masterData);
imagePtr->changeProc = changeProc;
imagePtr->widgetClientData = clientData;
imagePtr->nextPtr = masterPtr->instancePtr;
@@ -661,7 +667,7 @@ Tk_FreeImage(
*/
if (masterPtr->typePtr != NULL) {
- (*masterPtr->typePtr->freeProc)(imagePtr->instanceData,
+ masterPtr->typePtr->freeProc(imagePtr->instanceData,
imagePtr->display);
}
prevPtr = masterPtr->instancePtr;
@@ -673,7 +679,7 @@ Tk_FreeImage(
}
prevPtr->nextPtr = imagePtr->nextPtr;
}
- ckfree((char *) imagePtr);
+ ckfree(imagePtr);
/*
* If there are no more instances left for the master, and if the master
@@ -684,8 +690,8 @@ Tk_FreeImage(
if (masterPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(masterPtr->hPtr);
}
- Tcl_Release((ClientData) masterPtr->winPtr);
- ckfree((char *) masterPtr);
+ Tcl_Release(masterPtr->winPtr);
+ ckfree(masterPtr);
}
}
@@ -739,9 +745,9 @@ Tk_PostscriptImage(
*/
if (imagePtr->masterPtr->typePtr->postscriptProc != NULL) {
- return (*imagePtr->masterPtr->typePtr->postscriptProc)(
- imagePtr->masterPtr->masterData, interp, tkwin, psinfo,
- x, y, width, height, prepass);
+ return imagePtr->masterPtr->typePtr->postscriptProc(
+ imagePtr->masterPtr->masterData, interp, tkwin, psinfo,
+ x, y, width, height, prepass);
}
if (prepass) {
@@ -760,15 +766,15 @@ Tk_PostscriptImage(
gcValues.foreground = WhitePixelOfScreen(Tk_Screen(tkwin));
newGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
if (newGC != None) {
- XFillRectangle(Tk_Display(tkwin), pmap, newGC,
- 0, 0, (unsigned int)width, (unsigned int)height);
+ XFillRectangle(Tk_Display(tkwin), pmap, newGC, 0, 0,
+ (unsigned) width, (unsigned) height);
Tk_FreeGC(Tk_Display(tkwin), newGC);
}
Tk_RedrawImage(image, x, y, width, height, pmap, 0, 0);
ximage = XGetImage(Tk_Display(tkwin), pmap, 0, 0,
- (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap);
+ (unsigned) width, (unsigned) height, AllPlanes, ZPixmap);
Tk_FreePixmap(Tk_Display(tkwin), pmap);
@@ -849,9 +855,9 @@ Tk_RedrawImage(
if ((imageY + height) > imagePtr->masterPtr->height) {
height = imagePtr->masterPtr->height - imageY;
}
- (*imagePtr->masterPtr->typePtr->displayProc)(
- imagePtr->instanceData, imagePtr->display, drawable,
- imageX, imageY, width, height, drawableX, drawableY);
+ imagePtr->masterPtr->typePtr->displayProc(imagePtr->instanceData,
+ imagePtr->display, drawable, imageX, imageY, width, height,
+ drawableX, drawableY);
}
/*
@@ -904,7 +910,7 @@ void
Tk_DeleteImage(
Tcl_Interp *interp, /* Interpreter in which the image was
* created. */
- CONST char *name) /* Name of image. */
+ const char *name) /* Name of image. */
{
Tcl_HashEntry *hPtr;
TkWindow *winPtr;
@@ -917,7 +923,7 @@ Tk_DeleteImage(
if (hPtr == NULL) {
return;
}
- DeleteImage((ImageMaster *)Tcl_GetHashValue(hPtr));
+ DeleteImage(Tcl_GetHashValue(hPtr));
}
/*
@@ -950,20 +956,19 @@ DeleteImage(
if (typePtr != NULL) {
for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
imagePtr = imagePtr->nextPtr) {
- (*typePtr->freeProc)(imagePtr->instanceData,
- imagePtr->display);
- (*imagePtr->changeProc)(imagePtr->widgetClientData, 0, 0,
+ typePtr->freeProc(imagePtr->instanceData, imagePtr->display);
+ imagePtr->changeProc(imagePtr->widgetClientData, 0, 0,
masterPtr->width, masterPtr->height, masterPtr->width,
masterPtr->height);
}
- (*typePtr->deleteProc)(masterPtr->masterData);
+ typePtr->deleteProc(masterPtr->masterData);
}
if (masterPtr->instancePtr == NULL) {
if (masterPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(masterPtr->hPtr);
}
- Tcl_Release((ClientData) masterPtr->winPtr);
- ckfree((char *) masterPtr);
+ Tcl_Release(masterPtr->winPtr);
+ ckfree(masterPtr);
} else {
masterPtr->deleted = 1;
}
@@ -998,8 +1003,7 @@ EventuallyDeleteImage(
}
if (!masterPtr->deleted) {
masterPtr->deleted = 1;
- Tcl_EventuallyFree((ClientData) masterPtr,
- (Tcl_FreeProc *)DeleteImage);
+ Tcl_EventuallyFree(masterPtr, (Tcl_FreeProc *) DeleteImage);
}
}
@@ -1031,7 +1035,7 @@ TkDeleteAllImages(
for (hPtr = Tcl_FirstHashEntry(&mainPtr->imageTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- EventuallyDeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr), 1);
+ EventuallyDeleteImage(Tcl_GetHashValue(hPtr), 1);
}
Tcl_DeleteHashTable(&mainPtr->imageTable);
}
@@ -1060,21 +1064,21 @@ ClientData
Tk_GetImageMasterData(
Tcl_Interp *interp, /* Interpreter in which the image was
* created. */
- CONST char *name, /* Name of image. */
- Tk_ImageType **typePtrPtr) /* Points to location to fill in with pointer
+ const char *name, /* Name of image. */
+ const Tk_ImageType **typePtrPtr)
+ /* Points to location to fill in with pointer
* to type information for image. */
{
+ TkWindow *winPtr = (TkWindow *) Tk_MainWindow(interp);
Tcl_HashEntry *hPtr;
- TkWindow *winPtr;
ImageMaster *masterPtr;
- winPtr = (TkWindow *) Tk_MainWindow(interp);
hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, name);
if (hPtr == NULL) {
*typePtrPtr = NULL;
return NULL;
}
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
if (masterPtr->deleted) {
*typePtrPtr = NULL;
return NULL;
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 88c96d5..87c6283 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -75,8 +75,8 @@ typedef struct BitmapInstance {
static int GetByte(Tcl_Channel chan);
static int ImgBmapCreate(Tcl_Interp *interp,
- char *name, int argc, Tcl_Obj *CONST objv[],
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+ const char *name, int argc, Tcl_Obj *const objv[],
+ const Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *clientDataPtr);
static ClientData ImgBmapGet(Tk_Window tkwin, ClientData clientData);
static void ImgBmapDisplay(ClientData clientData,
@@ -98,27 +98,28 @@ Tk_ImageType tkBitmapImageType = {
ImgBmapFree, /* freeProc */
ImgBmapDelete, /* deleteProc */
ImgBmapPostscript, /* postscriptProc */
- NULL /* nextPtr */
+ NULL, /* nextPtr */
+ NULL
};
/*
* Information used for parsing configuration specs:
*/
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_UID, "-background", NULL, NULL,
- "", Tk_Offset(BitmapMaster, bgUid), 0},
+ "", Tk_Offset(BitmapMaster, bgUid), 0, NULL},
{TK_CONFIG_STRING, "-data", NULL, NULL,
- NULL, Tk_Offset(BitmapMaster, dataString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapMaster, dataString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_STRING, "-file", NULL, NULL,
- NULL, Tk_Offset(BitmapMaster, fileString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapMaster, fileString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_UID, "-foreground", NULL, NULL,
- "#000000", Tk_Offset(BitmapMaster, fgUid), 0},
+ "#000000", Tk_Offset(BitmapMaster, fgUid), 0, NULL},
{TK_CONFIG_STRING, "-maskdata", NULL, NULL,
- NULL, Tk_Offset(BitmapMaster, maskDataString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(BitmapMaster, maskDataString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_STRING, "-maskfile", NULL, NULL,
- NULL, Tk_Offset(BitmapMaster, maskFileString), TK_CONFIG_NULL_OK},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ NULL, Tk_Offset(BitmapMaster, maskFileString), TK_CONFIG_NULL_OK, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -129,7 +130,7 @@ static Tk_ConfigSpec configSpecs[] = {
#define MAX_WORD_LENGTH 100
typedef struct ParseInfo {
- char *string; /* Next character of string data for bitmap,
+ const char *string; /* Next character of string data for bitmap,
* or NULL if bitmap is being read from
* file. */
Tcl_Channel chan; /* File containing bitmap data, or NULL if no
@@ -145,13 +146,13 @@ typedef struct ParseInfo {
*/
static int ImgBmapCmd(ClientData clientData, Tcl_Interp *interp,
- int argc, Tcl_Obj *CONST objv[]);
+ int argc, Tcl_Obj *const objv[]);
static void ImgBmapCmdDeletedProc(ClientData clientData);
static void ImgBmapConfigureInstance(BitmapInstance *instancePtr);
static int ImgBmapConfigureMaster(BitmapMaster *masterPtr,
- int argc, Tcl_Obj *CONST objv[], int flags);
+ int argc, Tcl_Obj *const objv[], int flags);
static int NextBitmapWord(ParseInfo *parseInfoPtr);
-
+
/*
*----------------------------------------------------------------------
*
@@ -173,23 +174,22 @@ static int
ImgBmapCreate(
Tcl_Interp *interp, /* Interpreter for application containing
* image. */
- char *name, /* Name to use for image. */
+ const char *name, /* Name to use for image. */
int argc, /* Number of arguments. */
- Tcl_Obj *CONST argv[], /* Argument objects for options (doesn't
+ Tcl_Obj *const argv[], /* Argument objects for options (doesn't
* include image name or type). */
- Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
+ const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */
Tk_ImageMaster master, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
- BitmapMaster *masterPtr;
+ BitmapMaster *masterPtr = ckalloc(sizeof(BitmapMaster));
- masterPtr = (BitmapMaster *) ckalloc(sizeof(BitmapMaster));
masterPtr->tkMaster = master;
masterPtr->interp = interp;
masterPtr->imageCmd = Tcl_CreateObjCommand(interp, name, ImgBmapCmd,
- (ClientData) masterPtr, ImgBmapCmdDeletedProc);
+ masterPtr, ImgBmapCmdDeletedProc);
masterPtr->width = masterPtr->height = 0;
masterPtr->data = NULL;
masterPtr->maskData = NULL;
@@ -201,13 +201,13 @@ ImgBmapCreate(
masterPtr->maskDataString = NULL;
masterPtr->instancePtr = NULL;
if (ImgBmapConfigureMaster(masterPtr, argc, argv, 0) != TCL_OK) {
- ImgBmapDelete((ClientData) masterPtr);
+ ImgBmapDelete(masterPtr);
return TCL_ERROR;
}
- *clientDataPtr = (ClientData) masterPtr;
+ *clientDataPtr = masterPtr;
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -233,26 +233,25 @@ ImgBmapConfigureMaster(
BitmapMaster *masterPtr, /* Pointer to data structure describing
* overall bitmap image to (reconfigure). */
int objc, /* Number of entries in objv. */
- Tcl_Obj *CONST objv[], /* Pairs of configuration options for image. */
+ Tcl_Obj *const objv[], /* Pairs of configuration options for image. */
int flags) /* Flags to pass to Tk_ConfigureWidget, such
* as TK_CONFIG_ARGV_ONLY. */
{
BitmapInstance *instancePtr;
int maskWidth, maskHeight, dummy1, dummy2;
+ const char **argv = 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]);
}
argv[objc] = NULL;
if (Tk_ConfigureWidget(masterPtr->interp, Tk_MainWindow(masterPtr->interp),
- configSpecs, objc, argv, (char *) masterPtr, flags)
- != TCL_OK) {
- ckfree((char *) argv);
+ configSpecs, objc, argv, (char *) masterPtr, flags) != TCL_OK) {
+ ckfree(argv);
return TCL_ERROR;
}
- ckfree((char *) argv);
+ ckfree(argv);
/*
* Parse the bitmap and/or mask to create binary data. Make sure that the
@@ -312,7 +311,7 @@ ImgBmapConfigureMaster(
masterPtr->height, masterPtr->width, masterPtr->height);
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -442,12 +441,12 @@ ImgBmapConfigureInstance(
Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc);
}
instancePtr->gc = None;
- Tcl_AddErrorInfo(masterPtr->interp, "\n (while configuring image \"");
- Tcl_AddErrorInfo(masterPtr->interp, Tk_NameOfImage(masterPtr->tkMaster));
- Tcl_AddErrorInfo(masterPtr->interp, "\")");
+ Tcl_AppendObjToErrorInfo(masterPtr->interp, Tcl_ObjPrintf(
+ "\n (while configuring image \"%s\")", Tk_NameOfImage(
+ masterPtr->tkMaster)));
Tcl_BackgroundError(masterPtr->interp);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -473,8 +472,8 @@ ImgBmapConfigureInstance(
char *
TkGetBitmapData(
Tcl_Interp *interp, /* For reporting errors, or NULL. */
- char *string, /* String describing bitmap. May be NULL. */
- char *fileName, /* Name of file containing bitmap description.
+ const char *string, /* String describing bitmap. May be NULL. */
+ const char *fileName, /* Name of file containing bitmap description.
* Used only if string is NULL. Must not be
* NULL if string is NULL. */
int *widthPtr, int *heightPtr,
@@ -482,7 +481,7 @@ TkGetBitmapData(
int *hotXPtr, int *hotYPtr) /* Position of hot spot or -1,-1. */
{
int width, height, numBytes, hotX, hotY;
- CONST char *expandedFileName;
+ const char *expandedFileName;
char *p, *end;
ParseInfo pi;
char *data = NULL;
@@ -611,7 +610,7 @@ TkGetBitmapData(
goto error;
}
numBytes = ((width+7)/8) * height;
- data = (char *) ckalloc((unsigned) numBytes);
+ data = ckalloc(numBytes);
for (p = data; numBytes > 0; p++, numBytes--) {
if (NextBitmapWord(&pi) != TCL_OK) {
goto error;
@@ -649,7 +648,7 @@ TkGetBitmapData(
}
return NULL;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -674,7 +673,8 @@ NextBitmapWord(
ParseInfo *parseInfoPtr) /* Describes what we're reading and where we
* are in it. */
{
- char *src, *dst;
+ const char *src;
+ char *dst;
int c;
parseInfoPtr->wordLength = 0;
@@ -718,7 +718,7 @@ NextBitmapWord(
parseInfoPtr->word[parseInfoPtr->wordLength] = 0;
return TCL_OK;
}
-
+
/*
*--------------------------------------------------------------
*
@@ -742,14 +742,14 @@ ImgBmapCmd(
ClientData clientData, /* Information about the image master. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *bmapOptions[] = {"cget", "configure", NULL};
- BitmapMaster *masterPtr = (BitmapMaster *) clientData;
+ static const char *const bmapOptions[] = {"cget", "configure", NULL};
+ BitmapMaster *masterPtr = clientData;
int index;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], bmapOptions, "option", 0,
@@ -781,7 +781,7 @@ ImgBmapCmd(
return TCL_OK;
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -807,7 +807,7 @@ ImgBmapGet(
ClientData masterData) /* Pointer to our master structure for the
* image. */
{
- BitmapMaster *masterPtr = (BitmapMaster *) masterData;
+ BitmapMaster *masterPtr = masterData;
BitmapInstance *instancePtr;
/*
@@ -819,7 +819,7 @@ ImgBmapGet(
instancePtr = instancePtr->nextPtr) {
if (instancePtr->tkwin == tkwin) {
instancePtr->refCount++;
- return (ClientData) instancePtr;
+ return instancePtr;
}
}
@@ -828,7 +828,7 @@ ImgBmapGet(
* the image.
*/
- instancePtr = (BitmapInstance *) ckalloc(sizeof(BitmapInstance));
+ instancePtr = ckalloc(sizeof(BitmapInstance));
instancePtr->refCount = 1;
instancePtr->masterPtr = masterPtr;
instancePtr->tkwin = tkwin;
@@ -850,9 +850,9 @@ ImgBmapGet(
masterPtr->height);
}
- return (ClientData) instancePtr;
+ return instancePtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -882,7 +882,7 @@ ImgBmapDisplay(
/* Coordinates within drawable that correspond
* to imageX and imageY. */
{
- BitmapInstance *instancePtr = (BitmapInstance *) clientData;
+ BitmapInstance *instancePtr = clientData;
int masking;
/*
@@ -912,7 +912,7 @@ ImgBmapDisplay(
XSetClipOrigin(display, instancePtr->gc, 0, 0);
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -936,7 +936,7 @@ ImgBmapFree(
* instance to be displayed. */
Display *display) /* Display containing window that used image. */
{
- BitmapInstance *instancePtr = (BitmapInstance *) clientData;
+ BitmapInstance *instancePtr = clientData;
BitmapInstance *prevPtr;
instancePtr->refCount--;
@@ -973,9 +973,9 @@ ImgBmapFree(
}
prevPtr->nextPtr = instancePtr->nextPtr;
}
- ckfree((char *) instancePtr);
+ ckfree(instancePtr);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -998,7 +998,7 @@ ImgBmapDelete(
ClientData masterData) /* Pointer to BitmapMaster structure for
* image. Must not have any more instances. */
{
- BitmapMaster *masterPtr = (BitmapMaster *) masterData;
+ BitmapMaster *masterPtr = masterData;
if (masterPtr->instancePtr != NULL) {
Tcl_Panic("tried to delete bitmap image when instances still exist");
@@ -1014,9 +1014,9 @@ ImgBmapDelete(
ckfree(masterPtr->maskData);
}
Tk_FreeOptions(configSpecs, (char *) masterPtr, NULL, 0);
- ckfree((char *) masterPtr);
+ ckfree(masterPtr);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1039,14 +1039,14 @@ ImgBmapCmdDeletedProc(
ClientData clientData) /* Pointer to BitmapMaster structure for
* image. */
{
- BitmapMaster *masterPtr = (BitmapMaster *) clientData;
+ BitmapMaster *masterPtr = clientData;
masterPtr->imageCmd = NULL;
if (masterPtr->tkMaster != NULL) {
Tk_DeleteImage(masterPtr->interp, Tk_NameOfImage(masterPtr->tkMaster));
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1078,7 +1078,7 @@ GetByte(
}
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1131,7 +1131,7 @@ ImgBmapPsImagemask(
* within a byte so that the bits will be in the order postscript expects.
*/
- static unsigned char bit_reverse[] = {
+ static const 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,
@@ -1174,7 +1174,7 @@ ImgBmapPsImagemask(
Tcl_AppendResult(interp, ">} imagemask \n", NULL);
return TCL_OK;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -1203,7 +1203,7 @@ ImgBmapPostscript(
int x, int y, int width, int height,
int prepass)
{
- BitmapMaster *masterPtr = (BitmapMaster *) clientData;
+ BitmapMaster *masterPtr = clientData;
char buffer[200];
if (prepass) {
@@ -1281,7 +1281,7 @@ ImgBmapPostscript(
}
return TCL_OK;
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index e576559..4cbf94d 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -11,7 +11,7 @@
* Copyright (c) Reed Wade (wade@cs.utk.edu), University of Tennessee
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright (c) 1997 Australian National University
- * Copyright (c) 2005 Donal K. Fellows
+ * Copyright (c) 2005-2010 Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -28,9 +28,6 @@
* | notice appear in supporting documentation. This software is |
* | provided "as is" without express or implied warranty. |
* +--------------------------------------------------------------------+
- *
- * This file also contains code from miGIF. See lower down in file for the
- * applicable copyright notice for that portion.
*/
#include "tkInt.h"
@@ -110,6 +107,14 @@ typedef struct {
} GIFImageConfig;
/*
+ * Type of a function used to do the writing to a file or buffer when
+ * serializing in the GIF format.
+ */
+
+typedef int (WriteBytesFunc) (ClientData clientData, const char *bytes,
+ int byteCount);
+
+/*
* The format record for the GIF file format:
*/
@@ -128,8 +133,11 @@ static int StringReadGIF(Tcl_Interp *interp, Tcl_Obj *dataObj,
int srcX, int srcY);
static int FileWriteGIF(Tcl_Interp *interp, const char *filename,
Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
-static int CommonWriteGIF(Tcl_Interp *interp, Tcl_Channel handle,
- Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
+static int StringWriteGIF(Tcl_Interp *interp, Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr);
+static int CommonWriteGIF(Tcl_Interp *interp, ClientData clientData,
+ WriteBytesFunc *writeProc, Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr);
Tk_PhotoImageFormat tkImgFmtGIF = {
"gif", /* name */
@@ -138,7 +146,8 @@ Tk_PhotoImageFormat tkImgFmtGIF = {
FileReadGIF, /* fileReadProc */
StringReadGIF, /* stringReadProc */
FileWriteGIF, /* fileWriteProc */
- NULL, /* stringWriteProc */
+ StringWriteGIF, /* stringWriteProc */
+ NULL
};
#define INTERLACE 0x40
@@ -186,6 +195,135 @@ static int Mgetc(MFile *handle);
static int char64(int c);
static void mInit(unsigned char *string, MFile *handle,
int length);
+
+/*
+ * Types, defines and variables needed to write and compress a GIF.
+ */
+
+#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 DEFAULT_BACKGROUND_VALUE 0xD9
+
+typedef struct {
+ int ssize;
+ int csize;
+ int rsize;
+ unsigned char *pixelOffset;
+ int pixelSize;
+ int pixelPitch;
+ int greenOffset;
+ int blueOffset;
+ int alphaOffset;
+ int num;
+ unsigned char mapa[MAXCOLORMAPSIZE][3];
+} GifWriterState;
+
+typedef int (* ifunptr) (GifWriterState *statePtr);
+
+/*
+ * Support for compression of GIFs.
+ */
+
+#define MAXCODE(numBits) (((long) 1 << (numBits)) - 1)
+
+#ifdef SIGNED_COMPARE_SLOW
+#define U(x) ((unsigned) (x))
+#else
+#define U(x) (x)
+#endif
+
+typedef struct {
+ int numBits; /* Number of bits/code. */
+ long maxCode; /* Maximum code, given numBits. */
+ int hashTable[HSIZE];
+ unsigned int codeTable[HSIZE];
+ long hSize; /* For dynamic table sizing. */
+
+ /*
+ * To save much memory, we overlay the table used by compress() with those
+ * used by decompress(). The tab_prefix table is the same size and type as
+ * the codeTable. The tab_suffix table needs 2**GIFBITS characters. We get
+ * this from the beginning of hashTable. The output stack uses the rest of
+ * hashTable, and contains characters. There is plenty of room for any
+ * possible stack (stack used to be 8000 characters).
+ */
+
+ int freeEntry; /* First unused entry. */
+
+ /*
+ * Block compression parameters. After all codes are used up, and
+ * compression rate changes, start over.
+ */
+
+ int clearFlag;
+
+ int offset;
+ unsigned int inCount; /* Length of input */
+ unsigned int outCount; /* # of codes output (for debugging) */
+
+ /*
+ * Algorithm: use open addressing double hashing (no chaining) on the
+ * prefix code / next character combination. We do a variant of Knuth's
+ * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime
+ * secondary probe. Here, the modular division first probe is gives way to
+ * a faster exclusive-or manipulation. Also do block compression with an
+ * adaptive reset, whereby the code table is cleared when the compression
+ * ratio decreases, but after the table fills. The variable-length output
+ * codes are re-sized at this point, and a special CLEAR code is generated
+ * for the decompressor. Late addition: construct the table according to
+ * file size for noticeable speed improvement on small files. Please
+ * direct questions about this implementation to ames!jaw.
+ */
+
+ int initialBits;
+ ClientData destination;
+ WriteBytesFunc *writeProc;
+
+ int clearCode;
+ int eofCode;
+
+ unsigned long currentAccumulated;
+ int currentBits;
+
+ /*
+ * Number of characters so far in this 'packet'
+ */
+
+ int accumulatedByteCount;
+
+ /*
+ * Define the storage for the packet accumulator
+ */
+
+ unsigned char packetAccumulator[256];
+} GIFState_t;
+
+/*
+ * Definition of new functions to write GIFs
+ */
+
+static int ColorNumber(GifWriterState *statePtr,
+ int red, int green, int blue);
+static void Compress(int initBits, ClientData handle,
+ WriteBytesFunc *writeProc, ifunptr readValue,
+ GifWriterState *statePtr);
+static int IsNewColor(GifWriterState *statePtr,
+ int red, int green, int blue);
+static void SaveMap(GifWriterState *statePtr,
+ Tk_PhotoImageBlock *blockPtr);
+static int ReadValue(GifWriterState *statePtr);
+static WriteBytesFunc WriteToChannel;
+static WriteBytesFunc WriteToByteArray;
+static void Output(GIFState_t *statePtr, long code);
+static void ClearForBlock(GIFState_t *statePtr);
+static void ClearHashTable(GIFState_t *statePtr, int hSize);
+static void CharInit(GIFState_t *statePtr);
+static void CharOut(GIFState_t *statePtr, int c);
+static void FlushChar(GIFState_t *statePtr);
/*
*----------------------------------------------------------------------
@@ -262,7 +400,7 @@ FileReadGIF(
int bitPixel;
unsigned char colorMap[MAXCOLORMAPSIZE][4];
int transparent = -1;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-index", NULL
};
GIFImageConfig gifConf, *gifConfPtr = &gifConf;
@@ -434,7 +572,7 @@ FileReadGIF(
if (trashBuffer == NULL) {
nBytes = fileWidth * fileHeight * 3;
- trashBuffer = (unsigned char *) ckalloc((unsigned) nBytes);
+ trashBuffer = ckalloc(nBytes);
}
/*
@@ -518,20 +656,20 @@ FileReadGIF(
block.offset[3] = (transparent>=0) ? 3 : 0;
block.pitch = block.pixelSize * imageWidth;
nBytes = block.pitch * imageHeight;
- block.pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes);
+ block.pixelPtr = ckalloc(nBytes);
if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth,
imageHeight, colorMap, srcX, srcY, BitSet(buf[8],INTERLACE),
transparent) != TCL_OK) {
- ckfree((char *) block.pixelPtr);
+ ckfree(block.pixelPtr);
goto error;
}
if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
- ckfree((char *) block.pixelPtr);
+ ckfree(block.pixelPtr);
goto error;
}
- ckfree((char *) block.pixelPtr);
+ ckfree(block.pixelPtr);
}
/*
@@ -548,7 +686,7 @@ FileReadGIF(
*/
if (trashBuffer != NULL) {
- ckfree((char *) trashBuffer);
+ ckfree(trashBuffer);
}
return result;
}
@@ -1414,8 +1552,8 @@ Fread(
* 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>
+ * Modified for transparency handling (gif89a)
+ * by Jan Nijtmans <nijtmans@users.sourceforge.net>
*
*----------------------------------------------------------------------
* FileWriteGIF-
@@ -1424,54 +1562,12 @@ Fread(
* data from a photo image into a given file
*
* Results:
- * A standard TCL completion code. If TCL_ERROR is returned then an error
- * message is left in interp->result.
+ * A standard TCL completion code. If TCL_ERROR is returned then an
+ * error message is left in the interp's result.
*
*----------------------------------------------------------------------
*/
-/*
- * Types, defines and variables needed to write and compress a GIF.
- */
-
-typedef int (* ifunptr) (ClientData clientData);
-
-#define LSB(a) ((unsigned char) (((short)(a)) & 0x00FF))
-#define MSB(a) ((unsigned char) (((short)(a)) >> 8))
-
-#define GIFBITS 12
-#define HSIZE 5003 /* 80% occupancy */
-
-typedef struct {
- int ssize;
- int csize;
- int rsize;
- unsigned char *pixelo;
- int pixelSize;
- int pixelPitch;
- int greenOffset;
- int blueOffset;
- int alphaOffset;
- int num;
- unsigned char mapa[MAXCOLORMAPSIZE][3];
-} GifWriterState;
-
-/*
- * Definition of new functions to write GIFs
- */
-
-static int color(GifWriterState *statePtr,
- int red, int green, int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3]);
-static void compress(int initBits, Tcl_Channel handle,
- ifunptr readValue, ClientData clientData);
-static int nuevo(GifWriterState *statePtr,
- int red, int green, int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3]);
-static void savemap(GifWriterState *statePtr,
- Tk_PhotoImageBlock *blockPtr,
- unsigned char mapa[MAXCOLORMAPSIZE][3]);
-static int ReadValue(ClientData clientData);
static int
FileWriteGIF(
@@ -1493,22 +1589,69 @@ FileWriteGIF(
return TCL_ERROR;
}
- result = CommonWriteGIF(interp, chan, format, blockPtr);
+ result = CommonWriteGIF(interp, chan, WriteToChannel, format, blockPtr);
if (Tcl_Close(interp, chan) == TCL_ERROR) {
return TCL_ERROR;
}
return result;
}
+
+static int
+StringWriteGIF(
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors and
+ * returning the GIF data. */
+ Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr)
+{
+ int result;
+ Tcl_Obj *objPtr = Tcl_NewObj();
+
+ Tcl_IncrRefCount(objPtr);
+ result = CommonWriteGIF(interp, objPtr, WriteToByteArray, format,
+ blockPtr);
+ if (result == TCL_OK) {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ Tcl_DecrRefCount(objPtr);
+ return result;
+}
+
+static int
+WriteToChannel(
+ ClientData clientData,
+ const char *bytes,
+ int byteCount)
+{
+ Tcl_Channel handle = clientData;
+
+ return Tcl_Write(handle, bytes, byteCount);
+}
+
+static int
+WriteToByteArray(
+ ClientData clientData,
+ const char *bytes,
+ int byteCount)
+{
+ Tcl_Obj *objPtr = clientData;
+ Tcl_Obj *tmpObj = Tcl_NewByteArrayObj((unsigned char *) bytes, byteCount);
+
+ Tcl_IncrRefCount(tmpObj);
+ Tcl_AppendObjToObj(objPtr, tmpObj);
+ Tcl_DecrRefCount(tmpObj);
+ return byteCount;
+}
static int
CommonWriteGIF(
Tcl_Interp *interp,
- Tcl_Channel handle,
+ ClientData handle,
+ WriteBytesFunc *writeProc,
Tcl_Obj *format,
Tk_PhotoImageBlock *blockPtr)
{
- GifWriterState state, *statePtr = &state;
+ GifWriterState state;
int resolution;
long width, height, x;
unsigned char c;
@@ -1517,140 +1660,140 @@ CommonWriteGIF(
top = 0;
left = 0;
- memset(statePtr, 0, sizeof(state));
+ memset(&state, 0, sizeof(state));
- statePtr->pixelSize = blockPtr->pixelSize;
- statePtr->greenOffset = blockPtr->offset[1]-blockPtr->offset[0];
- statePtr->blueOffset = blockPtr->offset[2]-blockPtr->offset[0];
- statePtr->alphaOffset = blockPtr->offset[0];
- if (statePtr->alphaOffset < blockPtr->offset[2]) {
- statePtr->alphaOffset = blockPtr->offset[2];
+ state.pixelSize = blockPtr->pixelSize;
+ state.greenOffset = blockPtr->offset[1]-blockPtr->offset[0];
+ state.blueOffset = blockPtr->offset[2]-blockPtr->offset[0];
+ state.alphaOffset = blockPtr->offset[0];
+ if (state.alphaOffset < blockPtr->offset[2]) {
+ state.alphaOffset = blockPtr->offset[2];
}
- if (++statePtr->alphaOffset < statePtr->pixelSize) {
- statePtr->alphaOffset -= blockPtr->offset[0];
+ if (++state.alphaOffset < state.pixelSize) {
+ state.alphaOffset -= blockPtr->offset[0];
} else {
- statePtr->alphaOffset = 0;
+ state.alphaOffset = 0;
}
- Tcl_Write(handle, (char *) (statePtr->alphaOffset ? GIF89a : GIF87a), 6);
+ writeProc(handle, (char *) (state.alphaOffset ? GIF89a : GIF87a), 6);
- for (x=0 ; x<MAXCOLORMAPSIZE ; x++) {
- statePtr->mapa[x][CM_RED] = 255;
- statePtr->mapa[x][CM_GREEN] = 255;
- statePtr->mapa[x][CM_BLUE] = 255;
+ for (x = 0; x < MAXCOLORMAPSIZE ;x++) {
+ state.mapa[x][CM_RED] = 255;
+ state.mapa[x][CM_GREEN] = 255;
+ state.mapa[x][CM_BLUE] = 255;
}
width = blockPtr->width;
height = blockPtr->height;
- statePtr->pixelo = blockPtr->pixelPtr + blockPtr->offset[0];
- statePtr->pixelPitch = blockPtr->pitch;
- savemap(statePtr, blockPtr, statePtr->mapa);
- if (statePtr->num >= MAXCOLORMAPSIZE) {
+ state.pixelOffset = blockPtr->pixelPtr + blockPtr->offset[0];
+ state.pixelPitch = blockPtr->pitch;
+ SaveMap(&state, blockPtr);
+ if (state.num >= MAXCOLORMAPSIZE) {
Tcl_AppendResult(interp, "too many colors", NULL);
return TCL_ERROR;
}
- if (statePtr->num<2) {
- statePtr->num = 2;
+ if (state.num<2) {
+ state.num = 2;
}
c = LSB(width);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(width);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = LSB(height);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(height);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
resolution = 0;
- while (statePtr->num >> resolution) {
+ while (state.num >> resolution) {
resolution++;
}
c = 111 + resolution * 17;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
- statePtr->num = 1 << resolution;
+ state.num = 1 << resolution;
/*
* Background color
*/
c = 0;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
/*
* Zero for future expansion.
*/
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
- for (x=0 ; x<statePtr->num ; x++) {
- c = statePtr->mapa[x][CM_RED];
- Tcl_Write(handle, (char *) &c, 1);
- c = statePtr->mapa[x][CM_GREEN];
- Tcl_Write(handle, (char *) &c, 1);
- c = statePtr->mapa[x][CM_BLUE];
- Tcl_Write(handle, (char *) &c, 1);
+ for (x = 0; x < state.num; x++) {
+ c = state.mapa[x][CM_RED];
+ writeProc(handle, (char *) &c, 1);
+ c = state.mapa[x][CM_GREEN];
+ writeProc(handle, (char *) &c, 1);
+ c = state.mapa[x][CM_BLUE];
+ writeProc(handle, (char *) &c, 1);
}
/*
* Write out extension for transparent colour index, if necessary.
*/
- if (statePtr->alphaOffset) {
+ if (state.alphaOffset) {
c = GIF_EXTENSION;
- Tcl_Write(handle, (char *) &c, 1);
- Tcl_Write(handle, "\371\4\1\0\0\0", 7);
+ writeProc(handle, (char *) &c, 1);
+ writeProc(handle, "\371\4\1\0\0\0", 7);
}
c = GIF_START;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = LSB(top);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(top);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = LSB(left);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(left);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = LSB(width);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(width);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = LSB(height);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = MSB(height);
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = 0;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = resolution;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
- statePtr->ssize = statePtr->rsize = blockPtr->width;
- statePtr->csize = blockPtr->height;
- compress(resolution+1, handle, ReadValue, (ClientData) statePtr);
+ state.ssize = state.rsize = blockPtr->width;
+ state.csize = blockPtr->height;
+ Compress(resolution+1, handle, writeProc, ReadValue, &state);
c = 0;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
c = GIF_TERMINATOR;
- Tcl_Write(handle, (char *) &c, 1);
+ writeProc(handle, (char *) &c, 1);
return TCL_OK;
}
static int
-color(
+ColorNumber(
GifWriterState *statePtr,
- int red, int green, int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3])
+ int red, int green, int blue)
{
int x = (statePtr->alphaOffset != 0);
- for (; x<=MAXCOLORMAPSIZE ; x++) {
- if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) &&
- (mapa[x][CM_BLUE] == blue)) {
+ for (; x <= MAXCOLORMAPSIZE; x++) {
+ if ((statePtr->mapa[x][CM_RED] == red) &&
+ (statePtr->mapa[x][CM_GREEN] == green) &&
+ (statePtr->mapa[x][CM_BLUE] == blue)) {
return x;
}
}
@@ -1658,16 +1801,16 @@ color(
}
static int
-nuevo(
+IsNewColor(
GifWriterState *statePtr,
- int red, int green, int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3])
+ int red, int green, int blue)
{
int x = (statePtr->alphaOffset != 0);
for (; x<=statePtr->num ; x++) {
- if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) &&
- (mapa[x][CM_BLUE] == blue)) {
+ if ((statePtr->mapa[x][CM_RED] == red) &&
+ (statePtr->mapa[x][CM_GREEN] == green) &&
+ (statePtr->mapa[x][CM_BLUE] == blue)) {
return 0;
}
}
@@ -1675,10 +1818,9 @@ nuevo(
}
static void
-savemap(
+SaveMap(
GifWriterState *statePtr,
- Tk_PhotoImageBlock *blockPtr,
- unsigned char mapa[MAXCOLORMAPSIZE][3])
+ Tk_PhotoImageBlock *blockPtr)
{
unsigned char *colores;
int x, y;
@@ -1686,9 +1828,9 @@ savemap(
if (statePtr->alphaOffset) {
statePtr->num = 0;
- mapa[0][CM_RED] = 0xd9;
- mapa[0][CM_GREEN] = 0xd9;
- mapa[0][CM_BLUE] = 0xd9;
+ statePtr->mapa[0][CM_RED] = DEFAULT_BACKGROUND_VALUE;
+ statePtr->mapa[0][CM_GREEN] = DEFAULT_BACKGROUND_VALUE;
+ statePtr->mapa[0][CM_BLUE] = DEFAULT_BACKGROUND_VALUE;
} else {
statePtr->num = -1;
}
@@ -1700,14 +1842,14 @@ savemap(
red = colores[0];
green = colores[statePtr->greenOffset];
blue = colores[statePtr->blueOffset];
- if (nuevo(statePtr, red, green, blue, mapa)) {
+ if (IsNewColor(statePtr, red, green, blue)) {
statePtr->num++;
if (statePtr->num >= MAXCOLORMAPSIZE) {
return;
}
- mapa[statePtr->num][CM_RED] = red;
- mapa[statePtr->num][CM_GREEN] = green;
- mapa[statePtr->num][CM_BLUE] = blue;
+ statePtr->mapa[statePtr->num][CM_RED] = red;
+ statePtr->mapa[statePtr->num][CM_GREEN] = green;
+ statePtr->mapa[statePtr->num][CM_BLUE] = blue;
}
}
colores += statePtr->pixelSize;
@@ -1717,26 +1859,26 @@ savemap(
static int
ReadValue(
- ClientData clientData)
+ GifWriterState *statePtr)
{
- GifWriterState *statePtr = (GifWriterState *) clientData;
unsigned int col;
if (statePtr->csize == 0) {
return EOF;
}
- if (statePtr->alphaOffset && statePtr->pixelo[statePtr->alphaOffset]==0) {
+ if (statePtr->alphaOffset
+ && (statePtr->pixelOffset[statePtr->alphaOffset]==0)) {
col = 0;
} else {
- col = color(statePtr, statePtr->pixelo[0],
- statePtr->pixelo[statePtr->greenOffset],
- statePtr->pixelo[statePtr->blueOffset], statePtr->mapa);
+ col = ColorNumber(statePtr, statePtr->pixelOffset[0],
+ statePtr->pixelOffset[statePtr->greenOffset],
+ statePtr->pixelOffset[statePtr->blueOffset]);
}
- statePtr->pixelo += statePtr->pixelSize;
+ statePtr->pixelOffset += statePtr->pixelSize;
if (--statePtr->ssize <= 0) {
statePtr->ssize = statePtr->rsize;
statePtr->csize--;
- statePtr->pixelo += statePtr->pixelPitch
+ statePtr->pixelOffset += statePtr->pixelPitch
- (statePtr->rsize * statePtr->pixelSize);
}
@@ -1744,501 +1886,308 @@ ReadValue(
}
/*
- *-----------------------------------------------------------------------
- *
- * miGIF Compression - mouse and ivo's GIF-compatible compression
- *
- * -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.
- *
- * 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.
+ * GIF Image compression - modified 'Compress'
*
- * der Mouse
- * mouse@rodents.montreal.qc.ca
- * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
+ * Based on: compress.c - File compression ala IEEE Computer, June 1984.
*
- * 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.
- *
- *-----------------------------------------------------------------------
+ * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
+ * Jim McKie (decvax!mcvax!jim)
+ * Steve Davies (decvax!vax135!petsd!peora!srd)
+ * Ken Turkowski (decvax!decwrl!turtlevax!ken)
+ * James A. Woods (decvax!ihnp4!ames!jaw)
+ * Joe Orost (decvax!vax135!petsd!joe)
*/
-
-typedef struct {
- int runlengthPixel;
- int runlengthBaseCode;
- int runlengthCount;
- int runlengthTablePixel;
- int runlengthTableMax;
- int justCleared;
- int outputBits;
- int outputBitsInit;
- int outputCount;
- int outputBump;
- int outputBumpInit;
- int outputClear;
- int outputClearInit;
- int maxOcodes;
- int codeClear;
- int codeEOF;
- unsigned int obuf;
- int obits;
- Tcl_Channel ofile;
- unsigned char oblock[256];
- int oblen;
-} miGIFState_t;
-/*
- * Used only when debugging GIF compression code
- */
-/* #define MIGIF_DEBUGGING_ENVARS */
+static void
+Compress(
+ int initialBits,
+ ClientData handle,
+ WriteBytesFunc *writeProc,
+ ifunptr readValue,
+ GifWriterState *statePtr)
+{
+ long fcode, ent, disp, hSize, i = 0;
+ int c, hshift;
+ GIFState_t state;
-#ifdef MIGIF_DEBUGGING_ENVARS
+ memset(&state, 0, sizeof(state));
-/*
- * This debugging code is _absolutely_ not thread-safe. It's also not normally
- * enabled either.
- */
+ /*
+ * Set up the globals: initialBits - initial number of bits
+ * outChannel - pointer to output file
+ */
-static int verboseSet = 0;
-static int verbose;
-#define MIGIF_VERBOSE (verboseSet?verbose:setVerbose())
-#define DEBUGMSG(printfArgs) if (MIGIF_VERBOSE) { printf printfArgs; }
+ state.initialBits = initialBits;
+ state.destination = handle;
+ state.writeProc = writeProc;
-static int
-setVerbose(void)
-{
- verbose = !!getenv("MIGIF_VERBOSE");
- verboseSet = 1;
- return verbose;
-}
+ /*
+ * Set up the necessary values.
+ */
-static const char *
-binformat(
- 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++ = '.';
- }
+ state.offset = 0;
+ state.hSize = HSIZE;
+ state.outCount = 0;
+ state.clearFlag = 0;
+ state.inCount = 1;
+ state.maxCode = MAXCODE(state.numBits = state.initialBits);
+ state.clearCode = 1 << (initialBits - 1);
+ state.eofCode = state.clearCode + 1;
+ state.freeEntry = state.clearCode + 2;
+ CharInit(&state);
+
+ ent = readValue(statePtr);
+
+ hshift = 0;
+ for (fcode = (long) state.hSize; fcode < 65536L; fcode *= 2L) {
+ hshift++;
}
- *bp = '\0';
- return &bufs[bhand][0];
-}
-#else /* !MIGIF_DEBUGGING_ENVARS */
-#define DEBUGMSG(printfArgs) /* do nothing */
-#endif
-
-static void
-writeBlock(
- miGIFState_t *statePtr)
-{
- unsigned char c;
+ hshift = 8 - hshift; /* Set hash code range bound */
+
+ hSize = state.hSize;
+ ClearHashTable(&state, (int) hSize); /* Clear hash table */
+
+ Output(&state, (long) state.clearCode);
+
+ while (U(c = readValue(statePtr)) != U(EOF)) {
+ state.inCount++;
-#ifdef MIGIF_DEBUGGING_ENVARS
- if (MIGIF_VERBOSE) {
- int i;
- printf("writeBlock %d:", statePtr->oblen);
- for (i=0 ; i<statePtr->oblen ; i++) {
- printf(" %02x", statePtr->oblock[i]);
+ fcode = (long) (((long) c << GIFBITS) + ent);
+ i = ((long)c << hshift) ^ ent; /* XOR hashing */
+
+ if (state.hashTable[i] == fcode) {
+ ent = state.codeTable[i];
+ continue;
+ } else if ((long) state.hashTable[i] < 0) { /* Empty slot */
+ goto nomatch;
+ }
+
+ disp = hSize - i; /* Secondary hash (after G. Knott) */
+ if (i == 0) {
+ disp = 1;
+ }
+
+ probe:
+ if ((i -= disp) < 0) {
+ i += hSize;
+ }
+
+ if (state.hashTable[i] == fcode) {
+ ent = state.codeTable[i];
+ continue;
+ }
+ if ((long) state.hashTable[i] > 0) {
+ goto probe;
+ }
+
+ nomatch:
+ Output(&state, (long) ent);
+ state.outCount++;
+ ent = c;
+ if (U(state.freeEntry) < U((long)1 << GIFBITS)) {
+ state.codeTable[i] = state.freeEntry++; /* code -> hashtable */
+ state.hashTable[i] = fcode;
+ } else {
+ ClearForBlock(&state);
}
- printf("\n");
- }
-#endif
- c = statePtr->oblen;
- Tcl_Write(statePtr->ofile, (char *) &c, 1);
- Tcl_Write(statePtr->ofile, (char *) &statePtr->oblock[0], statePtr->oblen);
- statePtr->oblen = 0;
-}
-
-static void
-blockOut(
- miGIFState_t *statePtr,
- unsigned c)
-{
- DEBUGMSG(("blockOut %s\n", binformat(c, 8)));
- statePtr->oblock[statePtr->oblen++] = (unsigned char) c;
- if (statePtr->oblen >= 255) {
- writeBlock(statePtr);
- }
-}
-
-static void
-blockFlush(
- miGIFState_t *statePtr)
-{
- DEBUGMSG(("blockFlush\n"));
- if (statePtr->oblen > 0) {
- writeBlock(statePtr);
- }
-}
-
-static void
-output(
- miGIFState_t *statePtr,
- int val)
-{
- DEBUGMSG(("output %s [%s %d %d]\n", binformat(val, statePtr->outputBits),
- binformat(statePtr->obuf, statePtr->obits), statePtr->obits,
- statePtr->outputBits));
- statePtr->obuf |= val << statePtr->obits;
- statePtr->obits += statePtr->outputBits;
- while (statePtr->obits >= 8) {
- blockOut(statePtr, statePtr->obuf & 0xff);
- statePtr->obuf >>= 8;
- statePtr->obits -= 8;
- }
- DEBUGMSG(("output leaving [%s %d]\n",
- binformat(statePtr->obuf, statePtr->obits), statePtr->obits));
-}
-
-static void
-outputFlush(
- miGIFState_t *statePtr)
-{
- DEBUGMSG(("outputFlush\n"));
- if (statePtr->obits > 0) {
- blockOut(statePtr, statePtr->obuf);
}
- blockFlush(statePtr);
-}
-
-static void
-didClear(
- miGIFState_t *statePtr)
-{
- DEBUGMSG(("didClear\n"));
- statePtr->outputBits = statePtr->outputBitsInit;
- statePtr->outputBump = statePtr->outputBumpInit;
- statePtr->outputClear = statePtr->outputClearInit;
- statePtr->outputCount = 0;
- statePtr->runlengthTableMax = 0;
- statePtr->justCleared = 1;
+
+ /*
+ * Put out the final code.
+ */
+
+ Output(&state, (long) ent);
+ state.outCount++;
+ Output(&state, (long) state.eofCode);
}
+/*****************************************************************
+ * Output --
+ * Output the given code.
+ *
+ * Inputs:
+ * code: A numBits-bit integer. If == -1, then EOF. This assumes that
+ * numBits =< (long) wordsize - 1.
+ * Outputs:
+ * Outputs code to the file.
+ * Assumptions:
+ * Chars are 8 bits long.
+ * Algorithm:
+ * Maintain a GIFBITS character long buffer (so that 8 codes will fit in
+ * it exactly). Use the VAX insv instruction to insert each code in turn.
+ * When the buffer fills up empty it and start over.
+ */
+
static void
-outputPlain(
- miGIFState_t *statePtr,
- int c)
+Output(
+ GIFState_t *statePtr,
+ long code)
{
- DEBUGMSG(("outputPlain %s\n", binformat(c, statePtr->outputBits)));
- statePtr->justCleared = 0;
- output(statePtr, c);
- statePtr->outputCount++;
- if (statePtr->outputCount >= statePtr->outputBump) {
- statePtr->outputBits++;
- statePtr->outputBump += 1 << (statePtr->outputBits - 1);
- }
- if (statePtr->outputCount >= statePtr->outputClear) {
- output(statePtr, statePtr->codeClear);
- didClear(statePtr);
+ static const unsigned long masks[] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000F,
+ 0x001F, 0x003F, 0x007F, 0x00FF,
+ 0x01FF, 0x03FF, 0x07FF, 0x0FFF,
+ 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF
+ };
+
+ statePtr->currentAccumulated &= masks[statePtr->currentBits];
+ if (statePtr->currentBits > 0) {
+ statePtr->currentAccumulated |= ((long) code << statePtr->currentBits);
+ } else {
+ statePtr->currentAccumulated = code;
}
-}
-
-static unsigned int
-isqrt(
- unsigned int x)
-{
- unsigned int r;
- unsigned int v;
+ statePtr->currentBits += statePtr->numBits;
- if (x < 2) {
- return x;
+ while (statePtr->currentBits >= 8) {
+ CharOut(statePtr, (unsigned) (statePtr->currentAccumulated & 0xff));
+ statePtr->currentAccumulated >>= 8;
+ statePtr->currentBits -= 8;
}
- 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;
+
+ /*
+ * If the next entry is going to be too big for the code size, then
+ * increase it, if possible.
+ */
+
+ if ((statePtr->freeEntry > statePtr->maxCode) || statePtr->clearFlag) {
+ if (statePtr->clearFlag) {
+ statePtr->maxCode = MAXCODE(
+ statePtr->numBits = statePtr->initialBits);
+ statePtr->clearFlag = 0;
+ } else {
+ statePtr->numBits++;
+ if (statePtr->numBits == GIFBITS) {
+ statePtr->maxCode = (long)1 << GIFBITS;
+ } else {
+ statePtr->maxCode = MAXCODE(statePtr->numBits);
+ }
}
- r = v;
}
-}
-
-static int
-computeTriangleCount(
- 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 = isqrt(count);
+ if (code == statePtr->eofCode) {
+ /*
+ * At EOF, write the rest of the buffer.
+ */
- while (n*(n+1) >= 2*count) {
- n--;
- }
- while (n*(n+1) < 2*count) {
- n++;
+ while (statePtr->currentBits > 0) {
+ CharOut(statePtr,
+ (unsigned) (statePtr->currentAccumulated & 0xff));
+ statePtr->currentAccumulated >>= 8;
+ statePtr->currentBits -= 8;
}
- cost += n;
- }
- return (int) cost + 1;
-}
-
-static void
-maxOutputClear(
- miGIFState_t *statePtr)
-{
- statePtr->outputClear = statePtr->maxOcodes;
-}
-
-static void
-resetOutputClear(
- miGIFState_t *statePtr)
-{
- statePtr->outputClear = statePtr->outputClearInit;
- if (statePtr->outputCount >= statePtr->outputClear) {
- output(statePtr, statePtr->codeClear);
- didClear(statePtr);
+ FlushChar(statePtr);
}
}
+/*
+ * Clear out the hash table
+ */
+
static void
-runlengthFlushFromClear(
- miGIFState_t *statePtr,
- int count)
+ClearForBlock( /* Table clear for block compress. */
+ GIFState_t *statePtr)
{
- int n;
-
- DEBUGMSG(("runlengthFlushFromClear %d\n", count));
- maxOutputClear(statePtr);
- statePtr->runlengthTablePixel = statePtr->runlengthPixel;
- n = 1;
- while (count > 0) {
- if (n == 1) {
- statePtr->runlengthTableMax = 1;
- outputPlain(statePtr, statePtr->runlengthPixel);
- count--;
- } else if (count >= n) {
- statePtr->runlengthTableMax = n;
- outputPlain(statePtr, statePtr->runlengthBaseCode+n-2);
- count -= n;
- } else if (count == 1) {
- statePtr->runlengthTableMax++;
- outputPlain(statePtr, statePtr->runlengthPixel);
- count = 0;
- } else {
- statePtr->runlengthTableMax++;
- outputPlain(statePtr, statePtr->runlengthBaseCode+count-2);
- count = 0;
- }
- if (statePtr->outputCount == 0) {
- n = 1;
- } else {
- n++;
- }
- }
- resetOutputClear(statePtr);
- DEBUGMSG(("runlengthFlushFromClear leaving tableMax=%d\n",
- statePtr->runlengthTableMax));
+ ClearHashTable(statePtr, (int) statePtr->hSize);
+ statePtr->freeEntry = statePtr->clearCode + 2;
+ statePtr->clearFlag = 1;
+
+ Output(statePtr, (long) statePtr->clearCode);
}
static void
-runlengthFlushClearOrRep(
- miGIFState_t *statePtr,
- int count)
+ClearHashTable( /* Reset code table. */
+ GIFState_t *statePtr,
+ int hSize)
{
- int withclr;
-
- DEBUGMSG(("runlengthFlushClearOrRep %d\n", count));
- withclr = computeTriangleCount((unsigned) count,
- (unsigned) statePtr->maxOcodes);
- if (withclr < count) {
- output(statePtr, statePtr->codeClear);
- didClear(statePtr);
- runlengthFlushFromClear(statePtr, count);
- } else {
- for (; count>0 ; count--) {
- outputPlain(statePtr, statePtr->runlengthPixel);
- }
+ register int *hashTablePtr = statePtr->hashTable + hSize;
+ register long i;
+ register long m1 = -1;
+
+ i = hSize - 16;
+ do { /* might use Sys V memset(3) here */
+ *(hashTablePtr-16) = m1;
+ *(hashTablePtr-15) = m1;
+ *(hashTablePtr-14) = m1;
+ *(hashTablePtr-13) = m1;
+ *(hashTablePtr-12) = m1;
+ *(hashTablePtr-11) = m1;
+ *(hashTablePtr-10) = m1;
+ *(hashTablePtr-9) = m1;
+ *(hashTablePtr-8) = m1;
+ *(hashTablePtr-7) = m1;
+ *(hashTablePtr-6) = m1;
+ *(hashTablePtr-5) = m1;
+ *(hashTablePtr-4) = m1;
+ *(hashTablePtr-3) = m1;
+ *(hashTablePtr-2) = m1;
+ *(hashTablePtr-1) = m1;
+ hashTablePtr -= 16;
+ } while ((i -= 16) >= 0);
+
+ for (i += 16; i > 0; i--) {
+ *--hashTablePtr = m1;
}
}
+/*
+ *****************************************************************************
+ *
+ * GIF Specific routines
+ *
+ *****************************************************************************
+ */
+
+/*
+ * Set up the 'byte output' routine
+ */
+
static void
-runlengthFlushWithTable(
- miGIFState_t *statePtr,
- int count)
+CharInit(
+ GIFState_t *statePtr)
{
- int repmax;
- int repleft;
- int leftover;
-
- DEBUGMSG(("runlengthFlushWithTable %d\n", count));
- repmax = count / statePtr->runlengthTableMax;
- leftover = count % statePtr->runlengthTableMax;
- repleft = (leftover ? 1 : 0);
- if (statePtr->outputCount+repmax+repleft > statePtr->maxOcodes) {
- repmax = statePtr->maxOcodes - statePtr->outputCount;
- leftover = count - (repmax * statePtr->runlengthTableMax);
- repleft = computeTriangleCount((unsigned) leftover,
- (unsigned) statePtr->maxOcodes);
- }
- DEBUGMSG(("runlengthFlushWithTable repmax=%d leftover=%d repleft=%d\n",
- repmax, leftover, repleft));
- if (computeTriangleCount((unsigned) count, (unsigned) statePtr->maxOcodes)
- < repmax+repleft) {
- output(statePtr, statePtr->codeClear);
- didClear(statePtr);
- runlengthFlushFromClear(statePtr, count);
- return;
- }
- maxOutputClear(statePtr);
- for (; repmax>0 ; repmax--) {
- outputPlain(statePtr,
- statePtr->runlengthBaseCode + statePtr->runlengthTableMax - 2);
- }
- if (leftover) {
- if (statePtr->justCleared) {
- runlengthFlushFromClear(statePtr, leftover);
- } else if (leftover == 1) {
- outputPlain(statePtr, statePtr->runlengthPixel);
- } else {
- outputPlain(statePtr, statePtr->runlengthBaseCode + leftover - 2);
- }
- }
- resetOutputClear(statePtr);
+ statePtr->accumulatedByteCount = 0;
+ statePtr->currentAccumulated = 0;
+ statePtr->currentBits = 0;
}
+/*
+ * Add a character to the end of the current packet, and if it is 254
+ * characters, flush the packet to disk.
+ */
+
static void
-runlengthFlush(
- miGIFState_t *statePtr)
+CharOut(
+ GIFState_t *statePtr,
+ int c)
{
- DEBUGMSG(("runlengthFlush [ %d %d\n", statePtr->runlengthCount,
- statePtr->runlengthPixel));
- if (statePtr->runlengthCount == 1) {
- outputPlain(statePtr, statePtr->runlengthPixel);
- statePtr->runlengthCount = 0;
- DEBUGMSG(("runlengthFlush ]\n"));
- return;
- }
- if (statePtr->justCleared) {
- runlengthFlushFromClear(statePtr, statePtr->runlengthCount);
- } else if ((statePtr->runlengthTableMax < 2)
- || (statePtr->runlengthTablePixel != statePtr->runlengthPixel)) {
- runlengthFlushClearOrRep(statePtr, statePtr->runlengthCount);
- } else {
- runlengthFlushWithTable(statePtr, statePtr->runlengthCount);
+ statePtr->packetAccumulator[statePtr->accumulatedByteCount++] = c;
+ if (statePtr->accumulatedByteCount >= 254) {
+ FlushChar(statePtr);
}
- DEBUGMSG(("runlengthFlush ]\n"));
- statePtr->runlengthCount = 0;
}
+/*
+ * Flush the packet to disk, and reset the accumulator
+ */
+
static void
-compress(
- int initBits,
- Tcl_Channel handle,
- ifunptr readValue,
- ClientData clientData)
+FlushChar(
+ GIFState_t *statePtr)
{
- int c;
- miGIFState_t state, *statePtr = &state;
-
- memset(statePtr, 0, sizeof(state));
-
- statePtr->ofile = handle;
- statePtr->obuf = 0;
- statePtr->obits = 0;
- statePtr->oblen = 0;
- statePtr->codeClear = 1 << (initBits - 1);
- statePtr->codeEOF = statePtr->codeClear + 1;
- statePtr->runlengthBaseCode = statePtr->codeEOF + 1;
- statePtr->outputBumpInit = (1 << (initBits - 1)) - 1;
-
- /*
- * For images with a lot of runs, making outputClearInit larger will give
- * better compression.
- */
-
- statePtr->outputClearInit =
- (initBits <= 3) ? 9 : (statePtr->outputBumpInit-1);
-#ifdef MIGIF_DEBUGGING_ENVARS
- {
- const char *ocienv = getenv("MIGIF_OUT_CLEAR_INIT");
+ unsigned char c;
- if (ocienv) {
- statePtr->outputClearInit = atoi(ocienv);
- DEBUGMSG(("[overriding outputClearInit to %d]\n",
- statePtr->outputClearInit));
- }
+ if (statePtr->accumulatedByteCount > 0) {
+ c = statePtr->accumulatedByteCount;
+ statePtr->writeProc(statePtr->destination, (const char *) &c, 1);
+ statePtr->writeProc(statePtr->destination,
+ (const char *) statePtr->packetAccumulator,
+ statePtr->accumulatedByteCount);
+ statePtr->accumulatedByteCount = 0;
}
-#endif
- statePtr->outputBitsInit = initBits;
- statePtr->maxOcodes =
- (1 << GIFBITS) - ((1 << (statePtr->outputBitsInit - 1)) + 3);
- didClear(statePtr);
- output(statePtr, statePtr->codeClear);
- statePtr->runlengthCount = 0;
- while (1) {
- c = readValue(clientData);
- if (statePtr->runlengthCount>0 && statePtr->runlengthPixel!=c) {
- runlengthFlush(statePtr);
- }
- if (c == EOF) {
- break;
- }
- if (statePtr->runlengthPixel == c) {
- statePtr->runlengthCount++;
- } else {
- statePtr->runlengthPixel = c;
- statePtr->runlengthCount = 1;
- }
- }
- output(statePtr, statePtr->codeEOF);
- outputFlush(statePtr);
}
-/*
- *-----------------------------------------------------------------------
- *
- * End of miGIF section - See copyright notice at start of section.
- *
- *-----------------------------------------------------------------------
- */
+/* The End */
/*
* Local Variables:
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
new file mode 100644
index 0000000..8d6721e
--- /dev/null
+++ b/generic/tkImgPNG.c
@@ -0,0 +1,3485 @@
+/*
+ * tkImgPNG.c --
+ *
+ * A Tk photo image file handler for PNG files.
+ *
+ * Copyright (c) 2006-2008 Muonics, Inc.
+ * Copyright (c) 2008 Donal K. Fellows
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#include "tkInt.h"
+
+#define PNG_INT32(a,b,c,d) \
+ (((long)(a) << 24) | ((long)(b) << 16) | ((long)(c) << 8) | (long)(d))
+#define PNG_BLOCK_SZ 1024 /* Process up to 1k at a time. */
+#define PNG_MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+/*
+ * Every PNG image starts with the following 8-byte signature.
+ */
+
+#define PNG_SIG_SZ 8
+static const unsigned char pngSignature[] = {
+ 137, 80, 78, 71, 13, 10, 26, 10
+};
+
+static const int startLine[8] = {
+ 0, 0, 0, 4, 0, 2, 0, 1
+};
+
+/*
+ * Chunk type flags.
+ */
+
+#define PNG_CF_ANCILLARY 0x10000000L /* Non-critical chunk (can ignore). */
+#define PNG_CF_PRIVATE 0x00100000L /* Application-specific chunk. */
+#define PNG_CF_RESERVED 0x00001000L /* Not used. */
+#define PNG_CF_COPYSAFE 0x00000010L /* Opaque data safe for copying. */
+
+/*
+ * Chunk types, not all of which have support implemented. Note that there are
+ * others in the official extension set which we will never support (as they
+ * are officially deprecated).
+ */
+
+#define CHUNK_IDAT PNG_INT32('I','D','A','T') /* Pixel data. */
+#define CHUNK_IEND PNG_INT32('I','E','N','D') /* End of Image. */
+#define CHUNK_IHDR PNG_INT32('I','H','D','R') /* Header. */
+#define CHUNK_PLTE PNG_INT32('P','L','T','E') /* Palette. */
+
+#define CHUNK_bKGD PNG_INT32('b','K','G','D') /* Background Color */
+#define CHUNK_cHRM PNG_INT32('c','H','R','M') /* Chroma values. */
+#define CHUNK_gAMA PNG_INT32('g','A','M','A') /* Gamma. */
+#define CHUNK_hIST PNG_INT32('h','I','S','T') /* Histogram. */
+#define CHUNK_iCCP PNG_INT32('i','C','C','P') /* Color profile. */
+#define CHUNK_iTXt PNG_INT32('i','T','X','t') /* Internationalized
+ * text (comments,
+ * etc.) */
+#define CHUNK_oFFs PNG_INT32('o','F','F','s') /* Image offset. */
+#define CHUNK_pCAL PNG_INT32('p','C','A','L') /* Pixel calibration
+ * data. */
+#define CHUNK_pHYs PNG_INT32('p','H','Y','s') /* Physical pixel
+ * dimensions. */
+#define CHUNK_sBIT PNG_INT32('s','B','I','T') /* Significant bits */
+#define CHUNK_sCAL PNG_INT32('s','C','A','L') /* Physical scale. */
+#define CHUNK_sPLT PNG_INT32('s','P','L','T') /* Suggested
+ * palette. */
+#define CHUNK_sRGB PNG_INT32('s','R','G','B') /* Standard RGB space
+ * declaration. */
+#define CHUNK_tEXt PNG_INT32('t','E','X','t') /* Plain Latin-1
+ * text. */
+#define CHUNK_tIME PNG_INT32('t','I','M','E') /* Time stamp. */
+#define CHUNK_tRNS PNG_INT32('t','R','N','S') /* Transparency. */
+#define CHUNK_zTXt PNG_INT32('z','T','X','t') /* Compressed Latin-1
+ * text. */
+
+/*
+ * Color flags.
+ */
+
+#define PNG_COLOR_INDEXED 1
+#define PNG_COLOR_USED 2
+#define PNG_COLOR_ALPHA 4
+
+/*
+ * Actual color types.
+ */
+
+#define PNG_COLOR_GRAY 0
+#define PNG_COLOR_RGB (PNG_COLOR_USED)
+#define PNG_COLOR_PLTE (PNG_COLOR_USED | PNG_COLOR_INDEXED)
+#define PNG_COLOR_GRAYALPHA (PNG_COLOR_GRAY | PNG_COLOR_ALPHA)
+#define PNG_COLOR_RGBA (PNG_COLOR_USED | PNG_COLOR_ALPHA)
+
+/*
+ * Compression Methods.
+ */
+
+#define PNG_COMPRESS_DEFLATE 0
+
+/*
+ * Filter Methods.
+ */
+
+#define PNG_FILTMETH_STANDARD 0
+
+/*
+ * Interlacing Methods.
+ */
+
+#define PNG_INTERLACE_NONE 0
+#define PNG_INTERLACE_ADAM7 1
+
+/*
+ * State information, used to store everything about the PNG image being
+ * currently parsed or created.
+ */
+
+typedef struct {
+ /*
+ * PNG data source/destination channel/object/byte array.
+ */
+
+ Tcl_Channel channel; /* Channel for from-file reads. */
+ Tcl_Obj *objDataPtr;
+ unsigned char *strDataBuf; /* Raw source data for from-string reads. */
+ int strDataLen; /* Length of source data. */
+ unsigned char *base64Data; /* base64 encoded string data. */
+ unsigned char base64Bits; /* Remaining bits from last base64 read. */
+ unsigned char base64State; /* Current state of base64 decoder. */
+ double alpha; /* Alpha from -format option. */
+
+ /*
+ * Image header information.
+ */
+
+ unsigned char bitDepth; /* Number of bits per pixel. */
+ unsigned char colorType; /* Grayscale, TrueColor, etc. */
+ unsigned char compression; /* Compression Mode (always zlib). */
+ unsigned char filter; /* Filter mode (0 - 3). */
+ unsigned char interlace; /* Type of interlacing (if any). */
+ unsigned char numChannels; /* Number of channels per pixel. */
+ unsigned char bytesPerPixel;/* Bytes per pixel in scan line. */
+ int bitScale; /* Scale factor for RGB/Gray depths < 8. */
+ int currentLine; /* Current line being unfiltered. */
+ unsigned char phase; /* Interlacing phase (0..6). */
+ Tk_PhotoImageBlock block;
+ int blockLen; /* Number of bytes in Tk image pixels. */
+
+ /*
+ * For containing data read from PLTE (palette) and tRNS (transparency)
+ * chunks.
+ */
+
+ int paletteLen; /* Number of PLTE entries (1..256). */
+ int useTRNS; /* Flag to indicate whether there was a
+ * palette given. */
+ struct {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char alpha;
+ } palette[256]; /* Palette RGB/Transparency table. */
+ unsigned char transVal[6]; /* Fully-transparent RGB/Gray Value. */
+
+ /*
+ * For compressing and decompressing IDAT chunks.
+ */
+
+ Tcl_ZlibStream stream; /* Inflating or deflating stream; this one is
+ * not bound to a Tcl command. */
+ Tcl_Obj *lastLineObj; /* Last line of pixels, for unfiltering. */
+ Tcl_Obj *thisLineObj; /* Current line of pixels to process. */
+ int lineSize; /* Number of bytes in a PNG line. */
+ int phaseSize; /* Number of bytes/line in current phase. */
+} PNGImage;
+
+/*
+ * Maximum size of various chunks.
+ */
+
+#define PNG_PLTE_MAXSZ 768 /* 3 bytes/RGB entry, 256 entries max */
+#define PNG_TRNS_MAXSZ 256 /* 1-byte alpha, 256 entries max */
+
+/*
+ * Forward declarations of non-global functions defined in this file:
+ */
+
+static void ApplyAlpha(PNGImage *pngPtr);
+static int CheckColor(Tcl_Interp *interp, PNGImage *pngPtr);
+static inline int CheckCRC(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned long calculated);
+static void CleanupPNGImage(PNGImage *pngPtr);
+static int DecodeLine(Tcl_Interp *interp, PNGImage *pngPtr);
+static int DecodePNG(Tcl_Interp *interp, PNGImage *pngPtr,
+ Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle,
+ int destX, int destY);
+static int EncodePNG(Tcl_Interp *interp,
+ Tk_PhotoImageBlock *blockPtr, PNGImage *pngPtr);
+static int FileMatchPNG(Tcl_Channel chan, const char *fileName,
+ Tcl_Obj *fmtObj, int *widthPtr, int *heightPtr,
+ Tcl_Interp *interp);
+static int FileReadPNG(Tcl_Interp *interp, Tcl_Channel chan,
+ const char *fileName, Tcl_Obj *fmtObj,
+ Tk_PhotoHandle imageHandle, int destX, int destY,
+ int width, int height, int srcX, int srcY);
+static int FileWritePNG(Tcl_Interp *interp, const char *filename,
+ Tcl_Obj *fmtObj, Tk_PhotoImageBlock *blockPtr);
+static int InitPNGImage(Tcl_Interp *interp, PNGImage *pngPtr,
+ Tcl_Channel chan, Tcl_Obj *objPtr, int dir);
+static inline unsigned char Paeth(int a, int b, int c);
+static int ParseFormat(Tcl_Interp *interp, Tcl_Obj *fmtObj,
+ PNGImage *pngPtr);
+static int ReadBase64(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned char *destPtr, int destSz,
+ unsigned long *crcPtr);
+static int ReadByteArray(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned char *destPtr, int destSz,
+ unsigned long *crcPtr);
+static int ReadData(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned char *destPtr, int destSz,
+ unsigned long *crcPtr);
+static int ReadChunkHeader(Tcl_Interp *interp, PNGImage *pngPtr,
+ int *sizePtr, unsigned long *typePtr,
+ unsigned long *crcPtr);
+static int ReadIDAT(Tcl_Interp *interp, PNGImage *pngPtr,
+ int chunkSz, unsigned long crc);
+static int ReadIHDR(Tcl_Interp *interp, PNGImage *pngPtr);
+static inline int ReadInt32(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned long *resultPtr, unsigned long *crcPtr);
+static int ReadPLTE(Tcl_Interp *interp, PNGImage *pngPtr,
+ int chunkSz, unsigned long crc);
+static int ReadTRNS(Tcl_Interp *interp, PNGImage *pngPtr,
+ int chunkSz, unsigned long crc);
+static int SkipChunk(Tcl_Interp *interp, PNGImage *pngPtr,
+ int chunkSz, unsigned long crc);
+static int StringMatchPNG(Tcl_Obj *dataObj, Tcl_Obj *fmtObj,
+ int *widthPtr, int *heightPtr,
+ Tcl_Interp *interp);
+static int StringReadPNG(Tcl_Interp *interp, Tcl_Obj *dataObj,
+ Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle,
+ int destX, int destY, int width, int height,
+ int srcX, int srcY);
+static int StringWritePNG(Tcl_Interp *interp, Tcl_Obj *fmtObj,
+ Tk_PhotoImageBlock *blockPtr);
+static int UnfilterLine(Tcl_Interp *interp, PNGImage *pngPtr);
+static inline int WriteByte(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned char c, unsigned long *crcPtr);
+static inline int WriteChunk(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned long chunkType,
+ const unsigned char *dataPtr, int dataSize);
+static int WriteData(Tcl_Interp *interp, PNGImage *pngPtr,
+ const unsigned char *srcPtr, int srcSz,
+ unsigned long *crcPtr);
+static int WriteExtraChunks(Tcl_Interp *interp,
+ PNGImage *pngPtr);
+static int WriteIHDR(Tcl_Interp *interp, PNGImage *pngPtr,
+ Tk_PhotoImageBlock *blockPtr);
+static int WriteIDAT(Tcl_Interp *interp, PNGImage *pngPtr,
+ Tk_PhotoImageBlock *blockPtr);
+static inline int WriteInt32(Tcl_Interp *interp, PNGImage *pngPtr,
+ unsigned long l, unsigned long *crcPtr);
+
+/*
+ * The format record for the PNG file format:
+ */
+
+Tk_PhotoImageFormat tkImgFmtPNG = {
+ "png", /* name */
+ FileMatchPNG, /* fileMatchProc */
+ StringMatchPNG, /* stringMatchProc */
+ FileReadPNG, /* fileReadProc */
+ StringReadPNG, /* stringReadProc */
+ FileWritePNG, /* fileWriteProc */
+ StringWritePNG, /* stringWriteProc */
+ NULL
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitPNGImage --
+ *
+ * This function is invoked by each of the Tk image handler procs
+ * (MatchStringProc, etc.) to initialize state information used during
+ * the course of encoding or decoding a PNG image.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if initialization failed.
+ *
+ * Side effects:
+ * The reference count of the -data Tcl_Obj*, if any, is incremented.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InitPNGImage(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ Tcl_Channel chan,
+ Tcl_Obj *objPtr,
+ int dir)
+{
+ memset(pngPtr, 0, sizeof(PNGImage));
+
+ pngPtr->channel = chan;
+ pngPtr->alpha = 1.0;
+
+ /*
+ * If decoding from a -data string object, increment its reference count
+ * for the duration of the decode and get its length and byte array for
+ * reading with ReadData().
+ */
+
+ if (objPtr) {
+ Tcl_IncrRefCount(objPtr);
+ pngPtr->objDataPtr = objPtr;
+ pngPtr->strDataBuf =
+ Tcl_GetByteArrayFromObj(objPtr, &pngPtr->strDataLen);
+ }
+
+ /*
+ * Initialize the palette transparency table to fully opaque.
+ */
+
+ memset(pngPtr->palette, 255, sizeof(pngPtr->palette));
+
+ /*
+ * Initialize Zlib inflate/deflate stream.
+ */
+
+ if (Tcl_ZlibStreamInit(NULL, dir, TCL_ZLIB_FORMAT_ZLIB,
+ TCL_ZLIB_COMPRESS_DEFAULT, NULL, &pngPtr->stream) != TCL_OK) {
+ Tcl_SetResult(interp, "zlib initialization failed", TCL_STATIC);
+ if (objPtr) {
+ Tcl_DecrRefCount(objPtr);
+ }
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CleanupPNGImage --
+ *
+ * This function is invoked by each of the Tk image handler procs
+ * (MatchStringProc, etc.) prior to returning to Tcl in order to clean up
+ * any allocated memory and call other cleanup handlers such as zlib's
+ * inflateEnd/deflateEnd.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The reference count of the -data Tcl_Obj*, if any, is decremented.
+ * Buffers are freed, streams are closed. The PNGImage should not be used
+ * for any purpose without being reinitialized post-cleanup.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+CleanupPNGImage(
+ PNGImage *pngPtr)
+{
+ /*
+ * Don't need the object containing the -data value anymore.
+ */
+
+ if (pngPtr->objDataPtr) {
+ Tcl_DecrRefCount(pngPtr->objDataPtr);
+ }
+
+ /*
+ * Discard pixel buffer.
+ */
+
+ if (pngPtr->stream) {
+ Tcl_ZlibStreamClose(pngPtr->stream);
+ }
+
+ if (pngPtr->block.pixelPtr) {
+ ckfree(pngPtr->block.pixelPtr);
+ }
+ if (pngPtr->thisLineObj) {
+ Tcl_DecrRefCount(pngPtr->thisLineObj);
+ }
+ if (pngPtr->lastLineObj) {
+ Tcl_DecrRefCount(pngPtr->lastLineObj);
+ }
+
+ memset(pngPtr, 0, sizeof(PNGImage));
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadBase64 --
+ *
+ * This function is invoked to read the specified number of bytes from
+ * base-64 encoded image data.
+ *
+ * Note: It would be better if the Tk_PhotoImage stuff handled this by
+ * creating a channel from the -data value, which would take care of
+ * base64 decoding and made the data readable as if it were coming from a
+ * file.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs.
+ *
+ * Side effects:
+ * The file position will change. The running CRC is updated if a pointer
+ * to it is provided.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadBase64(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned char *destPtr,
+ int destSz,
+ unsigned long *crcPtr)
+{
+ static const unsigned char from64[] = {
+ 0x82, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x80, 0x80,
+ 0x83, 0x80, 0x80, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x80,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x3e,
+ 0x83, 0x83, 0x83, 0x3f, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a,
+ 0x3b, 0x3c, 0x3d, 0x83, 0x83, 0x83, 0x81, 0x83, 0x83, 0x83, 0x00,
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
+ 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31,
+ 0x32, 0x33, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
+ 0x83, 0x83
+ };
+
+ /*
+ * Definitions for the base-64 decoder.
+ */
+
+#define PNG64_SPECIAL 0x80 /* Flag bit */
+#define PNG64_SPACE 0x80 /* Whitespace */
+#define PNG64_PAD 0x81 /* Padding */
+#define PNG64_DONE 0x82 /* End of data */
+#define PNG64_BAD 0x83 /* Ooooh, naughty! */
+
+ while (destSz && pngPtr->strDataLen) {
+ unsigned char c = 0;
+ unsigned char c64 = from64[*pngPtr->strDataBuf++];
+
+ pngPtr->strDataLen--;
+
+ if (PNG64_SPACE == c64) {
+ continue;
+ }
+
+ if (c64 & PNG64_SPECIAL) {
+ c = (unsigned char) pngPtr->base64Bits;
+ } else {
+ switch (pngPtr->base64State++) {
+ case 0:
+ pngPtr->base64Bits = c64 << 2;
+ continue;
+ case 1:
+ c = (unsigned char) (pngPtr->base64Bits | (c64 >> 4));
+ pngPtr->base64Bits = (c64 & 0xF) << 4;
+ break;
+ case 2:
+ c = (unsigned char) (pngPtr->base64Bits | (c64 >> 2));
+ pngPtr->base64Bits = (c64 & 0x3) << 6;
+ break;
+ case 3:
+ c = (unsigned char) (pngPtr->base64Bits | c64);
+ pngPtr->base64State = 0;
+ pngPtr->base64Bits = 0;
+ break;
+ }
+ }
+
+ if (crcPtr) {
+ *crcPtr = Tcl_ZlibCRC32(*crcPtr, &c, 1);
+ }
+
+ if (destPtr) {
+ *destPtr++ = c;
+ }
+
+ destSz--;
+
+ if (c64 & PNG64_SPECIAL) {
+ break;
+ }
+ }
+
+ if (destSz) {
+ Tcl_SetResult(interp, "Unexpected end of image data", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadByteArray --
+ *
+ * This function is invoked to read the specified number of bytes from a
+ * non-base64-encoded byte array provided via the -data option.
+ *
+ * Note: It would be better if the Tk_PhotoImage stuff handled this by
+ * creating a channel from the -data value and made the data readable as
+ * if it were coming from a file.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs.
+ *
+ * Side effects:
+ * The file position will change. The running CRC is updated if a pointer
+ * to it is provided.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadByteArray(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned char *destPtr,
+ int destSz,
+ unsigned long *crcPtr)
+{
+ /*
+ * Check to make sure the number of requested bytes are available.
+ */
+
+ if (pngPtr->strDataLen < destSz) {
+ Tcl_SetResult(interp, "Unexpected end of image data", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ while (destSz) {
+ int blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ);
+
+ memcpy(destPtr, pngPtr->strDataBuf, blockSz);
+
+ pngPtr->strDataBuf += blockSz;
+ pngPtr->strDataLen -= blockSz;
+
+ if (crcPtr) {
+ *crcPtr = Tcl_ZlibCRC32(*crcPtr, destPtr, blockSz);
+ }
+
+ destPtr += blockSz;
+ destSz -= blockSz;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadData --
+ *
+ * This function is invoked to read the specified number of bytes from
+ * the image file or data. It is a wrapper around the choice of byte
+ * array Tcl_Obj or Tcl_Channel which depends on whether the image data
+ * is coming from a file or -data.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs.
+ *
+ * Side effects:
+ * The file position will change. The running CRC is updated if a pointer
+ * to it is provided.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadData(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned char *destPtr,
+ int destSz,
+ unsigned long *crcPtr)
+{
+ if (pngPtr->base64Data) {
+ return ReadBase64(interp, pngPtr, destPtr, destSz, crcPtr);
+ } else if (pngPtr->strDataBuf) {
+ return ReadByteArray(interp, pngPtr, destPtr, destSz, crcPtr);
+ }
+
+ while (destSz) {
+ int blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ);
+
+ blockSz = Tcl_Read(pngPtr->channel, (char *)destPtr, blockSz);
+
+ /*
+ * Check for read failure.
+ */
+
+ if (blockSz < 0) {
+ /* TODO: failure info... */
+ Tcl_SetResult(interp, "Channel read failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Update CRC, pointer, and remaining count if anything was read.
+ */
+
+ if (blockSz) {
+ if (crcPtr) {
+ *crcPtr = Tcl_ZlibCRC32(*crcPtr, destPtr, blockSz);
+ }
+
+ destPtr += blockSz;
+ destSz -= blockSz;
+ }
+
+ /*
+ * Check for EOF before all desired data was read.
+ */
+
+ if (destSz && Tcl_Eof(pngPtr->channel)) {
+ Tcl_SetResult(interp, "Unexpected end of file ", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadInt32 --
+ *
+ * This function is invoked to read a 32-bit integer in network byte
+ * order from the image data and return the value in host byte order.
+ * This is used, for example, to read the 32-bit CRC value for a chunk
+ * stored in the image file for comparison with the calculated CRC value.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs.
+ *
+ * Side effects:
+ * The file position will change. The running CRC is updated if a pointer
+ * to it is provided.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline int
+ReadInt32(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned long *resultPtr,
+ unsigned long *crcPtr)
+{
+ unsigned char p[4];
+
+ if (ReadData(interp, pngPtr, p, 4, crcPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ *resultPtr = PNG_INT32(p[0], p[1], p[2], p[3]);
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CheckCRC --
+ *
+ * This function is reads the final 4-byte integer CRC from a chunk and
+ * compares it to the running CRC calculated over the chunk type and data
+ * fields.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error or CRC mismatch occurs.
+ *
+ * Side effects:
+ * The file position will change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline int
+CheckCRC(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned long calculated)
+{
+ unsigned long chunked;
+
+ /*
+ * Read the CRC field at the end of the chunk.
+ */
+
+ if (ReadInt32(interp, pngPtr, &chunked, NULL) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Compare the read CRC to what we calculate to make sure they match.
+ */
+
+ if (calculated != chunked) {
+ Tcl_SetResult(interp, "CRC check failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SkipChunk --
+ *
+ * This function is used to skip a PNG chunk that is not used by this
+ * implementation. Given the input stream has had the chunk length and
+ * chunk type fields already read, this function will read the number of
+ * bytes indicated by the chunk length, plus four for the CRC, and will
+ * verify that CRC is correct for the skipped data.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error or CRC mismatch occurs.
+ *
+ * Side effects:
+ * The file position will change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+SkipChunk(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ int chunkSz,
+ unsigned long crc)
+{
+ unsigned char buffer[PNG_BLOCK_SZ];
+
+ /*
+ * Skip data in blocks until none is left. Read up to PNG_BLOCK_SZ bytes
+ * at a time, rather than trusting the claimed chunk size, which may not
+ * be trustworthy.
+ */
+
+ while (chunkSz) {
+ int blockSz = PNG_MIN(chunkSz, PNG_BLOCK_SZ);
+
+ if (ReadData(interp, pngPtr, buffer, blockSz, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ chunkSz -= blockSz;
+ }
+
+ if (CheckCRC(interp, pngPtr, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ * 4.3. Summary of standard chunks
+ *
+ * This table summarizes some properties of the standard chunk types.
+ *
+ * Critical chunks (must appear in this order, except PLTE is optional):
+ *
+ * Name Multiple Ordering constraints OK?
+ *
+ * IHDR No Must be first
+ * PLTE No Before IDAT
+ * IDAT Yes Multiple IDATs must be consecutive
+ * IEND No Must be last
+ *
+ * Ancillary chunks (need not appear in this order):
+ *
+ * Name Multiple Ordering constraints OK?
+ *
+ * cHRM No Before PLTE and IDAT
+ * gAMA No Before PLTE and IDAT
+ * iCCP No Before PLTE and IDAT
+ * sBIT No Before PLTE and IDAT
+ * sRGB No Before PLTE and IDAT
+ * bKGD No After PLTE; before IDAT
+ * hIST No After PLTE; before IDAT
+ * tRNS No After PLTE; before IDAT
+ * pHYs No Before IDAT
+ * sPLT Yes Before IDAT
+ * tIME No None
+ * iTXt Yes None
+ * tEXt Yes None
+ * zTXt Yes None
+ *
+ * [From the PNG specification.]
+ */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadChunkHeader --
+ *
+ * This function is used at the start of each chunk to extract the
+ * four-byte chunk length and four-byte chunk type fields. It will
+ * continue reading until it finds a chunk type that is handled by this
+ * implementation, checking the CRC of any chunks it skips.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs or an unknown critical
+ * chunk type is encountered.
+ *
+ * Side effects:
+ * The file position will change. The running CRC is updated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadChunkHeader(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ int *sizePtr,
+ unsigned long *typePtr,
+ unsigned long *crcPtr)
+{
+ unsigned long chunkType = 0;
+ int chunkSz = 0;
+ unsigned long crc = 0;
+
+ /*
+ * Continue until finding a chunk type that is handled.
+ */
+
+ while (!chunkType) {
+ unsigned long temp;
+ unsigned char pc[4];
+ int i;
+
+ /*
+ * Read the 4-byte length field for the chunk. The length field is not
+ * included in the CRC calculation, so the running CRC must be reset
+ * afterward. Limit chunk lengths to INT_MAX, to align with the
+ * maximum size for Tcl_Read, Tcl_GetByteArrayFromObj, etc.
+ */
+
+ if (ReadData(interp, pngPtr, pc, 4, NULL) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ temp = PNG_INT32(pc[0], pc[1], pc[2], pc[3]);
+
+ if (temp > INT_MAX) {
+ Tcl_SetResult(interp, "Chunk size is out of supported range "
+ "on this architecture", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ chunkSz = (int) temp;
+ crc = Tcl_ZlibCRC32(0, NULL, 0);
+
+ /*
+ * Read the 4-byte chunk type.
+ */
+
+ if (ReadData(interp, pngPtr, pc, 4, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Convert it to a host-order integer for simple comparison.
+ */
+
+ chunkType = PNG_INT32(pc[0], pc[1], pc[2], pc[3]);
+
+ /*
+ * Check to see if this is a known/supported chunk type. Note that the
+ * PNG specs require non-critical (i.e., ancillary) chunk types that
+ * are not recognized to be ignored, rather than be treated as an
+ * error. It does, however, recommend that an unknown critical chunk
+ * type be treated as a failure.
+ *
+ * This switch/loop acts as a filter of sorts for undesired chunk
+ * types. The chunk type should still be checked elsewhere for
+ * determining it is in the correct order.
+ */
+
+ switch (chunkType) {
+ /*
+ * These chunk types are required and/or supported.
+ */
+
+ case CHUNK_IDAT:
+ case CHUNK_IEND:
+ case CHUNK_IHDR:
+ case CHUNK_PLTE:
+ case CHUNK_tRNS:
+ break;
+
+ /*
+ * These chunk types are part of the standard, but are not used by
+ * this implementation (at least not yet). Note that these are all
+ * ancillary chunks (lowercase first letter).
+ */
+
+ case CHUNK_bKGD:
+ case CHUNK_cHRM:
+ case CHUNK_gAMA:
+ case CHUNK_hIST:
+ case CHUNK_iCCP:
+ case CHUNK_iTXt:
+ case CHUNK_oFFs:
+ case CHUNK_pCAL:
+ case CHUNK_pHYs:
+ case CHUNK_sBIT:
+ case CHUNK_sCAL:
+ case CHUNK_sPLT:
+ case CHUNK_sRGB:
+ case CHUNK_tEXt:
+ case CHUNK_tIME:
+ case CHUNK_zTXt:
+ /*
+ * TODO: might want to check order here.
+ */
+
+ if (SkipChunk(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ chunkType = 0;
+ break;
+
+ default:
+ /*
+ * Unknown chunk type. If it's critical, we can't continue.
+ */
+
+ if (!(chunkType & PNG_CF_ANCILLARY)) {
+ Tcl_SetResult(interp,
+ "Encountered an unsupported criticial chunk type",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Check to see if the chunk type has legal bytes.
+ */
+
+ for (i=0 ; i<4 ; i++) {
+ if ((pc[i] < 65) || (pc[i] > 122) ||
+ ((pc[i] > 90) && (pc[i] < 97))) {
+ Tcl_SetResult(interp, "Invalid chunk type", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * It seems to be an otherwise legally labelled ancillary chunk
+ * that we don't want, so skip it after at least checking its CRC.
+ */
+
+ if (SkipChunk(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ chunkType = 0;
+ }
+ }
+
+ /*
+ * Found a known chunk type that's handled, albiet possibly not in the
+ * right order. Send back the chunk type (for further checking or
+ * handling), the chunk size and the current CRC for the rest of the
+ * calculation.
+ */
+
+ *typePtr = chunkType;
+ *sizePtr = chunkSz;
+ *crcPtr = crc;
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CheckColor --
+ *
+ * Do validation on color type, depth, and related information, and
+ * calculates storage requirements and offsets based on image dimensions
+ * and color.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if color information is invalid or some other
+ * failure occurs.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+CheckColor(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr)
+{
+ int result = TCL_OK;
+ int offset;
+
+ /*
+ * Verify the color type is valid and the bit depth is allowed.
+ */
+
+ switch (pngPtr->colorType) {
+ case PNG_COLOR_GRAY:
+ pngPtr->numChannels = 1;
+ if ((1 != pngPtr->bitDepth) && (2 != pngPtr->bitDepth) &&
+ (4 != pngPtr->bitDepth) && (8 != pngPtr->bitDepth) &&
+ (16 != pngPtr->bitDepth)) {
+ result = TCL_ERROR;
+ }
+ break;
+
+ case PNG_COLOR_RGB:
+ pngPtr->numChannels = 3;
+ if ((8 != pngPtr->bitDepth) && (16 != pngPtr->bitDepth)) {
+ result = TCL_ERROR;
+ }
+ break;
+
+ case PNG_COLOR_PLTE:
+ pngPtr->numChannels = 1;
+ if ((1 != pngPtr->bitDepth) && (2 != pngPtr->bitDepth) &&
+ (4 != pngPtr->bitDepth) && (8 != pngPtr->bitDepth)) {
+ result = TCL_ERROR;
+ }
+ break;
+
+ case PNG_COLOR_GRAYALPHA:
+ pngPtr->numChannels = 2;
+ if ((8 != pngPtr->bitDepth) && (16 != pngPtr->bitDepth)) {
+ result = TCL_ERROR;
+ }
+ break;
+
+ case PNG_COLOR_RGBA:
+ pngPtr->numChannels = 4;
+ if ((8 != pngPtr->bitDepth) && (16 != pngPtr->bitDepth)) {
+ result = TCL_ERROR;
+ }
+ break;
+
+ default:
+ Tcl_SetResult(interp, "Unknown Color Type field", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (TCL_ERROR == result) {
+ Tcl_SetResult(interp, "Bit depth is not allowed for given color type",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Set up the Tk photo block's pixel size and channel offsets. offset
+ * array elements should already be 0 from the memset during InitPNGImage.
+ */
+
+ offset = (pngPtr->bitDepth > 8) ? 2 : 1;
+
+ if (pngPtr->colorType & PNG_COLOR_USED) {
+ pngPtr->block.pixelSize = offset * 4;
+ pngPtr->block.offset[1] = offset;
+ pngPtr->block.offset[2] = offset * 2;
+ pngPtr->block.offset[3] = offset * 3;
+ } else {
+ pngPtr->block.pixelSize = offset * 2;
+ pngPtr->block.offset[3] = offset;
+ }
+
+ /*
+ * Calculate the block pitch, which is the number of bytes per line in the
+ * image, given image width and depth of color. Make sure that it it isn't
+ * larger than Tk can handle.
+ */
+
+ if (pngPtr->block.width > INT_MAX / pngPtr->block.pixelSize) {
+ Tcl_SetResult(interp,
+ "Image pitch is out of supported range on this architecture",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ pngPtr->block.pitch = pngPtr->block.pixelSize * pngPtr->block.width;
+
+ /*
+ * Calculate the total size of the image as represented to Tk given pitch
+ * and image height. Make sure that it isn't larger than Tk can handle.
+ */
+
+ if (pngPtr->block.height > INT_MAX / pngPtr->block.pitch) {
+ Tcl_SetResult(interp, "Image total size is out of supported range "
+ "on this architecture", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ pngPtr->blockLen = pngPtr->block.height * pngPtr->block.pitch;
+
+ /*
+ * Determine number of bytes per pixel in the source for later use.
+ */
+
+ switch (pngPtr->colorType) {
+ case PNG_COLOR_GRAY:
+ pngPtr->bytesPerPixel = (pngPtr->bitDepth > 8) ? 2 : 1;
+ break;
+ case PNG_COLOR_RGB:
+ pngPtr->bytesPerPixel = (pngPtr->bitDepth > 8) ? 6 : 3;
+ break;
+ case PNG_COLOR_PLTE:
+ pngPtr->bytesPerPixel = 1;
+ break;
+ case PNG_COLOR_GRAYALPHA:
+ pngPtr->bytesPerPixel = (pngPtr->bitDepth > 8) ? 4 : 2;
+ break;
+ case PNG_COLOR_RGBA:
+ pngPtr->bytesPerPixel = (pngPtr->bitDepth > 8) ? 8 : 4;
+ break;
+ default:
+ Tcl_SetResult(interp, "internal error - unknown color type",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Calculate scale factor for bit depths less than 8, in order to adjust
+ * them to a minimum of 8 bits per pixel in the Tk image.
+ */
+
+ if (pngPtr->bitDepth < 8) {
+ pngPtr->bitScale = 255 / (int)(pow(2, pngPtr->bitDepth) - 1);
+ } else {
+ pngPtr->bitScale = 1;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadIHDR --
+ *
+ * This function reads the PNG header from the beginning of a PNG file
+ * and returns the dimensions of the image.
+ *
+ * Results:
+ * The return value is 1 if file "f" appears to start with a valid PNG
+ * header, 0 otherwise. If the header is valid, then *widthPtr and
+ * *heightPtr are modified to hold the dimensions of the image.
+ *
+ * Side effects:
+ * The access position in f advances.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadIHDR(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr)
+{
+ unsigned char sigBuf[PNG_SIG_SZ];
+ unsigned long chunkType;
+ int chunkSz;
+ unsigned long crc;
+ unsigned long width, height;
+ int mismatch;
+
+ /*
+ * Read the appropriate number of bytes for the PNG signature.
+ */
+
+ if (ReadData(interp, pngPtr, sigBuf, PNG_SIG_SZ, NULL) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Compare the read bytes to the expected signature.
+ */
+
+ mismatch = memcmp(sigBuf, pngSignature, PNG_SIG_SZ);
+
+ /*
+ * If reading from string, reset position and try base64 decode.
+ */
+
+ if (mismatch && pngPtr->strDataBuf) {
+ pngPtr->strDataBuf = Tcl_GetByteArrayFromObj(pngPtr->objDataPtr,
+ &pngPtr->strDataLen);
+ pngPtr->base64Data = pngPtr->strDataBuf;
+
+ if (ReadData(interp, pngPtr, sigBuf, PNG_SIG_SZ, NULL) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ mismatch = memcmp(sigBuf, pngSignature, PNG_SIG_SZ);
+ }
+
+ if (mismatch) {
+ Tcl_SetResult(interp, "Data stream does not have a PNG signature",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Read in the IHDR (header) chunk for width, height, etc.
+ *
+ * The first chunk in the file must be the IHDR (headr) chunk.
+ */
+
+ if (chunkType != CHUNK_IHDR) {
+ Tcl_SetResult(interp, "Expected IHDR chunk type", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (chunkSz != 13) {
+ Tcl_SetResult(interp, "Invalid IHDR chunk size", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Read and verify the image width and height to be sure Tk can handle its
+ * dimensions. The PNG specification does not permit zero-width or
+ * zero-height images.
+ */
+
+ if (ReadInt32(interp, pngPtr, &width, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (ReadInt32(interp, pngPtr, &height, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (!width || !height || (width > INT_MAX) || (height > INT_MAX)) {
+ Tcl_SetResult(interp,
+ "Image dimensions are invalid or beyond architecture limits",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Set height and width for the Tk photo block.
+ */
+
+ pngPtr->block.width = (int) width;
+ pngPtr->block.height = (int) height;
+
+ /*
+ * Read and the Bit Depth and Color Type.
+ */
+
+ if (ReadData(interp, pngPtr, &pngPtr->bitDepth, 1, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (ReadData(interp, pngPtr, &pngPtr->colorType, 1, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Verify that the color type is valid, the bit depth is allowed for the
+ * color type, and calculate the number of channels and pixel depth (bits
+ * per pixel * channels). Also set up offsets and sizes in the Tk photo
+ * block for the pixel data.
+ */
+
+ if (CheckColor(interp, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Only one compression method is currently defined by the standard.
+ */
+
+ if (ReadData(interp, pngPtr, &pngPtr->compression, 1, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (PNG_COMPRESS_DEFLATE != pngPtr->compression) {
+ Tcl_SetResult(interp, "Unknown compression method", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Only one filter method is currently defined by the standard; the method
+ * has five actual filter types associated with it.
+ */
+
+ if (ReadData(interp, pngPtr, &pngPtr->filter, 1, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (PNG_FILTMETH_STANDARD != pngPtr->filter) {
+ Tcl_SetResult(interp, "Unknown filter method", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (ReadData(interp, pngPtr, &pngPtr->interlace, 1, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ switch (pngPtr->interlace) {
+ case PNG_INTERLACE_NONE:
+ case PNG_INTERLACE_ADAM7:
+ break;
+
+ default:
+ Tcl_SetResult(interp, "Unknown interlace method", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ return CheckCRC(interp, pngPtr, crc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadPLTE --
+ *
+ * This function reads the PLTE (indexed color palette) chunk data from
+ * the PNG file and populates the palette table in the PNGImage
+ * structure.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs or the PLTE chunk is
+ * invalid.
+ *
+ * Side effects:
+ * The access position in f advances.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadPLTE(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ int chunkSz,
+ unsigned long crc)
+{
+ unsigned char buffer[PNG_PLTE_MAXSZ];
+ int i, c;
+
+ /*
+ * This chunk is mandatory for color type 3 and forbidden for 2 and 6.
+ */
+
+ switch (pngPtr->colorType) {
+ case PNG_COLOR_GRAY:
+ case PNG_COLOR_GRAYALPHA:
+ Tcl_SetResult(interp, "PLTE chunk type forbidden for grayscale",
+ TCL_STATIC);
+ return TCL_ERROR;
+
+ default:
+ break;
+ }
+
+ /*
+ * The palette chunk contains from 1 to 256 palette entries. Each entry
+ * consists of a 3-byte RGB value. It must therefore contain a non-zero
+ * multiple of 3 bytes, up to 768.
+ */
+
+ if (!chunkSz || (chunkSz > PNG_PLTE_MAXSZ) || (chunkSz % 3)) {
+ Tcl_SetResult(interp, "Invalid palette chunk size", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Read the palette contents and stash them for later, possibly.
+ */
+
+ if (ReadData(interp, pngPtr, buffer, chunkSz, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (CheckCRC(interp, pngPtr, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Stash away the palette entries and entry count for later mapping each
+ * pixel's palette index to its color.
+ */
+
+ for (i=0, c=0 ; c<chunkSz ; i++) {
+ pngPtr->palette[i].red = buffer[c++];
+ pngPtr->palette[i].green = buffer[c++];
+ pngPtr->palette[i].blue = buffer[c++];
+ }
+
+ pngPtr->paletteLen = i;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadTRNS --
+ *
+ * This function reads the tRNS (transparency) chunk data from the PNG
+ * file and populates the alpha field of the palette table in the
+ * PNGImage structure or the single color transparency, as appropriate
+ * for the color type.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs or the tRNS chunk is
+ * invalid.
+ *
+ * Side effects:
+ * The access position in f advances.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadTRNS(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ int chunkSz,
+ unsigned long crc)
+{
+ unsigned char buffer[PNG_TRNS_MAXSZ];
+ int i;
+
+ if (pngPtr->colorType & PNG_COLOR_ALPHA) {
+ Tcl_SetResult(interp,
+ "tRNS chunk not allowed color types with a full alpha channel",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * For indexed color, there is up to one single-byte transparency value
+ * per palette entry (thus a max of 256).
+ */
+
+ if (chunkSz > PNG_TRNS_MAXSZ) {
+ Tcl_SetResult(interp, "Invalid tRNS chunk size", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Read in the raw transparency information.
+ */
+
+ if (ReadData(interp, pngPtr, buffer, chunkSz, &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (CheckCRC(interp, pngPtr, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ switch (pngPtr->colorType) {
+ case PNG_COLOR_GRAYALPHA:
+ case PNG_COLOR_RGBA:
+ break;
+
+ case PNG_COLOR_PLTE:
+ /*
+ * The number of tRNS entries must be less than or equal to the number
+ * of PLTE entries, and consists of a single-byte alpha level for the
+ * corresponding PLTE entry.
+ */
+
+ if (chunkSz > pngPtr->paletteLen) {
+ Tcl_SetResult(interp,
+ "Size of tRNS chunk is too large for the palette",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ for (i=0 ; i<chunkSz ; i++) {
+ pngPtr->palette[i].alpha = buffer[i];
+ }
+ break;
+
+ case PNG_COLOR_GRAY:
+ /*
+ * Grayscale uses a single 2-byte gray level, which we'll store in
+ * palette index 0, since we're not using the palette.
+ */
+
+ if (chunkSz != 2) {
+ Tcl_SetResult(interp,
+ "Invalid tRNS chunk size - must 2 bytes for grayscale",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * According to the PNG specs, if the bit depth is less than 16, then
+ * only the lower byte is used.
+ */
+
+ if (16 == pngPtr->bitDepth) {
+ pngPtr->transVal[0] = buffer[0];
+ pngPtr->transVal[1] = buffer[1];
+ } else {
+ pngPtr->transVal[0] = buffer[1];
+ }
+ pngPtr->useTRNS = 1;
+ break;
+
+ case PNG_COLOR_RGB:
+ /*
+ * TrueColor uses a single RRGGBB triplet.
+ */
+
+ if (chunkSz != 6) {
+ Tcl_SetResult(interp,
+ "Invalid tRNS chunk size - must 6 bytes for RGB",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * According to the PNG specs, if the bit depth is less than 16, then
+ * only the lower byte is used. But the tRNS chunk still contains two
+ * bytes per channel.
+ */
+
+ if (16 == pngPtr->bitDepth) {
+ memcpy(pngPtr->transVal, buffer, 6);
+ } else {
+ pngPtr->transVal[0] = buffer[1];
+ pngPtr->transVal[1] = buffer[3];
+ pngPtr->transVal[2] = buffer[5];
+ }
+ pngPtr->useTRNS = 1;
+ break;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Paeth --
+ *
+ * Utility function for applying the Paeth filter to a pixel. The Paeth
+ * filter is a linear function of the pixel to be filtered and the pixels
+ * to the left, above, and above-left of the pixel to be unfiltered.
+ *
+ * Results:
+ * Result of the Paeth function for the left, above, and above-left
+ * pixels.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline unsigned char
+Paeth(
+ int a,
+ int b,
+ int c)
+{
+ int pa = abs(b - c);
+ int pb = abs(a - c);
+ int pc = abs(a + b - c - c);
+
+ if ((pa <= pb) && (pa <= pc)) {
+ return (unsigned char) a;
+ }
+
+ if (pb <= pc) {
+ return (unsigned char) b;
+ }
+
+ return (unsigned char) c;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * UnfilterLine --
+ *
+ * Applies the filter algorithm specified in first byte of a line to the
+ * line of pixels being read from a PNG image.
+ *
+ * PNG specifies four filter algorithms (Sub, Up, Average, and Paeth)
+ * that combine a pixel's value with those of other pixels in the same
+ * and/or previous lines. Filtering is intended to make an image more
+ * compressible.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the filter type is not recognized.
+ *
+ * Side effects:
+ * Pixel data in thisLineObj are modified.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+UnfilterLine(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr)
+{
+ unsigned char *thisLine =
+ Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, NULL);
+ unsigned char *lastLine =
+ Tcl_GetByteArrayFromObj(pngPtr->lastLineObj, NULL);
+
+#define PNG_FILTER_NONE 0
+#define PNG_FILTER_SUB 1
+#define PNG_FILTER_UP 2
+#define PNG_FILTER_AVG 3
+#define PNG_FILTER_PAETH 4
+
+ switch (*thisLine) {
+ case PNG_FILTER_NONE: /* Nothing to do */
+ break;
+ case PNG_FILTER_SUB: { /* Sub(x) = Raw(x) - Raw(x-bpp) */
+ unsigned char *rawBpp = thisLine + 1;
+ unsigned char *raw = rawBpp + pngPtr->bytesPerPixel;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+
+ while (raw < end) {
+ *raw++ += *rawBpp++;
+ }
+ break;
+ }
+ case PNG_FILTER_UP: /* Up(x) = Raw(x) - Prior(x) */
+ if (pngPtr->currentLine > startLine[pngPtr->phase]) {
+ unsigned char *prior = lastLine + 1;
+ unsigned char *raw = thisLine + 1;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+
+ while (raw < end) {
+ *raw++ += *prior++;
+ }
+ }
+ break;
+ case PNG_FILTER_AVG:
+ /* Avg(x) = Raw(x) - floor((Raw(x-bpp)+Prior(x))/2) */
+ if (pngPtr->currentLine > startLine[pngPtr->phase]) {
+ unsigned char *prior = lastLine + 1;
+ unsigned char *rawBpp = thisLine + 1;
+ unsigned char *raw = rawBpp;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+ unsigned char *end2 = raw + pngPtr->bytesPerPixel;
+
+ while ((raw < end2) && (raw < end)) {
+ *raw++ += *prior++ / 2;
+ }
+
+ while (raw < end) {
+ *raw++ += (unsigned char)
+ (((int) *rawBpp++ + (int) *prior++) / 2);
+ }
+ } else {
+ unsigned char *rawBpp = thisLine + 1;
+ unsigned char *raw = rawBpp + pngPtr->bytesPerPixel;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+
+ while (raw < end) {
+ *raw++ += *rawBpp++ / 2;
+ }
+ }
+ break;
+ case PNG_FILTER_PAETH:
+ /* Paeth(x) = Raw(x) - PaethPredictor(Raw(x-bpp), Prior(x), Prior(x-bpp)) */
+ if (pngPtr->currentLine > startLine[pngPtr->phase]) {
+ unsigned char *priorBpp = lastLine + 1;
+ unsigned char *prior = priorBpp;
+ unsigned char *rawBpp = thisLine + 1;
+ unsigned char *raw = rawBpp;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+ unsigned char *end2 = rawBpp + pngPtr->bytesPerPixel;
+
+ while ((raw < end) && (raw < end2)) {
+ *raw++ += *prior++;
+ }
+
+ while (raw < end) {
+ *raw++ += Paeth(*rawBpp++, *prior++, *priorBpp++);
+ }
+ } else {
+ unsigned char *rawBpp = thisLine + 1;
+ unsigned char *raw = rawBpp + pngPtr->bytesPerPixel;
+ unsigned char *end = thisLine + pngPtr->phaseSize;
+
+ while (raw < end) {
+ *raw++ += *rawBpp++;
+ }
+ }
+ break;
+ default:
+ Tcl_SetResult(interp, "Invalid filter type", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DecodeLine --
+ *
+ * Unfilters a line of pixels from the PNG source data and decodes the
+ * data into the Tk_PhotoImageBlock for later copying into the Tk image.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the filter type is not recognized.
+ *
+ * Side effects:
+ * Pixel data in thisLine and block are modified and state information
+ * updated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+DecodeLine(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr)
+{
+ unsigned char *pixelPtr = pngPtr->block.pixelPtr;
+ int colNum = 0; /* Current pixel column */
+ unsigned char chan = 0; /* Current channel (0..3) = (R, G, B, A) */
+ unsigned char readByte = 0; /* Current scan line byte */
+ int haveBits = 0; /* Number of bits remaining in current byte */
+ unsigned char pixBits = 0; /* Extracted bits for current channel */
+ int shifts = 0; /* Number of channels extracted from byte */
+ int offset = 0; /* Current offset into pixelPtr */
+ int colStep = 1; /* Column increment each pass */
+ int pixStep = 0; /* extra pixelPtr increment each pass */
+ unsigned char lastPixel[6];
+ unsigned char *p = Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, NULL);
+
+ p++;
+ if (UnfilterLine(interp, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (pngPtr->interlace) {
+ switch (pngPtr->phase) {
+ case 1: /* Phase 1: */
+ colStep = 8; /* 1 pixel per block of 8 per line */
+ break; /* Start at column 0 */
+ case 2: /* Phase 2: */
+ colStep = 8; /* 1 pixels per block of 8 per line */
+ colNum = 4; /* Start at column 4 */
+ break;
+ case 3: /* Phase 3: */
+ colStep = 4; /* 2 pixels per block of 8 per line */
+ break; /* Start at column 0 */
+ case 4: /* Phase 4: */
+ colStep = 4; /* 2 pixels per block of 8 per line */
+ colNum = 2; /* Start at column 2 */
+ break;
+ case 5: /* Phase 5: */
+ colStep = 2; /* 4 pixels per block of 8 per line */
+ break; /* Start at column 0 */
+ case 6: /* Phase 6: */
+ colStep = 2; /* 4 pixels per block of 8 per line */
+ colNum = 1; /* Start at column 1 */
+ break;
+ /* Phase 7: */
+ /* 8 pixels per block of 8 per line */
+ /* Start at column 0 */
+ }
+ }
+
+ /*
+ * Calculate offset into pixelPtr for the first pixel of the line.
+ */
+
+ offset = pngPtr->currentLine * pngPtr->block.pitch;
+
+ /*
+ * Adjust up for the starting pixel of the line.
+ */
+
+ offset += colNum * pngPtr->block.pixelSize;
+
+ /*
+ * Calculate the extra number of bytes to skip between columns.
+ */
+
+ pixStep = (colStep - 1) * pngPtr->block.pixelSize;
+
+ for ( ; colNum < pngPtr->block.width ; colNum += colStep) {
+ if (haveBits < (pngPtr->bitDepth * pngPtr->numChannels)) {
+ haveBits = 0;
+ }
+
+ for (chan = 0 ; chan < pngPtr->numChannels ; chan++) {
+ if (!haveBits) {
+ shifts = 0;
+ readByte = *p++;
+ haveBits += 8;
+ }
+
+ if (16 == pngPtr->bitDepth) {
+ pngPtr->block.pixelPtr[offset++] = readByte;
+
+ if (pngPtr->useTRNS) {
+ lastPixel[chan * 2] = readByte;
+ }
+
+ readByte = *p++;
+
+ if (pngPtr->useTRNS) {
+ lastPixel[(chan * 2) + 1] = readByte;
+ }
+
+ pngPtr->block.pixelPtr[offset++] = readByte;
+
+ haveBits = 0;
+ continue;
+ }
+
+ switch (pngPtr->bitDepth) {
+ case 1:
+ pixBits = (unsigned char)((readByte >> (7-shifts)) & 0x01);
+ break;
+ case 2:
+ pixBits = (unsigned char)((readByte >> (6-shifts*2)) & 0x03);
+ break;
+ case 4:
+ pixBits = (unsigned char)((readByte >> (4-shifts*4)) & 0x0f);
+ break;
+ case 8:
+ pixBits = readByte;
+ break;
+ }
+
+ if (PNG_COLOR_PLTE == pngPtr->colorType) {
+ pixelPtr[offset++] = pngPtr->palette[pixBits].red;
+ pixelPtr[offset++] = pngPtr->palette[pixBits].green;
+ pixelPtr[offset++] = pngPtr->palette[pixBits].blue;
+ pixelPtr[offset++] = pngPtr->palette[pixBits].alpha;
+ chan += 2;
+ } else {
+ pixelPtr[offset++] = (unsigned char)
+ (pixBits * pngPtr->bitScale);
+
+ if (pngPtr->useTRNS) {
+ lastPixel[chan] = pixBits;
+ }
+ }
+
+ haveBits -= pngPtr->bitDepth;
+ shifts++;
+ }
+
+ /*
+ * Apply boolean transparency via tRNS data if necessary (where
+ * necessary means a tRNS chunk was provided and we're not using an
+ * alpha channel or indexed alpha).
+ */
+
+ if ((PNG_COLOR_PLTE != pngPtr->colorType) &&
+ ((pngPtr->colorType & PNG_COLOR_ALPHA) == 0)) {
+ unsigned char alpha;
+
+ if (pngPtr->useTRNS) {
+ if (memcmp(lastPixel, pngPtr->transVal,
+ pngPtr->bytesPerPixel) == 0) {
+ alpha = 0x00;
+ } else {
+ alpha = 0xff;
+ }
+ } else {
+ alpha = 0xff;
+ }
+
+ pixelPtr[offset++] = alpha;
+
+ if (16 == pngPtr->bitDepth) {
+ pixelPtr[offset++] = alpha;
+ }
+ }
+
+ offset += pixStep;
+ }
+
+ if (pngPtr->interlace) {
+ /* Skip lines */
+
+ switch (pngPtr->phase) {
+ case 1: case 2: case 3:
+ pngPtr->currentLine += 8;
+ break;
+ case 4: case 5:
+ pngPtr->currentLine += 4;
+ break;
+ case 6: case 7:
+ pngPtr->currentLine += 2;
+ break;
+ }
+
+ /*
+ * Start the next phase if there are no more lines to do.
+ */
+
+ if (pngPtr->currentLine >= pngPtr->block.height) {
+ unsigned long pixels = 0;
+
+ while ((!pixels || (pngPtr->currentLine >= pngPtr->block.height))
+ && (pngPtr->phase < 7)) {
+ pngPtr->phase++;
+
+ switch (pngPtr->phase) {
+ case 2:
+ pixels = (pngPtr->block.width + 3) >> 3;
+ pngPtr->currentLine = 0;
+ break;
+ case 3:
+ pixels = (pngPtr->block.width + 3) >> 2;
+ pngPtr->currentLine = 4;
+ break;
+ case 4:
+ pixels = (pngPtr->block.width + 1) >> 2;
+ pngPtr->currentLine = 0;
+ break;
+ case 5:
+ pixels = (pngPtr->block.width + 1) >> 1;
+ pngPtr->currentLine = 2;
+ break;
+ case 6:
+ pixels = pngPtr->block.width >> 1;
+ pngPtr->currentLine = 0;
+ break;
+ case 7:
+ pngPtr->currentLine = 1;
+ pixels = pngPtr->block.width;
+ break;
+ }
+ }
+
+ if (16 == pngPtr->bitDepth) {
+ pngPtr->phaseSize = 1 + (pngPtr->numChannels * pixels * 2);
+ } else {
+ pngPtr->phaseSize = 1 + ((pngPtr->numChannels * pixels *
+ pngPtr->bitDepth + 7) >> 3);
+ }
+ }
+ } else {
+ pngPtr->currentLine++;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadIDAT --
+ *
+ * This function reads the IDAT (pixel data) chunk from the PNG file to
+ * build the image. It will continue reading until all IDAT chunks have
+ * been processed or an error occurs.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs or an IDAT chunk is
+ * invalid.
+ *
+ * Side effects:
+ * The access position in f advances. Memory may be allocated by zlib
+ * through PNGZAlloc.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReadIDAT(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ int chunkSz,
+ unsigned long crc)
+{
+ /*
+ * Process IDAT contents until there is no more in this chunk.
+ */
+
+ while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream)) {
+ int len1, len2;
+
+ /*
+ * Read another block of input into the zlib stream if data remains.
+ */
+
+ if (chunkSz) {
+ Tcl_Obj *inputObj = NULL;
+ int blockSz = PNG_MIN(chunkSz, PNG_BLOCK_SZ);
+ unsigned char *inputPtr = NULL;
+
+ /*
+ * Check for end of zlib stream.
+ */
+
+ if (Tcl_ZlibStreamEof(pngPtr->stream)) {
+ Tcl_SetResult(interp, "Extra data after end of zlib stream",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ inputObj = Tcl_NewObj();
+ Tcl_IncrRefCount(inputObj);
+ inputPtr = Tcl_SetByteArrayLength(inputObj, blockSz);
+
+ /*
+ * Read the next bit of IDAT chunk data, up to read buffer size.
+ */
+
+ if (ReadData(interp, pngPtr, inputPtr, blockSz,
+ &crc) == TCL_ERROR) {
+ Tcl_DecrRefCount(inputObj);
+ return TCL_ERROR;
+ }
+
+ chunkSz -= blockSz;
+
+ Tcl_ZlibStreamPut(pngPtr->stream, inputObj, TCL_ZLIB_NO_FLUSH);
+ Tcl_DecrRefCount(inputObj);
+ }
+
+ /*
+ * Inflate, processing each output buffer's worth as a line of pixels,
+ * until we cannot fill the buffer any more.
+ */
+
+ getNextLine:
+ Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, &len1);
+ if (Tcl_ZlibStreamGet(pngPtr->stream, pngPtr->thisLineObj,
+ pngPtr->phaseSize - len1) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, &len2);
+
+ if (len2 == pngPtr->phaseSize) {
+ if (pngPtr->phase > 7) {
+ Tcl_SetResult(interp,
+ "Extra data after final scan line of final phase",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (DecodeLine(interp, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Swap the current/last lines so that we always have the last
+ * line processed available, which is necessary for filtering.
+ */
+
+ {
+ Tcl_Obj *temp = pngPtr->lastLineObj;
+
+ pngPtr->lastLineObj = pngPtr->thisLineObj;
+ pngPtr->thisLineObj = temp;
+ }
+ Tcl_SetByteArrayLength(pngPtr->thisLineObj, 0);
+
+ /*
+ * Try to read another line of pixels out of the buffer
+ * immediately.
+ */
+
+ goto getNextLine;
+ }
+
+ /*
+ * Got less than a whole buffer-load of pixels. Either we're going to
+ * be getting more data from the next IDAT, or we've done what we can
+ * here.
+ */
+ }
+
+ /*
+ * Ensure that if we've got to the end of the compressed data, we've
+ * also got to the end of the compressed stream. This sanity check is
+ * enforced by most PNG readers.
+ */
+
+ if (chunkSz != 0) {
+ Tcl_AppendResult(interp,
+ "compressed data after stream finalize in PNG data", NULL);
+ return TCL_ERROR;
+ }
+
+ return CheckCRC(interp, pngPtr, crc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ApplyAlpha --
+ *
+ * Applies an overall alpha value to a complete image that has been read.
+ * This alpha value is specified using the -format option to [image
+ * create photo].
+ *
+ * Results:
+ * N/A
+ *
+ * Side effects:
+ * The access position in f may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ApplyAlpha(
+ PNGImage *pngPtr)
+{
+ if (pngPtr->alpha != 1.0) {
+ register unsigned char *p = pngPtr->block.pixelPtr;
+ unsigned char *endPtr = p + pngPtr->blockLen;
+ int offset = pngPtr->block.offset[3];
+
+ p += offset;
+
+ if (16 == pngPtr->bitDepth) {
+ register int channel;
+
+ while (p < endPtr) {
+ channel = (unsigned char)
+ (((p[0] << 8) | p[1]) * pngPtr->alpha);
+
+ *p++ = (unsigned char) (channel >> 8);
+ *p++ = (unsigned char) (channel & 0xff);
+
+ p += offset;
+ }
+ } else {
+ while (p < endPtr) {
+ p[0] = (unsigned char) (pngPtr->alpha * p[0]);
+ p += 1 + offset;
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ParseFormat --
+ *
+ * This function parses the -format string that can be specified to the
+ * [image create photo] command to extract options for postprocessing of
+ * loaded images. Currently, this just allows specifying and applying an
+ * overall alpha value to the loaded image (for example, to make it
+ * entirely 50% as transparent as the actual image file).
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the format specification is invalid.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ParseFormat(
+ Tcl_Interp *interp,
+ Tcl_Obj *fmtObj,
+ PNGImage *pngPtr)
+{
+ Tcl_Obj **objv = NULL;
+ int objc = 0;
+ static const char *const fmtOptions[] = {
+ "png", "-alpha", NULL
+ };
+ enum fmtOptions {
+ OPT_PNG, OPT_ALPHA
+ };
+
+ /*
+ * Extract elements of format specification as a list.
+ */
+
+ if (fmtObj &&
+ Tcl_ListObjGetElements(interp, fmtObj, &objc, &objv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ for (; objc>0 ; objc--, objv++) {
+ int optIndex;
+
+ if (Tcl_GetIndexFromObj(interp, objv[0], fmtOptions, "option", 0,
+ &optIndex) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Ignore the "png" part of the format specification.
+ */
+
+ if (OPT_PNG == optIndex) {
+ continue;
+ }
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "value");
+ return TCL_ERROR;
+ }
+
+ objc--;
+ objv++;
+
+ switch ((enum fmtOptions) optIndex) {
+ case OPT_PNG:
+ break;
+
+ case OPT_ALPHA:
+ if (Tcl_GetDoubleFromObj(interp, objv[0],
+ &pngPtr->alpha) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if ((pngPtr->alpha < 0.0) || (pngPtr->alpha > 1.0)) {
+ Tcl_SetResult(interp,
+ "-alpha value must be between 0.0 and 1.0",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ break;
+ }
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DecodePNG --
+ *
+ * This function handles the entirety of reading a PNG file (or data)
+ * from the first byte to the last.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O error occurs or any problems are
+ * detected in the PNG file.
+ *
+ * Side effects:
+ * The access position in f advances. Memory may be allocated and image
+ * dimensions and contents may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+DecodePNG(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ Tcl_Obj *fmtObj,
+ Tk_PhotoHandle imageHandle,
+ int destX,
+ int destY)
+{
+ unsigned long chunkType;
+ int chunkSz;
+ unsigned long crc;
+
+ /*
+ * Parse the PNG signature and IHDR (header) chunk.
+ */
+
+ if (ReadIHDR(interp, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Extract alpha value from -format object, if specified.
+ */
+
+ if (ParseFormat(interp, fmtObj, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * The next chunk may either be a PLTE (Palette) chunk or the first of at
+ * least one IDAT (data) chunks. It could also be one of a number of
+ * ancillary chunks, but those are skipped for us by the switch in
+ * ReadChunkHeader().
+ *
+ * PLTE is mandatory for color type 3 and forbidden for 2 and 6
+ */
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (CHUNK_PLTE == chunkType) {
+ /*
+ * Finish parsing the PLTE chunk.
+ */
+
+ if (ReadPLTE(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Begin the next chunk.
+ */
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ } else if (PNG_COLOR_PLTE == pngPtr->colorType) {
+ Tcl_SetResult(interp, "PLTE chunk required for indexed color",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * The next chunk may be a tRNS (palette transparency) chunk, depending on
+ * the color type. It must come after the PLTE chunk and before the IDAT
+ * chunk, but can be present if there is no PLTE chunk because it can be
+ * used for Grayscale and TrueColor in lieu of an alpha channel.
+ */
+
+ if (CHUNK_tRNS == chunkType) {
+ /*
+ * Finish parsing the tRNS chunk.
+ */
+
+ if (ReadTRNS(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Begin the next chunk.
+ */
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * Other ancillary chunk types could appear here, but for now we're only
+ * interested in IDAT. The others should have been skipped.
+ */
+
+ if (CHUNK_IDAT != chunkType) {
+ Tcl_SetResult(interp, "At least one IDAT chunk is required",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Expand the photo size (if not set by the user) to provide enough space
+ * for the image being parsed. It does not matter if width or height wrap
+ * to negative here: Tk will not shrink the image.
+ */
+
+ if (Tk_PhotoExpand(interp, imageHandle, destX + pngPtr->block.width,
+ destY + pngPtr->block.height) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * A scan line consists of one byte for a filter type, plus the number of
+ * bits per color sample times the number of color samples per pixel.
+ */
+
+ if (pngPtr->block.width > ((INT_MAX - 1) / (pngPtr->numChannels * 2))) {
+ Tcl_SetResult(interp,
+ "Line size is out of supported range on this architecture",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (16 == pngPtr->bitDepth) {
+ pngPtr->lineSize = 1 + (pngPtr->numChannels * pngPtr->block.width*2);
+ } else {
+ pngPtr->lineSize = 1 + ((pngPtr->numChannels * pngPtr->block.width) /
+ (8 / pngPtr->bitDepth));
+ if (pngPtr->block.width % (8 / pngPtr->bitDepth)) {
+ pngPtr->lineSize++;
+ }
+ }
+
+ /*
+ * Allocate space for decoding the scan lines.
+ */
+
+ pngPtr->lastLineObj = Tcl_NewObj();
+ Tcl_IncrRefCount(pngPtr->lastLineObj);
+ pngPtr->thisLineObj = Tcl_NewObj();
+ Tcl_IncrRefCount(pngPtr->thisLineObj);
+
+ pngPtr->block.pixelPtr = attemptckalloc(pngPtr->blockLen);
+ if (!pngPtr->block.pixelPtr) {
+ Tcl_SetResult(interp, "Memory allocation failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Determine size of the first phase if interlaced. Phase size should
+ * always be <= line size, so probably not necessary to check for
+ * arithmetic overflow here: should be covered by line size check.
+ */
+
+ if (pngPtr->interlace) {
+ /*
+ * Only one pixel per block of 8 per line in the first phase.
+ */
+
+ unsigned int pixels = (pngPtr->block.width + 7) >> 3;
+
+ pngPtr->phase = 1;
+ if (16 == pngPtr->bitDepth) {
+ pngPtr->phaseSize = 1 + pngPtr->numChannels*pixels*2;
+ } else {
+ pngPtr->phaseSize = 1 +
+ ((pngPtr->numChannels*pixels*pngPtr->bitDepth + 7) >> 3);
+ }
+ } else {
+ pngPtr->phaseSize = pngPtr->lineSize;
+ }
+
+ /*
+ * All of the IDAT (data) chunks must be consecutive.
+ */
+
+ while (CHUNK_IDAT == chunkType) {
+ if (ReadIDAT(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * Ensure that we've got to the end of the compressed stream now that
+ * there are no more IDAT segments. This sanity check is enforced by most
+ * PNG readers.
+ */
+
+ if (!Tcl_ZlibStreamEof(pngPtr->stream)) {
+ Tcl_AppendResult(interp, "unfinalized data stream in PNG data", NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Now skip the remaining chunks which we're also not interested in.
+ */
+
+ while (CHUNK_IEND != chunkType) {
+ if (SkipChunk(interp, pngPtr, chunkSz, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (ReadChunkHeader(interp, pngPtr, &chunkSz, &chunkType,
+ &crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ }
+
+ /*
+ * Got the IEND (end of image) chunk. Do some final checks...
+ */
+
+ if (chunkSz) {
+ Tcl_SetResult(interp, "IEND chunk contents must be empty",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Check the CRC on the IEND chunk.
+ */
+
+ if (CheckCRC(interp, pngPtr, crc) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * TODO: verify that nothing else comes after the IEND chunk, or do we
+ * really care?
+ */
+
+#if 0
+ if (ReadData(interp, pngPtr, &c, 1, NULL) != TCL_ERROR) {
+ Tcl_SetResult(interp, "Extra data following IEND chunk", TCL_STATIC);
+ return TCL_ERROR;
+ }
+#endif
+
+ /*
+ * Apply overall image alpha if specified.
+ */
+
+ ApplyAlpha(pngPtr);
+
+ /*
+ * Copy the decoded image block into the Tk photo image.
+ */
+
+ if (Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY,
+ pngPtr->block.width, pngPtr->block.height,
+ TK_PHOTO_COMPOSITE_SET) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FileMatchPNG --
+ *
+ * This function is invoked by the photo image type to see if a file
+ * contains image data in PNG format.
+ *
+ * Results:
+ * The return value is 1 if the first characters in file f look like PNG
+ * data, and 0 otherwise.
+ *
+ * Side effects:
+ * The access position in f may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+FileMatchPNG(
+ Tcl_Channel chan,
+ const char *fileName,
+ Tcl_Obj *fmtObj,
+ int *widthPtr,
+ int *heightPtr,
+ Tcl_Interp *interp)
+{
+ PNGImage png;
+ int match = 0;
+ Tcl_SavedResult sya;
+
+ Tcl_SaveResult(interp, &sya);
+
+ InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
+
+ if (ReadIHDR(interp, &png) == TCL_OK) {
+ *widthPtr = png.block.width;
+ *heightPtr = png.block.height;
+ match = 1;
+ }
+
+ CleanupPNGImage(&png);
+ Tcl_RestoreResult(interp, &sya);
+
+ return match;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FileReadPNG --
+ *
+ * This function is called by the photo image type to read PNG format
+ * data from a file and write it into a given photo image.
+ *
+ * Results:
+ * A standard TCL completion code. If TCL_ERROR is returned 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 added to the
+ * image given by imageHandle.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+FileReadPNG(
+ Tcl_Interp *interp,
+ Tcl_Channel chan,
+ const char *fileName,
+ Tcl_Obj *fmtObj,
+ Tk_PhotoHandle imageHandle,
+ int destX,
+ int destY,
+ int width,
+ int height,
+ int srcX,
+ int srcY)
+{
+ PNGImage png;
+ int result = TCL_ERROR;
+
+ result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
+
+ if (TCL_OK == result) {
+ result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY);
+ }
+
+ CleanupPNGImage(&png);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * StringMatchPNG --
+ *
+ * This function is invoked by the photo image type to see if an object
+ * contains image data in PNG format.
+ *
+ * Results:
+ * The return value is 1 if the first characters in the data are like PNG
+ * data, and 0 otherwise.
+ *
+ * Side effects:
+ * The size of the image is placed in widthPre and heightPtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+StringMatchPNG(
+ Tcl_Obj *pObjData,
+ Tcl_Obj *fmtObj,
+ int *widthPtr,
+ int *heightPtr,
+ Tcl_Interp *interp)
+{
+ PNGImage png;
+ int match = 0;
+ Tcl_SavedResult sya;
+
+ Tcl_SaveResult(interp, &sya);
+ InitPNGImage(interp, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE);
+
+ png.strDataBuf = Tcl_GetByteArrayFromObj(pObjData, &png.strDataLen);
+
+ if (ReadIHDR(interp, &png) == TCL_OK) {
+ *widthPtr = png.block.width;
+ *heightPtr = png.block.height;
+ match = 1;
+ }
+
+ CleanupPNGImage(&png);
+ Tcl_RestoreResult(interp, &sya);
+ return match;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * StringReadPNG --
+ *
+ * This function is called by the photo image type to read PNG format
+ * data from an object and give it to the photo image.
+ *
+ * Results:
+ * A standard TCL completion code. If TCL_ERROR is returned then an error
+ * message is left in the interp's result.
+ *
+ * Side effects:
+ * New data is added to the image given by imageHandle.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+StringReadPNG(
+ Tcl_Interp *interp,
+ Tcl_Obj *pObjData,
+ Tcl_Obj *fmtObj,
+ Tk_PhotoHandle imageHandle,
+ int destX,
+ int destY,
+ int width,
+ int height,
+ int srcX,
+ int srcY)
+{
+ PNGImage png;
+ int result = TCL_ERROR;
+
+ result = InitPNGImage(interp, &png, NULL, pObjData,
+ TCL_ZLIB_STREAM_INFLATE);
+
+ if (TCL_OK == result) {
+ result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY);
+ }
+
+ CleanupPNGImage(&png);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteData --
+ *
+ * This function writes a bytes from a buffer out to the PNG image.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * File or buffer will be modified.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WriteData(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ const unsigned char *srcPtr,
+ int srcSz,
+ unsigned long *crcPtr)
+{
+ if (!srcPtr || !srcSz) {
+ return TCL_OK;
+ }
+
+ if (crcPtr) {
+ *crcPtr = Tcl_ZlibCRC32(*crcPtr, srcPtr, srcSz);
+ }
+
+ /*
+ * TODO: is Tcl_AppendObjToObj faster here? i.e., does Tcl join the
+ * objects immediately or store them in a multi-object rep?
+ */
+
+ if (pngPtr->objDataPtr) {
+ int objSz;
+ unsigned char *destPtr;
+
+ Tcl_GetByteArrayFromObj(pngPtr->objDataPtr, &objSz);
+
+ if (objSz > INT_MAX - srcSz) {
+ Tcl_SetResult(interp,
+ "Image too large to store completely in byte array",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ destPtr = Tcl_SetByteArrayLength(pngPtr->objDataPtr, objSz + srcSz);
+
+ if (!destPtr) {
+ Tcl_SetResult(interp, "Memory allocation failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ memcpy(destPtr+objSz, srcPtr, srcSz);
+ } else if (Tcl_Write(pngPtr->channel, (const char *) srcPtr, srcSz) < 0) {
+ /* TODO: reason */
+
+ Tcl_SetResult(interp, "Write to channel failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+static inline int
+WriteByte(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned char c,
+ unsigned long *crcPtr)
+{
+ return WriteData(interp, pngPtr, &c, 1, crcPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteInt32 --
+ *
+ * This function writes a 32-bit integer value out to the PNG image as
+ * four bytes in network byte order.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * File or buffer will be modified.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline int
+WriteInt32(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned long l,
+ unsigned long *crcPtr)
+{
+ unsigned char pc[4];
+
+ pc[0] = (unsigned char) ((l & 0xff000000) >> 24);
+ pc[1] = (unsigned char) ((l & 0x00ff0000) >> 16);
+ pc[2] = (unsigned char) ((l & 0x0000ff00) >> 8);
+ pc[3] = (unsigned char) ((l & 0x000000ff) >> 0);
+
+ return WriteData(interp, pngPtr, pc, 4, crcPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteChunk --
+ *
+ * Writes a complete chunk to the PNG image, including chunk type,
+ * length, contents, and CRC.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline int
+WriteChunk(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ unsigned long chunkType,
+ const unsigned char *dataPtr,
+ int dataSize)
+{
+ unsigned long crc = Tcl_ZlibCRC32(0, NULL, 0);
+ int result = TCL_OK;
+
+ /*
+ * Write the length field for the chunk.
+ */
+
+ result = WriteInt32(interp, pngPtr, dataSize, NULL);
+
+ /*
+ * Write the Chunk Type.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, chunkType, &crc);
+ }
+
+ /*
+ * Write the contents (if any).
+ */
+
+ if (TCL_OK == result) {
+ result = WriteData(interp, pngPtr, dataPtr, dataSize, &crc);
+ }
+
+ /*
+ * Write out the CRC at the end of the chunk.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, crc, NULL);
+ }
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteIHDR --
+ *
+ * This function writes the PNG header at the beginning of a PNG file,
+ * which includes information such as dimensions and color type.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * File or buffer will be modified.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WriteIHDR(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ Tk_PhotoImageBlock *blockPtr)
+{
+ unsigned long crc = Tcl_ZlibCRC32(0, NULL, 0);
+ int result = TCL_OK;
+
+ /*
+ * The IHDR (header) chunk has a fixed size of 13 bytes.
+ */
+
+ result = WriteInt32(interp, pngPtr, 13, NULL);
+
+ /*
+ * Write the IHDR Chunk Type.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, CHUNK_IHDR, &crc);
+ }
+
+ /*
+ * Write the image width, height.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, (unsigned long) blockPtr->width,
+ &crc);
+ }
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, (unsigned long) blockPtr->height,
+ &crc);
+ }
+
+ /*
+ * Write bit depth. Although the PNG format supports 16 bits per channel,
+ * Tk supports only 8 in the internal representation, which blockPtr
+ * points to.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteByte(interp, pngPtr, 8, &crc);
+ }
+
+ /*
+ * Write out the color type, previously determined.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteByte(interp, pngPtr, pngPtr->colorType, &crc);
+ }
+
+ /*
+ * Write compression method (only one method is defined).
+ */
+
+ if (TCL_OK == result) {
+ result = WriteByte(interp, pngPtr, PNG_COMPRESS_DEFLATE, &crc);
+ }
+
+ /*
+ * Write filter method (only one method is defined).
+ */
+
+ if (TCL_OK == result) {
+ result = WriteByte(interp, pngPtr, PNG_FILTMETH_STANDARD, &crc);
+ }
+
+ /*
+ * Write interlace method as not interlaced.
+ *
+ * TODO: support interlace through -format?
+ */
+
+ if (TCL_OK == result) {
+ result = WriteByte(interp, pngPtr, PNG_INTERLACE_NONE, &crc);
+ }
+
+ /*
+ * Write out the CRC at the end of the chunk.
+ */
+
+ if (TCL_OK == result) {
+ result = WriteInt32(interp, pngPtr, crc, NULL);
+ }
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteIDAT --
+ *
+ * Writes the IDAT (data) chunk to the PNG image, containing the pixel
+ * channel data. Currently, image lines are not filtered and writing
+ * interlaced pixels is not supported.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WriteIDAT(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr,
+ Tk_PhotoImageBlock *blockPtr)
+{
+ int rowNum, flush = TCL_ZLIB_NO_FLUSH, outputSize, result;
+ Tcl_Obj *outputObj;
+ unsigned char *outputBytes;
+
+ /*
+ * Filter and compress each row one at a time.
+ */
+
+ for (rowNum=0 ; rowNum < blockPtr->height ; rowNum++) {
+ int colNum;
+ unsigned char *srcPtr, *destPtr;
+
+ srcPtr = blockPtr->pixelPtr + (rowNum * blockPtr->pitch);
+ destPtr = Tcl_SetByteArrayLength(pngPtr->thisLineObj,
+ pngPtr->lineSize);
+
+ /*
+ * TODO: use Paeth filtering.
+ */
+
+ *destPtr++ = PNG_FILTER_NONE;
+
+ /*
+ * Copy each pixel into the destination buffer after the filter type
+ * before filtering.
+ */
+
+ for (colNum = 0 ; colNum < blockPtr->width ; colNum++) {
+ /*
+ * Copy red or gray channel.
+ */
+
+ *destPtr++ = srcPtr[blockPtr->offset[0]];
+
+ /*
+ * If not grayscale, copy the green and blue channels.
+ */
+
+ if (pngPtr->colorType & PNG_COLOR_USED) {
+ *destPtr++ = srcPtr[blockPtr->offset[1]];
+ *destPtr++ = srcPtr[blockPtr->offset[2]];
+ }
+
+ /*
+ * Copy the alpha channel, if used.
+ */
+
+ if (pngPtr->colorType & PNG_COLOR_ALPHA) {
+ *destPtr++ = srcPtr[blockPtr->offset[3]];
+ }
+
+ /*
+ * Point to the start of the next pixel.
+ */
+
+ srcPtr += blockPtr->pixelSize;
+ }
+
+ /*
+ * Compress the line of pixels into the destination. If this is the
+ * last line, finalize the compressor at the same time. Note that this
+ * can't be just a flush; that leads to a file that some PNG readers
+ * choke on. [Bug 2984787]
+ */
+
+ if (rowNum + 1 == blockPtr->height) {
+ flush = TCL_ZLIB_FINALIZE;
+ }
+ if (Tcl_ZlibStreamPut(pngPtr->stream, pngPtr->thisLineObj,
+ flush) != TCL_OK) {
+ Tcl_SetResult(interp, "deflate() returned error", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Swap line buffers to keep the last around for filtering next.
+ */
+
+ {
+ Tcl_Obj *temp = pngPtr->lastLineObj;
+
+ pngPtr->lastLineObj = pngPtr->thisLineObj;
+ pngPtr->thisLineObj = temp;
+ }
+ }
+
+ /*
+ * Now get the compressed data and write it as one big IDAT chunk.
+ */
+
+ outputObj = Tcl_NewObj();
+ (void) Tcl_ZlibStreamGet(pngPtr->stream, outputObj, -1);
+ outputBytes = Tcl_GetByteArrayFromObj(outputObj, &outputSize);
+ result = WriteChunk(interp, pngPtr, CHUNK_IDAT, outputBytes, outputSize);
+ Tcl_DecrRefCount(outputObj);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WriteExtraChunks --
+ *
+ * Writes an sBIT and a tEXt chunks to the PNG image, describing a bunch
+ * of not very important metadata that many readers seem to need anyway.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if the write fails.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+WriteExtraChunks(
+ Tcl_Interp *interp,
+ PNGImage *pngPtr)
+{
+ static const unsigned char sBIT_contents[] = {
+ 8, 8, 8, 8
+ };
+ int sBIT_length = 4;
+ Tcl_DString buf;
+
+ /*
+ * Each byte of each channel is always significant; we always write RGBA
+ * images with 8 bits per channel as that is what the photo image's basic
+ * data model is.
+ */
+
+ switch (pngPtr->colorType) {
+ case PNG_COLOR_GRAY:
+ sBIT_length = 1;
+ break;
+ case PNG_COLOR_GRAYALPHA:
+ sBIT_length = 2;
+ break;
+ case PNG_COLOR_RGB:
+ case PNG_COLOR_PLTE:
+ sBIT_length = 3;
+ break;
+ case PNG_COLOR_RGBA:
+ sBIT_length = 4;
+ break;
+ }
+ if (WriteChunk(interp, pngPtr, CHUNK_sBIT, sBIT_contents, sBIT_length)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Say that it is Tk that made the PNG. Note that we *need* the NUL at the
+ * end of "Software" to be transferred; do *not* change the length
+ * parameter to -1 there!
+ */
+
+ Tcl_DStringInit(&buf);
+ Tcl_DStringAppend(&buf, "Software", 9);
+ Tcl_DStringAppend(&buf, "Tk Toolkit v", -1);
+ Tcl_DStringAppend(&buf, TK_PATCH_LEVEL, -1);
+ if (WriteChunk(interp, pngPtr, CHUNK_tEXt,
+ (unsigned char *) Tcl_DStringValue(&buf),
+ Tcl_DStringLength(&buf)) != TCL_OK) {
+ Tcl_DStringFree(&buf);
+ return TCL_ERROR;
+ }
+ Tcl_DStringFree(&buf);
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EncodePNG --
+ *
+ * This function handles the entirety of writing a PNG file (or data)
+ * from the first byte to the last. No effort is made to optimize the
+ * image data for best compression.
+ *
+ * Results:
+ * TCL_OK, or TCL_ERROR if an I/O or memory error occurs.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+EncodePNG(
+ Tcl_Interp *interp,
+ Tk_PhotoImageBlock *blockPtr,
+ PNGImage *pngPtr)
+{
+ int greenOffset, blueOffset, alphaOffset;
+
+ /*
+ * Determine appropriate color type based on color usage (e.g., only red
+ * and maybe alpha channel = grayscale).
+ *
+ * TODO: Check whether this is doing any good; Tk might just be pushing
+ * full RGBA data all the time through here, even though the actual image
+ * doesn't need it...
+ */
+
+ greenOffset = blockPtr->offset[1] - blockPtr->offset[0];
+ blueOffset = blockPtr->offset[2] - blockPtr->offset[0];
+ alphaOffset = blockPtr->offset[3];
+ if ((alphaOffset >= blockPtr->pixelSize) || (alphaOffset < 0)) {
+ alphaOffset = 0;
+ } else {
+ alphaOffset -= blockPtr->offset[0];
+ }
+
+ if ((greenOffset != 0) || (blueOffset != 0)) {
+ if (alphaOffset) {
+ pngPtr->colorType = PNG_COLOR_RGBA;
+ pngPtr->bytesPerPixel = 4;
+ } else {
+ pngPtr->colorType = PNG_COLOR_RGBA;
+ pngPtr->bytesPerPixel = 3;
+ }
+ } else {
+ if (alphaOffset) {
+ pngPtr->colorType = PNG_COLOR_GRAYALPHA;
+ pngPtr->bytesPerPixel = 2;
+ } else {
+ pngPtr->colorType = PNG_COLOR_GRAY;
+ pngPtr->bytesPerPixel = 1;
+ }
+ }
+
+ /*
+ * Allocate buffers for lines for filtering and compressed data.
+ */
+
+ pngPtr->lineSize = 1 + (pngPtr->bytesPerPixel * blockPtr->width);
+ pngPtr->blockLen = pngPtr->lineSize * blockPtr->height;
+
+ if ((blockPtr->width > (INT_MAX - 1) / (pngPtr->bytesPerPixel)) ||
+ (blockPtr->height > INT_MAX / pngPtr->lineSize)) {
+ Tcl_SetResult(interp, "Image is too large to encode pixel data",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ pngPtr->lastLineObj = Tcl_NewObj();
+ Tcl_IncrRefCount(pngPtr->lastLineObj);
+ pngPtr->thisLineObj = Tcl_NewObj();
+ Tcl_IncrRefCount(pngPtr->thisLineObj);
+
+ /*
+ * Write out the PNG Signature that all PNGs begin with.
+ */
+
+ if (WriteData(interp, pngPtr, pngSignature, PNG_SIG_SZ,
+ NULL) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Write out the IHDR (header) chunk containing image dimensions, color
+ * type, etc.
+ */
+
+ if (WriteIHDR(interp, pngPtr, blockPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Write out the extra chunks containing metadata that is of interest to
+ * other programs more than us.
+ */
+
+ if (WriteExtraChunks(interp, pngPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Write out the image pixels in the IDAT (data) chunk.
+ */
+
+ if (WriteIDAT(interp, pngPtr, blockPtr) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Write out the IEND chunk that all PNGs end with.
+ */
+
+ return WriteChunk(interp, pngPtr, CHUNK_IEND, NULL, 0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FileWritePNG --
+ *
+ * This function is called by the photo image type to write PNG format
+ * data to a file.
+ *
+ * Results:
+ * A standard TCL completion code. If TCL_ERROR is returned then an error
+ * message is left in the interp's result.
+ *
+ * Side effects:
+ * The specified file is overwritten.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+FileWritePNG(
+ Tcl_Interp *interp,
+ const char *filename,
+ Tcl_Obj *fmtObj,
+ Tk_PhotoImageBlock *blockPtr)
+{
+ Tcl_Channel chan;
+ PNGImage png;
+ int result = TCL_ERROR;
+
+ /*
+ * Open a Tcl file channel where the image data will be stored. Tk ought
+ * to take care of this, and just provide a channel, but it doesn't.
+ */
+
+ chan = Tcl_OpenFileChannel(interp, filename, "w", 0644);
+
+ if (!chan) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Initalize PNGImage instance for encoding.
+ */
+
+ if (InitPNGImage(interp, &png, chan, NULL,
+ TCL_ZLIB_STREAM_DEFLATE) == TCL_ERROR) {
+ goto cleanup;
+ }
+
+ /*
+ * Set the translation mode to binary so that CR and LF are not to the
+ * platform's EOL sequence.
+ */
+
+ if (Tcl_SetChannelOption(interp, chan, "-translation",
+ "binary") != TCL_OK) {
+ goto cleanup;
+ }
+
+ /*
+ * Write the raw PNG data out to the file.
+ */
+
+ result = EncodePNG(interp, blockPtr, &png);
+
+ cleanup:
+ Tcl_Close(interp, chan);
+ CleanupPNGImage(&png);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * StringWritePNG --
+ *
+ * This function is called by the photo image type to write PNG format
+ * data to a Tcl object and return it in the result.
+ *
+ * Results:
+ * A standard TCL completion code. If TCL_ERROR is returned then an error
+ * message is left in the interp's result.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+StringWritePNG(
+ Tcl_Interp *interp,
+ Tcl_Obj *fmtObj,
+ Tk_PhotoImageBlock *blockPtr)
+{
+ Tcl_Obj *resultObj = Tcl_NewObj();
+ PNGImage png;
+ int result = TCL_ERROR;
+
+ /*
+ * Initalize PNGImage instance for encoding.
+ */
+
+ if (InitPNGImage(interp, &png, NULL, resultObj,
+ TCL_ZLIB_STREAM_DEFLATE) == TCL_ERROR) {
+ goto cleanup;
+ }
+
+ /*
+ * Write the raw PNG data into the prepared Tcl_Obj buffer. Set the result
+ * back to the interpreter if successful.
+ */
+
+ result = EncodePNG(interp, blockPtr, &png);
+
+ if (TCL_OK == result) {
+ Tcl_SetObjResult(interp, png.objDataPtr);
+ }
+
+ cleanup:
+ CleanupPNGImage(&png);
+ return result;
+}
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index 8a46fde..527efa2 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -34,14 +34,14 @@
* The format record for the PPM file format:
*/
-static int FileMatchPPM(Tcl_Channel chan, CONST char *fileName,
+static int FileMatchPPM(Tcl_Channel chan, const char *fileName,
Tcl_Obj *format, int *widthPtr, int *heightPtr,
Tcl_Interp *interp);
static int FileReadPPM(Tcl_Interp *interp, Tcl_Channel chan,
- CONST char *fileName, Tcl_Obj *format,
+ const char *fileName, Tcl_Obj *format,
Tk_PhotoHandle imageHandle, int destX, int destY,
int width, int height, int srcX, int srcY);
-static int FileWritePPM(Tcl_Interp *interp, CONST char *fileName,
+static int FileWritePPM(Tcl_Interp *interp, const char *fileName,
Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
static int StringWritePPM(Tcl_Interp *interp, Tcl_Obj *format,
Tk_PhotoImageBlock *blockPtr);
@@ -60,6 +60,7 @@ Tk_PhotoImageFormat tkImgFmtPPM = {
StringReadPPM, /* stringReadProc */
FileWritePPM, /* fileWriteProc */
StringWritePPM, /* stringWriteProc */
+ NULL
};
/*
@@ -93,7 +94,7 @@ static int ReadPPMStringHeader(Tcl_Obj *dataObj, int *widthPtr,
static int
FileMatchPPM(
Tcl_Channel chan, /* The image file, open for reading. */
- CONST char *fileName, /* The name of the image file. */
+ const char *fileName, /* The name of the image file. */
Tcl_Obj *format, /* User-specified format string, or NULL. */
int *widthPtr, int *heightPtr,
/* The dimensions of the image are returned
@@ -129,7 +130,7 @@ static int
FileReadPPM(
Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
Tcl_Channel chan, /* The image file, open for reading. */
- CONST char *fileName, /* The name of the image file. */
+ const char *fileName, /* The name of the image file. */
Tcl_Obj *format, /* User-specified format string, or NULL. */
Tk_PhotoHandle imageHandle, /* The photo image to write into. */
int destX, int destY, /* Coordinates of top-left pixel in photo
@@ -207,7 +208,7 @@ FileReadPPM(
nLines = 1;
}
nBytes = nLines * block.pitch;
- pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes);
+ pixelPtr = ckalloc(nBytes);
block.pixelPtr = pixelPtr + srcX * block.pixelSize;
for (h = height; h > 0; h -= nLines) {
@@ -221,7 +222,7 @@ FileReadPPM(
fileName, "\": ",
Tcl_Eof(chan) ? "not enough data" : Tcl_PosixError(interp),
NULL);
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
return TCL_ERROR;
}
if (maxIntensity != 255) {
@@ -234,13 +235,13 @@ FileReadPPM(
block.height = nLines;
if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
return TCL_ERROR;
}
destY += nLines;
}
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
return TCL_OK;
}
@@ -265,7 +266,7 @@ FileReadPPM(
static int
FileWritePPM(
Tcl_Interp *interp,
- CONST char *fileName,
+ const char *fileName,
Tcl_Obj *format,
Tk_PhotoImageBlock *blockPtr)
{
@@ -559,7 +560,7 @@ StringReadPPM(
nLines = 1;
}
nBytes = nLines * block.pitch;
- pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes);
+ pixelPtr = ckalloc(nBytes);
block.pixelPtr = pixelPtr + srcX * block.pixelSize;
for (h = height; h > 0; h -= nLines) {
@@ -570,7 +571,7 @@ StringReadPPM(
nBytes = nLines * block.pitch;
}
if (dataSize < nBytes) {
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
Tcl_AppendResult(interp, "truncated PPM data", NULL);
return TCL_ERROR;
}
@@ -581,13 +582,13 @@ StringReadPPM(
block.height = nLines;
if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
return TCL_ERROR;
}
destY += nLines;
}
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
return TCL_OK;
}
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
new file mode 100644
index 0000000..04f65e2
--- /dev/null
+++ b/generic/tkImgPhInstance.c
@@ -0,0 +1,1965 @@
+/*
+ * tkImgPhInstance.c --
+ *
+ * Implements the rendering of images of type "photo" for Tk. Photo
+ * images are stored in full color (32 bits per pixel including alpha
+ * channel) and displayed using dithering if necessary.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2002-2008 Donal K. Fellows
+ * Copyright (c) 2003 ActiveState Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * Author: Paul Mackerras (paulus@cs.anu.edu.au),
+ * Department of Computer Science,
+ * Australian National University.
+ */
+
+#include "tkImgPhoto.h"
+
+/*
+ * Declaration for internal Xlib function used here:
+ */
+
+extern int _XInitImageFuncPtrs(XImage *image);
+
+/*
+ * Forward declarations
+ */
+
+static void BlendComplexAlpha(XImage *bgImg, PhotoInstance *iPtr,
+ int xOffset, int yOffset, int width, int height);
+static int IsValidPalette(PhotoInstance *instancePtr,
+ const char *palette);
+static int CountBits(pixel mask);
+static void GetColorTable(PhotoInstance *instancePtr);
+static void FreeColorTable(ColorTable *colorPtr, int force);
+static void AllocateColors(ColorTable *colorPtr);
+static void DisposeColorTable(ClientData clientData);
+static int ReclaimColors(ColorTableId *id, int numColors);
+
+/*
+ * Hash table used to hash from (display, colormap, palette, gamma) to
+ * ColorTable address.
+ */
+
+static Tcl_HashTable imgPhotoColorHash;
+static int imgPhotoColorHashInitialized;
+#define N_COLOR_HASH (sizeof(ColorTableId) / sizeof(int))
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgPhotoConfigureInstance --
+ *
+ * This function is called to create displaying information for a photo
+ * image instance based on the configuration information in the master.
+ * It is invoked both when new instances are created and when the master
+ * is reconfigured.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates errors via Tcl_BackgroundError if there are problems in
+ * setting up the instance.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgPhotoConfigureInstance(
+ PhotoInstance *instancePtr) /* Instance to reconfigure. */
+{
+ PhotoMaster *masterPtr = instancePtr->masterPtr;
+ XImage *imagePtr;
+ int bitsPerPixel;
+ ColorTable *colorTablePtr;
+ XRectangle validBox;
+
+ /*
+ * If the -palette configuration option has been set for the master, use
+ * the value specified for our palette, but only if it is a valid palette
+ * for our windows. Use the gamma value specified the master.
+ */
+
+ if ((masterPtr->palette && masterPtr->palette[0])
+ && IsValidPalette(instancePtr, masterPtr->palette)) {
+ instancePtr->palette = masterPtr->palette;
+ } else {
+ instancePtr->palette = instancePtr->defaultPalette;
+ }
+ instancePtr->gamma = masterPtr->gamma;
+
+ /*
+ * If we don't currently have a color table, or if the one we have no
+ * longer applies (e.g. because our palette or gamma has changed), get a
+ * new one.
+ */
+
+ colorTablePtr = instancePtr->colorTablePtr;
+ if ((colorTablePtr == NULL)
+ || (instancePtr->colormap != colorTablePtr->id.colormap)
+ || (instancePtr->palette != colorTablePtr->id.palette)
+ || (instancePtr->gamma != colorTablePtr->id.gamma)) {
+ /*
+ * Free up our old color table, and get a new one.
+ */
+
+ if (colorTablePtr != NULL) {
+ colorTablePtr->liveRefCount -= 1;
+ FreeColorTable(colorTablePtr, 0);
+ }
+ GetColorTable(instancePtr);
+
+ /*
+ * Create a new XImage structure for sending data to the X server, if
+ * necessary.
+ */
+
+ if (instancePtr->colorTablePtr->flags & BLACK_AND_WHITE) {
+ bitsPerPixel = 1;
+ } else {
+ bitsPerPixel = instancePtr->visualInfo.depth;
+ }
+
+ if ((instancePtr->imagePtr == NULL)
+ || (instancePtr->imagePtr->bits_per_pixel != bitsPerPixel)) {
+ if (instancePtr->imagePtr != NULL) {
+ XDestroyImage(instancePtr->imagePtr);
+ }
+ imagePtr = XCreateImage(instancePtr->display,
+ instancePtr->visualInfo.visual, (unsigned) bitsPerPixel,
+ (bitsPerPixel > 1? ZPixmap: XYBitmap), 0, NULL,
+ 1, 1, 32, 0);
+ instancePtr->imagePtr = imagePtr;
+
+ /*
+ * We create images using the local host's endianness, rather than
+ * the endianness of the server; otherwise we would have to
+ * byte-swap any 16 or 32 bit values that we store in the image
+ * if the server's endianness is different from ours.
+ */
+
+ if (imagePtr != NULL) {
+#ifdef WORDS_BIGENDIAN
+ imagePtr->byte_order = MSBFirst;
+#else
+ imagePtr->byte_order = LSBFirst;
+#endif
+ _XInitImageFuncPtrs(imagePtr);
+ }
+ }
+ }
+
+ /*
+ * If the user has specified a width and/or height for the master which is
+ * different from our current width/height, set the size to the values
+ * specified by the user. If we have no pixmap, we do this also, since it
+ * has the side effect of allocating a pixmap for us.
+ */
+
+ if ((instancePtr->pixels == None) || (instancePtr->error == NULL)
+ || (instancePtr->width != masterPtr->width)
+ || (instancePtr->height != masterPtr->height)) {
+ TkImgPhotoInstanceSetSize(instancePtr);
+ }
+
+ /*
+ * Redither this instance if necessary.
+ */
+
+ if ((masterPtr->flags & IMAGE_CHANGED)
+ || (instancePtr->colorTablePtr != colorTablePtr)) {
+ TkClipBox(masterPtr->validRegion, &validBox);
+ if ((validBox.width > 0) && (validBox.height > 0)) {
+ TkImgDitherInstance(instancePtr, validBox.x, validBox.y,
+ validBox.width, validBox.height);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgPhotoGet --
+ *
+ * This function is called for each use of a photo image in a widget.
+ *
+ * Results:
+ * The return value is a token for the instance, which is passed back to
+ * us in calls to TkImgPhotoDisplay and ImgPhotoFree.
+ *
+ * Side effects:
+ * A data structure is set up for the instance (or, an existing instance
+ * is re-used for the new one).
+ *
+ *----------------------------------------------------------------------
+ */
+
+ClientData
+TkImgPhotoGet(
+ Tk_Window tkwin, /* Window in which the instance will be
+ * used. */
+ ClientData masterData) /* Pointer to our master structure for the
+ * image. */
+{
+ PhotoMaster *masterPtr = masterData;
+ PhotoInstance *instancePtr;
+ Colormap colormap;
+ int mono, nRed, nGreen, nBlue, numVisuals;
+ XVisualInfo visualInfo, *visInfoPtr;
+ char buf[TCL_INTEGER_SPACE * 3];
+ XColor *white, *black;
+ XGCValues gcValues;
+
+ /*
+ * Table of "best" choices for palette for PseudoColor displays with
+ * between 3 and 15 bits/pixel.
+ */
+
+ static const int paletteChoice[13][3] = {
+ /* #red, #green, #blue */
+ {2, 2, 2, /* 3 bits, 8 colors */},
+ {2, 3, 2, /* 4 bits, 12 colors */},
+ {3, 4, 2, /* 5 bits, 24 colors */},
+ {4, 5, 3, /* 6 bits, 60 colors */},
+ {5, 6, 4, /* 7 bits, 120 colors */},
+ {7, 7, 4, /* 8 bits, 198 colors */},
+ {8, 10, 6, /* 9 bits, 480 colors */},
+ {10, 12, 8, /* 10 bits, 960 colors */},
+ {14, 15, 9, /* 11 bits, 1890 colors */},
+ {16, 20, 12, /* 12 bits, 3840 colors */},
+ {20, 24, 16, /* 13 bits, 7680 colors */},
+ {26, 30, 20, /* 14 bits, 15600 colors */},
+ {32, 32, 30, /* 15 bits, 30720 colors */}
+ };
+
+ /*
+ * See if there is already an instance for windows using the same
+ * colormap. If so then just re-use it.
+ */
+
+ colormap = Tk_Colormap(tkwin);
+ for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
+ instancePtr = instancePtr->nextPtr) {
+ if ((colormap == instancePtr->colormap)
+ && (Tk_Display(tkwin) == instancePtr->display)) {
+ /*
+ * Re-use this instance.
+ */
+
+ if (instancePtr->refCount == 0) {
+ /*
+ * We are resurrecting this instance.
+ */
+
+ Tcl_CancelIdleCall(TkImgDisposeInstance, instancePtr);
+ if (instancePtr->colorTablePtr != NULL) {
+ FreeColorTable(instancePtr->colorTablePtr, 0);
+ }
+ GetColorTable(instancePtr);
+ }
+ instancePtr->refCount++;
+ return instancePtr;
+ }
+ }
+
+ /*
+ * The image isn't already in use in a window with the same colormap. Make
+ * a new instance of the image.
+ */
+
+ instancePtr = ckalloc(sizeof(PhotoInstance));
+ instancePtr->masterPtr = masterPtr;
+ instancePtr->display = Tk_Display(tkwin);
+ instancePtr->colormap = Tk_Colormap(tkwin);
+ Tk_PreserveColormap(instancePtr->display, instancePtr->colormap);
+ instancePtr->refCount = 1;
+ instancePtr->colorTablePtr = NULL;
+ instancePtr->pixels = None;
+ instancePtr->error = NULL;
+ instancePtr->width = 0;
+ instancePtr->height = 0;
+ instancePtr->imagePtr = 0;
+ instancePtr->nextPtr = masterPtr->instancePtr;
+ masterPtr->instancePtr = instancePtr;
+
+ /*
+ * Obtain information about the visual and decide on the default palette.
+ */
+
+ visualInfo.screen = Tk_ScreenNumber(tkwin);
+ visualInfo.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
+ visInfoPtr = XGetVisualInfo(Tk_Display(tkwin),
+ VisualScreenMask | VisualIDMask, &visualInfo, &numVisuals);
+ if (visInfoPtr == NULL) {
+ Tcl_Panic("TkImgPhotoGet couldn't find visual for window");
+ }
+
+ nRed = 2;
+ nGreen = nBlue = 0;
+ mono = 1;
+ instancePtr->visualInfo = *visInfoPtr;
+ switch (visInfoPtr->class) {
+ case DirectColor:
+ case TrueColor:
+ nRed = 1 << CountBits(visInfoPtr->red_mask);
+ nGreen = 1 << CountBits(visInfoPtr->green_mask);
+ nBlue = 1 << CountBits(visInfoPtr->blue_mask);
+ mono = 0;
+ break;
+ case PseudoColor:
+ case StaticColor:
+ if (visInfoPtr->depth > 15) {
+ nRed = 32;
+ nGreen = 32;
+ nBlue = 32;
+ mono = 0;
+ } else if (visInfoPtr->depth >= 3) {
+ const int *ip = paletteChoice[visInfoPtr->depth - 3];
+
+ nRed = ip[0];
+ nGreen = ip[1];
+ nBlue = ip[2];
+ mono = 0;
+ }
+ break;
+ case GrayScale:
+ case StaticGray:
+ nRed = 1 << visInfoPtr->depth;
+ break;
+ }
+ XFree((char *) visInfoPtr);
+
+ if (mono) {
+ sprintf(buf, "%d", nRed);
+ } else {
+ sprintf(buf, "%d/%d/%d", nRed, nGreen, nBlue);
+ }
+ instancePtr->defaultPalette = Tk_GetUid(buf);
+
+ /*
+ * Make a GC with background = black and foreground = white.
+ */
+
+ white = Tk_GetColor(masterPtr->interp, tkwin, "white");
+ black = Tk_GetColor(masterPtr->interp, tkwin, "black");
+ gcValues.foreground = (white != NULL)? white->pixel:
+ WhitePixelOfScreen(Tk_Screen(tkwin));
+ gcValues.background = (black != NULL)? black->pixel:
+ BlackPixelOfScreen(Tk_Screen(tkwin));
+ Tk_FreeColor(white);
+ Tk_FreeColor(black);
+ 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.
+ */
+
+ TkImgPhotoConfigureInstance(instancePtr);
+
+ /*
+ * If this is the first instance, must set the size of the image.
+ */
+
+ if (instancePtr->nextPtr == NULL) {
+ Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0,
+ masterPtr->width, masterPtr->height);
+ }
+
+ return instancePtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BlendComplexAlpha --
+ *
+ * This function is called when an image with partially transparent
+ * pixels must be drawn over another image. It blends the photo data onto
+ * a local copy of the surface that we are drawing on, *including* the
+ * pixels drawn by everything that should be drawn underneath the image.
+ *
+ * Much of this code has hard-coded values in for speed because this
+ * routine is performance critical for complex image drawing.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Background image passed in gets drawn over with image data.
+ *
+ * Notes:
+ * This should work on all platforms that set mask and shift data
+ * properly from the visualInfo. RGB is really only a 24+ bpp version
+ * whereas RGB15 is the correct version and works for 15bpp+, but it
+ * slower, so it's only used for 15bpp+.
+ *
+ * Note that Win32 pre-defines those operations that we really need.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifndef __WIN32__
+#define GetRValue(rgb) (UCHAR(((rgb) & red_mask) >> red_shift))
+#define GetGValue(rgb) (UCHAR(((rgb) & green_mask) >> green_shift))
+#define GetBValue(rgb) (UCHAR(((rgb) & blue_mask) >> blue_shift))
+#define RGB(r, g, b) ((unsigned)( \
+ (UCHAR(r) << red_shift) | \
+ (UCHAR(g) << green_shift) | \
+ (UCHAR(b) << blue_shift) ))
+#define RGB15(r, g, b) ((unsigned)( \
+ (((r) * red_mask / 255) & red_mask) | \
+ (((g) * green_mask / 255) & green_mask) | \
+ (((b) * blue_mask / 255) & blue_mask) ))
+#endif /* !__WIN32__ */
+
+static void
+BlendComplexAlpha(
+ XImage *bgImg, /* Background image to draw on. */
+ PhotoInstance *iPtr, /* Image instance to draw. */
+ int xOffset, int yOffset, /* X & Y offset into image instance to
+ * draw. */
+ int width, int height) /* Width & height of image to draw. */
+{
+ int x, y, line;
+ unsigned long pixel;
+ unsigned char r, g, b, alpha, unalpha, *masterPtr;
+ unsigned char *alphaAr = iPtr->masterPtr->pix32;
+
+ /*
+ * This blending is an integer version of the Source-Over compositing rule
+ * (see Porter&Duff, "Compositing Digital Images", proceedings of SIGGRAPH
+ * 1984) that has been hard-coded (for speed) to work with targetting a
+ * solid surface.
+ *
+ * The 'unalpha' field must be 255-alpha; it is separated out to encourage
+ * more efficient compilation.
+ */
+
+#define ALPHA_BLEND(bgPix, imgPix, alpha, unalpha) \
+ ((bgPix * unalpha + imgPix * alpha) / 255)
+
+ /*
+ * We have to get the mask and shift info from the visual on non-Win32 so
+ * that the macros Get*Value(), RGB() and RGB15() work correctly. This
+ * might be cached for better performance.
+ */
+
+#ifndef __WIN32__
+ unsigned long red_mask, green_mask, blue_mask;
+ unsigned long red_shift, green_shift, blue_shift;
+ Visual *visual = iPtr->visualInfo.visual;
+
+ red_mask = visual->red_mask;
+ green_mask = visual->green_mask;
+ blue_mask = visual->blue_mask;
+ red_shift = 0;
+ green_shift = 0;
+ blue_shift = 0;
+ while ((0x0001 & (red_mask >> red_shift)) == 0) {
+ red_shift++;
+ }
+ while ((0x0001 & (green_mask >> green_shift)) == 0) {
+ green_shift++;
+ }
+ while ((0x0001 & (blue_mask >> blue_shift)) == 0) {
+ blue_shift++;
+ }
+#endif /* !__WIN32__ */
+
+ /*
+ * Only UNIX requires the special case for <24bpp. It varies with 3 extra
+ * shifts and uses RGB15. The 24+bpp version could also then be further
+ * optimized.
+ */
+
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
+ if (bgImg->depth < 24) {
+ unsigned char red_mlen, green_mlen, blue_mlen;
+
+ red_mlen = 8 - CountBits(red_mask >> red_shift);
+ green_mlen = 8 - CountBits(green_mask >> green_shift);
+ blue_mlen = 8 - CountBits(blue_mask >> blue_shift);
+ for (y = 0; y < height; y++) {
+ line = (y + yOffset) * iPtr->masterPtr->width;
+ for (x = 0; x < width; x++) {
+ masterPtr = alphaAr + ((line + x + xOffset) * 4);
+ alpha = masterPtr[3];
+
+ /*
+ * Ignore pixels that are fully transparent
+ */
+
+ if (alpha) {
+ /*
+ * We could perhaps be more efficient than XGetPixel for
+ * 24 and 32 bit displays, but this seems "fast enough".
+ */
+
+ r = masterPtr[0];
+ g = masterPtr[1];
+ b = masterPtr[2];
+ if (alpha != 255) {
+ /*
+ * Only blend pixels that have some transparency
+ */
+
+ unsigned char ra, ga, ba;
+
+ pixel = XGetPixel(bgImg, x, y);
+ ra = GetRValue(pixel) << red_mlen;
+ ga = GetGValue(pixel) << green_mlen;
+ ba = GetBValue(pixel) << blue_mlen;
+ unalpha = 255 - alpha; /* Calculate once. */
+ r = ALPHA_BLEND(ra, r, alpha, unalpha);
+ g = ALPHA_BLEND(ga, g, alpha, unalpha);
+ b = ALPHA_BLEND(ba, b, alpha, unalpha);
+ }
+ XPutPixel(bgImg, x, y, RGB15(r, g, b));
+ }
+ }
+ }
+ return;
+ }
+#endif /* !__WIN32__ && !MAC_OSX_TK */
+
+ for (y = 0; y < height; y++) {
+ line = (y + yOffset) * iPtr->masterPtr->width;
+ for (x = 0; x < width; x++) {
+ masterPtr = alphaAr + ((line + x + xOffset) * 4);
+ alpha = masterPtr[3];
+
+ /*
+ * Ignore pixels that are fully transparent
+ */
+
+ if (alpha) {
+ /*
+ * We could perhaps be more efficient than XGetPixel for 24
+ * and 32 bit displays, but this seems "fast enough".
+ */
+
+ r = masterPtr[0];
+ g = masterPtr[1];
+ b = masterPtr[2];
+ if (alpha != 255) {
+ /*
+ * Only blend pixels that have some transparency
+ */
+
+ unsigned char ra, ga, ba;
+
+ pixel = XGetPixel(bgImg, x, y);
+ ra = GetRValue(pixel);
+ ga = GetGValue(pixel);
+ ba = GetBValue(pixel);
+ unalpha = 255 - alpha; /* Calculate once. */
+ r = ALPHA_BLEND(ra, r, alpha, unalpha);
+ g = ALPHA_BLEND(ga, g, alpha, unalpha);
+ b = ALPHA_BLEND(ba, b, alpha, unalpha);
+ }
+ XPutPixel(bgImg, x, y, RGB(r, g, b));
+ }
+ }
+ }
+#undef ALPHA_BLEND
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgPhotoDisplay --
+ *
+ * This function is invoked to draw a photo image.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A portion of the image gets rendered in a pixmap or window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgPhotoDisplay(
+ ClientData clientData, /* Pointer to PhotoInstance structure for
+ * instance to be displayed. */
+ Display *display, /* Display on which to draw image. */
+ Drawable drawable, /* Pixmap or window in which to draw image. */
+ int imageX, int imageY, /* Upper-left corner of region within image to
+ * draw. */
+ int width, int height, /* Dimensions of region within image to
+ * draw. */
+ int drawableX,int drawableY)/* Coordinates within drawable that correspond
+ * to imageX and imageY. */
+{
+ PhotoInstance *instancePtr = clientData;
+ XVisualInfo visInfo = instancePtr->visualInfo;
+
+ /*
+ * If there's no pixmap, it means that an error occurred while creating
+ * the image instance so it can't be displayed.
+ */
+
+ if (instancePtr->pixels == None) {
+ return;
+ }
+
+ if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA)
+ && visInfo.depth >= 15
+ && (visInfo.class == DirectColor || visInfo.class == TrueColor)) {
+ Tk_ErrorHandler handler;
+ XImage *bgImg = NULL;
+
+ /*
+ * Create an error handler to suppress the case where the input was
+ * not properly constrained, which can cause an X error. [Bug 979239]
+ */
+
+ handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL);
+
+ /*
+ * Pull the current background from the display to blend with
+ */
+
+ bgImg = XGetImage(display, drawable, drawableX, drawableY,
+ (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap);
+ if (bgImg == NULL) {
+ Tk_DeleteErrorHandler(handler);
+ return;
+ }
+
+ BlendComplexAlpha(bgImg, instancePtr, imageX, imageY, width, height);
+
+ /*
+ * Color info is unimportant as we only do this operation for depth >=
+ * 15.
+ */
+
+ TkPutImage(NULL, 0, display, drawable, instancePtr->gc,
+ bgImg, 0, 0, drawableX, drawableY,
+ (unsigned int) width, (unsigned int) height);
+ XDestroyImage(bgImg);
+ Tk_DeleteErrorHandler(handler);
+ } else {
+ /*
+ * masterPtr->region describes which parts of the image contain valid
+ * data. We set this region as the clip mask for the gc, setting its
+ * origin appropriately, and use it when drawing the image.
+ */
+
+ TkSetRegion(display, instancePtr->gc,
+ instancePtr->masterPtr->validRegion);
+ XSetClipOrigin(display, instancePtr->gc, drawableX - imageX,
+ drawableY - imageY);
+ XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc,
+ imageX, imageY, (unsigned) width, (unsigned) height,
+ drawableX, drawableY);
+ XSetClipMask(display, instancePtr->gc, None);
+ XSetClipOrigin(display, instancePtr->gc, 0, 0);
+ }
+ XFlush(display);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgPhotoFree --
+ *
+ * This function is called when a widget ceases to use a particular
+ * instance of an image. We don't actually get rid of the instance until
+ * later because we may be about to get this instance again.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Internal data structures get cleaned up, later.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgPhotoFree(
+ ClientData clientData, /* Pointer to PhotoInstance structure for
+ * instance to be displayed. */
+ Display *display) /* Display containing window that used
+ * image. */
+{
+ PhotoInstance *instancePtr = clientData;
+ ColorTable *colorPtr;
+
+ instancePtr->refCount -= 1;
+ if (instancePtr->refCount > 0) {
+ return;
+ }
+
+ /*
+ * There are no more uses of the image within this widget. Decrement the
+ * count of live uses of its color table, so that its colors can be
+ * reclaimed if necessary, and set up an idle call to free the instance
+ * structure.
+ */
+
+ colorPtr = instancePtr->colorTablePtr;
+ if (colorPtr != NULL) {
+ colorPtr->liveRefCount -= 1;
+ }
+
+ Tcl_DoWhenIdle(TkImgDisposeInstance, instancePtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgPhotoInstanceSetSize --
+ *
+ * This function reallocates the instance pixmap and dithering error
+ * array for a photo instance, as necessary, to change the image's size
+ * to `width' x `height' pixels.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Storage gets reallocated, here and in the X server.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgPhotoInstanceSetSize(
+ PhotoInstance *instancePtr) /* Instance whose size is to be changed. */
+{
+ PhotoMaster *masterPtr;
+ schar *newError, *errSrcPtr, *errDestPtr;
+ int h, offset;
+ XRectangle validBox;
+ Pixmap newPixmap;
+
+ masterPtr = instancePtr->masterPtr;
+ TkClipBox(masterPtr->validRegion, &validBox);
+
+ if ((instancePtr->width != masterPtr->width)
+ || (instancePtr->height != masterPtr->height)
+ || (instancePtr->pixels == None)) {
+ newPixmap = Tk_GetPixmap(instancePtr->display,
+ RootWindow(instancePtr->display,
+ instancePtr->visualInfo.screen),
+ (masterPtr->width > 0) ? masterPtr->width: 1,
+ (masterPtr->height > 0) ? masterPtr->height: 1,
+ instancePtr->visualInfo.depth);
+ if (!newPixmap) {
+ Tcl_Panic("Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize");
+ }
+
+ /*
+ * The following is a gross hack needed to properly support colormaps
+ * under Windows. Before the pixels can be copied to the pixmap, the
+ * relevent colormap must be associated with the drawable. Normally we
+ * can infer this association from the window that was used to create
+ * the pixmap. However, in this case we're using the root window, so
+ * we have to be more explicit.
+ */
+
+ TkSetPixmapColormap(newPixmap, instancePtr->colormap);
+
+ if (instancePtr->pixels != None) {
+ /*
+ * Copy any common pixels from the old pixmap and free it.
+ */
+
+ XCopyArea(instancePtr->display, instancePtr->pixels, newPixmap,
+ instancePtr->gc, validBox.x, validBox.y,
+ validBox.width, validBox.height, validBox.x, validBox.y);
+ Tk_FreePixmap(instancePtr->display, instancePtr->pixels);
+ }
+ instancePtr->pixels = newPixmap;
+ }
+
+ if ((instancePtr->width != masterPtr->width)
+ || (instancePtr->height != masterPtr->height)
+ || (instancePtr->error == NULL)) {
+ if (masterPtr->height > 0 && masterPtr->width > 0) {
+ /*
+ * TODO: use attemptckalloc() here once there is a strategy that
+ * will allow us to recover from failure. Right now, there's no
+ * such possibility.
+ */
+
+ newError = ckalloc(masterPtr->height * masterPtr->width
+ * 3 * sizeof(schar));
+
+ /*
+ * Zero the new array so that we don't get bogus error values
+ * propagating into areas we dither later.
+ */
+
+ if ((instancePtr->error != NULL)
+ && ((instancePtr->width == masterPtr->width)
+ || (validBox.width == masterPtr->width))) {
+ if (validBox.y > 0) {
+ memset(newError, 0, (size_t)
+ validBox.y * masterPtr->width * 3 * sizeof(schar));
+ }
+ h = validBox.y + validBox.height;
+ if (h < masterPtr->height) {
+ memset(newError + h*masterPtr->width*3, 0,
+ (size_t) (masterPtr->height - h)
+ * masterPtr->width * 3 * sizeof(schar));
+ }
+ } else {
+ memset(newError, 0, (size_t)
+ masterPtr->height * masterPtr->width *3*sizeof(schar));
+ }
+ } else {
+ newError = NULL;
+ }
+
+ if (instancePtr->error != NULL) {
+ /*
+ * Copy the common area over to the new array and free the old
+ * array.
+ */
+
+ if (masterPtr->width == instancePtr->width) {
+ offset = validBox.y * masterPtr->width * 3;
+ memcpy(newError + offset, instancePtr->error + offset,
+ (size_t) (validBox.height
+ * masterPtr->width * 3 * sizeof(schar)));
+
+ } else if (validBox.width > 0 && validBox.height > 0) {
+ errDestPtr = newError +
+ (validBox.y * masterPtr->width + validBox.x) * 3;
+ errSrcPtr = instancePtr->error +
+ (validBox.y * instancePtr->width + validBox.x) * 3;
+
+ for (h = validBox.height; h > 0; --h) {
+ memcpy(errDestPtr, errSrcPtr,
+ validBox.width * 3 * sizeof(schar));
+ errDestPtr += masterPtr->width * 3;
+ errSrcPtr += instancePtr->width * 3;
+ }
+ }
+ ckfree(instancePtr->error);
+ }
+
+ instancePtr->error = newError;
+ }
+
+ instancePtr->width = masterPtr->width;
+ instancePtr->height = masterPtr->height;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * IsValidPalette --
+ *
+ * This function is called to check whether a value given for the
+ * -palette option is valid for a particular instance of a photo image.
+ *
+ * Results:
+ * A boolean value: 1 if the palette is acceptable, 0 otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+IsValidPalette(
+ PhotoInstance *instancePtr, /* Instance to which the palette specification
+ * is to be applied. */
+ const char *palette) /* Palette specification string. */
+{
+ int nRed, nGreen, nBlue, mono, numColors;
+ char *endp;
+
+ /*
+ * First parse the specification: it must be of the form %d or %d/%d/%d.
+ */
+
+ nRed = strtol(palette, &endp, 10);
+ if ((endp == palette) || ((*endp != 0) && (*endp != '/'))
+ || (nRed < 2) || (nRed > 256)) {
+ return 0;
+ }
+
+ if (*endp == 0) {
+ mono = 1;
+ nGreen = nBlue = nRed;
+ } else {
+ palette = endp + 1;
+ nGreen = strtol(palette, &endp, 10);
+ if ((endp == palette) || (*endp != '/') || (nGreen < 2)
+ || (nGreen > 256)) {
+ return 0;
+ }
+ palette = endp + 1;
+ nBlue = strtol(palette, &endp, 10);
+ if ((endp == palette) || (*endp != 0) || (nBlue < 2)
+ || (nBlue > 256)) {
+ return 0;
+ }
+ mono = 0;
+ }
+
+ switch (instancePtr->visualInfo.class) {
+ case DirectColor:
+ case TrueColor:
+ if ((nRed > (1 << CountBits(instancePtr->visualInfo.red_mask)))
+ || (nGreen>(1<<CountBits(instancePtr->visualInfo.green_mask)))
+ || (nBlue>(1<<CountBits(instancePtr->visualInfo.blue_mask)))) {
+ return 0;
+ }
+ break;
+ case PseudoColor:
+ case StaticColor:
+ numColors = nRed;
+ if (!mono) {
+ numColors *= nGreen * nBlue;
+ }
+ if (numColors > (1 << instancePtr->visualInfo.depth)) {
+ return 0;
+ }
+ break;
+ case GrayScale:
+ case StaticGray:
+ if (!mono || (nRed > (1 << instancePtr->visualInfo.depth))) {
+ return 0;
+ }
+ break;
+ }
+
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CountBits --
+ *
+ * This function counts how many bits are set to 1 in `mask'.
+ *
+ * Results:
+ * The integer number of bits.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+CountBits(
+ pixel mask) /* Value to count the 1 bits in. */
+{
+ int n;
+
+ for (n=0 ; mask!=0 ; mask&=mask-1) {
+ n++;
+ }
+ return n;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetColorTable --
+ *
+ * This function is called to allocate a table of colormap information
+ * for an instance of a photo image. Only one such table is allocated for
+ * all photo instances using the same display, colormap, palette and
+ * gamma values, so that the application need only request a set of
+ * colors from the X server once for all such photo widgets. This
+ * function maintains a hash table to find previously-allocated
+ * ColorTables.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A new ColorTable may be allocated and placed in the hash table, and
+ * have colors allocated for it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetColorTable(
+ PhotoInstance *instancePtr) /* Instance needing a color table. */
+{
+ ColorTable *colorPtr;
+ Tcl_HashEntry *entry;
+ ColorTableId id;
+ int isNew;
+
+ /*
+ * Look for an existing ColorTable in the hash table.
+ */
+
+ memset(&id, 0, sizeof(id));
+ id.display = instancePtr->display;
+ id.colormap = instancePtr->colormap;
+ id.palette = instancePtr->palette;
+ id.gamma = instancePtr->gamma;
+ if (!imgPhotoColorHashInitialized) {
+ Tcl_InitHashTable(&imgPhotoColorHash, N_COLOR_HASH);
+ imgPhotoColorHashInitialized = 1;
+ }
+ entry = Tcl_CreateHashEntry(&imgPhotoColorHash, (char *) &id, &isNew);
+
+ if (!isNew) {
+ /*
+ * Re-use the existing entry.
+ */
+
+ colorPtr = Tcl_GetHashValue(entry);
+ } else {
+ /*
+ * No color table currently available; need to make one.
+ */
+
+ colorPtr = ckalloc(sizeof(ColorTable));
+
+ /*
+ * The following line of code should not normally be needed due to the
+ * assignment in the following line. However, it compensates for bugs
+ * in some compilers (HP, for example) where sizeof(ColorTable) is 24
+ * but the assignment only copies 20 bytes, leaving 4 bytes
+ * uninitialized; these cause problems when using the id for lookups
+ * in imgPhotoColorHash, and can result in core dumps.
+ */
+
+ memset(&colorPtr->id, 0, sizeof(ColorTableId));
+ colorPtr->id = id;
+ Tk_PreserveColormap(colorPtr->id.display, colorPtr->id.colormap);
+ colorPtr->flags = 0;
+ colorPtr->refCount = 0;
+ colorPtr->liveRefCount = 0;
+ colorPtr->numColors = 0;
+ colorPtr->visualInfo = instancePtr->visualInfo;
+ colorPtr->pixelMap = NULL;
+ Tcl_SetHashValue(entry, colorPtr);
+ }
+
+ colorPtr->refCount++;
+ colorPtr->liveRefCount++;
+ instancePtr->colorTablePtr = colorPtr;
+ if (colorPtr->flags & DISPOSE_PENDING) {
+ Tcl_CancelIdleCall(DisposeColorTable, colorPtr);
+ colorPtr->flags &= ~DISPOSE_PENDING;
+ }
+
+ /*
+ * Allocate colors for this color table if necessary.
+ */
+
+ if ((colorPtr->numColors == 0)
+ && ((colorPtr->flags & BLACK_AND_WHITE) == 0)) {
+ AllocateColors(colorPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FreeColorTable --
+ *
+ * This function is called when an instance ceases using a color table.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If no other instances are using this color table, a when-idle handler
+ * is registered to free up the color table and the colors allocated for
+ * it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FreeColorTable(
+ ColorTable *colorPtr, /* Pointer to the color table which is no
+ * longer required by an instance. */
+ int force) /* Force free to happen immediately. */
+{
+ colorPtr->refCount--;
+ if (colorPtr->refCount > 0) {
+ return;
+ }
+
+ if (force) {
+ if ((colorPtr->flags & DISPOSE_PENDING) != 0) {
+ Tcl_CancelIdleCall(DisposeColorTable, colorPtr);
+ colorPtr->flags &= ~DISPOSE_PENDING;
+ }
+ DisposeColorTable(colorPtr);
+ } else if ((colorPtr->flags & DISPOSE_PENDING) == 0) {
+ Tcl_DoWhenIdle(DisposeColorTable, colorPtr);
+ colorPtr->flags |= DISPOSE_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AllocateColors --
+ *
+ * This function allocates the colors required by a color table, and sets
+ * up the fields in the color table data structure which are used in
+ * dithering.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Colors are allocated from the X server. Fields in the color table data
+ * structure are updated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+AllocateColors(
+ ColorTable *colorPtr) /* Pointer to the color table requiring colors
+ * to be allocated. */
+{
+ int i, r, g, b, rMult, mono;
+ int numColors, nRed, nGreen, nBlue;
+ double fr, fg, fb, igam;
+ XColor *colors;
+ unsigned long *pixels;
+
+ /*
+ * 16-bit intensity value for i/n of full intensity.
+ */
+#define CFRAC(i, n) ((i) * 65535 / (n))
+
+ /* As for CFRAC, but apply exponent of g. */
+#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
+
+ /*
+ * First parse the palette specification to get the required number of
+ * shades of each primary.
+ */
+
+ mono = sscanf(colorPtr->id.palette, "%d/%d/%d", &nRed, &nGreen, &nBlue)
+ <= 1;
+ igam = 1.0 / colorPtr->id.gamma;
+
+ /*
+ * Each time around this loop, we reduce the number of colors we're trying
+ * to allocate until we succeed in allocating all of the colors we need.
+ */
+
+ for (;;) {
+ /*
+ * If we are using 1 bit/pixel, we don't need to allocate any colors
+ * (we just use the foreground and background colors in the GC).
+ */
+
+ if (mono && (nRed <= 2)) {
+ colorPtr->flags |= BLACK_AND_WHITE;
+ return;
+ }
+
+ /*
+ * Calculate the RGB coordinates of the colors we want to allocate and
+ * store them in *colors.
+ */
+
+ if ((colorPtr->visualInfo.class == DirectColor)
+ || (colorPtr->visualInfo.class == TrueColor)) {
+
+ /*
+ * Direct/True Color: allocate shades of red, green, blue
+ * independently.
+ */
+
+ if (mono) {
+ numColors = nGreen = nBlue = nRed;
+ } else {
+ numColors = MAX(MAX(nRed, nGreen), nBlue);
+ }
+ colors = ckalloc(numColors * sizeof(XColor));
+
+ for (i = 0; i < numColors; ++i) {
+ if (igam == 1.0) {
+ colors[i].red = CFRAC(i, nRed - 1);
+ colors[i].green = CFRAC(i, nGreen - 1);
+ colors[i].blue = CFRAC(i, nBlue - 1);
+ } else {
+ colors[i].red = CGFRAC(i, nRed - 1, igam);
+ colors[i].green = CGFRAC(i, nGreen - 1, igam);
+ colors[i].blue = CGFRAC(i, nBlue - 1, igam);
+ }
+ }
+ } else {
+ /*
+ * PseudoColor, StaticColor, GrayScale or StaticGray visual: we
+ * have to allocate each color in the color cube separately.
+ */
+
+ numColors = (mono) ? nRed: (nRed * nGreen * nBlue);
+ colors = ckalloc(numColors * sizeof(XColor));
+
+ if (!mono) {
+ /*
+ * Color display using a PseudoColor or StaticColor visual.
+ */
+
+ i = 0;
+ for (r = 0; r < nRed; ++r) {
+ for (g = 0; g < nGreen; ++g) {
+ for (b = 0; b < nBlue; ++b) {
+ if (igam == 1.0) {
+ colors[i].red = CFRAC(r, nRed - 1);
+ colors[i].green = CFRAC(g, nGreen - 1);
+ colors[i].blue = CFRAC(b, nBlue - 1);
+ } else {
+ colors[i].red = CGFRAC(r, nRed - 1, igam);
+ colors[i].green = CGFRAC(g, nGreen - 1, igam);
+ colors[i].blue = CGFRAC(b, nBlue - 1, igam);
+ }
+ i++;
+ }
+ }
+ }
+ } else {
+ /*
+ * Monochrome display - allocate the shades of grey we want.
+ */
+
+ for (i = 0; i < numColors; ++i) {
+ if (igam == 1.0) {
+ r = CFRAC(i, numColors - 1);
+ } else {
+ r = CGFRAC(i, numColors - 1, igam);
+ }
+ colors[i].red = colors[i].green = colors[i].blue = r;
+ }
+ }
+ }
+
+ /*
+ * Now try to allocate the colors we've calculated.
+ */
+
+ pixels = ckalloc(numColors * sizeof(unsigned long));
+ for (i = 0; i < numColors; ++i) {
+ if (!XAllocColor(colorPtr->id.display, colorPtr->id.colormap,
+ &colors[i])) {
+ /*
+ * Can't get all the colors we want in the default colormap;
+ * first try freeing colors from other unused color tables.
+ */
+
+ if (!ReclaimColors(&colorPtr->id, numColors - i)
+ || !XAllocColor(colorPtr->id.display,
+ colorPtr->id.colormap, &colors[i])) {
+ /*
+ * Still can't allocate the color.
+ */
+
+ break;
+ }
+ }
+ pixels[i] = colors[i].pixel;
+ }
+
+ /*
+ * If we didn't get all of the colors, reduce the resolution of the
+ * color cube, free the ones we got, and try again.
+ */
+
+ if (i >= numColors) {
+ break;
+ }
+ XFreeColors(colorPtr->id.display, colorPtr->id.colormap, pixels, i, 0);
+ ckfree(colors);
+ ckfree(pixels);
+
+ if (!mono) {
+ if ((nRed == 2) && (nGreen == 2) && (nBlue == 2)) {
+ /*
+ * Fall back to 1-bit monochrome display.
+ */
+
+ mono = 1;
+ } else {
+ /*
+ * Reduce the number of shades of each primary to about 3/4 of
+ * the previous value. This should reduce the total number of
+ * colors required to about half the previous value for
+ * PseudoColor displays.
+ */
+
+ nRed = (nRed * 3 + 2) / 4;
+ nGreen = (nGreen * 3 + 2) / 4;
+ nBlue = (nBlue * 3 + 2) / 4;
+ }
+ } else {
+ /*
+ * Reduce the number of shades of gray to about 1/2.
+ */
+
+ nRed = nRed / 2;
+ }
+ }
+
+ /*
+ * We have allocated all of the necessary colors: fill in various fields
+ * of the ColorTable record.
+ */
+
+ if (!mono) {
+ colorPtr->flags |= COLOR_WINDOW;
+
+ /*
+ * The following is a hairy hack. We only want to index into the
+ * pixelMap on colormap displays. However, if the display is on
+ * Windows, then we actually want to store the index not the value
+ * since we will be passing the color table into the TkPutImage call.
+ */
+
+#ifndef __WIN32__
+ if ((colorPtr->visualInfo.class != DirectColor)
+ && (colorPtr->visualInfo.class != TrueColor)) {
+ colorPtr->flags |= MAP_COLORS;
+ }
+#endif /* __WIN32__ */
+ }
+
+ colorPtr->numColors = numColors;
+ colorPtr->pixelMap = pixels;
+
+ /*
+ * Set up quantization tables for dithering.
+ */
+
+ rMult = nGreen * nBlue;
+ for (i = 0; i < 256; ++i) {
+ r = (i * (nRed - 1) + 127) / 255;
+ if (mono) {
+ fr = (double) colors[r].red / 65535.0;
+ if (colorPtr->id.gamma != 1.0 ) {
+ fr = pow(fr, colorPtr->id.gamma);
+ }
+ colorPtr->colorQuant[0][i] = (int)(fr * 255.99);
+ colorPtr->redValues[i] = colors[r].pixel;
+ } else {
+ g = (i * (nGreen - 1) + 127) / 255;
+ b = (i * (nBlue - 1) + 127) / 255;
+ if ((colorPtr->visualInfo.class == DirectColor)
+ || (colorPtr->visualInfo.class == TrueColor)) {
+ colorPtr->redValues[i] =
+ colors[r].pixel & colorPtr->visualInfo.red_mask;
+ colorPtr->greenValues[i] =
+ colors[g].pixel & colorPtr->visualInfo.green_mask;
+ colorPtr->blueValues[i] =
+ colors[b].pixel & colorPtr->visualInfo.blue_mask;
+ } else {
+ r *= rMult;
+ g *= nBlue;
+ colorPtr->redValues[i] = r;
+ colorPtr->greenValues[i] = g;
+ colorPtr->blueValues[i] = b;
+ }
+ fr = (double) colors[r].red / 65535.0;
+ fg = (double) colors[g].green / 65535.0;
+ fb = (double) colors[b].blue / 65535.0;
+ if (colorPtr->id.gamma != 1.0) {
+ fr = pow(fr, colorPtr->id.gamma);
+ fg = pow(fg, colorPtr->id.gamma);
+ fb = pow(fb, colorPtr->id.gamma);
+ }
+ colorPtr->colorQuant[0][i] = (int)(fr * 255.99);
+ colorPtr->colorQuant[1][i] = (int)(fg * 255.99);
+ colorPtr->colorQuant[2][i] = (int)(fb * 255.99);
+ }
+ }
+
+ ckfree(colors);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DisposeColorTable --
+ *
+ * Release a color table and its associated resources.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The colors in the argument color table are freed, as is the color
+ * table structure itself. The color table is removed from the hash table
+ * which is used to locate color tables.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DisposeColorTable(
+ ClientData clientData) /* Pointer to the ColorTable whose
+ * colors are to be released. */
+{
+ ColorTable *colorPtr = clientData;
+ Tcl_HashEntry *entry;
+
+ if (colorPtr->pixelMap != NULL) {
+ if (colorPtr->numColors > 0) {
+ XFreeColors(colorPtr->id.display, colorPtr->id.colormap,
+ colorPtr->pixelMap, colorPtr->numColors, 0);
+ Tk_FreeColormap(colorPtr->id.display, colorPtr->id.colormap);
+ }
+ ckfree(colorPtr->pixelMap);
+ }
+
+ entry = Tcl_FindHashEntry(&imgPhotoColorHash, (char *) &colorPtr->id);
+ if (entry == NULL) {
+ Tcl_Panic("DisposeColorTable couldn't find hash entry");
+ }
+ Tcl_DeleteHashEntry(entry);
+
+ ckfree(colorPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReclaimColors --
+ *
+ * This function is called to try to free up colors in the colormap used
+ * by a color table. It looks for other color tables with the same
+ * colormap and with a zero live reference count, and frees their colors.
+ * It only does so if there is the possibility of freeing up at least
+ * `numColors' colors.
+ *
+ * Results:
+ * The return value is TRUE if any colors were freed, FALSE otherwise.
+ *
+ * Side effects:
+ * ColorTables which are not currently in use may lose their color
+ * allocations.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReclaimColors(
+ ColorTableId *id, /* Pointer to information identifying
+ * the color table which needs more colors. */
+ int numColors) /* Number of colors required. */
+{
+ Tcl_HashSearch srch;
+ Tcl_HashEntry *entry;
+ ColorTable *colorPtr;
+ int nAvail = 0;
+
+ /*
+ * First scan through the color hash table to get an upper bound on how
+ * many colors we might be able to free.
+ */
+
+ entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch);
+ while (entry != NULL) {
+ colorPtr = Tcl_GetHashValue(entry);
+ if ((colorPtr->id.display == id->display)
+ && (colorPtr->id.colormap == id->colormap)
+ && (colorPtr->liveRefCount == 0 )&& (colorPtr->numColors != 0)
+ && ((colorPtr->id.palette != id->palette)
+ || (colorPtr->id.gamma != id->gamma))) {
+ /*
+ * We could take this guy's colors off him.
+ */
+
+ nAvail += colorPtr->numColors;
+ }
+ entry = Tcl_NextHashEntry(&srch);
+ }
+
+ /*
+ * nAvail is an (over)estimate of the number of colors we could free.
+ */
+
+ if (nAvail < numColors) {
+ return 0;
+ }
+
+ /*
+ * Scan through a second time freeing colors.
+ */
+
+ entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch);
+ while ((entry != NULL) && (numColors > 0)) {
+ colorPtr = Tcl_GetHashValue(entry);
+ if ((colorPtr->id.display == id->display)
+ && (colorPtr->id.colormap == id->colormap)
+ && (colorPtr->liveRefCount == 0) && (colorPtr->numColors != 0)
+ && ((colorPtr->id.palette != id->palette)
+ || (colorPtr->id.gamma != id->gamma))) {
+ /*
+ * Free the colors that this ColorTable has.
+ */
+
+ XFreeColors(colorPtr->id.display, colorPtr->id.colormap,
+ colorPtr->pixelMap, colorPtr->numColors, 0);
+ numColors -= colorPtr->numColors;
+ colorPtr->numColors = 0;
+ ckfree(colorPtr->pixelMap);
+ colorPtr->pixelMap = NULL;
+ }
+
+ entry = Tcl_NextHashEntry(&srch);
+ }
+ return 1; /* We freed some colors. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgDisposeInstance --
+ *
+ * This function is called to finally free up an instance of a photo
+ * image which is no longer required.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The instance data structure and the resources it references are freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgDisposeInstance(
+ ClientData clientData) /* Pointer to the instance whose resources are
+ * to be released. */
+{
+ PhotoInstance *instancePtr = clientData;
+ PhotoInstance *prevPtr;
+
+ if (instancePtr->pixels != None) {
+ Tk_FreePixmap(instancePtr->display, instancePtr->pixels);
+ }
+ if (instancePtr->gc != None) {
+ Tk_FreeGC(instancePtr->display, instancePtr->gc);
+ }
+ if (instancePtr->imagePtr != NULL) {
+ XDestroyImage(instancePtr->imagePtr);
+ }
+ if (instancePtr->error != NULL) {
+ ckfree(instancePtr->error);
+ }
+ if (instancePtr->colorTablePtr != NULL) {
+ FreeColorTable(instancePtr->colorTablePtr, 1);
+ }
+
+ if (instancePtr->masterPtr->instancePtr == instancePtr) {
+ instancePtr->masterPtr->instancePtr = instancePtr->nextPtr;
+ } else {
+ for (prevPtr = instancePtr->masterPtr->instancePtr;
+ prevPtr->nextPtr != instancePtr; prevPtr = prevPtr->nextPtr) {
+ /* Empty loop body. */
+ }
+ prevPtr->nextPtr = instancePtr->nextPtr;
+ }
+ Tk_FreeColormap(instancePtr->display, instancePtr->colormap);
+ ckfree(instancePtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgDitherInstance --
+ *
+ * This function is called to update an area of an instance's pixmap by
+ * dithering the corresponding area of the master.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The instance's pixmap gets updated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgDitherInstance(
+ PhotoInstance *instancePtr, /* The instance to be updated. */
+ int xStart, int yStart, /* Coordinates of the top-left pixel in the
+ * block to be dithered. */
+ int width, int height) /* Dimensions of the block to be dithered. */
+{
+ PhotoMaster *masterPtr = instancePtr->masterPtr;
+ ColorTable *colorPtr = instancePtr->colorTablePtr;
+ XImage *imagePtr;
+ int nLines, bigEndian, i, c, x, y, xEnd, doDithering = 1;
+ int bitsPerPixel, bytesPerLine, lineLength;
+ unsigned char *srcLinePtr;
+ schar *errLinePtr;
+ pixel firstBit, word, mask;
+
+ /*
+ * Turn dithering off in certain cases where it is not needed (TrueColor,
+ * DirectColor with many colors).
+ */
+
+ if ((colorPtr->visualInfo.class == DirectColor)
+ || (colorPtr->visualInfo.class == TrueColor)) {
+ int nRed, nGreen, nBlue, result;
+
+ result = sscanf(colorPtr->id.palette, "%d/%d/%d", &nRed,
+ &nGreen, &nBlue);
+ if ((nRed >= 256)
+ && ((result == 1) || ((nGreen >= 256) && (nBlue >= 256)))) {
+ doDithering = 0;
+ }
+ }
+
+ /*
+ * First work out how many lines to do at a time, then how many bytes
+ * we'll need for pixel storage, and allocate it.
+ */
+
+ nLines = (MAX_PIXELS + width - 1) / width;
+ if (nLines < 1) {
+ nLines = 1;
+ }
+ if (nLines > height ) {
+ nLines = height;
+ }
+
+ imagePtr = instancePtr->imagePtr;
+ if (imagePtr == NULL) {
+ return; /* We must be really tight on memory. */
+ }
+ bitsPerPixel = imagePtr->bits_per_pixel;
+ bytesPerLine = ((bitsPerPixel * width + 31) >> 3) & ~3;
+ imagePtr->width = width;
+ imagePtr->height = nLines;
+ imagePtr->bytes_per_line = bytesPerLine;
+
+ /*
+ * TODO: use attemptckalloc() here once we have some strategy for
+ * recovering from the failure.
+ */
+
+ imagePtr->data = ckalloc(imagePtr->bytes_per_line * nLines);
+ bigEndian = imagePtr->bitmap_bit_order == MSBFirst;
+ firstBit = bigEndian? (1 << (imagePtr->bitmap_unit - 1)): 1;
+
+ lineLength = masterPtr->width * 3;
+ srcLinePtr = masterPtr->pix32 + (yStart * masterPtr->width + xStart) * 4;
+ errLinePtr = instancePtr->error + yStart * lineLength + xStart * 3;
+ xEnd = xStart + width;
+
+ /*
+ * Loop over the image, doing at most nLines lines before updating the
+ * screen image.
+ */
+
+ for (; height > 0; height -= nLines) {
+ unsigned char *dstLinePtr = (unsigned char *) imagePtr->data;
+ int yEnd;
+
+ if (nLines > height) {
+ nLines = height;
+ }
+ yEnd = yStart + nLines;
+ for (y = yStart; y < yEnd; ++y) {
+ unsigned char *srcPtr = srcLinePtr;
+ schar *errPtr = errLinePtr;
+ unsigned char *destBytePtr = dstLinePtr;
+ pixel *destLongPtr = (pixel *) dstLinePtr;
+
+ if (colorPtr->flags & COLOR_WINDOW) {
+ /*
+ * Color window. We dither the three components independently,
+ * using Floyd-Steinberg dithering, which propagates errors
+ * from the quantization of pixels to the pixels below and to
+ * the right.
+ */
+
+ for (x = xStart; x < xEnd; ++x) {
+ int col[3];
+
+ if (doDithering) {
+ for (i = 0; i < 3; ++i) {
+ /*
+ * Compute the error propagated into this pixel
+ * for this component. If e[x,y] is the array of
+ * quantization error values, we compute
+ * 7/16 * e[x-1,y] + 1/16 * e[x-1,y-1]
+ * + 5/16 * e[x,y-1] + 3/16 * e[x+1,y-1]
+ * and round it to an integer.
+ *
+ * The expression ((c + 2056) >> 4) - 128 computes
+ * round(c / 16), and works correctly on machines
+ * without a sign-extending right shift.
+ */
+
+ c = (x > 0) ? errPtr[-3] * 7: 0;
+ if (y > 0) {
+ if (x > 0) {
+ c += errPtr[-lineLength-3];
+ }
+ c += errPtr[-lineLength] * 5;
+ if ((x + 1) < masterPtr->width) {
+ c += errPtr[-lineLength+3] * 3;
+ }
+ }
+
+ /*
+ * Add the propagated error to the value of this
+ * component, quantize it, and store the
+ * quantization error.
+ */
+
+ c = ((c + 2056) >> 4) - 128 + *srcPtr++;
+ if (c < 0) {
+ c = 0;
+ } else if (c > 255) {
+ c = 255;
+ }
+ col[i] = colorPtr->colorQuant[i][c];
+ *errPtr++ = c - col[i];
+ }
+ } else {
+ /*
+ * Output is virtually continuous in this case, so
+ * don't bother dithering.
+ */
+
+ col[0] = *srcPtr++;
+ col[1] = *srcPtr++;
+ col[2] = *srcPtr++;
+ }
+ srcPtr++;
+
+ /*
+ * Translate the quantized component values into an X
+ * pixel value, and store it in the image.
+ */
+
+ i = colorPtr->redValues[col[0]]
+ + colorPtr->greenValues[col[1]]
+ + colorPtr->blueValues[col[2]];
+ if (colorPtr->flags & MAP_COLORS) {
+ i = colorPtr->pixelMap[i];
+ }
+ switch (bitsPerPixel) {
+ case NBBY:
+ *destBytePtr++ = i;
+ break;
+#ifndef __WIN32__
+ /*
+ * This case is not valid for Windows because the
+ * image format is different from the pixel format in
+ * Win32. Eventually we need to fix the image code in
+ * Tk to use the Windows native image ordering. This
+ * would speed up the image code for all of the common
+ * sizes.
+ */
+
+ case NBBY * sizeof(pixel):
+ *destLongPtr++ = i;
+ break;
+#endif
+ default:
+ XPutPixel(imagePtr, x - xStart, y - yStart,
+ (unsigned) i);
+ }
+ }
+
+ } else if (bitsPerPixel > 1) {
+ /*
+ * Multibit monochrome window. The operation here is similar
+ * to the color window case above, except that there is only
+ * one component. If the master image is in color, use the
+ * luminance computed as
+ * 0.344 * red + 0.5 * green + 0.156 * blue.
+ */
+
+ for (x = xStart; x < xEnd; ++x) {
+ c = (x > 0) ? errPtr[-1] * 7: 0;
+ if (y > 0) {
+ if (x > 0) {
+ c += errPtr[-lineLength-1];
+ }
+ c += errPtr[-lineLength] * 5;
+ if (x + 1 < masterPtr->width) {
+ c += errPtr[-lineLength+1] * 3;
+ }
+ }
+ c = ((c + 2056) >> 4) - 128;
+
+ if ((masterPtr->flags & COLOR_IMAGE) == 0) {
+ c += srcPtr[0];
+ } else {
+ c += (unsigned) (srcPtr[0] * 11 + srcPtr[1] * 16
+ + srcPtr[2] * 5 + 16) >> 5;
+ }
+ srcPtr += 4;
+
+ if (c < 0) {
+ c = 0;
+ } else if (c > 255) {
+ c = 255;
+ }
+ i = colorPtr->colorQuant[0][c];
+ *errPtr++ = c - i;
+ i = colorPtr->redValues[i];
+ switch (bitsPerPixel) {
+ case NBBY:
+ *destBytePtr++ = i;
+ break;
+#ifndef __WIN32__
+ /*
+ * This case is not valid for Windows because the
+ * image format is different from the pixel format in
+ * Win32. Eventually we need to fix the image code in
+ * Tk to use the Windows native image ordering. This
+ * would speed up the image code for all of the common
+ * sizes.
+ */
+
+ case NBBY * sizeof(pixel):
+ *destLongPtr++ = i;
+ break;
+#endif
+ default:
+ XPutPixel(imagePtr, x - xStart, y - yStart,
+ (unsigned) i);
+ }
+ }
+ } else {
+ /*
+ * 1-bit monochrome window. This is similar to the multibit
+ * monochrome case above, except that the quantization is
+ * simpler (we only have black = 0 and white = 255), and we
+ * produce an XY-Bitmap.
+ */
+
+ word = 0;
+ mask = firstBit;
+ for (x = xStart; x < xEnd; ++x) {
+ /*
+ * If we have accumulated a whole word, store it in the
+ * image and start a new word.
+ */
+
+ if (mask == 0) {
+ *destLongPtr++ = word;
+ mask = firstBit;
+ word = 0;
+ }
+
+ c = (x > 0) ? errPtr[-1] * 7: 0;
+ if (y > 0) {
+ if (x > 0) {
+ c += errPtr[-lineLength-1];
+ }
+ c += errPtr[-lineLength] * 5;
+ if (x + 1 < masterPtr->width) {
+ c += errPtr[-lineLength+1] * 3;
+ }
+ }
+ c = ((c + 2056) >> 4) - 128;
+
+ if ((masterPtr->flags & COLOR_IMAGE) == 0) {
+ c += srcPtr[0];
+ } else {
+ c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
+ + srcPtr[2] * 5 + 16) >> 5;
+ }
+ srcPtr += 4;
+
+ if (c < 0) {
+ c = 0;
+ } else if (c > 255) {
+ c = 255;
+ }
+ if (c >= 128) {
+ word |= mask;
+ *errPtr++ = c - 255;
+ } else {
+ *errPtr++ = c;
+ }
+ mask = bigEndian? (mask >> 1): (mask << 1);
+ }
+ *destLongPtr = word;
+ }
+ srcLinePtr += masterPtr->width * 4;
+ errLinePtr += lineLength;
+ dstLinePtr += bytesPerLine;
+ }
+
+ /*
+ * Update the pixmap for this instance with the block of pixels that
+ * we have just computed.
+ */
+
+ TkPutImage(colorPtr->pixelMap, colorPtr->numColors,
+ instancePtr->display, instancePtr->pixels,
+ instancePtr->gc, imagePtr, 0, 0, xStart, yStart,
+ (unsigned) width, (unsigned) nLines);
+ yStart = yEnd;
+ }
+
+ ckfree(imagePtr->data);
+ imagePtr->data = NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkImgResetDither --
+ *
+ * This function is called to eliminate the content of a photo instance's
+ * dither error buffer. It's called when the overall image is blanked.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The instance's dither buffer gets cleared.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkImgResetDither(
+ PhotoInstance *instancePtr)
+{
+ if (instancePtr->error) {
+ memset(instancePtr->error, 0,
+ /*(size_t)*/ (instancePtr->masterPtr->width
+ * instancePtr->masterPtr->height * 3 * sizeof(schar)));
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index ef907e6..a833e29 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -18,207 +18,7 @@
* Australian National University.
*/
-#include "tkInt.h"
-#include <ctype.h>
-
-#ifdef __WIN32__
-#include "tkWinInt.h"
-#endif
-
-/*
- * Declaration for internal Xlib function used here:
- */
-
-extern int _XInitImageFuncPtrs(XImage *image);
-
-/*
- * A signed 8-bit integral type. If chars are unsigned and the compiler isn't
- * an ANSI one, then we have to use short instead (which wastes space) to get
- * signed behavior.
- */
-
-#if defined(__STDC__) || defined(_AIX)
- typedef signed char schar;
-#else
-# ifndef __CHAR_UNSIGNED__
- typedef char schar;
-# else
- typedef short schar;
-# endif
-#endif
-
-/*
- * An unsigned 32-bit integral type, used for pixel values. We use int rather
- * than long here to accommodate those systems where longs are 64 bits.
- */
-
-typedef unsigned int pixel;
-
-/*
- * The maximum number of pixels to transmit to the server in a single
- * XPutImage call.
- */
-
-#define MAX_PIXELS 65536
-
-/*
- * The set of colors required to display a photo image in a window depends on:
- * - the visual used by the window
- * - the palette, which specifies how many levels of each primary color to
- * use, and
- * - the gamma value for the image.
- *
- * Pixel values allocated for specific colors are valid only for the colormap
- * in which they were allocated. Sets of pixel values allocated for displaying
- * photos are re-used in other windows if possible, that is, if the display,
- * colormap, palette and gamma values match. A hash table is used to locate
- * these sets of pixel values, using the following data structure as key:
- */
-
-typedef struct {
- Display *display; /* Qualifies the colormap resource ID. */
- Colormap colormap; /* Colormap that the windows are using. */
- double gamma; /* Gamma exponent value for images. */
- Tk_Uid palette; /* Specifies how many shades of each primary
- * we want to allocate. */
-} ColorTableId;
-
-/*
- * For a particular (display, colormap, palette, gamma) combination, a data
- * structure of the following type is used to store the allocated pixel values
- * and other information:
- */
-
-typedef struct ColorTable {
- ColorTableId id; /* Information used in selecting this color
- * table. */
- int flags; /* See below. */
- int refCount; /* Number of instances using this map. */
- int liveRefCount; /* Number of instances which are actually in
- * use, using this map. */
- int numColors; /* Number of colors allocated for this map. */
-
- XVisualInfo visualInfo; /* Information about the visual for windows
- * using this color table. */
-
- pixel redValues[256]; /* Maps 8-bit values of red intensity to a
- * pixel value or index in pixelMap. */
- pixel greenValues[256]; /* Ditto for green intensity. */
- pixel blueValues[256]; /* Ditto for blue intensity. */
- unsigned long *pixelMap; /* Actual pixel values allocated. */
-
- unsigned char colorQuant[3][256];
- /* Maps 8-bit intensities to quantized
- * intensities. The first index is 0 for red,
- * 1 for green, 2 for blue. */
-} ColorTable;
-
-/*
- * Bit definitions for the flags field of a ColorTable.
- * BLACK_AND_WHITE: 1 means only black and white colors are
- * available.
- * COLOR_WINDOW: 1 means a full 3-D color cube has been
- * allocated.
- * DISPOSE_PENDING: 1 means a call to DisposeColorTable has been
- * scheduled as an idle handler, but it hasn't
- * been invoked yet.
- * MAP_COLORS: 1 means pixel values should be mapped through
- * pixelMap.
- */
-
-#ifdef COLOR_WINDOW
-#undef COLOR_WINDOW
-#endif
-
-#define BLACK_AND_WHITE 1
-#define COLOR_WINDOW 2
-#define DISPOSE_PENDING 4
-#define MAP_COLORS 8
-
-/*
- * Definition of the data associated with each photo image master.
- */
-
-typedef struct PhotoMaster {
- Tk_ImageMaster tkMaster; /* Tk's token for image master. NULL means the
- * image is being deleted. */
- Tcl_Interp *interp; /* Interpreter associated with the application
- * using this image. */
- Tcl_Command imageCmd; /* Token for image command (used to delete it
- * when the image goes away). NULL means the
- * image command has already been deleted. */
- int flags; /* Sundry flags, defined below. */
- int width, height; /* Dimensions of image. */
- int userWidth, userHeight; /* User-declared image dimensions. */
- Tk_Uid palette; /* User-specified default palette for
- * instances of this image. */
- double gamma; /* Display gamma value to correct for. */
- char *fileString; /* Name of file to read into image. */
- Tcl_Obj *dataString; /* Object to use as contents of image. */
- Tcl_Obj *format; /* User-specified format of data in image file
- * or string value. */
- unsigned char *pix32; /* Local storage for 32-bit image. */
- int ditherX, ditherY; /* Location of first incorrectly dithered
- * pixel in image. */
- TkRegion validRegion; /* Tk region indicating which parts of the
- * image have valid image data. */
- struct PhotoInstance *instancePtr;
- /* First in the list of instances associated
- * with this master. */
-} PhotoMaster;
-
-/*
- * Bit definitions for the flags field of a PhotoMaster.
- * COLOR_IMAGE: 1 means that the image has different color
- * components.
- * IMAGE_CHANGED: 1 means that the instances of this image need
- * to be redithered.
- * COMPLEX_ALPHA: 1 means that the instances of this image have
- * alpha values that aren't 0 or 255, and so need
- * the copy-merge-replace renderer .
- */
-
-#define COLOR_IMAGE 1
-#define IMAGE_CHANGED 2
-#define COMPLEX_ALPHA 4
-
-/*
- * Flag to OR with the compositing rule to indicate that the source, despite
- * having an alpha channel, has simple alpha.
- */
-
-#define SOURCE_IS_SIMPLE_ALPHA_PHOTO 0x10000000
-
-/*
- * The following data structure represents all of the instances of a photo
- * image in windows on a given screen that are using the same colormap.
- */
-
-typedef struct PhotoInstance {
- PhotoMaster *masterPtr; /* Pointer to master for image. */
- Display *display; /* Display for windows using this instance. */
- Colormap colormap; /* The image may only be used in windows with
- * this particular colormap. */
- struct PhotoInstance *nextPtr;
- /* Pointer to the next instance in the list of
- * instances associated with this master. */
- int refCount; /* Number of instances using this structure. */
- Tk_Uid palette; /* Palette for these particular instances. */
- double gamma; /* Gamma value for these instances. */
- Tk_Uid defaultPalette; /* Default palette to use if a palette is not
- * specified for the master. */
- ColorTable *colorTablePtr; /* Pointer to information about colors
- * allocated for image display in windows like
- * this one. */
- Pixmap pixels; /* X pixmap containing dithered image. */
- int width, height; /* Dimensions of the pixmap. */
- schar *error; /* Error image, used in dithering. */
- XImage *imagePtr; /* Image structure for converted pixels. */
- XVisualInfo visualInfo; /* Information about the visual that these
- * windows are using. */
- GC gc; /* Graphics context for writing images to the
- * pixmap. */
-} PhotoInstance;
+#include "tkImgPhoto.h"
/*
* The following data structure is used to return information from
@@ -274,7 +74,7 @@ struct SubcommandOptions {
* of the OPT_* constants above.
*/
-static char *optionNames[] = {
+static const char *const optionNames[] = {
"-background",
"-compositingrule",
"-format",
@@ -299,16 +99,10 @@ static char *optionNames[] = {
* Functions used in the type record for photo images.
*/
-static int ImgPhotoCreate(Tcl_Interp *interp, char *name,
- int objc, Tcl_Obj *CONST objv[],
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+static int ImgPhotoCreate(Tcl_Interp *interp, const char *name,
+ int objc, Tcl_Obj *const objv[],
+ const Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *clientDataPtr);
-static ClientData ImgPhotoGet(Tk_Window tkwin, ClientData clientData);
-static void ImgPhotoDisplay(ClientData clientData,
- Display *display, Drawable drawable,
- int imageX, int imageY, int width, int height,
- int drawableX, int drawableY);
-static void ImgPhotoFree(ClientData clientData, Display *display);
static void ImgPhotoDelete(ClientData clientData);
static int ImgPhotoPostscript(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
@@ -322,12 +116,13 @@ static int ImgPhotoPostscript(ClientData clientData,
Tk_ImageType tkPhotoImageType = {
"photo", /* name */
ImgPhotoCreate, /* createProc */
- ImgPhotoGet, /* getProc */
- ImgPhotoDisplay, /* displayProc */
- ImgPhotoFree, /* freeProc */
+ TkImgPhotoGet, /* getProc */
+ TkImgPhotoDisplay, /* displayProc */
+ TkImgPhotoFree, /* freeProc */
ImgPhotoDelete, /* deleteProc */
ImgPhotoPostscript, /* postscriptProc */
- NULL /* nextPtr */
+ NULL, /* nextPtr */
+ NULL
};
typedef struct ThreadSpecificData {
@@ -338,7 +133,7 @@ typedef struct ThreadSpecificData {
/* Pointer to the first in the list of known
* photo image formats.*/
int initialized; /* Set to 1 if we've initialized the
- * strucuture. */
+ * structure. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -355,45 +150,27 @@ static Tcl_ThreadDataKey dataKey;
* Information used for parsing configuration specifications:
*/
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_STRING, "-file", NULL, NULL,
- NULL, Tk_Offset(PhotoMaster, fileString), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(PhotoMaster, fileString), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_DOUBLE, "-gamma", NULL, NULL,
- DEF_PHOTO_GAMMA, Tk_Offset(PhotoMaster, gamma), 0},
+ DEF_PHOTO_GAMMA, Tk_Offset(PhotoMaster, gamma), 0, NULL},
{TK_CONFIG_INT, "-height", NULL, NULL,
- DEF_PHOTO_HEIGHT, Tk_Offset(PhotoMaster, userHeight), 0},
+ DEF_PHOTO_HEIGHT, Tk_Offset(PhotoMaster, userHeight), 0, NULL},
{TK_CONFIG_UID, "-palette", NULL, NULL,
- DEF_PHOTO_PALETTE, Tk_Offset(PhotoMaster, palette), 0},
+ DEF_PHOTO_PALETTE, Tk_Offset(PhotoMaster, palette), 0, NULL},
{TK_CONFIG_INT, "-width", NULL, NULL,
- DEF_PHOTO_WIDTH, Tk_Offset(PhotoMaster, userWidth), 0},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ DEF_PHOTO_WIDTH, Tk_Offset(PhotoMaster, userWidth), 0, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
- * Hash table used to hash from (display, colormap, palette, gamma) to
- * ColorTable address.
- */
-
-static Tcl_HashTable imgPhotoColorHash;
-static int imgPhotoColorHashInitialized;
-#define N_COLOR_HASH (sizeof(ColorTableId) / sizeof(int))
-
-/*
- * Implementation of the Porter-Duff Source-Over compositing rule.
- */
-
-#define PD_SRC_OVER(srcColor,srcAlpha,dstColor,dstAlpha) \
- (srcColor*srcAlpha/255) + dstAlpha*(255-srcAlpha)/255*dstColor/255
-#define PD_SRC_OVER_ALPHA(srcAlpha,dstAlpha) \
- (srcAlpha + (255-srcAlpha)*dstAlpha/255)
-
-/*
* Forward declarations
*/
static void PhotoFormatThreadExitProc(ClientData clientData);
static int ImgPhotoCmd(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int ParseSubcommandOptions(
struct SubcommandOptions *optPtr,
Tcl_Interp *interp, int allowedOptions,
@@ -402,47 +179,24 @@ static void ImgPhotoCmdDeletedProc(ClientData clientData);
static int ImgPhotoConfigureMaster(Tcl_Interp *interp,
PhotoMaster *masterPtr, int objc,
Tcl_Obj *const objv[], int flags);
-static void ImgPhotoConfigureInstance(PhotoInstance *instancePtr);
static int ToggleComplexAlphaIfNeeded(PhotoMaster *mPtr);
-static void ImgPhotoBlendComplexAlpha(XImage *bgImg,
- PhotoInstance *iPtr, int xOffset, int yOffset,
- int width, int height);
static int ImgPhotoSetSize(PhotoMaster *masterPtr, int width,
int height);
-static void ImgPhotoInstanceSetSize(PhotoInstance *instancePtr);
static int ImgStringWrite(Tcl_Interp *interp,
Tcl_Obj *formatString,
Tk_PhotoImageBlock *blockPtr);
static char * ImgGetPhoto(PhotoMaster *masterPtr,
Tk_PhotoImageBlock *blockPtr,
struct SubcommandOptions *optPtr);
-static int IsValidPalette(PhotoInstance *instancePtr,
- const char *palette);
-static int CountBits(pixel mask);
-static void GetColorTable(PhotoInstance *instancePtr);
-static void FreeColorTable(ColorTable *colorPtr, int force);
-static void AllocateColors(ColorTable *colorPtr);
-static void DisposeColorTable(ClientData clientData);
-static void DisposeInstance(ClientData clientData);
-static int ReclaimColors(ColorTableId *id, int numColors);
static int MatchFileFormat(Tcl_Interp *interp, Tcl_Channel chan,
- char *fileName, Tcl_Obj *formatString,
+ const char *fileName, Tcl_Obj *formatString,
Tk_PhotoImageFormat **imageFormatPtr,
int *widthPtr, int *heightPtr, int *oldformat);
static int MatchStringFormat(Tcl_Interp *interp, Tcl_Obj *data,
Tcl_Obj *formatString,
Tk_PhotoImageFormat **imageFormatPtr,
int *widthPtr, int *heightPtr, int *oldformat);
-static Tcl_ObjCmdProc * PhotoOptionFind(Tcl_Interp *interp, Tcl_Obj *obj);
-static void DitherInstance(PhotoInstance *instancePtr, int x,
- int y, int width, int height);
-static void PhotoOptionCleanupProc(ClientData clientData,
- Tcl_Interp *interp);
-
-#undef MIN
-#define MIN(a, b) ((a) < (b)? (a): (b))
-#undef MAX
-#define MAX(a, b) ((a) > (b)? (a): (b))
+static const char * GetExtension(const char *path);
/*
*----------------------------------------------------------------------
@@ -465,19 +219,19 @@ PhotoFormatThreadExitProc(
ClientData clientData) /* not used */
{
Tk_PhotoImageFormat *freePtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
while (tsdPtr->oldFormatList != NULL) {
freePtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
- ckfree((char *) freePtr);
+ ckfree(freePtr);
}
while (tsdPtr->formatList != NULL) {
freePtr = tsdPtr->formatList;
tsdPtr->formatList = tsdPtr->formatList->nextPtr;
- ckfree((char *) freePtr->name);
- ckfree((char *) freePtr);
+ ckfree(freePtr->name);
+ ckfree(freePtr);
}
}
@@ -502,20 +256,20 @@ PhotoFormatThreadExitProc(
void
Tk_CreateOldPhotoImageFormat(
- Tk_PhotoImageFormat *formatPtr)
+ const Tk_PhotoImageFormat *formatPtr)
/* Structure describing the format. All of the
* fields except "nextPtr" must be filled in
* by caller. */
{
Tk_PhotoImageFormat *copyPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL);
}
- copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
+ copyPtr = ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
copyPtr->nextPtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = copyPtr;
@@ -523,20 +277,20 @@ Tk_CreateOldPhotoImageFormat(
void
Tk_CreatePhotoImageFormat(
- Tk_PhotoImageFormat *formatPtr)
+ const Tk_PhotoImageFormat *formatPtr)
/* Structure describing the format. All of the
* fields except "nextPtr" must be filled in
* by caller. */
{
Tk_PhotoImageFormat *copyPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL);
}
- copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
+ copyPtr = ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
if (isupper((unsigned char) *formatPtr->name)) {
copyPtr->nextPtr = tsdPtr->oldFormatList;
@@ -572,11 +326,11 @@ static int
ImgPhotoCreate(
Tcl_Interp *interp, /* Interpreter for application containing
* image. */
- char *name, /* Name to use for image. */
+ const char *name, /* Name to use for image. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects for options (doesn't
+ Tcl_Obj *const objv[], /* Argument objects for options (doesn't
* include image name or type). */
- Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
+ const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */
Tk_ImageMaster master, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
@@ -588,12 +342,12 @@ ImgPhotoCreate(
* Allocate and initialize the photo image master record.
*/
- masterPtr = (PhotoMaster *) ckalloc(sizeof(PhotoMaster));
+ masterPtr = ckalloc(sizeof(PhotoMaster));
memset(masterPtr, 0, sizeof(PhotoMaster));
masterPtr->tkMaster = master;
masterPtr->interp = interp;
masterPtr->imageCmd = Tcl_CreateObjCommand(interp, name, ImgPhotoCmd,
- (ClientData) masterPtr, ImgPhotoCmdDeletedProc);
+ masterPtr, ImgPhotoCmdDeletedProc);
masterPtr->palette = NULL;
masterPtr->pix32 = NULL;
masterPtr->instancePtr = NULL;
@@ -604,11 +358,11 @@ ImgPhotoCreate(
*/
if (ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, 0) != TCL_OK) {
- ImgPhotoDelete((ClientData) masterPtr);
+ ImgPhotoDelete(masterPtr);
return TCL_ERROR;
}
- *clientDataPtr = (ClientData) masterPtr;
+ *clientDataPtr = masterPtr;
return TCL_OK;
}
@@ -635,9 +389,9 @@ ImgPhotoCmd(
ClientData clientData, /* Information about photo master. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static const char *photoOptions[] = {
+ static const char *const photoOptions[] = {
"blank", "cget", "configure", "copy", "data", "get", "put",
"read", "redither", "transparency", "write", NULL
};
@@ -647,7 +401,7 @@ ImgPhotoCmd(
PHOTO_WRITE
};
- PhotoMaster *masterPtr = (PhotoMaster *) clientData;
+ PhotoMaster *masterPtr = clientData;
int result, index, x, y, width, height, dataWidth, dataHeight, listObjc;
struct SubcommandOptions options;
Tcl_Obj **listObjv, **srcObjv;
@@ -658,22 +412,17 @@ ImgPhotoCmd(
int imageWidth, imageHeight, matched, length, oldformat = 0;
Tcl_Channel chan;
Tk_PhotoHandle srcHandle;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], photoOptions, "option", 0,
&index) != TCL_OK) {
- Tcl_ObjCmdProc *proc;
- proc = PhotoOptionFind(interp, objv[1]);
- if (proc == NULL) {
- return TCL_ERROR;
- }
- return proc(clientData, interp, objc, objv);
+ return TCL_ERROR;
}
switch ((enum PhotoOptions) index) {
@@ -691,7 +440,7 @@ ImgPhotoCmd(
}
case PHOTO_CGET: {
- char *arg;
+ const char *arg;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "option");
@@ -746,11 +495,15 @@ ImgPhotoCmd(
return TCL_OK;
} else if (objc == 3) {
- char *arg = Tcl_GetStringFromObj(objv[2], &length);
+ const char *arg = Tcl_GetStringFromObj(objv[2], &length);
if (length > 1 && !strncmp(arg, "-data", (unsigned) length)) {
Tcl_AppendResult(interp, "-data {} {} {}", NULL);
if (masterPtr->dataString) {
+ /*
+ * TODO: Modifying result is bad!
+ */
+
Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
masterPtr->dataString);
} else {
@@ -761,6 +514,10 @@ ImgPhotoCmd(
!strncmp(arg, "-format", (unsigned) length)) {
Tcl_AppendResult(interp, "-format {} {} {}", NULL);
if (masterPtr->format) {
+ /*
+ * TODO: Modifying result is bad!
+ */
+
Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
masterPtr->format);
} else {
@@ -771,9 +528,10 @@ ImgPhotoCmd(
return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
configSpecs, (char *) masterPtr, arg, 0);
}
+ } else {
+ return ImgPhotoConfigureMaster(interp, masterPtr, objc-2, objv+2,
+ TK_CONFIG_ARGV_ONLY);
}
- return ImgPhotoConfigureMaster(interp, masterPtr, objc-2, objv+2,
- TK_CONFIG_ARGV_ONLY);
case PHOTO_COPY:
/*
@@ -907,7 +665,7 @@ ImgPhotoCmd(
return TCL_ERROR;
}
if ((options.name != NULL) || (index < objc)) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?");
return TCL_ERROR;
}
if ((options.fromX > masterPtr->width)
@@ -978,23 +736,25 @@ ImgPhotoCmd(
if (oldformat) {
Tcl_DString buffer;
+ typedef int (*OldStringWriteProc)(Tcl_Interp *interp,
+ Tcl_DString *dataPtr, const char *formatString,
+ Tk_PhotoImageBlock *blockPtr);
Tcl_DStringInit(&buffer);
- result = ((int (*) (Tcl_Interp *interp,
- Tcl_DString *dataPtr, char *formatString,
- Tk_PhotoImageBlock *blockPtr)) stringWriteProc)
- (interp, &buffer, Tcl_GetString(options.format), &block);
+ result = ((OldStringWriteProc) stringWriteProc)(interp, &buffer,
+ Tcl_GetString(options.format), &block);
if (result == TCL_OK) {
Tcl_DStringResult(interp, &buffer);
} else {
Tcl_DStringFree(&buffer);
}
} else {
-
- result = ((int (*) (Tcl_Interp *interp,
+ typedef int (*NewStringWriteProc)(Tcl_Interp *interp,
Tcl_Obj *formatString, Tk_PhotoImageBlock *blockPtr,
- void *dummy)) stringWriteProc)
- (interp, options.format, &block, NULL);
+ void *dummy);
+
+ result = ((NewStringWriteProc) stringWriteProc)(interp,
+ options.format, &block, NULL);
}
if (options.background) {
Tk_FreeColor(options.background);
@@ -1051,7 +811,7 @@ ImgPhotoCmd(
return TCL_ERROR;
}
if ((options.name == NULL) || (index < objc)) {
- Tcl_WrongNumArgs(interp, 2, objv, "data ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "data ?-option value ...?");
return TCL_ERROR;
}
@@ -1078,10 +838,9 @@ ImgPhotoCmd(
}
data = (Tcl_Obj *) Tcl_GetString(data);
}
- if ((*imageFormat->stringReadProc)(interp, data,
- format, (Tk_PhotoHandle) masterPtr,
- options.toX, options.toY, imageWidth, imageHeight,
- 0, 0) != TCL_OK) {
+ if (imageFormat->stringReadProc(interp, data, format,
+ (Tk_PhotoHandle) masterPtr, options.toX, options.toY,
+ imageWidth, imageHeight, 0, 0) != TCL_OK) {
return TCL_ERROR;
}
masterPtr->flags |= IMAGE_CHANGED;
@@ -1114,8 +873,7 @@ ImgPhotoCmd(
break;
}
dataWidth = listObjc;
- pixelPtr = (unsigned char *)
- ckalloc((unsigned) dataWidth * dataHeight * 3);
+ pixelPtr = ckalloc(dataWidth * dataHeight * 3);
block.pixelPtr = pixelPtr;
} else if (listObjc != dataWidth) {
Tcl_AppendResult(interp, "all elements of color list must",
@@ -1124,7 +882,7 @@ ImgPhotoCmd(
}
for (x = 0; x < dataWidth; ++x) {
- char *colorString = Tcl_GetString(listObjv[x]);
+ const char *colorString = Tcl_GetString(listObjv[x]);
XColor color;
int tmpr, tmpg, tmpb;
@@ -1176,7 +934,7 @@ ImgPhotoCmd(
}
if (y < dataHeight || dataHeight == 0 || dataWidth == 0) {
if (block.pixelPtr != NULL) {
- ckfree((char *) block.pixelPtr);
+ ckfree(block.pixelPtr);
}
if (y < dataHeight) {
return TCL_ERROR;
@@ -1201,11 +959,11 @@ ImgPhotoCmd(
block.offset[1] = 1;
block.offset[2] = 2;
block.offset[3] = 0;
- result = Tk_PhotoPutBlock(interp, (ClientData)masterPtr, &block,
+ result = Tk_PhotoPutBlock(interp, masterPtr, &block,
options.toX, options.toY, options.toX2 - options.toX,
options.toY2 - options.toY,
TK_PHOTO_COMPOSITE_SET);
- ckfree((char *) block.pixelPtr);
+ ckfree(block.pixelPtr);
return result;
case PHOTO_READ: {
@@ -1225,7 +983,7 @@ ImgPhotoCmd(
return TCL_ERROR;
}
if ((options.name == NULL) || (index < objc)) {
- Tcl_WrongNumArgs(interp, 2, objv, "fileName ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "fileName ?-option value ...?");
return TCL_ERROR;
}
@@ -1308,7 +1066,7 @@ ImgPhotoCmd(
if (oldformat && format) {
format = (Tcl_Obj *) Tcl_GetString(format);
}
- result = (*imageFormat->fileReadProc)(interp, chan,
+ result = imageFormat->fileReadProc(interp, chan,
Tcl_GetString(options.name),
format, (Tk_PhotoHandle) masterPtr, options.toX,
options.toY, width, height, options.fromX, options.fromY);
@@ -1354,7 +1112,7 @@ ImgPhotoCmd(
return TCL_OK;
case PHOTO_TRANS: {
- static const char *photoTransOptions[] = {
+ static const char *const photoTransOptions[] = {
"get", "set", NULL
};
enum transOptions {
@@ -1362,7 +1120,7 @@ ImgPhotoCmd(
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[2], photoTransOptions, "option",
@@ -1384,7 +1142,7 @@ ImgPhotoCmd(
return TCL_ERROR;
}
if ((x < 0) || (x >= masterPtr->width)
- || (y < 0) || (y >= masterPtr->height)) {
+ || (y < 0) || (y >= masterPtr->height)) {
Tcl_AppendResult(interp, Tcl_GetString(objv[0]),
" transparency get: coordinates out of range", NULL);
return TCL_ERROR;
@@ -1401,8 +1159,8 @@ ImgPhotoCmd(
TkClipBox(testRegion, &testBox);
TkDestroyRegion(testRegion);
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- (testBox.width==0 && testBox.height==0));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ testBox.width==0 && testBox.height==0));
return TCL_OK;
}
@@ -1477,7 +1235,9 @@ ImgPhotoCmd(
case PHOTO_WRITE: {
char *data;
+ const char *fmtString;
Tcl_Obj *format;
+ int usedExt;
/*
* Prevent file system access in safe interpreters.
@@ -1503,7 +1263,7 @@ ImgPhotoCmd(
return TCL_ERROR;
}
if ((options.name == NULL) || (index < objc)) {
- Tcl_WrongNumArgs(interp, 2, objv, "fileName ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "fileName ?-option value ...?");
return TCL_ERROR;
}
if ((options.fromX > masterPtr->width)
@@ -1516,13 +1276,22 @@ ImgPhotoCmd(
}
/*
- * Fill in default values for unspecified parameters.
+ * Fill in default values for unspecified parameters. Note that a
+ * missing -format flag results in us having a guess from the file
+ * extension. [Bug 2983824]
*/
if (!(options.options & OPT_FROM) || (options.fromX2 < 0)) {
options.fromX2 = masterPtr->width;
options.fromY2 = masterPtr->height;
}
+ if (options.format == NULL) {
+ fmtString = GetExtension(Tcl_GetString(options.name));
+ usedExt = (fmtString != NULL);
+ } else {
+ fmtString = Tcl_GetString(options.format);
+ usedExt = 0;
+ }
/*
* Search for an appropriate image file format handler, and give an
@@ -1530,11 +1299,12 @@ ImgPhotoCmd(
*/
matched = 0;
+ redoFormatLookup:
for (imageFormat = tsdPtr->formatList; imageFormat != NULL;
imageFormat = imageFormat->nextPtr) {
- if ((options.format == NULL)
- || (strncasecmp(Tcl_GetString(options.format),
- imageFormat->name, strlen(imageFormat->name)) == 0)) {
+ if ((fmtString == NULL)
+ || (strncasecmp(fmtString, imageFormat->name,
+ strlen(imageFormat->name)) == 0)) {
matched = 1;
if (imageFormat->fileWriteProc != NULL) {
break;
@@ -1545,9 +1315,9 @@ ImgPhotoCmd(
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)) {
+ if ((fmtString == NULL)
+ || (strncasecmp(fmtString, imageFormat->name,
+ strlen(imageFormat->name)) == 0)) {
matched = 1;
if (imageFormat->fileWriteProc != NULL) {
break;
@@ -1555,18 +1325,31 @@ ImgPhotoCmd(
}
}
}
+ if (usedExt && !matched) {
+ /*
+ * If we didn't find one and we're using file extensions as the
+ * basis for the guessing, go back and look again without
+ * prejudice. Supports old broken code.
+ */
+
+ usedExt = 0;
+ fmtString = NULL;
+ goto redoFormatLookup;
+ }
if (imageFormat == NULL) {
- if (options.format == NULL) {
+ if (fmtString == NULL) {
Tcl_AppendResult(interp, "no available image file format ",
"has file writing capability", NULL);
} else if (!matched) {
Tcl_AppendResult(interp, "image file format \"",
- Tcl_GetString(options.format),
- "\" is unknown", NULL);
+ fmtString, "\" is unknown", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT",
+ fmtString, NULL);
} else {
Tcl_AppendResult(interp, "image file format \"",
- Tcl_GetString(options.format),
- "\" has no file writing capability", NULL);
+ fmtString, "\" has no file writing capability", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT",
+ fmtString, NULL);
}
return TCL_ERROR;
}
@@ -1580,7 +1363,7 @@ ImgPhotoCmd(
if (oldformat && format) {
format = (Tcl_Obj *) Tcl_GetString(options.format);
}
- result = (*imageFormat->fileWriteProc)(interp,
+ result = imageFormat->fileWriteProc(interp,
Tcl_GetString(options.name), format, &block);
if (options.background) {
Tk_FreeColor(options.background);
@@ -1599,6 +1382,36 @@ ImgPhotoCmd(
/*
*----------------------------------------------------------------------
*
+ * GetExtension --
+ *
+ * Return the extension part of a path, or NULL if there is no extension.
+ * The returned string will be a substring of the argument string, so
+ * should not be ckfree()d directly. No side effects.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static const char *
+GetExtension(
+ const char *path)
+{
+ char c;
+ const char *extension = NULL;
+
+ for (; (c=*path++) != '\0' ;) {
+ if (c == '.') {
+ extension = path;
+ }
+ }
+ if (extension != NULL && extension[0] == '\0') {
+ extension = NULL;
+ }
+ return extension;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* ParseSubcommandOptions --
*
* This function is invoked to process one of the options which may be
@@ -1630,7 +1443,8 @@ ParseSubcommandOptions(
{
int index, c, bit, currentBit, length;
int values[4], numValues, maxValues, argIndex;
- char *option, **listPtr;
+ const char *option;
+ const char *const *listPtr;
for (index = *optIndexPtr; index < objc; *optIndexPtr = ++index) {
/*
@@ -1739,7 +1553,7 @@ ParseSubcommandOptions(
* constants.
*/
- static const char *compositingRules[] = {
+ static const char *const compositingRules[] = {
"overlay", "set", NULL
};
@@ -1756,7 +1570,7 @@ ParseSubcommandOptions(
return TCL_ERROR;
}
} else if ((bit != OPT_SHRINK) && (bit != OPT_GRAYSCALE)) {
- char *val;
+ const char *val;
maxValues = ((bit == OPT_FROM) || (bit == OPT_TO))? 4: 2;
argIndex = index + 1;
for (numValues = 0; numValues < maxValues; ++numValues) {
@@ -1773,7 +1587,7 @@ ParseSubcommandOptions(
} else {
break;
}
- ++argIndex;
+ argIndex++;
}
if (numValues == 0) {
@@ -1905,7 +1719,7 @@ ImgPhotoConfigureMaster(
Tk_PhotoImageFormat *imageFormat;
const char **args;
- args = (const char **) ckalloc((objc + 1) * sizeof(char *));
+ args = 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] == '-')) {
@@ -1915,6 +1729,7 @@ ImgPhotoConfigureMaster(
data = objv[i];
j--;
} else {
+ ckfree(args);
Tcl_AppendResult(interp,
"value for \"-data\" missing", NULL);
return TCL_ERROR;
@@ -1925,6 +1740,7 @@ ImgPhotoConfigureMaster(
format = objv[i];
j--;
} else {
+ ckfree(args);
Tcl_AppendResult(interp,
"value for \"-format\" missing", NULL);
return TCL_ERROR;
@@ -1962,10 +1778,10 @@ ImgPhotoConfigureMaster(
if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs,
j, args, (char *) masterPtr, flags) != TCL_OK) {
- ckfree((char *) args);
+ ckfree(args);
goto errorExit;
}
- ckfree((char *) args);
+ ckfree(args);
/*
* Regard the empty string for -file, -data or -format as the null value.
@@ -2029,7 +1845,6 @@ ImgPhotoConfigureMaster(
if ((masterPtr->fileString != NULL)
&& ((masterPtr->fileString != oldFileString)
|| (masterPtr->format != oldFormat))) {
-
/*
* Prevent file system access in a safe interpreter.
*/
@@ -2069,7 +1884,7 @@ ImgPhotoConfigureMaster(
if (oldformat && tempformat) {
tempformat = (Tcl_Obj *) Tcl_GetString(tempformat);
}
- result = (*imageFormat->fileReadProc)(interp, chan,
+ result = imageFormat->fileReadProc(interp, chan,
masterPtr->fileString, tempformat, (Tk_PhotoHandle) masterPtr,
0, 0, imageWidth, imageHeight, 0, 0);
Tcl_Close(NULL, chan);
@@ -2103,9 +1918,9 @@ ImgPhotoConfigureMaster(
}
tempdata = (Tcl_Obj *) Tcl_GetString(tempdata);
}
- if ((*imageFormat->stringReadProc)(interp, tempdata,
- tempformat, (Tk_PhotoHandle) masterPtr,
- 0, 0, imageWidth, imageHeight, 0, 0) != TCL_OK) {
+ if (imageFormat->stringReadProc(interp, tempdata, tempformat,
+ (Tk_PhotoHandle) masterPtr, 0, 0, imageWidth, imageHeight,
+ 0, 0) != TCL_OK) {
goto errorExit;
}
@@ -2134,7 +1949,7 @@ ImgPhotoConfigureMaster(
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
- ImgPhotoConfigureInstance(instancePtr);
+ TkImgPhotoConfigureInstance(instancePtr);
}
/*
@@ -2169,329 +1984,6 @@ ImgPhotoConfigureMaster(
/*
*----------------------------------------------------------------------
*
- * ImgPhotoConfigureInstance --
- *
- * This function is called to create displaying information for a photo
- * image instance based on the configuration information in the master.
- * It is invoked both when new instances are created and when the master
- * is reconfigured.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Generates errors via Tcl_BackgroundError if there are problems in
- * setting up the instance.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImgPhotoConfigureInstance(
- PhotoInstance *instancePtr) /* Instance to reconfigure. */
-{
- PhotoMaster *masterPtr = instancePtr->masterPtr;
- XImage *imagePtr;
- int bitsPerPixel;
- ColorTable *colorTablePtr;
- XRectangle validBox;
-
- /*
- * If the -palette configuration option has been set for the master, use
- * the value specified for our palette, but only if it is a valid palette
- * for our windows. Use the gamma value specified the master.
- */
-
- if ((masterPtr->palette && masterPtr->palette[0])
- && IsValidPalette(instancePtr, masterPtr->palette)) {
- instancePtr->palette = masterPtr->palette;
- } else {
- instancePtr->palette = instancePtr->defaultPalette;
- }
- instancePtr->gamma = masterPtr->gamma;
-
- /*
- * If we don't currently have a color table, or if the one we have no
- * longer applies (e.g. because our palette or gamma has changed), get a
- * new one.
- */
-
- colorTablePtr = instancePtr->colorTablePtr;
- if ((colorTablePtr == NULL)
- || (instancePtr->colormap != colorTablePtr->id.colormap)
- || (instancePtr->palette != colorTablePtr->id.palette)
- || (instancePtr->gamma != colorTablePtr->id.gamma)) {
- /*
- * Free up our old color table, and get a new one.
- */
-
- if (colorTablePtr != NULL) {
- colorTablePtr->liveRefCount -= 1;
- FreeColorTable(colorTablePtr, 0);
- }
- GetColorTable(instancePtr);
-
- /*
- * Create a new XImage structure for sending data to the X server, if
- * necessary.
- */
-
- if (instancePtr->colorTablePtr->flags & BLACK_AND_WHITE) {
- bitsPerPixel = 1;
- } else {
- bitsPerPixel = instancePtr->visualInfo.depth;
- }
-
- if ((instancePtr->imagePtr == NULL)
- || (instancePtr->imagePtr->bits_per_pixel != bitsPerPixel)) {
- if (instancePtr->imagePtr != NULL) {
- XDestroyImage(instancePtr->imagePtr);
- }
- imagePtr = XCreateImage(instancePtr->display,
- instancePtr->visualInfo.visual, (unsigned) bitsPerPixel,
- (bitsPerPixel > 1? ZPixmap: XYBitmap), 0, NULL,
- 1, 1, 32, 0);
- instancePtr->imagePtr = imagePtr;
-
- /*
- * We create images using the local host's endianness, rather than
- * the endianness of the server; otherwise we would have to
- * byte-swap any 16 or 32 bit values that we store in the image
- * if the server's endianness is different from ours.
- */
-
- if (imagePtr != NULL) {
-#ifdef WORDS_BIGENDIAN
- imagePtr->byte_order = MSBFirst;
-#else
- imagePtr->byte_order = LSBFirst;
-#endif
- _XInitImageFuncPtrs(imagePtr);
- }
- }
- }
-
- /*
- * If the user has specified a width and/or height for the master which is
- * different from our current width/height, set the size to the values
- * specified by the user. If we have no pixmap, we do this also, since it
- * has the side effect of allocating a pixmap for us.
- */
-
- if ((instancePtr->pixels == None) || (instancePtr->error == NULL)
- || (instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)) {
- ImgPhotoInstanceSetSize(instancePtr);
- }
-
- /*
- * Redither this instance if necessary.
- */
-
- if ((masterPtr->flags & IMAGE_CHANGED)
- || (instancePtr->colorTablePtr != colorTablePtr)) {
- TkClipBox(masterPtr->validRegion, &validBox);
- if ((validBox.width > 0) && (validBox.height > 0)) {
- DitherInstance(instancePtr, validBox.x, validBox.y,
- validBox.width, validBox.height);
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImgPhotoGet --
- *
- * This function is called for each use of a photo image in a widget.
- *
- * Results:
- * The return value is a token for the instance, which is passed back to
- * us in calls to ImgPhotoDisplay and ImgPhotoFree.
- *
- * Side effects:
- * A data structure is set up for the instance (or, an existing instance
- * is re-used for the new one).
- *
- *----------------------------------------------------------------------
- */
-
-static ClientData
-ImgPhotoGet(
- Tk_Window tkwin, /* Window in which the instance will be
- * used. */
- ClientData masterData) /* Pointer to our master structure for the
- * image. */
-{
- PhotoMaster *masterPtr = (PhotoMaster *) masterData;
- PhotoInstance *instancePtr;
- Colormap colormap;
- int mono, nRed, nGreen, nBlue, numVisuals;
- XVisualInfo visualInfo, *visInfoPtr;
- char buf[TCL_INTEGER_SPACE * 3];
- XColor *white, *black;
- XGCValues gcValues;
-
- /*
- * Table of "best" choices for palette for PseudoColor displays with
- * between 3 and 15 bits/pixel.
- */
-
- static const int paletteChoice[13][3] = {
- /* #red, #green, #blue */
- {2, 2, 2, /* 3 bits, 8 colors */},
- {2, 3, 2, /* 4 bits, 12 colors */},
- {3, 4, 2, /* 5 bits, 24 colors */},
- {4, 5, 3, /* 6 bits, 60 colors */},
- {5, 6, 4, /* 7 bits, 120 colors */},
- {7, 7, 4, /* 8 bits, 198 colors */},
- {8, 10, 6, /* 9 bits, 480 colors */},
- {10, 12, 8, /* 10 bits, 960 colors */},
- {14, 15, 9, /* 11 bits, 1890 colors */},
- {16, 20, 12, /* 12 bits, 3840 colors */},
- {20, 24, 16, /* 13 bits, 7680 colors */},
- {26, 30, 20, /* 14 bits, 15600 colors */},
- {32, 32, 30, /* 15 bits, 30720 colors */}
- };
-
- /*
- * See if there is already an instance for windows using the same
- * colormap. If so then just re-use it.
- */
-
- colormap = Tk_Colormap(tkwin);
- for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
- instancePtr = instancePtr->nextPtr) {
- if ((colormap == instancePtr->colormap)
- && (Tk_Display(tkwin) == instancePtr->display)) {
- /*
- * Re-use this instance.
- */
-
- if (instancePtr->refCount == 0) {
- /*
- * We are resurrecting this instance.
- */
-
- Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr);
- if (instancePtr->colorTablePtr != NULL) {
- FreeColorTable(instancePtr->colorTablePtr, 0);
- }
- GetColorTable(instancePtr);
- }
- instancePtr->refCount++;
- return (ClientData) instancePtr;
- }
- }
-
- /*
- * The image isn't already in use in a window with the same colormap. Make
- * a new instance of the image.
- */
-
- instancePtr = (PhotoInstance *) ckalloc(sizeof(PhotoInstance));
- instancePtr->masterPtr = masterPtr;
- instancePtr->display = Tk_Display(tkwin);
- instancePtr->colormap = Tk_Colormap(tkwin);
- Tk_PreserveColormap(instancePtr->display, instancePtr->colormap);
- instancePtr->refCount = 1;
- instancePtr->colorTablePtr = NULL;
- instancePtr->pixels = None;
- instancePtr->error = NULL;
- instancePtr->width = 0;
- instancePtr->height = 0;
- instancePtr->imagePtr = 0;
- instancePtr->nextPtr = masterPtr->instancePtr;
- masterPtr->instancePtr = instancePtr;
-
- /*
- * Obtain information about the visual and decide on the default palette.
- */
-
- visualInfo.screen = Tk_ScreenNumber(tkwin);
- visualInfo.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
- visInfoPtr = XGetVisualInfo(Tk_Display(tkwin),
- VisualScreenMask | VisualIDMask, &visualInfo, &numVisuals);
- if (visInfoPtr == NULL) {
- Tcl_Panic("ImgPhotoGet couldn't find visual for window");
- }
-
- nRed = 2;
- nGreen = nBlue = 0;
- mono = 1;
- instancePtr->visualInfo = *visInfoPtr;
- switch (visInfoPtr->class) {
- case DirectColor:
- case TrueColor:
- nRed = 1 << CountBits(visInfoPtr->red_mask);
- nGreen = 1 << CountBits(visInfoPtr->green_mask);
- nBlue = 1 << CountBits(visInfoPtr->blue_mask);
- mono = 0;
- break;
- case PseudoColor:
- case StaticColor:
- if (visInfoPtr->depth > 15) {
- nRed = 32;
- nGreen = 32;
- nBlue = 32;
- mono = 0;
- } else if (visInfoPtr->depth >= 3) {
- const int *ip = paletteChoice[visInfoPtr->depth - 3];
-
- nRed = ip[0];
- nGreen = ip[1];
- nBlue = ip[2];
- mono = 0;
- }
- break;
- case GrayScale:
- case StaticGray:
- nRed = 1 << visInfoPtr->depth;
- break;
- }
- XFree((char *) visInfoPtr);
-
- sprintf(buf, ((mono) ? "%d": "%d/%d/%d"), nRed, nGreen, nBlue);
- instancePtr->defaultPalette = Tk_GetUid(buf);
-
- /*
- * Make a GC with background = black and foreground = white.
- */
-
- white = Tk_GetColor(masterPtr->interp, tkwin, "white");
- black = Tk_GetColor(masterPtr->interp, tkwin, "black");
- gcValues.foreground = (white != NULL)? white->pixel:
- WhitePixelOfScreen(Tk_Screen(tkwin));
- gcValues.background = (black != NULL)? black->pixel:
- BlackPixelOfScreen(Tk_Screen(tkwin));
- Tk_FreeColor(white);
- Tk_FreeColor(black);
- 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);
-
- /*
- * If this is the first instance, must set the size of the image.
- */
-
- if (instancePtr->nextPtr == NULL) {
- Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0,
- masterPtr->width, masterPtr->height);
- }
-
- return (ClientData) instancePtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* ToggleComplexAlphaIfNeeded --
*
* This function is called when an image is modified to check if any
@@ -2535,349 +2027,6 @@ ToggleComplexAlphaIfNeeded(
/*
*----------------------------------------------------------------------
*
- * ImgPhotoBlendComplexAlpha --
- *
- * This function is called when an image with partially transparent
- * pixels must be drawn over another image. It blends the photo data onto
- * a local copy of the surface that we are drawing on, *including* the
- * pixels drawn by everything that should be drawn underneath the image.
- *
- * Much of this code has hard-coded values in for speed because this
- * routine is performance critical for complex image drawing.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Background image passed in gets drawn over with image data.
- *
- * Notes:
- * This should work on all platforms that set mask and shift data
- * properly from the visualInfo. RGB is really only a 24+ bpp version
- * whereas RGB15 is the correct version and works for 15bpp+, but it
- * slower, so it's only used for 15bpp+.
- *
- * Note that Win32 pre-defines those operations that we really need.
- *
- *----------------------------------------------------------------------
- */
-
-#ifndef __WIN32__
-#define GetRValue(rgb) (UCHAR(((rgb) & red_mask) >> red_shift))
-#define GetGValue(rgb) (UCHAR(((rgb) & green_mask) >> green_shift))
-#define GetBValue(rgb) (UCHAR(((rgb) & blue_mask) >> blue_shift))
-#define RGB(r, g, b) ((unsigned)( \
- (UCHAR(r) << red_shift) | \
- (UCHAR(g) << green_shift) | \
- (UCHAR(b) << blue_shift) ))
-#define RGB15(r, g, b) ((unsigned)( \
- (((r) * red_mask / 255) & red_mask) | \
- (((g) * green_mask / 255) & green_mask) | \
- (((b) * blue_mask / 255) & blue_mask) ))
-#endif /* !__WIN32__ */
-
-static void
-ImgPhotoBlendComplexAlpha(
- XImage *bgImg, /* Background image to draw on. */
- PhotoInstance *iPtr, /* Image instance to draw. */
- int xOffset, int yOffset, /* X & Y offset into image instance to
- * draw. */
- int width, int height) /* Width & height of image to draw. */
-{
- int x, y, line;
- unsigned long pixel;
- unsigned char r, g, b, alpha, unalpha, *masterPtr;
- unsigned char *alphaAr = iPtr->masterPtr->pix32;
-
- /*
- * This blending is an integer version of the Source-Over compositing rule
- * (see Porter&Duff, "Compositing Digital Images", proceedings of SIGGRAPH
- * 1984) that has been hard-coded (for speed) to work with targetting a
- * solid surface.
- *
- * The 'unalpha' field must be 255-alpha; it is separated out to encourage
- * more efficient compilation.
- */
-
-#define ALPHA_BLEND(bgPix, imgPix, alpha, unalpha) \
- ((bgPix * unalpha + imgPix * alpha) / 255)
-
- /*
- * We have to get the mask and shift info from the visual on non-Win32 so
- * that the macros Get*Value(), RGB() and RGB15() work correctly. This
- * might be cached for better performance.
- */
-
-#ifndef __WIN32__
- unsigned long red_mask, green_mask, blue_mask;
- unsigned long red_shift, green_shift, blue_shift;
- Visual *visual = iPtr->visualInfo.visual;
-
- red_mask = visual->red_mask;
- green_mask = visual->green_mask;
- blue_mask = visual->blue_mask;
- red_shift = 0;
- green_shift = 0;
- blue_shift = 0;
- while ((0x0001 & (red_mask >> red_shift)) == 0) {
- red_shift++;
- }
- while ((0x0001 & (green_mask >> green_shift)) == 0) {
- green_shift++;
- }
- while ((0x0001 & (blue_mask >> blue_shift)) == 0) {
- blue_shift++;
- }
-#endif /* !__WIN32__ */
-
- /*
- * Only UNIX requires the special case for <24bpp. It varies with 3 extra
- * shifts and uses RGB15. The 24+bpp version could also then be further
- * optimized.
- */
-
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
- if (bgImg->depth < 24) {
- unsigned char red_mlen, green_mlen, blue_mlen;
-
- red_mlen = 8 - CountBits(red_mask >> red_shift);
- green_mlen = 8 - CountBits(green_mask >> green_shift);
- blue_mlen = 8 - CountBits(blue_mask >> blue_shift);
- for (y = 0; y < height; y++) {
- line = (y + yOffset) * iPtr->masterPtr->width;
- for (x = 0; x < width; x++) {
- masterPtr = alphaAr + ((line + x + xOffset) * 4);
- alpha = masterPtr[3];
-
- /*
- * Ignore pixels that are fully transparent
- */
-
- if (alpha) {
- /*
- * We could perhaps be more efficient than XGetPixel for
- * 24 and 32 bit displays, but this seems "fast enough".
- */
-
- r = masterPtr[0];
- g = masterPtr[1];
- b = masterPtr[2];
- if (alpha != 255) {
- /*
- * Only blend pixels that have some transparency
- */
-
- unsigned char ra, ga, ba;
-
- pixel = XGetPixel(bgImg, x, y);
- ra = GetRValue(pixel) << red_mlen;
- ga = GetGValue(pixel) << green_mlen;
- ba = GetBValue(pixel) << blue_mlen;
- unalpha = 255 - alpha; /* Calculate once. */
- r = ALPHA_BLEND(ra, r, alpha, unalpha);
- g = ALPHA_BLEND(ga, g, alpha, unalpha);
- b = ALPHA_BLEND(ba, b, alpha, unalpha);
- }
- XPutPixel(bgImg, x, y, RGB15(r, g, b));
- }
- }
- }
- return;
- }
-#endif /* !__WIN32__ && !MAC_OSX_TK */
-
- for (y = 0; y < height; y++) {
- line = (y + yOffset) * iPtr->masterPtr->width;
- for (x = 0; x < width; x++) {
- masterPtr = alphaAr + ((line + x + xOffset) * 4);
- alpha = masterPtr[3];
-
- /*
- * Ignore pixels that are fully transparent
- */
-
- if (alpha) {
- /*
- * We could perhaps be more efficient than XGetPixel for 24
- * and 32 bit displays, but this seems "fast enough".
- */
-
- r = masterPtr[0];
- g = masterPtr[1];
- b = masterPtr[2];
- if (alpha != 255) {
- /*
- * Only blend pixels that have some transparency
- */
-
- unsigned char ra, ga, ba;
-
- pixel = XGetPixel(bgImg, x, y);
- ra = GetRValue(pixel);
- ga = GetGValue(pixel);
- ba = GetBValue(pixel);
- unalpha = 255 - alpha; /* Calculate once. */
- r = ALPHA_BLEND(ra, r, alpha, unalpha);
- g = ALPHA_BLEND(ga, g, alpha, unalpha);
- b = ALPHA_BLEND(ba, b, alpha, unalpha);
- }
- XPutPixel(bgImg, x, y, RGB(r, g, b));
- }
- }
- }
-#undef ALPHA_BLEND
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImgPhotoDisplay --
- *
- * This function is invoked to draw a photo image.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A portion of the image gets rendered in a pixmap or window.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImgPhotoDisplay(
- ClientData clientData, /* Pointer to PhotoInstance structure for
- * instance to be displayed. */
- Display *display, /* Display on which to draw image. */
- Drawable drawable, /* Pixmap or window in which to draw image. */
- int imageX, int imageY, /* Upper-left corner of region within image to
- * draw. */
- int width, int height, /* Dimensions of region within image to
- * draw. */
- int drawableX,int drawableY)/* Coordinates within drawable that correspond
- * to imageX and imageY. */
-{
- PhotoInstance *instancePtr = (PhotoInstance *) clientData;
- XVisualInfo visInfo = instancePtr->visualInfo;
-
- /*
- * If there's no pixmap, it means that an error occurred while creating
- * the image instance so it can't be displayed.
- */
-
- if (instancePtr->pixels == None) {
- return;
- }
-
- if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA)
- && visInfo.depth >= 15
- && (visInfo.class == DirectColor || visInfo.class == TrueColor)) {
- Tk_ErrorHandler handler;
- XImage *bgImg = NULL;
-
- /*
- * Create an error handler to suppress the case where the input was
- * not properly constrained, which can cause an X error. [Bug 979239]
- */
-
- handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL,
- (ClientData) NULL);
-
- /*
- * Pull the current background from the display to blend with
- */
-
- bgImg = XGetImage(display, drawable, drawableX, drawableY,
- (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap);
- if (bgImg == NULL) {
- Tk_DeleteErrorHandler(handler);
- return;
- }
-
- ImgPhotoBlendComplexAlpha(bgImg, instancePtr, imageX, imageY, width,
- height);
-
- /*
- * Color info is unimportant as we only do this operation for depth >=
- * 15.
- */
-
- TkPutImage(NULL, 0, display, drawable, instancePtr->gc,
- bgImg, 0, 0, drawableX, drawableY,
- (unsigned int) width, (unsigned int) height);
- XDestroyImage(bgImg);
- Tk_DeleteErrorHandler(handler);
- } else {
- /*
- * masterPtr->region describes which parts of the image contain valid
- * data. We set this region as the clip mask for the gc, setting its
- * origin appropriately, and use it when drawing the image.
- */
-
- TkSetRegion(display, instancePtr->gc,
- instancePtr->masterPtr->validRegion);
- XSetClipOrigin(display, instancePtr->gc, drawableX - imageX,
- drawableY - imageY);
- XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc,
- imageX, imageY, (unsigned) width, (unsigned) height,
- drawableX, drawableY);
- XSetClipMask(display, instancePtr->gc, None);
- XSetClipOrigin(display, instancePtr->gc, 0, 0);
- }
- XFlush(display);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ImgPhotoFree --
- *
- * This function is called when a widget ceases to use a particular
- * instance of an image. We don't actually get rid of the instance until
- * later because we may be about to get this instance again.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Internal data structures get cleaned up, later.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImgPhotoFree(
- ClientData clientData, /* Pointer to PhotoInstance structure for
- * instance to be displayed. */
- Display *display) /* Display containing window that used
- * image. */
-{
- PhotoInstance *instancePtr = (PhotoInstance *) clientData;
- ColorTable *colorPtr;
-
- instancePtr->refCount -= 1;
- if (instancePtr->refCount > 0) {
- return;
- }
-
- /*
- * There are no more uses of the image within this widget. Decrement the
- * count of live uses of its color table, so that its colors can be
- * reclaimed if necessary, and set up an idle call to free the instance
- * structure.
- */
-
- colorPtr = instancePtr->colorTablePtr;
- if (colorPtr != NULL) {
- colorPtr->liveRefCount -= 1;
- }
-
- Tcl_DoWhenIdle(DisposeInstance, (ClientData) instancePtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* ImgPhotoDelete --
*
* This function is called by the image code to delete the master
@@ -2897,22 +2046,22 @@ ImgPhotoDelete(
ClientData masterData) /* Pointer to PhotoMaster structure for image.
* Must not have any more instances. */
{
- PhotoMaster *masterPtr = (PhotoMaster *) masterData;
+ PhotoMaster *masterPtr = masterData;
PhotoInstance *instancePtr;
while ((instancePtr = masterPtr->instancePtr) != NULL) {
if (instancePtr->refCount > 0) {
Tcl_Panic("tried to delete photo image when instances still exist");
}
- Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr);
- DisposeInstance((ClientData) instancePtr);
+ Tcl_CancelIdleCall(TkImgDisposeInstance, instancePtr);
+ TkImgDisposeInstance(instancePtr);
}
masterPtr->tkMaster = NULL;
if (masterPtr->imageCmd != NULL) {
Tcl_DeleteCommandFromToken(masterPtr->interp, masterPtr->imageCmd);
}
if (masterPtr->pix32 != NULL) {
- ckfree((char *) masterPtr->pix32);
+ ckfree(masterPtr->pix32);
}
if (masterPtr->validRegion != NULL) {
TkDestroyRegion(masterPtr->validRegion);
@@ -2924,7 +2073,7 @@ ImgPhotoDelete(
Tcl_DecrRefCount(masterPtr->format);
}
Tk_FreeOptions(configSpecs, (char *) masterPtr, NULL, 0);
- ckfree((char *) masterPtr);
+ ckfree(masterPtr);
}
/*
@@ -2949,7 +2098,7 @@ ImgPhotoCmdDeletedProc(
ClientData clientData) /* Pointer to PhotoMaster structure for
* image. */
{
- PhotoMaster *masterPtr = (PhotoMaster *) clientData;
+ PhotoMaster *masterPtr = clientData;
masterPtr->imageCmd = NULL;
if (masterPtr->tkMaster != NULL) {
@@ -3017,7 +2166,7 @@ ImgPhotoSetSize(
if (newPixSize == 0) {
newPix32 = NULL;
} else {
- newPix32 = (unsigned char *) attemptckalloc(newPixSize);
+ newPix32 = attemptckalloc(newPixSize);
if (newPix32 == NULL) {
return TCL_ERROR;
}
@@ -3101,7 +2250,7 @@ ImgPhotoSetSize(
}
}
- ckfree((char *) masterPtr->pix32);
+ ckfree(masterPtr->pix32);
}
masterPtr->pix32 = newPix32;
@@ -3136,7 +2285,7 @@ ImgPhotoSetSize(
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
- ImgPhotoInstanceSetSize(instancePtr);
+ TkImgPhotoInstanceSetSize(instancePtr);
}
return TCL_OK;
@@ -3145,867 +2294,6 @@ ImgPhotoSetSize(
/*
*----------------------------------------------------------------------
*
- * ImgPhotoInstanceSetSize --
- *
- * This function reallocates the instance pixmap and dithering error
- * array for a photo instance, as necessary, to change the image's size
- * to `width' x `height' pixels.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Storage gets reallocated, here and in the X server.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-ImgPhotoInstanceSetSize(
- PhotoInstance *instancePtr) /* Instance whose size is to be changed. */
-{
- PhotoMaster *masterPtr;
- schar *newError, *errSrcPtr, *errDestPtr;
- int h, offset;
- XRectangle validBox;
- Pixmap newPixmap;
-
- masterPtr = instancePtr->masterPtr;
- TkClipBox(masterPtr->validRegion, &validBox);
-
- if ((instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)
- || (instancePtr->pixels == None)) {
- newPixmap = Tk_GetPixmap(instancePtr->display,
- RootWindow(instancePtr->display,
- instancePtr->visualInfo.screen),
- (masterPtr->width > 0) ? masterPtr->width: 1,
- (masterPtr->height > 0) ? masterPtr->height: 1,
- instancePtr->visualInfo.depth);
- if (!newPixmap) {
- Tcl_Panic("Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize.\n");
- }
-
- /*
- * The following is a gross hack needed to properly support colormaps
- * under Windows. Before the pixels can be copied to the pixmap, the
- * relevent colormap must be associated with the drawable. Normally we
- * can infer this association from the window that was used to create
- * the pixmap. However, in this case we're using the root window, so
- * we have to be more explicit.
- */
-
- TkSetPixmapColormap(newPixmap, instancePtr->colormap);
-
- if (instancePtr->pixels != None) {
- /*
- * Copy any common pixels from the old pixmap and free it.
- */
-
- XCopyArea(instancePtr->display, instancePtr->pixels, newPixmap,
- instancePtr->gc, validBox.x, validBox.y,
- validBox.width, validBox.height, validBox.x, validBox.y);
- Tk_FreePixmap(instancePtr->display, instancePtr->pixels);
- }
- instancePtr->pixels = newPixmap;
- }
-
- if ((instancePtr->width != masterPtr->width)
- || (instancePtr->height != masterPtr->height)
- || (instancePtr->error == NULL)) {
-
- if (masterPtr->height > 0 && masterPtr->width > 0) {
- newError = (schar *) ckalloc((unsigned)
- masterPtr->height * masterPtr->width * 3 * sizeof(schar));
-
- /*
- * Zero the new array so that we don't get bogus error values
- * propagating into areas we dither later.
- */
-
- if ((instancePtr->error != NULL)
- && ((instancePtr->width == masterPtr->width)
- || (validBox.width == masterPtr->width))) {
- if (validBox.y > 0) {
- memset(newError, 0, (size_t)
- validBox.y * masterPtr->width * 3 * sizeof(schar));
- }
- h = validBox.y + validBox.height;
- if (h < masterPtr->height) {
- memset(newError + h*masterPtr->width*3, 0,
- (size_t) (masterPtr->height - h)
- * masterPtr->width * 3 * sizeof(schar));
- }
- } else {
- memset(newError, 0, (size_t)
- masterPtr->height * masterPtr->width *3*sizeof(schar));
- }
- } else {
- newError = NULL;
- }
-
- if (instancePtr->error != NULL) {
- /*
- * Copy the common area over to the new array and free the old
- * array.
- */
-
- if (masterPtr->width == instancePtr->width) {
- offset = validBox.y * masterPtr->width * 3;
- memcpy(newError + offset, instancePtr->error + offset,
- (size_t) (validBox.height
- * masterPtr->width * 3 * sizeof(schar)));
-
- } else if (validBox.width > 0 && validBox.height > 0) {
- errDestPtr = newError +
- (validBox.y * masterPtr->width + validBox.x) * 3;
- errSrcPtr = instancePtr->error +
- (validBox.y * instancePtr->width + validBox.x) * 3;
-
- for (h = validBox.height; h > 0; --h) {
- memcpy(errDestPtr, errSrcPtr,
- validBox.width * 3 * sizeof(schar));
- errDestPtr += masterPtr->width * 3;
- errSrcPtr += instancePtr->width * 3;
- }
- }
- ckfree((char *) instancePtr->error);
- }
-
- instancePtr->error = newError;
- }
-
- instancePtr->width = masterPtr->width;
- instancePtr->height = masterPtr->height;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * IsValidPalette --
- *
- * This function is called to check whether a value given for the
- * -palette option is valid for a particular instance of a photo image.
- *
- * Results:
- * A boolean value: 1 if the palette is acceptable, 0 otherwise.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-IsValidPalette(
- PhotoInstance *instancePtr, /* Instance to which the palette specification
- * is to be applied. */
- const char *palette) /* Palette specification string. */
-{
- int nRed, nGreen, nBlue, mono, numColors;
- char *endp;
-
- /*
- * First parse the specification: it must be of the form %d or %d/%d/%d.
- */
-
- nRed = strtol(palette, &endp, 10);
- if ((endp == palette) || ((*endp != 0) && (*endp != '/'))
- || (nRed < 2) || (nRed > 256)) {
- return 0;
- }
-
- if (*endp == 0) {
- mono = 1;
- nGreen = nBlue = nRed;
- } else {
- palette = endp + 1;
- nGreen = strtol(palette, &endp, 10);
- if ((endp == palette) || (*endp != '/') || (nGreen < 2)
- || (nGreen > 256)) {
- return 0;
- }
- palette = endp + 1;
- nBlue = strtol(palette, &endp, 10);
- if ((endp == palette) || (*endp != 0) || (nBlue < 2)
- || (nBlue > 256)) {
- return 0;
- }
- mono = 0;
- }
-
- switch (instancePtr->visualInfo.class) {
- case DirectColor:
- case TrueColor:
- if ((nRed > (1 << CountBits(instancePtr->visualInfo.red_mask)))
- || (nGreen>(1<<CountBits(instancePtr->visualInfo.green_mask)))
- || (nBlue>(1<<CountBits(instancePtr->visualInfo.blue_mask)))) {
- return 0;
- }
- break;
- case PseudoColor:
- case StaticColor:
- numColors = nRed;
- if (!mono) {
- numColors *= nGreen*nBlue;
- }
- if (numColors > (1 << instancePtr->visualInfo.depth)) {
- return 0;
- }
- break;
- case GrayScale:
- case StaticGray:
- if (!mono || (nRed > (1 << instancePtr->visualInfo.depth))) {
- return 0;
- }
- break;
- }
-
- return 1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * CountBits --
- *
- * This function counts how many bits are set to 1 in `mask'.
- *
- * Results:
- * The integer number of bits.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-CountBits(
- pixel mask) /* Value to count the 1 bits in. */
-{
- int n;
-
- for (n=0 ; mask!=0 ; mask&=mask-1) {
- n++;
- }
- return n;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetColorTable --
- *
- * This function is called to allocate a table of colormap information
- * for an instance of a photo image. Only one such table is allocated for
- * all photo instances using the same display, colormap, palette and
- * gamma values, so that the application need only request a set of
- * colors from the X server once for all such photo widgets. This
- * function maintains a hash table to find previously-allocated
- * ColorTables.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A new ColorTable may be allocated and placed in the hash table, and
- * have colors allocated for it.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-GetColorTable(
- PhotoInstance *instancePtr) /* Instance needing a color table. */
-{
- ColorTable *colorPtr;
- Tcl_HashEntry *entry;
- ColorTableId id;
- int isNew;
-
- /*
- * Look for an existing ColorTable in the hash table.
- */
-
- memset(&id, 0, sizeof(id));
- id.display = instancePtr->display;
- id.colormap = instancePtr->colormap;
- id.palette = instancePtr->palette;
- id.gamma = instancePtr->gamma;
- if (!imgPhotoColorHashInitialized) {
- Tcl_InitHashTable(&imgPhotoColorHash, N_COLOR_HASH);
- imgPhotoColorHashInitialized = 1;
- }
- entry = Tcl_CreateHashEntry(&imgPhotoColorHash, (char *) &id, &isNew);
-
- if (!isNew) {
- /*
- * Re-use the existing entry.
- */
-
- colorPtr = (ColorTable *) Tcl_GetHashValue(entry);
- } else {
- /*
- * No color table currently available; need to make one.
- */
-
- colorPtr = (ColorTable *) ckalloc(sizeof(ColorTable));
-
- /*
- * The following line of code should not normally be needed due to the
- * assignment in the following line. However, it compensates for bugs
- * in some compilers (HP, for example) where sizeof(ColorTable) is 24
- * but the assignment only copies 20 bytes, leaving 4 bytes
- * uninitialized; these cause problems when using the id for lookups
- * in imgPhotoColorHash, and can result in core dumps.
- */
-
- memset(&colorPtr->id, 0, sizeof(ColorTableId));
- colorPtr->id = id;
- Tk_PreserveColormap(colorPtr->id.display, colorPtr->id.colormap);
- colorPtr->flags = 0;
- colorPtr->refCount = 0;
- colorPtr->liveRefCount = 0;
- colorPtr->numColors = 0;
- colorPtr->visualInfo = instancePtr->visualInfo;
- colorPtr->pixelMap = NULL;
- Tcl_SetHashValue(entry, colorPtr);
- }
-
- colorPtr->refCount++;
- colorPtr->liveRefCount++;
- instancePtr->colorTablePtr = colorPtr;
- if (colorPtr->flags & DISPOSE_PENDING) {
- Tcl_CancelIdleCall(DisposeColorTable, (ClientData) colorPtr);
- colorPtr->flags &= ~DISPOSE_PENDING;
- }
-
- /*
- * Allocate colors for this color table if necessary.
- */
-
- if ((colorPtr->numColors == 0)
- && ((colorPtr->flags & BLACK_AND_WHITE) == 0)) {
- AllocateColors(colorPtr);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * FreeColorTable --
- *
- * This function is called when an instance ceases using a color table.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If no other instances are using this color table, a when-idle handler
- * is registered to free up the color table and the colors allocated for
- * it.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-FreeColorTable(
- ColorTable *colorPtr, /* Pointer to the color table which is no
- * longer required by an instance. */
- int force) /* Force free to happen immediately. */
-{
- colorPtr->refCount--;
- if (colorPtr->refCount > 0) {
- return;
- }
-
- if (force) {
- if ((colorPtr->flags & DISPOSE_PENDING) != 0) {
- Tcl_CancelIdleCall(DisposeColorTable, (ClientData) colorPtr);
- colorPtr->flags &= ~DISPOSE_PENDING;
- }
- DisposeColorTable((ClientData) colorPtr);
- } else if ((colorPtr->flags & DISPOSE_PENDING) == 0) {
- Tcl_DoWhenIdle(DisposeColorTable, (ClientData) colorPtr);
- colorPtr->flags |= DISPOSE_PENDING;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * AllocateColors --
- *
- * This function allocates the colors required by a color table, and sets
- * up the fields in the color table data structure which are used in
- * dithering.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Colors are allocated from the X server. Fields in the color table data
- * structure are updated.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-AllocateColors(
- ColorTable *colorPtr) /* Pointer to the color table requiring colors
- * to be allocated. */
-{
- int i, r, g, b, rMult, mono;
- int numColors, nRed, nGreen, nBlue;
- double fr, fg, fb, igam;
- XColor *colors;
- unsigned long *pixels;
-
- /*
- * 16-bit intensity value for i/n of full intensity.
- */
-#define CFRAC(i, n) ((i) * 65535 / (n))
-
- /* As for CFRAC, but apply exponent of g. */
-#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
-
- /*
- * First parse the palette specification to get the required number of
- * shades of each primary.
- */
-
- mono = sscanf(colorPtr->id.palette, "%d/%d/%d", &nRed, &nGreen, &nBlue)
- <= 1;
- igam = 1.0 / colorPtr->id.gamma;
-
- /*
- * Each time around this loop, we reduce the number of colors we're trying
- * to allocate until we succeed in allocating all of the colors we need.
- */
-
- for (;;) {
- /*
- * If we are using 1 bit/pixel, we don't need to allocate any colors
- * (we just use the foreground and background colors in the GC).
- */
-
- if (mono && (nRed <= 2)) {
- colorPtr->flags |= BLACK_AND_WHITE;
- return;
- }
-
- /*
- * Calculate the RGB coordinates of the colors we want to allocate and
- * store them in *colors.
- */
-
- if ((colorPtr->visualInfo.class == DirectColor)
- || (colorPtr->visualInfo.class == TrueColor)) {
-
- /*
- * Direct/True Color: allocate shades of red, green, blue
- * independently.
- */
-
- if (mono) {
- numColors = nGreen = nBlue = nRed;
- } else {
- numColors = MAX(MAX(nRed, nGreen), nBlue);
- }
- colors = (XColor *) ckalloc(numColors * sizeof(XColor));
-
- for (i = 0; i < numColors; ++i) {
- if (igam == 1.0) {
- colors[i].red = CFRAC(i, nRed - 1);
- colors[i].green = CFRAC(i, nGreen - 1);
- colors[i].blue = CFRAC(i, nBlue - 1);
- } else {
- colors[i].red = CGFRAC(i, nRed - 1, igam);
- colors[i].green = CGFRAC(i, nGreen - 1, igam);
- colors[i].blue = CGFRAC(i, nBlue - 1, igam);
- }
- }
- } else {
- /*
- * PseudoColor, StaticColor, GrayScale or StaticGray visual: we
- * have to allocate each color in the color cube separately.
- */
-
- numColors = (mono) ? nRed: (nRed * nGreen * nBlue);
- colors = (XColor *) ckalloc(numColors * sizeof(XColor));
-
- if (!mono) {
- /*
- * Color display using a PseudoColor or StaticColor visual.
- */
-
- i = 0;
- for (r = 0; r < nRed; ++r) {
- for (g = 0; g < nGreen; ++g) {
- for (b = 0; b < nBlue; ++b) {
- if (igam == 1.0) {
- colors[i].red = CFRAC(r, nRed - 1);
- colors[i].green = CFRAC(g, nGreen - 1);
- colors[i].blue = CFRAC(b, nBlue - 1);
- } else {
- colors[i].red = CGFRAC(r, nRed - 1, igam);
- colors[i].green = CGFRAC(g, nGreen - 1, igam);
- colors[i].blue = CGFRAC(b, nBlue - 1, igam);
- }
- i++;
- }
- }
- }
- } else {
- /*
- * Monochrome display - allocate the shades of grey we want.
- */
-
- for (i = 0; i < numColors; ++i) {
- if (igam == 1.0) {
- r = CFRAC(i, numColors - 1);
- } else {
- r = CGFRAC(i, numColors - 1, igam);
- }
- colors[i].red = colors[i].green = colors[i].blue = r;
- }
- }
- }
-
- /*
- * Now try to allocate the colors we've calculated.
- */
-
- pixels = (unsigned long *) ckalloc(numColors * sizeof(unsigned long));
- for (i = 0; i < numColors; ++i) {
- if (!XAllocColor(colorPtr->id.display, colorPtr->id.colormap,
- &colors[i])) {
- /*
- * Can't get all the colors we want in the default colormap;
- * first try freeing colors from other unused color tables.
- */
-
- if (!ReclaimColors(&colorPtr->id, numColors - i)
- || !XAllocColor(colorPtr->id.display,
- colorPtr->id.colormap, &colors[i])) {
- /*
- * Still can't allocate the color.
- */
-
- break;
- }
- }
- pixels[i] = colors[i].pixel;
- }
-
- /*
- * If we didn't get all of the colors, reduce the resolution of the
- * color cube, free the ones we got, and try again.
- */
-
- if (i >= numColors) {
- break;
- }
- XFreeColors(colorPtr->id.display, colorPtr->id.colormap, pixels, i, 0);
- ckfree((char *) colors);
- ckfree((char *) pixels);
-
- if (!mono) {
- if ((nRed == 2) && (nGreen == 2) && (nBlue == 2)) {
- /*
- * Fall back to 1-bit monochrome display.
- */
-
- mono = 1;
- } else {
- /*
- * Reduce the number of shades of each primary to about 3/4 of
- * the previous value. This should reduce the total number of
- * colors required to about half the previous value for
- * PseudoColor displays.
- */
-
- nRed = (nRed * 3 + 2) / 4;
- nGreen = (nGreen * 3 + 2) / 4;
- nBlue = (nBlue * 3 + 2) / 4;
- }
- } else {
- /*
- * Reduce the number of shades of gray to about 1/2.
- */
-
- nRed = nRed / 2;
- }
- }
-
- /*
- * We have allocated all of the necessary colors: fill in various fields
- * of the ColorTable record.
- */
-
- if (!mono) {
- colorPtr->flags |= COLOR_WINDOW;
-
- /*
- * The following is a hairy hack. We only want to index into the
- * pixelMap on colormap displays. However, if the display is on
- * Windows, then we actually want to store the index not the value
- * since we will be passing the color table into the TkPutImage call.
- */
-
-#ifndef __WIN32__
- if ((colorPtr->visualInfo.class != DirectColor)
- && (colorPtr->visualInfo.class != TrueColor)) {
- colorPtr->flags |= MAP_COLORS;
- }
-#endif /* __WIN32__ */
- }
-
- colorPtr->numColors = numColors;
- colorPtr->pixelMap = pixels;
-
- /*
- * Set up quantization tables for dithering.
- */
-
- rMult = nGreen * nBlue;
- for (i = 0; i < 256; ++i) {
- r = (i * (nRed - 1) + 127) / 255;
- if (mono) {
- fr = (double) colors[r].red / 65535.0;
- if (colorPtr->id.gamma != 1.0 ) {
- fr = pow(fr, colorPtr->id.gamma);
- }
- colorPtr->colorQuant[0][i] = (int)(fr * 255.99);
- colorPtr->redValues[i] = colors[r].pixel;
- } else {
- g = (i * (nGreen - 1) + 127) / 255;
- b = (i * (nBlue - 1) + 127) / 255;
- if ((colorPtr->visualInfo.class == DirectColor)
- || (colorPtr->visualInfo.class == TrueColor)) {
- colorPtr->redValues[i] =
- colors[r].pixel & colorPtr->visualInfo.red_mask;
- colorPtr->greenValues[i] =
- colors[g].pixel & colorPtr->visualInfo.green_mask;
- colorPtr->blueValues[i] =
- colors[b].pixel & colorPtr->visualInfo.blue_mask;
- } else {
- r *= rMult;
- g *= nBlue;
- colorPtr->redValues[i] = r;
- colorPtr->greenValues[i] = g;
- colorPtr->blueValues[i] = b;
- }
- fr = (double) colors[r].red / 65535.0;
- fg = (double) colors[g].green / 65535.0;
- fb = (double) colors[b].blue / 65535.0;
- if (colorPtr->id.gamma != 1.0) {
- fr = pow(fr, colorPtr->id.gamma);
- fg = pow(fg, colorPtr->id.gamma);
- fb = pow(fb, colorPtr->id.gamma);
- }
- colorPtr->colorQuant[0][i] = (int)(fr * 255.99);
- colorPtr->colorQuant[1][i] = (int)(fg * 255.99);
- colorPtr->colorQuant[2][i] = (int)(fb * 255.99);
- }
- }
-
- ckfree((char *) colors);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * DisposeColorTable --
- *
- * Release a color table and its associated resources.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The colors in the argument color table are freed, as is the color
- * table structure itself. The color table is removed from the hash table
- * which is used to locate color tables.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-DisposeColorTable(
- ClientData clientData) /* Pointer to the ColorTable whose
- * colors are to be released. */
-{
- ColorTable *colorPtr = (ColorTable *) clientData;
- Tcl_HashEntry *entry;
-
- if (colorPtr->pixelMap != NULL) {
- if (colorPtr->numColors > 0) {
- XFreeColors(colorPtr->id.display, colorPtr->id.colormap,
- colorPtr->pixelMap, colorPtr->numColors, 0);
- Tk_FreeColormap(colorPtr->id.display, colorPtr->id.colormap);
- }
- ckfree((char *) colorPtr->pixelMap);
- }
-
- entry = Tcl_FindHashEntry(&imgPhotoColorHash, (char *) &colorPtr->id);
- if (entry == NULL) {
- Tcl_Panic("DisposeColorTable couldn't find hash entry");
- }
- Tcl_DeleteHashEntry(entry);
-
- ckfree((char *) colorPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ReclaimColors --
- *
- * This function is called to try to free up colors in the colormap used
- * by a color table. It looks for other color tables with the same
- * colormap and with a zero live reference count, and frees their colors.
- * It only does so if there is the possibility of freeing up at least
- * `numColors' colors.
- *
- * Results:
- * The return value is TRUE if any colors were freed, FALSE otherwise.
- *
- * Side effects:
- * ColorTables which are not currently in use may lose their color
- * allocations.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-ReclaimColors(
- ColorTableId *id, /* Pointer to information identifying
- * the color table which needs more colors. */
- int numColors) /* Number of colors required. */
-{
- Tcl_HashSearch srch;
- Tcl_HashEntry *entry;
- ColorTable *colorPtr;
- int nAvail = 0;
-
- /*
- * First scan through the color hash table to get an upper bound on how
- * many colors we might be able to free.
- */
-
- entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch);
- while (entry != NULL) {
- colorPtr = (ColorTable *) Tcl_GetHashValue(entry);
- if ((colorPtr->id.display == id->display)
- && (colorPtr->id.colormap == id->colormap)
- && (colorPtr->liveRefCount == 0 )&& (colorPtr->numColors != 0)
- && ((colorPtr->id.palette != id->palette)
- || (colorPtr->id.gamma != id->gamma))) {
- /*
- * We could take this guy's colors off him.
- */
-
- nAvail += colorPtr->numColors;
- }
- entry = Tcl_NextHashEntry(&srch);
- }
-
- /*
- * nAvail is an (over)estimate of the number of colors we could free.
- */
-
- if (nAvail < numColors) {
- return 0;
- }
-
- /*
- * Scan through a second time freeing colors.
- */
-
- entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch);
- while ((entry != NULL) && (numColors > 0)) {
- colorPtr = (ColorTable *) Tcl_GetHashValue(entry);
- if ((colorPtr->id.display == id->display)
- && (colorPtr->id.colormap == id->colormap)
- && (colorPtr->liveRefCount == 0) && (colorPtr->numColors != 0)
- && ((colorPtr->id.palette != id->palette)
- || (colorPtr->id.gamma != id->gamma))) {
- /*
- * Free the colors that this ColorTable has.
- */
-
- XFreeColors(colorPtr->id.display, colorPtr->id.colormap,
- colorPtr->pixelMap, colorPtr->numColors, 0);
- numColors -= colorPtr->numColors;
- colorPtr->numColors = 0;
- ckfree((char *) colorPtr->pixelMap);
- colorPtr->pixelMap = NULL;
- }
-
- entry = Tcl_NextHashEntry(&srch);
- }
- return 1; /* We freed some colors. */
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * DisposeInstance --
- *
- * This function is called to finally free up an instance of a photo
- * image which is no longer required.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The instance data structure and the resources it references are freed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-DisposeInstance(
- ClientData clientData) /* Pointer to the instance whose resources are
- * to be released. */
-{
- PhotoInstance *instancePtr = (PhotoInstance *) clientData;
- PhotoInstance *prevPtr;
-
- if (instancePtr->pixels != None) {
- Tk_FreePixmap(instancePtr->display, instancePtr->pixels);
- }
- if (instancePtr->gc != None) {
- Tk_FreeGC(instancePtr->display, instancePtr->gc);
- }
- if (instancePtr->imagePtr != NULL) {
- XDestroyImage(instancePtr->imagePtr);
- }
- if (instancePtr->error != NULL) {
- ckfree((char *) instancePtr->error);
- }
- if (instancePtr->colorTablePtr != NULL) {
- FreeColorTable(instancePtr->colorTablePtr, 1);
- }
-
- if (instancePtr->masterPtr->instancePtr == instancePtr) {
- instancePtr->masterPtr->instancePtr = instancePtr->nextPtr;
- } else {
- for (prevPtr = instancePtr->masterPtr->instancePtr;
- prevPtr->nextPtr != instancePtr; prevPtr = prevPtr->nextPtr) {
- /* Empty loop body. */
- }
- prevPtr->nextPtr = instancePtr->nextPtr;
- }
- Tk_FreeColormap(instancePtr->display, instancePtr->colormap);
- ckfree((char *) instancePtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* MatchFileFormat --
*
* This function is called to find a photo image file format handler
@@ -4029,7 +2317,7 @@ static int
MatchFileFormat(
Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
Tcl_Channel chan, /* The image file, open for reading. */
- char *fileName, /* The name of the image file. */
+ const char *fileName, /* The name of the image file. */
Tcl_Obj *formatObj, /* User-specified format string, or NULL. */
Tk_PhotoImageFormat **imageFormatPtr,
/* A pointer to the photo image format record
@@ -4041,9 +2329,9 @@ MatchFileFormat(
{
int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- char *formatString = NULL;
+ const char *formatString = NULL;
if (formatObj) {
formatString = Tcl_GetString(formatObj);
@@ -4071,7 +2359,7 @@ MatchFileFormat(
if (formatPtr->fileMatchProc != NULL) {
(void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
- if ((*formatPtr->fileMatchProc)(chan, fileName, formatObj,
+ if (formatPtr->fileMatchProc(chan, fileName, formatObj,
widthPtr, heightPtr, interp)) {
if (*widthPtr < 1) {
*widthPtr = 1;
@@ -4101,7 +2389,7 @@ MatchFileFormat(
}
if (formatPtr->fileMatchProc != NULL) {
(void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
- if ((*formatPtr->fileMatchProc)(chan, fileName, (Tcl_Obj *)
+ if (formatPtr->fileMatchProc(chan, fileName, (Tcl_Obj *)
formatString, widthPtr, heightPtr, interp)) {
if (*widthPtr < 1) {
*widthPtr = 1;
@@ -4170,9 +2458,9 @@ MatchStringFormat(
{
int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- char *formatString = NULL;
+ const char *formatString = NULL;
if (formatObj) {
formatString = Tcl_GetString(formatObj);
@@ -4199,8 +2487,8 @@ MatchStringFormat(
}
if ((formatPtr->stringMatchProc != NULL)
&& (formatPtr->stringReadProc != NULL)
- && (*formatPtr->stringMatchProc)(data, formatObj,
- widthPtr, heightPtr, interp)) {
+ && formatPtr->stringMatchProc(data, formatObj,
+ widthPtr, heightPtr, interp)) {
break;
}
}
@@ -4223,7 +2511,7 @@ MatchStringFormat(
}
if ((formatPtr->stringMatchProc != NULL)
&& (formatPtr->stringReadProc != NULL)
- && (*formatPtr->stringMatchProc)(
+ && formatPtr->stringMatchProc(
(Tcl_Obj *) Tcl_GetString(data),
(Tcl_Obj *) formatString,
widthPtr, heightPtr, interp)) {
@@ -4270,16 +2558,16 @@ Tk_PhotoHandle
Tk_FindPhoto(
Tcl_Interp *interp, /* Interpreter (application) in which image
* exists. */
- CONST char *imageName) /* Name of the desired photo image. */
+ const char *imageName) /* Name of the desired photo image. */
{
- ClientData clientData;
- Tk_ImageType *typePtr;
+ const Tk_ImageType *typePtr;
+ ClientData clientData =
+ Tk_GetImageMasterData(interp, imageName, &typePtr);
- clientData = Tk_GetImageMasterData(interp, imageName, &typePtr);
if ((typePtr == NULL) || (typePtr->name != tkPhotoImageType.name)) {
return NULL;
}
- return (Tk_PhotoHandle) clientData;
+ return clientData;
}
/*
@@ -4317,14 +2605,21 @@ Tk_PhotoPutBlock(
int compRule) /* Compositing rule to use when processing
* transparent pixels. */
{
- register PhotoMaster *masterPtr;
+ register PhotoMaster *masterPtr = (PhotoMaster *) handle;
int xEnd, yEnd, greenOffset, blueOffset, alphaOffset;
int wLeft, hLeft, wCopy, hCopy, pitch;
unsigned char *srcPtr, *srcLinePtr, *destPtr, *destLinePtr;
int sourceIsSimplePhoto = compRule & SOURCE_IS_SIMPLE_ALPHA_PHOTO;
XRectangle rect;
- masterPtr = (PhotoMaster *) handle;
+ /*
+ * Zero-sized blocks never cause any changes. [Bug 3078902]
+ */
+
+ if (blockPtr->height == 0 || blockPtr->width == 0) {
+ return TCL_OK;
+ }
+
compRule &= ~SOURCE_IS_SIMPLE_ALPHA_PHOTO;
if ((masterPtr->userWidth != 0) && ((x + width) > masterPtr->userWidth)) {
@@ -4611,27 +2906,32 @@ Tk_PhotoPutBlock(
* Check if display code needs alpha blending...
*/
- if (!sourceIsSimplePhoto && (width == 1) && (height == 1)) {
+ if (!sourceIsSimplePhoto && (height == 1)) {
/*
- * Optimize the single pixel case if we can. This speeds up code that
- * builds up large simple-alpha images by single pixels. We don't
- * negate COMPLEX_ALPHA in this case. [Bug 1409140]
+ * Optimize the single span case if we can. This speeds up code that
+ * builds up large simple-alpha images by scan-lines or individual
+ * pixels. We don't negate COMPLEX_ALPHA in this case. [Bug 1409140]
+ * [Patch 1539990]
*/
if (!(masterPtr->flags & COMPLEX_ALPHA)) {
- unsigned char newAlpha;
+ register int x1;
- destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4;
- newAlpha = destLinePtr[3];
+ for (x1=x ; x1<x+width ; x1++) {
+ register unsigned char newAlpha;
- if (newAlpha && newAlpha != 255) {
- masterPtr->flags |= COMPLEX_ALPHA;
+ destLinePtr = masterPtr->pix32 + (y*masterPtr->width + x1)*4;
+ newAlpha = destLinePtr[3];
+ if (newAlpha && newAlpha != 255) {
+ masterPtr->flags |= COMPLEX_ALPHA;
+ break;
+ }
}
}
} else if ((alphaOffset != 0) || (masterPtr->flags & COMPLEX_ALPHA)) {
/*
* Check for partial transparency if alpha pixels are specified, or
- * rescan if we already knew such pixels existed. To restrict this
+ * rescan if we already knew such pixels existed. To restrict this
* Toggle to only checking the changed pixels requires knowing where
* the alpha pixels are.
*/
@@ -4699,6 +2999,14 @@ Tk_PhotoPutZoomedBlock(
int pitch, xRepeat, yRepeat, blockXSkip, blockYSkip, sourceIsSimplePhoto;
XRectangle rect;
+ /*
+ * Zero-sized blocks never cause any changes. [Bug 3078902]
+ */
+
+ if (blockPtr->height == 0 || blockPtr->width == 0) {
+ return TCL_OK;
+ }
+
if (zoomX==1 && zoomY==1 && subsampleX==1 && subsampleY==1) {
return Tk_PhotoPutBlock(interp, handle, blockPtr, x, y, width, height,
compRule);
@@ -4725,6 +3033,7 @@ Tk_PhotoPutZoomedBlock(
yEnd = y + height;
if ((xEnd > masterPtr->width) || (yEnd > masterPtr->height)) {
int sameSrc = (blockPtr->pixelPtr == masterPtr->pix32);
+
if (ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
MAX(yEnd, masterPtr->height)) == TCL_ERROR) {
if (interp != NULL) {
@@ -4740,7 +3049,7 @@ Tk_PhotoPutZoomedBlock(
}
if ((y < masterPtr->ditherY) || ((y == masterPtr->ditherY)
- && (x < masterPtr->ditherX))) {
+ && (x < masterPtr->ditherX))) {
/*
* The dithering isn't correct past the start of this block.
*/
@@ -4914,7 +3223,7 @@ Tk_PhotoPutZoomedBlock(
if (!sourceIsSimplePhoto && (width == 1) && (height == 1)) {
/*
* Optimize the single pixel case if we can. This speeds up code that
- * builds up large simple-alpha images by single pixels. We don't
+ * builds up large simple-alpha images by single pixels. We don't
* negate COMPLEX_ALPHA in this case. [Bug 1409140]
*/
if (!(masterPtr->flags & COMPLEX_ALPHA)) {
@@ -4930,7 +3239,7 @@ Tk_PhotoPutZoomedBlock(
} else if ((alphaOffset != 0) || (masterPtr->flags & COMPLEX_ALPHA)) {
/*
* Check for partial transparency if alpha pixels are specified, or
- * rescan if we already knew such pixels existed. To restrict this
+ * rescan if we already knew such pixels existed. To restrict this
* Toggle to only checking the changed pixels requires knowing where
* the alpha pixels are.
*/
@@ -4988,7 +3297,7 @@ Tk_DitherPhoto(
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
- DitherInstance(instancePtr, x, y, width, height);
+ TkImgDitherInstance(instancePtr, x, y, width, height);
}
/*
@@ -5034,345 +3343,6 @@ Tk_DitherPhoto(
/*
*----------------------------------------------------------------------
*
- * DitherInstance --
- *
- * This function is called to update an area of an instance's pixmap by
- * dithering the corresponding area of the master.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The instance's pixmap gets updated.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-DitherInstance(
- PhotoInstance *instancePtr, /* The instance to be updated. */
- int xStart, int yStart, /* Coordinates of the top-left pixel in the
- * block to be dithered. */
- int width, int height) /* Dimensions of the block to be dithered. */
-{
- PhotoMaster *masterPtr = instancePtr->masterPtr;
- ColorTable *colorPtr = instancePtr->colorTablePtr;
- XImage *imagePtr;
- int nLines, bigEndian, i, c, x, y, xEnd, doDithering = 1;
- int bitsPerPixel, bytesPerLine, lineLength;
- unsigned char *srcLinePtr;
- schar *errLinePtr;
- pixel firstBit, word, mask;
-
- /*
- * Turn dithering off in certain cases where it is not needed (TrueColor,
- * DirectColor with many colors).
- */
-
- if ((colorPtr->visualInfo.class == DirectColor)
- || (colorPtr->visualInfo.class == TrueColor)) {
- int nRed, nGreen, nBlue, result;
-
- result = sscanf(colorPtr->id.palette, "%d/%d/%d", &nRed,
- &nGreen, &nBlue);
- if ((nRed >= 256)
- && ((result == 1) || ((nGreen >= 256) && (nBlue >= 256)))) {
- doDithering = 0;
- }
- }
-
- /*
- * First work out how many lines to do at a time, then how many bytes
- * we'll need for pixel storage, and allocate it.
- */
-
- nLines = (MAX_PIXELS + width - 1) / width;
- if (nLines < 1) {
- nLines = 1;
- }
- if (nLines > height ) {
- nLines = height;
- }
-
- imagePtr = instancePtr->imagePtr;
- if (imagePtr == NULL) {
- return; /* We must be really tight on memory. */
- }
- bitsPerPixel = imagePtr->bits_per_pixel;
- bytesPerLine = ((bitsPerPixel * width + 31) >> 3) & ~3;
- imagePtr->width = width;
- imagePtr->height = nLines;
- imagePtr->bytes_per_line = bytesPerLine;
- imagePtr->data = (char *)
- ckalloc((unsigned) (imagePtr->bytes_per_line * nLines));
- bigEndian = imagePtr->bitmap_bit_order == MSBFirst;
- firstBit = bigEndian? (1 << (imagePtr->bitmap_unit - 1)): 1;
-
- lineLength = masterPtr->width * 3;
- srcLinePtr = masterPtr->pix32 + (yStart * masterPtr->width + xStart) * 4;
- errLinePtr = instancePtr->error + yStart * lineLength + xStart * 3;
- xEnd = xStart + width;
-
- /*
- * Loop over the image, doing at most nLines lines before updating the
- * screen image.
- */
-
- for (; height > 0; height -= nLines) {
- unsigned char *dstLinePtr = (unsigned char *) imagePtr->data;
- int yEnd;
-
- if (nLines > height) {
- nLines = height;
- }
- yEnd = yStart + nLines;
- for (y = yStart; y < yEnd; ++y) {
- unsigned char *srcPtr = srcLinePtr;
- schar *errPtr = errLinePtr;
- unsigned char *destBytePtr = dstLinePtr;
- pixel *destLongPtr = (pixel *) dstLinePtr;
-
- if (colorPtr->flags & COLOR_WINDOW) {
- /*
- * Color window. We dither the three components independently,
- * using Floyd-Steinberg dithering, which propagates errors
- * from the quantization of pixels to the pixels below and to
- * the right.
- */
-
- for (x = xStart; x < xEnd; ++x) {
- int col[3];
-
- if (doDithering) {
- for (i = 0; i < 3; ++i) {
- /*
- * Compute the error propagated into this pixel
- * for this component. If e[x,y] is the array of
- * quantization error values, we compute
- * 7/16 * e[x-1,y] + 1/16 * e[x-1,y-1]
- * + 5/16 * e[x,y-1] + 3/16 * e[x+1,y-1]
- * and round it to an integer.
- *
- * The expression ((c + 2056) >> 4) - 128 computes
- * round(c / 16), and works correctly on machines
- * without a sign-extending right shift.
- */
-
- c = (x > 0) ? errPtr[-3] * 7: 0;
- if (y > 0) {
- if (x > 0) {
- c += errPtr[-lineLength-3];
- }
- c += errPtr[-lineLength] * 5;
- if ((x + 1) < masterPtr->width) {
- c += errPtr[-lineLength+3] * 3;
- }
- }
-
- /*
- * Add the propagated error to the value of this
- * component, quantize it, and store the
- * quantization error.
- */
-
- c = ((c + 2056) >> 4) - 128 + *srcPtr++;
- if (c < 0) {
- c = 0;
- } else if (c > 255) {
- c = 255;
- }
- col[i] = colorPtr->colorQuant[i][c];
- *errPtr++ = c - col[i];
- }
- } else {
- /*
- * Output is virtually continuous in this case, so
- * don't bother dithering.
- */
-
- col[0] = *srcPtr++;
- col[1] = *srcPtr++;
- col[2] = *srcPtr++;
- }
- srcPtr++;
-
- /*
- * Translate the quantized component values into an X
- * pixel value, and store it in the image.
- */
-
- i = colorPtr->redValues[col[0]]
- + colorPtr->greenValues[col[1]]
- + colorPtr->blueValues[col[2]];
- if (colorPtr->flags & MAP_COLORS) {
- i = colorPtr->pixelMap[i];
- }
- switch (bitsPerPixel) {
- case NBBY:
- *destBytePtr++ = i;
- break;
-#ifndef __WIN32__
- /*
- * This case is not valid for Windows because the
- * image format is different from the pixel format in
- * Win32. Eventually we need to fix the image code in
- * Tk to use the Windows native image ordering. This
- * would speed up the image code for all of the common
- * sizes.
- */
-
- case NBBY * sizeof(pixel):
- *destLongPtr++ = i;
- break;
-#endif
- default:
- XPutPixel(imagePtr, x - xStart, y - yStart,
- (unsigned) i);
- }
- }
-
- } else if (bitsPerPixel > 1) {
- /*
- * Multibit monochrome window. The operation here is similar
- * to the color window case above, except that there is only
- * one component. If the master image is in color, use the
- * luminance computed as
- * 0.344 * red + 0.5 * green + 0.156 * blue.
- */
-
- for (x = xStart; x < xEnd; ++x) {
- c = (x > 0) ? errPtr[-1] * 7: 0;
- if (y > 0) {
- if (x > 0) {
- c += errPtr[-lineLength-1];
- }
- c += errPtr[-lineLength] * 5;
- if (x + 1 < masterPtr->width) {
- c += errPtr[-lineLength+1] * 3;
- }
- }
- c = ((c + 2056) >> 4) - 128;
-
- if ((masterPtr->flags & COLOR_IMAGE) == 0) {
- c += srcPtr[0];
- } else {
- c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
- + srcPtr[2] * 5 + 16) >> 5;
- }
- srcPtr += 4;
-
- if (c < 0) {
- c = 0;
- } else if (c > 255) {
- c = 255;
- }
- i = colorPtr->colorQuant[0][c];
- *errPtr++ = c - i;
- i = colorPtr->redValues[i];
- switch (bitsPerPixel) {
- case NBBY:
- *destBytePtr++ = i;
- break;
-#ifndef __WIN32__
- /*
- * This case is not valid for Windows because the
- * image format is different from the pixel format in
- * Win32. Eventually we need to fix the image code in
- * Tk to use the Windows native image ordering. This
- * would speed up the image code for all of the common
- * sizes.
- */
-
- case NBBY * sizeof(pixel):
- *destLongPtr++ = i;
- break;
-#endif
- default:
- XPutPixel(imagePtr, x - xStart, y - yStart,
- (unsigned) i);
- }
- }
- } else {
- /*
- * 1-bit monochrome window. This is similar to the multibit
- * monochrome case above, except that the quantization is
- * simpler (we only have black = 0 and white = 255), and we
- * produce an XY-Bitmap.
- */
-
- word = 0;
- mask = firstBit;
- for (x = xStart; x < xEnd; ++x) {
- /*
- * If we have accumulated a whole word, store it in the
- * image and start a new word.
- */
-
- if (mask == 0) {
- *destLongPtr++ = word;
- mask = firstBit;
- word = 0;
- }
-
- c = (x > 0) ? errPtr[-1] * 7: 0;
- if (y > 0) {
- if (x > 0) {
- c += errPtr[-lineLength-1];
- }
- c += errPtr[-lineLength] * 5;
- if (x + 1 < masterPtr->width) {
- c += errPtr[-lineLength+1] * 3;
- }
- }
- c = ((c + 2056) >> 4) - 128;
-
- if ((masterPtr->flags & COLOR_IMAGE) == 0) {
- c += srcPtr[0];
- } else {
- c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
- + srcPtr[2] * 5 + 16) >> 5;
- }
- srcPtr += 4;
-
- if (c < 0) {
- c = 0;
- } else if (c > 255) {
- c = 255;
- }
- if (c >= 128) {
- word |= mask;
- *errPtr++ = c - 255;
- } else {
- *errPtr++ = c;
- }
- mask = bigEndian? (mask >> 1): (mask << 1);
- }
- *destLongPtr = word;
- }
- srcLinePtr += masterPtr->width * 4;
- errLinePtr += lineLength;
- dstLinePtr += bytesPerLine;
- }
-
- /*
- * Update the pixmap for this instance with the block of pixels that
- * we have just computed.
- */
-
- TkPutImage(colorPtr->pixelMap, colorPtr->numColors,
- instancePtr->display, instancePtr->pixels,
- instancePtr->gc, imagePtr, 0, 0, xStart, yStart,
- (unsigned) width, (unsigned) nLines);
- yStart = yEnd;
- }
-
- ckfree(imagePtr->data);
- imagePtr->data = NULL;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tk_PhotoBlank --
*
* This function is called to clear an entire photo image.
@@ -5415,11 +3385,7 @@ Tk_PhotoBlank(
(size_t) (masterPtr->width * masterPtr->height * 4));
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
- if (instancePtr->error) {
- memset(instancePtr->error, 0,
- (size_t) (masterPtr->width * masterPtr->height
- * 3 * sizeof(schar)));
- }
+ TkImgResetDither(instancePtr);
}
/*
@@ -5662,8 +3628,10 @@ ImgGetPhoto(
if ((greenOffset||blueOffset) && !(optPtr->options & OPT_GRAYSCALE)) {
newPixelSize += 2;
}
- data = ckalloc((unsigned int) (newPixelSize *
- blockPtr->width * blockPtr->height));
+ data = attemptckalloc(newPixelSize*blockPtr->width*blockPtr->height);
+ if (data == NULL) {
+ return NULL;
+ }
srcPtr = blockPtr->pixelPtr + blockPtr->offset[0];
destPtr = (unsigned char *) data;
if (!greenOffset && !blueOffset) {
@@ -5758,12 +3726,12 @@ ImgGetPhoto(
blockPtr->pixelSize = newPixelSize;
blockPtr->pitch = newPixelSize * blockPtr->width;
blockPtr->offset[0] = 0;
- if (newPixelSize>2) {
- blockPtr->offset[1]= 1;
- blockPtr->offset[2]= 2;
+ if (newPixelSize > 2) {
+ blockPtr->offset[1] = 1;
+ blockPtr->offset[2] = 2;
} else {
- blockPtr->offset[1]= 0;
- blockPtr->offset[2]= 0;
+ blockPtr->offset[1] = 0;
+ blockPtr->offset[2] = 0;
}
return data;
}
@@ -5793,9 +3761,6 @@ ImgStringWrite(
Tcl_Obj *formatString,
Tk_PhotoImageBlock *blockPtr)
{
- int row, col;
- char *line, *linePtr;
- unsigned char *pixelPtr;
int greenOffset, blueOffset;
Tcl_DString data;
@@ -5804,11 +3769,14 @@ ImgStringWrite(
Tcl_DStringInit(&data);
if ((blockPtr->width > 0) && (blockPtr->height > 0)) {
- line = (char *) ckalloc((unsigned int) ((8 * blockPtr->width) + 2));
+ char *line = ckalloc((8 * blockPtr->width) + 2);
+ int row, col;
+
for (row=0; row<blockPtr->height; row++) {
- pixelPtr = blockPtr->pixelPtr + blockPtr->offset[0] +
- row * blockPtr->pitch;
- linePtr = line;
+ unsigned char *pixelPtr = blockPtr->pixelPtr + blockPtr->offset[0]
+ + row * blockPtr->pitch;
+ char *linePtr = line;
+
for (col=0; col<blockPtr->width; col++) {
sprintf(linePtr, " #%02x%02x%02x", *pixelPtr,
pixelPtr[greenOffset], pixelPtr[blueOffset]);
@@ -5817,7 +3785,7 @@ ImgStringWrite(
}
Tcl_DStringAppendElement(&data, line+1);
}
- ckfree (line);
+ ckfree(line);
}
Tcl_DStringResult(interp, &data);
return TCL_OK;
@@ -5866,150 +3834,6 @@ Tk_PhotoGetImage(
}
/*
- *----------------------------------------------------------------------
- *
- * PhotoOptionFind --
- *
- * Finds a specific Photo option.
- *
- * Results:
- * None.
- *
- * Side effects:
- * After commands are removed.
- *
- *----------------------------------------------------------------------
- */
-
-typedef struct OptionAssocData {
- struct OptionAssocData *nextPtr;
- /* Pointer to next OptionAssocData. */
- Tcl_ObjCmdProc *command; /* Command associated with this option. */
- char name[1]; /* Name of option (remaining chars) */
-} OptionAssocData;
-
-static Tcl_ObjCmdProc *
-PhotoOptionFind(
- Tcl_Interp *interp, /* Interpreter that is being deleted. */
- Tcl_Obj *obj) /* Name of option to be found. */
-{
- int length;
- char *name = Tcl_GetStringFromObj(obj, &length);
- char *prevname = NULL;
- Tcl_ObjCmdProc *proc = NULL;
- OptionAssocData *list = (OptionAssocData *) Tcl_GetAssocData(interp,
- "photoOption", NULL);
-
- while (list != NULL) {
- if (strncmp(name, list->name, (unsigned) length) == 0) {
- if (proc != NULL) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "ambiguous option \"", name,
- "\": must be ", prevname, NULL);
- while (list->nextPtr != NULL) {
- Tcl_AppendResult(interp, prevname, ", ",NULL);
- list = list->nextPtr;
- prevname = list->name;
- }
- Tcl_AppendResult(interp, ", or", prevname, NULL);
- return NULL;
- }
- proc = list->command;
- prevname = list->name;
- }
- list = list->nextPtr;
- }
- if (proc != NULL) {
- Tcl_ResetResult(interp);
- }
- return proc;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * PhotoOptionCleanupProc --
- *
- * This function is invoked whenever an interpreter is deleted to cleanup
- * the AssocData for "photoVisitor".
- *
- * Results:
- * None.
- *
- * Side effects:
- * Photo Visitor options are removed.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-PhotoOptionCleanupProc(
- ClientData clientData, /* Points to "photoVisitor" AssocData for the
- * interpreter. */
- Tcl_Interp *interp) /* Interpreter that is being deleted. */
-{
- OptionAssocData *list = (OptionAssocData *) clientData;
-
- while (list != NULL) {
- register OptionAssocData *ptr;
-
- list = (ptr = list)->nextPtr;
- ckfree((char *) ptr);
- }
-}
-
-/*
- *--------------------------------------------------------------
- *
- * Tk_CreatePhotoOption --
- *
- * This function may be invoked to add a new kind of photo option to the
- * core photo command supported by Tk.
- *
- * Results:
- * None.
- *
- * Side effects:
- * From now on, the new option will be useable by the photo command.
- *
- *--------------------------------------------------------------
- */
-
-MODULE_SCOPE void
-Tk_CreatePhotoOption(
- Tcl_Interp *interp, /* Interpreter. */
- CONST char *name, /* Option name. */
- Tcl_ObjCmdProc *proc) /* Function to execute command. */
-{
- OptionAssocData *typePtr2, *prevPtr, *ptr;
- OptionAssocData *list = (OptionAssocData *)
- Tcl_GetAssocData(interp, "photoOption", NULL);
-
- /*
- * If there's already a photo option with the given name, remove it.
- */
-
- for (typePtr2 = list, prevPtr = NULL; typePtr2 != NULL;
- prevPtr = typePtr2, typePtr2 = typePtr2->nextPtr) {
- if (strcmp(typePtr2->name, name) == 0) {
- if (prevPtr == NULL) {
- list = typePtr2->nextPtr;
- } else {
- prevPtr->nextPtr = typePtr2->nextPtr;
- }
- ckfree((char *) typePtr2);
- break;
- }
- }
- ptr = (OptionAssocData *) ckalloc(sizeof(OptionAssocData) + strlen(name));
- strcpy(&(ptr->name[0]), name);
- ptr->command = proc;
- ptr->nextPtr = list;
- Tcl_SetAssocData(interp, "photoOption", PhotoOptionCleanupProc,
- (ClientData) ptr);
-}
-
-/*
*--------------------------------------------------------------
*
* TkPostscriptPhoto --
@@ -6038,7 +3862,7 @@ ImgPhotoPostscript(
{
Tk_PhotoImageBlock block;
- Tk_PhotoGetImage((Tk_PhotoHandle) clientData, &block);
+ Tk_PhotoGetImage(clientData, &block);
block.pixelPtr += y * block.pitch + x * block.pixelSize;
return Tk_PostscriptPhoto(interp, &block, psInfo, width, height);
diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h
new file mode 100644
index 0000000..7f338ab
--- /dev/null
+++ b/generic/tkImgPhoto.h
@@ -0,0 +1,260 @@
+/*
+ * tkImgPhoto.h --
+ *
+ * Declarations for images of type "photo" for Tk.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2002-2008 Donal K. Fellows
+ * Copyright (c) 2003 ActiveState Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * Author: Paul Mackerras (paulus@cs.anu.edu.au),
+ * Department of Computer Science,
+ * Australian National University.
+ */
+
+#include "tkInt.h"
+#ifdef __WIN32__
+#include "tkWinInt.h"
+#endif
+
+/*
+ * Forward declarations of the structures we define.
+ */
+
+typedef struct ColorTableId ColorTableId;
+typedef struct ColorTable ColorTable;
+typedef struct PhotoInstance PhotoInstance;
+typedef struct PhotoMaster PhotoMaster;
+
+/*
+ * A signed 8-bit integral type. If chars are unsigned and the compiler isn't
+ * an ANSI one, then we have to use short instead (which wastes space) to get
+ * signed behavior.
+ */
+
+#if defined(__STDC__) || defined(_AIX)
+ typedef signed char schar;
+#else
+# ifndef __CHAR_UNSIGNED__
+ typedef char schar;
+# else
+ typedef short schar;
+# endif
+#endif
+
+/*
+ * An unsigned 32-bit integral type, used for pixel values. We use int rather
+ * than long here to accommodate those systems where longs are 64 bits.
+ */
+
+typedef unsigned int pixel;
+
+/*
+ * The maximum number of pixels to transmit to the server in a single
+ * XPutImage call.
+ */
+
+#define MAX_PIXELS 65536
+
+/*
+ * The set of colors required to display a photo image in a window depends on:
+ * - the visual used by the window
+ * - the palette, which specifies how many levels of each primary color to
+ * use, and
+ * - the gamma value for the image.
+ *
+ * Pixel values allocated for specific colors are valid only for the colormap
+ * in which they were allocated. Sets of pixel values allocated for displaying
+ * photos are re-used in other windows if possible, that is, if the display,
+ * colormap, palette and gamma values match. A hash table is used to locate
+ * these sets of pixel values, using the following data structure as key:
+ */
+
+struct ColorTableId {
+ Display *display; /* Qualifies the colormap resource ID. */
+ Colormap colormap; /* Colormap that the windows are using. */
+ double gamma; /* Gamma exponent value for images. */
+ Tk_Uid palette; /* Specifies how many shades of each primary
+ * we want to allocate. */
+};
+
+/*
+ * For a particular (display, colormap, palette, gamma) combination, a data
+ * structure of the following type is used to store the allocated pixel values
+ * and other information:
+ */
+
+struct ColorTable {
+ ColorTableId id; /* Information used in selecting this color
+ * table. */
+ int flags; /* See below. */
+ int refCount; /* Number of instances using this map. */
+ int liveRefCount; /* Number of instances which are actually in
+ * use, using this map. */
+ int numColors; /* Number of colors allocated for this map. */
+
+ XVisualInfo visualInfo; /* Information about the visual for windows
+ * using this color table. */
+
+ pixel redValues[256]; /* Maps 8-bit values of red intensity to a
+ * pixel value or index in pixelMap. */
+ pixel greenValues[256]; /* Ditto for green intensity. */
+ pixel blueValues[256]; /* Ditto for blue intensity. */
+ unsigned long *pixelMap; /* Actual pixel values allocated. */
+
+ unsigned char colorQuant[3][256];
+ /* Maps 8-bit intensities to quantized
+ * intensities. The first index is 0 for red,
+ * 1 for green, 2 for blue. */
+};
+
+/*
+ * Bit definitions for the flags field of a ColorTable.
+ * BLACK_AND_WHITE: 1 means only black and white colors are
+ * available.
+ * COLOR_WINDOW: 1 means a full 3-D color cube has been
+ * allocated.
+ * DISPOSE_PENDING: 1 means a call to DisposeColorTable has been
+ * scheduled as an idle handler, but it hasn't
+ * been invoked yet.
+ * MAP_COLORS: 1 means pixel values should be mapped through
+ * pixelMap.
+ */
+
+#ifdef COLOR_WINDOW
+#undef COLOR_WINDOW
+#endif
+
+#define BLACK_AND_WHITE 1
+#define COLOR_WINDOW 2
+#define DISPOSE_PENDING 4
+#define MAP_COLORS 8
+
+/*
+ * Definition of the data associated with each photo image master.
+ */
+
+struct PhotoMaster {
+ Tk_ImageMaster tkMaster; /* Tk's token for image master. NULL means the
+ * image is being deleted. */
+ Tcl_Interp *interp; /* Interpreter associated with the application
+ * using this image. */
+ Tcl_Command imageCmd; /* Token for image command (used to delete it
+ * when the image goes away). NULL means the
+ * image command has already been deleted. */
+ int flags; /* Sundry flags, defined below. */
+ int width, height; /* Dimensions of image. */
+ int userWidth, userHeight; /* User-declared image dimensions. */
+ Tk_Uid palette; /* User-specified default palette for
+ * instances of this image. */
+ double gamma; /* Display gamma value to correct for. */
+ char *fileString; /* Name of file to read into image. */
+ Tcl_Obj *dataString; /* Object to use as contents of image. */
+ Tcl_Obj *format; /* User-specified format of data in image file
+ * or string value. */
+ unsigned char *pix32; /* Local storage for 32-bit image. */
+ int ditherX, ditherY; /* Location of first incorrectly dithered
+ * pixel in image. */
+ TkRegion validRegion; /* Tk region indicating which parts of the
+ * image have valid image data. */
+ PhotoInstance *instancePtr; /* First in the list of instances associated
+ * with this master. */
+};
+
+/*
+ * Bit definitions for the flags field of a PhotoMaster.
+ * COLOR_IMAGE: 1 means that the image has different color
+ * components.
+ * IMAGE_CHANGED: 1 means that the instances of this image need
+ * to be redithered.
+ * COMPLEX_ALPHA: 1 means that the instances of this image have
+ * alpha values that aren't 0 or 255, and so need
+ * the copy-merge-replace renderer .
+ */
+
+#define COLOR_IMAGE 1
+#define IMAGE_CHANGED 2
+#define COMPLEX_ALPHA 4
+
+/*
+ * Flag to OR with the compositing rule to indicate that the source, despite
+ * having an alpha channel, has simple alpha.
+ */
+
+#define SOURCE_IS_SIMPLE_ALPHA_PHOTO 0x10000000
+
+/*
+ * The following data structure represents all of the instances of a photo
+ * image in windows on a given screen that are using the same colormap.
+ */
+
+struct PhotoInstance {
+ PhotoMaster *masterPtr; /* Pointer to master for image. */
+ Display *display; /* Display for windows using this instance. */
+ Colormap colormap; /* The image may only be used in windows with
+ * this particular colormap. */
+ PhotoInstance *nextPtr; /* Pointer to the next instance in the list of
+ * instances associated with this master. */
+ int refCount; /* Number of instances using this structure. */
+ Tk_Uid palette; /* Palette for these particular instances. */
+ double gamma; /* Gamma value for these instances. */
+ Tk_Uid defaultPalette; /* Default palette to use if a palette is not
+ * specified for the master. */
+ ColorTable *colorTablePtr; /* Pointer to information about colors
+ * allocated for image display in windows like
+ * this one. */
+ Pixmap pixels; /* X pixmap containing dithered image. */
+ int width, height; /* Dimensions of the pixmap. */
+ schar *error; /* Error image, used in dithering. */
+ XImage *imagePtr; /* Image structure for converted pixels. */
+ XVisualInfo visualInfo; /* Information about the visual that these
+ * windows are using. */
+ GC gc; /* Graphics context for writing images to the
+ * pixmap. */
+};
+
+/*
+ * Implementation of the Porter-Duff Source-Over compositing rule.
+ */
+
+#define PD_SRC_OVER(srcColor, srcAlpha, dstColor, dstAlpha) \
+ (srcColor*srcAlpha/255) + dstAlpha*(255-srcAlpha)/255*dstColor/255
+#define PD_SRC_OVER_ALPHA(srcAlpha, dstAlpha) \
+ (srcAlpha + (255-srcAlpha)*dstAlpha/255)
+
+#undef MIN
+#define MIN(a, b) ((a) < (b)? (a): (b))
+#undef MAX
+#define MAX(a, b) ((a) > (b)? (a): (b))
+
+/*
+ * Declarations of functions shared between the different parts of the
+ * photo image implementation.
+ */
+
+MODULE_SCOPE void TkImgPhotoConfigureInstance(
+ PhotoInstance *instancePtr);
+MODULE_SCOPE void TkImgDisposeInstance(ClientData clientData);
+MODULE_SCOPE void TkImgPhotoInstanceSetSize(PhotoInstance *instancePtr);
+MODULE_SCOPE ClientData TkImgPhotoGet(Tk_Window tkwin, ClientData clientData);
+MODULE_SCOPE void TkImgDitherInstance(PhotoInstance *instancePtr, int x,
+ int y, int width, int height);
+MODULE_SCOPE void TkImgPhotoDisplay(ClientData clientData,
+ Display *display, Drawable drawable,
+ int imageX, int imageY, int width, int height,
+ int drawableX, int drawableY);
+MODULE_SCOPE void TkImgPhotoFree(ClientData clientData,
+ Display *display);
+MODULE_SCOPE void TkImgResetDither(PhotoInstance *instancePtr);
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgUtil.c b/generic/tkImgUtil.c
index 8ba6c0e..5487165 100644
--- a/generic/tkImgUtil.c
+++ b/generic/tkImgUtil.c
@@ -55,7 +55,7 @@ TkAlignImageData(
dataWidth += (alignment - (dataWidth % alignment));
}
- data = ckalloc((unsigned) dataWidth * image->height);
+ data = ckalloc(dataWidth * image->height);
destPtr = data;
for (i = 0; i < image->height; i++) {
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 45447f5..113d5d6 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -17,393 +17,386 @@ library tk
# Define the unsupported generic interfaces.
interface tkInt
+scspec EXTERN
# Declare each of the functions in the unsupported internal Tcl interface.
# These interfaces are allowed to changed between versions. Use at your own
# risk. Note that the position of functions should not be changed between
# versions to avoid gratuitous incompatibilities.
-declare 0 generic {
+declare 0 {
TkWindow *TkAllocWindow(TkDisplay *dispPtr, int screenNum,
TkWindow *parentPtr)
}
-declare 1 generic {
+declare 1 {
void TkBezierPoints(double control[], int numSteps, double *coordPtr)
}
-declare 2 generic {
+declare 2 {
void TkBezierScreenPoints(Tk_Canvas canvas, double control[],
int numSteps, XPoint *xPointPtr)
}
-declare 3 generic {
- void TkBindDeadWindow(TkWindow *winPtr)
-}
-declare 4 generic {
+#
+# Slot 3 unused (WAS: TkBindDeadWindow)
+#
+declare 4 {
void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 5 generic {
+declare 5 {
void TkBindFree(TkMainInfo *mainPtr)
}
-declare 6 generic {
+declare 6 {
void TkBindInit(TkMainInfo *mainPtr)
}
-declare 7 generic {
+declare 7 {
void TkChangeEventWindow(XEvent *eventPtr, TkWindow *winPtr)
}
-declare 8 generic {
+declare 8 {
int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr)
}
-declare 9 generic {
+declare 9 {
void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY,
int innerWidth, int innerHeight, int *xPtr, int *yPtr)
}
-declare 10 generic {
- int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script)
-}
-declare 11 generic {
- unsigned long TkCreateBindingProcedure(Tcl_Interp *interp,
- Tk_BindingTable bindingTable, ClientData object,
- CONST char *eventString, TkBindEvalProc *evalProc,
- TkBindFreeProc *freeProc, ClientData clientData)
-}
-declare 12 generic {
+#
+# Slot 10 unused (WAS: TkCopyAndGlobalEval)
+# Slot 11 unused (WAS: TkCreateBindingProcedure)
+#
+declare 12 {
TkCursor *TkCreateCursorFromData(Tk_Window tkwin,
- CONST char *source, CONST char *mask, int width, int height,
+ const char *source, const char *mask, int width, int height,
int xHot, int yHot, XColor fg, XColor bg)
}
-declare 13 generic {
+declare 13 {
int TkCreateFrame(ClientData clientData, Tcl_Interp *interp,
- int argc, char **argv, int toplevel, char *appName)
+ int argc, const char *const *argv, int toplevel, const char *appName)
}
-declare 14 generic {
+declare 14 {
Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
- CONST char *screenName, char *baseName)
+ const char *screenName, const char *baseName)
}
-declare 15 generic {
+declare 15 {
Time TkCurrentTime(TkDisplay *dispPtr)
}
-declare 16 generic {
+declare 16 {
void TkDeleteAllImages(TkMainInfo *mainPtr)
}
-declare 17 generic {
+declare 17 {
void TkDoConfigureNotify(TkWindow *winPtr)
}
-declare 18 generic {
+declare 18 {
void TkDrawInsetFocusHighlight(Tk_Window tkwin, GC gc, int width,
Drawable drawable, int padding)
}
-declare 19 generic {
+declare 19 {
void TkEventDeadWindow(TkWindow *winPtr)
}
-declare 20 generic {
+declare 20 {
void TkFillPolygon(Tk_Canvas canvas, double *coordPtr, int numPoints,
Display *display, Drawable drawable, GC gc, GC outlineGC)
}
-declare 21 generic {
- int TkFindStateNum(Tcl_Interp *interp, CONST char *option,
- CONST TkStateMap *mapPtr, CONST char *strKey)
+declare 21 {
+ int TkFindStateNum(Tcl_Interp *interp, const char *option,
+ const TkStateMap *mapPtr, const char *strKey)
}
-declare 22 generic {
- char *TkFindStateString(CONST TkStateMap *mapPtr, int numKey)
+declare 22 {
+ CONST86 char *TkFindStateString(const TkStateMap *mapPtr, int numKey)
}
-declare 23 generic {
+declare 23 {
void TkFocusDeadWindow(TkWindow *winPtr)
}
-declare 24 generic {
+declare 24 {
int TkFocusFilterEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 25 generic {
+declare 25 {
TkWindow *TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 26 generic {
+declare 26 {
void TkFontPkgInit(TkMainInfo *mainPtr)
}
-declare 27 generic {
+declare 27 {
void TkFontPkgFree(TkMainInfo *mainPtr)
}
-declare 28 generic {
+declare 28 {
void TkFreeBindingTags(TkWindow *winPtr)
}
# Name change only, TkFreeCursor in Tcl 8.0.x now TkpFreeCursor
-declare 29 generic {
+declare 29 {
void TkpFreeCursor(TkCursor *cursorPtr)
}
-declare 30 generic {
- char *TkGetBitmapData(Tcl_Interp *interp, char *string,
- char *fileName, int *widthPtr, int *heightPtr,
+declare 30 {
+ char *TkGetBitmapData(Tcl_Interp *interp, const char *string,
+ const char *fileName, int *widthPtr, int *heightPtr,
int *hotXPtr, int *hotYPtr)
}
-declare 31 generic {
+declare 31 {
void TkGetButtPoints(double p1[], double p2[],
double width, int project, double m1[], double m2[])
}
-declare 32 generic {
+declare 32 {
TkCursor *TkGetCursorByName(Tcl_Interp *interp,
Tk_Window tkwin, Tk_Uid string)
}
-declare 33 generic {
- CONST84_RETURN char *TkGetDefaultScreenName(Tcl_Interp *interp,
- CONST char *screenName)
+declare 33 {
+ const char *TkGetDefaultScreenName(Tcl_Interp *interp,
+ const char *screenName)
}
-declare 34 generic {
+declare 34 {
TkDisplay *TkGetDisplay(Display *display)
}
-declare 35 generic {
- int TkGetDisplayOf(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[],
+declare 35 {
+ int TkGetDisplayOf(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[],
Tk_Window *tkwinPtr)
}
-declare 36 generic {
+declare 36 {
TkWindow *TkGetFocusWin(TkWindow *winPtr)
}
-declare 37 generic {
+declare 37 {
int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin)
}
-declare 38 generic {
+declare 38 {
int TkGetMiterPoints(double p1[], double p2[], double p3[],
double width, double m1[], double m2[])
}
-declare 39 generic {
+declare 39 {
void TkGetPointerCoords(Tk_Window tkwin, int *xPtr, int *yPtr)
}
-declare 40 generic {
+declare 40 {
void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin)
}
-declare 41 generic {
+declare 41 {
void TkGrabDeadWindow(TkWindow *winPtr)
}
-declare 42 generic {
+declare 42 {
int TkGrabState(TkWindow *winPtr)
}
-declare 43 generic {
+declare 43 {
void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr)
}
-declare 44 generic {
+declare 44 {
void TkInOutEvents(XEvent *eventPtr, TkWindow *sourcePtr,
TkWindow *destPtr, int leaveType, int enterType,
Tcl_QueuePosition position)
}
-declare 45 generic {
+declare 45 {
void TkInstallFrameMenu(Tk_Window tkwin)
}
-declare 46 generic {
- char *TkKeysymToString(KeySym keysym)
+declare 46 {
+ CONST86 char *TkKeysymToString(KeySym keysym)
}
-declare 47 generic {
+declare 47 {
int TkLineToArea(double end1Ptr[], double end2Ptr[], double rectPtr[])
}
-declare 48 generic {
+declare 48 {
double TkLineToPoint(double end1Ptr[], double end2Ptr[], double pointPtr[])
}
-declare 49 generic {
+declare 49 {
int TkMakeBezierCurve(Tk_Canvas canvas, double *pointPtr, int numPoints,
int numSteps, XPoint xPoints[], double dblPoints[])
}
-declare 50 generic {
+declare 50 {
void TkMakeBezierPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, double *pointPtr, int numPoints)
}
-declare 51 generic {
+declare 51 {
void TkOptionClassChanged(TkWindow *winPtr)
}
-declare 52 generic {
+declare 52 {
void TkOptionDeadWindow(TkWindow *winPtr)
}
-declare 53 generic {
+declare 53 {
int TkOvalToArea(double *ovalPtr, double *rectPtr)
}
-declare 54 generic {
+declare 54 {
double TkOvalToPoint(double ovalPtr[],
double width, int filled, double pointPtr[])
}
-declare 55 generic {
+declare 55 {
int TkpChangeFocus(TkWindow *winPtr, int force)
}
-declare 56 generic {
+declare 56 {
void TkpCloseDisplay(TkDisplay *dispPtr)
}
-declare 57 generic {
+declare 57 {
void TkpClaimFocus(TkWindow *topLevelPtr, int force)
}
-declare 58 generic {
- void TkpDisplayWarning(CONST char *msg, CONST char *title)
+declare 58 {
+ void TkpDisplayWarning(const char *msg, const char *title)
}
-declare 59 generic {
+declare 59 {
void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name)
}
-declare 60 generic {
+declare 60 {
TkWindow *TkpGetOtherWindow(TkWindow *winPtr)
}
-declare 61 generic {
+declare 61 {
TkWindow *TkpGetWrapperWindow(TkWindow *winPtr)
}
-declare 62 generic {
+declare 62 {
int TkpInit(Tcl_Interp *interp)
}
-declare 63 generic {
+declare 63 {
void TkpInitializeMenuBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable)
}
-declare 64 generic {
+declare 64 {
void TkpMakeContainer(Tk_Window tkwin)
}
-declare 65 generic {
+declare 65 {
void TkpMakeMenuWindow(Tk_Window tkwin, int transient)
}
-declare 66 generic {
+declare 66 {
Window TkpMakeWindow(TkWindow *winPtr, Window parent)
}
-declare 67 generic {
- void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1, char *menuName)
+declare 67 {
+ void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName)
}
-declare 68 generic {
- TkDisplay *TkpOpenDisplay(CONST char *display_name)
+declare 68 {
+ TkDisplay *TkpOpenDisplay(const char *display_name)
}
-declare 69 generic {
+declare 69 {
int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr)
}
-declare 70 generic {
+declare 70 {
int TkPolygonToArea(double *polyPtr, int numPoints, double *rectPtr)
}
-declare 71 generic {
+declare 71 {
double TkPolygonToPoint(double *polyPtr, int numPoints, double *pointPtr)
}
-declare 72 generic {
+declare 72 {
int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr)
}
-declare 73 generic {
+declare 73 {
void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 74 generic {
- void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, char *menuName)
+declare 74 {
+ void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName)
}
-declare 75 generic {
- int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
+declare 75 {
+ int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string)
}
-declare 76 generic {
- int TkpWindowWasRecentlyDeleted(Window win, TkDisplay *dispPtr)
-}
-declare 77 generic {
+declare 77 {
void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr)
}
-declare 78 generic {
- int TkReadBitmapFile(Display *display, Drawable d, CONST char *filename,
+declare 78 {
+ int TkReadBitmapFile(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)
}
-declare 79 generic {
+declare 79 {
int TkScrollWindow(Tk_Window tkwin, GC gc, int x, int y,
int width, int height, int dx, int dy, TkRegion damageRgn)
}
-declare 80 generic {
+declare 80 {
void TkSelDeadWindow(TkWindow *winPtr)
}
-declare 81 generic {
+declare 81 {
void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr)
}
-declare 82 generic {
+declare 82 {
void TkSelInit(Tk_Window tkwin)
}
-declare 83 generic {
+declare 83 {
void TkSelPropProc(XEvent *eventPtr)
}
# Exported publically as Tk_SetClassProcs in 8.4a2
-#declare 84 generic {
+#declare 84 {
# void TkSetClassProcs(Tk_Window tkwin,
# TkClassProcs *procs, ClientData instanceData)
#}
-declare 85 generic {
+declare 85 {
void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin,
- char *oldMenuName, char *menuName)
+ const char *oldMenuName, const char *menuName)
}
-declare 86 generic {
- KeySym TkStringToKeysym(char *name)
+declare 86 {
+ KeySym TkStringToKeysym(const char *name)
}
-declare 87 generic {
+declare 87 {
int TkThickPolyLineToArea(double *coordPtr, int numPoints,
double width, int capStyle, int joinStyle, double *rectPtr)
}
-declare 88 generic {
+declare 88 {
void TkWmAddToColormapWindows(TkWindow *winPtr)
}
-declare 89 generic {
+declare 89 {
void TkWmDeadWindow(TkWindow *winPtr)
}
-declare 90 generic {
+declare 90 {
TkWindow *TkWmFocusToplevel(TkWindow *winPtr)
}
-declare 91 generic {
+declare 91 {
void TkWmMapWindow(TkWindow *winPtr)
}
-declare 92 generic {
+declare 92 {
void TkWmNewWindow(TkWindow *winPtr)
}
-declare 93 generic {
+declare 93 {
void TkWmProtocolEventProc(TkWindow *winPtr, XEvent *evenvPtr)
}
-declare 94 generic {
+declare 94 {
void TkWmRemoveFromColormapWindows(TkWindow *winPtr)
}
-declare 95 generic {
+declare 95 {
void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow,
TkWindow *otherPtr)
}
-declare 96 generic {
+declare 96 {
void TkWmSetClass(TkWindow *winPtr)
}
-declare 97 generic {
+declare 97 {
void TkWmUnmapWindow(TkWindow *winPtr)
}
# new for 8.1
-declare 98 generic {
- Tcl_Obj *TkDebugBitmap(Tk_Window tkwin, char *name)
+declare 98 {
+ Tcl_Obj *TkDebugBitmap(Tk_Window tkwin, const char *name)
}
-declare 99 generic {
- Tcl_Obj *TkDebugBorder(Tk_Window tkwin, char *name)
+declare 99 {
+ Tcl_Obj *TkDebugBorder(Tk_Window tkwin, const char *name)
}
-declare 100 generic {
- Tcl_Obj *TkDebugCursor(Tk_Window tkwin, char *name)
+declare 100 {
+ Tcl_Obj *TkDebugCursor(Tk_Window tkwin, const char *name)
}
-declare 101 generic {
- Tcl_Obj *TkDebugColor(Tk_Window tkwin, char *name)
+declare 101 {
+ Tcl_Obj *TkDebugColor(Tk_Window tkwin, const char *name)
}
-declare 102 generic {
+declare 102 {
Tcl_Obj *TkDebugConfig(Tcl_Interp *interp, Tk_OptionTable table)
}
-declare 103 generic {
- Tcl_Obj *TkDebugFont(Tk_Window tkwin, char *name)
+declare 103 {
+ Tcl_Obj *TkDebugFont(Tk_Window tkwin, const char *name)
}
-declare 104 generic {
+declare 104 {
int TkFindStateNumObj(Tcl_Interp *interp, Tcl_Obj *optionPtr,
- CONST TkStateMap *mapPtr, Tcl_Obj *keyPtr)
+ const TkStateMap *mapPtr, Tcl_Obj *keyPtr)
}
-declare 105 generic {
+declare 105 {
Tcl_HashTable *TkGetBitmapPredefTable(void)
}
-declare 106 generic {
+declare 106 {
TkDisplay *TkGetDisplayList(void)
}
-declare 107 generic {
+declare 107 {
TkMainInfo *TkGetMainInfoList(void)
}
-declare 108 generic {
+declare 108 {
int TkGetWindowFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr, Tk_Window *windowPtr)
}
-declare 109 generic {
- char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr)
+declare 109 {
+ CONST86 char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr)
}
-declare 110 generic {
+declare 110 {
void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont)
}
-declare 111 generic {
+declare 111 {
Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin,
- CONST char *dbName, CONST char *className)
+ const char *dbName, const char *className)
}
-declare 112 generic {
+declare 112 {
void TkpMenuThreadInit(void)
}
declare 113 {aqua win} {
@@ -430,145 +423,215 @@ declare 119 {aqua win} {
TkRegion src, TkRegion dr_return)
}
declare 121 aqua {
- Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source)
+ Pixmap TkpCreateNativeBitmap(Display *display, const void *source)
}
declare 122 aqua {
void TkpDefineNativeBitmaps(void)
}
declare 124 aqua {
Pixmap TkpGetNativeAppBitmap(Display *display,
- CONST char *name, int *width, int *height)
+ const char *name, int *width, int *height)
}
-declare 135 generic {
+declare 135 {
void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC,
int highlightWidth, Drawable drawable)
}
-declare 136 generic {
+declare 136 {
void TkSetFocusWin(TkWindow *winPtr, int force)
}
-declare 137 generic {
+declare 137 {
void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym,
XEvent *eventPtr)
}
-declare 138 generic {
+declare 138 {
KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr)
}
-declare 139 generic {
+declare 139 {
void TkpInitKeymapInfo(TkDisplay *dispPtr)
}
-declare 140 generic {
+declare 140 {
TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle)
}
-declare 141 generic {
+declare 141 {
TkWindow **TkWmStackorderToplevel(TkWindow *parentPtr)
}
-declare 142 generic {
+declare 142 {
void TkFocusFree(TkMainInfo *mainPtr)
}
-declare 143 generic {
+declare 143 {
void TkClipCleanup(TkDisplay *dispPtr)
}
-declare 144 generic {
+declare 144 {
void TkGCCleanup(TkDisplay *dispPtr)
}
declare 145 {win aqua} {
void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
-declare 146 generic {
+declare 146 {
void TkStylePkgInit(TkMainInfo *mainPtr)
}
-declare 147 generic {
+declare 147 {
void TkStylePkgFree(TkMainInfo *mainPtr)
}
-declare 148 generic {
+declare 148 {
Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp,
- CONST char *cmdName)
+ const char *cmdName)
}
-declare 149 generic {
- CONST Tk_OptionSpec *TkGetOptionSpec(CONST char *name,
+declare 149 {
+ const Tk_OptionSpec *TkGetOptionSpec(const char *name,
Tk_OptionTable optionTable)
}
# TIP#168
-declare 150 generic {
+declare 150 {
int TkMakeRawCurve(Tk_Canvas canvas, double *pointPtr, int numPoints,
int numSteps, XPoint xPoints[], double dblPoints[])
}
-declare 151 generic {
+declare 151 {
void TkMakeRawCurvePostscript(Tcl_Interp *interp,
Tk_Canvas canvas, double *pointPtr, int numPoints)
}
-declare 152 generic {
+declare 152 {
void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border,
int highlightWidth, int borderWidth, int relief)
}
-declare 153 generic {
+declare 153 {
void TkCreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData)
}
-declare 154 generic {
+declare 154 {
void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData)
}
# entries needed only by tktest:
-declare 156 generic {
+declare 156 {
int TkpTestembedCmd(ClientData clientData, Tcl_Interp *interp, int argc,
- CONST char **argv)
+ const char **argv)
}
-declare 157 generic {
+declare 157 {
int TkpTesttextCmd(ClientData dummy, Tcl_Interp *interp, int argc,
- CONST char **argv)
-}
-
-# Next group of functions exposed due to [Bug 2768945]. Numbers are chosen so
-# as to match 8.6 branch/HEAD.
-declare 169 generic {
+ const char **argv)
+}
+declare 158 {
+ int TkSelGetSelection(Tcl_Interp *interp, Tk_Window tkwin,
+ Atom selection, Atom target, Tk_GetSelProc *proc,
+ ClientData clientData)
+}
+declare 159 {
+ int TkTextGetIndex(Tcl_Interp *interp, struct TkText *textPtr,
+ const char *string, struct TkTextIndex *indexPtr)
+}
+declare 160 {
+ int TkTextIndexBackBytes(const struct TkText *textPtr,
+ const struct TkTextIndex *srcPtr, int count,
+ struct TkTextIndex *dstPtr)
+}
+declare 161 {
+ int TkTextIndexForwBytes(const struct TkText *textPtr,
+ const struct TkTextIndex *srcPtr, int count,
+ struct TkTextIndex *dstPtr)
+}
+declare 162 {
+ struct TkTextIndex *TkTextMakeByteIndex(TkTextBTree tree,
+ const struct TkText *textPtr, int lineIndex,
+ int byteIndex, struct TkTextIndex *indexPtr)
+}
+declare 163 {
+ int TkTextPrintIndex(const struct TkText *textPtr,
+ const struct TkTextIndex *indexPtr, char *string)
+}
+declare 164 {
+ struct TkTextSegment *TkTextSetMark(struct TkText *textPtr,
+ const char *name, struct TkTextIndex *indexPtr)
+}
+declare 165 {
+ int TkTextXviewCmd(struct TkText *textPtr, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[])
+}
+declare 166 {
+ void TkTextChanged(struct TkSharedText *sharedTextPtr,
+ struct TkText *textPtr, const struct TkTextIndex *index1Ptr,
+ const struct TkTextIndex *index2Ptr)
+}
+declare 167 {
+ int TkBTreeNumLines(TkTextBTree tree,
+ const struct TkText *textPtr)
+}
+declare 168 {
+ void TkTextInsertDisplayProc(struct TkText *textPtr,
+ struct TkTextDispChunk *chunkPtr, int x, int y,
+ int height, int baseline, Display *display,
+ Drawable dst, int screenY)
+}
+# Next group of functions exposed due to [Bug 2768945].
+declare 169 {
int TkStateParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 170 generic {
- char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin,
+declare 170 {
+ CONST86 char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 171 generic {
+declare 171 {
int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 172 generic {
- char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 172 {
+ CONST86 char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 173 generic {
+declare 173 {
int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 174 generic {
- char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 174 {
+ CONST86 char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 175 generic {
+declare 175 {
int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 176 generic {
- char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 176 {
+ CONST86 char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 177 generic {
+declare 177 {
int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 178 generic {
- char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 178 {
+ CONST86 char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-declare 179 generic {
+declare 179 {
int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+ Tk_Window tkwin, const char *value, char *widgRec, int offset)
}
-declare 180 generic {
- char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin,
+declare 180 {
+ CONST86 char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
+
+# Angled text API, exposed for Emiliano Gavilan's RBC work.
+declare 181 {
+ void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc,
+ Tk_TextLayout layout, int x, int y, double angle, int firstChar,
+ int lastChar)
+}
+declare 182 {
+ void TkUnderlineAngledTextLayout(Display *display, Drawable drawable,
+ GC gc, Tk_TextLayout layout, int x, int y, double angle,
+ int underline)
+}
+declare 183 {
+ int TkIntersectAngledTextLayout(Tk_TextLayout layout, int x, int y,
+ int width, int height, double angle)
+}
+declare 184 {
+ void TkDrawAngledChars(Display *display,Drawable drawable, GC gc,
+ Tk_Font tkfont, const char *source, int numBytes, double x,
+ double y, double angle)
+}
##############################################################################
@@ -583,12 +646,6 @@ interface tkIntPlat
declare 0 x11 {
void TkCreateXEventSource(void)
}
-declare 1 x11 {
- void TkFreeWindowId(TkDisplay *dispPtr, Window w)
-}
-declare 2 x11 {
- void TkInitXId(TkDisplay *dispPtr)
-}
declare 3 x11 {
int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
}
@@ -605,7 +662,7 @@ declare 7 x11 {
void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar)
}
declare 8 x11 {
- int TkpScanWindowId(Tcl_Interp *interp, CONST char *string, Window *idPtr)
+ int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr)
}
declare 9 x11 {
void TkWmCleanup(TkDisplay *dispPtr)
@@ -613,16 +670,13 @@ declare 9 x11 {
declare 10 x11 {
void TkSendCleanup(TkDisplay *dispPtr)
}
-declare 11 x11 {
- void TkFreeXId(TkDisplay *dispPtr)
-}
declare 12 x11 {
int TkpWmSetState(TkWindow *winPtr, int state)
}
# only needed by tktest:
declare 13 x11 {
int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int argc,
- CONST char **argv)
+ const char **argv)
}
################################
@@ -644,7 +698,7 @@ declare 5 win {
void TkpPrintWindowId(char *buf, Window window)
}
declare 6 win {
- int TkpScanWindowId(Tcl_Interp *interp, CONST char *string, Window *idPtr)
+ int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr)
}
declare 7 win {
void TkpSetCapture(TkWindow *winPtr)
@@ -729,7 +783,7 @@ declare 31 win {
}
declare 32 win {
Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin,
- CONST char *dbName, CONST char *className)
+ const char *dbName, const char *className)
}
declare 33 win {
int TkWinGetPlatformId(void)
@@ -760,7 +814,7 @@ declare 0 aqua {
# removed duplicates from tkInt table
#declare 1 aqua {
-# Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source)
+# Pixmap TkpCreateNativeBitmap(Display *display, const void *source)
#}
#
#declare 2 aqua {
@@ -804,22 +858,22 @@ declare 12 aqua {
#}
declare 14 aqua {
- int TkMacOSXDoHLEvent(EventRecord *theEvent)
+ int TkMacOSXDoHLEvent(void *theEvent)
}
# removed duplicate from tkPlat table(tk.decls)
#declare 15 aqua {
-# GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable)
+# void *TkMacOSXGetDrawablePort(Drawable drawable)
#}
declare 16 aqua {
- Window TkMacOSXGetXWindow(WindowRef macWinPtr)
+ Window TkMacOSXGetXWindow(void *macWinPtr)
}
declare 17 aqua {
- int TkMacOSXGrowToplevel(WindowRef whichWindow, Point start)
+ int TkMacOSXGrowToplevel(void *whichWindow, XPoint start)
}
declare 18 aqua {
- void TkMacOSXHandleMenuSelect(MenuID theMenu, MenuItemIndex theItem,
+ void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem,
int optionKeyPressed)
}
@@ -842,13 +896,13 @@ declare 23 aqua {
void TkMacOSXMakeRealWindowExist(TkWindow *winPtr)
}
declare 24 aqua {
- BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2)
+ void *TkMacOSXMakeStippleMap(Drawable d1, Drawable d2)
}
declare 25 aqua {
void TkMacOSXMenuClick(void)
}
declare 26 aqua {
- void TkMacOSXRegisterOffScreenWindow(Window window, GWorldPtr portPtr)
+ void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr)
}
declare 27 aqua {
int TkMacOSXResizable(TkWindow *winPtr)
@@ -863,28 +917,28 @@ declare 30 aqua {
void TkMacOSXSetUpClippingRgn(Drawable drawable)
}
declare 31 aqua {
- void TkMacOSXSetUpGraphicsPort(GC gc, GWorldPtr destPort)
+ void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort)
}
declare 32 aqua {
void TkMacOSXUpdateClipRgn(TkWindow *winPtr)
}
declare 33 aqua {
- void TkMacOSXUnregisterMacWindow(WindowRef portPtr)
+ void TkMacOSXUnregisterMacWindow(void *portPtr)
}
declare 34 aqua {
int TkMacOSXUseMenuID(short macID)
}
declare 35 aqua {
- RgnHandle TkMacOSXVisableClipRgn(TkWindow *winPtr)
+ TkRegion TkMacOSXVisableClipRgn(TkWindow *winPtr)
}
declare 36 aqua {
- void TkMacOSXWinBounds(TkWindow *winPtr, Rect *geometry)
+ void TkMacOSXWinBounds(TkWindow *winPtr, void *geometry)
}
declare 37 aqua {
- void TkMacOSXWindowOffset(WindowRef wRef, int *xOffset, int *yOffset)
+ void TkMacOSXWindowOffset(void *wRef, int *xOffset, int *yOffset)
}
declare 38 aqua {
- int TkSetMacColor(unsigned long pixel, RGBColor *macColor)
+ int TkSetMacColor(unsigned long pixel, void *macColor)
}
declare 39 aqua {
void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid)
@@ -893,7 +947,7 @@ declare 40 aqua {
void TkSuspendClipboard(void)
}
declare 41 aqua {
- int TkMacOSXZoomToplevel(WindowPtr whichWindow, short zoomPart)
+ int TkMacOSXZoomToplevel(void *whichWindow, short zoomPart)
}
declare 42 aqua {
Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX, int rootY,
@@ -909,7 +963,7 @@ declare 45 aqua {
void TkMacOSXPreprocessMenu(void)
}
declare 46 aqua {
- int TkpIsWindowFloating(WindowRef window)
+ int TkpIsWindowFloating(void *window)
}
declare 47 aqua {
Tk_Window TkMacOSXGetCapture(void)
@@ -933,7 +987,7 @@ declare 51 aqua {
declare 53 aqua {
unsigned long TkpGetMS(void)
}
-
+
##############################################################################
# Define the platform specific internal Xlib interfaces. These functions are
@@ -1161,7 +1215,7 @@ declare 61 win {
Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
}
declare 62 win {
- void XSetCommand(Display *d, Window w, CONST char **c, int i)
+ void XSetCommand(Display *d, Window w, const char **c, int i)
}
declare 63 win {
void XSetIconName(Display *d, Window w, _Xconst char *c)
diff --git a/generic/tkInt.h b/generic/tkInt.h
index bd40a88..51bc896 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -15,22 +15,17 @@
#ifndef _TKINT
#define _TKINT
-#ifndef _TK
-#include "tk.h"
-#endif
-#ifndef _TCL
-#include "tcl.h"
-#endif
#ifndef _TKPORT
#include "tkPort.h"
#endif
/*
- * Ensure WORDS_BIGENDIAN is defined correcly:
+ * Ensure WORDS_BIGENDIAN is defined correctly:
* Needs to happen here in addition to configure to work with fat compiles on
* Darwin (where configure runs only once for multiple architectures).
*/
+#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@@ -100,18 +95,11 @@ typedef struct TkpCursor_ *TkpCursor;
typedef struct TkRegion_ *TkRegion;
typedef struct TkStressedCmap TkStressedCmap;
typedef struct TkBindInfo_ *TkBindInfo;
-
-/*
- * Function types.
- */
-
-typedef int (TkBindEvalProc)(ClientData clientData, Tcl_Interp *interp,
- XEvent *eventPtr, Tk_Window tkwin, KeySym keySym);
-typedef void (TkBindFreeProc)(ClientData clientData);
+typedef struct Busy *TkBusy;
/*
* One of the following structures is maintained for each cursor in use in the
- * system. This structure is used by tkCursor.c and the various system
+ * system. This structure is used by tkCursor.c and the various system-
* specific cursor files.
*/
@@ -397,10 +385,6 @@ typedef struct TkDisplay {
int postCommandGeneration;
/*
- * Information used by tkOption.c only.
- */
-
- /*
* Information used by tkPack.c only.
*/
@@ -469,24 +453,6 @@ typedef struct TkDisplay {
* application name on each comm window. */
/*
- * Information used by tkXId.c only:
- */
-
- struct TkIdStack *idStackPtr;
- /* First in list of chunks of free resource
- * identifiers, or NULL if there are no free
- * resources. */
- XID (*defaultAllocProc) (Display *display);
- /* Default resource allocator for display. */
- struct TkIdStack *windowStackPtr;
- /* First in list of chunks of window ids that
- * can't be reused right now. */
- 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:
*/
@@ -495,18 +461,6 @@ typedef struct TkDisplay {
/* Points to the foreground window. */
/*
- * Information maintained by tkWindow.c for use later on by tkXId.c:
- */
-
- int destroyCount; /* Number of Tk_DestroyWindow operations in
- * progress. */
- unsigned long lastDestroyRequest;
- /* Id of most recent XDestroyWindow request;
- * can re-use ids in windowStackPtr when
- * server has seen this request and event
- * queue is empty. */
-
- /*
* Information used by tkVisual.c only:
*/
@@ -537,7 +491,9 @@ typedef struct TkDisplay {
* display. */
Window mouseButtonWindow; /* Window the button state was set in, added
* in Tk 8.4. */
- Window warpWindow;
+ Tk_Window warpWindow;
+ Tk_Window warpMainwin; /* For finding the root window for warping
+ * purposes. */
int warpX;
int warpY;
@@ -669,6 +625,7 @@ typedef struct TkMainInfo {
* ::tk::AlwaysShowSelection variable. */
struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
* this process. */
+ Tcl_HashTable busyTable; /* Information used by [tk busy] command. */
} TkMainInfo;
/*
@@ -678,7 +635,7 @@ typedef struct TkMainInfo {
*/
typedef struct {
- const char *source; /* Bits for bitmap. */
+ const void *source; /* Bits for bitmap. */
int width, height; /* Dimensions of bitmap. */
int native; /* 0 means generic (X style) bitmap, 1 means
* native style bitmap. */
@@ -803,7 +760,8 @@ typedef struct TkWindow {
* Information used by tkGeometry.c for geometry management.
*/
- const Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for this
+ const Tk_GeomMgr *geomMgrPtr;
+ /* Information about geometry manager for this
* window. */
ClientData geomData; /* Argument for geometry manager functions. */
int reqWidth, reqHeight; /* Arguments from last call to
@@ -822,13 +780,14 @@ typedef struct TkWindow {
struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also for special
* Unix menubar and wrapper windows), points
* to structure with wm-related info (see
- * tkWm.c). For other windows, this is NULL. */
+ * tkWm.c). For other windows, this is
+ * NULL. */
/*
* Information used by widget classes.
*/
- Tk_ClassProcs *classProcsPtr;
+ const Tk_ClassProcs *classProcsPtr;
ClientData instanceData;
/*
@@ -848,6 +807,7 @@ typedef struct TkWindow {
int minReqWidth; /* Minimum requested width. */
int minReqHeight; /* Minimum requested height. */
+ char *geometryMaster;
} TkWindow;
/*
@@ -869,6 +829,25 @@ typedef struct {
} TkKeyEvent;
/*
+ * Flags passed to TkpMakeMenuWindow's 'transient' argument.
+ */
+
+#define TK_MAKE_MENU_TEAROFF 0 /* Only non-transient case. */
+#define TK_MAKE_MENU_POPUP 1
+#define TK_MAKE_MENU_DROPDOWN 2
+
+/*
+ * The following structure is used with TkMakeEnsemble to create ensemble
+ * commands and optionally to create sub-ensembles.
+ */
+
+typedef struct TkEnsemble {
+ const char *name;
+ Tcl_ObjCmdProc *proc;
+ const struct TkEnsemble *subensemble;
+} TkEnsemble;
+
+/*
* The following structure is used as a two way map between integers and
* strings, usually to map between an internal C representation and the
* strings used in Tcl.
@@ -896,12 +875,6 @@ typedef struct TkpClipMask {
#define TKP_CLIP_REGION 1
/*
- * Pointer to first entry in list of all displays currently known.
- */
-
-extern TkDisplay *tkDisplayList;
-
-/*
* Return values from TkGrabState:
*/
@@ -948,35 +921,72 @@ extern TkDisplay *tkDisplayList;
* be properly registered with Tcl:
*/
-MODULE_SCOPE Tcl_ObjType tkBorderObjType;
-MODULE_SCOPE Tcl_ObjType tkBitmapObjType;
-MODULE_SCOPE Tcl_ObjType tkColorObjType;
-MODULE_SCOPE Tcl_ObjType tkCursorObjType;
-MODULE_SCOPE Tcl_ObjType tkFontObjType;
-MODULE_SCOPE Tcl_ObjType tkOptionObjType;
-MODULE_SCOPE Tcl_ObjType tkStateKeyObjType;
-MODULE_SCOPE Tcl_ObjType tkTextIndexType;
+MODULE_SCOPE const Tcl_ObjType tkBorderObjType;
+MODULE_SCOPE const Tcl_ObjType tkBitmapObjType;
+MODULE_SCOPE const Tcl_ObjType tkColorObjType;
+MODULE_SCOPE const Tcl_ObjType tkCursorObjType;
+MODULE_SCOPE const Tcl_ObjType tkFontObjType;
+MODULE_SCOPE const Tcl_ObjType tkStateKeyObjType;
+MODULE_SCOPE const Tcl_ObjType tkTextIndexType;
/*
* Miscellaneous variables shared among Tk modules but not exported to the
* outside world:
*/
-MODULE_SCOPE Tk_SmoothMethod tkBezierSmoothMethod;
+MODULE_SCOPE const Tk_SmoothMethod tkBezierSmoothMethod;
MODULE_SCOPE Tk_ImageType tkBitmapImageType;
MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtGIF;
MODULE_SCOPE void (*tkHandleEventProc) (XEvent* eventPtr);
+MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtPNG;
MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtPPM;
MODULE_SCOPE TkMainInfo *tkMainWindowList;
MODULE_SCOPE Tk_ImageType tkPhotoImageType;
MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable;
-#include "tkIntDecls.h"
+/*
+ * The definition of pi, at least from the perspective of double-precision
+ * floats.
+ */
+
+#ifndef PI
+#ifdef M_PI
+#define PI M_PI
+#else
+#define PI 3.14159265358979323846
+#endif
+#endif
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
+/*
+ * Support for Clang Static Analyzer <http://clang-analyzer.llvm.org>
+ */
+
+#if defined(PURIFY) && defined(__clang__)
+#if __has_feature(attribute_analyzer_noreturn) && \
+ !defined(Tcl_Panic) && defined(Tcl_Panic_TCL_DECLARED)
+void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn));
+#endif
+#if !defined(CLANG_ASSERT)
+#include <assert.h>
+#define CLANG_ASSERT(x) assert(x)
#endif
+#elif !defined(CLANG_ASSERT)
+#define CLANG_ASSERT(x)
+#endif /* PURIFY && __clang__ */
+
+/*
+ * The following magic value is stored in the "send_event" field of FocusIn
+ * and FocusOut events. This allows us to separate "real" events coming from
+ * the server from those that we generated.
+ */
+
+#define GENERATED_FOCUS_EVENT_MAGIC ((Bool) 0x547321ac)
+
+/*
+ * Exported internals.
+ */
+
+#include "tkIntDecls.h"
/*
* Themed widget set init function:
@@ -998,6 +1008,9 @@ MODULE_SCOPE int Tk_BindObjCmd(ClientData clientData,
MODULE_SCOPE int Tk_BindtagsObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_BusyObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
MODULE_SCOPE int Tk_ButtonObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -1016,9 +1029,6 @@ MODULE_SCOPE int Tk_ChooseColorObjCmd(ClientData clientData,
MODULE_SCOPE int Tk_ChooseDirectoryObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int Tk_ChooseFontObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
MODULE_SCOPE int Tk_DestroyObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -1110,9 +1120,6 @@ MODULE_SCOPE int Tk_SpinboxObjCmd(ClientData clientData,
MODULE_SCOPE int Tk_TextObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int Tk_TkObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
MODULE_SCOPE int Tk_TkwaitObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
@@ -1131,6 +1138,10 @@ MODULE_SCOPE int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp,
MODULE_SCOPE int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr,
double *doublePtr);
+MODULE_SCOPE int TkSetGeometryMaster(Tcl_Interp *interp,
+ Tk_Window tkwin, const char *master);
+MODULE_SCOPE void TkFreeGeometryMaster(Tk_Window tkwin,
+ const char *master);
MODULE_SCOPE void TkEventInit(void);
MODULE_SCOPE void TkRegisterObjTypes(void);
@@ -1158,7 +1169,7 @@ MODULE_SCOPE void TkpBuildRegionFromAlphaData(TkRegion region,
unsigned height, unsigned char *dataPtr,
unsigned pixelStride, unsigned lineStride);
MODULE_SCOPE void TkPrintPadAmount(Tcl_Interp *interp,
- char *buffer, int pad1, int pad2);
+ const char *buffer, int pad1, int pad2);
MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr,
int *pad1Ptr, int *pad2Ptr);
@@ -1179,6 +1190,26 @@ MODULE_SCOPE void TkUnderlineCharsInContext(Display *display,
int firstByte, int lastByte);
MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont,
Tcl_UniChar c, struct TkFontAttributes *faPtr);
+MODULE_SCOPE Tcl_Obj * TkNewWindowObj(Tk_Window tkwin);
+MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy);
+MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy);
+MODULE_SCOPE void TkpMakeTransparentWindowExist(Tk_Window tkwin,
+ Window parent);
+MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef,
+ Window *parentPtr, Tk_Window tkParent,
+ TkBusy busy);
+MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp,
+ int objc, Tcl_Obj *const *objv, int flags);
+MODULE_SCOPE void TkSendVirtualEvent(Tk_Window tgtWin,
+ const char *eventName);
+MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp,
+ const char *nsname, const char *name,
+ ClientData clientData, const TkEnsemble *map);
+MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp,
+ ClientData clientData);
+MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp,
+ ClientData clientData);
+MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr);
/*
* Unsupported commands.
@@ -1188,11 +1219,21 @@ MODULE_SCOPE int TkUnsupported1ObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
+/*
+ * For Tktest.
+ */
+MODULE_SCOPE int SquareObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj * const objv[]);
+MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
+#define TkplatformtestInit(x) TCL_OK
+#else
+MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
+#endif
#endif /* _TKINT */
-
+
/*
* Local Variables:
* mode: c
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 531ee5f..cfa87da 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -20,6 +20,13 @@
#define TCL_STORAGE_CLASS DLLEXPORT
#endif
+struct TkText;
+typedef struct TkTextBTree_ *TkTextBTree;
+struct TkTextDispChunk;
+struct TkTextIndex;
+struct TkTextSegment;
+struct TkSharedText;
+
/*
* WARNING: This file is automatically generated by the tools/genStubs.tcl
* script. Any modifications to the function declarations below should be made
@@ -32,768 +39,373 @@
* Exported function declarations:
*/
-#ifndef TkAllocWindow_TCL_DECLARED
-#define TkAllocWindow_TCL_DECLARED
/* 0 */
EXTERN TkWindow * TkAllocWindow(TkDisplay *dispPtr, int screenNum,
TkWindow *parentPtr);
-#endif
-#ifndef TkBezierPoints_TCL_DECLARED
-#define TkBezierPoints_TCL_DECLARED
/* 1 */
EXTERN void TkBezierPoints(double control[], int numSteps,
double *coordPtr);
-#endif
-#ifndef TkBezierScreenPoints_TCL_DECLARED
-#define TkBezierScreenPoints_TCL_DECLARED
/* 2 */
EXTERN void TkBezierScreenPoints(Tk_Canvas canvas,
double control[], int numSteps,
XPoint *xPointPtr);
-#endif
-#ifndef TkBindDeadWindow_TCL_DECLARED
-#define TkBindDeadWindow_TCL_DECLARED
-/* 3 */
-EXTERN void TkBindDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkBindEventProc_TCL_DECLARED
-#define TkBindEventProc_TCL_DECLARED
+/* Slot 3 is reserved */
/* 4 */
EXTERN void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr);
-#endif
-#ifndef TkBindFree_TCL_DECLARED
-#define TkBindFree_TCL_DECLARED
/* 5 */
EXTERN void TkBindFree(TkMainInfo *mainPtr);
-#endif
-#ifndef TkBindInit_TCL_DECLARED
-#define TkBindInit_TCL_DECLARED
/* 6 */
EXTERN void TkBindInit(TkMainInfo *mainPtr);
-#endif
-#ifndef TkChangeEventWindow_TCL_DECLARED
-#define TkChangeEventWindow_TCL_DECLARED
/* 7 */
EXTERN void TkChangeEventWindow(XEvent *eventPtr,
TkWindow *winPtr);
-#endif
-#ifndef TkClipInit_TCL_DECLARED
-#define TkClipInit_TCL_DECLARED
/* 8 */
EXTERN int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr);
-#endif
-#ifndef TkComputeAnchor_TCL_DECLARED
-#define TkComputeAnchor_TCL_DECLARED
/* 9 */
EXTERN void TkComputeAnchor(Tk_Anchor anchor, Tk_Window tkwin,
int padX, int padY, int innerWidth,
int innerHeight, int *xPtr, int *yPtr);
-#endif
-#ifndef TkCopyAndGlobalEval_TCL_DECLARED
-#define TkCopyAndGlobalEval_TCL_DECLARED
-/* 10 */
-EXTERN int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script);
-#endif
-#ifndef TkCreateBindingProcedure_TCL_DECLARED
-#define TkCreateBindingProcedure_TCL_DECLARED
-/* 11 */
-EXTERN unsigned long TkCreateBindingProcedure(Tcl_Interp *interp,
- Tk_BindingTable bindingTable,
- ClientData object, CONST char *eventString,
- TkBindEvalProc *evalProc,
- TkBindFreeProc *freeProc,
- ClientData clientData);
-#endif
-#ifndef TkCreateCursorFromData_TCL_DECLARED
-#define TkCreateCursorFromData_TCL_DECLARED
+/* Slot 10 is reserved */
+/* Slot 11 is reserved */
/* 12 */
EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin,
- CONST char *source, CONST char *mask,
+ const char *source, const char *mask,
int width, int height, int xHot, int yHot,
XColor fg, XColor bg);
-#endif
-#ifndef TkCreateFrame_TCL_DECLARED
-#define TkCreateFrame_TCL_DECLARED
/* 13 */
EXTERN int TkCreateFrame(ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv,
- int toplevel, char *appName);
-#endif
-#ifndef TkCreateMainWindow_TCL_DECLARED
-#define TkCreateMainWindow_TCL_DECLARED
+ Tcl_Interp *interp, int argc,
+ const char *const *argv, int toplevel,
+ const char *appName);
/* 14 */
EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
- CONST char *screenName, char *baseName);
-#endif
-#ifndef TkCurrentTime_TCL_DECLARED
-#define TkCurrentTime_TCL_DECLARED
+ const char *screenName, const char *baseName);
/* 15 */
EXTERN Time TkCurrentTime(TkDisplay *dispPtr);
-#endif
-#ifndef TkDeleteAllImages_TCL_DECLARED
-#define TkDeleteAllImages_TCL_DECLARED
/* 16 */
EXTERN void TkDeleteAllImages(TkMainInfo *mainPtr);
-#endif
-#ifndef TkDoConfigureNotify_TCL_DECLARED
-#define TkDoConfigureNotify_TCL_DECLARED
/* 17 */
EXTERN void TkDoConfigureNotify(TkWindow *winPtr);
-#endif
-#ifndef TkDrawInsetFocusHighlight_TCL_DECLARED
-#define TkDrawInsetFocusHighlight_TCL_DECLARED
/* 18 */
EXTERN void TkDrawInsetFocusHighlight(Tk_Window tkwin, GC gc,
int width, Drawable drawable, int padding);
-#endif
-#ifndef TkEventDeadWindow_TCL_DECLARED
-#define TkEventDeadWindow_TCL_DECLARED
/* 19 */
EXTERN void TkEventDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkFillPolygon_TCL_DECLARED
-#define TkFillPolygon_TCL_DECLARED
/* 20 */
EXTERN void TkFillPolygon(Tk_Canvas canvas, double *coordPtr,
int numPoints, Display *display,
Drawable drawable, GC gc, GC outlineGC);
-#endif
-#ifndef TkFindStateNum_TCL_DECLARED
-#define TkFindStateNum_TCL_DECLARED
/* 21 */
EXTERN int TkFindStateNum(Tcl_Interp *interp,
- CONST char *option, CONST TkStateMap *mapPtr,
- CONST char *strKey);
-#endif
-#ifndef TkFindStateString_TCL_DECLARED
-#define TkFindStateString_TCL_DECLARED
+ const char *option, const TkStateMap *mapPtr,
+ const char *strKey);
/* 22 */
-EXTERN char * TkFindStateString(CONST TkStateMap *mapPtr,
+EXTERN CONST86 char * TkFindStateString(const TkStateMap *mapPtr,
int numKey);
-#endif
-#ifndef TkFocusDeadWindow_TCL_DECLARED
-#define TkFocusDeadWindow_TCL_DECLARED
/* 23 */
EXTERN void TkFocusDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkFocusFilterEvent_TCL_DECLARED
-#define TkFocusFilterEvent_TCL_DECLARED
/* 24 */
EXTERN int TkFocusFilterEvent(TkWindow *winPtr,
XEvent *eventPtr);
-#endif
-#ifndef TkFocusKeyEvent_TCL_DECLARED
-#define TkFocusKeyEvent_TCL_DECLARED
/* 25 */
EXTERN TkWindow * TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr);
-#endif
-#ifndef TkFontPkgInit_TCL_DECLARED
-#define TkFontPkgInit_TCL_DECLARED
/* 26 */
EXTERN void TkFontPkgInit(TkMainInfo *mainPtr);
-#endif
-#ifndef TkFontPkgFree_TCL_DECLARED
-#define TkFontPkgFree_TCL_DECLARED
/* 27 */
EXTERN void TkFontPkgFree(TkMainInfo *mainPtr);
-#endif
-#ifndef TkFreeBindingTags_TCL_DECLARED
-#define TkFreeBindingTags_TCL_DECLARED
/* 28 */
EXTERN void TkFreeBindingTags(TkWindow *winPtr);
-#endif
-#ifndef TkpFreeCursor_TCL_DECLARED
-#define TkpFreeCursor_TCL_DECLARED
/* 29 */
EXTERN void TkpFreeCursor(TkCursor *cursorPtr);
-#endif
-#ifndef TkGetBitmapData_TCL_DECLARED
-#define TkGetBitmapData_TCL_DECLARED
/* 30 */
-EXTERN char * TkGetBitmapData(Tcl_Interp *interp, char *string,
- char *fileName, int *widthPtr,
- int *heightPtr, int *hotXPtr, int *hotYPtr);
-#endif
-#ifndef TkGetButtPoints_TCL_DECLARED
-#define TkGetButtPoints_TCL_DECLARED
+EXTERN char * TkGetBitmapData(Tcl_Interp *interp,
+ const char *string, const char *fileName,
+ int *widthPtr, int *heightPtr, int *hotXPtr,
+ int *hotYPtr);
/* 31 */
EXTERN void TkGetButtPoints(double p1[], double p2[],
double width, int project, double m1[],
double m2[]);
-#endif
-#ifndef TkGetCursorByName_TCL_DECLARED
-#define TkGetCursorByName_TCL_DECLARED
/* 32 */
EXTERN TkCursor * TkGetCursorByName(Tcl_Interp *interp,
Tk_Window tkwin, Tk_Uid string);
-#endif
-#ifndef TkGetDefaultScreenName_TCL_DECLARED
-#define TkGetDefaultScreenName_TCL_DECLARED
/* 33 */
-EXTERN CONST84_RETURN char * TkGetDefaultScreenName(Tcl_Interp *interp,
- CONST char *screenName);
-#endif
-#ifndef TkGetDisplay_TCL_DECLARED
-#define TkGetDisplay_TCL_DECLARED
+EXTERN const char * TkGetDefaultScreenName(Tcl_Interp *interp,
+ const char *screenName);
/* 34 */
EXTERN TkDisplay * TkGetDisplay(Display *display);
-#endif
-#ifndef TkGetDisplayOf_TCL_DECLARED
-#define TkGetDisplayOf_TCL_DECLARED
/* 35 */
EXTERN int TkGetDisplayOf(Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr);
-#endif
-#ifndef TkGetFocusWin_TCL_DECLARED
-#define TkGetFocusWin_TCL_DECLARED
+ Tcl_Obj *const objv[], Tk_Window *tkwinPtr);
/* 36 */
EXTERN TkWindow * TkGetFocusWin(TkWindow *winPtr);
-#endif
-#ifndef TkGetInterpNames_TCL_DECLARED
-#define TkGetInterpNames_TCL_DECLARED
/* 37 */
EXTERN int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin);
-#endif
-#ifndef TkGetMiterPoints_TCL_DECLARED
-#define TkGetMiterPoints_TCL_DECLARED
/* 38 */
EXTERN int TkGetMiterPoints(double p1[], double p2[],
double p3[], double width, double m1[],
double m2[]);
-#endif
-#ifndef TkGetPointerCoords_TCL_DECLARED
-#define TkGetPointerCoords_TCL_DECLARED
/* 39 */
EXTERN void TkGetPointerCoords(Tk_Window tkwin, int *xPtr,
int *yPtr);
-#endif
-#ifndef TkGetServerInfo_TCL_DECLARED
-#define TkGetServerInfo_TCL_DECLARED
/* 40 */
EXTERN void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin);
-#endif
-#ifndef TkGrabDeadWindow_TCL_DECLARED
-#define TkGrabDeadWindow_TCL_DECLARED
/* 41 */
EXTERN void TkGrabDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkGrabState_TCL_DECLARED
-#define TkGrabState_TCL_DECLARED
/* 42 */
EXTERN int TkGrabState(TkWindow *winPtr);
-#endif
-#ifndef TkIncludePoint_TCL_DECLARED
-#define TkIncludePoint_TCL_DECLARED
/* 43 */
EXTERN void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr);
-#endif
-#ifndef TkInOutEvents_TCL_DECLARED
-#define TkInOutEvents_TCL_DECLARED
/* 44 */
EXTERN void TkInOutEvents(XEvent *eventPtr, TkWindow *sourcePtr,
TkWindow *destPtr, int leaveType,
int enterType, Tcl_QueuePosition position);
-#endif
-#ifndef TkInstallFrameMenu_TCL_DECLARED
-#define TkInstallFrameMenu_TCL_DECLARED
/* 45 */
EXTERN void TkInstallFrameMenu(Tk_Window tkwin);
-#endif
-#ifndef TkKeysymToString_TCL_DECLARED
-#define TkKeysymToString_TCL_DECLARED
/* 46 */
-EXTERN char * TkKeysymToString(KeySym keysym);
-#endif
-#ifndef TkLineToArea_TCL_DECLARED
-#define TkLineToArea_TCL_DECLARED
+EXTERN CONST86 char * TkKeysymToString(KeySym keysym);
/* 47 */
EXTERN int TkLineToArea(double end1Ptr[], double end2Ptr[],
double rectPtr[]);
-#endif
-#ifndef TkLineToPoint_TCL_DECLARED
-#define TkLineToPoint_TCL_DECLARED
/* 48 */
EXTERN double TkLineToPoint(double end1Ptr[], double end2Ptr[],
double pointPtr[]);
-#endif
-#ifndef TkMakeBezierCurve_TCL_DECLARED
-#define TkMakeBezierCurve_TCL_DECLARED
/* 49 */
EXTERN int TkMakeBezierCurve(Tk_Canvas canvas, double *pointPtr,
int numPoints, int numSteps,
XPoint xPoints[], double dblPoints[]);
-#endif
-#ifndef TkMakeBezierPostscript_TCL_DECLARED
-#define TkMakeBezierPostscript_TCL_DECLARED
/* 50 */
EXTERN void TkMakeBezierPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, double *pointPtr,
int numPoints);
-#endif
-#ifndef TkOptionClassChanged_TCL_DECLARED
-#define TkOptionClassChanged_TCL_DECLARED
/* 51 */
EXTERN void TkOptionClassChanged(TkWindow *winPtr);
-#endif
-#ifndef TkOptionDeadWindow_TCL_DECLARED
-#define TkOptionDeadWindow_TCL_DECLARED
/* 52 */
EXTERN void TkOptionDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkOvalToArea_TCL_DECLARED
-#define TkOvalToArea_TCL_DECLARED
/* 53 */
EXTERN int TkOvalToArea(double *ovalPtr, double *rectPtr);
-#endif
-#ifndef TkOvalToPoint_TCL_DECLARED
-#define TkOvalToPoint_TCL_DECLARED
/* 54 */
EXTERN double TkOvalToPoint(double ovalPtr[], double width,
int filled, double pointPtr[]);
-#endif
-#ifndef TkpChangeFocus_TCL_DECLARED
-#define TkpChangeFocus_TCL_DECLARED
/* 55 */
EXTERN int TkpChangeFocus(TkWindow *winPtr, int force);
-#endif
-#ifndef TkpCloseDisplay_TCL_DECLARED
-#define TkpCloseDisplay_TCL_DECLARED
/* 56 */
EXTERN void TkpCloseDisplay(TkDisplay *dispPtr);
-#endif
-#ifndef TkpClaimFocus_TCL_DECLARED
-#define TkpClaimFocus_TCL_DECLARED
/* 57 */
EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force);
-#endif
-#ifndef TkpDisplayWarning_TCL_DECLARED
-#define TkpDisplayWarning_TCL_DECLARED
/* 58 */
-EXTERN void TkpDisplayWarning(CONST char *msg, CONST char *title);
-#endif
-#ifndef TkpGetAppName_TCL_DECLARED
-#define TkpGetAppName_TCL_DECLARED
+EXTERN void TkpDisplayWarning(const char *msg, const char *title);
/* 59 */
EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name);
-#endif
-#ifndef TkpGetOtherWindow_TCL_DECLARED
-#define TkpGetOtherWindow_TCL_DECLARED
/* 60 */
EXTERN TkWindow * TkpGetOtherWindow(TkWindow *winPtr);
-#endif
-#ifndef TkpGetWrapperWindow_TCL_DECLARED
-#define TkpGetWrapperWindow_TCL_DECLARED
/* 61 */
EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr);
-#endif
-#ifndef TkpInit_TCL_DECLARED
-#define TkpInit_TCL_DECLARED
/* 62 */
EXTERN int TkpInit(Tcl_Interp *interp);
-#endif
-#ifndef TkpInitializeMenuBindings_TCL_DECLARED
-#define TkpInitializeMenuBindings_TCL_DECLARED
/* 63 */
EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable);
-#endif
-#ifndef TkpMakeContainer_TCL_DECLARED
-#define TkpMakeContainer_TCL_DECLARED
/* 64 */
EXTERN void TkpMakeContainer(Tk_Window tkwin);
-#endif
-#ifndef TkpMakeMenuWindow_TCL_DECLARED
-#define TkpMakeMenuWindow_TCL_DECLARED
/* 65 */
EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient);
-#endif
-#ifndef TkpMakeWindow_TCL_DECLARED
-#define TkpMakeWindow_TCL_DECLARED
/* 66 */
EXTERN Window TkpMakeWindow(TkWindow *winPtr, Window parent);
-#endif
-#ifndef TkpMenuNotifyToplevelCreate_TCL_DECLARED
-#define TkpMenuNotifyToplevelCreate_TCL_DECLARED
/* 67 */
-EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1,
- char *menuName);
-#endif
-#ifndef TkpOpenDisplay_TCL_DECLARED
-#define TkpOpenDisplay_TCL_DECLARED
+EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp,
+ const char *menuName);
/* 68 */
-EXTERN TkDisplay * TkpOpenDisplay(CONST char *display_name);
-#endif
-#ifndef TkPointerEvent_TCL_DECLARED
-#define TkPointerEvent_TCL_DECLARED
+EXTERN TkDisplay * TkpOpenDisplay(const char *display_name);
/* 69 */
EXTERN int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr);
-#endif
-#ifndef TkPolygonToArea_TCL_DECLARED
-#define TkPolygonToArea_TCL_DECLARED
/* 70 */
EXTERN int TkPolygonToArea(double *polyPtr, int numPoints,
double *rectPtr);
-#endif
-#ifndef TkPolygonToPoint_TCL_DECLARED
-#define TkPolygonToPoint_TCL_DECLARED
/* 71 */
EXTERN double TkPolygonToPoint(double *polyPtr, int numPoints,
double *pointPtr);
-#endif
-#ifndef TkPositionInTree_TCL_DECLARED
-#define TkPositionInTree_TCL_DECLARED
/* 72 */
EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr);
-#endif
-#ifndef TkpRedirectKeyEvent_TCL_DECLARED
-#define TkpRedirectKeyEvent_TCL_DECLARED
/* 73 */
EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr,
XEvent *eventPtr);
-#endif
-#ifndef TkpSetMainMenubar_TCL_DECLARED
-#define TkpSetMainMenubar_TCL_DECLARED
/* 74 */
EXTERN void TkpSetMainMenubar(Tcl_Interp *interp,
- Tk_Window tkwin, char *menuName);
-#endif
-#ifndef TkpUseWindow_TCL_DECLARED
-#define TkpUseWindow_TCL_DECLARED
+ Tk_Window tkwin, const char *menuName);
/* 75 */
EXTERN int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *string);
-#endif
-#ifndef TkpWindowWasRecentlyDeleted_TCL_DECLARED
-#define TkpWindowWasRecentlyDeleted_TCL_DECLARED
-/* 76 */
-EXTERN int TkpWindowWasRecentlyDeleted(Window win,
- TkDisplay *dispPtr);
-#endif
-#ifndef TkQueueEventForAllChildren_TCL_DECLARED
-#define TkQueueEventForAllChildren_TCL_DECLARED
+ const char *string);
+/* Slot 76 is reserved */
/* 77 */
EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr,
XEvent *eventPtr);
-#endif
-#ifndef TkReadBitmapFile_TCL_DECLARED
-#define TkReadBitmapFile_TCL_DECLARED
/* 78 */
EXTERN int TkReadBitmapFile(Display *display, Drawable d,
- CONST char *filename,
+ const char *filename,
unsigned int *width_return,
unsigned int *height_return,
Pixmap *bitmap_return, int *x_hot_return,
int *y_hot_return);
-#endif
-#ifndef TkScrollWindow_TCL_DECLARED
-#define TkScrollWindow_TCL_DECLARED
/* 79 */
EXTERN int TkScrollWindow(Tk_Window tkwin, GC gc, int x, int y,
int width, int height, int dx, int dy,
TkRegion damageRgn);
-#endif
-#ifndef TkSelDeadWindow_TCL_DECLARED
-#define TkSelDeadWindow_TCL_DECLARED
/* 80 */
EXTERN void TkSelDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkSelEventProc_TCL_DECLARED
-#define TkSelEventProc_TCL_DECLARED
/* 81 */
EXTERN void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr);
-#endif
-#ifndef TkSelInit_TCL_DECLARED
-#define TkSelInit_TCL_DECLARED
/* 82 */
EXTERN void TkSelInit(Tk_Window tkwin);
-#endif
-#ifndef TkSelPropProc_TCL_DECLARED
-#define TkSelPropProc_TCL_DECLARED
/* 83 */
EXTERN void TkSelPropProc(XEvent *eventPtr);
-#endif
/* Slot 84 is reserved */
-#ifndef TkSetWindowMenuBar_TCL_DECLARED
-#define TkSetWindowMenuBar_TCL_DECLARED
/* 85 */
EXTERN void TkSetWindowMenuBar(Tcl_Interp *interp,
- Tk_Window tkwin, char *oldMenuName,
- char *menuName);
-#endif
-#ifndef TkStringToKeysym_TCL_DECLARED
-#define TkStringToKeysym_TCL_DECLARED
+ Tk_Window tkwin, const char *oldMenuName,
+ const char *menuName);
/* 86 */
-EXTERN KeySym TkStringToKeysym(char *name);
-#endif
-#ifndef TkThickPolyLineToArea_TCL_DECLARED
-#define TkThickPolyLineToArea_TCL_DECLARED
+EXTERN KeySym TkStringToKeysym(const char *name);
/* 87 */
EXTERN int TkThickPolyLineToArea(double *coordPtr,
int numPoints, double width, int capStyle,
int joinStyle, double *rectPtr);
-#endif
-#ifndef TkWmAddToColormapWindows_TCL_DECLARED
-#define TkWmAddToColormapWindows_TCL_DECLARED
/* 88 */
EXTERN void TkWmAddToColormapWindows(TkWindow *winPtr);
-#endif
-#ifndef TkWmDeadWindow_TCL_DECLARED
-#define TkWmDeadWindow_TCL_DECLARED
/* 89 */
EXTERN void TkWmDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkWmFocusToplevel_TCL_DECLARED
-#define TkWmFocusToplevel_TCL_DECLARED
/* 90 */
EXTERN TkWindow * TkWmFocusToplevel(TkWindow *winPtr);
-#endif
-#ifndef TkWmMapWindow_TCL_DECLARED
-#define TkWmMapWindow_TCL_DECLARED
/* 91 */
EXTERN void TkWmMapWindow(TkWindow *winPtr);
-#endif
-#ifndef TkWmNewWindow_TCL_DECLARED
-#define TkWmNewWindow_TCL_DECLARED
/* 92 */
EXTERN void TkWmNewWindow(TkWindow *winPtr);
-#endif
-#ifndef TkWmProtocolEventProc_TCL_DECLARED
-#define TkWmProtocolEventProc_TCL_DECLARED
/* 93 */
EXTERN void TkWmProtocolEventProc(TkWindow *winPtr,
XEvent *evenvPtr);
-#endif
-#ifndef TkWmRemoveFromColormapWindows_TCL_DECLARED
-#define TkWmRemoveFromColormapWindows_TCL_DECLARED
/* 94 */
EXTERN void TkWmRemoveFromColormapWindows(TkWindow *winPtr);
-#endif
-#ifndef TkWmRestackToplevel_TCL_DECLARED
-#define TkWmRestackToplevel_TCL_DECLARED
/* 95 */
EXTERN void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow,
TkWindow *otherPtr);
-#endif
-#ifndef TkWmSetClass_TCL_DECLARED
-#define TkWmSetClass_TCL_DECLARED
/* 96 */
EXTERN void TkWmSetClass(TkWindow *winPtr);
-#endif
-#ifndef TkWmUnmapWindow_TCL_DECLARED
-#define TkWmUnmapWindow_TCL_DECLARED
/* 97 */
EXTERN void TkWmUnmapWindow(TkWindow *winPtr);
-#endif
-#ifndef TkDebugBitmap_TCL_DECLARED
-#define TkDebugBitmap_TCL_DECLARED
/* 98 */
-EXTERN Tcl_Obj * TkDebugBitmap(Tk_Window tkwin, char *name);
-#endif
-#ifndef TkDebugBorder_TCL_DECLARED
-#define TkDebugBorder_TCL_DECLARED
+EXTERN Tcl_Obj * TkDebugBitmap(Tk_Window tkwin, const char *name);
/* 99 */
-EXTERN Tcl_Obj * TkDebugBorder(Tk_Window tkwin, char *name);
-#endif
-#ifndef TkDebugCursor_TCL_DECLARED
-#define TkDebugCursor_TCL_DECLARED
+EXTERN Tcl_Obj * TkDebugBorder(Tk_Window tkwin, const char *name);
/* 100 */
-EXTERN Tcl_Obj * TkDebugCursor(Tk_Window tkwin, char *name);
-#endif
-#ifndef TkDebugColor_TCL_DECLARED
-#define TkDebugColor_TCL_DECLARED
+EXTERN Tcl_Obj * TkDebugCursor(Tk_Window tkwin, const char *name);
/* 101 */
-EXTERN Tcl_Obj * TkDebugColor(Tk_Window tkwin, char *name);
-#endif
-#ifndef TkDebugConfig_TCL_DECLARED
-#define TkDebugConfig_TCL_DECLARED
+EXTERN Tcl_Obj * TkDebugColor(Tk_Window tkwin, const char *name);
/* 102 */
EXTERN Tcl_Obj * TkDebugConfig(Tcl_Interp *interp,
Tk_OptionTable table);
-#endif
-#ifndef TkDebugFont_TCL_DECLARED
-#define TkDebugFont_TCL_DECLARED
/* 103 */
-EXTERN Tcl_Obj * TkDebugFont(Tk_Window tkwin, char *name);
-#endif
-#ifndef TkFindStateNumObj_TCL_DECLARED
-#define TkFindStateNumObj_TCL_DECLARED
+EXTERN Tcl_Obj * TkDebugFont(Tk_Window tkwin, const char *name);
/* 104 */
EXTERN int TkFindStateNumObj(Tcl_Interp *interp,
- Tcl_Obj *optionPtr, CONST TkStateMap *mapPtr,
+ Tcl_Obj *optionPtr, const TkStateMap *mapPtr,
Tcl_Obj *keyPtr);
-#endif
-#ifndef TkGetBitmapPredefTable_TCL_DECLARED
-#define TkGetBitmapPredefTable_TCL_DECLARED
/* 105 */
EXTERN Tcl_HashTable * TkGetBitmapPredefTable(void);
-#endif
-#ifndef TkGetDisplayList_TCL_DECLARED
-#define TkGetDisplayList_TCL_DECLARED
/* 106 */
EXTERN TkDisplay * TkGetDisplayList(void);
-#endif
-#ifndef TkGetMainInfoList_TCL_DECLARED
-#define TkGetMainInfoList_TCL_DECLARED
/* 107 */
EXTERN TkMainInfo * TkGetMainInfoList(void);
-#endif
-#ifndef TkGetWindowFromObj_TCL_DECLARED
-#define TkGetWindowFromObj_TCL_DECLARED
/* 108 */
EXTERN int TkGetWindowFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr,
Tk_Window *windowPtr);
-#endif
-#ifndef TkpGetString_TCL_DECLARED
-#define TkpGetString_TCL_DECLARED
/* 109 */
-EXTERN char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr,
+EXTERN CONST86 char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr,
Tcl_DString *dsPtr);
-#endif
-#ifndef TkpGetSubFonts_TCL_DECLARED
-#define TkpGetSubFonts_TCL_DECLARED
/* 110 */
EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
-#endif
-#ifndef TkpGetSystemDefault_TCL_DECLARED
-#define TkpGetSystemDefault_TCL_DECLARED
/* 111 */
EXTERN Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin,
- CONST char *dbName, CONST char *className);
-#endif
-#ifndef TkpMenuThreadInit_TCL_DECLARED
-#define TkpMenuThreadInit_TCL_DECLARED
+ const char *dbName, const char *className);
/* 112 */
EXTERN void TkpMenuThreadInit(void);
-#endif
#ifdef __WIN32__ /* WIN */
-#ifndef TkClipBox_TCL_DECLARED
-#define TkClipBox_TCL_DECLARED
/* 113 */
EXTERN void TkClipBox(TkRegion rgn, XRectangle *rect_return);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkClipBox_TCL_DECLARED
-#define TkClipBox_TCL_DECLARED
/* 113 */
EXTERN void TkClipBox(TkRegion rgn, XRectangle *rect_return);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkCreateRegion_TCL_DECLARED
-#define TkCreateRegion_TCL_DECLARED
/* 114 */
EXTERN TkRegion TkCreateRegion(void);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkCreateRegion_TCL_DECLARED
-#define TkCreateRegion_TCL_DECLARED
/* 114 */
EXTERN TkRegion TkCreateRegion(void);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkDestroyRegion_TCL_DECLARED
-#define TkDestroyRegion_TCL_DECLARED
/* 115 */
EXTERN void TkDestroyRegion(TkRegion rgn);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkDestroyRegion_TCL_DECLARED
-#define TkDestroyRegion_TCL_DECLARED
/* 115 */
EXTERN void TkDestroyRegion(TkRegion rgn);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkIntersectRegion_TCL_DECLARED
-#define TkIntersectRegion_TCL_DECLARED
/* 116 */
EXTERN void TkIntersectRegion(TkRegion sra, TkRegion srcb,
TkRegion dr_return);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkIntersectRegion_TCL_DECLARED
-#define TkIntersectRegion_TCL_DECLARED
/* 116 */
EXTERN void TkIntersectRegion(TkRegion sra, TkRegion srcb,
TkRegion dr_return);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkRectInRegion_TCL_DECLARED
-#define TkRectInRegion_TCL_DECLARED
/* 117 */
EXTERN int TkRectInRegion(TkRegion rgn, int x, int y,
unsigned int width, unsigned int height);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkRectInRegion_TCL_DECLARED
-#define TkRectInRegion_TCL_DECLARED
/* 117 */
EXTERN int TkRectInRegion(TkRegion rgn, int x, int y,
unsigned int width, unsigned int height);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkSetRegion_TCL_DECLARED
-#define TkSetRegion_TCL_DECLARED
/* 118 */
EXTERN void TkSetRegion(Display *display, GC gc, TkRegion rgn);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkSetRegion_TCL_DECLARED
-#define TkSetRegion_TCL_DECLARED
/* 118 */
EXTERN void TkSetRegion(Display *display, GC gc, TkRegion rgn);
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkUnionRectWithRegion_TCL_DECLARED
-#define TkUnionRectWithRegion_TCL_DECLARED
/* 119 */
EXTERN void TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
TkRegion dr_return);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkUnionRectWithRegion_TCL_DECLARED
-#define TkUnionRectWithRegion_TCL_DECLARED
/* 119 */
EXTERN void TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
TkRegion dr_return);
-#endif
#endif /* AQUA */
/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpCreateNativeBitmap_TCL_DECLARED
-#define TkpCreateNativeBitmap_TCL_DECLARED
/* 121 */
EXTERN Pixmap TkpCreateNativeBitmap(Display *display,
- CONST char *source);
-#endif
+ const void *source);
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpDefineNativeBitmaps_TCL_DECLARED
-#define TkpDefineNativeBitmaps_TCL_DECLARED
/* 122 */
EXTERN void TkpDefineNativeBitmaps(void);
-#endif
#endif /* AQUA */
/* Slot 123 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpGetNativeAppBitmap_TCL_DECLARED
-#define TkpGetNativeAppBitmap_TCL_DECLARED
/* 124 */
EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
- CONST char *name, int *width, int *height);
-#endif
+ const char *name, int *width, int *height);
#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
@@ -805,267 +417,215 @@ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
-#ifndef TkpDrawHighlightBorder_TCL_DECLARED
-#define TkpDrawHighlightBorder_TCL_DECLARED
/* 135 */
EXTERN void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC,
GC bgGC, int highlightWidth,
Drawable drawable);
-#endif
-#ifndef TkSetFocusWin_TCL_DECLARED
-#define TkSetFocusWin_TCL_DECLARED
/* 136 */
EXTERN void TkSetFocusWin(TkWindow *winPtr, int force);
-#endif
-#ifndef TkpSetKeycodeAndState_TCL_DECLARED
-#define TkpSetKeycodeAndState_TCL_DECLARED
/* 137 */
EXTERN void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym,
XEvent *eventPtr);
-#endif
-#ifndef TkpGetKeySym_TCL_DECLARED
-#define TkpGetKeySym_TCL_DECLARED
/* 138 */
EXTERN KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr);
-#endif
-#ifndef TkpInitKeymapInfo_TCL_DECLARED
-#define TkpInitKeymapInfo_TCL_DECLARED
/* 139 */
EXTERN void TkpInitKeymapInfo(TkDisplay *dispPtr);
-#endif
-#ifndef TkPhotoGetValidRegion_TCL_DECLARED
-#define TkPhotoGetValidRegion_TCL_DECLARED
/* 140 */
EXTERN TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle);
-#endif
-#ifndef TkWmStackorderToplevel_TCL_DECLARED
-#define TkWmStackorderToplevel_TCL_DECLARED
/* 141 */
EXTERN TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr);
-#endif
-#ifndef TkFocusFree_TCL_DECLARED
-#define TkFocusFree_TCL_DECLARED
/* 142 */
EXTERN void TkFocusFree(TkMainInfo *mainPtr);
-#endif
-#ifndef TkClipCleanup_TCL_DECLARED
-#define TkClipCleanup_TCL_DECLARED
/* 143 */
EXTERN void TkClipCleanup(TkDisplay *dispPtr);
-#endif
-#ifndef TkGCCleanup_TCL_DECLARED
-#define TkGCCleanup_TCL_DECLARED
/* 144 */
EXTERN void TkGCCleanup(TkDisplay *dispPtr);
-#endif
#ifdef __WIN32__ /* WIN */
-#ifndef TkSubtractRegion_TCL_DECLARED
-#define TkSubtractRegion_TCL_DECLARED
/* 145 */
EXTERN void TkSubtractRegion(TkRegion sra, TkRegion srcb,
TkRegion dr_return);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkSubtractRegion_TCL_DECLARED
-#define TkSubtractRegion_TCL_DECLARED
/* 145 */
EXTERN void TkSubtractRegion(TkRegion sra, TkRegion srcb,
TkRegion dr_return);
-#endif
#endif /* AQUA */
-#ifndef TkStylePkgInit_TCL_DECLARED
-#define TkStylePkgInit_TCL_DECLARED
/* 146 */
EXTERN void TkStylePkgInit(TkMainInfo *mainPtr);
-#endif
-#ifndef TkStylePkgFree_TCL_DECLARED
-#define TkStylePkgFree_TCL_DECLARED
/* 147 */
EXTERN void TkStylePkgFree(TkMainInfo *mainPtr);
-#endif
-#ifndef TkToplevelWindowForCommand_TCL_DECLARED
-#define TkToplevelWindowForCommand_TCL_DECLARED
/* 148 */
EXTERN Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp,
- CONST char *cmdName);
-#endif
-#ifndef TkGetOptionSpec_TCL_DECLARED
-#define TkGetOptionSpec_TCL_DECLARED
+ const char *cmdName);
/* 149 */
-EXTERN CONST Tk_OptionSpec * TkGetOptionSpec(CONST char *name,
+EXTERN const Tk_OptionSpec * TkGetOptionSpec(const char *name,
Tk_OptionTable optionTable);
-#endif
-#ifndef TkMakeRawCurve_TCL_DECLARED
-#define TkMakeRawCurve_TCL_DECLARED
/* 150 */
EXTERN int TkMakeRawCurve(Tk_Canvas canvas, double *pointPtr,
int numPoints, int numSteps,
XPoint xPoints[], double dblPoints[]);
-#endif
-#ifndef TkMakeRawCurvePostscript_TCL_DECLARED
-#define TkMakeRawCurvePostscript_TCL_DECLARED
/* 151 */
EXTERN void TkMakeRawCurvePostscript(Tcl_Interp *interp,
Tk_Canvas canvas, double *pointPtr,
int numPoints);
-#endif
-#ifndef TkpDrawFrame_TCL_DECLARED
-#define TkpDrawFrame_TCL_DECLARED
/* 152 */
EXTERN void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border,
int highlightWidth, int borderWidth,
int relief);
-#endif
-#ifndef TkCreateThreadExitHandler_TCL_DECLARED
-#define TkCreateThreadExitHandler_TCL_DECLARED
/* 153 */
EXTERN void TkCreateThreadExitHandler(Tcl_ExitProc *proc,
ClientData clientData);
-#endif
-#ifndef TkDeleteThreadExitHandler_TCL_DECLARED
-#define TkDeleteThreadExitHandler_TCL_DECLARED
/* 154 */
EXTERN void TkDeleteThreadExitHandler(Tcl_ExitProc *proc,
ClientData clientData);
-#endif
/* Slot 155 is reserved */
-#ifndef TkpTestembedCmd_TCL_DECLARED
-#define TkpTestembedCmd_TCL_DECLARED
/* 156 */
EXTERN int TkpTestembedCmd(ClientData clientData,
Tcl_Interp *interp, int argc,
- CONST char **argv);
-#endif
-#ifndef TkpTesttextCmd_TCL_DECLARED
-#define TkpTesttextCmd_TCL_DECLARED
+ const char **argv);
/* 157 */
EXTERN int TkpTesttextCmd(ClientData dummy, Tcl_Interp *interp,
- int argc, CONST char **argv);
-#endif
-/* Slot 158 is reserved */
-/* Slot 159 is reserved */
-/* Slot 160 is reserved */
-/* Slot 161 is reserved */
-/* Slot 162 is reserved */
-/* Slot 163 is reserved */
-/* Slot 164 is reserved */
-/* Slot 165 is reserved */
-/* Slot 166 is reserved */
-/* Slot 167 is reserved */
-/* Slot 168 is reserved */
-#ifndef TkStateParseProc_TCL_DECLARED
-#define TkStateParseProc_TCL_DECLARED
+ int argc, const char **argv);
+/* 158 */
+EXTERN int TkSelGetSelection(Tcl_Interp *interp,
+ Tk_Window tkwin, Atom selection, Atom target,
+ Tk_GetSelProc *proc, ClientData clientData);
+/* 159 */
+EXTERN int TkTextGetIndex(Tcl_Interp *interp,
+ struct TkText *textPtr, const char *string,
+ struct TkTextIndex *indexPtr);
+/* 160 */
+EXTERN int TkTextIndexBackBytes(const struct TkText *textPtr,
+ const struct TkTextIndex *srcPtr, int count,
+ struct TkTextIndex *dstPtr);
+/* 161 */
+EXTERN int TkTextIndexForwBytes(const struct TkText *textPtr,
+ const struct TkTextIndex *srcPtr, int count,
+ struct TkTextIndex *dstPtr);
+/* 162 */
+EXTERN struct TkTextIndex * TkTextMakeByteIndex(TkTextBTree tree,
+ const struct TkText *textPtr, int lineIndex,
+ int byteIndex, struct TkTextIndex *indexPtr);
+/* 163 */
+EXTERN int TkTextPrintIndex(const struct TkText *textPtr,
+ const struct TkTextIndex *indexPtr,
+ char *string);
+/* 164 */
+EXTERN struct TkTextSegment * TkTextSetMark(struct TkText *textPtr,
+ const char *name,
+ struct TkTextIndex *indexPtr);
+/* 165 */
+EXTERN int TkTextXviewCmd(struct TkText *textPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+/* 166 */
+EXTERN void TkTextChanged(struct TkSharedText *sharedTextPtr,
+ struct TkText *textPtr,
+ const struct TkTextIndex *index1Ptr,
+ const struct TkTextIndex *index2Ptr);
+/* 167 */
+EXTERN int TkBTreeNumLines(TkTextBTree tree,
+ const struct TkText *textPtr);
+/* 168 */
+EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr,
+ struct TkTextDispChunk *chunkPtr, int x,
+ int y, int height, int baseline,
+ Display *display, Drawable dst, int screenY);
/* 169 */
EXTERN int TkStateParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkStatePrintProc_TCL_DECLARED
-#define TkStatePrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 170 */
-EXTERN char * TkStatePrintProc(ClientData clientData,
+EXTERN CONST86 char * TkStatePrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef TkCanvasDashParseProc_TCL_DECLARED
-#define TkCanvasDashParseProc_TCL_DECLARED
/* 171 */
EXTERN int TkCanvasDashParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkCanvasDashPrintProc_TCL_DECLARED
-#define TkCanvasDashPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 172 */
-EXTERN char * TkCanvasDashPrintProc(ClientData clientData,
+EXTERN CONST86 char * TkCanvasDashPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef TkOffsetParseProc_TCL_DECLARED
-#define TkOffsetParseProc_TCL_DECLARED
/* 173 */
EXTERN int TkOffsetParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkOffsetPrintProc_TCL_DECLARED
-#define TkOffsetPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 174 */
-EXTERN char * TkOffsetPrintProc(ClientData clientData,
+EXTERN CONST86 char * TkOffsetPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef TkPixelParseProc_TCL_DECLARED
-#define TkPixelParseProc_TCL_DECLARED
/* 175 */
EXTERN int TkPixelParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkPixelPrintProc_TCL_DECLARED
-#define TkPixelPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 176 */
-EXTERN char * TkPixelPrintProc(ClientData clientData,
+EXTERN CONST86 char * TkPixelPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef TkOrientParseProc_TCL_DECLARED
-#define TkOrientParseProc_TCL_DECLARED
/* 177 */
EXTERN int TkOrientParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkOrientPrintProc_TCL_DECLARED
-#define TkOrientPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 178 */
-EXTERN char * TkOrientPrintProc(ClientData clientData,
+EXTERN CONST86 char * TkOrientPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
-#ifndef TkSmoothParseProc_TCL_DECLARED
-#define TkSmoothParseProc_TCL_DECLARED
/* 179 */
EXTERN int TkSmoothParseProc(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *widgRec, int offset);
-#endif
-#ifndef TkSmoothPrintProc_TCL_DECLARED
-#define TkSmoothPrintProc_TCL_DECLARED
+ const char *value, char *widgRec, int offset);
/* 180 */
-EXTERN char * TkSmoothPrintProc(ClientData clientData,
+EXTERN CONST86 char * TkSmoothPrintProc(ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr);
-#endif
+/* 181 */
+EXTERN void TkDrawAngledTextLayout(Display *display,
+ Drawable drawable, GC gc,
+ Tk_TextLayout layout, int x, int y,
+ double angle, int firstChar, int lastChar);
+/* 182 */
+EXTERN void TkUnderlineAngledTextLayout(Display *display,
+ Drawable drawable, GC gc,
+ Tk_TextLayout layout, int x, int y,
+ double angle, int underline);
+/* 183 */
+EXTERN int TkIntersectAngledTextLayout(Tk_TextLayout layout,
+ int x, int y, int width, int height,
+ double angle);
+/* 184 */
+EXTERN void TkDrawAngledChars(Display *display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ const char *source, int numBytes, double x,
+ double y, double angle);
typedef struct TkIntStubs {
int magic;
- struct TkIntStubHooks *hooks;
+ const struct TkIntStubHooks *hooks;
TkWindow * (*tkAllocWindow) (TkDisplay *dispPtr, int screenNum, TkWindow *parentPtr); /* 0 */
void (*tkBezierPoints) (double control[], int numSteps, double *coordPtr); /* 1 */
void (*tkBezierScreenPoints) (Tk_Canvas canvas, double control[], int numSteps, XPoint *xPointPtr); /* 2 */
- void (*tkBindDeadWindow) (TkWindow *winPtr); /* 3 */
+ void (*reserved3)(void);
void (*tkBindEventProc) (TkWindow *winPtr, XEvent *eventPtr); /* 4 */
void (*tkBindFree) (TkMainInfo *mainPtr); /* 5 */
void (*tkBindInit) (TkMainInfo *mainPtr); /* 6 */
void (*tkChangeEventWindow) (XEvent *eventPtr, TkWindow *winPtr); /* 7 */
int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */
void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */
- int (*tkCopyAndGlobalEval) (Tcl_Interp *interp, char *script); /* 10 */
- unsigned long (*tkCreateBindingProcedure) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, CONST char *eventString, TkBindEvalProc *evalProc, TkBindFreeProc *freeProc, ClientData clientData); /* 11 */
- TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, CONST char *source, CONST char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */
- int (*tkCreateFrame) (ClientData clientData, Tcl_Interp *interp, int argc, char **argv, int toplevel, char *appName); /* 13 */
- Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, CONST char *screenName, char *baseName); /* 14 */
+ void (*reserved10)(void);
+ void (*reserved11)(void);
+ TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */
+ int (*tkCreateFrame) (ClientData clientData, Tcl_Interp *interp, int argc, const char *const *argv, int toplevel, const char *appName); /* 13 */
+ Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */
Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */
void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */
void (*tkDoConfigureNotify) (TkWindow *winPtr); /* 17 */
void (*tkDrawInsetFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding); /* 18 */
void (*tkEventDeadWindow) (TkWindow *winPtr); /* 19 */
void (*tkFillPolygon) (Tk_Canvas canvas, double *coordPtr, int numPoints, Display *display, Drawable drawable, GC gc, GC outlineGC); /* 20 */
- int (*tkFindStateNum) (Tcl_Interp *interp, CONST char *option, CONST TkStateMap *mapPtr, CONST char *strKey); /* 21 */
- char * (*tkFindStateString) (CONST TkStateMap *mapPtr, int numKey); /* 22 */
+ int (*tkFindStateNum) (Tcl_Interp *interp, const char *option, const TkStateMap *mapPtr, const char *strKey); /* 21 */
+ CONST86 char * (*tkFindStateString) (const TkStateMap *mapPtr, int numKey); /* 22 */
void (*tkFocusDeadWindow) (TkWindow *winPtr); /* 23 */
int (*tkFocusFilterEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 24 */
TkWindow * (*tkFocusKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 25 */
@@ -1073,12 +633,12 @@ typedef struct TkIntStubs {
void (*tkFontPkgFree) (TkMainInfo *mainPtr); /* 27 */
void (*tkFreeBindingTags) (TkWindow *winPtr); /* 28 */
void (*tkpFreeCursor) (TkCursor *cursorPtr); /* 29 */
- char * (*tkGetBitmapData) (Tcl_Interp *interp, char *string, char *fileName, int *widthPtr, int *heightPtr, int *hotXPtr, int *hotYPtr); /* 30 */
+ char * (*tkGetBitmapData) (Tcl_Interp *interp, const char *string, const char *fileName, int *widthPtr, int *heightPtr, int *hotXPtr, int *hotYPtr); /* 30 */
void (*tkGetButtPoints) (double p1[], double p2[], double width, int project, double m1[], double m2[]); /* 31 */
TkCursor * (*tkGetCursorByName) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid string); /* 32 */
- CONST84_RETURN char * (*tkGetDefaultScreenName) (Tcl_Interp *interp, CONST char *screenName); /* 33 */
+ const char * (*tkGetDefaultScreenName) (Tcl_Interp *interp, const char *screenName); /* 33 */
TkDisplay * (*tkGetDisplay) (Display *display); /* 34 */
- int (*tkGetDisplayOf) (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr); /* 35 */
+ int (*tkGetDisplayOf) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], Tk_Window *tkwinPtr); /* 35 */
TkWindow * (*tkGetFocusWin) (TkWindow *winPtr); /* 36 */
int (*tkGetInterpNames) (Tcl_Interp *interp, Tk_Window tkwin); /* 37 */
int (*tkGetMiterPoints) (double p1[], double p2[], double p3[], double width, double m1[], double m2[]); /* 38 */
@@ -1089,7 +649,7 @@ typedef struct TkIntStubs {
void (*tkIncludePoint) (Tk_Item *itemPtr, double *pointPtr); /* 43 */
void (*tkInOutEvents) (XEvent *eventPtr, TkWindow *sourcePtr, TkWindow *destPtr, int leaveType, int enterType, Tcl_QueuePosition position); /* 44 */
void (*tkInstallFrameMenu) (Tk_Window tkwin); /* 45 */
- char * (*tkKeysymToString) (KeySym keysym); /* 46 */
+ CONST86 char * (*tkKeysymToString) (KeySym keysym); /* 46 */
int (*tkLineToArea) (double end1Ptr[], double end2Ptr[], double rectPtr[]); /* 47 */
double (*tkLineToPoint) (double end1Ptr[], double end2Ptr[], double pointPtr[]); /* 48 */
int (*tkMakeBezierCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 49 */
@@ -1101,7 +661,7 @@ typedef struct TkIntStubs {
int (*tkpChangeFocus) (TkWindow *winPtr, int force); /* 55 */
void (*tkpCloseDisplay) (TkDisplay *dispPtr); /* 56 */
void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */
- void (*tkpDisplayWarning) (CONST char *msg, CONST char *title); /* 58 */
+ void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */
void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */
TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */
TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */
@@ -1110,26 +670,26 @@ typedef struct TkIntStubs {
void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */
void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */
Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */
- void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp1, char *menuName); /* 67 */
- TkDisplay * (*tkpOpenDisplay) (CONST char *display_name); /* 68 */
+ void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */
+ TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */
int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */
int (*tkPolygonToArea) (double *polyPtr, int numPoints, double *rectPtr); /* 70 */
double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */
int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */
void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */
- void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, char *menuName); /* 74 */
- int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, CONST char *string); /* 75 */
- int (*tkpWindowWasRecentlyDeleted) (Window win, TkDisplay *dispPtr); /* 76 */
+ void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */
+ int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */
+ void (*reserved76)(void);
void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */
- int (*tkReadBitmapFile) (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 */
+ int (*tkReadBitmapFile) (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 */
int (*tkScrollWindow) (Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, TkRegion damageRgn); /* 79 */
void (*tkSelDeadWindow) (TkWindow *winPtr); /* 80 */
void (*tkSelEventProc) (Tk_Window tkwin, XEvent *eventPtr); /* 81 */
void (*tkSelInit) (Tk_Window tkwin); /* 82 */
void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */
- VOID *reserved84;
- void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, char *oldMenuName, char *menuName); /* 85 */
- KeySym (*tkStringToKeysym) (char *name); /* 86 */
+ void (*reserved84)(void);
+ void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */
+ KeySym (*tkStringToKeysym) (const char *name); /* 86 */
int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */
void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */
void (*tkWmDeadWindow) (TkWindow *winPtr); /* 89 */
@@ -1141,133 +701,133 @@ typedef struct TkIntStubs {
void (*tkWmRestackToplevel) (TkWindow *winPtr, int aboveBelow, TkWindow *otherPtr); /* 95 */
void (*tkWmSetClass) (TkWindow *winPtr); /* 96 */
void (*tkWmUnmapWindow) (TkWindow *winPtr); /* 97 */
- Tcl_Obj * (*tkDebugBitmap) (Tk_Window tkwin, char *name); /* 98 */
- Tcl_Obj * (*tkDebugBorder) (Tk_Window tkwin, char *name); /* 99 */
- Tcl_Obj * (*tkDebugCursor) (Tk_Window tkwin, char *name); /* 100 */
- Tcl_Obj * (*tkDebugColor) (Tk_Window tkwin, char *name); /* 101 */
+ Tcl_Obj * (*tkDebugBitmap) (Tk_Window tkwin, const char *name); /* 98 */
+ Tcl_Obj * (*tkDebugBorder) (Tk_Window tkwin, const char *name); /* 99 */
+ Tcl_Obj * (*tkDebugCursor) (Tk_Window tkwin, const char *name); /* 100 */
+ Tcl_Obj * (*tkDebugColor) (Tk_Window tkwin, const char *name); /* 101 */
Tcl_Obj * (*tkDebugConfig) (Tcl_Interp *interp, Tk_OptionTable table); /* 102 */
- Tcl_Obj * (*tkDebugFont) (Tk_Window tkwin, char *name); /* 103 */
- int (*tkFindStateNumObj) (Tcl_Interp *interp, Tcl_Obj *optionPtr, CONST TkStateMap *mapPtr, Tcl_Obj *keyPtr); /* 104 */
+ Tcl_Obj * (*tkDebugFont) (Tk_Window tkwin, const char *name); /* 103 */
+ int (*tkFindStateNumObj) (Tcl_Interp *interp, Tcl_Obj *optionPtr, const TkStateMap *mapPtr, Tcl_Obj *keyPtr); /* 104 */
Tcl_HashTable * (*tkGetBitmapPredefTable) (void); /* 105 */
TkDisplay * (*tkGetDisplayList) (void); /* 106 */
TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */
int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */
- char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
+ CONST86 char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
- Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, CONST char *dbName, CONST char *className); /* 111 */
+ Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */
void (*tkpMenuThreadInit) (void); /* 112 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved113;
+ void (*reserved113)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved113; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved113)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved114;
+ void (*reserved114)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkRegion (*tkCreateRegion) (void); /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved114; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved114)(void); /* Dummy entry for stubs table backwards compatibility */
TkRegion (*tkCreateRegion) (void); /* 114 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved115;
+ void (*reserved115)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkDestroyRegion) (TkRegion rgn); /* 115 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved115; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved115)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkDestroyRegion) (TkRegion rgn); /* 115 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved116;
+ void (*reserved116)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved116; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved116)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved117;
+ void (*reserved117)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved117; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved117)(void); /* Dummy entry for stubs table backwards compatibility */
int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved118;
+ void (*reserved118)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved118; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved118)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved119;
+ void (*reserved119)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved119; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved119)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
#endif /* AQUA */
- VOID *reserved120;
+ void (*reserved120)(void);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved121;
+ void (*reserved121)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- VOID *reserved121;
+ void (*reserved121)(void);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved121; /* Dummy entry for stubs table backwards compatibility */
- Pixmap (*tkpCreateNativeBitmap) (Display *display, CONST char *source); /* 121 */
+ void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */
+ Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved122;
+ void (*reserved122)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- VOID *reserved122;
+ void (*reserved122)(void);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved122; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkpDefineNativeBitmaps) (void); /* 122 */
#endif /* AQUA */
- VOID *reserved123;
+ void (*reserved123)(void);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved124;
+ void (*reserved124)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- VOID *reserved124;
+ void (*reserved124)(void);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved124; /* Dummy entry for stubs table backwards compatibility */
- Pixmap (*tkpGetNativeAppBitmap) (Display *display, CONST char *name, int *width, int *height); /* 124 */
+ void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */
+ Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */
#endif /* AQUA */
- VOID *reserved125;
- VOID *reserved126;
- VOID *reserved127;
- VOID *reserved128;
- VOID *reserved129;
- VOID *reserved130;
- VOID *reserved131;
- VOID *reserved132;
- VOID *reserved133;
- VOID *reserved134;
+ void (*reserved125)(void);
+ void (*reserved126)(void);
+ void (*reserved127)(void);
+ void (*reserved128)(void);
+ void (*reserved129)(void);
+ void (*reserved130)(void);
+ void (*reserved131)(void);
+ void (*reserved132)(void);
+ void (*reserved133)(void);
+ void (*reserved134)(void);
void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */
void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */
void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */
@@ -1279,618 +839,360 @@ typedef struct TkIntStubs {
void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */
void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- VOID *reserved145;
+ void (*reserved145)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- VOID *reserved145; /* Dummy entry for stubs table backwards compatibility */
+ void (*reserved145)(void); /* Dummy entry for stubs table backwards compatibility */
void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */
#endif /* AQUA */
void (*tkStylePkgInit) (TkMainInfo *mainPtr); /* 146 */
void (*tkStylePkgFree) (TkMainInfo *mainPtr); /* 147 */
- Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, CONST char *cmdName); /* 148 */
- CONST Tk_OptionSpec * (*tkGetOptionSpec) (CONST char *name, Tk_OptionTable optionTable); /* 149 */
+ Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, const char *cmdName); /* 148 */
+ const Tk_OptionSpec * (*tkGetOptionSpec) (const char *name, Tk_OptionTable optionTable); /* 149 */
int (*tkMakeRawCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 150 */
void (*tkMakeRawCurvePostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 151 */
void (*tkpDrawFrame) (Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); /* 152 */
void (*tkCreateThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 153 */
void (*tkDeleteThreadExitHandler) (Tcl_ExitProc *proc, ClientData clientData); /* 154 */
- VOID *reserved155;
- int (*tkpTestembedCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 156 */
- int (*tkpTesttextCmd) (ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv); /* 157 */
- VOID *reserved158;
- VOID *reserved159;
- VOID *reserved160;
- VOID *reserved161;
- VOID *reserved162;
- VOID *reserved163;
- VOID *reserved164;
- VOID *reserved165;
- VOID *reserved166;
- VOID *reserved167;
- VOID *reserved168;
- int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 169 */
- char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 170 */
- int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 171 */
- char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 172 */
- int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 173 */
- char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 174 */
- int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 175 */
- char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 176 */
- int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 177 */
- char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 178 */
- int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, CONST char *value, char *widgRec, int offset); /* 179 */
- char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 180 */
+ void (*reserved155)(void);
+ int (*tkpTestembedCmd) (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); /* 156 */
+ int (*tkpTesttextCmd) (ClientData dummy, Tcl_Interp *interp, int argc, const char **argv); /* 157 */
+ int (*tkSelGetSelection) (Tcl_Interp *interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc *proc, ClientData clientData); /* 158 */
+ int (*tkTextGetIndex) (Tcl_Interp *interp, struct TkText *textPtr, const char *string, struct TkTextIndex *indexPtr); /* 159 */
+ int (*tkTextIndexBackBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 160 */
+ int (*tkTextIndexForwBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 161 */
+ struct TkTextIndex * (*tkTextMakeByteIndex) (TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 162 */
+ int (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */
+ struct TkTextSegment * (*tkTextSetMark) (struct TkText *textPtr, const char *name, struct TkTextIndex *indexPtr); /* 164 */
+ int (*tkTextXviewCmd) (struct TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 165 */
+ void (*tkTextChanged) (struct TkSharedText *sharedTextPtr, struct TkText *textPtr, const struct TkTextIndex *index1Ptr, const struct TkTextIndex *index2Ptr); /* 166 */
+ int (*tkBTreeNumLines) (TkTextBTree tree, const struct TkText *textPtr); /* 167 */
+ void (*tkTextInsertDisplayProc) (struct TkText *textPtr, struct TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 168 */
+ int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 169 */
+ CONST86 char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 170 */
+ int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 171 */
+ CONST86 char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 172 */
+ int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 173 */
+ CONST86 char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 174 */
+ int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 175 */
+ CONST86 char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 176 */
+ int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 177 */
+ CONST86 char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 178 */
+ int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 179 */
+ CONST86 char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 180 */
+ void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */
+ void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */
+ int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */
+ void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, double x, double y, double angle); /* 184 */
} TkIntStubs;
#ifdef __cplusplus
extern "C" {
#endif
-extern TkIntStubs *tkIntStubsPtr;
+extern const TkIntStubs *tkIntStubsPtr;
#ifdef __cplusplus
}
#endif
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+#if defined(USE_TK_STUBS)
/*
* Inline function declarations:
*/
-#ifndef TkAllocWindow
#define TkAllocWindow \
(tkIntStubsPtr->tkAllocWindow) /* 0 */
-#endif
-#ifndef TkBezierPoints
#define TkBezierPoints \
(tkIntStubsPtr->tkBezierPoints) /* 1 */
-#endif
-#ifndef TkBezierScreenPoints
#define TkBezierScreenPoints \
(tkIntStubsPtr->tkBezierScreenPoints) /* 2 */
-#endif
-#ifndef TkBindDeadWindow
-#define TkBindDeadWindow \
- (tkIntStubsPtr->tkBindDeadWindow) /* 3 */
-#endif
-#ifndef TkBindEventProc
+/* Slot 3 is reserved */
#define TkBindEventProc \
(tkIntStubsPtr->tkBindEventProc) /* 4 */
-#endif
-#ifndef TkBindFree
#define TkBindFree \
(tkIntStubsPtr->tkBindFree) /* 5 */
-#endif
-#ifndef TkBindInit
#define TkBindInit \
(tkIntStubsPtr->tkBindInit) /* 6 */
-#endif
-#ifndef TkChangeEventWindow
#define TkChangeEventWindow \
(tkIntStubsPtr->tkChangeEventWindow) /* 7 */
-#endif
-#ifndef TkClipInit
#define TkClipInit \
(tkIntStubsPtr->tkClipInit) /* 8 */
-#endif
-#ifndef TkComputeAnchor
#define TkComputeAnchor \
(tkIntStubsPtr->tkComputeAnchor) /* 9 */
-#endif
-#ifndef TkCopyAndGlobalEval
-#define TkCopyAndGlobalEval \
- (tkIntStubsPtr->tkCopyAndGlobalEval) /* 10 */
-#endif
-#ifndef TkCreateBindingProcedure
-#define TkCreateBindingProcedure \
- (tkIntStubsPtr->tkCreateBindingProcedure) /* 11 */
-#endif
-#ifndef TkCreateCursorFromData
+/* Slot 10 is reserved */
+/* Slot 11 is reserved */
#define TkCreateCursorFromData \
(tkIntStubsPtr->tkCreateCursorFromData) /* 12 */
-#endif
-#ifndef TkCreateFrame
#define TkCreateFrame \
(tkIntStubsPtr->tkCreateFrame) /* 13 */
-#endif
-#ifndef TkCreateMainWindow
#define TkCreateMainWindow \
(tkIntStubsPtr->tkCreateMainWindow) /* 14 */
-#endif
-#ifndef TkCurrentTime
#define TkCurrentTime \
(tkIntStubsPtr->tkCurrentTime) /* 15 */
-#endif
-#ifndef TkDeleteAllImages
#define TkDeleteAllImages \
(tkIntStubsPtr->tkDeleteAllImages) /* 16 */
-#endif
-#ifndef TkDoConfigureNotify
#define TkDoConfigureNotify \
(tkIntStubsPtr->tkDoConfigureNotify) /* 17 */
-#endif
-#ifndef TkDrawInsetFocusHighlight
#define TkDrawInsetFocusHighlight \
(tkIntStubsPtr->tkDrawInsetFocusHighlight) /* 18 */
-#endif
-#ifndef TkEventDeadWindow
#define TkEventDeadWindow \
(tkIntStubsPtr->tkEventDeadWindow) /* 19 */
-#endif
-#ifndef TkFillPolygon
#define TkFillPolygon \
(tkIntStubsPtr->tkFillPolygon) /* 20 */
-#endif
-#ifndef TkFindStateNum
#define TkFindStateNum \
(tkIntStubsPtr->tkFindStateNum) /* 21 */
-#endif
-#ifndef TkFindStateString
#define TkFindStateString \
(tkIntStubsPtr->tkFindStateString) /* 22 */
-#endif
-#ifndef TkFocusDeadWindow
#define TkFocusDeadWindow \
(tkIntStubsPtr->tkFocusDeadWindow) /* 23 */
-#endif
-#ifndef TkFocusFilterEvent
#define TkFocusFilterEvent \
(tkIntStubsPtr->tkFocusFilterEvent) /* 24 */
-#endif
-#ifndef TkFocusKeyEvent
#define TkFocusKeyEvent \
(tkIntStubsPtr->tkFocusKeyEvent) /* 25 */
-#endif
-#ifndef TkFontPkgInit
#define TkFontPkgInit \
(tkIntStubsPtr->tkFontPkgInit) /* 26 */
-#endif
-#ifndef TkFontPkgFree
#define TkFontPkgFree \
(tkIntStubsPtr->tkFontPkgFree) /* 27 */
-#endif
-#ifndef TkFreeBindingTags
#define TkFreeBindingTags \
(tkIntStubsPtr->tkFreeBindingTags) /* 28 */
-#endif
-#ifndef TkpFreeCursor
#define TkpFreeCursor \
(tkIntStubsPtr->tkpFreeCursor) /* 29 */
-#endif
-#ifndef TkGetBitmapData
#define TkGetBitmapData \
(tkIntStubsPtr->tkGetBitmapData) /* 30 */
-#endif
-#ifndef TkGetButtPoints
#define TkGetButtPoints \
(tkIntStubsPtr->tkGetButtPoints) /* 31 */
-#endif
-#ifndef TkGetCursorByName
#define TkGetCursorByName \
(tkIntStubsPtr->tkGetCursorByName) /* 32 */
-#endif
-#ifndef TkGetDefaultScreenName
#define TkGetDefaultScreenName \
(tkIntStubsPtr->tkGetDefaultScreenName) /* 33 */
-#endif
-#ifndef TkGetDisplay
#define TkGetDisplay \
(tkIntStubsPtr->tkGetDisplay) /* 34 */
-#endif
-#ifndef TkGetDisplayOf
#define TkGetDisplayOf \
(tkIntStubsPtr->tkGetDisplayOf) /* 35 */
-#endif
-#ifndef TkGetFocusWin
#define TkGetFocusWin \
(tkIntStubsPtr->tkGetFocusWin) /* 36 */
-#endif
-#ifndef TkGetInterpNames
#define TkGetInterpNames \
(tkIntStubsPtr->tkGetInterpNames) /* 37 */
-#endif
-#ifndef TkGetMiterPoints
#define TkGetMiterPoints \
(tkIntStubsPtr->tkGetMiterPoints) /* 38 */
-#endif
-#ifndef TkGetPointerCoords
#define TkGetPointerCoords \
(tkIntStubsPtr->tkGetPointerCoords) /* 39 */
-#endif
-#ifndef TkGetServerInfo
#define TkGetServerInfo \
(tkIntStubsPtr->tkGetServerInfo) /* 40 */
-#endif
-#ifndef TkGrabDeadWindow
#define TkGrabDeadWindow \
(tkIntStubsPtr->tkGrabDeadWindow) /* 41 */
-#endif
-#ifndef TkGrabState
#define TkGrabState \
(tkIntStubsPtr->tkGrabState) /* 42 */
-#endif
-#ifndef TkIncludePoint
#define TkIncludePoint \
(tkIntStubsPtr->tkIncludePoint) /* 43 */
-#endif
-#ifndef TkInOutEvents
#define TkInOutEvents \
(tkIntStubsPtr->tkInOutEvents) /* 44 */
-#endif
-#ifndef TkInstallFrameMenu
#define TkInstallFrameMenu \
(tkIntStubsPtr->tkInstallFrameMenu) /* 45 */
-#endif
-#ifndef TkKeysymToString
#define TkKeysymToString \
(tkIntStubsPtr->tkKeysymToString) /* 46 */
-#endif
-#ifndef TkLineToArea
#define TkLineToArea \
(tkIntStubsPtr->tkLineToArea) /* 47 */
-#endif
-#ifndef TkLineToPoint
#define TkLineToPoint \
(tkIntStubsPtr->tkLineToPoint) /* 48 */
-#endif
-#ifndef TkMakeBezierCurve
#define TkMakeBezierCurve \
(tkIntStubsPtr->tkMakeBezierCurve) /* 49 */
-#endif
-#ifndef TkMakeBezierPostscript
#define TkMakeBezierPostscript \
(tkIntStubsPtr->tkMakeBezierPostscript) /* 50 */
-#endif
-#ifndef TkOptionClassChanged
#define TkOptionClassChanged \
(tkIntStubsPtr->tkOptionClassChanged) /* 51 */
-#endif
-#ifndef TkOptionDeadWindow
#define TkOptionDeadWindow \
(tkIntStubsPtr->tkOptionDeadWindow) /* 52 */
-#endif
-#ifndef TkOvalToArea
#define TkOvalToArea \
(tkIntStubsPtr->tkOvalToArea) /* 53 */
-#endif
-#ifndef TkOvalToPoint
#define TkOvalToPoint \
(tkIntStubsPtr->tkOvalToPoint) /* 54 */
-#endif
-#ifndef TkpChangeFocus
#define TkpChangeFocus \
(tkIntStubsPtr->tkpChangeFocus) /* 55 */
-#endif
-#ifndef TkpCloseDisplay
#define TkpCloseDisplay \
(tkIntStubsPtr->tkpCloseDisplay) /* 56 */
-#endif
-#ifndef TkpClaimFocus
#define TkpClaimFocus \
(tkIntStubsPtr->tkpClaimFocus) /* 57 */
-#endif
-#ifndef TkpDisplayWarning
#define TkpDisplayWarning \
(tkIntStubsPtr->tkpDisplayWarning) /* 58 */
-#endif
-#ifndef TkpGetAppName
#define TkpGetAppName \
(tkIntStubsPtr->tkpGetAppName) /* 59 */
-#endif
-#ifndef TkpGetOtherWindow
#define TkpGetOtherWindow \
(tkIntStubsPtr->tkpGetOtherWindow) /* 60 */
-#endif
-#ifndef TkpGetWrapperWindow
#define TkpGetWrapperWindow \
(tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */
-#endif
-#ifndef TkpInit
#define TkpInit \
(tkIntStubsPtr->tkpInit) /* 62 */
-#endif
-#ifndef TkpInitializeMenuBindings
#define TkpInitializeMenuBindings \
(tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */
-#endif
-#ifndef TkpMakeContainer
#define TkpMakeContainer \
(tkIntStubsPtr->tkpMakeContainer) /* 64 */
-#endif
-#ifndef TkpMakeMenuWindow
#define TkpMakeMenuWindow \
(tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */
-#endif
-#ifndef TkpMakeWindow
#define TkpMakeWindow \
(tkIntStubsPtr->tkpMakeWindow) /* 66 */
-#endif
-#ifndef TkpMenuNotifyToplevelCreate
#define TkpMenuNotifyToplevelCreate \
(tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */
-#endif
-#ifndef TkpOpenDisplay
#define TkpOpenDisplay \
(tkIntStubsPtr->tkpOpenDisplay) /* 68 */
-#endif
-#ifndef TkPointerEvent
#define TkPointerEvent \
(tkIntStubsPtr->tkPointerEvent) /* 69 */
-#endif
-#ifndef TkPolygonToArea
#define TkPolygonToArea \
(tkIntStubsPtr->tkPolygonToArea) /* 70 */
-#endif
-#ifndef TkPolygonToPoint
#define TkPolygonToPoint \
(tkIntStubsPtr->tkPolygonToPoint) /* 71 */
-#endif
-#ifndef TkPositionInTree
#define TkPositionInTree \
(tkIntStubsPtr->tkPositionInTree) /* 72 */
-#endif
-#ifndef TkpRedirectKeyEvent
#define TkpRedirectKeyEvent \
(tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */
-#endif
-#ifndef TkpSetMainMenubar
#define TkpSetMainMenubar \
(tkIntStubsPtr->tkpSetMainMenubar) /* 74 */
-#endif
-#ifndef TkpUseWindow
#define TkpUseWindow \
(tkIntStubsPtr->tkpUseWindow) /* 75 */
-#endif
-#ifndef TkpWindowWasRecentlyDeleted
-#define TkpWindowWasRecentlyDeleted \
- (tkIntStubsPtr->tkpWindowWasRecentlyDeleted) /* 76 */
-#endif
-#ifndef TkQueueEventForAllChildren
+/* Slot 76 is reserved */
#define TkQueueEventForAllChildren \
(tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */
-#endif
-#ifndef TkReadBitmapFile
#define TkReadBitmapFile \
(tkIntStubsPtr->tkReadBitmapFile) /* 78 */
-#endif
-#ifndef TkScrollWindow
#define TkScrollWindow \
(tkIntStubsPtr->tkScrollWindow) /* 79 */
-#endif
-#ifndef TkSelDeadWindow
#define TkSelDeadWindow \
(tkIntStubsPtr->tkSelDeadWindow) /* 80 */
-#endif
-#ifndef TkSelEventProc
#define TkSelEventProc \
(tkIntStubsPtr->tkSelEventProc) /* 81 */
-#endif
-#ifndef TkSelInit
#define TkSelInit \
(tkIntStubsPtr->tkSelInit) /* 82 */
-#endif
-#ifndef TkSelPropProc
#define TkSelPropProc \
(tkIntStubsPtr->tkSelPropProc) /* 83 */
-#endif
/* Slot 84 is reserved */
-#ifndef TkSetWindowMenuBar
#define TkSetWindowMenuBar \
(tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
-#endif
-#ifndef TkStringToKeysym
#define TkStringToKeysym \
(tkIntStubsPtr->tkStringToKeysym) /* 86 */
-#endif
-#ifndef TkThickPolyLineToArea
#define TkThickPolyLineToArea \
(tkIntStubsPtr->tkThickPolyLineToArea) /* 87 */
-#endif
-#ifndef TkWmAddToColormapWindows
#define TkWmAddToColormapWindows \
(tkIntStubsPtr->tkWmAddToColormapWindows) /* 88 */
-#endif
-#ifndef TkWmDeadWindow
#define TkWmDeadWindow \
(tkIntStubsPtr->tkWmDeadWindow) /* 89 */
-#endif
-#ifndef TkWmFocusToplevel
#define TkWmFocusToplevel \
(tkIntStubsPtr->tkWmFocusToplevel) /* 90 */
-#endif
-#ifndef TkWmMapWindow
#define TkWmMapWindow \
(tkIntStubsPtr->tkWmMapWindow) /* 91 */
-#endif
-#ifndef TkWmNewWindow
#define TkWmNewWindow \
(tkIntStubsPtr->tkWmNewWindow) /* 92 */
-#endif
-#ifndef TkWmProtocolEventProc
#define TkWmProtocolEventProc \
(tkIntStubsPtr->tkWmProtocolEventProc) /* 93 */
-#endif
-#ifndef TkWmRemoveFromColormapWindows
#define TkWmRemoveFromColormapWindows \
(tkIntStubsPtr->tkWmRemoveFromColormapWindows) /* 94 */
-#endif
-#ifndef TkWmRestackToplevel
#define TkWmRestackToplevel \
(tkIntStubsPtr->tkWmRestackToplevel) /* 95 */
-#endif
-#ifndef TkWmSetClass
#define TkWmSetClass \
(tkIntStubsPtr->tkWmSetClass) /* 96 */
-#endif
-#ifndef TkWmUnmapWindow
#define TkWmUnmapWindow \
(tkIntStubsPtr->tkWmUnmapWindow) /* 97 */
-#endif
-#ifndef TkDebugBitmap
#define TkDebugBitmap \
(tkIntStubsPtr->tkDebugBitmap) /* 98 */
-#endif
-#ifndef TkDebugBorder
#define TkDebugBorder \
(tkIntStubsPtr->tkDebugBorder) /* 99 */
-#endif
-#ifndef TkDebugCursor
#define TkDebugCursor \
(tkIntStubsPtr->tkDebugCursor) /* 100 */
-#endif
-#ifndef TkDebugColor
#define TkDebugColor \
(tkIntStubsPtr->tkDebugColor) /* 101 */
-#endif
-#ifndef TkDebugConfig
#define TkDebugConfig \
(tkIntStubsPtr->tkDebugConfig) /* 102 */
-#endif
-#ifndef TkDebugFont
#define TkDebugFont \
(tkIntStubsPtr->tkDebugFont) /* 103 */
-#endif
-#ifndef TkFindStateNumObj
#define TkFindStateNumObj \
(tkIntStubsPtr->tkFindStateNumObj) /* 104 */
-#endif
-#ifndef TkGetBitmapPredefTable
#define TkGetBitmapPredefTable \
(tkIntStubsPtr->tkGetBitmapPredefTable) /* 105 */
-#endif
-#ifndef TkGetDisplayList
#define TkGetDisplayList \
(tkIntStubsPtr->tkGetDisplayList) /* 106 */
-#endif
-#ifndef TkGetMainInfoList
#define TkGetMainInfoList \
(tkIntStubsPtr->tkGetMainInfoList) /* 107 */
-#endif
-#ifndef TkGetWindowFromObj
#define TkGetWindowFromObj \
(tkIntStubsPtr->tkGetWindowFromObj) /* 108 */
-#endif
-#ifndef TkpGetString
#define TkpGetString \
(tkIntStubsPtr->tkpGetString) /* 109 */
-#endif
-#ifndef TkpGetSubFonts
#define TkpGetSubFonts \
(tkIntStubsPtr->tkpGetSubFonts) /* 110 */
-#endif
-#ifndef TkpGetSystemDefault
#define TkpGetSystemDefault \
(tkIntStubsPtr->tkpGetSystemDefault) /* 111 */
-#endif
-#ifndef TkpMenuThreadInit
#define TkpMenuThreadInit \
(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
-#endif
#ifdef __WIN32__ /* WIN */
-#ifndef TkClipBox
#define TkClipBox \
(tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkClipBox
#define TkClipBox \
(tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkCreateRegion
#define TkCreateRegion \
(tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkCreateRegion
#define TkCreateRegion \
(tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkDestroyRegion
#define TkDestroyRegion \
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkDestroyRegion
#define TkDestroyRegion \
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkIntersectRegion
#define TkIntersectRegion \
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkIntersectRegion
#define TkIntersectRegion \
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkRectInRegion
#define TkRectInRegion \
(tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkRectInRegion
#define TkRectInRegion \
(tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkSetRegion
#define TkSetRegion \
(tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkSetRegion
#define TkSetRegion \
(tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
-#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
#endif /* AQUA */
/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpCreateNativeBitmap
#define TkpCreateNativeBitmap \
(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
-#endif
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpDefineNativeBitmaps
#define TkpDefineNativeBitmaps \
(tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
-#endif
#endif /* AQUA */
/* Slot 123 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkpGetNativeAppBitmap
#define TkpGetNativeAppBitmap \
(tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
-#endif
#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
@@ -1902,164 +1204,113 @@ extern TkIntStubs *tkIntStubsPtr;
/* Slot 132 is reserved */
/* Slot 133 is reserved */
/* Slot 134 is reserved */
-#ifndef TkpDrawHighlightBorder
#define TkpDrawHighlightBorder \
(tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */
-#endif
-#ifndef TkSetFocusWin
#define TkSetFocusWin \
(tkIntStubsPtr->tkSetFocusWin) /* 136 */
-#endif
-#ifndef TkpSetKeycodeAndState
#define TkpSetKeycodeAndState \
(tkIntStubsPtr->tkpSetKeycodeAndState) /* 137 */
-#endif
-#ifndef TkpGetKeySym
#define TkpGetKeySym \
(tkIntStubsPtr->tkpGetKeySym) /* 138 */
-#endif
-#ifndef TkpInitKeymapInfo
#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__ /* WIN */
-#ifndef TkSubtractRegion
#define TkSubtractRegion \
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkSubtractRegion
#define TkSubtractRegion \
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
-#endif
#endif /* AQUA */
-#ifndef TkStylePkgInit
#define TkStylePkgInit \
(tkIntStubsPtr->tkStylePkgInit) /* 146 */
-#endif
-#ifndef TkStylePkgFree
#define TkStylePkgFree \
(tkIntStubsPtr->tkStylePkgFree) /* 147 */
-#endif
-#ifndef TkToplevelWindowForCommand
#define TkToplevelWindowForCommand \
(tkIntStubsPtr->tkToplevelWindowForCommand) /* 148 */
-#endif
-#ifndef TkGetOptionSpec
#define TkGetOptionSpec \
(tkIntStubsPtr->tkGetOptionSpec) /* 149 */
-#endif
-#ifndef TkMakeRawCurve
#define TkMakeRawCurve \
(tkIntStubsPtr->tkMakeRawCurve) /* 150 */
-#endif
-#ifndef TkMakeRawCurvePostscript
#define TkMakeRawCurvePostscript \
(tkIntStubsPtr->tkMakeRawCurvePostscript) /* 151 */
-#endif
-#ifndef TkpDrawFrame
#define TkpDrawFrame \
(tkIntStubsPtr->tkpDrawFrame) /* 152 */
-#endif
-#ifndef TkCreateThreadExitHandler
#define TkCreateThreadExitHandler \
(tkIntStubsPtr->tkCreateThreadExitHandler) /* 153 */
-#endif
-#ifndef TkDeleteThreadExitHandler
#define TkDeleteThreadExitHandler \
(tkIntStubsPtr->tkDeleteThreadExitHandler) /* 154 */
-#endif
/* Slot 155 is reserved */
-#ifndef TkpTestembedCmd
#define TkpTestembedCmd \
(tkIntStubsPtr->tkpTestembedCmd) /* 156 */
-#endif
-#ifndef TkpTesttextCmd
#define TkpTesttextCmd \
(tkIntStubsPtr->tkpTesttextCmd) /* 157 */
-#endif
-/* Slot 158 is reserved */
-/* Slot 159 is reserved */
-/* Slot 160 is reserved */
-/* Slot 161 is reserved */
-/* Slot 162 is reserved */
-/* Slot 163 is reserved */
-/* Slot 164 is reserved */
-/* Slot 165 is reserved */
-/* Slot 166 is reserved */
-/* Slot 167 is reserved */
-/* Slot 168 is reserved */
-#ifndef TkStateParseProc
+#define TkSelGetSelection \
+ (tkIntStubsPtr->tkSelGetSelection) /* 158 */
+#define TkTextGetIndex \
+ (tkIntStubsPtr->tkTextGetIndex) /* 159 */
+#define TkTextIndexBackBytes \
+ (tkIntStubsPtr->tkTextIndexBackBytes) /* 160 */
+#define TkTextIndexForwBytes \
+ (tkIntStubsPtr->tkTextIndexForwBytes) /* 161 */
+#define TkTextMakeByteIndex \
+ (tkIntStubsPtr->tkTextMakeByteIndex) /* 162 */
+#define TkTextPrintIndex \
+ (tkIntStubsPtr->tkTextPrintIndex) /* 163 */
+#define TkTextSetMark \
+ (tkIntStubsPtr->tkTextSetMark) /* 164 */
+#define TkTextXviewCmd \
+ (tkIntStubsPtr->tkTextXviewCmd) /* 165 */
+#define TkTextChanged \
+ (tkIntStubsPtr->tkTextChanged) /* 166 */
+#define TkBTreeNumLines \
+ (tkIntStubsPtr->tkBTreeNumLines) /* 167 */
+#define TkTextInsertDisplayProc \
+ (tkIntStubsPtr->tkTextInsertDisplayProc) /* 168 */
#define TkStateParseProc \
(tkIntStubsPtr->tkStateParseProc) /* 169 */
-#endif
-#ifndef TkStatePrintProc
#define TkStatePrintProc \
(tkIntStubsPtr->tkStatePrintProc) /* 170 */
-#endif
-#ifndef TkCanvasDashParseProc
#define TkCanvasDashParseProc \
(tkIntStubsPtr->tkCanvasDashParseProc) /* 171 */
-#endif
-#ifndef TkCanvasDashPrintProc
#define TkCanvasDashPrintProc \
(tkIntStubsPtr->tkCanvasDashPrintProc) /* 172 */
-#endif
-#ifndef TkOffsetParseProc
#define TkOffsetParseProc \
(tkIntStubsPtr->tkOffsetParseProc) /* 173 */
-#endif
-#ifndef TkOffsetPrintProc
#define TkOffsetPrintProc \
(tkIntStubsPtr->tkOffsetPrintProc) /* 174 */
-#endif
-#ifndef TkPixelParseProc
#define TkPixelParseProc \
(tkIntStubsPtr->tkPixelParseProc) /* 175 */
-#endif
-#ifndef TkPixelPrintProc
#define TkPixelPrintProc \
(tkIntStubsPtr->tkPixelPrintProc) /* 176 */
-#endif
-#ifndef TkOrientParseProc
#define TkOrientParseProc \
(tkIntStubsPtr->tkOrientParseProc) /* 177 */
-#endif
-#ifndef TkOrientPrintProc
#define TkOrientPrintProc \
(tkIntStubsPtr->tkOrientPrintProc) /* 178 */
-#endif
-#ifndef TkSmoothParseProc
#define TkSmoothParseProc \
(tkIntStubsPtr->tkSmoothParseProc) /* 179 */
-#endif
-#ifndef TkSmoothPrintProc
#define TkSmoothPrintProc \
(tkIntStubsPtr->tkSmoothPrintProc) /* 180 */
-#endif
+#define TkDrawAngledTextLayout \
+ (tkIntStubsPtr->tkDrawAngledTextLayout) /* 181 */
+#define TkUnderlineAngledTextLayout \
+ (tkIntStubsPtr->tkUnderlineAngledTextLayout) /* 182 */
+#define TkIntersectAngledTextLayout \
+ (tkIntStubsPtr->tkIntersectAngledTextLayout) /* 183 */
+#define TkDrawAngledChars \
+ (tkIntStubsPtr->tkDrawAngledChars) /* 184 */
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
+#endif /* defined(USE_TK_STUBS) */
/* !END!: Do not edit above this line. */
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 8de3a71..f681397 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -31,541 +31,248 @@
*/
#ifdef __WIN32__ /* WIN */
-#ifndef TkAlignImageData_TCL_DECLARED
-#define TkAlignImageData_TCL_DECLARED
/* 0 */
EXTERN char * TkAlignImageData(XImage *image, int alignment,
int bitOrder);
-#endif
/* Slot 1 is reserved */
-#ifndef TkGenerateActivateEvents_TCL_DECLARED
-#define TkGenerateActivateEvents_TCL_DECLARED
/* 2 */
EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
int active);
-#endif
-#ifndef TkpGetMS_TCL_DECLARED
-#define TkpGetMS_TCL_DECLARED
/* 3 */
EXTERN unsigned long TkpGetMS(void);
-#endif
-#ifndef TkPointerDeadWindow_TCL_DECLARED
-#define TkPointerDeadWindow_TCL_DECLARED
/* 4 */
EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkpPrintWindowId_TCL_DECLARED
-#define TkpPrintWindowId_TCL_DECLARED
/* 5 */
EXTERN void TkpPrintWindowId(char *buf, Window window);
-#endif
-#ifndef TkpScanWindowId_TCL_DECLARED
-#define TkpScanWindowId_TCL_DECLARED
/* 6 */
EXTERN int TkpScanWindowId(Tcl_Interp *interp,
- CONST char *string, Window *idPtr);
-#endif
-#ifndef TkpSetCapture_TCL_DECLARED
-#define TkpSetCapture_TCL_DECLARED
+ const char *string, Window *idPtr);
/* 7 */
EXTERN void TkpSetCapture(TkWindow *winPtr);
-#endif
-#ifndef TkpSetCursor_TCL_DECLARED
-#define TkpSetCursor_TCL_DECLARED
/* 8 */
EXTERN void TkpSetCursor(TkpCursor cursor);
-#endif
-#ifndef TkpWmSetState_TCL_DECLARED
-#define TkpWmSetState_TCL_DECLARED
/* 9 */
EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
-#endif
-#ifndef TkSetPixmapColormap_TCL_DECLARED
-#define TkSetPixmapColormap_TCL_DECLARED
/* 10 */
EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap);
-#endif
-#ifndef TkWinCancelMouseTimer_TCL_DECLARED
-#define TkWinCancelMouseTimer_TCL_DECLARED
/* 11 */
EXTERN void TkWinCancelMouseTimer(void);
-#endif
-#ifndef TkWinClipboardRender_TCL_DECLARED
-#define TkWinClipboardRender_TCL_DECLARED
/* 12 */
EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format);
-#endif
-#ifndef TkWinEmbeddedEventProc_TCL_DECLARED
-#define TkWinEmbeddedEventProc_TCL_DECLARED
/* 13 */
EXTERN LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);
-#endif
-#ifndef TkWinFillRect_TCL_DECLARED
-#define TkWinFillRect_TCL_DECLARED
/* 14 */
EXTERN void TkWinFillRect(HDC dc, int x, int y, int width,
int height, int pixel);
-#endif
-#ifndef TkWinGetBorderPixels_TCL_DECLARED
-#define TkWinGetBorderPixels_TCL_DECLARED
/* 15 */
EXTERN COLORREF TkWinGetBorderPixels(Tk_Window tkwin,
Tk_3DBorder border, int which);
-#endif
-#ifndef TkWinGetDrawableDC_TCL_DECLARED
-#define TkWinGetDrawableDC_TCL_DECLARED
/* 16 */
EXTERN HDC TkWinGetDrawableDC(Display *display, Drawable d,
TkWinDCState *state);
-#endif
-#ifndef TkWinGetModifierState_TCL_DECLARED
-#define TkWinGetModifierState_TCL_DECLARED
/* 17 */
EXTERN int TkWinGetModifierState(void);
-#endif
-#ifndef TkWinGetSystemPalette_TCL_DECLARED
-#define TkWinGetSystemPalette_TCL_DECLARED
/* 18 */
EXTERN HPALETTE TkWinGetSystemPalette(void);
-#endif
-#ifndef TkWinGetWrapperWindow_TCL_DECLARED
-#define TkWinGetWrapperWindow_TCL_DECLARED
/* 19 */
EXTERN HWND TkWinGetWrapperWindow(Tk_Window tkwin);
-#endif
-#ifndef TkWinHandleMenuEvent_TCL_DECLARED
-#define TkWinHandleMenuEvent_TCL_DECLARED
/* 20 */
EXTERN int TkWinHandleMenuEvent(HWND *phwnd, UINT *pMessage,
WPARAM *pwParam, LPARAM *plParam,
LRESULT *plResult);
-#endif
-#ifndef TkWinIndexOfColor_TCL_DECLARED
-#define TkWinIndexOfColor_TCL_DECLARED
/* 21 */
EXTERN int TkWinIndexOfColor(XColor *colorPtr);
-#endif
-#ifndef TkWinReleaseDrawableDC_TCL_DECLARED
-#define TkWinReleaseDrawableDC_TCL_DECLARED
/* 22 */
EXTERN void TkWinReleaseDrawableDC(Drawable d, HDC hdc,
TkWinDCState *state);
-#endif
-#ifndef TkWinResendEvent_TCL_DECLARED
-#define TkWinResendEvent_TCL_DECLARED
/* 23 */
EXTERN LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd,
XEvent *eventPtr);
-#endif
-#ifndef TkWinSelectPalette_TCL_DECLARED
-#define TkWinSelectPalette_TCL_DECLARED
/* 24 */
EXTERN HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap);
-#endif
-#ifndef TkWinSetMenu_TCL_DECLARED
-#define TkWinSetMenu_TCL_DECLARED
/* 25 */
EXTERN void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu);
-#endif
-#ifndef TkWinSetWindowPos_TCL_DECLARED
-#define TkWinSetWindowPos_TCL_DECLARED
/* 26 */
EXTERN void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd,
int pos);
-#endif
-#ifndef TkWinWmCleanup_TCL_DECLARED
-#define TkWinWmCleanup_TCL_DECLARED
/* 27 */
EXTERN void TkWinWmCleanup(HINSTANCE hInstance);
-#endif
-#ifndef TkWinXCleanup_TCL_DECLARED
-#define TkWinXCleanup_TCL_DECLARED
/* 28 */
EXTERN void TkWinXCleanup(ClientData clientData);
-#endif
-#ifndef TkWinXInit_TCL_DECLARED
-#define TkWinXInit_TCL_DECLARED
/* 29 */
EXTERN void TkWinXInit(HINSTANCE hInstance);
-#endif
-#ifndef TkWinSetForegroundWindow_TCL_DECLARED
-#define TkWinSetForegroundWindow_TCL_DECLARED
/* 30 */
EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr);
-#endif
-#ifndef TkWinDialogDebug_TCL_DECLARED
-#define TkWinDialogDebug_TCL_DECLARED
/* 31 */
EXTERN void TkWinDialogDebug(int debug);
-#endif
-#ifndef TkWinGetMenuSystemDefault_TCL_DECLARED
-#define TkWinGetMenuSystemDefault_TCL_DECLARED
/* 32 */
EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin,
- CONST char *dbName, CONST char *className);
-#endif
-#ifndef TkWinGetPlatformId_TCL_DECLARED
-#define TkWinGetPlatformId_TCL_DECLARED
+ const char *dbName, const char *className);
/* 33 */
EXTERN int TkWinGetPlatformId(void);
-#endif
-#ifndef TkWinSetHINSTANCE_TCL_DECLARED
-#define TkWinSetHINSTANCE_TCL_DECLARED
/* 34 */
EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance);
-#endif
-#ifndef TkWinGetPlatformTheme_TCL_DECLARED
-#define TkWinGetPlatformTheme_TCL_DECLARED
/* 35 */
EXTERN int TkWinGetPlatformTheme(void);
-#endif
-#ifndef TkWinChildProc_TCL_DECLARED
-#define TkWinChildProc_TCL_DECLARED
/* 36 */
EXTERN LRESULT CALLBACK TkWinChildProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef TkGenerateActivateEvents_TCL_DECLARED
-#define TkGenerateActivateEvents_TCL_DECLARED
/* 0 */
EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
int active);
-#endif
/* Slot 1 is reserved */
/* Slot 2 is reserved */
-#ifndef TkPointerDeadWindow_TCL_DECLARED
-#define TkPointerDeadWindow_TCL_DECLARED
/* 3 */
EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
-#endif
-#ifndef TkpSetCapture_TCL_DECLARED
-#define TkpSetCapture_TCL_DECLARED
/* 4 */
EXTERN void TkpSetCapture(TkWindow *winPtr);
-#endif
-#ifndef TkpSetCursor_TCL_DECLARED
-#define TkpSetCursor_TCL_DECLARED
/* 5 */
EXTERN void TkpSetCursor(TkpCursor cursor);
-#endif
-#ifndef TkpWmSetState_TCL_DECLARED
-#define TkpWmSetState_TCL_DECLARED
/* 6 */
EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
-#endif
-#ifndef TkAboutDlg_TCL_DECLARED
-#define TkAboutDlg_TCL_DECLARED
/* 7 */
EXTERN void TkAboutDlg(void);
-#endif
-#ifndef TkMacOSXButtonKeyState_TCL_DECLARED
-#define TkMacOSXButtonKeyState_TCL_DECLARED
/* 8 */
EXTERN unsigned int TkMacOSXButtonKeyState(void);
-#endif
-#ifndef TkMacOSXClearMenubarActive_TCL_DECLARED
-#define TkMacOSXClearMenubarActive_TCL_DECLARED
/* 9 */
EXTERN void TkMacOSXClearMenubarActive(void);
-#endif
-#ifndef TkMacOSXDispatchMenuEvent_TCL_DECLARED
-#define TkMacOSXDispatchMenuEvent_TCL_DECLARED
/* 10 */
EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index);
-#endif
-#ifndef TkMacOSXInstallCursor_TCL_DECLARED
-#define TkMacOSXInstallCursor_TCL_DECLARED
/* 11 */
EXTERN void TkMacOSXInstallCursor(int resizeOverride);
-#endif
-#ifndef TkMacOSXHandleTearoffMenu_TCL_DECLARED
-#define TkMacOSXHandleTearoffMenu_TCL_DECLARED
/* 12 */
EXTERN void TkMacOSXHandleTearoffMenu(void);
-#endif
/* Slot 13 is reserved */
-#ifndef TkMacOSXDoHLEvent_TCL_DECLARED
-#define TkMacOSXDoHLEvent_TCL_DECLARED
/* 14 */
-EXTERN int TkMacOSXDoHLEvent(EventRecord *theEvent);
-#endif
+EXTERN int TkMacOSXDoHLEvent(void *theEvent);
/* Slot 15 is reserved */
-#ifndef TkMacOSXGetXWindow_TCL_DECLARED
-#define TkMacOSXGetXWindow_TCL_DECLARED
/* 16 */
-EXTERN Window TkMacOSXGetXWindow(WindowRef macWinPtr);
-#endif
-#ifndef TkMacOSXGrowToplevel_TCL_DECLARED
-#define TkMacOSXGrowToplevel_TCL_DECLARED
+EXTERN Window TkMacOSXGetXWindow(void *macWinPtr);
/* 17 */
-EXTERN int TkMacOSXGrowToplevel(WindowRef whichWindow,
- Point start);
-#endif
-#ifndef TkMacOSXHandleMenuSelect_TCL_DECLARED
-#define TkMacOSXHandleMenuSelect_TCL_DECLARED
+EXTERN int TkMacOSXGrowToplevel(void *whichWindow, XPoint start);
/* 18 */
-EXTERN void TkMacOSXHandleMenuSelect(MenuID theMenu,
- MenuItemIndex theItem, int optionKeyPressed);
-#endif
+EXTERN void TkMacOSXHandleMenuSelect(short theMenu,
+ unsigned short theItem, int optionKeyPressed);
/* Slot 19 is reserved */
/* Slot 20 is reserved */
-#ifndef TkMacOSXInvalidateWindow_TCL_DECLARED
-#define TkMacOSXInvalidateWindow_TCL_DECLARED
/* 21 */
EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin,
int flag);
-#endif
-#ifndef TkMacOSXIsCharacterMissing_TCL_DECLARED
-#define TkMacOSXIsCharacterMissing_TCL_DECLARED
/* 22 */
EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont,
unsigned int searchChar);
-#endif
-#ifndef TkMacOSXMakeRealWindowExist_TCL_DECLARED
-#define TkMacOSXMakeRealWindowExist_TCL_DECLARED
/* 23 */
EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXMakeStippleMap_TCL_DECLARED
-#define TkMacOSXMakeStippleMap_TCL_DECLARED
/* 24 */
-EXTERN BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2);
-#endif
-#ifndef TkMacOSXMenuClick_TCL_DECLARED
-#define TkMacOSXMenuClick_TCL_DECLARED
+EXTERN void * TkMacOSXMakeStippleMap(Drawable d1, Drawable d2);
/* 25 */
EXTERN void TkMacOSXMenuClick(void);
-#endif
-#ifndef TkMacOSXRegisterOffScreenWindow_TCL_DECLARED
-#define TkMacOSXRegisterOffScreenWindow_TCL_DECLARED
/* 26 */
EXTERN void TkMacOSXRegisterOffScreenWindow(Window window,
- GWorldPtr portPtr);
-#endif
-#ifndef TkMacOSXResizable_TCL_DECLARED
-#define TkMacOSXResizable_TCL_DECLARED
+ void *portPtr);
/* 27 */
EXTERN int TkMacOSXResizable(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXSetHelpMenuItemCount_TCL_DECLARED
-#define TkMacOSXSetHelpMenuItemCount_TCL_DECLARED
/* 28 */
EXTERN void TkMacOSXSetHelpMenuItemCount(void);
-#endif
-#ifndef TkMacOSXSetScrollbarGrow_TCL_DECLARED
-#define TkMacOSXSetScrollbarGrow_TCL_DECLARED
/* 29 */
EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag);
-#endif
-#ifndef TkMacOSXSetUpClippingRgn_TCL_DECLARED
-#define TkMacOSXSetUpClippingRgn_TCL_DECLARED
/* 30 */
EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable);
-#endif
-#ifndef TkMacOSXSetUpGraphicsPort_TCL_DECLARED
-#define TkMacOSXSetUpGraphicsPort_TCL_DECLARED
/* 31 */
-EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, GWorldPtr destPort);
-#endif
-#ifndef TkMacOSXUpdateClipRgn_TCL_DECLARED
-#define TkMacOSXUpdateClipRgn_TCL_DECLARED
+EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort);
/* 32 */
EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXUnregisterMacWindow_TCL_DECLARED
-#define TkMacOSXUnregisterMacWindow_TCL_DECLARED
/* 33 */
-EXTERN void TkMacOSXUnregisterMacWindow(WindowRef portPtr);
-#endif
-#ifndef TkMacOSXUseMenuID_TCL_DECLARED
-#define TkMacOSXUseMenuID_TCL_DECLARED
+EXTERN void TkMacOSXUnregisterMacWindow(void *portPtr);
/* 34 */
EXTERN int TkMacOSXUseMenuID(short macID);
-#endif
-#ifndef TkMacOSXVisableClipRgn_TCL_DECLARED
-#define TkMacOSXVisableClipRgn_TCL_DECLARED
/* 35 */
-EXTERN RgnHandle TkMacOSXVisableClipRgn(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXWinBounds_TCL_DECLARED
-#define TkMacOSXWinBounds_TCL_DECLARED
+EXTERN TkRegion TkMacOSXVisableClipRgn(TkWindow *winPtr);
/* 36 */
-EXTERN void TkMacOSXWinBounds(TkWindow *winPtr, Rect *geometry);
-#endif
-#ifndef TkMacOSXWindowOffset_TCL_DECLARED
-#define TkMacOSXWindowOffset_TCL_DECLARED
+EXTERN void TkMacOSXWinBounds(TkWindow *winPtr, void *geometry);
/* 37 */
-EXTERN void TkMacOSXWindowOffset(WindowRef wRef, int *xOffset,
+EXTERN void TkMacOSXWindowOffset(void *wRef, int *xOffset,
int *yOffset);
-#endif
-#ifndef TkSetMacColor_TCL_DECLARED
-#define TkSetMacColor_TCL_DECLARED
/* 38 */
-EXTERN int TkSetMacColor(unsigned long pixel,
- RGBColor *macColor);
-#endif
-#ifndef TkSetWMName_TCL_DECLARED
-#define TkSetWMName_TCL_DECLARED
+EXTERN int TkSetMacColor(unsigned long pixel, void *macColor);
/* 39 */
EXTERN void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid);
-#endif
-#ifndef TkSuspendClipboard_TCL_DECLARED
-#define TkSuspendClipboard_TCL_DECLARED
/* 40 */
EXTERN void TkSuspendClipboard(void);
-#endif
-#ifndef TkMacOSXZoomToplevel_TCL_DECLARED
-#define TkMacOSXZoomToplevel_TCL_DECLARED
/* 41 */
-EXTERN int TkMacOSXZoomToplevel(WindowPtr whichWindow,
+EXTERN int TkMacOSXZoomToplevel(void *whichWindow,
short zoomPart);
-#endif
-#ifndef Tk_TopCoordsToWindow_TCL_DECLARED
-#define Tk_TopCoordsToWindow_TCL_DECLARED
/* 42 */
EXTERN Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX,
int rootY, int *newX, int *newY);
-#endif
-#ifndef TkMacOSXContainerId_TCL_DECLARED
-#define TkMacOSXContainerId_TCL_DECLARED
/* 43 */
EXTERN MacDrawable * TkMacOSXContainerId(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXGetHostToplevel_TCL_DECLARED
-#define TkMacOSXGetHostToplevel_TCL_DECLARED
/* 44 */
EXTERN MacDrawable * TkMacOSXGetHostToplevel(TkWindow *winPtr);
-#endif
-#ifndef TkMacOSXPreprocessMenu_TCL_DECLARED
-#define TkMacOSXPreprocessMenu_TCL_DECLARED
/* 45 */
EXTERN void TkMacOSXPreprocessMenu(void);
-#endif
-#ifndef TkpIsWindowFloating_TCL_DECLARED
-#define TkpIsWindowFloating_TCL_DECLARED
/* 46 */
-EXTERN int TkpIsWindowFloating(WindowRef window);
-#endif
-#ifndef TkMacOSXGetCapture_TCL_DECLARED
-#define TkMacOSXGetCapture_TCL_DECLARED
+EXTERN int TkpIsWindowFloating(void *window);
/* 47 */
EXTERN Tk_Window TkMacOSXGetCapture(void);
-#endif
/* Slot 48 is reserved */
-#ifndef TkGetTransientMaster_TCL_DECLARED
-#define TkGetTransientMaster_TCL_DECLARED
/* 49 */
EXTERN Window TkGetTransientMaster(TkWindow *winPtr);
-#endif
-#ifndef TkGenerateButtonEvent_TCL_DECLARED
-#define TkGenerateButtonEvent_TCL_DECLARED
/* 50 */
EXTERN int TkGenerateButtonEvent(int x, int y, Window window,
unsigned int state);
-#endif
-#ifndef TkGenWMDestroyEvent_TCL_DECLARED
-#define TkGenWMDestroyEvent_TCL_DECLARED
/* 51 */
EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
-#endif
/* Slot 52 is reserved */
-#ifndef TkpGetMS_TCL_DECLARED
-#define TkpGetMS_TCL_DECLARED
/* 53 */
EXTERN unsigned long TkpGetMS(void);
-#endif
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
-#ifndef TkCreateXEventSource_TCL_DECLARED
-#define TkCreateXEventSource_TCL_DECLARED
/* 0 */
EXTERN void TkCreateXEventSource(void);
-#endif
-#ifndef TkFreeWindowId_TCL_DECLARED
-#define TkFreeWindowId_TCL_DECLARED
-/* 1 */
-EXTERN void TkFreeWindowId(TkDisplay *dispPtr, Window w);
-#endif
-#ifndef TkInitXId_TCL_DECLARED
-#define TkInitXId_TCL_DECLARED
-/* 2 */
-EXTERN void TkInitXId(TkDisplay *dispPtr);
-#endif
-#ifndef TkpCmapStressed_TCL_DECLARED
-#define TkpCmapStressed_TCL_DECLARED
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
/* 3 */
EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap);
-#endif
-#ifndef TkpSync_TCL_DECLARED
-#define TkpSync_TCL_DECLARED
/* 4 */
EXTERN void TkpSync(Display *display);
-#endif
-#ifndef TkUnixContainerId_TCL_DECLARED
-#define TkUnixContainerId_TCL_DECLARED
/* 5 */
EXTERN Window TkUnixContainerId(TkWindow *winPtr);
-#endif
-#ifndef TkUnixDoOneXEvent_TCL_DECLARED
-#define TkUnixDoOneXEvent_TCL_DECLARED
/* 6 */
EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr);
-#endif
-#ifndef TkUnixSetMenubar_TCL_DECLARED
-#define TkUnixSetMenubar_TCL_DECLARED
/* 7 */
EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar);
-#endif
-#ifndef TkpScanWindowId_TCL_DECLARED
-#define TkpScanWindowId_TCL_DECLARED
/* 8 */
EXTERN int TkpScanWindowId(Tcl_Interp *interp,
- CONST char *string, Window *idPtr);
-#endif
-#ifndef TkWmCleanup_TCL_DECLARED
-#define TkWmCleanup_TCL_DECLARED
+ const char *string, Window *idPtr);
/* 9 */
EXTERN void TkWmCleanup(TkDisplay *dispPtr);
-#endif
-#ifndef TkSendCleanup_TCL_DECLARED
-#define TkSendCleanup_TCL_DECLARED
/* 10 */
EXTERN void TkSendCleanup(TkDisplay *dispPtr);
-#endif
-#ifndef TkFreeXId_TCL_DECLARED
-#define TkFreeXId_TCL_DECLARED
-/* 11 */
-EXTERN void TkFreeXId(TkDisplay *dispPtr);
-#endif
-#ifndef TkpWmSetState_TCL_DECLARED
-#define TkpWmSetState_TCL_DECLARED
+/* Slot 11 is reserved */
/* 12 */
EXTERN int TkpWmSetState(TkWindow *winPtr, int state);
-#endif
-#ifndef TkpTestsendCmd_TCL_DECLARED
-#define TkpTestsendCmd_TCL_DECLARED
/* 13 */
EXTERN int TkpTestsendCmd(ClientData clientData,
Tcl_Interp *interp, int argc,
- CONST char **argv);
-#endif
+ const char **argv);
#endif /* X11 */
typedef struct TkIntPlatStubs {
int magic;
- struct TkIntPlatStubHooks *hooks;
+ const struct TkIntPlatStubHooks *hooks;
#ifdef __WIN32__ /* WIN */
char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */
- VOID *reserved1;
+ void (*reserved1)(void);
void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */
unsigned long (*tkpGetMS) (void); /* 3 */
void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */
void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */
- int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 6 */
+ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */
void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */
void (*tkpSetCursor) (TkpCursor cursor); /* 8 */
void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */
@@ -591,7 +298,7 @@ typedef struct TkIntPlatStubs {
void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */
void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */
void (*tkWinDialogDebug) (int debug); /* 31 */
- Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, CONST char *dbName, CONST char *className); /* 32 */
+ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */
int (*tkWinGetPlatformId) (void); /* 33 */
void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */
int (*tkWinGetPlatformTheme) (void); /* 35 */
@@ -599,8 +306,8 @@ typedef struct TkIntPlatStubs {
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */
- VOID *reserved1;
- VOID *reserved2;
+ void (*reserved1)(void);
+ void (*reserved2)(void);
void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */
void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */
void (*tkpSetCursor) (TkpCursor cursor); /* 5 */
@@ -611,481 +318,286 @@ typedef struct TkIntPlatStubs {
int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */
void (*tkMacOSXInstallCursor) (int resizeOverride); /* 11 */
void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */
- VOID *reserved13;
- int (*tkMacOSXDoHLEvent) (EventRecord *theEvent); /* 14 */
- VOID *reserved15;
- Window (*tkMacOSXGetXWindow) (WindowRef macWinPtr); /* 16 */
- int (*tkMacOSXGrowToplevel) (WindowRef whichWindow, Point start); /* 17 */
- void (*tkMacOSXHandleMenuSelect) (MenuID theMenu, MenuItemIndex theItem, int optionKeyPressed); /* 18 */
- VOID *reserved19;
- VOID *reserved20;
+ void (*reserved13)(void);
+ int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */
+ void (*reserved15)(void);
+ Window (*tkMacOSXGetXWindow) (void *macWinPtr); /* 16 */
+ int (*tkMacOSXGrowToplevel) (void *whichWindow, XPoint start); /* 17 */
+ void (*tkMacOSXHandleMenuSelect) (short theMenu, unsigned short theItem, int optionKeyPressed); /* 18 */
+ void (*reserved19)(void);
+ void (*reserved20)(void);
void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */
int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */
void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */
- BitMapPtr (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */
+ void * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */
void (*tkMacOSXMenuClick) (void); /* 25 */
- void (*tkMacOSXRegisterOffScreenWindow) (Window window, GWorldPtr portPtr); /* 26 */
+ void (*tkMacOSXRegisterOffScreenWindow) (Window window, void *portPtr); /* 26 */
int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */
void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */
void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */
void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */
- void (*tkMacOSXSetUpGraphicsPort) (GC gc, GWorldPtr destPort); /* 31 */
+ void (*tkMacOSXSetUpGraphicsPort) (GC gc, void *destPort); /* 31 */
void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */
- void (*tkMacOSXUnregisterMacWindow) (WindowRef portPtr); /* 33 */
+ void (*tkMacOSXUnregisterMacWindow) (void *portPtr); /* 33 */
int (*tkMacOSXUseMenuID) (short macID); /* 34 */
- RgnHandle (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */
- void (*tkMacOSXWinBounds) (TkWindow *winPtr, Rect *geometry); /* 36 */
- void (*tkMacOSXWindowOffset) (WindowRef wRef, int *xOffset, int *yOffset); /* 37 */
- int (*tkSetMacColor) (unsigned long pixel, RGBColor *macColor); /* 38 */
+ TkRegion (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */
+ void (*tkMacOSXWinBounds) (TkWindow *winPtr, void *geometry); /* 36 */
+ void (*tkMacOSXWindowOffset) (void *wRef, int *xOffset, int *yOffset); /* 37 */
+ int (*tkSetMacColor) (unsigned long pixel, void *macColor); /* 38 */
void (*tkSetWMName) (TkWindow *winPtr, Tk_Uid titleUid); /* 39 */
void (*tkSuspendClipboard) (void); /* 40 */
- int (*tkMacOSXZoomToplevel) (WindowPtr whichWindow, short zoomPart); /* 41 */
+ int (*tkMacOSXZoomToplevel) (void *whichWindow, short zoomPart); /* 41 */
Tk_Window (*tk_TopCoordsToWindow) (Tk_Window tkwin, int rootX, int rootY, int *newX, int *newY); /* 42 */
MacDrawable * (*tkMacOSXContainerId) (TkWindow *winPtr); /* 43 */
MacDrawable * (*tkMacOSXGetHostToplevel) (TkWindow *winPtr); /* 44 */
void (*tkMacOSXPreprocessMenu) (void); /* 45 */
- int (*tkpIsWindowFloating) (WindowRef window); /* 46 */
+ int (*tkpIsWindowFloating) (void *window); /* 46 */
Tk_Window (*tkMacOSXGetCapture) (void); /* 47 */
- VOID *reserved48;
+ void (*reserved48)(void);
Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */
int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */
void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */
- VOID *reserved52;
+ void (*reserved52)(void);
unsigned long (*tkpGetMS) (void); /* 53 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
void (*tkCreateXEventSource) (void); /* 0 */
- void (*tkFreeWindowId) (TkDisplay *dispPtr, Window w); /* 1 */
- void (*tkInitXId) (TkDisplay *dispPtr); /* 2 */
+ void (*reserved1)(void);
+ void (*reserved2)(void);
int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */
void (*tkpSync) (Display *display); /* 4 */
Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */
int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */
void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */
- int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 8 */
+ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */
void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */
void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */
- void (*tkFreeXId) (TkDisplay *dispPtr); /* 11 */
+ void (*reserved11)(void);
int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */
- int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 13 */
+ int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); /* 13 */
#endif /* X11 */
} TkIntPlatStubs;
#ifdef __cplusplus
extern "C" {
#endif
-extern TkIntPlatStubs *tkIntPlatStubsPtr;
+extern const TkIntPlatStubs *tkIntPlatStubsPtr;
#ifdef __cplusplus
}
#endif
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+#if defined(USE_TK_STUBS)
/*
* Inline function declarations:
*/
#ifdef __WIN32__ /* WIN */
-#ifndef TkAlignImageData
#define TkAlignImageData \
(tkIntPlatStubsPtr->tkAlignImageData) /* 0 */
-#endif
/* Slot 1 is reserved */
-#ifndef TkGenerateActivateEvents
#define TkGenerateActivateEvents \
(tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */
-#endif
-#ifndef TkpGetMS
#define TkpGetMS \
(tkIntPlatStubsPtr->tkpGetMS) /* 3 */
-#endif
-#ifndef TkPointerDeadWindow
#define TkPointerDeadWindow \
(tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */
-#endif
-#ifndef TkpPrintWindowId
#define TkpPrintWindowId \
(tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */
-#endif
-#ifndef TkpScanWindowId
#define TkpScanWindowId \
(tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */
-#endif
-#ifndef TkpSetCapture
#define TkpSetCapture \
(tkIntPlatStubsPtr->tkpSetCapture) /* 7 */
-#endif
-#ifndef TkpSetCursor
#define TkpSetCursor \
(tkIntPlatStubsPtr->tkpSetCursor) /* 8 */
-#endif
-#ifndef TkpWmSetState
#define TkpWmSetState \
(tkIntPlatStubsPtr->tkpWmSetState) /* 9 */
-#endif
-#ifndef TkSetPixmapColormap
#define TkSetPixmapColormap \
(tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */
-#endif
-#ifndef TkWinCancelMouseTimer
#define TkWinCancelMouseTimer \
(tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */
-#endif
-#ifndef TkWinClipboardRender
#define TkWinClipboardRender \
(tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */
-#endif
-#ifndef TkWinEmbeddedEventProc
#define TkWinEmbeddedEventProc \
(tkIntPlatStubsPtr->tkWinEmbeddedEventProc) /* 13 */
-#endif
-#ifndef TkWinFillRect
#define TkWinFillRect \
(tkIntPlatStubsPtr->tkWinFillRect) /* 14 */
-#endif
-#ifndef TkWinGetBorderPixels
#define TkWinGetBorderPixels \
(tkIntPlatStubsPtr->tkWinGetBorderPixels) /* 15 */
-#endif
-#ifndef TkWinGetDrawableDC
#define TkWinGetDrawableDC \
(tkIntPlatStubsPtr->tkWinGetDrawableDC) /* 16 */
-#endif
-#ifndef TkWinGetModifierState
#define TkWinGetModifierState \
(tkIntPlatStubsPtr->tkWinGetModifierState) /* 17 */
-#endif
-#ifndef TkWinGetSystemPalette
#define TkWinGetSystemPalette \
(tkIntPlatStubsPtr->tkWinGetSystemPalette) /* 18 */
-#endif
-#ifndef TkWinGetWrapperWindow
#define TkWinGetWrapperWindow \
(tkIntPlatStubsPtr->tkWinGetWrapperWindow) /* 19 */
-#endif
-#ifndef TkWinHandleMenuEvent
#define TkWinHandleMenuEvent \
(tkIntPlatStubsPtr->tkWinHandleMenuEvent) /* 20 */
-#endif
-#ifndef TkWinIndexOfColor
#define TkWinIndexOfColor \
(tkIntPlatStubsPtr->tkWinIndexOfColor) /* 21 */
-#endif
-#ifndef TkWinReleaseDrawableDC
#define TkWinReleaseDrawableDC \
(tkIntPlatStubsPtr->tkWinReleaseDrawableDC) /* 22 */
-#endif
-#ifndef TkWinResendEvent
#define TkWinResendEvent \
(tkIntPlatStubsPtr->tkWinResendEvent) /* 23 */
-#endif
-#ifndef TkWinSelectPalette
#define TkWinSelectPalette \
(tkIntPlatStubsPtr->tkWinSelectPalette) /* 24 */
-#endif
-#ifndef TkWinSetMenu
#define TkWinSetMenu \
(tkIntPlatStubsPtr->tkWinSetMenu) /* 25 */
-#endif
-#ifndef TkWinSetWindowPos
#define TkWinSetWindowPos \
(tkIntPlatStubsPtr->tkWinSetWindowPos) /* 26 */
-#endif
-#ifndef TkWinWmCleanup
#define TkWinWmCleanup \
(tkIntPlatStubsPtr->tkWinWmCleanup) /* 27 */
-#endif
-#ifndef TkWinXCleanup
#define TkWinXCleanup \
(tkIntPlatStubsPtr->tkWinXCleanup) /* 28 */
-#endif
-#ifndef TkWinXInit
#define TkWinXInit \
(tkIntPlatStubsPtr->tkWinXInit) /* 29 */
-#endif
-#ifndef TkWinSetForegroundWindow
#define TkWinSetForegroundWindow \
(tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */
-#endif
-#ifndef TkWinDialogDebug
#define TkWinDialogDebug \
(tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */
-#endif
-#ifndef TkWinGetMenuSystemDefault
#define TkWinGetMenuSystemDefault \
(tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */
-#endif
-#ifndef TkWinGetPlatformId
#define TkWinGetPlatformId \
(tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */
-#endif
-#ifndef TkWinSetHINSTANCE
#define TkWinSetHINSTANCE \
(tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */
-#endif
-#ifndef TkWinGetPlatformTheme
#define TkWinGetPlatformTheme \
(tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */
-#endif
-#ifndef TkWinChildProc
#define TkWinChildProc \
(tkIntPlatStubsPtr->tkWinChildProc) /* 36 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#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 /* AQUA */
#if !(defined(__WIN32__) || 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
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
#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
+/* Slot 11 is reserved */
#define TkpWmSetState \
(tkIntPlatStubsPtr->tkpWmSetState) /* 12 */
-#endif
-#ifndef TkpTestsendCmd
#define TkpTestsendCmd \
(tkIntPlatStubsPtr->tkpTestsendCmd) /* 13 */
-#endif
#endif /* X11 */
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
+#endif /* defined(USE_TK_STUBS) */
/* !END!: Do not edit above this line. */
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index bf80342..c816779 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -13,6 +13,16 @@
#ifndef _TKINTXLIBDECLS
#define _TKINTXLIBDECLS
+/*
+ * WARNING: This file is automatically generated by the tools/genStubs.tcl
+ * script. Any modifications to the function declarations below should be made
+ * in the generic/tkInt.decls script.
+ */
+
+#ifndef _TCL
+# include <tcl.h>
+#endif
+
#include "X11/Xutil.h"
#ifdef BUILD_tk
@@ -20,12 +30,6 @@
#define TCL_STORAGE_CLASS DLLEXPORT
#endif
-/*
- * WARNING: This file is automatically generated by the tools/genStubs.tcl
- * script. Any modifications to the function declarations below should be made
- * in the generic/tkInt.decls script.
- */
-
/* !BEGIN!: Do not edit below this line. */
/*
@@ -33,1165 +37,571 @@
*/
#ifdef __WIN32__ /* WIN */
-#ifndef XSetDashes_TCL_DECLARED
-#define XSetDashes_TCL_DECLARED
/* 0 */
EXTERN void XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n);
-#endif
-#ifndef XGetModifierMapping_TCL_DECLARED
-#define XGetModifierMapping_TCL_DECLARED
/* 1 */
EXTERN XModifierKeymap * XGetModifierMapping(Display *d);
-#endif
-#ifndef XCreateImage_TCL_DECLARED
-#define XCreateImage_TCL_DECLARED
/* 2 */
EXTERN 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);
-#endif
-#ifndef XGetImage_TCL_DECLARED
-#define XGetImage_TCL_DECLARED
/* 3 */
EXTERN XImage * XGetImage(Display *d, Drawable dr, int i1, int i2,
unsigned int ui1, unsigned int ui2,
unsigned long ul, int i3);
-#endif
-#ifndef XGetAtomName_TCL_DECLARED
-#define XGetAtomName_TCL_DECLARED
/* 4 */
EXTERN char * XGetAtomName(Display *d, Atom a);
-#endif
-#ifndef XKeysymToString_TCL_DECLARED
-#define XKeysymToString_TCL_DECLARED
/* 5 */
EXTERN char * XKeysymToString(KeySym k);
-#endif
-#ifndef XCreateColormap_TCL_DECLARED
-#define XCreateColormap_TCL_DECLARED
/* 6 */
EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v,
int i);
-#endif
-#ifndef XCreatePixmapCursor_TCL_DECLARED
-#define XCreatePixmapCursor_TCL_DECLARED
/* 7 */
EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
XColor *x1, XColor *x2, unsigned int ui1,
unsigned int ui2);
-#endif
-#ifndef XCreateGlyphCursor_TCL_DECLARED
-#define XCreateGlyphCursor_TCL_DECLARED
/* 8 */
EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
unsigned int ui1, unsigned int ui2,
XColor *x1, XColor *x2);
-#endif
-#ifndef XGContextFromGC_TCL_DECLARED
-#define XGContextFromGC_TCL_DECLARED
/* 9 */
EXTERN GContext XGContextFromGC(GC g);
-#endif
-#ifndef XListHosts_TCL_DECLARED
-#define XListHosts_TCL_DECLARED
/* 10 */
EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b);
-#endif
-#ifndef XKeycodeToKeysym_TCL_DECLARED
-#define XKeycodeToKeysym_TCL_DECLARED
/* 11 */
EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i);
-#endif
-#ifndef XStringToKeysym_TCL_DECLARED
-#define XStringToKeysym_TCL_DECLARED
/* 12 */
EXTERN KeySym XStringToKeysym(_Xconst char *c);
-#endif
-#ifndef XRootWindow_TCL_DECLARED
-#define XRootWindow_TCL_DECLARED
/* 13 */
EXTERN Window XRootWindow(Display *d, int i);
-#endif
-#ifndef XSetErrorHandler_TCL_DECLARED
-#define XSetErrorHandler_TCL_DECLARED
/* 14 */
EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
-#endif
-#ifndef XIconifyWindow_TCL_DECLARED
-#define XIconifyWindow_TCL_DECLARED
/* 15 */
EXTERN Status XIconifyWindow(Display *d, Window w, int i);
-#endif
-#ifndef XWithdrawWindow_TCL_DECLARED
-#define XWithdrawWindow_TCL_DECLARED
/* 16 */
EXTERN Status XWithdrawWindow(Display *d, Window w, int i);
-#endif
-#ifndef XGetWMColormapWindows_TCL_DECLARED
-#define XGetWMColormapWindows_TCL_DECLARED
/* 17 */
EXTERN Status XGetWMColormapWindows(Display *d, Window w,
Window **wpp, int *ip);
-#endif
-#ifndef XAllocColor_TCL_DECLARED
-#define XAllocColor_TCL_DECLARED
/* 18 */
EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
-#endif
-#ifndef XBell_TCL_DECLARED
-#define XBell_TCL_DECLARED
/* 19 */
EXTERN void XBell(Display *d, int i);
-#endif
-#ifndef XChangeProperty_TCL_DECLARED
-#define XChangeProperty_TCL_DECLARED
/* 20 */
EXTERN void XChangeProperty(Display *d, Window w, Atom a1,
Atom a2, int i1, int i2,
_Xconst unsigned char *c, int i3);
-#endif
-#ifndef XChangeWindowAttributes_TCL_DECLARED
-#define XChangeWindowAttributes_TCL_DECLARED
/* 21 */
EXTERN void XChangeWindowAttributes(Display *d, Window w,
unsigned long ul, XSetWindowAttributes *x);
-#endif
-#ifndef XClearWindow_TCL_DECLARED
-#define XClearWindow_TCL_DECLARED
/* 22 */
EXTERN void XClearWindow(Display *d, Window w);
-#endif
-#ifndef XConfigureWindow_TCL_DECLARED
-#define XConfigureWindow_TCL_DECLARED
/* 23 */
EXTERN void XConfigureWindow(Display *d, Window w,
unsigned int i, XWindowChanges *x);
-#endif
-#ifndef XCopyArea_TCL_DECLARED
-#define XCopyArea_TCL_DECLARED
/* 24 */
EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4);
-#endif
-#ifndef XCopyPlane_TCL_DECLARED
-#define XCopyPlane_TCL_DECLARED
/* 25 */
EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4,
unsigned long ul);
-#endif
-#ifndef XCreateBitmapFromData_TCL_DECLARED
-#define XCreateBitmapFromData_TCL_DECLARED
/* 26 */
EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d,
_Xconst char *data, unsigned int width,
unsigned int height);
-#endif
-#ifndef XDefineCursor_TCL_DECLARED
-#define XDefineCursor_TCL_DECLARED
/* 27 */
EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
-#endif
-#ifndef XDeleteProperty_TCL_DECLARED
-#define XDeleteProperty_TCL_DECLARED
/* 28 */
EXTERN void XDeleteProperty(Display *d, Window w, Atom a);
-#endif
-#ifndef XDestroyWindow_TCL_DECLARED
-#define XDestroyWindow_TCL_DECLARED
/* 29 */
EXTERN void XDestroyWindow(Display *d, Window w);
-#endif
-#ifndef XDrawArc_TCL_DECLARED
-#define XDrawArc_TCL_DECLARED
/* 30 */
EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-#endif
-#ifndef XDrawLines_TCL_DECLARED
-#define XDrawLines_TCL_DECLARED
/* 31 */
EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2);
-#endif
-#ifndef XDrawRectangle_TCL_DECLARED
-#define XDrawRectangle_TCL_DECLARED
/* 32 */
EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-#endif
-#ifndef XFillArc_TCL_DECLARED
-#define XFillArc_TCL_DECLARED
/* 33 */
EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-#endif
-#ifndef XFillPolygon_TCL_DECLARED
-#define XFillPolygon_TCL_DECLARED
/* 34 */
EXTERN void XFillPolygon(Display *d, Drawable dr, GC g,
XPoint *x, int i1, int i2, int i3);
-#endif
-#ifndef XFillRectangles_TCL_DECLARED
-#define XFillRectangles_TCL_DECLARED
/* 35 */
EXTERN void XFillRectangles(Display *d, Drawable dr, GC g,
XRectangle *x, int i);
-#endif
-#ifndef XForceScreenSaver_TCL_DECLARED
-#define XForceScreenSaver_TCL_DECLARED
/* 36 */
EXTERN void XForceScreenSaver(Display *d, int i);
-#endif
-#ifndef XFreeColormap_TCL_DECLARED
-#define XFreeColormap_TCL_DECLARED
/* 37 */
EXTERN void XFreeColormap(Display *d, Colormap c);
-#endif
-#ifndef XFreeColors_TCL_DECLARED
-#define XFreeColors_TCL_DECLARED
/* 38 */
EXTERN void XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul);
-#endif
-#ifndef XFreeCursor_TCL_DECLARED
-#define XFreeCursor_TCL_DECLARED
/* 39 */
EXTERN void XFreeCursor(Display *d, Cursor c);
-#endif
-#ifndef XFreeModifiermap_TCL_DECLARED
-#define XFreeModifiermap_TCL_DECLARED
/* 40 */
EXTERN void XFreeModifiermap(XModifierKeymap *x);
-#endif
-#ifndef XGetGeometry_TCL_DECLARED
-#define XGetGeometry_TCL_DECLARED
/* 41 */
EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w,
int *i1, int *i2, unsigned int *ui1,
unsigned int *ui2, unsigned int *ui3,
unsigned int *ui4);
-#endif
-#ifndef XGetInputFocus_TCL_DECLARED
-#define XGetInputFocus_TCL_DECLARED
/* 42 */
EXTERN void XGetInputFocus(Display *d, Window *w, int *i);
-#endif
-#ifndef XGetWindowProperty_TCL_DECLARED
-#define XGetWindowProperty_TCL_DECLARED
/* 43 */
EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1,
long l1, long l2, Bool b, Atom a2, Atom *ap,
int *ip, unsigned long *ulp1,
unsigned long *ulp2, unsigned char **cpp);
-#endif
-#ifndef XGetWindowAttributes_TCL_DECLARED
-#define XGetWindowAttributes_TCL_DECLARED
/* 44 */
EXTERN Status XGetWindowAttributes(Display *d, Window w,
XWindowAttributes *x);
-#endif
-#ifndef XGrabKeyboard_TCL_DECLARED
-#define XGrabKeyboard_TCL_DECLARED
/* 45 */
EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1,
int i2, Time t);
-#endif
-#ifndef XGrabPointer_TCL_DECLARED
-#define XGrabPointer_TCL_DECLARED
/* 46 */
EXTERN int XGrabPointer(Display *d, Window w1, Bool b,
unsigned int ui, int i1, int i2, Window w2,
Cursor c, Time t);
-#endif
-#ifndef XKeysymToKeycode_TCL_DECLARED
-#define XKeysymToKeycode_TCL_DECLARED
/* 47 */
EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k);
-#endif
-#ifndef XLookupColor_TCL_DECLARED
-#define XLookupColor_TCL_DECLARED
/* 48 */
EXTERN Status XLookupColor(Display *d, Colormap c1,
_Xconst char *c2, XColor *x1, XColor *x2);
-#endif
-#ifndef XMapWindow_TCL_DECLARED
-#define XMapWindow_TCL_DECLARED
/* 49 */
EXTERN void XMapWindow(Display *d, Window w);
-#endif
-#ifndef XMoveResizeWindow_TCL_DECLARED
-#define XMoveResizeWindow_TCL_DECLARED
/* 50 */
EXTERN void XMoveResizeWindow(Display *d, Window w, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-#endif
-#ifndef XMoveWindow_TCL_DECLARED
-#define XMoveWindow_TCL_DECLARED
/* 51 */
EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2);
-#endif
-#ifndef XNextEvent_TCL_DECLARED
-#define XNextEvent_TCL_DECLARED
/* 52 */
EXTERN void XNextEvent(Display *d, XEvent *x);
-#endif
-#ifndef XPutBackEvent_TCL_DECLARED
-#define XPutBackEvent_TCL_DECLARED
/* 53 */
EXTERN void XPutBackEvent(Display *d, XEvent *x);
-#endif
-#ifndef XQueryColors_TCL_DECLARED
-#define XQueryColors_TCL_DECLARED
/* 54 */
EXTERN void XQueryColors(Display *d, Colormap c, XColor *x,
int i);
-#endif
-#ifndef XQueryPointer_TCL_DECLARED
-#define XQueryPointer_TCL_DECLARED
/* 55 */
EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2,
Window *w3, int *i1, int *i2, int *i3,
int *i4, unsigned int *ui);
-#endif
-#ifndef XQueryTree_TCL_DECLARED
-#define XQueryTree_TCL_DECLARED
/* 56 */
EXTERN Status XQueryTree(Display *d, Window w1, Window *w2,
Window *w3, Window **w4, unsigned int *ui);
-#endif
-#ifndef XRaiseWindow_TCL_DECLARED
-#define XRaiseWindow_TCL_DECLARED
/* 57 */
EXTERN void XRaiseWindow(Display *d, Window w);
-#endif
-#ifndef XRefreshKeyboardMapping_TCL_DECLARED
-#define XRefreshKeyboardMapping_TCL_DECLARED
/* 58 */
EXTERN void XRefreshKeyboardMapping(XMappingEvent *x);
-#endif
-#ifndef XResizeWindow_TCL_DECLARED
-#define XResizeWindow_TCL_DECLARED
/* 59 */
EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1,
unsigned int ui2);
-#endif
-#ifndef XSelectInput_TCL_DECLARED
-#define XSelectInput_TCL_DECLARED
/* 60 */
EXTERN void XSelectInput(Display *d, Window w, long l);
-#endif
-#ifndef XSendEvent_TCL_DECLARED
-#define XSendEvent_TCL_DECLARED
/* 61 */
EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l,
XEvent *x);
-#endif
-#ifndef XSetCommand_TCL_DECLARED
-#define XSetCommand_TCL_DECLARED
/* 62 */
-EXTERN void XSetCommand(Display *d, Window w, CONST char **c,
+EXTERN void XSetCommand(Display *d, Window w, const char **c,
int i);
-#endif
-#ifndef XSetIconName_TCL_DECLARED
-#define XSetIconName_TCL_DECLARED
/* 63 */
EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c);
-#endif
-#ifndef XSetInputFocus_TCL_DECLARED
-#define XSetInputFocus_TCL_DECLARED
/* 64 */
EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
-#endif
-#ifndef XSetSelectionOwner_TCL_DECLARED
-#define XSetSelectionOwner_TCL_DECLARED
/* 65 */
EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
Time t);
-#endif
-#ifndef XSetWindowBackground_TCL_DECLARED
-#define XSetWindowBackground_TCL_DECLARED
/* 66 */
EXTERN void XSetWindowBackground(Display *d, Window w,
unsigned long ul);
-#endif
-#ifndef XSetWindowBackgroundPixmap_TCL_DECLARED
-#define XSetWindowBackgroundPixmap_TCL_DECLARED
/* 67 */
EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w,
Pixmap p);
-#endif
-#ifndef XSetWindowBorder_TCL_DECLARED
-#define XSetWindowBorder_TCL_DECLARED
/* 68 */
EXTERN void XSetWindowBorder(Display *d, Window w,
unsigned long ul);
-#endif
-#ifndef XSetWindowBorderPixmap_TCL_DECLARED
-#define XSetWindowBorderPixmap_TCL_DECLARED
/* 69 */
EXTERN void XSetWindowBorderPixmap(Display *d, Window w,
Pixmap p);
-#endif
-#ifndef XSetWindowBorderWidth_TCL_DECLARED
-#define XSetWindowBorderWidth_TCL_DECLARED
/* 70 */
EXTERN void XSetWindowBorderWidth(Display *d, Window w,
unsigned int ui);
-#endif
-#ifndef XSetWindowColormap_TCL_DECLARED
-#define XSetWindowColormap_TCL_DECLARED
/* 71 */
EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c);
-#endif
-#ifndef XTranslateCoordinates_TCL_DECLARED
-#define XTranslateCoordinates_TCL_DECLARED
/* 72 */
EXTERN Bool XTranslateCoordinates(Display *d, Window w1,
Window w2, int i1, int i2, int *i3, int *i4,
Window *w3);
-#endif
-#ifndef XUngrabKeyboard_TCL_DECLARED
-#define XUngrabKeyboard_TCL_DECLARED
/* 73 */
EXTERN void XUngrabKeyboard(Display *d, Time t);
-#endif
-#ifndef XUngrabPointer_TCL_DECLARED
-#define XUngrabPointer_TCL_DECLARED
/* 74 */
EXTERN void XUngrabPointer(Display *d, Time t);
-#endif
-#ifndef XUnmapWindow_TCL_DECLARED
-#define XUnmapWindow_TCL_DECLARED
/* 75 */
EXTERN void XUnmapWindow(Display *d, Window w);
-#endif
-#ifndef XWindowEvent_TCL_DECLARED
-#define XWindowEvent_TCL_DECLARED
/* 76 */
EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x);
-#endif
-#ifndef XDestroyIC_TCL_DECLARED
-#define XDestroyIC_TCL_DECLARED
/* 77 */
EXTERN void XDestroyIC(XIC x);
-#endif
-#ifndef XFilterEvent_TCL_DECLARED
-#define XFilterEvent_TCL_DECLARED
/* 78 */
EXTERN Bool XFilterEvent(XEvent *x, Window w);
-#endif
-#ifndef XmbLookupString_TCL_DECLARED
-#define XmbLookupString_TCL_DECLARED
/* 79 */
EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk,
char *c, int i, KeySym *k, Status *s);
-#endif
-#ifndef TkPutImage_TCL_DECLARED
-#define TkPutImage_TCL_DECLARED
/* 80 */
EXTERN void TkPutImage(unsigned long *colors, int ncolors,
Display *display, Drawable d, GC gc,
XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
unsigned int height);
-#endif
/* Slot 81 is reserved */
-#ifndef XParseColor_TCL_DECLARED
-#define XParseColor_TCL_DECLARED
/* 82 */
EXTERN Status XParseColor(Display *display, Colormap map,
_Xconst char *spec, XColor *colorPtr);
-#endif
-#ifndef XCreateGC_TCL_DECLARED
-#define XCreateGC_TCL_DECLARED
/* 83 */
EXTERN GC XCreateGC(Display *display, Drawable d,
unsigned long valuemask, XGCValues *values);
-#endif
-#ifndef XFreeGC_TCL_DECLARED
-#define XFreeGC_TCL_DECLARED
/* 84 */
EXTERN void XFreeGC(Display *display, GC gc);
-#endif
-#ifndef XInternAtom_TCL_DECLARED
-#define XInternAtom_TCL_DECLARED
/* 85 */
EXTERN Atom XInternAtom(Display *display,
_Xconst char *atom_name, Bool only_if_exists);
-#endif
-#ifndef XSetBackground_TCL_DECLARED
-#define XSetBackground_TCL_DECLARED
/* 86 */
EXTERN void XSetBackground(Display *display, GC gc,
unsigned long foreground);
-#endif
-#ifndef XSetForeground_TCL_DECLARED
-#define XSetForeground_TCL_DECLARED
/* 87 */
EXTERN void XSetForeground(Display *display, GC gc,
unsigned long foreground);
-#endif
-#ifndef XSetClipMask_TCL_DECLARED
-#define XSetClipMask_TCL_DECLARED
/* 88 */
EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap);
-#endif
-#ifndef XSetClipOrigin_TCL_DECLARED
-#define XSetClipOrigin_TCL_DECLARED
/* 89 */
EXTERN void XSetClipOrigin(Display *display, GC gc,
int clip_x_origin, int clip_y_origin);
-#endif
-#ifndef XSetTSOrigin_TCL_DECLARED
-#define XSetTSOrigin_TCL_DECLARED
/* 90 */
EXTERN void XSetTSOrigin(Display *display, GC gc,
int ts_x_origin, int ts_y_origin);
-#endif
-#ifndef XChangeGC_TCL_DECLARED
-#define XChangeGC_TCL_DECLARED
/* 91 */
EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask,
XGCValues *values);
-#endif
-#ifndef XSetFont_TCL_DECLARED
-#define XSetFont_TCL_DECLARED
/* 92 */
EXTERN void XSetFont(Display *display, GC gc, Font font);
-#endif
-#ifndef XSetArcMode_TCL_DECLARED
-#define XSetArcMode_TCL_DECLARED
/* 93 */
EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode);
-#endif
-#ifndef XSetStipple_TCL_DECLARED
-#define XSetStipple_TCL_DECLARED
/* 94 */
EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple);
-#endif
-#ifndef XSetFillRule_TCL_DECLARED
-#define XSetFillRule_TCL_DECLARED
/* 95 */
EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule);
-#endif
-#ifndef XSetFillStyle_TCL_DECLARED
-#define XSetFillStyle_TCL_DECLARED
/* 96 */
EXTERN void XSetFillStyle(Display *display, GC gc,
int fill_style);
-#endif
-#ifndef XSetFunction_TCL_DECLARED
-#define XSetFunction_TCL_DECLARED
/* 97 */
EXTERN void XSetFunction(Display *display, GC gc, int function);
-#endif
-#ifndef XSetLineAttributes_TCL_DECLARED
-#define XSetLineAttributes_TCL_DECLARED
/* 98 */
EXTERN void XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style);
-#endif
-#ifndef _XInitImageFuncPtrs_TCL_DECLARED
-#define _XInitImageFuncPtrs_TCL_DECLARED
/* 99 */
EXTERN int _XInitImageFuncPtrs(XImage *image);
-#endif
-#ifndef XCreateIC_TCL_DECLARED
-#define XCreateIC_TCL_DECLARED
/* 100 */
EXTERN XIC XCreateIC(void);
-#endif
-#ifndef XGetVisualInfo_TCL_DECLARED
-#define XGetVisualInfo_TCL_DECLARED
/* 101 */
EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask,
XVisualInfo *vinfo_template,
int *nitems_return);
-#endif
-#ifndef XSetWMClientMachine_TCL_DECLARED
-#define XSetWMClientMachine_TCL_DECLARED
/* 102 */
EXTERN void XSetWMClientMachine(Display *display, Window w,
XTextProperty *text_prop);
-#endif
-#ifndef XStringListToTextProperty_TCL_DECLARED
-#define XStringListToTextProperty_TCL_DECLARED
/* 103 */
EXTERN Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return);
-#endif
-#ifndef XDrawLine_TCL_DECLARED
-#define XDrawLine_TCL_DECLARED
/* 104 */
EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1,
int y1, int x2, int y2);
-#endif
-#ifndef XWarpPointer_TCL_DECLARED
-#define XWarpPointer_TCL_DECLARED
/* 105 */
EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx,
int sy, unsigned int sw, unsigned int sh,
int dx, int dy);
-#endif
-#ifndef XFillRectangle_TCL_DECLARED
-#define XFillRectangle_TCL_DECLARED
/* 106 */
EXTERN void XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef XSetDashes_TCL_DECLARED
-#define XSetDashes_TCL_DECLARED
/* 0 */
EXTERN void XSetDashes(Display *display, GC gc, int dash_offset,
_Xconst char *dash_list, int n);
-#endif
-#ifndef XGetModifierMapping_TCL_DECLARED
-#define XGetModifierMapping_TCL_DECLARED
/* 1 */
EXTERN XModifierKeymap * XGetModifierMapping(Display *d);
-#endif
-#ifndef XCreateImage_TCL_DECLARED
-#define XCreateImage_TCL_DECLARED
/* 2 */
EXTERN 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);
-#endif
-#ifndef XGetImage_TCL_DECLARED
-#define XGetImage_TCL_DECLARED
/* 3 */
EXTERN XImage * XGetImage(Display *d, Drawable dr, int i1, int i2,
unsigned int ui1, unsigned int ui2,
unsigned long ul, int i3);
-#endif
-#ifndef XGetAtomName_TCL_DECLARED
-#define XGetAtomName_TCL_DECLARED
/* 4 */
EXTERN char * XGetAtomName(Display *d, Atom a);
-#endif
-#ifndef XKeysymToString_TCL_DECLARED
-#define XKeysymToString_TCL_DECLARED
/* 5 */
EXTERN char * XKeysymToString(KeySym k);
-#endif
-#ifndef XCreateColormap_TCL_DECLARED
-#define XCreateColormap_TCL_DECLARED
/* 6 */
EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v,
int i);
-#endif
-#ifndef XGContextFromGC_TCL_DECLARED
-#define XGContextFromGC_TCL_DECLARED
/* 7 */
EXTERN GContext XGContextFromGC(GC g);
-#endif
-#ifndef XKeycodeToKeysym_TCL_DECLARED
-#define XKeycodeToKeysym_TCL_DECLARED
/* 8 */
EXTERN KeySym XKeycodeToKeysym(Display *d, KeyCode k, int i);
-#endif
-#ifndef XStringToKeysym_TCL_DECLARED
-#define XStringToKeysym_TCL_DECLARED
/* 9 */
EXTERN KeySym XStringToKeysym(_Xconst char *c);
-#endif
-#ifndef XRootWindow_TCL_DECLARED
-#define XRootWindow_TCL_DECLARED
/* 10 */
EXTERN Window XRootWindow(Display *d, int i);
-#endif
-#ifndef XSetErrorHandler_TCL_DECLARED
-#define XSetErrorHandler_TCL_DECLARED
/* 11 */
EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
-#endif
-#ifndef XAllocColor_TCL_DECLARED
-#define XAllocColor_TCL_DECLARED
/* 12 */
EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
-#endif
-#ifndef XBell_TCL_DECLARED
-#define XBell_TCL_DECLARED
/* 13 */
EXTERN void XBell(Display *d, int i);
-#endif
-#ifndef XChangeProperty_TCL_DECLARED
-#define XChangeProperty_TCL_DECLARED
/* 14 */
EXTERN void XChangeProperty(Display *d, Window w, Atom a1,
Atom a2, int i1, int i2,
_Xconst unsigned char *c, int i3);
-#endif
-#ifndef XChangeWindowAttributes_TCL_DECLARED
-#define XChangeWindowAttributes_TCL_DECLARED
/* 15 */
EXTERN void XChangeWindowAttributes(Display *d, Window w,
unsigned long ul, XSetWindowAttributes *x);
-#endif
-#ifndef XConfigureWindow_TCL_DECLARED
-#define XConfigureWindow_TCL_DECLARED
/* 16 */
EXTERN void XConfigureWindow(Display *d, Window w,
unsigned int i, XWindowChanges *x);
-#endif
-#ifndef XCopyArea_TCL_DECLARED
-#define XCopyArea_TCL_DECLARED
/* 17 */
EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4);
-#endif
-#ifndef XCopyPlane_TCL_DECLARED
-#define XCopyPlane_TCL_DECLARED
/* 18 */
EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2,
GC g, int i1, int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4,
unsigned long ul);
-#endif
-#ifndef XCreateBitmapFromData_TCL_DECLARED
-#define XCreateBitmapFromData_TCL_DECLARED
/* 19 */
EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d,
_Xconst char *data, unsigned int width,
unsigned int height);
-#endif
-#ifndef XDefineCursor_TCL_DECLARED
-#define XDefineCursor_TCL_DECLARED
/* 20 */
EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
-#endif
-#ifndef XDestroyWindow_TCL_DECLARED
-#define XDestroyWindow_TCL_DECLARED
/* 21 */
EXTERN void XDestroyWindow(Display *d, Window w);
-#endif
-#ifndef XDrawArc_TCL_DECLARED
-#define XDrawArc_TCL_DECLARED
/* 22 */
EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-#endif
-#ifndef XDrawLines_TCL_DECLARED
-#define XDrawLines_TCL_DECLARED
/* 23 */
EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2);
-#endif
-#ifndef XDrawRectangle_TCL_DECLARED
-#define XDrawRectangle_TCL_DECLARED
/* 24 */
EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-#endif
-#ifndef XFillArc_TCL_DECLARED
-#define XFillArc_TCL_DECLARED
/* 25 */
EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1,
int i2, unsigned int ui1, unsigned int ui2,
int i3, int i4);
-#endif
-#ifndef XFillPolygon_TCL_DECLARED
-#define XFillPolygon_TCL_DECLARED
/* 26 */
EXTERN void XFillPolygon(Display *d, Drawable dr, GC g,
XPoint *x, int i1, int i2, int i3);
-#endif
-#ifndef XFillRectangles_TCL_DECLARED
-#define XFillRectangles_TCL_DECLARED
/* 27 */
EXTERN void XFillRectangles(Display *d, Drawable dr, GC g,
XRectangle *x, int i);
-#endif
-#ifndef XFreeColormap_TCL_DECLARED
-#define XFreeColormap_TCL_DECLARED
/* 28 */
EXTERN void XFreeColormap(Display *d, Colormap c);
-#endif
-#ifndef XFreeColors_TCL_DECLARED
-#define XFreeColors_TCL_DECLARED
/* 29 */
EXTERN void XFreeColors(Display *d, Colormap c,
unsigned long *ulp, int i, unsigned long ul);
-#endif
-#ifndef XFreeModifiermap_TCL_DECLARED
-#define XFreeModifiermap_TCL_DECLARED
/* 30 */
EXTERN void XFreeModifiermap(XModifierKeymap *x);
-#endif
-#ifndef XGetGeometry_TCL_DECLARED
-#define XGetGeometry_TCL_DECLARED
/* 31 */
EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w,
int *i1, int *i2, unsigned int *ui1,
unsigned int *ui2, unsigned int *ui3,
unsigned int *ui4);
-#endif
-#ifndef XGetWindowProperty_TCL_DECLARED
-#define XGetWindowProperty_TCL_DECLARED
/* 32 */
EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1,
long l1, long l2, Bool b, Atom a2, Atom *ap,
int *ip, unsigned long *ulp1,
unsigned long *ulp2, unsigned char **cpp);
-#endif
-#ifndef XGrabKeyboard_TCL_DECLARED
-#define XGrabKeyboard_TCL_DECLARED
/* 33 */
EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1,
int i2, Time t);
-#endif
-#ifndef XGrabPointer_TCL_DECLARED
-#define XGrabPointer_TCL_DECLARED
/* 34 */
EXTERN int XGrabPointer(Display *d, Window w1, Bool b,
unsigned int ui, int i1, int i2, Window w2,
Cursor c, Time t);
-#endif
-#ifndef XKeysymToKeycode_TCL_DECLARED
-#define XKeysymToKeycode_TCL_DECLARED
/* 35 */
EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k);
-#endif
-#ifndef XMapWindow_TCL_DECLARED
-#define XMapWindow_TCL_DECLARED
/* 36 */
EXTERN void XMapWindow(Display *d, Window w);
-#endif
-#ifndef XMoveResizeWindow_TCL_DECLARED
-#define XMoveResizeWindow_TCL_DECLARED
/* 37 */
EXTERN void XMoveResizeWindow(Display *d, Window w, int i1,
int i2, unsigned int ui1, unsigned int ui2);
-#endif
-#ifndef XMoveWindow_TCL_DECLARED
-#define XMoveWindow_TCL_DECLARED
/* 38 */
EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2);
-#endif
-#ifndef XQueryPointer_TCL_DECLARED
-#define XQueryPointer_TCL_DECLARED
/* 39 */
EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2,
Window *w3, int *i1, int *i2, int *i3,
int *i4, unsigned int *ui);
-#endif
-#ifndef XRaiseWindow_TCL_DECLARED
-#define XRaiseWindow_TCL_DECLARED
/* 40 */
EXTERN void XRaiseWindow(Display *d, Window w);
-#endif
-#ifndef XRefreshKeyboardMapping_TCL_DECLARED
-#define XRefreshKeyboardMapping_TCL_DECLARED
/* 41 */
EXTERN void XRefreshKeyboardMapping(XMappingEvent *x);
-#endif
-#ifndef XResizeWindow_TCL_DECLARED
-#define XResizeWindow_TCL_DECLARED
/* 42 */
EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1,
unsigned int ui2);
-#endif
-#ifndef XSelectInput_TCL_DECLARED
-#define XSelectInput_TCL_DECLARED
/* 43 */
EXTERN void XSelectInput(Display *d, Window w, long l);
-#endif
-#ifndef XSendEvent_TCL_DECLARED
-#define XSendEvent_TCL_DECLARED
/* 44 */
EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l,
XEvent *x);
-#endif
-#ifndef XSetIconName_TCL_DECLARED
-#define XSetIconName_TCL_DECLARED
/* 45 */
EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c);
-#endif
-#ifndef XSetInputFocus_TCL_DECLARED
-#define XSetInputFocus_TCL_DECLARED
/* 46 */
EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
-#endif
-#ifndef XSetSelectionOwner_TCL_DECLARED
-#define XSetSelectionOwner_TCL_DECLARED
/* 47 */
EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
Time t);
-#endif
-#ifndef XSetWindowBackground_TCL_DECLARED
-#define XSetWindowBackground_TCL_DECLARED
/* 48 */
EXTERN void XSetWindowBackground(Display *d, Window w,
unsigned long ul);
-#endif
-#ifndef XSetWindowBackgroundPixmap_TCL_DECLARED
-#define XSetWindowBackgroundPixmap_TCL_DECLARED
/* 49 */
EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w,
Pixmap p);
-#endif
-#ifndef XSetWindowBorder_TCL_DECLARED
-#define XSetWindowBorder_TCL_DECLARED
/* 50 */
EXTERN void XSetWindowBorder(Display *d, Window w,
unsigned long ul);
-#endif
-#ifndef XSetWindowBorderPixmap_TCL_DECLARED
-#define XSetWindowBorderPixmap_TCL_DECLARED
/* 51 */
EXTERN void XSetWindowBorderPixmap(Display *d, Window w,
Pixmap p);
-#endif
-#ifndef XSetWindowBorderWidth_TCL_DECLARED
-#define XSetWindowBorderWidth_TCL_DECLARED
/* 52 */
EXTERN void XSetWindowBorderWidth(Display *d, Window w,
unsigned int ui);
-#endif
-#ifndef XSetWindowColormap_TCL_DECLARED
-#define XSetWindowColormap_TCL_DECLARED
/* 53 */
EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c);
-#endif
-#ifndef XUngrabKeyboard_TCL_DECLARED
-#define XUngrabKeyboard_TCL_DECLARED
/* 54 */
EXTERN void XUngrabKeyboard(Display *d, Time t);
-#endif
-#ifndef XUngrabPointer_TCL_DECLARED
-#define XUngrabPointer_TCL_DECLARED
/* 55 */
EXTERN void XUngrabPointer(Display *d, Time t);
-#endif
-#ifndef XUnmapWindow_TCL_DECLARED
-#define XUnmapWindow_TCL_DECLARED
/* 56 */
EXTERN void XUnmapWindow(Display *d, Window w);
-#endif
-#ifndef TkPutImage_TCL_DECLARED
-#define TkPutImage_TCL_DECLARED
/* 57 */
EXTERN void TkPutImage(unsigned long *colors, int ncolors,
Display *display, Drawable d, GC gc,
XImage *image, int src_x, int src_y,
int dest_x, int dest_y, unsigned int width,
unsigned int height);
-#endif
-#ifndef XParseColor_TCL_DECLARED
-#define XParseColor_TCL_DECLARED
/* 58 */
EXTERN Status XParseColor(Display *display, Colormap map,
_Xconst char *spec, XColor *colorPtr);
-#endif
-#ifndef XCreateGC_TCL_DECLARED
-#define XCreateGC_TCL_DECLARED
/* 59 */
EXTERN GC XCreateGC(Display *display, Drawable d,
unsigned long valuemask, XGCValues *values);
-#endif
-#ifndef XFreeGC_TCL_DECLARED
-#define XFreeGC_TCL_DECLARED
/* 60 */
EXTERN void XFreeGC(Display *display, GC gc);
-#endif
-#ifndef XInternAtom_TCL_DECLARED
-#define XInternAtom_TCL_DECLARED
/* 61 */
EXTERN Atom XInternAtom(Display *display,
_Xconst char *atom_name, Bool only_if_exists);
-#endif
-#ifndef XSetBackground_TCL_DECLARED
-#define XSetBackground_TCL_DECLARED
/* 62 */
EXTERN void XSetBackground(Display *display, GC gc,
unsigned long foreground);
-#endif
-#ifndef XSetForeground_TCL_DECLARED
-#define XSetForeground_TCL_DECLARED
/* 63 */
EXTERN void XSetForeground(Display *display, GC gc,
unsigned long foreground);
-#endif
-#ifndef XSetClipMask_TCL_DECLARED
-#define XSetClipMask_TCL_DECLARED
/* 64 */
EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap);
-#endif
-#ifndef XSetClipOrigin_TCL_DECLARED
-#define XSetClipOrigin_TCL_DECLARED
/* 65 */
EXTERN void XSetClipOrigin(Display *display, GC gc,
int clip_x_origin, int clip_y_origin);
-#endif
-#ifndef XSetTSOrigin_TCL_DECLARED
-#define XSetTSOrigin_TCL_DECLARED
/* 66 */
EXTERN void XSetTSOrigin(Display *display, GC gc,
int ts_x_origin, int ts_y_origin);
-#endif
-#ifndef XChangeGC_TCL_DECLARED
-#define XChangeGC_TCL_DECLARED
/* 67 */
EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask,
XGCValues *values);
-#endif
-#ifndef XSetFont_TCL_DECLARED
-#define XSetFont_TCL_DECLARED
/* 68 */
EXTERN void XSetFont(Display *display, GC gc, Font font);
-#endif
-#ifndef XSetArcMode_TCL_DECLARED
-#define XSetArcMode_TCL_DECLARED
/* 69 */
EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode);
-#endif
-#ifndef XSetStipple_TCL_DECLARED
-#define XSetStipple_TCL_DECLARED
/* 70 */
EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple);
-#endif
-#ifndef XSetFillRule_TCL_DECLARED
-#define XSetFillRule_TCL_DECLARED
/* 71 */
EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule);
-#endif
-#ifndef XSetFillStyle_TCL_DECLARED
-#define XSetFillStyle_TCL_DECLARED
/* 72 */
EXTERN void XSetFillStyle(Display *display, GC gc,
int fill_style);
-#endif
-#ifndef XSetFunction_TCL_DECLARED
-#define XSetFunction_TCL_DECLARED
/* 73 */
EXTERN void XSetFunction(Display *display, GC gc, int function);
-#endif
-#ifndef XSetLineAttributes_TCL_DECLARED
-#define XSetLineAttributes_TCL_DECLARED
/* 74 */
EXTERN void XSetLineAttributes(Display *display, GC gc,
unsigned int line_width, int line_style,
int cap_style, int join_style);
-#endif
-#ifndef _XInitImageFuncPtrs_TCL_DECLARED
-#define _XInitImageFuncPtrs_TCL_DECLARED
/* 75 */
EXTERN int _XInitImageFuncPtrs(XImage *image);
-#endif
-#ifndef XCreateIC_TCL_DECLARED
-#define XCreateIC_TCL_DECLARED
/* 76 */
EXTERN XIC XCreateIC(void);
-#endif
-#ifndef XGetVisualInfo_TCL_DECLARED
-#define XGetVisualInfo_TCL_DECLARED
/* 77 */
EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask,
XVisualInfo *vinfo_template,
int *nitems_return);
-#endif
-#ifndef XSetWMClientMachine_TCL_DECLARED
-#define XSetWMClientMachine_TCL_DECLARED
/* 78 */
EXTERN void XSetWMClientMachine(Display *display, Window w,
XTextProperty *text_prop);
-#endif
-#ifndef XStringListToTextProperty_TCL_DECLARED
-#define XStringListToTextProperty_TCL_DECLARED
/* 79 */
EXTERN Status XStringListToTextProperty(char **list, int count,
XTextProperty *text_prop_return);
-#endif
-#ifndef XDrawSegments_TCL_DECLARED
-#define XDrawSegments_TCL_DECLARED
/* 80 */
EXTERN void XDrawSegments(Display *display, Drawable d, GC gc,
XSegment *segments, int nsegments);
-#endif
-#ifndef XForceScreenSaver_TCL_DECLARED
-#define XForceScreenSaver_TCL_DECLARED
/* 81 */
EXTERN void XForceScreenSaver(Display *display, int mode);
-#endif
-#ifndef XDrawLine_TCL_DECLARED
-#define XDrawLine_TCL_DECLARED
/* 82 */
EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1,
int y1, int x2, int y2);
-#endif
-#ifndef XFillRectangle_TCL_DECLARED
-#define XFillRectangle_TCL_DECLARED
/* 83 */
EXTERN void XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height);
-#endif
-#ifndef XClearWindow_TCL_DECLARED
-#define XClearWindow_TCL_DECLARED
/* 84 */
EXTERN void XClearWindow(Display *d, Window w);
-#endif
-#ifndef XDrawPoint_TCL_DECLARED
-#define XDrawPoint_TCL_DECLARED
/* 85 */
EXTERN void XDrawPoint(Display *display, Drawable d, GC gc,
int x, int y);
-#endif
-#ifndef XDrawPoints_TCL_DECLARED
-#define XDrawPoints_TCL_DECLARED
/* 86 */
EXTERN void XDrawPoints(Display *display, Drawable d, GC gc,
XPoint *points, int npoints, int mode);
-#endif
-#ifndef XWarpPointer_TCL_DECLARED
-#define XWarpPointer_TCL_DECLARED
/* 87 */
EXTERN 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);
-#endif
-#ifndef XQueryColor_TCL_DECLARED
-#define XQueryColor_TCL_DECLARED
/* 88 */
EXTERN void XQueryColor(Display *display, Colormap colormap,
XColor *def_in_out);
-#endif
-#ifndef XQueryColors_TCL_DECLARED
-#define XQueryColors_TCL_DECLARED
/* 89 */
EXTERN void XQueryColors(Display *display, Colormap colormap,
XColor *defs_in_out, int ncolors);
-#endif
-#ifndef XQueryTree_TCL_DECLARED
-#define XQueryTree_TCL_DECLARED
/* 90 */
EXTERN Status XQueryTree(Display *d, Window w1, Window *w2,
Window *w3, Window **w4, unsigned int *ui);
-#endif
-#ifndef XSync_TCL_DECLARED
-#define XSync_TCL_DECLARED
/* 91 */
EXTERN int XSync(Display *display, Bool flag);
-#endif
#endif /* AQUA */
typedef struct TkIntXlibStubs {
int magic;
- struct TkIntXlibStubHooks *hooks;
+ const struct TkIntXlibStubHooks *hooks;
#ifdef __WIN32__ /* WIN */
void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
@@ -1256,7 +666,7 @@ typedef struct TkIntXlibStubs {
void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */
void (*xSelectInput) (Display *d, Window w, long l); /* 60 */
Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */
- void (*xSetCommand) (Display *d, Window w, CONST char **c, int i); /* 62 */
+ void (*xSetCommand) (Display *d, Window w, const char **c, int i); /* 62 */
void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */
void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */
void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */
@@ -1275,7 +685,7 @@ typedef struct TkIntXlibStubs {
Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */
int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */
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); /* 80 */
- VOID *reserved81;
+ void (*reserved81)(void);
Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */
GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */
void (*xFreeGC) (Display *display, GC gc); /* 84 */
@@ -1401,816 +811,420 @@ typedef struct TkIntXlibStubs {
#ifdef __cplusplus
extern "C" {
#endif
-extern TkIntXlibStubs *tkIntXlibStubsPtr;
+extern const TkIntXlibStubs *tkIntXlibStubsPtr;
#ifdef __cplusplus
}
#endif
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+#if defined(USE_TK_STUBS)
/*
* Inline function declarations:
*/
#ifdef __WIN32__ /* WIN */
-#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 XCreatePixmapCursor
#define XCreatePixmapCursor \
(tkIntXlibStubsPtr->xCreatePixmapCursor) /* 7 */
-#endif
-#ifndef XCreateGlyphCursor
#define XCreateGlyphCursor \
(tkIntXlibStubsPtr->xCreateGlyphCursor) /* 8 */
-#endif
-#ifndef XGContextFromGC
#define XGContextFromGC \
(tkIntXlibStubsPtr->xGContextFromGC) /* 9 */
-#endif
-#ifndef XListHosts
#define XListHosts \
(tkIntXlibStubsPtr->xListHosts) /* 10 */
-#endif
-#ifndef XKeycodeToKeysym
#define XKeycodeToKeysym \
(tkIntXlibStubsPtr->xKeycodeToKeysym) /* 11 */
-#endif
-#ifndef XStringToKeysym
#define XStringToKeysym \
(tkIntXlibStubsPtr->xStringToKeysym) /* 12 */
-#endif
-#ifndef XRootWindow
#define XRootWindow \
(tkIntXlibStubsPtr->xRootWindow) /* 13 */
-#endif
-#ifndef XSetErrorHandler
#define XSetErrorHandler \
(tkIntXlibStubsPtr->xSetErrorHandler) /* 14 */
-#endif
-#ifndef XIconifyWindow
#define XIconifyWindow \
(tkIntXlibStubsPtr->xIconifyWindow) /* 15 */
-#endif
-#ifndef XWithdrawWindow
#define XWithdrawWindow \
(tkIntXlibStubsPtr->xWithdrawWindow) /* 16 */
-#endif
-#ifndef XGetWMColormapWindows
#define XGetWMColormapWindows \
(tkIntXlibStubsPtr->xGetWMColormapWindows) /* 17 */
-#endif
-#ifndef XAllocColor
#define XAllocColor \
(tkIntXlibStubsPtr->xAllocColor) /* 18 */
-#endif
-#ifndef XBell
#define XBell \
(tkIntXlibStubsPtr->xBell) /* 19 */
-#endif
-#ifndef XChangeProperty
#define XChangeProperty \
(tkIntXlibStubsPtr->xChangeProperty) /* 20 */
-#endif
-#ifndef XChangeWindowAttributes
#define XChangeWindowAttributes \
(tkIntXlibStubsPtr->xChangeWindowAttributes) /* 21 */
-#endif
-#ifndef XClearWindow
#define XClearWindow \
(tkIntXlibStubsPtr->xClearWindow) /* 22 */
-#endif
-#ifndef XConfigureWindow
#define XConfigureWindow \
(tkIntXlibStubsPtr->xConfigureWindow) /* 23 */
-#endif
-#ifndef XCopyArea
#define XCopyArea \
(tkIntXlibStubsPtr->xCopyArea) /* 24 */
-#endif
-#ifndef XCopyPlane
#define XCopyPlane \
(tkIntXlibStubsPtr->xCopyPlane) /* 25 */
-#endif
-#ifndef XCreateBitmapFromData
#define XCreateBitmapFromData \
(tkIntXlibStubsPtr->xCreateBitmapFromData) /* 26 */
-#endif
-#ifndef XDefineCursor
#define XDefineCursor \
(tkIntXlibStubsPtr->xDefineCursor) /* 27 */
-#endif
-#ifndef XDeleteProperty
#define XDeleteProperty \
(tkIntXlibStubsPtr->xDeleteProperty) /* 28 */
-#endif
-#ifndef XDestroyWindow
#define XDestroyWindow \
(tkIntXlibStubsPtr->xDestroyWindow) /* 29 */
-#endif
-#ifndef XDrawArc
#define XDrawArc \
(tkIntXlibStubsPtr->xDrawArc) /* 30 */
-#endif
-#ifndef XDrawLines
#define XDrawLines \
(tkIntXlibStubsPtr->xDrawLines) /* 31 */
-#endif
-#ifndef XDrawRectangle
#define XDrawRectangle \
(tkIntXlibStubsPtr->xDrawRectangle) /* 32 */
-#endif
-#ifndef XFillArc
#define XFillArc \
(tkIntXlibStubsPtr->xFillArc) /* 33 */
-#endif
-#ifndef XFillPolygon
#define XFillPolygon \
(tkIntXlibStubsPtr->xFillPolygon) /* 34 */
-#endif
-#ifndef XFillRectangles
#define XFillRectangles \
(tkIntXlibStubsPtr->xFillRectangles) /* 35 */
-#endif
-#ifndef XForceScreenSaver
#define XForceScreenSaver \
(tkIntXlibStubsPtr->xForceScreenSaver) /* 36 */
-#endif
-#ifndef XFreeColormap
#define XFreeColormap \
(tkIntXlibStubsPtr->xFreeColormap) /* 37 */
-#endif
-#ifndef XFreeColors
#define XFreeColors \
(tkIntXlibStubsPtr->xFreeColors) /* 38 */
-#endif
-#ifndef XFreeCursor
#define XFreeCursor \
(tkIntXlibStubsPtr->xFreeCursor) /* 39 */
-#endif
-#ifndef XFreeModifiermap
#define XFreeModifiermap \
(tkIntXlibStubsPtr->xFreeModifiermap) /* 40 */
-#endif
-#ifndef XGetGeometry
#define XGetGeometry \
(tkIntXlibStubsPtr->xGetGeometry) /* 41 */
-#endif
-#ifndef XGetInputFocus
#define XGetInputFocus \
(tkIntXlibStubsPtr->xGetInputFocus) /* 42 */
-#endif
-#ifndef XGetWindowProperty
#define XGetWindowProperty \
(tkIntXlibStubsPtr->xGetWindowProperty) /* 43 */
-#endif
-#ifndef XGetWindowAttributes
#define XGetWindowAttributes \
(tkIntXlibStubsPtr->xGetWindowAttributes) /* 44 */
-#endif
-#ifndef XGrabKeyboard
#define XGrabKeyboard \
(tkIntXlibStubsPtr->xGrabKeyboard) /* 45 */
-#endif
-#ifndef XGrabPointer
#define XGrabPointer \
(tkIntXlibStubsPtr->xGrabPointer) /* 46 */
-#endif
-#ifndef XKeysymToKeycode
#define XKeysymToKeycode \
(tkIntXlibStubsPtr->xKeysymToKeycode) /* 47 */
-#endif
-#ifndef XLookupColor
#define XLookupColor \
(tkIntXlibStubsPtr->xLookupColor) /* 48 */
-#endif
-#ifndef XMapWindow
#define XMapWindow \
(tkIntXlibStubsPtr->xMapWindow) /* 49 */
-#endif
-#ifndef XMoveResizeWindow
#define XMoveResizeWindow \
(tkIntXlibStubsPtr->xMoveResizeWindow) /* 50 */
-#endif
-#ifndef XMoveWindow
#define XMoveWindow \
(tkIntXlibStubsPtr->xMoveWindow) /* 51 */
-#endif
-#ifndef XNextEvent
#define XNextEvent \
(tkIntXlibStubsPtr->xNextEvent) /* 52 */
-#endif
-#ifndef XPutBackEvent
#define XPutBackEvent \
(tkIntXlibStubsPtr->xPutBackEvent) /* 53 */
-#endif
-#ifndef XQueryColors
#define XQueryColors \
(tkIntXlibStubsPtr->xQueryColors) /* 54 */
-#endif
-#ifndef XQueryPointer
#define XQueryPointer \
(tkIntXlibStubsPtr->xQueryPointer) /* 55 */
-#endif
-#ifndef XQueryTree
#define XQueryTree \
(tkIntXlibStubsPtr->xQueryTree) /* 56 */
-#endif
-#ifndef XRaiseWindow
#define XRaiseWindow \
(tkIntXlibStubsPtr->xRaiseWindow) /* 57 */
-#endif
-#ifndef XRefreshKeyboardMapping
#define XRefreshKeyboardMapping \
(tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 58 */
-#endif
-#ifndef XResizeWindow
#define XResizeWindow \
(tkIntXlibStubsPtr->xResizeWindow) /* 59 */
-#endif
-#ifndef XSelectInput
#define XSelectInput \
(tkIntXlibStubsPtr->xSelectInput) /* 60 */
-#endif
-#ifndef XSendEvent
#define XSendEvent \
(tkIntXlibStubsPtr->xSendEvent) /* 61 */
-#endif
-#ifndef XSetCommand
#define XSetCommand \
(tkIntXlibStubsPtr->xSetCommand) /* 62 */
-#endif
-#ifndef XSetIconName
#define XSetIconName \
(tkIntXlibStubsPtr->xSetIconName) /* 63 */
-#endif
-#ifndef XSetInputFocus
#define XSetInputFocus \
(tkIntXlibStubsPtr->xSetInputFocus) /* 64 */
-#endif
-#ifndef XSetSelectionOwner
#define XSetSelectionOwner \
(tkIntXlibStubsPtr->xSetSelectionOwner) /* 65 */
-#endif
-#ifndef XSetWindowBackground
#define XSetWindowBackground \
(tkIntXlibStubsPtr->xSetWindowBackground) /* 66 */
-#endif
-#ifndef XSetWindowBackgroundPixmap
#define XSetWindowBackgroundPixmap \
(tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 67 */
-#endif
-#ifndef XSetWindowBorder
#define XSetWindowBorder \
(tkIntXlibStubsPtr->xSetWindowBorder) /* 68 */
-#endif
-#ifndef XSetWindowBorderPixmap
#define XSetWindowBorderPixmap \
(tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 69 */
-#endif
-#ifndef XSetWindowBorderWidth
#define XSetWindowBorderWidth \
(tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 70 */
-#endif
-#ifndef XSetWindowColormap
#define XSetWindowColormap \
(tkIntXlibStubsPtr->xSetWindowColormap) /* 71 */
-#endif
-#ifndef XTranslateCoordinates
#define XTranslateCoordinates \
(tkIntXlibStubsPtr->xTranslateCoordinates) /* 72 */
-#endif
-#ifndef XUngrabKeyboard
#define XUngrabKeyboard \
(tkIntXlibStubsPtr->xUngrabKeyboard) /* 73 */
-#endif
-#ifndef XUngrabPointer
#define XUngrabPointer \
(tkIntXlibStubsPtr->xUngrabPointer) /* 74 */
-#endif
-#ifndef XUnmapWindow
#define XUnmapWindow \
(tkIntXlibStubsPtr->xUnmapWindow) /* 75 */
-#endif
-#ifndef XWindowEvent
#define XWindowEvent \
(tkIntXlibStubsPtr->xWindowEvent) /* 76 */
-#endif
-#ifndef XDestroyIC
#define XDestroyIC \
(tkIntXlibStubsPtr->xDestroyIC) /* 77 */
-#endif
-#ifndef XFilterEvent
#define XFilterEvent \
(tkIntXlibStubsPtr->xFilterEvent) /* 78 */
-#endif
-#ifndef XmbLookupString
#define XmbLookupString \
(tkIntXlibStubsPtr->xmbLookupString) /* 79 */
-#endif
-#ifndef TkPutImage
#define TkPutImage \
(tkIntXlibStubsPtr->tkPutImage) /* 80 */
-#endif
/* Slot 81 is reserved */
-#ifndef XParseColor
#define XParseColor \
(tkIntXlibStubsPtr->xParseColor) /* 82 */
-#endif
-#ifndef XCreateGC
#define XCreateGC \
(tkIntXlibStubsPtr->xCreateGC) /* 83 */
-#endif
-#ifndef XFreeGC
#define XFreeGC \
(tkIntXlibStubsPtr->xFreeGC) /* 84 */
-#endif
-#ifndef XInternAtom
#define XInternAtom \
(tkIntXlibStubsPtr->xInternAtom) /* 85 */
-#endif
-#ifndef XSetBackground
#define XSetBackground \
(tkIntXlibStubsPtr->xSetBackground) /* 86 */
-#endif
-#ifndef XSetForeground
#define XSetForeground \
(tkIntXlibStubsPtr->xSetForeground) /* 87 */
-#endif
-#ifndef XSetClipMask
#define XSetClipMask \
(tkIntXlibStubsPtr->xSetClipMask) /* 88 */
-#endif
-#ifndef XSetClipOrigin
#define XSetClipOrigin \
(tkIntXlibStubsPtr->xSetClipOrigin) /* 89 */
-#endif
-#ifndef XSetTSOrigin
#define XSetTSOrigin \
(tkIntXlibStubsPtr->xSetTSOrigin) /* 90 */
-#endif
-#ifndef XChangeGC
#define XChangeGC \
(tkIntXlibStubsPtr->xChangeGC) /* 91 */
-#endif
-#ifndef XSetFont
#define XSetFont \
(tkIntXlibStubsPtr->xSetFont) /* 92 */
-#endif
-#ifndef XSetArcMode
#define XSetArcMode \
(tkIntXlibStubsPtr->xSetArcMode) /* 93 */
-#endif
-#ifndef XSetStipple
#define XSetStipple \
(tkIntXlibStubsPtr->xSetStipple) /* 94 */
-#endif
-#ifndef XSetFillRule
#define XSetFillRule \
(tkIntXlibStubsPtr->xSetFillRule) /* 95 */
-#endif
-#ifndef XSetFillStyle
#define XSetFillStyle \
(tkIntXlibStubsPtr->xSetFillStyle) /* 96 */
-#endif
-#ifndef XSetFunction
#define XSetFunction \
(tkIntXlibStubsPtr->xSetFunction) /* 97 */
-#endif
-#ifndef XSetLineAttributes
#define XSetLineAttributes \
(tkIntXlibStubsPtr->xSetLineAttributes) /* 98 */
-#endif
-#ifndef _XInitImageFuncPtrs
#define _XInitImageFuncPtrs \
(tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 99 */
-#endif
-#ifndef XCreateIC
#define XCreateIC \
(tkIntXlibStubsPtr->xCreateIC) /* 100 */
-#endif
-#ifndef XGetVisualInfo
#define XGetVisualInfo \
(tkIntXlibStubsPtr->xGetVisualInfo) /* 101 */
-#endif
-#ifndef XSetWMClientMachine
#define XSetWMClientMachine \
(tkIntXlibStubsPtr->xSetWMClientMachine) /* 102 */
-#endif
-#ifndef XStringListToTextProperty
#define XStringListToTextProperty \
(tkIntXlibStubsPtr->xStringListToTextProperty) /* 103 */
-#endif
-#ifndef XDrawLine
#define XDrawLine \
(tkIntXlibStubsPtr->xDrawLine) /* 104 */
-#endif
-#ifndef XWarpPointer
#define XWarpPointer \
(tkIntXlibStubsPtr->xWarpPointer) /* 105 */
-#endif
-#ifndef XFillRectangle
#define XFillRectangle \
(tkIntXlibStubsPtr->xFillRectangle) /* 106 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#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
-#ifndef XQueryTree
#define XQueryTree \
(tkIntXlibStubsPtr->xQueryTree) /* 90 */
-#endif
-#ifndef XSync
#define XSync \
(tkIntXlibStubsPtr->xSync) /* 91 */
-#endif
#endif /* AQUA */
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
+#endif /* defined(USE_TK_STUBS) */
/* !END!: Do not edit above this line. */
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 44421d2..ada467f 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -24,7 +24,7 @@ typedef struct {
/* Table defining configuration options
* available for the listbox. */
Tk_OptionTable itemAttrOptionTable;
- /* Table definining configuration options
+ /* Table defining configuration options
* available for listbox items. */
} ListboxOptionTables;
@@ -211,7 +211,7 @@ enum state {
STATE_DISABLED, STATE_NORMAL
};
-static char *stateStrings[] = {
+static const char *const stateStrings[] = {
"disabled", "normal", NULL
};
@@ -219,7 +219,7 @@ enum activeStyle {
ACTIVE_STYLE_DOTBOX, ACTIVE_STYLE_NONE, ACTIVE_STYLE_UNDERLINE
};
-static char *activeStyleStrings[] = {
+static const char *const activeStyleStrings[] = {
"dotbox", "none", "underline", NULL
};
@@ -338,7 +338,7 @@ static const Tk_OptionSpec itemAttrOptionSpecs[] = {
* dispatch the listbox widget command.
*/
-static const char *commandNames[] = {
+static const char *const commandNames[] = {
"activate", "bbox", "cget", "configure", "curselection", "delete", "get",
"index", "insert", "itemcget", "itemconfigure", "nearest", "scan",
"see", "selection", "size", "xview", "yview", NULL
@@ -351,21 +351,21 @@ enum command {
COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW
};
-static const char *selCommandNames[] = {
+static const char *const selCommandNames[] = {
"anchor", "clear", "includes", "set", NULL
};
enum selcommand {
SELECTION_ANCHOR, SELECTION_CLEAR, SELECTION_INCLUDES, SELECTION_SET
};
-static const char *scanCommandNames[] = {
+static const char *const scanCommandNames[] = {
"mark", "dragto", NULL
};
enum scancommand {
SCAN_MARK, SCAN_DRAGTO
};
-static const char *indexNames[] = {
+static const char *const indexNames[] = {
"active", "anchor", "end", NULL
};
enum indices {
@@ -434,7 +434,7 @@ static void MigrateHashEntries(Tcl_HashTable *table,
* that can be invoked from generic window code.
*/
-static Tk_ClassProcs listboxClass = {
+static const Tk_ClassProcs listboxClass = {
sizeof(Tk_ClassProcs), /* size */
ListboxWorldChanged, /* worldChangedProc */
NULL, /* createProc */
@@ -470,7 +470,7 @@ Tk_ListboxObjCmd(
ListboxOptionTables *optionTables;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -489,15 +489,14 @@ Tk_ListboxObjCmd(
* command, so future invocations will have access to it.
*/
- optionTables = (ListboxOptionTables *)
- ckalloc(sizeof(ListboxOptionTables));
+ optionTables = ckalloc(sizeof(ListboxOptionTables));
/*
* Set up an exit handler to free the optionTables struct.
*/
Tcl_SetAssocData(interp, "ListboxOptionTables",
- DestroyListboxOptionTables, (ClientData) optionTables);
+ DestroyListboxOptionTables, optionTables);
/*
* Create the listbox option table and the listbox item option table.
@@ -515,22 +514,20 @@ Tk_ListboxObjCmd(
* already (e.g. resource pointers).
*/
- listPtr = (Listbox *) ckalloc(sizeof(Listbox));
+ listPtr = ckalloc(sizeof(Listbox));
memset(listPtr, 0, (sizeof(Listbox)));
listPtr->tkwin = tkwin;
listPtr->display = Tk_Display(tkwin);
listPtr->interp = interp;
listPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(listPtr->tkwin), ListboxWidgetObjCmd,
- (ClientData) listPtr, ListboxCmdDeletedProc);
+ Tk_PathName(listPtr->tkwin), ListboxWidgetObjCmd, listPtr,
+ ListboxCmdDeletedProc);
listPtr->optionTable = optionTables->listboxOptionTable;
listPtr->itemAttrOptionTable = optionTables->itemAttrOptionTable;
- listPtr->selection = (Tcl_HashTable *)
- ckalloc(sizeof(Tcl_HashTable));
+ listPtr->selection = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->selection, TCL_ONE_WORD_KEYS);
- listPtr->itemAttrTable = (Tcl_HashTable *)
- ckalloc(sizeof(Tcl_HashTable));
+ listPtr->itemAttrTable = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->itemAttrTable, TCL_ONE_WORD_KEYS);
listPtr->relief = TK_RELIEF_RAISED;
listPtr->textGC = None;
@@ -548,15 +545,15 @@ Tk_ListboxObjCmd(
* otherwise Tk might free it while we still need it.
*/
- Tcl_Preserve((ClientData) listPtr->tkwin);
+ Tcl_Preserve(listPtr->tkwin);
Tk_SetClass(listPtr->tkwin, "Listbox");
- Tk_SetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr);
+ Tk_SetClassProcs(listPtr->tkwin, &listboxClass, listPtr);
Tk_CreateEventHandler(listPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- ListboxEventProc, (ClientData) listPtr);
+ ListboxEventProc, listPtr);
Tk_CreateSelHandler(listPtr->tkwin, XA_PRIMARY, XA_STRING,
- ListboxFetchSelection, (ClientData) listPtr, XA_STRING);
+ ListboxFetchSelection, listPtr, XA_STRING);
if (Tk_InitOptions(interp, (char *)listPtr,
optionTables->listboxOptionTable, tkwin) != TCL_OK) {
Tk_DestroyWindow(listPtr->tkwin);
@@ -568,7 +565,7 @@ Tk_ListboxObjCmd(
return TCL_ERROR;
}
- Tcl_SetResult(interp, Tk_PathName(listPtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(listPtr->tkwin));
return TCL_OK;
}
@@ -597,12 +594,12 @@ ListboxWidgetObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Arguments as Tcl_Obj's. */
{
- register Listbox *listPtr = (Listbox *) clientData;
+ register Listbox *listPtr = clientData;
int cmdIndex, index;
int result = TCL_OK;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -617,7 +614,7 @@ ListboxWidgetObjCmd(
return result;
}
- Tcl_Preserve((ClientData)listPtr);
+ Tcl_Preserve(listPtr);
/*
* The subcommand was valid, so continue processing.
@@ -694,10 +691,9 @@ ListboxWidgetObjCmd(
if (objPtr == NULL) {
result = TCL_ERROR;
break;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
}
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
} else {
result = ConfigureListbox(interp, listPtr, objc-2, objv+2, 0);
}
@@ -820,8 +816,8 @@ ListboxWidgetObjCmd(
Tcl_SetObjResult(interp, elemPtrs[first]);
} else {
- Tcl_SetListObj(Tcl_GetObjResult(interp), (last - first + 1),
- &(elemPtrs[first]));
+ Tcl_SetObjResult(interp,
+ Tcl_NewListObj(last-first+1, elemPtrs+first));
}
result = TCL_OK;
break;
@@ -843,7 +839,7 @@ ListboxWidgetObjCmd(
case COMMAND_INSERT:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index ?element element ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "index ?element ...?");
result = TCL_ERROR;
break;
}
@@ -901,7 +897,7 @@ ListboxWidgetObjCmd(
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv,
- "index ?option? ?value? ?option value ...?");
+ "index ?-option? ?value? ?-option value ...?");
result = TCL_ERROR;
break;
}
@@ -1049,7 +1045,7 @@ ListboxWidgetObjCmd(
result = ListboxYviewSubCmd(interp, listPtr, objc, objv);
break;
}
- Tcl_Release((ClientData)listPtr);
+ Tcl_Release(listPtr);
return result;
}
@@ -1094,9 +1090,8 @@ ListboxBboxSubCmd(
*/
if ((listPtr->topIndex <= index) && (index < lastVisibleIndex)) {
- char buf[TCL_INTEGER_SPACE * 4];
Tcl_Obj *el;
- char *stringRep;
+ const char *stringRep;
int pixelWidth, stringLen, x, y, result;
Tk_FontMetrics fm;
@@ -1116,8 +1111,8 @@ ListboxBboxSubCmd(
x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
y = ((index - listPtr->topIndex)*listPtr->lineHeight)
+ listPtr->inset + listPtr->selBorderWidth;
- sprintf(buf, "%d %d %d %d", x, y, pixelWidth, fm.linespace);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d %d",
+ x, y, pixelWidth, fm.linespace));
}
return TCL_OK;
}
@@ -1240,7 +1235,7 @@ ListboxXviewSubCmd(
int index, count, type, windowWidth, windowUnits;
int offset = 0; /* Initialized to stop gcc warnings. */
- double fraction, fraction2;
+ double fraction;
windowWidth = Tk_Width(listPtr->tkwin)
- 2*(listPtr->inset + listPtr->selBorderWidth);
@@ -1248,7 +1243,7 @@ ListboxXviewSubCmd(
if (listPtr->maxWidth == 0) {
Tcl_SetResult(interp, "0.0 1.0", TCL_STATIC);
} else {
- char buf[TCL_DOUBLE_SPACE];
+ double fraction2;
fraction = listPtr->xOffset/((double) listPtr->maxWidth);
fraction2 = (listPtr->xOffset + windowWidth)
@@ -1256,10 +1251,8 @@ ListboxXviewSubCmd(
if (fraction2 > 1.0) {
fraction2 = 1.0;
}
- Tcl_PrintDouble(NULL, fraction, buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- Tcl_PrintDouble(NULL, fraction2, buf);
- Tcl_AppendResult(interp, " ", buf, NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%g %g",
+ fraction, fraction2));
}
} else if (objc == 3) {
if (Tcl_GetIntFromObj(interp, objv[2], &index) != TCL_OK) {
@@ -1316,24 +1309,21 @@ ListboxYviewSubCmd(
Tcl_Obj *const objv[]) /* Array of arguments to the procedure */
{
int index, count, type;
- double fraction, fraction2;
+ double fraction;
if (objc == 2) {
if (listPtr->nElements == 0) {
Tcl_SetResult(interp, "0.0 1.0", TCL_STATIC);
} else {
- char buf[TCL_DOUBLE_SPACE];
+ double fraction2, numEls = (double) listPtr->nElements;
- fraction = listPtr->topIndex/((double) listPtr->nElements);
- fraction2 = (listPtr->topIndex+listPtr->fullLines)
- /((double) listPtr->nElements);
+ fraction = listPtr->topIndex / numEls;
+ fraction2 = (listPtr->topIndex+listPtr->fullLines) / numEls;
if (fraction2 > 1.0) {
fraction2 = 1.0;
}
- Tcl_PrintDouble(NULL, fraction, buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- Tcl_PrintDouble(NULL, fraction2, buf);
- Tcl_AppendResult(interp, " ", buf, NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%g %g",
+ fraction, fraction2));
}
} else if (objc == 3) {
if (GetListboxIndex(interp, listPtr, objv[2], 0, &index) != TCL_OK) {
@@ -1396,16 +1386,17 @@ ListboxGetItemAttributes(
entry = Tcl_CreateHashEntry(listPtr->itemAttrTable,
(char *) INT2PTR(index), &isNew);
if (isNew) {
- attrs = (ItemAttr *) ckalloc(sizeof(ItemAttr));
+ attrs = ckalloc(sizeof(ItemAttr));
attrs->border = NULL;
attrs->selBorder = NULL;
attrs->fgColor = NULL;
attrs->selFgColor = NULL;
Tk_InitOptions(interp, (char *)attrs, listPtr->itemAttrOptionTable,
listPtr->tkwin);
- Tcl_SetHashValue(entry, (ClientData) attrs);
+ Tcl_SetHashValue(entry, attrs);
+ } else {
+ attrs = Tcl_GetHashValue(entry);
}
- attrs = (ItemAttr *)Tcl_GetHashValue(entry);
return attrs;
}
@@ -1447,7 +1438,7 @@ DestroyListbox(
if (listPtr->listVarName != NULL) {
Tcl_UntraceVar(listPtr->interp, listPtr->listVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ListboxListVarProc, (ClientData) listPtr);
+ ListboxListVarProc, listPtr);
}
/*
@@ -1455,7 +1446,7 @@ DestroyListbox(
*/
Tcl_DeleteHashTable(listPtr->selection);
- ckfree((char *)listPtr->selection);
+ ckfree(listPtr->selection);
/*
* Free the item attribute hash table.
@@ -1463,10 +1454,10 @@ DestroyListbox(
for (entry = Tcl_FirstHashEntry(listPtr->itemAttrTable, &search);
entry != NULL; entry = Tcl_NextHashEntry(&search)) {
- ckfree((char *)Tcl_GetHashValue(entry));
+ ckfree(Tcl_GetHashValue(entry));
}
Tcl_DeleteHashTable(listPtr->itemAttrTable);
- ckfree((char *)listPtr->itemAttrTable);
+ ckfree(listPtr->itemAttrTable);
/*
* Free up all the stuff that requires special handling, then let
@@ -1483,11 +1474,11 @@ DestroyListbox(
Tk_FreeBitmap(Tk_Display(listPtr->tkwin), listPtr->gray);
}
- Tk_FreeConfigOptions((char *)listPtr, listPtr->optionTable,
+ Tk_FreeConfigOptions((char *) listPtr, listPtr->optionTable,
listPtr->tkwin);
- Tcl_Release((ClientData) listPtr->tkwin);
+ Tcl_Release(listPtr->tkwin);
listPtr->tkwin = NULL;
- ckfree((char *) listPtr);
+ ckfree(listPtr);
}
/*
@@ -1513,7 +1504,7 @@ DestroyListboxOptionTables(
ClientData clientData, /* Pointer to the OptionTables struct */
Tcl_Interp *interp) /* Pointer to the calling interp */
{
- ckfree((char *) clientData);
+ ckfree(clientData);
return;
}
@@ -1555,7 +1546,7 @@ ConfigureListbox(
if (listPtr->listVarName != NULL) {
Tcl_UntraceVar(interp, listPtr->listVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ListboxListVarProc, (ClientData) listPtr);
+ ListboxListVarProc, listPtr);
}
for (error = 0; error <= 1; error++) {
@@ -1598,8 +1589,8 @@ ConfigureListbox(
if (listPtr->exportSelection && !oldExport
&& (listPtr->numSelected != 0)) {
- Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection,
- (ClientData) listPtr);
+ Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY,
+ ListboxLostSelection, listPtr);
}
/*
@@ -1651,7 +1642,7 @@ ConfigureListbox(
listPtr->listObj = listVarObj;
Tcl_TraceVar(listPtr->interp, listPtr->listVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ListboxListVarProc, (ClientData) listPtr);
+ ListboxListVarProc, listPtr);
} else if (listPtr->listObj == NULL) {
listPtr->listObj = Tcl_NewObj();
}
@@ -1675,10 +1666,9 @@ ConfigureListbox(
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
return TCL_ERROR;
- } else {
- ListboxWorldChanged((ClientData) listPtr);
- return TCL_OK;
}
+ ListboxWorldChanged(listPtr);
+ return TCL_OK;
}
/*
@@ -1755,7 +1745,7 @@ ListboxWorldChanged(
XGCValues gcValues;
GC gc;
unsigned long mask;
- Listbox *listPtr = (Listbox *) instanceData;
+ Listbox *listPtr = instanceData;
if (listPtr->state & STATE_NORMAL) {
gcValues.foreground = listPtr->fgColorPtr->pixel;
@@ -1826,14 +1816,14 @@ static void
DisplayListbox(
ClientData clientData) /* Information about window. */
{
- register Listbox *listPtr = (Listbox *) clientData;
+ register Listbox *listPtr = clientData;
register Tk_Window tkwin = listPtr->tkwin;
GC gc;
int i, limit, x, y, prevSelected, freeGC, stringLen;
Tk_FontMetrics fm;
Tcl_Obj *curElement;
Tcl_HashEntry *entry;
- char *stringRep;
+ const char *stringRep;
ItemAttr *attrs;
Tk_3DBorder selectedBg;
XGCValues gcValues;
@@ -1854,23 +1844,23 @@ DisplayListbox(
listPtr->flags |= UPDATE_H_SCROLLBAR;
}
- Tcl_Preserve((ClientData) listPtr);
+ Tcl_Preserve(listPtr);
if (listPtr->flags & UPDATE_V_SCROLLBAR) {
ListboxUpdateVScrollbar(listPtr);
if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) {
- Tcl_Release((ClientData) listPtr);
+ Tcl_Release(listPtr);
return;
}
}
if (listPtr->flags & UPDATE_H_SCROLLBAR) {
ListboxUpdateHScrollbar(listPtr);
if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) {
- Tcl_Release((ClientData) listPtr);
+ Tcl_Release(listPtr);
return;
}
}
listPtr->flags &= ~(REDRAW_PENDING|UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR);
- Tcl_Release((ClientData) listPtr);
+ Tcl_Release(listPtr);
#ifndef TK_NO_DOUBLE_BUFFERING
/*
@@ -1944,7 +1934,7 @@ DisplayListbox(
*/
if (entry != NULL) {
- attrs = (ItemAttr *)Tcl_GetHashValue(entry);
+ attrs = Tcl_GetHashValue(entry);
/*
* Default GC has the values from the widget at large.
@@ -2026,7 +2016,7 @@ DisplayListbox(
*/
if (entry != NULL) {
- attrs = (ItemAttr *)Tcl_GetHashValue(entry);
+ attrs = Tcl_GetHashValue(entry);
gcValues.foreground = listPtr->fgColorPtr->pixel;
gcValues.font = Tk_FontId(listPtr->tkfont);
gcValues.graphics_exposures = False;
@@ -2216,7 +2206,7 @@ ListboxComputeGeometry(
int width, height, pixelWidth, pixelHeight, textLength, i, result;
Tk_FontMetrics fm;
Tcl_Obj *element;
- char *text;
+ const char *text;
if (fontChanged || maxIsStale) {
listPtr->xScrollUnit = Tk_TextWidth(listPtr->tkfont, "0", 1);
@@ -2302,7 +2292,7 @@ ListboxInsertSubCmd(
{
int i, oldMaxWidth, pixelWidth, result, length;
Tcl_Obj *newListObj;
- char *stringRep;
+ const char *stringRep;
oldMaxWidth = listPtr->maxWidth;
for (i = 0; i < objc; i++) {
@@ -2416,7 +2406,7 @@ ListboxDeleteSubCmd(
{
int count, i, widthChanged, length, result, pixelWidth;
Tcl_Obj *newListObj, *element;
- char *stringRep;
+ const char *stringRep;
Tcl_HashEntry *entry;
/*
@@ -2457,7 +2447,7 @@ ListboxDeleteSubCmd(
entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *) INT2PTR(i));
if (entry != NULL) {
- ckfree((char *)Tcl_GetHashValue(entry));
+ ckfree(Tcl_GetHashValue(entry));
Tcl_DeleteHashEntry(entry);
}
@@ -2587,7 +2577,7 @@ ListboxEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- Listbox *listPtr = (Listbox *) clientData;
+ Listbox *listPtr = clientData;
if (eventPtr->type == Expose) {
EventuallyRedrawRange(listPtr,
@@ -2662,7 +2652,7 @@ static void
ListboxCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- Listbox *listPtr = (Listbox *) clientData;
+ Listbox *listPtr = clientData;
/*
* This procedure could be invoked either because the window was destroyed
@@ -2706,7 +2696,7 @@ GetListboxIndex(
int *indexPtr) /* Where to store converted index. */
{
int result, index;
- char *stringRep;
+ const char *stringRep;
/*
* First see if the index is one of the named indices.
@@ -2743,7 +2733,8 @@ GetListboxIndex(
if (stringRep[0] == '@') {
/* @x,y index */
int y;
- char *start, *end;
+ const char *start;
+ char *end;
start = stringRep + 1;
y = strtol(start, &end, 0);
@@ -3048,7 +3039,7 @@ ListboxSelect(
if (select) {
entry = Tcl_CreateHashEntry(listPtr->selection,
(char *) INT2PTR(i), &isNew);
- Tcl_SetHashValue(entry, (ClientData) NULL);
+ Tcl_SetHashValue(entry, NULL);
listPtr->numSelected++;
if (firstRedisplay < 0) {
firstRedisplay = i;
@@ -3062,8 +3053,8 @@ ListboxSelect(
}
if ((oldCount == 0) && (listPtr->numSelected > 0)
&& (listPtr->exportSelection)) {
- Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection,
- (ClientData) listPtr);
+ Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY,
+ ListboxLostSelection, listPtr);
}
return TCL_OK;
}
@@ -3100,11 +3091,11 @@ ListboxFetchSelection(
* not including terminating NULL
* character. */
{
- register Listbox *listPtr = (Listbox *) clientData;
+ register Listbox *listPtr = clientData;
Tcl_DString selection;
int length, count, needNewline, stringLen, i;
Tcl_Obj *curElement;
- char *stringRep;
+ const char *stringRep;
Tcl_HashEntry *entry;
if (!listPtr->exportSelection) {
@@ -3176,7 +3167,7 @@ static void
ListboxLostSelection(
ClientData clientData) /* Information about listbox widget. */
{
- register Listbox *listPtr = (Listbox *) clientData;
+ register Listbox *listPtr = clientData;
if ((listPtr->exportSelection) && (listPtr->nElements > 0)) {
ListboxSelect(listPtr, 0, listPtr->nElements-1, 0);
@@ -3220,7 +3211,7 @@ EventuallyRedrawRange(
return;
}
listPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayListbox, (ClientData) listPtr);
+ Tcl_DoWhenIdle(DisplayListbox, listPtr);
}
/*
@@ -3247,7 +3238,7 @@ static void
ListboxUpdateVScrollbar(
register Listbox *listPtr) /* Information about widget. */
{
- char firstStr[TCL_DOUBLE_SPACE+1], lastStr[TCL_DOUBLE_SPACE+1];
+ char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE];
double first, last;
int result;
Tcl_Interp *interp;
@@ -3259,16 +3250,15 @@ ListboxUpdateVScrollbar(
first = 0.0;
last = 1.0;
} else {
- first = listPtr->topIndex / (double) listPtr->nElements;
+ first = listPtr->topIndex / ((double) listPtr->nElements);
last = (listPtr->topIndex + listPtr->fullLines)
- / (double) listPtr->nElements;
+ / ((double) listPtr->nElements);
if (last > 1.0) {
last = 1.0;
}
}
- firstStr[0] = lastStr[0] = ' ';
- Tcl_PrintDouble(NULL, first, firstStr+1);
- Tcl_PrintDouble(NULL, last, lastStr+1);
+ Tcl_PrintDouble(NULL, first, firstStr);
+ Tcl_PrintDouble(NULL, last, lastStr);
/*
* We must hold onto the interpreter from the listPtr because the data at
@@ -3277,12 +3267,12 @@ ListboxUpdateVScrollbar(
interp = listPtr->interp;
Tcl_Preserve(interp);
- result = Tcl_VarEval(interp, listPtr->yScrollCmd, firstStr, lastStr,
- NULL);
+ result = Tcl_VarEval(interp, listPtr->yScrollCmd, " ", firstStr, " ",
+ lastStr, NULL);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (vertical scrolling command executed by listbox)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_Release(interp);
}
@@ -3311,7 +3301,7 @@ static void
ListboxUpdateHScrollbar(
register Listbox *listPtr) /* Information about widget. */
{
- char firstStr[TCL_DOUBLE_SPACE+1], lastStr[TCL_DOUBLE_SPACE+1];
+ char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE];
int result, windowWidth;
double first, last;
Tcl_Interp *interp;
@@ -3325,17 +3315,15 @@ ListboxUpdateHScrollbar(
first = 0;
last = 1.0;
} else {
- register double maxWide = (double) listPtr->maxWidth;
-
- first = listPtr->xOffset / maxWide;
- last = (listPtr->xOffset + windowWidth) / maxWide;
+ first = listPtr->xOffset/((double) listPtr->maxWidth);
+ last = (listPtr->xOffset + windowWidth)
+ /((double) listPtr->maxWidth);
if (last > 1.0) {
last = 1.0;
}
}
- firstStr[0] = lastStr[0] = ' ';
- Tcl_PrintDouble(NULL, first, firstStr+1);
- Tcl_PrintDouble(NULL, last, lastStr+1);
+ Tcl_PrintDouble(NULL, first, firstStr);
+ Tcl_PrintDouble(NULL, last, lastStr);
/*
* We must hold onto the interpreter because the data referred to at
@@ -3344,12 +3332,12 @@ ListboxUpdateHScrollbar(
interp = listPtr->interp;
Tcl_Preserve(interp);
- result = Tcl_VarEval(interp, listPtr->xScrollCmd, firstStr, lastStr,
- NULL);
+ result = Tcl_VarEval(interp, listPtr->xScrollCmd, " ", firstStr, " ",
+ lastStr, NULL);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by listbox)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_Release(interp);
}
@@ -3378,7 +3366,7 @@ ListboxListVarProc(
const char *name2, /* Not used. */
int flags) /* Information about what happened. */
{
- Listbox *listPtr = (Listbox *)clientData;
+ Listbox *listPtr = clientData;
Tcl_Obj *oldListObj, *varListObj;
int oldLength, i;
Tcl_HashEntry *entry;
@@ -3454,7 +3442,7 @@ ListboxListVarProc(
entry = Tcl_FindHashEntry(listPtr->itemAttrTable,
(char *) INT2PTR(i));
if (entry != NULL) {
- ckfree((char *) Tcl_GetHashValue(entry));
+ ckfree(Tcl_GetHashValue(entry));
Tcl_DeleteHashEntry(entry);
}
}
diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c
index 9351de1..9449838 100644
--- a/generic/tkMacWinMenu.c
+++ b/generic/tkMacWinMenu.c
@@ -43,10 +43,10 @@ PreprocessMenu(
TkMenu *menuPtr)
{
int index, result, finished;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- Tcl_Preserve((ClientData) menuPtr);
+ Tcl_Preserve(menuPtr);
/*
* First, let's process the post command on ourselves. If this command
@@ -91,7 +91,7 @@ PreprocessMenu(
} while (!finished);
done:
- Tcl_Release((ClientData) menuPtr);
+ Tcl_Release(menuPtr);
return result;
}
@@ -129,7 +129,7 @@ int
TkPreprocessMenu(
TkMenu *menuPtr)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->postCommandGeneration++;
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 39465c9..fee669e 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -14,27 +14,75 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tclInt.h"
+/**
+ * On Windows, this file needs to be compiled twice, once with
+ * TK_ASCII_MAIN defined. This way both Tk_MainEx and Tk_MainExW
+ * can be implemented, sharing the same source code.
+ */
+#if defined(TK_ASCII_MAIN)
+# ifdef UNICODE
+# undef UNICODE
+# undef _UNICODE
+# else
+# define UNICODE
+# define _UNICODE
+# endif
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
#include "tkInt.h"
+#ifdef NO_STDLIB_H
+# include "../compat/stdlib.h"
+#else
+# include <stdlib.h>
+#endif
+
+/*
+ * The default prompt used when the user has not overridden it.
+ */
+
+#define DEFAULT_PRIMARY_PROMPT "% "
+
+/*
+ * This file can be compiled on Windows in UNICODE mode, as well as
+ * on all other platforms using the native encoding. This is done
+ * by using the normal Windows functions like _tcscmp, but on
+ * platforms which don't have <tchar.h> we have to translate that
+ * to strcmp here.
+ */
#ifdef __WIN32__
-#include "tkWinInt.h"
+# include "tkWinInt.h"
+#else
+# define TCHAR char
+# define TEXT(arg) arg
+# define _tcscmp strcmp
+# define _tcslen strlen
+# define _tcsncmp strncmp
#endif
+
#ifdef MAC_OSX_TK
#include "tkMacOSXInt.h"
#endif
-
-typedef struct ThreadSpecificData {
- Tcl_Interp *interp; /* Interpreter for this thread. */
- Tcl_DString command; /* Used to assemble lines of terminal input
- * into Tcl commands. */
- Tcl_DString line; /* Used to read the next line from the
- * terminal input. */
- int tty; /* Non-zero means standard input is a
- * terminal-like device. Zero means it's a
- * file. */
-} ThreadSpecificData;
-static Tcl_ThreadDataKey dataKey;
+/*
+ * Further on, in UNICODE mode, we need to use Tcl_NewUnicodeObj,
+ * while otherwise NewNativeObj is needed (which provides proper
+ * conversion from native encoding to UTF-8).
+ */
+#ifdef UNICODE
+# define NewNativeObj Tcl_NewUnicodeObj
+#else /* !UNICODE */
+ static Tcl_Obj *NewNativeObj(char *string, int length) {
+ Tcl_Obj *obj;
+ Tcl_DString ds;
+ Tcl_ExternalToUtfDString(NULL, string, length, &ds);
+ obj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
+ return obj;
+}
+#endif /* !UNICODE */
/*
* Declarations for various library functions and variables (don't want to
@@ -44,16 +92,49 @@ static Tcl_ThreadDataKey dataKey;
* it will conflict with a declaration elsewhere on some systems.
*/
-#if !defined(__WIN32__) && !defined(_WIN32)
+#if defined(_WIN32)
+#define isatty WinIsTty
+static int WinIsTty(int fd) {
+ HANDLE handle;
+ /*
+ * For now, under Windows, we assume we are not running as a console mode
+ * app, so we need to use the GUI console. In order to enable this, we
+ * always claim to be running on a tty. This probably isn't the right way
+ * to do it.
+ */
+ handle = GetStdHandle(STD_INPUT_HANDLE + fd);
+ /*
+ * If it's a bad or closed handle, then it's been connected to a wish
+ * console window. A character file handle is a tty by definition.
+ */
+ return (handle == INVALID_HANDLE_VALUE) || (handle == 0)
+ || (GetFileType(handle) == FILE_TYPE_UNKNOWN)
+ || (GetFileType(handle) == FILE_TYPE_CHAR);
+}
+#else
extern int isatty(int fd);
-extern char * strrchr(CONST char *string, int c);
#endif
+typedef struct InteractiveState {
+ Tcl_Channel input; /* The standard input channel from which lines
+ * are read. */
+ int tty; /* Non-zero means standard input is a
+ * terminal-like device. Zero means it's a
+ * file. */
+ Tcl_DString command; /* Used to assemble lines of terminal input
+ * into Tcl commands. */
+ Tcl_DString line; /* Used to read the next line from the
+ * terminal input. */
+ int gotPartial;
+ Tcl_Interp *interp; /* Interpreter that evaluates interactive
+ * commands. */
+} InteractiveState;
+
/*
* Forward declarations for functions defined later in this file.
*/
-static void Prompt(Tcl_Interp *interp, int partial);
+static void Prompt(Tcl_Interp *interp, InteractiveState *isPtr);
static void StdinProc(ClientData clientData, int mask);
/*
@@ -65,7 +146,7 @@ static void StdinProc(ClientData clientData, int mask);
*
* Results:
* None. This function never returns (it exits the process when it's
- * done.
+ * done).
*
* Side effects:
* This function initializes the Tk world and then starts interpreting
@@ -78,25 +159,21 @@ static void StdinProc(ClientData clientData, int mask);
void
Tk_MainEx(
int argc, /* Number of arguments. */
- char **argv, /* Array of argument strings. */
+ TCHAR **argv, /* Array of argument strings. */
Tcl_AppInitProc *appInitProc,
/* Application-specific initialization
* function to call after most initialization
* but before starting to execute commands. */
Tcl_Interp *interp)
{
- Tcl_Obj *path, *argvPtr;
- CONST char *encodingName;
+ Tcl_Obj *path, *argvPtr, *appName;
+ const char *encodingName;
int code, nullStdin = 0;
- Tcl_Channel inChannel, outChannel;
- ThreadSpecificData *tsdPtr;
-#ifdef __WIN32__
- HANDLE handle;
-#endif
- Tcl_DString appName;
+ Tcl_Channel chan;
+ InteractiveState is;
/*
- * Ensure that we are getting the matching version of Tcl. This is really
+ * Ensure that we are getting a compatible version of Tcl. This is really
* only an issue when Tk is loaded dynamically.
*/
@@ -104,12 +181,11 @@ Tk_MainEx(
abort();
}
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_InitMemory(interp);
- Tcl_FindExecutable(argv[0]);
- tsdPtr->interp = interp;
- Tcl_Preserve((ClientData) interp);
+ is.interp = interp;
+ is.gotPartial = 0;
+ Tcl_Preserve(interp);
#if defined(__WIN32__)
Tk_InitConsoleChannels(interp);
@@ -121,10 +197,6 @@ Tk_MainEx(
}
#endif
-#ifdef TCL_MEM_DEBUG
- Tcl_InitMemory(interp);
-#endif
-
/*
* If the application has not already set a startup script, parse the
* first few command line arguments to determine the script path and
@@ -136,44 +208,40 @@ Tk_MainEx(
/*
* Check whether first 3 args (argv[1] - argv[3]) look like
- * -encoding ENCODING FILENAME
+ * -encoding ENCODING FILENAME
* or like
- * FILENAME
+ * FILENAME
* or like
- * -file FILENAME (ancient history support only)
+ * -file FILENAME (ancient history support only)
*/
- if ((argc > 3) && (0 == strcmp("-encoding", argv[1]))
- && ('-' != argv[3][0])) {
- Tcl_SetStartupScript(Tcl_NewStringObj(argv[3], -1), argv[2]);
+ if ((argc > 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1]))
+ && (TEXT('-') != argv[3][0])) {
+ Tcl_Obj *value = NewNativeObj(argv[2], -1);
+ Tcl_SetStartupScript(NewNativeObj(argv[3], -1), Tcl_GetString(value));
+ Tcl_DecrRefCount(value);
argc -= 3;
argv += 3;
- } else if ((argc > 1) && ('-' != argv[1][0])) {
- Tcl_SetStartupScript(Tcl_NewStringObj(argv[1], -1), NULL);
+ } else if ((argc > 1) && (TEXT('-') != argv[1][0])) {
+ Tcl_SetStartupScript(NewNativeObj(argv[1], -1), NULL);
argc--;
argv++;
- } else if ((argc > 2) && (length = strlen(argv[1]))
- && (length > 1) && (0 == strncmp("-file", argv[1], length))
- && ('-' != argv[2][0])) {
- Tcl_SetStartupScript(Tcl_NewStringObj(argv[2], -1), NULL);
+ } else if ((argc > 2) && (length = _tcslen(argv[1]))
+ && (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length))
+ && (TEXT('-') != argv[2][0])) {
+ Tcl_SetStartupScript(NewNativeObj(argv[2], -1), NULL);
argc -= 2;
argv += 2;
}
}
path = Tcl_GetStartupScript(&encodingName);
- if (NULL == path) {
- Tcl_ExternalToUtfDString(NULL, argv[0], -1, &appName);
+ if (path == NULL) {
+ appName = NewNativeObj(argv[0], -1);
} else {
- int numBytes;
- CONST char *pathName = Tcl_GetStringFromObj(path, &numBytes);
-
- Tcl_ExternalToUtfDString(NULL, pathName, numBytes, &appName);
- path = Tcl_NewStringObj(Tcl_DStringValue(&appName), -1);
- Tcl_SetStartupScript(path, encodingName);
+ appName = path;
}
- Tcl_SetVar(interp, "argv0", Tcl_DStringValue(&appName), TCL_GLOBAL_ONLY);
- Tcl_DStringFree(&appName);
+ Tcl_SetVar2Ex(interp, "argv0", NULL, appName, TCL_GLOBAL_ONLY);
argc--;
argv++;
@@ -181,12 +249,7 @@ Tk_MainEx(
argvPtr = Tcl_NewListObj(0, NULL);
while (argc--) {
- Tcl_DString ds;
-
- Tcl_ExternalToUtfDString(NULL, *argv++, -1, &ds);
- Tcl_ListObjAppendElement(NULL, argvPtr, Tcl_NewStringObj(
- Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)));
- Tcl_DStringFree(&ds);
+ Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(*argv++, -1));
}
Tcl_SetVar2Ex(interp, "argv", NULL, argvPtr, TCL_GLOBAL_ONLY);
@@ -194,61 +257,30 @@ Tk_MainEx(
* Set the "tcl_interactive" variable.
*/
-#ifdef __WIN32__
- /*
- * For now, under Windows, we assume we are not running as a console mode
- * app, so we need to use the GUI console. In order to enable this, we
- * always claim to be running on a tty. This probably isn't the right way
- * to do it.
- */
-
- handle = GetStdHandle(STD_INPUT_HANDLE);
-
- if ((handle == INVALID_HANDLE_VALUE) || (handle == 0)
- || (GetFileType(handle) == FILE_TYPE_UNKNOWN)) {
- /*
- * If it's a bad or closed handle, then it's been connected to a wish
- * console window.
- */
-
- tsdPtr->tty = 1;
- } else if (GetFileType(handle) == FILE_TYPE_CHAR) {
- /*
- * A character file handle is a tty by definition.
- */
-
- tsdPtr->tty = 1;
- } else {
- tsdPtr->tty = 0;
- }
-
-#else
- tsdPtr->tty = isatty(0);
-#endif
+ is.tty = isatty(0);
#if defined(MAC_OSX_TK)
/*
* On TkAqua, if we don't have a TTY and stdin is a special character file
* of length 0, (e.g. /dev/null, which is what Finder sets when double
* clicking Wish) then use the GUI console.
*/
-
- if (!tsdPtr->tty) {
+
+ if (!is.tty) {
struct stat st;
nullStdin = fstat(0, &st) || (S_ISCHR(st.st_mode) && !st.st_blocks);
}
#endif
- Tcl_SetVar(interp, "tcl_interactive",
- ((path == NULL) && (tsdPtr->tty || nullStdin)) ? "1" : "0",
- TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
+ Tcl_NewIntObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY);
/*
* Invoke application-specific initialization.
*/
- if ((*appInitProc)(interp) != TCL_OK) {
+ if (appInitProc(interp) != TCL_OK) {
TkpDisplayWarning(Tcl_GetStringResult(interp),
- "Application initialization failed");
+ "application-specific initialization failed");
}
/*
@@ -272,7 +304,7 @@ Tk_MainEx(
Tcl_DeleteInterp(interp);
Tcl_Exit(1);
}
- tsdPtr->tty = 0;
+ is.tty = 0;
} else {
/*
@@ -285,22 +317,21 @@ Tk_MainEx(
* Establish a channel handler for stdin.
*/
- inChannel = Tcl_GetStdChannel(TCL_STDIN);
- if (inChannel) {
- Tcl_CreateChannelHandler(inChannel, TCL_READABLE, StdinProc,
- (ClientData) inChannel);
+ is.input = Tcl_GetStdChannel(TCL_STDIN);
+ if (is.input) {
+ Tcl_CreateChannelHandler(is.input, TCL_READABLE, StdinProc, &is);
}
- if (tsdPtr->tty) {
- Prompt(interp, 0);
+ if (is.tty) {
+ Prompt(interp, &is);
}
}
- outChannel = Tcl_GetStdChannel(TCL_STDOUT);
- if (outChannel) {
- Tcl_Flush(outChannel);
+ chan = Tcl_GetStdChannel(TCL_STDOUT);
+ if (chan) {
+ Tcl_Flush(chan);
}
- Tcl_DStringInit(&tsdPtr->command);
- Tcl_DStringInit(&tsdPtr->line);
+ Tcl_DStringInit(&is.command);
+ Tcl_DStringInit(&is.line);
Tcl_ResetResult(interp);
/*
@@ -310,7 +341,7 @@ Tk_MainEx(
Tk_MainLoop();
Tcl_DeleteInterp(interp);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
Tcl_SetStartupScript(NULL, NULL);
Tcl_Exit(0);
}
@@ -337,37 +368,34 @@ Tk_MainEx(
/* ARGSUSED */
static void
StdinProc(
- ClientData clientData, /* Not used. */
+ ClientData clientData, /* The state of interactive cmd line */
int mask) /* Not used. */
{
- static int gotPartial = 0;
char *cmd;
int code, count;
- Tcl_Channel chan = (Tcl_Channel) clientData;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- Tcl_Interp *interp = tsdPtr->interp;
+ InteractiveState *isPtr = clientData;
+ Tcl_Channel chan = isPtr->input;
+ Tcl_Interp *interp = isPtr->interp;
- count = Tcl_Gets(chan, &tsdPtr->line);
+ count = Tcl_Gets(chan, &isPtr->line);
- if (count < 0 && !gotPartial) {
- if (tsdPtr->tty) {
+ if (count < 0 && !isPtr->gotPartial) {
+ if (isPtr->tty) {
Tcl_Exit(0);
} else {
- Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
+ Tcl_DeleteChannelHandler(chan, StdinProc, isPtr);
}
return;
}
- (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue(
- &tsdPtr->line), -1);
- cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1);
- Tcl_DStringFree(&tsdPtr->line);
+ Tcl_DStringAppend(&isPtr->command, Tcl_DStringValue(&isPtr->line), -1);
+ cmd = Tcl_DStringAppend(&isPtr->command, "\n", -1);
+ Tcl_DStringFree(&isPtr->line);
if (!Tcl_CommandComplete(cmd)) {
- gotPartial = 1;
+ isPtr->gotPartial = 1;
goto prompt;
}
- gotPartial = 0;
+ isPtr->gotPartial = 0;
/*
* Disable the stdin channel handler while evaluating the command;
@@ -376,18 +404,17 @@ StdinProc(
* things, this will trash the text of the command being evaluated.
*/
- Tcl_CreateChannelHandler(chan, 0, StdinProc, (ClientData) chan);
+ Tcl_CreateChannelHandler(chan, 0, StdinProc, isPtr);
code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL);
- chan = Tcl_GetStdChannel(TCL_STDIN);
- if (chan) {
- Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc,
- (ClientData) chan);
+ isPtr->input = Tcl_GetStdChannel(TCL_STDIN);
+ if (isPtr->input) {
+ Tcl_CreateChannelHandler(isPtr->input, TCL_READABLE, StdinProc, isPtr);
}
- Tcl_DStringFree(&tsdPtr->command);
+ Tcl_DStringFree(&isPtr->command);
if (Tcl_GetStringResult(interp)[0] != '\0') {
- if ((code != TCL_OK) || (tsdPtr->tty)) {
- chan = Tcl_GetStdChannel(TCL_STDOUT);
+ if ((code != TCL_OK) || (isPtr->tty)) {
+ chan = Tcl_GetStdChannel((code != TCL_OK) ? TCL_STDERR : TCL_STDOUT);
if (chan) {
Tcl_WriteObj(chan, Tcl_GetObjResult(interp));
Tcl_WriteChars(chan, "\n", 1);
@@ -396,12 +423,12 @@ StdinProc(
}
/*
- * Output a prompt.
+ * If a tty stdin is still around, output a prompt.
*/
prompt:
- if (tsdPtr->tty) {
- Prompt(interp, gotPartial);
+ if (isPtr->tty && (isPtr->input != NULL)) {
+ Prompt(interp, isPtr);
}
Tcl_ResetResult(interp);
}
@@ -426,53 +453,42 @@ StdinProc(
static void
Prompt(
Tcl_Interp *interp, /* Interpreter to use for prompting. */
- int partial) /* Non-zero means there already exists a
- * partial command, so use the secondary
- * prompt. */
+ InteractiveState *isPtr) /* InteractiveState. */
{
- Tcl_Obj *promptCmd;
+ Tcl_Obj *promptCmdPtr;
int code;
- Tcl_Channel outChannel, errChannel;
+ Tcl_Channel chan;
- promptCmd = Tcl_GetVar2Ex(interp,
- partial ? "tcl_prompt2" : "tcl_prompt1", NULL, TCL_GLOBAL_ONLY);
- if (promptCmd == NULL) {
+ promptCmdPtr = Tcl_GetVar2Ex(interp,
+ isPtr->gotPartial ? "tcl_prompt2" : "tcl_prompt1", NULL, TCL_GLOBAL_ONLY);
+ if (promptCmdPtr == NULL) {
defaultPrompt:
- if (!partial) {
- /*
- * We must check that outChannel is a real channel - it is
- * possible that someone has transferred stdout out of this
- * interpreter with "interp transfer".
- */
-
- outChannel = Tcl_GetChannel(interp, "stdout", NULL);
- if (outChannel != (Tcl_Channel) NULL) {
- Tcl_WriteChars(outChannel, "% ", 2);
+ if (!isPtr->gotPartial) {
+ chan = Tcl_GetStdChannel(TCL_STDOUT);
+ if (chan != NULL) {
+ Tcl_WriteChars(chan, DEFAULT_PRIMARY_PROMPT,
+ strlen(DEFAULT_PRIMARY_PROMPT));
}
}
} else {
- code = Tcl_EvalObjEx(interp, promptCmd, TCL_EVAL_GLOBAL);
+ code = Tcl_EvalObjEx(interp, promptCmdPtr, TCL_EVAL_GLOBAL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (script that generates prompt)");
-
- /*
- * We must check that errChannel is a real channel - it is
- * possible that someone has transferred stderr out of this
- * interpreter with "interp transfer".
- */
-
- errChannel = Tcl_GetChannel(interp, "stderr", NULL);
- if (errChannel != (Tcl_Channel) NULL) {
- Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp));
- Tcl_WriteChars(errChannel, "\n", 1);
+ if (Tcl_GetStringResult(interp)[0] != '\0') {
+ chan = Tcl_GetStdChannel(TCL_STDERR);
+ if (chan != NULL) {
+ Tcl_WriteObj(chan, Tcl_GetObjResult(interp));
+ Tcl_WriteChars(chan, "\n", 1);
+ }
}
goto defaultPrompt;
}
}
- outChannel = Tcl_GetChannel(interp, "stdout", NULL);
- if (outChannel != (Tcl_Channel) NULL) {
- Tcl_Flush(outChannel);
+
+ chan = Tcl_GetStdChannel(TCL_STDOUT);
+ if (chan != NULL) {
+ Tcl_Flush(chan);
}
}
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 15af7a2..18eae0a 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -97,9 +97,9 @@ TCL_DECLARE_MUTEX(menuMutex)
* to update code in TkpMenuInit that changes the font string entry.
*/
-char *tkMenuStateStrings[] = {"active", "normal", "disabled", NULL};
+static const char *const menuStateStrings[] = {"active", "normal", "disabled", NULL};
-static CONST char *menuEntryTypeStrings[] = {
+static const char *const menuEntryTypeStrings[] = {
"cascade", "checkbutton", "command", "radiobutton", "separator", NULL
};
@@ -108,125 +108,125 @@ static CONST char *menuEntryTypeStrings[] = {
* is used with the "enum compound" declaration in tkMenu.h
*/
-static char *compoundStrings[] = {
+static const char *const compoundStrings[] = {
"bottom", "center", "left", "none", "right", "top", NULL
};
static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", NULL, NULL,
DEF_MENU_ENTRY_ACTIVE_BG, Tk_Offset(TkMenuEntry, activeBorderPtr), -1,
- TK_OPTION_NULL_OK},
+ TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-activeforeground", NULL, NULL,
DEF_MENU_ENTRY_ACTIVE_FG,
- Tk_Offset(TkMenuEntry, activeFgPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, activeFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-accelerator", NULL, NULL,
DEF_MENU_ENTRY_ACCELERATOR,
- Tk_Offset(TkMenuEntry, accelPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, accelPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BITMAP, "-bitmap", NULL, NULL,
DEF_MENU_ENTRY_BITMAP,
- Tk_Offset(TkMenuEntry, bitmapPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, bitmapPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL,
DEF_MENU_ENTRY_COLUMN_BREAK,
- -1, Tk_Offset(TkMenuEntry, columnBreak)},
+ -1, Tk_Offset(TkMenuEntry, columnBreak), 0, NULL, 0},
{TK_OPTION_STRING, "-command", NULL, NULL,
DEF_MENU_ENTRY_COMMAND,
- Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0,
(ClientData) compoundStrings, 0},
{TK_OPTION_FONT, "-font", NULL, NULL,
DEF_MENU_ENTRY_FONT,
- Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-foreground", NULL, NULL,
DEF_MENU_ENTRY_FG,
- Tk_Offset(TkMenuEntry, fgPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, fgPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL,
DEF_MENU_ENTRY_HIDE_MARGIN,
- -1, Tk_Offset(TkMenuEntry, hideMargin)},
+ -1, Tk_Offset(TkMenuEntry, hideMargin), 0, NULL, 0},
{TK_OPTION_STRING, "-image", NULL, NULL,
DEF_MENU_ENTRY_IMAGE,
- Tk_Offset(TkMenuEntry, imagePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, imagePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-label", NULL, NULL,
DEF_MENU_ENTRY_LABEL,
- Tk_Offset(TkMenuEntry, labelPtr), -1, 0},
+ Tk_Offset(TkMenuEntry, labelPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
DEF_MENU_ENTRY_STATE,
-1, Tk_Offset(TkMenuEntry, state), 0,
- (ClientData) tkMenuStateStrings},
+ (ClientData) menuStateStrings, 0},
{TK_OPTION_INT, "-underline", NULL, NULL,
- DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline)},
- {TK_OPTION_END}
+ DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline), 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
static const Tk_OptionSpec tkSeparatorEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_END}
+ Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
static const Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = {
{TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
- -1, Tk_Offset(TkMenuEntry, indicatorOn)},
+ -1, Tk_Offset(TkMenuEntry, indicatorOn), 0, NULL, 0},
{TK_OPTION_STRING, "-offvalue", NULL, NULL,
DEF_MENU_ENTRY_OFF_VALUE,
- Tk_Offset(TkMenuEntry, offValuePtr), -1},
+ Tk_Offset(TkMenuEntry, offValuePtr), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-onvalue", NULL, NULL,
DEF_MENU_ENTRY_ON_VALUE,
- Tk_Offset(TkMenuEntry, onValuePtr), -1},
+ Tk_Offset(TkMenuEntry, onValuePtr), -1, 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
- Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-selectimage", NULL, NULL,
DEF_MENU_ENTRY_SELECT_IMAGE,
- Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_CHECK_VARIABLE,
- Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = {
{TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
- -1, Tk_Offset(TkMenuEntry, indicatorOn)},
+ -1, Tk_Offset(TkMenuEntry, indicatorOn), 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
- Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-selectimage", NULL, NULL,
DEF_MENU_ENTRY_SELECT_IMAGE,
- Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-value", NULL, NULL,
DEF_MENU_ENTRY_VALUE,
- Tk_Offset(TkMenuEntry, onValuePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, onValuePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_RADIO_VARIABLE,
- Tk_Offset(TkMenuEntry, namePtr), -1, 0},
+ Tk_Offset(TkMenuEntry, namePtr), -1, 0, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = {
{TK_OPTION_STRING, "-menu", NULL, NULL,
DEF_MENU_ENTRY_MENU,
- Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL,
- NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0}
};
static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
- Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0,
- (ClientData) tkMenuStateStrings},
- {TK_OPTION_END}
+ (ClientData) menuStateStrings, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
static const Tk_OptionSpec *specsArray[] = {
@@ -239,7 +239,7 @@ static const Tk_OptionSpec *specsArray[] = {
* Menu type strings for use with Tcl_GetIndexFromObj.
*/
-static const char *menuTypeStrings[] = {
+static const char *const menuTypeStrings[] = {
"normal", "tearoff", "menubar", NULL
};
@@ -247,60 +247,60 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground",
"Foreground", DEF_MENU_ACTIVE_BG_COLOR,
Tk_Offset(TkMenu, activeBorderPtr), -1, 0,
- (ClientData) DEF_MENU_ACTIVE_BG_MONO},
+ (ClientData) DEF_MENU_ACTIVE_BG_MONO, 0},
{TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth",
"BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
- Tk_Offset(TkMenu, activeBorderWidthPtr), -1},
+ Tk_Offset(TkMenu, activeBorderWidthPtr), -1, 0, NULL, 0},
{TK_OPTION_COLOR, "-activeforeground", "activeForeground",
"Background", DEF_MENU_ACTIVE_FG_COLOR,
Tk_Offset(TkMenu, activeFgPtr), -1, 0,
- (ClientData) DEF_MENU_ACTIVE_FG_MONO},
+ (ClientData) DEF_MENU_ACTIVE_FG_MONO, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_MENU_BG_COLOR, Tk_Offset(TkMenu, borderPtr), -1, 0,
- (ClientData) DEF_MENU_BG_MONO},
+ (ClientData) DEF_MENU_BG_MONO, 0},
{TK_OPTION_SYNONYM, "-bd", NULL, NULL,
- NULL, 0, -1, 0, (ClientData) "-borderwidth"},
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
{TK_OPTION_SYNONYM, "-bg", NULL, NULL,
- NULL, 0, -1, 0, (ClientData) "-background"},
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_MENU_BORDER_WIDTH,
- Tk_Offset(TkMenu, borderWidthPtr), -1, 0},
+ Tk_Offset(TkMenu, borderWidthPtr), -1, 0, NULL, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_MENU_CURSOR,
- Tk_Offset(TkMenu, cursorPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenu, cursorPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
"DisabledForeground", DEF_MENU_DISABLED_FG_COLOR,
Tk_Offset(TkMenu, disabledFgPtr), -1, TK_OPTION_NULL_OK,
- (ClientData) DEF_MENU_DISABLED_FG_MONO},
+ (ClientData) DEF_MENU_DISABLED_FG_MONO, 0},
{TK_OPTION_SYNONYM, "-fg", NULL, NULL,
- NULL, 0, -1, 0, (ClientData) "-foreground"},
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
- DEF_MENU_FONT, Tk_Offset(TkMenu, fontPtr), -1},
+ DEF_MENU_FONT, Tk_Offset(TkMenu, fontPtr), -1, 0, NULL, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MENU_FG, Tk_Offset(TkMenu, fgPtr), -1},
+ DEF_MENU_FG, Tk_Offset(TkMenu, fgPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-postcommand", "postCommand", "Command",
DEF_MENU_POST_COMMAND,
- Tk_Offset(TkMenu, postCommandPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenu, postCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_MENU_RELIEF, Tk_Offset(TkMenu, reliefPtr), -1},
+ DEF_MENU_RELIEF, Tk_Offset(TkMenu, reliefPtr), -1, 0, NULL, 0},
{TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background",
DEF_MENU_SELECT_COLOR, Tk_Offset(TkMenu, indicatorFgPtr), -1, 0,
- (ClientData) DEF_MENU_SELECT_MONO},
+ (ClientData) DEF_MENU_SELECT_MONO, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_MENU_TAKE_FOCUS,
- Tk_Offset(TkMenu, takeFocusPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenu, takeFocusPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff",
- DEF_MENU_TEAROFF, -1, Tk_Offset(TkMenu, tearoff)},
+ DEF_MENU_TEAROFF, -1, Tk_Offset(TkMenu, tearoff), 0, NULL, 0},
{TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand",
"TearOffCommand", DEF_MENU_TEAROFF_CMD,
- Tk_Offset(TkMenu, tearoffCommandPtr), -1, TK_OPTION_NULL_OK},
+ Tk_Offset(TkMenu, tearoffCommandPtr), -1, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-title", "title", "Title",
DEF_MENU_TITLE, Tk_Offset(TkMenu, titlePtr), -1,
- TK_OPTION_NULL_OK},
+ TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_STRING_TABLE, "-type", "type", "Type",
DEF_MENU_TYPE, Tk_Offset(TkMenu, menuTypePtr), -1, TK_OPTION_NULL_OK,
- (ClientData) menuTypeStrings},
- {TK_OPTION_END}
+ (ClientData) menuTypeStrings, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0}
};
/*
@@ -308,7 +308,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = {
* with MenuWidgetObjCmd.
*/
-static CONST char *menuOptions[] = {
+static const char *const menuOptions[] = {
"activate", "add", "cget", "clone", "configure", "delete", "entrycget",
"entryconfigure", "index", "insert", "invoke", "post", "postcascade",
"type", "unpost", "xposition", "yposition", NULL
@@ -327,37 +327,38 @@ enum options {
static int CloneMenu(TkMenu *menuPtr, Tcl_Obj *newMenuName,
Tcl_Obj *newMenuTypeString);
static int ConfigureMenu(Tcl_Interp *interp, TkMenu *menuPtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int ConfigureMenuCloneEntries(Tcl_Interp *interp,
TkMenu *menuPtr, int index,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int ConfigureMenuEntry(TkMenuEntry *mePtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteMenuCloneEntries(TkMenu *menuPtr,
int first, int last);
static void DestroyMenuHashTable(ClientData clientData,
Tcl_Interp *interp);
static void DestroyMenuInstance(TkMenu *menuPtr);
static void DestroyMenuEntry(char *memPtr);
-static int GetIndexFromCoords(Tcl_Interp *interp, TkMenu *menuPtr,
- char *string, int *indexPtr);
+static int GetIndexFromCoords(Tcl_Interp *interp,
+ TkMenu *menuPtr, const char *string,
+ int *indexPtr);
static int MenuDoYPosition(Tcl_Interp *interp,
TkMenu *menuPtr, Tcl_Obj *objPtr);
static int MenuDoXPosition(Tcl_Interp *interp,
TkMenu *menuPtr, Tcl_Obj *objPtr);
static int MenuAddOrInsert(Tcl_Interp *interp,
TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int MenuCmd(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void MenuCmdDeletedProc(ClientData clientData);
static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, int index, int type);
static char * MenuVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static int MenuWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void MenuWorldChanged(ClientData instanceData);
static int PostProcessEntry(TkMenuEntry *mePtr);
static void RecursivelyDeleteMenu(TkMenu *menuPtr);
@@ -370,9 +371,11 @@ static void TkMenuCleanup(ClientData unused);
* geometry proc to be called.
*/
-static Tk_ClassProcs menuClass = {
+static const Tk_ClassProcs menuClass = {
sizeof(Tk_ClassProcs), /* size */
- MenuWorldChanged /* worldChangedProc */
+ MenuWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -404,8 +407,7 @@ TkCreateMenuCmd(
Tcl_Interp *interp) /* Interpreter we are creating the command
* in. */
{
- TkMenuOptionTables *optionTablesPtr =
- (TkMenuOptionTables *) ckalloc(sizeof(TkMenuOptionTables));
+ TkMenuOptionTables *optionTablesPtr = ckalloc(sizeof(TkMenuOptionTables));
optionTablesPtr->menuOptionTable =
Tk_CreateOptionTable(interp, tkMenuConfigSpecs);
@@ -454,19 +456,19 @@ MenuCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
Tk_Window tkwin = Tk_MainWindow(interp);
Tk_Window newWin;
register TkMenu *menuPtr;
TkMenuReferences *menuRefPtr;
int i, index, toplevel;
- char *windowName;
- static CONST char *typeStringList[] = {"-type", NULL};
- TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData;
+ const char *windowName;
+ static const char *const typeStringList[] = {"-type", NULL};
+ TkMenuOptionTables *optionTablesPtr = clientData;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -474,8 +476,8 @@ MenuCmd(
toplevel = 1;
for (i = 2; i < (objc - 1); i++) {
- if (Tcl_GetIndexFromObj(NULL, objv[i], typeStringList, NULL, 0, &index)
- != TCL_ERROR) {
+ if (Tcl_GetIndexFromObj(NULL, objv[i], typeStringList, NULL, 0,
+ &index) != TCL_ERROR) {
if ((Tcl_GetIndexFromObj(NULL, objv[i + 1], menuTypeStrings, NULL,
0, &index) == TCL_OK) && (index == MENUBAR)) {
toplevel = 0;
@@ -497,14 +499,14 @@ MenuCmd(
* Tcl_EventuallyFree is called.
*/
- menuPtr = (TkMenu *) ckalloc(sizeof(TkMenu));
+ menuPtr = ckalloc(sizeof(TkMenu));
memset(menuPtr, 0, sizeof(TkMenu));
menuPtr->tkwin = newWin;
menuPtr->display = Tk_Display(newWin);
menuPtr->interp = interp;
menuPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd,
- (ClientData) menuPtr, MenuCmdDeletedProc);
+ Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, menuPtr,
+ MenuCmdDeletedProc);
menuPtr->active = -1;
menuPtr->cursorPtr = None;
menuPtr->masterMenuPtr = menuPtr;
@@ -513,10 +515,10 @@ MenuCmd(
TkMenuInitializeDrawingFields(menuPtr);
Tk_SetClass(menuPtr->tkwin, "Menu");
- Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
+ Tk_SetClassProcs(menuPtr->tkwin, &menuClass, menuPtr);
Tk_CreateEventHandler(newWin,
ExposureMask|StructureNotifyMask|ActivateMask,
- TkMenuEventProc, (ClientData) menuPtr);
+ TkMenuEventProc, menuPtr);
if (Tk_InitOptions(interp, (char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin)
!= TCL_OK) {
@@ -578,7 +580,7 @@ MenuCmd(
&& ((cascadeListPtr->menuPtr->masterMenuPtr
== cascadeListPtr->menuPtr)))) {
newObjv[0] = Tcl_NewStringObj("-menu", -1);
- newObjv[1] = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin), -1);
+ newObjv[1] = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin),-1);
Tcl_IncrRefCount(newObjv[0]);
Tcl_IncrRefCount(newObjv[1]);
ConfigureMenuEntry(cascadeListPtr, 2, newObjv);
@@ -640,7 +642,7 @@ MenuCmd(
}
}
- Tcl_SetResult(interp, Tk_PathName(menuPtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(menuPtr->tkwin));
return TCL_OK;
}
@@ -667,22 +669,22 @@ MenuWidgetObjCmd(
ClientData clientData, /* Information about menu widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
- register TkMenu *menuPtr = (TkMenu *) clientData;
+ register TkMenu *menuPtr = clientData;
register TkMenuEntry *mePtr;
int result = TCL_OK;
int option;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], menuOptions, "option", 0,
&option) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) menuPtr);
+ Tcl_Preserve(menuPtr);
switch ((enum options) option) {
case MENU_ACTIVATE: {
@@ -707,11 +709,11 @@ MenuWidgetObjCmd(
}
case MENU_ADD:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "type ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "type ?-option value ...?");
goto error;
}
- if (MenuAddOrInsert(interp, menuPtr, NULL, objc-2, objv+2) != TCL_OK) {
+ if (MenuAddOrInsert(interp, menuPtr, NULL, objc-2, objv+2) != TCL_OK){
goto error;
}
break;
@@ -825,10 +827,10 @@ MenuWidgetObjCmd(
goto done;
}
mePtr = menuPtr->entries[index];
- Tcl_Preserve((ClientData) mePtr);
+ Tcl_Preserve(mePtr);
resultPtr = Tk_GetOptionValue(interp, (char *) mePtr,
mePtr->optionTable, objv[3], menuPtr->tkwin);
- Tcl_Release((ClientData) mePtr);
+ Tcl_Release(mePtr);
if (resultPtr == NULL) {
goto error;
}
@@ -840,7 +842,7 @@ MenuWidgetObjCmd(
Tcl_Obj *resultPtr;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index ?option value ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "index ?-option value ...?");
goto error;
}
if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
@@ -850,7 +852,7 @@ MenuWidgetObjCmd(
goto done;
}
mePtr = menuPtr->entries[index];
- Tcl_Preserve((ClientData) mePtr);
+ Tcl_Preserve(mePtr);
if (objc == 3) {
resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr,
mePtr->optionTable, NULL, menuPtr->tkwin);
@@ -873,7 +875,7 @@ MenuWidgetObjCmd(
result = ConfigureMenuCloneEntries(interp, menuPtr, index,
objc-3, objv+3);
}
- Tcl_Release((ClientData) mePtr);
+ Tcl_Release(mePtr);
break;
}
case MENU_INDEX: {
@@ -889,13 +891,14 @@ MenuWidgetObjCmd(
if (index < 0) {
Tcl_SetResult(interp, "none", TCL_STATIC);
} else {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
}
break;
}
case MENU_INSERT:
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "index type ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "index type ?-option value ...?");
goto error;
}
if (MenuAddOrInsert(interp,menuPtr,objv[2],objc-3,objv+3) != TCL_OK) {
@@ -977,8 +980,8 @@ MenuWidgetObjCmd(
if (menuPtr->entries[index]->type == TEAROFF_ENTRY) {
Tcl_SetResult(interp, "tearoff", TCL_STATIC);
} else {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- menuEntryTypeStrings[menuPtr->entries[index]->type], -1);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ menuEntryTypeStrings[menuPtr->entries[index]->type], -1));
}
break;
}
@@ -1006,11 +1009,11 @@ MenuWidgetObjCmd(
break;
}
done:
- Tcl_Release((ClientData) menuPtr);
+ Tcl_Release(menuPtr);
return result;
error:
- Tcl_Release((ClientData) menuPtr);
+ Tcl_Release(menuPtr);
return TCL_ERROR;
}
@@ -1049,9 +1052,11 @@ TkInvokeMenu(
if (mePtr->state == ENTRY_DISABLED) {
goto done;
}
- Tcl_Preserve((ClientData) mePtr);
+
+ Tcl_Preserve(mePtr);
if (mePtr->type == TEAROFF_ENTRY) {
Tcl_DString ds;
+
Tcl_DStringInit(&ds);
Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1);
Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1);
@@ -1104,7 +1109,8 @@ TkInvokeMenu(
result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL);
Tcl_DecrRefCount(commandPtr);
}
- Tcl_Release((ClientData) mePtr);
+ Tcl_Release(mePtr);
+
done:
return result;
}
@@ -1202,7 +1208,7 @@ DestroyMenuInstance(
}
}
} else if (menuPtr->nextInstancePtr != NULL) {
- Tcl_Panic("Attempting to delete master menu when there are still clones.");
+ Tcl_Panic("Attempting to delete master menu when there are still clones");
}
/*
@@ -1222,13 +1228,14 @@ DestroyMenuInstance(
menuPtr->numEntries = i;
}
if (menuPtr->entries != NULL) {
- ckfree((char *) menuPtr->entries);
+ ckfree(menuPtr->entries);
}
TkMenuFreeDrawOptions(menuPtr);
Tk_FreeConfigOptions((char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin);
if (menuPtr->tkwin != NULL) {
Tk_Window tkwin = menuPtr->tkwin;
+
menuPtr->tkwin = NULL;
Tk_DestroyWindow(tkwin);
}
@@ -1438,13 +1445,13 @@ DestroyMenuEntry(
if (mePtr->type == CASCADE_ENTRY) {
if (menuPtr->masterMenuPtr != menuPtr) {
TkMenu *destroyThis = NULL;
+ TkMenuReferences *menuRefPtr = mePtr->childMenuRefPtr;
+
/*
* The menu as a whole is a clone. We must delete the clone of the
* cascaded menu for the particular entry we are destroying.
*/
- TkMenuReferences *menuRefPtr = mePtr->childMenuRefPtr;
-
if (menuRefPtr != NULL) {
destroyThis = menuRefPtr->menuPtr;
@@ -1482,16 +1489,16 @@ DestroyMenuEntry(
if (((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY))
&& (mePtr->namePtr != NULL)) {
- char *varName = Tcl_GetString(mePtr->namePtr);
+ const char *varName = Tcl_GetString(mePtr->namePtr);
Tcl_UntraceVar(menuPtr->interp, varName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuVarProc, (ClientData) mePtr);
+ MenuVarProc, mePtr);
}
TkpDestroyMenuEntry(mePtr);
TkMenuEntryFreeDrawOptions(mePtr);
Tk_FreeConfigOptions((char *) mePtr, mePtr->optionTable, menuPtr->tkwin);
- ckfree((char *) mePtr);
+ ckfree(mePtr);
}
/*
@@ -1516,7 +1523,7 @@ static void
MenuWorldChanged(
ClientData instanceData) /* Information about widget. */
{
- TkMenu *menuPtr = (TkMenu *) instanceData;
+ TkMenu *menuPtr = instanceData;
int i;
TkMenuConfigureDrawOptions(menuPtr);
@@ -1553,7 +1560,7 @@ ConfigureMenu(
register TkMenu *menuPtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[]) /* Arguments. */
+ Tcl_Obj *const objv[]) /* Arguments. */
{
int i;
TkMenu *menuListPtr, *cleanupPtr;
@@ -1561,8 +1568,7 @@ ConfigureMenu(
for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL;
menuListPtr = menuListPtr->nextInstancePtr) {
- menuListPtr->errorStructPtr = (Tk_SavedOptions *)
- ckalloc(sizeof(Tk_SavedOptions));
+ menuListPtr->errorStructPtr = ckalloc(sizeof(Tk_SavedOptions));
result = Tk_SetOptions(interp, (char *) menuListPtr,
menuListPtr->optionTablesPtr->menuOptionTable, objc, objv,
menuListPtr->tkwin, menuListPtr->errorStructPtr, NULL);
@@ -1571,12 +1577,12 @@ ConfigureMenu(
cleanupPtr != menuListPtr;
cleanupPtr = cleanupPtr->nextInstancePtr) {
Tk_RestoreSavedOptions(cleanupPtr->errorStructPtr);
- ckfree((char *) cleanupPtr->errorStructPtr);
+ ckfree(cleanupPtr->errorStructPtr);
cleanupPtr->errorStructPtr = NULL;
}
if (menuListPtr->errorStructPtr != NULL) {
Tk_RestoreSavedOptions(menuListPtr->errorStructPtr);
- ckfree((char *) menuListPtr->errorStructPtr);
+ ckfree(menuListPtr->errorStructPtr);
menuListPtr->errorStructPtr = NULL;
}
return TCL_ERROR;
@@ -1602,13 +1608,31 @@ ConfigureMenu(
*/
if (menuListPtr->menuType == MASTER_MENU) {
- TkpMakeMenuWindow(menuListPtr->tkwin, 1);
+ int typeFlag = TK_MAKE_MENU_POPUP;
+ Tk_Window tkwin = menuPtr->tkwin;
+
+ /*
+ * Work out if we are the child of a menubar or a popup.
+ */
+
+ while (1) {
+ Tk_Window parent = Tk_Parent(tkwin);
+
+ if (Tk_Class(parent) != Tk_Class(menuPtr->tkwin)) {
+ break;
+ }
+ tkwin = parent;
+ }
+ if (((TkMenu *) tkwin)->menuType == MENUBAR) {
+ typeFlag = TK_MAKE_MENU_DROPDOWN;
+ }
+
+ TkpMakeMenuWindow(menuListPtr->tkwin, typeFlag);
} else if (menuListPtr->menuType == TEAROFF_MENU) {
- TkpMakeMenuWindow(menuListPtr->tkwin, 0);
+ TkpMakeMenuWindow(menuListPtr->tkwin, TK_MAKE_MENU_TEAROFF);
}
}
-
/*
* Depending on the -tearOff option, make sure that there is or isn't
* an initial tear-off entry at the beginning of the menu.
@@ -1619,15 +1643,15 @@ ConfigureMenu(
|| (menuListPtr->entries[0]->type != TEAROFF_ENTRY)) {
if (MenuNewEntry(menuListPtr, 0, TEAROFF_ENTRY) == NULL) {
for (cleanupPtr = menuPtr->masterMenuPtr;
- cleanupPtr != menuListPtr;
- cleanupPtr = cleanupPtr->nextInstancePtr) {
+ cleanupPtr != menuListPtr;
+ cleanupPtr = cleanupPtr->nextInstancePtr) {
Tk_RestoreSavedOptions(cleanupPtr->errorStructPtr);
- ckfree((char *) cleanupPtr->errorStructPtr);
+ ckfree(cleanupPtr->errorStructPtr);
cleanupPtr->errorStructPtr = NULL;
}
if (menuListPtr->errorStructPtr != NULL) {
Tk_RestoreSavedOptions(menuListPtr->errorStructPtr);
- ckfree((char *) menuListPtr->errorStructPtr);
+ ckfree(menuListPtr->errorStructPtr);
menuListPtr->errorStructPtr = NULL;
}
return TCL_ERROR;
@@ -1637,8 +1661,7 @@ ConfigureMenu(
&& (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) {
int i;
- Tcl_EventuallyFree((ClientData) menuListPtr->entries[0],
- DestroyMenuEntry);
+ Tcl_EventuallyFree(menuListPtr->entries[0], DestroyMenuEntry);
for (i = 0; i < menuListPtr->numEntries - 1; i++) {
menuListPtr->entries[i] = menuListPtr->entries[i + 1];
@@ -1646,7 +1669,7 @@ ConfigureMenu(
}
menuListPtr->numEntries--;
if (menuListPtr->numEntries == 0) {
- ckfree((char *) menuListPtr->entries);
+ ckfree(menuListPtr->entries);
menuListPtr->entries = NULL;
}
}
@@ -1673,7 +1696,7 @@ ConfigureMenu(
for (cleanupPtr = menuPtr->masterMenuPtr; cleanupPtr != NULL;
cleanupPtr = cleanupPtr->nextInstancePtr) {
Tk_FreeSavedOptions(cleanupPtr->errorStructPtr);
- ckfree((char *) cleanupPtr->errorStructPtr);
+ ckfree(cleanupPtr->errorStructPtr);
cleanupPtr->errorStructPtr = NULL;
}
@@ -1706,7 +1729,7 @@ PostProcessEntry(
{
TkMenu *menuPtr = mePtr->menuPtr;
int index = mePtr->index;
- char *name;
+ const char *name;
Tk_Image image;
/*
@@ -1799,10 +1822,10 @@ PostProcessEntry(
*/
if (mePtr->imagePtr != NULL) {
- char *imageString = Tcl_GetString(mePtr->imagePtr);
+ const char *imageString = Tcl_GetString(mePtr->imagePtr);
image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, imageString,
- TkMenuImageProc, (ClientData) mePtr);
+ TkMenuImageProc, mePtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -1814,10 +1837,10 @@ PostProcessEntry(
}
mePtr->image = image;
if (mePtr->selectImagePtr != NULL) {
- char *selectImageString = Tcl_GetString(mePtr->selectImagePtr);
+ const char *selectImageString = Tcl_GetString(mePtr->selectImagePtr);
image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, selectImageString,
- TkMenuSelectImageProc, (ClientData) mePtr);
+ TkMenuSelectImageProc, mePtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -1832,7 +1855,7 @@ PostProcessEntry(
if ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY)) {
Tcl_Obj *valuePtr;
- char *name;
+ const char *name;
if (mePtr->namePtr == NULL) {
if (mePtr->labelPtr == NULL) {
@@ -1866,8 +1889,8 @@ PostProcessEntry(
mePtr->entryFlags &= ~ENTRY_SELECTED;
if (valuePtr != NULL) {
if (mePtr->onValuePtr != NULL) {
- char *value = Tcl_GetString(valuePtr);
- char *onValue = Tcl_GetString(mePtr->onValuePtr);
+ const char *value = Tcl_GetString(valuePtr);
+ const char *onValue = Tcl_GetString(mePtr->onValuePtr);
if (strcmp(value, onValue) == 0) {
mePtr->entryFlags |= ENTRY_SELECTED;
@@ -1884,7 +1907,7 @@ PostProcessEntry(
name = Tcl_GetString(mePtr->namePtr);
Tcl_TraceVar(menuPtr->interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuVarProc, (ClientData) mePtr);
+ MenuVarProc, mePtr);
}
}
@@ -1919,7 +1942,7 @@ ConfigureMenuEntry(
register TkMenuEntry *mePtr,/* Information about menu entry; may or may
* not already have values for some fields. */
int objc, /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[]) /* Arguments. */
+ Tcl_Obj *const objv[]) /* Arguments. */
{
TkMenu *menuPtr = mePtr->menuPtr;
Tk_SavedOptions errorStruct;
@@ -1933,11 +1956,11 @@ ConfigureMenuEntry(
if ((mePtr->namePtr != NULL)
&& ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY))) {
- char *name = Tcl_GetString(mePtr->namePtr);
+ const char *name = Tcl_GetString(mePtr->namePtr);
Tcl_UntraceVar(menuPtr->interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuVarProc, (ClientData) mePtr);
+ MenuVarProc, mePtr);
}
result = TCL_OK;
@@ -1984,14 +2007,14 @@ ConfigureMenuCloneEntries(
TkMenu *menuPtr, /* Information about whole menu. */
int index, /* Index of mePtr within menuPtr's entries. */
int objc, /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[]) /* Arguments. */
+ Tcl_Obj *const objv[]) /* Arguments. */
{
TkMenuEntry *mePtr;
TkMenu *menuListPtr;
int cascadeEntryChanged = 0;
TkMenuReferences *oldCascadeMenuRefPtr, *cascadeMenuRefPtr = NULL;
Tcl_Obj *oldCascadePtr = NULL;
- char *newCascadeName;
+ const char *newCascadeName;
/*
* Cascades are kind of tricky here. This is special case #3 in the
@@ -2015,7 +2038,7 @@ ConfigureMenuCloneEntries(
}
if (mePtr->type == CASCADE_ENTRY) {
- char *oldCascadeName;
+ const char *oldCascadeName;
if (mePtr->namePtr != NULL) {
newCascadeName = Tcl_GetString(mePtr->namePtr);
@@ -2068,7 +2091,7 @@ ConfigureMenuCloneEntries(
}
if (cascadeEntryChanged && (mePtr->namePtr != NULL)) {
- if (cascadeMenuRefPtr->menuPtr != NULL) {
+ if (cascadeMenuRefPtr && cascadeMenuRefPtr->menuPtr != NULL) {
Tcl_Obj *newObjv[2];
Tcl_Obj *newCloneNamePtr;
Tcl_Obj *pathNamePtr = Tcl_NewStringObj(
@@ -2131,7 +2154,7 @@ TkGetMenuIndex(
int *indexPtr) /* Where to store converted index. */
{
int i;
- char *string = Tcl_GetString(objPtr);
+ const char *string = Tcl_GetString(objPtr);
if ((string[0] == 'a') && (strcmp(string, "active") == 0)) {
*indexPtr = menuPtr->active;
@@ -2170,12 +2193,12 @@ TkGetMenuIndex(
*indexPtr = i;
goto success;
}
- Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_ResetResult(interp);
}
for (i = 0; i < menuPtr->numEntries; i++) {
Tcl_Obj *labelPtr = menuPtr->entries[i]->labelPtr;
- char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr);
+ const char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr);
if ((label != NULL) && (Tcl_StringMatch(label, string))) {
*indexPtr = i;
@@ -2212,7 +2235,7 @@ static void
MenuCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkMenu *menuPtr = (TkMenu *) clientData;
+ TkMenu *menuPtr = clientData;
Tk_Window tkwin = menuPtr->tkwin;
/*
@@ -2266,8 +2289,7 @@ MenuNewEntry(
* Create a new array of entries with an empty slot for the new entry.
*/
- newEntries = (TkMenuEntry **) ckalloc((unsigned)
- ((menuPtr->numEntries+1)*sizeof(TkMenuEntry *)));
+ newEntries = ckalloc((menuPtr->numEntries+1) * sizeof(TkMenuEntry *));
for (i = 0; i < index; i++) {
newEntries[i] = menuPtr->entries[i];
}
@@ -2276,11 +2298,11 @@ MenuNewEntry(
newEntries[i+1]->index = i + 1;
}
if (menuPtr->numEntries != 0) {
- ckfree((char *) menuPtr->entries);
+ ckfree(menuPtr->entries);
}
menuPtr->entries = newEntries;
menuPtr->numEntries++;
- mePtr = (TkMenuEntry *) ckalloc(sizeof(TkMenuEntry));
+ mePtr = ckalloc(sizeof(TkMenuEntry));
menuPtr->entries[index] = mePtr;
mePtr->type = type;
mePtr->optionTable = menuPtr->optionTablesPtr->entryOptionTables[type];
@@ -2315,14 +2337,14 @@ MenuNewEntry(
mePtr->nextCascadePtr = NULL;
if (Tk_InitOptions(menuPtr->interp, (char *) mePtr,
mePtr->optionTable, menuPtr->tkwin) != TCL_OK) {
- ckfree((char *) mePtr);
+ ckfree(mePtr);
return NULL;
}
TkMenuInitializeEntryDrawingFields(mePtr);
if (TkpMenuNewEntry(mePtr) != TCL_OK) {
Tk_FreeConfigOptions((char *) mePtr, mePtr->optionTable,
menuPtr->tkwin);
- ckfree((char *) mePtr);
+ ckfree(mePtr);
return NULL;
}
@@ -2353,7 +2375,7 @@ MenuAddOrInsert(
Tcl_Obj *indexPtr, /* Object describing index at which to insert.
* NULL means insert at end. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments to command: first arg is type of
+ Tcl_Obj *const objv[]) /* Arguments to command: first arg is type of
* entry, others are config options. */
{
int type, index;
@@ -2368,7 +2390,8 @@ MenuAddOrInsert(
index = menuPtr->numEntries;
}
if (index < 0) {
- char *indexString = Tcl_GetString(indexPtr);
+ const char *indexString = Tcl_GetString(indexPtr);
+
Tcl_AppendResult(interp, "bad index \"", indexString, "\"", NULL);
return TCL_ERROR;
}
@@ -2403,7 +2426,7 @@ MenuAddOrInsert(
for (errorMenuPtr = menuPtr->masterMenuPtr;
errorMenuPtr != NULL;
errorMenuPtr = errorMenuPtr->nextInstancePtr) {
- Tcl_EventuallyFree((ClientData) errorMenuPtr->entries[index],
+ Tcl_EventuallyFree(errorMenuPtr->entries[index],
DestroyMenuEntry);
for (i = index; i < errorMenuPtr->numEntries - 1; i++) {
errorMenuPtr->entries[i] = errorMenuPtr->entries[i + 1];
@@ -2411,7 +2434,7 @@ MenuAddOrInsert(
}
errorMenuPtr->numEntries--;
if (errorMenuPtr->numEntries == 0) {
- ckfree((char *) errorMenuPtr->entries);
+ ckfree(errorMenuPtr->entries);
errorMenuPtr->entries = NULL;
}
if (errorMenuPtr == menuListPtr) {
@@ -2452,7 +2475,7 @@ MenuAddOrInsert(
menuRefPtr = TkFindMenuReferencesObj(menuListPtr->interp,
newCascadePtr);
if (menuRefPtr == NULL) {
- Tcl_Panic("CloneMenu failed inside of MenuAddOrInsert.");
+ Tcl_Panic("CloneMenu failed inside of MenuAddOrInsert");
}
newObjv[0] = menuNamePtr;
newObjv[1] = newCascadePtr;
@@ -2491,15 +2514,14 @@ static char *
MenuVarProc(
ClientData clientData, /* Information about menu entry. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* First part of variable's name. */
- CONST 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;
+ TkMenuEntry *mePtr = clientData;
TkMenu *menuPtr;
- CONST char *value;
- char *name;
- char *onValue;
+ const char *value;
+ const char *name, *onValue;
if (flags & TCL_INTERP_DESTROYED) {
/*
@@ -2703,7 +2725,7 @@ CloneMenu(
for (i = 0; i < 4; i++) {
Tcl_IncrRefCount(menuDupCommandArray[i]);
}
- Tcl_Preserve((ClientData) menuPtr);
+ Tcl_Preserve(menuPtr);
returnResult = Tcl_EvalObjv(menuPtr->interp, 4, menuDupCommandArray, 0);
for (i = 0; i < 4; i++) {
Tcl_DecrRefCount(menuDupCommandArray[i]);
@@ -2749,9 +2771,9 @@ CloneMenu(
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;
+ if (Tk_BindtagsObjCmd(newMenuPtr->tkwin, newMenuPtr->interp, 2,
+ newObjv) == TCL_OK) {
+ const char *windowName;
Tcl_Obj *bindingsPtr =
Tcl_DuplicateObj(Tcl_GetObjResult(newMenuPtr->interp));
Tcl_Obj *elementPtr;
@@ -2775,8 +2797,8 @@ CloneMenu(
Tcl_ListObjReplace(menuPtr->interp, bindingsPtr,
i + 1, 0, 1, &newElementPtr);
newObjv[2] = bindingsPtr;
- Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
- menuPtr->interp, 3, newObjv);
+ Tk_BindtagsObjCmd(newMenuPtr->tkwin, menuPtr->interp, 3,
+ newObjv);
break;
}
}
@@ -2828,7 +2850,7 @@ CloneMenu(
} else {
returnResult = TCL_ERROR;
}
- Tcl_Release((ClientData) menuPtr);
+ Tcl_Release(menuPtr);
return returnResult;
}
@@ -2933,11 +2955,12 @@ static int
GetIndexFromCoords(
Tcl_Interp *interp, /* Interpreter of menu. */
TkMenu *menuPtr, /* The menu we are searching. */
- char *string, /* The @string we are parsing. */
+ const char *string, /* The @string we are parsing. */
int *indexPtr) /* The index of the item that matches. */
{
int x, y, i;
- char *p, *end;
+ const char *p;
+ char *end;
int x2, borderwidth, max;
TkRecomputeMenu(menuPtr);
@@ -2985,7 +3008,7 @@ GetIndexFromCoords(
return TCL_OK;
error:
- Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_ResetResult(interp);
return TCL_ERROR;
}
@@ -3067,7 +3090,7 @@ TkNewMenuName(
Tcl_CmdInfo cmdInfo;
Tcl_HashTable *nameTablePtr = NULL;
TkWindow *winPtr = (TkWindow *) menuPtr->tkwin;
- char *parentName = Tcl_GetString(parentPtr);
+ const char *parentName = Tcl_GetString(parentPtr);
if (winPtr->mainPtr != NULL) {
nameTablePtr = &(winPtr->mainPtr->nameTable);
@@ -3136,10 +3159,10 @@ void
TkSetWindowMenuBar(
Tcl_Interp *interp, /* The interpreter the toplevel lives in. */
Tk_Window tkwin, /* The toplevel window. */
- char *oldMenuName, /* The name of the menubar previously set in
+ const char *oldMenuName, /* The name of the menubar previously set in
* this toplevel. NULL means no menu was set
* previously. */
- char *menuName) /* The name of the new menubar that the
+ const char *menuName) /* The name of the new menubar that the
* toplevel needs to be set to. NULL means
* that their is no menu now. */
{
@@ -3202,7 +3225,7 @@ TkSetWindowMenuBar(
} else {
prevTopLevelPtr->nextPtr = topLevelListPtr->nextPtr;
}
- ckfree((char *) topLevelListPtr);
+ ckfree(topLevelListPtr);
TkFreeMenuReferences(menuRefPtr);
}
}
@@ -3267,8 +3290,7 @@ TkSetWindowMenuBar(
* menu.
*/
- topLevelListPtr = (TkMenuTopLevelList *)
- ckalloc(sizeof(TkMenuTopLevelList));
+ topLevelListPtr = ckalloc(sizeof(TkMenuTopLevelList));
topLevelListPtr->tkwin = tkwin;
topLevelListPtr->nextPtr = menuRefPtr->topLevelListPtr;
menuRefPtr->topLevelListPtr = topLevelListPtr;
@@ -3300,8 +3322,8 @@ DestroyMenuHashTable(
ClientData clientData, /* The menu hash table we are destroying. */
Tcl_Interp *interp) /* The interpreter we are destroying. */
{
- Tcl_DeleteHashTable((Tcl_HashTable *) clientData);
- ckfree((char *) clientData);
+ Tcl_DeleteHashTable(clientData);
+ ckfree(clientData);
}
/*
@@ -3326,15 +3348,14 @@ Tcl_HashTable *
TkGetMenuHashTable(
Tcl_Interp *interp) /* The interp we need the hash table in.*/
{
- Tcl_HashTable *menuTablePtr;
-
- menuTablePtr = (Tcl_HashTable *)
+ Tcl_HashTable *menuTablePtr =
Tcl_GetAssocData(interp, MENU_HASH_KEY, NULL);
+
if (menuTablePtr == NULL) {
- menuTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
+ menuTablePtr = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(menuTablePtr, TCL_STRING_KEYS);
Tcl_SetAssocData(interp, MENU_HASH_KEY, DestroyMenuHashTable,
- (ClientData) menuTablePtr);
+ menuTablePtr);
}
return menuTablePtr;
}
@@ -3363,7 +3384,7 @@ TkGetMenuHashTable(
TkMenuReferences *
TkCreateMenuReferences(
Tcl_Interp *interp,
- char *pathName) /* The path of the menu widget. */
+ const char *pathName) /* The path of the menu widget. */
{
Tcl_HashEntry *hashEntryPtr;
TkMenuReferences *menuRefPtr;
@@ -3372,14 +3393,14 @@ TkCreateMenuReferences(
hashEntryPtr = Tcl_CreateHashEntry(menuTablePtr, pathName, &newEntry);
if (newEntry) {
- menuRefPtr = (TkMenuReferences *) ckalloc(sizeof(TkMenuReferences));
+ menuRefPtr = ckalloc(sizeof(TkMenuReferences));
menuRefPtr->menuPtr = NULL;
menuRefPtr->topLevelListPtr = NULL;
menuRefPtr->parentEntryPtr = NULL;
menuRefPtr->hashEntryPtr = hashEntryPtr;
- Tcl_SetHashValue(hashEntryPtr, (char *) menuRefPtr);
+ Tcl_SetHashValue(hashEntryPtr, menuRefPtr);
} else {
- menuRefPtr = (TkMenuReferences *) Tcl_GetHashValue(hashEntryPtr);
+ menuRefPtr = Tcl_GetHashValue(hashEntryPtr);
}
return menuRefPtr;
}
@@ -3407,7 +3428,7 @@ TkCreateMenuReferences(
TkMenuReferences *
TkFindMenuReferences(
Tcl_Interp *interp, /* The interp the menu is living in. */
- char *pathName) /* The path of the menu widget. */
+ const char *pathName) /* The path of the menu widget. */
{
Tcl_HashEntry *hashEntryPtr;
TkMenuReferences *menuRefPtr = NULL;
@@ -3416,7 +3437,7 @@ TkFindMenuReferences(
menuTablePtr = TkGetMenuHashTable(interp);
hashEntryPtr = Tcl_FindHashEntry(menuTablePtr, pathName);
if (hashEntryPtr != NULL) {
- menuRefPtr = (TkMenuReferences *) Tcl_GetHashValue(hashEntryPtr);
+ menuRefPtr = Tcl_GetHashValue(hashEntryPtr);
}
return menuRefPtr;
}
@@ -3446,7 +3467,7 @@ TkFindMenuReferencesObj(
Tcl_Interp *interp, /* The interp the menu is living in. */
Tcl_Obj *objPtr) /* The path of the menu widget. */
{
- char *pathName = Tcl_GetString(objPtr);
+ const char *pathName = Tcl_GetString(objPtr);
return TkFindMenuReferences(interp, pathName);
}
@@ -3477,7 +3498,7 @@ TkFreeMenuReferences(
&& (menuRefPtr->parentEntryPtr == NULL)
&& (menuRefPtr->topLevelListPtr == NULL)) {
Tcl_DeleteHashEntry(menuRefPtr->hashEntryPtr);
- ckfree((char *) menuRefPtr);
+ ckfree(menuRefPtr);
return 1;
}
return 0;
@@ -3514,8 +3535,7 @@ DeleteMenuCloneEntries(
for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL;
menuListPtr = menuListPtr->nextInstancePtr) {
for (i = last; i >= first; i--) {
- Tcl_EventuallyFree((ClientData) menuListPtr->entries[i],
- DestroyMenuEntry);
+ Tcl_EventuallyFree(menuListPtr->entries[i], DestroyMenuEntry);
}
for (i = last + 1; i < menuListPtr->numEntries; i++) {
j = i - numDeleted;
@@ -3524,7 +3544,7 @@ DeleteMenuCloneEntries(
}
menuListPtr->numEntries -= numDeleted;
if (menuListPtr->numEntries == 0) {
- ckfree((char *) menuListPtr->entries);
+ ckfree(menuListPtr->entries);
menuListPtr->entries = NULL;
}
if ((menuListPtr->active >= first)
@@ -3581,7 +3601,7 @@ TkMenuCleanup(
void
TkMenuInit(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!menusInitialized) {
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 24f32e7..def7d19 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -25,11 +25,6 @@
#include "default.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Dummy types used by the platform menu code.
*/
@@ -252,8 +247,6 @@ typedef struct TkMenuEntry {
* Menu states
*/
-MODULE_SCOPE char *tkMenuStateStrings[];
-
#define ENTRY_ACTIVE 0
#define ENTRY_NORMAL 1
#define ENTRY_DISABLED 2
@@ -505,12 +498,12 @@ typedef struct TkMenuOptionTables {
MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, int index);
MODULE_SCOPE void TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr);
MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp,
- char *name);
+ const char *name);
MODULE_SCOPE void TkDestroyMenu(TkMenu *menuPtr);
MODULE_SCOPE void TkEventuallyRecomputeMenu(TkMenu *menuPtr);
MODULE_SCOPE void TkEventuallyRedrawMenu(TkMenu *menuPtr,
TkMenuEntry *mePtr);
-MODULE_SCOPE TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, char *name);
+MODULE_SCOPE TkMenuReferences*TkFindMenuReferences(Tcl_Interp *interp, const char *name);
MODULE_SCOPE TkMenuReferences*TkFindMenuReferencesObj(Tcl_Interp *interp,
Tcl_Obj *namePtr);
MODULE_SCOPE int TkFreeMenuReferences(TkMenuReferences *menuRefPtr);
@@ -567,7 +560,4 @@ MODULE_SCOPE int TkpPostMenu(Tcl_Interp *interp, TkMenu *menuPtr,
int x, int y);
MODULE_SCOPE void TkpSetWindowMenuBar(Tk_Window tkwin, TkMenu *menuPtr);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKMENU */
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index d2a66d3..119b4bf 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -432,7 +432,7 @@ TkEventuallyRecomputeMenu(
{
if (!(menuPtr->menuFlags & RESIZE_PENDING)) {
menuPtr->menuFlags |= RESIZE_PENDING;
- Tcl_DoWhenIdle(ComputeMenuGeometry, (ClientData) menuPtr);
+ Tcl_DoWhenIdle(ComputeMenuGeometry, menuPtr);
}
}
@@ -458,8 +458,8 @@ TkRecomputeMenu(
TkMenu *menuPtr)
{
if (menuPtr->menuFlags & RESIZE_PENDING) {
- Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr);
- ComputeMenuGeometry((ClientData) menuPtr);
+ Tcl_CancelIdleCall(ComputeMenuGeometry, menuPtr);
+ ComputeMenuGeometry(menuPtr);
}
}
@@ -503,7 +503,7 @@ TkEventuallyRedrawMenu(
|| (menuPtr->menuFlags & REDRAW_PENDING)) {
return;
}
- Tcl_DoWhenIdle(DisplayMenu, (ClientData) menuPtr);
+ Tcl_DoWhenIdle(DisplayMenu, menuPtr);
menuPtr->menuFlags |= REDRAW_PENDING;
}
@@ -530,7 +530,7 @@ static void
ComputeMenuGeometry(
ClientData clientData) /* Structure describing menu. */
{
- TkMenu *menuPtr = (TkMenu *) clientData;
+ TkMenu *menuPtr = clientData;
if (menuPtr->tkwin == NULL) {
return;
@@ -586,12 +586,12 @@ TkMenuSelectImageProc(
* <=0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkMenuEntry *mePtr = (TkMenuEntry *) clientData;
+ register TkMenuEntry *mePtr = clientData;
if ((mePtr->entryFlags & ENTRY_SELECTED)
&& !(mePtr->menuPtr->menuFlags & REDRAW_PENDING)) {
mePtr->menuPtr->menuFlags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayMenu, (ClientData) mePtr->menuPtr);
+ Tcl_DoWhenIdle(DisplayMenu, mePtr->menuPtr);
}
}
@@ -615,7 +615,7 @@ static void
DisplayMenu(
ClientData clientData) /* Information about widget. */
{
- register TkMenu *menuPtr = (TkMenu *) clientData;
+ register TkMenu *menuPtr = clientData;
register TkMenuEntry *mePtr;
register Tk_Window tkwin = menuPtr->tkwin;
int index, strictMotif;
@@ -745,7 +745,7 @@ TkMenuEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkMenu *menuPtr = (TkMenu *) clientData;
+ TkMenu *menuPtr = clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
TkEventuallyRedrawMenu(menuPtr, NULL);
@@ -772,14 +772,14 @@ TkMenuEventProc(
menuPtr->widgetCmd = NULL;
}
if (menuPtr->menuFlags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMenu, (ClientData) menuPtr);
+ Tcl_CancelIdleCall(DisplayMenu, menuPtr);
menuPtr->menuFlags &= ~REDRAW_PENDING;
}
if (menuPtr->menuFlags & RESIZE_PENDING) {
- Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr);
+ Tcl_CancelIdleCall(ComputeMenuGeometry, menuPtr);
menuPtr->menuFlags &= ~RESIZE_PENDING;
}
- Tcl_EventuallyFree((ClientData) menuPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(menuPtr, TCL_DYNAMIC);
}
}
@@ -810,11 +810,11 @@ TkMenuImageProc(
* <=0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkMenu *menuPtr = ((TkMenuEntry *)clientData)->menuPtr;
+ register TkMenu *menuPtr = ((TkMenuEntry *) clientData)->menuPtr;
if ((menuPtr->tkwin != NULL) && !(menuPtr->menuFlags & RESIZE_PENDING)) {
menuPtr->menuFlags |= RESIZE_PENDING;
- Tcl_DoWhenIdle(ComputeMenuGeometry, (ClientData) menuPtr);
+ Tcl_DoWhenIdle(ComputeMenuGeometry, menuPtr);
}
}
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index b19c7aa..e540224 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -16,11 +16,23 @@
#include "default.h"
/*
+ * The structure below defines menubutton class behavior by means of
+ * procedures that can be invoked from generic window code.
+ */
+
+static const Tk_ClassProcs menubuttonClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkMenuButtonWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
+};
+
+/*
* The following table defines the legal values for the -direction option. It
* is used together with the "enum direction" declaration in tkMenubutton.h.
*/
-static char *directionStrings[] = {
+static const char *const directionStrings[] = {
"above", "below", "flush", "left", "right", NULL
};
@@ -29,7 +41,7 @@ static char *directionStrings[] = {
* used together with the "enum state" declaration in tkMenubutton.h.
*/
-static char *stateStrings[] = {
+static const char *const stateStrings[] = {
"active", "disabled", "normal", NULL
};
@@ -38,7 +50,7 @@ static char *stateStrings[] = {
* is used with the "enum compound" declaration in tkMenuButton.h
*/
-static char *compoundStrings[] = {
+static const char *const compoundStrings[] = {
"bottom", "center", "left", "none", "right", "top", NULL
};
@@ -142,7 +154,7 @@ static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_MENUBUTTON_WRAP_LENGTH, -1, Tk_Offset(TkMenuButton, wrapLength),
0, 0, 0},
- {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
/*
@@ -151,7 +163,7 @@ static const Tk_OptionSpec optionSpecs[] = {
* dispatch the scale widget command.
*/
-static CONST char *commandNames[] = {
+static const char *const commandNames[] = {
"cget", "configure", NULL
};
@@ -170,14 +182,14 @@ static void MenuButtonImageProc(ClientData clientData,
int x, int y, int width, int height, int imgWidth,
int imgHeight);
static char * MenuButtonTextVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static int MenuButtonWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int ConfigureMenuButton(Tcl_Interp *interp,
TkMenuButton *mbPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void DestroyMenuButton(char *memPtr);
/*
@@ -203,14 +215,14 @@ Tk_MenubuttonObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register TkMenuButton *mbPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -234,18 +246,18 @@ Tk_MenubuttonObjCmd(
Tk_SetClass(tkwin, "Menubutton");
mbPtr = TkpCreateMenuButton(tkwin);
- Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr);
+ Tk_SetClassProcs(tkwin, &menubuttonClass, mbPtr);
/*
* Initialize the data structure for the button.
*/
mbPtr->tkwin = tkwin;
- mbPtr->display = Tk_Display (tkwin);
+ mbPtr->display = Tk_Display(tkwin);
mbPtr->interp = interp;
mbPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd,
- (ClientData) mbPtr, MenuButtonCmdDeletedProc);
+ Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd, mbPtr,
+ MenuButtonCmdDeletedProc);
mbPtr->optionTable = optionTable;
mbPtr->menuName = NULL;
mbPtr->text = NULL;
@@ -294,7 +306,7 @@ Tk_MenubuttonObjCmd(
Tk_CreateEventHandler(mbPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- MenuButtonEventProc, (ClientData) mbPtr);
+ MenuButtonEventProc, mbPtr);
if (Tk_InitOptions(interp, (char *) mbPtr, optionTable, tkwin) != TCL_OK) {
Tk_DestroyWindow(mbPtr->tkwin);
@@ -306,7 +318,7 @@ Tk_MenubuttonObjCmd(
return TCL_ERROR;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(mbPtr->tkwin), -1);
+ Tcl_SetObjResult(interp, TkNewWindowObj(mbPtr->tkwin));
return TCL_OK;
}
@@ -333,14 +345,14 @@ MenuButtonWidgetObjCmd(
ClientData clientData, /* Information about button widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
+ register TkMenuButton *mbPtr = clientData;
int result, index;
Tcl_Obj *objPtr;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
result = Tcl_GetIndexFromObj(interp, objv[1], commandNames, "option", 0,
@@ -348,7 +360,7 @@ MenuButtonWidgetObjCmd(
if (result != TCL_OK) {
return result;
}
- Tcl_Preserve((ClientData) mbPtr);
+ Tcl_Preserve(mbPtr);
switch (index) {
case COMMAND_CGET:
@@ -361,9 +373,8 @@ MenuButtonWidgetObjCmd(
mbPtr->optionTable, objv[2], mbPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case COMMAND_CONFIGURE:
@@ -373,19 +384,18 @@ MenuButtonWidgetObjCmd(
mbPtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
result = ConfigureMenuButton(interp, mbPtr, objc-2, objv+2);
}
break;
}
- Tcl_Release((ClientData) mbPtr);
+ Tcl_Release(mbPtr);
return result;
error:
- Tcl_Release((ClientData) mbPtr);
+ Tcl_Release(mbPtr);
return TCL_ERROR;
}
@@ -416,7 +426,7 @@ DestroyMenuButton(
TkpDestroyMenuButton(mbPtr);
if (mbPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_CancelIdleCall(TkpDisplayMenuButton, mbPtr);
}
/*
@@ -428,7 +438,7 @@ DestroyMenuButton(
if (mbPtr->textVarName != NULL) {
Tcl_UntraceVar(mbPtr->interp, mbPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData) mbPtr);
+ MenuButtonTextVarProc, mbPtr);
}
if (mbPtr->image != NULL) {
Tk_FreeImage(mbPtr->image);
@@ -453,7 +463,7 @@ DestroyMenuButton(
}
Tk_FreeConfigOptions((char *) mbPtr, mbPtr->optionTable, mbPtr->tkwin);
mbPtr->tkwin = NULL;
- Tcl_EventuallyFree((ClientData) mbPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(mbPtr, TCL_DYNAMIC);
}
/*
@@ -484,7 +494,7 @@ ConfigureMenuButton(
/* 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. */
+ Tcl_Obj *const objv[]) /* Arguments. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
@@ -498,7 +508,7 @@ ConfigureMenuButton(
if (mbPtr->textVarName != NULL) {
Tcl_UntraceVar(interp, mbPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData) mbPtr);
+ MenuButtonTextVarProc, mbPtr);
}
/*
@@ -561,8 +571,7 @@ ConfigureMenuButton(
if (mbPtr->imageString != NULL) {
image = Tk_GetImage(mbPtr->interp, mbPtr->tkwin,
- mbPtr->imageString, MenuButtonImageProc,
- (ClientData) mbPtr);
+ mbPtr->imageString, MenuButtonImageProc, mbPtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -614,7 +623,7 @@ ConfigureMenuButton(
* Set up a trace to watch for any changes in it, create the variable
* if it doesn't exist, and fetch its current value.
*/
- CONST char *value;
+ const char *value;
value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
@@ -624,15 +633,15 @@ ConfigureMenuButton(
if (mbPtr->text != NULL) {
ckfree(mbPtr->text);
}
- mbPtr->text = (char *) ckalloc((unsigned) (strlen(value) + 1));
+ mbPtr->text = ckalloc(strlen(value) + 1);
strcpy(mbPtr->text, value);
}
Tcl_TraceVar(interp, mbPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MenuButtonTextVarProc, (ClientData) mbPtr);
+ MenuButtonTextVarProc, mbPtr);
}
- TkMenuButtonWorldChanged((ClientData) mbPtr);
+ TkMenuButtonWorldChanged(mbPtr);
if (error) {
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
@@ -666,9 +675,7 @@ TkMenuButtonWorldChanged(
XGCValues gcValues;
GC gc;
unsigned long mask;
- TkMenuButton *mbPtr;
-
- mbPtr = (TkMenuButton *) instanceData;
+ TkMenuButton *mbPtr = instanceData;
gcValues.font = Tk_FontId(mbPtr->tkfont);
gcValues.foreground = mbPtr->normalFg->pixel;
@@ -741,7 +748,7 @@ TkMenuButtonWorldChanged(
*/
if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr);
mbPtr->flags |= REDRAW_PENDING;
}
}
@@ -769,7 +776,8 @@ MenuButtonEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkMenuButton *mbPtr = (TkMenuButton *) clientData;
+ TkMenuButton *mbPtr = clientData;
+
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
goto redraw;
} else if (eventPtr->type == ConfigureNotify) {
@@ -800,7 +808,7 @@ MenuButtonEventProc(
redraw:
if ((mbPtr->tkwin != NULL) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr);
mbPtr->flags |= REDRAW_PENDING;
}
}
@@ -827,7 +835,7 @@ static void
MenuButtonCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkMenuButton *mbPtr = (TkMenuButton *) clientData;
+ TkMenuButton *mbPtr = clientData;
Tk_Window tkwin = mbPtr->tkwin;
/*
@@ -865,12 +873,12 @@ static char *
MenuButtonTextVarProc(
ClientData clientData, /* Information about button. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Name of variable. */
- CONST char *name2, /* Second part of variable name. */
+ 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;
- CONST char *value;
+ register TkMenuButton *mbPtr = clientData;
+ const char *value;
unsigned len;
/*
@@ -897,13 +905,13 @@ MenuButtonTextVarProc(
ckfree(mbPtr->text);
}
len = 1 + (unsigned) strlen(value);
- mbPtr->text = (char *) ckalloc(len);
+ mbPtr->text = ckalloc(len);
memcpy(mbPtr->text, value, len);
TkpComputeMenuButtonGeometry(mbPtr);
if ((mbPtr->tkwin != NULL) && Tk_IsMapped(mbPtr->tkwin)
&& !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr);
mbPtr->flags |= REDRAW_PENDING;
}
return NULL;
@@ -936,12 +944,12 @@ MenuButtonImageProc(
* 0). */
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
+ register TkMenuButton *mbPtr = clientData;
if (mbPtr->tkwin != NULL) {
TkpComputeMenuButtonGeometry(mbPtr);
if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr);
mbPtr->flags |= REDRAW_PENDING;
}
}
diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h
index 41af675..e8dc12f 100644
--- a/generic/tkMenubutton.h
+++ b/generic/tkMenubutton.h
@@ -21,11 +21,6 @@
#include "tkMenu.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Legal values for the "orient" field of TkMenubutton records.
*/
@@ -209,12 +204,6 @@ typedef struct {
#define INDICATOR_HEIGHT 17
/*
- * Declaration of variables shared between the files in the button module.
- */
-
-MODULE_SCOPE Tk_ClassProcs tkpMenubuttonClass;
-
-/*
* Declaration of procedures used in the implementation of the button widget.
*/
@@ -224,7 +213,4 @@ MODULE_SCOPE void TkpDisplayMenuButton(ClientData clientData);
MODULE_SCOPE void TkpDestroyMenuButton(TkMenuButton *mbPtr);
MODULE_SCOPE void TkMenuButtonWorldChanged(ClientData instanceData);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKMENUBUTTON */
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index 0fd57a9..5df3875 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -133,7 +133,7 @@ static const Tk_OptionSpec optionSpecs[] = {
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_Offset(Message, highlightBgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
DEF_MESSAGE_HIGHLIGHT, -1, Tk_Offset(Message, highlightColorPtr),
0, 0, 0},
@@ -160,7 +160,7 @@ static const Tk_OptionSpec optionSpecs[] = {
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, NULL, NULL, NULL, NULL, 0, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
/*
@@ -171,15 +171,15 @@ static void MessageCmdDeletedProc(ClientData clientData);
static void MessageEventProc(ClientData clientData,
XEvent *eventPtr);
static char * MessageTextVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static int MessageWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void MessageWorldChanged(ClientData instanceData);
static void ComputeMessageGeometry(Message *msgPtr);
static int ConfigureMessage(Tcl_Interp *interp, Message *msgPtr,
- int objc, Tcl_Obj *CONST objv[], int flags);
+ int objc, Tcl_Obj *const objv[], int flags);
static void DestroyMessage(char *memPtr);
static void DisplayMessage(ClientData clientData);
@@ -188,9 +188,11 @@ static void DisplayMessage(ClientData clientData);
* that can be invoked from generic window code.
*/
-static Tk_ClassProcs messageClass = {
+static const Tk_ClassProcs messageClass = {
sizeof(Tk_ClassProcs), /* size */
MessageWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -215,14 +217,14 @@ Tk_MessageObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
register Message *msgPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -239,7 +241,7 @@ Tk_MessageObjCmd(
optionTable = Tk_CreateOptionTable(interp, optionSpecs);
- msgPtr = (Message *) ckalloc(sizeof(Message));
+ msgPtr = ckalloc(sizeof(Message));
memset(msgPtr, 0, (size_t) sizeof(Message));
/*
@@ -250,8 +252,8 @@ Tk_MessageObjCmd(
msgPtr->display = Tk_Display(tkwin);
msgPtr->interp = interp;
msgPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd,
- (ClientData) msgPtr, MessageCmdDeletedProc);
+ Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd, msgPtr,
+ MessageCmdDeletedProc);
msgPtr->optionTable = optionTable;
msgPtr->relief = TK_RELIEF_FLAT;
msgPtr->textGC = None;
@@ -261,10 +263,10 @@ Tk_MessageObjCmd(
msgPtr->cursor = None;
Tk_SetClass(msgPtr->tkwin, "Message");
- Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
+ Tk_SetClassProcs(msgPtr->tkwin, &messageClass, msgPtr);
Tk_CreateEventHandler(msgPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- MessageEventProc, (ClientData) msgPtr);
+ MessageEventProc, msgPtr);
if (Tk_InitOptions(interp, (char *)msgPtr, optionTable, tkwin) != TCL_OK) {
Tk_DestroyWindow(msgPtr->tkwin);
return TCL_ERROR;
@@ -302,17 +304,17 @@ MessageWidgetObjCmd(
ClientData clientData, /* Information about message widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
- register Message *msgPtr = (Message *) clientData;
- static CONST char *optionStrings[] = { "cget", "configure", NULL };
+ register Message *msgPtr = clientData;
+ static const char *const optionStrings[] = { "cget", "configure", 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 ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -321,7 +323,7 @@ MessageWidgetObjCmd(
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) msgPtr);
+ Tcl_Preserve(msgPtr);
switch ((enum options) index) {
case MESSAGE_CGET:
@@ -356,7 +358,7 @@ MessageWidgetObjCmd(
break;
}
- Tcl_Release((ClientData) msgPtr);
+ Tcl_Release(msgPtr);
return result;
}
@@ -388,7 +390,7 @@ DestroyMessage(
Tcl_DeleteCommandFromToken(msgPtr->interp, msgPtr->widgetCmd);
if (msgPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMessage, (ClientData) msgPtr);
+ Tcl_CancelIdleCall(DisplayMessage, msgPtr);
}
/*
@@ -405,11 +407,11 @@ DestroyMessage(
if (msgPtr->textVarName != NULL) {
Tcl_UntraceVar(msgPtr->interp, msgPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MessageTextVarProc, (ClientData) msgPtr);
+ MessageTextVarProc, msgPtr);
}
Tk_FreeConfigOptions((char *) msgPtr, msgPtr->optionTable, msgPtr->tkwin);
msgPtr->tkwin = NULL;
- ckfree((char *) msgPtr);
+ ckfree(msgPtr);
}
/*
@@ -438,7 +440,7 @@ ConfigureMessage(
register Message *msgPtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[], /* Arguments. */
+ Tcl_Obj *const objv[], /* Arguments. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
@@ -450,7 +452,7 @@ ConfigureMessage(
if (msgPtr->textVarName != NULL) {
Tcl_UntraceVar(interp, msgPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MessageTextVarProc, (ClientData) msgPtr);
+ MessageTextVarProc, msgPtr);
}
if (Tk_SetOptions(interp, (char *) msgPtr, msgPtr->optionTable, objc, objv,
@@ -466,7 +468,7 @@ ConfigureMessage(
*/
if (msgPtr->textVarName != NULL) {
- CONST char *value;
+ const char *value;
value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
@@ -480,7 +482,7 @@ ConfigureMessage(
}
Tcl_TraceVar(interp, msgPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- MessageTextVarProc, (ClientData) msgPtr);
+ MessageTextVarProc, msgPtr);
}
/*
@@ -496,7 +498,7 @@ ConfigureMessage(
}
Tk_FreeSavedOptions(&savedOptions);
- MessageWorldChanged((ClientData) msgPtr);
+ MessageWorldChanged(msgPtr);
return TCL_OK;
}
@@ -525,9 +527,7 @@ MessageWorldChanged(
XGCValues gcValues;
GC gc = None;
Tk_FontMetrics fm;
- Message *msgPtr;
-
- msgPtr = (Message *) instanceData;
+ Message *msgPtr = instanceData;
if (msgPtr->border != NULL) {
Tk_SetBackgroundFromBorder(msgPtr->tkwin, msgPtr->border);
@@ -557,7 +557,7 @@ MessageWorldChanged(
ComputeMessageGeometry(msgPtr);
if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin)
&& !(msgPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr);
+ Tcl_DoWhenIdle(DisplayMessage, msgPtr);
msgPtr->flags |= REDRAW_PENDING;
}
}
@@ -666,7 +666,7 @@ static void
DisplayMessage(
ClientData clientData) /* Information about window. */
{
- register Message *msgPtr = (Message *) clientData;
+ register Message *msgPtr = clientData;
register Tk_Window tkwin = msgPtr->tkwin;
int x, y;
int borderWidth = msgPtr->highlightWidth;
@@ -742,13 +742,13 @@ MessageEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- Message *msgPtr = (Message *) clientData;
+ Message *msgPtr = clientData;
if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0))
|| (eventPtr->type == ConfigureNotify)) {
goto redraw;
} else if (eventPtr->type == DestroyNotify) {
- DestroyMessage((char *) clientData);
+ DestroyMessage(clientData);
} else if (eventPtr->type == FocusIn) {
if (eventPtr->xfocus.detail != NotifyInferior) {
msgPtr->flags |= GOT_FOCUS;
@@ -768,7 +768,7 @@ MessageEventProc(
redraw:
if ((msgPtr->tkwin != NULL) && !(msgPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr);
+ Tcl_DoWhenIdle(DisplayMessage, msgPtr);
msgPtr->flags |= REDRAW_PENDING;
}
}
@@ -795,7 +795,7 @@ static void
MessageCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- Message *msgPtr = (Message *) clientData;
+ Message *msgPtr = clientData;
/*
* This function could be invoked either because the window was destroyed
@@ -831,12 +831,12 @@ static char *
MessageTextVarProc(
ClientData clientData, /* Information about message. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Name of variable. */
- CONST 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;
- CONST char *value;
+ register Message *msgPtr = clientData;
+ const char *value;
/*
* If the variable is unset, then immediately recreate it unless the whole
@@ -862,13 +862,13 @@ MessageTextVarProc(
ckfree(msgPtr->string);
}
msgPtr->numChars = Tcl_NumUtfChars(value, -1);
- msgPtr->string = (char *) ckalloc((unsigned) (strlen(value) + 1));
+ msgPtr->string = ckalloc(strlen(value) + 1);
strcpy(msgPtr->string, value);
ComputeMessageGeometry(msgPtr);
if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin)
&& !(msgPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr);
+ Tcl_DoWhenIdle(DisplayMessage, msgPtr);
msgPtr->flags |= REDRAW_PENDING;
}
return NULL;
diff --git a/generic/tkObj.c b/generic/tkObj.c
index d973bd4..779636b 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -34,7 +34,7 @@ typedef struct PixelRep {
#define SET_COMPLEXPIXEL(objPtr, repPtr) \
(objPtr)->internalRep.twoPtrValue.ptr1 = 0; \
- (objPtr)->internalRep.twoPtrValue.ptr2 = (VOID *) repPtr
+ (objPtr)->internalRep.twoPtrValue.ptr2 = repPtr
#define GET_COMPLEXPIXEL(objPtr) \
((PixelRep *) (objPtr)->internalRep.twoPtrValue.ptr2)
@@ -85,7 +85,7 @@ static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
* initial display-independant settings.
*/
-static Tcl_ObjType pixelObjType = {
+static const Tcl_ObjType pixelObjType = {
"pixel", /* name */
FreePixelInternalRep, /* freeIntRepProc */
DupPixelInternalRep, /* dupIntRepProc */
@@ -99,7 +99,7 @@ static Tcl_ObjType pixelObjType = {
* initial display-independant settings.
*/
-static Tcl_ObjType mmObjType = {
+static const Tcl_ObjType mmObjType = {
"mm", /* name */
FreeMMInternalRep, /* freeIntRepProc */
DupMMInternalRep, /* dupIntRepProc */
@@ -112,7 +112,7 @@ static Tcl_ObjType mmObjType = {
* Tcl object.
*/
-static Tcl_ObjType windowObjType = {
+static const Tcl_ObjType windowObjType = {
"window", /* name */
FreeWindowInternalRep, /* freeIntRepProc */
DupWindowInternalRep, /* dupIntRepProc */
@@ -153,7 +153,7 @@ GetPixelsFromObjEx(
int result,fresh;
double d;
PixelRep *pixelPtr;
- static double bias[] = {
+ static const double bias[] = {
1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/
};
@@ -310,7 +310,7 @@ FreePixelInternalRep(
if (!SIMPLE_PIXELREP(objPtr)) {
pixelPtr = GET_COMPLEXPIXEL(objPtr);
- ckfree((char *) pixelPtr);
+ ckfree(pixelPtr);
}
SET_SIMPLEPIXEL(objPtr, 0);
objPtr->typePtr = NULL;
@@ -347,7 +347,7 @@ DupPixelInternalRep(
SET_SIMPLEPIXEL(copyPtr, GET_SIMPLEPIXEL(srcPtr));
} else {
oldPtr = GET_COMPLEXPIXEL(srcPtr);
- newPtr = (PixelRep *) ckalloc(sizeof(PixelRep));
+ newPtr = ckalloc(sizeof(PixelRep));
newPtr->value = oldPtr->value;
newPtr->units = oldPtr->units;
newPtr->tkwin = oldPtr->tkwin;
@@ -381,7 +381,8 @@ SetPixelFromAny(
Tcl_Obj *objPtr) /* The object to convert. */
{
const Tcl_ObjType *typePtr;
- char *string, *rest;
+ const char *string;
+ char *rest;
double d;
int i, units;
@@ -421,7 +422,7 @@ SetPixelFromAny(
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &pixelObjType;
@@ -430,7 +431,7 @@ SetPixelFromAny(
if ((units < 0) && (i == d)) {
SET_SIMPLEPIXEL(objPtr, i);
} else {
- PixelRep *pixelPtr = (PixelRep *) ckalloc(sizeof(PixelRep));
+ PixelRep *pixelPtr = ckalloc(sizeof(PixelRep));
pixelPtr->value = d;
pixelPtr->units = units;
@@ -442,16 +443,8 @@ SetPixelFromAny(
error:
if (interp != NULL) {
- /*
- * Must copy string before resetting the result in case a caller is
- * trying to convert the interpreter's result to pixels.
- */
-
- char buf[100];
-
- sprintf(buf, "bad screen distance \"%.50s\"", string);
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, buf, NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "bad screen distance \"%.50s\"", string));
}
return TCL_ERROR;
}
@@ -487,7 +480,7 @@ Tk_GetMMFromObj(
int result;
double d;
MMRep *mmPtr;
- static double bias[] = {
+ static const double bias[] = {
10.0, 25.4, 1.0, 0.35278 /*25.4 / 72.0*/
};
@@ -498,7 +491,7 @@ Tk_GetMMFromObj(
}
}
- mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr;
+ mmPtr = objPtr->internalRep.otherValuePtr;
if (mmPtr->tkwin != tkwin) {
d = mmPtr->value;
if (mmPtr->units == -1) {
@@ -537,7 +530,7 @@ static void
FreeMMInternalRep(
Tcl_Obj *objPtr) /* MM object with internal rep to free. */
{
- ckfree((char *) objPtr->internalRep.otherValuePtr);
+ ckfree(objPtr->internalRep.otherValuePtr);
objPtr->internalRep.otherValuePtr = NULL;
objPtr->typePtr = NULL;
}
@@ -568,13 +561,13 @@ DupMMInternalRep(
MMRep *oldPtr, *newPtr;
copyPtr->typePtr = srcPtr->typePtr;
- oldPtr = (MMRep *) srcPtr->internalRep.otherValuePtr;
- newPtr = (MMRep *) ckalloc(sizeof(MMRep));
+ oldPtr = srcPtr->internalRep.otherValuePtr;
+ newPtr = ckalloc(sizeof(MMRep));
newPtr->value = oldPtr->value;
newPtr->units = oldPtr->units;
newPtr->tkwin = oldPtr->tkwin;
newPtr->returnValue = oldPtr->returnValue;
- copyPtr->internalRep.otherValuePtr = (VOID *) newPtr;
+ copyPtr->internalRep.otherValuePtr = newPtr;
}
/*
@@ -604,7 +597,7 @@ UpdateStringOfMM(
char buffer[TCL_DOUBLE_SPACE];
register int len;
- mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr;
+ mmPtr = objPtr->internalRep.otherValuePtr;
/* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */
if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) {
Tcl_Panic("UpdateStringOfMM: false precondition");
@@ -613,7 +606,7 @@ UpdateStringOfMM(
Tcl_PrintDouble(NULL, mmPtr->value, buffer);
len = (int)strlen(buffer);
- objPtr->bytes = (char *) ckalloc((unsigned) len + 1);
+ objPtr->bytes = ckalloc(len + 1);
strcpy(objPtr->bytes, buffer);
objPtr->length = len;
}
@@ -643,7 +636,8 @@ SetMMFromAny(
Tcl_Obj *objPtr) /* The object to convert. */
{
const Tcl_ObjType *typePtr;
- char *string, *rest;
+ const char *string;
+ char *rest;
double d;
int units;
MMRep *mmPtr;
@@ -658,7 +652,7 @@ SetMMFromAny(
*/
tclDoubleObjType = Tcl_GetObjType("double");
- tclIntObjType = Tcl_GetObjType("int");
+ tclIntObjType = Tcl_GetObjType("int");
}
if (objPtr->typePtr == tclDoubleObjType) {
@@ -726,18 +720,18 @@ SetMMFromAny(
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(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 = ckalloc(sizeof(MMRep));
+ mmPtr->value = d;
+ mmPtr->units = units;
+ mmPtr->tkwin = NULL;
mmPtr->returnValue = d;
- objPtr->internalRep.otherValuePtr = (VOID *) mmPtr;
+ objPtr->internalRep.otherValuePtr = mmPtr;
return TCL_OK;
}
@@ -770,7 +764,7 @@ TkGetWindowFromObj(
Tcl_Obj *objPtr, /* The object from which to get window. */
Tk_Window *windowPtr) /* Place to store resulting window. */
{
- TkMainInfo *mainPtr = ((TkWindow *)tkwin)->mainPtr;
+ TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr;
register WindowRep *winPtr;
int result;
@@ -779,26 +773,27 @@ TkGetWindowFromObj(
return result;
}
- winPtr = (WindowRep *) objPtr->internalRep.otherValuePtr;
- if ( winPtr->tkwin == NULL
- || winPtr->mainPtr == NULL
- || winPtr->mainPtr != mainPtr
- || winPtr->epoch != mainPtr->deletionEpoch)
- {
- /* Cache is invalid.
+ winPtr = objPtr->internalRep.otherValuePtr;
+ if (winPtr->tkwin == NULL
+ || winPtr->mainPtr == NULL
+ || winPtr->mainPtr != mainPtr
+ || winPtr->epoch != mainPtr->deletionEpoch) {
+ /*
+ * Cache is invalid.
*/
+
winPtr->tkwin = Tk_NameToWindow(interp,
Tcl_GetStringFromObj(objPtr, NULL), tkwin);
+ if (winPtr->tkwin == NULL) {
+ /* ASSERT: Tk_NameToWindow has left error message in interp */
+ return TCL_ERROR;
+ }
+
winPtr->mainPtr = mainPtr;
winPtr->epoch = mainPtr ? mainPtr->deletionEpoch : 0;
}
*windowPtr = winPtr->tkwin;
-
- if (winPtr->tkwin == NULL) {
- /* ASSERT: Tk_NameToWindow has left error message in interp */
- return TCL_ERROR;
- }
return TCL_OK;
}
@@ -837,15 +832,15 @@ SetWindowFromAny(
Tcl_GetStringFromObj(objPtr, NULL);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
- winPtr = (WindowRep *) ckalloc(sizeof(WindowRep));
+ winPtr = ckalloc(sizeof(WindowRep));
winPtr->tkwin = NULL;
winPtr->mainPtr = NULL;
winPtr->epoch = 0;
- objPtr->internalRep.otherValuePtr = (VOID*)winPtr;
+ objPtr->internalRep.otherValuePtr = winPtr;
objPtr->typePtr = &windowObjType;
return TCL_OK;
@@ -877,11 +872,11 @@ DupWindowInternalRep(
register WindowRep *oldPtr, *newPtr;
oldPtr = srcPtr->internalRep.otherValuePtr;
- newPtr = (WindowRep *) ckalloc(sizeof(WindowRep));
+ newPtr = ckalloc(sizeof(WindowRep));
newPtr->tkwin = oldPtr->tkwin;
newPtr->mainPtr = oldPtr->mainPtr;
newPtr->epoch = oldPtr->epoch;
- copyPtr->internalRep.otherValuePtr = (VOID *)newPtr;
+ copyPtr->internalRep.otherValuePtr = newPtr;
copyPtr->typePtr = srcPtr->typePtr;
}
@@ -907,13 +902,47 @@ static void
FreeWindowInternalRep(
Tcl_Obj *objPtr) /* Window object with internal rep to free. */
{
- ckfree((char *) objPtr->internalRep.otherValuePtr);
+ ckfree(objPtr->internalRep.otherValuePtr);
objPtr->internalRep.otherValuePtr = NULL;
objPtr->typePtr = NULL;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
+ *
+ * TkNewWindowObj --
+ *
+ * This function allocates a new Tcl_Obj that refers to a particular to a
+ * particular Tk window.
+ *
+ * Results:
+ * A standard Tcl object reference, with refcount 0.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Obj *
+TkNewWindowObj(
+ Tk_Window tkwin)
+{
+ Tcl_Obj *objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1);
+ TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr;
+ register WindowRep *winPtr;
+
+ SetWindowFromAny(NULL, objPtr);
+
+ winPtr = objPtr->internalRep.otherValuePtr;
+ winPtr->tkwin = tkwin;
+ winPtr->mainPtr = mainPtr;
+ winPtr->epoch = mainPtr->deletionEpoch;
+ return objPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
*
* TkParsePadAmount --
*
@@ -931,7 +960,7 @@ FreeWindowInternalRep(
* An error message is written to the interpreter if something is not
* right.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
int
@@ -1044,7 +1073,6 @@ TkRegisterObjTypes(void)
Tcl_RegisterObjType(&tkCursorObjType);
Tcl_RegisterObjType(&tkFontObjType);
Tcl_RegisterObjType(&mmObjType);
- Tcl_RegisterObjType(&tkOptionObjType);
Tcl_RegisterObjType(&pixelObjType);
Tcl_RegisterObjType(&tkStateKeyObjType);
Tcl_RegisterObjType(&windowObjType);
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 97ad5cb..1ab6ab6 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -12,7 +12,7 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
+#include "tkInt.h"
/*
* Values for "flags" field of Tk_ConfigSpec structures. Be sure to coordinate
@@ -33,12 +33,12 @@ static int DoConfig(Tcl_Interp *interp, Tk_Window tkwin,
Tk_ConfigSpec *specPtr, Tk_Uid value,
int valueIsUid, char *widgRec);
static Tk_ConfigSpec * FindConfigSpec(Tcl_Interp *interp,
- Tk_ConfigSpec *specs, CONST char *argvName,
+ Tk_ConfigSpec *specs, const char *argvName,
int needFlags, int hateFlags);
static char * FormatConfigInfo(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_ConfigSpec *specPtr, char *widgRec);
-static CONST char * FormatConfigValue(Tcl_Interp *interp, Tk_Window tkwin,
- Tk_ConfigSpec *specPtr, char *widgRec,
+ const Tk_ConfigSpec *specPtr, char *widgRec);
+static const char * FormatConfigValue(Tcl_Interp *interp, Tk_Window tkwin,
+ const Tk_ConfigSpec *specPtr, char *widgRec,
char *buffer, Tcl_FreeProc **freeProcPtr);
static Tk_ConfigSpec * GetCachedSpecs(Tcl_Interp *interp,
const Tk_ConfigSpec *staticSpecs);
@@ -72,9 +72,9 @@ Tk_ConfigureWidget(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Window containing widget (needed to set up
* X resources). */
- Tk_ConfigSpec *specs, /* Describes legal options. */
+ const Tk_ConfigSpec *specs, /* Describes legal options. */
int argc, /* Number of elements in argv. */
- CONST 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. */
int flags) /* Used to specify additional flags that must
@@ -82,7 +82,7 @@ Tk_ConfigureWidget(
* considered. Also, may have
* TK_CONFIG_ARGV_ONLY set. */
{
- register Tk_ConfigSpec *specPtr;
+ register Tk_ConfigSpec *specPtr, *staticSpecs;
Tk_Uid value; /* Value of option from database. */
int needFlags; /* Specs must contain this set of flags or
* else they are not considered. */
@@ -110,7 +110,7 @@ Tk_ConfigureWidget(
* Get the build of the config for this interpreter.
*/
- specs = GetCachedSpecs(interp, specs);
+ staticSpecs = GetCachedSpecs(interp, specs);
/*
* Pass one: scan through all of the arguments, processing those that
@@ -118,14 +118,14 @@ Tk_ConfigureWidget(
*/
for ( ; argc > 0; argc -= 2, argv += 2) {
- CONST char *arg;
+ const char *arg;
if (flags & TK_CONFIG_OBJS) {
arg = Tcl_GetStringFromObj((Tcl_Obj *) *argv, NULL);
} else {
arg = *argv;
}
- specPtr = FindConfigSpec(interp, specs, arg, needFlags, hateFlags);
+ specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags);
if (specPtr == NULL) {
return TCL_ERROR;
}
@@ -163,7 +163,7 @@ Tk_ConfigureWidget(
*/
if (!(flags & TK_CONFIG_ARGV_ONLY)) {
- for (specPtr=specs; specPtr->type!=TK_CONFIG_END; specPtr++) {
+ for (specPtr = staticSpecs; specPtr->type != TK_CONFIG_END; specPtr++) {
if ((specPtr->specFlags & TK_CONFIG_OPTION_SPECIFIED)
|| (specPtr->argvName == NULL)
|| (specPtr->type == TK_CONFIG_SYNONYM)) {
@@ -240,7 +240,7 @@ FindConfigSpec(
Tcl_Interp *interp, /* Used for reporting errors. */
Tk_ConfigSpec *specs, /* Pointer to table of configuration
* specifications for a widget. */
- CONST 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. */
@@ -372,7 +372,7 @@ DoConfig(
if (nullValue) {
newStr = NULL;
} else {
- newStr = (char *) ckalloc((unsigned) (strlen(value) + 1));
+ newStr = ckalloc(strlen(value) + 1);
strcpy(newStr, value);
}
oldStr = *((char **) ptr);
@@ -541,9 +541,8 @@ DoConfig(
break;
}
case TK_CONFIG_CUSTOM:
- if ((*specPtr->customPtr->parseProc)(
- specPtr->customPtr->clientData, interp, tkwin, value,
- widgRec, specPtr->offset) != TCL_OK) {
+ if (specPtr->customPtr->parseProc(specPtr->customPtr->clientData,
+ interp, tkwin, value, widgRec, specPtr->offset)!=TCL_OK) {
return TCL_ERROR;
}
break;
@@ -592,20 +591,20 @@ int
Tk_ConfigureInfo(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Window corresponding to widgRec. */
- Tk_ConfigSpec *specs, /* Describes legal options. */
+ const Tk_ConfigSpec *specs, /* Describes legal options. */
char *widgRec, /* Record whose fields contain current values
* for options. */
- CONST 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 that must
* be present in config specs for them to be
* considered. */
{
- register Tk_ConfigSpec *specPtr;
+ register Tk_ConfigSpec *specPtr, *staticSpecs;
int needFlags, hateFlags;
char *list;
- char *leader = "{";
+ const char *leader = "{";
needFlags = flags & ~(TK_CONFIG_USER_BIT - 1);
if (Tk_Depth(tkwin) <= 1) {
@@ -618,22 +617,22 @@ Tk_ConfigureInfo(
* Get the build of the config for this interpreter.
*/
- specs = GetCachedSpecs(interp, specs);
+ staticSpecs = GetCachedSpecs(interp, specs);
/*
* If information is only wanted for a single configuration spec, then
* handle that one spec specially.
*/
- Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_ResetResult(interp);
if (argvName != NULL) {
- specPtr = FindConfigSpec(interp, specs, argvName, needFlags,hateFlags);
+ specPtr = FindConfigSpec(interp, staticSpecs, argvName, needFlags,hateFlags);
if (specPtr == NULL) {
return TCL_ERROR;
}
- Tcl_SetResult(interp,
- FormatConfigInfo(interp, tkwin, specPtr, widgRec),
- TCL_DYNAMIC);
+ list = FormatConfigInfo(interp, tkwin, specPtr, widgRec);
+ Tcl_SetResult(interp, list, TCL_VOLATILE);
+ ckfree(list);
return TCL_OK;
}
@@ -642,7 +641,7 @@ Tk_ConfigureInfo(
* information.
*/
- for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) {
+ for (specPtr = staticSpecs; specPtr->type != TK_CONFIG_END; specPtr++) {
if ((argvName != NULL) && (specPtr->argvName != argvName)) {
continue;
}
@@ -684,13 +683,13 @@ FormatConfigInfo(
Tcl_Interp *interp, /* Interpreter to use for things like
* floating-point precision. */
Tk_Window tkwin, /* Window corresponding to widget. */
- register Tk_ConfigSpec *specPtr,
+ register const Tk_ConfigSpec *specPtr,
/* Pointer to information describing
* option. */
char *widgRec) /* Pointer to record holding current values of
* info for widget. */
{
- CONST char *argv[6];
+ const char *argv[6];
char *result;
char buffer[200];
Tcl_FreeProc *freeProc = NULL;
@@ -719,9 +718,9 @@ FormatConfigInfo(
result = Tcl_Merge(5, argv);
if (freeProc != NULL) {
if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
- ckfree((char *)argv[4]);
+ ckfree(argv[4]);
} else {
- (*freeProc)((char *)argv[4]);
+ freeProc((char *) argv[4]);
}
}
return result;
@@ -747,11 +746,11 @@ FormatConfigInfo(
*----------------------------------------------------------------------
*/
-static CONST char *
+static const char *
FormatConfigValue(
Tcl_Interp *interp, /* Interpreter for use in real conversions. */
Tk_Window tkwin, /* Window corresponding to widget. */
- Tk_ConfigSpec *specPtr, /* Pointer to information describing option.
+ const Tk_ConfigSpec *specPtr, /* Pointer to information describing option.
* Must not point to a synonym option. */
char *widgRec, /* Pointer to record holding current values of
* info for widget. */
@@ -761,7 +760,7 @@ FormatConfigValue(
* function to free the result, or NULL if
* result is static. */
{
- CONST char *ptr, *result;
+ const char *ptr, *result;
*freeProcPtr = NULL;
ptr = widgRec + specPtr->offset;
@@ -870,9 +869,8 @@ FormatConfigValue(
break;
}
case TK_CONFIG_CUSTOM:
- result = (*specPtr->customPtr->printProc)(
- specPtr->customPtr->clientData, tkwin, widgRec,
- specPtr->offset, freeProcPtr);
+ result = specPtr->customPtr->printProc(specPtr->customPtr->clientData,
+ tkwin, widgRec, specPtr->offset, freeProcPtr);
break;
default:
result = "?? unknown type ??";
@@ -904,10 +902,10 @@ int
Tk_ConfigureValue(
Tcl_Interp *interp, /* Interpreter for error reporting. */
Tk_Window tkwin, /* Window corresponding to widgRec. */
- Tk_ConfigSpec *specs, /* Describes legal options. */
+ const Tk_ConfigSpec *specs, /* Describes legal options. */
char *widgRec, /* Record whose fields contain current values
* for options. */
- CONST char *argvName, /* Gives the command-line name for the option
+ 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 for them to be
@@ -916,7 +914,7 @@ Tk_ConfigureValue(
Tk_ConfigSpec *specPtr;
int needFlags, hateFlags;
Tcl_FreeProc *freeProc;
- CONST char *result;
+ const char *result;
char buffer[200];
needFlags = flags & ~(TK_CONFIG_USER_BIT - 1);
@@ -930,9 +928,9 @@ Tk_ConfigureValue(
* Get the build of the config for this interpreter.
*/
- specs = GetCachedSpecs(interp, specs);
+ specPtr = GetCachedSpecs(interp, specs);
- specPtr = FindConfigSpec(interp, specs, argvName, needFlags, hateFlags);
+ specPtr = FindConfigSpec(interp, specPtr, argvName, needFlags, hateFlags);
if (specPtr == NULL) {
return TCL_ERROR;
}
@@ -941,9 +939,9 @@ Tk_ConfigureValue(
Tcl_SetResult(interp, (char *) result, TCL_VOLATILE);
if (freeProc != NULL) {
if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
- ckfree((char *)result);
+ ckfree(result);
} else {
- (*freeProc)((char *)result);
+ freeProc((char *) result);
}
}
return TCL_OK;
@@ -973,7 +971,7 @@ Tk_ConfigureValue(
/* ARGSUSED */
void
Tk_FreeOptions(
- Tk_ConfigSpec *specs, /* Describes legal options. */
+ const Tk_ConfigSpec *specs, /* Describes legal options. */
char *widgRec, /* Record whose fields contain current values
* for options. */
Display *display, /* X display; needed for freeing some
@@ -982,7 +980,7 @@ Tk_FreeOptions(
* be present in config specs for them to be
* considered. */
{
- register Tk_ConfigSpec *specPtr;
+ register const Tk_ConfigSpec *specPtr;
char *ptr;
for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) {
@@ -1070,13 +1068,13 @@ GetCachedSpecs(
* self-initializing code.
*/
- specCacheTablePtr = (Tcl_HashTable *)
+ specCacheTablePtr =
Tcl_GetAssocData(interp, "tkConfigSpec.threadTable", NULL);
if (specCacheTablePtr == NULL) {
- specCacheTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
+ specCacheTablePtr = ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(specCacheTablePtr, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "tkConfigSpec.threadTable",
- DeleteSpecCacheTable, (ClientData) specCacheTablePtr);
+ DeleteSpecCacheTable, specCacheTablePtr);
}
/*
@@ -1106,9 +1104,9 @@ GetCachedSpecs(
* from the master copy.
*/
- cachedSpecs = (Tk_ConfigSpec *) ckalloc(entrySpace);
+ cachedSpecs = ckalloc(entrySpace);
memcpy(cachedSpecs, staticSpecs, entrySpace);
- Tcl_SetHashValue(entryPtr, (ClientData) cachedSpecs);
+ Tcl_SetHashValue(entryPtr, cachedSpecs);
/*
* Finally, go through and replace database names, database classes
@@ -1131,7 +1129,7 @@ GetCachedSpecs(
specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED;
}
} else {
- cachedSpecs = (Tk_ConfigSpec *) Tcl_GetHashValue(entryPtr);
+ cachedSpecs = Tcl_GetHashValue(entryPtr);
}
return cachedSpecs;
@@ -1159,7 +1157,7 @@ DeleteSpecCacheTable(
ClientData clientData,
Tcl_Interp *interp)
{
- Tcl_HashTable *tablePtr = (Tcl_HashTable *) clientData;
+ Tcl_HashTable *tablePtr = clientData;
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
@@ -1169,10 +1167,10 @@ DeleteSpecCacheTable(
* Someone else deallocates the Tk_Uids themselves.
*/
- ckfree((char *) Tcl_GetHashValue(entryPtr));
+ ckfree(Tcl_GetHashValue(entryPtr));
}
Tcl_DeleteHashTable(tablePtr);
- ckfree((char *) tablePtr);
+ ckfree(tablePtr);
}
/*
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
index cfbce23..b0edf76 100644
--- a/generic/tkOldTest.c
+++ b/generic/tkOldTest.c
@@ -16,6 +16,12 @@
*/
#define USE_OLD_IMAGE
+#ifndef USE_TCL_STUBS
+# define USE_TCL_STUBS
+#endif
+#ifndef USE_TK_STUBS
+# define USE_TK_STUBS
+#endif
#include "tkInt.h"
/*
@@ -67,7 +73,8 @@ static Tk_ImageType imageType = {
ImageFree, /* freeProc */
ImageDelete, /* deleteProc */
NULL, /* postscriptPtr */
- NULL /* nextPtr */
+ NULL, /* nextPtr */
+ NULL
};
/*
@@ -75,8 +82,7 @@ static Tk_ImageType imageType = {
*/
static int ImageCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
-MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
+ Tcl_Interp *interp, int argc, const char **argv);
/*
@@ -142,7 +148,7 @@ ImageCreate(
* will be returned in later callbacks. */
{
TImageMaster *timPtr;
- char *varName;
+ const char *varName;
int i;
varName = "log";
@@ -160,17 +166,17 @@ ImageCreate(
varName = argv[i+1];
}
- timPtr = (TImageMaster *) ckalloc(sizeof(TImageMaster));
+ timPtr = ckalloc(sizeof(TImageMaster));
timPtr->master = master;
timPtr->interp = interp;
timPtr->width = 30;
timPtr->height = 15;
- timPtr->imageName = (char *) ckalloc((unsigned) (strlen(name) + 1));
+ timPtr->imageName = ckalloc((unsigned) (strlen(name) + 1));
strcpy(timPtr->imageName, name);
- timPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1));
+ timPtr->varName = ckalloc((unsigned) (strlen(varName) + 1));
strcpy(timPtr->varName, varName);
- Tcl_CreateCommand(interp, name, ImageCmd, (ClientData) timPtr, NULL);
- *clientDataPtr = (ClientData) timPtr;
+ Tcl_CreateCommand(interp, name, ImageCmd, timPtr, NULL);
+ *clientDataPtr = timPtr;
Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15);
return TCL_OK;
}
@@ -198,14 +204,14 @@ ImageCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
- TImageMaster *timPtr = (TImageMaster *) clientData;
+ TImageMaster *timPtr = clientData;
int x, y, width, height;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], "option ?arg arg ...?", NULL);
+ argv[0], "option ?arg ...?", NULL);
return TCL_ERROR;
}
if (strcmp(argv[1], "changed") == 0) {
@@ -256,7 +262,7 @@ ImageGet(
* used. */
ClientData clientData) /* Pointer to TImageMaster for image. */
{
- TImageMaster *timPtr = (TImageMaster *) clientData;
+ TImageMaster *timPtr = clientData;
TImageInstance *instPtr;
char buffer[100];
XGCValues gcValues;
@@ -265,12 +271,12 @@ ImageGet(
Tcl_SetVar(timPtr->interp, timPtr->varName, buffer,
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
- instPtr = (TImageInstance *) ckalloc(sizeof(TImageInstance));
+ instPtr = ckalloc(sizeof(TImageInstance));
instPtr->masterPtr = timPtr;
instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
gcValues.foreground = instPtr->fg->pixel;
instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
- return (ClientData) instPtr;
+ return instPtr;
}
/*
@@ -303,7 +309,7 @@ ImageDisplay(
/* Coordinates in drawable corresponding to
* imageX and imageY. */
{
- TImageInstance *instPtr = (TImageInstance *) clientData;
+ TImageInstance *instPtr = clientData;
char buffer[200 + TCL_INTEGER_SPACE * 6];
sprintf(buffer, "%s display %d %d %d %d %d %d",
@@ -348,7 +354,7 @@ ImageFree(
ClientData clientData, /* Pointer to TImageInstance for instance. */
Display *display) /* Display where image was to be drawn. */
{
- TImageInstance *instPtr = (TImageInstance *) clientData;
+ TImageInstance *instPtr = clientData;
char buffer[200];
sprintf(buffer, "%s free", instPtr->masterPtr->imageName);
@@ -356,7 +362,7 @@ ImageFree(
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
Tk_FreeColor(instPtr->fg);
Tk_FreeGC(display, instPtr->gc);
- ckfree((char *) instPtr);
+ ckfree(instPtr);
}
/*
@@ -382,7 +388,7 @@ ImageDelete(
* this function is called, no more instances
* exist. */
{
- TImageMaster *timPtr = (TImageMaster *) clientData;
+ TImageMaster *timPtr = clientData;
char buffer[100];
sprintf(buffer, "%s delete", timPtr->imageName);
@@ -392,7 +398,7 @@ ImageDelete(
Tcl_DeleteCommand(timPtr->interp, timPtr->imageName);
ckfree(timPtr->imageName);
ckfree(timPtr->varName);
- ckfree((char *) timPtr);
+ ckfree(timPtr);
}
/*
diff --git a/generic/tkOption.c b/generic/tkOption.c
index de92627..d5c423f 100644
--- a/generic/tkOption.c
+++ b/generic/tkOption.c
@@ -221,9 +221,9 @@ static int GetDefaultOptions(Tcl_Interp *interp,
static ElArray * NewArray(int numEls);
static void OptionThreadExitProc(ClientData clientData);
static void OptionInit(TkMainInfo *mainPtr);
-static int ParsePriority(Tcl_Interp *interp, char *string);
+static int ParsePriority(Tcl_Interp *interp, const char *string);
static int ReadOptionFile(Tcl_Interp *interp, Tk_Window tkwin,
- char *fileName, int priority);
+ const char *fileName, int priority);
static void SetupStacks(TkWindow *winPtr, int leaf);
/*
@@ -246,8 +246,8 @@ void
Tk_AddOption(
Tk_Window tkwin, /* Window token; option will be associated
* with main window for this window. */
- CONST char *name, /* Multi-element name of option. */
- CONST 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 0 and
@@ -257,13 +257,13 @@ Tk_AddOption(
register ElArray **arrayPtrPtr;
register Element *elPtr;
Element newEl;
- register CONST char *p;
- CONST char *field;
+ register const char *p;
+ const char *field;
int count, firstField;
ptrdiff_t length;
#define TMP_SIZE 100
char tmp[TMP_SIZE+1];
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->mainPtr->optionRootPtr == NULL) {
@@ -400,8 +400,8 @@ Tk_Uid
Tk_GetOption(
Tk_Window tkwin, /* Token for window that option is associated
* with. */
- CONST char *name, /* Name of option. */
- CONST char *className) /* Class of option. NULL means there is no
+ 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. */
{
@@ -411,7 +411,7 @@ Tk_GetOption(
register int count;
StackLevel *levelPtr;
int stackDepth[NUM_STACKS];
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -475,16 +475,16 @@ Tk_GetOption(
*/
for (elPtr = tsdPtr->stacks[EXACT_LEAF_NAME]->els,
- count = stackDepth[EXACT_LEAF_NAME]; 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 = stackDepth[WILDCARD_LEAF_NAME]; count > 0;
- elPtr++, count--) {
+ count = stackDepth[WILDCARD_LEAF_NAME]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == nameId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
@@ -494,16 +494,16 @@ Tk_GetOption(
if (className != NULL) {
classId = Tk_GetUid(className);
for (elPtr = tsdPtr->stacks[EXACT_LEAF_CLASS]->els,
- count = stackDepth[EXACT_LEAF_CLASS]; 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 = stackDepth[WILDCARD_LEAF_CLASS]; count > 0;
- elPtr++, count--) {
+ count = stackDepth[WILDCARD_LEAF_CLASS]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == classId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
@@ -523,18 +523,19 @@ Tk_GetOption(
Tk_Uid nodeId, winClassId, winNameId;
unsigned int classNameLength;
register Element *nodePtr, *leafPtr;
- static int searchOrder[] = {
+ static const int searchOrder[] = {
EXACT_NODE_NAME, WILDCARD_NODE_NAME, EXACT_NODE_CLASS,
WILDCARD_NODE_CLASS, -1
};
- int *currentPtr, currentStack, leafCount;
+ const int *currentPtr;
+ int currentStack, leafCount;
/*
* Extract the masquerade class name from the name field.
*/
- classNameLength = (unsigned int)(masqName - name);
- masqClass = (char *) ckalloc(classNameLength + 1);
+ classNameLength = (unsigned) (masqName - name);
+ masqClass = ckalloc(classNameLength + 1);
strncpy(masqClass, name, classNameLength);
masqClass[classNameLength] = '\0';
@@ -612,14 +613,14 @@ Tk_OptionObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of Tcl_Obj arguments. */
- Tcl_Obj *CONST objv[]) /* Tcl_Obj arguments. */
+ Tcl_Obj *const objv[]) /* Tcl_Obj arguments. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
int index, result;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static CONST char *optionCmds[] = {
+ static const char *const optionCmds[] = {
"add", "clear", "get", "readfile", NULL
};
@@ -642,6 +643,7 @@ Tk_OptionObjCmd(
switch ((enum optionVals) index) {
case OPTION_ADD: {
int priority;
+
if ((objc != 4) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "pattern value ?priority?");
return TCL_ERROR;
@@ -691,7 +693,7 @@ Tk_OptionObjCmd(
value = Tk_GetOption(window, Tcl_GetString(objv[3]),
Tcl_GetString(objv[4]));
if (value != NULL) {
- Tcl_SetResult(interp, (char *)value, TCL_STATIC);
+ Tcl_SetResult(interp, (char *) value, TCL_STATIC);
}
break;
}
@@ -741,7 +743,7 @@ void
TkOptionDeadWindow(
register TkWindow *winPtr) /* Window to be cleaned up. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -797,7 +799,7 @@ TkOptionClassChanged(
{
int i, j, *basePtr;
ElArray *arrayPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->optionLevel == -1) {
@@ -852,7 +854,7 @@ TkOptionClassChanged(
static int
ParsePriority(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- char *string) /* Describes a priority level, either
+ const char *string) /* Describes a priority level, either
* symbolically or numerically. */
{
int priority, c;
@@ -928,7 +930,6 @@ AddFromString(
src = string;
lineNum = 1;
while (1) {
-
/*
* Skip leading white space and empty lines and comment lines, and
* check for the end of the spec.
@@ -1065,13 +1066,13 @@ ReadOptionFile(
Tcl_Interp *interp, /* Interpreter to use for reporting results. */
Tk_Window tkwin, /* Token for window: options are entered for
* this window's main window. */
- char *fileName, /* Name of file containing options. */
+ const char *fileName, /* Name of file containing options. */
int priority) /* Priority level to use for options in this
* file, such as TK_USER_DEFAULT_PRIO or
* TK_INTERACTIVE_PRIO. Must be between 0 and
* TK_MAX_PRIO. */
{
- CONST char *realName;
+ const char *realName;
char *buffer;
int result, bufferSize;
Tcl_Channel chan;
@@ -1106,16 +1107,16 @@ ReadOptionFile(
*/
bufferSize = (int) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_END);
- (void) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET);
+ Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET);
if (bufferSize < 0) {
Tcl_AppendResult(interp, "error seeking to end of file \"",
fileName, "\":", Tcl_PosixError(interp), NULL);
Tcl_Close(NULL, chan);
return TCL_ERROR;
-
}
- buffer = (char *) ckalloc((unsigned) bufferSize+1);
+
+ buffer = ckalloc(bufferSize + 1);
bufferSize = Tcl_Read(chan, buffer, bufferSize);
if (bufferSize < 0) {
Tcl_AppendResult(interp, "error reading file \"", fileName, "\":",
@@ -1151,9 +1152,8 @@ static ElArray *
NewArray(
int numEls) /* How many elements of space to allocate. */
{
- register ElArray *arrayPtr;
+ register ElArray *arrayPtr = ckalloc(EL_ARRAY_SIZE(numEls));
- arrayPtr = (ElArray *) ckalloc(EL_ARRAY_SIZE(numEls));
arrayPtr->arraySize = numEls;
arrayPtr->numUsed = 0;
arrayPtr->nextToUse = arrayPtr->els;
@@ -1187,16 +1187,11 @@ ExtendArray(
*/
if (arrayPtr->numUsed >= arrayPtr->arraySize) {
- register ElArray *newPtr;
-
- newPtr = (ElArray *) ckalloc(EL_ARRAY_SIZE(2*arrayPtr->arraySize));
- newPtr->arraySize = 2*arrayPtr->arraySize;
- newPtr->numUsed = arrayPtr->numUsed;
- newPtr->nextToUse = &newPtr->els[newPtr->numUsed];
- memcpy(newPtr->els, arrayPtr->els,
- arrayPtr->arraySize * sizeof(Element));
- ckfree((char *) arrayPtr);
- arrayPtr = newPtr;
+ register int newSize = 2*arrayPtr->arraySize;
+
+ arrayPtr = ckrealloc(arrayPtr, EL_ARRAY_SIZE(newSize));
+ arrayPtr->arraySize = newSize;
+ arrayPtr->nextToUse = &arrayPtr->els[arrayPtr->numUsed];
}
*arrayPtr->nextToUse = *elPtr;
@@ -1231,10 +1226,11 @@ SetupStacks(
* being probed. Zero means this is an
* ancestor of the desired leaf. */
{
- int level, i, *iPtr;
+ int level, i;
+ const int *iPtr;
register StackLevel *levelPtr;
register ElArray *arrayPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1246,7 +1242,7 @@ SetupStacks(
* differently.
*/
- static int searchOrder[] = {WILDCARD_NODE_CLASS, WILDCARD_NODE_NAME,
+ static const int searchOrder[] = {WILDCARD_NODE_CLASS, WILDCARD_NODE_NAME,
EXACT_NODE_CLASS, EXACT_NODE_NAME, -1};
if (winPtr->mainPtr->optionRootPtr == NULL) {
@@ -1311,13 +1307,11 @@ SetupStacks(
*/
if (tsdPtr->curLevel >= tsdPtr->numLevels) {
- StackLevel *newLevels;
-
- newLevels = (StackLevel *) ckalloc((unsigned)
- (tsdPtr->numLevels * 2 * sizeof(StackLevel)));
+ StackLevel *newLevels =
+ ckalloc(tsdPtr->numLevels * 2 * sizeof(StackLevel));
memcpy(newLevels, tsdPtr->levels,
tsdPtr->numLevels * sizeof(StackLevel));
- ckfree((char *) tsdPtr->levels);
+ ckfree(tsdPtr->levels);
tsdPtr->numLevels *= 2;
tsdPtr->levels = newLevels;
}
@@ -1396,7 +1390,7 @@ ExtendStacks(
{
register int count;
register Element *elPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (elPtr = arrayPtr->els, count = arrayPtr->numUsed;
@@ -1429,16 +1423,16 @@ static void
OptionThreadExitProc(
ClientData clientData) /* not used */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->initialized) {
int i;
for (i = 0; i < NUM_STACKS; i++) {
- ckfree((char *) tsdPtr->stacks[i]);
+ ckfree(tsdPtr->stacks[i]);
}
- ckfree((char *) tsdPtr->levels);
+ ckfree(tsdPtr->levels);
tsdPtr->initialized = 0;
}
}
@@ -1467,7 +1461,7 @@ OptionInit(
{
int i;
Tcl_Interp *interp;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Element *defaultMatchPtr = &tsdPtr->defaultMatch;
@@ -1482,8 +1476,7 @@ OptionInit(
tsdPtr->curLevel = -1;
tsdPtr->serial = 0;
- tsdPtr->levels = (StackLevel *)
- ckalloc((unsigned) (5*sizeof(StackLevel)));
+ tsdPtr->levels = ckalloc(5 * sizeof(StackLevel));
for (i = 0; i < NUM_STACKS; i++) {
tsdPtr->stacks[i] = NewArray(10);
tsdPtr->levels[0].bases[i] = 0;
@@ -1503,7 +1496,7 @@ OptionInit(
mainPtr->optionRootPtr = NewArray(20);
interp = Tcl_CreateInterp();
- (void) GetDefaultOptions(interp, mainPtr->winPtr);
+ GetDefaultOptions(interp, mainPtr->winPtr);
Tcl_DeleteInterp(interp);
}
@@ -1539,7 +1532,7 @@ ClearOptionTree(
ClearOptionTree(elPtr->child.arrayPtr);
}
}
- ckfree((char *) arrayPtr);
+ ckfree(arrayPtr);
}
/*
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 47eddd6..b32cc23 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -14,14 +14,14 @@
#include "tkInt.h"
typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side;
-static CONST char *sideNames[] = {
+static const char *const sideNames[] = {
"top", "bottom", "left", "right", NULL
};
-/* For each window that the packer cares about (either because
- * the window is managed by the packer or because the window
- * has slaves that are managed by the packer), there is a
- * structure of the following type:
+/*
+ * For each window that the packer cares about (either because the window is
+ * managed by the packer or because the window has slaves that are managed by
+ * the packer), there is a structure of the following type:
*/
typedef struct Packer {
@@ -32,9 +32,9 @@ typedef struct Packer {
struct Packer *masterPtr; /* Master window within which this window is
* packed (NULL means this window isn't
* managed by the packer). */
- struct Packer *nextPtr; /* Next window packed within same master.
- * List is priority-ordered: first on list
- * gets packed first. */
+ struct Packer *nextPtr; /* Next window packed within same master. List
+ * is priority-ordered: first on list gets
+ * packed first. */
struct Packer *slavePtr; /* First in list of slaves packed inside this
* window (NULL means no packed slaves). */
Side side; /* Side of master against which this window is
@@ -87,6 +87,8 @@ typedef struct Packer {
* size. 0 means if this window is a master then
* Tk will set its requested size to fit the
* needs of its slaves.
+ * ALLOCED_MASTER 1 means that Pack has allocated itself as
+ * geometry master for this window.
*/
#define REQUESTED_REPACK 1
@@ -95,6 +97,7 @@ typedef struct Packer {
#define EXPAND 8
#define OLD_STYLE 16
#define DONT_PROPAGATE 32
+#define ALLOCED_MASTER 64
/*
* The following structure is the official type record for the packer:
@@ -116,11 +119,11 @@ static const Tk_GeomMgr packerType = {
static void ArrangePacking(ClientData clientData);
static int ConfigureSlaves(Tcl_Interp *interp, Tk_Window tkwin,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DestroyPacker(char *memPtr);
static Packer * GetPacker(Tk_Window tkwin);
static int PackAfter(Tcl_Interp *interp, Packer *prevPtr,
- Packer *masterPtr, int objc,Tcl_Obj *CONST objv[]);
+ Packer *masterPtr, int objc,Tcl_Obj *const objv[]);
static void PackStructureProc(ClientData clientData,
XEvent *eventPtr);
static void Unlink(Packer *packPtr);
@@ -128,7 +131,7 @@ static int XExpansion(Packer *slavePtr, int cavityWidth);
static int YExpansion(Packer *slavePtr, int cavityHeight);
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* TkPrintPadAmount --
*
@@ -142,14 +145,14 @@ static int YExpansion(Packer *slavePtr, int cavityHeight);
* Side effects:
* None.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
void
TkPrintPadAmount(
Tcl_Interp *interp, /* The interpreter into which the result is
* written. */
- char *switchName, /* One of "padx", "pady", "ipadx" or "ipady" */
+ const char *switchName, /* One of "padx", "pady", "ipadx" or "ipady" */
int halfSpace, /* The left or top padding amount */
int allSpace) /* The total amount of padding */
{
@@ -164,7 +167,7 @@ TkPrintPadAmount(
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* Tk_PackCmd --
*
@@ -177,7 +180,7 @@ TkPrintPadAmount(
* Side effects:
* See the user documentation.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
int
@@ -185,11 +188,11 @@ Tk_PackObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
- char *argv2;
- static CONST char *optionStrings[] = {
+ Tk_Window tkwin = clientData;
+ const char *argv2;
+ static const char *const optionStrings[] = {
/* after, append, before and unpack are deprecated */
"after", "append", "before", "unpack",
"configure", "forget", "info", "propagate", "slaves", NULL };
@@ -199,7 +202,8 @@ Tk_PackObjCmd(
int index;
if (objc >= 2) {
- char *string = Tcl_GetString(objv[1]);
+ const char *string = Tcl_GetString(objv[1]);
+
if (string[0] == '.') {
return ConfigureSlaves(interp, tkwin, objc-1, objv+1);
}
@@ -305,8 +309,7 @@ Tk_PackObjCmd(
}
slavePtr = GetPacker(slave);
if ((slavePtr != NULL) && (slavePtr->masterPtr != NULL)) {
- Tk_ManageGeometry(slave, NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(slave, NULL, NULL);
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
Tk_UnmaintainGeometry(slavePtr->tkwin,
slavePtr->masterPtr->tkwin);
@@ -383,6 +386,16 @@ Tk_PackObjCmd(
return TCL_ERROR;
}
if (propagate) {
+ /*
+ * If we have slaves, we need to register as geometry master.
+ */
+
+ if (masterPtr->slavePtr != NULL) {
+ if (TkSetGeometryMaster(interp, master, "pack") != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr->flags |= ALLOCED_MASTER;
+ }
masterPtr->flags &= ~DONT_PROPAGATE;
/*
@@ -395,9 +408,13 @@ Tk_PackObjCmd(
}
if (!(masterPtr->flags & REQUESTED_REPACK)) {
masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, masterPtr);
}
} else {
+ if (masterPtr->flags & ALLOCED_MASTER) {
+ TkFreeGeometryMaster(master, "pack");
+ masterPtr->flags &= ~ALLOCED_MASTER;
+ }
masterPtr->flags |= DONT_PROPAGATE;
}
break;
@@ -405,6 +422,7 @@ Tk_PackObjCmd(
case PACK_SLAVES: {
Tk_Window master;
Packer *masterPtr, *slavePtr;
+ Tcl_Obj *resultObj;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
@@ -413,11 +431,14 @@ Tk_PackObjCmd(
if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
return TCL_ERROR;
}
+ resultObj = Tcl_NewObj();
masterPtr = GetPacker(master);
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
- Tcl_AppendElement(interp, Tk_PathName(slavePtr->tkwin));
+ Tcl_ListObjAppendElement(NULL, resultObj,
+ TkNewWindowObj(slavePtr->tkwin));
}
+ Tcl_SetObjResult(interp, resultObj);
break;
}
case PACK_UNPACK: {
@@ -433,8 +454,7 @@ Tk_PackObjCmd(
}
packPtr = GetPacker(tkwin2);
if ((packPtr != NULL) && (packPtr->masterPtr != NULL)) {
- Tk_ManageGeometry(tkwin2, NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(tkwin2, NULL, NULL);
if (packPtr->masterPtr->tkwin != Tk_Parent(packPtr->tkwin)) {
Tk_UnmaintainGeometry(packPtr->tkwin,
packPtr->masterPtr->tkwin);
@@ -450,7 +470,7 @@ Tk_PackObjCmd(
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* PackReqProc --
*
@@ -464,7 +484,7 @@ Tk_PackObjCmd(
* Arranges for tkwin, and all its managed siblings, to be re-packed at
* the next idle point.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -475,17 +495,17 @@ PackReqProc(
Tk_Window tkwin) /* Other Tk-related information about the
* window. */
{
- register Packer *packPtr = (Packer *) clientData;
+ register Packer *packPtr = clientData;
packPtr = packPtr->masterPtr;
if (!(packPtr->flags & REQUESTED_REPACK)) {
packPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr);
+ Tcl_DoWhenIdle(ArrangePacking, packPtr);
}
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* PackLostSlaveProc --
*
@@ -498,7 +518,7 @@ PackReqProc(
* Side effects:
* Forgets all packer-related information about the slave.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -508,7 +528,7 @@ PackLostSlaveProc(
* stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- register Packer *slavePtr = (Packer *) clientData;
+ register Packer *slavePtr = clientData;
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin);
@@ -518,7 +538,7 @@ PackLostSlaveProc(
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* ArrangePacking --
*
@@ -533,7 +553,7 @@ PackLostSlaveProc(
* Side effects:
* The packed slaves of masterPtr may get resized or moved.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
static void
@@ -541,7 +561,7 @@ ArrangePacking(
ClientData clientData) /* Structure describing master whose slaves
* are to be re-layed out. */
{
- register Packer *masterPtr = (Packer *) clientData;
+ register Packer *masterPtr = clientData;
register Packer *slavePtr;
int cavityX, cavityY, cavityWidth, cavityHeight;
/* These variables keep track of the
@@ -581,7 +601,7 @@ ArrangePacking(
}
masterPtr->abortPtr = &abort;
abort = 0;
- Tcl_Preserve((ClientData) masterPtr);
+ Tcl_Preserve(masterPtr);
/*
* Pass #1: scan all the slaves to figure out the total amount of space
@@ -650,7 +670,7 @@ ArrangePacking(
&& !(masterPtr->flags & DONT_PROPAGATE)) {
Tk_GeometryRequest(masterPtr->tkwin, maxWidth, maxHeight);
masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, masterPtr);
goto done;
}
@@ -841,7 +861,7 @@ ArrangePacking(
done:
masterPtr->abortPtr = NULL;
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
}
/*
@@ -888,9 +908,11 @@ XExpansion(
childWidth = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
+ slavePtr->padX + slavePtr->iPadX;
if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
- curExpand = (cavityWidth - childWidth)/numExpand;
- if (curExpand < minExpand) {
- minExpand = curExpand;
+ if (numExpand) {
+ curExpand = (cavityWidth - childWidth)/numExpand;
+ if (curExpand < minExpand) {
+ minExpand = curExpand;
+ }
}
} else {
cavityWidth -= childWidth;
@@ -899,9 +921,11 @@ XExpansion(
}
}
}
- curExpand = cavityWidth/numExpand;
- if (curExpand < minExpand) {
- minExpand = curExpand;
+ if (numExpand) {
+ curExpand = cavityWidth/numExpand;
+ if (curExpand < minExpand) {
+ minExpand = curExpand;
+ }
}
return (minExpand < 0) ? 0 : minExpand;
}
@@ -943,9 +967,11 @@ YExpansion(
childHeight = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->doubleBw
+ slavePtr->padY + slavePtr->iPadY;
if ((slavePtr->side == LEFT) || (slavePtr->side == RIGHT)) {
- curExpand = (cavityHeight - childHeight)/numExpand;
- if (curExpand < minExpand) {
- minExpand = curExpand;
+ if (numExpand) {
+ curExpand = (cavityHeight - childHeight)/numExpand;
+ if (curExpand < minExpand) {
+ minExpand = curExpand;
+ }
}
} else {
cavityHeight -= childHeight;
@@ -954,15 +980,17 @@ YExpansion(
}
}
}
- curExpand = cavityHeight/numExpand;
- if (curExpand < minExpand) {
- minExpand = curExpand;
+ if (numExpand) {
+ curExpand = cavityHeight/numExpand;
+ if (curExpand < minExpand) {
+ minExpand = curExpand;
+ }
}
return (minExpand < 0) ? 0 : minExpand;
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* GetPacker --
*
@@ -977,7 +1005,7 @@ YExpansion(
* A new packer structure may be created. If so, then a callback is set
* up to clean things up when the window is deleted.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
static Packer *
@@ -1003,9 +1031,9 @@ GetPacker(
hPtr = Tcl_CreateHashEntry(&dispPtr->packerHashTable, (char *) tkwin,
&isNew);
if (!isNew) {
- return (Packer *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
- packPtr = (Packer *) ckalloc(sizeof(Packer));
+ packPtr = ckalloc(sizeof(Packer));
packPtr->tkwin = tkwin;
packPtr->masterPtr = NULL;
packPtr->nextPtr = NULL;
@@ -1020,12 +1048,12 @@ GetPacker(
packPtr->flags = 0;
Tcl_SetHashValue(hPtr, packPtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask,
- PackStructureProc, (ClientData) packPtr);
+ PackStructureProc, packPtr);
return packPtr;
}
/*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*
* PackAfter --
*
@@ -1039,7 +1067,7 @@ GetPacker(
* The geometry of the specified windows may change, both now and again
* in the future.
*
- *--------------------------------------------------------------
+ *------------------------------------------------------------------------
*/
static int
@@ -1050,7 +1078,7 @@ PackAfter(
* masterPtr. */
Packer *masterPtr, /* Master in which to pack windows. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]) /* Array of lists, each containing 2 elements:
+ Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements:
* window name and side against which to
* pack. */
{
@@ -1122,7 +1150,7 @@ PackAfter(
packPtr->flags |= OLD_STYLE;
for (index = 0 ; index < optionCount; index++) {
Tcl_Obj *curOptPtr = options[index];
- char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length);
+ const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length);
c = curOpt[0];
@@ -1225,7 +1253,17 @@ PackAfter(
packPtr->nextPtr = prevPtr->nextPtr;
prevPtr->nextPtr = packPtr;
}
- Tk_ManageGeometry(tkwin, &packerType, (ClientData) packPtr);
+ Tk_ManageGeometry(tkwin, &packerType, packPtr);
+
+ if (!(masterPtr->flags & DONT_PROPAGATE)) {
+ if (TkSetGeometryMaster(interp, masterPtr->tkwin, "pack")
+ != TCL_OK) {
+ Tk_ManageGeometry(tkwin, NULL, NULL);
+ Unlink(packPtr);
+ return TCL_ERROR;
+ }
+ masterPtr->flags |= ALLOCED_MASTER;
+ }
}
}
@@ -1238,7 +1276,7 @@ PackAfter(
}
if (!(masterPtr->flags & REQUESTED_REPACK)) {
masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, masterPtr);
}
return TCL_OK;
}
@@ -1284,13 +1322,24 @@ Unlink(
}
if (!(masterPtr->flags & REQUESTED_REPACK)) {
masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, masterPtr);
}
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
}
packPtr->masterPtr = NULL;
+
+ /*
+ * If we have emptied this master from slaves it means we are no longer
+ * handling it and should mark it as free.
+ */
+
+ if (masterPtr->slavePtr == NULL && masterPtr->flags & ALLOCED_MASTER) {
+ TkFreeGeometryMaster(masterPtr->tkwin, "pack");
+ masterPtr->flags &= ~ALLOCED_MASTER;
+ }
+
}
/*
@@ -1317,7 +1366,8 @@ DestroyPacker(
* dead. */
{
register Packer *packPtr = (Packer *) memPtr;
- ckfree((char *) packPtr);
+
+ ckfree(packPtr);
}
/*
@@ -1344,20 +1394,20 @@ PackStructureProc(
* eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- register Packer *packPtr = (Packer *) clientData;
+ register Packer *packPtr = clientData;
if (eventPtr->type == ConfigureNotify) {
if ((packPtr->slavePtr != NULL)
&& !(packPtr->flags & REQUESTED_REPACK)) {
packPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr);
+ Tcl_DoWhenIdle(ArrangePacking, packPtr);
}
if ((packPtr->masterPtr != NULL)
&& (packPtr->doubleBw != 2*Tk_Changes(packPtr->tkwin)->border_width)) {
if (!(packPtr->masterPtr->flags & REQUESTED_REPACK)) {
packPtr->doubleBw = 2*Tk_Changes(packPtr->tkwin)->border_width;
packPtr->masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr->masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, packPtr->masterPtr);
}
}
} else if (eventPtr->type == DestroyNotify) {
@@ -1369,8 +1419,7 @@ PackStructureProc(
for (slavePtr = packPtr->slavePtr; slavePtr != NULL;
slavePtr = nextPtr) {
- Tk_ManageGeometry(slavePtr->tkwin, NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(slavePtr->tkwin, NULL, NULL);
Tk_UnmapWindow(slavePtr->tkwin);
slavePtr->masterPtr = NULL;
nextPtr = slavePtr->nextPtr;
@@ -1384,10 +1433,10 @@ PackStructureProc(
}
if (packPtr->flags & REQUESTED_REPACK) {
- Tcl_CancelIdleCall(ArrangePacking, (ClientData) packPtr);
+ Tcl_CancelIdleCall(ArrangePacking, packPtr);
}
packPtr->tkwin = NULL;
- Tcl_EventuallyFree((ClientData) packPtr, DestroyPacker);
+ Tcl_EventuallyFree(packPtr, DestroyPacker);
} else if (eventPtr->type == MapNotify) {
/*
* When a master gets mapped, must redo the geometry computation so
@@ -1397,7 +1446,7 @@ PackStructureProc(
if ((packPtr->slavePtr != NULL)
&& !(packPtr->flags & REQUESTED_REPACK)) {
packPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr);
+ Tcl_DoWhenIdle(ArrangePacking, packPtr);
}
} else if (eventPtr->type == UnmapNotify) {
register Packer *packPtr2;
@@ -1439,7 +1488,7 @@ ConfigureSlaves(
Tk_Window tkwin, /* Any window in application containing
* slaves. Used to look up slave names. */
int objc, /* Number of elements in argv. */
- Tcl_Obj *CONST objv[]) /* Argument objects: contains one or more
+ 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 window name. */
@@ -1447,8 +1496,8 @@ ConfigureSlaves(
Packer *masterPtr, *slavePtr, *prevPtr, *otherPtr;
Tk_Window other, slave, parent, ancestor;
int i, j, numWindows, tmp, positionGiven;
- char *string;
- static CONST char *optionStrings[] = {
+ const char *string;
+ static const char *const optionStrings[] = {
"-after", "-anchor", "-before", "-expand", "-fill",
"-in", "-ipadx", "-ipady", "-padx", "-pady", "-side", NULL };
enum options {
@@ -1530,8 +1579,8 @@ ConfigureSlaves(
if (prevPtr->masterPtr == NULL) {
notPacked:
Tcl_AppendResult(interp, "window \"",
- Tcl_GetString(objv[i+1]),
- "\" isn't packed", NULL);
+ Tcl_GetString(objv[i+1]), "\" isn't packed",
+ NULL);
return TCL_ERROR;
}
masterPtr = prevPtr->masterPtr;
@@ -1728,6 +1777,7 @@ ConfigureSlaves(
}
Unlink(slavePtr);
}
+
slavePtr->masterPtr = masterPtr;
if (prevPtr == NULL) {
slavePtr->nextPtr = masterPtr->slavePtr;
@@ -1736,9 +1786,19 @@ ConfigureSlaves(
slavePtr->nextPtr = prevPtr->nextPtr;
prevPtr->nextPtr = slavePtr;
}
- Tk_ManageGeometry(slave, &packerType, (ClientData) slavePtr);
+ Tk_ManageGeometry(slave, &packerType, slavePtr);
prevPtr = slavePtr;
+ if (!(masterPtr->flags & DONT_PROPAGATE)) {
+ if (TkSetGeometryMaster(interp, masterPtr->tkwin, "pack")
+ != TCL_OK) {
+ Tk_ManageGeometry(slave, NULL, NULL);
+ Unlink(slavePtr);
+ return TCL_ERROR;
+ }
+ masterPtr->flags |= ALLOCED_MASTER;
+ }
+
/*
* Arrange for the master to be re-packed at the first idle moment.
*/
@@ -1749,7 +1809,7 @@ ConfigureSlaves(
}
if (!(masterPtr->flags & REQUESTED_REPACK)) {
masterPtr->flags |= REQUESTED_REPACK;
- Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(ArrangePacking, masterPtr);
}
}
return TCL_OK;
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 68d62d7..34f91b7 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -35,7 +35,7 @@
* The following table defines the legal values for the -orient option.
*/
-static char *orientStrings[] = {
+static const char *const orientStrings[] = {
"horizontal", "vertical", NULL
};
@@ -45,7 +45,7 @@ enum orient { ORIENT_HORIZONTAL, ORIENT_VERTICAL };
* The following table defines the legal values for the -stretch option.
*/
-static char *stretchStrings[] = {
+static const char *const stretchStrings[] = {
"always", "first", "last", "middle", "never", NULL
};
@@ -181,11 +181,11 @@ typedef struct PanedWindow {
int Tk_PanedWindowObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void PanedWindowCmdDeletedProc(ClientData clientData);
static int ConfigurePanedWindow(Tcl_Interp *interp,
PanedWindow *pwPtr, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void DestroyPanedWindow(PanedWindow *pwPtr);
static void DisplayPanedWindow(ClientData clientData);
static void PanedWindowEventProc(ClientData clientData,
@@ -195,7 +195,7 @@ static void ProxyWindowEventProc(ClientData clientData,
static void DisplayProxyWindow(ClientData clientData);
static void PanedWindowWorldChanged(ClientData instanceData);
static int PanedWindowWidgetObjCmd(ClientData clientData,
- Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]);
+ Tcl_Interp *, int objc, Tcl_Obj * const objv[]);
static void PanedWindowLostSlaveProc(ClientData clientData,
Tk_Window tkwin);
static void PanedWindowReqProc(ClientData clientData,
@@ -207,14 +207,14 @@ static void SlaveStructureProc(ClientData clientData,
XEvent *eventPtr);
static int PanedWindowSashCommand(PanedWindow *pwPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int PanedWindowProxyCommand(PanedWindow *pwPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static void ComputeGeometry(PanedWindow *pwPtr);
static int ConfigureSlaves(PanedWindow *pwPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static void DestroyOptionTables(ClientData clientData,
Tcl_Interp *interp);
static int SetSticky(ClientData clientData, Tcl_Interp *interp,
@@ -258,7 +258,7 @@ static const Tk_GeomMgr panedWindowMgrType = {
* the custom "-sticky" option for slave windows.
*/
-static Tk_ObjCustomOption stickyOption = {
+static const Tk_ObjCustomOption stickyOption = {
"sticky", /* name */
SetSticky, /* setProc */
GetSticky, /* getProc */
@@ -270,11 +270,11 @@ static Tk_ObjCustomOption stickyOption = {
static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0,
- (ClientData) DEF_PANEDWINDOW_BG_MONO},
+ (ClientData) DEF_PANEDWINDOW_BG_MONO, 0},
{TK_OPTION_SYNONYM, "-bd", NULL, NULL,
- NULL, 0, -1, 0, (ClientData) "-borderwidth"},
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
{TK_OPTION_SYNONYM, "-bg", NULL, NULL,
- NULL, 0, -1, 0, (ClientData) "-background"},
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth),
0, 0, GEOMETRY},
@@ -316,7 +316,7 @@ static const Tk_OptionSpec optionSpecs[] = {
{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}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
static const Tk_OptionSpec slaveOptionSpecs[] = {
@@ -346,7 +346,7 @@ static const Tk_OptionSpec slaveOptionSpecs[] = {
{TK_OPTION_PIXELS, "-width", NULL, NULL,
DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Slave, widthPtr),
Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
/*
@@ -371,7 +371,7 @@ Tk_PanedWindowObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj * CONST objv[]) /* Argument objects. */
+ Tcl_Obj * const objv[]) /* Argument objects. */
{
PanedWindow *pwPtr;
Tk_Window tkwin, parent;
@@ -379,7 +379,7 @@ Tk_PanedWindowObjCmd(
XSetWindowAttributes atts;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -399,14 +399,14 @@ Tk_PanedWindowObjCmd(
* easy access to it in the future.
*/
- pwOpts = (OptionTables *) ckalloc(sizeof(OptionTables));
+ pwOpts = ckalloc(sizeof(OptionTables));
/*
* Set up an exit handler to free the optionTables struct.
*/
Tcl_SetAssocData(interp, "PanedWindowOptionTables",
- DestroyOptionTables, (ClientData) pwOpts);
+ DestroyOptionTables, pwOpts);
/*
* Create the paned window option tables.
@@ -422,14 +422,14 @@ Tk_PanedWindowObjCmd(
* Allocate and initialize the widget record.
*/
- pwPtr = (PanedWindow *) ckalloc(sizeof(PanedWindow));
+ pwPtr = 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);
+ Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd, pwPtr,
+ PanedWindowCmdDeletedProc);
pwPtr->optionTable = pwOpts->pwOptions;
pwPtr->slaveOpts = pwOpts->slaveOpts;
pwPtr->relief = TK_RELIEF_RAISED;
@@ -442,7 +442,7 @@ Tk_PanedWindowObjCmd(
* otherwise Tk might free it while we still need it.
*/
- Tcl_Preserve((ClientData) pwPtr->tkwin);
+ Tcl_Preserve(pwPtr->tkwin);
if (Tk_InitOptions(interp, (char *) pwPtr, pwOpts->pwOptions,
tkwin) != TCL_OK) {
@@ -451,7 +451,7 @@ Tk_PanedWindowObjCmd(
}
Tk_CreateEventHandler(pwPtr->tkwin, ExposureMask|StructureNotifyMask,
- PanedWindowEventProc, (ClientData) pwPtr);
+ PanedWindowEventProc, pwPtr);
/*
* Find the toplevel ancestor of the panedwindow, and make a proxy win as
@@ -481,7 +481,7 @@ Tk_PanedWindowObjCmd(
Tk_SetWindowVisual(pwPtr->proxywin,
Tk_Visual(tkwin), Tk_Depth(tkwin), Tk_Colormap(tkwin));
Tk_CreateEventHandler(pwPtr->proxywin, ExposureMask, ProxyWindowEventProc,
- (ClientData) pwPtr);
+ pwPtr);
atts.save_under = True;
Tk_ChangeWindowAttributes(pwPtr->proxywin, CWSaveUnder, &atts);
@@ -491,7 +491,7 @@ Tk_PanedWindowObjCmd(
return TCL_ERROR;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(pwPtr->tkwin), -1);
+ Tcl_SetObjResult(interp, TkNewWindowObj(pwPtr->tkwin));
return TCL_OK;
}
@@ -518,11 +518,11 @@ PanedWindowWidgetObjCmd(
ClientData clientData, /* Information about square widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj * CONST objv[]) /* Argument objects. */
+ Tcl_Obj * const objv[]) /* Argument objects. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
int result = TCL_OK;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"add", "cget", "configure", "forget", "identify", "panecget",
"paneconfigure", "panes", "proxy", "sash", NULL
};
@@ -545,7 +545,7 @@ PanedWindowWidgetObjCmd(
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) pwPtr);
+ Tcl_Preserve(pwPtr);
switch ((enum options) index) {
case PW_ADD:
@@ -603,16 +603,17 @@ PanedWindowWidgetObjCmd(
for (count = 0, i = 2; i < objc; i++) {
Tk_Window 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, NULL, (ClientData)NULL);
+ Tk_ManageGeometry(slave, NULL, NULL);
Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin);
Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask,
- SlaveStructureProc, (ClientData) slavePtr);
+ SlaveStructureProc, slavePtr);
Tk_UnmapWindow(slavePtr->tkwin);
Unlink(slavePtr);
}
@@ -718,7 +719,7 @@ PanedWindowWidgetObjCmd(
result = PanedWindowSashCommand(pwPtr, interp, objc, objv);
break;
}
- Tcl_Release((ClientData) pwPtr);
+ Tcl_Release(pwPtr);
return result;
}
@@ -744,14 +745,14 @@ ConfigureSlaves(
PanedWindow *pwPtr, /* Information about paned window. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ 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, **newSlaves;
Slave options;
- char *arg;
+ const char *arg;
/*
* Find the non-window name arguments; these are the configure options for
@@ -875,7 +876,7 @@ ConfigureSlaves(
* structures may already have existed, some may be new.
*/
- inserts = (Slave **)ckalloc(sizeof(Slave *) * (firstOptionArg - 2));
+ inserts = ckalloc(sizeof(Slave *) * (firstOptionArg - 2));
insertIndex = 0;
/*
@@ -942,7 +943,7 @@ ConfigureSlaves(
* out with their "natural" dimensions.
*/
- slavePtr = (Slave *) ckalloc(sizeof(Slave));
+ slavePtr = ckalloc(sizeof(Slave));
memset(slavePtr, 0, sizeof(Slave));
Tk_InitOptions(interp, (char *)slavePtr, pwPtr->slaveOpts,
pwPtr->tkwin);
@@ -971,9 +972,8 @@ ConfigureSlaves(
*/
Tk_CreateEventHandler(slavePtr->tkwin, StructureNotifyMask,
- SlaveStructureProc, (ClientData) slavePtr);
- Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType,
- (ClientData) slavePtr);
+ SlaveStructureProc, slavePtr);
+ Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType, slavePtr);
inserts[insertIndex++] = slavePtr;
numNewSlaves++;
}
@@ -982,8 +982,8 @@ ConfigureSlaves(
* Allocate the new slaves array, then copy the slaves into it, in order.
*/
- i = sizeof(Slave *) * (pwPtr->numSlaves+numNewSlaves);
- newSlaves = (Slave **)ckalloc((unsigned) i);
+ i = sizeof(Slave *) * (pwPtr->numSlaves + numNewSlaves);
+ newSlaves = ckalloc(i);
memset(newSlaves, 0, (size_t) i);
if (index == -1) {
/*
@@ -1026,8 +1026,8 @@ ConfigureSlaves(
* Make the new slaves array the paned window's slave array, and clean up.
*/
- ckfree((void *)pwPtr->slaves);
- ckfree((void *)inserts);
+ ckfree(pwPtr->slaves);
+ ckfree(inserts);
pwPtr->slaves = newSlaves;
/*
@@ -1064,9 +1064,9 @@ PanedWindowSashCommand(
PanedWindow *pwPtr, /* Pointer to paned window information. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *sashOptionStrings[] = {
+ static const char *const sashOptionStrings[] = {
"coord", "dragto", "mark", "place", NULL
};
enum sashOptions {
@@ -1107,7 +1107,7 @@ PanedWindowSashCommand(
coords[0] = Tcl_NewIntObj(slavePtr->sashx);
coords[1] = Tcl_NewIntObj(slavePtr->sashy);
- Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords));
break;
case SASH_MARK:
@@ -1140,7 +1140,7 @@ PanedWindowSashCommand(
} else {
coords[0] = Tcl_NewIntObj(pwPtr->slaves[sash]->markx);
coords[1] = Tcl_NewIntObj(pwPtr->slaves[sash]->marky);
- Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords));
}
break;
@@ -1215,7 +1215,7 @@ ConfigurePanedWindow(
Tcl_Interp *interp, /* Used for error reporting. */
PanedWindow *pwPtr, /* Information about widget. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
int typemask = 0;
@@ -1228,7 +1228,7 @@ ConfigurePanedWindow(
Tk_FreeSavedOptions(&savedOptions);
- PanedWindowWorldChanged((ClientData) pwPtr);
+ PanedWindowWorldChanged(pwPtr);
/*
* If an option that affects geometry has changed, make a re-layout
@@ -1266,7 +1266,7 @@ PanedWindowWorldChanged(
{
XGCValues gcValues;
GC newGC;
- PanedWindow *pwPtr = (PanedWindow *) instanceData;
+ PanedWindow *pwPtr = instanceData;
/*
* Allocated a graphics context for drawing the paned window widget
@@ -1295,7 +1295,7 @@ PanedWindowWorldChanged(
*/
if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr);
pwPtr->flags |= REDRAW_PENDING;
}
}
@@ -1323,17 +1323,17 @@ PanedWindowEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
if (eventPtr->type == Expose) {
if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ Tcl_DoWhenIdle(DisplayPanedWindow, 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);
+ Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr);
pwPtr->flags |= REDRAW_PENDING;
}
} else if (eventPtr->type == DestroyNotify) {
@@ -1363,7 +1363,7 @@ static void
PanedWindowCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
/*
* This function could be invoked either because the window was destroyed
@@ -1400,7 +1400,7 @@ static void
DisplayPanedWindow(
ClientData clientData) /* Information about window. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
Slave *slavePtr;
Pixmap pixmap;
Tk_Window tkwin = pwPtr->tkwin;
@@ -1518,10 +1518,10 @@ DestroyPanedWindow(
*/
if (pwPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayPanedWindow, (ClientData) pwPtr);
+ Tcl_CancelIdleCall(DisplayPanedWindow, pwPtr);
}
if (pwPtr->flags & RESIZE_PENDING) {
- Tcl_CancelIdleCall(ArrangePanes, (ClientData) pwPtr);
+ Tcl_CancelIdleCall(ArrangePanes, pwPtr);
}
/*
@@ -1533,15 +1533,15 @@ DestroyPanedWindow(
for (i = 0; i < pwPtr->numSlaves; i++) {
Tk_DeleteEventHandler(pwPtr->slaves[i]->tkwin, StructureNotifyMask,
- SlaveStructureProc, (ClientData) pwPtr->slaves[i]);
+ SlaveStructureProc, pwPtr->slaves[i]);
Tk_ManageGeometry(pwPtr->slaves[i]->tkwin, NULL, NULL);
- Tk_FreeConfigOptions((char *)pwPtr->slaves[i], pwPtr->slaveOpts,
+ Tk_FreeConfigOptions((char *) pwPtr->slaves[i], pwPtr->slaveOpts,
pwPtr->tkwin);
- ckfree((void *)pwPtr->slaves[i]);
+ ckfree(pwPtr->slaves[i]);
pwPtr->slaves[i] = NULL;
}
if (pwPtr->slaves) {
- ckfree((char *) pwPtr->slaves);
+ ckfree(pwPtr->slaves);
}
/*
@@ -1555,10 +1555,10 @@ DestroyPanedWindow(
*/
Tk_FreeConfigOptions((char *) pwPtr, pwPtr->optionTable, pwPtr->tkwin);
- Tcl_Release((ClientData) pwPtr->tkwin);
+ Tcl_Release(pwPtr->tkwin);
pwPtr->tkwin = NULL;
- Tcl_EventuallyFree((ClientData) pwPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(pwPtr, TCL_DYNAMIC);
}
/*
@@ -1586,12 +1586,13 @@ PanedWindowReqProc(
Tk_Window tkwin) /* Other Tk-related information about the
* window. */
{
- Slave *slavePtr = (Slave *) clientData;
- PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr);
+ Slave *slavePtr = clientData;
+ PanedWindow *pwPtr = (PanedWindow *) slavePtr->masterPtr;
+
if (Tk_IsMapped(pwPtr->tkwin)) {
if (!(pwPtr->flags & RESIZE_PENDING)) {
pwPtr->flags |= RESIZE_PENDING;
- Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
+ Tcl_DoWhenIdle(ArrangePanes, pwPtr);
}
} else {
int doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width;
@@ -1630,18 +1631,18 @@ PanedWindowLostSlaveProc(
* stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- register Slave *slavePtr = (Slave *) clientData;
- PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr);
+ register Slave *slavePtr = 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);
+ SlaveStructureProc, slavePtr);
Tk_UnmapWindow(slavePtr->tkwin);
slavePtr->tkwin = NULL;
- ckfree((void *)slavePtr);
+ ckfree(slavePtr);
ComputeGeometry(pwPtr);
}
@@ -1669,7 +1670,7 @@ ArrangePanes(
ClientData clientData) /* Structure describing parent whose slaves
* are to be re-layed out. */
{
- register PanedWindow *pwPtr = (PanedWindow *) clientData;
+ register PanedWindow *pwPtr = clientData;
register Slave *slavePtr;
int i, slaveWidth, slaveHeight, slaveX, slaveY;
int paneWidth, paneHeight, paneSize, paneMinSize;
@@ -1696,7 +1697,7 @@ ArrangePanes(
return;
}
- Tcl_Preserve((ClientData) pwPtr);
+ Tcl_Preserve(pwPtr);
/*
* Find index of last visible pane.
@@ -1939,7 +1940,7 @@ ArrangePanes(
}
sashCount--;
}
- Tcl_Release((ClientData) pwPtr);
+ Tcl_Release(pwPtr);
}
/*
@@ -2000,7 +2001,7 @@ Unlink(
masterPtr->flags |= REQUESTED_RELAYOUT;
if (!(masterPtr->flags & REDRAW_PENDING)) {
masterPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(DisplayPanedWindow, masterPtr);
}
/*
@@ -2071,13 +2072,13 @@ SlaveStructureProc(
ClientData clientData, /* Pointer to record describing window item. */
XEvent *eventPtr) /* Describes what just happened. */
{
- Slave *slavePtr = (Slave *) clientData;
+ Slave *slavePtr = clientData;
PanedWindow *pwPtr = slavePtr->masterPtr;
if (eventPtr->type == DestroyNotify) {
Unlink(slavePtr);
slavePtr->tkwin = NULL;
- ckfree((void *)slavePtr);
+ ckfree(slavePtr);
ComputeGeometry(pwPtr);
}
}
@@ -2256,7 +2257,7 @@ ComputeGeometry(
Tk_GeometryRequest(pwPtr->tkwin, reqWidth, reqHeight);
if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) {
pwPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr);
}
}
@@ -2283,8 +2284,7 @@ DestroyOptionTables(
ClientData clientData, /* Pointer to the OptionTables struct */
Tcl_Interp *interp) /* Pointer to the calling interp */
{
- ckfree((char *)clientData);
- return;
+ ckfree(clientData);
}
/*
@@ -2313,22 +2313,22 @@ GetSticky(
* sticky value. */
{
int sticky = *(int *)(recordPtr + internalOffset);
- static char buffer[5];
- int count = 0;
+ char buffer[5];
+ char *p = &buffer[0];
if (sticky & STICK_NORTH) {
- buffer[count++] = 'n';
+ *p++ = 'n';
}
if (sticky & STICK_EAST) {
- buffer[count++] = 'e';
+ *p++ = 'e';
}
if (sticky & STICK_SOUTH) {
- buffer[count++] = 's';
+ *p++ = 's';
}
if (sticky & STICK_WEST) {
- buffer[count++] = 'w';
+ *p++ = 'w';
}
- buffer[count] = '\0';
+ *p = '\0';
return Tcl_NewStringObj(buffer, -1);
}
@@ -2367,7 +2367,8 @@ SetSticky(
int flags) /* Flags for the option, set Tk_SetOptions. */
{
int sticky = 0;
- char c, *string, *internalPtr;
+ char c, *internalPtr;
+ const char *string;
internalPtr = ComputeSlotAddress(recordPtr, internalOffset);
@@ -2664,11 +2665,11 @@ ProxyWindowEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
if (eventPtr->type == Expose) {
if (pwPtr->proxywin != NULL &&!(pwPtr->flags & PROXY_REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayProxyWindow, (ClientData) pwPtr);
+ Tcl_DoWhenIdle(DisplayProxyWindow, pwPtr);
pwPtr->flags |= PROXY_REDRAW_PENDING;
}
}
@@ -2696,7 +2697,7 @@ static void
DisplayProxyWindow(
ClientData clientData) /* Information about window. */
{
- PanedWindow *pwPtr = (PanedWindow *) clientData;
+ PanedWindow *pwPtr = clientData;
Pixmap pixmap;
Tk_Window tkwin = pwPtr->proxywin;
pwPtr->flags &= ~PROXY_REDRAW_PENDING;
@@ -2755,9 +2756,9 @@ PanedWindowProxyCommand(
PanedWindow *pwPtr, /* Pointer to paned window information. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"coord", "forget", "place", NULL
};
enum options {
@@ -2785,7 +2786,7 @@ PanedWindowProxyCommand(
coords[0] = Tcl_NewIntObj(pwPtr->proxyx);
coords[1] = Tcl_NewIntObj(pwPtr->proxyy);
- Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords));
break;
case PROXY_FORGET:
@@ -2831,12 +2832,12 @@ PanedWindowProxyCommand(
(2 * Tk_InternalBorderWidth(pwPtr->tkwin));
}
- if (sashWidth < 1) {
- sashWidth = 1;
- }
- if (sashHeight < 1) {
- sashHeight = 1;
- }
+ if (sashWidth < 1) {
+ sashWidth = 1;
+ }
+ if (sashHeight < 1) {
+ sashHeight = 1;
+ }
/*
* Stash the proxy coordinates for future "proxy coord" calls.
diff --git a/generic/tkPlace.c b/generic/tkPlace.c
index 951cd8f..c7f3a89 100644
--- a/generic/tkPlace.c
+++ b/generic/tkPlace.c
@@ -24,7 +24,7 @@
* actual window size.
*/
-static char *borderModeStrings[] = {
+static const char *const borderModeStrings[] = {
"inside", "outside", "ignore", NULL
};
@@ -172,7 +172,7 @@ static void SlaveStructureProc(ClientData clientData,
XEvent *eventPtr);
static int ConfigureSlave(Tcl_Interp *interp, Tk_Window tkwin,
Tk_OptionTable table, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int PlaceInfoCommand(Tcl_Interp *interp, Tk_Window tkwin);
static Slave * CreateSlave(Tk_Window tkwin, Tk_OptionTable table);
static void FreeSlave(Slave *slavePtr);
@@ -203,17 +203,17 @@ static void UnlinkSlave(Slave *slavePtr);
int
Tk_PlaceObjCmd(
- ClientData clientData, /* NULL. */
+ ClientData clientData, /* Interpreter main window. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
+ Tk_Window main_win = clientData;
Tk_Window tkwin;
Slave *slavePtr;
- char *string;
TkDisplay *dispPtr;
Tk_OptionTable optionTable;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"configure", "forget", "info", "slaves", NULL
};
enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES };
@@ -235,10 +235,9 @@ Tk_PlaceObjCmd(
* Handle special shortcut where window name is first argument.
*/
- string = Tcl_GetString(objv[1]);
- if (string[0] == '.') {
- tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
- if (tkwin == NULL) {
+ if (Tcl_GetString(objv[1])[0] == '.') {
+ if (TkGetWindowFromObj(interp, main_win, objv[1],
+ &tkwin) != TCL_OK) {
return TCL_ERROR;
}
@@ -261,9 +260,8 @@ Tk_PlaceObjCmd(
* possible additional arguments.
*/
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
- Tk_MainWindow(interp));
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, main_win, objv[2],
+ &tkwin) != TCL_OK) {
return TCL_ERROR;
}
@@ -319,8 +317,8 @@ Tk_PlaceObjCmd(
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
(char *) tkwin));
Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- (ClientData) slavePtr);
- Tk_ManageGeometry(tkwin, NULL, (ClientData) NULL);
+ slavePtr);
+ Tk_ManageGeometry(tkwin, NULL, NULL);
Tk_UnmapWindow(tkwin);
FreeSlave(slavePtr);
break;
@@ -346,7 +344,7 @@ Tk_PlaceObjCmd(
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
Tcl_ListObjAppendElement(interp, listPtr,
- Tcl_NewStringObj(Tk_PathName(slavePtr->tkwin),-1));
+ TkNewWindowObj(slavePtr->tkwin));
}
Tcl_SetObjResult(interp, listPtr);
}
@@ -386,7 +384,7 @@ CreateSlave(
hPtr = Tcl_CreateHashEntry(&dispPtr->slaveTable, (char *) tkwin, &isNew);
if (!isNew) {
- return (Slave *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -394,7 +392,7 @@ CreateSlave(
* populate it with some default values.
*/
- slavePtr = (Slave *) ckalloc(sizeof(Slave));
+ slavePtr = ckalloc(sizeof(Slave));
memset(slavePtr, 0, sizeof(Slave));
slavePtr->tkwin = tkwin;
slavePtr->inTkwin = None;
@@ -403,7 +401,7 @@ CreateSlave(
slavePtr->optionTable = table;
Tcl_SetHashValue(hPtr, slavePtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- (ClientData) slavePtr);
+ slavePtr);
return slavePtr;
}
@@ -429,7 +427,7 @@ FreeSlave(
{
Tk_FreeConfigOptions((char *) slavePtr, slavePtr->optionTable,
slavePtr->tkwin);
- ckfree((char *) slavePtr);
+ ckfree(slavePtr);
}
/*
@@ -454,16 +452,14 @@ static Slave *
FindSlave(
Tk_Window tkwin) /* Token for desired slave. */
{
- Tcl_HashEntry *hPtr;
- register Slave *slavePtr;
+ register Tcl_HashEntry *hPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
hPtr = Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin);
if (hPtr == NULL) {
return NULL;
}
- slavePtr = (Slave *) Tcl_GetHashValue(hPtr);
- return slavePtr;
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -507,7 +503,7 @@ UnlinkSlave(
}
}
}
-
+
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
}
@@ -542,16 +538,16 @@ CreateMaster(
hPtr = Tcl_CreateHashEntry(&dispPtr->masterTable, (char *) tkwin, &isNew);
if (isNew) {
- masterPtr = (Master *) ckalloc(sizeof(Master));
+ masterPtr = ckalloc(sizeof(Master));
masterPtr->tkwin = tkwin;
masterPtr->slavePtr = NULL;
masterPtr->abortPtr = NULL;
masterPtr->flags = 0;
Tcl_SetHashValue(hPtr, masterPtr);
Tk_CreateEventHandler(masterPtr->tkwin, StructureNotifyMask,
- MasterStructureProc, (ClientData) masterPtr);
+ MasterStructureProc, masterPtr);
} else {
- masterPtr = (Master *) Tcl_GetHashValue(hPtr);
+ masterPtr = Tcl_GetHashValue(hPtr);
}
return masterPtr;
}
@@ -579,16 +575,14 @@ static Master *
FindMaster(
Tk_Window tkwin) /* Token for desired master. */
{
- Tcl_HashEntry *hPtr;
- register Master *masterPtr;
+ register Tcl_HashEntry *hPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
hPtr = Tcl_FindHashEntry(&dispPtr->masterTable, (char *) tkwin);
if (hPtr == NULL) {
return NULL;
}
- masterPtr = (Master *) Tcl_GetHashValue(hPtr);
- return masterPtr;
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -616,7 +610,7 @@ ConfigureSlave(
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. */
+ Tcl_Obj *const objv[]) /* Object values for arguments. */
{
register Master *masterPtr;
Tk_SavedOptions savedOptions;
@@ -730,7 +724,7 @@ ConfigureSlave(
slavePtr->masterPtr = masterPtr;
slavePtr->nextPtr = masterPtr->slavePtr;
masterPtr->slavePtr = slavePtr;
- Tk_ManageGeometry(slavePtr->tkwin, &placerType, (ClientData) slavePtr);
+ Tk_ManageGeometry(slavePtr->tkwin, &placerType, slavePtr);
/*
* Arrange for the master to be re-arranged at the first idle moment.
@@ -741,7 +735,7 @@ ConfigureSlave(
if (!(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
masterPtr->flags |= PARENT_RECONFIG_PENDING;
- Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(RecomputePlacement, masterPtr);
}
return TCL_OK;
@@ -849,21 +843,20 @@ static void
RecomputePlacement(
ClientData clientData) /* Pointer to Master record. */
{
- register Master *masterPtr = (Master *) clientData;
+ register Master *masterPtr = clientData;
register Slave *slavePtr;
int x, y, width, height, tmp;
int masterWidth, masterHeight, masterX, masterY;
double x1, y1, x2, y2;
-
int abort; /* May get set to non-zero to abort this
* placement operation. */
masterPtr->flags &= ~PARENT_RECONFIG_PENDING;
-
+
/*
* Abort any nested call to RecomputePlacement for this window, since
- * we'll do everything necessary here, and set up so this call
- * can be aborted if necessary.
+ * we'll do everything necessary here, and set up so this call can be
+ * aborted if necessary.
*/
if (masterPtr->abortPtr != NULL) {
@@ -871,13 +864,13 @@ RecomputePlacement(
}
masterPtr->abortPtr = &abort;
abort = 0;
- Tcl_Preserve((ClientData) masterPtr);
+ Tcl_Preserve(masterPtr);
/*
* Iterate over all the slaves for the master. Each slave's geometry can
* be computed independently of the other slaves. Changes to the window's
* structure could cause almost anything to happen, including deleting the
- * parent or child. If this happens, we'll be told to abort.
+ * parent or child. If this happens, we'll be told to abort.
*/
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL && !abort;
@@ -1044,7 +1037,7 @@ RecomputePlacement(
}
masterPtr->abortPtr = NULL;
- Tcl_Release((ClientData) masterPtr);
+ Tcl_Release(masterPtr);
}
/*
@@ -1071,17 +1064,19 @@ MasterStructureProc(
* referred to by eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- register Master *masterPtr = (Master *) clientData;
+ register Master *masterPtr = clientData;
register Slave *slavePtr, *nextPtr;
TkDisplay *dispPtr = ((TkWindow *) masterPtr->tkwin)->dispPtr;
- if (eventPtr->type == ConfigureNotify) {
+ switch (eventPtr->type) {
+ case ConfigureNotify:
if ((masterPtr->slavePtr != NULL)
&& !(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
masterPtr->flags |= PARENT_RECONFIG_PENDING;
- Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(RecomputePlacement, masterPtr);
}
- } else if (eventPtr->type == DestroyNotify) {
+ return;
+ case DestroyNotify:
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = nextPtr) {
slavePtr->masterPtr = NULL;
@@ -1091,14 +1086,15 @@ MasterStructureProc(
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->masterTable,
(char *) masterPtr->tkwin));
if (masterPtr->flags & PARENT_RECONFIG_PENDING) {
- Tcl_CancelIdleCall(RecomputePlacement, (ClientData) masterPtr);
+ Tcl_CancelIdleCall(RecomputePlacement, masterPtr);
}
masterPtr->tkwin = NULL;
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
}
- Tcl_EventuallyFree((ClientData) masterPtr, TCL_DYNAMIC);
- } else if (eventPtr->type == MapNotify) {
+ Tcl_EventuallyFree(masterPtr, TCL_DYNAMIC);
+ return;
+ case MapNotify:
/*
* When a master gets mapped, must redo the geometry computation so
* that all of its slaves get remapped.
@@ -1107,9 +1103,10 @@ MasterStructureProc(
if ((masterPtr->slavePtr != NULL)
&& !(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
masterPtr->flags |= PARENT_RECONFIG_PENDING;
- Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(RecomputePlacement, masterPtr);
}
- } else if (eventPtr->type == UnmapNotify) {
+ return;
+ case UnmapNotify:
/*
* Unmap all of the slaves when the master gets unmapped, so that they
* don't keep redisplaying themselves.
@@ -1119,6 +1116,7 @@ MasterStructureProc(
slavePtr = slavePtr->nextPtr) {
Tk_UnmapWindow(slavePtr->tkwin);
}
+ return;
}
}
@@ -1145,7 +1143,7 @@ SlaveStructureProc(
* referred to by eventPtr. */
XEvent *eventPtr) /* Describes what just happened. */
{
- register Slave *slavePtr = (Slave *) clientData;
+ register Slave *slavePtr = clientData;
TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr;
if (eventPtr->type == DestroyNotify) {
@@ -1182,7 +1180,7 @@ PlaceRequestProc(
ClientData clientData, /* Pointer to our record for slave. */
Tk_Window tkwin) /* Window that changed its desired size. */
{
- Slave *slavePtr = (Slave *) clientData;
+ Slave *slavePtr = clientData;
Master *masterPtr;
if (((slavePtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH)) != 0)
@@ -1195,7 +1193,7 @@ PlaceRequestProc(
}
if (!(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
masterPtr->flags |= PARENT_RECONFIG_PENDING;
- Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
+ Tcl_DoWhenIdle(RecomputePlacement, masterPtr);
}
}
@@ -1223,7 +1221,7 @@ PlaceLostSlaveProc(
* stolen away. */
Tk_Window tkwin) /* Tk's handle for the slave window. */
{
- register Slave *slavePtr = (Slave *) clientData;
+ register Slave *slavePtr = clientData;
TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr;
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
@@ -1234,7 +1232,7 @@ PlaceLostSlaveProc(
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
(char *) tkwin));
Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- (ClientData) slavePtr);
+ slavePtr);
FreeSlave(slavePtr);
}
diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h
index 5b386ee..49274d4 100644
--- a/generic/tkPlatDecls.h
+++ b/generic/tkPlatDecls.h
@@ -23,6 +23,10 @@
* in the generic/tk.decls script.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* !BEGIN!: Do not edit below this line. */
/*
@@ -30,42 +34,22 @@
*/
#ifdef __WIN32__ /* WIN */
-#ifndef Tk_AttachHWND_TCL_DECLARED
-#define Tk_AttachHWND_TCL_DECLARED
/* 0 */
EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd);
-#endif
-#ifndef Tk_GetHINSTANCE_TCL_DECLARED
-#define Tk_GetHINSTANCE_TCL_DECLARED
/* 1 */
EXTERN HINSTANCE Tk_GetHINSTANCE(void);
-#endif
-#ifndef Tk_GetHWND_TCL_DECLARED
-#define Tk_GetHWND_TCL_DECLARED
/* 2 */
EXTERN HWND Tk_GetHWND(Window window);
-#endif
-#ifndef Tk_HWNDToWindow_TCL_DECLARED
-#define Tk_HWNDToWindow_TCL_DECLARED
/* 3 */
EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd);
-#endif
-#ifndef Tk_PointerEvent_TCL_DECLARED
-#define Tk_PointerEvent_TCL_DECLARED
/* 4 */
EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y);
-#endif
-#ifndef Tk_TranslateWinEvent_TCL_DECLARED
-#define Tk_TranslateWinEvent_TCL_DECLARED
/* 5 */
EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam,
LRESULT *result);
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#ifndef Tk_MacOSXSetEmbedHandler_TCL_DECLARED
-#define Tk_MacOSXSetEmbedHandler_TCL_DECLARED
/* 0 */
EXTERN void Tk_MacOSXSetEmbedHandler(
Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
@@ -73,63 +57,32 @@ EXTERN void Tk_MacOSXSetEmbedHandler(
Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
Tk_MacOSXEmbedGetClipProc *getClipProc,
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc);
-#endif
-#ifndef Tk_MacOSXTurnOffMenus_TCL_DECLARED
-#define Tk_MacOSXTurnOffMenus_TCL_DECLARED
/* 1 */
EXTERN void Tk_MacOSXTurnOffMenus(void);
-#endif
-#ifndef Tk_MacOSXTkOwnsCursor_TCL_DECLARED
-#define Tk_MacOSXTkOwnsCursor_TCL_DECLARED
/* 2 */
EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt);
-#endif
-#ifndef TkMacOSXInitMenus_TCL_DECLARED
-#define TkMacOSXInitMenus_TCL_DECLARED
/* 3 */
EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp);
-#endif
-#ifndef TkMacOSXInitAppleEvents_TCL_DECLARED
-#define TkMacOSXInitAppleEvents_TCL_DECLARED
/* 4 */
EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp);
-#endif
-#ifndef TkGenWMConfigureEvent_TCL_DECLARED
-#define TkGenWMConfigureEvent_TCL_DECLARED
/* 5 */
EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y,
int width, int height, int flags);
-#endif
-#ifndef TkMacOSXInvalClipRgns_TCL_DECLARED
-#define TkMacOSXInvalClipRgns_TCL_DECLARED
/* 6 */
EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin);
-#endif
-#ifndef TkMacOSXGetDrawablePort_TCL_DECLARED
-#define TkMacOSXGetDrawablePort_TCL_DECLARED
/* 7 */
-EXTERN GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable);
-#endif
-#ifndef TkMacOSXGetRootControl_TCL_DECLARED
-#define TkMacOSXGetRootControl_TCL_DECLARED
+EXTERN void * TkMacOSXGetDrawablePort(Drawable drawable);
/* 8 */
-EXTERN ControlRef TkMacOSXGetRootControl(Drawable drawable);
-#endif
-#ifndef Tk_MacOSXSetupTkNotifier_TCL_DECLARED
-#define Tk_MacOSXSetupTkNotifier_TCL_DECLARED
+EXTERN void * TkMacOSXGetRootControl(Drawable drawable);
/* 9 */
EXTERN void Tk_MacOSXSetupTkNotifier(void);
-#endif
-#ifndef Tk_MacOSXIsAppInFront_TCL_DECLARED
-#define Tk_MacOSXIsAppInFront_TCL_DECLARED
/* 10 */
EXTERN int Tk_MacOSXIsAppInFront(void);
-#endif
#endif /* AQUA */
typedef struct TkPlatStubs {
int magic;
- struct TkPlatStubHooks *hooks;
+ const struct TkPlatStubHooks *hooks;
#ifdef __WIN32__ /* WIN */
Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */
@@ -147,8 +100,8 @@ typedef struct TkPlatStubs {
void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */
void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */
void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
- GWorldPtr (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
- ControlRef (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
+ void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
+ void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
int (*tk_MacOSXIsAppInFront) (void); /* 10 */
#endif /* AQUA */
@@ -157,94 +110,64 @@ typedef struct TkPlatStubs {
#ifdef __cplusplus
extern "C" {
#endif
-extern TkPlatStubs *tkPlatStubsPtr;
+extern const TkPlatStubs *tkPlatStubsPtr;
#ifdef __cplusplus
}
#endif
-#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS)
+#if defined(USE_TK_STUBS)
/*
* Inline function declarations:
*/
#ifdef __WIN32__ /* WIN */
-#ifndef Tk_AttachHWND
#define Tk_AttachHWND \
(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
-#endif
-#ifndef Tk_GetHINSTANCE
#define Tk_GetHINSTANCE \
(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
-#endif
-#ifndef Tk_GetHWND
#define Tk_GetHWND \
(tkPlatStubsPtr->tk_GetHWND) /* 2 */
-#endif
-#ifndef Tk_HWNDToWindow
#define Tk_HWNDToWindow \
(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
-#endif
-#ifndef Tk_PointerEvent
#define Tk_PointerEvent \
(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
-#endif
-#ifndef Tk_TranslateWinEvent
#define Tk_TranslateWinEvent \
(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
-#endif
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
-#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 /* AQUA */
-#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
+#endif /* defined(USE_TK_STUBS) */
/* !END!: Do not edit above this line. */
+#ifdef __cplusplus
+}
+#endif
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 4051552..4242423 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -30,7 +30,7 @@
#define ALL_BUTTONS \
(Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
-static unsigned int buttonMasks[] = {
+static const unsigned int buttonMasks[] = {
Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
};
#define ButtonMask(b) (buttonMasks[(b)-Button1])
@@ -54,7 +54,7 @@ static Tcl_ThreadDataKey dataKey;
static int GenerateEnterLeave(TkWindow *winPtr, int x, int y,
int state);
-static void InitializeEvent(XEvent* eventPtr, TkWindow *winPtr,
+static void InitializeEvent(XEvent *eventPtr, TkWindow *winPtr,
int type, int x, int y, int state, int detail);
static void UpdateCursor(TkWindow *winPtr);
@@ -138,7 +138,7 @@ GenerateEnterLeave(
int state) /* State flags. */
{
int crossed = 0; /* 1 if mouse crossed a window boundary */
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
TkWindow *restrictWinPtr = tsdPtr->restrictWinPtr;
TkWindow *lastWinPtr = tsdPtr->lastWinPtr;
@@ -231,7 +231,7 @@ Tk_UpdatePointer(
int x, int y, /* Pointer location in root coords. */
int state) /* Modifier state mask. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
TkWindow *winPtr = (TkWindow *)tkwin;
TkWindow *targetWinPtr;
@@ -436,7 +436,7 @@ XGrabPointer(
Cursor cursor,
Time time)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
display->request++;
@@ -471,7 +471,7 @@ XUngrabPointer(
Display *display,
Time time)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
display->request++;
@@ -501,7 +501,7 @@ void
TkPointerDeadWindow(
TkWindow *winPtr)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr == tsdPtr->lastWinPtr) {
@@ -540,7 +540,7 @@ UpdateCursor(
TkWindow *winPtr)
{
Cursor cursor = None;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -585,8 +585,8 @@ XDefineCursor(
Window w,
Cursor cursor)
{
- TkWindow *winPtr = (TkWindow *)Tk_IdToWindow(display, w);
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(display, w);
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->cursorWinPtr == winPtr) {
diff --git a/generic/tkPort.h b/generic/tkPort.h
index 00c49fd..d6db449 100644
--- a/generic/tkPort.h
+++ b/generic/tkPort.h
@@ -14,16 +14,13 @@
#ifndef _TKPORT
#define _TKPORT
-#ifndef _TK
-#include "tk.h"
+#if defined(_WIN32)
+# include "tkWinPort.h"
#endif
-#ifndef _TCL
-#include "tcl.h"
+#ifndef _TK
+# include "tk.h"
#endif
-
-#if defined(__WIN32__) || defined(_WIN32)
-# include "tkWinPort.h"
-#else
+#if !defined(_WIN32)
# if defined(MAC_OSX_TK)
# include "tkMacOSXPort.h"
# else
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index c9cd7cb..630737c 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -43,40 +42,35 @@ typedef struct RectOvalItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL
};
-static Tk_CustomOption dashOption = {
- (Tk_OptionParseProc *) TkCanvasDashParseProc,
- TkCanvasDashPrintProc, (ClientData) NULL
+static const Tk_CustomOption dashOption = {
+ TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc, (ClientData) TK_OFFSET_RELATIVE
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE)
};
-static Tk_CustomOption pixelOption = {
- (Tk_OptionParseProc *) TkPixelParseProc,
- TkPixelPrintProc, (ClientData) NULL
+static const Tk_CustomOption pixelOption = {
+ TkPixelParseProc, TkPixelPrintProc, NULL
};
-static Tk_ConfigSpec configSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
NULL, Tk_Offset(RectOvalItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-activefill", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, activeFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, activeFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-activeoutline", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, outline.activeColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL,
NULL, Tk_Offset(RectOvalItem, outline.activeStipple),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, activeFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, activeFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(RectOvalItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
@@ -85,45 +79,45 @@ static Tk_ConfigSpec configSpecs[] = {
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
"0", Tk_Offset(RectOvalItem, outline.offset),
- TK_CONFIG_DONT_SET_DEFAULT},
+ TK_CONFIG_DONT_SET_DEFAULT, NULL},
{TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
NULL, Tk_Offset(RectOvalItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
{TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, disabledFillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL,
NULL, Tk_Offset(RectOvalItem, outline.disabledColor),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL,
NULL, Tk_Offset(RectOvalItem, outline.disabledStipple),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, disabledFillStipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(RectOvalItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
{TK_CONFIG_COLOR, "-fill", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, fillColor), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, fillColor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(RectOvalItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_COLOR, "-outline", NULL, NULL,
- "black", Tk_Offset(RectOvalItem, outline.color), TK_CONFIG_NULL_OK},
+ "black", Tk_Offset(RectOvalItem, outline.color), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(RectOvalItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
{TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, outline.stipple), TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, outline.stipple), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-state", NULL, NULL,
NULL, Tk_Offset(Tk_Item, state),TK_CONFIG_NULL_OK, &stateOption},
{TK_CONFIG_BITMAP, "-stipple", NULL, NULL,
- NULL, Tk_Offset(RectOvalItem, fillStipple),TK_CONFIG_NULL_OK},
+ NULL, Tk_Offset(RectOvalItem, fillStipple),TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
{TK_CONFIG_CUSTOM, "-width", NULL, NULL,
"1.0", Tk_Offset(RectOvalItem, outline.width),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -133,10 +127,10 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeRectOvalBbox(Tk_Canvas canvas,
RectOvalItem *rectOvalPtr);
static int ConfigureRectOval(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[],
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[],
int flags);
static int CreateRectOval(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
static void DeleteRectOval(Tk_Canvas canvas, Tk_Item *itemPtr,
Display *display);
static void DisplayRectOval(Tk_Canvas canvas, Tk_Item *itemPtr,
@@ -147,7 +141,7 @@ static int OvalToArea(Tk_Canvas canvas, Tk_Item *itemPtr,
static double OvalToPoint(Tk_Canvas canvas, Tk_Item *itemPtr,
double *pointPtr);
static int RectOvalCoords(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
static int RectOvalToPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
static int RectToArea(Tk_Canvas canvas, Tk_Item *itemPtr,
@@ -186,6 +180,7 @@ Tk_ItemType tkRectangleType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
Tk_ItemType tkOvalType = {
@@ -209,6 +204,7 @@ Tk_ItemType tkOvalType = {
NULL, /* insertProc */
NULL, /* dTextProc */
NULL, /* nextPtr */
+ NULL, 0, NULL, NULL
};
/*
@@ -238,13 +234,13 @@ CreateRectOval(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
+ Tcl_Obj *const objv[]) /* Arguments describing rectangle. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
int i;
if (objc == 0) {
- Tcl_Panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords");
}
/*
@@ -269,7 +265,7 @@ CreateRectOval(
*/
for (i = 1; i < objc; i++) {
- char *arg = Tcl_GetString(objv[i]);
+ const char *arg = Tcl_GetString(objv[i]);
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
@@ -313,7 +309,7 @@ RectOvalCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1,y1,x2,y2,... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1,y1,x2,y2,... */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
@@ -402,7 +398,7 @@ ConfigureRectOval(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Rectangle item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
@@ -418,7 +414,7 @@ ConfigureRectOval(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
state = itemPtr->state;
@@ -481,7 +477,7 @@ ConfigureRectOval(
rectOvalPtr->outline.gc = newGC;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (state == TK_STATE_HIDDEN) {
ComputeRectOvalBbox(canvas, rectOvalPtr);
@@ -490,7 +486,7 @@ ConfigureRectOval(
color = rectOvalPtr->fillColor;
stipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectOvalPtr->activeFillColor!=NULL) {
color = rectOvalPtr->activeFillColor;
}
@@ -634,7 +630,7 @@ ComputeRectOvalBbox(
Tk_State state = rectOvalPtr->header.state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectOvalPtr->outline.width;
@@ -643,7 +639,7 @@ ComputeRectOvalBbox(
rectOvalPtr->header.x2 = rectOvalPtr->header.y2 = -1;
return;
}
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) {
if (rectOvalPtr->outline.activeWidth>width) {
width = rectOvalPtr->outline.activeWidth;
}
@@ -779,10 +775,10 @@ DisplayRectOval(
*/
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
fillStipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) {
if (rectOvalPtr->activeFillStipple != None) {
fillStipple = rectOvalPtr->activeFillStipple;
}
@@ -884,11 +880,11 @@ RectToPoint(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectPtr->outline.activeWidth>width) {
width = rectPtr->outline.activeWidth;
}
@@ -1004,11 +1000,11 @@ OvalToPoint(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = (double) ovalPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (ovalPtr->outline.activeWidth>width) {
width = (double) ovalPtr->outline.activeWidth;
}
@@ -1060,16 +1056,16 @@ RectToArea(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (rectPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (rectPtr->outline.activeWidth > width) {
width = rectPtr->outline.activeWidth;
}
} else if (state == TK_STATE_DISABLED) {
- if (rectPtr->outline.disabledWidth>0) {
+ if (rectPtr->outline.disabledWidth > 0) {
width = rectPtr->outline.disabledWidth;
}
}
@@ -1129,22 +1125,21 @@ OvalToArea(
* y1, x2, y2) describing rectangular area. */
{
RectOvalItem *ovalPtr = (RectOvalItem *) itemPtr;
- double oval[4], halfWidth;
+ double oval[4], halfWidth, width;
int result;
- double width;
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = ovalPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (ovalPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (ovalPtr->outline.activeWidth > width) {
width = ovalPtr->outline.activeWidth;
}
} else if (state == TK_STATE_DISABLED) {
- if (ovalPtr->outline.disabledWidth>0) {
+ if (ovalPtr->outline.disabledWidth > 0) {
width = ovalPtr->outline.disabledWidth;
}
}
@@ -1326,12 +1321,12 @@ RectOvalToPostscript(
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
color = rectOvalPtr->outline.color;
fillColor = rectOvalPtr->fillColor;
fillStipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectOvalPtr->outline.activeColor!=NULL) {
color = rectOvalPtr->outline.activeColor;
}
@@ -1383,7 +1378,7 @@ RectOvalToPostscript(
Tcl_AppendResult(interp, pathCmd, "0 setlinejoin 2 setlinecap\n",
NULL);
if (Tk_CanvasPsOutline(canvas, itemPtr,
- &(rectOvalPtr->outline))!= TCL_OK) {
+ &rectOvalPtr->outline)!= TCL_OK) {
return TCL_ERROR;
}
}
diff --git a/generic/tkScale.c b/generic/tkScale.c
index 103f39c..473904a 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -26,7 +26,7 @@
* used together with the "enum orient" declaration in tkScale.h.
*/
-static char *orientStrings[] = {
+static const char *const orientStrings[] = {
"horizontal", "vertical", NULL
};
@@ -35,7 +35,7 @@ static char *orientStrings[] = {
* used together with the "enum state" declaration in tkScale.h.
*/
-static char *stateStrings[] = {
+static const char *const stateStrings[] = {
"active", "disabled", "normal", NULL
};
@@ -140,7 +140,7 @@ static const Tk_OptionSpec optionSpecs[] = {
* scale widget command.
*/
-static CONST char *commandNames[] = {
+static const char *const commandNames[] = {
"cget", "configure", "coords", "get", "identify", "set", NULL
};
@@ -156,17 +156,17 @@ enum command {
static void ComputeFormat(TkScale *scalePtr);
static void ComputeScaleGeometry(TkScale *scalePtr);
static int ConfigureScale(Tcl_Interp *interp, TkScale *scalePtr,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DestroyScale(char *memPtr);
static void ScaleCmdDeletedProc(ClientData clientData);
static void ScaleEventProc(ClientData clientData,
XEvent *eventPtr);
static char * ScaleVarProc(ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags);
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
static int ScaleWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void ScaleWorldChanged(ClientData instanceData);
static void ScaleSetVariable(TkScale *scalePtr);
@@ -175,9 +175,11 @@ static void ScaleSetVariable(TkScale *scalePtr);
* that can be invoked from generic window code.
*/
-static Tk_ClassProcs scaleClass = {
+static const Tk_ClassProcs scaleClass = {
sizeof(Tk_ClassProcs), /* size */
ScaleWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -202,14 +204,14 @@ Tk_ScaleObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
register TkScale *scalePtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -240,7 +242,7 @@ Tk_ScaleObjCmd(
scalePtr->interp = interp;
scalePtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(scalePtr->tkwin), ScaleWidgetObjCmd,
- (ClientData) scalePtr, ScaleCmdDeletedProc);
+ scalePtr, ScaleCmdDeletedProc);
scalePtr->optionTable = optionTable;
scalePtr->orient = ORIENT_VERTICAL;
scalePtr->width = 0;
@@ -289,10 +291,10 @@ Tk_ScaleObjCmd(
scalePtr->takeFocusPtr = NULL;
scalePtr->flags = NEVER_SET;
- Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr);
+ Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, scalePtr);
Tk_CreateEventHandler(scalePtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- ScaleEventProc, (ClientData) scalePtr);
+ ScaleEventProc, scalePtr);
if ((Tk_InitOptions(interp, (char *) scalePtr, optionTable, tkwin)
!= TCL_OK) ||
@@ -301,7 +303,7 @@ Tk_ScaleObjCmd(
return TCL_ERROR;
}
- Tcl_SetResult(interp, Tk_PathName(scalePtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin));
return TCL_OK;
}
@@ -328,14 +330,14 @@ ScaleWidgetObjCmd(
ClientData clientData, /* Information about scale widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument strings. */
+ Tcl_Obj *const objv[]) /* Argument strings. */
{
- TkScale *scalePtr = (TkScale *) clientData;
+ TkScale *scalePtr = clientData;
Tcl_Obj *objPtr;
int index, result;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
result = Tcl_GetIndexFromObj(interp, objv[1], commandNames,
@@ -343,7 +345,7 @@ ScaleWidgetObjCmd(
if (result != TCL_OK) {
return result;
}
- Tcl_Preserve((ClientData) scalePtr);
+ Tcl_Preserve(scalePtr);
switch (index) {
case COMMAND_CGET:
@@ -355,9 +357,8 @@ ScaleWidgetObjCmd(
scalePtr->optionTable, objv[2], scalePtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
break;
case COMMAND_CONFIGURE:
if (objc <= 3) {
@@ -366,17 +367,15 @@ ScaleWidgetObjCmd(
(objc == 3) ? objv[2] : NULL, scalePtr->tkwin);
if (objPtr == NULL) {
goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
}
+ Tcl_SetObjResult(interp, objPtr);
} else {
result = ConfigureScale(interp, scalePtr, objc-2, objv+2);
}
break;
case COMMAND_COORDS: {
- int x, y ;
+ int x, y;
double value;
- char buf[TCL_INTEGER_SPACE * 2];
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "coords ?value?");
@@ -398,14 +397,12 @@ ScaleWidgetObjCmd(
y = scalePtr->horizTroughY + scalePtr->width/2
+ scalePtr->borderWidth;
}
- sprintf(buf, "%d %d", x, y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d", x, y));
break;
}
case COMMAND_GET: {
double value;
int x, y;
- char buf[TCL_DOUBLE_SPACE];
if ((objc != 2) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "get ?x y?");
@@ -420,8 +417,7 @@ ScaleWidgetObjCmd(
}
value = TkScalePixelToValue(scalePtr, x, y);
}
- sprintf(buf, scalePtr->format, value);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(scalePtr->format, value));
break;
}
case COMMAND_IDENTIFY: {
@@ -465,11 +461,11 @@ ScaleWidgetObjCmd(
break;
}
}
- Tcl_Release((ClientData) scalePtr);
+ Tcl_Release(scalePtr);
return result;
error:
- Tcl_Release((ClientData) scalePtr);
+ Tcl_Release(scalePtr);
return TCL_ERROR;
}
@@ -501,7 +497,7 @@ DestroyScale(
Tcl_DeleteCommandFromToken(scalePtr->interp, scalePtr->widgetCmd);
if (scalePtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(TkpDisplayScale, (ClientData) scalePtr);
+ Tcl_CancelIdleCall(TkpDisplayScale, scalePtr);
}
/*
@@ -512,7 +508,7 @@ DestroyScale(
if (scalePtr->varNamePtr != NULL) {
Tcl_UntraceVar(scalePtr->interp, Tcl_GetString(scalePtr->varNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ScaleVarProc, (ClientData) scalePtr);
+ ScaleVarProc, scalePtr);
}
if (scalePtr->troughGC != None) {
Tk_FreeGC(scalePtr->display, scalePtr->troughGC);
@@ -555,7 +551,7 @@ ConfigureScale(
register TkScale *scalePtr, /* 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[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
@@ -569,7 +565,7 @@ ConfigureScale(
if (scalePtr->varNamePtr != NULL) {
Tcl_UntraceVar(interp, Tcl_GetString(scalePtr->varNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ScaleVarProc, (ClientData) scalePtr);
+ ScaleVarProc, scalePtr);
}
for (error = 0; error <= 1; error++) {
@@ -579,8 +575,8 @@ ConfigureScale(
*/
if (Tk_SetOptions(interp, (char *) scalePtr,
- scalePtr->optionTable, objc, objv,
- scalePtr->tkwin, &savedOptions, NULL) != TCL_OK) {
+ scalePtr->optionTable, objc, objv, scalePtr->tkwin,
+ &savedOptions, NULL) != TCL_OK) {
continue;
}
} else {
@@ -685,10 +681,10 @@ ConfigureScale(
}
Tcl_TraceVar(interp, Tcl_GetString(scalePtr->varNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ScaleVarProc, (ClientData) scalePtr);
+ ScaleVarProc, scalePtr);
}
- ScaleWorldChanged((ClientData) scalePtr);
+ ScaleWorldChanged(scalePtr);
if (error) {
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
@@ -721,9 +717,7 @@ ScaleWorldChanged(
{
XGCValues gcValues;
GC gc;
- TkScale *scalePtr;
-
- scalePtr = (TkScale *) instanceData;
+ TkScale *scalePtr = instanceData;
gcValues.foreground = scalePtr->troughColorPtr->pixel;
gc = Tk_GetGC(scalePtr->tkwin, GCForeground, &gcValues);
@@ -1005,12 +999,12 @@ ScaleEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkScale *scalePtr = (TkScale *) clientData;
+ TkScale *scalePtr = clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
TkEventuallyRedrawScale(scalePtr, REDRAW_ALL);
} else if (eventPtr->type == DestroyNotify) {
- DestroyScale((char *) clientData);
+ DestroyScale(clientData);
} else if (eventPtr->type == ConfigureNotify) {
ComputeScaleGeometry(scalePtr);
TkEventuallyRedrawScale(scalePtr, REDRAW_ALL);
@@ -1053,7 +1047,7 @@ static void
ScaleCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkScale *scalePtr = (TkScale *) clientData;
+ TkScale *scalePtr = clientData;
Tk_Window tkwin = scalePtr->tkwin;
/*
@@ -1100,7 +1094,7 @@ TkEventuallyRedrawScale(
}
if (!(scalePtr->flags & REDRAW_PENDING)) {
scalePtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(TkpDisplayScale, (ClientData) scalePtr);
+ Tcl_DoWhenIdle(TkpDisplayScale, scalePtr);
}
scalePtr->flags |= what;
}
@@ -1171,12 +1165,12 @@ static char *
ScaleVarProc(
ClientData clientData, /* Information about button. */
Tcl_Interp *interp, /* Interpreter containing variable. */
- CONST char *name1, /* Name of variable. */
- CONST char *name2, /* Second part of variable name. */
+ 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;
- char *resultStr;
+ register TkScale *scalePtr = clientData;
+ const char *resultStr;
double value;
Tcl_Obj *valuePtr;
int result;
@@ -1227,7 +1221,7 @@ ScaleVarProc(
}
TkEventuallyRedrawScale(scalePtr, REDRAW_SLIDER);
- return resultStr;
+ return (char *) resultStr;
}
/*
diff --git a/generic/tkScale.h b/generic/tkScale.h
index f406bf6..af35978 100644
--- a/generic/tkScale.h
+++ b/generic/tkScale.h
@@ -18,11 +18,6 @@
#include "tkInt.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Legal values for the "orient" field of TkScale records.
*/
@@ -240,7 +235,4 @@ MODULE_SCOPE void TkScaleSetValue(TkScale *scalePtr, double value,
MODULE_SCOPE double TkScalePixelToValue(TkScale *scalePtr, int x, int y);
MODULE_SCOPE int TkScaleValueToPixel(TkScale *scalePtr, double value);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKSCALE */
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index f19671c..49ddca0 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -20,75 +20,76 @@
* Custom option for handling "-orient"
*/
-static Tk_CustomOption orientOption = {
- (Tk_OptionParseProc *) TkOrientParseProc,
- TkOrientPrintProc,
- (ClientData) NULL
+static const Tk_CustomOption orientOption = {
+ TkOrientParseProc, TkOrientPrintProc, NULL
};
+/* non-const space for "-width" default value for scrollbars */
+char tkDefScrollbarWidth[TCL_INTEGER_SPACE] = DEF_SCROLLBAR_WIDTH;
+
/*
* Information used for argv parsing.
*/
-Tk_ConfigSpec tkpScrollbarConfigSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_SCROLLBAR_ACTIVE_BG_COLOR, Tk_Offset(TkScrollbar, activeBorder),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_SCROLLBAR_ACTIVE_BG_MONO, Tk_Offset(TkScrollbar, activeBorder),
- TK_CONFIG_MONO_ONLY},
+ TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief",
- DEF_SCROLLBAR_ACTIVE_RELIEF, Tk_Offset(TkScrollbar, activeRelief), 0},
+ DEF_SCROLLBAR_ACTIVE_RELIEF, Tk_Offset(TkScrollbar, activeRelief), 0, NULL},
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_SCROLLBAR_BG_COLOR, Tk_Offset(TkScrollbar, bgBorder),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_SCROLLBAR_BG_MONO, Tk_Offset(TkScrollbar, bgBorder),
- TK_CONFIG_MONO_ONLY},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0},
- {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0},
+ TK_CONFIG_MONO_ONLY, NULL},
+ {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL},
+ {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL},
{TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_SCROLLBAR_BORDER_WIDTH, Tk_Offset(TkScrollbar, borderWidth), 0},
+ DEF_SCROLLBAR_BORDER_WIDTH, Tk_Offset(TkScrollbar, borderWidth), 0, NULL},
{TK_CONFIG_STRING, "-command", "command", "Command",
DEF_SCROLLBAR_COMMAND, Tk_Offset(TkScrollbar, command),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_SCROLLBAR_CURSOR, Tk_Offset(TkScrollbar, cursor), TK_CONFIG_NULL_OK},
+ DEF_SCROLLBAR_CURSOR, Tk_Offset(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth",
"BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH,
- Tk_Offset(TkScrollbar, elementBorderWidth), 0},
+ Tk_Offset(TkScrollbar, elementBorderWidth), 0, NULL},
{TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG,
- Tk_Offset(TkScrollbar, highlightBgColorPtr), 0},
+ Tk_Offset(TkScrollbar, highlightBgColorPtr), 0, NULL},
{TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
DEF_SCROLLBAR_HIGHLIGHT,
- Tk_Offset(TkScrollbar, highlightColorPtr), 0},
+ Tk_Offset(TkScrollbar, highlightColorPtr), 0, NULL},
{TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
"HighlightThickness",
- DEF_SCROLLBAR_HIGHLIGHT_WIDTH, Tk_Offset(TkScrollbar, highlightWidth), 0},
+ DEF_SCROLLBAR_HIGHLIGHT_WIDTH, Tk_Offset(TkScrollbar, highlightWidth), 0, NULL},
{TK_CONFIG_BOOLEAN, "-jump", "jump", "Jump",
- DEF_SCROLLBAR_JUMP, Tk_Offset(TkScrollbar, jump), 0},
+ DEF_SCROLLBAR_JUMP, Tk_Offset(TkScrollbar, jump), 0, NULL},
{TK_CONFIG_CUSTOM, "-orient", "orient", "Orient",
DEF_SCROLLBAR_ORIENT, Tk_Offset(TkScrollbar, vertical), 0,
&orientOption},
{TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_SCROLLBAR_RELIEF, Tk_Offset(TkScrollbar, relief), 0},
+ DEF_SCROLLBAR_RELIEF, Tk_Offset(TkScrollbar, relief), 0, NULL},
{TK_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
- DEF_SCROLLBAR_REPEAT_DELAY, Tk_Offset(TkScrollbar, repeatDelay), 0},
+ DEF_SCROLLBAR_REPEAT_DELAY, Tk_Offset(TkScrollbar, repeatDelay), 0, NULL},
{TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
- DEF_SCROLLBAR_REPEAT_INTERVAL, Tk_Offset(TkScrollbar, repeatInterval), 0},
+ DEF_SCROLLBAR_REPEAT_INTERVAL, Tk_Offset(TkScrollbar, repeatInterval), 0, NULL},
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_SCROLLBAR_TAKE_FOCUS, Tk_Offset(TkScrollbar, takeFocus),
- TK_CONFIG_NULL_OK},
+ TK_CONFIG_NULL_OK, NULL},
{TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background",
DEF_SCROLLBAR_TROUGH_COLOR, Tk_Offset(TkScrollbar, troughColorPtr),
- TK_CONFIG_COLOR_ONLY},
+ TK_CONFIG_COLOR_ONLY, NULL},
{TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background",
DEF_SCROLLBAR_TROUGH_MONO, Tk_Offset(TkScrollbar, troughColorPtr),
- TK_CONFIG_MONO_ONLY},
+ TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_PIXELS, "-width", "width", "Width",
- DEF_SCROLLBAR_WIDTH, Tk_Offset(TkScrollbar, width), 0},
- {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
+ tkDefScrollbarWidth, Tk_Offset(TkScrollbar, width), 0, NULL},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
/*
@@ -97,10 +98,10 @@ Tk_ConfigSpec tkpScrollbarConfigSpecs[] = {
static int ConfigureScrollbar(Tcl_Interp *interp,
TkScrollbar *scrollPtr, int argc,
- CONST char **argv, int flags);
+ const char **argv, int flags);
static void ScrollbarCmdDeletedProc(ClientData clientData);
static int ScrollbarWidgetCmd(ClientData clientData,
- Tcl_Interp *, int argc, CONST char **argv);
+ Tcl_Interp *, int argc, const char **argv);
/*
*--------------------------------------------------------------
@@ -124,15 +125,15 @@ Tk_ScrollbarCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
register TkScrollbar *scrollPtr;
Tk_Window newWin;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " pathName ?options?\"", NULL);
+ argv[0], " pathName ?-option value ...?\"", NULL);
return TCL_ERROR;
}
@@ -144,7 +145,7 @@ Tk_ScrollbarCmd(
Tk_SetClass(newWin, "Scrollbar");
scrollPtr = TkpCreateScrollbar(newWin);
- Tk_SetClassProcs(newWin, &tkpScrollbarProcs, (ClientData) scrollPtr);
+ Tk_SetClassProcs(newWin, &tkpScrollbarProcs, scrollPtr);
/*
* Initialize fields that won't be initialized by ConfigureScrollbar, or
@@ -157,7 +158,7 @@ Tk_ScrollbarCmd(
scrollPtr->interp = interp;
scrollPtr->widgetCmd = Tcl_CreateCommand(interp,
Tk_PathName(scrollPtr->tkwin), ScrollbarWidgetCmd,
- (ClientData) scrollPtr, ScrollbarCmdDeletedProc);
+ scrollPtr, ScrollbarCmdDeletedProc);
scrollPtr->vertical = 0;
scrollPtr->width = 0;
scrollPtr->command = NULL;
@@ -194,7 +195,7 @@ Tk_ScrollbarCmd(
return TCL_ERROR;
}
- Tcl_SetResult(interp, Tk_PathName(scrollPtr->tkwin), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(scrollPtr->tkwin));
return TCL_OK;
}
@@ -221,19 +222,19 @@ ScrollbarWidgetCmd(
ClientData clientData, /* Information about scrollbar widget. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
- register TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ register TkScrollbar *scrollPtr = clientData;
int result = TCL_OK;
size_t length;
int c;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option ?arg arg ...?\"", NULL);
+ argv[0], " option ?arg ...?\"", NULL);
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) scrollPtr);
+ Tcl_Preserve(scrollPtr);
c = argv[1][0];
length = strlen(argv[1]);
if ((c == 'a') && (strncmp(argv[1], "activate", length) == 0)) {
@@ -281,15 +282,15 @@ ScrollbarWidgetCmd(
goto error;
}
result = Tk_ConfigureValue(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, argv[2], 0);
+ configSpecs, (char *) scrollPtr, argv[2], 0);
} else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)
&& (length >= 2)) {
if (argc == 2) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, NULL, 0);
+ configSpecs, (char *) scrollPtr, NULL, 0);
} else if (argc == 3) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, argv[2], 0);
+ configSpecs, (char *) scrollPtr, argv[2], 0);
} else {
result = ConfigureScrollbar(interp, scrollPtr, argc-2, argv+2,
TK_CONFIG_ARGV_ONLY);
@@ -297,7 +298,6 @@ ScrollbarWidgetCmd(
} else if ((c == 'd') && (strncmp(argv[1], "delta", length) == 0)) {
int xDelta, yDelta, pixels, length;
double fraction;
- char buf[TCL_DOUBLE_SPACE];
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -322,12 +322,10 @@ ScrollbarWidgetCmd(
} else {
fraction = ((double) pixels / (double) length);
}
- Tcl_PrintDouble(NULL, fraction, buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(fraction));
} else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
int x, y, pos, length;
double fraction;
- char buf[TCL_DOUBLE_SPACE];
if (argc != 4) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -357,8 +355,7 @@ ScrollbarWidgetCmd(
} else if (fraction > 1.0) {
fraction = 1.0;
}
- Tcl_PrintDouble(NULL, fraction, buf);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_NewDoubleObj(fraction));
} else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) {
if (argc != 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -366,18 +363,19 @@ ScrollbarWidgetCmd(
goto error;
}
if (scrollPtr->flags & NEW_STYLE_COMMANDS) {
- char first[TCL_DOUBLE_SPACE], last[TCL_DOUBLE_SPACE];
+ Tcl_Obj *resObjs[2];
- Tcl_PrintDouble(interp, scrollPtr->firstFraction, first);
- Tcl_PrintDouble(interp, scrollPtr->lastFraction, last);
- Tcl_AppendResult(interp, first, " ", last, NULL);
+ resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction);
+ resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs));
} else {
- char buf[TCL_INTEGER_SPACE * 4];
+ Tcl_Obj *resObjs[4];
- sprintf(buf, "%d %d %d %d", scrollPtr->totalUnits,
- scrollPtr->windowUnits, scrollPtr->firstUnit,
- scrollPtr->lastUnit);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ resObjs[0] = Tcl_NewIntObj(scrollPtr->totalUnits);
+ resObjs[1] = Tcl_NewIntObj(scrollPtr->windowUnits);
+ resObjs[2] = Tcl_NewIntObj(scrollPtr->firstUnit);
+ resObjs[3] = Tcl_NewIntObj(scrollPtr->lastUnit);
+ Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs));
}
} else if ((c == 'i') && (strncmp(argv[1], "identify", length) == 0)) {
int x, y, thing;
@@ -491,11 +489,11 @@ ScrollbarWidgetCmd(
}
done:
- Tcl_Release((ClientData) scrollPtr);
+ Tcl_Release(scrollPtr);
return result;
error:
- Tcl_Release((ClientData) scrollPtr);
+ Tcl_Release(scrollPtr);
return TCL_ERROR;
}
@@ -526,10 +524,10 @@ ConfigureScrollbar(
/* Information about widget; may or may not
* already have values for some fields. */
int argc, /* Number of valid entries in argv. */
- CONST char **argv, /* Arguments. */
+ const char **argv, /* Arguments. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
- if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, tkpScrollbarConfigSpecs,
+ if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs,
argc, argv, (char *) scrollPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -585,7 +583,7 @@ TkScrollbarEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
TkScrollbarEventuallyRedraw(scrollPtr);
@@ -597,16 +595,16 @@ TkScrollbarEventProc(
scrollPtr->widgetCmd);
}
if (scrollPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(TkpDisplayScrollbar, (ClientData) scrollPtr);
+ Tcl_CancelIdleCall(TkpDisplayScrollbar, scrollPtr);
}
/*
* Free up all the stuff that requires special handling, then let
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- Tk_FreeOptions(tkpScrollbarConfigSpecs, (char *) scrollPtr,
+ Tk_FreeOptions(configSpecs, (char *) scrollPtr,
scrollPtr->display, 0);
- Tcl_EventuallyFree((ClientData) scrollPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(scrollPtr, TCL_DYNAMIC);
} else if (eventPtr->type == ConfigureNotify) {
TkpComputeScrollbarGeometry(scrollPtr);
TkScrollbarEventuallyRedraw(scrollPtr);
@@ -649,7 +647,7 @@ static void
ScrollbarCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
Tk_Window tkwin = scrollPtr->tkwin;
/*
@@ -689,7 +687,7 @@ TkScrollbarEventuallyRedraw(
return;
}
if ((scrollPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(TkpDisplayScrollbar, (ClientData) scrollPtr);
+ Tcl_DoWhenIdle(TkpDisplayScrollbar, scrollPtr);
scrollPtr->flags |= REDRAW_PENDING;
}
}
diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h
index e2890f4..b0cd085 100644
--- a/generic/tkScrollbar.h
+++ b/generic/tkScrollbar.h
@@ -17,11 +17,6 @@
#include "tkInt.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* A data structure of the following type is kept for each scrollbar widget.
*/
@@ -162,16 +157,12 @@ typedef struct TkScrollbar {
#define GOT_FOCUS 4
/*
- * Declaration of scrollbar class functions structure.
+ * Declaration of scrollbar class functions structure
+ * and default scrollbar width, for use in configSpec.
*/
-MODULE_SCOPE Tk_ClassProcs tkpScrollbarProcs;
-
-/*
- * Declaration of scrollbar configuration options.
- */
-
-MODULE_SCOPE Tk_ConfigSpec tkpScrollbarConfigSpecs[];
+MODULE_SCOPE const Tk_ClassProcs tkpScrollbarProcs;
+MODULE_SCOPE char tkDefScrollbarWidth[TCL_INTEGER_SPACE];
/*
* Declaration of functions used in the implementation of the scrollbar
@@ -189,7 +180,4 @@ MODULE_SCOPE void TkpConfigureScrollbar(TkScrollbar *scrollPtr);
MODULE_SCOPE int TkpScrollbarPosition(TkScrollbar *scrollPtr,
int x, int y);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKSCROLLBAR */
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 7c96b94..ee52ba1 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -28,7 +28,7 @@ typedef struct {
* chunk. */
char buffer[TCL_UTF_MAX]; /* A buffer to hold part of a UTF character
* that is split across chunks. */
- char command[4]; /* Command to invoke. Actual space is
+ char command[1]; /* Command to invoke. Actual space is
* allocated as large as necessary. This must
* be the last entry in the structure. */
} CommandInfo;
@@ -41,9 +41,7 @@ typedef struct {
typedef struct LostCommand {
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
- char command[4]; /* Command to invoke. Actual space is
- * allocated as large as necessary. This must
- * be the last entry in the structure. */
+ Tcl_Obj *cmdObj; /* Reference to command to invoke. */
} LostCommand;
/*
@@ -65,7 +63,7 @@ static int HandleTclCommand(ClientData clientData,
int offset, char *buffer, int maxBytes);
static void LostSelection(ClientData clientData);
static int SelGetProc(ClientData clientData,
- Tcl_Interp *interp, char *portion);
+ Tcl_Interp *interp, const char *portion);
/*
*--------------------------------------------------------------
@@ -141,7 +139,7 @@ Tk_CreateSelHandler(
for (selPtr = winPtr->selHandlerList; ; selPtr = selPtr->nextPtr) {
if (selPtr == NULL) {
- selPtr = (TkSelHandler *) ckalloc(sizeof(TkSelHandler));
+ selPtr = ckalloc(sizeof(TkSelHandler));
selPtr->nextPtr = winPtr->selHandlerList;
winPtr->selHandlerList = selPtr;
break;
@@ -154,7 +152,7 @@ Tk_CreateSelHandler(
*/
if (selPtr->proc == HandleTclCommand) {
- ckfree((char *) selPtr->clientData);
+ ckfree(selPtr->clientData);
}
break;
}
@@ -179,7 +177,7 @@ Tk_CreateSelHandler(
target = winPtr->dispPtr->utf8Atom;
for (selPtr = winPtr->selHandlerList; ; selPtr = selPtr->nextPtr) {
if (selPtr == NULL) {
- selPtr = (TkSelHandler *) ckalloc(sizeof(TkSelHandler));
+ selPtr = ckalloc(sizeof(TkSelHandler));
selPtr->nextPtr = winPtr->selHandlerList;
winPtr->selHandlerList = selPtr;
selPtr->selection = selection;
@@ -192,10 +190,10 @@ Tk_CreateSelHandler(
* should make a copy for this selPtr.
*/
- unsigned cmdInfoLen = sizeof(CommandInfo) +
- ((CommandInfo*)clientData)->cmdLength - 3;
+ unsigned cmdInfoLen = Tk_Offset(CommandInfo, command) +
+ ((CommandInfo *)clientData)->cmdLength + 1;
- selPtr->clientData = (ClientData)ckalloc(cmdInfoLen);
+ selPtr->clientData = ckalloc(cmdInfoLen);
memcpy(selPtr->clientData, clientData, cmdInfoLen);
} else {
selPtr->clientData = clientData;
@@ -243,7 +241,7 @@ Tk_DeleteSelHandler(
TkWindow *winPtr = (TkWindow *) tkwin;
register TkSelHandler *selPtr, *prevPtr;
register TkSelInProgress *ipPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -319,10 +317,10 @@ Tk_DeleteSelHandler(
* Mark the CommandInfo as deleted and free it if we can.
*/
- ((CommandInfo*)selPtr->clientData)->interp = NULL;
+ ((CommandInfo *) selPtr->clientData)->interp = NULL;
Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC);
}
- ckfree((char *) selPtr);
+ ckfree(selPtr);
}
/*
@@ -384,7 +382,7 @@ Tk_OwnSelection(
}
}
if (infoPtr == NULL) {
- infoPtr = (TkSelectionInfo*) ckalloc(sizeof(TkSelectionInfo));
+ infoPtr = ckalloc(sizeof(TkSelectionInfo));
infoPtr->selection = selection;
infoPtr->nextPtr = dispPtr->selectionInfoPtr;
dispPtr->selectionInfoPtr = infoPtr;
@@ -399,7 +397,7 @@ Tk_OwnSelection(
* memory leak.
*/
- ckfree((char *) infoPtr->clearData);
+ ckfree(infoPtr->clearData);
}
}
@@ -433,7 +431,7 @@ Tk_OwnSelection(
*/
if (clearProc != NULL) {
- (*clearProc)(clearData);
+ clearProc(clearData);
}
}
@@ -492,12 +490,12 @@ Tk_ClearSelection(
if (infoPtr != NULL) {
clearProc = infoPtr->clearProc;
clearData = infoPtr->clearData;
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
XSetSelectionOwner(winPtr->display, selection, None, CurrentTime);
if (clearProc != NULL) {
- (*clearProc)(clearData);
+ clearProc(clearData);
}
}
@@ -558,7 +556,7 @@ Tk_GetSelection(
TkWindow *winPtr = (TkWindow *) tkwin;
TkDisplay *dispPtr = winPtr->dispPtr;
TkSelectionInfo *infoPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (dispPtr->multipleAtom == None) {
@@ -602,7 +600,7 @@ Tk_GetSelection(
goto cantget;
}
buffer[count] = 0;
- result = (*proc)(clientData, interp, buffer);
+ result = proc(clientData, interp, buffer);
} else {
offset = 0;
result = TCL_OK;
@@ -610,7 +608,7 @@ Tk_GetSelection(
ip.nextPtr = tsdPtr->pendingPtr;
tsdPtr->pendingPtr = &ip;
while (1) {
- count = (selPtr->proc)(selPtr->clientData, offset, buffer,
+ count = selPtr->proc(selPtr->clientData, offset, buffer,
TK_SEL_BYTES_AT_ONCE);
if ((count < 0) || (ip.selPtr == NULL)) {
tsdPtr->pendingPtr = ip.nextPtr;
@@ -620,7 +618,7 @@ Tk_GetSelection(
Tcl_Panic("selection handler returned too many bytes");
}
buffer[count] = '\0';
- result = (*proc)(clientData, interp, buffer);
+ result = proc(clientData, interp, buffer);
if ((result != TCL_OK) || (count < TK_SEL_BYTES_AT_ONCE)
|| (ip.selPtr == NULL)) {
break;
@@ -669,15 +667,16 @@ Tk_SelectionObjCmd(
* interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
- char *path = NULL;
+ Tk_Window tkwin = clientData;
+ const char *path = NULL;
Atom selection;
- char *selName = NULL, *string;
+ const char *selName = NULL;
+ const char *string;
int count, index;
Tcl_Obj **objs;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"clear", "get", "handle", "own", NULL
};
enum options {
@@ -685,7 +684,7 @@ Tk_SelectionObjCmd(
};
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -696,7 +695,7 @@ Tk_SelectionObjCmd(
switch ((enum options) index) {
case SELECTION_CLEAR: {
- static CONST char *clearOptionStrings[] = {
+ static const char *const clearOptionStrings[] = {
"-displayof", "-selection", NULL
};
enum clearOptions { CLEAR_DISPLAYOF, CLEAR_SELECTION };
@@ -731,7 +730,7 @@ Tk_SelectionObjCmd(
if (count == 1) {
path = Tcl_GetString(objs[0]);
} else if (count > 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?");
return TCL_ERROR;
}
if (path != NULL) {
@@ -752,10 +751,10 @@ Tk_SelectionObjCmd(
case SELECTION_GET: {
Atom target;
- char *targetName = NULL;
+ const char *targetName = NULL;
Tcl_DString selBytes;
int result;
- static CONST char *getOptionStrings[] = {
+ static const char *const getOptionStrings[] = {
"-displayof", "-selection", "-type", NULL
};
enum getOptions { GET_DISPLAYOF, GET_SELECTION, GET_TYPE };
@@ -803,7 +802,7 @@ Tk_SelectionObjCmd(
selection = XA_PRIMARY;
}
if (count > 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?");
return TCL_ERROR;
} else if (count == 1) {
target = Tk_InternAtom(tkwin, Tcl_GetString(objs[0]));
@@ -815,7 +814,7 @@ Tk_SelectionObjCmd(
Tcl_DStringInit(&selBytes);
result = Tk_GetSelection(interp, tkwin, selection, target,
- SelGetProc, (ClientData) &selBytes);
+ SelGetProc, &selBytes);
if (result == TCL_OK) {
Tcl_DStringResult(interp, &selBytes);
} else {
@@ -826,11 +825,11 @@ Tk_SelectionObjCmd(
case SELECTION_HANDLE: {
Atom target, format;
- char *targetName = NULL;
- char *formatName = NULL;
+ const char *targetName = NULL;
+ const char *formatName = NULL;
register CommandInfo *cmdInfoPtr;
int cmdLength;
- static CONST char *handleOptionStrings[] = {
+ static const char *const handleOptionStrings[] = {
"-format", "-selection", "-type", NULL
};
enum handleOptions {
@@ -869,7 +868,7 @@ Tk_SelectionObjCmd(
}
if ((count < 2) || (count > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options? window command");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? window command");
return TCL_ERROR;
}
tkwin = Tk_NameToWindow(interp, Tcl_GetString(objs[0]), tkwin);
@@ -900,8 +899,8 @@ Tk_SelectionObjCmd(
if (cmdLength == 0) {
Tk_DeleteSelHandler(tkwin, selection, target);
} else {
- cmdInfoPtr = (CommandInfo *) ckalloc((unsigned) (
- sizeof(CommandInfo) - 3 + cmdLength));
+ cmdInfoPtr = ckalloc(Tk_Offset(CommandInfo, command)
+ + 1 + cmdLength);
cmdInfoPtr->interp = interp;
cmdInfoPtr->charOffset = 0;
cmdInfoPtr->byteOffset = 0;
@@ -909,16 +908,15 @@ Tk_SelectionObjCmd(
cmdInfoPtr->cmdLength = cmdLength;
memcpy(cmdInfoPtr->command, string, cmdLength + 1);
Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand,
- (ClientData) cmdInfoPtr, format);
+ cmdInfoPtr, format);
}
return TCL_OK;
}
case SELECTION_OWN: {
register LostCommand *lostPtr;
- char *script = NULL;
- int cmdLength;
- static CONST char *ownOptionStrings[] = {
+ Tcl_Obj *commandObj = NULL;
+ static const char *const ownOptionStrings[] = {
"-command", "-displayof", "-selection", NULL
};
enum ownOptions { OWN_COMMAND, OWN_DISPLAYOF, OWN_SELECTION };
@@ -943,7 +941,7 @@ Tk_SelectionObjCmd(
switch ((enum ownOptions) ownIndex) {
case OWN_COMMAND:
- script = Tcl_GetString(objs[1]);
+ commandObj = objs[1];
break;
case OWN_DISPLAYOF:
path = Tcl_GetString(objs[1]);
@@ -955,7 +953,7 @@ Tk_SelectionObjCmd(
}
if (count > 2) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options? ?window?");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? ?window?");
return TCL_ERROR;
}
if (selName != NULL) {
@@ -998,18 +996,17 @@ Tk_SelectionObjCmd(
return TCL_ERROR;
}
if (count == 2) {
- script = Tcl_GetString(objs[1]);
+ commandObj = objs[1];
}
- if (script == NULL) {
- Tk_OwnSelection(tkwin, selection, NULL, (ClientData) NULL);
+ if (commandObj == NULL) {
+ Tk_OwnSelection(tkwin, selection, NULL, NULL);
return TCL_OK;
}
- cmdLength = strlen(script);
- lostPtr = (LostCommand *) ckalloc((unsigned) (sizeof(LostCommand)
- -3 + cmdLength));
+ lostPtr = ckalloc(sizeof(LostCommand));
lostPtr->interp = interp;
- strcpy(lostPtr->command, script);
- Tk_OwnSelection(tkwin, selection, LostSelection, (ClientData) lostPtr);
+ lostPtr->cmdObj = commandObj;
+ Tcl_IncrRefCount(commandObj);
+ Tk_OwnSelection(tkwin, selection, LostSelection, lostPtr);
return TCL_OK;
}
}
@@ -1037,7 +1034,7 @@ Tk_SelectionObjCmd(
TkSelInProgress *
TkSelGetInProgress(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->pendingPtr;
@@ -1064,7 +1061,7 @@ void
TkSelSetInProgress(
TkSelInProgress *pendingPtr)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->pendingPtr = pendingPtr;
@@ -1094,7 +1091,7 @@ TkSelDeadWindow(
register TkSelHandler *selPtr;
register TkSelInProgress *ipPtr;
TkSelectionInfo *infoPtr, *prevPtr, *nextPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1117,10 +1114,10 @@ TkSelDeadWindow(
* Mark the CommandInfo as deleted and free it when we can.
*/
- ((CommandInfo*)selPtr->clientData)->interp = NULL;
+ ((CommandInfo *) selPtr->clientData)->interp = NULL;
Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC);
}
- ckfree((char *) selPtr);
+ ckfree(selPtr);
}
/*
@@ -1132,9 +1129,9 @@ TkSelDeadWindow(
nextPtr = infoPtr->nextPtr;
if (infoPtr->owner == (Tk_Window) winPtr) {
if (infoPtr->clearProc == LostSelection) {
- ckfree((char *) infoPtr->clearData);
+ ckfree(infoPtr->clearData);
}
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
infoPtr = prevPtr;
if (prevPtr == NULL) {
winPtr->dispPtr->selectionInfoPtr = nextPtr;
@@ -1190,7 +1187,7 @@ TkSelInit(
* http://www.cl.cam.ac.uk/~mgk25/unicode.html#x11
*/
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
+#if !defined(__WIN32__)
dispPtr->utf8Atom = Tk_InternAtom(tkwin, "UTF8_STRING");
#else
dispPtr->utf8Atom = (Atom) 0;
@@ -1257,9 +1254,9 @@ TkSelClearSelection(
*/
if (infoPtr->clearProc != NULL) {
- (*infoPtr->clearProc)(infoPtr->clearData);
+ infoPtr->clearProc(infoPtr->clearData);
}
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
}
@@ -1288,9 +1285,9 @@ SelGetProc(
* selection. */
Tcl_Interp *interp, /* Interpreter used for error reporting (not
* used). */
- char *portion) /* New information to be appended. */
+ const char *portion) /* New information to be appended. */
{
- Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1);
+ Tcl_DStringAppend(clientData, portion, -1);
return TCL_OK;
}
@@ -1322,16 +1319,16 @@ HandleTclCommand(
char *buffer, /* Place to store converted selection. */
int maxBytes) /* Maximum # of bytes to store at buffer. */
{
- CommandInfo *cmdInfoPtr = (CommandInfo *) clientData;
+ CommandInfo *cmdInfoPtr = clientData;
int spaceNeeded, length;
#define MAX_STATIC_SIZE 100
char staticSpace[MAX_STATIC_SIZE];
- char *command, *string;
+ char *command;
+ const char *string;
Tcl_Interp *interp = cmdInfoPtr->interp;
Tcl_DString oldResult;
- Tcl_Obj *objPtr;
- int extraBytes, charOffset, count, numChars;
- CONST char *p;
+ int extraBytes, charOffset, count, numChars, code;
+ const char *p;
/*
* We must also protect the interpreter and the command from being deleted
@@ -1339,7 +1336,7 @@ HandleTclCommand(
*/
Tcl_Preserve(clientData);
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
/*
* Compute the proper byte offset in the case where the last chunk split a
@@ -1370,7 +1367,7 @@ HandleTclCommand(
if (spaceNeeded < MAX_STATIC_SIZE) {
command = staticSpace;
} else {
- command = (char *) ckalloc((unsigned) spaceNeeded);
+ command = ckalloc(spaceNeeded);
}
sprintf(command, "%s %d %d", cmdInfoPtr->command, charOffset, maxBytes);
@@ -1381,9 +1378,9 @@ HandleTclCommand(
Tcl_DStringInit(&oldResult);
Tcl_DStringGetResult(interp, &oldResult);
- if (TkCopyAndGlobalEval(interp, command) == TCL_OK) {
- objPtr = Tcl_GetObjResult(interp);
- string = Tcl_GetStringFromObj(objPtr, &length);
+ code = Tcl_EvalEx(interp, command, -1, TCL_EVAL_GLOBAL);
+ if (code == TCL_OK) {
+ string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length);
count = (length > maxBytes) ? maxBytes : length;
memcpy(buffer, string, (size_t) count);
buffer[count] = '\0';
@@ -1416,6 +1413,15 @@ HandleTclCommand(
}
count += extraBytes;
} else {
+ /*
+ * Something went wrong. Log errors as background errors, and silently
+ * drop everything else.
+ */
+
+ if (code == TCL_ERROR) {
+ Tcl_AddErrorInfo(interp, "\n (command handling selection)");
+ Tcl_BackgroundException(interp, code);
+ }
count = -1;
}
Tcl_DStringResult(interp, &oldResult);
@@ -1425,7 +1431,7 @@ HandleTclCommand(
}
Tcl_Release(clientData);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
return count;
}
@@ -1490,7 +1496,7 @@ TkSelDefaultSelection(
if ((selPtr->selection == infoPtr->selection)
&& (selPtr->target != dispPtr->applicationAtom)
&& (selPtr->target != dispPtr->windowAtom)) {
- CONST char *atomString = Tk_GetAtomName((Tk_Window) winPtr,
+ const char *atomString = Tk_GetAtomName((Tk_Window) winPtr,
selPtr->target);
Tcl_DStringAppendElement(&ds, atomString);
}
@@ -1557,12 +1563,13 @@ static void
LostSelection(
ClientData clientData) /* Pointer to LostCommand structure. */
{
- LostCommand *lostPtr = (LostCommand *) clientData;
+ LostCommand *lostPtr = clientData;
Tcl_Obj *objPtr;
Tcl_Interp *interp;
+ int code;
interp = lostPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
/*
* Execute the command. Save the interpreter's result, if any, and restore
@@ -1573,20 +1580,22 @@ LostSelection(
Tcl_IncrRefCount(objPtr);
Tcl_ResetResult(interp);
- if (TkCopyAndGlobalEval(interp, lostPtr->command) != TCL_OK) {
- Tcl_BackgroundError(interp);
+ code = Tcl_EvalObjEx(interp, lostPtr->cmdObj, TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
}
Tcl_SetObjResult(interp, objPtr);
Tcl_DecrRefCount(objPtr);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
/*
* Free the storage for the command, since we're done with it now.
*/
- ckfree((char *) lostPtr);
+ Tcl_DecrRefCount(lostPtr->cmdObj);
+ ckfree(lostPtr);
}
/*
diff --git a/generic/tkSelect.h b/generic/tkSelect.h
index b9d7d2d..74326d0 100644
--- a/generic/tkSelect.h
+++ b/generic/tkSelect.h
@@ -75,8 +75,7 @@ typedef struct TkSelRetrievalInfo {
Atom selection; /* Selection being requested. */
Atom property; /* Property where selection will appear. */
Atom target; /* Desired form for selection. */
- int (*proc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
- char *portion)); /* Procedure to call to handle pieces of
+ Tk_GetSelProc *proc; /* Procedure to call to handle pieces of
* selection. */
ClientData clientData; /* Argument for proc. */
int result; /* Initially -1. Set to a Tcl return value
@@ -160,9 +159,6 @@ MODULE_SCOPE void TkSelClearSelection(Tk_Window tkwin, XEvent *eventPtr);
MODULE_SCOPE int TkSelDefaultSelection(TkSelectionInfo *infoPtr,
Atom target, char *buffer, int maxBytes,
Atom *typePtr);
-MODULE_SCOPE int TkSelGetSelection(Tcl_Interp *interp, Tk_Window tkwin,
- Atom selection, Atom target, Tk_GetSelProc *proc,
- ClientData clientData);
#ifndef TkSelUpdateClipboard
MODULE_SCOPE void TkSelUpdateClipboard(TkWindow *winPtr,
TkClipboardTarget *targetPtr);
diff --git a/generic/tkSquare.c b/generic/tkSquare.c
index a35832a..e9b0081 100644
--- a/generic/tkSquare.c
+++ b/generic/tkSquare.c
@@ -16,6 +16,12 @@
#if 0
#define __NO_OLD_CONFIG
#endif
+#ifndef USE_TCL_STUBS
+# define USE_TCL_STUBS
+#endif
+#ifndef USE_TK_STUBS
+# define USE_TK_STUBS
+#endif
#include "tkInt.h"
/*
@@ -61,38 +67,35 @@ typedef struct {
static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
"#d9d9d9", Tk_Offset(Square, bgBorderPtr), -1, 0,
- (ClientData) "white"},
+ (ClientData) "white", 0},
{TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0,
- (ClientData) "-borderwidth"},
+ (ClientData) "-borderwidth", 0},
{TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0,
- (ClientData) "-background"},
+ (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- "2", Tk_Offset(Square, borderWidthPtr), -1},
+ "2", Tk_Offset(Square, borderWidthPtr), -1, 0, NULL, 0},
{TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer",
- "1", Tk_Offset(Square, doubleBufferPtr), -1},
+ "1", Tk_Offset(Square, doubleBufferPtr), -1, 0 , NULL, 0},
{TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, -1, 0,
- (ClientData) "-foreground"},
+ (ClientData) "-foreground", 0},
{TK_OPTION_BORDER, "-foreground", "foreground", "Foreground",
"#b03060", Tk_Offset(Square, fgBorderPtr), -1, 0,
- (ClientData) "black"},
+ (ClientData) "black", 0},
{TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0",
- Tk_Offset(Square, xPtr), -1},
+ Tk_Offset(Square, xPtr), -1, 0, NULL, 0},
{TK_OPTION_PIXELS, "-posy", "posy", "PosY", "0",
- Tk_Offset(Square, yPtr), -1},
+ Tk_Offset(Square, yPtr), -1, 0, NULL, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- "raised", Tk_Offset(Square, reliefPtr), -1},
+ "raised", Tk_Offset(Square, reliefPtr), -1, 0, NULL, 0},
{TK_OPTION_PIXELS, "-size", "size", "Size", "20",
- Tk_Offset(Square, sizeObjPtr), -1},
- {TK_OPTION_END}
+ Tk_Offset(Square, sizeObjPtr), -1, 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
/*
* Forward declarations for procedures defined later in this file:
*/
-int SquareObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
static void SquareDeletedProc(ClientData clientData);
static int SquareConfigure(Tcl_Interp *interp, Square *squarePtr);
static void SquareDestroy(char *memPtr);
@@ -101,7 +104,7 @@ static void KeepInWindow(Square *squarePtr);
static void SquareObjEventProc(ClientData clientData,
XEvent *eventPtr);
static int SquareWidgetObjCmd(ClientData clientData,
- Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]);
+ Tcl_Interp *, int objc, Tcl_Obj * const objv[]);
/*
*--------------------------------------------------------------
@@ -125,14 +128,14 @@ SquareObjCmd(
ClientData clientData, /* NULL. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Square *squarePtr;
Tk_Window tkwin;
Tk_OptionTable optionTable;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -157,27 +160,27 @@ SquareObjCmd(
* just the non-NULL/0 items.
*/
- squarePtr = (Square *) ckalloc(sizeof(Square));
- memset((void *) squarePtr, 0, (sizeof(Square)));
+ squarePtr = ckalloc(sizeof(Square));
+ memset(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);
+ Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd, squarePtr,
+ SquareDeletedProc);
squarePtr->gc = None;
squarePtr->optionTable = optionTable;
if (Tk_InitOptions(interp, (char *) squarePtr, optionTable, tkwin)
!= TCL_OK) {
Tk_DestroyWindow(squarePtr->tkwin);
- ckfree((char *) squarePtr);
+ ckfree(squarePtr);
return TCL_ERROR;
}
Tk_CreateEventHandler(squarePtr->tkwin, ExposureMask|StructureNotifyMask,
- SquareObjEventProc, (ClientData) squarePtr);
+ SquareObjEventProc, squarePtr);
if (Tk_SetOptions(interp, (char *) squarePtr, optionTable, objc - 2,
objv + 2, tkwin, NULL, NULL) != TCL_OK) {
goto error;
@@ -218,11 +221,11 @@ SquareWidgetObjCmd(
ClientData clientData, /* Information about square widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj * CONST objv[]) /* Argument objects. */
+ Tcl_Obj * const objv[]) /* Argument objects. */
{
- Square *squarePtr = (Square *) clientData;
+ Square *squarePtr = clientData;
int result = TCL_OK;
- static CONST char *squareOptions[] = {"cget", "configure", NULL};
+ static const char *const squareOptions[] = {"cget", "configure", NULL};
enum {
SQUARE_CGET, SQUARE_CONFIGURE
};
@@ -239,7 +242,7 @@ SquareWidgetObjCmd(
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) squarePtr);
+ Tcl_Preserve(squarePtr);
switch (index) {
case SQUARE_CGET:
@@ -277,7 +280,7 @@ SquareWidgetObjCmd(
result = SquareConfigure(interp, squarePtr);
}
if (!squarePtr->updatePending) {
- Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr);
+ Tcl_DoWhenIdle(SquareDisplay, squarePtr);
squarePtr->updatePending = 1;
}
}
@@ -285,11 +288,11 @@ SquareWidgetObjCmd(
Tcl_SetObjResult(interp, resultObjPtr);
}
}
- Tcl_Release((ClientData) squarePtr);
+ Tcl_Release(squarePtr);
return result;
error:
- Tcl_Release((ClientData) squarePtr);
+ Tcl_Release(squarePtr);
return TCL_ERROR;
}
@@ -350,7 +353,7 @@ SquareConfigure(
&borderWidth);
Tk_SetInternalBorder(squarePtr->tkwin, borderWidth);
if (!squarePtr->updatePending) {
- Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr);
+ Tcl_DoWhenIdle(SquareDisplay, squarePtr);
squarePtr->updatePending = 1;
}
KeepInWindow(squarePtr);
@@ -380,17 +383,17 @@ SquareObjEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- Square *squarePtr = (Square *) clientData;
+ Square *squarePtr = clientData;
if (eventPtr->type == Expose) {
if (!squarePtr->updatePending) {
- Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr);
+ Tcl_DoWhenIdle(SquareDisplay, squarePtr);
squarePtr->updatePending = 1;
}
} else if (eventPtr->type == ConfigureNotify) {
KeepInWindow(squarePtr);
if (!squarePtr->updatePending) {
- Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr);
+ Tcl_DoWhenIdle(SquareDisplay, squarePtr);
squarePtr->updatePending = 1;
}
} else if (eventPtr->type == DestroyNotify) {
@@ -405,9 +408,9 @@ SquareObjEventProc(
squarePtr->widgetCmd);
}
if (squarePtr->updatePending) {
- Tcl_CancelIdleCall(SquareDisplay, (ClientData) squarePtr);
+ Tcl_CancelIdleCall(SquareDisplay, squarePtr);
}
- Tcl_EventuallyFree((ClientData) squarePtr, SquareDestroy);
+ Tcl_EventuallyFree(squarePtr, SquareDestroy);
}
}
@@ -433,7 +436,7 @@ static void
SquareDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- Square *squarePtr = (Square *) clientData;
+ Square *squarePtr = clientData;
Tk_Window tkwin = squarePtr->tkwin;
/*
@@ -470,7 +473,7 @@ static void
SquareDisplay(
ClientData clientData) /* Information about window. */
{
- Square *squarePtr = (Square *) clientData;
+ Square *squarePtr = clientData;
Tk_Window tkwin = squarePtr->tkwin;
Pixmap pm = None;
Drawable d;
@@ -555,7 +558,7 @@ SquareDestroy(
{
Square *squarePtr = (Square *) memPtr;
- ckfree((char *) squarePtr);
+ ckfree(squarePtr);
}
/*
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 9c154e8..2b87360 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -31,43 +31,36 @@
#include "tkIntXlibDecls.h"
/*
- * Remove macros that will interfere with the definitions below.
+ * WARNING: The contents of this file is automatically generated by the
+ * tools/genStubs.tcl script. Any modifications to the function declarations
+ * below should be made in the generic/tk.decls script.
*/
-#define Tk_CreateCanvasVisitor \
- ((void (*)(Tcl_Interp * interp, VOID * typePtr)) NULL)
-#define Tk_GetCanvasVisitor \
- ((VOID * (*)(Tcl_Interp * interp, CONST char * name)) NULL)
-
-MODULE_SCOPE TkIntStubs tkIntStubs;
-MODULE_SCOPE TkIntPlatStubs tkIntPlatStubs;
-MODULE_SCOPE TkIntXlibStubs tkIntXlibStubs;
-MODULE_SCOPE TkPlatStubs tkPlatStubs;
-MODULE_SCOPE TkStubs tkStubs;
+MODULE_SCOPE const TkStubs tkStubs;
/*
- * WARNING: The contents of this file is automatically generated by the
- * tools/genStubs.tcl script. Any modifications to the function declarations
- * below should be made in the generic/tk.decls script.
+ * Remove macro that might interfere with the definition below.
*/
+#undef Tk_MainEx
+
/* !BEGIN!: Do not edit below this line. */
-TkIntStubs tkIntStubs = {
+static const TkIntStubs tkIntStubs = {
TCL_STUB_MAGIC,
- NULL,
+ 0,
TkAllocWindow, /* 0 */
TkBezierPoints, /* 1 */
TkBezierScreenPoints, /* 2 */
- TkBindDeadWindow, /* 3 */
+ 0, /* 3 */
TkBindEventProc, /* 4 */
TkBindFree, /* 5 */
TkBindInit, /* 6 */
TkChangeEventWindow, /* 7 */
TkClipInit, /* 8 */
TkComputeAnchor, /* 9 */
- TkCopyAndGlobalEval, /* 10 */
- TkCreateBindingProcedure, /* 11 */
+ 0, /* 10 */
+ 0, /* 11 */
TkCreateCursorFromData, /* 12 */
TkCreateFrame, /* 13 */
TkCreateMainWindow, /* 14 */
@@ -132,7 +125,7 @@ TkIntStubs tkIntStubs = {
TkpRedirectKeyEvent, /* 73 */
TkpSetMainMenubar, /* 74 */
TkpUseWindow, /* 75 */
- TkpWindowWasRecentlyDeleted, /* 76 */
+ 0, /* 76 */
TkQueueEventForAllChildren, /* 77 */
TkReadBitmapFile, /* 78 */
TkScrollWindow, /* 79 */
@@ -140,7 +133,7 @@ TkIntStubs tkIntStubs = {
TkSelEventProc, /* 81 */
TkSelInit, /* 82 */
TkSelPropProc, /* 83 */
- NULL, /* 84 */
+ 0, /* 84 */
TkSetWindowMenuBar, /* 85 */
TkStringToKeysym, /* 86 */
TkThickPolyLineToArea, /* 87 */
@@ -170,117 +163,117 @@ TkIntStubs tkIntStubs = {
TkpGetSystemDefault, /* 111 */
TkpMenuThreadInit, /* 112 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 113 */
+ 0, /* 113 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkClipBox, /* 113 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 113 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 113 */ /* Dummy entry for stubs table backwards compatibility */
TkClipBox, /* 113 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 114 */
+ 0, /* 114 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkCreateRegion, /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 114 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 114 */ /* Dummy entry for stubs table backwards compatibility */
TkCreateRegion, /* 114 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 115 */
+ 0, /* 115 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkDestroyRegion, /* 115 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 115 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 115 */ /* Dummy entry for stubs table backwards compatibility */
TkDestroyRegion, /* 115 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 116 */
+ 0, /* 116 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkIntersectRegion, /* 116 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 116 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 116 */ /* Dummy entry for stubs table backwards compatibility */
TkIntersectRegion, /* 116 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 117 */
+ 0, /* 117 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkRectInRegion, /* 117 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 117 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 117 */ /* Dummy entry for stubs table backwards compatibility */
TkRectInRegion, /* 117 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 118 */
+ 0, /* 118 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkSetRegion, /* 118 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 118 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 118 */ /* Dummy entry for stubs table backwards compatibility */
TkSetRegion, /* 118 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 119 */
+ 0, /* 119 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkUnionRectWithRegion, /* 119 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 119 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 119 */ /* Dummy entry for stubs table backwards compatibility */
TkUnionRectWithRegion, /* 119 */
#endif /* AQUA */
- NULL, /* 120 */
+ 0, /* 120 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 121 */
+ 0, /* 121 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- NULL, /* 121 */
+ 0, /* 121 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 121 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */
TkpCreateNativeBitmap, /* 121 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 122 */
+ 0, /* 122 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- NULL, /* 122 */
+ 0, /* 122 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 122 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */
TkpDefineNativeBitmaps, /* 122 */
#endif /* AQUA */
- NULL, /* 123 */
+ 0, /* 123 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 124 */
+ 0, /* 124 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
- NULL, /* 124 */
+ 0, /* 124 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 124 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */
TkpGetNativeAppBitmap, /* 124 */
#endif /* AQUA */
- NULL, /* 125 */
- NULL, /* 126 */
- NULL, /* 127 */
- NULL, /* 128 */
- NULL, /* 129 */
- NULL, /* 130 */
- NULL, /* 131 */
- NULL, /* 132 */
- NULL, /* 133 */
- NULL, /* 134 */
+ 0, /* 125 */
+ 0, /* 126 */
+ 0, /* 127 */
+ 0, /* 128 */
+ 0, /* 129 */
+ 0, /* 130 */
+ 0, /* 131 */
+ 0, /* 132 */
+ 0, /* 133 */
+ 0, /* 134 */
TkpDrawHighlightBorder, /* 135 */
TkSetFocusWin, /* 136 */
TkpSetKeycodeAndState, /* 137 */
@@ -292,13 +285,13 @@ TkIntStubs tkIntStubs = {
TkClipCleanup, /* 143 */
TkGCCleanup, /* 144 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
- NULL, /* 145 */
+ 0, /* 145 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
TkSubtractRegion, /* 145 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
- NULL, /* 145 */ /* Dummy entry for stubs table backwards compatibility */
+ 0, /* 145 */ /* Dummy entry for stubs table backwards compatibility */
TkSubtractRegion, /* 145 */
#endif /* AQUA */
TkStylePkgInit, /* 146 */
@@ -310,20 +303,20 @@ TkIntStubs tkIntStubs = {
TkpDrawFrame, /* 152 */
TkCreateThreadExitHandler, /* 153 */
TkDeleteThreadExitHandler, /* 154 */
- NULL, /* 155 */
+ 0, /* 155 */
TkpTestembedCmd, /* 156 */
TkpTesttextCmd, /* 157 */
- NULL, /* 158 */
- NULL, /* 159 */
- NULL, /* 160 */
- NULL, /* 161 */
- NULL, /* 162 */
- NULL, /* 163 */
- NULL, /* 164 */
- NULL, /* 165 */
- NULL, /* 166 */
- NULL, /* 167 */
- NULL, /* 168 */
+ TkSelGetSelection, /* 158 */
+ TkTextGetIndex, /* 159 */
+ TkTextIndexBackBytes, /* 160 */
+ TkTextIndexForwBytes, /* 161 */
+ TkTextMakeByteIndex, /* 162 */
+ TkTextPrintIndex, /* 163 */
+ TkTextSetMark, /* 164 */
+ TkTextXviewCmd, /* 165 */
+ TkTextChanged, /* 166 */
+ TkBTreeNumLines, /* 167 */
+ TkTextInsertDisplayProc, /* 168 */
TkStateParseProc, /* 169 */
TkStatePrintProc, /* 170 */
TkCanvasDashParseProc, /* 171 */
@@ -336,14 +329,18 @@ TkIntStubs tkIntStubs = {
TkOrientPrintProc, /* 178 */
TkSmoothParseProc, /* 179 */
TkSmoothPrintProc, /* 180 */
+ TkDrawAngledTextLayout, /* 181 */
+ TkUnderlineAngledTextLayout, /* 182 */
+ TkIntersectAngledTextLayout, /* 183 */
+ TkDrawAngledChars, /* 184 */
};
-TkIntPlatStubs tkIntPlatStubs = {
+static const TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
- NULL,
+ 0,
#ifdef __WIN32__ /* WIN */
TkAlignImageData, /* 0 */
- NULL, /* 1 */
+ 0, /* 1 */
TkGenerateActivateEvents, /* 2 */
TkpGetMS, /* 3 */
TkPointerDeadWindow, /* 4 */
@@ -382,8 +379,8 @@ TkIntPlatStubs tkIntPlatStubs = {
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
TkGenerateActivateEvents, /* 0 */
- NULL, /* 1 */
- NULL, /* 2 */
+ 0, /* 1 */
+ 0, /* 2 */
TkPointerDeadWindow, /* 3 */
TkpSetCapture, /* 4 */
TkpSetCursor, /* 5 */
@@ -394,14 +391,14 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXDispatchMenuEvent, /* 10 */
TkMacOSXInstallCursor, /* 11 */
TkMacOSXHandleTearoffMenu, /* 12 */
- NULL, /* 13 */
+ 0, /* 13 */
TkMacOSXDoHLEvent, /* 14 */
- NULL, /* 15 */
+ 0, /* 15 */
TkMacOSXGetXWindow, /* 16 */
TkMacOSXGrowToplevel, /* 17 */
TkMacOSXHandleMenuSelect, /* 18 */
- NULL, /* 19 */
- NULL, /* 20 */
+ 0, /* 19 */
+ 0, /* 20 */
TkMacOSXInvalidateWindow, /* 21 */
TkMacOSXIsCharacterMissing, /* 22 */
TkMacOSXMakeRealWindowExist, /* 23 */
@@ -429,17 +426,17 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacOSXPreprocessMenu, /* 45 */
TkpIsWindowFloating, /* 46 */
TkMacOSXGetCapture, /* 47 */
- NULL, /* 48 */
+ 0, /* 48 */
TkGetTransientMaster, /* 49 */
TkGenerateButtonEvent, /* 50 */
TkGenWMDestroyEvent, /* 51 */
- NULL, /* 52 */
+ 0, /* 52 */
TkpGetMS, /* 53 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
- TkFreeWindowId, /* 1 */
- TkInitXId, /* 2 */
+ 0, /* 1 */
+ 0, /* 2 */
TkpCmapStressed, /* 3 */
TkpSync, /* 4 */
TkUnixContainerId, /* 5 */
@@ -448,15 +445,15 @@ TkIntPlatStubs tkIntPlatStubs = {
TkpScanWindowId, /* 8 */
TkWmCleanup, /* 9 */
TkSendCleanup, /* 10 */
- TkFreeXId, /* 11 */
+ 0, /* 11 */
TkpWmSetState, /* 12 */
TkpTestsendCmd, /* 13 */
#endif /* X11 */
};
-TkIntXlibStubs tkIntXlibStubs = {
+static const TkIntXlibStubs tkIntXlibStubs = {
TCL_STUB_MAGIC,
- NULL,
+ 0,
#ifdef __WIN32__ /* WIN */
XSetDashes, /* 0 */
XGetModifierMapping, /* 1 */
@@ -539,7 +536,7 @@ TkIntXlibStubs tkIntXlibStubs = {
XFilterEvent, /* 78 */
XmbLookupString, /* 79 */
TkPutImage, /* 80 */
- NULL, /* 81 */
+ 0, /* 81 */
XParseColor, /* 82 */
XCreateGC, /* 83 */
XFreeGC, /* 84 */
@@ -662,9 +659,9 @@ TkIntXlibStubs tkIntXlibStubs = {
#endif /* AQUA */
};
-TkPlatStubs tkPlatStubs = {
+static const TkPlatStubs tkPlatStubs = {
TCL_STUB_MAGIC,
- NULL,
+ 0,
#ifdef __WIN32__ /* WIN */
Tk_AttachHWND, /* 0 */
Tk_GetHINSTANCE, /* 1 */
@@ -688,14 +685,14 @@ TkPlatStubs tkPlatStubs = {
#endif /* AQUA */
};
-static TkStubHooks tkStubHooks = {
+static const TkStubHooks tkStubHooks = {
&tkPlatStubs,
&tkIntStubs,
&tkIntPlatStubs,
&tkIntXlibStubs
};
-TkStubs tkStubs = {
+const TkStubs tkStubs = {
TCL_STUB_MAGIC,
&tkStubHooks,
Tk_MainLoop, /* 0 */
@@ -742,7 +739,7 @@ TkStubs tkStubs = {
Tk_CreateSelHandler, /* 41 */
Tk_CreateWindow, /* 42 */
Tk_CreateWindowFromPath, /* 43 */
- Tk_DefineBitmap, /* 44 */
+ Tk_OldDefineBitmap, /* 44 */
Tk_DefineCursor, /* 45 */
Tk_DeleteAllBindings, /* 46 */
Tk_DeleteBinding, /* 47 */
@@ -784,7 +781,7 @@ TkStubs tkStubs = {
Tk_GetAtomName, /* 83 */
Tk_GetBinding, /* 84 */
Tk_GetBitmap, /* 85 */
- Tk_GetBitmapFromData, /* 86 */
+ Tk_OldGetBitmapFromData, /* 86 */
Tk_GetCapStyle, /* 87 */
Tk_GetColor, /* 88 */
Tk_GetColorByValue, /* 89 */
@@ -916,8 +913,8 @@ TkStubs tkStubs = {
Tk_InitConsoleChannels, /* 215 */
Tk_CreateConsoleWindow, /* 216 */
Tk_CreateSmoothMethod, /* 217 */
- NULL, /* 218 */
- NULL, /* 219 */
+ 0, /* 218 */
+ 0, /* 219 */
Tk_GetDash, /* 220 */
Tk_CreateOutline, /* 221 */
Tk_DeleteOutline, /* 222 */
@@ -972,9 +969,8 @@ TkStubs tkStubs = {
Tk_Interp, /* 271 */
Tk_CreateOldImageType, /* 272 */
Tk_CreateOldPhotoImageFormat, /* 273 */
+ Tk_DefineBitmap, /* 274 */
+ Tk_GetBitmapFromData, /* 275 */
};
/* !END!: Do not edit above this line. */
-
-#undef UNIX_TK
-#undef MAC_OSX_TK
diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c
index 5349a0b..53f177d 100644
--- a/generic/tkStubLib.c
+++ b/generic/tkStubLib.c
@@ -18,15 +18,10 @@
* including the rest of the stub functions.
*/
-#ifndef USE_TCL_STUBS
+#undef USE_TCL_STUBS
#define USE_TCL_STUBS
-#endif
-#undef USE_TCL_STUB_PROCS
-#ifndef USE_TK_STUBS
#define USE_TK_STUBS
-#endif
-#undef USE_TK_STUB_PROCS
#include "tkInt.h"
@@ -46,17 +41,25 @@
#include "tkPlatDecls.h"
#include "tkIntXlibDecls.h"
-TkStubs *tkStubsPtr = NULL;
-TkPlatStubs *tkPlatStubsPtr = NULL;
-TkIntStubs *tkIntStubsPtr = NULL;
-TkIntPlatStubs *tkIntPlatStubsPtr = NULL;
-TkIntXlibStubs *tkIntXlibStubsPtr = NULL;
+MODULE_SCOPE const TkStubs *tkStubsPtr;
+MODULE_SCOPE const TkPlatStubs *tkPlatStubsPtr;
+MODULE_SCOPE const TkIntStubs *tkIntStubsPtr;
+MODULE_SCOPE const TkIntPlatStubs *tkIntPlatStubsPtr;
+MODULE_SCOPE const TkIntXlibStubs *tkIntXlibStubsPtr;
+
+const TkStubs *tkStubsPtr = NULL;
+const TkPlatStubs *tkPlatStubsPtr = NULL;
+const TkIntStubs *tkIntStubsPtr = NULL;
+const TkIntPlatStubs *tkIntPlatStubsPtr = NULL;
+const TkIntXlibStubs *tkIntXlibStubsPtr = NULL;
/*
* Use our own isdigit to avoid linking to libc on windows
*/
-static int isDigit(const int c)
+static int
+isDigit(
+ const int c)
{
return (c >= '0' && c <= '9');
}
@@ -79,33 +82,29 @@ static int isDigit(const int c)
*----------------------------------------------------------------------
*/
-#ifdef Tk_InitStubs
-#undef Tk_InitStubs
-#endif
-
-CONST char *
+MODULE_SCOPE const char *
Tk_InitStubs(
Tcl_Interp *interp,
- CONST char *version,
+ const char *version,
int exact)
{
- CONST char *actualVersion;
- TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */
+ ClientData pkgClientData = NULL;
+ const char *actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0,
+ &pkgClientData);
+ const TkStubs *stubsPtr = pkgClientData;
- actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0,
- (ClientData *) stubsPtrPtr);
if (!actualVersion) {
return NULL;
}
if (exact) {
- CONST char *p = version;
+ const char *p = version;
int count = 0;
while (*p) {
count += !isDigit(*p++);
}
if (count == 1) {
- CONST char *q = actualVersion;
+ const char *q = actualVersion;
p = version;
while (*p && (*p == *q)) {
@@ -115,7 +114,6 @@ Tk_InitStubs(
/* Construct error message */
Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
return NULL;
-
}
} else {
actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
@@ -125,17 +123,18 @@ Tk_InitStubs(
}
}
- if (!tkStubsPtr) {
+ if (!stubsPtr) {
Tcl_SetResult(interp,
"This implementation of Tk does not support stubs",
TCL_STATIC);
return NULL;
}
- tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
- tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
- tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
- tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
+ tkPlatStubsPtr = stubsPtr->hooks->tkPlatStubs;
+ tkIntStubsPtr = stubsPtr->hooks->tkIntStubs;
+ tkIntPlatStubsPtr = stubsPtr->hooks->tkIntPlatStubs;
+ tkIntXlibStubsPtr = stubsPtr->hooks->tkIntXlibStubs;
+ tkStubsPtr = stubsPtr;
return actualVersion;
}
diff --git a/generic/tkStyle.c b/generic/tkStyle.c
index 80d4e59..76291fa 100644
--- a/generic/tkStyle.c
+++ b/generic/tkStyle.c
@@ -24,7 +24,7 @@ typedef struct StyledWidgetSpec {
* structure. */
Tk_OptionTable optionTable; /* Option table for the widget class using the
* element. */
- CONST Tk_OptionSpec **optionsPtr;
+ const Tk_OptionSpec **optionsPtr;
/* Table of option spec pointers, matching the
* option list provided during element
* registration. Malloc'd. */
@@ -58,11 +58,11 @@ typedef struct StyledElement {
*/
typedef struct StyleEngine {
- CONST char *name; /* Name of engine. Points to a hash key. */
+ 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*/
+ * are registered. Malloc'd. */
struct StyleEngine *parentPtr;
/* Parent engine. Engines may be layered to
* form a fallback chain, terminated by the
@@ -75,7 +75,7 @@ typedef struct StyleEngine {
*/
typedef struct Style {
- CONST char *name; /* Name of style. Points to a hash key. */
+ 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. */
@@ -86,7 +86,7 @@ typedef struct Style {
*/
typedef struct Element {
- CONST char *name; /* Name of element. Points to a hash key. */
+ 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
@@ -120,7 +120,7 @@ static Tcl_ThreadDataKey dataKey;
* Forward declarations for functions defined later in this file:
*/
-static int CreateElement(CONST char *name, int create);
+static int CreateElement(const char *name, int create);
static void DupStyleObjProc(Tcl_Obj *srcObjPtr,
Tcl_Obj *dupObjPtr);
static void FreeElement(Element *elementPtr);
@@ -132,13 +132,13 @@ static StyledElement * GetStyledElement(StyleEngine *enginePtr,
int elementId);
static StyledWidgetSpec*GetWidgetSpec(StyledElement *elementPtr,
Tk_OptionTable optionTable);
-static void InitElement(Element *elementPtr, CONST char *name,
+static void InitElement(Element *elementPtr, const char *name,
int id, int genericId, int created);
-static void InitStyle(Style *stylePtr, CONST char *name,
+static void InitStyle(Style *stylePtr, const char *name,
StyleEngine *enginePtr, ClientData clientData);
static void InitStyledElement(StyledElement *elementPtr);
static void InitStyleEngine(StyleEngine *enginePtr,
- CONST char *name, StyleEngine *parentPtr);
+ const char *name, StyleEngine *parentPtr);
static void InitWidgetSpec(StyledWidgetSpec *widgetSpecPtr,
StyledElement *elementPtr,
Tk_OptionTable optionTable);
@@ -150,7 +150,7 @@ static int SetStyleFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
* object points to the Style structure for the stylefont, or NULL.
*/
-static Tcl_ObjType styleObjType = {
+static const Tcl_ObjType styleObjType = {
"style", /* name */
FreeStyleObjProc, /* freeIntRepProc */
DupStyleObjProc, /* dupIntRepProc */
@@ -180,7 +180,7 @@ void
TkStylePkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->nbInit != 0) {
@@ -208,8 +208,7 @@ TkStylePkgInit(
* Create the default system style.
*/
- Tk_CreateStyle(NULL, (Tk_StyleEngine) tsdPtr->defaultEnginePtr,
- (ClientData) 0);
+ Tk_CreateStyle(NULL, (Tk_StyleEngine) tsdPtr->defaultEnginePtr, NULL);
tsdPtr->nbInit++;
}
@@ -236,7 +235,7 @@ void
TkStylePkgFree(
TkMainInfo *mainPtr) /* The application being deleted. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashSearch search;
Tcl_HashEntry *entryPtr;
@@ -254,7 +253,7 @@ TkStylePkgFree(
entryPtr = Tcl_FirstHashEntry(&tsdPtr->styleTable, &search);
while (entryPtr != NULL) {
- ckfree((char *) Tcl_GetHashValue(entryPtr));
+ ckfree(Tcl_GetHashValue(entryPtr));
entryPtr = Tcl_NextHashEntry(&search);
}
Tcl_DeleteHashTable(&tsdPtr->styleTable);
@@ -265,9 +264,9 @@ TkStylePkgFree(
entryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search);
while (entryPtr != NULL) {
- enginePtr = (StyleEngine *) Tcl_GetHashValue(entryPtr);
+ enginePtr = Tcl_GetHashValue(entryPtr);
FreeStyleEngine(enginePtr);
- ckfree((char *) enginePtr);
+ ckfree(enginePtr);
entryPtr = Tcl_NextHashEntry(&search);
}
Tcl_DeleteHashTable(&tsdPtr->engineTable);
@@ -280,7 +279,7 @@ TkStylePkgFree(
FreeElement(tsdPtr->elements+i);
}
Tcl_DeleteHashTable(&tsdPtr->elementTable);
- ckfree((char *) tsdPtr->elements);
+ ckfree(tsdPtr->elements);
}
/*
@@ -303,12 +302,12 @@ TkStylePkgFree(
Tk_StyleEngine
Tk_RegisterStyleEngine(
- CONST char *name, /* Name of the engine to create. NULL or empty
+ 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 *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr;
int newEntry;
@@ -332,10 +331,10 @@ Tk_RegisterStyleEngine(
* Allocate and intitialize a new engine.
*/
- enginePtr = (StyleEngine *) ckalloc(sizeof(StyleEngine));
+ enginePtr = ckalloc(sizeof(StyleEngine));
InitStyleEngine(enginePtr, Tcl_GetHashKey(&tsdPtr->engineTable, entryPtr),
(StyleEngine *) parent);
- Tcl_SetHashValue(entryPtr, (ClientData) enginePtr);
+ Tcl_SetHashValue(entryPtr, enginePtr);
return (Tk_StyleEngine) enginePtr;
}
@@ -359,13 +358,13 @@ Tk_RegisterStyleEngine(
static void
InitStyleEngine(
StyleEngine *enginePtr, /* Points to an uninitialized engine. */
- CONST char *name, /* Name of the registered engine. NULL or empty
+ 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 *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int elementId;
@@ -375,14 +374,12 @@ InitStyleEngine(
*/
enginePtr->parentPtr = NULL;
-
} else if (parentPtr == NULL) {
/*
* The default style engine is the parent.
*/
enginePtr->parentPtr = tsdPtr->defaultEnginePtr;
-
} else {
enginePtr->parentPtr = parentPtr;
}
@@ -392,7 +389,7 @@ InitStyleEngine(
*/
if (tsdPtr->nbElements > 0) {
- enginePtr->elements = (StyledElement *) ckalloc(
+ enginePtr->elements = ckalloc(
sizeof(StyledElement) * tsdPtr->nbElements);
for (elementId = 0; elementId < tsdPtr->nbElements; elementId++) {
InitStyledElement(enginePtr->elements+elementId);
@@ -422,7 +419,7 @@ static void
FreeStyleEngine(
StyleEngine *enginePtr) /* The style engine to free. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int elementId;
@@ -433,7 +430,7 @@ FreeStyleEngine(
for (elementId = 0; elementId < tsdPtr->nbElements; elementId++) {
FreeStyledElement(enginePtr->elements+elementId);
}
- ckfree((char *) enginePtr->elements);
+ ckfree(enginePtr->elements);
}
/*
@@ -454,10 +451,10 @@ FreeStyleEngine(
Tk_StyleEngine
Tk_GetStyleEngine(
- CONST char *name) /* Name of the engine to retrieve. NULL or
+ const char *name) /* Name of the engine to retrieve. NULL or
* empty means the default system engine. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr;
@@ -470,7 +467,7 @@ Tk_GetStyleEngine(
return NULL;
}
- return (Tk_StyleEngine) Tcl_GetHashValue(entryPtr);
+ return Tcl_GetHashValue(entryPtr);
}
/*
@@ -492,7 +489,7 @@ Tk_GetStyleEngine(
static void
InitElement(
Element *elementPtr, /* Points to an uninitialized element.*/
- CONST char *name, /* Name of the registered element. Usually
+ 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. */
@@ -581,7 +578,7 @@ FreeStyledElement(
for (i = 0; i < elementPtr->nbWidgetSpecs; i++) {
FreeWidgetSpec(elementPtr->widgetSpecs+i);
}
- ckfree((char *) elementPtr->widgetSpecs);
+ ckfree(elementPtr->widgetSpecs);
}
/*
@@ -602,17 +599,16 @@ FreeStyledElement(
static int
CreateElement(
- 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). */
+ 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 *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr, *engineEntryPtr;
Tcl_HashSearch search;
- int newEntry;
- int elementId, genericId = -1;
+ int newEntry, elementId, genericId = -1;
char *dot;
StyleEngine *enginePtr;
@@ -640,13 +636,13 @@ CreateElement(
}
elementId = tsdPtr->nbElements++;
- Tcl_SetHashValue(entryPtr, (ClientData) INT2PTR(elementId));
+ Tcl_SetHashValue(entryPtr, INT2PTR(elementId));
/*
* Reallocate element table.
*/
- tsdPtr->elements = (Element *) ckrealloc((char *) tsdPtr->elements,
+ tsdPtr->elements = ckrealloc(tsdPtr->elements,
sizeof(Element) * tsdPtr->nbElements);
InitElement(tsdPtr->elements+elementId,
Tcl_GetHashKey(&tsdPtr->elementTable, entryPtr), elementId,
@@ -658,10 +654,9 @@ CreateElement(
engineEntryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search);
while (engineEntryPtr != NULL) {
- enginePtr = (StyleEngine *) Tcl_GetHashValue(engineEntryPtr);
+ enginePtr = Tcl_GetHashValue(engineEntryPtr);
- enginePtr->elements = (StyledElement *) ckrealloc(
- (char *) enginePtr->elements,
+ enginePtr->elements = ckrealloc(enginePtr->elements,
sizeof(StyledElement) * tsdPtr->nbElements);
InitStyledElement(enginePtr->elements+elementId);
@@ -689,9 +684,9 @@ CreateElement(
int
Tk_GetElementId(
- CONST char *name) /* Name of the element. */
+ const char *name) /* Name of the element. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr;
int genericId = -1;
@@ -791,7 +786,7 @@ Tk_RegisterStyledElement(
elementPtr = ((StyleEngine *) engine)->elements+elementId;
- specPtr = (Tk_ElementSpec *) ckalloc(sizeof(Tk_ElementSpec));
+ specPtr = ckalloc(sizeof(Tk_ElementSpec));
specPtr->version = templatePtr->version;
specPtr->name = ckalloc(strlen(templatePtr->name)+1);
strcpy(specPtr->name, templatePtr->name);
@@ -800,7 +795,7 @@ Tk_RegisterStyledElement(
srcOptions->name != NULL; nbOptions++, srcOptions++) {
/* empty body */
}
- specPtr->options = (Tk_ElementOptionSpec *)
+ specPtr->options =
ckalloc(sizeof(Tk_ElementOptionSpec) * (nbOptions+1));
for (srcOptions = templatePtr->options, dstOptions = specPtr->options;
/* End condition within loop */; srcOptions++, dstOptions++) {
@@ -849,7 +844,7 @@ GetStyledElement(
int elementId) /* Unique element ID */
{
StyledElement *elementPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
StyleEngine *enginePtr2;
@@ -910,7 +905,7 @@ InitWidgetSpec(
{
int i, nbOptions;
Tk_ElementOptionSpec *elementOptionPtr;
- CONST Tk_OptionSpec *widgetOptionPtr;
+ const Tk_OptionSpec *widgetOptionPtr;
widgetSpecPtr->elementPtr = elementPtr;
widgetSpecPtr->optionTable = optionTable;
@@ -928,7 +923,7 @@ InitWidgetSpec(
* Build the widget option list.
*/
- widgetSpecPtr->optionsPtr = (CONST Tk_OptionSpec **)
+ widgetSpecPtr->optionsPtr =
ckalloc(sizeof(Tk_OptionSpec *) * nbOptions);
for (i = 0, elementOptionPtr = elementPtr->specPtr->options;
i < nbOptions; i++, elementOptionPtr++) {
@@ -969,7 +964,7 @@ FreeWidgetSpec(
StyledWidgetSpec *widgetSpecPtr)
/* The widget spec to free. */
{
- ckfree((char *) widgetSpecPtr->optionsPtr);
+ ckfree(widgetSpecPtr->optionsPtr);
}
/*
@@ -1013,8 +1008,7 @@ GetWidgetSpec(
*/
i = elementPtr->nbWidgetSpecs++;
- elementPtr->widgetSpecs = (StyledWidgetSpec *) ckrealloc(
- (char *) elementPtr->widgetSpecs,
+ elementPtr->widgetSpecs = ckrealloc(elementPtr->widgetSpecs,
sizeof(StyledWidgetSpec) * elementPtr->nbWidgetSpecs);
widgetSpecPtr = elementPtr->widgetSpecs+i;
InitWidgetSpec(widgetSpecPtr, elementPtr, optionTable);
@@ -1230,12 +1224,12 @@ Tk_DrawElement(
Tk_Style
Tk_CreateStyle(
- CONST char *name, /* Name of the style to create. NULL or empty
+ 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 *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr;
int newEntry;
@@ -1259,12 +1253,11 @@ Tk_CreateStyle(
* Allocate and intitialize a new style.
*/
- stylePtr = (Style *) ckalloc(sizeof(Style));
+ stylePtr = ckalloc(sizeof(Style));
InitStyle(stylePtr, Tcl_GetHashKey(&tsdPtr->styleTable, entryPtr),
- (engine != NULL ? (StyleEngine *) engine :
- tsdPtr->defaultEnginePtr),
+ (engine!=NULL ? (StyleEngine*) engine : tsdPtr->defaultEnginePtr),
clientData);
- Tcl_SetHashValue(entryPtr, (ClientData) stylePtr);
+ Tcl_SetHashValue(entryPtr, stylePtr);
return (Tk_Style) stylePtr;
}
@@ -1288,7 +1281,7 @@ Tk_CreateStyle(
*---------------------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_NameOfStyle(
Tk_Style style) /* Style whose name is desired. */
{
@@ -1316,7 +1309,7 @@ Tk_NameOfStyle(
static void
InitStyle(
Style *stylePtr, /* Points to an uninitialized style. */
- CONST char *name, /* Name of the registered style. NULL or empty
+ 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. */
@@ -1348,10 +1341,10 @@ InitStyle(
Tk_Style
Tk_GetStyle(
Tcl_Interp *interp, /* Interp for error return. */
- CONST char *name) /* Name of the style to retrieve. NULL or empty
+ const char *name) /* Name of the style to retrieve. NULL or empty
* means the default system style. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashEntry *entryPtr;
Style *stylePtr;
@@ -1368,7 +1361,7 @@ Tk_GetStyle(
}
return (Tk_Style) NULL;
}
- stylePtr = (Style *) Tcl_GetHashValue(entryPtr);
+ stylePtr = Tcl_GetHashValue(entryPtr);
return (Tk_Style) stylePtr;
}
@@ -1415,10 +1408,8 @@ Tk_AllocStyleFromObj(
if (objPtr->typePtr != &styleObjType) {
SetStyleFromAny(interp, objPtr);
- stylePtr = (Style *) objPtr->internalRep.otherValuePtr;
- } else {
- stylePtr = (Style *) objPtr->internalRep.otherValuePtr;
}
+ stylePtr = objPtr->internalRep.otherValuePtr;
return (Tk_Style) stylePtr;
}
@@ -1450,7 +1441,7 @@ Tk_GetStyleFromObj(
SetStyleFromAny(NULL, objPtr);
}
- return (Tk_Style) objPtr->internalRep.otherValuePtr;
+ return objPtr->internalRep.otherValuePtr;
}
/*
@@ -1501,11 +1492,11 @@ SetStyleFromAny(
name = Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(objPtr);
+ typePtr->freeIntRepProc(objPtr);
}
objPtr->typePtr = &styleObjType;
- objPtr->internalRep.otherValuePtr = (VOID *) Tk_GetStyle(interp, name);
+ objPtr->internalRep.otherValuePtr = Tk_GetStyle(interp, name);
return TCL_OK;
}
@@ -1549,7 +1540,8 @@ DupStyleObjProc(
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.otherValuePtr=srcObjPtr->internalRep.otherValuePtr;
+ dupObjPtr->internalRep.otherValuePtr =
+ srcObjPtr->internalRep.otherValuePtr;
}
/*
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 639ed8d..1df8ae8 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -14,6 +14,13 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#undef STATIC_BUILD
+#ifndef USE_TCL_STUBS
+# define USE_TCL_STUBS
+#endif
+#ifndef USE_TK_STUBS
+# define USE_TK_STUBS
+#endif
#include "tkInt.h"
#include "tkText.h"
@@ -31,6 +38,15 @@
#endif
/*
+ * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
+ * Tcltest_Init declaration is in the source file itself, which is only
+ * accessed when we are building a library.
+ */
+
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
+EXTERN int Tktest_Init(Tcl_Interp *interp);
+/*
* The following data structure represents the master for a test image:
*/
@@ -59,8 +75,8 @@ typedef struct TImageInstance {
*/
static int ImageCreate(Tcl_Interp *interp,
- char *name, int argc, Tcl_Obj *CONST objv[],
- Tk_ImageType *typePtr, Tk_ImageMaster master,
+ const char *name, int argc, Tcl_Obj *const objv[],
+ const Tk_ImageType *typePtr, Tk_ImageMaster master,
ClientData *clientDataPtr);
static ClientData ImageGet(Tk_Window tkwin, ClientData clientData);
static void ImageDisplay(ClientData clientData,
@@ -79,7 +95,8 @@ static Tk_ImageType imageType = {
ImageFree, /* freeProc */
ImageDelete, /* deleteProc */
NULL, /* postscriptPtr */
- NULL /* nextPtr */
+ NULL, /* nextPtr */
+ NULL
};
/*
@@ -96,25 +113,11 @@ typedef struct NewApp {
static NewApp *newAppPtr = NULL;/* First in list of all new interpreters. */
/*
- * Declaration for the square widget's class command function:
- */
-
-extern int SquareObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
-
-typedef struct CBinding {
- Tcl_Interp *interp;
- char *command;
- char *delete;
-} CBinding;
-
-/*
* Header for trivial configuration command items.
*/
-#define ODD TK_CONFIG_USER_BIT
-#define EVEN (TK_CONFIG_USER_BIT << 1)
+#define ODD TK_CONFIG_USER_BIT
+#define EVEN (TK_CONFIG_USER_BIT << 1)
enum {
NONE,
@@ -136,45 +139,38 @@ typedef struct TrivialCommandHeader {
* Forward declarations for functions defined later in this file:
*/
-static int CBindingEvalProc(ClientData clientData,
- Tcl_Interp *interp, XEvent *eventPtr,
- Tk_Window tkwin, KeySym keySym);
-static void CBindingFreeProc(ClientData clientData);
-int Tktest_Init(Tcl_Interp *interp);
static int ImageCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
-static int TestcbindCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
static int TestbitmapObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int TestborderObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int TestcolorObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int TestcursorObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int TestdeleteappsCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
static int TestfontObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int TestmakeexistCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
static int TestmenubarCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
#endif
#if defined(__WIN32__) || defined(MAC_OSX_TK)
static int TestmetricsCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
#endif
static int TestobjconfigObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static int CustomOptionSet(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj **value, char *recordPtr,
@@ -189,32 +185,17 @@ static void CustomOptionRestore(ClientData clientData,
static void CustomOptionFree(ClientData clientData,
Tk_Window tkwin, char *internalPtr);
static int TestpropCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
static int TestwrapperCmd(ClientData dummy,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
#endif
static void TrivialCmdDeletedProc(ClientData clientData);
static int TrivialConfigObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
- Tcl_Obj * CONST objv[]);
+ Tcl_Obj * const objv[]);
static void TrivialEventProc(ClientData clientData,
XEvent *eventPtr);
-
-/*
- * External (platform specific) initialization routine:
- */
-
-#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
-#define TkplatformtestInit(x) TCL_OK
-#else
-MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
-#endif
-
-/*
- * External legacy testing initialization routine:
- */
-MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
/*
*----------------------------------------------------------------------
@@ -239,6 +220,13 @@ Tktest_Init(
{
static int initialized = 0;
+ if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ if (Tk_InitStubs(interp, "8.1", 0) == NULL) {
+ return TCL_ERROR;
+ }
+
/*
* Create additional commands for testing Tk.
*/
@@ -247,10 +235,7 @@ Tktest_Init(
return TCL_ERROR;
}
- Tcl_CreateObjCommand(interp, "square", SquareObjCmd,
- (ClientData) NULL, NULL);
- Tcl_CreateCommand(interp, "testcbind", TestcbindCmd,
- (ClientData) Tk_MainWindow(interp), NULL);
+ Tcl_CreateObjCommand(interp, "square", SquareObjCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "testbitmap", TestbitmapObjCmd,
(ClientData) Tk_MainWindow(interp), NULL);
Tcl_CreateObjCommand(interp, "testborder", TestborderObjCmd,
@@ -313,113 +298,6 @@ Tktest_Init(
/*
*----------------------------------------------------------------------
*
- * TestcbindCmd --
- *
- * This function implements the "testcbinding" command. It provides a set
- * of functions for testing C bindings in tkBind.c.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * Depends on option; see below.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestcbindCmd(
- ClientData clientData, /* Main window for application. */
- Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
-{
- TkWindow *winPtr;
- Tk_Window tkwin;
- ClientData object;
- CBinding *cbindPtr;
-
-
- if (argc < 4 || argc > 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " bindtag pattern command ?deletecommand?", NULL);
- return TCL_ERROR;
- }
-
- tkwin = (Tk_Window) clientData;
-
- if (argv[1][0] == '.') {
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[1], tkwin);
- if (winPtr == NULL) {
- return TCL_ERROR;
- }
- object = (ClientData) winPtr->pathName;
- } else {
- winPtr = (TkWindow *) clientData;
- object = (ClientData) Tk_GetUid(argv[1]);
- }
-
- if (argv[3][0] == '\0') {
- return Tk_DeleteBinding(interp, winPtr->mainPtr->bindingTable,
- object, argv[2]);
- }
-
- cbindPtr = (CBinding *) ckalloc(sizeof(CBinding));
- cbindPtr->interp = interp;
- cbindPtr->command =
- strcpy((char *) ckalloc(strlen(argv[3]) + 1), argv[3]);
- if (argc == 4) {
- cbindPtr->delete = NULL;
- } else {
- cbindPtr->delete =
- strcpy((char *) ckalloc(strlen(argv[4]) + 1), argv[4]);
- }
-
- if (TkCreateBindingProcedure(interp, winPtr->mainPtr->bindingTable,
- object, argv[2], CBindingEvalProc, CBindingFreeProc,
- (ClientData) cbindPtr) == 0) {
- ckfree((char *) cbindPtr->command);
- if (cbindPtr->delete != NULL) {
- ckfree((char *) cbindPtr->delete);
- }
- ckfree((char *) cbindPtr);
- return TCL_ERROR;
- }
- return TCL_OK;
-}
-
-static int
-CBindingEvalProc(
- ClientData clientData,
- Tcl_Interp *interp,
- XEvent *eventPtr,
- Tk_Window tkwin,
- KeySym keySym)
-{
- CBinding *cbindPtr;
-
- cbindPtr = (CBinding *) clientData;
-
- return Tcl_GlobalEval(interp, cbindPtr->command);
-}
-
-static void
-CBindingFreeProc(
- ClientData clientData)
-{
- CBinding *cbindPtr = (CBinding *) clientData;
-
- if (cbindPtr->delete != NULL) {
- Tcl_GlobalEval(cbindPtr->interp, cbindPtr->delete);
- ckfree((char *) cbindPtr->delete);
- }
- ckfree((char *) cbindPtr->command);
- ckfree((char *) cbindPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TestbitmapObjCmd --
*
* This function implements the "testbitmap" command, which is used to
@@ -440,7 +318,7 @@ TestbitmapObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc < 2) {
@@ -475,7 +353,7 @@ TestborderObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc < 2) {
@@ -510,7 +388,7 @@ TestcolorObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "color");
@@ -544,7 +422,7 @@ TestcursorObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "cursor");
@@ -579,14 +457,14 @@ TestdeleteappsCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
NewApp *nextPtr;
while (newAppPtr != NULL) {
nextPtr = newAppPtr->nextPtr;
Tcl_DeleteInterp(newAppPtr->interp);
- ckfree((char *) newAppPtr);
+ ckfree(newAppPtr);
newAppPtr = nextPtr;
}
@@ -616,9 +494,9 @@ TestobjconfigObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *options[] = {
+ static const char *const options[] = {
"alltypes", "chain1", "chain2", "configerror", "delete", "info",
"internal", "new", "notenoughparams", "twowindows", NULL
};
@@ -631,13 +509,13 @@ TestobjconfigObjCmd(
/* Holds pointers to option tables created by
* commands below; indexed with same values as
* "options" array. */
- static Tk_ObjCustomOption CustomOption = {
+ static const Tk_ObjCustomOption CustomOption = {
"custom option",
CustomOptionSet,
CustomOptionGet,
CustomOptionRestore,
CustomOptionFree,
- (ClientData) 1
+ INT2PTR(1)
};
Tk_Window mainWin = (Tk_Window) clientData;
Tk_Window tkwin;
@@ -658,10 +536,10 @@ TestobjconfigObjCmd(
} ExtensionWidgetRecord;
static const Tk_OptionSpec baseSpecs[] = {
{TK_OPTION_STRING, "-one", "one", "One", "one",
- Tk_Offset(ExtensionWidgetRecord, base1ObjPtr), -1},
+ Tk_Offset(ExtensionWidgetRecord, base1ObjPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-two", "two", "Two", "two",
- Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1},
- {TK_OPTION_END}
+ Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
if (objc < 2) {
@@ -697,7 +575,7 @@ TestobjconfigObjCmd(
Tcl_Obj *customPtr;
} TypesRecord;
TypesRecord *recordPtr;
- static char *stringTable[] = {
+ static const char *const stringTable[] = {
"one", "two", "three", "four", NULL
};
static const Tk_OptionSpec typesSpecs[] = {
@@ -746,7 +624,7 @@ TestobjconfigObjCmd(
TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000},
{TK_OPTION_SYNONYM, "-synonym", NULL, NULL,
NULL, 0, -1, 0, (ClientData) "-color", 0x8000},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_OptionTable optionTable;
Tk_Window tkwin;
@@ -760,7 +638,7 @@ TestobjconfigObjCmd(
}
Tk_SetClass(tkwin, "Test");
- recordPtr = (TypesRecord *) ckalloc(sizeof(TypesRecord));
+ recordPtr = ckalloc(sizeof(TypesRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = optionTable;
recordPtr->header.tkwin = tkwin;
@@ -795,7 +673,7 @@ TestobjconfigObjCmd(
}
} else {
Tk_DestroyWindow(tkwin);
- ckfree((char *) recordPtr);
+ ckfree(recordPtr);
}
if (result == TCL_OK) {
Tcl_SetObjResult(interp, objv[2]);
@@ -817,8 +695,7 @@ TestobjconfigObjCmd(
optionTable = Tk_CreateOptionTable(interp, baseSpecs);
tables[index] = optionTable;
- recordPtr = (ExtensionWidgetRecord *)
- ckalloc(sizeof(ExtensionWidgetRecord));
+ recordPtr = ckalloc(sizeof(ExtensionWidgetRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = optionTable;
recordPtr->header.tkwin = tkwin;
@@ -847,16 +724,16 @@ TestobjconfigObjCmd(
ExtensionWidgetRecord *recordPtr;
static const Tk_OptionSpec extensionSpecs[] = {
{TK_OPTION_STRING, "-three", "three", "Three", "three",
- Tk_Offset(ExtensionWidgetRecord, extension3ObjPtr), -1},
+ Tk_Offset(ExtensionWidgetRecord, extension3ObjPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-four", "four", "Four", "four",
- Tk_Offset(ExtensionWidgetRecord, extension4ObjPtr), -1},
+ Tk_Offset(ExtensionWidgetRecord, extension4ObjPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-two", "two", "Two", "two and a half",
- Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1},
+ Tk_Offset(ExtensionWidgetRecord, base2ObjPtr), -1, 0, NULL, 0},
{TK_OPTION_STRING,
"-oneAgain", "oneAgain", "OneAgain", "one again",
- Tk_Offset(ExtensionWidgetRecord, extension5ObjPtr), -1},
+ Tk_Offset(ExtensionWidgetRecord, extension5ObjPtr), -1, 0, NULL, 0},
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0,
- (ClientData) baseSpecs}
+ (ClientData) baseSpecs, 0}
};
Tk_Window tkwin;
Tk_OptionTable optionTable;
@@ -870,8 +747,7 @@ TestobjconfigObjCmd(
optionTable = Tk_CreateOptionTable(interp, extensionSpecs);
tables[index] = optionTable;
- recordPtr = (ExtensionWidgetRecord *) ckalloc(
- sizeof(ExtensionWidgetRecord));
+ recordPtr = ckalloc(sizeof(ExtensionWidgetRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = optionTable;
recordPtr->header.tkwin = tkwin;
@@ -904,8 +780,8 @@ TestobjconfigObjCmd(
ErrorWidgetRecord widgetRecord;
static const Tk_OptionSpec errorSpecs[] = {
{TK_OPTION_INT, "-int", "integer", "Integer", "bogus",
- Tk_Offset(ErrorWidgetRecord, intPtr)},
- {TK_OPTION_END}
+ Tk_Offset(ErrorWidgetRecord, intPtr), 0, 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_OptionTable optionTable;
@@ -970,7 +846,7 @@ TestobjconfigObjCmd(
char *custom;
} InternalRecord;
InternalRecord *recordPtr;
- static char *internalStringTable[] = {
+ static const char *const internalStringTable[] = {
"one", "two", "three", "four", NULL
};
static const Tk_OptionSpec internalSpecs[] = {
@@ -1022,7 +898,7 @@ TestobjconfigObjCmd(
TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000},
{TK_OPTION_SYNONYM, "-synonym", NULL, NULL,
NULL, -1, -1, 0, (ClientData) "-color", 0x8000},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_OptionTable optionTable;
Tk_Window tkwin;
@@ -1036,7 +912,7 @@ TestobjconfigObjCmd(
}
Tk_SetClass(tkwin, "Test");
- recordPtr = (InternalRecord *) ckalloc(sizeof(InternalRecord));
+ recordPtr = ckalloc(sizeof(InternalRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = optionTable;
recordPtr->header.tkwin = tkwin;
@@ -1062,9 +938,9 @@ TestobjconfigObjCmd(
if (result == TCL_OK) {
recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp,
Tcl_GetString(objv[2]), TrivialConfigObjCmd,
- (ClientData) recordPtr, TrivialCmdDeletedProc);
+ recordPtr, TrivialCmdDeletedProc);
Tk_CreateEventHandler(tkwin, StructureNotifyMask,
- TrivialEventProc, (ClientData) recordPtr);
+ TrivialEventProc, recordPtr);
result = Tk_SetOptions(interp, (char *) recordPtr, optionTable,
objc - 3, objv + 3, tkwin, NULL, NULL);
if (result != TCL_OK) {
@@ -1072,7 +948,7 @@ TestobjconfigObjCmd(
}
} else {
Tk_DestroyWindow(tkwin);
- ckfree((char *) recordPtr);
+ ckfree(recordPtr);
}
if (result == TCL_OK) {
Tcl_SetObjResult(interp, objv[2]);
@@ -1092,24 +968,24 @@ TestobjconfigObjCmd(
FiveRecord *recordPtr;
static const Tk_OptionSpec smallSpecs[] = {
{TK_OPTION_INT, "-one", "one", "One", "1",
- Tk_Offset(FiveRecord, one), -1},
+ Tk_Offset(FiveRecord, one), -1, 0, NULL, 0},
{TK_OPTION_INT, "-two", "two", "Two", "2",
- Tk_Offset(FiveRecord, two), -1},
+ Tk_Offset(FiveRecord, two), -1, 0, NULL, 0},
{TK_OPTION_INT, "-three", "three", "Three", "3",
- Tk_Offset(FiveRecord, three), -1},
+ Tk_Offset(FiveRecord, three), -1, 0, NULL, 0},
{TK_OPTION_INT, "-four", "four", "Four", "4",
- Tk_Offset(FiveRecord, four), -1},
+ Tk_Offset(FiveRecord, four), -1, 0, NULL, 0},
{TK_OPTION_STRING, "-five", NULL, NULL, NULL,
- Tk_Offset(FiveRecord, five), -1},
- {TK_OPTION_END}
+ Tk_Offset(FiveRecord, five), -1, 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "new name ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "new name ?-option value ...?");
return TCL_ERROR;
}
- recordPtr = (FiveRecord *) ckalloc(sizeof(FiveRecord));
+ recordPtr = ckalloc(sizeof(FiveRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = Tk_CreateOptionTable(interp,
smallSpecs);
@@ -1134,7 +1010,7 @@ TestobjconfigObjCmd(
}
}
if (result != TCL_OK) {
- ckfree((char *) recordPtr);
+ ckfree(recordPtr);
}
break;
@@ -1146,8 +1022,8 @@ TestobjconfigObjCmd(
NotEnoughRecord record;
static const Tk_OptionSpec errorSpecs[] = {
{TK_OPTION_INT, "-foo", "foo", "Foo", "0",
- Tk_Offset(NotEnoughRecord, fooObjPtr)},
- {TK_OPTION_END}
+ Tk_Offset(NotEnoughRecord, fooObjPtr), 0, 0, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tcl_Obj *newObjPtr = Tcl_NewStringObj("-foo", -1);
Tk_OptionTable optionTable;
@@ -1177,8 +1053,8 @@ TestobjconfigObjCmd(
SlaveRecord *recordPtr;
static const Tk_OptionSpec slaveSpecs[] = {
{TK_OPTION_WINDOW, "-window", "window", "Window", ".bar",
- Tk_Offset(SlaveRecord, windowPtr), -1, TK_CONFIG_NULL_OK},
- {TK_OPTION_END}
+ Tk_Offset(SlaveRecord, windowPtr), -1, TK_CONFIG_NULL_OK, NULL, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0}
};
Tk_Window tkwin = Tk_CreateWindowFromPath(interp,
(Tk_Window) clientData, Tcl_GetString(objv[2]), NULL);
@@ -1188,7 +1064,7 @@ TestobjconfigObjCmd(
}
Tk_SetClass(tkwin, "Test");
- recordPtr = (SlaveRecord *) ckalloc(sizeof(SlaveRecord));
+ recordPtr = ckalloc(sizeof(SlaveRecord));
recordPtr->header.interp = interp;
recordPtr->header.optionTable = Tk_CreateOptionTable(interp,
slaveSpecs);
@@ -1205,9 +1081,9 @@ TestobjconfigObjCmd(
if (result == TCL_OK) {
recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp,
Tcl_GetString(objv[2]), TrivialConfigObjCmd,
- (ClientData) recordPtr, TrivialCmdDeletedProc);
+ recordPtr, TrivialCmdDeletedProc);
Tk_CreateEventHandler(tkwin, StructureNotifyMask,
- TrivialEventProc, (ClientData) recordPtr);
+ TrivialEventProc, recordPtr);
Tcl_SetObjResult(interp, objv[2]);
} else {
Tk_FreeConfigOptions((char *) recordPtr,
@@ -1216,7 +1092,7 @@ TestobjconfigObjCmd(
}
if (result != TCL_OK) {
Tk_DestroyWindow(tkwin);
- ckfree((char *) recordPtr);
+ ckfree(recordPtr);
}
}
}
@@ -1247,10 +1123,10 @@ TrivialConfigObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int result = TCL_OK;
- static CONST char *options[] = {
+ static const char *const options[] = {
"cget", "configure", "csave", NULL
};
enum {
@@ -1312,7 +1188,7 @@ TrivialConfigObjCmd(
headerPtr->optionTable, objc - 2, objv + 2,
tkwin, NULL, &mask);
if (result == TCL_OK) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), mask);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(mask));
}
}
break;
@@ -1322,7 +1198,7 @@ TrivialConfigObjCmd(
tkwin, &saved, &mask);
Tk_FreeSavedOptions(&saved);
if (result == TCL_OK) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), mask);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(mask));
}
break;
}
@@ -1430,9 +1306,9 @@ TestfontObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- static CONST char *options[] = {"counts", "subfonts", NULL};
+ static const char *const options[] = {"counts", "subfonts", NULL};
enum option {COUNTS, SUBFONTS};
int index;
Tk_Window tkwin;
@@ -1489,18 +1365,18 @@ static int
ImageCreate(
Tcl_Interp *interp, /* Interpreter for application containing
* image. */
- char *name, /* Name to use for image. */
+ const char *name, /* Name to use for image. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument strings for options (doesn't
+ Tcl_Obj *const objv[], /* Argument strings for options (doesn't
* include image name or type). */
- Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
+ const Tk_ImageType *typePtr, /* Pointer to our type record (not used). */
Tk_ImageMaster master, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
TImageMaster *timPtr;
- char *varName;
+ const char *varName;
int i;
varName = "log";
@@ -1518,17 +1394,17 @@ ImageCreate(
varName = Tcl_GetString(objv[i+1]);
}
- timPtr = (TImageMaster *) ckalloc(sizeof(TImageMaster));
+ timPtr = ckalloc(sizeof(TImageMaster));
timPtr->master = master;
timPtr->interp = interp;
timPtr->width = 30;
timPtr->height = 15;
- timPtr->imageName = (char *) ckalloc((unsigned) (strlen(name) + 1));
+ timPtr->imageName = ckalloc(strlen(name) + 1);
strcpy(timPtr->imageName, name);
- timPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1));
+ timPtr->varName = ckalloc(strlen(varName) + 1);
strcpy(timPtr->varName, varName);
- Tcl_CreateCommand(interp, name, ImageCmd, (ClientData) timPtr, NULL);
- *clientDataPtr = (ClientData) timPtr;
+ Tcl_CreateCommand(interp, name, ImageCmd, timPtr, NULL);
+ *clientDataPtr = timPtr;
Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15);
return TCL_OK;
}
@@ -1556,14 +1432,14 @@ ImageCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
TImageMaster *timPtr = (TImageMaster *) clientData;
int x, y, width, height;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], "option ?arg arg ...?", NULL);
+ argv[0], "option ?arg ...?", NULL);
return TCL_ERROR;
}
if (strcmp(argv[1], "changed") == 0) {
@@ -1623,12 +1499,12 @@ ImageGet(
Tcl_SetVar(timPtr->interp, timPtr->varName, buffer,
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
- instPtr = (TImageInstance *) ckalloc(sizeof(TImageInstance));
+ instPtr = ckalloc(sizeof(TImageInstance));
instPtr->masterPtr = timPtr;
instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000");
gcValues.foreground = instPtr->fg->pixel;
instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues);
- return (ClientData) instPtr;
+ return instPtr;
}
/*
@@ -1714,7 +1590,7 @@ ImageFree(
TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
Tk_FreeColor(instPtr->fg);
Tk_FreeGC(display, instPtr->gc);
- ckfree((char *) instPtr);
+ ckfree(instPtr);
}
/*
@@ -1750,7 +1626,7 @@ ImageDelete(
Tcl_DeleteCommand(timPtr->interp, timPtr->imageName);
ckfree(timPtr->imageName);
ckfree(timPtr->varName);
- ckfree((char *) timPtr);
+ ckfree(timPtr);
}
/*
@@ -1777,7 +1653,7 @@ TestmakeexistCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
Tk_Window mainWin = (Tk_Window) clientData;
int i;
@@ -1819,7 +1695,7 @@ TestmenubarCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
#ifdef __UNIX__
Tk_Window mainWin = (Tk_Window) clientData;
@@ -1888,7 +1764,7 @@ TestmetricsCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
char buf[TCL_INTEGER_SPACE];
int val;
@@ -1961,7 +1837,7 @@ TestpropCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
Tk_Window mainWin = (Tk_Window) clientData;
int result, actualFormat;
@@ -2041,7 +1917,7 @@ TestwrapperCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
TkWindow *winPtr, *wrapperPtr;
Tk_Window tkwin;
@@ -2123,6 +1999,7 @@ CustomOptionSet(
if (value == NULL) {
objEmpty = 1;
+ CLANG_ASSERT(value);
} else if ((*value)->bytes != NULL) {
objEmpty = ((*value)->length == 0);
} else {
@@ -2144,7 +2021,7 @@ CustomOptionSet(
if (internalPtr != NULL) {
if ((*value) != NULL) {
string = Tcl_GetStringFromObj((*value), &length);
- newStr = ckalloc((size_t) (length + 1));
+ newStr = ckalloc(length + 1);
strcpy(newStr, string);
} else {
newStr = NULL;
diff --git a/generic/tkText.c b/generic/tkText.c
index 187be65..360240c 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -48,7 +48,7 @@
* table below.
*/
-static char *stateStrings[] = {
+static const char *const stateStrings[] = {
"disabled", "normal", NULL
};
@@ -58,7 +58,7 @@ static char *stateStrings[] = {
* table below.
*/
-static char *wrapStrings[] = {
+static const char *const wrapStrings[] = {
"char", "none", "word", NULL
};
@@ -68,11 +68,21 @@ static char *wrapStrings[] = {
* the string table below.
*/
-static char *tabStyleStrings[] = {
+static const char *const tabStyleStrings[] = {
"tabular", "wordprocessor", NULL
};
/*
+ * The 'TkTextInsertUnfocussed' enum in tkText.h is used to define a type for
+ * the -insertunfocussed option of the Text widget. These values are used as
+ * indice into the string table below.
+ */
+
+static const char *const insertUnfocussedStrings[] = {
+ "hollow", "none", "solid", NULL
+};
+
+/*
* The following functions and custom option type are used to define the
* "line" option type, and thereby handle the text widget '-startline',
* '-endline' configuration options which are of that type.
@@ -96,7 +106,7 @@ static void RestoreLineStartEnd(ClientData clientData,
char *oldInternalPtr);
static int ObjectIsEmpty(Tcl_Obj *objPtr);
-static Tk_ObjCustomOption lineOption = {
+static const Tk_ObjCustomOption lineOption = {
"line", /* name */
SetLineStartEnd, /* setProc */
GetLineStartEnd, /* getProc */
@@ -175,6 +185,10 @@ static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
DEF_TEXT_INSERT_ON_TIME, -1, Tk_Offset(TkText, insertOnTime),
0, 0, 0},
+ {TK_OPTION_STRING_TABLE,
+ "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed",
+ DEF_TEXT_INSERT_UNFOCUSSED, -1, Tk_Offset(TkText, insertUnfocussed),
+ 0, (ClientData) insertUnfocussedStrings, 0},
{TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
DEF_TEXT_INSERT_WIDTH, -1, Tk_Offset(TkText, insertWidth),
0, 0, 0},
@@ -329,13 +343,13 @@ int tkTextDebug = 0;
*/
static int ConfigureText(Tcl_Interp *interp,
- TkText *textPtr, int objc, Tcl_Obj *CONST objv[]);
+ TkText *textPtr, int objc, Tcl_Obj *const objv[]);
static int DeleteIndexRange(TkSharedText *sharedPtr,
- TkText *textPtr, CONST TkTextIndex *indexPtr1,
- CONST TkTextIndex *indexPtr2, int viewUpdate);
-static int CountIndices(CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr1,
- CONST TkTextIndex *indexPtr2,
+ TkText *textPtr, const TkTextIndex *indexPtr1,
+ const TkTextIndex *indexPtr2, int viewUpdate);
+static int CountIndices(const TkText *textPtr,
+ const TkTextIndex *indexPtr1,
+ const TkTextIndex *indexPtr2,
TkTextCountType type);
static void DestroyText(TkText *textPtr);
static int InsertChars(TkSharedText *sharedTextPtr,
@@ -344,58 +358,58 @@ static int InsertChars(TkSharedText *sharedTextPtr,
static void TextBlinkProc(ClientData clientData);
static void TextCmdDeletedProc(ClientData clientData);
static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin,
- Tcl_Interp *interp, CONST TkText *parent,
- int objc, Tcl_Obj *CONST objv[]);
+ Tcl_Interp *interp, const TkText *parent,
+ int objc, Tcl_Obj *const objv[]);
static void TextEventProc(ClientData clientData,
XEvent *eventPtr);
static int TextFetchSelection(ClientData clientData, int offset,
char *buffer, int maxBytes);
-static int TextIndexSortProc(CONST void *first,
- CONST void *second);
+static int TextIndexSortProc(const void *first,
+ const void *second);
static int TextInsertCmd(TkSharedText *sharedTextPtr,
TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[],
- CONST TkTextIndex *indexPtr, int viewUpdate);
+ int objc, Tcl_Obj *const objv[],
+ const TkTextIndex *indexPtr, int viewUpdate);
static int TextReplaceCmd(TkText *textPtr, Tcl_Interp *interp,
- CONST TkTextIndex *indexFromPtr,
- CONST TkTextIndex *indexToPtr,
- int objc, Tcl_Obj *CONST objv[], int viewUpdate);
+ const TkTextIndex *indexFromPtr,
+ const TkTextIndex *indexToPtr,
+ int objc, Tcl_Obj *const objv[], int viewUpdate);
static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int TextWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int SharedTextObjCmd(ClientData clientData,
Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void TextWorldChangedCallback(ClientData instanceData);
static void TextWorldChanged(TkText *textPtr, int mask);
static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static int DumpLine(Tcl_Interp *interp, TkText *textPtr,
int what, TkTextLine *linePtr, int start, int end,
int lineno, Tcl_Obj *command);
static int DumpSegment(TkText *textPtr, Tcl_Interp *interp,
- CONST char *key, CONST char *value,
- Tcl_Obj *command, CONST TkTextIndex *index,
+ const char *key, const char *value,
+ Tcl_Obj *command, const TkTextIndex *index,
int what);
static int TextEditUndo(TkText *textPtr);
static int TextEditRedo(TkText *textPtr);
-static Tcl_Obj * TextGetText(CONST TkText *textPtr,
- CONST TkTextIndex *index1,
- CONST TkTextIndex *index2, int visibleOnly);
+static Tcl_Obj * TextGetText(const TkText *textPtr,
+ const TkTextIndex *index1,
+ const TkTextIndex *index2, int visibleOnly);
static void GenerateModifiedEvent(TkText *textPtr);
static void UpdateDirtyFlag(TkSharedText *sharedPtr);
static void TextPushUndoAction(TkText *textPtr,
Tcl_Obj *undoString, int insert,
- CONST TkTextIndex *index1Ptr,
- CONST TkTextIndex *index2Ptr);
-static int TextSearchIndexInLine(CONST SearchSpec *searchSpecPtr,
+ const TkTextIndex *index1Ptr,
+ const TkTextIndex *index2Ptr);
+static int TextSearchIndexInLine(const SearchSpec *searchSpecPtr,
TkTextLine *linePtr, int byteIndex);
static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]);
+ int objc, Tcl_Obj *const objv[]);
static TkUndoProc TextUndoRedoCallback;
/*
@@ -412,7 +426,7 @@ static SearchLineIndexProc TextSearchGetLineIndex;
* can be invoked from generic window code.
*/
-static Tk_ClassProcs textClass = {
+static const Tk_ClassProcs textClass = {
sizeof(Tk_ClassProcs), /* size */
TextWorldChangedCallback, /* worldChangedProc */
NULL, /* createProc */
@@ -441,12 +455,12 @@ Tk_TextObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
@@ -479,10 +493,10 @@ CreateWidget(
TkSharedText *sharedPtr, /* Shared widget info, or NULL. */
Tk_Window tkwin, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
- CONST TkText *parent, /* If non-NULL then take default start, end
+ const TkText *parent, /* If non-NULL then take default start, end
* from this parent. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register TkText *textPtr;
Tk_OptionTable optionTable;
@@ -505,7 +519,7 @@ CreateWidget(
* and 'insert', 'current' mark pointers are all NULL to start.
*/
- textPtr = (TkText *) ckalloc(sizeof(TkText));
+ textPtr = ckalloc(sizeof(TkText));
memset(textPtr, 0, sizeof(TkText));
textPtr->tkwin = newWin;
@@ -513,10 +527,10 @@ CreateWidget(
textPtr->interp = interp;
textPtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(textPtr->tkwin), TextWidgetObjCmd,
- (ClientData) textPtr, TextCmdDeletedProc);
+ textPtr, TextCmdDeletedProc);
if (sharedPtr == NULL) {
- sharedPtr = (TkSharedText *) ckalloc(sizeof(TkSharedText));
+ sharedPtr = ckalloc(sizeof(TkSharedText));
memset(sharedPtr, 0, sizeof(TkSharedText));
sharedPtr->refCount = 0;
@@ -614,7 +628,7 @@ CreateWidget(
*/
textPtr->selTagPtr = TkTextCreateTag(textPtr, "sel", NULL);
- textPtr->selTagPtr->reliefString = (char *)
+ textPtr->selTagPtr->reliefString =
ckalloc(sizeof(DEF_TEXT_SELECT_RELIEF));
strcpy(textPtr->selTagPtr->reliefString, DEF_TEXT_SELECT_RELIEF);
Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &textPtr->selTagPtr->relief);
@@ -629,18 +643,18 @@ CreateWidget(
optionTable = Tk_CreateOptionTable(interp, optionSpecs);
Tk_SetClass(textPtr->tkwin, "Text");
- Tk_SetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr);
+ Tk_SetClassProcs(textPtr->tkwin, &textClass, textPtr);
textPtr->optionTable = optionTable;
Tk_CreateEventHandler(textPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- TextEventProc, (ClientData) textPtr);
+ TextEventProc, textPtr);
Tk_CreateEventHandler(textPtr->tkwin, KeyPressMask|KeyReleaseMask
|ButtonPressMask|ButtonReleaseMask|EnterWindowMask
|LeaveWindowMask|PointerMotionMask|VirtualEventMask,
- TkTextBindProc, (ClientData) textPtr);
+ TkTextBindProc, textPtr);
Tk_CreateSelHandler(textPtr->tkwin, XA_PRIMARY, XA_STRING,
- TextFetchSelection, (ClientData) textPtr, XA_STRING);
+ TextFetchSelection, textPtr, XA_STRING);
if (Tk_InitOptions(interp, (char *) textPtr, optionTable, textPtr->tkwin)
!= TCL_OK) {
@@ -652,8 +666,7 @@ CreateWidget(
return TCL_ERROR;
}
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj(Tk_PathName(textPtr->tkwin),-1));
+ Tcl_SetObjResult(interp, TkNewWindowObj(textPtr->tkwin));
return TCL_OK;
}
@@ -680,13 +693,13 @@ TextWidgetObjCmd(
ClientData clientData, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
int result = TCL_OK;
int index;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"bbox", "cget", "compare", "configure", "count", "debug", "delete",
"dlineinfo", "dump", "edit", "get", "image", "index", "insert",
"mark", "peer", "replace", "scan", "search", "see", "tag", "window",
@@ -701,7 +714,7 @@ TextWidgetObjCmd(
};
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -714,7 +727,7 @@ TextWidgetObjCmd(
switch ((enum options) index) {
case TEXT_BBOX: {
int x, y, width, height;
- CONST TkTextIndex *indexPtr;
+ const TkTextIndex *indexPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "index");
@@ -758,8 +771,8 @@ TextWidgetObjCmd(
break;
case TEXT_COMPARE: {
int relation, value;
- CONST char *p;
- CONST TkTextIndex *index1Ptr, *index2Ptr;
+ const char *p;
+ const TkTextIndex *index1Ptr, *index2Ptr;
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "index1 op index2");
@@ -819,12 +832,12 @@ TextWidgetObjCmd(
}
break;
case TEXT_COUNT: {
- CONST TkTextIndex *indexFromPtr, *indexToPtr;
+ const TkTextIndex *indexFromPtr, *indexToPtr;
int i, found = 0, update = 0;
Tcl_Obj *objPtr = NULL;
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options? index1 index2");
+ Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? index1 index2");
result = TCL_ERROR;
goto done;
}
@@ -842,7 +855,7 @@ TextWidgetObjCmd(
for (i = 2; i < objc-2; i++) {
int value, length;
- CONST char *option = Tcl_GetStringFromObj(objv[i], &length);
+ const char *option = Tcl_GetStringFromObj(objv[i], &length);
char c;
if (length < 2 || option[0] != '-') {
@@ -881,7 +894,7 @@ TextWidgetObjCmd(
}
if (compare > 0) {
- CONST TkTextIndex *tmpPtr = indexFromPtr;
+ const TkTextIndex *tmpPtr = indexFromPtr;
indexFromPtr = indexToPtr;
indexToPtr = tmpPtr;
@@ -1062,7 +1075,7 @@ TextWidgetObjCmd(
* Simple case requires no predetermination of indices.
*/
- CONST TkTextIndex *indexPtr1, *indexPtr2;
+ const TkTextIndex *indexPtr1, *indexPtr2;
/*
* Parse the starting and stopping indices.
@@ -1100,20 +1113,19 @@ TextWidgetObjCmd(
objc -= 2;
objv += 2;
- indices = (TkTextIndex *)
- ckalloc((objc + 1) * sizeof(TkTextIndex));
+ indices = ckalloc((objc + 1) * sizeof(TkTextIndex));
/*
* First pass verifies that all indices are valid.
*/
for (i = 0; i < objc; i++) {
- CONST TkTextIndex *indexPtr =
+ const TkTextIndex *indexPtr =
TkTextGetIndexFromObj(interp, textPtr, objv[i]);
if (indexPtr == NULL) {
result = TCL_ERROR;
- ckfree((char *) indices);
+ ckfree(indices);
goto done;
}
indices[i] = *indexPtr;
@@ -1129,7 +1141,7 @@ TextWidgetObjCmd(
COUNT_INDICES);
objc++;
}
- useIdx = (char *) ckalloc((unsigned) objc);
+ useIdx = ckalloc(objc);
memset(useIdx, 0, (unsigned) objc);
/*
@@ -1193,13 +1205,13 @@ TextWidgetObjCmd(
&indices[i+1], 1);
}
}
- ckfree((char *) indices);
+ ckfree(indices);
}
}
break;
case TEXT_DLINEINFO: {
int x, y, width, height, base;
- CONST TkTextIndex *indexPtr;
+ const TkTextIndex *indexPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "index");
@@ -1234,7 +1246,7 @@ TextWidgetObjCmd(
case TEXT_GET: {
Tcl_Obj *objPtr = NULL;
int i, found = 0, visible = 0;
- CONST char *name;
+ const char *name;
int length;
if (objc < 3) {
@@ -1265,7 +1277,7 @@ TextWidgetObjCmd(
}
for (; i < objc; i += 2) {
- CONST TkTextIndex *index1Ptr, *index2Ptr;
+ const TkTextIndex *index1Ptr, *index2Ptr;
TkTextIndex index2;
index1Ptr = TkTextGetIndexFromObj(interp, textPtr, objv[i]);
@@ -1329,7 +1341,7 @@ TextWidgetObjCmd(
result = TkTextImageCmd(textPtr, interp, objc, objv);
break;
case TEXT_INDEX: {
- CONST TkTextIndex *indexPtr;
+ const TkTextIndex *indexPtr;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "index");
@@ -1346,7 +1358,7 @@ TextWidgetObjCmd(
break;
}
case TEXT_INSERT: {
- CONST TkTextIndex *indexPtr;
+ const TkTextIndex *indexPtr;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -1372,7 +1384,7 @@ TextWidgetObjCmd(
result = TextPeerCmd(textPtr, interp, objc, objv);
break;
case TEXT_REPLACE: {
- CONST TkTextIndex *indexFromPtr, *indexToPtr;
+ const TkTextIndex *indexFromPtr, *indexToPtr;
if (objc < 5) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -1501,7 +1513,7 @@ TextWidgetObjCmd(
done:
textPtr->refCount--;
if (textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
return result;
}
@@ -1531,13 +1543,13 @@ SharedTextObjCmd(
ClientData clientData, /* Information about shared test B-tree. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- register TkSharedText *sharedPtr = (TkSharedText *) clientData;
+ register TkSharedText *sharedPtr = clientData;
int result = TCL_OK;
int index;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"delete", "insert", NULL
};
enum options {
@@ -1545,7 +1557,7 @@ SharedTextObjCmd(
};
if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -1637,12 +1649,12 @@ TextPeerCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window tkwin = textPtr->tkwin;
int index;
- static CONST char *peerOptionStrings[] = {
+ static const char *const peerOptionStrings[] = {
"create", "names", NULL
};
enum peerOptions {
@@ -1650,7 +1662,7 @@ TextPeerCmd(
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -1662,7 +1674,7 @@ TextPeerCmd(
switch ((enum peerOptions)index) {
case PEER_CREATE:
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "pathName ?options?");
+ Tcl_WrongNumArgs(interp, 3, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
return CreateWidget(textPtr->sharedTextPtr, tkwin, interp, textPtr,
@@ -1711,12 +1723,12 @@ static int
TextReplaceCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
- CONST TkTextIndex *indexFromPtr,
+ const TkTextIndex *indexFromPtr,
/* Index from which to replace. */
- CONST TkTextIndex *indexToPtr,
+ const TkTextIndex *indexToPtr,
/* Index to which to replace. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
+ Tcl_Obj *const objv[], /* Argument objects. */
int viewUpdate) /* Update vertical view if set. */
{
/*
@@ -1781,8 +1793,8 @@ TextReplaceCmd(
static int
TextIndexSortProc(
- CONST void *first, /* Elements to be compared. */
- CONST void *second)
+ const void *first, /* Elements to be compared. */
+ const void *second)
{
TkTextIndex *pair1 = (TkTextIndex *) first;
TkTextIndex *pair2 = (TkTextIndex *) second;
@@ -1876,10 +1888,10 @@ DestroyText(
TkTextDeleteTag(textPtr, textPtr->selTagPtr);
TkBTreeUnlinkSegment(textPtr->insertMarkPtr,
textPtr->insertMarkPtr->body.mark.linePtr);
- ckfree((char *) textPtr->insertMarkPtr);
+ ckfree(textPtr->insertMarkPtr);
TkBTreeUnlinkSegment(textPtr->currentMarkPtr,
textPtr->currentMarkPtr->body.mark.linePtr);
- ckfree((char *) textPtr->currentMarkPtr);
+ ckfree(textPtr->currentMarkPtr);
/*
* Now we've cleaned up everything of relevance to us in the B-tree, so we
@@ -1901,7 +1913,7 @@ DestroyText(
for (hPtr = Tcl_FirstHashEntry(&sharedTextPtr->windowTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
TkTextEmbWindowClient *loop;
- TkTextSegment *ewPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ TkTextSegment *ewPtr = Tcl_GetHashValue(hPtr);
loop = ewPtr->body.ew.clients;
if (loop->textPtr == textPtr) {
@@ -1933,7 +1945,7 @@ DestroyText(
for (hPtr = Tcl_FirstHashEntry(&sharedTextPtr->tagTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr = Tcl_GetHashValue(hPtr);
/*
* No need to use 'TkTextDeleteTag' since we've already removed
@@ -1945,7 +1957,7 @@ DestroyText(
Tcl_DeleteHashTable(&sharedTextPtr->tagTable);
for (hPtr = Tcl_FirstHashEntry(&sharedTextPtr->markTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- ckfree((char *) Tcl_GetHashValue(hPtr));
+ ckfree(Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(&sharedTextPtr->markTable);
TkUndoFreeStack(sharedTextPtr->undoStack);
@@ -1956,11 +1968,11 @@ DestroyText(
if (sharedTextPtr->bindingTable != NULL) {
Tk_DeleteBindingTable(sharedTextPtr->bindingTable);
}
- ckfree((char *) sharedTextPtr);
+ ckfree(sharedTextPtr);
}
if (textPtr->tabArrayPtr != NULL) {
- ckfree((char *) textPtr->tabArrayPtr);
+ ckfree(textPtr->tabArrayPtr);
}
if (textPtr->insertBlinkHandler != NULL) {
Tcl_DeleteTimerHandler(textPtr->insertBlinkHandler);
@@ -1970,7 +1982,7 @@ DestroyText(
textPtr->refCount--;
Tcl_DeleteCommandFromToken(textPtr->interp, textPtr->widgetCmd);
if (textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
}
@@ -1999,7 +2011,7 @@ ConfigureText(
register TkText *textPtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_SavedOptions savedOptions;
int oldExport = textPtr->exportSelection;
@@ -2127,7 +2139,7 @@ ConfigureText(
*/
if (textPtr->tabArrayPtr != NULL) {
- ckfree((char *) textPtr->tabArrayPtr);
+ ckfree(textPtr->tabArrayPtr);
textPtr->tabArrayPtr = NULL;
}
if (textPtr->tabOptionPtr != NULL) {
@@ -2199,7 +2211,7 @@ ConfigureText(
if (TkBTreeCharTagged(&first, textPtr->selTagPtr)
|| TkBTreeNextTag(&search)) {
Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY, TkTextLostSelection,
- (ClientData) textPtr);
+ textPtr);
textPtr->flags |= GOT_SELECTION;
}
}
@@ -2210,8 +2222,8 @@ ConfigureText(
if (textPtr->flags & GOT_FOCUS) {
Tcl_DeleteTimerHandler(textPtr->insertBlinkHandler);
- textPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
- TextBlinkProc((ClientData) textPtr);
+ textPtr->insertBlinkHandler = NULL;
+ TextBlinkProc(textPtr);
}
/*
@@ -2254,9 +2266,8 @@ static void
TextWorldChangedCallback(
ClientData instanceData) /* Information about widget. */
{
- TkText *textPtr;
+ TkText *textPtr = instanceData;
- textPtr = (TkText *) instanceData;
TextWorldChanged(textPtr, TK_TEXT_LINE_GEOMETRY);
}
@@ -2342,7 +2353,7 @@ TextEventProc(
ClientData clientData, /* Information about window. */
register XEvent *eventPtr) /* Information about event. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
TkTextIndex index, index2;
if (eventPtr->type == Expose) {
@@ -2402,12 +2413,11 @@ TextEventProc(
textPtr->flags |= GOT_FOCUS | INSERT_ON;
if (textPtr->insertOffTime != 0) {
textPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- textPtr->insertOnTime, TextBlinkProc,
- (ClientData) textPtr);
+ textPtr->insertOnTime, TextBlinkProc, textPtr);
}
} else {
textPtr->flags &= ~(GOT_FOCUS | INSERT_ON);
- textPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
+ textPtr->insertBlinkHandler = NULL;
}
if (textPtr->inactiveSelBorder != textPtr->selBorder) {
TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr,
@@ -2452,7 +2462,7 @@ static void
TextCmdDeletedProc(
ClientData clientData) /* Pointer to widget record for widget. */
{
- TkText *textPtr = (TkText *) clientData;
+ TkText *textPtr = clientData;
Tk_Window tkwin = textPtr->tkwin;
/*
@@ -2510,7 +2520,7 @@ InsertChars(
int resetViewCount;
int pixels[2*PIXEL_CLIENTS];
- CONST char *string = Tcl_GetStringFromObj(stringPtr, &length);
+ const char *string = Tcl_GetStringFromObj(stringPtr, &length);
if (sharedTextPtr == NULL) {
sharedTextPtr = textPtr->sharedTextPtr;
@@ -2537,8 +2547,7 @@ InsertChars(
resetViewCount = 0;
if (sharedTextPtr->refCount > PIXEL_CLIENTS) {
- lineAndByteIndex = (int *)
- ckalloc(sizeof(int) * 2 * sharedTextPtr->refCount);
+ lineAndByteIndex = ckalloc(sizeof(int) * 2 * sharedTextPtr->refCount);
} else {
lineAndByteIndex = pixels;
}
@@ -2600,7 +2609,7 @@ InsertChars(
resetViewCount += 2;
}
if (sharedTextPtr->refCount > PIXEL_CLIENTS) {
- ckfree((char *) lineAndByteIndex);
+ ckfree(lineAndByteIndex);
}
/*
@@ -2642,9 +2651,9 @@ TextPushUndoAction(
TkText *textPtr, /* Overall information about text widget. */
Tcl_Obj *undoString, /* New text. */
int insert, /* 1 if insert, else delete. */
- CONST TkTextIndex *index1Ptr,
+ const TkTextIndex *index1Ptr,
/* Index describing first location. */
- CONST TkTextIndex *index2Ptr)
+ const TkTextIndex *index2Ptr)
/* Index describing second location. */
{
TkUndoSubAtom *iAtom, *dAtom;
@@ -2720,13 +2729,13 @@ TextPushUndoAction(
* underlying data shared by all peers.
*/
- iAtom = TkUndoMakeSubAtom(&TextUndoRedoCallback,
- (ClientData)textPtr->sharedTextPtr, insertCmdObj, NULL);
+ iAtom = TkUndoMakeSubAtom(&TextUndoRedoCallback, textPtr->sharedTextPtr,
+ insertCmdObj, NULL);
TkUndoMakeCmdSubAtom(NULL, markSet2InsertObj, iAtom);
TkUndoMakeCmdSubAtom(NULL, seeInsertObj, iAtom);
- dAtom = TkUndoMakeSubAtom(&TextUndoRedoCallback,
- (ClientData)textPtr->sharedTextPtr, deleteCmdObj, NULL);
+ dAtom = TkUndoMakeSubAtom(&TextUndoRedoCallback, textPtr->sharedTextPtr,
+ deleteCmdObj, NULL);
TkUndoMakeCmdSubAtom(NULL, markSet1InsertObj, dAtom);
TkUndoMakeCmdSubAtom(NULL, seeInsertObj, dAtom);
@@ -2775,7 +2784,7 @@ TextUndoRedoCallback(
Tcl_Obj *objPtr) /* Arguments of a command to be handled by the
* shared text data structure. */
{
- TkSharedText *sharedPtr = (TkSharedText *) clientData;
+ TkSharedText *sharedPtr = clientData;
int res, objc;
Tcl_Obj **objv;
TkText *textPtr;
@@ -2840,7 +2849,7 @@ TextUndoRedoCallback(
* the Tcl level.
*/
- return SharedTextObjCmd((ClientData)sharedPtr, interp, objc+1, objv-1);
+ return SharedTextObjCmd(sharedPtr, interp, objc+1, objv-1);
}
/*
@@ -2866,11 +2875,11 @@ TextUndoRedoCallback(
static int
CountIndices(
- CONST TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr1,
+ const TkText *textPtr, /* Overall information about text widget. */
+ const TkTextIndex *indexPtr1,
/* Index describing location of first
* character to delete. */
- CONST TkTextIndex *indexPtr2,
+ const TkTextIndex *indexPtr2,
/* Index describing location of last character
* to delete. NULL means just delete the one
* character given by indexPtr1. */
@@ -2923,10 +2932,10 @@ static int
DeleteIndexRange(
TkSharedText *sharedTextPtr,/* Shared portion of peer widgets. */
TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr1,
+ const TkTextIndex *indexPtr1,
/* Index describing location of first
* character (or other entity) to delete. */
- CONST TkTextIndex *indexPtr2,
+ const TkTextIndex *indexPtr2,
/* Index describing location of last
* character (or other entity) to delete.
* NULL means just delete the one character
@@ -2996,7 +3005,7 @@ DeleteIndexRange(
for (i = 0; i < arraySize; i++) {
TkBTreeTag(&index2, &oldIndex2, arrayPtr[i], 0);
}
- ckfree((char *) arrayPtr);
+ ckfree(arrayPtr);
}
}
@@ -3013,7 +3022,7 @@ DeleteIndexRange(
for (i=0, hPtr=Tcl_FirstHashEntry(&sharedTextPtr->tagTable, &search);
hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) {
- TkTextTag *tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ TkTextTag *tagPtr = Tcl_GetHashValue(hPtr);
TkBTreeTag(&index1, &index2, tagPtr, 0);
}
@@ -3050,8 +3059,7 @@ DeleteIndexRange(
resetViewCount = 0;
if (sharedTextPtr->refCount > PIXEL_CLIENTS) {
- lineAndByteIndex = (int *)
- ckalloc(sizeof(int) * 2 * sharedTextPtr->refCount);
+ lineAndByteIndex = ckalloc(sizeof(int) * 2 * sharedTextPtr->refCount);
} else {
lineAndByteIndex = pixels;
}
@@ -3102,7 +3110,7 @@ DeleteIndexRange(
} else {
lineAndByteIndex[resetViewCount] = -1;
}
- resetViewCount+=2;
+ resetViewCount += 2;
}
/*
@@ -3153,7 +3161,7 @@ DeleteIndexRange(
resetViewCount += 2;
}
if (sharedTextPtr->refCount > PIXEL_CLIENTS) {
- ckfree((char *) lineAndByteIndex);
+ ckfree(lineAndByteIndex);
}
if (line1 >= line2) {
@@ -3201,7 +3209,7 @@ TextFetchSelection(
* not including terminating NULL
* character. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
TkTextIndex eof;
int count, chunkSize, offsetInSeg;
TkTextSearch search;
@@ -3332,7 +3340,7 @@ void
TkTextLostSelection(
ClientData clientData) /* Information about text widget. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
if (TkpAlwaysShowSelection(textPtr->tkwin)) {
TkTextIndex start, end;
@@ -3426,12 +3434,22 @@ static void
TextBlinkProc(
ClientData clientData) /* Pointer to record describing text. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
TkTextIndex index;
int x, y, w, h, charWidth;
if ((textPtr->state == TK_TEXT_STATE_DISABLED) ||
!(textPtr->flags & GOT_FOCUS) || (textPtr->insertOffTime == 0)) {
+ if (!(textPtr->flags & GOT_FOCUS) &&
+ (textPtr->insertUnfocussed != TK_TEXT_INSERT_NOFOCUS_NONE)) {
+ /*
+ * The widget doesn't have the focus yet it is configured to
+ * display the cursor when it doesn't have the focus. Act now!
+ */
+
+ textPtr->flags |= INSERT_ON;
+ goto redrawInsert;
+ }
if ((textPtr->insertOffTime == 0) && !(textPtr->flags & INSERT_ON)) {
/*
* The widget was configured to have zero offtime while the
@@ -3446,11 +3464,11 @@ TextBlinkProc(
if (textPtr->flags & INSERT_ON) {
textPtr->flags &= ~INSERT_ON;
textPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- textPtr->insertOffTime, TextBlinkProc, (ClientData) textPtr);
+ textPtr->insertOffTime, TextBlinkProc, textPtr);
} else {
textPtr->flags |= INSERT_ON;
textPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- textPtr->insertOnTime, TextBlinkProc, (ClientData) textPtr);
+ textPtr->insertOnTime, TextBlinkProc, textPtr);
}
redrawInsert:
TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);
@@ -3493,8 +3511,8 @@ TextInsertCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
- CONST TkTextIndex *indexPtr,/* Index at which to insert. */
+ Tcl_Obj *const objv[], /* Argument objects. */
+ const TkTextIndex *indexPtr,/* Index at which to insert. */
int viewUpdate) /* Update the view if set. */
{
TkTextIndex index1, index2;
@@ -3529,7 +3547,7 @@ TextInsertCmd(
for (i = 0; i < numTags; i++) {
TkBTreeTag(&index1, &index2, oldTagArrayPtr[i], 0);
}
- ckfree((char *) oldTagArrayPtr);
+ ckfree(oldTagArrayPtr);
}
if (Tcl_ListObjGetElements(interp, objv[j+1], &numTags,
&tagNamePtrs) != TCL_OK) {
@@ -3538,7 +3556,7 @@ TextInsertCmd(
int i;
for (i = 0; i < numTags; i++) {
- CONST char *strTag = Tcl_GetString(tagNamePtrs[i]);
+ const char *strTag = Tcl_GetString(tagNamePtrs[i]);
TkBTreeTag(&index1, &index2,
TkTextCreateTag(textPtr, strTag, NULL), 1);
@@ -3572,12 +3590,12 @@ TextSearchCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int i, argsLeft, code;
SearchSpec searchSpec;
- static CONST char *switchStrings[] = {
+ static const char *const switchStrings[] = {
"--", "-all", "-backwards", "-count", "-elide", "-exact", "-forwards",
"-hidden", "-nocase", "-nolinestop", "-overlap", "-regexp",
"-strictlimits", NULL
@@ -3606,7 +3624,7 @@ TextSearchCmd(
searchSpec.strictLimits = 0;
searchSpec.numLines =
TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr);
- searchSpec.clientData = (ClientData)textPtr;
+ searchSpec.clientData = textPtr;
searchSpec.addLineProc = &TextSearchAddNextLine;
searchSpec.foundMatchProc = &TextSearchFoundMatch;
searchSpec.lineIndexProc = &TextSearchGetLineIndex;
@@ -3789,9 +3807,9 @@ TextSearchGetLineIndex(
int *offsetPosPtr) /* For returning the text offset in the
* line. */
{
- CONST TkTextIndex *indexPtr;
+ const TkTextIndex *indexPtr;
int line;
- TkText *textPtr = (TkText *) searchSpecPtr->clientData;
+ TkText *textPtr = searchSpecPtr->clientData;
indexPtr = TkTextGetIndexFromObj(interp, textPtr, objPtr);
if (indexPtr == NULL) {
@@ -3848,7 +3866,7 @@ TextSearchGetLineIndex(
static int
TextSearchIndexInLine(
- CONST SearchSpec *searchSpecPtr,
+ const SearchSpec *searchSpecPtr,
/* Search parameters. */
TkTextLine *linePtr, /* The line we're looking at. */
int byteIndex) /* Index into the line. */
@@ -3856,7 +3874,7 @@ TextSearchIndexInLine(
TkTextSegment *segPtr;
TkTextIndex curIndex;
int index, leftToScan;
- TkText *textPtr = (TkText *) searchSpecPtr->clientData;
+ TkText *textPtr = searchSpecPtr->clientData;
index = 0;
curIndex.tree = textPtr->sharedTextPtr->tree;
@@ -3926,7 +3944,7 @@ TextSearchAddNextLine(
TkTextLine *linePtr, *thisLinePtr;
TkTextIndex curIndex;
TkTextSegment *segPtr;
- TkText *textPtr = (TkText *) searchSpecPtr->clientData;
+ TkText *textPtr = searchSpecPtr->clientData;
int nothingYet = 1;
/*
@@ -4003,7 +4021,7 @@ TextSearchAddNextLine(
*lenPtr = Tcl_GetCharLength(theLine);
}
}
- return (ClientData)linePtr;
+ return linePtr;
}
/*
@@ -4047,7 +4065,7 @@ TextSearchFoundMatch(
TkTextIndex curIndex, foundIndex;
TkTextSegment *segPtr;
TkTextLine *linePtr;
- TkText *textPtr = (TkText *) searchSpecPtr->clientData;
+ TkText *textPtr = searchSpecPtr->clientData;
if (lineNum == searchSpecPtr->stopLine) {
/*
@@ -4068,7 +4086,7 @@ TextSearchFoundMatch(
*/
if (searchSpecPtr->exact) {
- CONST char *startOfLine = Tcl_GetString(theLine);
+ const char *startOfLine = Tcl_GetString(theLine);
numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength);
} else {
@@ -4098,7 +4116,7 @@ TextSearchFoundMatch(
* reached the end of the match or we have reached the end of the line.
*/
- linePtr = (TkTextLine *)clientData;
+ linePtr = clientData;
if (linePtr == NULL) {
linePtr = TkBTreeFindLine(textPtr->sharedTextPtr->tree, textPtr,
lineNum);
@@ -4279,7 +4297,7 @@ TkTextGetTabs(
/*
* Map these strings to TkTextTabAlign values.
*/
- static CONST char *tabOptionStrings[] = {
+ static const char *const tabOptionStrings[] = {
"left", "right", "center", "numeric", NULL
};
@@ -4294,6 +4312,7 @@ TkTextGetTabs(
count = 0;
for (i = 0; i < objc; i++) {
char c = Tcl_GetString(objv[i])[0];
+
if ((c != 'l') && (c != 'r') && (c != 'c') && (c != 'n')) {
count++;
}
@@ -4303,8 +4322,8 @@ TkTextGetTabs(
* Parse the elements of the list one at a time to fill in the array.
*/
- tabArrayPtr = (TkTextTabArray *) ckalloc((unsigned)
- (sizeof(TkTextTabArray) + (count-1)*sizeof(TkTextTab)));
+ tabArrayPtr = ckalloc(sizeof(TkTextTabArray)
+ + (count - 1) * sizeof(TkTextTab));
tabArrayPtr->numTabs = 0;
prevStop = 0.0;
lastStop = 0.0;
@@ -4328,8 +4347,8 @@ TkTextGetTabs(
}
prevStop = lastStop;
- if (Tk_GetDoublePixelsFromObj (interp, textPtr->tkwin, objv[i],
- &lastStop) != TCL_OK) {
+ if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i],
+ &lastStop) != TCL_OK) {
goto error;
}
@@ -4388,7 +4407,7 @@ TkTextGetTabs(
"tab alignment", 0, &index) != TCL_OK) {
goto error;
}
- tabPtr->alignment = ((TkTextTabAlign)index);
+ tabPtr->alignment = (TkTextTabAlign) index;
}
/*
@@ -4403,7 +4422,7 @@ TkTextGetTabs(
return tabArrayPtr;
error:
- ckfree((char *) tabArrayPtr);
+ ckfree(tabArrayPtr);
return NULL;
}
@@ -4431,7 +4450,7 @@ TextDumpCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "dump". */
{
@@ -4449,7 +4468,7 @@ TextDumpCmd(
#define TK_DUMP_IMG 0x10
#define TK_DUMP_ALL (TK_DUMP_TEXT|TK_DUMP_MARK|TK_DUMP_TAG| \
TK_DUMP_WIN|TK_DUMP_IMG)
- static CONST char *optStrings[] = {
+ static const char *const optStrings[] = {
"-all", "-command", "-image", "-mark", "-tag", "-text", "-window",
NULL
};
@@ -4517,7 +4536,7 @@ TextDumpCmd(
TkTextIndexForwChars(NULL, &index1, 1, &index2, COUNT_INDICES);
} else {
int length;
- char *str;
+ const char *str;
if (TkTextGetObjIndex(interp, textPtr, objv[arg], &index2) != TCL_OK) {
return TCL_ERROR;
@@ -4556,8 +4575,8 @@ TextDumpCmd(
if (lineno == lineend) {
break;
}
- textChanged = DumpLine(interp, textPtr, what, linePtr, 0, 32000000,
- lineno, command);
+ textChanged = DumpLine(interp, textPtr, what, linePtr, 0,
+ 32000000, lineno, command);
if (textChanged) {
if (textPtr->flags & DESTROYED) {
return TCL_OK;
@@ -4666,7 +4685,7 @@ DumpLine(
*/
int length = last - first;
- char *range = ckalloc((length + 1) * sizeof(char));
+ char *range = ckalloc(length + 1);
memcpy(range, segPtr->body.chars + first,
length * sizeof(char));
@@ -4684,9 +4703,11 @@ DumpLine(
segPtr->body.chars + first, command, &index, what);
}
} else if ((offset >= startByte)) {
- if ((what & TK_DUMP_MARK) && (segPtr->typePtr->name[0] == 'm')) {
- char *name;
- TkTextMark *markPtr = (TkTextMark *) &segPtr->body;
+ if ((what & TK_DUMP_MARK)
+ && (segPtr->typePtr == &tkTextLeftMarkType
+ || segPtr->typePtr == &tkTextRightMarkType)) {
+ const char *name;
+ TkTextMark *markPtr = &segPtr->body.mark;
if (segPtr == textPtr->insertMarkPtr) {
name = "insert";
@@ -4720,18 +4741,18 @@ DumpLine(
segPtr->body.toggle.tagPtr->name, command, &index,
what);
} else if ((what & TK_DUMP_IMG) &&
- (segPtr->typePtr->name[0] == 'i')) {
- TkTextEmbImage *eiPtr = (TkTextEmbImage *)&segPtr->body;
- char *name = (eiPtr->name == NULL) ? "" : eiPtr->name;
+ (segPtr->typePtr == &tkTextEmbImageType)) {
+ TkTextEmbImage *eiPtr = &segPtr->body.ei;
+ const char *name = (eiPtr->name == NULL) ? "" : eiPtr->name;
TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr,
lineno, offset, &index);
lineChanged = DumpSegment(textPtr, interp, "image", name,
command, &index, what);
} else if ((what & TK_DUMP_WIN) &&
- (segPtr->typePtr->name[0] == 'w')) {
- TkTextEmbWindow *ewPtr = (TkTextEmbWindow *)&segPtr->body;
- char *pathname;
+ (segPtr->typePtr == &tkTextEmbWindowType)) {
+ TkTextEmbWindow *ewPtr = &segPtr->body.ew;
+ const char *pathname;
if (ewPtr->tkwin == (Tk_Window) NULL) {
pathname = "";
@@ -4821,10 +4842,10 @@ static int
DumpSegment(
TkText *textPtr,
Tcl_Interp *interp,
- CONST char *key, /* Segment type key. */
- CONST char *value, /* Segment value. */
+ const char *key, /* Segment type key. */
+ const char *value, /* Segment value. */
Tcl_Obj *command, /* Script callback. */
- CONST TkTextIndex *index, /* index with line/byte position info. */
+ const TkTextIndex *index, /* index with line/byte position info. */
int what) /* Look for TK_DUMP_INDEX bit. */
{
char buffer[TK_POS_CHARS];
@@ -4836,7 +4857,7 @@ DumpSegment(
Tcl_AppendElement(interp, buffer);
return 0;
} else {
- CONST char *argv[4];
+ const char *argv[4];
char *list;
int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree);
@@ -4973,11 +4994,11 @@ TextEditCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int index;
- static CONST char *editOptionStrings[] = {
+ static const char *const editOptionStrings[] = {
"modified", "redo", "reset", "separator", "undo", NULL
};
enum editOptions {
@@ -4985,7 +5006,7 @@ TextEditCmd(
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -5107,10 +5128,10 @@ TextEditCmd(
static Tcl_Obj *
TextGetText(
- CONST TkText *textPtr, /* Information about text widget. */
- CONST TkTextIndex *indexPtr1,
+ const TkText *textPtr, /* Information about text widget. */
+ const TkTextIndex *indexPtr1,
/* Get text from this index... */
- CONST TkTextIndex *indexPtr2,
+ const TkTextIndex *indexPtr2,
/* ...to this index. */
int visibleOnly) /* If non-zero, then only return non-elided
* characters. */
@@ -5164,7 +5185,7 @@ TextGetText(
*
* GenerateModifiedEvent --
*
- * Send an event that the text was modified. This is equivalent to
+ * Send an event that the text was modified. This is equivalent to:
* event generate $textWidget <<Modified>>
*
* Results:
@@ -5290,7 +5311,7 @@ SearchPerform(
* for regexp search, utf-8 bytes for exact search).
*/
- if ((*searchSpecPtr->lineIndexProc)(interp, fromPtr, searchSpecPtr,
+ if (searchSpecPtr->lineIndexProc(interp, fromPtr, searchSpecPtr,
&searchSpecPtr->startLine,
&searchSpecPtr->startOffset) != TCL_OK) {
return TCL_ERROR;
@@ -5301,8 +5322,8 @@ SearchPerform(
*/
if (toPtr != NULL) {
- CONST TkTextIndex *indexToPtr, *indexFromPtr;
- TkText *textPtr = (TkText *) searchSpecPtr->clientData;
+ const TkTextIndex *indexToPtr, *indexFromPtr;
+ TkText *textPtr = searchSpecPtr->clientData;
indexToPtr = TkTextGetIndexFromObj(interp, textPtr, toPtr);
if (indexToPtr == NULL) {
@@ -5326,7 +5347,7 @@ SearchPerform(
}
}
- if ((*searchSpecPtr->lineIndexProc)(interp, toPtr, searchSpecPtr,
+ if (searchSpecPtr->lineIndexProc(interp, toPtr, searchSpecPtr,
&searchSpecPtr->stopLine,
&searchSpecPtr->stopOffset) != TCL_OK) {
return TCL_ERROR;
@@ -5395,7 +5416,7 @@ SearchCore(
Tcl_Obj *theLine;
int alreadySearchOffset = -1;
- CONST char *pattern = NULL; /* For exact searches only. */
+ const char *pattern = NULL; /* For exact searches only. */
int firstNewLine = -1; /* For exact searches only. */
Tcl_RegExp regexp = NULL; /* For regexp searches only. */
@@ -5453,7 +5474,7 @@ SearchCore(
*/
if (searchSpecPtr->exact) {
- CONST char *nl;
+ const char *nl;
/*
* We only need to set the matchLength once for exact searches, and we
@@ -5512,8 +5533,8 @@ SearchCore(
* this line, which is what 'lastOffset' represents.
*/
- lineInfo = (*searchSpecPtr->addLineProc)(lineNum, searchSpecPtr,
- theLine, &lastOffset, &linesSearched);
+ lineInfo = searchSpecPtr->addLineProc(lineNum, searchSpecPtr, theLine,
+ &lastOffset, &linesSearched);
if (lineInfo == NULL) {
/*
@@ -5590,11 +5611,12 @@ SearchCore(
if (searchSpecPtr->exact) {
int maxExtraLines = 0;
- CONST char *startOfLine = Tcl_GetString(theLine);
+ const char *startOfLine = Tcl_GetString(theLine);
+ CLANG_ASSERT(pattern);
do {
Tcl_UniChar ch;
- CONST char *p;
+ const char *p;
int lastFullLine = lastOffset;
if (firstNewLine == -1) {
@@ -5619,7 +5641,7 @@ SearchCore(
* match.
*/
- CONST char c = pattern[0];
+ const char c = pattern[0];
if (alreadySearchOffset != -1) {
p = startOfLine + alreadySearchOffset;
@@ -5697,7 +5719,7 @@ SearchCore(
*/
if (extraLines > maxExtraLines) {
- if ((*searchSpecPtr->addLineProc)(lineNum
+ if (searchSpecPtr->addLineProc(lineNum
+ extraLines, searchSpecPtr, theLine,
&lastTotal, &extraLines) == NULL) {
p = NULL;
@@ -5777,9 +5799,8 @@ SearchCore(
matchOffset = p - startOfLine;
if (searchSpecPtr->all &&
- !(*searchSpecPtr->foundMatchProc)(lineNum,
- searchSpecPtr, lineInfo, theLine, matchOffset,
- matchLength)) {
+ !searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr,
+ lineInfo, theLine, matchOffset, matchLength)) {
/*
* We reached the end of the search.
*/
@@ -5920,7 +5941,7 @@ SearchCore(
*/
if (extraLines > maxExtraLines) {
- if ((*searchSpecPtr->addLineProc)(lineNum
+ if (searchSpecPtr->addLineProc(lineNum
+ extraLines, searchSpecPtr, theLine,
&lastTotal, &extraLines) == NULL) {
/*
@@ -6099,9 +6120,9 @@ SearchCore(
if (lastBackwardsLineMatch != -1) {
recordBackwardsMatch:
- (*searchSpecPtr->foundMatchProc)(
- lastBackwardsLineMatch, searchSpecPtr, NULL,
- NULL, lastBackwardsMatchOffset, matchLength);
+ searchSpecPtr->foundMatchProc(lastBackwardsLineMatch,
+ searchSpecPtr, NULL, NULL,
+ lastBackwardsMatchOffset, matchLength);
lastBackwardsLineMatch = -1;
if (!searchSpecPtr->all) {
goto searchDone;
@@ -6144,13 +6165,13 @@ SearchCore(
* matches on the heap.
*/
- int *newArray = (int *)
+ int *newArray =
ckalloc(4 * matchNum * sizeof(int));
memcpy(newArray, storeMatch, matchNum*sizeof(int));
memcpy(newArray + 2*matchNum, storeLength,
matchNum * sizeof(int));
if (storeMatch != smArray) {
- ckfree((char *) storeMatch);
+ ckfree(storeMatch);
}
matchNum *= 2;
storeMatch = newArray;
@@ -6166,7 +6187,7 @@ SearchCore(
*/
if (searchSpecPtr->all &&
- !(*searchSpecPtr->foundMatchProc)(lineNum,
+ !searchSpecPtr->foundMatchProc(lineNum,
searchSpecPtr, lineInfo, theLine, matchOffset,
matchLength)) {
/*
@@ -6257,7 +6278,7 @@ SearchCore(
continue;
}
}
- (*searchSpecPtr->foundMatchProc)(lineNum, searchSpecPtr,
+ searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr,
lineInfo, theLine, matchOffset, matchLength);
if (!searchSpecPtr->all) {
goto searchDone;
@@ -6272,7 +6293,7 @@ SearchCore(
* non-all case.
*/
- (*searchSpecPtr->foundMatchProc)(lineNum, searchSpecPtr,
+ searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr,
lineInfo, theLine, matchOffset, matchLength);
} else {
lastBackwardsLineMatch = lineNum;
@@ -6291,7 +6312,7 @@ SearchCore(
if ((lastBackwardsLineMatch == -1) && (matchOffset >= 0)
&& !searchSpecPtr->all) {
- (*searchSpecPtr->foundMatchProc)(lineNum, searchSpecPtr, lineInfo,
+ searchSpecPtr->foundMatchProc(lineNum, searchSpecPtr, lineInfo,
theLine, matchOffset, matchLength);
goto searchDone;
}
@@ -6318,7 +6339,7 @@ SearchCore(
if (lastBackwardsLineMatch != -1
&& ((lineNum < 0)
|| (lineNum + 2 < lastBackwardsLineMatch))) {
- (*searchSpecPtr->foundMatchProc)(lastBackwardsLineMatch,
+ searchSpecPtr->foundMatchProc(lastBackwardsLineMatch,
searchSpecPtr, NULL, NULL,
lastBackwardsMatchOffset, matchLength);
lastBackwardsLineMatch = -1;
@@ -6364,7 +6385,7 @@ SearchCore(
searchDone:
if (lastBackwardsLineMatch != -1) {
- (*searchSpecPtr->foundMatchProc)(lastBackwardsLineMatch, searchSpecPtr,
+ searchSpecPtr->foundMatchProc(lastBackwardsLineMatch, searchSpecPtr,
NULL, NULL, lastBackwardsMatchOffset, matchLength);
}
@@ -6380,7 +6401,7 @@ SearchCore(
*/
if (storeMatch != smArray) {
- ckfree((char *) storeMatch);
+ ckfree(storeMatch);
}
return code;
@@ -6415,9 +6436,8 @@ GetLineStartEnd(
if (linePtr == NULL) {
return Tcl_NewObj();
- } else {
- return Tcl_NewIntObj(1+TkBTreeLinesTo(NULL, linePtr));
}
+ return Tcl_NewIntObj(1 + TkBTreeLinesTo(NULL, linePtr));
}
/*
@@ -6565,7 +6585,7 @@ TkpTesttextCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
TkText *textPtr;
size_t len;
@@ -6582,9 +6602,9 @@ TkpTesttextCmd(
return TCL_ERROR;
}
if (info.isNativeObjectProc) {
- textPtr = (TkText *) info.objClientData;
+ textPtr = info.objClientData;
} else {
- textPtr = (TkText *) info.clientData;
+ textPtr = info.clientData;
}
len = strlen(argv[2]);
if (strncmp(argv[2], "byteindex", len) == 0) {
diff --git a/generic/tkText.h b/generic/tkText.h
index 289e64b..483550b 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -21,17 +21,6 @@
#include "tkUndo.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
-/*
- * Opaque types for structures whose guts are only needed by a single file.
- */
-
-typedef struct TkTextBTree_ *TkTextBTree;
-
/*
* The data structure below defines a single logical line of text (from
* newline to newline, not necessarily what appears on one display line of the
@@ -179,7 +168,7 @@ typedef struct TkTextSegment {
int size; /* Size of this segment (# of bytes of index
* space it occupies). */
union {
- char chars[4]; /* Characters that make up character info.
+ char chars[1]; /* Characters that make up character info.
* Actual length varies to hold as many
* characters as needed.*/
TkTextToggle toggle; /* Information about tag toggle. */
@@ -493,7 +482,7 @@ typedef struct TkTextTabArray {
} TkTextTabArray;
/*
- * Enumeration definining the edit modes of the widget.
+ * Enumeration defining the edit modes of the widget.
*/
typedef enum {
@@ -594,6 +583,17 @@ typedef struct TkSharedText {
} TkSharedText;
/*
+ * The following enum is used to define a type for the -insertunfocussed
+ * option of the Text widget.
+ */
+
+typedef enum {
+ TK_TEXT_INSERT_NOFOCUS_HOLLOW,
+ TK_TEXT_INSERT_NOFOCUS_NONE,
+ TK_TEXT_INSERT_NOFOCUS_SOLID
+} TkTextInsertUnfocussed;
+
+/*
* A data structure of the following type is kept for each text widget that
* currently exists for this process:
*/
@@ -725,7 +725,10 @@ typedef struct TkText {
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
* cursor. */
int insertWidth; /* Total width of insert cursor. */
- int insertBorderWidth; /* Width of 3-D border around insert cursor. */
+ int insertBorderWidth; /* Width of 3-D border around insert cursor */
+ TkTextInsertUnfocussed insertUnfocussed;
+ /* How to display the insert cursor when the
+ * text widget does not have the focus. */
int insertOnTime; /* Number of milliseconds cursor should spend
* in "on" state for each blink. */
int insertOffTime; /* Number of milliseconds cursor should spend
@@ -954,6 +957,8 @@ MODULE_SCOPE const Tk_SegType tkTextLeftMarkType;
MODULE_SCOPE const Tk_SegType tkTextRightMarkType;
MODULE_SCOPE const Tk_SegType tkTextToggleOnType;
MODULE_SCOPE const Tk_SegType tkTextToggleOffType;
+MODULE_SCOPE const Tk_SegType tkTextEmbWindowType;
+MODULE_SCOPE const Tk_SegType tkTextEmbImageType;
/*
* Convenience macros for use by B-tree clients which want to access pixel
@@ -1005,8 +1010,6 @@ MODULE_SCOPE void TkBTreeLinkSegment(TkTextSegment *segPtr,
MODULE_SCOPE TkTextLine *TkBTreeNextLine(const TkText *textPtr,
TkTextLine *linePtr);
MODULE_SCOPE int TkBTreeNextTag(TkTextSearch *searchPtr);
-MODULE_SCOPE int TkBTreeNumLines(TkTextBTree tree,
- const TkText *textPtr);
MODULE_SCOPE int TkBTreeNumPixels(TkTextBTree tree,
const TkText *textPtr);
MODULE_SCOPE TkTextLine *TkBTreePreviousLine(TkText *textPtr,
@@ -1026,9 +1029,6 @@ MODULE_SCOPE void TkBTreeUnlinkSegment(TkTextSegment *segPtr,
MODULE_SCOPE void TkTextBindProc(ClientData clientData,
XEvent *eventPtr);
MODULE_SCOPE void TkTextSelectionEvent(TkText *textPtr);
-MODULE_SCOPE void TkTextChanged(TkSharedText *sharedTextPtr,
- TkText *textPtr, const TkTextIndex *index1Ptr,
- const TkTextIndex *index2Ptr);
MODULE_SCOPE int TkTextIndexBbox(TkText *textPtr,
const TkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr, int *charWidthPtr);
@@ -1049,8 +1049,6 @@ MODULE_SCOPE TkTextTag *TkTextCreateTag(TkText *textPtr,
MODULE_SCOPE void TkTextFreeDInfo(TkText *textPtr);
MODULE_SCOPE void TkTextDeleteTag(TkText *textPtr, TkTextTag *tagPtr);
MODULE_SCOPE void TkTextFreeTag(TkText *textPtr, TkTextTag *tagPtr);
-MODULE_SCOPE int TkTextGetIndex(Tcl_Interp *interp, TkText *textPtr,
- const char *string, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextGetObjIndex(Tcl_Interp *interp, TkText *textPtr,
Tcl_Obj *idxPtr, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextSharedGetObjIndex(Tcl_Interp *interp,
@@ -1062,9 +1060,6 @@ MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp,
TkText *textPtr, Tcl_Obj *stringPtr);
MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr,
TkTextIndex *indexPtr, int end, int *xOffset);
-MODULE_SCOPE int TkTextIndexBackBytes(const TkText *textPtr,
- const TkTextIndex *srcPtr, int count,
- TkTextIndex *dstPtr);
MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr,
const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr, TkTextCountType type);
@@ -1074,9 +1069,6 @@ MODULE_SCOPE int TkTextIndexCount(const TkText *textPtr,
const TkTextIndex *index1Ptr,
const TkTextIndex *index2Ptr,
TkTextCountType type);
-MODULE_SCOPE int TkTextIndexForwBytes(const TkText *textPtr,
- const TkTextIndex *srcPtr, int count,
- TkTextIndex *dstPtr);
MODULE_SCOPE void TkTextIndexForwChars(const TkText *textPtr,
const TkTextIndex *srcPtr, int count,
TkTextIndex *dstPtr, TkTextCountType type);
@@ -1086,10 +1078,6 @@ MODULE_SCOPE int TkTextIndexYPixels(TkText *textPtr,
const TkTextIndex *indexPtr);
MODULE_SCOPE TkTextSegment *TkTextIndexToSeg(const TkTextIndex *indexPtr,
int *offsetPtr);
-MODULE_SCOPE void TkTextInsertDisplayProc(TkText *textPtr,
- TkTextDispChunk *chunkPtr, int x, int y,
- int height, int baseline, Display *display,
- Drawable dst, int screenY);
MODULE_SCOPE void TkTextLostSelection(ClientData clientData);
MODULE_SCOPE TkTextIndex *TkTextMakeCharIndex(TkTextBTree tree, TkText *textPtr,
int lineIndex, int charIndex,
@@ -1100,9 +1088,6 @@ MODULE_SCOPE void TkTextFreeElideInfo(TkTextElideInfo *infoPtr);
MODULE_SCOPE int TkTextIsElided(const TkText *textPtr,
const TkTextIndex *indexPtr,
TkTextElideInfo *infoPtr);
-MODULE_SCOPE TkTextIndex *TkTextMakeByteIndex(TkTextBTree tree,
- const TkText *textPtr, int lineIndex,
- int byteIndex, TkTextIndex *indexPtr);
MODULE_SCOPE int TkTextMakePixelIndex(TkText *textPtr,
int pixelIndex, TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextInvalidateLineMetrics(
@@ -1123,8 +1108,6 @@ MODULE_SCOPE void TkTextEventuallyRepick(TkText *textPtr);
MODULE_SCOPE void TkTextPickCurrent(TkText *textPtr, XEvent *eventPtr);
MODULE_SCOPE void TkTextPixelIndex(TkText *textPtr, int x, int y,
TkTextIndex *indexPtr, int *nearest);
-MODULE_SCOPE int TkTextPrintIndex(const TkText *textPtr,
- const TkTextIndex *indexPtr, char *string);
MODULE_SCOPE Tcl_Obj * TkTextNewIndexObj(TkText *textPtr,
const TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextRedrawRegion(TkText *textPtr, int x, int y,
@@ -1140,8 +1123,6 @@ MODULE_SCOPE int TkTextSeeCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextSegToOffset(const TkTextSegment *segPtr,
const TkTextLine *linePtr);
-MODULE_SCOPE TkTextSegment *TkTextSetMark(TkText *textPtr,
- const char *name, TkTextIndex *indexPtr);
MODULE_SCOPE void TkTextSetYView(TkText *textPtr,
TkTextIndex *indexPtr, int pickPlace);
MODULE_SCOPE int TkTextTagCmd(TkText *textPtr, Tcl_Interp *interp,
@@ -1154,16 +1135,11 @@ MODULE_SCOPE int TkTextWindowCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextWindowIndex(TkText *textPtr, const char *name,
TkTextIndex *indexPtr);
-MODULE_SCOPE int TkTextXviewCmd(TkText *textPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkTextYviewCmd(TkText *textPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE void TkTextWinFreeClient(Tcl_HashEntry *hPtr,
TkTextEmbWindowClient *client);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKTEXT */
/*
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index 0038e64..572c623 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -273,9 +273,9 @@ TkBTreeCreate(
* of the tree.
*/
- rootPtr = (Node *) ckalloc(sizeof(Node));
- linePtr = (TkTextLine *) ckalloc(sizeof(TkTextLine));
- linePtr2 = (TkTextLine *) ckalloc(sizeof(TkTextLine));
+ rootPtr = ckalloc(sizeof(Node));
+ linePtr = ckalloc(sizeof(TkTextLine));
+ linePtr2 = ckalloc(sizeof(TkTextLine));
rootPtr->parentPtr = NULL;
rootPtr->nextPtr = NULL;
@@ -296,7 +296,7 @@ TkBTreeCreate(
linePtr->parentPtr = rootPtr;
linePtr->nextPtr = linePtr2;
- segPtr = (TkTextSegment *) ckalloc(CSEG_SIZE(1));
+ segPtr = ckalloc(CSEG_SIZE(1));
linePtr->segPtr = segPtr;
segPtr->typePtr = &tkTextCharType;
segPtr->nextPtr = NULL;
@@ -306,7 +306,7 @@ TkBTreeCreate(
linePtr2->parentPtr = rootPtr;
linePtr2->nextPtr = NULL;
- segPtr = (TkTextSegment *) ckalloc(CSEG_SIZE(1));
+ segPtr = ckalloc(CSEG_SIZE(1));
linePtr2->segPtr = segPtr;
segPtr->typePtr = &tkTextCharType;
segPtr->nextPtr = NULL;
@@ -314,7 +314,7 @@ TkBTreeCreate(
segPtr->body.chars[0] = '\n';
segPtr->body.chars[1] = 0;
- treePtr = (BTree *) ckalloc(sizeof(BTree));
+ treePtr = ckalloc(sizeof(BTree));
treePtr->sharedTextPtr = sharedTextPtr;
treePtr->rootPtr = rootPtr;
treePtr->clients = 0;
@@ -478,10 +478,10 @@ TkBTreeDestroy(
DestroyNode(treePtr->rootPtr);
if (treePtr->startEnd != NULL) {
- ckfree((char *) treePtr->startEnd);
- ckfree((char *) treePtr->startEndRef);
+ ckfree(treePtr->startEnd);
+ ckfree(treePtr->startEndRef);
}
- ckfree((char *) treePtr);
+ ckfree(treePtr);
}
/*
@@ -543,7 +543,7 @@ TkBTreeRemoveClient(
*/
DestroyNode(treePtr->rootPtr);
- ckfree((char *) treePtr);
+ ckfree(treePtr);
return;
} else if (pixelReference == -1) {
/*
@@ -632,11 +632,9 @@ AdjustStartEndRefs(
i++;
}
treePtr->startEndCount = count;
- treePtr->startEnd = (TkTextLine **)
- ckrealloc((char *) treePtr->startEnd,
+ treePtr->startEnd = ckrealloc(treePtr->startEnd,
sizeof(TkTextLine *) * count);
- treePtr->startEndRef = (TkText **)
- ckrealloc((char *) treePtr->startEndRef,
+ treePtr->startEndRef = ckrealloc(treePtr->startEndRef,
sizeof(TkText *) * count);
}
if ((action & TEXT_ADD_REFS)
@@ -652,11 +650,9 @@ AdjustStartEndRefs(
count = treePtr->startEndCount;
- treePtr->startEnd = (TkTextLine **)
- ckrealloc((char *) treePtr->startEnd,
+ treePtr->startEnd = ckrealloc(treePtr->startEnd,
sizeof(TkTextLine *) * count);
- treePtr->startEndRef = (TkText **)
- ckrealloc((char *) treePtr->startEndRef,
+ treePtr->startEndRef = ckrealloc(treePtr->startEndRef,
sizeof(TkText *) * count);
if (textPtr->start != NULL) {
@@ -739,7 +735,7 @@ AdjustPixelClient(
*counting = 0;
}
if (newPixelReferences != treePtr->pixelReferences) {
- linePtr->pixels = (int *) ckrealloc((char *) linePtr->pixels,
+ linePtr->pixels = ckrealloc(linePtr->pixels,
sizeof(int) * 2 * newPixelReferences);
}
@@ -756,7 +752,7 @@ AdjustPixelClient(
}
}
if (newPixelReferences != treePtr->pixelReferences) {
- nodePtr->numPixels = (int *) ckrealloc((char *) nodePtr->numPixels,
+ nodePtr->numPixels = ckrealloc(nodePtr->numPixels,
sizeof(int) * newPixelReferences);
}
nodePtr->numPixels[useReference] = pixelCount;
@@ -805,7 +801,7 @@ RemovePixelClient(
if (treePtr->pixelReferences == 1) {
nodePtr->numPixels = NULL;
} else {
- nodePtr->numPixels = (int *) ckrealloc((char *) nodePtr->numPixels,
+ nodePtr->numPixels = ckrealloc(nodePtr->numPixels,
sizeof(int) * (treePtr->pixelReferences - 1));
}
if (nodePtr->level != 0) {
@@ -826,7 +822,7 @@ RemovePixelClient(
if (treePtr->pixelReferences == 1) {
linePtr->pixels = NULL;
} else {
- linePtr->pixels = (int *) ckrealloc((char *) linePtr->pixels,
+ linePtr->pixels = ckrealloc(linePtr->pixels,
sizeof(int) * 2 * (treePtr->pixelReferences-1));
}
linePtr = linePtr->nextPtr;
@@ -865,10 +861,10 @@ DestroyNode(
while (linePtr->segPtr != NULL) {
segPtr = linePtr->segPtr;
linePtr->segPtr = segPtr->nextPtr;
- (*segPtr->typePtr->deleteProc)(segPtr, linePtr, 1);
+ segPtr->typePtr->deleteProc(segPtr, linePtr, 1);
}
- ckfree((char *) linePtr->pixels);
- ckfree((char *) linePtr);
+ ckfree(linePtr->pixels);
+ ckfree(linePtr);
}
} else {
register Node *childPtr;
@@ -880,8 +876,8 @@ DestroyNode(
}
}
DeleteSummaries(nodePtr->summaryPtr);
- ckfree((char *) nodePtr->numPixels);
- ckfree((char *) nodePtr);
+ ckfree(nodePtr->numPixels);
+ ckfree(nodePtr);
}
/*
@@ -910,7 +906,7 @@ DeleteSummaries(
while (summaryPtr != NULL) {
nextPtr = summaryPtr->nextPtr;
- ckfree((char *) summaryPtr);
+ ckfree(summaryPtr);
summaryPtr = nextPtr;
}
}
@@ -1047,8 +1043,7 @@ TkBTreeInsertChars(
changeToLineCount = 0;
if (treePtr->pixelReferences > PIXEL_CLIENTS) {
- changeToPixelCount = (int *)
- ckalloc(sizeof(int) * treePtr->pixelReferences);
+ changeToPixelCount = ckalloc(sizeof(int) * treePtr->pixelReferences);
} else {
changeToPixelCount = pixels;
}
@@ -1064,7 +1059,7 @@ TkBTreeInsertChars(
}
}
chunkSize = eol-string;
- segPtr = (TkTextSegment *) ckalloc(CSEG_SIZE(chunkSize));
+ segPtr = ckalloc(CSEG_SIZE(chunkSize));
segPtr->typePtr = &tkTextCharType;
if (curPtr == NULL) {
segPtr->nextPtr = linePtr->segPtr;
@@ -1086,8 +1081,8 @@ TkBTreeInsertChars(
* the remainder of the old line to it.
*/
- newLinePtr = (TkTextLine *) ckalloc(sizeof(TkTextLine));
- newLinePtr->pixels = (int *)
+ newLinePtr = ckalloc(sizeof(TkTextLine));
+ newLinePtr->pixels =
ckalloc(sizeof(int) * 2 * treePtr->pixelReferences);
newLinePtr->parentPtr = linePtr->parentPtr;
@@ -1147,7 +1142,7 @@ TkBTreeInsertChars(
}
}
if (treePtr->pixelReferences > PIXEL_CLIENTS) {
- ckfree((char *) changeToPixelCount);
+ ckfree(changeToPixelCount);
}
nodePtr = linePtr->parentPtr;
@@ -1205,7 +1200,7 @@ SplitSeg(
if (count == 0) {
return prevPtr;
}
- segPtr = (*segPtr->typePtr->splitProc)(segPtr, count);
+ segPtr = segPtr->typePtr->splitProc(segPtr, count);
if (prevPtr == NULL) {
indexPtr->linePtr->segPtr = segPtr;
} else {
@@ -1231,8 +1226,9 @@ SplitSeg(
/*
* Reached end of the text.
*/
+ } else {
+ segPtr = linePtr->segPtr;
}
- segPtr = linePtr->segPtr;
}
}
Tcl_Panic("SplitSeg reached end of line!");
@@ -1280,7 +1276,7 @@ CleanupLine(
segPtr != NULL;
prevPtrPtr = &(*prevPtrPtr)->nextPtr, segPtr = *prevPtrPtr) {
if (segPtr->typePtr->cleanupProc != NULL) {
- *prevPtrPtr = (*segPtr->typePtr->cleanupProc)(segPtr, linePtr);
+ *prevPtrPtr = segPtr->typePtr->cleanupProc(segPtr, linePtr);
if (segPtr != *prevPtrPtr) {
anyChanges = 1;
}
@@ -1387,6 +1383,7 @@ TkBTreeDeleteIndexRange(
}
}
changeToLineCount++;
+ CLANG_ASSERT(curNodePtr);
curNodePtr->numChildren--;
/*
@@ -1417,8 +1414,8 @@ TkBTreeDeleteIndexRange(
checkCount++;
}
}
- ckfree((char *) curLinePtr->pixels);
- ckfree((char *) curLinePtr);
+ ckfree(curLinePtr->pixels);
+ ckfree(curLinePtr);
}
curLinePtr = nextLinePtr;
segPtr = curLinePtr->segPtr;
@@ -1442,7 +1439,7 @@ TkBTreeDeleteIndexRange(
prevNodePtr->nextPtr = curNodePtr->nextPtr;
}
parentPtr->numChildren--;
- ckfree((char *) curNodePtr);
+ ckfree(curNodePtr);
curNodePtr = parentPtr;
}
curNodePtr = curLinePtr->parentPtr;
@@ -1450,7 +1447,7 @@ TkBTreeDeleteIndexRange(
}
nextPtr = segPtr->nextPtr;
- if ((*segPtr->typePtr->deleteProc)(segPtr, curLinePtr, 0) != 0) {
+ if (segPtr->typePtr->deleteProc(segPtr, curLinePtr, 0) != 0) {
/*
* This segment refuses to die. Move it to prevPtr and advance
* prevPtr if the segment has left gravity.
@@ -1481,7 +1478,7 @@ TkBTreeDeleteIndexRange(
for (segPtr = lastPtr; segPtr != NULL;
segPtr = segPtr->nextPtr) {
if (segPtr->typePtr->lineChangeProc != NULL) {
- (*segPtr->typePtr->lineChangeProc)(segPtr, index2Ptr->linePtr);
+ segPtr->typePtr->lineChangeProc(segPtr, index2Ptr->linePtr);
}
}
curNodePtr = index2Ptr->linePtr->parentPtr;
@@ -1537,8 +1534,8 @@ TkBTreeDeleteIndexRange(
checkCount++;
}
}
- ckfree((char *) index2Ptr->linePtr->pixels);
- ckfree((char *) index2Ptr->linePtr);
+ ckfree(index2Ptr->linePtr->pixels);
+ ckfree(index2Ptr->linePtr);
Rebalance((BTree *) index2Ptr->tree, curNodePtr);
}
@@ -2133,7 +2130,7 @@ TkBTreeTag(
oldState = TkBTreeCharTagged(index1Ptr, tagPtr);
if ((add != 0) ^ oldState) {
- segPtr = (TkTextSegment *) ckalloc(TSEG_SIZE);
+ segPtr = ckalloc(TSEG_SIZE);
segPtr->typePtr = (add) ? &tkTextToggleOnType : &tkTextToggleOffType;
prevPtr = SplitSeg(index1Ptr);
if (prevPtr == NULL) {
@@ -2178,7 +2175,7 @@ TkBTreeTag(
} else {
changed = 0;
}
- ckfree((char *) segPtr);
+ ckfree(segPtr);
/*
* The code below is a bit tricky. After deleting a toggle we
@@ -2204,7 +2201,7 @@ TkBTreeTag(
}
}
if ((add != 0) ^ oldState) {
- segPtr = (TkTextSegment *) ckalloc(TSEG_SIZE);
+ segPtr = ckalloc(TSEG_SIZE);
segPtr->typePtr = (add) ? &tkTextToggleOffType : &tkTextToggleOnType;
prevPtr = SplitSeg(index2Ptr);
if (prevPtr == NULL) {
@@ -2329,7 +2326,7 @@ ChangeNodeToggleCount(
} else {
prevPtr->nextPtr = summaryPtr->nextPtr;
}
- ckfree((char *) summaryPtr);
+ ckfree(summaryPtr);
} else {
/*
* This tag isn't currently in the summary information list.
@@ -2348,7 +2345,7 @@ ChangeNodeToggleCount(
Node *rootNodePtr = tagPtr->tagRootPtr;
- summaryPtr = (Summary *) ckalloc(sizeof(Summary));
+ summaryPtr = ckalloc(sizeof(Summary));
summaryPtr->tagPtr = tagPtr;
summaryPtr->toggleCount = tagPtr->toggleCount - delta;
summaryPtr->nextPtr = rootNodePtr->summaryPtr;
@@ -2357,7 +2354,7 @@ ChangeNodeToggleCount(
rootLevel = rootNodePtr->level;
tagPtr->tagRootPtr = rootNodePtr;
}
- summaryPtr = (Summary *) ckalloc(sizeof(Summary));
+ summaryPtr = ckalloc(sizeof(Summary));
summaryPtr->tagPtr = tagPtr;
summaryPtr->toggleCount = delta;
summaryPtr->nextPtr = nodePtr->summaryPtr;
@@ -2414,7 +2411,7 @@ ChangeNodeToggleCount(
} else {
prevPtr->nextPtr = summaryPtr->nextPtr;
}
- ckfree((char *) summaryPtr);
+ ckfree(summaryPtr);
tagPtr->tagRootPtr = node2Ptr;
break;
}
@@ -2463,7 +2460,7 @@ FindTagStart(
* level 0 node.
*/
- while (nodePtr->level > 0) {
+ while (nodePtr && nodePtr->level > 0) {
for (nodePtr = nodePtr->children.nodePtr ; nodePtr != NULL;
nodePtr = nodePtr->nextPtr) {
for (summaryPtr = nodePtr->summaryPtr ; summaryPtr != NULL;
@@ -2477,6 +2474,10 @@ FindTagStart(
continue;
}
+ if (nodePtr == NULL) {
+ return NULL;
+ }
+
/*
* Work through the lines attached to the level-0 node.
*/
@@ -2544,7 +2545,7 @@ FindTagEnd(
* level 0 node.
*/
- while (nodePtr->level > 0) {
+ while (nodePtr && nodePtr->level > 0) {
for (lastNodePtr = NULL, nodePtr = nodePtr->children.nodePtr ;
nodePtr != NULL; nodePtr = nodePtr->nextPtr) {
for (summaryPtr = nodePtr->summaryPtr ; summaryPtr != NULL;
@@ -2558,6 +2559,10 @@ FindTagEnd(
nodePtr = lastNodePtr;
}
+ if (nodePtr == NULL) {
+ return NULL;
+ }
+
/*
* Work through the lines attached to the level-0 node.
*/
@@ -2927,7 +2932,7 @@ TkBTreeNextTag(
}
searchPtr->linesLeft -= nodePtr->numLines;
if (nodePtr->nextPtr == NULL) {
- Tcl_Panic("TkBTreeNextTag found incorrect tag summary info.");
+ Tcl_Panic("TkBTreeNextTag found incorrect tag summary info");
}
}
nextChild:
@@ -3145,7 +3150,7 @@ TkBTreePrevTag(
continue;
}
if (prevNodePtr == NULL) {
- Tcl_Panic("TkBTreePrevTag found incorrect tag summary info.");
+ Tcl_Panic("TkBTreePrevTag found incorrect tag summary info");
}
searchPtr->linesLeft -= linesSkipped;
nodePtr = prevNodePtr;
@@ -3325,10 +3330,8 @@ TkBTreeGetTags(
tagInfo.numTags = 0;
tagInfo.arraySize = NUM_TAG_INFOS;
- tagInfo.tagPtrs = (TkTextTag **)
- ckalloc((unsigned) NUM_TAG_INFOS * sizeof(TkTextTag *));
- tagInfo.counts = (int *)
- ckalloc((unsigned) NUM_TAG_INFOS * sizeof(int));
+ tagInfo.tagPtrs = ckalloc(NUM_TAG_INFOS * sizeof(TkTextTag *));
+ tagInfo.counts = ckalloc(NUM_TAG_INFOS * sizeof(int));
/*
* Record tag toggles within the line of indexPtr but preceding indexPtr.
@@ -3413,9 +3416,9 @@ TkBTreeGetTags(
}
}
*numTagsPtr = dst;
- ckfree((char *) tagInfo.counts);
+ ckfree(tagInfo.counts);
if (dst == 0) {
- ckfree((char *) tagInfo.tagPtrs);
+ ckfree(tagInfo.tagPtrs);
return NULL;
}
return tagInfo.tagPtrs;
@@ -3472,8 +3475,7 @@ TkTextIsElided(
int elide;
if (elideInfo == NULL) {
- infoPtr = (TkTextElideInfo *)
- ckalloc((unsigned) sizeof(TkTextElideInfo));
+ infoPtr = ckalloc(sizeof(TkTextElideInfo));
} else {
infoPtr = elideInfo;
}
@@ -3488,10 +3490,8 @@ TkTextIsElided(
*/
if (LOTSA_TAGS < infoPtr->numTags) {
- infoPtr->tagCnts = (int *)
- ckalloc((unsigned) sizeof(int) * infoPtr->numTags);
- infoPtr->tagPtrs = (TkTextTag **)
- ckalloc((unsigned) sizeof(TkTextTag *) * infoPtr->numTags);
+ infoPtr->tagCnts = ckalloc(sizeof(int) * infoPtr->numTags);
+ infoPtr->tagPtrs = ckalloc(sizeof(TkTextTag *) * infoPtr->numTags);
}
for (i=0; i<infoPtr->numTags; i++) {
@@ -3620,11 +3620,11 @@ TkTextIsElided(
if (elideInfo == NULL) {
if (LOTSA_TAGS < infoPtr->numTags) {
- ckfree((char *) infoPtr->tagCnts);
- ckfree((char *) infoPtr->tagPtrs);
+ ckfree(infoPtr->tagCnts);
+ ckfree(infoPtr->tagPtrs);
}
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
return elide;
@@ -3653,8 +3653,8 @@ TkTextFreeElideInfo(
* structure. */
{
if (LOTSA_TAGS < elideInfo->numTags) {
- ckfree((char *) elideInfo->tagCnts);
- ckfree((char *) elideInfo->tagPtrs);
+ ckfree(elideInfo->tagCnts);
+ ckfree(elideInfo->tagPtrs);
}
}
@@ -3705,16 +3705,15 @@ IncCount(
int *newCounts, newSize;
newSize = 2 * tagInfoPtr->arraySize;
- newTags = (TkTextTag **)
- ckalloc((unsigned) newSize * sizeof(TkTextTag *));
+ newTags = ckalloc(newSize * sizeof(TkTextTag *));
memcpy(newTags, tagInfoPtr->tagPtrs,
tagInfoPtr->arraySize * sizeof(TkTextTag *));
- ckfree((char *) tagInfoPtr->tagPtrs);
+ ckfree(tagInfoPtr->tagPtrs);
tagInfoPtr->tagPtrs = newTags;
- newCounts = (int *) ckalloc((unsigned) newSize * sizeof(int));
+ newCounts = ckalloc(newSize * sizeof(int));
memcpy(newCounts, tagInfoPtr->counts,
tagInfoPtr->arraySize * sizeof(int));
- ckfree((char *) tagInfoPtr->counts);
+ ckfree(tagInfoPtr->counts);
tagInfoPtr->counts = newCounts;
tagInfoPtr->arraySize = newSize;
}
@@ -3762,7 +3761,7 @@ TkBTreeCheck(
for (entryPtr=Tcl_FirstHashEntry(&treePtr->sharedTextPtr->tagTable,&search);
entryPtr != NULL ; entryPtr = Tcl_NextHashEntry(&search)) {
- tagPtr = (TkTextTag *) Tcl_GetHashValue(entryPtr);
+ tagPtr = Tcl_GetHashValue(entryPtr);
nodePtr = tagPtr->tagRootPtr;
if (nodePtr == NULL) {
if (tagPtr->toggleCount != 0) {
@@ -3914,7 +3913,7 @@ CheckNodeConsistency(
numChildren = 0;
numLines = 0;
if (references > PIXEL_CLIENTS) {
- numPixels = (int *) ckalloc(sizeof(int) * references);
+ numPixels = ckalloc(sizeof(int) * references);
} else {
numPixels = pixels;
}
@@ -3934,7 +3933,7 @@ CheckNodeConsistency(
for (segPtr = linePtr->segPtr; segPtr != NULL;
segPtr = segPtr->nextPtr) {
if (segPtr->typePtr->checkProc != NULL) {
- (*segPtr->typePtr->checkProc)(segPtr, linePtr);
+ segPtr->typePtr->checkProc(segPtr, linePtr);
}
if ((segPtr->size == 0) && (!segPtr->typePtr->leftGravity)
&& (segPtr->nextPtr != NULL)
@@ -4003,7 +4002,7 @@ CheckNodeConsistency(
}
}
if (references > PIXEL_CLIENTS) {
- ckfree((char *) numPixels);
+ ckfree(numPixels);
}
for (summaryPtr = nodePtr->summaryPtr; summaryPtr != NULL;
@@ -4102,7 +4101,7 @@ Rebalance(
*/
if (nodePtr->parentPtr == NULL) {
- newPtr = (Node *) ckalloc(sizeof(Node));
+ newPtr = ckalloc(sizeof(Node));
newPtr->parentPtr = NULL;
newPtr->nextPtr = NULL;
newPtr->summaryPtr = NULL;
@@ -4110,7 +4109,7 @@ Rebalance(
newPtr->children.nodePtr = nodePtr;
newPtr->numChildren = 1;
newPtr->numLines = nodePtr->numLines;
- newPtr->numPixels = (int *)
+ newPtr->numPixels =
ckalloc(sizeof(int) * treePtr->pixelReferences);
for (i=0; i<treePtr->pixelReferences; i++) {
newPtr->numPixels[i] = nodePtr->numPixels[i];
@@ -4118,8 +4117,8 @@ Rebalance(
RecomputeNodeCounts(treePtr, newPtr);
treePtr->rootPtr = newPtr;
}
- newPtr = (Node *) ckalloc(sizeof(Node));
- newPtr->numPixels = (int *)
+ newPtr = ckalloc(sizeof(Node));
+ newPtr->numPixels =
ckalloc(sizeof(int) * treePtr->pixelReferences);
for (i=0; i<treePtr->pixelReferences; i++) {
newPtr->numPixels[i] = 0;
@@ -4176,7 +4175,7 @@ Rebalance(
treePtr->rootPtr = nodePtr->children.nodePtr;
treePtr->rootPtr->parentPtr = NULL;
DeleteSummaries(nodePtr->summaryPtr);
- ckfree((char *) nodePtr);
+ ckfree(nodePtr);
}
return;
}
@@ -4265,7 +4264,7 @@ Rebalance(
nodePtr->nextPtr = otherPtr->nextPtr;
nodePtr->parentPtr->numChildren--;
DeleteSummaries(otherPtr->summaryPtr);
- ckfree((char *) otherPtr);
+ ckfree(otherPtr);
continue;
}
@@ -4275,9 +4274,11 @@ Rebalance(
*/
if (nodePtr->level == 0) {
+ CLANG_ASSERT(halfwayLinePtr);
otherPtr->children.linePtr = halfwayLinePtr->nextPtr;
halfwayLinePtr->nextPtr = NULL;
} else {
+ CLANG_ASSERT(halfwayNodePtr);
otherPtr->children.nodePtr = halfwayNodePtr->nextPtr;
halfwayNodePtr->nextPtr = NULL;
}
@@ -4361,7 +4362,7 @@ RecomputeNodeCounts(
for (summaryPtr = nodePtr->summaryPtr; ;
summaryPtr = summaryPtr->nextPtr) {
if (summaryPtr == NULL) {
- summaryPtr = (Summary *) ckalloc(sizeof(Summary));
+ summaryPtr = ckalloc(sizeof(Summary));
summaryPtr->tagPtr = tagPtr;
summaryPtr->toggleCount = 1;
summaryPtr->nextPtr = nodePtr->summaryPtr;
@@ -4389,7 +4390,7 @@ RecomputeNodeCounts(
for (summaryPtr = nodePtr->summaryPtr; ;
summaryPtr = summaryPtr->nextPtr) {
if (summaryPtr == NULL) {
- summaryPtr = (Summary *) ckalloc(sizeof(Summary));
+ summaryPtr = ckalloc(sizeof(Summary));
summaryPtr->tagPtr = summaryPtr2->tagPtr;
summaryPtr->toggleCount = summaryPtr2->toggleCount;
summaryPtr->nextPtr = nodePtr->summaryPtr;
@@ -4438,11 +4439,11 @@ RecomputeNodeCounts(
}
if (summaryPtr2 != NULL) {
summaryPtr2->nextPtr = summaryPtr->nextPtr;
- ckfree((char *) summaryPtr);
+ ckfree(summaryPtr);
summaryPtr = summaryPtr2->nextPtr;
} else {
nodePtr->summaryPtr = summaryPtr->nextPtr;
- ckfree((char *) summaryPtr);
+ ckfree(summaryPtr);
summaryPtr = nodePtr->summaryPtr;
}
}
@@ -4542,9 +4543,8 @@ CharSplitProc(
{
TkTextSegment *newPtr1, *newPtr2;
- newPtr1 = (TkTextSegment *) ckalloc(CSEG_SIZE(index));
- newPtr2 = (TkTextSegment *) ckalloc(
- CSEG_SIZE(segPtr->size - index));
+ newPtr1 = ckalloc(CSEG_SIZE(index));
+ newPtr2 = ckalloc(CSEG_SIZE(segPtr->size - index));
newPtr1->typePtr = &tkTextCharType;
newPtr1->nextPtr = newPtr2;
newPtr1->size = index;
@@ -4555,7 +4555,7 @@ CharSplitProc(
newPtr2->size = segPtr->size - index;
memcpy(newPtr2->body.chars, segPtr->body.chars + index, newPtr2->size);
newPtr2->body.chars[newPtr2->size] = 0;
- ckfree((char *) segPtr);
+ ckfree(segPtr);
return newPtr1;
}
@@ -4590,16 +4590,15 @@ CharCleanupProc(
if ((segPtr2 == NULL) || (segPtr2->typePtr != &tkTextCharType)) {
return segPtr;
}
- newPtr = (TkTextSegment *) ckalloc(CSEG_SIZE(
- segPtr->size + segPtr2->size));
+ newPtr = ckalloc(CSEG_SIZE(segPtr->size + segPtr2->size));
newPtr->typePtr = &tkTextCharType;
newPtr->nextPtr = segPtr2->nextPtr;
newPtr->size = segPtr->size + segPtr2->size;
memcpy(newPtr->body.chars, segPtr->body.chars, segPtr->size);
memcpy(newPtr->body.chars + segPtr->size, segPtr2->body.chars, segPtr2->size);
newPtr->body.chars[newPtr->size] = 0;
- ckfree((char *) segPtr);
- ckfree((char *) segPtr2);
+ ckfree(segPtr);
+ ckfree(segPtr2);
return newPtr;
}
@@ -4628,7 +4627,7 @@ CharDeleteProc(
* deleted, so everything must get cleaned
* up. */
{
- ckfree((char *) segPtr);
+ ckfree(segPtr);
return 0;
}
@@ -4704,7 +4703,7 @@ ToggleDeleteProc(
* up. */
{
if (treeGone) {
- ckfree((char *) segPtr);
+ ckfree(segPtr);
return 0;
}
@@ -4778,9 +4777,9 @@ ToggleCleanupProc(
segPtr->body.toggle.tagPtr, -counts);
}
prevPtr->nextPtr = segPtr2->nextPtr;
- ckfree((char *) segPtr2);
+ ckfree(segPtr2);
segPtr2 = segPtr->nextPtr;
- ckfree((char *) segPtr);
+ ckfree(segPtr);
return segPtr2;
}
}
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 144bca9..4eca4ca 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -413,8 +413,8 @@ typedef struct TextDInfo {
typedef struct CharInfo {
int numBytes; /* Number of bytes to display. */
- char chars[4]; /* UTF characters to display. Actual size will
- * be numBytes, not 4. THIS MUST BE THE LAST
+ char chars[1]; /* UTF characters to display. Actual size will
+ * be numBytes, not 1. THIS MUST BE THE LAST
* FIELD IN THE STRUCTURE. */
} CharInfo;
@@ -444,6 +444,7 @@ typedef struct BaseCharInfo {
* LayoutDLine(). */
} BaseCharInfo;
+/* TODO: Thread safety */
static TkTextDispChunk *baseCharChunkPtr = NULL;
#endif /* TK_LAYOUT_WITH_BASE_CHUNKS */
@@ -540,23 +541,23 @@ static void DisplayDLine(TkText *textPtr, DLine *dlPtr,
static void DisplayLineBackground(TkText *textPtr, DLine *dlPtr,
DLine *prevPtr, Pixmap pixmap);
static void DisplayText(ClientData clientData);
-static DLine * FindDLine(DLine *dlPtr, CONST TkTextIndex *indexPtr);
+static DLine * FindDLine(DLine *dlPtr, const TkTextIndex *indexPtr);
static void FreeDLines(TkText *textPtr, DLine *firstPtr,
DLine *lastPtr, int action);
static void FreeStyle(TkText *textPtr, TextStyle *stylePtr);
-static TextStyle * GetStyle(TkText *textPtr, CONST TkTextIndex *indexPtr);
+static TextStyle * GetStyle(TkText *textPtr, const TkTextIndex *indexPtr);
static void GetXView(Tcl_Interp *interp, TkText *textPtr,
int report);
static void GetYView(Tcl_Interp *interp, TkText *textPtr,
int report);
static int GetYPixelCount(TkText *textPtr, DLine *dlPtr);
static DLine * LayoutDLine(TkText *textPtr,
- CONST TkTextIndex *indexPtr);
-static int MeasureChars(Tk_Font tkfont, CONST char *source,
+ const TkTextIndex *indexPtr);
+static int MeasureChars(Tk_Font tkfont, const char *source,
int maxBytes, int rangeStart, int rangeLength,
int startX, int maxX, int flags, int *nextXPtr);
static void MeasureUp(TkText *textPtr,
- CONST TkTextIndex *srcPtr, int distance,
+ const TkTextIndex *srcPtr, int distance,
TkTextIndex *dstPtr, int *overlap);
static int NextTabStop(Tk_Font tkfont, int x, int tabOrigin);
static void UpdateDisplayInfo(TkText *textPtr);
@@ -566,8 +567,8 @@ static int SizeOfTab(TkText *textPtr, int tabStyle,
TkTextTabArray *tabArrayPtr, int *indexPtr, int x,
int maxX);
static void TextChanged(TkText *textPtr,
- CONST TkTextIndex *index1Ptr,
- CONST TkTextIndex *index2Ptr);
+ const TkTextIndex *index1Ptr,
+ const TkTextIndex *index2Ptr);
static void TextInvalidateRegion(TkText *textPtr, TkRegion region);
static void TextRedrawTag(TkText *textPtr,
TkTextIndex *index1Ptr, TkTextIndex *index2Ptr,
@@ -575,7 +576,7 @@ static void TextRedrawTag(TkText *textPtr,
static void TextInvalidateLineMetrics(TkText *textPtr,
TkTextLine *linePtr, int lineCount, int action);
static int CalculateDisplayLineHeight(TkText *textPtr,
- CONST TkTextIndex *indexPtr, int *byteCountPtr,
+ const TkTextIndex *indexPtr, int *byteCountPtr,
int *mergedLinePtr);
static void DlineIndexOfX(TkText *textPtr,
DLine *dlPtr, int x, TkTextIndex *indexPtr);
@@ -583,7 +584,7 @@ static int DlineXOfIndex(TkText *textPtr,
DLine *dlPtr, int byteIndex);
static int TextGetScrollInfoObj(Tcl_Interp *interp,
TkText *textPtr, int objc,
- Tcl_Obj *CONST objv[], double *dblPtr,
+ Tcl_Obj *const objv[], double *dblPtr,
int *intPtr);
static void AsyncUpdateLineMetrics(ClientData clientData);
static void AsyncUpdateYScrollbar(ClientData clientData);
@@ -623,7 +624,7 @@ TkTextCreateDInfo(
register TextDInfo *dInfoPtr;
XGCValues gcValues;
- dInfoPtr = (TextDInfo *) ckalloc(sizeof(TextDInfo));
+ dInfoPtr = ckalloc(sizeof(TextDInfo));
Tcl_InitHashTable(&dInfoPtr->styleTable, sizeof(StyleValues)/sizeof(int));
dInfoPtr->dLinePtr = NULL;
dInfoPtr->copyGC = None;
@@ -659,10 +660,10 @@ TkTextCreateDInfo(
textPtr->refCount++;
dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(0,
- AsyncUpdateLineMetrics, (ClientData) textPtr);
+ AsyncUpdateLineMetrics, textPtr);
textPtr->refCount++;
dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200,
- AsyncUpdateYScrollbar, (ClientData) textPtr);
+ AsyncUpdateYScrollbar, textPtr);
textPtr->dInfoPtr = dInfoPtr;
}
@@ -704,7 +705,7 @@ TkTextFreeDInfo(
}
Tk_FreeGC(textPtr->display, dInfoPtr->scrollGC);
if (dInfoPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayText, (ClientData) textPtr);
+ Tcl_CancelIdleCall(DisplayText, textPtr);
}
if (dInfoPtr->lineUpdateTimer != NULL) {
Tcl_DeleteTimerHandler(dInfoPtr->lineUpdateTimer);
@@ -716,7 +717,7 @@ TkTextFreeDInfo(
textPtr->refCount--;
dInfoPtr->scrollbarTimer = NULL;
}
- ckfree((char *) dInfoPtr);
+ ckfree(dInfoPtr);
}
/*
@@ -740,7 +741,7 @@ TkTextFreeDInfo(
static TextStyle *
GetStyle(
TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr)/* The character in the text for which display
+ const TkTextIndex *indexPtr)/* The character in the text for which display
* information is wanted. */
{
TkTextTag **tagPtrs;
@@ -920,7 +921,7 @@ GetStyle(
}
}
if (tagPtrs != NULL) {
- ckfree((char *) tagPtrs);
+ ckfree(tagPtrs);
}
/*
@@ -930,7 +931,7 @@ GetStyle(
hPtr = Tcl_CreateHashEntry(&textPtr->dInfoPtr->styleTable,
(char *) &styleValues, &isNew);
if (!isNew) {
- stylePtr = (TextStyle *) Tcl_GetHashValue(hPtr);
+ stylePtr = Tcl_GetHashValue(hPtr);
stylePtr->refCount++;
return stylePtr;
}
@@ -939,7 +940,7 @@ GetStyle(
* No existing style matched. Make a new one.
*/
- stylePtr = (TextStyle *) ckalloc(sizeof(TextStyle));
+ stylePtr = ckalloc(sizeof(TextStyle));
stylePtr->refCount = 1;
if (styleValues.border != NULL) {
gcValues.foreground = Tk_3DBorderColor(styleValues.border)->pixel;
@@ -1004,7 +1005,7 @@ FreeStyle(
Tk_FreeGC(textPtr->display, stylePtr->fgGC);
}
Tcl_DeleteHashEntry(stylePtr->hPtr);
- ckfree((char *) stylePtr);
+ ckfree(stylePtr);
}
}
@@ -1045,7 +1046,7 @@ FreeStyle(
static DLine *
LayoutDLine(
TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr)/* Beginning of display line. May not
+ const TkTextIndex *indexPtr)/* Beginning of display line. May not
* necessarily point to a character
* segment. */
{
@@ -1103,7 +1104,7 @@ LayoutDLine(
* Create and initialize a new DLine structure.
*/
- dlPtr = (DLine *) ckalloc(sizeof(DLine));
+ dlPtr = ckalloc(sizeof(DLine));
dlPtr->index = *indexPtr;
dlPtr->byteCount = 0;
dlPtr->y = 0;
@@ -1263,14 +1264,14 @@ LayoutDLine(
*/
TkTextLine *linePtr = TkBTreeNextLine(NULL, curIndex.linePtr);
- if (linePtr != NULL) {
- dlPtr->logicalLinesMerged++;
- curIndex.byteIndex = 0;
- curIndex.linePtr = linePtr;
- segPtr = curIndex.linePtr->segPtr;
- } else {
+ if (linePtr == NULL) {
break;
}
+
+ dlPtr->logicalLinesMerged++;
+ curIndex.byteIndex = 0;
+ curIndex.linePtr = linePtr;
+ segPtr = curIndex.linePtr->segPtr;
}
}
@@ -1334,7 +1335,7 @@ LayoutDLine(
* into a single display line.
*
if (segPtr == NULL && chunkPtr != NULL) {
- ckfree((char *) chunkPtr);
+ ckfree(chunkPtr);
chunkPtr = NULL;
}
*/
@@ -1348,7 +1349,7 @@ LayoutDLine(
continue;
}
if (chunkPtr == NULL) {
- chunkPtr = (TkTextDispChunk *) ckalloc(sizeof(TkTextDispChunk));
+ chunkPtr = ckalloc(sizeof(TkTextDispChunk));
chunkPtr->nextPtr = NULL;
chunkPtr->clientData = NULL;
}
@@ -1457,7 +1458,7 @@ LayoutDLine(
code = 1;
} else {
- code = (*segPtr->typePtr->layoutProc)(textPtr, &curIndex, segPtr,
+ code = segPtr->typePtr->layoutProc(textPtr, &curIndex, segPtr,
byteOffset, maxX-tabSize, maxBytes, noCharsYet, wrapMode,
chunkPtr);
}
@@ -1480,7 +1481,7 @@ LayoutDLine(
*/
if (chunkPtr != NULL) {
- ckfree((char *) chunkPtr);
+ ckfree(chunkPtr);
}
break;
}
@@ -1609,18 +1610,18 @@ LayoutDLine(
FreeStyle(textPtr, chunkPtr->stylePtr);
breakChunkPtr->nextPtr = chunkPtr->nextPtr;
if (chunkPtr->undisplayProc != NULL) {
- (*chunkPtr->undisplayProc)(textPtr, chunkPtr);
+ chunkPtr->undisplayProc(textPtr, chunkPtr);
}
- ckfree((char *) chunkPtr);
+ ckfree(chunkPtr);
}
if (breakByteOffset != breakChunkPtr->numBytes) {
if (breakChunkPtr->undisplayProc != NULL) {
- (*breakChunkPtr->undisplayProc)(textPtr, breakChunkPtr);
+ breakChunkPtr->undisplayProc(textPtr, breakChunkPtr);
}
segPtr = TkTextIndexToSeg(&breakIndex, &byteOffset);
- (*segPtr->typePtr->layoutProc)(textPtr, &breakIndex,
- segPtr, byteOffset, maxX, breakByteOffset, 0,
- wrapMode, breakChunkPtr);
+ segPtr->typePtr->layoutProc(textPtr, &breakIndex, segPtr,
+ byteOffset, maxX, breakByteOffset, 0, wrapMode,
+ breakChunkPtr);
#if TK_LAYOUT_WITH_BASE_CHUNKS
FinalizeBaseChunk(NULL);
#endif /* TK_LAYOUT_WITH_BASE_CHUNKS */
@@ -2304,13 +2305,13 @@ FreeDLines(
for (chunkPtr = firstPtr->chunkPtr; chunkPtr != NULL;
chunkPtr = nextChunkPtr) {
if (chunkPtr->undisplayProc != NULL) {
- (*chunkPtr->undisplayProc)(textPtr, chunkPtr);
+ chunkPtr->undisplayProc(textPtr, chunkPtr);
}
FreeStyle(textPtr, chunkPtr->stylePtr);
nextChunkPtr = chunkPtr->nextPtr;
- ckfree((char *) chunkPtr);
+ ckfree(chunkPtr);
}
- ckfree((char *) firstPtr);
+ ckfree(firstPtr);
firstPtr = nextDLinePtr;
}
if (action != DLINE_FREE_TEMP) {
@@ -2402,7 +2403,7 @@ DisplayDLine(
if (chunkPtr->displayProc == TkTextInsertDisplayProc) {
int x = chunkPtr->x + dInfoPtr->x - dInfoPtr->curXPixelOffset;
- (*chunkPtr->displayProc)(textPtr, chunkPtr, x,
+ chunkPtr->displayProc(textPtr, chunkPtr, x,
y + dlPtr->spaceAbove,
dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
dlPtr->baseline - dlPtr->spaceAbove, display, pixmap,
@@ -2450,7 +2451,7 @@ DisplayDLine(
x = -chunkPtr->width;
}
- (*chunkPtr->displayProc)(textPtr, chunkPtr, x,
+ chunkPtr->displayProc(textPtr, chunkPtr, x,
y + dlPtr->spaceAbove, dlPtr->height - dlPtr->spaceAbove -
dlPtr->spaceBelow, dlPtr->baseline - dlPtr->spaceAbove,
display, pixmap, dlPtr->y + dlPtr->spaceAbove);
@@ -2724,7 +2725,7 @@ DisplayLineBackground(
rightX2 + xOffset, y, sValuePtr->borderWidth,
sValuePtr->borderWidth, 1, sValuePtr->relief);
Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
- leftX + xOffset, y, rightX2 + sValuePtr->borderWidth -
+ leftX + xOffset, y, rightX2 + sValuePtr->borderWidth -
leftX, sValuePtr->borderWidth, leftXIn, 0, 1,
sValuePtr->relief);
}
@@ -2876,7 +2877,7 @@ static void
AsyncUpdateLineMetrics(
ClientData clientData) /* Information about widget. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
int lineNum;
@@ -2888,7 +2889,7 @@ AsyncUpdateLineMetrics(
*/
if (--textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
return;
}
@@ -2899,6 +2900,11 @@ AsyncUpdateLineMetrics(
return;
}
+ /*
+ * Reify where we end or all hell breaks loose with the calculations when
+ * we try to update. [Bug 2677890]
+ */
+
lineNum = dInfoPtr->currentMetricUpdateLine;
if (dInfoPtr->lastMetricUpdateLine == -1) {
dInfoPtr->lastMetricUpdateLine =
@@ -2935,7 +2941,7 @@ AsyncUpdateLineMetrics(
textPtr->refCount--;
if (textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
return;
}
@@ -2947,7 +2953,7 @@ AsyncUpdateLineMetrics(
*/
dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1,
- AsyncUpdateLineMetrics, (ClientData) textPtr);
+ AsyncUpdateLineMetrics, textPtr);
}
/*
@@ -3048,86 +3054,82 @@ TkTextUpdateLineMetrics(
*/
if (TkBTreeLinePixelEpoch(textPtr, linePtr)
- != textPtr->dInfoPtr->lineMetricUpdateEpoch) {
- if (doThisMuch == -1) {
- count += 8 * TkTextUpdateOneLine(textPtr, linePtr, 0,
- NULL, 0);
- } else {
- TkTextIndex index;
- TkTextIndex *indexPtr;
- int pixelHeight;
+ == textPtr->dInfoPtr->lineMetricUpdateEpoch) {
+ /*
+ * This line is already up to date. That means there's nothing
+ * to do here.
+ */
+ } else if (doThisMuch == -1) {
+ count += 8 * TkTextUpdateOneLine(textPtr, linePtr, 0,NULL,0);
+ } else {
+ TkTextIndex index;
+ TkTextIndex *indexPtr;
+ int pixelHeight;
+ /*
+ * If the metric epoch is the same as the widget's epoch, then
+ * we know that indexPtrs are still valid, and if the cached
+ * metricIndex (if any) is for the same line as we wish to
+ * examine, then we are looking at a long line wrapped many
+ * times, which we will examine in pieces.
+ */
+
+ if (textPtr->dInfoPtr->metricEpoch ==
+ textPtr->sharedTextPtr->stateEpoch &&
+ textPtr->dInfoPtr->metricIndex.linePtr==linePtr) {
+ indexPtr = &textPtr->dInfoPtr->metricIndex;
+ pixelHeight = textPtr->dInfoPtr->metricPixelHeight;
+ } else {
/*
- * If the metric epoch is the same as the widget's epoch,
- * then we know that indexPtrs are still valid, and if the
- * cached metricIndex (if any) is for the same line as we
- * wish to examine, then we are looking at a long line
- * wrapped many times, which we will examine in pieces.
+ * We must reset the partial line height calculation data
+ * here, so we don't use it when it is out of date.
*/
- if (textPtr->dInfoPtr->metricEpoch ==
- textPtr->sharedTextPtr->stateEpoch &&
- textPtr->dInfoPtr->metricIndex.linePtr==linePtr) {
- indexPtr = &textPtr->dInfoPtr->metricIndex;
- pixelHeight = textPtr->dInfoPtr->metricPixelHeight;
- } else {
- /*
- * We must reset the partial line height calculation
- * data here, so we don't use it when it is out of
- * date.
- */
+ textPtr->dInfoPtr->metricEpoch = -1;
+ index.tree = textPtr->sharedTextPtr->tree;
+ index.linePtr = linePtr;
+ index.byteIndex = 0;
+ index.textPtr = NULL;
+ indexPtr = &index;
+ pixelHeight = 0;
+ }
- textPtr->dInfoPtr->metricEpoch = -1;
- index.tree = textPtr->sharedTextPtr->tree;
- index.linePtr = linePtr;
- index.byteIndex = 0;
- index.textPtr = NULL;
- indexPtr = &index;
- pixelHeight = 0;
- }
+ /*
+ * Update the line and update the counter, counting 8 for each
+ * display line we actually re-layout.
+ */
+
+ count += 8 * TkTextUpdateOneLine(textPtr, linePtr,
+ pixelHeight, indexPtr, 1);
+ if (indexPtr->linePtr == linePtr) {
/*
- * Update the line and update the counter, counting 8 for
- * each display line we actually re-layout.
+ * We didn't complete the logical line, because it
+ * produced very many display lines, which must be because
+ * it must be a long line wrapped many times. So we must
+ * cache as far as we got for next time around.
*/
- count += 8 * TkTextUpdateOneLine(textPtr, linePtr,
- pixelHeight, indexPtr, 1);
-
- if (indexPtr->linePtr == linePtr) {
+ if (pixelHeight == 0) {
/*
- * We didn't complete the logical line, because it
- * produced very many display lines - it must be a
- * long line wrapped many times. So we must cache as
- * far as we got for next time around.
+ * These have already been stored, unless we just
+ * started the new line.
*/
- if (pixelHeight == 0) {
- /*
- * These have already been stored, unless we just
- * started the new line.
- */
-
- textPtr->dInfoPtr->metricIndex = index;
- textPtr->dInfoPtr->metricEpoch =
- textPtr->sharedTextPtr->stateEpoch;
- }
- textPtr->dInfoPtr->metricPixelHeight =
- TkBTreeLinePixelCount(textPtr, linePtr);
- break;
- } else {
- /*
- * We're done with this long line.
- */
-
- textPtr->dInfoPtr->metricEpoch = -1;
+ textPtr->dInfoPtr->metricIndex = index;
+ textPtr->dInfoPtr->metricEpoch =
+ textPtr->sharedTextPtr->stateEpoch;
}
+ textPtr->dInfoPtr->metricPixelHeight =
+ TkBTreeLinePixelCount(textPtr, linePtr);
+ break;
}
- } else {
+
/*
- * This line is already up to date. That means there's nothing
- * to do here.
+ * We're done with this long line.
*/
+
+ textPtr->dInfoPtr->metricEpoch = -1;
}
} else {
/*
@@ -3328,7 +3330,7 @@ TextInvalidateLineMetrics(
if (dInfoPtr->lineUpdateTimer == NULL) {
textPtr->refCount++;
dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1,
- AsyncUpdateLineMetrics, (ClientData) textPtr);
+ AsyncUpdateLineMetrics, textPtr);
}
}
@@ -3378,6 +3380,8 @@ TkTextFindDisplayLineEnd(
* of the original index within its display
* line. */
{
+ TkTextIndex index;
+
if (!end && indexPtr->byteIndex == 0) {
/*
* Nothing to do.
@@ -3387,95 +3391,93 @@ TkTextFindDisplayLineEnd(
*xOffset = 0;
}
return;
- } else {
- TkTextIndex index = *indexPtr;
-
- index.byteIndex = 0;
- index.textPtr = NULL;
-
- while (1) {
- TkTextIndex endOfLastLine;
+ }
- if (TkTextIndexBackBytes(textPtr, &index, 1, &endOfLastLine)) {
- /*
- * Reached beginning of text.
- */
+ index = *indexPtr;
+ index.byteIndex = 0;
+ index.textPtr = NULL;
- break;
- }
+ while (1) {
+ TkTextIndex endOfLastLine;
- if (!TkTextIsElided(textPtr, &endOfLastLine, NULL)) {
- /*
- * The eol is not elided, so 'index' points to the start of a
- * display line (as well as logical line).
- */
+ if (TkTextIndexBackBytes(textPtr, &index, 1, &endOfLastLine)) {
+ /*
+ * Reached beginning of text.
+ */
- break;
- }
+ break;
+ }
+ if (!TkTextIsElided(textPtr, &endOfLastLine, NULL)) {
/*
- * indexPtr's logical line is actually merged with the previous
- * logical line whose eol is elided. Continue searching back to
- * get a real line start.
+ * The eol is not elided, so 'index' points to the start of a
+ * display line (as well as logical line).
*/
- index = endOfLastLine;
- index.byteIndex = 0;
+ break;
}
- while (1) {
- DLine *dlPtr;
- int byteCount;
- TkTextIndex nextLineStart;
+ /*
+ * indexPtr's logical line is actually merged with the previous
+ * logical line whose eol is elided. Continue searching back to get a
+ * real line start.
+ */
- dlPtr = LayoutDLine(textPtr, &index);
- byteCount = dlPtr->byteCount;
+ index = endOfLastLine;
+ index.byteIndex = 0;
+ }
+
+ while (1) {
+ DLine *dlPtr;
+ int byteCount;
+ TkTextIndex nextLineStart;
+
+ dlPtr = LayoutDLine(textPtr, &index);
+ byteCount = dlPtr->byteCount;
- TkTextIndexForwBytes(textPtr, &index, byteCount, &nextLineStart);
+ TkTextIndexForwBytes(textPtr, &index, byteCount, &nextLineStart);
+ /*
+ * 'byteCount' goes up to the beginning of the next display line, so
+ * equality here says we need one more line. We try to perform a quick
+ * comparison which is valid for the case where the logical line is
+ * the same, but otherwise fall back on a full TkTextIndexCmp.
+ */
+
+ if (((index.linePtr == indexPtr->linePtr)
+ && (index.byteIndex + byteCount > indexPtr->byteIndex))
+ || (dlPtr->logicalLinesMerged > 0
+ && TkTextIndexCmp(&nextLineStart, indexPtr) > 0)) {
/*
- * 'byteCount' goes up to the beginning of the next display line,
- * so equality here says we need one more line. We try to perform
- * a quick comparison which is valid for the case where the
- * logical line is the same, but otherwise fall back on a full
- * TkTextIndexCmp.
+ * It's on this display line.
*/
- if (((index.linePtr == indexPtr->linePtr)
- && (index.byteIndex + byteCount > indexPtr->byteIndex))
- || (dlPtr->logicalLinesMerged > 0
- && TkTextIndexCmp(&nextLineStart, indexPtr) > 0)) {
+ if (xOffset != NULL) {
/*
- * It's on this display line.
+ * This call takes a byte index relative to the start of the
+ * current _display_ line, not logical line. We are about to
+ * overwrite indexPtr->byteIndex, so we must do this now.
*/
- if (xOffset != NULL) {
- /*
- * This call takes a byte index relative to the start of
- * the current _display_ line, not logical line. We are
- * about to overwrite indexPtr->byteIndex, so we must do
- * this now.
- */
-
- *xOffset = DlineXOfIndex(textPtr, dlPtr,
- indexPtr->byteIndex - dlPtr->index.byteIndex);
- }
- if (end) {
- /*
- * The index we want is one less than the number of bytes
- * in the display line.
- */
+ *xOffset = DlineXOfIndex(textPtr, dlPtr,
+ indexPtr->byteIndex - dlPtr->index.byteIndex);
+ }
+ if (end) {
+ /*
+ * The index we want is one less than the number of bytes in
+ * the display line.
+ */
- TkTextIndexBackBytes(textPtr, &nextLineStart, 1, indexPtr);
- } else {
- *indexPtr = index;
- }
- FreeDLines(textPtr, dlPtr, NULL, DLINE_FREE_TEMP);
- return;
+ TkTextIndexBackBytes(textPtr, &nextLineStart, 1, indexPtr);
+ } else {
+ *indexPtr = index;
}
FreeDLines(textPtr, dlPtr, NULL, DLINE_FREE_TEMP);
- index = nextLineStart;
+ return;
}
+
+ FreeDLines(textPtr, dlPtr, NULL, DLINE_FREE_TEMP);
+ index = nextLineStart;
}
}
@@ -3517,7 +3519,7 @@ TkTextFindDisplayLineEnd(
static int
CalculateDisplayLineHeight(
TkText *textPtr, /* Widget record for text widget. */
- CONST TkTextIndex *indexPtr,/* The index at the beginning of the display
+ const TkTextIndex *indexPtr,/* The index at the beginning of the display
* line of interest. */
int *byteCountPtr, /* NULL or used to return the number of byte
* indices on the given display line. */
@@ -3588,7 +3590,7 @@ CalculateDisplayLineHeight(
int
TkTextIndexYPixels(
TkText *textPtr, /* Widget record for text widget. */
- CONST TkTextIndex *indexPtr)/* The index of which we want the pixel
+ const TkTextIndex *indexPtr)/* The index of which we want the pixel
* distance from top of logical line to top of
* index. */
{
@@ -3859,7 +3861,7 @@ TkTextUpdateOneLine(
if (textPtr->dInfoPtr->scrollbarTimer == NULL) {
textPtr->refCount++;
textPtr->dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200,
- AsyncUpdateYScrollbar, (ClientData) textPtr);
+ AsyncUpdateYScrollbar, textPtr);
}
return displayLines;
}
@@ -3885,7 +3887,7 @@ static void
DisplayText(
ClientData clientData) /* Information about widget. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
register DLine *dlPtr;
DLine *prevPtr;
@@ -3904,7 +3906,7 @@ DisplayText(
}
interp = textPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
if (tkTextDebug) {
Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY);
@@ -3950,7 +3952,7 @@ DisplayText(
dInfoPtr->flags &= ~REPICK_NEEDED;
TkTextPickCurrent(textPtr, &textPtr->pickEvent);
if (--textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
goto end;
}
if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
@@ -4342,7 +4344,7 @@ DisplayText(
}
end:
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -4371,7 +4373,7 @@ TkTextEventuallyRepick(
dInfoPtr->flags |= REPICK_NEEDED;
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
}
@@ -4415,7 +4417,7 @@ TkTextRedrawRegion(
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
TkDestroyRegion(damageRgn);
}
@@ -4509,8 +4511,8 @@ void
TkTextChanged(
TkSharedText *sharedTextPtr,/* Shared widget section, or NULL. */
TkText *textPtr, /* Widget record for text widget, or NULL. */
- CONST TkTextIndex*index1Ptr,/* Index of first character to redisplay. */
- CONST TkTextIndex*index2Ptr)/* Index of character just after last one to
+ const TkTextIndex*index1Ptr,/* Index of first character to redisplay. */
+ const TkTextIndex*index2Ptr)/* Index of character just after last one to
* redisplay. */
{
if (sharedTextPtr == NULL) {
@@ -4527,8 +4529,8 @@ TkTextChanged(
static void
TextChanged(
TkText *textPtr, /* Widget record for text widget, or NULL. */
- CONST TkTextIndex*index1Ptr,/* Index of first character to redisplay. */
- CONST TkTextIndex*index2Ptr)/* Index of character just after last one to
+ const TkTextIndex*index1Ptr,/* Index of first character to redisplay. */
+ const TkTextIndex*index2Ptr)/* Index of character just after last one to
* redisplay. */
{
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
@@ -4552,7 +4554,7 @@ TextChanged(
*/
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|DINFO_OUT_OF_DATE|REPICK_NEEDED;
@@ -4734,7 +4736,7 @@ TextRedrawTag(
*/
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|DINFO_OUT_OF_DATE|REPICK_NEEDED;
@@ -4839,7 +4841,7 @@ TkTextRelayoutWindow(
*/
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|REDRAW_BORDERS|DINFO_OUT_OF_DATE
|REPICK_NEEDED;
@@ -4934,7 +4936,7 @@ TkTextRelayoutWindow(
if (dInfoPtr->lineUpdateTimer == NULL) {
textPtr->refCount++;
dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1,
- AsyncUpdateLineMetrics, (ClientData) textPtr);
+ AsyncUpdateLineMetrics, textPtr);
}
}
}
@@ -5118,7 +5120,7 @@ TkTextSetYView(
scheduleUpdate:
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|DINFO_OUT_OF_DATE|REPICK_NEEDED;
}
@@ -5208,7 +5210,7 @@ TkTextMeasureDown(
static void
MeasureUp(
TkText *textPtr, /* Text widget in which to measure. */
- CONST TkTextIndex *srcPtr, /* Index of character from which to start
+ const TkTextIndex *srcPtr, /* Index of character from which to start
* measuring. */
int distance, /* Vertical distance in pixels measured from
* the pixel just below the lowest one in
@@ -5312,7 +5314,7 @@ TkTextSeeCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "see". */
{
@@ -5384,7 +5386,7 @@ TkTextSeeCmd(
*/
if (chunkPtr != NULL) {
- (*chunkPtr->bboxProc)(textPtr, chunkPtr, byteCount,
+ chunkPtr->bboxProc(textPtr, chunkPtr, byteCount,
dlPtr->y + dlPtr->spaceAbove,
dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width,
@@ -5393,27 +5395,25 @@ TkTextSeeCmd(
oneThird = lineWidth/3;
if (delta < 0) {
if (delta < -oneThird) {
- dInfoPtr->newXPixelOffset = (x - lineWidth/2);
+ dInfoPtr->newXPixelOffset = x - lineWidth/2;
} else {
- dInfoPtr->newXPixelOffset -= ((-delta) );
+ dInfoPtr->newXPixelOffset += delta;
}
} else {
- delta -= (lineWidth - width);
- if (delta > 0) {
- if (delta > oneThird) {
- dInfoPtr->newXPixelOffset = (x - lineWidth/2);
- } else {
- dInfoPtr->newXPixelOffset += (delta );
- }
- } else {
+ delta -= lineWidth - width;
+ if (delta <= 0) {
return TCL_OK;
+ } else if (delta > oneThird) {
+ dInfoPtr->newXPixelOffset = x - lineWidth/2;
+ } else {
+ dInfoPtr->newXPixelOffset += delta;
}
}
}
dInfoPtr->flags |= DINFO_OUT_OF_DATE;
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
return TCL_OK;
}
@@ -5441,7 +5441,7 @@ TkTextXviewCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "xview". */
{
@@ -5494,7 +5494,7 @@ TkTextXviewCmd(
dInfoPtr->flags |= DINFO_OUT_OF_DATE;
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
return TCL_OK;
}
@@ -5579,7 +5579,7 @@ YScrollByPixels(
return;
}
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|DINFO_OUT_OF_DATE|REPICK_NEEDED;
}
@@ -5696,7 +5696,7 @@ YScrollByLines(
scheduleUpdate:
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
dInfoPtr->flags |= REDRAW_PENDING|DINFO_OUT_OF_DATE|REPICK_NEEDED;
}
@@ -5724,7 +5724,7 @@ TkTextYviewCmd(
TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "yview". */
{
@@ -5750,7 +5750,7 @@ TkTextYviewCmd(
pickPlace = 0;
if (Tcl_GetString(objv[2])[0] == '-') {
- register CONST char *switchStr =
+ register const char *switchStr =
Tcl_GetStringFromObj(objv[2], &switchLength);
if ((switchLength >= 2) && (strncmp(switchStr, "-pickplace",
@@ -5905,7 +5905,7 @@ TkTextScanCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "scan". */
{
@@ -5976,7 +5976,7 @@ TkTextScanCmd(
dInfoPtr->flags |= DINFO_OUT_OF_DATE;
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
- Tcl_DoWhenIdle(DisplayText, (ClientData) textPtr);
+ Tcl_DoWhenIdle(DisplayText, textPtr);
}
} else if (c=='m' && strncmp(Tcl_GetString(objv[2]), "mark", length)==0) {
dInfoPtr->scanMarkXPixel = dInfoPtr->newXPixelOffset;
@@ -6067,7 +6067,7 @@ GetXView(
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by text)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
}
}
@@ -6189,9 +6189,8 @@ GetYPixelCount(
notFirst = 1;
}
break;
- } else {
- dlPtr = dlPtr->nextPtr;
}
+ dlPtr = dlPtr->nextPtr;
} while (dlPtr->index.linePtr == linePtr);
return count;
@@ -6350,7 +6349,7 @@ GetYView(
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (vertical scrolling command executed by text)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
}
}
@@ -6377,7 +6376,7 @@ static void
AsyncUpdateYScrollbar(
ClientData clientData) /* Information about widget. */
{
- register TkText *textPtr = (TkText *) clientData;
+ register TkText *textPtr = clientData;
textPtr->dInfoPtr->scrollbarTimer = NULL;
@@ -6386,7 +6385,7 @@ AsyncUpdateYScrollbar(
}
if (--textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
}
@@ -6413,7 +6412,7 @@ static DLine *
FindDLine(
register DLine *dlPtr, /* Pointer to first in list of DLines to
* search. */
- CONST TkTextIndex *indexPtr)/* Index of desired character. */
+ const TkTextIndex *indexPtr)/* Index of desired character. */
{
TkTextLine *linePtr;
@@ -6542,25 +6541,26 @@ TkTextPixelIndex(
}
*indexPtr = textPtr->topIndex;
return;
- } else {
- for (dlPtr = validDlPtr = dInfoPtr->dLinePtr;
- y >= (dlPtr->y + dlPtr->height);
- dlPtr = dlPtr->nextPtr) {
- if (dlPtr->chunkPtr != NULL) {
- validDlPtr = dlPtr;
- }
- if (dlPtr->nextPtr == NULL) {
- /*
- * Y-coordinate is off the bottom of the displayed text. Use
- * the last character on the last line.
- */
+ }
+ for (dlPtr = validDlPtr = dInfoPtr->dLinePtr;
+ y >= (dlPtr->y + dlPtr->height);
+ dlPtr = dlPtr->nextPtr) {
+ if (dlPtr->chunkPtr != NULL) {
+ validDlPtr = dlPtr;
+ }
+ if (dlPtr->nextPtr == NULL) {
+ /*
+ * Y-coordinate is off the bottom of the displayed text. Use the
+ * last character on the last line.
+ */
- x = dInfoPtr->maxX - 1;
- nearby = 1;
- break;
- }
+ x = dInfoPtr->maxX - 1;
+ nearby = 1;
+ break;
}
- if (dlPtr->chunkPtr == NULL) dlPtr = validDlPtr;
+ }
+ if (dlPtr->chunkPtr == NULL) {
+ dlPtr = validDlPtr;
}
if (nearest != NULL) {
@@ -6653,7 +6653,7 @@ DlineIndexOfX(
*/
if (chunkPtr->numBytes > 1) {
- indexPtr->byteIndex += (*chunkPtr->measureProc)(chunkPtr, x);
+ indexPtr->byteIndex += chunkPtr->measureProc(chunkPtr, x);
}
}
@@ -6725,10 +6725,10 @@ DlineXOfIndex(
* coordinate. */
{
register TkTextDispChunk *chunkPtr = dlPtr->chunkPtr;
- int x;
+ int x = 0;
if (byteIndex == 0 || chunkPtr == NULL) {
- return 0;
+ return x;
}
/*
@@ -6741,15 +6741,14 @@ DlineXOfIndex(
if (byteIndex < chunkPtr->numBytes) {
int y, width, height;
- (*chunkPtr->bboxProc)(textPtr, chunkPtr, byteIndex,
+ chunkPtr->bboxProc(textPtr, chunkPtr, byteIndex,
dlPtr->y + dlPtr->spaceAbove,
dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width,
&height);
break;
- } else {
- byteIndex -= chunkPtr->numBytes;
}
+ byteIndex -= chunkPtr->numBytes;
if (chunkPtr->nextPtr == NULL || byteIndex == 0) {
x = chunkPtr->x + chunkPtr->width;
break;
@@ -6783,7 +6782,7 @@ DlineXOfIndex(
int
TkTextIndexBbox(
TkText *textPtr, /* Widget record for text widget. */
- CONST TkTextIndex *indexPtr,/* Index whose bounding box is desired. */
+ const TkTextIndex *indexPtr,/* Index whose bounding box is desired. */
int *xPtr, int *yPtr, /* Filled with index's upper-left
* coordinate. */
int *widthPtr, int *heightPtr,
@@ -6837,7 +6836,7 @@ TkTextIndexBbox(
* coordinate on the screen. Translate it to reflect horizontal scrolling.
*/
- (*chunkPtr->bboxProc)(textPtr, chunkPtr, byteIndex,
+ chunkPtr->bboxProc(textPtr, chunkPtr, byteIndex,
dlPtr->y + dlPtr->spaceAbove,
dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
dlPtr->baseline - dlPtr->spaceAbove, xPtr, yPtr, widthPtr,
@@ -6913,7 +6912,7 @@ TkTextIndexBbox(
int
TkTextDLineInfo(
TkText *textPtr, /* Widget record for text widget. */
- CONST TkTextIndex *indexPtr,/* Index of character whose bounding box is
+ const TkTextIndex *indexPtr,/* Index of character whose bounding box is
* desired. */
int *xPtr, int *yPtr, /* Filled with line's upper-left
* coordinate. */
@@ -7071,22 +7070,22 @@ TkTextCharLayoutProc(
#if TK_LAYOUT_WITH_BASE_CHUNKS
if (baseCharChunkPtr == NULL) {
baseCharChunkPtr = chunkPtr;
- bciPtr = (BaseCharInfo *) ckalloc(sizeof(BaseCharInfo));
+ bciPtr = ckalloc(sizeof(BaseCharInfo));
baseString = &bciPtr->baseChars;
Tcl_DStringInit(baseString);
bciPtr->width = 0;
ciPtr = &bciPtr->ci;
} else {
- bciPtr = (BaseCharInfo *) baseCharChunkPtr->clientData;
- ciPtr = (CharInfo *) ckalloc(sizeof(CharInfo));
+ bciPtr = baseCharChunkPtr->clientData;
+ ciPtr = ckalloc(sizeof(CharInfo));
baseString = &bciPtr->baseChars;
}
lineOffset = Tcl_DStringLength(baseString);
line = Tcl_DStringAppend(baseString,p,maxBytes);
- chunkPtr->clientData = (ClientData) ciPtr;
+ chunkPtr->clientData = ciPtr;
ciPtr->baseChunkPtr = baseCharChunkPtr;
ciPtr->baseOffset = lineOffset;
ciPtr->chars = NULL;
@@ -7142,7 +7141,7 @@ TkTextCharLayoutProc(
} else {
Tcl_DStringSetLength(baseString,lineOffset);
}
- ckfree((char *) ciPtr);
+ ckfree(ciPtr);
#endif /* TK_LAYOUT_WITH_BASE_CHUNKS */
return 0;
}
@@ -7168,9 +7167,8 @@ TkTextCharLayoutProc(
chunkPtr->breakIndex = -1;
#if !TK_LAYOUT_WITH_BASE_CHUNKS
- ciPtr = (CharInfo *)
- ckalloc((unsigned) bytesThatFit + Tk_Offset(CharInfo, chars) + 1);
- chunkPtr->clientData = (ClientData) ciPtr;
+ ciPtr = ckalloc((Tk_Offset(CharInfo, chars) + 1) + bytesThatFit);
+ chunkPtr->clientData = ciPtr;
memcpy(ciPtr->chars, p, (unsigned) bytesThatFit);
#endif /* TK_LAYOUT_WITH_BASE_CHUNKS */
@@ -7208,11 +7206,21 @@ TkTextCharLayoutProc(
} else {
for (count = bytesThatFit, p += bytesThatFit - 1; count > 0;
count--, p--) {
- if (UCHAR(*p) < 0x80 && isspace(UCHAR(*p))) {
+ /*
+ * Don't use isspace(); effects are unpredictable and can lead to
+ * odd word-wrapping problems on some platforms. Also don't use
+ * Tcl_UniCharIsSpace here either, as it identifies non-breaking
+ * spaces as places to break. What we actually want is only the
+ * ASCII space characters, so use them explicitly...
+ */
+
+ switch (*p) {
+ case '\t': case '\n': case '\v': case '\f': case '\r': case ' ':
chunkPtr->breakIndex = count;
- break;
+ goto checkForNextChunk;
}
}
+ checkForNextChunk:
if ((bytesThatFit + byteOffset) == segPtr->size) {
for (nextPtr = segPtr->nextPtr; nextPtr != NULL;
nextPtr = nextPtr->nextPtr) {
@@ -7272,7 +7280,7 @@ CharChunkMeasureChars(
* here. */
{
Tk_Font tkfont = chunkPtr->stylePtr->sValuePtr->tkfont;
- CharInfo *ciPtr = (CharInfo *) chunkPtr->clientData;
+ CharInfo *ciPtr = chunkPtr->clientData;
#if !TK_LAYOUT_WITH_BASE_CHUNKS
if (chars == NULL) {
@@ -7361,7 +7369,7 @@ CharDisplayProc(
int screenY) /* Y-coordinate in text window that
* corresponds to y. */
{
- CharInfo *ciPtr = (CharInfo *) chunkPtr->clientData;
+ CharInfo *ciPtr = chunkPtr->clientData;
const char *string;
TextStyle *stylePtr;
StyleValues *sValuePtr;
@@ -7379,7 +7387,7 @@ CharDisplayProc(
}
#if TK_DRAW_IN_CONTEXT
- bciPtr = (BaseCharInfo *) ciPtr->baseChunkPtr->clientData;
+ bciPtr = ciPtr->baseChunkPtr->clientData;
numBytes = Tcl_DStringLength(&bciPtr->baseChars);
string = Tcl_DStringValue(&bciPtr->baseChars);
@@ -7512,7 +7520,7 @@ CharUndisplayProc(
TkText *textPtr, /* Overall information about text widget. */
TkTextDispChunk *chunkPtr) /* Chunk that is about to be freed. */
{
- CharInfo *ciPtr = (CharInfo *) chunkPtr->clientData;
+ CharInfo *ciPtr = chunkPtr->clientData;
if (ciPtr) {
#if TK_LAYOUT_WITH_BASE_CHUNKS
@@ -7539,7 +7547,7 @@ CharUndisplayProc(
ciPtr->numBytes = 0;
#endif /* TK_LAYOUT_WITH_BASE_CHUNKS */
- ckfree((char *) ciPtr);
+ ckfree(ciPtr);
chunkPtr->clientData = NULL;
}
}
@@ -7615,7 +7623,7 @@ CharBboxProc(
int *heightPtr) /* Gets filled in with height of character, in
* pixels. */
{
- CharInfo *ciPtr = (CharInfo *) chunkPtr->clientData;
+ CharInfo *ciPtr = chunkPtr->clientData;
int maxX;
maxX = chunkPtr->width + chunkPtr->x;
@@ -7778,7 +7786,7 @@ AdjustForTab(
if (chunkPtr2->displayProc != CharDisplayProc) {
continue;
}
- ciPtr = (CharInfo *) chunkPtr2->clientData;
+ ciPtr = chunkPtr2->clientData;
for (p = ciPtr->chars, i = 0; i < ciPtr->numBytes; p++, i++) {
if (isdigit(UCHAR(*p))) {
gotDigit = 1;
@@ -7799,23 +7807,23 @@ AdjustForTab(
if (decimalChunkPtr != NULL) {
int curX;
- ciPtr = (CharInfo *) decimalChunkPtr->clientData;
+ ciPtr = decimalChunkPtr->clientData;
CharChunkMeasureChars(decimalChunkPtr, NULL, 0, 0, decimal,
decimalChunkPtr->x, -1, 0, &curX);
desired = tabX - (curX - x);
goto update;
- } else {
- /*
- * There wasn't a decimal point. Right justify the text.
- */
+ }
- width = 0;
- for (chunkPtr2 = chunkPtr->nextPtr; chunkPtr2 != NULL;
- chunkPtr2 = chunkPtr2->nextPtr) {
- width += chunkPtr2->width;
- }
- desired = tabX - width;
+ /*
+ * There wasn't a decimal point. Right justify the text.
+ */
+
+ width = 0;
+ for (chunkPtr2 = chunkPtr->nextPtr; chunkPtr2 != NULL;
+ chunkPtr2 = chunkPtr2->nextPtr) {
+ width += chunkPtr2->width;
}
+ desired = tabX - width;
/*
* Shift all of the chunks to the right so that the left edge is at the
@@ -8053,7 +8061,7 @@ NextTabStop(
static int
MeasureChars(
Tk_Font tkfont, /* Font in which to draw characters. */
- CONST char *source, /* Characters to be displayed. Need not be
+ const char *source, /* Characters to be displayed. Need not be
* NULL-terminated. */
int maxBytes, /* Maximum # of bytes to consider from
* source. */
@@ -8068,7 +8076,7 @@ MeasureChars(
* here. */
{
int curX, width, ch;
- CONST char *special, *end, *start;
+ const char *special, *end, *start;
ch = 0; /* lint. */
curX = startX;
@@ -8115,11 +8123,10 @@ MeasureChars(
break;
}
if (special < end) {
- if (ch == '\t') {
- start++;
- } else {
+ if (ch != '\t') {
break;
}
+ start++;
}
}
@@ -8160,19 +8167,19 @@ TextGetScrollInfoObj(
Tcl_Interp *interp, /* Used for error reporting. */
TkText *textPtr, /* Information about the text widget. */
int objc, /* # arguments for command. */
- Tcl_Obj *CONST objv[], /* Arguments for command. */
+ Tcl_Obj *const objv[], /* Arguments for command. */
double *dblPtr, /* Filled in with argument "moveto" option, if
* any. */
int *intPtr) /* Filled in with number of pages or lines or
* pixels to scroll, if any. */
{
- static CONST char *subcommands[] = {
+ static const char *const subcommands[] = {
"moveto", "scroll", NULL
};
enum viewSubcmds {
VIEW_MOVETO, VIEW_SCROLL
};
- static CONST char *units[] = {
+ static const char *const units[] = {
"units", "pages", "pixels", NULL
};
enum viewUnits {
@@ -8279,7 +8286,7 @@ FinalizeBaseChunk(
if (chunkPtr->displayProc != CharDisplayProc) {
continue;
}
- ciPtr = (CharInfo *)chunkPtr->clientData;
+ ciPtr = chunkPtr->clientData;
if (ciPtr->baseChunkPtr != baseCharChunkPtr) {
break;
}
@@ -8296,7 +8303,7 @@ FinalizeBaseChunk(
}
if (addChunkPtr != NULL) {
- ciPtr = (CharInfo *)addChunkPtr->clientData;
+ ciPtr = addChunkPtr->clientData;
ciPtr->chars = baseChars + ciPtr->baseOffset;
#if TK_DRAW_IN_CONTEXT
@@ -8347,7 +8354,7 @@ FreeBaseChunk(
if (chunkPtr->undisplayProc != CharUndisplayProc) {
continue;
}
- ciPtr = (CharInfo *) chunkPtr->clientData;
+ ciPtr = chunkPtr->clientData;
if (ciPtr->baseChunkPtr != baseChunkPtr) {
break;
}
@@ -8356,7 +8363,9 @@ FreeBaseChunk(
ciPtr->chars = NULL;
}
- Tcl_DStringFree(&((BaseCharInfo *) baseChunkPtr->clientData)->baseChars);
+ if (baseChunkPtr) {
+ Tcl_DStringFree(&((BaseCharInfo *) baseChunkPtr->clientData)->baseChars);
+ }
}
/*
@@ -8465,14 +8474,14 @@ RemoveFromBaseChunk(
* Reinstitute this base chunk for re-layout.
*/
- ciPtr = (CharInfo *) chunkPtr->clientData;
+ ciPtr = chunkPtr->clientData;
baseCharChunkPtr = ciPtr->baseChunkPtr;
/*
* Remove the chunk data from the base chunk data.
*/
- bciPtr = (BaseCharInfo *) baseCharChunkPtr->clientData;
+ bciPtr = baseCharChunkPtr->clientData;
if ((ciPtr->baseOffset + ciPtr->numBytes)
!= Tcl_DStringLength(&bciPtr->baseChars)) {
diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c
index 5d77c13..83684c1 100644
--- a/generic/tkTextImage.c
+++ b/generic/tkTextImage.c
@@ -54,7 +54,7 @@ static void EmbImageProc(ClientData clientData, int x, int y,
* The following structure declares the "embedded image" segment type.
*/
-static const Tk_SegType tkTextEmbImageType = {
+const Tk_SegType tkTextEmbImageType = {
"image", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -69,7 +69,7 @@ static const Tk_SegType tkTextEmbImageType = {
* Definitions for alignment values:
*/
-static char *alignStrings[] = {
+static const char *const alignStrings[] = {
"baseline", "bottom", "center", "top", NULL
};
@@ -95,9 +95,8 @@ static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_STRING, "-name", NULL, NULL,
NULL, -1, Tk_Offset(TkTextEmbImage, imageName),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
-
/*
*--------------------------------------------------------------
@@ -128,7 +127,7 @@ TkTextImageCmd(
int idx;
register TkTextSegment *eiPtr;
TkTextIndex index;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"cget", "configure", "create", "names", NULL
};
enum opts {
@@ -136,7 +135,7 @@ TkTextImageCmd(
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings, "option", 0,
@@ -171,7 +170,7 @@ TkTextImageCmd(
}
case CMD_CONF:
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?");
+ Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?");
return TCL_ERROR;
}
if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) {
@@ -215,7 +214,7 @@ TkTextImageCmd(
*/
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?");
+ Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?");
return TCL_ERROR;
}
if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) {
@@ -238,7 +237,7 @@ TkTextImageCmd(
* Create the new image segment and initialize it.
*/
- eiPtr = (TkTextSegment *) ckalloc(EI_SEG_SIZE);
+ eiPtr = ckalloc(EI_SEG_SIZE);
eiPtr->typePtr = &tkTextEmbImageType;
eiPtr->size = 1;
eiPtr->body.ei.sharedTextPtr = textPtr->sharedTextPtr;
@@ -343,7 +342,7 @@ EmbImageConfigure(
if (eiPtr->body.ei.imageString != NULL) {
image = Tk_GetImage(textPtr->interp, textPtr->tkwin,
- eiPtr->body.ei.imageString, EmbImageProc, (ClientData) eiPtr);
+ eiPtr->body.ei.imageString, EmbImageProc, eiPtr);
if (image == NULL) {
return TCL_ERROR;
}
@@ -412,7 +411,7 @@ EmbImageConfigure(
}
Tcl_SetHashValue(hPtr, eiPtr);
Tcl_AppendResult(textPtr->interp, name, NULL);
- eiPtr->body.ei.name = ckalloc((unsigned) Tcl_DStringLength(&newName)+1);
+ eiPtr->body.ei.name = ckalloc(Tcl_DStringLength(&newName) + 1);
strcpy(eiPtr->body.ei.name, name);
Tcl_DStringFree(&newName);
@@ -473,7 +472,7 @@ EmbImageDeleteProc(
if (eiPtr->body.ei.name) {
ckfree(eiPtr->body.ei.name);
}
- ckfree((char *) eiPtr);
+ ckfree(eiPtr);
return 0;
}
@@ -586,7 +585,7 @@ EmbImageLayoutProc(
chunkPtr->width = width;
chunkPtr->breakIndex = -1;
chunkPtr->breakIndex = 1;
- chunkPtr->clientData = (ClientData) eiPtr;
+ chunkPtr->clientData = eiPtr;
eiPtr->body.ei.chunkCount += 1;
return 1;
}
@@ -658,7 +657,7 @@ EmbImageDisplayProc(
int screenY) /* Y-coordinate in text window that
* corresponds to y. */
{
- TkTextSegment *eiPtr = (TkTextSegment *) chunkPtr->clientData;
+ TkTextSegment *eiPtr = chunkPtr->clientData;
int lineX, imageX, imageY, width, height;
Tk_Image image;
@@ -722,7 +721,7 @@ EmbImageBboxProc(
int *heightPtr) /* Gets filled in with height of image, in
* pixels. */
{
- TkTextSegment *eiPtr = (TkTextSegment *) chunkPtr->clientData;
+ TkTextSegment *eiPtr = chunkPtr->clientData;
Tk_Image image;
image = eiPtr->body.ei.image;
@@ -783,7 +782,7 @@ TkTextImageIndex(
if (hPtr == NULL) {
return 0;
}
- eiPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ eiPtr = Tcl_GetHashValue(hPtr);
indexPtr->tree = textPtr->sharedTextPtr->tree;
indexPtr->linePtr = eiPtr->body.ei.linePtr;
indexPtr->byteIndex = TkTextSegToOffset(eiPtr, indexPtr->linePtr);
@@ -817,7 +816,7 @@ EmbImageProc(
int imgWidth, int imgHeight)/* New dimensions of image. */
{
- TkTextSegment *eiPtr = (TkTextSegment *) clientData;
+ TkTextSegment *eiPtr = clientData;
TkTextIndex index;
index.tree = eiPtr->body.ei.sharedTextPtr->tree;
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index a9b0bed..c11ce0b 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -33,12 +33,12 @@
* Forward declarations for functions defined later in this file:
*/
-static CONST char * ForwBack(TkText *textPtr, CONST char *string,
+static const char * ForwBack(TkText *textPtr, const char *string,
TkTextIndex *indexPtr);
-static CONST char * StartEnd(TkText *textPtr, CONST char *string,
+static const char * StartEnd(TkText *textPtr, const char *string,
TkTextIndex *indexPtr);
static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr,
- TkText *textPtr, CONST char *string,
+ TkText *textPtr, const char *string,
TkTextIndex *indexPtr, int *canCachePtr);
/*
@@ -61,23 +61,23 @@ static void UpdateStringOfTextIndex(Tcl_Obj *objPtr);
#define GET_INDEXEPOCH(objPtr) \
(PTR2INT((objPtr)->internalRep.twoPtrValue.ptr2))
#define SET_TEXTINDEX(objPtr, indexPtr) \
- ((objPtr)->internalRep.twoPtrValue.ptr1 = (VOID *) (indexPtr))
+ ((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (indexPtr))
#define SET_INDEXEPOCH(objPtr, epoch) \
((objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(epoch))
-
+
/*
* Define the 'textindex' object type, which Tk uses to represent indices in
* text widgets internally.
*/
-Tcl_ObjType tkTextIndexType = {
+const Tcl_ObjType tkTextIndexType = {
"textindex", /* name */
FreeTextIndexInternalRep, /* freeIntRepProc */
DupTextIndexInternalRep, /* dupIntRepProc */
NULL, /* updateStringProc */
SetTextIndexFromAny /* setFromAnyProc */
};
-
+
static void
FreeTextIndexInternalRep(
Tcl_Obj *indexObjPtr) /* TextIndex object with internal rep to
@@ -90,10 +90,11 @@ FreeTextIndexInternalRep(
* The text widget has been deleted and we need to free it now.
*/
- ckfree((char *) (indexPtr->textPtr));
+ ckfree(indexPtr->textPtr);
}
}
- ckfree((char *) indexPtr);
+ ckfree(indexPtr);
+ indexObjPtr->typePtr = NULL;
}
static void
@@ -104,7 +105,7 @@ DupTextIndexInternalRep(
int epoch;
TkTextIndex *dupIndexPtr, *indexPtr;
- dupIndexPtr = (TkTextIndex *) ckalloc(sizeof(TkTextIndex));
+ dupIndexPtr = ckalloc(sizeof(TkTextIndex));
indexPtr = GET_TEXTINDEX(srcPtr);
epoch = GET_INDEXEPOCH(srcPtr);
@@ -119,7 +120,7 @@ DupTextIndexInternalRep(
SET_INDEXEPOCH(copyPtr, epoch);
copyPtr->typePtr = &tkTextIndexType;
}
-
+
/*
* This will not be called except by TkTextNewIndexObj below. This is because
* if a TkTextIndex is no longer valid, it is not possible to regenerate the
@@ -133,11 +134,11 @@ UpdateStringOfTextIndex(
char buffer[TK_POS_CHARS];
register int len;
- CONST TkTextIndex *indexPtr = GET_TEXTINDEX(objPtr);
+ const TkTextIndex *indexPtr = GET_TEXTINDEX(objPtr);
len = TkTextPrintIndex(indexPtr->textPtr, indexPtr, buffer);
- objPtr->bytes = ckalloc((unsigned) len + 1);
+ objPtr->bytes = ckalloc(len + 1);
strcpy(objPtr->bytes, buffer);
objPtr->length = len;
}
@@ -147,9 +148,8 @@ SetTextIndexFromAny(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_AppendToObj(Tcl_GetObjResult(interp),
- "can't convert value to textindex except via TkTextGetIndexFromObj API",
- -1);
+ Tcl_AppendResult(interp, "can't convert value to textindex except "
+ "via TkTextGetIndexFromObj API", -1);
return TCL_ERROR;
}
@@ -183,9 +183,9 @@ MakeObjIndex(
TkText *textPtr, /* Information about text widget. */
Tcl_Obj *objPtr, /* Object containing description of
* position. */
- CONST TkTextIndex *origPtr) /* Pointer to index. */
+ const TkTextIndex *origPtr) /* Pointer to index. */
{
- TkTextIndex *indexPtr = (TkTextIndex *) ckalloc(sizeof(TkTextIndex));
+ TkTextIndex *indexPtr = ckalloc(sizeof(TkTextIndex));
indexPtr->tree = origPtr->tree;
indexPtr->linePtr = origPtr->linePtr;
@@ -202,8 +202,8 @@ MakeObjIndex(
}
return indexPtr;
}
-
-CONST TkTextIndex *
+
+const TkTextIndex *
TkTextGetIndexFromObj(
Tcl_Interp *interp, /* Use this for error reporting. */
TkText *textPtr, /* Information about text widget. */
@@ -242,8 +242,8 @@ TkTextGetIndexFromObj(
if (objPtr->bytes == NULL) {
objPtr->typePtr->updateStringProc(objPtr);
}
- if ((objPtr->typePtr->freeIntRepProc) != NULL) {
- (*objPtr->typePtr->freeIntRepProc)(objPtr);
+ if (objPtr->typePtr->freeIntRepProc != NULL) {
+ objPtr->typePtr->freeIntRepProc(objPtr);
}
}
@@ -271,7 +271,7 @@ TkTextGetIndexFromObj(
Tcl_Obj *
TkTextNewIndexObj(
TkText *textPtr, /* Text widget for this index */
- CONST TkTextIndex *indexPtr)/* Pointer to index. */
+ const TkTextIndex *indexPtr)/* Pointer to index. */
{
Tcl_Obj *retVal;
@@ -385,9 +385,9 @@ TkTextMakePixelIndex(
TkTextIndex *
TkTextMakeByteIndex(
- TkTextBTree tree, /* Tree that lineIndex and byteIndex refer
+ TkTextBTree tree, /* Tree that lineIndex and byteIndex refer
* to. */
- CONST TkText *textPtr,
+ const TkText *textPtr,
int lineIndex, /* Index of desired line (0 means first line
* of text). */
int byteIndex, /* Byte index of desired character. */
@@ -395,7 +395,7 @@ TkTextMakeByteIndex(
{
TkTextSegment *segPtr;
int index;
- CONST char *p, *start;
+ const char *p, *start;
Tcl_UniChar ch;
indexPtr->tree = tree;
@@ -439,7 +439,7 @@ TkTextMakeByteIndex(
if ((byteIndex > index) && (segPtr->typePtr == &tkTextCharType)) {
/*
* Prevent UTF-8 character from being split up by ensuring
- * that byteIndex falls on a character boundary. If index
+ * that byteIndex falls on a character boundary. If the index
* falls in the middle of a UTF-8 character, it will be
* adjusted to the end of that UTF-8 character.
*/
@@ -573,7 +573,7 @@ TkTextMakeCharIndex(
TkTextSegment *
TkTextIndexToSeg(
- CONST TkTextIndex *indexPtr,/* Text index. */
+ const TkTextIndex *indexPtr,/* Text index. */
int *offsetPtr) /* Where to store offset within segment, or
* NULL if offset isn't wanted. */
{
@@ -611,10 +611,10 @@ TkTextIndexToSeg(
int
TkTextSegToOffset(
- CONST TkTextSegment *segPtr,/* Segment whose offset is desired. */
- CONST TkTextLine *linePtr) /* Line containing segPtr. */
+ const TkTextSegment *segPtr,/* Segment whose offset is desired. */
+ const TkTextLine *linePtr) /* Line containing segPtr. */
{
- CONST TkTextSegment *segPtr2;
+ const TkTextSegment *segPtr2;
int offset = 0;
for (segPtr2 = linePtr->segPtr; segPtr2 != segPtr;
@@ -705,7 +705,7 @@ int
TkTextGetIndex(
Tcl_Interp *interp, /* Use this for error reporting. */
TkText *textPtr, /* Information about text widget. */
- CONST char *string, /* Textual description of position. */
+ const char *string, /* Textual description of position. */
TkTextIndex *indexPtr) /* Index structure to fill in. */
{
return GetIndex(interp, NULL, textPtr, string, indexPtr, NULL);
@@ -739,7 +739,7 @@ GetIndex(
Tcl_Interp *interp, /* Use this for error reporting. */
TkSharedText *sharedPtr,
TkText *textPtr, /* Information about text widget. */
- CONST char *string, /* Textual description of position. */
+ const char *string, /* Textual description of position. */
TkTextIndex *indexPtr, /* Index structure to fill in. */
int *canCachePtr) /* Pointer to integer to store whether we can
* cache the index (or NULL). */
@@ -748,7 +748,7 @@ GetIndex(
TkTextIndex first, last;
int wantLast, result;
char c;
- CONST char *cp;
+ const char *cp;
Tcl_DString copy;
int canCache = 0;
@@ -790,7 +790,7 @@ GetIndex(
TkTextSearch search;
TkTextTag *tagPtr;
Tcl_HashEntry *hPtr = NULL;
- CONST char *tagName;
+ const char *tagName;
if ((p[1] == 'f') && (strncmp(p+1, "first", 5) == 0)) {
wantLast = 0;
@@ -815,7 +815,7 @@ GetIndex(
hPtr = Tcl_FindHashEntry(&sharedPtr->tagTable, tagName);
*p = '.';
if (hPtr != NULL) {
- tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr = Tcl_GetHashValue(hPtr);
}
}
@@ -831,7 +831,9 @@ GetIndex(
if (tagPtr == textPtr->selTagPtr) {
tagName = "sel";
} else {
- tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr);
+ if (hPtr != NULL) {
+ tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr);
+ }
}
Tcl_ResetResult(interp);
Tcl_AppendResult(interp,
@@ -1024,8 +1026,8 @@ GetIndex(
int
TkTextPrintIndex(
- CONST TkText *textPtr,
- CONST TkTextIndex *indexPtr,/* Pointer to index. */
+ const TkText *textPtr,
+ const TkTextIndex *indexPtr,/* Pointer to index. */
char *string) /* Place to store the position. Must have at
* least TK_POS_CHARS characters. */
{
@@ -1088,8 +1090,8 @@ TkTextPrintIndex(
int
TkTextIndexCmp(
- CONST TkTextIndex*index1Ptr,/* First index. */
- CONST TkTextIndex*index2Ptr)/* Second index. */
+ const TkTextIndex*index1Ptr,/* First index. */
+ const TkTextIndex*index2Ptr)/* Second index. */
{
int line1, line2;
@@ -1141,15 +1143,15 @@ TkTextIndexCmp(
*---------------------------------------------------------------------------
*/
-static CONST char *
+static const char *
ForwBack(
TkText *textPtr, /* Information about text widget. */
- CONST char *string, /* String to parse for additional info about
+ 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 CONST char *p, *units;
+ register const char *p, *units;
char *end;
int count, lineIndex, modifier;
size_t length;
@@ -1389,8 +1391,8 @@ ForwBack(
int
TkTextIndexForwBytes(
- CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, /* Source index. */
+ const TkText *textPtr,
+ const TkTextIndex *srcPtr, /* Source index. */
int byteCount, /* How many bytes forward to move. May be
* negative. */
TkTextIndex *dstPtr) /* Destination index: gets modified. */
@@ -1461,8 +1463,8 @@ TkTextIndexForwBytes(
void
TkTextIndexForwChars(
- CONST TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *srcPtr, /* Source index. */
+ const TkText *textPtr, /* Overall information about text widget. */
+ const TkTextIndex *srcPtr, /* Source index. */
int charCount, /* How many characters forward to move. May
* be negative. */
TkTextIndex *dstPtr, /* Destination index: gets modified. */
@@ -1482,8 +1484,7 @@ TkTextIndexForwChars(
return;
}
if (checkElided) {
- infoPtr = (TkTextElideInfo *)
- ckalloc((unsigned) sizeof(TkTextElideInfo));
+ infoPtr = ckalloc(sizeof(TkTextElideInfo));
elide = TkTextIsElided(textPtr, srcPtr, infoPtr);
}
@@ -1611,7 +1612,7 @@ TkTextIndexForwChars(
forwardCharDone:
if (infoPtr != NULL) {
TkTextFreeElideInfo(infoPtr);
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
}
@@ -1641,11 +1642,11 @@ TkTextIndexForwChars(
int
TkTextIndexCount(
- CONST TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *indexPtr1,
+ const TkText *textPtr, /* Overall information about text widget. */
+ const TkTextIndex *indexPtr1,
/* Index describing location of character from
* which to count. */
- CONST TkTextIndex *indexPtr2,
+ const TkTextIndex *indexPtr2,
/* Index describing location of last character
* at which to stop the count. */
TkTextCountType type) /* The kind of indices to count. */
@@ -1667,8 +1668,7 @@ TkTextIndexCount(
seg2Ptr = TkTextIndexToSeg(indexPtr2, &maxBytes);
if (checkElided) {
- infoPtr = (TkTextElideInfo *)
- ckalloc((unsigned) sizeof(TkTextElideInfo));
+ infoPtr = ckalloc(sizeof(TkTextElideInfo));
elide = TkTextIsElided(textPtr, indexPtr1, infoPtr);
}
@@ -1808,11 +1808,11 @@ TkTextIndexCount(
countDone:
if (infoPtr != NULL) {
TkTextFreeElideInfo(infoPtr);
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
return count;
}
-
+
/*
*---------------------------------------------------------------------------
*
@@ -1837,8 +1837,8 @@ TkTextIndexCount(
int
TkTextIndexBackBytes(
- CONST TkText *textPtr,
- CONST TkTextIndex *srcPtr, /* Source index. */
+ const TkText *textPtr,
+ const TkTextIndex *srcPtr, /* Source index. */
int byteCount, /* How many bytes backward to move. May be
* negative. */
TkTextIndex *dstPtr) /* Destination index: gets modified. */
@@ -1907,8 +1907,8 @@ TkTextIndexBackBytes(
void
TkTextIndexBackChars(
- CONST TkText *textPtr, /* Overall information about text widget. */
- CONST TkTextIndex *srcPtr, /* Source index. */
+ const TkText *textPtr, /* Overall information about text widget. */
+ const TkTextIndex *srcPtr, /* Source index. */
int charCount, /* How many characters backward to move. May
* be negative. */
TkTextIndex *dstPtr, /* Destination index: gets modified. */
@@ -1917,7 +1917,7 @@ TkTextIndexBackChars(
TkTextSegment *segPtr, *oldPtr;
TkTextElideInfo *infoPtr = NULL;
int lineIndex, segSize;
- CONST char *p, *start, *end;
+ const char *p, *start, *end;
int elide = 0;
int checkElided = (type & COUNT_DISPLAY);
@@ -1926,7 +1926,7 @@ TkTextIndexBackChars(
return;
}
if (checkElided) {
- infoPtr = (TkTextElideInfo *) ckalloc(sizeof(TkTextElideInfo));
+ infoPtr = ckalloc(sizeof(TkTextElideInfo));
elide = TkTextIsElided(textPtr, srcPtr, infoPtr);
}
@@ -2092,7 +2092,7 @@ TkTextIndexBackChars(
backwardCharDone:
if (infoPtr != NULL) {
TkTextFreeElideInfo(infoPtr);
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
}
@@ -2116,15 +2116,15 @@ TkTextIndexBackChars(
*----------------------------------------------------------------------
*/
-static CONST char *
+static const char *
StartEnd(
TkText *textPtr, /* Information about text widget. */
- CONST char *string, /* String to parse for additional info about
+ 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 modify based on string. */
{
- CONST char *p;
+ const char *p;
size_t length;
register TkTextSegment *segPtr;
int modifier;
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index 281baf1..1c08b4a 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -13,6 +13,7 @@
#include "tkInt.h"
#include "tkText.h"
+#include "tk3d.h"
/*
* Macro that determines the size of a mark segment:
@@ -104,7 +105,7 @@ TkTextMarkCmd(
TkTextIndex index;
const Tk_SegType *newTypePtr;
int optionIndex;
- static const char *markOptionStrings[] = {
+ static const char *const markOptionStrings[] = {
"gravity", "names", "next", "previous", "set", "unset", NULL
};
enum markOptions {
@@ -113,7 +114,7 @@ TkTextMarkCmd(
};
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[2], markOptionStrings, "mark option",
@@ -125,7 +126,7 @@ TkTextMarkCmd(
case MARK_GRAVITY: {
char c;
int length;
- char *str;
+ const char *str;
if (objc < 4 || objc > 5) {
Tcl_WrongNumArgs(interp, 3, objv, "markName ?gravity?");
@@ -143,7 +144,7 @@ TkTextMarkCmd(
Tcl_GetString(objv[3]), "\"", NULL);
return TCL_ERROR;
}
- markPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ markPtr = Tcl_GetHashValue(hPtr);
}
if (objc == 4) {
if (markPtr->typePtr == &tkTextRightMarkType) {
@@ -155,10 +156,10 @@ TkTextMarkCmd(
}
str = Tcl_GetStringFromObj(objv[4],&length);
c = str[0];
- if ((c == 'l') && (strncmp(str, "left", (unsigned)length) == 0)) {
+ if ((c == 'l') && (strncmp(str, "left", (unsigned) length) == 0)) {
newTypePtr = &tkTextLeftMarkType;
} else if ((c == 'r') &&
- (strncmp(str, "right", (unsigned)length) == 0)) {
+ (strncmp(str, "right", (unsigned) length) == 0)) {
newTypePtr = &tkTextRightMarkType;
} else {
Tcl_AppendResult(interp, "bad mark gravity \"", str,
@@ -213,7 +214,7 @@ TkTextMarkCmd(
hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->markTable,
Tcl_GetString(objv[i]));
if (hPtr != NULL) {
- markPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ markPtr = Tcl_GetHashValue(hPtr);
/*
* Special case not needed with peer widgets.
@@ -225,7 +226,7 @@ TkTextMarkCmd(
}
TkBTreeUnlinkSegment(markPtr, markPtr->body.mark.linePtr);
Tcl_DeleteHashEntry(hPtr);
- ckfree((char *) markPtr);
+ ckfree(markPtr);
}
}
break;
@@ -274,7 +275,7 @@ TkTextSetMark(
widgetSpecific = 0;
hPtr = Tcl_CreateHashEntry(&textPtr->sharedTextPtr->markTable, name,
&isNew);
- markPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ markPtr = Tcl_GetHashValue(hPtr);
}
if (!isNew) {
/*
@@ -287,7 +288,7 @@ TkTextSetMark(
TkTextIndex index, index2;
TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);
- TkTextIndexForwChars(NULL,&index, 1, &index2, COUNT_INDICES);
+ TkTextIndexForwChars(NULL, &index, 1, &index2, COUNT_INDICES);
/*
* While we wish to redisplay, no heights have changed, so no need
@@ -296,15 +297,15 @@ TkTextSetMark(
TkTextChanged(NULL, textPtr, &index, &index2);
if (TkBTreeLinesTo(textPtr, indexPtr->linePtr) ==
- TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr)) {
- TkTextIndexBackChars(NULL,indexPtr, 1, &insertIndex,
+ TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr)) {
+ TkTextIndexBackChars(NULL, indexPtr, 1, &insertIndex,
COUNT_INDICES);
indexPtr = &insertIndex;
}
}
TkBTreeUnlinkSegment(markPtr, markPtr->body.mark.linePtr);
} else {
- markPtr = (TkTextSegment *) ckalloc(MSEG_SIZE);
+ markPtr = ckalloc(MSEG_SIZE);
markPtr->typePtr = &tkTextRightMarkType;
markPtr->size = 0;
markPtr->body.mark.textPtr = textPtr;
@@ -328,7 +329,7 @@ TkTextSetMark(
if (markPtr == textPtr->insertMarkPtr) {
TkTextIndex index2;
- TkTextIndexForwChars(NULL,indexPtr, 1, &index2, COUNT_INDICES);
+ TkTextIndexForwChars(NULL, indexPtr, 1, &index2, COUNT_INDICES);
/*
* While we wish to redisplay, no heights have changed, so no need to
@@ -412,12 +413,13 @@ TkTextMarkNameToIndex(
} else if (!strcmp(name, "current")) {
segPtr = textPtr->currentMarkPtr;
} else {
- Tcl_HashEntry *hPtr;
- hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->markTable, name);
+ Tcl_HashEntry *hPtr =
+ Tcl_FindHashEntry(&textPtr->sharedTextPtr->markTable, name);
+
if (hPtr == NULL) {
return TCL_ERROR;
}
- segPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ segPtr = Tcl_GetHashValue(hPtr);
}
TkTextMarkSegToIndex(textPtr, segPtr, indexPtr);
return TCL_OK;
@@ -537,7 +539,7 @@ MarkLayoutProc(
*/
chunkPtr->breakIndex = -1;
- chunkPtr->clientData = (ClientData) textPtr;
+ chunkPtr->clientData = textPtr;
return 1;
}
@@ -578,13 +580,13 @@ TkTextInsertDisplayProc(
* We have no need for the clientData.
*/
- /* TkText *textPtr = (TkText *) chunkPtr->clientData; */
+ /* TkText *textPtr = chunkPtr->clientData; */
TkTextIndex index;
int halfWidth = textPtr->insertWidth/2;
int rightSideWidth;
int ix = 0, iy = 0, iw = 0, ih = 0, charWidth = 0;
- if(textPtr->insertCursorType) {
+ if (textPtr->insertCursorType) {
TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);
TkTextIndexBbox(textPtr, &index, &ix, &iy, &iw, &ih, &charWidth);
rightSideWidth = charWidth + halfWidth;
@@ -612,14 +614,37 @@ TkTextInsertDisplayProc(
* the cursor.
*/
- if (textPtr->flags & INSERT_ON) {
+ if (textPtr->flags & GOT_FOCUS) {
+ if (textPtr->flags & INSERT_ON) {
+ Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder,
+ x - halfWidth, y, charWidth + textPtr->insertWidth,
+ height, textPtr->insertBorderWidth, TK_RELIEF_RAISED);
+ } else if (textPtr->selBorder == textPtr->insertBorder) {
+ Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->border,
+ x - halfWidth, y, charWidth + textPtr->insertWidth,
+ height, 0, TK_RELIEF_FLAT);
+ }
+ } else if (textPtr->insertUnfocussed == TK_TEXT_INSERT_NOFOCUS_HOLLOW) {
+ if (textPtr->insertBorderWidth < 1) {
+ /*
+ * Hack to work around the fact that a "solid" border always
+ * paints in black.
+ */
+
+ TkBorder *borderPtr = (TkBorder *) textPtr->insertBorder;
+
+ XDrawRectangle(Tk_Display(textPtr->tkwin), dst, borderPtr->bgGC,
+ x - halfWidth, y, charWidth + textPtr->insertWidth - 1,
+ height - 1);
+ } else {
+ Tk_Draw3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder,
+ x - halfWidth, y, charWidth + textPtr->insertWidth,
+ height, textPtr->insertBorderWidth, TK_RELIEF_RAISED);
+ }
+ } else if (textPtr->insertUnfocussed == TK_TEXT_INSERT_NOFOCUS_SOLID) {
Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder,
x - halfWidth, y, charWidth + textPtr->insertWidth, height,
textPtr->insertBorderWidth, TK_RELIEF_RAISED);
- } else if (textPtr->selBorder == textPtr->insertBorder) {
- Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->border,
- x - halfWidth, y, charWidth + textPtr->insertWidth, height,
- 0, TK_RELIEF_FLAT);
}
}
@@ -748,7 +773,7 @@ MarkFindNext(
* position.
*/
- segPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ segPtr = Tcl_GetHashValue(hPtr);
TkTextMarkSegToIndex(textPtr, segPtr, &index);
segPtr = segPtr->nextPtr;
} else {
@@ -846,7 +871,7 @@ MarkFindPrev(
* position.
*/
- segPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ segPtr = Tcl_GetHashValue(hPtr);
TkTextMarkSegToIndex(textPtr, segPtr, &index);
} else {
/*
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index b0d33ce..38a1c44 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -23,7 +23,7 @@
* a whole is not.
*/
-static char *wrapStrings[] = {
+static const char *const wrapStrings[] = {
"char", "none", "word", "", NULL
};
@@ -34,7 +34,7 @@ static char *wrapStrings[] = {
* widget as a whole is not.
*/
-static char *tabStyleStrings[] = {
+static const char *const tabStyleStrings[] = {
"tabular", "wordprocessor", "", NULL
};
@@ -87,7 +87,7 @@ static const Tk_OptionSpec tagOptionSpecs[] = {
{TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL,
NULL, -1, Tk_Offset(TkTextTag, wrapMode),
TK_OPTION_NULL_OK, (ClientData) wrapStrings, 0},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
/*
@@ -99,7 +99,7 @@ static void ChangeTagPriority(TkText *textPtr, TkTextTag *tagPtr,
static TkTextTag * FindTag(Tcl_Interp *interp, TkText *textPtr,
Tcl_Obj *tagName);
static void SortTags(int numTags, TkTextTag **tagArrayPtr);
-static int TagSortProc(CONST VOID *first, CONST VOID *second);
+static int TagSortProc(const void *first, const void *second);
static void TagBindEvent(TkText *textPtr, XEvent *eventPtr,
int numTags, TkTextTag **tagArrayPtr);
@@ -126,11 +126,11 @@ TkTextTagCmd(
register TkText *textPtr, /* Information about text widget. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already
+ Tcl_Obj *const objv[]) /* Argument objects. Someone else has already
* parsed this command enough to know that
* objv[1] is "tag". */
{
- static CONST char *tagOptionStrings[] = {
+ static const char *const tagOptionStrings[] = {
"add", "bind", "cget", "configure", "delete", "lower", "names",
"nextrange", "prevrange", "raise", "ranges", "remove", NULL
};
@@ -144,7 +144,7 @@ TkTextTagCmd(
TkTextIndex index1, index2;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
@@ -223,7 +223,7 @@ TkTextTagCmd(
if (addTag && textPtr->exportSelection
&& !(textPtr->flags & GOT_SELECTION)) {
Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY,
- TkTextLostSelection, (ClientData) textPtr);
+ TkTextLostSelection, textPtr);
textPtr->flags |= GOT_SELECTION;
}
textPtr->abortSelections = 1;
@@ -251,7 +251,7 @@ TkTextTagCmd(
if (objc == 6) {
int append = 0;
unsigned long mask;
- char *fifth = Tcl_GetString(objv[5]);
+ const char *fifth = Tcl_GetString(objv[5]);
if (fifth[0] == 0) {
return Tk_DeleteBinding(interp,
@@ -283,13 +283,13 @@ TkTextTagCmd(
return TCL_ERROR;
}
} else if (objc == 5) {
- CONST char *command;
+ const char *command;
command = Tk_GetBinding(interp,
textPtr->sharedTextPtr->bindingTable,
(ClientData) tagPtr->name, Tcl_GetString(objv[4]));
if (command == NULL) {
- CONST char *string = Tcl_GetStringResult(interp);
+ const char *string = Tcl_GetStringResult(interp);
/*
* Ignore missing binding errors. This is a special hack that
@@ -334,7 +334,7 @@ TkTextTagCmd(
if (objc < 4) {
Tcl_WrongNumArgs(interp, 3, objv,
- "tagName ?option? ?value? ?option value ...?");
+ "tagName ?-option? ?value? ?-option value ...?");
return TCL_ERROR;
}
tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(objv[3]), &newTag);
@@ -351,7 +351,7 @@ TkTextTagCmd(
} else {
int result = TCL_OK;
- if (Tk_SetOptions(interp, (char*)tagPtr, tagPtr->optionTable,
+ if (Tk_SetOptions(interp, (char *) tagPtr, tagPtr->optionTable,
objc-4, objv+4, textPtr->tkwin, NULL, NULL) != TCL_OK) {
return TCL_ERROR;
}
@@ -436,7 +436,7 @@ TkTextTagCmd(
}
}
if (tagPtr->tabArrayPtr != NULL) {
- ckfree((char *) tagPtr->tabArrayPtr);
+ ckfree(tagPtr->tabArrayPtr);
tagPtr->tabArrayPtr = NULL;
}
if (tagPtr->tabStringPtr != NULL) {
@@ -539,7 +539,7 @@ TkTextTagCmd(
continue;
}
- tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr = Tcl_GetHashValue(hPtr);
if (tagPtr == textPtr->selTagPtr) {
continue;
}
@@ -600,12 +600,12 @@ TkTextTagCmd(
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
- arrayPtr = (TkTextTag **) ckalloc((unsigned)
- (textPtr->sharedTextPtr->numTags * sizeof(TkTextTag *)));
+ arrayPtr = ckalloc(textPtr->sharedTextPtr->numTags
+ * sizeof(TkTextTag *));
for (i=0, hPtr = Tcl_FirstHashEntry(
&textPtr->sharedTextPtr->tagTable, &search);
hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) {
- arrayPtr[i] = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ arrayPtr[i] = Tcl_GetHashValue(hPtr);
}
/*
@@ -634,7 +634,7 @@ TkTextTagCmd(
Tcl_NewStringObj(tagPtr->name,-1));
}
Tcl_SetObjResult(interp, listObj);
- ckfree((char *) arrayPtr);
+ ckfree(arrayPtr);
break;
}
case TAG_NEXTRANGE: {
@@ -926,14 +926,14 @@ TkTextTagCmd(
TkTextTag *
TkTextCreateTag(
TkText *textPtr, /* Widget in which tag is being used. */
- CONST char *tagName, /* Name of desired tag. */
+ const char *tagName, /* Name of desired tag. */
int *newTag) /* If non-NULL, then return 1 if new, or 0 if
* already exists. */
{
register TkTextTag *tagPtr;
Tcl_HashEntry *hPtr = NULL;
int isNew;
- CONST char *name;
+ const char *name;
if (!strcmp(tagName, "sel")) {
if (textPtr->selTagPtr != NULL) {
@@ -953,7 +953,7 @@ TkTextCreateTag(
*newTag = isNew;
}
if (!isNew) {
- return (TkTextTag *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
name = Tcl_GetHashKey(&textPtr->sharedTextPtr->tagTable, hPtr);
}
@@ -963,7 +963,7 @@ TkTextCreateTag(
* to it to the hash table entry.
*/
- tagPtr = (TkTextTag *) ckalloc(sizeof(TkTextTag));
+ tagPtr = ckalloc(sizeof(TkTextTag));
tagPtr->name = name;
tagPtr->textPtr = NULL;
tagPtr->toggleCount = 0;
@@ -1011,6 +1011,7 @@ TkTextCreateTag(
tagPtr->textPtr = textPtr;
textPtr->refCount++;
} else {
+ CLANG_ASSERT(hPtr);
Tcl_SetHashValue(hPtr, tagPtr);
}
tagPtr->optionTable =
@@ -1046,7 +1047,7 @@ FindTag(
{
Tcl_HashEntry *hPtr;
int len;
- CONST char *str;
+ const char *str;
str = Tcl_GetStringFromObj(tagName, &len);
if (len == 3 && !strcmp(str,"sel")) {
@@ -1055,7 +1056,7 @@ FindTag(
hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable,
Tcl_GetString(tagName));
if (hPtr != NULL) {
- return (TkTextTag *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
if (interp != NULL) {
Tcl_AppendResult(interp, "tag \"", Tcl_GetString(tagName),
@@ -1166,7 +1167,7 @@ TkTextFreeTag(
*/
if (tagPtr->tabArrayPtr != NULL) {
- ckfree((char *) tagPtr->tabArrayPtr);
+ ckfree(tagPtr->tabArrayPtr);
}
/*
@@ -1195,7 +1196,7 @@ TkTextFreeTag(
}
textPtr->refCount--;
if (textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
tagPtr->textPtr = NULL;
}
@@ -1204,7 +1205,7 @@ TkTextFreeTag(
* Finally free the tag's memory.
*/
- ckfree((char *) tagPtr);
+ ckfree(tagPtr);
}
/*
@@ -1277,8 +1278,8 @@ SortTags(
static int
TagSortProc(
- CONST void *first,
- CONST void *second) /* Elements to be compared. */
+ const void *first,
+ const void *second) /* Elements to be compared. */
{
TkTextTag *tagPtr1, *tagPtr2;
@@ -1347,7 +1348,7 @@ ChangeTagPriority(
}
for (hPtr = Tcl_FirstHashEntry(&textPtr->sharedTextPtr->tagTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- tagPtr2 = (TkTextTag *) Tcl_GetHashValue(hPtr);
+ tagPtr2 = Tcl_GetHashValue(hPtr);
if ((tagPtr2->priority >= low) && (tagPtr2->priority <= high)) {
tagPtr2->priority += delta;
}
@@ -1378,7 +1379,7 @@ TkTextBindProc(
ClientData clientData, /* Pointer to canvas structure. */
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
- TkText *textPtr = (TkText *) clientData;
+ TkText *textPtr = clientData;
int repick = 0;
# define AnyButtonMask \
@@ -1458,7 +1459,7 @@ TkTextBindProc(
done:
if (--textPtr->refCount == 0) {
- ckfree((char *) textPtr);
+ ckfree(textPtr);
}
}
@@ -1590,7 +1591,7 @@ TkTextPickCurrent(
SortTags(textPtr->numCurTags, textPtr->curTagArrayPtr);
if (numNewTags > 0) {
size = numNewTags * sizeof(TkTextTag *);
- copyArrayPtr = (TkTextTag **) ckalloc((unsigned) size);
+ copyArrayPtr = ckalloc(size);
memcpy(copyArrayPtr, newArrayPtr, (size_t) size);
for (i = 0; i < textPtr->numCurTags; i++) {
for (j = 0; j < numNewTags; j++) {
@@ -1632,7 +1633,7 @@ TkTextPickCurrent(
event.xcrossing.detail = NotifyAncestor;
TagBindEvent(textPtr, &event, numOldTags, oldArrayPtr);
}
- ckfree((char *) oldArrayPtr);
+ ckfree(oldArrayPtr);
}
/*
@@ -1654,7 +1655,7 @@ TkTextPickCurrent(
event.xcrossing.detail = NotifyAncestor;
TagBindEvent(textPtr, &event, numNewTags, copyArrayPtr);
}
- ckfree((char *) copyArrayPtr);
+ ckfree(copyArrayPtr);
}
}
@@ -1684,9 +1685,9 @@ TagBindEvent(
int numTags, /* Number of relevant tags. */
TkTextTag **tagArrayPtr) /* Array of relevant tags. */
{
- #define NUM_BIND_TAGS 10
- CONST char *nameArray[NUM_BIND_TAGS];
- CONST char **nameArrPtr;
+# define NUM_BIND_TAGS 10
+ const char *nameArray[NUM_BIND_TAGS];
+ const char **nameArrPtr;
int i;
/*
@@ -1694,7 +1695,7 @@ TagBindEvent(
*/
if (numTags > NUM_BIND_TAGS) {
- nameArrPtr = (CONST char **) ckalloc(numTags * sizeof(CONST char *));
+ nameArrPtr = ckalloc(numTags * sizeof(const char *));
} else {
nameArrPtr = nameArray;
}
@@ -1707,6 +1708,7 @@ TagBindEvent(
for (i = 0; i < numTags; i++) {
TkTextTag *tagPtr = tagArrayPtr[i];
+
if (tagPtr != NULL) {
nameArrPtr[i] = tagPtr->name;
} else {
@@ -1723,7 +1725,7 @@ TagBindEvent(
textPtr->tkwin, numTags, (ClientData *) nameArrPtr);
if (numTags > NUM_BIND_TAGS) {
- ckfree((char *) nameArrPtr);
+ ckfree(nameArrPtr);
}
}
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index 1758964..e54aeef 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -63,14 +63,14 @@ static void EmbWinStructureProc(ClientData clientData,
XEvent *eventPtr);
static void EmbWinUndisplayProc(TkText *textPtr,
TkTextDispChunk *chunkPtr);
-static TkTextEmbWindowClient* EmbWinGetClient(const TkText *textPtr,
+static TkTextEmbWindowClient *EmbWinGetClient(const TkText *textPtr,
TkTextSegment *ewPtr);
/*
* The following structure declares the "embedded window" segment type.
*/
-static const Tk_SegType tkTextEmbWindowType = {
+const Tk_SegType tkTextEmbWindowType = {
"window", /* name */
0, /* leftGravity */
NULL, /* splitProc */
@@ -85,7 +85,7 @@ static const Tk_SegType tkTextEmbWindowType = {
* Definitions for alignment values:
*/
-static char *alignStrings[] = {
+static const char *const alignStrings[] = {
"baseline", "bottom", "center", "top", NULL
};
@@ -111,7 +111,7 @@ static const Tk_OptionSpec optionSpecs[] = {
"0", -1, Tk_Offset(TkTextEmbWindow, stretch), 0, 0, 0},
{TK_OPTION_WINDOW, "-window", NULL, NULL,
NULL, -1, Tk_Offset(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
/*
@@ -141,7 +141,7 @@ TkTextWindowCmd(
* objv[1] is "window". */
{
int optionIndex;
- static const char *windOptionStrings[] = {
+ static const char *const windOptionStrings[] = {
"cget", "configure", "create", "names", NULL
};
enum windOptions {
@@ -150,7 +150,7 @@ TkTextWindowCmd(
register TkTextSegment *ewPtr;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[2], windOptionStrings,
@@ -202,7 +202,7 @@ TkTextWindowCmd(
TkTextSegment *ewPtr;
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?");
+ Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?");
return TCL_ERROR;
}
if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) {
@@ -216,7 +216,7 @@ TkTextWindowCmd(
}
if (objc <= 5) {
TkTextEmbWindowClient *client;
- Tcl_Obj* objPtr;
+ Tcl_Obj *objPtr;
/*
* Copy over client specific value before querying.
@@ -263,7 +263,7 @@ TkTextWindowCmd(
*/
if (objc < 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?");
+ Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?");
return TCL_ERROR;
}
if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) {
@@ -286,7 +286,7 @@ TkTextWindowCmd(
* Create the new window segment and initialize it.
*/
- ewPtr = (TkTextSegment *) ckalloc(EW_SEG_SIZE);
+ ewPtr = ckalloc(EW_SEG_SIZE);
ewPtr->typePtr = &tkTextEmbWindowType;
ewPtr->size = 1;
ewPtr->body.ew.sharedTextPtr = textPtr->sharedTextPtr;
@@ -298,8 +298,7 @@ TkTextWindowCmd(
ewPtr->body.ew.stretch = 0;
ewPtr->body.ew.optionTable = Tk_CreateOptionTable(interp, optionSpecs);
- client = (TkTextEmbWindowClient *)
- ckalloc(sizeof(TkTextEmbWindowClient));
+ client = ckalloc(sizeof(TkTextEmbWindowClient));
client->next = NULL;
client->textPtr = textPtr;
client->tkwin = NULL;
@@ -408,8 +407,8 @@ EmbWinConfigure(
&textPtr->sharedTextPtr->windowTable,
Tk_PathName(oldWindow)));
Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
- EmbWinStructureProc, (ClientData) client);
- Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL);
+ EmbWinStructureProc, client);
+ Tk_ManageGeometry(oldWindow, NULL, NULL);
if (textPtr->tkwin != Tk_Parent(oldWindow)) {
Tk_UnmaintainGeometry(oldWindow, textPtr->tkwin);
} else {
@@ -457,8 +456,7 @@ EmbWinConfigure(
* Have to make the new client.
*/
- client = (TkTextEmbWindowClient *)
- ckalloc(sizeof(TkTextEmbWindowClient));
+ client = ckalloc(sizeof(TkTextEmbWindowClient));
client->next = ewPtr->body.ew.clients;
client->textPtr = textPtr;
client->tkwin = NULL;
@@ -474,10 +472,9 @@ EmbWinConfigure(
* event handler to find out when it is deleted.
*/
- Tk_ManageGeometry(ewPtr->body.ew.tkwin, &textGeomType,
- (ClientData) client);
+ Tk_ManageGeometry(ewPtr->body.ew.tkwin, &textGeomType, client);
Tk_CreateEventHandler(ewPtr->body.ew.tkwin, StructureNotifyMask,
- EmbWinStructureProc, (ClientData) client);
+ EmbWinStructureProc, client);
/*
* Special trick! Must enter into the hash table *after* calling
@@ -518,7 +515,7 @@ EmbWinStructureProc(
ClientData clientData, /* Pointer to record describing window item. */
XEvent *eventPtr) /* Describes what just happened. */
{
- TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData;
+ TkTextEmbWindowClient *client = clientData;
TkTextSegment *ewPtr = client->parent;
TkTextIndex index;
Tcl_HashEntry *hPtr;
@@ -571,7 +568,7 @@ EmbWinRequestProc(
ClientData clientData, /* Pointer to record for window item. */
Tk_Window tkwin) /* Window that changed its desired size. */
{
- TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData;
+ TkTextEmbWindowClient *client = clientData;
TkTextSegment *ewPtr = client->parent;
TkTextIndex index;
@@ -608,15 +605,15 @@ EmbWinLostSlaveProc(
Tk_Window tkwin) /* Window that was claimed away by another
* geometry manager. */
{
- TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData;
+ TkTextEmbWindowClient *client = clientData;
TkTextSegment *ewPtr = client->parent;
TkTextIndex index;
Tcl_HashEntry *hPtr;
TkTextEmbWindowClient *loop;
Tk_DeleteEventHandler(client->tkwin, StructureNotifyMask,
- EmbWinStructureProc, (ClientData) client);
- Tcl_CancelIdleCall(EmbWinDelayedUnmap, (ClientData) client);
+ EmbWinStructureProc, client);
+ Tcl_CancelIdleCall(EmbWinDelayedUnmap, client);
if (client->textPtr->tkwin != Tk_Parent(tkwin)) {
Tk_UnmaintainGeometry(tkwin, client->textPtr->tkwin);
} else {
@@ -641,7 +638,7 @@ EmbWinLostSlaveProc(
}
loop->next = client->next;
}
- ckfree((char *) client);
+ ckfree(client);
index.tree = ewPtr->body.ew.sharedTextPtr->tree;
index.linePtr = ewPtr->body.ew.linePtr;
@@ -698,16 +695,16 @@ TkTextWinFreeClient(
if (client->tkwin != NULL) {
Tk_DeleteEventHandler(client->tkwin, StructureNotifyMask,
- EmbWinStructureProc, (ClientData) client);
+ EmbWinStructureProc, client);
Tk_DestroyWindow(client->tkwin);
}
- Tcl_CancelIdleCall(EmbWinDelayedUnmap, (ClientData) client);
+ Tcl_CancelIdleCall(EmbWinDelayedUnmap, client);
/*
* Free up this client.
*/
- ckfree((char *) client);
+ ckfree(client);
}
/*
@@ -761,7 +758,7 @@ EmbWinDeleteProc(
* Free up all memory allocated.
*/
- ckfree((char *) ewPtr);
+ ckfree(ewPtr);
return 0;
}
@@ -909,7 +906,7 @@ EmbWinLayoutProc(
}
if (code != TCL_OK) {
createError:
- Tcl_BackgroundError(textPtr->interp);
+ Tcl_BackgroundException(textPtr->interp, code);
goto gotWindow;
}
Tcl_DStringInit(&name);
@@ -946,8 +943,7 @@ EmbWinLayoutProc(
* now need to add to our client list.
*/
- client = (TkTextEmbWindowClient *)
- ckalloc(sizeof(TkTextEmbWindowClient));
+ client = ckalloc(sizeof(TkTextEmbWindowClient));
client->next = ewPtr->body.ew.clients;
client->textPtr = textPtr;
client->tkwin = NULL;
@@ -958,10 +954,9 @@ EmbWinLayoutProc(
}
client->tkwin = ewPtr->body.ew.tkwin;
- Tk_ManageGeometry(client->tkwin, &textGeomType,
- (ClientData) client);
+ Tk_ManageGeometry(client->tkwin, &textGeomType, client);
Tk_CreateEventHandler(client->tkwin, StructureNotifyMask,
- EmbWinStructureProc, (ClientData) client);
+ EmbWinStructureProc, client);
/*
* Special trick! Must enter into the hash table *after* calling
@@ -1013,7 +1008,7 @@ EmbWinLayoutProc(
chunkPtr->width = width;
chunkPtr->breakIndex = -1;
chunkPtr->breakIndex = 1;
- chunkPtr->clientData = (ClientData) ewPtr;
+ chunkPtr->clientData = ewPtr;
if (client != NULL) {
client->chunkCount += 1;
}
@@ -1089,7 +1084,7 @@ TkTextEmbWinDisplayProc(
{
int lineX, windowX, windowY, width, height;
Tk_Window tkwin;
- TkTextSegment *ewPtr = (TkTextSegment*) chunkPtr->clientData;
+ TkTextSegment *ewPtr = chunkPtr->clientData;
TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr);
if (client == NULL) {
@@ -1165,7 +1160,7 @@ EmbWinUndisplayProc(
TkText *textPtr, /* Overall information about text widget. */
TkTextDispChunk *chunkPtr) /* Chunk that is about to be freed. */
{
- TkTextSegment *ewPtr = (TkTextSegment*) chunkPtr->clientData;
+ TkTextSegment *ewPtr = chunkPtr->clientData;
TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr);
if (client == NULL) {
@@ -1183,7 +1178,7 @@ EmbWinUndisplayProc(
*/
client->displayed = 0;
- Tcl_DoWhenIdle(EmbWinDelayedUnmap, (ClientData) client);
+ Tcl_DoWhenIdle(EmbWinDelayedUnmap, client);
}
}
@@ -1228,7 +1223,7 @@ EmbWinBboxProc(
* pixels. */
{
Tk_Window tkwin;
- TkTextSegment *ewPtr = (TkTextSegment *) chunkPtr->clientData;
+ TkTextSegment *ewPtr = chunkPtr->clientData;
TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr);
if (client == NULL) {
@@ -1290,7 +1285,7 @@ static void
EmbWinDelayedUnmap(
ClientData clientData) /* Token for the window to be unmapped. */
{
- TkTextEmbWindowClient *client = (TkTextEmbWindowClient*) clientData;
+ TkTextEmbWindowClient *client = clientData;
if (!client->displayed && (client->tkwin != NULL)) {
if (client->textPtr->tkwin != Tk_Parent(client->tkwin)) {
@@ -1334,7 +1329,7 @@ TkTextWindowIndex(
return 0;
}
- ewPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr);
+ ewPtr = Tcl_GetHashValue(hPtr);
indexPtr->tree = textPtr->sharedTextPtr->tree;
indexPtr->linePtr = ewPtr->body.ew.linePtr;
indexPtr->byteIndex = TkTextSegToOffset(ewPtr, indexPtr->linePtr);
@@ -1365,7 +1360,7 @@ TkTextWindowIndex(
*--------------------------------------------------------------
*/
-static TkTextEmbWindowClient*
+static TkTextEmbWindowClient *
EmbWinGetClient(
const TkText *textPtr, /* Information about text widget. */
TkTextSegment *ewPtr) /* Segment containing embedded window. */
diff --git a/generic/tkTrig.c b/generic/tkTrig.c
index d7439b3..d999062 100644
--- a/generic/tkTrig.c
+++ b/generic/tkTrig.c
@@ -12,7 +12,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
@@ -20,9 +19,6 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#undef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#ifndef PI
-# define PI 3.14159265358979323846
-#endif /* PI */
/*
*--------------------------------------------------------------
@@ -755,7 +751,7 @@ TkOvalToPoint(
int
TkOvalToArea(
- register double *ovalPtr, /* Points to coordinates definining the
+ register double *ovalPtr, /* Points to coordinates defining the
* bounding rectangle for the oval: x1, y1,
* x2, y2. X1 must be less than x2 and y1 less
* than y2. */
diff --git a/generic/tkUndo.c b/generic/tkUndo.c
index bf2ed7c..a642e72 100644
--- a/generic/tkUndo.c
+++ b/generic/tkUndo.c
@@ -94,7 +94,7 @@ TkUndoInsertSeparator(
TkUndoAtom *separator;
if (*stack!=NULL && (*stack)->type!=TK_UNDO_SEPARATOR) {
- separator = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom));
+ separator = ckalloc(sizeof(TkUndoAtom));
separator->type = TK_UNDO_SEPARATOR;
TkUndoPushStack(stack,separator);
return 1;
@@ -135,7 +135,7 @@ TkUndoClearStack(
if (sub->action != NULL) {
Tcl_DecrRefCount(sub->action);
}
- ckfree((char *)sub);
+ ckfree(sub);
sub = next;
}
@@ -146,11 +146,11 @@ TkUndoClearStack(
if (sub->action != NULL) {
Tcl_DecrRefCount(sub->action);
}
- ckfree((char *)sub);
+ ckfree(sub);
sub = next;
}
}
- ckfree((char *)elem);
+ ckfree(elem);
}
*stack = NULL;
}
@@ -181,7 +181,7 @@ TkUndoPushAction(
{
TkUndoAtom *atom;
- atom = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom));
+ atom = ckalloc(sizeof(TkUndoAtom));
atom->type = TK_UNDO_ACTION;
atom->apply = apply;
atom->revert = revert;
@@ -237,7 +237,7 @@ TkUndoMakeCmdSubAtom(
Tcl_Panic("NULL command and actionScript in TkUndoMakeCmdSubAtom");
}
- atom = (TkUndoSubAtom *) ckalloc(sizeof(TkUndoSubAtom));
+ atom = ckalloc(sizeof(TkUndoSubAtom));
atom->command = command;
atom->funcPtr = NULL;
atom->clientData = NULL;
@@ -299,7 +299,7 @@ TkUndoMakeSubAtom(
Tcl_Panic("NULL funcPtr in TkUndoMakeSubAtom");
}
- atom = (TkUndoSubAtom *) ckalloc(sizeof(TkUndoSubAtom));
+ atom = ckalloc(sizeof(TkUndoSubAtom));
atom->command = NULL;
atom->funcPtr = funcPtr;
atom->clientData = clientData;
@@ -341,7 +341,7 @@ TkUndoInitStack(
{
TkUndoRedoStack *stack; /* An Undo/Redo stack */
- stack = (TkUndoRedoStack *) ckalloc(sizeof(TkUndoRedoStack));
+ stack = ckalloc(sizeof(TkUndoRedoStack));
stack->undoStack = NULL;
stack->redoStack = NULL;
stack->interp = interp;
@@ -392,6 +392,7 @@ TkUndoSetDepth(
prevelem = elem;
elem = elem->next;
}
+ CLANG_ASSERT(prevelem);
prevelem->next = NULL;
while (elem != NULL) {
prevelem = elem;
@@ -403,7 +404,7 @@ TkUndoSetDepth(
if (sub->action != NULL) {
Tcl_DecrRefCount(sub->action);
}
- ckfree((char *)sub);
+ ckfree(sub);
sub = next;
}
sub = elem->revert;
@@ -413,12 +414,12 @@ TkUndoSetDepth(
if (sub->action != NULL) {
Tcl_DecrRefCount(sub->action);
}
- ckfree((char *)sub);
+ ckfree(sub);
sub = next;
}
}
elem = elem->next;
- ckfree((char *) prevelem);
+ ckfree(prevelem);
}
stack->depth = stack->maxdepth;
}
@@ -471,7 +472,7 @@ TkUndoFreeStack(
TkUndoRedoStack *stack) /* An Undo/Redo stack */
{
TkUndoClearStacks(stack);
- ckfree((char *) stack);
+ ckfree(stack);
}
/*
@@ -540,7 +541,7 @@ TkUndoRevert(
}
if (elem->type == TK_UNDO_SEPARATOR) {
- ckfree((char *) elem);
+ ckfree(elem);
elem = TkUndoPopStack(&stack->undoStack);
}
@@ -602,7 +603,7 @@ TkUndoApply(
}
if (elem->type == TK_UNDO_SEPARATOR) {
- ckfree((char *) elem);
+ ckfree(elem);
elem = TkUndoPopStack(&stack->redoStack);
}
@@ -654,7 +655,7 @@ EvaluateActionList(
while (action != NULL) {
if (action->funcPtr != NULL) {
- result = (*action->funcPtr)(interp, action->clientData,
+ result = action->funcPtr(interp, action->clientData,
action->action);
} else if (action->command != NULL) {
Tcl_Obj *cmdNameObj, *evalObj;
diff --git a/generic/tkUndo.h b/generic/tkUndo.h
index b0e2db0..e63aac4 100644
--- a/generic/tkUndo.h
+++ b/generic/tkUndo.h
@@ -16,13 +16,8 @@
#include "tkInt.h"
#endif
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
- * Enum definining the types used in an undo stack.
+ * Enum defining the types used in an undo stack.
*/
typedef enum {
@@ -115,7 +110,4 @@ MODULE_SCOPE void TkUndoPushAction(TkUndoRedoStack *stack,
MODULE_SCOPE int TkUndoRevert(TkUndoRedoStack *stack);
MODULE_SCOPE int TkUndoApply(TkUndoRedoStack *stack);
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKUNDO */
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index bfa5d5c..5282708 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -18,7 +18,7 @@
* object, used for quickly finding a mapping in a TkStateMap.
*/
-Tcl_ObjType tkStateKeyObjType = {
+const Tcl_ObjType tkStateKeyObjType = {
"statekey", /* name */
NULL, /* freeIntRepProc */
NULL, /* dupIntRepProc */
@@ -59,7 +59,7 @@ TkStateParseProc(
register Tk_State *statePtr = (Tk_State *) (widgRec + offset);
- if(value == NULL || *value == 0) {
+ if (value == NULL || *value == 0) {
*statePtr = TK_STATE_NULL;
return TCL_OK;
}
@@ -121,7 +121,7 @@ TkStateParseProc(
*--------------------------------------------------------------
*/
-char *
+const char *
TkStatePrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -179,7 +179,7 @@ TkOrientParseProc(
register int *orientPtr = (int *) (widgRec + offset);
- if(value == NULL || *value == 0) {
+ if (value == NULL || *value == 0) {
*orientPtr = 0;
return TCL_OK;
}
@@ -222,7 +222,7 @@ TkOrientParseProc(
*--------------------------------------------------------------
*/
-char *
+const char *
TkOrientPrintProc(
ClientData clientData, /* Ignored. */
Tk_Window tkwin, /* Window containing canvas widget. */
@@ -273,7 +273,7 @@ TkOffsetParseProc(
tsoffset.flags = 0;
p = value;
- switch(value[0]) {
+ switch (value[0]) {
case '#':
if (PTR2INT(clientData) & TK_OFFSET_RELATIVE) {
tsoffset.flags = TK_OFFSET_RELATIVE;
@@ -336,7 +336,13 @@ TkOffsetParseProc(
tsoffset.flags = TK_OFFSET_CENTER|TK_OFFSET_MIDDLE;
goto goodTSOffset;
}
- if ((q = strchr(p,',')) == NULL) {
+
+ /*
+ * Check for an extra offset.
+ */
+
+ q = strchr(p, ',');
+ if (q == NULL) {
if (PTR2INT(clientData) & TK_OFFSET_INDEX) {
if (Tcl_GetInt(interp, (char *) p, &tsoffset.flags) != TCL_OK) {
Tcl_ResetResult(interp);
@@ -347,6 +353,7 @@ TkOffsetParseProc(
}
goto badTSOffset;
}
+
*((char *) q) = 0;
result = Tk_GetPixels(interp, tkwin, (char *) p, &tsoffset.xoffset);
*((char *) q) = ',';
@@ -357,14 +364,14 @@ TkOffsetParseProc(
return TCL_ERROR;
}
- goodTSOffset:
/*
* Below is a hack to allow the stipple/tile offset to be stored in the
* internal tile structure. Most of the times, offsetPtr is a pointer to
* an already existing tile structure. However if this structure is not
- * already created, we must do it with Tk_GetTile()!!!!;
+ * already created, we must do it with Tk_GetTile()!!!!
*/
+ goodTSOffset:
memcpy(offsetPtr, &tsoffset, sizeof(Tk_TSOffset));
return TCL_OK;
@@ -394,7 +401,7 @@ TkOffsetParseProc(
*----------------------------------------------------------------------
*/
-char *
+const char *
TkOffsetPrintProc(
ClientData clientData, /* not used */
Tk_Window tkwin, /* not used */
@@ -409,7 +416,7 @@ TkOffsetPrintProc(
if (offsetPtr->flags >= INT_MAX) {
return "end";
}
- p = (char *) ckalloc(32);
+ p = ckalloc(32);
sprintf(p, "%d", offsetPtr->flags & ~TK_OFFSET_INDEX);
*freeProcPtr = TCL_DYNAMIC;
return p;
@@ -439,7 +446,7 @@ TkOffsetPrintProc(
return "se";
}
}
- q = p = (char *) ckalloc(32);
+ q = p = ckalloc(32);
if (offsetPtr->flags & TK_OFFSET_RELATIVE) {
*q++ = '#';
}
@@ -461,7 +468,7 @@ TkOffsetPrintProc(
int
TkPixelParseProc(
ClientData clientData, /* If non-NULL, negative values are allowed as
- * well */
+ * well. */
Tcl_Interp *interp, /* Interpreter to send results back to */
Tk_Window tkwin, /* Window on same display as tile */
const char *value, /* Name of image */
@@ -493,7 +500,7 @@ TkPixelParseProc(
*----------------------------------------------------------------------
*/
-char *
+const char *
TkPixelPrintProc(
ClientData clientData, /* not used */
Tk_Window tkwin, /* not used */
@@ -502,7 +509,7 @@ TkPixelPrintProc(
Tcl_FreeProc **freeProcPtr) /* not used */
{
double *doublePtr = (double *) (widgRec + offset);
- char *p = (char *) ckalloc(24);
+ char *p = ckalloc(24);
Tcl_PrintDouble(NULL, *doublePtr, p);
*freeProcPtr = TCL_DYNAMIC;
@@ -707,11 +714,10 @@ Tk_GetScrollInfoObj(
* scroll, if any. */
{
int length;
- const char *arg;
-
- arg = Tcl_GetStringFromObj(objv[2], &length);
+ const char *arg = Tcl_GetStringFromObj(objv[2], &length);
-#define ArgPfxEq(str) ((arg[0]==str[0])&&!strncmp(arg,str,(unsigned)length))
+#define ArgPfxEq(str) \
+ ((arg[0] == str[0]) && !strncmp(arg, str, (unsigned)length))
if (ArgPfxEq("moveto")) {
if (objc != 4) {
@@ -848,14 +854,14 @@ TkComputeAnchor(
*---------------------------------------------------------------------------
*/
-char *
+const char *
TkFindStateString(
const TkStateMap *mapPtr, /* The state table. */
int numKey) /* The key to try to find in the table. */
{
for (; mapPtr->strKey!=NULL ; mapPtr++) {
if (numKey == mapPtr->numKey) {
- return (char *) mapPtr->strKey;
+ return mapPtr->strKey;
}
}
return NULL;
@@ -948,7 +954,7 @@ TkFindStateNumObj(
if (strcmp(key, mPtr->strKey) == 0) {
typePtr = keyPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- (*typePtr->freeIntRepProc)(keyPtr);
+ typePtr->freeIntRepProc(keyPtr);
}
keyPtr->internalRep.twoPtrValue.ptr1 = (void *) mapPtr;
keyPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(mPtr->numKey);
@@ -976,6 +982,206 @@ TkFindStateNumObj(
}
/*
+ * ----------------------------------------------------------------------
+ *
+ * TkBackgroundEvalObjv --
+ *
+ * Evaluate a command while ensuring that we do not affect the
+ * interpreters state. This is important when evaluating script
+ * during background tasks.
+ *
+ * Results:
+ * A standard Tcl result code.
+ *
+ * Side Effects:
+ * The interpreters variables and code may be modified by the script
+ * but the result will not be modified.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+int
+TkBackgroundEvalObjv(
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const *objv,
+ int flags)
+{
+ Tcl_DString errorInfo, errorCode;
+ Tcl_SavedResult state;
+ int n, r = TCL_OK;
+
+ Tcl_DStringInit(&errorInfo);
+ Tcl_DStringInit(&errorCode);
+
+ Tcl_Preserve(interp);
+
+ /*
+ * Record the state of the interpreter
+ */
+
+ Tcl_SaveResult(interp, &state);
+ Tcl_DStringAppend(&errorInfo,
+ Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY), -1);
+ Tcl_DStringAppend(&errorCode,
+ Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY), -1);
+
+ /*
+ * Evaluate the command and handle any error.
+ */
+
+ for (n = 0; n < objc; ++n) {
+ Tcl_IncrRefCount(objv[n]);
+ }
+ r = Tcl_EvalObjv(interp, objc, objv, flags);
+ for (n = 0; n < objc; ++n) {
+ Tcl_DecrRefCount(objv[n]);
+ }
+ if (r == TCL_ERROR) {
+ Tcl_AddErrorInfo(interp, "\n (background event handler)");
+ Tcl_BackgroundException(interp, r);
+ }
+
+ Tcl_Release(interp);
+
+ /*
+ * Restore the state of the interpreter
+ */
+
+ Tcl_SetVar(interp, "errorInfo",
+ Tcl_DStringValue(&errorInfo), TCL_GLOBAL_ONLY);
+ Tcl_SetVar(interp, "errorCode",
+ Tcl_DStringValue(&errorCode), TCL_GLOBAL_ONLY);
+ Tcl_RestoreResult(interp, &state);
+
+ /*
+ * Clean up references.
+ */
+
+ Tcl_DStringFree(&errorInfo);
+ Tcl_DStringFree(&errorCode);
+
+ return r;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMakeEnsemble --
+ *
+ * Create an ensemble from a table of implementation commands. This may
+ * be called recursively to create sub-ensembles.
+ *
+ * Results:
+ * Handle for the ensemble, or NULL if creation of it fails.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Command
+TkMakeEnsemble(
+ Tcl_Interp *interp,
+ const char *namespace,
+ const char *name,
+ ClientData clientData,
+ const TkEnsemble map[])
+{
+ Tcl_Namespace *namespacePtr = NULL;
+ Tcl_Command ensemble = NULL;
+ Tcl_Obj *dictObj = NULL, *nameObj;
+ Tcl_DString ds;
+ int i;
+
+ if (map == NULL) {
+ return NULL;
+ }
+
+ Tcl_DStringInit(&ds);
+
+ namespacePtr = Tcl_FindNamespace(interp, namespace, NULL, 0);
+ if (namespacePtr == NULL) {
+ namespacePtr = Tcl_CreateNamespace(interp, namespace, NULL, NULL);
+ if (namespacePtr == NULL) {
+ Tcl_Panic("failed to create namespace \"%s\"", namespace);
+ }
+ }
+
+ nameObj = Tcl_NewStringObj(name, -1);
+ ensemble = Tcl_FindEnsemble(interp, nameObj, 0);
+ Tcl_DecrRefCount(nameObj);
+ if (ensemble == NULL) {
+ ensemble = Tcl_CreateEnsemble(interp, name, namespacePtr,
+ TCL_ENSEMBLE_PREFIX);
+ if (ensemble == NULL) {
+ Tcl_Panic("failed to create ensemble \"%s\"", name);
+ }
+ }
+
+ Tcl_DStringSetLength(&ds, 0);
+ Tcl_DStringAppend(&ds, namespace, -1);
+ if (!(strlen(namespace) == 2 && namespace[1] == ':')) {
+ Tcl_DStringAppend(&ds, "::", -1);
+ }
+ Tcl_DStringAppend(&ds, name, -1);
+
+ dictObj = Tcl_NewObj();
+ for (i = 0; map[i].name != NULL ; ++i) {
+ Tcl_Obj *nameObj, *fqdnObj;
+
+ nameObj = Tcl_NewStringObj(map[i].name, -1);
+ fqdnObj = Tcl_NewStringObj(Tcl_DStringValue(&ds),
+ Tcl_DStringLength(&ds));
+ Tcl_AppendStringsToObj(fqdnObj, "::", map[i].name, NULL);
+ Tcl_DictObjPut(NULL, dictObj, nameObj, fqdnObj);
+ if (map[i].proc) {
+ Tcl_CreateObjCommand(interp, Tcl_GetString(fqdnObj),
+ map[i].proc, clientData, NULL);
+ } else if (map[i].subensemble) {
+ TkMakeEnsemble(interp, Tcl_DStringValue(&ds),
+ map[i].name, clientData, map[i].subensemble);
+ }
+ }
+
+ if (ensemble) {
+ Tcl_SetEnsembleMappingDict(interp, ensemble, dictObj);
+ }
+
+ Tcl_DStringFree(&ds);
+ return ensemble;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSendVirtualEvent --
+ *
+ * Send a virtual event notification to the specified target window.
+ * Equivalent to "event generate $target <<$eventName>>"
+ *
+ * Note that we use Tk_QueueWindowEvent, not Tk_HandleEvent, so this
+ * routine does not reenter the interpreter.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSendVirtualEvent(
+ Tk_Window target,
+ const char *eventName)
+{
+ union {XEvent general; XVirtualEvent virtual;} event;
+
+ memset(&event, 0, sizeof(event));
+ event.general.xany.type = VirtualEvent;
+ event.general.xany.serial = NextRequest(Tk_Display(target));
+ event.general.xany.send_event = False;
+ event.general.xany.window = Tk_WindowId(target);
+ event.general.xany.display = Tk_Display(target);
+ event.virtual.name = Tk_GetUid(eventName);
+
+ Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL);
+}
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/generic/tkVisual.c b/generic/tkVisual.c
index ec8be11..3602088 100644
--- a/generic/tkVisual.c
+++ b/generic/tkVisual.c
@@ -20,12 +20,12 @@
*/
typedef struct VisualDictionary {
- char *name; /* Textual name of class. */
+ const char *name; /* Textual name of class. */
int minLength; /* Minimum # characters that must be specified
* for an unambiguous match. */
int class; /* X symbol for class. */
} VisualDictionary;
-static VisualDictionary visualNames[] = {
+static const VisualDictionary visualNames[] = {
{"best", 1, 0},
{"directcolor", 2, DirectColor},
{"grayscale", 1, GrayScale},
@@ -86,7 +86,7 @@ Visual *
Tk_GetVisual(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which visual will be used. */
- CONST char *string, /* String describing visual. See manual entry
+ const char *string, /* String describing visual. See manual entry
* for details. */
int *depthPtr, /* The depth of the returned visual is stored
* here. */
@@ -101,8 +101,8 @@ Tk_GetVisual(
Visual *visual;
ptrdiff_t length;
int c, numVisuals, prio, bestPrio, i;
- CONST char *p;
- VisualDictionary *dictPtr;
+ const char *p;
+ const VisualDictionary *dictPtr;
TkColormap *cmapPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -301,6 +301,7 @@ Tk_GetVisual(
bestPtr = &visInfoList[i];
bestPrio = prio;
}
+ CLANG_ASSERT(bestPtr);
*depthPtr = bestPtr->depth;
visual = bestPtr->visual;
XFree((char *) visInfoList);
@@ -324,7 +325,7 @@ Tk_GetVisual(
goto done;
}
}
- cmapPtr = (TkColormap *) ckalloc(sizeof(TkColormap));
+ cmapPtr = ckalloc(sizeof(TkColormap));
cmapPtr->colormap = XCreateColormap(Tk_Display(tkwin),
RootWindowOfScreen(Tk_Screen(tkwin)), visual,
AllocNone);
@@ -366,7 +367,7 @@ Colormap
Tk_GetColormap(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window where colormap will be used. */
- CONST char *string) /* String that identifies colormap: either
+ const char *string) /* String that identifies colormap: either
* "new" or the name of another window. */
{
Colormap colormap;
@@ -379,7 +380,7 @@ Tk_GetColormap(
*/
if (strcmp(string, "new") == 0) {
- cmapPtr = (TkColormap *) ckalloc(sizeof(TkColormap));
+ cmapPtr = ckalloc(sizeof(TkColormap));
cmapPtr->colormap = XCreateColormap(Tk_Display(tkwin),
RootWindowOfScreen(Tk_Screen(tkwin)), Tk_Visual(tkwin),
AllocNone);
@@ -478,7 +479,7 @@ Tk_FreeColormap(
} else {
prevPtr->nextPtr = cmapPtr->nextPtr;
}
- ckfree((char *) cmapPtr);
+ ckfree(cmapPtr);
}
return;
}
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 1ffdd56..7102b1a 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -92,11 +92,12 @@ static XSetWindowAttributes defAtts= {
* The following structure defines all of the commands supported by Tk, and
* the C functions that execute them.
*/
-
+typedef int (TkInitProc)(Tcl_Interp *interp, ClientData clientData);
typedef struct {
- char *name; /* Name of command. */
+ const char *name; /* Name of command. */
Tcl_CmdProc *cmdProc; /* Command's string-based function. */
Tcl_ObjCmdProc *objProc; /* Command's object-based function. */
+ TkInitProc *initProc; /* Command's initialization function */
int isSafe; /* If !0, this command will be exposed in a
* safe interpreter. Otherwise it will be
* hidden in a safe interpreter. */
@@ -105,77 +106,77 @@ typedef struct {
* clientData to command function. */
} TkCmd;
-static TkCmd commands[] = {
+static const TkCmd commands[] = {
/*
* Commands that are part of the intrinsics:
*/
- {"bell", NULL, Tk_BellObjCmd, 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", 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", NULL, Tk_PackObjCmd, 1, 1},
- {"place", NULL, Tk_PlaceObjCmd, 1, 0},
- {"raise", NULL, Tk_RaiseObjCmd, 1, 1},
- {"selection", NULL, Tk_SelectionObjCmd, 0, 1},
- {"tk", NULL, Tk_TkObjCmd, 1, 1},
- {"tkwait", NULL, Tk_TkwaitObjCmd, 1, 1},
- {"update", NULL, Tk_UpdateObjCmd, 1, 1},
- {"winfo", NULL, Tk_WinfoObjCmd, 1, 1},
- {"wm", NULL, Tk_WmObjCmd, 0, 1},
+ {"bell", NULL, Tk_BellObjCmd, NULL, 0, 1},
+ {"bind", NULL, Tk_BindObjCmd, NULL, 1, 1},
+ {"bindtags", NULL, Tk_BindtagsObjCmd, NULL, 1, 1},
+ {"clipboard", NULL, Tk_ClipboardObjCmd, NULL, 0, 1},
+ {"destroy", NULL, Tk_DestroyObjCmd, NULL, 1, 1},
+ {"event", NULL, Tk_EventObjCmd, NULL, 1, 1},
+ {"focus", NULL, Tk_FocusObjCmd, NULL, 1, 1},
+ {"font", NULL, Tk_FontObjCmd, NULL, 1, 1},
+ {"grab", NULL, Tk_GrabObjCmd, NULL, 0, 1},
+ {"grid", NULL, Tk_GridObjCmd, NULL, 1, 1},
+ {"image", NULL, Tk_ImageObjCmd, NULL, 1, 1},
+ {"lower", NULL, Tk_LowerObjCmd, NULL, 1, 1},
+ {"option", NULL, Tk_OptionObjCmd, NULL, 1, 1},
+ {"pack", NULL, Tk_PackObjCmd, NULL, 1, 1},
+ {"place", NULL, Tk_PlaceObjCmd, NULL, 1, 1},
+ {"raise", NULL, Tk_RaiseObjCmd, NULL, 1, 1},
+ {"selection", NULL, Tk_SelectionObjCmd, NULL, 0, 1},
+ {"tk", NULL, NULL, TkInitTkCmd, 1, 1},
+ {"tkwait", NULL, Tk_TkwaitObjCmd, NULL, 1, 1},
+ {"update", NULL, Tk_UpdateObjCmd, NULL, 1, 1},
+ {"winfo", NULL, Tk_WinfoObjCmd, NULL, 1, 1},
+ {"wm", NULL, Tk_WmObjCmd, NULL, 0, 1},
/*
* Default widget class commands.
*/
- {"button", NULL, Tk_ButtonObjCmd, 1, 0},
- {"canvas", NULL, Tk_CanvasObjCmd, 1, 1},
- {"checkbutton", NULL, Tk_CheckbuttonObjCmd, 1, 0},
- {"entry", NULL, Tk_EntryObjCmd, 1, 0},
- {"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", 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", NULL, Tk_TextObjCmd, 1, 1},
- {"toplevel", NULL, Tk_ToplevelObjCmd, 0, 0},
+ {"button", NULL, Tk_ButtonObjCmd, NULL, 1, 0},
+ {"canvas", NULL, Tk_CanvasObjCmd, NULL, 1, 1},
+ {"checkbutton", NULL, Tk_CheckbuttonObjCmd, NULL, 1, 0},
+ {"entry", NULL, Tk_EntryObjCmd, NULL, 1, 0},
+ {"frame", NULL, Tk_FrameObjCmd, NULL, 1, 0},
+ {"label", NULL, Tk_LabelObjCmd, NULL, 1, 0},
+ {"labelframe", NULL, Tk_LabelframeObjCmd, NULL, 1, 0},
+ {"listbox", NULL, Tk_ListboxObjCmd, NULL, 1, 0},
+ {"menubutton", NULL, Tk_MenubuttonObjCmd, NULL, 1, 0},
+ {"message", NULL, Tk_MessageObjCmd, NULL, 1, 0},
+ {"panedwindow", NULL, Tk_PanedWindowObjCmd, NULL, 1, 0},
+ {"radiobutton", NULL, Tk_RadiobuttonObjCmd, NULL, 1, 0},
+ {"scale", NULL, Tk_ScaleObjCmd, NULL, 1, 0},
+ {"scrollbar", Tk_ScrollbarCmd,NULL, NULL, 1, 1},
+ {"spinbox", NULL, Tk_SpinboxObjCmd, NULL, 1, 0},
+ {"text", NULL, Tk_TextObjCmd, NULL, 1, 1},
+ {"toplevel", NULL, Tk_ToplevelObjCmd, NULL, 0, 0},
/*
* Classic widget class commands.
*/
- {"::tk::button", NULL, Tk_ButtonObjCmd, 1, 0},
- {"::tk::canvas", NULL, Tk_CanvasObjCmd, 1, 1},
- {"::tk::checkbutton",NULL, Tk_CheckbuttonObjCmd, 1, 0},
- {"::tk::entry", NULL, Tk_EntryObjCmd, 1, 0},
- {"::tk::frame", NULL, Tk_FrameObjCmd, 1, 0},
- {"::tk::label", NULL, Tk_LabelObjCmd, 1, 0},
- {"::tk::labelframe",NULL, Tk_LabelframeObjCmd, 1, 0},
- {"::tk::listbox", NULL, Tk_ListboxObjCmd, 1, 0},
- {"::tk::menubutton",NULL, Tk_MenubuttonObjCmd, 1, 0},
- {"::tk::message", NULL, Tk_MessageObjCmd, 1, 0},
- {"::tk::panedwindow",NULL, Tk_PanedWindowObjCmd, 1, 0},
- {"::tk::radiobutton",NULL, Tk_RadiobuttonObjCmd, 1, 0},
- {"::tk::scale", NULL, Tk_ScaleObjCmd, 1, 0},
- {"::tk::scrollbar", Tk_ScrollbarCmd, NULL, 1, 1},
- {"::tk::spinbox", NULL, Tk_SpinboxObjCmd, 1, 0},
- {"::tk::text", NULL, Tk_TextObjCmd, 1, 1},
- {"::tk::toplevel", NULL, Tk_ToplevelObjCmd, 0, 0},
+ {"::tk::button", NULL, Tk_ButtonObjCmd, NULL, 1, 0},
+ {"::tk::canvas", NULL, Tk_CanvasObjCmd, NULL, 1, 1},
+ {"::tk::checkbutton",NULL, Tk_CheckbuttonObjCmd, NULL, 1, 0},
+ {"::tk::entry", NULL, Tk_EntryObjCmd, NULL, 1, 0},
+ {"::tk::frame", NULL, Tk_FrameObjCmd, NULL, 1, 0},
+ {"::tk::label", NULL, Tk_LabelObjCmd, NULL, 1, 0},
+ {"::tk::labelframe",NULL, Tk_LabelframeObjCmd, NULL, 1, 0},
+ {"::tk::listbox", NULL, Tk_ListboxObjCmd, NULL, 1, 0},
+ {"::tk::menubutton",NULL, Tk_MenubuttonObjCmd, NULL, 1, 0},
+ {"::tk::message", NULL, Tk_MessageObjCmd, NULL, 1, 0},
+ {"::tk::panedwindow",NULL, Tk_PanedWindowObjCmd, NULL, 1, 0},
+ {"::tk::radiobutton",NULL, Tk_RadiobuttonObjCmd, NULL, 1, 0},
+ {"::tk::scale", NULL, Tk_ScaleObjCmd, NULL, 1, 0},
+ {"::tk::scrollbar", Tk_ScrollbarCmd,NULL, NULL, 1, 1},
+ {"::tk::spinbox", NULL, Tk_SpinboxObjCmd, NULL, 1, 0},
+ {"::tk::text", NULL, Tk_TextObjCmd, NULL, 1, 1},
+ {"::tk::toplevel", NULL, Tk_ToplevelObjCmd, NULL, 0, 0},
/*
* Standard dialog support. Note that the Unix/X11 platform implements
@@ -183,11 +184,11 @@ static TkCmd commands[] = {
*/
#if defined(__WIN32__) || 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},
- {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, 0, 1},
- {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, 0, 1},
+ {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, NULL, 0, 1},
+ {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd,NULL, 0,1},
+ {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, NULL, 0, 1},
+ {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, NULL, 0, 1},
+ {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, NULL, 0, 1},
#endif
/*
@@ -196,9 +197,9 @@ static TkCmd commands[] = {
#if defined(MAC_OSX_TK)
{"::tk::unsupported::MacWindowStyle",
- NULL, TkUnsupported1ObjCmd, 1, 1},
+ NULL, TkUnsupported1ObjCmd, NULL, 1, 1},
#endif
- {NULL, NULL, NULL, 0, 0}
+ {NULL, NULL, NULL, NULL, 0, 0}
};
/*
@@ -215,7 +216,7 @@ static char *use = NULL;
static char *visual = NULL;
static int rest = 0;
-static Tk_ArgvInfo argTable[] = {
+static const Tk_ArgvInfo argTable[] = {
{"-colormap", TK_ARGV_STRING, NULL, (char *) &colormap,
"Colormap for main window"},
{"-display", TK_ARGV_STRING, NULL, (char *) &display,
@@ -240,14 +241,14 @@ static Tk_ArgvInfo argTable[] = {
*/
static Tk_Window CreateTopLevelWindow(Tcl_Interp *interp,
- Tk_Window parent, CONST char *name,
- CONST char *screenName, unsigned int flags);
+ Tk_Window parent, const char *name,
+ const char *screenName, unsigned int flags);
static void DeleteWindowsExitProc(ClientData clientData);
-static TkDisplay * GetScreen(Tcl_Interp *interp, CONST char *screenName,
+static TkDisplay * GetScreen(Tcl_Interp *interp, const char *screenName,
int *screenPtr);
static int Initialize(Tcl_Interp *interp);
static int NameWindow(Tcl_Interp *interp, TkWindow *winPtr,
- TkWindow *parentPtr, CONST char *name);
+ TkWindow *parentPtr, const char *name);
static void UnlinkWindow(TkWindow *winPtr);
/*
@@ -291,7 +292,7 @@ TkCloseDisplay(
errorPtr != NULL;
errorPtr = dispPtr->errorPtr) {
dispPtr->errorPtr = errorPtr->nextPtr;
- ckfree((char *) errorPtr);
+ ckfree(errorPtr);
}
}
@@ -306,7 +307,7 @@ TkCloseDisplay(
Tcl_DeleteHashTable(&dispPtr->winTable);
- ckfree((char *) dispPtr);
+ ckfree(dispPtr);
/*
* There is more to clean up, we leave it at this for the time being.
@@ -340,9 +341,9 @@ CreateTopLevelWindow(
Tk_Window parent, /* Token for logical parent of new window
* (used for naming, options, etc.). May be
* NULL. */
- CONST char *name, /* Name for new window; if parent is non-NULL,
+ const char *name, /* Name for new window; if parent is non-NULL,
* must be unique among parent's children. */
- CONST char *screenName, /* Name of screen on which to create window.
+ 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
@@ -352,7 +353,7 @@ CreateTopLevelWindow(
register TkWindow *winPtr;
register TkDisplay *dispPtr;
int screenId;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
@@ -370,6 +371,7 @@ CreateTopLevelWindow(
*/
Tk_CreatePhotoImageFormat(&tkImgFmtGIF);
+ Tk_CreatePhotoImageFormat(&tkImgFmtPNG);
Tk_CreatePhotoImageFormat(&tkImgFmtPPM);
}
@@ -444,15 +446,15 @@ CreateTopLevelWindow(
static TkDisplay *
GetScreen(
Tcl_Interp *interp, /* Place to leave error message. */
- CONST char *screenName, /* Name for screen. NULL or empty means use
+ const char *screenName, /* Name for screen. NULL or empty means use
* DISPLAY envariable. */
int *screenPtr) /* Where to store screen number. */
{
register TkDisplay *dispPtr;
- CONST char *p;
+ const char *p;
int screenId;
size_t length;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -504,7 +506,7 @@ GetScreen(
dispPtr->lastEventTime = CurrentTime;
dispPtr->bindInfoStale = 1;
dispPtr->cursorFont = None;
- dispPtr->warpWindow = None;
+ dispPtr->warpWindow = NULL;
dispPtr->multipleAtom = None;
/*
@@ -516,11 +518,9 @@ GetScreen(
Tcl_InitHashTable(&dispPtr->winTable, TCL_ONE_WORD_KEYS);
- dispPtr->name = (char *) ckalloc((unsigned) (length+1));
+ dispPtr->name = ckalloc(length + 1);
strncpy(dispPtr->name, screenName, length);
dispPtr->name[length] = '\0';
-
- TkInitXId(dispPtr);
break;
}
if ((strncmp(dispPtr->name, screenName, length) == 0)
@@ -562,7 +562,7 @@ TkGetDisplay(
Display *display) /* X's display pointer */
{
TkDisplay *dispPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (dispPtr = tsdPtr->displayList; dispPtr != NULL;
@@ -595,7 +595,7 @@ TkGetDisplay(
TkDisplay *
TkGetDisplayList(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->displayList;
@@ -622,7 +622,7 @@ TkGetDisplayList(void)
TkMainInfo *
TkGetMainInfoList(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->mainWindowList;
@@ -652,9 +652,8 @@ TkAllocWindow(
* inherit visual information. NULL means use
* screen defaults instead of inheriting. */
{
- register TkWindow *winPtr;
+ register TkWindow *winPtr = ckalloc(sizeof(TkWindow));
- winPtr = (TkWindow *) ckalloc(sizeof(TkWindow));
winPtr->display = dispPtr->display;
winPtr->dispPtr = dispPtr;
winPtr->screenNum = screenNum;
@@ -707,6 +706,7 @@ TkAllocWindow(
winPtr->internalBorderBottom = 0;
winPtr->minReqWidth = 0;
winPtr->minReqHeight = 0;
+ winPtr->geometryMaster = NULL;
return winPtr;
}
@@ -734,7 +734,7 @@ NameWindow(
register TkWindow *winPtr, /* Window that is to be named and inserted. */
TkWindow *parentPtr, /* Pointer to logical parent for winPtr (used
* for naming, options, etc.). */
- CONST 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
@@ -800,7 +800,7 @@ NameWindow(
if ((length1+length2+2) <= FIXED_SIZE) {
pathName = staticSpace;
} else {
- pathName = (char *) ckalloc((unsigned) (length1+length2+2));
+ pathName = ckalloc(length1 + length2 + 2);
}
if (length1 == 1) {
pathName[0] = '.';
@@ -851,10 +851,10 @@ NameWindow(
Tk_Window
TkCreateMainWindow(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- CONST char *screenName, /* Name of screen on which to create window.
+ 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
+ const char *baseName) /* Base name for application; usually of the
* form "prog instance". */
{
Tk_Window tkwin;
@@ -862,9 +862,9 @@ TkCreateMainWindow(
Tcl_HashEntry *hPtr;
register TkMainInfo *mainPtr;
register TkWindow *winPtr;
- register TkCmd *cmdPtr;
+ register const TkCmd *cmdPtr;
ClientData clientData;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -892,7 +892,7 @@ TkCreateMainWindow(
*/
winPtr = (TkWindow *) tkwin;
- mainPtr = (TkMainInfo *) ckalloc(sizeof(TkMainInfo));
+ mainPtr = ckalloc(sizeof(TkMainInfo));
mainPtr->winPtr = winPtr;
mainPtr->refCount = 1;
mainPtr->interp = interp;
@@ -926,6 +926,7 @@ TkCreateMainWindow(
hPtr = Tcl_CreateHashEntry(&mainPtr->nameTable, ".", &dummy);
Tcl_SetHashValue(hPtr, winPtr);
winPtr->pathName = Tcl_GetHashKey(&mainPtr->nameTable, hPtr);
+ Tcl_InitHashTable(&mainPtr->busyTable, TCL_ONE_WORD_KEYS);
/*
* We have just created another Tk application; increment the refcount on
@@ -946,17 +947,20 @@ TkCreateMainWindow(
isSafe = Tcl_IsSafe(interp);
for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) {
- if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)) {
+ if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)
+ && (cmdPtr->initProc == NULL)) {
Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs");
}
if (cmdPtr->passMainWindow) {
- clientData = (ClientData) tkwin;
+ clientData = tkwin;
} else {
- clientData = (ClientData) NULL;
+ clientData = NULL;
}
- if (cmdPtr->cmdProc != NULL) {
+ if (cmdPtr->initProc != NULL) {
+ cmdPtr->initProc(interp, clientData);
+ } else if (cmdPtr->cmdProc != NULL) {
Tcl_CreateCommand(interp, cmdPtr->name, cmdPtr->cmdProc,
- clientData, (void (*) _ANSI_ARGS_((ClientData))) NULL);
+ clientData, NULL);
} else {
Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc,
clientData, NULL);
@@ -1009,36 +1013,36 @@ Tk_CreateWindow(
* the interp's result is assumed to be
* initialized by the caller. */
Tk_Window parent, /* Token for parent of new window. */
- CONST char *name, /* Name for new window. Must be unique among
+ const char *name, /* Name for new window. Must be unique among
* parent's children. */
- CONST 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
* 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", NULL);
- return NULL;
- } else if ((parentPtr != NULL) &&
- (parentPtr->flags & TK_CONTAINER)) {
- Tcl_AppendResult(interp,
- "can't create window: its parent has -container = yes", NULL);
- return NULL;
- }
-
- if (screenName == NULL) {
- winPtr = TkAllocWindow(parentPtr->dispPtr, parentPtr->screenNum,
- parentPtr);
- if (NameWindow(interp, winPtr, parentPtr, name) != TCL_OK) {
- Tk_DestroyWindow((Tk_Window) winPtr);
+ if (parentPtr) {
+ if (parentPtr->flags & TK_ALREADY_DEAD) {
+ Tcl_AppendResult(interp,
+ "can't create window: parent has been destroyed", NULL);
return NULL;
+ } else if (parentPtr->flags & TK_CONTAINER) {
+ Tcl_AppendResult(interp,
+ "can't create window: its parent has -container = yes",
+ NULL);
+ return NULL;
+ } else if (screenName == NULL) {
+ TkWindow *winPtr = TkAllocWindow(parentPtr->dispPtr,
+ parentPtr->screenNum, parentPtr);
+
+ if (NameWindow(interp, winPtr, parentPtr, name) != TCL_OK) {
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ return NULL;
+ }
+ return (Tk_Window) winPtr;
}
- return (Tk_Window) winPtr;
}
return CreateTopLevelWindow(interp, parent, name, screenName,
/* flags */ 0);
@@ -1073,39 +1077,39 @@ Tk_CreateAnonymousWindow(
* 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
+ 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", NULL);
- return NULL;
- } else if ((parentPtr != NULL) &&
- (parentPtr->flags & TK_CONTAINER)) {
- Tcl_AppendResult(interp,
- "can't create window: its parent has -container = yes", 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, NULL) != TCL_OK) {
- Tk_DestroyWindow((Tk_Window) winPtr);
+ if (parentPtr) {
+ if (parentPtr->flags & TK_ALREADY_DEAD) {
+ Tcl_AppendResult(interp,
+ "can't create window: parent has been destroyed", NULL);
+ return NULL;
+ } else if (parentPtr->flags & TK_CONTAINER) {
+ Tcl_AppendResult(interp,
+ "can't create window: its parent has -container = yes",
+ NULL);
return NULL;
+ } else if (screenName == NULL) {
+ TkWindow *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, NULL) != TCL_OK) {
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ return NULL;
+ }
+ return (Tk_Window) winPtr;
}
- return (Tk_Window) winPtr;
}
return CreateTopLevelWindow(interp, parent, NULL, screenName,
TK_ANONYMOUS_WINDOW);
@@ -1140,11 +1144,11 @@ Tk_CreateWindowFromPath(
* initialized by the caller. */
Tk_Window tkwin, /* Token for any window in application that is
* to contain new window. */
- CONST 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. */
- CONST char *screenName) /* If NULL, new window will be on same screen
+ 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 window. */
@@ -1171,7 +1175,7 @@ Tk_CreateWindowFromPath(
}
numChars = (int) (p-pathName);
if (numChars > FIXED_SPACE) {
- p = (char *) ckalloc((unsigned) (numChars+1));
+ p = ckalloc(numChars + 1);
} else {
p = fixedSpace;
}
@@ -1255,7 +1259,7 @@ Tk_DestroyWindow(
TkDisplay *dispPtr = winPtr->dispPtr;
XEvent event;
TkHalfdeadWindow *halfdeadPtr, *prev_halfdeadPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->flags & TK_ALREADY_DEAD) {
@@ -1278,7 +1282,7 @@ Tk_DestroyWindow(
(tsdPtr->halfdeadWindowList->winPtr == winPtr)) {
halfdeadPtr = tsdPtr->halfdeadWindowList;
} else {
- halfdeadPtr = (TkHalfdeadWindow *) ckalloc(sizeof(TkHalfdeadWindow));
+ halfdeadPtr = ckalloc(sizeof(TkHalfdeadWindow));
halfdeadPtr->flags = 0;
halfdeadPtr->winPtr = winPtr;
halfdeadPtr->nextPtr = tsdPtr->halfdeadWindowList;
@@ -1340,7 +1344,6 @@ Tk_DestroyWindow(
if (!(halfdeadPtr->flags & HD_DESTROY_COUNT)) {
halfdeadPtr->flags |= HD_DESTROY_COUNT;
- dispPtr->destroyCount++;
}
while (winPtr->childList != NULL) {
@@ -1423,7 +1426,7 @@ Tk_DestroyWindow(
} else {
prev_halfdeadPtr->nextPtr = halfdeadPtr->nextPtr;
}
- ckfree((char *) halfdeadPtr);
+ ckfree(halfdeadPtr);
break;
}
prev_halfdeadPtr = halfdeadPtr;
@@ -1455,19 +1458,15 @@ Tk_DestroyWindow(
* to do an explicit destroy of this X window.
*/
- dispPtr->lastDestroyRequest = NextRequest(winPtr->display);
XDestroyWindow(winPtr->display, winPtr->window);
}
#endif
- TkFreeWindowId(dispPtr, winPtr->window);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->winTable,
(char *) winPtr->window));
winPtr->window = None;
}
- dispPtr->destroyCount--;
UnlinkWindow(winPtr);
TkEventDeadWindow(winPtr);
- TkBindDeadWindow(winPtr);
#ifdef TK_USE_INPUT_METHODS
if (winPtr->inputContext != NULL) {
XDestroyIC(winPtr->inputContext);
@@ -1480,10 +1479,14 @@ Tk_DestroyWindow(
TkOptionDeadWindow(winPtr);
TkSelDeadWindow(winPtr);
TkGrabDeadWindow(winPtr);
+ if (winPtr->geometryMaster != NULL) {
+ ckfree(winPtr->geometryMaster);
+ winPtr->geometryMaster = NULL;
+ }
if (winPtr->mainPtr != NULL) {
if (winPtr->pathName != NULL) {
Tk_DeleteAllBindings(winPtr->mainPtr->bindingTable,
- (ClientData) winPtr->pathName);
+ winPtr->pathName);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&winPtr->mainPtr->nameTable,
winPtr->pathName));
@@ -1504,7 +1507,7 @@ Tk_DestroyWindow(
}
winPtr->mainPtr->refCount--;
if (winPtr->mainPtr->refCount == 0) {
- register TkCmd *cmdPtr;
+ register const TkCmd *cmdPtr;
/*
* We just deleted the last window in the application. Delete the
@@ -1526,10 +1529,11 @@ Tk_DestroyWindow(
Tcl_CreateCommand(winPtr->mainPtr->interp, "send",
TkDeadAppCmd, NULL, NULL);
Tcl_UnlinkVar(winPtr->mainPtr->interp, "tk_strictMotif");
- Tcl_UnlinkVar(winPtr->mainPtr->interp,
+ Tcl_UnlinkVar(winPtr->mainPtr->interp,
"::tk::AlwaysShowSelection");
}
+ Tcl_DeleteHashTable(&winPtr->mainPtr->busyTable);
Tcl_DeleteHashTable(&winPtr->mainPtr->nameTable);
TkBindFree(winPtr->mainPtr);
TkDeleteAllImages(winPtr->mainPtr);
@@ -1547,7 +1551,7 @@ Tk_DestroyWindow(
if (winPtr->flags & TK_EMBEDDED) {
XSync(winPtr->display, False);
}
- ckfree((char *) winPtr->mainPtr);
+ ckfree(winPtr->mainPtr);
/*
* If no other applications are using the display, close the
@@ -1605,7 +1609,7 @@ Tk_DestroyWindow(
#endif
}
}
- Tcl_EventuallyFree((ClientData) winPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(winPtr, TCL_DYNAMIC);
}
/*
@@ -1712,7 +1716,7 @@ Tk_MakeWindowExist(
createProc = Tk_GetClassProc(winPtr->classProcsPtr, createProc);
if (createProc != NULL && parent != None) {
- winPtr->window = (*createProc)(tkwin, parent, winPtr->instanceData);
+ winPtr->window = createProc(tkwin, parent, winPtr->instanceData);
} else {
winPtr->window = TkpMakeWindow(winPtr, parent);
}
@@ -1853,7 +1857,7 @@ Tk_ConfigureWindow(
winPtr->changes.border_width = valuePtr->border_width;
}
if (valueMask & (CWSibling|CWStackMode)) {
- Tcl_Panic("Can't set sibling or stack mode from Tk_ConfigureWindow.");
+ Tcl_Panic("Can't set sibling or stack mode from Tk_ConfigureWindow");
}
if (winPtr->window != None) {
@@ -2240,7 +2244,7 @@ TkDoConfigureNotify(
void
Tk_SetClass(
Tk_Window tkwin, /* Token for window to assign class. */
- CONST char *className) /* New class for tkwin. */
+ const char *className) /* New class for tkwin. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -2272,7 +2276,7 @@ Tk_SetClass(
void
Tk_SetClassProcs(
Tk_Window tkwin, /* Token for window to modify. */
- Tk_ClassProcs *procs, /* Class procs structure. */
+ const Tk_ClassProcs *procs, /* Class procs structure. */
ClientData instanceData) /* Data to be passed to class functions. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -2304,7 +2308,7 @@ Tk_SetClassProcs(
Tk_Window
Tk_NameToWindow(
Tcl_Interp *interp, /* Where to report errors. */
- CONST 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. */
{
@@ -2331,7 +2335,7 @@ Tk_NameToWindow(
}
return NULL;
}
- return (Tk_Window) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -2374,7 +2378,7 @@ Tk_IdToWindow(
if (hPtr == NULL) {
return NULL;
}
- return (Tk_Window) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -2394,7 +2398,7 @@ Tk_IdToWindow(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_DisplayName(
Tk_Window tkwin) /* Window whose display name is desired. */
{
@@ -2633,8 +2637,7 @@ Tk_MainWindow(
return NULL;
}
#endif
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (mainPtr = tsdPtr->mainWindowList; mainPtr != NULL;
mainPtr = mainPtr->nextPtr) {
@@ -2702,8 +2705,7 @@ Tk_GetNumMainWindows(void)
}
#endif
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->numMainWindows;
}
@@ -2761,7 +2763,7 @@ DeleteWindowsExitProc(
{
TkDisplay *dispPtr, *nextPtr;
Tcl_Interp *interp;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+ ThreadSpecificData *tsdPtr = clientData;
if (tsdPtr == NULL) {
return;
@@ -2777,11 +2779,11 @@ DeleteWindowsExitProc(
while (tsdPtr->halfdeadWindowList != NULL) {
interp = tsdPtr->halfdeadWindowList->winPtr->mainPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
tsdPtr->halfdeadWindowList->flags |= HD_CLEANUP;
tsdPtr->halfdeadWindowList->winPtr->flags &= ~TK_ALREADY_DEAD;
Tk_DestroyWindow((Tk_Window) tsdPtr->halfdeadWindowList->winPtr);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -2790,9 +2792,9 @@ DeleteWindowsExitProc(
while (tsdPtr->mainWindowList != NULL) {
interp = tsdPtr->mainWindowList->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
Tk_DestroyWindow((Tk_Window) tsdPtr->mainWindowList->winPtr);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -2917,7 +2919,7 @@ Tk_SafeInit(
return Initialize(interp);
}
-extern TkStubs tkStubs;
+MODULE_SCOPE const TkStubs tkStubs;
/*
*----------------------------------------------------------------------
@@ -2942,14 +2944,14 @@ Initialize(
{
char *p;
int argc, code;
- CONST char **argv;
- char *args[20];
- CONST char *argString = NULL;
+ const char **argv;
+ const char *args[20];
+ const char *argString = NULL;
Tcl_DString class;
ThreadSpecificData *tsdPtr;
/*
- * Ensure that we are getting the matching version of Tcl. This is really
+ * Ensure that we are getting a compatible version of Tcl. This is really
* only an issue when Tk is loaded dynamically.
*/
@@ -2963,8 +2965,7 @@ Initialize(
TkRegisterObjTypes();
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
* Start by initializing all the static variables to default acceptable
@@ -2984,7 +2985,7 @@ Initialize(
argv = NULL;
/*
- * We start by resetting the result because it might not be clean
+ * We start by resetting the result because it might not be clean.
*/
Tcl_ResetResult(interp);
@@ -3160,7 +3161,7 @@ Initialize(
visual = NULL;
}
args[argc] = NULL;
- code = TkCreateFrame((ClientData) NULL, interp, argc, args, 1, name);
+ code = TkCreateFrame(NULL, interp, argc, args, 1, name);
Tcl_DStringFree(&class);
if (code != TCL_OK) {
@@ -3209,12 +3210,6 @@ Initialize(
Tcl_SetMainLoop(Tk_MainLoop);
-#ifdef Tk_InitStubs
-#undef Tk_InitStubs
-#endif
-
- Tk_InitStubs(interp, TK_VERSION, 1);
-
/*
* Initialized the themed widget set
*/
@@ -3232,7 +3227,7 @@ Initialize(
Tcl_MutexUnlock(&windowMutex);
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
code = TkpInit(interp);
if (code == TCL_OK) {
@@ -3264,14 +3259,14 @@ tkInit");
* specific cleanups take place to avoid panics in finalization.
*/
- TkCreateThreadExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr);
+ TkCreateThreadExitHandler(DeleteWindowsExitProc, tsdPtr);
}
return code;
done:
Tcl_MutexUnlock(&windowMutex);
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
return code;
}
@@ -3295,16 +3290,16 @@ tkInit");
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
Tk_PkgInitStubsCheck(
Tcl_Interp *interp,
- CONST char * version,
+ const char * version,
int exact)
{
- CONST char *actualVersion = Tcl_PkgRequire(interp, "Tk", version, 0);
+ const char *actualVersion = Tcl_PkgRequire(interp, "Tk", version, 0);
if (exact && actualVersion) {
- CONST char *p = version;
+ const char *p = version;
int count = 0;
while (*p) {
diff --git a/generic/ttk/ttk.decls b/generic/ttk/ttk.decls
index 8b2b50b..e668a2a 100644
--- a/generic/ttk/ttk.decls
+++ b/generic/ttk/ttk.decls
@@ -3,148 +3,148 @@ interface ttk
epoch 0
scspec TTKAPI
-declare 0 current {
- Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, const char *name);
+declare 0 {
+ Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, const char *name)
}
-declare 1 current {
- Ttk_Theme Ttk_GetDefaultTheme(Tcl_Interp *interp);
+declare 1 {
+ Ttk_Theme Ttk_GetDefaultTheme(Tcl_Interp *interp)
}
-declare 2 current {
- Ttk_Theme Ttk_GetCurrentTheme(Tcl_Interp *interp);
+declare 2 {
+ Ttk_Theme Ttk_GetCurrentTheme(Tcl_Interp *interp)
}
-declare 3 current {
+declare 3 {
Ttk_Theme Ttk_CreateTheme(
- Tcl_Interp *interp, const char *name, Ttk_Theme parent);
+ Tcl_Interp *interp, const char *name, Ttk_Theme parent)
}
-declare 4 current {
+declare 4 {
void Ttk_RegisterCleanup(
- Tcl_Interp *interp, void *deleteData, Ttk_CleanupProc *cleanupProc);
+ Tcl_Interp *interp, void *deleteData, Ttk_CleanupProc *cleanupProc)
}
-declare 5 current {
+declare 5 {
int Ttk_RegisterElementSpec(
Ttk_Theme theme,
const char *elementName,
Ttk_ElementSpec *elementSpec,
- void *clientData);
+ void *clientData)
}
-declare 6 current {
+declare 6 {
Ttk_ElementClass *Ttk_RegisterElement(
Tcl_Interp *interp,
Ttk_Theme theme,
const char *elementName,
Ttk_ElementSpec *elementSpec,
- void *clientData);
+ void *clientData)
}
-declare 7 current {
+declare 7 {
int Ttk_RegisterElementFactory(
Tcl_Interp *interp,
const char *name,
Ttk_ElementFactory factoryProc,
- void *clientData);
+ void *clientData)
}
-declare 8 current {
+declare 8 {
void Ttk_RegisterLayout(
- Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec);
+ Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec)
}
#
# State maps.
#
-declare 10 current {
+declare 10 {
int Ttk_GetStateSpecFromObj(
- Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_StateSpec *spec_rtn);
+ Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_StateSpec *spec_rtn)
}
-declare 11 current {
+declare 11 {
Tcl_Obj *Ttk_NewStateSpecObj(
- unsigned int onbits, unsigned int offbits);
+ unsigned int onbits, unsigned int offbits)
}
-declare 12 current {
+declare 12 {
Ttk_StateMap Ttk_GetStateMapFromObj(
- Tcl_Interp *interp, Tcl_Obj *objPtr);
+ Tcl_Interp *interp, Tcl_Obj *objPtr)
}
-declare 13 current {
+declare 13 {
Tcl_Obj *Ttk_StateMapLookup(
- Tcl_Interp *interp, Ttk_StateMap map, Ttk_State state);
+ Tcl_Interp *interp, Ttk_StateMap map, Ttk_State state)
}
-declare 14 current {
+declare 14 {
int Ttk_StateTableLookup(
- Ttk_StateTable map[], Ttk_State state);
+ Ttk_StateTable map[], Ttk_State state)
}
#
# Low-level geometry utilities.
#
-declare 20 current {
+declare 20 {
int Ttk_GetPaddingFromObj(
Tcl_Interp *interp,
Tk_Window tkwin,
Tcl_Obj *objPtr,
- Ttk_Padding *pad_rtn);
+ Ttk_Padding *pad_rtn)
}
-declare 21 current {
+declare 21 {
int Ttk_GetBorderFromObj(
Tcl_Interp *interp,
Tcl_Obj *objPtr,
- Ttk_Padding *pad_rtn);
+ Ttk_Padding *pad_rtn)
}
-declare 22 current {
+declare 22 {
int Ttk_GetStickyFromObj(
- Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Sticky *sticky_rtn);
+ Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Sticky *sticky_rtn)
}
-declare 23 current {
+declare 23 {
Ttk_Padding Ttk_MakePadding(
- short l, short t, short r, short b);
+ short l, short t, short r, short b)
}
-declare 24 current {
+declare 24 {
Ttk_Padding Ttk_UniformPadding(
- short borderWidth);
+ short borderWidth)
}
-declare 25 current {
- Ttk_Padding Ttk_AddPadding(Ttk_Padding pad1, Ttk_Padding pad2);
+declare 25 {
+ Ttk_Padding Ttk_AddPadding(Ttk_Padding pad1, Ttk_Padding pad2)
}
-declare 26 current {
+declare 26 {
Ttk_Padding Ttk_RelievePadding(
- Ttk_Padding padding, int relief, int n);
+ Ttk_Padding padding, int relief, int n)
}
-declare 27 current {
- Ttk_Box Ttk_MakeBox(int x, int y, int width, int height);
+declare 27 {
+ Ttk_Box Ttk_MakeBox(int x, int y, int width, int height)
}
-declare 28 current {
- int Ttk_BoxContains(Ttk_Box box, int x, int y);
+declare 28 {
+ int Ttk_BoxContains(Ttk_Box box, int x, int y)
}
-declare 29 current {
- Ttk_Box Ttk_PackBox(Ttk_Box *cavity, int w, int h, Ttk_Side side);
+declare 29 {
+ Ttk_Box Ttk_PackBox(Ttk_Box *cavity, int w, int h, Ttk_Side side)
}
-declare 30 current {
- Ttk_Box Ttk_StickBox(Ttk_Box parcel, int w, int h, Ttk_Sticky sticky);
+declare 30 {
+ Ttk_Box Ttk_StickBox(Ttk_Box parcel, int w, int h, Ttk_Sticky sticky)
}
-declare 31 current {
- Ttk_Box Ttk_AnchorBox(Ttk_Box parcel, int w, int h, Tk_Anchor anchor);
+declare 31 {
+ Ttk_Box Ttk_AnchorBox(Ttk_Box parcel, int w, int h, Tk_Anchor anchor)
}
-declare 32 current {
- Ttk_Box Ttk_PadBox(Ttk_Box b, Ttk_Padding p);
+declare 32 {
+ Ttk_Box Ttk_PadBox(Ttk_Box b, Ttk_Padding p)
}
-declare 33 current {
- Ttk_Box Ttk_ExpandBox(Ttk_Box b, Ttk_Padding p);
+declare 33 {
+ Ttk_Box Ttk_ExpandBox(Ttk_Box b, Ttk_Padding p)
}
-declare 34 current {
+declare 34 {
Ttk_Box Ttk_PlaceBox(
- Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky);
+ Ttk_Box *cavity, int w, int h, Ttk_Side side, Ttk_Sticky sticky)
}
-declare 35 current {
- Tcl_Obj *Ttk_NewBoxObj(Ttk_Box box);
+declare 35 {
+ Tcl_Obj *Ttk_NewBoxObj(Ttk_Box box)
}
#
# Utilities.
#
-declare 40 current {
- int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient);
+declare 40 {
+ int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient)
}
diff --git a/generic/ttk/ttkBlink.c b/generic/ttk/ttkBlink.c
index 7e46fac..706a871 100644
--- a/generic/ttk/ttkBlink.c
+++ b/generic/ttk/ttkBlink.c
@@ -49,10 +49,10 @@ static void CursorManagerDeleteProc(ClientData clientData, Tcl_Interp *interp)
static CursorManager *GetCursorManager(Tcl_Interp *interp)
{
static const char *cm_key = "ttk::CursorManager";
- CursorManager *cm = (CursorManager *) Tcl_GetAssocData(interp, cm_key,0);
+ CursorManager *cm = Tcl_GetAssocData(interp, cm_key,0);
if (!cm) {
- cm = (CursorManager*)ckalloc(sizeof(*cm));
+ cm = ckalloc(sizeof(*cm));
cm->timer = 0;
cm->owner = 0;
cm->onTime = DEF_CURSOR_ON_TIME;
diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c
index e3aeaba..39c76e0 100644
--- a/generic/ttk/ttkCache.c
+++ b/generic/ttk/ttkCache.c
@@ -49,7 +49,7 @@ struct Ttk_ResourceCache_ {
*/
Ttk_ResourceCache Ttk_CreateResourceCache(Tcl_Interp *interp)
{
- Ttk_ResourceCache cache = (Ttk_ResourceCache)ckalloc(sizeof(*cache));
+ Ttk_ResourceCache cache = ckalloc(sizeof(*cache));
cache->tkwin = NULL; /* initialized later */
cache->interp = interp;
@@ -160,7 +160,7 @@ void Ttk_FreeResourceCache(Ttk_ResourceCache cache)
}
Tcl_DeleteHashTable(&cache->namedColors);
- ckfree((ClientData)cache);
+ ckfree(cache);
}
/*
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index ee679b7..3ff2f62 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -28,36 +28,36 @@ extern const char *TtkInitializeStubs(
*/
/* 0 */
-TTKAPI Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, CONST char *name);
+TTKAPI Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, const char *name);
/* 1 */
TTKAPI Ttk_Theme Ttk_GetDefaultTheme(Tcl_Interp *interp);
/* 2 */
TTKAPI Ttk_Theme Ttk_GetCurrentTheme(Tcl_Interp *interp);
/* 3 */
-TTKAPI Ttk_Theme Ttk_CreateTheme(Tcl_Interp *interp, CONST char *name,
+TTKAPI Ttk_Theme Ttk_CreateTheme(Tcl_Interp *interp, const char *name,
Ttk_Theme parent);
/* 4 */
TTKAPI void Ttk_RegisterCleanup(Tcl_Interp *interp,
- VOID *deleteData,
+ void *deleteData,
Ttk_CleanupProc *cleanupProc);
/* 5 */
TTKAPI int Ttk_RegisterElementSpec(Ttk_Theme theme,
- CONST char *elementName,
+ const char *elementName,
Ttk_ElementSpec *elementSpec,
- VOID *clientData);
+ void *clientData);
/* 6 */
TTKAPI Ttk_ElementClass * Ttk_RegisterElement(Tcl_Interp *interp,
- Ttk_Theme theme, CONST char *elementName,
+ Ttk_Theme theme, const char *elementName,
Ttk_ElementSpec *elementSpec,
- VOID *clientData);
+ void *clientData);
/* 7 */
TTKAPI int Ttk_RegisterElementFactory(Tcl_Interp *interp,
- CONST char *name,
+ const char *name,
Ttk_ElementFactory factoryProc,
- VOID *clientData);
+ void *clientData);
/* 8 */
TTKAPI void Ttk_RegisterLayout(Ttk_Theme theme,
- CONST char *className,
+ const char *className,
Ttk_LayoutSpec layoutSpec);
/* Slot 9 is reserved */
/* 10 */
@@ -135,15 +135,15 @@ typedef struct TtkStubs {
int revision;
const struct TtkStubHooks *hooks;
- Ttk_Theme (*ttk_GetTheme) (Tcl_Interp *interp, CONST char *name); /* 0 */
+ Ttk_Theme (*ttk_GetTheme) (Tcl_Interp *interp, const char *name); /* 0 */
Ttk_Theme (*ttk_GetDefaultTheme) (Tcl_Interp *interp); /* 1 */
Ttk_Theme (*ttk_GetCurrentTheme) (Tcl_Interp *interp); /* 2 */
- Ttk_Theme (*ttk_CreateTheme) (Tcl_Interp *interp, CONST char *name, Ttk_Theme parent); /* 3 */
- void (*ttk_RegisterCleanup) (Tcl_Interp *interp, VOID *deleteData, Ttk_CleanupProc *cleanupProc); /* 4 */
- int (*ttk_RegisterElementSpec) (Ttk_Theme theme, CONST char *elementName, Ttk_ElementSpec *elementSpec, VOID *clientData); /* 5 */
- Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, CONST char *elementName, Ttk_ElementSpec *elementSpec, VOID *clientData); /* 6 */
- int (*ttk_RegisterElementFactory) (Tcl_Interp *interp, CONST char *name, Ttk_ElementFactory factoryProc, VOID *clientData); /* 7 */
- void (*ttk_RegisterLayout) (Ttk_Theme theme, CONST char *className, Ttk_LayoutSpec layoutSpec); /* 8 */
+ Ttk_Theme (*ttk_CreateTheme) (Tcl_Interp *interp, const char *name, Ttk_Theme parent); /* 3 */
+ void (*ttk_RegisterCleanup) (Tcl_Interp *interp, void *deleteData, Ttk_CleanupProc *cleanupProc); /* 4 */
+ int (*ttk_RegisterElementSpec) (Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 5 */
+ Ttk_ElementClass * (*ttk_RegisterElement) (Tcl_Interp *interp, Ttk_Theme theme, const char *elementName, Ttk_ElementSpec *elementSpec, void *clientData); /* 6 */
+ int (*ttk_RegisterElementFactory) (Tcl_Interp *interp, const char *name, Ttk_ElementFactory factoryProc, void *clientData); /* 7 */
+ void (*ttk_RegisterLayout) (Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec); /* 8 */
void (*reserved9)(void);
int (*ttk_GetStateSpecFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_StateSpec *spec_rtn); /* 10 */
Tcl_Obj * (*ttk_NewStateSpecObj) (unsigned int onbits, unsigned int offbits); /* 11 */
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl
index fb9c018..269d3ef 100644
--- a/generic/ttk/ttkGenStubs.tcl
+++ b/generic/ttk/ttkGenStubs.tcl
@@ -5,26 +5,20 @@
#
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# SOURCE: tcl/tools/genStubs.tcl, revision 1.20
+# SOURCE: tcl/tools/genStubs.tcl, revision 1.44
#
-# CHANGES:
-# + Remove xxx_TCL_DECLARED #ifdeffery
-# + Use application-defined storage class specifier instead of "EXTERN"
-# + Add "epoch" and "revision" fields to stubs table record
-# + Remove dead code related to USE_*_STUB_PROCS (emitStubs, makeStub)
+# CHANGES:
# + Second argument to "declare" is used as a status guard
# instead of a platform guard.
-# + Use void (*reserved$i)(void) = 0 instead of void *reserved$i = NULL
-# for unused stub entries, in case pointer-to-function and
-# pointer-to-object are different sizes.
# + Allow trailing semicolon in function declarations
-# + stubs table is const-qualified
#
-package require Tcl 8
+package require Tcl 8.4
namespace eval genStubs {
# libraryName --
@@ -50,9 +44,9 @@ namespace eval genStubs {
# scspec --
#
# Storage class specifier for external function declarations.
- # Normally "extern", may be set to something like XYZAPI
+ # Normally "EXTERN", may be set to something like XYZAPI
#
- variable scspec "extern"
+ variable scspec "EXTERN"
# epoch, revision --
#
@@ -60,7 +54,7 @@ namespace eval genStubs {
# (@@@TODO: should be an array mapping interface names -> numbers)
#
- variable epoch 0
+ variable epoch {}
variable revision 0
# hooks --
@@ -181,13 +175,15 @@ proc genStubs::hooks {names} {
# decl The C function declaration, or {} for an undefined
# entry.
#
+# Results:
+# None.
+
proc genStubs::declare {args} {
variable stubs
variable curName
variable revision
incr revision
-
if {[llength $args] == 2} {
lassign $args index decl
set status current
@@ -204,7 +200,6 @@ proc genStubs::declare {args} {
if {[info exists stubs($curName,decl,$index)]} {
puts stderr "Duplicate entry: $index"
}
- regsub -all const $decl CONST decl
regsub -all "\[ \t\n\]+" [string trim $decl] " " decl
set decl [parseDecl $decl]
@@ -214,7 +209,25 @@ proc genStubs::declare {args} {
if {$index > $stubs($curName,lastNum)} {
set stubs($curName,lastNum) $index
}
+ return
+}
+# genStubs::export --
+#
+# This function is used in the declarations file to declare a symbol
+# that is exported from the library but is not in the stubs table.
+#
+# Arguments:
+# decl The C function declaration, or {} for an undefined
+# entry.
+#
+# Results:
+# None.
+
+proc genStubs::export {args} {
+ if {[llength $args] != 1} {
+ puts stderr "wrong # args: export $args"
+ }
return
}
@@ -238,6 +251,7 @@ proc genStubs::rewriteFile {file text} {
}
set in [open ${file} r]
set out [open ${file}.new w]
+ fconfigure $out -translation lf
while {![eof $in]} {
set line [gets $in]
@@ -272,22 +286,48 @@ proc genStubs::rewriteFile {file text} {
# Results:
# Returns the original text inside an appropriate #ifdef.
-proc genStubs::addPlatformGuard {plat text} {
+proc genStubs::addPlatformGuard {plat iftxt {eltxt {}}} {
+ set text ""
switch $plat {
win {
- return "#ifdef __WIN32__\n${text}#endif /* __WIN32__ */\n"
+ append text "#ifdef __WIN32__ /* WIN */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* WIN */\n${eltxt}"
+ }
+ append text "#endif /* WIN */\n"
}
unix {
- return "#if !defined(__WIN32__) /* UNIX */\n${text}#endif /* UNIX */\n"
+ append text "#if !defined(__WIN32__) && !defined(MAC_OSX_TCL)\
+ /* UNIX */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* UNIX */\n${eltxt}"
+ }
+ append text "#endif /* UNIX */\n"
}
macosx {
- return "#ifdef MAC_OSX_TCL\n${text}#endif /* MAC_OSX_TCL */\n"
+ append text "#ifdef MAC_OSX_TCL /* MACOSX */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* MACOSX */\n${eltxt}"
+ }
+ append text "#endif /* MACOSX */\n"
}
aqua {
- return "#ifdef MAC_OSX_TK\n${text}#endif /* MAC_OSX_TK */\n"
+ append text "#ifdef MAC_OSX_TK /* AQUA */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* AQUA */\n${eltxt}"
+ }
+ append text "#endif /* AQUA */\n"
}
x11 {
- return "#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */\n${text}#endif /* X11 */\n"
+ append text "#if !(defined(__WIN32__) || defined(MAC_OSX_TK))\
+ /* X11 */\n${iftxt}"
+ if {$eltxt ne ""} {
+ append text "#else /* X11 */\n${eltxt}"
+ }
+ append text "#endif /* X11 */\n"
+ }
+ default {
+ append text "${iftxt}${eltxt}"
}
}
return $text
@@ -295,7 +335,9 @@ proc genStubs::addPlatformGuard {plat text} {
# genStubs::emitSlots --
#
-# Generate the stub table slots for the given interface.
+# Generate the stub table slots for the given interface. If there
+# are no generic slots, then one table is generated for each
+# platform, otherwise one table is generated for all platforms.
#
# Arguments:
# name The name of the interface being emitted.
@@ -306,6 +348,7 @@ proc genStubs::addPlatformGuard {plat text} {
proc genStubs::emitSlots {name textVar} {
upvar $textVar text
+
forAllStubs $name makeSlot noGuard text {" void (*reserved$i)(void);\n"}
return
}
@@ -334,7 +377,7 @@ proc genStubs::parseDecl {decl} {
return
}
set rtype [string trim $rtype]
- if {$args == ""} {
+ if {$args eq ""} {
return [list $rtype $fname {}]
}
foreach arg [split $args ,] {
@@ -382,14 +425,14 @@ proc genStubs::parseDecl {decl} {
proc genStubs::parseArg {arg} {
if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} {
- if {$arg == "void"} {
+ if {$arg eq "void"} {
return $arg
} else {
return
}
}
set result [list [string trim $type] $name]
- if {$array != ""} {
+ if {$array ne ""} {
lappend result $array
}
return $result
@@ -409,13 +452,9 @@ proc genStubs::parseArg {arg} {
proc genStubs::makeDecl {name decl index} {
variable scspec
-
lassign $decl rtype fname args
append text "/* $index */\n"
- if {$rtype != "void"} {
- regsub -all void $rtype VOID rtype
- }
set line "$scspec $rtype"
set count [expr {2 - ([string length $line] / 8)}]
append line [string range "\t\t\t" 0 $count]
@@ -424,7 +463,7 @@ proc genStubs::makeDecl {name decl index} {
append line " "
set pad 0
}
- if {$args == ""} {
+ if {$args eq ""} {
append line $fname
append text $line
append text ";\n"
@@ -432,10 +471,9 @@ proc genStubs::makeDecl {name decl index} {
}
append line $fname
- regsub -all void $args VOID args
set arg1 [lindex $args 0]
switch -exact $arg1 {
- VOID {
+ void {
append line "(void)"
}
TCL_VARARGS {
@@ -503,7 +541,7 @@ proc genStubs::makeMacro {name decl index} {
append lfname [string range $fname 1 end]
set text "#define $fname \\\n\t("
- if {$args == ""} {
+ if {$args eq ""} {
append text "*"
}
append text "${name}StubsPtr->$lfname)"
@@ -530,19 +568,18 @@ proc genStubs::makeSlot {name decl index} {
append lfname [string range $fname 1 end]
set text " "
- if {$rtype != "void"} {
- regsub -all void $rtype VOID rtype
- }
- if {$args == ""} {
+ if {$args eq ""} {
append text $rtype " *" $lfname "; /* $index */\n"
return $text
}
- append text $rtype " (*" $lfname ") "
-
- regsub -all void $args VOID args
+ if {[string range $rtype end-7 end] eq "CALLBACK"} {
+ append text [string trim [string range $rtype 0 end-8]] " (CALLBACK *" $lfname ") "
+ } else {
+ append text $rtype " (*" $lfname ") "
+ }
set arg1 [lindex $args 0]
switch -exact $arg1 {
- VOID {
+ void {
append text "(void)"
}
TCL_VARARGS {
@@ -588,7 +625,7 @@ proc genStubs::makeSlot {name decl index} {
# Returns the formatted declaration string.
proc genStubs::makeInit {name decl index} {
- if {[lindex $decl 2] == ""} {
+ if {[lindex $decl 2] eq ""} {
append text " &" [lindex $decl 1] ", /* " $index " */\n"
} else {
append text " " [lindex $decl 1] ", /* " $index " */\n"
@@ -618,7 +655,7 @@ proc genStubs::makeInit {name decl index} {
# None.
proc genStubs::forAllStubs {name slotProc guardProc textVar
- {skipString {"/* Slot $i is reserved */\n"}}} {
+ {skipString {"/* Slot $i is reserved */\n"}}} {
variable stubs
upvar $textVar text
@@ -641,7 +678,7 @@ proc genStubs::addGuard {status text} {
set upName [string toupper $libraryName]
switch -- $status {
- current {
+ current {
# No change
}
deprecated {
@@ -654,7 +691,7 @@ proc genStubs::addGuard {status text} {
puts stderr "Unrecognized status code $status"
}
}
- return $text
+ return $text
}
proc genStubs::ifdeffed {macro text} {
@@ -725,10 +762,12 @@ proc genStubs::emitHeader {name} {
set capName [string toupper [string index $name 0]]
append capName [string range $name 1 end]
- set CAPName [string toupper $name]
- append text "\n"
- append text "#define ${CAPName}_STUBS_EPOCH $epoch\n"
- append text "#define ${CAPName}_STUBS_REVISION $revision\n"
+ if {$epoch ne ""} {
+ set CAPName [string toupper $name]
+ append text "\n"
+ append text "#define ${CAPName}_STUBS_EPOCH $epoch\n"
+ append text "#define ${CAPName}_STUBS_REVISION $revision\n"
+ }
emitDeclarations $name text
@@ -743,8 +782,10 @@ proc genStubs::emitHeader {name} {
}
append text "\ntypedef struct ${capName}Stubs {\n"
append text " int magic;\n"
- append text " int epoch;\n"
- append text " int revision;\n"
+ if {$epoch ne ""} {
+ append text " int epoch;\n"
+ append text " int revision;\n"
+ }
append text " const struct ${capName}StubHooks *hooks;\n\n"
emitSlots $name text
@@ -776,14 +817,11 @@ proc genStubs::emitInit {name textVar} {
variable hooks
variable interfaces
variable epoch
- variable revision
-
upvar $textVar text
set root 1
set capName [string toupper [string index $name 0]]
append capName [string range $name 1 end]
- set CAPName [string toupper $name]
if {[info exists hooks($name)]} {
append text "\nstatic const ${capName}StubHooks ${name}StubHooks = \{\n"
@@ -796,21 +834,23 @@ proc genStubs::emitInit {name textVar} {
}
foreach intf [array names interfaces] {
if {[info exists hooks($intf)]} {
- if {0<=[lsearch -exact $hooks($intf) $name]} {
+ if {[lsearch -exact $hooks($intf) $name] >= 0} {
set root 0
- break;
+ break
}
}
}
- if {$root} {
- append text "\nconst ${capName}Stubs ${name}Stubs = \{\n"
- } else {
- append text "\nstatic const ${capName}Stubs ${name}Stubs = \{\n"
+ append text "\n"
+ if {!$root} {
+ append text "static "
+ }
+ append text "const ${capName}Stubs ${name}Stubs = \{\n TCL_STUB_MAGIC,\n"
+ if {$epoch ne ""} {
+ set CAPName [string toupper $name]
+ append text " ${CAPName}_STUBS_EPOCH,\n"
+ append text " ${CAPName}_STUBS_REVISION,\n"
}
- append text " TCL_STUB_MAGIC,\n"
- append text " ${CAPName}_STUBS_EPOCH,\n"
- append text " ${CAPName}_STUBS_REVISION,\n"
if {[info exists hooks($name)]} {
append text " &${name}StubHooks,\n"
} else {
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index c3b55e9..bf313a9 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -47,7 +47,7 @@ TtkGetImageSpec(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
int i = 0, n = 0, objc;
Tcl_Obj **objv;
- imageSpec = (Ttk_ImageSpec *)ckalloc(sizeof(*imageSpec));
+ imageSpec = ckalloc(sizeof(*imageSpec));
imageSpec->baseImage = 0;
imageSpec->mapCount = 0;
imageSpec->states = 0;
@@ -67,8 +67,8 @@ TtkGetImageSpec(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr)
}
n = (objc - 1) / 2;
- imageSpec->states = (Ttk_StateSpec*)ckalloc(n * sizeof(Ttk_StateSpec));
- imageSpec->images = (Tk_Image*)ckalloc(n * sizeof(Tk_Image *));
+ imageSpec->states = ckalloc(n * sizeof(Ttk_StateSpec));
+ imageSpec->images = ckalloc(n * sizeof(Tk_Image *));
/* Get base image:
*/
@@ -117,10 +117,10 @@ void TtkFreeImageSpec(Ttk_ImageSpec *imageSpec)
}
if (imageSpec->baseImage) { Tk_FreeImage(imageSpec->baseImage); }
- if (imageSpec->states) { ckfree((ClientData)imageSpec->states); }
- if (imageSpec->images) { ckfree((ClientData)imageSpec->images); }
+ if (imageSpec->states) { ckfree(imageSpec->states); }
+ if (imageSpec->images) { ckfree(imageSpec->images); }
- ckfree((ClientData)imageSpec);
+ ckfree(imageSpec);
}
/* TtkSelectImage --
@@ -333,7 +333,7 @@ Ttk_CreateImageElement(
return TCL_ERROR;
}
- imageData = (ImageData*)ckalloc(sizeof(*imageData));
+ imageData = ckalloc(sizeof(*imageData));
imageData->imageSpec = imageSpec;
imageData->minWidth = imageData->minHeight = -1;
imageData->sticky = TTK_FILL_BOTH;
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 0f773e7..90ed9e7 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -325,10 +325,16 @@ static void ImageDraw(
* stipple the image.
* @@@ Possibly: Don't do disabled-stippling at all;
* @@@ it's ugly and out of fashion.
+ * Do not stipple at all under Aqua, just draw the image: it shows up
+ * as a white rectangle otherwise.
*/
+
+
if (state & TTK_STATE_DISABLED) {
if (TtkSelectImage(image->imageSpec, 0ul) == image->tkimg) {
+ #ifndef MAC_OSX_TK
StippleOver(image, tkwin, d, b.x,b.y);
+ #endif
}
}
}
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c
index 58c99eb..d248dcb 100644
--- a/generic/ttk/ttkLayout.c
+++ b/generic/ttk/ttkLayout.c
@@ -524,7 +524,7 @@ struct Ttk_LayoutNode_
static Ttk_LayoutNode *Ttk_NewLayoutNode(
unsigned flags, Ttk_ElementClass *elementClass)
{
- Ttk_LayoutNode *node = (Ttk_LayoutNode*)ckalloc(sizeof(*node));
+ Ttk_LayoutNode *node = ckalloc(sizeof(*node));
node->flags = flags;
node->eclass = elementClass;
@@ -540,7 +540,7 @@ static void Ttk_FreeLayoutNode(Ttk_LayoutNode *node)
while (node) {
Ttk_LayoutNode *next = node->next;
Ttk_FreeLayoutNode(node->child);
- ckfree((ClientData)node);
+ ckfree(node);
node = next;
}
}
@@ -557,7 +557,7 @@ struct Ttk_TemplateNode_ {
static Ttk_TemplateNode *Ttk_NewTemplateNode(const char *name, unsigned flags)
{
- Ttk_TemplateNode *op = (Ttk_TemplateNode*)ckalloc(sizeof(*op));
+ Ttk_TemplateNode *op = ckalloc(sizeof(*op));
op->name = ckalloc(strlen(name) + 1); strcpy(op->name, name);
op->flags = flags;
op->next = op->child = 0;
@@ -570,7 +570,7 @@ void Ttk_FreeLayoutTemplate(Ttk_LayoutTemplate op)
Ttk_LayoutTemplate next = op->next;
Ttk_FreeLayoutTemplate(op->child);
ckfree(op->name);
- ckfree((ClientData)op);
+ ckfree(op);
op = next;
}
}
@@ -839,7 +839,7 @@ static Ttk_Layout TTKNewLayout(
void *recordPtr,Tk_OptionTable optionTable, Tk_Window tkwin,
Ttk_LayoutNode *root)
{
- Ttk_Layout layout = (Ttk_Layout)ckalloc(sizeof(*layout));
+ Ttk_Layout layout = ckalloc(sizeof(*layout));
layout->style = style;
layout->recordPtr = recordPtr;
layout->optionTable = optionTable;
@@ -851,7 +851,7 @@ static Ttk_Layout TTKNewLayout(
void Ttk_FreeLayout(Ttk_Layout layout)
{
Ttk_FreeLayoutNode(layout->root);
- ckfree((ClientData)layout);
+ ckfree(layout);
}
/*
diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c
index ba9e5c0..256573f 100644
--- a/generic/ttk/ttkManager.c
+++ b/generic/ttk/ttkManager.c
@@ -188,7 +188,7 @@ static void SlaveEventHandler(ClientData clientData, XEvent *eventPtr)
static Ttk_Slave *NewSlave(
Ttk_Manager *mgr, Tk_Window slaveWindow, void *slaveData)
{
- Ttk_Slave *slave = (Ttk_Slave*)ckalloc(sizeof(*slave));
+ Ttk_Slave *slave = ckalloc(sizeof(*slave));
slave->slaveWindow = slaveWindow;
slave->manager = mgr;
@@ -200,7 +200,7 @@ static Ttk_Slave *NewSlave(
static void DeleteSlave(Ttk_Slave *slave)
{
- ckfree((ClientData)slave);
+ ckfree(slave);
}
/*------------------------------------------------------------------------
@@ -210,7 +210,7 @@ static void DeleteSlave(Ttk_Slave *slave)
Ttk_Manager *Ttk_CreateManager(
Ttk_ManagerSpec *managerSpec, void *managerData, Tk_Window masterWindow)
{
- Ttk_Manager *mgr = (Ttk_Manager*)ckalloc(sizeof(*mgr));
+ Ttk_Manager *mgr = ckalloc(sizeof(*mgr));
mgr->managerSpec = managerSpec;
mgr->managerData = managerData;
@@ -234,12 +234,12 @@ void Ttk_DeleteManager(Ttk_Manager *mgr)
Ttk_ForgetSlave(mgr, mgr->nSlaves - 1);
}
if (mgr->slaves) {
- ckfree((ClientData)mgr->slaves);
+ ckfree(mgr->slaves);
}
Tk_CancelIdleCall(ManagerIdleProc, mgr);
- ckfree((ClientData)mgr);
+ ckfree(mgr);
}
/*------------------------------------------------------------------------
@@ -252,8 +252,7 @@ void Ttk_DeleteManager(Ttk_Manager *mgr)
static void InsertSlave(Ttk_Manager *mgr, Ttk_Slave *slave, int index)
{
int endIndex = mgr->nSlaves++;
- mgr->slaves = (Ttk_Slave**)ckrealloc(
- (ClientData)mgr->slaves, mgr->nSlaves * sizeof(Ttk_Slave *));
+ mgr->slaves = ckrealloc(mgr->slaves, mgr->nSlaves * sizeof(Ttk_Slave *));
while (endIndex > index) {
mgr->slaves[endIndex] = mgr->slaves[endIndex - 1];
diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c
index defe05a..c02b868 100644
--- a/generic/ttk/ttkScroll.c
+++ b/generic/ttk/ttkScroll.c
@@ -55,7 +55,7 @@ struct ScrollHandleRec
*/
ScrollHandle TtkCreateScrollHandle(WidgetCore *corePtr, Scrollable *scrollPtr)
{
- ScrollHandle h = (ScrollHandle)ckalloc(sizeof(*h));
+ ScrollHandle h = ckalloc(sizeof(*h));
h->flags = 0;
h->corePtr = corePtr;
@@ -247,6 +247,6 @@ void TtkFreeScrollHandle(ScrollHandle h)
if (h->flags & SCROLL_UPDATE_PENDING) {
Tcl_CancelIdleCall(UpdateScrollbarBG, (ClientData)h);
}
- ckfree((ClientData)h);
+ ckfree(h);
}
diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c
index 9f2a87b..f2108b9 100644
--- a/generic/ttk/ttkTagSet.c
+++ b/generic/ttk/ttkTagSet.c
@@ -34,7 +34,7 @@ struct TtkTagTable {
*/
static Ttk_Tag NewTag(Ttk_TagTable tagTable, const char *tagName)
{
- Ttk_Tag tag = (Ttk_Tag)ckalloc(sizeof(*tag));
+ Ttk_Tag tag = ckalloc(sizeof(*tag));
tag->tagRecord = ckalloc(tagTable->recordSize);
memset(tag->tagRecord, 0, tagTable->recordSize);
/* Don't need Tk_InitOptions() here, all defaults should be NULL. */
@@ -47,7 +47,7 @@ static void DeleteTag(Ttk_TagTable tagTable, Ttk_Tag tag)
{
Tk_FreeConfigOptions(tag->tagRecord,tagTable->optionTable,tagTable->tkwin);
ckfree(tag->tagRecord);
- ckfree((void*)tag);
+ ckfree(tag);
}
/*------------------------------------------------------------------------
@@ -58,7 +58,7 @@ Ttk_TagTable Ttk_CreateTagTable(
Tcl_Interp *interp, Tk_Window tkwin,
Tk_OptionSpec optionSpecs[], int recordSize)
{
- Ttk_TagTable tagTable = (Ttk_TagTable)ckalloc(sizeof(*tagTable));
+ Ttk_TagTable tagTable = ckalloc(sizeof(*tagTable));
tagTable->tkwin = tkwin;
tagTable->optionSpecs = optionSpecs;
tagTable->optionTable = Tk_CreateOptionTable(interp, optionSpecs);
@@ -80,7 +80,7 @@ void Ttk_DeleteTagTable(Ttk_TagTable tagTable)
}
Tcl_DeleteHashTable(&tagTable->tags);
- ckfree((void*)tagTable);
+ ckfree(tagTable);
}
Ttk_Tag Ttk_GetTag(Ttk_TagTable tagTable, const char *tagName)
@@ -116,7 +116,7 @@ Ttk_Tag Ttk_GetTagFromObj(Ttk_TagTable tagTable, Tcl_Obj *objPtr)
Ttk_TagSet Ttk_GetTagSetFromObj(
Tcl_Interp *interp, Ttk_TagTable tagTable, Tcl_Obj *objPtr)
{
- Ttk_TagSet tagset = (Ttk_TagSet)(ckalloc(sizeof *tagset));
+ Ttk_TagSet tagset = ckalloc(sizeof(*tagset));
Tcl_Obj **objv;
int i, objc;
@@ -127,11 +127,11 @@ Ttk_TagSet Ttk_GetTagSetFromObj(
}
if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- ckfree((ClientData)tagset);
+ ckfree(tagset);
return NULL;
}
- tagset->tags = (Ttk_Tag*)ckalloc((objc+1) * sizeof(Ttk_Tag));
+ tagset->tags = ckalloc((objc+1) * sizeof(Ttk_Tag));
for (i=0; i<objc; ++i) {
tagset->tags[i] = Ttk_GetTagFromObj(tagTable, objv[i]);
}
@@ -158,8 +158,8 @@ Tcl_Obj *Ttk_NewTagSetObj(Ttk_TagSet tagset)
void Ttk_FreeTagSet(Ttk_TagSet tagset)
{
- ckfree((ClientData)tagset->tags);
- ckfree((ClientData)tagset);
+ ckfree(tagset->tags);
+ ckfree(tagset);
}
/* Ttk_TagSetContains -- test if tag set contains a tag.
@@ -188,7 +188,7 @@ int Ttk_TagSetAdd(Ttk_TagSet tagset, Ttk_Tag tag)
return 0;
}
}
- tagset->tags = (void*)ckrealloc((void*)tagset->tags,
+ tagset->tags = ckrealloc(tagset->tags,
(tagset->nTags+1)*sizeof(tagset->tags[0]));
tagset->tags[tagset->nTags++] = tag;
return 1;
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index 5095487..b0e9171 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -40,7 +40,7 @@ typedef struct Ttk_Style_
static Style *NewStyle()
{
- Style *stylePtr = (Style*)ckalloc(sizeof(Style));
+ Style *stylePtr = ckalloc(sizeof(Style));
stylePtr->styleName = NULL;
stylePtr->parentStyle = NULL;
@@ -75,7 +75,7 @@ static void FreeStyle(Style *stylePtr)
Ttk_FreeLayoutTemplate(stylePtr->layoutTemplate);
- ckfree((ClientData)stylePtr);
+ ckfree(stylePtr);
}
/*
@@ -179,7 +179,7 @@ static const Tk_OptionSpec *TTKGetOptionSpec(
static OptionMap
BuildOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
{
- OptionMap optionMap = (OptionMap)ckalloc(
+ OptionMap optionMap = ckalloc(
sizeof(const Tk_OptionSpec) * elementClass->nResources + 1);
int i;
@@ -221,8 +221,7 @@ GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
static Ttk_ElementClass *
NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData)
{
- Ttk_ElementClass *elementClass =
- (Ttk_ElementClass*)ckalloc(sizeof(Ttk_ElementClass));
+ Ttk_ElementClass *elementClass = ckalloc(sizeof(Ttk_ElementClass));
int i;
elementClass->name = name;
@@ -238,7 +237,7 @@ NewElementClass(const char *name, Ttk_ElementSpec *specPtr,void *clientData)
/* Initialize default values:
*/
- elementClass->defaultValues = (Tcl_Obj**)
+ elementClass->defaultValues =
ckalloc(elementClass->nResources * sizeof(Tcl_Obj *) + 1);
for (i=0; i < elementClass->nResources; ++i) {
const char *defaultValue = specPtr->options[i].defaultValue;
@@ -275,7 +274,7 @@ static void FreeElementClass(Ttk_ElementClass *elementClass)
Tcl_DecrRefCount(elementClass->defaultValues[i]);
}
}
- ckfree((ClientData)elementClass->defaultValues);
+ ckfree(elementClass->defaultValues);
/*
* Free option map cache:
@@ -288,7 +287,7 @@ static void FreeElementClass(Ttk_ElementClass *elementClass)
Tcl_DeleteHashTable(&elementClass->optMapCache);
ckfree(elementClass->elementRecord);
- ckfree((ClientData)elementClass);
+ ckfree(elementClass);
}
/*------------------------------------------------------------------------
@@ -311,7 +310,7 @@ typedef struct Ttk_Theme_
static Theme *NewTheme(Ttk_ResourceCache cache, Ttk_Theme parent)
{
- Theme *themePtr = (Theme*)ckalloc(sizeof(Theme));
+ Theme *themePtr = ckalloc(sizeof(Theme));
Tcl_HashEntry *entryPtr;
int unused;
@@ -365,7 +364,7 @@ static void FreeTheme(Theme *themePtr)
/*
* Free theme record:
*/
- ckfree((ClientData)themePtr);
+ ckfree(themePtr);
return;
}
@@ -454,11 +453,11 @@ static void Ttk_StylePkgFree(ClientData clientData, Tcl_Interp *interp)
while (cleanup) {
Cleanup *next = cleanup->next;
cleanup->cleanupProc(cleanup->clientData);
- ckfree((ClientData)cleanup);
+ ckfree(cleanup);
cleanup = next;
}
- ckfree((ClientData)pkgPtr);
+ ckfree(pkgPtr);
}
/*
@@ -484,7 +483,7 @@ void Ttk_RegisterCleanup(
Tcl_Interp *interp, ClientData clientData, Ttk_CleanupProc *cleanupProc)
{
StylePackageData *pkgPtr = GetStylePackageData(interp);
- Cleanup *cleanup = (Cleanup*)ckalloc(sizeof(*cleanup));
+ Cleanup *cleanup = ckalloc(sizeof(*cleanup));
cleanup->clientData = clientData;
cleanup->cleanupProc = cleanupProc;
@@ -800,7 +799,7 @@ int Ttk_RegisterElementFactory(
Ttk_ElementFactory factory, void *clientData)
{
StylePackageData *pkgPtr = GetStylePackageData(interp);
- FactoryRec *recPtr = (FactoryRec*)ckalloc(sizeof(*recPtr));
+ FactoryRec *recPtr = ckalloc(sizeof(*recPtr));
Tcl_HashEntry *entryPtr;
int newEntry;
@@ -1695,8 +1694,7 @@ void Ttk_StylePkgInit(Tcl_Interp *interp)
{
Tcl_Namespace *nsPtr;
- StylePackageData *pkgPtr = (StylePackageData *)
- ckalloc(sizeof(StylePackageData));
+ StylePackageData *pkgPtr = ckalloc(sizeof(StylePackageData));
pkgPtr->interp = interp;
Tcl_InitHashTable(&pkgPtr->themeTable, TCL_STRING_KEYS);
diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c
index 8bc8519..e6234b8 100644
--- a/generic/ttk/ttkTrace.c
+++ b/generic/ttk/ttkTrace.c
@@ -85,7 +85,7 @@ Ttk_TraceHandle *Ttk_TraceVariable(
Ttk_TraceProc callback,
void *clientData)
{
- Ttk_TraceHandle *h = (Ttk_TraceHandle*)ckalloc(sizeof(*h));
+ Ttk_TraceHandle *h = ckalloc(sizeof(*h));
int status;
h->interp = interp;
@@ -100,7 +100,7 @@ Ttk_TraceHandle *Ttk_TraceVariable(
if (status != TCL_OK) {
Tcl_DecrRefCount(h->varnameObj);
- ckfree((ClientData)h);
+ ckfree(h);
return NULL;
}
@@ -154,7 +154,7 @@ void Ttk_UntraceVariable(Ttk_TraceHandle *h)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
VarTraceProc, (ClientData)h);
Tcl_DecrRefCount(h->varnameObj);
- ckfree((ClientData)h);
+ ckfree(h);
}
}
diff --git a/generic/ttk/ttkTrack.c b/generic/ttk/ttkTrack.c
index 9cf8267..396b073 100644
--- a/generic/ttk/ttkTrack.c
+++ b/generic/ttk/ttkTrack.c
@@ -173,7 +173,7 @@ ElementStateEventProc(ClientData clientData, XEvent *ev)
void TtkTrackElementState(WidgetCore *corePtr)
{
- ElementStateTracker *es = (ElementStateTracker*)ckalloc(sizeof(*es));
+ ElementStateTracker *es = ckalloc(sizeof(*es));
es->corePtr = corePtr;
es->tracking = 0;
es->activeElement = es->pressedElement = 0;
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 222b280..b17ae45 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -86,7 +86,7 @@ static Tk_OptionSpec ItemOptionSpecs[] = {
*/
static TreeItem *NewItem(void)
{
- TreeItem *item = (TreeItem*)ckalloc(sizeof(*item));
+ TreeItem *item = ckalloc(sizeof(*item));
item->entryPtr = 0;
item->parent = item->children = item->next = item->prev = NULL;
@@ -118,7 +118,7 @@ static void FreeItem(TreeItem *item)
if (item->tagset) { Ttk_FreeTagSet(item->tagset); }
if (item->imagespec) { TtkFreeImageSpec(item->imagespec); }
- ckfree((ClientData)item);
+ ckfree(item);
}
static void FreeItemCB(void *clientData) { FreeItem(clientData); }
@@ -612,11 +612,11 @@ static TreeItem **GetItemListFromObj(
return NULL;
}
- items = (TreeItem**)ckalloc((nElements + 1)*sizeof(TreeItem*));
+ items = ckalloc((nElements + 1)*sizeof(TreeItem*));
for (i = 0; i < nElements; ++i) {
items[i] = FindItem(interp, tv, elements[i]);
if (!items[i]) {
- ckfree((ClientData)items);
+ ckfree(items);
return NULL;
}
}
@@ -658,7 +658,7 @@ static void TreeviewFreeColumns(Treeview *tv)
if (tv->tree.columns) {
for (i = 0; i < tv->tree.nColumns; ++i)
FreeColumn(tv->tree.columns + i);
- ckfree((ClientData)tv->tree.columns);
+ ckfree(tv->tree.columns);
tv->tree.columns = 0;
}
}
@@ -687,8 +687,7 @@ static int TreeviewInitColumns(Tcl_Interp *interp, Treeview *tv)
* Initialize columns array and columnNames hash table:
*/
tv->tree.nColumns = ncols;
- tv->tree.columns =
- (TreeColumn*)ckalloc(tv->tree.nColumns * sizeof(TreeColumn));
+ tv->tree.columns = ckalloc(tv->tree.nColumns * sizeof(TreeColumn));
for (i = 0; i < ncols; ++i) {
int isNew;
@@ -733,16 +732,16 @@ static int TreeviewInitDisplayColumns(Tcl_Interp *interp, Treeview *tv)
if (!strcmp(Tcl_GetString(tv->tree.displayColumnsObj), "#all")) {
ndcols = tv->tree.nColumns;
- displayColumns = (TreeColumn**)ckalloc((ndcols+1)*sizeof(TreeColumn*));
+ displayColumns = ckalloc((ndcols+1) * sizeof(TreeColumn*));
for (index = 0; index < ndcols; ++index) {
displayColumns[index+1] = tv->tree.columns + index;
}
} else {
- displayColumns = (TreeColumn**)ckalloc((ndcols+1)*sizeof(TreeColumn*));
+ displayColumns = ckalloc((ndcols+1) * sizeof(TreeColumn*));
for (index = 0; index < ndcols; ++index) {
displayColumns[index+1] = GetColumn(interp, tv, dcolumns[index]);
if (!displayColumns[index+1]) {
- ckfree((ClientData)displayColumns);
+ ckfree(displayColumns);
return TCL_ERROR;
}
}
@@ -750,7 +749,7 @@ static int TreeviewInitDisplayColumns(Tcl_Interp *interp, Treeview *tv)
displayColumns[0] = &tv->tree.column0;
if (tv->tree.displayColumns)
- ckfree((ClientData)tv->tree.displayColumns);
+ ckfree(tv->tree.displayColumns);
tv->tree.displayColumns = displayColumns;
tv->tree.nDisplayColumns = ndcols + 1;
@@ -1986,7 +1985,7 @@ static int TreeviewChildrenCommand(
*/
for (i=0; newChildren[i]; ++i) {
if (!AncestryCheck(interp, tv, newChildren[i], item)) {
- ckfree((ClientData)newChildren);
+ ckfree(newChildren);
return TCL_ERROR;
}
}
@@ -2022,7 +2021,7 @@ static int TreeviewChildrenCommand(
child = newChildren[i];
}
- ckfree((ClientData)newChildren);
+ ckfree(newChildren);
TtkRedisplayWidget(&tv->core);
}
@@ -2648,7 +2647,7 @@ static int TreeviewDetachCommand(
for (i = 0; items[i]; ++i) {
if (items[i] == tv->tree.root) {
Tcl_AppendResult(interp, "Cannot detach root item", NULL);
- ckfree((ClientData)items);
+ ckfree(items);
return TCL_ERROR;
}
}
@@ -2658,7 +2657,7 @@ static int TreeviewDetachCommand(
}
TtkRedisplayWidget(&tv->core);
- ckfree((ClientData)items);
+ ckfree(items);
return TCL_OK;
}
@@ -2694,7 +2693,7 @@ static int TreeviewDeleteCommand(
*/
for (i=0; items[i]; ++i) {
if (items[i] == tv->tree.root) {
- ckfree((ClientData)items);
+ ckfree(items);
Tcl_AppendResult(interp, "Cannot delete root item", NULL);
return TCL_ERROR;
}
@@ -2719,7 +2718,7 @@ static int TreeviewDeleteCommand(
delq = next;
}
- ckfree((ClientData)items);
+ ckfree(items);
TtkRedisplayWidget(&tv->core);
return TCL_OK;
}
@@ -2988,7 +2987,7 @@ static int TreeviewSelectionCommand(
break;
}
- ckfree((ClientData)items);
+ ckfree(items);
TtkSendVirtualEvent(tv->core.tkwin, "TreeviewSelect");
TtkRedisplayWidget(&tv->core);
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index a9e7d30..65e7209 100644
--- a/library/bgerror.tcl
+++ b/library/bgerror.tcl
@@ -9,6 +9,7 @@
# Copyright (c) 1998-2000 by Ajuba Solutions.
# Copyright (c) 2007 by ActiveState Software Inc.
# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+# Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
namespace eval ::tk::dialog::error {
namespace import -force ::tk::msgcat::*
@@ -26,13 +27,13 @@ namespace eval ::tk::dialog::error {
}
}
-proc ::tk::dialog::error::Return {} {
+proc ::tk::dialog::error::Return {which code} {
variable button
- .bgerrorDialog.ok configure -state active -relief sunken
+ .bgerrorDialog.$which state {active selected focus}
update idletasks
after 100
- set button 0
+ set button $code
}
proc ::tk::dialog::error::Details {} {
@@ -53,19 +54,19 @@ proc ::tk::dialog::error::SaveToLog {text} {
} else {
set allFiles *
}
- set types [list \
- [list [mc "Log Files"] .log] \
- [list [mc "Text Files"] .txt] \
+ 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
+ if {$filename ne {}} {
+ set f [open $filename w]
+ puts -nonewline $f $text
+ close $f
}
- set f [open $filename w]
- puts -nonewline $f $text
- close $f
+ return
}
proc ::tk::dialog::error::Destroy {w} {
@@ -75,14 +76,27 @@ proc ::tk::dialog::error::Destroy {w} {
}
}
+proc ::tk::dialog::error::DeleteByProtocol {} {
+ variable button
+ set button 1
+}
+
+proc ::tk::dialog::error::ReturnInDetails w {
+ bind $w <Return> {}; # Remove this binding
+ $w invoke
+ return -code break
+}
+
# ::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
-# trace.
+#
+# 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 trace.
+#
# Arguments:
-# err - The error message.
-
+# err - The error message.
+#
proc ::tk::dialog::error::bgerror err {
global errorInfo tcl_platform
variable button
@@ -130,12 +144,13 @@ proc ::tk::dialog::error::bgerror err {
# and bottom parts.
set dlg .bgerrorDialog
+ set bg [ttk::style lookup . -background]
destroy $dlg
- toplevel $dlg -class ErrorDialog
+ toplevel $dlg -class ErrorDialog -background $bg
wm withdraw $dlg
wm title $dlg $title
wm iconname $dlg ErrorDialog
- wm protocol $dlg WM_DELETE_WINDOW { }
+ wm protocol $dlg WM_DELETE_WINDOW [namespace code DeleteByProtocol]
if {$windowingsystem eq "aqua"} {
::tk::unsupported::MacWindowStyle style $dlg moveableAlert {}
@@ -143,23 +158,19 @@ proc ::tk::dialog::error::bgerror err {
wm attributes $dlg -type dialog
}
- frame $dlg.bot
- frame $dlg.top
- if {$windowingsystem eq "x11"} {
- $dlg.bot configure -relief raised -bd 1
- $dlg.top configure -relief raised -bd 1
- }
+ ttk::frame $dlg.bot
+ ttk::frame $dlg.top
pack $dlg.bot -side bottom -fill both
pack $dlg.top -side top -fill both -expand 1
- set W [frame $dlg.top.info]
+ set W [ttk::frame $dlg.top.info]
text $W.text -setgrid true -height 10 -wrap char \
-yscrollcommand [list $W.scroll set]
if {$windowingsystem ne "aqua"} {
$W.text configure -width 40
}
- scrollbar $W.scroll -command [list $W.text yview]
+ ttk::scrollbar $W.scroll -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"
@@ -174,18 +185,11 @@ proc ::tk::dialog::error::bgerror err {
# ...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 $dlg 9m]}]
- label $dlg.msg -justify left -text $text -wraplength $wrapwidth
- if {$windowingsystem eq "aqua"} {
- # On the Macintosh, use the stop bitmap
- label $dlg.bitmap -bitmap stop
- } else {
- # On other platforms, make the error icon
- canvas $dlg.bitmap -width 32 -height 32 -highlightthickness 0
- $dlg.bitmap create oval 0 0 31 31 -fill red -outline black
- $dlg.bitmap create line 9 9 23 23 -fill white -width 4
- $dlg.bitmap create line 9 23 23 9 -fill white -width 4
- }
+ ttk::label $dlg.msg -justify left -text $text -wraplength $wrapwidth
+ ttk::label $dlg.bitmap -image ::tk::icons::error
+
grid $dlg.bitmap $dlg.msg -in $dlg.top -row 0 -padx 3m -pady 3m
+ grid configure $dlg.bitmap -sticky ne
grid configure $dlg.msg -sticky nsw -padx {0 3m}
grid rowconfigure $dlg.top 1 -weight 1
grid columnconfigure $dlg.top 1 -weight 1
@@ -194,7 +198,7 @@ proc ::tk::dialog::error::bgerror err {
set i 0
foreach {name caption} $buttons {
- button $dlg.$name -text $caption -default normal \
+ ttk::button $dlg.$name -text $caption -default normal \
-command [namespace code [list set button $i]]
grid $dlg.$name -in $dlg.bot -column $i -row 0 -sticky ew -padx 10
grid columnconfigure $dlg.bot $i -weight 1
@@ -210,15 +214,21 @@ proc ::tk::dialog::error::bgerror err {
# The "OK" button is the default for this dialog.
$dlg.ok configure -default active
- bind $dlg <Return> [namespace code Return]
- bind $dlg <Destroy> [namespace code [list Destroy %W]]
+ bind $dlg <Return> [namespace code {Return ok 0}]
+ bind $dlg <Escape> [namespace code {Return dismiss 1}]
+ bind $dlg <Destroy> [namespace code {Destroy %W}]
+ bind $dlg.function <Return> [namespace code {ReturnInDetails %W}]
$dlg.function configure -command [namespace code Details]
# 6. Place the window (centered in the display) and deiconify it.
::tk::PlaceWindow $dlg
- # 7. Ensure that we are topmost.
+ # 7. Set a grab and claim the focus too.
+
+ ::tk::SetFocusGrab $dlg $dlg.ok
+
+ # 8. Ensure that we are topmost.
raise $dlg
if {$tcl_platform(platform) eq "windows"} {
@@ -226,13 +236,9 @@ proc ::tk::dialog::error::bgerror err {
# order to ensure that it's seen
if {[lindex [wm stackorder .] end] ne "$dlg"} {
wm attributes $dlg -topmost 1
- }
+ }
}
- # 8. Set a grab and claim the focus too.
-
- ::tk::SetFocusGrab $dlg $dlg.ok
-
# 9. 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
diff --git a/library/button.tcl b/library/button.tcl
index b817b76..fb6ad1c 100644
--- a/library/button.tcl
+++ b/library/button.tcl
@@ -746,3 +746,10 @@ proc ::tk::CheckLeave {w} {
set Priv(window) ""
}
+
+return
+
+# Local Variables:
+# mode: tcl
+# fill-column: 78
+# End:
diff --git a/library/choosedir.tcl b/library/choosedir.tcl
index 8f3f75f..8c87b9e 100644
--- a/library/choosedir.tcl
+++ b/library/choosedir.tcl
@@ -209,9 +209,9 @@ proc ::tk::dialog::file::chooseDir::OkCmd {w} {
# 4b. If the value is different from the current directory, change to
# that directory.
- set selection [tk::IconList_CurSelection $data(icons)]
+ set selection [$data(icons) selection get]
if {[llength $selection] != 0} {
- set iconText [tk::IconList_Get $data(icons) [lindex $selection 0]]
+ set iconText [$data(icons) get [lindex $selection 0]]
set iconText [file join $data(selectPath) $iconText]
Done $w $iconText
} else {
@@ -259,10 +259,9 @@ proc ::tk::dialog::file::chooseDir::IsOK? {w text} {
proc ::tk::dialog::file::chooseDir::DblClick {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set selection [tk::IconList_CurSelection $data(icons)]
+ set selection [$data(icons) selection get]
if {[llength $selection] != 0} {
- set filenameFragment \
- [tk::IconList_Get $data(icons) [lindex $selection 0]]
+ set filenameFragment [$data(icons) get [lindex $selection 0]]
set file $data(selectPath)
if {[file isdirectory $file]} {
::tk::dialog::file::ListInvoke $w [list $filenameFragment]
diff --git a/library/console.tcl b/library/console.tcl
index e44324f..e6b7ce9 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -6,7 +6,7 @@
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
-# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+# Copyright (c) 2007-2008 Daniel A. Steffen <das@users.sourceforge.net>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -20,11 +20,10 @@ namespace eval ::tk::console {
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 useFontchooser [llength [info command ::tk::fontchooser]]
variable inPlugin [info exists embed_args]
variable defaultPrompt ; # default prompt if tcl_prompt1 isn't used
-
if {$inPlugin} {
set defaultPrompt {subst {[history nextid] % }}
} else {
@@ -93,11 +92,34 @@ proc ::tk::ConsoleInit {} {
}
AmpMenuArgs .menubar.edit add separator
+ if {$::tk::console::useFontchooser} {
+ if {[tk windowingsystem] eq "aqua"} {
+ .menubar.edit add command -label tk_choose_font_marker
+ set index [.menubar.edit index tk_choose_font_marker]
+ .menubar.edit entryconfigure $index \
+ -label [mc "Show Fonts"]\
+ -accelerator "$mod-T"\
+ -command [list ::tk::console::FontchooserToggle]
+ bind Console <<TkFontchooserVisibility>> \
+ [list ::tk::console::FontchooserVisibility $index]
+ ::tk::console::FontchooserVisibility $index
+ } else {
+ AmpMenuArgs .menubar.edit add command -label [mc "&Font..."] \
+ -command [list ::tk::console::FontchooserToggle]
+ }
+ bind Console <FocusIn> [list ::tk::console::FontchooserFocus %W 1]
+ bind Console <FocusOut> [list ::tk::console::FontchooserFocus %W 0]
+ }
AmpMenuArgs .menubar.edit add command -label [mc "&Increase Font Size"] \
-accel "$mod++" -command {event generate .console <<Console_FontSizeIncr>>}
AmpMenuArgs .menubar.edit add command -label [mc "&Decrease Font Size"] \
-accel "$mod+-" -command {event generate .console <<Console_FontSizeDecr>>}
+ if {[tk windowingsystem] eq "aqua"} {
+ .menubar add cascade -label [mc Window] -menu [menu .menubar.window]
+ .menubar add cascade -label [mc Help] -menu [menu .menubar.help]
+ }
+
. configure -menu .menubar
# See if we can find a better font than the TkFixedFont
@@ -426,6 +448,9 @@ proc ::tk::ConsoleBind {w} {
event add $ev $key
bind Console $key {}
}
+ if {$::tk::console::useFontchooser} {
+ bind Console <Command-Key-t> [list ::tk::console::FontchooserToggle]
+ }
}
bind Console <<Console_Expand>> {
if {[%W compare insert > promptEnd]} {
@@ -562,11 +587,22 @@ proc ::tk::ConsoleBind {w} {
bind Console <<Console_FontSizeIncr>> {
set size [font configure TkConsoleFont -size]
- font configure TkConsoleFont -size [incr size]
+ if {$size < 0} {set sign -1} else {set sign 1}
+ set size [expr {(abs($size) + 1) * $sign}]
+ font configure TkConsoleFont -size $size
+ if {$::tk::console::useFontchooser} {
+ tk fontchooser configure -font TkConsoleFont
+ }
}
bind Console <<Console_FontSizeDecr>> {
set size [font configure TkConsoleFont -size]
- font configure TkConsoleFont -size [incr size -1]
+ if {abs($size) < 2} { return }
+ if {$size < 0} {set sign -1} else {set sign 1}
+ set size [expr {(abs($size) - 1) * $sign}]
+ font configure TkConsoleFont -size $size
+ if {$::tk::console::useFontchooser} {
+ tk fontchooser configure -font TkConsoleFont
+ }
}
##
@@ -671,6 +707,35 @@ Tcl $::tcl_patchLevel
Tk $::tk_patchLevel"
}
+# ::tk::console::Fontchooser* --
+# Let the user select the console font (TIP 324).
+
+proc ::tk::console::FontchooserToggle {} {
+ if {[tk fontchooser configure -visible]} {
+ tk fontchooser hide
+ } else {
+ tk fontchooser show
+ }
+}
+proc ::tk::console::FontchooserVisibility {index} {
+ if {[tk fontchooser configure -visible]} {
+ .menubar.edit entryconfigure $index -label [msgcat::mc "Hide Fonts"]
+ } else {
+ .menubar.edit entryconfigure $index -label [msgcat::mc "Show Fonts"]
+ }
+}
+proc ::tk::console::FontchooserFocus {w isFocusIn} {
+ if {$isFocusIn} {
+ tk fontchooser configure -parent $w -font TkConsoleFont \
+ -command [namespace code [list FontchooserApply]]
+ } else {
+ tk fontchooser configure -parent $w -font {} -command {}
+ }
+}
+proc ::tk::console::FontchooserApply {font args} {
+ catch {font configure TkConsoleFont {*}[font actual $font]}
+}
+
# ::tk::console::TagProc --
#
# Tags a procedure in the console if it's recognized
diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl
index 5dad9f0..8631904 100644
--- a/library/demos/combo.tcl
+++ b/library/demos/combo.tcl
@@ -7,7 +7,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .combo
catch {destroy $w}
diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl
index e894bc2..4b8c644 100644
--- a/library/demos/ctext.tcl
+++ b/library/demos/ctext.tcl
@@ -17,7 +17,7 @@ wm iconname $w "Text"
positionWindow $w
set c $w.c
-label $w.msg -font $font -wraplength 5i -justify left -text "This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification. The text also supports the following simple bindings for editing:
+label $w.msg -font $font -wraplength 5i -justify left -text "This window displays a string of text to demonstrate the text facilities of canvas widgets. You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification, and on a pie slice to change its angle. The text also supports the following simple bindings for editing:
1. You can point, click, and type.
2. You can also select with button 1.
3. You can copy the selection to the mouse position with button 2.
@@ -50,36 +50,63 @@ $c bind text <Return> "textInsert $c \\n"
$c bind text <Control-h> "textBs $c"
$c bind text <BackSpace> "textBs $c"
$c bind text <Delete> "textDel $c"
-$c bind text <2> "textPaste $c @%x,%y"
+$c bind text <2> "textPaste $c @%x,%y"
# Next, create some items that allow the text's anchor position
# to be edited.
-proc mkTextConfig {w x y option value color} {
+proc mkTextConfigBox {w x y option value color} {
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
}
+proc mkTextConfigPie {w x y a option value color} {
+ set item [$w create arc $x $y [expr {$x+90}] [expr {$y+90}] \
+ -start [expr {$a-15}] -extent 30 -outline black -fill $color \
+ -width 1]
+ $w bind $item <1> "$w itemconf text $option $value"
+ $w addtag config withtag $item
+}
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
+mkTextConfigBox $c $x $y -anchor se $color
+mkTextConfigBox $c [expr {$x+30}] [expr {$y }] -anchor s $color
+mkTextConfigBox $c [expr {$x+60}] [expr {$y }] -anchor sw $color
+mkTextConfigBox $c [expr {$x }] [expr {$y+30}] -anchor e $color
+mkTextConfigBox $c [expr {$x+30}] [expr {$y+30}] -anchor center $color
+mkTextConfigBox $c [expr {$x+60}] [expr {$y+30}] -anchor w $color
+mkTextConfigBox $c [expr {$x }] [expr {$y+60}] -anchor ne $color
+mkTextConfigBox $c [expr {$x+30}] [expr {$y+60}] -anchor n $color
+mkTextConfigBox $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
+ -text {Text Position} -anchor s -font {Times 20} -fill brown
+
+# Now create some items that allow the text's angle to be changed.
+
+set x 205
+set y 50
+set color Yellow
+mkTextConfigPie $c $x $y 0 -angle 90 $color
+mkTextConfigPie $c $x $y 30 -angle 120 $color
+mkTextConfigPie $c $x $y 60 -angle 150 $color
+mkTextConfigPie $c $x $y 90 -angle 180 $color
+mkTextConfigPie $c $x $y 120 -angle 210 $color
+mkTextConfigPie $c $x $y 150 -angle 240 $color
+mkTextConfigPie $c $x $y 180 -angle 270 $color
+mkTextConfigPie $c $x $y 210 -angle 300 $color
+mkTextConfigPie $c $x $y 240 -angle 330 $color
+mkTextConfigPie $c $x $y 270 -angle 0 $color
+mkTextConfigPie $c $x $y 300 -angle 30 $color
+mkTextConfigPie $c $x $y 330 -angle 60 $color
+$c create text [expr {$x+45}] [expr {$y-5}] \
+ -text {Text Angle} -anchor s -font {Times 20} -fill brown
# Lastly, create some items that allow the text's justification to be
# changed.
@@ -87,11 +114,11 @@ $c create text [expr {$x+45}] [expr {$y-5}] \
set x 350
set y 50
set color SeaGreen2
-mkTextConfig $c $x $y -justify left $color
-mkTextConfig $c [expr {$x+30}] $y -justify center $color
-mkTextConfig $c [expr {$x+60}] $y -justify right $color
+mkTextConfigBox $c $x $y -justify left $color
+mkTextConfigBox $c [expr {$x+30}] $y -justify center $color
+mkTextConfigBox $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
+ -text {Justification} -anchor s -font {Times 20} -fill brown
$c bind config <Enter> "textEnter $c"
$c bind config <Leave> "$c itemconf current -fill \$textConfigFill"
diff --git a/library/demos/en.msg b/library/demos/en.msg
index d4783fe..e364c81 100644
--- a/library/demos/en.msg
+++ b/library/demos/en.msg
@@ -18,7 +18,7 @@
::msgcat::mcset en "Demo code: %s"
::msgcat::mcset en "About Widget Demo"
::msgcat::mcset en "Tk widget demonstration application"
-::msgcat::mcset en "Copyright (c) %s" "Copyright \u00a9 %s"
+::msgcat::mcset en "Copyright \u00a9 %s"
::msgcat::mcset en "
@@title
Tk Widget Demonstrations
diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl
index 032e3d8..e06ebba 100644
--- a/library/demos/filebox.tcl
+++ b/library/demos/filebox.tcl
@@ -15,7 +15,10 @@ wm title $w "File Selection Dialogs"
wm iconname $w "filebox"
positionWindow $w
-label $w.msg -font $font -wraplength 4i -justify left -text "Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog."
+ttk::frame $w._bg
+place $w._bg -x 0 -y 0 -relwidth 1 -relheight 1
+
+ttk::label $w.msg -font $font -wraplength 4i -justify left -text "Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog."
pack $w.msg -side top
## See Code / Dismiss buttons
@@ -23,10 +26,10 @@ set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x
foreach i {open save} {
- set f [frame $w.$i]
- label $f.lab -text "Select a file to $i: " -anchor e
- entry $f.ent -width 20
- button $f.but -text "Browse ..." -command "fileDialog $w $f.ent $i"
+ set f [ttk::frame $w.$i]
+ ttk::label $f.lab -text "Select a file to $i: " -anchor e
+ ttk::entry $f.ent -width 20
+ ttk::button $f.but -text "Browse ..." -command "fileDialog $w $f.ent $i"
pack $f.lab -side left
pack $f.ent -side left -expand yes -fill x
pack $f.but -side left
@@ -34,7 +37,7 @@ foreach i {open save} {
}
if {[tk windowingsystem] eq "x11"} {
- checkbutton $w.strict -text "Use Motif Style Dialog" \
+ ttk::checkbutton $w.strict -text "Use Motif Style Dialog" \
-variable tk_strictMotif -onvalue 1 -offvalue 0
pack $w.strict -anchor c
diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl
new file mode 100644
index 0000000..def30c3
--- /dev/null
+++ b/library/demos/fontchoose.tcl
@@ -0,0 +1,69 @@
+# fontchoose.tcl --
+#
+# Show off the stock font selector dialog
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+package require Tk
+
+set w .fontchoose
+catch {destroy $w}
+toplevel $w
+wm title $w "Font Selection Dialog"
+wm iconname $w "fontchooser"
+positionWindow $w
+
+catch {font create FontchooseDemoFont {*}[font actual TkDefaultFont]}
+
+# The font chooser needs to be configured and then shown.
+proc SelectFont {parent} {
+ tk fontchooser configure -font FontchooseDemoFont \
+ -command ApplyFont -parent $parent
+ tk fontchooser show
+}
+
+proc ApplyFont {font} {
+ font configure FontchooseDemoFont {*}[font actual $font]
+}
+
+# When the visibility of the fontchooser changes, the following event is fired
+# to the parent widget.
+#
+bind $w <<TkFontchooserVisibility>> {
+ if {[tk fontchooser configure -visible]} {
+ %W.f.font state disabled
+ } else {
+ %W.f.font state !disabled
+ }
+}
+
+
+set f [ttk::frame $w.f -relief sunken -padding 2]
+
+text $f.msg -font FontchooseDemoFont -width 40 -height 6 -borderwidth 0 \
+ -yscrollcommand [list $f.vs set]
+ttk::scrollbar $f.vs -command [list $f.msg yview]
+
+$f.msg insert end "Press the buttons below to choose a new font for the\
+ text shown in this window.\n" {}
+
+ttk::button $f.font -text "Set font ..." -command [list SelectFont $w]
+
+grid $f.msg $f.vs -sticky news
+grid $f.font - -sticky e
+grid columnconfigure $f 0 -weight 1
+grid rowconfigure $f 0 -weight 1
+bind $w <Visibility> {
+ bind %W <Visibility> {}
+ grid propagate %W.f 0
+}
+
+## See Code / Dismiss buttons
+set btns [addSeeDismiss $w.buttons $w]
+
+grid $f -sticky news
+grid $btns -sticky ew
+grid columnconfigure $w 0 -weight 1
+grid rowconfigure $w 0 -weight 1
diff --git a/library/demos/hello b/library/demos/hello
index c8ccd37..d10b8d5 100644
--- a/library/demos/hello
+++ b/library/demos/hello
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# hello --
# Simple Tk script to create a button that prints "Hello, world".
diff --git a/library/demos/image2.tcl b/library/demos/image2.tcl
index 7b3d748..a17da31 100644
--- a/library/demos/image2.tcl
+++ b/library/demos/image2.tcl
@@ -36,7 +36,7 @@ proc loadDir w {
proc selectAndLoadDir w {
global dirName
set dir [tk_chooseDirectory -initialdir $dirName -parent $w -mustexist 1]
- if {[string length $dir] != 0} {
+ if {$dir ne ""} {
set dirName $dir
loadDir $w
}
diff --git a/library/demos/images/face.xbm b/library/demos/images/face.xbm
deleted file mode 100644
index 03d829f..0000000
--- a/library/demos/images/face.xbm
+++ /dev/null
@@ -1,173 +0,0 @@
-#define face_width 108
-#define face_height 144
-#define face_x_hot 48
-#define face_y_hot 80
-static char face_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09,
- 0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88,
- 0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01,
- 0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84,
- 0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00,
- 0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24,
- 0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea,
- 0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05,
- 0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02,
- 0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41,
- 0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00,
- 0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20,
- 0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57,
- 0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff,
- 0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5,
- 0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0,
- 0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20,
- 0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00,
- 0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10,
- 0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9,
- 0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef,
- 0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf,
- 0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe,
- 0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91,
- 0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04,
- 0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03,
- 0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb,
- 0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54,
- 0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11,
- 0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff,
- 0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40,
- 0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00,
- 0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f,
- 0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d,
- 0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52,
- 0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00,
- 0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d,
- 0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04,
- 0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00,
- 0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f,
- 0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe,
- 0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40,
- 0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10,
- 0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29,
- 0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00,
- 0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04,
- 0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f,
- 0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6,
- 0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84,
- 0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20,
- 0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95,
- 0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00,
- 0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00,
- 0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e,
- 0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6,
- 0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82,
- 0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01,
- 0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a,
- 0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02,
- 0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00,
- 0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f,
- 0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde,
- 0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef,
- 0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b,
- 0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb,
- 0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00,
- 0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00,
- 0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d,
- 0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb,
- 0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff,
- 0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb,
- 0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5,
- 0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01,
- 0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00,
- 0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b,
- 0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa,
- 0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55,
- 0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0,
- 0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a,
- 0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00,
- 0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00,
- 0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b,
- 0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4,
- 0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01,
- 0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a,
- 0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15,
- 0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00,
- 0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00,
- 0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51,
- 0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6,
- 0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6,
- 0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56,
- 0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8,
- 0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08,
- 0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00,
- 0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00,
- 0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff,
- 0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae,
- 0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95,
- 0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51,
- 0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00,
- 0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01,
- 0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00,
- 0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff,
- 0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d,
- 0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a,
- 0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40,
- 0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20,
- 0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00,
- 0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03,
- 0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff,
- 0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56,
- 0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52,
- 0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04,
- 0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51,
- 0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04,
- 0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f,
- 0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf,
- 0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55,
- 0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2,
- 0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8,
- 0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50,
- 0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02,
- 0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff,
- 0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0,
- 0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd,
- 0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa,
- 0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10,
- 0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50,
- 0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04,
- 0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff,
- 0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd,
- 0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f,
- 0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea,
- 0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0,
- 0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40,
- 0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14,
- 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba,
- 0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21,
- 0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40,
- 0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01,
- 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84,
- 0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf,
- 0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08,
- 0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80,
- 0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff,
- 0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28,
- 0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10,
- 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff,
- 0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb,
- 0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};
diff --git a/library/demos/images/ouster.png b/library/demos/images/ouster.png
new file mode 100644
index 0000000..259b8f9
--- /dev/null
+++ b/library/demos/images/ouster.png
Binary files differ
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index 85bf5f3..31a1570 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -126,8 +126,8 @@ $c create text 25.5c 11c -anchor w -font $font1 -fill $blue \
-text "Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge." \
-justify center -tags item
$c create rectangle 24.9c 13.9c 25.1c 14.1c
-$c create text 25c 14c -font $font2 -anchor c -fill $red -stipple gray50 \
- -text "Stippled characters" -tags item
+$c create text 25c 14c -font $font2 -anchor c -fill $red -angle 15 \
+ -text "Angled characters" -tags item
$c create text 5c 16.2c -text Arcs -anchor n
$c create arc 0.5c 17c 7c 20c -fill $green -outline black \
@@ -140,9 +140,13 @@ $c create arc 0.5c 20c 9.5c 24c -width 4m -style pieslice \
$c create arc 5.5c 20.5c 9.5c 23.5c -width 4m -style chord \
-fill $blue -outline {} -start 45 -extent 270 -tags item
-$c create text 15c 16.2c -text Bitmaps -anchor n
-$c create bitmap 13c 20c -tags item \
- -bitmap @[file join $tk_demoDirectory images face.xbm]
+image create photo items.ousterhout \
+ -file [file join $tk_demoDirectory images ouster.png]
+image create photo items.ousterhout.active -format "png -alpha 0.5" \
+ -file [file join $tk_demoDirectory images ouster.png]
+$c create text 15c 16.2c -text "Bitmaps and Images" -anchor n
+$c create image 13c 20c -tags item -image items.ousterhout \
+ -activeimage items.ousterhout.active
$c create bitmap 17c 18.5c -tags item \
-bitmap @[file join $tk_demoDirectory images noletter.xbm]
$c create bitmap 17c 21.5c -tags item \
@@ -183,15 +187,18 @@ proc itemEnter {c} {
return
}
set type [$c type current]
- if {$type == "window"} {
+ if {$type == "window" || $type == "image"} {
set restoreCmd {}
return
- }
- if {$type == "bitmap"} {
+ } elseif {$type == "bitmap"} {
set bg [lindex [$c itemconf current -background] 4]
set restoreCmd [list $c itemconfig current -background $bg]
$c itemconfig current -background SteelBlue2
return
+ } elseif {$type == "image"} {
+ set restoreCmd [list $c itemconfig current -state normal]
+ $c itemconfig current -state active
+ return
}
set fill [lindex [$c itemconfig current -fill] 4]
if {(($type == "rectangle") || ($type == "oval") || ($type == "arc"))
@@ -279,6 +286,6 @@ proc itemDrag {c x y} {
# is invoked.
proc butPress {w color} {
- set i [$w create text 25c 18.1c -text "Ouch!!" -fill $color -anchor n]
+ set i [$w create text 25c 18.1c -text "Oooohhh!!" -fill $color -anchor n]
after 500 "$w delete $i"
}
diff --git a/library/demos/knightstour.tcl b/library/demos/knightstour.tcl
index b52e38f..73ca3a3 100644
--- a/library/demos/knightstour.tcl
+++ b/library/demos/knightstour.tcl
@@ -61,6 +61,8 @@ proc Next {square} {
set minimum $count
set nextSquare $testSquare
} elseif {$count == $minimum} {
+ # to remove the enhancement to Warnsdorff's rule
+ # remove the next line:
set nextSquare [Edgemost $nextSquare $testSquare]
}
}
@@ -92,7 +94,7 @@ proc MovePiece {dlg last square} {
$dlg.f.txt see end
$dlg.f.c itemconfigure [expr {1+$last}] -state normal -outline black
$dlg.f.c itemconfigure [expr {1+$square}] -state normal -outline red
- $dlg.f.c coords knight [lrange [$dlg.f.c coords [expr {1+$square}]] 0 1]
+ $dlg.f.c moveto knight {*}[lrange [$dlg.f.c coords [expr {1+$square}]] 0 1]
lappend visited $square
set next [Next $square]
if {$next ne -1} {
@@ -125,8 +127,8 @@ proc Tour {dlg {square {}}} {
$dlg.f.c itemconfigure $n -state disabled -outline black
}
if {$square eq {}} {
- set square [expr {[$dlg.f.c find closest \
- {*}[$dlg.f.c coords knight] 0 65]-1}]
+ set coords [lrange [$dlg.f.c coords knight] 0 1]
+ set square [expr {[$dlg.f.c find closest {*}$coords 0 65]-1}]
}
variable initial $square
after idle [list MovePiece $dlg $initial $initial]
@@ -161,7 +163,7 @@ proc DragMotion {w x y} {
}
proc DragEnd {w x y} {
set square [$w find closest $x $y 0 65]
- $w coords selected [lrange [$w coords $square] 0 1]
+ $w moveto selected {*}[lrange [$w coords $square] 0 1]
$w dtag selected
variable dragging ; unset dragging
}
@@ -201,10 +203,21 @@ proc CreateGUI {} {
-width 2 -state disabled
}
}
- catch {eval font create KnightFont -size -24}
- $c create text 0 0 -font KnightFont -text "\u265e" \
- -anchor nw -tags knight -fill black -activefill "#600000"
- $c coords knight [lrange [$c coords [expr {1 + int(rand() * 64)}]] 0 1]
+ if {[tk windowingsystem] ne "x11"} {
+ catch {eval font create KnightFont -size -24}
+ $c create text 0 0 -font KnightFont -text "\u265e" \
+ -anchor nw -tags knight -fill black -activefill "#600000"
+ } else {
+ # On X11 we cannot reliably tell if the \u265e glyph is available
+ # so just use a polygon
+ set pts {
+ 2 25 24 25 21 19 20 8 14 0 10 0 0 13 0 16
+ 2 17 4 14 5 15 3 17 5 17 9 14 10 15 5 21
+ }
+ $c create polygon $pts -tag knight -offset 8 \
+ -fill black -activefill "#600000"
+ }
+ $c moveto knight {*}[lrange [$c coords [expr {1 + int(rand() * 64)}]] 0 1]
$c bind knight <ButtonPress-1> [namespace code [list DragStart %W %x %y]]
$c bind knight <Motion> [namespace code [list DragMotion %W %x %y]]
$c bind knight <ButtonRelease-1> [namespace code [list DragEnd %W %x %y]]
diff --git a/library/demos/label.tcl b/library/demos/label.tcl
index a5cab10..13463f7 100644
--- a/library/demos/label.tcl
+++ b/library/demos/label.tcl
@@ -16,7 +16,7 @@ wm title $w "Label Demonstration"
wm iconname $w "label"
positionWindow $w
-label $w.msg -font $font -wraplength 4i -justify left -text "Five labels are displayed below: three textual ones on the left, and a bitmap label and a text label on the right. Labels are pretty boring because you can't do anything with them."
+label $w.msg -font $font -wraplength 4i -justify left -text "Five labels are displayed below: three textual ones on the left, and an image label and a text label on the right. Labels are pretty boring because you can't do anything with them."
pack $w.msg -side top
## See Code / Dismiss buttons
@@ -33,7 +33,8 @@ label $w.left.l3 -text "Third label, sunken" -relief sunken
pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -pady 2 -anchor w
# Main widget program sets variable tk_demoDirectory
-label $w.right.bitmap -borderwidth 2 -relief sunken \
- -bitmap @[file join $tk_demoDirectory images face.xbm]
-label $w.right.caption -text "Tcl/Tk Proprietor"
-pack $w.right.bitmap $w.right.caption -side top
+image create photo label.ousterhout \
+ -file [file join $tk_demoDirectory images ouster.png]
+label $w.right.picture -borderwidth 2 -relief sunken -image label.ousterhout
+label $w.right.caption -text "Tcl/Tk Creator"
+pack $w.right.picture $w.right.caption -side top
diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl
index d1d3f47..7a4dd4c 100644
--- a/library/demos/mclist.tcl
+++ b/library/demos/mclist.tcl
@@ -8,7 +8,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .mclist
catch {destroy $w}
@@ -27,19 +26,22 @@ pack [addSeeDismiss $w.seeDismiss $w] -side bottom -fill x
ttk::frame $w.container
ttk::treeview $w.tree -columns {country capital currency} -show headings \
-yscroll "$w.vsb set" -xscroll "$w.hsb set"
-if {[tk windowingsystem] ne "aqua"} {
- ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview"
- ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
-} else {
- scrollbar $w.vsb -orient vertical -command "$w.tree yview"
- scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
-}
+ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview"
+ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
pack $w.container -fill both -expand 1
grid $w.tree $w.vsb -in $w.container -sticky nsew
grid $w.hsb -in $w.container -sticky nsew
grid column $w.container 0 -weight 1
grid row $w.container 0 -weight 1
+image create photo upArrow -data {
+ R0lGODlhDgAOAJEAANnZ2YCAgPz8/P///yH5BAEAAAAALAAAAAAOAA4AAAImhI+
+ py+1LIsJHiBAh+BgmiEAJQITgW6DgUQIAECH4JN8IPqYuNxUAOw==}
+image create photo downArrow -data {
+ R0lGODlhDgAOAJEAANnZ2YCAgPz8/P///yH5BAEAAAAALAAAAAAOAA4AAAInhI+
+ py+1I4ocQ/IgDEYIPgYJICUCE4F+YIBolEoKPEJKZmVJK6ZACADs=}
+image create photo noArrow -height 14 -width 14
+
## The data we're going to insert
set data {
Argentina {Buenos Aires} ARS
@@ -60,11 +62,15 @@ set data {
}
## Code to insert the data nicely
-set font [ttk::style lookup [$w.tree cget -style] -font]
+set font [ttk::style lookup Heading -font]
foreach col {country capital currency} name {Country Capital Currency} {
- $w.tree heading $col -command [list SortBy $w.tree $col 0] -text $name
- $w.tree column $col -width [font measure $font $name]
+ $w.tree heading $col -text $name -image noArrow -anchor w \
+ -command [list SortBy $w.tree $col 0]
+ $w.tree column $col -width [expr {
+ [font measure $font $name] + [image width noArrow] + 5
+ }]
}
+set font [ttk::style lookup Treeview -font]
foreach {country capital currency} $data {
$w.tree insert {} end -values [list $country $capital $currency]
foreach col {country capital currency} {
@@ -77,6 +83,16 @@ foreach {country capital currency} $data {
## Code to do the sorting of the tree contents when clicked on
proc SortBy {tree col direction} {
+ # Determine currently sorted column and its sort direction
+ foreach c {country capital currency} {
+ set s [$tree heading $c state]
+ if {("selected" in $s || "alternate" in $s) && $col ne $c} {
+ # Sorted column has changed
+ $tree heading $c -image noArrow state {!selected !alternate !user1}
+ set direction [expr {"alternate" in $s}]
+ }
+ }
+
# Build something we can sort
set data {}
foreach row [$tree children {}] {
@@ -92,5 +108,12 @@ proc SortBy {tree col direction} {
}
# Switch the heading so that it will sort in the opposite direction
- $tree heading $col -command [list SortBy $tree $col [expr {!$direction}]]
+ $tree heading $col -command [list SortBy $tree $col [expr {!$direction}]] \
+ state [expr {$direction?"!selected alternate":"selected !alternate"}]
+ if {[ttk::style theme use] eq "aqua"} {
+ # Aqua theme displays native sort arrows when user1 state is set
+ $tree heading $col state "user1"
+ } else {
+ $tree heading $col -image [expr {$direction?"upArrow":"downArrow"}]
+ }
}
diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl
index a8f7d17..bd98bf2 100644
--- a/library/demos/msgbox.tcl
+++ b/library/demos/msgbox.tcl
@@ -7,7 +7,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .msgbox
catch {destroy $w}
diff --git a/library/demos/nl.msg b/library/demos/nl.msg
index b17ceaa..61832d8 100644
--- a/library/demos/nl.msg
+++ b/library/demos/nl.msg
@@ -18,7 +18,7 @@
::msgcat::mcset nl "Demo code: %s" "Code van Demo %s"
::msgcat::mcset nl "About Widget Demo" "Over deze demonstratie"
::msgcat::mcset nl "Tk widget demonstration" "Demonstratie van Tk widgets"
-::msgcat::mcset nl "Copyright (c) %s" "Copyright (c) %s"
+::msgcat::mcset nl "Copyright \u00a9 %s"
::msgcat::mcset nl "Tk Widget Demonstrations" "Demostratie van Tk widgets"
::msgcat::mcset nl "This application provides a front end for several short scripts" \
diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl
index 2e3d459..d344d8d 100644
--- a/library/demos/pendulum.tcl
+++ b/library/demos/pendulum.tcl
@@ -49,9 +49,9 @@ for {set i 90} {$i>=0} {incr i -10} {
# Coordinates of these items don't matter; they will be set properly below
$w.k create line 0 0 1 1 -smooth true -tags graph$i -fill grey$i
}
-# FIXME: UNICODE labels
-$w.k create text 0 0 -anchor ne -text "q" -font {Symbol 8} -tags label_theta
-$w.k create text 0 0 -anchor ne -text "dq" -font {Symbol 8} -tags label_dtheta
+
+$w.k create text 0 0 -anchor ne -text "\u03b8" -tags label_theta
+$w.k create text 0 0 -anchor ne -text "\u03b4\u03b8" -tags label_dtheta
pack $w.k -in $w.p.l2 -fill both -expand true
# Initialize some variables
diff --git a/library/demos/rmt b/library/demos/rmt
index 1be4b56..51886de 100644
--- a/library/demos/rmt
+++ b/library/demos/rmt
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# rmt --
# This script implements a simple remote-control mechanism for
diff --git a/library/demos/square b/library/demos/square
index b7dd78f..08c362b 100644
--- a/library/demos/square
+++ b/library/demos/square
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# square --
# This script generates a demo application containing only a "square"
diff --git a/library/demos/tcolor b/library/demos/tcolor
index bd20f7b..6e50c61 100644
--- a/library/demos/tcolor
+++ b/library/demos/tcolor
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# tcolor --
# This script implements a simple color editor, where you can
diff --git a/library/demos/text.tcl b/library/demos/text.tcl
index 21ee096..e1b3a0c 100644
--- a/library/demos/text.tcl
+++ b/library/demos/text.tcl
@@ -17,7 +17,8 @@ wm iconname $w "text"
positionWindow $w
## See Code / Dismiss buttons
-set btns [addSeeDismiss $w.buttons $w]
+set btns [addSeeDismiss $w.buttons $w {} \
+ {ttk::button $w.buttons.fontchooser -command fontchooserToggle}]
pack $btns -side bottom -fill x
text $w.text -yscrollcommand [list $w.scroll set] -setgrid 1 \
@@ -25,6 +26,30 @@ text $w.text -yscrollcommand [list $w.scroll set] -setgrid 1 \
scrollbar $w.scroll -command [list $w.text yview]
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both
+
+# TIP 324 Demo: [tk fontchooser]
+proc fontchooserToggle {} {
+ tk fontchooser [expr {[tk fontchooser configure -visible] ?
+ "hide" : "show"}]
+}
+proc fontchooserVisibility {w} {
+ $w configure -text [expr {[tk fontchooser configure -visible] ?
+ "Hide Font Dialog" : "Show Font Dialog"}]
+}
+proc fontchooserFocus {w} {
+ tk fontchooser configure -font [$w cget -font] \
+ -command [list fontchooserFontSel $w]
+}
+proc fontchooserFontSel {w font args} {
+ $w configure -font [font actual $font]
+}
+tk fontchooser configure -parent $w
+bind $w.text <FocusIn> [list fontchooserFocus $w.text]
+fontchooserVisibility $w.buttons.fontchooser
+bind $w <<TkFontchooserVisibility>> [list \
+ fontchooserVisibility $w.buttons.fontchooser]
+focus $w.text
+
$w.text insert 0.0 \
{This window is a text widget. It displays one or more lines of text
and allows you to edit the text. Here is a summary of the things you
diff --git a/library/demos/timer b/library/demos/timer
index 694227f..e10b840 100644
--- a/library/demos/timer
+++ b/library/demos/timer
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# timer --
# This script generates a counter with start and stop buttons.
diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl
index 541e8ba..e7c87e2 100644
--- a/library/demos/toolbar.tcl
+++ b/library/demos/toolbar.tcl
@@ -7,7 +7,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .toolbar
destroy $w
@@ -16,7 +15,7 @@ wm title $w "Toolbar Demonstration"
wm iconname $w "toolbar"
positionWindow $w
-if {[tk windowingsystem] ne "aqua"} {
+if {[tk windowingsystem] ne {}} {
ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
a toolbar that is styled correctly and which can be torn off. The\
buttons are configured to be \u201Ctoolbar style\u201D buttons by\
@@ -37,7 +36,7 @@ ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
set t [frame $w.toolbar] ;# Must be a frame!
ttk::separator $w.sep
ttk::frame $t.tearoff -cursor fleur
-if {[tk windowingsystem] ne "aqua"} {
+if {[tk windowingsystem] ne {}} {
ttk::separator $t.tearoff.to -orient vertical
ttk::separator $t.tearoff.to2 -orient vertical
pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left
@@ -48,7 +47,7 @@ grid $t.tearoff $t.contents -sticky nsew
grid columnconfigure $t $t.contents -weight 1
grid columnconfigure $t.contents 1000 -weight 1
-if {[tk windowingsystem] ne "aqua"} {
+if {[tk windowingsystem] ne {}} {
## Bindings so that the toolbar can be torn off and reattached
bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y]
bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y]
diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl
index 14d5db8..71c32c1 100644
--- a/library/demos/tree.tcl
+++ b/library/demos/tree.tcl
@@ -8,7 +8,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .tree
catch {destroy $w}
@@ -72,13 +71,8 @@ proc populateTree {tree node} {
## Create the tree and set it up
ttk::treeview $w.tree -columns {fullpath type size} -displaycolumns {size} \
-yscroll "$w.vsb set" -xscroll "$w.hsb set"
-if {[tk windowingsystem] ne "aqua"} {
- ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview"
- ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
-} else {
- scrollbar $w.vsb -orient vertical -command "$w.tree yview"
- scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
-}
+ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview"
+ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview"
$w.tree heading \#0 -text "Directory Structure"
$w.tree heading size -text "File Size"
$w.tree column size -stretch 0 -width 70
diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl
index 66ff1d7..904cd31 100644
--- a/library/demos/ttkbut.tcl
+++ b/library/demos/ttkbut.tcl
@@ -9,7 +9,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .ttkbut
catch {destroy $w}
diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl
index c01c9af..0084dd6 100644
--- a/library/demos/ttkmenu.tcl
+++ b/library/demos/ttkmenu.tcl
@@ -8,7 +8,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .ttkmenu
catch {destroy $w}
diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl
index 5683892..50a9258 100644
--- a/library/demos/ttknote.tcl
+++ b/library/demos/ttknote.tcl
@@ -8,7 +8,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .ttknote
catch {destroy $w}
@@ -53,10 +52,6 @@ ttk::frame $w.note.editor
$w.note add $w.note.editor -text "Text Editor" -underline 0
text $w.note.editor.t -width 40 -height 10 -wrap char \
-yscroll "$w.note.editor.s set"
-if {[tk windowingsystem] ne "aqua"} {
- ttk::scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview"
-} else {
- scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview"
-}
+ttk::scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview"
pack $w.note.editor.s -side right -fill y -padx {0 2} -pady 2
pack $w.note.editor.t -fill both -expand 1 -pady 2 -padx {2 0}
diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl
index a4d5738..7575d76 100644
--- a/library/demos/ttkpane.tcl
+++ b/library/demos/ttkpane.tcl
@@ -7,7 +7,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .ttkpane
catch {destroy $w}
@@ -51,7 +50,7 @@ proc every {delay script} {
uplevel #0 $script
after $delay [list every $delay $script]
}
-set zones {
+set testzones {
:Europe/Berlin
:America/Argentina/Buenos_Aires
:Africa/Johannesburg
@@ -65,7 +64,13 @@ set zones {
}
# Force a pre-load of all the timezones needed; otherwise can end up
# poor-looking synch problems!
-foreach zone $zones {clock format 0 -timezone $zone}
+set zones {}
+foreach zone $testzones {
+ if {![catch {clock format 0 -timezone $zone}]} {
+ lappend zones $zone
+ }
+}
+if {[llength $zones] < 2} { lappend zones -0200 :GMT :UTC +0200 }
foreach zone $zones {
set city [string map {_ " "} [regexp -inline {[^/]+$} $zone]]
if {$i} {
diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl
index 87765d7..8a72cf9 100644
--- a/library/demos/ttkprogress.tcl
+++ b/library/demos/ttkprogress.tcl
@@ -7,7 +7,6 @@ if {![info exists widgetDemo]} {
}
package require Tk
-package require Ttk
set w .ttkprogress
catch {destroy $w}
diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl
index e1d0b5b..8f3c12e 100644
--- a/library/demos/twind.tcl
+++ b/library/demos/twind.tcl
@@ -162,7 +162,7 @@ $t window create end -window $t.smallP
$t insert end "\n\nFinally, images fit comfortably in text widgets too:"
$t image create end -image \
- [image create bitmap -file [file join $tk_demoDirectory images face.xbm]]
+ [image create photo -file [file join $tk_demoDirectory images ouster.png]]
proc textWindBigB w {
diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl
index 11cc933..faa9f90 100644
--- a/library/demos/unicodeout.tcl
+++ b/library/demos/unicodeout.tcl
@@ -9,26 +9,6 @@ if {![info exists widgetDemo]} {
package require Tk
-# On Windows, we need to determine whether the font system will render
-# right-to-left text.
-
-if {[tk windowingsystem] eq {win32}} {
- set rkey [join {
- HKEY_LOCAL_MACHINE
- SOFTWARE
- Microsoft
- {Windows NT}
- CurrentVersion
- LanguagePack
- } \\]
- set w32langs {}
- if {![catch {package require registry}]} {
- if {[catch {registry values $rkey} w32langs]} {
- set w32langs {}
- }
- }
-}
-
set w .unicodeout
catch {destroy $w}
toplevel $w
@@ -50,11 +30,9 @@ pack $w.msg -side top
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x
-pack [label $w.wait -text "Please wait while loading fonts..." \
- -font {Helvetica 12 italic}]
-pack [frame $w.f] -expand 1 -fill both -padx 2m -pady 1m
+## The frame that will contain the sample texts.
+pack [frame $w.f] -side bottom -expand 1 -fill both -padx 2m -pady 1m
grid columnconfigure $w.f 1 -weight 1
-
set i 0
proc addSample {w language args} {
global font i
@@ -66,42 +44,87 @@ proc addSample {w language args} {
grid configure $w.f.l$j -padx 1m
}
-# Processing when some characters are missing might take a while, so make
-# sure we're displaying something in the meantime...
+## A helper procedure that determines what form to use to express languages
+## that have complex rendering rules...
+proc usePresentationFormsFor {language} {
+ switch [tk windowingsystem] {
+ aqua {
+ # OSX wants natural character order; the renderer knows how to
+ # compose things for display for all languages.
+ return false
+ }
+ x11 {
+ # The X11 font renderers that Tk supports all know nothing about
+ # composing characters, so we need to use presentation forms.
+ return true
+ }
+ win32 {
+ # On Windows, we need to determine whether the font system will
+ # render right-to-left text. This varies by language!
+ try {
+ package require registry
+ set rkey [join {
+ HKEY_LOCAL_MACHINE
+ SOFTWARE
+ Microsoft
+ {Windows NT}
+ CurrentVersion
+ LanguagePack
+ } \\]
+ return [expr {
+ [string toupper $language] ni [registry values $rkey]
+ }]
+ } trap error {} {
+ # Cannot work it out, so use presentation forms.
+ return true
+ }
+ }
+ default {
+ # Default to using presentation forms.
+ return true
+ }
+ }
+}
+## Processing when some characters are not currently cached by the display
+## engine might take a while, so make sure we're displaying something in the
+## meantime...
+pack [label $w.wait -text "Please wait while loading fonts..." \
+ -font {Helvetica 12 italic}]
set oldCursor [$w cget -cursor]
$w conf -cursor watch
update
-if {[tk windowingsystem] eq {x11}
- || (([tk windowingsystem] eq {win32}) && ({ARABIC} ni $w32langs))} {
+## Add the samples...
+if {[usePresentationFormsFor Arabic]} {
# Using presentation forms (pre-layouted)
addSample $w Arabic \
- "\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D " \
- "\uFE94\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D"
+ "\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D " \
+ "\uFE94\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D"
} else {
# Using standard text characters
addSample $w Arabic \
- "\u0627\u0644\u0643\u0644\u0645\u0629 " \
- "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"
+ "\u0627\u0644\u0643\u0644\u0645\u0629 " \
+ "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"
}
-addSample $w "Trad. Chinese" "\u4E2D\u570B\u7684\u6F22\u5B57"
+addSample $w "Trad. Chinese" "\u4E2D\u570B\u7684\u6F22\u5B57"
addSample $w "Simpl. Chinese" "\u6C49\u8BED"
+addSample $w French "Langue fran\u00E7aise"
addSample $w Greek \
"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE " \
"\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1"
-if {[tk windowingsystem] eq {x11}
- || (([tk windowingsystem] eq {win32}) && ({HEBREW} ni $w32langs))} {
+if {[usePresentationFormsFor Hebrew]} {
# Visual order (pre-layouted)
addSample $w Hebrew \
- "\u05EA\u05D9\u05E8\u05D1\u05E2 " \
- "\u05D1\u05EA\u05DB"
+ "\u05EA\u05D9\u05E8\u05D1\u05E2 \u05D1\u05EA\u05DB"
} else {
# Standard logical order
addSample $w Hebrew \
- "\u05DB\u05EA\u05D1 " \
- "\u05E2\u05D1\u05E8\u05D9\u05EA"
+ "\u05DB\u05EA\u05D1 \u05E2\u05D1\u05E8\u05D9\u05EA"
}
+addSample $w Hindi \
+ "\u0939\u093f\u0928\u094d\u0926\u0940 \u092d\u093e\u0937\u093e"
+addSample $w Icelandic "\u00CDslenska"
addSample $w Japanese \
"\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, " \
"\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA"
@@ -109,6 +132,6 @@ addSample $w Korean "\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00"
addSample $w Russian \
"\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A"
-# We're done processing, so change things back to normal running...
+## We're done processing, so change things back to normal running...
destroy $w.wait
$w conf -cursor $oldCursor
diff --git a/library/demos/widget b/library/demos/widget
index 7dd8ab3..8b92f9a 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# widget --
# This script demonstrates the various widgets provided by Tk, along with many
@@ -13,7 +13,6 @@ exec wish "$0" "$@"
package require Tcl 8.5
package require Tk 8.5
package require msgcat
-package require Ttk
eval destroy [winfo child .]
set tk_demoDirectory [file join [pwd] [file dirname [info script]]]
@@ -318,16 +317,13 @@ addFormattedText {
@@demo image1 Two labels displaying images
@@demo image2 A simple user interface for viewing images
@@demo labelframe Labelled frames
- @@new
@@demo ttkbut The simple Themed Tk widgets
@@subtitle Listboxes and Trees
@@demo states The 50 states
@@demo colors Colors: change the color scheme for the application
@@demo sayings A collection of famous and infamous sayings
- @@new
@@demo mclist A multi-column list of countries
- @@new
@@demo tree A directory browser tree
@@subtitle Entries, Spin-boxes and Combo-boxes
@@ -335,7 +331,6 @@ addFormattedText {
@@demo entry2 Entries with scrollbars
@@demo entry3 Validated entries and password fields
@@demo spin Spin-boxes
- @@new
@@demo combo Combo-boxes
@@demo form Simple Rolodex-like form
@@ -345,7 +340,6 @@ addFormattedText {
@@demo bind Hypertext (tag bindings)
@@demo twind A text widget with embedded windows and other features
@@demo search A search tool built with a text widget
- @@new
@@demo textpeer Peering text widgets
@@subtitle Canvases
@@ -356,7 +350,6 @@ addFormattedText {
@@demo ruler A ruler with adjustable tab stops
@@demo floor A building floor plan
@@demo cscroll A simple scrollable canvas
- @@new
@@demo knightstour A Knight's tour of the chess board
@@subtitle Scales and Progress Bars
@@ -364,38 +357,30 @@ addFormattedText {
@@demo vscale Vertical scale
@@new
@@demo ttkscale Themed scale linked to a label with traces
- @@new
@@demo ttkprogress Progress bar
@@subtitle Paned Windows and Notebooks
@@demo paned1 Horizontal paned window
@@demo paned2 Vertical paned window
- @@new
@@demo ttkpane Themed nested panes
- @@new
@@demo ttknote Notebook widget
@@subtitle Menus and Toolbars
@@demo menu Menus and cascades (sub-menus)
@@demo menubu Menu-buttons
- @@new
@@demo ttkmenu Themed menu buttons
- @@new
@@demo toolbar Themed toolbar
@@subtitle Common Dialogs
@@demo msgbox Message boxes
@@demo filebox File selection dialog
@@demo clrpick Color picker
+ @@demo fontchoose Font selection dialog
@@subtitle Animation
- @@new
@@demo anilabel Animated labels
- @@new
@@demo aniwave Animated wave
- @@new
@@demo pendulum Pendulum simulation
- @@new
@@demo goldberg A celebration of Rube Goldberg
@@subtitle Miscellaneous
@@ -724,10 +709,10 @@ proc PrintTextWin32 {filename} {
proc tkAboutDialog {} {
tk_messageBox -icon info -type ok -title [mc "About Widget Demo"] \
-message [mc "Tk widget demonstration application"] -detail \
-"[mc {Copyright (c) %s} {1996-1997 Sun Microsystems, Inc.}]
-[mc {Copyright (c) %s} {1997-2000 Ajuba Solutions, Inc.}]
-[mc {Copyright (c) %s} {2001-2007 Donal K. Fellows}]
-[mc {Copyright (c) %s} {2002-2007 Daniel A. Steffen}]"
+"[mc "Copyright \u00a9 %s" {1996-1997 Sun Microsystems, Inc.}]
+[mc "Copyright \u00a9 %s" {1997-2000 Ajuba Solutions, Inc.}]
+[mc "Copyright \u00a9 %s" {2001-2009 Donal K. Fellows}]
+[mc "Copyright \u00a9 %s" {2002-2007 Daniel A. Steffen}]"
}
# Local Variables:
diff --git a/library/dialog.tcl b/library/dialog.tcl
index abe142b..1ae5b8a 100644
--- a/library/dialog.tcl
+++ b/library/dialog.tcl
@@ -136,7 +136,7 @@ proc ::tk_dialog {w title text bitmap default args} {
bind $w <Return> [list $w.button$default invoke]
}
bind $w <<PrevWindow>> [list bind $w <Return> {[tk_focusPrev %W] invoke}]
- bind $w <Tab> [list bind $w <Return> {[tk_focusNext %W] invoke}]
+ bind $w <<NextWindow>> [list bind $w <Return> {[tk_focusNext %W] invoke}]
# 5. Create a <Destroy> binding for the window that sets the
# button variable to -1; this is needed in case something happens
diff --git a/library/entry.tcl b/library/entry.tcl
index 54f2136..69480eb 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -119,45 +119,45 @@ bind Entry <Control-1> {
%W icursor @%x
}
-bind Entry <Left> {
+bind Entry <<PrevChar>> {
tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
}
-bind Entry <Right> {
+bind Entry <<NextChar>> {
tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
}
-bind Entry <Shift-Left> {
+bind Entry <<SelectPrevChar>> {
tk::EntryKeySelect %W [expr {[%W index insert] - 1}]
tk::EntrySeeInsert %W
}
-bind Entry <Shift-Right> {
+bind Entry <<SelectNextChar>> {
tk::EntryKeySelect %W [expr {[%W index insert] + 1}]
tk::EntrySeeInsert %W
}
-bind Entry <Control-Left> {
+bind Entry <<PrevWord>> {
tk::EntrySetCursor %W [tk::EntryPreviousWord %W insert]
}
-bind Entry <Control-Right> {
+bind Entry <<NextWord>> {
tk::EntrySetCursor %W [tk::EntryNextWord %W insert]
}
-bind Entry <Shift-Control-Left> {
+bind Entry <<SelectPrevWord>> {
tk::EntryKeySelect %W [tk::EntryPreviousWord %W insert]
tk::EntrySeeInsert %W
}
-bind Entry <Shift-Control-Right> {
+bind Entry <<SelectNextWord>> {
tk::EntryKeySelect %W [tk::EntryNextWord %W insert]
tk::EntrySeeInsert %W
}
-bind Entry <Home> {
+bind Entry <<LineStart>> {
tk::EntrySetCursor %W 0
}
-bind Entry <Shift-Home> {
+bind Entry <<SelectLineStart>> {
tk::EntryKeySelect %W 0
tk::EntrySeeInsert %W
}
-bind Entry <End> {
+bind Entry <<LineEnd>> {
tk::EntrySetCursor %W end
}
-bind Entry <Shift-End> {
+bind Entry <<SelectLineEnd>> {
tk::EntryKeySelect %W end
tk::EntrySeeInsert %W
}
@@ -208,9 +208,14 @@ bind Entry <Escape> {# nothing}
bind Entry <Return> {# nothing}
bind Entry <KP_Enter> {# nothing}
bind Entry <Tab> {# nothing}
+bind Entry <Prior> {# nothing}
+bind Entry <Next> {# nothing}
if {[tk windowingsystem] eq "aqua"} {
bind Entry <Command-KeyPress> {# nothing}
}
+# Tk-on-Cocoa generates characters for these two keys. [Bug 2971663]
+bind Entry <Down> {# nothing}
+bind Entry <Up> {# 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.
diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl
new file mode 100644
index 0000000..13b5895
--- /dev/null
+++ b/library/fontchooser.tcl
@@ -0,0 +1,442 @@
+# fontchooser.tcl -
+#
+# A themeable Tk font selection dialog. See TIP #324.
+#
+# Copyright (C) 2008 Keith Vetter
+# Copyright (C) 2008 Pat Thoyts <patthoyts@users.sourceforge.net>
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+namespace eval ::tk::fontchooser {
+ variable S
+
+ set S(W) .__tk__fontchooser
+ set S(fonts) [lsort -dictionary [font families]]
+ set S(styles) [list \
+ [::msgcat::mc "Regular"] \
+ [::msgcat::mc "Italic"] \
+ [::msgcat::mc "Bold"] \
+ [::msgcat::mc "Bold Italic"] \
+ ]
+
+ set S(sizes) {8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72}
+ set S(strike) 0
+ set S(under) 0
+ set S(first) 1
+ set S(sampletext) [::msgcat::mc "AaBbYyZz01"]
+ set S(-parent) .
+ set S(-title) [::msgcat::mc "Font"]
+ set S(-command) ""
+ set S(-font) TkDefaultFont
+
+ # Canonical versions of font families, styles, etc. for easier searching
+ set S(fonts,lcase) {}
+ foreach font $S(fonts) { lappend S(fonts,lcase) [string tolower $font]}
+ set S(styles,lcase) {}
+ foreach style $S(styles) { lappend S(styles,lcase) [string tolower $style]}
+ set S(sizes,lcase) $S(sizes)
+
+ ::ttk::style layout FontchooserFrame {
+ Entry.field -sticky news -border true -children {
+ FontchooserFrame.padding -sticky news
+ }
+ }
+ bind [winfo class .] <<ThemeChanged>> \
+ [list +ttk::style layout FontchooserFrame \
+ [ttk::style layout FontchooserFrame]]
+
+ namespace ensemble create -map {
+ show ::tk::fontchooser::Show
+ hide ::tk::fontchooser::Hide
+ configure ::tk::fontchooser::Configure
+ }
+}
+
+proc ::tk::fontchooser::Show {} {
+ variable S
+ if {![winfo exists $S(W)]} {
+ Create
+ wm transient $S(W) [winfo toplevel $S(-parent)]
+ tk::PlaceWindow $S(W) widget $S(-parent)
+ }
+ wm deiconify $S(W)
+}
+
+proc ::tk::fontchooser::Hide {} {
+ variable S
+ wm withdraw $S(W)
+}
+
+proc ::tk::fontchooser::Configure {args} {
+ variable S
+
+ set specs {
+ {-parent "" "" . }
+ {-title "" "" ""}
+ {-font "" "" ""}
+ {-command "" "" ""}
+ }
+
+ if {[llength $args] == 0} {
+ set result {}
+ foreach spec $specs {
+ foreach {name xx yy default} $spec break
+ lappend result $name \
+ [expr {[info exists S($name)] ? $S($name) : $default}]
+ }
+ lappend result -visible \
+ [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}]
+ return $result
+ }
+ if {[llength $args] == 1} {
+ set option [lindex $args 0]
+ if {[string equal $option "-visible"]} {
+ return [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}]
+ } elseif {[info exists S($option)]} {
+ return $S($option)
+ }
+ return -code error "bad option \"$option\": must be\
+ -command, -font, -parent, -title or -visible"
+ }
+
+ set cache [dict create -parent $S(-parent) -title $S(-title) \
+ -font $S(-font) -command $S(-command)]
+ set r [tclParseConfigSpec [namespace which -variable S] $specs "" $args]
+ if {![winfo exists $S(-parent)]} {
+ set err "bad window path name \"$S(-parent)\""
+ array set S $cache
+ return -code error $err
+ }
+ if {[string trim $S(-title)] eq ""} {
+ set S(-title) [::msgcat::mc "Font"]
+ }
+ if {[winfo exists $S(W)] && [lsearch $args -font] != -1} {
+ Init $S(-font)
+ event generate $S(-parent) <<TkFontchooserFontChanged>>
+ }
+ return $r
+}
+
+proc ::tk::fontchooser::Create {} {
+ variable S
+ set windowName __tk__fontchooser
+ if {$S(-parent) eq "."} {
+ set S(W) .$windowName
+ } else {
+ set S(W) $S(-parent).$windowName
+ }
+
+ # Now build the dialog
+ if {![winfo exists $S(W)]} {
+ toplevel $S(W) -class TkFontDialog
+ if {[package provide tcltest] ne {}} {set ::tk_dialog $S(W)}
+ wm withdraw $S(W)
+ wm title $S(W) $S(-title)
+ wm transient $S(W) [winfo toplevel $S(-parent)]
+
+ set outer [::ttk::frame $S(W).outer -padding {10 10}]
+ ::tk::AmpWidget ::ttk::label $S(W).font -text [::msgcat::mc "&Font:"]
+ ::tk::AmpWidget ::ttk::label $S(W).style -text [::msgcat::mc "Font st&yle:"]
+ ::tk::AmpWidget ::ttk::label $S(W).size -text [::msgcat::mc "&Size:"]
+ ttk::entry $S(W).efont -width 18 \
+ -textvariable [namespace which -variable S](font)
+ ttk::entry $S(W).estyle -width 10 \
+ -textvariable [namespace which -variable S](style)
+ ttk::entry $S(W).esize -textvariable [namespace which -variable S](size) \
+ -width 3 -validate key -validatecommand {string is double %P}
+
+ ttk_slistbox $S(W).lfonts -height 7 -exportselection 0 \
+ -selectmode browse -activestyle none \
+ -listvariable [namespace which -variable S](fonts)
+ ttk_slistbox $S(W).lstyles -width 5 -height 7 -exportselection 0 \
+ -selectmode browse -activestyle none \
+ -listvariable [namespace which -variable S](styles)
+ ttk_slistbox $S(W).lsizes -width 4 -height 7 -exportselection 0 \
+ -selectmode browse -activestyle none \
+ -listvariable [namespace which -variable S](sizes)
+
+ set WE $S(W).effects
+ ::ttk::labelframe $WE -text [::msgcat::mc "Effects"]
+ ::tk::AmpWidget ::ttk::checkbutton $WE.strike \
+ -variable [namespace which -variable S](strike) \
+ -text [::msgcat::mc "Stri&keout"] \
+ -command [namespace code [list Click strike]]
+ ::tk::AmpWidget ::ttk::checkbutton $WE.under \
+ -variable [namespace which -variable S](under) \
+ -text [::msgcat::mc "&Underline"] \
+ -command [namespace code [list Click under]]
+
+ set bbox [::ttk::frame $S(W).bbox]
+ ::ttk::button $S(W).ok -text [::msgcat::mc OK] -default active\
+ -command [namespace code [list Done 1]]
+ ::ttk::button $S(W).cancel -text [::msgcat::mc Cancel] \
+ -command [namespace code [list Done 0]]
+ ::tk::AmpWidget ::ttk::button $S(W).apply -text [::msgcat::mc "&Apply"] \
+ -command [namespace code [list Apply]]
+ wm protocol $S(W) WM_DELETE_WINDOW [namespace code [list Done 0]]
+
+ # Calculate minimum sizes
+ ttk::scrollbar $S(W).tmpvs
+ set scroll_width [winfo reqwidth $S(W).tmpvs]
+ destroy $S(W).tmpvs
+ set minsize(gap) 10
+ set minsize(bbox) [winfo reqwidth $S(W).ok]
+ set minsize(fonts) \
+ [expr {[font measure TkDefaultFont "Helvetica"] + $scroll_width}]
+ set minsize(styles) \
+ [expr {[font measure TkDefaultFont "Bold Italic"] + $scroll_width}]
+ set minsize(sizes) \
+ [expr {[font measure TkDefaultFont "-99"] + $scroll_width}]
+ set min [expr {$minsize(gap) * 4}]
+ foreach {what width} [array get minsize] { incr min $width }
+ wm minsize $S(W) $min 260
+
+ bind $S(W) <Return> [namespace code [list Done 1]]
+ bind $S(W) <Escape> [namespace code [list Done 0]]
+ bind $S(W) <Map> [namespace code [list Visibility %W 1]]
+ bind $S(W) <Unmap> [namespace code [list Visibility %W 0]]
+ bind $S(W) <Destroy> [namespace code [list Visibility %W 0]]
+ bind $S(W).lfonts.list <<ListboxSelect>> [namespace code [list Click font]]
+ bind $S(W).lstyles.list <<ListboxSelect>> [namespace code [list Click style]]
+ bind $S(W).lsizes.list <<ListboxSelect>> [namespace code [list Click size]]
+ bind $S(W) <Alt-Key> [list ::tk::AltKeyInDialog $S(W) %A]
+ bind $S(W).font <<AltUnderlined>> [list ::focus $S(W).efont]
+ bind $S(W).style <<AltUnderlined>> [list ::focus $S(W).estyle]
+ bind $S(W).size <<AltUnderlined>> [list ::focus $S(W).esize]
+ bind $S(W).apply <<AltUnderlined>> [namespace code [list Apply]]
+ bind $WE.strike <<AltUnderlined>> [list $WE.strike invoke]
+ bind $WE.under <<AltUnderlined>> [list $WE.under invoke]
+
+ set WS $S(W).sample
+ ::ttk::labelframe $WS -text [::msgcat::mc "Sample"]
+ ::ttk::label $WS.sample -relief sunken -anchor center \
+ -textvariable [namespace which -variable S](sampletext)
+ set S(sample) $WS.sample
+ grid $WS.sample -sticky news -padx 6 -pady 4
+ grid rowconfigure $WS 0 -weight 1
+ grid columnconfigure $WS 0 -weight 1
+ grid propagate $WS 0
+
+ grid $S(W).ok -in $bbox -sticky new -pady {0 2}
+ grid $S(W).cancel -in $bbox -sticky new -pady 2
+ if {$S(-command) ne ""} {
+ grid $S(W).apply -in $bbox -sticky new -pady 2
+ }
+ grid columnconfigure $bbox 0 -weight 1
+
+ grid $WE.strike -sticky w -padx 10
+ grid $WE.under -sticky w -padx 10 -pady {0 30}
+ grid columnconfigure $WE 1 -weight 1
+
+ grid $S(W).font x $S(W).style x $S(W).size x -in $outer -sticky w
+ grid $S(W).efont x $S(W).estyle x $S(W).esize x $bbox -in $outer -sticky ew
+ grid $S(W).lfonts x $S(W).lstyles x $S(W).lsizes x ^ -in $outer -sticky news
+ grid $WE x $WS - - x ^ -in $outer -sticky news -pady {15 30}
+ grid configure $bbox -sticky n
+ grid columnconfigure $outer {1 3 5} -minsize $minsize(gap)
+ grid columnconfigure $outer {0 2 4} -weight 1
+ grid columnconfigure $outer 0 -minsize $minsize(fonts)
+ grid columnconfigure $outer 2 -minsize $minsize(styles)
+ grid columnconfigure $outer 4 -minsize $minsize(sizes)
+ grid columnconfigure $outer 6 -minsize $minsize(bbox)
+
+ grid $outer -sticky news
+ grid rowconfigure $S(W) 0 -weight 1
+ grid columnconfigure $S(W) 0 -weight 1
+
+ Init $S(-font)
+
+ trace add variable [namespace which -variable S](size) \
+ write [namespace code [list Tracer]]
+ trace add variable [namespace which -variable S](style) \
+ write [namespace code [list Tracer]]
+ trace add variable [namespace which -variable S](font) \
+ write [namespace code [list Tracer]]
+ } else {
+ Init $S(-font)
+ }
+
+ return
+}
+
+# ::tk::fontchooser::Done --
+#
+# Handles teardown of the dialog, calling -command if needed
+#
+# Arguments:
+# ok true if user pressed OK
+#
+proc ::tk::::fontchooser::Done {ok} {
+ variable S
+
+ if {! $ok} {
+ set S(result) ""
+ }
+ trace vdelete S(size) w [namespace code [list Tracer]]
+ trace vdelete S(style) w [namespace code [list Tracer]]
+ trace vdelete S(font) w [namespace code [list Tracer]]
+ destroy $S(W)
+ if {$ok && $S(-command) ne ""} {
+ uplevel #0 $S(-command) [list $S(result)]
+ }
+}
+
+# ::tk::fontchooser::Apply --
+#
+# Call the -command procedure appending the current font
+# Errors are reported via the background error mechanism
+#
+proc ::tk::fontchooser::Apply {} {
+ variable S
+ if {$S(-command) ne ""} {
+ if {[catch {uplevel #0 $S(-command) [list $S(result)]} err]} {
+ ::bgerror $err
+ }
+ }
+ event generate $S(-parent) <<TkFontchooserFontChanged>>
+}
+
+# ::tk::fontchooser::Init --
+#
+# Initializes dialog to a default font
+#
+# Arguments:
+# defaultFont font to use as the default
+#
+proc ::tk::fontchooser::Init {{defaultFont ""}} {
+ variable S
+
+ if {$S(first) || $defaultFont ne ""} {
+ if {$defaultFont eq ""} {
+ set defaultFont [[entry .___e] cget -font]
+ destroy .___e
+ }
+ array set F [font actual $defaultFont]
+ set S(font) $F(-family)
+ set S(size) $F(-size)
+ set S(strike) $F(-overstrike)
+ set S(under) $F(-underline)
+ set S(style) "Regular"
+ if {$F(-weight) eq "bold" && $F(-slant) eq "italic"} {
+ set S(style) "Bold Italic"
+ } elseif {$F(-weight) eq "bold"} {
+ set S(style) "Bold"
+ } elseif {$F(-slant) eq "italic"} {
+ set S(style) "Italic"
+ }
+
+ set S(first) 0
+ }
+
+ Tracer a b c
+ Update
+}
+
+# ::tk::fontchooser::Click --
+#
+# Handles all button clicks, updating the appropriate widgets
+#
+# Arguments:
+# who which widget got pressed
+#
+proc ::tk::fontchooser::Click {who} {
+ variable S
+
+ if {$who eq "font"} {
+ set S(font) [$S(W).lfonts get [$S(W).lfonts curselection]]
+ } elseif {$who eq "style"} {
+ set S(style) [$S(W).lstyles get [$S(W).lstyles curselection]]
+ } elseif {$who eq "size"} {
+ set S(size) [$S(W).lsizes get [$S(W).lsizes curselection]]
+ }
+ Update
+}
+
+# ::tk::fontchooser::Tracer --
+#
+# Handles traces on key variables, updating the appropriate widgets
+#
+# Arguments:
+# standard trace arguments (not used)
+#
+proc ::tk::fontchooser::Tracer {var1 var2 op} {
+ variable S
+
+ set bad 0
+ set nstate normal
+ # Make selection in each listbox
+ foreach var {font style size} {
+ set value [string tolower $S($var)]
+ $S(W).l${var}s selection clear 0 end
+ set n [lsearch -exact $S(${var}s,lcase) $value]
+ $S(W).l${var}s selection set $n
+ if {$n != -1} {
+ set S($var) [lindex $S(${var}s) $n]
+ $S(W).e$var icursor end
+ $S(W).e$var selection clear
+ } else { ;# No match, try prefix
+ # Size is weird: valid numbers are legal but don't display
+ # unless in the font size list
+ set n [lsearch -glob $S(${var}s,lcase) "$value*"]
+ set bad 1
+ if {$var ne "size" || ! [string is double -strict $value]} {
+ set nstate disabled
+ }
+ }
+ $S(W).l${var}s see $n
+ }
+ if {!$bad} { Update }
+ $S(W).ok configure -state $nstate
+}
+
+# ::tk::fontchooser::Update --
+#
+# Shows a sample of the currently selected font
+#
+proc ::tk::fontchooser::Update {} {
+ variable S
+
+ set S(result) [list $S(font) $S(size)]
+ if {$S(style) eq "Bold"} { lappend S(result) bold }
+ if {$S(style) eq "Italic"} { lappend S(result) italic }
+ if {$S(style) eq "Bold Italic"} { lappend S(result) bold italic}
+ if {$S(strike)} { lappend S(result) overstrike}
+ if {$S(under)} { lappend S(result) underline}
+
+ $S(sample) configure -font $S(result)
+}
+
+# ::tk::fontchooser::Visibility --
+#
+# Notify the parent when the dialog visibility changes
+#
+proc ::tk::fontchooser::Visibility {w visible} {
+ variable S
+ if {$w eq $S(W)} {
+ event generate $S(-parent) <<TkFontchooserVisibility>>
+ }
+}
+
+# ::tk::fontchooser::ttk_listbox --
+#
+# Create a properly themed scrolled listbox.
+# This is exactly right on XP but may need adjusting on other platforms.
+#
+proc ::tk::fontchooser::ttk_slistbox {w args} {
+ set f [ttk::frame $w -style FontchooserFrame -padding 2]
+ if {[catch {
+ listbox $f.list -relief flat -highlightthickness 0 -borderwidth 0 {*}$args
+ ttk::scrollbar $f.vs -command [list $f.list yview]
+ $f.list configure -yscrollcommand [list $f.vs set]
+ grid $f.list $f.vs -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+ interp hide {} $w
+ interp alias {} $w {} $f.list
+ } err]} {
+ destroy $f
+ return -code error $err
+ }
+ return $w
+}
diff --git a/library/iconlist.tcl b/library/iconlist.tcl
new file mode 100644
index 0000000..fc8128d
--- /dev/null
+++ b/library/iconlist.tcl
@@ -0,0 +1,694 @@
+# iconlist.tcl
+#
+# Implements the icon-list megawidget used in the "Tk" standard file
+# selection dialog boxes.
+#
+# Copyright (c) 1994-1998 Sun Microsystems, Inc.
+# Copyright (c) 2009 Donal K. Fellows
+#
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# API Summary:
+# tk::IconList <path> ?<option> <value>? ...
+# <path> add <imageName> <itemList>
+# <path> cget <option>
+# <path> configure ?<option>? ?<value>? ...
+# <path> deleteall
+# <path> destroy
+# <path> get <itemIndex>
+# <path> index <index>
+# <path> invoke
+# <path> see <index>
+# <path> selection anchor ?<int>?
+# <path> selection clear <first> ?<last>?
+# <path> selection get
+# <path> selection includes <item>
+# <path> selection set <first> ?<last>?
+
+package require Tk 8.6
+
+::tk::Megawidget create ::tk::IconList ::tk::FocusableWidget {
+ variable w canvas sbar accel accelCB fill font index \
+ itemList itemsPerColumn list maxIH maxIW maxTH maxTW noScroll \
+ numItems oldX oldY options rect selected selection textList
+ constructor args {
+ next {*}$args
+ set accelCB {}
+ }
+ destructor {
+ my Reset
+ next
+ }
+
+ method GetSpecs {} {
+ concat [next] {
+ {-command "" "" ""}
+ {-font "" "" "TkIconFont"}
+ {-multiple "" "" "0"}
+ }
+ }
+
+ # ----------------------------------------------------------------------
+
+ method index i {
+ if {![info exist list]} {
+ set list {}
+ }
+ switch -regexp -- $i {
+ "^-?[0-9]+$" {
+ if {$i < 0} {
+ set i 0
+ }
+ if {$i >= [llength $list]} {
+ set i [expr {[llength $list] - 1}]
+ }
+ return $i
+ }
+ "^anchor$" {
+ return $index(anchor)
+ }
+ "^end$" {
+ return [llength $list]
+ }
+ "@-?[0-9]+,-?[0-9]+" {
+ scan $i "@%d,%d" x y
+ set item [$canvas find closest \
+ [$canvas canvasx $x] [$canvas canvasy $y]]
+ return [lindex [$canvas itemcget $item -tags] 1]
+ }
+ }
+ }
+
+ method selection {op args} {
+ switch -exact -- $op {
+ anchor {
+ if {[llength $args] == 1} {
+ set index(anchor) [$w index [lindex $args 0]]
+ } else {
+ return $index(anchor)
+ }
+ }
+ clear {
+ switch [llength $args] {
+ 2 {
+ lassign $args first last
+ }
+ 1 {
+ set first [set last [lindex $args 0]]
+ }
+ default {
+ return -code error "wrong # args: should be\
+ \"[lrange [info level 0] 0 1] first ?last?\""
+ }
+ }
+
+ set first [$w index $first]
+ set last [$w index $last]
+ if {$first > $last} {
+ set tmp $first
+ set first $last
+ set last $tmp
+ }
+ set ind 0
+ foreach item $selection {
+ if {$item >= $first} {
+ set first $ind
+ break
+ }
+ incr ind
+ }
+ set ind [expr {[llength $selection] - 1}]
+ for {} {$ind >= 0} {incr ind -1} {
+ set item [lindex $selection $ind]
+ if {$item <= $last} {
+ set last $ind
+ break
+ }
+ }
+
+ if {$first > $last} {
+ return
+ }
+ set selection [lreplace $selection $first $last]
+ event generate $w <<ListboxSelect>>
+ my DrawSelection
+ }
+ get {
+ return $selection
+ }
+ includes {
+ return [expr {[lindex $args 0] in $selection}]
+ }
+ set {
+ switch [llength $args] {
+ 2 {
+ lassign $args first last
+ }
+ 1 {
+ set first [set last [lindex $args 0]]
+ }
+ default {
+ return -code error "wrong # args: should be\
+ \"[lrange [info level 0] 0 1] first ?last?\""
+ }
+ }
+
+ set first [$w index $first]
+ set last [$w index $last]
+ if {$first > $last} {
+ set tmp $first
+ set first $last
+ set last $tmp
+ }
+
+ for {set i $first} {$i <= $last} {incr i} {
+ lappend selection $i
+ }
+ set selection [lsort -integer -unique $selection]
+ event generate $w <<ListboxSelect>>
+ my DrawSelection
+ }
+ }
+ }
+
+ method get item {
+ set rTag [lindex $list $item 2]
+ lassign $itemList($rTag) iTag tTag text serial
+ return $text
+ }
+
+ # Deletes all the items inside the canvas subwidget and reset the
+ # iconList's state.
+ #
+ method deleteall {} {
+ $canvas delete all
+ unset -nocomplain selected rect list itemList
+ set maxIW 1
+ set maxIH 1
+ set maxTW 1
+ set maxTH 1
+ set numItems 0
+ set noScroll 1
+ set selection {}
+ set index(anchor) ""
+ $sbar set 0.0 1.0
+ $canvas xview moveto 0
+ }
+
+ # Adds an icon into the IconList with the designated image and text
+ #
+ method add {image items} {
+ foreach text $items {
+ set iID item$numItems
+ set iTag [$canvas create image 0 0 -image $image -anchor nw \
+ -tags [list icon $numItems $iID]]
+ set tTag [$canvas create text 0 0 -text $text -anchor nw \
+ -font $options(-font) -fill $fill \
+ -tags [list text $numItems $iID]]
+ set rTag [$canvas create rect 0 0 0 0 -fill "" -outline "" \
+ -tags [list rect $numItems $iID]]
+
+ lassign [$canvas bbox $iTag] x1 y1 x2 y2
+ set iW [expr {$x2 - $x1}]
+ set iH [expr {$y2 - $y1}]
+ if {$maxIW < $iW} {
+ set maxIW $iW
+ }
+ if {$maxIH < $iH} {
+ set maxIH $iH
+ }
+
+ lassign [$canvas bbox $tTag] x1 y1 x2 y2
+ set tW [expr {$x2 - $x1}]
+ set tH [expr {$y2 - $y1}]
+ if {$maxTW < $tW} {
+ set maxTW $tW
+ }
+ if {$maxTH < $tH} {
+ set maxTH $tH
+ }
+
+ lappend list [list $iTag $tTag $rTag $iW $iH $tW $tH $numItems]
+ set itemList($rTag) [list $iTag $tTag $text $numItems]
+ set textList($numItems) [string tolower $text]
+ incr numItems
+ }
+ my WhenIdle Arrange
+ return
+ }
+
+ # Gets called when the user invokes the IconList (usually by
+ # double-clicking or pressing the Return key).
+ #
+ method invoke {} {
+ if {$options(-command) ne "" && [llength $selection]} {
+ uplevel #0 $options(-command)
+ }
+ }
+
+ # If the item is not (completely) visible, scroll the canvas so that it
+ # becomes visible.
+ #
+ method see rTag {
+ if {$noScroll} {
+ return
+ }
+ set sRegion [$canvas cget -scrollregion]
+ if {$sRegion eq ""} {
+ return
+ }
+
+ if {$rTag < 0 || $rTag >= [llength $list]} {
+ return
+ }
+
+ set bbox [$canvas bbox item$rTag]
+ set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -bd]}]
+
+ set x1 [lindex $bbox 0]
+ set x2 [lindex $bbox 2]
+ incr x1 [expr {$pad * -2}]
+ incr x2 [expr {$pad * -1}]
+
+ set cW [expr {[winfo width $canvas] - $pad*2}]
+
+ set scrollW [expr {[lindex $sRegion 2]-[lindex $sRegion 0]+1}]
+ set dispX [expr {int([lindex [$canvas xview] 0]*$scrollW)}]
+ set oldDispX $dispX
+
+ # check if out of the right edge
+ #
+ if {($x2 - $dispX) >= $cW} {
+ set dispX [expr {$x2 - $cW}]
+ }
+ # check if out of the left edge
+ #
+ if {($x1 - $dispX) < 0} {
+ set dispX $x1
+ }
+
+ if {$oldDispX ne $dispX} {
+ set fraction [expr {double($dispX) / double($scrollW)}]
+ $canvas xview moveto $fraction
+ }
+ }
+
+ # ----------------------------------------------------------------------
+
+ # Places the icons in a column-major arrangement.
+ #
+ method Arrange {} {
+ if {![info exists list]} {
+ if {[info exists canvas] && [winfo exists $canvas]} {
+ set noScroll 1
+ $sbar configure -command ""
+ }
+ return
+ }
+
+ set W [winfo width $canvas]
+ set H [winfo height $canvas]
+ set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -bd]}]
+ if {$pad < 2} {
+ set pad 2
+ }
+
+ incr W [expr {$pad*-2}]
+ incr H [expr {$pad*-2}]
+
+ set dx [expr {$maxIW + $maxTW + 8}]
+ if {$maxTH > $maxIH} {
+ set dy $maxTH
+ } else {
+ set dy $maxIH
+ }
+ incr dy 2
+ set shift [expr {$maxIW + 4}]
+
+ set x [expr {$pad * 2}]
+ set y [expr {$pad * 1}] ; # Why * 1 ?
+ set usedColumn 0
+ foreach sublist $list {
+ set usedColumn 1
+ lassign $sublist iTag tTag rTag iW iH tW tH
+
+ set i_dy [expr {($dy - $iH)/2}]
+ set t_dy [expr {($dy - $tH)/2}]
+
+ $canvas coords $iTag $x [expr {$y + $i_dy}]
+ $canvas coords $tTag [expr {$x + $shift}] [expr {$y + $t_dy}]
+ $canvas coords $rTag $x $y [expr {$x+$dx}] [expr {$y+$dy}]
+
+ incr y $dy
+ if {($y + $dy) > $H} {
+ set y [expr {$pad * 1}] ; # *1 ?
+ incr x $dx
+ set usedColumn 0
+ }
+ }
+
+ if {$usedColumn} {
+ set sW [expr {$x + $dx}]
+ } else {
+ set sW $x
+ }
+
+ if {$sW < $W} {
+ $canvas configure -scrollregion [list $pad $pad $sW $H]
+ $sbar configure -command ""
+ $canvas xview moveto 0
+ set noScroll 1
+ } else {
+ $canvas configure -scrollregion [list $pad $pad $sW $H]
+ $sbar configure -command [list $canvas xview]
+ set noScroll 0
+ }
+
+ set itemsPerColumn [expr {($H-$pad) / $dy}]
+ if {$itemsPerColumn < 1} {
+ set itemsPerColumn 1
+ }
+
+ my DrawSelection
+ }
+
+ method DrawSelection {} {
+ $canvas delete selection
+ $canvas itemconfigure selectionText -fill black
+ $canvas dtag selectionText
+ set cbg [ttk::style lookup TEntry -selectbackground focus]
+ set cfg [ttk::style lookup TEntry -selectforeground focus]
+ foreach item $selection {
+ set rTag [lindex $list $item 2]
+ foreach {iTag tTag text serial} $itemList($rTag) {
+ break
+ }
+
+ set bbox [$canvas bbox $tTag]
+ $canvas create rect $bbox -fill $cbg -outline $cbg \
+ -tags selection
+ $canvas itemconfigure $tTag -fill $cfg -tags selectionText
+ }
+ $canvas lower selection
+ return
+ }
+
+ # Creates an IconList widget by assembling a canvas widget and a
+ # scrollbar widget. Sets all the bindings necessary for the IconList's
+ # operations.
+ #
+ method Create {} {
+ variable hull
+ set sbar [ttk::scrollbar $hull.sbar -orient horizontal -takefocus 0]
+ catch {$sbar configure -highlightthickness 0}
+ set canvas [canvas $hull.canvas -highlightthick 0 -takefocus 1 \
+ -width 400 -height 120 -background white]
+ pack $sbar -side bottom -fill x -padx 2 -pady {0 2}
+ pack $canvas -expand yes -fill both -padx 2 -pady {2 0}
+
+ $sbar configure -command [list $canvas xview]
+ $canvas configure -xscrollcommand [list $sbar set]
+
+ # Initializes the max icon/text width and height and other variables
+ #
+ set maxIW 1
+ set maxIH 1
+ set maxTW 1
+ set maxTH 1
+ set numItems 0
+ set noScroll 1
+ set selection {}
+ set index(anchor) ""
+ set fg [option get $canvas foreground Foreground]
+ if {$fg eq ""} {
+ set fill black
+ } else {
+ set fill $fg
+ }
+
+ # Creates the event bindings.
+ #
+ bind $canvas <Configure> [namespace code {my WhenIdle Arrange}]
+
+ bind $canvas <1> [namespace code {my Btn1 %x %y}]
+ bind $canvas <B1-Motion> [namespace code {my Motion1 %x %y}]
+ bind $canvas <B1-Leave> [namespace code {my Leave1 %x %y}]
+ bind $canvas <Control-1> [namespace code {my CtrlBtn1 %x %y}]
+ bind $canvas <Shift-1> [namespace code {my ShiftBtn1 %x %y}]
+ bind $canvas <B1-Enter> [list tk::CancelRepeat]
+ bind $canvas <ButtonRelease-1> [list tk::CancelRepeat]
+ bind $canvas <Double-ButtonRelease-1> \
+ [namespace code {my Double1 %x %y}]
+
+ bind $canvas <Control-B1-Motion> {;}
+ bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}]
+
+ bind $canvas <Up> [namespace code {my UpDown -1}]
+ bind $canvas <Down> [namespace code {my UpDown 1}]
+ bind $canvas <Left> [namespace code {my LeftRight -1}]
+ bind $canvas <Right> [namespace code {my LeftRight 1}]
+ bind $canvas <Return> [namespace code {my ReturnKey}]
+ bind $canvas <KeyPress> [namespace code {my KeyPress %A}]
+ bind $canvas <Control-KeyPress> ";"
+ bind $canvas <Alt-KeyPress> ";"
+
+ bind $canvas <FocusIn> [namespace code {my FocusIn}]
+ bind $canvas <FocusOut> [namespace code {my FocusOut}]
+
+ return $w
+ }
+
+ # 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 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.
+ #
+ method AutoScan {} {
+ if {![winfo exists $w]} return
+ set x $oldX
+ set y $oldY
+ if {$noScroll} {
+ return
+ }
+ if {$x >= [winfo width $canvas]} {
+ $canvas xview scroll 1 units
+ } elseif {$x < 0} {
+ $canvas xview scroll -1 units
+ } elseif {$y >= [winfo height $canvas]} {
+ # do nothing
+ } elseif {$y < 0} {
+ # do nothing
+ } else {
+ return
+ }
+ my Motion1 $x $y
+ set ::tk::Priv(afterId) [after 50 [namespace code {my AutoScan}]]
+ }
+
+ # ----------------------------------------------------------------------
+
+ # Event handlers
+ method Btn1 {x y} {
+ focus $canvas
+ set i [$w index @$x,$y]
+ if {$i eq ""} {
+ return
+ }
+ $w selection clear 0 end
+ $w selection set $i
+ $w selection anchor $i
+ }
+ method CtrlBtn1 {x y} {
+ if {$options(-multiple)} {
+ focus $canvas
+ set i [$w index @$x,$y]
+ if {$i eq ""} {
+ return
+ }
+ if {[$w selection includes $i]} {
+ $w selection clear $i
+ } else {
+ $w selection set $i
+ $w selection anchor $i
+ }
+ }
+ }
+ method ShiftBtn1 {x y} {
+ if {$options(-multiple)} {
+ focus $canvas
+ set i [$w index @$x,$y]
+ if {$i eq ""} {
+ return
+ }
+ if {[$w index anchor] eq ""} {
+ $w selection anchor $i
+ }
+ $w selection clear 0 end
+ $w selection set anchor $i
+ }
+ }
+
+ # Gets called on button-1 motions
+ #
+ method Motion1 {x y} {
+ set oldX $x
+ set oldY $y
+ set i [$w index @$x,$y]
+ if {$i eq ""} {
+ return
+ }
+ $w selection clear 0 end
+ $w selection set $i
+ }
+ method ShiftMotion1 {x y} {
+ set oldX $x
+ set oldY $y
+ set i [$w index @$x,$y]
+ if {$i eq ""} {
+ return
+ }
+ $w selection clear 0 end
+ $w selection set anchor $i
+ }
+ method Double1 {x y} {
+ if {[llength $selection]} {
+ $w invoke
+ }
+ }
+ method ReturnKey {} {
+ $w invoke
+ }
+ method Leave1 {x y} {
+ set oldX $x
+ set oldY $y
+ my AutoScan
+ }
+ method FocusIn {} {
+ $w state focus
+ if {![info exists list]} {
+ return
+ }
+ if {[llength $selection]} {
+ my DrawSelection
+ }
+ }
+ method FocusOut {} {
+ $w state !focus
+ $w selection clear 0 end
+ }
+
+ # Moves the active element up or down by one element
+ #
+ # Arguments:
+ # amount - +1 to move down one item, -1 to move back one item.
+ #
+ method UpDown amount {
+ if {![info exists list]} {
+ return
+ }
+ set curr [$w selection get]
+ if {[llength $curr] == 0} {
+ set i 0
+ } else {
+ set i [$w index anchor]
+ if {$i eq ""} {
+ return
+ }
+ incr i $amount
+ }
+ $w selection clear 0 end
+ $w selection set $i
+ $w selection anchor $i
+ $w see $i
+ }
+
+ # Moves the active element left or right by one column
+ #
+ # Arguments:
+ # amount - +1 to move right one column, -1 to move left one
+ # column
+ #
+ method LeftRight amount {
+ if {![info exists list]} {
+ return
+ }
+ set curr [$w selection get]
+ if {[llength $curr] == 0} {
+ set i 0
+ } else {
+ set i [$w index anchor]
+ if {$i eq ""} {
+ return
+ }
+ incr i [expr {$amount * $itemsPerColumn}]
+ }
+ $w selection clear 0 end
+ $w selection set $i
+ $w selection anchor $i
+ $w see $i
+ }
+
+ # Gets called when user enters an arbitrary key in the listbox.
+ #
+ method KeyPress key {
+ append accel $key
+ my Goto $accel
+ after cancel $accelCB
+ set accelCB [after 500 [namespace code {my Reset}]]
+ }
+
+ method Goto text {
+ if {![info exists list]} {
+ return
+ }
+ if {$text eq "" || $numItems == 0} {
+ return
+ }
+
+ if {[llength [$w selection get]]} {
+ set start [$w index anchor]
+ } else {
+ set start 0
+ }
+ set theIndex -1
+ set less 0
+ set len [string length $text]
+ set len0 [expr {$len - 1}]
+ set i $start
+
+ # Search forward until we find a filename whose prefix is a
+ # case-insensitive match with $text
+ while {1} {
+ if {[string equal -nocase -length $len0 $textList($i) $text]} {
+ set theIndex $i
+ break
+ }
+ incr i
+ if {$i == $numItems} {
+ set i 0
+ }
+ if {$i == $start} {
+ break
+ }
+ }
+
+ if {$theIndex > -1} {
+ $w selection clear 0 end
+ $w selection set $theIndex
+ $w selection anchor $theIndex
+ $w see $theIndex
+ }
+ }
+ method Reset {} {
+ unset -nocomplain accel
+ }
+}
+
+return
+
+# Local Variables:
+# mode: tcl
+# fill-column: 78
+# End:
diff --git a/library/icons.tcl b/library/icons.tcl
new file mode 100644
index 0000000..e53a1bd
--- /dev/null
+++ b/library/icons.tcl
@@ -0,0 +1,153 @@
+# icons.tcl --
+#
+# A set of stock icons for use in Tk dialogs. The icons used here
+# were provided by the Tango Desktop project which provides a
+# unified set of high quality icons licensed under the
+# Creative Commons Attribution Share-Alike license
+# (http://creativecommons.org/licenses/by-sa/3.0/)
+#
+# See http://tango.freedesktop.org/Tango_Desktop_Project
+#
+# Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+namespace eval ::tk::icons {}
+
+image create photo ::tk::icons::warning -data {
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAABSZJREFU
+ WIXll1toVEcYgL+Zc87u2Yu7MYmrWRuTJuvdiMuqiJd4yYKXgMQKVkSjFR80kFIVJfWCWlvpg4h9
+ 8sXGWGof8iKNICYSo6JgkCBEJRG8ImYThNrNxmaTeM7pQ5IlJkabi0/9YZhhZv7///4z/8zPgf+7
+ KCNRLgdlJijXwRyuDTlcxV9hbzv8nQmxMjg+XDtiOEplkG9PSfkztGmTgmFQd+FCVzwa3fYN/PHZ
+ AcpBaReicW5xcbb64IEQqko8Lc26d/58cxS+/BY6hmJvyEfQBoUpwWCmW1FErKaGWHU13uRk4QkE
+ UtxQNFR7QwIoB4eiKD9PWbVKbb10CZmaCqmpxCormRYO26QQx85B0mcD+AeK0xYvHqu1tNDx+DH6
+ gQM4jh0j3tCA3tGBLyfHLuD7zwJwAcYqun44sHy51nr5MsqsWWj5+djCYdS5c4ldvUr24sU2qarf
+ lUL6qAN0wqH0vDy7+fAhXZEI+v79CNmt7igpofPVK5SmJvyhkJBwYlQBSiHd7vUWZ86bp8WqqtCW
+ LkVbuBAhBEIItGAQ2+rVxG7cICMY1KTDsekc5IwagIQTmStXis47dzBiMfR9+xCi+wb39s79+zFi
+ MczGRjLmzTMlnBoVgLMwyzF+/Cb/lClq2/Xr2AoKUKdPxzAMWltbiUajmKaJkpGBY8sW3tbW4g8E
+ VNXrXVEKK0YMoMKp7Px8K15Tg2VZOHbvBiASiRAMBgkGg0QiEYQQOIuLsRSFrnv3yJo/HxVOW594
+ 7D4KUAa57qysvNSUFOVtbS32rVuRfj9CCFwuV2Kfy+VCCIFMScFVVET7/fukJidLm883rQy+HhaA
+ BUII8cvUNWt4W1WFcLvRd+5MnHl/AOjOB+eOHchx44jX1ZEdCqkSTpaDbcgA5+GrpNmzc9ymKdvr
+ 67Hv2oVMSko4cjgcKIqCoijoup64EdLpxLV3Lx1PnuCVUrgmTfK9hV1DAjgKqlSUk1PCYdl25QrS
+ 70cvLEw4SWS+04nT6XxvXgiBc8MGtKlTaa+rIysnR1Ok/OF38PxngAzY4VuwYKL99WvR8fQpjj17
+ kLqeiL6393g8eDyeAWBSVfEcOkRXczOOaBRvVpZuDPJEDwD4DVyKrv+UlZurxSorUWfMQC8oGOBc
+ CDHgC/Rdc4TD2BctIl5fT+bkyTahaXvOw8RPApiwd2Ju7hjZ2EhXSwvOkhKQcoADgIqKCioqKgYc
+ QW9LOnIEIxZDbWpiXCCABT9+FKAUxtm83pKMUEiLVVejLVqEtmTJB50LIdi2bRuFPbnRd7232efM
+ wbVuHR2PHjHR77dJXS8sg5mDAihweFJenmrevYvR1oazpGTQ6IQQaJqG7ClI/dd655IOHsSyLMSL
+ F6QFAib9nugEQClk2Xy+orTsbK3t1i3sa9ei5eQMGr0QgvLyci5evDiocyEEtsxMPNu30/nsGRO8
+ XlVzu8NlkNvrV+0T/fHMZcusrtu3MeNx9PXrobUVq8cYQrw3TrRub1h9+v573Bs3Ej1zBvP5c/zp
+ 6dbLhoaTwPy+ANKCfF92thq7dg2A6JYt/fNlxGK8eUNSerryHEJHQT8K8V4A5ztojty8OeaLzZul
+ 1DSwLCzDANPEMozusWFgmWZ33288YK3/nGlixuM0v3xpWfDX0Z4i1VupXEWwIgRnJfhGPfQ+YsLr
+ +7DzNFwCuvqWyiRg7DSYoIBu9smPkYqEd4AwIN4ITUAL0A4Da7UC6ICdEfy2fUBMoAvo7GnWKNoe
+ mfwLcAuinuFNL7QAAAAASUVORK5CYII=
+}
+
+image create photo ::tk::icons::error -data {
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAABiRJREFU
+ WIXFl11sHFcVgL97Z/bX693sbtd2ipOqCU7sQKukFYUigQgv/a+hoZGoqipvfQKpAsEDD0hIvCHE
+ j/pQ3sIDUdOiIqUyqXioEFSUhqit7cRJFJpEruxs1mt77Z3d2Z259/KwM5vZXTtOERJXOrozZ+6e
+ 852fuXcW/s9D3O3Cs1Bow1Nx234BKQ9qpYpK6yFLSseScsVoveApdUrAzNOw9j8DOAMTtmX9RsM3
+ SqOjevcXDqUzu8dI5AvEc8O0axu4q6s4yzdZvnCxUSmXLWHMXzxjXpmGq/81wGmIZ6T8NXDi8w8d
+ id//+GPS8j1YWQXHgVYbfA/sGCRiMDQExTzKtvn3zDv6k9m5FsacXNT6+y+D95kAZqCEEO/cMzIy
+ 9eBLLybjyodrN6DpDqw1/dfpFNw3TtuSfPz7P7irlZUL2pjHn4GVuwJ4G/JCiLl9U1OjB58/ZnP5
+ Mqxv3NGpMWZAz64cHNzHlTf/5N9YuHzTMeaLx6HW78+K3pwGKynEu/snJycOHPuWzdw81BuDUQZO
+ dfQ+MmvAuC1MdY3i178izUo15VZXj07DyTf6OGX0Jivlz0vFwgMTz3/bNnMXO0ZCo8b0iIk4C0WF
+ zsP1TRc1e4l9x56N5YuFwxkpf9afgW4J/gi7M1IuHH3lezm5uAQbmwOpjc79ujArA2uMgWwGMz7K
+ P377u/WW1pPTUB7IQFrKXx44NJWRbQ9d2+hGqbeRMEoTZEQFJdERfVgmvVFH+D57Jw9k4lL+YqAE
+ pyGnjZm+95knLHVjcVvHA6WIPgtLE+hVH4i6vsS9T3zTVsY8NwPZHoAUPFUs5JVQCt1q9zqORKm3
+ iLKrF6IjkfSHOiUlqu0hhCSXHdYePNYDEBPiu6MT+zOquo6JGNGhESkxUnYNmkCnLQtjWRgpMRG9
+ CtZ3JdD7axsU9+3N2EK8EALYQcNMpvfuQTcaXUMIAa+/Hi0Xgs9weASjefx4p5mFQDdbpD63G/HR
+ hakeAA2l+EgJU652iIMMyO2sRoYxBq1191oIgZQSITqooT0A7fnEirswUAp/LwG0MZlYIY9WqpPa
+ IHU7Da01Sqluo4UQSil830dr3emVsBeMIZbLoI0Z7gGQQtTbjoOOxW/XewcApVQ38jsBNs6fx6tW
+ O70Si+GWKwghNsM1NoCAW81KJTeUjKNbrR2N7uS4B7TRwJ+fR6TTxO4fxzUeAio9AMCl+tVrE0NH
+ DmM2nU4DAu6JE53UGoNfLuNdv45xnO4OF/ZKz+4X2T179I6D5To0NupouNgD4Btzqjx/8WjpS0cy
+ PU1Tr6MqFfylpc4bss1W26/rBwyfybECtcvXNrUxp3oAXJjZ2Kxb7cVP8P61gDGgWy2M624Z5d1E
+ 3wNkDDKdwMQkjtuygbMhgAQ4DjUhxFvL/5z15X1jeLUaynW7p1u484WiuL3V9m/NoV6F50Ogjx3Y
+ Q/mDBV8a3piGzR4AAFfrHy4vlesmm0bks7edRQ6aAafcPoZVH2AUXOYzkI5TvbVa9+FHREYX4Bgs
+ I8RrV9/9oJF4eBKTjO8YvdoCJgqujcGkEqQemmDxb7OOFOLV6FHcAwBQ1/onTtOd/fTvH3rJRx/A
+ pBIDqd0q+p5sRaInnWDoywdZem+u7bbaH9W1/il9Y2Brfwt22TBfKOVHxr92JOacv4S/UuttuC06
+ PKoHsEs5hg7vZ/m9eW+zWltuwoNbfRNuebacgXsEnE2lkof2Hn04ZRouzQvXUU5z29cwFGs4TWpy
+ HJGK8+lfP256bnuuDU8+B9WtfG17uL0GsTF4VQrxYn60kBh55JDEbdG6uYq/7qDdFtpTELOQyQRW
+ Lk1sLI+MW9w6d8Wv3Vrz2nDyJPzgDDS287MVgAAywBCQ+Q5MTsOPs/BIMpVQ2bFCKlnMYg+nsYeS
+ eE6TVq1Be3WD9ZtrTc9tWetw7k341dtwBagDTmTeESAdAAxH5z0w9iQ8ehi+moWxBGRsiPvguVBf
+ h8qH8P6f4dxSp9PrdN73cN6k859R3U0J0nS+28JMpIM5FUgCiNP5X2ECox7gAk06KQ8ldLzZ7/xO
+ ANHnscBhCkgGjuOB3gb8CEAbaAWO3UA34DQ6/gPnmhBFs5mqXAAAAABJRU5ErkJggg==
+}
+
+image create photo ::tk::icons::information -data {
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
+ WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gUdFDM4pWaDogAABwNJREFUWMPFlltsVNcVhv+199ln
+ bh7PjAdfMGNDcA04EKMkJlIsBVJVbRqlEVUrqyW0QAtFTVWpjVpFfamUF6K+tCTKQyXn0jaiShOr
+ bRqRoHJpEEoIEBucENuk2OViPB5f5j5zrvuc3YcMFQ8FPBFVj7S0paN91v+tf1/OAv7PD9UzeeCp
+ p0KRCrYyHtymoPrgySYAANdyBBr2Peu1agP+NrR/v3nHAb6/52d7wfivWlet11NdvZG21laEwzo0
+ RvA9F4uLi7h08bxxaWLUVp78xSsv/XrwjgAMDDyjRxPWUGOy5Uu9/VsjEA3I5KvIVQ240gHIh9CA
+ 5YkwelIJRATw94NvGpnpK0fL+eDA0NAzzq3ya7cDjCbsoWWr1j+y4f4vB/41Z8JTeaxqE7hndSNi
+ EeELzn3LkapQdfzJTE5JV/GBb28LHz327lcnzp4ZAvB1AOpmAvyWtv/g6R9GW1c+uf6Bx0Kfzpjo
+ TmnYtDaKtkTAj4aEFBqTnJPUOfciIeG3N4XVQtmyzl/JuY8/fH9wOjO/smvVmuy5s+8P1w2wa9dP
+ 46SLN3sf2ha7uiixaU0Qna06NA6PMXIZQRJBMiIXRBKABygv3hBQV+bK1dmcoR7d3Bc5c/pk/8YN
+ fYOjo6es/6bDbgbAdLa9uXNj2PYF2pOEloQGAiRIuUTkME42J7IZweYES+NkckZWWNfseEPAKJtO
+ oWxLu69/c5jpbPtNdW7qPwvsbO1cF8pVLKxs0+HD94gpl0AOQTlEsDkjizFmMk4WESyNM4NzMgOC
+ VYI6q17OlIp9992ngek769+EvtfVEI3jWqaKgAgAIAlFLuOwGZHDiTnElGQgF4DvM1LKV7Bdz2NE
+ xaCuhQpVm1Y0p5qhvNV1AyjlRTWhwVM2TMdzgkJzieAQyGGMbMZgfwZBEiBPA3xX+VSouAvBAFeM
+ yDddD7rgpHw/WjcAMa0EZScZk5heqFrxiO4BzCGCzYgsBrI4I5sYcxlBKl/5WdOdd6S0gxoLEZEi
+ Iq4AnzGq1r0HiPhYuZRFU1R3FgqWkS1aZQA2gWzOyGQcJudkaAwVR3qz8yXzvCXlzJoViaagrlWC
+ jJnLm8Jarli2GNMm6wbwPPO31y6Ollc2N3pcI+fyYjW/8a5EKqQTz5WtdLHsTi1W7Im5vDlcMdxx
+ wVk2Ys9/pTI3+WhAaIauM+MLbYnlH46MVKVyX6v7Hhg9e2ps3doN32ld0Rlrb1nmmK4stCdCSCUj
+ Le1NwW6uXJ08m/t2OarBXh0ie0syHu0plKtTFGw8n4o33q1z1XngD7+X3C/uHBkZces7hoAi1946
+ fPSvtpDlYFdLPDI8mR03HC87frXwFpgqLYuFuzrbkg8m49EeDsqDa+cizXcNpppia5ui+sYXnn+O
+ 29LbOTg4aHzun9GOPT/pDemhf3xzx25DicjkiqaAIs4zhumMRUJaPhzgJZ0LQ5C7gXjQL1kS0YD+
+ o337nhWlYvHJV178zZ9vlZ/dDuDVl57/2HWt755894hINoYSmZx11TYKCUZKCs4cnQuDmGtfvDiR
+ dD3n04aA6J4YHzeLhfLg7cSXBAAA5NPpufS1WFjwkFSelZ6ZLWfn0kliTDJdue8dO9qenp2d1DVR
+ 4cTarlyZJgV5dim5lwTw8sv7c1L6H89cm6FlDcHVhlOJffThsa9d+ud72y5+cnTn2PjJJ1avjOoE
+ SnBiPadOfRDTGT5YSm5tqR2R7Zp7//L6gRPf27NjVaolqS9MCzh28W6mgDXdKxCNRb/oOlV18O3D
+ 1xzXGXpx8LnZO94Tbt/x+MFYouexh7dsQU/PWjRGI+BcAyMgm1vAO28fxvj4xOX5jL7u0KEX7Dvq
+ AAC0Nucf2rLZhq8Y3njjT8gulOBKDw0NAQjNQT435eQWL3iHDk3YS81ZF0B6psI/GbuAXbu+gQf7
+ H4ArPeQWC5jLZKCUhQvjWb2QD3bVk5PVM9nz5LML8waOH38fekBHIhFDqqMFXd0pnDhxGmMTU3Bd
+ 9/X/GQDntO/eezswMPBjaFwAABxH4sKFq+jt7cX6ni6EQuJbdeWsZ3J3d/PTmqaEYUyhXDZBTEOh
+ WIIQwOi5jzA1eRnZXPFSPO7/bmbGlLfqhus5BVotRH9/x7rGxtBeIQJPACrMOYNSPpRiUIpnlTIO
+ nzmT+eX8fLH8WZMKF4Csje7ncUAHEKhFcHq6ZE5OZoc7O3tlc3N33+7dP9c2bXoE09NlO52uHDhy
+ ZOTVatUWte+otsTXg2pQSwagG6r/jwsAQul0erqjo+OesbGx1tHRUT+fz48dP378j57neQD8mtB1
+ B1TtnV9zo64loJqoXhtFDUQHEGhvb2/2fZ9nMpliTcAFYNdC1sIBYN1sCeq5Ca9bqtWcu9Fe3FDl
+ 9Uqvu3HLjfhvTUo85WzjhogAAAAASUVORK5CYII=
+}
+
+image create photo ::tk::icons::question -data {
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAACG5JREFU
+ WIXFl3twVdUVxn97n3Nubm7euZcghEdeBBICEQUFIgVECqIo1uJMp3WodqyjMzpjZ7TTh20cK31N
+ /2jL2FYdKXaqRcbnDKGpoBFaAY1BHgHMgyRKQkJy87yv3Nyzd/84594k1RlppzPumTXn3Dl3r/Wd
+ b31rrbPhS17iSv+4bl2t2ZFhrRGI7QKxRkMAyHEfjwgYEOgjNnpfcXjiSENDbeL/AqBoW22uGE/7
+ MYL7yubN4MYVpVkrquaKqwJZ+LPTARgcjdIbHKOx+aI+9EH7WGvnZdA8q9PGf9b5eu3w/wygaPPO
+ h6Uhntxcsyj9/q+vtMrnBa6Is7ZPgzzzyvGJ/YfPRpWWj3fWff93/xWAonW1Xu3z/nVx6cxNTz74
+ 1YzK4gIQjuN/nfyEEx9fIjgaYXAkhhAQyE3Hn5PBsvJZrF46l5I5+QB83NnP40+/FT7d1ltPOPrN
+ zoba2BcCWLy91hMOp72/bX1VxU/u3+BJ91i0fhrkuTcaaTzbjTQkhpQIIZBSIBApL1prtNYsryhk
+ xy1XUzonn1g8wVPPvh1/5dDpcz5f7LrmfbXxqfGM6eG1yCw+9uq2G6tW7nxoU5plGrzecJYnnnub
+ SwMhTNPAmmKmYWCaBoYpMQyJaRhIQ3IpGOKt4+1k+dKoLJ7BjStKjb6hcN7JloFrhlsO7oUnPh9A
+ 8Rbvo6uuLrr3N4/ckm4Ykt/vPcqe/R9hGAamaWJZbnDL+W2axqRJA8NlxzAkAI3newhF4lxbMZs1
+ y4rNM+19c0PZ++NDLQff+0wKCu/Y6c/UVsubv/12/ryZubxUf5Ln3vgQ0zKnvK1kadkMlpQUUFEU
+ oCDPR25WOuPxBH2DYZpa+qg/3kEoGsdWCttWJGzF3ZuXcuf6Ci5eHmXrw7sHR4mXd7/2w+A0Bvyl
+ N+265/bl19+8eqE8c6GPn+85jGkYWC4Ay3Luf/3AV1g038+MXB8+rwfDkKR5TPKyvCyan8+qqtmc
+ au8nFrcdnQCn2vuoLptJSWEeE7bynDjdXTDUcvBNAAmweF1tpmXKu+65bYWh0Ty97zhSyGkUO0BM
+ hBAI4RAXTyjiCYWUEukKMz/Ly/b1C7EsE49lYlkmhjTYvf8jNHD3lmsM0zTuWryuNhPABIj4vFvW
+ Xl0s87PTOdXWS8snQTwec4ro3DSYBglbcfx8P+8199I7FMEQgg3L53N7TWkKXOV8Px7LJCFtXKx0
+ dA9zrnOAyqIAa68tkQePtm4BXpaO9vWOm65b4EPAkY+6HDEZTt4NN/dJML946QSv/fMCA6PjpHks
+ LI/F2a5BtNYpMUtJirGpLL7f3A3AxpXlPiHFjhQDaJZVlc0EoPWT4DQ1m8ZkKizTJDRuY1mmC04i
+ pWDNksJUD9Bac7E/jGUZrmuN1qCU5sKlIQAqSwrQWi+bBCDwF+RnAk5fl27wqeYAkZM9wLWaxVex
+ qnJmKritFO+e7sMyDdBOc1JKYxiSkdA4CMGM3Aw02j+VAfLcwTIWibuiEpNApJMSw208ydJcu3QW
+ axZPCW7bHGjspmcwimkYTmAlMWzHTyTmDMiczLRU/ctkNxgajboPvUghppuUGFJMY6O6OJ/ViwIo
+ pVBKYds2dR9e4uPuMbc7Tm9MUgqyM70AjITHUy1IAghNsH8oDEAgz4cQOIqWjkkpEC4rSYfXL/Sn
+ giulONYyRFd/1GXKAZxkUrgvkp/tAAgORxAQnAQg5InmC5cBWDgv4NS5EAhAINzyIlVmUgiy040U
+ 9Uop2voiKYakEAiRvDp7EYKS2XkAnOvsR0h5IqUBrfWeQ8fb1t2xvtJXs3QuB462TfZokbxMGZxC
+ 8If6DtI8Fh6PhcdjojSpBuXin7Kc3csXzQLgrWOtEWWrPSkAvkis7kjTBTU8FqOypIAF8/x09Y6Q
+ FGjyTdHJstLsWDsnNZIBXj7Wj1LKYSS5B412nRTNymHBnHxGQ+O8836r8kVidakUNDfUhhIJtfcv
+ dU22AO69dRlCCNeZU8fJe6U0ylZYBlgGmNKx+ESCiYRNwlYoWzn/UxqtHOB3ra8AAX/7x0nbttXe
+ 5oba0GQVAPGE9dju1z4Y7u4fY9F8P9/YWOUEV06O7eTVnXBTBaiUIj4xwcSETSJhk7BtbNtOPdta
+ U0ZpYS59wRB/2ndsOBa3HkvGTU3D0fb6aE7ZBt3RM1yzuabcqiwKEI5N0N495ChaSKcihJPRa0pz
+ sbUmYTugPmgbJmErB4DLxETC5oYlhWxdXUrCVvxgV32krav/qa4Djx76D4kllxalt/7q9e2bqjf9
+ 9Lsb0oQQHGrsYO+hc0gp3emW/Bhxm5NbZlqD0g79CTcFt60u4YYlhWhg5/MN4y/WNdW3vfnoNhD6
+ Mww46wlmV9/w6snzA1sHRqKBVUvnGQvm+qkuKyA4GqVvKOJAdrcn8zz14yNh2ywozOVbGyuoKg4w
+ PmHzyxcOx1+sazqTlhbZ3H92vT29Pj5nzVn1SLqVH3ipunzOxqceutlX6n7lXrw8yqn2flq7hxgL
+ TzAWiyOFICfTS44vjbLCXKqK/cwOOHOl49IwP9r192hT84V3e4+9cF90sC0IRL8QAOADsgvXfu9B
+ b3bgkTs3LPN+52srzPlX5V7RUerTy6M8/0Zj4uUDH45Hg13PdB/9425gzLUhQH0RgDQgC8hKLyid
+ 7a/c9oCV4d9WVTpLbF5TmX5tRaGYkecjJ8MLAkZD4wyMRGg636PrDjfHzrT26NhYT33w1Kt/Hh/u
+ 6XUDh4BBIHwlDIBTohlANpBhWb6s7PKNK30FCzZa6dnVYORoIX2OExVF26Px8NCZSN/5d0bb3mlK
+ JGIhHLpDwLAL4jPnxSs9nBqABXhddrw4XdRygSrABuKuxYBx9/6KDqlf2vo3PYe56vmkuwMAAAAA
+ SUVORK5CYII=
+}
diff --git a/library/images/lamp.png b/library/images/lamp.png
new file mode 100644
index 0000000..5445746
--- /dev/null
+++ b/library/images/lamp.png
Binary files differ
diff --git a/library/images/lamp.svg b/library/images/lamp.svg
new file mode 100644
index 0000000..aa34765
--- /dev/null
+++ b/library/images/lamp.svg
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="256"
+ height="256"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ version="1.0"
+ sodipodi:docname="lamp.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:export-filename="C:\Users\pat\Documents\SVG\wish\lamp.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective4202"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.9765625"
+ inkscape:cx="122.94071"
+ inkscape:cy="132.27976"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1253"
+ inkscape:window-height="696"
+ inkscape:window-x="155"
+ inkscape:window-y="130" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>Wish</dc:title>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/by-nc-sa/3.0/" />
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/by-nc-sa/3.0/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Notice" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Attribution" />
+ <cc:prohibits
+ rdf:resource="http://creativecommons.org/ns#CommercialUse" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ id="path4244"
+ d="M 415.15644,157.10949 C 415.95395,156.55285 413.63871,156.20026 408.98022,156.16891 C 400.39605,156.11114 394.03714,153.62619 389.90404,148.71428 C 386.80837,145.03529 386.70005,142.56479 389.55139,140.67157 C 392.33793,138.82138 391.59696,137.74624 384.94986,133.99485 C 377.10186,129.56571 367.45876,120.11083 361.01771,110.52982 C 356.2238,103.39891 354.835,102.02199 351.39782,100.99218 C 348.07028,99.995225 347.3807,99.349945 347.3807,97.233135 C 347.3807,95.827615 348.28389,93.409235 349.38778,91.858965 C 350.70625,90.007345 351.00116,88.909055 350.24734,88.657785 C 348.52268,88.082895 349.12369,71.212775 351.01049,67.236642 C 352.72697,63.619426 358.4038,59.341601 362.8807,58.291741 C 368.19851,57.044683 371.3807,54.944074 371.3807,52.68077 C 371.3807,51.505545 370.0325,48.443002 368.38469,45.875118 C 364.6377,40.035936 363.56213,33.352517 365.70314,29.212273 C 368.86873,23.090696 378.69381,16.159436 389.80945,12.206085 C 396.16957,9.9440683 409.19029,7.9006403 416.8807,7.9576143 C 429.56583,8.0515923 430.45121,10.684797 418.52387,12.844573 C 408.41402,14.675243 395.40533,18.738492 389.39058,21.944323 C 382.19817,25.777834 375.3807,32.024842 375.3807,34.781896 C 375.3807,35.961118 376.7307,39.600271 378.3807,42.868903 C 381.7881,49.618923 382.10517,53.281819 379.7158,58.292375 C 377.80005,62.30975 372.62836,64.868903 366.42556,64.868903 C 361.00253,64.868903 357.56106,66.378947 356.20597,69.353051 C 354.65926,72.747705 355.39815,73.177385 359.69504,71.382035 C 364.84442,69.230481 369.94545,69.499889 378.3807,72.368905 C 386.08854,74.990505 393.19753,75.572485 396.42352,73.845985 C 399.16382,72.379425 400.20168,69.980487 401.8714,61.253678 C 402.8156,56.318785 404.11402,52.717225 405.46884,51.27508 C 409.57057,46.908996 417.3263,46.188254 435.8807,48.4489 C 440.51899,49.014024 441.21999,48.798052 445.57071,45.463499 C 448.15021,43.486471 450.93616,41.868903 451.76169,41.868903 C 456.39638,41.868903 453.00898,47.459001 446.28417,50.908252 C 444.30607,51.922844 437.33107,53.551117 430.78417,54.526637 C 415.93531,56.739186 415.13628,57.382184 413.51607,68.422706 C 412.86967,72.827445 411.54206,77.483105 410.53723,78.868905 C 407.37979,83.223475 398.88397,87.099935 391.31007,87.641845 C 382.34323,88.283415 380.33433,87.656565 374.36395,82.354025 C 370.03354,78.508005 368.69669,77.868905 364.98218,77.868905 C 360.03038,77.868905 356.23453,80.317105 353.75648,85.109115 C 352.31064,87.905065 352.31073,88.250245 353.75754,89.059915 C 354.62947,89.547875 358.14729,92.392935 361.57494,95.382295 C 373.67667,105.93659 385.05189,109.87945 387.55431,104.38722 C 389.01862,101.17342 400.23138,93.868905 403.70042,93.868905 C 405.61476,93.868905 406.3807,93.354525 406.3807,92.068905 C 406.3807,89.300765 408.42915,87.865755 412.3307,87.900705 C 416.2925,87.936195 418.45173,89.238425 420.29952,92.706685 C 421.27351,94.534825 422.08643,94.908595 424.02848,94.421175 C 425.97033,93.933795 427.14185,94.472205 429.40044,96.890035 C 430.98913,98.590725 433.7721,100.41478 435.58483,100.94347 C 438.47789,101.78726 439.06063,101.62756 440.35288,99.636815 C 445.10643,92.313915 453.6284,87.868905 462.91432,87.868905 C 471.25226,87.868905 477.3762,94.861065 477.37915,104.38451 C 477.38132,111.40533 474.73351,115.99375 469.63732,117.8004 C 465.8216,119.15312 465.3143,119.09082 460.41928,116.6683 L 455.23918,114.10469 L 455.55994,118.7368 C 455.85694,123.02582 455.69553,123.39336 453.3807,123.69898 C 452.0057,123.88052 449.0807,125.72311 446.8807,127.79362 C 444.6807,129.86413 441.3057,132.60737 439.3807,133.88971 C 437.4557,135.17205 435.71687,136.34329 435.51663,136.49247 C 435.3164,136.64165 436.1039,138.303 437.26663,140.18434 C 440.00489,144.61494 439.95186,145.14881 436.36797,149.23063 C 433.17349,152.86894 427.63954,155.56972 421.9273,156.27821 C 420.02228,156.51449 417.43247,156.99854 416.17217,157.35387 C 414.69967,157.76902 414.33665,157.68168 415.15644,157.10949 z M 461.66289,105.49411 C 466.02111,106.09147 466.3807,105.96302 467.55302,103.39006 C 468.64455,100.9944 468.56244,100.47497 466.9,99.259355 C 463.50165,96.774425 454.03816,98.379955 450.76501,101.99675 C 449.2334,103.68915 449.23826,104.00257 450.83387,106.43778 L 452.55063,109.05789 L 454.78597,106.9579 C 456.6536,105.20335 457.78484,104.96256 461.66289,105.49411 z M 480.08955,157.24443 C 479.03653,156.19141 479.23148,154.86891 480.43972,154.86891 C 481.02218,154.86891 481.22062,155.31891 480.8807,155.86891 C 480.53516,156.42801 481.28072,156.85424 482.57168,156.83564 L 484.8807,156.80237 L 482.82974,155.08564 C 481.26204,153.77341 480.78031,152.19079 480.78523,148.36891 C 480.78878,145.61891 480.4093,142.24744 479.94194,140.87675 C 479.17159,138.6174 479.24977,138.51536 480.77884,139.78437 C 482.10899,140.8883 482.72069,140.92526 483.67308,139.95921 C 484.61817,139.00056 484.50928,138.45979 483.17218,137.47168 C 480.67758,135.62817 479.8077,125.30277 482.07374,124.43321 C 484.50372,123.50074 486.09262,125.4993 484.69743,127.73335 C 484.07418,128.73133 483.86705,130.0378 484.23714,130.63662 C 484.60722,131.23543 484.90343,137.49517 484.89536,144.54714 C 484.88148,156.68738 484.7722,157.38444 482.83955,157.66109 C 481.71692,157.82179 480.47942,157.63429 480.08955,157.24443 z M 482.25305,118.70224 C 481.74301,109.37956 481.9401,107.3904 483.40197,107.10616 C 484.64333,106.86478 484.91924,108.04245 484.9015,113.50646 C 484.88705,117.95665 484.46065,120.34226 483.63023,120.61907 C 482.88848,120.86632 482.32882,120.08736 482.25305,118.70224 z M 379.00441,69.349758 C 376.06529,66.410633 377.10113,63.67485 383.3807,57.791426 C 389.1743,52.363315 389.3807,51.996847 389.3807,47.13811 C 389.3807,42.527633 389.68488,41.874271 393.01325,39.335601 C 396.00346,37.054853 398.10542,36.431883 404.90027,35.812562 C 416.73834,34.733574 419.96577,32.472032 421.51698,24.168809 C 422.76442,17.491595 424.77273,15.934307 435.02949,13.690888 C 444.53714,11.61132 473.5654,10.035808 469.8807,11.799335 C 462.39978,15.379766 448.69837,19.973669 443.16225,20.757679 C 434.68965,21.957548 433.72397,22.530265 426.73194,30.502062 C 423.51376,34.171199 419.46171,37.767608 417.72739,38.494081 C 415.99308,39.220554 410.20812,40.121839 404.87193,40.496935 C 392.82345,41.34386 390.96003,42.710991 391.65408,50.194442 C 392.08855,54.878864 391.98999,55.090456 388.28416,57.429845 C 384.39732,59.883502 381.94201,63.096875 383.08255,64.23742 C 383.42987,64.584736 386.14059,64.868903 389.10639,64.868903 C 395.04346,64.868903 395.33233,66.026622 389.95576,68.273094 C 383.92501,70.792905 380.75884,71.104181 379.00441,69.349758 z M 434.60321,38.312199 C 427.83023,33.568222 439.44607,28.281864 448.8156,31.844152 C 452.78899,33.354831 451.84999,34.868903 446.93972,34.868903 C 442.58714,34.868903 440.3344,36.104222 442.3807,37.368903 C 442.94864,37.719911 443.15443,38.426005 442.838,38.938001 C 441.93507,40.398969 437.05277,40.027939 434.60321,38.312199 z M 399.1307,26.788804 C 398.1682,26.228199 397.3807,24.907716 397.3807,23.854397 C 397.3807,19.888982 404.86882,18.583104 410.97957,21.482844 C 414.6962,23.2465 415.79992,26.473299 412.3807,25.579154 C 411.08084,25.239232 410.3807,25.548472 410.3807,26.462523 C 410.3807,28.151255 401.89255,28.397435 399.1307,26.788804 z"
+ style="fill:#a19ea5" />
+ <path
+ id="path4242"
+ d="M 105.76326,194.33186 C 96.199481,191.3282 86.035511,183.95952 84.415432,178.8551 C 83.669624,176.50526 84.619431,173.43151 87.043677,170.34958 C 89.131529,167.6953 90.839771,164.85771 90.839771,164.04381 C 90.839771,163.22992 85.918717,159.94111 79.904096,156.73534 C 65.654177,149.14022 48.534772,133.52161 39.035518,119.44956 C 25.94837,100.06246 20.676575,94.528555 15.260318,94.492261 C 12.544659,94.474078 9.7834525,93.586577 9.1243032,92.52005 C 7.1111542,89.262706 9.8582449,82.714405 14.697759,79.234457 L 19.284506,75.93627 L 32.226689,86.830368 C 45.242318,97.786283 61.932601,107.70092 70.896763,109.80181 C 74.874966,110.73415 76.973245,109.63504 82.823316,103.55448 C 91.577415,94.455454 106.5437,84.581571 109.7288,85.803804 C 112.30619,86.792846 119.14001,82.528975 119.50937,79.701372 C 119.63551,78.735652 119.84193,77.072338 119.96808,76.00515 C 120.1008,74.882421 123.45816,74.302552 127.93568,74.629009 C 134.42967,75.102512 136.37445,76.225828 140.03071,81.615217 C 142.42694,85.147312 144.93094,87.89196 145.59516,87.714438 C 146.25938,87.536916 148.11372,86.880753 149.71593,86.256298 C 151.55372,85.540025 154.60158,87.11622 157.97278,90.526315 C 160.91183,93.499275 166.37382,96.761572 170.11052,97.77588 C 176.63713,99.547487 177.10469,99.356038 181.99078,92.911204 C 189.2319,83.360053 193.30348,80.314122 203.42538,76.876064 C 213.99829,73.284813 227.86298,74.099195 234.92479,78.726276 C 249.97261,88.585994 246.13011,121.71137 229.57839,124.81649 C 217.25776,127.12786 203.68336,119.34028 204.912,110.66549 C 205.47565,106.68593 206.35069,106.38575 217.3878,106.38575 C 228.7903,106.38575 229.33057,106.17926 231.11535,101.13898 C 232.77591,96.449555 232.39214,95.427248 227.50256,91.5151 C 221.01109,86.321288 212.43622,85.84151 203.33017,90.162611 C 193.1595,94.988901 192.26182,99.390772 198.85898,112.08736 C 201.94886,118.03401 204.71121,125.78933 204.99756,129.32143 C 205.44391,134.8274 204.9522,135.7516 201.55033,135.80083 C 199.36802,135.83241 193.58823,139.5894 188.70635,144.14971 C 183.82446,148.71 177.14673,154.02271 173.86693,155.95573 C 170.58712,157.88875 167.90365,160.16082 167.90365,161.00476 C 167.90365,161.8487 169.76144,165.83259 172.03207,169.85786 L 176.16049,177.17652 L 169.56843,183.28424 C 155.87761,195.96917 126.9335,200.98073 105.76326,194.33186 z"
+ style="fill:#edd400"
+ sodipodi:nodetypes="cssssssscccsssssssssssssssssssssssssscccc" />
+ <path
+ id="path4238"
+ d="M 105.76326,195.26015 C 91.2682,190.70773 79.926103,178.96138 85.064191,173.82331 C 86.412111,172.47539 90.329525,173.11166 98.078673,175.93715 C 114.43988,181.90274 127.59098,183.59079 140.28535,181.35472 C 153.94689,178.94829 158.14857,176.20124 155.47497,171.42379 C 153.72375,168.29452 151.50157,168.02067 131.82394,168.50911 C 119.87893,168.8056 106.35554,168.19755 101.77196,167.15787 C 89.698721,164.41931 70.093174,152.93068 56.939947,140.88681 C 44.534571,129.52772 29.195171,107.81695 31.238758,104.51038 C 31.937342,103.38006 30.70876,100.53908 28.508587,98.197089 C 25.268931,94.748645 23.184206,94.116538 17.545112,94.872902 C 13.258048,95.447908 10.071549,94.981011 9.2539007,93.658026 C 7.1231945,90.210482 9.7375867,83.729446 14.697767,80.162746 L 19.284499,76.864559 L 32.226699,87.758658 C 47.530117,100.64033 63.263112,109.42753 74.136789,111.1663 C 82.555064,112.51244 85.287914,115.79329 81.646114,120.18138 C 77.940809,124.646 66.533098,123.44089 54.981809,117.36455 C 49.183358,114.31439 44.065729,112.19224 43.609327,112.64866 C 42.195407,114.06256 58.535133,129.40174 68.983105,136.4687 C 82.893943,145.87792 99.314337,150.64583 118.36258,150.80678 C 145.52872,151.03631 162.76551,145.71413 177.25684,132.62207 C 188.34716,122.60263 188.94814,120.5505 182.73878,113.90333 C 175.81472,106.49109 168.70623,106.44964 158.32432,113.76097 C 147.98605,121.04152 132.76454,123.60855 116.61147,120.79561 C 102.20671,118.28713 93.486961,114.8298 92.037334,111.05211 C 91.442016,109.50075 89.277658,108.23147 87.227649,108.23147 C 85.17764,108.23147 83.500363,107.13687 83.500363,105.79902 C 83.500363,100.44846 105.44657,85.088853 110.38429,86.983634 C 112.97609,87.978198 112.0154,89.694925 104.72512,97.096507 L 95.944216,106.01146 L 108.89174,108.95633 C 125.60393,112.75743 132.19327,112.622 141.75698,108.28088 C 150.27283,104.41539 151.12833,102.11981 146.51015,95.52644 C 143.6484,91.440733 143.6695,91.029744 146.86084,88.696177 C 151.48792,85.312779 152.0368,85.452081 158.05294,91.536605 C 160.9479,94.464463 166.37382,97.689862 170.11052,98.704169 C 176.63713,100.47578 177.10469,100.28433 181.99078,93.839493 C 189.2319,84.288343 193.30348,81.242411 203.42538,77.804353 C 214.46761,74.053691 228.66626,75.111117 235.46998,80.190801 C 246.39872,88.350288 247.47071,106.01058 237.63431,115.84696 C 231.52704,121.95423 223.54183,122.71682 215.49179,117.96155 C 204.60894,111.53288 206.6535,105.81232 219.23735,107.48162 C 226.96374,108.50657 228.35458,108.17571 230.11029,104.8951 C 232.76067,99.942824 232.67127,92.999442 229.92172,90.249895 C 226.72145,87.049615 210.78434,87.553668 203.33017,91.0909 C 193.1595,95.917191 192.26182,100.31906 198.85898,113.01565 C 201.94886,118.9623 204.71121,126.71762 204.99756,130.24972 C 205.44391,135.75569 204.9522,136.67989 201.55033,136.72912 C 199.36802,136.7607 193.58823,140.51769 188.70635,145.078 C 183.82446,149.63829 177.14673,154.951 173.86693,156.88402 C 170.58712,158.81704 167.90365,161.08911 167.90365,161.93305 C 167.90365,162.77699 169.76144,166.76088 172.03207,170.78615 L 176.16049,178.10481 L 169.56843,184.21253 C 155.87761,196.89746 126.9335,201.90902 105.76326,195.26015 z M 124.39689,92.286528 C 123.73252,90.555233 124.16318,88.866818 125.37189,88.463902 C 128.82997,87.311229 127.89606,85.131073 122.98588,82.893835 C 115.70755,79.577611 118.94662,74.88732 128.04458,75.568657 C 133.65369,75.988728 136.35232,77.369401 139.27998,81.316906 L 143.13312,86.512278 L 137.98496,90.949892 C 131.98533,96.12141 126.09095,96.701224 124.39689,92.286528 z"
+ style="fill:#555753"
+ sodipodi:nodetypes="cssssssssssscccsssssssssssssscccsssssssssssssssssssscccccssscccc" />
+ <path
+ id="path4234"
+ d="M 110.50482,194.3016 C 101.29684,192.13337 94.533525,188.48684 89.271383,182.85325 C 82.390918,175.4871 85.936884,174.28107 99.528813,179.36455 C 115.59245,185.37247 143.30992,186.28633 152.7661,181.11982 C 159.03409,177.69523 160.98588,170.45868 156.43581,167.51383 C 155.17435,166.69739 142.9955,165.96174 129.37171,165.87907 C 108.80987,165.75428 102.74285,165.05333 93.663859,161.75352 C 73.025491,154.25244 49.561448,135.01491 39.768427,117.56612 C 35.780389,110.46041 36.411322,110.85564 48.942698,123.31318 C 70.302623,144.54723 92.258893,154.15548 119.15432,154.03838 C 135.83546,153.96576 152.56346,150.85172 163.02604,145.87134 C 172.41161,141.40363 189.9219,125.23231 189.9219,121.03213 C 189.9219,119.19248 187.7843,115.1469 185.17167,112.04198 C 178.58784,104.21754 168.03965,104.18244 155.55484,111.94343 C 150.18536,115.28129 142.95424,117.92581 137.39714,118.58397 C 127.97216,119.70021 104.80591,116.69758 100.01936,113.73933 C 94.450094,110.29735 100.24351,109.86707 113.23644,112.75774 C 127.9361,116.02809 138.20198,114.95313 146.93857,109.22869 C 153.28212,105.07225 154.19121,101.72283 150.50345,96.094621 C 148.24619,92.649609 147.93449,90.769617 149.38072,89.323385 C 150.82695,87.877153 153.0819,88.968084 157.50247,93.252689 C 160.86829,96.51495 166.83523,100.07126 170.76237,101.15561 C 177.28458,102.95648 178.14485,102.76481 180.70126,98.941361 C 190.46478,84.338673 203.44977,77.038962 219.66199,77.038962 C 239.73552,77.038962 249.19265,98.555619 235.51724,113.11244 C 230.28699,118.67977 219.45458,118.99815 214.68225,113.7248 C 210.40882,109.00271 211.87531,107.60004 218.46592,110.10579 C 222.73772,111.72993 224.48175,111.47356 228.23768,108.66934 C 235.27205,103.41743 237.01116,96.063887 232.61714,90.15151 C 228.70991,84.894138 221.3182,83.243302 210.64805,85.245036 C 203.22425,86.637745 191.75676,96.268143 191.75676,101.10994 C 191.75676,103.03903 194.23381,109.00645 197.26132,114.37093 C 203.6019,125.60581 204.5447,133.91945 199.47821,133.91945 C 197.66998,133.91945 192.50945,137.70093 188.01037,142.32275 C 183.51127,146.94454 176.32104,152.80279 172.03207,155.34108 C 163.73389,160.25204 162.48268,163.20921 167.08641,167.02996 C 171.28,170.51035 173.54029,175.47679 172.34649,178.58776 C 170.71762,182.83253 158.4385,190.19925 147.65345,193.40206 C 137.09511,196.53755 121.59442,196.91291 110.50482,194.3016 z M 56.408298,114.61872 C 49.129046,110.97705 38.716927,103.92466 33.270272,98.946719 L 23.367251,89.895915 L 16.969775,92.568949 C 9.3420288,95.756035 8.6495364,95.306148 9.7405408,87.872639 C 10.344685,83.75629 11.031471,82.8609 12.211447,84.651204 C 13.540212,86.667268 14.305567,86.530535 16.306604,83.919666 C 17.660139,82.153618 19.320682,80.708671 19.996697,80.708671 C 20.672694,80.708671 26.554779,85.229385 33.067979,90.7547 C 45.470438,101.27603 59.192323,109.15379 71.573791,112.86101 C 75.610471,114.06964 78.913208,116.20591 78.913208,117.60829 C 78.913208,122.46961 69.63857,121.23756 56.408298,114.61872 z M 87.170053,103.7711 C 87.170053,101.119 98.339717,92.839094 105.19954,90.406132 C 109.67365,88.819295 99.599675,99.261745 92.756946,103.30384 C 87.921829,106.16003 87.170053,106.22289 87.170053,103.7711 z M 129.35231,88.988873 C 132.38564,85.333953 130.37875,80.708671 125.7596,80.708671 C 123.70957,80.708671 122.03229,79.882986 122.03229,78.873816 C 122.03229,76.472212 130.46732,76.514212 134.9969,78.938366 C 141.6449,82.496277 137.51074,91.717796 129.26767,91.717796 C 127.62199,91.717796 127.64274,91.04879 129.35231,88.988873 z"
+ style="fill:#000000;fill-opacity:1"
+ sodipodi:nodetypes="cssssssssssssssssssssssssssssssssssssscccccsssssssccssccssssc" />
+ </g>
+</svg>
diff --git a/library/listbox.tcl b/library/listbox.tcl
index f3434a5..99047f4 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -194,6 +194,9 @@ if {[tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}
+ bind Listbox <Shift-MouseWheel> {
+ %W xview scroll [expr {- (%D / 120) * 4}] units
+ }
}
if {"x11" eq [tk windowingsystem]} {
@@ -206,11 +209,21 @@ if {"x11" eq [tk windowingsystem]} {
%W yview scroll -5 units
}
}
+ bind Listbox <Shift-4> {
+ if {!$tk_strictMotif} {
+ %W xview scroll -5 units
+ }
+ }
bind Listbox <5> {
if {!$tk_strictMotif} {
%W yview scroll 5 units
}
}
+ bind Listbox <Shift-5> {
+ if {!$tk_strictMotif} {
+ %W xview scroll 5 units
+ }
+ }
}
# ::tk::ListboxBeginSelect --
diff --git a/library/megawidget.tcl b/library/megawidget.tcl
new file mode 100644
index 0000000..1cd2900
--- /dev/null
+++ b/library/megawidget.tcl
@@ -0,0 +1,140 @@
+# megawidget.tcl
+#
+# Basic megawidget support classes. Experimental for any use other than
+# the ::tk::IconList megawdget, which is itself only designed for use in
+# the Unix file dialogs.
+#
+# Copyright (c) 2009-2010 Donal K. Fellows
+#
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+
+package require Tk 8.6
+
+::oo::class create ::tk::Megawidget {
+ superclass ::oo::class
+ method unknown {w args} {
+ if {[string match .* $w]} {
+ [self] create $w {*}$args
+ return $w
+ }
+ next $w {*}$args
+ }
+ unexport new unknown
+ self method create {name superclasses body} {
+ next $name [list \
+ superclass ::tk::MegawidgetClass {*}$superclasses]\;$body
+ }
+}
+
+::oo::class create ::tk::MegawidgetClass {
+ variable w hull OptionSpecification options IdleCallbacks
+ constructor args {
+ # Extract the "widget name" from the object name
+ set w [namespace tail [self]]
+
+ # Configure things
+ set OptionSpecification [my GetSpecs]
+ my configure {*}$args
+
+ # Move the object out of the way of the hull widget
+ rename [self] _tmp
+
+ # Make the hull widget(s)
+ my CreateHull
+ bind $hull <Destroy> [list [namespace which my] destroy]
+
+ # Rename things into their final places
+ rename ::$w theFrame
+ rename [self] ::$w
+
+ # Make the contents
+ my Create
+ }
+ destructor {
+ foreach {name cb} [array get IdleCallbacks] {
+ after cancel $cb
+ unset IdleCallbacks($name)
+ }
+ if {[winfo exists $w]} {
+ bind $hull <Destroy> {}
+ destroy $w
+ }
+ }
+
+ method configure args {
+ tclParseConfigSpec [my varname options] $OptionSpecification "" $args
+ }
+ method cget option {
+ return $options($option)
+ }
+
+ method GetSpecs {} {
+ return {
+ {-takefocus takeFocus TakeFocus {}}
+ }
+ }
+
+ method CreateHull {} {error "method must be overridden"}
+ method Create {} {error "method must be overridden"}
+
+ method WhenIdle {method args} {
+ if {![info exists IdleCallbacks($method)]} {
+ set IdleCallbacks($method) [after idle [list \
+ [namespace which my] DoWhenIdle $method $args]]
+ }
+ }
+ method DoWhenIdle {method arguments} {
+ unset IdleCallbacks($method)
+ tailcall my $method {*}$arguments
+ }
+}
+
+::tk::Megawidget create ::tk::SimpleWidget {} {
+ variable w hull options
+ method GetSpecs {} {
+ return {
+ {-cursor cursor Cursor {}}
+ {-takefocus takeFocus TakeFocus {}}
+ }
+ }
+ method CreateHull {} {
+ set hull [::ttk::frame $w -cursor $options(-cursor)]
+ trace add variable options(-cursor) write \
+ [namespace code {my UpdateCursorOption}]
+ }
+ method UpdateCursorOption args {
+ $hull configure -cursor $options(-cursor)
+ }
+ method state args {
+ tailcall $hull state {*}$args
+ }
+ method instate args {
+ tailcall $hull instate {*}$args
+ }
+}
+
+::tk::Megawidget create ::tk::FocusableWidget ::tk::SimpleWidget {
+ variable w hull options
+ method GetSpecs {} {
+ return {
+ {-cursor cursor Cursor {}}
+ {-takefocus takeFocus TakeFocus ::ttk::takefocus}
+ }
+ }
+ method CreateHull {} {
+ ttk::frame $w
+ set hull [ttk::entry $w.cHull -takefocus 0 -cursor $options(-cursor)]
+ pack $hull -expand yes -fill both -ipadx 2 -ipady 2
+ trace add variable options(-cursor) write \
+ [namespace code {my UpdateCursorOption}]
+ }
+}
+
+return
+
+# Local Variables:
+# mode: tcl
+# fill-column: 78
+# End:
diff --git a/library/mkpsenc.tcl b/library/mkpsenc.tcl
index 9efb6de..50224eb 100644
--- a/library/mkpsenc.tcl
+++ b/library/mkpsenc.tcl
@@ -1,1365 +1,1487 @@
# mkpsenc.tcl --
#
-# Creates Postscript encoding vector for given encoding
-#
+# This file generates the postscript prolog used by Tk.
-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"
+namespace eval ::tk {
+ # Creates Postscript encoding vector for ISO-8859-1 (could theoretically
+ # handle any 8-bit encoding, but Tk never generates characters outside
+ # ASCII).
+ #
+ proc CreatePostscriptEncoding {} {
+ variable psglyphs
+ # 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 "\[\n"
+ for {set i 0} {$i<256} {incr i 8} {
+ for {set j 0} {$j<8} {incr j} {
+ set enc [encoding convertfrom "iso8859-1" \
+ [format %c [expr {$i+$j}]]]
+ catch {
+ set hexcode {}
+ set hexcode [format %04X [scan $enc %c]]
+ }
+ if {[info exists psglyphs($hexcode)]} {
+ append result "/$psglyphs($hexcode)"
+ } else {
+ append result "/space"
+ }
}
+ append result "\n"
}
- append result "\n"
+ append result "\]"
+ return $result
}
- 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.
-% 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).
+ # List of adobe glyph names. Converted from glyphlist.txt, downloaded from
+ # Adobe.
-/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
+ variable psglyphs
+ 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
+ }
+ variable ps_preamble {}
-/cstringshow {
- {
- dup type /stringtype eq
- { show } { glyphshow }
- ifelse
+ namespace eval ps {
+ namespace ensemble create
+ namespace export {[a-z]*}
+ proc literal {string} {
+ upvar 0 ::tk::ps_preamble preamble
+ foreach line [split $string \n] {
+ set line [string trim $line]
+ if {$line eq ""} continue
+ append preamble $line \n
+ }
+ return
+ }
+ proc variable {name value} {
+ upvar 0 ::tk::ps_preamble preamble
+ append preamble "/$name $value def\n"
+ return
+ }
+ proc function {name body} {
+ upvar 0 ::tk::ps_preamble preamble
+ append preamble "/$name \{"
+ foreach line [split $body \n] {
+ set line [string trim $line]
+ # Strip blank lines and comments from the bodies of functions
+ if {$line eq "" } continue
+ if {[string match {[%#]*} $line]} continue
+ append preamble $line " "
+ }
+ append preamble "\} bind def\n"
+ return
+ }
}
- forall
-} bind def
+ ps literal {
+ %%BeginProlog
+ % This is a standard prolog for Postscript generated by Tk's canvas
+ % widget.
+ }
+ ps variable CurrentEncoding [CreatePostscriptEncoding]
+ ps literal {50 dict begin}
+ # 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).
+ ps variable baseline 0
+ ps variable stipimage 0
+ ps variable height 0
+ ps variable justify 0
+ ps variable lineLength 0
+ ps variable spacing 0
+ ps variable stipple 0
+ ps variable strings 0
+ ps variable xoffset 0
+ ps variable yoffset 0
+ ps variable tmpstip null
+ ps variable baselineSampler "( TXygqPZ)"
+ # Put an extra-tall character in; done this way to avoid encoding trouble
+ ps literal {baselineSampler 0 196 put}
-/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
+ ps function cstringshow {
+ {
+ dup type /stringtype eq
+ { show } { glyphshow }
+ ifelse
+ } forall
}
- 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.
+ ps function 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
+ }
-/ISOEncode {
- dup length dict begin
+ # 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.
+ ps function 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
+ 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
+ }
- % 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
+ # 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.
+ ps function StrokeClip {
+ {strokepath} stopped {
+ (This Postscript printer gets limitcheck overflows when) =
+ (stippling dashed lines; lines will be printed solid instead.) =
+ [] 0 setdash strokepath} if
+ clip
+ }
- 6 index exch {
- 2 index 5 index 3 index {
- % Stack now: width height string y1 y2 x y
+ # 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.
+ ps function 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
+ }
- gsave
- 1 index exch translate
- 5 index 5 index true matrix tmpstip imagemask
- grestore
+ # 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.
+ ps function 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
- } 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.
+ pop pop pop pop pop
+ }
-/AdjustColor {
- CL 2 lt {
- currentgray
- CL 0 eq {
- .5 lt {0} {1} ifelse
+ # -- 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.
+ ps function AdjustColor {
+ CL 2 lt {
+ currentgray
+ CL 0 eq {
+ .5 lt {0} {1} ifelse
+ } if
+ setgray
} 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
+ # 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, function 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.
+ ps function 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 baselineSampler false charpath
+ pathbbox dup /baseline exch def
+ exch pop exch sub /height exch def pop
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.
+ % Translate and rotate coordinates first so that the origin is at
+ % the upper-left corner of the text's bounding box. Remember that
+ % angle for rotating, and x and y for positioning are still on the
+ % stack.
+ translate
+ rotate
+ 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
+ }
- 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.
+ # Define the "TkPhoto" function variants, which are modified versions
+ # of the original "transparentimage" function posted by ian@five-d.com
+ # (Ian Kemmish) to comp.lang.postscript. For a monochrome colorLevel
+ # this is a slightly different version that uses the imagemask command
+ # instead of image.
- gsave
- /char (X) def
+ ps function TkPhotoColor {
+ gsave
+ 32 dict begin
+ /tinteger exch def
+ /transparent 1 string def
+ transparent 0 tinteger put
+ /olddict exch def
+ olddict /DataSource get dup type /filetype ne {
+ olddict /DataSource 3 -1 roll
+ 0 () /SubFileDecode filter put
+ } {
+ pop
+ } ifelse
+ /newdict olddict maxlength dict def
+ olddict newdict copy pop
+ /w newdict /Width get def
+ /crpp newdict /Decode get length 2 idiv def
+ /str w string def
+ /pix w crpp mul string def
+ /substrlen 2 w log 2 log div floor exp cvi def
+ /substrs [ {
+ substrlen string
+ 0 1 substrlen 1 sub {
+ 1 index exch tinteger put
+ } for
+ /substrlen substrlen 2 idiv def
+ substrlen 0 eq {exit} if
+ } loop ] def
+ /h newdict /Height get def
+ 1 w div 1 h div matrix scale
+ olddict /ImageMatrix get exch matrix concatmatrix
+ matrix invertmatrix concat
+ newdict /Height 1 put
+ newdict /DataSource pix put
+ /mat [w 0 0 h 0 0] def
+ newdict /ImageMatrix mat put
+ 0 1 h 1 sub {
+ mat 5 3 -1 roll neg put
+ olddict /DataSource get str readstring pop pop
+ /tail str def
+ /x 0 def
+ olddict /DataSource get pix readstring pop pop
{
- 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
-}
+ tail transparent search dup /done exch not def
+ {exch pop exch pop} if
+ /w1 exch length def
+ w1 0 ne {
+ newdict /DataSource
+ pix x crpp mul w1 crpp mul getinterval put
+ newdict /Width w1 put
+ mat 4 x neg put
+ /x x w1 add def
+ newdict image
+ /tail tail w1 tail length w1 sub getinterval def
+ } if
+ done {exit} if
+ tail substrs {
+ anchorsearch {pop} if
+ } forall
+ /tail exch def
+ tail length 0 eq {exit} if
+ /x w tail length sub def
+ } loop
+ } for
+ end
+ grestore
+ }
+ ps function TkPhotoMono {
+ gsave
+ 32 dict begin
+ /dummyInteger exch def
+ /olddict exch def
+ olddict /DataSource get dup type /filetype ne {
+ olddict /DataSource 3 -1 roll
+ 0 () /SubFileDecode filter put
+ } {
+ pop
+ } ifelse
+ /newdict olddict maxlength dict def
+ olddict newdict copy pop
+ /w newdict /Width get def
+ /pix w 7 add 8 idiv string def
+ /h newdict /Height get def
+ 1 w div 1 h div matrix scale
+ olddict /ImageMatrix get exch matrix concatmatrix
+ matrix invertmatrix concat
+ newdict /Height 1 put
+ newdict /DataSource pix put
+ /mat [w 0 0 h 0 0] def
+ newdict /ImageMatrix mat put
+ 0 1 h 1 sub {
+ mat 5 3 -1 roll neg put
+ 0.000 0.000 0.000 setrgbcolor
+ olddict /DataSource get pix readstring pop pop
+ newdict /DataSource pix put
+ newdict imagemask
+ 1.000 1.000 1.000 setrgbcolor
+ olddict /DataSource get pix readstring pop pop
+ newdict /DataSource pix put
+ newdict imagemask
+ } for
+ end
+ grestore
+ }
+ ps literal %%EndProlog
}
proc tk::ensure_psenc_is_loaded {} {
diff --git a/library/msgbox.tcl b/library/msgbox.tcl
index ed1f4fe..087567e 100644
--- a/library/msgbox.tcl
+++ b/library/msgbox.tcl
@@ -271,15 +271,11 @@ proc ::tk::MessageBox {args} {
wm attributes $w -type dialog
}
- ttk::frame $w.bot;# -background $bg
+ ttk::frame $w.bot
grid anchor $w.bot center
pack $w.bot -side bottom -fill both
- ttk::frame $w.top;# -background $bg
+ ttk::frame $w.top
pack $w.top -side top -fill both -expand 1
- if {$windowingsystem ne "aqua"} {
- #$w.bot configure -relief raised -bd 1
- #$w.top configure -relief raised -bd 1
- }
# 4. Fill the top part with bitmap, message and detail (use the
# option database for -wraplength and -font so that they can be
@@ -291,53 +287,32 @@ proc ::tk::MessageBox {args} {
option add *Dialog.dtl.font TkDefaultFont widgetDefault
ttk::label $w.msg -anchor nw -justify left -text $data(-message)
- #-background $bg
if {$data(-detail) ne ""} {
ttk::label $w.dtl -anchor nw -justify left -text $data(-detail)
- #-background $bg
}
if {$data(-icon) ne ""} {
- if {$windowingsystem eq "aqua"
- || ([winfo depth $w] < 4) || $tk_strictMotif} {
+ if {([winfo depth $w] < 4) || $tk_strictMotif} {
# ttk::label has no -bitmap option
- label $w.bitmap -bitmap $data(-icon);# -background $bg
+ label $w.bitmap -bitmap $data(-icon) -background $bg
} else {
- 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
- $w.bitmap create line 9 9 23 23 -fill white -width 4
- $w.bitmap create line 9 23 23 9 -fill white -width 4
- }
- info {
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::b1
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::b2
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::i
- }
- question {
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::b1
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::b2
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::q
- }
- default {
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::w1
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::w2
- $w.bitmap create image 0 0 -anchor nw \
- -image ::tk::dialog::w3
- }
+ error {
+ ttk::label $w.bitmap -image ::tk::icons::error
+ }
+ info {
+ ttk::label $w.bitmap -image ::tk::icons::information
+ }
+ question {
+ ttk::label $w.bitmap -image ::tk::icons::question
+ }
+ default {
+ ttk::label $w.bitmap -image ::tk::icons::warning
+ }
}
}
}
grid $w.bitmap $w.msg -in $w.top -sticky news -padx 2m -pady 2m
+ grid configure $w.bitmap -sticky nw
grid columnconfigure $w.top 1 -weight 1
if {$data(-detail) ne ""} {
grid ^ $w.dtl -in $w.top -sticky news -padx 2m -pady {0 2m}
@@ -360,7 +335,6 @@ proc ::tk::MessageBox {args} {
eval [list tk::AmpWidget ttk::button $w.$name] $opts \
[list -command [list set tk::Priv(button) $name]]
- # -padx 3m
if {$name eq $data(-default)} {
$w.$name configure -default active
diff --git a/library/msgs/cs.msg b/library/msgs/cs.msg
index cd86ca9..d6be730 100644
--- a/library/msgs/cs.msg
+++ b/library/msgs/cs.msg
@@ -1,72 +1,65 @@
namespace eval ::tk {
::msgcat::mcset cs "&Abort" "&P\u0159eru\u0161it"
::msgcat::mcset cs "&About..." "&O programu..."
- ::msgcat::mcset cs "&Blue" "&Modr\341"
- ::msgcat::mcset cs "&Cancel" "&Zru\u0161it"
- ::msgcat::mcset cs "&Clear Console" "&Smazat konzolu"
- ::msgcat::mcset cs "&Copy" "&Kop\355rovat"
- ::msgcat::mcset cs "&Delete" "&Smazat"
- ::msgcat::mcset cs "&Directory:" "&Adres\341\u0159:"
- ::msgcat::mcset cs "&Edit" "&\332pravy"
- ::msgcat::mcset cs "&File" "&Soubor"
- ::msgcat::mcset cs "&Filter" "&Filtr"
- ::msgcat::mcset cs "&Green" "Ze&len\341"
- ::msgcat::mcset cs "&Help" "&N\341pov\u011bda"
- ::msgcat::mcset cs "&Hide Console" "&Schovat Konzolu"
- ::msgcat::mcset cs "&Ignore" "&Ignorovat"
- ::msgcat::mcset cs "&No" "&Ne"
- ::msgcat::mcset cs "&OK"
- ::msgcat::mcset cs "&Open" "&Otev\u0159\355t"
- ::msgcat::mcset cs "&Quit" "&Ukon\u010dit"
- ::msgcat::mcset cs "&Red" "\u010ce&rven\341"
- ::msgcat::mcset cs "&Retry" "Z&novu"
- ::msgcat::mcset cs "&Save" "&Ulo\u017eit"
- ::msgcat::mcset cs "&Selection:" "&V\375b\u011br:"
- ::msgcat::mcset cs "&Source..." "&Zdroj..."
- ::msgcat::mcset cs "&Yes" "&Ano"
- ::msgcat::mcset cs "About..." "O programu..."
::msgcat::mcset cs "All Files" "V\u0161echny soubory"
::msgcat::mcset cs "Application Error" "Chyba programu"
+ ::msgcat::mcset cs "Bold Italic"
+ ::msgcat::mcset cs "&Blue" "&Modr\341"
+ ::msgcat::mcset cs "Cancel" "Zru\u0161it"
+ ::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 "Cl&ear" "Sma&zat"
- ::msgcat::mcset cs "Clear" "Smazat"
+ ::msgcat::mcset cs "&Clear Console" "&Smazat konzolu"
::msgcat::mcset cs "Color" "Barva"
::msgcat::mcset cs "Console" "Konzole"
- ::msgcat::mcset cs "Copy" "Kop\355rovat"
+ ::msgcat::mcset cs "&Copy" "&Kop\355rovat"
::msgcat::mcset cs "Cu&t" "V&y\u0159\355znout"
- ::msgcat::mcset cs "Cut" "Vy\u0159\355znout"
- ::msgcat::mcset cs "Delete" "Smazat"
+ ::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 "E&xit" "&Konec"
+ ::msgcat::mcset cs "&Directory:" "&Adres\341\u0159:"
+ ::msgcat::mcset cs "&Edit" "&\332pravy"
::msgcat::mcset cs "Error: %1\$s" "Chyba: %1\$s"
- ::msgcat::mcset cs "Exit" "Konec"
- ::msgcat::mcset cs "Fi&les:" "Sou&bory:"
- ::msgcat::mcset cs "Fil&ter:" "Fil&tr:"
- ::msgcat::mcset cs "File \"%1\$s\" already exists.\n\n" "Soubor \"%1\$s\" ji\u017e existuje.\n\n"
+ ::msgcat::mcset cs "E&xit" "&Konec"
+ ::msgcat::mcset cs "&File" "&Soubor"
::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\" already exists.\n\n" "Soubor \"%1\$s\" ji\u017e existuje.\n\n"
::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 "Font st&yle:"
+ ::msgcat::mcset cs "&Green" "Ze&len\341"
+ ::msgcat::mcset cs "&Help" "&N\341pov\u011bda"
::msgcat::mcset cs "Hi" "Ahoj"
- ::msgcat::mcset cs "Hide Console" "Skr\375t konsolu"
+ ::msgcat::mcset cs "&Hide Console" "&Schovat Konzolu"
+ ::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 "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 "P&aste" "&Vlo\u017eit"
- ::msgcat::mcset cs "Paste" "Vlo\u017eit"
- ::msgcat::mcset cs "Quit" "Skon\u010dit"
+ ::msgcat::mcset cs "&Quit" "&Ukon\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 "&Source..." "&Zdroj..."
::msgcat::mcset cs "Tcl Scripts" "Tcl skripty"
::msgcat::mcset cs "Tcl for Windows" "Tcl pro Windows"
::msgcat::mcset cs "Text Files" "Textov\351 soubory"
diff --git a/library/msgs/da.msg b/library/msgs/da.msg
index c749608..c302c79 100644
--- a/library/msgs/da.msg
+++ b/library/msgs/da.msg
@@ -4,10 +4,11 @@ namespace eval ::tk {
::msgcat::mcset da "All Files" "Alle filer"
::msgcat::mcset da "Application Error" "Programfejl"
::msgcat::mcset da "&Blue" "&Bl\u00E5"
+ ::msgcat::mcset da "Cancel" "Annuller"
::msgcat::mcset da "&Cancel" "&Annuller"
::msgcat::mcset da "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kan ikke skifte til katalog \"%1\$s\".\nIngen rettigheder."
::msgcat::mcset da "Choose Directory" "V\u00E6lg katalog"
- ::msgcat::mcset da "&Clear" "&Ryd"
+ ::msgcat::mcset da "Cl&ear" "&Ryd"
::msgcat::mcset da "&Clear Console" "&Ryd konsolen"
::msgcat::mcset da "Color" "Farve"
::msgcat::mcset da "Console" "Konsol"
@@ -38,8 +39,8 @@ namespace eval ::tk {
::msgcat::mcset da "Invalid file name \"%1\$s\"." "Ugyldig fil navn \"%1\$s\"."
::msgcat::mcset da "Log Files" "Logfiler"
::msgcat::mcset da "&No" "&Nej"
- ::msgcat::mcset da "OK" "O.K."
::msgcat::mcset da "&OK" "&O.K."
+ ::msgcat::mcset da "OK" "O.K."
::msgcat::mcset da "Ok"
::msgcat::mcset da "Open" "\u00C5bn"
::msgcat::mcset da "&Open" "&\u00C5bn"
diff --git a/library/msgs/de.msg b/library/msgs/de.msg
index 7750313..e420f8a 100644
--- a/library/msgs/de.msg
+++ b/library/msgs/de.msg
@@ -3,7 +3,11 @@ namespace eval ::tk {
::msgcat::mcset de "&About..." "&\u00dcber..."
::msgcat::mcset de "All Files" "Alle Dateien"
::msgcat::mcset de "Application Error" "Applikationsfehler"
+ ::msgcat::mcset de "&Apply" "&Anwenden"
+ ::msgcat::mcset de "Bold" "Fett"
+ ::msgcat::mcset de "Bold Italic" "Fett kursiv"
::msgcat::mcset de "&Blue" "&Blau"
+ ::msgcat::mcset de "Cancel" "Abbruch"
::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"
@@ -18,6 +22,7 @@ namespace eval ::tk {
::msgcat::mcset de "Directory \"%1\$s\" does not exist." "Das Verzeichnis \"%1\$s\" existiert nicht."
::msgcat::mcset de "&Directory:" "&Verzeichnis:"
::msgcat::mcset de "&Edit" "&Bearbeiten"
+ ::msgcat::mcset de "Effects" "Effekte"
::msgcat::mcset de "Error: %1\$s" "Fehler: %1\$s"
::msgcat::mcset de "E&xit" "&Ende"
::msgcat::mcset de "&File" "&Datei"
@@ -30,15 +35,20 @@ namespace eval ::tk {
::msgcat::mcset de "Fi&les:" "Dat&eien:"
::msgcat::mcset de "&Filter"
::msgcat::mcset de "Fil&ter:"
+ ::msgcat::mcset de "Font" "Schriftart"
+ ::msgcat::mcset de "&Font:" "Schriftart:"
+ ::msgcat::mcset de "Font st&yle:" "Schriftschnitt:"
::msgcat::mcset de "&Green" "&Gr\u00fcn"
::msgcat::mcset de "&Help" "&Hilfe"
::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 "Italic" "Kursiv"
::msgcat::mcset de "Log Files" "Protokolldatei"
::msgcat::mcset de "&No" "&Nein"
::msgcat::mcset de "&OK"
+ ::msgcat::mcset de "OK"
::msgcat::mcset de "Ok"
::msgcat::mcset de "Open" "\u00d6ffnen"
::msgcat::mcset de "&Open" "\u00d6&ffnen"
@@ -46,21 +56,26 @@ namespace eval ::tk {
::msgcat::mcset de "P&aste" "E&inf\u00fcgen"
::msgcat::mcset de "&Quit" "&Beenden"
::msgcat::mcset de "&Red" "&Rot"
+ ::msgcat::mcset de "Regular" "Standard"
::msgcat::mcset de "Replace existing file?" "Existierende Datei ersetzen?"
::msgcat::mcset de "&Retry" "&Wiederholen"
+ ::msgcat::mcset de "Sample" "Beispiel"
::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 "&Size:" "Schriftgrad:"
::msgcat::mcset de "Show &Hidden Directories" "Zeige versteckte Dateien"
::msgcat::mcset de "Show &Hidden Files and Directories" "Zeige versteckte Dateien und Verzeichnisse"
::msgcat::mcset de "Skip Messages" "Weitere Nachrichten \u00fcberspringen"
::msgcat::mcset de "&Source..." "&Ausf\u00fchren..."
+ ::msgcat::mcset de "Stri&keout" "&Durchgestrichen"
::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 "&Underline" "&Unterstrichen"
::msgcat::mcset de "&Yes" "&Ja"
::msgcat::mcset de "abort" "abbrechen"
::msgcat::mcset de "blue" "blau"
diff --git a/library/msgs/el.msg b/library/msgs/el.msg
index 1dcc451..2e3f236 100644
--- a/library/msgs/el.msg
+++ b/library/msgs/el.msg
@@ -47,12 +47,13 @@ namespace eval ::tk {
::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 "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 "P&aste" "\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?" \
@@ -66,7 +67,7 @@ namespace eval ::tk {
"\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\u03b7\u03bd\u03c5\u03bc\u03ac\u03c4\u03c9\u03bd"
- ::msgcat::mcset el "Source..." "\u0395\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7..."
+ ::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"
@@ -83,4 +84,3 @@ namespace eval ::tk {
::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/library/msgs/en.msg b/library/msgs/en.msg
index b4e51bf..5ad1094 100644
--- a/library/msgs/en.msg
+++ b/library/msgs/en.msg
@@ -3,7 +3,11 @@ namespace eval ::tk {
::msgcat::mcset en "&About..."
::msgcat::mcset en "All Files"
::msgcat::mcset en "Application Error"
+ ::msgcat::mcset en "&Apply"
+ ::msgcat::mcset en "Bold"
+ ::msgcat::mcset en "Bold Italic"
::msgcat::mcset en "&Blue"
+ ::msgcat::mcset en "Cancel"
::msgcat::mcset en "&Cancel"
::msgcat::mcset en "Cannot change to the directory \"%1\$s\".\nPermission denied."
::msgcat::mcset en "Choose Directory"
@@ -18,6 +22,7 @@ namespace eval ::tk {
::msgcat::mcset en "Directory \"%1\$s\" does not exist."
::msgcat::mcset en "&Directory:"
::msgcat::mcset en "&Edit"
+ ::msgcat::mcset en "Effects"
::msgcat::mcset en "Error: %1\$s"
::msgcat::mcset en "E&xit"
::msgcat::mcset en "&File"
@@ -30,15 +35,20 @@ namespace eval ::tk {
::msgcat::mcset en "Fi&les:"
::msgcat::mcset en "&Filter"
::msgcat::mcset en "Fil&ter:"
+ ::msgcat::mcset en "Font"
+ ::msgcat::mcset en "&Font:"
+ ::msgcat::mcset en "Font st&yle:"
::msgcat::mcset en "&Green"
::msgcat::mcset en "&Help"
::msgcat::mcset en "Hi"
::msgcat::mcset en "&Hide Console"
::msgcat::mcset en "&Ignore"
::msgcat::mcset en "Invalid file name \"%1\$s\"."
+ ::msgcat::mcset en "Italic"
::msgcat::mcset en "Log Files"
::msgcat::mcset en "&No"
::msgcat::mcset en "&OK"
+ ::msgcat::mcset en "OK"
::msgcat::mcset en "Ok"
::msgcat::mcset en "Open"
::msgcat::mcset en "&Open"
@@ -46,21 +56,26 @@ namespace eval ::tk {
::msgcat::mcset en "P&aste"
::msgcat::mcset en "&Quit"
::msgcat::mcset en "&Red"
+ ::msgcat::mcset en "Regular"
::msgcat::mcset en "Replace existing file?"
::msgcat::mcset en "&Retry"
+ ::msgcat::mcset en "Sample"
::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 "&Size:"
::msgcat::mcset en "Show &Hidden Directories"
::msgcat::mcset en "Show &Hidden Files and Directories"
::msgcat::mcset en "Skip Messages"
::msgcat::mcset en "&Source..."
+ ::msgcat::mcset en "Stri&keout"
::msgcat::mcset en "Tcl Scripts"
::msgcat::mcset en "Tcl for Windows"
::msgcat::mcset en "Text Files"
+ ::msgcat::mcset en "&Underline"
::msgcat::mcset en "&Yes"
::msgcat::mcset en "abort"
::msgcat::mcset en "blue"
diff --git a/library/msgs/eo.msg b/library/msgs/eo.msg
index 85436c3..3645630 100644
--- a/library/msgs/eo.msg
+++ b/library/msgs/eo.msg
@@ -4,10 +4,11 @@ namespace eval ::tk {
::msgcat::mcset eo "All Files" "\u0108ioj dosieroj"
::msgcat::mcset eo "Application Error" "Aplikoerraro"
::msgcat::mcset eo "&Blue" "&Blua"
+ ::msgcat::mcset eo "Cancel" "Rezignu"
::msgcat::mcset eo "&Cancel" "&Rezignu"
::msgcat::mcset eo "Cannot change to the directory \"%1\$s\".\nPermission denied." "Neeble \u0109angi al dosierulon \"%1\$s\".\nVi ne rajtas tion."
::msgcat::mcset eo "Choose Directory" "Elektu Dosierujo"
- ::msgcat::mcset eo "&Clear" "&Klaru"
+ ::msgcat::mcset eo "Cl&ear" "&Klaru"
::msgcat::mcset eo "&Clear Console" "&Klaru konzolon"
::msgcat::mcset eo "Color" "Farbo"
::msgcat::mcset eo "Console" "Konzolo"
@@ -38,6 +39,7 @@ namespace eval ::tk {
::msgcat::mcset eo "Invalid file name \"%1\$s\"." "Malvalida dosieronomo \"%1\$s\"."
::msgcat::mcset eo "Log Files" "Protokolo"
::msgcat::mcset eo "&No" "&Ne"
+ ::msgcat::mcset eo "&OK"
::msgcat::mcset eo "OK"
::msgcat::mcset eo "Ok"
::msgcat::mcset eo "Open" "Malfermu"
diff --git a/library/msgs/es.msg b/library/msgs/es.msg
index ceb12d6..991711b 100644
--- a/library/msgs/es.msg
+++ b/library/msgs/es.msg
@@ -4,12 +4,13 @@ namespace eval ::tk {
::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 "&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 "Cl&ear" "&Borrar"
::msgcat::mcset es "&Clear Console" "&Borrar consola"
- ::msgcat::mcset es "Color" "Color"
+ ::msgcat::mcset es "Color"
::msgcat::mcset es "Console" "Consola"
::msgcat::mcset es "&Copy" "&Copiar"
::msgcat::mcset es "Cu&t" "Cor&tar"
@@ -18,7 +19,7 @@ namespace eval ::tk {
::msgcat::mcset es "Directory \"%1\$s\" does not exist." "El directorio \"%1\$s\" no existe."
::msgcat::mcset es "&Directory:" "&Directorio:"
::msgcat::mcset es "&Edit" "&Editar"
- ::msgcat::mcset es "Error: %1\$s" "Error: %1\$s"
+ ::msgcat::mcset es "Error: %1\$s"
::msgcat::mcset es "E&xit" "Salir"
::msgcat::mcset es "&File" "&Archivo"
::msgcat::mcset es "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "El archivo \"%1\$s\" ya existe.\n\u00bfDesea sobreescribirlo?"
@@ -37,9 +38,10 @@ namespace eval ::tk {
::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 "&No"
+ ::msgcat::mcset es "&OK"
+ ::msgcat::mcset es "OK"
+ ::msgcat::mcset es "Ok"
::msgcat::mcset es "Open" "Abrir"
::msgcat::mcset es "&Open" "&Abrir"
::msgcat::mcset es "Open Multiple Files" "Abrir m\u00faltiples archivos"
@@ -67,7 +69,7 @@ namespace eval ::tk {
::msgcat::mcset es "extensions" "extensiones"
::msgcat::mcset es "green" "verde"
::msgcat::mcset es "ignore" "ignorar"
- ::msgcat::mcset es "ok" "ok"
+ ::msgcat::mcset es "ok"
::msgcat::mcset es "red" "rojo"
::msgcat::mcset es "retry" "reintentar"
::msgcat::mcset es "yes" "s\u00ed"
diff --git a/library/msgs/fr.msg b/library/msgs/fr.msg
index b1eb7e3..7f42aca 100644
--- a/library/msgs/fr.msg
+++ b/library/msgs/fr.msg
@@ -4,20 +4,21 @@ namespace eval ::tk {
::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 "&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 "Cl&ear" "Effacer"
::msgcat::mcset fr "Color" "Couleur"
::msgcat::mcset fr "Console"
::msgcat::mcset fr "Copy" "Copier"
- ::msgcat::mcset fr "Cut" "Couper"
+ ::msgcat::mcset fr "Cu&t" "Couper"
::msgcat::mcset fr "Delete" "Effacer"
::msgcat::mcset fr "Details >>" "D\u00e9tails >>"
::msgcat::mcset fr "Directory \"%1\$s\" does not exist." "Le r\u00e9pertoire \"%1\$s\" n'existe pas."
::msgcat::mcset fr "&Directory:" "&R\u00e9pertoire:"
::msgcat::mcset fr "Error: %1\$s" "Erreur: %1\$s"
- ::msgcat::mcset fr "Exit" "Quitter"
+ ::msgcat::mcset fr "E&xit" "Quitter"
::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."
@@ -29,18 +30,19 @@ namespace eval ::tk {
::msgcat::mcset fr "Fil&ter:" "Fil&tre:"
::msgcat::mcset fr "&Green" "&Vert"
::msgcat::mcset fr "Hi" "Salut"
- ::msgcat::mcset fr "Hide Console" "Cacher la Console"
+ ::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 "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" "Quitter"
+ ::msgcat::mcset fr "P&aste" "Coller"
+ ::msgcat::mcset fr "&Quit" "&Quitter"
::msgcat::mcset fr "&Red" "&Rouge"
::msgcat::mcset fr "Replace existing file?" "Remplacer le fichier existant?"
::msgcat::mcset fr "&Retry" "&R\u00e9-essayer"
@@ -51,7 +53,7 @@ namespace eval ::tk {
::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 "&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"
diff --git a/library/msgs/hu.msg b/library/msgs/hu.msg
index fc4700f..38ef0b8 100644
--- a/library/msgs/hu.msg
+++ b/library/msgs/hu.msg
@@ -1,14 +1,14 @@
namespace eval ::tk {
::msgcat::mcset hu "&Abort" "&Megszak\u00edt\u00e1s"
- ::msgcat::mcset hu "About..." "N\u00e9vjegy..."
+ ::msgcat::mcset hu "&About..." "N\u00e9vjegy..."
::msgcat::mcset hu "All Files" "Minden f\u00e1jl"
- ::msgcat::mcset hu "All Files (*) " "Minden f\u00e1jl (*) "
::msgcat::mcset hu "Application Error" "Alkalmaz\u00e1s hiba"
::msgcat::mcset hu "&Blue" "&K\u00e9k"
+ ::msgcat::mcset hu "Cancel" "M\u00e9gsem"
::msgcat::mcset hu "&Cancel" "M\u00e9g&sem"
::msgcat::mcset hu "Cannot change to the directory \"%1\$s\".\nPermission denied." "A k\u00f6nyvt\u00e1rv\u00e1lt\u00e1s nem siker\u00fclt: \"%1\$s\".\nHozz\u00e1f\u00e9r\u00e9s megtagadva."
::msgcat::mcset hu "Choose Directory" "K\u00f6nyvt\u00e1r kiv\u00e1laszt\u00e1sa"
- ::msgcat::mcset hu "Clear" "T\u00f6rl\u00e9s"
+ ::msgcat::mcset hu "Cl&ear" "T\u00f6rl\u00e9s"
::msgcat::mcset hu "&Clear Console" "&T\u00f6rl\u00e9s Konzol"
::msgcat::mcset hu "Color" "Sz\u00edn"
::msgcat::mcset hu "Console" "Konzol"
@@ -41,6 +41,7 @@ namespace eval ::tk {
::msgcat::mcset hu "&No" "&Nem"
::msgcat::mcset hu "&OK"
::msgcat::mcset hu "OK"
+ ::msgcat::mcset hu "Ok"
::msgcat::mcset hu "Open" "Megnyit\u00e1s"
::msgcat::mcset hu "&Open" "&Megnyit\u00e1s"
::msgcat::mcset hu "Open Multiple Files" "T\u00f6bb f\u00e1jl megnyit\u00e1sa"
diff --git a/library/msgs/it.msg b/library/msgs/it.msg
index 52394cd..2e1b4bd 100644
--- a/library/msgs/it.msg
+++ b/library/msgs/it.msg
@@ -1,23 +1,25 @@
namespace eval ::tk {
::msgcat::mcset it "&Abort" "&Interrompi"
- ::msgcat::mcset it "About..." "Informazioni..."
+ ::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 "&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 una directory"
- ::msgcat::mcset it "Clear" "Azzera"
+ ::msgcat::mcset it "Cl&ear" "Azzera"
+ ::msgcat::mcset it "&Clear Console" "Azzera Console"
::msgcat::mcset it "Color" "Colore"
::msgcat::mcset it "Console"
- ::msgcat::mcset it "Copy" "Copia"
- ::msgcat::mcset it "Cut" "Taglia"
+ ::msgcat::mcset it "&Copy" "Copia"
+ ::msgcat::mcset it "Cu&t" "Taglia"
::msgcat::mcset it "Delete" "Cancella"
::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 "E&xit" "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."
@@ -29,18 +31,19 @@ namespace eval ::tk {
::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 "&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 "Ok"
- ::msgcat::mcset it "&Open" "A&pri"
::msgcat::mcset it "Open" "Apri"
+ ::msgcat::mcset it "&Open" "A&pri"
::msgcat::mcset it "Open Multiple Files" "Apri file multipli"
- ::msgcat::mcset it "Paste" "Incolla"
- ::msgcat::mcset it "Quit" "Esci"
+ ::msgcat::mcset it "P&aste" "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"
diff --git a/library/msgs/nl.msg b/library/msgs/nl.msg
index 90446c8..148a9e6 100644
--- a/library/msgs/nl.msg
+++ b/library/msgs/nl.msg
@@ -1,37 +1,33 @@
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 "&About..." "Over..."
::msgcat::mcset nl "All Files" "Alle Bestanden"
::msgcat::mcset nl "Application Error" "Toepassingsfout"
+ ::msgcat::mcset nl "&Apply" "Toepassen"
+ ::msgcat::mcset nl "Bold" "Vet"
+ ::msgcat::mcset nl "Bold Italic" "Vet Cursief"
::msgcat::mcset nl "&Blue" "&Blauw"
+ ::msgcat::mcset nl "Cancel" "Annuleren"
::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 hiervoor geen toestemming."
::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; typ %1\$s in, druk op OK"
+ ::msgcat::mcset nl "Cl&ear" "Wissen"
::msgcat::mcset nl "&Clear Console" "&Wis Console"
::msgcat::mcset nl "Color" "Kleur"
::msgcat::mcset nl "Console"
- ::msgcat::mcset nl "Copy" "Kopi\u00ebren"
- ::msgcat::mcset nl "Cut" "Knippen"
- ::msgcat::mcset nl "Delete" "Wissen"
- ::msgcat::mcset nl "Details"
+ ::msgcat::mcset nl "&Copy" "Kopi\u00ebren"
+ ::msgcat::mcset nl "Cu&t" "Knippen"
+ ::msgcat::mcset nl "&Delete" "Wissen"
::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 "Edit" "Bewerken"
- ::msgcat::mcset nl "Enter \"%1\$s\", press OK" "Typ \"%1\$s\", druk op OK"
- ::msgcat::mcset nl "Enter \"%1\$s\", press OK, enter \"%2\$s\", press OK" "Typ \"%1\$s\", druk op OK, typ \"%2\$s\", druk op OK"
+ ::msgcat::mcset nl "&Edit" "Bewerken"
+ ::msgcat::mcset nl "Effects" "Effecten"
::msgcat::mcset nl "Error: %1\$s" "Fout: %1\$s"
- ::msgcat::mcset nl "Exit" "Be\u00ebindigen"
- ::msgcat::mcset nl "File" "Bestand"
- ::msgcat::mcset nl "File \"%1\$s\" already exists.\n\n" "Bestand \"%1\$s\" bestaat al.\n\n"
+ ::msgcat::mcset nl "E&xit" "Be\u00ebindigen"
+ ::msgcat::mcset nl "&File" "Bestand"
::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\" already exists.\n\n" "Bestand \"%1\$s\" bestaat al.\n\n"
::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:"
@@ -39,71 +35,57 @@ namespace eval ::tk {
::msgcat::mcset nl "Fi&les:" "&Bestanden:"
::msgcat::mcset nl "&Filter"
::msgcat::mcset nl "Fil&ter:"
+ ::msgcat::mcset nl "Font"
+ ::msgcat::mcset nl "&Font:"
+ ::msgcat::mcset nl "Font st&yle:" "Font stijl:"
::msgcat::mcset nl "&Green" "&Groen"
+ ::msgcat::mcset nl "&Help"
::msgcat::mcset nl "Hi" "H\u00e9"
- ::msgcat::mcset nl "Hide Console" "Verberg Console"
+ ::msgcat::mcset nl "&Hide Console" "Verberg Console"
::msgcat::mcset nl "&Ignore" "&Negeren"
::msgcat::mcset nl "Invalid file name \"%1\$s\"." "Ongeldige bestandsnaam \"%1\$s\"."
+ ::msgcat::mcset nl "Italic" "Cursief"
::msgcat::mcset nl "Log Files" "Log Bestanden"
::msgcat::mcset nl "&No" "&Nee"
::msgcat::mcset nl "&OK"
+ ::msgcat::mcset nl "OK"
::msgcat::mcset nl "Ok"
- ::msgcat::mcset nl "&Open" "&Openen"
::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 "P&aste" "Pl&akken"
+ ::msgcat::mcset nl "&Quit" "Stoppen"
::msgcat::mcset nl "&Red" "&Rood"
+ ::msgcat::mcset nl "Regular" "Standaard"
::msgcat::mcset nl "Replace existing file?" "Vervang bestaand bestand?"
::msgcat::mcset nl "&Retry" "&Herhalen"
+ ::msgcat::mcset nl "Sample"
::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 "&Size:" "Grootte"
+ ::msgcat::mcset nl "Show &Hidden Directories" "Laat verborgen mappen zien"
+ ::msgcat::mcset nl "Show &Hidden Files and Directories" "Laat verborgen bestanden mappen zien"
::msgcat::mcset nl "Skip Messages" "Berichten overslaan"
- ::msgcat::mcset nl "Source..." "Bron..."
+ ::msgcat::mcset nl "&Source..." "Bron..."
+ ::msgcat::mcset nl "Stri&keout"
::msgcat::mcset nl "Tcl Scripts"
::msgcat::mcset nl "Tcl for Windows" "Tcl voor Windows"
::msgcat::mcset nl "Text Files" "Tekstbestanden"
+ ::msgcat::mcset nl "&Underline" "Onderstreept"
::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" "verkeerde %1\$s waarde \"%2\$s\": moet zijn %3\$s"
- ::msgcat::mcset nl "bad file type \"%1\$s\", should be" "verkeerd bestandstype \"%1\$s\", moet zijn"
- ::msgcat::mcset nl "bad option \"%1\$s\": should be %2\$s" "verkeerde optie \"%1\$s\": moet zijn %2\$s"
- ::msgcat::mcset nl "bad window path name \"%1\$s\"" "verkeerde window-padnaam \"%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 nieuwe eis 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" "focusgroep \"%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 opdracht"
- ::msgcat::mcset nl "tk_chooseDirectory command, cancel gives null" "tk_chooseDirectory opdracht, annuleren geeft lege waarde"
- ::msgcat::mcset nl "tk_chooseDirectory command, initialdir" "tk_chooseDirectory opdracht, initi\u00eble map"
::msgcat::mcset nl "yes" "ja"
}
diff --git a/library/msgs/pl.msg b/library/msgs/pl.msg
index debebcb..c20f41e 100644
--- a/library/msgs/pl.msg
+++ b/library/msgs/pl.msg
@@ -3,7 +3,11 @@ namespace eval ::tk {
::msgcat::mcset pl "&About..." "O programie..."
::msgcat::mcset pl "All Files" "Wszystkie pliki"
::msgcat::mcset pl "Application Error" "B\u0142\u0105d w programie"
+ ::msgcat::mcset pl "&Apply" "Zastosuj"
+ ::msgcat::mcset pl "Bold" "Pogrubienie"
+ ::msgcat::mcset pl "Bold Italic" "Pogrubiona kursywa"
::msgcat::mcset pl "&Blue" "&Niebieski"
+ ::msgcat::mcset pl "Cancel" "Anuluj"
::msgcat::mcset pl "&Cancel" "&Anuluj"
::msgcat::mcset pl "Cannot change to the directory \"%1\$s\".\nPermission denied." "Nie mo\u017cna otworzy\u0107 katalogu \"%1\$s\".\nOdmowa dost\u0119pu."
::msgcat::mcset pl "Choose Directory" "Wybierz katalog"
@@ -18,6 +22,7 @@ namespace eval ::tk {
::msgcat::mcset pl "Directory \"%1\$s\" does not exist." "Katalog \"%1\$s\" nie istnieje."
::msgcat::mcset pl "&Directory:" "&Katalog:"
::msgcat::mcset pl "&Edit" "&Edytuj"
+ ::msgcat::mcset pl "Effects" "Efekty"
::msgcat::mcset pl "Error: %1\$s" "B\u0142\u0105d: %1\$s"
::msgcat::mcset pl "E&xit" "&Wyjd\u017a"
::msgcat::mcset pl "&File" "&Plik"
@@ -30,35 +35,47 @@ namespace eval ::tk {
::msgcat::mcset pl "Fi&les:" "Pli&ki:"
::msgcat::mcset pl "&Filter" "&Filtr"
::msgcat::mcset pl "Fil&ter:" "&Filtr:"
+ ::msgcat::mcset pl "Font" "Czcionka"
+ ::msgcat::mcset pl "&Font:" "Czcio&nka:"
+ ::msgcat::mcset pl "Font st&yle:" "&Styl czcionki:"
::msgcat::mcset pl "&Green" "&Zielony"
::msgcat::mcset pl "&Help" "&Pomoc"
::msgcat::mcset pl "Hi" "Witaj"
::msgcat::mcset pl "&Hide Console" "&Ukryj konsol\u0119"
::msgcat::mcset pl "&Ignore" "&Ignoruj"
::msgcat::mcset pl "Invalid file name \"%1\$s\"." "Niew\u0142a\u015bciwa nazwa pliku \"%1\$s\"."
+ ::msgcat::mcset pl "Italic" "Kursywa"
::msgcat::mcset pl "Log Files" "Pliki dziennika"
::msgcat::mcset pl "&No" "&Nie"
- ::msgcat::mcset pl "OK" "OK"
- ::msgcat::mcset pl "Ok" "Ok"
+ ::msgcat::mcset pl "&OK"
+ ::msgcat::mcset pl "OK"
+ ::msgcat::mcset pl "Ok"
::msgcat::mcset pl "Open" "Otw\u00f3rz"
::msgcat::mcset pl "&Open" "&Otw\u00f3rz"
::msgcat::mcset pl "Open Multiple Files" "Otw\u00f3rz wiele plik\u00f3w"
::msgcat::mcset pl "P&aste" "&Wklej"
::msgcat::mcset pl "&Quit" "&Zako\u0144cz"
::msgcat::mcset pl "&Red" "&Czerwony"
+ ::msgcat::mcset pl "Regular" "Regularne"
::msgcat::mcset pl "Replace existing file?" "Czy zast\u0105pi\u0107 istniej\u0105cy plik?"
::msgcat::mcset pl "&Retry" "&Pon\u00f3w"
+ ::msgcat::mcset pl "Sample" "Przyk\u0142ad"
::msgcat::mcset pl "&Save" "&Zapisz"
::msgcat::mcset pl "Save As" "Zapisz jako"
::msgcat::mcset pl "Save To Log" "Wpisz do dziennika"
::msgcat::mcset pl "Select Log File" "Wybierz plik dziennika"
::msgcat::mcset pl "Select a file to source" "Wybierz plik do wykonania"
::msgcat::mcset pl "&Selection:" "&Wyb\u00f3r:"
+ ::msgcat::mcset pl "&Size:" "&Rozmiar:"
+ ::msgcat::mcset pl "Show &Hidden Directories" "Poka\u017c &ukryte katalogi"
+ ::msgcat::mcset pl "Show &Hidden Files and Directories" "Poka\u017c &ukryte pliki i katalogi"
::msgcat::mcset pl "Skip Messages" "Pomi\u0144 pozosta\u0142e komunikaty"
::msgcat::mcset pl "&Source..." "&Kod \u017ar\u00f3d\u0142owy..."
+ ::msgcat::mcset pl "Stri&keout" "&Przekre\u015blenie"
::msgcat::mcset pl "Tcl Scripts" "Skrypty Tcl"
::msgcat::mcset pl "Tcl for Windows" "Tcl dla Windows"
::msgcat::mcset pl "Text Files" "Pliki tekstowe"
+ ::msgcat::mcset pl "&Underline" "Po&dkre\u015blenie"
::msgcat::mcset pl "&Yes" "&Tak"
::msgcat::mcset pl "abort" "przerwij"
::msgcat::mcset pl "blue" "niebieski"
@@ -67,6 +84,7 @@ namespace eval ::tk {
::msgcat::mcset pl "extensions" "rozszerzenia"
::msgcat::mcset pl "green" "zielony"
::msgcat::mcset pl "ignore" "ignoruj"
+ ::msgcat::mcset pl "ok"
::msgcat::mcset pl "red" "czerwony"
::msgcat::mcset pl "retry" "pon\u00f3w"
::msgcat::mcset pl "yes" "tak"
diff --git a/library/msgs/pt.msg b/library/msgs/pt.msg
index 259f82e..c29e293 100644
--- a/library/msgs/pt.msg
+++ b/library/msgs/pt.msg
@@ -1,70 +1,74 @@
namespace eval ::tk {
- ::msgcat::mcset pt_br "&Abort" "&Abortar"
- ::msgcat::mcset pt_br "About..." "Sobre ..."
- ::msgcat::mcset pt_br "All Files" "Todos os arquivos"
- ::msgcat::mcset pt_br "Application Error" "Erro de aplica\u00e7\u00e3o"
- ::msgcat::mcset pt_br "&Blue" "&Azul"
- ::msgcat::mcset pt_br "&Cancel" "&Cancelar"
- ::msgcat::mcset pt_br "Cannot change to the directory \"%1\$s\".\nPermission denied." "N\u00e3o foi poss\u00edvel mudar para o diret\u00f3rio \"%1\$s\".\nPermiss\u00e3o negada."
- ::msgcat::mcset pt_br "Choose Directory" "Escolha um diret\u00f3rio"
- ::msgcat::mcset pt_br "Clear" "Apagar"
- ::msgcat::mcset pt_br "Color" "Cor"
- ::msgcat::mcset pt_br "Console" "Console"
- ::msgcat::mcset pt_br "Copy" "Copiar"
- ::msgcat::mcset pt_br "Cut" "Recortar"
- ::msgcat::mcset pt_br "Delete" "Excluir"
- ::msgcat::mcset pt_br "Details >>" "Detalhes >>"
- ::msgcat::mcset pt_br "Directory \"%1\$s\" does not exist." "O diret\u00f3rio \"%1\$s\" n\u00e3o existe."
- ::msgcat::mcset pt_br "&Directory:" "&Diret\u00f3rio:"
- ::msgcat::mcset pt_br "Error: %1\$s" "Erro: %1\$s"
- ::msgcat::mcset pt_br "Exit" "Sair"
- ::msgcat::mcset pt_br "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "O arquivo \"%1\$s\" j\u00e1 existe.\nDeseja sobrescreve-lo?"
- ::msgcat::mcset pt_br "File \"%1\$s\" already exists.\n\n" "O arquivo \"%1\$s\" j\u00e1 existe.\n\n"
- ::msgcat::mcset pt_br "File \"%1\$s\" does not exist." "Arquivo \"%1\$s\" n\u00e3o existe."
- ::msgcat::mcset pt_br "File &name:" "&Nome do arquivo:"
- ::msgcat::mcset pt_br "File &names:" "&Nomes dos arquivos:"
- ::msgcat::mcset pt_br "Files of &type:" "Arquivos do &tipo:"
- ::msgcat::mcset pt_br "Fi&les:" "&Arquivos:"
- ::msgcat::mcset pt_br "&Filter" "&Filtro"
- ::msgcat::mcset pt_br "Fil&ter:" "Fil&tro:"
- ::msgcat::mcset pt_br "&Green" "&Verde"
- ::msgcat::mcset pt_br "Hi" "Oi"
- ::msgcat::mcset pt_br "Hide Console" "Ocultar console"
- ::msgcat::mcset pt_br "&Ignore" "&Ignorar"
- ::msgcat::mcset pt_br "Invalid file name \"%1\$s\"." "O nome do arquivo \u00e9 inv\u00e1lido \"%1\$s\"."
- ::msgcat::mcset pt_br "Log Files" "Arquivos de log"
- ::msgcat::mcset pt_br "&No" "&N\u00e3o"
- ::msgcat::mcset pt_br "&OK" "&OK"
- ::msgcat::mcset pt_br "Ok" "Ok"
- ::msgcat::mcset pt_br "Open" "Abrir"
- ::msgcat::mcset pt_br "&Open" "&Abrir"
- ::msgcat::mcset pt_br "Open Multiple Files" "Abrir m\u00faltiplos arquivos"
- ::msgcat::mcset pt_br "Paste" "Colar"
- ::msgcat::mcset pt_br "Quit" "Encerrar"
- ::msgcat::mcset pt_br "&Red" "&Vermelho"
- ::msgcat::mcset pt_br "Replace existing file?" "Substituir arquivo existente?"
- ::msgcat::mcset pt_br "&Retry" "Tenta&r novamente"
- ::msgcat::mcset pt_br "&Save" "&Salvar"
- ::msgcat::mcset pt_br "Save As" "Salvar como"
- ::msgcat::mcset pt_br "Save To Log" "Salvar arquivo de log"
- ::msgcat::mcset pt_br "Select Log File" "Selecionar arquivo de log"
- ::msgcat::mcset pt_br "Select a file to source" "Selecione um arquivo como fonte(source)"
- ::msgcat::mcset pt_br "&Selection:" "&Sele\u00e7\u00e3o:"
- ::msgcat::mcset pt_br "Skip Messages" "Omitir as mensagens"
- ::msgcat::mcset pt_br "Source..." "Source..."
- ::msgcat::mcset pt_br "Tcl Scripts" "Scripts Tcl"
- ::msgcat::mcset pt_br "Tcl for Windows" "Tcl para Windows"
- ::msgcat::mcset pt_br "Text Files" "Arquivos de texto"
- ::msgcat::mcset pt_br "&Yes" "&Sim"
- ::msgcat::mcset pt_br "abort" "abortar"
- ::msgcat::mcset pt_br "blue" "azul"
- ::msgcat::mcset pt_br "cancel" "cancelar"
- ::msgcat::mcset pt_br "extension" "extens\u00e3o"
- ::msgcat::mcset pt_br "extensions" "extens\u00f5es"
- ::msgcat::mcset pt_br "green" "verde"
- ::msgcat::mcset pt_br "ignore" "ignorar"
- ::msgcat::mcset pt_br "ok" "ok"
- ::msgcat::mcset pt_br "red" "vermelho"
- ::msgcat::mcset pt_br "retry" "tentar novamente"
- ::msgcat::mcset pt_br "yes" "sim"
+ ::msgcat::mcset pt "&Abort" "&Abortar"
+ ::msgcat::mcset pt "About..." "Sobre ..."
+ ::msgcat::mcset pt "All Files" "Todos os arquivos"
+ ::msgcat::mcset pt "Application Error" "Erro de aplica\u00e7\u00e3o"
+ ::msgcat::mcset pt "&Blue" "&Azul"
+ ::msgcat::mcset pt "Cancel" "Cancelar"
+ ::msgcat::mcset pt "&Cancel" "&Cancelar"
+ ::msgcat::mcset pt "Cannot change to the directory \"%1\$s\".\nPermission denied." "N\u00e3o foi poss\u00edvel mudar para o diret\u00f3rio \"%1\$s\".\nPermiss\u00e3o negada."
+ ::msgcat::mcset pt "Choose Directory" "Escolha um diret\u00f3rio"
+ ::msgcat::mcset pt "Cl&ear" "Apagar"
+ ::msgcat::mcset pt "&Clear Console" "Apagar Console"
+ ::msgcat::mcset pt "Color" "Cor"
+ ::msgcat::mcset pt "Console"
+ ::msgcat::mcset pt "&Copy" "Copiar"
+ ::msgcat::mcset pt "Cu&t" "Recortar"
+ ::msgcat::mcset pt "&Delete" "Excluir"
+ ::msgcat::mcset pt "Details >>" "Detalhes >>"
+ ::msgcat::mcset pt "Directory \"%1\$s\" does not exist." "O diret\u00f3rio \"%1\$s\" n\u00e3o existe."
+ ::msgcat::mcset pt "&Directory:" "&Diret\u00f3rio:"
+ ::msgcat::mcset pt "Error: %1\$s" "Erro: %1\$s"
+ ::msgcat::mcset pt "E&xit" "Sair"
+ ::msgcat::mcset pt "&File" "Arquivo"
+ ::msgcat::mcset pt "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "O arquivo \"%1\$s\" j\u00e1 existe.\nDeseja sobrescreve-lo?"
+ ::msgcat::mcset pt "File \"%1\$s\" already exists.\n\n" "O arquivo \"%1\$s\" j\u00e1 existe.\n\n"
+ ::msgcat::mcset pt "File \"%1\$s\" does not exist." "Arquivo \"%1\$s\" n\u00e3o existe."
+ ::msgcat::mcset pt "File &name:" "&Nome do arquivo:"
+ ::msgcat::mcset pt "File &names:" "&Nomes dos arquivos:"
+ ::msgcat::mcset pt "Files of &type:" "Arquivos do &tipo:"
+ ::msgcat::mcset pt "Fi&les:" "&Arquivos:"
+ ::msgcat::mcset pt "&Filter" "&Filtro"
+ ::msgcat::mcset pt "Fil&ter:" "Fil&tro:"
+ ::msgcat::mcset pt "&Green" "&Verde"
+ ::msgcat::mcset pt "Hi" "Oi"
+ ::msgcat::mcset pt "&Hide Console" "Ocultar console"
+ ::msgcat::mcset pt "&Ignore" "&Ignorar"
+ ::msgcat::mcset pt "Invalid file name \"%1\$s\"." "O nome do arquivo \u00e9 inv\u00e1lido \"%1\$s\"."
+ ::msgcat::mcset pt "Log Files" "Arquivos de log"
+ ::msgcat::mcset pt "&No" "&N\u00e3o"
+ ::msgcat::mcset pt "&OK"
+ ::msgcat::mcset pt "OK"
+ ::msgcat::mcset pt "Ok"
+ ::msgcat::mcset pt "Open" "Abrir"
+ ::msgcat::mcset pt "&Open" "&Abrir"
+ ::msgcat::mcset pt "Open Multiple Files" "Abrir m\u00faltiplos arquivos"
+ ::msgcat::mcset pt "P&aste" "Col&ar"
+ ::msgcat::mcset pt "Quit" "Encerrar"
+ ::msgcat::mcset pt "&Red" "&Vermelho"
+ ::msgcat::mcset pt "Replace existing file?" "Substituir arquivo existente?"
+ ::msgcat::mcset pt "&Retry" "Tenta&r novamente"
+ ::msgcat::mcset pt "&Save" "&Salvar"
+ ::msgcat::mcset pt "Save As" "Salvar como"
+ ::msgcat::mcset pt "Save To Log" "Salvar arquivo de log"
+ ::msgcat::mcset pt "Select Log File" "Selecionar arquivo de log"
+ ::msgcat::mcset pt "Select a file to source" "Selecione um arquivo como fonte"
+ ::msgcat::mcset pt "&Selection:" "&Sele\u00e7\u00e3o:"
+ ::msgcat::mcset pt "Skip Messages" "Omitir as mensagens"
+ ::msgcat::mcset pt "&Source..." "&Fonte..."
+ ::msgcat::mcset pt "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset pt "Tcl for Windows" "Tcl para Windows"
+ ::msgcat::mcset pt "Text Files" "Arquivos de texto"
+ ::msgcat::mcset pt "&Yes" "&Sim"
+ ::msgcat::mcset pt "abort" "abortar"
+ ::msgcat::mcset pt "blue" "azul"
+ ::msgcat::mcset pt "cancel" "cancelar"
+ ::msgcat::mcset pt "extension" "extens\u00e3o"
+ ::msgcat::mcset pt "extensions" "extens\u00f5es"
+ ::msgcat::mcset pt "green" "verde"
+ ::msgcat::mcset pt "ignore" "ignorar"
+ ::msgcat::mcset pt "ok"
+ ::msgcat::mcset pt "red" "vermelho"
+ ::msgcat::mcset pt "retry" "tentar novamente"
+ ::msgcat::mcset pt "yes" "sim"
}
diff --git a/library/msgs/ru.msg b/library/msgs/ru.msg
index 9f6aa80..be2b551 100644
--- a/library/msgs/ru.msg
+++ b/library/msgs/ru.msg
@@ -1,24 +1,25 @@
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 "&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 "&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 "Cl&ear" "\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 "&Copy" "\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Cu&t" "\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 "E&xit" "\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"
@@ -31,18 +32,19 @@ namespace eval ::tk {
::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 "&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" "\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 "P&aste" "\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"
@@ -51,9 +53,9 @@ namespace eval ::tk {
::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 "&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 "&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"
diff --git a/library/msgs/sv.msg b/library/msgs/sv.msg
index 14ce14d..62bfcbd 100644
--- a/library/msgs/sv.msg
+++ b/library/msgs/sv.msg
@@ -4,10 +4,11 @@ namespace eval ::tk {
::msgcat::mcset sv "All Files" "Samtliga filer"
::msgcat::mcset sv "Application Error" "Programfel"
::msgcat::mcset sv "&Blue" "&Bl\u00e5"
+ ::msgcat::mcset sv "Cancel" "Avbryt"
::msgcat::mcset sv "&Cancel" "&Avbryt"
::msgcat::mcset sv "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kan ej n\u00e5 mappen \"%1\$s\".\nSaknar r\u00e4ttigheter."
::msgcat::mcset sv "Choose Directory" "V\u00e4lj mapp"
- ::msgcat::mcset sv "&Clear" "&Radera"
+ ::msgcat::mcset sv "Cl&ear" "&Radera"
::msgcat::mcset sv "&Clear Console" "&Radera konsollen"
::msgcat::mcset sv "Color" "F\u00e4rg"
::msgcat::mcset sv "Console" "Konsoll"
@@ -38,6 +39,7 @@ namespace eval ::tk {
::msgcat::mcset sv "Invalid file name \"%1\$s\"." "Ogiltigt filnamn \"%1\$s\"."
::msgcat::mcset sv "Log Files" "Loggfiler"
::msgcat::mcset sv "&No" "&Nej"
+ ::msgcat::mcset sv "&OK"
::msgcat::mcset sv "OK"
::msgcat::mcset sv "Ok"
::msgcat::mcset sv "Open" "\u00d6ppna"
diff --git a/library/safetk.tcl b/library/safetk.tcl
index c975fd6..e664ace 100644
--- a/library/safetk.tcl
+++ b/library/safetk.tcl
@@ -85,14 +85,12 @@ proc ::safe::loadTk {} {}
if {![::tcl::OptProcArgGiven "-use"]} {
# create a decorated toplevel
- ::tcl::Lassign [tkTopLevel $slave $display] w use
+ lassign [tkTopLevel $slave $display] w use
# set our delete hook (slave arg is added by interpDelete)
# to clean up both window related code and tkInit(slave)
set state(cleanupHook) [list tkDelete {} $w]
-
} else {
-
# set our delete hook (slave arg is added by interpDelete)
# to clean up tkInit(slave)
set state(cleanupHook) [list disallowTk]
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 4cb95bd..9277160 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -128,18 +128,34 @@ bind Scrollbar <End> {
tk::ScrollToPos %W 1
}
}
-if {[tk windowingsystem] eq "aqua"} {
- bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {- (%D)}]
- }
- bind Scrollbar <Option-MouseWheel> {
- tk::ScrollByUnits %W v [expr {-10 * (%D)}]
+switch [tk windowingsystem] {
+ "aqua" {
+ bind Scrollbar <MouseWheel> {
+ tk::ScrollByUnits %W v [expr {- (%D)}]
+ }
+ bind Scrollbar <Option-MouseWheel> {
+ tk::ScrollByUnits %W v [expr {-10 * (%D)}]
+ }
+ bind Scrollbar <Shift-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {- (%D)}]
+ }
+ bind Scrollbar <Shift-Option-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {-10 * (%D)}]
+ }
}
- bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {- (%D)}]
+ "win32" {
+ bind Scrollbar <MouseWheel> {
+ tk::ScrollByUnits %W v [expr {- (%D / 120) * 4}]
+ }
+ bind Scrollbar <Shift-MouseWheel> {
+ tk::ScrollByUnits %W h [expr {- (%D / 120) * 4}]
+ }
}
- bind Scrollbar <Shift-Option-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-10 * (%D)}]
+ "x11" {
+ bind Scrollbar <4> {tk::ScrollByUnits %W v -5}
+ bind Scrollbar <5> {tk::ScrollByUnits %W v 5}
+ bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5}
+ bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5}
}
}
# tk::ScrollButtonDown --
diff --git a/library/spinbox.tcl b/library/spinbox.tcl
index c05ccec..84a00a7 100644
--- a/library/spinbox.tcl
+++ b/library/spinbox.tcl
@@ -127,45 +127,45 @@ bind Spinbox <Down> {
%W invoke buttondown
}
-bind Spinbox <Left> {
+bind Spinbox <<PrevChar>> {
::tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
}
-bind Spinbox <Right> {
+bind Spinbox <<NextChar>> {
::tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
}
-bind Spinbox <Shift-Left> {
+bind Spinbox <<SelectPrevChar>> {
::tk::EntryKeySelect %W [expr {[%W index insert] - 1}]
::tk::EntrySeeInsert %W
}
-bind Spinbox <Shift-Right> {
+bind Spinbox <<SelectNextChar>> {
::tk::EntryKeySelect %W [expr {[%W index insert] + 1}]
::tk::EntrySeeInsert %W
}
-bind Spinbox <Control-Left> {
+bind Spinbox <<PrevWord>> {
::tk::EntrySetCursor %W [::tk::EntryPreviousWord %W insert]
}
-bind Spinbox <Control-Right> {
+bind Spinbox <<NextWord>> {
::tk::EntrySetCursor %W [::tk::EntryNextWord %W insert]
}
-bind Spinbox <Shift-Control-Left> {
+bind Spinbox <<SelectPrevWord>> {
::tk::EntryKeySelect %W [::tk::EntryPreviousWord %W insert]
::tk::EntrySeeInsert %W
}
-bind Spinbox <Shift-Control-Right> {
+bind Spinbox <<SelectNextWord>> {
::tk::EntryKeySelect %W [::tk::EntryNextWord %W insert]
::tk::EntrySeeInsert %W
}
-bind Spinbox <Home> {
+bind Spinbox <<LineStart>> {
::tk::EntrySetCursor %W 0
}
-bind Spinbox <Shift-Home> {
+bind Spinbox <<SelectLineStart>> {
::tk::EntryKeySelect %W 0
::tk::EntrySeeInsert %W
}
-bind Spinbox <End> {
+bind Spinbox <<LineEnd>> {
::tk::EntrySetCursor %W end
}
-bind Spinbox <Shift-End> {
+bind Spinbox <<SelectLineEnd>> {
::tk::EntryKeySelect %W end
::tk::EntrySeeInsert %W
}
@@ -215,6 +215,8 @@ bind Spinbox <Escape> {# nothing}
bind Spinbox <Return> {# nothing}
bind Spinbox <KP_Enter> {# nothing}
bind Spinbox <Tab> {# nothing}
+bind Spinbox <Prior> {# nothing}
+bind Spinbox <Next> {# nothing}
if {[tk windowingsystem] eq "aqua"} {
bind Spinbox <Command-KeyPress> {# nothing}
}
diff --git a/library/tclIndex b/library/tclIndex
index e7f5b81..b3f37fa 100644
--- a/library/tclIndex
+++ b/library/tclIndex
@@ -79,6 +79,7 @@ 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::IconList) [list source [file join $dir iconlist.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]]
@@ -89,6 +90,7 @@ set auto_index(::tk::ListboxExtendUpDown) [list source [file join $dir listbox.t
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::Megawidget) [list source [file join $dir megawidget.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]]
@@ -198,34 +200,6 @@ 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]]
@@ -276,3 +250,4 @@ set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.
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]]
+set auto_index(::tk::fontchooser) [list source [file join $dir fontchooser.tcl]]
diff --git a/library/text.tcl b/library/text.tcl
index d4ff18e..32fd9ad 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -86,10 +86,10 @@ bind Text <ButtonRelease-1> {
bind Text <Control-1> {
%W mark set insert @%x,%y
}
-bind Text <Left> {
+bind Text <<PrevChar>> {
tk::TextSetCursor %W insert-1displayindices
}
-bind Text <Right> {
+bind Text <<NextChar>> {
tk::TextSetCursor %W insert+1displayindices
}
bind Text <Up> {
@@ -98,10 +98,10 @@ bind Text <Up> {
bind Text <Down> {
tk::TextSetCursor %W [tk::TextUpDownLine %W 1]
}
-bind Text <Shift-Left> {
+bind Text <<SelectPrevChar>> {
tk::TextKeySelect %W [%W index {insert - 1displayindices}]
}
-bind Text <Shift-Right> {
+bind Text <<SelectNextChar>> {
tk::TextKeySelect %W [%W index {insert + 1displayindices}]
}
bind Text <Shift-Up> {
@@ -110,10 +110,10 @@ bind Text <Shift-Up> {
bind Text <Shift-Down> {
tk::TextKeySelect %W [tk::TextUpDownLine %W 1]
}
-bind Text <Control-Left> {
+bind Text <<PrevWord>> {
tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
-bind Text <Control-Right> {
+bind Text <<NextWord>> {
tk::TextSetCursor %W [tk::TextNextWord %W insert]
}
bind Text <Control-Up> {
@@ -122,10 +122,10 @@ bind Text <Control-Up> {
bind Text <Control-Down> {
tk::TextSetCursor %W [tk::TextNextPara %W insert]
}
-bind Text <Shift-Control-Left> {
+bind Text <<SelectPrevWord>> {
tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
-bind Text <Shift-Control-Right> {
+bind Text <<SelectNextWord>> {
tk::TextKeySelect %W [tk::TextNextWord %W insert]
}
bind Text <Shift-Control-Up> {
@@ -153,16 +153,16 @@ bind Text <Control-Next> {
%W xview scroll 1 page
}
-bind Text <Home> {
+bind Text <<LineStart>> {
tk::TextSetCursor %W {insert display linestart}
}
-bind Text <Shift-Home> {
+bind Text <<SelectLineStart>> {
tk::TextKeySelect %W {insert display linestart}
}
-bind Text <End> {
+bind Text <<LineEnd>> {
tk::TextSetCursor %W {insert display lineend}
}
-bind Text <Shift-End> {
+bind Text <<SelectLineEnd>> {
tk::TextKeySelect %W {insert display lineend}
}
bind Text <Control-Home> {
@@ -208,18 +208,22 @@ bind Text <Return> {
bind Text <Delete> {
if {[tk::TextCursorInSelection %W]} {
%W delete sel.first sel.last
- } elseif {[%W compare end != insert+1c]} {
- %W delete insert
+ } else {
+ if {[%W compare end != insert+1c]} {
+ %W delete insert
+ }
+ %W see insert
}
- %W see insert
}
bind Text <BackSpace> {
if {[tk::TextCursorInSelection %W]} {
%W delete sel.first sel.last
- } elseif {[%W compare insert != 1.0]} {
- %W delete insert-1c
+ } else {
+ if {[%W compare insert != 1.0]} {
+ %W delete insert-1c
+ }
+ %W see insert
}
- %W see insert
}
bind Text <Control-space> {
@@ -469,6 +473,13 @@ if {[tk windowingsystem] eq "aqua"} {
%W yview scroll [expr {(2-%D)/3}] pixels
}
}
+ bind Text <Shift-MouseWheel> {
+ if {%D >= 0} {
+ %W xview scroll [expr {-%D/3}] pixels
+ } else {
+ %W xview scroll [expr {(2-%D)/3}] pixels
+ }
+ }
}
if {"x11" eq [tk windowingsystem]} {
@@ -486,6 +497,16 @@ if {"x11" eq [tk windowingsystem]} {
%W yview scroll 50 pixels
}
}
+ bind Text <Shift-4> {
+ if {!$tk_strictMotif} {
+ %W xview scroll -50 pixels
+ }
+ }
+ bind Text <Shift-5> {
+ if {!$tk_strictMotif} {
+ %W xview scroll 50 pixels
+ }
+ }
}
# ::tk::TextClosestGap --
@@ -873,16 +894,17 @@ proc ::tk::TextInsert {w s} {
}
set compound 0
if {[TextCursorInSelection $w]} {
- set compound [$w cget -autoseparators]
- if {$compound} {
+ 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} {
+ if {$compound && $oldSeparator} {
$w edit separator
$w configure -autoseparators 1
}
diff --git a/library/tk.tcl b/library/tk.tcl
index 42089ac..5e6f4a6 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -10,23 +10,21 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
-package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp before
- ;# using 8.5 [package] features.
# Insist on running with compatible version of Tcl
-package require Tcl 8.5.0
+package require Tcl 8.6
# Verify that we have Tk binary and script components from the same release
-package require -exact Tk 8.5.10
-
+package require -exact Tk 8.6b2
+
# 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.
+ # The msgcat package is not available. Supply our own
+ # minimal replacement.
proc mc {src args} {
- return [format $src {*}$args]
+ tailcall format $src {*}$args
}
proc mcmax {args} {
set max 0
@@ -59,7 +57,8 @@ namespace eval ::ttk {
# isn't already on the path:
if {[info exists ::auto_path] && ($::tk_library ne "")
- && ($::tk_library ni $::auto_path)} {
+ && ($::tk_library ni $::auto_path)
+} then {
lappend ::auto_path $::tk_library $::ttk::library
}
@@ -67,13 +66,13 @@ if {[info exists ::auto_path] && ($::tk_library ne "")
set ::tk_strictMotif 0
-# Turn on useinputmethods (X Input Methods) by default. We catch this because
-# safe interpreters may not allow the call.
+# Turn on useinputmethods (X Input Methods) by default.
+# We catch this because safe interpreters may not allow the call.
catch {tk useinputmethods 1}
# ::tk::PlaceWindow --
-# Place a toplevel at a particular position
+# place a toplevel at a particular position
# Arguments:
# toplevel name of toplevel window
# ?placement? pointer ?center? ; places $w centered on the pointer
@@ -129,7 +128,9 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
}
if {[tk windowingsystem] eq "aqua"} {
# Avoid the native menu bar which sits on top of everything.
- if {$y < 22} { set y 22 }
+ if {$y < 22} {
+ set y 22
+ }
}
}
wm geometry $w +$x+$y
@@ -137,7 +138,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
}
# ::tk::SetFocusGrab --
-# Swap out current focus and grab temporarily (for dialogs)
+# swap out current focus and grab temporarily (for dialogs)
# Arguments:
# grab new window to grab
# focus window to give focus to
@@ -154,8 +155,8 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
if {[winfo exists $oldGrab]} {
lappend data [grab status $oldGrab]
}
- # The "grab" command will fail if another application already holds the
- # grab. So catch it.
+ # The "grab" command will fail if another application
+ # already holds the grab. So catch it.
catch {grab $grab}
if {[winfo exists $focus]} {
focus $focus
@@ -163,7 +164,7 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
}
# ::tk::RestoreFocusGrab --
-# Restore old focus and grab (for dialogs)
+# restore old focus and grab (for dialogs)
# Arguments:
# grab window that had taken grab
# focus window that had taken focus
@@ -197,10 +198,10 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
}
# ::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.
+# 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.
@@ -210,9 +211,11 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
#
if {$tcl_platform(platform) eq "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]} {
+ if {[catch {
+ selection get -displayof $w -selection $sel -type UTF8_STRING
+ } txt] && [catch {
+ selection get -displayof $w -selection $sel
+ } txt]} then {
return -code error "could not find default selection"
} else {
return $txt
@@ -220,7 +223,9 @@ if {$tcl_platform(platform) eq "unix"} {
}
} else {
proc ::tk::GetSelection {w {sel PRIMARY}} {
- if {[catch {selection get -displayof $w -selection $sel} txt]} {
+ if {[catch {
+ selection get -displayof $w -selection $sel
+ } txt]} then {
return -code error "could not find default selection"
} else {
return $txt
@@ -229,22 +234,18 @@ if {$tcl_platform(platform) eq "unix"} {
}
# ::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 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.
+# 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 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 ::tk::ScreenChanged {screen} {
- set x [string last . $screen]
- if {$x > 0} {
- set disp [string range $screen 0 [expr {$x - 1}]]
- } else {
- set disp $screen
- }
+proc ::tk::ScreenChanged screen {
+ # Extract the display name.
+ set disp [string range $screen 0 [string last . $screen]-1]
# Ensure that namespace separators never occur in the display name (as
# they cause problems in variable names). Double-colons exist in some VNC
@@ -293,8 +294,9 @@ proc ::tk::ScreenChanged {screen} {
tk::ScreenChanged [winfo screen .]
# ::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.
+# 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").
@@ -315,41 +317,41 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} {
}
#----------------------------------------------------------------------
-# Define common dialogs on platforms where they are not implemented using
-# compiled code.
+# Define common dialogs on platforms where they are not implemented
+# using compiled code.
#----------------------------------------------------------------------
if {![llength [info commands tk_chooseColor]]} {
proc ::tk_chooseColor {args} {
- return [tk::dialog::color:: {*}$args]
+ tailcall ::tk::dialog::color:: {*}$args
}
}
if {![llength [info commands tk_getOpenFile]]} {
proc ::tk_getOpenFile {args} {
if {$::tk_strictMotif} {
- return [tk::MotifFDialog open {*}$args]
+ tailcall ::tk::MotifFDialog open {*}$args
} else {
- return [::tk::dialog::file:: open {*}$args]
+ tailcall ::tk::dialog::file:: open {*}$args
}
}
}
if {![llength [info commands tk_getSaveFile]]} {
proc ::tk_getSaveFile {args} {
if {$::tk_strictMotif} {
- return [tk::MotifFDialog save {*}$args]
+ tailcall ::tk::MotifFDialog save {*}$args
} else {
- return [::tk::dialog::file:: save {*}$args]
+ tailcall ::tk::dialog::file:: save {*}$args
}
}
}
if {![llength [info commands tk_messageBox]]} {
proc ::tk_messageBox {args} {
- return [tk::MessageBox {*}$args]
+ tailcall ::tk::MessageBox {*}$args
}
}
if {![llength [info command tk_chooseDirectory]]} {
proc ::tk_chooseDirectory {args} {
- return [::tk::dialog::file::chooseDir:: {*}$args]
+ tailcall ::tk::dialog::file::chooseDir:: {*}$args
}
}
@@ -365,19 +367,38 @@ switch -exact -- [tk windowingsystem] {
event add <<PasteSelection>> <ButtonRelease-2>
event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z>
+ event add <<ContextMenu>> <Button-3>
+ if {[info exists tcl_platform(os)] && $tcl_platform(os) eq "Darwin"} {
+ event add <<ContextMenu>> <Button-2>
+ }
+
+ event add <<NextChar>> <Right>
+ event add <<SelectNextChar>> <Shift-Right>
+ event add <<PrevChar>> <Left>
+ event add <<SelectPrevChar>> <Shift-Left>
+ event add <<NextWord>> <Control-Right>
+ event add <<SelectNextWord>> <Shift-Control-Right>
+ event add <<PrevWord>> <Control-Left>
+ event add <<SelectPrevWord>> <Shift-Control-Left>
+ event add <<LineStart>> <Home>
+ event add <<SelectLineStart>> <Shift-Home>
+ event add <<LineEnd>> <End>
+ event add <<SelectLineEnd>> <Shift-End>
+
# 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 PrevWindow
- # event. We use catch just in case the keysym isn't recognized. This
- # is needed for XFree86 systems
+ # event. We use catch just in case the keysym isn't recognized.
+
+ # This is needed for XFree86 systems
catch { event add <<PrevWindow>> <ISO_Left_Tab> }
# This seems to be correct on *some* HP systems.
catch { event add <<PrevWindow>> <hpBackTab> }
trace add variable ::tk_strictMotif write ::tk::EventMotifBindings
set ::tk_strictMotif $::tk_strictMotif
- # On unix, we want to always display entry/text selection, regardless
- # of which window has focus
+ # On unix, we want to always display entry/text selection,
+ # regardless of which window has focus
set ::tk::AlwaysShowSelection 1
}
"win32" {
@@ -390,6 +411,20 @@ switch -exact -- [tk windowingsystem] {
event add <<PasteSelection>> <ButtonRelease-2>
event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z>
event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y>
+ event add <<ContextMenu>> <Button-3>
+
+ event add <<NextChar>> <Right>
+ event add <<SelectNextChar>> <Shift-Right>
+ event add <<PrevChar>> <Left>
+ event add <<SelectPrevChar>> <Shift-Left>
+ event add <<NextWord>> <Control-Right>
+ event add <<SelectNextWord>> <Shift-Control-Right>
+ event add <<PrevWord>> <Control-Left>
+ event add <<SelectPrevWord>> <Shift-Control-Left>
+ event add <<LineStart>> <Home>
+ event add <<SelectLineStart>> <Shift-Home>
+ event add <<LineEnd>> <End>
+ event add <<SelectLineEnd>> <Shift-End>
}
"aqua" {
event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X>
@@ -399,9 +434,27 @@ switch -exact -- [tk windowingsystem] {
event add <<Clear>> <Clear>
event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z>
event add <<Redo>> <Command-Key-y> <Control-Lock-Key-Y>
+ event add <<ContextMenu>> <Button-2>
+
+ # Official bindings
+ # See http://support.apple.com/kb/HT1343
+ event add <<NextChar>> <Right>
+ event add <<SelectNextChar>> <Shift-Right>
+ event add <<PrevChar>> <Left>
+ event add <<SelectPrevChar>> <Shift-Left>
+ event add <<NextWord>> <Option-Right>
+ event add <<SelectNextWord>> <Shift-Option-Right>
+ event add <<PrevWord>> <Option-Left>
+ event add <<SelectPrevWord>> <Shift-Option-Left>
+ event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left>
+ event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right>
+ # Not official, but logical extensions of above. Also derived from
+ # bindings present in MS Word on OSX.
+ event add <<LineStart>> <Home> <Command-Left>
+ event add <<LineEnd>> <End> <Command-Right>
}
}
-
+
# ----------------------------------------------------------------------
# Read in files that define all of the class bindings.
# ----------------------------------------------------------------------
@@ -411,6 +464,7 @@ if {$::tk_library ne ""} {
namespace eval :: [list source [file join $::tk_library $file.tcl]]
}
namespace eval ::tk {
+ SourceLibFile icons
SourceLibFile button
SourceLibFile entry
SourceLibFile listbox
@@ -428,13 +482,15 @@ if {$::tk_library ne ""} {
# ----------------------------------------------------------------------
event add <<PrevWindow>> <Shift-Tab>
-bind all <Tab> {tk::TabToWindow [tk_focusNext %W]}
+event add <<NextWindow>> <Tab>
+bind all <<NextWindow>> {tk::TabToWindow [tk_focusNext %W]}
bind all <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]}
# ::tk::CancelRepeat --
-# This procedure is invoked to cancel an auto-repeat action described 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.
+# This procedure is invoked to cancel an auto-repeat action described
+# 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.
@@ -447,9 +503,9 @@ proc ::tk::CancelRepeat {} {
# ::tk::TabToWindow --
# This procedure moves the focus to the given widget.
-# It sends a <<TraverseOut>> virtual event to the previous focus window, if
-# any, before changing the focus, and a <<TraverseIn>> event to the new focus
-# window afterwards.
+# It sends a <<TraverseOut>> virtual event to the previous focus window,
+# if any, before changing the focus, and a <<TraverseIn>> event
+# to the new focus window afterwards.
#
# Arguments:
# w - Window to which focus should be set.
@@ -464,9 +520,10 @@ proc ::tk::TabToWindow {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.
+# 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 s [string map {&& & & \ufeff} $text]
@@ -475,8 +532,8 @@ proc ::tk::UnderlineAmpersand {text} {
}
# ::tk::SetAmpText --
-# Given widget path and text with "magic ampersands", sets -text and
-# -underline options for the widget
+# Given widget path and text with "magic ampersands", sets -text and
+# -underline options for the widget
#
proc ::tk::SetAmpText {widget text} {
lassign [UnderlineAmpersand $text] newtext under
@@ -484,8 +541,8 @@ proc ::tk::SetAmpText {widget text} {
}
# ::tk::AmpWidget --
-# Creates new widget, turning -text option into -text and -underline options,
-# returned by ::tk::UnderlineAmpersand.
+# Creates new widget, turning -text option into -text and -underline
+# options, returned by ::tk::UnderlineAmpersand.
#
proc ::tk::AmpWidget {class path args} {
set options {}
@@ -505,8 +562,8 @@ proc ::tk::AmpWidget {class path args} {
}
# ::tk::AmpMenuArgs --
-# Processes arguments for a menu entry, turning -label option into -label and
-# -underline options, returned by ::tk::UnderlineAmpersand.
+# Processes arguments for a menu entry, turning -label option into
+# -label and -underline options, returned by ::tk::UnderlineAmpersand.
#
proc ::tk::AmpMenuArgs {widget add type args} {
set options {}
@@ -520,47 +577,53 @@ proc ::tk::AmpMenuArgs {widget add type args} {
}
$widget add $type {*}$options
}
-
+
# ::tk::FindAltKeyTarget --
-# Search recursively through the hierarchy of visible widgets to find button
-# or label which has $char as underlined character
+# 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 -
- TButton - TLabel - TCheckbutton {
- if {[string equal -nocase $char \
- [string index [$path cget -text] [$path cget -underline]]]} {
- return $path
- } else {
- return {}
+ set class [winfo class $path]
+ if {$class in {
+ Button Checkbutton Label Radiobutton
+ TButton TCheckbutton TLabel TRadiobutton
+ } && [string equal -nocase $char \
+ [string index [$path cget -text] [$path cget -underline]]]} {
+ return $path
+ }
+ set subwins [concat [grid slaves $path] [pack slaves $path] \
+ [place slaves $path]]
+ if {$class eq "Canvas"} {
+ foreach item [$path find all] {
+ if {[$path type $item] eq "window"} {
+ set w [$path itemcget $item -window]
+ if {$w ne ""} {lappend subwins $w}
}
}
- default {
- foreach child [concat [grid slaves $path] \
- [pack slaves $path] [place slaves $path]] {
- set target [FindAltKeyTarget $child $char]
- if {$target ne ""} {
- return $target
- }
- }
+ } elseif {$class eq "Text"} {
+ lappend subwins {*}[$path window names]
+ }
+ foreach child $subwins {
+ set target [FindAltKeyTarget $child $char]
+ if {$target ne ""} {
+ return $target
}
}
- return {}
}
# ::tk::AltKeyInDialog --
-# <Alt-Key> event handler for standard dialogs. Sends <<AltUnderlined>> to
-# button or label which has appropriate underlined character
+# <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 [FindAltKeyTarget $path $key]
- if { $target eq ""} return
- event generate $target <<AltUnderlined>>
+ if {$target ne ""} {
+ event generate $target <<AltUnderlined>>
+ }
}
-
+
# ::tk::mcmaxamp --
-# Replacement for mcmax, used for texts with "magic ampersand" in it.
+# Replacement for mcmax, used for texts with "magic ampersand" in it.
#
proc ::tk::mcmaxamp {args} {
@@ -580,13 +643,13 @@ proc ::tk::mcmaxamp {args} {
if {[tk windowingsystem] eq "aqua"} {
namespace eval ::tk::mac {
- variable useCustomMDEF 0
+ set useCustomMDEF 0
}
}
# Run the Ttk themed widget set initialization
if {$::ttk::library ne ""} {
- uplevel \#0 [list source [file join $::ttk::library ttk.tcl]]
+ uplevel \#0 [list source $::ttk::library/ttk.tcl]
}
# Local Variables:
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index 78112e1..6354300 100644
--- a/library/tkfbox.tcl
+++ b/library/tkfbox.tcl
@@ -1,15 +1,14 @@
# tkfbox.tcl --
#
-# Implements the "TK" standard file selection dialog box. This
-# dialog box is used on the Unix platforms whenever the tk_strictMotif
-# flag is not set.
+# Implements the "TK" standard file selection dialog box. This dialog
+# box is used on the Unix platforms whenever the tk_strictMotif flag is
+# not set.
#
-# The "TK" standard file selection dialog box is similar to the
-# file selection dialog box on Win95(TM). The user can navigate
-# the directories by clicking on the folder icons or by
-# selecting the "Directory" option menu. The user can select
-# files by clicking on the file icons or by entering a filename
-# in the "Filename:" entry.
+# The "TK" standard file selection dialog box is similar to the file
+# selection dialog box on Win95(TM). The user can navigate the
+# directories by clicking on the folder icons or by selecting the
+# "Directory" option menu. The user can select files by clicking on the
+# file icons or by entering a filename in the "Filename:" entry.
#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
@@ -17,794 +16,78 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-package require Ttk
-
-#----------------------------------------------------------------------
-#
-# I C O N L I S T
-#
-# This is a pseudo-widget that implements the icon list inside the
-# ::tk::dialog::file:: dialog box.
-#
-#----------------------------------------------------------------------
-
-# ::tk::IconList --
-#
-# Creates an IconList widget.
-#
-proc ::tk::IconList {w args} {
- IconList_Config $w $args
- IconList_Create $w
-}
-
-proc ::tk::IconList_Index {w i} {
- upvar #0 ::tk::$w data ::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 \
- [$data(canvas) canvasx $x] [$data(canvas) canvasy $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
- }
- incr ind
- }
- 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?"
- }
-
- 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)
-}
-
-proc ::tk::IconList_DrawSelection {w} {
- upvar ::tk::$w data
- upvar ::tk::$w:itemList itemList
-
- $data(canvas) delete selection
- $data(canvas) itemconfigure selectionText -fill black
- $data(canvas) dtag selectionText
- set cbg [ttk::style lookup TEntry -selectbackground focus]
- set cfg [ttk::style lookup TEntry -selectforeground focus]
- 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 $cbg -outline $cbg \
- -tags selection
- $data(canvas) itemconfigure $tTag -fill $cfg -tags selectionText
- }
- $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 ::tk::IconList_Config {w argList} {
-
- # 1: the configuration specs
- #
- set specs {
- {-command "" "" ""}
- {-multiple "" "" "0"}
- }
-
- # 2: parse the arguments
- #
- tclParseConfigSpec ::tk::$w $specs "" $argList
-}
-
-# ::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 ::tk::IconList_Create {w} {
- upvar ::tk::$w data
-
- ttk::frame $w
- ttk::entry $w.cHull -takefocus 0 -cursor {}
- set data(sbar) [ttk::scrollbar $w.cHull.sbar -orient horizontal -takefocus 0]
- catch {$data(sbar) configure -highlightthickness 0}
- set data(canvas) [canvas $w.cHull.canvas -highlightthick 0 \
- -width 400 -height 120 -takefocus 1 -background white]
- pack $data(sbar) -side bottom -fill x -padx 2 -in $w.cHull -pady {0 2}
- pack $data(canvas) -expand yes -fill both -padx 2 -pady {2 0}
- pack $w.cHull -expand yes -fill both -ipadx 2 -ipady 2
-
- $data(sbar) configure -command [list $data(canvas) xview]
- $data(canvas) configure -xscrollcommand [list $data(sbar) set]
-
- # Initializes the max icon/text width and height and other variables
- #
- set data(maxIW) 1
- set data(maxIH) 1
- set data(maxTW) 1
- set data(maxTH) 1
- set data(numItems) 0
- set data(noScroll) 1
- set data(selection) {}
- set data(index,anchor) ""
- set fg [option get $data(canvas) foreground Foreground]
- if {$fg eq ""} {
- set data(fill) black
- } else {
- set data(fill) $fg
- }
-
- # Creates the event bindings.
- #
- 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 tk::IconList_Double1 $w %x %y]
-
- bind $data(canvas) <Control-B1-Motion> {;}
- bind $data(canvas) <Shift-B1-Motion> \
- [list tk::IconList_ShiftMotion1 $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 tk::IconList_FocusIn $w]
- bind $data(canvas) <FocusOut> [list tk::IconList_FocusOut $w]
-
- return $w
-}
-
-# ::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
-# right, depending on where the mouse left the window, 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 IconList window.
-#
-proc ::tk::IconList_AutoScan {w} {
- upvar ::tk::$w data
- variable ::tk::Priv
-
- if {![winfo exists $w]} return
- set x $Priv(x)
- set y $Priv(y)
-
- if {$data(noScroll)} {
- return
- }
- if {$x >= [winfo width $data(canvas)]} {
- $data(canvas) xview scroll 1 units
- } elseif {$x < 0} {
- $data(canvas) xview scroll -1 units
- } elseif {$y >= [winfo height $data(canvas)]} {
- # do nothing
- } elseif {$y < 0} {
- # do nothing
- } else {
- return
- }
-
- 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 ::tk::IconList_DeleteAll {w} {
- upvar ::tk::$w data
- upvar ::tk::$w:itemList itemList
-
- $data(canvas) delete all
- unset -nocomplain data(selected) data(rect) data(list) itemList
- set data(maxIW) 1
- set data(maxIH) 1
- set data(maxTW) 1
- set data(maxTH) 1
- set data(numItems) 0
- 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 ::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) -fill $data(fill) \
- -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
- }
-
- 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
- }
-
- 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 ::tk::IconList_Arrange {w} {
- upvar ::tk::$w data
-
- if {![info exists data(list)]} {
- if {[info exists data(canvas)] && [winfo exists $data(canvas)]} {
- set data(noScroll) 1
- $data(sbar) configure -command ""
- }
- return
- }
-
- set W [winfo width $data(canvas)]
- set H [winfo height $data(canvas)]
- set pad [expr {[$data(canvas) cget -highlightthickness] + \
- [$data(canvas) cget -bd]}]
- if {$pad < 2} {
- set pad 2
- }
-
- incr W -[expr {$pad*2}]
- incr H -[expr {$pad*2}]
-
- set dx [expr {$data(maxIW) + $data(maxTW) + 8}]
- if {$data(maxTH) > $data(maxIH)} {
- set dy $data(maxTH)
- } else {
- set dy $data(maxIH)
- }
- incr dy 2
- set shift [expr {$data(maxIW) + 4}]
-
- set x [expr {$pad * 2}]
- set y [expr {$pad * 1}] ; # Why * 1 ?
- set usedColumn 0
- foreach sublist $data(list) {
- set usedColumn 1
- 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 $rTag $x $y [expr {$x+$dx}] [expr {$y+$dy}]
-
- incr y $dy
- if {($y + $dy) > $H} {
- set y [expr {$pad * 1}] ; # *1 ?
- incr x $dx
- set usedColumn 0
- }
- }
-
- if {$usedColumn} {
- set sW [expr {$x + $dx}]
- } else {
- set sW $x
- }
-
- if {$sW < $W} {
- $data(canvas) configure -scrollregion [list $pad $pad $sW $H]
- $data(sbar) configure -command ""
- $data(canvas) xview moveto 0
- set data(noScroll) 1
- } else {
- $data(canvas) configure -scrollregion [list $pad $pad $sW $H]
- $data(sbar) configure -command [list $data(canvas) xview]
- set data(noScroll) 0
- }
-
- set data(itemsPerColumn) [expr {($H-$pad)/$dy}]
- if {$data(itemsPerColumn) < 1} {
- set data(itemsPerColumn) 1
- }
-
- IconList_DrawSelection $w
-}
-
-# Gets called when the user invokes the IconList (usually by double-clicking
-# or pressing the Return key).
-#
-proc ::tk::IconList_Invoke {w} {
- upvar ::tk::$w data
-
- if {$data(-command) ne "" && [llength $data(selection)]} {
- uplevel #0 $data(-command)
- }
-}
-
-# ::tk::IconList_See --
-#
-# If the item is not (completely) visible, scroll the canvas so that
-# it becomes visible.
-proc ::tk::IconList_See {w rTag} {
- upvar ::tk::$w data
- upvar ::tk::$w:itemList itemList
-
- if {$data(noScroll)} {
- return
- }
- set sRegion [$data(canvas) cget -scrollregion]
- if {$sRegion eq ""} {
- return
- }
-
- if { $rTag < 0 || $rTag >= [llength $data(list)] } {
- return
- }
-
- set bbox [$data(canvas) bbox item$rTag]
- set pad [expr {[$data(canvas) cget -highlightthickness] + \
- [$data(canvas) cget -bd]}]
-
- set x1 [lindex $bbox 0]
- set x2 [lindex $bbox 2]
- incr x1 -[expr {$pad * 2}]
- incr x2 -[expr {$pad * 1}] ; # *1 ?
-
- set cW [expr {[winfo width $data(canvas)] - $pad*2}]
-
- set scrollW [expr {[lindex $sRegion 2]-[lindex $sRegion 0]+1}]
- set dispX [expr {int([lindex [$data(canvas) xview] 0]*$scrollW)}]
- set oldDispX $dispX
-
- # check if out of the right edge
- #
- if {($x2 - $dispX) >= $cW} {
- set dispX [expr {$x2 - $cW}]
- }
- # check if out of the left edge
- #
- if {($x1 - $dispX) < 0} {
- set dispX $x1
- }
-
- if {$oldDispX ne $dispX} {
- set fraction [expr {double($dispX)/double($scrollW)}]
- $data(canvas) xview moveto $fraction
- }
-}
-
-proc ::tk::IconList_Btn1 {w x y} {
- upvar ::tk::$w data
-
- focus $data(canvas)
- set i [IconList_Index $w @$x,$y]
- if {$i eq ""} {
- return
- }
- IconList_Selection $w clear 0 end
- IconList_Selection $w set $i
- IconList_Selection $w anchor $i
-}
-
-proc ::tk::IconList_CtrlBtn1 {w x y} {
- upvar ::tk::$w data
-
- if { $data(-multiple) } {
- focus $data(canvas)
- set i [IconList_Index $w @$x,$y]
- if {$i eq ""} {
- return
- }
- if { [IconList_Selection $w includes $i] } {
- IconList_Selection $w clear $i
- } else {
- IconList_Selection $w set $i
- IconList_Selection $w anchor $i
- }
- }
-}
-
-proc ::tk::IconList_ShiftBtn1 {w x y} {
- upvar ::tk::$w data
-
- if { $data(-multiple) } {
- focus $data(canvas)
- set i [IconList_Index $w @$x,$y]
- if {$i eq ""} {
- return
- }
- if {[IconList_Index $w anchor] eq ""} {
- IconList_Selection $w anchor $i
- }
- IconList_Selection $w clear 0 end
- IconList_Selection $w set anchor $i
- }
-}
-
-# Gets called on button-1 motions
-#
-proc ::tk::IconList_Motion1 {w x y} {
- variable ::tk::Priv
- set Priv(x) $x
- set Priv(y) $y
- set i [IconList_Index $w @$x,$y]
- if {$i eq ""} {
- return
- }
- IconList_Selection $w clear 0 end
- IconList_Selection $w set $i
-}
-
-proc ::tk::IconList_ShiftMotion1 {w x y} {
- upvar ::tk::$w data
- variable ::tk::Priv
- set Priv(x) $x
- set Priv(y) $y
- set i [IconList_Index $w @$x,$y]
- if {$i eq ""} {
- return
- }
- IconList_Selection $w clear 0 end
- IconList_Selection $w set anchor $i
-}
-
-proc ::tk::IconList_Double1 {w x y} {
- upvar ::tk::$w data
-
- if {[llength $data(selection)]} {
- IconList_Invoke $w
- }
-}
-
-proc ::tk::IconList_ReturnKey {w} {
- IconList_Invoke $w
-}
-
-proc ::tk::IconList_Leave1 {w x y} {
- variable ::tk::Priv
-
- set Priv(x) $x
- set Priv(y) $y
- IconList_AutoScan $w
-}
-
-proc ::tk::IconList_FocusIn {w} {
- upvar ::tk::$w data
-
- $w.cHull state focus
- if {![info exists data(list)]} {
- return
- }
-
- if {[llength $data(selection)]} {
- IconList_DrawSelection $w
- }
-}
-
-proc ::tk::IconList_FocusOut {w} {
- $w.cHull state !focus
- IconList_Selection $w clear 0 end
-}
-
-# ::tk::IconList_UpDown --
-#
-# Moves the active element up or down by one element
-#
-# Arguments:
-# w - The IconList widget.
-# amount - +1 to move down one item, -1 to move back one item.
-#
-proc ::tk::IconList_UpDown {w amount} {
- upvar ::tk::$w data
-
- if {![info exists data(list)]} {
- return
- }
-
- set curr [tk::IconList_CurSelection $w]
- if { [llength $curr] == 0 } {
- set i 0
- } else {
- set i [tk::IconList_Index $w anchor]
- if {$i eq ""} {
- return
- }
- incr i $amount
- }
- IconList_Selection $w clear 0 end
- IconList_Selection $w set $i
- IconList_Selection $w anchor $i
- IconList_See $w $i
-}
-
-# ::tk::IconList_LeftRight --
-#
-# Moves the active element left or right by one column
-#
-# Arguments:
-# w - The IconList widget.
-# amount - +1 to move right one column, -1 to move left one column.
-#
-proc ::tk::IconList_LeftRight {w amount} {
- upvar ::tk::$w data
-
- if {![info exists data(list)]} {
- return
- }
-
- set curr [IconList_CurSelection $w]
- if { [llength $curr] == 0 } {
- set i 0
- } else {
- set i [IconList_Index $w anchor]
- if {$i eq ""} {
- 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
-#----------------------------------------------------------------------
-
-# ::tk::IconList_KeyPress --
-#
-# Gets called when user enters an arbitrary key in the listbox.
-#
-proc ::tk::IconList_KeyPress {w key} {
- variable ::tk::Priv
-
- append Priv(ILAccel,$w) $key
- IconList_Goto $w $Priv(ILAccel,$w)
- catch {
- after cancel $Priv(ILAccel,$w,afterId)
- }
- set Priv(ILAccel,$w,afterId) [after 500 [list tk::IconList_Reset $w]]
-}
-
-proc ::tk::IconList_Goto {w text} {
- upvar ::tk::$w data
- upvar ::tk::$w:textList textList
-
- if {![info exists data(list)]} {
- return
- }
-
- if {$text eq "" || $data(numItems) == 0} {
- return
- }
-
- if {[llength [IconList_CurSelection $w]]} {
- set start [IconList_Index $w anchor]
- } else {
- set start 0
- }
-
- set theIndex -1
- set less 0
- set len [string length $text]
- set len0 [expr {$len-1}]
- set i $start
-
- # Search forward until we find a filename whose prefix is a
- # case-insensitive match with $text
- while {1} {
- if {[string equal -nocase -length $len0 $textList($i) $text]} {
- set theIndex $i
- break
- }
- incr i
- if {$i == $data(numItems)} {
- set i 0
- }
- if {$i == $start} {
- break
- }
- }
-
- if {$theIndex > -1} {
- IconList_Selection $w clear 0 end
- IconList_Selection $w set $theIndex
- IconList_Selection $w anchor $theIndex
- IconList_See $w $theIndex
- }
-}
-
-proc ::tk::IconList_Reset {w} {
- variable ::tk::Priv
-
- unset -nocomplain Priv(ILAccel,$w)
-}
-
-#----------------------------------------------------------------------
-#
-# F I L E D I A L O G
-#
-#----------------------------------------------------------------------
-
namespace eval ::tk::dialog {}
namespace eval ::tk::dialog::file {
namespace import -force ::tk::msgcat::*
- set ::tk::dialog::file::showHiddenBtn 0
- set ::tk::dialog::file::showHiddenVar 1
+ variable showHiddenBtn 0
+ variable showHiddenVar 1
+
+ # Create the images if they did not already exist.
+ if {![info exists ::tk::Priv(updirImage)]} {
+ set ::tk::Priv(updirImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/gD+AP7rGN
+ SCAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAACXZwQWcAAAAWAAAAFgDcxelYAAAENUlE
+ QVQ4y7WUbWiVZRjHf/f9POcc9+Kc5bC2aIq5sGG0XnTzNU13zAIlFMNc9CEhTCKwCC
+ JIgt7AglaR0RcrolAKg14+GBbiGL6xZiYyy63cmzvu7MVznnOe537rw7bDyvlBoT/c
+ n+6L3/3nf13XLZLJJP+HfICysjKvqqpq+rWKysvLR1tbW+11g+fPn/+bEGIe4KYqCs
+ Owu66u7oG2trah6wJrrRc0NTVhjME5h7Vj5pxzCCE4duxYZUdHx/aGhoZmgJ+yb+wF
+ uCO19RmAffv25f8LFslkktraWtvU1CS6u7vRWmOtxVpbAPu+T0tLS04pFU/J34Wd3S
+ cdFtlfZWeZBU4IcaS5uXn1ZLAEMMY4ay1aa4wx/zpKKYIgoL6+vmjxqoXe5ZLTcsPq
+ bTyycjODpe1y3WMrvDAMV14jCuW0VhhjiJQpOJ5w7Zwjk8/y9R+vsHHNNq6oFMrkeX
+ BxI+8d2sktap3YvOPD0lRQrH+Z81fE7t3WB4gihVKazsuaA20aKSUgAG/seQdy2l6W
+ 37+EyopqTv39I6HJUT2zlnlza2jLdgiTaxwmDov6alLHcZUTzXPGGAauWJbfO4dHl9
+ bgJs3HyfNf0N4ZsOa+jbT3/ownY/hO09p1kBULtjBw+Tvq7xzwauds4dWPDleAcP5E
+ xlprgtBRUZRgYCRPTzoHwEi2g6OnX+eFrW/RM9qBE4p43CeTz5ATaU6nDrFm2cPs/+
+ E1SopqkZ7MFJqntXZaa7IKppckwIEvJbg8LWd28OT6nVihCPQQ8UScWCLGqO4hXuQx
+ qDtJ204eWrqWb1ufRspwtABWaqx5gRKUFSdwDnxPcuLcyyxbuIyaqntIBV34MY9YzC
+ Owg+S9YeJFkniRpGPkCLMrZzG3+jbktA/KClMxFoUhiKC0OAbAhd79CO8i6xe/STyW
+ 4O7KVRgUJ/sP0heeJV4kEVKw/vZd40sFKxat4mLvp6VLdvnb/XHHGGPIKwBBpC1/9n
+ 3DpfRZnn9/AwCxRII9O79kVPdjvByxuET6Ai8mePeTt4lyheXzhOSpCcdWa00uckTG
+ kckbGu76nEhbIm2xznH4VB3OWYaiXqQn8GKSWGIMHuXyPL76LBcupmhp69pz4uMnXi
+ w4VloTGcdQRtGdzmHs1f+RdYZslMZJhzUOHVnceN1ooEiP5JUzdqCQMWCD0JCIeQzn
+ NNpO+clhrCYf5rC+A2cxWmDUWG2oHEOZMEKIwclgMnnLrTeXUV7sUzpNXgU9DmijWV
+ v9LEKCkAIhKIBnlvpks6F21qUZ31u/sbExPa9h0/RzwzMov2nGlG5TmW1YOzzlnSfL
+ mVnyGf19Q7lwZHBp+1fPtflAIgiC7389n9qkihP+lWyeqfUO15ZwQTqlw9H+o2cOvN
+ QJCAHEgEqgYnI0NyALjAJdyWQy7wMa6AEujUdzo3LjcAXwD/XCTKIRjWytAAAAJXRF
+ WHRjcmVhdGUtZGF0ZQAyMDA5LTA0LTA2VDIxOjI1OjQxLTAzOjAw8s+uCAAAACV0RV
+ h0bW9kaWZ5LWRhdGUAMjAwOC0wMS0wM1QxNTowODoyMS0wMjowMJEc/44AAAAZdEVY
+ dFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC
+ }]
+ }
+ if {![info exists ::tk::Priv(folderImage)]} {
+ set ::tk::Priv(folderImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiA
+ AAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBl
+ Lm9yZ5vuPBoAAAHCSURBVDiNpZAxa5NRFIafc+9XLCni4BC6FBycMnbrLpkcgtDVX6
+ C70D/g4lZX/4coxLlgxFkpiiSSUGm/JiXfveee45AmNlhawXc53HvPee55X+l2u/yP
+ qt3d3Tfu/viatwt3fzIYDI5uBJhZr9fr3TMzzAx3B+D09PR+v98/7HQ6z5fNOWdCCG
+ U4HH6s67oAVDlnV1UmkwmllBUkhMD29nYHeLuEAkyn06qU8qqu64MrgIyqYmZrkHa7
+ 3drc3KTVahFjJITAaDRiPB4/XFlQVVMtHH5IzJo/P4EA4MyB+erWPQB7++zs7ccYvl
+ U5Z08pMW2cl88eIXLZeDUpXzsBkNQ5eP1+p0opmaoCTgzw6fjs6gLLsp58FB60t0Dc
+ K1Ul54yIEIMQ43Uj68pquDmCeJVztpwzuBNE2LgBoMVpslHMCUEAFgDVxQbzVAiA+a
+ K5uGPmmDtZF3VpoUm2ArhqQaRiUjcMf81p1G60UEVhcjZfAFTVUkrgkS+jc06mDX9n
+ vq4YhJ9nlxZExMwMEaHJRutOdWuIIsJFUoBSuTvHJ4YIfP46unV4qdlsjsBRZRtb/X
+ fHd5+C8+P7+J8BIoxFwovfRxYhnhxjpzEAAAAASUVORK5CYII=
+ }]
+ }
+ if {![info exists ::tk::Priv(fileImage)]} {
+ set ::tk::Priv(fileImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gva
+ eTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QQWFA84umAmQgAAANpJREFU
+ OMutkj1uhDAQhb8HSLtbISGfgZ+zbJkix0HmFhwhUdocBnMBGvqtTIqIFSReWKK8ai
+ x73nwzHrVt+zEMwwvH9FrX9TsA1trpqKy10+yUzME4jnjvAZB0LzXHkojjmDRNVyh3
+ A+89zrlVwlKSqKrqVy/J8lAUxSZBSMny4ZLgp54iyPM8UPHGNJ2IomibAKDv+9VlWZ
+ bABbgB5/0WQgSSkC4PF2JF4JzbHN430c4vhAm0TyCJruuClefph4yCBCGT3T3Isoy/
+ KDHGfDZNcz2SZIx547/0BVRRX7n8uT/sAAAAAElFTkSuQmCC
+ }]
+ }
}
# ::tk::dialog::file:: --
#
-# Implements the TK file selection dialog. This dialog is used when
-# the tk_strictMotif flag is set to false. This procedure shouldn't
-# be called directly. Call tk_getOpenFile or tk_getSaveFile instead.
+# Implements the TK file selection dialog. This dialog is used when the
+# tk_strictMotif flag is set to false. This procedure shouldn't be
+# called directly. Call tk_getOpenFile or tk_getSaveFile instead.
#
# Arguments:
# type "open" or "save"
@@ -813,6 +96,7 @@ namespace eval ::tk::dialog::file {
proc ::tk::dialog::file:: {type args} {
variable ::tk::Priv
+ variable showHiddenBtn
set dataName __tk_filedialog
upvar ::tk::dialog::file::$dataName data
@@ -845,7 +129,7 @@ proc ::tk::dialog::file:: {type args} {
set data(hiddenBtn) $w.contents.f2.hidden
SetSelectMode $w $data(-multiple)
}
- if {$::tk::dialog::file::showHiddenBtn} {
+ if {$showHiddenBtn} {
$data(hiddenBtn) configure -state normal
grid $data(hiddenBtn)
} else {
@@ -856,12 +140,12 @@ proc ::tk::dialog::file:: {type args} {
# Make sure subseqent uses of this dialog are independent [Bug 845189]
unset -nocomplain data(extUsed)
- # Dialog boxes should be transient with respect to their parent,
- # so that they will always stay on top of their parent window. However,
- # some window managers will create the window as withdrawn if the parent
- # window is withdrawn or iconified. Combined with the grab we put on the
- # window, this can hang the entire application. Therefore we only make
- # the dialog transient if the parent is viewable.
+ # 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)
@@ -897,7 +181,7 @@ proc ::tk::dialog::file:: {type args} {
set filter [lindex $type 1]
$data(typeMenu) add command -label $title \
-command [list ::tk::dialog::file::SetFilter $w $type]
- # string first avoids glob-pattern char issues
+ # [string first] avoids glob-pattern char issues
if {[string first ${initialTypeName} $title] == 0} {
set initialtype $type
}
@@ -912,9 +196,9 @@ proc ::tk::dialog::file:: {type args} {
}
UpdateWhenIdle $w
- # Withdraw the window, then update all the geometry information
- # so we know how big it wants to be, then center the window in the
- # display and de-iconify it.
+ # 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.
::tk::PlaceWindow $w widget $data(-parent)
wm title $w $data(-title)
@@ -927,11 +211,10 @@ proc ::tk::dialog::file:: {type args} {
$data(ent) selection range 0 end
$data(ent) icursor end
- # Wait for the user to respond, then restore the focus and
- # return the index of the selected button. Restore the focus
- # before deleting the window, since otherwise the window manager
- # may take the focus away so we can't redirect it. Finally,
- # restore any grab that was in effect.
+ # Wait for the user to respond, then restore the focus and return the
+ # index of the selected button. Restore the focus before deleting the
+ # window, since otherwise the window manager may take the focus away so we
+ # can't redirect it. Finally, restore any grab that was in effect.
vwait ::tk::Priv(selectFilePath)
@@ -941,7 +224,7 @@ proc ::tk::dialog::file:: {type args} {
#
foreach trace [trace info variable data(selectPath)] {
- trace remove variable data(selectPath) [lindex $trace 0] [lindex $trace 1]
+ trace remove variable data(selectPath) {*}$trace
}
$data(dirMenuBtn) configure -textvariable {}
@@ -962,7 +245,7 @@ proc ::tk::dialog::file::Config {dataName type argList} {
# if the dialog is now used with a different -parent option.
foreach trace [trace info variable data(selectPath)] {
- trace remove variable data(selectPath) [lindex $trace 0] [lindex $trace 1]
+ trace remove variable data(selectPath) {*}$trace
}
# 1: the configuration specs
@@ -1033,8 +316,8 @@ proc ::tk::dialog::file::Config {dataName type argList} {
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.
+ # Set -multiple to a one or zero value (not other boolean types like
+ # "yes") so we can use it in tests more easily.
if {$type eq "save"} {
set data(-multiple) 0
} elseif {$data(-multiple)} {
@@ -1068,21 +351,10 @@ proc ::tk::dialog::file::Create {w class} {
set data(dirMenu) $f1.menu.menu
ttk::menubutton $f1.menu -menu $data(dirMenu) -direction flush \
-textvariable [format %s(selectPath) ::tk::dialog::file::$dataName]
- [menu $data(dirMenu) -tearoff 0] add radiobutton -label "" -variable \
+ menu $data(dirMenu) -tearoff 0
+ $data(dirMenu) add radiobutton -label "" -variable \
[format %s(selectPath) ::tk::dialog::file::$dataName]
set data(upBtn) [ttk::button $f1.up]
- if {![info exists Priv(updirImage)]} {
- set Priv(updirImage) [image create bitmap -data {
-#define updir_width 28
-#define updir_height 16
-static char updir_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00,
- 0x20, 0x40, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x01, 0x10, 0x00, 0x00, 0x01,
- 0x10, 0x02, 0x00, 0x01, 0x10, 0x07, 0x00, 0x01, 0x90, 0x0f, 0x00, 0x01,
- 0x10, 0x02, 0x00, 0x01, 0x10, 0x02, 0x00, 0x01, 0x10, 0x02, 0x00, 0x01,
- 0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
- 0xf0, 0xff, 0xff, 0x01};}]
- }
$data(upBtn) configure -image $Priv(updirImage)
$f1.menu configure -takefocus 1;# -highlightthickness 2
@@ -1119,8 +391,8 @@ static char updir_bits[] = {
# -pady 0
set data(ent) [ttk::entry $f2.ent]
- # The font to use for the icons. The default Canvas font on Unix
- # is just deviant.
+ # The font to use for the icons. The default Canvas font on Unix is just
+ # deviant.
set ::tk::$w.contents.icons(font) [$data(ent) cget -font]
# Make the file types bits only if this is a File Dialog
@@ -1137,9 +409,9 @@ static char updir_bits[] = {
focus $data(typeMenuBtn)]
}
- # The hidden button is displayed when ::tk::dialog::file::showHiddenBtn
- # is true. Create it disabled so the binding doesn't trigger if it
- # isn't shown.
+ # The hidden button is displayed when ::tk::dialog::file::showHiddenBtn is
+ # true. Create it disabled so the binding doesn't trigger if it isn't
+ # shown.
if {$class eq "TkFDialog"} {
set text [mc "Show &Hidden Files and Directories"]
} else {
@@ -1242,36 +514,32 @@ proc ::tk::dialog::file::SetSelectMode {w multi} {
}
set iconListCommand [list ::tk::dialog::file::OkCmd $w]
::tk::SetAmpText $w.contents.f2.lab $fNameCaption
- ::tk::IconList_Config $data(icons) \
- [list -multiple $multi -command $iconListCommand]
+ $data(icons) configure -multiple $multi -command $iconListCommand
return
}
# ::tk::dialog::file::UpdateWhenIdle --
#
-# Creates an idle event handler which updates the dialog in idle
-# time. This is important because loading the directory may take a long
-# time and we don't want to load the same directory for multiple times
-# due to multiple concurrent events.
+# Creates an idle event handler which updates the dialog in idle time.
+# This is important because loading the directory may take a long time
+# and we don't want to load the same directory for multiple times due to
+# multiple concurrent events.
#
proc ::tk::dialog::file::UpdateWhenIdle {w} {
upvar ::tk::dialog::file::[winfo name $w] data
if {[info exists data(updateId)]} {
return
- } else {
- set data(updateId) [after idle [list ::tk::dialog::file::Update $w]]
}
+ set data(updateId) [after idle [list ::tk::dialog::file::Update $w]]
}
# ::tk::dialog::file::Update --
#
-# Loads the files and directories into the IconList widget. Also
-# sets up the directory option menu for quick access to parent
-# directories.
+# Loads the files and directories into the IconList widget. Also sets up
+# the directory option menu for quick access to parent directories.
#
proc ::tk::dialog::file::Update {w} {
-
# This proc may be called within an idle handler. Make sure that the
# window has not been destroyed before this proc is called
if {![winfo exists $w]} {
@@ -1285,30 +553,24 @@ proc ::tk::dialog::file::Update {w} {
set dataName [winfo name $w]
upvar ::tk::dialog::file::$dataName data
variable ::tk::Priv
+ variable showHiddenVar
global tk_library
unset -nocomplain data(updateId)
- if {![info exists Priv(folderImage)]} {
- set Priv(folderImage) [image create photo -data {
-R0lGODlhEAAMAKEAAAD//wAAAPD/gAAAACH5BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB
-QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==}]
- set Priv(fileImage) [image create photo -data {
-R0lGODlhDAAMAKEAALLA3AAAAP//8wAAACH5BAEAAAAALAAAAAAMAAwAAAIgRI4Ha+IfWHsO
-rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
- }
set folder $Priv(folderImage)
set file $Priv(fileImage)
set appPWD [pwd]
if {[catch {
cd $data(selectPath)
- }]} {
+ }]} then {
# We cannot change directory to $data(selectPath). $data(selectPath)
- # should have been checked before ::tk::dialog::file::Update is called, so
- # we normally won't come to here. Anyways, give an error and abort
- # action.
- tk_messageBox -type ok -parent $w -icon warning -message \
- [mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $data(selectPath)]
+ # should have been checked before ::tk::dialog::file::Update is
+ # called, so we normally won't come to here. Anyways, give an error
+ # and abort action.
+ tk_messageBox -type ok -parent $w -icon warning -message [mc \
+ "Cannot change to the directory \"%1\$s\".\nPermission denied."\
+ $data(selectPath)]
cd $appPWD
return
}
@@ -1322,15 +584,17 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
$w configure -cursor watch
update idletasks
- ::tk::IconList_DeleteAll $data(icons)
+ $data(icons) deleteall
- set showHidden $::tk::dialog::file::showHiddenVar
+ set showHidden $showHiddenVar
# Make the dir list
# Using -directory [pwd] is better in some VFS cases.
set cmd [list glob -tails -directory [pwd] -type d -nocomplain *]
- if {$showHidden} { lappend cmd .* }
- set dirs [lsort -dictionary -unique [eval $cmd]]
+ if {$showHidden} {
+ lappend cmd .*
+ }
+ set dirs [lsort -dictionary -unique [{*}$cmd]]
set dirList {}
foreach d $dirs {
if {$d eq "." || $d eq ".."} {
@@ -1338,11 +602,11 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
}
lappend dirList $d
}
- ::tk::IconList_Add $data(icons) $folder $dirList
+ $data(icons) add $folder $dirList
if {$class eq "TkFDialog"} {
- # Make the file list if this is a File Dialog, selecting all
- # but 'd'irectory type files.
+ # Make the file list if this is a File Dialog, selecting all but
+ # 'd'irectory type files.
#
set cmd [list glob -tails -directory [pwd] \
-type {f b c l p s} -nocomplain]
@@ -1352,14 +616,12 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
lappend cmd .*
}
} else {
- eval [list lappend cmd] $data(filter)
+ lappend cmd {*}$data(filter)
}
- set fileList [lsort -dictionary -unique [eval $cmd]]
- ::tk::IconList_Add $data(icons) $file $fileList
+ set fileList [lsort -dictionary -unique [{*}$cmd]]
+ $data(icons) add $file $fileList
}
- ::tk::IconList_Arrange $data(icons)
-
# Update the Directory: option menu
#
set list ""
@@ -1402,9 +664,10 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
proc ::tk::dialog::file::SetPathSilently {w path} {
upvar ::tk::dialog::file::[winfo name $w] data
- trace remove variable data(selectPath) write [list ::tk::dialog::file::SetPath $w]
+ set cb [list ::tk::dialog::file::SetPath $w]
+ trace remove variable data(selectPath) write $cb
set data(selectPath) $path
- trace add variable data(selectPath) write [list ::tk::dialog::file::SetPath $w]
+ trace add variable data(selectPath) write $cb
}
@@ -1426,14 +689,13 @@ 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 ::tk::$data(icons) icons
set data(filterType) $type
set data(filter) [lindex $type 1]
$data(typeMenuBtn) configure -text [lindex $type 0] ;#-indicatoron 1
- # If we aren't using a default extension, use the one suppled
- # by the filter.
+ # If 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
@@ -1443,8 +705,8 @@ proc ::tk::dialog::file::SetFilter {w type} {
}
if {!$data(extUsed)} {
- # Get the first extension in the list that matches {^\*\.\w+$}
- # and remove all * from the filter.
+ # 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) \
@@ -1455,15 +717,14 @@ proc ::tk::dialog::file::SetFilter {w type} {
}
}
- $icons(sbar) set 0.0 0.0
+ $data(icons) see 0
UpdateWhenIdle $w
}
# tk::dialog::file::ResolveFile --
#
-# Interpret the user's text input in a file selection dialog.
-# Performs:
+# Interpret the user's text input in a file selection dialog. Performs:
#
# (1) ~ substitution
# (2) resolve all instances of . and ..
@@ -1484,25 +745,24 @@ proc ::tk::dialog::file::SetFilter {w type} {
# flag = OK : valid input
# = PATTERN : valid directory/pattern
# = PATH : the directory does not exist
-# = FILE : the directory exists by the file doesn't
-# exist
+# = FILE : the directory exists by the file doesn't exist
# = CHDIR : Cannot change to the directory
# = ERROR : Invalid entry
#
# directory : valid only if flag = OK or PATTERN or FILE
# file : valid only if flag = OK or PATTERN
#
-# directory may not be the same as context, because text may contain
-# a subdirectory name
+# directory may not be the same as context, because text may contain a
+# subdirectory name
#
proc ::tk::dialog::file::ResolveFile {context text defaultext {expandEnv 1}} {
set appPWD [pwd]
set path [JoinFile $context $text]
- # If the file has no extension, append the default. Be careful not
- # to do this for directories, otherwise typing a dirname in the box
- # will give back "dirname.extension" instead of trying to change dir.
+ # If the file has no extension, append the default. Be careful not to do
+ # this for directories, otherwise typing a dirname in the box will give
+ # back "dirname.extension" instead of trying to change dir.
if {
![file isdirectory $path] && ([file ext $path] eq "") &&
![string match {$*} [file tail $path]]
@@ -1511,8 +771,8 @@ proc ::tk::dialog::file::ResolveFile {context text defaultext {expandEnv 1}} {
}
if {[catch {file exists $path}]} {
- # This "if" block can be safely removed if the following code
- # stop generating errors.
+ # This "if" block can be safely removed if the following code stop
+ # generating errors.
#
# file exists ~nonsuchuser
#
@@ -1711,8 +971,8 @@ proc ::tk::dialog::file::UpDirCmd {w} {
}
}
-# Join a file name to a path name. The "file join" command will break
-# if the filename begins with ~
+# Join a file name to a path name. The "file join" command will break if the
+# filename begins with ~
#
proc ::tk::dialog::file::JoinFile {path file} {
if {[string match {~*} $file] && [file exists $path/$file]} {
@@ -1728,12 +988,14 @@ proc ::tk::dialog::file::OkCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
set filenames {}
- foreach item [::tk::IconList_CurSelection $data(icons)] {
- lappend filenames [::tk::IconList_Get $data(icons) $item]
+ foreach item [$data(icons) selection get] {
+ lappend filenames [$data(icons) get $item]
}
- if {([llength $filenames] && !$data(-multiple)) || \
- ($data(-multiple) && ([llength $filenames] == 1))} {
+ if {
+ ([llength $filenames] && !$data(-multiple)) ||
+ ($data(-multiple) && ([llength $filenames] == 1))
+ } then {
set filename [lindex $filenames 0]
set file [JoinFile $data(selectPath) $filename]
if {[file isdirectory $file]} {
@@ -1771,8 +1033,8 @@ proc ::tk::dialog::file::ListBrowse {w} {
upvar ::tk::dialog::file::[winfo name $w] data
set text {}
- foreach item [::tk::IconList_CurSelection $data(icons)] {
- lappend text [::tk::IconList_Get $data(icons) $item]
+ foreach item [$data(icons) selection get] {
+ lappend text [$data(icons) get $item]
}
if {[llength $text] == 0} {
return
@@ -1808,8 +1070,8 @@ proc ::tk::dialog::file::ListBrowse {w} {
}
}
-# Gets called when user invokes the IconList widget (double-click,
-# Return key, etc)
+# Gets called when user invokes the IconList widget (double-click, Return key,
+# etc)
#
proc ::tk::dialog::file::ListInvoke {w filenames} {
upvar ::tk::dialog::file::[winfo name $w] data
@@ -1842,11 +1104,11 @@ proc ::tk::dialog::file::ListInvoke {w filenames} {
# ::tk::dialog::file::Done --
#
-# Gets called when user has input a valid filename. Pops up a
-# dialog box to confirm selection when necessary. Sets the
-# tk::Priv(selectFilePath) variable, which will break the "vwait"
-# loop in ::tk::dialog::file:: and return the selected filename to the
-# script that calls tk_getOpenFile or tk_getSaveFile
+# Gets called when user has input a valid filename. Pops up a dialog
+# box to confirm selection when necessary. Sets the
+# tk::Priv(selectFilePath) variable, which will break the "vwait" loop
+# in ::tk::dialog::file:: and return the selected filename to the script
+# that calls tk_getOpenFile or tk_getSaveFile
#
proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
upvar ::tk::dialog::file::[winfo name $w] data
@@ -1873,9 +1135,11 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
return
}
}
- if {[info exists data(-typevariable)] && $data(-typevariable) ne ""
- && [info exists data(-filetypes)] && [llength $data(-filetypes)]
- && [info exists data(filterType)] && $data(filterType) ne ""} {
+ if {
+ [info exists data(-typevariable)] && $data(-typevariable) ne ""
+ && [info exists data(-filetypes)] && [llength $data(-filetypes)]
+ && [info exists data(filterType)] && $data(filterType) ne ""
+ } then {
upvar #0 $data(-typevariable) typeVariable
set typeVariable [lindex $data(filterType) 0]
}
@@ -1885,6 +1149,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
}
proc ::tk::dialog::file::CompleteEnt {w} {
+ variable showHiddenVar
upvar ::tk::dialog::file::[winfo name $w] data
set f [$data(ent) get]
if {$data(-multiple)} {
@@ -1901,7 +1166,7 @@ proc ::tk::dialog::file::CompleteEnt {w} {
-nocomplain *]
if {$data(filter) eq "*"} {
lappend globF *
- if {$::tk::dialog::file::showHiddenVar} {
+ if {$showHiddenVar} {
lappend globF .*
lappend globD .*
}
@@ -1912,7 +1177,7 @@ proc ::tk::dialog::file::CompleteEnt {w} {
}
set dirs [lsort -dictionary -unique [{*}$globD]]
} else {
- if {$::tk::dialog::file::showHiddenVar} {
+ if {$showHiddenVar} {
lappend globD .*
}
if {[winfo class $w] eq "TkFDialog"} {
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl
index e60df90..faae7b2 100644
--- a/library/ttk/entry.tcl
+++ b/library/ttk/entry.tcl
@@ -42,7 +42,7 @@ option add *TEntry.cursor [ttk::cursor text]
#
# <Control-Key-space>, <Control-Shift-Key-space>,
# <Key-Select>, <Shift-Key-Select>:
-# ttk::entry widget doesn't use selection anchor.
+# Ttk entry widget doesn't use selection anchor.
# <Key-Insert>:
# Inserts PRIMARY selection (on non-Windows platforms).
# This is inconsistent with typical platform bindings.
@@ -93,19 +93,19 @@ bind TEntry <<PasteSelection>> { ttk::entry::ScanRelease %W %x }
## Keyboard navigation bindings:
#
-bind TEntry <Key-Left> { ttk::entry::Move %W prevchar }
-bind TEntry <Key-Right> { ttk::entry::Move %W nextchar }
-bind TEntry <Control-Key-Left> { ttk::entry::Move %W prevword }
-bind TEntry <Control-Key-Right> { ttk::entry::Move %W nextword }
-bind TEntry <Key-Home> { ttk::entry::Move %W home }
-bind TEntry <Key-End> { ttk::entry::Move %W end }
-
-bind TEntry <Shift-Key-Left> { ttk::entry::Extend %W prevchar }
-bind TEntry <Shift-Key-Right> { ttk::entry::Extend %W nextchar }
-bind TEntry <Shift-Control-Key-Left> { ttk::entry::Extend %W prevword }
-bind TEntry <Shift-Control-Key-Right> { ttk::entry::Extend %W nextword }
-bind TEntry <Shift-Key-Home> { ttk::entry::Extend %W home }
-bind TEntry <Shift-Key-End> { ttk::entry::Extend %W end }
+bind TEntry <<PrevChar>> { ttk::entry::Move %W prevchar }
+bind TEntry <<NextChar>> { ttk::entry::Move %W nextchar }
+bind TEntry <<PrevWord>> { ttk::entry::Move %W prevword }
+bind TEntry <<NextWord>> { ttk::entry::Move %W nextword }
+bind TEntry <<LineStart>> { ttk::entry::Move %W home }
+bind TEntry <<LineEnd>> { ttk::entry::Move %W end }
+
+bind TEntry <<SelectPrevChar>> { ttk::entry::Extend %W prevchar }
+bind TEntry <<SelectNextChar>> { ttk::entry::Extend %W nextchar }
+bind TEntry <<SelectPrevWord>> { ttk::entry::Extend %W prevword }
+bind TEntry <<SelectNextWord>> { ttk::entry::Extend %W nextword }
+bind TEntry <<SelectLineStart>> { ttk::entry::Extend %W home }
+bind TEntry <<SelectLineEnd>> { ttk::entry::Extend %W end }
bind TEntry <Control-Key-slash> { %W selection range 0 end }
bind TEntry <Control-Key-backslash> { %W selection clear }
diff --git a/library/unsupported.tcl b/library/unsupported.tcl
index aeece38..feb9cc5 100644
--- a/library/unsupported.tcl
+++ b/library/unsupported.tcl
@@ -86,34 +86,6 @@ namespace eval ::tk::unsupported {
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
diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl
index d511462..092f177 100644
--- a/library/xmfbox.tcl
+++ b/library/xmfbox.tcl
@@ -159,7 +159,7 @@ proc ::tk::MotifFDialog_FileTypes {w} {
set initialTypeName [lindex $data(-filetypes) 0 0]
if {$data(-typevariable) ne ""} {
upvar #0 $data(-typevariable) typeVariable
- if {[info exist typeVariable]} {
+ if {[info exists typeVariable]} {
set initialTypeName $typeVariable
}
}
diff --git a/license.terms b/license.terms
index 50619a3..e0b92ea 100644
--- a/license.terms
+++ b/license.terms
@@ -1,7 +1,8 @@
This software is copyrighted by the Regents of the University of
-California, Sun Microsystems, Inc., and other parties. The following
-terms apply to all files associated with the software unless explicitly
-disclaimed in individual files.
+California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
+Corporation, Apple Inc. and other parties. The following terms apply to
+all files associated with the software unless explicitly disclaimed in
+individual files.
The authors hereby grant permission to use, copy, modify, distribute,
and license this software and its documentation for any purpose, provided
diff --git a/macosx/README b/macosx/README
index d0357df..f58184c 100644
--- a/macosx/README
+++ b/macosx/README
@@ -28,12 +28,11 @@ before asking on the list, many questions have already been answered).
- There are two versions of Tk available on Mac OS X: TkAqua using the native
aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets.
TkX11 requires an X11 server to be installed, such as Apple's X11 (which is
-available as an optional install on recent Mac OS X retail disks).
+available as an optional or default install on recent Mac OS X).
TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem].
-- At a minimum, Mac OS X 10.1 is required to run Tcl and TkX11, and OS X 10.2 is
-required to run TkAqua. However OS X 10.3 or higher is recommended (certain
-[file] operations behave incorrectly on earlier releases).
+- At a minimum, Mac OS X 10.3 is required to run Tcl and TkX11.
+TkAqua requires Mac OS X 10.5 or later (starting with Tk 8.6b2).
- Unless weak-linking is used, Tcl/Tk built on Mac OS X 10.x will not run on
10.y with y < x; on the other hand Tcl/Tk built on 10.y will always run on 10.x
@@ -52,36 +51,36 @@ brings up the Tk console window at startup. This is the case when double
clicking Wish in the Finder (or using 'open Wish.app' from the Terminal).
- Tcl extensions can be installed in any of:
- $HOME/Library/Tcl /Library/Tcl /Network/Library/Tcl /System/Library/Tcl
- $HOME/Library/Frameworks /Library/Frameworks /Network/Library/Frameworks
- /System/Library/Frameworks (searched in that order).
+ $HOME/Library/Tcl /Library/Tcl /System/Library/Tcl
+ $HOME/Library/Frameworks /Library/Frameworks /System/Library/Frameworks
+ (searched in that order).
Given a potential package directory $pkg, Tcl on OSX checks for the file
$pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl.
This allows building extensions as frameworks with all script files contained in
the Resources/Scripts directory of the framework.
- [load]able binary extensions can linked as either ordinary shared libraries
-(.dylib) or as MachO bundles (since 8.4.10/8.5a3); only bundles can be unloaded,
-and bundles are also loaded more efficiently from VFS (no temporary copy to the
-native filesystem required).
+(.dylib) or as MachO bundles (since 8.4.10/8.5a3); bundles have the advantage
+that they are [load]ed more efficiently from a tcl VFS (no temporary copy to the
+native filesystem required), and prior to Mac OS X 10.5, only bundles can be
+[unload]ed.
- The 'deploy' target of macosx/GNUmakefile installs the html manpages into the
standard documentation location in the Tcl/Tk frameworks:
Tcl.framework/Resources/Documentation/Reference/Tcl
Tk.framework/Resources/Documentation/Reference/Tk
-No nroff manpages are installed by default by the GNUmakefiles.
+No nroff manpages are installed by default by the GNUmakefile.
- The Tcl and Tk frameworks can be installed in any of the system's standard
framework directories:
- $HOME/Library/Frameworks /Library/Frameworks
- /Network/Library/Frameworks /System/Library/Frameworks
+ $HOME/Library/Frameworks /Library/Frameworks /System/Library/Frameworks
-- /usr/bin/wish8.x is a script that calls a copy of 'Wish' contained in
+- ${prefix}/bin/wish8.x is a script that calls a copy of 'Wish' contained in
Tk.framework/Resources
-- if 'Wish' is started from the Finder or via 'open', $argv contains a
-"-psn_XXXX" argument. This is the Wish's carbon process serial number, you may
-need to filter it out for cross platform compatibility of your scripts.
+- if 'Wish' is started from the Finder or via 'open', $argv may contain a
+"-psn_XXXX" argument. This is the process serial number, you may need to filter
+it out for cross platform compatibility of your scripts.
- the env array is different when Wish is started from the Finder (i.e. via
LaunchServices) than when it (or tclsh) is invoked from the Terminal, in
@@ -89,47 +88,139 @@ particular PATH may not be what you expect. (Wish started by LaunchServices
inherits loginwindow's environment variables, which are essentially those set in
$HOME/.MacOSX/environment.plist, and are unrelated to those set in your shell).
-- As of Tk 8.4.7, TkAqua has a version of the low-level drawing primitives using
-the CoreGraphics routines - the code is primarily due to James Tittle. There
-were numerous problems with the QD version, mostly due to the different drawing
-model of QD & Tk. CG also trivially supports dashed lines, and the various end
-caps & miters. The old QD code is retained for now, just in case there are any
-compatibility problems. To switch back to the QD drawing, put
- set tk::mac::useCGDrawing 0
-in your script before you do drawing.
-All CG drawing is antialiased by default, but (outline) linewidth can be used to
-control whether a line/shape is drawn antialiased. The antialiasing threshold is
-0 by default (i.e. antialias everything), it can be changed by setting
+- TkAqua drawing is antialiased by default, but (outline) linewidth can be used
+to control whether a line/shape is drawn antialiased. The antialiasing threshold
+is 0 by default (i.e. antialias everything), it can be changed by setting
set tk::mac::CGAntialiasLimit <limit>
in your script before drawing, in which case lines (or shapes with outlines)
thinner than <limit> pixels will not be antialiased.
-- ATSUI text antialiasing by default uses the standard OS antialising settings.
+- Text antialiasing by default uses the standard OS antialising settings.
Setting the global variable '::tk::mac::antialiasedtext' allows to control text
antialiasing from Tcl: a value of 1 enables AA, 0 disables AA and -1 restores
the default behaviour of respecting the OS settings.
- Scrollbars: There are two scrollbar variants in Aqua, normal & small. The
-normal scrollbar has a small dimension of 15, the small variant 11. Access to
-the small variant was added in Tk 8.4.2.
-
-- Cursors: You can now put up and spin the Classic MacOS spinner, and the
-counting hands and watch cursor. The way this is done is each of the spinners
-have a base name:
- spinning: The circular B&W circular spinner
- countinguphand: The counting up hand
- countingdownhand: The counting down hand
- countingupanddownhand: The counting up then down hand
- watch: The watch cursor
-Then to get the sequential variants, add an integer to the end of the base name.
-So, for instance this code will spin the spinner:
- proc spinCursor {widget count} {
- $widget configure -cursor spinning$count
- after 100 spinCursor [incr count]
- }
-This was added in Tk 8.4.2
-
-- If you want to use Remote Debugging with Xcode 1.5 or 2.2, you need to set the
+normal scrollbar has a small dimension of 15, the small variant 11.
+Access to the small variant was added in Tk 8.4.2.
+
+- The default metrics of native buttons, radiobuttons, checkboxes and
+menubuttons in the Cocoa-based Tk 8.6b2 and later preserve compatibility with
+the older Carbon-based implementation, you can turn off the compatibility
+metrics to get more native-looking spacing by setting:
+ set tk::mac::useCompatibilityMetrics 0
+
+- TkAqua provides access to native OS X images via the Tk native bitmap facility
+(including any image file readable by NSImage). A native bitmap name is
+interpreted as follows (in order):
+ - predefined builtin 32x32 icon name (stop, caution, document, etc)
+ - name defined by [tk::mac::iconBitmap]
+ - NSImage named image name
+ - NSImage url string
+ - 4-char OSType of IconServices icon
+the syntax of [tk::mac::iconBitmap] is as follows:
+ tk::mac::iconBitmap name width height -kind value
+where -kind is one of
+ -file icon of file at given path
+ -fileType icon of given file type
+ -osType icon of given 4-char OSType file type
+ -systemType icon for given IconServices 4-char OSType
+ -namedImage named NSImage for given name
+ -imageFile image at given path
+This support was added with the Cocoa-based Tk 8.6b2.
+
+- TkAqua cursor names are interpred as follows (in order):
+ - standard or platform-specific Tk cursor name (c.f. cursors.n)
+ - @path to any image file readable by NSImage
+ - NSImage named image name
+Support for the latter two was added with the Cocoa-based Tk 8.6b2.
+
+- The standard Tk dialog commands [tk_getOpenFile], [tk_chooseDirectory],
+[tk_getSaveFile] and [tk_messageBox] all take an additional optional -command
+parameter on TkAqua. If it is present, the given command prefix is evaluated at
+the global level when the dialog closes, with the dialog command's result
+appended (the dialog command itself returning an emtpy result). If the -parent
+option is also present, the dialog is configured as a modeless (window-modal)
+sheet attached to the parent window and the dialog command returns immediately.
+Support for -command was added with the Cocoa-based Tk 8.6b2.
+
+- The TkAqua-specific [tk::mac::standardAboutPanel] command brings the standard
+Cocoa about panel to the front, with all its information filled in from your
+application bundle files (i.e. standard about panel with no options specified).
+See Apple Technote TN2179 and the AppKit documentation for -[NSApplication
+orderFrontStandardAboutPanelWithOptions:] for details on the Info.plist keys and
+app bundle files used by the about panel.
+This support was added with the Cocoa-based Tk 8.6b2.
+
+- TkAqua has three special menu names that give access to the standard
+Application, Window and Help menus, see menu.n for details.
+By default, the platform-specific standard Help menu item "YourApp Help" peforms
+the default Cocoa action of showing the Help Book configured in the
+application's Info.plist (or displaying an alert if no Help Book is set). This
+action can be customized by defining a procedure named [tk::mac::ShowHelp], if
+present, this procedure is invoked instead by the standard Help menu item.
+Support for the Window menu and [tk::mac::ShowHelp] was added with the
+Cocoa-based Tk 8.6b2.
+
+- The TkAqua-specific command [tk::unsupported::MacWindowStyle style] is used to
+get and set Mac OS X-specific toplevel window class and attributes. Note that
+the window class and many attributes have to be set before the window is first
+mapped for the change to have any effect.
+The command has the following syntax:
+ tk::unsupported::MacWindowStyle style window ?class? ?attributes?
+The 2 argument form returns a list of the current class and attributes for the
+given window. The 3 argument form sets the class for the given window using the
+default attributes for that class. The 4 argument form sets the class and the
+list of attributes for the given window.
+Window class names:
+ document, modal, floating, utility, toolbar, simple, help, overlay
+Window attribute names:
+ standardDocument, standardFloating, resizable, fullZoom, horizontalZoom,
+ verticalZoom, closeBox, collapseBox, toolbarButton, sideTitlebar,
+ noTitleBar, unifiedTitleAndToolbar, metal, hud, noShadow, doesNotCycle,
+ noActivates, hideOnSuspend, inWindowMenu, ignoreClicks, doesNotHide,
+ canJoinAllSpaces, moveToActiveSpace, nonActivating, black, dark, light,
+ gray, red, green, blue, cyan, yellow, magenta, orange, purple,
+ brown, clear, opacity
+
+Note that not all attributes are valid for all window classes.
+Support for the 3 argument form was added with the Cocoa-based Tk 8.6b2, at the
+same time support for some legacy Carbon-specific classes and attributes was
+removed (they are still accepted by the command but no longer have any effect).
+
+The color window attributes (black, dark, red, etc.) and the "opacity" allow one to set the background and opacity of a textured ("metal") window. This allows a Tk window to implement a window without the dividing line between the titlebar and the rest of the window, or the "unified toolbar" effect, which is increasingly standard in Mac applications. An example:
+
+toplevel .f
+tk::unsupported::MacWindowStyle style .f document {metal light opaque closeBox collapseBox resizable standardDocument }
+
+pack [label .f.f -bg #ababab -text "This is a textured window\nwith opacity and a gray background\nsimilar to other Mac applications"] -fill both -expand yes
+
+The color attributes correspond to system-defined NSColor constants (e.g., red is [NSColor redColor]. The "light" and "dark" attributes correspond to lightGrayColor and darkGrayColor, respectively (because of the way the attributes are parsed, using "lightgray" and "darkgray" would cause a conflict with the core "gray" attribute).
+
+Below are the corresponding hex and/or Tk-defined colors that can be used from Tk widgets to match the NSColor-based attributes:
+
+black #000000
+dark #545454
+light #ababab
+white #ffffff
+gray #7f7f7f
+red #ff0000
+green #00ff00
+blue #0000ff
+cyan #00ffff
+yellow #ffff00
+magenta #ff00ff
+orange #ff8000
+purple #800080
+brown #996633
+clear systemTransparent
+
+- The Cocoa-based TkAqua can be distinguished from the older Carbon-based
+version via the [winfo server .] command, example output on Mac OS X 10.5.7:
+ Cocoa-based: CG409.3 Apple AppKit GC 949.46 Mac OS X 1057
+ Carbon-based: QD10R30 Apple 1057
+
+- If you want to use Remote Debugging with Xcode, you need to set the
environment variable XCNOSTDIN to 1 in the Executable editor for Wish. That will
cause us to force closing stdin & stdout. Otherwise, given how Xcode launches
Wish remotely, they will be left open and then Wish & gdb will fight for stdin.
@@ -138,13 +229,13 @@ Wish remotely, they will be left open and then Wish & gdb will fight for stdin.
3. Building Tcl/Tk on Mac OS X
------------------------------
-- At least Mac OS X 10.1 is required to build Tcl and TkX11 and OS X 10.2 is
-required to build TkAqua. Apple's Developer Tools need to be installed (only the
-most recent version matching your OS release is supported). The Developer Tools
-installer is available on Mac OS X retail disks or is present in
-/Applications/Installers on Macs that came with OS X preinstalled. The most
-recent version can be downloaded from the ADC website http://connect.apple.com
-(after you register for free ADC membership).
+- At least Mac OS X 10.3 is required to build Tcl and TkX11, and Mac OS X 10.5
+is required to build TkAqua.
+Apple's Xcode Developer Tools need to be installed (only the most recent version
+matching your OS release is supported), the Xcode installer is available on Mac
+OS X install media or may be present in /Applications/Installers on Macs that
+came with OS X preinstalled. The most recent version can always be downloaded
+from the ADC website http://connect.apple.com (free ADC membership required).
- Tcl/Tk are most easily built as Mac OS X frameworks via GNUmakefile in
tcl/macosx and tk/macosx (see below for details), but can also be built with the
@@ -156,94 +247,66 @@ The Mac OS X specific configure flags are --enable-aqua, --enable-framework and
select based notifier). Note that --enable-aqua is incompatible with
--disable-corefoundation (for both Tcl and Tk configure).
-- It is also possible to build with Apple's IDE via the projects in tk/macosx,
-take care to only use the project matching your DevTools and OS version:
- * Wish.pbproj for Xcode or ProjectBuilder on 10.3 and earlier, this has a
- 'Tk' target that simply calls through to the tcl/macosx/GNUMakefile. It
- requires a build of the 'Tcl' target of tcl/macosx/Tcl.pbproj.
- * Wish.xcode Xcode 2.4 on 10.4 and Xcode 2.5 on 10.4 and later, which
- additionally has native 'tktest' and 'tktest-X11' targets for
- debugging, these targets' 'Debug' build configuration has ZeroLink and
- Fix&Continue enabled, use the 'DebugNoFixZL' build configuration if you
- need a debug build without these features. The following build
- configurations are available:
- 'DebugUnthreaded': debug build with threading turned off.
- 'DebugNoCF': debug build with corefoundation turned off
- (for 'tktest-X11' only).
- 'DebugNoCFUnthreaded': debug build with corefoundation turned off
- (for 'tktest-X11' only) and with threading turned off.
- 'DebugMemCompile': debug build with memory and bytecode debugging on.
- 'DebugLeaks': debug build with PURIFY defined.
- 'DebugGCov': debug build with generation of gcov data files enabled.
- 'ReleaseUniversal': builds the targets as universal binaries for the
- ppc and i386 architectures.
- 'ReleaseUniversal10.4uSDK': same as 'ReleaseUniversal' but builds
- against the 10.4u SDK, required to build universal binaries on
- PowerPC Tiger (where the system libraries are not universal).
- 'ReleasePPC10.3.9SDK': builds for PowerPC against the 10.3.9 SDK, useful
- for verifying on Tiger that building on Panther would succeed.
- 'ReleasePPC10.2.8SDK': builds for PowerPC with gcc-3.3 against the
- 10.2.8 SDK, useful to verify on Tiger that building on Jaguar
- would succeed.
- * Wish.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following
- additional build configurations:
- 'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds
- against the 10.5 SDK on Leopard (with 10.5 deployment target).
- 'Debug gcc42': same as 'Debug' but builds with gcc 4.2.
- 'Debug llvmgcc42': same as 'Debug' but builds with llvm-gcc 4.2.
- 'ReleaseUniversal gcc42': same as 'ReleaseUniversal' but builds with
- gcc 4.2.
- 'ReleaseUniversal llvmgcc42': same as 'ReleaseUniversal' but builds
- with llvm-gcc 4.2.
- 'Debug64bit': builds the 'tktest-X11' target as 64bit with debugging
- enabled (requires a 64bit capable processor).
- Note that all non-SDK configurations have 10.5 deployment target and
- that all Universal configurations build the 'tktest-X11' target
- also for the ppc64 and x86_64 architectures.
-
-Notes about the native targets of the Xcode projects:
- * the Xcode projects refer to the toplevel tcl and tk source dirs through
- the TCL_SRCROOT and TK_SRCROOT user build settings, by default these are
- set to the project-relative paths '../../tcl' and '../../tk', if your
- source directories are named differently, e.g. '../../tcl8.5', you'll
- need to manually change the TCL_SRCROOT and TK_SRCROOT settings by
- editing your ${USER}.pbxuser file (located inside the Wish.xcodeproj
- bundle directory) with a text editor.
- * the native targets need a version of the unix configure scripts with config
- headers enabled, this is automatically generated as tcl/macosx/configure
- and tk/macosx/configure by the project but that requires 2.59 versions
- of autoconf & autoheader. These are not available on Mac OS X 10.5 by
- default and need to be installed manually. By default they are assumed
- to be installed as /usr/local/bin/autoconf-2.59 and
- /usr/local/bin/autoheader-2.59, set the AUTOCONF and AUTOHEADER build
- settings in ${USER}.pbxuser to their true locations if necessary.
-
-- To build universal binaries outside of Wish.xcodeproj, set CFLAGS as follows:
- export CFLAGS="-arch ppc -arch i386 \
- -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
-This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on any
-of the architectures (the -isysroot flag is only required on PowerPC Tiger).
+- It is also possible to build with the Xcode IDE via the projects in
+tk/macosx, take care to use the project matching your DevTools and OS version:
+ Tk.xcode: for Xcode 3.1 on 10.5
+ Tk.xcodeproj: for Xcode 3.2 on 10.6
+These have the following targets:
+ Tk: calls through to tk/macosx/GNUMakefile,
+ requires a corresponding build of the Tcl
+ target of tcl/macosx/Tcl.xcode.
+ tktest: static build of TkAqua tktest for debugging.
+ tktest-X11: static build of TkX11 tktest for debugging.
+The following build configurations are available:
+ Debug: debug build for the active architecture,
+ with Fix & Continue enabled.
+ Debug clang: use clang compiler.
+ Debug llvm-gcc: use llvm-gcc compiler.
+ Debug gcc40: use gcc 4.0 compiler.
+ DebugNoGC: disable Objective-C garbage collection.
+ DebugNoFixAndContinue: disable Fix & Continue.
+ DebugUnthreaded: disable threading.
+ DebugNoCF: disable corefoundation (X11 only).
+ DebugNoCFUnthreaded: disable corefoundation an threading.
+ DebugMemCompile: enable memory and bytecode debugging.
+ DebugLeaks: define PURIFY.
+ DebugGCov: enable generation of gcov data files.
+ Debug64bit: configure with --enable-64bit (requires
+ building on a 64bit capable processor).
+ Release: release build for the active architecture.
+ ReleaseUniversal: 32/64-bit universal build.
+ ReleaseUniversal clang: use clang compiler.
+ ReleaseUniversal llvm-gcc: use llvm-gcc compiler.
+ ReleaseUniversal gcc40: use gcc 4.0 compiler.
+ ReleaseUniversal10.5SDK: build against the 10.5 SDK (with 10.5
+ deployment target).
+ Note that the non-SDK configurations have their deployment target set to
+ 10.5 (Tk.xcode) resp. 10.6 (Tk.xcodeproj).
+The Xcode projects refer to the toplevel tcl and tk source directories via the
+the TCL_SRCROOT and TK_SRCROOT user build settings, by default these are set to
+the project-relative paths '../../tcl' and '../../tk', if your source
+directories are named differently, e.g. '../../tcl8.6' and '../../tk8.6', you
+need to manually change the TCL_SRCROOT and TK_SRCROOT settings by editing your
+${USER}.pbxuser file (located inside the Tk.xcodeproj bundle directory) with a
+text editor.
+
+- To build universal binaries outside of the Xcode IDE, set CFLAGS as follows:
+ export CFLAGS="-arch i386 -arch x86_64 -arch ppc"
+This requires Mac OS X 10.4 and Xcode 2.4 (or Xcode 2.2 if -arch x86_64 is
+omitted, but _not_ Xcode 2.1) and will work on any architecture (on PowerPC
+Tiger you need to add "-isysroot /Developer/SDKs/MacOSX10.4u.sdk").
Note that configure requires CFLAGS to contain a least one architecture that can
-be run on the build machine (i.e. ppc on PowerPC, ppc or i386 on Intel).
-Universal builds of Tk TEA extensions are also possible with CFLAGS set as
-above, they will be [load]able by universal as well as thin binaries of Tk.
-Note that while Tcl can be built for 64-bit architectures, neither TkAqua nor
-TkX11 can be built for 64-bit as the corresponding GUI libraries are not
-available for 64bit at present. However, linking a universal 'ppc i386' Tk
-binary against a universal 'ppc ppc64 i386 x86_64' Tcl binary works just fine.
-The Tk configure script automatically removes the 64-bit -arch flags from CFLAGS
-to facilitate universal building of both Tcl and Tk with the same CFLAGS; the
-same happens with configure in Tk extensions based on TEA 3.5 or later.
+be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386
+on Core and ppc, i386 or x86_64 on Core2/Xeon).
+Universal builds of Tcl TEA extensions are also possible with CFLAGS set as
+above, they will be [load]able by universal as well as thin binaries of Tcl.
- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
-to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g:
- export MACOSX_DEPLOYMENT_TARGET=10.2
-This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set
-CFLAGS instead:
- export CFLAGS="-mmacosx-version-min=10.2"
-The Wish.xcode project is setup to produce binaries that can run on 10.2 or
-later (except for the Universal and SDK configurations).
-Support for weak-linking was added to the code for 8.4.14/8.5a5.
+to the minimal OS version the binaries should be able to run on, e.g:
+ export MACOSX_DEPLOYMENT_TARGET=10.4
+This requires at least gcc 3.1; with gcc 4 or later, set/add to CFLAGS instead:
+ export CFLAGS="-mmacosx-version-min=10.4"
+Support for weak-linking was added with 8.4.14/8.5a5.
Detailed Instructions for building with macosx/GNUmakefile
----------------------------------------------------------
@@ -257,26 +320,25 @@ trees in a common parent directory.
[ or you can pass an argument of BUILD_DIR=/somewhere to the tcl and tk make. ]
- The following instructions assume the Tcl and Tk source trees are named
-"tcl${ver}" and "tk${ver}", respectively, where ${ver} is a shell variable
-containing the Tcl and Tk version number (for example '8.4.12').
-Setup the shell variable as follows:
- set ver="8.4.12" ;: if your shell is csh
- ver="8.4.12" ;: if your shell is sh
-The source trees will be named this way only if you are building from a release
-archive, if you are building from CVS, the version numbers will be missing; so
-set ${ver} to the empty string instead:
- set ver="" ;: if your shell is csh
- ver="" ;: if your shell is sh
-
-- The following steps will build Tcl and Tk from the Terminal, assuming you are
-located in the directory containing the tcl and tk source trees:
+"tcl${ver}" and "tk${ver}" (where ${ver} is a shell variable containing the
+Tcl/Tk version number, e.g. '8.6').
+Setup this shell variable as follows:
+ ver="8.6"
+If you are building from CVS, omit this step (CVS source tree names usually do
+not contain a version number).
+
+- Setup environment variables as desired, e.g. for a universal build on 10.5:
+ CFLAGS="-arch i386 -arch x86_64 -arch ppc -mmacosx-version-min=10.5"
+ export CFLAGS
+
+- Change to the directory containing the Tcl and Tk source trees and build:
make -C tcl${ver}/macosx
make -C tk${ver}/macosx
-and the following will then install Tcl and Tk onto the root volume (admin
-password required):
+
+- Install Tcl and Tk onto the root volume (admin password required):
sudo make -C tcl${ver}/macosx install
sudo make -C tk${ver}/macosx install
-if you don't have the admin password, you can install into your home directory,
+if you don't have an admin password, you can install into your home directory
instead by passing an INSTALL_ROOT argument to make:
make -C tcl${ver}/macosx install INSTALL_ROOT="${HOME}/"
make -C tk${ver}/macosx install INSTALL_ROOT="${HOME}/"
@@ -289,27 +351,27 @@ This allows switching to the debug libraries at runtime by setting
(c.f. man dyld for more details)
If you only want to build and install the debug or optimized build, use the
-'develop' or 'deploy' target variants of the GNUmakefiles, respectively.
+'develop' or 'deploy' target variants of the GNUmakefile, respectively.
For example, to build and install only the optimized versions:
make -C tcl${ver}/macosx deploy
make -C tk${ver}/macosx deploy
sudo make -C tcl${ver}/macosx install-deploy
sudo make -C tk${ver}/macosx install-deploy
-- The GNUmakefiles can also build a version of 'Wish' that has the Tcl and Tk
+- The GNUmakefile can also build a version of Wish.app that has the Tcl and Tk
frameworks embedded in its application package. This allows for standalone
deployment of the application with no installation required, e.g. from read-only
-media. To build & install in this manner, use the 'embedded' target variants of
-the GNUmakefiles. For example, to build a standalone 'Wish.app'
-in ./embedded/Applications/Utilities:
+media. To build & install in this manner, use the 'embedded' variants of
+the GNUmakefile targets.
+For example, to build a standalone 'Wish.app' in ./emb/Applications/Utilities:
make -C tcl${ver}/macosx embedded
make -C tk${ver}/macosx embedded
- sudo make -C tcl${ver}/macosx install-embedded INSTALL_ROOT=`pwd`/embedded/
- sudo make -C tk${ver}/macosx install-embedded INSTALL_ROOT=`pwd`/embedded/
+ sudo make -C tcl${ver}/macosx install-embedded INSTALL_ROOT=`pwd`/emb/
+ sudo make -C tk${ver}/macosx install-embedded INSTALL_ROOT=`pwd`/emb/
Notes:
* if you've already built standard TclTkAqua, building embedded does not
require any new compiling or linking, so you can skip the first two makes.
- (making relinking unnecessary was added in 8.4.2)
+ (making relinking unnecessary was added with 8.4.2)
* the embedded frameworks include only optimized builds and no documentation.
* the standalone Wish has the directory Wish.app/Contents/lib in its
auto_path. Thus you can place tcl extensions in this directory (i.e. embed
@@ -325,4 +387,4 @@ make overrides to the tk/macosx GNUmakefile, e.g.
TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin
sudo make -C tk${ver}/macosx install \
TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin
-The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added in Tk 8.4.3.
+The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3.
diff --git a/macosx/Tk-Common.xcconfig b/macosx/Tk-Common.xcconfig
new file mode 100644
index 0000000..0d6e474
--- /dev/null
+++ b/macosx/Tk-Common.xcconfig
@@ -0,0 +1,46 @@
+//
+// Tk-Common.xcconfig --
+//
+// This file contains the Xcode build settings comon to all
+// project configurations in Wish.xcodeproj.
+//
+// Copyright (c) 2007-2009 Daniel A. Steffen <das@users.sourceforge.net>
+// Copyright 2008-2009, Apple Inc.
+//
+// See the file "license.terms" for information on usage and redistribution
+// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+HEADER_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TK_SRCROOT)/xlib "$(DERIVED_FILE_DIR)/tcl" "$(DERIVED_FILE_DIR)/tk" $(HEADER_SEARCH_PATHS)
+REZ_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TCL_SRCROOT)/generic $(REZ_SEARCH_PATHS)
+OTHER_LDFLAGS = -headerpad_max_install_names -sectcreate __TEXT __info_plist "$(DERIVED_FILE_DIR)/tk/Wish-Info.plist" $(OTHER_LDFLAGS)
+OTHER_LDFLAGS_AQUA =
+INSTALL_PATH = $(APPLICATION_INSTALL_PATH)
+INSTALL_MODE_FLAG = go-w,a+rX
+GCC_PREFIX_HEADER = $(DERIVED_FILE_DIR)/tk/tkConfig.h
+OTHER_CFLAGS = -imacros "$(DERIVED_FILE_DIR)/tcl/tclConfig.h" $(OTHER_CFLAGS)
+GCC_GENERATE_DEBUGGING_SYMBOLS = YES
+GCC_NO_COMMON_BLOCKS = YES
+GCC_DYNAMIC_NO_PIC = YES
+GCC_VERSION = 4.2
+GCC = gcc-$(GCC_VERSION)
+WARNING_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-value -Winit-self -Wpointer-arith -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS)
+REZ_RESOURCE_MAP_READ_ONLY = YES
+APPLICATION_INSTALL_PATH = /Applications/Utilities
+BINDIR = $(PREFIX)/bin
+CFLAGS = $(CFLAGS)
+CPPFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) $(CPPFLAGS)
+FRAMEWORK_INSTALL_PATH = /Library/Frameworks
+INCLUDEDIR = $(PREFIX)/include
+LIBDIR = $(PREFIX)/lib
+MANDIR = $(PREFIX)/man
+PER_ARCH_CFLAGS_ppc = -mcpu=G3 -mtune=G4 $(PER_ARCH_CFLAGS_ppc)
+PREFIX = /usr/local
+TCL_BUILD_DIR = $(OBJROOT)/../tcl/Tcl.build/$(CONFIGURATION)/Tcl.build/Objects
+TCL_CONFIGURE_ARGS = --enable-threads --enable-dtrace
+TCL_FRAMEWORK_DIR = $(SYMROOT)/../tcl/$(CONFIGURATION)
+TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION)
+TCL_PACKAGE_PATH = "$(LIBDIR)"
+TCL_DEFS = HAVE_TCL_CONFIG_H
+TK_LIBRARY = $(LIBDIR)/tk$(VERSION)
+TK_DEFS = HAVE_TK_CONFIG_H TCL_NO_DEPRECATED
+VERSION = 8.6
diff --git a/macosx/Tk-Debug.xcconfig b/macosx/Tk-Debug.xcconfig
new file mode 100644
index 0000000..2382661
--- /dev/null
+++ b/macosx/Tk-Debug.xcconfig
@@ -0,0 +1,19 @@
+//
+// Tk-Debug.xcconfig --
+//
+// This file contains the Xcode build settings for all Debug
+// project configurations in Wish.xcodeproj.
+//
+// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+//
+// See the file "license.terms" for information on usage and redistribution
+// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+#include "Tk-Common.xcconfig"
+
+DEBUG_INFORMATION_FORMAT = dwarf
+DEPLOYMENT_POSTPROCESSING = NO
+GCC_OPTIMIZATION_LEVEL = 0
+GCC_PREPROCESSOR_DEFINITIONS = DEBUGLEVEL=4 $(TCL_DEFS) $(TK_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
+CONFIGURE_ARGS = --enable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
+MAKE_TARGET = develop
diff --git a/macosx/Tk-Info.plist.in b/macosx/Tk-Info.plist.in
index 1705a98..50b9d24 100644
--- a/macosx/Tk-Info.plist.in
+++ b/macosx/Tk-Info.plist.in
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
- Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ Copyright 2008-2009, Apple Inc.
See the file "license.terms" for information on usage and redistribution of
this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,7 +17,7 @@
<string>Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@@TK_PATCH_LEVEL@,
Copyright © 1989-@TK_YEAR@ Tcl Core Team,
Copyright © 2002-@TK_YEAR@ Daniel A. Steffen,
-Copyright © 2001-2002 Apple Inc.,
+Copyright © 2001-2009 Apple Inc.,
Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
<key>CFBundleIdentifier</key>
<string>com.tcltk.tklibrary</string>
diff --git a/macosx/Tk-Release.xcconfig b/macosx/Tk-Release.xcconfig
new file mode 100644
index 0000000..505373c
--- /dev/null
+++ b/macosx/Tk-Release.xcconfig
@@ -0,0 +1,19 @@
+//
+// Tk-Release.xcconfig --
+//
+// This file contains the Xcode build settings for all Release
+// project configurations in Wish.xcodeproj.
+//
+// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
+//
+// See the file "license.terms" for information on usage and redistribution
+// of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+#include "Tk-Common.xcconfig"
+
+DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
+// DEPLOYMENT_POSTPROCESSING = YES
+GCC_OPTIMIZATION_LEVEL = s
+GCC_PREPROCESSOR_DEFINITIONS = NDEBUG $(TCL_DEFS) $(TK_DEFS) $(GCC_PREPROCESSOR_DEFINITIONS)
+CONFIGURE_ARGS = --disable-symbols $(TCL_CONFIGURE_ARGS) $(CONFIGURE_ARGS)
+MAKE_TARGET = deploy
diff --git a/macosx/Tk.icns b/macosx/Tk.icns
new file mode 100644
index 0000000..394b588
--- /dev/null
+++ b/macosx/Tk.icns
Binary files differ
diff --git a/macosx/Tk.tiff b/macosx/Tk.tiff
new file mode 100644
index 0000000..1e2aed5
--- /dev/null
+++ b/macosx/Tk.tiff
Binary files differ
diff --git a/macosx/Tk.xcode/default.pbxuser b/macosx/Tk.xcode/default.pbxuser
new file mode 100644
index 0000000..c8456e8
--- /dev/null
+++ b/macosx/Tk.xcode/default.pbxuser
@@ -0,0 +1,384 @@
+// !$*UTF8*$!
+{
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ activeBuildConfigurationName = Debug;
+ activeExecutable = F9E61D1C090A4282002B3151 /* Wish */;
+ activeTarget = F9E61D16090A3E94002B3151 /* Tk */;
+ codeSenseManager = F944EB9D08F798180049FDD4 /* Code sense */;
+ executables = (
+ F9E61D1C090A4282002B3151 /* Wish */,
+ F944EB8F08F798100049FDD4 /* tktest */,
+ F9FD31F50CC1AD070073837D /* tktest-X11 */,
+ );
+ perUserDictionary = {
+ com.apple.ide.smrt.PBXUserSmartGroupsKey.Rev10 = <040b73747265616d747970656481e8038401408484840e4e534d757461626c654172726179008484074e534172726179008484084e534f626a65637400858401690192848484134e534d757461626c6544696374696f6e6172790084840c4e5344696374696f6e6172790095960792848484084e53537472696e67019584012b046e616d658692849a9a14496d706c656d656e746174696f6e2046696c65738692849a9a146162736f6c75746550617468546f42756e646c658692849a9a008692849a9a195042585472616e7369656e744c6f636174696f6e4174546f708692849a9a06626f74746f6d8692849a9a03636c7a8692849a9a1550425846696c656e616d65536d61727447726f75708692849a9a0b6465736372697074696f6e8692849a9a103c6e6f206465736372697074696f6e3e8692849a9a0b707265666572656e63657386928497960892849a9a07666e6d617463688692849a9a008692849a9a05696d6167658692849a9a0b536d617274466f6c6465728692849a9a04726f6f748692849a9a093c50524f4a4543543e8692849a9a0572656765788692849a9a065c2e286329248692849a9a097265637572736976658692848484084e534e756d626572008484074e5356616c7565009584012a849696018692849a9a0669734c656166869284b09db296008692849a9a0763616e536176658692af92849a9a1250425850726f6a65637453636f70654b65798692849a9a03594553868692849a9a08676c6f62616c49448692849a9a18314343304541343030343335304546393030343434313042868686>;
+ };
+ sourceControlManager = F944EB9C08F798180049FDD4 /* Source Control */;
+ userBuildSettings = {
+ SYMROOT = "${SRCROOT}/../../build/tk";
+ TCL_SRCROOT = "${SRCROOT}/../../tcl";
+ TK_SRCROOT = "${SRCROOT}/../../tk";
+ };
+ };
+ 8DD76FA90486AB0100D96B5E /* tktest */ = {
+ activeExec = 0;
+ executables = (
+ F944EB8F08F798100049FDD4 /* tktest */,
+ );
+ };
+ F944EB8F08F798100049FDD4 /* tktest */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ "${TK_SRCROOT}/tests/all.tcl",
+ "${TK_SRCROOT}/tests/ttk/all.tcl",
+ "-geometry +0+0",
+ "-singleproc 1",
+ "-verbose \"bet\"",
+ "-skip window-2.9",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = YES;
+ name = TCL_LIBRARY;
+ value = "${TCL_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TK_LIBRARY;
+ value = "${TK_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TCLLIBPATH;
+ value = /Library/Tcl;
+ },
+ {
+ active = YES;
+ name = TK_SRCROOT;
+ value = "${TK_SRCROOT}";
+ },
+ {
+ active = NO;
+ name = TK_CONSOLE;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ {
+ active = NO;
+ name = NSTraceEvents;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = MallocBadFreeAbort;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocLogFile;
+ value = /tmp/malloc.log;
+ },
+ {
+ active = NO;
+ name = MallocStackLogging;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocStackLoggingNoCompact;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocPreScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = NSZombieEnabled;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSDeallocateZombies;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSAutoreleaseFreedObjectCheckEnabled;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSEnableAutoreleasePool;
+ value = NO;
+ },
+ {
+ active = NO;
+ name = AUTO_LOG_ALL;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = AUTO_LOG_NOISY;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = AUTO_REFERENCE_COUNT_LOGGING;
+ value = YES;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = tktest;
+ sourceDirectories = (
+ );
+ };
+ F944EB9C08F798180049FDD4 /* Source Control */ = {
+ isa = PBXSourceControlManager;
+ fallbackIsa = XCSourceControlManager;
+ isSCMEnabled = 0;
+ scmConfiguration = {
+ CVSToolPath = /usr/bin/cvs;
+ CVSUseSSH = NO;
+ SubversionToolPath = /usr/bin/svn;
+ repositoryNamesForRoots = {
+ .. = "";
+ };
+ };
+ scmType = scm.cvs;
+ };
+ F944EB9D08F798180049FDD4 /* Code sense */ = {
+ isa = PBXCodeSenseManager;
+ indexTemplatePath = "";
+ };
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
+ activeExec = 0;
+ executables = (
+ F9FD31F50CC1AD070073837D /* tktest-X11 */,
+ );
+ };
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ activeExec = 0;
+ executables = (
+ F9E61D1C090A4282002B3151 /* Wish */,
+ );
+ };
+ F9E61D1C090A4282002B3151 /* Wish */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = Wish;
+ sourceDirectories = (
+ );
+ };
+ F9FD31F50CC1AD070073837D /* tktest-X11 */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ "${TK_SRCROOT}/tests/all.tcl",
+ "${TK_SRCROOT}/tests/ttk/all.tcl",
+ "-geometry +0+0",
+ "-singleproc 1",
+ "-verbose \"bet\"",
+ "-skip window-2.9",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = YES;
+ name = TCL_LIBRARY;
+ value = "${TCL_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TK_LIBRARY;
+ value = "${TK_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TCLLIBPATH;
+ value = /Library/Tcl;
+ },
+ {
+ active = YES;
+ name = DISPLAY;
+ value = ":0";
+ },
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ {
+ active = NO;
+ name = MallocBadFreeAbort;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocLogFile;
+ value = /tmp/malloc.log;
+ },
+ {
+ active = NO;
+ name = MallocStackLogging;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocStackLoggingNoCompact;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocPreScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocScribble;
+ value = 1;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = "tktest-X11";
+ sourceDirectories = (
+ );
+ };
+}
diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj
new file mode 100644
index 0000000..70c2472
--- /dev/null
+++ b/macosx/Tk.xcode/project.pbxproj
@@ -0,0 +1,5785 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+ F94523A20E6FC2AC00C1D987 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F94523A10E6FC2AC00C1D987 /* Cocoa.framework */; };
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
+ F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
+ F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
+ F966BDD308F27A3F005CB29B /* tkBind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB008F27A39005CB29B /* tkBind.c */; };
+ F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB108F27A39005CB29B /* tkBitmap.c */; };
+ F966BDD508F27A3F005CB29B /* tkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB208F27A39005CB29B /* tkButton.c */; };
+ F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB408F27A39005CB29B /* tkCanvArc.c */; };
+ F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB508F27A39005CB29B /* tkCanvas.c */; };
+ F966BDDA08F27A3F005CB29B /* tkCanvBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB708F27A39005CB29B /* tkCanvBmap.c */; };
+ F966BDDB08F27A3F005CB29B /* tkCanvImg.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB808F27A39005CB29B /* tkCanvImg.c */; };
+ F966BDDC08F27A3F005CB29B /* tkCanvLine.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB908F27A39005CB29B /* tkCanvLine.c */; };
+ F966BDDD08F27A3F005CB29B /* tkCanvPoly.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABA08F27A39005CB29B /* tkCanvPoly.c */; };
+ F966BDDE08F27A3F005CB29B /* tkCanvPs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABB08F27A39005CB29B /* tkCanvPs.c */; };
+ F966BDE008F27A3F005CB29B /* tkCanvText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABD08F27A39005CB29B /* tkCanvText.c */; };
+ F966BDE108F27A3F005CB29B /* tkCanvUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABE08F27A39005CB29B /* tkCanvUtil.c */; };
+ F966BDE208F27A3F005CB29B /* tkCanvWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABF08F27A39005CB29B /* tkCanvWind.c */; };
+ F966BDE308F27A3F005CB29B /* tkClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC008F27A39005CB29B /* tkClipboard.c */; };
+ F966BDE408F27A3F005CB29B /* tkCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC108F27A39005CB29B /* tkCmds.c */; };
+ F966BDE508F27A3F005CB29B /* tkColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC208F27A39005CB29B /* tkColor.c */; };
+ F966BDE708F27A3F005CB29B /* tkConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC408F27A39005CB29B /* tkConfig.c */; };
+ F966BDE808F27A3F005CB29B /* tkConsole.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC508F27A39005CB29B /* tkConsole.c */; };
+ F966BDE908F27A3F005CB29B /* tkCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC608F27A39005CB29B /* tkCursor.c */; };
+ F966BDEB08F27A3F005CB29B /* tkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC808F27A39005CB29B /* tkEntry.c */; };
+ F966BDED08F27A3F005CB29B /* tkError.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACA08F27A39005CB29B /* tkError.c */; };
+ F966BDEE08F27A3F005CB29B /* tkEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACB08F27A39005CB29B /* tkEvent.c */; };
+ F966BDEF08F27A3F005CB29B /* tkFileFilter.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACC08F27A39005CB29B /* tkFileFilter.c */; };
+ F966BDF108F27A3F005CB29B /* tkFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACE08F27A39005CB29B /* tkFocus.c */; };
+ F966BDF208F27A3F005CB29B /* tkFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACF08F27A39005CB29B /* tkFont.c */; };
+ F966BDF408F27A3F005CB29B /* tkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD108F27A39005CB29B /* tkFrame.c */; };
+ F966BDF508F27A3F005CB29B /* tkGC.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD208F27A39005CB29B /* tkGC.c */; };
+ F966BDF608F27A3F005CB29B /* tkGeometry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD308F27A39005CB29B /* tkGeometry.c */; };
+ F966BDF708F27A3F005CB29B /* tkGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD408F27A39005CB29B /* tkGet.c */; };
+ F966BDF808F27A3F005CB29B /* tkGrab.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD508F27A39005CB29B /* tkGrab.c */; };
+ F966BDF908F27A3F005CB29B /* tkGrid.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD608F27A39005CB29B /* tkGrid.c */; };
+ F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD708F27A39005CB29B /* tkImage.c */; };
+ F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD808F27A39005CB29B /* tkImgBmap.c */; };
+ F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD908F27A39005CB29B /* tkImgGIF.c */; };
+ F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADA08F27A39005CB29B /* tkImgPhoto.c */; };
+ F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADB08F27A39005CB29B /* tkImgPPM.c */; };
+ F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE408F27A39005CB29B /* tkListbox.c */; };
+ F966BE0808F27A3F005CB29B /* tkMacWinMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE508F27A39005CB29B /* tkMacWinMenu.c */; };
+ F966BE0908F27A3F005CB29B /* tkMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE608F27A39005CB29B /* tkMain.c */; };
+ F966BE0A08F27A3F005CB29B /* tkMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE708F27A39005CB29B /* tkMenu.c */; };
+ F966BE0C08F27A3F005CB29B /* tkMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE908F27A39005CB29B /* tkMenubutton.c */; };
+ F966BE0E08F27A3F005CB29B /* tkMenuDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEB08F27A39005CB29B /* tkMenuDraw.c */; };
+ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; };
+ F966BE1008F27A3F005CB29B /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; };
+ F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; };
+ F966BE1208F27A3F005CB29B /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; };
+ F966BE1308F27A3F005CB29B /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; };
+ F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; };
+ F966BE1508F27A3F005CB29B /* tkPlace.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF208F27A39005CB29B /* tkPlace.c */; };
+ F966BE1708F27A3F005CB29B /* tkPointer.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF408F27A39005CB29B /* tkPointer.c */; };
+ F966BE1908F27A3F005CB29B /* tkRectOval.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF608F27A39005CB29B /* tkRectOval.c */; };
+ F966BE1A08F27A3F005CB29B /* tkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF708F27A39005CB29B /* tkScale.c */; };
+ F966BE1C08F27A40005CB29B /* tkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF908F27A39005CB29B /* tkScrollbar.c */; };
+ F966BE1E08F27A40005CB29B /* tkSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFB08F27A39005CB29B /* tkSelect.c */; };
+ F966BE2008F27A40005CB29B /* tkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFD08F27A39005CB29B /* tkSquare.c */; };
+ F966BE2208F27A40005CB29B /* tkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFF08F27A39005CB29B /* tkStubInit.c */; };
+ F966BE2308F27A40005CB29B /* tkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0008F27A39005CB29B /* tkStubLib.c */; };
+ F966BE2408F27A40005CB29B /* tkStyle.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0108F27A39005CB29B /* tkStyle.c */; };
+ F966BE2508F27A40005CB29B /* tkTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0208F27A39005CB29B /* tkTest.c */; };
+ F966BE2608F27A40005CB29B /* tkText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0308F27A39005CB29B /* tkText.c */; };
+ F966BE2808F27A40005CB29B /* tkTextBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0508F27A39005CB29B /* tkTextBTree.c */; };
+ F966BE2908F27A40005CB29B /* tkTextDisp.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0608F27A39005CB29B /* tkTextDisp.c */; };
+ F966BE2B08F27A40005CB29B /* tkTextImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0808F27A39005CB29B /* tkTextImage.c */; };
+ F966BE2C08F27A40005CB29B /* tkTextIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0908F27A39005CB29B /* tkTextIndex.c */; };
+ F966BE2D08F27A40005CB29B /* tkTextMark.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0A08F27A39005CB29B /* tkTextMark.c */; };
+ F966BE2E08F27A40005CB29B /* tkTextTag.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0B08F27A39005CB29B /* tkTextTag.c */; };
+ F966BE2F08F27A40005CB29B /* tkTextWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0C08F27A39005CB29B /* tkTextWind.c */; };
+ F966BE3008F27A40005CB29B /* tkTrig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0D08F27A39005CB29B /* tkTrig.c */; };
+ F966BE3108F27A40005CB29B /* tkUndo.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0E08F27A39005CB29B /* tkUndo.c */; };
+ F966BE3308F27A40005CB29B /* tkUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1008F27A39005CB29B /* tkUtil.c */; };
+ F966BE3408F27A40005CB29B /* tkVisual.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1108F27A39005CB29B /* tkVisual.c */; };
+ F966BE3508F27A40005CB29B /* tkWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1208F27A39005CB29B /* tkWindow.c */; };
+ F966BEDB08F27A40005CB29B /* tkMacOSXBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */; };
+ F966BEDC08F27A40005CB29B /* tkMacOSXButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */; };
+ F966BEDE08F27A40005CB29B /* tkMacOSXClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */; };
+ F966BEDF08F27A40005CB29B /* tkMacOSXColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */; };
+ F966BEE008F27A40005CB29B /* tkMacOSXConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */; };
+ F966BEE108F27A40005CB29B /* tkMacOSXCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */; };
+ F966BEE308F27A40005CB29B /* tkMacOSXDebug.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */; };
+ F966BEE608F27A40005CB29B /* tkMacOSXDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */; };
+ F966BEE708F27A40005CB29B /* tkMacOSXDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */; };
+ F966BEE808F27A40005CB29B /* tkMacOSXEmbed.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */; };
+ F966BEE908F27A40005CB29B /* tkMacOSXEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */; };
+ F966BEEA08F27A40005CB29B /* tkMacOSXEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */; };
+ F966BEEC08F27A40005CB29B /* tkMacOSXFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */; };
+ F966BEED08F27A40005CB29B /* tkMacOSXHLEvents.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */; };
+ F966BEEE08F27A40005CB29B /* tkMacOSXInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */; settings = {COMPILER_FLAGS = "-DTK_LIBRARY=\\\"$(TK_LIBRARY)\\\""; }; };
+ F966BEF108F27A40005CB29B /* tkMacOSXKeyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */; };
+ F966BEF208F27A40005CB29B /* tkMacOSXKeyEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */; };
+ F966BEF308F27A40005CB29B /* tkMacOSXMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */; };
+ F966BEF608F27A40005CB29B /* tkMacOSXMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */; };
+ F966BEF708F27A40005CB29B /* tkMacOSXMenus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */; };
+ F966BEF808F27A40005CB29B /* tkMacOSXMouseEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */; };
+ F966BEF908F27A40005CB29B /* tkMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */; };
+ F966BF0108F27A40005CB29B /* tkMacOSXRegion.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */; };
+ F966BF0308F27A40005CB29B /* tkMacOSXScrlbr.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */; };
+ F966BF0408F27A40005CB29B /* tkMacOSXSend.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */; };
+ F966BF0508F27A40005CB29B /* tkMacOSXSubwindows.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */; };
+ F966BF0608F27A40005CB29B /* tkMacOSXTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */; };
+ F966BF0708F27A40005CB29B /* tkMacOSXWindowEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */; };
+ F966BF0808F27A40005CB29B /* tkMacOSXWm.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */; };
+ F966BF0B08F27A40005CB29B /* tkMacOSXXStubs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */; };
+ F966BF7F08F27A41005CB29B /* tkAppInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7508F27A3D005CB29B /* tkAppInit.c */; settings = {COMPILER_FLAGS = "-DTK_TEST"; }; };
+ F966BF8308F27A41005CB29B /* tkUnix3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7908F27A3D005CB29B /* tkUnix3d.c */; };
+ F966BF9608F27A41005CB29B /* tkUnixScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8C08F27A3D005CB29B /* tkUnixScale.c */; };
+ F966C02A08F27A42005CB29B /* xcolors.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2408F27A3F005CB29B /* xcolors.c */; };
+ F966C02B08F27A42005CB29B /* xdraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2508F27A3F005CB29B /* xdraw.c */; };
+ F966C02C08F27A42005CB29B /* xgc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2608F27A3F005CB29B /* xgc.c */; };
+ F966C02D08F27A42005CB29B /* ximage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2708F27A3F005CB29B /* ximage.c */; };
+ F966C02E08F27A42005CB29B /* xutil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2808F27A3F005CB29B /* xutil.c */; };
+ F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07408F2820D005CB29B /* CoreFoundation.framework */; };
+ F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07608F2821B005CB29B /* Carbon.framework */; };
+ F966C07908F28233005CB29B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07808F28233005CB29B /* IOKit.framework */; };
+ F96888050AF786D5000797B5 /* ttkBlink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E10AF786D5000797B5 /* ttkBlink.c */; };
+ F96888060AF786D5000797B5 /* ttkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E20AF786D5000797B5 /* ttkButton.c */; };
+ F96888070AF786D5000797B5 /* ttkCache.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E30AF786D5000797B5 /* ttkCache.c */; };
+ F96888080AF786D5000797B5 /* ttkClamTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E40AF786D5000797B5 /* ttkClamTheme.c */; };
+ F96888090AF786D5000797B5 /* ttkClassicTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E50AF786D5000797B5 /* ttkClassicTheme.c */; };
+ F968880A0AF786D5000797B5 /* ttkDefaultTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */; };
+ F968880B0AF786D5000797B5 /* ttkElements.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E80AF786D5000797B5 /* ttkElements.c */; };
+ F968880C0AF786D5000797B5 /* ttkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E90AF786D5000797B5 /* ttkEntry.c */; };
+ F968880D0AF786D5000797B5 /* ttkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EA0AF786D5000797B5 /* ttkFrame.c */; };
+ F968880E0AF786D5000797B5 /* ttkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EB0AF786D5000797B5 /* ttkImage.c */; };
+ F968880F0AF786D5000797B5 /* ttkInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EC0AF786D5000797B5 /* ttkInit.c */; };
+ F96888100AF786D5000797B5 /* ttkLabel.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887ED0AF786D5000797B5 /* ttkLabel.c */; };
+ F96888110AF786D5000797B5 /* ttkLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EE0AF786D5000797B5 /* ttkLayout.c */; };
+ F96888120AF786D5000797B5 /* ttkManager.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EF0AF786D5000797B5 /* ttkManager.c */; };
+ F96888130AF786D5000797B5 /* ttkNotebook.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F10AF786D5000797B5 /* ttkNotebook.c */; };
+ F96888140AF786D5000797B5 /* ttkPanedwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F20AF786D5000797B5 /* ttkPanedwindow.c */; };
+ F96888150AF786D5000797B5 /* ttkProgress.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F30AF786D5000797B5 /* ttkProgress.c */; };
+ F96888160AF786D5000797B5 /* ttkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F40AF786D5000797B5 /* ttkScale.c */; };
+ F96888170AF786D5000797B5 /* ttkScroll.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F50AF786D5000797B5 /* ttkScroll.c */; };
+ F96888180AF786D5000797B5 /* ttkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F60AF786D5000797B5 /* ttkScrollbar.c */; };
+ F96888190AF786D5000797B5 /* ttkSeparator.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F70AF786D5000797B5 /* ttkSeparator.c */; };
+ F968881A0AF786D5000797B5 /* ttkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F80AF786D5000797B5 /* ttkSquare.c */; };
+ F968881B0AF786D5000797B5 /* ttkState.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F90AF786D5000797B5 /* ttkState.c */; };
+ F968881C0AF786D5000797B5 /* ttkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FA0AF786D5000797B5 /* ttkStubInit.c */; };
+ F968881D0AF786D5000797B5 /* ttkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FB0AF786D5000797B5 /* ttkStubLib.c */; };
+ F968881E0AF786D5000797B5 /* ttkTagSet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FC0AF786D5000797B5 /* ttkTagSet.c */; };
+ F968881F0AF786D5000797B5 /* ttkTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FD0AF786D5000797B5 /* ttkTheme.c */; };
+ F96888200AF786D5000797B5 /* ttkTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888000AF786D5000797B5 /* ttkTrace.c */; };
+ F96888210AF786D5000797B5 /* ttkTrack.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888010AF786D5000797B5 /* ttkTrack.c */; };
+ F96888220AF786D5000797B5 /* ttkTreeview.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888020AF786D5000797B5 /* ttkTreeview.c */; };
+ F96888230AF786D5000797B5 /* ttkWidget.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888030AF786D5000797B5 /* ttkWidget.c */; };
+ F96888850AF78938000797B5 /* ttkMacOSXTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888840AF78938000797B5 /* ttkMacOSXTheme.c */; };
+ F96D456F08F272BB004A47F5 /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED008F272A7004A47F5 /* regcomp.c */; };
+ F96D457208F272BB004A47F5 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED308F272A7004A47F5 /* regerror.c */; };
+ F96D457508F272BB004A47F5 /* regexec.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED608F272A7004A47F5 /* regexec.c */; };
+ F96D457608F272BB004A47F5 /* regfree.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED708F272A7004A47F5 /* regfree.c */; };
+ F96D457B08F272BB004A47F5 /* tclAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDC08F272A7004A47F5 /* tclAlloc.c */; settings = {COMPILER_FLAGS = "-DUSE_TCLALLOC=0"; }; };
+ F96D457C08F272BB004A47F5 /* tclAsync.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDD08F272A7004A47F5 /* tclAsync.c */; };
+ F96D457D08F272BB004A47F5 /* tclBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDE08F272A7004A47F5 /* tclBasic.c */; };
+ F96D457E08F272BC004A47F5 /* tclBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDF08F272A7004A47F5 /* tclBinary.c */; };
+ F96D457F08F272BC004A47F5 /* tclCkalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE008F272A7004A47F5 /* tclCkalloc.c */; };
+ F96D458008F272BC004A47F5 /* tclClock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE108F272A7004A47F5 /* tclClock.c */; };
+ F96D458108F272BC004A47F5 /* tclCmdAH.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE208F272A7004A47F5 /* tclCmdAH.c */; };
+ F96D458208F272BC004A47F5 /* tclCmdIL.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE308F272A7004A47F5 /* tclCmdIL.c */; };
+ F96D458308F272BC004A47F5 /* tclCmdMZ.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */; };
+ F96D458408F272BC004A47F5 /* tclCompCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE508F272A7004A47F5 /* tclCompCmds.c */; };
+ F96D458508F272BC004A47F5 /* tclCompExpr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE608F272A7004A47F5 /* tclCompExpr.c */; };
+ F96D458608F272BC004A47F5 /* tclCompile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE708F272A7004A47F5 /* tclCompile.c */; };
+ F96D458808F272BC004A47F5 /* tclConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE908F272A7004A47F5 /* tclConfig.c */; };
+ F96D458908F272BC004A47F5 /* tclDate.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEA08F272A7004A47F5 /* tclDate.c */; };
+ F96D458B08F272BC004A47F5 /* tclDictObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEC08F272A7004A47F5 /* tclDictObj.c */; };
+ F96D458C08F272BC004A47F5 /* tclEncoding.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EED08F272A7004A47F5 /* tclEncoding.c */; };
+ F96D458D08F272BC004A47F5 /* tclEnv.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEE08F272A7004A47F5 /* tclEnv.c */; };
+ F96D458E08F272BC004A47F5 /* tclEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEF08F272A7004A47F5 /* tclEvent.c */; };
+ F96D458F08F272BC004A47F5 /* tclExecute.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF008F272A7004A47F5 /* tclExecute.c */; };
+ F96D459008F272BC004A47F5 /* tclFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF108F272A7004A47F5 /* tclFCmd.c */; };
+ F96D459108F272BC004A47F5 /* tclFileName.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF208F272A7004A47F5 /* tclFileName.c */; };
+ F96D459308F272BC004A47F5 /* tclGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF408F272A7004A47F5 /* tclGet.c */; };
+ F96D459508F272BC004A47F5 /* tclHash.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF608F272A7004A47F5 /* tclHash.c */; };
+ F96D459608F272BC004A47F5 /* tclHistory.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF708F272A7004A47F5 /* tclHistory.c */; };
+ F96D459708F272BC004A47F5 /* tclIndexObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF808F272A7004A47F5 /* tclIndexObj.c */; };
+ F96D459B08F272BC004A47F5 /* tclInterp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFC08F272A7004A47F5 /* tclInterp.c */; };
+ F96D459D08F272BC004A47F5 /* tclIO.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFE08F272A7004A47F5 /* tclIO.c */; };
+ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0008F272A7004A47F5 /* tclIOCmd.c */; };
+ F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0108F272A7004A47F5 /* tclIOGT.c */; };
+ F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0208F272A7004A47F5 /* tclIORChan.c */; };
+ F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0308F272A7004A47F5 /* tclIOSock.c */; };
+ F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0408F272A7004A47F5 /* tclIOUtil.c */; };
+ F96D45A408F272BC004A47F5 /* tclLink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0508F272A7004A47F5 /* tclLink.c */; };
+ F96D45A508F272BC004A47F5 /* tclListObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0608F272A7004A47F5 /* tclListObj.c */; };
+ F96D45A608F272BC004A47F5 /* tclLiteral.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0708F272A7004A47F5 /* tclLiteral.c */; };
+ F96D45A708F272BC004A47F5 /* tclLoad.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0808F272A7004A47F5 /* tclLoad.c */; };
+ F96D45A908F272BC004A47F5 /* tclMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0A08F272A7004A47F5 /* tclMain.c */; };
+ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0B08F272A7004A47F5 /* tclNamesp.c */; };
+ F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0C08F272A7004A47F5 /* tclNotify.c */; };
+ F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0D08F272A7004A47F5 /* tclObj.c */; };
+ F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0E08F272A7004A47F5 /* tclPanic.c */; };
+ F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0F08F272A7004A47F5 /* tclParse.c */; };
+ F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1108F272A7004A47F5 /* tclPathObj.c */; };
+ F96D45B108F272BC004A47F5 /* tclPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1208F272A7004A47F5 /* tclPipe.c */; };
+ F96D45B208F272BC004A47F5 /* tclPkg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1308F272A7004A47F5 /* tclPkg.c */; };
+ F96D45B308F272BC004A47F5 /* tclPkgConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */; settings = {COMPILER_FLAGS = "-DCFG_INSTALL_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_INSTALL_BINDIR=\\\"$(BINDIR)\\\" -DCFG_INSTALL_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_INSTALL_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_INSTALL_DOCDIR=\\\"$(MANDIR)\\\" -DCFG_RUNTIME_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_RUNTIME_BINDIR=\\\"$(BINDIR)\\\" -DCFG_RUNTIME_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_RUNTIME_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_RUNTIME_DOCDIR=\\\"$(MANDIR)\\\""; }; };
+ F96D45B608F272BC004A47F5 /* tclPosixStr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1708F272A7004A47F5 /* tclPosixStr.c */; };
+ F96D45B708F272BC004A47F5 /* tclPreserve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1808F272A7004A47F5 /* tclPreserve.c */; };
+ F96D45B808F272BC004A47F5 /* tclProc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1908F272A7004A47F5 /* tclProc.c */; };
+ F96D45B908F272BC004A47F5 /* tclRegexp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1A08F272A7004A47F5 /* tclRegexp.c */; };
+ F96D45BB08F272BC004A47F5 /* tclResolve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1C08F272A7004A47F5 /* tclResolve.c */; };
+ F96D45BC08F272BC004A47F5 /* tclResult.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1D08F272A7004A47F5 /* tclResult.c */; };
+ F96D45BD08F272BC004A47F5 /* tclScan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1E08F272A7004A47F5 /* tclScan.c */; };
+ F96D45BE08F272BC004A47F5 /* tclStringObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1F08F272A7004A47F5 /* tclStringObj.c */; };
+ F96D45C308F272BC004A47F5 /* tclStrToD.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2408F272A7004A47F5 /* tclStrToD.c */; };
+ F96D45C408F272BC004A47F5 /* tclStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2508F272A7004A47F5 /* tclStubInit.c */; };
+ F96D45C508F272BC004A47F5 /* tclStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2608F272A7004A47F5 /* tclStubLib.c */; };
+ F96D45C908F272BC004A47F5 /* tclThread.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2A08F272A7004A47F5 /* tclThread.c */; };
+ F96D45CA08F272BC004A47F5 /* tclThreadAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */; };
+ F96D45CB08F272BC004A47F5 /* tclThreadJoin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */; };
+ F96D45CC08F272BC004A47F5 /* tclThreadStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */; };
+ F96D45CE08F272BC004A47F5 /* tclTimer.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2F08F272A7004A47F5 /* tclTimer.c */; };
+ F96D45D008F272BC004A47F5 /* tclTomMathInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */; };
+ F96D45D108F272BC004A47F5 /* tclTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3208F272A7004A47F5 /* tclTrace.c */; };
+ F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3408F272A7004A47F5 /* tclUtf.c */; };
+ F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3508F272A7004A47F5 /* tclUtil.c */; };
+ F96D45D508F272BC004A47F5 /* tclVar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3608F272A7004A47F5 /* tclVar.c */; };
+ F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */; };
+ F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */; };
+ F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426908F272B3004A47F5 /* bn_mp_add.c */; };
+ F96D48E808F272C3004A47F5 /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */; };
+ F96D48EB08F272C3004A47F5 /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */; };
+ F96D48EC08F272C3004A47F5 /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426E08F272B3004A47F5 /* bn_mp_clear.c */; };
+ F96D48ED08F272C3004A47F5 /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */; };
+ F96D48EE08F272C3004A47F5 /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427008F272B3004A47F5 /* bn_mp_cmp.c */; };
+ F96D48F008F272C3004A47F5 /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */; };
+ F96D48F208F272C3004A47F5 /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427408F272B3004A47F5 /* bn_mp_copy.c */; };
+ F96D48F308F272C3004A47F5 /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */; };
+ F96D48F408F272C3004A47F5 /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427608F272B3004A47F5 /* bn_mp_div.c */; };
+ F96D48F508F272C3004A47F5 /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427708F272B3004A47F5 /* bn_mp_div_2.c */; };
+ F96D48F608F272C3004A47F5 /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */; };
+ F96D48F708F272C3004A47F5 /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427908F272B3004A47F5 /* bn_mp_div_3.c */; };
+ F96D48F808F272C3004A47F5 /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */; };
+ F96D48FC08F272C3004A47F5 /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427E08F272B3004A47F5 /* bn_mp_exch.c */; };
+ F96D490508F272C3004A47F5 /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428708F272B3004A47F5 /* bn_mp_grow.c */; };
+ F96D490608F272C3004A47F5 /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428808F272B3004A47F5 /* bn_mp_init.c */; };
+ F96D490708F272C3004A47F5 /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */; };
+ F96D490808F272C3004A47F5 /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */; };
+ F96D490908F272C3004A47F5 /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */; };
+ F96D490B08F272C3004A47F5 /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */; };
+ F96D491008F272C3004A47F5 /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */; };
+ F96D491108F272C3004A47F5 /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */; };
+ F96D491308F272C3004A47F5 /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429508F272B3004A47F5 /* bn_mp_lshd.c */; };
+ F96D491408F272C3004A47F5 /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429608F272B3004A47F5 /* bn_mp_mod.c */; };
+ F96D491508F272C3004A47F5 /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */; };
+ F96D491A08F272C3004A47F5 /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429C08F272B3004A47F5 /* bn_mp_mul.c */; };
+ F96D491B08F272C3004A47F5 /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */; };
+ F96D491C08F272C3004A47F5 /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */; };
+ F96D491D08F272C3004A47F5 /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */; };
+ F96D492908F272C3004A47F5 /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */; };
+ F96D492A08F272C3004A47F5 /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */; };
+ F96D492C08F272C3004A47F5 /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */; };
+ F96D493708F272C3004A47F5 /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */; };
+ F96D493808F272C3004A47F5 /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BA08F272B3004A47F5 /* bn_mp_set.c */; };
+ F96D493C08F272C3004A47F5 /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */; };
+ F96D493F08F272C3004A47F5 /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C108F272B3004A47F5 /* bn_mp_sub.c */; };
+ F96D494008F272C3004A47F5 /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */; };
+ F96D494608F272C3004A47F5 /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */; };
+ F96D494708F272C3004A47F5 /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */; };
+ F96D494908F272C3004A47F5 /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */; };
+ F96D494C08F272C3004A47F5 /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */; };
+ F96D494E08F272C3004A47F5 /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D008F272B3004A47F5 /* bn_reverse.c */; };
+ F96D494F08F272C3004A47F5 /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */; };
+ F96D495108F272C3004A47F5 /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */; };
+ F96D495308F272C3004A47F5 /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */; };
+ F96D495408F272C3004A47F5 /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */; };
+ F96D495508F272C3004A47F5 /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D708F272B3004A47F5 /* bncore.c */; };
+ F96D49A908F272C4004A47F5 /* tclMacOSXBundle.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */; };
+ F96D49AD08F272C4004A47F5 /* tclMacOSXFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */; };
+ F96D49AE08F272C4004A47F5 /* tclMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */; };
+ F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445B08F272B9004A47F5 /* tclLoadDyld.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445F08F272B9004A47F5 /* tclUnixChan.c */; };
+ F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446008F272B9004A47F5 /* tclUnixEvent.c */; };
+ F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446108F272B9004A47F5 /* tclUnixFCmd.c */; };
+ F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446208F272B9004A47F5 /* tclUnixFile.c */; };
+ F96D4ACE08F272C9004A47F5 /* tclUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446308F272B9004A47F5 /* tclUnixInit.c */; settings = {COMPILER_FLAGS = "-DTCL_LIBRARY=\\\"$(TCL_LIBRARY)\\\" -DTCL_PACKAGE_PATH=\\\"$(TCL_PACKAGE_PATH)\\\""; }; };
+ F96D4ACF08F272C9004A47F5 /* tclUnixNotfy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446408F272B9004A47F5 /* tclUnixNotfy.c */; };
+ F96D4AD008F272C9004A47F5 /* tclUnixPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446508F272B9004A47F5 /* tclUnixPipe.c */; };
+ F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446708F272B9004A47F5 /* tclUnixSock.c */; };
+ F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446908F272B9004A47F5 /* tclUnixThrd.c */; };
+ F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446B08F272B9004A47F5 /* tclUnixTime.c */; };
+ F9C9CC000E84059800E00935 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */; };
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
+ F9E61D28090A481F002B3151 /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */; };
+ F9E61D29090A486C002B3151 /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A208F272B3004A47F5 /* bn_mp_neg.c */; };
+ F9E61D2A090A4891002B3151 /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */; };
+ F9E61D2B090A48A4002B3151 /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426C08F272B3004A47F5 /* bn_mp_and.c */; };
+ F9E61D2C090A48AC002B3151 /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */; };
+ F9E61D2D090A48BB002B3151 /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */; };
+ F9E61D2E090A48BF002B3151 /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A308F272B3004A47F5 /* bn_mp_or.c */; };
+ F9E61D2F090A48C7002B3151 /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */; };
+ F9E61D30090A48E2002B3151 /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */; };
+ F9E61D31090A48F9002B3151 /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */; };
+ F9E61D32090A48FA002B3151 /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */; };
+ F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */ = {isa = PBXBuildFile; fileRef = F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */; };
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; };
+ F9FD30BC0CC1AD070073837D /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED008F272A7004A47F5 /* regcomp.c */; };
+ F9FD30BD0CC1AD070073837D /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED308F272A7004A47F5 /* regerror.c */; };
+ F9FD30BE0CC1AD070073837D /* regexec.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED608F272A7004A47F5 /* regexec.c */; };
+ F9FD30BF0CC1AD070073837D /* regfree.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED708F272A7004A47F5 /* regfree.c */; };
+ F9FD30C00CC1AD070073837D /* tclAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDC08F272A7004A47F5 /* tclAlloc.c */; settings = {COMPILER_FLAGS = "-DUSE_TCLALLOC=0"; }; };
+ F9FD30C10CC1AD070073837D /* tclAsync.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDD08F272A7004A47F5 /* tclAsync.c */; };
+ F9FD30C20CC1AD070073837D /* tclBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDE08F272A7004A47F5 /* tclBasic.c */; };
+ F9FD30C30CC1AD070073837D /* tclBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDF08F272A7004A47F5 /* tclBinary.c */; };
+ F9FD30C40CC1AD070073837D /* tclCkalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE008F272A7004A47F5 /* tclCkalloc.c */; };
+ F9FD30C50CC1AD070073837D /* tclClock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE108F272A7004A47F5 /* tclClock.c */; };
+ F9FD30C60CC1AD070073837D /* tclCmdAH.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE208F272A7004A47F5 /* tclCmdAH.c */; };
+ F9FD30C70CC1AD070073837D /* tclCmdIL.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE308F272A7004A47F5 /* tclCmdIL.c */; };
+ F9FD30C80CC1AD070073837D /* tclCmdMZ.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */; };
+ F9FD30C90CC1AD070073837D /* tclCompCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE508F272A7004A47F5 /* tclCompCmds.c */; };
+ F9FD30CA0CC1AD070073837D /* tclCompExpr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE608F272A7004A47F5 /* tclCompExpr.c */; };
+ F9FD30CB0CC1AD070073837D /* tclCompile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE708F272A7004A47F5 /* tclCompile.c */; };
+ F9FD30CC0CC1AD070073837D /* tclConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE908F272A7004A47F5 /* tclConfig.c */; };
+ F9FD30CD0CC1AD070073837D /* tclDate.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEA08F272A7004A47F5 /* tclDate.c */; };
+ F9FD30CE0CC1AD070073837D /* tclDictObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEC08F272A7004A47F5 /* tclDictObj.c */; };
+ F9FD30CF0CC1AD070073837D /* tclEncoding.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EED08F272A7004A47F5 /* tclEncoding.c */; };
+ F9FD30D00CC1AD070073837D /* tclEnv.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEE08F272A7004A47F5 /* tclEnv.c */; };
+ F9FD30D10CC1AD070073837D /* tclEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEF08F272A7004A47F5 /* tclEvent.c */; };
+ F9FD30D20CC1AD070073837D /* tclExecute.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF008F272A7004A47F5 /* tclExecute.c */; };
+ F9FD30D30CC1AD070073837D /* tclFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF108F272A7004A47F5 /* tclFCmd.c */; };
+ F9FD30D40CC1AD070073837D /* tclFileName.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF208F272A7004A47F5 /* tclFileName.c */; };
+ F9FD30D50CC1AD070073837D /* tclGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF408F272A7004A47F5 /* tclGet.c */; };
+ F9FD30D60CC1AD070073837D /* tclHash.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF608F272A7004A47F5 /* tclHash.c */; };
+ F9FD30D70CC1AD070073837D /* tclHistory.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF708F272A7004A47F5 /* tclHistory.c */; };
+ F9FD30D80CC1AD070073837D /* tclIndexObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF808F272A7004A47F5 /* tclIndexObj.c */; };
+ F9FD30D90CC1AD070073837D /* tclInterp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFC08F272A7004A47F5 /* tclInterp.c */; };
+ F9FD30DA0CC1AD070073837D /* tclIO.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFE08F272A7004A47F5 /* tclIO.c */; };
+ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0008F272A7004A47F5 /* tclIOCmd.c */; };
+ F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0108F272A7004A47F5 /* tclIOGT.c */; };
+ F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0208F272A7004A47F5 /* tclIORChan.c */; };
+ F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0308F272A7004A47F5 /* tclIOSock.c */; };
+ F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0408F272A7004A47F5 /* tclIOUtil.c */; };
+ F9FD30E00CC1AD070073837D /* tclLink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0508F272A7004A47F5 /* tclLink.c */; };
+ F9FD30E10CC1AD070073837D /* tclListObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0608F272A7004A47F5 /* tclListObj.c */; };
+ F9FD30E20CC1AD070073837D /* tclLiteral.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0708F272A7004A47F5 /* tclLiteral.c */; };
+ F9FD30E30CC1AD070073837D /* tclLoad.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0808F272A7004A47F5 /* tclLoad.c */; };
+ F9FD30E40CC1AD070073837D /* tclMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0A08F272A7004A47F5 /* tclMain.c */; };
+ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0B08F272A7004A47F5 /* tclNamesp.c */; };
+ F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0C08F272A7004A47F5 /* tclNotify.c */; };
+ F9FD30E70CC1AD070073837D /* tclObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0D08F272A7004A47F5 /* tclObj.c */; };
+ F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0E08F272A7004A47F5 /* tclPanic.c */; };
+ F9FD30E90CC1AD070073837D /* tclParse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0F08F272A7004A47F5 /* tclParse.c */; };
+ F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1108F272A7004A47F5 /* tclPathObj.c */; };
+ F9FD30EB0CC1AD070073837D /* tclPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1208F272A7004A47F5 /* tclPipe.c */; };
+ F9FD30EC0CC1AD070073837D /* tclPkg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1308F272A7004A47F5 /* tclPkg.c */; };
+ F9FD30ED0CC1AD070073837D /* tclPkgConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */; settings = {COMPILER_FLAGS = "-DCFG_INSTALL_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_INSTALL_BINDIR=\\\"$(BINDIR)\\\" -DCFG_INSTALL_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_INSTALL_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_INSTALL_DOCDIR=\\\"$(MANDIR)\\\" -DCFG_RUNTIME_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_RUNTIME_BINDIR=\\\"$(BINDIR)\\\" -DCFG_RUNTIME_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_RUNTIME_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_RUNTIME_DOCDIR=\\\"$(MANDIR)\\\""; }; };
+ F9FD30EE0CC1AD070073837D /* tclPosixStr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1708F272A7004A47F5 /* tclPosixStr.c */; };
+ F9FD30EF0CC1AD070073837D /* tclPreserve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1808F272A7004A47F5 /* tclPreserve.c */; };
+ F9FD30F00CC1AD070073837D /* tclProc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1908F272A7004A47F5 /* tclProc.c */; };
+ F9FD30F10CC1AD070073837D /* tclRegexp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1A08F272A7004A47F5 /* tclRegexp.c */; };
+ F9FD30F20CC1AD070073837D /* tclResolve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1C08F272A7004A47F5 /* tclResolve.c */; };
+ F9FD30F30CC1AD070073837D /* tclResult.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1D08F272A7004A47F5 /* tclResult.c */; };
+ F9FD30F40CC1AD070073837D /* tclScan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1E08F272A7004A47F5 /* tclScan.c */; };
+ F9FD30F50CC1AD070073837D /* tclStringObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1F08F272A7004A47F5 /* tclStringObj.c */; };
+ F9FD30F60CC1AD070073837D /* tclStrToD.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2408F272A7004A47F5 /* tclStrToD.c */; };
+ F9FD30F70CC1AD070073837D /* tclStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2508F272A7004A47F5 /* tclStubInit.c */; };
+ F9FD30F80CC1AD070073837D /* tclStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2608F272A7004A47F5 /* tclStubLib.c */; };
+ F9FD30F90CC1AD070073837D /* tclThread.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2A08F272A7004A47F5 /* tclThread.c */; };
+ F9FD30FA0CC1AD070073837D /* tclThreadAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */; };
+ F9FD30FB0CC1AD070073837D /* tclThreadJoin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */; };
+ F9FD30FC0CC1AD070073837D /* tclThreadStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */; };
+ F9FD30FD0CC1AD070073837D /* tclTimer.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2F08F272A7004A47F5 /* tclTimer.c */; };
+ F9FD30FE0CC1AD070073837D /* tclTomMathInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */; };
+ F9FD30FF0CC1AD070073837D /* tclTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3208F272A7004A47F5 /* tclTrace.c */; };
+ F9FD31000CC1AD070073837D /* tclUtf.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3408F272A7004A47F5 /* tclUtf.c */; };
+ F9FD31010CC1AD070073837D /* tclUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3508F272A7004A47F5 /* tclUtil.c */; };
+ F9FD31020CC1AD070073837D /* tclVar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3608F272A7004A47F5 /* tclVar.c */; };
+ F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */; };
+ F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */; };
+ F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426908F272B3004A47F5 /* bn_mp_add.c */; };
+ F9FD31060CC1AD070073837D /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */; };
+ F9FD31070CC1AD070073837D /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426C08F272B3004A47F5 /* bn_mp_and.c */; };
+ F9FD31080CC1AD070073837D /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */; };
+ F9FD31090CC1AD070073837D /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426E08F272B3004A47F5 /* bn_mp_clear.c */; };
+ F9FD310A0CC1AD070073837D /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */; };
+ F9FD310B0CC1AD070073837D /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427008F272B3004A47F5 /* bn_mp_cmp.c */; };
+ F9FD310C0CC1AD070073837D /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */; };
+ F9FD310D0CC1AD070073837D /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */; };
+ F9FD310E0CC1AD070073837D /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427408F272B3004A47F5 /* bn_mp_copy.c */; };
+ F9FD310F0CC1AD070073837D /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */; };
+ F9FD31100CC1AD070073837D /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427608F272B3004A47F5 /* bn_mp_div.c */; };
+ F9FD31110CC1AD070073837D /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427708F272B3004A47F5 /* bn_mp_div_2.c */; };
+ F9FD31120CC1AD070073837D /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */; };
+ F9FD31130CC1AD070073837D /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427908F272B3004A47F5 /* bn_mp_div_3.c */; };
+ F9FD31140CC1AD070073837D /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */; };
+ F9FD31150CC1AD070073837D /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427E08F272B3004A47F5 /* bn_mp_exch.c */; };
+ F9FD31160CC1AD070073837D /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */; };
+ F9FD31170CC1AD070073837D /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428708F272B3004A47F5 /* bn_mp_grow.c */; };
+ F9FD31180CC1AD070073837D /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428808F272B3004A47F5 /* bn_mp_init.c */; };
+ F9FD31190CC1AD070073837D /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */; };
+ F9FD311A0CC1AD070073837D /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */; };
+ F9FD311B0CC1AD070073837D /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */; };
+ F9FD311C0CC1AD070073837D /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */; };
+ F9FD311D0CC1AD070073837D /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */; };
+ F9FD311E0CC1AD070073837D /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */; };
+ F9FD311F0CC1AD070073837D /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429508F272B3004A47F5 /* bn_mp_lshd.c */; };
+ F9FD31200CC1AD070073837D /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429608F272B3004A47F5 /* bn_mp_mod.c */; };
+ F9FD31210CC1AD070073837D /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */; };
+ F9FD31220CC1AD070073837D /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429C08F272B3004A47F5 /* bn_mp_mul.c */; };
+ F9FD31230CC1AD070073837D /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */; };
+ F9FD31240CC1AD070073837D /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */; };
+ F9FD31250CC1AD070073837D /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */; };
+ F9FD31260CC1AD070073837D /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A208F272B3004A47F5 /* bn_mp_neg.c */; };
+ F9FD31270CC1AD070073837D /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A308F272B3004A47F5 /* bn_mp_or.c */; };
+ F9FD31280CC1AD070073837D /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */; };
+ F9FD31290CC1AD070073837D /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */; };
+ F9FD312A0CC1AD070073837D /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */; };
+ F9FD312B0CC1AD070073837D /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */; };
+ F9FD312C0CC1AD070073837D /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BA08F272B3004A47F5 /* bn_mp_set.c */; };
+ F9FD312D0CC1AD070073837D /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */; };
+ F9FD312E0CC1AD070073837D /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */; };
+ F9FD312F0CC1AD070073837D /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */; };
+ F9FD31300CC1AD070073837D /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C108F272B3004A47F5 /* bn_mp_sub.c */; };
+ F9FD31310CC1AD070073837D /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */; };
+ F9FD31320CC1AD070073837D /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */; };
+ F9FD31330CC1AD070073837D /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */; };
+ F9FD31340CC1AD070073837D /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */; };
+ F9FD31350CC1AD070073837D /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */; };
+ F9FD31360CC1AD070073837D /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */; };
+ F9FD31370CC1AD070073837D /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */; };
+ F9FD31380CC1AD070073837D /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */; };
+ F9FD31390CC1AD070073837D /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */; };
+ F9FD313A0CC1AD070073837D /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D008F272B3004A47F5 /* bn_reverse.c */; };
+ F9FD313B0CC1AD070073837D /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */; };
+ F9FD313C0CC1AD070073837D /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */; };
+ F9FD313D0CC1AD070073837D /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */; };
+ F9FD313E0CC1AD070073837D /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */; };
+ F9FD313F0CC1AD070073837D /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D708F272B3004A47F5 /* bncore.c */; };
+ F9FD31400CC1AD070073837D /* tclMacOSXBundle.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */; };
+ F9FD31410CC1AD070073837D /* tclMacOSXFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */; };
+ F9FD31420CC1AD070073837D /* tclMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */; };
+ F9FD31430CC1AD070073837D /* tclLoadDyld.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445B08F272B9004A47F5 /* tclLoadDyld.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ F9FD31440CC1AD070073837D /* tclUnixChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445F08F272B9004A47F5 /* tclUnixChan.c */; };
+ F9FD31450CC1AD070073837D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; };
+ F9FD31460CC1AD070073837D /* tclUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446008F272B9004A47F5 /* tclUnixEvent.c */; };
+ F9FD31470CC1AD070073837D /* tclUnixFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446108F272B9004A47F5 /* tclUnixFCmd.c */; };
+ F9FD31480CC1AD070073837D /* tclUnixFile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446208F272B9004A47F5 /* tclUnixFile.c */; };
+ F9FD31490CC1AD070073837D /* tclUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446308F272B9004A47F5 /* tclUnixInit.c */; settings = {COMPILER_FLAGS = "-DTCL_LIBRARY=\\\"$(TCL_LIBRARY)\\\" -DTCL_PACKAGE_PATH=\\\"$(TCL_PACKAGE_PATH)\\\""; }; };
+ F9FD314A0CC1AD070073837D /* tclUnixNotfy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446408F272B9004A47F5 /* tclUnixNotfy.c */; };
+ F9FD314B0CC1AD070073837D /* tclUnixPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446508F272B9004A47F5 /* tclUnixPipe.c */; };
+ F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446708F272B9004A47F5 /* tclUnixSock.c */; };
+ F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446908F272B9004A47F5 /* tclUnixThrd.c */; };
+ F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446B08F272B9004A47F5 /* tclUnixTime.c */; };
+ F9FD314F0CC1AD070073837D /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
+ F9FD31500CC1AD070073837D /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
+ F9FD31510CC1AD070073837D /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
+ F9FD31520CC1AD070073837D /* tkBind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB008F27A39005CB29B /* tkBind.c */; };
+ F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB108F27A39005CB29B /* tkBitmap.c */; };
+ F9FD31540CC1AD070073837D /* tkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB208F27A39005CB29B /* tkButton.c */; };
+ F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB408F27A39005CB29B /* tkCanvArc.c */; };
+ F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB508F27A39005CB29B /* tkCanvas.c */; };
+ F9FD31570CC1AD070073837D /* tkCanvBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB708F27A39005CB29B /* tkCanvBmap.c */; };
+ F9FD31580CC1AD070073837D /* tkCanvImg.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB808F27A39005CB29B /* tkCanvImg.c */; };
+ F9FD31590CC1AD070073837D /* tkCanvLine.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB908F27A39005CB29B /* tkCanvLine.c */; };
+ F9FD315A0CC1AD070073837D /* tkCanvPoly.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABA08F27A39005CB29B /* tkCanvPoly.c */; };
+ F9FD315B0CC1AD070073837D /* tkCanvPs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABB08F27A39005CB29B /* tkCanvPs.c */; };
+ F9FD315C0CC1AD070073837D /* tkCanvText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABD08F27A39005CB29B /* tkCanvText.c */; };
+ F9FD315D0CC1AD070073837D /* tkCanvUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABE08F27A39005CB29B /* tkCanvUtil.c */; };
+ F9FD315E0CC1AD070073837D /* tkCanvWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABF08F27A39005CB29B /* tkCanvWind.c */; };
+ F9FD315F0CC1AD070073837D /* tkClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC008F27A39005CB29B /* tkClipboard.c */; };
+ F9FD31600CC1AD070073837D /* tkCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC108F27A39005CB29B /* tkCmds.c */; };
+ F9FD31610CC1AD070073837D /* tkColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC208F27A39005CB29B /* tkColor.c */; };
+ F9FD31620CC1AD070073837D /* tkConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC408F27A39005CB29B /* tkConfig.c */; };
+ F9FD31630CC1AD070073837D /* tkConsole.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC508F27A39005CB29B /* tkConsole.c */; };
+ F9FD31640CC1AD070073837D /* tkCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC608F27A39005CB29B /* tkCursor.c */; };
+ F9FD31650CC1AD070073837D /* tkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC808F27A39005CB29B /* tkEntry.c */; };
+ F9FD31660CC1AD070073837D /* tkError.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACA08F27A39005CB29B /* tkError.c */; };
+ F9FD31670CC1AD070073837D /* tkEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACB08F27A39005CB29B /* tkEvent.c */; };
+ F9FD31680CC1AD070073837D /* tkFileFilter.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACC08F27A39005CB29B /* tkFileFilter.c */; };
+ F9FD31690CC1AD070073837D /* tkFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACE08F27A39005CB29B /* tkFocus.c */; };
+ F9FD316A0CC1AD070073837D /* tkFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACF08F27A39005CB29B /* tkFont.c */; };
+ F9FD316B0CC1AD070073837D /* tkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD108F27A39005CB29B /* tkFrame.c */; };
+ F9FD316C0CC1AD070073837D /* tkGC.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD208F27A39005CB29B /* tkGC.c */; };
+ F9FD316D0CC1AD070073837D /* tkGeometry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD308F27A39005CB29B /* tkGeometry.c */; };
+ F9FD316E0CC1AD070073837D /* tkGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD408F27A39005CB29B /* tkGet.c */; };
+ F9FD316F0CC1AD070073837D /* tkGrab.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD508F27A39005CB29B /* tkGrab.c */; };
+ F9FD31700CC1AD070073837D /* tkGrid.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD608F27A39005CB29B /* tkGrid.c */; };
+ F9FD31710CC1AD070073837D /* tkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD708F27A39005CB29B /* tkImage.c */; };
+ F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD808F27A39005CB29B /* tkImgBmap.c */; };
+ F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD908F27A39005CB29B /* tkImgGIF.c */; };
+ F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADA08F27A39005CB29B /* tkImgPhoto.c */; };
+ F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADB08F27A39005CB29B /* tkImgPPM.c */; };
+ F9FD31760CC1AD070073837D /* tkListbox.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE408F27A39005CB29B /* tkListbox.c */; };
+ F9FD31770CC1AD070073837D /* tkMacWinMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE508F27A39005CB29B /* tkMacWinMenu.c */; };
+ F9FD31780CC1AD070073837D /* tkMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE608F27A39005CB29B /* tkMain.c */; };
+ F9FD31790CC1AD070073837D /* tkMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE708F27A39005CB29B /* tkMenu.c */; };
+ F9FD317A0CC1AD070073837D /* tkMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE908F27A39005CB29B /* tkMenubutton.c */; };
+ F9FD317B0CC1AD070073837D /* tkMenuDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEB08F27A39005CB29B /* tkMenuDraw.c */; };
+ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; };
+ F9FD317D0CC1AD070073837D /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; };
+ F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; };
+ F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9FD31800CC1AD070073837D /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; };
+ F9FD31810CC1AD070073837D /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; };
+ F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; };
+ F9FD31830CC1AD070073837D /* tkPlace.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF208F27A39005CB29B /* tkPlace.c */; };
+ F9FD31850CC1AD070073837D /* tkRectOval.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF608F27A39005CB29B /* tkRectOval.c */; };
+ F9FD31860CC1AD070073837D /* tkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF708F27A39005CB29B /* tkScale.c */; };
+ F9FD31870CC1AD070073837D /* tkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF908F27A39005CB29B /* tkScrollbar.c */; };
+ F9FD31880CC1AD070073837D /* tkSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFB08F27A39005CB29B /* tkSelect.c */; };
+ F9FD31890CC1AD070073837D /* tkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFD08F27A39005CB29B /* tkSquare.c */; };
+ F9FD318A0CC1AD070073837D /* tkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFF08F27A39005CB29B /* tkStubInit.c */; };
+ F9FD318B0CC1AD070073837D /* tkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0008F27A39005CB29B /* tkStubLib.c */; };
+ F9FD318C0CC1AD070073837D /* tkStyle.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0108F27A39005CB29B /* tkStyle.c */; };
+ F9FD318D0CC1AD070073837D /* tkTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0208F27A39005CB29B /* tkTest.c */; };
+ F9FD318E0CC1AD070073837D /* tkText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0308F27A39005CB29B /* tkText.c */; };
+ F9FD318F0CC1AD070073837D /* tkTextBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0508F27A39005CB29B /* tkTextBTree.c */; };
+ F9FD31900CC1AD070073837D /* tkTextDisp.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0608F27A39005CB29B /* tkTextDisp.c */; };
+ F9FD31910CC1AD070073837D /* tkTextImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0808F27A39005CB29B /* tkTextImage.c */; };
+ F9FD31920CC1AD070073837D /* tkTextIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0908F27A39005CB29B /* tkTextIndex.c */; };
+ F9FD31930CC1AD070073837D /* tkTextMark.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0A08F27A39005CB29B /* tkTextMark.c */; };
+ F9FD31940CC1AD070073837D /* tkTextTag.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0B08F27A39005CB29B /* tkTextTag.c */; };
+ F9FD31950CC1AD070073837D /* tkTextWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0C08F27A39005CB29B /* tkTextWind.c */; };
+ F9FD31960CC1AD070073837D /* tkTrig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0D08F27A39005CB29B /* tkTrig.c */; };
+ F9FD31970CC1AD070073837D /* tkUndo.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0E08F27A39005CB29B /* tkUndo.c */; };
+ F9FD31980CC1AD070073837D /* tkUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1008F27A39005CB29B /* tkUtil.c */; };
+ F9FD31990CC1AD070073837D /* tkVisual.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1108F27A39005CB29B /* tkVisual.c */; };
+ F9FD319A0CC1AD070073837D /* tkWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1208F27A39005CB29B /* tkWindow.c */; };
+ F9FD319B0CC1AD070073837D /* ttkBlink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E10AF786D5000797B5 /* ttkBlink.c */; };
+ F9FD319C0CC1AD070073837D /* ttkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E20AF786D5000797B5 /* ttkButton.c */; };
+ F9FD319D0CC1AD070073837D /* ttkCache.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E30AF786D5000797B5 /* ttkCache.c */; };
+ F9FD319E0CC1AD070073837D /* ttkClamTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E40AF786D5000797B5 /* ttkClamTheme.c */; };
+ F9FD319F0CC1AD070073837D /* ttkClassicTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E50AF786D5000797B5 /* ttkClassicTheme.c */; };
+ F9FD31A00CC1AD070073837D /* ttkDefaultTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */; };
+ F9FD31A10CC1AD070073837D /* ttkElements.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E80AF786D5000797B5 /* ttkElements.c */; };
+ F9FD31A20CC1AD070073837D /* ttkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E90AF786D5000797B5 /* ttkEntry.c */; };
+ F9FD31A30CC1AD070073837D /* ttkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EA0AF786D5000797B5 /* ttkFrame.c */; };
+ F9FD31A40CC1AD070073837D /* ttkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EB0AF786D5000797B5 /* ttkImage.c */; };
+ F9FD31A50CC1AD070073837D /* ttkInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EC0AF786D5000797B5 /* ttkInit.c */; };
+ F9FD31A60CC1AD070073837D /* ttkLabel.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887ED0AF786D5000797B5 /* ttkLabel.c */; };
+ F9FD31A70CC1AD070073837D /* ttkLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EE0AF786D5000797B5 /* ttkLayout.c */; };
+ F9FD31A80CC1AD070073837D /* ttkManager.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EF0AF786D5000797B5 /* ttkManager.c */; };
+ F9FD31A90CC1AD070073837D /* ttkNotebook.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F10AF786D5000797B5 /* ttkNotebook.c */; };
+ F9FD31AA0CC1AD070073837D /* ttkPanedwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F20AF786D5000797B5 /* ttkPanedwindow.c */; };
+ F9FD31AB0CC1AD070073837D /* ttkProgress.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F30AF786D5000797B5 /* ttkProgress.c */; };
+ F9FD31AC0CC1AD070073837D /* ttkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F40AF786D5000797B5 /* ttkScale.c */; };
+ F9FD31AD0CC1AD070073837D /* ttkScroll.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F50AF786D5000797B5 /* ttkScroll.c */; };
+ F9FD31AE0CC1AD070073837D /* ttkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F60AF786D5000797B5 /* ttkScrollbar.c */; };
+ F9FD31AF0CC1AD070073837D /* ttkSeparator.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F70AF786D5000797B5 /* ttkSeparator.c */; };
+ F9FD31B00CC1AD070073837D /* ttkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F80AF786D5000797B5 /* ttkSquare.c */; };
+ F9FD31B10CC1AD070073837D /* ttkState.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F90AF786D5000797B5 /* ttkState.c */; };
+ F9FD31B20CC1AD070073837D /* ttkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FA0AF786D5000797B5 /* ttkStubInit.c */; };
+ F9FD31B30CC1AD070073837D /* ttkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FB0AF786D5000797B5 /* ttkStubLib.c */; };
+ F9FD31B40CC1AD070073837D /* ttkTagSet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FC0AF786D5000797B5 /* ttkTagSet.c */; };
+ F9FD31B50CC1AD070073837D /* ttkTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FD0AF786D5000797B5 /* ttkTheme.c */; };
+ F9FD31B60CC1AD070073837D /* ttkTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888000AF786D5000797B5 /* ttkTrace.c */; };
+ F9FD31B70CC1AD070073837D /* ttkTrack.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888010AF786D5000797B5 /* ttkTrack.c */; };
+ F9FD31B80CC1AD070073837D /* ttkTreeview.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888020AF786D5000797B5 /* ttkTreeview.c */; };
+ F9FD31B90CC1AD070073837D /* ttkWidget.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888030AF786D5000797B5 /* ttkWidget.c */; };
+ F9FD31DA0CC1AD070073837D /* tkAppInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7508F27A3D005CB29B /* tkAppInit.c */; settings = {COMPILER_FLAGS = "-DTK_TEST"; }; };
+ F9FD31DB0CC1AD070073837D /* tkUnix3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7908F27A3D005CB29B /* tkUnix3d.c */; };
+ F9FD31DC0CC1AD070073837D /* tkUnixScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8C08F27A3D005CB29B /* tkUnixScale.c */; };
+ F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */ = {isa = PBXBuildFile; fileRef = F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */; };
+ F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07408F2820D005CB29B /* CoreFoundation.framework */; };
+ F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */; };
+ F9FD31FA0CC1ADB70073837D /* tkUnixKey.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8708F27A3D005CB29B /* tkUnixKey.c */; };
+ F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC9108F27A3D005CB29B /* tkUnixXId.c */; };
+ F9FD31FC0CC1ADB70073837D /* tkUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8508F27A3D005CB29B /* tkUnixInit.c */; };
+ F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */; };
+ F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8F08F27A3D005CB29B /* tkUnixSend.c */; };
+ F9FD31FF0CC1ADB70073837D /* tkUnixFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8308F27A3D005CB29B /* tkUnixFocus.c */; };
+ F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC9008F27A3D005CB29B /* tkUnixWm.c */; };
+ F9FD32010CC1ADB70073837D /* tkUnixRFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */; };
+ F9FD32020CC1ADB70073837D /* tkUnix.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7808F27A3D005CB29B /* tkUnix.c */; };
+ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8808F27A3D005CB29B /* tkUnixMenu.c */; };
+ F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */; };
+ F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8008F27A3D005CB29B /* tkUnixDraw.c */; };
+ F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */; };
+ F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */; };
+ F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8208F27A3D005CB29B /* tkUnixEvent.c */; };
+ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7B08F27A3D005CB29B /* tkUnixColor.c */; };
+ F9FD320A0CC1ADB70073837D /* tkUnixButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7A08F27A3D005CB29B /* tkUnixButton.c */; };
+ F9FD320B0CC1ADB70073837D /* tkUnixMenubu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */; };
+ F9FD320C0CC1ADB70073837D /* tkUnixScrlbr.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */; };
+ F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32140CC1AF170073837D /* libX11.dylib */; };
+ F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32150CC1AF170073837D /* libXext.dylib */; };
+ F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32160CC1AF170073837D /* libXss.dylib */; };
+ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; };
+ F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; };
+ F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; };
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8DD76FB20486AB0100D96B5E /* tktest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tktest; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = "<group>"; };
+ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = "<group>"; };
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBusy.c; sourceTree = "<group>"; };
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchoose.tcl; sourceTree = "<group>"; };
+ F915432A0EF201CF0032D1E8 /* zlib.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = zlib.test; sourceTree = "<group>"; };
+ F915432D0EF201EE0032D1E8 /* zlib.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = zlib.n; sourceTree = "<group>"; };
+ F9183E640EFC80CD0030B814 /* throw.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = throw.n; sourceTree = "<group>"; };
+ F9183E650EFC80D70030B814 /* try.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = try.n; sourceTree = "<group>"; };
+ F9183E6A0EFC81560030B814 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F9183E8F0EFC817B0030B814 /* tdbc */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tdbc; sourceTree = "<group>"; };
+ F91DC23C0E44C51B002CB8D1 /* nre.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = nre.test; sourceTree = "<group>"; };
+ F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = "<group>"; };
+ F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = "<group>"; };
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = "<group>"; };
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhInstance.c; sourceTree = "<group>"; };
+ F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = "<group>"; };
+ F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = "<group>"; };
+ F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = "<group>"; };
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = "<group>"; };
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = "<group>"; };
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = "<group>"; };
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = "<group>"; };
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = "<group>"; };
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = "<group>"; };
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = "<group>"; };
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = "<group>"; };
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = "<group>"; };
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = "<group>"; };
+ F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = "<group>"; };
+ F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = "<group>"; };
+ F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = "<group>"; };
+ F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = "<group>"; };
+ F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = "<group>"; };
+ F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = "<group>"; };
+ F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = "<group>"; };
+ F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = "<group>"; };
+ F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = "<group>"; };
+ F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = "<group>"; };
+ F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = "<group>"; };
+ F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = "<group>"; };
+ F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = "<group>"; };
+ F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = "<group>"; };
+ F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
+ F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
+ F94523A10E6FC2AC00C1D987 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ F946FB8B0FBE3AED00CD6495 /* itcl */ = {isa = PBXFileReference; lastKnownFileType = folder; path = itcl; sourceTree = "<group>"; };
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = "<group>"; };
+ F95D8D4B0F1715610006B020 /* Tk.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Tk.icns; sourceTree = "<group>"; };
+ F95D8D4C0F1715610006B020 /* Tk.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Tk.tiff; sourceTree = "<group>"; };
+ F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
+ F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
+ F96437C90EF0D4B2003F468E /* tclZlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclZlib.c; sourceTree = "<group>"; };
+ F96437E60EF0D652003F468E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
+ F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
+ F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
+ F966BA0708F27A37005CB29B /* gray50.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray50.xbm; sourceTree = "<group>"; };
+ F966BA0808F27A37005CB29B /* gray75.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray75.xbm; sourceTree = "<group>"; };
+ F966BA0908F27A37005CB29B /* hourglass.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = hourglass.xbm; sourceTree = "<group>"; };
+ F966BA0A08F27A37005CB29B /* info.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = info.xbm; sourceTree = "<group>"; };
+ F966BA0B08F27A37005CB29B /* questhead.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = questhead.xbm; sourceTree = "<group>"; };
+ F966BA0C08F27A37005CB29B /* question.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = question.xbm; sourceTree = "<group>"; };
+ F966BA0D08F27A37005CB29B /* warning.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = warning.xbm; sourceTree = "<group>"; };
+ F966BA0E08F27A37005CB29B /* ChangeLog */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = ChangeLog; sourceTree = "<group>"; };
+ F966BA0F08F27A37005CB29B /* changes */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = changes; sourceTree = "<group>"; };
+ F966BA1108F27A37005CB29B /* 3DBorder.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = 3DBorder.3; sourceTree = "<group>"; };
+ F966BA1208F27A37005CB29B /* AddOption.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AddOption.3; sourceTree = "<group>"; };
+ F966BA1308F27A37005CB29B /* bell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bell.n; sourceTree = "<group>"; };
+ F966BA1408F27A37005CB29B /* bind.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bind.n; sourceTree = "<group>"; };
+ F966BA1508F27A37005CB29B /* BindTable.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BindTable.3; sourceTree = "<group>"; };
+ F966BA1608F27A37005CB29B /* bindtags.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bindtags.n; sourceTree = "<group>"; };
+ F966BA1708F27A37005CB29B /* bitmap.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bitmap.n; sourceTree = "<group>"; };
+ F966BA1808F27A37005CB29B /* button.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = button.n; sourceTree = "<group>"; };
+ F966BA1908F27A37005CB29B /* canvas.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = canvas.n; sourceTree = "<group>"; };
+ F966BA1A08F27A37005CB29B /* CanvPsY.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvPsY.3; sourceTree = "<group>"; };
+ F966BA1B08F27A37005CB29B /* CanvTkwin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvTkwin.3; sourceTree = "<group>"; };
+ F966BA1C08F27A37005CB29B /* CanvTxtInfo.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvTxtInfo.3; sourceTree = "<group>"; };
+ F966BA1D08F27A37005CB29B /* checkbutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = checkbutton.n; sourceTree = "<group>"; };
+ F966BA1E08F27A37005CB29B /* chooseColor.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chooseColor.n; sourceTree = "<group>"; };
+ F966BA1F08F27A37005CB29B /* chooseDirectory.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chooseDirectory.n; sourceTree = "<group>"; };
+ F966BA2008F27A37005CB29B /* Clipboard.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Clipboard.3; sourceTree = "<group>"; };
+ F966BA2108F27A37005CB29B /* clipboard.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = clipboard.n; sourceTree = "<group>"; };
+ F966BA2208F27A37005CB29B /* ClrSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ClrSelect.3; sourceTree = "<group>"; };
+ F966BA2308F27A37005CB29B /* colors.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = colors.n; sourceTree = "<group>"; };
+ F966BA2408F27A37005CB29B /* ConfigWidg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ConfigWidg.3; sourceTree = "<group>"; };
+ F966BA2508F27A37005CB29B /* ConfigWind.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ConfigWind.3; sourceTree = "<group>"; };
+ F966BA2608F27A37005CB29B /* console.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = console.n; sourceTree = "<group>"; };
+ F966BA2708F27A37005CB29B /* CoordToWin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CoordToWin.3; sourceTree = "<group>"; };
+ F966BA2808F27A37005CB29B /* CrtCmHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCmHdlr.3; sourceTree = "<group>"; };
+ F966BA2908F27A37005CB29B /* CrtErrHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtErrHdlr.3; sourceTree = "<group>"; };
+ F966BA2A08F27A37005CB29B /* CrtGenHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtGenHdlr.3; sourceTree = "<group>"; };
+ F966BA2B08F27A37005CB29B /* CrtImgType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtImgType.3; sourceTree = "<group>"; };
+ F966BA2C08F27A37005CB29B /* CrtItemType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtItemType.3; sourceTree = "<group>"; };
+ F966BA2D08F27A37005CB29B /* CrtPhImgFmt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtPhImgFmt.3; sourceTree = "<group>"; };
+ F966BA2E08F27A37005CB29B /* CrtSelHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtSelHdlr.3; sourceTree = "<group>"; };
+ F966BA2F08F27A37005CB29B /* CrtWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtWindow.3; sourceTree = "<group>"; };
+ F966BA3008F27A37005CB29B /* cursors.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = cursors.n; sourceTree = "<group>"; };
+ F966BA3108F27A37005CB29B /* DeleteImg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DeleteImg.3; sourceTree = "<group>"; };
+ F966BA3208F27A37005CB29B /* destroy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = destroy.n; sourceTree = "<group>"; };
+ F966BA3308F27A37005CB29B /* dialog.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dialog.n; sourceTree = "<group>"; };
+ F966BA3408F27A37005CB29B /* DrawFocHlt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DrawFocHlt.3; sourceTree = "<group>"; };
+ F966BA3508F27A37005CB29B /* entry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = entry.n; sourceTree = "<group>"; };
+ F966BA3608F27A37005CB29B /* event.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = event.n; sourceTree = "<group>"; };
+ F966BA3708F27A37005CB29B /* EventHndlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = EventHndlr.3; sourceTree = "<group>"; };
+ F966BA3808F27A37005CB29B /* FindPhoto.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FindPhoto.3; sourceTree = "<group>"; };
+ F966BA3908F27A37005CB29B /* focus.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = focus.n; sourceTree = "<group>"; };
+ F966BA3A08F27A37005CB29B /* focusNext.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = focusNext.n; sourceTree = "<group>"; };
+ F966BA3B08F27A37005CB29B /* font.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = font.n; sourceTree = "<group>"; };
+ F966BA3C08F27A37005CB29B /* FontId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FontId.3; sourceTree = "<group>"; };
+ F966BA3D08F27A37005CB29B /* frame.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = frame.n; sourceTree = "<group>"; };
+ F966BA3E08F27A37005CB29B /* FreeXId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FreeXId.3; sourceTree = "<group>"; };
+ F966BA3F08F27A37005CB29B /* GeomReq.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GeomReq.3; sourceTree = "<group>"; };
+ F966BA4008F27A37005CB29B /* GetAnchor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetAnchor.3; sourceTree = "<group>"; };
+ F966BA4108F27A37005CB29B /* GetBitmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetBitmap.3; sourceTree = "<group>"; };
+ F966BA4208F27A37005CB29B /* GetCapStyl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCapStyl.3; sourceTree = "<group>"; };
+ F966BA4308F27A37005CB29B /* GetClrmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetClrmap.3; sourceTree = "<group>"; };
+ F966BA4408F27A37005CB29B /* GetColor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetColor.3; sourceTree = "<group>"; };
+ F966BA4508F27A37005CB29B /* GetCursor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCursor.3; sourceTree = "<group>"; };
+ F966BA4608F27A37005CB29B /* GetDash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetDash.3; sourceTree = "<group>"; };
+ F966BA4708F27A37005CB29B /* GetFont.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetFont.3; sourceTree = "<group>"; };
+ F966BA4808F27A37005CB29B /* GetGC.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetGC.3; sourceTree = "<group>"; };
+ F966BA4908F27A37005CB29B /* GetHINSTANCE.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHINSTANCE.3; sourceTree = "<group>"; };
+ F966BA4A08F27A37005CB29B /* GetHWND.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHWND.3; sourceTree = "<group>"; };
+ F966BA4B08F27A37005CB29B /* GetImage.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetImage.3; sourceTree = "<group>"; };
+ F966BA4C08F27A37005CB29B /* GetJoinStl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetJoinStl.3; sourceTree = "<group>"; };
+ F966BA4D08F27A37005CB29B /* GetJustify.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetJustify.3; sourceTree = "<group>"; };
+ F966BA4E08F27A37005CB29B /* getOpenFile.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = getOpenFile.n; sourceTree = "<group>"; };
+ F966BA4F08F27A37005CB29B /* GetOption.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetOption.3; sourceTree = "<group>"; };
+ F966BA5008F27A38005CB29B /* GetPixels.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetPixels.3; sourceTree = "<group>"; };
+ F966BA5108F27A38005CB29B /* GetPixmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetPixmap.3; sourceTree = "<group>"; };
+ F966BA5208F27A38005CB29B /* GetRelief.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetRelief.3; sourceTree = "<group>"; };
+ F966BA5308F27A38005CB29B /* GetRootCrd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetRootCrd.3; sourceTree = "<group>"; };
+ F966BA5408F27A38005CB29B /* GetScroll.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetScroll.3; sourceTree = "<group>"; };
+ F966BA5508F27A38005CB29B /* GetSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetSelect.3; sourceTree = "<group>"; };
+ F966BA5608F27A38005CB29B /* GetUid.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetUid.3; sourceTree = "<group>"; };
+ F966BA5708F27A38005CB29B /* GetVisual.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVisual.3; sourceTree = "<group>"; };
+ F966BA5808F27A38005CB29B /* GetVRoot.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVRoot.3; sourceTree = "<group>"; };
+ F966BA5908F27A38005CB29B /* Grab.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Grab.3; sourceTree = "<group>"; };
+ F966BA5A08F27A38005CB29B /* grab.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = grab.n; sourceTree = "<group>"; };
+ F966BA5B08F27A38005CB29B /* grid.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = grid.n; sourceTree = "<group>"; };
+ F966BA5C08F27A38005CB29B /* HandleEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = HandleEvent.3; sourceTree = "<group>"; };
+ F966BA5D08F27A38005CB29B /* HWNDToWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = HWNDToWindow.3; sourceTree = "<group>"; };
+ F966BA5E08F27A38005CB29B /* IdToWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = IdToWindow.3; sourceTree = "<group>"; };
+ F966BA5F08F27A38005CB29B /* image.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = image.n; sourceTree = "<group>"; };
+ F966BA6008F27A38005CB29B /* ImgChanged.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ImgChanged.3; sourceTree = "<group>"; };
+ F966BA6108F27A38005CB29B /* Inactive.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Inactive.3; sourceTree = "<group>"; };
+ F966BA6208F27A38005CB29B /* InternAtom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = InternAtom.3; sourceTree = "<group>"; };
+ F966BA6308F27A38005CB29B /* keysyms.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = keysyms.n; sourceTree = "<group>"; };
+ F966BA6408F27A38005CB29B /* label.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = label.n; sourceTree = "<group>"; };
+ F966BA6508F27A38005CB29B /* labelframe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = labelframe.n; sourceTree = "<group>"; };
+ F966BA6608F27A38005CB29B /* listbox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = listbox.n; sourceTree = "<group>"; };
+ F966BA6708F27A38005CB29B /* loadTk.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = loadTk.n; sourceTree = "<group>"; };
+ F966BA6808F27A38005CB29B /* lower.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lower.n; sourceTree = "<group>"; };
+ F966BA6908F27A38005CB29B /* MainLoop.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MainLoop.3; sourceTree = "<group>"; };
+ F966BA6A08F27A38005CB29B /* MaintGeom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MaintGeom.3; sourceTree = "<group>"; };
+ F966BA6B08F27A38005CB29B /* MainWin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MainWin.3; sourceTree = "<group>"; };
+ F966BA6D08F27A38005CB29B /* ManageGeom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ManageGeom.3; sourceTree = "<group>"; };
+ F966BA6E08F27A38005CB29B /* MapWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MapWindow.3; sourceTree = "<group>"; };
+ F966BA6F08F27A38005CB29B /* MeasureChar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MeasureChar.3; sourceTree = "<group>"; };
+ F966BA7008F27A38005CB29B /* menu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menu.n; sourceTree = "<group>"; };
+ F966BA7108F27A38005CB29B /* menubar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubar.n; sourceTree = "<group>"; };
+ F966BA7208F27A38005CB29B /* menubutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubutton.n; sourceTree = "<group>"; };
+ F966BA7308F27A38005CB29B /* message.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = message.n; sourceTree = "<group>"; };
+ F966BA7408F27A38005CB29B /* messageBox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = messageBox.n; sourceTree = "<group>"; };
+ F966BA7508F27A38005CB29B /* MoveToplev.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MoveToplev.3; sourceTree = "<group>"; };
+ F966BA7608F27A38005CB29B /* Name.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Name.3; sourceTree = "<group>"; };
+ F966BA7708F27A38005CB29B /* NameOfImg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = NameOfImg.3; sourceTree = "<group>"; };
+ F966BA7808F27A38005CB29B /* option.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = option.n; sourceTree = "<group>"; };
+ F966BA7908F27A38005CB29B /* optionMenu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = optionMenu.n; sourceTree = "<group>"; };
+ F966BA7A08F27A38005CB29B /* options.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = options.n; sourceTree = "<group>"; };
+ F966BA7B08F27A38005CB29B /* OwnSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OwnSelect.3; sourceTree = "<group>"; };
+ F966BA7C08F27A38005CB29B /* pack-old.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = "pack-old.n"; sourceTree = "<group>"; };
+ F966BA7D08F27A38005CB29B /* pack.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pack.n; sourceTree = "<group>"; };
+ F966BA7E08F27A38005CB29B /* palette.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = palette.n; sourceTree = "<group>"; };
+ F966BA7F08F27A38005CB29B /* panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = panedwindow.n; sourceTree = "<group>"; };
+ F966BA8008F27A38005CB29B /* ParseArgv.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ParseArgv.3; sourceTree = "<group>"; };
+ F966BA8108F27A38005CB29B /* photo.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = photo.n; sourceTree = "<group>"; };
+ F966BA8208F27A38005CB29B /* place.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = place.n; sourceTree = "<group>"; };
+ F966BA8308F27A38005CB29B /* popup.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = popup.n; sourceTree = "<group>"; };
+ F966BA8408F27A38005CB29B /* QWinEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = QWinEvent.3; sourceTree = "<group>"; };
+ F966BA8508F27A38005CB29B /* radiobutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = radiobutton.n; sourceTree = "<group>"; };
+ F966BA8608F27A38005CB29B /* raise.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = raise.n; sourceTree = "<group>"; };
+ F966BA8708F27A38005CB29B /* Restack.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Restack.3; sourceTree = "<group>"; };
+ F966BA8808F27A38005CB29B /* RestrictEv.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RestrictEv.3; sourceTree = "<group>"; };
+ F966BA8908F27A38005CB29B /* scale.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scale.n; sourceTree = "<group>"; };
+ F966BA8A08F27A38005CB29B /* scrollbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scrollbar.n; sourceTree = "<group>"; };
+ F966BA8B08F27A38005CB29B /* selection.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = selection.n; sourceTree = "<group>"; };
+ F966BA8C08F27A38005CB29B /* send.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = send.n; sourceTree = "<group>"; };
+ F966BA8D08F27A38005CB29B /* SetAppName.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetAppName.3; sourceTree = "<group>"; };
+ F966BA8E08F27A38005CB29B /* SetCaret.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetCaret.3; sourceTree = "<group>"; };
+ F966BA8F08F27A38005CB29B /* SetClass.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetClass.3; sourceTree = "<group>"; };
+ F966BA9008F27A38005CB29B /* SetClassProcs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetClassProcs.3; sourceTree = "<group>"; };
+ F966BA9108F27A38005CB29B /* SetGrid.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetGrid.3; sourceTree = "<group>"; };
+ F966BA9208F27A38005CB29B /* SetOptions.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetOptions.3; sourceTree = "<group>"; };
+ F966BA9308F27A38005CB29B /* SetVisual.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetVisual.3; sourceTree = "<group>"; };
+ F966BA9408F27A38005CB29B /* spinbox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = spinbox.n; sourceTree = "<group>"; };
+ F966BA9508F27A38005CB29B /* StrictMotif.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StrictMotif.3; sourceTree = "<group>"; };
+ F966BA9608F27A38005CB29B /* text.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = text.n; sourceTree = "<group>"; };
+ F966BA9708F27A38005CB29B /* TextLayout.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TextLayout.3; sourceTree = "<group>"; };
+ F966BA9808F27A38005CB29B /* tk.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tk.n; sourceTree = "<group>"; };
+ F966BA9A08F27A38005CB29B /* Tk_Init.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tk_Init.3; sourceTree = "<group>"; };
+ F966BA9B08F27A38005CB29B /* Tk_Main.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tk_Main.3; sourceTree = "<group>"; };
+ F966BA9C08F27A38005CB29B /* tkerror.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkerror.n; sourceTree = "<group>"; };
+ F966BA9D08F27A38005CB29B /* TkInitStubs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TkInitStubs.3; sourceTree = "<group>"; };
+ F966BA9E08F27A38005CB29B /* tkvars.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkvars.n; sourceTree = "<group>"; };
+ F966BA9F08F27A38005CB29B /* tkwait.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkwait.n; sourceTree = "<group>"; };
+ F966BAA008F27A38005CB29B /* toplevel.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = toplevel.n; sourceTree = "<group>"; };
+ F966BAA108F27A38005CB29B /* WindowId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = WindowId.3; sourceTree = "<group>"; };
+ F966BAA208F27A38005CB29B /* winfo.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = winfo.n; sourceTree = "<group>"; };
+ F966BAA308F27A38005CB29B /* wish.1 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wish.1; sourceTree = "<group>"; };
+ F966BAA408F27A38005CB29B /* wm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wm.n; sourceTree = "<group>"; };
+ F966BAA608F27A38005CB29B /* default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default.h; sourceTree = "<group>"; };
+ F966BAA708F27A38005CB29B /* ks_names.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ks_names.h; sourceTree = "<group>"; };
+ F966BAA908F27A39005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BAAA08F27A39005CB29B /* tk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.decls; sourceTree = "<group>"; };
+ F966BAAB08F27A39005CB29B /* tk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk.h; sourceTree = "<group>"; };
+ F966BAAC08F27A39005CB29B /* tk3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tk3d.c; sourceTree = "<group>"; };
+ F966BAAD08F27A39005CB29B /* tk3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk3d.h; sourceTree = "<group>"; };
+ F966BAAE08F27A39005CB29B /* tkArgv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkArgv.c; sourceTree = "<group>"; };
+ F966BAAF08F27A39005CB29B /* tkAtom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkAtom.c; sourceTree = "<group>"; };
+ F966BAB008F27A39005CB29B /* tkBind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBind.c; sourceTree = "<group>"; };
+ F966BAB108F27A39005CB29B /* tkBitmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBitmap.c; sourceTree = "<group>"; };
+ F966BAB208F27A39005CB29B /* tkButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkButton.c; sourceTree = "<group>"; };
+ F966BAB308F27A39005CB29B /* tkButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkButton.h; sourceTree = "<group>"; };
+ F966BAB408F27A39005CB29B /* tkCanvArc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvArc.c; sourceTree = "<group>"; };
+ F966BAB508F27A39005CB29B /* tkCanvas.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvas.c; sourceTree = "<group>"; };
+ F966BAB608F27A39005CB29B /* tkCanvas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkCanvas.h; sourceTree = "<group>"; };
+ F966BAB708F27A39005CB29B /* tkCanvBmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvBmap.c; sourceTree = "<group>"; };
+ F966BAB808F27A39005CB29B /* tkCanvImg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvImg.c; sourceTree = "<group>"; };
+ F966BAB908F27A39005CB29B /* tkCanvLine.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvLine.c; sourceTree = "<group>"; };
+ F966BABA08F27A39005CB29B /* tkCanvPoly.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvPoly.c; sourceTree = "<group>"; };
+ F966BABB08F27A39005CB29B /* tkCanvPs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvPs.c; sourceTree = "<group>"; };
+ F966BABD08F27A39005CB29B /* tkCanvText.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvText.c; sourceTree = "<group>"; };
+ F966BABE08F27A39005CB29B /* tkCanvUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvUtil.c; sourceTree = "<group>"; };
+ F966BABF08F27A39005CB29B /* tkCanvWind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvWind.c; sourceTree = "<group>"; };
+ F966BAC008F27A39005CB29B /* tkClipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkClipboard.c; sourceTree = "<group>"; };
+ F966BAC108F27A39005CB29B /* tkCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCmds.c; sourceTree = "<group>"; };
+ F966BAC208F27A39005CB29B /* tkColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkColor.c; sourceTree = "<group>"; };
+ F966BAC308F27A39005CB29B /* tkColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkColor.h; sourceTree = "<group>"; };
+ F966BAC408F27A39005CB29B /* tkConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkConfig.c; sourceTree = "<group>"; };
+ F966BAC508F27A39005CB29B /* tkConsole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkConsole.c; sourceTree = "<group>"; };
+ F966BAC608F27A39005CB29B /* tkCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCursor.c; sourceTree = "<group>"; };
+ F966BAC708F27A39005CB29B /* tkDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkDecls.h; sourceTree = "<group>"; };
+ F966BAC808F27A39005CB29B /* tkEntry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkEntry.c; sourceTree = "<group>"; };
+ F966BAC908F27A39005CB29B /* tkEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkEntry.h; sourceTree = "<group>"; };
+ F966BACA08F27A39005CB29B /* tkError.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkError.c; sourceTree = "<group>"; };
+ F966BACB08F27A39005CB29B /* tkEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkEvent.c; sourceTree = "<group>"; };
+ F966BACC08F27A39005CB29B /* tkFileFilter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFileFilter.c; sourceTree = "<group>"; };
+ F966BACD08F27A39005CB29B /* tkFileFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkFileFilter.h; sourceTree = "<group>"; };
+ F966BACE08F27A39005CB29B /* tkFocus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFocus.c; sourceTree = "<group>"; };
+ F966BACF08F27A39005CB29B /* tkFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFont.c; sourceTree = "<group>"; };
+ F966BAD008F27A39005CB29B /* tkFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkFont.h; sourceTree = "<group>"; };
+ F966BAD108F27A39005CB29B /* tkFrame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFrame.c; sourceTree = "<group>"; };
+ F966BAD208F27A39005CB29B /* tkGC.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGC.c; sourceTree = "<group>"; };
+ F966BAD308F27A39005CB29B /* tkGeometry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGeometry.c; sourceTree = "<group>"; };
+ F966BAD408F27A39005CB29B /* tkGet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGet.c; sourceTree = "<group>"; };
+ F966BAD508F27A39005CB29B /* tkGrab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGrab.c; sourceTree = "<group>"; };
+ F966BAD608F27A39005CB29B /* tkGrid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGrid.c; sourceTree = "<group>"; };
+ F966BAD708F27A39005CB29B /* tkImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImage.c; sourceTree = "<group>"; };
+ F966BAD808F27A39005CB29B /* tkImgBmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgBmap.c; sourceTree = "<group>"; };
+ F966BAD908F27A39005CB29B /* tkImgGIF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgGIF.c; sourceTree = "<group>"; };
+ F966BADA08F27A39005CB29B /* tkImgPhoto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhoto.c; sourceTree = "<group>"; };
+ F966BADB08F27A39005CB29B /* tkImgPPM.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPPM.c; sourceTree = "<group>"; };
+ F966BADC08F27A39005CB29B /* tkImgUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgUtil.c; sourceTree = "<group>"; };
+ F966BADE08F27A39005CB29B /* tkInt.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkInt.decls; sourceTree = "<group>"; };
+ F966BADF08F27A39005CB29B /* tkInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkInt.h; sourceTree = "<group>"; };
+ F966BAE108F27A39005CB29B /* tkIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntDecls.h; sourceTree = "<group>"; };
+ F966BAE208F27A39005CB29B /* tkIntPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntPlatDecls.h; sourceTree = "<group>"; };
+ F966BAE308F27A39005CB29B /* tkIntXlibDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntXlibDecls.h; sourceTree = "<group>"; };
+ F966BAE408F27A39005CB29B /* tkListbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkListbox.c; sourceTree = "<group>"; };
+ F966BAE508F27A39005CB29B /* tkMacWinMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMacWinMenu.c; sourceTree = "<group>"; };
+ F966BAE608F27A39005CB29B /* tkMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMain.c; sourceTree = "<group>"; };
+ F966BAE708F27A39005CB29B /* tkMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenu.c; sourceTree = "<group>"; };
+ F966BAE808F27A39005CB29B /* tkMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMenu.h; sourceTree = "<group>"; };
+ F966BAE908F27A39005CB29B /* tkMenubutton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenubutton.c; sourceTree = "<group>"; };
+ F966BAEA08F27A39005CB29B /* tkMenubutton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMenubutton.h; sourceTree = "<group>"; };
+ F966BAEB08F27A39005CB29B /* tkMenuDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenuDraw.c; sourceTree = "<group>"; };
+ F966BAEC08F27A39005CB29B /* tkMessage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMessage.c; sourceTree = "<group>"; };
+ F966BAED08F27A39005CB29B /* tkObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkObj.c; sourceTree = "<group>"; };
+ F966BAEE08F27A39005CB29B /* tkOldConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldConfig.c; sourceTree = "<group>"; };
+ F966BAEF08F27A39005CB29B /* tkOption.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOption.c; sourceTree = "<group>"; };
+ F966BAF008F27A39005CB29B /* tkPack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPack.c; sourceTree = "<group>"; };
+ F966BAF108F27A39005CB29B /* tkPanedWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPanedWindow.c; sourceTree = "<group>"; };
+ F966BAF208F27A39005CB29B /* tkPlace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPlace.c; sourceTree = "<group>"; };
+ F966BAF308F27A39005CB29B /* tkPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkPlatDecls.h; sourceTree = "<group>"; };
+ F966BAF408F27A39005CB29B /* tkPointer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPointer.c; sourceTree = "<group>"; };
+ F966BAF508F27A39005CB29B /* tkPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkPort.h; sourceTree = "<group>"; };
+ F966BAF608F27A39005CB29B /* tkRectOval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkRectOval.c; sourceTree = "<group>"; };
+ F966BAF708F27A39005CB29B /* tkScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkScale.c; sourceTree = "<group>"; };
+ F966BAF808F27A39005CB29B /* tkScale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkScale.h; sourceTree = "<group>"; };
+ F966BAF908F27A39005CB29B /* tkScrollbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkScrollbar.c; sourceTree = "<group>"; };
+ F966BAFA08F27A39005CB29B /* tkScrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkScrollbar.h; sourceTree = "<group>"; };
+ F966BAFB08F27A39005CB29B /* tkSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSelect.c; sourceTree = "<group>"; };
+ F966BAFC08F27A39005CB29B /* tkSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkSelect.h; sourceTree = "<group>"; };
+ F966BAFD08F27A39005CB29B /* tkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSquare.c; sourceTree = "<group>"; };
+ F966BAFE08F27A39005CB29B /* tkOldTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldTest.c; sourceTree = "<group>"; };
+ F966BAFF08F27A39005CB29B /* tkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubInit.c; sourceTree = "<group>"; };
+ F966BB0008F27A39005CB29B /* tkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubLib.c; sourceTree = "<group>"; };
+ F966BB0108F27A39005CB29B /* tkStyle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStyle.c; sourceTree = "<group>"; };
+ F966BB0208F27A39005CB29B /* tkTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTest.c; sourceTree = "<group>"; };
+ F966BB0308F27A39005CB29B /* tkText.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkText.c; sourceTree = "<group>"; };
+ F966BB0408F27A39005CB29B /* tkText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkText.h; sourceTree = "<group>"; };
+ F966BB0508F27A39005CB29B /* tkTextBTree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextBTree.c; sourceTree = "<group>"; };
+ F966BB0608F27A39005CB29B /* tkTextDisp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextDisp.c; sourceTree = "<group>"; };
+ F966BB0808F27A39005CB29B /* tkTextImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextImage.c; sourceTree = "<group>"; };
+ F966BB0908F27A39005CB29B /* tkTextIndex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextIndex.c; sourceTree = "<group>"; };
+ F966BB0A08F27A39005CB29B /* tkTextMark.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextMark.c; sourceTree = "<group>"; };
+ F966BB0B08F27A39005CB29B /* tkTextTag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextTag.c; sourceTree = "<group>"; };
+ F966BB0C08F27A39005CB29B /* tkTextWind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextWind.c; sourceTree = "<group>"; };
+ F966BB0D08F27A39005CB29B /* tkTrig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTrig.c; sourceTree = "<group>"; };
+ F966BB0E08F27A39005CB29B /* tkUndo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUndo.c; sourceTree = "<group>"; };
+ F966BB0F08F27A39005CB29B /* tkUndo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUndo.h; sourceTree = "<group>"; };
+ F966BB1008F27A39005CB29B /* tkUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUtil.c; sourceTree = "<group>"; };
+ F966BB1108F27A39005CB29B /* tkVisual.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkVisual.c; sourceTree = "<group>"; };
+ F966BB1208F27A39005CB29B /* tkWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWindow.c; sourceTree = "<group>"; };
+ F966BB1408F27A39005CB29B /* bgerror.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bgerror.tcl; sourceTree = "<group>"; };
+ F966BB1508F27A39005CB29B /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F966BB1608F27A39005CB29B /* choosedir.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = choosedir.tcl; sourceTree = "<group>"; };
+ F966BB1708F27A39005CB29B /* clrpick.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.tcl; sourceTree = "<group>"; };
+ F966BB1808F27A39005CB29B /* comdlg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = comdlg.tcl; sourceTree = "<group>"; };
+ F966BB1908F27A39005CB29B /* console.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = console.tcl; sourceTree = "<group>"; };
+ F966BB1B08F27A39005CB29B /* anilabel.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = anilabel.tcl; sourceTree = "<group>"; };
+ F966BB1C08F27A39005CB29B /* aniwave.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = aniwave.tcl; sourceTree = "<group>"; };
+ F966BB1D08F27A39005CB29B /* arrow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = arrow.tcl; sourceTree = "<group>"; };
+ F966BB1E08F27A39005CB29B /* bind.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bind.tcl; sourceTree = "<group>"; };
+ F966BB1F08F27A39005CB29B /* bitmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bitmap.tcl; sourceTree = "<group>"; };
+ F966BB2008F27A39005CB29B /* browse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = browse; sourceTree = "<group>"; };
+ F966BB2108F27A39005CB29B /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F966BB2208F27A39005CB29B /* check.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = check.tcl; sourceTree = "<group>"; };
+ F966BB2308F27A39005CB29B /* clrpick.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.tcl; sourceTree = "<group>"; };
+ F966BB2408F27A39005CB29B /* colors.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = colors.tcl; sourceTree = "<group>"; };
+ F966BB2508F27A39005CB29B /* cscroll.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cscroll.tcl; sourceTree = "<group>"; };
+ F966BB2608F27A39005CB29B /* ctext.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ctext.tcl; sourceTree = "<group>"; };
+ F966BB2708F27A39005CB29B /* dialog1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog1.tcl; sourceTree = "<group>"; };
+ F966BB2808F27A39005CB29B /* dialog2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog2.tcl; sourceTree = "<group>"; };
+ F966BB2A08F27A39005CB29B /* entry1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry1.tcl; sourceTree = "<group>"; };
+ F966BB2B08F27A39005CB29B /* entry2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry2.tcl; sourceTree = "<group>"; };
+ F966BB2C08F27A39005CB29B /* entry3.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry3.tcl; sourceTree = "<group>"; };
+ F966BB2D08F27A39005CB29B /* filebox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = filebox.tcl; sourceTree = "<group>"; };
+ F966BB2E08F27A39005CB29B /* floor.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = floor.tcl; sourceTree = "<group>"; };
+ F966BB2F08F27A39005CB29B /* form.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = form.tcl; sourceTree = "<group>"; };
+ F966BB3008F27A39005CB29B /* goldberg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = goldberg.tcl; sourceTree = "<group>"; };
+ F966BB3108F27A39005CB29B /* hello */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = hello; sourceTree = "<group>"; };
+ F966BB3208F27A39005CB29B /* hscale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = hscale.tcl; sourceTree = "<group>"; };
+ F966BB3308F27A39005CB29B /* icon.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = icon.tcl; sourceTree = "<group>"; };
+ F966BB3408F27A39005CB29B /* image1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image1.tcl; sourceTree = "<group>"; };
+ F966BB3508F27A39005CB29B /* image2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image2.tcl; sourceTree = "<group>"; };
+ F966BB4208F27A3A005CB29B /* items.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = items.tcl; sourceTree = "<group>"; };
+ F966BB4308F27A3A005CB29B /* ixset */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ixset; sourceTree = "<group>"; };
+ F966BB4408F27A3A005CB29B /* label.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = label.tcl; sourceTree = "<group>"; };
+ F966BB4508F27A3A005CB29B /* labelframe.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = labelframe.tcl; sourceTree = "<group>"; };
+ F966BB4608F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; };
+ F966BB4708F27A3A005CB29B /* menubu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubu.tcl; sourceTree = "<group>"; };
+ F966BB4808F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; };
+ F966BB4A08F27A3A005CB29B /* paned1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = paned1.tcl; sourceTree = "<group>"; };
+ F966BB4B08F27A3A005CB29B /* paned2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = paned2.tcl; sourceTree = "<group>"; };
+ F966BB4C08F27A3A005CB29B /* pendulum.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pendulum.tcl; sourceTree = "<group>"; };
+ F966BB4D08F27A3A005CB29B /* plot.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = plot.tcl; sourceTree = "<group>"; };
+ F966BB4E08F27A3A005CB29B /* puzzle.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = puzzle.tcl; sourceTree = "<group>"; };
+ F966BB4F08F27A3A005CB29B /* radio.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = radio.tcl; sourceTree = "<group>"; };
+ F966BB5008F27A3A005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BB5108F27A3A005CB29B /* rmt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = rmt; sourceTree = "<group>"; };
+ F966BB5208F27A3A005CB29B /* rolodex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = rolodex; sourceTree = "<group>"; };
+ F966BB5308F27A3A005CB29B /* ruler.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ruler.tcl; sourceTree = "<group>"; };
+ F966BB5408F27A3A005CB29B /* sayings.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = sayings.tcl; sourceTree = "<group>"; };
+ F966BB5508F27A3A005CB29B /* search.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = search.tcl; sourceTree = "<group>"; };
+ F966BB5608F27A3A005CB29B /* spin.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spin.tcl; sourceTree = "<group>"; };
+ F966BB5708F27A3A005CB29B /* square */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = square; sourceTree = "<group>"; };
+ F966BB5808F27A3A005CB29B /* states.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = states.tcl; sourceTree = "<group>"; };
+ F966BB5908F27A3A005CB29B /* style.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = style.tcl; sourceTree = "<group>"; };
+ F966BB5A08F27A3A005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F966BB5B08F27A3A005CB29B /* tcolor */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = tcolor; sourceTree = "<group>"; };
+ F966BB5C08F27A3A005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; };
+ F966BB5D08F27A3A005CB29B /* timer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = timer; sourceTree = "<group>"; };
+ F966BB5E08F27A3A005CB29B /* twind.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = twind.tcl; sourceTree = "<group>"; };
+ F966BB5F08F27A3A005CB29B /* unicodeout.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unicodeout.tcl; sourceTree = "<group>"; };
+ F966BB6008F27A3A005CB29B /* vscale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vscale.tcl; sourceTree = "<group>"; };
+ F966BB6108F27A3A005CB29B /* widget */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = widget; sourceTree = "<group>"; };
+ F966BB6208F27A3A005CB29B /* dialog.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.tcl; sourceTree = "<group>"; };
+ F966BB6308F27A3A005CB29B /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; };
+ F966BB6408F27A3A005CB29B /* focus.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.tcl; sourceTree = "<group>"; };
+ F966BB7308F27A3A005CB29B /* listbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.tcl; sourceTree = "<group>"; };
+ F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; };
+ F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = "<group>"; };
+ F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; };
+ F966BB8608F27A3A005CB29B /* obsolete.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obsolete.tcl; sourceTree = "<group>"; };
+ F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; };
+ F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; };
+ F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
+ F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; };
+ F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
+ F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; };
+ F966BB8E08F27A3B005CB29B /* spinbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.tcl; sourceTree = "<group>"; };
+ F966BB8F08F27A3B005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F966BB9008F27A3B005CB29B /* tearoff.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tearoff.tcl; sourceTree = "<group>"; };
+ F966BB9108F27A3B005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; };
+ F966BB9208F27A3B005CB29B /* tk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.tcl; sourceTree = "<group>"; };
+ F966BB9308F27A3B005CB29B /* tkfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkfbox.tcl; sourceTree = "<group>"; };
+ F966BB9408F27A3B005CB29B /* unsupported.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unsupported.tcl; sourceTree = "<group>"; };
+ F966BB9508F27A3B005CB29B /* xmfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.tcl; sourceTree = "<group>"; };
+ F966BB9608F27A3B005CB29B /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; };
+ F966BBBA08F27A3B005CB29B /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; };
+ F966BBBB08F27A3B005CB29B /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; };
+ F966BBBE08F27A3B005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tk-Info.plist.in"; sourceTree = "<group>"; };
+ F966BBC208F27A3B005CB29B /* tkMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSX.h; sourceTree = "<group>"; };
+ F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXBitmap.c; sourceTree = "<group>"; };
+ F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXButton.c; sourceTree = "<group>"; };
+ F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXClipboard.c; sourceTree = "<group>"; };
+ F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXColor.c; sourceTree = "<group>"; };
+ F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXConfig.c; sourceTree = "<group>"; };
+ F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXCursor.c; sourceTree = "<group>"; };
+ F966BBCC08F27A3B005CB29B /* tkMacOSXCursors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXCursors.h; sourceTree = "<group>"; };
+ F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDebug.c; sourceTree = "<group>"; };
+ F966BBCE08F27A3B005CB29B /* tkMacOSXDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXDebug.h; sourceTree = "<group>"; };
+ F966BBCF08F27A3B005CB29B /* tkMacOSXDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXDefault.h; sourceTree = "<group>"; };
+ F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDialog.c; sourceTree = "<group>"; };
+ F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDraw.c; sourceTree = "<group>"; };
+ F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEmbed.c; sourceTree = "<group>"; };
+ F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEntry.c; sourceTree = "<group>"; };
+ F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEvent.c; sourceTree = "<group>"; };
+ F966BBD508F27A3B005CB29B /* tkMacOSXEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXEvent.h; sourceTree = "<group>"; };
+ F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXFont.c; sourceTree = "<group>"; };
+ F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXHLEvents.c; sourceTree = "<group>"; };
+ F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXInit.c; sourceTree = "<group>"; };
+ F966BBDA08F27A3B005CB29B /* tkMacOSXInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXInt.h; sourceTree = "<group>"; };
+ F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXKeyboard.c; sourceTree = "<group>"; };
+ F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXKeyEvent.c; sourceTree = "<group>"; };
+ F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenu.c; sourceTree = "<group>"; };
+ F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenubutton.c; sourceTree = "<group>"; };
+ F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenus.c; sourceTree = "<group>"; };
+ F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMouseEvent.c; sourceTree = "<group>"; };
+ F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXNotify.c; sourceTree = "<group>"; };
+ F966BBEA08F27A3C005CB29B /* tkMacOSXPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPort.h; sourceTree = "<group>"; };
+ F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXRegion.c; sourceTree = "<group>"; };
+ F966BBEC08F27A3C005CB29B /* tkMacOSXScale.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXScale.c; sourceTree = "<group>"; };
+ F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXScrlbr.c; sourceTree = "<group>"; };
+ F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXSend.c; sourceTree = "<group>"; };
+ F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXSubwindows.c; sourceTree = "<group>"; };
+ F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXTest.c; sourceTree = "<group>"; };
+ F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXWindowEvent.c; sourceTree = "<group>"; };
+ F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXWm.c; sourceTree = "<group>"; };
+ F966BBF308F27A3C005CB29B /* tkMacOSXWm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXWm.h; sourceTree = "<group>"; };
+ F966BBF408F27A3C005CB29B /* tkMacOSXXCursors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXXCursors.h; sourceTree = "<group>"; };
+ F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXXStubs.c; sourceTree = "<group>"; };
+ F966BBF708F27A3C005CB29B /* Wish-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Wish-Info.plist.in"; sourceTree = "<group>"; };
+ F966BC0308F27A3C005CB29B /* README */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = README; sourceTree = "<group>"; };
+ F966BC0508F27A3C005CB29B /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F966BC0608F27A3C005CB29B /* arc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = arc.tcl; sourceTree = "<group>"; };
+ F966BC0708F27A3C005CB29B /* bell.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bell.test; sourceTree = "<group>"; };
+ F966BC0808F27A3C005CB29B /* bevel.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bevel.tcl; sourceTree = "<group>"; };
+ F966BC0908F27A3C005CB29B /* bgerror.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bgerror.test; sourceTree = "<group>"; };
+ F966BC0A08F27A3C005CB29B /* bind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bind.test; sourceTree = "<group>"; };
+ F966BC0B08F27A3C005CB29B /* bitmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bitmap.test; sourceTree = "<group>"; };
+ F966BC0C08F27A3C005CB29B /* border.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = border.test; sourceTree = "<group>"; };
+ F966BC0D08F27A3C005CB29B /* bugs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bugs.tcl; sourceTree = "<group>"; };
+ F966BC0E08F27A3C005CB29B /* butGeom.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = butGeom.tcl; sourceTree = "<group>"; };
+ F966BC0F08F27A3C005CB29B /* butGeom2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = butGeom2.tcl; sourceTree = "<group>"; };
+ F966BC1008F27A3C005CB29B /* button.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.test; sourceTree = "<group>"; };
+ F966BC1108F27A3C005CB29B /* canvas.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvas.test; sourceTree = "<group>"; };
+ F966BC1208F27A3C005CB29B /* canvImg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvImg.test; sourceTree = "<group>"; };
+ F966BC1308F27A3C005CB29B /* canvPs.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPs.test; sourceTree = "<group>"; };
+ F966BC1408F27A3C005CB29B /* canvPsArc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsArc.tcl; sourceTree = "<group>"; };
+ F966BC1508F27A3C005CB29B /* canvPsBmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsBmap.tcl; sourceTree = "<group>"; };
+ F966BC1608F27A3C005CB29B /* canvPsGrph.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsGrph.tcl; sourceTree = "<group>"; };
+ F966BC1708F27A3C005CB29B /* canvPsImg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsImg.tcl; sourceTree = "<group>"; };
+ F966BC1808F27A3C005CB29B /* canvPsText.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsText.tcl; sourceTree = "<group>"; };
+ F966BC1908F27A3C005CB29B /* canvRect.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvRect.test; sourceTree = "<group>"; };
+ F966BC1A08F27A3C005CB29B /* canvText.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvText.test; sourceTree = "<group>"; };
+ F966BC1B08F27A3C005CB29B /* canvWind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvWind.test; sourceTree = "<group>"; };
+ F966BC1C08F27A3C005CB29B /* choosedir.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = choosedir.test; sourceTree = "<group>"; };
+ F966BC1D08F27A3C005CB29B /* clipboard.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clipboard.test; sourceTree = "<group>"; };
+ F966BC1E08F27A3C005CB29B /* clrpick.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.test; sourceTree = "<group>"; };
+ F966BC1F08F27A3C005CB29B /* cmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmap.tcl; sourceTree = "<group>"; };
+ F966BC2008F27A3C005CB29B /* cmds.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmds.test; sourceTree = "<group>"; };
+ F966BC2108F27A3C005CB29B /* color.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = color.test; sourceTree = "<group>"; };
+ F966BC2208F27A3C005CB29B /* config.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = config.test; sourceTree = "<group>"; };
+ F966BC2308F27A3C005CB29B /* constraints.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = constraints.tcl; sourceTree = "<group>"; };
+ F966BC2408F27A3C005CB29B /* cursor.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cursor.test; sourceTree = "<group>"; };
+ F966BC2508F27A3C005CB29B /* dialog.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.test; sourceTree = "<group>"; };
+ F966BC2608F27A3C005CB29B /* embed.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = embed.test; sourceTree = "<group>"; };
+ F966BC2708F27A3C005CB29B /* entry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.test; sourceTree = "<group>"; };
+ F966BC2808F27A3C005CB29B /* event.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = event.test; sourceTree = "<group>"; };
+ F966BC2908F27A3C005CB29B /* filebox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = filebox.test; sourceTree = "<group>"; };
+ F966BC2A08F27A3C005CB29B /* focus.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.test; sourceTree = "<group>"; };
+ F966BC2B08F27A3C005CB29B /* focusTcl.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focusTcl.test; sourceTree = "<group>"; };
+ F966BC2C08F27A3C005CB29B /* font.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = font.test; sourceTree = "<group>"; };
+ F966BC2D08F27A3C005CB29B /* frame.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = frame.test; sourceTree = "<group>"; };
+ F966BC2E08F27A3C005CB29B /* geometry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = geometry.test; sourceTree = "<group>"; };
+ F966BC2F08F27A3C005CB29B /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
+ F966BC3008F27A3C005CB29B /* grab.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grab.test; sourceTree = "<group>"; };
+ F966BC3108F27A3C005CB29B /* grid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grid.test; sourceTree = "<group>"; };
+ F966BC3308F27A3C005CB29B /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
+ F966BC3408F27A3C005CB29B /* imgBmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgBmap.test; sourceTree = "<group>"; };
+ F966BC3508F27A3C005CB29B /* imgPhoto.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPhoto.test; sourceTree = "<group>"; };
+ F966BC3608F27A3C005CB29B /* imgPPM.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPPM.test; sourceTree = "<group>"; };
+ F966BC3708F27A3C005CB29B /* listbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.test; sourceTree = "<group>"; };
+ F966BC3808F27A3C005CB29B /* main.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = main.test; sourceTree = "<group>"; };
+ F966BC3908F27A3C005CB29B /* menu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.test; sourceTree = "<group>"; };
+ F966BC3A08F27A3C005CB29B /* menubut.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubut.test; sourceTree = "<group>"; };
+ F966BC3B08F27A3C005CB29B /* menuDraw.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menuDraw.test; sourceTree = "<group>"; };
+ F966BC3C08F27A3C005CB29B /* message.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = message.test; sourceTree = "<group>"; };
+ F966BC3D08F27A3C005CB29B /* msgbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.test; sourceTree = "<group>"; };
+ F966BC3E08F27A3C005CB29B /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = "<group>"; };
+ F966BC3F08F27A3C005CB29B /* oldpack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oldpack.test; sourceTree = "<group>"; };
+ F966BC4008F27A3C005CB29B /* option.file1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file1; sourceTree = "<group>"; };
+ F966BC4108F27A3C005CB29B /* option.file2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file2; sourceTree = "<group>"; };
+ F966BC4208F27A3C005CB29B /* option.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = option.test; sourceTree = "<group>"; };
+ F966BC4308F27A3C005CB29B /* pack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pack.test; sourceTree = "<group>"; };
+ F966BC4408F27A3C005CB29B /* panedwindow.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.test; sourceTree = "<group>"; };
+ F966BC4508F27A3D005CB29B /* place.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = place.test; sourceTree = "<group>"; };
+ F966BC4608F27A3D005CB29B /* raise.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = raise.test; sourceTree = "<group>"; };
+ F966BC4708F27A3D005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BC4808F27A3D005CB29B /* safe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.test; sourceTree = "<group>"; };
+ F966BC4908F27A3D005CB29B /* scale.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.test; sourceTree = "<group>"; };
+ F966BC4A08F27A3D005CB29B /* scrollbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.test; sourceTree = "<group>"; };
+ F966BC4B08F27A3D005CB29B /* select.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = select.test; sourceTree = "<group>"; };
+ F966BC4C08F27A3D005CB29B /* send.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = send.test; sourceTree = "<group>"; };
+ F966BC4D08F27A3D005CB29B /* spinbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.test; sourceTree = "<group>"; };
+ F966BC4E08F27A3D005CB29B /* text.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.test; sourceTree = "<group>"; };
+ F966BC4F08F27A3D005CB29B /* textBTree.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textBTree.test; sourceTree = "<group>"; };
+ F966BC5008F27A3D005CB29B /* textDisp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textDisp.test; sourceTree = "<group>"; };
+ F966BC5108F27A3D005CB29B /* textImage.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textImage.test; sourceTree = "<group>"; };
+ F966BC5208F27A3D005CB29B /* textIndex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textIndex.test; sourceTree = "<group>"; };
+ F966BC5308F27A3D005CB29B /* textMark.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textMark.test; sourceTree = "<group>"; };
+ F966BC5408F27A3D005CB29B /* textTag.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textTag.test; sourceTree = "<group>"; };
+ F966BC5508F27A3D005CB29B /* textWind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textWind.test; sourceTree = "<group>"; };
+ F966BC5608F27A3D005CB29B /* tk.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.test; sourceTree = "<group>"; };
+ F966BC5708F27A3D005CB29B /* unixButton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixButton.test; sourceTree = "<group>"; };
+ F966BC5808F27A3D005CB29B /* unixEmbed.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixEmbed.test; sourceTree = "<group>"; };
+ F966BC5908F27A3D005CB29B /* unixFont.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFont.test; sourceTree = "<group>"; };
+ F966BC5A08F27A3D005CB29B /* unixMenu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixMenu.test; sourceTree = "<group>"; };
+ F966BC5B08F27A3D005CB29B /* unixSelect.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixSelect.test; sourceTree = "<group>"; };
+ F966BC5C08F27A3D005CB29B /* unixWm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixWm.test; sourceTree = "<group>"; };
+ F966BC5D08F27A3D005CB29B /* util.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = util.test; sourceTree = "<group>"; };
+ F966BC5E08F27A3D005CB29B /* visual.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = visual.test; sourceTree = "<group>"; };
+ F966BC5F08F27A3D005CB29B /* visual_bb.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = visual_bb.test; sourceTree = "<group>"; };
+ F966BC6008F27A3D005CB29B /* winButton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winButton.test; sourceTree = "<group>"; };
+ F966BC6108F27A3D005CB29B /* winClipboard.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winClipboard.test; sourceTree = "<group>"; };
+ F966BC6208F27A3D005CB29B /* winDialog.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winDialog.test; sourceTree = "<group>"; };
+ F966BC6308F27A3D005CB29B /* window.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = window.test; sourceTree = "<group>"; };
+ F966BC6408F27A3D005CB29B /* winfo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winfo.test; sourceTree = "<group>"; };
+ F966BC6508F27A3D005CB29B /* winFont.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFont.test; sourceTree = "<group>"; };
+ F966BC6608F27A3D005CB29B /* winMenu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winMenu.test; sourceTree = "<group>"; };
+ F966BC6708F27A3D005CB29B /* winSend.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winSend.test; sourceTree = "<group>"; };
+ F966BC6808F27A3D005CB29B /* winWm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winWm.test; sourceTree = "<group>"; };
+ F966BC6908F27A3D005CB29B /* wm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = wm.test; sourceTree = "<group>"; };
+ F966BC6A08F27A3D005CB29B /* xmfbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.test; sourceTree = "<group>"; };
+ F966BC6C08F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F966BC6D08F27A3D005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F966BC6E08F27A3D005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F966BC6F08F27A3D005CB29B /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = "<group>"; };
+ F966BC7008F27A3D005CB29B /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = "<group>"; };
+ F966BC7108F27A3D005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F966BC7208F27A3D005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BC7308F27A3D005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F966BC7408F27A3D005CB29B /* tk.spec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.spec; sourceTree = "<group>"; };
+ F966BC7508F27A3D005CB29B /* tkAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkAppInit.c; sourceTree = "<group>"; };
+ F966BC7608F27A3D005CB29B /* tkConfig.h.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = tkConfig.h.in; sourceTree = "<group>"; };
+ F966BC7708F27A3D005CB29B /* tkConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tkConfig.sh.in; sourceTree = "<group>"; };
+ F966BC7808F27A3D005CB29B /* tkUnix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnix.c; sourceTree = "<group>"; };
+ F966BC7908F27A3D005CB29B /* tkUnix3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnix3d.c; sourceTree = "<group>"; };
+ F966BC7A08F27A3D005CB29B /* tkUnixButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixButton.c; sourceTree = "<group>"; };
+ F966BC7B08F27A3D005CB29B /* tkUnixColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixColor.c; sourceTree = "<group>"; };
+ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixConfig.c; sourceTree = "<group>"; };
+ F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixCursor.c; sourceTree = "<group>"; };
+ F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixDefault.h; sourceTree = "<group>"; };
+ F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDialog.c; sourceTree = "<group>"; };
+ F966BC8008F27A3D005CB29B /* tkUnixDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDraw.c; sourceTree = "<group>"; };
+ F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEmbed.c; sourceTree = "<group>"; };
+ F966BC8208F27A3D005CB29B /* tkUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEvent.c; sourceTree = "<group>"; };
+ F966BC8308F27A3D005CB29B /* tkUnixFocus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixFocus.c; sourceTree = "<group>"; };
+ F966BC8408F27A3D005CB29B /* tkUnixFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixFont.c; sourceTree = "<group>"; };
+ F966BC8508F27A3D005CB29B /* tkUnixInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixInit.c; sourceTree = "<group>"; };
+ F966BC8608F27A3D005CB29B /* tkUnixInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixInt.h; sourceTree = "<group>"; };
+ F966BC8708F27A3D005CB29B /* tkUnixKey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixKey.c; sourceTree = "<group>"; };
+ F966BC8808F27A3D005CB29B /* tkUnixMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixMenu.c; sourceTree = "<group>"; };
+ F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixMenubu.c; sourceTree = "<group>"; };
+ F966BC8A08F27A3D005CB29B /* tkUnixPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixPort.h; sourceTree = "<group>"; };
+ F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixRFont.c; sourceTree = "<group>"; };
+ F966BC8C08F27A3D005CB29B /* tkUnixScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixScale.c; sourceTree = "<group>"; };
+ F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixScrlbr.c; sourceTree = "<group>"; };
+ F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixSelect.c; sourceTree = "<group>"; };
+ F966BC8F08F27A3D005CB29B /* tkUnixSend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixSend.c; sourceTree = "<group>"; };
+ F966BC9008F27A3D005CB29B /* tkUnixWm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixWm.c; sourceTree = "<group>"; };
+ F966BC9108F27A3D005CB29B /* tkUnixXId.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixXId.c; sourceTree = "<group>"; };
+ F966BC9408F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; };
+ F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
+ F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
+ F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = "<group>"; };
+ F966BC9C08F27A3E005CB29B /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
+ F966BCEE08F27A3E005CB29B /* tk.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.rc; sourceTree = "<group>"; };
+ F966BCEF08F27A3E005CB29B /* tk_base.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk_base.rc; sourceTree = "<group>"; };
+ F966BCF208F27A3E005CB29B /* wish.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = wish.rc; sourceTree = "<group>"; };
+ F966BCF308F27A3E005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BCF408F27A3E005CB29B /* rmd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rmd.bat; sourceTree = "<group>"; };
+ F966BCF508F27A3F005CB29B /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
+ F966BCF608F27A3F005CB29B /* stubs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stubs.c; sourceTree = "<group>"; };
+ F966BCF708F27A3F005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F966BCF808F27A3F005CB29B /* tkConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tkConfig.sh.in; sourceTree = "<group>"; };
+ F966BCF908F27A3F005CB29B /* tkWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWin.h; sourceTree = "<group>"; };
+ F966BCFA08F27A3F005CB29B /* tkWin32Dll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWin32Dll.c; sourceTree = "<group>"; };
+ F966BCFB08F27A3F005CB29B /* tkWin3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWin3d.c; sourceTree = "<group>"; };
+ F966BCFC08F27A3F005CB29B /* tkWinButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinButton.c; sourceTree = "<group>"; };
+ F966BCFD08F27A3F005CB29B /* tkWinClipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinClipboard.c; sourceTree = "<group>"; };
+ F966BCFE08F27A3F005CB29B /* tkWinColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinColor.c; sourceTree = "<group>"; };
+ F966BCFF08F27A3F005CB29B /* tkWinConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinConfig.c; sourceTree = "<group>"; };
+ F966BD0008F27A3F005CB29B /* tkWinCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinCursor.c; sourceTree = "<group>"; };
+ F966BD0108F27A3F005CB29B /* tkWinDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinDefault.h; sourceTree = "<group>"; };
+ F966BD0208F27A3F005CB29B /* tkWinDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinDialog.c; sourceTree = "<group>"; };
+ F966BD0308F27A3F005CB29B /* tkWinDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinDraw.c; sourceTree = "<group>"; };
+ F966BD0408F27A3F005CB29B /* tkWinEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinEmbed.c; sourceTree = "<group>"; };
+ F966BD0508F27A3F005CB29B /* tkWinFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinFont.c; sourceTree = "<group>"; };
+ F966BD0708F27A3F005CB29B /* tkWinImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinImage.c; sourceTree = "<group>"; };
+ F966BD0808F27A3F005CB29B /* tkWinInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinInit.c; sourceTree = "<group>"; };
+ F966BD0908F27A3F005CB29B /* tkWinInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinInt.h; sourceTree = "<group>"; };
+ F966BD0A08F27A3F005CB29B /* tkWinKey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinKey.c; sourceTree = "<group>"; };
+ F966BD0B08F27A3F005CB29B /* tkWinMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinMenu.c; sourceTree = "<group>"; };
+ F966BD0C08F27A3F005CB29B /* tkWinPixmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinPixmap.c; sourceTree = "<group>"; };
+ F966BD0D08F27A3F005CB29B /* tkWinPointer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinPointer.c; sourceTree = "<group>"; };
+ F966BD0E08F27A3F005CB29B /* tkWinPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinPort.h; sourceTree = "<group>"; };
+ F966BD0F08F27A3F005CB29B /* tkWinRegion.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinRegion.c; sourceTree = "<group>"; };
+ F966BD1008F27A3F005CB29B /* tkWinScrlbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinScrlbr.c; sourceTree = "<group>"; };
+ F966BD1108F27A3F005CB29B /* tkWinSend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinSend.c; sourceTree = "<group>"; };
+ F966BD1208F27A3F005CB29B /* tkWinSendCom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinSendCom.c; sourceTree = "<group>"; };
+ F966BD1308F27A3F005CB29B /* tkWinSendCom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinSendCom.h; sourceTree = "<group>"; };
+ F966BD1408F27A3F005CB29B /* tkWinTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinTest.c; sourceTree = "<group>"; };
+ F966BD1508F27A3F005CB29B /* tkWinWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinWindow.c; sourceTree = "<group>"; };
+ F966BD1608F27A3F005CB29B /* tkWinWm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinWm.c; sourceTree = "<group>"; };
+ F966BD1708F27A3F005CB29B /* tkWinX.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinX.c; sourceTree = "<group>"; };
+ F966BD1808F27A3F005CB29B /* winMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = winMain.c; sourceTree = "<group>"; };
+ F966BD1B08F27A3F005CB29B /* cursorfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cursorfont.h; sourceTree = "<group>"; };
+ F966BD1C08F27A3F005CB29B /* keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keysym.h; sourceTree = "<group>"; };
+ F966BD1D08F27A3F005CB29B /* keysymdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keysymdef.h; sourceTree = "<group>"; };
+ F966BD1E08F27A3F005CB29B /* X.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X.h; sourceTree = "<group>"; };
+ F966BD1F08F27A3F005CB29B /* Xatom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xatom.h; sourceTree = "<group>"; };
+ F966BD2008F27A3F005CB29B /* Xfuncproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xfuncproto.h; sourceTree = "<group>"; };
+ F966BD2108F27A3F005CB29B /* Xlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xlib.h; sourceTree = "<group>"; };
+ F966BD2208F27A3F005CB29B /* Xutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xutil.h; sourceTree = "<group>"; };
+ F966BD2308F27A3F005CB29B /* xbytes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xbytes.h; sourceTree = "<group>"; };
+ F966BD2408F27A3F005CB29B /* xcolors.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xcolors.c; sourceTree = "<group>"; };
+ F966BD2508F27A3F005CB29B /* xdraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xdraw.c; sourceTree = "<group>"; };
+ F966BD2608F27A3F005CB29B /* xgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xgc.c; sourceTree = "<group>"; };
+ F966BD2708F27A3F005CB29B /* ximage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ximage.c; sourceTree = "<group>"; };
+ F966BD2808F27A3F005CB29B /* xutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xutil.c; sourceTree = "<group>"; };
+ F966C07408F2820D005CB29B /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ F966C07608F2821B005CB29B /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+ F966C07808F28233005CB29B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
+ F96887E00AF786D5000797B5 /* ttk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.decls; sourceTree = "<group>"; };
+ F96887E10AF786D5000797B5 /* ttkBlink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkBlink.c; sourceTree = "<group>"; };
+ F96887E20AF786D5000797B5 /* ttkButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkButton.c; sourceTree = "<group>"; };
+ F96887E30AF786D5000797B5 /* ttkCache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkCache.c; sourceTree = "<group>"; };
+ F96887E40AF786D5000797B5 /* ttkClamTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkClamTheme.c; sourceTree = "<group>"; };
+ F96887E50AF786D5000797B5 /* ttkClassicTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkClassicTheme.c; sourceTree = "<group>"; };
+ F96887E60AF786D5000797B5 /* ttkDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkDecls.h; sourceTree = "<group>"; };
+ F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkDefaultTheme.c; sourceTree = "<group>"; };
+ F96887E80AF786D5000797B5 /* ttkElements.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkElements.c; sourceTree = "<group>"; };
+ F96887E90AF786D5000797B5 /* ttkEntry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkEntry.c; sourceTree = "<group>"; };
+ F96887EA0AF786D5000797B5 /* ttkFrame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkFrame.c; sourceTree = "<group>"; };
+ F96887EB0AF786D5000797B5 /* ttkImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkImage.c; sourceTree = "<group>"; };
+ F96887EC0AF786D5000797B5 /* ttkInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkInit.c; sourceTree = "<group>"; };
+ F96887ED0AF786D5000797B5 /* ttkLabel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkLabel.c; sourceTree = "<group>"; };
+ F96887EE0AF786D5000797B5 /* ttkLayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkLayout.c; sourceTree = "<group>"; };
+ F96887EF0AF786D5000797B5 /* ttkManager.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkManager.c; sourceTree = "<group>"; };
+ F96887F00AF786D5000797B5 /* ttkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkManager.h; sourceTree = "<group>"; };
+ F96887F10AF786D5000797B5 /* ttkNotebook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkNotebook.c; sourceTree = "<group>"; };
+ F96887F20AF786D5000797B5 /* ttkPanedwindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkPanedwindow.c; sourceTree = "<group>"; };
+ F96887F30AF786D5000797B5 /* ttkProgress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkProgress.c; sourceTree = "<group>"; };
+ F96887F40AF786D5000797B5 /* ttkScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScale.c; sourceTree = "<group>"; };
+ F96887F50AF786D5000797B5 /* ttkScroll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScroll.c; sourceTree = "<group>"; };
+ F96887F60AF786D5000797B5 /* ttkScrollbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScrollbar.c; sourceTree = "<group>"; };
+ F96887F70AF786D5000797B5 /* ttkSeparator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkSeparator.c; sourceTree = "<group>"; };
+ F96887F80AF786D5000797B5 /* ttkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkSquare.c; sourceTree = "<group>"; };
+ F96887F90AF786D5000797B5 /* ttkState.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkState.c; sourceTree = "<group>"; };
+ F96887FA0AF786D5000797B5 /* ttkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkStubInit.c; sourceTree = "<group>"; };
+ F96887FB0AF786D5000797B5 /* ttkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkStubLib.c; sourceTree = "<group>"; };
+ F96887FC0AF786D5000797B5 /* ttkTagSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTagSet.c; sourceTree = "<group>"; };
+ F96887FD0AF786D5000797B5 /* ttkTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTheme.c; sourceTree = "<group>"; };
+ F96887FE0AF786D5000797B5 /* ttkTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkTheme.h; sourceTree = "<group>"; };
+ F96887FF0AF786D5000797B5 /* ttkThemeInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkThemeInt.h; sourceTree = "<group>"; };
+ F96888000AF786D5000797B5 /* ttkTrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTrace.c; sourceTree = "<group>"; };
+ F96888010AF786D5000797B5 /* ttkTrack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTrack.c; sourceTree = "<group>"; };
+ F96888020AF786D5000797B5 /* ttkTreeview.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTreeview.c; sourceTree = "<group>"; };
+ F96888030AF786D5000797B5 /* ttkWidget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWidget.c; sourceTree = "<group>"; };
+ F96888040AF786D5000797B5 /* ttkWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkWidget.h; sourceTree = "<group>"; };
+ F96888370AF787B3000797B5 /* altTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = altTheme.tcl; sourceTree = "<group>"; };
+ F96888380AF787B3000797B5 /* aquaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = aquaTheme.tcl; sourceTree = "<group>"; };
+ F96888390AF787B3000797B5 /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F968883A0AF787B3000797B5 /* clamTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clamTheme.tcl; sourceTree = "<group>"; };
+ F968883B0AF787B3000797B5 /* classicTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = classicTheme.tcl; sourceTree = "<group>"; };
+ F968883C0AF787B3000797B5 /* combobox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combobox.tcl; sourceTree = "<group>"; };
+ F968883D0AF787B3000797B5 /* cursors.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cursors.tcl; sourceTree = "<group>"; };
+ F968883E0AF787B3000797B5 /* defaults.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = defaults.tcl; sourceTree = "<group>"; };
+ F96888400AF787B3000797B5 /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; };
+ F96888410AF787B3000797B5 /* fonts.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fonts.tcl; sourceTree = "<group>"; };
+ F96888440AF787B3000797B5 /* menubutton.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubutton.tcl; sourceTree = "<group>"; };
+ F96888450AF787B3000797B5 /* notebook.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notebook.tcl; sourceTree = "<group>"; };
+ F96888460AF787B3000797B5 /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
+ F96888470AF787B3000797B5 /* progress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = progress.tcl; sourceTree = "<group>"; };
+ F96888480AF787B3000797B5 /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
+ F96888490AF787B3000797B5 /* scrollbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.tcl; sourceTree = "<group>"; };
+ F968884A0AF787B3000797B5 /* sizegrip.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = sizegrip.tcl; sourceTree = "<group>"; };
+ F968884B0AF787B3000797B5 /* treeview.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treeview.tcl; sourceTree = "<group>"; };
+ F968884C0AF787B3000797B5 /* ttk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.tcl; sourceTree = "<group>"; };
+ F968884D0AF787B3000797B5 /* utils.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = utils.tcl; sourceTree = "<group>"; };
+ F968884E0AF787B3000797B5 /* winTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTheme.tcl; sourceTree = "<group>"; };
+ F968884F0AF787B3000797B5 /* xpTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xpTheme.tcl; sourceTree = "<group>"; };
+ F96888540AF7880C000797B5 /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F96888560AF7880C000797B5 /* combobox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combobox.test; sourceTree = "<group>"; };
+ F96888570AF7880C000797B5 /* entry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.test; sourceTree = "<group>"; };
+ F96888580AF7880C000797B5 /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
+ F96888590AF7880C000797B5 /* labelframe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = labelframe.test; sourceTree = "<group>"; };
+ F968885A0AF7880C000797B5 /* layout.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = layout.test; sourceTree = "<group>"; };
+ F968885C0AF7880C000797B5 /* notebook.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notebook.test; sourceTree = "<group>"; };
+ F968885D0AF7880C000797B5 /* panedwindow.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.test; sourceTree = "<group>"; };
+ F968885E0AF7880C000797B5 /* progressbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = progressbar.test; sourceTree = "<group>"; };
+ F968885F0AF7880C000797B5 /* scrollbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.test; sourceTree = "<group>"; };
+ F96888600AF7880C000797B5 /* treetags.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treetags.test; sourceTree = "<group>"; };
+ F96888610AF7880C000797B5 /* treeview.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treeview.test; sourceTree = "<group>"; };
+ F96888620AF7880C000797B5 /* ttk.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.test; sourceTree = "<group>"; };
+ F96888630AF7880C000797B5 /* validate.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = validate.test; sourceTree = "<group>"; };
+ F968886B0AF788F6000797B5 /* ttk_button.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_button.n; sourceTree = "<group>"; };
+ F968886C0AF788F6000797B5 /* ttk_checkbutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_checkbutton.n; sourceTree = "<group>"; };
+ F968886D0AF788F6000797B5 /* ttk_combobox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_combobox.n; sourceTree = "<group>"; };
+ F968886F0AF788F6000797B5 /* ttk_entry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_entry.n; sourceTree = "<group>"; };
+ F96888700AF788F6000797B5 /* ttk_frame.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_frame.n; sourceTree = "<group>"; };
+ F96888710AF788F6000797B5 /* ttk_Geometry.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_Geometry.3; sourceTree = "<group>"; };
+ F96888720AF788F6000797B5 /* ttk_image.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_image.n; sourceTree = "<group>"; };
+ F96888730AF788F6000797B5 /* ttk_intro.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_intro.n; sourceTree = "<group>"; };
+ F96888740AF788F6000797B5 /* ttk_label.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_label.n; sourceTree = "<group>"; };
+ F96888750AF788F6000797B5 /* ttk_labelframe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_labelframe.n; sourceTree = "<group>"; };
+ F96888760AF788F6000797B5 /* ttk_menubutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_menubutton.n; sourceTree = "<group>"; };
+ F96888770AF788F6000797B5 /* ttk_notebook.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_notebook.n; sourceTree = "<group>"; };
+ F96888780AF788F6000797B5 /* ttk_panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_panedwindow.n; sourceTree = "<group>"; };
+ F96888790AF788F6000797B5 /* ttk_progressbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_progressbar.n; sourceTree = "<group>"; };
+ F968887A0AF788F6000797B5 /* ttk_radiobutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_radiobutton.n; sourceTree = "<group>"; };
+ F968887B0AF788F6000797B5 /* ttk_scrollbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_scrollbar.n; sourceTree = "<group>"; };
+ F968887C0AF788F6000797B5 /* ttk_separator.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_separator.n; sourceTree = "<group>"; };
+ F968887D0AF788F6000797B5 /* ttk_sizegrip.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_sizegrip.n; sourceTree = "<group>"; };
+ F968887E0AF788F6000797B5 /* ttk_style.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_style.n; sourceTree = "<group>"; };
+ F968887F0AF788F6000797B5 /* ttk_Theme.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_Theme.3; sourceTree = "<group>"; };
+ F96888800AF788F6000797B5 /* ttk_treeview.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_treeview.n; sourceTree = "<group>"; };
+ F96888810AF788F6000797B5 /* ttk_widget.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_widget.n; sourceTree = "<group>"; };
+ F96888840AF78938000797B5 /* ttkMacOSXTheme.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = ttkMacOSXTheme.c; sourceTree = "<group>"; };
+ F96888860AF78953000797B5 /* ttkWinMonitor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinMonitor.c; sourceTree = "<group>"; };
+ F96888870AF78953000797B5 /* ttkWinTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinTheme.c; sourceTree = "<group>"; };
+ F96888880AF78953000797B5 /* ttkWinXPTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinXPTheme.c; sourceTree = "<group>"; };
+ F96D3DFA08F272A4004A47F5 /* ChangeLog */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = ChangeLog; sourceTree = "<group>"; };
+ F96D3DFB08F272A4004A47F5 /* changes */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = changes; sourceTree = "<group>"; };
+ F96D3DFD08F272A4004A47F5 /* Access.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Access.3; sourceTree = "<group>"; };
+ F96D3DFE08F272A4004A47F5 /* AddErrInfo.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AddErrInfo.3; sourceTree = "<group>"; };
+ F96D3DFF08F272A4004A47F5 /* after.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = after.n; sourceTree = "<group>"; };
+ F96D3E0008F272A4004A47F5 /* Alloc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Alloc.3; sourceTree = "<group>"; };
+ F96D3E0108F272A4004A47F5 /* AllowExc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AllowExc.3; sourceTree = "<group>"; };
+ F96D3E0208F272A4004A47F5 /* append.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = append.n; sourceTree = "<group>"; };
+ F96D3E0308F272A4004A47F5 /* AppInit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AppInit.3; sourceTree = "<group>"; };
+ F96D3E0408F272A5004A47F5 /* array.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = array.n; sourceTree = "<group>"; };
+ F96D3E0508F272A5004A47F5 /* AssocData.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AssocData.3; sourceTree = "<group>"; };
+ F96D3E0608F272A5004A47F5 /* Async.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Async.3; sourceTree = "<group>"; };
+ F96D3E0708F272A5004A47F5 /* BackgdErr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BackgdErr.3; sourceTree = "<group>"; };
+ F96D3E0808F272A5004A47F5 /* Backslash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Backslash.3; sourceTree = "<group>"; };
+ F96D3E0908F272A5004A47F5 /* bgerror.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bgerror.n; sourceTree = "<group>"; };
+ F96D3E0A08F272A5004A47F5 /* binary.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = binary.n; sourceTree = "<group>"; };
+ F96D3E0B08F272A5004A47F5 /* BoolObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BoolObj.3; sourceTree = "<group>"; };
+ F96D3E0C08F272A5004A47F5 /* break.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = break.n; sourceTree = "<group>"; };
+ F96D3E0D08F272A5004A47F5 /* ByteArrObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ByteArrObj.3; sourceTree = "<group>"; };
+ F96D3E0E08F272A5004A47F5 /* CallDel.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CallDel.3; sourceTree = "<group>"; };
+ F96D3E0F08F272A5004A47F5 /* case.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = case.n; sourceTree = "<group>"; };
+ F96D3E1008F272A5004A47F5 /* catch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = catch.n; sourceTree = "<group>"; };
+ F96D3E1108F272A5004A47F5 /* cd.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = cd.n; sourceTree = "<group>"; };
+ F96D3E1208F272A5004A47F5 /* chan.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chan.n; sourceTree = "<group>"; };
+ F96D3E1308F272A5004A47F5 /* ChnlStack.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ChnlStack.3; sourceTree = "<group>"; };
+ F96D3E1408F272A5004A47F5 /* clock.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = clock.n; sourceTree = "<group>"; };
+ F96D3E1508F272A5004A47F5 /* close.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = close.n; sourceTree = "<group>"; };
+ F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CmdCmplt.3; sourceTree = "<group>"; };
+ F96D3E1708F272A5004A47F5 /* Concat.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Concat.3; sourceTree = "<group>"; };
+ F96D3E1808F272A5004A47F5 /* concat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = concat.n; sourceTree = "<group>"; };
+ F96D3E1908F272A5004A47F5 /* continue.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = continue.n; sourceTree = "<group>"; };
+ F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtChannel.3; sourceTree = "<group>"; };
+ F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtChnlHdlr.3; sourceTree = "<group>"; };
+ F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCloseHdlr.3; sourceTree = "<group>"; };
+ F96D3E1D08F272A5004A47F5 /* CrtCommand.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCommand.3; sourceTree = "<group>"; };
+ F96D3E1E08F272A5004A47F5 /* CrtFileHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtFileHdlr.3; sourceTree = "<group>"; };
+ F96D3E1F08F272A5004A47F5 /* CrtInterp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtInterp.3; sourceTree = "<group>"; };
+ F96D3E2008F272A5004A47F5 /* CrtMathFnc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtMathFnc.3; sourceTree = "<group>"; };
+ F96D3E2108F272A5004A47F5 /* CrtObjCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtObjCmd.3; sourceTree = "<group>"; };
+ F96D3E2208F272A5004A47F5 /* CrtSlave.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtSlave.3; sourceTree = "<group>"; };
+ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtTimerHdlr.3; sourceTree = "<group>"; };
+ F96D3E2408F272A5004A47F5 /* CrtTrace.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtTrace.3; sourceTree = "<group>"; };
+ F96D3E2508F272A5004A47F5 /* dde.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dde.n; sourceTree = "<group>"; };
+ F96D3E2608F272A5004A47F5 /* DetachPids.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DetachPids.3; sourceTree = "<group>"; };
+ F96D3E2708F272A5004A47F5 /* dict.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dict.n; sourceTree = "<group>"; };
+ F96D3E2808F272A5004A47F5 /* DictObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DictObj.3; sourceTree = "<group>"; };
+ F96D3E2908F272A5004A47F5 /* DoOneEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoOneEvent.3; sourceTree = "<group>"; };
+ F96D3E2A08F272A5004A47F5 /* DoubleObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoubleObj.3; sourceTree = "<group>"; };
+ F96D3E2B08F272A5004A47F5 /* DoWhenIdle.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoWhenIdle.3; sourceTree = "<group>"; };
+ F96D3E2C08F272A5004A47F5 /* DString.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DString.3; sourceTree = "<group>"; };
+ F96D3E2D08F272A5004A47F5 /* DumpActiveMemory.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DumpActiveMemory.3; sourceTree = "<group>"; };
+ F96D3E2E08F272A5004A47F5 /* Encoding.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Encoding.3; sourceTree = "<group>"; };
+ F96D3E2F08F272A5004A47F5 /* encoding.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = encoding.n; sourceTree = "<group>"; };
+ F96D3E3008F272A5004A47F5 /* Ensemble.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Ensemble.3; sourceTree = "<group>"; };
+ F96D3E3108F272A5004A47F5 /* Environment.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Environment.3; sourceTree = "<group>"; };
+ F96D3E3208F272A5004A47F5 /* eof.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = eof.n; sourceTree = "<group>"; };
+ F96D3E3308F272A5004A47F5 /* error.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = error.n; sourceTree = "<group>"; };
+ F96D3E3408F272A5004A47F5 /* Eval.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Eval.3; sourceTree = "<group>"; };
+ F96D3E3508F272A5004A47F5 /* eval.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = eval.n; sourceTree = "<group>"; };
+ F96D3E3608F272A5004A47F5 /* exec.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = exec.n; sourceTree = "<group>"; };
+ F96D3E3708F272A5004A47F5 /* Exit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Exit.3; sourceTree = "<group>"; };
+ F96D3E3808F272A5004A47F5 /* exit.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = exit.n; sourceTree = "<group>"; };
+ F96D3E3908F272A5004A47F5 /* expr.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = expr.n; sourceTree = "<group>"; };
+ F96D3E3A08F272A5004A47F5 /* ExprLong.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ExprLong.3; sourceTree = "<group>"; };
+ F96D3E3B08F272A5004A47F5 /* ExprLongObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ExprLongObj.3; sourceTree = "<group>"; };
+ F96D3E3C08F272A5004A47F5 /* fblocked.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fblocked.n; sourceTree = "<group>"; };
+ F96D3E3D08F272A5004A47F5 /* fconfigure.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fconfigure.n; sourceTree = "<group>"; };
+ F96D3E3E08F272A5004A47F5 /* fcopy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fcopy.n; sourceTree = "<group>"; };
+ F96D3E3F08F272A5004A47F5 /* file.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = file.n; sourceTree = "<group>"; };
+ F96D3E4008F272A5004A47F5 /* fileevent.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fileevent.n; sourceTree = "<group>"; };
+ F96D3E4108F272A5004A47F5 /* filename.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = filename.n; sourceTree = "<group>"; };
+ F96D3E4208F272A5004A47F5 /* FileSystem.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FileSystem.3; sourceTree = "<group>"; };
+ F96D3E4308F272A5004A47F5 /* FindExec.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FindExec.3; sourceTree = "<group>"; };
+ F96D3E4408F272A5004A47F5 /* flush.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = flush.n; sourceTree = "<group>"; };
+ F96D3E4508F272A5004A47F5 /* for.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = for.n; sourceTree = "<group>"; };
+ F96D3E4608F272A5004A47F5 /* foreach.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = foreach.n; sourceTree = "<group>"; };
+ F96D3E4708F272A5004A47F5 /* format.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = format.n; sourceTree = "<group>"; };
+ F96D3E4808F272A5004A47F5 /* GetCwd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCwd.3; sourceTree = "<group>"; };
+ F96D3E4908F272A5004A47F5 /* GetHostName.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHostName.3; sourceTree = "<group>"; };
+ F96D3E4A08F272A5004A47F5 /* GetIndex.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetIndex.3; sourceTree = "<group>"; };
+ F96D3E4B08F272A5004A47F5 /* GetInt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetInt.3; sourceTree = "<group>"; };
+ F96D3E4C08F272A5004A47F5 /* GetOpnFl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetOpnFl.3; sourceTree = "<group>"; };
+ F96D3E4D08F272A5004A47F5 /* gets.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = gets.n; sourceTree = "<group>"; };
+ F96D3E4E08F272A5004A47F5 /* GetStdChan.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetStdChan.3; sourceTree = "<group>"; };
+ F96D3E4F08F272A5004A47F5 /* GetTime.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetTime.3; sourceTree = "<group>"; };
+ F96D3E5008F272A5004A47F5 /* GetVersion.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVersion.3; sourceTree = "<group>"; };
+ F96D3E5108F272A5004A47F5 /* glob.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = glob.n; sourceTree = "<group>"; };
+ F96D3E5208F272A6004A47F5 /* global.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = global.n; sourceTree = "<group>"; };
+ F96D3E5308F272A6004A47F5 /* Hash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Hash.3; sourceTree = "<group>"; };
+ F96D3E5408F272A6004A47F5 /* history.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = history.n; sourceTree = "<group>"; };
+ F96D3E5508F272A6004A47F5 /* http.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = http.n; sourceTree = "<group>"; };
+ F96D3E5608F272A6004A47F5 /* if.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = if.n; sourceTree = "<group>"; };
+ F96D3E5708F272A6004A47F5 /* incr.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = incr.n; sourceTree = "<group>"; };
+ F96D3E5808F272A6004A47F5 /* info.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = info.n; sourceTree = "<group>"; };
+ F96D3E5908F272A6004A47F5 /* Init.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Init.3; sourceTree = "<group>"; };
+ F96D3E5A08F272A6004A47F5 /* InitStubs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = InitStubs.3; sourceTree = "<group>"; };
+ F96D3E5B08F272A6004A47F5 /* Interp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Interp.3; sourceTree = "<group>"; };
+ F96D3E5C08F272A6004A47F5 /* interp.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = interp.n; sourceTree = "<group>"; };
+ F96D3E5D08F272A6004A47F5 /* IntObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = IntObj.3; sourceTree = "<group>"; };
+ F96D3E5E08F272A6004A47F5 /* join.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = join.n; sourceTree = "<group>"; };
+ F96D3E5F08F272A6004A47F5 /* lappend.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lappend.n; sourceTree = "<group>"; };
+ F96D3E6008F272A6004A47F5 /* lassign.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lassign.n; sourceTree = "<group>"; };
+ F96D3E6108F272A6004A47F5 /* library.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = library.n; sourceTree = "<group>"; };
+ F96D3E6208F272A6004A47F5 /* Limit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Limit.3; sourceTree = "<group>"; };
+ F96D3E6308F272A6004A47F5 /* lindex.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lindex.n; sourceTree = "<group>"; };
+ F96D3E6408F272A6004A47F5 /* LinkVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = LinkVar.3; sourceTree = "<group>"; };
+ F96D3E6508F272A6004A47F5 /* linsert.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = linsert.n; sourceTree = "<group>"; };
+ F96D3E6608F272A6004A47F5 /* list.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = list.n; sourceTree = "<group>"; };
+ F96D3E6708F272A6004A47F5 /* ListObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ListObj.3; sourceTree = "<group>"; };
+ F96D3E6808F272A6004A47F5 /* llength.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = llength.n; sourceTree = "<group>"; };
+ F96D3E6908F272A6004A47F5 /* load.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = load.n; sourceTree = "<group>"; };
+ F96D3E6A08F272A6004A47F5 /* lrange.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lrange.n; sourceTree = "<group>"; };
+ F96D3E6B08F272A6004A47F5 /* lrepeat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lrepeat.n; sourceTree = "<group>"; };
+ F96D3E6C08F272A6004A47F5 /* lreplace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lreplace.n; sourceTree = "<group>"; };
+ F96D3E6D08F272A6004A47F5 /* lsearch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lsearch.n; sourceTree = "<group>"; };
+ F96D3E6E08F272A6004A47F5 /* lset.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lset.n; sourceTree = "<group>"; };
+ F96D3E6F08F272A6004A47F5 /* lsort.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lsort.n; sourceTree = "<group>"; };
+ F96D3E7008F272A6004A47F5 /* man.macros */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = man.macros; sourceTree = "<group>"; };
+ F96D3E7108F272A6004A47F5 /* mathfunc.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = mathfunc.n; sourceTree = "<group>"; };
+ F96D3E7208F272A6004A47F5 /* memory.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = memory.n; sourceTree = "<group>"; };
+ F96D3E7308F272A6004A47F5 /* msgcat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = msgcat.n; sourceTree = "<group>"; };
+ F96D3E7408F272A6004A47F5 /* Namespace.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Namespace.3; sourceTree = "<group>"; };
+ F96D3E7508F272A6004A47F5 /* namespace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = namespace.n; sourceTree = "<group>"; };
+ F96D3E7608F272A6004A47F5 /* Notifier.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Notifier.3; sourceTree = "<group>"; };
+ F96D3E7708F272A6004A47F5 /* Object.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Object.3; sourceTree = "<group>"; };
+ F96D3E7808F272A6004A47F5 /* ObjectType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ObjectType.3; sourceTree = "<group>"; };
+ F96D3E7908F272A6004A47F5 /* open.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = open.n; sourceTree = "<group>"; };
+ F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OpenFileChnl.3; sourceTree = "<group>"; };
+ F96D3E7B08F272A6004A47F5 /* OpenTcp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OpenTcp.3; sourceTree = "<group>"; };
+ F96D3E7C08F272A6004A47F5 /* package.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = package.n; sourceTree = "<group>"; };
+ F96D3E7D08F272A6004A47F5 /* packagens.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = packagens.n; sourceTree = "<group>"; };
+ F96D3E7E08F272A6004A47F5 /* Panic.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Panic.3; sourceTree = "<group>"; };
+ F96D3E7F08F272A6004A47F5 /* ParseCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ParseCmd.3; sourceTree = "<group>"; };
+ F96D3E8008F272A6004A47F5 /* pid.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pid.n; sourceTree = "<group>"; };
+ F96D3E8108F272A6004A47F5 /* pkgMkIndex.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pkgMkIndex.n; sourceTree = "<group>"; };
+ F96D3E8208F272A6004A47F5 /* PkgRequire.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = PkgRequire.3; sourceTree = "<group>"; };
+ F96D3E8308F272A6004A47F5 /* Preserve.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Preserve.3; sourceTree = "<group>"; };
+ F96D3E8408F272A6004A47F5 /* PrintDbl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = PrintDbl.3; sourceTree = "<group>"; };
+ F96D3E8508F272A6004A47F5 /* proc.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = proc.n; sourceTree = "<group>"; };
+ F96D3E8608F272A6004A47F5 /* puts.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = puts.n; sourceTree = "<group>"; };
+ F96D3E8708F272A6004A47F5 /* pwd.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pwd.n; sourceTree = "<group>"; };
+ F96D3E8808F272A6004A47F5 /* re_syntax.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = re_syntax.n; sourceTree = "<group>"; };
+ F96D3E8908F272A6004A47F5 /* read.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = read.n; sourceTree = "<group>"; };
+ F96D3E8A08F272A6004A47F5 /* RecEvalObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RecEvalObj.3; sourceTree = "<group>"; };
+ F96D3E8B08F272A6004A47F5 /* RecordEval.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RecordEval.3; sourceTree = "<group>"; };
+ F96D3E8C08F272A6004A47F5 /* RegConfig.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RegConfig.3; sourceTree = "<group>"; };
+ F96D3E8D08F272A6004A47F5 /* RegExp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RegExp.3; sourceTree = "<group>"; };
+ F96D3E8E08F272A6004A47F5 /* regexp.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = regexp.n; sourceTree = "<group>"; };
+ F96D3E8F08F272A6004A47F5 /* registry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = registry.n; sourceTree = "<group>"; };
+ F96D3E9008F272A6004A47F5 /* regsub.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = regsub.n; sourceTree = "<group>"; };
+ F96D3E9108F272A6004A47F5 /* rename.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = rename.n; sourceTree = "<group>"; };
+ F96D3E9208F272A6004A47F5 /* return.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = return.n; sourceTree = "<group>"; };
+ F96D3E9308F272A6004A47F5 /* safe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = safe.n; sourceTree = "<group>"; };
+ F96D3E9408F272A6004A47F5 /* SaveResult.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SaveResult.3; sourceTree = "<group>"; };
+ F96D3E9508F272A6004A47F5 /* scan.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scan.n; sourceTree = "<group>"; };
+ F96D3E9608F272A6004A47F5 /* seek.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = seek.n; sourceTree = "<group>"; };
+ F96D3E9708F272A6004A47F5 /* set.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = set.n; sourceTree = "<group>"; };
+ F96D3E9808F272A6004A47F5 /* SetChanErr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetChanErr.3; sourceTree = "<group>"; };
+ F96D3E9908F272A6004A47F5 /* SetErrno.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetErrno.3; sourceTree = "<group>"; };
+ F96D3E9A08F272A6004A47F5 /* SetRecLmt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetRecLmt.3; sourceTree = "<group>"; };
+ F96D3E9B08F272A7004A47F5 /* SetResult.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetResult.3; sourceTree = "<group>"; };
+ F96D3E9C08F272A7004A47F5 /* SetVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetVar.3; sourceTree = "<group>"; };
+ F96D3E9D08F272A7004A47F5 /* Signal.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Signal.3; sourceTree = "<group>"; };
+ F96D3E9E08F272A7004A47F5 /* Sleep.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Sleep.3; sourceTree = "<group>"; };
+ F96D3E9F08F272A7004A47F5 /* socket.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = socket.n; sourceTree = "<group>"; };
+ F96D3EA008F272A7004A47F5 /* source.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = source.n; sourceTree = "<group>"; };
+ F96D3EA108F272A7004A47F5 /* SourceRCFile.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SourceRCFile.3; sourceTree = "<group>"; };
+ F96D3EA208F272A7004A47F5 /* split.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = split.n; sourceTree = "<group>"; };
+ F96D3EA308F272A7004A47F5 /* SplitList.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SplitList.3; sourceTree = "<group>"; };
+ F96D3EA408F272A7004A47F5 /* SplitPath.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SplitPath.3; sourceTree = "<group>"; };
+ F96D3EA508F272A7004A47F5 /* StaticPkg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StaticPkg.3; sourceTree = "<group>"; };
+ F96D3EA608F272A7004A47F5 /* StdChannels.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StdChannels.3; sourceTree = "<group>"; };
+ F96D3EA708F272A7004A47F5 /* string.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = string.n; sourceTree = "<group>"; };
+ F96D3EA808F272A7004A47F5 /* StringObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StringObj.3; sourceTree = "<group>"; };
+ F96D3EA908F272A7004A47F5 /* StrMatch.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StrMatch.3; sourceTree = "<group>"; };
+ F96D3EAA08F272A7004A47F5 /* subst.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = subst.n; sourceTree = "<group>"; };
+ F96D3EAB08F272A7004A47F5 /* SubstObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SubstObj.3; sourceTree = "<group>"; };
+ F96D3EAC08F272A7004A47F5 /* switch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = switch.n; sourceTree = "<group>"; };
+ F96D3EAD08F272A7004A47F5 /* Tcl.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tcl.n; sourceTree = "<group>"; };
+ F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tcl_Main.3; sourceTree = "<group>"; };
+ F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TCL_MEM_DEBUG.3; sourceTree = "<group>"; };
+ F96D3EB008F272A7004A47F5 /* tclsh.1 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tclsh.1; sourceTree = "<group>"; };
+ F96D3EB108F272A7004A47F5 /* tcltest.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tcltest.n; sourceTree = "<group>"; };
+ F96D3EB208F272A7004A47F5 /* tclvars.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tclvars.n; sourceTree = "<group>"; };
+ F96D3EB308F272A7004A47F5 /* tell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tell.n; sourceTree = "<group>"; };
+ F96D3EB408F272A7004A47F5 /* Thread.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Thread.3; sourceTree = "<group>"; };
+ F96D3EB508F272A7004A47F5 /* time.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = time.n; sourceTree = "<group>"; };
+ F96D3EB608F272A7004A47F5 /* tm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tm.n; sourceTree = "<group>"; };
+ F96D3EB708F272A7004A47F5 /* ToUpper.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ToUpper.3; sourceTree = "<group>"; };
+ F96D3EB808F272A7004A47F5 /* trace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = trace.n; sourceTree = "<group>"; };
+ F96D3EB908F272A7004A47F5 /* TraceCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TraceCmd.3; sourceTree = "<group>"; };
+ F96D3EBA08F272A7004A47F5 /* TraceVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TraceVar.3; sourceTree = "<group>"; };
+ F96D3EBB08F272A7004A47F5 /* Translate.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Translate.3; sourceTree = "<group>"; };
+ F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = UniCharIsAlpha.3; sourceTree = "<group>"; };
+ F96D3EBD08F272A7004A47F5 /* unknown.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unknown.n; sourceTree = "<group>"; };
+ F96D3EBE08F272A7004A47F5 /* unload.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unload.n; sourceTree = "<group>"; };
+ F96D3EBF08F272A7004A47F5 /* unset.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unset.n; sourceTree = "<group>"; };
+ F96D3EC008F272A7004A47F5 /* update.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = update.n; sourceTree = "<group>"; };
+ F96D3EC108F272A7004A47F5 /* uplevel.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = uplevel.n; sourceTree = "<group>"; };
+ F96D3EC208F272A7004A47F5 /* UpVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = UpVar.3; sourceTree = "<group>"; };
+ F96D3EC308F272A7004A47F5 /* upvar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = upvar.n; sourceTree = "<group>"; };
+ F96D3EC408F272A7004A47F5 /* Utf.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Utf.3; sourceTree = "<group>"; };
+ F96D3EC508F272A7004A47F5 /* variable.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = variable.n; sourceTree = "<group>"; };
+ F96D3EC608F272A7004A47F5 /* vwait.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = vwait.n; sourceTree = "<group>"; };
+ F96D3EC708F272A7004A47F5 /* while.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = while.n; sourceTree = "<group>"; };
+ F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = WrongNumArgs.3; sourceTree = "<group>"; };
+ F96D3ECA08F272A7004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D3ECB08F272A7004A47F5 /* regc_color.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_color.c; sourceTree = "<group>"; };
+ F96D3ECC08F272A7004A47F5 /* regc_cvec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_cvec.c; sourceTree = "<group>"; };
+ F96D3ECD08F272A7004A47F5 /* regc_lex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_lex.c; sourceTree = "<group>"; };
+ F96D3ECE08F272A7004A47F5 /* regc_locale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_locale.c; sourceTree = "<group>"; };
+ F96D3ECF08F272A7004A47F5 /* regc_nfa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_nfa.c; sourceTree = "<group>"; };
+ F96D3ED008F272A7004A47F5 /* regcomp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regcomp.c; sourceTree = "<group>"; };
+ F96D3ED108F272A7004A47F5 /* regcustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regcustom.h; sourceTree = "<group>"; };
+ F96D3ED208F272A7004A47F5 /* rege_dfa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rege_dfa.c; sourceTree = "<group>"; };
+ F96D3ED308F272A7004A47F5 /* regerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regerror.c; sourceTree = "<group>"; };
+ F96D3ED408F272A7004A47F5 /* regerrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regerrs.h; sourceTree = "<group>"; };
+ F96D3ED508F272A7004A47F5 /* regex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regex.h; sourceTree = "<group>"; };
+ F96D3ED608F272A7004A47F5 /* regexec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regexec.c; sourceTree = "<group>"; };
+ F96D3ED708F272A7004A47F5 /* regfree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regfree.c; sourceTree = "<group>"; };
+ F96D3ED808F272A7004A47F5 /* regfronts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regfronts.c; sourceTree = "<group>"; };
+ F96D3ED908F272A7004A47F5 /* regguts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regguts.h; sourceTree = "<group>"; };
+ F96D3EDA08F272A7004A47F5 /* tcl.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcl.decls; sourceTree = "<group>"; };
+ F96D3EDB08F272A7004A47F5 /* tcl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcl.h; sourceTree = "<group>"; };
+ F96D3EDC08F272A7004A47F5 /* tclAlloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAlloc.c; sourceTree = "<group>"; };
+ F96D3EDD08F272A7004A47F5 /* tclAsync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAsync.c; sourceTree = "<group>"; };
+ F96D3EDE08F272A7004A47F5 /* tclBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclBasic.c; sourceTree = "<group>"; };
+ F96D3EDF08F272A7004A47F5 /* tclBinary.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclBinary.c; sourceTree = "<group>"; };
+ F96D3EE008F272A7004A47F5 /* tclCkalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCkalloc.c; sourceTree = "<group>"; };
+ F96D3EE108F272A7004A47F5 /* tclClock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclClock.c; sourceTree = "<group>"; };
+ F96D3EE208F272A7004A47F5 /* tclCmdAH.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdAH.c; sourceTree = "<group>"; };
+ F96D3EE308F272A7004A47F5 /* tclCmdIL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdIL.c; sourceTree = "<group>"; };
+ F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdMZ.c; sourceTree = "<group>"; };
+ F96D3EE508F272A7004A47F5 /* tclCompCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompCmds.c; sourceTree = "<group>"; };
+ F96D3EE608F272A7004A47F5 /* tclCompExpr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompExpr.c; sourceTree = "<group>"; };
+ F96D3EE708F272A7004A47F5 /* tclCompile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompile.c; sourceTree = "<group>"; };
+ F96D3EE808F272A7004A47F5 /* tclCompile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclCompile.h; sourceTree = "<group>"; };
+ F96D3EE908F272A7004A47F5 /* tclConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclConfig.c; sourceTree = "<group>"; };
+ F96D3EEA08F272A7004A47F5 /* tclDate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclDate.c; sourceTree = "<group>"; };
+ F96D3EEB08F272A7004A47F5 /* tclDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclDecls.h; sourceTree = "<group>"; };
+ F96D3EEC08F272A7004A47F5 /* tclDictObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclDictObj.c; sourceTree = "<group>"; };
+ F96D3EED08F272A7004A47F5 /* tclEncoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEncoding.c; sourceTree = "<group>"; };
+ F96D3EEE08F272A7004A47F5 /* tclEnv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEnv.c; sourceTree = "<group>"; };
+ F96D3EEF08F272A7004A47F5 /* tclEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEvent.c; sourceTree = "<group>"; };
+ F96D3EF008F272A7004A47F5 /* tclExecute.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclExecute.c; sourceTree = "<group>"; };
+ F96D3EF108F272A7004A47F5 /* tclFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclFCmd.c; sourceTree = "<group>"; };
+ F96D3EF208F272A7004A47F5 /* tclFileName.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclFileName.c; sourceTree = "<group>"; };
+ F96D3EF308F272A7004A47F5 /* tclFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclFileSystem.h; sourceTree = "<group>"; };
+ F96D3EF408F272A7004A47F5 /* tclGet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclGet.c; sourceTree = "<group>"; };
+ F96D3EF508F272A7004A47F5 /* tclGetDate.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = tclGetDate.y; sourceTree = "<group>"; };
+ F96D3EF608F272A7004A47F5 /* tclHash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclHash.c; sourceTree = "<group>"; };
+ F96D3EF708F272A7004A47F5 /* tclHistory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclHistory.c; sourceTree = "<group>"; };
+ F96D3EF808F272A7004A47F5 /* tclIndexObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIndexObj.c; sourceTree = "<group>"; };
+ F96D3EF908F272A7004A47F5 /* tclInt.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclInt.decls; sourceTree = "<group>"; };
+ F96D3EFA08F272A7004A47F5 /* tclInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclInt.h; sourceTree = "<group>"; };
+ F96D3EFB08F272A7004A47F5 /* tclIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIntDecls.h; sourceTree = "<group>"; };
+ F96D3EFC08F272A7004A47F5 /* tclInterp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclInterp.c; sourceTree = "<group>"; };
+ F96D3EFD08F272A7004A47F5 /* tclIntPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIntPlatDecls.h; sourceTree = "<group>"; };
+ F96D3EFE08F272A7004A47F5 /* tclIO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIO.c; sourceTree = "<group>"; };
+ F96D3EFF08F272A7004A47F5 /* tclIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIO.h; sourceTree = "<group>"; };
+ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOCmd.c; sourceTree = "<group>"; };
+ F96D3F0108F272A7004A47F5 /* tclIOGT.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOGT.c; sourceTree = "<group>"; };
+ F96D3F0208F272A7004A47F5 /* tclIORChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORChan.c; sourceTree = "<group>"; };
+ F96D3F0308F272A7004A47F5 /* tclIOSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOSock.c; sourceTree = "<group>"; };
+ F96D3F0408F272A7004A47F5 /* tclIOUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOUtil.c; sourceTree = "<group>"; };
+ F96D3F0508F272A7004A47F5 /* tclLink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLink.c; sourceTree = "<group>"; };
+ F96D3F0608F272A7004A47F5 /* tclListObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclListObj.c; sourceTree = "<group>"; };
+ F96D3F0708F272A7004A47F5 /* tclLiteral.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLiteral.c; sourceTree = "<group>"; };
+ F96D3F0808F272A7004A47F5 /* tclLoad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoad.c; sourceTree = "<group>"; };
+ F96D3F0908F272A7004A47F5 /* tclLoadNone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadNone.c; sourceTree = "<group>"; };
+ F96D3F0A08F272A7004A47F5 /* tclMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMain.c; sourceTree = "<group>"; };
+ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclNamesp.c; sourceTree = "<group>"; };
+ F96D3F0C08F272A7004A47F5 /* tclNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclNotify.c; sourceTree = "<group>"; };
+ F96D3F0D08F272A7004A47F5 /* tclObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclObj.c; sourceTree = "<group>"; };
+ F96D3F0E08F272A7004A47F5 /* tclPanic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPanic.c; sourceTree = "<group>"; };
+ F96D3F0F08F272A7004A47F5 /* tclParse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclParse.c; sourceTree = "<group>"; };
+ F96D3F1108F272A7004A47F5 /* tclPathObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPathObj.c; sourceTree = "<group>"; };
+ F96D3F1208F272A7004A47F5 /* tclPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPipe.c; sourceTree = "<group>"; };
+ F96D3F1308F272A7004A47F5 /* tclPkg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPkg.c; sourceTree = "<group>"; };
+ F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPkgConfig.c; sourceTree = "<group>"; };
+ F96D3F1508F272A7004A47F5 /* tclPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclPlatDecls.h; sourceTree = "<group>"; };
+ F96D3F1608F272A7004A47F5 /* tclPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclPort.h; sourceTree = "<group>"; };
+ F96D3F1708F272A7004A47F5 /* tclPosixStr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPosixStr.c; sourceTree = "<group>"; };
+ F96D3F1808F272A7004A47F5 /* tclPreserve.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPreserve.c; sourceTree = "<group>"; };
+ F96D3F1908F272A7004A47F5 /* tclProc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclProc.c; sourceTree = "<group>"; };
+ F96D3F1A08F272A7004A47F5 /* tclRegexp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclRegexp.c; sourceTree = "<group>"; };
+ F96D3F1B08F272A7004A47F5 /* tclRegexp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclRegexp.h; sourceTree = "<group>"; };
+ F96D3F1C08F272A7004A47F5 /* tclResolve.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclResolve.c; sourceTree = "<group>"; };
+ F96D3F1D08F272A7004A47F5 /* tclResult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclResult.c; sourceTree = "<group>"; };
+ F96D3F1E08F272A7004A47F5 /* tclScan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclScan.c; sourceTree = "<group>"; };
+ F96D3F1F08F272A7004A47F5 /* tclStringObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStringObj.c; sourceTree = "<group>"; };
+ F96D3F2408F272A7004A47F5 /* tclStrToD.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStrToD.c; sourceTree = "<group>"; };
+ F96D3F2508F272A7004A47F5 /* tclStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStubInit.c; sourceTree = "<group>"; };
+ F96D3F2608F272A7004A47F5 /* tclStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStubLib.c; sourceTree = "<group>"; };
+ F96D3F2708F272A7004A47F5 /* tclTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTest.c; sourceTree = "<group>"; };
+ F96D3F2808F272A7004A47F5 /* tclTestObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTestObj.c; sourceTree = "<group>"; };
+ F96D3F2908F272A7004A47F5 /* tclTestProcBodyObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTestProcBodyObj.c; sourceTree = "<group>"; };
+ F96D3F2A08F272A7004A47F5 /* tclThread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThread.c; sourceTree = "<group>"; };
+ F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadAlloc.c; sourceTree = "<group>"; };
+ F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadJoin.c; sourceTree = "<group>"; };
+ F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadStorage.c; sourceTree = "<group>"; };
+ F96D3F2E08F272A7004A47F5 /* tclThreadTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadTest.c; sourceTree = "<group>"; };
+ F96D3F2F08F272A7004A47F5 /* tclTimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTimer.c; sourceTree = "<group>"; };
+ F96D3F3008F272A7004A47F5 /* tclTomMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMath.h; sourceTree = "<group>"; };
+ F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTomMathInterface.c; sourceTree = "<group>"; };
+ F96D3F3208F272A7004A47F5 /* tclTrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTrace.c; sourceTree = "<group>"; };
+ F96D3F3308F272A7004A47F5 /* tclUniData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUniData.c; sourceTree = "<group>"; };
+ F96D3F3408F272A7004A47F5 /* tclUtf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUtf.c; sourceTree = "<group>"; };
+ F96D3F3508F272A7004A47F5 /* tclUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUtil.c; sourceTree = "<group>"; };
+ F96D3F3608F272A7004A47F5 /* tclVar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclVar.c; sourceTree = "<group>"; };
+ F96D3F3708F272A7004A47F5 /* tommath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath.h; sourceTree = "<group>"; };
+ F96D3F3908F272A8004A47F5 /* auto.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = auto.tcl; sourceTree = "<group>"; };
+ F96D3F3A08F272A8004A47F5 /* clock.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clock.tcl; sourceTree = "<group>"; };
+ F96D3F3C08F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F8C08F272A8004A47F5 /* history.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = history.tcl; sourceTree = "<group>"; };
+ F96D3F8E08F272A8004A47F5 /* http.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.tcl; sourceTree = "<group>"; };
+ F96D3F8F08F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F9108F272A8004A47F5 /* http.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.tcl; sourceTree = "<group>"; };
+ F96D3F9208F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F9308F272A8004A47F5 /* init.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = init.tcl; sourceTree = "<group>"; };
+ F96D3F9508F272A8004A47F5 /* msgcat.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgcat.tcl; sourceTree = "<group>"; };
+ F96D3F9608F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401808F272AA004A47F5 /* optparse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optparse.tcl; sourceTree = "<group>"; };
+ F96D401908F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401A08F272AA004A47F5 /* package.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = package.tcl; sourceTree = "<group>"; };
+ F96D401B08F272AA004A47F5 /* parray.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parray.tcl; sourceTree = "<group>"; };
+ F96D401D08F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401E08F272AA004A47F5 /* safe.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.tcl; sourceTree = "<group>"; };
+ F96D401F08F272AA004A47F5 /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F96D402108F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D402208F272AA004A47F5 /* tcltest.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcltest.tcl; sourceTree = "<group>"; };
+ F96D402308F272AA004A47F5 /* tm.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tm.tcl; sourceTree = "<group>"; };
+ F96D425B08F272B2004A47F5 /* word.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = word.tcl; sourceTree = "<group>"; };
+ F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_mul_digs.c; sourceTree = "<group>"; };
+ F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_sqr.c; sourceTree = "<group>"; };
+ F96D426908F272B3004A47F5 /* bn_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add.c; sourceTree = "<group>"; };
+ F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add_d.c; sourceTree = "<group>"; };
+ F96D426C08F272B3004A47F5 /* bn_mp_and.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_and.c; sourceTree = "<group>"; };
+ F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clamp.c; sourceTree = "<group>"; };
+ F96D426E08F272B3004A47F5 /* bn_mp_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear.c; sourceTree = "<group>"; };
+ F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear_multi.c; sourceTree = "<group>"; };
+ F96D427008F272B3004A47F5 /* bn_mp_cmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp.c; sourceTree = "<group>"; };
+ F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_d.c; sourceTree = "<group>"; };
+ F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_mag.c; sourceTree = "<group>"; };
+ F96D427408F272B3004A47F5 /* bn_mp_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_copy.c; sourceTree = "<group>"; };
+ F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_count_bits.c; sourceTree = "<group>"; };
+ F96D427608F272B3004A47F5 /* bn_mp_div.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div.c; sourceTree = "<group>"; };
+ F96D427708F272B3004A47F5 /* bn_mp_div_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2.c; sourceTree = "<group>"; };
+ F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2d.c; sourceTree = "<group>"; };
+ F96D427908F272B3004A47F5 /* bn_mp_div_3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_3.c; sourceTree = "<group>"; };
+ F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_d.c; sourceTree = "<group>"; };
+ F96D427E08F272B3004A47F5 /* bn_mp_exch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exch.c; sourceTree = "<group>"; };
+ F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_expt_d.c; sourceTree = "<group>"; };
+ F96D428708F272B3004A47F5 /* bn_mp_grow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_grow.c; sourceTree = "<group>"; };
+ F96D428808F272B3004A47F5 /* bn_mp_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init.c; sourceTree = "<group>"; };
+ F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_copy.c; sourceTree = "<group>"; };
+ F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_multi.c; sourceTree = "<group>"; };
+ F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_set.c; sourceTree = "<group>"; };
+ F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_size.c; sourceTree = "<group>"; };
+ F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_mul.c; sourceTree = "<group>"; };
+ F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_sqr.c; sourceTree = "<group>"; };
+ F96D429508F272B3004A47F5 /* bn_mp_lshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_lshd.c; sourceTree = "<group>"; };
+ F96D429608F272B3004A47F5 /* bn_mp_mod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod.c; sourceTree = "<group>"; };
+ F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod_2d.c; sourceTree = "<group>"; };
+ F96D429C08F272B3004A47F5 /* bn_mp_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul.c; sourceTree = "<group>"; };
+ F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2.c; sourceTree = "<group>"; };
+ F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2d.c; sourceTree = "<group>"; };
+ F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_d.c; sourceTree = "<group>"; };
+ F96D42A208F272B3004A47F5 /* bn_mp_neg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_neg.c; sourceTree = "<group>"; };
+ F96D42A308F272B3004A47F5 /* bn_mp_or.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_or.c; sourceTree = "<group>"; };
+ F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_size.c; sourceTree = "<group>"; };
+ F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_smap.c; sourceTree = "<group>"; };
+ F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_read_radix.c; sourceTree = "<group>"; };
+ F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_rshd.c; sourceTree = "<group>"; };
+ F96D42BA08F272B3004A47F5 /* bn_mp_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_set.c; sourceTree = "<group>"; };
+ F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_shrink.c; sourceTree = "<group>"; };
+ F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqr.c; sourceTree = "<group>"; };
+ F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqrt.c; sourceTree = "<group>"; };
+ F96D42C108F272B3004A47F5 /* bn_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub.c; sourceTree = "<group>"; };
+ F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub_d.c; sourceTree = "<group>"; };
+ F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin.c; sourceTree = "<group>"; };
+ F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin_n.c; sourceTree = "<group>"; };
+ F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_mul.c; sourceTree = "<group>"; };
+ F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_sqr.c; sourceTree = "<group>"; };
+ F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toradix_n.c; sourceTree = "<group>"; };
+ F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_unsigned_bin_size.c; sourceTree = "<group>"; };
+ F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_xor.c; sourceTree = "<group>"; };
+ F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_zero.c; sourceTree = "<group>"; };
+ F96D42D008F272B3004A47F5 /* bn_reverse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_reverse.c; sourceTree = "<group>"; };
+ F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_add.c; sourceTree = "<group>"; };
+ F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_mul_digs.c; sourceTree = "<group>"; };
+ F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sqr.c; sourceTree = "<group>"; };
+ F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sub.c; sourceTree = "<group>"; };
+ F96D42D708F272B3004A47F5 /* bncore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bncore.c; sourceTree = "<group>"; };
+ F96D432908F272B4004A47F5 /* tommath_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_class.h; sourceTree = "<group>"; };
+ F96D432A08F272B4004A47F5 /* tommath_superclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_superclass.h; sourceTree = "<group>"; };
+ F96D432B08F272B4004A47F5 /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; };
+ F96D432E08F272B5004A47F5 /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; };
+ F96D432F08F272B5004A47F5 /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; };
+ F96D433108F272B5004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D433208F272B5004A47F5 /* Tcl-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tcl-Info.plist.in"; sourceTree = "<group>"; };
+ F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXBundle.c; sourceTree = "<group>"; };
+ F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXFCmd.c; sourceTree = "<group>"; };
+ F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXNotify.c; sourceTree = "<group>"; };
+ F96D434308F272B5004A47F5 /* README */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = README; sourceTree = "<group>"; };
+ F96D434508F272B5004A47F5 /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F96D434608F272B5004A47F5 /* append.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = append.test; sourceTree = "<group>"; };
+ F96D434708F272B5004A47F5 /* appendComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = appendComp.test; sourceTree = "<group>"; };
+ F96D434808F272B5004A47F5 /* assocd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = assocd.test; sourceTree = "<group>"; };
+ F96D434908F272B5004A47F5 /* async.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = async.test; sourceTree = "<group>"; };
+ F96D434A08F272B5004A47F5 /* autoMkindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = autoMkindex.test; sourceTree = "<group>"; };
+ F96D434B08F272B5004A47F5 /* basic.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = basic.test; sourceTree = "<group>"; };
+ F96D434C08F272B5004A47F5 /* binary.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = binary.test; sourceTree = "<group>"; };
+ F96D434D08F272B5004A47F5 /* case.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = case.test; sourceTree = "<group>"; };
+ F96D434E08F272B5004A47F5 /* chan.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chan.test; sourceTree = "<group>"; };
+ F96D434F08F272B5004A47F5 /* clock.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clock.test; sourceTree = "<group>"; };
+ F96D435008F272B5004A47F5 /* cmdAH.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdAH.test; sourceTree = "<group>"; };
+ F96D435108F272B5004A47F5 /* cmdIL.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdIL.test; sourceTree = "<group>"; };
+ F96D435208F272B5004A47F5 /* cmdInfo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdInfo.test; sourceTree = "<group>"; };
+ F96D435308F272B5004A47F5 /* cmdMZ.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdMZ.test; sourceTree = "<group>"; };
+ F96D435408F272B5004A47F5 /* compExpr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "compExpr-old.test"; sourceTree = "<group>"; };
+ F96D435508F272B5004A47F5 /* compExpr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = compExpr.test; sourceTree = "<group>"; };
+ F96D435608F272B5004A47F5 /* compile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = compile.test; sourceTree = "<group>"; };
+ F96D435708F272B5004A47F5 /* concat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = concat.test; sourceTree = "<group>"; };
+ F96D435808F272B5004A47F5 /* config.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = config.test; sourceTree = "<group>"; };
+ F96D435908F272B5004A47F5 /* dcall.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dcall.test; sourceTree = "<group>"; };
+ F96D435A08F272B5004A47F5 /* dict.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dict.test; sourceTree = "<group>"; };
+ F96D435C08F272B5004A47F5 /* dstring.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dstring.test; sourceTree = "<group>"; };
+ F96D435E08F272B5004A47F5 /* encoding.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = encoding.test; sourceTree = "<group>"; };
+ F96D435F08F272B5004A47F5 /* env.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = env.test; sourceTree = "<group>"; };
+ F96D436008F272B5004A47F5 /* error.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = error.test; sourceTree = "<group>"; };
+ F96D436108F272B5004A47F5 /* eval.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eval.test; sourceTree = "<group>"; };
+ F96D436208F272B5004A47F5 /* event.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = event.test; sourceTree = "<group>"; };
+ F96D436308F272B5004A47F5 /* exec.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = exec.test; sourceTree = "<group>"; };
+ F96D436408F272B5004A47F5 /* execute.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = execute.test; sourceTree = "<group>"; };
+ F96D436508F272B5004A47F5 /* expr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "expr-old.test"; sourceTree = "<group>"; };
+ F96D436608F272B5004A47F5 /* expr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = expr.test; sourceTree = "<group>"; };
+ F96D436708F272B6004A47F5 /* fCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fCmd.test; sourceTree = "<group>"; };
+ F96D436808F272B6004A47F5 /* fileName.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fileName.test; sourceTree = "<group>"; };
+ F96D436908F272B6004A47F5 /* fileSystem.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fileSystem.test; sourceTree = "<group>"; };
+ F96D436A08F272B6004A47F5 /* for-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "for-old.test"; sourceTree = "<group>"; };
+ F96D436B08F272B6004A47F5 /* for.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = for.test; sourceTree = "<group>"; };
+ F96D436C08F272B6004A47F5 /* foreach.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = foreach.test; sourceTree = "<group>"; };
+ F96D436D08F272B6004A47F5 /* format.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = format.test; sourceTree = "<group>"; };
+ F96D436E08F272B6004A47F5 /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
+ F96D436F08F272B6004A47F5 /* history.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = history.test; sourceTree = "<group>"; };
+ F96D437008F272B6004A47F5 /* http.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.test; sourceTree = "<group>"; };
+ F96D437108F272B6004A47F5 /* httpd */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpd; sourceTree = "<group>"; };
+ F96D437208F272B6004A47F5 /* httpold.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpold.test; sourceTree = "<group>"; };
+ F96D437308F272B6004A47F5 /* if-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "if-old.test"; sourceTree = "<group>"; };
+ F96D437408F272B6004A47F5 /* if.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = if.test; sourceTree = "<group>"; };
+ F96D437508F272B6004A47F5 /* incr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "incr-old.test"; sourceTree = "<group>"; };
+ F96D437608F272B6004A47F5 /* incr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = incr.test; sourceTree = "<group>"; };
+ F96D437708F272B6004A47F5 /* indexObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = indexObj.test; sourceTree = "<group>"; };
+ F96D437808F272B6004A47F5 /* info.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = info.test; sourceTree = "<group>"; };
+ F96D437908F272B6004A47F5 /* init.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = init.test; sourceTree = "<group>"; };
+ F96D437A08F272B6004A47F5 /* interp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = interp.test; sourceTree = "<group>"; };
+ F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = "<group>"; };
+ F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = "<group>"; };
+ F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = "<group>"; };
+ F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = "<group>"; };
+ F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = "<group>"; };
+ F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = "<group>"; };
+ F96D438208F272B6004A47F5 /* linsert.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = linsert.test; sourceTree = "<group>"; };
+ F96D438308F272B6004A47F5 /* list.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = list.test; sourceTree = "<group>"; };
+ F96D438408F272B6004A47F5 /* listObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listObj.test; sourceTree = "<group>"; };
+ F96D438508F272B6004A47F5 /* llength.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = llength.test; sourceTree = "<group>"; };
+ F96D438608F272B6004A47F5 /* load.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = load.test; sourceTree = "<group>"; };
+ F96D438708F272B6004A47F5 /* lrange.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lrange.test; sourceTree = "<group>"; };
+ F96D438808F272B6004A47F5 /* lrepeat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lrepeat.test; sourceTree = "<group>"; };
+ F96D438908F272B6004A47F5 /* lreplace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lreplace.test; sourceTree = "<group>"; };
+ F96D438A08F272B6004A47F5 /* lsearch.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lsearch.test; sourceTree = "<group>"; };
+ F96D438B08F272B6004A47F5 /* lset.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lset.test; sourceTree = "<group>"; };
+ F96D438C08F272B6004A47F5 /* lsetComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lsetComp.test; sourceTree = "<group>"; };
+ F96D438D08F272B6004A47F5 /* macOSXFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXFCmd.test; sourceTree = "<group>"; };
+ F96D438E08F272B6004A47F5 /* main.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = main.test; sourceTree = "<group>"; };
+ F96D438F08F272B6004A47F5 /* misc.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = misc.test; sourceTree = "<group>"; };
+ F96D439008F272B6004A47F5 /* msgcat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgcat.test; sourceTree = "<group>"; };
+ F96D439108F272B6004A47F5 /* namespace-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "namespace-old.test"; sourceTree = "<group>"; };
+ F96D439208F272B7004A47F5 /* namespace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = namespace.test; sourceTree = "<group>"; };
+ F96D439308F272B7004A47F5 /* notify.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notify.test; sourceTree = "<group>"; };
+ F96D439408F272B7004A47F5 /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = "<group>"; };
+ F96D439508F272B7004A47F5 /* opt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = opt.test; sourceTree = "<group>"; };
+ F96D439608F272B7004A47F5 /* package.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = package.test; sourceTree = "<group>"; };
+ F96D439708F272B7004A47F5 /* parse.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parse.test; sourceTree = "<group>"; };
+ F96D439808F272B7004A47F5 /* parseExpr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parseExpr.test; sourceTree = "<group>"; };
+ F96D439908F272B7004A47F5 /* parseOld.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parseOld.test; sourceTree = "<group>"; };
+ F96D439A08F272B7004A47F5 /* pid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pid.test; sourceTree = "<group>"; };
+ F96D439B08F272B7004A47F5 /* pkg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkg.test; sourceTree = "<group>"; };
+ F96D439C08F272B7004A47F5 /* pkgMkIndex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgMkIndex.test; sourceTree = "<group>"; };
+ F96D439D08F272B7004A47F5 /* platform.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.test; sourceTree = "<group>"; };
+ F96D439E08F272B7004A47F5 /* proc-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "proc-old.test"; sourceTree = "<group>"; };
+ F96D439F08F272B7004A47F5 /* proc.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = proc.test; sourceTree = "<group>"; };
+ F96D43A008F272B7004A47F5 /* pwd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pwd.test; sourceTree = "<group>"; };
+ F96D43A108F272B7004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D43A208F272B7004A47F5 /* reg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = reg.test; sourceTree = "<group>"; };
+ F96D43A308F272B7004A47F5 /* regexp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexp.test; sourceTree = "<group>"; };
+ F96D43A408F272B7004A47F5 /* regexpComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpComp.test; sourceTree = "<group>"; };
+ F96D43A508F272B7004A47F5 /* registry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = registry.test; sourceTree = "<group>"; };
+ F96D43A608F272B7004A47F5 /* remote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = remote.tcl; sourceTree = "<group>"; };
+ F96D43A708F272B7004A47F5 /* rename.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = rename.test; sourceTree = "<group>"; };
+ F96D43A808F272B7004A47F5 /* result.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = result.test; sourceTree = "<group>"; };
+ F96D43A908F272B7004A47F5 /* safe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.test; sourceTree = "<group>"; };
+ F96D43AA08F272B7004A47F5 /* scan.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scan.test; sourceTree = "<group>"; };
+ F96D43AB08F272B7004A47F5 /* security.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = security.test; sourceTree = "<group>"; };
+ F96D43AC08F272B7004A47F5 /* set-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "set-old.test"; sourceTree = "<group>"; };
+ F96D43AD08F272B7004A47F5 /* set.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = set.test; sourceTree = "<group>"; };
+ F96D43AE08F272B7004A47F5 /* socket.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = socket.test; sourceTree = "<group>"; };
+ F96D43AF08F272B7004A47F5 /* source.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = source.test; sourceTree = "<group>"; };
+ F96D43B008F272B7004A47F5 /* split.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = split.test; sourceTree = "<group>"; };
+ F96D43B108F272B7004A47F5 /* stack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stack.test; sourceTree = "<group>"; };
+ F96D43B208F272B7004A47F5 /* string.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = string.test; sourceTree = "<group>"; };
+ F96D43B308F272B7004A47F5 /* stringComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stringComp.test; sourceTree = "<group>"; };
+ F96D43B408F272B7004A47F5 /* stringObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stringObj.test; sourceTree = "<group>"; };
+ F96D43B508F272B7004A47F5 /* subst.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = subst.test; sourceTree = "<group>"; };
+ F96D43B608F272B7004A47F5 /* switch.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = switch.test; sourceTree = "<group>"; };
+ F96D43B708F272B7004A47F5 /* tcltest.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcltest.test; sourceTree = "<group>"; };
+ F96D43B808F272B7004A47F5 /* thread.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = thread.test; sourceTree = "<group>"; };
+ F96D43B908F272B7004A47F5 /* timer.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = timer.test; sourceTree = "<group>"; };
+ F96D43BA08F272B7004A47F5 /* tm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tm.test; sourceTree = "<group>"; };
+ F96D43BB08F272B7004A47F5 /* trace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = trace.test; sourceTree = "<group>"; };
+ F96D43BC08F272B7004A47F5 /* unixFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFCmd.test; sourceTree = "<group>"; };
+ F96D43BD08F272B7004A47F5 /* unixFile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFile.test; sourceTree = "<group>"; };
+ F96D43BE08F272B7004A47F5 /* unixInit.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixInit.test; sourceTree = "<group>"; };
+ F96D43BF08F272B7004A47F5 /* unixNotfy.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixNotfy.test; sourceTree = "<group>"; };
+ F96D43C008F272B7004A47F5 /* unknown.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unknown.test; sourceTree = "<group>"; };
+ F96D43C108F272B7004A47F5 /* unload.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unload.test; sourceTree = "<group>"; };
+ F96D43C208F272B7004A47F5 /* uplevel.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uplevel.test; sourceTree = "<group>"; };
+ F96D43C308F272B7004A47F5 /* upvar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = upvar.test; sourceTree = "<group>"; };
+ F96D43C408F272B7004A47F5 /* utf.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = utf.test; sourceTree = "<group>"; };
+ F96D43C508F272B7004A47F5 /* util.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = util.test; sourceTree = "<group>"; };
+ F96D43C608F272B7004A47F5 /* var.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = var.test; sourceTree = "<group>"; };
+ F96D43C708F272B7004A47F5 /* while-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "while-old.test"; sourceTree = "<group>"; };
+ F96D43C808F272B7004A47F5 /* while.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = while.test; sourceTree = "<group>"; };
+ F96D43C908F272B7004A47F5 /* winConsole.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winConsole.test; sourceTree = "<group>"; };
+ F96D43CA08F272B7004A47F5 /* winDde.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winDde.test; sourceTree = "<group>"; };
+ F96D43CB08F272B7004A47F5 /* winFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFCmd.test; sourceTree = "<group>"; };
+ F96D43CC08F272B7004A47F5 /* winFile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFile.test; sourceTree = "<group>"; };
+ F96D43CD08F272B7004A47F5 /* winNotify.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winNotify.test; sourceTree = "<group>"; };
+ F96D43CE08F272B7004A47F5 /* winPipe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winPipe.test; sourceTree = "<group>"; };
+ F96D43CF08F272B7004A47F5 /* winTime.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTime.test; sourceTree = "<group>"; };
+ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = "<group>"; };
+ F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = "<group>"; };
+ F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = "<group>"; };
+ F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = "<group>"; };
+ F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = "<group>"; };
+ F96D442808F272B8004A47F5 /* installData.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = installData.tcl; sourceTree = "<group>"; };
+ F96D442908F272B8004A47F5 /* loadICU.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = loadICU.tcl; sourceTree = "<group>"; };
+ F96D442A08F272B8004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D442B08F272B8004A47F5 /* makeTestCases.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = makeTestCases.tcl; sourceTree = "<group>"; };
+ F96D442C08F272B8004A47F5 /* man2help.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help.tcl; sourceTree = "<group>"; };
+ F96D442D08F272B8004A47F5 /* man2help2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help2.tcl; sourceTree = "<group>"; };
+ F96D442E08F272B8004A47F5 /* man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html.tcl; sourceTree = "<group>"; };
+ F96D442F08F272B8004A47F5 /* man2html1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html1.tcl; sourceTree = "<group>"; };
+ F96D443008F272B8004A47F5 /* man2html2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html2.tcl; sourceTree = "<group>"; };
+ F96D443108F272B8004A47F5 /* man2tcl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = man2tcl.c; sourceTree = "<group>"; };
+ F96D443208F272B8004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D443308F272B8004A47F5 /* regexpTestLib.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpTestLib.tcl; sourceTree = "<group>"; };
+ F96D443508F272B8004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
+ F96D443608F272B8004A47F5 /* tcl.wse.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.wse.in; sourceTree = "<group>"; };
+ F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "tcltk-man2html.tcl"; sourceTree = "<group>"; };
+ F96D443A08F272B9004A47F5 /* tclZIC.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclZIC.tcl; sourceTree = "<group>"; };
+ F96D443B08F272B9004A47F5 /* uniClass.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniClass.tcl; sourceTree = "<group>"; };
+ F96D443C08F272B9004A47F5 /* uniParse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniParse.tcl; sourceTree = "<group>"; };
+ F96D444008F272B9004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F96D444108F272B9004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D444208F272B9004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D444408F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D444508F272B9004A47F5 /* pkga.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkga.c; sourceTree = "<group>"; };
+ F96D444608F272B9004A47F5 /* pkgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgb.c; sourceTree = "<group>"; };
+ F96D444708F272B9004A47F5 /* pkgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgc.c; sourceTree = "<group>"; };
+ F96D444808F272B9004A47F5 /* pkgd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgd.c; sourceTree = "<group>"; };
+ F96D444908F272B9004A47F5 /* pkge.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkge.c; sourceTree = "<group>"; };
+ F96D444B08F272B9004A47F5 /* pkgua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgua.c; sourceTree = "<group>"; };
+ F96D444C08F272B9004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D444D08F272B9004A47F5 /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = "<group>"; };
+ F96D444E08F272B9004A47F5 /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = "<group>"; };
+ F96D444F08F272B9004A47F5 /* ldAix */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ldAix; sourceTree = "<group>"; };
+ F96D445008F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D445208F272B9004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D445308F272B9004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F96D445408F272B9004A47F5 /* tcl.spec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.spec; sourceTree = "<group>"; };
+ F96D445508F272B9004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
+ F96D445608F272B9004A47F5 /* tclConfig.h.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = tclConfig.h.in; sourceTree = "<group>"; };
+ F96D445708F272B9004A47F5 /* tclConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tclConfig.sh.in; sourceTree = "<group>"; };
+ F96D445808F272B9004A47F5 /* tclLoadAix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadAix.c; sourceTree = "<group>"; };
+ F96D445908F272B9004A47F5 /* tclLoadDl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadDl.c; sourceTree = "<group>"; };
+ F96D445B08F272B9004A47F5 /* tclLoadDyld.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadDyld.c; sourceTree = "<group>"; };
+ F96D445C08F272B9004A47F5 /* tclLoadNext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadNext.c; sourceTree = "<group>"; };
+ F96D445D08F272B9004A47F5 /* tclLoadOSF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadOSF.c; sourceTree = "<group>"; };
+ F96D445E08F272B9004A47F5 /* tclLoadShl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadShl.c; sourceTree = "<group>"; };
+ F96D445F08F272B9004A47F5 /* tclUnixChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixChan.c; sourceTree = "<group>"; };
+ F96D446008F272B9004A47F5 /* tclUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixEvent.c; sourceTree = "<group>"; };
+ F96D446108F272B9004A47F5 /* tclUnixFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixFCmd.c; sourceTree = "<group>"; };
+ F96D446208F272B9004A47F5 /* tclUnixFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixFile.c; sourceTree = "<group>"; };
+ F96D446308F272B9004A47F5 /* tclUnixInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixInit.c; sourceTree = "<group>"; };
+ F96D446408F272B9004A47F5 /* tclUnixNotfy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixNotfy.c; sourceTree = "<group>"; };
+ F96D446508F272B9004A47F5 /* tclUnixPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixPipe.c; sourceTree = "<group>"; };
+ F96D446608F272B9004A47F5 /* tclUnixPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixPort.h; sourceTree = "<group>"; };
+ F96D446708F272B9004A47F5 /* tclUnixSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixSock.c; sourceTree = "<group>"; };
+ F96D446808F272B9004A47F5 /* tclUnixTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTest.c; sourceTree = "<group>"; };
+ F96D446908F272B9004A47F5 /* tclUnixThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixThrd.c; sourceTree = "<group>"; };
+ F96D446A08F272B9004A47F5 /* tclUnixThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixThrd.h; sourceTree = "<group>"; };
+ F96D446B08F272B9004A47F5 /* tclUnixTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTime.c; sourceTree = "<group>"; };
+ F96D446C08F272B9004A47F5 /* tclXtNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtNotify.c; sourceTree = "<group>"; };
+ F96D446D08F272B9004A47F5 /* tclXtTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtTest.c; sourceTree = "<group>"; };
+ F96D447008F272BA004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F96D447108F272BA004A47F5 /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; };
+ F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = "<group>"; };
+ F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = "<group>"; };
+ F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
+ F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
+ F96D447908F272BA004A47F5 /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
+ F96D447A08F272BA004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D447C08F272BA004A47F5 /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
+ F96D447D08F272BA004A47F5 /* stub16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub16.c; sourceTree = "<group>"; };
+ F96D447E08F272BA004A47F5 /* tcl.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsp; sourceTree = "<group>"; };
+ F96D447F08F272BA004A47F5 /* tcl.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsw; sourceTree = "<group>"; };
+ F96D448008F272BA004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
+ F96D448108F272BA004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F96D448208F272BA004A47F5 /* tcl.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.rc; sourceTree = "<group>"; };
+ F96D448308F272BA004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
+ F96D448408F272BA004A47F5 /* tclConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tclConfig.sh.in; sourceTree = "<group>"; };
+ F96D448608F272BA004A47F5 /* tclsh.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tclsh.rc; sourceTree = "<group>"; };
+ F96D448708F272BA004A47F5 /* tclWin32Dll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWin32Dll.c; sourceTree = "<group>"; };
+ F96D448808F272BA004A47F5 /* tclWinChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinChan.c; sourceTree = "<group>"; };
+ F96D448908F272BA004A47F5 /* tclWinConsole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinConsole.c; sourceTree = "<group>"; };
+ F96D448A08F272BA004A47F5 /* tclWinDde.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinDde.c; sourceTree = "<group>"; };
+ F96D448B08F272BA004A47F5 /* tclWinError.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinError.c; sourceTree = "<group>"; };
+ F96D448C08F272BA004A47F5 /* tclWinFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinFCmd.c; sourceTree = "<group>"; };
+ F96D448D08F272BA004A47F5 /* tclWinFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinFile.c; sourceTree = "<group>"; };
+ F96D448E08F272BA004A47F5 /* tclWinInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinInit.c; sourceTree = "<group>"; };
+ F96D448F08F272BA004A47F5 /* tclWinInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinInt.h; sourceTree = "<group>"; };
+ F96D449008F272BA004A47F5 /* tclWinLoad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinLoad.c; sourceTree = "<group>"; };
+ F96D449108F272BA004A47F5 /* tclWinNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinNotify.c; sourceTree = "<group>"; };
+ F96D449208F272BA004A47F5 /* tclWinPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinPipe.c; sourceTree = "<group>"; };
+ F96D449308F272BA004A47F5 /* tclWinPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinPort.h; sourceTree = "<group>"; };
+ F96D449408F272BA004A47F5 /* tclWinReg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinReg.c; sourceTree = "<group>"; };
+ F96D449508F272BA004A47F5 /* tclWinSerial.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinSerial.c; sourceTree = "<group>"; };
+ F96D449608F272BA004A47F5 /* tclWinSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinSock.c; sourceTree = "<group>"; };
+ F96D449708F272BA004A47F5 /* tclWinTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTest.c; sourceTree = "<group>"; };
+ F96D449808F272BA004A47F5 /* tclWinThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinThrd.c; sourceTree = "<group>"; };
+ F96D449908F272BA004A47F5 /* tclWinThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinThrd.h; sourceTree = "<group>"; };
+ F96D449A08F272BA004A47F5 /* tclWinTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTime.c; sourceTree = "<group>"; };
+ F973E5960EE99384001A648E /* vistaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vistaTheme.tcl; sourceTree = "<group>"; };
+ F974D56C0FBE7D6300BF728B /* http11.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http11.test; sourceTree = "<group>"; };
+ F974D56D0FBE7D6300BF728B /* httpd11.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpd11.tcl; sourceTree = "<group>"; };
+ F974D5720FBE7DC600BF728B /* coroutine.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = coroutine.n; sourceTree = "<group>"; };
+ F974D5760FBE7E1900BF728B /* tailcall.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tailcall.n; sourceTree = "<group>"; };
+ F974D5770FBE7E6100BF728B /* coroutine.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = coroutine.test; sourceTree = "<group>"; };
+ F974D5780FBE7E6100BF728B /* tailcall.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tailcall.test; sourceTree = "<group>"; };
+ F974D5790FBE7E9C00BF728B /* tcl.pc.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.pc.in; sourceTree = "<group>"; };
+ F974D57B0FBE7EC000BF728B /* tk.pc.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.pc.in; sourceTree = "<group>"; };
+ F974D57C0FBE7EFF00BF728B /* iconlist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iconlist.tcl; sourceTree = "<group>"; };
+ F974D57D0FBE7EFF00BF728B /* icons.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = icons.tcl; sourceTree = "<group>"; };
+ F97590AE1039A96200558A9A /* Wish.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = Wish.sdef; sourceTree = "<group>"; };
+ F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPrivate.h; sourceTree = "<group>"; };
+ F97AE7F10B65C1E900310EA2 /* Tk-Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Common.xcconfig"; sourceTree = "<group>"; };
+ F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Release.xcconfig"; sourceTree = "<group>"; };
+ F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Debug.xcconfig"; sourceTree = "<group>"; };
+ F98383650F0FA43900171CA6 /* checkbutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkbutton.test; sourceTree = "<group>"; };
+ F98383680F0FA44700171CA6 /* radiobutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = radiobutton.test; sourceTree = "<group>"; };
+ F9903CAF094FAADA004613E9 /* tclTomMath.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclTomMath.decls; sourceTree = "<group>"; };
+ F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMathDecls.h; sourceTree = "<group>"; };
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.tcl; sourceTree = "<group>"; };
+ F99388950EE02D980065FE6B /* fontchooser.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.test; sourceTree = "<group>"; };
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TclZlib.3; sourceTree = "<group>"; };
+ F9A3082D08F2D4AB00BAE1AB /* Tk.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A3084B08F2D4CE00BAE1AB /* Wish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wish.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A493240CEBF38300B78AE2 /* chanio.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chanio.test; sourceTree = "<group>"; };
+ F9C888C20EEF6571003F63AD /* fontchooser.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fontchooser.n; sourceTree = "<group>"; };
+ F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
+ F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mclist.tcl; sourceTree = "<group>"; };
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPNG.c; sourceTree = "<group>"; };
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPNG.test; sourceTree = "<group>"; };
+ F9ECB1120B26521500A28025 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F9ECB1130B26521500A28025 /* platform.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.tcl; sourceTree = "<group>"; };
+ F9ECB1140B26521500A28025 /* shell.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = shell.tcl; sourceTree = "<group>"; };
+ F9ECB1CA0B2652D300A28025 /* apply.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = apply.test; sourceTree = "<group>"; };
+ F9ECB1CB0B26534C00A28025 /* mathop.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mathop.test; sourceTree = "<group>"; };
+ F9ECB1E10B26543C00A28025 /* platform_shell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = platform_shell.n; sourceTree = "<group>"; };
+ F9ECB1E20B26543C00A28025 /* platform.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = platform.n; sourceTree = "<group>"; };
+ F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tclDTrace.d; sourceTree = "<group>"; };
+ F9F4EFDC0CC7B3CA00378A27 /* ttkpane.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; languageSpecificationIdentifier = shell; path = ttkpane.tcl; sourceTree = "<group>"; };
+ F9F4EFDD0CC7B3CB00378A27 /* ttkmenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; languageSpecificationIdentifier = shell; path = ttkmenu.tcl; sourceTree = "<group>"; };
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixCompat.c; sourceTree = "<group>"; };
+ F9FD31F40CC1AD070073837D /* tktest-X11 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "tktest-X11"; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9FD32140CC1AF170073837D /* libX11.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libX11.dylib; path = /usr/X11R6/lib/libX11.dylib; sourceTree = "<absolute>"; };
+ F9FD32150CC1AF170073837D /* libXext.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXext.dylib; path = /usr/X11R6/lib/libXext.dylib; sourceTree = "<absolute>"; };
+ F9FD32160CC1AF170073837D /* libXss.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXss.dylib; path = /usr/X11R6/lib/libXss.dylib; sourceTree = "<absolute>"; };
+ F9FD34990CC1BB0D0073837D /* libfreetype.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfreetype.dylib; path = /usr/X11R6/lib/libfreetype.dylib; sourceTree = "<absolute>"; };
+ F9FD349A0CC1BB0D0073837D /* libXft.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXft.dylib; path = /usr/X11R6/lib/libXft.dylib; sourceTree = "<absolute>"; };
+ F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfontconfig.dylib; path = /usr/X11R6/lib/libfontconfig.dylib; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76FAD0486AB0100D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */,
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */,
+ F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */,
+ F966C07908F28233005CB29B /* IOKit.framework in Frameworks */,
+ F94523A20E6FC2AC00C1D987 /* Cocoa.framework in Frameworks */,
+ F9C9CC000E84059800E00935 /* ApplicationServices.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9FD31E30CC1AD070073837D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */,
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */,
+ F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */,
+ F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */,
+ F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */,
+ F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */,
+ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */,
+ F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* Tk */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3DF708F271BE004A47F5 /* Tk Sources */,
+ F96D3DF608F27169004A47F5 /* Tcl Sources */,
+ F966C06F08F281DC005CB29B /* Frameworks */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n";
+ name = Tk;
+ path = .;
+ sourceTree = SOURCE_ROOT;
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ F9A3084B08F2D4CE00BAE1AB /* Wish.app */,
+ F9A3082D08F2D4AB00BAE1AB /* Tk.framework */,
+ F9A3084E08F2D4F400BAE1AB /* Tcl.framework */,
+ 8DD76FB20486AB0100D96B5E /* tktest */,
+ F9FD31F40CC1AD070073837D /* tktest-X11 */,
+ );
+ includeInIndex = 0;
+ name = Products;
+ sourceTree = "<group>";
+ };
+ F9183E690EFC81560030B814 /* pkgs */ = {
+ isa = PBXGroup;
+ children = (
+ F9183E6A0EFC81560030B814 /* README */,
+ F946FB8B0FBE3AED00CD6495 /* itcl */,
+ F9183E8F0EFC817B0030B814 /* tdbc */,
+ );
+ path = pkgs;
+ sourceTree = "<group>";
+ };
+ F966BA0308F27A37005CB29B /* bitmaps */ = {
+ isa = PBXGroup;
+ children = (
+ F966BA0408F27A37005CB29B /* error.xbm */,
+ F966BA0508F27A37005CB29B /* gray12.xbm */,
+ F966BA0608F27A37005CB29B /* gray25.xbm */,
+ F966BA0708F27A37005CB29B /* gray50.xbm */,
+ F966BA0808F27A37005CB29B /* gray75.xbm */,
+ F966BA0908F27A37005CB29B /* hourglass.xbm */,
+ F966BA0A08F27A37005CB29B /* info.xbm */,
+ F966BA0B08F27A37005CB29B /* questhead.xbm */,
+ F966BA0C08F27A37005CB29B /* question.xbm */,
+ F966BA0D08F27A37005CB29B /* warning.xbm */,
+ );
+ path = bitmaps;
+ sourceTree = "<group>";
+ };
+ F966BA1008F27A37005CB29B /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ F966BA1108F27A37005CB29B /* 3DBorder.3 */,
+ F966BA1208F27A37005CB29B /* AddOption.3 */,
+ F966BA1308F27A37005CB29B /* bell.n */,
+ F966BA1408F27A37005CB29B /* bind.n */,
+ F966BA1508F27A37005CB29B /* BindTable.3 */,
+ F966BA1608F27A37005CB29B /* bindtags.n */,
+ F966BA1708F27A37005CB29B /* bitmap.n */,
+ F966BA1808F27A37005CB29B /* button.n */,
+ F966BA1908F27A37005CB29B /* canvas.n */,
+ F966BA1A08F27A37005CB29B /* CanvPsY.3 */,
+ F966BA1B08F27A37005CB29B /* CanvTkwin.3 */,
+ F966BA1C08F27A37005CB29B /* CanvTxtInfo.3 */,
+ F966BA1D08F27A37005CB29B /* checkbutton.n */,
+ F966BA1E08F27A37005CB29B /* chooseColor.n */,
+ F966BA1F08F27A37005CB29B /* chooseDirectory.n */,
+ F966BA2008F27A37005CB29B /* Clipboard.3 */,
+ F966BA2108F27A37005CB29B /* clipboard.n */,
+ F966BA2208F27A37005CB29B /* ClrSelect.3 */,
+ F966BA2308F27A37005CB29B /* colors.n */,
+ F966BA2408F27A37005CB29B /* ConfigWidg.3 */,
+ F966BA2508F27A37005CB29B /* ConfigWind.3 */,
+ F966BA2608F27A37005CB29B /* console.n */,
+ F966BA2708F27A37005CB29B /* CoordToWin.3 */,
+ F966BA2808F27A37005CB29B /* CrtCmHdlr.3 */,
+ F966BA2908F27A37005CB29B /* CrtErrHdlr.3 */,
+ F966BA2A08F27A37005CB29B /* CrtGenHdlr.3 */,
+ F966BA2B08F27A37005CB29B /* CrtImgType.3 */,
+ F966BA2C08F27A37005CB29B /* CrtItemType.3 */,
+ F966BA2D08F27A37005CB29B /* CrtPhImgFmt.3 */,
+ F966BA2E08F27A37005CB29B /* CrtSelHdlr.3 */,
+ F966BA2F08F27A37005CB29B /* CrtWindow.3 */,
+ F966BA3008F27A37005CB29B /* cursors.n */,
+ F966BA3108F27A37005CB29B /* DeleteImg.3 */,
+ F966BA3208F27A37005CB29B /* destroy.n */,
+ F966BA3308F27A37005CB29B /* dialog.n */,
+ F966BA3408F27A37005CB29B /* DrawFocHlt.3 */,
+ F966BA3508F27A37005CB29B /* entry.n */,
+ F966BA3608F27A37005CB29B /* event.n */,
+ F966BA3708F27A37005CB29B /* EventHndlr.3 */,
+ F966BA3808F27A37005CB29B /* FindPhoto.3 */,
+ F966BA3908F27A37005CB29B /* focus.n */,
+ F966BA3A08F27A37005CB29B /* focusNext.n */,
+ F966BA3B08F27A37005CB29B /* font.n */,
+ F9C888C20EEF6571003F63AD /* fontchooser.n */,
+ F966BA3C08F27A37005CB29B /* FontId.3 */,
+ F966BA3D08F27A37005CB29B /* frame.n */,
+ F966BA3E08F27A37005CB29B /* FreeXId.3 */,
+ F966BA3F08F27A37005CB29B /* GeomReq.3 */,
+ F966BA4008F27A37005CB29B /* GetAnchor.3 */,
+ F966BA4108F27A37005CB29B /* GetBitmap.3 */,
+ F966BA4208F27A37005CB29B /* GetCapStyl.3 */,
+ F966BA4308F27A37005CB29B /* GetClrmap.3 */,
+ F966BA4408F27A37005CB29B /* GetColor.3 */,
+ F966BA4508F27A37005CB29B /* GetCursor.3 */,
+ F966BA4608F27A37005CB29B /* GetDash.3 */,
+ F966BA4708F27A37005CB29B /* GetFont.3 */,
+ F966BA4808F27A37005CB29B /* GetGC.3 */,
+ F966BA4908F27A37005CB29B /* GetHINSTANCE.3 */,
+ F966BA4A08F27A37005CB29B /* GetHWND.3 */,
+ F966BA4B08F27A37005CB29B /* GetImage.3 */,
+ F966BA4C08F27A37005CB29B /* GetJoinStl.3 */,
+ F966BA4D08F27A37005CB29B /* GetJustify.3 */,
+ F966BA4E08F27A37005CB29B /* getOpenFile.n */,
+ F966BA4F08F27A37005CB29B /* GetOption.3 */,
+ F966BA5008F27A38005CB29B /* GetPixels.3 */,
+ F966BA5108F27A38005CB29B /* GetPixmap.3 */,
+ F966BA5208F27A38005CB29B /* GetRelief.3 */,
+ F966BA5308F27A38005CB29B /* GetRootCrd.3 */,
+ F966BA5408F27A38005CB29B /* GetScroll.3 */,
+ F966BA5508F27A38005CB29B /* GetSelect.3 */,
+ F966BA5608F27A38005CB29B /* GetUid.3 */,
+ F966BA5708F27A38005CB29B /* GetVisual.3 */,
+ F966BA5808F27A38005CB29B /* GetVRoot.3 */,
+ F966BA5908F27A38005CB29B /* Grab.3 */,
+ F966BA5A08F27A38005CB29B /* grab.n */,
+ F966BA5B08F27A38005CB29B /* grid.n */,
+ F966BA5C08F27A38005CB29B /* HandleEvent.3 */,
+ F966BA5D08F27A38005CB29B /* HWNDToWindow.3 */,
+ F966BA5E08F27A38005CB29B /* IdToWindow.3 */,
+ F966BA5F08F27A38005CB29B /* image.n */,
+ F966BA6008F27A38005CB29B /* ImgChanged.3 */,
+ F966BA6108F27A38005CB29B /* Inactive.3 */,
+ F966BA6208F27A38005CB29B /* InternAtom.3 */,
+ F966BA6308F27A38005CB29B /* keysyms.n */,
+ F966BA6408F27A38005CB29B /* label.n */,
+ F966BA6508F27A38005CB29B /* labelframe.n */,
+ F966BA6608F27A38005CB29B /* listbox.n */,
+ F966BA6708F27A38005CB29B /* loadTk.n */,
+ F966BA6808F27A38005CB29B /* lower.n */,
+ F966BA6908F27A38005CB29B /* MainLoop.3 */,
+ F966BA6A08F27A38005CB29B /* MaintGeom.3 */,
+ F966BA6B08F27A38005CB29B /* MainWin.3 */,
+ F966BA6D08F27A38005CB29B /* ManageGeom.3 */,
+ F966BA6E08F27A38005CB29B /* MapWindow.3 */,
+ F966BA6F08F27A38005CB29B /* MeasureChar.3 */,
+ F966BA7008F27A38005CB29B /* menu.n */,
+ F966BA7108F27A38005CB29B /* menubar.n */,
+ F966BA7208F27A38005CB29B /* menubutton.n */,
+ F966BA7308F27A38005CB29B /* message.n */,
+ F966BA7408F27A38005CB29B /* messageBox.n */,
+ F966BA7508F27A38005CB29B /* MoveToplev.3 */,
+ F966BA7608F27A38005CB29B /* Name.3 */,
+ F966BA7708F27A38005CB29B /* NameOfImg.3 */,
+ F966BA7808F27A38005CB29B /* option.n */,
+ F966BA7908F27A38005CB29B /* optionMenu.n */,
+ F966BA7A08F27A38005CB29B /* options.n */,
+ F966BA7B08F27A38005CB29B /* OwnSelect.3 */,
+ F966BA7C08F27A38005CB29B /* pack-old.n */,
+ F966BA7D08F27A38005CB29B /* pack.n */,
+ F966BA7E08F27A38005CB29B /* palette.n */,
+ F966BA7F08F27A38005CB29B /* panedwindow.n */,
+ F966BA8008F27A38005CB29B /* ParseArgv.3 */,
+ F966BA8108F27A38005CB29B /* photo.n */,
+ F966BA8208F27A38005CB29B /* place.n */,
+ F966BA8308F27A38005CB29B /* popup.n */,
+ F966BA8408F27A38005CB29B /* QWinEvent.3 */,
+ F966BA8508F27A38005CB29B /* radiobutton.n */,
+ F966BA8608F27A38005CB29B /* raise.n */,
+ F966BA8708F27A38005CB29B /* Restack.3 */,
+ F966BA8808F27A38005CB29B /* RestrictEv.3 */,
+ F966BA8908F27A38005CB29B /* scale.n */,
+ F966BA8A08F27A38005CB29B /* scrollbar.n */,
+ F966BA8B08F27A38005CB29B /* selection.n */,
+ F966BA8C08F27A38005CB29B /* send.n */,
+ F966BA8D08F27A38005CB29B /* SetAppName.3 */,
+ F966BA8E08F27A38005CB29B /* SetCaret.3 */,
+ F966BA8F08F27A38005CB29B /* SetClass.3 */,
+ F966BA9008F27A38005CB29B /* SetClassProcs.3 */,
+ F966BA9108F27A38005CB29B /* SetGrid.3 */,
+ F966BA9208F27A38005CB29B /* SetOptions.3 */,
+ F966BA9308F27A38005CB29B /* SetVisual.3 */,
+ F966BA9408F27A38005CB29B /* spinbox.n */,
+ F966BA9508F27A38005CB29B /* StrictMotif.3 */,
+ F966BA9608F27A38005CB29B /* text.n */,
+ F966BA9708F27A38005CB29B /* TextLayout.3 */,
+ F966BA9808F27A38005CB29B /* tk.n */,
+ F966BA9A08F27A38005CB29B /* Tk_Init.3 */,
+ F966BA9B08F27A38005CB29B /* Tk_Main.3 */,
+ F966BA9C08F27A38005CB29B /* tkerror.n */,
+ F966BA9D08F27A38005CB29B /* TkInitStubs.3 */,
+ F966BA9E08F27A38005CB29B /* tkvars.n */,
+ F966BA9F08F27A38005CB29B /* tkwait.n */,
+ F966BAA008F27A38005CB29B /* toplevel.n */,
+ F968886B0AF788F6000797B5 /* ttk_button.n */,
+ F968886C0AF788F6000797B5 /* ttk_checkbutton.n */,
+ F968886D0AF788F6000797B5 /* ttk_combobox.n */,
+ F968886F0AF788F6000797B5 /* ttk_entry.n */,
+ F96888700AF788F6000797B5 /* ttk_frame.n */,
+ F96888710AF788F6000797B5 /* ttk_Geometry.3 */,
+ F96888720AF788F6000797B5 /* ttk_image.n */,
+ F96888730AF788F6000797B5 /* ttk_intro.n */,
+ F96888740AF788F6000797B5 /* ttk_label.n */,
+ F96888750AF788F6000797B5 /* ttk_labelframe.n */,
+ F96888760AF788F6000797B5 /* ttk_menubutton.n */,
+ F96888770AF788F6000797B5 /* ttk_notebook.n */,
+ F96888780AF788F6000797B5 /* ttk_panedwindow.n */,
+ F96888790AF788F6000797B5 /* ttk_progressbar.n */,
+ F968887A0AF788F6000797B5 /* ttk_radiobutton.n */,
+ F968887B0AF788F6000797B5 /* ttk_scrollbar.n */,
+ F968887C0AF788F6000797B5 /* ttk_separator.n */,
+ F968887D0AF788F6000797B5 /* ttk_sizegrip.n */,
+ F968887E0AF788F6000797B5 /* ttk_style.n */,
+ F968887F0AF788F6000797B5 /* ttk_Theme.3 */,
+ F96888800AF788F6000797B5 /* ttk_treeview.n */,
+ F96888810AF788F6000797B5 /* ttk_widget.n */,
+ F966BAA108F27A38005CB29B /* WindowId.3 */,
+ F966BAA208F27A38005CB29B /* winfo.n */,
+ F966BAA308F27A38005CB29B /* wish.1 */,
+ F966BAA408F27A38005CB29B /* wm.n */,
+ );
+ path = doc;
+ sourceTree = "<group>";
+ };
+ F966BAA508F27A38005CB29B /* generic */ = {
+ isa = PBXGroup;
+ children = (
+ F966BAA608F27A38005CB29B /* default.h */,
+ F966BAA708F27A38005CB29B /* ks_names.h */,
+ F966BAA908F27A39005CB29B /* README */,
+ F966BAAA08F27A39005CB29B /* tk.decls */,
+ F966BAAB08F27A39005CB29B /* tk.h */,
+ F966BAAC08F27A39005CB29B /* tk3d.c */,
+ F966BAAD08F27A39005CB29B /* tk3d.h */,
+ F966BAAE08F27A39005CB29B /* tkArgv.c */,
+ F966BAAF08F27A39005CB29B /* tkAtom.c */,
+ F966BAB008F27A39005CB29B /* tkBind.c */,
+ F966BAB108F27A39005CB29B /* tkBitmap.c */,
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */,
+ F966BAB208F27A39005CB29B /* tkButton.c */,
+ F966BAB308F27A39005CB29B /* tkButton.h */,
+ F966BAB408F27A39005CB29B /* tkCanvArc.c */,
+ F966BAB508F27A39005CB29B /* tkCanvas.c */,
+ F966BAB608F27A39005CB29B /* tkCanvas.h */,
+ F966BAB708F27A39005CB29B /* tkCanvBmap.c */,
+ F966BAB808F27A39005CB29B /* tkCanvImg.c */,
+ F966BAB908F27A39005CB29B /* tkCanvLine.c */,
+ F966BABA08F27A39005CB29B /* tkCanvPoly.c */,
+ F966BABB08F27A39005CB29B /* tkCanvPs.c */,
+ F966BABD08F27A39005CB29B /* tkCanvText.c */,
+ F966BABE08F27A39005CB29B /* tkCanvUtil.c */,
+ F966BABF08F27A39005CB29B /* tkCanvWind.c */,
+ F966BAC008F27A39005CB29B /* tkClipboard.c */,
+ F966BAC108F27A39005CB29B /* tkCmds.c */,
+ F966BAC208F27A39005CB29B /* tkColor.c */,
+ F966BAC308F27A39005CB29B /* tkColor.h */,
+ F966BAC408F27A39005CB29B /* tkConfig.c */,
+ F966BAC508F27A39005CB29B /* tkConsole.c */,
+ F966BAC608F27A39005CB29B /* tkCursor.c */,
+ F966BAC708F27A39005CB29B /* tkDecls.h */,
+ F966BAC808F27A39005CB29B /* tkEntry.c */,
+ F966BAC908F27A39005CB29B /* tkEntry.h */,
+ F966BACA08F27A39005CB29B /* tkError.c */,
+ F966BACB08F27A39005CB29B /* tkEvent.c */,
+ F966BACC08F27A39005CB29B /* tkFileFilter.c */,
+ F966BACD08F27A39005CB29B /* tkFileFilter.h */,
+ F966BACE08F27A39005CB29B /* tkFocus.c */,
+ F966BACF08F27A39005CB29B /* tkFont.c */,
+ F966BAD008F27A39005CB29B /* tkFont.h */,
+ F966BAD108F27A39005CB29B /* tkFrame.c */,
+ F966BAD208F27A39005CB29B /* tkGC.c */,
+ F966BAD308F27A39005CB29B /* tkGeometry.c */,
+ F966BAD408F27A39005CB29B /* tkGet.c */,
+ F966BAD508F27A39005CB29B /* tkGrab.c */,
+ F966BAD608F27A39005CB29B /* tkGrid.c */,
+ F966BAD708F27A39005CB29B /* tkImage.c */,
+ F966BAD808F27A39005CB29B /* tkImgBmap.c */,
+ F966BAD908F27A39005CB29B /* tkImgGIF.c */,
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */,
+ F966BADA08F27A39005CB29B /* tkImgPhoto.c */,
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */,
+ F966BADB08F27A39005CB29B /* tkImgPPM.c */,
+ F966BADC08F27A39005CB29B /* tkImgUtil.c */,
+ F966BADE08F27A39005CB29B /* tkInt.decls */,
+ F966BADF08F27A39005CB29B /* tkInt.h */,
+ F966BAE108F27A39005CB29B /* tkIntDecls.h */,
+ F966BAE208F27A39005CB29B /* tkIntPlatDecls.h */,
+ F966BAE308F27A39005CB29B /* tkIntXlibDecls.h */,
+ F966BAE408F27A39005CB29B /* tkListbox.c */,
+ F966BAE508F27A39005CB29B /* tkMacWinMenu.c */,
+ F966BAE608F27A39005CB29B /* tkMain.c */,
+ F966BAE708F27A39005CB29B /* tkMenu.c */,
+ F966BAE808F27A39005CB29B /* tkMenu.h */,
+ F966BAE908F27A39005CB29B /* tkMenubutton.c */,
+ F966BAEA08F27A39005CB29B /* tkMenubutton.h */,
+ F966BAEB08F27A39005CB29B /* tkMenuDraw.c */,
+ F966BAEC08F27A39005CB29B /* tkMessage.c */,
+ F966BAED08F27A39005CB29B /* tkObj.c */,
+ F966BAEE08F27A39005CB29B /* tkOldConfig.c */,
+ F966BAEF08F27A39005CB29B /* tkOption.c */,
+ F966BAF008F27A39005CB29B /* tkPack.c */,
+ F966BAF108F27A39005CB29B /* tkPanedWindow.c */,
+ F966BAF208F27A39005CB29B /* tkPlace.c */,
+ F966BAF308F27A39005CB29B /* tkPlatDecls.h */,
+ F966BAF408F27A39005CB29B /* tkPointer.c */,
+ F966BAF508F27A39005CB29B /* tkPort.h */,
+ F966BAF608F27A39005CB29B /* tkRectOval.c */,
+ F966BAF708F27A39005CB29B /* tkScale.c */,
+ F966BAF808F27A39005CB29B /* tkScale.h */,
+ F966BAF908F27A39005CB29B /* tkScrollbar.c */,
+ F966BAFA08F27A39005CB29B /* tkScrollbar.h */,
+ F966BAFB08F27A39005CB29B /* tkSelect.c */,
+ F966BAFC08F27A39005CB29B /* tkSelect.h */,
+ F966BAFD08F27A39005CB29B /* tkSquare.c */,
+ F966BAFE08F27A39005CB29B /* tkOldTest.c */,
+ F966BAFF08F27A39005CB29B /* tkStubInit.c */,
+ F966BB0008F27A39005CB29B /* tkStubLib.c */,
+ F966BB0108F27A39005CB29B /* tkStyle.c */,
+ F966BB0208F27A39005CB29B /* tkTest.c */,
+ F966BB0308F27A39005CB29B /* tkText.c */,
+ F966BB0408F27A39005CB29B /* tkText.h */,
+ F966BB0508F27A39005CB29B /* tkTextBTree.c */,
+ F966BB0608F27A39005CB29B /* tkTextDisp.c */,
+ F966BB0808F27A39005CB29B /* tkTextImage.c */,
+ F966BB0908F27A39005CB29B /* tkTextIndex.c */,
+ F966BB0A08F27A39005CB29B /* tkTextMark.c */,
+ F966BB0B08F27A39005CB29B /* tkTextTag.c */,
+ F966BB0C08F27A39005CB29B /* tkTextWind.c */,
+ F966BB0D08F27A39005CB29B /* tkTrig.c */,
+ F966BB0E08F27A39005CB29B /* tkUndo.c */,
+ F966BB0F08F27A39005CB29B /* tkUndo.h */,
+ F966BB1008F27A39005CB29B /* tkUtil.c */,
+ F966BB1108F27A39005CB29B /* tkVisual.c */,
+ F966BB1208F27A39005CB29B /* tkWindow.c */,
+ F96887DF0AF786D5000797B5 /* ttk */,
+ );
+ path = generic;
+ sourceTree = "<group>";
+ };
+ F966BB1308F27A39005CB29B /* library */ = {
+ isa = PBXGroup;
+ children = (
+ F966BB1408F27A39005CB29B /* bgerror.tcl */,
+ F966BB1508F27A39005CB29B /* button.tcl */,
+ F966BB1608F27A39005CB29B /* choosedir.tcl */,
+ F966BB1708F27A39005CB29B /* clrpick.tcl */,
+ F966BB1808F27A39005CB29B /* comdlg.tcl */,
+ F966BB1908F27A39005CB29B /* console.tcl */,
+ F966BB1A08F27A39005CB29B /* demos */,
+ F966BB6208F27A3A005CB29B /* dialog.tcl */,
+ F966BB6308F27A3A005CB29B /* entry.tcl */,
+ F966BB6408F27A3A005CB29B /* focus.tcl */,
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */,
+ F974D57C0FBE7EFF00BF728B /* iconlist.tcl */,
+ F974D57D0FBE7EFF00BF728B /* icons.tcl */,
+ F966BB7308F27A3A005CB29B /* listbox.tcl */,
+ F966BB7408F27A3A005CB29B /* menu.tcl */,
+ F966BB7508F27A3A005CB29B /* mkpsenc.tcl */,
+ F966BB7608F27A3A005CB29B /* msgbox.tcl */,
+ F966BB8608F27A3A005CB29B /* obsolete.tcl */,
+ F966BB8708F27A3A005CB29B /* optMenu.tcl */,
+ F966BB8808F27A3A005CB29B /* palette.tcl */,
+ F966BB8908F27A3B005CB29B /* panedwindow.tcl */,
+ F966BB8B08F27A3B005CB29B /* safetk.tcl */,
+ F966BB8C08F27A3B005CB29B /* scale.tcl */,
+ F966BB8D08F27A3B005CB29B /* scrlbar.tcl */,
+ F966BB8E08F27A3B005CB29B /* spinbox.tcl */,
+ F966BB8F08F27A3B005CB29B /* tclIndex */,
+ F966BB9008F27A3B005CB29B /* tearoff.tcl */,
+ F966BB9108F27A3B005CB29B /* text.tcl */,
+ F966BB9208F27A3B005CB29B /* tk.tcl */,
+ F966BB9308F27A3B005CB29B /* tkfbox.tcl */,
+ F96888360AF787B3000797B5 /* ttk */,
+ F966BB9408F27A3B005CB29B /* unsupported.tcl */,
+ F966BB9508F27A3B005CB29B /* xmfbox.tcl */,
+ );
+ path = library;
+ sourceTree = "<group>";
+ };
+ F966BB1A08F27A39005CB29B /* demos */ = {
+ isa = PBXGroup;
+ children = (
+ F966BB1B08F27A39005CB29B /* anilabel.tcl */,
+ F966BB1C08F27A39005CB29B /* aniwave.tcl */,
+ F966BB1D08F27A39005CB29B /* arrow.tcl */,
+ F966BB1E08F27A39005CB29B /* bind.tcl */,
+ F966BB1F08F27A39005CB29B /* bitmap.tcl */,
+ F966BB2008F27A39005CB29B /* browse */,
+ F966BB2108F27A39005CB29B /* button.tcl */,
+ F966BB2208F27A39005CB29B /* check.tcl */,
+ F966BB2308F27A39005CB29B /* clrpick.tcl */,
+ F966BB2408F27A39005CB29B /* colors.tcl */,
+ F936FCDB0CCD984600716967 /* combo.tcl */,
+ F966BB2508F27A39005CB29B /* cscroll.tcl */,
+ F966BB2608F27A39005CB29B /* ctext.tcl */,
+ F966BB2708F27A39005CB29B /* dialog1.tcl */,
+ F966BB2808F27A39005CB29B /* dialog2.tcl */,
+ F966BB2A08F27A39005CB29B /* entry1.tcl */,
+ F966BB2B08F27A39005CB29B /* entry2.tcl */,
+ F966BB2C08F27A39005CB29B /* entry3.tcl */,
+ F966BB2D08F27A39005CB29B /* filebox.tcl */,
+ F966BB2E08F27A39005CB29B /* floor.tcl */,
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */,
+ F966BB2F08F27A39005CB29B /* form.tcl */,
+ F966BB3008F27A39005CB29B /* goldberg.tcl */,
+ F966BB3108F27A39005CB29B /* hello */,
+ F966BB3208F27A39005CB29B /* hscale.tcl */,
+ F966BB3308F27A39005CB29B /* icon.tcl */,
+ F966BB3408F27A39005CB29B /* image1.tcl */,
+ F966BB3508F27A39005CB29B /* image2.tcl */,
+ F966BB4208F27A3A005CB29B /* items.tcl */,
+ F966BB4308F27A3A005CB29B /* ixset */,
+ F92240290D7C620F005EC715 /* knightstour.tcl */,
+ F966BB4408F27A3A005CB29B /* label.tcl */,
+ F966BB4508F27A3A005CB29B /* labelframe.tcl */,
+ F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */,
+ F966BB4608F27A3A005CB29B /* menu.tcl */,
+ F966BB4708F27A3A005CB29B /* menubu.tcl */,
+ F966BB4808F27A3A005CB29B /* msgbox.tcl */,
+ F966BB4A08F27A3A005CB29B /* paned1.tcl */,
+ F966BB4B08F27A3A005CB29B /* paned2.tcl */,
+ F966BB4C08F27A3A005CB29B /* pendulum.tcl */,
+ F966BB4D08F27A3A005CB29B /* plot.tcl */,
+ F966BB4E08F27A3A005CB29B /* puzzle.tcl */,
+ F966BB4F08F27A3A005CB29B /* radio.tcl */,
+ F966BB5008F27A3A005CB29B /* README */,
+ F966BB5108F27A3A005CB29B /* rmt */,
+ F966BB5208F27A3A005CB29B /* rolodex */,
+ F966BB5308F27A3A005CB29B /* ruler.tcl */,
+ F966BB5408F27A3A005CB29B /* sayings.tcl */,
+ F966BB5508F27A3A005CB29B /* search.tcl */,
+ F966BB5608F27A3A005CB29B /* spin.tcl */,
+ F966BB5708F27A3A005CB29B /* square */,
+ F966BB5808F27A3A005CB29B /* states.tcl */,
+ F966BB5908F27A3A005CB29B /* style.tcl */,
+ F966BB5A08F27A3A005CB29B /* tclIndex */,
+ F966BB5B08F27A3A005CB29B /* tcolor */,
+ F966BB5C08F27A3A005CB29B /* text.tcl */,
+ F9099B8A0CC67D30005A9580 /* textpeer.tcl */,
+ F966BB5D08F27A3A005CB29B /* timer */,
+ F936FCD90CCD984600716967 /* toolbar.tcl */,
+ F936FCD80CCD984600716967 /* tree.tcl */,
+ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */,
+ F9F4EFDD0CC7B3CB00378A27 /* ttkmenu.tcl */,
+ F936FCDA0CCD984600716967 /* ttknote.tcl */,
+ F9F4EFDC0CC7B3CA00378A27 /* ttkpane.tcl */,
+ F936FCD70CCD984500716967 /* ttkprogress.tcl */,
+ F966BB5E08F27A3A005CB29B /* twind.tcl */,
+ F966BB5F08F27A3A005CB29B /* unicodeout.tcl */,
+ F966BB6008F27A3A005CB29B /* vscale.tcl */,
+ F966BB6108F27A3A005CB29B /* widget */,
+ );
+ path = demos;
+ sourceTree = "<group>";
+ };
+ F966BB9708F27A3B005CB29B /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ F966BBBA08F27A3B005CB29B /* configure.ac */,
+ F966BBBB08F27A3B005CB29B /* GNUmakefile */,
+ F966BBBE08F27A3B005CB29B /* README */,
+ F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */,
+ F966BBC208F27A3B005CB29B /* tkMacOSX.h */,
+ F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */,
+ F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */,
+ F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */,
+ F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */,
+ F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */,
+ F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */,
+ F966BBCC08F27A3B005CB29B /* tkMacOSXCursors.h */,
+ F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */,
+ F966BBCE08F27A3B005CB29B /* tkMacOSXDebug.h */,
+ F966BBCF08F27A3B005CB29B /* tkMacOSXDefault.h */,
+ F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */,
+ F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */,
+ F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */,
+ F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */,
+ F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */,
+ F966BBD508F27A3B005CB29B /* tkMacOSXEvent.h */,
+ F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */,
+ F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */,
+ F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */,
+ F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */,
+ F966BBDA08F27A3B005CB29B /* tkMacOSXInt.h */,
+ F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */,
+ F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */,
+ F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */,
+ F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */,
+ F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */,
+ F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */,
+ F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */,
+ F966BBEA08F27A3C005CB29B /* tkMacOSXPort.h */,
+ F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */,
+ F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */,
+ F966BBEC08F27A3C005CB29B /* tkMacOSXScale.c */,
+ F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */,
+ F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */,
+ F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */,
+ F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */,
+ F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */,
+ F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */,
+ F966BBF308F27A3C005CB29B /* tkMacOSXWm.h */,
+ F966BBF408F27A3C005CB29B /* tkMacOSXXCursors.h */,
+ F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */,
+ F96888840AF78938000797B5 /* ttkMacOSXTheme.c */,
+ F95D8D4B0F1715610006B020 /* Tk.icns */,
+ F95D8D4C0F1715610006B020 /* Tk.tiff */,
+ F966BBF708F27A3C005CB29B /* Wish-Info.plist.in */,
+ F97590AE1039A96200558A9A /* Wish.sdef */,
+ F97AE7F10B65C1E900310EA2 /* Tk-Common.xcconfig */,
+ F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */,
+ F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ F966BC0408F27A3C005CB29B /* tests */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC0508F27A3C005CB29B /* all.tcl */,
+ F966BC0608F27A3C005CB29B /* arc.tcl */,
+ F966BC0708F27A3C005CB29B /* bell.test */,
+ F966BC0808F27A3C005CB29B /* bevel.tcl */,
+ F966BC0908F27A3C005CB29B /* bgerror.test */,
+ F966BC0A08F27A3C005CB29B /* bind.test */,
+ F966BC0B08F27A3C005CB29B /* bitmap.test */,
+ F966BC0C08F27A3C005CB29B /* border.test */,
+ F966BC0D08F27A3C005CB29B /* bugs.tcl */,
+ F966BC0E08F27A3C005CB29B /* butGeom.tcl */,
+ F966BC0F08F27A3C005CB29B /* butGeom2.tcl */,
+ F966BC1008F27A3C005CB29B /* button.test */,
+ F966BC1108F27A3C005CB29B /* canvas.test */,
+ F966BC1208F27A3C005CB29B /* canvImg.test */,
+ F966BC1308F27A3C005CB29B /* canvPs.test */,
+ F966BC1408F27A3C005CB29B /* canvPsArc.tcl */,
+ F966BC1508F27A3C005CB29B /* canvPsBmap.tcl */,
+ F966BC1608F27A3C005CB29B /* canvPsGrph.tcl */,
+ F966BC1708F27A3C005CB29B /* canvPsImg.tcl */,
+ F966BC1808F27A3C005CB29B /* canvPsText.tcl */,
+ F966BC1908F27A3C005CB29B /* canvRect.test */,
+ F966BC1A08F27A3C005CB29B /* canvText.test */,
+ F966BC1B08F27A3C005CB29B /* canvWind.test */,
+ F966BC1C08F27A3C005CB29B /* choosedir.test */,
+ F966BC1D08F27A3C005CB29B /* clipboard.test */,
+ F966BC1E08F27A3C005CB29B /* clrpick.test */,
+ F966BC1F08F27A3C005CB29B /* cmap.tcl */,
+ F966BC2008F27A3C005CB29B /* cmds.test */,
+ F966BC2108F27A3C005CB29B /* color.test */,
+ F966BC2208F27A3C005CB29B /* config.test */,
+ F966BC2308F27A3C005CB29B /* constraints.tcl */,
+ F966BC2408F27A3C005CB29B /* cursor.test */,
+ F966BC2508F27A3C005CB29B /* dialog.test */,
+ F966BC2608F27A3C005CB29B /* embed.test */,
+ F966BC2708F27A3C005CB29B /* entry.test */,
+ F966BC2808F27A3C005CB29B /* event.test */,
+ F966BC2908F27A3C005CB29B /* filebox.test */,
+ F966BC2A08F27A3C005CB29B /* focus.test */,
+ F966BC2B08F27A3C005CB29B /* focusTcl.test */,
+ F966BC2C08F27A3C005CB29B /* font.test */,
+ F99388950EE02D980065FE6B /* fontchooser.test */,
+ F966BC2D08F27A3C005CB29B /* frame.test */,
+ F966BC2E08F27A3C005CB29B /* geometry.test */,
+ F966BC2F08F27A3C005CB29B /* get.test */,
+ F966BC3008F27A3C005CB29B /* grab.test */,
+ F966BC3108F27A3C005CB29B /* grid.test */,
+ F966BC3308F27A3C005CB29B /* image.test */,
+ F966BC3408F27A3C005CB29B /* imgBmap.test */,
+ F966BC3508F27A3C005CB29B /* imgPhoto.test */,
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */,
+ F966BC3608F27A3C005CB29B /* imgPPM.test */,
+ F966BC3708F27A3C005CB29B /* listbox.test */,
+ F966BC3808F27A3C005CB29B /* main.test */,
+ F966BC3908F27A3C005CB29B /* menu.test */,
+ F966BC3A08F27A3C005CB29B /* menubut.test */,
+ F966BC3B08F27A3C005CB29B /* menuDraw.test */,
+ F966BC3C08F27A3C005CB29B /* message.test */,
+ F966BC3D08F27A3C005CB29B /* msgbox.test */,
+ F966BC3E08F27A3C005CB29B /* obj.test */,
+ F966BC3F08F27A3C005CB29B /* oldpack.test */,
+ F966BC4008F27A3C005CB29B /* option.file1 */,
+ F966BC4108F27A3C005CB29B /* option.file2 */,
+ F966BC4208F27A3C005CB29B /* option.test */,
+ F966BC4308F27A3C005CB29B /* pack.test */,
+ F966BC4408F27A3C005CB29B /* panedwindow.test */,
+ F966BC4508F27A3D005CB29B /* place.test */,
+ F966BC4608F27A3D005CB29B /* raise.test */,
+ F966BC4708F27A3D005CB29B /* README */,
+ F966BC4808F27A3D005CB29B /* safe.test */,
+ F966BC4908F27A3D005CB29B /* scale.test */,
+ F966BC4A08F27A3D005CB29B /* scrollbar.test */,
+ F966BC4B08F27A3D005CB29B /* select.test */,
+ F966BC4C08F27A3D005CB29B /* send.test */,
+ F966BC4D08F27A3D005CB29B /* spinbox.test */,
+ F966BC4E08F27A3D005CB29B /* text.test */,
+ F966BC4F08F27A3D005CB29B /* textBTree.test */,
+ F966BC5008F27A3D005CB29B /* textDisp.test */,
+ F966BC5108F27A3D005CB29B /* textImage.test */,
+ F966BC5208F27A3D005CB29B /* textIndex.test */,
+ F966BC5308F27A3D005CB29B /* textMark.test */,
+ F966BC5408F27A3D005CB29B /* textTag.test */,
+ F966BC5508F27A3D005CB29B /* textWind.test */,
+ F966BC5608F27A3D005CB29B /* tk.test */,
+ F96888530AF7880C000797B5 /* ttk */,
+ F966BC5708F27A3D005CB29B /* unixButton.test */,
+ F966BC5808F27A3D005CB29B /* unixEmbed.test */,
+ F966BC5908F27A3D005CB29B /* unixFont.test */,
+ F966BC5A08F27A3D005CB29B /* unixMenu.test */,
+ F966BC5B08F27A3D005CB29B /* unixSelect.test */,
+ F966BC5C08F27A3D005CB29B /* unixWm.test */,
+ F966BC5D08F27A3D005CB29B /* util.test */,
+ F966BC5E08F27A3D005CB29B /* visual.test */,
+ F966BC5F08F27A3D005CB29B /* visual_bb.test */,
+ F966BC6008F27A3D005CB29B /* winButton.test */,
+ F966BC6108F27A3D005CB29B /* winClipboard.test */,
+ F966BC6208F27A3D005CB29B /* winDialog.test */,
+ F966BC6308F27A3D005CB29B /* window.test */,
+ F966BC6408F27A3D005CB29B /* winfo.test */,
+ F966BC6508F27A3D005CB29B /* winFont.test */,
+ F966BC6608F27A3D005CB29B /* winMenu.test */,
+ F966BC6708F27A3D005CB29B /* winSend.test */,
+ F966BC6808F27A3D005CB29B /* winWm.test */,
+ F966BC6908F27A3D005CB29B /* wm.test */,
+ F966BC6A08F27A3D005CB29B /* xmfbox.test */,
+ );
+ path = tests;
+ sourceTree = "<group>";
+ };
+ F966BC6B08F27A3D005CB29B /* unix */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC6C08F27A3D005CB29B /* aclocal.m4 */,
+ F966BC6D08F27A3D005CB29B /* configure */,
+ F966BC6E08F27A3D005CB29B /* configure.in */,
+ F966BC6F08F27A3D005CB29B /* install-sh */,
+ F966BC7008F27A3D005CB29B /* installManPage */,
+ F966BC7108F27A3D005CB29B /* Makefile.in */,
+ F966BC7208F27A3D005CB29B /* README */,
+ F966BC7308F27A3D005CB29B /* tcl.m4 */,
+ F974D57B0FBE7EC000BF728B /* tk.pc.in */,
+ F966BC7408F27A3D005CB29B /* tk.spec */,
+ F966BC7508F27A3D005CB29B /* tkAppInit.c */,
+ F966BC7608F27A3D005CB29B /* tkConfig.h.in */,
+ F966BC7708F27A3D005CB29B /* tkConfig.sh.in */,
+ F966BC7808F27A3D005CB29B /* tkUnix.c */,
+ F966BC7908F27A3D005CB29B /* tkUnix3d.c */,
+ F966BC7A08F27A3D005CB29B /* tkUnixButton.c */,
+ F966BC7B08F27A3D005CB29B /* tkUnixColor.c */,
+ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */,
+ F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */,
+ F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */,
+ F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */,
+ F966BC8008F27A3D005CB29B /* tkUnixDraw.c */,
+ F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */,
+ F966BC8208F27A3D005CB29B /* tkUnixEvent.c */,
+ F966BC8308F27A3D005CB29B /* tkUnixFocus.c */,
+ F966BC8408F27A3D005CB29B /* tkUnixFont.c */,
+ F966BC8508F27A3D005CB29B /* tkUnixInit.c */,
+ F966BC8608F27A3D005CB29B /* tkUnixInt.h */,
+ F966BC8708F27A3D005CB29B /* tkUnixKey.c */,
+ F966BC8808F27A3D005CB29B /* tkUnixMenu.c */,
+ F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */,
+ F966BC8A08F27A3D005CB29B /* tkUnixPort.h */,
+ F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */,
+ F966BC8C08F27A3D005CB29B /* tkUnixScale.c */,
+ F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */,
+ F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */,
+ F966BC8F08F27A3D005CB29B /* tkUnixSend.c */,
+ F966BC9008F27A3D005CB29B /* tkUnixWm.c */,
+ F966BC9108F27A3D005CB29B /* tkUnixXId.c */,
+ );
+ path = unix;
+ sourceTree = "<group>";
+ };
+ F966BC9208F27A3D005CB29B /* win */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC9408F27A3D005CB29B /* aclocal.m4 */,
+ F966BC9508F27A3D005CB29B /* buildall.vc.bat */,
+ F966BC9608F27A3E005CB29B /* configure */,
+ F966BC9708F27A3E005CB29B /* configure.in */,
+ F966BC9808F27A3E005CB29B /* makefile.bc */,
+ F966BC9908F27A3E005CB29B /* Makefile.in */,
+ F966BC9A08F27A3E005CB29B /* makefile.vc */,
+ F966BC9B08F27A3E005CB29B /* mkd.bat */,
+ F966BC9C08F27A3E005CB29B /* nmakehlp.c */,
+ F966BC9D08F27A3E005CB29B /* rc */,
+ F966BCF308F27A3E005CB29B /* README */,
+ F966BCF408F27A3E005CB29B /* rmd.bat */,
+ F966BCF508F27A3F005CB29B /* rules.vc */,
+ F966BCF608F27A3F005CB29B /* stubs.c */,
+ F966BCF708F27A3F005CB29B /* tcl.m4 */,
+ F966BCF808F27A3F005CB29B /* tkConfig.sh.in */,
+ F966BCF908F27A3F005CB29B /* tkWin.h */,
+ F966BCFA08F27A3F005CB29B /* tkWin32Dll.c */,
+ F966BCFB08F27A3F005CB29B /* tkWin3d.c */,
+ F966BCFC08F27A3F005CB29B /* tkWinButton.c */,
+ F966BCFD08F27A3F005CB29B /* tkWinClipboard.c */,
+ F966BCFE08F27A3F005CB29B /* tkWinColor.c */,
+ F966BCFF08F27A3F005CB29B /* tkWinConfig.c */,
+ F966BD0008F27A3F005CB29B /* tkWinCursor.c */,
+ F966BD0108F27A3F005CB29B /* tkWinDefault.h */,
+ F966BD0208F27A3F005CB29B /* tkWinDialog.c */,
+ F966BD0308F27A3F005CB29B /* tkWinDraw.c */,
+ F966BD0408F27A3F005CB29B /* tkWinEmbed.c */,
+ F966BD0508F27A3F005CB29B /* tkWinFont.c */,
+ F966BD0708F27A3F005CB29B /* tkWinImage.c */,
+ F966BD0808F27A3F005CB29B /* tkWinInit.c */,
+ F966BD0908F27A3F005CB29B /* tkWinInt.h */,
+ F966BD0A08F27A3F005CB29B /* tkWinKey.c */,
+ F966BD0B08F27A3F005CB29B /* tkWinMenu.c */,
+ F966BD0C08F27A3F005CB29B /* tkWinPixmap.c */,
+ F966BD0D08F27A3F005CB29B /* tkWinPointer.c */,
+ F966BD0E08F27A3F005CB29B /* tkWinPort.h */,
+ F966BD0F08F27A3F005CB29B /* tkWinRegion.c */,
+ F966BD1008F27A3F005CB29B /* tkWinScrlbr.c */,
+ F966BD1108F27A3F005CB29B /* tkWinSend.c */,
+ F966BD1208F27A3F005CB29B /* tkWinSendCom.c */,
+ F966BD1308F27A3F005CB29B /* tkWinSendCom.h */,
+ F966BD1408F27A3F005CB29B /* tkWinTest.c */,
+ F966BD1508F27A3F005CB29B /* tkWinWindow.c */,
+ F966BD1608F27A3F005CB29B /* tkWinWm.c */,
+ F966BD1708F27A3F005CB29B /* tkWinX.c */,
+ F96888860AF78953000797B5 /* ttkWinMonitor.c */,
+ F96888870AF78953000797B5 /* ttkWinTheme.c */,
+ F96888880AF78953000797B5 /* ttkWinXPTheme.c */,
+ F966BD1808F27A3F005CB29B /* winMain.c */,
+ );
+ path = win;
+ sourceTree = "<group>";
+ };
+ F966BC9D08F27A3E005CB29B /* rc */ = {
+ isa = PBXGroup;
+ children = (
+ F966BCEE08F27A3E005CB29B /* tk.rc */,
+ F966BCEF08F27A3E005CB29B /* tk_base.rc */,
+ F966BCF208F27A3E005CB29B /* wish.rc */,
+ );
+ path = rc;
+ sourceTree = "<group>";
+ };
+ F966BD1908F27A3F005CB29B /* xlib */ = {
+ isa = PBXGroup;
+ children = (
+ F966BD1A08F27A3F005CB29B /* X11 */,
+ F966BD2308F27A3F005CB29B /* xbytes.h */,
+ F966BD2408F27A3F005CB29B /* xcolors.c */,
+ F966BD2508F27A3F005CB29B /* xdraw.c */,
+ F966BD2608F27A3F005CB29B /* xgc.c */,
+ F966BD2708F27A3F005CB29B /* ximage.c */,
+ F966BD2808F27A3F005CB29B /* xutil.c */,
+ );
+ path = xlib;
+ sourceTree = "<group>";
+ };
+ F966BD1A08F27A3F005CB29B /* X11 */ = {
+ isa = PBXGroup;
+ children = (
+ F966BD1B08F27A3F005CB29B /* cursorfont.h */,
+ F966BD1C08F27A3F005CB29B /* keysym.h */,
+ F966BD1D08F27A3F005CB29B /* keysymdef.h */,
+ F966BD1E08F27A3F005CB29B /* X.h */,
+ F966BD1F08F27A3F005CB29B /* Xatom.h */,
+ F966BD2008F27A3F005CB29B /* Xfuncproto.h */,
+ F966BD2108F27A3F005CB29B /* Xlib.h */,
+ F966BD2208F27A3F005CB29B /* Xutil.h */,
+ );
+ path = X11;
+ sourceTree = "<group>";
+ };
+ F966C06F08F281DC005CB29B /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */,
+ F966C07408F2820D005CB29B /* CoreFoundation.framework */,
+ F96437E60EF0D652003F468E /* libz.dylib */,
+ F966C07608F2821B005CB29B /* Carbon.framework */,
+ F94523A10E6FC2AC00C1D987 /* Cocoa.framework */,
+ F966C07808F28233005CB29B /* IOKit.framework */,
+ F9FD32140CC1AF170073837D /* libX11.dylib */,
+ F9FD32150CC1AF170073837D /* libXext.dylib */,
+ F9FD32160CC1AF170073837D /* libXss.dylib */,
+ F9FD349A0CC1BB0D0073837D /* libXft.dylib */,
+ F9FD34990CC1BB0D0073837D /* libfreetype.dylib */,
+ F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ F96887DF0AF786D5000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96887E00AF786D5000797B5 /* ttk.decls */,
+ F96887E10AF786D5000797B5 /* ttkBlink.c */,
+ F96887E20AF786D5000797B5 /* ttkButton.c */,
+ F96887E30AF786D5000797B5 /* ttkCache.c */,
+ F96887E40AF786D5000797B5 /* ttkClamTheme.c */,
+ F96887E50AF786D5000797B5 /* ttkClassicTheme.c */,
+ F96887E60AF786D5000797B5 /* ttkDecls.h */,
+ F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */,
+ F96887E80AF786D5000797B5 /* ttkElements.c */,
+ F96887E90AF786D5000797B5 /* ttkEntry.c */,
+ F96887EA0AF786D5000797B5 /* ttkFrame.c */,
+ F96887EB0AF786D5000797B5 /* ttkImage.c */,
+ F96887EC0AF786D5000797B5 /* ttkInit.c */,
+ F96887ED0AF786D5000797B5 /* ttkLabel.c */,
+ F96887EE0AF786D5000797B5 /* ttkLayout.c */,
+ F96887EF0AF786D5000797B5 /* ttkManager.c */,
+ F96887F00AF786D5000797B5 /* ttkManager.h */,
+ F96887F10AF786D5000797B5 /* ttkNotebook.c */,
+ F96887F20AF786D5000797B5 /* ttkPanedwindow.c */,
+ F96887F30AF786D5000797B5 /* ttkProgress.c */,
+ F96887F40AF786D5000797B5 /* ttkScale.c */,
+ F96887F50AF786D5000797B5 /* ttkScroll.c */,
+ F96887F60AF786D5000797B5 /* ttkScrollbar.c */,
+ F96887F70AF786D5000797B5 /* ttkSeparator.c */,
+ F96887F80AF786D5000797B5 /* ttkSquare.c */,
+ F96887F90AF786D5000797B5 /* ttkState.c */,
+ F96887FA0AF786D5000797B5 /* ttkStubInit.c */,
+ F96887FB0AF786D5000797B5 /* ttkStubLib.c */,
+ F96887FC0AF786D5000797B5 /* ttkTagSet.c */,
+ F96887FD0AF786D5000797B5 /* ttkTheme.c */,
+ F96887FE0AF786D5000797B5 /* ttkTheme.h */,
+ F96887FF0AF786D5000797B5 /* ttkThemeInt.h */,
+ F96888000AF786D5000797B5 /* ttkTrace.c */,
+ F96888010AF786D5000797B5 /* ttkTrack.c */,
+ F96888020AF786D5000797B5 /* ttkTreeview.c */,
+ F96888030AF786D5000797B5 /* ttkWidget.c */,
+ F96888040AF786D5000797B5 /* ttkWidget.h */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96888360AF787B3000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96888370AF787B3000797B5 /* altTheme.tcl */,
+ F96888380AF787B3000797B5 /* aquaTheme.tcl */,
+ F96888390AF787B3000797B5 /* button.tcl */,
+ F968883A0AF787B3000797B5 /* clamTheme.tcl */,
+ F968883B0AF787B3000797B5 /* classicTheme.tcl */,
+ F968883C0AF787B3000797B5 /* combobox.tcl */,
+ F968883D0AF787B3000797B5 /* cursors.tcl */,
+ F968883E0AF787B3000797B5 /* defaults.tcl */,
+ F96888400AF787B3000797B5 /* entry.tcl */,
+ F96888410AF787B3000797B5 /* fonts.tcl */,
+ F96888440AF787B3000797B5 /* menubutton.tcl */,
+ F96888450AF787B3000797B5 /* notebook.tcl */,
+ F96888460AF787B3000797B5 /* panedwindow.tcl */,
+ F96888470AF787B3000797B5 /* progress.tcl */,
+ F96888480AF787B3000797B5 /* scale.tcl */,
+ F96888490AF787B3000797B5 /* scrollbar.tcl */,
+ F968884A0AF787B3000797B5 /* sizegrip.tcl */,
+ F968884B0AF787B3000797B5 /* treeview.tcl */,
+ F968884C0AF787B3000797B5 /* ttk.tcl */,
+ F968884D0AF787B3000797B5 /* utils.tcl */,
+ F968884E0AF787B3000797B5 /* winTheme.tcl */,
+ F973E5960EE99384001A648E /* vistaTheme.tcl */,
+ F968884F0AF787B3000797B5 /* xpTheme.tcl */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96888530AF7880C000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96888540AF7880C000797B5 /* all.tcl */,
+ F98383650F0FA43900171CA6 /* checkbutton.test */,
+ F96888560AF7880C000797B5 /* combobox.test */,
+ F96888570AF7880C000797B5 /* entry.test */,
+ F96888580AF7880C000797B5 /* image.test */,
+ F96888590AF7880C000797B5 /* labelframe.test */,
+ F968885A0AF7880C000797B5 /* layout.test */,
+ F968885C0AF7880C000797B5 /* notebook.test */,
+ F968885D0AF7880C000797B5 /* panedwindow.test */,
+ F968885E0AF7880C000797B5 /* progressbar.test */,
+ F98383680F0FA44700171CA6 /* radiobutton.test */,
+ F968885F0AF7880C000797B5 /* scrollbar.test */,
+ F96888600AF7880C000797B5 /* treetags.test */,
+ F96888610AF7880C000797B5 /* treeview.test */,
+ F96888620AF7880C000797B5 /* ttk.test */,
+ F96888630AF7880C000797B5 /* validate.test */,
+ F962F7C60DADC26200648DB8 /* vsapi.test */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96D3DF608F27169004A47F5 /* Tcl Sources */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3EC908F272A7004A47F5 /* generic */,
+ F96D432C08F272B4004A47F5 /* macosx */,
+ F96D443E08F272B9004A47F5 /* unix */,
+ F96D425C08F272B2004A47F5 /* libtommath */,
+ F96D446E08F272B9004A47F5 /* win */,
+ F96D3F3808F272A7004A47F5 /* library */,
+ F96D434408F272B5004A47F5 /* tests */,
+ F96D3DFC08F272A4004A47F5 /* doc */,
+ F96D43D008F272B8004A47F5 /* tools */,
+ F9183E690EFC81560030B814 /* pkgs */,
+ F96D3DFA08F272A4004A47F5 /* ChangeLog */,
+ F96D3DFB08F272A4004A47F5 /* changes */,
+ F96D434308F272B5004A47F5 /* README */,
+ F96D432B08F272B4004A47F5 /* license.terms */,
+ );
+ name = "Tcl Sources";
+ sourceTree = TCL_SRCROOT;
+ };
+ F96D3DF708F271BE004A47F5 /* Tk Sources */ = {
+ isa = PBXGroup;
+ children = (
+ F966BAA508F27A38005CB29B /* generic */,
+ F966BB9708F27A3B005CB29B /* macosx */,
+ F966BC6B08F27A3D005CB29B /* unix */,
+ F966BD1908F27A3F005CB29B /* xlib */,
+ F966BA0308F27A37005CB29B /* bitmaps */,
+ F966BC9208F27A3D005CB29B /* win */,
+ F966BB1308F27A39005CB29B /* library */,
+ F966BC0408F27A3C005CB29B /* tests */,
+ F966BA1008F27A37005CB29B /* doc */,
+ F966BA0E08F27A37005CB29B /* ChangeLog */,
+ F966BA0F08F27A37005CB29B /* changes */,
+ F966BC0308F27A3C005CB29B /* README */,
+ F966BB9608F27A3B005CB29B /* license.terms */,
+ );
+ name = "Tk Sources";
+ sourceTree = TK_SRCROOT;
+ };
+ F96D3DFC08F272A4004A47F5 /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3DFD08F272A4004A47F5 /* Access.3 */,
+ F96D3DFE08F272A4004A47F5 /* AddErrInfo.3 */,
+ F96D3DFF08F272A4004A47F5 /* after.n */,
+ F96D3E0008F272A4004A47F5 /* Alloc.3 */,
+ F96D3E0108F272A4004A47F5 /* AllowExc.3 */,
+ F96D3E0208F272A4004A47F5 /* append.n */,
+ F96D3E0308F272A4004A47F5 /* AppInit.3 */,
+ F96D3E0408F272A5004A47F5 /* array.n */,
+ F96D3E0508F272A5004A47F5 /* AssocData.3 */,
+ F96D3E0608F272A5004A47F5 /* Async.3 */,
+ F96D3E0708F272A5004A47F5 /* BackgdErr.3 */,
+ F96D3E0808F272A5004A47F5 /* Backslash.3 */,
+ F96D3E0908F272A5004A47F5 /* bgerror.n */,
+ F96D3E0A08F272A5004A47F5 /* binary.n */,
+ F96D3E0B08F272A5004A47F5 /* BoolObj.3 */,
+ F96D3E0C08F272A5004A47F5 /* break.n */,
+ F96D3E0D08F272A5004A47F5 /* ByteArrObj.3 */,
+ F96D3E0E08F272A5004A47F5 /* CallDel.3 */,
+ F96D3E0F08F272A5004A47F5 /* case.n */,
+ F96D3E1008F272A5004A47F5 /* catch.n */,
+ F96D3E1108F272A5004A47F5 /* cd.n */,
+ F96D3E1208F272A5004A47F5 /* chan.n */,
+ F96D3E1308F272A5004A47F5 /* ChnlStack.3 */,
+ F93599CF0DF1F87F00E04F67 /* Class.3 */,
+ F93599D00DF1F89E00E04F67 /* class.n */,
+ F96D3E1408F272A5004A47F5 /* clock.n */,
+ F96D3E1508F272A5004A47F5 /* close.n */,
+ F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */,
+ F96D3E1708F272A5004A47F5 /* Concat.3 */,
+ F96D3E1808F272A5004A47F5 /* concat.n */,
+ F96D3E1908F272A5004A47F5 /* continue.n */,
+ F93599D20DF1F8DF00E04F67 /* copy.n */,
+ F974D5720FBE7DC600BF728B /* coroutine.n */,
+ F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */,
+ F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */,
+ F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */,
+ F96D3E1D08F272A5004A47F5 /* CrtCommand.3 */,
+ F96D3E1E08F272A5004A47F5 /* CrtFileHdlr.3 */,
+ F96D3E1F08F272A5004A47F5 /* CrtInterp.3 */,
+ F96D3E2008F272A5004A47F5 /* CrtMathFnc.3 */,
+ F96D3E2108F272A5004A47F5 /* CrtObjCmd.3 */,
+ F96D3E2208F272A5004A47F5 /* CrtSlave.3 */,
+ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */,
+ F96D3E2408F272A5004A47F5 /* CrtTrace.3 */,
+ F96D3E2508F272A5004A47F5 /* dde.n */,
+ F93599D30DF1F8F500E04F67 /* define.n */,
+ F96D3E2608F272A5004A47F5 /* DetachPids.3 */,
+ F96D3E2708F272A5004A47F5 /* dict.n */,
+ F96D3E2808F272A5004A47F5 /* DictObj.3 */,
+ F96D3E2908F272A5004A47F5 /* DoOneEvent.3 */,
+ F96D3E2A08F272A5004A47F5 /* DoubleObj.3 */,
+ F96D3E2B08F272A5004A47F5 /* DoWhenIdle.3 */,
+ F96D3E2C08F272A5004A47F5 /* DString.3 */,
+ F96D3E2D08F272A5004A47F5 /* DumpActiveMemory.3 */,
+ F96D3E2E08F272A5004A47F5 /* Encoding.3 */,
+ F96D3E2F08F272A5004A47F5 /* encoding.n */,
+ F96D3E3008F272A5004A47F5 /* Ensemble.3 */,
+ F96D3E3108F272A5004A47F5 /* Environment.3 */,
+ F96D3E3208F272A5004A47F5 /* eof.n */,
+ F96D3E3308F272A5004A47F5 /* error.n */,
+ F96D3E3408F272A5004A47F5 /* Eval.3 */,
+ F96D3E3508F272A5004A47F5 /* eval.n */,
+ F96D3E3608F272A5004A47F5 /* exec.n */,
+ F96D3E3708F272A5004A47F5 /* Exit.3 */,
+ F96D3E3808F272A5004A47F5 /* exit.n */,
+ F96D3E3908F272A5004A47F5 /* expr.n */,
+ F96D3E3A08F272A5004A47F5 /* ExprLong.3 */,
+ F96D3E3B08F272A5004A47F5 /* ExprLongObj.3 */,
+ F96D3E3C08F272A5004A47F5 /* fblocked.n */,
+ F96D3E3D08F272A5004A47F5 /* fconfigure.n */,
+ F96D3E3E08F272A5004A47F5 /* fcopy.n */,
+ F96D3E3F08F272A5004A47F5 /* file.n */,
+ F96D3E4008F272A5004A47F5 /* fileevent.n */,
+ F96D3E4108F272A5004A47F5 /* filename.n */,
+ F96D3E4208F272A5004A47F5 /* FileSystem.3 */,
+ F96D3E4308F272A5004A47F5 /* FindExec.3 */,
+ F96D3E4408F272A5004A47F5 /* flush.n */,
+ F96D3E4508F272A5004A47F5 /* for.n */,
+ F96D3E4608F272A5004A47F5 /* foreach.n */,
+ F96D3E4708F272A5004A47F5 /* format.n */,
+ F96D3E4808F272A5004A47F5 /* GetCwd.3 */,
+ F96D3E4908F272A5004A47F5 /* GetHostName.3 */,
+ F96D3E4A08F272A5004A47F5 /* GetIndex.3 */,
+ F96D3E4B08F272A5004A47F5 /* GetInt.3 */,
+ F96D3E4C08F272A5004A47F5 /* GetOpnFl.3 */,
+ F96D3E4D08F272A5004A47F5 /* gets.n */,
+ F96D3E4E08F272A5004A47F5 /* GetStdChan.3 */,
+ F96D3E4F08F272A5004A47F5 /* GetTime.3 */,
+ F96D3E5008F272A5004A47F5 /* GetVersion.3 */,
+ F96D3E5108F272A5004A47F5 /* glob.n */,
+ F96D3E5208F272A6004A47F5 /* global.n */,
+ F96D3E5308F272A6004A47F5 /* Hash.3 */,
+ F96D3E5408F272A6004A47F5 /* history.n */,
+ F96D3E5508F272A6004A47F5 /* http.n */,
+ F96D3E5608F272A6004A47F5 /* if.n */,
+ F96D3E5708F272A6004A47F5 /* incr.n */,
+ F96D3E5808F272A6004A47F5 /* info.n */,
+ F96D3E5908F272A6004A47F5 /* Init.3 */,
+ F96D3E5A08F272A6004A47F5 /* InitStubs.3 */,
+ F96D3E5B08F272A6004A47F5 /* Interp.3 */,
+ F96D3E5C08F272A6004A47F5 /* interp.n */,
+ F96D3E5D08F272A6004A47F5 /* IntObj.3 */,
+ F96D3E5E08F272A6004A47F5 /* join.n */,
+ F96D3E5F08F272A6004A47F5 /* lappend.n */,
+ F96D3E6008F272A6004A47F5 /* lassign.n */,
+ F96D3E6108F272A6004A47F5 /* library.n */,
+ F96D3E6208F272A6004A47F5 /* Limit.3 */,
+ F96D3E6308F272A6004A47F5 /* lindex.n */,
+ F96D3E6408F272A6004A47F5 /* LinkVar.3 */,
+ F96D3E6508F272A6004A47F5 /* linsert.n */,
+ F96D3E6608F272A6004A47F5 /* list.n */,
+ F96D3E6708F272A6004A47F5 /* ListObj.3 */,
+ F96D3E6808F272A6004A47F5 /* llength.n */,
+ F96D3E6908F272A6004A47F5 /* load.n */,
+ F96D3E6A08F272A6004A47F5 /* lrange.n */,
+ F96D3E6B08F272A6004A47F5 /* lrepeat.n */,
+ F96D3E6C08F272A6004A47F5 /* lreplace.n */,
+ F96D3E6D08F272A6004A47F5 /* lsearch.n */,
+ F96D3E6E08F272A6004A47F5 /* lset.n */,
+ F96D3E6F08F272A6004A47F5 /* lsort.n */,
+ F96D3E7008F272A6004A47F5 /* man.macros */,
+ F96D3E7108F272A6004A47F5 /* mathfunc.n */,
+ F96D3E7208F272A6004A47F5 /* memory.n */,
+ F93599D40DF1F91900E04F67 /* Method.3 */,
+ F96D3E7308F272A6004A47F5 /* msgcat.n */,
+ F93599D50DF1F93700E04F67 /* my.n */,
+ F96D3E7408F272A6004A47F5 /* Namespace.3 */,
+ F96D3E7508F272A6004A47F5 /* namespace.n */,
+ F93599D60DF1F95000E04F67 /* next.n */,
+ F96D3E7608F272A6004A47F5 /* Notifier.3 */,
+ F96D3E7708F272A6004A47F5 /* Object.3 */,
+ F93599D70DF1F96800E04F67 /* object.n */,
+ F96D3E7808F272A6004A47F5 /* ObjectType.3 */,
+ F96D3E7908F272A6004A47F5 /* open.n */,
+ F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */,
+ F96D3E7B08F272A6004A47F5 /* OpenTcp.3 */,
+ F96D3E7C08F272A6004A47F5 /* package.n */,
+ F96D3E7D08F272A6004A47F5 /* packagens.n */,
+ F96D3E7E08F272A6004A47F5 /* Panic.3 */,
+ F96D3E7F08F272A6004A47F5 /* ParseCmd.3 */,
+ F96D3E8008F272A6004A47F5 /* pid.n */,
+ F96D3E8108F272A6004A47F5 /* pkgMkIndex.n */,
+ F96D3E8208F272A6004A47F5 /* PkgRequire.3 */,
+ F9ECB1E10B26543C00A28025 /* platform_shell.n */,
+ F9ECB1E20B26543C00A28025 /* platform.n */,
+ F96D3E8308F272A6004A47F5 /* Preserve.3 */,
+ F96D3E8408F272A6004A47F5 /* PrintDbl.3 */,
+ F96D3E8508F272A6004A47F5 /* proc.n */,
+ F96D3E8608F272A6004A47F5 /* puts.n */,
+ F96D3E8708F272A6004A47F5 /* pwd.n */,
+ F96D3E8808F272A6004A47F5 /* re_syntax.n */,
+ F96D3E8908F272A6004A47F5 /* read.n */,
+ F96D3E8A08F272A6004A47F5 /* RecEvalObj.3 */,
+ F96D3E8B08F272A6004A47F5 /* RecordEval.3 */,
+ F96D3E8C08F272A6004A47F5 /* RegConfig.3 */,
+ F96D3E8D08F272A6004A47F5 /* RegExp.3 */,
+ F96D3E8E08F272A6004A47F5 /* regexp.n */,
+ F96D3E8F08F272A6004A47F5 /* registry.n */,
+ F96D3E9008F272A6004A47F5 /* regsub.n */,
+ F96D3E9108F272A6004A47F5 /* rename.n */,
+ F96D3E9208F272A6004A47F5 /* return.n */,
+ F96D3E9308F272A6004A47F5 /* safe.n */,
+ F96D3E9408F272A6004A47F5 /* SaveResult.3 */,
+ F96D3E9508F272A6004A47F5 /* scan.n */,
+ F96D3E9608F272A6004A47F5 /* seek.n */,
+ F93599D80DF1F98300E04F67 /* self.n */,
+ F96D3E9708F272A6004A47F5 /* set.n */,
+ F96D3E9808F272A6004A47F5 /* SetChanErr.3 */,
+ F96D3E9908F272A6004A47F5 /* SetErrno.3 */,
+ F96D3E9A08F272A6004A47F5 /* SetRecLmt.3 */,
+ F96D3E9B08F272A7004A47F5 /* SetResult.3 */,
+ F96D3E9C08F272A7004A47F5 /* SetVar.3 */,
+ F96D3E9D08F272A7004A47F5 /* Signal.3 */,
+ F96D3E9E08F272A7004A47F5 /* Sleep.3 */,
+ F96D3E9F08F272A7004A47F5 /* socket.n */,
+ F96D3EA008F272A7004A47F5 /* source.n */,
+ F96D3EA108F272A7004A47F5 /* SourceRCFile.3 */,
+ F96D3EA208F272A7004A47F5 /* split.n */,
+ F96D3EA308F272A7004A47F5 /* SplitList.3 */,
+ F96D3EA408F272A7004A47F5 /* SplitPath.3 */,
+ F96D3EA508F272A7004A47F5 /* StaticPkg.3 */,
+ F96D3EA608F272A7004A47F5 /* StdChannels.3 */,
+ F96D3EA708F272A7004A47F5 /* string.n */,
+ F96D3EA808F272A7004A47F5 /* StringObj.3 */,
+ F96D3EA908F272A7004A47F5 /* StrMatch.3 */,
+ F96D3EAA08F272A7004A47F5 /* subst.n */,
+ F96D3EAB08F272A7004A47F5 /* SubstObj.3 */,
+ F96D3EAC08F272A7004A47F5 /* switch.n */,
+ F974D5760FBE7E1900BF728B /* tailcall.n */,
+ F96D3EAD08F272A7004A47F5 /* Tcl.n */,
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */,
+ F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */,
+ F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */,
+ F96D3EB008F272A7004A47F5 /* tclsh.1 */,
+ F96D3EB108F272A7004A47F5 /* tcltest.n */,
+ F96D3EB208F272A7004A47F5 /* tclvars.n */,
+ F96D3EB308F272A7004A47F5 /* tell.n */,
+ F96D3EB408F272A7004A47F5 /* Thread.3 */,
+ F9183E640EFC80CD0030B814 /* throw.n */,
+ F96D3EB508F272A7004A47F5 /* time.n */,
+ F96D3EB608F272A7004A47F5 /* tm.n */,
+ F96D3EB708F272A7004A47F5 /* ToUpper.3 */,
+ F96D3EB808F272A7004A47F5 /* trace.n */,
+ F96D3EB908F272A7004A47F5 /* TraceCmd.3 */,
+ F96D3EBA08F272A7004A47F5 /* TraceVar.3 */,
+ F96D3EBB08F272A7004A47F5 /* Translate.3 */,
+ F9183E650EFC80D70030B814 /* try.n */,
+ F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */,
+ F96D3EBD08F272A7004A47F5 /* unknown.n */,
+ F96D3EBE08F272A7004A47F5 /* unload.n */,
+ F96D3EBF08F272A7004A47F5 /* unset.n */,
+ F96D3EC008F272A7004A47F5 /* update.n */,
+ F96D3EC108F272A7004A47F5 /* uplevel.n */,
+ F96D3EC208F272A7004A47F5 /* UpVar.3 */,
+ F96D3EC308F272A7004A47F5 /* upvar.n */,
+ F96D3EC408F272A7004A47F5 /* Utf.3 */,
+ F96D3EC508F272A7004A47F5 /* variable.n */,
+ F96D3EC608F272A7004A47F5 /* vwait.n */,
+ F96D3EC708F272A7004A47F5 /* while.n */,
+ F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */,
+ F915432D0EF201EE0032D1E8 /* zlib.n */,
+ );
+ path = doc;
+ sourceTree = "<group>";
+ };
+ F96D3EC908F272A7004A47F5 /* generic */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3ECA08F272A7004A47F5 /* README */,
+ F96D3ECB08F272A7004A47F5 /* regc_color.c */,
+ F96D3ECC08F272A7004A47F5 /* regc_cvec.c */,
+ F96D3ECD08F272A7004A47F5 /* regc_lex.c */,
+ F96D3ECE08F272A7004A47F5 /* regc_locale.c */,
+ F96D3ECF08F272A7004A47F5 /* regc_nfa.c */,
+ F96D3ED008F272A7004A47F5 /* regcomp.c */,
+ F96D3ED108F272A7004A47F5 /* regcustom.h */,
+ F96D3ED208F272A7004A47F5 /* rege_dfa.c */,
+ F96D3ED308F272A7004A47F5 /* regerror.c */,
+ F96D3ED408F272A7004A47F5 /* regerrs.h */,
+ F96D3ED508F272A7004A47F5 /* regex.h */,
+ F96D3ED608F272A7004A47F5 /* regexec.c */,
+ F96D3ED708F272A7004A47F5 /* regfree.c */,
+ F96D3ED808F272A7004A47F5 /* regfronts.c */,
+ F96D3ED908F272A7004A47F5 /* regguts.h */,
+ F96D3EDA08F272A7004A47F5 /* tcl.decls */,
+ F96D3EDB08F272A7004A47F5 /* tcl.h */,
+ F96D3EDC08F272A7004A47F5 /* tclAlloc.c */,
+ F96D3EDD08F272A7004A47F5 /* tclAsync.c */,
+ F96D3EDE08F272A7004A47F5 /* tclBasic.c */,
+ F96D3EDF08F272A7004A47F5 /* tclBinary.c */,
+ F96D3EE008F272A7004A47F5 /* tclCkalloc.c */,
+ F96D3EE108F272A7004A47F5 /* tclClock.c */,
+ F96D3EE208F272A7004A47F5 /* tclCmdAH.c */,
+ F96D3EE308F272A7004A47F5 /* tclCmdIL.c */,
+ F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */,
+ F96D3EE508F272A7004A47F5 /* tclCompCmds.c */,
+ F96D3EE608F272A7004A47F5 /* tclCompExpr.c */,
+ F96D3EE708F272A7004A47F5 /* tclCompile.c */,
+ F96D3EE808F272A7004A47F5 /* tclCompile.h */,
+ F96D3EE908F272A7004A47F5 /* tclConfig.c */,
+ F96D3EEA08F272A7004A47F5 /* tclDate.c */,
+ F96D3EEB08F272A7004A47F5 /* tclDecls.h */,
+ F96D3EEC08F272A7004A47F5 /* tclDictObj.c */,
+ F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */,
+ F96D3EED08F272A7004A47F5 /* tclEncoding.c */,
+ F96D3EEE08F272A7004A47F5 /* tclEnv.c */,
+ F96D3EEF08F272A7004A47F5 /* tclEvent.c */,
+ F96D3EF008F272A7004A47F5 /* tclExecute.c */,
+ F96D3EF108F272A7004A47F5 /* tclFCmd.c */,
+ F96D3EF208F272A7004A47F5 /* tclFileName.c */,
+ F96D3EF308F272A7004A47F5 /* tclFileSystem.h */,
+ F96D3EF408F272A7004A47F5 /* tclGet.c */,
+ F96D3EF508F272A7004A47F5 /* tclGetDate.y */,
+ F96D3EF608F272A7004A47F5 /* tclHash.c */,
+ F96D3EF708F272A7004A47F5 /* tclHistory.c */,
+ F96D3EF808F272A7004A47F5 /* tclIndexObj.c */,
+ F96D3EF908F272A7004A47F5 /* tclInt.decls */,
+ F96D3EFA08F272A7004A47F5 /* tclInt.h */,
+ F96D3EFB08F272A7004A47F5 /* tclIntDecls.h */,
+ F96D3EFC08F272A7004A47F5 /* tclInterp.c */,
+ F96D3EFD08F272A7004A47F5 /* tclIntPlatDecls.h */,
+ F96D3EFE08F272A7004A47F5 /* tclIO.c */,
+ F96D3EFF08F272A7004A47F5 /* tclIO.h */,
+ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */,
+ F96D3F0108F272A7004A47F5 /* tclIOGT.c */,
+ F96D3F0208F272A7004A47F5 /* tclIORChan.c */,
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */,
+ F96D3F0308F272A7004A47F5 /* tclIOSock.c */,
+ F96D3F0408F272A7004A47F5 /* tclIOUtil.c */,
+ F96D3F0508F272A7004A47F5 /* tclLink.c */,
+ F96D3F0608F272A7004A47F5 /* tclListObj.c */,
+ F96D3F0708F272A7004A47F5 /* tclLiteral.c */,
+ F96D3F0808F272A7004A47F5 /* tclLoad.c */,
+ F96D3F0908F272A7004A47F5 /* tclLoadNone.c */,
+ F96D3F0A08F272A7004A47F5 /* tclMain.c */,
+ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */,
+ F96D3F0C08F272A7004A47F5 /* tclNotify.c */,
+ F96D3F0D08F272A7004A47F5 /* tclObj.c */,
+ F93599B20DF1F75400E04F67 /* tclOO.c */,
+ F93599B40DF1F75900E04F67 /* tclOO.decls */,
+ F93599B50DF1F75D00E04F67 /* tclOO.h */,
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */,
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */,
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */,
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */,
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */,
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */,
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */,
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */,
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */,
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */,
+ F96D3F0E08F272A7004A47F5 /* tclPanic.c */,
+ F96D3F0F08F272A7004A47F5 /* tclParse.c */,
+ F96D3F1108F272A7004A47F5 /* tclPathObj.c */,
+ F96D3F1208F272A7004A47F5 /* tclPipe.c */,
+ F96D3F1308F272A7004A47F5 /* tclPkg.c */,
+ F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */,
+ F96D3F1508F272A7004A47F5 /* tclPlatDecls.h */,
+ F96D3F1608F272A7004A47F5 /* tclPort.h */,
+ F96D3F1708F272A7004A47F5 /* tclPosixStr.c */,
+ F96D3F1808F272A7004A47F5 /* tclPreserve.c */,
+ F96D3F1908F272A7004A47F5 /* tclProc.c */,
+ F96D3F1A08F272A7004A47F5 /* tclRegexp.c */,
+ F96D3F1B08F272A7004A47F5 /* tclRegexp.h */,
+ F96D3F1C08F272A7004A47F5 /* tclResolve.c */,
+ F96D3F1D08F272A7004A47F5 /* tclResult.c */,
+ F96D3F1E08F272A7004A47F5 /* tclScan.c */,
+ F96D3F1F08F272A7004A47F5 /* tclStringObj.c */,
+ F96D3F2408F272A7004A47F5 /* tclStrToD.c */,
+ F96D3F2508F272A7004A47F5 /* tclStubInit.c */,
+ F96D3F2608F272A7004A47F5 /* tclStubLib.c */,
+ F96D3F2708F272A7004A47F5 /* tclTest.c */,
+ F96D3F2808F272A7004A47F5 /* tclTestObj.c */,
+ F96D3F2908F272A7004A47F5 /* tclTestProcBodyObj.c */,
+ F96D3F2A08F272A7004A47F5 /* tclThread.c */,
+ F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */,
+ F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */,
+ F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */,
+ F96D3F2E08F272A7004A47F5 /* tclThreadTest.c */,
+ F96D3F2F08F272A7004A47F5 /* tclTimer.c */,
+ F9903CAF094FAADA004613E9 /* tclTomMath.decls */,
+ F96D3F3008F272A7004A47F5 /* tclTomMath.h */,
+ F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */,
+ F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */,
+ F96D3F3208F272A7004A47F5 /* tclTrace.c */,
+ F96D3F3308F272A7004A47F5 /* tclUniData.c */,
+ F96D3F3408F272A7004A47F5 /* tclUtf.c */,
+ F96D3F3508F272A7004A47F5 /* tclUtil.c */,
+ F96D3F3608F272A7004A47F5 /* tclVar.c */,
+ F96437C90EF0D4B2003F468E /* tclZlib.c */,
+ F96D3F3708F272A7004A47F5 /* tommath.h */,
+ );
+ path = generic;
+ sourceTree = "<group>";
+ };
+ F96D3F3808F272A7004A47F5 /* library */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F3908F272A8004A47F5 /* auto.tcl */,
+ F96D3F3A08F272A8004A47F5 /* clock.tcl */,
+ F96D3F3B08F272A8004A47F5 /* dde */,
+ F96D3F8C08F272A8004A47F5 /* history.tcl */,
+ F96D3F8D08F272A8004A47F5 /* http */,
+ F96D3F9008F272A8004A47F5 /* http1.0 */,
+ F96D3F9308F272A8004A47F5 /* init.tcl */,
+ F96D3F9408F272A8004A47F5 /* msgcat */,
+ F96D401708F272AA004A47F5 /* opt */,
+ F96D401A08F272AA004A47F5 /* package.tcl */,
+ F96D401B08F272AA004A47F5 /* parray.tcl */,
+ F9ECB1110B26521500A28025 /* platform */,
+ F96D401C08F272AA004A47F5 /* reg */,
+ F96D401E08F272AA004A47F5 /* safe.tcl */,
+ F96D401F08F272AA004A47F5 /* tclIndex */,
+ F96D402008F272AA004A47F5 /* tcltest */,
+ F96D402308F272AA004A47F5 /* tm.tcl */,
+ F96D425B08F272B2004A47F5 /* word.tcl */,
+ );
+ path = library;
+ sourceTree = "<group>";
+ };
+ F96D3F3B08F272A8004A47F5 /* dde */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F3C08F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = dde;
+ sourceTree = "<group>";
+ };
+ F96D3F8D08F272A8004A47F5 /* http */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F8E08F272A8004A47F5 /* http.tcl */,
+ F96D3F8F08F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = http;
+ sourceTree = "<group>";
+ };
+ F96D3F9008F272A8004A47F5 /* http1.0 */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F9108F272A8004A47F5 /* http.tcl */,
+ F96D3F9208F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = http1.0;
+ sourceTree = "<group>";
+ };
+ F96D3F9408F272A8004A47F5 /* msgcat */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F9508F272A8004A47F5 /* msgcat.tcl */,
+ F96D3F9608F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = msgcat;
+ sourceTree = "<group>";
+ };
+ F96D401708F272AA004A47F5 /* opt */ = {
+ isa = PBXGroup;
+ children = (
+ F96D401808F272AA004A47F5 /* optparse.tcl */,
+ F96D401908F272AA004A47F5 /* pkgIndex.tcl */,
+ );
+ path = opt;
+ sourceTree = "<group>";
+ };
+ F96D401C08F272AA004A47F5 /* reg */ = {
+ isa = PBXGroup;
+ children = (
+ F96D401D08F272AA004A47F5 /* pkgIndex.tcl */,
+ );
+ path = reg;
+ sourceTree = "<group>";
+ };
+ F96D402008F272AA004A47F5 /* tcltest */ = {
+ isa = PBXGroup;
+ children = (
+ F96D402108F272AA004A47F5 /* pkgIndex.tcl */,
+ F96D402208F272AA004A47F5 /* tcltest.tcl */,
+ );
+ path = tcltest;
+ sourceTree = "<group>";
+ };
+ F96D425C08F272B2004A47F5 /* libtommath */ = {
+ isa = PBXGroup;
+ children = (
+ F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */,
+ F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */,
+ F96D426908F272B3004A47F5 /* bn_mp_add.c */,
+ F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */,
+ F96D426C08F272B3004A47F5 /* bn_mp_and.c */,
+ F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */,
+ F96D426E08F272B3004A47F5 /* bn_mp_clear.c */,
+ F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */,
+ F96D427008F272B3004A47F5 /* bn_mp_cmp.c */,
+ F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */,
+ F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */,
+ F96D427408F272B3004A47F5 /* bn_mp_copy.c */,
+ F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */,
+ F96D427608F272B3004A47F5 /* bn_mp_div.c */,
+ F96D427708F272B3004A47F5 /* bn_mp_div_2.c */,
+ F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */,
+ F96D427908F272B3004A47F5 /* bn_mp_div_3.c */,
+ F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */,
+ F96D427E08F272B3004A47F5 /* bn_mp_exch.c */,
+ F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */,
+ F96D428708F272B3004A47F5 /* bn_mp_grow.c */,
+ F96D428808F272B3004A47F5 /* bn_mp_init.c */,
+ F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */,
+ F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */,
+ F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */,
+ F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */,
+ F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */,
+ F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */,
+ F96D429508F272B3004A47F5 /* bn_mp_lshd.c */,
+ F96D429608F272B3004A47F5 /* bn_mp_mod.c */,
+ F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */,
+ F96D429C08F272B3004A47F5 /* bn_mp_mul.c */,
+ F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */,
+ F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */,
+ F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */,
+ F96D42A208F272B3004A47F5 /* bn_mp_neg.c */,
+ F96D42A308F272B3004A47F5 /* bn_mp_or.c */,
+ F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */,
+ F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */,
+ F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */,
+ F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */,
+ F96D42BA08F272B3004A47F5 /* bn_mp_set.c */,
+ F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */,
+ F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */,
+ F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */,
+ F96D42C108F272B3004A47F5 /* bn_mp_sub.c */,
+ F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */,
+ F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */,
+ F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */,
+ F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */,
+ F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */,
+ F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */,
+ F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */,
+ F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */,
+ F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */,
+ F96D42D008F272B3004A47F5 /* bn_reverse.c */,
+ F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */,
+ F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */,
+ F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */,
+ F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */,
+ F96D42D708F272B3004A47F5 /* bncore.c */,
+ F96D432908F272B4004A47F5 /* tommath_class.h */,
+ F96D432A08F272B4004A47F5 /* tommath_superclass.h */,
+ );
+ path = libtommath;
+ sourceTree = "<group>";
+ };
+ F96D432C08F272B4004A47F5 /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ F96D432E08F272B5004A47F5 /* configure.ac */,
+ F96D432F08F272B5004A47F5 /* GNUmakefile */,
+ F96D433108F272B5004A47F5 /* README */,
+ F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */,
+ F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */,
+ F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */,
+ F96D433208F272B5004A47F5 /* Tcl-Info.plist.in */,
+ F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ F96D434408F272B5004A47F5 /* tests */ = {
+ isa = PBXGroup;
+ children = (
+ F96D434508F272B5004A47F5 /* all.tcl */,
+ F96D434608F272B5004A47F5 /* append.test */,
+ F96D434708F272B5004A47F5 /* appendComp.test */,
+ F9ECB1CA0B2652D300A28025 /* apply.test */,
+ F96D434808F272B5004A47F5 /* assocd.test */,
+ F96D434908F272B5004A47F5 /* async.test */,
+ F96D434A08F272B5004A47F5 /* autoMkindex.test */,
+ F96D434B08F272B5004A47F5 /* basic.test */,
+ F96D434C08F272B5004A47F5 /* binary.test */,
+ F96D434D08F272B5004A47F5 /* case.test */,
+ F96D434E08F272B5004A47F5 /* chan.test */,
+ F9A493240CEBF38300B78AE2 /* chanio.test */,
+ F96D434F08F272B5004A47F5 /* clock.test */,
+ F96D435008F272B5004A47F5 /* cmdAH.test */,
+ F96D435108F272B5004A47F5 /* cmdIL.test */,
+ F96D435208F272B5004A47F5 /* cmdInfo.test */,
+ F96D435308F272B5004A47F5 /* cmdMZ.test */,
+ F96D435408F272B5004A47F5 /* compExpr-old.test */,
+ F96D435508F272B5004A47F5 /* compExpr.test */,
+ F96D435608F272B5004A47F5 /* compile.test */,
+ F96D435708F272B5004A47F5 /* concat.test */,
+ F96D435808F272B5004A47F5 /* config.test */,
+ F974D5770FBE7E6100BF728B /* coroutine.test */,
+ F96D435908F272B5004A47F5 /* dcall.test */,
+ F96D435A08F272B5004A47F5 /* dict.test */,
+ F96D435C08F272B5004A47F5 /* dstring.test */,
+ F96D435E08F272B5004A47F5 /* encoding.test */,
+ F96D435F08F272B5004A47F5 /* env.test */,
+ F96D436008F272B5004A47F5 /* error.test */,
+ F96D436108F272B5004A47F5 /* eval.test */,
+ F96D436208F272B5004A47F5 /* event.test */,
+ F96D436308F272B5004A47F5 /* exec.test */,
+ F96D436408F272B5004A47F5 /* execute.test */,
+ F96D436508F272B5004A47F5 /* expr-old.test */,
+ F96D436608F272B5004A47F5 /* expr.test */,
+ F96D436708F272B6004A47F5 /* fCmd.test */,
+ F96D436808F272B6004A47F5 /* fileName.test */,
+ F96D436908F272B6004A47F5 /* fileSystem.test */,
+ F96D436A08F272B6004A47F5 /* for-old.test */,
+ F96D436B08F272B6004A47F5 /* for.test */,
+ F96D436C08F272B6004A47F5 /* foreach.test */,
+ F96D436D08F272B6004A47F5 /* format.test */,
+ F96D436E08F272B6004A47F5 /* get.test */,
+ F96D436F08F272B6004A47F5 /* history.test */,
+ F96D437008F272B6004A47F5 /* http.test */,
+ F974D56C0FBE7D6300BF728B /* http11.test */,
+ F96D437108F272B6004A47F5 /* httpd */,
+ F974D56D0FBE7D6300BF728B /* httpd11.tcl */,
+ F96D437208F272B6004A47F5 /* httpold.test */,
+ F96D437308F272B6004A47F5 /* if-old.test */,
+ F96D437408F272B6004A47F5 /* if.test */,
+ F96D437508F272B6004A47F5 /* incr-old.test */,
+ F96D437608F272B6004A47F5 /* incr.test */,
+ F96D437708F272B6004A47F5 /* indexObj.test */,
+ F96D437808F272B6004A47F5 /* info.test */,
+ F96D437908F272B6004A47F5 /* init.test */,
+ F96D437A08F272B6004A47F5 /* interp.test */,
+ F96D437B08F272B6004A47F5 /* io.test */,
+ F96D437C08F272B6004A47F5 /* ioCmd.test */,
+ F96D437D08F272B6004A47F5 /* iogt.test */,
+ F96D437F08F272B6004A47F5 /* join.test */,
+ F96D438008F272B6004A47F5 /* lindex.test */,
+ F96D438108F272B6004A47F5 /* link.test */,
+ F96D438208F272B6004A47F5 /* linsert.test */,
+ F96D438308F272B6004A47F5 /* list.test */,
+ F96D438408F272B6004A47F5 /* listObj.test */,
+ F96D438508F272B6004A47F5 /* llength.test */,
+ F96D438608F272B6004A47F5 /* load.test */,
+ F96D438708F272B6004A47F5 /* lrange.test */,
+ F96D438808F272B6004A47F5 /* lrepeat.test */,
+ F96D438908F272B6004A47F5 /* lreplace.test */,
+ F96D438A08F272B6004A47F5 /* lsearch.test */,
+ F96D438B08F272B6004A47F5 /* lset.test */,
+ F96D438C08F272B6004A47F5 /* lsetComp.test */,
+ F96D438D08F272B6004A47F5 /* macOSXFCmd.test */,
+ F95FAFF90B34F1130072E431 /* macOSXLoad.test */,
+ F96D438E08F272B6004A47F5 /* main.test */,
+ F9ECB1CB0B26534C00A28025 /* mathop.test */,
+ F96D438F08F272B6004A47F5 /* misc.test */,
+ F96D439008F272B6004A47F5 /* msgcat.test */,
+ F96D439108F272B6004A47F5 /* namespace-old.test */,
+ F96D439208F272B7004A47F5 /* namespace.test */,
+ F96D439308F272B7004A47F5 /* notify.test */,
+ F91DC23C0E44C51B002CB8D1 /* nre.test */,
+ F96D439408F272B7004A47F5 /* obj.test */,
+ F93599C80DF1F81900E04F67 /* oo.test */,
+ F96D439508F272B7004A47F5 /* opt.test */,
+ F96D439608F272B7004A47F5 /* package.test */,
+ F96D439708F272B7004A47F5 /* parse.test */,
+ F96D439808F272B7004A47F5 /* parseExpr.test */,
+ F96D439908F272B7004A47F5 /* parseOld.test */,
+ F96D439A08F272B7004A47F5 /* pid.test */,
+ F96D439B08F272B7004A47F5 /* pkg.test */,
+ F96D439C08F272B7004A47F5 /* pkgMkIndex.test */,
+ F96D439D08F272B7004A47F5 /* platform.test */,
+ F96D439E08F272B7004A47F5 /* proc-old.test */,
+ F96D439F08F272B7004A47F5 /* proc.test */,
+ F96D43A008F272B7004A47F5 /* pwd.test */,
+ F96D43A108F272B7004A47F5 /* README */,
+ F96D43A208F272B7004A47F5 /* reg.test */,
+ F96D43A308F272B7004A47F5 /* regexp.test */,
+ F96D43A408F272B7004A47F5 /* regexpComp.test */,
+ F96D43A508F272B7004A47F5 /* registry.test */,
+ F96D43A608F272B7004A47F5 /* remote.tcl */,
+ F96D43A708F272B7004A47F5 /* rename.test */,
+ F96D43A808F272B7004A47F5 /* result.test */,
+ F96D43A908F272B7004A47F5 /* safe.test */,
+ F96D43AA08F272B7004A47F5 /* scan.test */,
+ F96D43AB08F272B7004A47F5 /* security.test */,
+ F96D43AC08F272B7004A47F5 /* set-old.test */,
+ F96D43AD08F272B7004A47F5 /* set.test */,
+ F96D43AE08F272B7004A47F5 /* socket.test */,
+ F96D43AF08F272B7004A47F5 /* source.test */,
+ F96D43B008F272B7004A47F5 /* split.test */,
+ F96D43B108F272B7004A47F5 /* stack.test */,
+ F96D43B208F272B7004A47F5 /* string.test */,
+ F96D43B308F272B7004A47F5 /* stringComp.test */,
+ F96D43B408F272B7004A47F5 /* stringObj.test */,
+ F96D43B508F272B7004A47F5 /* subst.test */,
+ F96D43B608F272B7004A47F5 /* switch.test */,
+ F974D5780FBE7E6100BF728B /* tailcall.test */,
+ F96D43B708F272B7004A47F5 /* tcltest.test */,
+ F96D43B808F272B7004A47F5 /* thread.test */,
+ F96D43B908F272B7004A47F5 /* timer.test */,
+ F96D43BA08F272B7004A47F5 /* tm.test */,
+ F96D43BB08F272B7004A47F5 /* trace.test */,
+ F96D43BC08F272B7004A47F5 /* unixFCmd.test */,
+ F96D43BD08F272B7004A47F5 /* unixFile.test */,
+ F96D43BE08F272B7004A47F5 /* unixInit.test */,
+ F96D43BF08F272B7004A47F5 /* unixNotfy.test */,
+ F96D43C008F272B7004A47F5 /* unknown.test */,
+ F96D43C108F272B7004A47F5 /* unload.test */,
+ F96D43C208F272B7004A47F5 /* uplevel.test */,
+ F96D43C308F272B7004A47F5 /* upvar.test */,
+ F96D43C408F272B7004A47F5 /* utf.test */,
+ F96D43C508F272B7004A47F5 /* util.test */,
+ F96D43C608F272B7004A47F5 /* var.test */,
+ F96D43C708F272B7004A47F5 /* while-old.test */,
+ F96D43C808F272B7004A47F5 /* while.test */,
+ F96D43C908F272B7004A47F5 /* winConsole.test */,
+ F96D43CA08F272B7004A47F5 /* winDde.test */,
+ F96D43CB08F272B7004A47F5 /* winFCmd.test */,
+ F96D43CC08F272B7004A47F5 /* winFile.test */,
+ F96D43CD08F272B7004A47F5 /* winNotify.test */,
+ F96D43CE08F272B7004A47F5 /* winPipe.test */,
+ F96D43CF08F272B7004A47F5 /* winTime.test */,
+ F915432A0EF201CF0032D1E8 /* zlib.test */,
+ );
+ path = tests;
+ sourceTree = "<group>";
+ };
+ F96D43D008F272B8004A47F5 /* tools */ = {
+ isa = PBXGroup;
+ children = (
+ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */,
+ F96D43D208F272B8004A47F5 /* configure */,
+ F96D43D308F272B8004A47F5 /* configure.in */,
+ F96D442208F272B8004A47F5 /* eolFix.tcl */,
+ F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */,
+ F96D442508F272B8004A47F5 /* genStubs.tcl */,
+ F96D442708F272B8004A47F5 /* index.tcl */,
+ F96D442808F272B8004A47F5 /* installData.tcl */,
+ F96D442908F272B8004A47F5 /* loadICU.tcl */,
+ F96D442A08F272B8004A47F5 /* Makefile.in */,
+ F96D442B08F272B8004A47F5 /* makeTestCases.tcl */,
+ F96D442C08F272B8004A47F5 /* man2help.tcl */,
+ F96D442D08F272B8004A47F5 /* man2help2.tcl */,
+ F96D442E08F272B8004A47F5 /* man2html.tcl */,
+ F96D442F08F272B8004A47F5 /* man2html1.tcl */,
+ F96D443008F272B8004A47F5 /* man2html2.tcl */,
+ F96D443108F272B8004A47F5 /* man2tcl.c */,
+ F96D443208F272B8004A47F5 /* README */,
+ F96D443308F272B8004A47F5 /* regexpTestLib.tcl */,
+ F96D443508F272B8004A47F5 /* tcl.hpj.in */,
+ F96D443608F272B8004A47F5 /* tcl.wse.in */,
+ F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
+ F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */,
+ F96D443B08F272B9004A47F5 /* uniClass.tcl */,
+ F96D443C08F272B9004A47F5 /* uniParse.tcl */,
+ );
+ path = tools;
+ sourceTree = "<group>";
+ };
+ F96D443E08F272B9004A47F5 /* unix */ = {
+ isa = PBXGroup;
+ children = (
+ F96D444008F272B9004A47F5 /* aclocal.m4 */,
+ F96D444108F272B9004A47F5 /* configure */,
+ F96D444208F272B9004A47F5 /* configure.in */,
+ F96D444308F272B9004A47F5 /* dltest */,
+ F96D444D08F272B9004A47F5 /* install-sh */,
+ F96D444E08F272B9004A47F5 /* installManPage */,
+ F96D444F08F272B9004A47F5 /* ldAix */,
+ F96D445008F272B9004A47F5 /* Makefile.in */,
+ F96D445208F272B9004A47F5 /* README */,
+ F96D445308F272B9004A47F5 /* tcl.m4 */,
+ F974D5790FBE7E9C00BF728B /* tcl.pc.in */,
+ F96D445408F272B9004A47F5 /* tcl.spec */,
+ F96D445508F272B9004A47F5 /* tclAppInit.c */,
+ F96D445608F272B9004A47F5 /* tclConfig.h.in */,
+ F96D445708F272B9004A47F5 /* tclConfig.sh.in */,
+ F96D445808F272B9004A47F5 /* tclLoadAix.c */,
+ F96D445908F272B9004A47F5 /* tclLoadDl.c */,
+ F96D445B08F272B9004A47F5 /* tclLoadDyld.c */,
+ F96D445C08F272B9004A47F5 /* tclLoadNext.c */,
+ F96D445D08F272B9004A47F5 /* tclLoadOSF.c */,
+ F96D445E08F272B9004A47F5 /* tclLoadShl.c */,
+ F96D445F08F272B9004A47F5 /* tclUnixChan.c */,
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */,
+ F96D446008F272B9004A47F5 /* tclUnixEvent.c */,
+ F96D446108F272B9004A47F5 /* tclUnixFCmd.c */,
+ F96D446208F272B9004A47F5 /* tclUnixFile.c */,
+ F96D446308F272B9004A47F5 /* tclUnixInit.c */,
+ F96D446408F272B9004A47F5 /* tclUnixNotfy.c */,
+ F96D446508F272B9004A47F5 /* tclUnixPipe.c */,
+ F96D446608F272B9004A47F5 /* tclUnixPort.h */,
+ F96D446708F272B9004A47F5 /* tclUnixSock.c */,
+ F96D446808F272B9004A47F5 /* tclUnixTest.c */,
+ F96D446908F272B9004A47F5 /* tclUnixThrd.c */,
+ F96D446A08F272B9004A47F5 /* tclUnixThrd.h */,
+ F96D446B08F272B9004A47F5 /* tclUnixTime.c */,
+ F96D446C08F272B9004A47F5 /* tclXtNotify.c */,
+ F96D446D08F272B9004A47F5 /* tclXtTest.c */,
+ );
+ path = unix;
+ sourceTree = "<group>";
+ };
+ F96D444308F272B9004A47F5 /* dltest */ = {
+ isa = PBXGroup;
+ children = (
+ F96D444408F272B9004A47F5 /* Makefile.in */,
+ F96D444508F272B9004A47F5 /* pkga.c */,
+ F96D444608F272B9004A47F5 /* pkgb.c */,
+ F96D444708F272B9004A47F5 /* pkgc.c */,
+ F96D444808F272B9004A47F5 /* pkgd.c */,
+ F96D444908F272B9004A47F5 /* pkge.c */,
+ F96D444B08F272B9004A47F5 /* pkgua.c */,
+ F96D444C08F272B9004A47F5 /* README */,
+ );
+ path = dltest;
+ sourceTree = "<group>";
+ };
+ F96D446E08F272B9004A47F5 /* win */ = {
+ isa = PBXGroup;
+ children = (
+ F96D447008F272BA004A47F5 /* aclocal.m4 */,
+ F96D447108F272BA004A47F5 /* buildall.vc.bat */,
+ F96D447208F272BA004A47F5 /* cat.c */,
+ F96D447308F272BA004A47F5 /* coffbase.txt */,
+ F96D447408F272BA004A47F5 /* configure */,
+ F96D447508F272BA004A47F5 /* configure.in */,
+ F96D447608F272BA004A47F5 /* makefile.bc */,
+ F96D447708F272BA004A47F5 /* Makefile.in */,
+ F96D447808F272BA004A47F5 /* makefile.vc */,
+ F96D447908F272BA004A47F5 /* nmakehlp.c */,
+ F96D447A08F272BA004A47F5 /* README */,
+ F96D447C08F272BA004A47F5 /* rules.vc */,
+ F96D447D08F272BA004A47F5 /* stub16.c */,
+ F96D447E08F272BA004A47F5 /* tcl.dsp */,
+ F96D447F08F272BA004A47F5 /* tcl.dsw */,
+ F96D448008F272BA004A47F5 /* tcl.hpj.in */,
+ F96D448108F272BA004A47F5 /* tcl.m4 */,
+ F96D448208F272BA004A47F5 /* tcl.rc */,
+ F96D448308F272BA004A47F5 /* tclAppInit.c */,
+ F96D448408F272BA004A47F5 /* tclConfig.sh.in */,
+ F96D448608F272BA004A47F5 /* tclsh.rc */,
+ F96D448708F272BA004A47F5 /* tclWin32Dll.c */,
+ F96D448808F272BA004A47F5 /* tclWinChan.c */,
+ F96D448908F272BA004A47F5 /* tclWinConsole.c */,
+ F96D448A08F272BA004A47F5 /* tclWinDde.c */,
+ F96D448B08F272BA004A47F5 /* tclWinError.c */,
+ F96D448C08F272BA004A47F5 /* tclWinFCmd.c */,
+ F96D448D08F272BA004A47F5 /* tclWinFile.c */,
+ F96D448E08F272BA004A47F5 /* tclWinInit.c */,
+ F96D448F08F272BA004A47F5 /* tclWinInt.h */,
+ F96D449008F272BA004A47F5 /* tclWinLoad.c */,
+ F96D449108F272BA004A47F5 /* tclWinNotify.c */,
+ F96D449208F272BA004A47F5 /* tclWinPipe.c */,
+ F96D449308F272BA004A47F5 /* tclWinPort.h */,
+ F96D449408F272BA004A47F5 /* tclWinReg.c */,
+ F96D449508F272BA004A47F5 /* tclWinSerial.c */,
+ F96D449608F272BA004A47F5 /* tclWinSock.c */,
+ F96D449708F272BA004A47F5 /* tclWinTest.c */,
+ F96D449808F272BA004A47F5 /* tclWinThrd.c */,
+ F96D449908F272BA004A47F5 /* tclWinThrd.h */,
+ F96D449A08F272BA004A47F5 /* tclWinTime.c */,
+ );
+ path = win;
+ sourceTree = "<group>";
+ };
+ F9ECB1110B26521500A28025 /* platform */ = {
+ isa = PBXGroup;
+ children = (
+ F9ECB1120B26521500A28025 /* pkgIndex.tcl */,
+ F9ECB1130B26521500A28025 /* platform.tcl */,
+ F9ECB1140B26521500A28025 /* shell.tcl */,
+ );
+ path = platform;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76FA90486AB0100D96B5E /* tktest */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8B009158F3100EA5ACE /* Build configuration list for PBXNativeTarget "tktest" */;
+ buildPhases = (
+ F9A5C5F508F651A2008AE941 /* Configure Tcl */,
+ F9A5C5F608F651AB008AE941 /* Configure Tk */,
+ 8DD76FAB0486AB0100D96B5E /* Sources */,
+ 8DD76FAD0486AB0100D96B5E /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = tktest;
+ productInstallPath = "$(BINDIR)";
+ productName = tktest;
+ productReference = 8DD76FB20486AB0100D96B5E /* tktest */;
+ productType = "com.apple.product-type.tool";
+ };
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */;
+ buildPhases = (
+ F9FD30B40CC1AD070073837D /* Configure Tcl */,
+ F9FD30B50CC1AD070073837D /* Configure Tk */,
+ F9FD30BB0CC1AD070073837D /* Sources */,
+ F9FD31E30CC1AD070073837D /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "tktest-X11";
+ productInstallPath = "$(BINDIR)";
+ productName = tktest;
+ productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
+ buildPhases = (
+ F97AF02F0B665DA900310EA2 /* Build Tk */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Tk;
+ productName = Wish;
+ productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ };
+ buildConfigurationList = F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Tk" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* Tk */;
+ projectDirPath = "";
+ projectRoot = ..;
+ targets = (
+ F9E61D16090A3E94002B3151 /* Tk */,
+ 8DD76FA90486AB0100D96B5E /* tktest */,
+ F97258A50A86873C00096C78 /* tktest-X11 */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ F97AF02F0B665DA900310EA2 /* Build Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_TEMP_DIR}/.none",
+ );
+ name = "Build Tk";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${WRAPPER_NAME}",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "export CC=$(xcrun -find ${GCC} || echo ${GCC}); export LD=${CC}\ngnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
+ showEnvVarsInLog = 0;
+ };
+ F9A5C5F508F651A2008AE941 /* Configure Tcl */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TCL_SRCROOT)/macosx/configure.ac",
+ "$(TCL_SRCROOT)/unix/configure.in",
+ "$(TCL_SRCROOT)/unix/tcl.m4",
+ "$(TCL_SRCROOT)/unix/aclocal.m4",
+ "$(TCL_SRCROOT)/unix/tclConfig.sh.in",
+ "$(TCL_SRCROOT)/unix/Makefile.in",
+ "$(TCL_SRCROOT)/unix/dltest/Makefile.in",
+ );
+ name = "Configure Tcl";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tcl/tclConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9A5C5F608F651AB008AE941 /* Configure Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/unix/configure.in",
+ "$(TK_SRCROOT)/unix/tcl.m4",
+ "$(TK_SRCROOT)/unix/aclocal.m4",
+ "$(TK_SRCROOT)/unix/tkConfig.sh.in",
+ );
+ name = "Configure Tk";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tk/tkConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9FD30B40CC1AD070073837D /* Configure Tcl */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TCL_SRCROOT)/macosx/configure.ac",
+ "$(TCL_SRCROOT)/unix/configure.in",
+ "$(TCL_SRCROOT)/unix/tcl.m4",
+ "$(TCL_SRCROOT)/unix/aclocal.m4",
+ "$(TCL_SRCROOT)/unix/tclConfig.sh.in",
+ "$(TCL_SRCROOT)/unix/Makefile.in",
+ "$(TCL_SRCROOT)/unix/dltest/Makefile.in",
+ );
+ name = "Configure Tcl";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tcl/tclConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9FD30B50CC1AD070073837D /* Configure Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/unix/configure.in",
+ "$(TK_SRCROOT)/unix/tcl.m4",
+ "$(TK_SRCROOT)/unix/aclocal.m4",
+ "$(TK_SRCROOT)/unix/tkConfig.sh.in",
+ );
+ name = "Configure Tk";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tk/tkConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76FAB0486AB0100D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F96D456F08F272BB004A47F5 /* regcomp.c in Sources */,
+ F96D457208F272BB004A47F5 /* regerror.c in Sources */,
+ F96D457508F272BB004A47F5 /* regexec.c in Sources */,
+ F96D457608F272BB004A47F5 /* regfree.c in Sources */,
+ F96D457B08F272BB004A47F5 /* tclAlloc.c in Sources */,
+ F96D457C08F272BB004A47F5 /* tclAsync.c in Sources */,
+ F96D457D08F272BB004A47F5 /* tclBasic.c in Sources */,
+ F96D457E08F272BC004A47F5 /* tclBinary.c in Sources */,
+ F96D457F08F272BC004A47F5 /* tclCkalloc.c in Sources */,
+ F96D458008F272BC004A47F5 /* tclClock.c in Sources */,
+ F96D458108F272BC004A47F5 /* tclCmdAH.c in Sources */,
+ F96D458208F272BC004A47F5 /* tclCmdIL.c in Sources */,
+ F96D458308F272BC004A47F5 /* tclCmdMZ.c in Sources */,
+ F96D458408F272BC004A47F5 /* tclCompCmds.c in Sources */,
+ F96D458508F272BC004A47F5 /* tclCompExpr.c in Sources */,
+ F96D458608F272BC004A47F5 /* tclCompile.c in Sources */,
+ F96D458808F272BC004A47F5 /* tclConfig.c in Sources */,
+ F96D458908F272BC004A47F5 /* tclDate.c in Sources */,
+ F96D458B08F272BC004A47F5 /* tclDictObj.c in Sources */,
+ F96D458C08F272BC004A47F5 /* tclEncoding.c in Sources */,
+ F96D458D08F272BC004A47F5 /* tclEnv.c in Sources */,
+ F96D458E08F272BC004A47F5 /* tclEvent.c in Sources */,
+ F96D458F08F272BC004A47F5 /* tclExecute.c in Sources */,
+ F96D459008F272BC004A47F5 /* tclFCmd.c in Sources */,
+ F96D459108F272BC004A47F5 /* tclFileName.c in Sources */,
+ F96D459308F272BC004A47F5 /* tclGet.c in Sources */,
+ F96D459508F272BC004A47F5 /* tclHash.c in Sources */,
+ F96D459608F272BC004A47F5 /* tclHistory.c in Sources */,
+ F96D459708F272BC004A47F5 /* tclIndexObj.c in Sources */,
+ F96D459B08F272BC004A47F5 /* tclInterp.c in Sources */,
+ F96D459D08F272BC004A47F5 /* tclIO.c in Sources */,
+ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */,
+ F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */,
+ F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */,
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */,
+ F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */,
+ F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */,
+ F96D45A408F272BC004A47F5 /* tclLink.c in Sources */,
+ F96D45A508F272BC004A47F5 /* tclListObj.c in Sources */,
+ F96D45A608F272BC004A47F5 /* tclLiteral.c in Sources */,
+ F96D45A708F272BC004A47F5 /* tclLoad.c in Sources */,
+ F96D45A908F272BC004A47F5 /* tclMain.c in Sources */,
+ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */,
+ F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */,
+ F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */,
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */,
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */,
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */,
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */,
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */,
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */,
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */,
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */,
+ F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */,
+ F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */,
+ F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */,
+ F96D45B108F272BC004A47F5 /* tclPipe.c in Sources */,
+ F96D45B208F272BC004A47F5 /* tclPkg.c in Sources */,
+ F96D45B308F272BC004A47F5 /* tclPkgConfig.c in Sources */,
+ F96D45B608F272BC004A47F5 /* tclPosixStr.c in Sources */,
+ F96D45B708F272BC004A47F5 /* tclPreserve.c in Sources */,
+ F96D45B808F272BC004A47F5 /* tclProc.c in Sources */,
+ F96D45B908F272BC004A47F5 /* tclRegexp.c in Sources */,
+ F96D45BB08F272BC004A47F5 /* tclResolve.c in Sources */,
+ F96D45BC08F272BC004A47F5 /* tclResult.c in Sources */,
+ F96D45BD08F272BC004A47F5 /* tclScan.c in Sources */,
+ F96D45BE08F272BC004A47F5 /* tclStringObj.c in Sources */,
+ F96D45C308F272BC004A47F5 /* tclStrToD.c in Sources */,
+ F96D45C408F272BC004A47F5 /* tclStubInit.c in Sources */,
+ F96D45C508F272BC004A47F5 /* tclStubLib.c in Sources */,
+ F96D45C908F272BC004A47F5 /* tclThread.c in Sources */,
+ F96D45CA08F272BC004A47F5 /* tclThreadAlloc.c in Sources */,
+ F96D45CB08F272BC004A47F5 /* tclThreadJoin.c in Sources */,
+ F96D45CC08F272BC004A47F5 /* tclThreadStorage.c in Sources */,
+ F96D45CE08F272BC004A47F5 /* tclTimer.c in Sources */,
+ F96D45D008F272BC004A47F5 /* tclTomMathInterface.c in Sources */,
+ F96D45D108F272BC004A47F5 /* tclTrace.c in Sources */,
+ F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */,
+ F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */,
+ F96D45D508F272BC004A47F5 /* tclVar.c in Sources */,
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */,
+ F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */,
+ F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */,
+ F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */,
+ F96D48E808F272C3004A47F5 /* bn_mp_add_d.c in Sources */,
+ F9E61D2B090A48A4002B3151 /* bn_mp_and.c in Sources */,
+ F96D48EB08F272C3004A47F5 /* bn_mp_clamp.c in Sources */,
+ F96D48EC08F272C3004A47F5 /* bn_mp_clear.c in Sources */,
+ F96D48ED08F272C3004A47F5 /* bn_mp_clear_multi.c in Sources */,
+ F96D48EE08F272C3004A47F5 /* bn_mp_cmp.c in Sources */,
+ F9E61D28090A481F002B3151 /* bn_mp_cmp_d.c in Sources */,
+ F96D48F008F272C3004A47F5 /* bn_mp_cmp_mag.c in Sources */,
+ F96D48F208F272C3004A47F5 /* bn_mp_copy.c in Sources */,
+ F96D48F308F272C3004A47F5 /* bn_mp_count_bits.c in Sources */,
+ F96D48F408F272C3004A47F5 /* bn_mp_div.c in Sources */,
+ F96D48F508F272C3004A47F5 /* bn_mp_div_2.c in Sources */,
+ F96D48F608F272C3004A47F5 /* bn_mp_div_2d.c in Sources */,
+ F96D48F708F272C3004A47F5 /* bn_mp_div_3.c in Sources */,
+ F96D48F808F272C3004A47F5 /* bn_mp_div_d.c in Sources */,
+ F96D48FC08F272C3004A47F5 /* bn_mp_exch.c in Sources */,
+ F9E61D2C090A48AC002B3151 /* bn_mp_expt_d.c in Sources */,
+ F96D490508F272C3004A47F5 /* bn_mp_grow.c in Sources */,
+ F96D490608F272C3004A47F5 /* bn_mp_init.c in Sources */,
+ F96D490708F272C3004A47F5 /* bn_mp_init_copy.c in Sources */,
+ F96D490808F272C3004A47F5 /* bn_mp_init_multi.c in Sources */,
+ F96D490908F272C3004A47F5 /* bn_mp_init_set.c in Sources */,
+ F96D490B08F272C3004A47F5 /* bn_mp_init_size.c in Sources */,
+ F96D491008F272C3004A47F5 /* bn_mp_karatsuba_mul.c in Sources */,
+ F96D491108F272C3004A47F5 /* bn_mp_karatsuba_sqr.c in Sources */,
+ F96D491308F272C3004A47F5 /* bn_mp_lshd.c in Sources */,
+ F96D491408F272C3004A47F5 /* bn_mp_mod.c in Sources */,
+ F96D491508F272C3004A47F5 /* bn_mp_mod_2d.c in Sources */,
+ F96D491A08F272C3004A47F5 /* bn_mp_mul.c in Sources */,
+ F96D491B08F272C3004A47F5 /* bn_mp_mul_2.c in Sources */,
+ F96D491C08F272C3004A47F5 /* bn_mp_mul_2d.c in Sources */,
+ F96D491D08F272C3004A47F5 /* bn_mp_mul_d.c in Sources */,
+ F9E61D29090A486C002B3151 /* bn_mp_neg.c in Sources */,
+ F9E61D2E090A48BF002B3151 /* bn_mp_or.c in Sources */,
+ F96D492908F272C3004A47F5 /* bn_mp_radix_size.c in Sources */,
+ F96D492A08F272C3004A47F5 /* bn_mp_radix_smap.c in Sources */,
+ F96D492C08F272C3004A47F5 /* bn_mp_read_radix.c in Sources */,
+ F96D493708F272C3004A47F5 /* bn_mp_rshd.c in Sources */,
+ F96D493808F272C3004A47F5 /* bn_mp_set.c in Sources */,
+ F9E61D2F090A48C7002B3151 /* bn_mp_shrink.c in Sources */,
+ F96D493C08F272C3004A47F5 /* bn_mp_sqr.c in Sources */,
+ F9E61D2A090A4891002B3151 /* bn_mp_sqrt.c in Sources */,
+ F96D493F08F272C3004A47F5 /* bn_mp_sub.c in Sources */,
+ F96D494008F272C3004A47F5 /* bn_mp_sub_d.c in Sources */,
+ F9E61D30090A48E2002B3151 /* bn_mp_to_unsigned_bin_n.c in Sources */,
+ F9E61D31090A48F9002B3151 /* bn_mp_to_unsigned_bin.c in Sources */,
+ F96D494608F272C3004A47F5 /* bn_mp_toom_mul.c in Sources */,
+ F96D494708F272C3004A47F5 /* bn_mp_toom_sqr.c in Sources */,
+ F96D494908F272C3004A47F5 /* bn_mp_toradix_n.c in Sources */,
+ F9E61D32090A48FA002B3151 /* bn_mp_unsigned_bin_size.c in Sources */,
+ F9E61D2D090A48BB002B3151 /* bn_mp_xor.c in Sources */,
+ F96D494C08F272C3004A47F5 /* bn_mp_zero.c in Sources */,
+ F96D494E08F272C3004A47F5 /* bn_reverse.c in Sources */,
+ F96D494F08F272C3004A47F5 /* bn_s_mp_add.c in Sources */,
+ F96D495108F272C3004A47F5 /* bn_s_mp_mul_digs.c in Sources */,
+ F96D495308F272C3004A47F5 /* bn_s_mp_sqr.c in Sources */,
+ F96D495408F272C3004A47F5 /* bn_s_mp_sub.c in Sources */,
+ F96D495508F272C3004A47F5 /* bncore.c in Sources */,
+ F96D49A908F272C4004A47F5 /* tclMacOSXBundle.c in Sources */,
+ F96D49AD08F272C4004A47F5 /* tclMacOSXFCmd.c in Sources */,
+ F96D49AE08F272C4004A47F5 /* tclMacOSXNotify.c in Sources */,
+ F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */,
+ F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */,
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */,
+ F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */,
+ F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */,
+ F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */,
+ F96D4ACE08F272C9004A47F5 /* tclUnixInit.c in Sources */,
+ F96D4ACF08F272C9004A47F5 /* tclUnixNotfy.c in Sources */,
+ F96D4AD008F272C9004A47F5 /* tclUnixPipe.c in Sources */,
+ F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */,
+ F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */,
+ F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */,
+ F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */,
+ F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */,
+ F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */,
+ F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */,
+ F966BDD308F27A3F005CB29B /* tkBind.c in Sources */,
+ F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */,
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */,
+ F966BDD508F27A3F005CB29B /* tkButton.c in Sources */,
+ F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */,
+ F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */,
+ F966BDDA08F27A3F005CB29B /* tkCanvBmap.c in Sources */,
+ F966BDDB08F27A3F005CB29B /* tkCanvImg.c in Sources */,
+ F966BDDC08F27A3F005CB29B /* tkCanvLine.c in Sources */,
+ F966BDDD08F27A3F005CB29B /* tkCanvPoly.c in Sources */,
+ F966BDDE08F27A3F005CB29B /* tkCanvPs.c in Sources */,
+ F966BDE008F27A3F005CB29B /* tkCanvText.c in Sources */,
+ F966BDE108F27A3F005CB29B /* tkCanvUtil.c in Sources */,
+ F966BDE208F27A3F005CB29B /* tkCanvWind.c in Sources */,
+ F966BDE308F27A3F005CB29B /* tkClipboard.c in Sources */,
+ F966BDE408F27A3F005CB29B /* tkCmds.c in Sources */,
+ F966BDE508F27A3F005CB29B /* tkColor.c in Sources */,
+ F966BDE708F27A3F005CB29B /* tkConfig.c in Sources */,
+ F966BDE808F27A3F005CB29B /* tkConsole.c in Sources */,
+ F966BDE908F27A3F005CB29B /* tkCursor.c in Sources */,
+ F966BDEB08F27A3F005CB29B /* tkEntry.c in Sources */,
+ F966BDED08F27A3F005CB29B /* tkError.c in Sources */,
+ F966BDEE08F27A3F005CB29B /* tkEvent.c in Sources */,
+ F966BDEF08F27A3F005CB29B /* tkFileFilter.c in Sources */,
+ F966BDF108F27A3F005CB29B /* tkFocus.c in Sources */,
+ F966BDF208F27A3F005CB29B /* tkFont.c in Sources */,
+ F966BDF408F27A3F005CB29B /* tkFrame.c in Sources */,
+ F966BDF508F27A3F005CB29B /* tkGC.c in Sources */,
+ F966BDF608F27A3F005CB29B /* tkGeometry.c in Sources */,
+ F966BDF708F27A3F005CB29B /* tkGet.c in Sources */,
+ F966BDF808F27A3F005CB29B /* tkGrab.c in Sources */,
+ F966BDF908F27A3F005CB29B /* tkGrid.c in Sources */,
+ F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */,
+ F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */,
+ F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */,
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */,
+ F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */,
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
+ F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */,
+ F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */,
+ F966BE0808F27A3F005CB29B /* tkMacWinMenu.c in Sources */,
+ F966BE0908F27A3F005CB29B /* tkMain.c in Sources */,
+ F966BE0A08F27A3F005CB29B /* tkMenu.c in Sources */,
+ F966BE0C08F27A3F005CB29B /* tkMenubutton.c in Sources */,
+ F966BE0E08F27A3F005CB29B /* tkMenuDraw.c in Sources */,
+ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */,
+ F966BE1008F27A3F005CB29B /* tkObj.c in Sources */,
+ F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */,
+ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */,
+ F966BE1208F27A3F005CB29B /* tkOption.c in Sources */,
+ F966BE1308F27A3F005CB29B /* tkPack.c in Sources */,
+ F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */,
+ F966BE1508F27A3F005CB29B /* tkPlace.c in Sources */,
+ F966BE1708F27A3F005CB29B /* tkPointer.c in Sources */,
+ F966BE1908F27A3F005CB29B /* tkRectOval.c in Sources */,
+ F966BE1A08F27A3F005CB29B /* tkScale.c in Sources */,
+ F966BE1C08F27A40005CB29B /* tkScrollbar.c in Sources */,
+ F966BE1E08F27A40005CB29B /* tkSelect.c in Sources */,
+ F966BE2008F27A40005CB29B /* tkSquare.c in Sources */,
+ F966BE2208F27A40005CB29B /* tkStubInit.c in Sources */,
+ F966BE2308F27A40005CB29B /* tkStubLib.c in Sources */,
+ F966BE2408F27A40005CB29B /* tkStyle.c in Sources */,
+ F966BE2508F27A40005CB29B /* tkTest.c in Sources */,
+ F966BE2608F27A40005CB29B /* tkText.c in Sources */,
+ F966BE2808F27A40005CB29B /* tkTextBTree.c in Sources */,
+ F966BE2908F27A40005CB29B /* tkTextDisp.c in Sources */,
+ F966BE2B08F27A40005CB29B /* tkTextImage.c in Sources */,
+ F966BE2C08F27A40005CB29B /* tkTextIndex.c in Sources */,
+ F966BE2D08F27A40005CB29B /* tkTextMark.c in Sources */,
+ F966BE2E08F27A40005CB29B /* tkTextTag.c in Sources */,
+ F966BE2F08F27A40005CB29B /* tkTextWind.c in Sources */,
+ F966BE3008F27A40005CB29B /* tkTrig.c in Sources */,
+ F966BE3108F27A40005CB29B /* tkUndo.c in Sources */,
+ F966BE3308F27A40005CB29B /* tkUtil.c in Sources */,
+ F966BE3408F27A40005CB29B /* tkVisual.c in Sources */,
+ F966BE3508F27A40005CB29B /* tkWindow.c in Sources */,
+ F96888050AF786D5000797B5 /* ttkBlink.c in Sources */,
+ F96888060AF786D5000797B5 /* ttkButton.c in Sources */,
+ F96888070AF786D5000797B5 /* ttkCache.c in Sources */,
+ F96888080AF786D5000797B5 /* ttkClamTheme.c in Sources */,
+ F96888090AF786D5000797B5 /* ttkClassicTheme.c in Sources */,
+ F968880A0AF786D5000797B5 /* ttkDefaultTheme.c in Sources */,
+ F968880B0AF786D5000797B5 /* ttkElements.c in Sources */,
+ F968880C0AF786D5000797B5 /* ttkEntry.c in Sources */,
+ F968880D0AF786D5000797B5 /* ttkFrame.c in Sources */,
+ F968880E0AF786D5000797B5 /* ttkImage.c in Sources */,
+ F968880F0AF786D5000797B5 /* ttkInit.c in Sources */,
+ F96888100AF786D5000797B5 /* ttkLabel.c in Sources */,
+ F96888110AF786D5000797B5 /* ttkLayout.c in Sources */,
+ F96888120AF786D5000797B5 /* ttkManager.c in Sources */,
+ F96888130AF786D5000797B5 /* ttkNotebook.c in Sources */,
+ F96888140AF786D5000797B5 /* ttkPanedwindow.c in Sources */,
+ F96888150AF786D5000797B5 /* ttkProgress.c in Sources */,
+ F96888160AF786D5000797B5 /* ttkScale.c in Sources */,
+ F96888170AF786D5000797B5 /* ttkScroll.c in Sources */,
+ F96888180AF786D5000797B5 /* ttkScrollbar.c in Sources */,
+ F96888190AF786D5000797B5 /* ttkSeparator.c in Sources */,
+ F968881A0AF786D5000797B5 /* ttkSquare.c in Sources */,
+ F968881B0AF786D5000797B5 /* ttkState.c in Sources */,
+ F968881C0AF786D5000797B5 /* ttkStubInit.c in Sources */,
+ F968881D0AF786D5000797B5 /* ttkStubLib.c in Sources */,
+ F968881E0AF786D5000797B5 /* ttkTagSet.c in Sources */,
+ F968881F0AF786D5000797B5 /* ttkTheme.c in Sources */,
+ F96888200AF786D5000797B5 /* ttkTrace.c in Sources */,
+ F96888210AF786D5000797B5 /* ttkTrack.c in Sources */,
+ F96888220AF786D5000797B5 /* ttkTreeview.c in Sources */,
+ F96888230AF786D5000797B5 /* ttkWidget.c in Sources */,
+ F966BEDB08F27A40005CB29B /* tkMacOSXBitmap.c in Sources */,
+ F966BEDC08F27A40005CB29B /* tkMacOSXButton.c in Sources */,
+ F966BEDE08F27A40005CB29B /* tkMacOSXClipboard.c in Sources */,
+ F966BEDF08F27A40005CB29B /* tkMacOSXColor.c in Sources */,
+ F966BEE008F27A40005CB29B /* tkMacOSXConfig.c in Sources */,
+ F966BEE108F27A40005CB29B /* tkMacOSXCursor.c in Sources */,
+ F966BEE308F27A40005CB29B /* tkMacOSXDebug.c in Sources */,
+ F966BEE608F27A40005CB29B /* tkMacOSXDialog.c in Sources */,
+ F966BEE708F27A40005CB29B /* tkMacOSXDraw.c in Sources */,
+ F966BEE808F27A40005CB29B /* tkMacOSXEmbed.c in Sources */,
+ F966BEE908F27A40005CB29B /* tkMacOSXEntry.c in Sources */,
+ F966BEEA08F27A40005CB29B /* tkMacOSXEvent.c in Sources */,
+ F966BEEC08F27A40005CB29B /* tkMacOSXFont.c in Sources */,
+ F966BEED08F27A40005CB29B /* tkMacOSXHLEvents.c in Sources */,
+ F966BEEE08F27A40005CB29B /* tkMacOSXInit.c in Sources */,
+ F966BEF108F27A40005CB29B /* tkMacOSXKeyboard.c in Sources */,
+ F966BEF208F27A40005CB29B /* tkMacOSXKeyEvent.c in Sources */,
+ F966BEF308F27A40005CB29B /* tkMacOSXMenu.c in Sources */,
+ F966BEF608F27A40005CB29B /* tkMacOSXMenubutton.c in Sources */,
+ F966BEF708F27A40005CB29B /* tkMacOSXMenus.c in Sources */,
+ F966BEF808F27A40005CB29B /* tkMacOSXMouseEvent.c in Sources */,
+ F966BEF908F27A40005CB29B /* tkMacOSXNotify.c in Sources */,
+ F966BF0108F27A40005CB29B /* tkMacOSXRegion.c in Sources */,
+ F966BF0308F27A40005CB29B /* tkMacOSXScrlbr.c in Sources */,
+ F966BF0408F27A40005CB29B /* tkMacOSXSend.c in Sources */,
+ F966BF0508F27A40005CB29B /* tkMacOSXSubwindows.c in Sources */,
+ F966BF0608F27A40005CB29B /* tkMacOSXTest.c in Sources */,
+ F966BF0708F27A40005CB29B /* tkMacOSXWindowEvent.c in Sources */,
+ F966BF0808F27A40005CB29B /* tkMacOSXWm.c in Sources */,
+ F966BF0B08F27A40005CB29B /* tkMacOSXXStubs.c in Sources */,
+ F96888850AF78938000797B5 /* ttkMacOSXTheme.c in Sources */,
+ F966BF7F08F27A41005CB29B /* tkAppInit.c in Sources */,
+ F966BF8308F27A41005CB29B /* tkUnix3d.c in Sources */,
+ F966BF9608F27A41005CB29B /* tkUnixScale.c in Sources */,
+ F966C02A08F27A42005CB29B /* xcolors.c in Sources */,
+ F966C02B08F27A42005CB29B /* xdraw.c in Sources */,
+ F966C02C08F27A42005CB29B /* xgc.c in Sources */,
+ F966C02D08F27A42005CB29B /* ximage.c in Sources */,
+ F966C02E08F27A42005CB29B /* xutil.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9FD30BB0CC1AD070073837D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9FD30BC0CC1AD070073837D /* regcomp.c in Sources */,
+ F9FD30BD0CC1AD070073837D /* regerror.c in Sources */,
+ F9FD30BE0CC1AD070073837D /* regexec.c in Sources */,
+ F9FD30BF0CC1AD070073837D /* regfree.c in Sources */,
+ F9FD30C00CC1AD070073837D /* tclAlloc.c in Sources */,
+ F9FD30C10CC1AD070073837D /* tclAsync.c in Sources */,
+ F9FD30C20CC1AD070073837D /* tclBasic.c in Sources */,
+ F9FD30C30CC1AD070073837D /* tclBinary.c in Sources */,
+ F9FD30C40CC1AD070073837D /* tclCkalloc.c in Sources */,
+ F9FD30C50CC1AD070073837D /* tclClock.c in Sources */,
+ F9FD30C60CC1AD070073837D /* tclCmdAH.c in Sources */,
+ F9FD30C70CC1AD070073837D /* tclCmdIL.c in Sources */,
+ F9FD30C80CC1AD070073837D /* tclCmdMZ.c in Sources */,
+ F9FD30C90CC1AD070073837D /* tclCompCmds.c in Sources */,
+ F9FD30CA0CC1AD070073837D /* tclCompExpr.c in Sources */,
+ F9FD30CB0CC1AD070073837D /* tclCompile.c in Sources */,
+ F9FD30CC0CC1AD070073837D /* tclConfig.c in Sources */,
+ F9FD30CD0CC1AD070073837D /* tclDate.c in Sources */,
+ F9FD30CE0CC1AD070073837D /* tclDictObj.c in Sources */,
+ F9FD30CF0CC1AD070073837D /* tclEncoding.c in Sources */,
+ F9FD30D00CC1AD070073837D /* tclEnv.c in Sources */,
+ F9FD30D10CC1AD070073837D /* tclEvent.c in Sources */,
+ F9FD30D20CC1AD070073837D /* tclExecute.c in Sources */,
+ F9FD30D30CC1AD070073837D /* tclFCmd.c in Sources */,
+ F9FD30D40CC1AD070073837D /* tclFileName.c in Sources */,
+ F9FD30D50CC1AD070073837D /* tclGet.c in Sources */,
+ F9FD30D60CC1AD070073837D /* tclHash.c in Sources */,
+ F9FD30D70CC1AD070073837D /* tclHistory.c in Sources */,
+ F9FD30D80CC1AD070073837D /* tclIndexObj.c in Sources */,
+ F9FD30D90CC1AD070073837D /* tclInterp.c in Sources */,
+ F9FD30DA0CC1AD070073837D /* tclIO.c in Sources */,
+ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */,
+ F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */,
+ F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */,
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */,
+ F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */,
+ F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */,
+ F9FD30E00CC1AD070073837D /* tclLink.c in Sources */,
+ F9FD30E10CC1AD070073837D /* tclListObj.c in Sources */,
+ F9FD30E20CC1AD070073837D /* tclLiteral.c in Sources */,
+ F9FD30E30CC1AD070073837D /* tclLoad.c in Sources */,
+ F9FD30E40CC1AD070073837D /* tclMain.c in Sources */,
+ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */,
+ F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */,
+ F9FD30E70CC1AD070073837D /* tclObj.c in Sources */,
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */,
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */,
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */,
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */,
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */,
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */,
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */,
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */,
+ F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */,
+ F9FD30E90CC1AD070073837D /* tclParse.c in Sources */,
+ F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */,
+ F9FD30EB0CC1AD070073837D /* tclPipe.c in Sources */,
+ F9FD30EC0CC1AD070073837D /* tclPkg.c in Sources */,
+ F9FD30ED0CC1AD070073837D /* tclPkgConfig.c in Sources */,
+ F9FD30EE0CC1AD070073837D /* tclPosixStr.c in Sources */,
+ F9FD30EF0CC1AD070073837D /* tclPreserve.c in Sources */,
+ F9FD30F00CC1AD070073837D /* tclProc.c in Sources */,
+ F9FD30F10CC1AD070073837D /* tclRegexp.c in Sources */,
+ F9FD30F20CC1AD070073837D /* tclResolve.c in Sources */,
+ F9FD30F30CC1AD070073837D /* tclResult.c in Sources */,
+ F9FD30F40CC1AD070073837D /* tclScan.c in Sources */,
+ F9FD30F50CC1AD070073837D /* tclStringObj.c in Sources */,
+ F9FD30F60CC1AD070073837D /* tclStrToD.c in Sources */,
+ F9FD30F70CC1AD070073837D /* tclStubInit.c in Sources */,
+ F9FD30F80CC1AD070073837D /* tclStubLib.c in Sources */,
+ F9FD30F90CC1AD070073837D /* tclThread.c in Sources */,
+ F9FD30FA0CC1AD070073837D /* tclThreadAlloc.c in Sources */,
+ F9FD30FB0CC1AD070073837D /* tclThreadJoin.c in Sources */,
+ F9FD30FC0CC1AD070073837D /* tclThreadStorage.c in Sources */,
+ F9FD30FD0CC1AD070073837D /* tclTimer.c in Sources */,
+ F9FD30FE0CC1AD070073837D /* tclTomMathInterface.c in Sources */,
+ F9FD30FF0CC1AD070073837D /* tclTrace.c in Sources */,
+ F9FD31000CC1AD070073837D /* tclUtf.c in Sources */,
+ F9FD31010CC1AD070073837D /* tclUtil.c in Sources */,
+ F9FD31020CC1AD070073837D /* tclVar.c in Sources */,
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */,
+ F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */,
+ F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */,
+ F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */,
+ F9FD31060CC1AD070073837D /* bn_mp_add_d.c in Sources */,
+ F9FD31070CC1AD070073837D /* bn_mp_and.c in Sources */,
+ F9FD31080CC1AD070073837D /* bn_mp_clamp.c in Sources */,
+ F9FD31090CC1AD070073837D /* bn_mp_clear.c in Sources */,
+ F9FD310A0CC1AD070073837D /* bn_mp_clear_multi.c in Sources */,
+ F9FD310B0CC1AD070073837D /* bn_mp_cmp.c in Sources */,
+ F9FD310C0CC1AD070073837D /* bn_mp_cmp_d.c in Sources */,
+ F9FD310D0CC1AD070073837D /* bn_mp_cmp_mag.c in Sources */,
+ F9FD310E0CC1AD070073837D /* bn_mp_copy.c in Sources */,
+ F9FD310F0CC1AD070073837D /* bn_mp_count_bits.c in Sources */,
+ F9FD31100CC1AD070073837D /* bn_mp_div.c in Sources */,
+ F9FD31110CC1AD070073837D /* bn_mp_div_2.c in Sources */,
+ F9FD31120CC1AD070073837D /* bn_mp_div_2d.c in Sources */,
+ F9FD31130CC1AD070073837D /* bn_mp_div_3.c in Sources */,
+ F9FD31140CC1AD070073837D /* bn_mp_div_d.c in Sources */,
+ F9FD31150CC1AD070073837D /* bn_mp_exch.c in Sources */,
+ F9FD31160CC1AD070073837D /* bn_mp_expt_d.c in Sources */,
+ F9FD31170CC1AD070073837D /* bn_mp_grow.c in Sources */,
+ F9FD31180CC1AD070073837D /* bn_mp_init.c in Sources */,
+ F9FD31190CC1AD070073837D /* bn_mp_init_copy.c in Sources */,
+ F9FD311A0CC1AD070073837D /* bn_mp_init_multi.c in Sources */,
+ F9FD311B0CC1AD070073837D /* bn_mp_init_set.c in Sources */,
+ F9FD311C0CC1AD070073837D /* bn_mp_init_size.c in Sources */,
+ F9FD311D0CC1AD070073837D /* bn_mp_karatsuba_mul.c in Sources */,
+ F9FD311E0CC1AD070073837D /* bn_mp_karatsuba_sqr.c in Sources */,
+ F9FD311F0CC1AD070073837D /* bn_mp_lshd.c in Sources */,
+ F9FD31200CC1AD070073837D /* bn_mp_mod.c in Sources */,
+ F9FD31210CC1AD070073837D /* bn_mp_mod_2d.c in Sources */,
+ F9FD31220CC1AD070073837D /* bn_mp_mul.c in Sources */,
+ F9FD31230CC1AD070073837D /* bn_mp_mul_2.c in Sources */,
+ F9FD31240CC1AD070073837D /* bn_mp_mul_2d.c in Sources */,
+ F9FD31250CC1AD070073837D /* bn_mp_mul_d.c in Sources */,
+ F9FD31260CC1AD070073837D /* bn_mp_neg.c in Sources */,
+ F9FD31270CC1AD070073837D /* bn_mp_or.c in Sources */,
+ F9FD31280CC1AD070073837D /* bn_mp_radix_size.c in Sources */,
+ F9FD31290CC1AD070073837D /* bn_mp_radix_smap.c in Sources */,
+ F9FD312A0CC1AD070073837D /* bn_mp_read_radix.c in Sources */,
+ F9FD312B0CC1AD070073837D /* bn_mp_rshd.c in Sources */,
+ F9FD312C0CC1AD070073837D /* bn_mp_set.c in Sources */,
+ F9FD312D0CC1AD070073837D /* bn_mp_shrink.c in Sources */,
+ F9FD312E0CC1AD070073837D /* bn_mp_sqr.c in Sources */,
+ F9FD312F0CC1AD070073837D /* bn_mp_sqrt.c in Sources */,
+ F9FD31300CC1AD070073837D /* bn_mp_sub.c in Sources */,
+ F9FD31310CC1AD070073837D /* bn_mp_sub_d.c in Sources */,
+ F9FD31320CC1AD070073837D /* bn_mp_to_unsigned_bin_n.c in Sources */,
+ F9FD31330CC1AD070073837D /* bn_mp_to_unsigned_bin.c in Sources */,
+ F9FD31340CC1AD070073837D /* bn_mp_toom_mul.c in Sources */,
+ F9FD31350CC1AD070073837D /* bn_mp_toom_sqr.c in Sources */,
+ F9FD31360CC1AD070073837D /* bn_mp_toradix_n.c in Sources */,
+ F9FD31370CC1AD070073837D /* bn_mp_unsigned_bin_size.c in Sources */,
+ F9FD31380CC1AD070073837D /* bn_mp_xor.c in Sources */,
+ F9FD31390CC1AD070073837D /* bn_mp_zero.c in Sources */,
+ F9FD313A0CC1AD070073837D /* bn_reverse.c in Sources */,
+ F9FD313B0CC1AD070073837D /* bn_s_mp_add.c in Sources */,
+ F9FD313C0CC1AD070073837D /* bn_s_mp_mul_digs.c in Sources */,
+ F9FD313D0CC1AD070073837D /* bn_s_mp_sqr.c in Sources */,
+ F9FD313E0CC1AD070073837D /* bn_s_mp_sub.c in Sources */,
+ F9FD313F0CC1AD070073837D /* bncore.c in Sources */,
+ F9FD31400CC1AD070073837D /* tclMacOSXBundle.c in Sources */,
+ F9FD31410CC1AD070073837D /* tclMacOSXFCmd.c in Sources */,
+ F9FD31420CC1AD070073837D /* tclMacOSXNotify.c in Sources */,
+ F9FD31430CC1AD070073837D /* tclLoadDyld.c in Sources */,
+ F9FD31440CC1AD070073837D /* tclUnixChan.c in Sources */,
+ F9FD31450CC1AD070073837D /* tclUnixCompat.c in Sources */,
+ F9FD31460CC1AD070073837D /* tclUnixEvent.c in Sources */,
+ F9FD31470CC1AD070073837D /* tclUnixFCmd.c in Sources */,
+ F9FD31480CC1AD070073837D /* tclUnixFile.c in Sources */,
+ F9FD31490CC1AD070073837D /* tclUnixInit.c in Sources */,
+ F9FD314A0CC1AD070073837D /* tclUnixNotfy.c in Sources */,
+ F9FD314B0CC1AD070073837D /* tclUnixPipe.c in Sources */,
+ F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */,
+ F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */,
+ F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */,
+ F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */,
+ F9FD314F0CC1AD070073837D /* tk3d.c in Sources */,
+ F9FD31500CC1AD070073837D /* tkArgv.c in Sources */,
+ F9FD31510CC1AD070073837D /* tkAtom.c in Sources */,
+ F9FD31520CC1AD070073837D /* tkBind.c in Sources */,
+ F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */,
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */,
+ F9FD31540CC1AD070073837D /* tkButton.c in Sources */,
+ F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */,
+ F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */,
+ F9FD31570CC1AD070073837D /* tkCanvBmap.c in Sources */,
+ F9FD31580CC1AD070073837D /* tkCanvImg.c in Sources */,
+ F9FD31590CC1AD070073837D /* tkCanvLine.c in Sources */,
+ F9FD315A0CC1AD070073837D /* tkCanvPoly.c in Sources */,
+ F9FD315B0CC1AD070073837D /* tkCanvPs.c in Sources */,
+ F9FD315C0CC1AD070073837D /* tkCanvText.c in Sources */,
+ F9FD315D0CC1AD070073837D /* tkCanvUtil.c in Sources */,
+ F9FD315E0CC1AD070073837D /* tkCanvWind.c in Sources */,
+ F9FD315F0CC1AD070073837D /* tkClipboard.c in Sources */,
+ F9FD31600CC1AD070073837D /* tkCmds.c in Sources */,
+ F9FD31610CC1AD070073837D /* tkColor.c in Sources */,
+ F9FD31620CC1AD070073837D /* tkConfig.c in Sources */,
+ F9FD31630CC1AD070073837D /* tkConsole.c in Sources */,
+ F9FD31640CC1AD070073837D /* tkCursor.c in Sources */,
+ F9FD31650CC1AD070073837D /* tkEntry.c in Sources */,
+ F9FD31660CC1AD070073837D /* tkError.c in Sources */,
+ F9FD31670CC1AD070073837D /* tkEvent.c in Sources */,
+ F9FD31680CC1AD070073837D /* tkFileFilter.c in Sources */,
+ F9FD31690CC1AD070073837D /* tkFocus.c in Sources */,
+ F9FD316A0CC1AD070073837D /* tkFont.c in Sources */,
+ F9FD316B0CC1AD070073837D /* tkFrame.c in Sources */,
+ F9FD316C0CC1AD070073837D /* tkGC.c in Sources */,
+ F9FD316D0CC1AD070073837D /* tkGeometry.c in Sources */,
+ F9FD316E0CC1AD070073837D /* tkGet.c in Sources */,
+ F9FD316F0CC1AD070073837D /* tkGrab.c in Sources */,
+ F9FD31700CC1AD070073837D /* tkGrid.c in Sources */,
+ F9FD31710CC1AD070073837D /* tkImage.c in Sources */,
+ F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */,
+ F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */,
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */,
+ F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */,
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
+ F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */,
+ F9FD31760CC1AD070073837D /* tkListbox.c in Sources */,
+ F9FD31770CC1AD070073837D /* tkMacWinMenu.c in Sources */,
+ F9FD31780CC1AD070073837D /* tkMain.c in Sources */,
+ F9FD31790CC1AD070073837D /* tkMenu.c in Sources */,
+ F9FD317A0CC1AD070073837D /* tkMenubutton.c in Sources */,
+ F9FD317B0CC1AD070073837D /* tkMenuDraw.c in Sources */,
+ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */,
+ F9FD317D0CC1AD070073837D /* tkObj.c in Sources */,
+ F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */,
+ F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */,
+ F9FD31800CC1AD070073837D /* tkOption.c in Sources */,
+ F9FD31810CC1AD070073837D /* tkPack.c in Sources */,
+ F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */,
+ F9FD31830CC1AD070073837D /* tkPlace.c in Sources */,
+ F9FD31850CC1AD070073837D /* tkRectOval.c in Sources */,
+ F9FD31860CC1AD070073837D /* tkScale.c in Sources */,
+ F9FD31870CC1AD070073837D /* tkScrollbar.c in Sources */,
+ F9FD31880CC1AD070073837D /* tkSelect.c in Sources */,
+ F9FD31890CC1AD070073837D /* tkSquare.c in Sources */,
+ F9FD318A0CC1AD070073837D /* tkStubInit.c in Sources */,
+ F9FD318B0CC1AD070073837D /* tkStubLib.c in Sources */,
+ F9FD318C0CC1AD070073837D /* tkStyle.c in Sources */,
+ F9FD318D0CC1AD070073837D /* tkTest.c in Sources */,
+ F9FD318E0CC1AD070073837D /* tkText.c in Sources */,
+ F9FD318F0CC1AD070073837D /* tkTextBTree.c in Sources */,
+ F9FD31900CC1AD070073837D /* tkTextDisp.c in Sources */,
+ F9FD31910CC1AD070073837D /* tkTextImage.c in Sources */,
+ F9FD31920CC1AD070073837D /* tkTextIndex.c in Sources */,
+ F9FD31930CC1AD070073837D /* tkTextMark.c in Sources */,
+ F9FD31940CC1AD070073837D /* tkTextTag.c in Sources */,
+ F9FD31950CC1AD070073837D /* tkTextWind.c in Sources */,
+ F9FD31960CC1AD070073837D /* tkTrig.c in Sources */,
+ F9FD31970CC1AD070073837D /* tkUndo.c in Sources */,
+ F9FD31980CC1AD070073837D /* tkUtil.c in Sources */,
+ F9FD31990CC1AD070073837D /* tkVisual.c in Sources */,
+ F9FD319A0CC1AD070073837D /* tkWindow.c in Sources */,
+ F9FD319B0CC1AD070073837D /* ttkBlink.c in Sources */,
+ F9FD319C0CC1AD070073837D /* ttkButton.c in Sources */,
+ F9FD319D0CC1AD070073837D /* ttkCache.c in Sources */,
+ F9FD319E0CC1AD070073837D /* ttkClamTheme.c in Sources */,
+ F9FD319F0CC1AD070073837D /* ttkClassicTheme.c in Sources */,
+ F9FD31A00CC1AD070073837D /* ttkDefaultTheme.c in Sources */,
+ F9FD31A10CC1AD070073837D /* ttkElements.c in Sources */,
+ F9FD31A20CC1AD070073837D /* ttkEntry.c in Sources */,
+ F9FD31A30CC1AD070073837D /* ttkFrame.c in Sources */,
+ F9FD31A40CC1AD070073837D /* ttkImage.c in Sources */,
+ F9FD31A50CC1AD070073837D /* ttkInit.c in Sources */,
+ F9FD31A60CC1AD070073837D /* ttkLabel.c in Sources */,
+ F9FD31A70CC1AD070073837D /* ttkLayout.c in Sources */,
+ F9FD31A80CC1AD070073837D /* ttkManager.c in Sources */,
+ F9FD31A90CC1AD070073837D /* ttkNotebook.c in Sources */,
+ F9FD31AA0CC1AD070073837D /* ttkPanedwindow.c in Sources */,
+ F9FD31AB0CC1AD070073837D /* ttkProgress.c in Sources */,
+ F9FD31AC0CC1AD070073837D /* ttkScale.c in Sources */,
+ F9FD31AD0CC1AD070073837D /* ttkScroll.c in Sources */,
+ F9FD31AE0CC1AD070073837D /* ttkScrollbar.c in Sources */,
+ F9FD31AF0CC1AD070073837D /* ttkSeparator.c in Sources */,
+ F9FD31B00CC1AD070073837D /* ttkSquare.c in Sources */,
+ F9FD31B10CC1AD070073837D /* ttkState.c in Sources */,
+ F9FD31B20CC1AD070073837D /* ttkStubInit.c in Sources */,
+ F9FD31B30CC1AD070073837D /* ttkStubLib.c in Sources */,
+ F9FD31B40CC1AD070073837D /* ttkTagSet.c in Sources */,
+ F9FD31B50CC1AD070073837D /* ttkTheme.c in Sources */,
+ F9FD31B60CC1AD070073837D /* ttkTrace.c in Sources */,
+ F9FD31B70CC1AD070073837D /* ttkTrack.c in Sources */,
+ F9FD31B80CC1AD070073837D /* ttkTreeview.c in Sources */,
+ F9FD31B90CC1AD070073837D /* ttkWidget.c in Sources */,
+ F9FD31DA0CC1AD070073837D /* tkAppInit.c in Sources */,
+ F9FD32020CC1ADB70073837D /* tkUnix.c in Sources */,
+ F9FD31DB0CC1AD070073837D /* tkUnix3d.c in Sources */,
+ F9FD320A0CC1ADB70073837D /* tkUnixButton.c in Sources */,
+ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */,
+ F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */,
+ F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */,
+ F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */,
+ F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */,
+ F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */,
+ F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */,
+ F9FD31FF0CC1ADB70073837D /* tkUnixFocus.c in Sources */,
+ F9FD31FC0CC1ADB70073837D /* tkUnixInit.c in Sources */,
+ F9FD31FA0CC1ADB70073837D /* tkUnixKey.c in Sources */,
+ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */,
+ F9FD320B0CC1ADB70073837D /* tkUnixMenubu.c in Sources */,
+ F9FD32010CC1ADB70073837D /* tkUnixRFont.c in Sources */,
+ F9FD31DC0CC1AD070073837D /* tkUnixScale.c in Sources */,
+ F9FD320C0CC1ADB70073837D /* tkUnixScrlbr.c in Sources */,
+ F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */,
+ F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */,
+ F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */,
+ F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ F90E36D50F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = unsupported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D60F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D70F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D80F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoGC;
+ };
+ F91BCC4F093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = ReleaseUniversal;
+ };
+ F91BCC50093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = ReleaseUniversal;
+ };
+ F91BCC51093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = ReleaseUniversal;
+ };
+ F93084370BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugMemCompile;
+ };
+ F93084380BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugMemCompile;
+ };
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugMemCompile;
+ };
+ F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-symbols=all";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugMemCompile;
+ };
+ F9359B250DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS)",
+ "-lgcov",
+ );
+ PREBINDING = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B260DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B270DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugGCov;
+ };
+ F9359B280DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugGCov;
+ };
+ F95CC8AC09158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Debug;
+ };
+ F95CC8AD09158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Release;
+ };
+ F95CC8AE09158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F95CC8B109158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Debug;
+ };
+ F95CC8B209158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Release;
+ };
+ F95CC8B309158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F95CC8B609158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = Debug;
+ };
+ F95CC8B709158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = Release;
+ };
+ F95CC8B809158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F97258A90A86873D00096C78 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Debug;
+ };
+ F97258AA0A86873D00096C78 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Release;
+ };
+ F97258AB0A86873D00096C78 /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal;
+ };
+ F97AED1B0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Debug64bit;
+ };
+ F97AED1C0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Debug64bit;
+ };
+ F97AED1D0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Debug64bit;
+ };
+ F97AED1E0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_64_BIT)";
+ CONFIGURE_ARGS = "--enable-64bit $(CONFIGURE_ARGS)";
+ CPPFLAGS = "-arch $(NATIVE_ARCH_64_BIT) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = Debug64bit;
+ };
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCF;
+ };
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCF;
+ };
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F9988AB10D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = 4.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB20D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB30D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB40D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB50D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC = "llvm-gcc";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB60D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB70D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB80D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = 4.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB50D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC = "llvm-gcc";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_OPTIMIZATION_LEVEL = 4;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB60D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB70D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE73C0BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugLeaks;
+ };
+ F99EE73D0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE73E0BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugLeaks;
+ };
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7400BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugLeaks;
+ };
+ F99EE7410BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7420BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = unsupported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ PURIFY,
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugLeaks;
+ };
+ F9EEED960C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED970C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ SDKROOT = macosx10.5;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8AC09158F3100EA5ACE /* Debug */,
+ F9988AB60D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB20D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D60F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8AE09158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE73B0BE835310060D4AF /* DebugUnthreaded */,
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084370BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE73C0BE835310060D4AF /* DebugLeaks */,
+ F9359B260DF212DA00E04F67 /* DebugGCov */,
+ F97AED1B0B660B2100310EA2 /* Debug64bit */,
+ F95CC8AD09158F3100EA5ACE /* Release */,
+ F91BCC4F093152310042A6BF /* ReleaseUniversal */,
+ F9988BB60D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED960C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F95CC8B009158F3100EA5ACE /* Build configuration list for PBXNativeTarget "tktest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8B109158F3100EA5ACE /* Debug */,
+ F9988AB70D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB30D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D70F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8B309158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE73D0BE835310060D4AF /* DebugUnthreaded */,
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084380BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE73E0BE835310060D4AF /* DebugLeaks */,
+ F9359B270DF212DA00E04F67 /* DebugGCov */,
+ F97AED1C0B660B2100310EA2 /* Debug64bit */,
+ F95CC8B209158F3100EA5ACE /* Release */,
+ F91BCC50093152310042A6BF /* ReleaseUniversal */,
+ F9988BB70D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED970C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Tk" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8B609158F3100EA5ACE /* Debug */,
+ F9988AB50D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB10D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D50F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8B809158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE7410BE835310060D4AF /* DebugUnthreaded */,
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F930843A0BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7420BE835310060D4AF /* DebugLeaks */,
+ F9359B250DF212DA00E04F67 /* DebugGCov */,
+ F97AED1E0B660B2100310EA2 /* Debug64bit */,
+ F95CC8B709158F3100EA5ACE /* Release */,
+ F91BCC51093152310042A6BF /* ReleaseUniversal */,
+ F9988BB50D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F97258A90A86873D00096C78 /* Debug */,
+ F9988AB80D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB40D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D80F3B5C8400810A10 /* DebugNoGC */,
+ F97258AB0A86873D00096C78 /* DebugNoFixAndContinue */,
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */,
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7400BE835310060D4AF /* DebugLeaks */,
+ F9359B280DF212DA00E04F67 /* DebugGCov */,
+ F97AED1D0B660B2100310EA2 /* Debug64bit */,
+ F97258AA0A86873D00096C78 /* Release */,
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */,
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/macosx/Tk.xcodeproj/default.pbxuser b/macosx/Tk.xcodeproj/default.pbxuser
new file mode 100644
index 0000000..30bcecb
--- /dev/null
+++ b/macosx/Tk.xcodeproj/default.pbxuser
@@ -0,0 +1,399 @@
+// !$*UTF8*$!
+{
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ activeBuildConfigurationName = Debug;
+ activeExecutable = F9E61D1C090A4282002B3151 /* Wish */;
+ activeTarget = F9E61D16090A3E94002B3151 /* Tk */;
+ codeSenseManager = F944EB9D08F798180049FDD4 /* Code sense */;
+ executables = (
+ F9E61D1C090A4282002B3151 /* Wish */,
+ F944EB8F08F798100049FDD4 /* tktest */,
+ F9FD31F50CC1AD070073837D /* tktest-X11 */,
+ );
+ perUserDictionary = {
+ com.apple.ide.smrt.PBXUserSmartGroupsKey.Rev10 = <040b73747265616d747970656481e8038401408484840e4e534d757461626c654172726179008484074e534172726179008484084e534f626a65637400858401690192848484134e534d757461626c6544696374696f6e6172790084840c4e5344696374696f6e6172790095960792848484084e53537472696e67019584012b046e616d658692849a9a14496d706c656d656e746174696f6e2046696c65738692849a9a195042585472616e7369656e744c6f636174696f6e4174546f708692849a9a06626f74746f6d8692849a9a0b707265666572656e63657386928497960892849a9a0669734c6561668692848484084e534e756d626572008484074e5356616c7565009584012a849696008692849a9a04726f6f748692849a9a093c50524f4a4543543e8692849a9a09726563757273697665869284a29da496018692849a9a05696d6167658692849a9a0b536d617274466f6c6465728692849a9a0763616e536176658692a892849a9a1250425850726f6a65637453636f70654b65798692849a9a035945538692849a9a0572656765788692849a9a065c2e286329248692849a9a07666e6d617463688692849a9a00868692849a9a146162736f6c75746550617468546f42756e646c658692849a9a008692849a9a0b6465736372697074696f6e8692849a9a103c6e6f206465736372697074696f6e3e8692849a9a08676c6f62616c49448692849a9a183143433045413430303433353045463930303434343130428692849a9a03636c7a8692849a9a1550425846696c656e616d65536d61727447726f7570868686>;
+ };
+ sourceControlManager = F944EB9C08F798180049FDD4 /* Source Control */;
+ userBuildSettings = {
+ SYMROOT = "${SRCROOT}/../../build/tk";
+ TCL_SRCROOT = "${SRCROOT}/../../tcl";
+ TK_SRCROOT = "${SRCROOT}/../../tk";
+ };
+ };
+ 8DD76FA90486AB0100D96B5E /* tktest */ = {
+ activeExec = 0;
+ executables = (
+ F944EB8F08F798100049FDD4 /* tktest */,
+ );
+ };
+ F944EB8F08F798100049FDD4 /* tktest */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ "${TK_SRCROOT}/tests/all.tcl",
+ "${TK_SRCROOT}/tests/ttk/all.tcl",
+ "-geometry +0+0",
+ "-singleproc 1",
+ "-verbose \"bet\"",
+ "-skip window-2.9",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ dataTipCustomDataFormattersEnabled = 1;
+ dataTipShowTypeColumn = 1;
+ dataTipSortType = 0;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = YES;
+ name = TCL_LIBRARY;
+ value = "${TCL_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TK_LIBRARY;
+ value = "${TK_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TCLLIBPATH;
+ value = /Library/Tcl;
+ },
+ {
+ active = YES;
+ name = TK_SRCROOT;
+ value = "${TK_SRCROOT}";
+ },
+ {
+ active = NO;
+ name = TK_CONSOLE;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ {
+ active = NO;
+ name = NSTraceEvents;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = MallocBadFreeAbort;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocLogFile;
+ value = /tmp/malloc.log;
+ },
+ {
+ active = NO;
+ name = MallocStackLogging;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocStackLoggingNoCompact;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocPreScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = NSZombieEnabled;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSDeallocateZombies;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSAutoreleaseFreedObjectCheckEnabled;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = NSEnableAutoreleasePool;
+ value = NO;
+ },
+ {
+ active = NO;
+ name = AUTO_LOG_ALL;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = AUTO_LOG_NOISY;
+ value = YES;
+ },
+ {
+ active = NO;
+ name = AUTO_REFERENCE_COUNT_LOGGING;
+ value = YES;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = tktest;
+ showTypeColumn = 0;
+ sourceDirectories = (
+ );
+ };
+ F944EB9C08F798180049FDD4 /* Source Control */ = {
+ isa = PBXSourceControlManager;
+ fallbackIsa = XCSourceControlManager;
+ isSCMEnabled = 0;
+ repositoryNamesForRoots = {
+ .. = "";
+ };
+ scmConfiguration = {
+ CVSToolPath = /usr/bin/cvs;
+ CVSUseSSH = NO;
+ SubversionToolPath = /usr/bin/svn;
+ repositoryNamesForRoots = {
+ .. = "";
+ };
+ };
+ scmType = scm.cvs;
+ };
+ F944EB9D08F798180049FDD4 /* Code sense */ = {
+ isa = PBXCodeSenseManager;
+ indexTemplatePath = "";
+ };
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
+ activeExec = 0;
+ executables = (
+ F9FD31F50CC1AD070073837D /* tktest-X11 */,
+ );
+ };
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ activeExec = 0;
+ executables = (
+ F9E61D1C090A4282002B3151 /* Wish */,
+ );
+ };
+ F9E61D1C090A4282002B3151 /* Wish */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ dataTipCustomDataFormattersEnabled = 1;
+ dataTipShowTypeColumn = 1;
+ dataTipSortType = 0;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = Wish;
+ showTypeColumn = 0;
+ sourceDirectories = (
+ );
+ };
+ F9FD31F50CC1AD070073837D /* tktest-X11 */ = {
+ isa = PBXExecutable;
+ activeArgIndices = (
+ YES,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ NO,
+ );
+ argumentStrings = (
+ "${TK_SRCROOT}/library/demos/widget",
+ "${TK_SRCROOT}/tests/all.tcl",
+ "${TK_SRCROOT}/tests/ttk/all.tcl",
+ "-geometry +0+0",
+ "-singleproc 1",
+ "-verbose \"bet\"",
+ "-skip window-2.9",
+ );
+ autoAttachOnCrash = 1;
+ breakpointsEnabled = 1;
+ configStateDict = {
+ "PBXLSLaunchAction-0" = {
+ PBXLSLaunchAction = 0;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXLSRunLaunchConfig;
+ displayName = "Executable Runner";
+ identifier = com.apple.Xcode.launch.runConfig;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ "PBXLSLaunchAction-1" = {
+ PBXLSLaunchAction = 1;
+ PBXLSLaunchStartAction = 1;
+ PBXLSLaunchStdioStyle = 2;
+ PBXLSLaunchStyle = 0;
+ class = PBXGDB_LaunchConfig;
+ displayName = GDB;
+ identifier = com.apple.Xcode.launch.GDBMI_Config;
+ remoteHostInfo = "";
+ startActionInfo = "";
+ };
+ };
+ customDataFormattersEnabled = 1;
+ dataTipCustomDataFormattersEnabled = 1;
+ dataTipShowTypeColumn = 1;
+ dataTipSortType = 0;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ dylibVariantSuffix = "";
+ enableDebugStr = 0;
+ environmentEntries = (
+ {
+ active = YES;
+ name = TCL_LIBRARY;
+ value = "${TCL_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TK_LIBRARY;
+ value = "${TK_SRCROOT}/library";
+ },
+ {
+ active = YES;
+ name = TCLLIBPATH;
+ value = /Library/Tcl;
+ },
+ {
+ active = YES;
+ name = DISPLAY;
+ value = ":0";
+ },
+ {
+ active = NO;
+ name = DYLD_PRINT_LIBRARIES;
+ },
+ {
+ active = NO;
+ name = MallocBadFreeAbort;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocLogFile;
+ value = /tmp/malloc.log;
+ },
+ {
+ active = NO;
+ name = MallocStackLogging;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocStackLoggingNoCompact;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocPreScribble;
+ value = 1;
+ },
+ {
+ active = NO;
+ name = MallocScribble;
+ value = 1;
+ },
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = "tktest-X11";
+ showTypeColumn = 0;
+ sourceDirectories = (
+ );
+ };
+}
diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..dcfe9fb
--- /dev/null
+++ b/macosx/Tk.xcodeproj/project.pbxproj
@@ -0,0 +1,5929 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; };
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; };
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+ F94523A20E6FC2AC00C1D987 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F94523A10E6FC2AC00C1D987 /* Cocoa.framework */; };
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96437C90EF0D4B2003F468E /* tclZlib.c */; };
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F96437E60EF0D652003F468E /* libz.dylib */; };
+ F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
+ F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
+ F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
+ F966BDD308F27A3F005CB29B /* tkBind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB008F27A39005CB29B /* tkBind.c */; };
+ F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB108F27A39005CB29B /* tkBitmap.c */; };
+ F966BDD508F27A3F005CB29B /* tkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB208F27A39005CB29B /* tkButton.c */; };
+ F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB408F27A39005CB29B /* tkCanvArc.c */; };
+ F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB508F27A39005CB29B /* tkCanvas.c */; };
+ F966BDDA08F27A3F005CB29B /* tkCanvBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB708F27A39005CB29B /* tkCanvBmap.c */; };
+ F966BDDB08F27A3F005CB29B /* tkCanvImg.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB808F27A39005CB29B /* tkCanvImg.c */; };
+ F966BDDC08F27A3F005CB29B /* tkCanvLine.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB908F27A39005CB29B /* tkCanvLine.c */; };
+ F966BDDD08F27A3F005CB29B /* tkCanvPoly.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABA08F27A39005CB29B /* tkCanvPoly.c */; };
+ F966BDDE08F27A3F005CB29B /* tkCanvPs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABB08F27A39005CB29B /* tkCanvPs.c */; };
+ F966BDE008F27A3F005CB29B /* tkCanvText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABD08F27A39005CB29B /* tkCanvText.c */; };
+ F966BDE108F27A3F005CB29B /* tkCanvUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABE08F27A39005CB29B /* tkCanvUtil.c */; };
+ F966BDE208F27A3F005CB29B /* tkCanvWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABF08F27A39005CB29B /* tkCanvWind.c */; };
+ F966BDE308F27A3F005CB29B /* tkClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC008F27A39005CB29B /* tkClipboard.c */; };
+ F966BDE408F27A3F005CB29B /* tkCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC108F27A39005CB29B /* tkCmds.c */; };
+ F966BDE508F27A3F005CB29B /* tkColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC208F27A39005CB29B /* tkColor.c */; };
+ F966BDE708F27A3F005CB29B /* tkConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC408F27A39005CB29B /* tkConfig.c */; };
+ F966BDE808F27A3F005CB29B /* tkConsole.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC508F27A39005CB29B /* tkConsole.c */; };
+ F966BDE908F27A3F005CB29B /* tkCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC608F27A39005CB29B /* tkCursor.c */; };
+ F966BDEB08F27A3F005CB29B /* tkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC808F27A39005CB29B /* tkEntry.c */; };
+ F966BDED08F27A3F005CB29B /* tkError.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACA08F27A39005CB29B /* tkError.c */; };
+ F966BDEE08F27A3F005CB29B /* tkEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACB08F27A39005CB29B /* tkEvent.c */; };
+ F966BDEF08F27A3F005CB29B /* tkFileFilter.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACC08F27A39005CB29B /* tkFileFilter.c */; };
+ F966BDF108F27A3F005CB29B /* tkFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACE08F27A39005CB29B /* tkFocus.c */; };
+ F966BDF208F27A3F005CB29B /* tkFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACF08F27A39005CB29B /* tkFont.c */; };
+ F966BDF408F27A3F005CB29B /* tkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD108F27A39005CB29B /* tkFrame.c */; };
+ F966BDF508F27A3F005CB29B /* tkGC.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD208F27A39005CB29B /* tkGC.c */; };
+ F966BDF608F27A3F005CB29B /* tkGeometry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD308F27A39005CB29B /* tkGeometry.c */; };
+ F966BDF708F27A3F005CB29B /* tkGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD408F27A39005CB29B /* tkGet.c */; };
+ F966BDF808F27A3F005CB29B /* tkGrab.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD508F27A39005CB29B /* tkGrab.c */; };
+ F966BDF908F27A3F005CB29B /* tkGrid.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD608F27A39005CB29B /* tkGrid.c */; };
+ F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD708F27A39005CB29B /* tkImage.c */; };
+ F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD808F27A39005CB29B /* tkImgBmap.c */; };
+ F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD908F27A39005CB29B /* tkImgGIF.c */; };
+ F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADA08F27A39005CB29B /* tkImgPhoto.c */; };
+ F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADB08F27A39005CB29B /* tkImgPPM.c */; };
+ F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE408F27A39005CB29B /* tkListbox.c */; };
+ F966BE0808F27A3F005CB29B /* tkMacWinMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE508F27A39005CB29B /* tkMacWinMenu.c */; };
+ F966BE0908F27A3F005CB29B /* tkMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE608F27A39005CB29B /* tkMain.c */; };
+ F966BE0A08F27A3F005CB29B /* tkMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE708F27A39005CB29B /* tkMenu.c */; };
+ F966BE0C08F27A3F005CB29B /* tkMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE908F27A39005CB29B /* tkMenubutton.c */; };
+ F966BE0E08F27A3F005CB29B /* tkMenuDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEB08F27A39005CB29B /* tkMenuDraw.c */; };
+ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; };
+ F966BE1008F27A3F005CB29B /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; };
+ F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; };
+ F966BE1208F27A3F005CB29B /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; };
+ F966BE1308F27A3F005CB29B /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; };
+ F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; };
+ F966BE1508F27A3F005CB29B /* tkPlace.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF208F27A39005CB29B /* tkPlace.c */; };
+ F966BE1708F27A3F005CB29B /* tkPointer.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF408F27A39005CB29B /* tkPointer.c */; };
+ F966BE1908F27A3F005CB29B /* tkRectOval.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF608F27A39005CB29B /* tkRectOval.c */; };
+ F966BE1A08F27A3F005CB29B /* tkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF708F27A39005CB29B /* tkScale.c */; };
+ F966BE1C08F27A40005CB29B /* tkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF908F27A39005CB29B /* tkScrollbar.c */; };
+ F966BE1E08F27A40005CB29B /* tkSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFB08F27A39005CB29B /* tkSelect.c */; };
+ F966BE2008F27A40005CB29B /* tkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFD08F27A39005CB29B /* tkSquare.c */; };
+ F966BE2208F27A40005CB29B /* tkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFF08F27A39005CB29B /* tkStubInit.c */; };
+ F966BE2308F27A40005CB29B /* tkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0008F27A39005CB29B /* tkStubLib.c */; };
+ F966BE2408F27A40005CB29B /* tkStyle.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0108F27A39005CB29B /* tkStyle.c */; };
+ F966BE2508F27A40005CB29B /* tkTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0208F27A39005CB29B /* tkTest.c */; };
+ F966BE2608F27A40005CB29B /* tkText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0308F27A39005CB29B /* tkText.c */; };
+ F966BE2808F27A40005CB29B /* tkTextBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0508F27A39005CB29B /* tkTextBTree.c */; };
+ F966BE2908F27A40005CB29B /* tkTextDisp.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0608F27A39005CB29B /* tkTextDisp.c */; };
+ F966BE2B08F27A40005CB29B /* tkTextImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0808F27A39005CB29B /* tkTextImage.c */; };
+ F966BE2C08F27A40005CB29B /* tkTextIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0908F27A39005CB29B /* tkTextIndex.c */; };
+ F966BE2D08F27A40005CB29B /* tkTextMark.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0A08F27A39005CB29B /* tkTextMark.c */; };
+ F966BE2E08F27A40005CB29B /* tkTextTag.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0B08F27A39005CB29B /* tkTextTag.c */; };
+ F966BE2F08F27A40005CB29B /* tkTextWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0C08F27A39005CB29B /* tkTextWind.c */; };
+ F966BE3008F27A40005CB29B /* tkTrig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0D08F27A39005CB29B /* tkTrig.c */; };
+ F966BE3108F27A40005CB29B /* tkUndo.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0E08F27A39005CB29B /* tkUndo.c */; };
+ F966BE3308F27A40005CB29B /* tkUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1008F27A39005CB29B /* tkUtil.c */; };
+ F966BE3408F27A40005CB29B /* tkVisual.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1108F27A39005CB29B /* tkVisual.c */; };
+ F966BE3508F27A40005CB29B /* tkWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1208F27A39005CB29B /* tkWindow.c */; };
+ F966BEDB08F27A40005CB29B /* tkMacOSXBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */; };
+ F966BEDC08F27A40005CB29B /* tkMacOSXButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */; };
+ F966BEDE08F27A40005CB29B /* tkMacOSXClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */; };
+ F966BEDF08F27A40005CB29B /* tkMacOSXColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */; };
+ F966BEE008F27A40005CB29B /* tkMacOSXConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */; };
+ F966BEE108F27A40005CB29B /* tkMacOSXCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */; };
+ F966BEE308F27A40005CB29B /* tkMacOSXDebug.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */; };
+ F966BEE608F27A40005CB29B /* tkMacOSXDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */; };
+ F966BEE708F27A40005CB29B /* tkMacOSXDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */; };
+ F966BEE808F27A40005CB29B /* tkMacOSXEmbed.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */; };
+ F966BEE908F27A40005CB29B /* tkMacOSXEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */; };
+ F966BEEA08F27A40005CB29B /* tkMacOSXEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */; };
+ F966BEEC08F27A40005CB29B /* tkMacOSXFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */; };
+ F966BEED08F27A40005CB29B /* tkMacOSXHLEvents.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */; };
+ F966BEEE08F27A40005CB29B /* tkMacOSXInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */; settings = {COMPILER_FLAGS = "-DTK_LIBRARY=\\\"$(TK_LIBRARY)\\\""; }; };
+ F966BEF108F27A40005CB29B /* tkMacOSXKeyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */; };
+ F966BEF208F27A40005CB29B /* tkMacOSXKeyEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */; };
+ F966BEF308F27A40005CB29B /* tkMacOSXMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */; };
+ F966BEF608F27A40005CB29B /* tkMacOSXMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */; };
+ F966BEF708F27A40005CB29B /* tkMacOSXMenus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */; };
+ F966BEF808F27A40005CB29B /* tkMacOSXMouseEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */; };
+ F966BEF908F27A40005CB29B /* tkMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */; };
+ F966BF0108F27A40005CB29B /* tkMacOSXRegion.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */; };
+ F966BF0308F27A40005CB29B /* tkMacOSXScrlbr.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */; };
+ F966BF0408F27A40005CB29B /* tkMacOSXSend.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */; };
+ F966BF0508F27A40005CB29B /* tkMacOSXSubwindows.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */; };
+ F966BF0608F27A40005CB29B /* tkMacOSXTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */; };
+ F966BF0708F27A40005CB29B /* tkMacOSXWindowEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */; };
+ F966BF0808F27A40005CB29B /* tkMacOSXWm.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */; };
+ F966BF0B08F27A40005CB29B /* tkMacOSXXStubs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */; };
+ F966BF7F08F27A41005CB29B /* tkAppInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7508F27A3D005CB29B /* tkAppInit.c */; settings = {COMPILER_FLAGS = "-DTK_TEST"; }; };
+ F966BF8308F27A41005CB29B /* tkUnix3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7908F27A3D005CB29B /* tkUnix3d.c */; };
+ F966BF9608F27A41005CB29B /* tkUnixScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8C08F27A3D005CB29B /* tkUnixScale.c */; };
+ F966C02A08F27A42005CB29B /* xcolors.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2408F27A3F005CB29B /* xcolors.c */; };
+ F966C02B08F27A42005CB29B /* xdraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2508F27A3F005CB29B /* xdraw.c */; };
+ F966C02C08F27A42005CB29B /* xgc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2608F27A3F005CB29B /* xgc.c */; };
+ F966C02D08F27A42005CB29B /* ximage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2708F27A3F005CB29B /* ximage.c */; };
+ F966C02E08F27A42005CB29B /* xutil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BD2808F27A3F005CB29B /* xutil.c */; };
+ F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07408F2820D005CB29B /* CoreFoundation.framework */; };
+ F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07608F2821B005CB29B /* Carbon.framework */; };
+ F966C07908F28233005CB29B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07808F28233005CB29B /* IOKit.framework */; };
+ F96888050AF786D5000797B5 /* ttkBlink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E10AF786D5000797B5 /* ttkBlink.c */; };
+ F96888060AF786D5000797B5 /* ttkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E20AF786D5000797B5 /* ttkButton.c */; };
+ F96888070AF786D5000797B5 /* ttkCache.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E30AF786D5000797B5 /* ttkCache.c */; };
+ F96888080AF786D5000797B5 /* ttkClamTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E40AF786D5000797B5 /* ttkClamTheme.c */; };
+ F96888090AF786D5000797B5 /* ttkClassicTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E50AF786D5000797B5 /* ttkClassicTheme.c */; };
+ F968880A0AF786D5000797B5 /* ttkDefaultTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */; };
+ F968880B0AF786D5000797B5 /* ttkElements.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E80AF786D5000797B5 /* ttkElements.c */; };
+ F968880C0AF786D5000797B5 /* ttkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E90AF786D5000797B5 /* ttkEntry.c */; };
+ F968880D0AF786D5000797B5 /* ttkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EA0AF786D5000797B5 /* ttkFrame.c */; };
+ F968880E0AF786D5000797B5 /* ttkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EB0AF786D5000797B5 /* ttkImage.c */; };
+ F968880F0AF786D5000797B5 /* ttkInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EC0AF786D5000797B5 /* ttkInit.c */; };
+ F96888100AF786D5000797B5 /* ttkLabel.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887ED0AF786D5000797B5 /* ttkLabel.c */; };
+ F96888110AF786D5000797B5 /* ttkLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EE0AF786D5000797B5 /* ttkLayout.c */; };
+ F96888120AF786D5000797B5 /* ttkManager.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EF0AF786D5000797B5 /* ttkManager.c */; };
+ F96888130AF786D5000797B5 /* ttkNotebook.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F10AF786D5000797B5 /* ttkNotebook.c */; };
+ F96888140AF786D5000797B5 /* ttkPanedwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F20AF786D5000797B5 /* ttkPanedwindow.c */; };
+ F96888150AF786D5000797B5 /* ttkProgress.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F30AF786D5000797B5 /* ttkProgress.c */; };
+ F96888160AF786D5000797B5 /* ttkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F40AF786D5000797B5 /* ttkScale.c */; };
+ F96888170AF786D5000797B5 /* ttkScroll.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F50AF786D5000797B5 /* ttkScroll.c */; };
+ F96888180AF786D5000797B5 /* ttkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F60AF786D5000797B5 /* ttkScrollbar.c */; };
+ F96888190AF786D5000797B5 /* ttkSeparator.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F70AF786D5000797B5 /* ttkSeparator.c */; };
+ F968881A0AF786D5000797B5 /* ttkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F80AF786D5000797B5 /* ttkSquare.c */; };
+ F968881B0AF786D5000797B5 /* ttkState.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F90AF786D5000797B5 /* ttkState.c */; };
+ F968881C0AF786D5000797B5 /* ttkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FA0AF786D5000797B5 /* ttkStubInit.c */; };
+ F968881D0AF786D5000797B5 /* ttkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FB0AF786D5000797B5 /* ttkStubLib.c */; };
+ F968881E0AF786D5000797B5 /* ttkTagSet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FC0AF786D5000797B5 /* ttkTagSet.c */; };
+ F968881F0AF786D5000797B5 /* ttkTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FD0AF786D5000797B5 /* ttkTheme.c */; };
+ F96888200AF786D5000797B5 /* ttkTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888000AF786D5000797B5 /* ttkTrace.c */; };
+ F96888210AF786D5000797B5 /* ttkTrack.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888010AF786D5000797B5 /* ttkTrack.c */; };
+ F96888220AF786D5000797B5 /* ttkTreeview.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888020AF786D5000797B5 /* ttkTreeview.c */; };
+ F96888230AF786D5000797B5 /* ttkWidget.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888030AF786D5000797B5 /* ttkWidget.c */; };
+ F96888850AF78938000797B5 /* ttkMacOSXTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888840AF78938000797B5 /* ttkMacOSXTheme.c */; };
+ F96D456F08F272BB004A47F5 /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED008F272A7004A47F5 /* regcomp.c */; };
+ F96D457208F272BB004A47F5 /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED308F272A7004A47F5 /* regerror.c */; };
+ F96D457508F272BB004A47F5 /* regexec.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED608F272A7004A47F5 /* regexec.c */; };
+ F96D457608F272BB004A47F5 /* regfree.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED708F272A7004A47F5 /* regfree.c */; };
+ F96D457B08F272BB004A47F5 /* tclAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDC08F272A7004A47F5 /* tclAlloc.c */; settings = {COMPILER_FLAGS = "-DUSE_TCLALLOC=0"; }; };
+ F96D457C08F272BB004A47F5 /* tclAsync.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDD08F272A7004A47F5 /* tclAsync.c */; };
+ F96D457D08F272BB004A47F5 /* tclBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDE08F272A7004A47F5 /* tclBasic.c */; };
+ F96D457E08F272BC004A47F5 /* tclBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDF08F272A7004A47F5 /* tclBinary.c */; };
+ F96D457F08F272BC004A47F5 /* tclCkalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE008F272A7004A47F5 /* tclCkalloc.c */; };
+ F96D458008F272BC004A47F5 /* tclClock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE108F272A7004A47F5 /* tclClock.c */; };
+ F96D458108F272BC004A47F5 /* tclCmdAH.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE208F272A7004A47F5 /* tclCmdAH.c */; };
+ F96D458208F272BC004A47F5 /* tclCmdIL.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE308F272A7004A47F5 /* tclCmdIL.c */; };
+ F96D458308F272BC004A47F5 /* tclCmdMZ.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */; };
+ F96D458408F272BC004A47F5 /* tclCompCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE508F272A7004A47F5 /* tclCompCmds.c */; };
+ F96D458508F272BC004A47F5 /* tclCompExpr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE608F272A7004A47F5 /* tclCompExpr.c */; };
+ F96D458608F272BC004A47F5 /* tclCompile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE708F272A7004A47F5 /* tclCompile.c */; };
+ F96D458808F272BC004A47F5 /* tclConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE908F272A7004A47F5 /* tclConfig.c */; };
+ F96D458908F272BC004A47F5 /* tclDate.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEA08F272A7004A47F5 /* tclDate.c */; };
+ F96D458B08F272BC004A47F5 /* tclDictObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEC08F272A7004A47F5 /* tclDictObj.c */; };
+ F96D458C08F272BC004A47F5 /* tclEncoding.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EED08F272A7004A47F5 /* tclEncoding.c */; };
+ F96D458D08F272BC004A47F5 /* tclEnv.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEE08F272A7004A47F5 /* tclEnv.c */; };
+ F96D458E08F272BC004A47F5 /* tclEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEF08F272A7004A47F5 /* tclEvent.c */; };
+ F96D458F08F272BC004A47F5 /* tclExecute.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF008F272A7004A47F5 /* tclExecute.c */; };
+ F96D459008F272BC004A47F5 /* tclFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF108F272A7004A47F5 /* tclFCmd.c */; };
+ F96D459108F272BC004A47F5 /* tclFileName.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF208F272A7004A47F5 /* tclFileName.c */; };
+ F96D459308F272BC004A47F5 /* tclGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF408F272A7004A47F5 /* tclGet.c */; };
+ F96D459508F272BC004A47F5 /* tclHash.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF608F272A7004A47F5 /* tclHash.c */; };
+ F96D459608F272BC004A47F5 /* tclHistory.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF708F272A7004A47F5 /* tclHistory.c */; };
+ F96D459708F272BC004A47F5 /* tclIndexObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF808F272A7004A47F5 /* tclIndexObj.c */; };
+ F96D459B08F272BC004A47F5 /* tclInterp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFC08F272A7004A47F5 /* tclInterp.c */; };
+ F96D459D08F272BC004A47F5 /* tclIO.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFE08F272A7004A47F5 /* tclIO.c */; };
+ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0008F272A7004A47F5 /* tclIOCmd.c */; };
+ F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0108F272A7004A47F5 /* tclIOGT.c */; };
+ F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0208F272A7004A47F5 /* tclIORChan.c */; };
+ F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0308F272A7004A47F5 /* tclIOSock.c */; };
+ F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0408F272A7004A47F5 /* tclIOUtil.c */; };
+ F96D45A408F272BC004A47F5 /* tclLink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0508F272A7004A47F5 /* tclLink.c */; };
+ F96D45A508F272BC004A47F5 /* tclListObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0608F272A7004A47F5 /* tclListObj.c */; };
+ F96D45A608F272BC004A47F5 /* tclLiteral.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0708F272A7004A47F5 /* tclLiteral.c */; };
+ F96D45A708F272BC004A47F5 /* tclLoad.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0808F272A7004A47F5 /* tclLoad.c */; };
+ F96D45A908F272BC004A47F5 /* tclMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0A08F272A7004A47F5 /* tclMain.c */; };
+ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0B08F272A7004A47F5 /* tclNamesp.c */; };
+ F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0C08F272A7004A47F5 /* tclNotify.c */; };
+ F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0D08F272A7004A47F5 /* tclObj.c */; };
+ F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0E08F272A7004A47F5 /* tclPanic.c */; };
+ F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0F08F272A7004A47F5 /* tclParse.c */; };
+ F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1108F272A7004A47F5 /* tclPathObj.c */; };
+ F96D45B108F272BC004A47F5 /* tclPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1208F272A7004A47F5 /* tclPipe.c */; };
+ F96D45B208F272BC004A47F5 /* tclPkg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1308F272A7004A47F5 /* tclPkg.c */; };
+ F96D45B308F272BC004A47F5 /* tclPkgConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */; settings = {COMPILER_FLAGS = "-DCFG_INSTALL_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_INSTALL_BINDIR=\\\"$(BINDIR)\\\" -DCFG_INSTALL_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_INSTALL_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_INSTALL_DOCDIR=\\\"$(MANDIR)\\\" -DCFG_RUNTIME_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_RUNTIME_BINDIR=\\\"$(BINDIR)\\\" -DCFG_RUNTIME_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_RUNTIME_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_RUNTIME_DOCDIR=\\\"$(MANDIR)\\\""; }; };
+ F96D45B608F272BC004A47F5 /* tclPosixStr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1708F272A7004A47F5 /* tclPosixStr.c */; };
+ F96D45B708F272BC004A47F5 /* tclPreserve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1808F272A7004A47F5 /* tclPreserve.c */; };
+ F96D45B808F272BC004A47F5 /* tclProc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1908F272A7004A47F5 /* tclProc.c */; };
+ F96D45B908F272BC004A47F5 /* tclRegexp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1A08F272A7004A47F5 /* tclRegexp.c */; };
+ F96D45BB08F272BC004A47F5 /* tclResolve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1C08F272A7004A47F5 /* tclResolve.c */; };
+ F96D45BC08F272BC004A47F5 /* tclResult.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1D08F272A7004A47F5 /* tclResult.c */; };
+ F96D45BD08F272BC004A47F5 /* tclScan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1E08F272A7004A47F5 /* tclScan.c */; };
+ F96D45BE08F272BC004A47F5 /* tclStringObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1F08F272A7004A47F5 /* tclStringObj.c */; };
+ F96D45C308F272BC004A47F5 /* tclStrToD.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2408F272A7004A47F5 /* tclStrToD.c */; };
+ F96D45C408F272BC004A47F5 /* tclStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2508F272A7004A47F5 /* tclStubInit.c */; };
+ F96D45C508F272BC004A47F5 /* tclStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2608F272A7004A47F5 /* tclStubLib.c */; };
+ F96D45C908F272BC004A47F5 /* tclThread.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2A08F272A7004A47F5 /* tclThread.c */; };
+ F96D45CA08F272BC004A47F5 /* tclThreadAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */; };
+ F96D45CB08F272BC004A47F5 /* tclThreadJoin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */; };
+ F96D45CC08F272BC004A47F5 /* tclThreadStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */; };
+ F96D45CE08F272BC004A47F5 /* tclTimer.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2F08F272A7004A47F5 /* tclTimer.c */; };
+ F96D45D008F272BC004A47F5 /* tclTomMathInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */; };
+ F96D45D108F272BC004A47F5 /* tclTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3208F272A7004A47F5 /* tclTrace.c */; };
+ F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3408F272A7004A47F5 /* tclUtf.c */; };
+ F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3508F272A7004A47F5 /* tclUtil.c */; };
+ F96D45D508F272BC004A47F5 /* tclVar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3608F272A7004A47F5 /* tclVar.c */; };
+ F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */; };
+ F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */; };
+ F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426908F272B3004A47F5 /* bn_mp_add.c */; };
+ F96D48E808F272C3004A47F5 /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */; };
+ F96D48EB08F272C3004A47F5 /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */; };
+ F96D48EC08F272C3004A47F5 /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426E08F272B3004A47F5 /* bn_mp_clear.c */; };
+ F96D48ED08F272C3004A47F5 /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */; };
+ F96D48EE08F272C3004A47F5 /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427008F272B3004A47F5 /* bn_mp_cmp.c */; };
+ F96D48F008F272C3004A47F5 /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */; };
+ F96D48F208F272C3004A47F5 /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427408F272B3004A47F5 /* bn_mp_copy.c */; };
+ F96D48F308F272C3004A47F5 /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */; };
+ F96D48F408F272C3004A47F5 /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427608F272B3004A47F5 /* bn_mp_div.c */; };
+ F96D48F508F272C3004A47F5 /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427708F272B3004A47F5 /* bn_mp_div_2.c */; };
+ F96D48F608F272C3004A47F5 /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */; };
+ F96D48F708F272C3004A47F5 /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427908F272B3004A47F5 /* bn_mp_div_3.c */; };
+ F96D48F808F272C3004A47F5 /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */; };
+ F96D48FC08F272C3004A47F5 /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427E08F272B3004A47F5 /* bn_mp_exch.c */; };
+ F96D490508F272C3004A47F5 /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428708F272B3004A47F5 /* bn_mp_grow.c */; };
+ F96D490608F272C3004A47F5 /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428808F272B3004A47F5 /* bn_mp_init.c */; };
+ F96D490708F272C3004A47F5 /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */; };
+ F96D490808F272C3004A47F5 /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */; };
+ F96D490908F272C3004A47F5 /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */; };
+ F96D490B08F272C3004A47F5 /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */; };
+ F96D491008F272C3004A47F5 /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */; };
+ F96D491108F272C3004A47F5 /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */; };
+ F96D491308F272C3004A47F5 /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429508F272B3004A47F5 /* bn_mp_lshd.c */; };
+ F96D491408F272C3004A47F5 /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429608F272B3004A47F5 /* bn_mp_mod.c */; };
+ F96D491508F272C3004A47F5 /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */; };
+ F96D491A08F272C3004A47F5 /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429C08F272B3004A47F5 /* bn_mp_mul.c */; };
+ F96D491B08F272C3004A47F5 /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */; };
+ F96D491C08F272C3004A47F5 /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */; };
+ F96D491D08F272C3004A47F5 /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */; };
+ F96D492908F272C3004A47F5 /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */; };
+ F96D492A08F272C3004A47F5 /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */; };
+ F96D492C08F272C3004A47F5 /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */; };
+ F96D493708F272C3004A47F5 /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */; };
+ F96D493808F272C3004A47F5 /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BA08F272B3004A47F5 /* bn_mp_set.c */; };
+ F96D493C08F272C3004A47F5 /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */; };
+ F96D493F08F272C3004A47F5 /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C108F272B3004A47F5 /* bn_mp_sub.c */; };
+ F96D494008F272C3004A47F5 /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */; };
+ F96D494608F272C3004A47F5 /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */; };
+ F96D494708F272C3004A47F5 /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */; };
+ F96D494908F272C3004A47F5 /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */; };
+ F96D494C08F272C3004A47F5 /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */; };
+ F96D494E08F272C3004A47F5 /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D008F272B3004A47F5 /* bn_reverse.c */; };
+ F96D494F08F272C3004A47F5 /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */; };
+ F96D495108F272C3004A47F5 /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */; };
+ F96D495308F272C3004A47F5 /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */; };
+ F96D495408F272C3004A47F5 /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */; };
+ F96D495508F272C3004A47F5 /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D708F272B3004A47F5 /* bncore.c */; };
+ F96D49A908F272C4004A47F5 /* tclMacOSXBundle.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */; };
+ F96D49AD08F272C4004A47F5 /* tclMacOSXFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */; };
+ F96D49AE08F272C4004A47F5 /* tclMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */; };
+ F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445B08F272B9004A47F5 /* tclLoadDyld.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445F08F272B9004A47F5 /* tclUnixChan.c */; };
+ F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446008F272B9004A47F5 /* tclUnixEvent.c */; };
+ F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446108F272B9004A47F5 /* tclUnixFCmd.c */; };
+ F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446208F272B9004A47F5 /* tclUnixFile.c */; };
+ F96D4ACE08F272C9004A47F5 /* tclUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446308F272B9004A47F5 /* tclUnixInit.c */; settings = {COMPILER_FLAGS = "-DTCL_LIBRARY=\\\"$(TCL_LIBRARY)\\\" -DTCL_PACKAGE_PATH=\\\"$(TCL_PACKAGE_PATH)\\\""; }; };
+ F96D4ACF08F272C9004A47F5 /* tclUnixNotfy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446408F272B9004A47F5 /* tclUnixNotfy.c */; };
+ F96D4AD008F272C9004A47F5 /* tclUnixPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446508F272B9004A47F5 /* tclUnixPipe.c */; };
+ F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446708F272B9004A47F5 /* tclUnixSock.c */; };
+ F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446908F272B9004A47F5 /* tclUnixThrd.c */; };
+ F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446B08F272B9004A47F5 /* tclUnixTime.c */; };
+ F9C9CC000E84059800E00935 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */; };
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */ = {isa = PBXBuildFile; fileRef = F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */; };
+ F9E61D28090A481F002B3151 /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */; };
+ F9E61D29090A486C002B3151 /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A208F272B3004A47F5 /* bn_mp_neg.c */; };
+ F9E61D2A090A4891002B3151 /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */; };
+ F9E61D2B090A48A4002B3151 /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426C08F272B3004A47F5 /* bn_mp_and.c */; };
+ F9E61D2C090A48AC002B3151 /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */; };
+ F9E61D2D090A48BB002B3151 /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */; };
+ F9E61D2E090A48BF002B3151 /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A308F272B3004A47F5 /* bn_mp_or.c */; };
+ F9E61D2F090A48C7002B3151 /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */; };
+ F9E61D30090A48E2002B3151 /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */; };
+ F9E61D31090A48F9002B3151 /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */; };
+ F9E61D32090A48FA002B3151 /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */; };
+ F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */ = {isa = PBXBuildFile; fileRef = F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */; };
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; };
+ F9FD30BC0CC1AD070073837D /* regcomp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED008F272A7004A47F5 /* regcomp.c */; };
+ F9FD30BD0CC1AD070073837D /* regerror.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED308F272A7004A47F5 /* regerror.c */; };
+ F9FD30BE0CC1AD070073837D /* regexec.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED608F272A7004A47F5 /* regexec.c */; };
+ F9FD30BF0CC1AD070073837D /* regfree.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3ED708F272A7004A47F5 /* regfree.c */; };
+ F9FD30C00CC1AD070073837D /* tclAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDC08F272A7004A47F5 /* tclAlloc.c */; settings = {COMPILER_FLAGS = "-DUSE_TCLALLOC=0"; }; };
+ F9FD30C10CC1AD070073837D /* tclAsync.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDD08F272A7004A47F5 /* tclAsync.c */; };
+ F9FD30C20CC1AD070073837D /* tclBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDE08F272A7004A47F5 /* tclBasic.c */; };
+ F9FD30C30CC1AD070073837D /* tclBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EDF08F272A7004A47F5 /* tclBinary.c */; };
+ F9FD30C40CC1AD070073837D /* tclCkalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE008F272A7004A47F5 /* tclCkalloc.c */; };
+ F9FD30C50CC1AD070073837D /* tclClock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE108F272A7004A47F5 /* tclClock.c */; };
+ F9FD30C60CC1AD070073837D /* tclCmdAH.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE208F272A7004A47F5 /* tclCmdAH.c */; };
+ F9FD30C70CC1AD070073837D /* tclCmdIL.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE308F272A7004A47F5 /* tclCmdIL.c */; };
+ F9FD30C80CC1AD070073837D /* tclCmdMZ.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */; };
+ F9FD30C90CC1AD070073837D /* tclCompCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE508F272A7004A47F5 /* tclCompCmds.c */; };
+ F9FD30CA0CC1AD070073837D /* tclCompExpr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE608F272A7004A47F5 /* tclCompExpr.c */; };
+ F9FD30CB0CC1AD070073837D /* tclCompile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE708F272A7004A47F5 /* tclCompile.c */; };
+ F9FD30CC0CC1AD070073837D /* tclConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EE908F272A7004A47F5 /* tclConfig.c */; };
+ F9FD30CD0CC1AD070073837D /* tclDate.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEA08F272A7004A47F5 /* tclDate.c */; };
+ F9FD30CE0CC1AD070073837D /* tclDictObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEC08F272A7004A47F5 /* tclDictObj.c */; };
+ F9FD30CF0CC1AD070073837D /* tclEncoding.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EED08F272A7004A47F5 /* tclEncoding.c */; };
+ F9FD30D00CC1AD070073837D /* tclEnv.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEE08F272A7004A47F5 /* tclEnv.c */; };
+ F9FD30D10CC1AD070073837D /* tclEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EEF08F272A7004A47F5 /* tclEvent.c */; };
+ F9FD30D20CC1AD070073837D /* tclExecute.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF008F272A7004A47F5 /* tclExecute.c */; };
+ F9FD30D30CC1AD070073837D /* tclFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF108F272A7004A47F5 /* tclFCmd.c */; };
+ F9FD30D40CC1AD070073837D /* tclFileName.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF208F272A7004A47F5 /* tclFileName.c */; };
+ F9FD30D50CC1AD070073837D /* tclGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF408F272A7004A47F5 /* tclGet.c */; };
+ F9FD30D60CC1AD070073837D /* tclHash.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF608F272A7004A47F5 /* tclHash.c */; };
+ F9FD30D70CC1AD070073837D /* tclHistory.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF708F272A7004A47F5 /* tclHistory.c */; };
+ F9FD30D80CC1AD070073837D /* tclIndexObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EF808F272A7004A47F5 /* tclIndexObj.c */; };
+ F9FD30D90CC1AD070073837D /* tclInterp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFC08F272A7004A47F5 /* tclInterp.c */; };
+ F9FD30DA0CC1AD070073837D /* tclIO.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3EFE08F272A7004A47F5 /* tclIO.c */; };
+ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0008F272A7004A47F5 /* tclIOCmd.c */; };
+ F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0108F272A7004A47F5 /* tclIOGT.c */; };
+ F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0208F272A7004A47F5 /* tclIORChan.c */; };
+ F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0308F272A7004A47F5 /* tclIOSock.c */; };
+ F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0408F272A7004A47F5 /* tclIOUtil.c */; };
+ F9FD30E00CC1AD070073837D /* tclLink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0508F272A7004A47F5 /* tclLink.c */; };
+ F9FD30E10CC1AD070073837D /* tclListObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0608F272A7004A47F5 /* tclListObj.c */; };
+ F9FD30E20CC1AD070073837D /* tclLiteral.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0708F272A7004A47F5 /* tclLiteral.c */; };
+ F9FD30E30CC1AD070073837D /* tclLoad.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0808F272A7004A47F5 /* tclLoad.c */; };
+ F9FD30E40CC1AD070073837D /* tclMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0A08F272A7004A47F5 /* tclMain.c */; };
+ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0B08F272A7004A47F5 /* tclNamesp.c */; };
+ F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0C08F272A7004A47F5 /* tclNotify.c */; };
+ F9FD30E70CC1AD070073837D /* tclObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0D08F272A7004A47F5 /* tclObj.c */; };
+ F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0E08F272A7004A47F5 /* tclPanic.c */; };
+ F9FD30E90CC1AD070073837D /* tclParse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F0F08F272A7004A47F5 /* tclParse.c */; };
+ F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1108F272A7004A47F5 /* tclPathObj.c */; };
+ F9FD30EB0CC1AD070073837D /* tclPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1208F272A7004A47F5 /* tclPipe.c */; };
+ F9FD30EC0CC1AD070073837D /* tclPkg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1308F272A7004A47F5 /* tclPkg.c */; };
+ F9FD30ED0CC1AD070073837D /* tclPkgConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */; settings = {COMPILER_FLAGS = "-DCFG_INSTALL_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_INSTALL_BINDIR=\\\"$(BINDIR)\\\" -DCFG_INSTALL_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_INSTALL_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_INSTALL_DOCDIR=\\\"$(MANDIR)\\\" -DCFG_RUNTIME_LIBDIR=\\\"$(LIBDIR)\\\" -DCFG_RUNTIME_BINDIR=\\\"$(BINDIR)\\\" -DCFG_RUNTIME_SCRDIR=\\\"$(TCL_LIBRARY)\\\" -DCFG_RUNTIME_INCDIR=\\\"$(INCLUDEDIR)\\\" -DCFG_RUNTIME_DOCDIR=\\\"$(MANDIR)\\\""; }; };
+ F9FD30EE0CC1AD070073837D /* tclPosixStr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1708F272A7004A47F5 /* tclPosixStr.c */; };
+ F9FD30EF0CC1AD070073837D /* tclPreserve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1808F272A7004A47F5 /* tclPreserve.c */; };
+ F9FD30F00CC1AD070073837D /* tclProc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1908F272A7004A47F5 /* tclProc.c */; };
+ F9FD30F10CC1AD070073837D /* tclRegexp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1A08F272A7004A47F5 /* tclRegexp.c */; };
+ F9FD30F20CC1AD070073837D /* tclResolve.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1C08F272A7004A47F5 /* tclResolve.c */; };
+ F9FD30F30CC1AD070073837D /* tclResult.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1D08F272A7004A47F5 /* tclResult.c */; };
+ F9FD30F40CC1AD070073837D /* tclScan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1E08F272A7004A47F5 /* tclScan.c */; };
+ F9FD30F50CC1AD070073837D /* tclStringObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F1F08F272A7004A47F5 /* tclStringObj.c */; };
+ F9FD30F60CC1AD070073837D /* tclStrToD.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2408F272A7004A47F5 /* tclStrToD.c */; };
+ F9FD30F70CC1AD070073837D /* tclStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2508F272A7004A47F5 /* tclStubInit.c */; };
+ F9FD30F80CC1AD070073837D /* tclStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2608F272A7004A47F5 /* tclStubLib.c */; };
+ F9FD30F90CC1AD070073837D /* tclThread.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2A08F272A7004A47F5 /* tclThread.c */; };
+ F9FD30FA0CC1AD070073837D /* tclThreadAlloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */; };
+ F9FD30FB0CC1AD070073837D /* tclThreadJoin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */; };
+ F9FD30FC0CC1AD070073837D /* tclThreadStorage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */; };
+ F9FD30FD0CC1AD070073837D /* tclTimer.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F2F08F272A7004A47F5 /* tclTimer.c */; };
+ F9FD30FE0CC1AD070073837D /* tclTomMathInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */; };
+ F9FD30FF0CC1AD070073837D /* tclTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3208F272A7004A47F5 /* tclTrace.c */; };
+ F9FD31000CC1AD070073837D /* tclUtf.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3408F272A7004A47F5 /* tclUtf.c */; };
+ F9FD31010CC1AD070073837D /* tclUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3508F272A7004A47F5 /* tclUtil.c */; };
+ F9FD31020CC1AD070073837D /* tclVar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D3F3608F272A7004A47F5 /* tclVar.c */; };
+ F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */; };
+ F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */; };
+ F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426908F272B3004A47F5 /* bn_mp_add.c */; };
+ F9FD31060CC1AD070073837D /* bn_mp_add_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */; };
+ F9FD31070CC1AD070073837D /* bn_mp_and.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426C08F272B3004A47F5 /* bn_mp_and.c */; };
+ F9FD31080CC1AD070073837D /* bn_mp_clamp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */; };
+ F9FD31090CC1AD070073837D /* bn_mp_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426E08F272B3004A47F5 /* bn_mp_clear.c */; };
+ F9FD310A0CC1AD070073837D /* bn_mp_clear_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */; };
+ F9FD310B0CC1AD070073837D /* bn_mp_cmp.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427008F272B3004A47F5 /* bn_mp_cmp.c */; };
+ F9FD310C0CC1AD070073837D /* bn_mp_cmp_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */; };
+ F9FD310D0CC1AD070073837D /* bn_mp_cmp_mag.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */; };
+ F9FD310E0CC1AD070073837D /* bn_mp_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427408F272B3004A47F5 /* bn_mp_copy.c */; };
+ F9FD310F0CC1AD070073837D /* bn_mp_count_bits.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */; };
+ F9FD31100CC1AD070073837D /* bn_mp_div.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427608F272B3004A47F5 /* bn_mp_div.c */; };
+ F9FD31110CC1AD070073837D /* bn_mp_div_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427708F272B3004A47F5 /* bn_mp_div_2.c */; };
+ F9FD31120CC1AD070073837D /* bn_mp_div_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */; };
+ F9FD31130CC1AD070073837D /* bn_mp_div_3.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427908F272B3004A47F5 /* bn_mp_div_3.c */; };
+ F9FD31140CC1AD070073837D /* bn_mp_div_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */; };
+ F9FD31150CC1AD070073837D /* bn_mp_exch.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427E08F272B3004A47F5 /* bn_mp_exch.c */; };
+ F9FD31160CC1AD070073837D /* bn_mp_expt_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */; };
+ F9FD31170CC1AD070073837D /* bn_mp_grow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428708F272B3004A47F5 /* bn_mp_grow.c */; };
+ F9FD31180CC1AD070073837D /* bn_mp_init.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428808F272B3004A47F5 /* bn_mp_init.c */; };
+ F9FD31190CC1AD070073837D /* bn_mp_init_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */; };
+ F9FD311A0CC1AD070073837D /* bn_mp_init_multi.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */; };
+ F9FD311B0CC1AD070073837D /* bn_mp_init_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */; };
+ F9FD311C0CC1AD070073837D /* bn_mp_init_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */; };
+ F9FD311D0CC1AD070073837D /* bn_mp_karatsuba_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */; };
+ F9FD311E0CC1AD070073837D /* bn_mp_karatsuba_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */; };
+ F9FD311F0CC1AD070073837D /* bn_mp_lshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429508F272B3004A47F5 /* bn_mp_lshd.c */; };
+ F9FD31200CC1AD070073837D /* bn_mp_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429608F272B3004A47F5 /* bn_mp_mod.c */; };
+ F9FD31210CC1AD070073837D /* bn_mp_mod_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */; };
+ F9FD31220CC1AD070073837D /* bn_mp_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429C08F272B3004A47F5 /* bn_mp_mul.c */; };
+ F9FD31230CC1AD070073837D /* bn_mp_mul_2.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */; };
+ F9FD31240CC1AD070073837D /* bn_mp_mul_2d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */; };
+ F9FD31250CC1AD070073837D /* bn_mp_mul_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */; };
+ F9FD31260CC1AD070073837D /* bn_mp_neg.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A208F272B3004A47F5 /* bn_mp_neg.c */; };
+ F9FD31270CC1AD070073837D /* bn_mp_or.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42A308F272B3004A47F5 /* bn_mp_or.c */; };
+ F9FD31280CC1AD070073837D /* bn_mp_radix_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */; };
+ F9FD31290CC1AD070073837D /* bn_mp_radix_smap.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */; };
+ F9FD312A0CC1AD070073837D /* bn_mp_read_radix.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */; };
+ F9FD312B0CC1AD070073837D /* bn_mp_rshd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */; };
+ F9FD312C0CC1AD070073837D /* bn_mp_set.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BA08F272B3004A47F5 /* bn_mp_set.c */; };
+ F9FD312D0CC1AD070073837D /* bn_mp_shrink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */; };
+ F9FD312E0CC1AD070073837D /* bn_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */; };
+ F9FD312F0CC1AD070073837D /* bn_mp_sqrt.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */; };
+ F9FD31300CC1AD070073837D /* bn_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C108F272B3004A47F5 /* bn_mp_sub.c */; };
+ F9FD31310CC1AD070073837D /* bn_mp_sub_d.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */; };
+ F9FD31320CC1AD070073837D /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */; };
+ F9FD31330CC1AD070073837D /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */; };
+ F9FD31340CC1AD070073837D /* bn_mp_toom_mul.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */; };
+ F9FD31350CC1AD070073837D /* bn_mp_toom_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */; };
+ F9FD31360CC1AD070073837D /* bn_mp_toradix_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */; };
+ F9FD31370CC1AD070073837D /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */; };
+ F9FD31380CC1AD070073837D /* bn_mp_xor.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */; };
+ F9FD31390CC1AD070073837D /* bn_mp_zero.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */; };
+ F9FD313A0CC1AD070073837D /* bn_reverse.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D008F272B3004A47F5 /* bn_reverse.c */; };
+ F9FD313B0CC1AD070073837D /* bn_s_mp_add.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */; };
+ F9FD313C0CC1AD070073837D /* bn_s_mp_mul_digs.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */; };
+ F9FD313D0CC1AD070073837D /* bn_s_mp_sqr.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */; };
+ F9FD313E0CC1AD070073837D /* bn_s_mp_sub.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */; };
+ F9FD313F0CC1AD070073837D /* bncore.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42D708F272B3004A47F5 /* bncore.c */; };
+ F9FD31400CC1AD070073837D /* tclMacOSXBundle.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */; };
+ F9FD31410CC1AD070073837D /* tclMacOSXFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */; };
+ F9FD31420CC1AD070073837D /* tclMacOSXNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */; };
+ F9FD31430CC1AD070073837D /* tclLoadDyld.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445B08F272B9004A47F5 /* tclLoadDyld.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ F9FD31440CC1AD070073837D /* tclUnixChan.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D445F08F272B9004A47F5 /* tclUnixChan.c */; };
+ F9FD31450CC1AD070073837D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; };
+ F9FD31460CC1AD070073837D /* tclUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446008F272B9004A47F5 /* tclUnixEvent.c */; };
+ F9FD31470CC1AD070073837D /* tclUnixFCmd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446108F272B9004A47F5 /* tclUnixFCmd.c */; };
+ F9FD31480CC1AD070073837D /* tclUnixFile.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446208F272B9004A47F5 /* tclUnixFile.c */; };
+ F9FD31490CC1AD070073837D /* tclUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446308F272B9004A47F5 /* tclUnixInit.c */; settings = {COMPILER_FLAGS = "-DTCL_LIBRARY=\\\"$(TCL_LIBRARY)\\\" -DTCL_PACKAGE_PATH=\\\"$(TCL_PACKAGE_PATH)\\\""; }; };
+ F9FD314A0CC1AD070073837D /* tclUnixNotfy.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446408F272B9004A47F5 /* tclUnixNotfy.c */; };
+ F9FD314B0CC1AD070073837D /* tclUnixPipe.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446508F272B9004A47F5 /* tclUnixPipe.c */; };
+ F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446708F272B9004A47F5 /* tclUnixSock.c */; };
+ F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446908F272B9004A47F5 /* tclUnixThrd.c */; };
+ F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D446B08F272B9004A47F5 /* tclUnixTime.c */; };
+ F9FD314F0CC1AD070073837D /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; };
+ F9FD31500CC1AD070073837D /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; };
+ F9FD31510CC1AD070073837D /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; };
+ F9FD31520CC1AD070073837D /* tkBind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB008F27A39005CB29B /* tkBind.c */; };
+ F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB108F27A39005CB29B /* tkBitmap.c */; };
+ F9FD31540CC1AD070073837D /* tkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB208F27A39005CB29B /* tkButton.c */; };
+ F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB408F27A39005CB29B /* tkCanvArc.c */; };
+ F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB508F27A39005CB29B /* tkCanvas.c */; };
+ F9FD31570CC1AD070073837D /* tkCanvBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB708F27A39005CB29B /* tkCanvBmap.c */; };
+ F9FD31580CC1AD070073837D /* tkCanvImg.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB808F27A39005CB29B /* tkCanvImg.c */; };
+ F9FD31590CC1AD070073837D /* tkCanvLine.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAB908F27A39005CB29B /* tkCanvLine.c */; };
+ F9FD315A0CC1AD070073837D /* tkCanvPoly.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABA08F27A39005CB29B /* tkCanvPoly.c */; };
+ F9FD315B0CC1AD070073837D /* tkCanvPs.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABB08F27A39005CB29B /* tkCanvPs.c */; };
+ F9FD315C0CC1AD070073837D /* tkCanvText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABD08F27A39005CB29B /* tkCanvText.c */; };
+ F9FD315D0CC1AD070073837D /* tkCanvUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABE08F27A39005CB29B /* tkCanvUtil.c */; };
+ F9FD315E0CC1AD070073837D /* tkCanvWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BABF08F27A39005CB29B /* tkCanvWind.c */; };
+ F9FD315F0CC1AD070073837D /* tkClipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC008F27A39005CB29B /* tkClipboard.c */; };
+ F9FD31600CC1AD070073837D /* tkCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC108F27A39005CB29B /* tkCmds.c */; };
+ F9FD31610CC1AD070073837D /* tkColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC208F27A39005CB29B /* tkColor.c */; };
+ F9FD31620CC1AD070073837D /* tkConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC408F27A39005CB29B /* tkConfig.c */; };
+ F9FD31630CC1AD070073837D /* tkConsole.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC508F27A39005CB29B /* tkConsole.c */; };
+ F9FD31640CC1AD070073837D /* tkCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC608F27A39005CB29B /* tkCursor.c */; };
+ F9FD31650CC1AD070073837D /* tkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAC808F27A39005CB29B /* tkEntry.c */; };
+ F9FD31660CC1AD070073837D /* tkError.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACA08F27A39005CB29B /* tkError.c */; };
+ F9FD31670CC1AD070073837D /* tkEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACB08F27A39005CB29B /* tkEvent.c */; };
+ F9FD31680CC1AD070073837D /* tkFileFilter.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACC08F27A39005CB29B /* tkFileFilter.c */; };
+ F9FD31690CC1AD070073837D /* tkFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACE08F27A39005CB29B /* tkFocus.c */; };
+ F9FD316A0CC1AD070073837D /* tkFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BACF08F27A39005CB29B /* tkFont.c */; };
+ F9FD316B0CC1AD070073837D /* tkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD108F27A39005CB29B /* tkFrame.c */; };
+ F9FD316C0CC1AD070073837D /* tkGC.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD208F27A39005CB29B /* tkGC.c */; };
+ F9FD316D0CC1AD070073837D /* tkGeometry.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD308F27A39005CB29B /* tkGeometry.c */; };
+ F9FD316E0CC1AD070073837D /* tkGet.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD408F27A39005CB29B /* tkGet.c */; };
+ F9FD316F0CC1AD070073837D /* tkGrab.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD508F27A39005CB29B /* tkGrab.c */; };
+ F9FD31700CC1AD070073837D /* tkGrid.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD608F27A39005CB29B /* tkGrid.c */; };
+ F9FD31710CC1AD070073837D /* tkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD708F27A39005CB29B /* tkImage.c */; };
+ F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD808F27A39005CB29B /* tkImgBmap.c */; };
+ F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAD908F27A39005CB29B /* tkImgGIF.c */; };
+ F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADA08F27A39005CB29B /* tkImgPhoto.c */; };
+ F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BADB08F27A39005CB29B /* tkImgPPM.c */; };
+ F9FD31760CC1AD070073837D /* tkListbox.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE408F27A39005CB29B /* tkListbox.c */; };
+ F9FD31770CC1AD070073837D /* tkMacWinMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE508F27A39005CB29B /* tkMacWinMenu.c */; };
+ F9FD31780CC1AD070073837D /* tkMain.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE608F27A39005CB29B /* tkMain.c */; };
+ F9FD31790CC1AD070073837D /* tkMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE708F27A39005CB29B /* tkMenu.c */; };
+ F9FD317A0CC1AD070073837D /* tkMenubutton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAE908F27A39005CB29B /* tkMenubutton.c */; };
+ F9FD317B0CC1AD070073837D /* tkMenuDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEB08F27A39005CB29B /* tkMenuDraw.c */; };
+ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; };
+ F9FD317D0CC1AD070073837D /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; };
+ F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; };
+ F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; };
+ F9FD31800CC1AD070073837D /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; };
+ F9FD31810CC1AD070073837D /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; };
+ F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; };
+ F9FD31830CC1AD070073837D /* tkPlace.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF208F27A39005CB29B /* tkPlace.c */; };
+ F9FD31850CC1AD070073837D /* tkRectOval.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF608F27A39005CB29B /* tkRectOval.c */; };
+ F9FD31860CC1AD070073837D /* tkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF708F27A39005CB29B /* tkScale.c */; };
+ F9FD31870CC1AD070073837D /* tkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF908F27A39005CB29B /* tkScrollbar.c */; };
+ F9FD31880CC1AD070073837D /* tkSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFB08F27A39005CB29B /* tkSelect.c */; };
+ F9FD31890CC1AD070073837D /* tkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFD08F27A39005CB29B /* tkSquare.c */; };
+ F9FD318A0CC1AD070073837D /* tkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFF08F27A39005CB29B /* tkStubInit.c */; };
+ F9FD318B0CC1AD070073837D /* tkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0008F27A39005CB29B /* tkStubLib.c */; };
+ F9FD318C0CC1AD070073837D /* tkStyle.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0108F27A39005CB29B /* tkStyle.c */; };
+ F9FD318D0CC1AD070073837D /* tkTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0208F27A39005CB29B /* tkTest.c */; };
+ F9FD318E0CC1AD070073837D /* tkText.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0308F27A39005CB29B /* tkText.c */; };
+ F9FD318F0CC1AD070073837D /* tkTextBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0508F27A39005CB29B /* tkTextBTree.c */; };
+ F9FD31900CC1AD070073837D /* tkTextDisp.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0608F27A39005CB29B /* tkTextDisp.c */; };
+ F9FD31910CC1AD070073837D /* tkTextImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0808F27A39005CB29B /* tkTextImage.c */; };
+ F9FD31920CC1AD070073837D /* tkTextIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0908F27A39005CB29B /* tkTextIndex.c */; };
+ F9FD31930CC1AD070073837D /* tkTextMark.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0A08F27A39005CB29B /* tkTextMark.c */; };
+ F9FD31940CC1AD070073837D /* tkTextTag.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0B08F27A39005CB29B /* tkTextTag.c */; };
+ F9FD31950CC1AD070073837D /* tkTextWind.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0C08F27A39005CB29B /* tkTextWind.c */; };
+ F9FD31960CC1AD070073837D /* tkTrig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0D08F27A39005CB29B /* tkTrig.c */; };
+ F9FD31970CC1AD070073837D /* tkUndo.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB0E08F27A39005CB29B /* tkUndo.c */; };
+ F9FD31980CC1AD070073837D /* tkUtil.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1008F27A39005CB29B /* tkUtil.c */; };
+ F9FD31990CC1AD070073837D /* tkVisual.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1108F27A39005CB29B /* tkVisual.c */; };
+ F9FD319A0CC1AD070073837D /* tkWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BB1208F27A39005CB29B /* tkWindow.c */; };
+ F9FD319B0CC1AD070073837D /* ttkBlink.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E10AF786D5000797B5 /* ttkBlink.c */; };
+ F9FD319C0CC1AD070073837D /* ttkButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E20AF786D5000797B5 /* ttkButton.c */; };
+ F9FD319D0CC1AD070073837D /* ttkCache.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E30AF786D5000797B5 /* ttkCache.c */; };
+ F9FD319E0CC1AD070073837D /* ttkClamTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E40AF786D5000797B5 /* ttkClamTheme.c */; };
+ F9FD319F0CC1AD070073837D /* ttkClassicTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E50AF786D5000797B5 /* ttkClassicTheme.c */; };
+ F9FD31A00CC1AD070073837D /* ttkDefaultTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */; };
+ F9FD31A10CC1AD070073837D /* ttkElements.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E80AF786D5000797B5 /* ttkElements.c */; };
+ F9FD31A20CC1AD070073837D /* ttkEntry.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887E90AF786D5000797B5 /* ttkEntry.c */; };
+ F9FD31A30CC1AD070073837D /* ttkFrame.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EA0AF786D5000797B5 /* ttkFrame.c */; };
+ F9FD31A40CC1AD070073837D /* ttkImage.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EB0AF786D5000797B5 /* ttkImage.c */; };
+ F9FD31A50CC1AD070073837D /* ttkInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EC0AF786D5000797B5 /* ttkInit.c */; };
+ F9FD31A60CC1AD070073837D /* ttkLabel.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887ED0AF786D5000797B5 /* ttkLabel.c */; };
+ F9FD31A70CC1AD070073837D /* ttkLayout.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EE0AF786D5000797B5 /* ttkLayout.c */; };
+ F9FD31A80CC1AD070073837D /* ttkManager.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887EF0AF786D5000797B5 /* ttkManager.c */; };
+ F9FD31A90CC1AD070073837D /* ttkNotebook.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F10AF786D5000797B5 /* ttkNotebook.c */; };
+ F9FD31AA0CC1AD070073837D /* ttkPanedwindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F20AF786D5000797B5 /* ttkPanedwindow.c */; };
+ F9FD31AB0CC1AD070073837D /* ttkProgress.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F30AF786D5000797B5 /* ttkProgress.c */; };
+ F9FD31AC0CC1AD070073837D /* ttkScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F40AF786D5000797B5 /* ttkScale.c */; };
+ F9FD31AD0CC1AD070073837D /* ttkScroll.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F50AF786D5000797B5 /* ttkScroll.c */; };
+ F9FD31AE0CC1AD070073837D /* ttkScrollbar.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F60AF786D5000797B5 /* ttkScrollbar.c */; };
+ F9FD31AF0CC1AD070073837D /* ttkSeparator.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F70AF786D5000797B5 /* ttkSeparator.c */; };
+ F9FD31B00CC1AD070073837D /* ttkSquare.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F80AF786D5000797B5 /* ttkSquare.c */; };
+ F9FD31B10CC1AD070073837D /* ttkState.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887F90AF786D5000797B5 /* ttkState.c */; };
+ F9FD31B20CC1AD070073837D /* ttkStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FA0AF786D5000797B5 /* ttkStubInit.c */; };
+ F9FD31B30CC1AD070073837D /* ttkStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FB0AF786D5000797B5 /* ttkStubLib.c */; };
+ F9FD31B40CC1AD070073837D /* ttkTagSet.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FC0AF786D5000797B5 /* ttkTagSet.c */; };
+ F9FD31B50CC1AD070073837D /* ttkTheme.c in Sources */ = {isa = PBXBuildFile; fileRef = F96887FD0AF786D5000797B5 /* ttkTheme.c */; };
+ F9FD31B60CC1AD070073837D /* ttkTrace.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888000AF786D5000797B5 /* ttkTrace.c */; };
+ F9FD31B70CC1AD070073837D /* ttkTrack.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888010AF786D5000797B5 /* ttkTrack.c */; };
+ F9FD31B80CC1AD070073837D /* ttkTreeview.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888020AF786D5000797B5 /* ttkTreeview.c */; };
+ F9FD31B90CC1AD070073837D /* ttkWidget.c in Sources */ = {isa = PBXBuildFile; fileRef = F96888030AF786D5000797B5 /* ttkWidget.c */; };
+ F9FD31DA0CC1AD070073837D /* tkAppInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7508F27A3D005CB29B /* tkAppInit.c */; settings = {COMPILER_FLAGS = "-DTK_TEST"; }; };
+ F9FD31DB0CC1AD070073837D /* tkUnix3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7908F27A3D005CB29B /* tkUnix3d.c */; };
+ F9FD31DC0CC1AD070073837D /* tkUnixScale.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8C08F27A3D005CB29B /* tkUnixScale.c */; };
+ F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */ = {isa = PBXBuildFile; fileRef = F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */; };
+ F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F966C07408F2820D005CB29B /* CoreFoundation.framework */; };
+ F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */; };
+ F9FD31FA0CC1ADB70073837D /* tkUnixKey.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8708F27A3D005CB29B /* tkUnixKey.c */; };
+ F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC9108F27A3D005CB29B /* tkUnixXId.c */; };
+ F9FD31FC0CC1ADB70073837D /* tkUnixInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8508F27A3D005CB29B /* tkUnixInit.c */; };
+ F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */; };
+ F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8F08F27A3D005CB29B /* tkUnixSend.c */; };
+ F9FD31FF0CC1ADB70073837D /* tkUnixFocus.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8308F27A3D005CB29B /* tkUnixFocus.c */; };
+ F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC9008F27A3D005CB29B /* tkUnixWm.c */; };
+ F9FD32010CC1ADB70073837D /* tkUnixRFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */; };
+ F9FD32020CC1ADB70073837D /* tkUnix.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7808F27A3D005CB29B /* tkUnix.c */; };
+ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8808F27A3D005CB29B /* tkUnixMenu.c */; };
+ F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */; };
+ F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8008F27A3D005CB29B /* tkUnixDraw.c */; };
+ F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */; };
+ F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */; };
+ F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8208F27A3D005CB29B /* tkUnixEvent.c */; };
+ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7B08F27A3D005CB29B /* tkUnixColor.c */; };
+ F9FD320A0CC1ADB70073837D /* tkUnixButton.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7A08F27A3D005CB29B /* tkUnixButton.c */; };
+ F9FD320B0CC1ADB70073837D /* tkUnixMenubu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */; };
+ F9FD320C0CC1ADB70073837D /* tkUnixScrlbr.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */; };
+ F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32140CC1AF170073837D /* libX11.dylib */; };
+ F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32150CC1AF170073837D /* libXext.dylib */; };
+ F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD32160CC1AF170073837D /* libXss.dylib */; };
+ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; };
+ F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; };
+ F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; };
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; };
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; };
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; };
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; };
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; };
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; };
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; };
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; };
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 8DD76FB20486AB0100D96B5E /* tktest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tktest; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = "<group>"; };
+ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = "<group>"; };
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBusy.c; sourceTree = "<group>"; };
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchoose.tcl; sourceTree = "<group>"; };
+ F915432A0EF201CF0032D1E8 /* zlib.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = zlib.test; sourceTree = "<group>"; };
+ F915432D0EF201EE0032D1E8 /* zlib.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = zlib.n; sourceTree = "<group>"; };
+ F9183E640EFC80CD0030B814 /* throw.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = throw.n; sourceTree = "<group>"; };
+ F9183E650EFC80D70030B814 /* try.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = try.n; sourceTree = "<group>"; };
+ F9183E6A0EFC81560030B814 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F9183E8F0EFC817B0030B814 /* tdbc */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tdbc; sourceTree = "<group>"; };
+ F91DC23C0E44C51B002CB8D1 /* nre.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = nre.test; sourceTree = "<group>"; };
+ F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = "<group>"; };
+ F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = "<group>"; };
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = "<group>"; };
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhInstance.c; sourceTree = "<group>"; };
+ F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = "<group>"; };
+ F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = "<group>"; };
+ F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = "<group>"; };
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = "<group>"; };
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = "<group>"; };
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = "<group>"; };
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = "<group>"; };
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = "<group>"; };
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = "<group>"; };
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = "<group>"; };
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = "<group>"; };
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = "<group>"; };
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = "<group>"; };
+ F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = "<group>"; };
+ F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = "<group>"; };
+ F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = "<group>"; };
+ F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = "<group>"; };
+ F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = "<group>"; };
+ F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = "<group>"; };
+ F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = "<group>"; };
+ F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = "<group>"; };
+ F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = "<group>"; };
+ F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = "<group>"; };
+ F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = "<group>"; };
+ F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = "<group>"; };
+ F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = "<group>"; };
+ F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = "<group>"; };
+ F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
+ F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
+ F94523A10E6FC2AC00C1D987 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ F946FB8B0FBE3AED00CD6495 /* itcl */ = {isa = PBXFileReference; lastKnownFileType = folder; path = itcl; sourceTree = "<group>"; };
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = "<group>"; };
+ F95D8D4B0F1715610006B020 /* Tk.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Tk.icns; sourceTree = "<group>"; };
+ F95D8D4C0F1715610006B020 /* Tk.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Tk.tiff; sourceTree = "<group>"; };
+ F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
+ F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
+ F96437C90EF0D4B2003F468E /* tclZlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclZlib.c; sourceTree = "<group>"; };
+ F96437E60EF0D652003F468E /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
+ F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
+ F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
+ F966BA0708F27A37005CB29B /* gray50.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray50.xbm; sourceTree = "<group>"; };
+ F966BA0808F27A37005CB29B /* gray75.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray75.xbm; sourceTree = "<group>"; };
+ F966BA0908F27A37005CB29B /* hourglass.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = hourglass.xbm; sourceTree = "<group>"; };
+ F966BA0A08F27A37005CB29B /* info.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = info.xbm; sourceTree = "<group>"; };
+ F966BA0B08F27A37005CB29B /* questhead.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = questhead.xbm; sourceTree = "<group>"; };
+ F966BA0C08F27A37005CB29B /* question.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = question.xbm; sourceTree = "<group>"; };
+ F966BA0D08F27A37005CB29B /* warning.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = warning.xbm; sourceTree = "<group>"; };
+ F966BA0E08F27A37005CB29B /* ChangeLog */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = ChangeLog; sourceTree = "<group>"; };
+ F966BA0F08F27A37005CB29B /* changes */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = changes; sourceTree = "<group>"; };
+ F966BA1108F27A37005CB29B /* 3DBorder.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = 3DBorder.3; sourceTree = "<group>"; };
+ F966BA1208F27A37005CB29B /* AddOption.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AddOption.3; sourceTree = "<group>"; };
+ F966BA1308F27A37005CB29B /* bell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bell.n; sourceTree = "<group>"; };
+ F966BA1408F27A37005CB29B /* bind.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bind.n; sourceTree = "<group>"; };
+ F966BA1508F27A37005CB29B /* BindTable.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BindTable.3; sourceTree = "<group>"; };
+ F966BA1608F27A37005CB29B /* bindtags.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bindtags.n; sourceTree = "<group>"; };
+ F966BA1708F27A37005CB29B /* bitmap.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bitmap.n; sourceTree = "<group>"; };
+ F966BA1808F27A37005CB29B /* button.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = button.n; sourceTree = "<group>"; };
+ F966BA1908F27A37005CB29B /* canvas.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = canvas.n; sourceTree = "<group>"; };
+ F966BA1A08F27A37005CB29B /* CanvPsY.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvPsY.3; sourceTree = "<group>"; };
+ F966BA1B08F27A37005CB29B /* CanvTkwin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvTkwin.3; sourceTree = "<group>"; };
+ F966BA1C08F27A37005CB29B /* CanvTxtInfo.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CanvTxtInfo.3; sourceTree = "<group>"; };
+ F966BA1D08F27A37005CB29B /* checkbutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = checkbutton.n; sourceTree = "<group>"; };
+ F966BA1E08F27A37005CB29B /* chooseColor.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chooseColor.n; sourceTree = "<group>"; };
+ F966BA1F08F27A37005CB29B /* chooseDirectory.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chooseDirectory.n; sourceTree = "<group>"; };
+ F966BA2008F27A37005CB29B /* Clipboard.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Clipboard.3; sourceTree = "<group>"; };
+ F966BA2108F27A37005CB29B /* clipboard.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = clipboard.n; sourceTree = "<group>"; };
+ F966BA2208F27A37005CB29B /* ClrSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ClrSelect.3; sourceTree = "<group>"; };
+ F966BA2308F27A37005CB29B /* colors.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = colors.n; sourceTree = "<group>"; };
+ F966BA2408F27A37005CB29B /* ConfigWidg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ConfigWidg.3; sourceTree = "<group>"; };
+ F966BA2508F27A37005CB29B /* ConfigWind.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ConfigWind.3; sourceTree = "<group>"; };
+ F966BA2608F27A37005CB29B /* console.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = console.n; sourceTree = "<group>"; };
+ F966BA2708F27A37005CB29B /* CoordToWin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CoordToWin.3; sourceTree = "<group>"; };
+ F966BA2808F27A37005CB29B /* CrtCmHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCmHdlr.3; sourceTree = "<group>"; };
+ F966BA2908F27A37005CB29B /* CrtErrHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtErrHdlr.3; sourceTree = "<group>"; };
+ F966BA2A08F27A37005CB29B /* CrtGenHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtGenHdlr.3; sourceTree = "<group>"; };
+ F966BA2B08F27A37005CB29B /* CrtImgType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtImgType.3; sourceTree = "<group>"; };
+ F966BA2C08F27A37005CB29B /* CrtItemType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtItemType.3; sourceTree = "<group>"; };
+ F966BA2D08F27A37005CB29B /* CrtPhImgFmt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtPhImgFmt.3; sourceTree = "<group>"; };
+ F966BA2E08F27A37005CB29B /* CrtSelHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtSelHdlr.3; sourceTree = "<group>"; };
+ F966BA2F08F27A37005CB29B /* CrtWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtWindow.3; sourceTree = "<group>"; };
+ F966BA3008F27A37005CB29B /* cursors.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = cursors.n; sourceTree = "<group>"; };
+ F966BA3108F27A37005CB29B /* DeleteImg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DeleteImg.3; sourceTree = "<group>"; };
+ F966BA3208F27A37005CB29B /* destroy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = destroy.n; sourceTree = "<group>"; };
+ F966BA3308F27A37005CB29B /* dialog.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dialog.n; sourceTree = "<group>"; };
+ F966BA3408F27A37005CB29B /* DrawFocHlt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DrawFocHlt.3; sourceTree = "<group>"; };
+ F966BA3508F27A37005CB29B /* entry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = entry.n; sourceTree = "<group>"; };
+ F966BA3608F27A37005CB29B /* event.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = event.n; sourceTree = "<group>"; };
+ F966BA3708F27A37005CB29B /* EventHndlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = EventHndlr.3; sourceTree = "<group>"; };
+ F966BA3808F27A37005CB29B /* FindPhoto.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FindPhoto.3; sourceTree = "<group>"; };
+ F966BA3908F27A37005CB29B /* focus.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = focus.n; sourceTree = "<group>"; };
+ F966BA3A08F27A37005CB29B /* focusNext.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = focusNext.n; sourceTree = "<group>"; };
+ F966BA3B08F27A37005CB29B /* font.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = font.n; sourceTree = "<group>"; };
+ F966BA3C08F27A37005CB29B /* FontId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FontId.3; sourceTree = "<group>"; };
+ F966BA3D08F27A37005CB29B /* frame.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = frame.n; sourceTree = "<group>"; };
+ F966BA3E08F27A37005CB29B /* FreeXId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FreeXId.3; sourceTree = "<group>"; };
+ F966BA3F08F27A37005CB29B /* GeomReq.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GeomReq.3; sourceTree = "<group>"; };
+ F966BA4008F27A37005CB29B /* GetAnchor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetAnchor.3; sourceTree = "<group>"; };
+ F966BA4108F27A37005CB29B /* GetBitmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetBitmap.3; sourceTree = "<group>"; };
+ F966BA4208F27A37005CB29B /* GetCapStyl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCapStyl.3; sourceTree = "<group>"; };
+ F966BA4308F27A37005CB29B /* GetClrmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetClrmap.3; sourceTree = "<group>"; };
+ F966BA4408F27A37005CB29B /* GetColor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetColor.3; sourceTree = "<group>"; };
+ F966BA4508F27A37005CB29B /* GetCursor.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCursor.3; sourceTree = "<group>"; };
+ F966BA4608F27A37005CB29B /* GetDash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetDash.3; sourceTree = "<group>"; };
+ F966BA4708F27A37005CB29B /* GetFont.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetFont.3; sourceTree = "<group>"; };
+ F966BA4808F27A37005CB29B /* GetGC.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetGC.3; sourceTree = "<group>"; };
+ F966BA4908F27A37005CB29B /* GetHINSTANCE.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHINSTANCE.3; sourceTree = "<group>"; };
+ F966BA4A08F27A37005CB29B /* GetHWND.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHWND.3; sourceTree = "<group>"; };
+ F966BA4B08F27A37005CB29B /* GetImage.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetImage.3; sourceTree = "<group>"; };
+ F966BA4C08F27A37005CB29B /* GetJoinStl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetJoinStl.3; sourceTree = "<group>"; };
+ F966BA4D08F27A37005CB29B /* GetJustify.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetJustify.3; sourceTree = "<group>"; };
+ F966BA4E08F27A37005CB29B /* getOpenFile.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = getOpenFile.n; sourceTree = "<group>"; };
+ F966BA4F08F27A37005CB29B /* GetOption.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetOption.3; sourceTree = "<group>"; };
+ F966BA5008F27A38005CB29B /* GetPixels.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetPixels.3; sourceTree = "<group>"; };
+ F966BA5108F27A38005CB29B /* GetPixmap.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetPixmap.3; sourceTree = "<group>"; };
+ F966BA5208F27A38005CB29B /* GetRelief.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetRelief.3; sourceTree = "<group>"; };
+ F966BA5308F27A38005CB29B /* GetRootCrd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetRootCrd.3; sourceTree = "<group>"; };
+ F966BA5408F27A38005CB29B /* GetScroll.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetScroll.3; sourceTree = "<group>"; };
+ F966BA5508F27A38005CB29B /* GetSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetSelect.3; sourceTree = "<group>"; };
+ F966BA5608F27A38005CB29B /* GetUid.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetUid.3; sourceTree = "<group>"; };
+ F966BA5708F27A38005CB29B /* GetVisual.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVisual.3; sourceTree = "<group>"; };
+ F966BA5808F27A38005CB29B /* GetVRoot.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVRoot.3; sourceTree = "<group>"; };
+ F966BA5908F27A38005CB29B /* Grab.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Grab.3; sourceTree = "<group>"; };
+ F966BA5A08F27A38005CB29B /* grab.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = grab.n; sourceTree = "<group>"; };
+ F966BA5B08F27A38005CB29B /* grid.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = grid.n; sourceTree = "<group>"; };
+ F966BA5C08F27A38005CB29B /* HandleEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = HandleEvent.3; sourceTree = "<group>"; };
+ F966BA5D08F27A38005CB29B /* HWNDToWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = HWNDToWindow.3; sourceTree = "<group>"; };
+ F966BA5E08F27A38005CB29B /* IdToWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = IdToWindow.3; sourceTree = "<group>"; };
+ F966BA5F08F27A38005CB29B /* image.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = image.n; sourceTree = "<group>"; };
+ F966BA6008F27A38005CB29B /* ImgChanged.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ImgChanged.3; sourceTree = "<group>"; };
+ F966BA6108F27A38005CB29B /* Inactive.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Inactive.3; sourceTree = "<group>"; };
+ F966BA6208F27A38005CB29B /* InternAtom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = InternAtom.3; sourceTree = "<group>"; };
+ F966BA6308F27A38005CB29B /* keysyms.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = keysyms.n; sourceTree = "<group>"; };
+ F966BA6408F27A38005CB29B /* label.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = label.n; sourceTree = "<group>"; };
+ F966BA6508F27A38005CB29B /* labelframe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = labelframe.n; sourceTree = "<group>"; };
+ F966BA6608F27A38005CB29B /* listbox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = listbox.n; sourceTree = "<group>"; };
+ F966BA6708F27A38005CB29B /* loadTk.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = loadTk.n; sourceTree = "<group>"; };
+ F966BA6808F27A38005CB29B /* lower.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lower.n; sourceTree = "<group>"; };
+ F966BA6908F27A38005CB29B /* MainLoop.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MainLoop.3; sourceTree = "<group>"; };
+ F966BA6A08F27A38005CB29B /* MaintGeom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MaintGeom.3; sourceTree = "<group>"; };
+ F966BA6B08F27A38005CB29B /* MainWin.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MainWin.3; sourceTree = "<group>"; };
+ F966BA6D08F27A38005CB29B /* ManageGeom.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ManageGeom.3; sourceTree = "<group>"; };
+ F966BA6E08F27A38005CB29B /* MapWindow.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MapWindow.3; sourceTree = "<group>"; };
+ F966BA6F08F27A38005CB29B /* MeasureChar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MeasureChar.3; sourceTree = "<group>"; };
+ F966BA7008F27A38005CB29B /* menu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menu.n; sourceTree = "<group>"; };
+ F966BA7108F27A38005CB29B /* menubar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubar.n; sourceTree = "<group>"; };
+ F966BA7208F27A38005CB29B /* menubutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = menubutton.n; sourceTree = "<group>"; };
+ F966BA7308F27A38005CB29B /* message.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = message.n; sourceTree = "<group>"; };
+ F966BA7408F27A38005CB29B /* messageBox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = messageBox.n; sourceTree = "<group>"; };
+ F966BA7508F27A38005CB29B /* MoveToplev.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = MoveToplev.3; sourceTree = "<group>"; };
+ F966BA7608F27A38005CB29B /* Name.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Name.3; sourceTree = "<group>"; };
+ F966BA7708F27A38005CB29B /* NameOfImg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = NameOfImg.3; sourceTree = "<group>"; };
+ F966BA7808F27A38005CB29B /* option.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = option.n; sourceTree = "<group>"; };
+ F966BA7908F27A38005CB29B /* optionMenu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = optionMenu.n; sourceTree = "<group>"; };
+ F966BA7A08F27A38005CB29B /* options.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = options.n; sourceTree = "<group>"; };
+ F966BA7B08F27A38005CB29B /* OwnSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OwnSelect.3; sourceTree = "<group>"; };
+ F966BA7C08F27A38005CB29B /* pack-old.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = "pack-old.n"; sourceTree = "<group>"; };
+ F966BA7D08F27A38005CB29B /* pack.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pack.n; sourceTree = "<group>"; };
+ F966BA7E08F27A38005CB29B /* palette.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = palette.n; sourceTree = "<group>"; };
+ F966BA7F08F27A38005CB29B /* panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = panedwindow.n; sourceTree = "<group>"; };
+ F966BA8008F27A38005CB29B /* ParseArgv.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ParseArgv.3; sourceTree = "<group>"; };
+ F966BA8108F27A38005CB29B /* photo.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = photo.n; sourceTree = "<group>"; };
+ F966BA8208F27A38005CB29B /* place.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = place.n; sourceTree = "<group>"; };
+ F966BA8308F27A38005CB29B /* popup.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = popup.n; sourceTree = "<group>"; };
+ F966BA8408F27A38005CB29B /* QWinEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = QWinEvent.3; sourceTree = "<group>"; };
+ F966BA8508F27A38005CB29B /* radiobutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = radiobutton.n; sourceTree = "<group>"; };
+ F966BA8608F27A38005CB29B /* raise.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = raise.n; sourceTree = "<group>"; };
+ F966BA8708F27A38005CB29B /* Restack.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Restack.3; sourceTree = "<group>"; };
+ F966BA8808F27A38005CB29B /* RestrictEv.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RestrictEv.3; sourceTree = "<group>"; };
+ F966BA8908F27A38005CB29B /* scale.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scale.n; sourceTree = "<group>"; };
+ F966BA8A08F27A38005CB29B /* scrollbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scrollbar.n; sourceTree = "<group>"; };
+ F966BA8B08F27A38005CB29B /* selection.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = selection.n; sourceTree = "<group>"; };
+ F966BA8C08F27A38005CB29B /* send.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = send.n; sourceTree = "<group>"; };
+ F966BA8D08F27A38005CB29B /* SetAppName.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetAppName.3; sourceTree = "<group>"; };
+ F966BA8E08F27A38005CB29B /* SetCaret.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetCaret.3; sourceTree = "<group>"; };
+ F966BA8F08F27A38005CB29B /* SetClass.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetClass.3; sourceTree = "<group>"; };
+ F966BA9008F27A38005CB29B /* SetClassProcs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetClassProcs.3; sourceTree = "<group>"; };
+ F966BA9108F27A38005CB29B /* SetGrid.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetGrid.3; sourceTree = "<group>"; };
+ F966BA9208F27A38005CB29B /* SetOptions.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetOptions.3; sourceTree = "<group>"; };
+ F966BA9308F27A38005CB29B /* SetVisual.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetVisual.3; sourceTree = "<group>"; };
+ F966BA9408F27A38005CB29B /* spinbox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = spinbox.n; sourceTree = "<group>"; };
+ F966BA9508F27A38005CB29B /* StrictMotif.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StrictMotif.3; sourceTree = "<group>"; };
+ F966BA9608F27A38005CB29B /* text.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = text.n; sourceTree = "<group>"; };
+ F966BA9708F27A38005CB29B /* TextLayout.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TextLayout.3; sourceTree = "<group>"; };
+ F966BA9808F27A38005CB29B /* tk.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tk.n; sourceTree = "<group>"; };
+ F966BA9A08F27A38005CB29B /* Tk_Init.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tk_Init.3; sourceTree = "<group>"; };
+ F966BA9B08F27A38005CB29B /* Tk_Main.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tk_Main.3; sourceTree = "<group>"; };
+ F966BA9C08F27A38005CB29B /* tkerror.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkerror.n; sourceTree = "<group>"; };
+ F966BA9D08F27A38005CB29B /* TkInitStubs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TkInitStubs.3; sourceTree = "<group>"; };
+ F966BA9E08F27A38005CB29B /* tkvars.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkvars.n; sourceTree = "<group>"; };
+ F966BA9F08F27A38005CB29B /* tkwait.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tkwait.n; sourceTree = "<group>"; };
+ F966BAA008F27A38005CB29B /* toplevel.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = toplevel.n; sourceTree = "<group>"; };
+ F966BAA108F27A38005CB29B /* WindowId.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = WindowId.3; sourceTree = "<group>"; };
+ F966BAA208F27A38005CB29B /* winfo.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = winfo.n; sourceTree = "<group>"; };
+ F966BAA308F27A38005CB29B /* wish.1 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wish.1; sourceTree = "<group>"; };
+ F966BAA408F27A38005CB29B /* wm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = wm.n; sourceTree = "<group>"; };
+ F966BAA608F27A38005CB29B /* default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default.h; sourceTree = "<group>"; };
+ F966BAA708F27A38005CB29B /* ks_names.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ks_names.h; sourceTree = "<group>"; };
+ F966BAA908F27A39005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BAAA08F27A39005CB29B /* tk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.decls; sourceTree = "<group>"; };
+ F966BAAB08F27A39005CB29B /* tk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk.h; sourceTree = "<group>"; };
+ F966BAAC08F27A39005CB29B /* tk3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tk3d.c; sourceTree = "<group>"; };
+ F966BAAD08F27A39005CB29B /* tk3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tk3d.h; sourceTree = "<group>"; };
+ F966BAAE08F27A39005CB29B /* tkArgv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkArgv.c; sourceTree = "<group>"; };
+ F966BAAF08F27A39005CB29B /* tkAtom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkAtom.c; sourceTree = "<group>"; };
+ F966BAB008F27A39005CB29B /* tkBind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBind.c; sourceTree = "<group>"; };
+ F966BAB108F27A39005CB29B /* tkBitmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkBitmap.c; sourceTree = "<group>"; };
+ F966BAB208F27A39005CB29B /* tkButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkButton.c; sourceTree = "<group>"; };
+ F966BAB308F27A39005CB29B /* tkButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkButton.h; sourceTree = "<group>"; };
+ F966BAB408F27A39005CB29B /* tkCanvArc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvArc.c; sourceTree = "<group>"; };
+ F966BAB508F27A39005CB29B /* tkCanvas.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvas.c; sourceTree = "<group>"; };
+ F966BAB608F27A39005CB29B /* tkCanvas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkCanvas.h; sourceTree = "<group>"; };
+ F966BAB708F27A39005CB29B /* tkCanvBmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvBmap.c; sourceTree = "<group>"; };
+ F966BAB808F27A39005CB29B /* tkCanvImg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvImg.c; sourceTree = "<group>"; };
+ F966BAB908F27A39005CB29B /* tkCanvLine.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvLine.c; sourceTree = "<group>"; };
+ F966BABA08F27A39005CB29B /* tkCanvPoly.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvPoly.c; sourceTree = "<group>"; };
+ F966BABB08F27A39005CB29B /* tkCanvPs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvPs.c; sourceTree = "<group>"; };
+ F966BABD08F27A39005CB29B /* tkCanvText.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvText.c; sourceTree = "<group>"; };
+ F966BABE08F27A39005CB29B /* tkCanvUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvUtil.c; sourceTree = "<group>"; };
+ F966BABF08F27A39005CB29B /* tkCanvWind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCanvWind.c; sourceTree = "<group>"; };
+ F966BAC008F27A39005CB29B /* tkClipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkClipboard.c; sourceTree = "<group>"; };
+ F966BAC108F27A39005CB29B /* tkCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCmds.c; sourceTree = "<group>"; };
+ F966BAC208F27A39005CB29B /* tkColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkColor.c; sourceTree = "<group>"; };
+ F966BAC308F27A39005CB29B /* tkColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkColor.h; sourceTree = "<group>"; };
+ F966BAC408F27A39005CB29B /* tkConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkConfig.c; sourceTree = "<group>"; };
+ F966BAC508F27A39005CB29B /* tkConsole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkConsole.c; sourceTree = "<group>"; };
+ F966BAC608F27A39005CB29B /* tkCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkCursor.c; sourceTree = "<group>"; };
+ F966BAC708F27A39005CB29B /* tkDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkDecls.h; sourceTree = "<group>"; };
+ F966BAC808F27A39005CB29B /* tkEntry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkEntry.c; sourceTree = "<group>"; };
+ F966BAC908F27A39005CB29B /* tkEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkEntry.h; sourceTree = "<group>"; };
+ F966BACA08F27A39005CB29B /* tkError.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkError.c; sourceTree = "<group>"; };
+ F966BACB08F27A39005CB29B /* tkEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkEvent.c; sourceTree = "<group>"; };
+ F966BACC08F27A39005CB29B /* tkFileFilter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFileFilter.c; sourceTree = "<group>"; };
+ F966BACD08F27A39005CB29B /* tkFileFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkFileFilter.h; sourceTree = "<group>"; };
+ F966BACE08F27A39005CB29B /* tkFocus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFocus.c; sourceTree = "<group>"; };
+ F966BACF08F27A39005CB29B /* tkFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFont.c; sourceTree = "<group>"; };
+ F966BAD008F27A39005CB29B /* tkFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkFont.h; sourceTree = "<group>"; };
+ F966BAD108F27A39005CB29B /* tkFrame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkFrame.c; sourceTree = "<group>"; };
+ F966BAD208F27A39005CB29B /* tkGC.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGC.c; sourceTree = "<group>"; };
+ F966BAD308F27A39005CB29B /* tkGeometry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGeometry.c; sourceTree = "<group>"; };
+ F966BAD408F27A39005CB29B /* tkGet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGet.c; sourceTree = "<group>"; };
+ F966BAD508F27A39005CB29B /* tkGrab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGrab.c; sourceTree = "<group>"; };
+ F966BAD608F27A39005CB29B /* tkGrid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkGrid.c; sourceTree = "<group>"; };
+ F966BAD708F27A39005CB29B /* tkImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImage.c; sourceTree = "<group>"; };
+ F966BAD808F27A39005CB29B /* tkImgBmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgBmap.c; sourceTree = "<group>"; };
+ F966BAD908F27A39005CB29B /* tkImgGIF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgGIF.c; sourceTree = "<group>"; };
+ F966BADA08F27A39005CB29B /* tkImgPhoto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPhoto.c; sourceTree = "<group>"; };
+ F966BADB08F27A39005CB29B /* tkImgPPM.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPPM.c; sourceTree = "<group>"; };
+ F966BADC08F27A39005CB29B /* tkImgUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgUtil.c; sourceTree = "<group>"; };
+ F966BADE08F27A39005CB29B /* tkInt.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkInt.decls; sourceTree = "<group>"; };
+ F966BADF08F27A39005CB29B /* tkInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkInt.h; sourceTree = "<group>"; };
+ F966BAE108F27A39005CB29B /* tkIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntDecls.h; sourceTree = "<group>"; };
+ F966BAE208F27A39005CB29B /* tkIntPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntPlatDecls.h; sourceTree = "<group>"; };
+ F966BAE308F27A39005CB29B /* tkIntXlibDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkIntXlibDecls.h; sourceTree = "<group>"; };
+ F966BAE408F27A39005CB29B /* tkListbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkListbox.c; sourceTree = "<group>"; };
+ F966BAE508F27A39005CB29B /* tkMacWinMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMacWinMenu.c; sourceTree = "<group>"; };
+ F966BAE608F27A39005CB29B /* tkMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMain.c; sourceTree = "<group>"; };
+ F966BAE708F27A39005CB29B /* tkMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenu.c; sourceTree = "<group>"; };
+ F966BAE808F27A39005CB29B /* tkMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMenu.h; sourceTree = "<group>"; };
+ F966BAE908F27A39005CB29B /* tkMenubutton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenubutton.c; sourceTree = "<group>"; };
+ F966BAEA08F27A39005CB29B /* tkMenubutton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMenubutton.h; sourceTree = "<group>"; };
+ F966BAEB08F27A39005CB29B /* tkMenuDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMenuDraw.c; sourceTree = "<group>"; };
+ F966BAEC08F27A39005CB29B /* tkMessage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkMessage.c; sourceTree = "<group>"; };
+ F966BAED08F27A39005CB29B /* tkObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkObj.c; sourceTree = "<group>"; };
+ F966BAEE08F27A39005CB29B /* tkOldConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldConfig.c; sourceTree = "<group>"; };
+ F966BAEF08F27A39005CB29B /* tkOption.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOption.c; sourceTree = "<group>"; };
+ F966BAF008F27A39005CB29B /* tkPack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPack.c; sourceTree = "<group>"; };
+ F966BAF108F27A39005CB29B /* tkPanedWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPanedWindow.c; sourceTree = "<group>"; };
+ F966BAF208F27A39005CB29B /* tkPlace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPlace.c; sourceTree = "<group>"; };
+ F966BAF308F27A39005CB29B /* tkPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkPlatDecls.h; sourceTree = "<group>"; };
+ F966BAF408F27A39005CB29B /* tkPointer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkPointer.c; sourceTree = "<group>"; };
+ F966BAF508F27A39005CB29B /* tkPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkPort.h; sourceTree = "<group>"; };
+ F966BAF608F27A39005CB29B /* tkRectOval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkRectOval.c; sourceTree = "<group>"; };
+ F966BAF708F27A39005CB29B /* tkScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkScale.c; sourceTree = "<group>"; };
+ F966BAF808F27A39005CB29B /* tkScale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkScale.h; sourceTree = "<group>"; };
+ F966BAF908F27A39005CB29B /* tkScrollbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkScrollbar.c; sourceTree = "<group>"; };
+ F966BAFA08F27A39005CB29B /* tkScrollbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkScrollbar.h; sourceTree = "<group>"; };
+ F966BAFB08F27A39005CB29B /* tkSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSelect.c; sourceTree = "<group>"; };
+ F966BAFC08F27A39005CB29B /* tkSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkSelect.h; sourceTree = "<group>"; };
+ F966BAFD08F27A39005CB29B /* tkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSquare.c; sourceTree = "<group>"; };
+ F966BAFE08F27A39005CB29B /* tkOldTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldTest.c; sourceTree = "<group>"; };
+ F966BAFF08F27A39005CB29B /* tkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubInit.c; sourceTree = "<group>"; };
+ F966BB0008F27A39005CB29B /* tkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubLib.c; sourceTree = "<group>"; };
+ F966BB0108F27A39005CB29B /* tkStyle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStyle.c; sourceTree = "<group>"; };
+ F966BB0208F27A39005CB29B /* tkTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTest.c; sourceTree = "<group>"; };
+ F966BB0308F27A39005CB29B /* tkText.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkText.c; sourceTree = "<group>"; };
+ F966BB0408F27A39005CB29B /* tkText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkText.h; sourceTree = "<group>"; };
+ F966BB0508F27A39005CB29B /* tkTextBTree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextBTree.c; sourceTree = "<group>"; };
+ F966BB0608F27A39005CB29B /* tkTextDisp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextDisp.c; sourceTree = "<group>"; };
+ F966BB0808F27A39005CB29B /* tkTextImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextImage.c; sourceTree = "<group>"; };
+ F966BB0908F27A39005CB29B /* tkTextIndex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextIndex.c; sourceTree = "<group>"; };
+ F966BB0A08F27A39005CB29B /* tkTextMark.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextMark.c; sourceTree = "<group>"; };
+ F966BB0B08F27A39005CB29B /* tkTextTag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextTag.c; sourceTree = "<group>"; };
+ F966BB0C08F27A39005CB29B /* tkTextWind.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTextWind.c; sourceTree = "<group>"; };
+ F966BB0D08F27A39005CB29B /* tkTrig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkTrig.c; sourceTree = "<group>"; };
+ F966BB0E08F27A39005CB29B /* tkUndo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUndo.c; sourceTree = "<group>"; };
+ F966BB0F08F27A39005CB29B /* tkUndo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUndo.h; sourceTree = "<group>"; };
+ F966BB1008F27A39005CB29B /* tkUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUtil.c; sourceTree = "<group>"; };
+ F966BB1108F27A39005CB29B /* tkVisual.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkVisual.c; sourceTree = "<group>"; };
+ F966BB1208F27A39005CB29B /* tkWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWindow.c; sourceTree = "<group>"; };
+ F966BB1408F27A39005CB29B /* bgerror.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bgerror.tcl; sourceTree = "<group>"; };
+ F966BB1508F27A39005CB29B /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F966BB1608F27A39005CB29B /* choosedir.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = choosedir.tcl; sourceTree = "<group>"; };
+ F966BB1708F27A39005CB29B /* clrpick.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.tcl; sourceTree = "<group>"; };
+ F966BB1808F27A39005CB29B /* comdlg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = comdlg.tcl; sourceTree = "<group>"; };
+ F966BB1908F27A39005CB29B /* console.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = console.tcl; sourceTree = "<group>"; };
+ F966BB1B08F27A39005CB29B /* anilabel.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = anilabel.tcl; sourceTree = "<group>"; };
+ F966BB1C08F27A39005CB29B /* aniwave.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = aniwave.tcl; sourceTree = "<group>"; };
+ F966BB1D08F27A39005CB29B /* arrow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = arrow.tcl; sourceTree = "<group>"; };
+ F966BB1E08F27A39005CB29B /* bind.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bind.tcl; sourceTree = "<group>"; };
+ F966BB1F08F27A39005CB29B /* bitmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bitmap.tcl; sourceTree = "<group>"; };
+ F966BB2008F27A39005CB29B /* browse */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = browse; sourceTree = "<group>"; };
+ F966BB2108F27A39005CB29B /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F966BB2208F27A39005CB29B /* check.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = check.tcl; sourceTree = "<group>"; };
+ F966BB2308F27A39005CB29B /* clrpick.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.tcl; sourceTree = "<group>"; };
+ F966BB2408F27A39005CB29B /* colors.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = colors.tcl; sourceTree = "<group>"; };
+ F966BB2508F27A39005CB29B /* cscroll.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cscroll.tcl; sourceTree = "<group>"; };
+ F966BB2608F27A39005CB29B /* ctext.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ctext.tcl; sourceTree = "<group>"; };
+ F966BB2708F27A39005CB29B /* dialog1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog1.tcl; sourceTree = "<group>"; };
+ F966BB2808F27A39005CB29B /* dialog2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog2.tcl; sourceTree = "<group>"; };
+ F966BB2A08F27A39005CB29B /* entry1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry1.tcl; sourceTree = "<group>"; };
+ F966BB2B08F27A39005CB29B /* entry2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry2.tcl; sourceTree = "<group>"; };
+ F966BB2C08F27A39005CB29B /* entry3.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry3.tcl; sourceTree = "<group>"; };
+ F966BB2D08F27A39005CB29B /* filebox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = filebox.tcl; sourceTree = "<group>"; };
+ F966BB2E08F27A39005CB29B /* floor.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = floor.tcl; sourceTree = "<group>"; };
+ F966BB2F08F27A39005CB29B /* form.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = form.tcl; sourceTree = "<group>"; };
+ F966BB3008F27A39005CB29B /* goldberg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = goldberg.tcl; sourceTree = "<group>"; };
+ F966BB3108F27A39005CB29B /* hello */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = hello; sourceTree = "<group>"; };
+ F966BB3208F27A39005CB29B /* hscale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = hscale.tcl; sourceTree = "<group>"; };
+ F966BB3308F27A39005CB29B /* icon.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = icon.tcl; sourceTree = "<group>"; };
+ F966BB3408F27A39005CB29B /* image1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image1.tcl; sourceTree = "<group>"; };
+ F966BB3508F27A39005CB29B /* image2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image2.tcl; sourceTree = "<group>"; };
+ F966BB4208F27A3A005CB29B /* items.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = items.tcl; sourceTree = "<group>"; };
+ F966BB4308F27A3A005CB29B /* ixset */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ixset; sourceTree = "<group>"; };
+ F966BB4408F27A3A005CB29B /* label.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = label.tcl; sourceTree = "<group>"; };
+ F966BB4508F27A3A005CB29B /* labelframe.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = labelframe.tcl; sourceTree = "<group>"; };
+ F966BB4608F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; };
+ F966BB4708F27A3A005CB29B /* menubu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubu.tcl; sourceTree = "<group>"; };
+ F966BB4808F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; };
+ F966BB4A08F27A3A005CB29B /* paned1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = paned1.tcl; sourceTree = "<group>"; };
+ F966BB4B08F27A3A005CB29B /* paned2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = paned2.tcl; sourceTree = "<group>"; };
+ F966BB4C08F27A3A005CB29B /* pendulum.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pendulum.tcl; sourceTree = "<group>"; };
+ F966BB4D08F27A3A005CB29B /* plot.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = plot.tcl; sourceTree = "<group>"; };
+ F966BB4E08F27A3A005CB29B /* puzzle.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = puzzle.tcl; sourceTree = "<group>"; };
+ F966BB4F08F27A3A005CB29B /* radio.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = radio.tcl; sourceTree = "<group>"; };
+ F966BB5008F27A3A005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BB5108F27A3A005CB29B /* rmt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = rmt; sourceTree = "<group>"; };
+ F966BB5208F27A3A005CB29B /* rolodex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = rolodex; sourceTree = "<group>"; };
+ F966BB5308F27A3A005CB29B /* ruler.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ruler.tcl; sourceTree = "<group>"; };
+ F966BB5408F27A3A005CB29B /* sayings.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = sayings.tcl; sourceTree = "<group>"; };
+ F966BB5508F27A3A005CB29B /* search.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = search.tcl; sourceTree = "<group>"; };
+ F966BB5608F27A3A005CB29B /* spin.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spin.tcl; sourceTree = "<group>"; };
+ F966BB5708F27A3A005CB29B /* square */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = square; sourceTree = "<group>"; };
+ F966BB5808F27A3A005CB29B /* states.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = states.tcl; sourceTree = "<group>"; };
+ F966BB5908F27A3A005CB29B /* style.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = style.tcl; sourceTree = "<group>"; };
+ F966BB5A08F27A3A005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F966BB5B08F27A3A005CB29B /* tcolor */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = tcolor; sourceTree = "<group>"; };
+ F966BB5C08F27A3A005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; };
+ F966BB5D08F27A3A005CB29B /* timer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = timer; sourceTree = "<group>"; };
+ F966BB5E08F27A3A005CB29B /* twind.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = twind.tcl; sourceTree = "<group>"; };
+ F966BB5F08F27A3A005CB29B /* unicodeout.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unicodeout.tcl; sourceTree = "<group>"; };
+ F966BB6008F27A3A005CB29B /* vscale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vscale.tcl; sourceTree = "<group>"; };
+ F966BB6108F27A3A005CB29B /* widget */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = widget; sourceTree = "<group>"; };
+ F966BB6208F27A3A005CB29B /* dialog.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.tcl; sourceTree = "<group>"; };
+ F966BB6308F27A3A005CB29B /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; };
+ F966BB6408F27A3A005CB29B /* focus.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.tcl; sourceTree = "<group>"; };
+ F966BB7308F27A3A005CB29B /* listbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.tcl; sourceTree = "<group>"; };
+ F966BB7408F27A3A005CB29B /* menu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.tcl; sourceTree = "<group>"; };
+ F966BB7508F27A3A005CB29B /* mkpsenc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mkpsenc.tcl; sourceTree = "<group>"; };
+ F966BB7608F27A3A005CB29B /* msgbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.tcl; sourceTree = "<group>"; };
+ F966BB8608F27A3A005CB29B /* obsolete.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obsolete.tcl; sourceTree = "<group>"; };
+ F966BB8708F27A3A005CB29B /* optMenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optMenu.tcl; sourceTree = "<group>"; };
+ F966BB8808F27A3A005CB29B /* palette.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = palette.tcl; sourceTree = "<group>"; };
+ F966BB8908F27A3B005CB29B /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
+ F966BB8B08F27A3B005CB29B /* safetk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safetk.tcl; sourceTree = "<group>"; };
+ F966BB8C08F27A3B005CB29B /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
+ F966BB8D08F27A3B005CB29B /* scrlbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrlbar.tcl; sourceTree = "<group>"; };
+ F966BB8E08F27A3B005CB29B /* spinbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.tcl; sourceTree = "<group>"; };
+ F966BB8F08F27A3B005CB29B /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F966BB9008F27A3B005CB29B /* tearoff.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tearoff.tcl; sourceTree = "<group>"; };
+ F966BB9108F27A3B005CB29B /* text.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.tcl; sourceTree = "<group>"; };
+ F966BB9208F27A3B005CB29B /* tk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.tcl; sourceTree = "<group>"; };
+ F966BB9308F27A3B005CB29B /* tkfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tkfbox.tcl; sourceTree = "<group>"; };
+ F966BB9408F27A3B005CB29B /* unsupported.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unsupported.tcl; sourceTree = "<group>"; };
+ F966BB9508F27A3B005CB29B /* xmfbox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.tcl; sourceTree = "<group>"; };
+ F966BB9608F27A3B005CB29B /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; };
+ F966BBBA08F27A3B005CB29B /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; };
+ F966BBBB08F27A3B005CB29B /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; };
+ F966BBBE08F27A3B005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tk-Info.plist.in"; sourceTree = "<group>"; };
+ F966BBC208F27A3B005CB29B /* tkMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSX.h; sourceTree = "<group>"; };
+ F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXBitmap.c; sourceTree = "<group>"; };
+ F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXButton.c; sourceTree = "<group>"; };
+ F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXClipboard.c; sourceTree = "<group>"; };
+ F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXColor.c; sourceTree = "<group>"; };
+ F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXConfig.c; sourceTree = "<group>"; };
+ F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXCursor.c; sourceTree = "<group>"; };
+ F966BBCC08F27A3B005CB29B /* tkMacOSXCursors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXCursors.h; sourceTree = "<group>"; };
+ F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDebug.c; sourceTree = "<group>"; };
+ F966BBCE08F27A3B005CB29B /* tkMacOSXDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXDebug.h; sourceTree = "<group>"; };
+ F966BBCF08F27A3B005CB29B /* tkMacOSXDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXDefault.h; sourceTree = "<group>"; };
+ F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDialog.c; sourceTree = "<group>"; };
+ F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXDraw.c; sourceTree = "<group>"; };
+ F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEmbed.c; sourceTree = "<group>"; };
+ F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEntry.c; sourceTree = "<group>"; };
+ F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXEvent.c; sourceTree = "<group>"; };
+ F966BBD508F27A3B005CB29B /* tkMacOSXEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXEvent.h; sourceTree = "<group>"; };
+ F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXFont.c; sourceTree = "<group>"; };
+ F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXHLEvents.c; sourceTree = "<group>"; };
+ F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXInit.c; sourceTree = "<group>"; };
+ F966BBDA08F27A3B005CB29B /* tkMacOSXInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXInt.h; sourceTree = "<group>"; };
+ F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXKeyboard.c; sourceTree = "<group>"; };
+ F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXKeyEvent.c; sourceTree = "<group>"; };
+ F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenu.c; sourceTree = "<group>"; };
+ F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenubutton.c; sourceTree = "<group>"; };
+ F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMenus.c; sourceTree = "<group>"; };
+ F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXMouseEvent.c; sourceTree = "<group>"; };
+ F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXNotify.c; sourceTree = "<group>"; };
+ F966BBEA08F27A3C005CB29B /* tkMacOSXPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPort.h; sourceTree = "<group>"; };
+ F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXRegion.c; sourceTree = "<group>"; };
+ F966BBEC08F27A3C005CB29B /* tkMacOSXScale.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXScale.c; sourceTree = "<group>"; };
+ F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXScrlbr.c; sourceTree = "<group>"; };
+ F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXSend.c; sourceTree = "<group>"; };
+ F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXSubwindows.c; sourceTree = "<group>"; };
+ F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXTest.c; sourceTree = "<group>"; };
+ F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXWindowEvent.c; sourceTree = "<group>"; };
+ F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXWm.c; sourceTree = "<group>"; };
+ F966BBF308F27A3C005CB29B /* tkMacOSXWm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXWm.h; sourceTree = "<group>"; };
+ F966BBF408F27A3C005CB29B /* tkMacOSXXCursors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXXCursors.h; sourceTree = "<group>"; };
+ F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = tkMacOSXXStubs.c; sourceTree = "<group>"; };
+ F966BBF708F27A3C005CB29B /* Wish-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Wish-Info.plist.in"; sourceTree = "<group>"; };
+ F966BC0308F27A3C005CB29B /* README */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = README; sourceTree = "<group>"; };
+ F966BC0508F27A3C005CB29B /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F966BC0608F27A3C005CB29B /* arc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = arc.tcl; sourceTree = "<group>"; };
+ F966BC0708F27A3C005CB29B /* bell.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bell.test; sourceTree = "<group>"; };
+ F966BC0808F27A3C005CB29B /* bevel.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bevel.tcl; sourceTree = "<group>"; };
+ F966BC0908F27A3C005CB29B /* bgerror.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bgerror.test; sourceTree = "<group>"; };
+ F966BC0A08F27A3C005CB29B /* bind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bind.test; sourceTree = "<group>"; };
+ F966BC0B08F27A3C005CB29B /* bitmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bitmap.test; sourceTree = "<group>"; };
+ F966BC0C08F27A3C005CB29B /* border.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = border.test; sourceTree = "<group>"; };
+ F966BC0D08F27A3C005CB29B /* bugs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = bugs.tcl; sourceTree = "<group>"; };
+ F966BC0E08F27A3C005CB29B /* butGeom.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = butGeom.tcl; sourceTree = "<group>"; };
+ F966BC0F08F27A3C005CB29B /* butGeom2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = butGeom2.tcl; sourceTree = "<group>"; };
+ F966BC1008F27A3C005CB29B /* button.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.test; sourceTree = "<group>"; };
+ F966BC1108F27A3C005CB29B /* canvas.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvas.test; sourceTree = "<group>"; };
+ F966BC1208F27A3C005CB29B /* canvImg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvImg.test; sourceTree = "<group>"; };
+ F966BC1308F27A3C005CB29B /* canvPs.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPs.test; sourceTree = "<group>"; };
+ F966BC1408F27A3C005CB29B /* canvPsArc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsArc.tcl; sourceTree = "<group>"; };
+ F966BC1508F27A3C005CB29B /* canvPsBmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsBmap.tcl; sourceTree = "<group>"; };
+ F966BC1608F27A3C005CB29B /* canvPsGrph.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsGrph.tcl; sourceTree = "<group>"; };
+ F966BC1708F27A3C005CB29B /* canvPsImg.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsImg.tcl; sourceTree = "<group>"; };
+ F966BC1808F27A3C005CB29B /* canvPsText.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvPsText.tcl; sourceTree = "<group>"; };
+ F966BC1908F27A3C005CB29B /* canvRect.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvRect.test; sourceTree = "<group>"; };
+ F966BC1A08F27A3C005CB29B /* canvText.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvText.test; sourceTree = "<group>"; };
+ F966BC1B08F27A3C005CB29B /* canvWind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = canvWind.test; sourceTree = "<group>"; };
+ F966BC1C08F27A3C005CB29B /* choosedir.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = choosedir.test; sourceTree = "<group>"; };
+ F966BC1D08F27A3C005CB29B /* clipboard.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clipboard.test; sourceTree = "<group>"; };
+ F966BC1E08F27A3C005CB29B /* clrpick.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clrpick.test; sourceTree = "<group>"; };
+ F966BC1F08F27A3C005CB29B /* cmap.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmap.tcl; sourceTree = "<group>"; };
+ F966BC2008F27A3C005CB29B /* cmds.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmds.test; sourceTree = "<group>"; };
+ F966BC2108F27A3C005CB29B /* color.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = color.test; sourceTree = "<group>"; };
+ F966BC2208F27A3C005CB29B /* config.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = config.test; sourceTree = "<group>"; };
+ F966BC2308F27A3C005CB29B /* constraints.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = constraints.tcl; sourceTree = "<group>"; };
+ F966BC2408F27A3C005CB29B /* cursor.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cursor.test; sourceTree = "<group>"; };
+ F966BC2508F27A3C005CB29B /* dialog.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dialog.test; sourceTree = "<group>"; };
+ F966BC2608F27A3C005CB29B /* embed.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = embed.test; sourceTree = "<group>"; };
+ F966BC2708F27A3C005CB29B /* entry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.test; sourceTree = "<group>"; };
+ F966BC2808F27A3C005CB29B /* event.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = event.test; sourceTree = "<group>"; };
+ F966BC2908F27A3C005CB29B /* filebox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = filebox.test; sourceTree = "<group>"; };
+ F966BC2A08F27A3C005CB29B /* focus.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focus.test; sourceTree = "<group>"; };
+ F966BC2B08F27A3C005CB29B /* focusTcl.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = focusTcl.test; sourceTree = "<group>"; };
+ F966BC2C08F27A3C005CB29B /* font.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = font.test; sourceTree = "<group>"; };
+ F966BC2D08F27A3C005CB29B /* frame.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = frame.test; sourceTree = "<group>"; };
+ F966BC2E08F27A3C005CB29B /* geometry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = geometry.test; sourceTree = "<group>"; };
+ F966BC2F08F27A3C005CB29B /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
+ F966BC3008F27A3C005CB29B /* grab.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grab.test; sourceTree = "<group>"; };
+ F966BC3108F27A3C005CB29B /* grid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = grid.test; sourceTree = "<group>"; };
+ F966BC3308F27A3C005CB29B /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
+ F966BC3408F27A3C005CB29B /* imgBmap.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgBmap.test; sourceTree = "<group>"; };
+ F966BC3508F27A3C005CB29B /* imgPhoto.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPhoto.test; sourceTree = "<group>"; };
+ F966BC3608F27A3C005CB29B /* imgPPM.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPPM.test; sourceTree = "<group>"; };
+ F966BC3708F27A3C005CB29B /* listbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listbox.test; sourceTree = "<group>"; };
+ F966BC3808F27A3C005CB29B /* main.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = main.test; sourceTree = "<group>"; };
+ F966BC3908F27A3C005CB29B /* menu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menu.test; sourceTree = "<group>"; };
+ F966BC3A08F27A3C005CB29B /* menubut.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubut.test; sourceTree = "<group>"; };
+ F966BC3B08F27A3C005CB29B /* menuDraw.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menuDraw.test; sourceTree = "<group>"; };
+ F966BC3C08F27A3C005CB29B /* message.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = message.test; sourceTree = "<group>"; };
+ F966BC3D08F27A3C005CB29B /* msgbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.test; sourceTree = "<group>"; };
+ F966BC3E08F27A3C005CB29B /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = "<group>"; };
+ F966BC3F08F27A3C005CB29B /* oldpack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oldpack.test; sourceTree = "<group>"; };
+ F966BC4008F27A3C005CB29B /* option.file1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file1; sourceTree = "<group>"; };
+ F966BC4108F27A3C005CB29B /* option.file2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file2; sourceTree = "<group>"; };
+ F966BC4208F27A3C005CB29B /* option.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = option.test; sourceTree = "<group>"; };
+ F966BC4308F27A3C005CB29B /* pack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pack.test; sourceTree = "<group>"; };
+ F966BC4408F27A3C005CB29B /* panedwindow.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.test; sourceTree = "<group>"; };
+ F966BC4508F27A3D005CB29B /* place.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = place.test; sourceTree = "<group>"; };
+ F966BC4608F27A3D005CB29B /* raise.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = raise.test; sourceTree = "<group>"; };
+ F966BC4708F27A3D005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BC4808F27A3D005CB29B /* safe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.test; sourceTree = "<group>"; };
+ F966BC4908F27A3D005CB29B /* scale.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.test; sourceTree = "<group>"; };
+ F966BC4A08F27A3D005CB29B /* scrollbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.test; sourceTree = "<group>"; };
+ F966BC4B08F27A3D005CB29B /* select.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = select.test; sourceTree = "<group>"; };
+ F966BC4C08F27A3D005CB29B /* send.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = send.test; sourceTree = "<group>"; };
+ F966BC4D08F27A3D005CB29B /* spinbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = spinbox.test; sourceTree = "<group>"; };
+ F966BC4E08F27A3D005CB29B /* text.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = text.test; sourceTree = "<group>"; };
+ F966BC4F08F27A3D005CB29B /* textBTree.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textBTree.test; sourceTree = "<group>"; };
+ F966BC5008F27A3D005CB29B /* textDisp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textDisp.test; sourceTree = "<group>"; };
+ F966BC5108F27A3D005CB29B /* textImage.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textImage.test; sourceTree = "<group>"; };
+ F966BC5208F27A3D005CB29B /* textIndex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textIndex.test; sourceTree = "<group>"; };
+ F966BC5308F27A3D005CB29B /* textMark.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textMark.test; sourceTree = "<group>"; };
+ F966BC5408F27A3D005CB29B /* textTag.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textTag.test; sourceTree = "<group>"; };
+ F966BC5508F27A3D005CB29B /* textWind.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textWind.test; sourceTree = "<group>"; };
+ F966BC5608F27A3D005CB29B /* tk.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tk.test; sourceTree = "<group>"; };
+ F966BC5708F27A3D005CB29B /* unixButton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixButton.test; sourceTree = "<group>"; };
+ F966BC5808F27A3D005CB29B /* unixEmbed.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixEmbed.test; sourceTree = "<group>"; };
+ F966BC5908F27A3D005CB29B /* unixFont.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFont.test; sourceTree = "<group>"; };
+ F966BC5A08F27A3D005CB29B /* unixMenu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixMenu.test; sourceTree = "<group>"; };
+ F966BC5B08F27A3D005CB29B /* unixSelect.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixSelect.test; sourceTree = "<group>"; };
+ F966BC5C08F27A3D005CB29B /* unixWm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixWm.test; sourceTree = "<group>"; };
+ F966BC5D08F27A3D005CB29B /* util.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = util.test; sourceTree = "<group>"; };
+ F966BC5E08F27A3D005CB29B /* visual.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = visual.test; sourceTree = "<group>"; };
+ F966BC5F08F27A3D005CB29B /* visual_bb.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = visual_bb.test; sourceTree = "<group>"; };
+ F966BC6008F27A3D005CB29B /* winButton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winButton.test; sourceTree = "<group>"; };
+ F966BC6108F27A3D005CB29B /* winClipboard.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winClipboard.test; sourceTree = "<group>"; };
+ F966BC6208F27A3D005CB29B /* winDialog.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winDialog.test; sourceTree = "<group>"; };
+ F966BC6308F27A3D005CB29B /* window.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = window.test; sourceTree = "<group>"; };
+ F966BC6408F27A3D005CB29B /* winfo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winfo.test; sourceTree = "<group>"; };
+ F966BC6508F27A3D005CB29B /* winFont.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFont.test; sourceTree = "<group>"; };
+ F966BC6608F27A3D005CB29B /* winMenu.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winMenu.test; sourceTree = "<group>"; };
+ F966BC6708F27A3D005CB29B /* winSend.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winSend.test; sourceTree = "<group>"; };
+ F966BC6808F27A3D005CB29B /* winWm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winWm.test; sourceTree = "<group>"; };
+ F966BC6908F27A3D005CB29B /* wm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = wm.test; sourceTree = "<group>"; };
+ F966BC6A08F27A3D005CB29B /* xmfbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xmfbox.test; sourceTree = "<group>"; };
+ F966BC6C08F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F966BC6D08F27A3D005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F966BC6E08F27A3D005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F966BC6F08F27A3D005CB29B /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = "<group>"; };
+ F966BC7008F27A3D005CB29B /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = "<group>"; };
+ F966BC7108F27A3D005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F966BC7208F27A3D005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BC7308F27A3D005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F966BC7408F27A3D005CB29B /* tk.spec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.spec; sourceTree = "<group>"; };
+ F966BC7508F27A3D005CB29B /* tkAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkAppInit.c; sourceTree = "<group>"; };
+ F966BC7608F27A3D005CB29B /* tkConfig.h.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = tkConfig.h.in; sourceTree = "<group>"; };
+ F966BC7708F27A3D005CB29B /* tkConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tkConfig.sh.in; sourceTree = "<group>"; };
+ F966BC7808F27A3D005CB29B /* tkUnix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnix.c; sourceTree = "<group>"; };
+ F966BC7908F27A3D005CB29B /* tkUnix3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnix3d.c; sourceTree = "<group>"; };
+ F966BC7A08F27A3D005CB29B /* tkUnixButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixButton.c; sourceTree = "<group>"; };
+ F966BC7B08F27A3D005CB29B /* tkUnixColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixColor.c; sourceTree = "<group>"; };
+ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixConfig.c; sourceTree = "<group>"; };
+ F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixCursor.c; sourceTree = "<group>"; };
+ F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixDefault.h; sourceTree = "<group>"; };
+ F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDialog.c; sourceTree = "<group>"; };
+ F966BC8008F27A3D005CB29B /* tkUnixDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDraw.c; sourceTree = "<group>"; };
+ F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEmbed.c; sourceTree = "<group>"; };
+ F966BC8208F27A3D005CB29B /* tkUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEvent.c; sourceTree = "<group>"; };
+ F966BC8308F27A3D005CB29B /* tkUnixFocus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixFocus.c; sourceTree = "<group>"; };
+ F966BC8408F27A3D005CB29B /* tkUnixFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixFont.c; sourceTree = "<group>"; };
+ F966BC8508F27A3D005CB29B /* tkUnixInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixInit.c; sourceTree = "<group>"; };
+ F966BC8608F27A3D005CB29B /* tkUnixInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixInt.h; sourceTree = "<group>"; };
+ F966BC8708F27A3D005CB29B /* tkUnixKey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixKey.c; sourceTree = "<group>"; };
+ F966BC8808F27A3D005CB29B /* tkUnixMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixMenu.c; sourceTree = "<group>"; };
+ F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixMenubu.c; sourceTree = "<group>"; };
+ F966BC8A08F27A3D005CB29B /* tkUnixPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixPort.h; sourceTree = "<group>"; };
+ F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixRFont.c; sourceTree = "<group>"; };
+ F966BC8C08F27A3D005CB29B /* tkUnixScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixScale.c; sourceTree = "<group>"; };
+ F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixScrlbr.c; sourceTree = "<group>"; };
+ F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixSelect.c; sourceTree = "<group>"; };
+ F966BC8F08F27A3D005CB29B /* tkUnixSend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixSend.c; sourceTree = "<group>"; };
+ F966BC9008F27A3D005CB29B /* tkUnixWm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixWm.c; sourceTree = "<group>"; };
+ F966BC9108F27A3D005CB29B /* tkUnixXId.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixXId.c; sourceTree = "<group>"; };
+ F966BC9408F27A3D005CB29B /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F966BC9508F27A3D005CB29B /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; };
+ F966BC9608F27A3E005CB29B /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F966BC9708F27A3E005CB29B /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F966BC9808F27A3E005CB29B /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
+ F966BC9908F27A3E005CB29B /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F966BC9A08F27A3E005CB29B /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
+ F966BC9B08F27A3E005CB29B /* mkd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mkd.bat; sourceTree = "<group>"; };
+ F966BC9C08F27A3E005CB29B /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
+ F966BCEE08F27A3E005CB29B /* tk.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.rc; sourceTree = "<group>"; };
+ F966BCEF08F27A3E005CB29B /* tk_base.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk_base.rc; sourceTree = "<group>"; };
+ F966BCF208F27A3E005CB29B /* wish.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = wish.rc; sourceTree = "<group>"; };
+ F966BCF308F27A3E005CB29B /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F966BCF408F27A3E005CB29B /* rmd.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rmd.bat; sourceTree = "<group>"; };
+ F966BCF508F27A3F005CB29B /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
+ F966BCF608F27A3F005CB29B /* stubs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stubs.c; sourceTree = "<group>"; };
+ F966BCF708F27A3F005CB29B /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F966BCF808F27A3F005CB29B /* tkConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tkConfig.sh.in; sourceTree = "<group>"; };
+ F966BCF908F27A3F005CB29B /* tkWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWin.h; sourceTree = "<group>"; };
+ F966BCFA08F27A3F005CB29B /* tkWin32Dll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWin32Dll.c; sourceTree = "<group>"; };
+ F966BCFB08F27A3F005CB29B /* tkWin3d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWin3d.c; sourceTree = "<group>"; };
+ F966BCFC08F27A3F005CB29B /* tkWinButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinButton.c; sourceTree = "<group>"; };
+ F966BCFD08F27A3F005CB29B /* tkWinClipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinClipboard.c; sourceTree = "<group>"; };
+ F966BCFE08F27A3F005CB29B /* tkWinColor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinColor.c; sourceTree = "<group>"; };
+ F966BCFF08F27A3F005CB29B /* tkWinConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinConfig.c; sourceTree = "<group>"; };
+ F966BD0008F27A3F005CB29B /* tkWinCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinCursor.c; sourceTree = "<group>"; };
+ F966BD0108F27A3F005CB29B /* tkWinDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinDefault.h; sourceTree = "<group>"; };
+ F966BD0208F27A3F005CB29B /* tkWinDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinDialog.c; sourceTree = "<group>"; };
+ F966BD0308F27A3F005CB29B /* tkWinDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinDraw.c; sourceTree = "<group>"; };
+ F966BD0408F27A3F005CB29B /* tkWinEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinEmbed.c; sourceTree = "<group>"; };
+ F966BD0508F27A3F005CB29B /* tkWinFont.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinFont.c; sourceTree = "<group>"; };
+ F966BD0708F27A3F005CB29B /* tkWinImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinImage.c; sourceTree = "<group>"; };
+ F966BD0808F27A3F005CB29B /* tkWinInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinInit.c; sourceTree = "<group>"; };
+ F966BD0908F27A3F005CB29B /* tkWinInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinInt.h; sourceTree = "<group>"; };
+ F966BD0A08F27A3F005CB29B /* tkWinKey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinKey.c; sourceTree = "<group>"; };
+ F966BD0B08F27A3F005CB29B /* tkWinMenu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinMenu.c; sourceTree = "<group>"; };
+ F966BD0C08F27A3F005CB29B /* tkWinPixmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinPixmap.c; sourceTree = "<group>"; };
+ F966BD0D08F27A3F005CB29B /* tkWinPointer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinPointer.c; sourceTree = "<group>"; };
+ F966BD0E08F27A3F005CB29B /* tkWinPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinPort.h; sourceTree = "<group>"; };
+ F966BD0F08F27A3F005CB29B /* tkWinRegion.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinRegion.c; sourceTree = "<group>"; };
+ F966BD1008F27A3F005CB29B /* tkWinScrlbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinScrlbr.c; sourceTree = "<group>"; };
+ F966BD1108F27A3F005CB29B /* tkWinSend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinSend.c; sourceTree = "<group>"; };
+ F966BD1208F27A3F005CB29B /* tkWinSendCom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinSendCom.c; sourceTree = "<group>"; };
+ F966BD1308F27A3F005CB29B /* tkWinSendCom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkWinSendCom.h; sourceTree = "<group>"; };
+ F966BD1408F27A3F005CB29B /* tkWinTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinTest.c; sourceTree = "<group>"; };
+ F966BD1508F27A3F005CB29B /* tkWinWindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinWindow.c; sourceTree = "<group>"; };
+ F966BD1608F27A3F005CB29B /* tkWinWm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinWm.c; sourceTree = "<group>"; };
+ F966BD1708F27A3F005CB29B /* tkWinX.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkWinX.c; sourceTree = "<group>"; };
+ F966BD1808F27A3F005CB29B /* winMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = winMain.c; sourceTree = "<group>"; };
+ F966BD1B08F27A3F005CB29B /* cursorfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cursorfont.h; sourceTree = "<group>"; };
+ F966BD1C08F27A3F005CB29B /* keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keysym.h; sourceTree = "<group>"; };
+ F966BD1D08F27A3F005CB29B /* keysymdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keysymdef.h; sourceTree = "<group>"; };
+ F966BD1E08F27A3F005CB29B /* X.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X.h; sourceTree = "<group>"; };
+ F966BD1F08F27A3F005CB29B /* Xatom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xatom.h; sourceTree = "<group>"; };
+ F966BD2008F27A3F005CB29B /* Xfuncproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xfuncproto.h; sourceTree = "<group>"; };
+ F966BD2108F27A3F005CB29B /* Xlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xlib.h; sourceTree = "<group>"; };
+ F966BD2208F27A3F005CB29B /* Xutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xutil.h; sourceTree = "<group>"; };
+ F966BD2308F27A3F005CB29B /* xbytes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xbytes.h; sourceTree = "<group>"; };
+ F966BD2408F27A3F005CB29B /* xcolors.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xcolors.c; sourceTree = "<group>"; };
+ F966BD2508F27A3F005CB29B /* xdraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xdraw.c; sourceTree = "<group>"; };
+ F966BD2608F27A3F005CB29B /* xgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xgc.c; sourceTree = "<group>"; };
+ F966BD2708F27A3F005CB29B /* ximage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ximage.c; sourceTree = "<group>"; };
+ F966BD2808F27A3F005CB29B /* xutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xutil.c; sourceTree = "<group>"; };
+ F966C07408F2820D005CB29B /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ F966C07608F2821B005CB29B /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+ F966C07808F28233005CB29B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
+ F96887E00AF786D5000797B5 /* ttk.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.decls; sourceTree = "<group>"; };
+ F96887E10AF786D5000797B5 /* ttkBlink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkBlink.c; sourceTree = "<group>"; };
+ F96887E20AF786D5000797B5 /* ttkButton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkButton.c; sourceTree = "<group>"; };
+ F96887E30AF786D5000797B5 /* ttkCache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkCache.c; sourceTree = "<group>"; };
+ F96887E40AF786D5000797B5 /* ttkClamTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkClamTheme.c; sourceTree = "<group>"; };
+ F96887E50AF786D5000797B5 /* ttkClassicTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkClassicTheme.c; sourceTree = "<group>"; };
+ F96887E60AF786D5000797B5 /* ttkDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkDecls.h; sourceTree = "<group>"; };
+ F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkDefaultTheme.c; sourceTree = "<group>"; };
+ F96887E80AF786D5000797B5 /* ttkElements.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkElements.c; sourceTree = "<group>"; };
+ F96887E90AF786D5000797B5 /* ttkEntry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkEntry.c; sourceTree = "<group>"; };
+ F96887EA0AF786D5000797B5 /* ttkFrame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkFrame.c; sourceTree = "<group>"; };
+ F96887EB0AF786D5000797B5 /* ttkImage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkImage.c; sourceTree = "<group>"; };
+ F96887EC0AF786D5000797B5 /* ttkInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkInit.c; sourceTree = "<group>"; };
+ F96887ED0AF786D5000797B5 /* ttkLabel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkLabel.c; sourceTree = "<group>"; };
+ F96887EE0AF786D5000797B5 /* ttkLayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkLayout.c; sourceTree = "<group>"; };
+ F96887EF0AF786D5000797B5 /* ttkManager.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkManager.c; sourceTree = "<group>"; };
+ F96887F00AF786D5000797B5 /* ttkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkManager.h; sourceTree = "<group>"; };
+ F96887F10AF786D5000797B5 /* ttkNotebook.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkNotebook.c; sourceTree = "<group>"; };
+ F96887F20AF786D5000797B5 /* ttkPanedwindow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkPanedwindow.c; sourceTree = "<group>"; };
+ F96887F30AF786D5000797B5 /* ttkProgress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkProgress.c; sourceTree = "<group>"; };
+ F96887F40AF786D5000797B5 /* ttkScale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScale.c; sourceTree = "<group>"; };
+ F96887F50AF786D5000797B5 /* ttkScroll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScroll.c; sourceTree = "<group>"; };
+ F96887F60AF786D5000797B5 /* ttkScrollbar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkScrollbar.c; sourceTree = "<group>"; };
+ F96887F70AF786D5000797B5 /* ttkSeparator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkSeparator.c; sourceTree = "<group>"; };
+ F96887F80AF786D5000797B5 /* ttkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkSquare.c; sourceTree = "<group>"; };
+ F96887F90AF786D5000797B5 /* ttkState.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkState.c; sourceTree = "<group>"; };
+ F96887FA0AF786D5000797B5 /* ttkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkStubInit.c; sourceTree = "<group>"; };
+ F96887FB0AF786D5000797B5 /* ttkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkStubLib.c; sourceTree = "<group>"; };
+ F96887FC0AF786D5000797B5 /* ttkTagSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTagSet.c; sourceTree = "<group>"; };
+ F96887FD0AF786D5000797B5 /* ttkTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTheme.c; sourceTree = "<group>"; };
+ F96887FE0AF786D5000797B5 /* ttkTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkTheme.h; sourceTree = "<group>"; };
+ F96887FF0AF786D5000797B5 /* ttkThemeInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkThemeInt.h; sourceTree = "<group>"; };
+ F96888000AF786D5000797B5 /* ttkTrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTrace.c; sourceTree = "<group>"; };
+ F96888010AF786D5000797B5 /* ttkTrack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTrack.c; sourceTree = "<group>"; };
+ F96888020AF786D5000797B5 /* ttkTreeview.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkTreeview.c; sourceTree = "<group>"; };
+ F96888030AF786D5000797B5 /* ttkWidget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWidget.c; sourceTree = "<group>"; };
+ F96888040AF786D5000797B5 /* ttkWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ttkWidget.h; sourceTree = "<group>"; };
+ F96888370AF787B3000797B5 /* altTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = altTheme.tcl; sourceTree = "<group>"; };
+ F96888380AF787B3000797B5 /* aquaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = aquaTheme.tcl; sourceTree = "<group>"; };
+ F96888390AF787B3000797B5 /* button.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = button.tcl; sourceTree = "<group>"; };
+ F968883A0AF787B3000797B5 /* clamTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clamTheme.tcl; sourceTree = "<group>"; };
+ F968883B0AF787B3000797B5 /* classicTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = classicTheme.tcl; sourceTree = "<group>"; };
+ F968883C0AF787B3000797B5 /* combobox.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combobox.tcl; sourceTree = "<group>"; };
+ F968883D0AF787B3000797B5 /* cursors.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cursors.tcl; sourceTree = "<group>"; };
+ F968883E0AF787B3000797B5 /* defaults.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = defaults.tcl; sourceTree = "<group>"; };
+ F96888400AF787B3000797B5 /* entry.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.tcl; sourceTree = "<group>"; };
+ F96888410AF787B3000797B5 /* fonts.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fonts.tcl; sourceTree = "<group>"; };
+ F96888440AF787B3000797B5 /* menubutton.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = menubutton.tcl; sourceTree = "<group>"; };
+ F96888450AF787B3000797B5 /* notebook.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notebook.tcl; sourceTree = "<group>"; };
+ F96888460AF787B3000797B5 /* panedwindow.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.tcl; sourceTree = "<group>"; };
+ F96888470AF787B3000797B5 /* progress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = progress.tcl; sourceTree = "<group>"; };
+ F96888480AF787B3000797B5 /* scale.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scale.tcl; sourceTree = "<group>"; };
+ F96888490AF787B3000797B5 /* scrollbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.tcl; sourceTree = "<group>"; };
+ F968884A0AF787B3000797B5 /* sizegrip.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = sizegrip.tcl; sourceTree = "<group>"; };
+ F968884B0AF787B3000797B5 /* treeview.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treeview.tcl; sourceTree = "<group>"; };
+ F968884C0AF787B3000797B5 /* ttk.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.tcl; sourceTree = "<group>"; };
+ F968884D0AF787B3000797B5 /* utils.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = utils.tcl; sourceTree = "<group>"; };
+ F968884E0AF787B3000797B5 /* winTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTheme.tcl; sourceTree = "<group>"; };
+ F968884F0AF787B3000797B5 /* xpTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = xpTheme.tcl; sourceTree = "<group>"; };
+ F96888540AF7880C000797B5 /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F96888560AF7880C000797B5 /* combobox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combobox.test; sourceTree = "<group>"; };
+ F96888570AF7880C000797B5 /* entry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = entry.test; sourceTree = "<group>"; };
+ F96888580AF7880C000797B5 /* image.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = image.test; sourceTree = "<group>"; };
+ F96888590AF7880C000797B5 /* labelframe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = labelframe.test; sourceTree = "<group>"; };
+ F968885A0AF7880C000797B5 /* layout.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = layout.test; sourceTree = "<group>"; };
+ F968885C0AF7880C000797B5 /* notebook.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notebook.test; sourceTree = "<group>"; };
+ F968885D0AF7880C000797B5 /* panedwindow.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = panedwindow.test; sourceTree = "<group>"; };
+ F968885E0AF7880C000797B5 /* progressbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = progressbar.test; sourceTree = "<group>"; };
+ F968885F0AF7880C000797B5 /* scrollbar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scrollbar.test; sourceTree = "<group>"; };
+ F96888600AF7880C000797B5 /* treetags.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treetags.test; sourceTree = "<group>"; };
+ F96888610AF7880C000797B5 /* treeview.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = treeview.test; sourceTree = "<group>"; };
+ F96888620AF7880C000797B5 /* ttk.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttk.test; sourceTree = "<group>"; };
+ F96888630AF7880C000797B5 /* validate.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = validate.test; sourceTree = "<group>"; };
+ F968886B0AF788F6000797B5 /* ttk_button.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_button.n; sourceTree = "<group>"; };
+ F968886C0AF788F6000797B5 /* ttk_checkbutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_checkbutton.n; sourceTree = "<group>"; };
+ F968886D0AF788F6000797B5 /* ttk_combobox.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_combobox.n; sourceTree = "<group>"; };
+ F968886F0AF788F6000797B5 /* ttk_entry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_entry.n; sourceTree = "<group>"; };
+ F96888700AF788F6000797B5 /* ttk_frame.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_frame.n; sourceTree = "<group>"; };
+ F96888710AF788F6000797B5 /* ttk_Geometry.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_Geometry.3; sourceTree = "<group>"; };
+ F96888720AF788F6000797B5 /* ttk_image.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_image.n; sourceTree = "<group>"; };
+ F96888730AF788F6000797B5 /* ttk_intro.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_intro.n; sourceTree = "<group>"; };
+ F96888740AF788F6000797B5 /* ttk_label.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_label.n; sourceTree = "<group>"; };
+ F96888750AF788F6000797B5 /* ttk_labelframe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_labelframe.n; sourceTree = "<group>"; };
+ F96888760AF788F6000797B5 /* ttk_menubutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_menubutton.n; sourceTree = "<group>"; };
+ F96888770AF788F6000797B5 /* ttk_notebook.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_notebook.n; sourceTree = "<group>"; };
+ F96888780AF788F6000797B5 /* ttk_panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_panedwindow.n; sourceTree = "<group>"; };
+ F96888790AF788F6000797B5 /* ttk_progressbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_progressbar.n; sourceTree = "<group>"; };
+ F968887A0AF788F6000797B5 /* ttk_radiobutton.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_radiobutton.n; sourceTree = "<group>"; };
+ F968887B0AF788F6000797B5 /* ttk_scrollbar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_scrollbar.n; sourceTree = "<group>"; };
+ F968887C0AF788F6000797B5 /* ttk_separator.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_separator.n; sourceTree = "<group>"; };
+ F968887D0AF788F6000797B5 /* ttk_sizegrip.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_sizegrip.n; sourceTree = "<group>"; };
+ F968887E0AF788F6000797B5 /* ttk_style.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_style.n; sourceTree = "<group>"; };
+ F968887F0AF788F6000797B5 /* ttk_Theme.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_Theme.3; sourceTree = "<group>"; };
+ F96888800AF788F6000797B5 /* ttk_treeview.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_treeview.n; sourceTree = "<group>"; };
+ F96888810AF788F6000797B5 /* ttk_widget.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ttk_widget.n; sourceTree = "<group>"; };
+ F96888840AF78938000797B5 /* ttkMacOSXTheme.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = ttkMacOSXTheme.c; sourceTree = "<group>"; };
+ F96888860AF78953000797B5 /* ttkWinMonitor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinMonitor.c; sourceTree = "<group>"; };
+ F96888870AF78953000797B5 /* ttkWinTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinTheme.c; sourceTree = "<group>"; };
+ F96888880AF78953000797B5 /* ttkWinXPTheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ttkWinXPTheme.c; sourceTree = "<group>"; };
+ F96D3DFA08F272A4004A47F5 /* ChangeLog */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = ChangeLog; sourceTree = "<group>"; };
+ F96D3DFB08F272A4004A47F5 /* changes */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = changes; sourceTree = "<group>"; };
+ F96D3DFD08F272A4004A47F5 /* Access.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Access.3; sourceTree = "<group>"; };
+ F96D3DFE08F272A4004A47F5 /* AddErrInfo.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AddErrInfo.3; sourceTree = "<group>"; };
+ F96D3DFF08F272A4004A47F5 /* after.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = after.n; sourceTree = "<group>"; };
+ F96D3E0008F272A4004A47F5 /* Alloc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Alloc.3; sourceTree = "<group>"; };
+ F96D3E0108F272A4004A47F5 /* AllowExc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AllowExc.3; sourceTree = "<group>"; };
+ F96D3E0208F272A4004A47F5 /* append.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = append.n; sourceTree = "<group>"; };
+ F96D3E0308F272A4004A47F5 /* AppInit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AppInit.3; sourceTree = "<group>"; };
+ F96D3E0408F272A5004A47F5 /* array.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = array.n; sourceTree = "<group>"; };
+ F96D3E0508F272A5004A47F5 /* AssocData.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = AssocData.3; sourceTree = "<group>"; };
+ F96D3E0608F272A5004A47F5 /* Async.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Async.3; sourceTree = "<group>"; };
+ F96D3E0708F272A5004A47F5 /* BackgdErr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BackgdErr.3; sourceTree = "<group>"; };
+ F96D3E0808F272A5004A47F5 /* Backslash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Backslash.3; sourceTree = "<group>"; };
+ F96D3E0908F272A5004A47F5 /* bgerror.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = bgerror.n; sourceTree = "<group>"; };
+ F96D3E0A08F272A5004A47F5 /* binary.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = binary.n; sourceTree = "<group>"; };
+ F96D3E0B08F272A5004A47F5 /* BoolObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = BoolObj.3; sourceTree = "<group>"; };
+ F96D3E0C08F272A5004A47F5 /* break.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = break.n; sourceTree = "<group>"; };
+ F96D3E0D08F272A5004A47F5 /* ByteArrObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ByteArrObj.3; sourceTree = "<group>"; };
+ F96D3E0E08F272A5004A47F5 /* CallDel.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CallDel.3; sourceTree = "<group>"; };
+ F96D3E0F08F272A5004A47F5 /* case.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = case.n; sourceTree = "<group>"; };
+ F96D3E1008F272A5004A47F5 /* catch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = catch.n; sourceTree = "<group>"; };
+ F96D3E1108F272A5004A47F5 /* cd.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = cd.n; sourceTree = "<group>"; };
+ F96D3E1208F272A5004A47F5 /* chan.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = chan.n; sourceTree = "<group>"; };
+ F96D3E1308F272A5004A47F5 /* ChnlStack.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ChnlStack.3; sourceTree = "<group>"; };
+ F96D3E1408F272A5004A47F5 /* clock.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = clock.n; sourceTree = "<group>"; };
+ F96D3E1508F272A5004A47F5 /* close.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = close.n; sourceTree = "<group>"; };
+ F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CmdCmplt.3; sourceTree = "<group>"; };
+ F96D3E1708F272A5004A47F5 /* Concat.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Concat.3; sourceTree = "<group>"; };
+ F96D3E1808F272A5004A47F5 /* concat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = concat.n; sourceTree = "<group>"; };
+ F96D3E1908F272A5004A47F5 /* continue.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = continue.n; sourceTree = "<group>"; };
+ F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtChannel.3; sourceTree = "<group>"; };
+ F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtChnlHdlr.3; sourceTree = "<group>"; };
+ F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCloseHdlr.3; sourceTree = "<group>"; };
+ F96D3E1D08F272A5004A47F5 /* CrtCommand.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtCommand.3; sourceTree = "<group>"; };
+ F96D3E1E08F272A5004A47F5 /* CrtFileHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtFileHdlr.3; sourceTree = "<group>"; };
+ F96D3E1F08F272A5004A47F5 /* CrtInterp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtInterp.3; sourceTree = "<group>"; };
+ F96D3E2008F272A5004A47F5 /* CrtMathFnc.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtMathFnc.3; sourceTree = "<group>"; };
+ F96D3E2108F272A5004A47F5 /* CrtObjCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtObjCmd.3; sourceTree = "<group>"; };
+ F96D3E2208F272A5004A47F5 /* CrtSlave.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtSlave.3; sourceTree = "<group>"; };
+ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtTimerHdlr.3; sourceTree = "<group>"; };
+ F96D3E2408F272A5004A47F5 /* CrtTrace.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = CrtTrace.3; sourceTree = "<group>"; };
+ F96D3E2508F272A5004A47F5 /* dde.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dde.n; sourceTree = "<group>"; };
+ F96D3E2608F272A5004A47F5 /* DetachPids.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DetachPids.3; sourceTree = "<group>"; };
+ F96D3E2708F272A5004A47F5 /* dict.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = dict.n; sourceTree = "<group>"; };
+ F96D3E2808F272A5004A47F5 /* DictObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DictObj.3; sourceTree = "<group>"; };
+ F96D3E2908F272A5004A47F5 /* DoOneEvent.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoOneEvent.3; sourceTree = "<group>"; };
+ F96D3E2A08F272A5004A47F5 /* DoubleObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoubleObj.3; sourceTree = "<group>"; };
+ F96D3E2B08F272A5004A47F5 /* DoWhenIdle.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DoWhenIdle.3; sourceTree = "<group>"; };
+ F96D3E2C08F272A5004A47F5 /* DString.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DString.3; sourceTree = "<group>"; };
+ F96D3E2D08F272A5004A47F5 /* DumpActiveMemory.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = DumpActiveMemory.3; sourceTree = "<group>"; };
+ F96D3E2E08F272A5004A47F5 /* Encoding.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Encoding.3; sourceTree = "<group>"; };
+ F96D3E2F08F272A5004A47F5 /* encoding.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = encoding.n; sourceTree = "<group>"; };
+ F96D3E3008F272A5004A47F5 /* Ensemble.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Ensemble.3; sourceTree = "<group>"; };
+ F96D3E3108F272A5004A47F5 /* Environment.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Environment.3; sourceTree = "<group>"; };
+ F96D3E3208F272A5004A47F5 /* eof.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = eof.n; sourceTree = "<group>"; };
+ F96D3E3308F272A5004A47F5 /* error.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = error.n; sourceTree = "<group>"; };
+ F96D3E3408F272A5004A47F5 /* Eval.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Eval.3; sourceTree = "<group>"; };
+ F96D3E3508F272A5004A47F5 /* eval.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = eval.n; sourceTree = "<group>"; };
+ F96D3E3608F272A5004A47F5 /* exec.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = exec.n; sourceTree = "<group>"; };
+ F96D3E3708F272A5004A47F5 /* Exit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Exit.3; sourceTree = "<group>"; };
+ F96D3E3808F272A5004A47F5 /* exit.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = exit.n; sourceTree = "<group>"; };
+ F96D3E3908F272A5004A47F5 /* expr.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = expr.n; sourceTree = "<group>"; };
+ F96D3E3A08F272A5004A47F5 /* ExprLong.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ExprLong.3; sourceTree = "<group>"; };
+ F96D3E3B08F272A5004A47F5 /* ExprLongObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ExprLongObj.3; sourceTree = "<group>"; };
+ F96D3E3C08F272A5004A47F5 /* fblocked.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fblocked.n; sourceTree = "<group>"; };
+ F96D3E3D08F272A5004A47F5 /* fconfigure.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fconfigure.n; sourceTree = "<group>"; };
+ F96D3E3E08F272A5004A47F5 /* fcopy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fcopy.n; sourceTree = "<group>"; };
+ F96D3E3F08F272A5004A47F5 /* file.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = file.n; sourceTree = "<group>"; };
+ F96D3E4008F272A5004A47F5 /* fileevent.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fileevent.n; sourceTree = "<group>"; };
+ F96D3E4108F272A5004A47F5 /* filename.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = filename.n; sourceTree = "<group>"; };
+ F96D3E4208F272A5004A47F5 /* FileSystem.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FileSystem.3; sourceTree = "<group>"; };
+ F96D3E4308F272A5004A47F5 /* FindExec.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = FindExec.3; sourceTree = "<group>"; };
+ F96D3E4408F272A5004A47F5 /* flush.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = flush.n; sourceTree = "<group>"; };
+ F96D3E4508F272A5004A47F5 /* for.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = for.n; sourceTree = "<group>"; };
+ F96D3E4608F272A5004A47F5 /* foreach.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = foreach.n; sourceTree = "<group>"; };
+ F96D3E4708F272A5004A47F5 /* format.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = format.n; sourceTree = "<group>"; };
+ F96D3E4808F272A5004A47F5 /* GetCwd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetCwd.3; sourceTree = "<group>"; };
+ F96D3E4908F272A5004A47F5 /* GetHostName.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetHostName.3; sourceTree = "<group>"; };
+ F96D3E4A08F272A5004A47F5 /* GetIndex.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetIndex.3; sourceTree = "<group>"; };
+ F96D3E4B08F272A5004A47F5 /* GetInt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetInt.3; sourceTree = "<group>"; };
+ F96D3E4C08F272A5004A47F5 /* GetOpnFl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetOpnFl.3; sourceTree = "<group>"; };
+ F96D3E4D08F272A5004A47F5 /* gets.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = gets.n; sourceTree = "<group>"; };
+ F96D3E4E08F272A5004A47F5 /* GetStdChan.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetStdChan.3; sourceTree = "<group>"; };
+ F96D3E4F08F272A5004A47F5 /* GetTime.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetTime.3; sourceTree = "<group>"; };
+ F96D3E5008F272A5004A47F5 /* GetVersion.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = GetVersion.3; sourceTree = "<group>"; };
+ F96D3E5108F272A5004A47F5 /* glob.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = glob.n; sourceTree = "<group>"; };
+ F96D3E5208F272A6004A47F5 /* global.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = global.n; sourceTree = "<group>"; };
+ F96D3E5308F272A6004A47F5 /* Hash.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Hash.3; sourceTree = "<group>"; };
+ F96D3E5408F272A6004A47F5 /* history.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = history.n; sourceTree = "<group>"; };
+ F96D3E5508F272A6004A47F5 /* http.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = http.n; sourceTree = "<group>"; };
+ F96D3E5608F272A6004A47F5 /* if.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = if.n; sourceTree = "<group>"; };
+ F96D3E5708F272A6004A47F5 /* incr.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = incr.n; sourceTree = "<group>"; };
+ F96D3E5808F272A6004A47F5 /* info.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = info.n; sourceTree = "<group>"; };
+ F96D3E5908F272A6004A47F5 /* Init.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Init.3; sourceTree = "<group>"; };
+ F96D3E5A08F272A6004A47F5 /* InitStubs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = InitStubs.3; sourceTree = "<group>"; };
+ F96D3E5B08F272A6004A47F5 /* Interp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Interp.3; sourceTree = "<group>"; };
+ F96D3E5C08F272A6004A47F5 /* interp.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = interp.n; sourceTree = "<group>"; };
+ F96D3E5D08F272A6004A47F5 /* IntObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = IntObj.3; sourceTree = "<group>"; };
+ F96D3E5E08F272A6004A47F5 /* join.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = join.n; sourceTree = "<group>"; };
+ F96D3E5F08F272A6004A47F5 /* lappend.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lappend.n; sourceTree = "<group>"; };
+ F96D3E6008F272A6004A47F5 /* lassign.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lassign.n; sourceTree = "<group>"; };
+ F96D3E6108F272A6004A47F5 /* library.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = library.n; sourceTree = "<group>"; };
+ F96D3E6208F272A6004A47F5 /* Limit.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Limit.3; sourceTree = "<group>"; };
+ F96D3E6308F272A6004A47F5 /* lindex.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lindex.n; sourceTree = "<group>"; };
+ F96D3E6408F272A6004A47F5 /* LinkVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = LinkVar.3; sourceTree = "<group>"; };
+ F96D3E6508F272A6004A47F5 /* linsert.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = linsert.n; sourceTree = "<group>"; };
+ F96D3E6608F272A6004A47F5 /* list.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = list.n; sourceTree = "<group>"; };
+ F96D3E6708F272A6004A47F5 /* ListObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ListObj.3; sourceTree = "<group>"; };
+ F96D3E6808F272A6004A47F5 /* llength.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = llength.n; sourceTree = "<group>"; };
+ F96D3E6908F272A6004A47F5 /* load.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = load.n; sourceTree = "<group>"; };
+ F96D3E6A08F272A6004A47F5 /* lrange.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lrange.n; sourceTree = "<group>"; };
+ F96D3E6B08F272A6004A47F5 /* lrepeat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lrepeat.n; sourceTree = "<group>"; };
+ F96D3E6C08F272A6004A47F5 /* lreplace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lreplace.n; sourceTree = "<group>"; };
+ F96D3E6D08F272A6004A47F5 /* lsearch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lsearch.n; sourceTree = "<group>"; };
+ F96D3E6E08F272A6004A47F5 /* lset.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lset.n; sourceTree = "<group>"; };
+ F96D3E6F08F272A6004A47F5 /* lsort.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = lsort.n; sourceTree = "<group>"; };
+ F96D3E7008F272A6004A47F5 /* man.macros */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = man.macros; sourceTree = "<group>"; };
+ F96D3E7108F272A6004A47F5 /* mathfunc.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = mathfunc.n; sourceTree = "<group>"; };
+ F96D3E7208F272A6004A47F5 /* memory.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = memory.n; sourceTree = "<group>"; };
+ F96D3E7308F272A6004A47F5 /* msgcat.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = msgcat.n; sourceTree = "<group>"; };
+ F96D3E7408F272A6004A47F5 /* Namespace.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Namespace.3; sourceTree = "<group>"; };
+ F96D3E7508F272A6004A47F5 /* namespace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = namespace.n; sourceTree = "<group>"; };
+ F96D3E7608F272A6004A47F5 /* Notifier.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Notifier.3; sourceTree = "<group>"; };
+ F96D3E7708F272A6004A47F5 /* Object.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Object.3; sourceTree = "<group>"; };
+ F96D3E7808F272A6004A47F5 /* ObjectType.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ObjectType.3; sourceTree = "<group>"; };
+ F96D3E7908F272A6004A47F5 /* open.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = open.n; sourceTree = "<group>"; };
+ F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OpenFileChnl.3; sourceTree = "<group>"; };
+ F96D3E7B08F272A6004A47F5 /* OpenTcp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OpenTcp.3; sourceTree = "<group>"; };
+ F96D3E7C08F272A6004A47F5 /* package.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = package.n; sourceTree = "<group>"; };
+ F96D3E7D08F272A6004A47F5 /* packagens.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = packagens.n; sourceTree = "<group>"; };
+ F96D3E7E08F272A6004A47F5 /* Panic.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Panic.3; sourceTree = "<group>"; };
+ F96D3E7F08F272A6004A47F5 /* ParseCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ParseCmd.3; sourceTree = "<group>"; };
+ F96D3E8008F272A6004A47F5 /* pid.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pid.n; sourceTree = "<group>"; };
+ F96D3E8108F272A6004A47F5 /* pkgMkIndex.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pkgMkIndex.n; sourceTree = "<group>"; };
+ F96D3E8208F272A6004A47F5 /* PkgRequire.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = PkgRequire.3; sourceTree = "<group>"; };
+ F96D3E8308F272A6004A47F5 /* Preserve.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Preserve.3; sourceTree = "<group>"; };
+ F96D3E8408F272A6004A47F5 /* PrintDbl.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = PrintDbl.3; sourceTree = "<group>"; };
+ F96D3E8508F272A6004A47F5 /* proc.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = proc.n; sourceTree = "<group>"; };
+ F96D3E8608F272A6004A47F5 /* puts.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = puts.n; sourceTree = "<group>"; };
+ F96D3E8708F272A6004A47F5 /* pwd.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pwd.n; sourceTree = "<group>"; };
+ F96D3E8808F272A6004A47F5 /* re_syntax.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = re_syntax.n; sourceTree = "<group>"; };
+ F96D3E8908F272A6004A47F5 /* read.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = read.n; sourceTree = "<group>"; };
+ F96D3E8A08F272A6004A47F5 /* RecEvalObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RecEvalObj.3; sourceTree = "<group>"; };
+ F96D3E8B08F272A6004A47F5 /* RecordEval.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RecordEval.3; sourceTree = "<group>"; };
+ F96D3E8C08F272A6004A47F5 /* RegConfig.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RegConfig.3; sourceTree = "<group>"; };
+ F96D3E8D08F272A6004A47F5 /* RegExp.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = RegExp.3; sourceTree = "<group>"; };
+ F96D3E8E08F272A6004A47F5 /* regexp.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = regexp.n; sourceTree = "<group>"; };
+ F96D3E8F08F272A6004A47F5 /* registry.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = registry.n; sourceTree = "<group>"; };
+ F96D3E9008F272A6004A47F5 /* regsub.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = regsub.n; sourceTree = "<group>"; };
+ F96D3E9108F272A6004A47F5 /* rename.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = rename.n; sourceTree = "<group>"; };
+ F96D3E9208F272A6004A47F5 /* return.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = return.n; sourceTree = "<group>"; };
+ F96D3E9308F272A6004A47F5 /* safe.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = safe.n; sourceTree = "<group>"; };
+ F96D3E9408F272A6004A47F5 /* SaveResult.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SaveResult.3; sourceTree = "<group>"; };
+ F96D3E9508F272A6004A47F5 /* scan.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = scan.n; sourceTree = "<group>"; };
+ F96D3E9608F272A6004A47F5 /* seek.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = seek.n; sourceTree = "<group>"; };
+ F96D3E9708F272A6004A47F5 /* set.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = set.n; sourceTree = "<group>"; };
+ F96D3E9808F272A6004A47F5 /* SetChanErr.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetChanErr.3; sourceTree = "<group>"; };
+ F96D3E9908F272A6004A47F5 /* SetErrno.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetErrno.3; sourceTree = "<group>"; };
+ F96D3E9A08F272A6004A47F5 /* SetRecLmt.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetRecLmt.3; sourceTree = "<group>"; };
+ F96D3E9B08F272A7004A47F5 /* SetResult.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetResult.3; sourceTree = "<group>"; };
+ F96D3E9C08F272A7004A47F5 /* SetVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SetVar.3; sourceTree = "<group>"; };
+ F96D3E9D08F272A7004A47F5 /* Signal.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Signal.3; sourceTree = "<group>"; };
+ F96D3E9E08F272A7004A47F5 /* Sleep.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Sleep.3; sourceTree = "<group>"; };
+ F96D3E9F08F272A7004A47F5 /* socket.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = socket.n; sourceTree = "<group>"; };
+ F96D3EA008F272A7004A47F5 /* source.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = source.n; sourceTree = "<group>"; };
+ F96D3EA108F272A7004A47F5 /* SourceRCFile.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SourceRCFile.3; sourceTree = "<group>"; };
+ F96D3EA208F272A7004A47F5 /* split.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = split.n; sourceTree = "<group>"; };
+ F96D3EA308F272A7004A47F5 /* SplitList.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SplitList.3; sourceTree = "<group>"; };
+ F96D3EA408F272A7004A47F5 /* SplitPath.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SplitPath.3; sourceTree = "<group>"; };
+ F96D3EA508F272A7004A47F5 /* StaticPkg.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StaticPkg.3; sourceTree = "<group>"; };
+ F96D3EA608F272A7004A47F5 /* StdChannels.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StdChannels.3; sourceTree = "<group>"; };
+ F96D3EA708F272A7004A47F5 /* string.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = string.n; sourceTree = "<group>"; };
+ F96D3EA808F272A7004A47F5 /* StringObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StringObj.3; sourceTree = "<group>"; };
+ F96D3EA908F272A7004A47F5 /* StrMatch.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = StrMatch.3; sourceTree = "<group>"; };
+ F96D3EAA08F272A7004A47F5 /* subst.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = subst.n; sourceTree = "<group>"; };
+ F96D3EAB08F272A7004A47F5 /* SubstObj.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = SubstObj.3; sourceTree = "<group>"; };
+ F96D3EAC08F272A7004A47F5 /* switch.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = switch.n; sourceTree = "<group>"; };
+ F96D3EAD08F272A7004A47F5 /* Tcl.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tcl.n; sourceTree = "<group>"; };
+ F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Tcl_Main.3; sourceTree = "<group>"; };
+ F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TCL_MEM_DEBUG.3; sourceTree = "<group>"; };
+ F96D3EB008F272A7004A47F5 /* tclsh.1 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tclsh.1; sourceTree = "<group>"; };
+ F96D3EB108F272A7004A47F5 /* tcltest.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tcltest.n; sourceTree = "<group>"; };
+ F96D3EB208F272A7004A47F5 /* tclvars.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tclvars.n; sourceTree = "<group>"; };
+ F96D3EB308F272A7004A47F5 /* tell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tell.n; sourceTree = "<group>"; };
+ F96D3EB408F272A7004A47F5 /* Thread.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Thread.3; sourceTree = "<group>"; };
+ F96D3EB508F272A7004A47F5 /* time.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = time.n; sourceTree = "<group>"; };
+ F96D3EB608F272A7004A47F5 /* tm.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tm.n; sourceTree = "<group>"; };
+ F96D3EB708F272A7004A47F5 /* ToUpper.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = ToUpper.3; sourceTree = "<group>"; };
+ F96D3EB808F272A7004A47F5 /* trace.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = trace.n; sourceTree = "<group>"; };
+ F96D3EB908F272A7004A47F5 /* TraceCmd.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TraceCmd.3; sourceTree = "<group>"; };
+ F96D3EBA08F272A7004A47F5 /* TraceVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TraceVar.3; sourceTree = "<group>"; };
+ F96D3EBB08F272A7004A47F5 /* Translate.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Translate.3; sourceTree = "<group>"; };
+ F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = UniCharIsAlpha.3; sourceTree = "<group>"; };
+ F96D3EBD08F272A7004A47F5 /* unknown.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unknown.n; sourceTree = "<group>"; };
+ F96D3EBE08F272A7004A47F5 /* unload.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unload.n; sourceTree = "<group>"; };
+ F96D3EBF08F272A7004A47F5 /* unset.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = unset.n; sourceTree = "<group>"; };
+ F96D3EC008F272A7004A47F5 /* update.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = update.n; sourceTree = "<group>"; };
+ F96D3EC108F272A7004A47F5 /* uplevel.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = uplevel.n; sourceTree = "<group>"; };
+ F96D3EC208F272A7004A47F5 /* UpVar.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = UpVar.3; sourceTree = "<group>"; };
+ F96D3EC308F272A7004A47F5 /* upvar.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = upvar.n; sourceTree = "<group>"; };
+ F96D3EC408F272A7004A47F5 /* Utf.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Utf.3; sourceTree = "<group>"; };
+ F96D3EC508F272A7004A47F5 /* variable.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = variable.n; sourceTree = "<group>"; };
+ F96D3EC608F272A7004A47F5 /* vwait.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = vwait.n; sourceTree = "<group>"; };
+ F96D3EC708F272A7004A47F5 /* while.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = while.n; sourceTree = "<group>"; };
+ F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = WrongNumArgs.3; sourceTree = "<group>"; };
+ F96D3ECA08F272A7004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D3ECB08F272A7004A47F5 /* regc_color.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_color.c; sourceTree = "<group>"; };
+ F96D3ECC08F272A7004A47F5 /* regc_cvec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_cvec.c; sourceTree = "<group>"; };
+ F96D3ECD08F272A7004A47F5 /* regc_lex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_lex.c; sourceTree = "<group>"; };
+ F96D3ECE08F272A7004A47F5 /* regc_locale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_locale.c; sourceTree = "<group>"; };
+ F96D3ECF08F272A7004A47F5 /* regc_nfa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regc_nfa.c; sourceTree = "<group>"; };
+ F96D3ED008F272A7004A47F5 /* regcomp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regcomp.c; sourceTree = "<group>"; };
+ F96D3ED108F272A7004A47F5 /* regcustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regcustom.h; sourceTree = "<group>"; };
+ F96D3ED208F272A7004A47F5 /* rege_dfa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rege_dfa.c; sourceTree = "<group>"; };
+ F96D3ED308F272A7004A47F5 /* regerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regerror.c; sourceTree = "<group>"; };
+ F96D3ED408F272A7004A47F5 /* regerrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regerrs.h; sourceTree = "<group>"; };
+ F96D3ED508F272A7004A47F5 /* regex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regex.h; sourceTree = "<group>"; };
+ F96D3ED608F272A7004A47F5 /* regexec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regexec.c; sourceTree = "<group>"; };
+ F96D3ED708F272A7004A47F5 /* regfree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regfree.c; sourceTree = "<group>"; };
+ F96D3ED808F272A7004A47F5 /* regfronts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = regfronts.c; sourceTree = "<group>"; };
+ F96D3ED908F272A7004A47F5 /* regguts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regguts.h; sourceTree = "<group>"; };
+ F96D3EDA08F272A7004A47F5 /* tcl.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcl.decls; sourceTree = "<group>"; };
+ F96D3EDB08F272A7004A47F5 /* tcl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcl.h; sourceTree = "<group>"; };
+ F96D3EDC08F272A7004A47F5 /* tclAlloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAlloc.c; sourceTree = "<group>"; };
+ F96D3EDD08F272A7004A47F5 /* tclAsync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAsync.c; sourceTree = "<group>"; };
+ F96D3EDE08F272A7004A47F5 /* tclBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclBasic.c; sourceTree = "<group>"; };
+ F96D3EDF08F272A7004A47F5 /* tclBinary.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclBinary.c; sourceTree = "<group>"; };
+ F96D3EE008F272A7004A47F5 /* tclCkalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCkalloc.c; sourceTree = "<group>"; };
+ F96D3EE108F272A7004A47F5 /* tclClock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclClock.c; sourceTree = "<group>"; };
+ F96D3EE208F272A7004A47F5 /* tclCmdAH.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdAH.c; sourceTree = "<group>"; };
+ F96D3EE308F272A7004A47F5 /* tclCmdIL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdIL.c; sourceTree = "<group>"; };
+ F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCmdMZ.c; sourceTree = "<group>"; };
+ F96D3EE508F272A7004A47F5 /* tclCompCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompCmds.c; sourceTree = "<group>"; };
+ F96D3EE608F272A7004A47F5 /* tclCompExpr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompExpr.c; sourceTree = "<group>"; };
+ F96D3EE708F272A7004A47F5 /* tclCompile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclCompile.c; sourceTree = "<group>"; };
+ F96D3EE808F272A7004A47F5 /* tclCompile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclCompile.h; sourceTree = "<group>"; };
+ F96D3EE908F272A7004A47F5 /* tclConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclConfig.c; sourceTree = "<group>"; };
+ F96D3EEA08F272A7004A47F5 /* tclDate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclDate.c; sourceTree = "<group>"; };
+ F96D3EEB08F272A7004A47F5 /* tclDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclDecls.h; sourceTree = "<group>"; };
+ F96D3EEC08F272A7004A47F5 /* tclDictObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclDictObj.c; sourceTree = "<group>"; };
+ F96D3EED08F272A7004A47F5 /* tclEncoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEncoding.c; sourceTree = "<group>"; };
+ F96D3EEE08F272A7004A47F5 /* tclEnv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEnv.c; sourceTree = "<group>"; };
+ F96D3EEF08F272A7004A47F5 /* tclEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclEvent.c; sourceTree = "<group>"; };
+ F96D3EF008F272A7004A47F5 /* tclExecute.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclExecute.c; sourceTree = "<group>"; };
+ F96D3EF108F272A7004A47F5 /* tclFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclFCmd.c; sourceTree = "<group>"; };
+ F96D3EF208F272A7004A47F5 /* tclFileName.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclFileName.c; sourceTree = "<group>"; };
+ F96D3EF308F272A7004A47F5 /* tclFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclFileSystem.h; sourceTree = "<group>"; };
+ F96D3EF408F272A7004A47F5 /* tclGet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclGet.c; sourceTree = "<group>"; };
+ F96D3EF508F272A7004A47F5 /* tclGetDate.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = tclGetDate.y; sourceTree = "<group>"; };
+ F96D3EF608F272A7004A47F5 /* tclHash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclHash.c; sourceTree = "<group>"; };
+ F96D3EF708F272A7004A47F5 /* tclHistory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclHistory.c; sourceTree = "<group>"; };
+ F96D3EF808F272A7004A47F5 /* tclIndexObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIndexObj.c; sourceTree = "<group>"; };
+ F96D3EF908F272A7004A47F5 /* tclInt.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclInt.decls; sourceTree = "<group>"; };
+ F96D3EFA08F272A7004A47F5 /* tclInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclInt.h; sourceTree = "<group>"; };
+ F96D3EFB08F272A7004A47F5 /* tclIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIntDecls.h; sourceTree = "<group>"; };
+ F96D3EFC08F272A7004A47F5 /* tclInterp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclInterp.c; sourceTree = "<group>"; };
+ F96D3EFD08F272A7004A47F5 /* tclIntPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIntPlatDecls.h; sourceTree = "<group>"; };
+ F96D3EFE08F272A7004A47F5 /* tclIO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIO.c; sourceTree = "<group>"; };
+ F96D3EFF08F272A7004A47F5 /* tclIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclIO.h; sourceTree = "<group>"; };
+ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOCmd.c; sourceTree = "<group>"; };
+ F96D3F0108F272A7004A47F5 /* tclIOGT.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOGT.c; sourceTree = "<group>"; };
+ F96D3F0208F272A7004A47F5 /* tclIORChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORChan.c; sourceTree = "<group>"; };
+ F96D3F0308F272A7004A47F5 /* tclIOSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOSock.c; sourceTree = "<group>"; };
+ F96D3F0408F272A7004A47F5 /* tclIOUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIOUtil.c; sourceTree = "<group>"; };
+ F96D3F0508F272A7004A47F5 /* tclLink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLink.c; sourceTree = "<group>"; };
+ F96D3F0608F272A7004A47F5 /* tclListObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclListObj.c; sourceTree = "<group>"; };
+ F96D3F0708F272A7004A47F5 /* tclLiteral.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLiteral.c; sourceTree = "<group>"; };
+ F96D3F0808F272A7004A47F5 /* tclLoad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoad.c; sourceTree = "<group>"; };
+ F96D3F0908F272A7004A47F5 /* tclLoadNone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadNone.c; sourceTree = "<group>"; };
+ F96D3F0A08F272A7004A47F5 /* tclMain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMain.c; sourceTree = "<group>"; };
+ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclNamesp.c; sourceTree = "<group>"; };
+ F96D3F0C08F272A7004A47F5 /* tclNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclNotify.c; sourceTree = "<group>"; };
+ F96D3F0D08F272A7004A47F5 /* tclObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclObj.c; sourceTree = "<group>"; };
+ F96D3F0E08F272A7004A47F5 /* tclPanic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPanic.c; sourceTree = "<group>"; };
+ F96D3F0F08F272A7004A47F5 /* tclParse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclParse.c; sourceTree = "<group>"; };
+ F96D3F1108F272A7004A47F5 /* tclPathObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPathObj.c; sourceTree = "<group>"; };
+ F96D3F1208F272A7004A47F5 /* tclPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPipe.c; sourceTree = "<group>"; };
+ F96D3F1308F272A7004A47F5 /* tclPkg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPkg.c; sourceTree = "<group>"; };
+ F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPkgConfig.c; sourceTree = "<group>"; };
+ F96D3F1508F272A7004A47F5 /* tclPlatDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclPlatDecls.h; sourceTree = "<group>"; };
+ F96D3F1608F272A7004A47F5 /* tclPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclPort.h; sourceTree = "<group>"; };
+ F96D3F1708F272A7004A47F5 /* tclPosixStr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPosixStr.c; sourceTree = "<group>"; };
+ F96D3F1808F272A7004A47F5 /* tclPreserve.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclPreserve.c; sourceTree = "<group>"; };
+ F96D3F1908F272A7004A47F5 /* tclProc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclProc.c; sourceTree = "<group>"; };
+ F96D3F1A08F272A7004A47F5 /* tclRegexp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclRegexp.c; sourceTree = "<group>"; };
+ F96D3F1B08F272A7004A47F5 /* tclRegexp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclRegexp.h; sourceTree = "<group>"; };
+ F96D3F1C08F272A7004A47F5 /* tclResolve.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclResolve.c; sourceTree = "<group>"; };
+ F96D3F1D08F272A7004A47F5 /* tclResult.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclResult.c; sourceTree = "<group>"; };
+ F96D3F1E08F272A7004A47F5 /* tclScan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclScan.c; sourceTree = "<group>"; };
+ F96D3F1F08F272A7004A47F5 /* tclStringObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStringObj.c; sourceTree = "<group>"; };
+ F96D3F2408F272A7004A47F5 /* tclStrToD.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStrToD.c; sourceTree = "<group>"; };
+ F96D3F2508F272A7004A47F5 /* tclStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStubInit.c; sourceTree = "<group>"; };
+ F96D3F2608F272A7004A47F5 /* tclStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclStubLib.c; sourceTree = "<group>"; };
+ F96D3F2708F272A7004A47F5 /* tclTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTest.c; sourceTree = "<group>"; };
+ F96D3F2808F272A7004A47F5 /* tclTestObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTestObj.c; sourceTree = "<group>"; };
+ F96D3F2908F272A7004A47F5 /* tclTestProcBodyObj.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTestProcBodyObj.c; sourceTree = "<group>"; };
+ F96D3F2A08F272A7004A47F5 /* tclThread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThread.c; sourceTree = "<group>"; };
+ F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadAlloc.c; sourceTree = "<group>"; };
+ F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadJoin.c; sourceTree = "<group>"; };
+ F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadStorage.c; sourceTree = "<group>"; };
+ F96D3F2E08F272A7004A47F5 /* tclThreadTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclThreadTest.c; sourceTree = "<group>"; };
+ F96D3F2F08F272A7004A47F5 /* tclTimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTimer.c; sourceTree = "<group>"; };
+ F96D3F3008F272A7004A47F5 /* tclTomMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMath.h; sourceTree = "<group>"; };
+ F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTomMathInterface.c; sourceTree = "<group>"; };
+ F96D3F3208F272A7004A47F5 /* tclTrace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclTrace.c; sourceTree = "<group>"; };
+ F96D3F3308F272A7004A47F5 /* tclUniData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUniData.c; sourceTree = "<group>"; };
+ F96D3F3408F272A7004A47F5 /* tclUtf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUtf.c; sourceTree = "<group>"; };
+ F96D3F3508F272A7004A47F5 /* tclUtil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUtil.c; sourceTree = "<group>"; };
+ F96D3F3608F272A7004A47F5 /* tclVar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclVar.c; sourceTree = "<group>"; };
+ F96D3F3708F272A7004A47F5 /* tommath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath.h; sourceTree = "<group>"; };
+ F96D3F3908F272A8004A47F5 /* auto.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = auto.tcl; sourceTree = "<group>"; };
+ F96D3F3A08F272A8004A47F5 /* clock.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clock.tcl; sourceTree = "<group>"; };
+ F96D3F3C08F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F8C08F272A8004A47F5 /* history.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = history.tcl; sourceTree = "<group>"; };
+ F96D3F8E08F272A8004A47F5 /* http.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.tcl; sourceTree = "<group>"; };
+ F96D3F8F08F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F9108F272A8004A47F5 /* http.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.tcl; sourceTree = "<group>"; };
+ F96D3F9208F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D3F9308F272A8004A47F5 /* init.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = init.tcl; sourceTree = "<group>"; };
+ F96D3F9508F272A8004A47F5 /* msgcat.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgcat.tcl; sourceTree = "<group>"; };
+ F96D3F9608F272A8004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401808F272AA004A47F5 /* optparse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = optparse.tcl; sourceTree = "<group>"; };
+ F96D401908F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401A08F272AA004A47F5 /* package.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = package.tcl; sourceTree = "<group>"; };
+ F96D401B08F272AA004A47F5 /* parray.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parray.tcl; sourceTree = "<group>"; };
+ F96D401D08F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D401E08F272AA004A47F5 /* safe.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.tcl; sourceTree = "<group>"; };
+ F96D401F08F272AA004A47F5 /* tclIndex */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclIndex; sourceTree = "<group>"; };
+ F96D402108F272AA004A47F5 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F96D402208F272AA004A47F5 /* tcltest.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcltest.tcl; sourceTree = "<group>"; };
+ F96D402308F272AA004A47F5 /* tm.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tm.tcl; sourceTree = "<group>"; };
+ F96D425B08F272B2004A47F5 /* word.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = word.tcl; sourceTree = "<group>"; };
+ F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_mul_digs.c; sourceTree = "<group>"; };
+ F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_fast_s_mp_sqr.c; sourceTree = "<group>"; };
+ F96D426908F272B3004A47F5 /* bn_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add.c; sourceTree = "<group>"; };
+ F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_add_d.c; sourceTree = "<group>"; };
+ F96D426C08F272B3004A47F5 /* bn_mp_and.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_and.c; sourceTree = "<group>"; };
+ F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clamp.c; sourceTree = "<group>"; };
+ F96D426E08F272B3004A47F5 /* bn_mp_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear.c; sourceTree = "<group>"; };
+ F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_clear_multi.c; sourceTree = "<group>"; };
+ F96D427008F272B3004A47F5 /* bn_mp_cmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp.c; sourceTree = "<group>"; };
+ F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_d.c; sourceTree = "<group>"; };
+ F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_cmp_mag.c; sourceTree = "<group>"; };
+ F96D427408F272B3004A47F5 /* bn_mp_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_copy.c; sourceTree = "<group>"; };
+ F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_count_bits.c; sourceTree = "<group>"; };
+ F96D427608F272B3004A47F5 /* bn_mp_div.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div.c; sourceTree = "<group>"; };
+ F96D427708F272B3004A47F5 /* bn_mp_div_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2.c; sourceTree = "<group>"; };
+ F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_2d.c; sourceTree = "<group>"; };
+ F96D427908F272B3004A47F5 /* bn_mp_div_3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_3.c; sourceTree = "<group>"; };
+ F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_div_d.c; sourceTree = "<group>"; };
+ F96D427E08F272B3004A47F5 /* bn_mp_exch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_exch.c; sourceTree = "<group>"; };
+ F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_expt_d.c; sourceTree = "<group>"; };
+ F96D428708F272B3004A47F5 /* bn_mp_grow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_grow.c; sourceTree = "<group>"; };
+ F96D428808F272B3004A47F5 /* bn_mp_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init.c; sourceTree = "<group>"; };
+ F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_copy.c; sourceTree = "<group>"; };
+ F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_multi.c; sourceTree = "<group>"; };
+ F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_set.c; sourceTree = "<group>"; };
+ F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_init_size.c; sourceTree = "<group>"; };
+ F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_mul.c; sourceTree = "<group>"; };
+ F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_karatsuba_sqr.c; sourceTree = "<group>"; };
+ F96D429508F272B3004A47F5 /* bn_mp_lshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_lshd.c; sourceTree = "<group>"; };
+ F96D429608F272B3004A47F5 /* bn_mp_mod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod.c; sourceTree = "<group>"; };
+ F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mod_2d.c; sourceTree = "<group>"; };
+ F96D429C08F272B3004A47F5 /* bn_mp_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul.c; sourceTree = "<group>"; };
+ F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2.c; sourceTree = "<group>"; };
+ F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_2d.c; sourceTree = "<group>"; };
+ F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_mul_d.c; sourceTree = "<group>"; };
+ F96D42A208F272B3004A47F5 /* bn_mp_neg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_neg.c; sourceTree = "<group>"; };
+ F96D42A308F272B3004A47F5 /* bn_mp_or.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_or.c; sourceTree = "<group>"; };
+ F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_size.c; sourceTree = "<group>"; };
+ F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_radix_smap.c; sourceTree = "<group>"; };
+ F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_read_radix.c; sourceTree = "<group>"; };
+ F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_rshd.c; sourceTree = "<group>"; };
+ F96D42BA08F272B3004A47F5 /* bn_mp_set.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_set.c; sourceTree = "<group>"; };
+ F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_shrink.c; sourceTree = "<group>"; };
+ F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqr.c; sourceTree = "<group>"; };
+ F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sqrt.c; sourceTree = "<group>"; };
+ F96D42C108F272B3004A47F5 /* bn_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub.c; sourceTree = "<group>"; };
+ F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_sub_d.c; sourceTree = "<group>"; };
+ F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin.c; sourceTree = "<group>"; };
+ F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_to_unsigned_bin_n.c; sourceTree = "<group>"; };
+ F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_mul.c; sourceTree = "<group>"; };
+ F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toom_sqr.c; sourceTree = "<group>"; };
+ F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_toradix_n.c; sourceTree = "<group>"; };
+ F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_unsigned_bin_size.c; sourceTree = "<group>"; };
+ F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_xor.c; sourceTree = "<group>"; };
+ F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_mp_zero.c; sourceTree = "<group>"; };
+ F96D42D008F272B3004A47F5 /* bn_reverse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_reverse.c; sourceTree = "<group>"; };
+ F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_add.c; sourceTree = "<group>"; };
+ F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_mul_digs.c; sourceTree = "<group>"; };
+ F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sqr.c; sourceTree = "<group>"; };
+ F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bn_s_mp_sub.c; sourceTree = "<group>"; };
+ F96D42D708F272B3004A47F5 /* bncore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bncore.c; sourceTree = "<group>"; };
+ F96D432908F272B4004A47F5 /* tommath_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_class.h; sourceTree = "<group>"; };
+ F96D432A08F272B4004A47F5 /* tommath_superclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tommath_superclass.h; sourceTree = "<group>"; };
+ F96D432B08F272B4004A47F5 /* license.terms */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = license.terms; sourceTree = "<group>"; };
+ F96D432E08F272B5004A47F5 /* configure.ac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure.ac; sourceTree = "<group>"; };
+ F96D432F08F272B5004A47F5 /* GNUmakefile */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = GNUmakefile; sourceTree = "<group>"; };
+ F96D433108F272B5004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D433208F272B5004A47F5 /* Tcl-Info.plist.in */ = {isa = PBXFileReference; explicitFileType = text.plist; fileEncoding = 4; path = "Tcl-Info.plist.in"; sourceTree = "<group>"; };
+ F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXBundle.c; sourceTree = "<group>"; };
+ F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXFCmd.c; sourceTree = "<group>"; };
+ F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclMacOSXNotify.c; sourceTree = "<group>"; };
+ F96D434308F272B5004A47F5 /* README */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = README; sourceTree = "<group>"; };
+ F96D434508F272B5004A47F5 /* all.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = all.tcl; sourceTree = "<group>"; };
+ F96D434608F272B5004A47F5 /* append.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = append.test; sourceTree = "<group>"; };
+ F96D434708F272B5004A47F5 /* appendComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = appendComp.test; sourceTree = "<group>"; };
+ F96D434808F272B5004A47F5 /* assocd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = assocd.test; sourceTree = "<group>"; };
+ F96D434908F272B5004A47F5 /* async.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = async.test; sourceTree = "<group>"; };
+ F96D434A08F272B5004A47F5 /* autoMkindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = autoMkindex.test; sourceTree = "<group>"; };
+ F96D434B08F272B5004A47F5 /* basic.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = basic.test; sourceTree = "<group>"; };
+ F96D434C08F272B5004A47F5 /* binary.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = binary.test; sourceTree = "<group>"; };
+ F96D434D08F272B5004A47F5 /* case.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = case.test; sourceTree = "<group>"; };
+ F96D434E08F272B5004A47F5 /* chan.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chan.test; sourceTree = "<group>"; };
+ F96D434F08F272B5004A47F5 /* clock.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = clock.test; sourceTree = "<group>"; };
+ F96D435008F272B5004A47F5 /* cmdAH.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdAH.test; sourceTree = "<group>"; };
+ F96D435108F272B5004A47F5 /* cmdIL.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdIL.test; sourceTree = "<group>"; };
+ F96D435208F272B5004A47F5 /* cmdInfo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdInfo.test; sourceTree = "<group>"; };
+ F96D435308F272B5004A47F5 /* cmdMZ.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = cmdMZ.test; sourceTree = "<group>"; };
+ F96D435408F272B5004A47F5 /* compExpr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "compExpr-old.test"; sourceTree = "<group>"; };
+ F96D435508F272B5004A47F5 /* compExpr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = compExpr.test; sourceTree = "<group>"; };
+ F96D435608F272B5004A47F5 /* compile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = compile.test; sourceTree = "<group>"; };
+ F96D435708F272B5004A47F5 /* concat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = concat.test; sourceTree = "<group>"; };
+ F96D435808F272B5004A47F5 /* config.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = config.test; sourceTree = "<group>"; };
+ F96D435908F272B5004A47F5 /* dcall.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dcall.test; sourceTree = "<group>"; };
+ F96D435A08F272B5004A47F5 /* dict.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dict.test; sourceTree = "<group>"; };
+ F96D435C08F272B5004A47F5 /* dstring.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = dstring.test; sourceTree = "<group>"; };
+ F96D435E08F272B5004A47F5 /* encoding.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = encoding.test; sourceTree = "<group>"; };
+ F96D435F08F272B5004A47F5 /* env.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = env.test; sourceTree = "<group>"; };
+ F96D436008F272B5004A47F5 /* error.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = error.test; sourceTree = "<group>"; };
+ F96D436108F272B5004A47F5 /* eval.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eval.test; sourceTree = "<group>"; };
+ F96D436208F272B5004A47F5 /* event.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = event.test; sourceTree = "<group>"; };
+ F96D436308F272B5004A47F5 /* exec.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = exec.test; sourceTree = "<group>"; };
+ F96D436408F272B5004A47F5 /* execute.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = execute.test; sourceTree = "<group>"; };
+ F96D436508F272B5004A47F5 /* expr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "expr-old.test"; sourceTree = "<group>"; };
+ F96D436608F272B5004A47F5 /* expr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = expr.test; sourceTree = "<group>"; };
+ F96D436708F272B6004A47F5 /* fCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fCmd.test; sourceTree = "<group>"; };
+ F96D436808F272B6004A47F5 /* fileName.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fileName.test; sourceTree = "<group>"; };
+ F96D436908F272B6004A47F5 /* fileSystem.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fileSystem.test; sourceTree = "<group>"; };
+ F96D436A08F272B6004A47F5 /* for-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "for-old.test"; sourceTree = "<group>"; };
+ F96D436B08F272B6004A47F5 /* for.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = for.test; sourceTree = "<group>"; };
+ F96D436C08F272B6004A47F5 /* foreach.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = foreach.test; sourceTree = "<group>"; };
+ F96D436D08F272B6004A47F5 /* format.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = format.test; sourceTree = "<group>"; };
+ F96D436E08F272B6004A47F5 /* get.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = get.test; sourceTree = "<group>"; };
+ F96D436F08F272B6004A47F5 /* history.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = history.test; sourceTree = "<group>"; };
+ F96D437008F272B6004A47F5 /* http.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http.test; sourceTree = "<group>"; };
+ F96D437108F272B6004A47F5 /* httpd */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpd; sourceTree = "<group>"; };
+ F96D437208F272B6004A47F5 /* httpold.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpold.test; sourceTree = "<group>"; };
+ F96D437308F272B6004A47F5 /* if-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "if-old.test"; sourceTree = "<group>"; };
+ F96D437408F272B6004A47F5 /* if.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = if.test; sourceTree = "<group>"; };
+ F96D437508F272B6004A47F5 /* incr-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "incr-old.test"; sourceTree = "<group>"; };
+ F96D437608F272B6004A47F5 /* incr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = incr.test; sourceTree = "<group>"; };
+ F96D437708F272B6004A47F5 /* indexObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = indexObj.test; sourceTree = "<group>"; };
+ F96D437808F272B6004A47F5 /* info.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = info.test; sourceTree = "<group>"; };
+ F96D437908F272B6004A47F5 /* init.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = init.test; sourceTree = "<group>"; };
+ F96D437A08F272B6004A47F5 /* interp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = interp.test; sourceTree = "<group>"; };
+ F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = "<group>"; };
+ F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = "<group>"; };
+ F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = "<group>"; };
+ F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = "<group>"; };
+ F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = "<group>"; };
+ F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = "<group>"; };
+ F96D438208F272B6004A47F5 /* linsert.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = linsert.test; sourceTree = "<group>"; };
+ F96D438308F272B6004A47F5 /* list.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = list.test; sourceTree = "<group>"; };
+ F96D438408F272B6004A47F5 /* listObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = listObj.test; sourceTree = "<group>"; };
+ F96D438508F272B6004A47F5 /* llength.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = llength.test; sourceTree = "<group>"; };
+ F96D438608F272B6004A47F5 /* load.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = load.test; sourceTree = "<group>"; };
+ F96D438708F272B6004A47F5 /* lrange.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lrange.test; sourceTree = "<group>"; };
+ F96D438808F272B6004A47F5 /* lrepeat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lrepeat.test; sourceTree = "<group>"; };
+ F96D438908F272B6004A47F5 /* lreplace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lreplace.test; sourceTree = "<group>"; };
+ F96D438A08F272B6004A47F5 /* lsearch.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lsearch.test; sourceTree = "<group>"; };
+ F96D438B08F272B6004A47F5 /* lset.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lset.test; sourceTree = "<group>"; };
+ F96D438C08F272B6004A47F5 /* lsetComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lsetComp.test; sourceTree = "<group>"; };
+ F96D438D08F272B6004A47F5 /* macOSXFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXFCmd.test; sourceTree = "<group>"; };
+ F96D438E08F272B6004A47F5 /* main.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = main.test; sourceTree = "<group>"; };
+ F96D438F08F272B6004A47F5 /* misc.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = misc.test; sourceTree = "<group>"; };
+ F96D439008F272B6004A47F5 /* msgcat.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgcat.test; sourceTree = "<group>"; };
+ F96D439108F272B6004A47F5 /* namespace-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "namespace-old.test"; sourceTree = "<group>"; };
+ F96D439208F272B7004A47F5 /* namespace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = namespace.test; sourceTree = "<group>"; };
+ F96D439308F272B7004A47F5 /* notify.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = notify.test; sourceTree = "<group>"; };
+ F96D439408F272B7004A47F5 /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = "<group>"; };
+ F96D439508F272B7004A47F5 /* opt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = opt.test; sourceTree = "<group>"; };
+ F96D439608F272B7004A47F5 /* package.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = package.test; sourceTree = "<group>"; };
+ F96D439708F272B7004A47F5 /* parse.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parse.test; sourceTree = "<group>"; };
+ F96D439808F272B7004A47F5 /* parseExpr.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parseExpr.test; sourceTree = "<group>"; };
+ F96D439908F272B7004A47F5 /* parseOld.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = parseOld.test; sourceTree = "<group>"; };
+ F96D439A08F272B7004A47F5 /* pid.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pid.test; sourceTree = "<group>"; };
+ F96D439B08F272B7004A47F5 /* pkg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkg.test; sourceTree = "<group>"; };
+ F96D439C08F272B7004A47F5 /* pkgMkIndex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgMkIndex.test; sourceTree = "<group>"; };
+ F96D439D08F272B7004A47F5 /* platform.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.test; sourceTree = "<group>"; };
+ F96D439E08F272B7004A47F5 /* proc-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "proc-old.test"; sourceTree = "<group>"; };
+ F96D439F08F272B7004A47F5 /* proc.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = proc.test; sourceTree = "<group>"; };
+ F96D43A008F272B7004A47F5 /* pwd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pwd.test; sourceTree = "<group>"; };
+ F96D43A108F272B7004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D43A208F272B7004A47F5 /* reg.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = reg.test; sourceTree = "<group>"; };
+ F96D43A308F272B7004A47F5 /* regexp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexp.test; sourceTree = "<group>"; };
+ F96D43A408F272B7004A47F5 /* regexpComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpComp.test; sourceTree = "<group>"; };
+ F96D43A508F272B7004A47F5 /* registry.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = registry.test; sourceTree = "<group>"; };
+ F96D43A608F272B7004A47F5 /* remote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = remote.tcl; sourceTree = "<group>"; };
+ F96D43A708F272B7004A47F5 /* rename.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = rename.test; sourceTree = "<group>"; };
+ F96D43A808F272B7004A47F5 /* result.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = result.test; sourceTree = "<group>"; };
+ F96D43A908F272B7004A47F5 /* safe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = safe.test; sourceTree = "<group>"; };
+ F96D43AA08F272B7004A47F5 /* scan.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = scan.test; sourceTree = "<group>"; };
+ F96D43AB08F272B7004A47F5 /* security.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = security.test; sourceTree = "<group>"; };
+ F96D43AC08F272B7004A47F5 /* set-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "set-old.test"; sourceTree = "<group>"; };
+ F96D43AD08F272B7004A47F5 /* set.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = set.test; sourceTree = "<group>"; };
+ F96D43AE08F272B7004A47F5 /* socket.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = socket.test; sourceTree = "<group>"; };
+ F96D43AF08F272B7004A47F5 /* source.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = source.test; sourceTree = "<group>"; };
+ F96D43B008F272B7004A47F5 /* split.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = split.test; sourceTree = "<group>"; };
+ F96D43B108F272B7004A47F5 /* stack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stack.test; sourceTree = "<group>"; };
+ F96D43B208F272B7004A47F5 /* string.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = string.test; sourceTree = "<group>"; };
+ F96D43B308F272B7004A47F5 /* stringComp.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stringComp.test; sourceTree = "<group>"; };
+ F96D43B408F272B7004A47F5 /* stringObj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = stringObj.test; sourceTree = "<group>"; };
+ F96D43B508F272B7004A47F5 /* subst.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = subst.test; sourceTree = "<group>"; };
+ F96D43B608F272B7004A47F5 /* switch.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = switch.test; sourceTree = "<group>"; };
+ F96D43B708F272B7004A47F5 /* tcltest.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tcltest.test; sourceTree = "<group>"; };
+ F96D43B808F272B7004A47F5 /* thread.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = thread.test; sourceTree = "<group>"; };
+ F96D43B908F272B7004A47F5 /* timer.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = timer.test; sourceTree = "<group>"; };
+ F96D43BA08F272B7004A47F5 /* tm.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tm.test; sourceTree = "<group>"; };
+ F96D43BB08F272B7004A47F5 /* trace.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = trace.test; sourceTree = "<group>"; };
+ F96D43BC08F272B7004A47F5 /* unixFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFCmd.test; sourceTree = "<group>"; };
+ F96D43BD08F272B7004A47F5 /* unixFile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixFile.test; sourceTree = "<group>"; };
+ F96D43BE08F272B7004A47F5 /* unixInit.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixInit.test; sourceTree = "<group>"; };
+ F96D43BF08F272B7004A47F5 /* unixNotfy.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unixNotfy.test; sourceTree = "<group>"; };
+ F96D43C008F272B7004A47F5 /* unknown.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unknown.test; sourceTree = "<group>"; };
+ F96D43C108F272B7004A47F5 /* unload.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = unload.test; sourceTree = "<group>"; };
+ F96D43C208F272B7004A47F5 /* uplevel.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uplevel.test; sourceTree = "<group>"; };
+ F96D43C308F272B7004A47F5 /* upvar.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = upvar.test; sourceTree = "<group>"; };
+ F96D43C408F272B7004A47F5 /* utf.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = utf.test; sourceTree = "<group>"; };
+ F96D43C508F272B7004A47F5 /* util.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = util.test; sourceTree = "<group>"; };
+ F96D43C608F272B7004A47F5 /* var.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = var.test; sourceTree = "<group>"; };
+ F96D43C708F272B7004A47F5 /* while-old.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "while-old.test"; sourceTree = "<group>"; };
+ F96D43C808F272B7004A47F5 /* while.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = while.test; sourceTree = "<group>"; };
+ F96D43C908F272B7004A47F5 /* winConsole.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winConsole.test; sourceTree = "<group>"; };
+ F96D43CA08F272B7004A47F5 /* winDde.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winDde.test; sourceTree = "<group>"; };
+ F96D43CB08F272B7004A47F5 /* winFCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFCmd.test; sourceTree = "<group>"; };
+ F96D43CC08F272B7004A47F5 /* winFile.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winFile.test; sourceTree = "<group>"; };
+ F96D43CD08F272B7004A47F5 /* winNotify.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winNotify.test; sourceTree = "<group>"; };
+ F96D43CE08F272B7004A47F5 /* winPipe.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winPipe.test; sourceTree = "<group>"; };
+ F96D43CF08F272B7004A47F5 /* winTime.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = winTime.test; sourceTree = "<group>"; };
+ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = "<group>"; };
+ F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = "<group>"; };
+ F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = "<group>"; };
+ F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = "<group>"; };
+ F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = "<group>"; };
+ F96D442808F272B8004A47F5 /* installData.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = installData.tcl; sourceTree = "<group>"; };
+ F96D442908F272B8004A47F5 /* loadICU.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = loadICU.tcl; sourceTree = "<group>"; };
+ F96D442A08F272B8004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D442B08F272B8004A47F5 /* makeTestCases.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = makeTestCases.tcl; sourceTree = "<group>"; };
+ F96D442C08F272B8004A47F5 /* man2help.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help.tcl; sourceTree = "<group>"; };
+ F96D442D08F272B8004A47F5 /* man2help2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2help2.tcl; sourceTree = "<group>"; };
+ F96D442E08F272B8004A47F5 /* man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html.tcl; sourceTree = "<group>"; };
+ F96D442F08F272B8004A47F5 /* man2html1.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html1.tcl; sourceTree = "<group>"; };
+ F96D443008F272B8004A47F5 /* man2html2.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = man2html2.tcl; sourceTree = "<group>"; };
+ F96D443108F272B8004A47F5 /* man2tcl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = man2tcl.c; sourceTree = "<group>"; };
+ F96D443208F272B8004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D443308F272B8004A47F5 /* regexpTestLib.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = regexpTestLib.tcl; sourceTree = "<group>"; };
+ F96D443508F272B8004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
+ F96D443608F272B8004A47F5 /* tcl.wse.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.wse.in; sourceTree = "<group>"; };
+ F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = "tcltk-man2html.tcl"; sourceTree = "<group>"; };
+ F96D443A08F272B9004A47F5 /* tclZIC.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclZIC.tcl; sourceTree = "<group>"; };
+ F96D443B08F272B9004A47F5 /* uniClass.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniClass.tcl; sourceTree = "<group>"; };
+ F96D443C08F272B9004A47F5 /* uniParse.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = uniParse.tcl; sourceTree = "<group>"; };
+ F96D444008F272B9004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F96D444108F272B9004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D444208F272B9004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D444408F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D444508F272B9004A47F5 /* pkga.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkga.c; sourceTree = "<group>"; };
+ F96D444608F272B9004A47F5 /* pkgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgb.c; sourceTree = "<group>"; };
+ F96D444708F272B9004A47F5 /* pkgc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgc.c; sourceTree = "<group>"; };
+ F96D444808F272B9004A47F5 /* pkgd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgd.c; sourceTree = "<group>"; };
+ F96D444908F272B9004A47F5 /* pkge.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkge.c; sourceTree = "<group>"; };
+ F96D444B08F272B9004A47F5 /* pkgua.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkgua.c; sourceTree = "<group>"; };
+ F96D444C08F272B9004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D444D08F272B9004A47F5 /* install-sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-sh"; sourceTree = "<group>"; };
+ F96D444E08F272B9004A47F5 /* installManPage */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = installManPage; sourceTree = "<group>"; };
+ F96D444F08F272B9004A47F5 /* ldAix */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ldAix; sourceTree = "<group>"; };
+ F96D445008F272B9004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D445208F272B9004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D445308F272B9004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F96D445408F272B9004A47F5 /* tcl.spec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.spec; sourceTree = "<group>"; };
+ F96D445508F272B9004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
+ F96D445608F272B9004A47F5 /* tclConfig.h.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = tclConfig.h.in; sourceTree = "<group>"; };
+ F96D445708F272B9004A47F5 /* tclConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tclConfig.sh.in; sourceTree = "<group>"; };
+ F96D445808F272B9004A47F5 /* tclLoadAix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadAix.c; sourceTree = "<group>"; };
+ F96D445908F272B9004A47F5 /* tclLoadDl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadDl.c; sourceTree = "<group>"; };
+ F96D445B08F272B9004A47F5 /* tclLoadDyld.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadDyld.c; sourceTree = "<group>"; };
+ F96D445C08F272B9004A47F5 /* tclLoadNext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadNext.c; sourceTree = "<group>"; };
+ F96D445D08F272B9004A47F5 /* tclLoadOSF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadOSF.c; sourceTree = "<group>"; };
+ F96D445E08F272B9004A47F5 /* tclLoadShl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclLoadShl.c; sourceTree = "<group>"; };
+ F96D445F08F272B9004A47F5 /* tclUnixChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixChan.c; sourceTree = "<group>"; };
+ F96D446008F272B9004A47F5 /* tclUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixEvent.c; sourceTree = "<group>"; };
+ F96D446108F272B9004A47F5 /* tclUnixFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixFCmd.c; sourceTree = "<group>"; };
+ F96D446208F272B9004A47F5 /* tclUnixFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixFile.c; sourceTree = "<group>"; };
+ F96D446308F272B9004A47F5 /* tclUnixInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixInit.c; sourceTree = "<group>"; };
+ F96D446408F272B9004A47F5 /* tclUnixNotfy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixNotfy.c; sourceTree = "<group>"; };
+ F96D446508F272B9004A47F5 /* tclUnixPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixPipe.c; sourceTree = "<group>"; };
+ F96D446608F272B9004A47F5 /* tclUnixPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixPort.h; sourceTree = "<group>"; };
+ F96D446708F272B9004A47F5 /* tclUnixSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixSock.c; sourceTree = "<group>"; };
+ F96D446808F272B9004A47F5 /* tclUnixTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTest.c; sourceTree = "<group>"; };
+ F96D446908F272B9004A47F5 /* tclUnixThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixThrd.c; sourceTree = "<group>"; };
+ F96D446A08F272B9004A47F5 /* tclUnixThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixThrd.h; sourceTree = "<group>"; };
+ F96D446B08F272B9004A47F5 /* tclUnixTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTime.c; sourceTree = "<group>"; };
+ F96D446C08F272B9004A47F5 /* tclXtNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtNotify.c; sourceTree = "<group>"; };
+ F96D446D08F272B9004A47F5 /* tclXtTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtTest.c; sourceTree = "<group>"; };
+ F96D447008F272BA004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; };
+ F96D447108F272BA004A47F5 /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; };
+ F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = "<group>"; };
+ F96D447308F272BA004A47F5 /* coffbase.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coffbase.txt; sourceTree = "<group>"; };
+ F96D447408F272BA004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = "<group>"; };
+ F96D447508F272BA004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = "<group>"; };
+ F96D447608F272BA004A47F5 /* makefile.bc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.bc; sourceTree = "<group>"; };
+ F96D447708F272BA004A47F5 /* Makefile.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = Makefile.in; sourceTree = "<group>"; };
+ F96D447808F272BA004A47F5 /* makefile.vc */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = makefile.vc; sourceTree = "<group>"; };
+ F96D447908F272BA004A47F5 /* nmakehlp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nmakehlp.c; sourceTree = "<group>"; };
+ F96D447A08F272BA004A47F5 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ F96D447C08F272BA004A47F5 /* rules.vc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rules.vc; sourceTree = "<group>"; };
+ F96D447D08F272BA004A47F5 /* stub16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub16.c; sourceTree = "<group>"; };
+ F96D447E08F272BA004A47F5 /* tcl.dsp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsp; sourceTree = "<group>"; };
+ F96D447F08F272BA004A47F5 /* tcl.dsw */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.dsw; sourceTree = "<group>"; };
+ F96D448008F272BA004A47F5 /* tcl.hpj.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.hpj.in; sourceTree = "<group>"; };
+ F96D448108F272BA004A47F5 /* tcl.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tcl.m4; sourceTree = "<group>"; };
+ F96D448208F272BA004A47F5 /* tcl.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.rc; sourceTree = "<group>"; };
+ F96D448308F272BA004A47F5 /* tclAppInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclAppInit.c; sourceTree = "<group>"; };
+ F96D448408F272BA004A47F5 /* tclConfig.sh.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = tclConfig.sh.in; sourceTree = "<group>"; };
+ F96D448608F272BA004A47F5 /* tclsh.rc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tclsh.rc; sourceTree = "<group>"; };
+ F96D448708F272BA004A47F5 /* tclWin32Dll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWin32Dll.c; sourceTree = "<group>"; };
+ F96D448808F272BA004A47F5 /* tclWinChan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinChan.c; sourceTree = "<group>"; };
+ F96D448908F272BA004A47F5 /* tclWinConsole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinConsole.c; sourceTree = "<group>"; };
+ F96D448A08F272BA004A47F5 /* tclWinDde.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinDde.c; sourceTree = "<group>"; };
+ F96D448B08F272BA004A47F5 /* tclWinError.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinError.c; sourceTree = "<group>"; };
+ F96D448C08F272BA004A47F5 /* tclWinFCmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinFCmd.c; sourceTree = "<group>"; };
+ F96D448D08F272BA004A47F5 /* tclWinFile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinFile.c; sourceTree = "<group>"; };
+ F96D448E08F272BA004A47F5 /* tclWinInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinInit.c; sourceTree = "<group>"; };
+ F96D448F08F272BA004A47F5 /* tclWinInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinInt.h; sourceTree = "<group>"; };
+ F96D449008F272BA004A47F5 /* tclWinLoad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinLoad.c; sourceTree = "<group>"; };
+ F96D449108F272BA004A47F5 /* tclWinNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinNotify.c; sourceTree = "<group>"; };
+ F96D449208F272BA004A47F5 /* tclWinPipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinPipe.c; sourceTree = "<group>"; };
+ F96D449308F272BA004A47F5 /* tclWinPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinPort.h; sourceTree = "<group>"; };
+ F96D449408F272BA004A47F5 /* tclWinReg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinReg.c; sourceTree = "<group>"; };
+ F96D449508F272BA004A47F5 /* tclWinSerial.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinSerial.c; sourceTree = "<group>"; };
+ F96D449608F272BA004A47F5 /* tclWinSock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinSock.c; sourceTree = "<group>"; };
+ F96D449708F272BA004A47F5 /* tclWinTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTest.c; sourceTree = "<group>"; };
+ F96D449808F272BA004A47F5 /* tclWinThrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinThrd.c; sourceTree = "<group>"; };
+ F96D449908F272BA004A47F5 /* tclWinThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclWinThrd.h; sourceTree = "<group>"; };
+ F96D449A08F272BA004A47F5 /* tclWinTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclWinTime.c; sourceTree = "<group>"; };
+ F973E5960EE99384001A648E /* vistaTheme.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vistaTheme.tcl; sourceTree = "<group>"; };
+ F974D56C0FBE7D6300BF728B /* http11.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = http11.test; sourceTree = "<group>"; };
+ F974D56D0FBE7D6300BF728B /* httpd11.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = httpd11.tcl; sourceTree = "<group>"; };
+ F974D5720FBE7DC600BF728B /* coroutine.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = coroutine.n; sourceTree = "<group>"; };
+ F974D5760FBE7E1900BF728B /* tailcall.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = tailcall.n; sourceTree = "<group>"; };
+ F974D5770FBE7E6100BF728B /* coroutine.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = coroutine.test; sourceTree = "<group>"; };
+ F974D5780FBE7E6100BF728B /* tailcall.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tailcall.test; sourceTree = "<group>"; };
+ F974D5790FBE7E9C00BF728B /* tcl.pc.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcl.pc.in; sourceTree = "<group>"; };
+ F974D57B0FBE7EC000BF728B /* tk.pc.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tk.pc.in; sourceTree = "<group>"; };
+ F974D57C0FBE7EFF00BF728B /* iconlist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iconlist.tcl; sourceTree = "<group>"; };
+ F974D57D0FBE7EFF00BF728B /* icons.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = icons.tcl; sourceTree = "<group>"; };
+ F97590AE1039A96200558A9A /* Wish.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = Wish.sdef; sourceTree = "<group>"; };
+ F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXPrivate.h; sourceTree = "<group>"; };
+ F97AE7F10B65C1E900310EA2 /* Tk-Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Common.xcconfig"; sourceTree = "<group>"; };
+ F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Release.xcconfig"; sourceTree = "<group>"; };
+ F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Tk-Debug.xcconfig"; sourceTree = "<group>"; };
+ F98383650F0FA43900171CA6 /* checkbutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkbutton.test; sourceTree = "<group>"; };
+ F98383680F0FA44700171CA6 /* radiobutton.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = radiobutton.test; sourceTree = "<group>"; };
+ F9903CAF094FAADA004613E9 /* tclTomMath.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclTomMath.decls; sourceTree = "<group>"; };
+ F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMathDecls.h; sourceTree = "<group>"; };
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.tcl; sourceTree = "<group>"; };
+ F99388950EE02D980065FE6B /* fontchooser.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fontchooser.test; sourceTree = "<group>"; };
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = TclZlib.3; sourceTree = "<group>"; };
+ F9A3082D08F2D4AB00BAE1AB /* Tk.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A3084B08F2D4CE00BAE1AB /* Wish.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wish.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9A493240CEBF38300B78AE2 /* chanio.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chanio.test; sourceTree = "<group>"; };
+ F9C888C20EEF6571003F63AD /* fontchooser.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = fontchooser.n; sourceTree = "<group>"; };
+ F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
+ F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mclist.tcl; sourceTree = "<group>"; };
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkImgPNG.c; sourceTree = "<group>"; };
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = imgPNG.test; sourceTree = "<group>"; };
+ F9ECB1120B26521500A28025 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = "<group>"; };
+ F9ECB1130B26521500A28025 /* platform.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.tcl; sourceTree = "<group>"; };
+ F9ECB1140B26521500A28025 /* shell.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = shell.tcl; sourceTree = "<group>"; };
+ F9ECB1CA0B2652D300A28025 /* apply.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = apply.test; sourceTree = "<group>"; };
+ F9ECB1CB0B26534C00A28025 /* mathop.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mathop.test; sourceTree = "<group>"; };
+ F9ECB1E10B26543C00A28025 /* platform_shell.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = platform_shell.n; sourceTree = "<group>"; };
+ F9ECB1E20B26543C00A28025 /* platform.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = platform.n; sourceTree = "<group>"; };
+ F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tclDTrace.d; sourceTree = "<group>"; };
+ F9F4EFDC0CC7B3CA00378A27 /* ttkpane.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; languageSpecificationIdentifier = shell; path = ttkpane.tcl; sourceTree = "<group>"; };
+ F9F4EFDD0CC7B3CB00378A27 /* ttkmenu.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; languageSpecificationIdentifier = shell; path = ttkmenu.tcl; sourceTree = "<group>"; };
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixCompat.c; sourceTree = "<group>"; };
+ F9FD31F40CC1AD070073837D /* tktest-X11 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "tktest-X11"; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9FD32140CC1AF170073837D /* libX11.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libX11.dylib; path = /usr/X11R6/lib/libX11.dylib; sourceTree = "<absolute>"; };
+ F9FD32150CC1AF170073837D /* libXext.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXext.dylib; path = /usr/X11R6/lib/libXext.dylib; sourceTree = "<absolute>"; };
+ F9FD32160CC1AF170073837D /* libXss.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXss.dylib; path = /usr/X11R6/lib/libXss.dylib; sourceTree = "<absolute>"; };
+ F9FD34990CC1BB0D0073837D /* libfreetype.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfreetype.dylib; path = /usr/X11R6/lib/libfreetype.dylib; sourceTree = "<absolute>"; };
+ F9FD349A0CC1BB0D0073837D /* libXft.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXft.dylib; path = /usr/X11R6/lib/libXft.dylib; sourceTree = "<absolute>"; };
+ F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfontconfig.dylib; path = /usr/X11R6/lib/libfontconfig.dylib; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76FAD0486AB0100D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F966C07508F2820D005CB29B /* CoreFoundation.framework in Frameworks */,
+ F96437E70EF0D652003F468E /* libz.dylib in Frameworks */,
+ F966C07708F2821B005CB29B /* Carbon.framework in Frameworks */,
+ F966C07908F28233005CB29B /* IOKit.framework in Frameworks */,
+ F94523A20E6FC2AC00C1D987 /* Cocoa.framework in Frameworks */,
+ F9C9CC000E84059800E00935 /* ApplicationServices.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9FD31E30CC1AD070073837D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9FD31E40CC1AD070073837D /* CoreFoundation.framework in Frameworks */,
+ F96437E80EF0D652003F468E /* libz.dylib in Frameworks */,
+ F9FD32170CC1AF170073837D /* libX11.dylib in Frameworks */,
+ F9FD32180CC1AF170073837D /* libXext.dylib in Frameworks */,
+ F9FD32190CC1AF170073837D /* libXss.dylib in Frameworks */,
+ F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */,
+ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */,
+ F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* Tk */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3DF708F271BE004A47F5 /* Tk Sources */,
+ F96D3DF608F27169004A47F5 /* Tcl Sources */,
+ F966C06F08F281DC005CB29B /* Frameworks */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n";
+ name = Tk;
+ path = .;
+ sourceTree = SOURCE_ROOT;
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ F9A3084B08F2D4CE00BAE1AB /* Wish.app */,
+ F9A3082D08F2D4AB00BAE1AB /* Tk.framework */,
+ F9A3084E08F2D4F400BAE1AB /* Tcl.framework */,
+ 8DD76FB20486AB0100D96B5E /* tktest */,
+ F9FD31F40CC1AD070073837D /* tktest-X11 */,
+ );
+ includeInIndex = 0;
+ name = Products;
+ sourceTree = "<group>";
+ };
+ F9183E690EFC81560030B814 /* pkgs */ = {
+ isa = PBXGroup;
+ children = (
+ F9183E6A0EFC81560030B814 /* README */,
+ F946FB8B0FBE3AED00CD6495 /* itcl */,
+ F9183E8F0EFC817B0030B814 /* tdbc */,
+ );
+ path = pkgs;
+ sourceTree = "<group>";
+ };
+ F966BA0308F27A37005CB29B /* bitmaps */ = {
+ isa = PBXGroup;
+ children = (
+ F966BA0408F27A37005CB29B /* error.xbm */,
+ F966BA0508F27A37005CB29B /* gray12.xbm */,
+ F966BA0608F27A37005CB29B /* gray25.xbm */,
+ F966BA0708F27A37005CB29B /* gray50.xbm */,
+ F966BA0808F27A37005CB29B /* gray75.xbm */,
+ F966BA0908F27A37005CB29B /* hourglass.xbm */,
+ F966BA0A08F27A37005CB29B /* info.xbm */,
+ F966BA0B08F27A37005CB29B /* questhead.xbm */,
+ F966BA0C08F27A37005CB29B /* question.xbm */,
+ F966BA0D08F27A37005CB29B /* warning.xbm */,
+ );
+ path = bitmaps;
+ sourceTree = "<group>";
+ };
+ F966BA1008F27A37005CB29B /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ F966BA1108F27A37005CB29B /* 3DBorder.3 */,
+ F966BA1208F27A37005CB29B /* AddOption.3 */,
+ F966BA1308F27A37005CB29B /* bell.n */,
+ F966BA1408F27A37005CB29B /* bind.n */,
+ F966BA1508F27A37005CB29B /* BindTable.3 */,
+ F966BA1608F27A37005CB29B /* bindtags.n */,
+ F966BA1708F27A37005CB29B /* bitmap.n */,
+ F966BA1808F27A37005CB29B /* button.n */,
+ F966BA1908F27A37005CB29B /* canvas.n */,
+ F966BA1A08F27A37005CB29B /* CanvPsY.3 */,
+ F966BA1B08F27A37005CB29B /* CanvTkwin.3 */,
+ F966BA1C08F27A37005CB29B /* CanvTxtInfo.3 */,
+ F966BA1D08F27A37005CB29B /* checkbutton.n */,
+ F966BA1E08F27A37005CB29B /* chooseColor.n */,
+ F966BA1F08F27A37005CB29B /* chooseDirectory.n */,
+ F966BA2008F27A37005CB29B /* Clipboard.3 */,
+ F966BA2108F27A37005CB29B /* clipboard.n */,
+ F966BA2208F27A37005CB29B /* ClrSelect.3 */,
+ F966BA2308F27A37005CB29B /* colors.n */,
+ F966BA2408F27A37005CB29B /* ConfigWidg.3 */,
+ F966BA2508F27A37005CB29B /* ConfigWind.3 */,
+ F966BA2608F27A37005CB29B /* console.n */,
+ F966BA2708F27A37005CB29B /* CoordToWin.3 */,
+ F966BA2808F27A37005CB29B /* CrtCmHdlr.3 */,
+ F966BA2908F27A37005CB29B /* CrtErrHdlr.3 */,
+ F966BA2A08F27A37005CB29B /* CrtGenHdlr.3 */,
+ F966BA2B08F27A37005CB29B /* CrtImgType.3 */,
+ F966BA2C08F27A37005CB29B /* CrtItemType.3 */,
+ F966BA2D08F27A37005CB29B /* CrtPhImgFmt.3 */,
+ F966BA2E08F27A37005CB29B /* CrtSelHdlr.3 */,
+ F966BA2F08F27A37005CB29B /* CrtWindow.3 */,
+ F966BA3008F27A37005CB29B /* cursors.n */,
+ F966BA3108F27A37005CB29B /* DeleteImg.3 */,
+ F966BA3208F27A37005CB29B /* destroy.n */,
+ F966BA3308F27A37005CB29B /* dialog.n */,
+ F966BA3408F27A37005CB29B /* DrawFocHlt.3 */,
+ F966BA3508F27A37005CB29B /* entry.n */,
+ F966BA3608F27A37005CB29B /* event.n */,
+ F966BA3708F27A37005CB29B /* EventHndlr.3 */,
+ F966BA3808F27A37005CB29B /* FindPhoto.3 */,
+ F966BA3908F27A37005CB29B /* focus.n */,
+ F966BA3A08F27A37005CB29B /* focusNext.n */,
+ F966BA3B08F27A37005CB29B /* font.n */,
+ F9C888C20EEF6571003F63AD /* fontchooser.n */,
+ F966BA3C08F27A37005CB29B /* FontId.3 */,
+ F966BA3D08F27A37005CB29B /* frame.n */,
+ F966BA3E08F27A37005CB29B /* FreeXId.3 */,
+ F966BA3F08F27A37005CB29B /* GeomReq.3 */,
+ F966BA4008F27A37005CB29B /* GetAnchor.3 */,
+ F966BA4108F27A37005CB29B /* GetBitmap.3 */,
+ F966BA4208F27A37005CB29B /* GetCapStyl.3 */,
+ F966BA4308F27A37005CB29B /* GetClrmap.3 */,
+ F966BA4408F27A37005CB29B /* GetColor.3 */,
+ F966BA4508F27A37005CB29B /* GetCursor.3 */,
+ F966BA4608F27A37005CB29B /* GetDash.3 */,
+ F966BA4708F27A37005CB29B /* GetFont.3 */,
+ F966BA4808F27A37005CB29B /* GetGC.3 */,
+ F966BA4908F27A37005CB29B /* GetHINSTANCE.3 */,
+ F966BA4A08F27A37005CB29B /* GetHWND.3 */,
+ F966BA4B08F27A37005CB29B /* GetImage.3 */,
+ F966BA4C08F27A37005CB29B /* GetJoinStl.3 */,
+ F966BA4D08F27A37005CB29B /* GetJustify.3 */,
+ F966BA4E08F27A37005CB29B /* getOpenFile.n */,
+ F966BA4F08F27A37005CB29B /* GetOption.3 */,
+ F966BA5008F27A38005CB29B /* GetPixels.3 */,
+ F966BA5108F27A38005CB29B /* GetPixmap.3 */,
+ F966BA5208F27A38005CB29B /* GetRelief.3 */,
+ F966BA5308F27A38005CB29B /* GetRootCrd.3 */,
+ F966BA5408F27A38005CB29B /* GetScroll.3 */,
+ F966BA5508F27A38005CB29B /* GetSelect.3 */,
+ F966BA5608F27A38005CB29B /* GetUid.3 */,
+ F966BA5708F27A38005CB29B /* GetVisual.3 */,
+ F966BA5808F27A38005CB29B /* GetVRoot.3 */,
+ F966BA5908F27A38005CB29B /* Grab.3 */,
+ F966BA5A08F27A38005CB29B /* grab.n */,
+ F966BA5B08F27A38005CB29B /* grid.n */,
+ F966BA5C08F27A38005CB29B /* HandleEvent.3 */,
+ F966BA5D08F27A38005CB29B /* HWNDToWindow.3 */,
+ F966BA5E08F27A38005CB29B /* IdToWindow.3 */,
+ F966BA5F08F27A38005CB29B /* image.n */,
+ F966BA6008F27A38005CB29B /* ImgChanged.3 */,
+ F966BA6108F27A38005CB29B /* Inactive.3 */,
+ F966BA6208F27A38005CB29B /* InternAtom.3 */,
+ F966BA6308F27A38005CB29B /* keysyms.n */,
+ F966BA6408F27A38005CB29B /* label.n */,
+ F966BA6508F27A38005CB29B /* labelframe.n */,
+ F966BA6608F27A38005CB29B /* listbox.n */,
+ F966BA6708F27A38005CB29B /* loadTk.n */,
+ F966BA6808F27A38005CB29B /* lower.n */,
+ F966BA6908F27A38005CB29B /* MainLoop.3 */,
+ F966BA6A08F27A38005CB29B /* MaintGeom.3 */,
+ F966BA6B08F27A38005CB29B /* MainWin.3 */,
+ F966BA6D08F27A38005CB29B /* ManageGeom.3 */,
+ F966BA6E08F27A38005CB29B /* MapWindow.3 */,
+ F966BA6F08F27A38005CB29B /* MeasureChar.3 */,
+ F966BA7008F27A38005CB29B /* menu.n */,
+ F966BA7108F27A38005CB29B /* menubar.n */,
+ F966BA7208F27A38005CB29B /* menubutton.n */,
+ F966BA7308F27A38005CB29B /* message.n */,
+ F966BA7408F27A38005CB29B /* messageBox.n */,
+ F966BA7508F27A38005CB29B /* MoveToplev.3 */,
+ F966BA7608F27A38005CB29B /* Name.3 */,
+ F966BA7708F27A38005CB29B /* NameOfImg.3 */,
+ F966BA7808F27A38005CB29B /* option.n */,
+ F966BA7908F27A38005CB29B /* optionMenu.n */,
+ F966BA7A08F27A38005CB29B /* options.n */,
+ F966BA7B08F27A38005CB29B /* OwnSelect.3 */,
+ F966BA7C08F27A38005CB29B /* pack-old.n */,
+ F966BA7D08F27A38005CB29B /* pack.n */,
+ F966BA7E08F27A38005CB29B /* palette.n */,
+ F966BA7F08F27A38005CB29B /* panedwindow.n */,
+ F966BA8008F27A38005CB29B /* ParseArgv.3 */,
+ F966BA8108F27A38005CB29B /* photo.n */,
+ F966BA8208F27A38005CB29B /* place.n */,
+ F966BA8308F27A38005CB29B /* popup.n */,
+ F966BA8408F27A38005CB29B /* QWinEvent.3 */,
+ F966BA8508F27A38005CB29B /* radiobutton.n */,
+ F966BA8608F27A38005CB29B /* raise.n */,
+ F966BA8708F27A38005CB29B /* Restack.3 */,
+ F966BA8808F27A38005CB29B /* RestrictEv.3 */,
+ F966BA8908F27A38005CB29B /* scale.n */,
+ F966BA8A08F27A38005CB29B /* scrollbar.n */,
+ F966BA8B08F27A38005CB29B /* selection.n */,
+ F966BA8C08F27A38005CB29B /* send.n */,
+ F966BA8D08F27A38005CB29B /* SetAppName.3 */,
+ F966BA8E08F27A38005CB29B /* SetCaret.3 */,
+ F966BA8F08F27A38005CB29B /* SetClass.3 */,
+ F966BA9008F27A38005CB29B /* SetClassProcs.3 */,
+ F966BA9108F27A38005CB29B /* SetGrid.3 */,
+ F966BA9208F27A38005CB29B /* SetOptions.3 */,
+ F966BA9308F27A38005CB29B /* SetVisual.3 */,
+ F966BA9408F27A38005CB29B /* spinbox.n */,
+ F966BA9508F27A38005CB29B /* StrictMotif.3 */,
+ F966BA9608F27A38005CB29B /* text.n */,
+ F966BA9708F27A38005CB29B /* TextLayout.3 */,
+ F966BA9808F27A38005CB29B /* tk.n */,
+ F966BA9A08F27A38005CB29B /* Tk_Init.3 */,
+ F966BA9B08F27A38005CB29B /* Tk_Main.3 */,
+ F966BA9C08F27A38005CB29B /* tkerror.n */,
+ F966BA9D08F27A38005CB29B /* TkInitStubs.3 */,
+ F966BA9E08F27A38005CB29B /* tkvars.n */,
+ F966BA9F08F27A38005CB29B /* tkwait.n */,
+ F966BAA008F27A38005CB29B /* toplevel.n */,
+ F968886B0AF788F6000797B5 /* ttk_button.n */,
+ F968886C0AF788F6000797B5 /* ttk_checkbutton.n */,
+ F968886D0AF788F6000797B5 /* ttk_combobox.n */,
+ F968886F0AF788F6000797B5 /* ttk_entry.n */,
+ F96888700AF788F6000797B5 /* ttk_frame.n */,
+ F96888710AF788F6000797B5 /* ttk_Geometry.3 */,
+ F96888720AF788F6000797B5 /* ttk_image.n */,
+ F96888730AF788F6000797B5 /* ttk_intro.n */,
+ F96888740AF788F6000797B5 /* ttk_label.n */,
+ F96888750AF788F6000797B5 /* ttk_labelframe.n */,
+ F96888760AF788F6000797B5 /* ttk_menubutton.n */,
+ F96888770AF788F6000797B5 /* ttk_notebook.n */,
+ F96888780AF788F6000797B5 /* ttk_panedwindow.n */,
+ F96888790AF788F6000797B5 /* ttk_progressbar.n */,
+ F968887A0AF788F6000797B5 /* ttk_radiobutton.n */,
+ F968887B0AF788F6000797B5 /* ttk_scrollbar.n */,
+ F968887C0AF788F6000797B5 /* ttk_separator.n */,
+ F968887D0AF788F6000797B5 /* ttk_sizegrip.n */,
+ F968887E0AF788F6000797B5 /* ttk_style.n */,
+ F968887F0AF788F6000797B5 /* ttk_Theme.3 */,
+ F96888800AF788F6000797B5 /* ttk_treeview.n */,
+ F96888810AF788F6000797B5 /* ttk_widget.n */,
+ F966BAA108F27A38005CB29B /* WindowId.3 */,
+ F966BAA208F27A38005CB29B /* winfo.n */,
+ F966BAA308F27A38005CB29B /* wish.1 */,
+ F966BAA408F27A38005CB29B /* wm.n */,
+ );
+ path = doc;
+ sourceTree = "<group>";
+ };
+ F966BAA508F27A38005CB29B /* generic */ = {
+ isa = PBXGroup;
+ children = (
+ F966BAA608F27A38005CB29B /* default.h */,
+ F966BAA708F27A38005CB29B /* ks_names.h */,
+ F966BAA908F27A39005CB29B /* README */,
+ F966BAAA08F27A39005CB29B /* tk.decls */,
+ F966BAAB08F27A39005CB29B /* tk.h */,
+ F966BAAC08F27A39005CB29B /* tk3d.c */,
+ F966BAAD08F27A39005CB29B /* tk3d.h */,
+ F966BAAE08F27A39005CB29B /* tkArgv.c */,
+ F966BAAF08F27A39005CB29B /* tkAtom.c */,
+ F966BAB008F27A39005CB29B /* tkBind.c */,
+ F966BAB108F27A39005CB29B /* tkBitmap.c */,
+ F9152B080EAF8A5000CD5C7B /* tkBusy.c */,
+ F966BAB208F27A39005CB29B /* tkButton.c */,
+ F966BAB308F27A39005CB29B /* tkButton.h */,
+ F966BAB408F27A39005CB29B /* tkCanvArc.c */,
+ F966BAB508F27A39005CB29B /* tkCanvas.c */,
+ F966BAB608F27A39005CB29B /* tkCanvas.h */,
+ F966BAB708F27A39005CB29B /* tkCanvBmap.c */,
+ F966BAB808F27A39005CB29B /* tkCanvImg.c */,
+ F966BAB908F27A39005CB29B /* tkCanvLine.c */,
+ F966BABA08F27A39005CB29B /* tkCanvPoly.c */,
+ F966BABB08F27A39005CB29B /* tkCanvPs.c */,
+ F966BABD08F27A39005CB29B /* tkCanvText.c */,
+ F966BABE08F27A39005CB29B /* tkCanvUtil.c */,
+ F966BABF08F27A39005CB29B /* tkCanvWind.c */,
+ F966BAC008F27A39005CB29B /* tkClipboard.c */,
+ F966BAC108F27A39005CB29B /* tkCmds.c */,
+ F966BAC208F27A39005CB29B /* tkColor.c */,
+ F966BAC308F27A39005CB29B /* tkColor.h */,
+ F966BAC408F27A39005CB29B /* tkConfig.c */,
+ F966BAC508F27A39005CB29B /* tkConsole.c */,
+ F966BAC608F27A39005CB29B /* tkCursor.c */,
+ F966BAC708F27A39005CB29B /* tkDecls.h */,
+ F966BAC808F27A39005CB29B /* tkEntry.c */,
+ F966BAC908F27A39005CB29B /* tkEntry.h */,
+ F966BACA08F27A39005CB29B /* tkError.c */,
+ F966BACB08F27A39005CB29B /* tkEvent.c */,
+ F966BACC08F27A39005CB29B /* tkFileFilter.c */,
+ F966BACD08F27A39005CB29B /* tkFileFilter.h */,
+ F966BACE08F27A39005CB29B /* tkFocus.c */,
+ F966BACF08F27A39005CB29B /* tkFont.c */,
+ F966BAD008F27A39005CB29B /* tkFont.h */,
+ F966BAD108F27A39005CB29B /* tkFrame.c */,
+ F966BAD208F27A39005CB29B /* tkGC.c */,
+ F966BAD308F27A39005CB29B /* tkGeometry.c */,
+ F966BAD408F27A39005CB29B /* tkGet.c */,
+ F966BAD508F27A39005CB29B /* tkGrab.c */,
+ F966BAD608F27A39005CB29B /* tkGrid.c */,
+ F966BAD708F27A39005CB29B /* tkImage.c */,
+ F966BAD808F27A39005CB29B /* tkImgBmap.c */,
+ F966BAD908F27A39005CB29B /* tkImgGIF.c */,
+ F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */,
+ F966BADA08F27A39005CB29B /* tkImgPhoto.c */,
+ F9DD99BC0F07DF850018B2E4 /* tkImgPNG.c */,
+ F966BADB08F27A39005CB29B /* tkImgPPM.c */,
+ F966BADC08F27A39005CB29B /* tkImgUtil.c */,
+ F966BADE08F27A39005CB29B /* tkInt.decls */,
+ F966BADF08F27A39005CB29B /* tkInt.h */,
+ F966BAE108F27A39005CB29B /* tkIntDecls.h */,
+ F966BAE208F27A39005CB29B /* tkIntPlatDecls.h */,
+ F966BAE308F27A39005CB29B /* tkIntXlibDecls.h */,
+ F966BAE408F27A39005CB29B /* tkListbox.c */,
+ F966BAE508F27A39005CB29B /* tkMacWinMenu.c */,
+ F966BAE608F27A39005CB29B /* tkMain.c */,
+ F966BAE708F27A39005CB29B /* tkMenu.c */,
+ F966BAE808F27A39005CB29B /* tkMenu.h */,
+ F966BAE908F27A39005CB29B /* tkMenubutton.c */,
+ F966BAEA08F27A39005CB29B /* tkMenubutton.h */,
+ F966BAEB08F27A39005CB29B /* tkMenuDraw.c */,
+ F966BAEC08F27A39005CB29B /* tkMessage.c */,
+ F966BAED08F27A39005CB29B /* tkObj.c */,
+ F966BAEE08F27A39005CB29B /* tkOldConfig.c */,
+ F966BAEF08F27A39005CB29B /* tkOption.c */,
+ F966BAF008F27A39005CB29B /* tkPack.c */,
+ F966BAF108F27A39005CB29B /* tkPanedWindow.c */,
+ F966BAF208F27A39005CB29B /* tkPlace.c */,
+ F966BAF308F27A39005CB29B /* tkPlatDecls.h */,
+ F966BAF408F27A39005CB29B /* tkPointer.c */,
+ F966BAF508F27A39005CB29B /* tkPort.h */,
+ F966BAF608F27A39005CB29B /* tkRectOval.c */,
+ F966BAF708F27A39005CB29B /* tkScale.c */,
+ F966BAF808F27A39005CB29B /* tkScale.h */,
+ F966BAF908F27A39005CB29B /* tkScrollbar.c */,
+ F966BAFA08F27A39005CB29B /* tkScrollbar.h */,
+ F966BAFB08F27A39005CB29B /* tkSelect.c */,
+ F966BAFC08F27A39005CB29B /* tkSelect.h */,
+ F966BAFD08F27A39005CB29B /* tkSquare.c */,
+ F966BAFE08F27A39005CB29B /* tkOldTest.c */,
+ F966BAFF08F27A39005CB29B /* tkStubInit.c */,
+ F966BB0008F27A39005CB29B /* tkStubLib.c */,
+ F966BB0108F27A39005CB29B /* tkStyle.c */,
+ F966BB0208F27A39005CB29B /* tkTest.c */,
+ F966BB0308F27A39005CB29B /* tkText.c */,
+ F966BB0408F27A39005CB29B /* tkText.h */,
+ F966BB0508F27A39005CB29B /* tkTextBTree.c */,
+ F966BB0608F27A39005CB29B /* tkTextDisp.c */,
+ F966BB0808F27A39005CB29B /* tkTextImage.c */,
+ F966BB0908F27A39005CB29B /* tkTextIndex.c */,
+ F966BB0A08F27A39005CB29B /* tkTextMark.c */,
+ F966BB0B08F27A39005CB29B /* tkTextTag.c */,
+ F966BB0C08F27A39005CB29B /* tkTextWind.c */,
+ F966BB0D08F27A39005CB29B /* tkTrig.c */,
+ F966BB0E08F27A39005CB29B /* tkUndo.c */,
+ F966BB0F08F27A39005CB29B /* tkUndo.h */,
+ F966BB1008F27A39005CB29B /* tkUtil.c */,
+ F966BB1108F27A39005CB29B /* tkVisual.c */,
+ F966BB1208F27A39005CB29B /* tkWindow.c */,
+ F96887DF0AF786D5000797B5 /* ttk */,
+ );
+ path = generic;
+ sourceTree = "<group>";
+ };
+ F966BB1308F27A39005CB29B /* library */ = {
+ isa = PBXGroup;
+ children = (
+ F966BB1408F27A39005CB29B /* bgerror.tcl */,
+ F966BB1508F27A39005CB29B /* button.tcl */,
+ F966BB1608F27A39005CB29B /* choosedir.tcl */,
+ F966BB1708F27A39005CB29B /* clrpick.tcl */,
+ F966BB1808F27A39005CB29B /* comdlg.tcl */,
+ F966BB1908F27A39005CB29B /* console.tcl */,
+ F966BB1A08F27A39005CB29B /* demos */,
+ F966BB6208F27A3A005CB29B /* dialog.tcl */,
+ F966BB6308F27A3A005CB29B /* entry.tcl */,
+ F966BB6408F27A3A005CB29B /* focus.tcl */,
+ F99388380EE0114B0065FE6B /* fontchooser.tcl */,
+ F974D57C0FBE7EFF00BF728B /* iconlist.tcl */,
+ F974D57D0FBE7EFF00BF728B /* icons.tcl */,
+ F966BB7308F27A3A005CB29B /* listbox.tcl */,
+ F966BB7408F27A3A005CB29B /* menu.tcl */,
+ F966BB7508F27A3A005CB29B /* mkpsenc.tcl */,
+ F966BB7608F27A3A005CB29B /* msgbox.tcl */,
+ F966BB8608F27A3A005CB29B /* obsolete.tcl */,
+ F966BB8708F27A3A005CB29B /* optMenu.tcl */,
+ F966BB8808F27A3A005CB29B /* palette.tcl */,
+ F966BB8908F27A3B005CB29B /* panedwindow.tcl */,
+ F966BB8B08F27A3B005CB29B /* safetk.tcl */,
+ F966BB8C08F27A3B005CB29B /* scale.tcl */,
+ F966BB8D08F27A3B005CB29B /* scrlbar.tcl */,
+ F966BB8E08F27A3B005CB29B /* spinbox.tcl */,
+ F966BB8F08F27A3B005CB29B /* tclIndex */,
+ F966BB9008F27A3B005CB29B /* tearoff.tcl */,
+ F966BB9108F27A3B005CB29B /* text.tcl */,
+ F966BB9208F27A3B005CB29B /* tk.tcl */,
+ F966BB9308F27A3B005CB29B /* tkfbox.tcl */,
+ F96888360AF787B3000797B5 /* ttk */,
+ F966BB9408F27A3B005CB29B /* unsupported.tcl */,
+ F966BB9508F27A3B005CB29B /* xmfbox.tcl */,
+ );
+ path = library;
+ sourceTree = "<group>";
+ };
+ F966BB1A08F27A39005CB29B /* demos */ = {
+ isa = PBXGroup;
+ children = (
+ F966BB1B08F27A39005CB29B /* anilabel.tcl */,
+ F966BB1C08F27A39005CB29B /* aniwave.tcl */,
+ F966BB1D08F27A39005CB29B /* arrow.tcl */,
+ F966BB1E08F27A39005CB29B /* bind.tcl */,
+ F966BB1F08F27A39005CB29B /* bitmap.tcl */,
+ F966BB2008F27A39005CB29B /* browse */,
+ F966BB2108F27A39005CB29B /* button.tcl */,
+ F966BB2208F27A39005CB29B /* check.tcl */,
+ F966BB2308F27A39005CB29B /* clrpick.tcl */,
+ F966BB2408F27A39005CB29B /* colors.tcl */,
+ F936FCDB0CCD984600716967 /* combo.tcl */,
+ F966BB2508F27A39005CB29B /* cscroll.tcl */,
+ F966BB2608F27A39005CB29B /* ctext.tcl */,
+ F966BB2708F27A39005CB29B /* dialog1.tcl */,
+ F966BB2808F27A39005CB29B /* dialog2.tcl */,
+ F966BB2A08F27A39005CB29B /* entry1.tcl */,
+ F966BB2B08F27A39005CB29B /* entry2.tcl */,
+ F966BB2C08F27A39005CB29B /* entry3.tcl */,
+ F966BB2D08F27A39005CB29B /* filebox.tcl */,
+ F966BB2E08F27A39005CB29B /* floor.tcl */,
+ F91543270EF201A90032D1E8 /* fontchoose.tcl */,
+ F966BB2F08F27A39005CB29B /* form.tcl */,
+ F966BB3008F27A39005CB29B /* goldberg.tcl */,
+ F966BB3108F27A39005CB29B /* hello */,
+ F966BB3208F27A39005CB29B /* hscale.tcl */,
+ F966BB3308F27A39005CB29B /* icon.tcl */,
+ F966BB3408F27A39005CB29B /* image1.tcl */,
+ F966BB3508F27A39005CB29B /* image2.tcl */,
+ F966BB4208F27A3A005CB29B /* items.tcl */,
+ F966BB4308F27A3A005CB29B /* ixset */,
+ F92240290D7C620F005EC715 /* knightstour.tcl */,
+ F966BB4408F27A3A005CB29B /* label.tcl */,
+ F966BB4508F27A3A005CB29B /* labelframe.tcl */,
+ F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */,
+ F966BB4608F27A3A005CB29B /* menu.tcl */,
+ F966BB4708F27A3A005CB29B /* menubu.tcl */,
+ F966BB4808F27A3A005CB29B /* msgbox.tcl */,
+ F966BB4A08F27A3A005CB29B /* paned1.tcl */,
+ F966BB4B08F27A3A005CB29B /* paned2.tcl */,
+ F966BB4C08F27A3A005CB29B /* pendulum.tcl */,
+ F966BB4D08F27A3A005CB29B /* plot.tcl */,
+ F966BB4E08F27A3A005CB29B /* puzzle.tcl */,
+ F966BB4F08F27A3A005CB29B /* radio.tcl */,
+ F966BB5008F27A3A005CB29B /* README */,
+ F966BB5108F27A3A005CB29B /* rmt */,
+ F966BB5208F27A3A005CB29B /* rolodex */,
+ F966BB5308F27A3A005CB29B /* ruler.tcl */,
+ F966BB5408F27A3A005CB29B /* sayings.tcl */,
+ F966BB5508F27A3A005CB29B /* search.tcl */,
+ F966BB5608F27A3A005CB29B /* spin.tcl */,
+ F966BB5708F27A3A005CB29B /* square */,
+ F966BB5808F27A3A005CB29B /* states.tcl */,
+ F966BB5908F27A3A005CB29B /* style.tcl */,
+ F966BB5A08F27A3A005CB29B /* tclIndex */,
+ F966BB5B08F27A3A005CB29B /* tcolor */,
+ F966BB5C08F27A3A005CB29B /* text.tcl */,
+ F9099B8A0CC67D30005A9580 /* textpeer.tcl */,
+ F966BB5D08F27A3A005CB29B /* timer */,
+ F936FCD90CCD984600716967 /* toolbar.tcl */,
+ F936FCD80CCD984600716967 /* tree.tcl */,
+ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */,
+ F9F4EFDD0CC7B3CB00378A27 /* ttkmenu.tcl */,
+ F936FCDA0CCD984600716967 /* ttknote.tcl */,
+ F9F4EFDC0CC7B3CA00378A27 /* ttkpane.tcl */,
+ F936FCD70CCD984500716967 /* ttkprogress.tcl */,
+ F966BB5E08F27A3A005CB29B /* twind.tcl */,
+ F966BB5F08F27A3A005CB29B /* unicodeout.tcl */,
+ F966BB6008F27A3A005CB29B /* vscale.tcl */,
+ F966BB6108F27A3A005CB29B /* widget */,
+ );
+ path = demos;
+ sourceTree = "<group>";
+ };
+ F966BB9708F27A3B005CB29B /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ F966BBBA08F27A3B005CB29B /* configure.ac */,
+ F966BBBB08F27A3B005CB29B /* GNUmakefile */,
+ F966BBBE08F27A3B005CB29B /* README */,
+ F966BBC008F27A3B005CB29B /* Tk-Info.plist.in */,
+ F966BBC208F27A3B005CB29B /* tkMacOSX.h */,
+ F966BBC508F27A3B005CB29B /* tkMacOSXBitmap.c */,
+ F966BBC608F27A3B005CB29B /* tkMacOSXButton.c */,
+ F966BBC808F27A3B005CB29B /* tkMacOSXClipboard.c */,
+ F966BBC908F27A3B005CB29B /* tkMacOSXColor.c */,
+ F966BBCA08F27A3B005CB29B /* tkMacOSXConfig.c */,
+ F966BBCB08F27A3B005CB29B /* tkMacOSXCursor.c */,
+ F966BBCC08F27A3B005CB29B /* tkMacOSXCursors.h */,
+ F966BBCD08F27A3B005CB29B /* tkMacOSXDebug.c */,
+ F966BBCE08F27A3B005CB29B /* tkMacOSXDebug.h */,
+ F966BBCF08F27A3B005CB29B /* tkMacOSXDefault.h */,
+ F966BBD008F27A3B005CB29B /* tkMacOSXDialog.c */,
+ F966BBD108F27A3B005CB29B /* tkMacOSXDraw.c */,
+ F966BBD208F27A3B005CB29B /* tkMacOSXEmbed.c */,
+ F966BBD308F27A3B005CB29B /* tkMacOSXEntry.c */,
+ F966BBD408F27A3B005CB29B /* tkMacOSXEvent.c */,
+ F966BBD508F27A3B005CB29B /* tkMacOSXEvent.h */,
+ F966BBD608F27A3B005CB29B /* tkMacOSXFont.c */,
+ F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */,
+ F966BBD708F27A3B005CB29B /* tkMacOSXHLEvents.c */,
+ F966BBD808F27A3B005CB29B /* tkMacOSXInit.c */,
+ F966BBDA08F27A3B005CB29B /* tkMacOSXInt.h */,
+ F966BBDB08F27A3B005CB29B /* tkMacOSXKeyboard.c */,
+ F966BBDC08F27A3B005CB29B /* tkMacOSXKeyEvent.c */,
+ F966BBDD08F27A3B005CB29B /* tkMacOSXMenu.c */,
+ F966BBE008F27A3B005CB29B /* tkMacOSXMenubutton.c */,
+ F966BBE108F27A3B005CB29B /* tkMacOSXMenus.c */,
+ F966BBE208F27A3B005CB29B /* tkMacOSXMouseEvent.c */,
+ F966BBE308F27A3B005CB29B /* tkMacOSXNotify.c */,
+ F966BBEA08F27A3C005CB29B /* tkMacOSXPort.h */,
+ F976F6A70C325FB6005066D9 /* tkMacOSXPrivate.h */,
+ F966BBEB08F27A3C005CB29B /* tkMacOSXRegion.c */,
+ F966BBEC08F27A3C005CB29B /* tkMacOSXScale.c */,
+ F966BBED08F27A3C005CB29B /* tkMacOSXScrlbr.c */,
+ F966BBEE08F27A3C005CB29B /* tkMacOSXSend.c */,
+ F966BBEF08F27A3C005CB29B /* tkMacOSXSubwindows.c */,
+ F966BBF008F27A3C005CB29B /* tkMacOSXTest.c */,
+ F966BBF108F27A3C005CB29B /* tkMacOSXWindowEvent.c */,
+ F966BBF208F27A3C005CB29B /* tkMacOSXWm.c */,
+ F966BBF308F27A3C005CB29B /* tkMacOSXWm.h */,
+ F966BBF408F27A3C005CB29B /* tkMacOSXXCursors.h */,
+ F966BBF508F27A3C005CB29B /* tkMacOSXXStubs.c */,
+ F96888840AF78938000797B5 /* ttkMacOSXTheme.c */,
+ F95D8D4B0F1715610006B020 /* Tk.icns */,
+ F95D8D4C0F1715610006B020 /* Tk.tiff */,
+ F966BBF708F27A3C005CB29B /* Wish-Info.plist.in */,
+ F97590AE1039A96200558A9A /* Wish.sdef */,
+ F97AE7F10B65C1E900310EA2 /* Tk-Common.xcconfig */,
+ F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */,
+ F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ F966BC0408F27A3C005CB29B /* tests */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC0508F27A3C005CB29B /* all.tcl */,
+ F966BC0608F27A3C005CB29B /* arc.tcl */,
+ F966BC0708F27A3C005CB29B /* bell.test */,
+ F966BC0808F27A3C005CB29B /* bevel.tcl */,
+ F966BC0908F27A3C005CB29B /* bgerror.test */,
+ F966BC0A08F27A3C005CB29B /* bind.test */,
+ F966BC0B08F27A3C005CB29B /* bitmap.test */,
+ F966BC0C08F27A3C005CB29B /* border.test */,
+ F966BC0D08F27A3C005CB29B /* bugs.tcl */,
+ F966BC0E08F27A3C005CB29B /* butGeom.tcl */,
+ F966BC0F08F27A3C005CB29B /* butGeom2.tcl */,
+ F966BC1008F27A3C005CB29B /* button.test */,
+ F966BC1108F27A3C005CB29B /* canvas.test */,
+ F966BC1208F27A3C005CB29B /* canvImg.test */,
+ F966BC1308F27A3C005CB29B /* canvPs.test */,
+ F966BC1408F27A3C005CB29B /* canvPsArc.tcl */,
+ F966BC1508F27A3C005CB29B /* canvPsBmap.tcl */,
+ F966BC1608F27A3C005CB29B /* canvPsGrph.tcl */,
+ F966BC1708F27A3C005CB29B /* canvPsImg.tcl */,
+ F966BC1808F27A3C005CB29B /* canvPsText.tcl */,
+ F966BC1908F27A3C005CB29B /* canvRect.test */,
+ F966BC1A08F27A3C005CB29B /* canvText.test */,
+ F966BC1B08F27A3C005CB29B /* canvWind.test */,
+ F966BC1C08F27A3C005CB29B /* choosedir.test */,
+ F966BC1D08F27A3C005CB29B /* clipboard.test */,
+ F966BC1E08F27A3C005CB29B /* clrpick.test */,
+ F966BC1F08F27A3C005CB29B /* cmap.tcl */,
+ F966BC2008F27A3C005CB29B /* cmds.test */,
+ F966BC2108F27A3C005CB29B /* color.test */,
+ F966BC2208F27A3C005CB29B /* config.test */,
+ F966BC2308F27A3C005CB29B /* constraints.tcl */,
+ F966BC2408F27A3C005CB29B /* cursor.test */,
+ F966BC2508F27A3C005CB29B /* dialog.test */,
+ F966BC2608F27A3C005CB29B /* embed.test */,
+ F966BC2708F27A3C005CB29B /* entry.test */,
+ F966BC2808F27A3C005CB29B /* event.test */,
+ F966BC2908F27A3C005CB29B /* filebox.test */,
+ F966BC2A08F27A3C005CB29B /* focus.test */,
+ F966BC2B08F27A3C005CB29B /* focusTcl.test */,
+ F966BC2C08F27A3C005CB29B /* font.test */,
+ F99388950EE02D980065FE6B /* fontchooser.test */,
+ F966BC2D08F27A3C005CB29B /* frame.test */,
+ F966BC2E08F27A3C005CB29B /* geometry.test */,
+ F966BC2F08F27A3C005CB29B /* get.test */,
+ F966BC3008F27A3C005CB29B /* grab.test */,
+ F966BC3108F27A3C005CB29B /* grid.test */,
+ F966BC3308F27A3C005CB29B /* image.test */,
+ F966BC3408F27A3C005CB29B /* imgBmap.test */,
+ F966BC3508F27A3C005CB29B /* imgPhoto.test */,
+ F9DD99BF0F07DFCD0018B2E4 /* imgPNG.test */,
+ F966BC3608F27A3C005CB29B /* imgPPM.test */,
+ F966BC3708F27A3C005CB29B /* listbox.test */,
+ F966BC3808F27A3C005CB29B /* main.test */,
+ F966BC3908F27A3C005CB29B /* menu.test */,
+ F966BC3A08F27A3C005CB29B /* menubut.test */,
+ F966BC3B08F27A3C005CB29B /* menuDraw.test */,
+ F966BC3C08F27A3C005CB29B /* message.test */,
+ F966BC3D08F27A3C005CB29B /* msgbox.test */,
+ F966BC3E08F27A3C005CB29B /* obj.test */,
+ F966BC3F08F27A3C005CB29B /* oldpack.test */,
+ F966BC4008F27A3C005CB29B /* option.file1 */,
+ F966BC4108F27A3C005CB29B /* option.file2 */,
+ F966BC4208F27A3C005CB29B /* option.test */,
+ F966BC4308F27A3C005CB29B /* pack.test */,
+ F966BC4408F27A3C005CB29B /* panedwindow.test */,
+ F966BC4508F27A3D005CB29B /* place.test */,
+ F966BC4608F27A3D005CB29B /* raise.test */,
+ F966BC4708F27A3D005CB29B /* README */,
+ F966BC4808F27A3D005CB29B /* safe.test */,
+ F966BC4908F27A3D005CB29B /* scale.test */,
+ F966BC4A08F27A3D005CB29B /* scrollbar.test */,
+ F966BC4B08F27A3D005CB29B /* select.test */,
+ F966BC4C08F27A3D005CB29B /* send.test */,
+ F966BC4D08F27A3D005CB29B /* spinbox.test */,
+ F966BC4E08F27A3D005CB29B /* text.test */,
+ F966BC4F08F27A3D005CB29B /* textBTree.test */,
+ F966BC5008F27A3D005CB29B /* textDisp.test */,
+ F966BC5108F27A3D005CB29B /* textImage.test */,
+ F966BC5208F27A3D005CB29B /* textIndex.test */,
+ F966BC5308F27A3D005CB29B /* textMark.test */,
+ F966BC5408F27A3D005CB29B /* textTag.test */,
+ F966BC5508F27A3D005CB29B /* textWind.test */,
+ F966BC5608F27A3D005CB29B /* tk.test */,
+ F96888530AF7880C000797B5 /* ttk */,
+ F966BC5708F27A3D005CB29B /* unixButton.test */,
+ F966BC5808F27A3D005CB29B /* unixEmbed.test */,
+ F966BC5908F27A3D005CB29B /* unixFont.test */,
+ F966BC5A08F27A3D005CB29B /* unixMenu.test */,
+ F966BC5B08F27A3D005CB29B /* unixSelect.test */,
+ F966BC5C08F27A3D005CB29B /* unixWm.test */,
+ F966BC5D08F27A3D005CB29B /* util.test */,
+ F966BC5E08F27A3D005CB29B /* visual.test */,
+ F966BC5F08F27A3D005CB29B /* visual_bb.test */,
+ F966BC6008F27A3D005CB29B /* winButton.test */,
+ F966BC6108F27A3D005CB29B /* winClipboard.test */,
+ F966BC6208F27A3D005CB29B /* winDialog.test */,
+ F966BC6308F27A3D005CB29B /* window.test */,
+ F966BC6408F27A3D005CB29B /* winfo.test */,
+ F966BC6508F27A3D005CB29B /* winFont.test */,
+ F966BC6608F27A3D005CB29B /* winMenu.test */,
+ F966BC6708F27A3D005CB29B /* winSend.test */,
+ F966BC6808F27A3D005CB29B /* winWm.test */,
+ F966BC6908F27A3D005CB29B /* wm.test */,
+ F966BC6A08F27A3D005CB29B /* xmfbox.test */,
+ );
+ path = tests;
+ sourceTree = "<group>";
+ };
+ F966BC6B08F27A3D005CB29B /* unix */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC6C08F27A3D005CB29B /* aclocal.m4 */,
+ F966BC6D08F27A3D005CB29B /* configure */,
+ F966BC6E08F27A3D005CB29B /* configure.in */,
+ F966BC6F08F27A3D005CB29B /* install-sh */,
+ F966BC7008F27A3D005CB29B /* installManPage */,
+ F966BC7108F27A3D005CB29B /* Makefile.in */,
+ F966BC7208F27A3D005CB29B /* README */,
+ F966BC7308F27A3D005CB29B /* tcl.m4 */,
+ F974D57B0FBE7EC000BF728B /* tk.pc.in */,
+ F966BC7408F27A3D005CB29B /* tk.spec */,
+ F966BC7508F27A3D005CB29B /* tkAppInit.c */,
+ F966BC7608F27A3D005CB29B /* tkConfig.h.in */,
+ F966BC7708F27A3D005CB29B /* tkConfig.sh.in */,
+ F966BC7808F27A3D005CB29B /* tkUnix.c */,
+ F966BC7908F27A3D005CB29B /* tkUnix3d.c */,
+ F966BC7A08F27A3D005CB29B /* tkUnixButton.c */,
+ F966BC7B08F27A3D005CB29B /* tkUnixColor.c */,
+ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */,
+ F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */,
+ F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */,
+ F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */,
+ F966BC8008F27A3D005CB29B /* tkUnixDraw.c */,
+ F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */,
+ F966BC8208F27A3D005CB29B /* tkUnixEvent.c */,
+ F966BC8308F27A3D005CB29B /* tkUnixFocus.c */,
+ F966BC8408F27A3D005CB29B /* tkUnixFont.c */,
+ F966BC8508F27A3D005CB29B /* tkUnixInit.c */,
+ F966BC8608F27A3D005CB29B /* tkUnixInt.h */,
+ F966BC8708F27A3D005CB29B /* tkUnixKey.c */,
+ F966BC8808F27A3D005CB29B /* tkUnixMenu.c */,
+ F966BC8908F27A3D005CB29B /* tkUnixMenubu.c */,
+ F966BC8A08F27A3D005CB29B /* tkUnixPort.h */,
+ F966BC8B08F27A3D005CB29B /* tkUnixRFont.c */,
+ F966BC8C08F27A3D005CB29B /* tkUnixScale.c */,
+ F966BC8D08F27A3D005CB29B /* tkUnixScrlbr.c */,
+ F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */,
+ F966BC8F08F27A3D005CB29B /* tkUnixSend.c */,
+ F966BC9008F27A3D005CB29B /* tkUnixWm.c */,
+ F966BC9108F27A3D005CB29B /* tkUnixXId.c */,
+ );
+ path = unix;
+ sourceTree = "<group>";
+ };
+ F966BC9208F27A3D005CB29B /* win */ = {
+ isa = PBXGroup;
+ children = (
+ F966BC9408F27A3D005CB29B /* aclocal.m4 */,
+ F966BC9508F27A3D005CB29B /* buildall.vc.bat */,
+ F966BC9608F27A3E005CB29B /* configure */,
+ F966BC9708F27A3E005CB29B /* configure.in */,
+ F966BC9808F27A3E005CB29B /* makefile.bc */,
+ F966BC9908F27A3E005CB29B /* Makefile.in */,
+ F966BC9A08F27A3E005CB29B /* makefile.vc */,
+ F966BC9B08F27A3E005CB29B /* mkd.bat */,
+ F966BC9C08F27A3E005CB29B /* nmakehlp.c */,
+ F966BC9D08F27A3E005CB29B /* rc */,
+ F966BCF308F27A3E005CB29B /* README */,
+ F966BCF408F27A3E005CB29B /* rmd.bat */,
+ F966BCF508F27A3F005CB29B /* rules.vc */,
+ F966BCF608F27A3F005CB29B /* stubs.c */,
+ F966BCF708F27A3F005CB29B /* tcl.m4 */,
+ F966BCF808F27A3F005CB29B /* tkConfig.sh.in */,
+ F966BCF908F27A3F005CB29B /* tkWin.h */,
+ F966BCFA08F27A3F005CB29B /* tkWin32Dll.c */,
+ F966BCFB08F27A3F005CB29B /* tkWin3d.c */,
+ F966BCFC08F27A3F005CB29B /* tkWinButton.c */,
+ F966BCFD08F27A3F005CB29B /* tkWinClipboard.c */,
+ F966BCFE08F27A3F005CB29B /* tkWinColor.c */,
+ F966BCFF08F27A3F005CB29B /* tkWinConfig.c */,
+ F966BD0008F27A3F005CB29B /* tkWinCursor.c */,
+ F966BD0108F27A3F005CB29B /* tkWinDefault.h */,
+ F966BD0208F27A3F005CB29B /* tkWinDialog.c */,
+ F966BD0308F27A3F005CB29B /* tkWinDraw.c */,
+ F966BD0408F27A3F005CB29B /* tkWinEmbed.c */,
+ F966BD0508F27A3F005CB29B /* tkWinFont.c */,
+ F966BD0708F27A3F005CB29B /* tkWinImage.c */,
+ F966BD0808F27A3F005CB29B /* tkWinInit.c */,
+ F966BD0908F27A3F005CB29B /* tkWinInt.h */,
+ F966BD0A08F27A3F005CB29B /* tkWinKey.c */,
+ F966BD0B08F27A3F005CB29B /* tkWinMenu.c */,
+ F966BD0C08F27A3F005CB29B /* tkWinPixmap.c */,
+ F966BD0D08F27A3F005CB29B /* tkWinPointer.c */,
+ F966BD0E08F27A3F005CB29B /* tkWinPort.h */,
+ F966BD0F08F27A3F005CB29B /* tkWinRegion.c */,
+ F966BD1008F27A3F005CB29B /* tkWinScrlbr.c */,
+ F966BD1108F27A3F005CB29B /* tkWinSend.c */,
+ F966BD1208F27A3F005CB29B /* tkWinSendCom.c */,
+ F966BD1308F27A3F005CB29B /* tkWinSendCom.h */,
+ F966BD1408F27A3F005CB29B /* tkWinTest.c */,
+ F966BD1508F27A3F005CB29B /* tkWinWindow.c */,
+ F966BD1608F27A3F005CB29B /* tkWinWm.c */,
+ F966BD1708F27A3F005CB29B /* tkWinX.c */,
+ F96888860AF78953000797B5 /* ttkWinMonitor.c */,
+ F96888870AF78953000797B5 /* ttkWinTheme.c */,
+ F96888880AF78953000797B5 /* ttkWinXPTheme.c */,
+ F966BD1808F27A3F005CB29B /* winMain.c */,
+ );
+ path = win;
+ sourceTree = "<group>";
+ };
+ F966BC9D08F27A3E005CB29B /* rc */ = {
+ isa = PBXGroup;
+ children = (
+ F966BCEE08F27A3E005CB29B /* tk.rc */,
+ F966BCEF08F27A3E005CB29B /* tk_base.rc */,
+ F966BCF208F27A3E005CB29B /* wish.rc */,
+ );
+ path = rc;
+ sourceTree = "<group>";
+ };
+ F966BD1908F27A3F005CB29B /* xlib */ = {
+ isa = PBXGroup;
+ children = (
+ F966BD1A08F27A3F005CB29B /* X11 */,
+ F966BD2308F27A3F005CB29B /* xbytes.h */,
+ F966BD2408F27A3F005CB29B /* xcolors.c */,
+ F966BD2508F27A3F005CB29B /* xdraw.c */,
+ F966BD2608F27A3F005CB29B /* xgc.c */,
+ F966BD2708F27A3F005CB29B /* ximage.c */,
+ F966BD2808F27A3F005CB29B /* xutil.c */,
+ );
+ path = xlib;
+ sourceTree = "<group>";
+ };
+ F966BD1A08F27A3F005CB29B /* X11 */ = {
+ isa = PBXGroup;
+ children = (
+ F966BD1B08F27A3F005CB29B /* cursorfont.h */,
+ F966BD1C08F27A3F005CB29B /* keysym.h */,
+ F966BD1D08F27A3F005CB29B /* keysymdef.h */,
+ F966BD1E08F27A3F005CB29B /* X.h */,
+ F966BD1F08F27A3F005CB29B /* Xatom.h */,
+ F966BD2008F27A3F005CB29B /* Xfuncproto.h */,
+ F966BD2108F27A3F005CB29B /* Xlib.h */,
+ F966BD2208F27A3F005CB29B /* Xutil.h */,
+ );
+ path = X11;
+ sourceTree = "<group>";
+ };
+ F966C06F08F281DC005CB29B /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ F9C9CBFF0E84059800E00935 /* ApplicationServices.framework */,
+ F966C07408F2820D005CB29B /* CoreFoundation.framework */,
+ F96437E60EF0D652003F468E /* libz.dylib */,
+ F966C07608F2821B005CB29B /* Carbon.framework */,
+ F94523A10E6FC2AC00C1D987 /* Cocoa.framework */,
+ F966C07808F28233005CB29B /* IOKit.framework */,
+ F9FD32140CC1AF170073837D /* libX11.dylib */,
+ F9FD32150CC1AF170073837D /* libXext.dylib */,
+ F9FD32160CC1AF170073837D /* libXss.dylib */,
+ F9FD349A0CC1BB0D0073837D /* libXft.dylib */,
+ F9FD34990CC1BB0D0073837D /* libfreetype.dylib */,
+ F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ F96887DF0AF786D5000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96887E00AF786D5000797B5 /* ttk.decls */,
+ F96887E10AF786D5000797B5 /* ttkBlink.c */,
+ F96887E20AF786D5000797B5 /* ttkButton.c */,
+ F96887E30AF786D5000797B5 /* ttkCache.c */,
+ F96887E40AF786D5000797B5 /* ttkClamTheme.c */,
+ F96887E50AF786D5000797B5 /* ttkClassicTheme.c */,
+ F96887E60AF786D5000797B5 /* ttkDecls.h */,
+ F96887E70AF786D5000797B5 /* ttkDefaultTheme.c */,
+ F96887E80AF786D5000797B5 /* ttkElements.c */,
+ F96887E90AF786D5000797B5 /* ttkEntry.c */,
+ F96887EA0AF786D5000797B5 /* ttkFrame.c */,
+ F96887EB0AF786D5000797B5 /* ttkImage.c */,
+ F96887EC0AF786D5000797B5 /* ttkInit.c */,
+ F96887ED0AF786D5000797B5 /* ttkLabel.c */,
+ F96887EE0AF786D5000797B5 /* ttkLayout.c */,
+ F96887EF0AF786D5000797B5 /* ttkManager.c */,
+ F96887F00AF786D5000797B5 /* ttkManager.h */,
+ F96887F10AF786D5000797B5 /* ttkNotebook.c */,
+ F96887F20AF786D5000797B5 /* ttkPanedwindow.c */,
+ F96887F30AF786D5000797B5 /* ttkProgress.c */,
+ F96887F40AF786D5000797B5 /* ttkScale.c */,
+ F96887F50AF786D5000797B5 /* ttkScroll.c */,
+ F96887F60AF786D5000797B5 /* ttkScrollbar.c */,
+ F96887F70AF786D5000797B5 /* ttkSeparator.c */,
+ F96887F80AF786D5000797B5 /* ttkSquare.c */,
+ F96887F90AF786D5000797B5 /* ttkState.c */,
+ F96887FA0AF786D5000797B5 /* ttkStubInit.c */,
+ F96887FB0AF786D5000797B5 /* ttkStubLib.c */,
+ F96887FC0AF786D5000797B5 /* ttkTagSet.c */,
+ F96887FD0AF786D5000797B5 /* ttkTheme.c */,
+ F96887FE0AF786D5000797B5 /* ttkTheme.h */,
+ F96887FF0AF786D5000797B5 /* ttkThemeInt.h */,
+ F96888000AF786D5000797B5 /* ttkTrace.c */,
+ F96888010AF786D5000797B5 /* ttkTrack.c */,
+ F96888020AF786D5000797B5 /* ttkTreeview.c */,
+ F96888030AF786D5000797B5 /* ttkWidget.c */,
+ F96888040AF786D5000797B5 /* ttkWidget.h */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96888360AF787B3000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96888370AF787B3000797B5 /* altTheme.tcl */,
+ F96888380AF787B3000797B5 /* aquaTheme.tcl */,
+ F96888390AF787B3000797B5 /* button.tcl */,
+ F968883A0AF787B3000797B5 /* clamTheme.tcl */,
+ F968883B0AF787B3000797B5 /* classicTheme.tcl */,
+ F968883C0AF787B3000797B5 /* combobox.tcl */,
+ F968883D0AF787B3000797B5 /* cursors.tcl */,
+ F968883E0AF787B3000797B5 /* defaults.tcl */,
+ F96888400AF787B3000797B5 /* entry.tcl */,
+ F96888410AF787B3000797B5 /* fonts.tcl */,
+ F96888440AF787B3000797B5 /* menubutton.tcl */,
+ F96888450AF787B3000797B5 /* notebook.tcl */,
+ F96888460AF787B3000797B5 /* panedwindow.tcl */,
+ F96888470AF787B3000797B5 /* progress.tcl */,
+ F96888480AF787B3000797B5 /* scale.tcl */,
+ F96888490AF787B3000797B5 /* scrollbar.tcl */,
+ F968884A0AF787B3000797B5 /* sizegrip.tcl */,
+ F968884B0AF787B3000797B5 /* treeview.tcl */,
+ F968884C0AF787B3000797B5 /* ttk.tcl */,
+ F968884D0AF787B3000797B5 /* utils.tcl */,
+ F968884E0AF787B3000797B5 /* winTheme.tcl */,
+ F973E5960EE99384001A648E /* vistaTheme.tcl */,
+ F968884F0AF787B3000797B5 /* xpTheme.tcl */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96888530AF7880C000797B5 /* ttk */ = {
+ isa = PBXGroup;
+ children = (
+ F96888540AF7880C000797B5 /* all.tcl */,
+ F98383650F0FA43900171CA6 /* checkbutton.test */,
+ F96888560AF7880C000797B5 /* combobox.test */,
+ F96888570AF7880C000797B5 /* entry.test */,
+ F96888580AF7880C000797B5 /* image.test */,
+ F96888590AF7880C000797B5 /* labelframe.test */,
+ F968885A0AF7880C000797B5 /* layout.test */,
+ F968885C0AF7880C000797B5 /* notebook.test */,
+ F968885D0AF7880C000797B5 /* panedwindow.test */,
+ F968885E0AF7880C000797B5 /* progressbar.test */,
+ F98383680F0FA44700171CA6 /* radiobutton.test */,
+ F968885F0AF7880C000797B5 /* scrollbar.test */,
+ F96888600AF7880C000797B5 /* treetags.test */,
+ F96888610AF7880C000797B5 /* treeview.test */,
+ F96888620AF7880C000797B5 /* ttk.test */,
+ F96888630AF7880C000797B5 /* validate.test */,
+ F962F7C60DADC26200648DB8 /* vsapi.test */,
+ );
+ path = ttk;
+ sourceTree = "<group>";
+ };
+ F96D3DF608F27169004A47F5 /* Tcl Sources */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3EC908F272A7004A47F5 /* generic */,
+ F96D432C08F272B4004A47F5 /* macosx */,
+ F96D443E08F272B9004A47F5 /* unix */,
+ F96D425C08F272B2004A47F5 /* libtommath */,
+ F96D446E08F272B9004A47F5 /* win */,
+ F96D3F3808F272A7004A47F5 /* library */,
+ F96D434408F272B5004A47F5 /* tests */,
+ F96D3DFC08F272A4004A47F5 /* doc */,
+ F96D43D008F272B8004A47F5 /* tools */,
+ F9183E690EFC81560030B814 /* pkgs */,
+ F96D3DFA08F272A4004A47F5 /* ChangeLog */,
+ F96D3DFB08F272A4004A47F5 /* changes */,
+ F96D434308F272B5004A47F5 /* README */,
+ F96D432B08F272B4004A47F5 /* license.terms */,
+ );
+ name = "Tcl Sources";
+ sourceTree = TCL_SRCROOT;
+ };
+ F96D3DF708F271BE004A47F5 /* Tk Sources */ = {
+ isa = PBXGroup;
+ children = (
+ F966BAA508F27A38005CB29B /* generic */,
+ F966BB9708F27A3B005CB29B /* macosx */,
+ F966BC6B08F27A3D005CB29B /* unix */,
+ F966BD1908F27A3F005CB29B /* xlib */,
+ F966BA0308F27A37005CB29B /* bitmaps */,
+ F966BC9208F27A3D005CB29B /* win */,
+ F966BB1308F27A39005CB29B /* library */,
+ F966BC0408F27A3C005CB29B /* tests */,
+ F966BA1008F27A37005CB29B /* doc */,
+ F966BA0E08F27A37005CB29B /* ChangeLog */,
+ F966BA0F08F27A37005CB29B /* changes */,
+ F966BC0308F27A3C005CB29B /* README */,
+ F966BB9608F27A3B005CB29B /* license.terms */,
+ );
+ name = "Tk Sources";
+ sourceTree = TK_SRCROOT;
+ };
+ F96D3DFC08F272A4004A47F5 /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3DFD08F272A4004A47F5 /* Access.3 */,
+ F96D3DFE08F272A4004A47F5 /* AddErrInfo.3 */,
+ F96D3DFF08F272A4004A47F5 /* after.n */,
+ F96D3E0008F272A4004A47F5 /* Alloc.3 */,
+ F96D3E0108F272A4004A47F5 /* AllowExc.3 */,
+ F96D3E0208F272A4004A47F5 /* append.n */,
+ F96D3E0308F272A4004A47F5 /* AppInit.3 */,
+ F96D3E0408F272A5004A47F5 /* array.n */,
+ F96D3E0508F272A5004A47F5 /* AssocData.3 */,
+ F96D3E0608F272A5004A47F5 /* Async.3 */,
+ F96D3E0708F272A5004A47F5 /* BackgdErr.3 */,
+ F96D3E0808F272A5004A47F5 /* Backslash.3 */,
+ F96D3E0908F272A5004A47F5 /* bgerror.n */,
+ F96D3E0A08F272A5004A47F5 /* binary.n */,
+ F96D3E0B08F272A5004A47F5 /* BoolObj.3 */,
+ F96D3E0C08F272A5004A47F5 /* break.n */,
+ F96D3E0D08F272A5004A47F5 /* ByteArrObj.3 */,
+ F96D3E0E08F272A5004A47F5 /* CallDel.3 */,
+ F96D3E0F08F272A5004A47F5 /* case.n */,
+ F96D3E1008F272A5004A47F5 /* catch.n */,
+ F96D3E1108F272A5004A47F5 /* cd.n */,
+ F96D3E1208F272A5004A47F5 /* chan.n */,
+ F96D3E1308F272A5004A47F5 /* ChnlStack.3 */,
+ F93599CF0DF1F87F00E04F67 /* Class.3 */,
+ F93599D00DF1F89E00E04F67 /* class.n */,
+ F96D3E1408F272A5004A47F5 /* clock.n */,
+ F96D3E1508F272A5004A47F5 /* close.n */,
+ F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */,
+ F96D3E1708F272A5004A47F5 /* Concat.3 */,
+ F96D3E1808F272A5004A47F5 /* concat.n */,
+ F96D3E1908F272A5004A47F5 /* continue.n */,
+ F93599D20DF1F8DF00E04F67 /* copy.n */,
+ F974D5720FBE7DC600BF728B /* coroutine.n */,
+ F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */,
+ F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */,
+ F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */,
+ F96D3E1D08F272A5004A47F5 /* CrtCommand.3 */,
+ F96D3E1E08F272A5004A47F5 /* CrtFileHdlr.3 */,
+ F96D3E1F08F272A5004A47F5 /* CrtInterp.3 */,
+ F96D3E2008F272A5004A47F5 /* CrtMathFnc.3 */,
+ F96D3E2108F272A5004A47F5 /* CrtObjCmd.3 */,
+ F96D3E2208F272A5004A47F5 /* CrtSlave.3 */,
+ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */,
+ F96D3E2408F272A5004A47F5 /* CrtTrace.3 */,
+ F96D3E2508F272A5004A47F5 /* dde.n */,
+ F93599D30DF1F8F500E04F67 /* define.n */,
+ F96D3E2608F272A5004A47F5 /* DetachPids.3 */,
+ F96D3E2708F272A5004A47F5 /* dict.n */,
+ F96D3E2808F272A5004A47F5 /* DictObj.3 */,
+ F96D3E2908F272A5004A47F5 /* DoOneEvent.3 */,
+ F96D3E2A08F272A5004A47F5 /* DoubleObj.3 */,
+ F96D3E2B08F272A5004A47F5 /* DoWhenIdle.3 */,
+ F96D3E2C08F272A5004A47F5 /* DString.3 */,
+ F96D3E2D08F272A5004A47F5 /* DumpActiveMemory.3 */,
+ F96D3E2E08F272A5004A47F5 /* Encoding.3 */,
+ F96D3E2F08F272A5004A47F5 /* encoding.n */,
+ F96D3E3008F272A5004A47F5 /* Ensemble.3 */,
+ F96D3E3108F272A5004A47F5 /* Environment.3 */,
+ F96D3E3208F272A5004A47F5 /* eof.n */,
+ F96D3E3308F272A5004A47F5 /* error.n */,
+ F96D3E3408F272A5004A47F5 /* Eval.3 */,
+ F96D3E3508F272A5004A47F5 /* eval.n */,
+ F96D3E3608F272A5004A47F5 /* exec.n */,
+ F96D3E3708F272A5004A47F5 /* Exit.3 */,
+ F96D3E3808F272A5004A47F5 /* exit.n */,
+ F96D3E3908F272A5004A47F5 /* expr.n */,
+ F96D3E3A08F272A5004A47F5 /* ExprLong.3 */,
+ F96D3E3B08F272A5004A47F5 /* ExprLongObj.3 */,
+ F96D3E3C08F272A5004A47F5 /* fblocked.n */,
+ F96D3E3D08F272A5004A47F5 /* fconfigure.n */,
+ F96D3E3E08F272A5004A47F5 /* fcopy.n */,
+ F96D3E3F08F272A5004A47F5 /* file.n */,
+ F96D3E4008F272A5004A47F5 /* fileevent.n */,
+ F96D3E4108F272A5004A47F5 /* filename.n */,
+ F96D3E4208F272A5004A47F5 /* FileSystem.3 */,
+ F96D3E4308F272A5004A47F5 /* FindExec.3 */,
+ F96D3E4408F272A5004A47F5 /* flush.n */,
+ F96D3E4508F272A5004A47F5 /* for.n */,
+ F96D3E4608F272A5004A47F5 /* foreach.n */,
+ F96D3E4708F272A5004A47F5 /* format.n */,
+ F96D3E4808F272A5004A47F5 /* GetCwd.3 */,
+ F96D3E4908F272A5004A47F5 /* GetHostName.3 */,
+ F96D3E4A08F272A5004A47F5 /* GetIndex.3 */,
+ F96D3E4B08F272A5004A47F5 /* GetInt.3 */,
+ F96D3E4C08F272A5004A47F5 /* GetOpnFl.3 */,
+ F96D3E4D08F272A5004A47F5 /* gets.n */,
+ F96D3E4E08F272A5004A47F5 /* GetStdChan.3 */,
+ F96D3E4F08F272A5004A47F5 /* GetTime.3 */,
+ F96D3E5008F272A5004A47F5 /* GetVersion.3 */,
+ F96D3E5108F272A5004A47F5 /* glob.n */,
+ F96D3E5208F272A6004A47F5 /* global.n */,
+ F96D3E5308F272A6004A47F5 /* Hash.3 */,
+ F96D3E5408F272A6004A47F5 /* history.n */,
+ F96D3E5508F272A6004A47F5 /* http.n */,
+ F96D3E5608F272A6004A47F5 /* if.n */,
+ F96D3E5708F272A6004A47F5 /* incr.n */,
+ F96D3E5808F272A6004A47F5 /* info.n */,
+ F96D3E5908F272A6004A47F5 /* Init.3 */,
+ F96D3E5A08F272A6004A47F5 /* InitStubs.3 */,
+ F96D3E5B08F272A6004A47F5 /* Interp.3 */,
+ F96D3E5C08F272A6004A47F5 /* interp.n */,
+ F96D3E5D08F272A6004A47F5 /* IntObj.3 */,
+ F96D3E5E08F272A6004A47F5 /* join.n */,
+ F96D3E5F08F272A6004A47F5 /* lappend.n */,
+ F96D3E6008F272A6004A47F5 /* lassign.n */,
+ F96D3E6108F272A6004A47F5 /* library.n */,
+ F96D3E6208F272A6004A47F5 /* Limit.3 */,
+ F96D3E6308F272A6004A47F5 /* lindex.n */,
+ F96D3E6408F272A6004A47F5 /* LinkVar.3 */,
+ F96D3E6508F272A6004A47F5 /* linsert.n */,
+ F96D3E6608F272A6004A47F5 /* list.n */,
+ F96D3E6708F272A6004A47F5 /* ListObj.3 */,
+ F96D3E6808F272A6004A47F5 /* llength.n */,
+ F96D3E6908F272A6004A47F5 /* load.n */,
+ F96D3E6A08F272A6004A47F5 /* lrange.n */,
+ F96D3E6B08F272A6004A47F5 /* lrepeat.n */,
+ F96D3E6C08F272A6004A47F5 /* lreplace.n */,
+ F96D3E6D08F272A6004A47F5 /* lsearch.n */,
+ F96D3E6E08F272A6004A47F5 /* lset.n */,
+ F96D3E6F08F272A6004A47F5 /* lsort.n */,
+ F96D3E7008F272A6004A47F5 /* man.macros */,
+ F96D3E7108F272A6004A47F5 /* mathfunc.n */,
+ F96D3E7208F272A6004A47F5 /* memory.n */,
+ F93599D40DF1F91900E04F67 /* Method.3 */,
+ F96D3E7308F272A6004A47F5 /* msgcat.n */,
+ F93599D50DF1F93700E04F67 /* my.n */,
+ F96D3E7408F272A6004A47F5 /* Namespace.3 */,
+ F96D3E7508F272A6004A47F5 /* namespace.n */,
+ F93599D60DF1F95000E04F67 /* next.n */,
+ F96D3E7608F272A6004A47F5 /* Notifier.3 */,
+ F96D3E7708F272A6004A47F5 /* Object.3 */,
+ F93599D70DF1F96800E04F67 /* object.n */,
+ F96D3E7808F272A6004A47F5 /* ObjectType.3 */,
+ F96D3E7908F272A6004A47F5 /* open.n */,
+ F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */,
+ F96D3E7B08F272A6004A47F5 /* OpenTcp.3 */,
+ F96D3E7C08F272A6004A47F5 /* package.n */,
+ F96D3E7D08F272A6004A47F5 /* packagens.n */,
+ F96D3E7E08F272A6004A47F5 /* Panic.3 */,
+ F96D3E7F08F272A6004A47F5 /* ParseCmd.3 */,
+ F96D3E8008F272A6004A47F5 /* pid.n */,
+ F96D3E8108F272A6004A47F5 /* pkgMkIndex.n */,
+ F96D3E8208F272A6004A47F5 /* PkgRequire.3 */,
+ F9ECB1E10B26543C00A28025 /* platform_shell.n */,
+ F9ECB1E20B26543C00A28025 /* platform.n */,
+ F96D3E8308F272A6004A47F5 /* Preserve.3 */,
+ F96D3E8408F272A6004A47F5 /* PrintDbl.3 */,
+ F96D3E8508F272A6004A47F5 /* proc.n */,
+ F96D3E8608F272A6004A47F5 /* puts.n */,
+ F96D3E8708F272A6004A47F5 /* pwd.n */,
+ F96D3E8808F272A6004A47F5 /* re_syntax.n */,
+ F96D3E8908F272A6004A47F5 /* read.n */,
+ F96D3E8A08F272A6004A47F5 /* RecEvalObj.3 */,
+ F96D3E8B08F272A6004A47F5 /* RecordEval.3 */,
+ F96D3E8C08F272A6004A47F5 /* RegConfig.3 */,
+ F96D3E8D08F272A6004A47F5 /* RegExp.3 */,
+ F96D3E8E08F272A6004A47F5 /* regexp.n */,
+ F96D3E8F08F272A6004A47F5 /* registry.n */,
+ F96D3E9008F272A6004A47F5 /* regsub.n */,
+ F96D3E9108F272A6004A47F5 /* rename.n */,
+ F96D3E9208F272A6004A47F5 /* return.n */,
+ F96D3E9308F272A6004A47F5 /* safe.n */,
+ F96D3E9408F272A6004A47F5 /* SaveResult.3 */,
+ F96D3E9508F272A6004A47F5 /* scan.n */,
+ F96D3E9608F272A6004A47F5 /* seek.n */,
+ F93599D80DF1F98300E04F67 /* self.n */,
+ F96D3E9708F272A6004A47F5 /* set.n */,
+ F96D3E9808F272A6004A47F5 /* SetChanErr.3 */,
+ F96D3E9908F272A6004A47F5 /* SetErrno.3 */,
+ F96D3E9A08F272A6004A47F5 /* SetRecLmt.3 */,
+ F96D3E9B08F272A7004A47F5 /* SetResult.3 */,
+ F96D3E9C08F272A7004A47F5 /* SetVar.3 */,
+ F96D3E9D08F272A7004A47F5 /* Signal.3 */,
+ F96D3E9E08F272A7004A47F5 /* Sleep.3 */,
+ F96D3E9F08F272A7004A47F5 /* socket.n */,
+ F96D3EA008F272A7004A47F5 /* source.n */,
+ F96D3EA108F272A7004A47F5 /* SourceRCFile.3 */,
+ F96D3EA208F272A7004A47F5 /* split.n */,
+ F96D3EA308F272A7004A47F5 /* SplitList.3 */,
+ F96D3EA408F272A7004A47F5 /* SplitPath.3 */,
+ F96D3EA508F272A7004A47F5 /* StaticPkg.3 */,
+ F96D3EA608F272A7004A47F5 /* StdChannels.3 */,
+ F96D3EA708F272A7004A47F5 /* string.n */,
+ F96D3EA808F272A7004A47F5 /* StringObj.3 */,
+ F96D3EA908F272A7004A47F5 /* StrMatch.3 */,
+ F96D3EAA08F272A7004A47F5 /* subst.n */,
+ F96D3EAB08F272A7004A47F5 /* SubstObj.3 */,
+ F96D3EAC08F272A7004A47F5 /* switch.n */,
+ F974D5760FBE7E1900BF728B /* tailcall.n */,
+ F96D3EAD08F272A7004A47F5 /* Tcl.n */,
+ F99D61180EF5573A00BBFE01 /* TclZlib.3 */,
+ F96D3EAE08F272A7004A47F5 /* Tcl_Main.3 */,
+ F96D3EAF08F272A7004A47F5 /* TCL_MEM_DEBUG.3 */,
+ F96D3EB008F272A7004A47F5 /* tclsh.1 */,
+ F96D3EB108F272A7004A47F5 /* tcltest.n */,
+ F96D3EB208F272A7004A47F5 /* tclvars.n */,
+ F96D3EB308F272A7004A47F5 /* tell.n */,
+ F96D3EB408F272A7004A47F5 /* Thread.3 */,
+ F9183E640EFC80CD0030B814 /* throw.n */,
+ F96D3EB508F272A7004A47F5 /* time.n */,
+ F96D3EB608F272A7004A47F5 /* tm.n */,
+ F96D3EB708F272A7004A47F5 /* ToUpper.3 */,
+ F96D3EB808F272A7004A47F5 /* trace.n */,
+ F96D3EB908F272A7004A47F5 /* TraceCmd.3 */,
+ F96D3EBA08F272A7004A47F5 /* TraceVar.3 */,
+ F96D3EBB08F272A7004A47F5 /* Translate.3 */,
+ F9183E650EFC80D70030B814 /* try.n */,
+ F96D3EBC08F272A7004A47F5 /* UniCharIsAlpha.3 */,
+ F96D3EBD08F272A7004A47F5 /* unknown.n */,
+ F96D3EBE08F272A7004A47F5 /* unload.n */,
+ F96D3EBF08F272A7004A47F5 /* unset.n */,
+ F96D3EC008F272A7004A47F5 /* update.n */,
+ F96D3EC108F272A7004A47F5 /* uplevel.n */,
+ F96D3EC208F272A7004A47F5 /* UpVar.3 */,
+ F96D3EC308F272A7004A47F5 /* upvar.n */,
+ F96D3EC408F272A7004A47F5 /* Utf.3 */,
+ F96D3EC508F272A7004A47F5 /* variable.n */,
+ F96D3EC608F272A7004A47F5 /* vwait.n */,
+ F96D3EC708F272A7004A47F5 /* while.n */,
+ F96D3EC808F272A7004A47F5 /* WrongNumArgs.3 */,
+ F915432D0EF201EE0032D1E8 /* zlib.n */,
+ );
+ path = doc;
+ sourceTree = "<group>";
+ };
+ F96D3EC908F272A7004A47F5 /* generic */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3ECA08F272A7004A47F5 /* README */,
+ F96D3ECB08F272A7004A47F5 /* regc_color.c */,
+ F96D3ECC08F272A7004A47F5 /* regc_cvec.c */,
+ F96D3ECD08F272A7004A47F5 /* regc_lex.c */,
+ F96D3ECE08F272A7004A47F5 /* regc_locale.c */,
+ F96D3ECF08F272A7004A47F5 /* regc_nfa.c */,
+ F96D3ED008F272A7004A47F5 /* regcomp.c */,
+ F96D3ED108F272A7004A47F5 /* regcustom.h */,
+ F96D3ED208F272A7004A47F5 /* rege_dfa.c */,
+ F96D3ED308F272A7004A47F5 /* regerror.c */,
+ F96D3ED408F272A7004A47F5 /* regerrs.h */,
+ F96D3ED508F272A7004A47F5 /* regex.h */,
+ F96D3ED608F272A7004A47F5 /* regexec.c */,
+ F96D3ED708F272A7004A47F5 /* regfree.c */,
+ F96D3ED808F272A7004A47F5 /* regfronts.c */,
+ F96D3ED908F272A7004A47F5 /* regguts.h */,
+ F96D3EDA08F272A7004A47F5 /* tcl.decls */,
+ F96D3EDB08F272A7004A47F5 /* tcl.h */,
+ F96D3EDC08F272A7004A47F5 /* tclAlloc.c */,
+ F96D3EDD08F272A7004A47F5 /* tclAsync.c */,
+ F96D3EDE08F272A7004A47F5 /* tclBasic.c */,
+ F96D3EDF08F272A7004A47F5 /* tclBinary.c */,
+ F96D3EE008F272A7004A47F5 /* tclCkalloc.c */,
+ F96D3EE108F272A7004A47F5 /* tclClock.c */,
+ F96D3EE208F272A7004A47F5 /* tclCmdAH.c */,
+ F96D3EE308F272A7004A47F5 /* tclCmdIL.c */,
+ F96D3EE408F272A7004A47F5 /* tclCmdMZ.c */,
+ F96D3EE508F272A7004A47F5 /* tclCompCmds.c */,
+ F96D3EE608F272A7004A47F5 /* tclCompExpr.c */,
+ F96D3EE708F272A7004A47F5 /* tclCompile.c */,
+ F96D3EE808F272A7004A47F5 /* tclCompile.h */,
+ F96D3EE908F272A7004A47F5 /* tclConfig.c */,
+ F96D3EEA08F272A7004A47F5 /* tclDate.c */,
+ F96D3EEB08F272A7004A47F5 /* tclDecls.h */,
+ F96D3EEC08F272A7004A47F5 /* tclDictObj.c */,
+ F9F4415D0C8BAE6F00BCCD67 /* tclDTrace.d */,
+ F96D3EED08F272A7004A47F5 /* tclEncoding.c */,
+ F96D3EEE08F272A7004A47F5 /* tclEnv.c */,
+ F96D3EEF08F272A7004A47F5 /* tclEvent.c */,
+ F96D3EF008F272A7004A47F5 /* tclExecute.c */,
+ F96D3EF108F272A7004A47F5 /* tclFCmd.c */,
+ F96D3EF208F272A7004A47F5 /* tclFileName.c */,
+ F96D3EF308F272A7004A47F5 /* tclFileSystem.h */,
+ F96D3EF408F272A7004A47F5 /* tclGet.c */,
+ F96D3EF508F272A7004A47F5 /* tclGetDate.y */,
+ F96D3EF608F272A7004A47F5 /* tclHash.c */,
+ F96D3EF708F272A7004A47F5 /* tclHistory.c */,
+ F96D3EF808F272A7004A47F5 /* tclIndexObj.c */,
+ F96D3EF908F272A7004A47F5 /* tclInt.decls */,
+ F96D3EFA08F272A7004A47F5 /* tclInt.h */,
+ F96D3EFB08F272A7004A47F5 /* tclIntDecls.h */,
+ F96D3EFC08F272A7004A47F5 /* tclInterp.c */,
+ F96D3EFD08F272A7004A47F5 /* tclIntPlatDecls.h */,
+ F96D3EFE08F272A7004A47F5 /* tclIO.c */,
+ F96D3EFF08F272A7004A47F5 /* tclIO.h */,
+ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */,
+ F96D3F0108F272A7004A47F5 /* tclIOGT.c */,
+ F96D3F0208F272A7004A47F5 /* tclIORChan.c */,
+ F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */,
+ F96D3F0308F272A7004A47F5 /* tclIOSock.c */,
+ F96D3F0408F272A7004A47F5 /* tclIOUtil.c */,
+ F96D3F0508F272A7004A47F5 /* tclLink.c */,
+ F96D3F0608F272A7004A47F5 /* tclListObj.c */,
+ F96D3F0708F272A7004A47F5 /* tclLiteral.c */,
+ F96D3F0808F272A7004A47F5 /* tclLoad.c */,
+ F96D3F0908F272A7004A47F5 /* tclLoadNone.c */,
+ F96D3F0A08F272A7004A47F5 /* tclMain.c */,
+ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */,
+ F96D3F0C08F272A7004A47F5 /* tclNotify.c */,
+ F96D3F0D08F272A7004A47F5 /* tclObj.c */,
+ F93599B20DF1F75400E04F67 /* tclOO.c */,
+ F93599B40DF1F75900E04F67 /* tclOO.decls */,
+ F93599B50DF1F75D00E04F67 /* tclOO.h */,
+ F93599B60DF1F76100E04F67 /* tclOOBasic.c */,
+ F93599B80DF1F76600E04F67 /* tclOOCall.c */,
+ F93599BA0DF1F76A00E04F67 /* tclOODecls.h */,
+ F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */,
+ F93599BD0DF1F77400E04F67 /* tclOOInfo.c */,
+ F93599BF0DF1F77900E04F67 /* tclOOInt.h */,
+ F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */,
+ F93599C10DF1F78300E04F67 /* tclOOMethod.c */,
+ F93599C30DF1F78800E04F67 /* tclOOStubInit.c */,
+ F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */,
+ F96D3F0E08F272A7004A47F5 /* tclPanic.c */,
+ F96D3F0F08F272A7004A47F5 /* tclParse.c */,
+ F96D3F1108F272A7004A47F5 /* tclPathObj.c */,
+ F96D3F1208F272A7004A47F5 /* tclPipe.c */,
+ F96D3F1308F272A7004A47F5 /* tclPkg.c */,
+ F96D3F1408F272A7004A47F5 /* tclPkgConfig.c */,
+ F96D3F1508F272A7004A47F5 /* tclPlatDecls.h */,
+ F96D3F1608F272A7004A47F5 /* tclPort.h */,
+ F96D3F1708F272A7004A47F5 /* tclPosixStr.c */,
+ F96D3F1808F272A7004A47F5 /* tclPreserve.c */,
+ F96D3F1908F272A7004A47F5 /* tclProc.c */,
+ F96D3F1A08F272A7004A47F5 /* tclRegexp.c */,
+ F96D3F1B08F272A7004A47F5 /* tclRegexp.h */,
+ F96D3F1C08F272A7004A47F5 /* tclResolve.c */,
+ F96D3F1D08F272A7004A47F5 /* tclResult.c */,
+ F96D3F1E08F272A7004A47F5 /* tclScan.c */,
+ F96D3F1F08F272A7004A47F5 /* tclStringObj.c */,
+ F96D3F2408F272A7004A47F5 /* tclStrToD.c */,
+ F96D3F2508F272A7004A47F5 /* tclStubInit.c */,
+ F96D3F2608F272A7004A47F5 /* tclStubLib.c */,
+ F96D3F2708F272A7004A47F5 /* tclTest.c */,
+ F96D3F2808F272A7004A47F5 /* tclTestObj.c */,
+ F96D3F2908F272A7004A47F5 /* tclTestProcBodyObj.c */,
+ F96D3F2A08F272A7004A47F5 /* tclThread.c */,
+ F96D3F2B08F272A7004A47F5 /* tclThreadAlloc.c */,
+ F96D3F2C08F272A7004A47F5 /* tclThreadJoin.c */,
+ F96D3F2D08F272A7004A47F5 /* tclThreadStorage.c */,
+ F96D3F2E08F272A7004A47F5 /* tclThreadTest.c */,
+ F96D3F2F08F272A7004A47F5 /* tclTimer.c */,
+ F9903CAF094FAADA004613E9 /* tclTomMath.decls */,
+ F96D3F3008F272A7004A47F5 /* tclTomMath.h */,
+ F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */,
+ F96D3F3108F272A7004A47F5 /* tclTomMathInterface.c */,
+ F96D3F3208F272A7004A47F5 /* tclTrace.c */,
+ F96D3F3308F272A7004A47F5 /* tclUniData.c */,
+ F96D3F3408F272A7004A47F5 /* tclUtf.c */,
+ F96D3F3508F272A7004A47F5 /* tclUtil.c */,
+ F96D3F3608F272A7004A47F5 /* tclVar.c */,
+ F96437C90EF0D4B2003F468E /* tclZlib.c */,
+ F96D3F3708F272A7004A47F5 /* tommath.h */,
+ );
+ path = generic;
+ sourceTree = "<group>";
+ };
+ F96D3F3808F272A7004A47F5 /* library */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F3908F272A8004A47F5 /* auto.tcl */,
+ F96D3F3A08F272A8004A47F5 /* clock.tcl */,
+ F96D3F3B08F272A8004A47F5 /* dde */,
+ F96D3F8C08F272A8004A47F5 /* history.tcl */,
+ F96D3F8D08F272A8004A47F5 /* http */,
+ F96D3F9008F272A8004A47F5 /* http1.0 */,
+ F96D3F9308F272A8004A47F5 /* init.tcl */,
+ F96D3F9408F272A8004A47F5 /* msgcat */,
+ F96D401708F272AA004A47F5 /* opt */,
+ F96D401A08F272AA004A47F5 /* package.tcl */,
+ F96D401B08F272AA004A47F5 /* parray.tcl */,
+ F9ECB1110B26521500A28025 /* platform */,
+ F96D401C08F272AA004A47F5 /* reg */,
+ F96D401E08F272AA004A47F5 /* safe.tcl */,
+ F96D401F08F272AA004A47F5 /* tclIndex */,
+ F96D402008F272AA004A47F5 /* tcltest */,
+ F96D402308F272AA004A47F5 /* tm.tcl */,
+ F96D425B08F272B2004A47F5 /* word.tcl */,
+ );
+ path = library;
+ sourceTree = "<group>";
+ };
+ F96D3F3B08F272A8004A47F5 /* dde */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F3C08F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = dde;
+ sourceTree = "<group>";
+ };
+ F96D3F8D08F272A8004A47F5 /* http */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F8E08F272A8004A47F5 /* http.tcl */,
+ F96D3F8F08F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = http;
+ sourceTree = "<group>";
+ };
+ F96D3F9008F272A8004A47F5 /* http1.0 */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F9108F272A8004A47F5 /* http.tcl */,
+ F96D3F9208F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = http1.0;
+ sourceTree = "<group>";
+ };
+ F96D3F9408F272A8004A47F5 /* msgcat */ = {
+ isa = PBXGroup;
+ children = (
+ F96D3F9508F272A8004A47F5 /* msgcat.tcl */,
+ F96D3F9608F272A8004A47F5 /* pkgIndex.tcl */,
+ );
+ path = msgcat;
+ sourceTree = "<group>";
+ };
+ F96D401708F272AA004A47F5 /* opt */ = {
+ isa = PBXGroup;
+ children = (
+ F96D401808F272AA004A47F5 /* optparse.tcl */,
+ F96D401908F272AA004A47F5 /* pkgIndex.tcl */,
+ );
+ path = opt;
+ sourceTree = "<group>";
+ };
+ F96D401C08F272AA004A47F5 /* reg */ = {
+ isa = PBXGroup;
+ children = (
+ F96D401D08F272AA004A47F5 /* pkgIndex.tcl */,
+ );
+ path = reg;
+ sourceTree = "<group>";
+ };
+ F96D402008F272AA004A47F5 /* tcltest */ = {
+ isa = PBXGroup;
+ children = (
+ F96D402108F272AA004A47F5 /* pkgIndex.tcl */,
+ F96D402208F272AA004A47F5 /* tcltest.tcl */,
+ );
+ path = tcltest;
+ sourceTree = "<group>";
+ };
+ F96D425C08F272B2004A47F5 /* libtommath */ = {
+ isa = PBXGroup;
+ children = (
+ F96D426408F272B3004A47F5 /* bn_fast_s_mp_mul_digs.c */,
+ F96D426608F272B3004A47F5 /* bn_fast_s_mp_sqr.c */,
+ F96D426908F272B3004A47F5 /* bn_mp_add.c */,
+ F96D426A08F272B3004A47F5 /* bn_mp_add_d.c */,
+ F96D426C08F272B3004A47F5 /* bn_mp_and.c */,
+ F96D426D08F272B3004A47F5 /* bn_mp_clamp.c */,
+ F96D426E08F272B3004A47F5 /* bn_mp_clear.c */,
+ F96D426F08F272B3004A47F5 /* bn_mp_clear_multi.c */,
+ F96D427008F272B3004A47F5 /* bn_mp_cmp.c */,
+ F96D427108F272B3004A47F5 /* bn_mp_cmp_d.c */,
+ F96D427208F272B3004A47F5 /* bn_mp_cmp_mag.c */,
+ F96D427408F272B3004A47F5 /* bn_mp_copy.c */,
+ F96D427508F272B3004A47F5 /* bn_mp_count_bits.c */,
+ F96D427608F272B3004A47F5 /* bn_mp_div.c */,
+ F96D427708F272B3004A47F5 /* bn_mp_div_2.c */,
+ F96D427808F272B3004A47F5 /* bn_mp_div_2d.c */,
+ F96D427908F272B3004A47F5 /* bn_mp_div_3.c */,
+ F96D427A08F272B3004A47F5 /* bn_mp_div_d.c */,
+ F96D427E08F272B3004A47F5 /* bn_mp_exch.c */,
+ F96D427F08F272B3004A47F5 /* bn_mp_expt_d.c */,
+ F96D428708F272B3004A47F5 /* bn_mp_grow.c */,
+ F96D428808F272B3004A47F5 /* bn_mp_init.c */,
+ F96D428908F272B3004A47F5 /* bn_mp_init_copy.c */,
+ F96D428A08F272B3004A47F5 /* bn_mp_init_multi.c */,
+ F96D428B08F272B3004A47F5 /* bn_mp_init_set.c */,
+ F96D428D08F272B3004A47F5 /* bn_mp_init_size.c */,
+ F96D429208F272B3004A47F5 /* bn_mp_karatsuba_mul.c */,
+ F96D429308F272B3004A47F5 /* bn_mp_karatsuba_sqr.c */,
+ F96D429508F272B3004A47F5 /* bn_mp_lshd.c */,
+ F96D429608F272B3004A47F5 /* bn_mp_mod.c */,
+ F96D429708F272B3004A47F5 /* bn_mp_mod_2d.c */,
+ F96D429C08F272B3004A47F5 /* bn_mp_mul.c */,
+ F96D429D08F272B3004A47F5 /* bn_mp_mul_2.c */,
+ F96D429E08F272B3004A47F5 /* bn_mp_mul_2d.c */,
+ F96D429F08F272B3004A47F5 /* bn_mp_mul_d.c */,
+ F96D42A208F272B3004A47F5 /* bn_mp_neg.c */,
+ F96D42A308F272B3004A47F5 /* bn_mp_or.c */,
+ F96D42AB08F272B3004A47F5 /* bn_mp_radix_size.c */,
+ F96D42AC08F272B3004A47F5 /* bn_mp_radix_smap.c */,
+ F96D42AE08F272B3004A47F5 /* bn_mp_read_radix.c */,
+ F96D42B908F272B3004A47F5 /* bn_mp_rshd.c */,
+ F96D42BA08F272B3004A47F5 /* bn_mp_set.c */,
+ F96D42BC08F272B3004A47F5 /* bn_mp_shrink.c */,
+ F96D42BE08F272B3004A47F5 /* bn_mp_sqr.c */,
+ F96D42C008F272B3004A47F5 /* bn_mp_sqrt.c */,
+ F96D42C108F272B3004A47F5 /* bn_mp_sub.c */,
+ F96D42C208F272B3004A47F5 /* bn_mp_sub_d.c */,
+ F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */,
+ F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */,
+ F96D42C808F272B3004A47F5 /* bn_mp_toom_mul.c */,
+ F96D42C908F272B3004A47F5 /* bn_mp_toom_sqr.c */,
+ F96D42CB08F272B3004A47F5 /* bn_mp_toradix_n.c */,
+ F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */,
+ F96D42CD08F272B3004A47F5 /* bn_mp_xor.c */,
+ F96D42CE08F272B3004A47F5 /* bn_mp_zero.c */,
+ F96D42D008F272B3004A47F5 /* bn_reverse.c */,
+ F96D42D108F272B3004A47F5 /* bn_s_mp_add.c */,
+ F96D42D308F272B3004A47F5 /* bn_s_mp_mul_digs.c */,
+ F96D42D508F272B3004A47F5 /* bn_s_mp_sqr.c */,
+ F96D42D608F272B3004A47F5 /* bn_s_mp_sub.c */,
+ F96D42D708F272B3004A47F5 /* bncore.c */,
+ F96D432908F272B4004A47F5 /* tommath_class.h */,
+ F96D432A08F272B4004A47F5 /* tommath_superclass.h */,
+ );
+ path = libtommath;
+ sourceTree = "<group>";
+ };
+ F96D432C08F272B4004A47F5 /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ F96D432E08F272B5004A47F5 /* configure.ac */,
+ F96D432F08F272B5004A47F5 /* GNUmakefile */,
+ F96D433108F272B5004A47F5 /* README */,
+ F96D433908F272B5004A47F5 /* tclMacOSXBundle.c */,
+ F96D433D08F272B5004A47F5 /* tclMacOSXFCmd.c */,
+ F96D433E08F272B5004A47F5 /* tclMacOSXNotify.c */,
+ F96D433208F272B5004A47F5 /* Tcl-Info.plist.in */,
+ F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ F96D434408F272B5004A47F5 /* tests */ = {
+ isa = PBXGroup;
+ children = (
+ F96D434508F272B5004A47F5 /* all.tcl */,
+ F96D434608F272B5004A47F5 /* append.test */,
+ F96D434708F272B5004A47F5 /* appendComp.test */,
+ F9ECB1CA0B2652D300A28025 /* apply.test */,
+ F96D434808F272B5004A47F5 /* assocd.test */,
+ F96D434908F272B5004A47F5 /* async.test */,
+ F96D434A08F272B5004A47F5 /* autoMkindex.test */,
+ F96D434B08F272B5004A47F5 /* basic.test */,
+ F96D434C08F272B5004A47F5 /* binary.test */,
+ F96D434D08F272B5004A47F5 /* case.test */,
+ F96D434E08F272B5004A47F5 /* chan.test */,
+ F9A493240CEBF38300B78AE2 /* chanio.test */,
+ F96D434F08F272B5004A47F5 /* clock.test */,
+ F96D435008F272B5004A47F5 /* cmdAH.test */,
+ F96D435108F272B5004A47F5 /* cmdIL.test */,
+ F96D435208F272B5004A47F5 /* cmdInfo.test */,
+ F96D435308F272B5004A47F5 /* cmdMZ.test */,
+ F96D435408F272B5004A47F5 /* compExpr-old.test */,
+ F96D435508F272B5004A47F5 /* compExpr.test */,
+ F96D435608F272B5004A47F5 /* compile.test */,
+ F96D435708F272B5004A47F5 /* concat.test */,
+ F96D435808F272B5004A47F5 /* config.test */,
+ F974D5770FBE7E6100BF728B /* coroutine.test */,
+ F96D435908F272B5004A47F5 /* dcall.test */,
+ F96D435A08F272B5004A47F5 /* dict.test */,
+ F96D435C08F272B5004A47F5 /* dstring.test */,
+ F96D435E08F272B5004A47F5 /* encoding.test */,
+ F96D435F08F272B5004A47F5 /* env.test */,
+ F96D436008F272B5004A47F5 /* error.test */,
+ F96D436108F272B5004A47F5 /* eval.test */,
+ F96D436208F272B5004A47F5 /* event.test */,
+ F96D436308F272B5004A47F5 /* exec.test */,
+ F96D436408F272B5004A47F5 /* execute.test */,
+ F96D436508F272B5004A47F5 /* expr-old.test */,
+ F96D436608F272B5004A47F5 /* expr.test */,
+ F96D436708F272B6004A47F5 /* fCmd.test */,
+ F96D436808F272B6004A47F5 /* fileName.test */,
+ F96D436908F272B6004A47F5 /* fileSystem.test */,
+ F96D436A08F272B6004A47F5 /* for-old.test */,
+ F96D436B08F272B6004A47F5 /* for.test */,
+ F96D436C08F272B6004A47F5 /* foreach.test */,
+ F96D436D08F272B6004A47F5 /* format.test */,
+ F96D436E08F272B6004A47F5 /* get.test */,
+ F96D436F08F272B6004A47F5 /* history.test */,
+ F96D437008F272B6004A47F5 /* http.test */,
+ F974D56C0FBE7D6300BF728B /* http11.test */,
+ F96D437108F272B6004A47F5 /* httpd */,
+ F974D56D0FBE7D6300BF728B /* httpd11.tcl */,
+ F96D437208F272B6004A47F5 /* httpold.test */,
+ F96D437308F272B6004A47F5 /* if-old.test */,
+ F96D437408F272B6004A47F5 /* if.test */,
+ F96D437508F272B6004A47F5 /* incr-old.test */,
+ F96D437608F272B6004A47F5 /* incr.test */,
+ F96D437708F272B6004A47F5 /* indexObj.test */,
+ F96D437808F272B6004A47F5 /* info.test */,
+ F96D437908F272B6004A47F5 /* init.test */,
+ F96D437A08F272B6004A47F5 /* interp.test */,
+ F96D437B08F272B6004A47F5 /* io.test */,
+ F96D437C08F272B6004A47F5 /* ioCmd.test */,
+ F96D437D08F272B6004A47F5 /* iogt.test */,
+ F96D437F08F272B6004A47F5 /* join.test */,
+ F96D438008F272B6004A47F5 /* lindex.test */,
+ F96D438108F272B6004A47F5 /* link.test */,
+ F96D438208F272B6004A47F5 /* linsert.test */,
+ F96D438308F272B6004A47F5 /* list.test */,
+ F96D438408F272B6004A47F5 /* listObj.test */,
+ F96D438508F272B6004A47F5 /* llength.test */,
+ F96D438608F272B6004A47F5 /* load.test */,
+ F96D438708F272B6004A47F5 /* lrange.test */,
+ F96D438808F272B6004A47F5 /* lrepeat.test */,
+ F96D438908F272B6004A47F5 /* lreplace.test */,
+ F96D438A08F272B6004A47F5 /* lsearch.test */,
+ F96D438B08F272B6004A47F5 /* lset.test */,
+ F96D438C08F272B6004A47F5 /* lsetComp.test */,
+ F96D438D08F272B6004A47F5 /* macOSXFCmd.test */,
+ F95FAFF90B34F1130072E431 /* macOSXLoad.test */,
+ F96D438E08F272B6004A47F5 /* main.test */,
+ F9ECB1CB0B26534C00A28025 /* mathop.test */,
+ F96D438F08F272B6004A47F5 /* misc.test */,
+ F96D439008F272B6004A47F5 /* msgcat.test */,
+ F96D439108F272B6004A47F5 /* namespace-old.test */,
+ F96D439208F272B7004A47F5 /* namespace.test */,
+ F96D439308F272B7004A47F5 /* notify.test */,
+ F91DC23C0E44C51B002CB8D1 /* nre.test */,
+ F96D439408F272B7004A47F5 /* obj.test */,
+ F93599C80DF1F81900E04F67 /* oo.test */,
+ F96D439508F272B7004A47F5 /* opt.test */,
+ F96D439608F272B7004A47F5 /* package.test */,
+ F96D439708F272B7004A47F5 /* parse.test */,
+ F96D439808F272B7004A47F5 /* parseExpr.test */,
+ F96D439908F272B7004A47F5 /* parseOld.test */,
+ F96D439A08F272B7004A47F5 /* pid.test */,
+ F96D439B08F272B7004A47F5 /* pkg.test */,
+ F96D439C08F272B7004A47F5 /* pkgMkIndex.test */,
+ F96D439D08F272B7004A47F5 /* platform.test */,
+ F96D439E08F272B7004A47F5 /* proc-old.test */,
+ F96D439F08F272B7004A47F5 /* proc.test */,
+ F96D43A008F272B7004A47F5 /* pwd.test */,
+ F96D43A108F272B7004A47F5 /* README */,
+ F96D43A208F272B7004A47F5 /* reg.test */,
+ F96D43A308F272B7004A47F5 /* regexp.test */,
+ F96D43A408F272B7004A47F5 /* regexpComp.test */,
+ F96D43A508F272B7004A47F5 /* registry.test */,
+ F96D43A608F272B7004A47F5 /* remote.tcl */,
+ F96D43A708F272B7004A47F5 /* rename.test */,
+ F96D43A808F272B7004A47F5 /* result.test */,
+ F96D43A908F272B7004A47F5 /* safe.test */,
+ F96D43AA08F272B7004A47F5 /* scan.test */,
+ F96D43AB08F272B7004A47F5 /* security.test */,
+ F96D43AC08F272B7004A47F5 /* set-old.test */,
+ F96D43AD08F272B7004A47F5 /* set.test */,
+ F96D43AE08F272B7004A47F5 /* socket.test */,
+ F96D43AF08F272B7004A47F5 /* source.test */,
+ F96D43B008F272B7004A47F5 /* split.test */,
+ F96D43B108F272B7004A47F5 /* stack.test */,
+ F96D43B208F272B7004A47F5 /* string.test */,
+ F96D43B308F272B7004A47F5 /* stringComp.test */,
+ F96D43B408F272B7004A47F5 /* stringObj.test */,
+ F96D43B508F272B7004A47F5 /* subst.test */,
+ F96D43B608F272B7004A47F5 /* switch.test */,
+ F974D5780FBE7E6100BF728B /* tailcall.test */,
+ F96D43B708F272B7004A47F5 /* tcltest.test */,
+ F96D43B808F272B7004A47F5 /* thread.test */,
+ F96D43B908F272B7004A47F5 /* timer.test */,
+ F96D43BA08F272B7004A47F5 /* tm.test */,
+ F96D43BB08F272B7004A47F5 /* trace.test */,
+ F96D43BC08F272B7004A47F5 /* unixFCmd.test */,
+ F96D43BD08F272B7004A47F5 /* unixFile.test */,
+ F96D43BE08F272B7004A47F5 /* unixInit.test */,
+ F96D43BF08F272B7004A47F5 /* unixNotfy.test */,
+ F96D43C008F272B7004A47F5 /* unknown.test */,
+ F96D43C108F272B7004A47F5 /* unload.test */,
+ F96D43C208F272B7004A47F5 /* uplevel.test */,
+ F96D43C308F272B7004A47F5 /* upvar.test */,
+ F96D43C408F272B7004A47F5 /* utf.test */,
+ F96D43C508F272B7004A47F5 /* util.test */,
+ F96D43C608F272B7004A47F5 /* var.test */,
+ F96D43C708F272B7004A47F5 /* while-old.test */,
+ F96D43C808F272B7004A47F5 /* while.test */,
+ F96D43C908F272B7004A47F5 /* winConsole.test */,
+ F96D43CA08F272B7004A47F5 /* winDde.test */,
+ F96D43CB08F272B7004A47F5 /* winFCmd.test */,
+ F96D43CC08F272B7004A47F5 /* winFile.test */,
+ F96D43CD08F272B7004A47F5 /* winNotify.test */,
+ F96D43CE08F272B7004A47F5 /* winPipe.test */,
+ F96D43CF08F272B7004A47F5 /* winTime.test */,
+ F915432A0EF201CF0032D1E8 /* zlib.test */,
+ );
+ path = tests;
+ sourceTree = "<group>";
+ };
+ F96D43D008F272B8004A47F5 /* tools */ = {
+ isa = PBXGroup;
+ children = (
+ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */,
+ F96D43D208F272B8004A47F5 /* configure */,
+ F96D43D308F272B8004A47F5 /* configure.in */,
+ F96D442208F272B8004A47F5 /* eolFix.tcl */,
+ F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */,
+ F96D442508F272B8004A47F5 /* genStubs.tcl */,
+ F96D442708F272B8004A47F5 /* index.tcl */,
+ F96D442808F272B8004A47F5 /* installData.tcl */,
+ F96D442908F272B8004A47F5 /* loadICU.tcl */,
+ F96D442A08F272B8004A47F5 /* Makefile.in */,
+ F96D442B08F272B8004A47F5 /* makeTestCases.tcl */,
+ F96D442C08F272B8004A47F5 /* man2help.tcl */,
+ F96D442D08F272B8004A47F5 /* man2help2.tcl */,
+ F96D442E08F272B8004A47F5 /* man2html.tcl */,
+ F96D442F08F272B8004A47F5 /* man2html1.tcl */,
+ F96D443008F272B8004A47F5 /* man2html2.tcl */,
+ F96D443108F272B8004A47F5 /* man2tcl.c */,
+ F96D443208F272B8004A47F5 /* README */,
+ F96D443308F272B8004A47F5 /* regexpTestLib.tcl */,
+ F96D443508F272B8004A47F5 /* tcl.hpj.in */,
+ F96D443608F272B8004A47F5 /* tcl.wse.in */,
+ F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */,
+ F96D443A08F272B9004A47F5 /* tclZIC.tcl */,
+ F92D7F100DE777240033A13A /* tsdPerf.tcl */,
+ F96D443B08F272B9004A47F5 /* uniClass.tcl */,
+ F96D443C08F272B9004A47F5 /* uniParse.tcl */,
+ );
+ path = tools;
+ sourceTree = "<group>";
+ };
+ F96D443E08F272B9004A47F5 /* unix */ = {
+ isa = PBXGroup;
+ children = (
+ F96D444008F272B9004A47F5 /* aclocal.m4 */,
+ F96D444108F272B9004A47F5 /* configure */,
+ F96D444208F272B9004A47F5 /* configure.in */,
+ F96D444308F272B9004A47F5 /* dltest */,
+ F96D444D08F272B9004A47F5 /* install-sh */,
+ F96D444E08F272B9004A47F5 /* installManPage */,
+ F96D444F08F272B9004A47F5 /* ldAix */,
+ F96D445008F272B9004A47F5 /* Makefile.in */,
+ F96D445208F272B9004A47F5 /* README */,
+ F96D445308F272B9004A47F5 /* tcl.m4 */,
+ F974D5790FBE7E9C00BF728B /* tcl.pc.in */,
+ F96D445408F272B9004A47F5 /* tcl.spec */,
+ F96D445508F272B9004A47F5 /* tclAppInit.c */,
+ F96D445608F272B9004A47F5 /* tclConfig.h.in */,
+ F96D445708F272B9004A47F5 /* tclConfig.sh.in */,
+ F96D445808F272B9004A47F5 /* tclLoadAix.c */,
+ F96D445908F272B9004A47F5 /* tclLoadDl.c */,
+ F96D445B08F272B9004A47F5 /* tclLoadDyld.c */,
+ F96D445C08F272B9004A47F5 /* tclLoadNext.c */,
+ F96D445D08F272B9004A47F5 /* tclLoadOSF.c */,
+ F96D445E08F272B9004A47F5 /* tclLoadShl.c */,
+ F96D445F08F272B9004A47F5 /* tclUnixChan.c */,
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */,
+ F96D446008F272B9004A47F5 /* tclUnixEvent.c */,
+ F96D446108F272B9004A47F5 /* tclUnixFCmd.c */,
+ F96D446208F272B9004A47F5 /* tclUnixFile.c */,
+ F96D446308F272B9004A47F5 /* tclUnixInit.c */,
+ F96D446408F272B9004A47F5 /* tclUnixNotfy.c */,
+ F96D446508F272B9004A47F5 /* tclUnixPipe.c */,
+ F96D446608F272B9004A47F5 /* tclUnixPort.h */,
+ F96D446708F272B9004A47F5 /* tclUnixSock.c */,
+ F96D446808F272B9004A47F5 /* tclUnixTest.c */,
+ F96D446908F272B9004A47F5 /* tclUnixThrd.c */,
+ F96D446A08F272B9004A47F5 /* tclUnixThrd.h */,
+ F96D446B08F272B9004A47F5 /* tclUnixTime.c */,
+ F96D446C08F272B9004A47F5 /* tclXtNotify.c */,
+ F96D446D08F272B9004A47F5 /* tclXtTest.c */,
+ );
+ path = unix;
+ sourceTree = "<group>";
+ };
+ F96D444308F272B9004A47F5 /* dltest */ = {
+ isa = PBXGroup;
+ children = (
+ F96D444408F272B9004A47F5 /* Makefile.in */,
+ F96D444508F272B9004A47F5 /* pkga.c */,
+ F96D444608F272B9004A47F5 /* pkgb.c */,
+ F96D444708F272B9004A47F5 /* pkgc.c */,
+ F96D444808F272B9004A47F5 /* pkgd.c */,
+ F96D444908F272B9004A47F5 /* pkge.c */,
+ F96D444B08F272B9004A47F5 /* pkgua.c */,
+ F96D444C08F272B9004A47F5 /* README */,
+ );
+ path = dltest;
+ sourceTree = "<group>";
+ };
+ F96D446E08F272B9004A47F5 /* win */ = {
+ isa = PBXGroup;
+ children = (
+ F96D447008F272BA004A47F5 /* aclocal.m4 */,
+ F96D447108F272BA004A47F5 /* buildall.vc.bat */,
+ F96D447208F272BA004A47F5 /* cat.c */,
+ F96D447308F272BA004A47F5 /* coffbase.txt */,
+ F96D447408F272BA004A47F5 /* configure */,
+ F96D447508F272BA004A47F5 /* configure.in */,
+ F96D447608F272BA004A47F5 /* makefile.bc */,
+ F96D447708F272BA004A47F5 /* Makefile.in */,
+ F96D447808F272BA004A47F5 /* makefile.vc */,
+ F96D447908F272BA004A47F5 /* nmakehlp.c */,
+ F96D447A08F272BA004A47F5 /* README */,
+ F96D447C08F272BA004A47F5 /* rules.vc */,
+ F96D447D08F272BA004A47F5 /* stub16.c */,
+ F96D447E08F272BA004A47F5 /* tcl.dsp */,
+ F96D447F08F272BA004A47F5 /* tcl.dsw */,
+ F96D448008F272BA004A47F5 /* tcl.hpj.in */,
+ F96D448108F272BA004A47F5 /* tcl.m4 */,
+ F96D448208F272BA004A47F5 /* tcl.rc */,
+ F96D448308F272BA004A47F5 /* tclAppInit.c */,
+ F96D448408F272BA004A47F5 /* tclConfig.sh.in */,
+ F96D448608F272BA004A47F5 /* tclsh.rc */,
+ F96D448708F272BA004A47F5 /* tclWin32Dll.c */,
+ F96D448808F272BA004A47F5 /* tclWinChan.c */,
+ F96D448908F272BA004A47F5 /* tclWinConsole.c */,
+ F96D448A08F272BA004A47F5 /* tclWinDde.c */,
+ F96D448B08F272BA004A47F5 /* tclWinError.c */,
+ F96D448C08F272BA004A47F5 /* tclWinFCmd.c */,
+ F96D448D08F272BA004A47F5 /* tclWinFile.c */,
+ F96D448E08F272BA004A47F5 /* tclWinInit.c */,
+ F96D448F08F272BA004A47F5 /* tclWinInt.h */,
+ F96D449008F272BA004A47F5 /* tclWinLoad.c */,
+ F96D449108F272BA004A47F5 /* tclWinNotify.c */,
+ F96D449208F272BA004A47F5 /* tclWinPipe.c */,
+ F96D449308F272BA004A47F5 /* tclWinPort.h */,
+ F96D449408F272BA004A47F5 /* tclWinReg.c */,
+ F96D449508F272BA004A47F5 /* tclWinSerial.c */,
+ F96D449608F272BA004A47F5 /* tclWinSock.c */,
+ F96D449708F272BA004A47F5 /* tclWinTest.c */,
+ F96D449808F272BA004A47F5 /* tclWinThrd.c */,
+ F96D449908F272BA004A47F5 /* tclWinThrd.h */,
+ F96D449A08F272BA004A47F5 /* tclWinTime.c */,
+ );
+ path = win;
+ sourceTree = "<group>";
+ };
+ F9ECB1110B26521500A28025 /* platform */ = {
+ isa = PBXGroup;
+ children = (
+ F9ECB1120B26521500A28025 /* pkgIndex.tcl */,
+ F9ECB1130B26521500A28025 /* platform.tcl */,
+ F9ECB1140B26521500A28025 /* shell.tcl */,
+ );
+ path = platform;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76FA90486AB0100D96B5E /* tktest */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8B009158F3100EA5ACE /* Build configuration list for PBXNativeTarget "tktest" */;
+ buildPhases = (
+ F9A5C5F508F651A2008AE941 /* Configure Tcl */,
+ F9A5C5F608F651AB008AE941 /* Configure Tk */,
+ 8DD76FAB0486AB0100D96B5E /* Sources */,
+ 8DD76FAD0486AB0100D96B5E /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = tktest;
+ productInstallPath = "$(BINDIR)";
+ productName = tktest;
+ productReference = 8DD76FB20486AB0100D96B5E /* tktest */;
+ productType = "com.apple.product-type.tool";
+ };
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */;
+ buildPhases = (
+ F9FD30B40CC1AD070073837D /* Configure Tcl */,
+ F9FD30B50CC1AD070073837D /* Configure Tk */,
+ F9FD30BB0CC1AD070073837D /* Sources */,
+ F9FD31E30CC1AD070073837D /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "tktest-X11";
+ productInstallPath = "$(BINDIR)";
+ productName = tktest;
+ productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */;
+ productType = "com.apple.product-type.tool";
+ };
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
+ buildPhases = (
+ F97AF02F0B665DA900310EA2 /* Build Tk */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Tk;
+ productName = Wish;
+ productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ };
+ buildConfigurationList = F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Tk" */;
+ compatibilityVersion = "Xcode 3.2";
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* Tk */;
+ projectDirPath = "";
+ projectRoots = (
+ ..,
+ ../../tcl,
+ );
+ targets = (
+ F9E61D16090A3E94002B3151 /* Tk */,
+ 8DD76FA90486AB0100D96B5E /* tktest */,
+ F97258A50A86873C00096C78 /* tktest-X11 */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ F97AF02F0B665DA900310EA2 /* Build Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "${TARGET_TEMP_DIR}/.none",
+ );
+ name = "Build Tk";
+ outputPaths = (
+ "${TARGET_BUILD_DIR}/${WRAPPER_NAME}",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "export CC=$(xcrun -find ${GCC} || echo ${GCC}); export LD=${CC}\ngnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
+ showEnvVarsInLog = 0;
+ };
+ F9A5C5F508F651A2008AE941 /* Configure Tcl */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TCL_SRCROOT)/macosx/configure.ac",
+ "$(TCL_SRCROOT)/unix/configure.in",
+ "$(TCL_SRCROOT)/unix/tcl.m4",
+ "$(TCL_SRCROOT)/unix/aclocal.m4",
+ "$(TCL_SRCROOT)/unix/tclConfig.sh.in",
+ "$(TCL_SRCROOT)/unix/Makefile.in",
+ "$(TCL_SRCROOT)/unix/dltest/Makefile.in",
+ );
+ name = "Configure Tcl";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tcl/tclConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9A5C5F608F651AB008AE941 /* Configure Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/unix/configure.in",
+ "$(TK_SRCROOT)/unix/tcl.m4",
+ "$(TK_SRCROOT)/unix/aclocal.m4",
+ "$(TK_SRCROOT)/unix/tkConfig.sh.in",
+ );
+ name = "Configure Tk";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tk/tkConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-aqua --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9FD30B40CC1AD070073837D /* Configure Tcl */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TCL_SRCROOT)/macosx/configure.ac",
+ "$(TCL_SRCROOT)/unix/configure.in",
+ "$(TCL_SRCROOT)/unix/tcl.m4",
+ "$(TCL_SRCROOT)/unix/aclocal.m4",
+ "$(TCL_SRCROOT)/unix/tclConfig.sh.in",
+ "$(TCL_SRCROOT)/unix/Makefile.in",
+ "$(TCL_SRCROOT)/unix/dltest/Makefile.in",
+ );
+ name = "Configure Tcl";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tcl/tclConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ F9FD30B50CC1AD070073837D /* Configure Tk */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(TK_SRCROOT)/macosx/configure.ac",
+ "$(TK_SRCROOT)/unix/configure.in",
+ "$(TK_SRCROOT)/unix/tcl.m4",
+ "$(TK_SRCROOT)/unix/aclocal.m4",
+ "$(TK_SRCROOT)/unix/tkConfig.sh.in",
+ );
+ name = "Configure Tk";
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/tk/tkConfig.sh",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/bash;
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n CC=$(xcrun -find ${GCC} || echo ${GCC})\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl CC=${CC} LD=${CC} ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76FAB0486AB0100D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F96D456F08F272BB004A47F5 /* regcomp.c in Sources */,
+ F96D457208F272BB004A47F5 /* regerror.c in Sources */,
+ F96D457508F272BB004A47F5 /* regexec.c in Sources */,
+ F96D457608F272BB004A47F5 /* regfree.c in Sources */,
+ F96D457B08F272BB004A47F5 /* tclAlloc.c in Sources */,
+ F96D457C08F272BB004A47F5 /* tclAsync.c in Sources */,
+ F96D457D08F272BB004A47F5 /* tclBasic.c in Sources */,
+ F96D457E08F272BC004A47F5 /* tclBinary.c in Sources */,
+ F96D457F08F272BC004A47F5 /* tclCkalloc.c in Sources */,
+ F96D458008F272BC004A47F5 /* tclClock.c in Sources */,
+ F96D458108F272BC004A47F5 /* tclCmdAH.c in Sources */,
+ F96D458208F272BC004A47F5 /* tclCmdIL.c in Sources */,
+ F96D458308F272BC004A47F5 /* tclCmdMZ.c in Sources */,
+ F96D458408F272BC004A47F5 /* tclCompCmds.c in Sources */,
+ F96D458508F272BC004A47F5 /* tclCompExpr.c in Sources */,
+ F96D458608F272BC004A47F5 /* tclCompile.c in Sources */,
+ F96D458808F272BC004A47F5 /* tclConfig.c in Sources */,
+ F96D458908F272BC004A47F5 /* tclDate.c in Sources */,
+ F96D458B08F272BC004A47F5 /* tclDictObj.c in Sources */,
+ F96D458C08F272BC004A47F5 /* tclEncoding.c in Sources */,
+ F96D458D08F272BC004A47F5 /* tclEnv.c in Sources */,
+ F96D458E08F272BC004A47F5 /* tclEvent.c in Sources */,
+ F96D458F08F272BC004A47F5 /* tclExecute.c in Sources */,
+ F96D459008F272BC004A47F5 /* tclFCmd.c in Sources */,
+ F96D459108F272BC004A47F5 /* tclFileName.c in Sources */,
+ F96D459308F272BC004A47F5 /* tclGet.c in Sources */,
+ F96D459508F272BC004A47F5 /* tclHash.c in Sources */,
+ F96D459608F272BC004A47F5 /* tclHistory.c in Sources */,
+ F96D459708F272BC004A47F5 /* tclIndexObj.c in Sources */,
+ F96D459B08F272BC004A47F5 /* tclInterp.c in Sources */,
+ F96D459D08F272BC004A47F5 /* tclIO.c in Sources */,
+ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */,
+ F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */,
+ F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */,
+ F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */,
+ F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */,
+ F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */,
+ F96D45A408F272BC004A47F5 /* tclLink.c in Sources */,
+ F96D45A508F272BC004A47F5 /* tclListObj.c in Sources */,
+ F96D45A608F272BC004A47F5 /* tclLiteral.c in Sources */,
+ F96D45A708F272BC004A47F5 /* tclLoad.c in Sources */,
+ F96D45A908F272BC004A47F5 /* tclMain.c in Sources */,
+ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */,
+ F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */,
+ F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */,
+ F93599B30DF1F75400E04F67 /* tclOO.c in Sources */,
+ F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */,
+ F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */,
+ F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */,
+ F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */,
+ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */,
+ F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */,
+ F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */,
+ F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */,
+ F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */,
+ F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */,
+ F96D45B108F272BC004A47F5 /* tclPipe.c in Sources */,
+ F96D45B208F272BC004A47F5 /* tclPkg.c in Sources */,
+ F96D45B308F272BC004A47F5 /* tclPkgConfig.c in Sources */,
+ F96D45B608F272BC004A47F5 /* tclPosixStr.c in Sources */,
+ F96D45B708F272BC004A47F5 /* tclPreserve.c in Sources */,
+ F96D45B808F272BC004A47F5 /* tclProc.c in Sources */,
+ F96D45B908F272BC004A47F5 /* tclRegexp.c in Sources */,
+ F96D45BB08F272BC004A47F5 /* tclResolve.c in Sources */,
+ F96D45BC08F272BC004A47F5 /* tclResult.c in Sources */,
+ F96D45BD08F272BC004A47F5 /* tclScan.c in Sources */,
+ F96D45BE08F272BC004A47F5 /* tclStringObj.c in Sources */,
+ F96D45C308F272BC004A47F5 /* tclStrToD.c in Sources */,
+ F96D45C408F272BC004A47F5 /* tclStubInit.c in Sources */,
+ F96D45C508F272BC004A47F5 /* tclStubLib.c in Sources */,
+ F96D45C908F272BC004A47F5 /* tclThread.c in Sources */,
+ F96D45CA08F272BC004A47F5 /* tclThreadAlloc.c in Sources */,
+ F96D45CB08F272BC004A47F5 /* tclThreadJoin.c in Sources */,
+ F96D45CC08F272BC004A47F5 /* tclThreadStorage.c in Sources */,
+ F96D45CE08F272BC004A47F5 /* tclTimer.c in Sources */,
+ F96D45D008F272BC004A47F5 /* tclTomMathInterface.c in Sources */,
+ F96D45D108F272BC004A47F5 /* tclTrace.c in Sources */,
+ F96D45D308F272BC004A47F5 /* tclUtf.c in Sources */,
+ F96D45D408F272BC004A47F5 /* tclUtil.c in Sources */,
+ F96D45D508F272BC004A47F5 /* tclVar.c in Sources */,
+ F96437CA0EF0D4B2003F468E /* tclZlib.c in Sources */,
+ F96D48E208F272C3004A47F5 /* bn_fast_s_mp_mul_digs.c in Sources */,
+ F96D48E408F272C3004A47F5 /* bn_fast_s_mp_sqr.c in Sources */,
+ F96D48E708F272C3004A47F5 /* bn_mp_add.c in Sources */,
+ F96D48E808F272C3004A47F5 /* bn_mp_add_d.c in Sources */,
+ F9E61D2B090A48A4002B3151 /* bn_mp_and.c in Sources */,
+ F96D48EB08F272C3004A47F5 /* bn_mp_clamp.c in Sources */,
+ F96D48EC08F272C3004A47F5 /* bn_mp_clear.c in Sources */,
+ F96D48ED08F272C3004A47F5 /* bn_mp_clear_multi.c in Sources */,
+ F96D48EE08F272C3004A47F5 /* bn_mp_cmp.c in Sources */,
+ F9E61D28090A481F002B3151 /* bn_mp_cmp_d.c in Sources */,
+ F96D48F008F272C3004A47F5 /* bn_mp_cmp_mag.c in Sources */,
+ F96D48F208F272C3004A47F5 /* bn_mp_copy.c in Sources */,
+ F96D48F308F272C3004A47F5 /* bn_mp_count_bits.c in Sources */,
+ F96D48F408F272C3004A47F5 /* bn_mp_div.c in Sources */,
+ F96D48F508F272C3004A47F5 /* bn_mp_div_2.c in Sources */,
+ F96D48F608F272C3004A47F5 /* bn_mp_div_2d.c in Sources */,
+ F96D48F708F272C3004A47F5 /* bn_mp_div_3.c in Sources */,
+ F96D48F808F272C3004A47F5 /* bn_mp_div_d.c in Sources */,
+ F96D48FC08F272C3004A47F5 /* bn_mp_exch.c in Sources */,
+ F9E61D2C090A48AC002B3151 /* bn_mp_expt_d.c in Sources */,
+ F96D490508F272C3004A47F5 /* bn_mp_grow.c in Sources */,
+ F96D490608F272C3004A47F5 /* bn_mp_init.c in Sources */,
+ F96D490708F272C3004A47F5 /* bn_mp_init_copy.c in Sources */,
+ F96D490808F272C3004A47F5 /* bn_mp_init_multi.c in Sources */,
+ F96D490908F272C3004A47F5 /* bn_mp_init_set.c in Sources */,
+ F96D490B08F272C3004A47F5 /* bn_mp_init_size.c in Sources */,
+ F96D491008F272C3004A47F5 /* bn_mp_karatsuba_mul.c in Sources */,
+ F96D491108F272C3004A47F5 /* bn_mp_karatsuba_sqr.c in Sources */,
+ F96D491308F272C3004A47F5 /* bn_mp_lshd.c in Sources */,
+ F96D491408F272C3004A47F5 /* bn_mp_mod.c in Sources */,
+ F96D491508F272C3004A47F5 /* bn_mp_mod_2d.c in Sources */,
+ F96D491A08F272C3004A47F5 /* bn_mp_mul.c in Sources */,
+ F96D491B08F272C3004A47F5 /* bn_mp_mul_2.c in Sources */,
+ F96D491C08F272C3004A47F5 /* bn_mp_mul_2d.c in Sources */,
+ F96D491D08F272C3004A47F5 /* bn_mp_mul_d.c in Sources */,
+ F9E61D29090A486C002B3151 /* bn_mp_neg.c in Sources */,
+ F9E61D2E090A48BF002B3151 /* bn_mp_or.c in Sources */,
+ F96D492908F272C3004A47F5 /* bn_mp_radix_size.c in Sources */,
+ F96D492A08F272C3004A47F5 /* bn_mp_radix_smap.c in Sources */,
+ F96D492C08F272C3004A47F5 /* bn_mp_read_radix.c in Sources */,
+ F96D493708F272C3004A47F5 /* bn_mp_rshd.c in Sources */,
+ F96D493808F272C3004A47F5 /* bn_mp_set.c in Sources */,
+ F9E61D2F090A48C7002B3151 /* bn_mp_shrink.c in Sources */,
+ F96D493C08F272C3004A47F5 /* bn_mp_sqr.c in Sources */,
+ F9E61D2A090A4891002B3151 /* bn_mp_sqrt.c in Sources */,
+ F96D493F08F272C3004A47F5 /* bn_mp_sub.c in Sources */,
+ F96D494008F272C3004A47F5 /* bn_mp_sub_d.c in Sources */,
+ F9E61D30090A48E2002B3151 /* bn_mp_to_unsigned_bin_n.c in Sources */,
+ F9E61D31090A48F9002B3151 /* bn_mp_to_unsigned_bin.c in Sources */,
+ F96D494608F272C3004A47F5 /* bn_mp_toom_mul.c in Sources */,
+ F96D494708F272C3004A47F5 /* bn_mp_toom_sqr.c in Sources */,
+ F96D494908F272C3004A47F5 /* bn_mp_toradix_n.c in Sources */,
+ F9E61D32090A48FA002B3151 /* bn_mp_unsigned_bin_size.c in Sources */,
+ F9E61D2D090A48BB002B3151 /* bn_mp_xor.c in Sources */,
+ F96D494C08F272C3004A47F5 /* bn_mp_zero.c in Sources */,
+ F96D494E08F272C3004A47F5 /* bn_reverse.c in Sources */,
+ F96D494F08F272C3004A47F5 /* bn_s_mp_add.c in Sources */,
+ F96D495108F272C3004A47F5 /* bn_s_mp_mul_digs.c in Sources */,
+ F96D495308F272C3004A47F5 /* bn_s_mp_sqr.c in Sources */,
+ F96D495408F272C3004A47F5 /* bn_s_mp_sub.c in Sources */,
+ F96D495508F272C3004A47F5 /* bncore.c in Sources */,
+ F96D49A908F272C4004A47F5 /* tclMacOSXBundle.c in Sources */,
+ F96D49AD08F272C4004A47F5 /* tclMacOSXFCmd.c in Sources */,
+ F96D49AE08F272C4004A47F5 /* tclMacOSXNotify.c in Sources */,
+ F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */,
+ F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */,
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */,
+ F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */,
+ F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */,
+ F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */,
+ F96D4ACE08F272C9004A47F5 /* tclUnixInit.c in Sources */,
+ F96D4ACF08F272C9004A47F5 /* tclUnixNotfy.c in Sources */,
+ F96D4AD008F272C9004A47F5 /* tclUnixPipe.c in Sources */,
+ F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */,
+ F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */,
+ F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */,
+ F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */,
+ F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */,
+ F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */,
+ F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */,
+ F966BDD308F27A3F005CB29B /* tkBind.c in Sources */,
+ F966BDD408F27A3F005CB29B /* tkBitmap.c in Sources */,
+ F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */,
+ F966BDD508F27A3F005CB29B /* tkButton.c in Sources */,
+ F966BDD708F27A3F005CB29B /* tkCanvArc.c in Sources */,
+ F966BDD808F27A3F005CB29B /* tkCanvas.c in Sources */,
+ F966BDDA08F27A3F005CB29B /* tkCanvBmap.c in Sources */,
+ F966BDDB08F27A3F005CB29B /* tkCanvImg.c in Sources */,
+ F966BDDC08F27A3F005CB29B /* tkCanvLine.c in Sources */,
+ F966BDDD08F27A3F005CB29B /* tkCanvPoly.c in Sources */,
+ F966BDDE08F27A3F005CB29B /* tkCanvPs.c in Sources */,
+ F966BDE008F27A3F005CB29B /* tkCanvText.c in Sources */,
+ F966BDE108F27A3F005CB29B /* tkCanvUtil.c in Sources */,
+ F966BDE208F27A3F005CB29B /* tkCanvWind.c in Sources */,
+ F966BDE308F27A3F005CB29B /* tkClipboard.c in Sources */,
+ F966BDE408F27A3F005CB29B /* tkCmds.c in Sources */,
+ F966BDE508F27A3F005CB29B /* tkColor.c in Sources */,
+ F966BDE708F27A3F005CB29B /* tkConfig.c in Sources */,
+ F966BDE808F27A3F005CB29B /* tkConsole.c in Sources */,
+ F966BDE908F27A3F005CB29B /* tkCursor.c in Sources */,
+ F966BDEB08F27A3F005CB29B /* tkEntry.c in Sources */,
+ F966BDED08F27A3F005CB29B /* tkError.c in Sources */,
+ F966BDEE08F27A3F005CB29B /* tkEvent.c in Sources */,
+ F966BDEF08F27A3F005CB29B /* tkFileFilter.c in Sources */,
+ F966BDF108F27A3F005CB29B /* tkFocus.c in Sources */,
+ F966BDF208F27A3F005CB29B /* tkFont.c in Sources */,
+ F966BDF408F27A3F005CB29B /* tkFrame.c in Sources */,
+ F966BDF508F27A3F005CB29B /* tkGC.c in Sources */,
+ F966BDF608F27A3F005CB29B /* tkGeometry.c in Sources */,
+ F966BDF708F27A3F005CB29B /* tkGet.c in Sources */,
+ F966BDF808F27A3F005CB29B /* tkGrab.c in Sources */,
+ F966BDF908F27A3F005CB29B /* tkGrid.c in Sources */,
+ F966BDFA08F27A3F005CB29B /* tkImage.c in Sources */,
+ F966BDFB08F27A3F005CB29B /* tkImgBmap.c in Sources */,
+ F966BDFC08F27A3F005CB29B /* tkImgGIF.c in Sources */,
+ F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */,
+ F966BDFD08F27A3F005CB29B /* tkImgPhoto.c in Sources */,
+ F9DD99BD0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
+ F966BDFE08F27A3F005CB29B /* tkImgPPM.c in Sources */,
+ F966BE0708F27A3F005CB29B /* tkListbox.c in Sources */,
+ F966BE0808F27A3F005CB29B /* tkMacWinMenu.c in Sources */,
+ F966BE0908F27A3F005CB29B /* tkMain.c in Sources */,
+ F966BE0A08F27A3F005CB29B /* tkMenu.c in Sources */,
+ F966BE0C08F27A3F005CB29B /* tkMenubutton.c in Sources */,
+ F966BE0E08F27A3F005CB29B /* tkMenuDraw.c in Sources */,
+ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */,
+ F966BE1008F27A3F005CB29B /* tkObj.c in Sources */,
+ F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */,
+ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */,
+ F966BE1208F27A3F005CB29B /* tkOption.c in Sources */,
+ F966BE1308F27A3F005CB29B /* tkPack.c in Sources */,
+ F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */,
+ F966BE1508F27A3F005CB29B /* tkPlace.c in Sources */,
+ F966BE1708F27A3F005CB29B /* tkPointer.c in Sources */,
+ F966BE1908F27A3F005CB29B /* tkRectOval.c in Sources */,
+ F966BE1A08F27A3F005CB29B /* tkScale.c in Sources */,
+ F966BE1C08F27A40005CB29B /* tkScrollbar.c in Sources */,
+ F966BE1E08F27A40005CB29B /* tkSelect.c in Sources */,
+ F966BE2008F27A40005CB29B /* tkSquare.c in Sources */,
+ F966BE2208F27A40005CB29B /* tkStubInit.c in Sources */,
+ F966BE2308F27A40005CB29B /* tkStubLib.c in Sources */,
+ F966BE2408F27A40005CB29B /* tkStyle.c in Sources */,
+ F966BE2508F27A40005CB29B /* tkTest.c in Sources */,
+ F966BE2608F27A40005CB29B /* tkText.c in Sources */,
+ F966BE2808F27A40005CB29B /* tkTextBTree.c in Sources */,
+ F966BE2908F27A40005CB29B /* tkTextDisp.c in Sources */,
+ F966BE2B08F27A40005CB29B /* tkTextImage.c in Sources */,
+ F966BE2C08F27A40005CB29B /* tkTextIndex.c in Sources */,
+ F966BE2D08F27A40005CB29B /* tkTextMark.c in Sources */,
+ F966BE2E08F27A40005CB29B /* tkTextTag.c in Sources */,
+ F966BE2F08F27A40005CB29B /* tkTextWind.c in Sources */,
+ F966BE3008F27A40005CB29B /* tkTrig.c in Sources */,
+ F966BE3108F27A40005CB29B /* tkUndo.c in Sources */,
+ F966BE3308F27A40005CB29B /* tkUtil.c in Sources */,
+ F966BE3408F27A40005CB29B /* tkVisual.c in Sources */,
+ F966BE3508F27A40005CB29B /* tkWindow.c in Sources */,
+ F96888050AF786D5000797B5 /* ttkBlink.c in Sources */,
+ F96888060AF786D5000797B5 /* ttkButton.c in Sources */,
+ F96888070AF786D5000797B5 /* ttkCache.c in Sources */,
+ F96888080AF786D5000797B5 /* ttkClamTheme.c in Sources */,
+ F96888090AF786D5000797B5 /* ttkClassicTheme.c in Sources */,
+ F968880A0AF786D5000797B5 /* ttkDefaultTheme.c in Sources */,
+ F968880B0AF786D5000797B5 /* ttkElements.c in Sources */,
+ F968880C0AF786D5000797B5 /* ttkEntry.c in Sources */,
+ F968880D0AF786D5000797B5 /* ttkFrame.c in Sources */,
+ F968880E0AF786D5000797B5 /* ttkImage.c in Sources */,
+ F968880F0AF786D5000797B5 /* ttkInit.c in Sources */,
+ F96888100AF786D5000797B5 /* ttkLabel.c in Sources */,
+ F96888110AF786D5000797B5 /* ttkLayout.c in Sources */,
+ F96888120AF786D5000797B5 /* ttkManager.c in Sources */,
+ F96888130AF786D5000797B5 /* ttkNotebook.c in Sources */,
+ F96888140AF786D5000797B5 /* ttkPanedwindow.c in Sources */,
+ F96888150AF786D5000797B5 /* ttkProgress.c in Sources */,
+ F96888160AF786D5000797B5 /* ttkScale.c in Sources */,
+ F96888170AF786D5000797B5 /* ttkScroll.c in Sources */,
+ F96888180AF786D5000797B5 /* ttkScrollbar.c in Sources */,
+ F96888190AF786D5000797B5 /* ttkSeparator.c in Sources */,
+ F968881A0AF786D5000797B5 /* ttkSquare.c in Sources */,
+ F968881B0AF786D5000797B5 /* ttkState.c in Sources */,
+ F968881C0AF786D5000797B5 /* ttkStubInit.c in Sources */,
+ F968881D0AF786D5000797B5 /* ttkStubLib.c in Sources */,
+ F968881E0AF786D5000797B5 /* ttkTagSet.c in Sources */,
+ F968881F0AF786D5000797B5 /* ttkTheme.c in Sources */,
+ F96888200AF786D5000797B5 /* ttkTrace.c in Sources */,
+ F96888210AF786D5000797B5 /* ttkTrack.c in Sources */,
+ F96888220AF786D5000797B5 /* ttkTreeview.c in Sources */,
+ F96888230AF786D5000797B5 /* ttkWidget.c in Sources */,
+ F966BEDB08F27A40005CB29B /* tkMacOSXBitmap.c in Sources */,
+ F966BEDC08F27A40005CB29B /* tkMacOSXButton.c in Sources */,
+ F966BEDE08F27A40005CB29B /* tkMacOSXClipboard.c in Sources */,
+ F966BEDF08F27A40005CB29B /* tkMacOSXColor.c in Sources */,
+ F966BEE008F27A40005CB29B /* tkMacOSXConfig.c in Sources */,
+ F966BEE108F27A40005CB29B /* tkMacOSXCursor.c in Sources */,
+ F966BEE308F27A40005CB29B /* tkMacOSXDebug.c in Sources */,
+ F966BEE608F27A40005CB29B /* tkMacOSXDialog.c in Sources */,
+ F966BEE708F27A40005CB29B /* tkMacOSXDraw.c in Sources */,
+ F966BEE808F27A40005CB29B /* tkMacOSXEmbed.c in Sources */,
+ F966BEE908F27A40005CB29B /* tkMacOSXEntry.c in Sources */,
+ F966BEEA08F27A40005CB29B /* tkMacOSXEvent.c in Sources */,
+ F966BEEC08F27A40005CB29B /* tkMacOSXFont.c in Sources */,
+ F966BEED08F27A40005CB29B /* tkMacOSXHLEvents.c in Sources */,
+ F966BEEE08F27A40005CB29B /* tkMacOSXInit.c in Sources */,
+ F966BEF108F27A40005CB29B /* tkMacOSXKeyboard.c in Sources */,
+ F966BEF208F27A40005CB29B /* tkMacOSXKeyEvent.c in Sources */,
+ F966BEF308F27A40005CB29B /* tkMacOSXMenu.c in Sources */,
+ F966BEF608F27A40005CB29B /* tkMacOSXMenubutton.c in Sources */,
+ F966BEF708F27A40005CB29B /* tkMacOSXMenus.c in Sources */,
+ F966BEF808F27A40005CB29B /* tkMacOSXMouseEvent.c in Sources */,
+ F966BEF908F27A40005CB29B /* tkMacOSXNotify.c in Sources */,
+ F966BF0108F27A40005CB29B /* tkMacOSXRegion.c in Sources */,
+ F966BF0308F27A40005CB29B /* tkMacOSXScrlbr.c in Sources */,
+ F966BF0408F27A40005CB29B /* tkMacOSXSend.c in Sources */,
+ F966BF0508F27A40005CB29B /* tkMacOSXSubwindows.c in Sources */,
+ F966BF0608F27A40005CB29B /* tkMacOSXTest.c in Sources */,
+ F966BF0708F27A40005CB29B /* tkMacOSXWindowEvent.c in Sources */,
+ F966BF0808F27A40005CB29B /* tkMacOSXWm.c in Sources */,
+ F966BF0B08F27A40005CB29B /* tkMacOSXXStubs.c in Sources */,
+ F96888850AF78938000797B5 /* ttkMacOSXTheme.c in Sources */,
+ F966BF7F08F27A41005CB29B /* tkAppInit.c in Sources */,
+ F966BF8308F27A41005CB29B /* tkUnix3d.c in Sources */,
+ F966BF9608F27A41005CB29B /* tkUnixScale.c in Sources */,
+ F966C02A08F27A42005CB29B /* xcolors.c in Sources */,
+ F966C02B08F27A42005CB29B /* xdraw.c in Sources */,
+ F966C02C08F27A42005CB29B /* xgc.c in Sources */,
+ F966C02D08F27A42005CB29B /* ximage.c in Sources */,
+ F966C02E08F27A42005CB29B /* xutil.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F9FD30BB0CC1AD070073837D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ F9FD30BC0CC1AD070073837D /* regcomp.c in Sources */,
+ F9FD30BD0CC1AD070073837D /* regerror.c in Sources */,
+ F9FD30BE0CC1AD070073837D /* regexec.c in Sources */,
+ F9FD30BF0CC1AD070073837D /* regfree.c in Sources */,
+ F9FD30C00CC1AD070073837D /* tclAlloc.c in Sources */,
+ F9FD30C10CC1AD070073837D /* tclAsync.c in Sources */,
+ F9FD30C20CC1AD070073837D /* tclBasic.c in Sources */,
+ F9FD30C30CC1AD070073837D /* tclBinary.c in Sources */,
+ F9FD30C40CC1AD070073837D /* tclCkalloc.c in Sources */,
+ F9FD30C50CC1AD070073837D /* tclClock.c in Sources */,
+ F9FD30C60CC1AD070073837D /* tclCmdAH.c in Sources */,
+ F9FD30C70CC1AD070073837D /* tclCmdIL.c in Sources */,
+ F9FD30C80CC1AD070073837D /* tclCmdMZ.c in Sources */,
+ F9FD30C90CC1AD070073837D /* tclCompCmds.c in Sources */,
+ F9FD30CA0CC1AD070073837D /* tclCompExpr.c in Sources */,
+ F9FD30CB0CC1AD070073837D /* tclCompile.c in Sources */,
+ F9FD30CC0CC1AD070073837D /* tclConfig.c in Sources */,
+ F9FD30CD0CC1AD070073837D /* tclDate.c in Sources */,
+ F9FD30CE0CC1AD070073837D /* tclDictObj.c in Sources */,
+ F9FD30CF0CC1AD070073837D /* tclEncoding.c in Sources */,
+ F9FD30D00CC1AD070073837D /* tclEnv.c in Sources */,
+ F9FD30D10CC1AD070073837D /* tclEvent.c in Sources */,
+ F9FD30D20CC1AD070073837D /* tclExecute.c in Sources */,
+ F9FD30D30CC1AD070073837D /* tclFCmd.c in Sources */,
+ F9FD30D40CC1AD070073837D /* tclFileName.c in Sources */,
+ F9FD30D50CC1AD070073837D /* tclGet.c in Sources */,
+ F9FD30D60CC1AD070073837D /* tclHash.c in Sources */,
+ F9FD30D70CC1AD070073837D /* tclHistory.c in Sources */,
+ F9FD30D80CC1AD070073837D /* tclIndexObj.c in Sources */,
+ F9FD30D90CC1AD070073837D /* tclInterp.c in Sources */,
+ F9FD30DA0CC1AD070073837D /* tclIO.c in Sources */,
+ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */,
+ F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */,
+ F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */,
+ F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */,
+ F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */,
+ F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */,
+ F9FD30E00CC1AD070073837D /* tclLink.c in Sources */,
+ F9FD30E10CC1AD070073837D /* tclListObj.c in Sources */,
+ F9FD30E20CC1AD070073837D /* tclLiteral.c in Sources */,
+ F9FD30E30CC1AD070073837D /* tclLoad.c in Sources */,
+ F9FD30E40CC1AD070073837D /* tclMain.c in Sources */,
+ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */,
+ F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */,
+ F9FD30E70CC1AD070073837D /* tclObj.c in Sources */,
+ F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */,
+ F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */,
+ F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */,
+ F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */,
+ F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */,
+ F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */,
+ F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */,
+ F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */,
+ F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */,
+ F9FD30E90CC1AD070073837D /* tclParse.c in Sources */,
+ F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */,
+ F9FD30EB0CC1AD070073837D /* tclPipe.c in Sources */,
+ F9FD30EC0CC1AD070073837D /* tclPkg.c in Sources */,
+ F9FD30ED0CC1AD070073837D /* tclPkgConfig.c in Sources */,
+ F9FD30EE0CC1AD070073837D /* tclPosixStr.c in Sources */,
+ F9FD30EF0CC1AD070073837D /* tclPreserve.c in Sources */,
+ F9FD30F00CC1AD070073837D /* tclProc.c in Sources */,
+ F9FD30F10CC1AD070073837D /* tclRegexp.c in Sources */,
+ F9FD30F20CC1AD070073837D /* tclResolve.c in Sources */,
+ F9FD30F30CC1AD070073837D /* tclResult.c in Sources */,
+ F9FD30F40CC1AD070073837D /* tclScan.c in Sources */,
+ F9FD30F50CC1AD070073837D /* tclStringObj.c in Sources */,
+ F9FD30F60CC1AD070073837D /* tclStrToD.c in Sources */,
+ F9FD30F70CC1AD070073837D /* tclStubInit.c in Sources */,
+ F9FD30F80CC1AD070073837D /* tclStubLib.c in Sources */,
+ F9FD30F90CC1AD070073837D /* tclThread.c in Sources */,
+ F9FD30FA0CC1AD070073837D /* tclThreadAlloc.c in Sources */,
+ F9FD30FB0CC1AD070073837D /* tclThreadJoin.c in Sources */,
+ F9FD30FC0CC1AD070073837D /* tclThreadStorage.c in Sources */,
+ F9FD30FD0CC1AD070073837D /* tclTimer.c in Sources */,
+ F9FD30FE0CC1AD070073837D /* tclTomMathInterface.c in Sources */,
+ F9FD30FF0CC1AD070073837D /* tclTrace.c in Sources */,
+ F9FD31000CC1AD070073837D /* tclUtf.c in Sources */,
+ F9FD31010CC1AD070073837D /* tclUtil.c in Sources */,
+ F9FD31020CC1AD070073837D /* tclVar.c in Sources */,
+ F96437CB0EF0D4B2003F468E /* tclZlib.c in Sources */,
+ F9FD31030CC1AD070073837D /* bn_fast_s_mp_mul_digs.c in Sources */,
+ F9FD31040CC1AD070073837D /* bn_fast_s_mp_sqr.c in Sources */,
+ F9FD31050CC1AD070073837D /* bn_mp_add.c in Sources */,
+ F9FD31060CC1AD070073837D /* bn_mp_add_d.c in Sources */,
+ F9FD31070CC1AD070073837D /* bn_mp_and.c in Sources */,
+ F9FD31080CC1AD070073837D /* bn_mp_clamp.c in Sources */,
+ F9FD31090CC1AD070073837D /* bn_mp_clear.c in Sources */,
+ F9FD310A0CC1AD070073837D /* bn_mp_clear_multi.c in Sources */,
+ F9FD310B0CC1AD070073837D /* bn_mp_cmp.c in Sources */,
+ F9FD310C0CC1AD070073837D /* bn_mp_cmp_d.c in Sources */,
+ F9FD310D0CC1AD070073837D /* bn_mp_cmp_mag.c in Sources */,
+ F9FD310E0CC1AD070073837D /* bn_mp_copy.c in Sources */,
+ F9FD310F0CC1AD070073837D /* bn_mp_count_bits.c in Sources */,
+ F9FD31100CC1AD070073837D /* bn_mp_div.c in Sources */,
+ F9FD31110CC1AD070073837D /* bn_mp_div_2.c in Sources */,
+ F9FD31120CC1AD070073837D /* bn_mp_div_2d.c in Sources */,
+ F9FD31130CC1AD070073837D /* bn_mp_div_3.c in Sources */,
+ F9FD31140CC1AD070073837D /* bn_mp_div_d.c in Sources */,
+ F9FD31150CC1AD070073837D /* bn_mp_exch.c in Sources */,
+ F9FD31160CC1AD070073837D /* bn_mp_expt_d.c in Sources */,
+ F9FD31170CC1AD070073837D /* bn_mp_grow.c in Sources */,
+ F9FD31180CC1AD070073837D /* bn_mp_init.c in Sources */,
+ F9FD31190CC1AD070073837D /* bn_mp_init_copy.c in Sources */,
+ F9FD311A0CC1AD070073837D /* bn_mp_init_multi.c in Sources */,
+ F9FD311B0CC1AD070073837D /* bn_mp_init_set.c in Sources */,
+ F9FD311C0CC1AD070073837D /* bn_mp_init_size.c in Sources */,
+ F9FD311D0CC1AD070073837D /* bn_mp_karatsuba_mul.c in Sources */,
+ F9FD311E0CC1AD070073837D /* bn_mp_karatsuba_sqr.c in Sources */,
+ F9FD311F0CC1AD070073837D /* bn_mp_lshd.c in Sources */,
+ F9FD31200CC1AD070073837D /* bn_mp_mod.c in Sources */,
+ F9FD31210CC1AD070073837D /* bn_mp_mod_2d.c in Sources */,
+ F9FD31220CC1AD070073837D /* bn_mp_mul.c in Sources */,
+ F9FD31230CC1AD070073837D /* bn_mp_mul_2.c in Sources */,
+ F9FD31240CC1AD070073837D /* bn_mp_mul_2d.c in Sources */,
+ F9FD31250CC1AD070073837D /* bn_mp_mul_d.c in Sources */,
+ F9FD31260CC1AD070073837D /* bn_mp_neg.c in Sources */,
+ F9FD31270CC1AD070073837D /* bn_mp_or.c in Sources */,
+ F9FD31280CC1AD070073837D /* bn_mp_radix_size.c in Sources */,
+ F9FD31290CC1AD070073837D /* bn_mp_radix_smap.c in Sources */,
+ F9FD312A0CC1AD070073837D /* bn_mp_read_radix.c in Sources */,
+ F9FD312B0CC1AD070073837D /* bn_mp_rshd.c in Sources */,
+ F9FD312C0CC1AD070073837D /* bn_mp_set.c in Sources */,
+ F9FD312D0CC1AD070073837D /* bn_mp_shrink.c in Sources */,
+ F9FD312E0CC1AD070073837D /* bn_mp_sqr.c in Sources */,
+ F9FD312F0CC1AD070073837D /* bn_mp_sqrt.c in Sources */,
+ F9FD31300CC1AD070073837D /* bn_mp_sub.c in Sources */,
+ F9FD31310CC1AD070073837D /* bn_mp_sub_d.c in Sources */,
+ F9FD31320CC1AD070073837D /* bn_mp_to_unsigned_bin_n.c in Sources */,
+ F9FD31330CC1AD070073837D /* bn_mp_to_unsigned_bin.c in Sources */,
+ F9FD31340CC1AD070073837D /* bn_mp_toom_mul.c in Sources */,
+ F9FD31350CC1AD070073837D /* bn_mp_toom_sqr.c in Sources */,
+ F9FD31360CC1AD070073837D /* bn_mp_toradix_n.c in Sources */,
+ F9FD31370CC1AD070073837D /* bn_mp_unsigned_bin_size.c in Sources */,
+ F9FD31380CC1AD070073837D /* bn_mp_xor.c in Sources */,
+ F9FD31390CC1AD070073837D /* bn_mp_zero.c in Sources */,
+ F9FD313A0CC1AD070073837D /* bn_reverse.c in Sources */,
+ F9FD313B0CC1AD070073837D /* bn_s_mp_add.c in Sources */,
+ F9FD313C0CC1AD070073837D /* bn_s_mp_mul_digs.c in Sources */,
+ F9FD313D0CC1AD070073837D /* bn_s_mp_sqr.c in Sources */,
+ F9FD313E0CC1AD070073837D /* bn_s_mp_sub.c in Sources */,
+ F9FD313F0CC1AD070073837D /* bncore.c in Sources */,
+ F9FD31400CC1AD070073837D /* tclMacOSXBundle.c in Sources */,
+ F9FD31410CC1AD070073837D /* tclMacOSXFCmd.c in Sources */,
+ F9FD31420CC1AD070073837D /* tclMacOSXNotify.c in Sources */,
+ F9FD31430CC1AD070073837D /* tclLoadDyld.c in Sources */,
+ F9FD31440CC1AD070073837D /* tclUnixChan.c in Sources */,
+ F9FD31450CC1AD070073837D /* tclUnixCompat.c in Sources */,
+ F9FD31460CC1AD070073837D /* tclUnixEvent.c in Sources */,
+ F9FD31470CC1AD070073837D /* tclUnixFCmd.c in Sources */,
+ F9FD31480CC1AD070073837D /* tclUnixFile.c in Sources */,
+ F9FD31490CC1AD070073837D /* tclUnixInit.c in Sources */,
+ F9FD314A0CC1AD070073837D /* tclUnixNotfy.c in Sources */,
+ F9FD314B0CC1AD070073837D /* tclUnixPipe.c in Sources */,
+ F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */,
+ F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */,
+ F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */,
+ F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */,
+ F9FD314F0CC1AD070073837D /* tk3d.c in Sources */,
+ F9FD31500CC1AD070073837D /* tkArgv.c in Sources */,
+ F9FD31510CC1AD070073837D /* tkAtom.c in Sources */,
+ F9FD31520CC1AD070073837D /* tkBind.c in Sources */,
+ F9FD31530CC1AD070073837D /* tkBitmap.c in Sources */,
+ F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */,
+ F9FD31540CC1AD070073837D /* tkButton.c in Sources */,
+ F9FD31550CC1AD070073837D /* tkCanvArc.c in Sources */,
+ F9FD31560CC1AD070073837D /* tkCanvas.c in Sources */,
+ F9FD31570CC1AD070073837D /* tkCanvBmap.c in Sources */,
+ F9FD31580CC1AD070073837D /* tkCanvImg.c in Sources */,
+ F9FD31590CC1AD070073837D /* tkCanvLine.c in Sources */,
+ F9FD315A0CC1AD070073837D /* tkCanvPoly.c in Sources */,
+ F9FD315B0CC1AD070073837D /* tkCanvPs.c in Sources */,
+ F9FD315C0CC1AD070073837D /* tkCanvText.c in Sources */,
+ F9FD315D0CC1AD070073837D /* tkCanvUtil.c in Sources */,
+ F9FD315E0CC1AD070073837D /* tkCanvWind.c in Sources */,
+ F9FD315F0CC1AD070073837D /* tkClipboard.c in Sources */,
+ F9FD31600CC1AD070073837D /* tkCmds.c in Sources */,
+ F9FD31610CC1AD070073837D /* tkColor.c in Sources */,
+ F9FD31620CC1AD070073837D /* tkConfig.c in Sources */,
+ F9FD31630CC1AD070073837D /* tkConsole.c in Sources */,
+ F9FD31640CC1AD070073837D /* tkCursor.c in Sources */,
+ F9FD31650CC1AD070073837D /* tkEntry.c in Sources */,
+ F9FD31660CC1AD070073837D /* tkError.c in Sources */,
+ F9FD31670CC1AD070073837D /* tkEvent.c in Sources */,
+ F9FD31680CC1AD070073837D /* tkFileFilter.c in Sources */,
+ F9FD31690CC1AD070073837D /* tkFocus.c in Sources */,
+ F9FD316A0CC1AD070073837D /* tkFont.c in Sources */,
+ F9FD316B0CC1AD070073837D /* tkFrame.c in Sources */,
+ F9FD316C0CC1AD070073837D /* tkGC.c in Sources */,
+ F9FD316D0CC1AD070073837D /* tkGeometry.c in Sources */,
+ F9FD316E0CC1AD070073837D /* tkGet.c in Sources */,
+ F9FD316F0CC1AD070073837D /* tkGrab.c in Sources */,
+ F9FD31700CC1AD070073837D /* tkGrid.c in Sources */,
+ F9FD31710CC1AD070073837D /* tkImage.c in Sources */,
+ F9FD31720CC1AD070073837D /* tkImgBmap.c in Sources */,
+ F9FD31730CC1AD070073837D /* tkImgGIF.c in Sources */,
+ F92EE8D30E62F939001A6E80 /* tkImgPhInstance.c in Sources */,
+ F9FD31740CC1AD070073837D /* tkImgPhoto.c in Sources */,
+ F9DD99BE0F07DF850018B2E4 /* tkImgPNG.c in Sources */,
+ F9FD31750CC1AD070073837D /* tkImgPPM.c in Sources */,
+ F9FD31760CC1AD070073837D /* tkListbox.c in Sources */,
+ F9FD31770CC1AD070073837D /* tkMacWinMenu.c in Sources */,
+ F9FD31780CC1AD070073837D /* tkMain.c in Sources */,
+ F9FD31790CC1AD070073837D /* tkMenu.c in Sources */,
+ F9FD317A0CC1AD070073837D /* tkMenubutton.c in Sources */,
+ F9FD317B0CC1AD070073837D /* tkMenuDraw.c in Sources */,
+ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */,
+ F9FD317D0CC1AD070073837D /* tkObj.c in Sources */,
+ F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */,
+ F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */,
+ F9FD31800CC1AD070073837D /* tkOption.c in Sources */,
+ F9FD31810CC1AD070073837D /* tkPack.c in Sources */,
+ F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */,
+ F9FD31830CC1AD070073837D /* tkPlace.c in Sources */,
+ F9FD31850CC1AD070073837D /* tkRectOval.c in Sources */,
+ F9FD31860CC1AD070073837D /* tkScale.c in Sources */,
+ F9FD31870CC1AD070073837D /* tkScrollbar.c in Sources */,
+ F9FD31880CC1AD070073837D /* tkSelect.c in Sources */,
+ F9FD31890CC1AD070073837D /* tkSquare.c in Sources */,
+ F9FD318A0CC1AD070073837D /* tkStubInit.c in Sources */,
+ F9FD318B0CC1AD070073837D /* tkStubLib.c in Sources */,
+ F9FD318C0CC1AD070073837D /* tkStyle.c in Sources */,
+ F9FD318D0CC1AD070073837D /* tkTest.c in Sources */,
+ F9FD318E0CC1AD070073837D /* tkText.c in Sources */,
+ F9FD318F0CC1AD070073837D /* tkTextBTree.c in Sources */,
+ F9FD31900CC1AD070073837D /* tkTextDisp.c in Sources */,
+ F9FD31910CC1AD070073837D /* tkTextImage.c in Sources */,
+ F9FD31920CC1AD070073837D /* tkTextIndex.c in Sources */,
+ F9FD31930CC1AD070073837D /* tkTextMark.c in Sources */,
+ F9FD31940CC1AD070073837D /* tkTextTag.c in Sources */,
+ F9FD31950CC1AD070073837D /* tkTextWind.c in Sources */,
+ F9FD31960CC1AD070073837D /* tkTrig.c in Sources */,
+ F9FD31970CC1AD070073837D /* tkUndo.c in Sources */,
+ F9FD31980CC1AD070073837D /* tkUtil.c in Sources */,
+ F9FD31990CC1AD070073837D /* tkVisual.c in Sources */,
+ F9FD319A0CC1AD070073837D /* tkWindow.c in Sources */,
+ F9FD319B0CC1AD070073837D /* ttkBlink.c in Sources */,
+ F9FD319C0CC1AD070073837D /* ttkButton.c in Sources */,
+ F9FD319D0CC1AD070073837D /* ttkCache.c in Sources */,
+ F9FD319E0CC1AD070073837D /* ttkClamTheme.c in Sources */,
+ F9FD319F0CC1AD070073837D /* ttkClassicTheme.c in Sources */,
+ F9FD31A00CC1AD070073837D /* ttkDefaultTheme.c in Sources */,
+ F9FD31A10CC1AD070073837D /* ttkElements.c in Sources */,
+ F9FD31A20CC1AD070073837D /* ttkEntry.c in Sources */,
+ F9FD31A30CC1AD070073837D /* ttkFrame.c in Sources */,
+ F9FD31A40CC1AD070073837D /* ttkImage.c in Sources */,
+ F9FD31A50CC1AD070073837D /* ttkInit.c in Sources */,
+ F9FD31A60CC1AD070073837D /* ttkLabel.c in Sources */,
+ F9FD31A70CC1AD070073837D /* ttkLayout.c in Sources */,
+ F9FD31A80CC1AD070073837D /* ttkManager.c in Sources */,
+ F9FD31A90CC1AD070073837D /* ttkNotebook.c in Sources */,
+ F9FD31AA0CC1AD070073837D /* ttkPanedwindow.c in Sources */,
+ F9FD31AB0CC1AD070073837D /* ttkProgress.c in Sources */,
+ F9FD31AC0CC1AD070073837D /* ttkScale.c in Sources */,
+ F9FD31AD0CC1AD070073837D /* ttkScroll.c in Sources */,
+ F9FD31AE0CC1AD070073837D /* ttkScrollbar.c in Sources */,
+ F9FD31AF0CC1AD070073837D /* ttkSeparator.c in Sources */,
+ F9FD31B00CC1AD070073837D /* ttkSquare.c in Sources */,
+ F9FD31B10CC1AD070073837D /* ttkState.c in Sources */,
+ F9FD31B20CC1AD070073837D /* ttkStubInit.c in Sources */,
+ F9FD31B30CC1AD070073837D /* ttkStubLib.c in Sources */,
+ F9FD31B40CC1AD070073837D /* ttkTagSet.c in Sources */,
+ F9FD31B50CC1AD070073837D /* ttkTheme.c in Sources */,
+ F9FD31B60CC1AD070073837D /* ttkTrace.c in Sources */,
+ F9FD31B70CC1AD070073837D /* ttkTrack.c in Sources */,
+ F9FD31B80CC1AD070073837D /* ttkTreeview.c in Sources */,
+ F9FD31B90CC1AD070073837D /* ttkWidget.c in Sources */,
+ F9FD31DA0CC1AD070073837D /* tkAppInit.c in Sources */,
+ F9FD32020CC1ADB70073837D /* tkUnix.c in Sources */,
+ F9FD31DB0CC1AD070073837D /* tkUnix3d.c in Sources */,
+ F9FD320A0CC1ADB70073837D /* tkUnixButton.c in Sources */,
+ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */,
+ F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */,
+ F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */,
+ F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */,
+ F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */,
+ F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */,
+ F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */,
+ F9FD31FF0CC1ADB70073837D /* tkUnixFocus.c in Sources */,
+ F9FD31FC0CC1ADB70073837D /* tkUnixInit.c in Sources */,
+ F9FD31FA0CC1ADB70073837D /* tkUnixKey.c in Sources */,
+ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */,
+ F9FD320B0CC1ADB70073837D /* tkUnixMenubu.c in Sources */,
+ F9FD32010CC1ADB70073837D /* tkUnixRFont.c in Sources */,
+ F9FD31DC0CC1AD070073837D /* tkUnixScale.c in Sources */,
+ F9FD320C0CC1ADB70073837D /* tkUnixScrlbr.c in Sources */,
+ F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */,
+ F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */,
+ F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */,
+ F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ F90E36D50F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = unsupported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D60F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D70F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoGC;
+ };
+ F90E36D80F3B5C8400810A10 /* DebugNoGC */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoGC;
+ };
+ F91BCC4F093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = ReleaseUniversal;
+ };
+ F91BCC50093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = ReleaseUniversal;
+ };
+ F91BCC51093152310042A6BF /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ PREBINDING = NO;
+ };
+ name = ReleaseUniversal;
+ };
+ F93084370BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugMemCompile;
+ };
+ F93084380BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugMemCompile;
+ };
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugMemCompile;
+ };
+ F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-symbols=all";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugMemCompile;
+ };
+ F9359B250DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS)",
+ "-lgcov",
+ );
+ PREBINDING = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B260DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B270DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugGCov;
+ };
+ F9359B280DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugGCov;
+ };
+ F95CC8AC09158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Debug;
+ };
+ F95CC8AD09158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Release;
+ };
+ F95CC8AE09158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F95CC8B109158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Debug;
+ };
+ F95CC8B209158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Release;
+ };
+ F95CC8B309158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F95CC8B609158F3100EA5ACE /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = Debug;
+ };
+ F95CC8B709158F3100EA5ACE /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = Release;
+ };
+ F95CC8B809158F3100EA5ACE /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F97258A90A86873D00096C78 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Debug;
+ };
+ F97258AA0A86873D00096C78 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Release;
+ };
+ F97258AB0A86873D00096C78 /* DebugNoFixAndContinue */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoFixAndContinue;
+ };
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal;
+ };
+ F97AED1B0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Debug64bit;
+ };
+ F97AED1C0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Debug64bit;
+ };
+ F97AED1D0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Debug64bit;
+ };
+ F97AED1E0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_64_BIT)";
+ CONFIGURE_ARGS = "--enable-64bit $(CONFIGURE_ARGS)";
+ CPPFLAGS = "-arch $(NATIVE_ARCH_64_BIT) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ PREBINDING = NO;
+ };
+ name = Debug64bit;
+ };
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCF;
+ };
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCF;
+ };
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F9988AB10D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = 4.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB20D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB30D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB40D814C6500B6B03B /* Debug gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "Debug gcc40";
+ };
+ F9988AB50D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC = "llvm-gcc";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB60D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB70D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988AB80D814C7500B6B03B /* Debug llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "Debug llvm-gcc";
+ };
+ F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = 4.0;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ PREBINDING = NO;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc40 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal gcc40";
+ };
+ F9988BB50D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC = "llvm-gcc";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_OPTIMIZATION_LEVEL = 4;
+ "GCC_OPTIMIZATION_LEVEL[arch=ppc]" = s;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ PREBINDING = NO;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB60D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB70D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvm-gcc */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal llvm-gcc";
+ };
+ F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE73C0BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugLeaks;
+ };
+ F99EE73D0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE73E0BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugLeaks;
+ };
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7400BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugLeaks;
+ };
+ F99EE7410BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads";
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7420BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = unsupported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ PURIFY,
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ RUN_CLANG_STATIC_ANALYZER = YES;
+ };
+ name = DebugLeaks;
+ };
+ F9A9D1EF0FC77787002A2BE3 /* Debug clang */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tk-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CPPFLAGS = "-arch $(CURRENT_ARCH) $(CPPFLAGS)";
+ GCC = clang;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = YES;
+ PREBINDING = NO;
+ };
+ name = "Debug clang";
+ };
+ F9A9D1F00FC77787002A2BE3 /* Debug clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "Debug clang";
+ };
+ F9A9D1F10FC77787002A2BE3 /* Debug clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "Debug clang";
+ };
+ F9A9D1F20FC77787002A2BE3 /* Debug clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "Debug clang";
+ };
+ F9A9D1F30FC77799002A2BE3 /* ReleaseUniversal clang */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = (
+ "$(NATIVE_ARCH_64_BIT)",
+ "$(NATIVE_ARCH_32_BIT)",
+ );
+ CFLAGS = "-arch i386 -arch x86_64 $(CFLAGS)";
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC = clang;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ GCC_OPTIMIZATION_LEVEL = 4;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ PREBINDING = NO;
+ };
+ name = "ReleaseUniversal clang";
+ };
+ F9A9D1F40FC77799002A2BE3 /* ReleaseUniversal clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = "ReleaseUniversal clang";
+ };
+ F9A9D1F50FC77799002A2BE3 /* ReleaseUniversal clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = "ReleaseUniversal clang";
+ };
+ F9A9D1F60FC77799002A2BE3 /* ReleaseUniversal clang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal clang";
+ };
+ F9EEED960C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED970C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ GCC_INPUT_FILETYPE = sourcecode.c.c;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+ F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tk-Release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc $(CFLAGS)";
+ CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_INPUT_FILETYPE = sourcecode.c.objc;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ SDKROOT = macosx10.5;
+ };
+ name = ReleaseUniversal10.5SDK;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8AC09158F3100EA5ACE /* Debug */,
+ F9A9D1F00FC77787002A2BE3 /* Debug clang */,
+ F9988AB60D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB20D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D60F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8AE09158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE73B0BE835310060D4AF /* DebugUnthreaded */,
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084370BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE73C0BE835310060D4AF /* DebugLeaks */,
+ F9359B260DF212DA00E04F67 /* DebugGCov */,
+ F97AED1B0B660B2100310EA2 /* Debug64bit */,
+ F95CC8AD09158F3100EA5ACE /* Release */,
+ F91BCC4F093152310042A6BF /* ReleaseUniversal */,
+ F9A9D1F40FC77799002A2BE3 /* ReleaseUniversal clang */,
+ F9988BB60D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED960C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F95CC8B009158F3100EA5ACE /* Build configuration list for PBXNativeTarget "tktest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8B109158F3100EA5ACE /* Debug */,
+ F9A9D1F10FC77787002A2BE3 /* Debug clang */,
+ F9988AB70D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB30D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D70F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8B309158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE73D0BE835310060D4AF /* DebugUnthreaded */,
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084380BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE73E0BE835310060D4AF /* DebugLeaks */,
+ F9359B270DF212DA00E04F67 /* DebugGCov */,
+ F97AED1C0B660B2100310EA2 /* Debug64bit */,
+ F95CC8B209158F3100EA5ACE /* Release */,
+ F91BCC50093152310042A6BF /* ReleaseUniversal */,
+ F9A9D1F50FC77799002A2BE3 /* ReleaseUniversal clang */,
+ F9988BB70D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED970C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Tk" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F95CC8B609158F3100EA5ACE /* Debug */,
+ F9A9D1EF0FC77787002A2BE3 /* Debug clang */,
+ F9988AB50D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB10D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D50F3B5C8400810A10 /* DebugNoGC */,
+ F95CC8B809158F3100EA5ACE /* DebugNoFixAndContinue */,
+ F99EE7410BE835310060D4AF /* DebugUnthreaded */,
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F930843A0BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7420BE835310060D4AF /* DebugLeaks */,
+ F9359B250DF212DA00E04F67 /* DebugGCov */,
+ F97AED1E0B660B2100310EA2 /* Debug64bit */,
+ F95CC8B709158F3100EA5ACE /* Release */,
+ F91BCC51093152310042A6BF /* ReleaseUniversal */,
+ F9A9D1F30FC77799002A2BE3 /* ReleaseUniversal clang */,
+ F9988BB50D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ F97258A90A86873D00096C78 /* Debug */,
+ F9A9D1F20FC77787002A2BE3 /* Debug clang */,
+ F9988AB80D814C7500B6B03B /* Debug llvm-gcc */,
+ F9988AB40D814C6500B6B03B /* Debug gcc40 */,
+ F90E36D80F3B5C8400810A10 /* DebugNoGC */,
+ F97258AB0A86873D00096C78 /* DebugNoFixAndContinue */,
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */,
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7400BE835310060D4AF /* DebugLeaks */,
+ F9359B280DF212DA00E04F67 /* DebugGCov */,
+ F97AED1D0B660B2100310EA2 /* Debug64bit */,
+ F97258AA0A86873D00096C78 /* Release */,
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */,
+ F9A9D1F60FC77799002A2BE3 /* ReleaseUniversal clang */,
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvm-gcc */,
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc40 */,
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in
index 85b0b08..90e00a4 100644
--- a/macosx/Wish-Info.plist.in
+++ b/macosx/Wish-Info.plist.in
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
- Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ Copyright 2008-2009, Apple Inc.
See the file "license.terms" for information on usage and redistribution of
this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -41,7 +42,7 @@
<string>Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@,
Copyright © 1989-@TK_YEAR@ Tcl Core Team,
Copyright © 2002-@TK_YEAR@ Daniel A. Steffen,
-Copyright © 2001-2002 Apple Inc.,
+Copyright © 2001-2009 Apple Inc.,
Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
<key>CFBundleIconFile</key>
<string>Wish.icns</string>
@@ -64,10 +65,12 @@ Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
<key>CFBundleVersion</key>
<string>@TK_VERSION@@TK_PATCH_LEVEL@</string>
<key>LSMinimumSystemVersion</key>
- <string>10.2.0</string>
+ <string>10.5.0</string>
<key>LSRequiresCarbon</key>
<true/>
<key>NSAppleScriptEnabled</key>
<true/>
+ <key>OSAScriptingDefinition</key>
+ <string>Wish.sdef</string>
</dict>
</plist>
diff --git a/macosx/Wish.pbproj/default.pbxuser b/macosx/Wish.pbproj/default.pbxuser
deleted file mode 100644
index aafee5a..0000000
--- a/macosx/Wish.pbproj/default.pbxuser
+++ /dev/null
@@ -1,178 +0,0 @@
-// !$*UTF8*$!
-{
- F537552A016C352C01DC9062 = {
- activeBuildStyle = F537552C016C352C01DC9062;
- activeExecutable = F9F6B1E308E8648C00C9CB24;
- activeTarget = F9D6747B08E84DC100688CAA;
- addToTargets = (
- );
- codeSenseManager = F9D7368F06AD399F00DC3A31;
- executables = (
- F9F6B1EB08E864DC00C9CB24,
- F9F6B1E308E8648C00C9CB24,
- );
- sourceControlManager = F9D7368E06AD399F00DC3A31;
- userBuildSettings = {
- SYMROOT = "${SRCROOT}/../../build/tk";
- };
- };
- F9D6747B08E84DC100688CAA = {
- activeExec = 0;
- };
- F9D7368E06AD399F00DC3A31 = {
- fallbackIsa = XCSourceControlManager;
- isSCMEnabled = 0;
- isa = PBXSourceControlManager;
- scmConfiguration = {
- };
- scmType = scm.cvs;
- };
- F9D7368F06AD399F00DC3A31 = {
- indexTemplatePath = "";
- isa = PBXCodeSenseManager;
- usesDefaults = 1;
- wantsCodeCompletion = 1;
- wantsCodeCompletionAutoSuggestions = 1;
- wantsCodeCompletionCaseSensitivity = 1;
- wantsCodeCompletionListAlways = 1;
- wantsCodeCompletionOnlyMatchingItems = 1;
- wantsCodeCompletionParametersIncluded = 1;
- wantsCodeCompletionPlaceholdersInserted = 1;
- wantsCodeCompletionTabCompletes = 1;
- wantsIndex = 1;
- };
- F9F6B1E308E8648C00C9CB24 = {
- activeArgIndex = 2147483647;
- activeArgIndices = (
- );
- argumentStrings = (
- );
- configStateDict = {
- "PBXLSLaunchAction-0" = {
- PBXLSLaunchAction = 0;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXLSRunLaunchConfig;
- displayName = "Executable Runner";
- identifier = com.apple.Xcode.launch.runConfig;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- "PBXLSLaunchAction-1" = {
- PBXLSLaunchAction = 1;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXGDB_LaunchConfig;
- displayName = GDB;
- identifier = com.apple.Xcode.launch.GDBMI_Config;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- };
- cppStopOnCatchEnabled = 0;
- cppStopOnThrowEnabled = 0;
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = _debug;
- enableDebugStr = 0;
- environmentEntries = (
- {
- active = NO;
- name = DYLD_PRINT_LIBRARIES;
- },
- );
- isa = PBXExecutable;
- launchableReference = F9F6B1E408E8648C00C9CB24;
- libgmallocEnabled = 0;
- name = Wish;
- shlibInfoDictList = (
- );
- sourceDirectories = (
- );
- };
- F9F6B1E408E8648C00C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.application;
- path = Wish.app;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F9F6B1EB08E864DC00C9CB24 = {
- activeArgIndex = 2147483647;
- activeArgIndices = (
- NO,
- NO,
- NO,
- );
- argumentStrings = (
- "${SRCROOT}/../../tcl/tests/all.tcl",
- "${SRCROOT}/../../tk/tests/all.tcl",
- "-verbose \"\"",
- );
- configStateDict = {
- "PBXLSLaunchAction-0" = {
- PBXLSLaunchAction = 0;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXLSRunLaunchConfig;
- displayName = "Executable Runner";
- identifier = com.apple.Xcode.launch.runConfig;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- "PBXLSLaunchAction-1" = {
- PBXLSLaunchAction = 1;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXGDB_LaunchConfig;
- displayName = GDB;
- identifier = com.apple.Xcode.launch.GDBMI_Config;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- };
- cppStopOnCatchEnabled = 0;
- cppStopOnThrowEnabled = 0;
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = _debug;
- enableDebugStr = 0;
- environmentEntries = (
- {
- active = YES;
- name = TCL_LIBRARY;
- value = "${SRCROOT}/../../tcl/library";
- },
- {
- active = YES;
- name = TK_LIBRARY;
- value = "${SRCROOT}/../../tk/library";
- },
- {
- active = NO;
- name = DYLD_PRINT_LIBRARIES;
- },
- );
- isa = PBXExecutable;
- launchableReference = F9F6B1EC08E864DC00C9CB24;
- libgmallocEnabled = 0;
- name = tktest;
- shlibInfoDictList = (
- );
- sourceDirectories = (
- );
- };
- F9F6B1EC08E864DC00C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = "compiled.mach-o.executable";
- path = tktest;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-}
diff --git a/macosx/Wish.pbproj/jingham.pbxuser b/macosx/Wish.pbproj/jingham.pbxuser
deleted file mode 100644
index aafee5a..0000000
--- a/macosx/Wish.pbproj/jingham.pbxuser
+++ /dev/null
@@ -1,178 +0,0 @@
-// !$*UTF8*$!
-{
- F537552A016C352C01DC9062 = {
- activeBuildStyle = F537552C016C352C01DC9062;
- activeExecutable = F9F6B1E308E8648C00C9CB24;
- activeTarget = F9D6747B08E84DC100688CAA;
- addToTargets = (
- );
- codeSenseManager = F9D7368F06AD399F00DC3A31;
- executables = (
- F9F6B1EB08E864DC00C9CB24,
- F9F6B1E308E8648C00C9CB24,
- );
- sourceControlManager = F9D7368E06AD399F00DC3A31;
- userBuildSettings = {
- SYMROOT = "${SRCROOT}/../../build/tk";
- };
- };
- F9D6747B08E84DC100688CAA = {
- activeExec = 0;
- };
- F9D7368E06AD399F00DC3A31 = {
- fallbackIsa = XCSourceControlManager;
- isSCMEnabled = 0;
- isa = PBXSourceControlManager;
- scmConfiguration = {
- };
- scmType = scm.cvs;
- };
- F9D7368F06AD399F00DC3A31 = {
- indexTemplatePath = "";
- isa = PBXCodeSenseManager;
- usesDefaults = 1;
- wantsCodeCompletion = 1;
- wantsCodeCompletionAutoSuggestions = 1;
- wantsCodeCompletionCaseSensitivity = 1;
- wantsCodeCompletionListAlways = 1;
- wantsCodeCompletionOnlyMatchingItems = 1;
- wantsCodeCompletionParametersIncluded = 1;
- wantsCodeCompletionPlaceholdersInserted = 1;
- wantsCodeCompletionTabCompletes = 1;
- wantsIndex = 1;
- };
- F9F6B1E308E8648C00C9CB24 = {
- activeArgIndex = 2147483647;
- activeArgIndices = (
- );
- argumentStrings = (
- );
- configStateDict = {
- "PBXLSLaunchAction-0" = {
- PBXLSLaunchAction = 0;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXLSRunLaunchConfig;
- displayName = "Executable Runner";
- identifier = com.apple.Xcode.launch.runConfig;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- "PBXLSLaunchAction-1" = {
- PBXLSLaunchAction = 1;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXGDB_LaunchConfig;
- displayName = GDB;
- identifier = com.apple.Xcode.launch.GDBMI_Config;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- };
- cppStopOnCatchEnabled = 0;
- cppStopOnThrowEnabled = 0;
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = _debug;
- enableDebugStr = 0;
- environmentEntries = (
- {
- active = NO;
- name = DYLD_PRINT_LIBRARIES;
- },
- );
- isa = PBXExecutable;
- launchableReference = F9F6B1E408E8648C00C9CB24;
- libgmallocEnabled = 0;
- name = Wish;
- shlibInfoDictList = (
- );
- sourceDirectories = (
- );
- };
- F9F6B1E408E8648C00C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.application;
- path = Wish.app;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F9F6B1EB08E864DC00C9CB24 = {
- activeArgIndex = 2147483647;
- activeArgIndices = (
- NO,
- NO,
- NO,
- );
- argumentStrings = (
- "${SRCROOT}/../../tcl/tests/all.tcl",
- "${SRCROOT}/../../tk/tests/all.tcl",
- "-verbose \"\"",
- );
- configStateDict = {
- "PBXLSLaunchAction-0" = {
- PBXLSLaunchAction = 0;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXLSRunLaunchConfig;
- displayName = "Executable Runner";
- identifier = com.apple.Xcode.launch.runConfig;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- "PBXLSLaunchAction-1" = {
- PBXLSLaunchAction = 1;
- PBXLSLaunchStartAction = 1;
- PBXLSLaunchStdioStyle = 2;
- PBXLSLaunchStyle = 0;
- class = PBXGDB_LaunchConfig;
- displayName = GDB;
- identifier = com.apple.Xcode.launch.GDBMI_Config;
- remoteHostInfo = "";
- startActionInfo = "";
- };
- };
- cppStopOnCatchEnabled = 0;
- cppStopOnThrowEnabled = 0;
- customDataFormattersEnabled = 1;
- debuggerPlugin = GDBDebugging;
- disassemblyDisplayState = 0;
- dylibVariantSuffix = _debug;
- enableDebugStr = 0;
- environmentEntries = (
- {
- active = YES;
- name = TCL_LIBRARY;
- value = "${SRCROOT}/../../tcl/library";
- },
- {
- active = YES;
- name = TK_LIBRARY;
- value = "${SRCROOT}/../../tk/library";
- },
- {
- active = NO;
- name = DYLD_PRINT_LIBRARIES;
- },
- );
- isa = PBXExecutable;
- launchableReference = F9F6B1EC08E864DC00C9CB24;
- libgmallocEnabled = 0;
- name = tktest;
- shlibInfoDictList = (
- );
- sourceDirectories = (
- );
- };
- F9F6B1EC08E864DC00C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = "compiled.mach-o.executable";
- path = tktest;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-}
diff --git a/macosx/Wish.pbproj/project.pbxproj b/macosx/Wish.pbproj/project.pbxproj
deleted file mode 100644
index b1c72e5..0000000
--- a/macosx/Wish.pbproj/project.pbxproj
+++ /dev/null
@@ -1,2312 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 39;
- objects = {
- 4C148E2007ECCFAC0033822E = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkEntry.h;
- path = ../generic/tkEntry.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- 4C148E2407ECCFCF0033822E = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXEntry.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 4C3B4CF6040B18B200C916F0 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.rez;
- path = tkMacOSXAETE.r;
- refType = 4;
- sourceTree = "<group>";
- };
- 4C8A204405E0421900C18A82 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXCarbonEvents.c;
- refType = 4;
- sourceTree = "<group>";
- };
- 4CB2D7CF0619F8EB0081E375 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXScale.c;
- refType = 4;
- sourceTree = "<group>";
- };
-//4C0
-//4C1
-//4C2
-//4C3
-//4C4
-//950
-//951
-//952
-//953
-//954
- 95911CC7081532D8006F6BCB = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = IOKit.framework;
- path = /System/Library/Frameworks/IOKit.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
-//950
-//951
-//952
-//953
-//954
-//F50
-//F51
-//F52
-//F53
-//F54
- F50D96120196176E01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = ApplicationServices.framework;
- path = /System/Library/Frameworks/ApplicationServices.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- F537552A016C352C01DC9062 = {
- buildSettings = {
- };
- buildStyles = (
- F537552C016C352C01DC9062,
- F537552D016C352C01DC9062,
- );
- hasScannedForEncodings = 1;
- isa = PBXProject;
- mainGroup = F537552B016C352C01DC9062;
- productRefGroup = F53755DD016C38D201DC9062;
- projectDirPath = "";
- targets = (
- F9D6747B08E84DC100688CAA,
- );
- };
- F537552B016C352C01DC9062 = {
- children = (
- F92ED9910403D0F0006F146B,
- F5C88659017D625C01DC9062,
- F5DF07A7016CD03801DC9062,
- F5375688016C3F1001DC9062,
- F5375531016C376E01DC9062,
- F537552E016C376E01DC9062,
- F537553C016C376E01DC9062,
- F53755C9016C389901DC9062,
- F53755CC016C389901DC9062,
- F537567C016C3ADB01DC9062,
- F53755DD016C38D201DC9062,
- );
- isa = PBXGroup;
- refType = 4;
- sourceTree = "<group>";
- };
- F537552C016C352C01DC9062 = {
- buildSettings = {
- BUILD_STYLE = Development;
- MAKE_TARGET = develop;
- };
- isa = PBXBuildStyle;
- name = Development;
- };
- F537552D016C352C01DC9062 = {
- buildSettings = {
- BUILD_STYLE = Deployment;
- MAKE_TARGET = deploy;
- };
- isa = PBXBuildStyle;
- name = Deployment;
- };
- F537552E016C376E01DC9062 = {
- children = (
- F537552F016C376E01DC9062,
- F5375530016C376E01DC9062,
- );
- isa = PBXGroup;
- name = Generic;
- refType = 4;
- sourceTree = "<group>";
- };
- F537552F016C376E01DC9062 = {
- children = (
- F5375569016C37A601DC9062,
- F537556A016C37A601DC9062,
- F537556B016C37A601DC9062,
- F537556C016C37A601DC9062,
- F537556D016C37A601DC9062,
- F537556E016C37A601DC9062,
- F537556F016C37A601DC9062,
- F5375570016C37A601DC9062,
- 4C148E2007ECCFAC0033822E,
- F5375571016C37A601DC9062,
- F5375572016C37A601DC9062,
- F5375573016C37A601DC9062,
- F5375574016C37A601DC9062,
- F5375575016C37A601DC9062,
- F5375576016C37A601DC9062,
- F5375577016C37A601DC9062,
- F5375578016C37A601DC9062,
- F5375579016C37A601DC9062,
- F537557A016C37A601DC9062,
- F537557B016C37A601DC9062,
- F537557C016C37A601DC9062,
- F537557D016C37A601DC9062,
- F537557E016C37A601DC9062,
- F537557F016C37A601DC9062,
- F5BFE58F02F8C45B01DC9062,
- );
- isa = PBXGroup;
- name = Headers;
- refType = 4;
- sourceTree = "<group>";
- };
- 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;
- sourceTree = "<group>";
- };
- F5375531016C376E01DC9062 = {
- children = (
- F5375532016C376E01DC9062,
- F537553B016C376E01DC9062,
- );
- isa = PBXGroup;
- name = Resources;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375532016C376E01DC9062 = {
- children = (
- F5375533016C376E01DC9062,
- 4C3B4CF6040B18B200C916F0,
- F5375535016C376E01DC9062,
- F5375538016C376E01DC9062,
- F537553A016C376E01DC9062,
- );
- isa = PBXGroup;
- name = "Resource Manager Resources";
- refType = 4;
- sourceTree = "<group>";
- };
- F5375533016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.rez;
- path = tkAboutDlg.r;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375535016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.rez;
- path = tkMacOSXCursors.r;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375538016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.rez;
- path = tkMacOSXMenu.r;
- refType = 4;
- sourceTree = "<group>";
- };
- F537553A016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.rez;
- path = tkMacOSXXCursors.r;
- refType = 4;
- sourceTree = "<group>";
- };
- F537553B016C376E01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.icns;
- path = Wish.icns;
- refType = 4;
- sourceTree = "<group>";
- };
- F537553C016C376E01DC9062 = {
- children = (
- F537553D016C376E01DC9062,
- F5375546016C376E01DC9062,
- );
- isa = PBXGroup;
- name = "MacOS X";
- refType = 4;
- sourceTree = "<group>";
- };
- F537553D016C376E01DC9062 = {
- children = (
- F537553E016C376E01DC9062,
- F537553F016C376E01DC9062,
- F5375540016C376E01DC9062,
- F5375541016C376E01DC9062,
- F5375542016C376E01DC9062,
- F5375543016C376E01DC9062,
- F5375545016C376E01DC9062,
- );
- isa = PBXGroup;
- name = Headers;
- refType = 4;
- sourceTree = "<group>";
- };
- F537553E016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSX.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537553F016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXDebug.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375540016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXDefault.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375541016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXEvent.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375542016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXInt.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375543016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXPort.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375545016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = tkMacOSXWm.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375546016C376E01DC9062 = {
- children = (
- F5375549016C376E01DC9062,
- F537554A016C376E01DC9062,
- 4C8A204405E0421900C18A82,
- F537554B016C376E01DC9062,
- F537554C016C376E01DC9062,
- F537554D016C376E01DC9062,
- F537554E016C376E01DC9062,
- F537554F016C376E01DC9062,
- F5375550016C376E01DC9062,
- F5375551016C376E01DC9062,
- F5375552016C376E01DC9062,
- 4C148E2407ECCFCF0033822E,
- F5375553016C376E01DC9062,
- F5375554016C376E01DC9062,
- F5375555016C376E01DC9062,
- F5375556016C376E01DC9062,
- F5375557016C376E01DC9062,
- F5375558016C376E01DC9062,
- F5375559016C376E01DC9062,
- F537555A016C376E01DC9062,
- F537555B016C376E01DC9062,
- F537555C016C376E01DC9062,
- F537555D016C376E01DC9062,
- F537555E016C376E01DC9062,
- 4CB2D7CF0619F8EB0081E375,
- F5375560016C376E01DC9062,
- F5375561016C376E01DC9062,
- F5375562016C376E01DC9062,
- F5375563016C376E01DC9062,
- F5375565016C376E01DC9062,
- F5375567016C376E01DC9062,
- F5375568016C376E01DC9062,
- );
- isa = PBXGroup;
- name = Source;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375548016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkAppInit.c;
- path = ../unix/tkAppInit.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375549016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXBitmap.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554A016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXButton.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554B016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXClipboard.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554C016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXColor.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554D016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXConfig.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554E016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXCursor.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537554F016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXDebug.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375550016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXDialog.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375551016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXDraw.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375552016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXEmbed.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375553016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXEvent.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375554016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXFont.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375555016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXHLEvents.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375556016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXInit.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375557016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXKeyboard.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375558016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXKeyEvent.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375559016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXMenu.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537555A016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXMenubutton.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537555B016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXMenus.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537555C016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXMouseEvent.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537555D016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXNotify.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F537555E016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXRegion.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375560016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXScrlbr.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375561016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXSend.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375562016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXSubwindows.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375563016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXTest.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375565016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXWindowEvent.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375567016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXWm.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375568016C376E01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- path = tkMacOSXXStubs.c;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375569016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = default.h;
- path = ../generic/default.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556A016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = ks_names.h;
- path = ../generic/ks_names.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556B016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tk.h;
- path = ../generic/tk.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556C016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tk3d.h;
- path = ../generic/tk3d.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556D016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkButton.h;
- path = ../generic/tkButton.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556E016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkCanvas.h;
- path = ../generic/tkCanvas.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537556F016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkColor.h;
- path = ../generic/tkColor.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375570016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkDecls.h;
- path = ../generic/tkDecls.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375571016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkFileFilter.h;
- path = ../generic/tkFileFilter.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375572016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkFont.h;
- path = ../generic/tkFont.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375573016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkInitScript.h;
- path = ../generic/tkInitScript.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375574016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkInt.h;
- path = ../generic/tkInt.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375575016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkIntDecls.h;
- path = ../generic/tkIntDecls.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375576016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkIntPlatDecls.h;
- path = ../generic/tkIntPlatDecls.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375577016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkIntXlibDecls.h;
- path = ../generic/tkIntXlibDecls.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375578016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkMenu.h;
- path = ../generic/tkMenu.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375579016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkMenubutton.h;
- path = ../generic/tkMenubutton.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557A016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkPlatDecls.h;
- path = ../generic/tkPlatDecls.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557B016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkPort.h;
- path = ../generic/tkPort.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557C016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkScale.h;
- path = ../generic/tkScale.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557D016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkScrollbar.h;
- path = ../generic/tkScrollbar.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557E016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkSelect.h;
- path = ../generic/tkSelect.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537557F016C37A601DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkText.h;
- path = ../generic/tkText.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375580016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tk3d.c;
- path = ../generic/tk3d.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375581016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkArgv.c;
- path = ../generic/tkArgv.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375582016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkAtom.c;
- path = ../generic/tkAtom.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375583016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkBind.c;
- path = ../generic/tkBind.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375584016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkBitmap.c;
- path = ../generic/tkBitmap.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375585016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkButton.c;
- path = ../generic/tkButton.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375586016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvArc.c;
- path = ../generic/tkCanvArc.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375587016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvas.c;
- path = ../generic/tkCanvas.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375588016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvBmap.c;
- path = ../generic/tkCanvBmap.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375589016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvImg.c;
- path = ../generic/tkCanvImg.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558A016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvLine.c;
- path = ../generic/tkCanvLine.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558B016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvPoly.c;
- path = ../generic/tkCanvPoly.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558C016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvPs.c;
- path = ../generic/tkCanvPs.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558D016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvText.c;
- path = ../generic/tkCanvText.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558E016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvUtil.c;
- path = ../generic/tkCanvUtil.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537558F016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCanvWind.c;
- path = ../generic/tkCanvWind.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375590016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkClipboard.c;
- path = ../generic/tkClipboard.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375591016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCmds.c;
- path = ../generic/tkCmds.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375592016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkColor.c;
- path = ../generic/tkColor.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375593016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkConfig.c;
- path = ../generic/tkConfig.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375594016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkConsole.c;
- path = ../generic/tkConsole.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375595016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkCursor.c;
- path = ../generic/tkCursor.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375596016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkEntry.c;
- path = ../generic/tkEntry.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375597016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkError.c;
- path = ../generic/tkError.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375598016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkEvent.c;
- path = ../generic/tkEvent.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375599016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkFileFilter.c;
- path = ../generic/tkFileFilter.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559A016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkFocus.c;
- path = ../generic/tkFocus.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559B016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkFont.c;
- path = ../generic/tkFont.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559C016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkFrame.c;
- path = ../generic/tkFrame.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559D016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkGC.c;
- path = ../generic/tkGC.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559E016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkGeometry.c;
- path = ../generic/tkGeometry.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537559F016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkGet.c;
- path = ../generic/tkGet.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A0016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkGrab.c;
- path = ../generic/tkGrab.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A1016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkGrid.c;
- path = ../generic/tkGrid.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A2016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImage.c;
- path = ../generic/tkImage.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A3016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImgBmap.c;
- path = ../generic/tkImgBmap.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A4016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImgGIF.c;
- path = ../generic/tkImgGIF.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A5016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImgPhoto.c;
- path = ../generic/tkImgPhoto.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A6016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImgPPM.c;
- path = ../generic/tkImgPPM.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A7016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkImgUtil.c;
- path = ../generic/tkImgUtil.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A8016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkListbox.c;
- path = ../generic/tkListbox.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755A9016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMacWinMenu.c;
- path = ../generic/tkMacWinMenu.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AA016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMain.c;
- path = ../generic/tkMain.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AB016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMenu.c;
- path = ../generic/tkMenu.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AC016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMenubutton.c;
- path = ../generic/tkMenubutton.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AD016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMenuDraw.c;
- path = ../generic/tkMenuDraw.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AE016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkMessage.c;
- path = ../generic/tkMessage.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755AF016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkObj.c;
- path = ../generic/tkObj.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B0016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkOldConfig.c;
- path = ../generic/tkOldConfig.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B1016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkOption.c;
- path = ../generic/tkOption.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B2016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkPack.c;
- path = ../generic/tkPack.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B3016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkPlace.c;
- path = ../generic/tkPlace.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B4016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkPointer.c;
- path = ../generic/tkPointer.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B5016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkRectOval.c;
- path = ../generic/tkRectOval.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B6016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkScale.c;
- path = ../generic/tkScale.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B7016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkScrollbar.c;
- path = ../generic/tkScrollbar.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B8016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkSelect.c;
- path = ../generic/tkSelect.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755B9016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkStubImg.c;
- path = ../generic/tkStubImg.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BA016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkStubInit.c;
- path = ../generic/tkStubInit.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BB016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkStubLib.c;
- path = ../generic/tkStubLib.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BC016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTest.c;
- path = ../generic/tkTest.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BD016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkText.c;
- path = ../generic/tkText.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BE016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextBTree.c;
- path = ../generic/tkTextBTree.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755BF016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextDisp.c;
- path = ../generic/tkTextDisp.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C0016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextImage.c;
- path = ../generic/tkTextImage.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C1016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextIndex.c;
- path = ../generic/tkTextIndex.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C2016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextMark.c;
- path = ../generic/tkTextMark.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C3016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextTag.c;
- path = ../generic/tkTextTag.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C4016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTextWind.c;
- path = ../generic/tkTextWind.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C5016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkTrig.c;
- path = ../generic/tkTrig.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C6016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkUtil.c;
- path = ../generic/tkUtil.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C7016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkVisual.c;
- path = ../generic/tkVisual.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C8016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkWindow.c;
- path = ../generic/tkWindow.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755C9016C389901DC9062 = {
- children = (
- F5375548016C376E01DC9062,
- F53755CA016C389901DC9062,
- F53755CB016C389901DC9062,
- );
- isa = PBXGroup;
- name = Unix;
- refType = 4;
- sourceTree = "<group>";
- };
- F53755CA016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkUnix3d.c;
- path = ../unix/tkUnix3d.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755CB016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkUnixScale.c;
- path = ../unix/tkUnixScale.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755CC016C389901DC9062 = {
- children = (
- F53755CD016C389901DC9062,
- F53755D7016C389901DC9062,
- );
- isa = PBXGroup;
- name = "X Emulation";
- refType = 4;
- sourceTree = "<group>";
- };
- F53755CD016C389901DC9062 = {
- children = (
- F53755CE016C389901DC9062,
- F53755CF016C389901DC9062,
- F53755D0016C389901DC9062,
- F53755D1016C389901DC9062,
- F53755D2016C389901DC9062,
- F53755D3016C389901DC9062,
- F53755D4016C389901DC9062,
- F53755D5016C389901DC9062,
- F53755D6016C389901DC9062,
- );
- isa = PBXGroup;
- name = Headers;
- refType = 4;
- sourceTree = "<group>";
- };
- F53755CE016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = xbytes.h;
- path = ../xlib/xbytes.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755CF016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = cursorfont.h;
- path = ../xlib/X11/cursorfont.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D0016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = keysym.h;
- path = ../xlib/X11/keysym.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D1016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = keysymdef.h;
- path = ../xlib/X11/keysymdef.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D2016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = X.h;
- path = ../xlib/X11/X.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D3016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = Xatom.h;
- path = ../xlib/X11/Xatom.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D4016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = Xfuncproto.h;
- path = ../xlib/X11/Xfuncproto.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D5016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = Xlib.h;
- path = ../xlib/X11/Xlib.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D6016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = Xutil.h;
- path = ../xlib/X11/Xutil.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D7016C389901DC9062 = {
- children = (
- F53755D8016C389901DC9062,
- F53755D9016C389901DC9062,
- F53755DA016C389901DC9062,
- F53755DB016C389901DC9062,
- F53755DC016C389901DC9062,
- );
- isa = PBXGroup;
- name = Source;
- refType = 4;
- sourceTree = "<group>";
- };
- F53755D8016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = xcolors.c;
- path = ../xlib/xcolors.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755D9016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = xdraw.c;
- path = ../xlib/xdraw.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755DA016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = xgc.c;
- path = ../xlib/xgc.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755DB016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = ximage.c;
- path = ../xlib/ximage.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755DC016C389901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = xutil.c;
- path = ../xlib/xutil.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F53755DD016C38D201DC9062 = {
- children = (
- F9F6B1C008E863C200C9CB24,
- F9F6B1BF08E863B300C9CB24,
- F9F6B1BE08E8639A00C9CB24,
- );
- isa = PBXGroup;
- name = Products;
- refType = 4;
- sourceTree = "<group>";
- };
- F537567C016C3ADB01DC9062 = {
- children = (
- F5875C7B016FEF1D01DC9062,
- F50D96120196176E01DC9062,
- F537567D016C3ADB01DC9062,
- 95911CC7081532D8006F6BCB,
- );
- isa = PBXGroup;
- name = "External Frameworks";
- refType = 4;
- sourceTree = "<group>";
- };
- F537567D016C3ADB01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- F5375688016C3F1001DC9062 = {
- children = (
- F5375689016C3F1001DC9062,
- F537568A016C3F1001DC9062,
- F537568B016C3F1001DC9062,
- F537568C016C3F1001DC9062,
- F537568D016C3F1001DC9062,
- F537568E016C3F1001DC9062,
- F537568F016C3F1001DC9062,
- F5375690016C3F1001DC9062,
- F5375691016C3F1001DC9062,
- F5375692016C3F1001DC9062,
- );
- isa = PBXGroup;
- name = Bitmaps;
- refType = 4;
- sourceTree = "<group>";
- };
- F5375689016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = error.xbm;
- path = ../bitmaps/error.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568A016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = gray12.xbm;
- path = ../bitmaps/gray12.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568B016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = gray25.xbm;
- path = ../bitmaps/gray25.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568C016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = gray50.xbm;
- path = ../bitmaps/gray50.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568D016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = gray75.xbm;
- path = ../bitmaps/gray75.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568E016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = hourglass.xbm;
- path = ../bitmaps/hourglass.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F537568F016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = info.xbm;
- path = ../bitmaps/info.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375690016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = questhead.xbm;
- path = ../bitmaps/questhead.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375691016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = question.xbm;
- path = ../bitmaps/question.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5375692016C3F1001DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = image.bmp;
- name = warning.xbm;
- path = ../bitmaps/warning.xbm;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F55BC46802B2D38B01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkPanedWindow.c;
- path = ../generic/tkPanedWindow.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F55BC46A02B2D3F301DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = panedwindow.tcl;
- path = ../library/panedwindow.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5875C7B016FEF1D01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Tcl.framework;
- path = ../tcl/Tcl.framework;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F5BFE58B02F8C41501DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkStyle.c;
- path = ../generic/tkStyle.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5BFE58C02F8C41501DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.c;
- name = tkUndo.c;
- path = ../generic/tkUndo.c;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5BFE58F02F8C45B01DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- name = tkUndo.h;
- path = ../generic/tkUndo.h;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5C2EA33034D71B2016F146B = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = mkpsenc.tcl;
- path = ../library/mkpsenc.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5C88659017D625C01DC9062 = {
- children = (
- F5C8865A017D625C01DC9062,
- F5C8865B017D625C01DC9062,
- );
- isa = PBXGroup;
- name = "Header Tools";
- refType = 4;
- sourceTree = "<group>";
- };
- F5C8865A017D625C01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tk.decls;
- path = ../generic/tk.decls;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5C8865B017D625C01DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tkInt.decls;
- path = ../generic/tkInt.decls;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF07A7016CD03801DC9062 = {
- children = (
- F5DF0928016CD3F901DC9062,
- F5DF0929016CD3F901DC9062,
- F5DF092A016CD3F901DC9062,
- F5DF092B016CD3F901DC9062,
- F5DF092C016CD3F901DC9062,
- F5DF092D016CD3F901DC9062,
- F5DF092E016CD3F901DC9062,
- F5DF092F016CD3F901DC9062,
- F5DF0930016CD3F901DC9062,
- F5DF0931016CD3F901DC9062,
- F5DF0932016CD3F901DC9062,
- F5DF0933016CD3F901DC9062,
- F5DF0934016CD3F901DC9062,
- F5C2EA33034D71B2016F146B,
- F5DF0935016CD3F901DC9062,
- F5DF0936016CD3F901DC9062,
- F5DF0937016CD3F901DC9062,
- F5DF0938016CD3F901DC9062,
- F5DF0939016CD3F901DC9062,
- F55BC46A02B2D3F301DC9062,
- F5DF093A016CD3F901DC9062,
- F5DF093B016CD3F901DC9062,
- F5DF093C016CD3F901DC9062,
- F5DF093D016CD3F901DC9062,
- F5DF093E016CD3F901DC9062,
- F5DF093F016CD3F901DC9062,
- F5DF0940016CD3F901DC9062,
- F5DF0941016CD3F901DC9062,
- F5DF0942016CD3F901DC9062,
- F5DF0943016CD3F901DC9062,
- F5DF0944016CD3F901DC9062,
- F5DF0945016CD3F901DC9062,
- );
- isa = PBXGroup;
- name = Scripts;
- refType = 4;
- sourceTree = "<group>";
- };
- F5DF0928016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = bgerror.tcl;
- path = ../library/bgerror.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0929016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = button.tcl;
- path = ../library/button.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092A016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = choosedir.tcl;
- path = ../library/choosedir.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092B016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = clrpick.tcl;
- path = ../library/clrpick.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092C016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = comdlg.tcl;
- path = ../library/comdlg.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092D016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = console.tcl;
- path = ../library/console.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092E016CD3F901DC9062 = {
- includeInIndex = 0;
- isa = PBXFileReference;
- lastKnownFileType = folder;
- name = demos;
- path = ../library/demos;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF092F016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = dialog.tcl;
- path = ../library/dialog.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0930016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = entry.tcl;
- path = ../library/entry.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0931016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = focus.tcl;
- path = ../library/focus.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0932016CD3F901DC9062 = {
- includeInIndex = 0;
- isa = PBXFileReference;
- lastKnownFileType = folder;
- name = images;
- path = ../library/images;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0933016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = listbox.tcl;
- path = ../library/listbox.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0934016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = menu.tcl;
- path = ../library/menu.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0935016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = msgbox.tcl;
- path = ../library/msgbox.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0936016CD3F901DC9062 = {
- includeInIndex = 0;
- isa = PBXFileReference;
- lastKnownFileType = folder;
- name = msgs;
- path = ../library/msgs;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0937016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = obsolete.tcl;
- path = ../library/obsolete.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0938016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = optMenu.tcl;
- path = ../library/optMenu.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0939016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = palette.tcl;
- path = ../library/palette.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093A016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = prolog.ps;
- path = ../generic/prolog.ps;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093B016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = safetk.tcl;
- path = ../library/safetk.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093C016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = scale.tcl;
- path = ../library/scale.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093D016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = scrlbar.tcl;
- path = ../library/scrlbar.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093E016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = spinbox.tcl;
- path = ../library/spinbox.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF093F016CD3F901DC9062 = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tclIndex;
- path = ../library/tclIndex;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0940016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tearoff.tcl;
- path = ../library/tearoff.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0941016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = text.tcl;
- path = ../library/text.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0942016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tk.tcl;
- path = ../library/tk.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0943016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = tkfbox.tcl;
- path = ../library/tkfbox.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0944016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = unsupported.tcl;
- path = ../library/unsupported.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F5DF0945016CD3F901DC9062 = {
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = xmfbox.tcl;
- path = ../library/xmfbox.tcl;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
-//F50
-//F51
-//F52
-//F53
-//F54
-//F90
-//F91
-//F92
-//F93
-//F94
- F92ED9910403D0F0006F146B = {
- fileEncoding = 5;
- isa = PBXFileReference;
- lastKnownFileType = text;
- name = ChangeLog;
- path = ../ChangeLog;
- refType = 2;
- sourceTree = SOURCE_ROOT;
- };
- F9D6747B08E84DC100688CAA = {
- buildArgumentsString = "-c \"cd \\\"${TK_SRCROOT}/macosx\\\" && ACTION=${ACTION} && CFLAGS=\\\"${CFLAGS}\\\" gnumake \\${ACTION:+\\${ACTION/clean/distclean}-}${MAKE_TARGET} INSTALL_ROOT=\\\"${DSTROOT}\\\" INSTALL_PATH=\\\"${INSTALL_PATH}\\\" PREFIX=\\\"${PREFIX}\\\" BINDIR=\\\"${BINDIR}\\\" MANDIR=\\\"${MANDIR}\\\" TCL_BUILD_DIR=\\\"${TCL_BUILD_DIR}\\\" APPLICATION_INSTALL_PATH=\\\"${APPLICATION_INSTALL_PATH}\\\" \\${EXTRA_MAKE_FLAGS} ${ALL_SETTINGS}\"";
- buildPhases = (
- );
- buildSettings = {
- APPLICATION_INSTALL_PATH = /Applications/Utilities;
- BINDIR = "${PREFIX}/bin";
- CFLAGS = "";
- INSTALL_PATH = /Library/Frameworks;
- MANDIR = "${PREFIX}/man";
- PREFIX = /usr/local;
- PRODUCT_NAME = Tk;
- TCL_BUILD_DIR = "${SYMROOT}/../tcl/${BUILD_STYLE}";
- TCL_SRCROOT = "${SRCROOT}/../../tcl";
- TEMP_DIR = "${PROJECT_TEMP_DIR}";
- TK_SRCROOT = "${SRCROOT}/../../tk";
- };
- buildToolPath = /bin/bash;
- buildWorkingDirectory = "${SRCROOT}";
- dependencies = (
- );
- isa = PBXLegacyTarget;
- name = Tk;
- passBuildSettingsInEnvironment = 0;
- productName = Tk;
- };
- F9F6B1BE08E8639A00C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- path = Tk.framework;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F9F6B1BF08E863B300C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.application;
- path = Wish.app;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F9F6B1C008E863C200C9CB24 = {
- isa = PBXFileReference;
- lastKnownFileType = "compiled.mach-o.executable";
- path = tktest;
- refType = 3;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- };
- rootObject = F537552A016C352C01DC9062;
-}
diff --git a/macosx/Wish.sdef b/macosx/Wish.sdef
new file mode 100644
index 0000000..26d1ee8
--- /dev/null
+++ b/macosx/Wish.sdef
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
+<!--
+ Copyright (c) 1997 Sun Microsystems, Inc.
+ Copyright 2009 Kevin Walzer/WordTech Communications LLC.
+ Copyright (c) 2009 Daniel A. Steffen <das@users.sourceforge.net>
+
+ See the file "license.terms" for information on usage and redistribution of
+ this file, and for a DISCLAIMER OF ALL WARRANTIES.
+-->
+<dictionary title="Wish Terminology">
+ <suite name="Standard Suite" code="reqd" description="Common commands for all applications.">
+ <command name="open" code="aevtodoc" description="Open a document.">
+ <direct-parameter description="The file(s) to be opened.">
+ <type type="file"/>
+ <type type="file" list="yes"/>
+ </direct-parameter>
+ </command>
+ <command name="print" code="aevtpdoc" description="Print a document.">
+ <direct-parameter description="The file(s) to be printed.">
+ <type type="file" list="yes"/>
+ <type type="specifier"/>
+ </direct-parameter>
+ </command>
+ <command name="quit" code="aevtquit" description="Quit the application."/>
+ </suite>
+ <suite name="Wish Suite" code="WIsH" description="Commands for the Wish application.">
+ <command name="do script" code="miscdosc" description="Execute a Tcl script.">
+ <direct-parameter description="Script to execute" type="text">
+ <type type="text"/>
+ </direct-parameter>
+ <result description="Result">
+ <type type="text"/>
+ </result>
+ </command>
+ </suite>
+</dictionary>
diff --git a/macosx/tkMacOSX.h b/macosx/tkMacOSX.h
index a2a35a5..05ea6c2 100644
--- a/macosx/tkMacOSX.h
+++ b/macosx/tkMacOSX.h
@@ -4,8 +4,8 @@
* Declarations of Macintosh specific exported variables and procedures.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -18,18 +18,16 @@
#include "tk.h"
#endif
-#include <Carbon/Carbon.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_MacOSXEmbedRegisterWinProc) (long winID, Tk_Window window);
+typedef void* (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);
+typedef void (Tk_MacOSXEmbedGetClipProc) (Tk_Window window, TkRegion rgn);
+typedef void (Tk_MacOSXEmbedGetOffsetInParentProc) (Tk_Window window, void *ulCorner);
#include "tkPlatDecls.h"
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index c5b2df9..0c94712 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -4,31 +4,14 @@
* This file handles the implementation of native bitmaps.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkMacOSXInt.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;
+#include "tkMacOSXPrivate.h"
/*
* This structure holds information about native bitmaps.
@@ -36,9 +19,7 @@ typedef struct {
typedef struct {
const char *name; /* Name of icon. */
- long int type; /* Type of icon. */
- int id; /* Id of icon. */
- int size; /* Size of icon. */
+ OSType iconType; /* OSType of icon. */
} BuiltInIcon;
/*
@@ -47,24 +28,42 @@ typedef struct {
*/
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},
- {NULL, 0, 0, 0}
+ {"document", kGenericDocumentIcon},
+ {"stationery", kGenericStationeryIcon},
+ {"edition", kGenericEditionFileIcon},
+ {"application", kGenericApplicationIcon},
+ {"accessory", kGenericDeskAccessoryIcon},
+ {"folder", kGenericFolderIcon},
+ {"pfolder", kPrivateFolderIcon},
+ {"trash", kTrashIcon},
+ {"floppy", kGenericFloppyIcon},
+ {"ramdisk", kGenericRAMDiskIcon},
+ {"cdrom", kGenericCDROMIcon},
+ {"preferences", kGenericPreferencesIcon},
+ {"querydoc", kGenericQueryDocumentIcon},
+ {"stop", kAlertStopIcon},
+ {"note", kAlertNoteIcon},
+ {"caution", kAlertCautionIcon},
+ {NULL}
};
+
+#define builtInIconSize 32
+
+static Tcl_HashTable iconBitmapTable = {};
+typedef struct {
+ int kind, width, height;
+ char *value;
+} IconBitmap;
+
+static const char *const iconBitmapOptionStrings[] = {
+ "-file", "-fileType", "-osType", "-systemType", "-namedImage",
+ "-imageFile", NULL
+};
+enum iconBitmapOptions {
+ ICON_FILE, ICON_FILETYPE, ICON_OSTYPE, ICON_SYSTEMTYPE, ICON_NAMEDIMAGE,
+ ICON_IMAGEFILE,
+};
+
/*
*----------------------------------------------------------------------
@@ -92,22 +91,17 @@ TkpDefineNativeBitmaps(void)
for (builtInPtr = builtInIcons; builtInPtr->name != NULL; builtInPtr++) {
Tcl_HashEntry *predefHashPtr;
- const char * name;
+ Tk_Uid name;
int isNew;
name = Tk_GetUid(builtInPtr->name);
predefHashPtr = Tcl_CreateHashEntry(tablePtr, name, &isNew);
if (isNew) {
- TkPredefBitmap *predefPtr = (TkPredefBitmap *)
- ckalloc(sizeof(TkPredefBitmap));
- NativeIcon *nativeIconPtr = (NativeIcon *)
- ckalloc(sizeof(NativeIcon));
+ TkPredefBitmap *predefPtr = ckalloc(sizeof(TkPredefBitmap));
- nativeIconPtr->id = builtInPtr->id;
- nativeIconPtr->type = builtInPtr->type;
- predefPtr->source = (char *) nativeIconPtr;
- predefPtr->width = builtInPtr->size;
- predefPtr->height = builtInPtr->size;
+ predefPtr->source = UINT2PTR(builtInPtr->iconType);
+ predefPtr->width = builtInIconSize;
+ predefPtr->height = builtInIconSize;
predefPtr->native = 1;
Tcl_SetHashValue(predefHashPtr, predefPtr);
}
@@ -117,17 +111,54 @@ TkpDefineNativeBitmaps(void)
/*
*----------------------------------------------------------------------
*
+ * GetBitmapForIcon --
+ *
+ * Results:
+ * Bitmap for the given IconRef.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Pixmap
+GetBitmapForIcon(
+ Display *display,
+ IconRef icon,
+ CGSize size)
+{
+ TkMacOSXDrawingContext dc;
+ Pixmap pixmap;
+
+ pixmap = Tk_GetPixmap(display, None, size.width, size.height, 0);
+ if (TkMacOSXSetupDrawingContext(pixmap, NULL, 1, &dc)) {
+ if (dc.context) {
+ const CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1,
+ .tx = 0, .ty = size.height };
+ const CGRect r = { .origin = { .x = 0, .y = 0 }, .size = size };
+
+ CGContextConcatCTM(dc.context, t);
+ PlotIconRefInContext(dc.context, &r, kAlignAbsoluteCenter,
+ kTransformNone, NULL, kPlotIconRefNormalFlags, icon);
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+ }
+ return pixmap;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkpCreateNativeBitmap --
*
- * Add native bitmaps.
+ * Create native bitmap.
*
* Results:
- * A standard Tcl result. If an error occurs then TCL_ERROR is
- * returned and a message is left in the interp's result.
+ * Native bitmap.
*
* Side effects:
- * "Name" is entered into the bitmap table and may be used from
- * here on to refer to the given bitmap.
+ * None.
*
*----------------------------------------------------------------------
*/
@@ -135,41 +166,58 @@ TkpDefineNativeBitmaps(void)
Pixmap
TkpCreateNativeBitmap(
Display *display,
- CONST char *source) /* Info about the icon to build. */
+ const void *source) /* Info about the icon to build. */
{
- Pixmap pix;
- Rect destRect;
- CGrafPtr savePort;
- Boolean portChanged;
- const NativeIcon *nativeIconPtr;
-
- pix = Tk_GetPixmap(display, None, 32, 32, 0);
- portChanged = QDSwapPort(TkMacOSXGetDrawablePort(pix), &savePort);
-
- nativeIconPtr = (const NativeIcon *) source;
- SetRect(&destRect, 0, 0, 32, 32);
- if (nativeIconPtr->type == TYPE1) {
- RGBColor white = {0xFFFF, 0xFFFF, 0xFFFF};
+ Pixmap pixmap;
+ IconRef icon;
+ OSErr err;
- RGBForeColor(&white);
- PaintRect(&destRect);
- PlotIconID(&destRect, atAbsoluteCenter, ttNone, nativeIconPtr->id);
- } else if (nativeIconPtr->type == TYPE2) {
- Handle icon = GetIcon(nativeIconPtr->id);
-
- if (icon != NULL) {
- RGBColor black = {0, 0, 0};
-
- RGBForeColor(&black);
- PlotIcon(&destRect, icon);
- ReleaseResource(icon);
- }
+ err = ChkErr(GetIconRef, kOnSystemDisk, kSystemIconsCreator,
+ PTR2UINT(source), &icon);
+ if (err == noErr) {
+ pixmap = GetBitmapForIcon(display, icon, CGSizeMake(builtInIconSize,
+ builtInIconSize));
+ ReleaseIconRef(icon);
+ } else {
+ pixmap = Tk_GetPixmap(display, None, builtInIconSize,
+ builtInIconSize, 0);
}
+ return pixmap;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * OSTypeFromString --
+ *
+ * Helper to convert string to OSType.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * t is set to OSType if conversion successful.
+ *
+ *----------------------------------------------------------------------
+ */
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+static int
+OSTypeFromString(const char *s, OSType *t) {
+ int result = TCL_ERROR;
+ Tcl_DString ds;
+ Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");
+
+ Tcl_UtfToExternalDString(encoding, s, -1, &ds);
+ if (Tcl_DStringLength(&ds) <= 4) {
+ char string[4] = {};
+ memcpy(string, Tcl_DStringValue(&ds), (size_t) Tcl_DStringLength(&ds));
+ *t = (OSType) string[0] << 24 | (OSType) string[1] << 16 |
+ (OSType) string[2] << 8 | (OSType) string[3];
+ result = TCL_OK;
}
- return pix;
+ Tcl_DStringFree(&ds);
+ Tcl_FreeEncoding(encoding);
+ return result;
}
/*
@@ -177,15 +225,19 @@ TkpCreateNativeBitmap(
*
* TkpGetNativeAppBitmap --
*
- * Add native bitmaps.
+ * Get a named native bitmap.
+ *
+ * Attemps to interpret the given name in order as:
+ * - name defined by ::tk::mac::iconBitmap
+ * - NSImage named image name
+ * - NSImage url string
+ * - 4-char OSType of IconServices icon
*
* Results:
- * A standard Tcl result. If an error occurs then TCL_ERROR is
- * returned and a message is left in the interp's result.
+ * Native bitmap or None.
*
* Side effects:
- * "Name" is entered into the bitmap table and may be used from
- * here on to refer to the given bitmap.
+ * None.
*
*----------------------------------------------------------------------
*/
@@ -193,78 +245,211 @@ TkpCreateNativeBitmap(
Pixmap
TkpGetNativeAppBitmap(
Display *display, /* The display. */
- CONST char *name, /* The name of the bitmap. */
+ const char *name, /* The name of the bitmap. */
int *width, /* The width & height of the bitmap. */
int *height)
{
- Pixmap pix;
- CGrafPtr savePort;
- Boolean portChanged;
- Rect destRect;
- Handle resource;
- int type = -1, destWrote;
- Str255 nativeName;
- Tcl_Encoding encoding;
-
- /*
- * macRoman is the encoding that the resource fork uses.
- */
+ Tcl_HashEntry *hPtr;
+ Pixmap pixmap = None;
+ NSString *string;
+ NSImage *image = nil;
+ NSSize size = { .width = builtInIconSize, .height = builtInIconSize };
- encoding = Tcl_GetEncoding(NULL, "macRoman");
- Tcl_UtfToExternal(NULL, encoding, name, strlen(name), 0, NULL,
- (char *) &nativeName[1], 255, NULL, &destWrote, NULL);
- nativeName[0] = destWrote;
- Tcl_FreeEncoding(encoding);
-
- resource = GetNamedResource('cicn', nativeName);
- if (resource != NULL) {
- type = TYPE3;
+ if (iconBitmapTable.buckets &&
+ (hPtr = Tcl_FindHashEntry(&iconBitmapTable, name))) {
+ OSType type;
+ IconBitmap *iconBitmap = Tcl_GetHashValue(hPtr);
+ name = NULL;
+ size = NSMakeSize(iconBitmap->width, iconBitmap->height);
+ switch (iconBitmap->kind) {
+ case ICON_FILE:
+ string = [[NSString stringWithUTF8String:iconBitmap->value]
+ stringByExpandingTildeInPath];
+ image = [[NSWorkspace sharedWorkspace] iconForFile:string];
+ break;
+ case ICON_FILETYPE:
+ string = [NSString stringWithUTF8String:iconBitmap->value];
+ image = [[NSWorkspace sharedWorkspace] iconForFileType:string];
+ break;
+ case ICON_OSTYPE:
+ if (OSTypeFromString(iconBitmap->value, &type) == TCL_OK) {
+ string = NSFileTypeForHFSTypeCode(type);
+ image = [[NSWorkspace sharedWorkspace] iconForFileType:string];
+ }
+ break;
+ case ICON_SYSTEMTYPE:
+ name = iconBitmap->value;
+ break;
+ case ICON_NAMEDIMAGE:
+ string = [NSString stringWithUTF8String:iconBitmap->value];
+ image = [NSImage imageNamed:string];
+ break;
+ case ICON_IMAGEFILE:
+ string = [[NSString stringWithUTF8String:iconBitmap->value]
+ stringByExpandingTildeInPath];
+ image = [[[NSImage alloc] initWithContentsOfFile:string]
+ autorelease];
+ break;
+ }
+ if (image) {
+ [image setSize:size];
+ }
} else {
- resource = GetNamedResource('ICON', nativeName);
- if (resource != NULL) {
- type = TYPE2;
+ string = [NSString stringWithUTF8String:name];
+ image = [NSImage imageNamed:string];
+ if (!image) {
+ NSURL *url = [NSURL URLWithString:string];
+ if (url) {
+ image = [[[NSImage alloc] initWithContentsOfURL:url]
+ autorelease];
+ }
+ }
+ if (image) {
+ size = [image size];
}
}
+ if (image) {
+ TkMacOSXDrawingContext dc;
+ int depth = 0;
- if (resource == NULL) {
- return (Pixmap) NULL;
- }
-
- pix = Tk_GetPixmap(display, None, 32, 32, 0);
- portChanged = QDSwapPort(TkMacOSXGetDrawablePort(pix), &savePort);
-
- SetRect(&destRect, 0, 0, 32, 32);
- if (type == TYPE2) {
- RGBColor black = {0, 0, 0};
+#ifdef MAC_OSX_TK_TODO
+ for (NSImageRep *r in [image representations]) {
+ NSInteger bitsPerSample = [r bitsPerSample];
+ if (bitsPerSample && bitsPerSample > depth) {
+ depth = bitsPerSample;
+ };
+ }
+ if (depth == 1) {
+ /* TODO: convert BW NSImage to CGImageMask */
+ }
+#endif
+ pixmap = Tk_GetPixmap(display, None, size.width, size.height, depth);
+ *width = size.width;
+ *height = size.height;
+ if (TkMacOSXSetupDrawingContext(pixmap, NULL, 1, &dc)) {
+ if (dc.context) {
+ CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1,
+ .tx = 0, .ty = size.height};
- RGBForeColor(&black);
- PlotIcon(&destRect, resource);
- ReleaseResource(resource);
- } else if (type == TYPE3) {
- RGBColor white = {0xFFFF, 0xFFFF, 0xFFFF};
- short id;
- ResType theType;
- Str255 dummy;
+ CGContextConcatCTM(dc.context, t);
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:dc.context flipped:NO]];
+ [image drawAtPoint:NSZeroPoint fromRect:NSZeroRect
+ operation:NSCompositeCopy fraction:1.0];
+ [NSGraphicsContext restoreGraphicsState];
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+ }
+ } else if (name) {
+ OSType iconType;
+ if (OSTypeFromString(name, &iconType) == TCL_OK) {
+ IconRef icon;
+ OSErr err = ChkErr(GetIconRef, kOnSystemDisk, kSystemIconsCreator,
+ iconType, &icon);
+ if (err == noErr) {
+ pixmap = GetBitmapForIcon(display, icon, NSSizeToCGSize(size));
+ *width = size.width;
+ *height = size.height;
+ ReleaseIconRef(icon);
+ }
+ }
+ }
+ return pixmap;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXIconBitmapObjCmd --
+ *
+ * Implements the ::tk::mac::iconBitmap command.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * none
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * 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.
- */
+int
+TkMacOSXIconBitmapObjCmd(
+ ClientData clientData, /* Unused. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
+{
+ Tcl_HashEntry *hPtr;
+ int i = 1, len, isNew, result = TCL_ERROR;
+ const char *name, *value;
+ IconBitmap ib, *iconBitmap;
- RGBForeColor(&white);
- PaintRect(&destRect);
- GetResInfo(resource, &id, &theType, dummy);
- ReleaseResource(resource);
- resource = (Handle) GetCIcon(id);
- PlotCIcon(&destRect, (CIconHandle) resource);
- DisposeCIcon((CIconHandle) resource);
+ if (objc != 6) {
+ Tcl_WrongNumArgs(interp, 1, objv, "name width height "
+ "-file|-fileType|-osType|-systemType|-namedImage|-imageFile "
+ "value");
+ goto end;
}
-
- *width = 32;
- *height = 32;
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ name = Tcl_GetStringFromObj(objv[i++], &len);
+ if (!len) {
+ Tcl_AppendResult(interp, "empty bitmap name", NULL);
+ goto end;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[i++], &ib.width) != TCL_OK) {
+ goto end;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[i++], &ib.height) != TCL_OK) {
+ goto end;
+ }
+ if (Tcl_GetIndexFromObj(interp, objv[i++], iconBitmapOptionStrings,
+ "kind", TCL_EXACT, &ib.kind) != TCL_OK) {
+ goto end;
+ }
+ value = Tcl_GetStringFromObj(objv[i++], &len);
+ if (!len) {
+ Tcl_AppendResult(interp, "empty bitmap value", NULL);
+ goto end;
+ }
+#if 0
+ if ((kind == ICON_TYPE || kind == ICON_SYSTEM)) {
+ Tcl_DString ds;
+ Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");
+ Tcl_UtfToExternalDString(encoding, value, -1, &ds);
+ len = Tcl_DStringLength(&ds);
+ Tcl_DStringFree(&ds);
+ Tcl_FreeEncoding(encoding);
+ if (len > 4) {
+ Tcl_AppendResult(interp, "invalid bitmap value", NULL);
+ goto end;
+ }
}
- return pix;
+#endif
+ ib.value = ckalloc(len + 1);
+ strcpy(ib.value, value);
+ if (!iconBitmapTable.buckets) {
+ Tcl_InitHashTable(&iconBitmapTable, TCL_STRING_KEYS);
+ }
+ hPtr = Tcl_CreateHashEntry(&iconBitmapTable, name, &isNew);
+ if (!isNew) {
+ iconBitmap = Tcl_GetHashValue(hPtr);
+ ckfree(iconBitmap->value);
+ } else {
+ iconBitmap = ckalloc(sizeof(IconBitmap));
+ Tcl_SetHashValue(hPtr, iconBitmap);
+ }
+ *iconBitmap = ib;
+ result = TCL_OK;
+end:
+ return result;
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 184380f..8eb3a1f 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -5,8 +5,8 @@
* button widgets.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -17,110 +17,72 @@
#include "tkMacOSXFont.h"
#include "tkMacOSXDebug.h"
-#define DEFAULT_USE_TK_TEXT 0
-
-#define CONTROL_INITIALIZED 1
-#define FIRST_DRAW 2
-#define ACTIVE 4
-
-#define MAX_VALUE 2
-
/*
- * Default insets for controls
- */
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_BUTTON
+#endif
+*/
-#define DEF_INSET_LEFT 2
-#define DEF_INSET_RIGHT 2
-#define DEF_INSET_TOP 2
-#define DEF_INSET_BOTTOM 4
+typedef struct MacButton {
+ TkButton info;
+ NSButton *button;
+ NSImage *image, *selectImage, *tristateImage;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ int fix;
+#endif
+} MacButton;
-/*
- * Some defines used to control what type of control is drawn.
- */
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
-#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
+int tkMacOSXUseCompatibilityMetrics = 1;
/*
- * Declaration of Mac specific button structure.
+ * Use the following heuristic conversion constants to make NSButton-based
+ * widget metrics match up with the old Carbon control buttons (for the
+ * default Lucida Grande 13 font).
*/
-typedef struct {
- SInt16 initialValue;
- SInt16 minValue;
- SInt16 maxValue;
- SInt16 procID;
- int isBevel;
-} MacControlParams;
+#define NATIVE_BUTTON_INSET 2
+#define NATIVE_BUTTON_EXTRA_H 2
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;
- unsigned long 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.
- */
- ControlButtonContentInfo bevelButtonContent;
- OpenCPicParams picParams;
-} MacButton;
+ int trimW, trimH, inset, shrinkH, offsetX, offsetY;
+} BoundsFix;
+
+#define fixForTypeStyle(type, style) ( \
+ type == NSSwitchButton ? 0 : \
+ type == NSRadioButton ? 1 : \
+ style == NSRoundedBezelStyle ? 2 : \
+ style == NSRegularSquareBezelStyle ? 3 : \
+ style == NSShadowlessSquareBezelStyle ? 4 : \
+ INT_MIN)
+
+static const BoundsFix boundsFixes[] = {
+ [fixForTypeStyle(NSSwitchButton,0)] = { 2, 2, -1, 0, 2, 1 },
+ [fixForTypeStyle(NSRadioButton,0)] = { 0, 2, -1, 0, 1, 1 },
+ [fixForTypeStyle(0,NSRoundedBezelStyle)] = { 28, 16, -6, 0, 0, 3 },
+ [fixForTypeStyle(0,NSRegularSquareBezelStyle)] = { 28, 15, -2, -1 },
+ [fixForTypeStyle(0,NSShadowlessSquareBezelStyle)] = { 2, 2 },
+};
-/*
- * Forward declarations for procedures defined later in this file:
- */
+#endif
-static OSStatus SetUserPaneDrawProc(ControlRef control,
- ControlUserPaneDrawProcPtr upp);
-static OSStatus SetUserPaneSetUpSpecialBackgroundProc(ControlRef control,
- ControlUserPaneBackgroundProcPtr upp);
-static void UserPaneDraw(ControlRef control, ControlPartCode cpc);
-static void UserPaneBackgroundProc(ControlHandle,
- ControlBackgroundPtr info);
-
-static void ButtonEventProc(ClientData clientData, XEvent *eventPtr);
-static int UpdateControlColors(MacButton *mbPtr);
-static void TkMacOSXComputeControlParams(TkButton *butPtr,
- MacControlParams *paramsPtr);
-static int TkMacOSXComputeDrawParams(TkButton *butPtr, DrawParams *dpPtr);
-static void TkMacOSXDrawControl(MacButton *butPtr, GWorldPtr destPort, GC gc,
- Pixmap pixmap);
-static void SetupBevelButton(MacButton *butPtr, ControlRef controlHandle,
- GWorldPtr destPort, GC gc, Pixmap pixmap);
+static void DisplayNativeButton(TkButton *butPtr);
+static void ComputeNativeButtonGeometry(TkButton *butPtr);
+static void DisplayUnixButton(TkButton *butPtr);
+static void ComputeUnixButtonGeometry(TkButton *butPtr);
/*
* The class procedure table for the button widgets.
*/
-Tk_ClassProcs tkpButtonProcs = {
+const Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
-static int bCount;
-
/*
*----------------------------------------------------------------------
@@ -142,22 +104,42 @@ TkButton *
TkpCreateButton(
Tk_Window tkwin)
{
- MacButton *macButtonPtr = (MacButton *) ckalloc(sizeof(MacButton));
-
- Tk_CreateEventHandler(tkwin, ActivateMask,
- ButtonEventProc, (ClientData) macButtonPtr);
- macButtonPtr->id = bCount++;
- macButtonPtr->usingControl = 0;
- macButtonPtr->flags = 0;
- macButtonPtr->userPaneBackground = PIXEL_MAGIC << 24;
- macButtonPtr->userPane = NULL;
- macButtonPtr->control = NULL;
- macButtonPtr->controlTitle[0] = 0;
- macButtonPtr->controlTitle[1] = 0;
- bzero(&macButtonPtr->params, sizeof(macButtonPtr->params));
- bzero(&macButtonPtr->fontStyle, sizeof(macButtonPtr->fontStyle));
-
- return (TkButton *)macButtonPtr;
+ MacButton *macButtonPtr = ckalloc(sizeof(MacButton));
+
+ macButtonPtr->button = nil;
+ macButtonPtr->image = nil;
+ macButtonPtr->selectImage = nil;
+ macButtonPtr->tristateImage = nil;
+
+ return (TkButton *) macButtonPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyButton --
+ *
+ * Free data structures associated with the button control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Restores the default control state.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyButton(
+ TkButton *butPtr)
+{
+ MacButton *macButtonPtr = (MacButton *) butPtr;
+
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->button);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->selectImage);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->selectImage);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->tristateImage);
}
/*
@@ -182,313 +164,22 @@ void
TkpDisplayButton(
ClientData clientData) /* Information about widget. */
{
- MacButton *macButtonPtr = (MacButton *) clientData;
TkButton *butPtr = (TkButton *) clientData;
- Tk_Window tkwin = butPtr->tkwin;
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- Pixmap pixmap;
- int width, height, fullWidth, fullHeight, textXOffset, textYOffset;
- int borderWidth, wasUsingControl;
- int haveImage = 0, haveText = 0, imageWidth = 0, imageHeight = 0;
- int imageXOffset = 0, imageYOffset = 0; /* image information that will
- * be used to restrict disabled
- * pixmap as well */
- DrawParams drawParams, *dpPtr = &drawParams;
butPtr->flags &= ~REDRAW_PENDING;
- if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ if (!butPtr->tkwin || !Tk_IsMapped(butPtr->tkwin)) {
return;
}
- pixmap = (Pixmap) Tk_WindowId(tkwin);
- wasUsingControl = macButtonPtr->usingControl;
-
- if (TkMacOSXComputeDrawParams(butPtr, &drawParams) ) {
- macButtonPtr->usingControl = 1;
- if (butPtr->type == TYPE_BUTTON) {
- macButtonPtr->useTkText = 0;
- } else {
- macButtonPtr->useTkText = 1;
- }
- } else {
- macButtonPtr->usingControl = 0;
- macButtonPtr->useTkText = 1;
- }
-
- /*
- * 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);
- }
- }
-
- /*
- * Set up clipping region. Make sure the we are using the port
- * for this button, or we will set the wrong window's clip.
- */
-
- destPort = TkMacOSXGetDrawablePort(pixmap);
- portChanged = QDSwapPort(destPort, &savePort);
- TkMacOSXSetUpClippingRgn(pixmap);
-
- /*
- * 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;
- 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) {
- goto applyStipple;
- }
-
- 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;
- }
- imageWidth = width;
- imageHeight = height;
-
- haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
- if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
- int x, y;
-
- 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;
- }
- imageXOffset += x;
- imageYOffset += y;
- if (butPtr->image != NULL) {
- if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
- Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- } else if ((butPtr->tristateImage != NULL) &&
- (butPtr->flags & TRISTATED)) {
- Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- } else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- }
- } else {
- XSetClipOrigin(butPtr->display, dpPtr->gc, imageXOffset,
- imageYOffset);
- XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
- 0, 0, width, height, imageXOffset, 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) {
- int x = 0, y;
-
- 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;
- }
- imageXOffset += x;
- imageYOffset += y;
- if (butPtr->image != NULL) {
- if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
- Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- } else if ((butPtr->tristateImage != NULL) &&
- (butPtr->flags & TRISTATED)) {
- Tk_RedrawImage(butPtr->tristateImage, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- } else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height,
- pixmap, imageXOffset, imageYOffset);
- }
- } else {
- XSetClipOrigin(butPtr->display, dpPtr->gc, x, y);
- XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
- 0, 0, width, height, x, y, 1);
- XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
- }
- y += height/2;
- } else if (macButtonPtr->useTkText) {
- int x = 0, y;
-
- TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
- butPtr->indicatorSpace + butPtr->textWidth,
- butPtr->textHeight, &x, &y);
- x += butPtr->indicatorSpace;
- Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc,
- butPtr->textLayout, x, y, 0, -1);
- }
-
- /*
- * 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 so the stippling is the right color.
- */
-
- applyStipple:
- 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->stippleGC,
- Tk_3DBorderColor(butPtr->selectBorder)->pixel);
- }
-
- /*
- * Stipple the whole button if no disabledFg was specified,
- * otherwise restrict stippling only to displayed image
- */
-
- if (butPtr->disabledFg == NULL) {
- XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC,
- 0, 0, (unsigned) Tk_Width(tkwin),
- (unsigned) Tk_Height(tkwin));
- } else {
- XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC,
- imageXOffset, imageYOffset,
- (unsigned) imageWidth, (unsigned) imageHeight);
- }
- if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
- && (butPtr->selectBorder != NULL)) {
- XSetForeground(butPtr->display, butPtr->stippleGC,
- 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,
- borderWidth, dpPtr->relief);
- }
- }
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ switch (butPtr->type) {
+ case TYPE_LABEL:
+ DisplayUnixButton(butPtr);
+ break;
+ case TYPE_BUTTON:
+ case TYPE_CHECK_BUTTON:
+ case TYPE_RADIO_BUTTON:
+ DisplayNativeButton(butPtr);
+ break;
}
}
@@ -512,890 +203,817 @@ TkpDisplayButton(
void
TkpComputeButtonGeometry(
- TkButton *butPtr) /* Button whose geometry may have changed. */
+ register TkButton *butPtr) /* Button whose geometry may have changed. */
{
- int width, height, avgWidth, haveImage = 0, haveText = 0;
- int xInset, yInset, 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;
- }
+ MacButton *macButtonPtr = (MacButton *) butPtr;
- 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);
+ switch (butPtr->type) {
+ case TYPE_LABEL:
+ if (macButtonPtr->button && [macButtonPtr->button superview]) {
+ [macButtonPtr->button removeFromSuperviewWithoutNeedingDisplay];
}
- } else if (butPtr->type == TYPE_LABEL) {
- butPtr->inset = butPtr->borderWidth;
- } else 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;
+ ComputeUnixButtonGeometry(butPtr);
+ break;
+ case TYPE_BUTTON:
+ case TYPE_CHECK_BUTTON:
+ case TYPE_RADIO_BUTTON:
+ if (!macButtonPtr->button) {
+ NSButton *button = [[NSButton alloc] initWithFrame:NSZeroRect];
+ macButtonPtr->button = TkMacOSXMakeUncollectable(button);
}
+ ComputeNativeButtonGeometry(butPtr);
+ break;
}
-
- 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 --
+ * TkpButtonSetDefaults --
*
- * Free data structures associated with the button control.
+ * This procedure is invoked before option tables are created for
+ * buttons. It modifies some of the default values to match the current
+ * values defined for this platform.
*
* Results:
- * None.
+ * Some of the default values in *specPtr are modified.
*
* Side effects:
- * Restores the default control state.
+ * Updates some of.
*
*----------------------------------------------------------------------
*/
void
-TkpDestroyButton(
- TkButton *butPtr)
+TkpButtonSetDefaults()
{
- MacButton *mbPtr = (MacButton *) butPtr; /* Mac button. */
-
- if (mbPtr->userPane) {
- DisposeControl(mbPtr->userPane);
- mbPtr->userPane = NULL;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (!tkMacOSXUseCompatibilityMetrics) {
+ strcpy(tkDefButtonHighlightWidth, DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM);
+ strcpy(tkDefLabelHighlightWidth, DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM);
+ strcpy(tkDefButtonPadx, DEF_BUTTON_PADX_NOCM);
+ strcpy(tkDefLabelPadx, DEF_BUTTON_PADX_NOCM);
+ strcpy(tkDefButtonPady, DEF_BUTTON_PADY_NOCM);
+ strcpy(tkDefLabelPady, DEF_BUTTON_PADY_NOCM);
}
+#endif
}
+
+#pragma mark -
+#pragma mark Native Buttons:
+
/*
*----------------------------------------------------------------------
*
- * TkMacOSXInitControl --
+ * DisplayNativeButton --
*
- * This procedure initialises a Carbon control.
+ * This procedure is invoked to display a button widget. It is
+ * normally invoked as an idle handler.
*
* Results:
- * 0 on success, 1 on failure.
+ * None.
*
* 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
+ * Commands are output to X to display the button in its
+ * current mode. The REDRAW_PENDING flag is cleared.
*
*----------------------------------------------------------------------
*/
-static int
-TkMacOSXInitControl(
- MacButton *mbPtr, /* Mac button. */
- GWorldPtr destPort,
- GC gc,
- Pixmap pixmap,
- Rect *paneRect,
- Rect *cntrRect)
+static void
+DisplayNativeButton(
+ TkButton *butPtr)
{
- TkButton *butPtr = (TkButton *) mbPtr;
- ControlRef rootControl;
- SInt16 procID, initialValue, minValue, maxValue;
- Boolean initiallyVisible;
- SInt32 controlReference;
-
- rootControl = TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
- mbPtr->windowRef = TkMacOSXDrawableWindow(Tk_WindowId(butPtr->tkwin));
+ MacButton *macButtonPtr = (MacButton *) butPtr;
+ NSButton *button = macButtonPtr->button;
+ Tk_Window tkwin = butPtr->tkwin;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+ TkMacOSXDrawingContext dc;
+ NSView *view = TkMacOSXDrawableView(macWin);
+ CGFloat viewHeight = [view bounds].size.height;
+ CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
+ .ty = viewHeight};
+ NSRect frame;
+ int enabled;
+ NSCellStateValue state;
+
+ if (!view ||
+ !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) {
+ return;
+ }
+ CGContextConcatCTM(dc.context, t);
/*
- * Set up the user pane.
+ * We cannot change the background color of the button itself, only the
+ * color of the background of its container.
+ * 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.
*/
- 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) {
- TkMacOSXDbgMsg("Failed to create user pane control");
- return 1;
+ Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, butPtr->type == TYPE_BUTTON ?
+ butPtr->highlightBorder : butPtr->normalBorder, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ if ([button superview] != view) {
+ [view addSubview:button];
}
- if (ChkErr(EmbedControl, mbPtr->userPane,rootControl) != noErr) {
- return 1;
+ if (macButtonPtr->tristateImage) {
+ NSImage *selectImage = macButtonPtr->selectImage ?
+ macButtonPtr->selectImage : macButtonPtr->image;
+ [button setImage:(butPtr->flags & TRISTATED ?
+ selectImage : macButtonPtr->image)];
+ [button setAlternateImage:(butPtr->flags & TRISTATED ?
+ macButtonPtr->tristateImage : selectImage)];
}
-
- 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) {
- TkMacOSXDbgMsg("Failed to create control of type %d\n", procID);
- return 1;
+ if (butPtr->flags & SELECTED) {
+ state = NSOnState;
+ } else if (butPtr->flags & TRISTATED) {
+ state = NSMixedState;
+ } else {
+ state = NSOffState;
}
- if (ChkErr(EmbedControl, mbPtr->control,mbPtr->userPane) != noErr ) {
- return 1;
+ [button setState:state];
+ enabled = !(butPtr->state == STATE_DISABLED);
+ [button setEnabled:enabled];
+ if (enabled) {
+ //[button highlight:(butPtr->state == STATE_ACTIVE)];
+ //[cell setHighlighted:(butPtr->state == STATE_ACTIVE)];
}
-
- mbPtr->flags |= (CONTROL_INITIALIZED | FIRST_DRAW);
- if (IsWindowActive(mbPtr->windowRef)) {
- mbPtr->flags |= ACTIVE;
+ if (butPtr->type == TYPE_BUTTON && butPtr->defaultState == STATE_ACTIVE) {
+ //[[view window] setDefaultButtonCell:cell];
+ [button setKeyEquivalent:@"\r"];
+ } else {
+ [button setKeyEquivalent:@""];
+ }
+ frame = NSMakeRect(macWin->xOff, macWin->yOff, Tk_Width(tkwin),
+ Tk_Height(tkwin));
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ BoundsFix boundsFix = boundsFixes[macButtonPtr->fix];
+ frame = NSOffsetRect(frame, boundsFix.offsetX, boundsFix.offsetY);
+ frame.size.height -= boundsFix.shrinkH + NATIVE_BUTTON_EXTRA_H;
+ frame = NSInsetRect(frame, boundsFix.inset + NATIVE_BUTTON_INSET,
+ boundsFix.inset + NATIVE_BUTTON_INSET);
+ }
+#endif
+ frame.origin.y = viewHeight - (frame.origin.y + frame.size.height);
+ if (!NSEqualRects(frame, [button frame])) {
+ [button setFrame:frame];
}
- return 0;
+ [button displayRectIgnoringOpacity:[button bounds]];
+ TkMacOSXRestoreDrawingContext(&dc);
+#ifdef TK_MAC_DEBUG_BUTTON
+ TKLog(@"button %s frame %@ width %d height %d",
+ ((TkWindow *)butPtr->tkwin)->pathName, NSStringFromRect(frame),
+ Tk_Width(tkwin), Tk_Height(tkwin));
+#endif
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
- * TkMacOSXDrawControl --
+ * ComputeNativeButtonGeometry --
*
- * This function draws the tk button using Mac controls
- * In addition, this code may apply custom colors passed
- * in the TkButton.
+ * 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 control is created, or reinitialised as needed.
+ * The button's window may change size.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
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 */
+ComputeNativeButtonGeometry(
+ TkButton *butPtr) /* Button whose geometry may have changed. */
{
- TkButton *butPtr = (TkButton *) mbPtr;
- TkWindow *winPtr;
- Rect paneRect, cntrRect;
- int active, enabled;
- int rebuild;
-
- 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;
+ MacButton *macButtonPtr = (MacButton *) butPtr;
+ NSButton *button = macButtonPtr->button;
+ NSButtonCell *cell = [button cell];
+ NSButtonType type = -1;
+ NSBezelStyle style = 0;
+ NSInteger highlightsBy = 0, showsStateBy = 0;
+ NSFont *font;
+ NSRect bounds = NSZeroRect, titleRect = NSZeroRect;
+ int haveImage = (butPtr->image || butPtr->bitmap != None), haveText = 0;
+ int haveCompound = (butPtr->compound != COMPOUND_NONE);
+ int width, height, border = 0;
-/*
- 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
- */
-#ifdef TK_REBUILD_TOPLEVEL
- rebuild = (winPtr->flags & TK_REBUILD_TOPLEVEL);
- winPtr->flags &= ~TK_REBUILD_TOPLEVEL;
-#else
- rebuild = 0;
+ butPtr->indicatorSpace = 0;
+ butPtr->inset = 0;
+ if (butPtr->highlightWidth < 0) {
+ butPtr->highlightWidth = 0;
+ }
+ switch (butPtr->type) {
+ case TYPE_BUTTON:
+ type = NSMomentaryPushInButton;
+ if (!haveImage) {
+ style = NSRoundedBezelStyle;
+ butPtr->inset = butPtr->defaultState != STATE_DISABLED ?
+ butPtr->highlightWidth : 0;
+ [button setImage:nil];
+ [button setImagePosition:NSNoImage];
+ } else {
+ style = NSShadowlessSquareBezelStyle;
+ highlightsBy = butPtr->selectImage || butPtr->bitmap ?
+ NSContentsCellMask : 0;
+ border = butPtr->borderWidth;
+ }
+ break;
+ case TYPE_RADIO_BUTTON:
+ case TYPE_CHECK_BUTTON:
+ if (!haveImage /*|| butPtr->indicatorOn*/) { // TODO: indicatorOn
+ type = butPtr->type == TYPE_RADIO_BUTTON ?
+ NSRadioButton : NSSwitchButton;
+ butPtr->inset = /*butPtr->indicatorOn ? 0 :*/ butPtr->borderWidth;
+ } else {
+ type = NSPushOnPushOffButton;
+ style = NSShadowlessSquareBezelStyle;
+ highlightsBy = butPtr->selectImage || butPtr->bitmap ?
+ NSContentsCellMask : 0;
+ showsStateBy = butPtr->selectImage || butPtr->tristateImage ?
+ NSContentsCellMask : 0;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ border = butPtr->borderWidth > 1 ? butPtr->borderWidth - 1 : 1;
+ } else
#endif
- if (mbPtr->flags) {
- MacControlParams params;
-
- TkMacOSXComputeControlParams(butPtr, &params);
- if (rebuild || 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;
+ {
+ border = butPtr->borderWidth;
}
- mbPtr->flags = 0;
}
+ break;
}
- if (!(mbPtr->flags & CONTROL_INITIALIZED)) {
- if (TkMacOSXInitControl(mbPtr, destPort, gc, pixmap, &paneRect,
- &cntrRect)) {
- return;
+ [button setButtonType:type];
+ if (style) {
+ [button setBezelStyle:style];
+ }
+ if (highlightsBy) {
+ [cell setHighlightsBy:highlightsBy|[cell highlightsBy]];
+ }
+ if (showsStateBy) {
+ [cell setShowsStateBy:showsStateBy|[cell showsStateBy]];
+ }
+#if 0
+ if (style == NSShadowlessSquareBezelStyle) {
+ NSControlSize controlSize = NSRegularControlSize;
+
+ if (butPtr->borderWidth <= 2) {
+ controlSize = NSMiniControlSize;
+ } else if (butPtr->borderWidth == 3) {
+ controlSize = NSSmallControlSize;
}
+ [cell setControlSize:controlSize];
}
- SetControlBounds(mbPtr->userPane, &paneRect);
- SetControlBounds(mbPtr->control, &cntrRect);
+#endif
+ [button setAllowsMixedState:YES];
- if (!mbPtr->useTkText) {
- Str255 controlTitle;
- ControlFontStyleRec fontStyle;
- Tk_Font font;
+ if (!haveImage || haveCompound) {
int len;
+ char *text = Tcl_GetStringFromObj(butPtr->textPtr, &len);
- if (((mbPtr->info.image == NULL) && (mbPtr->info.bitmap == None))
- || (mbPtr->info.compound != COMPOUND_NONE)) {
- len = TkFontGetFirstTextLayout(butPtr->textLayout,
- &font, (char*) controlTitle);
- controlTitle[len] = 0;
- } else {
- len = 0;
- controlTitle[0] = 0;
- }
- if (rebuild || bcmp(mbPtr->controlTitle, controlTitle, len+1)) {
- CFStringRef cf = CFStringCreateWithCString(NULL,
- (char*) 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)) ) {
- ChkErr(SetControlFontStyle, mbPtr->control, &fontStyle);
- bcopy(&fontStyle, &mbPtr->fontStyle, sizeof(fontStyle));
- }
+ NSString *title = [[NSString alloc] initWithBytes:text length:len
+ encoding:NSUTF8StringEncoding];
+ [button setTitle:title];
+ [title release];
+ haveText = 1;
}
}
- if (mbPtr->params.isBevel) {
- /*
- * Initialiase the image/button parameters.
- */
-
- SetupBevelButton(mbPtr, mbPtr->control, destPort, gc, pixmap);
- }
+ haveCompound = (haveCompound && haveImage && haveText);
+ if (haveText) {
+ NSTextAlignment alignment = NSNaturalTextAlignment;
- if (butPtr->flags & SELECTED) {
- SetControlValue(mbPtr->control, 1);
- } else if (butPtr->flags & TRISTATED) {
- SetControlValue(mbPtr->control, 2);
+ switch (butPtr->justify) {
+ case TK_JUSTIFY_LEFT:
+ alignment = NSLeftTextAlignment;
+ break;
+ case TK_JUSTIFY_RIGHT:
+ alignment = NSRightTextAlignment;
+ break;
+ case TK_JUSTIFY_CENTER:
+ alignment = NSCenterTextAlignment;
+ break;
+ }
+ [button setAlignment:alignment];
} else {
- SetControlValue(mbPtr->control, 0);
+ [button setTitle:@""];
}
-
- active = ((mbPtr->flags & ACTIVE) != 0);
- if (active != IsControlActive(mbPtr->control)) {
- if (active) {
- ChkErr(ActivateControl, mbPtr->control);
- } else {
- ChkErr(DeactivateControl, mbPtr->control);
- }
+ font = TkMacOSXNSFontForFont(butPtr->tkfont);
+ if (font) {
+ [button setFont:font];
}
- enabled = !(butPtr->state == STATE_DISABLED);
- if (enabled != IsControlEnabled(mbPtr->control)) {
- if (enabled) {
- ChkErr(EnableControl, mbPtr->control);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->image);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->selectImage);
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->tristateImage);
+ if (haveImage) {
+ int width, height;
+ NSImage *image, *selectImage = nil, *tristateImage = nil;
+ NSCellImagePosition pos = NSImageOnly;
+
+ if (butPtr->image) {
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ image = TkMacOSXGetNSImageWithTkImage(butPtr->display,
+ butPtr->image, width, height);
+ if (butPtr->selectImage) {
+ selectImage = TkMacOSXGetNSImageWithTkImage(butPtr->display,
+ butPtr->selectImage, width, height);
+ }
+ if (butPtr->tristateImage) {
+ tristateImage = TkMacOSXGetNSImageWithTkImage(butPtr->display,
+ butPtr->tristateImage, width, height);
+ }
} else {
- ChkErr(DisableControl, mbPtr->control);
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ image = TkMacOSXGetNSImageWithBitmap(butPtr->display,
+ butPtr->bitmap, butPtr->normalTextGC, width, height);
+ selectImage = TkMacOSXGetNSImageWithBitmap(butPtr->display,
+ butPtr->bitmap, butPtr->activeTextGC, width, height);
}
- }
- if (active && enabled) {
- 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;
- }
+ [button setImage:image];
+ if (selectImage) {
+ [button setAlternateImage:selectImage];
+ }
+ if (tristateImage) {
+ macButtonPtr->image = TkMacOSXMakeUncollectableAndRetain(image);
+ if (selectImage) {
+ macButtonPtr->selectImage =
+ TkMacOSXMakeUncollectableAndRetain(selectImage);
+ }
+ macButtonPtr->tristateImage =
+ TkMacOSXMakeUncollectableAndRetain(tristateImage);
+ }
+ if (haveCompound) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ pos = NSImageAbove;
+ break;
+ case COMPOUND_BOTTOM:
+ pos = NSImageBelow;
+ break;
+ case COMPOUND_LEFT:
+ pos = NSImageLeft;
+ break;
+ case COMPOUND_RIGHT:
+ pos = NSImageRight;
+ break;
+ case COMPOUND_CENTER:
+ pos = NSImageOverlaps;
+ break;
+ case COMPOUND_NONE:
+ pos = NSImageOnly;
+ break;
}
- } else {
- HiliteControl(mbPtr->control, kControlNoPart);
}
+ [button setImagePosition:pos];
}
- UpdateControlColors(mbPtr);
- if (butPtr->type == TYPE_BUTTON && !mbPtr->params.isBevel) {
- Boolean isDefault;
-
- if (butPtr->defaultState == STATE_ACTIVE) {
- isDefault = true;
- } else {
- isDefault = false;
+ bounds.size = [cell cellSize];
+ if (haveText) {
+ titleRect = [cell titleRectForBounds:bounds];
+ if (butPtr->wrapLength > 0 &&
+ titleRect.size.width > butPtr->wrapLength) {
+ if (style == NSRoundedBezelStyle) {
+ [button setBezelStyle:(style = NSRegularSquareBezelStyle)];
+ bounds.size = [cell cellSize];
+ titleRect = [cell titleRectForBounds:bounds];
+ }
+ bounds.size.width -= titleRect.size.width - butPtr->wrapLength;
+ bounds.size.height = 40000.0;
+ [cell setWraps:YES];
+ bounds.size = [cell cellSizeForBounds:bounds];
+#ifdef TK_MAC_DEBUG_BUTTON
+ titleRect = [cell titleRectForBounds:bounds];
+#endif
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ bounds.size.height += 3;
+ }
+#endif
}
- ChkErr(SetControlData, mbPtr->control, kControlNoPart,
- kControlPushButtonDefaultTag, sizeof(isDefault), &isDefault);
}
+ width = lround(bounds.size.width);
+ height = lround(bounds.size.height);
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ macButtonPtr->fix = fixForTypeStyle(type, style);
+ width -= boundsFixes[macButtonPtr->fix].trimW;
+ height -= boundsFixes[macButtonPtr->fix].trimH;
+ }
+#endif
- if (mbPtr->flags & FIRST_DRAW) {
- ShowControl(mbPtr->userPane);
- ShowControl(mbPtr->control);
- mbPtr->flags ^= FIRST_DRAW;
+ if (haveImage || haveCompound) {
+ if (butPtr->width > 0) {
+ width = butPtr->width;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height;
+ }
} else {
- SetControlVisibility(mbPtr->control, true, true);
- Draw1Control(mbPtr->userPane);
- }
+ if (butPtr->width > 0) {
+ int avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
+ width = butPtr->width * avgWidth;
+ }
+ if (butPtr->height > 0) {
+ Tk_FontMetrics fm;
- if (mbPtr->params.isBevel) {
- if (mbPtr->bevelButtonContent.contentType ==
- kControlContentPictHandle) {
- KillPicture(mbPtr->bevelButtonContent.u.picture);
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ height = butPtr->height * fm.linespace;
}
}
+ if (!haveImage || haveCompound) {
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
+ }
+ if (haveImage) {
+ width += 2*border;
+ height += 2*border;
+ }
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ width += 2*NATIVE_BUTTON_INSET;
+ height += 2*NATIVE_BUTTON_INSET + NATIVE_BUTTON_EXTRA_H;
+ }
+#endif
+ Tk_GeometryRequest(butPtr->tkwin, width, height);
+ Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
+#ifdef TK_MAC_DEBUG_BUTTON
+ TKLog(@"button %s bounds %@ titleRect %@ width %d height %d inset %d borderWidth %d",
+ ((TkWindow *)butPtr->tkwin)->pathName, NSStringFromRect(bounds),
+ NSStringFromRect(titleRect), width, height, butPtr->inset,
+ butPtr->borderWidth);
+#endif
}
+
+#pragma mark -
+#pragma mark Unix Buttons:
+
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
- * SetupBevelButton --
+ * DisplayUnixButton --
*
- * Sets up the Bevel Button with image by copying the
- * source image onto the PicHandle for the button.
+ * This procedure is invoked to display a button widget. It is
+ * normally invoked as an idle handler.
*
* Results:
- * None
+ * None.
*
* Side effects:
- * The image or bitmap for the button is copied over to a picture.
+ * Commands are output to X to display the button in its
+ * current mode. The REDRAW_PENDING flag is cleared.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
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. */
+DisplayUnixButton(
+ TkButton *butPtr)
{
- TkButton *butPtr = (TkButton *) mbPtr;
- int height, width;
- ControlButtonGraphicAlignment theAlignment;
- CGrafPtr savePort;
- Boolean portChanged = false;
+ GC gc;
+ Tk_3DBorder border;
+ Pixmap pixmap;
+ int x = 0; /* Initialization only needed to stop compiler
+ * warning. */
+ int y, relief;
+ Tk_Window tkwin = butPtr->tkwin;
+ int width = 0, height = 0, fullWidth, fullHeight;
+ int textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
+ int imageWidth, imageHeight;
+ int imageXOffset = 0, imageYOffset = 0;
+ /* image information that will be used to
+ * restrict disabled pixmap as well */
+
+ border = butPtr->normalBorder;
+ if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {
+ gc = butPtr->disabledGC;
+ } else if ((butPtr->state == STATE_ACTIVE)
+ && !Tk_StrictMotif(butPtr->tkwin)) {
+ gc = butPtr->activeTextGC;
+ border = butPtr->activeBorder;
+ } else {
+ gc = butPtr->normalTextGC;
+ }
+ if ((butPtr->flags & SELECTED) && (butPtr->state != STATE_ACTIVE)
+ && (butPtr->selectBorder != NULL) && !butPtr->indicatorOn) {
+ border = butPtr->selectBorder;
+ }
+
+ relief = butPtr->relief;
+
+ pixmap = (Pixmap) Tk_WindowId(tkwin);
+ 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.
+ */
- if (butPtr->image != None) {
+ if (butPtr->image != NULL) {
Tk_SizeOfImage(butPtr->image, &width, &height);
- } else {
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
}
+ imageWidth = width;
+ imageHeight = height;
- if ((butPtr->width > 0) && (butPtr->width < width)) {
- width = butPtr->width;
- }
- if ((butPtr->height > 0) && (butPtr->height < height)) {
- height = butPtr->height;
- }
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
- {
- portChanged = QDSwapPort(destPort, &savePort);
- mbPtr->picParams.version = -2;
- mbPtr->picParams.hRes = 0x00480000;
- mbPtr->picParams.vRes = 0x00480000;
- mbPtr->picParams.srcRect.top = 0;
- mbPtr->picParams.srcRect.left = 0;
- mbPtr->picParams.srcRect.bottom = height;
- mbPtr->picParams.srcRect.right = width;
- mbPtr->picParams.reserved1 = 0;
- mbPtr->picParams.reserved2 = 0;
- mbPtr->bevelButtonContent.contentType = kControlContentPictHandle;
- mbPtr->bevelButtonContent.u.picture = OpenCPicture(&mbPtr->picParams);
- if (!mbPtr->bevelButtonContent.u.picture) {
- TkMacOSXDbgMsg("OpenCPicture failed");
- }
- tkPictureIsOpen = 1;
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
- /*
- * 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->tristateImage != NULL && (butPtr->flags & TRISTATED)) {
- Tk_RedrawImage(butPtr->tristateImage, 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, width,
- height, 0, 0, 1);
- }
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM:
+ /*
+ * Image is above or below text.
+ */
- {
- ClosePicture();
- tkPictureIsOpen = 0;
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
- }
- ChkErr(SetControlData, controlHandle, kControlButtonPart,
- kControlBevelButtonContentTag,
- sizeof(ControlButtonContentInfo),
- (char *) &mbPtr->bevelButtonContent);
-
- 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;
- }
- ChkErr(SetControlData, controlHandle, kControlButtonPart,
- kControlBevelButtonGraphicAlignTag,
- sizeof(ControlButtonGraphicAlignment), (char *) &theAlignment);
-
- if (butPtr->compound != COMPOUND_NONE) {
- ControlButtonTextPlacement thePlacement =
- kControlBevelButtonPlaceNormally;
-
- if (butPtr->compound == COMPOUND_TOP) {
- thePlacement = kControlBevelButtonPlaceBelowGraphic;
- } else if (butPtr->compound == COMPOUND_BOTTOM) {
- thePlacement = kControlBevelButtonPlaceAboveGraphic;
- } else if (butPtr->compound == COMPOUND_LEFT) {
- thePlacement = kControlBevelButtonPlaceToRightOfGraphic;
- } else if (butPtr->compound == COMPOUND_RIGHT) {
- thePlacement = kControlBevelButtonPlaceToLeftOfGraphic;
+ 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;
}
- ChkErr(SetControlData, controlHandle, kControlButtonPart,
- kControlBevelButtonTextPlaceTag,
- sizeof(ControlButtonTextPlacement), (char *) &thePlacement);
- }
-}
-
-/*
- *--------------------------------------------------------------
- *
- * 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.
- *
- *--------------------------------------------------------------
- */
-OSStatus
-SetUserPaneDrawProc(
- ControlRef control,
- ControlUserPaneDrawProcPtr upp)
-{
- ControlUserPaneDrawUPP myControlUserPaneDrawUPP;
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ fullWidth, fullHeight, &x, &y);
- 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.
- *
- *--------------------------------------------------------------
- */
+ imageXOffset += x;
+ imageYOffset += y;
-OSStatus
-SetUserPaneSetUpSpecialBackgroundProc(
- ControlRef control,
- ControlUserPaneBackgroundProcPtr upp)
-{
- ControlUserPaneBackgroundUPP myControlUserPaneBackgroundUPP;
+ if (butPtr->image != NULL) {
+ /*
+ * Do boundary clipping, so that Tk_RedrawImage is passed valid
+ * coordinates. [Bug 979239]
+ */
- 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.
- *
- *--------------------------------------------------------------
- */
+ if (imageXOffset < 0) {
+ imageXOffset = 0;
+ }
+ if (imageYOffset < 0) {
+ imageYOffset = 0;
+ }
+ if (width > Tk_Width(tkwin)) {
+ width = Tk_Width(tkwin);
+ }
+ if (height > Tk_Height(tkwin)) {
+ height = Tk_Height(tkwin);
+ }
+ if ((width + imageXOffset) > Tk_Width(tkwin)) {
+ imageXOffset = Tk_Width(tkwin) - width;
+ }
+ if ((height + imageYOffset) > Tk_Height(tkwin)) {
+ imageYOffset = Tk_Height(tkwin) - height;
+ }
-void
-UserPaneDraw(
- ControlRef control,
- ControlPartCode cpc)
-{
- MacButton *mbPtr = (MacButton *)(intptr_t)GetControlReference(control);
- Rect contrlRect;
- CGrafPtr port;
-
- GetPort(&port);
- GetControlBounds(control,&contrlRect);
- TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
- 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.
- *
- *--------------------------------------------------------------
- */
+ if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0,
+ width, height, pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) && (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0,
+ width, height, pixmap, imageXOffset, imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, imageXOffset, imageYOffset);
+ }
+ } else {
+ XSetClipOrigin(butPtr->display, gc, imageXOffset, imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc,
+ 0, 0, (unsigned int) width, (unsigned int) height,
+ imageXOffset, imageYOffset, 1);
+ XSetClipOrigin(butPtr->display, gc, 0, 0);
+ }
-void
-UserPaneBackgroundProc(
- ControlHandle control,
- ControlBackgroundPtr info)
-{
- MacButton * mbPtr = (MacButton *)(intptr_t)GetControlReference(control);
+ 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,
+ width, height, &x, &y);
+ imageXOffset += x;
+ imageYOffset += y;
+ if (butPtr->image != NULL) {
+ /*
+ * Do boundary clipping, so that Tk_RedrawImage is passed
+ * valid coordinates. [Bug 979239]
+ */
- if (info->colorDevice) {
- CGrafPtr port;
-
- GetPort(&port);
- TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
- }
-}
-
-/*
- *--------------------------------------------------------------
- *
- * 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.
- *
- *--------------------------------------------------------------
- */
+ if (imageXOffset < 0) {
+ imageXOffset = 0;
+ }
+ if (imageYOffset < 0) {
+ imageYOffset = 0;
+ }
+ if (width > Tk_Width(tkwin)) {
+ width = Tk_Width(tkwin);
+ }
+ if (height > Tk_Height(tkwin)) {
+ height = Tk_Height(tkwin);
+ }
+ if ((width + imageXOffset) > Tk_Width(tkwin)) {
+ imageXOffset = Tk_Width(tkwin) - width;
+ }
+ if ((height + imageYOffset) > Tk_Height(tkwin)) {
+ imageYOffset = Tk_Height(tkwin) - height;
+ }
-static int
-UpdateControlColors(
- MacButton *mbPtr)
-{
- XColor *xcolor;
- TkButton *butPtr = (TkButton *) mbPtr;
+ if ((butPtr->selectImage != NULL) &&
+ (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0, width,
+ height, pixmap, imageXOffset, imageYOffset);
+ } else if ((butPtr->tristateImage != NULL) &&
+ (butPtr->flags & TRISTATED)) {
+ Tk_RedrawImage(butPtr->tristateImage, 0, 0, width,
+ height, pixmap, imageXOffset, imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
+ imageXOffset, 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, 0, 0);
+ }
+ y += height/2;
+ } else {
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->textWidth, butPtr->textHeight, &x, &y);
+
+ 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;
+ }
+ }
/*
- * 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 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 so the stippling is the right color.
*/
- if (butPtr->type == TYPE_BUTTON) {
- xcolor = Tk_3DBorderColor(butPtr->highlightBorder);
- } else {
- xcolor = Tk_3DBorderColor(butPtr->normalBorder);
+ if ((butPtr->state == STATE_DISABLED)
+ && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) {
+ if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
+ && (butPtr->selectBorder != NULL)) {
+ XSetForeground(butPtr->display, butPtr->stippleGC,
+ Tk_3DBorderColor(butPtr->selectBorder)->pixel);
+ }
+
+ /*
+ * Stipple the whole button if no disabledFg was specified, otherwise
+ * restrict stippling only to displayed image
+ */
+
+ if (butPtr->disabledFg == NULL) {
+ XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, 0, 0,
+ (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin));
+ } else {
+ XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC,
+ imageXOffset, imageYOffset,
+ (unsigned) imageWidth, (unsigned) imageHeight);
+ }
+ if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
+ && (butPtr->selectBorder != NULL)) {
+ XSetForeground(butPtr->display, butPtr->stippleGC,
+ Tk_3DBorderColor(butPtr->normalBorder)->pixel);
+ }
}
- mbPtr->userPaneBackground = xcolor->pixel;
- 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.
- *
- *--------------------------------------------------------------
- */
+ /*
+ * Draw the border and traversal highlight last. This way, if the button's
+ * contents overflow they'll be covered up by the border. This code is
+ * complicated by the possible combinations of focus highlight and default
+ * rings. We draw the focus and highlight rings using the highlight border
+ * and highlight foreground color.
+ */
-static void
-ButtonEventProc(
- ClientData clientData, /* Information about window. */
- XEvent *eventPtr) /* Information about event. */
-{
- TkButton *buttonPtr = (TkButton *) clientData;
- MacButton *mbPtr = (MacButton *) clientData;
+ if (relief != TK_RELIEF_FLAT) {
+ int inset = butPtr->highlightWidth;
+
+ if (butPtr->defaultState == DEFAULT_ACTIVE) {
+ /*
+ * Draw the default ring with 2 pixels of space between the
+ * default ring and the button and the default ring and the focus
+ * ring. Note that we need to explicitly draw the space in the
+ * highlightBorder color to ensure that we overwrite any overflow
+ * text and/or a different button background color.
+ */
+
+ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset,
+ inset, Tk_Width(tkwin) - 2*inset,
+ Tk_Height(tkwin) - 2*inset, 2, TK_RELIEF_FLAT);
+ inset += 2;
+ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset,
+ inset, Tk_Width(tkwin) - 2*inset,
+ Tk_Height(tkwin) - 2*inset, 1, TK_RELIEF_SUNKEN);
+ inset++;
+ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset,
+ inset, Tk_Width(tkwin) - 2*inset,
+ Tk_Height(tkwin) - 2*inset, 2, TK_RELIEF_FLAT);
+
+ inset += 2;
+ } else if (butPtr->defaultState == DEFAULT_NORMAL) {
+ /*
+ * Leave room for the default ring and write over any text or
+ * background color.
+ */
- if (eventPtr->type == ActivateNotify
- || eventPtr->type == DeactivateNotify) {
- if ((buttonPtr->tkwin == NULL) || (!Tk_IsMapped(buttonPtr->tkwin))) {
- return;
+ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0,
+ 0, Tk_Width(tkwin), Tk_Height(tkwin), 5, TK_RELIEF_FLAT);
+ inset += 5;
}
- if (eventPtr->type == ActivateNotify) {
- mbPtr->flags |= ACTIVE;
+
+ /*
+ * Draw the button border.
+ */
+
+ Tk_Draw3DRectangle(tkwin, pixmap, border, inset, inset,
+ Tk_Width(tkwin) - 2*inset, Tk_Height(tkwin) - 2*inset,
+ butPtr->borderWidth, relief);
+ }
+ if (butPtr->highlightWidth > 0) {
+ GC gc;
+
+ if (butPtr->flags & GOT_FOCUS) {
+ gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap);
} else {
- mbPtr->flags &= ~ACTIVE;
+ gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder),
+ pixmap);
}
- if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) buttonPtr);
- buttonPtr->flags |= REDRAW_PENDING;
+
+ /*
+ * Make sure the focus ring shrink-wraps the actual button, not the
+ * padding space left for a default ring.
+ */
+
+ if (butPtr->defaultState == DEFAULT_NORMAL) {
+ TkDrawInsetFocusHighlight(tkwin, gc, butPtr->highlightWidth,
+ pixmap, 5);
+ } else {
+ Tk_DrawFocusHighlight(tkwin, gc, butPtr->highlightWidth, pixmap);
}
}
}
@@ -1403,217 +1021,150 @@ ButtonEventProc(
/*
*----------------------------------------------------------------------
*
- * TkMacOSXComputeControlParams --
+ * ComputeUnixButtonGeometry --
*
- * This procedure computes the various parameters used
- * when creating a Carbon control (NewControl).
- * These are determined by the various tk button parameters
+ * 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:
- * Sets the control initialisation parameters
+ * The button's window may change size.
*
*----------------------------------------------------------------------
*/
-static void
-TkMacOSXComputeControlParams(
- TkButton *butPtr,
- MacControlParams *paramsPtr)
+void
+ComputeUnixButtonGeometry(
+ register TkButton *butPtr) /* Button whose geometry may have changed. */
{
- paramsPtr->isBevel = 0;
+ int width, height, avgWidth, txtWidth, txtHeight;
+ int haveImage = 0, haveText = 0;
+ Tk_FontMetrics fm;
+
+ butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth;
/*
- * Determine ProcID based on button type and dimensions.
+ * Leave room for the default ring if needed.
*/
- 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 = MAX_VALUE;
- paramsPtr->procID = kControlRadioButtonProc;
- } else {
- paramsPtr->initialValue = 0;
- paramsPtr->minValue = kControlBehaviorOffsetContents |
- kControlBehaviorSticky | kControlContentPictHandle;
- paramsPtr->maxValue = MAX_VALUE;
- 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 = MAX_VALUE;
- paramsPtr->procID = kControlCheckBoxProc;
- } else {
- paramsPtr->initialValue = 0;
- paramsPtr->minValue = kControlBehaviorOffsetContents |
- kControlBehaviorSticky | kControlContentPictHandle;
- paramsPtr->maxValue = MAX_VALUE;
- if (butPtr->borderWidth <= 2) {
- paramsPtr->procID = kControlBevelButtonSmallBevelProc;
- } else if (butPtr->borderWidth == 3) {
- paramsPtr->procID = kControlBevelButtonNormalBevelProc;
- } else {
- paramsPtr->procID = kControlBevelButtonLargeBevelProc;
- }
- paramsPtr->isBevel = 1;
- }
- break;
+ if (butPtr->defaultState != DEFAULT_DISABLED) {
+ butPtr->inset += 5;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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
- *
- *----------------------------------------------------------------------
- */
+ butPtr->indicatorSpace = 0;
-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;
- }
+ width = 0;
+ height = 0;
+ txtWidth = 0;
+ txtHeight = 0;
+ avgWidth = 0;
- if ((butPtr->flags & SELECTED) && (butPtr->state != STATE_ACTIVE)
- && (butPtr->selectBorder != NULL) && !butPtr->indicatorOn) {
- dpPtr->border = butPtr->selectBorder;
+ 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;
}
- /*
- * 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.
- */
+ if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) {
+ Tk_FreeTextLayout(butPtr->textLayout);
- dpPtr->relief = butPtr->relief;
+ butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
+ Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
+ butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
- if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
- if (!dpPtr->hasImageOrBitmap) {
- dpPtr->relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : TK_RELIEF_RAISED;
- }
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
+ avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ haveText = (txtWidth != 0 && txtHeight != 0);
}
/*
- * Determine the draw type
+ * 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->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 {
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM:
/*
- * 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.
+ * Image is above or below text.
*/
- if (dpPtr->gc->clip_mask == 0) {
- dpPtr->drawType = DRAW_BEVEL;
- } else {
- TkpClipMask *clipPtr = (TkpClipMask *) dpPtr->gc->clip_mask;
+ height += txtHeight + butPtr->padY;
+ width = (width > txtWidth ? width : txtWidth);
+ break;
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT:
+ /*
+ * Image is left or right of text.
+ */
- if ((clipPtr->type == TKP_CLIP_PIXMAP) &&
- (clipPtr->value.pixmap != butPtr->bitmap)) {
- dpPtr->drawType = DRAW_CUSTOM;
- } else {
- dpPtr->drawType = DRAW_BEVEL;
- }
- }
+ 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;
}
- } else if (butPtr->indicatorOn) {
- dpPtr->drawType = DRAW_CONTROL;
- } else if (dpPtr->hasImageOrBitmap) {
- if (dpPtr->gc->clip_mask == 0) {
- dpPtr->drawType = DRAW_BEVEL;
+ if (butPtr->width > 0) {
+ width = butPtr->width;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height;
+ }
+
+ 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;
+ }
} else {
- TkpClipMask *clipPtr = (TkpClipMask*) dpPtr->gc->clip_mask;
+ width = txtWidth;
+ height = txtHeight;
- if ((clipPtr->type == TKP_CLIP_PIXMAP) &&
- (clipPtr->value.pixmap != butPtr->bitmap)) {
- dpPtr->drawType = DRAW_CUSTOM;
- } else {
- dpPtr->drawType = DRAW_BEVEL;
+ if (butPtr->width > 0) {
+ width = butPtr->width * avgWidth;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height * fm.linespace;
}
}
- } else {
- dpPtr->drawType = DRAW_CUSTOM;
}
- if ((dpPtr->drawType == DRAW_CONTROL) || (dpPtr->drawType == DRAW_BEVEL)) {
- return 1;
- } else {
- return 0;
+ if (!haveImage) {
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
}
+ Tk_GeometryRequest(butPtr->tkwin, (int) (width
+ + 2*butPtr->inset), (int) (height + 2*butPtr->inset));
+ Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c
index b561244..7105135 100644
--- a/macosx/tkMacOSXClipboard.c
+++ b/macosx/tkMacOSXClipboard.c
@@ -4,8 +4,8 @@
* This file manages the clipboard for the Tk toolkit.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -14,20 +14,94 @@
#include "tkMacOSXPrivate.h"
#include "tkSelect.h"
+static NSInteger changeCount = -1;
+static Tk_Window clipboardOwner = NULL;
+
+#pragma mark TKApplication(TKClipboard)
+
+@implementation TKApplication(TKClipboard)
+- (void) tkProvidePasteboard: (TkDisplay *) dispPtr
+ pasteboard: (NSPasteboard *) sender
+ provideDataForType: (NSString *) type
+{
+ NSMutableString *string = [NSMutableString new];
+
+ if (dispPtr && dispPtr->clipboardActive &&
+ [type isEqualToString:NSStringPboardType]) {
+ for (TkClipboardTarget *targetPtr = dispPtr->clipTargetPtr; targetPtr;
+ targetPtr = targetPtr->nextPtr) {
+ if (targetPtr->type == XA_STRING ||
+ targetPtr->type == dispPtr->utf8Atom) {
+ for (TkClipboardBuffer *cbPtr = targetPtr->firstBufferPtr;
+ cbPtr; cbPtr = cbPtr->nextPtr) {
+ NSString *s = [[NSString alloc] initWithBytesNoCopy:
+ cbPtr->buffer length:cbPtr->length
+ encoding:NSUTF8StringEncoding freeWhenDone:NO];
+
+ [string appendString:s];
+ [s release];
+ }
+ break;
+ }
+ }
+ }
+ [sender setString:string forType:type];
+ [string release];
+}
+
+- (void) tkProvidePasteboard: (TkDisplay *) dispPtr
+{
+ if (dispPtr && dispPtr->clipboardActive) {
+ [self tkProvidePasteboard:dispPtr
+ pasteboard:[NSPasteboard generalPasteboard]
+ provideDataForType:NSStringPboardType];
+ }
+}
+
+- (void) pasteboard: (NSPasteboard *) sender
+ provideDataForType: (NSString *) type
+{
+ [self tkProvidePasteboard:TkGetDisplayList() pasteboard:sender
+ provideDataForType:type];
+}
+
+- (void) tkCheckPasteboard
+{
+ if (clipboardOwner && [[NSPasteboard generalPasteboard] changeCount] !=
+ changeCount) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+
+ if (dispPtr) {
+ XEvent event;
+
+ event.xany.type = SelectionClear;
+ event.xany.serial = NextRequest(Tk_Display(clipboardOwner));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(clipboardOwner);
+ event.xany.display = Tk_Display(clipboardOwner);
+ event.xselectionclear.selection = dispPtr->clipboardAtom;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ }
+ clipboardOwner = NULL;
+ }
+}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
*
* TkSelGetSelection --
*
- * Retrieve the specified selection from another process. For
- * now, only fetching XA_STRING from CLIPBOARD is supported.
- * Eventually other types should be allowed.
+ * 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.
+ * 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.
@@ -48,109 +122,35 @@ TkSelGetSelection(
* once it has been retrieved. */
ClientData clientData) /* Arbitrary value to pass to proc. */
{
- int result;
- OSStatus 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 = ChkErr(GetCurrentScrap, &scrapRef);
- if (err != noErr) {
- Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
- " GetCurrentScrap failed.", NULL);
- return TCL_ERROR;
- }
-
- /*
- * Try UNICODE first
- */
- err = ChkErr(GetScrapFlavorSize, scrapRef, kScrapFlavorTypeUnicode,
- &length);
- if (err == noErr && length > 0) {
- Tcl_DString ds;
- char *data;
-
- buf = (char *) ckalloc(length + 2);
- buf[length] = 0;
- buf[length+1] = 0; /* 2-byte unicode null */
- err = ChkErr(GetScrapFlavorData, scrapRef, kScrapFlavorTypeUnicode,
- &length, buf);
- if (err == noErr) {
- Tcl_DStringInit(&ds);
- Tcl_UniCharToUtfDString((Tcl_UniChar *)buf,
- Tcl_UniCharLen((Tcl_UniChar *)buf), &ds);
- for (data = Tcl_DStringValue(&ds); *data != '\0'; data++) {
- if (*data == '\r') {
- *data = '\n';
- }
- }
- result = (*proc)(clientData, interp, Tcl_DStringValue(&ds));
- Tcl_DStringFree(&ds);
- ckfree(buf);
- return result;
- }
- }
-
- err = ChkErr(GetScrapFlavorSize, scrapRef, 'TEXT', &length);
- if (err != noErr) {
- Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
- " GetScrapFlavorSize failed.", NULL);
- return TCL_ERROR;
- }
- if (length > 0) {
- Tcl_DString encodedText;
- char *data;
-
- buf = (char *) ckalloc(length + 1);
- buf[length] = 0;
- err = ChkErr(GetScrapFlavorData, scrapRef, 'TEXT', &length, buf);
- if (err != noErr) {
- Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
- " GetScrapFlavorData failed.", NULL);
- return TCL_ERROR;
- }
-
- /*
- * Tcl expects '\n' not '\r' as the line break character.
- */
-
- for (data = buf; *data != '\0'; data++) {
- if (*data == '\r') {
- *data = '\n';
- }
- }
-
- Tcl_ExternalToUtfDString(TkMacOSXCarbonEncoding, buf, length,
- &encodedText);
- result = (*proc)(clientData, interp,
- Tcl_DStringValue(&encodedText));
- Tcl_DStringFree(&encodedText);
-
- ckfree(buf);
- return result;
+ int result = TCL_ERROR;
+ TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
+
+ if (dispPtr && selection == dispPtr->clipboardAtom && (target == XA_STRING
+ || target == dispPtr->utf8Atom)) {
+ NSString *string = nil;
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+ NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject:
+ NSStringPboardType]];
+
+ if (type) {
+ string = [pb stringForType:type];
}
+ result = proc(clientData, interp, string ? [string UTF8String] : "");
+ } else {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " selection doesn't exist or form \"",
+ Tk_GetAtomName(tkwin, target), "\" not defined", NULL);
}
-
- Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
- " selection doesn't exist or form \"",
- Tk_GetAtomName(tkwin, target), "\" not defined", NULL);
- return TCL_ERROR;
+ return result;
}
/*
*----------------------------------------------------------------------
*
- * TkSetSelectionOwner --
+ * XSetSelectionOwner --
*
- * This function claims ownership of the specified selection.
- * If the selection is CLIPBOARD, then we empty the system
- * clipboard.
+ * This function claims ownership of the specified selection. If the
+ * selection is CLIPBOARD, then we empty the system clipboard.
*
* Results:
* None.
@@ -168,27 +168,41 @@ XSetSelectionOwner(
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;
+ TkDisplay *dispPtr = TkGetDisplayList();
- if (selection == Tk_InternAtom(tkwin, "CLIPBOARD")) {
- /*
- * Only claim and empty the clipboard if we aren't already the
- * owner of the clipboard.
- */
+ if (dispPtr && selection == dispPtr->clipboardAtom) {
+ clipboardOwner = owner ? Tk_IdToWindow(display, owner) : NULL;
+ if (!dispPtr->clipboardActive) {
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
- dispPtr = TkGetMainInfoList()->winPtr->dispPtr;
- if (dispPtr->clipboardActive) {
- return;
+ changeCount = [pb declareTypes:[NSArray array] owner:NSApp];
}
- ClearCurrentScrap();
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSelDeadWindow --
+ *
+ * This function is invoked just before a TkWindow is deleted. It
+ * performs selection-related cleanup.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * clipboardOwner is cleared.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSelDeadWindow(
+ TkWindow *winPtr)
+{
+ if (winPtr && winPtr == (TkWindow *)clipboardOwner) {
+ clipboardOwner = NULL;
}
}
@@ -197,9 +211,8 @@ XSetSelectionOwner(
*
* 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.
+ * This function is called to force the clipboard to be updated after new
+ * data is added.
*
* Results:
* None.
@@ -216,6 +229,10 @@ TkSelUpdateClipboard(
TkClipboardTarget *targetPtr)
/* Info about the content. */
{
+ NSPasteboard *pb = [NSPasteboard generalPasteboard];
+
+ changeCount = [pb addTypes:[NSArray arrayWithObject:NSStringPboardType]
+ owner:NSApp];
}
/*
@@ -223,8 +240,7 @@ TkSelUpdateClipboard(
*
* TkSelEventProc --
*
- * This procedure is invoked whenever a selection-related
- * event occurs.
+ * This procedure is invoked whenever a selection-related event occurs.
*
* Results:
* None.
@@ -242,6 +258,7 @@ TkSelEventProc(
* SelectionRequest, or SelectionNotify. */
{
if (eventPtr->type == SelectionClear) {
+ clipboardOwner = NULL;
TkSelClearSelection(tkwin, eventPtr);
}
}
@@ -251,9 +268,8 @@ TkSelEventProc(
*
* TkSelPropProc --
*
- * This procedure is invoked when property-change events
- * occur on windows not known to the toolkit. This is a stub
- * function under Windows.
+ * 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.
@@ -276,7 +292,6 @@ TkSelPropProc(
* TkSuspendClipboard --
*
* Handle clipboard conversion as required by the suppend event.
- * This function is also called on exit.
*
* Results:
* None.
@@ -290,80 +305,14 @@ TkSelPropProc(
void
TkSuspendClipboard(void)
{
- 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, unicodedText;
-
- 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);
-
- /*
- * Also put unicode data on scrap.
- */
-
- Tcl_DStringInit(&unicodedText);
- Tcl_UtfToUniCharDString(buffer, length, &unicodedText);
- PutScrapFlavor(scrapRef, kScrapFlavorTypeUnicode, 0,
- Tcl_DStringLength(&unicodedText),
- Tcl_DStringValue(&unicodedText));
- Tcl_DStringFree(&unicodedText);
-
- 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;
+ changeCount = [[NSPasteboard generalPasteboard] changeCount];
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index b6b1d18..3cd7c66 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -7,8 +7,8 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -17,11 +17,6 @@
#include "tkMacOSXPrivate.h"
#include "tkColor.h"
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
-/* Undocumented CG API for creating CGPattern from CGImage */
-extern CGPatternRef CGPatternCreateWithImage(CGImageRef img, int i) WEAK_IMPORT_ATTRIBUTE;
-#endif
-
struct SystemColorMapEntry {
const char *name;
ThemeBrush brush;
@@ -176,7 +171,7 @@ static const struct SystemColorMapEntry systemColorMap[] = {
{ NULL, 0, 0, 0 }
};
#define MAX_PIXELCODE 165
-
+
/*
*----------------------------------------------------------------------
*
@@ -202,7 +197,7 @@ GetThemeFromPixelCode(
ThemeTextColor *textColor,
ThemeBackgroundKind *background)
{
- if (code >= MIN_PIXELCODE && code <= MAX_PIXELCODE && code != PIXEL_MAGIC) {
+ if (code >= MIN_PIXELCODE && code <= MAX_PIXELCODE) {
*brush = systemColorMap[code - MIN_PIXELCODE].brush;
*textColor = systemColorMap[code - MIN_PIXELCODE].textColor;
*background = systemColorMap[code - MIN_PIXELCODE].background;
@@ -211,7 +206,8 @@ GetThemeFromPixelCode(
*textColor = 0;
*background = 0;
}
- if (!*brush && !*textColor && !*background && code != PIXEL_MAGIC) {
+ if (!*brush && !*textColor && !*background && code != PIXEL_MAGIC &&
+ code != TRANSPARENT_PIXEL) {
return false;
} else {
return true;
@@ -240,23 +236,43 @@ GetThemeColor(
ThemeBrush brush,
ThemeTextColor textColor,
ThemeBackgroundKind background,
- RGBColor *c)
+ CGColorRef *c)
{
OSStatus err = noErr;
if (brush) {
- err = ChkErr(GetThemeBrushAsColor,
- brush == kThemeBrushMenuBackgroundSelected ?
- kThemeBrushFocusHighlight : brush, 32, true, c);
- } else if (textColor) {
- err = ChkErr(GetThemeTextColor, textColor, 32, true, c);
+ err = ChkErr(HIThemeBrushCreateCGColor, brush, c);
+ /*} else if (textColor) {
+ err = ChkErr(GetThemeTextColor, textColor, 32, true, c);*/
} else {
- c->red = (pixel >> 16) & 0xff;
- c->green = (pixel >> 8) & 0xff;
- c->blue = (pixel ) & 0xff;
- c->red |= c->red << 8;
- c->green |= c->green << 8;
- c->blue |= c->blue << 8;
+ CGFloat rgba[4] = {0, 0, 0, 1};
+
+ switch ((pixel >> 24) & 0xff) {
+ case PIXEL_MAGIC: {
+ unsigned short red, green, blue;
+ red = (pixel >> 16) & 0xff;
+ green = (pixel >> 8) & 0xff;
+ blue = (pixel ) & 0xff;
+ red |= red << 8;
+ green |= green << 8;
+ blue |= blue << 8;
+ rgba[0] = red / 65535.0;
+ rgba[1] = green / 65535.0;
+ rgba[2] = blue / 65535.0;
+ break;
+ }
+ case TRANSPARENT_PIXEL:
+ rgba[3] = 0.0;
+ break;
+ }
+
+ *c = CGColorCreateGenericRGB(rgba[0], rgba[1], rgba[2], rgba[3]);
+
+ /*static CGColorSpaceRef deviceRGBSpace = NULL;
+ if (!deviceRGBSpace) {
+ deviceRGBSpace = CGDisplayCopyColorSpace(CGMainDisplayID());
+ }
+ *c = CGColorCreate(deviceRGBSpace, rgba );*/
}
return err;
}
@@ -266,14 +282,14 @@ GetThemeColor(
*
* TkSetMacColor --
*
- * Populates a Macintosh RGBColor structure from a X style
- * pixel value.
+ * Creates a CGColorRef 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.
+ * The variable macColor is set to a new CGColorRef, the caller is
+ * responsible for releasing it!
*
*----------------------------------------------------------------------
*/
@@ -281,8 +297,9 @@ GetThemeColor(
int
TkSetMacColor(
unsigned long pixel, /* Pixel value to convert. */
- RGBColor *macColor) /* Mac color struct to modify. */
+ void *macColor) /* CGColorRef to modify. */
{
+ CGColorRef *color = (CGColorRef*)macColor;
OSStatus err = -1;
ThemeBrush brush;
ThemeTextColor textColor;
@@ -291,7 +308,7 @@ TkSetMacColor(
if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
&background)) {
err = ChkErr(GetThemeColor, pixel, brush, textColor, background,
- macColor);
+ color);
}
return (err == noErr);
}
@@ -299,81 +316,149 @@ TkSetMacColor(
/*
*----------------------------------------------------------------------
*
- * TkMacOSXSetColorInPort --
+ * TkpInitGCCache, TkpFreeGCCache, CopyCachedColor, SetCachedColor --
*
- * Sets fore or back color in the given QD port from an X pixel
- * value, and if the pixel code indicates a system color, sets
- * the corresponding brush, textColor or background via
- * Appearance mgr APIs.
+ * Maintain a per-GC cache of previously converted CGColorRefs
*
* Results:
- * None.
+ * None resp. retained CGColorRef for CopyCachedColor()
*
* Side effects:
- * If penPat is non-NULL it is set to the forground color/pattern.
+ * None.
*
*----------------------------------------------------------------------
*/
void
-TkMacOSXSetColorInPort(
- unsigned long pixel,
- int fg,
- PixPatHandle penPat,
- CGrafPtr port)
+TkpInitGCCache(
+ GC gc)
{
- OSStatus err;
- RGBColor c;
- ThemeBrush brush;
- ThemeTextColor textColor;
- ThemeBackgroundKind background;
- int setPenPat = 0;
+ bzero(TkpGetGCCache(gc), sizeof(TkpGCCache));
+}
- if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
- &background)) {
- CGrafPtr savePort;
- Boolean portChanged;
+void
+TkpFreeGCCache(
+ GC gc)
+{
+ TkpGCCache *gcCache = TkpGetGCCache(gc);
- portChanged = QDSwapPort(port, &savePort);
- err = ChkErr(GetThemeColor, pixel, brush, textColor, background, &c);
- if (err == noErr) {
- if (fg) {
- RGBForeColor(&c);
- if (penPat) {
- MakeRGBPat(penPat, &c);
- setPenPat = 1;
- }
- } else {
- RGBBackColor(&c);
- }
- }
- err = -1;
- if (brush) {
- err = ChkErr(SetThemeBackground,
- brush == kThemeBrushMenuBackgroundSelected ?
- kThemeBrushFocusHighlight : brush, 32, true);
- } else if (textColor && fg) {
- err = ChkErr(SetThemeTextColor, textColor, 32, true);
- } else if (background) {
- Rect bounds;
+ if (gcCache->cachedForegroundColor) {
+ CFRelease(gcCache->cachedForegroundColor);
+ }
+ if (gcCache->cachedBackgroundColor) {
+ CFRelease(gcCache->cachedBackgroundColor);
+ }
+}
- GetPortBounds(port, &bounds);
- err = ChkErr(ApplyThemeBackground, background, &bounds,
- kThemeStateActive, 32, true);
+static CGColorRef
+CopyCachedColor(
+ GC gc,
+ unsigned long pixel)
+{
+ TkpGCCache *gcCache = TkpGetGCCache(gc);
+ CGColorRef cgColor = NULL;
+
+ if (gcCache) {
+ if (gcCache->cachedForeground == pixel) {
+ cgColor = gcCache->cachedForegroundColor;
+ } else if (gcCache->cachedBackground == pixel) {
+ cgColor = gcCache->cachedBackgroundColor;
}
- if (penPat && err == noErr && (brush || background)) {
- GetPortBackPixPat(port, penPat);
- setPenPat = 1;
+ if (cgColor) {
+ CFRetain(cgColor);
}
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ }
+ return cgColor;
+}
+
+static void
+SetCachedColor(
+ GC gc,
+ unsigned long pixel,
+ CGColorRef cgColor)
+{
+ TkpGCCache *gcCache = TkpGetGCCache(gc);
+
+ if (gcCache && cgColor) {
+ if (gc->foreground == pixel) {
+ if (gcCache->cachedForegroundColor) {
+ CFRelease(gcCache->cachedForegroundColor);
+ }
+ gcCache->cachedForegroundColor = (CGColorRef) CFRetain(cgColor);
+ gcCache->cachedForeground = pixel;
+ } else if (gc->background == pixel) {
+ if (gcCache->cachedBackgroundColor) {
+ CFRelease(gcCache->cachedBackgroundColor);
+ }
+ gcCache->cachedBackgroundColor = (CGColorRef) CFRetain(cgColor);
+ gcCache->cachedBackground = pixel;
}
- } else {
- TkMacOSXDbgMsg("Ignored unknown pixel value 0x%lx", pixel);
}
- if (penPat && !setPenPat) {
- GetPortBackPixPat(port, penPat);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXCreateCGColor --
+ *
+ * Creates a CGColorRef from a X style pixel value.
+ *
+ * Results:
+ * Returns NULL if not a real pixel, CGColorRef otherwise.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+CGColorRef
+TkMacOSXCreateCGColor(
+ GC gc,
+ unsigned long pixel) /* Pixel value to convert. */
+{
+ CGColorRef cgColor = CopyCachedColor(gc, pixel);
+
+ if (!cgColor && TkSetMacColor(pixel, &cgColor)) {
+ SetCachedColor(gc, pixel, cgColor);
+ }
+ return cgColor;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNSColor --
+ *
+ * Creates an autoreleased NSColor from a X style pixel value.
+ *
+ * Results:
+ * Returns nil if not a real pixel, NSColor* otherwise.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+NSColor*
+TkMacOSXGetNSColor(
+ GC gc,
+ unsigned long pixel) /* Pixel value to convert. */
+{
+ CGColorRef cgColor = TkMacOSXCreateCGColor(gc, pixel);
+ NSColor *nsColor = nil;
+
+ if (cgColor) {
+ NSColorSpace *colorSpace = [[NSColorSpace alloc]
+ initWithCGColorSpace:CGColorGetColorSpace(cgColor)];
+ nsColor = [NSColor colorWithColorSpace:colorSpace
+ components:CGColorGetComponents(cgColor)
+ count:CGColorGetNumberOfComponents(cgColor)];
+ [colorSpace release];
+ CFRelease(cgColor);
}
+ return nsColor;
}
/*
@@ -397,136 +482,52 @@ TkMacOSXSetColorInPort(
void
TkMacOSXSetColorInContext(
+ GC gc,
unsigned long pixel,
CGContextRef context)
{
OSStatus err = -1;
- RGBColor c;
+ CGColorRef cgColor = CopyCachedColor(gc, pixel);
ThemeBrush brush;
ThemeTextColor textColor;
ThemeBackgroundKind background;
- if (GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush, &textColor,
- &background)) {
+ if (!cgColor && GetThemeFromPixelCode((pixel >> 24) & 0xff, &brush,
+ &textColor, &background)) {
if (brush) {
- TK_IF_MAC_OS_X_API (4, HIThemeSetFill,
- err = ChkErr(HIThemeSetFill, brush, NULL, context,
+ err = ChkErr(HIThemeSetFill, brush, NULL, context,
+ kHIThemeOrientationNormal);
+ if (err == noErr) {
+ err = ChkErr(HIThemeSetStroke, brush, NULL, context,
kHIThemeOrientationNormal);
- TK_IF_MAC_OS_X_API_COND (4, HIThemeSetFill, err == noErr,
- err = ChkErr(HIThemeSetStroke, brush, NULL, context,
- kHIThemeOrientationNormal);
- ) TK_ENDIF
- ) TK_ENDIF
+ }
} else if (textColor) {
- TK_IF_MAC_OS_X_API (4, HIThemeSetTextFill,
- err = ChkErr(HIThemeSetTextFill, textColor, NULL, context,
- kHIThemeOrientationNormal);
- ) TK_ENDIF
+ err = ChkErr(HIThemeSetTextFill, textColor, NULL, context,
+ kHIThemeOrientationNormal);
} else if (background) {
- TK_IF_MAC_OS_X_API (3, CGContextGetClipBoundingBox,
- CGRect rect = CGContextGetClipBoundingBox(context);
- HIThemeBackgroundDrawInfo info = { 0, kThemeStateActive,
- background };
-
- TK_IF_MAC_OS_X_API (3, HIThemeApplyBackground,
- TK_IF_HI_TOOLBOX (3, /* c.f. QA1377 */
- err = ChkErr(HIThemeApplyBackground, &rect, &info,
- context, kHIThemeOrientationNormal);
- ) TK_ENDIF
- ) TK_ENDIF
- ) TK_ENDIF
+ CGRect rect = CGContextGetClipBoundingBox(context);
+ HIThemeBackgroundDrawInfo info = { 0, kThemeStateActive,
+ background };
+
+ err = ChkErr(HIThemeApplyBackground, &rect, &info,
+ context, kHIThemeOrientationNormal);
}
if (err == noErr) {
return;
}
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
- /*
- * Convert Appearance theme pattern to CGPattern:
- */
- if ((brush || background) && CGPatternCreateWithImage != NULL) {
- static PixPatHandle pixpat = NULL;
- static GWorldPtr patGWorld = NULL;
- static uint32_t bitmapInfo = 0;
- const short patDim = 16;
- const Rect bounds = {0, 0, patDim, patDim};
- CGrafPtr savePort;
- Boolean portChanged;
- PixMapHandle pixmap;
- long rowbytes;
- CGImageRef img;
- CGColorSpaceRef rgbCspace;
- CGDataProviderRef provider;
-
- if (!pixpat) {
- pixpat = NewPixPat();
- err = ChkErr(NewGWorld, &patGWorld, 32, &bounds, NULL, NULL, 0
-#ifdef __LITTLE_ENDIAN__
- | kNativeEndianPixMap
-#endif
- );
- if (!pixpat || err != noErr || !patGWorld) {
- Tcl_Panic("TkMacOSXSetColorInContext(): "
- "pattern initialization failed !");
- }
- TK_IF_HI_TOOLBOX (4,
- bitmapInfo = kCGBitmapByteOrder32Host;
- ) TK_ENDIF
- }
- portChanged = QDSwapPort(patGWorld, &savePort);
- TkMacOSXSetColorInPort(pixel, 1, pixpat, patGWorld);
-#ifdef TK_MAC_DEBUG
- Rect patBounds;
- GetPixBounds((**pixpat).patMap, &patBounds);
- if (patBounds.right > patDim || patBounds.bottom > patDim) {
- Tcl_Panic("TkMacOSXSetColorInContext(): "
- "pattern larger than expected !");
- }
-#endif /* TK_MAC_DEBUG */
- FillCRect(&bounds, pixpat);
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
- pixmap = GetPortPixMap(patGWorld);
- rowbytes = GetPixRowBytes(pixmap);
- provider = CGDataProviderCreateWithData(&patGWorld,
- GetPixBaseAddr(pixmap), rowbytes * patDim, NULL);
- rgbCspace = CGColorSpaceCreateDeviceRGB();
- img = CGImageCreate(patDim, patDim, 8, 32,
- rowbytes, rgbCspace, kCGImageAlphaFirst | bitmapInfo,
- provider, NULL, 0, kCGRenderingIntentDefault);
- CGColorSpaceRelease(rgbCspace);
- CGDataProviderRelease(provider);
- if (img) {
- CGPatternRef pat = CGPatternCreateWithImage(img, 2);
- CGColorSpaceRef patCSpace = CGColorSpaceCreatePattern(NULL);
- const float alpha = 1;
-
- CGContextSetFillColorSpace(context, patCSpace);
- CGContextSetFillPattern(context, pat, &alpha);
- CGContextSetStrokeColorSpace(context, patCSpace);
- CGContextSetStrokePattern(context, pat, &alpha);
- CGColorSpaceRelease(patCSpace);
- CGPatternRelease(pat);
- CGImageRelease(img);
- return;
- }
- }
-#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1040 */
- err = ChkErr(GetThemeColor, pixel, brush, textColor, background, &c);
+ err = ChkErr(GetThemeColor, pixel, brush, textColor, background,
+ &cgColor);
if (err == noErr) {
- double r = c.red / 65535.0;
- double g = c.green / 65535.0;
- double b = c.blue / 65535.0;
-
- CGContextSetRGBFillColor(context, r, g, b, 1.0);
- CGContextSetRGBStrokeColor(context, r, g, b, 1.0);
+ SetCachedColor(gc, pixel, cgColor);
}
- } else if (((pixel >> 24) & 0xff) == TRANSPARENT_PIXEL) {
- CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 0.0);
- CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 0.0);
- } else {
+ } else if (!cgColor) {
TkMacOSXDbgMsg("Ignored unknown pixel value 0x%lx", pixel);
}
+ if (cgColor) {
+ CGContextSetFillColorWithColor(context, cgColor);
+ CGContextSetStrokeColorWithColor(context, cgColor);
+ CGColorRelease(cgColor);
+ }
}
/*
@@ -553,8 +554,8 @@ TkpGetColor(
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);
+ Display *display = tkwin != None ? Tk_Display(tkwin) : NULL;
+ Colormap colormap = tkwin!= None ? Tk_Colormap(tkwin) : None;
TkColor *tkColPtr;
XColor color;
@@ -571,7 +572,7 @@ TkpGetColor(
Tcl_DecrRefCount(strPtr);
if (result == TCL_OK) {
OSStatus err;
- RGBColor c;
+ CGColorRef c;
unsigned char pixelCode = idx + MIN_PIXELCODE;
ThemeBrush brush = systemColorMap[idx].brush;
ThemeTextColor textColor = systemColorMap[idx].textColor;
@@ -579,24 +580,38 @@ TkpGetColor(
err = ChkErr(GetThemeColor, 0, brush, textColor, background, &c);
if (err == noErr) {
- color.red = c.red;
- color.green = c.green;
- color.blue = c.blue;
+ const size_t n = CGColorGetNumberOfComponents(c);
+ const CGFloat *rgba = CGColorGetComponents(c);
+
+ switch (n) {
+ case 4:
+ color.red = rgba[0] * 65535.0;
+ color.green = rgba[1] * 65535.0;
+ color.blue = rgba[2] * 65535.0;
+ break;
+ case 2:
+ color.red = color.green = color.blue = rgba[0] * 65535.0;
+ break;
+ default:
+ Tcl_Panic("CGColor with %d components", (int) n);
+ }
color.pixel = ((((((pixelCode << 8)
| ((color.red >> 8) & 0xff)) << 8)
| ((color.green >> 8) & 0xff)) << 8)
| ((color.blue >> 8) & 0xff));
+ CGColorRelease(c);
goto validXColor;
}
+ CGColorRelease(c);
}
}
if (XParseColor(display, colormap, name, &color) == 0) {
- return (TkColor *) NULL;
+ return NULL;
}
validXColor:
- tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ tkColPtr = ckalloc(sizeof(TkColor));
tkColPtr->color = color;
return tkColPtr;
@@ -630,7 +645,7 @@ TkpGetColorByValue(
XColor *colorPtr) /* Red, green, and blue fields indicate
* desired color. */
{
- TkColor *tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ TkColor *tkColPtr = ckalloc(sizeof(TkColor));
tkColPtr->color.red = colorPtr->red;
tkColPtr->color.green = colorPtr->green;
@@ -639,37 +654,6 @@ TkpGetColorByValue(
return tkColPtr;
}
-#if !TK_DRAW_IN_CONTEXT
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXCompareColors --
- *
- * On Mac, color codes may specify symbolic values like "highlight
- * foreground", but we really need the actual values to compare.
- * Maybe see also: "TIP #154: Add Named Colors to Tk".
- *
- * Results:
- * Returns true if both colors are the same, false otherwise.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkMacOSXCompareColors(
- unsigned long c1,
- unsigned long c2)
-{
- RGBColor col1, col2;
- return TkSetMacColor(c1,&col1) &&
- TkSetMacColor(c1,&col2) &&
- !memcmp(&col1,&col2,sizeof(col1));
-}
-#endif /* !TK_DRAW_IN_CONTEXT */
-
/*
*----------------------------------------------------------------------
*
@@ -734,3 +718,12 @@ XFreeColors(
* no colormap in the Tk sense.
*/
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c
index 4c803f0..bdfcb6e 100644
--- a/macosx/tkMacOSXConfig.c
+++ b/macosx/tkMacOSXConfig.c
@@ -5,7 +5,7 @@
* the configuration package.
*
* Copyright (c) 1997 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
+ * Copyright 2001, Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -36,8 +36,8 @@
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. */
+ const char *dbName, /* The option database name. */
+ const char *className) /* The name of the option class. */
{
return NULL;
}
diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c
index 4c5b332..a333adf 100644
--- a/macosx/tkMacOSXCursor.c
+++ b/macosx/tkMacOSXCursor.c
@@ -4,26 +4,28 @@
* This file contains Macintosh specific cursor related routines.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
+#include "tkMacOSXCursors.h"
+#include "tkMacOSXXCursors.h"
/*
- * There are three different ways to set the cursor on the Mac. The default
- * theme cursors (listed in cursorNames below), color resource cursors, &
- * normal cursors.
+ * Mac Cursor Types.
*/
#define NONE -1 /* Hidden cursor */
-#define THEME 0 /* Theme cursors */
-#define ANIMATED 1 /* Animated theme cursors */
-#define COLOR 2 /* Cursors of type crsr. */
-#define NORMAL 3 /* Cursors of type CURS. */
+#define SELECTOR 1 /* NSCursor class method */
+#define IMAGENAMED 2 /* Named NSImage */
+#define IMAGEPATH 3 /* Path to NSImage */
+#define IMAGEBITMAP 4 /* Pointer to 16x16 cursor bitmap data */
+
+#define pix 16 /* Pixel width & height of cursor bitmap data */
/*
* The following data structure contains the system specific data necessary to
@@ -32,60 +34,151 @@
typedef struct {
TkCursor info; /* Generic cursor info used by tkCursor.c */
- Handle macCursor; /* Resource containing Macintosh cursor. For
- * theme cursors, this is -1. */
- int type; /* Type of Mac cursor: for theme cursors this
- * is the theme cursor constant, otherwise one
- * of crsr or CURS. */
- int count; /* For animating cursors, the count for the
- * cursor. */
+ NSCursor *macCursor; /* Macintosh cursor */
+ int type; /* Type of Mac cursor */
} TkMacOSXCursor;
/*
* The table below is used to map from the name of a predefined cursor
- * to its resource identifier.
+ * to a NSCursor.
*/
struct CursorName {
const char *name;
- int id;
-};
-
-static struct CursorName noneCursorName = {"none", 0};
-
-static struct CursorName themeCursorNames[] = {
- {"arrow", kThemeArrowCursor},
- {"copyarrow", kThemeCopyArrowCursor},
- {"aliasarrow", kThemeAliasArrowCursor},
- {"contextualmenuarrow", kThemeContextualMenuArrowCursor},
- {"ibeam", kThemeIBeamCursor},
- {"text", kThemeIBeamCursor},
- {"xterm", kThemeIBeamCursor},
- {"cross", kThemeCrossCursor},
- {"crosshair", kThemeCrossCursor},
- {"cross-hair", kThemeCrossCursor},
- {"plus", kThemePlusCursor},
- {"closedhand", kThemeClosedHandCursor},
- {"openhand", kThemeOpenHandCursor},
- {"pointinghand", kThemePointingHandCursor},
- {"resizeleft", kThemeResizeLeftCursor},
- {"resizeright", kThemeResizeRightCursor},
- {"resizeleftright", kThemeResizeLeftRightCursor},
- {"resizeup", kThemeResizeUpCursor},
- {"resizedown", kThemeResizeDownCursor},
- {"resizeupdown", kThemeResizeUpDownCursor},
- {"notallowed", kThemeNotAllowedCursor},
- {"poof", kThemePoofCursor},
- {NULL, 0}
+ const int kind;
+ id id1, id2;
+ NSPoint hotspot;
};
-static struct CursorName animatedThemeCursorNames[] = {
- {"watch", kThemeWatchCursor},
- {"countinguphand", kThemeCountingUpHandCursor},
- {"countingdownhand", kThemeCountingDownHandCursor},
- {"countingupanddownhand", kThemeCountingUpAndDownHandCursor},
- {"spinning", kThemeSpinningCursor},
- {NULL, 0}
+#define MacCursorData(n) ((id)tkMacOSXCursors[TK_MAC_CURSOR_##n])
+#define MacXCursorData(n) ((id)tkMacOSXXCursors[TK_MAC_XCURSOR_##n])
+
+static const struct CursorName cursorNames[] = {
+ {"none", NONE, nil},
+ {"arrow", SELECTOR, @"arrowCursor"},
+ {"top_left_arrow", SELECTOR, @"arrowCursor"},
+ {"left_ptr", SELECTOR, @"arrowCursor"},
+ {"copyarrow", SELECTOR, @"dragCopyCursor", @"_copyDragCursor"},
+ {"aliasarrow", SELECTOR, @"dragLinkCursor", @"_linkDragCursor"},
+ {"contextualmenuarrow", SELECTOR, @"contextualMenuCursor"},
+ {"movearrow", SELECTOR, @"_moveCursor"},
+ {"ibeam", SELECTOR, @"IBeamCursor"},
+ {"text", SELECTOR, @"IBeamCursor"},
+ {"xterm", SELECTOR, @"IBeamCursor"},
+ {"cross", SELECTOR, @"crosshairCursor"},
+ {"crosshair", SELECTOR, @"crosshairCursor"},
+ {"cross-hair", SELECTOR, @"crosshairCursor"},
+ {"tcross", SELECTOR, @"crosshairCursor"},
+ {"hand", SELECTOR, @"openHandCursor"},
+ {"openhand", SELECTOR, @"openHandCursor"},
+ {"closedhand", SELECTOR, @"closedHandCursor"},
+ {"fist", SELECTOR, @"closedHandCursor"},
+ {"pointinghand", SELECTOR, @"pointingHandCursor"},
+ {"resize", SELECTOR, @"arrowCursor"},
+ {"resizeleft", SELECTOR, @"resizeLeftCursor"},
+ {"resizeright", SELECTOR, @"resizeRightCursor"},
+ {"resizeleftright", SELECTOR, @"resizeLeftRightCursor"},
+ {"resizeup", SELECTOR, @"resizeUpCursor"},
+ {"resizedown", SELECTOR, @"resizeDownCursor"},
+ {"resizeupdown", SELECTOR, @"resizeUpDownCursor"},
+ {"resizebottomleft", SELECTOR, @"_bottomLeftResizeCursor"},
+ {"resizetopleft", SELECTOR, @"_topLeftResizeCursor"},
+ {"resizebottomright", SELECTOR, @"_bottomRightResizeCursor"},
+ {"resizetopright", SELECTOR, @"_topRightResizeCursor"},
+ {"notallowed", SELECTOR, @"operationNotAllowedCursor"},
+ {"poof", SELECTOR, @"disappearingItemCursor"},
+ {"wait", SELECTOR, @"busyButClickableCursor"},
+ {"spinning", SELECTOR, @"busyButClickableCursor"},
+ {"countinguphand", SELECTOR, @"busyButClickableCursor"},
+ {"countingdownhand", SELECTOR, @"busyButClickableCursor"},
+ {"countingupanddownhand", SELECTOR, @"busyButClickableCursor"},
+ {"help", IMAGENAMED, @"NSHelpCursor", nil, {8, 8}},
+// {"hand", IMAGEBITMAP, MacCursorData(hand)},
+ {"bucket", IMAGEBITMAP, MacCursorData(bucket)},
+ {"cancel", IMAGEBITMAP, MacCursorData(cancel)},
+// {"resize", IMAGEBITMAP, MacCursorData(resize)},
+ {"eyedrop", IMAGEBITMAP, MacCursorData(eyedrop)},
+ {"eyedrop-full", IMAGEBITMAP, MacCursorData(eyedrop_full)},
+ {"zoom-in", IMAGEBITMAP, MacCursorData(zoom_in)},
+ {"zoom-out", IMAGEBITMAP, MacCursorData(zoom_out)},
+ {"X_cursor", IMAGEBITMAP, MacXCursorData(X_cursor)},
+// {"arrow", IMAGEBITMAP, MacXCursorData(arrow)},
+ {"based_arrow_down", IMAGEBITMAP, MacXCursorData(based_arrow_down)},
+ {"based_arrow_up", IMAGEBITMAP, MacXCursorData(based_arrow_up)},
+ {"boat", IMAGEBITMAP, MacXCursorData(boat)},
+ {"bogosity", IMAGEBITMAP, MacXCursorData(bogosity)},
+ {"bottom_left_corner", IMAGEBITMAP, MacXCursorData(bottom_left_corner)},
+ {"bottom_right_corner", IMAGEBITMAP, MacXCursorData(bottom_right_corner)},
+ {"bottom_side", IMAGEBITMAP, MacXCursorData(bottom_side)},
+ {"bottom_tee", IMAGEBITMAP, MacXCursorData(bottom_tee)},
+ {"box_spiral", IMAGEBITMAP, MacXCursorData(box_spiral)},
+ {"center_ptr", IMAGEBITMAP, MacXCursorData(center_ptr)},
+ {"circle", IMAGEBITMAP, MacXCursorData(circle)},
+ {"clock", IMAGEBITMAP, MacXCursorData(clock)},
+ {"coffee_mug", IMAGEBITMAP, MacXCursorData(coffee_mug)},
+// {"cross", IMAGEBITMAP, MacXCursorData(cross)},
+ {"cross_reverse", IMAGEBITMAP, MacXCursorData(cross_reverse)},
+// {"crosshair", IMAGEBITMAP, MacXCursorData(crosshair)},
+ {"diamond_cross", IMAGEBITMAP, MacXCursorData(diamond_cross)},
+ {"dot", IMAGEBITMAP, MacXCursorData(dot)},
+ {"dotbox", IMAGEBITMAP, MacXCursorData(dotbox)},
+ {"double_arrow", IMAGEBITMAP, MacXCursorData(double_arrow)},
+ {"draft_large", IMAGEBITMAP, MacXCursorData(draft_large)},
+ {"draft_small", IMAGEBITMAP, MacXCursorData(draft_small)},
+ {"draped_box", IMAGEBITMAP, MacXCursorData(draped_box)},
+ {"exchange", IMAGEBITMAP, MacXCursorData(exchange)},
+ {"fleur", IMAGEBITMAP, MacXCursorData(fleur)},
+ {"gobbler", IMAGEBITMAP, MacXCursorData(gobbler)},
+ {"gumby", IMAGEBITMAP, MacXCursorData(gumby)},
+ {"hand1", IMAGEBITMAP, MacXCursorData(hand1)},
+ {"hand2", IMAGEBITMAP, MacXCursorData(hand2)},
+ {"heart", IMAGEBITMAP, MacXCursorData(heart)},
+ {"icon", IMAGEBITMAP, MacXCursorData(icon)},
+ {"iron_cross", IMAGEBITMAP, MacXCursorData(iron_cross)},
+// {"left_ptr", IMAGEBITMAP, MacXCursorData(left_ptr)},
+ {"left_side", IMAGEBITMAP, MacXCursorData(left_side)},
+ {"left_tee", IMAGEBITMAP, MacXCursorData(left_tee)},
+ {"leftbutton", IMAGEBITMAP, MacXCursorData(leftbutton)},
+ {"ll_angle", IMAGEBITMAP, MacXCursorData(ll_angle)},
+ {"lr_angle", IMAGEBITMAP, MacXCursorData(lr_angle)},
+ {"man", IMAGEBITMAP, MacXCursorData(man)},
+ {"middlebutton", IMAGEBITMAP, MacXCursorData(middlebutton)},
+ {"mouse", IMAGEBITMAP, MacXCursorData(mouse)},
+ {"pencil", IMAGEBITMAP, MacXCursorData(pencil)},
+ {"pirate", IMAGEBITMAP, MacXCursorData(pirate)},
+ {"plus", IMAGEBITMAP, MacXCursorData(plus)},
+ {"question_arrow", IMAGEBITMAP, MacXCursorData(question_arrow)},
+ {"right_ptr", IMAGEBITMAP, MacXCursorData(right_ptr)},
+ {"right_side", IMAGEBITMAP, MacXCursorData(right_side)},
+ {"right_tee", IMAGEBITMAP, MacXCursorData(right_tee)},
+ {"rightbutton", IMAGEBITMAP, MacXCursorData(rightbutton)},
+ {"rtl_logo", IMAGEBITMAP, MacXCursorData(rtl_logo)},
+ {"sailboat", IMAGEBITMAP, MacXCursorData(sailboat)},
+ {"sb_down_arrow", IMAGEBITMAP, MacXCursorData(sb_down_arrow)},
+ {"sb_h_double_arrow", IMAGEBITMAP, MacXCursorData(sb_h_double_arrow)},
+ {"sb_left_arrow", IMAGEBITMAP, MacXCursorData(sb_left_arrow)},
+ {"sb_right_arrow", IMAGEBITMAP, MacXCursorData(sb_right_arrow)},
+ {"sb_up_arrow", IMAGEBITMAP, MacXCursorData(sb_up_arrow)},
+ {"sb_v_double_arrow", IMAGEBITMAP, MacXCursorData(sb_v_double_arrow)},
+ {"shuttle", IMAGEBITMAP, MacXCursorData(shuttle)},
+ {"sizing", IMAGEBITMAP, MacXCursorData(sizing)},
+ {"spider", IMAGEBITMAP, MacXCursorData(spider)},
+ {"spraycan", IMAGEBITMAP, MacXCursorData(spraycan)},
+ {"star", IMAGEBITMAP, MacXCursorData(star)},
+ {"target", IMAGEBITMAP, MacXCursorData(target)},
+// {"tcross", IMAGEBITMAP, MacXCursorData(tcross)},
+// {"top_left_arrow", IMAGEBITMAP, MacXCursorData(top_left_arrow)},
+ {"top_left_corner", IMAGEBITMAP, MacXCursorData(top_left_corner)},
+ {"top_right_corner", IMAGEBITMAP, MacXCursorData(top_right_corner)},
+ {"top_side", IMAGEBITMAP, MacXCursorData(top_side)},
+ {"top_tee", IMAGEBITMAP, MacXCursorData(top_tee)},
+ {"trek", IMAGEBITMAP, MacXCursorData(trek)},
+ {"ul_angle", IMAGEBITMAP, MacXCursorData(ul_angle)},
+ {"umbrella", IMAGEBITMAP, MacXCursorData(umbrella)},
+ {"ur_angle", IMAGEBITMAP, MacXCursorData(ur_angle)},
+ {"watch", IMAGEBITMAP, MacXCursorData(watch)},
+// {"xterm", IMAGEBITMAP, MacXCursorData(xterm)},
+ {NULL}
};
/*
@@ -116,9 +209,8 @@ static void FindCursorByName(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.
+ * structure. If the cursor cannot be found, the macCursor field
+ * will be nil.
*
* Results:
* Fills the macCursorPtr record.
@@ -132,41 +224,127 @@ static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string);
void
FindCursorByName(
TkMacOSXCursor *macCursorPtr,
- const char *string)
+ const char *name)
{
- Handle resource;
- Str255 curName;
- int destWrote, inCurLen;
- Tcl_Encoding encoding;
+ NSString *path = nil;
+ NSImage *image = nil;
+ NSPoint hotSpot = NSZeroPoint;
+ int haveHotSpot = 0, result = TCL_ERROR;
+ NSCursor *macCursor = nil;
- inCurLen = strlen(string);
- if (inCurLen > 255) {
- return;
- }
-
- /*
- * macRoman is the encoding that the resource fork uses.
- */
+ if (name[0] == '@') {
+ /*
+ * System cursor of type @filename
+ */
- encoding = Tcl_GetEncoding(NULL, "macRoman");
- Tcl_UtfToExternal(NULL, encoding, string, inCurLen, 0, NULL,
- (char *) &curName[1], 255, NULL, &destWrote, NULL);
- curName[0] = destWrote;
- Tcl_FreeEncoding(encoding);
-
- resource = GetNamedResource('crsr', curName);
- if (resource) {
- short id;
- Str255 theName;
- ResType theType;
-
- GetResInfo(resource, &id, &theType, theName);
- macCursorPtr->macCursor = (Handle) GetCCursor(id);
- macCursorPtr->type = COLOR;
+ macCursorPtr->type = IMAGEPATH;
+ path = [NSString stringWithUTF8String:&name[1]];
} else {
- macCursorPtr->macCursor = GetNamedResource('CURS', curName);
- macCursorPtr->type = NORMAL;
+ Tcl_Obj *strPtr = Tcl_NewStringObj(name, -1);
+ int idx;
+
+ result = Tcl_GetIndexFromObjStruct(NULL, strPtr, cursorNames,
+ sizeof(struct CursorName), NULL, TCL_EXACT, &idx);
+ Tcl_DecrRefCount(strPtr);
+ if (result == TCL_OK) {
+ macCursorPtr->type = cursorNames[idx].kind;
+ switch (cursorNames[idx].kind) {
+ case SELECTOR: {
+ SEL selector = NSSelectorFromString(cursorNames[idx].id1);
+ if ([NSCursor respondsToSelector:selector]) {
+ macCursor = [[NSCursor performSelector:selector] retain];
+ } else if (cursorNames[idx].id2) {
+ selector = NSSelectorFromString(cursorNames[idx].id2);
+ if ([NSCursor respondsToSelector:selector]) {
+ macCursor = [[NSCursor performSelector:selector] retain];
+ }
+ }
+ break;
+ }
+ case IMAGENAMED:
+ image = [[NSImage imageNamed:cursorNames[idx].id1] retain];
+ hotSpot = cursorNames[idx].hotspot;
+ haveHotSpot = 1;
+ break;
+ case IMAGEPATH:
+ path = [NSApp tkFrameworkImagePath:cursorNames[idx].id1];
+ break;
+ case IMAGEBITMAP: {
+ unsigned char *bitmap = (unsigned char *)(cursorNames[idx].id1);
+ NSBitmapImageRep *bitmapImageRep = NULL;
+ CGImageRef img = NULL, mask = NULL, maskedImg = NULL;
+ static const CGFloat decodeWB[] = {1, 0};
+ CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(
+ kCGColorSpaceGenericGray);
+ CGDataProviderRef provider = CGDataProviderCreateWithData(NULL,
+ bitmap, pix*pix/8, NULL);
+ if (provider) {
+ img = CGImageCreate(pix, pix, 1, 1, pix/8, colorspace,
+ kCGBitmapByteOrderDefault, provider, decodeWB, 0,
+ kCGRenderingIntentDefault);
+ CFRelease(provider);
+ }
+ provider = CGDataProviderCreateWithData(NULL, bitmap +
+ pix*pix/8, pix*pix/8, NULL);
+ if (provider) {
+ mask = CGImageMaskCreate(pix, pix, 1, 1, pix/8, provider,
+ decodeWB, 0);
+ CFRelease(provider);
+ }
+ if (img && mask) {
+ maskedImg = CGImageCreateWithMask(img, mask);
+ }
+ if (maskedImg) {
+ bitmapImageRep = [[NSBitmapImageRep alloc]
+ initWithCGImage:maskedImg];
+ CFRelease(maskedImg);
+ }
+ if (mask) { CFRelease(mask); }
+ if (img) { CFRelease(img); }
+ if (colorspace) { CFRelease(colorspace); }
+ if (bitmapImageRep) {
+ image = [[NSImage alloc] initWithSize:NSMakeSize(pix, pix)];
+ [image addRepresentation:bitmapImageRep];
+ [bitmapImageRep release];
+ }
+ uint16_t *hotSpotData = (uint16_t*)(bitmap + 2*pix*pix/8);
+ hotSpot.y = CFSwapInt16BigToHost(*hotSpotData++);
+ hotSpot.x = CFSwapInt16BigToHost(*hotSpotData);
+ haveHotSpot = 1;
+ break;
+ }
+ }
+ }
+ }
+ if (path) {
+ image = [[NSImage alloc] initWithContentsOfFile:path];
}
+ if (!image && !macCursor && result != TCL_OK) {
+ macCursorPtr->type = IMAGENAMED;
+ image = [[NSImage imageNamed:[NSString stringWithUTF8String:name]]
+ retain];
+ haveHotSpot = 0;
+ }
+ if (image) {
+ if (!haveHotSpot && [[path pathExtension] isEqualToString:@"cur"]) {
+ NSData *data = [NSData dataWithContentsOfFile:path];
+ if ([data length] > 14) {
+ uint16_t *hotSpotData = (uint16_t*)((char*) [data bytes] + 10);
+ hotSpot.x = CFSwapInt16LittleToHost(*hotSpotData++);
+ hotSpot.y = CFSwapInt16LittleToHost(*hotSpotData);
+ haveHotSpot = 1;
+ }
+ }
+ if (!haveHotSpot) {
+ NSSize size = [image size];
+ hotSpot.x = size.width * 0.5;
+ hotSpot.y = size.height * 0.5;
+ }
+ hotSpot.y = -hotSpot.y;
+ macCursor = [[NSCursor alloc] initWithImage:image hotSpot:hotSpot];
+ [image release];
+ }
+ macCursorPtr->macCursor = TkMacOSXMakeUncollectable(macCursor);
}
/*
@@ -192,81 +370,32 @@ TkGetCursorByName(
Tk_Uid string) /* Description of cursor. See manual entry
* for details on legal syntax. */
{
- struct CursorName *namePtr;
- TkMacOSXCursor *macCursorPtr;
- int count = -1;
-
- macCursorPtr = (TkMacOSXCursor *) ckalloc(sizeof(TkMacOSXCursor));
- macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr;
+ TkMacOSXCursor *macCursorPtr = NULL;
+ const char **argv = NULL;
+ int argc;
/*
- * 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.
+ * All cursor names are valid lists of one element (for
+ * TkX11-compatibility), even unadorned system cursor names.
*/
- if (strcmp(noneCursorName.name, string) == 0) {
- namePtr = &noneCursorName;
- macCursorPtr->type = NONE;
- } else {
- for (namePtr = themeCursorNames; namePtr->name != NULL; namePtr++) {
- if (strcmp(namePtr->name, string) == 0) {
- macCursorPtr->type = THEME;
- break;
- }
+ if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK) {
+ if (argc) {
+ macCursorPtr = ckalloc(sizeof(TkMacOSXCursor));
+ macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr;
+ macCursorPtr->macCursor = nil;
+ macCursorPtr->type = 0;
+ FindCursorByName(macCursorPtr, argv[0]);
}
+ ckfree(argv);
}
-
- if (namePtr->name == NULL) {
- for (namePtr = animatedThemeCursorNames;
- namePtr->name != NULL; namePtr++) {
- int namelen = strlen(namePtr->name);
-
- if (strncmp(namePtr->name, string, namelen) == 0) {
- const char *numPtr = string + namelen;
-
- if (*numPtr) {
- int result = Tcl_GetInt(NULL, numPtr, &count);
-
- if (result != TCL_OK) {
- continue;
- }
- }
- macCursorPtr->type = ANIMATED;
- break;
- }
- }
- }
-
- if (namePtr->name != NULL) {
- macCursorPtr->macCursor = (Handle) namePtr;
- macCursorPtr->count = count;
- } else {
- FindCursorByName(macCursorPtr, string);
-
- if (macCursorPtr->macCursor == NULL) {
- const char **argv;
- int argc;
-
- /*
- * 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.
- */
-
- if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK ) {
- if (argc > 1) {
- FindCursorByName(macCursorPtr, argv[0]);
- }
- ckfree((char *) argv);
- }
- }
- }
-
- if (macCursorPtr->macCursor == NULL) {
- ckfree((char *)macCursorPtr);
+ if (!macCursorPtr || (!macCursorPtr->macCursor &&
+ macCursorPtr->type != NONE)) {
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
- return NULL;
+ if (macCursorPtr) {
+ ckfree(macCursorPtr);
+ macCursorPtr = NULL;
+ }
}
return (TkCursor *) macCursorPtr;
}
@@ -290,8 +419,8 @@ TkGetCursorByName(
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. */
+ 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. */
@@ -323,15 +452,7 @@ TkpFreeCursor(
{
TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr;
- switch (macCursorPtr->type) {
- case COLOR:
- DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor);
- break;
- case NORMAL:
- ReleaseResource(macCursorPtr->macCursor);
- break;
- }
-
+ TkMacOSXMakeCollectableAndRelease(macCursorPtr->macCursor);
if (macCursorPtr == gCurrentCursor) {
gCurrentCursor = NULL;
}
@@ -359,59 +480,34 @@ TkMacOSXInstallCursor(
int resizeOverride)
{
TkMacOSXCursor *macCursorPtr = gCurrentCursor;
- CCrsrHandle ccursor;
- CursHandle cursor;
- static unsigned int cursorStep = 0;
static int cursorHidden = 0;
int cursorNone = 0;
gResizeOverride = resizeOverride;
- if (resizeOverride) {
- cursor = (CursHandle) GetNamedResource('CURS', "\presize");
- if (cursor) {
- SetCursor(*cursor);
- } else {
- TkMacOSXDbgMsg("Resize cursor failed: %d", ResError());
- }
- } else if (macCursorPtr == NULL) {
- SetThemeCursor(kThemeArrowCursor);
+ if (resizeOverride || !macCursorPtr) {
+ [[NSCursor arrowCursor] set];
} else {
- struct CursorName *namePtr;
-
switch (macCursorPtr->type) {
case NONE:
if (!cursorHidden) {
cursorHidden = 1;
- HideCursor();
+ [NSCursor hide];
}
cursorNone = 1;
break;
- case THEME:
- namePtr = (struct CursorName *) macCursorPtr->macCursor;
- SetThemeCursor(namePtr->id);
- break;
- case ANIMATED:
- namePtr = (struct CursorName *) macCursorPtr->macCursor;
- if (macCursorPtr->count == -1) {
- SetAnimatedThemeCursor(namePtr->id, cursorStep++);
- } else {
- SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count);
- }
- break;
- case COLOR:
- ccursor = (CCrsrHandle) macCursorPtr->macCursor;
- SetCCursor(ccursor);
- break;
- case NORMAL:
- cursor = (CursHandle) macCursorPtr->macCursor;
- SetCursor(*cursor);
+ case SELECTOR:
+ case IMAGENAMED:
+ case IMAGEPATH:
+ case IMAGEBITMAP:
+ default:
+ [macCursorPtr->macCursor set];
break;
}
}
if (cursorHidden && !cursorNone) {
cursorHidden = 0;
- ShowCursor();
+ [NSCursor unhide];
}
}
@@ -485,3 +581,12 @@ Tk_MacOSXTkOwnsCursor(
{
gTkOwnsCursor = tkOwnsIt;
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXCursors.h b/macosx/tkMacOSXCursors.h
new file mode 100644
index 0000000..2cf00fb
--- /dev/null
+++ b/macosx/tkMacOSXCursors.h
@@ -0,0 +1,89 @@
+/*
+ * tkMacOSXCursors.h --
+ *
+ * This file defines a set of Macintosh cursor resources that
+ * are only available on the Macintosh platform.
+ *
+ * Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright 2008-2009, Apple Inc.
+ * Copyright (c) 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+static const unsigned char tkMacOSXCursors[][68] = {
+
+#define TK_MAC_CURSOR_hand 0
+[TK_MAC_CURSOR_hand] = {
+ 0x01, 0x80, 0x1A, 0x70, 0x26, 0x48, 0x26, 0x4A, 0x12, 0x4D, 0x12, 0x49, 0x68, 0x09, 0x98, 0x01,
+ 0x88, 0x02, 0x40, 0x02, 0x20, 0x02, 0x20, 0x04, 0x10, 0x04, 0x08, 0x08, 0x04, 0x08, 0x04, 0x08,
+ 0x01, 0x80, 0x1B, 0xF0, 0x3F, 0xF8, 0x3F, 0xFA, 0x1F, 0xFF, 0x1F, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFE, 0x7F, 0xFE, 0x3F, 0xFE, 0x3F, 0xFC, 0x1F, 0xFC, 0x0F, 0xF8, 0x07, 0xF8, 0x07, 0xF8,
+ 0x00, 0x09, 0x00, 0x08,
+},
+
+#define TK_MAC_CURSOR_bucket 2
+[TK_MAC_CURSOR_bucket] = {
+ 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x80, 0x09, 0x40, 0x0B, 0x30, 0x0D, 0x18, 0x09, 0x0C,
+ 0x12, 0x9C, 0x21, 0x2C, 0x10, 0x4C, 0x08, 0x8C, 0x05, 0x0C, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x09, 0x80, 0x09, 0xC0, 0x0B, 0xF0, 0x0F, 0xF8, 0x0F, 0xFC,
+ 0x1F, 0xFC, 0x3F, 0xEC, 0x1F, 0xCC, 0x0F, 0x8C, 0x07, 0x0C, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0D, 0x00, 0x0C,
+},
+
+#define TK_MAC_CURSOR_cancel 3
+[TK_MAC_CURSOR_cancel] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x80, 0x4A, 0x40, 0x4A, 0x40, 0x3F, 0x80,
+ 0x0A, 0x00, 0x3F, 0x80, 0x4A, 0x40, 0x4A, 0x46, 0x31, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x80, 0x7B, 0xC0, 0xFF, 0xE0, 0xFF, 0xE0, 0x7F, 0xC0,
+ 0x3F, 0x80, 0x7F, 0xC0, 0xFF, 0xE6, 0xFF, 0xEF, 0x7B, 0xCF, 0x31, 0x86, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x05,
+},
+
+#define TK_MAC_CURSOR_resize 4
+[TK_MAC_CURSOR_resize] = {
+ 0xFF, 0xFF, 0x80, 0x01, 0xBF, 0x01, 0xA1, 0x81, 0xA1, 0xF9, 0xA1, 0x8D, 0xA1, 0x8D, 0xBF, 0x8D,
+ 0x9F, 0x8D, 0x88, 0x0D, 0x88, 0x0D, 0x88, 0x0D, 0x8F, 0xFD, 0x87, 0xFD, 0x80, 0x01, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x08, 0x00, 0x08,
+},
+
+#define TK_MAC_CURSOR_eyedrop 5
+[TK_MAC_CURSOR_eyedrop] = {
+ 0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xB8, 0x01, 0x18, 0x02, 0x28,
+ 0x04, 0x40, 0x08, 0x80, 0x11, 0x00, 0x22, 0x00, 0x44, 0x00, 0x48, 0x00, 0xB0, 0x00, 0x40, 0x00,
+ 0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xF8, 0x01, 0xF8, 0x03, 0xE8,
+ 0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
+ 0x00, 0x0F, 0x00, 0x00,
+},
+
+#define TK_MAC_CURSOR_eyedrop_full 6
+[TK_MAC_CURSOR_eyedrop_full] = {
+ 0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xB8, 0x01, 0x18, 0x03, 0x28,
+ 0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
+ 0x00, 0x0E, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0xFF, 0x00, 0x7E, 0x00, 0xF8, 0x01, 0xF8, 0x03, 0xE8,
+ 0x07, 0xC0, 0x0F, 0x80, 0x1F, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x40, 0x00,
+ 0x00, 0x0F, 0x00, 0x00,
+},
+
+#define TK_MAC_CURSOR_zoom_in 7
+[TK_MAC_CURSOR_zoom_in] = {
+ 0x07, 0x80, 0x18, 0x60, 0x27, 0x90, 0x58, 0x68, 0x53, 0x28, 0xA3, 0x14, 0xAF, 0xD4, 0xAF, 0xD4,
+ 0xA3, 0x14, 0x53, 0x28, 0x58, 0x68, 0x27, 0x98, 0x18, 0x7C, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
+ 0x07, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x78, 0x78, 0x73, 0x38, 0xE3, 0x1C, 0xEF, 0xDC, 0xEF, 0xDC,
+ 0xE3, 0x1C, 0x73, 0x38, 0x78, 0x78, 0x3F, 0xF8, 0x1F, 0xFC, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_CURSOR_zoom_out 8
+[TK_MAC_CURSOR_zoom_out] = {
+ 0x07, 0x80, 0x18, 0x60, 0x27, 0x90, 0x58, 0x68, 0x50, 0x28, 0xA0, 0x14, 0xAF, 0xD4, 0xAF, 0xD4,
+ 0xA0, 0x14, 0x50, 0x28, 0x58, 0x68, 0x27, 0x98, 0x18, 0x7C, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
+ 0x07, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x78, 0x78, 0x70, 0x38, 0xE0, 0x1C, 0xEF, 0xDC, 0xEF, 0xDC,
+ 0xE0, 0x1C, 0x70, 0x38, 0x78, 0x78, 0x3F, 0xF8, 0x1F, 0xFC, 0x07, 0x8E, 0x00, 0x07, 0x00, 0x03,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+};
diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c
index 9d1ebf6..6009f09 100644
--- a/macosx/tkMacOSXDebug.c
+++ b/macosx/tkMacOSXDebug.c
@@ -1,58 +1,14 @@
/*
* tkMacOSXDebug.c --
*
- * Implementation of Macintosh specific functions for debugging MacOS events,
- * regions, etc...
+ * Implementation of Macintosh specific functions for debugging MacOS
+ * events, regions, etc...
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
@@ -60,423 +16,6 @@
#ifdef TK_MAC_DEBUG
-typedef struct {
- EventKind kind;
- const 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}
-};
-
-#ifdef TK_MACOSXDEBUG_UNUSED
-static 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 }
-};
-#endif /* TK_MACOSXDEBUG_UNUSED */
-
-MODULE_SCOPE char *
-TkMacOSXCarbonEventToAscii(EventRef eventRef)
-{
- EventClass eventClass;
- EventKind eventKind;
- MyEventNameList * list = eventNameList;
- MyEventName * names = NULL;
- static char str[256];
- char *buf = str;
- int *iPtr = (int*)str;
- 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++;
- }
- }
- while (names && names->name) {
- if (eventKind == names->kind) {
- snprintf(buf, 250, "%-20s", names->name);
- break;
- } else {
- names++;
- }
- }
- if (!found) {
- snprintf(buf, 250, "%-20d", eventKind);
- }
- return str;
-}
-
-#ifdef TK_MACOSXDEBUG_UNUSED
-MODULE_SCOPE char *
-TkMacOSXCarbonEventKindToAscii(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;
-}
-
-MODULE_SCOPE char *
-TkMacOSXClassicEventToAscii(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;
-
-}
-
-MODULE_SCOPE void
-TkMacOSXPrintPoint(char * tag, Point * p )
-{
- TkMacOSXDbgMsg("%s %4d %4d", tag,p->h,p->v );
-}
-
-MODULE_SCOPE void
-TkMacOSXPrintRect(char * tag, Rect * r )
-{
- TkMacOSXDbgMsg("%s %4d %4d %4d %4d (%dx%d)",
- tag, r->left, r->top, r->right, r->bottom,
- r->right - r->left + 1, r->bottom - r->top + 1);
-}
-
-MODULE_SCOPE void
-TkMacOSXPrintRegion(char * tag, RgnHandle rgn )
-{
- Rect r;
- GetRegionBounds(rgn,&r);
- TkMacOSXPrintRect(tag,&r);
-}
-
-MODULE_SCOPE void
-TkMacOSXPrintWindowTitle(char * tag, WindowRef window )
-{
- Str255 title;
- GetWTitle(window,title);
- title [title[0] + 1] = 0;
- TkMacOSXDbgMsg("%s %s", tag, title +1 );
-}
-
-typedef struct {
- int msg;
- char * name;
-} MsgName;
-
-static MsgName msgNames [] = {
- { kMenuDrawMsg, "Draw"},
- { kMenuSizeMsg, "Size"},
- { kMenuPopUpMsg, "PopUp"},
- { kMenuCalcItemMsg, "CalcItem" },
- { kMenuThemeSavvyMsg, "ThemeSavvy"},
- { kMenuInitMsg, "Init" },
- { kMenuDisposeMsg, "Dispose" },
- { kMenuFindItemMsg, "FindItem" },
- { kMenuHiliteItemMsg, "HiliteItem" },
- { kMenuDrawItemsMsg, "DrawItems" },
- { -1, NULL }
-};
-
-MODULE_SCOPE 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;
-}
-
-static MsgName trackingNames [] = {
- { kMouseTrackingMousePressed , "MousePressed " },
- { kMouseTrackingMouseReleased , "MouseReleased " },
- { kMouseTrackingMouseExited , "MouseExited " },
- { kMouseTrackingMouseEntered , "MouseEntered " },
- { kMouseTrackingMouseMoved , "MouseMoved " },
- { kMouseTrackingKeyModifiersChanged, "KeyModifiersChanged" },
- { kMouseTrackingUserCancelled , "UserCancelled " },
- { kMouseTrackingTimedOut , "TimedOut " },
- { -1, NULL }
-};
-
-MODULE_SCOPE char *
-TkMacOSXMouseTrackingResultToAscii(MouseTrackingResult r, char * buf)
-{
- 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;
-}
-#endif /* TK_MACOSXDEBUG_UNUSED */
-
-MODULE_SCOPE void
-TkMacOSXDebugFlashRegion(
- Drawable d,
- HIShapeRef rgn)
-{
- TkMacOSXInitNamedDebugSymbol(HIToolbox, int, QDDebugFlashRegion,
- CGrafPtr port, RgnHandle region);
- CFShow(rgn);
- if (d && rgn && QDDebugFlashRegion && !HIShapeIsEmpty(rgn)) {
- CGrafPtr port = TkMacOSXGetDrawablePort(d);
-
- if (port) {
- static RgnHandle qdRgn = NULL;
-
- if (!qdRgn) {
- qdRgn = NewRgn();
- }
- ChkErr(HIShapeGetAsQDRgn, rgn, qdRgn);
-
- /*
- * Carbon-internal region flashing SPI (c.f. Technote 2124)
- */
-
- QDDebugFlashRegion(port, qdRgn);
- SetEmptyRgn(qdRgn);
- }
- }
-}
-
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
@@ -485,19 +24,17 @@ TkMacOSXDebugFlashRegion(
*
* TkMacOSXGetNamedDebugSymbol --
*
+ * Dynamically acquire address of a named symbol from a loaded dynamic
+ * library, so that we can use API that may not be available on all OS
+ * versions. For debugging purposes, if we cannot find the symbol with
+ * the usual dynamic library APIs, we manually walk the symbol table of
+ * the loaded library. This allows access to unexported symbols such as
+ * private_extern internal debugging functions. If module is NULL or the
+ * empty string, search all loaded libraries (could be very expensive and
+ * should be avoided).
*
- * Dynamically acquire address of a named symbol from a loaded
- * dynamic library, so that we can use API that may not be
- * available on all OS versions.
- * For debugging purposes, if we cannot find the symbol with the
- * usual dynamic library APIs, we manually walk the symbol table
- * of the loaded library. This allows access to unexported
- * symbols such as private_extern internal debugging functions.
- * If module is NULL or the empty string, search all loaded
- * libraries (could be very expensive and should be avoided).
- *
- * THIS FUCTION IS ONLY TO BE USED FOR DEBUGGING PURPOSES, IT MAY
- * BREAK UNEXPECTEDLY IN THE FUTURE !
+ * THIS FUCTION IS ONLY TO BE USED FOR DEBUGGING PURPOSES, IT MAY BREAK
+ * UNEXPECTEDLY IN THE FUTURE!
*
* Results:
* Address of given symbol or NULL if unavailable.
@@ -510,10 +47,11 @@ TkMacOSXDebugFlashRegion(
MODULE_SCOPE void *
TkMacOSXGetNamedDebugSymbol(
- const char* module,
- const char* symbol)
+ const char *module,
+ const char *symbol)
{
- void* addr = TkMacOSXGetNamedSymbol(module, symbol);
+ void *addr = TkMacOSXGetNamedSymbol(module, symbol);
+
#ifndef __LP64__
if (!addr) {
const struct mach_header *mh = NULL;
@@ -572,7 +110,7 @@ TkMacOSXGetNamedDebugSymbol(
nsect += ns;
}
} else if (!st && lc->cmd == LC_SYMTAB) {
- st = (struct symtab_command*) lc;
+ st = (struct symtab_command *) lc;
break;
}
lc = (struct load_command *)((char *) lc + lc->cmdsize);
@@ -584,11 +122,14 @@ TkMacOSXGetNamedDebugSymbol(
uint32_t strsize = st->strsize;
int32_t strx;
- /* Offset file positions by difference to actual position
- in memory of last segment before symbol table: */
+ /*
+ * Offset file positions by difference to actual position
+ * in memory of last segment before symbol table:
+ */
+
base = (intptr_t) sg->vmaddr + slide - sg->fileoff;
- strings = (char*)(base + st->stroff);
- sym = (struct nlist*)(base + st->symoff);
+ strings = (char *) (base + st->stroff);
+ sym = (struct nlist *) (base + st->symoff);
m = st->nsyms;
for (j = 0; j < m; j++) {
/* Find symbol with given name in __text section */
@@ -613,5 +154,13 @@ TkMacOSXGetNamedDebugSymbol(
#endif /* __LP64__ */
return addr;
}
-
#endif /* TK_MAC_DEBUG */
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h
index 8dc8109..ab37187 100644
--- a/macosx/tkMacOSXDebug.h
+++ b/macosx/tkMacOSXDebug.h
@@ -4,55 +4,11 @@
* Declarations of Macintosh specific functions for debugging MacOS events,
* regions, etc...
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKMACDEBUG
@@ -64,24 +20,6 @@
#ifdef TK_MAC_DEBUG
-MODULE_SCOPE char* TkMacOSXCarbonEventToAscii(EventRef eventRef);
-
-#ifdef TK_MACOSXDEBUG_UNUSED
-MODULE_SCOPE char* TkMacOSXCarbonEventKindToAscii(EventRef eventRef, char * buf );
-MODULE_SCOPE char* TkMacOSXClassicEventToAscii(EventRecord * eventPtr, char * buf );
-
-MODULE_SCOPE void TkMacOSXPrintRect(char * tag, Rect * r );
-MODULE_SCOPE void TkMacOSXPrintPoint(char * tag, Point * p );
-
-MODULE_SCOPE void TkMacOSXPrintRegion(char * tag, RgnHandle rgn );
-MODULE_SCOPE void TkMacOSXPrintWindowTitle(char * tag, WindowRef window );
-MODULE_SCOPE char* TkMacOSXMenuMessageToAscii(int msg, char * s);
-
-MODULE_SCOPE char* TkMacOSXMouseTrackingResultToAscii(MouseTrackingResult r, char * buf );
-#endif
-
-MODULE_SCOPE void TkMacOSXDebugFlashRegion(Drawable d, HIShapeRef rgn);
-
MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
/* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h
index f969064..8565cdb 100644
--- a/macosx/tkMacOSXDefault.h
+++ b/macosx/tkMacOSXDefault.h
@@ -6,8 +6,8 @@
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,6 +16,10 @@
#ifndef _TKMACDEFAULT
#define _TKMACDEFAULT
+#ifndef TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+#define TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS 1
+#endif
+
/*
* The definitions below provide symbolic names for the default colors.
* NORMAL_BG - Normal background color.
@@ -27,17 +31,17 @@
* DISABLED - Foreground color when widget is disabled.
*/
-#define BLACK "Black"
-#define WHITE "White"
-#define NORMAL_BG "systemWindowBody"
-#define ACTIVE_BG "systemButtonFacePressed"
-#define ACTIVE_FG "systemPushButtonPressedText"
-#define SELECT_BG "systemHighlight"
-#define SELECT_FG None
-#define INACTIVE_SELECT_BG "systemHighlightSecondary"
-#define TROUGH "#c3c3c3"
-#define INDICATOR "#b03060"
-#define DISABLED "#a3a3a3"
+#define BLACK "Black"
+#define WHITE "White"
+#define NORMAL_BG "systemWindowBody"
+#define ACTIVE_BG "systemButtonFacePressed"
+#define ACTIVE_FG "systemPushButtonPressedText"
+#define SELECT_BG "systemHighlight"
+#define SELECT_FG None
+#define INACTIVE_SELECT_BG "systemHighlightSecondary"
+#define TROUGH "#c3c3c3"
+#define INDICATOR "#b03060"
+#define DISABLED "#a3a3a3"
/*
* Defaults for labels, buttons, checkbuttons, and radiobuttons:
@@ -68,17 +72,32 @@
#define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO
#define DEF_BUTTON_HIGHLIGHT "systemButtonFrame"
#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
#define DEF_BUTTON_HIGHLIGHT_WIDTH "4"
-#define DEF_BUTTON_IMAGE (char *) NULL
+#define DEF_BUTTON_HIGHLIGHT_WIDTH_NOCM "1"
+#else
+#define DEF_BUTTON_HIGHLIGHT_WIDTH "1"
+#endif
+#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_TRISTATE_VALUE ""
#define DEF_BUTTON_OVER_RELIEF ""
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
#define DEF_BUTTON_PADX "12"
+#define DEF_BUTTON_PADX_NOCM "1"
+#else
+#define DEF_BUTTON_PADX "1"
+#endif
#define DEF_LABCHKRAD_PADX "1"
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
#define DEF_BUTTON_PADY "3"
+#define DEF_BUTTON_PADY_NOCM "1"
+#else
+#define DEF_BUTTON_PADY "1"
+#endif
#define DEF_LABCHKRAD_PADY "1"
#define DEF_BUTTON_RELIEF "flat"
#define DEF_LABCHKRAD_RELIEF "flat"
@@ -86,10 +105,10 @@
#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_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_TAKE_FOCUS ((char *) NULL)
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
#define DEF_BUTTON_UNDERLINE "-1"
@@ -127,7 +146,7 @@
#define DEF_CANVAS_SELECT_BD_MONO "0"
#define DEF_CANVAS_SELECT_FG_COLOR SELECT_FG
#define DEF_CANVAS_SELECT_FG_MONO WHITE
-#define DEF_CANVAS_TAKE_FOCUS (char *) NULL
+#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"
@@ -183,9 +202,9 @@
#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_SHOW ((char *) NULL)
#define DEF_ENTRY_STATE "normal"
-#define DEF_ENTRY_TAKE_FOCUS (char *) NULL
+#define DEF_ENTRY_TAKE_FOCUS ((char *) NULL)
#define DEF_ENTRY_TEXT_VARIABLE ""
#define DEF_ENTRY_WIDTH "20"
@@ -251,36 +270,36 @@
#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_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_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_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_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_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_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_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_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_SELECT ((char *) NULL)
#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
@@ -311,7 +330,7 @@
*/
#define DEF_MENU_TEAROFF "0"
-#define DEF_MENU_TEAROFF_CMD (char *) NULL
+#define DEF_MENU_TEAROFF_CMD ((char *) NULL)
#define DEF_MENU_TITLE ""
#define DEF_MENU_TYPE "normal"
@@ -339,13 +358,12 @@
#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_IMAGE ((char *) NULL)
+#define DEF_MENUBUTTON_INDICATOR "1"
#define DEF_MENUBUTTON_JUSTIFY "left"
#define DEF_MENUBUTTON_MENU ""
-#define DEF_MENUBUTTON_PADX "4p"
-#define DEF_MENUBUTTON_PADY "3p"
+#define DEF_MENUBUTTON_PADX "4"
+#define DEF_MENUBUTTON_PADY "3"
#define DEF_MENUBUTTON_RELIEF "flat"
#define DEF_MENUBUTTON_STATE "normal"
#define DEF_MENUBUTTON_TAKE_FOCUS "0"
@@ -448,7 +466,7 @@
#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_TAKE_FOCUS ((char *) NULL)
#define DEF_SCALE_TICK_INTERVAL "0"
#define DEF_SCALE_TO "100"
#define DEF_SCALE_VARIABLE ""
@@ -475,7 +493,7 @@
#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_TAKE_FOCUS ((char *) NULL)
#define DEF_SCROLLBAR_TROUGH_COLOR TROUGH
#define DEF_SCROLLBAR_TROUGH_MONO WHITE
#define DEF_SCROLLBAR_WIDTH "15"
@@ -502,6 +520,7 @@
#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_UNFOCUSSED "none"
#define DEF_TEXT_INSERT_WIDTH "1"
#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
@@ -522,7 +541,7 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TABSTYLE "tabular"
-#define DEF_TEXT_TAKE_FOCUS (char *) NULL
+#define DEF_TEXT_TAKE_FOCUS ((char *) NULL)
#define DEF_TEXT_UNDO "0"
#define DEF_TEXT_WIDTH "80"
#define DEF_TEXT_WRAP "char"
@@ -545,4 +564,10 @@
#define DEF_TOPLEVEL_SCREEN ""
#define DEF_TOPLEVEL_USE ""
+/*
+ * Defaults for busy windows (not really used yet):
+ */
+
+#define DEF_BUSY_CURSOR "watch"
+
#endif /* _TKMACDEFAULT */
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index c99cdbc..23b3de5 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -4,106 +4,224 @@
* Contains the Mac implementation of the common dialog boxes.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
#include "tkFileFilter.h"
-#ifndef StrLength
-#define StrLength(s) (*((unsigned char *) (s)))
-#endif
-#ifndef StrBody
-#define StrBody(s) ((char *) (s) + 1)
-#endif
-
-#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
+static const char *const colorOptionStrings[] = {
+ "-initialcolor", "-parent", "-title", NULL
+};
+enum colorOptions {
+ COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
+};
+
+static const char *const openOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-message", "-multiple", "-parent", "-title", "-typevariable",
+ "-command", NULL
+};
+enum openOptions {
+ OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, OPEN_INITFILE,
+ OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE,
+ OPEN_TYPEVARIABLE, OPEN_COMMAND,
+};
+static const char *const saveOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-message", "-parent", "-title", "-typevariable", "-command",
+ "-confirmoverwrite", NULL
+};
+enum saveOptions {
+ SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE,
+ SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, SAVE_COMMAND,
+ SAVE_CONFIRMOW
+};
+static const char *const chooseOptionStrings[] = {
+ "-initialdir", "-message", "-mustexist", "-parent", "-title", "-command",
+ NULL
+};
+enum chooseOptions {
+ CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST, CHOOSE_PARENT,
+ CHOOSE_TITLE, CHOOSE_COMMAND,
+};
+typedef struct {
+ Tcl_Interp *interp;
+ Tcl_Obj *cmdObj;
+ int multiple;
+} FilePanelCallbackInfo;
+
+static const char *const alertOptionStrings[] = {
+ "-default", "-detail", "-icon", "-message", "-parent", "-title",
+ "-type", "-command", NULL
+};
+enum alertOptions {
+ ALERT_DEFAULT, ALERT_DETAIL, ALERT_ICON, ALERT_MESSAGE, ALERT_PARENT,
+ ALERT_TITLE, ALERT_TYPE, ALERT_COMMAND,
+};
+typedef struct {
+ Tcl_Interp *interp;
+ Tcl_Obj *cmdObj;
+ int typeIndex;
+} AlertCallbackInfo;
+static const char *const alertTypeStrings[] = {
+ "abortretryignore", "ok", "okcancel", "retrycancel", "yesno",
+ "yesnocancel", NULL
+};
+enum alertTypeOptions {
+ TYPE_ABORTRETRYIGNORE, TYPE_OK, TYPE_OKCANCEL, TYPE_RETRYCANCEL,
+ TYPE_YESNO, TYPE_YESNOCANCEL
+};
+static const char *const alertIconStrings[] = {
+ "error", "info", "question", "warning", NULL
+};
+enum alertIconOptions {
+ ICON_ERROR, ICON_INFO, ICON_QUESTION, ICON_WARNING
+};
+static const char *const alertButtonStrings[] = {
+ "abort", "retry", "ignore", "ok", "cancel", "yes", "no", NULL
+};
+
+static const NSString *const alertButtonNames[][3] = {
+ [TYPE_ABORTRETRYIGNORE] = {@"Abort", @"Retry", @"Ignore"},
+ [TYPE_OK] = {@"OK"},
+ [TYPE_OKCANCEL] = {@"OK", @"Cancel"},
+ [TYPE_RETRYCANCEL] = {@"Retry", @"Cancel"},
+ [TYPE_YESNO] = {@"Yes", @"No"},
+ [TYPE_YESNOCANCEL] = {@"Yes", @"No", @"Cancel"},
+};
+static const NSAlertStyle alertStyles[] = {
+ [ICON_ERROR] = NSWarningAlertStyle,
+ [ICON_INFO] = NSInformationalAlertStyle,
+ [ICON_QUESTION] = NSWarningAlertStyle,
+ [ICON_WARNING] = NSCriticalAlertStyle,
+};
/*
- * The following structures are used in the GetFileName() function. They store
- * information about the file dialog and the file filters.
+ * Need to map from 'alertButtonStrings' and its corresponding integer, index
+ * to the native button index, which is 1, 2, 3, from right to left. This is
+ * necessary to do for each separate '-type' of button sets.
*/
-typedef struct _OpenFileData {
- FileFilterList fl; /* List of file filters. */
- SInt16 curType; /* The filetype currently being listed. */
- short initialType; /* Type to use initially */
- short popupItem; /* Item number of the popup in the dialog. */
- short usePopup; /* True if we show the popup menu (this */
- /* is an open operation and the */
- /* -filetypes option is set). */
-} OpenFileData;
-
-typedef struct NavHandlerUserData {
- OpenFileData *ofdPtr;
- NavReplyRecord reply;
- OSStatus err;
- CFStringRef saveNameRef;
- int sheet;
- WindowRef dialogWindow, origUnavailWindow;
- WindowModality origModality;
-} NavHandlerUserData;
+static const short alertButtonIndexAndTypeToNativeButtonIndex[][7] = {
+ /* abort retry ignore ok cancel yes no */
+ [TYPE_ABORTRETRYIGNORE] = {1, 2, 3, 0, 0, 0, 0},
+ [TYPE_OK] = {0, 0, 0, 1, 0, 0, 0},
+ [TYPE_OKCANCEL] = {0, 0, 0, 1, 2, 0, 0},
+ [TYPE_RETRYCANCEL] = {0, 1, 0, 0, 2, 0, 0},
+ [TYPE_YESNO] = {0, 0, 0, 0, 0, 1, 2},
+ [TYPE_YESNOCANCEL] = {0, 0, 0, 0, 3, 1, 2},
+};
/*
- * The following structure is used in the tk_messageBox implementation.
+ * Need also the inverse mapping, from NSAlertFirstButtonReturn etc to the
+ * descriptive button text string index.
*/
-typedef struct {
- int buttonIndex;
- WindowRef dialogWindow, origUnavailWindow;
- WindowModality origModality;
- EventHandlerRef handlerRef;
-} AlertHandlerUserData;
-
-
-static OSStatus AlertHandler(EventHandlerCallRef callRef,
- EventRef eventRef, void *userData);
-static Boolean MatchOneType(StringPtr fileNamePtr, OSType fileType,
- OpenFileData *myofdPtr, FileFilter *filterPtr);
-static pascal Boolean OpenFileFilterProc(AEDesc* theItem, void* info,
- NavCallBackUserData callBackUD,
- NavFilterModes filterMode);
-static pascal void OpenEventProc(NavEventCallbackMessage callBackSelector,
- NavCBRecPtr callBackParms,
- NavCallBackUserData callBackUD);
-static void InitFileDialogs(void);
-static int NavServicesGetFile(Tcl_Interp *interp,
- OpenFileData *ofd, AEDesc *initialDescPtr,
- char *initialFile, AEDescList *selectDescPtr,
- CFStringRef title, CFStringRef message,
- const char *initialType, int multiple,
- int confirmOverwrite, int isOpen,
- Tk_Window parent);
-static int HandleInitialDirectory(Tcl_Interp *interp,
- char *initialFile, char *initialDir, FSRef *dirRef,
- AEDescList *selectDescPtr, AEDesc *dirDescPtr);
+static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = {
+ [TYPE_ABORTRETRYIGNORE] = {0, 1, 2},
+ [TYPE_OK] = {3, 0, 0},
+ [TYPE_OKCANCEL] = {3, 4, 0},
+ [TYPE_RETRYCANCEL] = {1, 4, 0},
+ [TYPE_YESNO] = {5, 6, 0},
+ [TYPE_YESNOCANCEL] = {5, 6, 4},
+};
+
+#pragma mark TKApplication(TKDialog)
-/*
- * Have we initialized the file dialog subsystem
- */
+@interface NSColorPanel(TKDialog)
+- (void) _setUseModalAppearance: (BOOL) flag;
+@end
-static int fileDlgInited = 0;
+@implementation TKApplication(TKDialog)
-/*
- * Filter and hook functions used by the tk_getOpenFile and tk_getSaveFile
- * commands.
- */
+- (void) tkFilePanelDidEnd: (NSSavePanel *) panel
+ returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
+{
+ FilePanelCallbackInfo *callbackInfo = contextInfo;
-static NavObjectFilterUPP openFileFilterUPP;
-static NavEventUPP openFileEventUPP;
+ if (returnCode == NSFileHandlingPanelOKButton) {
+ Tcl_Obj *resultObj;
+
+ if (callbackInfo->multiple) {
+ resultObj = Tcl_NewListObj(0, NULL);
+ for (NSString *name in [(NSOpenPanel*)panel filenames]) {
+ Tcl_ListObjAppendElement(callbackInfo->interp, resultObj,
+ Tcl_NewStringObj([name UTF8String], -1));
+ }
+ } else {
+ resultObj = Tcl_NewStringObj([[panel filename] UTF8String], -1);
+ }
+ if (callbackInfo->cmdObj) {
+ Tcl_Obj **objv, **tmpv;
+ int objc, result = Tcl_ListObjGetElements(callbackInfo->interp,
+ callbackInfo->cmdObj, &objc, &objv);
+
+ if (result == TCL_OK && objc) {
+ tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
+ tmpv[objc] = resultObj;
+ TkBackgroundEvalObjv(callbackInfo->interp, objc + 1, tmpv,
+ TCL_EVAL_GLOBAL);
+ ckfree(tmpv);
+ }
+ } else {
+ Tcl_SetObjResult(callbackInfo->interp, resultObj);
+ }
+ } else if (returnCode == NSFileHandlingPanelCancelButton) {
+ Tcl_ResetResult(callbackInfo->interp);
+ }
+ if (panel == [NSApp modalWindow]) {
+ [NSApp stopModalWithCode:returnCode];
+ }
+ if (callbackInfo->cmdObj) {
+ Tcl_DecrRefCount(callbackInfo->cmdObj);
+ ckfree(callbackInfo);
+ }
+}
+
+- (void) tkAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode
+ contextInfo: (void *) contextInfo
+{
+ AlertCallbackInfo *callbackInfo = contextInfo;
+
+ if (returnCode != NSAlertErrorReturn) {
+ Tcl_Obj *resultObj = Tcl_NewStringObj(alertButtonStrings[
+ alertNativeButtonIndexAndTypeToButtonIndex[callbackInfo->
+ typeIndex][returnCode - NSAlertFirstButtonReturn]], -1);
+
+ if (callbackInfo->cmdObj) {
+ Tcl_Obj **objv, **tmpv;
+ int objc, result = Tcl_ListObjGetElements(callbackInfo->interp,
+ callbackInfo->cmdObj, &objc, &objv);
+
+ if (result == TCL_OK && objc) {
+ tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
+ tmpv[objc] = resultObj;
+ TkBackgroundEvalObjv(callbackInfo->interp, objc + 1, tmpv,
+ TCL_EVAL_GLOBAL);
+ ckfree(tmpv);
+ }
+ } else {
+ Tcl_SetObjResult(callbackInfo->interp, resultObj);
+ }
+ }
+ if ([alert window] == [NSApp modalWindow]) {
+ [NSApp stopModalWithCode:returnCode];
+ }
+ if (callbackInfo->cmdObj) {
+ Tcl_DecrRefCount(callbackInfo->cmdObj);
+ ckfree(callbackInfo);
+ }
+}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -127,35 +245,21 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- OSStatus err;
int result = TCL_ERROR;
Tk_Window parent, tkwin = clientData;
- const char *title;
- int i, srcRead, dstWrote;
- CMError cmerr;
- CMProfileRef prof;
- NColorPickerInfo cpinfo;
- static RGBColor color = {0xffff, 0xffff, 0xffff};
- static const char *optionStrings[] = {
- "-initialcolor", "-parent", "-title", NULL
- };
- enum options {
- COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
- };
-
- title = "Choose a color:";
- bzero(&cpinfo, sizeof(cpinfo));
- cpinfo.theColor.color.rgb.red = color.red;
- cpinfo.theColor.color.rgb.green = color.green;
- cpinfo.theColor.color.rgb.blue = color.blue;
+ const char *title = NULL;
+ int i;
+ NSColor *color = nil, *initialColor = nil;
+ NSColorPanel *colorPanel;
+ NSInteger returnCode, numberOfComponents = 0;
for (i = 1; i < objc; i += 2) {
int index;
const char *option, *value;
- if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option",
+ if (Tcl_GetIndexFromObj(interp, objv[i], colorOptionStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
goto end;
}
@@ -167,63 +271,65 @@ Tk_ChooseColorObjCmd(
}
value = Tcl_GetString(objv[i + 1]);
- switch ((enum options) index) {
- case COLOR_INITIAL: {
- XColor *colorPtr;
+ switch (index) {
+ case COLOR_INITIAL: {
+ XColor *colorPtr;
- colorPtr = Tk_GetColor(interp, tkwin, value);
- if (colorPtr == NULL) {
- goto end;
- }
- cpinfo.theColor.color.rgb.red = colorPtr->red;
- cpinfo.theColor.color.rgb.green = colorPtr->green;
- cpinfo.theColor.color.rgb.blue = colorPtr->blue;
- Tk_FreeColor(colorPtr);
- break;
- }
- case COLOR_PARENT: {
- parent = Tk_NameToWindow(interp, value, tkwin);
- if (parent == NULL) {
- goto end;
- }
- break;
+ colorPtr = Tk_GetColor(interp, tkwin, value);
+ if (colorPtr == NULL) {
+ goto end;
}
- case COLOR_TITLE: {
- title = value;
- break;
+ initialColor = TkMacOSXGetNSColor(NULL, colorPtr->pixel);
+ Tk_FreeColor(colorPtr);
+ break;
+ }
+ case COLOR_PARENT:
+ parent = Tk_NameToWindow(interp, value, tkwin);
+ if (parent == NULL) {
+ goto end;
}
+ break;
+ case COLOR_TITLE:
+ title = value;
+ break;
}
}
-
- cmerr = CMGetDefaultProfileBySpace(cmRGBData, &prof);
- cpinfo.theColor.profile = prof;
- cpinfo.dstProfile = prof;
- cpinfo.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal;
- cpinfo.placeWhere = kCenterOnMainScreen;
- /* Currently, this does not actually change the colorpicker title */
- Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, title, -1, 0, NULL,
- StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL);
- StrLength(cpinfo.prompt) = (unsigned char) dstWrote;
-
- TkMacOSXTrackingLoop(1);
- err = ChkErr(NPickColor, &cpinfo);
- TkMacOSXTrackingLoop(0);
- cmerr = CMCloseProfile(prof);
- if ((err == noErr) && (cpinfo.newColorChosen != 0)) {
+ colorPanel = [NSColorPanel sharedColorPanel];
+ [colorPanel orderOut:NSApp];
+ [colorPanel setContinuous:NO];
+ [colorPanel setBecomesKeyOnlyIfNeeded:NO];
+ [colorPanel setShowsAlpha: NO];
+ [colorPanel _setUseModalAppearance:YES];
+ if (title) {
+ NSString *s = [[NSString alloc] initWithUTF8String:title];
+ [colorPanel setTitle:s];
+ [s release];
+ }
+ if (initialColor) {
+ [colorPanel setColor:initialColor];
+ }
+ returnCode = [NSApp runModalForWindow:colorPanel];
+ if (returnCode == NSOKButton) {
+ color = [[colorPanel color] colorUsingColorSpace:
+ [NSColorSpace genericRGBColorSpace]];
+ numberOfComponents = [color numberOfComponents];
+ }
+ if (color && numberOfComponents >= 3 && numberOfComponents <= 4) {
+ CGFloat components[4];
char colorstr[8];
- color.red = cpinfo.theColor.color.rgb.red;
- color.green = cpinfo.theColor.color.rgb.green;
- color.blue = cpinfo.theColor.color.rgb.blue;
- snprintf(colorstr, 8, "#%02x%02x%02x", color.red >> 8,
- color.green >> 8, color.blue >> 8);
+ [color getComponents:components];
+ snprintf(colorstr, 8, "#%02x%02x%02x",
+ (short)(components[0] * 255),
+ (short)(components[1] * 255),
+ (short)(components[2] * 255));
Tcl_SetObjResult(interp, Tcl_NewStringObj(colorstr, 7));
} else {
Tcl_ResetResult(interp);
}
result = TCL_OK;
- end:
+end:
return result;
}
@@ -248,85 +354,61 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- int i, result = TCL_ERROR, multiple = 0;
- OpenFileData ofd;
- Tk_Window parent = NULL;
- CFStringRef message = NULL, title = NULL;
- AEDesc initialDesc = {typeNull, NULL};
- FSRef dirRef;
- AEDesc *initialPtr = NULL;
- AEDescList selectDesc = {typeNull, NULL};
- char *initialFile = NULL, *initialDir = NULL;
- Tcl_Obj *typeVariablePtr = NULL;
- const char *initialtype = NULL;
- static const char *openOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-message", "-multiple", "-parent", "-title", "-typevariable", NULL
- };
- enum openOptions {
- OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, OPEN_INITFILE,
- OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE,
- OPEN_TYPEVARIABLE,
- };
-
- if (!fileDlgInited) {
- InitFileDialogs();
- }
- TkInitFileFilters(&ofd.fl);
- ofd.curType = 0;
- ofd.initialType = -1;
- ofd.popupItem = OPEN_POPUP_ITEM;
- ofd.usePopup = 1;
-
+ Tk_Window tkwin = clientData;
+ char *str;
+ int i, result = TCL_ERROR, haveParentOption = 0;
+ int index, len, multiple = 0;
+ FileFilterList fl;
+ Tcl_Obj *cmdObj = NULL, *typeVariablePtr = NULL;
+ FilePanelCallbackInfo callbackInfoStruct;
+ FilePanelCallbackInfo *callbackInfo = &callbackInfoStruct;
+ NSString *directory = nil, *filename = nil;
+ NSString *message, *title, *type;
+ NSWindow *parent;
+ NSMutableArray *fileTypes = nil;
+ NSOpenPanel *panel = [NSOpenPanel openPanel];
+ NSInteger returnCode = NSAlertErrorReturn;
+
+ TkInitFileFilters(&fl);
for (i = 1; i < objc; i += 2) {
- char *choice;
- int index, choiceLen;
- char *string;
- Tcl_Obj *types;
-
if (Tcl_GetIndexFromObj(interp, objv[i], openOptionStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
goto end;
}
if (i + 1 == objc) {
- string = Tcl_GetString(objv[i]);
- Tcl_AppendResult(interp, "value for \"", string, "\" missing",
- NULL);
+ str = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL);
goto end;
}
-
switch (index) {
case OPEN_DEFAULT:
break;
case OPEN_FILETYPES:
- types = objv[i + 1];
- if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ if (TkGetFileFilters(interp, &fl, objv[i + 1], 0) != TCL_OK) {
goto end;
}
break;
case OPEN_INITDIR:
- initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) {
- initialDir = NULL;
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ if (len) {
+ directory = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
}
break;
case OPEN_INITFILE:
- initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) {
- initialFile = NULL;
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ if (len) {
+ filename = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
}
break;
case OPEN_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (message) {
- CFRelease(message);
- }
- message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
+ message = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setMessage:message];
+ [message release];
break;
case OPEN_MULTIPLE:
if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
@@ -335,68 +417,96 @@ Tk_GetOpenFileObjCmd(
}
break;
case OPEN_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice, clientData);
- if (parent == NULL) {
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (!tkwin) {
goto end;
}
+ haveParentOption = 1;
break;
case OPEN_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (title) {
- CFRelease(title);
- }
- title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
+ title = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setTitle:title];
+ [title release];
break;
case OPEN_TYPEVARIABLE:
typeVariablePtr = objv[i + 1];
break;
+ case OPEN_COMMAND:
+ cmdObj = objv[i+1];
+ break;
}
}
-
- if (HandleInitialDirectory(interp, initialFile, initialDir, &dirRef,
- &selectDesc, &initialDesc) != TCL_OK) {
- goto end;
+ if (fl.filters) {
+ fileTypes = [NSMutableArray array];
+ for (FileFilter *filterPtr = fl.filters; filterPtr;
+ filterPtr = filterPtr->next) {
+ for (FileFilterClause *clausePtr = filterPtr->clauses; clausePtr;
+ clausePtr = clausePtr->next) {
+ for (GlobPattern *globPtr = clausePtr->patterns; globPtr;
+ globPtr = globPtr->next) {
+ str = globPtr->pattern;
+ while (*str && (*str == '*' || *str == '.')) {
+ str++;
+ }
+ if (*str) {
+ type = [[NSString alloc] initWithUTF8String:str];
+ if (![fileTypes containsObject:type]) {
+ [fileTypes addObject:type];
+ }
+ [type release];
+ }
+ }
+ for (MacFileType *mfPtr = clausePtr->macTypes; mfPtr;
+ mfPtr = mfPtr->next) {
+ if (mfPtr->type) {
+ type = NSFileTypeForHFSTypeCode(mfPtr->type);
+ if (![fileTypes containsObject:type]) {
+ [fileTypes addObject:type];
+ }
+ }
+ }
+ }
+ }
}
- if (initialDesc.descriptorType == typeFSRef) {
- initialPtr = &initialDesc;
+ [panel setAllowsMultipleSelection:multiple];
+ if (cmdObj) {
+ callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ if (Tcl_IsShared(cmdObj)) {
+ cmdObj = Tcl_DuplicateObj(cmdObj);
+ }
+ Tcl_IncrRefCount(cmdObj);
}
- if (typeVariablePtr) {
- initialtype = Tcl_GetVar(interp, Tcl_GetString(typeVariablePtr),
- TCL_GLOBAL_ONLY);
+ callbackInfo->cmdObj = cmdObj;
+ callbackInfo->interp = interp;
+ callbackInfo->multiple = multiple;
+ parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window);
+ if (haveParentOption && parent && ![parent attachedSheet]) {
+ [panel beginSheetForDirectory:directory file:filename types:fileTypes
+ modalForWindow:parent modalDelegate:NSApp didEndSelector:
+ @selector(tkFilePanelDidEnd:returnCode:contextInfo:)
+ contextInfo:callbackInfo];
+ returnCode = cmdObj ? NSAlertOtherReturn :
+ [NSApp runModalForWindow:panel];
+ } else {
+ returnCode = [panel runModalForDirectory:directory file:filename
+ types:fileTypes];
+ [NSApp tkFilePanelDidEnd:panel returnCode:returnCode
+ contextInfo:callbackInfo];
}
- result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, &selectDesc,
- title, message, initialtype, multiple, false, OPEN_FILE, parent);
-
- if (typeVariablePtr) {
- FileFilter *filterPtr = ofd.fl.filters;
- int i = ofd.curType;
+ result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR;
+ if (typeVariablePtr && result == TCL_OK) {
+ /*
+ * The -typevariable option is not really supported.
+ */
- while (filterPtr && i-- > 0) {
- filterPtr = filterPtr->next;
- }
- if (Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr),
- filterPtr ? filterPtr->name : "",
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
+ Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), "",
+ TCL_GLOBAL_ONLY);
}
end:
- TkFreeFileFilters(&ofd.fl);
- if (initialDesc.dataHandle) {
- ChkErr(AEDisposeDesc, &initialDesc);
- }
- if (selectDesc.dataHandle) {
- ChkErr(AEDisposeDesc, &selectDesc);
- }
- if (title) {
- CFRelease(title);
- }
- if (message) {
- CFRelease(message);
- }
+ TkFreeFileFilters(&fl);
return result;
}
@@ -405,7 +515,8 @@ Tk_GetOpenFileObjCmd(
*
* Tk_GetSaveFileObjCmd --
*
- * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box instead.
+ * This procedure implements the "save file" dialog box for the Mac
+ * platform. See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -420,123 +531,154 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- int i, result = TCL_ERROR;
+ Tk_Window tkwin = clientData;
+ char *str;
+ int i, result = TCL_ERROR, haveParentOption = 0;
int confirmOverwrite = 1;
- char *initialFile = NULL;
- Tk_Window parent = NULL;
- AEDesc initialDesc = {typeNull, NULL};
- AEDesc *initialPtr = NULL;
- FSRef dirRef;
- CFStringRef title = NULL, message = NULL;
- OpenFileData ofd;
- static const char *saveOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-message", "-parent", "-title", "-typevariable",
- "-confirmoverwrite", NULL
- };
- enum saveOptions {
- SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE,
- SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE,
- SAVE_CONFIRMOW
- };
-
- if (!fileDlgInited) {
- InitFileDialogs();
- }
-
- TkInitFileFilters(&ofd.fl);
- ofd.curType = 0;
- ofd.usePopup = 0;
-
+ int index, len;
+ FileFilterList fl;
+ Tcl_Obj *cmdObj = NULL;
+ FilePanelCallbackInfo callbackInfoStruct;
+ FilePanelCallbackInfo *callbackInfo = &callbackInfoStruct;
+ NSString *directory = nil, *filename = nil, *defaultType = nil;
+ NSString *message, *title, *type;
+ NSWindow *parent;
+ NSMutableArray *fileTypes = nil;
+ NSSavePanel *panel = [NSSavePanel savePanel];
+ NSInteger returnCode = NSAlertErrorReturn;
+
+ TkInitFileFilters(&fl);
for (i = 1; i < objc; i += 2) {
- char *choice, *string;
- int index, choiceLen;
- Tcl_Obj *types;
-
if (Tcl_GetIndexFromObj(interp, objv[i], saveOptionStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
goto end;
}
if (i + 1 == objc) {
- string = Tcl_GetString(objv[i]);
- Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ str = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", str, "\" missing",
NULL);
goto end;
}
switch (index) {
case SAVE_DEFAULT:
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ while (*str && (*str == '*' || *str == '.')) {
+ str++;
+ }
+ if (*str) {
+ defaultType = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
+ }
break;
case SAVE_FILETYPES:
- types = objv[i + 1];
- if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ if (TkGetFileFilters(interp, &fl, objv[i + 1], 0) != TCL_OK) {
goto end;
}
break;
case SAVE_INITDIR:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
- &dirRef, NULL, &initialDesc) != TCL_OK) {
- goto end;
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ if (len) {
+ directory = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
}
break;
case SAVE_INITFILE:
- initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) {
- initialFile = NULL;
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ if (len) {
+ filename = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
}
break;
case SAVE_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (message) {
- CFRelease(message);
- }
- message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
+ message = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setMessage:message];
+ [message release];
break;
case SAVE_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice, (Tk_Window) clientData);
- if (parent == NULL) {
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (!tkwin) {
goto end;
}
+ haveParentOption = 1;
break;
case SAVE_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (title) {
- CFRelease(title);
- }
- title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
+ title = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setTitle:title];
+ [title release];
+ break;
+ case SAVE_TYPEVARIABLE:
+ break;
+ case SAVE_COMMAND:
+ cmdObj = objv[i+1];
break;
case SAVE_CONFIRMOW:
- if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &confirmOverwrite)
- != TCL_OK) {
- return TCL_ERROR;
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
+ &confirmOverwrite) != TCL_OK) {
+ goto end;
}
break;
}
}
-
- if (initialDesc.descriptorType == typeFSRef) {
- initialPtr = &initialDesc;
- }
- result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL,
- title, message, NULL, false, confirmOverwrite, SAVE_FILE, parent);
- TkFreeFileFilters(&ofd.fl);
- end:
- if (initialDesc.dataHandle) {
- ChkErr(AEDisposeDesc, &initialDesc);
+ if (fl.filters || defaultType) {
+ fileTypes = [NSMutableArray array];
+ [fileTypes addObject:defaultType ? defaultType : (id)kUTTypeContent];
+ for (FileFilter *filterPtr = fl.filters; filterPtr;
+ filterPtr = filterPtr->next) {
+ for (FileFilterClause *clausePtr = filterPtr->clauses; clausePtr;
+ clausePtr = clausePtr->next) {
+ for (GlobPattern *globPtr = clausePtr->patterns; globPtr;
+ globPtr = globPtr->next) {
+ str = globPtr->pattern;
+ while (*str && (*str == '*' || *str == '.')) {
+ str++;
+ }
+ if (*str) {
+ type = [[NSString alloc] initWithUTF8String:str];
+ if (![fileTypes containsObject:type]) {
+ [fileTypes addObject:type];
+ }
+ [type release];
+ }
+ }
+ }
+ }
+ [panel setAllowedFileTypes:fileTypes];
+ [panel setAllowsOtherFileTypes:YES];
}
- if (title) {
- CFRelease(title);
+ [panel setCanSelectHiddenExtension:YES];
+ [panel setExtensionHidden:NO];
+ if (cmdObj) {
+ callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ if (Tcl_IsShared(cmdObj)) {
+ cmdObj = Tcl_DuplicateObj(cmdObj);
+ }
+ Tcl_IncrRefCount(cmdObj);
}
- if (message) {
- CFRelease(message);
+ callbackInfo->cmdObj = cmdObj;
+ callbackInfo->interp = interp;
+ callbackInfo->multiple = 0;
+ parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window);
+ if (haveParentOption && parent && ![parent attachedSheet]) {
+ [panel beginSheetForDirectory:directory file:filename
+ modalForWindow:parent modalDelegate:NSApp didEndSelector:
+ @selector(tkFilePanelDidEnd:returnCode:contextInfo:)
+ contextInfo:callbackInfo];
+ returnCode = cmdObj ? NSAlertOtherReturn :
+ [NSApp runModalForWindow:panel];
+ } else {
+ returnCode = [panel runModalForDirectory:directory file:filename];
+ [NSApp tkFilePanelDidEnd:panel returnCode:returnCode
+ contextInfo:callbackInfo];
}
+ result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR;
+
+ end:
+ TkFreeFileFilters(&fl);
return result;
}
@@ -563,104 +705,112 @@ Tk_ChooseDirectoryObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- int i, result = TCL_ERROR;
- Tk_Window parent = NULL;
- AEDesc initialDesc = {typeNull, NULL}, *initialPtr = NULL;
- FSRef dirRef;
- CFStringRef message = NULL, title = NULL;
- 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 (!fileDlgInited) {
- InitFileDialogs();
- }
+ Tk_Window tkwin = clientData;
+ char *str;
+ int i, result = TCL_ERROR, haveParentOption = 0;
+ int index, len, mustexist = 0;
+ Tcl_Obj *cmdObj = NULL;
+ FilePanelCallbackInfo callbackInfoStruct;
+ FilePanelCallbackInfo *callbackInfo = &callbackInfoStruct;
+ NSString *directory = nil, *filename = nil;
+ NSString *message, *title;
+ NSWindow *parent;
+ NSOpenPanel *panel = [NSOpenPanel openPanel];
+ NSInteger returnCode = NSAlertErrorReturn;
for (i = 1; i < objc; i += 2) {
- char *string, *choice;
- int index, choiceLen;
-
if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
goto end;
}
if (i + 1 == objc) {
- string = Tcl_GetString(objv[i]);
- Tcl_AppendResult(interp, "value for \"", string, "\" missing",
- NULL);
+ str = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL);
goto end;
}
switch (index) {
case CHOOSE_INITDIR:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
- &dirRef, NULL, &initialDesc) != TCL_OK) {
- goto end;
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ if (len) {
+ directory = [[[NSString alloc] initWithUTF8String:str]
+ autorelease];
}
break;
case CHOOSE_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (message) {
- CFRelease(message);
+ message = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setMessage:message];
+ [message release];
+ break;
+ case CHOOSE_MUSTEXIST:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
+ &mustexist) != TCL_OK) {
+ goto end;
}
- message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
break;
case CHOOSE_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice, clientData);
- if (parent == NULL) {
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (!tkwin) {
goto end;
}
+ haveParentOption = 1;
break;
case CHOOSE_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (title) {
- CFRelease(title);
- }
- title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
- choiceLen, kCFStringEncodingUTF8, false);
+ title = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [panel setTitle:title];
+ [title release];
+ break;
+ case CHOOSE_COMMAND:
+ cmdObj = objv[i+1];
break;
}
}
-
- TkInitFileFilters(&ofd.fl);
- ofd.usePopup = 0;
- if (initialDesc.descriptorType == typeFSRef) {
- initialPtr = &initialDesc;
- }
- result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL, title,
- message, NULL, false, false, CHOOSE_FOLDER, parent);
- TkFreeFileFilters(&ofd.fl);
- end:
- if (initialDesc.dataHandle) {
- ChkErr(AEDisposeDesc, &initialDesc);
- }
- if (title) {
- CFRelease(title);
+ [panel setPrompt:@"Choose"];
+ [panel setCanChooseFiles:NO];
+ [panel setCanChooseDirectories:YES];
+ [panel setCanCreateDirectories:!mustexist];
+ if (cmdObj) {
+ callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
+ if (Tcl_IsShared(cmdObj)) {
+ cmdObj = Tcl_DuplicateObj(cmdObj);
+ }
+ Tcl_IncrRefCount(cmdObj);
}
- if (message) {
- CFRelease(message);
+ callbackInfo->cmdObj = cmdObj;
+ callbackInfo->interp = interp;
+ callbackInfo->multiple = 0;
+ parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window);
+ if (haveParentOption && parent && ![parent attachedSheet]) {
+ [panel beginSheetForDirectory:directory file:filename
+ modalForWindow:parent modalDelegate:NSApp didEndSelector:
+ @selector(tkFilePanelDidEnd:returnCode:contextInfo:)
+ contextInfo:callbackInfo];
+ returnCode = cmdObj ? NSAlertOtherReturn :
+ [NSApp runModalForWindow:panel];
+ } else {
+ returnCode = [panel runModalForDirectory:directory file:filename];
+ [NSApp tkFilePanelDidEnd:panel returnCode:returnCode
+ contextInfo:callbackInfo];
}
+ result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR;
+
+ end:
return result;
}
/*
*----------------------------------------------------------------------
*
- * HandleInitialDirectory --
+ * TkAboutDlg --
*
- * Helper for -initialdir setup.
+ * Displays the default Tk About box.
*
* Results:
- * Tcl result.
+ * None.
*
* Side effects:
* None.
@@ -668,478 +818,436 @@ Tk_ChooseDirectoryObjCmd(
*----------------------------------------------------------------------
*/
-int
-HandleInitialDirectory(
- Tcl_Interp *interp,
- char *initialFile,
- char *initialDir,
- FSRef *dirRef,
- AEDescList *selectDescPtr,
- AEDesc *dirDescPtr)
+void
+TkAboutDlg(void)
{
- Tcl_DString ds;
- OSStatus err;
- Boolean isDirectory;
- char *dirName = NULL;
- int result = TCL_ERROR;
+ NSImage *image;
+ NSString *path = [NSApp tkFrameworkImagePath: @"Tk.tiff"];
- if (initialDir) {
- dirName = Tcl_TranslateFileName(interp, initialDir, &ds);
- if (dirName == NULL) {
- goto end;
- }
- err = ChkErr(FSPathMakeRef, (unsigned char *) dirName, dirRef,
- &isDirectory);
- if (err != noErr) {
- Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"",
- NULL);
- goto end;
- }
- if (!isDirectory) {
- Tcl_AppendResult(interp, "-intialdir \"", initialDir, "\""
- " is a file, not a directory.", NULL);
- goto end;
- }
- ChkErr(AECreateDesc, typeFSRef, dirRef, sizeof(*dirRef), dirDescPtr);
+ if (path) {
+ image = [[[NSImage alloc] initWithContentsOfFile:path] autorelease];
+ } else {
+ image = [NSApp applicationIconImage];
}
- if (initialFile && selectDescPtr) {
- FSRef fileRef;
- AEDesc fileDesc;
- char *namePtr;
-
- if (initialDir) {
- Tcl_DStringAppend(&ds, "/", 1);
- Tcl_DStringAppend(&ds, initialFile, -1);
- namePtr = Tcl_DStringValue(&ds);
- } else {
- namePtr = initialFile;
- }
-
- ChkErr(AECreateList, NULL, 0, false, selectDescPtr);
-
- err = ChkErr(FSPathMakeRef, (unsigned char *) namePtr, &fileRef,
- &isDirectory);
- if (err != noErr) {
- Tcl_AppendResult(interp, "bad initialfile \"", initialFile,
- "\" file does not exist.", NULL);
- goto end;
- }
- ChkErr(AECreateDesc, typeFSRef, &fileRef, sizeof(fileRef), &fileDesc);
- ChkErr(AEPutDesc, selectDescPtr, 1, &fileDesc);
- ChkErr(AEDisposeDesc, &fileDesc);
- }
- result = TCL_OK;
- end:
- if (dirName) {
- Tcl_DStringFree(&ds);
- }
- return result;
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+
+ [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
+ [dateFormatter setDateFormat:@"Y"];
+
+ NSString *year = [dateFormatter stringFromDate:[NSDate date]];
+
+ [dateFormatter release];
+
+ NSMutableParagraphStyle *style =
+ [[[NSParagraphStyle defaultParagraphStyle] mutableCopy]
+ autorelease];
+
+ [style setAlignment:NSCenterTextAlignment];
+
+ NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
+ @"Tcl & Tk", @"ApplicationName",
+ @"Tcl " TCL_VERSION " & Tk " TK_VERSION, @"ApplicationVersion",
+ @TK_PATCH_LEVEL, @"Version",
+ image, @"ApplicationIcon",
+ [NSString stringWithFormat:@"Copyright %1$C 1987-%2$@.", 0xA9,
+ year], @"Copyright",
+ [[[NSAttributedString alloc] initWithString:
+ [NSString stringWithFormat:
+ @"%1$C 1987-%2$@ Tcl Core Team." "\n\n"
+ "%1$C 2002-%2$@ Daniel A. Steffen." "\n\n"
+ "%1$C 2001-2009 Apple Inc." "\n\n"
+ "%1$C 2001-2002 Jim Ingham & Ian Reid" "\n\n"
+ "%1$C 1998-2000 Jim Ingham & Ray Johnson" "\n\n"
+ "%1$C 1998-2000 Scriptics Inc." "\n\n"
+ "%1$C 1996-1997 Sun Microsystems Inc.", 0xA9, year] attributes:
+ [NSDictionary dictionaryWithObject:style
+ forKey:NSParagraphStyleAttributeName]] autorelease], @"Credits",
+ nil];
+ [NSApp orderFrontStandardAboutPanelWithOptions:options];
}
/*
*----------------------------------------------------------------------
*
- * InitFileDialogs --
+ * TkMacOSXStandardAboutPanelObjCmd --
*
- * Initialize file dialog subsystem.
+ * Implements the ::tk::mac::standardAboutPanel command.
*
* Results:
- * None.
+ * A standard Tcl result.
*
* Side effects:
- * None.
+ * none
*
*----------------------------------------------------------------------
*/
-void
-InitFileDialogs(void)
+int
+TkMacOSXStandardAboutPanelObjCmd(
+ ClientData clientData, /* Unused. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- fileDlgInited = 1;
- openFileFilterUPP = NewNavObjectFilterUPP(OpenFileFilterProc);
- openFileEventUPP = NewNavEventUPP(OpenEventProc);
+ if (objc > 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
+ [NSApp orderFrontStandardAboutPanelWithOptions:nil];
+ return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * NavServicesGetFile --
+ * Tk_MessageBoxObjCmd --
*
- * Common wrapper for NavServices API.
+ * Implements the tk_messageBox in native Mac OS X style.
*
* Results:
- * Tcl result.
+ * A standard Tcl result.
*
* Side effects:
- * None.
+ * none
*
*----------------------------------------------------------------------
*/
int
-NavServicesGetFile(
- Tcl_Interp *interp,
- OpenFileData *ofdPtr,
- AEDesc *initialDescPtr,
- char *initialFile,
- AEDescList *selectDescPtr,
- CFStringRef title,
- CFStringRef message,
- const char *initialtype,
- int multiple,
- int confirmOverwrite,
- int isOpen,
- Tk_Window parent)
+Tk_MessageBoxObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- NavHandlerUserData data;
- NavDialogCreationOptions options;
- NavDialogRef dialogRef = NULL;
- CFStringRef *menuItemNames = NULL;
- OSStatus err;
- Tcl_Obj *theResult = NULL;
- int result = TCL_ERROR;
-
- bzero(&data, sizeof(data));
- err = NavGetDefaultDialogCreationOptions(&options);
- if (err != noErr) {
- return result;
- }
- options.optionFlags = kNavDontAutoTranslate | kNavDontAddTranslateItems
- | kNavSupportPackages | kNavAllFilesInPopup;
- if (multiple) {
- options.optionFlags |= kNavAllowMultipleFiles;
- }
- if (!confirmOverwrite) {
- options.optionFlags |= kNavDontConfirmReplacement;
- }
- options.modality = kWindowModalityAppModal;
- if (parent && ((TkWindow *) parent)->window != None &&
- TkMacOSXHostToplevelExists(parent)) {
- options.parentWindow = TkMacOSXDrawableWindow(Tk_WindowId(parent));
- TK_IF_HI_TOOLBOX (5,
+ Tk_Window tkwin = clientData;
+ char *str;
+ int i, result = TCL_ERROR, haveParentOption = 0;
+ int index, typeIndex, iconIndex, indexDefaultOption = 0;
+ int defaultNativeButtonIndex = 1; /* 1, 2, 3: right to left */
+ Tcl_Obj *cmdObj = NULL;
+ AlertCallbackInfo callbackInfoStruct, *callbackInfo = &callbackInfoStruct;
+ NSString *message, *title;
+ NSWindow *parent;
+ NSArray *buttons;
+ NSAlert *alert = [NSAlert new];
+ NSInteger returnCode = NSAlertErrorReturn;
+
+ iconIndex = ICON_INFO;
+ typeIndex = TYPE_OK;
+ for (i = 1; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], alertOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ goto end;
+ }
+ if (i + 1 == objc) {
+ str = Tcl_GetString(objv[i]);
+ Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL);
+ goto end;
+ }
+ switch (index) {
+ case ALERT_DEFAULT:
/*
- * Impossible to modify dialog modality with the Cocoa-based
- * NavServices implementation.
+ * Need to postpone processing of this option until we are sure to
+ * know the '-type' as well.
*/
- ) TK_ELSE_HI_TOOLBOX (5,
- if (options.parentWindow) {
- options.modality = kWindowModalityWindowModal;
- data.sheet = 1;
- }
- ) TK_ENDIF
- }
- /*
- * Now process the selection list. We have to use the popupExtension
- * to fill the menu.
- */
+ indexDefaultOption = i;
+ break;
- if (ofdPtr && ofdPtr->usePopup) {
- FileFilter *filterPtr = ofdPtr->fl.filters;
+ case ALERT_DETAIL:
+ message = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [alert setInformativeText:message];
+ [message release];
+ break;
- if (filterPtr == NULL) {
- ofdPtr->usePopup = 0;
- }
- }
- if (ofdPtr && 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, kCFStringEncodingUTF8);
- if (initialtype && strcmp(filterPtr->name, initialtype) == 0) {
- ofdPtr->initialType = index;
+ case ALERT_ICON:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], alertIconStrings,
+ "value", TCL_EXACT, &iconIndex) != TCL_OK) {
+ goto end;
}
- }
- options.popupExtension = CFArrayCreate(NULL,
- (const void **) menuItemNames, ofdPtr->fl.numFilters, NULL);
- } else {
- options.optionFlags |= kNavNoTypePopup;
- options.popupExtension = NULL;
- }
- options.clientName = CFSTR("Wish");
- options.message = message;
- options.windowTitle = title;
- if (initialFile) {
- options.saveFileName = CFStringCreateWithCString(NULL, initialFile,
- kCFStringEncodingUTF8);
- } else {
- options.saveFileName = NULL;
- }
- if (isOpen == OPEN_FILE) {
- data.ofdPtr = ofdPtr;
- err = ChkErr(NavCreateGetFileDialog, &options, NULL,
- openFileEventUPP, NULL, openFileFilterUPP, &data, &dialogRef);
- } else if (isOpen == SAVE_FILE) {
- err = ChkErr(NavCreatePutFileDialog, &options, 'TEXT', 'WIsH',
- openFileEventUPP, &data, &dialogRef);
- } else if (isOpen == CHOOSE_FOLDER) {
- err = ChkErr(NavCreateChooseFolderDialog, &options,
- openFileEventUPP, openFileFilterUPP, &data, &dialogRef);
- }
- if (err == noErr && dialogRef) {
- if (initialDescPtr) {
- ChkErr(NavCustomControl, dialogRef, kNavCtlSetLocation,
- initialDescPtr);
- }
- if (selectDescPtr && selectDescPtr->descriptorType != typeNull) {
- ChkErr(NavCustomControl, dialogRef, kNavCtlSetSelection,
- selectDescPtr);
- }
- TkMacOSXTrackingLoop(1);
- err = ChkErr(NavDialogRun, dialogRef);
- if (err == noErr) {
- if (data.sheet) {
- data.dialogWindow = NavDialogGetWindow(dialogRef);
- ChkErr(GetWindowModality, data.dialogWindow,
- &data.origModality, &data.origUnavailWindow);
- ChkErr(SetWindowModality, data.dialogWindow,
- kWindowModalityAppModal, NULL);
- ChkErr(RunAppModalLoopForWindow, data.dialogWindow);
+ break;
+
+ case ALERT_MESSAGE:
+ message = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [alert setMessageText:message];
+ [message release];
+ break;
+
+ case ALERT_PARENT:
+ str = Tcl_GetString(objv[i + 1]);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (!tkwin) {
+ goto end;
}
- err = data.err;
- }
- TkMacOSXTrackingLoop(0);
- }
+ haveParentOption = 1;
+ break;
- /*
- * Most commands assume that the file dialogs return a single item, not a
- * list. So only build a list if multiple is true...
- */
+ case ALERT_TITLE:
+ title = [[NSString alloc] initWithUTF8String:
+ Tcl_GetString(objv[i + 1])];
+ [[alert window] setTitle:title];
+ [title release];
+ break;
- if (err == noErr) {
- if (multiple) {
- theResult = Tcl_NewListObj(0, NULL);
- } else {
- theResult = Tcl_NewObj();
- }
- if (!theResult) {
- err = memFullErr;
+ case ALERT_TYPE:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], alertTypeStrings,
+ "value", TCL_EXACT, &typeIndex) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case ALERT_COMMAND:
+ cmdObj = objv[i+1];
+ break;
}
}
- if (err == noErr && data.reply.validRecord) {
- AEDesc resultDesc;
- long count, i;
- FSRef fsRef;
- char pathPtr[PATH_MAX + 1];
- char saveName[PATH_MAX + 1];
-
- err = ChkErr(AECountItems, &data.reply.selection, &count);
- if (err != noErr) {
- /*
- * There was an error when counting the items? Treat as if no
- * items were chosen.
- */
+ if (indexDefaultOption) {
+ /*
+ * Any '-default' option needs to know the '-type' option, which is
+ * why we do this here.
+ */
- goto installResult;
+ if (Tcl_GetIndexFromObj(interp, objv[indexDefaultOption + 1],
+ alertButtonStrings, "value", TCL_EXACT, &index) != TCL_OK) {
+ goto end;
}
/*
- * Process the chosen files. This will be one unless -multiple was
- * specified.
+ * Need to map from "ok" etc. to 1, 2, 3, right to left.
*/
- for (i = 1; i <= count; i++) {
- /*
- * Get the name of the selected file.
- */
-
- err = ChkErr(AEGetNthDesc, &data.reply.selection, i,
- typeFSRef, NULL, &resultDesc);
- if (err != noErr) {
- continue;
- }
- err = ChkErr(AEGetDescData, &resultDesc, &fsRef, sizeof(fsRef));
- if (err != noErr) {
- goto nextFilename;
- }
- err = ChkErr(FSRefMakePath, &fsRef, (unsigned char *) pathPtr,
- PATH_MAX + 1);
- if (err != noErr) {
- goto nextFilename;
- }
-
- /*
- * If we're saving the file, we're creating a new filename and
- * must therefore check whether it is a legal filename (not
- * exceeding path length limits, etc.)
- */
-
- if (isOpen == SAVE_FILE) {
- if (!data.saveNameRef) {
- TkMacOSXDbgMsg("NavDialogGetSaveFileName failed");
- goto nextFilename;
- }
-
- if (!CFStringGetCString(data.saveNameRef, saveName,
- PATH_MAX + 1, kCFStringEncodingUTF8)) {
- TkMacOSXDbgMsg("CFStringGetCString failed");
- goto nextFilename;
- }
-
- if (strlen(pathPtr) + strlen(saveName) >= PATH_MAX) {
- TkMacOSXDbgMsg("Path name too long");
- goto nextFilename;
- }
+ defaultNativeButtonIndex =
+ alertButtonIndexAndTypeToNativeButtonIndex[typeIndex][index];
+ if (!defaultNativeButtonIndex) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("Illegal default option", -1));
+ goto end;
+ }
+ }
+ [alert setIcon:[NSApp applicationIconImage]];
+ [alert setAlertStyle:alertStyles[iconIndex]];
+ i = 0;
+ while (i < 3 && alertButtonNames[typeIndex][i]) {
+ [alert addButtonWithTitle:(NSString*)alertButtonNames[typeIndex][i++]];
+ }
+ buttons = [alert buttons];
+ for (NSButton *b in buttons) {
+ NSString *ke = [b keyEquivalent];
- strcat(pathPtr, "/");
- strcat(pathPtr, saveName);
- }
+ if (([ke isEqualToString:@"\r"] || [ke isEqualToString:@"\033"]) &&
+ ![b keyEquivalentModifierMask]) {
+ [b setKeyEquivalent:@""];
+ }
+ }
+ [[buttons objectAtIndex: [buttons count]-1] setKeyEquivalent: @"\033"];
+ [[buttons objectAtIndex: defaultNativeButtonIndex-1]
+ setKeyEquivalent: @"\r"];
+ if (cmdObj) {
+ callbackInfo = ckalloc(sizeof(AlertCallbackInfo));
+ if (Tcl_IsShared(cmdObj)) {
+ cmdObj = Tcl_DuplicateObj(cmdObj);
+ }
+ Tcl_IncrRefCount(cmdObj);
+ }
+ callbackInfo->cmdObj = cmdObj;
+ callbackInfo->interp = interp;
+ callbackInfo->typeIndex = typeIndex;
+ parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window);
+ if (haveParentOption && parent && ![parent attachedSheet]) {
+ [alert beginSheetModalForWindow:parent modalDelegate:NSApp
+ didEndSelector:@selector(tkAlertDidEnd:returnCode:contextInfo:)
+ contextInfo:callbackInfo];
+ returnCode = cmdObj ? NSAlertOtherReturn :
+ [NSApp runModalForWindow:[alert window]];
+ } else {
+ returnCode = [alert runModal];
+ [NSApp tkAlertDidEnd:alert returnCode:returnCode
+ contextInfo:callbackInfo];
+ }
+ result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR;
+ end:
+ [alert release];
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ */
+#pragma mark [tk fontchooser] implementation (TIP 324)
+/*
+ *----------------------------------------------------------------------
+ */
- /*
- * Got a valid file name; put it in the result object.
- */
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXFont.h"
+
+typedef struct FontchooserData {
+ Tcl_Obj *titleObj;
+ Tcl_Obj *cmdObj;
+ Tk_Window parent;
+} FontchooserData;
+
+enum FontchooserEvent { FontchooserClosed, FontchooserSelection };
+
+static void FontchooserEvent(int kind);
+static Tcl_Obj * FontchooserCget(FontchooserData *fcdPtr,
+ int optionIndex);
+static int FontchooserConfigureCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int FontchooserShowCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int FontchooserHideCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static void FontchooserParentEventHandler(ClientData clientData,
+ XEvent *eventPtr);
+static void DeleteFontchooserData(ClientData clientData,
+ Tcl_Interp *interp);
+
+MODULE_SCOPE const TkEnsemble tkFontchooserEnsemble[];
+const TkEnsemble tkFontchooserEnsemble[] = {
+ { "configure", FontchooserConfigureCmd, NULL },
+ { "show", FontchooserShowCmd, NULL },
+ { "hide", FontchooserHideCmd, NULL },
+ { NULL, NULL, NULL }
+};
+
+static Tcl_Interp *fontchooserInterp = NULL;
+static NSFont *fontPanelFont = nil;
+static NSMutableDictionary *fontPanelFontAttributes = nil;
+
+static const char *const fontchooserOptionStrings[] = {
+ "-parent", "-title", "-font", "-command",
+ "-visible", NULL
+};
+enum FontchooserOption {
+ FontchooserParent, FontchooserTitle, FontchooserFont, FontchooserCmd,
+ FontchooserVisible
+};
+
+@implementation TKApplication(TKFontPanel)
+
+- (void) changeFont: (id) sender
+{
+ NSFontManager *fm = [NSFontManager sharedFontManager];
- if (multiple) {
- Tcl_ListObjAppendElement(interp, theResult,
- Tcl_NewStringObj(pathPtr, -1));
- } else {
- Tcl_SetStringObj(theResult, pathPtr, -1);
- }
+ if ([fm currentFontAction] == NSViaPanelFontAction) {
+ NSFont *font = [fm convertFont:fontPanelFont];
- nextFilename:
- ChkErr(AEDisposeDesc, &resultDesc);
+ if (![fontPanelFont isEqual:font]) {
+ [fontPanelFont release];
+ fontPanelFont = [font retain];
+ FontchooserEvent(FontchooserSelection);
}
-
- installResult:
- Tcl_SetObjResult(interp, theResult);
- result = TCL_OK;
- } else if (err == userCanceledErr) {
- Tcl_ResetResult(interp);
- result = TCL_OK;
}
+}
- /*
- * Clean up any allocated memory.
- */
+- (void) changeAttributes: (id) sender
+{
+ NSDictionary *attributes = [sender convertAttributes:
+ fontPanelFontAttributes];
- if (data.reply.validRecord) {
- ChkErr(NavDisposeReply, &data.reply);
- }
- if (data.saveNameRef) {
- CFRelease(data.saveNameRef);
- }
- if (options.saveFileName) {
- CFRelease(options.saveFileName);
+ if (![fontPanelFontAttributes isEqual:attributes]) {
+ [fontPanelFontAttributes setDictionary:attributes];
+ FontchooserEvent(FontchooserSelection);
}
- if (options.clientName) {
- CFRelease(options.clientName);
- }
- if (menuItemNames) {
- int i;
+}
- for (i = 0; i < ofdPtr->fl.numFilters; i++) {
- CFRelease(menuItemNames[i]);
- }
- ckfree((void *) menuItemNames);
- }
- if (options.popupExtension) {
- CFRelease(options.popupExtension);
+- (NSUInteger) validModesForFontPanel: (NSFontPanel *) fontPanel
+{
+ return (NSFontPanelStandardModesMask & ~NSFontPanelAllEffectsModeMask) |
+ NSFontPanelUnderlineEffectModeMask |
+ NSFontPanelStrikethroughEffectModeMask;
+}
+
+- (void) windowDidOrderOffScreen: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ if ([[notification object] isEqual:[[NSFontManager sharedFontManager]
+ fontPanel:NO]]) {
+ FontchooserEvent(FontchooserClosed);
}
- return result;
}
+@end
/*
*----------------------------------------------------------------------
*
- * OpenEventProc --
+ * FontchooserEvent --
*
- * NavServices event handling callback.
+ * This processes events generated by user interaction with the
+ * font panel.
*
* Results:
* None.
*
* Side effects:
- * None.
+ * Additional events may be place on the Tk event queue.
*
*----------------------------------------------------------------------
*/
-pascal void
-OpenEventProc(
- NavEventCallbackMessage callBackSelector,
- NavCBRecPtr callBackParams,
- NavCallBackUserData callBackUD)
+static void
+FontchooserEvent(
+ int kind)
{
- NavHandlerUserData *data = (NavHandlerUserData*) callBackUD;
- OpenFileData *ofd = data->ofdPtr;
-
- switch (callBackSelector) {
- case kNavCBStart:
- if (ofd && ofd->initialType >= 0) {
- /* Select initial filter */
- FileFilter *filterPtr = ofd->fl.filters;
- int i = ofd->initialType;
-
- while (filterPtr && i-- > 0) {
- filterPtr = filterPtr->next;
- }
- if (filterPtr) {
- NavMenuItemSpec selectItem;
-
- selectItem.version = kNavMenuItemSpecVersion;
- selectItem.menuCreator = 0;
- selectItem.menuType = ofd->initialType;
- selectItem.menuItemName[0] = strlen(filterPtr->name);
- strncpy((char *) &selectItem.menuItemName[1],
- filterPtr->name, 255);
- ChkErr(NavCustomControl, callBackParams->context,
- kNavCtlSelectCustomType, &selectItem);
- }
- }
- break;
- case kNavCBPopupMenuSelect:
- ofd->curType = ((NavMenuItemSpec *)
- callBackParams->eventData.eventDataParms.param)->menuType;
- break;
- case kNavCBAccept:
- case kNavCBCancel:
- if (data->sheet) {
- ChkErr(QuitAppModalLoopForWindow, data->dialogWindow);
- ChkErr(SetWindowModality, data->dialogWindow,
- data->origModality, data->origUnavailWindow);
- }
- break;
- case kNavCBUserAction:
- if (data->reply.validRecord) {
- ChkErr(NavDisposeReply, &data->reply);
- data->reply.validRecord = 0;
- }
- data->err = NavDialogGetReply(callBackParams->context,
- &data->reply);
- if (callBackParams->userAction == kNavUserActionSaveAs) {
- data->saveNameRef = NavDialogGetSaveFileName(
- callBackParams->context);
- if (data->saveNameRef) {
- CFRetain(data->saveNameRef);
+ FontchooserData *fcdPtr;
+ Tcl_Obj *fontObj;
+
+ if (!fontchooserInterp) {
+ return;
+ }
+ fcdPtr = Tcl_GetAssocData(fontchooserInterp, "::tk::fontchooser", NULL);
+ switch (kind) {
+ case FontchooserClosed:
+ if (fcdPtr->parent != None) {
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility");
+ fontchooserInterp = NULL;
+ }
+ break;
+ case FontchooserSelection:
+ fontObj = TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
+ fontPanelFont, fontPanelFontAttributes);
+ if (fontObj) {
+ if (fcdPtr->cmdObj) {
+ int objc, result;
+ Tcl_Obj **objv, **tmpv;
+
+ result = Tcl_ListObjGetElements(fontchooserInterp,
+ fcdPtr->cmdObj, &objc, &objv);
+ if (result == TCL_OK) {
+ tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
+ tmpv[objc] = fontObj;
+ TkBackgroundEvalObjv(fontchooserInterp, objc + 1, tmpv,
+ TCL_EVAL_GLOBAL);
+ ckfree(tmpv);
}
}
- break;
- case kNavCBTerminate:
- NavDialogDispose(callBackParams->context);
- break;
- case kNavCBEvent:
- TkMacOSXRunTclEventLoop();
- break;
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged");
+ }
+ break;
}
}
/*
*----------------------------------------------------------------------
*
- * OpenFileFilterProc --
+ * FontchooserCget --
*
- * NavServices file filter callback.
+ * Helper for the FontchooserConfigure command to return the
+ * current value of any of the options (which may be NULL in
+ * the structure)
*
* Results:
- * Whether to use the file in question.
+ * Tcl object of option value.
*
* Side effects:
* None.
@@ -1147,614 +1255,402 @@ OpenEventProc(
*----------------------------------------------------------------------
*/
-pascal Boolean
-OpenFileFilterProc(
- AEDesc *theItem,
- void *info,
- NavCallBackUserData callBackUD,
- NavFilterModes filterMode)
+static Tcl_Obj *
+FontchooserCget(
+ FontchooserData *fcdPtr,
+ int optionIndex)
{
- OpenFileData *ofdPtr = ((NavHandlerUserData *) callBackUD)->ofdPtr;
- int result = MATCHED;
-
- if (ofdPtr && ofdPtr->usePopup && ofdPtr->fl.numFilters > 0 &&
- ((theItem->descriptorType == typeFSS)
- || (theItem->descriptorType == typeFSRef))) {
- NavFileOrFolderInfo *theInfo = info;
- char fileName[256];
- OSType fileType;
- StringPtr fileNamePtr = NULL;
- Tcl_DString fileNameDString;
- int i;
- FileFilter *filterPtr;
-
- if (!theInfo->isFolder) {
- fileType = theInfo->fileAndFolder.fileInfo.finderInfo.fdType;
- Tcl_DStringInit(&fileNameDString);
-
- if (theItem->descriptorType == typeFSS) {
- int len;
-
- fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name;
- len = fileNamePtr[0];
- strncpy(fileName, (char *) fileNamePtr + 1, len);
- fileName[len] = '\0';
- fileNamePtr = (unsigned char *) fileName;
- } else if ((theItem->descriptorType == typeFSRef)) {
- OSStatus err;
- FSRef *theRef = (FSRef *) *theItem->dataHandle;
- HFSUniStr255 uniFileName;
-
- err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone,
- NULL, &uniFileName, NULL, NULL);
-
- if (err == noErr) {
- Tcl_UniCharToUtfDString((Tcl_UniChar *)uniFileName.unicode,
- uniFileName.length, &fileNameDString);
- fileNamePtr = (unsigned char *)
- Tcl_DStringValue(&fileNameDString);
- }
- }
- 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 = UNMATCHED;
- }
- } 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;
- }
- }
- }
- Tcl_DStringFree(&fileNameDString);
+ Tcl_Obj *resObj = NULL;
+
+ switch(optionIndex) {
+ case FontchooserParent:
+ if (fcdPtr->parent != None) {
+ resObj = Tcl_NewStringObj(
+ ((TkWindow *) fcdPtr->parent)->pathName, -1);
+ } else {
+ resObj = Tcl_NewStringObj(".", 1);
+ }
+ break;
+ case FontchooserTitle:
+ if (fcdPtr->titleObj) {
+ resObj = fcdPtr->titleObj;
+ } else {
+ resObj = Tcl_NewObj();
}
+ break;
+ case FontchooserFont:
+ resObj = TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
+ fontPanelFont, fontPanelFontAttributes);
+ if (!resObj) {
+ resObj = Tcl_NewObj();
+ }
+ break;
+ case FontchooserCmd:
+ if (fcdPtr->cmdObj) {
+ resObj = fcdPtr->cmdObj;
+ } else {
+ resObj = Tcl_NewObj();
+ }
+ break;
+ case FontchooserVisible:
+ resObj = Tcl_NewBooleanObj([[[NSFontManager sharedFontManager]
+ fontPanel:NO] isVisible]);
+ break;
+ default:
+ resObj = Tcl_NewObj();
}
- return (result == MATCHED);
+ return resObj;
}
/*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*
- * MatchOneType --
+ * FontchooserConfigureCmd --
*
- * Match a file with one file type in the list of file types.
+ * Implementation of the 'tk fontchooser configure' ensemble command.
+ * See the user documentation for what it does.
*
* Results:
- * Returns MATCHED if the file matches with the file type; returns
- * UNMATCHED otherwise.
+ * See the user documentation.
*
* Side effects:
- * None
+ * Per-interp data structure may be modified
*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*/
-Boolean
-MatchOneType(
- StringPtr fileNamePtr, /* Name of the file */
- OSType fileType, /* Type of the file, 0 means there was no
- * specified type. */
- OpenFileData *ofdPtr, /* Information about this file dialog */
- FileFilter *filterPtr) /* Match the file described by pb against this
- * filter */
+static int
+FontchooserConfigureCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
{
- FileFilterClause *clausePtr;
+ Tk_Window tkwin = (Tk_Window)clientData;
+ FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser",
+ NULL);
+ int i, r = TCL_OK;
/*
- * 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.
+ * With no arguments we return all the options in a dict
*/
- for (clausePtr = filterPtr->clauses; clausePtr;
- clausePtr = clausePtr->next) {
- int macMatched = 0;
- int globMatched = 0;
- GlobPattern *globPtr;
- MacFileType *mfPtr;
+ if (objc == 1) {
+ Tcl_Obj *keyObj, *valueObj;
+ Tcl_Obj *dictObj = Tcl_NewDictObj();
- if (clausePtr->patterns == NULL) {
- globMatched = 1;
+ for (i = 0; r == TCL_OK && fontchooserOptionStrings[i] != NULL; ++i) {
+ keyObj = Tcl_NewStringObj(fontchooserOptionStrings[i], -1);
+ valueObj = FontchooserCget(fcdPtr, i);
+ r = Tcl_DictObjPut(interp, dictObj, keyObj, valueObj);
}
- if (clausePtr->macTypes == NULL) {
- macMatched = 1;
+ if (r == TCL_OK) {
+ Tcl_SetObjResult(interp, dictObj);
}
+ return r;
+ }
- for (globPtr = clausePtr->patterns; globPtr;
- globPtr = globPtr->next) {
- char *q, *ext;
-
- if (fileNamePtr == NULL) {
- continue;
- }
- ext = globPtr->pattern;
+ for (i = 1; i < objc; i += 2) {
+ int optionIndex, len;
- if (ext[0] == '\0') {
- /*
- * We don't want any extensions: OK if the filename doesn't
- * have "." in it
- */
+ if (Tcl_GetIndexFromObj(interp, objv[i], fontchooserOptionStrings,
+ "option", 0, &optionIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ /*
+ * With one option and no arg, return the current value.
+ */
- for (q = (char*) fileNamePtr; *q; q++) {
- if (*q == '.') {
- goto glob_unmatched;
- }
- }
- goto glob_matched;
- }
+ Tcl_SetObjResult(interp, FontchooserCget(fcdPtr, optionIndex));
+ return TCL_OK;
+ }
+ if (i + 1 == objc) {
+ Tcl_AppendResult(interp, "value for \"",
+ Tcl_GetString(objv[i]), "\" missing", NULL);
+ return TCL_ERROR;
+ }
+ switch (optionIndex) {
+ case FontchooserVisible: {
+ const char *msg = "cannot change read-only option "
+ "\"-visible\": use the show or hide command";
- if (Tcl_StringMatch((char*) fileNamePtr, ext)) {
- goto glob_matched;
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, sizeof(msg)-1));
+ return TCL_ERROR;
}
- glob_unmatched:
- continue;
-
- glob_matched:
- globMatched = 1;
- break;
- }
+ case FontchooserParent: {
+ Tk_Window parent = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[i+1]), tkwin);
- for (mfPtr = clausePtr->macTypes; mfPtr; mfPtr = mfPtr->next) {
- if (fileType == mfPtr->type) {
- macMatched = 1;
+ if (parent == None) {
+ return TCL_ERROR;
+ }
+ if (fcdPtr->parent) {
+ Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ }
+ fcdPtr->parent = parent;
+ Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
break;
}
- }
+ case FontchooserTitle:
+ if (fcdPtr->titleObj) {
+ Tcl_DecrRefCount(fcdPtr->titleObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ fcdPtr->titleObj = objv[i+1];
+ if (Tcl_IsShared(fcdPtr->titleObj)) {
+ fcdPtr->titleObj = Tcl_DuplicateObj(fcdPtr->titleObj);
+ }
+ Tcl_IncrRefCount(fcdPtr->titleObj);
+ } else {
+ fcdPtr->titleObj = NULL;
+ }
+ break;
+ case FontchooserFont:
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ Tk_Font f = Tk_AllocFontFromObj(interp, tkwin, objv[i+1]);
- /*
- * On Mac OS X, it is not uncommon for files to have NO file type. But
- * folks with Tcl code on Classic MacOS pretty much assume that a
- * generic file will have type TEXT. So if we were strict about
- * matching types when the source file had NO type set, they would
- * have to add another rule always with no fileType. To avoid that, we
- * pass the macMatch side of the test if no fileType is set.
- */
+ if (!f) {
+ return TCL_ERROR;
+ }
+ [fontPanelFont autorelease];
+ fontPanelFont = [TkMacOSXNSFontForFont(f) retain];
+ [fontPanelFontAttributes setDictionary:
+ TkMacOSXNSFontAttributesForFont(f)];
+ [fontPanelFontAttributes removeObjectsForKeys:[NSArray
+ arrayWithObjects:NSFontAttributeName,
+ NSLigatureAttributeName, NSKernAttributeName,
+ nil]];
+ Tk_FreeFont(f);
+ } else {
+ [fontPanelFont release];
+ fontPanelFont = nil;
+ [fontPanelFontAttributes removeAllObjects];
+ }
- if (globMatched && (macMatched || (fileType == 0))) {
- return MATCHED;
+ NSFontManager *fm = [NSFontManager sharedFontManager];
+ NSFontPanel *fp = [fm fontPanel:NO];
+
+ [fp setPanelFont:fontPanelFont isMultiple:NO];
+ [fm setSelectedFont:fontPanelFont isMultiple:NO];
+ [fm setSelectedAttributes:fontPanelFontAttributes
+ isMultiple:NO];
+ if ([fp isVisible]) {
+ TkSendVirtualEvent(fcdPtr->parent,
+ "TkFontchooserFontChanged");
+ }
+ break;
+ case FontchooserCmd:
+ if (fcdPtr->cmdObj) {
+ Tcl_DecrRefCount(fcdPtr->cmdObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ fcdPtr->cmdObj = objv[i+1];
+ if (Tcl_IsShared(fcdPtr->cmdObj)) {
+ fcdPtr->cmdObj = Tcl_DuplicateObj(fcdPtr->cmdObj);
+ }
+ Tcl_IncrRefCount(fcdPtr->cmdObj);
+ } else {
+ fcdPtr->cmdObj = NULL;
+ }
+ break;
}
}
-
- return UNMATCHED;
+ return TCL_OK;
}
/*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*
- * TkAboutDlg --
+ * FontchooserShowCmd --
*
- * Displays the default Tk About box. This code uses Macintosh resources
- * to define the content of the About Box.
+ * Implements the 'tk fontchooser show' ensemble command. The
+ * per-interp configuration data for the dialog is held in an interp
+ * associated structure.
*
* Results:
- * None.
+ * See the user documentation.
*
* Side effects:
- * None.
+ * Font Panel may be shown.
*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*/
-void
-TkAboutDlg(void)
+static int
+FontchooserShowCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
{
- DialogPtr aboutDlog;
- WindowRef windowRef;
- short itemHit = -9;
+ FontchooserData *fcdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser",
+ NULL);
- aboutDlog = GetNewDialog(TK_DEFAULT_ABOUT, NULL, (void *) (-1));
- if (!aboutDlog) {
- return;
+ if (fcdPtr->parent == None) {
+ fcdPtr->parent = (Tk_Window) clientData;
+ Tk_CreateEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ }
+ NSFontManager *fm = [NSFontManager sharedFontManager];
+ NSFontPanel *fp = [fm fontPanel:YES];
+ if ([fp delegate] != NSApp) {
+ [fp setDelegate:NSApp];
}
- windowRef = GetDialogWindow(aboutDlog);
- SelectWindow(windowRef);
- TkMacOSXTrackingLoop(1);
- while (itemHit != 1) {
- ModalDialog(NULL, &itemHit);
+ if (![fp isVisible]) {
+ [fm orderFrontFontPanel:NSApp];
+ TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility");
}
- TkMacOSXTrackingLoop(0);
- DisposeDialog(aboutDlog);
- SelectWindow(ActiveNonFloatingWindow());
+ fontchooserInterp = interp;
+
+ return TCL_OK;
}
/*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*
- * Tk_MessageBoxObjCmd --
+ * FontchooserHideCmd --
*
- * Implements the tk_messageBox in native Mac OS X style.
+ * Implementation of the 'tk fontchooser hide' ensemble. See the
+ * user documentation for details.
*
* Results:
- * A standard Tcl result.
+ * See the user documentation.
*
* Side effects:
- * none
+ * Font Panel may be hidden.
*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*/
-int
-Tk_MessageBoxObjCmd(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+static int
+FontchooserHideCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
{
- Tk_Window tkwin = clientData;
- AlertStdCFStringAlertParamRec paramCFStringRec;
- AlertType alertType;
- DialogRef dialogRef;
- CFStringRef messageTextCF = NULL, finemessageTextCF = NULL;
- OSStatus err;
- SInt16 itemHit;
- Boolean haveDefaultOption = false, haveParentOption = false;
- char *str;
- int index, defaultButtonIndex;
- int defaultNativeButtonIndex; /* 1, 2, 3: right to left */
- int typeIndex, i, indexDefaultOption = 0, result = TCL_ERROR;
-
- static const char *movableAlertStrings[] = {
- "-default", "-detail", "-icon", "-message", "-parent", "-title",
- "-type", NULL
- };
- static const char *movableTypeStrings[] = {
- "abortretryignore", "ok", "okcancel", "retrycancel", "yesno",
- "yesnocancel", NULL
- };
- static const char *movableButtonStrings[] = {
- "abort", "retry", "ignore", "ok", "cancel", "yes", "no", NULL
- };
- static const char *movableIconStrings[] = {
- "error", "info", "question", "warning", NULL
- };
- enum movableAlertOptions {
- ALERT_DEFAULT, ALERT_DETAIL, ALERT_ICON, ALERT_MESSAGE, ALERT_PARENT,
- ALERT_TITLE, ALERT_TYPE
- };
- enum movableTypeOptions {
- TYPE_ABORTRETRYIGNORE, TYPE_OK, TYPE_OKCANCEL, TYPE_RETRYCANCEL,
- TYPE_YESNO, TYPE_YESNOCANCEL
- };
- enum movableButtonOptions {
- TEXT_ABORT, TEXT_RETRY, TEXT_IGNORE, TEXT_OK, TEXT_CANCEL, TEXT_YES,
- TEXT_NO
- };
- enum movableIconOptions {
- ICON_ERROR, ICON_INFO, ICON_QUESTION, ICON_WARNING
- };
-
- /*
- * Need to map from 'movableButtonStrings' and its corresponding integer,
- * index to the native button index, which is 1, 2, 3, from right to left.
- * This is necessary to do for each separate '-type' of button sets.
- */
-
- short buttonIndexAndTypeToNativeButtonIndex[][7] = {
- /* abort retry ignore ok cancel yes no */
- {1, 2, 3, 0, 0, 0, 0}, /* abortretryignore */
- {0, 0, 0, 1, 0, 0, 0}, /* ok */
- {0, 0, 0, 1, 2, 0, 0}, /* okcancel */
- {0, 1, 0, 0, 2, 0, 0}, /* retrycancel */
- {0, 0, 0, 0, 0, 1, 2}, /* yesno */
- {0, 0, 0, 0, 3, 1, 2}, /* yesnocancel */
- };
-
- /*
- * Need also the inverse mapping, from native button (1, 2, 3) to the
- * descriptive button text string index.
- */
-
- short nativeButtonIndexAndTypeToButtonIndex[][4] = {
- {-1, 0, 1, 2}, /* abortretryignore */
- {-1, 3, 0, 0}, /* ok */
- {-1, 3, 4, 0}, /* okcancel */
- {-1, 1, 4, 0}, /* retrycancel */
- {-1, 5, 6, 0}, /* yesno */
- {-1, 5, 6, 4}, /* yesnocancel */
- };
-
- alertType = kAlertPlainAlert;
- typeIndex = TYPE_OK;
-
- ChkErr(GetStandardAlertDefaultParams, &paramCFStringRec,
- kStdCFStringAlertVersionOne);
- paramCFStringRec.movable = true;
- paramCFStringRec.helpButton = false;
- paramCFStringRec.defaultButton = kAlertStdAlertOKButton;
- paramCFStringRec.cancelButton = kAlertStdAlertCancelButton;
-
- for (i = 1; i < objc; i += 2) {
- int iconIndex;
- char *string;
-
- if (Tcl_GetIndexFromObj(interp, objv[i], movableAlertStrings, "option",
- TCL_EXACT, &index) != TCL_OK) {
- goto end;
- }
- if (i + 1 == objc) {
- string = Tcl_GetString(objv[i]);
- Tcl_AppendResult(interp, "value for \"", string, "\" missing",
- NULL);
- goto end;
- }
-
- switch (index) {
- case ALERT_DEFAULT:
- /*
- * Need to postpone processing of this option until we are sure to
- * know the '-type' as well.
- */
-
- haveDefaultOption = true;
- indexDefaultOption = i;
- break;
-
- case ALERT_DETAIL:
- str = Tcl_GetString(objv[i + 1]);
- if (finemessageTextCF) {
- CFRelease(finemessageTextCF);
- }
- finemessageTextCF = CFStringCreateWithCString(NULL, str,
- kCFStringEncodingUTF8);
- break;
-
- case ALERT_ICON:
- if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableIconStrings,
- "value", TCL_EXACT, &iconIndex) != TCL_OK) {
- goto end;
- }
- switch (iconIndex) {
- case ICON_ERROR:
- alertType = kAlertStopAlert;
- break;
- case ICON_INFO:
- alertType = kAlertNoteAlert;
- break;
- case ICON_QUESTION:
- alertType = kAlertCautionAlert;
- break;
- case ICON_WARNING:
- alertType = kAlertCautionAlert;
- break;
- }
- break;
-
- case ALERT_MESSAGE:
- str = Tcl_GetString(objv[i + 1]);
- if (messageTextCF) {
- CFRelease(messageTextCF);
- }
- messageTextCF = CFStringCreateWithCString(NULL, str,
- kCFStringEncodingUTF8);
- break;
-
- case ALERT_PARENT:
- str = Tcl_GetString(objv[i + 1]);
- tkwin = Tk_NameToWindow(interp, str, tkwin);
- if (tkwin == NULL) {
- goto end;
- }
- if (((TkWindow *) tkwin)->window != None &&
- TkMacOSXHostToplevelExists(tkwin)) {
- haveParentOption = true;
- }
- break;
-
- case ALERT_TITLE:
- break;
-
- case ALERT_TYPE:
- if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableTypeStrings,
- "value", TCL_EXACT, &typeIndex) != TCL_OK) {
- goto end;
- }
- switch (typeIndex) {
- case TYPE_ABORTRETRYIGNORE:
- paramCFStringRec.defaultText = CFSTR("Abort");
- paramCFStringRec.cancelText = CFSTR("Retry");
- paramCFStringRec.otherText = CFSTR("Ignore");
- paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
- break;
- case TYPE_OK:
- paramCFStringRec.defaultText = CFSTR("OK");
- break;
- case TYPE_OKCANCEL:
- paramCFStringRec.defaultText = CFSTR("OK");
- paramCFStringRec.cancelText = CFSTR("Cancel");
- break;
- case TYPE_RETRYCANCEL:
- paramCFStringRec.defaultText = CFSTR("Retry");
- paramCFStringRec.cancelText = CFSTR("Cancel");
- break;
- case TYPE_YESNO:
- paramCFStringRec.defaultText = CFSTR("Yes");
- paramCFStringRec.cancelText = CFSTR("No");
- break;
- case TYPE_YESNOCANCEL:
- paramCFStringRec.defaultText = CFSTR("Yes");
- paramCFStringRec.cancelText = CFSTR("No");
- paramCFStringRec.otherText = CFSTR("Cancel");
- paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
- break;
- }
- break;
- }
+ NSFontPanel *fp = [[NSFontManager sharedFontManager] fontPanel:NO];
+ if ([fp isVisible]) {
+ [fp orderOut:NSApp];
}
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserParentEventHandler --
+ *
+ * Event handler for StructureNotify events on the font chooser's parent
+ * window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Font chooser parent info is cleared and font panel is hidden.
+ *
+ * ----------------------------------------------------------------------
+ */
- if (haveDefaultOption) {
- /*
- * Any '-default' option needs to know the '-type' option, which is why
- * we do this here.
- */
-
- str = Tcl_GetString(objv[indexDefaultOption + 1]);
- if (Tcl_GetIndexFromObj(interp, objv[indexDefaultOption + 1],
- movableButtonStrings, "value", TCL_EXACT, &defaultButtonIndex)
- != TCL_OK) {
- goto end;
- }
-
- /*
- * Need to map from "ok" etc. to 1, 2, 3, right to left.
- */
+static void
+FontchooserParentEventHandler(
+ ClientData clientData,
+ XEvent *eventPtr)
+{
+ FontchooserData *fcdPtr = clientData;
- defaultNativeButtonIndex =
- buttonIndexAndTypeToNativeButtonIndex[typeIndex][defaultButtonIndex];
- if (defaultNativeButtonIndex == 0) {
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj("Illegal default option", -1));
- goto end;
- }
- paramCFStringRec.defaultButton = defaultNativeButtonIndex;
- if (paramCFStringRec.cancelButton == defaultNativeButtonIndex) {
- paramCFStringRec.cancelButton = 0;
- }
- }
- ChkErr(SetThemeCursor, kThemeArrowCursor);
-
- if (haveParentOption) {
- AlertHandlerUserData data;
- static EventHandlerUPP handler = NULL;
- WindowRef windowRef;
- const EventTypeSpec kEvents[] = {
- {kEventClassCommand, kEventProcessCommand}
- };
-
- bzero(&data, sizeof(data));
- if (!handler) {
- handler = NewEventHandlerUPP(AlertHandler);
- }
- windowRef = TkMacOSXDrawableWindow(Tk_WindowId(tkwin));
- if (!windowRef) {
- goto end;
- }
- err = ChkErr(CreateStandardSheet, alertType, messageTextCF,
- finemessageTextCF, &paramCFStringRec, NULL, &dialogRef);
- if(err != noErr) {
- goto end;
- }
- data.dialogWindow = GetDialogWindow(dialogRef);
- err = ChkErr(ShowSheetWindow, data.dialogWindow, windowRef);
- if(err != noErr) {
- DisposeDialog(dialogRef);
- goto end;
- }
- ChkErr(GetWindowModality, data.dialogWindow, &data.origModality,
- &data.origUnavailWindow);
- ChkErr(SetWindowModality, data.dialogWindow, kWindowModalityAppModal,
- NULL);
- ChkErr(InstallEventHandler, GetWindowEventTarget(data.dialogWindow),
- handler, GetEventTypeCount(kEvents), kEvents, &data,
- &data.handlerRef);
- TkMacOSXTrackingLoop(1);
- ChkErr(RunAppModalLoopForWindow, data.dialogWindow);
- TkMacOSXTrackingLoop(0);
- itemHit = data.buttonIndex;
- } else {
- err = ChkErr(CreateStandardAlert, alertType, messageTextCF,
- finemessageTextCF, &paramCFStringRec, &dialogRef);
- if(err != noErr) {
- goto end;
- }
- TkMacOSXTrackingLoop(1);
- err = ChkErr(RunStandardAlert, dialogRef, NULL, &itemHit);
- TkMacOSXTrackingLoop(0);
- if (err != noErr) {
- goto end;
- }
+ if (eventPtr->type == DestroyNotify) {
+ Tk_DeleteEventHandler(fcdPtr->parent, StructureNotifyMask,
+ FontchooserParentEventHandler, fcdPtr);
+ fcdPtr->parent = None;
+ FontchooserHideCmd(NULL, NULL, 0, NULL);
}
- if (err == noErr) {
- /*
- * Map 'itemHit' (1, 2, 3) to descriptive text string.
- */
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * DeleteFontchooserData --
+ *
+ * Clean up the font chooser configuration data when the interp is
+ * destroyed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * per-interp configuration data is destroyed.
+ *
+ * ----------------------------------------------------------------------
+ */
- int ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit];
+static void
+DeleteFontchooserData(
+ ClientData clientData,
+ Tcl_Interp *interp)
+{
+ FontchooserData *fcdPtr = clientData;
- Tcl_SetObjResult(interp, Tcl_NewStringObj(movableButtonStrings[ind],
- -1));
- result = TCL_OK;
+ if (fcdPtr->titleObj) {
+ Tcl_DecrRefCount(fcdPtr->titleObj);
}
-
- end:
- if (finemessageTextCF) {
- CFRelease(finemessageTextCF);
+ if (fcdPtr->cmdObj) {
+ Tcl_DecrRefCount(fcdPtr->cmdObj);
}
- if (messageTextCF) {
- CFRelease(messageTextCF);
+ ckfree(fcdPtr);
+
+ if (fontchooserInterp == interp) {
+ fontchooserInterp = NULL;
}
- return result;
}
/*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*
- * AlertHandler --
+ * TkInitFontchooser --
*
- * Carbon event handler for the Standard Sheet dialog.
+ * Associate the font chooser configuration data with the Tcl
+ * interpreter. There is one font chooser per interp.
*
* Results:
- * OSStatus if event handled or not.
+ * None.
*
* Side effects:
- * May set userData.
+ * per-interp configuration data is destroyed.
*
- *----------------------------------------------------------------------
+ * ----------------------------------------------------------------------
*/
-OSStatus
-AlertHandler(
- EventHandlerCallRef callRef,
- EventRef eventRef,
- void *userData)
+MODULE_SCOPE int
+TkInitFontchooser(
+ Tcl_Interp *interp,
+ ClientData clientData)
{
- AlertHandlerUserData *data = userData;
- HICommand cmd;
-
- ChkErr(GetEventParameter,eventRef, kEventParamDirectObject, typeHICommand,
- NULL, sizeof(cmd), NULL, &cmd);
- switch (cmd.commandID) {
- case kHICommandOK:
- data->buttonIndex = 1;
- break;
- case kHICommandCancel:
- data->buttonIndex = 2;
- break;
- case kHICommandOther:
- data->buttonIndex = 3;
- break;
+ FontchooserData *fcdPtr = ckalloc(sizeof(FontchooserData));
+
+ bzero(fcdPtr, sizeof(FontchooserData));
+ Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteFontchooserData,
+ fcdPtr);
+ if (!fontPanelFontAttributes) {
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+ fontPanelFontAttributes = [NSMutableDictionary new];
+ [pool drain];
}
- if (data->buttonIndex) {
- ChkErr(QuitAppModalLoopForWindow, data->dialogWindow);
- ChkErr(RemoveEventHandler, data->handlerRef);
- ChkErr(SetWindowModality, data->dialogWindow,
- data->origModality, data->origUnavailWindow);
- }
- return eventNotHandledErr;
+ return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index db498f9..806cbf4 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -6,8 +6,8 @@
* Xlib functions.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -17,9 +17,11 @@
#include "tkMacOSXDebug.h"
#include "xbytes.h"
+
/*
#ifdef TK_MAC_DEBUG
#define TK_MAC_DEBUG_DRAWING
+#define TK_MAC_DEBUG_IMAGE_DRAWING
#endif
*/
@@ -31,18 +33,6 @@
*/
#define NON_AA_CG_OFFSET .999
-/*
- * Temporary region that can be reused.
- */
-
-RgnHandle tkMacOSXtmpQdRgn = NULL;
-
-int tkMacOSXUseCGDrawing = 1;
-
-int tkPictureIsOpen;
-
-static PixPatHandle penPat = NULL, tmpPixPat = NULL;
-
static int cgAntiAliasLimit = 0;
#define notAA(w) ((w) < cgAntiAliasLimit)
@@ -54,7 +44,11 @@ static int useThemedFrame = 0;
*/
static void ClipToGC(Drawable d, GC gc, HIShapeRef *clipRgnPtr);
-static void NoQDClip(CGrafPtr port);
+static CGImageRef CreateCGImageWithXImage(XImage *ximage);
+static CGContextRef GetCGContextForDrawable(Drawable d);
+static void DrawCGImage(Drawable d, GC gc, CGContextRef context, CGImageRef image,
+ unsigned long imageForeground, unsigned long imageBackground,
+ CGRect imageBounds, CGRect srcBounds, CGRect dstBounds);
/*
@@ -87,11 +81,6 @@ TkMacOSXInitCGDrawing(
if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) {
Tcl_ResetResult(interp);
}
- if (Tcl_LinkVar(interp, "::tk::mac::useCGDrawing",
- (char *) &tkMacOSXUseCGDrawing, TCL_LINK_BOOLEAN) != TCL_OK) {
- Tcl_ResetResult(interp);
- }
- tkMacOSXUseCGDrawing = enable;
if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit",
(char *) &cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) {
@@ -111,17 +100,14 @@ TkMacOSXInitCGDrawing(
(char *) &useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) {
Tcl_ResetResult(interp);
}
-
- if (tkMacOSXtmpQdRgn == NULL) {
- tkMacOSXtmpQdRgn = NewRgn();
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (Tcl_LinkVar(interp, "::tk::mac::useCompatibilityMetrics",
+ (char *) &tkMacOSXUseCompatibilityMetrics, TCL_LINK_BOOLEAN)
+ != TCL_OK) {
+ Tcl_ResetResult(interp);
}
+#endif
}
-#ifdef TK_MAC_DEBUG_DRAWING
- TkMacOSXInitNamedDebugSymbol(QD, void, QD_DebugPrint, char*);
- if (QD_DebugPrint) {
- ; /* gdb: b *QD_DebugPrint */
- }
-#endif /* TK_MAC_DEBUG_WINDOWS */
return TCL_OK;
}
@@ -157,53 +143,76 @@ XCopyArea(
int dest_y)
{
TkMacOSXDrawingContext dc;
- MacDrawable *srcDraw = (MacDrawable *) src, *dstDraw = (MacDrawable *) dst;
+ MacDrawable *srcDraw = (MacDrawable *) src;
display->request++;
if (!width || !height) {
/* TkMacOSXDbgMsg("Drawing of emtpy area requested"); */
return;
}
- {
- CGrafPtr srcPort;
-
- srcPort = TkMacOSXGetDrawablePort(src);
- if (srcPort) {
- Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
- const BitMap *srcBit, *dstBit;
- RGBColor black = {0, 0, 0}, white = {0xffff, 0xffff, 0xffff};
-
- if (!TkMacOSXSetupDrawingContext(dst, gc, 0, &dc)) {
- return;
+ if (srcDraw->flags & TK_IS_PIXMAP) {
+ if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGImageRef img = TkMacOSXCreateCGImageWithDrawable(src);
+
+ if (img) {
+ DrawCGImage(dst, gc, dc.context, img, gc->foreground,
+ gc->background, CGRectMake(0, 0,
+ srcDraw->size.width, srcDraw->size.height),
+ CGRectMake(src_x, src_y, width, height),
+ CGRectMake(dest_x, dest_y, width, height));
+ CFRelease(img);
+ } else {
+ TkMacOSXDbgMsg("Invalid source drawable");
}
- if (dc.context) {
- TkMacOSXDbgMsg("Ignored CG drawing of QD drawable");
- goto end;
+ } else {
+ TkMacOSXDbgMsg("Invalid destination drawable");
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+ } else if (TkMacOSXDrawableWindow(src)) {
+ NSView *view = TkMacOSXDrawableView(srcDraw);
+ NSWindow *w = [view window];
+ NSInteger gs = [w windowNumber] > 0 ? [w gState] : 0;
+ /* // alternative using per-view gState:
+ NSInteger gs = [view gState];
+ if (!gs) {
+ [view allocateGState];
+ if ([view lockFocusIfCanDraw]) {
+ [view unlockFocus];
}
- if (!dc.port) {
- TkMacOSXDbgMsg("Invalid destination drawable");
- goto end;
+ gs = [view gState];
+ }
+ */
+ if (!gs || !TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ NSGraphicsContext *gc = nil;
+ CGFloat boundsH = [view bounds].size.height;
+ NSRect srcRect = NSMakeRect(srcDraw->xOff + src_x, boundsH -
+ height - (srcDraw->yOff + src_y), width, height);
+
+ if (((MacDrawable *) dst)->flags & TK_IS_PIXMAP) {
+ gc = [NSGraphicsContext graphicsContextWithGraphicsPort:
+ dc.context flipped:NO];
+ if (gc) {
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext:gc];
+ }
}
- srcBit = GetPortBitMapForCopyBits(srcPort);
- dstBit = GetPortBitMapForCopyBits(dc.port);
- SetRect(srcPtr, srcDraw->xOff + src_x, srcDraw->yOff + src_y,
- srcDraw->xOff + src_x + width,
- srcDraw->yOff + src_y + height);
- if (tkPictureIsOpen) {
- dstPtr = srcPtr;
- } else {
- SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
- dstDraw->xOff + dest_x + width,
- dstDraw->yOff + dest_y + height);
+ NSCopyBits(gs, srcRect, NSMakePoint(dest_x,
+ dc.portBounds.size.height - dest_y));
+ if (gc) {
+ [NSGraphicsContext restoreGraphicsState];
}
- RGBForeColor(&black);
- RGBBackColor(&white);
- CopyBits(srcBit, dstBit, srcPtr, dstPtr, srcCopy, NULL);
-end:
- TkMacOSXRestoreDrawingContext(&dc);
} else {
- TkMacOSXDbgMsg("Invalid source drawable");
+ TkMacOSXDbgMsg("Invalid destination drawable");
}
+ TkMacOSXRestoreDrawingContext(&dc);
+ } else {
+ TkMacOSXDbgMsg("Invalid source drawable");
}
}
@@ -241,7 +250,7 @@ XCopyPlane(
unsigned long plane) /* Which plane to copy. */
{
TkMacOSXDrawingContext dc;
- MacDrawable *srcDraw = (MacDrawable *) src, *dstDraw = (MacDrawable *) dst;
+ MacDrawable *srcDraw = (MacDrawable *) src;
display->request++;
if (!width || !height) {
@@ -251,73 +260,37 @@ XCopyPlane(
if (plane != 1) {
Tcl_Panic("Unexpected plane specified for XCopyPlane");
}
- {
- CGrafPtr srcPort;
+ if (srcDraw->flags & TK_IS_PIXMAP) {
+ if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) {
+ return;
+ }
+ if (dc.context) {
+ CGImageRef img = TkMacOSXCreateCGImageWithDrawable(src);
- srcPort = TkMacOSXGetDrawablePort(src);
- if (srcPort) {
- Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
- const BitMap *srcBit, *dstBit;
- TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask;
+ if (img) {
+ TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask;
+ unsigned long imageBackground = gc->background;
- if (!TkMacOSXSetupDrawingContext(dst, gc, 0, &dc)) {
- return;
- }
- if (dc.context) {
- TkMacOSXDbgMsg("Ignored CG drawing of QD drawable");
- goto end;
- }
- if (!dc.port) {
- TkMacOSXDbgMsg("Invalid destination drawable");
- goto end;
- }
- srcBit = GetPortBitMapForCopyBits(srcPort);
- dstBit = GetPortBitMapForCopyBits(dc.port);
- SetRect(srcPtr, srcDraw->xOff + src_x, srcDraw->yOff + src_y,
- srcDraw->xOff + src_x + width,
- srcDraw->yOff + src_y + height);
- if (tkPictureIsOpen) {
- dstPtr = srcPtr;
- } else {
- SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
- dstDraw->xOff + dest_x + width,
- dstDraw->yOff + dest_y + height);
- }
- TkMacOSXSetColorInPort(gc->foreground, 1, NULL, dc.port);
- if (!clipPtr || clipPtr->type == TKP_CLIP_REGION) {
- /*
- * Opaque bitmaps.
- */
-
- TkMacOSXSetColorInPort(gc->background, 0, NULL, dc.port);
- CopyBits(srcBit, dstBit, srcPtr, dstPtr, srcCopy, NULL);
- } else if (clipPtr->type == TKP_CLIP_PIXMAP) {
- if (clipPtr->value.pixmap == src) {
- /*
- * Transparent bitmaps. If it's color ignore the forecolor.
- */
- short tmode = GetPixDepth(GetPortPixMap(srcPort)) == 1 ?
- srcOr : transparent;
-
- CopyBits(srcBit, dstBit, srcPtr, dstPtr, tmode, NULL);
- } else {
- /*
- * Two arbitrary bitmaps.
- */
-
- CGrafPtr mskPort = TkMacOSXGetDrawablePort(
- clipPtr->value.pixmap);
- const BitMap *mskBit = GetPortBitMapForCopyBits(mskPort);
-
- CopyDeepMask(srcBit, mskBit, dstBit, srcPtr, srcPtr,
- dstPtr, srcCopy, NULL);
+ if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP &&
+ clipPtr->value.pixmap == src) {
+ imageBackground = TRANSPARENT_PIXEL << 24;
}
+ DrawCGImage(dst, gc, dc.context, img, gc->foreground,
+ imageBackground, CGRectMake(0, 0,
+ srcDraw->size.width, srcDraw->size.height),
+ CGRectMake(src_x, src_y, width, height),
+ CGRectMake(dest_x, dest_y, width, height));
+ CFRelease(img);
+ } else {
+ TkMacOSXDbgMsg("Invalid source drawable");
}
-end:
- TkMacOSXRestoreDrawingContext(&dc);
} else {
- TkMacOSXDbgMsg("Invalid source drawable");
+ TkMacOSXDbgMsg("Invalid destination drawable");
}
+ TkMacOSXRestoreDrawingContext(&dc);
+ } else {
+ XCopyArea(display, src, dst, gc, src_x, src_y, width, height, dest_x,
+ dest_y);
}
}
@@ -354,182 +327,424 @@ TkPutImage(
unsigned int height) /* distination and source. */
{
TkMacOSXDrawingContext dc;
- MacDrawable *dstDraw = (MacDrawable *) d;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
- TkMacOSXDbgMsg("Ignored CG drawing of XImage");
- } else {
- Rect srcRect, dstRect, *srcPtr = &srcRect, *dstPtr = &dstRect;
- const BitMap *dstBit;
- RGBColor black = {0, 0, 0}, white = {0xffff, 0xffff, 0xffff};
- int i, j;
- char *newData = NULL;
- char *dataPtr, *newPtr, *oldPtr;
- int rowBytes = image->bytes_per_line, sliceRowBytes, lastSliceRowBytes;
- int slices, sliceWidth, lastSliceWidth;
-
- dstBit = GetPortBitMapForCopyBits(dc.port);
- SetRect(srcPtr, src_x, src_y, src_x + width, src_y + height);
- if (tkPictureIsOpen) {
- dstPtr = srcPtr;
+ CGImageRef img = CreateCGImageWithXImage(image);
+
+ if (img) {
+ DrawCGImage(d, gc, dc.context, img, gc->foreground, gc->background,
+ CGRectMake(0, 0, image->width, image->height),
+ CGRectMake(src_x, src_y, width, height),
+ CGRectMake(dest_x, dest_y, width, height));
+ CFRelease(img);
} else {
- SetRect(dstPtr, dstDraw->xOff + dest_x, dstDraw->yOff + dest_y,
- dstDraw->xOff + dest_x + width,
- dstDraw->yOff + dest_y + height);
+ TkMacOSXDbgMsg("Invalid source drawable");
}
- RGBForeColor(&black);
- RGBBackColor(&white);
- if (image->obdata) {
- /*
- * Image from XGetImage, copy from containing GWorld directly.
- */
+ } else {
+ TkMacOSXDbgMsg("Invalid destination drawable");
+ }
+ TkMacOSXRestoreDrawingContext(&dc);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateCGImageWithXImage --
+ *
+ * Create CGImage from XImage, copying the image data.
+ *
+ * Results:
+ * CGImage, release after use.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
- CopyBits(GetPortBitMapForCopyBits(TkMacOSXGetDrawablePort(
- (Drawable)image->obdata)), dstBit,
- srcPtr, dstPtr, srcCopy, NULL);
- } else if (image->depth == 1) {
- /*
- * BW image
- */
-
- const int maxRowBytes = 0x3ffe;
- BitMap bitmap;
- int odd;
-
- if (rowBytes > maxRowBytes) {
- slices = rowBytes / maxRowBytes;
- sliceRowBytes = maxRowBytes;
- lastSliceRowBytes = rowBytes - (slices * maxRowBytes);
- if (!lastSliceRowBytes) {
- slices--;
- lastSliceRowBytes = maxRowBytes;
- }
- sliceWidth = (long) image->width * maxRowBytes / rowBytes;
- lastSliceWidth = image->width - (sliceWidth * slices);
- } else {
- slices = 0;
- sliceRowBytes = lastSliceRowBytes = rowBytes;
- sliceWidth = lastSliceWidth = image->width;
+static void ReleaseData(void *info, const void *data, size_t size) {
+ ckfree(info);
+}
+
+CGImageRef
+CreateCGImageWithXImage(
+ XImage *image)
+{
+ CGImageRef img = NULL;
+ size_t bitsPerComponent, bitsPerPixel;
+ size_t len = image->bytes_per_line * image->height;
+ const CGFloat *decode = NULL;
+ CGBitmapInfo bitmapInfo;
+ CGDataProviderRef provider = NULL;
+ char *data = NULL;
+ CGDataProviderReleaseDataCallback releaseData = ReleaseData;
+
+ if (image->obdata) {
+ /*
+ * Image from XGetImage
+ */
+
+ img = TkMacOSXCreateCGImageWithDrawable((Pixmap) image->obdata);
+ } else if (image->bits_per_pixel == 1) {
+ /*
+ * BW image
+ */
+
+ static const CGFloat decodeWB[2] = {1, 0};
+
+ bitsPerComponent = 1;
+ bitsPerPixel = 1;
+ decode = decodeWB;
+ if (image->bitmap_bit_order != MSBFirst) {
+ char *srcPtr = image->data + image->xoffset;
+ char *endPtr = srcPtr + len;
+ char *destPtr = (data = ckalloc(len));
+
+ while (srcPtr < endPtr) {
+ *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))];
}
- bitmap.bounds.top = bitmap.bounds.left = 0;
- bitmap.bounds.bottom = (short) image->height;
- dataPtr = image->data + image->xoffset;
- do {
- if (slices) {
- bitmap.bounds.right = bitmap.bounds.left + sliceWidth;
- } else {
- sliceRowBytes = lastSliceRowBytes;
- bitmap.bounds.right = bitmap.bounds.left + lastSliceWidth;
- }
- oldPtr = dataPtr;
- odd = sliceRowBytes % 2;
- if (!newData) {
- newData = ckalloc(image->height * (sliceRowBytes+odd));
- }
- newPtr = newData;
- if (image->bitmap_bit_order != MSBFirst) {
- for (i = 0; i < image->height; i++) {
- for (j = 0; j < sliceRowBytes; j++) {
- *newPtr = xBitReverseTable[(unsigned char)*oldPtr];
- newPtr++; oldPtr++;
- }
- if (odd) {
- *newPtr++ = 0;
- }
- oldPtr += rowBytes - sliceRowBytes;
- }
- } else {
- for (i = 0; i < image->height; i++) {
- memcpy(newPtr, oldPtr, sliceRowBytes);
- newPtr += sliceRowBytes;
- if (odd) {
- *newPtr++ = 0;
- }
- oldPtr += rowBytes;
- }
- }
- bitmap.baseAddr = newData;
- bitmap.rowBytes = sliceRowBytes + odd;
- CopyBits(&bitmap, dstBit, srcPtr, dstPtr, srcCopy, NULL);
- if (slices) {
- bitmap.bounds.left = bitmap.bounds.right;
- dataPtr += sliceRowBytes;
- }
- } while (slices--);
- ckfree(newData);
} else {
- /*
- * Color image
- */
-
- const int maxRowBytes = 0x3ffc;
- PixMap pixmap;
-
- pixmap.bounds.left = 0;
- pixmap.bounds.top = 0;
- pixmap.bounds.bottom = (short) image->height;
- pixmap.pixelType = RGBDirect;
- pixmap.pmVersion = baseAddr32; /* 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 = image->byte_order == MSBFirst ?
- k32ARGBPixelFormat : k32BGRAPixelFormat;
- pixmap.pmTable = NULL;
- pixmap.pmExt = 0;
- if (rowBytes > maxRowBytes) {
- slices = rowBytes / maxRowBytes;
- sliceRowBytes = maxRowBytes;
- lastSliceRowBytes = rowBytes - (slices * maxRowBytes);
- if (!lastSliceRowBytes) {
- slices--;
- lastSliceRowBytes = maxRowBytes;
+ data = memcpy(ckalloc(len), image->data + image->xoffset,
+ len);
+ }
+ if (data) {
+ provider = CGDataProviderCreateWithData(data, data, len, releaseData);
+ }
+ if (provider) {
+ img = CGImageMaskCreate(image->width, image->height, bitsPerComponent,
+ bitsPerPixel, image->bytes_per_line,
+ provider, decode, 0);
+ }
+ } else if (image->format == ZPixmap && image->bits_per_pixel == 32) {
+ /*
+ * Color image
+ */
+
+ CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+
+ bitsPerComponent = 8;
+ bitsPerPixel = 32;
+ bitmapInfo = (image->byte_order == MSBFirst ?
+ kCGBitmapByteOrder32Big : kCGBitmapByteOrder32Little) |
+ kCGImageAlphaNoneSkipFirst;
+ data = memcpy(ckalloc(len), image->data + image->xoffset, len);
+ if (data) {
+ provider = CGDataProviderCreateWithData(data, data, len, releaseData);
+ }
+ if (provider) {
+ img = CGImageCreate(image->width, image->height, bitsPerComponent,
+ bitsPerPixel, image->bytes_per_line, colorspace, bitmapInfo,
+ provider, decode, 0, kCGRenderingIntentDefault);
+ }
+ if (colorspace) {
+ CFRelease(colorspace);
+ }
+ } else {
+ TkMacOSXDbgMsg("Unsupported image type");
+ }
+ if (provider) {
+ CFRelease(provider);
+ }
+
+ return img;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXCreateCGImageWithDrawable --
+ *
+ * Create a CGImage from the given Drawable.
+ *
+ * Results:
+ * CGImage, release after use.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CGImageRef
+TkMacOSXCreateCGImageWithDrawable(
+ Drawable drawable)
+{
+ CGImageRef img = NULL;
+ CGContextRef context = GetCGContextForDrawable(drawable);
+
+ if (context) {
+ img = CGBitmapContextCreateImage(context);
+ }
+ return img;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateNSImageWithPixmap --
+ *
+ * Create NSImage for Pixmap.
+ *
+ * Results:
+ * NSImage.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static NSImage*
+CreateNSImageWithPixmap(
+ Pixmap pixmap,
+ int width,
+ int height)
+{
+ CGImageRef cgImage;
+ NSImage *nsImage;
+ NSBitmapImageRep *bitmapImageRep;
+
+ cgImage = TkMacOSXCreateCGImageWithDrawable(pixmap);
+ nsImage = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
+ bitmapImageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
+ [nsImage addRepresentation:bitmapImageRep];
+ [bitmapImageRep release];
+ CFRelease(cgImage);
+
+ return nsImage;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNSImageWithTkImage --
+ *
+ * Get autoreleased NSImage for Tk_Image.
+ *
+ * Results:
+ * NSImage.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+NSImage*
+TkMacOSXGetNSImageWithTkImage(
+ Display *display,
+ Tk_Image image,
+ int width,
+ int height)
+{
+ Pixmap pixmap = Tk_GetPixmap(display, None, width, height, 0);
+ NSImage *nsImage;
+
+ Tk_RedrawImage(image, 0, 0, width, height, pixmap, 0, 0);
+ nsImage = CreateNSImageWithPixmap(pixmap, width, height);
+ Tk_FreePixmap(display, pixmap);
+
+ return [nsImage autorelease];
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNSImageWithBitmap --
+ *
+ * Get autoreleased NSImage for Bitmap.
+ *
+ * Results:
+ * NSImage.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+NSImage*
+TkMacOSXGetNSImageWithBitmap(
+ Display *display,
+ Pixmap bitmap,
+ GC gc,
+ int width,
+ int height)
+{
+ Pixmap pixmap = Tk_GetPixmap(display, None, width, height, 0);
+ NSImage *nsImage;
+
+ unsigned long origBackground = gc->background;
+
+ gc->background = TRANSPARENT_PIXEL << 24;
+ XSetClipOrigin(display, gc, 0, 0);
+ XCopyPlane(display, bitmap, pixmap, gc, 0, 0, width, height, 0, 0, 1);
+ gc->background = origBackground;
+ nsImage = CreateNSImageWithPixmap(pixmap, width, height);
+ Tk_FreePixmap(display, pixmap);
+
+ return [nsImage autorelease];
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetCGContextForDrawable --
+ *
+ * Get CGContext for given Drawable, creating one if necessary.
+ *
+ * Results:
+ * CGContext.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CGContextRef
+GetCGContextForDrawable(
+ Drawable d)
+{
+ MacDrawable *macDraw = (MacDrawable *) d;
+
+ if (macDraw && (macDraw->flags & TK_IS_PIXMAP) && !macDraw->context) {
+ const size_t bitsPerComponent = 8;
+ size_t bitsPerPixel, bytesPerRow, len;
+ CGColorSpaceRef colorspace = NULL;
+ CGBitmapInfo bitmapInfo =
+#ifdef __LITTLE_ENDIAN__
+ kCGBitmapByteOrder32Host;
+#else
+ kCGBitmapByteOrderDefault;
+#endif
+ char *data;
+ CGRect bounds = CGRectMake(0, 0, macDraw->size.width,
+ macDraw->size.height);
+
+ if (macDraw->flags & TK_IS_BW_PIXMAP) {
+ bitsPerPixel = 8;
+ bitmapInfo = kCGImageAlphaOnly;
+ } else {
+ colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+ bitsPerPixel = 32;
+ bitmapInfo |= kCGImageAlphaPremultipliedFirst;
+ }
+ bytesPerRow = ((size_t) macDraw->size.width * bitsPerPixel + 127) >> 3
+ & ~15;
+ len = macDraw->size.height * bytesPerRow;
+ data = ckalloc(len);
+ bzero(data, len);
+ macDraw->context = CGBitmapContextCreate(data, macDraw->size.width,
+ macDraw->size.height, bitsPerComponent, bytesPerRow,
+ colorspace, bitmapInfo);
+ if (macDraw->context) {
+ CGContextClearRect(macDraw->context, bounds);
+ }
+ if (colorspace) {
+ CFRelease(colorspace);
+ }
+ }
+
+ return (macDraw ? macDraw->context : NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawCGImage --
+ *
+ * Draw CG image into drawable.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+DrawCGImage(
+ Drawable d,
+ GC gc,
+ CGContextRef context,
+ CGImageRef image,
+ unsigned long imageForeground,
+ unsigned long imageBackground,
+ CGRect imageBounds,
+ CGRect srcBounds,
+ CGRect dstBounds)
+{
+ MacDrawable *macDraw = (MacDrawable *) d;
+
+ if (macDraw && context && image) {
+ CGImageRef subImage = NULL;
+
+ if (!CGRectEqualToRect(imageBounds, srcBounds)) {
+ if (!CGRectContainsRect(imageBounds, srcBounds)) {
+ TkMacOSXDbgMsg("Mismatch of sub CGImage bounds");
+ }
+ subImage = CGImageCreateWithImageInRect(image, CGRectOffset(
+ srcBounds, -imageBounds.origin.x, -imageBounds.origin.y));
+ if (subImage) {
+ image = subImage;
+ }
+ }
+ dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff);
+ if (CGImageIsMask(image)) {
+ /*CGContextSaveGState(context);*/
+ if (macDraw->flags & TK_IS_BW_PIXMAP) {
+ if (imageBackground != TRANSPARENT_PIXEL << 24) {
+ CGContextClearRect(context, dstBounds);
}
- sliceWidth = (long) image->width * maxRowBytes / rowBytes;
- lastSliceWidth = image->width - (sliceWidth * slices);
- dataPtr = image->data + image->xoffset;
- newData = (char *) ckalloc(image->height * sliceRowBytes);
- do {
- if (slices) {
- pixmap.bounds.right = pixmap.bounds.left + sliceWidth;
- } else {
- sliceRowBytes = lastSliceRowBytes;
- pixmap.bounds.right = pixmap.bounds.left + lastSliceWidth;
- }
- oldPtr = dataPtr;
- newPtr = newData;
- for (i = 0; i < image->height; i++) {
- memcpy(newPtr, oldPtr, sliceRowBytes);
- oldPtr += rowBytes;
- newPtr += sliceRowBytes;
- }
- pixmap.baseAddr = newData;
- pixmap.rowBytes = sliceRowBytes | 0x8000;
- CopyBits((BitMap*) &pixmap, dstBit, srcPtr, dstPtr, srcCopy,
- NULL);
- if (slices) {
- pixmap.bounds.left = pixmap.bounds.right;
- dataPtr += sliceRowBytes;
- }
- } while (slices--);
- ckfree(newData);
+ CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 1.0);
} else {
- pixmap.bounds.right = (short) image->width;
- pixmap.baseAddr = image->data + image->xoffset;
- pixmap.rowBytes = rowBytes | 0x8000;
- CopyBits((BitMap*) &pixmap, dstBit, srcPtr, dstPtr, srcCopy, NULL);
+ if (imageBackground != TRANSPARENT_PIXEL << 24) {
+ TkMacOSXSetColorInContext(gc, imageBackground, context);
+ CGContextFillRect(context, dstBounds);
+ }
+ TkMacOSXSetColorInContext(gc, imageForeground, context);
}
}
+#ifdef TK_MAC_DEBUG_IMAGE_DRAWING
+ CGContextSaveGState(context);
+ CGContextSetLineWidth(context, 1.0);
+ CGContextSetRGBStrokeColor(context, 0, 0, 0, 0.1);
+ CGContextSetRGBFillColor(context, 0, 1, 0, 0.1);
+ CGContextFillRect(context, dstBounds);
+ CGContextStrokeRect(context, dstBounds);
+ CGPoint p[4] = {dstBounds.origin,
+ CGPointMake(CGRectGetMaxX(dstBounds), CGRectGetMaxY(dstBounds)),
+ CGPointMake(CGRectGetMinX(dstBounds), CGRectGetMaxY(dstBounds)),
+ CGPointMake(CGRectGetMaxX(dstBounds), CGRectGetMinY(dstBounds))
+ };
+ CGContextStrokeLineSegments(context, p, 4);
+ CGContextRestoreGState(context);
+ TkMacOSXDbgMsg("Drawing CGImage at (x=%f, y=%f), (w=%f, h=%f)",
+ dstBounds.origin.x, dstBounds.origin.y,
+ dstBounds.size.width, dstBounds.size.height);
+#else /* TK_MAC_DEBUG_IMAGE_DRAWING */
+ CGContextSaveGState(context);
+ CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds));
+ CGContextScaleCTM(context, 1, -1);
+ CGContextDrawImage(context, dstBounds, image);
+ CGContextRestoreGState(context);
+#endif /* TK_MAC_DEBUG_IMAGE_DRAWING */
+ /*if (CGImageIsMask(image)) {
+ CGContextRestoreGState(context);
+ }*/
+ if (subImage) {
+ CFRelease(subImage);
+ }
+ } else {
+ TkMacOSXDbgMsg("Drawing of empty CGImage requested");
}
- TkMacOSXRestoreDrawingContext(&dc);
}
/*
@@ -570,7 +785,7 @@ XDrawLines(
}
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -593,23 +808,6 @@ XDrawLines(
}
}
CGContextStrokePath(dc.context);
- } else {
- int o = -lw/2;
-
- /* This is broken for fat lines, it is not possible to correctly
- * imitate X11 drawing of oblique fat lines with QD line drawing,
- * we should draw a filled polygon instead. */
-
- MoveTo((short) (macWin->xOff + points[0].x + o),
- (short) (macWin->yOff + points[0].y + o));
- for (i = 1; i < npoints; i++) {
- if (mode == CoordModeOrigin) {
- LineTo((short) (macWin->xOff + points[i].x + o),
- (short) (macWin->yOff + points[i].y + o));
- } else {
- Line((short) points[i].x, (short) points[i].y);
- }
- }
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -643,7 +841,7 @@ XDrawSegments(
int i, lw = gc->line_width;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -659,19 +857,6 @@ XDrawSegments(
macWin->yOff + segments[i].y2 + o);
CGContextStrokePath(dc.context);
}
- } else {
- int o = -lw/2;
-
- /* This is broken for fat lines, it is not possible to correctly
- * imitate X11 drawing of oblique fat lines with QD line drawing,
- * we should draw a filled polygon instead. */
-
- for (i = 0; i < nsegments; i++) {
- MoveTo((short) (macWin->xOff + segments[i].x1 + o),
- (short) (macWin->yOff + segments[i].y1 + o));
- LineTo((short) (macWin->xOff + segments[i].x2 + o),
- (short) (macWin->yOff + segments[i].y2 + o));
- }
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -707,7 +892,7 @@ XFillPolygon(
int i;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -730,23 +915,6 @@ XFillPolygon(
}
}
CGContextEOFillPath(dc.context);
- } else {
- PolyHandle polygon;
-
- polygon = OpenPoly();
- 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) points[i].x, (short) points[i].y);
- }
- }
- ClosePoly();
- FillCPoly(polygon, dc.penPat);
- KillPoly(polygon);
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -785,7 +953,7 @@ XDrawRectangle(
}
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -797,15 +965,6 @@ XDrawRectangle(
macWin->yOff + y + o,
width, height);
CGContextStrokeRect(dc.context, rect);
- } else {
- Rect theRect;
- int o = -lw/2;
-
- theRect.left = (short) (macWin->xOff + x + o);
- theRect.top = (short) (macWin->yOff + y + o);
- theRect.right = (short) (theRect.left + width + lw);
- theRect.bottom = (short) (theRect.top + height + lw);
- FrameRect(&theRect);
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -851,7 +1010,7 @@ XDrawRectangles(
int i, lw = gc->line_width;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -868,17 +1027,6 @@ XDrawRectangles(
rectPtr->width, rectPtr->height);
CGContextStrokeRect(dc.context, rect);
}
- } else {
- Rect theRect;
- int o = -lw/2;
-
- for (i = 0, rectPtr = rectArr; i < nRects;i++, rectPtr++) {
- theRect.left = (short) (macWin->xOff + rectPtr->x + o);
- theRect.top = (short) (macWin->yOff + rectPtr->y + o);
- theRect.right = (short) (theRect.left + rectPtr->width + lw);
- theRect.bottom = (short) (theRect.top + rectPtr->height + lw);
- FrameRect(&theRect);
- }
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -914,7 +1062,7 @@ XFillRectangles(
int i;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -930,16 +1078,6 @@ XFillRectangles(
rectPtr->width, rectPtr->height);
CGContextFillRect(dc.context, rect);
}
- } else {
- Rect theRect;
-
- for (i = 0, rectPtr = rectangles; i < n_rectangles; i++, rectPtr++) {
- theRect.left = (short) (macWin->xOff + rectPtr->x);
- theRect.top = (short) (macWin->yOff + rectPtr->y);
- theRect.right = (short) (theRect.left + rectPtr->width);
- theRect.bottom = (short) (theRect.top + rectPtr->height);
- FillCRect(&theRect, dc.penPat);
- }
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -980,7 +1118,7 @@ XDrawArc(
}
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -991,10 +1129,9 @@ XDrawArc(
macWin->xOff + x + o,
macWin->yOff + y + o,
width, height);
- TK_IF_MAC_OS_X_API_COND (4, CGContextStrokeEllipseInRect,
- angle1 == 0 && angle2 == 23040,
+ if (angle1 == 0 && angle2 == 23040) {
CGContextStrokeEllipseInRect(dc.context, rect);
- ) TK_ELSE (
+ } else {
CGMutablePathRef p = CGPathCreateMutable();
CGAffineTransform t = CGAffineTransformIdentity;
CGPoint c = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
@@ -1009,19 +1146,7 @@ XDrawArc(
CGContextAddPath(dc.context, p);
CGPathRelease(p);
CGContextStrokePath(dc.context);
- ) TK_ENDIF
- } else {
- Rect theRect;
- short start, extent;
- int o = -lw/2;
-
- theRect.left = (short) (macWin->xOff + x + o);
- theRect.top = (short) (macWin->yOff + y + o);
- theRect.right = (short) (theRect.left + width + lw);
- theRect.bottom = (short) (theRect.top + height + lw);
- start = (short) (90 - (angle1/64));
- extent = (short) (-(angle2/64));
- FrameArc(&theRect, start, extent);
+ }
}
TkMacOSXRestoreDrawingContext(&dc);
}
@@ -1065,7 +1190,7 @@ XDrawArcs(
int i, lw = gc->line_width;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -1082,10 +1207,9 @@ XDrawArcs(
macWin->yOff + arcPtr->y + o,
arcPtr->width, arcPtr->height);
- TK_IF_MAC_OS_X_API_COND (4, CGContextStrokeEllipseInRect,
- arcPtr->angle1 == 0 && arcPtr->angle2 == 23040,
+ if (arcPtr->angle1 == 0 && arcPtr->angle2 == 23040) {
CGContextStrokeEllipseInRect(dc.context, rect);
- ) TK_ELSE (
+ } else {
CGMutablePathRef p = CGPathCreateMutable();
CGAffineTransform t = CGAffineTransformIdentity;
CGPoint c = CGPointMake(CGRectGetMidX(rect),
@@ -1104,21 +1228,7 @@ XDrawArcs(
CGContextAddPath(dc.context, p);
CGPathRelease(p);
CGContextStrokePath(dc.context);
- ) TK_ENDIF
- }
- } else {
- Rect theRect;
- short start, extent;
- int o = -lw/2;
-
- for (i = 0, arcPtr = arcArr;i < nArcs;i++, arcPtr++) {
- theRect.left = (short) (macWin->xOff + arcPtr->x + o);
- theRect.top = (short) (macWin->yOff + arcPtr->y + o);
- theRect.right = (short) (theRect.left + arcPtr->width + lw);
- theRect.bottom = (short) (theRect.top + arcPtr->height + lw);
- start = (short) (90 - (arcPtr->angle1/64));
- extent = (short) (-(arcPtr->angle2/64));
- FrameArc(&theRect, start, extent);
+ }
}
}
TkMacOSXRestoreDrawingContext(&dc);
@@ -1161,7 +1271,7 @@ XFillArc(
}
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -1177,10 +1287,9 @@ XFillArc(
macWin->yOff + y + o,
width - u, height - u);
- TK_IF_MAC_OS_X_API_COND (4, CGContextFillEllipseInRect,
- angle1 == 0 && angle2 == 23040,
+ if (angle1 == 0 && angle2 == 23040) {
CGContextFillEllipseInRect(dc.context, rect);
- ) TK_ELSE (
+ } else {
CGMutablePathRef p = CGPathCreateMutable();
CGAffineTransform t = CGAffineTransformIdentity;
CGPoint c = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
@@ -1199,49 +1308,6 @@ XFillArc(
CGContextAddPath(dc.context, p);
CGPathRelease(p);
CGContextFillPath(dc.context);
- ) TK_ENDIF
- } else {
- Rect theRect;
- short start, extent;
- int o = -lw/2;
- PolyHandle polygon;
- double sin1, cos1, sin2, cos2, angle;
- double boxWidth, boxHeight;
- double vertex[2], center1[2], center2[2];
-
- theRect.left = (short) (macWin->xOff + x + o);
- theRect.top = (short) (macWin->yOff + y + o);
- theRect.right = (short) (theRect.left + width + lw);
- theRect.bottom = (short) (theRect.top + height + lw);
- 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 = radians(-angle1/64.0);
- sin1 = sin(angle);
- cos1 = cos(angle);
- angle -= radians(angle2/64.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] + .5), (short) (center1[1] + .5));
- LineTo((short) (center2[0] + .5), (short) (center2[1] + .5));
- ClosePoly();
- FillCArc(&theRect, start, extent, dc.penPat);
- FillCPoly(polygon, dc.penPat);
- KillPoly(polygon);
- } else {
- FillCArc(&theRect, start, extent, dc.penPat);
}
}
TkMacOSXRestoreDrawingContext(&dc);
@@ -1278,7 +1344,7 @@ XFillArcs(
int i, lw = gc->line_width;
display->request++;
- if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
return;
}
if (dc.context) {
@@ -1298,10 +1364,9 @@ XFillArcs(
macWin->xOff + arcPtr->x + o,
macWin->yOff + arcPtr->y + o,
arcPtr->width - u, arcPtr->height - u);
- TK_IF_MAC_OS_X_API_COND (4, CGContextFillEllipseInRect,
- arcPtr->angle1 == 0 && arcPtr->angle2 == 23040,
+ if (arcPtr->angle1 == 0 && arcPtr->angle2 == 23040) {
CGContextFillEllipseInRect(dc.context, rect);
- ) TK_ELSE (
+ } else {
CGMutablePathRef p = CGPathCreateMutable();
CGAffineTransform t = CGAffineTransformIdentity;
CGPoint c = CGPointMake(CGRectGetMidX(rect),
@@ -1324,52 +1389,6 @@ XFillArcs(
CGContextAddPath(dc.context, p);
CGPathRelease(p);
CGContextFillPath(dc.context);
- ) TK_ENDIF
- }
- } else {
- Rect theRect;
- short start, extent;
- int o = -lw/2;
- PolyHandle polygon;
- double sin1, cos1, sin2, cos2, angle;
- double boxWidth, boxHeight;
- double vertex[2], center1[2], center2[2];
-
- for (i = 0, arcPtr = arcArr;i<nArcs;i++, arcPtr++) {
- theRect.left = (short) (macWin->xOff + arcPtr->x + o);
- theRect.top = (short) (macWin->yOff + arcPtr->y + o);
- theRect.right = (short) (theRect.left + arcPtr->width + lw);
- theRect.bottom = (short) (theRect.top + arcPtr->height + lw);
- start = (short) (90 - (arcPtr->angle1/64));
- extent = (short) (- (arcPtr->angle2/64));
-
- if (gc->arc_mode == ArcChord) {
- boxWidth = theRect.right - theRect.left;
- boxHeight = theRect.bottom - theRect.top;
- angle = radians(-arcPtr->angle1/64.0);
- sin1 = sin(angle);
- cos1 = cos(angle);
- angle -= radians(arcPtr->angle2/64.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] + .5), (short) (center1[1] + .5));
- LineTo((short) (center2[0] + .5), (short) (center2[1] + .5));
- ClosePoly();
- FillCArc(&theRect, start, extent, dc.penPat);
- FillCPoly(polygon, dc.penPat);
- KillPoly(polygon);
- } else {
- FillCArc(&theRect, start, extent, dc.penPat);
}
}
}
@@ -1422,56 +1441,39 @@ TkScrollWindow(
int dx, int dy, /* Distance rectangle should be moved. */
TkRegion damageRgn) /* Region to accumulate damage in. */
{
- MacDrawable *destDraw = (MacDrawable *) Tk_WindowId(tkwin);
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- Rect scrollRect;
+ MacDrawable *macDraw = (MacDrawable *) Tk_WindowId(tkwin);
+ NSView *view = TkMacOSXDrawableView(macDraw);
+ CGRect visRect, srcRect, dstRect;
+ CGFloat boundsH;
+ HIShapeRef dmgRgn, dstRgn;
int result;
- HIShapeRef dmgRgn;
-
- /*
- * 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.
- */
-
- scrollRect.left = destDraw->xOff + x;
- scrollRect.top = destDraw->yOff + y;
- scrollRect.right = scrollRect.left + width;
- scrollRect.bottom = scrollRect.top + height;
- if (dx < 0) {
- scrollRect.left += dx;
- } else {
- scrollRect.right += dx;
- }
- if (dy < 0) {
- scrollRect.top += dy;
- } else {
- scrollRect.bottom += dy;
- }
- destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
- TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
- TkMacOSXCheckTmpQdRgnEmpty();
- portChanged = QDSwapPort(destPort, &savePort);
- ScrollRect(&scrollRect, dx, dy, tkMacOSXtmpQdRgn);
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ if (view && !CGRectIsEmpty(visRect = NSRectToCGRect([view visibleRect]))) {
+ boundsH = [view bounds].size.height;
+ srcRect = CGRectMake(macDraw->xOff + x, boundsH - height -
+ (macDraw->yOff + y), width, height);
+ dstRect = CGRectIntersection(CGRectOffset(srcRect, dx, -dy), visRect);
+ srcRect = CGRectIntersection(srcRect, visRect);
+ if (!CGRectIsEmpty(srcRect) && !CGRectIsEmpty(dstRect)) {
+ /*
+ CGRect sRect = CGRectIntersection(CGRectOffset(dstRect, -dx, dy),
+ srcRect);
+ NSCopyBits(0, NSRectFromCGRect(sRect),
+ NSPointFromCGPoint(CGRectOffset(sRect, dx, -dy).origin));
+ */
+ [view scrollRect:NSRectFromCGRect(srcRect) by:NSMakeSize(dx, -dy)];
+ }
+ srcRect.origin.y = boundsH - srcRect.size.height - srcRect.origin.y;
+ dstRect.origin.y = boundsH - dstRect.size.height - dstRect.origin.y;
+ srcRect = CGRectUnion(srcRect, dstRect);
+ dmgRgn = HIShapeCreateMutableWithRect(&srcRect);
+ dstRgn = HIShapeCreateWithRect(&dstRect);
+ ChkErr(HIShapeDifference, dmgRgn, dstRgn, (HIMutableShapeRef) dmgRgn);
+ CFRelease(dstRgn);
+ TkMacOSXInvalidateViewRegion(view, dmgRgn);
+ } else {
+ dmgRgn = HIShapeCreateEmpty();
}
-
- /*
- * Fortunately, the region returned by ScrollRect is semantically
- * 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.
- */
-
- dmgRgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
- SetEmptyRgn(tkMacOSXtmpQdRgn);
TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;
CFRelease(dmgRgn);
@@ -1490,7 +1492,7 @@ TkScrollWindow(
* None.
*
* Side effects:
- * The current port is adjusted.
+ * None.
*
*----------------------------------------------------------------------
*/
@@ -1498,42 +1500,12 @@ TkScrollWindow(
void
TkMacOSXSetUpGraphicsPort(
GC gc, /* GC to apply to current port. */
- GWorldPtr destPort)
+ void *destPort)
{
- CGrafPtr savePort;
- Boolean portChanged;
-
- portChanged = QDSwapPort(destPort, &savePort);
- PenNormal();
- if (gc) {
- if (!penPat) {
- if (!tmpPixPat) {
- penPat = NewPixPat();
- } else {
- penPat = tmpPixPat;
- tmpPixPat = NULL;
- }
- }
- TkMacOSXSetColorInPort(gc->foreground, 1, penPat, destPort);
- PenPixPat(penPat);
- if(gc->function == GXxor) {
- PenMode(patXor);
- }
- if (gc->line_width > 1) {
- PenSize(gc->line_width, gc->line_width);
- }
- if (gc->line_style != LineSolid) {
- /*
- * FIXME: Here the dash pattern should be set in the drawing
- * environment. This is not possible with QuickDraw line drawing.
- */
- }
- }
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
+ Tcl_Panic("TkMacOSXSetUpGraphicsPort: Obsolete, no more QD!");
}
+
/*
*----------------------------------------------------------------------
*
@@ -1560,101 +1532,98 @@ TkMacOSXSetupDrawingContext(
TkMacOSXDrawingContext *dcPtr)
{
MacDrawable *macDraw = ((MacDrawable*)d);
- int dontDraw = 0;
- TkMacOSXDrawingContext dc = {NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- {SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX}, false};
-
- if (tkPictureIsOpen) {
- if (useCG) {
- TkMacOSXDbgMsg("Ignored CG Drawing with QD Picture open");
- dontDraw = 1;
- }
- } else {
- dc.clipRgn = TkMacOSXGetClipRgn(d);
- }
+ int dontDraw = 0, isWin = 0;
+ TkMacOSXDrawingContext dc = {};
+ CGRect clipBounds;
+
+ dc.clipRgn = TkMacOSXGetClipRgn(d);
if (!dontDraw) {
ClipToGC(d, gc, &dc.clipRgn);
dontDraw = dc.clipRgn ? HIShapeIsEmpty(dc.clipRgn) : 0;
}
if (dontDraw) {
- if (dc.clipRgn) {
- CFRelease(dc.clipRgn);
- dc.clipRgn = NULL;
- }
goto end;
}
if (useCG) {
- dc.context = macDraw->context;
+ dc.context = GetCGContextForDrawable(d);
}
if (!dc.context || !(macDraw->flags & TK_IS_PIXMAP)) {
- dc.port = TkMacOSXGetDrawablePort(d);
- if (dc.port) {
- GetPortBounds(dc.port, &dc.portBounds);
- }
+ isWin = (TkMacOSXDrawableWindow(d) != nil);
}
if (dc.context) {
- if (!dc.port) {
- CGRect r;
-
- TK_IF_MAC_OS_X_API (3, CGContextGetClipBoundingBox,
- r = CGContextGetClipBoundingBox(dc.context);
- ) TK_ELSE_MAC_OS_X (3,
- r.origin = CGPointZero;
- r.size = macDraw->size;
- ) TK_ENDIF
- SetRect(&dc.portBounds, r.origin.x + macDraw->xOff,
- r.origin.y + macDraw->yOff,
- r.origin.x + r.size.width + macDraw->xOff,
- r.origin.y + r.size.height + macDraw->yOff);
- }
- CGContextSaveGState(dc.context);
- dc.saveState = (void*)1;
- dc.port = NULL;
- } else if (dc.port) {
- dc.portChanged = QDSwapPort(dc.port, &dc.savePort);
- if (useCG && ChkErr(QDBeginCGContext, dc.port, &dc.context) == noErr) {
- SyncCGContextOriginWithPort(dc.context, dc.port);
+ dc.portBounds = clipBounds = CGContextGetClipBoundingBox(dc.context);
+ } else if (isWin) {
+ NSView *view = TkMacOSXDrawableView(macDraw);
+ if (view) {
+ if (view != [NSView focusView]) {
+ dc.focusLocked = [view lockFocusIfCanDraw];
+ dontDraw = !dc.focusLocked;
+ } else {
+ dontDraw = ![view canDraw];
+ }
+ if (dontDraw) {
+ goto end;
+ }
+ [[view window] disableFlushWindow];
+ dc.view = view;
+ dc.context = [[NSGraphicsContext currentContext] graphicsPort];
+ dc.portBounds = NSRectToCGRect([view bounds]);
+ if (dc.clipRgn) {
+ clipBounds = CGContextGetClipBoundingBox(dc.context);
+ }
} else {
- dc.context = NULL;
+ Tcl_Panic("TkMacOSXSetupDrawingContext(): "
+ "no NSView to draw into !");
}
} else {
Tcl_Panic("TkMacOSXSetupDrawingContext(): "
- "no port or context to draw into !");
+ "no context to draw into !");
}
if (dc.context) {
- CGContextConcatCTM(dc.context, CGAffineTransformMake(1.0, 0.0, 0.0,
- -1.0, 0.0, dc.portBounds.bottom - dc.portBounds.top));
+ CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
+ .ty = dc.portBounds.size.height};
+ dc.portBounds.origin.x += macDraw->xOff;
+ dc.portBounds.origin.y += macDraw->yOff;
+ if (!dc.focusLocked) {
+ CGContextSaveGState(dc.context);
+ }
+ CGContextSetTextDrawingMode(dc.context, kCGTextFill);
+ CGContextConcatCTM(dc.context, t);
if (dc.clipRgn) {
#ifdef TK_MAC_DEBUG_DRAWING
CGContextSaveGState(dc.context);
ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
- CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.2);
+ CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.1);
CGContextEOFillPath(dc.context);
CGContextRestoreGState(dc.context);
#endif /* TK_MAC_DEBUG_DRAWING */
- ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
- CGContextEOClip(dc.context);
+ CGRect r;
+ if (!HIShapeIsRectangular(dc.clipRgn) || !CGRectContainsRect(
+ *HIShapeGetBounds(dc.clipRgn, &r),
+ CGRectApplyAffineTransform(clipBounds, t))) {
+ ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
+ CGContextEOClip(dc.context);
+ }
}
if (gc) {
static const CGLineCap cgCap[] = {
- [CapNotLast] = kCGLineCapButt,
- [CapButt] = kCGLineCapButt,
- [CapRound] = kCGLineCapRound,
- [CapProjecting] = kCGLineCapSquare,
+ [CapNotLast] = kCGLineCapButt,
+ [CapButt] = kCGLineCapButt,
+ [CapRound] = kCGLineCapRound,
+ [CapProjecting] = kCGLineCapSquare,
};
static const CGLineJoin cgJoin[] = {
- [JoinMiter] = kCGLineJoinMiter,
- [JoinRound] = kCGLineJoinRound,
- [JoinBevel] = kCGLineJoinBevel,
+ [JoinMiter] = kCGLineJoinMiter,
+ [JoinRound] = kCGLineJoinRound,
+ [JoinBevel] = kCGLineJoinBevel,
};
bool shouldAntialias;
double w = gc->line_width;
- TkMacOSXSetColorInContext(gc->foreground, dc.context);
- if (dc.port) {
+ TkMacOSXSetColorInContext(gc, gc->foreground, dc.context);
+ if (isWin) {
CGContextSetPatternPhase(dc.context, CGSizeMake(
- dc.portBounds.right - dc.portBounds.left,
- dc.portBounds.bottom - dc.portBounds.top));
+ dc.portBounds.size.width, dc.portBounds.size.height));
}
if(gc->function != GXcopy) {
TkMacOSXDbgMsg("Logical functions other than GXcopy are "
@@ -1671,8 +1640,8 @@ TkMacOSXSetupDrawingContext(
if (gc->line_style != LineSolid) {
int num = 0;
char *p = &(gc->dashes);
- double dashOffset = gc->dash_offset;
- float lengths[10];
+ CGFloat dashOffset = gc->dash_offset;
+ CGFloat lengths[10];
while (p[num] != '\0' && num < 10) {
lengths[num] = p[num];
@@ -1689,26 +1658,12 @@ TkMacOSXSetupDrawingContext(
cgJoin[(unsigned)gc->join_style]);
}
}
- } else if (dc.port) {
- PixPatHandle savePat = penPat;
-
- ChkErr(GetThemeDrawingState, &dc.saveState);
- penPat = NULL;
- TkMacOSXSetUpGraphicsPort(gc, dc.port);
- dc.penPat = penPat;
- penPat = savePat;
- dc.saveClip = NewRgn();
- GetPortClipRegion(dc.port, dc.saveClip);
- if (dc.clipRgn) {
- ChkErr(HIShapeSetQDClip, dc.clipRgn, dc.port);
- } else {
- NoQDClip(dc.port);
- }
- if (!tkPictureIsOpen) {
- ShowPen();
- }
}
end:
+ if (dontDraw && dc.clipRgn) {
+ CFRelease(dc.clipRgn);
+ dc.clipRgn = NULL;
+ }
*dcPtr = dc;
return !dontDraw;
}
@@ -1735,38 +1690,16 @@ TkMacOSXRestoreDrawingContext(
{
if (dcPtr->context) {
CGContextSynchronize(dcPtr->context);
- if (dcPtr->saveState) {
+ [[dcPtr->view window] enableFlushWindow];
+ if (dcPtr->focusLocked) {
+ [dcPtr->view unlockFocus];
+ } else {
CGContextRestoreGState(dcPtr->context);
}
- if (dcPtr->port) {
- ChkErr(QDEndCGContext, dcPtr->port, &(dcPtr->context));
- }
- } else if (dcPtr->port) {
- if (!tkPictureIsOpen) {
- HidePen();
- }
- PenNormal();
- if (dcPtr->saveClip) {
- SetPortClipRegion(dcPtr->port, dcPtr->saveClip);
- DisposeRgn(dcPtr->saveClip);
- }
- if (dcPtr->penPat) {
- if (!tmpPixPat) {
- tmpPixPat = dcPtr->penPat;
- } else {
- DisposePixPat(dcPtr->penPat);
- }
- }
- if (dcPtr->saveState) {
- ChkErr(SetThemeDrawingState, dcPtr->saveState, true);
- }
}
if (dcPtr->clipRgn) {
CFRelease(dcPtr->clipRgn);
}
- if (dcPtr->portChanged) {
- QDSwapPort(dcPtr->savePort, NULL);
- }
#ifdef TK_MAC_DEBUG
bzero(dcPtr, sizeof(TkMacOSXDrawingContext));
#endif /* TK_MAC_DEBUG */
@@ -1795,35 +1728,31 @@ TkMacOSXGetClipRgn(
{
MacDrawable *macDraw = (MacDrawable *) drawable;
HIShapeRef clipRgn = NULL;
- CGRect r;
if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
TkMacOSXUpdateClipRgn(macDraw->winPtr);
#ifdef TK_MAC_DEBUG_DRAWING
- TkMacOSXDbgMsg("%s visRgn ", macDraw->winPtr->pathName);
- TkMacOSXDebugFlashRegion(drawable, macDraw->visRgn);
+ TkMacOSXDbgMsg("%s", macDraw->winPtr->pathName);
+ NSView *view = TkMacOSXDrawableView(macDraw);
+ if ([view lockFocusIfCanDraw]) {
+ CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
+ CGContextSaveGState(context);
+ CGContextConcatCTM(context, CGAffineTransformMake(1.0, 0.0, 0.0,
+ -1.0, 0.0, [view bounds].size.height));
+ ChkErr(HIShapeReplacePathInCGContext, macDraw->visRgn, context);
+ CGContextSetRGBFillColor(context, 0.0, 1.0, 0.0, 0.1);
+ CGContextEOFillPath(context);
+ CGContextRestoreGState(context);
+ [view unlockFocus];
+ }
#endif /* TK_MAC_DEBUG_DRAWING */
}
- if (macDraw->flags & TK_CLIPPED_DRAW) {
- r = CGRectOffset(macDraw->drawRect, macDraw->xOff, macDraw->yOff);
- }
- if (macDraw->visRgn) {
- if (macDraw->flags & TK_CLIPPED_DRAW) {
- HIShapeRef rgn = HIShapeCreateWithRect(&r);
-
- clipRgn = HIShapeCreateIntersection(macDraw->visRgn, rgn);
- CFRelease(rgn);
- } else {
- clipRgn = HIShapeCreateCopy(macDraw->visRgn);
- }
- } else if (macDraw->flags & TK_CLIPPED_DRAW) {
- clipRgn = HIShapeCreateWithRect(&r);
+ if (macDraw->drawRgn) {
+ clipRgn = HIShapeCreateCopy(macDraw->drawRgn);
+ } else if (macDraw->visRgn) {
+ clipRgn = HIShapeCreateCopy(macDraw->visRgn);
}
-#ifdef TK_MAC_DEBUG_DRAWING
- TkMacOSXDbgMsg("%s clipRgn ", macDraw->winPtr->pathName);
- TkMacOSXDebugFlashRegion(drawable, clipRgn);
-#endif /* TK_MAC_DEBUG_DRAWING */
return clipRgn;
}
@@ -1840,7 +1769,7 @@ TkMacOSXGetClipRgn(
* None.
*
* Side effects:
- * The clipping region in the current port is changed.
+ * None.
*
*----------------------------------------------------------------------
*/
@@ -1849,16 +1778,6 @@ void
TkMacOSXSetUpClippingRgn(
Drawable drawable) /* Drawable to update. */
{
- CGrafPtr port = TkMacOSXGetDrawablePort(drawable);
-
- if (port) {
- HIShapeRef clipRgn = TkMacOSXGetClipRgn(drawable);
-
- if (clipRgn) {
- ChkErr(HIShapeSetQDClip, clipRgn, port);
- CFRelease(clipRgn);
- }
- }
}
/*
@@ -1867,7 +1786,7 @@ TkMacOSXSetUpClippingRgn(
* TkpClipDrawableToRect --
*
* Clip all drawing into the drawable d to the given rectangle.
- * If width and height are negative, reset to no clipping.
+ * If width or height are negative, reset to no clipping.
*
* Results:
* None.
@@ -1886,13 +1805,38 @@ TkpClipDrawableToRect(
int width, int height)
{
MacDrawable *macDraw = (MacDrawable *) d;
+ NSView *view = TkMacOSXDrawableView(macDraw);
- if (width < 0 && height < 0) {
- macDraw->drawRect = CGRectNull;
- macDraw->flags &= ~TK_CLIPPED_DRAW;
+ if (macDraw->drawRgn) {
+ CFRelease(macDraw->drawRgn);
+ macDraw->drawRgn = NULL;
+ }
+ if (width >= 0 && height >= 0) {
+ CGRect drawRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff,
+ width, height);
+ HIShapeRef drawRgn = HIShapeCreateWithRect(&drawRect);
+
+ if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(macDraw->winPtr);
+ }
+ if (macDraw->visRgn) {
+ macDraw->drawRgn = HIShapeCreateIntersection(macDraw->visRgn,
+ drawRgn);
+ CFRelease(drawRgn);
+ } else {
+ macDraw->drawRgn = drawRgn;
+ }
+ if (view && view != [NSView focusView] && [view lockFocusIfCanDraw]) {
+ drawRect.origin.y = [view bounds].size.height -
+ (drawRect.origin.y + drawRect.size.height);
+ NSRectClip(NSRectFromCGRect(drawRect));
+ macDraw->flags |= TK_FOCUSED_VIEW;
+ }
} else {
- macDraw->drawRect = CGRectMake(x, y, width, height);
- macDraw->flags |= TK_CLIPPED_DRAW;
+ if (view && (macDraw->flags & TK_FOCUSED_VIEW)) {
+ [view unlockFocus];
+ macDraw->flags &= ~TK_FOCUSED_VIEW;
+ }
}
}
@@ -1925,9 +1869,7 @@ ClipToGC(
int yOffset = ((MacDrawable *) d)->yOff + gc->clip_y_origin;
HIShapeRef clipRgn = *clipRgnPtr, gcClipRgn;
- if (!tkPictureIsOpen) {
- TkMacOSXOffsetRegion(gcClip, xOffset, yOffset);
- }
+ TkMacOSXOffsetRegion(gcClip, xOffset, yOffset);
gcClipRgn = TkMacOSXGetNativeRegion(gcClip);
if (clipRgn) {
*clipRgnPtr = HIShapeCreateIntersection(gcClipRgn, clipRgn);
@@ -1936,39 +1878,8 @@ ClipToGC(
*clipRgnPtr = HIShapeCreateCopy(gcClipRgn);
}
CFRelease(gcClipRgn);
- if (!tkPictureIsOpen) {
- TkMacOSXOffsetRegion(gcClip, -xOffset, -yOffset);
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * NoQDClip --
- *
- * Helper function to setup a QD port to not clip anything.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-NoQDClip(
- CGrafPtr port)
-{
- static RgnHandle noClipRgn = NULL;
-
- if (!noClipRgn) {
- noClipRgn = NewRgn();
- SetRectRgn(noClipRgn, SHRT_MIN, SHRT_MIN, SHRT_MAX, SHRT_MAX);
+ TkMacOSXOffsetRegion(gcClip, -xOffset, -yOffset);
}
- SetPortClipRegion(port, noClipRgn);
}
/*
@@ -1990,45 +1901,12 @@ NoQDClip(
*----------------------------------------------------------------------
*/
-BitMapPtr
+void *
TkMacOSXMakeStippleMap(
Drawable drawable, /* Window to apply stipple. */
Drawable stipple) /* The stipple pattern. */
{
- CGrafPtr stipplePort;
- BitMapPtr bitmapPtr;
- const BitMap *stippleBitmap;
- Rect portRect;
- int width, height, stippleHeight, stippleWidth, i, j;
- Rect bounds;
-
- GetPortBounds(TkMacOSXGetDrawablePort(drawable), &portRect);
- width = portRect.right - portRect.left;
- height = portRect.bottom - portRect.top;
- bitmapPtr = (BitMap *) ckalloc(sizeof(BitMap));
- bitmapPtr->bounds.top = bitmapPtr->bounds.left = 0;
- bitmapPtr->bounds.right = (short) width;
- bitmapPtr->bounds.bottom = (short) height;
- bitmapPtr->rowBytes = (width / 8) + 1;
- bitmapPtr->baseAddr = ckalloc(height * bitmapPtr->rowBytes);
-
- stipplePort = TkMacOSXGetDrawablePort(stipple);
- stippleBitmap = GetPortBitMapForCopyBits(stipplePort);
- GetPortBounds(stipplePort, &portRect);
- 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(stippleBitmap, bitmapPtr, &portRect, &bounds, srcCopy,
- NULL);
- }
- }
- return bitmapPtr;
+ return NULL;
}
/*
@@ -2116,3 +1994,12 @@ TkpDrawFrame(
Tk_Height(tkwin) - 2 * highlightWidth,
borderWidth, relief);
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 85bfe05..d6ce254 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -8,14 +8,15 @@
* Tk application is allowed on the Macintosh.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkMacOSXInt.h"
+#include "tkMacOSXPrivate.h"
+#include "tkBusy.h"
/*
* One of the following structures exists for each container in this
@@ -89,8 +90,7 @@ Tk_MacOSXSetEmbedHandler(
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
{
if (tkMacOSXEmbedHandler == NULL) {
- tkMacOSXEmbedHandler = (TkMacOSXEmbedHandler *)
- ckalloc(sizeof(TkMacOSXEmbedHandler));
+ tkMacOSXEmbedHandler = ckalloc(sizeof(TkMacOSXEmbedHandler));
}
tkMacOSXEmbedHandler->registerWinProc = registerWinProc;
tkMacOSXEmbedHandler->getPortProc = getPortProc;
@@ -134,7 +134,7 @@ TkpMakeWindow(
* Allocate sub window
*/
- macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ macWin = ckalloc(sizeof(MacDrawable));
if (macWin == NULL) {
winPtr->privatePtr = NULL;
return None;
@@ -143,10 +143,10 @@ TkpMakeWindow(
winPtr->privatePtr = macWin;
macWin->visRgn = NULL;
macWin->aboveVisRgn = NULL;
- macWin->drawRect = CGRectNull;
+ macWin->drawRgn = NULL;
macWin->referenceCount = 0;
macWin->flags = TK_CLIP_INVALID;
- macWin->grafPtr = NULL;
+ macWin->view = nil;
macWin->context = NULL;
macWin->size = CGSizeZero;
if (Tk_IsTopLevel(macWin->winPtr)) {
@@ -199,7 +199,7 @@ TkpUseWindow(
* 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
+ const char *string) /* String identifying an X window to use for
* tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -260,7 +260,7 @@ TkpUseWindow(
* Make the embedded window.
*/
- macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ macWin = ckalloc(sizeof(MacDrawable));
if (macWin == NULL) {
winPtr->privatePtr = NULL;
return TCL_ERROR;
@@ -277,12 +277,12 @@ TkpUseWindow(
* correctly find the container's port.
*/
- macWin->grafPtr = NULL;
+ macWin->view = nil;
macWin->context = NULL;
macWin->size = CGSizeZero;
macWin->visRgn = NULL;
macWin->aboveVisRgn = NULL;
- macWin->drawRect = CGRectNull;
+ macWin->drawRgn = NULL;
macWin->referenceCount = 0;
macWin->flags = TK_CLIP_INVALID;
macWin->toplevel = macWin;
@@ -310,20 +310,20 @@ TkpUseWindow(
*/
if (tkMacOSXEmbedHandler == NULL ||
- tkMacOSXEmbedHandler->registerWinProc((int) parent,
+ tkMacOSXEmbedHandler->registerWinProc((long) parent,
(Tk_Window) winPtr) != TCL_OK) {
Tcl_AppendResult(interp, "The window ID ", string,
" does not correspond to a valid Tk Window.", 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;
}
+
+ containerPtr = 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.
@@ -389,7 +389,7 @@ TkpMakeContainer(
*/
Tk_MakeWindowExist(tkwin);
- containerPtr = (Container *) ckalloc(sizeof(Container));
+ containerPtr = ckalloc(sizeof(Container));
containerPtr->parent = Tk_WindowId(tkwin);
containerPtr->parentPtr = winPtr;
containerPtr->embedded = None;
@@ -561,7 +561,7 @@ TkpTestembedCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
int all;
Container *containerPtr;
@@ -640,6 +640,7 @@ TkpRedirectKeyEvent(
XEvent *eventPtr) /* X event to redirect (should be KeyPress or
* KeyRelease). */
{
+ /* TODO: Implement this or decide it definitely needs no implementation */
}
/*
@@ -1085,7 +1086,7 @@ EmbedWindowDeleted(
XEvent event;
event.xany.serial =
- Tk_Display(containerPtr->parentPtr)->request;
+ LastKnownRequestProcessed(Tk_Display(containerPtr->parentPtr));
event.xany.send_event = False;
event.xany.display = Tk_Display(containerPtr->parentPtr);
@@ -1113,6 +1114,69 @@ EmbedWindowDeleted(
} else {
prevPtr->nextPtr = containerPtr->nextPtr;
}
- ckfree((char *) containerPtr);
+ ckfree(containerPtr);
}
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpShowBusyWindow, TkpHideBusyWindow, TkpMakeTransparentWindowExist,
+ * TkpCreateBusy --
+ *
+ * Portability layer for busy windows. Holds platform-specific gunk for
+ * the [tk busy] command, which is currently a dummy implementation for
+ * OSX/Aqua. The individual functions are supposed to do the following:
+ *
+ * TkpShowBusyWindow --
+ * Make the busy window appear.
+ *
+ * TkpHideBusyWindow --
+ * Make the busy window go away.
+ *
+ * TkpMakeTransparentWindowExist --
+ * Actually make a transparent window.
+ *
+ * TkpCreateBusy --
+ * Creates the platform-specific part of a busy window structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpShowBusyWindow(
+ TkBusy busy)
+{
+}
+
+void
+TkpHideBusyWindow(
+ TkBusy busy)
+{
+}
+
+void
+TkpMakeTransparentWindowExist(
+ Tk_Window tkwin, /* Token for window. */
+ Window parent) /* Parent window. */
+{
+}
+
+void
+TkpCreateBusy(
+ Tk_FakeWin *winPtr,
+ Tk_Window tkRef,
+ Window* parentPtr,
+ Tk_Window tkParent,
+ TkBusy busy)
+{
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c
index 64b8f3a..c103c6d 100644
--- a/macosx/tkMacOSXEntry.c
+++ b/macosx/tkMacOSXEntry.c
@@ -4,70 +4,27 @@
* This file implements the native aqua entry widget.
*
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple Inc.
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
-#include "tkMacOSXDefault.h"
#include "tkEntry.h"
-static ThemeButtonKind ComputeIncDecParameters (int height, int *width);
+static ThemeButtonKind ComputeIncDecParameters(int height, int *width);
+#define HIOrientation kHIThemeOrientationNormal
+
/*
*--------------------------------------------------------------
*
* ComputeIncDecParameters --
*
- * This procedure figures out which of the kThemeIncDec
- * buttons to use. It also sets width to the width of the
- * IncDec button.
+ * This procedure figures out which of the kThemeIncDec buttons to use.
+ * It also sets width to the width of the IncDec button.
*
* Results:
* The ThemeButtonKind of the button we should use.
@@ -77,51 +34,43 @@ static ThemeButtonKind ComputeIncDecParameters (int height, int *width);
*
*--------------------------------------------------------------
*/
+
static ThemeButtonKind
-ComputeIncDecParameters(int height, int *width)
+ComputeIncDecParameters(
+ int height,
+ int *width)
{
ThemeButtonKind kind;
- TK_IF_HI_TOOLBOX (3,
- if (height < 11 || height > 28) {
- *width = 0;
- kind = (ThemeButtonKind) 0;
- } else {
- if (height >= 21) {
- *width = 13;
- kind = kThemeIncDecButton;
- } else if (height >= 18) {
- *width = 12;
- kind = kThemeIncDecButtonSmall;
- } else {
- *width = 11;
- kind = kThemeIncDecButtonMini;
- }
- }
- ) TK_ELSE_HI_TOOLBOX (3,
- if (height < 21 || height > 28) {
- *width = 0;
- kind = (ThemeButtonKind) 0;
- } else {
+ if (height < 11 || height > 28) {
+ *width = 0;
+ kind = (ThemeButtonKind) 0;
+ } else {
+ if (height >= 21) {
*width = 13;
kind = kThemeIncDecButton;
+ } else if (height >= 18) {
+ *width = 12;
+ kind = kThemeIncDecButtonSmall;
+ } else {
+ *width = 11;
+ kind = kThemeIncDecButtonMini;
}
- ) TK_ENDIF
+ }
return kind;
}
-
+
/*
*--------------------------------------------------------------
*
* TkpDrawEntryBorderAndFocus --
*
- * This procedure redraws the border of an entry window.
- * It overrides the generic border drawing code if the
- * entry widget parameters are such that the native widget
- * drawing is a good fit.
- * This version just returns 1, so platforms that don't
- * do special native drawing don't have to implement it.
+ * This procedure redraws the border of an entry window. It overrides the
+ * generic border drawing code if the entry widget parameters are such
+ * that the native widget drawing is a good fit. This version just
+ * returns 1, so platforms that don't do special native drawing don't
+ * have to implement it.
*
* Results:
* 1 if it has drawn the border, 0 if not.
@@ -131,21 +80,31 @@ ComputeIncDecParameters(int height, int *width)
*
*--------------------------------------------------------------
*/
+
int
-TkpDrawEntryBorderAndFocus(Entry *entryPtr, Drawable d, int isSpinbox)
+TkpDrawEntryBorderAndFocus(
+ Entry *entryPtr,
+ Drawable d,
+ int isSpinbox)
{
- Rect bounds;
+ CGRect bounds;
TkMacOSXDrawingContext dc;
GC bgGC;
Tk_Window tkwin = entryPtr->tkwin;
- ThemeDrawState drawState;
int oldWidth = 0;
MacDrawable *macDraw = (MacDrawable *) d;
+ const HIThemeFrameDrawInfo info = {
+ .version = 0,
+ .kind = kHIThemeFrameTextFieldSquare,
+ .state = (entryPtr->state == STATE_DISABLED ? kThemeStateInactive :
+ kThemeStateActive),
+ .isFocused = (entryPtr->flags & GOT_FOCUS ? 1 : 0),
+ };
/*
- * I use 6 as the borderwidth. 2 of the 5 go into the actual frame the
- * 3 are because the Mac OS Entry widgets leave more space around the
- * Text than Tk does on X11.
+ * I use 6 as the borderwidth. 2 of the 5 go into the actual frame the 3
+ * are because the Mac OS Entry widgets leave more space around the Text
+ * than Tk does on X11.
*/
if (entryPtr->borderWidth != MAC_OSX_ENTRY_BORDER
@@ -155,76 +114,61 @@ TkpDrawEntryBorderAndFocus(Entry *entryPtr, Drawable d, int isSpinbox)
}
/*
- * For the spinbox, we have to make the entry part smaller by the size
- * of the buttons. We also leave 2 pixels to the left (as per the HIG)
- * and space for one pixel to the right, 'cause it makes the buttons look
+ * For the spinbox, we have to make the entry part smaller by the size of
+ * the buttons. We also leave 2 pixels to the left (as per the HIG) and
+ * space for one pixel to the right, 'cause it makes the buttons look
* nicer.
*/
if (isSpinbox) {
- ThemeButtonKind buttonKind;
int incDecWidth;
oldWidth = Tk_Width(tkwin);
- buttonKind = ComputeIncDecParameters(Tk_Height(tkwin)
- - 2 * MAC_OSX_FOCUS_WIDTH, &incDecWidth);
+ ComputeIncDecParameters(Tk_Height(tkwin) - 2 * MAC_OSX_FOCUS_WIDTH,
+ &incDecWidth);
Tk_Width(tkwin) -= incDecWidth + 1;
}
/*
- * The focus ring is drawn with an Alpha at the outside
- * part of the ring, so we have to draw over the edges of the
- * ring before drawing the focus or the text will peep through.
+ * The focus ring is drawn with an Alpha at the outside part of the ring,
+ * so we have to draw over the edges of the ring before drawing the focus
+ * or the text will peep through.
*/
bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, d);
TkDrawInsetFocusHighlight(entryPtr->tkwin, bgGC, MAC_OSX_FOCUS_WIDTH, d, 0);
/*
- * Inset the entry Frame by the maximum width of the focus rect,
- * which is 3 according to the Carbon docs.
+ * Inset the entry Frame by the maximum width of the focus rect, which is
+ * 3 according to the Carbon docs.
*/
- bounds.left = macDraw->xOff + MAC_OSX_FOCUS_WIDTH;
- bounds.top = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
- bounds.right = macDraw->xOff + Tk_Width(tkwin) - MAC_OSX_FOCUS_WIDTH;
- bounds.bottom = macDraw->yOff + Tk_Height(tkwin) - MAC_OSX_FOCUS_WIDTH;
- if (entryPtr->state == STATE_DISABLED) {
- drawState = kThemeStateInactive;
- } else {
- drawState = kThemeStateActive;
- }
- if (!TkMacOSXSetupDrawingContext(d, NULL, 0, &dc)) {
+ bounds.origin.x = macDraw->xOff + MAC_OSX_FOCUS_WIDTH;
+ bounds.origin.y = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
+ bounds.size.width = Tk_Width(tkwin) - 2*MAC_OSX_FOCUS_WIDTH;
+ bounds.size.height = Tk_Height(tkwin) - 2*MAC_OSX_FOCUS_WIDTH;
+ if (!TkMacOSXSetupDrawingContext(d, NULL, 1, &dc)) {
return 0;
}
- DrawThemeEditTextFrame(&bounds, drawState);
- if (entryPtr->flags & GOT_FOCUS) {
- /*
- * Don't call this if we don't have the focus, because then it
- * erases the focus rect to white, but we've already drawn the
- * highlightbackground above.
- */
-
- DrawThemeFocusRect(&bounds, (entryPtr->flags & GOT_FOCUS) != 0);
- }
+ ChkErr(HIThemeDrawFrame, &bounds, &info, dc.context, HIOrientation);
+ TkMacOSXRestoreDrawingContext(&dc);
if (isSpinbox) {
Tk_Width(tkwin) = oldWidth;
}
- TkMacOSXRestoreDrawingContext(&dc);
return 1;
}
+
/*
*--------------------------------------------------------------
*
* TkpDrawSpinboxButtons --
*
- * This procedure redraws the buttons of an spinbox widget.
- * It overrides the generic button drawing code if the
- * spinbox widget parameters are such that the native widget
- * drawing is a good fit.
- * This version just returns 0, so platforms that don't
- * do special native drawing don't have to implement it.
+ * This procedure redraws the buttons of an spinbox widget. It overrides
+ * the generic button drawing code if the spinbox widget parameters are
+ * such that the native widget drawing is a good fit. This version just
+ * returns 0, so platforms that don't do special native drawing don't
+ * have to implement it.
*
* Results:
* 1 if it has drawn the border, 0 if not.
@@ -236,15 +180,11 @@ TkpDrawEntryBorderAndFocus(Entry *entryPtr, Drawable d, int isSpinbox)
*/
int
-TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d)
+TkpDrawSpinboxButtons(
+ Spinbox *sbPtr,
+ Drawable d)
{
- Rect inBounds;
- ThemeButtonKind inKind;
- ThemeButtonDrawInfo inNewInfo;
- ThemeButtonDrawInfo * inPrevInfo = NULL;
- ThemeEraseUPP inEraseProc = NULL;
- ThemeButtonDrawUPP inLabelProc = NULL;
- UInt32 inUserData = 0;
+ CGRect bounds;
Tk_Window tkwin = sbPtr->entry.tkwin;
int height = Tk_Height(tkwin);
int buttonHeight = height - 2 * MAC_OSX_FOCUS_WIDTH;
@@ -253,6 +193,10 @@ TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d)
XRectangle rects[1];
GC bgGC;
MacDrawable *macDraw = (MacDrawable *) d;
+ HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .adornment = kThemeAdornmentNone,
+ };
/*
* FIXME: RAISED really makes more sense
@@ -263,56 +207,61 @@ TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d)
}
/*
- * The actual sizes of the IncDec button are 21 for the normal,
- * 18 for the small and 15 for the mini. But the spinbox still
- * looks okay if the entry is a little bigger than this, so we
- * give it a little slop.
+ * The actual sizes of the IncDec button are 21 for the normal, 18 for the
+ * small and 15 for the mini. But the spinbox still looks okay if the
+ * entry is a little bigger than this, so we give it a little slop.
*/
- inKind = ComputeIncDecParameters(buttonHeight, &incDecWidth);
- if (inKind == (ThemeButtonKind) 0) {
+ info.kind = ComputeIncDecParameters(buttonHeight, &incDecWidth);
+ if (info.kind == (ThemeButtonKind) 0) {
return 0;
}
if (sbPtr->entry.state == STATE_DISABLED) {
- inNewInfo.state = kThemeStateInactive;
- inNewInfo.value = kThemeButtonOff;
+ info.state = kThemeStateInactive;
+ info.value = kThemeButtonOff;
} else if (sbPtr->selElement == SEL_BUTTONUP) {
- inNewInfo.state = kThemeStatePressedUp;
- inNewInfo.value = kThemeButtonOn;
+ info.state = kThemeStatePressedUp;
+ info.value = kThemeButtonOn;
} else if (sbPtr->selElement == SEL_BUTTONDOWN) {
- inNewInfo.state = kThemeStatePressedDown;
- inNewInfo.value = kThemeButtonOn;
+ info.state = kThemeStatePressedDown;
+ info.value = kThemeButtonOn;
} else {
- inNewInfo.state = kThemeStateActive;
- inNewInfo.value = kThemeButtonOff;
+ info.state = kThemeStateActive;
+ info.value = kThemeButtonOff;
}
- inNewInfo.adornment = kThemeAdornmentNone;
-
- inBounds.left = macDraw->xOff + Tk_Width(tkwin) - incDecWidth - 1;
- inBounds.right = macDraw->xOff + Tk_Width(tkwin) - 1;
- inBounds.top = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
- inBounds.bottom = macDraw->yOff + Tk_Height(tkwin) - MAC_OSX_FOCUS_WIDTH;
+ bounds.origin.x = macDraw->xOff + Tk_Width(tkwin) - incDecWidth - 1;
+ bounds.origin.y = macDraw->yOff + MAC_OSX_FOCUS_WIDTH;
+ bounds.size.width = incDecWidth;
+ bounds.size.height = Tk_Height(tkwin) - 2*MAC_OSX_FOCUS_WIDTH;
- /* We had to make the entry part of the window smaller so that we
- * wouldn't overdraw the spin buttons with the focus highlight. So
- * now we have to draw the highlightbackground.
+ /*
+ * We had to make the entry part of the window smaller so that we wouldn't
+ * overdraw the spin buttons with the focus highlight. So now we have to
+ * draw the highlightbackground.
*/
bgGC = Tk_GCForColor(sbPtr->entry.highlightBgColorPtr, d);
- rects[0].x = inBounds.left;
+ rects[0].x = bounds.origin.x;
rects[0].y = 0;
rects[0].width = Tk_Width(tkwin);
rects[0].height = Tk_Height(tkwin);
XFillRectangles(Tk_Display(tkwin), d, bgGC, rects, 1);
- if (!TkMacOSXSetupDrawingContext(d, NULL, 0, &dc)) {
+ if (!TkMacOSXSetupDrawingContext(d, NULL, 1, &dc)) {
return 0;
}
- ChkErr(DrawThemeButton, &inBounds, inKind, &inNewInfo, inPrevInfo,
- inEraseProc, inLabelProc, inUserData);
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
TkMacOSXRestoreDrawingContext(&dc);
return 1;
}
-
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c
index 5da46a9..ea262ff 100644
--- a/macosx/tkMacOSXEvent.c
+++ b/macosx/tkMacOSXEvent.c
@@ -4,8 +4,8 @@
* This file contains the basic Mac OS X Event handling routines.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,256 +15,141 @@
#include "tkMacOSXEvent.h"
#include "tkMacOSXDebug.h"
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXFlushWindows --
- *
- * This routine flushes all the Carbon windows of the application. It
- * is called by XSync().
- *
- * Results:
- * None.
- *
- * Side effects:
- * Flushes all Carbon windows
- *
- *----------------------------------------------------------------------
- */
+#pragma mark TKApplication(TKEvent)
-MODULE_SCOPE void
-TkMacOSXFlushWindows(void)
+enum {
+ NSWindowWillMoveEventType = 20
+};
+
+@implementation TKApplication(TKEvent)
+/* TODO: replace by +[addLocalMonitorForEventsMatchingMask ? */
+- (NSEvent *) tkProcessEvent: (NSEvent *) theEvent
{
- WindowRef wRef = GetWindowList();
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
+#endif
+ NSEvent *processedEvent = theEvent;
+ NSEventType type = [theEvent type];
+ NSInteger subtype;
+ NSUInteger flags;
- while (wRef) {
- TK_IF_MAC_OS_X_API (3, HIWindowFlush,
- ChkErr(HIWindowFlush, wRef);
- ) TK_ELSE_MAC_OS_X (3,
- CGrafPtr portPtr = GetWindowPort(wRef);
+ switch ((NSInteger)type) {
+ case NSAppKitDefined:
+ subtype = [theEvent subtype];
- if (QDIsPortBuffered(portPtr)) {
- QDFlushPortBuffer(portPtr, NULL);
- }
- ) TK_ENDIF
- wRef = GetNextWindow(wRef);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXProcessEvent --
- *
- * This dispatches a filtered Carbon event to the appropriate handler
- *
- * Note on MacEventStatus.stopProcessing: Please be conservative in the
- * individual handlers and don't assume the event is fully handled
- * unless you *really* need to ensure that other handlers don't see the
- * event anymore. Some OS manager or library might be interested in
- * events even after they are already handled on the Tk level.
- *
- * Results:
- * 0 on success
- * -1 on failure
- *
- * Side effects:
- * Converts a Carbon event to a Tk event
- *
- *----------------------------------------------------------------------
- */
-
-MODULE_SCOPE 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);
+ switch (subtype) {
+ case NSApplicationActivatedEventType:
break;
- case kEventClassAppearance:
- TkMacOSXProcessAppearanceEvent(eventPtr, statusPtr);
+ case NSApplicationDeactivatedEventType:
break;
- case kEventClassMenu:
- TkMacOSXProcessMenuEvent(eventPtr, statusPtr);
+ case NSWindowExposedEventType:
+ case NSScreenChangedEventType:
break;
- case kEventClassCommand:
- TkMacOSXProcessCommandEvent(eventPtr, statusPtr);
- break;
- default: {
- TkMacOSXDbgMsg("Unrecognised event: %s",
- TkMacOSXCarbonEventToAscii(eventPtr->eventRef));
+ case NSWindowMovedEventType:
break;
+ case NSWindowWillMoveEventType:
+ break;
+
+ default:
+ break;
+ }
+ break;
+ case NSKeyUp:
+ case NSKeyDown:
+ case NSFlagsChanged:
+ flags = [theEvent modifierFlags];
+ processedEvent = [self tkProcessKeyEvent:theEvent];
+ break;
+ case NSLeftMouseDown:
+ case NSLeftMouseUp:
+ case NSRightMouseDown:
+ case NSRightMouseUp:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSMouseMoved:
+ case NSMouseEntered:
+ case NSMouseExited:
+ case NSScrollWheel:
+ case NSOtherMouseDown:
+ case NSOtherMouseUp:
+ case NSOtherMouseDragged:
+ case NSTabletPoint:
+ case NSTabletProximity:
+ processedEvent = [self tkProcessMouseEvent:theEvent];
+ break;
+#if 0
+ case NSSystemDefined:
+ subtype = [theEvent subtype];
+ break;
+ case NSApplicationDefined: {
+ id win;
+ win = [theEvent window];
+ break;
}
+ case NSCursorUpdate:
+ break;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+ case NSEventTypeGesture:
+ case NSEventTypeMagnify:
+ case NSEventTypeRotate:
+ case NSEventTypeSwipe:
+ case NSEventTypeBeginGesture:
+ case NSEventTypeEndGesture:
+ break;
+#endif
+#endif
+
+ default:
+ break;
}
- return 0;
+ return processedEvent;
}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
*
- * TkMacOSXProcessMenuEvent --
+ * TkMacOSXFlushWindows --
*
- * This routine processes the event in eventPtr, and
- * generates the appropriate Tk events from it.
+ * This routine flushes all the windows of the application. It is
+ * called by XSync().
*
* Results:
- * True if event(s) are generated - false otherwise.
+ * None.
*
* Side effects:
- * Additional events may be place on the Tk event queue.
+ * Flushes all Carbon windows
*
*----------------------------------------------------------------------
*/
-MODULE_SCOPE int
-TkMacOSXProcessMenuEvent(
- TkMacOSXEvent *eventPtr,
- MacEventStatus *statusPtr)
+MODULE_SCOPE void
+TkMacOSXFlushWindows(void)
{
- int menuContext;
- OSStatus err;
+ NSInteger windowCount;
+ NSInteger *windowNumbers;
- switch (eventPtr->eKind) {
- case kEventMenuBeginTracking:
- case kEventMenuEndTracking:
- case kEventMenuOpening:
- case kEventMenuTargetItem:
- break;
- default:
- return 0;
- break;
- }
- err = ChkErr(GetEventParameter, eventPtr->eventRef, kEventParamMenuContext,
- typeUInt32, NULL, sizeof(menuContext), NULL, &menuContext);
- if (err == noErr && ((menuContext & kMenuContextMenuBarTracking) ||
- (menuContext & kMenuContextPopUpTracking))) {
- switch (eventPtr->eKind) {
- MenuRef menu;
-
- case kEventMenuBeginTracking:
- TkMacOSXClearMenubarActive();
-
- /*
- * Handle -postcommand
- */
-
- TkMacOSXPreprocessMenu();
- TkMacOSXTrackingLoop(1);
- break;
- case kEventMenuEndTracking:
- TkMacOSXTrackingLoop(0);
- break;
- case kEventMenuOpening:
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamDirectObject, typeMenuRef, NULL,
- sizeof(menu), NULL, &menu);
- if (err == noErr) {
- TkMacOSXClearActiveMenu(menu);
- return TkMacOSXGenerateParentMenuSelectEvent(menu);
- }
- break;
- case kEventMenuTargetItem:
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamDirectObject, typeMenuRef, NULL,
- sizeof(menu), NULL, &menu);
- if (err == noErr) {
- MenuItemIndex index;
-
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamMenuItemIndex, typeMenuItemIndex, NULL,
- sizeof(index), NULL, &index);
- if (err == noErr) {
- return TkMacOSXGenerateMenuSelectEvent(menu, index);
- }
- }
- break;
+ NSCountWindows(&windowCount);
+ if(windowCount) {
+ windowNumbers = ckalloc(windowCount * sizeof(NSInteger));
+ NSWindowList(windowCount, windowNumbers);
+ for (NSInteger index = 0; index < windowCount; index++) {
+ NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]];
+ if (TkMacOSXGetXWindow(w)) {
+ [w flushWindow];
+ }
}
+ ckfree(windowNumbers);
}
- return 0;
}
/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXProcessCommandEvent --
- *
- * 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.
- *
- *----------------------------------------------------------------------
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
*/
-
-MODULE_SCOPE int
-TkMacOSXProcessCommandEvent(
- TkMacOSXEvent *eventPtr,
- MacEventStatus * statusPtr)
-{
- HICommand command;
- int menuContext;
- OSStatus err;
-
- switch (eventPtr->eKind) {
- case kEventCommandProcess:
- case kEventCommandUpdateStatus:
- break;
- default:
- return 0;
- break;
- }
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamDirectObject, typeHICommand, NULL, sizeof(command),
- NULL, &command);
- if (err == noErr && (command.attributes & kHICommandFromMenu)) {
- if (eventPtr->eKind == kEventCommandProcess) {
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamMenuContext, typeUInt32, NULL,
- sizeof(menuContext), NULL, &menuContext);
- if (err == noErr && (menuContext & kMenuContextMenuBar) &&
- (menuContext & kMenuContextMenuBarTracking)) {
- TkMacOSXHandleMenuSelect(GetMenuID(command.menu.menuRef),
- command.menu.menuItemIndex,
- (GetCurrentEventKeyModifiers() & optionKey) != 0);
- return 1;
- }
- } else {
- Tcl_CmdInfo dummy;
- if (command.commandID == kHICommandPreferences && eventPtr->interp) {
- if (Tcl_GetCommandInfo(eventPtr->interp,
- "::tk::mac::ShowPreferences", &dummy)) {
- if (!IsMenuItemEnabled(command.menu.menuRef,
- command.menu.menuItemIndex)) {
- EnableMenuItem(command.menu.menuRef,
- command.menu.menuItemIndex);
- }
- } else {
- if (IsMenuItemEnabled(command.menu.menuRef,
- command.menu.menuItemIndex)) {
- DisableMenuItem(command.menu.menuRef,
- command.menu.menuItemIndex);
- }
- }
- statusPtr->stopProcessing = 1;
- return 1;
- }
- }
- }
- return 0;
-}
diff --git a/macosx/tkMacOSXEvent.h b/macosx/tkMacOSXEvent.h
index 19b44f1..46d1585 100644
--- a/macosx/tkMacOSXEvent.h
+++ b/macosx/tkMacOSXEvent.h
@@ -4,55 +4,11 @@
* Declarations of Macintosh specific functions for implementing the
* Mac OS X Notifier.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKMACEVENT
@@ -62,44 +18,6 @@
#include "tkMacOSXInt.h"
#endif
-typedef struct {
- int stopProcessing;
- 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 */
- Tcl_Interp *interp; /* Interp to handle events in */
- EventHandlerCallRef callRef;
-} TkMacOSXEvent;
-
MODULE_SCOPE void TkMacOSXFlushWindows(void);
-MODULE_SCOPE int TkMacOSXProcessEvent(TkMacOSXEvent *eventPtr,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessMouseEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessWindowEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessKeyboardEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessApplicationEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessAppearanceEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessMenuEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXProcessCommandEvent(TkMacOSXEvent *e,
- MacEventStatus *statusPtr);
-MODULE_SCOPE int TkMacOSXKeycodeToUnicode(
- UniChar * uniChars, int maxChars,
- EventKind eKind,
- UInt32 keycode, UInt32 modifiers,
- UInt32 * deadKeyStatePtr);
#endif
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 1cf8951..305fe53 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -2,38 +2,14 @@
* tkMacOSXFont.c --
*
* Contains the Macintosh implementation of the platform-independant
- * font package interface. This version uses ATSU instead of Quickdraw.
+ * font package interface.
*
* Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
- * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
- *
- * Some functions were originally copied verbatim from the QuickDraw version
- * of tkMacOSXFont.c, which had these copyright notices:
- *
- * Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Todos:
- *
- * - Get away from Font Manager and Quickdraw functions as much as possible,
- * replace with ATS functions instead.
- *
- * - Use Font Manager functions to translate ids from ATS to Font Manager
- * instead of just assuming that they are the same.
- *
- * - Get a second font register going for fonts that are not assigned to a
- * font family by the OS. On my system I have 27 fonts of that type,
- * Hebrew, Arabic and Hindi fonts that actually come with the system.
- * FMGetFontFamilyInstanceFromFont() returns -981 (kFMInvalidFontFamilyErr)
- * for these and they are not listed when enumerating families, but they
- * are when enumerating fonts directly. The problem that the OS sees may
- * be that at least some of them do not contain any Latin characters. Note
- * that such fonts can not be used for controls, because controls
- * definitely require a family id (this assertion needs testing).
*/
#include "tkMacOSXPrivate.h"
@@ -46,19 +22,6 @@
*/
/*
- * Problem: The sum of two parts is not the same as the whole. In particular
- * the width of two separately measured strings will usually be larger than
- * the width of them pasted together. Tk has a design bug here, because it
- * generally assumes that this kind of arithmetic works.
- * To workaround this, #define TK_MAC_COALESCE_LINE to 1 below, we then avoid
- * lines that tremble and shiver while the cursor passes through them by
- * undercutting the system and behind the scenes pasting strings together that
- * look like they are on the same line and adjacent and that are drawn with
- * the same font. To do this we need some global data.
- */
-#define TK_MAC_COALESCE_LINE 0
-
-/*
* The following structure represents our Macintosh-specific implementation
* of a font object.
*/
@@ -67,87 +30,11 @@ typedef struct {
TkFont font; /* Stuff used by generic font package. Must
* be first in structure. */
- /*
- * The ATSU view of the font and other text properties. Used for drawing
- * and measuring.
- */
-
- ATSUFontID atsuFontId; /* == FMFont. */
- ATSUTextLayout atsuLayout; /* ATSU layout object, representing the whole
- * text that ATSU sees with some option
- * bits. */
- ATSUStyle atsuStyle; /* ATSU style object, representing a run of
- * text with the same properties. */
-
- /*
- * The QuickDraw view of the font. Used to configure controls.
- */
-
- FMFontFamily qdFont; /* == FMFontFamilyId, Carbon replacement for
- * QD face numbers. */
- short qdSize; /* Font size in points. */
- short qdStyle; /* QuickDraw style bits. */
+ NSFont *nsFont;
+ NSDictionary *nsAttributes;
} MacFont;
/*
- * Information about font families, initialized at startup time. Font
- * families are described by a mapping from UTF-8 names to MacOS font family
- * IDs. The whole list is kept as the sorted array "familyList", allocated
- * with ckrealloc().
- *
- * Note: This would have been easier, if we could just have used Tcl hash
- * arrays. Unfortunately there seems to be no pre-packaged
- * non-case-sensitive version of that available.
- */
-
-typedef struct {
- const char * name;
- FMFontFamily familyId;
-} MacFontFamily;
-
-static MacFontFamily * familyList = NULL;
-static int
- familyListNextFree = 0, /* The next free slot in familyList. */
- familyListMaxValid = 0, /* The top of the sorted area. */
- familyListSize = 0; /* The size of the whole array. */
-
-/*
- * A simple one-shot sub-allocator for fast and efficient allocation of
- * strings. Used by the familyList array for the names. These strings are
- * only allocated once at startup and never freed. If you ever need to
- * re-initialize this, you can just ckfree() all the StringBlocks in the list
- * and start over.
- */
-
-#define STRING_BLOCK_MAX (1024-8) /* Make sizeof(StringBlock) ==
- * 1024. */
-typedef struct StringBlock {
- struct StringBlock *next; /* Starting from "stringMemory" these
- * blocks form a linked list. */
- int nextFree; /* Top of the used area in the
- * "strings" member. */
- char strings[STRING_BLOCK_MAX]; /* The actual memory managed here. */
-} StringBlock;
-
-static StringBlock *stringMemory = NULL;
-
-#if TK_MAC_COALESCE_LINE
-static Tcl_DString currentLine; /* The current line as seen so far. This
- * contains a Tcl_UniChar DString. */
-static int
- currentY = -1, /* The Y position (row in pixels) of the
- * current line. */
- currentLeft = -1, /* The left edge (pixels) of the current
- * line. */
- currentRight = -1; /* The right edge (pixels) of the current
- * line. */
-static const MacFont *currentFontPtr = NULL;
- /* The font of the current line. */
-#endif /* TK_MAC_COALESCE_LINE */
-
-static int antialiasedTextEnabled;
-
-/*
* The names for our "native" fonts.
*/
@@ -187,172 +74,226 @@ static const struct SystemFontMapEntry systemFontMap[] = {
};
#undef ThemeFont
-/*
- * Procedures used only in this file.
- */
-
-static void LayoutSetString(const MacFont *fontPtr,
- const TkMacOSXDrawingContext *drawingContextPtr,
- const UniChar * uchars, int ulen);
-
-/*
- * The actual workers.
- */
-
-static int MeasureStringWidth(const MacFont *fontPtr, int start, int end);
-
-#if TK_MAC_COALESCE_LINE
-static const Tcl_UniChar *UpdateLineBuffer(const MacFont *fontPtr,
- const TkMacOSXDrawingContext *drawingContextPtr, const char *source,
- int numBytes, int x, int y, int * offset);
-#endif /* TK_MAC_COALESCE_LINE */
-
-/*
- * Initialization and setup of a font data structure.
- */
-
-static const char *FamilyNameForFamilyID(FMFontFamily familyId);
-static void InitFont(FMFontFamily familyId, const char *familyName,
- int size, int qdStyle, MacFont *fontPtr);
-static void InitATSUObjects(FMFontFamily familyId, short qdsize, short qdStyle,
- ATSUFontID *fontIdPtr, ATSUTextLayout *layoutPtr, ATSUStyle *stylePtr);
-static void InitATSUStyle(ATSUFontID fontId, short ptSize, short qdStyle,
- ATSUStyle style);
-static void SetFontFeatures(ATSUFontID fontId, int fixed, short size,
- ATSUStyle style);
-static void AdjustFontHeight(MacFont *fontPtr);
-static void InitATSULayout(const TkMacOSXDrawingContext *drawingContextPtr,
- ATSUTextLayout layout, int fixed);
-static void ReleaseFont(MacFont *fontPtr);
-
-/*
- * Finding fonts by name.
- */
-
-static const MacFontFamily *FindFontFamilyOrAlias(const char *name);
-static const MacFontFamily *FindFontFamilyOrAliasOrFallback(const char *name);
-
-/*
- * Doing interesting things with font families and fonts.
- */
-
-static void InitFontFamilies(void);
-static OSStatus GetFontFamilyName(FMFontFamily fontFamily, char *name,
- int numBytes);
-
-/*
- * Accessor functions and internal utilities for the font family list.
- */
-
-static const MacFontFamily *AddFontFamily(const char *name,
- FMFontFamily familyId);
-static const MacFontFamily *FindFontFamily(const char *name);
-static Tcl_Obj *EnumFontFamilies(void);
-
-static OSStatus FontFamilyEnumCallback(ATSFontFamilyRef family, void *refCon);
-static void SortFontFamilies(void);
-static int CompareFontFamilies(const void *vp1, const void *vp2);
-static const char *AddString(const char *in);
+static int antialiasedTextEnabled = -1;
+static NSCharacterSet *whitespaceCharacterSet = nil;
+static NSCharacterSet *lineendingCharacterSet = nil;
-static OSStatus GetThemeFontAndFamily(const ThemeFontID themeFontId,
- FMFontFamily *fontFamily, unsigned char *fontName, SInt16 *fontSize,
- Style *fontStyle);
-static void InitSystemFonts(TkMainInfo *mainPtr);
+static void GetTkFontAttributesForNSFont(NSFont *nsFont,
+ TkFontAttributes *faPtr);
+static NSFont *FindNSFont(const char *familyName, NSFontTraitMask traits,
+ NSInteger weight, CGFloat size, int fallbackToDefault);
+static void InitFont(NSFont *nsFont, const TkFontAttributes *reqFaPtr,
+ MacFont * fontPtr);
static int CreateNamedSystemFont(Tcl_Interp *interp, Tk_Window tkwin,
const char* name, TkFontAttributes *faPtr);
-
+static void DrawCharsInContext(Display *display, Drawable drawable, GC gc,
+ Tk_Font tkfont, const char *source, int numBytes, int rangeStart,
+ int rangeLength, int x, int y, double angle);
+
+@interface NSFont(TKFont)
+- (NSFont *) bestMatchingFontForCharacters: (const UTF16Char *) characters
+ length: (NSUInteger) length attributes: (NSDictionary *) attributes
+ actualCoveredLength: (NSUInteger *) coveredLength;
+@end
+
+#pragma mark -
+#pragma mark Font Helpers:
+
+#define GetNSFontTraitsFromTkFontAttributes(faPtr) \
+ ((faPtr)->weight == TK_FW_BOLD ? NSBoldFontMask : NSUnboldFontMask) | \
+ ((faPtr)->slant == TK_FS_ITALIC ? NSItalicFontMask : NSUnitalicFontMask)
/*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*
- * TkpFontPkgInit --
+ * GetTkFontAttributesForNSFont --
*
- * 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.
+ * Fill in TkFontAttributes for given NSFont.
*
* Results:
* None.
*
* Side effects:
- * Initialization of variables local to this file.
+ * None.
*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
-void
-TkpFontPkgInit(
- TkMainInfo *mainPtr) /* The application being created. */
+static void
+GetTkFontAttributesForNSFont(
+ NSFont *nsFont,
+ TkFontAttributes *faPtr)
{
- InitFontFamilies();
- InitSystemFonts(mainPtr);
+ NSFontTraitMask traits = [[NSFontManager sharedFontManager]
+ traitsOfFont:nsFont];
-#if TK_MAC_COALESCE_LINE
- Tcl_DStringInit(&currentLine);
-#endif
+ faPtr->family = Tk_GetUid([[nsFont familyName] UTF8String]);
+ faPtr->size = [nsFont pointSize];
+ faPtr->weight = (traits & NSBoldFontMask ? TK_FW_BOLD : TK_FW_NORMAL);
+ faPtr->slant = (traits & NSItalicFontMask ? TK_FS_ITALIC : TK_FS_ROMAN);
}
/*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*
- * InitSystemFonts --
+ * FindNSFont --
*
- * Initialize named system fonts.
+ * Find NSFont for given attributes. Use default values for missing
+ * attributes, and do a case-insensitive search for font family names
+ * if necessary. If fallbackToDefault flag is set, use the system font
+ * as a last resort.
*
* Results:
- *
* None.
*
* Side effects:
- *
* None.
*
- *-------------------------------------------------------------------------
+ *---------------------------------------------------------------------------
*/
-static void
-InitSystemFonts(
- TkMainInfo *mainPtr)
+static NSFont *
+FindNSFont(
+ const char *familyName,
+ NSFontTraitMask traits,
+ NSInteger weight,
+ CGFloat size,
+ int fallbackToDefault)
{
- Tcl_Interp *interp = mainPtr->interp;
- Tk_Window tkwin = (Tk_Window) mainPtr->winPtr;
- const struct SystemFontMapEntry *systemFont = systemFontMap;
- TkFontAttributes fa;
+ NSFontManager *fm = [NSFontManager sharedFontManager];
+ NSFont *nsFont, *dflt = nil;
+ #define defaultFont (dflt ? dflt : (dflt = [NSFont systemFontOfSize:0]))
+ NSString *family;
- /* force this for now */
- if (!mainPtr->winPtr->mainPtr) {
- mainPtr->winPtr->mainPtr = mainPtr;
+ if (familyName) {
+ family = [[[NSString alloc] initWithUTF8String:familyName] autorelease];
+ } else {
+ family = [defaultFont familyName];
}
- TkInitFontAttributes(&fa);
- while (systemFont->systemName) {
- Str255 fontName;
- SInt16 fontSize;
- Style fontStyle;
-
- if (GetThemeFont(systemFont->id, smSystemScript, fontName,
- &fontSize, &fontStyle) == noErr) {
- CopyPascalStringToC(fontName, (char*)fontName);
- fa.family = Tk_GetUid((char*)fontName);
- fa.size = fontSize;
- fa.weight = (fontStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
- fa.slant = (fontStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
- fa.underline = ((fontStyle & underline) != 0);
- CreateNamedSystemFont(interp, tkwin, systemFont->systemName, &fa);
- if (systemFont->tkName) {
- CreateNamedSystemFont(interp, tkwin, systemFont->tkName, &fa);
- }
- if (systemFont->tkName1) {
- CreateNamedSystemFont(interp, tkwin, systemFont->tkName1, &fa);
+ if (size == 0.0) {
+ size = [defaultFont pointSize];
+ }
+ nsFont = [fm fontWithFamily:family traits:traits weight:weight size:size];
+ if (!nsFont) {
+ NSArray *availableFamilies = [fm availableFontFamilies];
+ NSString *caseFamily = nil;
+
+ for (NSString *f in availableFamilies) {
+ if ([family caseInsensitiveCompare:f] == NSOrderedSame) {
+ caseFamily = f;
+ break;
}
}
- systemFont++;
+ if (caseFamily) {
+ nsFont = [fm fontWithFamily:caseFamily traits:traits weight:weight
+ size:size];
+ }
}
- fa.family = Tk_GetUid("monaco");
- fa.size = 11;
- fa.weight = TK_FW_NORMAL;
- fa.slant = TK_FS_ROMAN;
- fa.underline = 0;
- CreateNamedSystemFont(interp, tkwin, "TkFixedFont", &fa);
+ if (!nsFont) {
+ nsFont = [NSFont fontWithName:family size:size];
+ }
+ if (!nsFont && fallbackToDefault) {
+ nsFont = [fm convertFont:defaultFont toFamily:family];
+ nsFont = [fm convertFont:nsFont toSize:size];
+ nsFont = [fm convertFont:nsFont toHaveTrait:traits];
+ }
+ #undef defaultFont
+ return nsFont;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitFont --
+ *
+ * Helper for TkpGetNativeFont() and TkpGetFontFromAttributes().
+ *
+ * Results:
+ * Fills the MacFont structure.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitFont(
+ NSFont *nsFont,
+ const TkFontAttributes *reqFaPtr, /* Can be NULL */
+ MacFont *fontPtr)
+{
+ TkFontAttributes *faPtr;
+ TkFontMetrics *fmPtr;
+ NSDictionary *nsAttributes;
+ NSRect bounds;
+ CGFloat kern = 0.0;
+ NSFontRenderingMode renderingMode = NSFontDefaultRenderingMode;
+ int ascent, descent, dontAA;
+ static const UniChar ch[] = {'.', 'W', ' ', 0xc4, 0xc1, 0xc2, 0xc3, 0xc7};
+ /* ., W, Space, Auml, Aacute, Acirc, Atilde, Ccedilla */
+ #define nCh (sizeof(ch) / sizeof(UniChar))
+ CGGlyph glyphs[nCh];
+ CGRect boundingRects[nCh];
+
+ fontPtr->font.fid = (Font) fontPtr;
+ faPtr = &fontPtr->font.fa;
+ if (reqFaPtr) {
+ *faPtr = *reqFaPtr;
+ } else {
+ TkInitFontAttributes(faPtr);
+ }
+ fontPtr->nsFont = nsFont;
+ dontAA = [nsFont isFixedPitch] && fontPtr->font.fa.size <= 10;
+ if (antialiasedTextEnabled >= 0 || dontAA) {
+ renderingMode = (antialiasedTextEnabled == 0 || dontAA) ?
+ NSFontIntegerAdvancementsRenderingMode :
+ NSFontAntialiasedRenderingMode;
+ }
+ nsFont = [nsFont screenFontWithRenderingMode:renderingMode];
+ GetTkFontAttributesForNSFont(nsFont, faPtr);
+ fmPtr = &fontPtr->font.fm;
+ fmPtr->ascent = floor([nsFont ascender] + [nsFont leading] + 0.5);
+ fmPtr->descent = floor(-[nsFont descender] + 0.5);
+ fmPtr->maxWidth = [nsFont maximumAdvancement].width;
+ fmPtr->fixed = [nsFont isFixedPitch]; /* Does not work for all fonts */
+
+ /*
+ * The ascent, descent and fixed fields are not correct for all fonts, as
+ * a workaround deduce that info from the metrics of some typical glyphs,
+ * along with screenfont kerning (space advance difference to printer font)
+ */
+
+ bounds = [nsFont boundingRectForFont];
+ if (CTFontGetGlyphsForCharacters((CTFontRef) nsFont, ch, glyphs, nCh)) {
+ fmPtr->fixed = [nsFont advancementForGlyph:glyphs[0]].width ==
+ [nsFont advancementForGlyph:glyphs[1]].width;
+ bounds = NSRectFromCGRect(CTFontGetBoundingRectsForGlyphs((CTFontRef)
+ nsFont, kCTFontDefaultOrientation, ch, boundingRects, nCh));
+ kern = [nsFont advancementForGlyph:glyphs[2]].width -
+ [fontPtr->nsFont advancementForGlyph:glyphs[2]].width;
+ }
+ descent = floor(-bounds.origin.y + 0.5);
+ ascent = floor(bounds.size.height + bounds.origin.y + 0.5);
+ if (ascent > fmPtr->ascent) {
+ fmPtr->ascent = ascent;
+ }
+ if (descent > fmPtr->descent) {
+ fmPtr->descent = descent;
+ }
+ nsAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
+ nsFont, NSFontAttributeName,
+ [NSNumber numberWithInt:faPtr->underline ?
+ NSUnderlineStyleSingle|NSUnderlinePatternSolid :
+ NSUnderlineStyleNone], NSUnderlineStyleAttributeName,
+ [NSNumber numberWithInt:faPtr->overstrike ?
+ NSUnderlineStyleSingle|NSUnderlinePatternSolid :
+ NSUnderlineStyleNone], NSStrikethroughStyleAttributeName,
+ [NSNumber numberWithInt:fmPtr->fixed ? 0 : 1],
+ NSLigatureAttributeName,
+ [NSNumber numberWithDouble:kern], NSKernAttributeName, nil];
+ fontPtr->nsAttributes = TkMacOSXMakeUncollectableAndRetain(nsAttributes);
+ #undef nCh
}
/*
@@ -383,37 +324,84 @@ CreateNamedSystemFont(
TkDeleteNamedFont(NULL, tkwin, name);
return TkCreateNamedFont(interp, tkwin, name, faPtr);
}
+
+#pragma mark -
+#pragma mark Font handling:
/*
- *---------------------------------------------------------------------------
+ *-------------------------------------------------------------------------
+ *
+ * TkpFontPkgInit --
*
- * GetThemeFontAndFamily --
+ * 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.
+ * Note that this is called before TkpInit() !
*
- * Wrapper around the GetThemeFont and FMGetFontFamilyFromName APIs.
+ * Results:
+ * None.
*
- *---------------------------------------------------------------------------
+ * Side effects:
+ * Initialize named system fonts.
+ *
+ *-------------------------------------------------------------------------
*/
-OSStatus
-GetThemeFontAndFamily(
- const ThemeFontID themeFontId,
- FMFontFamily* fontFamily,
- unsigned char *fontName,
- SInt16 *fontSize,
- Style *fontStyle)
+void
+TkpFontPkgInit(
+ TkMainInfo *mainPtr) /* The application being created. */
{
- OSStatus err = ChkErr(GetThemeFont, themeFontId, smSystemScript, fontName,
- fontSize, fontStyle);
+ Tcl_Interp *interp = mainPtr->interp;
+ Tk_Window tkwin = (Tk_Window) mainPtr->winPtr;
+ const struct SystemFontMapEntry *systemFont = systemFontMap;
+ NSFont *nsFont;
+ TkFontAttributes fa;
+ NSMutableCharacterSet *cs;
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
- if (err == noErr) {
- *fontFamily = FMGetFontFamilyFromName(fontName);
- if (*fontFamily == kInvalidFontFamily) {
- err = kFMInvalidFontFamilyErr;
- TkMacOSXDbgMsg("FMGetFontFamilyFromName failed.");
+ /* force this for now */
+ if (!mainPtr->winPtr->mainPtr) {
+ mainPtr->winPtr->mainPtr = mainPtr;
+ }
+ while (systemFont->systemName) {
+ nsFont = (NSFont*) CTFontCreateUIFontForLanguage(
+ HIThemeGetUIFontType(systemFont->id), 0, NULL);
+ if (nsFont) {
+ TkInitFontAttributes(&fa);
+ GetTkFontAttributesForNSFont(nsFont, &fa);
+ CreateNamedSystemFont(interp, tkwin, systemFont->systemName, &fa);
+ if (systemFont->tkName) {
+ CreateNamedSystemFont(interp, tkwin, systemFont->tkName, &fa);
+ }
+ if (systemFont->tkName1) {
+ CreateNamedSystemFont(interp, tkwin, systemFont->tkName1, &fa);
+ }
+ CFRelease(nsFont);
}
+ systemFont++;
}
-
- return err;
+ TkInitFontAttributes(&fa);
+ nsFont = (NSFont*) CTFontCreateUIFontForLanguage(
+ kCTFontUserFixedPitchFontType, 11, NULL);
+ if (nsFont) {
+ GetTkFontAttributesForNSFont(nsFont, &fa);
+ CFRelease(nsFont);
+ } else {
+ fa.family = Tk_GetUid("Monaco");
+ fa.size = 11;
+ fa.weight = TK_FW_NORMAL;
+ fa.slant = TK_FS_ROMAN;
+ }
+ CreateNamedSystemFont(interp, tkwin, "TkFixedFont", &fa);
+ if (!whitespaceCharacterSet) {
+ whitespaceCharacterSet = [[NSCharacterSet
+ whitespaceAndNewlineCharacterSet] retain];
+ cs = [whitespaceCharacterSet mutableCopy];
+ [cs removeCharactersInString:@" "];
+ lineendingCharacterSet = [cs copy];
+ [cs release];
+ }
+ [pool drain];
}
/*
@@ -447,12 +435,9 @@ TkpGetNativeFont(
Tk_Window tkwin, /* For display where font will be used. */
const char *name) /* Platform-specific font name. */
{
+ MacFont *fontPtr = NULL;
ThemeFontID themeFontId;
- FMFontFamily fontFamily;
- Str255 fontName;
- SInt16 fontSize;
- Style fontStyle;
- MacFont *fontPtr;
+ CTFontRef ctFont;
if (strcmp(name, SYSTEMFONT_NAME) == 0) {
themeFontId = kThemeSystemFont;
@@ -463,14 +448,12 @@ TkpGetNativeFont(
} else {
return NULL;
}
- if (GetThemeFontAndFamily(themeFontId, &fontFamily, fontName, &fontSize,
- &fontStyle) != noErr) {
- return NULL;
+ ctFont = CTFontCreateUIFontForLanguage(HIThemeGetUIFontType(
+ themeFontId), 0, NULL);
+ if (ctFont) {
+ fontPtr = ckalloc(sizeof(MacFont));
+ InitFont((NSFont*) ctFont, NULL, fontPtr);
}
- CopyPascalStringToC(fontName, (char*)fontName);
-
- fontPtr = (MacFont *) ckalloc(sizeof(MacFont));
- InitFont(fontFamily, (char*)fontName, fontSize, fontStyle, fontPtr);
return (TkFont *) fontPtr;
}
@@ -516,41 +499,34 @@ TkpGetFontFromAttributes(
const TkFontAttributes *faPtr)
/* Set of attributes to match. */
{
- short qdStyle;
- FMFontFamily familyId;
- const char *name;
- const MacFontFamily *familyPtr;
MacFont *fontPtr;
+ int points = TkFontGetPoints(tkwin, faPtr->size);
+ NSFontTraitMask traits = GetNSFontTraitsFromTkFontAttributes(faPtr);
+ NSInteger weight = (faPtr->weight == TK_FW_BOLD ? 9 : 5);
+ NSFont *nsFont;
- familyId = GetAppFont();
- name = NULL;
- qdStyle = 0;
+ nsFont = FindNSFont(faPtr->family, traits, weight, points, 0);
+ if (!nsFont) {
+ const char *const *aliases = TkFontGetAliasList(faPtr->family);
- if (faPtr->family != NULL) {
- familyPtr = FindFontFamilyOrAliasOrFallback(faPtr->family);
- if (familyPtr != NULL) {
- name = familyPtr->name;
- familyId = familyPtr->familyId;
+ while (aliases && !nsFont) {
+ nsFont = FindNSFont(*aliases++, traits, weight, points, 0);
}
}
-
- if (faPtr->weight != TK_FW_NORMAL) {
- qdStyle |= bold;
+ if (!nsFont) {
+ nsFont = FindNSFont(faPtr->family, traits, weight, points, 1);
}
- if (faPtr->slant != TK_FS_ROMAN) {
- qdStyle |= italic;
- }
- if (faPtr->underline) {
- qdStyle |= underline;
+ if (!nsFont) {
+ Tcl_Panic("Could not deternmine NSFont from TkFontAttributes");
}
if (tkFontPtr == NULL) {
- fontPtr = (MacFont *) ckalloc(sizeof(MacFont));
+ fontPtr = ckalloc(sizeof(MacFont));
} else {
fontPtr = (MacFont *) tkFontPtr;
- ReleaseFont(fontPtr);
+ TkpDeleteFont(tkFontPtr);
}
- InitFont(familyId, name, TkFontGetPoints(tkwin, faPtr->size),
- qdStyle, fontPtr);
+ CFRetain(nsFont); /* Always needed to allow unconditional CFRelease below */
+ InitFont(nsFont, faPtr, fontPtr);
return (TkFont *) fontPtr;
}
@@ -578,7 +554,10 @@ void
TkpDeleteFont(
TkFont *tkFontPtr) /* Token of font to be deleted. */
{
- ReleaseFont((MacFont *) tkFontPtr);
+ MacFont *fontPtr = (MacFont *) tkFontPtr;
+
+ TkMacOSXMakeCollectableAndRelease(fontPtr->nsAttributes);
+ CFRelease(fontPtr->nsFont); /* Either a CTFontRef or a CFRetained NSFont */
}
/*
@@ -604,7 +583,14 @@ TkpGetFontFamilies(
Tcl_Interp *interp, /* Interp to hold result. */
Tk_Window tkwin) /* For display to query. */
{
- Tcl_SetObjResult(interp, EnumFontFamilies());
+ Tcl_Obj *resultPtr = Tcl_NewListObj(0, NULL);
+ NSArray *list = [[NSFontManager sharedFontManager] availableFontFamilies];
+
+ for (NSString *family in list) {
+ Tcl_ListObjAppendElement(NULL, resultPtr,
+ Tcl_NewStringObj([family UTF8String], -1));
+ }
+ Tcl_SetObjResult(interp, resultPtr);
}
/*
@@ -630,10 +616,23 @@ TkpGetSubFonts(
Tcl_Interp *interp, /* Interp to hold result. */
Tk_Font tkfont) /* Font object to query. */
{
- /* We don't know much about our fallback fonts, ATSU does all that for
- * us. We could use ATSUMatchFont to implement this function. But as
- * the information is only used for testing, such an effort seems not
- * very useful. */
+ MacFont *fontPtr = (MacFont *) tkfont;
+ Tcl_Obj *resultPtr = Tcl_NewListObj(0, NULL);
+
+ if (fontPtr->nsFont) {
+ NSArray *list = [[fontPtr->nsFont fontDescriptor]
+ objectForKey:NSFontCascadeListAttribute];
+
+ for (NSFontDescriptor *subFontDesc in list) {
+ NSString *family = [subFontDesc objectForKey:NSFontFamilyAttribute];
+
+ if (family) {
+ Tcl_ListObjAppendElement(NULL, resultPtr,
+ Tcl_NewStringObj([family UTF8String], -1));
+ }
+ }
+ }
+ Tcl_SetObjResult(interp, resultPtr);
}
/*
@@ -660,72 +659,23 @@ TkpGetFontAttrsForChar(
Tcl_UniChar c, /* Character of interest */
TkFontAttributes* faPtr) /* Output: Font attributes */
{
- const MacFont * fontPtr = (const MacFont *) tkfont;
- UniChar uchar = c;
- TkMacOSXDrawingContext drawingContext;
- OSStatus err;
- ATSUFontID fontId;
- UniCharArrayOffset changedOffset;
- UniCharCount changedLength;
-
- /*
- * Most of the attributes are just copied from the base font. This
- * assumes that all fonts can have all attributes.
- */
+ MacFont *fontPtr = (MacFont *) tkfont;
+ NSFont *nsFont = fontPtr->nsFont;
*faPtr = fontPtr->font.fa;
+ if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) {
+ UTF16Char ch = c;
- /*
- * But the name of the actual font may still differ, so we activate the
- * string as an ATSU layout and ask ATSU about the fallback.
- */
- if (!TkMacOSXSetupDrawingContext(Tk_WindowId(tkwin), NULL, 1,
- &drawingContext)) {
- Tcl_Panic("TkpGetFontAttrsForChar: drawingContext not setup");
- }
-
- LayoutSetString(fontPtr, &drawingContext, &uchar, 1);
-
- fontId = fontPtr->atsuFontId;
- err = ATSUMatchFontsToText(
- fontPtr->atsuLayout, 0, 1,
- &fontId, &changedOffset, &changedLength);
- if (err != kATSUFontsMatched && err != noErr) {
- TkMacOSXDbgMsg("Can't match \\u%04X", (unsigned) c);
- }
-
- if (err == kATSUFontsMatched) {
- /*
- * A fallback was used and the actual font is in fontId. Determine
- * the name.
- */
-
- FMFontFamily fontFamilyId;
- FMFontStyle fontStyle;
- int i;
-
- err = ChkErr(FMGetFontFamilyInstanceFromFont, fontId, &fontFamilyId,
- &fontStyle);
- if (err == noErr) {
- /*
- * Find the canonical name in our global list.
- */
-
- for (i=0; i<familyListMaxValid; ++i) {
- if (fontFamilyId == familyList[i].familyId) {
- faPtr->family = familyList[i].name;
- break;
- }
- }
- if (i >= familyListMaxValid) {
- TkMacOSXDbgMsg("Can't find font %d for \\u%04X", fontFamilyId,
- (unsigned) c);
- }
+ nsFont = [nsFont bestMatchingFontForCharacters:&ch
+ length:1 attributes:nil actualCoveredLength:NULL];
+ if (nsFont) {
+ GetTkFontAttributesForNSFont(nsFont, faPtr);
}
}
-
- TkMacOSXRestoreDrawingContext(&drawingContext);
}
+
+#pragma mark -
+#pragma mark Measuring and drawing:
/*
*---------------------------------------------------------------------------
@@ -837,263 +787,116 @@ TkpMeasureCharsInContext(
* terminating character. */
{
const MacFont *fontPtr = (const MacFont *) tkfont;
- int curX = -1, curByte = 0;
- UniChar *uchars;
- int ulen;
- UniCharArrayOffset urstart, urlen, urend;
- Tcl_DString ucharBuffer;
- int forceCharacterMode = 0;
-
- /*
- * Sanity checks.
- */
-
- if (rangeStart < 0 || (rangeStart+rangeLength) > numBytes) {
- TkMacOSXDbgMsg("Bad parameters");
+ NSString *string;
+ NSAttributedString *attributedString;
+ CTTypesetterRef typesetter;
+ CFIndex start, len;
+ CFRange range = {0, 0};
+ CTLineRef line;
+ CGFloat offset = 0;
+ CFIndex index;
+ double width;
+ int length, fit;
+
+ if (rangeStart < 0 || rangeLength <= 0 ||
+ rangeStart + rangeLength > numBytes ||
+ (maxLength == 0 && !(flags & TK_AT_LEAST_ONE))) {
*lengthPtr = 0;
return 0;
}
-
- /*
- * Get simple no-brainers out of the way.
- */
-
- if (rangeLength == 0 || (maxLength == 0 && !(flags & TK_AT_LEAST_ONE))) {
- *lengthPtr = 0;
- return 0;
+#if 0
+ /* Back-compatibility with ATSUI renderer, appears not to be needed */
+ if (rangeStart == 0 && maxLength == 1 && (flags & TK_ISOLATE_END) &&
+ !(flags & TK_AT_LEAST_ONE)) {
+ length = 0;
+ fit = 0;
+ goto done;
+ }
+#endif
+ if (maxLength > 32767) {
+ maxLength = 32767;
+ }
+ string = [[NSString alloc] initWithBytesNoCopy:(void*)source
+ length:numBytes encoding:NSUTF8StringEncoding freeWhenDone:NO];
+ if (!string) {
+ length = 0;
+ fit = rangeLength;
+ goto done;
+ }
+ attributedString = [[NSAttributedString alloc] initWithString:string
+ attributes:fontPtr->nsAttributes];
+ typesetter = CTTypesetterCreateWithAttributedString(
+ (CFAttributedStringRef)attributedString);
+ start = Tcl_NumUtfChars(source, rangeStart);
+ len = Tcl_NumUtfChars(source, rangeStart + rangeLength);
+ if (start > 0) {
+ range.length = start;
+ line = CTTypesetterCreateLine(typesetter, range);
+ offset = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
+ CFRelease(line);
}
-
- Tcl_DStringInit(&ucharBuffer);
- uchars = Tcl_UtfToUniCharDString(source, numBytes, &ucharBuffer);
- ulen = Tcl_DStringLength(&ucharBuffer) / sizeof(Tcl_UniChar);
- LayoutSetString(fontPtr, NULL, uchars, ulen);
-
- urstart = Tcl_NumUtfChars(source, rangeStart);
- urlen = Tcl_NumUtfChars(source+rangeStart,rangeLength);
- urend = urstart + urlen;
-
if (maxLength < 0) {
- curX = MeasureStringWidth(fontPtr, urstart, urend);
- curByte = rangeLength;
+ index = len;
+ range.length = len;
+ line = CTTypesetterCreateLine(typesetter, range);
+ width = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
+ CFRelease(line);
} else {
- UniCharArrayOffset offset = 0;
- OSStatus err;
-
- /*
- * Have some upper limit on the size actually used.
- */
-
- if (maxLength > 32767) {
- maxLength = 32767;
- }
-
- offset = urstart;
- err = noErr;
-
- if (maxLength > 1) {
- /*
- * Let the system do some work by calculating a line break.
- *
- * Somehow ATSUBreakLine seems to assume that it needs at least
- * one pixel padding. So we add one to the limit. Note also
- * that ATSUBreakLine sometimes runs into an endless loop when
- * the third parameter is equal or less than IntToFixed(2), so we
- * need at least IntToFixed(3) (at least that's the current state
- * of my knowledge).
- */
-
- err = ATSUBreakLine(fontPtr->atsuLayout, urstart,
- IntToFixed(maxLength+1), false, /* !iUseAsSoftLineBreak */
- &offset);
-
- /*
- * There is no way to signal an error from this routine, so we
- * use predefined offset=urstart and otherwise ignore the
- * possibility.
- */
-
- if ((err != noErr) && (err != kATSULineBreakInWord)) {
- TkMacOSXDbgMsg("ATSUBreakLine failed: %ld for '%.*s'", err,
- rangeLength, source+rangeStart);
- }
-
-#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("measure: '%.*s', break offset=%ld, errcode=%ld",
- rangeLength, source+rangeStart, offset, err);
-#endif
-
- /*
- * ATSUBreakLine includes the whitespace that separates words,
- * but we don't want that. Besides, ATSUBreakLine thinks that
- * spaces don't occupy pixels at the end of the break, which is
- * also something we like to decide for ourself.
- */
-
- while ((offset > urstart) && (uchars[offset-1] == ' ')) {
- offset--;
- }
- }
-
- /*
- * Fix up left-overs for the TK_WHOLE_WORDS case.
- */
+ double maxWidth = maxLength + offset;
+ NSCharacterSet *cs;
+ index = start;
if (flags & TK_WHOLE_WORDS) {
- if ((flags & TK_AT_LEAST_ONE) && ((offset == urstart)
- || ((offset != urend) && (uchars[offset] != ' ')))) {
- /*
- * With TK_AT_LEAST_ONE, if we are the the start of the
- * range, we need to add at least one character. If we are
- * not at the end of a word, we must be in the middle of the
- * first word still and we want to just use what we have so
- * far. In both cases we still need to find the right
- * character boundary, so we set a flag that gets us into the
- * code for character mode below.
- */
-
- forceCharacterMode = 1;
-
- } else {
- /*
- * If we are not at the end of a word, we must be in the
- * middle of the first word still. Return 0.
- */
-
- if ((offset != urend) && (uchars[offset] != ' ')) {
- offset = urstart;
- curX = 0;
- }
+ index = CTTypesetterSuggestLineBreak(typesetter, 0, maxWidth);
+ if (index <= start && (flags & TK_AT_LEAST_ONE)) {
+ flags &= ~TK_WHOLE_WORDS;
}
}
-
- if (offset > urend) {
- offset = urend;
+ if (index <= start && !(flags & TK_WHOLE_WORDS)) {
+ index = CTTypesetterSuggestClusterBreak(typesetter, 0, maxWidth);
}
-
- /*
- * If "flags" says that we don't actually want a word break, we need
- * to find the next character break ourself, as ATSUBreakLine will
- * only give us word breaks. Do a simple linear search.
- *
- * Even do this, if ATSUBreakLine returned kATSULineBreakInWord,
- * because we have not accounted correctly for all of the flags yet,
- * like TK_AT_LEAST_ONE.
- */
-
- if ((!(flags & TK_WHOLE_WORDS) || forceCharacterMode) && (offset <= urend)) {
- UniCharArrayOffset lastOffset = offset;
- UniCharArrayOffset nextoffset;
- int lastX = -1;
- int wantonemorechar = -1; /* undecided */
-
- while (offset <= urend) {
- if (flags & TK_ISOLATE_END) {
- LayoutSetString(fontPtr, NULL, uchars, offset);
- }
- curX = MeasureStringWidth(fontPtr, urstart, offset);
-
-#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("measure: '%.*s', try until=%ld, width=%d",
- rangeLength, source+rangeStart, offset, curX);
-#endif
-
- if (curX > maxLength) {
- /*
- * Even if we are over the limit, we may want another
- * character in some situations. Than we keep looking
- * for one more character.
- */
-
- if (wantonemorechar == -1) {
- wantonemorechar = ((flags & TK_AT_LEAST_ONE) &&
- (lastOffset == urstart)) ||
- ((flags & TK_PARTIAL_OK) &&
- (lastX != maxLength));
- if (!wantonemorechar) {
- break;
- }
- lastX = curX;
- }
-
- /*
- * There may belong combining marks to this character.
- * Wait for a new curX to collect them all.
- */
-
- if (lastX != curX) {
- break;
- }
- }
-
- /*
- * Save this position, so we can come back to it.
- */
-
- lastX = curX;
- lastOffset = offset;
-
- /*
- * Increment offset by one character, taking combining marks
- * into account.
- */
-
- if (offset >= urend) {
- break;
- }
- nextoffset = 0;
- if (flags & TK_ISOLATE_END) {
- LayoutSetString(fontPtr, NULL, uchars, ulen);
- }
- err = ChkErr(ATSUNextCursorPosition, fontPtr->atsuLayout,
- offset, kATSUByCluster, &nextoffset);
- if (err != noErr) {
- break;
- }
- if (nextoffset <= offset) {
-#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("ATSUNextCursorPosition: Can't move further"
- " (shouldn't happen, bad data?)");
-#endif
- break;
- }
-
- offset = nextoffset;
- }
-
- /*
- * We have overshot one character, so backup one position.
- */
-
- curX = lastX;
- offset = lastOffset;
+ cs = (index < len || (flags & TK_WHOLE_WORDS)) ?
+ whitespaceCharacterSet : lineendingCharacterSet;
+ while (index > start &&
+ [cs characterIsMember:[string characterAtIndex:(index - 1)]]) {
+ index--;
}
-
- if (curX < 0) {
- if (flags & TK_ISOLATE_END) {
- LayoutSetString(fontPtr, NULL, uchars, offset);
- }
- curX = MeasureStringWidth(fontPtr, urstart, offset);
+ if (index <= start && (flags & TK_AT_LEAST_ONE)) {
+ index = start + 1;
+ }
+ if (index > 0) {
+ range.length = index;
+ line = CTTypesetterCreateLine(typesetter, range);
+ width = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
+ CFRelease(line);
+ } else {
+ width = 0;
+ }
+ if (width < maxWidth && (flags & TK_PARTIAL_OK) && index < len) {
+ range.length = ++index;
+ line = CTTypesetterCreateLine(typesetter, range);
+ width = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
+ CFRelease(line);
}
-
- curByte = Tcl_UtfAtIndex(source, offset) - source;
- curByte -= rangeStart;
}
-
- Tcl_DStringFree(&ucharBuffer);
-
+ CFRelease(typesetter);
+ [attributedString release];
+ [string release];
+ length = ceil(width - offset);
+ fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart;
+done:
#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("measure: '%.*s', maxLength=%d, flags=%s%s%s%s "
- "-> width=%d, bytes=%d",
- rangeLength, source+rangeStart, maxLength,
+ TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d "
+ "flags='%s%s%s%s' -> width=%d bytesFit=%d\n", source, rangeLength,
+ source+rangeStart, maxLength,
flags & TK_PARTIAL_OK ? "partialOk " : "",
flags & TK_WHOLE_WORDS ? "wholeWords " : "",
flags & TK_AT_LEAST_ONE ? "atLeastOne " : "",
flags & TK_ISOLATE_END ? "isolateEnd " : "",
- curX, curByte);
+ length, fit);
#endif
-
- *lengthPtr = curX;
- return curByte;
+ *lengthPtr = length;
+ return fit;
}
/*
@@ -1133,8 +936,31 @@ Tk_DrawChars(
int x, int y) /* Coordinates at which to place origin of the
* string when drawing. */
{
- TkpDrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
- 0, numBytes, x, y);
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ 0, numBytes, x, y, 0.0);
+}
+
+void
+TkDrawAngledChars(
+ 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. */
+ double x, double y, /* Coordinates at which to place origin of
+ * string when drawing. */
+ double angle) /* What angle to put text at, in degrees. */
+{
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ 0, numBytes, x, y, angle);
}
/*
@@ -1178,1219 +1004,148 @@ TkpDrawCharsInContext(
* whole (not just the range) string when
* drawing. */
{
- const MacFont * fontPtr = (const MacFont *) tkfont;
+ DrawCharsInContext(display, drawable, gc, tkfont, source, numBytes,
+ rangeStart, rangeLength, x, y, 0.0);
+}
+
+static void
+DrawCharsInContext(
+ 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 rangeStart, /* Index of first byte to draw. */
+ int rangeLength, /* Length of range to draw in bytes. */
+ int x, int y, /* Coordinates at which to place origin of the
+ * whole (not just the range) string when
+ * drawing. */
+ double angle)
+{
+ const MacFont *fontPtr = (const MacFont *) tkfont;
+ NSString *string;
+ NSMutableDictionary *attributes;
+ NSAttributedString *attributedString;
+ CTTypesetterRef typesetter;
+ CFIndex start, len;
+ CTLineRef line;
MacDrawable *macWin = (MacDrawable *) drawable;
- Fixed fx, fy;
- int ulen, urstart, urlen;
- const UniChar * uchars;
- int lineOffset;
TkMacOSXDrawingContext drawingContext;
-#if !TK_MAC_COALESCE_LINE
- Tcl_DString runString;
-#endif
-
- if (!TkMacOSXSetupDrawingContext(drawable, gc, tkMacOSXUseCGDrawing,
- &drawingContext)) {
+ CGContextRef context;
+ CGColorRef fg;
+ NSFont *nsFont;
+ CGAffineTransform t;
+ int h;
+
+ if (rangeStart < 0 || rangeLength <= 0 ||
+ rangeStart + rangeLength > numBytes ||
+ !TkMacOSXSetupDrawingContext(drawable, gc, 1, &drawingContext)) {
return;
}
-
-#if 0
- /*
- * TODO: implement stippled text drawing
- */
-
- if ((gc->fill_style == FillStippled
- || gc->fill_style == FillOpaqueStippled)
- && gc->stipple != None) {
- #error Stippling not implemented
+ string = [[NSString alloc] initWithBytesNoCopy:(void*)source
+ length:numBytes encoding:NSUTF8StringEncoding freeWhenDone:NO];
+ if (!string) {
+ return;
}
-#endif
-
+ context = drawingContext.context;
+ fg = TkMacOSXCreateCGColor(gc, gc->foreground);
+ attributes = [fontPtr->nsAttributes mutableCopy];
+ [attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName];
+ CFRelease(fg);
+ nsFont = [attributes objectForKey:NSFontAttributeName];
+ [nsFont setInContext:[NSGraphicsContext graphicsContextWithGraphicsPort:
+ context flipped:NO]];
+ CGContextSetTextMatrix(context, CGAffineTransformIdentity);
+ attributedString = [[NSAttributedString alloc] initWithString:string
+ attributes:attributes];
+ typesetter = CTTypesetterCreateWithAttributedString(
+ (CFAttributedStringRef)attributedString);
x += macWin->xOff;
y += macWin->yOff;
- /* Turn the y coordinate upside-down for Quarz drawing. */
- if (drawingContext.context) {
- CGContextConcatCTM(drawingContext.context, CGAffineTransformMake(1.0,
- 0.0, 0.0, -1.0, 0.0, drawingContext.portBounds.bottom -
- drawingContext.portBounds.top));
- y = drawingContext.portBounds.bottom -
- drawingContext.portBounds.top - y;
- }
- fy = IntToFixed(y);
-
-#if TK_MAC_COALESCE_LINE
- UpdateLineBuffer(
- fontPtr, &drawingContext, source, numBytes, x, y, &lineOffset);
-
- fx = IntToFixed(currentLeft);
-
- uchars = (const Tcl_UniChar*) Tcl_DStringValue(&currentLine);
- ulen = Tcl_DStringLength(&currentLine) / sizeof(uchars[0]);
-#else
- lineOffset = 0;
- fx = IntToFixed(x);
-
- Tcl_DStringInit(&runString);
- uchars = Tcl_UtfToUniCharDString(source, numBytes, &runString);
- ulen = Tcl_DStringLength(&runString) / sizeof(uchars[0]);
-
- LayoutSetString(fontPtr, &drawingContext, uchars, ulen);
-#endif
-
- urstart = Tcl_NumUtfChars(source, rangeStart);
- urlen = Tcl_NumUtfChars(source+rangeStart,rangeLength);
-
- ChkErr(ATSUDrawText, fontPtr->atsuLayout, lineOffset+urstart, urlen, fx,
- fy);
-
-#if !TK_MAC_COALESCE_LINE
- Tcl_DStringFree(&runString);
-#endif
-
- TkMacOSXRestoreDrawingContext(&drawingContext);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * MeasureStringWidth --
- *
- * Low-level measuring of strings.
- *
- * Results:
- * The width of the string in pixels.
- *
- * Side effects:
- * None.
- *
- * Assumptions:
- * fontPtr->atsuLayout is setup with the actual string data to measure.
- *
- *---------------------------------------------------------------------------
- */
-static int
-MeasureStringWidth(
- const MacFont *fontPtr, /* Contains font, ATSU layout and string data
- * to measure. */
- int start, int end) /* Start and end positions to measure in that
- * string. */
-{
- /*
- * This implementation of measuring via ATSUGetGlyphBounds() does not
- * quite conform with the specification given for [font measure]:
- *
- * The return value is the total width in pixels of text, not
- * including the extra pixels used by highly exagerrated characters
- * such as cursive "f".
- *
- * Instead the result of ATSUGetGlyphBounds() *does* include these
- * "extra pixels".
- */
-
- ATSTrapezoid bounds;
- ItemCount numBounds;
-
- if (end <= start) {
- return 0;
+ h = drawingContext.portBounds.size.height;
+ y = h - y;
+ t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, h);
+ if (angle != 0.0) {
+ t = CGAffineTransformTranslate(CGAffineTransformRotate(
+ CGAffineTransformTranslate(t, x, y), angle*PI/180.0), -x, -y);
}
-
- bounds.upperRight.x = bounds.upperLeft.x = 0;
- ChkErr(ATSUGetGlyphBounds, fontPtr->atsuLayout, 0, 0, start, end-start,
- kATSUseFractionalOrigins, 1, &bounds, &numBounds);
-#ifdef TK_MAC_DEBUG_FONTS
- if (numBounds < 1 || numBounds > 1) {
- TkMacOSXDbgMsg("ATSUGetGlyphBounds: %s output",
- numBounds < 1 ? "No " : "More");
+ CGContextConcatCTM(context, t);
+ CGContextSetTextPosition(context, x, y);
+ start = Tcl_NumUtfChars(source, rangeStart);
+ len = Tcl_NumUtfChars(source, rangeStart + rangeLength);
+ if (start > 0) {
+ CGRect clipRect = CGRectInfinite, startBounds;
+ line = CTTypesetterCreateLine(typesetter, CFRangeMake(0, start));
+ startBounds = CTLineGetImageBounds(line, context);
+ CFRelease(line);
+ clipRect.origin.x = startBounds.origin.x + startBounds.size.width;
+ CGContextClipToRect(context, clipRect);
}
-#endif
-
- return FixedToInt(bounds.upperRight.x - bounds.upperLeft.x);
-}
-
-#if TK_MAC_COALESCE_LINE
-/*
- *-------------------------------------------------------------------------
- *
- * UpdateLineBuffer --
- *
- * See the general dicussion of TK_MAC_COALESCE_LINE on the header
- * pages. This function maintains the data for this feature.
- *
- * Results:
- *
- * The Tcl_UniChar string of the whole line as seen so far.
- *
- * Side effects:
- * "*offset" is filled with the index of the first new character in
- * "currentLine". The globals currentLine, currentY, currentLeft,
- * currentRight and currentFontPtr are updated as necessary.
- *
- * The currentLine string is set as the current text in
- * fontPtr->atsuLayout (see LayoutSetString()).
- *
- *-------------------------------------------------------------------------
- */
-
-static const Tcl_UniChar *
-UpdateLineBuffer(
- const MacFont *fontPtr, /* The font to be used for the new piece of
- * text. */
- const TkMacOSXDrawingContext *drawingContextPtr,
- /* The Quarz drawing parameters. Needed for
- * measuring the new piece. */
- const char *source, /* A new piece of line to be added. */
- int numBytes, /* Length of the new piece. */
- int x, int y, /* Position of the new piece in the window. */
- int *offset) /* Filled with the offset of the new piece in
- * currentLine. */
-{
- const Tcl_UniChar * uchars;
- int ulen;
-
- if (y != currentY
- || x < currentRight-1 || x > currentRight+2
- || currentFontPtr != fontPtr) {
- Tcl_DStringFree(&currentLine);
- Tcl_DStringInit(&currentLine);
- currentY = y;
- currentLeft = x;
- currentFontPtr = fontPtr;
- *offset = 0;
- } else {
- *offset = Tcl_DStringLength(&currentLine) / 2;
- }
-
- Tcl_UtfToUniCharDString(source, numBytes, &currentLine);
- uchars = (const Tcl_UniChar*) Tcl_DStringValue(&currentLine);
- ulen = Tcl_DStringLength(&currentLine) / sizeof(*uchars);
- LayoutSetString(fontPtr, drawingContextPtr, uchars, ulen);
- currentRight = x + MeasureStringWidth(fontPtr, *offset, ulen);
-
- return uchars;
-}
-#endif /* TK_MAC_COALESCE_LINE */
-
-/*
- *---------------------------------------------------------------------------
- *
- * FamilyNameForFamilyID --
- *
- * Helper for InitFont() and TkMacOSXFontDescriptionForFMFontInfo().
- * Retrieves font family names for a given font family ID.
- *
- * Results:
- * Font family name or NULL.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-static const char *
-FamilyNameForFamilyID(
- FMFontFamily familyId)
-{
- OSStatus err;
- char name[256] = "";
- const MacFontFamily * familyPtr = NULL;
-
- err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name));
- if (err == noErr) {
- /*
- * We find the canonical font name, so we can avoid unnecessary
- * memory management.
- */
-
- familyPtr = FindFontFamily(name);
-#ifdef TK_MAC_DEBUG_FONTS
- if (!familyPtr) {
- TkMacOSXDbgMsg("Font family '%s' not found", name);
- }
-#endif
- }
- return familyPtr ? familyPtr->name : NULL;
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * 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(
- FMFontFamily familyId, /* The font family to initialize for. */
- const char * familyName, /* The font family name, if known. Otherwise
- * this can be NULL. */
- int size, /* Point size for the font. */
- int qdStyle, /* QuickDraw style bits. */
- MacFont * fontPtr) /* Filled with information constructed from the
- * above arguments. */
-{
- FontInfo fi;
- TkFontAttributes * faPtr;
- TkFontMetrics * fmPtr;
- int periodWidth, wWidth;
-
- if (size == 0) {
- size = GetDefFontSize();
- }
- ChkErr(FetchFontInfo, familyId, size, qdStyle, &fi);
- if (!familyName) {
- familyName = FamilyNameForFamilyID(familyId);
- }
-
- fontPtr->font.fid = (Font) fontPtr;
-
- faPtr = &fontPtr->font.fa;
- faPtr->family = familyName;
- faPtr->size = size;
- faPtr->weight = (qdStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
- faPtr->slant = (qdStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
- faPtr->underline = ((qdStyle & underline) != 0);
- faPtr->overstrike = 0;
-
- fmPtr = &fontPtr->font.fm;
-
- /*
- * Note: Macs measure the line height as ascent + descent +
- * leading. Leading as a separate entity does not exist in X11
- * and Tk. We add it to the ascent at the moment, because adding
- * it to the descent, as the Mac docs would indicate, would change
- * the position of self-drawn underlines.
- */
-
- fmPtr->ascent = fi.ascent + fi.leading;
- fmPtr->descent = fi.descent;
- fmPtr->maxWidth = fi.widMax;
-
- fontPtr->qdFont = familyId;
- fontPtr->qdSize = size;
- fontPtr->qdStyle = (short) qdStyle;
-
- InitATSUObjects(familyId, size, qdStyle, &fontPtr->atsuFontId,
- &fontPtr->atsuLayout, &fontPtr->atsuStyle);
-
- Tk_MeasureChars((Tk_Font)fontPtr, ".", 1, -1, 0, &periodWidth);
- Tk_MeasureChars((Tk_Font)fontPtr, "W", 1, -1, 0, &wWidth);
- fmPtr->fixed = periodWidth == wWidth;
-
- SetFontFeatures(fontPtr->atsuFontId, fmPtr->fixed, size,
- fontPtr->atsuStyle);
-
- AdjustFontHeight(fontPtr);
+ line = CTTypesetterCreateLine(typesetter, CFRangeMake(0, len));
+ CTLineDraw(line, context);
+ CFRelease(line);
+ CFRelease(typesetter);
+ [attributedString release];
+ [string release];
+ [attributes release];
+ TkMacOSXRestoreDrawingContext(&drawingContext);
}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitATSUObjects --
- *
- * Helper for InitFont(). Initializes the ATSU data handles for a
- * MacFont.
- *
- * Results:
- * Sets up all we know and can do at this point in time in fontIdPtr,
- * layoutPtr and stylePtr.
- *
- * Side effects:
- * Allocates data structures inside of ATSU.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-InitATSUObjects(
- FMFontFamily familyId, /* The font family to use. */
- short ptSize, short qdStyles,
- /* The additional font parameters. */
- ATSUFontID *fontIdPtr, /* Filled with the font id. */
- ATSUTextLayout *layoutPtr, /* Filled with the ATSU layout handle. */
- ATSUStyle *stylePtr) /* Filled with the ATSU style handle,
- * configured with all parameters. */
-{
- FMFontStyle stylesDone, stylesLeft;
-
- /*
- * Defaults in case of error.
- */
-
- *fontIdPtr = GetAppFont();
- *stylePtr = 0;
- *layoutPtr = 0;
-
- /*
- * Generate a font id from family id and QD style bits.
- */
-
- ChkErr(FMGetFontFromFontFamilyInstance, familyId, qdStyles, fontIdPtr,
- &stylesDone);
-
- /*
- * We see what style bits are left and tell ATSU to synthesize what's
- * left like QD does it.
- */
-
- stylesLeft = qdStyles & ~(unsigned)stylesDone;
-
- /*
- * Create the style and set its attributes.
- */
-
- ChkErr(ATSUCreateStyle, stylePtr);
- InitATSUStyle(*fontIdPtr, ptSize, stylesLeft, *stylePtr);
-
- /*
- * Create the layout. Note: We can't set the layout attributes here,
- * because the text and the style must be set first.
- */
- ChkErr(ATSUCreateTextLayout, layoutPtr);
- /*InitATSULayout(*layoutPtr);*/
-}
+#pragma mark -
+#pragma mark Accessors:
/*
*---------------------------------------------------------------------------
*
- * InitATSUStyle --
+ * TkMacOSXNSFontForFont --
*
- * Helper for InitATSUObjects(). Initializes the ATSU style for a
- * MacFont.
+ * Return an NSFont for the given Tk_Font.
*
* Results:
- * Sets up all parameters needed for an ATSU style.
+ * NSFont*.
*
* Side effects:
- * Allocates data structures for the style inside of ATSU.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-InitATSUStyle(
- ATSUFontID fontId, /* The font id to use. */
- short ptSize, short qdStyles,
- /* Additional font parameters. */
- ATSUStyle style) /* The style handle to configure. */
-{
- /*
- * Attributes for the style.
- */
-
- Fixed fsize = IntToFixed(ptSize);
- Boolean
- isBold = (qdStyles&bold) != 0,
- isUnderline = (qdStyles&underline) != 0,
- isItalic = (qdStyles&italic) != 0;
-
- ATSStyleRenderingOptions options =
- antialiasedTextEnabled == -1 ? kATSStyleNoOptions :
- antialiasedTextEnabled == 0 ? kATSStyleNoAntiAliasing :
- kATSStyleApplyAntiAliasing;
-
- static const ATSUAttributeTag styleTags[] = {
- kATSUFontTag, kATSUSizeTag,
- kATSUQDBoldfaceTag, kATSUQDItalicTag, kATSUQDUnderlineTag,
- kATSUStyleRenderingOptionsTag,
- };
- static const ByteCount styleSizes[] = {
- sizeof(ATSUFontID), sizeof(Fixed),
- sizeof(Boolean), sizeof(Boolean), sizeof(Boolean),
- sizeof(ATSStyleRenderingOptions),
- };
- const ATSUAttributeValuePtr styleValues[] = {
- &fontId, &fsize,
- &isBold, &isItalic, &isUnderline,
- &options,
- };
-
- ChkErr(ATSUSetAttributes, style, sizeof(styleTags)/sizeof(styleTags[0]),
- styleTags, styleSizes, styleValues);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * SetFontFeatures --
- *
- * Helper for InitFont(). Request specific font features of the ATSU
- * style object for a MacFont.
- *
- * Results:
* None.
*
- * Side effects:
- * Specific font features are enabled on the ATSU style object.
- *
*---------------------------------------------------------------------------
*/
-static void
-SetFontFeatures(
- ATSUFontID fontId, /* The font id to use. */
- int fixed, /* Is this a fixed font? */
- short size, /* Size of the font */
- ATSUStyle style) /* The style handle to configure. */
+MODULE_SCOPE NSFont*
+TkMacOSXNSFontForFont(
+ Tk_Font tkfont)
{
- /*
- * Don't use the standard latin ligatures, if this is determined to be a
- * fixed-width font.
- */
-
- static const ATSUFontFeatureType fixed_featureTypes[] = {
- kLigaturesType, kLigaturesType
- };
- static const ATSUFontFeatureSelector fixed_featureSelectors[] = {
- kCommonLigaturesOffSelector, kRareLigaturesOffSelector
- };
-
- if (fixed) {
- ChkErr(ATSUSetFontFeatures, style, sizeof(fixed_featureTypes) /
- sizeof(fixed_featureTypes[0]), fixed_featureTypes,
- fixed_featureSelectors);
- if (size <= 10) {
- /*
- * Disable antialiasing of fixed-width fonts with sizes <= 10
- */
-
- const ATSStyleRenderingOptions options = kATSStyleNoAntiAliasing;
- const ATSUAttributeTag styleTag = kATSUStyleRenderingOptionsTag;
- const ByteCount styleSize = sizeof(ATSStyleRenderingOptions);
- const ConstATSUAttributeValuePtr styleValue = &options;
-
- ChkErr(ATSUSetAttributes, style, 1, &styleTag, &styleSize,
- (ATSUAttributeValuePtr*) &styleValue);
- }
- }
+ return tkfont ? ((MacFont *)tkfont)->nsFont : nil;
}
/*
*---------------------------------------------------------------------------
*
- * AdjustFontHeight --
+ * TkMacOSXNSFontAttributesForFont --
*
- * Helper for InitFont(). Check font height against some real world
- * examples.
+ * Return an NSDictionary of font attributes for the given Tk_Font.
*
* Results:
- * None.
+ * NSFont*.
*
* Side effects:
- * The metrics in fontPtr->font.fm are adjusted so that typical combined
- * characters fit into ascent+descent.
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-AdjustFontHeight(
- MacFont * fontPtr)
-{
- /*
- * The standard values for ascent, descent and leading as determined in
- * InitFont do not take composition into account, they are designed for
- * plain ASCII characters. This code measures the actual size of some
- * typical composed characters from the Latin-1 range and corrects these
- * factors, especially the ascent.
- *
- * A font requested with a pixel size may thus have a larger line height
- * than requested.
- *
- * An alternative would be to instruct ATSU to shrink oversized combined
- * characters. I think I have seen that feature somewhere, but I can't
- * find it now [BR].
- */
-
- static const UniChar chars[]
- /* Auml, Aacute, Acirc, Atilde, Ccedilla */
- = {0x00C4, 0x00C1, 0x00C2, 0x00C3, 0x00C7};
- static const int charslen = sizeof(chars) / sizeof(chars[0]);
- Rect size;
- OSStatus err;
-
- LayoutSetString(fontPtr, NULL, chars, charslen);
-
- size.top = size.bottom = 0;
- err = ChkErr(ATSUMeasureTextImage, fontPtr->atsuLayout, 0, charslen, 0, 0,
- &size);
-
- if (err == noErr) {
- TkFontMetrics * fmPtr = &fontPtr->font.fm;
- int ascent = -size.top;
- int descent = size.bottom;
-
- if (ascent > fmPtr->ascent) {
- fmPtr->ascent = ascent;
- }
- if (descent > fmPtr->descent) {
- fmPtr->descent = descent;
- }
- }
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * InitATSULayout --
- *
- * Helper for LayoutSetString(). Initializes the ATSU layout
- * object for a MacFont and a specific string.
- *
- * Results:
- * Sets up all parameters needed for an ATSU layout object.
- *
- * Side effects:
- * Allocates data structures for the layout object inside of ATSU.
- *
- * Assumptions:
- * The actual string data and style information is already set by
- * ATSUSetTextPointerLocation() and ATSUSetRunStyle() (see
- * LayoutSetString()).
- *
- *---------------------------------------------------------------------------
- */
-
-static void
-InitATSULayout(
- const TkMacOSXDrawingContext *drawingContextPtr,
- /* Specifies the CGContext to use. */
- ATSUTextLayout layout, /* The layout object to configure. */
- int fixed) /* Is this a fixed font? */
-{
- /*
- * Attributes for the layout.
- */
-
- ATSLineLayoutOptions layoutOptions = 0
-#if TK_MAC_COALESCE_LINE
- /*
- * Options to use unconditionally when we try to do coalescing.
- */
- | kATSLineDisableAllLayoutOperations
- | kATSLineFractDisable
- | kATSLineUseDeviceMetrics
-#endif
- ;
- CGContextRef context = drawingContextPtr ?
- drawingContextPtr->context : NULL;
-
- static const ATSUAttributeTag layoutTags[] = {
- kATSUCGContextTag,
- kATSULineLayoutOptionsTag,
- };
- static const ByteCount layoutSizes[] = {
- sizeof(CGContextRef),
- sizeof(ATSLineLayoutOptions),
- };
- const ATSUAttributeValuePtr layoutValues[] = {
- &context,
- &layoutOptions,
- };
-
- /*
- * Ensure W(abcdefg) == W(a)*7 for fixed fonts (Latin scripts only).
- */
-
- if (fixed) {
- layoutOptions |= kATSLineFractDisable | kATSLineUseDeviceMetrics;
- }
-
- ChkErr(ATSUSetLayoutControls, layout, sizeof(layoutTags) /
- sizeof(layoutTags[0]), layoutTags, layoutSizes, layoutValues);
- ChkErr(ATSUSetTransientFontMatching, layout, true);
-}
-
-/*
- *---------------------------------------------------------------------------
- *
- * LayoutSetString --
- *
- * Setup the MacFont for a specific string.
- *
- * Results:
- * Sets up all parameters so that ATSU can work with the objects in
- * MacFont.
- *
- * Side effects:
- * Sets parameters on the layout object fontPtr->atsuLayout.
- *
- *---------------------------------------------------------------------------
- */
-
-void
-LayoutSetString(
- const MacFont *fontPtr, /* The fontPtr to configure. */
- const TkMacOSXDrawingContext *drawingContextPtr,
- /* For the CGContext to be used.*/
- const UniChar *uchars, int ulen)
- /* The UniChar string to set into
- * fontPtr->atsuLayout. */
-{
- ChkErr(ATSUSetTextPointerLocation, fontPtr->atsuLayout, uchars,
- kATSUFromTextBeginning, ulen, ulen);
-
- /*
- * Styles can only be set after the text is set.
- */
-
- ChkErr(ATSUSetRunStyle, fontPtr->atsuLayout, fontPtr->atsuStyle,
- kATSUFromTextBeginning, kATSUToTextEnd);
-
- /*
- * Layout attributes can only be set after the styles are set.
- */
-
- InitATSULayout(drawingContextPtr, fontPtr->atsuLayout,
- fontPtr->font.fm.fixed);
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * 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. */
+MODULE_SCOPE NSDictionary*
+TkMacOSXNSFontAttributesForFont(
+ Tk_Font tkfont)
{
- ATSUDisposeTextLayout(fontPtr->atsuLayout);
- ATSUDisposeStyle(fontPtr->atsuStyle);
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * FindFontFamilyOrAlias, FindFontFamilyOrAliasOrFallback --
- *
- * Determine 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.
- *
- * FindFontFamilyOrAlias also considers font aliases as determined by
- * TkFontGetAliasList().
- *
- * FindFontFamilyOrAliasOrFallback also considers font aliases as
- * determined by TkFontGetFallbacks().
- *
- * The overall algorithm to get the closest font to the one requested is
- * this:
- *
- * try fontname
- * try all aliases for fontname
- * foreach fallback for fontname
- * try the fallback
- * try all aliases for the fallback
- *
- * Results:
- *
- * The return value is NULL if the specified font family does not exist,
- * a valid MacFontFamily* otherwise.
- *
- * Side effects:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static const MacFontFamily *
-FindFontFamilyOrAlias(
- const char *name) /* Name or alias name of the font to find. */
-{
- const MacFontFamily * familyPtr;
- char ** aliases;
- int i;
-
- familyPtr = FindFontFamily(name);
- if (familyPtr != NULL) {
- return familyPtr;
- }
-
- aliases = TkFontGetAliasList(name);
- if (aliases != NULL) {
- for (i = 0; aliases[i] != NULL; i++) {
- familyPtr = FindFontFamily(aliases[i]);
- if (familyPtr != NULL) {
- return familyPtr;
- }
- }
- }
- return NULL;
-}
-
-static const MacFontFamily *
-FindFontFamilyOrAliasOrFallback(
- const char *name) /* Name or alias name of the font to find. */
-{
- const MacFontFamily * familyPtr;
- const char * fallback;
- char *** fallbacks;
- int i, j;
-
- familyPtr = FindFontFamilyOrAlias(name);
- if (familyPtr != NULL) {
- return familyPtr;
- }
- fallbacks = TkFontGetFallbacks();
- for (i = 0; fallbacks[i] != NULL; i++) {
- for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
- if (strcasecmp(name, fallback) == 0) {
- for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
- familyPtr = FindFontFamilyOrAlias(fallback);
- if (familyPtr != NULL) {
- return familyPtr;
- }
- }
- }
- break; /* benny: This "break" is a carry-over from
- * tkMacOSXFont.c, but what is actually its purpose
- * ???? */
- }
- }
-
-
- /*
- * FIXME: We would have liked to recover by re-enumerating fonts. But
- * that doesn't work, because Carbon seems to cache the inital list of
- * fonts. Fonts newly installed don't show up with
- * FMCreateFontFamilyIterator()/FMGetNextFontFamily() without a restart
- * of the app. Similar problem with fonts removed.
- */
-
-#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("Font family '%s' not found", name);
-#endif
-
- return NULL;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * InitFontFamilies --
- *
- * Helper to TkpFontPkgInit. Use the Font Manager to fill in the
- * familyList global array.
- *
- * Results:
- *
- * None.
- *
- * Side effects:
- *
- * Allocates memory.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-InitFontFamilies(void)
-{
- FMFontFamily fontFamily;
- Str255 fontName;
- SInt16 fontSize;
- Style fontStyle;
-
- /*
- * Has this been called before?
- */
-
- if (familyListNextFree > 0) {
- return;
- }
-
- ChkErr(ATSFontFamilyApplyFunction, FontFamilyEnumCallback,NULL);
-
- if (GetThemeFontAndFamily(kThemeSystemFont, &fontFamily, fontName,
- &fontSize, &fontStyle) == noErr) {
- AddFontFamily(SYSTEMFONT_NAME, fontFamily);
- }
- if (GetThemeFontAndFamily(kThemeApplicationFont, &fontFamily, fontName,
- &fontSize, &fontStyle) == noErr) {
- AddFontFamily(APPLFONT_NAME, fontFamily);
- }
- if (GetThemeFontAndFamily(kThemeMenuItemFont, &fontFamily, fontName,
- &fontSize, &fontStyle) == noErr) {
- AddFontFamily(MENUITEMFONT_NAME, fontFamily);
- }
-
- SortFontFamilies();
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * FontFamilyEnumCallback --
- *
- * Callback for ATSFontFamilyApplyFunction().
- *
- * Results:
- *
- * noErr.
- *
- * Side effects:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static OSStatus
-FontFamilyEnumCallback(
- ATSFontFamilyRef family,
- void *refCon)
-{
- OSStatus err;
- char name[260] = "";
-
- (void) refCon;
-
- err = ChkErr(GetFontFamilyName, family, name, sizeof(name));
- if (err == noErr) {
- AddFontFamily(name, family);
- }
-
- return noErr;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * GetFontFamilyName --
- *
- * Use the Font Manager to get the name of a given FMFontfamily. This
- * currently gets the standard, non-localized QuickDraw name. Other
- * names would be possible, see docs for ATSUFindFontName for a
- * selection. The MacOSX font selector seems to use the localized
- * family name given by ATSUFindFontName(kFontFamilyName), but that API
- * doesn't give us a name at all for some fonts.
- *
- * Results:
- * An OS error code, noErr on success. name is filled with the
- * resulting name.
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static OSStatus
-GetFontFamilyName(
- FMFontFamily fontFamily, /* The font family for which to find the
- * name. */
- char * name, int numBytes) /* Filled with the result. */
-{
- OSStatus err;
- Str255 nativeName;
- CFStringRef cfString;
- TextEncoding encoding;
- ScriptCode nameencoding;
-
- nativeName[0] = 0;
- name[0] = 0;
- err = ChkErr(FMGetFontFamilyName, fontFamily, nativeName);
- if (err != noErr) {
- return err;
- }
-
- /*
- * QuickDraw font names are encoded with the script that the font uses.
- * So we determine that encoding and than we reencode the name. We
- * pre-set the encoding with the default value, so we do not need to
- * check result codes here.
- */
-
- encoding = kTextEncodingMacRoman;
- ChkErr(FMGetFontFamilyTextEncoding, fontFamily, &encoding);
- nameencoding = encoding;
- ChkErr(RevertTextEncodingToScriptInfo, encoding, &nameencoding, NULL,
- NULL);
-
- /*
- * Note: We could use Tcl facilities to do the re-encoding here. We'd
- * have to maintain tables to map OS encoding codes to Tcl encoding names
- * like tkMacOSXFont.c did. Using native re-encoding directly instead is
- * a lot easier and future-proof than that. There is one snag, though: I
- * have seen CFStringGetCString() crash with invalid encoding ids. But
- * than if that happens it would be a bug in
- * FMGetFontFamilyTextEncoding() or RevertTextEncodingToScriptInfo().
- * Another problem is that users have seen CFStringCreate return null
- * (Bug #2548661). This is due to font names with a bad encoding.
- */
-
- cfString = CFStringCreateWithPascalStringNoCopy(
- NULL, nativeName, nameencoding, kCFAllocatorNull);
- if (cfString == NULL) {
- TkMacOSXDbgMsg("CFStringCreate: "
- "'%.*s' could not be decoded with encoding %d",
- nativeName[0], nativeName+1, (int) nameencoding);
- return kTextMalformedInputErr;
- }
-
- CFStringGetCString(cfString, name, numBytes, kCFStringEncodingUTF8);
- CFRelease(cfString);
-
- return noErr;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * FindFontFamily --
- *
- * Find the font family with the given name in the global familyList.
- * Uses bsearch() for convenient access. Comparision is done
- * non-case-sensitively with CompareFontFamilies() which see.
- *
- * Results:
- *
- * MacFontFamily: A pair of family id and the actual name registered for
- * the font.
- *
- * Side effects:
- *
- * None.
- *
- * Assumption:
- *
- * Requires the familyList array to be sorted.
- *
- *-------------------------------------------------------------------------
- */
-
-static const MacFontFamily *
-FindFontFamily(
- const char *name) /* The family name. Note: Names are compared
- * non-case-sensitive. */
-{
- const MacFontFamily key = {name,-1};
-
- if(familyListMaxValid <= 0) {
- return NULL;
- }
-
- return bsearch(&key, familyList, familyListMaxValid, sizeof(*familyList),
- CompareFontFamilies);
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * EnumFontFamilies --
- *
- * Create a Tcl list with the registered names in the global familyList.
- *
- * Results:
- * A Tcl list of names.
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static Tcl_Obj *
-EnumFontFamilies(void)
-{
- int i;
- Tcl_Obj * tclList;
-
- tclList = Tcl_NewListObj(0, NULL);
- for (i=0; i<familyListMaxValid; ++i) {
- Tcl_ListObjAppendElement(NULL, tclList,
- Tcl_NewStringObj(familyList[i].name, -1));
- }
-
- return tclList;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * AddFontFamily --
- *
- * Register a font family in familyList. Until SortFontFamilies() is
- * called, this is not actually available for FindFontFamily().
- *
- * Results:
- *
- * MacFontFamily: The new pair of family id and the actual name
- * registered for the font.
- *
- * Side effects:
- *
- * New entry in familyList and familyListNextFree updated.
- *
- *-------------------------------------------------------------------------
- */
-
-static const MacFontFamily *
-AddFontFamily(
- const char *name, /* Font family name to register. */
- FMFontFamily familyId) /* Font family id to register. */
-{
- MacFontFamily * familyPtr;
-
- if (familyListNextFree >= familyListSize) {
- familyListSize += 100;
- familyList = (MacFontFamily *) ckrealloc((void*) familyList,
- familyListSize * sizeof(*familyList));
- }
-
- familyPtr = familyList + familyListNextFree;
- ++familyListNextFree;
-
- familyPtr->name = AddString(name);
- familyPtr->familyId = familyId;
-
- return familyPtr;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * SortFontFamilies --
- *
- * Sort the entries in familyList. Only after calling
- * SortFontFamilies(), the new families registered with AddFontFamily()
- * are actually available for FindFontFamily(), because FindFontFamily()
- * requires the array to be sorted.
- *
- * Results:
- *
- * None.
- *
- * Side effects:
- *
- * familyList is sorted and familyListMaxValid is updated.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-SortFontFamilies(void)
-{
- if (familyListNextFree > 0) {
- qsort(familyList, familyListNextFree, sizeof(*familyList),
- CompareFontFamilies);
- }
- familyListMaxValid = familyListNextFree;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * CompareFontFamilies --
- *
- * Comparison function used by SortFontFamilies() and FindFontFamily().
- *
- * Results:
- * Result as required to generate a stable sort order for bsearch() and
- * qsort(). The ordering is not case-sensitive as far as
- * Tcl_UtfNcasecmp() (which see) can provide that.
- *
- * Note: It would be faster to compare first the length and the actual
- * strings only as a tie-breaker, but than the ordering wouldn't look so
- * pretty in [font families] ;-).
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static int
-CompareFontFamilies(
- const void * vp1,
- const void * vp2)
-{
- const char * name1;
- const char * name2;
- int len1, len2, diff;
-
- name1 = ((const MacFontFamily *) vp1)->name;
- name2 = ((const MacFontFamily *) vp2)->name;
-
- len1 = Tcl_NumUtfChars(name1, -1);
- len2 = Tcl_NumUtfChars(name2, -1);
-
- diff = Tcl_UtfNcasecmp(name1, name2, len1<len2 ? len1 : len2);
-
- return diff == 0 ? len1-len2 : diff;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * AddString --
- *
- * Helper for AddFontFamily(). Allocates a string in the one-shot
- * allocator.
- *
- * Results:
- * A duplicated string in the one-shot allocator.
- *
- * Side effects:
- * May allocate a new memory block.
- *
- *-------------------------------------------------------------------------
- */
-
-static const char *
-AddString(
- const char *in) /* String to add, zero-terminated. */
-{
- int len;
- char *result;
-
- len = strlen(in) +1;
-
- if (stringMemory == NULL
- || (stringMemory->nextFree+len) > STRING_BLOCK_MAX) {
- StringBlock * newblock = (StringBlock *) ckalloc(sizeof(StringBlock));
-
- newblock->next = stringMemory;
- newblock->nextFree = 0;
- stringMemory = newblock;
- }
-
- result = stringMemory->strings + stringMemory->nextFree;
- stringMemory->nextFree += len;
-
- memcpy(result, in, len);
-
- return result;
+ return tkfont ? ((MacFont *)tkfont)->nsAttributes : nil;
}
/*
@@ -2415,29 +1170,18 @@ TkMacOSXIsCharacterMissing(
Tk_Font tkfont, /* The font we are looking in. */
unsigned int searchChar) /* The character we are looking for. */
{
- /* Background: This function is private and only used in
- * tkMacOSXMenu.c:FindMarkCharacter().
- *
- * We could use ATSUMatchFont() to implement. We'd have to change the
- * definition of the encoding of the parameter searchChar from MacRoman
- * to UniChar for that.
- *
- * The system uses font fallback for controls, so we don't really need
- * this. */
-
return 0;
}
/*
*----------------------------------------------------------------------
*
- * TkMacOSXInitControlFontStyle --
+ * TkMacOSXFontDescriptionForNSFontAndNSFontAttributes --
*
- * This procedure sets up the appropriate ControlFontStyleRec
- * for a Mac control.
+ * Get text description of a font specified by NSFont and attributes.
*
* Results:
- * None.
+ * List object or NULL.
*
* Side effects:
* None.
@@ -2445,19 +1189,40 @@ TkMacOSXIsCharacterMissing(
*----------------------------------------------------------------------
*/
-void
-TkMacOSXInitControlFontStyle(
- Tk_Font tkfont, /* Tk font object to use for the control. */
- ControlFontStylePtr fsPtr) /* The style object to configure. */
+MODULE_SCOPE Tcl_Obj *
+TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
+ NSFont *nsFont,
+ NSDictionary *nsAttributes)
{
- const MacFont * fontPtr = (MacFont *) tkfont;
-
- fsPtr->flags = kControlUseFontMask | kControlUseSizeMask |
- kControlUseFaceMask | kControlUseJustMask;
- fsPtr->font = fontPtr->qdFont;
- fsPtr->size = fontPtr->qdSize;
- fsPtr->style = fontPtr->qdStyle;
- fsPtr->just = teCenter;
+ Tcl_Obj *objv[6];
+ int i = 0;
+ const char *familyName = [[nsFont familyName] UTF8String];
+
+ if (nsFont && familyName) {
+ NSFontTraitMask traits = [[NSFontManager sharedFontManager]
+ traitsOfFont:nsFont];
+ id underline = [nsAttributes objectForKey:
+ NSUnderlineStyleAttributeName];
+ id strikethrough = [nsAttributes objectForKey:
+ NSStrikethroughStyleAttributeName];
+ objv[i++] = Tcl_NewStringObj(familyName, -1);
+ objv[i++] = Tcl_NewIntObj([nsFont pointSize]);
+#define S(s) Tcl_NewStringObj(STRINGIFY(s),(int)(sizeof(STRINGIFY(s))-1))
+ objv[i++] = (traits & NSBoldFontMask) ? S(bold) : S(normal);
+ objv[i++] = (traits & NSItalicFontMask) ? S(italic) : S(roman);
+ if ([underline respondsToSelector:@selector(intValue)] &&
+ ([underline intValue] & (NSUnderlineStyleSingle |
+ NSUnderlineStyleThick | NSUnderlineStyleDouble))) {
+ objv[i++] = S(underline);
+ }
+ if ([strikethrough respondsToSelector:@selector(intValue)] &&
+ ([strikethrough intValue] & (NSUnderlineStyleSingle |
+ NSUnderlineStyleThick | NSUnderlineStyleDouble))) {
+ objv[i++] = S(overstrike);
+ }
+#undef S
+ }
+ return i ? Tcl_NewListObj(i, objv) : NULL;
}
/*
@@ -2511,7 +1276,7 @@ TkMacOSXUseAntialiasedText(
/*
* Local Variables:
- * mode: c
+ * mode: objc
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8
diff --git a/macosx/tkMacOSXFont.h b/macosx/tkMacOSXFont.h
index 6ce310d..08380c4 100644
--- a/macosx/tkMacOSXFont.h
+++ b/macosx/tkMacOSXFont.h
@@ -6,8 +6,8 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -26,7 +26,7 @@
* Function prototypes
*/
-MODULE_SCOPE void TkMacOSXInitControlFontStyle(Tk_Font tkfont,
- ControlFontStylePtr fsPtr);
+MODULE_SCOPE Tcl_Obj * TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
+ NSFont *nsFont, NSDictionary *nsAttributes);
#endif /*TKMACOSXFONT_H*/
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index 14ce7d9..362f752 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -5,11 +5,11 @@
* only event that really does anything is the Quit event.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
+ * Copyright 2001-2009, Apple Inc.
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
@@ -31,22 +31,38 @@ typedef struct KillEvent {
*/
static OSErr QuitHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr OappHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr RappHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr OdocHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr PrintHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr ScriptHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static OSErr PrefsHandler(const AppleEvent *event,
- AppleEvent *reply, long handlerRefcon);
+ AppleEvent *reply, SRefCon handlerRefcon);
static int MissedAnyParameters(const AppleEvent *theEvent);
static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds);
+
+#pragma mark TKApplication(TKHLEvents)
+
+@implementation TKApplication(TKHLEvents)
+- (void) terminate: (id) sender
+{
+ QuitHandler(NULL, NULL, (SRefCon) _eventInterp);
+}
+
+- (void) preferences: (id) sender
+{
+ PrefsHandler(NULL, NULL, (SRefCon) _eventInterp);
+}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -83,32 +99,32 @@ TkMacOSXInitAppleEvents(
QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEQuitApplication,
- QuitHandlerUPP, (long) interp, false);
+ QuitHandlerUPP, (SRefCon) interp, false);
OappHandlerUPP = NewAEEventHandlerUPP(OappHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenApplication,
- OappHandlerUPP, (long) interp, false);
+ OappHandlerUPP, (SRefCon) interp, false);
RappHandlerUPP = NewAEEventHandlerUPP(RappHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEReopenApplication,
- RappHandlerUPP, (long) interp, false);
+ RappHandlerUPP, (SRefCon) interp, false);
OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenDocuments,
- OdocHandlerUPP, (long) interp, false);
+ OdocHandlerUPP, (SRefCon) interp, false);
PrintHandlerUPP = NewAEEventHandlerUPP(PrintHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEPrintDocuments,
- PrintHandlerUPP, (long) interp, false);
+ PrintHandlerUPP, (SRefCon) interp, false);
PrefsHandlerUPP = NewAEEventHandlerUPP(PrefsHandler);
ChkErr(AEInstallEventHandler, kCoreEventClass, kAEShowPreferences,
- PrefsHandlerUPP, (long) interp, false);
+ PrefsHandlerUPP, (SRefCon) interp, false);
if (interp) {
ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler);
ChkErr(AEInstallEventHandler, kAEMiscStandards, kAEDoScript,
- ScriptHandlerUPP, (long) interp, false);
+ ScriptHandlerUPP, (SRefCon) interp, false);
}
}
}
@@ -131,9 +147,9 @@ TkMacOSXInitAppleEvents(
int
TkMacOSXDoHLEvent(
- EventRecord *theEvent)
+ void *theEvent)
{
- return AEProcessAppleEvent(theEvent);
+ return AEProcessAppleEvent((EventRecord *)theEvent);
}
/*
@@ -156,7 +172,7 @@ static OSErr
QuitHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
KillEvent *eventPtr;
@@ -170,7 +186,7 @@ QuitHandler(
* quickly as possible.
*/
- eventPtr = (KillEvent *) ckalloc(sizeof(KillEvent));
+ eventPtr = ckalloc(sizeof(KillEvent));
eventPtr->header.proc = ReallyKillMe;
eventPtr->interp = interp;
@@ -199,15 +215,16 @@ static OSErr
OappHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_CmdInfo dummy;
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
if (interp &&
Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){
- if (Tcl_GlobalEval(interp, "::tk::mac::OpenApplication") != TCL_OK) {
- Tcl_BackgroundError(interp);
+ int code = Tcl_GlobalEval(interp, "::tk::mac::OpenApplication");
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
}
}
return noErr;
@@ -233,7 +250,7 @@ static OSErr
RappHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_CmdInfo dummy;
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
@@ -242,8 +259,9 @@ RappHandler(
if (interp && Tcl_GetCommandInfo(interp,
"::tk::mac::ReopenApplication", &dummy)) {
- if (Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication") != TCL_OK){
- Tcl_BackgroundError(interp);
+ int code = Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication");
+ if (code != TCL_OK){
+ Tcl_BackgroundException(interp, code);
}
}
return err;
@@ -270,15 +288,16 @@ static OSErr
PrefsHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_CmdInfo dummy;
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
if (interp &&
Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){
- if (Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences") != TCL_OK) {
- Tcl_BackgroundError(interp);
+ int code = Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences");
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
}
}
return noErr;
@@ -304,7 +323,7 @@ static OSErr
OdocHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
AEDescList fileSpecList;
@@ -315,6 +334,7 @@ OdocHandler(
AEKeyword keyword;
Tcl_DString command, pathName;
Tcl_CmdInfo dummy;
+ int code;
/*
* Don't bother if we don't have an interp or the open document procedure
@@ -365,9 +385,10 @@ OdocHandler(
* Now handle the event by evaluating a script.
*/
- if (Tcl_EvalEx(interp, Tcl_DStringValue(&command),
- Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) {
- Tcl_BackgroundError(interp);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command),
+ Tcl_DStringLength(&command), TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
}
Tcl_DStringFree(&command);
return noErr;
@@ -393,7 +414,7 @@ static OSErr
PrintHandler(
const AppleEvent * event,
AppleEvent * reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
AEDescList fileSpecList;
@@ -404,6 +425,7 @@ PrintHandler(
AEKeyword keyword;
Tcl_DString command, pathName;
Tcl_CmdInfo dummy;
+ int code;
/*
* Don't bother if we don't have an interp or the print document procedure
@@ -449,9 +471,10 @@ PrintHandler(
* Now handle the event by evaluating a script.
*/
- if (Tcl_EvalEx(interp, Tcl_DStringValue(&command),
- Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) {
- Tcl_BackgroundError(interp);
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command),
+ Tcl_DStringLength(&command), TCL_EVAL_GLOBAL);
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(interp, code);
}
Tcl_DStringFree(&command);
return noErr;
@@ -477,7 +500,7 @@ static OSErr
ScriptHandler(
const AppleEvent *event,
AppleEvent *reply,
- long handlerRefcon)
+ SRefCon handlerRefcon)
{
OSStatus theErr;
AEDescList theDesc;
@@ -602,13 +625,14 @@ ReallyKillMe(
Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp;
Tcl_CmdInfo dummy;
int quit = Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy);
+ int code = Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit");
- if (Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit") != TCL_OK) {
+ if (code != TCL_OK) {
/*
* Should be never reached...
*/
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
return 1;
}
@@ -676,8 +700,9 @@ FSRefToDString(
/*
* Local Variables:
- * mode: c
+ * mode: objc
* c-basic-offset: 4
- * fill-column: 78
+ * fill-column: 79
+ * coding: utf-8
* End:
*/
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 47c8c18..cd9b9e6 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -5,8 +5,8 @@
* functions.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -14,81 +14,177 @@
#include "tkMacOSXPrivate.h"
-#include "tclInt.h" /* for Tcl_GetStartupScript() & Tcl_SetStartupScript() */
-
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <mach-o/dyld.h>
-#include <mach-o/getsect.h>
+#include <dlfcn.h>
+#include <objc/objc-auto.h>
+
+static char tkLibPath[PATH_MAX + 1] = "";
/*
- * Define the following to 0 to not attempt to use an undocumented SPI to
- * notify the window server that an unbundled executable is a full GUI
- * application after loading Tk.
+ * If the App is in an App package, then we want to add the Scripts directory
+ * to the auto_path.
*/
-#ifndef MAC_OSX_TK_USE_CPS_SPI
-#define MAC_OSX_TK_USE_CPS_SPI 1
+static char scriptPath[PATH_MAX + 1] = "";
+
+int tkMacOSXGCEnabled = 0;
+long tkMacOSXMacOSXVersion = 0;
+
+#pragma mark TKApplication(TKInit)
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+#define NSTextInputContextKeyboardSelectionDidChangeNotification @"NSTextInputContextKeyboardSelectionDidChangeNotification"
+static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
+ [[NSNotificationCenter defaultCenter] postNotificationName:NSTextInputContextKeyboardSelectionDidChangeNotification object:nil userInfo:nil];
+}
#endif
-/*
- * 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.
- */
+@interface TKApplication(TKKeyboard)
+- (void) keyboardChanged: (NSNotification *) notification;
+@end
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+#define TKApplication_NSApplicationDelegate <NSApplicationDelegate>
+#else
+#define TKApplication_NSApplicationDelegate
+#endif
+@interface TKApplication(TKWindowEvent) TKApplication_NSApplicationDelegate
+- (void) _setupWindowNotifications;
+@end
+
+@interface TKApplication(TKScrlbr)
+- (void) _setupScrollBarNotifications;
+@end
+
+@interface TKApplication(TKMenus)
+- (void) _setupMenus;
+@end
-typedef struct Map {
- CFStringEncoding numKey;
- const 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"},
- {0, NULL}
-};
-
-Tcl_Encoding TkMacOSXCarbonEncoding = NULL;
+@implementation TKApplication
+@end
+@implementation TKApplication(TKInit)
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+- (void) _postedNotification: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+}
+#endif
+
+- (void) _setupApplicationNotifications
+{
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+#define observe(n, s) \
+ [nc addObserver:self selector:@selector(s) name:(n) object:nil]
+ observe(NSApplicationDidBecomeActiveNotification, applicationActivate:);
+ observe(NSApplicationDidResignActiveNotification, applicationDeactivate:);
+ observe(NSApplicationDidUnhideNotification, applicationShowHide:);
+ observe(NSApplicationDidHideNotification, applicationShowHide:);
+ observe(NSApplicationDidChangeScreenParametersNotification, displayChanged:);
+ observe(NSTextInputContextKeyboardSelectionDidChangeNotification, keyboardChanged:);
+#undef observe
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), NULL, &keyboardChanged, kTISNotifySelectedKeyboardInputSourceChanged, NULL, CFNotificationSuspensionBehaviorCoalesce);
+#endif
+}
+
+- (void) _setupEventLoop
+{
+ _running = 1;
+ if (!_appFlags._hasBeenRun) {
+ _appFlags._hasBeenRun = YES;
+ [self finishLaunching];
+ }
+ [self setWindowsNeedUpdate:YES];
+}
+
+- (void) _setup: (Tcl_Interp *) interp
+{
+ _eventInterp = interp;
+ _defaultMainMenu = nil;
+ [self _setupMenus];
+ [self setDelegate:self];
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(_postedNotification:) name:nil object:nil];
+#endif
+ [self _setupWindowNotifications];
+ [self _setupScrollBarNotifications];
+ [self _setupApplicationNotifications];
+}
+
+- (NSString *) tkFrameworkImagePath: (NSString *) image
+{
+ NSString *path = nil;
+
+ if (tkLibPath[0] != '\0') {
+ path = [[NSBundle bundleWithPath:[[NSString stringWithUTF8String:
+ tkLibPath] stringByAppendingString:@"/../.."]]
+ pathForImageResource:image];
+ }
+ if (!path) {
+ const char *tk_library = Tcl_GetVar2(_eventInterp, "tk_library", NULL,
+ TCL_GLOBAL_ONLY);
+
+ if (tk_library) {
+ NSFileManager *fm = [NSFileManager defaultManager];
+
+ path = [[NSString stringWithUTF8String:tk_library]
+ stringByAppendingFormat:@"/%@", image];
+ if (![fm isReadableFileAtPath:path]) {
+ path = [[NSString stringWithUTF8String:tk_library]
+ stringByAppendingFormat:@"/../macosx/%@", image];
+ if (![fm isReadableFileAtPath:path]) {
+ path = nil;
+ }
+ }
+ }
+ }
+#ifdef TK_MAC_DEBUG
+ if (!path && getenv("TK_SRCROOT")) {
+ path = [[NSString stringWithUTF8String:getenv("TK_SRCROOT")]
+ stringByAppendingFormat:@"/macosx/%@", image];
+ if (![[NSFileManager defaultManager] isReadableFileAtPath:path]) {
+ path = nil;
+ }
+ }
+#endif
+ return path;
+}
+@end
+
+#pragma mark -
+
/*
- * If the App is in an App package, then we want to add the Scripts directory
- * to the auto_path.
+ *----------------------------------------------------------------------
+ *
+ * DoWindowActivate --
+ *
+ * Idle handler that sets the application icon to the generic Tk icon.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
*/
-static char scriptPath[PATH_MAX + 1] = "";
-
-float tkMacOSXToolboxVersionNumber = 0;
+static void
+SetApplicationIcon(
+ ClientData clientData)
+{
+ NSString *path = [NSApp tkFrameworkImagePath:@"Tk.icns"];
+ if (path) {
+ NSImage *image = [[NSImage alloc] initWithContentsOfFile:path];
+ if (image) {
+ [NSApp setApplicationIconImage:image];
+ [image release];
+ }
+ }
+}
/*
*----------------------------------------------------------------------
@@ -112,11 +208,8 @@ int
TkpInit(
Tcl_Interp *interp)
{
- static char tkLibPath[PATH_MAX + 1];
static int initialized = 0;
- Tk_MacOSXSetupTkNotifier();
-
/*
* Since it is possible for TkInit to be called multiple times and we
* don't want to do the following initialization multiple times we protect
@@ -127,122 +220,56 @@ TkpInit(
int bundledExecutable = 0;
CFBundleRef bundleRef;
CFURLRef bundleUrl = NULL;
- CFStringEncoding encoding;
- const char *encodingStr = NULL;
- int i;
struct utsname name;
- long osVersion = 0;
+ struct stat st;
initialized = 1;
-
+
/*
* Initialize/check OS version variable for runtime checks.
*/
-
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
+# error Mac OS X 10.5 required
+#endif
+
if (!uname(&name)) {
- osVersion = strtol(name.release, NULL, 10) - 4;
+ tkMacOSXMacOSXVersion = (strtod(name.release, NULL) + 96) * 10;
}
- if (osVersion && osVersion < (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10) {
+ if (tkMacOSXMacOSXVersion &&
+ tkMacOSXMacOSXVersion/10 < MAC_OS_X_VERSION_MIN_REQUIRED/10) {
Tcl_Panic("Mac OS X 10.%d or later required !",
- (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10);
+ (MAC_OS_X_VERSION_MIN_REQUIRED/10)-100);
}
- TK_IF_MAC_OS_X_API (3, &kHIToolboxVersionNumber,
- tkMacOSXToolboxVersionNumber = kHIToolboxVersionNumber;
- ) TK_ELSE_MAC_OS_X (3,
- if (osVersion > 5) {
- tkMacOSXToolboxVersionNumber = INFINITY;
- } else if (osVersion >= 3) {
- static const float tbVersions[3] = {
- kHIToolboxVersionNumber10_3,
- kHIToolboxVersionNumber10_4,
- kHIToolboxVersionNumber10_5,
- };
-
- tkMacOSXToolboxVersionNumber = tbVersions[osVersion-3];
- }
- ) TK_ENDIF
+#ifdef TK_FRAMEWORK
/*
* 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?
*/
-#ifdef TK_FRAMEWORK
if (Tcl_MacOSXOpenVersionedBundleResources(interp,
- "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 1, PATH_MAX,
- tkLibPath) != TCL_OK)
-#endif
- {
- /* Tk.framework not found, check if resource file is open */
- Handle rsrc = Get1NamedResource('CURS', "\phand");
- if (rsrc) {
- ReleaseResource(rsrc);
- } else {
-#ifndef __LP64__
- const struct mach_header *image;
- char *data = NULL;
- uint32_t size;
- int fd = -1;
- char fileName[L_tmpnam + 15];
- uint32_t i, n;
-
- /* Get resource data from __tk_rsrc section of tk dylib file*/
- n = _dyld_image_count();
- for (i = 0; i < n; i++) {
- image = _dyld_get_image_header(i);
- if (image) {
- data = getsectdatafromheader(image, SEG_TEXT,
- "__tk_rsrc", (void *) &size);
- if (data) {
- data += _dyld_get_image_vmaddr_slide(i);
- break;
- }
- }
- }
- while (data) {
- FSRef ref;
- SInt16 refNum;
-
- /*
- * Write resource data to temporary file and open it.
- */
-
- strcpy(fileName, P_tmpdir);
- if (fileName[strlen(fileName) - 1] != '/') {
- strcat(fileName, "/");
- }
- strcat(fileName, "tkMacOSX_XXXXXX");
- fd = mkstemp(fileName);
- if (fd == -1) {
- break;
- }
- fcntl(fd, F_SETFD, FD_CLOEXEC);
- if (write(fd, data, size) == -1) {
- break;
- }
- if(ChkErr(FSPathMakeRef, (unsigned char *) fileName, &ref,
- NULL) != noErr) {
- break;
- }
- ChkErr(FSOpenResourceFile, &ref, 0, NULL, fsRdPerm,
- &refNum);
- break;
- }
- if (fd != -1) {
- unlink(fileName);
- close(fd);
- }
-#endif /* __LP64__ */
- }
+ "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX,
+ tkLibPath) != TCL_OK) {
+ TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed");
}
+#endif
- /*
- * If we are loaded into an executable that is not a bundled
- * application, the window server does not let us come to the
- * foreground. For such an executable, notify the window server that
- * we are now a full GUI application.
- */
+ static NSAutoreleasePool *pool = nil;
+ if (!pool) {
+ pool = [NSAutoreleasePool new];
+ }
+ tkMacOSXGCEnabled = ([NSGarbageCollector defaultCollector] != nil);
+ [[NSUserDefaults standardUserDefaults] registerDefaults:
+ [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES],
+ @"_NSCanWrapButtonTitles",
+ [NSNumber numberWithInt:-1],
+ @"NSStringDrawingTypesetterBehavior",
+ nil]];
+ [TKApplication sharedApplication];
+ [NSApp _setup:interp];
/* Check whether we are a bundled executable: */
bundleRef = CFBundleGetMainBundle();
@@ -277,60 +304,34 @@ TkpInit(
CFRelease(bundleUrl);
}
- /*
- * If we are not a bundled executable, notify the window server that
- * we are a foregroundable app.
- */
-
if (!bundledExecutable) {
+ /*
+ * If we are loaded into an executable that is not a bundled
+ * application, the window server does not let us come to the
+ * foreground. For such an executable, notify the window server
+ * that we are now a full GUI application.
+ */
+
OSStatus err = procNotFound;
ProcessSerialNumber psn = { 0, kCurrentProcess };
- TK_IF_MAC_OS_X_API (3, TransformProcessType,
- err = ChkErr(TransformProcessType, &psn,
- kProcessTransformToForegroundApplication);
- ) TK_ENDIF
-#if MAC_OSX_TK_USE_CPS_SPI
- if (err != noErr) {
- /*
- * When building or running on 10.2 or when the above fails,
- * attempt to use undocumented CPS SPI to notify the window
- * server. Load the SPI symbol dynamically, so that we don't
- * break if it ever disappears or changes its name.
- */
-
- TkMacOSXInitNamedSymbol(CoreGraphics, OSStatus,
- CPSEnableForegroundOperation, ProcessSerialNumberPtr);
- if (CPSEnableForegroundOperation) {
- ChkErr(CPSEnableForegroundOperation, &psn);
- }
- }
-#endif /* MAC_OSX_TK_USE_CPS_SPI */
+ err = ChkErr(TransformProcessType, &psn,
+ kProcessTransformToForegroundApplication);
+
+ /*
+ * Set application icon to generic Tk icon, do it at idle time
+ * instead of now to ensure tk_library is setup.
+ */
+
+ Tcl_DoWhenIdle(SetApplicationIcon, NULL);
}
+ [NSApp _setupEventLoop];
TkMacOSXInitAppleEvents(interp);
- TkMacOSXInitCarbonEvents(interp);
- TkMacOSXInitMenus(interp);
TkMacOSXUseAntialiasedText(interp, -1);
TkMacOSXInitCGDrawing(interp, TRUE, 0);
- TkMacOSXInitKeyboard(interp);
-
- 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);
- }
+ [pool drain];
+ pool = [NSAutoreleasePool new];
/*
* FIXME: Close stdin & stdout for remote debugging otherwise we will
@@ -348,36 +349,36 @@ TkpInit(
* clicking Wish) then use the Tk based console interpreter.
*/
- if (!isatty(0)) {
- struct stat st;
-
- if (fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0)) {
- 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 (getenv("TK_CONSOLE") ||
+ (!isatty(0) && (fstat(0, &st) ||
+ (S_ISCHR(st.st_mode) && st.st_blocks == 0)))) {
+ Tk_InitConsoleChannels(interp);
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDIN));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDOUT));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDERR));
- /*
- * Only show the console if we don't have a startup script
- * and tcl_interactive hasn't been set already.
- */
+ /*
+ * Only show the console if we don't have a startup script
+ * and tcl_interactive hasn't been set already.
+ */
- if (Tcl_GetStartupScript(NULL) == NULL) {
- const char *intvar = Tcl_GetVar(interp,
- "tcl_interactive", TCL_GLOBAL_ONLY);
+ if (Tcl_GetStartupScript(NULL) == NULL) {
+ const char *intvar = Tcl_GetVar(interp,
+ "tcl_interactive", TCL_GLOBAL_ONLY);
- if (intvar == NULL) {
- Tcl_SetVar(interp, "tcl_interactive", "1",
- TCL_GLOBAL_ONLY);
- }
- }
- if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
- return TCL_ERROR;
+ if (intvar == NULL) {
+ Tcl_SetVar(interp, "tcl_interactive", "1",
+ TCL_GLOBAL_ONLY);
}
}
+ if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
}
}
+ Tk_MacOSXSetupTkNotifier();
+
if (tkLibPath[0] != '\0') {
Tcl_SetVar(interp, "tk_library", tkLibPath, TCL_GLOBAL_ONLY);
}
@@ -386,6 +387,11 @@ TkpInit(
Tcl_SetVar(interp, "auto_path", scriptPath,
TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
}
+
+ Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel",
+ TkMacOSXStandardAboutPanelObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap",
+ TkMacOSXIconBitmapObjCmd, NULL, NULL);
return TCL_OK;
}
@@ -446,8 +452,8 @@ TkpGetAppName(
void
TkpDisplayWarning(
- CONST char *msg, /* Message to be displayed. */
- CONST 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);
@@ -517,8 +523,7 @@ TkMacOSXDefaultStartupScript(void)
*
* Dynamically acquire address of a named symbol from a loaded dynamic
* library, so that we can use API that may not be available on all OS
- * versions. If module is non-NULL and not the empty string, use twolevel
- * namespace lookup.
+ * versions.
*
* Results:
* Address of given symbol or NULL if unavailable.
@@ -534,22 +539,11 @@ TkMacOSXGetNamedSymbol(
const char* module,
const char* symbol)
{
- NSSymbol nsSymbol = NULL;
-
- if (module && *module) {
- if (NSIsSymbolNameDefinedWithHint(symbol, module)) {
- nsSymbol = NSLookupAndBindSymbolWithHint(symbol, module);
- }
- } else {
- if (NSIsSymbolNameDefined(symbol)) {
- nsSymbol = NSLookupAndBindSymbol(symbol);
- }
- }
-
- if (!nsSymbol) {
- return NULL;
+ void *addr = dlsym(RTLD_NEXT, symbol);
+ if (!addr) {
+ (void) dlerror(); /* Clear dlfcn error state */
}
- return NSAddressOfSymbol(nsSymbol);
+ return addr;
}
/*
@@ -594,7 +588,7 @@ TkMacOSXGetStringObjFromCFString(
/*
* Local Variables:
- * mode: c
+ * mode: objc
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8
diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h
index da9bfab..813acce 100644
--- a/macosx/tkMacOSXInt.h
+++ b/macosx/tkMacOSXInt.h
@@ -4,8 +4,8 @@
* Declarations of Macintosh specific shared variables and procedures.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -18,10 +18,6 @@
#include "tkInt.h"
#endif
-#define TextStyle MacTextStyle
-#include <Carbon/Carbon.h>
-#undef TextStyle
-
/*
* Include platform specific public interfaces.
*/
@@ -30,17 +26,46 @@
#include "tkMacOSX.h"
#endif
+/*
+ * Define compatibility platform types used in the structures below so that
+ * this header can be included without pulling in the platform headers.
+ */
+
+#ifndef _TKMACPRIV
+# ifndef CGGEOMETRY_H_
+# ifndef CGFLOAT_DEFINED
+# if __LP64__
+# define CGFloat double
+# else
+# define CGFloat float
+# endif
+# endif
+# define CGSize struct {CGFloat width; CGFloat height;}
+# endif
+# ifndef CGCONTEXT_H_
+# define CGContextRef void *
+# endif
+# ifndef CGCOLOR_H_
+# define CGColorRef void *
+# endif
+# ifndef __HISHAPE__
+# define HIShapeRef void *
+# endif
+# ifndef _APPKITDEFINES_H
+# define NSView void *
+# endif
+#endif
+
struct TkWindowPrivate {
TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
- CGrafPtr grafPtr;
+ NSView *view;
CGContextRef context;
- ControlRef rootControl;
int xOff; /* X offset from toplevel window */
int yOff; /* Y offset from toplevel window */
CGSize size;
HIShapeRef visRgn; /* Visible region of window */
HIShapeRef aboveVisRgn; /* Visible region of window & its children */
- CGRect drawRect; /* Clipped drawing rect */
+ HIShapeRef drawRgn; /* Clipped drawing region */
int referenceCount; /* Don't delete toplevel until children are
* gone. */
struct TkWindowPrivate *toplevel;
@@ -50,18 +75,6 @@ struct TkWindowPrivate {
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.
*/
@@ -69,7 +82,7 @@ typedef struct TkMacOSXWindowList {
#define TK_CLIP_INVALID 0x02
#define TK_HOST_EXISTS 0x04
#define TK_DRAWN_UNDER_MENU 0x08
-#define TK_CLIPPED_DRAW 0x10
+#define TK_FOCUSED_VIEW 0x10
#define TK_IS_PIXMAP 0x20
#define TK_IS_BW_PIXMAP 0x40
@@ -101,6 +114,46 @@ typedef struct {
MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler;
/*
+ * GC CGColorRef cache for tkMacOSXColor.c
+ */
+
+typedef struct {
+ unsigned long cachedForeground;
+ CGColorRef cachedForegroundColor;
+ unsigned long cachedBackground;
+ CGColorRef cachedBackgroundColor;
+} TkpGCCache;
+
+MODULE_SCOPE TkpGCCache *TkpGetGCCache(GC gc);
+MODULE_SCOPE void TkpInitGCCache(GC gc);
+MODULE_SCOPE void TkpFreeGCCache(GC gc);
+
+/*
+ * Undef compatibility platform types defined above.
+ */
+
+#ifndef _TKMACPRIV
+# ifndef CGGEOMETRY_H_
+# ifndef CGFLOAT_DEFINED
+# undef CGFloat
+# endif
+# undef CGSize
+# endif
+# ifndef CGCONTEXT_H_
+# undef CGContextRef
+# endif
+# ifndef CGCOLOR_H_
+# undef CGColorRef
+# endif
+# ifndef __HISHAPE__
+# undef HIShapeRef
+# endif
+# ifndef _APPKITDEFINES_H
+# undef NSView
+# endif
+#endif
+
+/*
* Defines used for TkMacOSXInvalidateWindow
*/
@@ -115,12 +168,13 @@ MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler;
(((TkWindow *) (tkwin))->privatePtr->toplevel->flags & TK_HOST_EXISTS)
/*
- * Defines use for the flags argument to TkGenWMConfigureEvent.
+ * Defines used for the flags argument to TkGenWMConfigureEvent.
*/
#define TK_LOCATION_CHANGED 1
#define TK_SIZE_CHANGED 2
#define TK_BOTH_CHANGED 3
+#define TK_MACOSX_HANDLE_EVENT_IMMEDIATELY 1024
/*
* Defines for tkTextDisp.c
@@ -129,32 +183,6 @@ MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler;
#define TK_LAYOUT_WITH_BASE_CHUNKS 1
#define TK_DRAW_IN_CONTEXT 1
-#if !TK_DRAW_IN_CONTEXT
-MODULE_SCOPE int TkMacOSXCompareColors(unsigned long c1, unsigned long c2);
-#endif
-
-/*
- * Globals shared among TkAqua.
- */
-
-MODULE_SCOPE MenuHandle tkCurrentAppleMenu; /* Handle to current Apple Menu */
-MODULE_SCOPE MenuHandle tkAppleMenu; /* Handle to default Apple Menu */
-MODULE_SCOPE MenuHandle tkFileMenu; /* Handles to menus */
-MODULE_SCOPE MenuHandle tkEditMenu; /* Handles to menus */
-MODULE_SCOPE 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
- */
-MODULE_SCOPE TkMacOSXWindowList *tkMacOSXWindowListPtr; /* List of toplevels */
-MODULE_SCOPE Tcl_Encoding TkMacOSXCarbonEncoding;
-
/*
* Prototypes of internal procs not in the stubs table.
*/
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index e599fe3..b3b016e 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -1,58 +1,14 @@
/*
* tkMacOSXKeyEvent.c --
*
- * This file implements functions that decode & handle keyboard events
- * on MacOS X.
+ * This file implements functions that decode & handle keyboard events on
+ * MacOS X.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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 "tkMacOSXPrivate.h"
@@ -64,953 +20,165 @@
#endif
*/
-typedef struct {
- WindowRef whichWindow;
- int global_x, global_y;
- int local_x, local_y;
- unsigned int state;
- UInt32 keyCode;
- UInt32 keyModifiers;
- UInt32 message;
- unsigned char ch;
-} KeyEventData;
-
static Tk_Window grabWinPtr = NULL;
/* Current grab window, NULL if no grab. */
static Tk_Window keyboardGrabWinPtr = NULL;
/* Current keyboard grab window. */
-static UInt32 deadKeyStateUp = 0;
- /* The deadkey state for the current sequence
- * of keyup events or 0 if not in a deadkey
- * sequence */
-static UInt32 deadKeyStateDown = 0;
- /* Ditto for keydown */
-
-/*
- * Declarations for functions used only in this file.
- */
-
-static int InitKeyData(KeyEventData *keyEventDataPtr);
-static int InitKeyEvent(XEvent *eventPtr, KeyEventData *e, UInt32 savedKeyCode,
- UInt32 savedModifiers);
-static int GenerateKeyEvent(UInt32 eKind, KeyEventData *e, UInt32 savedKeyCode,
- UInt32 savedModifiers, const UniChar *chars, int numChars);
-static int GetKeyboardLayout(Ptr *resourcePtr, TextEncoding *encodingPtr);
-static TextEncoding GetKCHREncoding(ScriptCode script, SInt32 layoutid);
-static int KeycodeToUnicodeViaUnicodeResource(UniChar *uniChars, int maxChars,
- Ptr uchr, EventKind eKind, UInt32 keycode, UInt32 modifiers,
- UInt32 *deadKeyStatePtr);
-static int KeycodeToUnicodeViaKCHRResource(UniChar *uniChars, int maxChars,
- Ptr kchr, TextEncoding encoding, EventKind eKind, UInt32 keycode,
- UInt32 modifiers, UInt32 *deadKeyStatePtr);
+static NSModalSession modalSession = NULL;
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
+#pragma mark TKApplication(TKKeyEvent)
-MODULE_SCOPE int
-TkMacOSXProcessKeyboardEvent(
- TkMacOSXEvent *eventPtr,
- MacEventStatus *statusPtr)
+@implementation TKApplication(TKKeyEvent)
+- (NSEvent *) tkProcessKeyEvent: (NSEvent *) theEvent
{
- static UInt32 savedKeyCode = 0;
- static UInt32 savedModifiers = 0;
- static UniChar savedChar = 0;
- OSStatus err;
- KeyEventData keyEventData;
- MenuRef menuRef;
- MenuItemIndex menuItemIndex;
- int eventGenerated;
- UniChar uniChars[5]; /* make this larger, if needed */
- UInt32 uniCharsLen = 0;
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
+#endif
+ NSWindow* w;
+ NSEventType type = [theEvent type];
+ NSUInteger modifiers, len;
+ BOOL repeat = NO;
+ unsigned short keyCode;
+ NSString *characters = nil, *charactersIgnoringModifiers = nil;
+ static NSUInteger savedModifiers = 0;
+
+ switch (type) {
+ case NSKeyUp:
+ case NSKeyDown:
+ repeat = [theEvent isARepeat];
+ characters = [theEvent characters];
+ charactersIgnoringModifiers = [theEvent charactersIgnoringModifiers];
+ case NSFlagsChanged:
+ modifiers = [theEvent modifierFlags];
+ keyCode = [theEvent keyCode];
+ w = [self windowWithWindowNumber:[theEvent windowNumber]];
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %d %u %@ %@ %u %@", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode, w);
+#endif
+ break;
- if (!InitKeyData(&keyEventData)) {
- statusPtr->err = 1;
- return false;
+ default:
+ return theEvent;
}
- /*
- * Because of the way that Tk operates, we can't in general funnel menu
- * accelerators through IsMenuKeyEvent. Tk treats accelerators as mere
- * decoration, and the user has to install bindings to get them to fire.
- *
- * However, the only way to trigger the Hide & Hide Others functions
- * is by invoking the Menu command for Hide. So there is no nice way to
- * provide a Tk command to hide the app which would be available for a
- * binding. So I am going to hijack Command-H and Command-Shift-H
- * here, and run the menu commands. Since the HI Guidelines explicitly
- * reserve these for Hide, this isn't such a bad thing. Also, if you do
- * rebind Command-H to another menu item, Hide will lose its binding.
- *
- * Note that I don't really do anything at this point,
- * I just mark stopProcessing as 0 and return, and then the
- * RecieveAndProcessEvent code will dispatch the event to the default
- * handler.
- */
-
- if ((eventPtr->eKind == kEventRawKeyDown
- || eventPtr->eKind == kEventRawKeyRepeat)
- && IsMenuKeyEvent(tkCurrentAppleMenu, eventPtr->eventRef,
- kMenuEventQueryOnly, &menuRef, &menuItemIndex)) {
- MenuCommand menuCmd;
-
- GetMenuItemCommandID (menuRef, menuItemIndex, &menuCmd);
- switch (menuCmd) {
- case kHICommandHide:
- case kHICommandHideOthers:
- case kHICommandShowAll:
- case kHICommandPreferences:
- case kHICommandQuit:
- statusPtr->stopProcessing = 0;
+ unsigned int state = 0;
- /*
- * TODO: may not be on event on queue.
- */
-
- return 0;
- break;
- default:
- break;
- }
- }
-
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamKeyMacCharCodes, typeChar, NULL,
- sizeof(keyEventData.ch), NULL, &keyEventData.ch);
- if (err != noErr) {
- statusPtr->err = 1;
- return false;
+ if (modifiers & NSAlphaShiftKeyMask) {
+ state |= LockMask;
}
- err = ChkErr(GetEventParameter, eventPtr->eventRef, kEventParamKeyCode,
- typeUInt32, NULL, sizeof(keyEventData.keyCode), NULL,
- &keyEventData.keyCode);
- if (err != noErr) {
- statusPtr->err = 1;
- return false;
+ if (modifiers & NSShiftKeyMask) {
+ state |= ShiftMask;
}
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamKeyModifiers, typeUInt32, NULL,
- sizeof(keyEventData.keyModifiers), NULL,
- &keyEventData.keyModifiers);
- if (err != noErr) {
- statusPtr->err = 1;
- return false;
+ if (modifiers & NSControlKeyMask) {
+ state |= ControlMask;
}
-
- switch (eventPtr->eKind) {
- case kEventRawKeyUp:
- case kEventRawKeyDown:
- case kEventRawKeyRepeat: {
- UInt32 *deadKeyStatePtr;
-
- if (kEventRawKeyDown == eventPtr->eKind) {
- deadKeyStatePtr = &deadKeyStateDown;
- } else {
- deadKeyStatePtr = &deadKeyStateUp;
- }
-
- uniCharsLen = TkMacOSXKeycodeToUnicode(uniChars,
- sizeof(uniChars)/sizeof(*uniChars), eventPtr->eKind,
- keyEventData.keyCode, keyEventData.keyModifiers,
- deadKeyStatePtr);
- break;
- }
- }
-
- if (kEventRawKeyUp == eventPtr->eKind) {
- /*
- * For some reason the deadkey processing for KeyUp doesn't work
- * sometimes, so we fudge and use the last detected KeyDown.
- */
-
- if ((0 == uniCharsLen) && (0 != savedChar)) {
- uniChars[0] = savedChar;
- uniCharsLen = 1;
- }
-
- /*
- * Suppress keyup events while we have a deadkey sequence on keydown.
- * We still *do* want to collect deadkey state in this situation if
- * the system provides it, that's why we do this only after
- * TkMacOSXKeycodeToUnicode().
- */
-
- if (0 != deadKeyStateDown) {
- uniCharsLen = 0;
- }
+ if (modifiers & NSCommandKeyMask) {
+ state |= Mod1Mask; /* command key */
}
-
- keyEventData.message = keyEventData.ch|(keyEventData.keyCode << 8);
-
- eventGenerated = GenerateKeyEvent(eventPtr->eKind, &keyEventData,
- savedKeyCode, savedModifiers, uniChars, uniCharsLen);
-
- savedModifiers = keyEventData.keyModifiers;
-
- if ((kEventRawKeyDown == eventPtr->eKind) && (uniCharsLen > 0)) {
- savedChar = uniChars[0];
- } else {
- savedChar = 0;
+ if (modifiers & NSAlternateKeyMask) {
+ state |= Mod2Mask; /* option key */
}
-
- statusPtr->stopProcessing = 1;
-
- if (eventGenerated == 0) {
- savedKeyCode = keyEventData.message;
- return false;
- } else if (eventGenerated == -1) {
- savedKeyCode = 0;
- statusPtr->stopProcessing = 0;
- return false;
- } else {
- savedKeyCode = 0;
- return true;
+ if (modifiers & NSNumericPadKeyMask) {
+ state |= Mod3Mask;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GenerateKeyEvent --
- *
- * Given Macintosh keyUp, keyDown & autoKey events (in their "raw"
- * form) and a list of unicode characters this function generates the
- * appropriate X key events.
- *
- * Parameter eKind is a raw keyboard event. e contains the data sent
- * with the event. savedKeyCode and savedModifiers contain the values
- * from the last event that came before (see
- * TkMacOSXProcessKeyboardEvent()). chars/numChars has the Unicode
- * characters for which we want to create events.
- *
- * Results:
- * 1 if an event was generated, -1 for any error.
- *
- * Side effects:
- * Additional events may be place on the Tk event queue.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GenerateKeyEvent(
- UInt32 eKind,
- KeyEventData * e,
- UInt32 savedKeyCode,
- UInt32 savedModifiers,
- const UniChar * chars,
- int numChars)
-{
- XEvent event;
- int i;
-
- if (-1 == InitKeyEvent(&event, e, savedKeyCode, savedModifiers)) {
- return -1;
+ if (modifiers & NSFunctionKeyMask) {
+ state |= Mod4Mask;
}
- if (kEventRawKeyModifiersChanged == eKind) {
- 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);
-
- } else {
- for (i = 0; i < numChars; ++i) {
- /*
- * Encode one char in the trans_chars array that was already
- * introduced for MS Windows. Don't encode the string, if it is
- * a control character but was not generated with a real control
- * modifier. Such control characters get generated by KeyTrans()
- * for special keys, but we rather want to identify those by
- * their KeySyms.
- */
-
- event.xkey.trans_chars[0] = 0;
- if ((controlKey & e->keyModifiers) || (chars[i] >= ' ')) {
- int done;
- done = Tcl_UniCharToUtf(chars[i],event.xkey.trans_chars);
- event.xkey.trans_chars[done] = 0;
- }
-
- 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;
- default:
- TkMacOSXDbgMsg("Invalid parameter eKind %ld", eKind);
- return -1;
- }
- }
- }
-
- return 1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * InitKeyData --
- *
- * This routine initializes a KeyEventData structure by asking the OS
- * and Tk for all the global information needed here.
- *
- * Results:
- * True if the current front window can be found in Tk data structures
- * - false otherwise.
- *
- * Side Effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-
-static int
-InitKeyData(
- KeyEventData *keyEventDataPtr)
-{
- memset(keyEventDataPtr, 0, sizeof(*keyEventDataPtr));
-
- keyEventDataPtr->whichWindow = ActiveNonFloatingWindow();
- if (keyEventDataPtr->whichWindow == NULL) {
- return false;
- }
- XQueryPointer(NULL, None, NULL, NULL, &keyEventDataPtr->global_x,
- &keyEventDataPtr->global_y, &keyEventDataPtr->local_x,
- &keyEventDataPtr->local_y, &keyEventDataPtr->state);
-
- return true;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * InitKeyEvent --
- *
- * Initialize an XEvent structure by asking Tk for global information.
- * Also uses a KeyEventData structure and other current state.
- *
- * Results:
- * 1 on success, -1 for any error.
- *
- * Side effects:
- * Additional events may be place on the Tk event queue.
- *
- *----------------------------------------------------------------------
- */
-
-/*
- * We have a general 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). OTOH Option-d actually produces
- * a real character on MacOS, namely a mathematical delta.
- *
- * The current behaviour is that a binding goes by the combinations of
- * modifiers and base keysym, that is Option-d. The string value of the
- * event is the mathematical delta character, so if no binding calls
- * [break], the text widget will insert that character.
- *
- * Note that this is similar to control combinations on all platforms. They
- * also generate events that have the base character as keysym and a real
- * control character as character value. So Ctrl+C gets us the keysym XK_C,
- * the modifier Control (so you can bind <Control-C>) and a string value as
- * "\u0003".
- *
- * For a different solutions we may want for the event to contain keysyms for
- * *both* the 'Opt-d' side of things and the mathematical delta. Then a
- * binding on Opt-d will trigger, but a binding on mathematical delta would
- * also trigger. This would require changes in the core, though.
- */
-
-static int
-InitKeyEvent(
- XEvent * eventPtr,
- KeyEventData * e,
- UInt32 savedKeyCode,
- UInt32 savedModifiers)
-{
- Window window;
- Tk_Window tkwin;
- 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.
+ * The focus must be in the FrontWindow on the Macintosh. We then query Tk
+ * to determine the exact Tk window that owns the focus.
*/
- window = TkMacOSXGetXWindow(e->whichWindow);
- dispPtr = TkGetDisplayList();
- tkwin = Tk_IdToWindow(dispPtr->display, window);
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+ Tk_Window tkwin = (Tk_Window) winPtr;
if (!tkwin) {
TkMacOSXDbgMsg("tkwin == NULL");
- return -1;
+ return theEvent;
}
-
- tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ tkwin = (Tk_Window) winPtr->dispPtr->focusPtr;
if (!tkwin) {
TkMacOSXDbgMsg("tkwin == NULL");
- return -1;
+ return theEvent;
}
- memset(eventPtr, 0, sizeof(XEvent));
- eventPtr->xany.send_event = false;
- eventPtr->xany.serial = Tk_Display(tkwin)->request;
-
- eventPtr->xkey.same_screen = true;
- eventPtr->xkey.subwindow = None;
- eventPtr->xkey.time = TkpGetMS();
- eventPtr->xkey.x_root = e->global_x;
- eventPtr->xkey.y_root = e->global_y;
- eventPtr->xkey.window = Tk_WindowId(tkwin);
- eventPtr->xkey.display = Tk_Display(tkwin);
- eventPtr->xkey.root = XRootWindow(Tk_Display(tkwin), 0);
- eventPtr->xkey.state = e->state;
- eventPtr->xkey.trans_chars[0] = 0;
-
- Tk_TopCoordsToWindow(tkwin, e->local_x, e->local_y, &eventPtr->xkey.x,
- &eventPtr->xkey.y);
-
- eventPtr->xkey.keycode = e->ch | ((savedKeyCode & charCodeMask) << 8) |
- ((e->message&keyCodeMask) << 8);
-
- return 1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetKeyboardLayout --
- *
- * Queries the OS for a pointer to a keyboard resource.
- *
- * This function works with the keyboard layout switch menu. It uses
- * Keyboard Layout Services, where available.
- *
- * Results:
- * 1 if there is returned a Unicode 'uchr' resource in *resourcePtr, 0
- * if it is a classic 'KCHR' resource. A pointer to the actual resource
- * data goes into *resourcePtr. If the resource is a 'KCHR' resource,
- * the corresponding Mac encoding goes into *encodingPtr.
- *
- * Side effects:
- * Sets some internal static variables.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GetKeyboardLayout(
- Ptr *resourcePtr,
- TextEncoding *encodingPtr)
-{
- static KeyboardLayoutRef lastLayout = NULL;
- static SInt32 lastLayoutId;
- static TextEncoding lastEncoding = kTextEncodingMacRoman;
- static Ptr uchr = NULL;
- static Ptr KCHR = NULL;
- int hasLayoutChanged = false;
- KeyboardLayoutRef currentLayout = NULL;
- SInt32 currentLayoutId = 0;
- ScriptCode currentKeyScript;
-
- currentKeyScript = GetScriptManagerVariable(smKeyScript);
-
- /*
- * Use the Keyboard Layout Services.
- */
-
- KLGetCurrentKeyboardLayout(&currentLayout);
-
- if (currentLayout != NULL) {
-
- /*
- * The layout pointer could in theory be the same for different
- * layouts, only the id gives us the information that the
- * keyboard has actually changed. OTOH the layout object can
- * also change and it could still be the same layoutid.
- */
-
- KLGetKeyboardLayoutProperty(currentLayout, kKLIdentifier,
- (const void**)&currentLayoutId);
-
- if ((lastLayout != currentLayout)
- || (lastLayoutId != currentLayoutId)) {
-
-#ifdef TK_MAC_DEBUG_KEYBOARD
- TkMacOSXDbgMsg("Use KLS");
-#endif
-
- hasLayoutChanged = true;
-
- /*
- * Reinitialize all relevant variables.
- */
-
- lastLayout = currentLayout;
- lastLayoutId = currentLayoutId;
- uchr = NULL;
- KCHR = NULL;
-
- if ((KLGetKeyboardLayoutProperty(currentLayout,
- kKLuchrData, (const void**)&uchr)
- == noErr)
- && (uchr != NULL)) {
- /* done */
- } else if ((KLGetKeyboardLayoutProperty(currentLayout,
- kKLKCHRData, (const void**)&KCHR)
- == noErr)
- && (KCHR != NULL)) {
- /* done */
- }
- }
- }
-
- if (hasLayoutChanged) {
-#ifdef TK_MAC_DEBUG_KEYBOARD
- if (KCHR) {
- TkMacOSXDbgMsg("New 'KCHR' layout %ld", currentLayoutId);
- } else if (uchr) {
- TkMacOSXDbgMsg("New 'uchr' layout %ld", currentLayoutId);
+ XEvent xEvent;
+
+ memset(&xEvent, 0, sizeof(XEvent));
+ xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
+ xEvent.xany.send_event = false;
+ xEvent.xany.display = Tk_Display(tkwin);
+ xEvent.xany.window = Tk_WindowId(tkwin);
+
+ xEvent.xkey.root = XRootWindow(Tk_Display(tkwin), 0);
+ xEvent.xkey.subwindow = None;
+ xEvent.xkey.time = TkpGetMS();
+ xEvent.xkey.state = state;
+ xEvent.xkey.same_screen = true;
+ xEvent.xkey.trans_chars[0] = 0;
+ xEvent.xkey.nbytes = 0;
+
+ if (type == NSFlagsChanged) {
+ if (savedModifiers > modifiers) {
+ xEvent.xany.type = KeyRelease;
} else {
- TkMacOSXDbgMsg("Use cached layout (should have been %ld)",
- currentLayoutId);
- }
-#endif
-
- deadKeyStateUp = deadKeyStateDown = 0;
-
- /*
- * If we did get a new 'KCHR', compute its encoding and put it into
- * lastEncoding.
- *
- * If we didn't get a new 'KCHR' and if we have no 'uchr' either, get
- * some 'KCHR' from the OS cache and leave lastEncoding at its
- * current value. This should better not happen, it doesn't really
- * work.
- */
-
- if (KCHR) {
- lastEncoding = GetKCHREncoding(currentKeyScript, currentLayoutId);
-#ifdef TK_MAC_DEBUG_KEYBOARD
- TkMacOSXDbgMsg("New 'KCHR' encoding %lu (%lu + 0x%lX)",
- lastEncoding, lastEncoding & 0xFFFFL,
- lastEncoding & ~0xFFFFL);
-#endif
- } else if (!uchr) {
- KCHR = (Ptr)(intptr_t)GetScriptManagerVariable(smKCHRCache);
+ xEvent.xany.type = KeyPress;
}
- }
-
- if (uchr) {
- *resourcePtr = uchr;
- return 1;
- } else {
- *resourcePtr = KCHR;
- *encodingPtr = lastEncoding;
- return 0;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetKCHREncoding --
- *
- * Upgrade a WorldScript code to a TEC encoding based on the keyboard
- * layout id.
- *
- * Results:
- * The TEC code that corresponds best to the combination of WorldScript
- * code and 'KCHR' id.
- *
- * Side effects:
- * None.
- *
- * Rationale and Notes:
- * WorldScript codes are sometimes not unique encodings. E.g. Icelandic
- * uses script smRoman (0), but the actual encoding is
- * kTextEncodingMacIcelandic (37). ftp://ftp.unicode.org/Public
- * /MAPPINGS/VENDORS/APPLE/README.TXT has a good summary of these
- * variants. So we need to upgrade the script to an encoding with
- * GetTextEncodingFromScriptInfo().
- *
- * 'KCHR' ids are usually region codes (see the comments in Script.h).
- * Where they are not, we get a paramErr from the OS function and have
- * appropriate fallbacks.
- *
- *----------------------------------------------------------------------
- */
-
-static TextEncoding
-GetKCHREncoding(
- ScriptCode script,
- SInt32 layoutid)
-{
- RegionCode region = layoutid;
- TextEncoding encoding = script;
-
- if (GetTextEncodingFromScriptInfo(script, kTextLanguageDontCare, region,
- &encoding) == noErr) {
- return encoding;
- }
-
- /*
- * GetTextEncodingFromScriptInfo() doesn't know about more exotic
- * layouts. This provides a fallback for good measure. In an ideal
- * world, exotic layouts would always provide a 'uchr' resource anyway,
- * so we wouldn't need this.
- *
- * We can add more keyboard layouts, if we get actual complaints. Farsi
- * or other Celtic/Gaelic layouts would be candidates.
- */
-
- switch (layoutid) {
- /*
- * Icelandic and Faroese (planned). These layouts are sold by Apple
- * Iceland for legacy applications.
- */
-
- case 1800: case 1821:
- return kTextEncodingMacIcelandic;
-
- /*
- * Irish and Welsh. These layouts are mentioned in <Script.h>.
- *
- * FIXME: This may have to be kTextEncodingMacGaelic instead, but I
- * can't locate layouts of this type for testing.
- */
-
- case 581: case 779:
- return kTextEncodingMacCeltic;
- }
-
- /*
- * The valid script codes are also the valid default encoding codes, so
- * if nothing else helps, fall back on those.
- */
-
- return script;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * KeycodeToUnicodeViaUnicodeResource --
- *
- * Given MacOS key event data this function generates the Unicode
- * characters. It does this using a 'uchr' and the UCKeyTranslate
- * API.
- *
- * The parameter deadKeyStatePtr can be NULL, if no deadkey handling
- * is needed.
- *
- * Tested and known to work with US, Hebrew, Greek and Russian layouts
- * as well as "Unicode Hex Input".
- *
- * Results:
- * The number of characters generated if any, 0 if we are waiting for
- * another byte of a dead-key sequence. Fills in the uniChars array
- * with a Unicode string.
- *
- * Side Effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-
-static int
-KeycodeToUnicodeViaUnicodeResource(
- UniChar *uniChars,
- int maxChars,
- Ptr uchr,
- EventKind eKind,
- UInt32 keycode,
- UInt32 modifiers,
- UInt32 *deadKeyStatePtr)
-{
- int action;
- unsigned long keyboardType;
- OptionBits options = 0;
- UInt32 dummy_state;
- UniCharCount actuallength;
- OSStatus err;
- keycode &= 0xFF;
- modifiers = (modifiers >> 8) & 0xFF;
- keyboardType = LMGetKbdType();
-
- if (NULL==deadKeyStatePtr) {
- options = kUCKeyTranslateNoDeadKeysMask;
- dummy_state = 0;
- deadKeyStatePtr = &dummy_state;
- }
-
- switch(eKind) {
- case kEventRawKeyDown:
- action = kUCKeyActionDown;
- break;
- case kEventRawKeyUp:
- action = kUCKeyActionUp;
- break;
- case kEventRawKeyRepeat:
- action = kUCKeyActionAutoKey;
- break;
- default:
- TkMacOSXDbgMsg("Invalid parameter eKind %d", eKind);
- return 0;
- }
-
- err = ChkErr(UCKeyTranslate, (const UCKeyboardLayout *) uchr, keycode,
- action, modifiers, keyboardType, options, deadKeyStatePtr,
- maxChars, &actuallength, uniChars);
-
- if ((0 == actuallength) && (0 != *deadKeyStatePtr)) {
/*
- * More data later
+ * Use special '-1' to signify a special keycode to our platform
+ * specific code in tkMacOSXKeyboard.c. This is rather like what
+ * happens on Windows.
*/
- return 0;
- }
-
- /*
- * some IMEs leave residue :-(
- */
-
- *deadKeyStatePtr = 0;
+ xEvent.xany.send_event = -1;
- if (err != noErr) {
- actuallength = 0;
- }
-
- return actuallength;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * KeycodeToUnicodeViaKCHRResource --
- *
- * Given MacOS key event data this function generates the Unicode
- * characters. It does this using a 'KCHR' and the KeyTranslate API.
- *
- * The parameter deadKeyStatePtr can be NULL, if no deadkey handling
- * is needed.
- *
- * Results:
- * The number of characters generated if any, 0 if we are waiting for
- * another byte of a dead-key sequence. Fills in the uniChars array
- * with a Unicode string.
- *
- * Side Effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-
-static int
-KeycodeToUnicodeViaKCHRResource(
- UniChar *uniChars,
- int maxChars,
- Ptr kchr,
- TextEncoding encoding,
- EventKind eKind,
- UInt32 keycode,
- UInt32 modifiers,
- UInt32 *deadKeyStatePtr)
-{
- UInt32 result;
- char macBuff[3];
- char *macStr;
- int macStrLen;
- UInt32 dummy_state = 0;
-
- if (NULL == deadKeyStatePtr) {
- deadKeyStatePtr = &dummy_state;
- }
-
- keycode |= modifiers;
- result = KeyTranslate(kchr, keycode, deadKeyStatePtr);
-
- if ((0 == result) && (0 != dummy_state)) {
/*
- * 'dummy_state' gets only filled if the caller did not want deadkey
- * processing (deadKeyStatePtr was NULL originally), but we still
- * have a deadkey. We just push the keycode for the space bar to get
- * the real key value.
- */
-
- result = KeyTranslate(kchr, 0x31, deadKeyStatePtr);
- *deadKeyStatePtr = 0;
- }
-
- if ((0 == result) && (0 != *deadKeyStatePtr)) {
- /*
- * More data later
- */
-
- return 0;
- }
-
- macBuff[0] = (char) (result >> 16);
- macBuff[1] = (char) result;
- macBuff[2] = 0;
-
- if (0 != macBuff[0]) {
- /*
- * If the first byte is valid, the second is too
- */
-
- macStr = macBuff;
- macStrLen = 2;
- } else if (0 != macBuff[1]) {
- /*
- * Only the second is valid
+ * Set keycode (which was zero) to the changed modifier
*/
- macStr = macBuff+1;
- macStrLen = 1;
+ xEvent.xkey.keycode = (modifiers ^ savedModifiers);
} else {
- /*
- * No valid bytes at all -- shouldn't happen
- */
-
- macStr = NULL;
- macStrLen = 0;
- }
-
- if (macStrLen <= 0) {
- return 0;
- } else {
-
- /*
- * Use the CFString conversion routines. This is the easiest and
- * most compatible way to get from an 8-bit string and a MacOS script
- * code to a Unicode string.
- *
- * FIXME: The system ships with an Irish 'KCHR' but without the
- * corresponding macCeltic encoding, which triggers the error below.
- * Tcl doesn't have the macCeltic encoding either right now, so until
- * we get that, we can just as well stick to this code. The right
- * fix would be to use the Tcl encodings and add macCeltic and
- * probably others there. Suitable Unicode data files for the
- * missing encodings are available from www.evertype.com.
- */
-
- CFStringRef cfString;
- int uniStrLen;
-
- cfString = CFStringCreateWithCStringNoCopy(NULL, macStr, encoding,
- kCFAllocatorNull);
- if (cfString == NULL) {
- TkMacOSXDbgMsg("CFString: Can't convert with encoding %ld",
- encoding);
- return 0;
+ if (type == NSKeyUp || repeat) {
+ xEvent.xany.type = KeyRelease;
+ } else {
+ xEvent.xany.type = KeyPress;
}
- uniStrLen = CFStringGetLength(cfString);
- if (uniStrLen > maxChars) {
- uniStrLen = maxChars;
+/* prevent SF bug 2907388 here (crash on composite characters) */
+if ([characters length] > 0) {
+ xEvent.xkey.keycode = (keyCode << 16) | (UInt16)
+ [characters characterAtIndex:0];
+ if (![characters getCString:xEvent.xkey.trans_chars
+ maxLength:XMaxTransChars encoding:NSUTF8StringEncoding]) {
+ TkMacOSXDbgMsg("characters too long");
+ return theEvent;
}
- CFStringGetCharacters(cfString, CFRangeMake(0,uniStrLen), uniChars);
- CFRelease(cfString);
-
- return uniStrLen;
- }
}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXKeycodeToUnicode --
- *
- * Given MacOS key event data this function generates the Unicode
- * characters. It does this using OS resources and APIs.
- *
- * The parameter deadKeyStatePtr can be NULL, if no deadkey handling
- * is needed.
- *
- * This function is called from XKeycodeToKeysym() in
- * tkMacOSKeyboard.c.
- *
- * Results:
- * The number of characters generated if any, 0 if we are waiting for
- * another byte of a dead-key sequence. Fills in the uniChars array
- * with a Unicode string.
- *
- * Side Effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-
-MODULE_SCOPE int
-TkMacOSXKeycodeToUnicode(
- UniChar *uniChars,
- int maxChars,
- EventKind eKind,
- UInt32 keycode,
- UInt32 modifiers,
- UInt32 *deadKeyStatePtr)
-{
- Ptr resource = NULL;
- TextEncoding encoding;
- int len;
+/* end workaround */
-
- if (GetKeyboardLayout(&resource,&encoding)) {
- len = KeycodeToUnicodeViaUnicodeResource(
- uniChars, maxChars, resource, eKind,
- keycode, modifiers, deadKeyStatePtr);
- } else {
- len = KeycodeToUnicodeViaKCHRResource(
- uniChars, maxChars, resource, encoding, eKind,
- keycode, modifiers, deadKeyStatePtr);
+ len = [charactersIgnoringModifiers length];
+ if (len) {
+ xEvent.xkey.nbytes = [charactersIgnoringModifiers characterAtIndex:0];
+ if (len > 1) {
+ TkMacOSXDbgMsg("more than one charactersIgnoringModifiers");
+ }
+ }
+ if (repeat) {
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ xEvent.xany.type = KeyPress;
+ xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
+ }
}
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ savedModifiers = modifiers;
- return len;
+ return theEvent;
}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -1038,6 +206,17 @@ XGrabKeyboard(
Time time)
{
keyboardGrabWinPtr = Tk_IdToWindow(display, grab_window);
+ if (keyboardGrabWinPtr && grabWinPtr) {
+ NSWindow *w = TkMacOSXDrawableWindow(grab_window);
+ MacDrawable *macWin = (MacDrawable *) grab_window;
+
+ if (w && macWin->toplevel->winPtr == (TkWindow*) grabWinPtr) {
+ if (modalSession) {
+ Tcl_Panic("XGrabKeyboard: already grabbed");
+ }
+ modalSession = [NSApp beginModalSessionForWindow:[w retain]];
+ }
+ }
return GrabSuccess;
}
@@ -1062,6 +241,13 @@ XUngrabKeyboard(
Display* display,
Time time)
{
+ if (modalSession) {
+ NSWindow *w = keyboardGrabWinPtr ? TkMacOSXDrawableWindow(
+ ((TkWindow *) keyboardGrabWinPtr)->window) : nil;
+ [NSApp endModalSession:modalSession];
+ [w release];
+ modalSession = NULL;
+ }
keyboardGrabWinPtr = NULL;
}
@@ -1072,6 +258,7 @@ XUngrabKeyboard(
*
* Results:
* Returns the current grab window
+ *
* Side effects:
* None.
*
@@ -1087,12 +274,31 @@ TkMacOSXGetCapture(void)
/*
*----------------------------------------------------------------------
*
+ * TkMacOSXGetModalSession --
+ *
+ * Results:
+ * Returns the current modal session
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE NSModalSession
+TkMacOSXGetModalSession(void)
+{
+ return modalSession;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* 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.
+ * 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.
@@ -1110,24 +316,6 @@ TkpSetCapture(
while (winPtr && !Tk_IsTopLevel(winPtr)) {
winPtr = winPtr->parentPtr;
}
-#if 0
- {
- TkWindow *w = NULL;
- WindowModality m;
-
- if (winPtr) {
- w = winPtr;
- m = kWindowModalityAppModal;
- } else if (grabWinPtr) {
- w = (TkWindow*)grabWinPtr;
- m = kWindowModalityNone;
- }
- if (w && w->window != None && TkMacOSXHostToplevelExists(w)) {
- ChkErr(SetWindowModality, TkMacOSXDrawableWindow(w->window), m,
- NULL);
- }
- }
-#endif
grabWinPtr = (Tk_Window) winPtr;
}
@@ -1136,9 +324,9 @@ TkpSetCapture(
*
* 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 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
@@ -1159,27 +347,10 @@ Tk_SetCaretPos(
}
/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXInitKeyboard --
- *
- * This procedure initializes the keyboard layout.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
*/
-
-MODULE_SCOPE void
-TkMacOSXInitKeyboard(
- Tcl_Interp *interp)
-{
- Ptr resource;
- TextEncoding encoding;
-
- GetKeyboardLayout(&resource, &encoding);
-}
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index b1e60bb..a51f970 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -4,17 +4,15 @@
* Routines to support keyboard events on the Macintosh.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkMacOSXInt.h"
-#include "tkMacOSXEvent.h" /* for TkMacOSXKeycodeToUnicode()
- * FIXME: That function should probably move
- * here. */
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXEvent.h"
/*
* A couple of simple definitions to make code a bit more self-explaining.
@@ -106,6 +104,8 @@ static Tcl_HashTable vkeyTable; /* virtualkeyArray hashed by virtual
static int latin1Table[LATIN1_MAX+1]; /* Reverse mapping table for
* controls, ASCII and Latin-1. */
+static int keyboardChanged = 1;
+
/*
* Prototypes for static functions used in this file.
*/
@@ -113,7 +113,23 @@ static int latin1Table[LATIN1_MAX+1]; /* Reverse mapping table for
static void InitKeyMaps (void);
static void InitLatin1Table(Display *display);
static int XKeysymToMacKeycode(Display *display, KeySym keysym);
+static int KeycodeToUnicode(UniChar * uniChars, int maxChars,
+ UInt16 keyaction, UInt32 keycode, UInt32 modifiers,
+ UInt32 * deadKeyStatePtr);
+
+#pragma mark TKApplication(TKKeyboard)
+
+@implementation TKApplication(TKKeyboard)
+- (void) keyboardChanged: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ keyboardChanged = 1;
+}
+@end
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -144,13 +160,13 @@ InitKeyMaps(void)
Tcl_InitHashTable(&keycodeTable, TCL_ONE_WORD_KEYS);
for (kPtr = keyArray; kPtr->keycode != 0; kPtr++) {
- hPtr = Tcl_CreateHashEntry(&keycodeTable, (char *) kPtr->keycode,
+ hPtr = Tcl_CreateHashEntry(&keycodeTable, INT2PTR(kPtr->keycode),
&dummy);
Tcl_SetHashValue(hPtr, kPtr->keysym);
}
Tcl_InitHashTable(&vkeyTable, TCL_ONE_WORD_KEYS);
for (kPtr = virtualkeyArray; kPtr->keycode != 0; kPtr++) {
- hPtr = Tcl_CreateHashEntry(&vkeyTable, (char *) kPtr->keycode,
+ hPtr = Tcl_CreateHashEntry(&vkeyTable, INT2PTR(kPtr->keycode),
&dummy);
Tcl_SetHashValue(hPtr, kPtr->keysym);
}
@@ -162,10 +178,10 @@ InitKeyMaps(void)
*
* InitLatin1Table --
*
- * Creates a simple table to be used for mapping from keysyms to
- * keycodes. Always needs to be called before using latin1Table,
- * because the keyboard layout may have changed, and than the table must
- * be re-computed.
+ * Creates a simple table to be used for mapping from keysyms to keycodes.
+ * Always needs to be called before using latin1Table, because the
+ * keyboard layout may have changed, and than the table must be
+ * re-computed.
*
* Results:
* None.
@@ -180,57 +196,128 @@ static void
InitLatin1Table(
Display *display)
{
- static Boolean latin1_initialized = false;
- static SInt16 lastKeyLayoutID = -1;
+ int keycode;
+ KeySym keysym;
+ int state;
+ int modifiers;
- SInt16 keyScript;
- SInt16 keyLayoutID;
+ memset(latin1Table, 0, sizeof(latin1Table));
- keyScript = GetScriptManagerVariable(smKeyScript);
- keyLayoutID = GetScriptVariable(keyScript,smScriptKeys);
+ /*
+ * In the common X11 implementations, a keymap has four columns
+ * "plain", "Shift", "Mode_switch" and "Mode_switch + Shift". We don't
+ * use "Mode_switch", but we use "Option" instead. (This is similar to
+ * Apple's X11 implementation, where "Mode_switch" is used as an alias
+ * for "Option".)
+ *
+ * So here we go through all 4 columns of the keymap and find all
+ * Latin-1 compatible keycodes. We go through the columns back-to-front
+ * from the more exotic columns to the more simple, so that simple
+ * keycode-modifier combinations are preferred in the resulting table.
+ */
- if (!latin1_initialized || (lastKeyLayoutID != keyLayoutID)) {
- int keycode;
- KeySym keysym;
- int state;
- int modifiers;
+ for (state = 3; state >= 0; state--) {
+ modifiers = 0;
+ if (state & 1) {
+ modifiers |= shiftKey;
+ }
+ if (state & 2) {
+ modifiers |= optionKey;
+ }
- latin1_initialized = true;
- lastKeyLayoutID = keyLayoutID;
+ for (keycode = 0; keycode <= MAC_KEYCODE_MAX; keycode++) {
+ keysym = XKeycodeToKeysym(display,keycode<<16,state);
+ if (keysym <= LATIN1_MAX) {
+ latin1Table[keysym] = keycode | modifiers;
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * KeycodeToUnicode --
+ *
+ * Given MacOS key event data this function generates the Unicode
+ * characters. It does this using OS resources and APIs.
+ *
+ * The parameter deadKeyStatePtr can be NULL, if no deadkey handling is
+ * needed.
+ *
+ * This function is called from XKeycodeToKeysym() in tkMacOSKeyboard.c.
+ *
+ * Results:
+ * The number of characters generated if any, 0 if we are waiting for
+ * another byte of a dead-key sequence. Fills in the uniChars array with a
+ * Unicode string.
+ *
+ * Side Effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
- memset(latin1Table, 0, sizeof(latin1Table));
+static int
+KeycodeToUnicode(
+ UniChar *uniChars,
+ int maxChars,
+ UInt16 keyaction,
+ UInt32 keycode,
+ UInt32 modifiers,
+ UInt32 *deadKeyStatePtr)
+{
+ static const void *uchr = NULL;
+ static UInt32 keyboardType = 0;
+ UniCharCount actuallength = 0;
- /*
- * In the common X11 implementations, a keymap has four columns
- * "plain", "Shift", "Mode_switch" and "Mode_switch + Shift". We
- * don't use "Mode_switch", but we use "Option" instead. (This is
- * similar to Apple's X11 implementation, where "Mode_switch" is used
- * as an alias for "Option".)
- *
- * So here we go through all 4 columns of the keymap and find all
- * Latin-1 compatible keycodes. We go through the columns
- * back-to-front from the more exotic columns to the more simple, so
- * that simple keycode-modifier combinations are preferred in the
- * resulting table.
- */
+ if (keyboardChanged) {
+ TISInputSourceRef currentKeyboardLayout =
+ TISCopyCurrentKeyboardLayoutInputSource();
- for (state = 3; state >= 0; state--) {
- modifiers = 0;
- if (state & 1) {
- modifiers |= shiftKey;
- }
- if (state & 2) {
- modifiers |= optionKey;
- }
+ if (currentKeyboardLayout) {
+ CFDataRef keyLayoutData = (CFDataRef) TISGetInputSourceProperty(
+ currentKeyboardLayout, kTISPropertyUnicodeKeyLayoutData);
- for (keycode = 0; keycode <= MAC_KEYCODE_MAX; keycode++) {
- keysym = XKeycodeToKeysym(display,keycode<<16,state);
- if (keysym <= LATIN1_MAX) {
- latin1Table[keysym] = keycode | modifiers;
- }
+ if (keyLayoutData) {
+ uchr = CFDataGetBytePtr(keyLayoutData);
+ keyboardType = LMGetKbdType();
}
+ CFRelease(currentKeyboardLayout);
}
+ keyboardChanged = 0;
}
+ if (uchr) {
+ OptionBits options = 0;
+ UInt32 dummyState;
+ OSStatus err;
+
+ keycode &= 0xFF;
+ modifiers = (modifiers >> 8) & 0xFF;
+
+ if (!deadKeyStatePtr) {
+ options = kUCKeyTranslateNoDeadKeysMask;
+ dummyState = 0;
+ deadKeyStatePtr = &dummyState;
+ }
+
+ err = ChkErr(UCKeyTranslate, uchr, keycode, keyaction, modifiers,
+ keyboardType, options, deadKeyStatePtr, maxChars,
+ &actuallength, uniChars);
+
+ if (!actuallength && *deadKeyStatePtr) {
+ /*
+ * More data later
+ */
+
+ return 0;
+ }
+ *deadKeyStatePtr = 0;
+ if (err != noErr) {
+ actuallength = 0;
+ }
+ }
+ return actuallength;
}
/*
@@ -267,21 +354,21 @@ XKeycodeToKeysym(
}
/*
- * 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
- * ASCII and Latin-1 chars.
+ * 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 ASCII and
+ * Latin-1 chars.
*/
newKeycode = keycode >> 16;
- if ((keycode & 0xFFFF) == 0x10) {
- hPtr = Tcl_FindHashEntry(&vkeyTable, (char *) newKeycode);
+ if ((keycode & 0xFFFF) >= 0xF700) { /* NSEvent.h function key unicodes */
+ hPtr = Tcl_FindHashEntry(&vkeyTable, INT2PTR(newKeycode));
if (hPtr != NULL) {
return (KeySym) Tcl_GetHashValue(hPtr);
}
}
- hPtr = Tcl_FindHashEntry(&keycodeTable, (char *) newKeycode);
+ hPtr = Tcl_FindHashEntry(&keycodeTable, INT2PTR(newKeycode));
if (hPtr != NULL) {
return (KeySym) Tcl_GetHashValue(hPtr);
}
@@ -298,13 +385,12 @@ XKeycodeToKeysym(
}
newChar = 0;
- TkMacOSXKeycodeToUnicode(
- &newChar, 1, kEventRawKeyDown,
- newKeycode & 0x00FF, newKeycode & 0xFF00, NULL);
+ KeycodeToUnicode(&newChar, 1, kUCKeyActionDown, newKeycode & 0x00FF,
+ newKeycode & 0xFF00, NULL);
/*
- * X11 keysyms are identical to Unicode for ASCII and Latin-1. Give up
- * for other characters for now.
+ * X11 keysyms are identical to Unicode for ASCII and Latin-1. Give up for
+ * other characters for now.
*/
if ((newChar >= XK_space) && (newChar <= LATIN1_MAX)) {
@@ -330,7 +416,7 @@ XKeycodeToKeysym(
*----------------------------------------------------------------------
*/
-char *
+const char *
TkpGetString(
TkWindow *winPtr, /* Window where event occurred: Needed to get
* input context. */
@@ -361,18 +447,18 @@ TkpGetString(
XModifierKeymap *
XGetModifierMapping(
- Display* display)
+ Display *display)
{
- XModifierKeymap * modmap;
+ XModifierKeymap *modmap;
(void) display; /*unused*/
/*
- * MacOSX doesn't use the key codes for the modifiers for anything, and
- * we don't generate them either. So there is no modifier map.
+ * MacOSX doesn't use the key codes for the modifiers for anything, and we
+ * don't generate them either. So there is no modifier map.
*/
- modmap = (XModifierKeymap *) ckalloc(sizeof(XModifierKeymap));
+ modmap = ckalloc(sizeof(XModifierKeymap));
modmap->max_keypermod = 0;
modmap->modifiermap = NULL;
return modmap;
@@ -399,9 +485,9 @@ XFreeModifiermap(
XModifierKeymap *modmap)
{
if (modmap->modifiermap != NULL) {
- ckfree((char *) modmap->modifiermap);
+ ckfree(modmap->modifiermap);
}
- ckfree((char *) modmap);
+ ckfree(modmap);
}
/*
@@ -410,9 +496,9 @@ XFreeModifiermap(
* XKeysymToString, XStringToKeysym --
*
* These X window functions map keysyms to strings & strings to keysyms.
- * However, Tk already does this for the most common keysyms.
- * Therefore, these functions only need to support keysyms that will be
- * specific to the Macintosh. Currently, there are none.
+ * However, Tk already does this for the most common keysyms. Therefore,
+ * these functions only need to support keysyms that will be specific to
+ * the Macintosh. Currently, there are none.
*
* Results:
* None.
@@ -442,8 +528,8 @@ XStringToKeysym(
*
* XKeysymToMacKeycode --
*
- * An internal function like XKeysymToKeycode but only generating the
- * Mac specific keycode plus the modifiers Shift and Option.
+ * An internal function like XKeysymToKeycode but only generating the Mac
+ * specific keycode plus the modifiers Shift and Option.
*
* Results:
* A Mac keycode with the actual keycode in the low byte and Mac-style
@@ -460,45 +546,44 @@ XKeysymToMacKeycode(
Display *display,
KeySym keysym)
{
- if (keysym <= LATIN1_MAX) {
+ KeyInfo *kPtr;
+ if (keysym <= LATIN1_MAX) {
/*
* Handle keysyms in the Latin-1 range where keysym and Unicode
* character code point are the same.
*/
- InitLatin1Table(display);
+ if (keyboardChanged) {
+ InitLatin1Table(display);
+ keyboardChanged = 0;
+ }
return latin1Table[keysym];
+ }
- } else {
-
- /*
- * Handle special keys from our exception tables. Don't mind if this
- * is slow, neither the test suite nor [event generate] need to be
- * optimized (we hope).
- */
-
- KeyInfo *kPtr;
+ /*
+ * Handle special keys from our exception tables. Don't mind if this is
+ * slow, neither the test suite nor [event generate] need to be optimized
+ * (we hope).
+ */
- for (kPtr = keyArray; kPtr->keycode != 0; kPtr++) {
- if (kPtr->keysym == keysym) {
- return kPtr->keycode;
- }
+ for (kPtr = keyArray; kPtr->keycode != 0; kPtr++) {
+ if (kPtr->keysym == keysym) {
+ return kPtr->keycode;
}
- for (kPtr = virtualkeyArray; kPtr->keycode != 0; kPtr++) {
- if (kPtr->keysym == keysym) {
- return kPtr->keycode;
- }
+ }
+ for (kPtr = virtualkeyArray; kPtr->keycode != 0; kPtr++) {
+ if (kPtr->keysym == keysym) {
+ return kPtr->keycode;
}
+ }
- /*
- * For other keysyms (not Latin-1 and not special keys), we'd need a
- * generic keysym-to-unicode table. We don't have that, so we give
- * up here.
- */
+ /*
+ * For other keysyms (not Latin-1 and not special keys), we'd need a
+ * generic keysym-to-unicode table. We don't have that, so we give up here.
+ */
- return 0;
- }
+ return 0;
}
/*
@@ -506,9 +591,9 @@ XKeysymToMacKeycode(
*
* XKeysymToKeycode --
*
- * The function XKeysymToKeycode takes an X11 keysym and converts it
- * into a Mac keycode. It is in the stubs table for compatibility but
- * not used anywhere in the core.
+ * The function XKeysymToKeycode takes an X11 keysym and converts it into
+ * a Mac keycode. It is in the stubs table for compatibility but not used
+ * anywhere in the core.
*
* Results:
* A 32 bit keycode with the the mac keycode (without modifiers) in the
@@ -544,32 +629,6 @@ XKeysymToKeycode(
return result;
}
-
-/*
-NB: Keep this commented code for a moment for reference.
-
- 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;
-*/
/*
*----------------------------------------------------------------------
@@ -578,8 +637,8 @@ NB: Keep this commented code for a moment for reference.
*
* The function TkpSetKeycodeAndState takes a keysym and fills in the
* appropriate members of an XEvent. It is similar to XKeysymToKeycode,
- * but it also sets the modifier mask in the XEvent. It is used by
- * [event generate] and it is in the stubs table.
+ * but it also sets the modifier mask in the XEvent. It is used by [event
+ * generate] and it is in the stubs table.
*
* Results:
* Fills an XEvent, sets the member xkey.keycode with a keycode
@@ -624,8 +683,8 @@ TkpSetKeycodeAndState(
}
if (keysym <= LATIN1_MAX) {
- int done;
- done = Tcl_UniCharToUtf(keysym,eventPtr->xkey.trans_chars);
+ int done = Tcl_UniCharToUtf(keysym, eventPtr->xkey.trans_chars);
+
eventPtr->xkey.trans_chars[done] = 0;
} else {
eventPtr->xkey.trans_chars[0] = 0;
@@ -675,28 +734,30 @@ TkpGetKeySym(
if (eventPtr->xany.send_event == -1) {
int modifier = eventPtr->xkey.keycode;
- if (modifier == cmdKey) {
+
+ if (modifier == NSCommandKeyMask) {
return XK_Meta_L;
- } else if (modifier == shiftKey) {
+ } else if (modifier == NSShiftKeyMask) {
return XK_Shift_L;
- } else if (modifier == alphaLock) {
+ } else if (modifier == NSAlphaShiftKeyMask) {
return XK_Caps_Lock;
- } else if (modifier == optionKey) {
+ } else if (modifier == NSAlternateKeyMask) {
return XK_Alt_L;
- } else if (modifier == controlKey) {
+ } else if (modifier == NSControlKeyMask) {
return XK_Control_L;
- } else if (modifier == kEventKeyModifierNumLockMask) {
+ } else if (modifier == NSNumericPadKeyMask) {
return XK_Num_Lock;
- } else if (modifier == kEventKeyModifierFnMask) {
+ } else if (modifier == NSFunctionKeyMask) {
return XK_Super_L;
+/*
} else if (modifier == rightShiftKey) {
return XK_Shift_R;
} else if (modifier == rightOptionKey) {
return XK_Alt_R;
} else if (modifier == rightControlKey) {
return XK_Control_R;
+*/
} else {
-
/*
* If we get here, we probably need to implement something new.
*/
@@ -705,11 +766,17 @@ TkpGetKeySym(
}
}
+#if 0
+ if (eventPtr->xkey.nbytes) {
+ return eventPtr->xkey.nbytes;
+ }
+#endif
+
/*
- * 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. (Note: We use "Option" in keymap columns 2 and 3
- * where other implementations have "Mode_switch".)
+ * 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. (Note: We use "Option" in keymap columns 2 and 3 where other
+ * implementations have "Mode_switch".)
*/
index = 0;
@@ -727,7 +794,7 @@ TkpGetKeySym(
if ((eventPtr->xkey.state & ShiftMask)
|| (/* (dispPtr->lockUsage != LU_IGNORE)
- && */ (eventPtr->xkey.state & LockMask))) {
+ && */ (eventPtr->xkey.state & LockMask))) {
index |= 1;
}
@@ -739,17 +806,16 @@ TkpGetKeySym(
/*
* 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.
+ * 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)*/ ) {
-
/*
- * FIXME: Keysyms are only identical to Unicode for ASCII and
- * Latin-1, so we can't use Tcl_UniCharIsUpper() for keysyms outside
- * that range. This may be a serious problem here.
+ * FIXME: Keysyms are only identical to Unicode for ASCII and Latin-1,
+ * so we can't use Tcl_UniCharIsUpper() for keysyms outside that range.
+ * This may be a serious problem here.
*/
if ((sym == NoSymbol) || (sym > LATIN1_MAX)
@@ -777,9 +843,9 @@ TkpGetKeySym(
*
* 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 the "Mode_switch" keysym.
+ * 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 the "Mode_switch" keysym.
*
* Results:
* None.
@@ -799,8 +865,8 @@ TkpInitKeymapInfo(
/*
* Behaviours that are variable on X11 are defined constant on MacOSX.
- * lockUsage is only used above in TkpGetKeySym(), nowhere else
- * currently. There is no offical "Mode_switch" key.
+ * lockUsage is only used above in TkpGetKeySym(), nowhere else currently.
+ * There is no offical "Mode_switch" key.
*/
dispPtr->lockUsage = LU_CAPS;
@@ -824,15 +890,24 @@ TkpInitKeymapInfo(
/*
* MacOSX doesn't use the keycodes for the modifiers for anything, and we
- * don't generate them either (the keycodes actually given in the
- * simulated modifier events are bogus). So there is no modifier map.
- * If we ever want to simulate real modifier keycodes, the list will be
- * constant in the Carbon implementation.
+ * don't generate them either (the keycodes actually given in the simulated
+ * modifier events are bogus). So there is no modifier map. If we ever want
+ * to simulate real modifier keycodes, the list will be constant in the
+ * Carbon implementation.
*/
if (dispPtr->modKeyCodes != NULL) {
- ckfree((char *) dispPtr->modKeyCodes);
+ ckfree(dispPtr->modKeyCodes);
}
dispPtr->numModKeyCodes = 0;
dispPtr->modKeyCodes = NULL;
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 386fe50..19db490 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -4,8 +4,8 @@
* This module implements the Mac-platform specific features of menus.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,6 +16,7 @@
#include "tkMenu.h"
#include "tkColor.h"
#include "tkFont.h"
+#include "tkMacOSXWm.h"
#include "tkMacOSXDebug.h"
/*
@@ -24,1564 +25,491 @@
#endif
*/
-#define USE_TK_MDEF
-
-typedef struct MacMenu {
- MenuRef menuHdl; /* The Menu Manager data structure. */
-#ifdef USE_TK_MDEF
- int useMDEF; /* true if this menu uses the MDEF */
-#endif
-} MacMenu;
-
-typedef struct MenuEntryUserData {
- Drawable mdefDrawable;
- TkMenuEntry *mePtr;
- Tk_Font tkfont;
- Tk_FontMetrics *fmPtr;
-} MenuEntryUserData;
-
-/*
- * 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)
-#define MODIFIER_NUM 4
-
-/*
- * 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. */
- int modifierNum; /* Number of modifiers */
- Tcl_UniChar modifierUniChars[MODIFIER_NUM];
- /* Modifiers in unicode */
- char accelGlyph; /* Accelerator glyph, if any */
-} 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 MENUBAR_REDRAW_PENDING 1
-
-static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as the
- * flag that Tk is not to draw any menus. */
-
-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 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 int menuBarFlags; /* Used for whether the menu bar needs
- * redrawing or not. */
-
-struct MenuCommandHandlerData { /* This is the ClientData we pass to */
- TkMenu *menuPtr; /* Tcl_DoWhenIdle to move handling */
- int index; /* menu commands to the event loop. */
+#define ENTRY_HELP_MENU ENTRY_PLATFORM_FLAG1
+#define ENTRY_APPLE_MENU ENTRY_PLATFORM_FLAG2
+#define ENTRY_WINDOWS_MENU ENTRY_PLATFORM_FLAG3
+
+#define sl(s) ((int) (sizeof(s "") - 1))
+
+#define SPECIALMENU(n, f) {.name = "." #n, .len = sl(#n) + 1, \
+ .flag = ENTRY_##f##_MENU }
+static const struct {
+ const char *name; const size_t len; const int flag;
+} specialMenus[] = {
+ SPECIALMENU(help, HELP),
+ SPECIALMENU(apple, APPLE),
+ SPECIALMENU(window, WINDOWS),
+ {NULL}
};
-
-static TopLevelMenubarList *windowListPtr;
- /* A list of windows that have menubars set. */
-
-/*
- * Array of unicode, charcode and utf representations of the most common
- * special menu symbols.
- */
-typedef struct MenuSymbol {
- const Tcl_UniChar unicode;
- const char charCode;
- /* char padding; */
- int utfLen, width;
- char utf[TCL_UTF_MAX + 1];
-} MenuSymbol;
-
-static MenuSymbol menuSymbols[] = {
- {kCommandUnicode, kCommandCharCode},
- {kOptionUnicode, kMenuOptionGlyph},
- {kControlUnicode, kMenuControlGlyph},
- {kShiftUnicode, kMenuShiftGlyph},
- {kCheckUnicode, kCheckCharCode},
- {kDiamondUnicode, kDiamondCharCode},
- {kBulletUnicode, kBulletCharCode},
- {0x2026, kNullCharCode},
- {0, 0},
+#undef SPECIALMENU
+
+#define MODIFIER(n, f) {.name = #n, .len = sl(#n), .mask = f }
+static const struct {
+ const char *name; const size_t len; const NSUInteger mask;
+} modifiers[] = {
+ MODIFIER(Control, NSControlKeyMask),
+ MODIFIER(Ctrl, NSControlKeyMask),
+ MODIFIER(Option, NSAlternateKeyMask),
+ MODIFIER(Opt, NSAlternateKeyMask),
+ MODIFIER(Alt, NSAlternateKeyMask),
+ MODIFIER(Shift, NSShiftKeyMask),
+ MODIFIER(Command, NSCommandKeyMask),
+ MODIFIER(Cmd, NSCommandKeyMask),
+ MODIFIER(Meta, NSCommandKeyMask),
+ {NULL}
};
-
-enum MenuSymbolIdx {
- COMMAND_SYMBOL,
- OPTION_SYMBOL,
- CONTROL_SYMBOL,
- SHIFT_SYMBOL,
- CHECK_SYMBOL,
- DIAMDOND_SYMBOL,
- BULLET_SYMBOL,
- ELLIPSIS_SYMBOL,
+#undef MODIFIER
+
+#define ACCEL(n, c) {.name = #n, .len = sl(#n), .ch = c }
+static const struct {
+ const char *name; const size_t len; const UniChar ch;
+} specialAccelerators[] = {
+ ACCEL(PageUp, NSPageUpFunctionKey),
+ ACCEL(PageDown, NSPageDownFunctionKey),
+ ACCEL(Left, NSLeftArrowFunctionKey),
+ ACCEL(Right, NSRightArrowFunctionKey),
+ ACCEL(Up, NSUpArrowFunctionKey),
+ ACCEL(Down, NSDownArrowFunctionKey),
+ ACCEL(Escape, 0x001b),
+ ACCEL(Clear, NSClearDisplayFunctionKey),
+ ACCEL(Enter, NSEnterCharacter),
+ ACCEL(Backspace, NSBackspaceCharacter),
+ ACCEL(Space, ' '),
+ ACCEL(Tab, NSTabCharacter),
+ ACCEL(BackTab, NSBackTabCharacter),
+ ACCEL(Delete, NSDeleteCharacter),
+ ACCEL(Home, NSHomeFunctionKey),
+ ACCEL(End, NSEndFunctionKey),
+ ACCEL(Return, NSCarriageReturnCharacter),
+ ACCEL(Help, NSHelpFunctionKey),
+ ACCEL(Power, 0x233d),
+ ACCEL(Eject, 0xf804),
+ {NULL}
};
+#undef ACCEL
+#undef sl
-MenuRef tkCurrentAppleMenu = NULL;
-
-static SInt32 menuMarkColumnWidth = 0, menuMarkIndent = 0;
+static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as
+ * the flag that Tk is not to draw any
+ * menus. */
+static int inPostMenu = 0;
+static unsigned long defaultBg = 0, defaultFg = 0;
+static SInt32 menuMarkColumnWidth = 0, menuIconTrailingEdgeMargin = 0;
static SInt32 menuTextLeadingEdgeMargin = 0, menuTextTrailingEdgeMargin = 0;
static SInt16 menuItemExtraHeight = 0, menuItemExtraWidth = 0;
static SInt16 menuSeparatorHeight = 0;
-/*
- * Forward declarations for procedures defined later in this file:
- */
-
-MODULE_SCOPE int TkMacOSXGetNewMenuID(Tcl_Interp *interp, TkMenu *menuInstPtr,
- int cascade, short *menuIDPtr);
-MODULE_SCOPE void TkMacOSXFreeMenuID(short menuID);
-
-static void CompleteIdlers(TkMenu *menuPtr);
-static void DrawMenuBarWhenIdle(ClientData clientData);
-static void DrawMenuEntryAccelerator(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(TkMenu *menuPtr, TkMenuEntry *mePtr,
- Drawable d, Tk_3DBorder activeBorder, Tk_3DBorder bgBorder, int x,
- int y, int width, int heigth);
-static void DrawMenuEntryIndicator(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(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(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(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 EventuallyInvokeMenu(ClientData data);
-static void GetEntryText(TkMenuEntry *mePtr, Tcl_DString *dStringPtr);
-static void GetMenuAccelGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr,
- Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *modWidthPtr,
- int *textWidthPtr, int *heightPtr);
-static void GetMenuLabelGeometry(TkMenuEntry *mePtr, Tk_Font tkfont,
- const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr);
-static void GetMenuIndicatorGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr,
- Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr,
- int *heightPtr);
-static void GetMenuSeparatorGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr,
- Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr,
- int *heightPtr);
-static TkMenuEntry* GetParentMenuEntry(TkMenu *menuPtr);
-static void GetTearoffEntryGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr,
- Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr,
- int *heightPtr);
-static char FindMarkCharacter(TkMenuEntry *mePtr);
-static int GetUtfMarkCharacter(char markChar, const char **markUtfPtr);
-static TkMenu* MenuPtrForMenuRef(MenuRef menu);
-static int ParseAccelerators(const char **accelStringPtr, int *modifierNumPtr,
- Tcl_UniChar *modifierUniChars, int *modifierWidth);
-static void MenuSelectEvent(TkMenu *menuPtr);
-static void ReconfigureIndividualMenu(TkMenu *menuPtr, MenuHandle macMenuHdl,
- int base);
-static void ReconfigureMacintoshMenu(ClientData clientData);
-static void RecursivelyClearActiveMenu(TkMenu *menuPtr);
-static void RecursivelyDeleteMenu(TkMenu *menuPtr);
-static void RecursivelyInsertMenu(TkMenu *menuPtr);
-static void SetDefaultMenubar(void);
-static int SetMenuCascade(TkMenu *menuPtr);
-
-#ifdef USE_TK_MDEF
-#define SCREEN_MARGIN 5
-static MacDrawable macMDEFDrawable;
- /* Drawable for use by MDEF code */
-static int MDEFScrollFlag = 0; /* Used so that popups don't scroll too soon.*/
-static MenuItemDrawingUPP tkThemeMenuItemDrawingUPP;
- /* Points to the UPP for theme Item drawing. */
-static Tcl_Obj *useMDEFVar;
-
-static void DrawMenuBackground(TkMenu *menuPtr, Rect *menuRectPtr,
- Drawable d);
-static void MenuDefProc(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 HandleMenuFindItemMsg(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 AppearanceEntryDrawWrapper(TkMenuEntry *mePtr, Rect * menuRectPtr,
- MenuTrackingData *mtdPtr, Drawable d, Tk_FontMetrics *fmPtr,
- Tk_Font tkfont, int erase);
-static pascal void ThemeMenuItemDrawingProc(const Rect *inBounds,
- SInt16 inDepth, Boolean inIsColorDevice, SInt32 inUserData);
-#else /* USE_TK_MDEF */
-# define useMDEF 0
-#endif /* USE_TK_MDEF */
-
-#define IS_THEME_MENU_FONT(tkfont) (strcmp(Tk_NameOfFont(tkfont), "menu") == 0)
-
-
-/*
- *----------------------------------------------------------------------
- *
- * DrawThemeText --
- *
- * Wrapper for DrawThemeTextBox API.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
+static void CheckForSpecialMenu(TkMenu *menuPtr);
+static NSString *ParseAccelerator(const char *accel, NSUInteger *maskPtr);
+static int GenerateMenuSelectEvent(TKMenu *menu, NSMenuItem *menuItem);
+static void MenuSelectEvent(TkMenu *menuPtr);
+static void RecursivelyClearActiveMenu(TkMenu *menuPtr);
+static int ModifierCharWidth(Tk_Font tkfont);
+
+#pragma mark TKMenu
+
+@interface TKMenu(TKMenuPrivate)
+- (id) initWithTkMenu: (TkMenu *) tkMenu;
+- (TkMenu *) tkMenu;
+- (int) tkIndexOfItem: (NSMenuItem *) menuItem;
+- (void) insertItem: (NSMenuItem *) newItem atTkIndex: (NSInteger) index;
+@end
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+#define TKMenu_NSMenuDelegate <NSMenuDelegate>
+#else
+#define TKMenu_NSMenuDelegate
+#endif
+@interface TKMenu(TKMenuDelegate) TKMenu_NSMenuDelegate
+@end
-static void
-DrawThemeText(
- Drawable d,
- GC gc,
- CFStringRef string,
- ThemeFontID font,
- ThemeDrawState drawState,
- const Rect* bounds,
- int baseline,
- int just)
+@implementation TKMenu
+- (void) setSpecial: (NSUInteger) special
{
- TkMacOSXDrawingContext dc;
- Rect adjustedBounds;
-
- /*
- * Menu item text drawn with the .Keyboard font (used for
- * kThemeMenuItemCmdKeyFont) won't always have the same ascent and
- * baseline as text drawn with the regular menu item font, since the
- * glyphs in the .Keyboard font may have a different height. Therefore, we
- * first determine the baseline of the text and then adjust the bounds
- * rect so the baseline aligns with the overall baseline of the menu item.
- */
- if (font == kThemeMenuItemCmdKeyFont) {
- Point size;
- SInt16 cmdKeyBaseline;
-
- GetThemeTextDimensions(string, font, drawState, false, &size,
- &cmdKeyBaseline);
- adjustedBounds = *bounds;
- OffsetRect(&adjustedBounds, 0, baseline - bounds->top - size.v -
- cmdKeyBaseline);
- bounds = &adjustedBounds;
- }
- if (TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
- ChkErr(DrawThemeTextBox, string, font, drawState, false, bounds, just,
- dc.context);
- TkMacOSXRestoreDrawingContext(&dc);
- }
+ NSAssert(!_tkSpecial, @"Cannot change specialness of a special menu");
+ _tkSpecial = special;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * MeasureThemeText --
- *
- * Wrapper for GetThemeTextDimensions API.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-MeasureThemeText(
- CFStringRef string,
- ThemeFontID font)
+- (BOOL) isSpecial: (NSUInteger) special
{
- Point pt;
-
- ChkErr(GetThemeTextDimensions, string, font, kThemeStateActive, false, &pt,
- NULL);
- return pt.h;
+ return (_tkSpecial == special);
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
+@end
-int
-TkMacOSXUseMenuID(
- short macID) /* The id to take out of the table */
+@implementation TKMenu(TKMenuPrivate)
+
+- (id) initWithTitle: (NSString *) aTitle
{
- Tcl_HashEntry *commandEntryPtr;
- int newEntry;
- int iMacID = macID; /* Do this to remove compiler warning */
-
- TkMenuInit();
- commandEntryPtr = Tcl_CreateHashEntry(&commandTable, (char *) iMacID,
- &newEntry);
- if (!newEntry) {
- return TCL_ERROR;
+ self = [super initWithTitle:aTitle];
+ if (self) {
+ _tkMenu = NULL;
+ _tkOffset = 0;
+ _tkItemCount = 0;
+ _tkSpecial = 0;
+ [self setDelegate:self];
}
- Tcl_SetHashValue(commandEntryPtr, NULL);
- return TCL_OK;
+ return self;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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 */
+- (id) initWithTkMenu: (TkMenu *) tkMenu
{
- 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;
+ NSString *title = [[NSString alloc] initWithUTF8String:
+ Tk_PathName(tkMenu->tkwin)];
- 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_ResetResult(interp);
- Tcl_AppendResult(interp, "No more menus can be allocated.", NULL);
- return TCL_ERROR;
+ self = [self initWithTitle:title];
+ [title release];
+ if (self) {
+ _tkMenu = tkMenu;
}
- Tcl_SetHashValue(commandEntryPtr, (char *) menuPtr);
- *menuIDPtr = returnID;
- return TCL_OK;
+ return self;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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 */
+- (id) copyWithZone: (NSZone *) zone
{
- Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&commandTable,
- (char*)(intptr_t)menuID);
+ TKMenu *copy = [super copyWithZone:zone];
- if (entryPtr != NULL) {
- Tcl_DeleteHashEntry(entryPtr);
- }
- if (menuID == currentAppleMenuID) {
- currentAppleMenuID = 0;
- }
- if (menuID == currentHelpMenuID) {
- currentHelpMenuID = 0;
- }
+ NSAssert(_tkMenu == nil, @"Cannot copy tkMenu");
+ copy->_tkMenu = _tkMenu;
+ copy->_tkOffset = _tkOffset;
+ copy->_tkItemCount = _tkItemCount;
+ copy->_tkSpecial = _tkSpecial;
+ return copy;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * MenuPtrForMenuRef --
- *
- * Returns a pointer to the TkMenu corresponding to a given
- * Carbon MenuRef.
- *
- * Results:
- * Returns a pointer to a TkMenu or NULL.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-TkMenu*
-MenuPtrForMenuRef(
- MenuRef menu)
+- (TkMenu *) tkMenu
{
- TkMenu *menuPtr = NULL;
- MenuID menuID = GetMenuID(menu);
- Tcl_HashEntry *commandEntryPtr = Tcl_FindHashEntry(&commandTable,
- (char*)(intptr_t)menuID);
-
- if (commandEntryPtr) {
- menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
- }
- return menuPtr;
+ return _tkMenu;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetParentMenuEntry --
- *
- * Returns a pointer to the parent's TkMenuEntry of a given TkMenu.
- *
- * Results:
- * Returns a pointer to a TkMenuEntry or NULL.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-TkMenuEntry*
-GetParentMenuEntry(
- TkMenu *menuPtr)
+- (int) tkIndexOfItem: (NSMenuItem *) menuItem
{
- TkMenuEntry *cascadeEntryPtr;
+ return [self indexOfItem:menuItem] - _tkOffset;
+}
- for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr;
- cascadeEntryPtr != NULL;
- cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
- const char *name = (cascadeEntryPtr->namePtr == NULL) ? ""
- : Tcl_GetString(cascadeEntryPtr->namePtr);
+- (void) insertItem: (NSMenuItem *) newItem atTkIndex: (NSInteger) index
+{
+ [super insertItem:newItem atIndex:index + _tkOffset];
+ _tkItemCount++;
+}
- if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) {
- break;
+- (void) insertItem: (NSMenuItem *) newItem atIndex: (NSInteger) index
+{
+ if (_tkMenu && index >= 0) {
+ if ((NSUInteger)index <= _tkOffset) {
+ _tkOffset++;
+ } else {
+ NSAssert((NSUInteger)index >= _tkItemCount + _tkOffset,
+ @"Cannot insert in the middle of Tk menu");
}
}
- return cascadeEntryPtr;
+ [super insertItem:newItem atIndex:index];
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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. */
+- (void) removeItemAtIndex: (NSInteger) index
{
- short menuID;
- MenuRef macMenuHdl;
-#ifdef USE_TK_MDEF
- MenuDefSpec menuDefSpec;
- Tcl_Obj *useMDEFObjPtr;
- int useMDEF = 1;
-#endif
- int error = TCL_OK;
- OSStatus err;
- CFStringRef cfStr;
-
- error = TkMacOSXGetNewMenuID(menuPtr->interp, menuPtr, 0, &menuID);
- if (error != TCL_OK) {
- return error;
- }
- err = ChkErr(CreateNewMenu, menuID, kMenuAttrDoNotUseUserCommandKeys,
- &macMenuHdl);
- if (err != noErr) {
- Tcl_AppendResult(menuPtr->interp, "CreateNewMenu failed.", NULL);
- return TCL_ERROR;
- }
- cfStr = CFStringCreateWithCString(NULL, Tk_PathName(menuPtr->tkwin),
- kCFStringEncodingUTF8);
- if (!cfStr) {
- Tcl_AppendResult(menuPtr->interp, "CFStringCreateWithCString failed.",
- NULL);
- return TCL_ERROR;
- }
- err = ChkErr(SetMenuTitleWithCFString, macMenuHdl, cfStr);
- CFRelease(cfStr);
- if (err != noErr) {
- Tcl_AppendResult(menuPtr->interp, "SetMenuTitleWithCFString failed.",
- NULL);
- return TCL_ERROR;
+ if (_tkMenu && index >= 0) {
+ if ((NSUInteger)index < _tkOffset) {
+ _tkOffset--;
+ } else if ((NSUInteger)index < _tkItemCount + _tkOffset) {
+ _tkItemCount--;
+ }
}
+ [super removeItemAtIndex:index];
+}
- menuPtr->platformData = (TkMenuPlatformData) ckalloc(sizeof(MacMenu));
- ((MacMenu *) menuPtr->platformData)->menuHdl = macMenuHdl;
+- (NSMenuItem *) newTkMenuItem: (TkMenuEntry *) mePtr
+{
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@""
+ action:@selector(tkMenuItemInvoke:) keyEquivalent:@""];
-#ifdef USE_TK_MDEF
- /*
- * 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.
- */
+ [menuItem setTarget:self];
+ [menuItem setTag:(NSInteger)mePtr];
+ return menuItem;
+}
+@end
- 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;
- ChkErr(SetMenuDefinition, macMenuHdl, &menuDefSpec);
- }
- ((MacMenu *) menuPtr->platformData)->useMDEF = useMDEF;
-#endif /* USE_TK_MDEF */
-
- 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, NULL);
- menuBarFlags |= MENUBAR_REDRAW_PENDING;
- }
- }
- }
- }
+@implementation TKMenu(TKMenuActions)
+// target methods
- menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
- Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
- return TCL_OK;
+- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
+{
+ return [menuItem isEnabled];
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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 */
+- (void) tkMenuItemInvoke: (id) sender
{
- MenuRef macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ /*
+ * With the delegate matching key equivalents, when a menu action is sent
+ * in response to a key equivalent, sender is the whole menu and not the
+ * the specific menu item, use this to ignore key equivalents for our
+ * menus (as Tk handles them directly via bindings).
+ */
- 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 ([sender isKindOfClass:[NSMenuItem class]]) {
+ NSMenuItem *menuItem = (NSMenuItem *)sender;
+ TkMenu *menuPtr = (TkMenu *)_tkMenu;
+ TkMenuEntry *mePtr = (TkMenuEntry *)[menuItem tag];
+
+ if (menuPtr && mePtr) {
+ Tcl_Interp *interp = menuPtr->interp;
+ /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/
+ Tcl_Sleep(100);
+
+ Tcl_Preserve(interp);
+ Tcl_Preserve(menuPtr);
- if ((HMGetHelpMenu(&helpMenuHdl,&helpIndex) == noErr)
- && (helpMenuHdl != NULL)) {
- int i, count = CountMenuItems(helpMenuHdl);
+ int result = TkInvokeMenu(interp, menuPtr, mePtr->index);
- for (i = helpIndex; i <= count; i++) {
- DeleteMenuItem(helpMenuHdl, helpIndex);
+ if (result != TCL_OK && result != TCL_CONTINUE &&
+ result != TCL_BREAK) {
+ Tcl_AddErrorInfo(interp, "\n (menu invoke)");
+ Tcl_BackgroundException(interp, result);
}
+ Tcl_Release(menuPtr);
+ Tcl_Release(interp);
}
- currentHelpMenuID = 0;
- }
- if (menuPtr->platformData != NULL) {
- 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.
- *
- *----------------------------------------------------------------------
- */
+@end
-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.
- *
- *----------------------------------------------------------------------
- */
+@implementation TKMenu(TKMenuDelegate)
+#define keyEquivModifiersMatch(km, m) (( \
+ ((km) & NSCommandKeyMask) != ((m) & NSCommandKeyMask) || \
+ ((km) & NSAlternateKeyMask) != ((m) & NSAlternateKeyMask) || \
+ ((km) & NSControlKeyMask) != ((m) & NSControlKeyMask) || \
+ (((km) & NSShiftKeyMask) != ((m) & NSShiftKeyMask) && \
+ ((m) & NSFunctionKeyMask))) ? NO : YES)
-void
-TkpDestroyMenuEntry(
- TkMenuEntry *mePtr) /* The common structure for the menu entry. */
+- (BOOL) menuHasKeyEquivalent: (NSMenu *) menu forEvent: (NSEvent *) event
+ target: (id *) target action: (SEL *) action
{
- TkMenu *menuPtr = mePtr->menuPtr;
+ /*Use lowercaseString to keep "shift" from firing twice if bound to different procedure.*/
+ NSString *key = [[event charactersIgnoringModifiers] lowercaseString];
+ NSUInteger modifiers = [event modifierFlags] &
+ NSDeviceIndependentModifierFlagsMask;
- ckfree((char *) mePtr->platformEntryData);
- if ((menuPtr->platformData != NULL)
- && !(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
- menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
- Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ if (modifiers == (NSCommandKeyMask | NSShiftKeyMask) &&
+ [key compare:@"?"] == NSOrderedSame) {
+ return NO;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
-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. */
-{
-#ifdef USE_TK_MDEF
- const int useMDEF = ((MacMenu *) mePtr->menuPtr->platformData)->useMDEF;
-#endif
- int noLabel = (mePtr->labelPtr == NULL || mePtr->labelLength == 0);
-
- Tcl_DStringInit(dStringPtr);
- if (mePtr->type == TEAROFF_ENTRY && (useMDEF || noLabel)) {
- Tcl_DStringAppend(dStringPtr, "(Tear-off)", -1);
- } else if (mePtr->imagePtr != NULL && (useMDEF || noLabel) &&
- mePtr->compound == COMPOUND_NONE) {
- Tcl_DStringAppend(dStringPtr, "(Image)", -1);
- } else if (mePtr->bitmapPtr != NULL && (useMDEF || noLabel) &&
- mePtr->compound == COMPOUND_NONE) {
- Tcl_DStringAppend(dStringPtr, "(Pixmap)", -1);
- } else if (noLabel) {
- /*
- * 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) == '.') && (*(text+2) == '.')) {
- Tcl_DStringAppend(dStringPtr, menuSymbols[ELLIPSIS_SYMBOL].utf,
- menuSymbols[ELLIPSIS_SYMBOL].utfLen);
- i += menuSymbols[ELLIPSIS_SYMBOL].utfLen - 1;
- text += 2;
- } else {
- Tcl_DStringSetLength(dStringPtr,
- Tcl_DStringLength(dStringPtr) + 1);
- dStringText = Tcl_DStringValue(dStringPtr);
- dStringText[i] = *text;
+ NSArray *itemArray = [self itemArray];
+
+ for (NSMenuItem *item in itemArray) {
+ if ([item isEnabled] && [[item keyEquivalent] compare:key] ==
+ NSOrderedSame) {
+ NSUInteger keyEquivModifiers = [item keyEquivalentModifierMask];
+
+ if (keyEquivModifiersMatch(keyEquivModifiers, modifiers)) {
+ *target = [item target];
+ *action = [item action];
+ return YES;
}
}
}
+ return NO;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- * Results:
- * Mark char.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-char
-FindMarkCharacter(
- TkMenuEntry *mePtr) /* The entry we are finding the character
- * for. */
+- (void) menuWillOpen: (NSMenu *) menu
{
- static const char markChars[] = {kCheckCharCode, kDiamondCharCode,
- kBulletCharCode, '-', kCheckCharCode};
- const char *markChar = markChars;
- int i = sizeof(markChars);
- Tk_Font tkfont;
-
- tkfont = Tk_GetFontFromObj(mePtr->menuPtr->tkwin,
- (mePtr->fontPtr == NULL) ? mePtr->menuPtr->fontPtr
- : mePtr->fontPtr);
-
- while (--i) {
- if (!TkMacOSXIsCharacterMissing(tkfont, *markChar)) {
- break;
- }
- markChar++;
+ if (_tkMenu) {
+ //RecursivelyClearActiveMenu(_tkMenu);
+ GenerateMenuSelectEvent((TKMenu *)[self supermenu],
+ [self itemInSupermenu]);
}
- return *markChar;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetUtfMarkCharacter --
- *
- * Get the utf8 string for the given mark character, taking into
- * account the special menu font char codes.
- *
- * Results:
- * Length of returned utf8 string.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-int
-GetUtfMarkCharacter(
- char markChar,
- const char **markUtfPtr)
+- (void) menuDidClose: (NSMenu *) menu
{
- const MenuSymbol *ms = menuSymbols;
- int len = 0;
-
- while (ms->unicode) {
- if (ms->charCode && ms->charCode == markChar) {
- *markUtfPtr = ms->utf;
- len = ms->utfLen;
- break;
- }
- ms++;
+ if (_tkMenu) {
+ RecursivelyClearActiveMenu(_tkMenu);
}
- if (!len) {
- static char markUtf[TCL_UTF_MAX + 1];
-
- Tcl_ExternalToUtf(NULL, TkMacOSXCarbonEncoding, &markChar, 1, 0, NULL,
- markUtf, TCL_UTF_MAX + 1, NULL, &len, NULL);
- *markUtfPtr = markUtf;
- }
- return len;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * ParseAccelerators --
- *
- * Parse menu accelerator string.
- *
- * Results:
- * Accelerator flags.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-int
-ParseAccelerators(
- const char **accelStringPtr,
- int *modifierNumPtr,
- Tcl_UniChar *modifierUniChars,
- int *modifierWidth)
+- (void) menu: (NSMenu *) menu willHighlightItem: (NSMenuItem *) item
{
- struct Modif {
- const char *name;
- const size_t len;
- const int flag, symbol;
- };
-#define MODIF(n, f) { #n, sizeof(#n)-1, ENTRY_##f##_ACCEL, f##_SYMBOL }
- static const struct Modif modifs[] = {
- MODIF(Control, CONTROL),
- MODIF(Ctrl, CONTROL),
- MODIF(Option, OPTION),
- MODIF(Opt, OPTION),
- MODIF(Alt, OPTION),
- MODIF(Shift, SHIFT),
- MODIF(Command, COMMAND),
- MODIF(Cmd, COMMAND),
- MODIF(Meta, COMMAND),
- { NULL, 0, 0, 0}
- };
-#undef MODIF
- const char *accelString = *accelStringPtr;
- int flags = 0, num = 0, seen = 0, width = 0;
- const struct Modif *m;
-
- while (1) {
- m = modifs;
- while (m->name) {
- int l = m->len;
-
- if (!strncasecmp(accelString, m->name, l) &&
- (accelString[l] == '-' || accelString[l] == '+')) {
- flags |= m->flag;
- accelString += l+1;
- break;
- }
- m++;
- }
- if (!m->name || !*accelString) {
- break;
- }
- }
- m = modifs;
- while (m->name && num < MODIFIER_NUM) {
- if (flags & m->flag && !(seen & m->flag)) {
- modifierUniChars[num++] = menuSymbols[m->symbol].unicode;
- width += menuSymbols[m->symbol].width;
- seen |= m->flag;
- }
- m++;
+ if (_tkMenu) {
+ GenerateMenuSelectEvent(self, item);
}
- *accelStringPtr = accelString;
- *modifierNumPtr = num;
- *modifierWidth = width;
- 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. */
+- (void) menuNeedsUpdate: (NSMenu *) menu
{
- TkMenu *menuPtr = mePtr->menuPtr;
- EntryGeometry *geometryPtr = (EntryGeometry *) mePtr->platformEntryData;
-
- /*
- * 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;
+ TkMenu *menuPtr = (TkMenu *) _tkMenu;
- if (childMenuHdl != NULL) {
- int error = SetMenuCascade(mePtr->childMenuRefPtr->menuPtr);
+ if (menuPtr) {
+ Tcl_Interp *interp = menuPtr->interp;
- if (error != TCL_OK) {
- return error;
- }
+ Tcl_Preserve(interp);
+ Tcl_Preserve(menuPtr);
- if (menuPtr->menuType == MENUBAR) {
- CFStringRef cfStr = CFStringCreateWithCString(NULL,
- (!(mePtr->labelPtr) ? "" :
- Tcl_GetString(mePtr->labelPtr)),
- kCFStringEncodingUTF8);
+ int result = TkPostCommand(_tkMenu);
- if (cfStr) {
- SetMenuTitleWithCFString(childMenuHdl, cfStr);
- CFRelease(cfStr);
- }
- }
- }
+ if (result!=TCL_OK && result!=TCL_CONTINUE && result!=TCL_BREAK) {
+ Tcl_AddErrorInfo(interp, "\n (menu preprocess)");
+ Tcl_BackgroundException(interp, result);
}
+ Tcl_Release(menuPtr);
+ Tcl_Release(interp);
}
+}
+@end
- /*
- * 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.
- */
+#pragma mark TKApplication(TKMenu)
- if (0 == mePtr->accelLength) {
- geometryPtr->accelTextStart = -1;
- } else {
- const char *accelString = (mePtr->accelPtr == NULL) ? ""
- : Tcl_GetString(mePtr->accelPtr);
- const char *accelStart = accelString;
-
- mePtr->entryFlags &= ~ENTRY_ACCEL_MASK;
- mePtr->entryFlags |= ParseAccelerators(&accelString,
- &geometryPtr->modifierNum, geometryPtr->modifierUniChars,
- &geometryPtr->modifierWidth);
- geometryPtr->accelTextStart = (ptrdiff_t)(accelString - accelStart);
- }
+@interface NSApplication(TKMenu)
+- (void) setAppleMenu: (NSMenu *) menu;
+@end
- if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
- menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
- Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
- }
+@implementation TKApplication(TKMenu)
- return TCL_OK;
+- (void) menuBeginTracking: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ //TkMacOSXClearMenubarActive();
+ //TkMacOSXPreprocessMenu();
}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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
- *
- *----------------------------------------------------------------------
- */
-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;
- * # of system help menu items
- * for help menus. */
+- (void) menuEndTracking: (NSNotification *) notification
{
- int count;
- int index;
- TkMenuEntry *mePtr;
- int parentDisabled = 0;
-
-#ifdef TK_MAC_DEBUG_MENUS
- /*
- * Carbon-internal menu debugging (c.f. Technote 2124)
- */
-
- TkMacOSXInitNamedDebugSymbol(HIToolbox, void, DebugPrintMenu,
- MenuRef menu);
- if (DebugPrintMenu) {
- DebugPrintMenu(macMenuHdl);
- }
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
-
- mePtr = GetParentMenuEntry(menuPtr);
- if (mePtr && mePtr->state == ENTRY_DISABLED) {
- parentDisabled = 1;
+ if (!inPostMenu) {
+ TkMacOSXClearMenubarActive();
}
+}
- /*
- * First, we get rid of all of the old items.
- */
-
- count = CountMenuItems(macMenuHdl);
- for (index = base; index < count; index++) {
- DeleteMenuItem(macMenuHdl, base + 1);
+- (void) tkSetMainMenu: (TKMenu *) menu
+{
+ if (gNoTkMenus) {
+ return;
}
- count = menuPtr->numEntries;
+ TKMenu *applicationMenu = nil;
- for (index = 1; index <= count; index++) {
- mePtr = menuPtr->entries[index - 1];
+ if (menu) {
+ NSMenuItem *applicationMenuItem = [menu numberOfItems] ?
+ [menu itemAtIndex:0] : nil;
- /*
- * We have to do separators separately because SetMenuItemText
- * does not parse meta-characters.
- */
+ if (![menu isSpecial:tkMainMenu]) {
+ TkMenuEntry *mePtr = (TkMenuEntry *)[applicationMenuItem tag];
- if (mePtr->type == SEPARATOR_ENTRY) {
- AppendMenuItemTextWithCFString(macMenuHdl, NULL,
- kMenuItemAttrSeparator | kMenuItemAttrDisabled, 0, NULL);
- } else {
- Tcl_DString itemTextDString;
- CFStringRef cfStr;
-
- GetEntryText(mePtr, &itemTextDString);
- cfStr = CFStringCreateWithCString(NULL,
- Tcl_DStringValue(&itemTextDString), kCFStringEncodingUTF8);
- if (cfStr) {
- AppendMenuItemTextWithCFString(macMenuHdl, cfStr, 0, 0, NULL);
- CFRelease(cfStr);
- } else {
- AppendMenuItemTextWithCFString(macMenuHdl, CFSTR ("<Error>"),
- 0, 0, NULL);
+ if (!mePtr || !(mePtr->entryFlags & ENTRY_APPLE_MENU)) {
+ applicationMenuItem = [NSMenuItem itemWithSubmenu:
+ [[_defaultApplicationMenu copy] autorelease]];
+ [menu insertItem:applicationMenuItem atIndex:0];
}
- Tcl_DStringFree(&itemTextDString);
-
- /*
- * Set enabling and disabling correctly.
- */
-
- if (parentDisabled || (mePtr->state == ENTRY_DISABLED)) {
- DisableMenuItem(macMenuHdl, base + index);
- } else {
- EnableMenuItem(macMenuHdl, base + index);
+ [menu setSpecial:tkMainMenu];
+ }
+ applicationMenu = (TKMenu *)[applicationMenuItem submenu];
+ if (![applicationMenu isSpecial:tkApplicationMenu]) {
+ for (NSMenuItem *item in _defaultApplicationMenuItems) {
+ [applicationMenu addItem:[[item copy] autorelease]];
}
+ [applicationMenu setSpecial:tkApplicationMenu];
+ }
- /*
- * Set the check mark for check entries and radio entries.
- */
+ NSArray *itemArray = [menu itemArray];
- 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));
- }
- }
+ for (NSMenuItem *item in itemArray) {
+ TkMenuEntry *mePtr = (TkMenuEntry *)[item tag];
+ TKMenu *submenu = (TKMenu *)[item submenu];
- if (mePtr->type == CASCADE_ENTRY) {
- if ((mePtr->childMenuRefPtr != NULL)
- && (mePtr->childMenuRefPtr->menuPtr != NULL)) {
- MenuHandle childMenuHdl =
- ((MacMenu *) mePtr->childMenuRefPtr
- ->menuPtr->platformData)->menuHdl;
-
- if (childMenuHdl != NULL) {
- ChkErr(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 && submenu) {
+ if ((mePtr->entryFlags & ENTRY_WINDOWS_MENU) &&
+ ![submenu isSpecial:tkWindowsMenu]) {
+ NSInteger index = 0;
- if ((mePtr->type != CASCADE_ENTRY) && (mePtr->accelPtr != NULL)) {
- int accelLen, modifiers = 0, hasCmd = 0;
- EntryGeometry *geometryPtr =
- (EntryGeometry*)mePtr->platformEntryData;
- int offset = geometryPtr->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;
- }
+ for (NSMenuItem *i in _defaultWindowsMenuItems) {
+ [submenu insertItem:[[i copy] autorelease] atIndex:
+ index++];
}
- } else {
- /*
- * Convert from accelerator names to Carbon menu glyphs.
- */
- struct Glyph {
- const char *name;
- const size_t len;
- const char glyph;
- };
-#define GLYPH(n, g) { #n, sizeof(#n)-1, kMenu##g##Glyph }
- static const struct Glyph glyphs[] = {
- GLYPH(PageUp, PageUp),
- GLYPH(PageDown, PageDown),
- GLYPH(Left, LeftArrow),
- GLYPH(Right, RightArrow),
- GLYPH(Up, UpArrow),
- GLYPH(Down, DownArrow),
- GLYPH(Escape, Escape),
- GLYPH(Clear, Clear),
- GLYPH(Enter, Enter),
- GLYPH(Backspace,DeleteLeft),
- GLYPH(Space, Space),
- GLYPH(Tab, TabRight),
- GLYPH(Delete, DeleteRight),
- GLYPH(Home, NorthwestArrow),
- GLYPH(End, SoutheastArrow),
- GLYPH(Return, Return),
- GLYPH(Help, Help),
- GLYPH(Power, Power),
- { NULL, 0, 0}
- };
-#undef GLYPH
- const struct Glyph *g = glyphs;
- char glyph = 0;
-
- if (accel[0] == 'F' && accelLen < 4 &&
- (accel[1] > '0' && accel[1] <= '9')) {
- int fkey = accel[1] - '0';
-
- if (accelLen == 3) {
- if (accel[2] >= '0' && accel[2] <= '9') {
- fkey = 10 * fkey + (accel[2] - '0');
- } else {
- fkey = 0;
- }
- }
- if (fkey >= 1 && fkey <= 12) {
- glyph = kMenuF1Glyph + fkey - 1;
- } else if (fkey >= 13 && fkey <= 15) {
- glyph = kMenuF13Glyph + fkey - 13;
- }
- } else while (g->name) {
- if (accel[0] == g->name[0] &&
- (size_t)accelLen == g->len &&
- !strncasecmp(accel, g->name, g->len)) {
- glyph = g->glyph;
- break;
- }
- g++;
- }
- if (glyph) {
- ChkErr(SetMenuItemKeyGlyph, macMenuHdl, base + index,
- glyph);
- if (!hasCmd) {
- modifiers |= kMenuNoCommandModifier;
- }
- geometryPtr->accelGlyph = glyph;
+ [self setWindowsMenu:submenu];
+ [submenu setSpecial:tkWindowsMenu];
+ } else if ((mePtr->entryFlags & ENTRY_HELP_MENU) &&
+ ![submenu isSpecial:tkHelpMenu]) {
+ NSInteger index = 0;
+
+ for (NSMenuItem *i in _defaultHelpMenuItems) {
+ [submenu insertItem:[[i copy] autorelease] atIndex:
+ index++];
}
+ [submenu setSpecial:tkHelpMenu];
}
- ChkErr(SetMenuItemModifiers, macMenuHdl, base + index,
- modifiers);
}
}
+ } else {
+ menu = _defaultMainMenu;
+ applicationMenu = _defaultApplicationMenu;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
-
-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 (GetMenuID(macMenuHdl) == currentHelpMenuID) {
- MenuItemIndex helpIndex;
- HMGetHelpMenu(&helpMenuHdl,&helpIndex);
- if (helpMenuHdl != NULL) {
- ReconfigureIndividualMenu(menuPtr, helpMenuHdl, helpIndex - 1);
- }
- }
+ NSMenuItem *servicesMenuItem =
+ [applicationMenu itemWithTitle:@"Services"];
- if (menuPtr->menuType == MENUBAR) {
- if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
- Tcl_DoWhenIdle(DrawMenuBarWhenIdle, NULL);
- menuBarFlags |= MENUBAR_REDRAW_PENDING;
- }
+ if (servicesMenuItem && [servicesMenuItem submenu] != _servicesMenu) {
+ [[_servicesMenu itemInSupermenu] setSubmenu:nil];
+ [servicesMenuItem setSubmenu:_servicesMenu];
}
+ [self setAppleMenu:applicationMenu];
+ [self setMainMenu:menu];
}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
*
- * CompleteIdlers --
+ * TkpNewMenu --
*
- * Completes all idle handling so that the menus are in sync when
- * the user invokes them with the mouse.
+ * Gets a new blank menu. Only the platform specific options are filled
+ * in.
*
* Results:
- * None.
+ * Returns a standard Tcl error.
*
* Side effects:
- * The Macintosh menu handles are flushed out.
+ * Allocates a NSMenu and puts it into the platformData field of the
+ * menuPtr.
*
*----------------------------------------------------------------------
*/
-void
-CompleteIdlers(
- TkMenu *menuPtr) /* The menu we are completing. */
+int
+TkpNewMenu(
+ TkMenu *menuPtr) /* The common structure we are making the
+ * platform structure for. */
{
- 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) &&
- (menuPtr->entries[i]->childMenuRefPtr != NULL) &&
- (menuPtr->entries[i]->childMenuRefPtr->menuPtr != NULL)) {
- CompleteIdlers(menuPtr->entries[i]->childMenuRefPtr->menuPtr);
- }
- }
+ TKMenu *menu = [[TKMenu alloc] initWithTkMenu:menuPtr];
+ menuPtr->platformData = (TkMenuPlatformData)
+ TkMacOSXMakeUncollectable(menu);
+ CheckForSpecialMenu(menuPtr);
+ return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * TkpPostMenu --
+ * TkpDestroyMenu --
*
- * Posts a menu on the screen
+ * Destroys platform-specific menu structures.
*
* Results:
* None.
*
* Side effects:
- * The menu is posted and handled.
+ * All platform-specific allocations are freed up.
*
*----------------------------------------------------------------------
*/
-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 */
+void
+TkpDestroyMenu(
+ TkMenu *menuPtr) /* The common menu structure */
{
- MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
- long popUpResult;
- int result;
-
- if (inPostMenu > 0) {
- Tcl_AppendResult(interp,
- "Cannot call post menu while already posting menu", NULL);
- result = TCL_ERROR;
- } else {
- short menuID;
- Window window;
- int oldWidth = menuPtr->totalWidth;
-
- inPostMenu++;
- result = TkPreprocessMenu(menuPtr);
- /*
- * The post commands could have deleted the menu, which means
- * we are dead and should go away.
- */
-
- if (result != TCL_OK || !menuPtr->tkwin) {
- goto endPostMenu;
- }
-
- CompleteIdlers(menuPtr);
- if (menuBarFlags & MENUBAR_REDRAW_PENDING) {
- Tcl_CancelIdleCall(DrawMenuBarWhenIdle, NULL);
- DrawMenuBarWhenIdle(NULL);
- }
- RecursivelyInsertMenu(menuPtr);
-
- TkMacOSXTrackingLoop(1);
- popUpResult = PopUpMenuSelect(macMenuHdl, y, x, menuPtr->active);
- TkMacOSXTrackingLoop(0);
- menuPtr->totalWidth = oldWidth;
-
- /*
- * Simulate the mouse up.
- */
-
- window = Tk_WindowId(menuPtr->tkwin);
- TkGenerateButtonEventForXPointer(window);
-
- /*
- * Dispatch the command.
- */
-
- menuID = HiWord(popUpResult);
- if (menuID != 0) {
- result = TkMacOSXDispatchMenuEvent(menuID, LoWord(popUpResult));
- }
-
-endPostMenu:
- inPostMenu--;
- }
- return result;
+ TkMacOSXMakeCollectableAndRelease(menuPtr->platformData);
}
/*
@@ -1590,9 +518,8 @@ endPostMenu:
* 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.
+ * specific fields filled in. The Macintosh uses the platformEntryData
+ * field of the TkMenuEntry record.
*
* Results:
* Standard TCL error.
@@ -1608,490 +535,233 @@ 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;
- geometryPtr->modifierNum = 0;
- geometryPtr->accelGlyph = 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(void)
-{
- gNoTkMenus = 1;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * DrawMenuBarWhenIdle --
- *
- * Update the menu bar next time there is an idle event.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Menu bar is redrawn.
- *
- *----------------------------------------------------------------------
- */
-
-void
-DrawMenuBarWhenIdle(
- ClientData clientData) /* ignored here */
-{
- TkMenuReferences *menuRefPtr;
- TkMenu *appleMenuPtr, *helpMenuPtr, *menuBarPtr = NULL;
- 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*)(intptr_t)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*)(intptr_t)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);
+ TKMenu *menu = (TKMenu *) mePtr->menuPtr->platformData;
+ NSMenuItem *menuItem;
+ if (mePtr->type == SEPARATOR_ENTRY || mePtr->type == TEAROFF_ENTRY) {
+ menuItem = [[NSMenuItem separatorItem] retain];
+ } else {
+ menuItem = [menu newTkMenuItem:mePtr];
}
+ mePtr->platformEntryData = (TkMenuPlatformEntryData)
+ TkMacOSXMakeUncollectable(menuItem);
/*
- * 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.
+ * Caller TkMenuEntry() already did this same insertion into the generic
+ * TkMenu so we just match it for the platform menu.
*/
- menuRefPtr = NULL;
- if (currentMenuBarName != NULL) {
- menuRefPtr = TkFindMenuReferences(currentMenuBarInterp,
- currentMenuBarName);
- }
- if (menuRefPtr) {
- TkMenu *menuPtr;
- TkMenu *cascadeMenuPtr;
- char *appleMenuName, *helpMenuName;
- int appleIndex = -1, helpIndex = -1, 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) {
- 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;
- tkCurrentAppleMenu = tkAppleMenu;
- } 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;
- 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;
- tkCurrentAppleMenu = macMenuHdl;
- }
- 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;
-
- 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);
- }
- }
- }
- }
- }
- }
- if (!menuRefPtr || !menuBarPtr) {
- SetDefaultMenubar();
- }
- DrawMenuBar();
- menuBarFlags &= ~MENUBAR_REDRAW_PENDING;
+ [menu insertItem:menuItem atTkIndex:mePtr->index];
+ return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * RecursivelyInsertMenu --
+ * TkpConfigureMenuEntry --
*
- * Puts all of the cascades of this menu in the Mac hierarchical list.
+ * Processes configurations for menu entries.
*
* Results:
- * None.
+ * Returns standard TCL result. If TCL_ERROR is returned, then the
+ * interp's result contains an error message.
*
* Side effects:
- * The menubar is changed.
+ * Configuration information get set for mePtr; old resources get freed,
+ * if any need it.
*
*----------------------------------------------------------------------
*/
-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;
+int
+TkpConfigureMenuEntry(
+ TkMenuEntry *mePtr) /* Information about menu entry; may or may
+ * not already have values for some fields. */
+{
+ NSMenuItem *menuItem = (NSMenuItem *) mePtr->platformEntryData;
+ NSString *title = @"";
+ NSAttributedString *attributedTitle = nil;
+ NSImage *image = nil;
+ NSString *keyEquivalent = @"";
+ NSUInteger modifierMask = NSCommandKeyMask;
+ NSMenu *submenu = nil;
+ NSDictionary *attributes;
+ int imageWidth, imageHeight;
+ GC gc = (mePtr->textGC ? mePtr->textGC : mePtr->menuPtr->textGC);
+ Tcl_Obj *fontPtr = (mePtr->fontPtr ? mePtr->fontPtr :
+ mePtr->menuPtr->fontPtr);
+
+ if (mePtr->image) {
+ Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
+ image = TkMacOSXGetNSImageWithTkImage(mePtr->menuPtr->display,
+ mePtr->image, imageWidth, imageHeight);
+ } else if (mePtr->bitmapPtr != None) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(mePtr->menuPtr->tkwin,
+ mePtr->bitmapPtr);
+
+ Tk_SizeOfBitmap(mePtr->menuPtr->display, bitmap, &imageWidth,
+ &imageHeight);
+ image = TkMacOSXGetNSImageWithBitmap(mePtr->menuPtr->display, bitmap,
+ gc, imageWidth, imageHeight);
+ }
+ [menuItem setImage:image];
+ if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr &&
+ mePtr->labelLength) {
+ title = [[[NSString alloc] initWithBytes:Tcl_GetString(mePtr->labelPtr)
+ length:mePtr->labelLength encoding:NSUTF8StringEncoding]
+ autorelease];
+ if ([title hasSuffix:@"..."]) {
+ title = [NSString stringWithFormat:@"%@%C",
+ [title substringToIndex:[title length] - 3], 0x2026];
+ }
+ }
+ [menuItem setTitle:title];
+ if (strcmp(Tcl_GetString(fontPtr), "menu") || gc->foreground != defaultFg
+ || gc->background != defaultBg) {
+ attributes = TkMacOSXNSFontAttributesForFont(Tk_GetFontFromObj(
+ mePtr->menuPtr->tkwin, fontPtr));
+ if (gc->foreground != defaultFg || gc->background != defaultBg) {
+ NSColor *color = TkMacOSXGetNSColor(gc,
+ gc->foreground!=defaultFg? gc->foreground:gc->background);
+
+ attributes = [[attributes mutableCopy] autorelease];
+ [(NSMutableDictionary *)attributes setObject:color
+ forKey:NSForegroundColorAttributeName];
+ }
+ if (attributes) {
+ attributedTitle = [[[NSAttributedString alloc]
+ initWithString:title attributes:attributes] autorelease];
+ }
+ }
+ [menuItem setAttributedTitle:attributedTitle];
+ [menuItem setEnabled:!(mePtr->state == ENTRY_DISABLED)];
+ [menuItem setState:((mePtr->type == CHECK_BUTTON_ENTRY ||
+ mePtr->type == RADIO_BUTTON_ENTRY) && mePtr->indicatorOn &&
+ (mePtr->entryFlags & ENTRY_SELECTED) ? NSOnState : NSOffState)];
+ if (mePtr->type != CASCADE_ENTRY && mePtr->accelPtr && mePtr->accelLength) {
+ keyEquivalent = ParseAccelerator(Tcl_GetString(mePtr->accelPtr),
+ &modifierMask);
+ }
+ [menuItem setKeyEquivalent:keyEquivalent];
+ [menuItem setKeyEquivalentModifierMask:modifierMask];
+ if (mePtr->type == CASCADE_ENTRY && mePtr->namePtr) {
+ TkMenuReferences *menuRefPtr;
+
+ menuRefPtr = TkFindMenuReferencesObj(mePtr->menuPtr->interp,
+ mePtr->namePtr);
+ if (menuRefPtr && menuRefPtr->menuPtr) {
+ CheckForSpecialMenu(menuRefPtr->menuPtr);
+ submenu = (TKMenu *) menuRefPtr->menuPtr->platformData;
+ if ([submenu supermenu] && [menuItem submenu] != submenu) {
+ /*
+ * This happens during a clone, where the parent menu is
+ * cloned before its children, so just ignore this temprary
+ * setting, it will be changed shortly (c.f. tkMenu.c
+ * CloneMenu())
+ */
- 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);
+ submenu = nil;
+ } else {
+ [submenu setTitle:title];
}
}
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * RecursivelyDeleteMenu --
- *
- * Takes all of the cascades of this menu out of the Mac hierarchical
- * list.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The menubar is changed.
- *
- *----------------------------------------------------------------------
- */
+ [menuItem setSubmenu:submenu];
-void
-RecursivelyDeleteMenu(
- TkMenu *menuPtr) /* All of the cascade items in this menu
- * will be deleted from 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));
- RecursivelyDeleteMenu(cascadeMenuPtr);
+ /*Disabling parent menu disables entries; we must re-enable the entries here.*/
+ NSArray *itemArray = [submenu itemArray];
+
+ if ([menuItem isEnabled]) {
+ for (NSMenuItem *item in itemArray) {
+ [item setEnabled:YES];
}
}
- }
+
+ return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * SetDefaultMenubar --
+ * TkpDestroyMenuEntry --
*
- * Puts the Apple, File and Edit menus into the Macintosh menubar.
+ * Cleans up platform-specific menu entry items.
*
* Results:
- * None.
+ * None
*
* Side effects:
- * The menubar is changed.
+ * All platform-specific allocations are freed up.
*
*----------------------------------------------------------------------
*/
void
-SetDefaultMenubar(void)
+TkpDestroyMenuEntry(
+ TkMenuEntry *mePtr)
{
- 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, NULL);
- menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ if (mePtr->platformEntryData && mePtr->menuPtr->platformData) {
+ TKMenu *menu = (TKMenu *) mePtr->menuPtr->platformData;
+ NSMenuItem *menuItem = (NSMenuItem *) mePtr->platformEntryData;
+ NSInteger index = [menu indexOfItem:menuItem];
+
+ if (index > -1) {
+ [menu removeItemAtIndex:index];
+ }
}
+ TkMacOSXMakeCollectableAndRelease(mePtr->platformEntryData);
}
/*
*----------------------------------------------------------------------
*
- * TkpSetMainMenubar --
+ * TkpPostMenu --
*
- * Puts the menu associated with a window into the menubar. Should
- * only be called when the window is in front.
+ * Posts a menu on the screen
*
* Results:
* None.
*
* Side effects:
- * The menubar is changed.
+ * The menu is posted and handled.
*
*----------------------------------------------------------------------
*/
-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.
- */
+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 */
{
- TkWindow *winPtr = (TkWindow *) tkwin;
- WindowRef macWindowPtr;
- WindowRef frontNonFloating;
-
- macWindowPtr = TkMacOSXDrawableWindow(winPtr->window);
-
- frontNonFloating = ActiveNonFloatingWindow();
- if ((macWindowPtr == NULL) || (macWindowPtr != frontNonFloating)) {
- return;
+ NSWindow *win = [NSApp keyWindow];
+ if (!win) {
+ return TCL_ERROR;
}
- if ((currentMenuBarInterp != interp) || (currentMenuBarOwner != tkwin)
- || (currentMenuBarName == NULL) || (menuName == NULL)
- || (strcmp(menuName, currentMenuBarName) != 0)) {
- Tk_Window searchWindow;
- TopLevelMenubarList *listPtr;
+ inPostMenu = 1;
- if (currentMenuBarName != NULL) {
- ckfree(currentMenuBarName);
- }
+ int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
+ NSView *view = [win contentView];
+ NSRect frame = NSMakeRect(x + 9, tkMacOSXZeroScreenHeight - y - 9, 1, 1);
- if (menuName == NULL) {
- searchWindow = tkwin;
- if (strcmp(Tk_Class(searchWindow), "Menu") == 0) {
- TkMenuReferences *menuRefPtr;
+ frame.origin = [view convertPoint:
+ [win convertScreenToBase:frame.origin] fromView:nil];
- menuRefPtr = TkFindMenuReferences(interp, Tk_PathName(tkwin));
- if (menuRefPtr != NULL) {
- TkMenu *menuPtr = menuRefPtr->menuPtr;
+ NSMenu *menu = (NSMenu *) menuPtr->platformData;
+ NSPopUpButtonCell *popUpButtonCell = [[NSPopUpButtonCell alloc]
+ initTextCell:@"" pullsDown:NO];
- if (menuPtr != NULL) {
- searchWindow = menuPtr->masterMenuPtr->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, NULL);
- menuBarFlags |= MENUBAR_REDRAW_PENDING;
- }
+ [popUpButtonCell setAltersStateOfSelectedItem:NO];
+ [popUpButtonCell setMenu:menu];
+ [popUpButtonCell selectItem:nil];
+ [popUpButtonCell performClickWithFrame:frame inView:view];
+ [popUpButtonCell release];
+ Tcl_SetServiceMode(oldMode);
+ inPostMenu = 0;
+ return TCL_OK;
}
/*
@@ -2105,8 +775,8 @@ TkpSetMainMenubar(
* None.
*
* Side effects:
- * On Windows and UNIX, associates the platform menu with the
- * platform window.
+ * On Windows and UNIX, associates the platform menu with the platform
+ * window.
*
*----------------------------------------------------------------------
*/
@@ -2116,276 +786,115 @@ 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);
- }
+ TkWindow *winPtr = (TkWindow *) tkwin;
- if (menuPtr != NULL) {
- listPtr = (TopLevelMenubarList *) ckalloc(sizeof(TopLevelMenubarList));
- listPtr->nextPtr = windowListPtr;
- windowListPtr = listPtr;
- listPtr->tkwin = tkwin;
- listPtr->menuPtr = menuPtr;
+ if (winPtr->wmInfoPtr) {
+ winPtr->wmInfoPtr->menuPtr = menuPtr;
}
}
/*
*----------------------------------------------------------------------
*
- * EventuallyInvokeMenu --
+ * TkpSetMainMenubar --
*
- * This IdleTime callback actually invokes the menu command
- * scheduled in TkMacOSXDispatchMenuEvent.
+ * Puts the menu associated with a window into the menubar. Should only
+ * be called when the window is in front.
*
* Results:
* None.
*
* Side effects:
- * Commands get executed.
+ * The menubar is changed.
*
*----------------------------------------------------------------------
*/
void
-EventuallyInvokeMenu (
- ClientData data)
+TkpSetMainMenubar(
+ Tcl_Interp *interp, /* The interpreter of the application */
+ Tk_Window tkwin, /* The frame we are setting up */
+ const char *menuName) /* The name of the menu to put in front. If
+ * NULL, use the default menu bar. */
{
- struct MenuCommandHandlerData *realData =
- (struct MenuCommandHandlerData *) data;
- int code;
-
- code = TkInvokeMenu(realData->menuPtr->interp, realData->menuPtr,
- realData->index);
+ static Tcl_Interp *currentInterp = NULL;
+ TKMenu *menu = nil;
- if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) {
- Tcl_AddErrorInfo(realData->menuPtr->interp, "\n (menu invoke)");
- Tcl_BackgroundError(realData->menuPtr->interp);
- }
+ if (menuName) {
+ TkWindow *winPtr = (TkWindow *) tkwin;
- if (realData->menuPtr->tkwin) {
- RecursivelyClearActiveMenu(realData->menuPtr);
- }
- TkMacOSXClearMenubarActive();
-
- Tcl_Release(realData->menuPtr->interp);
- Tcl_Release(realData->menuPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXDispatchMenuEvent --
- *
- * Given a menu id and an item, dispatches the command associated
- * with it.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands for the event are scheduled for execution at idle time.
- *
- *----------------------------------------------------------------------
- */
-
-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)) {
- MenuRef outHelpMenu;
- MenuItemIndex itemIndex;
- int newIndex;
-
- HMGetHelpMenu(&outHelpMenu, &itemIndex);
- newIndex = index - itemIndex;
- result = TkInvokeMenu(currentMenuBarInterp,
- helpMenuRef->menuPtr, newIndex);
- }
- }
+ if (winPtr->wmInfoPtr && winPtr->wmInfoPtr->menuPtr &&
+ winPtr->wmInfoPtr->menuPtr->masterMenuPtr &&
+ winPtr->wmInfoPtr->menuPtr->masterMenuPtr->tkwin &&
+ !strcmp(menuName, Tk_PathName(
+ winPtr->wmInfoPtr->menuPtr->masterMenuPtr->tkwin))) {
+ menu = (TKMenu *) winPtr->wmInfoPtr->menuPtr->platformData;
} else {
- Tcl_HashEntry *commandEntryPtr =
- Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
- if (commandEntryPtr != NULL) {
- TkMenu *menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
-
- if ((currentAppleMenuID == menuID)
- && (index > menuPtr->numEntries + 1)) {
- /*
- * We don't need to do anything here, the standard
- * Application event handler will open the built-in
- * Apple menu item for us.
- */
- result = TCL_OK;
- } else {
- struct MenuCommandHandlerData *data
- = (struct MenuCommandHandlerData *)
- ckalloc(sizeof(struct MenuCommandHandlerData));
-
- Tcl_Preserve(menuPtr->interp);
- Tcl_Preserve(menuPtr);
- data->menuPtr = menuPtr;
- data->index = index - 1;
- Tcl_DoWhenIdle(EventuallyInvokeMenu,
- (ClientData) data);
- /* result = TkInvokeMenu(menuPtr->interp, menuPtr, index - 1); */
- }
- } else {
- return TCL_ERROR;
+ TkMenuReferences *menuRefPtr = TkFindMenuReferences(interp,
+ menuName);
+
+ if (menuRefPtr && menuRefPtr->menuPtr &&
+ menuRefPtr->menuPtr->platformData) {
+ menu = (TKMenu *) menuRefPtr->menuPtr->platformData;
}
}
}
- return result;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetMenuIndicatorGeometry --
- *
- * Gets the width and height of the indicator area of a menu.
- *
- * Results:
- * widthPtr and heightPtr are set.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-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 */
-{
- *heightPtr = fmPtr->linespace + menuItemExtraHeight;
- if (IS_THEME_MENU_FONT(tkfont)) {
- *widthPtr = menuMarkColumnWidth;
- } else {
- const char markChar = FindMarkCharacter(mePtr);
- const char *markUtf = NULL;
- int len;
-
- len = GetUtfMarkCharacter(markChar, &markUtf);
- *widthPtr = Tk_TextWidth(tkfont, markUtf, len) + 2*menuMarkIndent;
+ if (menu || interp != currentInterp) {
+ [NSApp tkSetMainMenu:menu];
}
+ currentInterp = interp;
}
/*
*----------------------------------------------------------------------
*
- * GetMenuAccelGeometry --
+ * CheckForSpecialMenu --
*
- * Gets the width and height of the accelerator area of a menu.
+ * Given a menu, check to see whether or not it is a cascade in a menubar
+ * with one of the special names .apple, .help or .window If it is, the
+ * entry that points to this menu will be marked.
*
* Results:
- * widthPtr and heightPtr are set.
+ * None.
*
* Side effects:
- * None.
+ * Will set entryFlags appropriately.
*
*----------------------------------------------------------------------
*/
-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 */
+static void
+CheckForSpecialMenu(
+ TkMenu *menuPtr) /* The menu we are checking */
{
- *heightPtr = fmPtr->linespace + menuItemExtraHeight;
- *modWidthPtr = menuSymbols[COMMAND_SYMBOL].width;
- *textWidthPtr = 0;
- if (mePtr->type != CASCADE_ENTRY && mePtr->accelLength > 0) {
- const char *accel = (mePtr->accelPtr == NULL) ? ""
- : Tcl_GetString(mePtr->accelPtr);
- EntryGeometry *geometryPtr = (EntryGeometry*)mePtr->platformEntryData;
-
- if (IS_THEME_MENU_FONT(tkfont)) {
- CFStringRef cfStr;
- int width = 0;
- int maxWidth = ((TkFont *)tkfont)->fm.maxWidth;
-
- if (geometryPtr->accelGlyph) {
- cfStr = CFStringCreateWithBytes(NULL,
- (UInt8*)&geometryPtr->accelGlyph, 1,
- kTextEncodingMacKeyboardGlyphs, false);
- if (cfStr) {
- width = MeasureThemeText(cfStr, kThemeMenuItemCmdKeyFont);
- CFRelease(cfStr);
- }
- }
- if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
- if (!geometryPtr->accelGlyph) {
- width = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
- }
- *textWidthPtr = maxWidth;
- if (width < maxWidth) {
- *modWidthPtr = 0;
- } else {
- *modWidthPtr = width - maxWidth;
- }
- } else {
- if (!geometryPtr->accelGlyph) {
- width = Tk_TextWidth(tkfont, accel +
- geometryPtr->accelTextStart, mePtr->accelLength -
- geometryPtr->accelTextStart);
- }
- if (width < maxWidth) {
- *textWidthPtr = maxWidth;
+ if (!menuPtr->masterMenuPtr->tkwin) {
+ return;
+ }
+ for (TkMenuEntry *cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr;
+ cascadeEntryPtr;
+ cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
+ if (cascadeEntryPtr->menuPtr->menuType == MENUBAR
+ && cascadeEntryPtr->menuPtr->masterMenuPtr->tkwin) {
+ TkMenu *masterMenuPtr = cascadeEntryPtr->menuPtr->masterMenuPtr;
+ int i = 0;
+ Tcl_DString ds;
+
+ Tcl_DStringInit(&ds);
+ Tcl_DStringAppend(&ds, Tk_PathName(masterMenuPtr->tkwin), -1);
+ while (specialMenus[i].name) {
+ Tcl_DStringAppend(&ds, specialMenus[i].name,
+ specialMenus[i].len);
+ if (strcmp(Tcl_DStringValue(&ds),
+ Tk_PathName(menuPtr->masterMenuPtr->tkwin)) == 0) {
+ cascadeEntryPtr->entryFlags |= specialMenus[i].flag;
} else {
- *textWidthPtr = width;
- }
- if (geometryPtr->modifierNum) {
- *modWidthPtr = geometryPtr->modifierWidth;
+ cascadeEntryPtr->entryFlags &= ~specialMenus[i].flag;
}
+ Tcl_DStringSetLength(&ds, Tcl_DStringLength(&ds) -
+ specialMenus[i].len);
+ i++;
}
- } else {
- *textWidthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ Tcl_DStringFree(&ds);
}
}
}
@@ -2393,48 +902,12 @@ GetMenuAccelGeometry (
/*
*----------------------------------------------------------------------
*
- * GetTearoffEntryGeometry --
- *
- * Gets the width and height of of a tearoff entry.
- *
- * Results:
- * widthPtr and heightPtr are set.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-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 */
-{
-#ifdef USE_TK_MDEF
- const int useMDEF = ((MacMenu *) menuPtr->platformData)->useMDEF;
-#endif
- if (useMDEF && menuPtr->menuType != TEAROFF_MENU) {
- *heightPtr = fmPtr->linespace + menuItemExtraHeight;
- *widthPtr = menuPtr->totalWidth;
- } else {
- *widthPtr = *heightPtr = 0;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetMenuSeparatorGeometry --
+ * ParseAccelerator --
*
- * Gets the width and height of menu separator.
+ * Parse accelerator string.
*
* Results:
- * widthPtr and heightPtr are set.
+ * Accelerator string & flags.
*
* Side effects:
* None.
@@ -2442,705 +915,96 @@ GetTearoffEntryGeometry (
*----------------------------------------------------------------------
*/
-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 */
+static NSString *
+ParseAccelerator(
+ const char *accel,
+ NSUInteger *maskPtr)
{
- *widthPtr = 0;
- *heightPtr = menuSeparatorHeight;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
-
-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)) {
- short mark;
- int baseline = y + (height + fmPtr->ascent - fmPtr->descent)/2;
-
- GetItemMark(((MacMenu *) menuPtr->platformData)->menuHdl,
- mePtr->index + 1, &mark);
- if (IS_THEME_MENU_FONT(tkfont)) {
- ThemeFontID font = kThemeMenuItemMarkFont;
- TextEncoding encoding = GetApplicationTextEncoding();
- CFStringRef cfStr;
- ThemeDrawState drawState;
- Rect bounds = {y, x + menuMarkIndent, y + height, x + width};
-
- if (mark < kSpaceCharCode) {
- font = kThemeMenuItemCmdKeyFont;
- encoding = kTextEncodingMacKeyboardGlyphs;
- }
- switch (mePtr->state) {
- case ENTRY_ACTIVE:
- drawState = kThemeStatePressed;
- break;
- case ENTRY_DISABLED:
- drawState = kThemeStateInactive;
- break;
- default:
- drawState = kThemeStateActive;
- break;
- }
- cfStr = CFStringCreateWithBytes(NULL, (UInt8*)&mark, 1,
- encoding, false);
- if (cfStr) {
- DrawThemeText(d, gc, cfStr, font, drawState, &bounds,
- baseline, teFlushDefault);
- CFRelease(cfStr);
- }
- } else if (mark != 0) {
- const char *markUtf = NULL;
- int len;
+ unichar ch = 0;
+ size_t len;
+ int i;
- len = GetUtfMarkCharacter(mark, &markUtf);
- Tk_DrawChars(menuPtr->display, d, gc, tkfont, markUtf, len,
- x + menuMarkIndent, baseline);
+ *maskPtr = 0;
+ while (1) {
+ i = 0;
+ while (modifiers[i].name) {
+ int l = modifiers[i].len;
+
+ if (!strncasecmp(accel, modifiers[i].name, l) &&
+ (accel[l] == '-' || accel[l] == '+')) {
+ *maskPtr |= modifiers[i].mask;
+ accel += l+1;
+ break;
}
+ i++;
+ }
+ if (!modifiers[i].name || !*accel) {
+ break;
}
}
-}
-
-#ifdef USE_TK_MDEF
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
-void
-DrawMenuBackground(
- TkMenu *menuPtr,
- Rect *menuRectPtr, /* The menu rect */
- Drawable d) /* What we are drawing into */
-{
- Tk_3DBorder border;
-
- EraseMenuBackground(((MacMenu *) menuPtr->platformData)->menuHdl,
- menuRectPtr, ((MacDrawable*)d)->context);
- border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
- Tk_Fill3DRectangle(menuPtr->tkwin, d, border,
- menuRectPtr->left, menuRectPtr->top,
- menuRectPtr->right - menuRectPtr->left,
- menuRectPtr->bottom - menuRectPtr->top, 0, TK_RELIEF_FLAT);
-}
-#endif /* USE_TK_MDEF */
-
-/*
- *----------------------------------------------------------------------
- *
- * DrawMenuEntryAccelerator --
- *
- * This procedure draws the accelerator part of a menu.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menu in its
- * current mode.
- *
- *----------------------------------------------------------------------
- */
+ len = strlen(accel);
+ if (len > 1) {
+ i = 0;
+ if (accel[0] == 'F' && len < 4 && accel[1] > '0' && accel[1] <= '9') {
+ int fkey = accel[1] - '0';
-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 */
-{
- if (mePtr->type != CASCADE_ENTRY && mePtr->accelLength > 0) {
- const char *accel = (mePtr->accelPtr == NULL) ? ""
- : Tcl_GetString(mePtr->accelPtr);
- EntryGeometry *geometryPtr = (EntryGeometry*)mePtr->platformEntryData;
- int leftEdge = x + width - geometryPtr->accelTextWidth;
- int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
-
- if (IS_THEME_MENU_FONT(tkfont)) {
- CFStringRef cfStr;
- ThemeDrawState drawState;
-
- switch (mePtr->state) {
- case ENTRY_ACTIVE:
- drawState = kThemeStatePressed;
- break;
- case ENTRY_DISABLED:
- drawState = kThemeStateInactive;
- break;
- default:
- drawState = kThemeStateActive;
- break;
- }
- if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
- leftEdge -= geometryPtr->modifierWidth;
- }
- if (geometryPtr->accelGlyph) {
- Rect bounds = {y, leftEdge, y + height, leftEdge +
- geometryPtr->accelTextWidth};
-
- cfStr = CFStringCreateWithBytes(NULL,
- (UInt8*)&geometryPtr->accelGlyph, 1,
- kTextEncodingMacKeyboardGlyphs, false);
- if (cfStr) {
- DrawThemeText(d, gc, cfStr, kThemeMenuItemCmdKeyFont,
- drawState, &bounds, baseline, teFlushDefault);
- CFRelease(cfStr);
+ if (len == 3) {
+ if (accel[2] >= '0' && accel[2] <= '9') {
+ fkey = 10 * fkey + (accel[2] - '0');
+ } else {
+ fkey = 0;
}
- } else {
- Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel +
- geometryPtr->accelTextStart, mePtr->accelLength -
- geometryPtr->accelTextStart, leftEdge, baseline);
}
- if (geometryPtr->modifierNum) {
- Rect bounds = {y, leftEdge - geometryPtr->modifierWidth,
- y + height, leftEdge};
-
- cfStr = CFStringCreateWithCharacters(NULL,
- geometryPtr->modifierUniChars,
- geometryPtr->modifierNum);
- if (cfStr) {
- DrawThemeText(d, gc, cfStr, kThemeMenuItemCmdKeyFont,
- drawState, &bounds, baseline, teFlushDefault);
- CFRelease(cfStr);
- }
+ if (fkey >= 1 && fkey <= 15) {
+ ch = NSF1FunctionKey + fkey - 1;
}
- } else {
- Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
- mePtr->accelLength, leftEdge, baseline);
+ } else while (specialAccelerators[i].name) {
+ if (accel[0] == specialAccelerators[i].name[0] &&
+ len == specialAccelerators[i].len && !strncasecmp(accel,
+ specialAccelerators[i].name, specialAccelerators[i].len)) {
+ ch = specialAccelerators[i].ch;
+ break;
+ }
+ i++;
}
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * DrawMenuSeparator --
- *
- * The menu separator is drawn.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Commands are output to X to display the menu in its
- * current mode.
- *
- *----------------------------------------------------------------------
- */
-
-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 */
-{
- TkMacOSXDrawingContext dc;
- Rect r;
-
- r.top = y;
- r.left = x;
- r.bottom = y + height;
- r.right = x + width;
- if (TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) {
- ChkErr(DrawThemeMenuSeparator, &r);
- TkMacOSXRestoreDrawingContext(&dc);
- }
-}
-
-#ifdef USE_TK_MDEF
-/*
- *----------------------------------------------------------------------
- *
- * 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
- *
- *----------------------------------------------------------------------
- */
-void
-AppearanceEntryDrawWrapper(
- TkMenuEntry *mePtr,
- Rect *menuRectPtr,
- MenuTrackingData *mtdPtr,
- Drawable d,
- Tk_FontMetrics *fmPtr,
- Tk_Font tkfont,
- int erase)
-{
- MenuEntryUserData meData;
- Rect itemRect;
- ThemeMenuState theState;
- ThemeMenuItemType theType;
- Tk_FontMetrics entryMetrics;
-
- meData.mePtr = mePtr;
- meData.mdefDrawable = d;
- if (mePtr->fontPtr == NULL) {
- meData.fmPtr = fmPtr;
- meData.tkfont = tkfont;
- } else {
- meData.tkfont = Tk_GetFontFromObj(mePtr->menuPtr->tkwin,
- mePtr->fontPtr);
- Tk_GetFontMetrics(meData.tkfont, &entryMetrics);
- fmPtr = &entryMetrics;
- }
- itemRect.left = menuRectPtr->left + mePtr->x;
- itemRect.top = mtdPtr->virtualMenuTop + mePtr->y;
- itemRect.right = mePtr->entryFlags & ENTRY_LAST_COLUMN ?
- menuRectPtr->right : itemRect.left + mePtr->width;
- itemRect.bottom = itemRect.top + mePtr->height;
-
- if (mePtr->state == ENTRY_ACTIVE) {
- theState = kThemeMenuSelected;
- } else if (mePtr->state == ENTRY_DISABLED) {
- theState = kThemeMenuDisabled;
+ if (ch) {
+ return [[[NSString alloc] initWithCharacters:&ch length:1] autorelease];
} else {
- theState = kThemeMenuActive;
- }
- if (mePtr->type == CASCADE_ENTRY) {
- theType = kThemeMenuItemHierarchical;
- } else {
- theType = kThemeMenuItemPlain;
- }
- if (erase) {
- DisableScreenUpdates();
- DrawMenuBackground(mePtr->menuPtr, &itemRect, d);
+ return [[[[NSString alloc] initWithUTF8String:accel] autorelease]
+ lowercaseString];
}
- DrawThemeMenuItem(menuRectPtr, &itemRect,
- mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom, theState,
- theType | kThemeMenuItemNoBackground, tkThemeMenuItemDrawingUPP,
- (unsigned long) &meData);
- if (erase) {
- EnableScreenUpdates();
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * ThemeMenuItemDrawingProc --
- *
- * This routine is called from the Appearance DrawThemeMenuEntry
- *
- * Results:
- * A menu entry is drawn
- *
- * Side effects:
- * None
- *
- *----------------------------------------------------------------------
- */
-pascal void
-ThemeMenuItemDrawingProc(
- 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 + menuItemExtraWidth, inBounds->bottom -
- inBounds->top + menuItemExtraHeight, 0, 1);
-}
-#endif /* USE_TK_MDEF */
-
-/*
- *----------------------------------------------------------------------
- *
- * 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)
-{
- /*
- * Obsolete: Nothing to do.
- */
}
/*
*--------------------------------------------------------------
*
- * TkpInitializeMenuBindings --
+ * ModifierCharWidth --
*
- * For every interp, initializes the bindings for Windows
- * menus. Does nothing on Mac or XWindows.
+ * Helper mesuring width of command char in given font.
*
* Results:
- * None.
+ * Width of command char.
*
* 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(
- 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(
- TkMenu *menuPtr) /* Structure describing menu. */
-{
- TkpComputeStandardMenuGeometry(menuPtr);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * DrawTearoffEntry --
- *
- * This procedure draws a tearoff entry.
- *
- * 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->linespace/2;
- points[0].x = x;
- points[0].y = y + height/2;
- points[1].y = points[0].y;
- segmentWidth = 6;
- maxX = x + menuPtr->totalWidth - 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.
- * NB. Nobody uses this any more, since you can get the number
- * of system help items from HMGetHelpMenu trivially.
- * But it is in the stubs table...
- *
- * Results:
- * None.
- *
- * Side effects:
- * Nothing.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TkMacOSXSetHelpMenuItemCount(void)
+static int
+ModifierCharWidth(
+ Tk_Font tkfont)
{
- /*
- * Obsolete: Nothing to do.
- */
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXMenuClick --
- *
- * Prepares a menubar for MenuSelect or MenuKey.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Any pending configurations of the menubar are completed.
- *
- *----------------------------------------------------------------------
- */
+ static NSString *cmdChar = nil;
-void
-TkMacOSXMenuClick(void)
-{
- 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 (!cmdChar) {
+ unichar cmd = kCommandUnicode;
- if (menuBarFlags & MENUBAR_REDRAW_PENDING) {
- Tcl_CancelIdleCall(DrawMenuBarWhenIdle, NULL);
- DrawMenuBarWhenIdle(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 *parentEntryPtr = GetParentMenuEntry(menuPtr);
-
- if (((parentEntryPtr && parentEntryPtr->state == ENTRY_DISABLED) ||
- (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);
- }
+ cmdChar = [[NSString alloc] initWithCharacters:&cmd length:1];
}
+ return [cmdChar sizeWithAttributes:
+ TkMacOSXNSFontAttributesForFont(tkfont)].width;
}
/*
@@ -3148,16 +1012,15 @@ TkpDrawMenuEntry(
*
* TkpComputeStandardMenuGeometry --
*
- * This procedure is invoked to recompute the size and
- * layout of a menu that is not a menubar clone.
+ * 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.
+ * Fields of menu entries are changed to reflect their current positions,
+ * and the size of the menu window itself may be changed.
*
*--------------------------------------------------------------
*/
@@ -3168,13 +1031,12 @@ TkpComputeStandardMenuGeometry(
{
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 modifierCharWidth, menuModifierCharWidth;
+ int x, y, modifierWidth, labelWidth, indicatorSpace;
+ int windowWidth, windowHeight, accelWidth;
+ int i, j, lastColumnBreak, maxWidth;
int entryWidth, maxIndicatorSpace, borderWidth, activeBorderWidth;
TkMenuEntry *mePtr, *columnEntryPtr;
- EntryGeometry *geometryPtr;
int haveAccel = 0;
if (menuPtr->tkwin == NULL) {
@@ -3186,25 +1048,22 @@ TkpComputeStandardMenuGeometry(
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;
+ windowHeight = maxWidth = lastColumnBreak = 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.
+ * 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);
+ menuModifierCharWidth = ModifierCharWidth(menuFont);
for (i = 0; i < menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
@@ -3219,10 +1078,12 @@ TkpComputeStandardMenuGeometry(
if (mePtr->fontPtr == NULL) {
tkfont = menuFont;
fmPtr = &menuMetrics;
+ modifierCharWidth = menuModifierCharWidth;
} else {
tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr);
Tk_GetFontMetrics(tkfont, &entryMetrics);
fmPtr = &entryMetrics;
+ modifierCharWidth = ModifierCharWidth(tkfont);
}
if ((i > 0) && mePtr->columnBreak) {
@@ -3231,120 +1092,106 @@ TkpComputeStandardMenuGeometry(
}
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;
+ maxWidth = maxIndicatorSpace = 0;
lastColumnBreak = i;
y = borderWidth;
}
- geometryPtr = (EntryGeometry *) mePtr->platformEntryData;
-
- 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;
+ accelWidth = modifierWidth = indicatorSpace = 0;
+ if (mePtr->type == SEPARATOR_ENTRY || mePtr->type == TEAROFF_ENTRY) {
+ mePtr->height = menuSeparatorHeight;
} 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.
+ * 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;
+ NSMenuItem *menuItem = (NSMenuItem *) mePtr->platformEntryData;
+ int haveImage = 0, width = 0, height = 0;
- nonAccelMargin = 0;
- if (mePtr->type == CASCADE_ENTRY) {
- GetMenuAccelGeometry(menuPtr, mePtr, tkfont, fmPtr,
- &modifierWidth, &accelWidth, &height);
- } else if (mePtr->accelLength == 0) {
- if (haveAccel && !mePtr->hideMargin) {
- if (IS_THEME_MENU_FONT(tkfont)) {
- nonAccelMargin = menuSymbols[COMMAND_SYMBOL].width;
- } else {
- nonAccelMargin = Tk_TextWidth(tkfont,
- menuSymbols[COMMAND_SYMBOL].utf,
- menuSymbols[COMMAND_SYMBOL].utfLen);
- }
+ if (mePtr->image) {
+ Tk_SizeOfImage(mePtr->image, &width, &height);
+ haveImage = 1;
+ } else if (mePtr->bitmapPtr) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin,
+ mePtr->bitmapPtr);
+
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, &width, &height);
+ haveImage = 1;
+ }
+ if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
+ NSAttributedString *attrTitle = [menuItem attributedTitle];
+ NSSize size;
+
+ if (attrTitle) {
+ size = [attrTitle size];
+ } else {
+ size = [[menuItem title] sizeWithAttributes:
+ TkMacOSXNSFontAttributesForFont(tkfont)];
}
- accelWidth = modifierWidth = 0;
- } else {
- GetMenuAccelGeometry(menuPtr, mePtr, tkfont,
- fmPtr, &modifierWidth, &accelWidth, &height);
- if (height > mePtr->height) {
- mePtr->height = height;
+ size.width += menuTextLeadingEdgeMargin +
+ menuTextTrailingEdgeMargin;
+ if (size.height < fmPtr->linespace) {
+ size.height = fmPtr->linespace;
+ }
+ if (haveImage && (mePtr->compound != COMPOUND_NONE)) {
+ int margin = width + menuIconTrailingEdgeMargin;
+
+ if (margin > menuTextLeadingEdgeMargin) {
+ margin = menuTextLeadingEdgeMargin;
+ }
+ width += size.width + menuIconTrailingEdgeMargin - margin;
+ if (size.height > height) {
+ height = size.height;
+ }
+ } else {
+ width = size.width;
+ height = size.height;
}
}
+ labelWidth = width + menuItemExtraWidth;
+ mePtr->height = height + menuItemExtraHeight;
- if (!(mePtr->hideMargin)) {
- GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont,
- fmPtr, &indicatorSpace, &height);
- if (height > mePtr->height) {
- mePtr->height = height;
+ if (mePtr->type == CASCADE_ENTRY) {
+ modifierWidth = modifierCharWidth;
+ } else if (mePtr->accelLength == 0) {
+ if (haveAccel && !mePtr->hideMargin) {
+ modifierWidth = modifierCharWidth;
}
} else {
- indicatorSpace = 0;
- }
+ NSUInteger modifMask = [menuItem keyEquivalentModifierMask];
+ int i = 0;
- if (nonAccelMargin > maxNonAccelMargin) {
- maxNonAccelMargin = nonAccelMargin;
- }
- if (accelWidth > maxAccelTextWidth) {
- maxAccelTextWidth = accelWidth;
+ while (modifiers[i].name) {
+ if (modifMask & modifiers[i].mask) {
+ modifMask &= ~modifiers[i].mask;
+ modifierWidth += modifierCharWidth;
+ }
+ i++;
+ }
+ accelWidth = [[menuItem keyEquivalent] sizeWithAttributes:
+ TkMacOSXNSFontAttributesForFont(tkfont)].width;
}
- if (modifierWidth > maxModifierWidth) {
- maxModifierWidth = modifierWidth;
+ if (!mePtr->hideMargin) {
+ indicatorSpace = menuMarkColumnWidth;
}
if (indicatorSpace > maxIndicatorSpace) {
maxIndicatorSpace = indicatorSpace;
}
-
- entryWidth = labelWidth + modifierWidth + accelWidth
- + nonAccelMargin;
-
+ entryWidth = labelWidth + modifierWidth + accelWidth;
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;
@@ -3356,33 +1203,16 @@ TkpComputeStandardMenuGeometry(
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;
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;
}
@@ -3396,353 +1226,7 @@ TkpComputeStandardMenuGeometry(
/*
*----------------------------------------------------------------------
*
- * 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.
- *
- *----------------------------------------------------------------------
- */
-
-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 imageWidth, imageHeight, textWidth = 0, textHeight = 0;
- int indicatorSpace = mePtr->indicatorSpace;
- int leftEdge = x + indicatorSpace;
- int haveImage = 0, haveText = 0;
- int imageXOffset = 0, imageYOffset = 0;
- int textXOffset = 0, textYOffset = 0;
- Pixmap bitmap = (Pixmap) NULL;
- Tcl_DString itemTextDString;
-
- /*
- * 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) {
- 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) {
- GetEntryText(mePtr, &itemTextDString);
- if (mePtr->compound != COMPOUND_NONE) {
- textWidth = Tk_TextWidth(tkfont,
- Tcl_DStringValue(&itemTextDString),
- Tcl_DStringLength(&itemTextDString)) +
- menuTextLeadingEdgeMargin + menuTextTrailingEdgeMargin;
- textHeight = fmPtr->linespace;
- }
- haveText = 1;
- }
- }
-
- /*
- * Now work out what the relative positions are.
- */
-
- if (haveImage && haveText && (mePtr->compound != COMPOUND_NONE)) {
- 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:
- /*
- * Position image in the indicator space to the left of the
- * entries, unless this entry is a radio|check button because
- * then the indicator space will be used.
- */
-
- textXOffset = imageWidth + 2 - menuTextLeadingEdgeMargin;
- if ((mePtr->type != CHECK_BUTTON_ENTRY)
- && (mePtr->type != RADIO_BUTTON_ENTRY)) {
- textXOffset -= indicatorSpace;
- imageXOffset = -indicatorSpace;
- }
- if (textXOffset < 0) {
- textXOffset = 0;
- }
- break;
- case COMPOUND_RIGHT:
- imageXOffset = textWidth + 2 - menuTextTrailingEdgeMargin;
- break;
- case COMPOUND_CENTER:
- textXOffset = (fullWidth - textWidth)/2;
- imageXOffset = (fullWidth - imageWidth)/2;
- break;
- case COMPOUND_NONE:
- /*
- * Never reached.
- */
- break;
- }
- }
-
- /*
- * 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 + imageXOffset,
- y + (mePtr->height - imageHeight)/2 + imageYOffset);
- } else {
- Tk_RedrawImage(mePtr->image, 0, 0, imageWidth, imageHeight,
- d, leftEdge + imageXOffset,
- y + (mePtr->height - imageHeight)/2 + imageYOffset);
- }
- } else if (mePtr->bitmapPtr != NULL) {
- XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, imageWidth,
- imageHeight, leftEdge + imageXOffset,
- y + (mePtr->height - imageHeight)/2 + imageYOffset, 1);
- }
- if (haveText) {
- int baseline = y + (height + fmPtr->ascent - fmPtr->descent)/2;
-
- Tk_DrawChars(menuPtr->display, d, gc, tkfont,
- Tcl_DStringValue(&itemTextDString),
- Tcl_DStringLength(&itemTextDString),
- leftEdge + menuTextLeadingEdgeMargin + textXOffset,
- baseline + textYOffset);
- Tcl_DStringFree(&itemTextDString);
- }
-
- if (mePtr->state == ENTRY_DISABLED) {
- if (menuPtr->disabledFgPtr == NULL) {
- /* XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
- width, height); */
- } else if ((mePtr->image != NULL)
- && (menuPtr->disabledImageGC != None)) {
- XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
- leftEdge + imageXOffset,
- y + (mePtr->height - imageHeight)/2 + imageYOffset,
- imageWidth, 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.
- *
- *----------------------------------------------------------------------
- */
-
-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.
- *
- *----------------------------------------------------------------------
- */
-
-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;
- int haveImage = 0, tornOff = (menuPtr->menuType == TEAROFF_MENU);
-#ifdef USE_TK_MDEF
- const int useMDEF = ((MacMenu *) menuPtr->platformData)->useMDEF;
-#endif
-
- if (mePtr->image != NULL && (useMDEF || tornOff)) {
- Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
- haveImage = 1;
- } else if (mePtr->bitmapPtr != NULL && (useMDEF || tornOff)) {
- Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
- Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
- haveImage = 1;
- }
- if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
- int textWidth = 0, textHeight = fmPtr->linespace;
-
- if (mePtr->labelPtr != NULL) {
- Tcl_DString itemTextDString;
-
- GetEntryText(mePtr, &itemTextDString);
- textWidth = Tk_TextWidth(tkfont,
- Tcl_DStringValue(&itemTextDString),
- Tcl_DStringLength(&itemTextDString)) +
- menuTextLeadingEdgeMargin + menuTextTrailingEdgeMargin;
- Tcl_DStringFree(&itemTextDString);
-
- if (haveImage && (mePtr->compound != COMPOUND_NONE)) {
- switch ((enum compound) mePtr->compound) {
- int margin;
-
- case COMPOUND_TOP:
- case COMPOUND_BOTTOM:
- if (textWidth > *widthPtr) {
- *widthPtr = textWidth;
- }
- *heightPtr += textHeight + 2;
- break;
- case COMPOUND_LEFT:
- margin = *widthPtr + 2;
- if (margin > menuTextLeadingEdgeMargin) {
- margin = menuTextLeadingEdgeMargin;
- }
- *widthPtr += textWidth + 2 - margin;
- if (textHeight > *heightPtr) {
- *heightPtr = textHeight;
- }
- break;
- case COMPOUND_RIGHT:
- margin = menuTextTrailingEdgeMargin;
- *widthPtr += textWidth + 2 - margin;
- if (textHeight > *heightPtr) {
- *heightPtr = textHeight;
- }
- break;
- case COMPOUND_CENTER:
- if (textWidth > *widthPtr) {
- *widthPtr = textWidth;
- }
- if (textHeight > *heightPtr) {
- *heightPtr = textHeight;
- }
- break;
- case COMPOUND_NONE:
- /*
- * Never reached.
- */
- break;
- }
- goto labelGeomDone;
- }
- }
- *widthPtr = textWidth;
- *heightPtr = textHeight;
- }
-
-labelGeomDone:
- *heightPtr += menuItemExtraHeight;
- *widthPtr += menuItemExtraWidth;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXGenerateParentMenuSelectEvent --
- *
- * Respond to a hierarchical menu being opened.
- *
- * Results:
- * True if event(s) are generated - false otherwise.
- *
- * Side effects:
- * Places a virtual event on the event queue.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkMacOSXGenerateParentMenuSelectEvent(
- MenuRef menu)
-{
- TkMenu *menuPtr = MenuPtrForMenuRef(menu);
-
- if (menuPtr) {
- TkMenuEntry *parentEntryPtr = GetParentMenuEntry(menuPtr);
-
- if (parentEntryPtr && (menuPtr = parentEntryPtr->menuPtr)) {
- TkActivateMenuEntry(menuPtr, parentEntryPtr->index);
- MenuSelectEvent(menuPtr);
- Tcl_ServiceAll();
- return true;
- }
- }
- return false;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXGenerateMenuSelectEvent --
+ * GenerateMenuSelectEvent --
*
* Respond to a menu item being selected.
*
@@ -3756,34 +1240,34 @@ TkMacOSXGenerateParentMenuSelectEvent(
*/
int
-TkMacOSXGenerateMenuSelectEvent(
- MenuRef menu,
- MenuItemIndex index)
+GenerateMenuSelectEvent(
+ TKMenu *menu,
+ NSMenuItem *menuItem)
{
- TkMenu *menuPtr = MenuPtrForMenuRef(menu);
- int item = index - 1;
+ TkMenu *menuPtr = [menu tkMenu];
if (menuPtr) {
- if (item < 0 || item >= menuPtr->numEntries ||
- (menuPtr->entries[item])->state == ENTRY_DISABLED) {
+ int index = [menu tkIndexOfItem:menuItem];
+
+ if (index < 0 || index >= menuPtr->numEntries ||
+ (menuPtr->entries[index])->state == ENTRY_DISABLED) {
TkActivateMenuEntry(menuPtr, -1);
} else {
- TkActivateMenuEntry(menuPtr, item);
+ TkActivateMenuEntry(menuPtr, index);
MenuSelectEvent(menuPtr);
- Tcl_ServiceAll();
return true;
}
}
return false;
}
-
+
/*
*----------------------------------------------------------------------
*
* MenuSelectEvent --
*
- * Generates a "MenuSelect" virtual event. This can be used to
- * do context-sensitive menu help.
+ * Generates a "MenuSelect" virtual event. This can be used to do
+ * context-sensitive menu help.
*
* Results:
* None.
@@ -3802,46 +1286,22 @@ MenuSelectEvent(
bzero(&event, sizeof(XVirtualEvent));
event.type = VirtualEvent;
- event.serial = menuPtr->display->request;
+ event.serial = LastKnownRequestProcessed(menuPtr->display);
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();
-
XQueryPointer(NULL, None, NULL, NULL, &event.x_root, &event.y_root, NULL,
NULL, &event.state);
event.same_screen = true;
event.name = Tk_GetUid("MenuSelect");
- Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXClearActiveMenu --
- *
- * Clears Tk's active entry for the given MenuRef.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Generates <<MenuSelect>> virtual events.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TkMacOSXClearActiveMenu(
- MenuRef menu)
-{
- TkMenu *menuPtr = MenuPtrForMenuRef(menu);
-
- if (menuPtr) {
- RecursivelyClearActiveMenu(menuPtr);
+ Tk_MakeWindowExist(menuPtr->tkwin);
+ if (Tcl_GetServiceMode() != TCL_SERVICE_NONE) {
+ Tk_HandleEvent((XEvent *) &event);
+ } else {
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
}
}
@@ -3866,16 +1326,15 @@ RecursivelyClearActiveMenu(
TkMenu *menuPtr) /* The menu to reset. */
{
int i;
- TkMenuEntry *mePtr;
TkActivateMenuEntry(menuPtr, -1);
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);
- }
+ TkMenuEntry *mePtr = menuPtr->entries[i];
+
+ if (mePtr->type == CASCADE_ENTRY
+ && (mePtr->childMenuRefPtr != NULL)
+ && (mePtr->childMenuRefPtr->menuPtr != NULL)) {
+ RecursivelyClearActiveMenu(mePtr->childMenuRefPtr->menuPtr);
}
}
}
@@ -3899,20 +1358,13 @@ RecursivelyClearActiveMenu(
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);
- }
- }
+ NSMenu *mainMenu = [NSApp mainMenu];
+
+ if (mainMenu && [mainMenu isKindOfClass:[TKMenu class]]) {
+ TkMenu *menuPtr = [(TKMenu *) mainMenu tkMenu];
+
+ if (menuPtr && menuPtr->numEntries && menuPtr->entries) {
+ RecursivelyClearActiveMenu(menuPtr);
}
}
}
@@ -3920,29 +1372,25 @@ TkMacOSXClearMenubarActive(void)
/*
*----------------------------------------------------------------------
*
- * TkpMenuNotifyToplevelCreate --
+ * Tk_MacOSXTurnOffMenus --
*
- * 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.
+ * 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:
- * An idle handler is set up to do the reconfiguration.
+ * A flag is set which will disable all menu drawing.
*
*----------------------------------------------------------------------
*/
void
-TkpMenuNotifyToplevelCreate(
- Tcl_Interp *interp, /* The interp the menu lives in. */
- char *menuName) /* The name of the menu to reconfigure. */
+Tk_MacOSXTurnOffMenus(void)
{
- /*
- * Nothing to do.
- */
+ gNoTkMenus = 1;
}
/*
@@ -3964,66 +1412,46 @@ TkpMenuNotifyToplevelCreate(
void
TkpMenuInit(void)
{
- MenuSymbol *ms = menuSymbols;
- CFStringRef cfStr;
-
- lastMenuID = 256;
- Tcl_InitHashTable(&commandTable, TCL_ONE_WORD_KEYS);
- currentMenuBarOwner = NULL;
- currentAppleMenuID = 0;
- currentHelpMenuID = 0;
- currentMenuBarInterp = NULL;
- currentMenuBarName = NULL;
- windowListPtr = NULL;
-
-#ifdef USE_TK_MDEF
- tkThemeMenuItemDrawingUPP
- = NewMenuItemDrawingUPP(ThemeMenuItemDrawingProc);
- useMDEFVar = Tcl_NewStringObj("::tk::mac::useCustomMDEF", -1);
- macMDEFDrawable.winPtr = NULL;
- macMDEFDrawable.xOff = 0;
- macMDEFDrawable.yOff = 0;
- macMDEFDrawable.visRgn = NULL;
- macMDEFDrawable.aboveVisRgn = NULL;
- macMDEFDrawable.drawRect = CGRectNull;
- macMDEFDrawable.referenceCount = 0;
- macMDEFDrawable.toplevel = NULL;
- macMDEFDrawable.flags = 0;
- macMDEFDrawable.grafPtr = NULL;
- macMDEFDrawable.context = NULL;
- macMDEFDrawable.size = CGSizeZero;
-#endif
+ TkColor *tkColPtr;
+
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+
+#define observe(n, s) \
+ [nc addObserver:NSApp selector:@selector(s) name:(n) object:nil]
+ observe(NSMenuDidBeginTrackingNotification, menuBeginTracking:);
+ observe(NSMenuDidEndTrackingNotification, menuEndTracking:);
+#undef observe
+
+ [NSMenuItem setUsesUserKeyEquivalents:NO];
+ tkColPtr = TkpGetColor(None, DEF_MENU_BG_COLOR);
+ defaultBg = tkColPtr->color.pixel;
+ ckfree(tkColPtr);
+ tkColPtr = TkpGetColor(None, DEF_MENU_FG);
+ defaultFg = tkColPtr->color.pixel;
+ ckfree(tkColPtr);
ChkErr(GetThemeMetric, kThemeMetricMenuMarkColumnWidth,
&menuMarkColumnWidth);
- ChkErr(GetThemeMetric, kThemeMetricMenuMarkIndent, &menuMarkIndent);
ChkErr(GetThemeMetric, kThemeMetricMenuTextLeadingEdgeMargin,
&menuTextLeadingEdgeMargin);
ChkErr(GetThemeMetric, kThemeMetricMenuTextTrailingEdgeMargin,
&menuTextTrailingEdgeMargin);
+ ChkErr(GetThemeMetric, kThemeMetricMenuIconTrailingEdgeMargin,
+ &menuIconTrailingEdgeMargin);
ChkErr(GetThemeMenuItemExtra, kThemeMenuItemPlain, &menuItemExtraHeight,
&menuItemExtraWidth);
ChkErr(GetThemeMenuSeparatorHeight, &menuSeparatorHeight);
-
- while (ms->unicode) {
- ms->utfLen = Tcl_UniCharToUtf(ms->unicode, ms->utf);
- ms->utf[ms->utfLen] = 0;
- cfStr = CFStringCreateWithCharacters(NULL, &ms->unicode, 1);
- if (cfStr) {
- ms->width = MeasureThemeText(cfStr, kThemeMenuItemCmdKeyFont);
- CFRelease(cfStr);
- }
- ms++;
- }
}
+
+#pragma mark -
+#pragma mark NOPs
/*
*----------------------------------------------------------------------
*
* TkpMenuThreadInit --
*
- * Does platform-specific initialization of thread-specific
- * menu state.
+ * Does platform-specific initialization of thread-specific menu state.
*
* Results:
* None.
@@ -4045,696 +1473,273 @@ TkpMenuThreadInit(void)
/*
*----------------------------------------------------------------------
*
- * TkpPreprocessMacMenu --
+ * TkpMenuNotifyToplevelCreate --
*
- * Handle preprocessing of menubar if it exists.
+ * This routine reconfigures the menu and the clones indicated by
+ * menuName because a toplevel has been created and any system menus need
+ * to be created. Only applicable to Windows.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * All post commands for the current menubar get executed.
+ * An idle handler is set up to do the reconfiguration.
*
*----------------------------------------------------------------------
*/
void
-TkMacOSXPreprocessMenu(void)
+TkpMenuNotifyToplevelCreate(
+ Tcl_Interp *interp, /* The interp the menu lives in. */
+ const char *menuName) /* The name of the menu to reconfigure. */
{
- if ((currentMenuBarName != NULL) && (currentMenuBarInterp != NULL)) {
- TkMenuReferences *mbRefPtr =
- TkFindMenuReferences(currentMenuBarInterp,currentMenuBarName);
-
- if ((mbRefPtr != NULL) && (mbRefPtr->menuPtr != NULL)) {
- int code;
-
- 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);
- }
- }
+ /*
+ * Nothing to do.
+ */
}
-#ifdef USE_TK_MDEF
-#pragma mark MDEF
/*
- *----------------------------------------------------------------------
+ *--------------------------------------------------------------
*
- * MenuDefProc --
+ * TkpInitializeMenuBindings --
*
- * This routine is the MDEF handler for Tk. It receives all messages
- * for the menu and dispatches them.
+ * For every interp, initializes the bindings for Windows menus. Does
+ * nothing on Mac or XWindows.
*
* 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.
+ * 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
-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? */
+TkpInitializeMenuBindings(
+ Tcl_Interp *interp, /* The interpreter to set. */
+ Tk_BindingTable bindingTable)
+ /* The table to add to. */
{
- TkMenu *menuPtr;
- Tcl_HashEntry *commandEntryPtr;
- MenuID menuID;
-
- menuID = GetMenuID(menu);
- commandEntryPtr = Tcl_FindHashEntry(&commandTable, (char*)(intptr_t)menuID);
-
- if (!commandEntryPtr) return;
- menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
+ /*
+ * 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.
+ *
+ *--------------------------------------------------------------
+ */
- 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:
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: DrawItemsMsg");
-#endif
- /*
- * We do nothing here, because we don't support the Menu Managers
- * dynamic item groups
- */
- break;
- case kMenuThemeSavvyMsg:
- *whichItem = kThemeSavvyMenuResponse;
- break;
- case kMenuSizeMsg:
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: SizeMsg %d, %d", hitPt.h, hitPt.v);
-#endif
- SetMenuWidth(menu, hitPt.h < menuPtr->totalWidth ? hitPt.h :
- menuPtr->totalWidth);
- SetMenuHeight(menu, hitPt.v < menuPtr->totalHeight ? hitPt.v :
- menuPtr->totalHeight);
- break;
- case kMenuDrawMsg:
- HandleMenuDrawMsg(menu, menuRectPtr, hitPt, whichItem, menuPtr);
- break;
- case kMenuFindItemMsg:
- HandleMenuFindItemMsg(menu, menuRectPtr, hitPt, whichItem,
- menuPtr);
- break;
- case kMenuPopUpMsg:
- HandleMenuPopUpMsg(menu, menuRectPtr, hitPt, whichItem, menuPtr);
- break;
- }
+void
+TkpComputeMenubarGeometry(
+ TkMenu *menuPtr) /* Structure describing menu. */
+{
+ TkpComputeStandardMenuGeometry(menuPtr);
}
+
/*
*----------------------------------------------------------------------
*
- * HandleMenuHiliteMsg --
+ * TkpDrawMenuEntry --
*
- * Handles the MenuDefProc's hilite message.
+ * Draws the given menu entry at the given coordinates with the given
+ * attributes.
*
* Results:
- * A menu entry is drawn
+ * None.
*
* Side effects:
- * None
+ * X Server commands are executed to display the menu entry.
*
*----------------------------------------------------------------------
*/
void
-HandleMenuHiliteMsg(
- MenuRef menu,
- Rect *menuRectPtr,
- Point hitPt,
- SInt16 *whichItem,
- TkMenu *menuPtr)
+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. */
{
- OSStatus err;
- Tk_Font tkfont;
- Tk_FontMetrics fontMetrics;
- MDEFHiliteItemData *hidPtr = (MDEFHiliteItemData *)whichItem;
- int oldItem = hidPtr->previousItem - 1;
- int newItem = hidPtr->newItem - 1;
- MenuTrackingData mtd, *mtdPtr = &mtd;
-
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: HiliteMsg %d -> %d", hidPtr->previousItem,
- hidPtr->newItem);
-#endif
- GetPort(&macMDEFDrawable.grafPtr);
- macMDEFDrawable.context = (CGContextRef) hidPtr->context;
-
- err = ChkErr(GetMenuTrackingData, menu, mtdPtr);
- if (err != noErr) {
- return;
- }
-
- tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
- Tk_GetFontMetrics(tkfont, &fontMetrics);
- if (oldItem >= 0) {
- AppearanceEntryDrawWrapper(menuPtr->entries[oldItem], menuRectPtr,
- mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics, tkfont, 1);
- }
- if (newItem >= 0) {
- AppearanceEntryDrawWrapper(menuPtr->entries[newItem], menuRectPtr,
- mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics, tkfont, 0);
- }
}
+
+#pragma mark Obsolete
/*
*----------------------------------------------------------------------
*
- * HandleMenuDrawMsg --
+ * TkMacOSXPreprocessMenu --
*
- * Handles the MenuDefProc's draw message.
+ * Handle preprocessing of menubar if it exists.
*
* Results:
- * A menu entry is drawn
+ * None.
*
* Side effects:
- * None
+ * All post commands for the current menubar get executed.
*
*----------------------------------------------------------------------
*/
void
-HandleMenuDrawMsg(
- MenuRef menu,
- Rect *menuRectPtr,
- Point hitPt,
- SInt16 *whichItem,
- TkMenu *menuPtr)
+TkMacOSXPreprocessMenu(void)
{
- Tk_Font menuFont;
- Tk_FontMetrics fontMetrics;
- TkMenuEntry *mePtr;
- int i;
- Rect menuClipRect, bounds;
- MDEFDrawData *ddPtr = (MDEFDrawData*)whichItem;
- MenuTrackingData *mtdPtr = &(ddPtr->trackingData);
- TkWindow *winPtr = (TkWindow*)menuPtr->tkwin;
-
- GetPort(&macMDEFDrawable.grafPtr);
- GetPortBounds(macMDEFDrawable.grafPtr, &bounds);
- macMDEFDrawable.context = (CGContextRef) ddPtr->context;
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: DrawMsg %d - %d; %d - %d", menuRectPtr->top,
- menuRectPtr->bottom, bounds.top, bounds.bottom);
-#endif
- winPtr->changes.x = menuRectPtr->left;
- winPtr->changes.y = menuRectPtr->top;
- winPtr->changes.width = menuRectPtr->right - menuRectPtr->left;
- winPtr->changes.height = menuRectPtr->bottom - menuRectPtr->top;
- TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
- 0, 0, -1, -1);
-#if 0
- if (menuPtr->menuRefPtr->topLevelListPtr != NULL) {
- menuType = kThemeMenuTypePullDown;
- } else if (menuPtr->menuRefPtr->parentEntryPtr != NULL) {
- menuType = kThemeMenuTypeHierarchical;
- } else {
- menuType = kThemeMenuTypePopUp;
- }
-#endif
- DrawMenuBackground(menuPtr, menuRectPtr, (Drawable) &macMDEFDrawable);
- menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
- Tk_GetFontMetrics(menuFont, &fontMetrics);
- menuClipRect = *menuRectPtr;
- mtdPtr->virtualMenuBottom = mtdPtr->virtualMenuTop + menuPtr->totalHeight;
-
- /*
- * Next, figure out scrolling information.
- */
-
- if ((menuRectPtr->bottom - menuRectPtr->top) < menuPtr->totalHeight) {
- short arrowHeight = fontMetrics.linespace + 1;
- Rect arrowRect, eraseRect;
- ThemeMenuState menuState = IsMenuItemEnabled(menu, 0) ?
- kThemeMenuActive : kThemeMenuDisabled;
-
- if (mtdPtr->virtualMenuTop < menuRectPtr->top) {
- arrowRect = bounds;
- /*arrowRect.top += 1;*/
- arrowRect.bottom = arrowRect.top + arrowHeight;
- eraseRect = arrowRect;
- eraseRect.top = menuRectPtr->top;
- menuClipRect.top = arrowRect.bottom;
- ChkErr(EraseMenuBackground, menu, &eraseRect,
- macMDEFDrawable.context);
- ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
- mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom,
- menuState, kThemeMenuItemScrollUpArrow, NULL, 0);
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("upArrow: %d - %d, %d - %d", arrowRect.top,
- arrowRect.bottom, arrowRect.left, arrowRect.right);
-#endif
- }
- if (mtdPtr->virtualMenuBottom > menuRectPtr->bottom) {
- arrowRect = bounds;
- arrowRect.bottom -= 1;
- arrowRect.top = arrowRect.bottom - arrowHeight;
- eraseRect = arrowRect;
- eraseRect.bottom = menuRectPtr->bottom;
- menuClipRect.bottom = arrowRect.top;
- ChkErr(EraseMenuBackground, menu, &eraseRect,
- macMDEFDrawable.context);
- ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
- mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom,
- menuState, kThemeMenuItemScrollDownArrow, NULL, 0);
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("downArrow: %d - %d, %d - %d", arrowRect.top,
- arrowRect.bottom, arrowRect.left, arrowRect.right);
-#endif
- }
- TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
- menuClipRect.left, menuClipRect.top, menuClipRect.right -
- menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
- }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * 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.
- */
+int
+TkMacOSXUseMenuID(
+ short macID) /* The id to take out of the table */
+{
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDispatchMenuEvent --
+ *
+ * Given a menu id and an item, dispatches the command associated with
+ * it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands for the event are scheduled for execution at idle time.
+ *
+ *----------------------------------------------------------------------
+ */
- for (i = 0; i < menuPtr->numEntries; i++) {
- mePtr = menuPtr->entries[i];
- if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height <
- menuClipRect.top || mtdPtr->virtualMenuTop + mePtr->y >
- menuClipRect.bottom) {
- continue;
- }
- AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
- (Drawable) &macMDEFDrawable, &fontMetrics, menuFont, 0);
- }
- MDEFScrollFlag = 1;
+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. */
+{
+ return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
- * HandleMenuFindItemMsg --
+ * TkMacOSXHandleTearoffMenu() --
*
- * 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.
+ * 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:
- * The Menu system is informed of the selected item & the item
- * under the mouse.
+ * menuPtr->interp will have the result of the tearoff command.
*
* Side effects:
- * The menu might get scrolled.
+ * A new tearoff menu is created if it is supposed to be.
*
*----------------------------------------------------------------------
*/
+
void
-HandleMenuFindItemMsg(
- MenuRef menu,
- Rect *menuRectPtr,
- Point hitPt,
- SInt16 *whichItem,
- TkMenu *menuPtr)
+TkMacOSXHandleTearoffMenu(void)
{
- Tk_Font menuFont;
- Tk_FontMetrics fontMetrics;
- TkMenuEntry *mePtr;
- int i, newItem = -1, itemUnderMouse = -1;
- Rect itemRect = {0, 0, 0, 0}, menuClipRect, bounds;
- int hasTopScroll, hasBottomScroll;
- MDEFFindItemData *fiPtr = (MDEFFindItemData *)whichItem;
- MenuTrackingData *mtdPtr = &(fiPtr->trackingData), topMtd;
- enum {
- DONT_SCROLL, DOWN_SCROLL, UP_SCROLL
- } scrollDirection;
- short arrowHeight;
-
-#ifdef TK_MAC_DEBUG_MENUS
- static Point lastHitPt = {0, 0};
- if (hitPt.h != lastHitPt.h || hitPt.v != lastHitPt.v) {
- lastHitPt = hitPt;
- TkMacOSXDbgMsg("MDEF: FindItemMsg: %d, %d", hitPt.h, hitPt.v);
- }
-#endif
-
- GetPort(&macMDEFDrawable.grafPtr);
- GetPortBounds(macMDEFDrawable.grafPtr, &bounds);
- macMDEFDrawable.context = (CGContextRef) fiPtr->context;
-
/*
- * Now we need to take care of scrolling the menu.
- */
-
- menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
- Tk_GetFontMetrics(menuFont, &fontMetrics);
- arrowHeight = fontMetrics.linespace + 1;
- menuClipRect = *menuRectPtr;
- hasTopScroll = mtdPtr->virtualMenuTop < menuRectPtr->top;
- hasBottomScroll = mtdPtr->virtualMenuBottom > menuRectPtr->bottom;
- scrollDirection = DONT_SCROLL;
- if (hasTopScroll) {
- menuClipRect.top = bounds.top + arrowHeight;
- if (hitPt.v < menuClipRect.top) {
- newItem = -1;
- scrollDirection = DOWN_SCROLL;
- }
- }
- if (hasBottomScroll) {
- menuClipRect.bottom = bounds.bottom - 1 - arrowHeight;
- if (hitPt.v > menuClipRect.bottom) {
- newItem = -1;
- scrollDirection = UP_SCROLL;
- }
- }
- if (MDEFScrollFlag) {
- scrollDirection = DONT_SCROLL;
- MDEFScrollFlag = 0;
- }
- /*
- * Don't scroll if there are other menus open above us
+ * Obsolete: Nothing to do.
*/
- ChkErr(GetMenuTrackingData, NULL, &topMtd);
- if (menu != topMtd.menu) {
- scrollDirection = DONT_SCROLL;
- }
- if (scrollDirection == DONT_SCROLL) {
- /*
- * 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;
- itemRect.right = mePtr->entryFlags & ENTRY_LAST_COLUMN ?
- menuRectPtr->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 *parentEntryPtr =
- GetParentMenuEntry(menuPtr);
-
- if (parentEntryPtr &&
- parentEntryPtr->state == ENTRY_DISABLED) {
- newItem = -1;
- itemUnderMouse = i;
- } else {
- newItem = i;
- itemUnderMouse = i;
- }
- }
- break;
- }
- }
- }
- } else {
- short scrollAmt;
- unsigned long scrollDelay;
- Rect arrowRect, eraseRect, scrolledMenuClipRect;
- ThemeMenuState menuState = IsMenuItemEnabled(menu, 0) ?
- kThemeMenuActive : kThemeMenuDisabled;
- int oldItem = mtdPtr->itemSelected - 1;
- short d;
-
- TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
- 0, 0, -1, -1);
- scrollAmt = fontMetrics.linespace + menuItemExtraHeight;
- if (scrollDirection == UP_SCROLL) {
- scrollAmt = -scrollAmt;
- d = hitPt.v - bounds.bottom;
- } else {
- d = bounds.top - hitPt.v;
- }
- scrollDelay = (d >= scrollAmt/2) ? 1 : 10;
- menuClipRect = *menuRectPtr;
- if (mtdPtr->virtualMenuTop + scrollAmt < menuRectPtr->top) {
- arrowRect = bounds;
- /*arrowRect.top += 1;*/
- arrowRect.bottom = arrowRect.top + arrowHeight;
- eraseRect = arrowRect;
- eraseRect.top = menuRectPtr->top;
- menuClipRect.top = arrowRect.bottom;
- if (!hasTopScroll) {
- ChkErr(EraseMenuBackground, menu, &eraseRect,
- macMDEFDrawable.context);
- ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
- mtdPtr->virtualMenuTop + scrollAmt,
- mtdPtr->virtualMenuBottom + scrollAmt,
- menuState, kThemeMenuItemScrollUpArrow, NULL, 0);
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("upArrow: %d - %d, %d - %d", arrowRect.top,
- arrowRect.bottom, arrowRect.left, arrowRect.right);
-#endif
- }
- }
- if (mtdPtr->virtualMenuBottom + scrollAmt > menuRectPtr->bottom) {
- arrowRect = bounds;
- arrowRect.bottom -= 1;
- arrowRect.top = arrowRect.bottom - arrowHeight;
- eraseRect = arrowRect;
- eraseRect.bottom = menuRectPtr->bottom;
- menuClipRect.bottom = arrowRect.top;
- if (!hasBottomScroll) {
- ChkErr(EraseMenuBackground, menu, &eraseRect,
- macMDEFDrawable.context);
- ChkErr(DrawThemeMenuItem, menuRectPtr, &arrowRect,
- mtdPtr->virtualMenuTop + scrollAmt,
- mtdPtr->virtualMenuBottom + scrollAmt,
- menuState, kThemeMenuItemScrollDownArrow, NULL, 0);
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("downArrow: %d - %d, %d - %d", arrowRect.top,
- arrowRect.bottom, arrowRect.left, arrowRect.right);
-#endif
- }
- }
- TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
- menuClipRect.left, menuClipRect.top, menuClipRect.right -
- menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
- TkActivateMenuEntry(menuPtr, -1);
- if (oldItem >= 0) {
- AppearanceEntryDrawWrapper(menuPtr->entries[oldItem], menuRectPtr,
- mtdPtr, (Drawable) &macMDEFDrawable, &fontMetrics,
- menuFont, 1);
- }
- ChkErr(ScrollMenuImage, menu, &menuClipRect, 0, scrollAmt,
- macMDEFDrawable.context);
- mtdPtr->virtualMenuTop += scrollAmt;
- mtdPtr->virtualMenuBottom += scrollAmt;
- scrolledMenuClipRect = menuClipRect;
- OffsetRect(&scrolledMenuClipRect, 0, scrollAmt);
- menuClipRect = bounds;
- if (mtdPtr->virtualMenuTop < menuRectPtr->top) {
- menuClipRect.top += arrowHeight;
- }
- if (mtdPtr->virtualMenuBottom > menuRectPtr->bottom) {
- menuClipRect.bottom -= arrowHeight;
- }
- TkpClipDrawableToRect(menuPtr->display, (Drawable) &macMDEFDrawable,
- menuClipRect.left, menuClipRect.top, menuClipRect.right -
- menuClipRect.left, menuClipRect.bottom - menuClipRect.top);
- if (scrolledMenuClipRect.bottom < menuClipRect.bottom) {
- menuClipRect.top = scrolledMenuClipRect.bottom;
- } else if (scrolledMenuClipRect.top < menuClipRect.top) {
- menuClipRect.bottom = scrolledMenuClipRect.top;
- }
- for (i = 0; i < menuPtr->numEntries; i++) {
- mePtr = menuPtr->entries[i];
- if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height <
- menuClipRect.top || mtdPtr->virtualMenuTop + mePtr->y >
- menuClipRect.bottom) {
- continue;
- }
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("Drawing item %i", i);
-#endif
- AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
- (Drawable) &macMDEFDrawable, &fontMetrics, menuFont, 1);
- }
- Delay(scrollDelay, NULL);
- }
- mtdPtr->itemSelected = newItem + 1;
- mtdPtr->itemUnderMouse = itemUnderMouse + 1;
- mtdPtr->itemRect = itemRect;
}
/*
*----------------------------------------------------------------------
*
- * HandleMenuPopUpMsg --
+ * TkMacOSXSetHelpMenuItemCount --
*
- * Handles the MenuDefProc's PopUp message. The menu is
- * posted with the selected item at the point given in hitPt.
+ * 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.
+ * NB. Nobody uses this any more, since you can get the number of system
+ * help items from HMGetHelpMenu trivially. But it is in the stubs
+ * table...
*
* Results:
- * A menu is posted.
+ * None.
*
* Side effects:
- * None.
+ * Nothing.
*
*----------------------------------------------------------------------
*/
+
void
-HandleMenuPopUpMsg(
- MenuRef menu,
- Rect *menuRectPtr,
- Point hitPt,
- SInt16 *whichItem,
- TkMenu *menuPtr)
+TkMacOSXSetHelpMenuItemCount(void)
{
- int maxMenuHeight;
- int oldItem;
- Rect portRect;
- BitMap screenBits;
- static SInt16 menuBarHeight = 0;
-
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: PopUpMsg");
-#endif
-
- if (!menuBarHeight) {
- ChkErr(GetThemeMenuBarHeight, &menuBarHeight);
- }
- GetQDGlobalsScreenBits(&screenBits);
-
- /*
- * Note that for some oddball reason, h and v are reversed in the
- * point given to us by the MDEF.
- */
-
- oldItem = *whichItem;
- if (oldItem >= menuPtr->numEntries) {
- oldItem = -1;
- }
- portRect.top = 0;
- portRect.bottom = 1280;
- maxMenuHeight = screenBits.bounds.bottom - screenBits.bounds.top
- - menuBarHeight - SCREEN_MARGIN;
- if (menuPtr->totalHeight > maxMenuHeight) {
- menuRectPtr->top = menuBarHeight;
- } else {
- int delta;
-
- menuRectPtr->top = hitPt.h;
- if (oldItem >= 0) {
- menuRectPtr->top -= menuPtr->entries[oldItem]->y;
- }
-
- if (menuRectPtr->top < menuBarHeight) {
- /*
- * Displace downward if the menu would stick off the top of the
- * screen.
- */
-
- menuRectPtr->top = menuBarHeight + 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 == menuBarHeight) {
- *whichItem = hitPt.h;
- } else {
- *whichItem = menuRectPtr->top;
- }
}
/*
*----------------------------------------------------------------------
*
- * HandleMenuCalcItemMsg --
+ * TkMacOSXMenuClick --
*
- * 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.
+ * Prepares a menubar for MenuSelect or MenuKey.
*
* Results:
- * The Menu Manager is informed of the bounding rect of a
- * menu rect.
+ * None.
*
* Side effects:
- * None.
+ * Any pending configurations of the menubar are completed.
*
*----------------------------------------------------------------------
*/
void
-HandleMenuCalcItemMsg(
- MenuRef menu,
- Rect *menuRectPtr,
- Point hitPt,
- SInt16 *whichItem,
- TkMenu *menuPtr)
+TkMacOSXMenuClick(void)
{
- TkMenuEntry *mePtr;
- MenuTrackingData mtd, *mtdPtr = &mtd;
- OSStatus err;
- int virtualTop, item = *whichItem-1;
-
- err = ChkErr(GetMenuTrackingData, menu, mtdPtr);
- if (err == noErr) {
- virtualTop = mtdPtr->virtualMenuTop;
- } else {
- virtualTop = 0;
- }
-
- if (item >= 0 && item < menuPtr->numEntries) {
- mePtr = menuPtr->entries[item];
- 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;
- }
-#ifdef TK_MAC_DEBUG_MENUS
- TkMacOSXDbgMsg("MDEF: CalcItemMsg %d: %d, %d", *whichItem,
- menuRectPtr->left, menuRectPtr->top);
-#endif
}
-#endif /* USE_TK_MDEF */
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index ca4fe34..d6e635a 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -5,96 +5,66 @@
* menubutton widget.
*
* Copyright (c) 1996 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
-#include "tkMenu.h"
#include "tkMenubutton.h"
#include "tkMacOSXFont.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 */
-
-#define FIRST_DRAW 2
-#define ACTIVE 4
-
-MODULE_SCOPE int TkMacOSXGetNewMenuID(Tcl_Interp *interp, TkMenu *menuInstPtr,
- int cascade, short *menuIDPtr);
-MODULE_SCOPE void TkMacOSXFreeMenuID(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.
- */
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_MENUBUTTON
+#endif
+*/
typedef struct MacMenuButton {
- TkMenuButton info; /* Generic button info. */
- WindowRef windowRef;
- ControlRef userPane;
- ControlRef control;
- MenuRef menuRef;
- unsigned long userPaneBackground;
- int flags;
- MenuButtonControlParams params;
- ControlTitleParams titleParams;
- ControlButtonContentInfo bevelButtonContent;
- OpenCPicParams picParams;
+ TkMenuButton info;
+ NSPopUpButton *button;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ int fix;
+#endif
} MacMenuButton;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+
/*
- * Forward declarations for procedures defined later in this file:
+ * Use the following heuristic conversion constants to make NSButton-based
+ * widget metrics match up with the old Carbon control buttons (for the
+ * default Lucida Grande 13 font).
+ * TODO: provide a scriptable way to turn this off and use the raw NSButton
+ * metrics (will also need dynamic adjustment of the default padding,
+ * c.f. tkMacOSXDefault.h).
*/
-static OSStatus SetUserPaneDrawProc(ControlRef control,
- ControlUserPaneDrawProcPtr upp);
-static OSStatus 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 void MenuButtonEventProc(ClientData clientData, XEvent *eventPtr);
-static int UpdateControlColors(MacMenuButton *mbPtr);
-static void ComputeMenuButtonControlParams(TkMenuButton *mbPtr,
- MenuButtonControlParams * paramsPtr);
-static void ComputeControlTitleParams(TkMenuButton *mbPtr,
- ControlTitleParams *paramsPtr);
-static void CompareControlTitleParams(ControlTitleParams *p1Ptr,
- ControlTitleParams *p2Ptr, int *titleChanged, int *styleChanged);
+typedef struct {
+ int trimW, trimH, inset, shrinkW, offsetX, offsetY;
+} BoundsFix;
+
+#define fixForStyle(style) ( \
+ style == NSRoundedBezelStyle ? 1 : \
+ style == NSRegularSquareBezelStyle ? 2 : \
+ style == NSShadowlessSquareBezelStyle ? 3 : \
+ INT_MIN)
+
+static const BoundsFix boundsFixes[] = {
+ [fixForStyle(NSRoundedBezelStyle)] = { 14, 10, -2, -1},
+ [fixForStyle(NSRegularSquareBezelStyle)] = { 6, 13, -2, 1, 1},
+ [fixForStyle(NSShadowlessSquareBezelStyle)] = { 15, 0, 2 },
+};
+
+#endif
/*
- * The structure below defines menubutton class behavior by means of
- * procedures that can be invoked from generic window code.
+ * Forward declarations for procedures defined later in this file:
*/
-Tk_ClassProcs tkpMenubuttonClass = {
- sizeof(Tk_ClassProcs), /* size */
- TkMenuButtonWorldChanged, /* worldChangedProc */
-};
+static void MenuButtonEventProc(ClientData clientData, XEvent *eventPtr);
/*
@@ -117,309 +87,112 @@ TkMenuButton *
TkpCreateMenuButton(
Tk_Window tkwin)
{
- MacMenuButton *mbPtr = (MacMenuButton *) ckalloc(sizeof(MacMenuButton));
+ MacMenuButton *macButtonPtr = ckalloc(sizeof(MacMenuButton));
+ macButtonPtr->button = nil;
Tk_CreateEventHandler(tkwin, ActivateMask,
- MenuButtonEventProc, (ClientData) mbPtr);
- mbPtr->flags = 0;
- mbPtr->userPaneBackground = PIXEL_MAGIC << 24;
- mbPtr->userPane = NULL;
- mbPtr->control = NULL;
- mbPtr->menuRef = NULL;
- bzero(&mbPtr->params, sizeof(mbPtr->params));
- bzero(&mbPtr->titleParams, sizeof(mbPtr->titleParams));
-
- return (TkMenuButton *) mbPtr;
+ MenuButtonEventProc, (ClientData) macButtonPtr);
+ return (TkMenuButton *) macButtonPtr;
}
/*
*----------------------------------------------------------------------
*
- * TkpDisplayMenuButton --
+ * TkpDestroyMenuButton --
*
- * This procedure is invoked to display a menubutton widget.
+ * Free data structures associated with the menubutton control.
*
* Results:
* None.
*
* Side effects:
- * Commands are output to X to display the menubutton in its
- * current mode.
+ * Restores the default control state.
*
*----------------------------------------------------------------------
*/
void
-TkpDisplayMenuButton(
- ClientData clientData) /* Information about widget. */
+TkpDestroyMenuButton(
+ TkMenuButton *mbPtr)
{
- TkMenuButton *butPtr = (TkMenuButton *) clientData;
- Tk_Window tkwin = butPtr->tkwin;
- TkWindow *winPtr;
- Pixmap pixmap;
- MacMenuButton *mbPtr = (MacMenuButton *) butPtr;
- CGrafPtr destPort, savePort;
- Boolean portChanged = false;
- int hasImageOrBitmap = 0, width, height;
- OSStatus err;
- ControlButtonGraphicAlignment theAlignment;
- Rect paneRect, cntrRect;
- int active, enabled;
+ MacMenuButton *macButtonPtr = (MacMenuButton *) mbPtr;
- butPtr->flags &= ~REDRAW_PENDING;
- if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
- }
- pixmap = (Pixmap) Tk_WindowId(tkwin);
- 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);
- 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;
-
- if (mbPtr->userPane) {
- MenuButtonControlParams params;
- bzero(&params, sizeof(params));
- ComputeMenuButtonControlParams(butPtr, &params);
- if (
-#ifdef TK_REBUILD_TOPLEVEL
- (winPtr->flags & TK_REBUILD_TOPLEVEL) ||
-#endif
- 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)) {
- TkMacOSXDbgMsg("Init Control failed");
- return;
- }
- }
- SetControlBounds(mbPtr->userPane, &paneRect);
- SetControlBounds(mbPtr->control, &cntrRect);
-
- 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;
- }
-
- /*
- * We need to cache the title and its style
- */
-
- if (!(mbPtr->flags & FIRST_DRAW)) {
- ControlTitleParams titleParams;
- int titleChanged;
- int styleChanged;
-
- ComputeControlTitleParams(butPtr, &titleParams);
- CompareControlTitleParams(&titleParams, &mbPtr->titleParams,
- &titleChanged, &styleChanged);
- if (titleChanged) {
- CFStringRef cf = CFStringCreateWithCString(NULL,
- (char*) 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) {
- err = ChkErr(SetControlFontStyle, mbPtr->control,
- &titleParams.style);
- if (err != noErr) {
- return;
- }
- }
- bcopy(&titleParams.style, &mbPtr->titleParams.style,
- sizeof(titleParams.style));
- }
- }
- if (hasImageOrBitmap) {
- {
- destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
- portChanged = QDSwapPort(destPort, &savePort);
- mbPtr->picParams.version = -2;
- mbPtr->picParams.hRes = 0x00480000;
- mbPtr->picParams.vRes = 0x00480000;
- mbPtr->picParams.srcRect.top = 0;
- mbPtr->picParams.srcRect.left = 0;
- mbPtr->picParams.srcRect.bottom = height;
- mbPtr->picParams.srcRect.right = width;
- mbPtr->picParams.reserved1 = 0;
- mbPtr->picParams.reserved2 = 0;
- mbPtr->bevelButtonContent.contentType = kControlContentPictHandle;
- mbPtr->bevelButtonContent.u.picture = OpenCPicture(&mbPtr->picParams);
- if (!mbPtr->bevelButtonContent.u.picture) {
- TkMacOSXDbgMsg("OpenCPicture failed");
- }
- 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->image != NULL) {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, 0, 0);
- } else {
- GC gc;
-
- if (butPtr->state == STATE_DISABLED) {
- gc = butPtr->disabledGC;
- } else if (butPtr->state == STATE_ACTIVE) {
- gc = butPtr->activeTextGC;
- } else {
- gc = butPtr->normalTextGC;
- }
- XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0,
- width, height, 0, 0, 1);
- }
- {
- ClosePicture();
- tkPictureIsOpen = 0;
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
- }
- ChkErr(SetControlData, mbPtr->control, kControlButtonPart,
- kControlBevelButtonContentTag,
- sizeof(ControlButtonContentInfo),
- (char *) &mbPtr->bevelButtonContent);
- 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;
- }
-
- ChkErr(SetControlData, mbPtr->control, kControlButtonPart,
- kControlBevelButtonGraphicAlignTag,
- sizeof(ControlButtonGraphicAlignment), (char *) &theAlignment);
- }
- active = ((mbPtr->flags & ACTIVE) != 0);
- if (active != IsControlActive(mbPtr->control)) {
- if (active) {
- ChkErr(ActivateControl, mbPtr->control);
- } else {
- ChkErr(DeactivateControl, mbPtr->control);
- }
- }
- enabled = !(butPtr->state == STATE_DISABLED);
- if (enabled != IsControlEnabled(mbPtr->control)) {
- if (enabled) {
- ChkErr(EnableControl, mbPtr->control);
- } else {
- ChkErr(DisableControl, mbPtr->control);
- }
- }
- if (active && enabled) {
- if (butPtr->state == STATE_ACTIVE) {
- if (hasImageOrBitmap) {
- HiliteControl(mbPtr->control, kControlButtonPart);
- } else {
- HiliteControl(mbPtr->control, kControlLabelPart);
- }
- } else {
- HiliteControl(mbPtr->control, kControlNoPart);
- }
- }
- UpdateControlColors(mbPtr);
- if (mbPtr->flags & FIRST_DRAW) {
- ShowControl(mbPtr->control);
- ShowControl(mbPtr->userPane);
- mbPtr->flags ^= FIRST_DRAW;
- } else {
- SetControlVisibility(mbPtr->control, true, true);
- Draw1Control(mbPtr->userPane);
- }
- if (hasImageOrBitmap) {
- if (mbPtr->bevelButtonContent.contentType ==
- kControlContentPictHandle) {
- KillPicture(mbPtr->bevelButtonContent.u.picture);
- }
- }
+ TkMacOSXMakeCollectableAndRelease(macButtonPtr->button);
}
/*
*----------------------------------------------------------------------
*
- * TkpDestroyMenuButton --
+ * TkpDisplayMenuButton --
*
- * Free data structures associated with the menubutton control.
+ * This function is invoked to display a menubutton widget.
*
* Results:
* None.
*
* Side effects:
- * Restores the default control state.
+ * Commands are output to X to display the menubutton in its current
+ * mode.
*
*----------------------------------------------------------------------
*/
void
-TkpDestroyMenuButton(
- TkMenuButton *mbPtr)
+TkpDisplayMenuButton(
+ ClientData clientData) /* Information about widget. */
{
- MacMenuButton *macMbPtr = (MacMenuButton *) mbPtr;
-
- if (macMbPtr->userPane) {
- DisposeControl(macMbPtr->userPane);
- macMbPtr->userPane = NULL;
+ TkMenuButton *mbPtr = (TkMenuButton *) clientData;
+ MacMenuButton *macButtonPtr = (MacMenuButton *) mbPtr;
+ NSPopUpButton *button = macButtonPtr->button;
+ Tk_Window tkwin = mbPtr->tkwin;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+ TkMacOSXDrawingContext dc;
+ NSView *view = TkMacOSXDrawableView(macWin);
+ CGFloat viewHeight = [view bounds].size.height;
+ CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
+ .ty = viewHeight};
+ NSRect frame;
+ int enabled;
+
+ mbPtr->flags &= ~REDRAW_PENDING;
+ if (!tkwin || !Tk_IsMapped(tkwin) || !view ||
+ !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) {
+ return;
}
- if (macMbPtr->menuRef) {
- short menuID = GetMenuID(macMbPtr->menuRef);
-
- TkMacOSXFreeMenuID(menuID);
- DisposeMenu(macMbPtr->menuRef);
- macMbPtr->menuRef = NULL;
+ CGContextConcatCTM(dc.context, t);
+ Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, mbPtr->normalBorder, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ if ([button superview] != view) {
+ [view addSubview:button];
+ }
+ enabled = !(mbPtr->state == STATE_DISABLED);
+ [button setEnabled:enabled];
+ if (enabled) {
+ [[button cell] setHighlighted:(mbPtr->state == STATE_ACTIVE)];
+ }
+ frame = NSMakeRect(macWin->xOff, macWin->yOff, Tk_Width(tkwin),
+ Tk_Height(tkwin));
+ frame = NSInsetRect(frame, mbPtr->inset, mbPtr->inset);
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ BoundsFix boundsFix = boundsFixes[macButtonPtr->fix];
+ frame = NSOffsetRect(frame, boundsFix.offsetX, boundsFix.offsetY);
+ frame.size.width -= boundsFix.shrinkW;
+ frame = NSInsetRect(frame, boundsFix.inset, boundsFix.inset);
+ }
+#endif
+ frame.origin.y = viewHeight - (frame.origin.y + frame.size.height);
+ if (!NSEqualRects(frame, [button frame])) {
+ [button setFrame:frame];
}
+ [button displayRectIgnoringOpacity:[button bounds]];
+ TkMacOSXRestoreDrawingContext(&dc);
+#ifdef TK_MAC_DEBUG_MENUBUTTON
+ TKLog(@"menubutton %s frame %@ width %d height %d",
+ ((TkWindow *)mbPtr->tkwin)->pathName, NSStringFromRect(frame),
+ Tk_Width(tkwin), Tk_Height(tkwin));
+#endif
}
/*
@@ -427,7 +200,7 @@ TkpDestroyMenuButton(
*
* TkpComputeMenuButtonGeometry --
*
- * After changes in a menu button's text or bitmap, this procedure
+ * After changes in a menu button's text or bitmap, this function
* recomputes the menu button's geometry and passes this information
* along to the geometry manager for the window.
*
@@ -441,482 +214,205 @@ TkpDestroyMenuButton(
*/
void
-TkpComputeMenuButtonGeometry(mbPtr)
- register TkMenuButton *mbPtr; /* Widget record for menu button. */
+TkpComputeMenuButtonGeometry(
+ 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);
- hasImageOrBitmap = 1;
- } else if (mbPtr->bitmap != None) {
- Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
- hasImageOrBitmap = 1;
+ MacMenuButton *macButtonPtr = (MacMenuButton *) mbPtr;
+ NSPopUpButton *button = macButtonPtr->button;
+ NSPopUpButtonCell *cell;
+ NSMenuItem *menuItem;
+ NSBezelStyle style = NSRoundedBezelStyle;
+ NSFont *font;
+ NSRect bounds = NSZeroRect, titleRect = NSZeroRect;
+ int haveImage = (mbPtr->image || mbPtr->bitmap != None), haveText = 0;
+ int haveCompound = (mbPtr->compound != COMPOUND_NONE);
+ int width, height;
+
+ if (!button) {
+ button = [[NSPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:YES];
+ macButtonPtr->button = TkMacOSXMakeUncollectable(button);
+ cell = [button cell];
+ [cell setUsesItemFromMenu:NO];
+ menuItem = [[[NSMenuItem alloc] initWithTitle:@""
+ action:NULL keyEquivalent:@""] autorelease];
+ [cell setMenuItem:menuItem];
} 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;
+ cell = [button cell];
+ menuItem = [cell menuItem];
+ }
+ if (haveImage) {
+ style = NSShadowlessSquareBezelStyle;
+ } else if (!mbPtr->indicatorOn) {
+ style = NSRegularSquareBezelStyle;
+ }
+ [button setBezelStyle:style];
+ [cell setArrowPosition:(mbPtr->indicatorOn ? NSPopUpArrowAtBottom :
+ NSPopUpNoArrow)];
+#if 0
+ NSControlSize controlSize = NSRegularControlSize;
+
+ if (mbPtr->borderWidth <= 2) {
+ controlSize = NSMiniControlSize;
+ } else if (mbPtr->borderWidth == 3) {
+ controlSize = NSSmallControlSize;
+ }
+ [cell setControlSize:controlSize];
+#endif
- Tk_GetFontMetrics(mbPtr->tkfont, &fm);
- height = mbPtr->height * fm.linespace;
- }
- width += 2*mbPtr->padX;
- height += 2*mbPtr->padY;
+ if (mbPtr->text && *(mbPtr->text) && (!haveImage || haveCompound)) {
+ NSString *title = [[NSString alloc] initWithUTF8String:mbPtr->text];
+ [button setTitle:title];
+ [title release];
+ haveText = 1;
}
- if (hasImageOrBitmap) {
- if (mbPtr->width > 0) {
- width = mbPtr->width;
+ haveCompound = (haveCompound && haveImage && haveText);
+ if (haveText) {
+ NSTextAlignment alignment = NSNaturalTextAlignment;
+
+ switch (mbPtr->justify) {
+ case TK_JUSTIFY_LEFT:
+ alignment = NSLeftTextAlignment;
+ break;
+ case TK_JUSTIFY_RIGHT:
+ alignment = NSRightTextAlignment;
+ break;
+ case TK_JUSTIFY_CENTER:
+ alignment = NSCenterTextAlignment;
+ break;
}
- if (mbPtr->height > 0) {
- height = mbPtr->height;
- }
- mbPtr->inset = mbPtr->highlightWidth + 2;
- width += (2 * mbPtr->borderWidth + 4);
- height += (2 * mbPtr->borderWidth + 4);
+ [button setAlignment:alignment];
} else {
- width += TK_POPUP_OFFSET;
+ [button setTitle:@""];
}
- 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;
+ font = TkMacOSXNSFontForFont(mbPtr->tkfont);
+ if (font) {
+ [button setFont:font];
}
-
- 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;
+ if (haveImage) {
+ int width, height;
+ NSImage *image;
+ NSCellImagePosition pos = NSImageOnly;
+
+ if (mbPtr->image) {
+ Tk_SizeOfImage(mbPtr->image, &width, &height);
+ image = TkMacOSXGetNSImageWithTkImage(mbPtr->display,
+ mbPtr->image, width, height);
} else {
- paramsPtr->procID = kControlBevelButtonLargeBevelProc;
+ Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
+ image = TkMacOSXGetNSImageWithBitmap(mbPtr->display,
+ mbPtr->bitmap, mbPtr->normalTextGC, width, height);
}
- if (mbPtr->indicatorOn) {
- paramsPtr->initialValue = fakeMenuID;
- } else {
- paramsPtr->initialValue = 0;
+ if (haveCompound) {
+ switch ((enum compound) mbPtr->compound) {
+ case COMPOUND_TOP:
+ pos = NSImageAbove;
+ break;
+ case COMPOUND_BOTTOM:
+ pos = NSImageBelow;
+ break;
+ case COMPOUND_LEFT:
+ pos = NSImageLeft;
+ break;
+ case COMPOUND_RIGHT:
+ pos = NSImageRight;
+ break;
+ case COMPOUND_CENTER:
+ pos = NSImageOverlaps;
+ break;
+ case COMPOUND_NONE:
+ pos = NSImageOnly;
+ break;
+ }
}
+ [button setImagePosition:pos];
+ [menuItem setImage:image];
+ bounds.size = cell ? [cell cellSize] : NSZeroSize;
+ if (bounds.size.height < height + 8) { /* workaround AppKit sizing bug */
+ bounds.size.height = height + 8;
+ }
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (!mbPtr->indicatorOn && tkMacOSXUseCompatibilityMetrics) {
+ bounds.size.width -= 16;
+ }
+#endif
} 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,
- (char*) paramsPtr->title);
- paramsPtr->title[paramsPtr->len] = 0;
- if (paramsPtr->len) {
- TkMacOSXInitControlFontStyle(font,&paramsPtr->style);
+ bounds.size = cell ? [cell cellSize] : NSZeroSize;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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)
-{
- OSStatus err;
- TkMenuButton *butPtr = (TkMenuButton *) mbPtr;
- SInt16 procID, initialValue, minValue, maxValue;
- Boolean initiallyVisible;
- SInt32 controlReference;
- short menuID;
- ControlRef rootControl =
- TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
-
- mbPtr->windowRef = TkMacOSXDrawableWindow(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) {
- TkMacOSXDbgMsg("Failed to create user pane control");
- return 1;
- }
- err = ChkErr(EmbedControl, mbPtr->userPane, rootControl);
- if (err != noErr) {
- 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) {
- TkMacOSXDbgMsg("Failed to create control of type %d",
- mbPtr->params.procID);
- return 1;
- }
- err = ChkErr(EmbedControl, mbPtr->control, mbPtr->userPane);
- if (err != noErr ) {
- return 1;
- }
- if (mbPtr->params.isBevel) {
- CFStringRef cf = CFStringCreateWithCString(NULL,
- (char*) mbPtr->titleParams.title, kCFStringEncodingUTF8);
-
- SetControlTitleWithCFString(mbPtr->control, cf);
- CFRelease(cf);
- if (mbPtr->titleParams.len) {
- err = ChkErr(SetControlFontStyle, mbPtr->control,
- &mbPtr->titleParams.style);
- if (err != noErr) {
- return 1;
+ if (haveText) {
+ titleRect = cell ? [cell titleRectForBounds:bounds] : NSZeroRect;
+ if (mbPtr->wrapLength > 0 &&
+ titleRect.size.width > mbPtr->wrapLength) {
+ if (style == NSRoundedBezelStyle) {
+ [button setBezelStyle:(style = NSRegularSquareBezelStyle)];
+ bounds.size = cell ? [cell cellSize] : NSZeroSize;
+ titleRect = cell ? [cell titleRectForBounds:bounds] : NSZeroRect;
}
+ bounds.size.width -= titleRect.size.width - mbPtr->wrapLength;
+ bounds.size.height = 40000.0;
+ [cell setWraps:YES];
+ bounds.size = cell ? [cell cellSizeForBounds:bounds] : NSZeroSize;
+#ifdef TK_MAC_DEBUG_MENUBUTTON
+ titleRect = cell ? [cell titleRectForBounds:bounds] : NSZeroRect;
+#endif
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ bounds.size.height += 3;
+ }
+#endif
}
- } else {
- CFStringRef cfStr;
+ }
+ width = lround(bounds.size.width);
+ height = lround(bounds.size.height);
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+ if (tkMacOSXUseCompatibilityMetrics) {
+ macButtonPtr->fix = fixForStyle(style);
+ width -= boundsFixes[macButtonPtr->fix].trimW;
+ height -= boundsFixes[macButtonPtr->fix].trimH;
+ }
+#endif
- err = TkMacOSXGetNewMenuID(mbPtr->info.interp, (TkMenu *) mbPtr, 0,
- &menuID);
- if (err != TCL_OK) {
- return 1;
- }
- err = ChkErr(CreateNewMenu, menuID, kMenuAttrDoNotUseUserCommandKeys,
- &(mbPtr->menuRef));
- if (err != noErr) {
- return 1;
+ if (haveImage || haveCompound) {
+ if (mbPtr->width > 0) {
+ width = mbPtr->width;
}
- cfStr = CFStringCreateWithCString(NULL, Tk_PathName(mbPtr->info.tkwin),
- kCFStringEncodingUTF8);
- if (!cfStr) {
- TkMacOSXDbgMsg("CFStringCreateWithCString failed");
- return 1;
+ if (mbPtr->height > 0) {
+ height = mbPtr->height;
}
- err = ChkErr(SetMenuTitleWithCFString, mbPtr->menuRef, cfStr);
- CFRelease(cfStr);
- if (err != noErr) {
- return 1;
+ } else {
+ if (mbPtr->width > 0) {
+ int avgWidth = Tk_TextWidth(mbPtr->tkfont, "0", 1);
+ width = mbPtr->width * avgWidth;
}
- cfStr = CFStringCreateWithCString(NULL,
- (char*) mbPtr->titleParams.title, kCFStringEncodingUTF8);
- AppendMenuItemText(mbPtr->menuRef, "\px");
- if (cfStr) {
- SetMenuItemTextWithCFString(mbPtr->menuRef, 1, cfStr);
- CFRelease(cfStr);
+ if (mbPtr->height > 0) {
+ Tk_FontMetrics fm;
+
+ Tk_GetFontMetrics(mbPtr->tkfont, &fm);
+ height = mbPtr->height * fm.linespace;
}
- ChkErr(SetControlData, mbPtr->control, kControlNoPart,
- kControlPopupButtonMenuRefTag, sizeof(mbPtr->menuRef),
- &mbPtr->menuRef);
- SetControlMinimum(mbPtr->control, 1);
- SetControlMaximum(mbPtr->control, 1);
- SetControlValue(mbPtr->control, 1);
}
- mbPtr->flags |= FIRST_DRAW;
- if (IsWindowActive(mbPtr->windowRef)) {
- mbPtr->flags |= ACTIVE;
+ if (!haveImage || haveCompound) {
+ width += 2*mbPtr->padX;
+ height += 2*mbPtr->padY;
}
- 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.
- *
- *--------------------------------------------------------------
- */
-OSStatus
-SetUserPaneDrawProc(
- ControlRef control,
- ControlUserPaneDrawProcPtr upp)
-{
- ControlUserPaneDrawUPP 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.
- *
- *--------------------------------------------------------------
- */
-
-OSStatus
-SetUserPaneSetUpSpecialBackgroundProc(
- ControlRef control,
- ControlUserPaneBackgroundProcPtr upp)
-{
- ControlUserPaneBackgroundUPP 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 =
- (MacMenuButton *)(intptr_t)GetControlReference(control);
- CGrafPtr port;
-
- GetPort(&port);
- GetControlBounds(control,&contrlRect);
- TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
- 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 =
- (MacMenuButton *)(intptr_t)GetControlReference(control);
-
- if (info->colorDevice) {
- CGrafPtr port;
-
- GetPort(&port);
- TkMacOSXSetColorInPort(mbPtr->userPaneBackground, 0, NULL, port);
+ if (mbPtr->highlightWidth < 0) {
+ mbPtr->highlightWidth = 0;
}
-}
-
-/*
- *--------------------------------------------------------------
- *
- * 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);
- mbPtr->userPaneBackground = xcolor->pixel;
-
- return false;
+ if (haveImage) {
+ mbPtr->inset = mbPtr->highlightWidth;
+ width += 2*mbPtr->borderWidth;
+ height += 2*mbPtr->borderWidth;
+ } else {
+ mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;
+ }
+ Tk_GeometryRequest(mbPtr->tkwin, width + 2 * mbPtr->inset,
+ height + 2 * mbPtr->inset);
+ Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);
+#ifdef TK_MAC_DEBUG_MENUBUTTON
+ TKLog(@"menubutton %s bounds %@ titleRect %@ width %d height %d inset %d borderWidth %d",
+ ((TkWindow *)mbPtr->tkwin)->pathName, NSStringFromRect(bounds),
+ NSStringFromRect(titleRect), width, height, mbPtr->inset,
+ mbPtr->borderWidth);
+#endif
}
/*
@@ -931,7 +427,7 @@ UpdateControlColors(
* None.
*
* Side effects:
- * When it gets exposed, it is redisplayed.
+ * When activation state changes, it is redisplayed.
*
*--------------------------------------------------------------
*/
@@ -941,22 +437,27 @@ MenuButtonEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkMenuButton *buttonPtr = (TkMenuButton *) clientData;
- MacMenuButton *mbPtr = (MacMenuButton *) clientData;
+ TkMenuButton *mbPtr = (TkMenuButton *) clientData;
- if (eventPtr->type == ActivateNotify
- || eventPtr->type == DeactivateNotify) {
- if ((buttonPtr->tkwin == NULL) || (!Tk_IsMapped(buttonPtr->tkwin))) {
- return;
- }
- if (eventPtr->type == ActivateNotify) {
- mbPtr->flags |= ACTIVE;
- } else {
- mbPtr->flags &= ~ACTIVE;
- }
- if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
- Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) buttonPtr);
- buttonPtr->flags |= REDRAW_PENDING;
+ if (!mbPtr->tkwin || !Tk_IsMapped(mbPtr->tkwin)) {
+ return;
+ }
+ switch (eventPtr->type) {
+ case ActivateNotify:
+ case DeactivateNotify:
+ if (!(mbPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
+ mbPtr->flags |= REDRAW_PENDING;
}
+ break;
}
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index 2b5126c..3b79169 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -1,45 +1,279 @@
/*
* tkMacOSXMenus.c --
*
- * These calls set up and manage the menubar for the
- * Macintosh version of Tk.
+ * These calls set up the default menus for Tk.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
+#include "tkMenu.h"
-#define kAppleMenu 256
-#define kAppleAboutItem 1
-#define kFileMenu 2
-#define kEditMenu 3
+static void GenerateEditEvent(const char *name);
+static Tcl_Obj * GetWidgetDemoPath(Tcl_Interp *interp);
+
+#pragma mark TKApplication(TKMenus)
+
+@implementation TKApplication(TKMenus)
+- (void) _setupMenus
+{
+ if (_defaultMainMenu) {
+ return;
+ }
+ TkMenuInit();
+
+ NSString *applicationName = [[NSBundle mainBundle]
+ objectForInfoDictionaryKey:@"CFBundleName"];
+
+ if (!applicationName) {
+ applicationName = [[NSProcessInfo processInfo] processName];
+ }
+
+ NSString *aboutName = (applicationName &&
+ ![applicationName isEqualToString:@"Wish"] &&
+ ![applicationName hasPrefix:@"tclsh"]) ?
+ applicationName : @"Tcl & Tk";
+
+ _servicesMenu = [NSMenu menuWithTitle:@"Services"];
+ _defaultApplicationMenuItems = [[NSArray arrayWithObjects:
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"Preferences%C", 0x2026]
+ action:@selector(preferences:) keyEquivalent:@","],
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:@"Services" submenu:_servicesMenu],
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"Hide %@", applicationName]
+ action:@selector(hide:) keyEquivalent:@"h"],
+ [NSMenuItem itemWithTitle:@"Hide Others"
+ action:@selector(hideOtherApplications:) keyEquivalent:@"h"
+ keyEquivalentModifierMask:
+ NSCommandKeyMask|NSAlternateKeyMask],
+ [NSMenuItem itemWithTitle:@"Show All"
+ action:@selector(unhideAllApplications:)],
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"Quit %@", applicationName]
+ action: @selector(terminate:) keyEquivalent:@"q"],
+ nil] retain];
+ _defaultApplicationMenu = [TKMenu menuWithTitle:applicationName
+ menuItems:_defaultApplicationMenuItems];
+ [_defaultApplicationMenu insertItem:
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"About %@", aboutName]
+ action:@selector(orderFrontStandardAboutPanel:)] atIndex:0];
+
+ TKMenu *fileMenu = [TKMenu menuWithTitle:@"File" menuItems:
+ [NSArray arrayWithObjects:
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"Source%C", 0x2026]
+ action:@selector(tkSource:)],
+ [NSMenuItem itemWithTitle:@"Run Widget Demo"
+ action:@selector(tkDemo:)],
+ [NSMenuItem itemWithTitle:@"Close" action:@selector(performClose:)
+ target:nil keyEquivalent:@"w"],
+ nil]];
+ TKMenu *editMenu = [TKMenu menuWithTitle:@"Edit" menuItems:
+ [NSArray arrayWithObjects:
+ [NSMenuItem itemWithTitle:@"Undo" action:@selector(undo:)
+ target:nil keyEquivalent:@"z"],
+ [NSMenuItem itemWithTitle:@"Redo" action:@selector(redo:)
+ target:nil keyEquivalent:@"y"],
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:@"Cut" action:@selector(cut:)
+ target:nil keyEquivalent:@"x"],
+ [NSMenuItem itemWithTitle:@"Copy" action:@selector(copy:)
+ target:nil keyEquivalent:@"c"],
+ [NSMenuItem itemWithTitle:@"Paste" action:@selector(paste:)
+ target:nil keyEquivalent:@"v"],
+ [NSMenuItem itemWithTitle:@"Delete" action:@selector(delete:)
+ target:nil],
+ nil]];
+
+ _defaultWindowsMenuItems = [[NSArray arrayWithObjects:
+ [NSMenuItem itemWithTitle:@"Minimize"
+ action:@selector(performMiniaturize:) target:nil
+ keyEquivalent:@"m"],
+ [NSMenuItem itemWithTitle:@"Zoom" action:@selector(performZoom:)
+ target:nil],
+ [NSMenuItem separatorItem],
+ [NSMenuItem itemWithTitle:@"Bring All to Front"
+ action:@selector(arrangeInFront:)],
+ nil] retain];
+
+ TKMenu *windowsMenu = [TKMenu menuWithTitle:@"Window" menuItems:
+ _defaultWindowsMenuItems];
+
+ _defaultHelpMenuItems = [[NSArray arrayWithObjects:
+ [NSMenuItem itemWithTitle:
+ [NSString stringWithFormat:@"%@ Help", applicationName]
+ action:@selector(showHelp:) keyEquivalent:@"?"],
+ nil] retain];
+
+ TKMenu *helpMenu = [TKMenu menuWithTitle:@"Help" menuItems:
+ _defaultHelpMenuItems];
+
+ [self setServicesMenu:_servicesMenu];
+ [self setWindowsMenu:windowsMenu];
+ _defaultMainMenu = [[TKMenu menuWithTitle:@"" submenus:[NSArray
+ arrayWithObjects:_defaultApplicationMenu, fileMenu, editMenu,
+ windowsMenu, helpMenu, nil]] retain];
+ [_defaultMainMenu setSpecial:tkMainMenu];
+ [_defaultApplicationMenu setSpecial:tkApplicationMenu];
+ [windowsMenu setSpecial:tkWindowsMenu];
+ [helpMenu setSpecial:tkHelpMenu];
+ [self tkSetMainMenu:nil];
+}
+
+- (void) dealloc
+{
+ [_defaultMainMenu release];
+ [_defaultHelpMenuItems release];
+ [_defaultWindowsMenuItems release];
+ [_defaultApplicationMenuItems release];
+ [super dealloc];
+}
+
+- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>) anItem
+{
+ SEL action = [anItem action];
+
+ if (sel_isEqual(action, @selector(preferences:))) {
+ Tcl_CmdInfo dummy;
+
+ return (_eventInterp && Tcl_GetCommandInfo(_eventInterp,
+ "::tk::mac::ShowPreferences", &dummy));
+ } else if (sel_isEqual(action, @selector(tkDemo:))) {
+ BOOL haveDemo = NO;
+
+ if (_eventInterp) {
+ Tcl_Obj *path = GetWidgetDemoPath(_eventInterp);
+
+ if (path) {
+ Tcl_IncrRefCount(path);
+ haveDemo = (Tcl_FSAccess(path, R_OK) == 0);
+ Tcl_DecrRefCount(path);
+ }
+ }
+ return haveDemo;
+ } else {
+ return [super validateUserInterfaceItem:anItem];
+ }
+}
+
+- (void) orderFrontStandardAboutPanel: (id) sender
+{
+ Tcl_CmdInfo dummy;
+
+ if (!_eventInterp || !Tcl_GetCommandInfo(_eventInterp, "tkAboutDialog",
+ &dummy) || (GetCurrentEventKeyModifiers() & optionKey)) {
+ TkAboutDlg();
+ } else {
+ int code = Tcl_EvalEx(_eventInterp, "tkAboutDialog", -1,
+ TCL_EVAL_GLOBAL);
+
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(_eventInterp, code);
+ }
+ Tcl_ResetResult(_eventInterp);
+ }
+}
+
+- (void) showHelp: (id) sender
+{
+ Tcl_CmdInfo dummy;
+
+ if (!_eventInterp || !Tcl_GetCommandInfo(_eventInterp,
+ "::tk::mac::ShowHelp", &dummy)) {
+ [super showHelp:sender];
+ } else {
+ int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ShowHelp", -1,
+ TCL_EVAL_GLOBAL);
+
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(_eventInterp, code);
+ }
+ Tcl_ResetResult(_eventInterp);
+ }
+}
+
+- (void) tkSource: (id) sender
+{
+ if (_eventInterp) {
+ if (Tcl_EvalEx(_eventInterp, "tk_getOpenFile -filetypes {"
+ "{{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}",
+ -1, TCL_EVAL_GLOBAL) == TCL_OK) {
+ Tcl_Obj *path = Tcl_GetObjResult(_eventInterp);
+ int len;
-#define kSourceItem 1
-#define kDemoItem 2
-#define kCloseItem 3
+ Tcl_GetStringFromObj(path, &len);
+ if (len) {
+ Tcl_IncrRefCount(path);
-#define EDIT_CUT 1
-#define EDIT_COPY 2
-#define EDIT_PASTE 3
-#define EDIT_CLEAR 4
+ int code = Tcl_FSEvalFile(_eventInterp, path);
-MenuRef tkAppleMenu;
-MenuRef tkFileMenu;
-MenuRef tkEditMenu;
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(_eventInterp, code);
+ }
+ Tcl_DecrRefCount(path);
+ }
+ }
+ Tcl_ResetResult(_eventInterp);
+ }
+}
-static Tcl_Interp * gInterp = NULL; /* Standard menu interpreter. */
-static EventHandlerRef menuEventHandlerRef = NULL;
+- (void) tkDemo: (id) sender
+{
+ if (_eventInterp) {
+ Tcl_Obj *path = GetWidgetDemoPath(_eventInterp);
-static void GenerateEditEvent(int flag);
-static Tcl_Obj* GetWidgetDemoPath(Tcl_Interp *interp);
-static OSStatus MenuEventHandlerProc(EventHandlerCallRef callRef,
- EventRef event, void *userData);
+ if (path) {
+ Tcl_IncrRefCount(path);
+ int code = Tcl_FSEvalFile(_eventInterp, path);
+
+ if (code != TCL_OK) {
+ Tcl_BackgroundException(_eventInterp, code);
+ }
+ Tcl_DecrRefCount(path);
+ Tcl_ResetResult(_eventInterp);
+ }
+ }
+}
+@end
+
+#pragma mark TKContentView(TKMenus)
+
+@implementation TKContentView(TKMenus)
+
+- (BOOL) validateUserInterfaceItem: (id <NSValidatedUserInterfaceItem>) anItem
+{
+ return YES;
+}
+
+#define EDIT_ACTION(a, e) \
+ - (void) a: (id) sender \
+ { \
+ if ([sender isKindOfClass:[NSMenuItem class]]) { \
+ GenerateEditEvent(#e); \
+ } \
+ }
+EDIT_ACTION(cut, Cut)
+EDIT_ACTION(copy, Copy)
+EDIT_ACTION(paste, Paste)
+EDIT_ACTION(delete, Clear)
+EDIT_ACTION(undo, Undo)
+EDIT_ACTION(redo, Redo)
+#undef EDIT_ACTION
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -57,20 +291,22 @@ static OSStatus MenuEventHandlerProc(EventHandlerCallRef callRef,
*----------------------------------------------------------------------
*/
-Tcl_Obj*
+static Tcl_Obj *
GetWidgetDemoPath(
Tcl_Interp *interp)
{
- Tcl_Obj *libpath , *result = NULL;
+ Tcl_Obj *libpath, *result = NULL;
- libpath = Tcl_GetVar2Ex(gInterp, "tk_library", NULL, TCL_GLOBAL_ONLY);
+ libpath = Tcl_GetVar2Ex(interp, "tk_library", NULL, TCL_GLOBAL_ONLY);
if (libpath) {
Tcl_Obj *demo[2] = { Tcl_NewStringObj("demos", 5),
Tcl_NewStringObj("widget", 6) };
-
+
Tcl_IncrRefCount(libpath);
result = Tcl_FSJoinToPath(libpath, 2, demo);
Tcl_DecrRefCount(libpath);
+ } else {
+ Tcl_ResetResult(interp);
}
return result;
}
@@ -93,151 +329,11 @@ GetWidgetDemoPath(
void
TkMacOSXHandleMenuSelect(
- MenuID theMenu,
- MenuItemIndex theItem,
+ short theMenu,
+ unsigned short theItem,
int optionKeyPressed)
{
- Tk_Window tkwin;
- Window window;
- TkDisplay *dispPtr;
-
- if (theItem == 0) {
- 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 {
- if (Tcl_EvalEx(gInterp, "tkAboutDialog", -1,
- TCL_EVAL_GLOBAL) != TCL_OK) {
- Tcl_BackgroundError(gInterp);
- }
- Tcl_ResetResult(gInterp);
- }
- break;
- }
- }
- break;
- case kFileMenu:
- switch (theItem) {
- case kSourceItem:
- if (gInterp) {
- if(Tcl_EvalEx(gInterp, "tk_getOpenFile -filetypes {"
- "{{TCL Scripts} {.tcl} TEXT} "
- "{{Text Files} {} TEXT}}", -1, TCL_EVAL_GLOBAL)
- == TCL_OK) {
- Tcl_Obj *path = Tcl_GetObjResult(gInterp);
- int len;
-
- Tcl_GetStringFromObj(path, &len);
- if (len) {
- Tcl_IncrRefCount(path);
- if (Tcl_FSEvalFile(gInterp, path)
- == TCL_ERROR) {
- Tcl_BackgroundError(gInterp);
- }
- Tcl_DecrRefCount(path);
- }
- }
- Tcl_ResetResult(gInterp);
- }
- break;
- case kDemoItem:
- if (gInterp) {
- Tcl_Obj *path = GetWidgetDemoPath(gInterp);
-
- if (path) {
- Tcl_IncrRefCount(path);
- if (Tcl_FSEvalFile(gInterp, path)
- == TCL_ERROR) {
- Tcl_BackgroundError(gInterp);
- }
- Tcl_DecrRefCount(path);
- Tcl_ResetResult(gInterp);
- }
- }
- break;
- case kCloseItem:
- /* Send close event */
- window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
- dispPtr = TkGetDisplayList();
- tkwin = Tk_IdToWindow(dispPtr->display, window);
- TkGenWMDestroyEvent(tkwin);
- break;
- }
- break;
- case kEditMenu:
- /*
- * This implementation just send the keysyms Tk thinks are
- * associated with function keys that do Cut, Copy & Paste on
- * a Sun keyboard.
- */
- GenerateEditEvent(theItem);
- break;
- default:
- TkMacOSXDispatchMenuEvent(theMenu, theItem);
- break;
- }
- /*
- * Finally we unhighlight the menu.
- */
- HiliteMenu(0);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * MenuEventHandlerProc --
- *
- * One-time handler of kEventMenuEnableItems for the edit menu.
- *
- * Results:
- * OS status code.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static OSStatus
-MenuEventHandlerProc(
- EventHandlerCallRef callRef,
- EventRef event,
- void *userData)
-{
- OSStatus result = eventNotHandledErr, err;
- int menuContext;
-
- err = ChkErr(GetEventParameter, event, kEventParamMenuContext, typeUInt32,
- NULL, sizeof(menuContext), NULL, &menuContext);
- if (err == noErr && (menuContext & kMenuContextMenuBarTracking)) {
- if (gInterp) {
- Tcl_Obj *path = GetWidgetDemoPath(gInterp);
-
- if (path) {
- Tcl_IncrRefCount(path);
- if (Tcl_FSAccess(path, R_OK) == 0) {
- EnableMenuItem(tkFileMenu, kDemoItem);
- }
- Tcl_DecrRefCount(path);
- }
- }
- ChkErr(RemoveEventHandler, menuEventHandlerRef);
- menuEventHandlerRef = NULL;
- result = noErr;
- }
-
- return result;
+ Tcl_Panic("TkMacOSXHandleMenuSelect: Obsolete, no more Carbon!");
}
/*
@@ -260,75 +356,7 @@ void
TkMacOSXInitMenus(
Tcl_Interp *interp)
{
- OSStatus err;
- EventHandlerUPP menuEventHandlerUPP;
- const EventTypeSpec menuEventTypes[] = {
- {kEventClassMenu, kEventMenuEnableItems},
- };
-
- gInterp = interp;
- if (TkMacOSXUseMenuID(kAppleMenu) != TCL_OK) {
- Tcl_Panic("Menu ID %d is already in use!", kAppleMenu);
- }
- err = ChkErr(CreateNewMenu, kAppleMenu, kMenuAttrDoNotUseUserCommandKeys,
- &tkAppleMenu);
- if (err != noErr) {
- Tcl_Panic("CreateNewMenu failed !");
- }
- SetMenuTitle(tkAppleMenu, "\p\024");
- InsertMenu(tkAppleMenu, 0);
- AppendMenu(tkAppleMenu, "\pAbout Tcl & Tk\xc9");
- AppendMenu(tkAppleMenu, "\p(-");
-
- if (TkMacOSXUseMenuID(kFileMenu) != TCL_OK) {
- Tcl_Panic("Menu ID %d is already in use!", kFileMenu);
- }
- err = ChkErr(CreateNewMenu, kFileMenu, kMenuAttrDoNotUseUserCommandKeys,
- &tkFileMenu);
- if (err != noErr) {
- Tcl_Panic("CreateNewMenu failed !");
- }
- SetMenuTitle(tkFileMenu, "\pFile");
- InsertMenu(tkFileMenu, 0);
- InsertMenuItem(tkFileMenu, "\pSource\xc9", kSourceItem - 1);
- InsertMenuItem(tkFileMenu, "\pRun Widget Demo", kDemoItem - 1);
- InsertMenuItem(tkFileMenu, "\pClose/W", kCloseItem - 1);
- DisableMenuItem(tkFileMenu, kDemoItem);
- menuEventHandlerUPP = NewEventHandlerUPP(MenuEventHandlerProc);
- ChkErr(InstallEventHandler, GetMenuEventTarget(tkFileMenu),
- menuEventHandlerUPP, GetEventTypeCount(menuEventTypes),
- menuEventTypes, NULL, &menuEventHandlerRef);
- DisposeEventHandlerUPP(menuEventHandlerUPP);
-
- if (TkMacOSXUseMenuID(kEditMenu) != TCL_OK) {
- Tcl_Panic("Menu ID %d is already in use!", kEditMenu);
- }
- err = ChkErr(CreateNewMenu, kEditMenu, kMenuAttrDoNotUseUserCommandKeys,
- &tkEditMenu);
- if (err != noErr) {
- Tcl_Panic("CreateNewMenu failed !");
- }
- SetMenuTitle(tkEditMenu, "\pEdit");
- InsertMenu(tkEditMenu, 0);
- AppendMenu(tkEditMenu, "\pCut/X");
- AppendMenu(tkEditMenu, "\pCopy/C");
- AppendMenu(tkEditMenu, "\pPaste/V");
- AppendMenu(tkEditMenu, "\pClear");
- if (TkMacOSXUseMenuID(kHMHelpMenuID) != TCL_OK) {
- Tcl_Panic("Help menu ID %s is already in use!", kHMHelpMenuID);
- }
-
- /*
- * Workaround a Carbon bug with kHICommandPreferences: the first call to
- * IsMenuKeyEvent returns false for the preferences menu item key shorcut
- * event (even if the corresponding menu item is dynamically enabled by a
- * kEventCommandUpdateStatus handler), unless the kHICommandPreferences
- * menu item has previously been enabled manually. [Bug 1481503]
- */
- EnableMenuCommand(NULL, kHICommandPreferences);
-
- DrawMenuBar();
- return;
+ [NSApp _setupMenus];
}
/*
@@ -336,8 +364,8 @@ TkMacOSXInitMenus(
*
* GenerateEditEvent --
*
- * Takes an edit menu item and posts the corasponding a virtual
- * event to Tk's event queue.
+ * Takes an edit menu item and posts the corasponding a virtual event to
+ * Tk's event queue.
*
* Results:
* None.
@@ -350,50 +378,172 @@ TkMacOSXInitMenus(
static void
GenerateEditEvent(
- int flag)
+ const char *name)
{
XVirtualEvent event;
int x, y;
- Tk_Window tkwin;
- Window window;
- TkDisplay *dispPtr;
-
- window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
- dispPtr = TkGetDisplayList();
- tkwin = Tk_IdToWindow(dispPtr->display, window);
- tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ TkWindow *winPtr = TkMacOSXGetTkWindow([NSApp keyWindow]);
+ Tk_Window tkwin = (Tk_Window) winPtr;
+
+ if (tkwin == NULL) {
+ return;
+ }
+ tkwin = (Tk_Window) winPtr->dispPtr->focusPtr;
if (tkwin == NULL) {
return;
}
-
bzero(&event, sizeof(XVirtualEvent));
event.type = VirtualEvent;
- event.serial = Tk_Display(tkwin)->request;
+ event.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
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();
-
- XQueryPointer(NULL, None, NULL, NULL,
+ XQueryPointer(NULL, winPtr->window, NULL, NULL,
&event.x_root, &event.y_root, &x, &y, &event.state);
- tkwin = Tk_TopCoordsToWindow(tkwin, x, y, &event.x, &event.y);
+ Tk_TopCoordsToWindow(tkwin, x, y, &event.x, &event.y);
event.same_screen = true;
+ event.name = Tk_GetUid(name);
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+}
+
+#pragma mark -
+
+#pragma mark NSMenu & NSMenuItem Utilities
- 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;
+@implementation NSMenu(TKUtils)
+
++ (id) menuWithTitle: (NSString *) title
+{
+ NSMenu *m = [[self alloc] initWithTitle:title];
+
+ return [m autorelease];
+}
+
++ (id) menuWithTitle: (NSString *) title menuItems: (NSArray *) items
+{
+ NSMenu *m = [[self alloc] initWithTitle:title];
+
+ for (NSMenuItem *i in items) {
+ [m addItem:i];
}
- Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+ return [m autorelease];
+}
+
++ (id) menuWithTitle: (NSString *) title submenus: (NSArray *) submenus
+{
+ NSMenu *m = [[self alloc] initWithTitle:title];
+
+ for (NSMenu *i in submenus) {
+ [m addItem:[NSMenuItem itemWithSubmenu:i]];
+ }
+ return [m autorelease];
+}
+
+- (NSMenuItem *) itemWithSubmenu: (NSMenu *) submenu
+{
+ return [self itemAtIndex:[self indexOfItemWithSubmenu:submenu]];
+}
+
+- (NSMenuItem *) itemInSupermenu
+{
+ NSMenu *supermenu = [self supermenu];
+
+ return (supermenu ? [supermenu itemWithSubmenu:self] : nil);
}
+@end
+
+@implementation NSMenuItem(TKUtils)
+
++ (id) itemWithSubmenu: (NSMenu *) submenu
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:[submenu title] action:NULL
+ keyEquivalent:@""];
+
+ [i setSubmenu:submenu];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title submenu: (NSMenu *) submenu
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:NULL
+ keyEquivalent:@""];
+
+ [i setSubmenu:submenu];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:@""];
+
+ [i setTarget:NSApp];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+ target: (id) target
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:@""];
+
+ [i setTarget:target];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+ keyEquivalent: (NSString *) keyEquivalent
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:keyEquivalent];
+
+ [i setTarget:NSApp];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+ target: (id) target keyEquivalent: (NSString *) keyEquivalent
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:keyEquivalent];
+
+ [i setTarget:target];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+ keyEquivalent: (NSString *) keyEquivalent
+ keyEquivalentModifierMask: (NSUInteger) keyEquivalentModifierMask
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:keyEquivalent];
+
+ [i setTarget:NSApp];
+ [i setKeyEquivalentModifierMask:keyEquivalentModifierMask];
+ return [i autorelease];
+}
+
++ (id) itemWithTitle: (NSString *) title action: (SEL) action
+ target: (id) target keyEquivalent: (NSString *) keyEquivalent
+ keyEquivalentModifierMask: (NSUInteger) keyEquivalentModifierMask
+{
+ NSMenuItem *i = [[self alloc] initWithTitle:title action:action
+ keyEquivalent:keyEquivalent];
+
+ [i setTarget:target];
+ [i setKeyEquivalentModifierMask:keyEquivalentModifierMask];
+ return [i autorelease];
+}
+@end
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 46398f6..90d2d00 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -1,58 +1,14 @@
/*
* tkMacOSXMouseEvent.c --
*
- * This file implements functions that decode & handle mouse events
- * on MacOS X.
+ * This file implements functions that decode & handle mouse events on
+ * MacOS X.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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 "tkMacOSXPrivate.h"
@@ -61,698 +17,200 @@
#include "tkMacOSXDebug.h"
typedef struct {
- WindowRef whichWin;
- WindowRef activeNonFloating;
- WindowPartCode windowPart;
- unsigned int state;
- long delta;
- Window window;
- Point global;
- Point local;
+ unsigned int state;
+ long delta;
+ Window window;
+ Point global;
+ Point local;
} MouseEventData;
-/*
- * Declarations of static variables used in this file.
- */
-
-static int gEatButtonUp = 0; /* 1 if we need to eat the next up event */
+static int GenerateButtonEvent(MouseEventData *medPtr);
+static unsigned int ButtonModifiers2State(UInt32 buttonState,
+ UInt32 keyModifiers);
-/*
- * Declarations of functions used only in this file.
- */
-
-static void BringWindowForward(WindowRef wRef, int isFrontProcess,
- int frontWindowOnly);
-static int GeneratePollingEvents(MouseEventData * medPtr);
-static int GenerateMouseWheelEvent(MouseEventData * medPtr);
-static int GenerateButtonEvent(MouseEventData * medPtr);
-static int GenerateToolbarButtonEvent(MouseEventData * medPtr);
-static int HandleWindowTitlebarMouseDown(MouseEventData * medPtr, Tk_Window tkwin);
-static unsigned int ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers);
-static Tk_Window GetGrabWindowForWindow(Tk_Window tkwin);
+#pragma mark TKApplication(TKMouseEvent)
-static int TkMacOSXGetEatButtonUp(void);
-static 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.
- *
- *----------------------------------------------------------------------
- */
+enum {
+ NSWindowWillMoveEventType = 20
+};
-MODULE_SCOPE int
-TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
+@implementation TKApplication(TKMouseEvent)
+- (NSEvent *) tkProcessMouseEvent: (NSEvent *) theEvent
{
- Tk_Window tkwin;
- Point where, where2;
- int result;
- TkDisplay * dispPtr;
- OSStatus err;
- MouseEventData mouseEventData, * medPtr = &mouseEventData;
- int isFrontProcess;
-
- switch (eventPtr->eKind) {
- case kEventMouseDown:
- case kEventMouseUp:
- case kEventMouseMoved:
- case kEventMouseDragged:
- case kEventMouseWheelMoved:
- break;
- default:
- return false;
- break;
- }
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamMouseLocation,
- typeQDPoint, NULL,
- sizeof(where), NULL,
- &where);
- if (err != noErr) {
- GetGlobalMouse(&where);
- }
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamWindowRef,
- typeWindowRef, NULL,
- sizeof(WindowRef), NULL,
- &medPtr->whichWin);
- if (err == noErr) {
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamWindowPartCode,
- typeWindowPartCode, NULL,
- sizeof(WindowPartCode), NULL,
- &medPtr->windowPart);
- }
- if (err != noErr) {
- medPtr->windowPart = FindWindow(where, &medPtr->whichWin);
- }
- medPtr->window = TkMacOSXGetXWindow(medPtr->whichWin);
- if (medPtr->whichWin != NULL && medPtr->window == None) {
- return false;
- }
- if (eventPtr->eKind == kEventMouseDown) {
- if (IsWindowActive(medPtr->whichWin) && IsWindowPathSelectEvent(
- medPtr->whichWin, eventPtr->eventRef)) {
- ChkErr(WindowPathSelect, medPtr->whichWin, NULL, NULL);
- return false;
- }
- if (medPtr->windowPart == inProxyIcon) {
- TkMacOSXTrackingLoop(1);
- err = ChkErr(TrackWindowProxyDrag, medPtr->whichWin, where);
- TkMacOSXTrackingLoop(0);
- if (err == errUserWantsToDragWindow) {
- medPtr->windowPart = inDrag;
- } else {
- return false;
- }
- }
- }
- isFrontProcess = Tk_MacOSXIsAppInFront();
- if (isFrontProcess) {
- medPtr->state = ButtonModifiers2State(GetCurrentEventButtonState(),
- GetCurrentEventKeyModifiers());
- } else {
- medPtr->state = ButtonModifiers2State(GetCurrentButtonState(),
- GetCurrentKeyModifiers());
- }
- medPtr->global = where;
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamWindowMouseLocation,
- typeQDPoint, NULL,
- sizeof(Point), NULL,
- &medPtr->local);
- if (err == noErr) {
- if (medPtr->whichWin) {
- Rect widths;
- GetWindowStructureWidths(medPtr->whichWin, &widths);
- medPtr->local.h -= widths.left;
- medPtr->local.v -= widths.top;
- }
- } else {
- medPtr->local = where;
- if (medPtr->whichWin) {
- QDGlobalToLocalPoint(GetWindowPort(medPtr->whichWin),
- &medPtr->local);
- }
- }
- medPtr->activeNonFloating = ActiveNonFloatingWindow();
- dispPtr = TkGetDisplayList();
- tkwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
-
- if (eventPtr->eKind != kEventMouseDown) {
- int res = false;
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
+#endif
+ id win;
+ NSEventType type = [theEvent type];
+#if 0
+ NSTrackingArea *trackingArea = nil;
+ NSInteger eventNumber, clickCount, buttonNumber;
+#endif
- switch (eventPtr->eKind) {
- case kEventMouseUp:
- /*
- * 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 (TkMacOSXGetEatButtonUp()) {
- TkMacOSXSetEatButtonUp(false);
- } else {
- res = GenerateButtonEvent(medPtr);
- }
- break;
- case kEventMouseWheelMoved:
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamMouseWheelDelta, typeLongInteger, NULL,
- sizeof(long), NULL, &medPtr->delta);
- if (err != noErr ) {
- statusPtr->err = 1;
- } else {
- EventMouseWheelAxis axis;
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamMouseWheelAxis, typeMouseWheelAxis,
- NULL, sizeof(EventMouseWheelAxis), NULL, &axis);
- if (err == noErr && axis == kEventMouseWheelAxisX) {
- medPtr->state |= ShiftMask;
- }
- res = GenerateMouseWheelEvent(medPtr);
- }
- break;
- case kEventMouseMoved:
- case kEventMouseDragged:
- res = GeneratePollingEvents(medPtr);
- break;
- default:
- Tcl_Panic("Unknown mouse event !");
- }
- if (res) {
- statusPtr->stopProcessing = 1;
+ switch (type) {
+ case NSMouseEntered:
+ case NSMouseExited:
+ case NSCursorUpdate:
+#if 0
+ trackingArea = [theEvent trackingArea];
+#endif
+ /* fall through */
+ case NSLeftMouseDown:
+ case NSLeftMouseUp:
+ case NSRightMouseDown:
+ case NSRightMouseUp:
+ case NSOtherMouseDown:
+ case NSOtherMouseUp:
+
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDragged:
+
+ case NSMouseMoved:
+#if 0
+ eventNumber = [theEvent eventNumber];
+ if (!trackingArea) {
+ clickCount = [theEvent clickCount];
+ buttonNumber = [theEvent buttonNumber];
}
- return res;
- }
- TkMacOSXSetEatButtonUp(false);
- 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.
- */
+#endif
- if (!(TkpIsWindowFloating(medPtr->whichWin))
- && (medPtr->whichWin != medPtr->activeNonFloating
- || !isFrontProcess)) {
- int frontWindowOnly = 1;
- int cmdDragGrow = ((medPtr->windowPart == inDrag ||
- medPtr->windowPart == inGrow) && medPtr->state & Mod1Mask);
+ case NSTabletPoint:
+ case NSTabletProximity:
- if (!cmdDragGrow) {
- Tk_Window grabWin = GetGrabWindowForWindow(tkwin);
+ case NSScrollWheel:
+ win = [self windowWithWindowNumber:[theEvent windowNumber]];
+ break;
- frontWindowOnly = !grabWin;
- if (grabWin && grabWin != tkwin) {
- TkMacOSXSetEatButtonUp(true);
- BringWindowForward(TkMacOSXDrawableWindow(
- ((TkWindow*)grabWin)->window), isFrontProcess,
- frontWindowOnly);
- return false;
- }
- }
+ default:
+ return theEvent;
+ break;
+ }
- /*
- * Clicks in the titlebar widgets are handled without bringing the
- * window forward.
- */
- if ((result = HandleWindowTitlebarMouseDown(medPtr, tkwin)) != -1) {
- statusPtr->stopProcessing = 1;
- return result;
- } else {
- /*
- * Only windows with the kWindowNoActivatesAttribute can
- * receive mouse events in the background.
- */
- if (!(((TkWindow *)tkwin)->wmInfoPtr->attributes &
- kWindowNoActivatesAttribute)) {
- /*
- * Allow background window dragging & growing with Command
- * down.
- */
- if (!cmdDragGrow) {
- TkMacOSXSetEatButtonUp(true);
- BringWindowForward(medPtr->whichWin, isFrontProcess,
- frontWindowOnly);
- }
- /*
- * Allow dragging & growing of windows that were/are in the
- * background.
- */
- if (!(medPtr->windowPart == inDrag ||
- medPtr->windowPart == inGrow)) {
- return false;
- }
- }
- }
- } else {
- if ((result = HandleWindowTitlebarMouseDown(medPtr, tkwin)) != -1) {
- statusPtr->stopProcessing = 1;
- return result;
- }
- }
- switch (medPtr->windowPart) {
- case inDrag: {
- WindowAttributes attributes;
+ NSPoint global, local = [theEvent locationInWindow];
- GetWindowAttributes(medPtr->whichWin, &attributes);
- if (!(attributes & kWindowAsyncDragAttribute)) {
- TkMacOSXTrackingLoop(1);
- DragWindow(medPtr->whichWin, where, NULL);
- TkMacOSXTrackingLoop(0);
- where2.h = where2.v = 0;
- QDLocalToGlobalPoint(GetWindowPort(medPtr->whichWin),
- &where2);
- if (EqualPt(where, where2)) {
- return false;
- }
- return true;
- }
- 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) {
- statusPtr->stopProcessing = 1;
- return true;
- } else {
- return GenerateButtonEvent(medPtr);
- }
- break;
- case inContent:
- return GenerateButtonEvent(medPtr);
- break;
- default:
- return false;
- break;
- }
+ if (win) {
+ global = [win convertBaseToScreen:local];
+ local.y = [win frame].size.height - local.y;
+ global.y = tkMacOSXZeroScreenHeight - global.y;
+ } else {
+ local.y = tkMacOSXZeroScreenHeight - local.y;
+ global = local;
}
- return false;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * HandleWindowTitlebarMouseDown --
- *
- * Handle clicks in window titlebar.
- *
- * Results:
- * 1 if event was handled, 0 if event was not handled,
- * -1 if MouseDown was not in window titlebar.
- *
- * Side effects:
- * Additional events may be place on the Tk event queue.
- *
- *----------------------------------------------------------------------
- */
-int
-HandleWindowTitlebarMouseDown(MouseEventData * medPtr, Tk_Window tkwin)
-{
- int result = INT_MAX;
+ Window window = TkMacOSXGetXWindow(win);
+ Tk_Window tkwin = window ? Tk_IdToWindow(TkGetDisplayList()->display,
+ window) : NULL;
+ if (!tkwin) {
+ tkwin = TkMacOSXGetCapture();
+ }
+ if (!tkwin) {
+ return theEvent;
+ }
- switch (medPtr->windowPart) {
- case inGoAway:
- case inCollapseBox:
- case inZoomIn:
- case inZoomOut:
- case inToolbarButton:
- if (!IsWindowActive(medPtr->whichWin)) {
- WindowRef frontWindow = FrontNonFloatingWindow();
- WindowModality frontWindowModality = kWindowModalityNone;
+ /*
+ MacDrawable *macWin = (MacDrawable *) window;
+ NSView *view = TkMacOSXDrawableView(macWin);
+ local = [view convertPoint:local fromView:nil];
+ local.y = NSHeight([view bounds]) - local.y;
+ */
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ local.x -= winPtr->wmInfoPtr->xInParent;
+ local.y -= winPtr->wmInfoPtr->yInParent;
+
+ int win_x, win_y;
+ tkwin = Tk_TopCoordsToWindow(tkwin, local.x, local.y,
+ &win_x, &win_y);
+
+ unsigned int state = 0;
+ NSInteger button = [theEvent buttonNumber];
+ EventRef eventRef = (EventRef)[theEvent eventRef];
+ UInt32 buttons;
+ OSStatus err = GetEventParameter(eventRef, kEventParamMouseChord,
+ typeUInt32, NULL, sizeof(UInt32), NULL, &buttons);
- if (frontWindow && frontWindow != medPtr->whichWin) {
- ChkErr(GetWindowModality, frontWindow,
- &frontWindowModality, NULL);
- }
- if (frontWindowModality == kWindowModalityAppModal) {
- result = 0;
- }
- }
+ if (err == noErr) {
+ state |= (buttons & ((1<<5) - 1)) << 8;
+ } else if (button < 5) {
+ switch (type) {
+ case NSLeftMouseDown:
+ case NSRightMouseDown:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDown:
+ state |= 1 << (button + 8);
break;
default:
- result = -1;
break;
- }
-
- if (result == INT_MAX) {
- result = 0;
- TkMacOSXTrackingLoop(1);
- switch (medPtr->windowPart) {
- case inGoAway:
- if (TrackGoAway(medPtr->whichWin, medPtr->global) && tkwin) {
- TkGenWMDestroyEvent(tkwin);
- result = 1;
- }
- break;
- case inCollapseBox:
- if (TrackBox(medPtr->whichWin, medPtr->global,
- medPtr->windowPart) && tkwin) {
- TkpWmSetState((TkWindow *)tkwin, IconicState);
- result = 1;
- }
- break;
- case inZoomIn:
- case inZoomOut:
- if (TrackBox(medPtr->whichWin, medPtr->global,
- medPtr->windowPart)) {
- result = TkMacOSXZoomToplevel(medPtr->whichWin,
- medPtr->windowPart);
- }
- break;
- case inToolbarButton:
- if (TrackBox(medPtr->whichWin, medPtr->global,
- medPtr->windowPart)) {
- result = GenerateToolbarButtonEvent(medPtr);
- }
- break;
}
- TkMacOSXTrackingLoop(0);
}
- return result;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * 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.
- *
- *----------------------------------------------------------------------
- */
+ NSUInteger modifiers = [theEvent modifierFlags];
-static int
-GeneratePollingEvents(MouseEventData * medPtr)
-{
- Tk_Window tkwin, rootwin, grabWin;
- int local_x, local_y;
- TkDisplay *dispPtr;
-
-
- grabWin = TkMacOSXGetCapture();
-
- if ((!TkpIsWindowFloating(medPtr->whichWin)
- && (medPtr->activeNonFloating != medPtr->whichWin))) {
- /*
- * If the window for this event is not floating, and is not the
- * active non-floating window, don't generate polling events.
- * We don't send events to backgrounded windows. So either send
- * it to the grabWin, or NULL if there is no grabWin.
- */
-
- tkwin = grabWin;
- } else {
- /*
- * First check whether the toplevel containing this mouse
- * event is the grab window. If not, then send the event
- * to the grab window. Otherwise, set tkWin to the subwindow
- * which most closely contains the mouse event.
- */
-
- dispPtr = TkGetDisplayList();
- rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
- if ((rootwin == NULL)
- || ((grabWin != NULL) && (rootwin != grabWin))) {
- tkwin = grabWin;
- } else {
- tkwin = Tk_TopCoordsToWindow(rootwin,
- medPtr->local.h, medPtr->local.v,
- &local_x, &local_y);
- }
+ if (modifiers & NSAlphaShiftKeyMask) {
+ state |= LockMask;
}
-
- /*
- * The following call will generate the appropiate X events and
- * adjust any state that Tk must remember.
- */
-
- Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v,
- medPtr->state);
-
- return true;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * BringWindowForward --
- *
- * Bring this background window to the front.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is brought forward.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-BringWindowForward(
- WindowRef wRef,
- int isFrontProcess,
- int frontWindowOnly)
-{
- if (wRef && !TkpIsWindowFloating(wRef) && IsValidWindowPtr(wRef)) {
- WindowRef frontWindow = FrontNonFloatingWindow();
- WindowModality frontWindowModality = kWindowModalityNone;
-
- if (frontWindow && frontWindow != wRef) {
- ChkErr(GetWindowModality, frontWindow, &frontWindowModality, NULL);
- }
- if (frontWindowModality != kWindowModalityAppModal) {
- Window window = TkMacOSXGetXWindow(wRef);
-
- if (window != None) {
- TkDisplay *dispPtr = TkGetDisplayList();
- TkWindow * winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display,
- window);
-
- if (winPtr && winPtr->wmInfoPtr &&
- winPtr->wmInfoPtr->master != None) {
- TkWindow *masterWinPtr = (TkWindow *)Tk_IdToWindow(
- dispPtr->display, winPtr->wmInfoPtr->master);
-
- if (masterWinPtr && masterWinPtr->window != None &&
- TkMacOSXHostToplevelExists(masterWinPtr)) {
- WindowRef masterMacWin =
- TkMacOSXDrawableWindow(masterWinPtr->window);
-
- if (masterMacWin) {
- BringToFront(masterMacWin);
- }
- }
- }
- }
- SelectWindow(wRef);
- } else {
- frontWindowOnly = 0;
- }
+ if (modifiers & NSShiftKeyMask) {
+ state |= ShiftMask;
}
- if (!isFrontProcess) {
- ProcessSerialNumber ourPsn = {0, kCurrentProcess};
-
- ChkErr(SetFrontProcessWithOptions, &ourPsn, frontWindowOnly ?
- kSetFrontProcessFrontWindowOnly : 0);
+ if (modifiers & NSControlKeyMask) {
+ state |= ControlMask;
}
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXBringWindowForward --
- *
- * Bring this window to the front in response to a mouse click. If
- * a grab is in effect, bring the grab window to the front instead.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The window is brought forward.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TkMacOSXBringWindowForward(
- WindowRef wRef)
-{
- TkDisplay *dispPtr = TkGetDisplayList();
- Tk_Window tkwin = Tk_IdToWindow(dispPtr->display,TkMacOSXGetXWindow(wRef));
- Tk_Window grabWin = GetGrabWindowForWindow(tkwin);
-
- if (grabWin && grabWin != tkwin) {
- wRef = TkMacOSXDrawableWindow(((TkWindow*)grabWin)->window);
+ if (modifiers & NSCommandKeyMask) {
+ state |= Mod1Mask; /* command key */
}
- TkMacOSXSetEatButtonUp(true);
- BringWindowForward(wRef, Tk_MacOSXIsAppInFront(), !grabWin);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetGrabWindowForWindow --
- *
- * Get the grab window for the given window, if any.
- *
- * Results:
- * Grab Tk_Window or None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-Tk_Window
-GetGrabWindowForWindow(
- Tk_Window tkwin)
-{
- Tk_Window grabWin = TkMacOSXGetCapture();
-
- if (!grabWin) {
- int grabState = TkGrabState((TkWindow*)tkwin);
-
- if (grabState != TK_GRAB_NONE && grabState != TK_GRAB_IN_TREE) {
- grabWin = (Tk_Window) (((TkWindow*)tkwin)->dispPtr->grabWinPtr);
- }
+ if (modifiers & NSAlternateKeyMask) {
+ state |= Mod2Mask; /* option key */
}
-
- return grabWin;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GenerateMouseWheelEvent --
- *
- * Generates a "MouseWheel" Tk event.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Places a mousewheel event on the event queue.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GenerateMouseWheelEvent(MouseEventData * medPtr)
-{
- Tk_Window tkwin, rootwin;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
- XEvent xEvent;
-
- dispPtr = TkGetDisplayList();
- rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
- if (rootwin == NULL) {
- tkwin = NULL;
- } else {
- tkwin = Tk_TopCoordsToWindow(rootwin,
- medPtr->local.h, medPtr->local.v,
- &xEvent.xbutton.x, &xEvent.xbutton.y);
+ if (modifiers & NSNumericPadKeyMask) {
+ state |= Mod3Mask;
}
-
- /*
- * The following call will generate the appropiate X events and
- * adjust any state that Tk must remember.
- */
-
- if (!tkwin) {
- tkwin = TkMacOSXGetCapture();
+ if (modifiers & NSFunctionKeyMask) {
+ state |= Mod4Mask;
}
- if (!tkwin) {
- return false;
+
+ if (type != NSScrollWheel) {
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"UpdatePointer %p x %f.0 y %f.0 %d", tkwin, global.x, global.y, state);
+#endif
+ Tk_UpdatePointer(tkwin, global.x, global.y, state);
+ } else {
+ CGFloat delta;
+ int coarseDelta;
+ XEvent xEvent;
+
+ xEvent.type = MouseWheelEvent;
+ xEvent.xbutton.x = local.x;
+ xEvent.xbutton.y = local.y;
+ xEvent.xbutton.x_root = global.x;
+ xEvent.xbutton.y_root = global.y;
+ xEvent.xany.send_event = false;
+ xEvent.xany.display = Tk_Display(tkwin);
+ xEvent.xany.window = Tk_WindowId(tkwin);
+
+ delta = [theEvent deltaY];
+ if (delta != 0.0) {
+ coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta);
+ xEvent.xbutton.state = state;
+ xEvent.xkey.keycode = coarseDelta;
+ xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ }
+ delta = [theEvent deltaX];
+ if (delta != 0.0) {
+ coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta);
+ xEvent.xbutton.state = state | ShiftMask;
+ xEvent.xkey.keycode = coarseDelta;
+ xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+ }
}
- winPtr = (TkWindow *) tkwin;
- xEvent.type = MouseWheelEvent;
- xEvent.xkey.keycode = medPtr->delta;
- xEvent.xbutton.x_root = medPtr->global.h;
- xEvent.xbutton.y_root = medPtr->global.v;
- xEvent.xbutton.state = medPtr->state;
- 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(void)
-{
- 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;
+ return theEvent;
}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
@@ -779,7 +237,7 @@ TkMacOSXModifierState(void)
keyModifiers = isFrontProcess ? GetCurrentEventKeyModifiers() :
GetCurrentKeyModifiers();
- return (EventModifiers)(keyModifiers & USHRT_MAX);
+ return (EventModifiers) (keyModifiers & USHRT_MAX);
}
/*
@@ -790,8 +248,8 @@ TkMacOSXModifierState(void)
* 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.
+ * A bitwise inclusive OR of a subset of the following: Button1Mask,
+ * ShiftMask, LockMask, ControlMask, Mod*Mask.
*
* Side effects:
* None.
@@ -805,10 +263,8 @@ TkMacOSXButtonKeyState(void)
UInt32 buttonState = 0, keyModifiers;
int isFrontProcess = (GetCurrentEvent() && Tk_MacOSXIsAppInFront());
- if (!TkMacOSXGetEatButtonUp()) {
- buttonState = isFrontProcess ? GetCurrentEventButtonState() :
- GetCurrentButtonState();
- }
+ buttonState = isFrontProcess ? GetCurrentEventButtonState() :
+ GetCurrentButtonState();
keyModifiers = isFrontProcess ? GetCurrentEventKeyModifiers() :
GetCurrentKeyModifiers();
@@ -833,11 +289,16 @@ TkMacOSXButtonKeyState(void)
*/
static unsigned int
-ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers)
+ButtonModifiers2State(
+ UInt32 buttonState,
+ UInt32 keyModifiers)
{
unsigned int state;
- /* Tk supports at most 5 buttons */
+ /*
+ * Tk supports at most 5 buttons.
+ */
+
state = (buttonState & ((1<<5) - 1)) << 8;
if (keyModifiers & alphaLock) {
@@ -871,12 +332,12 @@ ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers)
* 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.
+ * 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.
+ * Sets root_x_return, root_y_return, and mask_return. Returns true on
+ * success.
*
* Side effects:
* None.
@@ -886,71 +347,42 @@ ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers)
Bool
XQueryPointer(
- Display* display,
+ 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)
+ 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)
{
int getGlobal = (root_x_return && root_y_return);
- int getLocal = (win_x_return && win_y_return);
+ int getLocal = (win_x_return && win_y_return && w != None);
if (getGlobal || getLocal) {
- Point where, local;
- OSStatus err = noErr;
- int gotMouseLoc = 0;
- EventRef ev = GetCurrentEvent();
+ NSPoint global = [NSEvent mouseLocation];
- if (ev && getLocal) {
- err = ChkErr(GetEventParameter, ev, kEventParamWindowMouseLocation,
- typeQDPoint, NULL, sizeof(Point), NULL, &local);
- gotMouseLoc = (err == noErr);
- }
- if (getGlobal || !gotMouseLoc) {
- if (ev) {
- err = ChkErr(GetEventParameter, ev, kEventParamMouseLocation,
- typeQDPoint, NULL, sizeof(Point), NULL, &where);
- }
- if (!ev || err != noErr) {
- GetGlobalMouse(&where);
- }
- }
if (getLocal) {
- WindowRef whichWin;
- if (ev) {
- err = ChkErr(GetEventParameter, ev, kEventParamWindowRef,
- typeWindowRef, NULL, sizeof(WindowRef), NULL,
- &whichWin);
- }
- if (!ev || err != noErr) {
- FindWindow(where, &whichWin);
- }
- if (gotMouseLoc) {
- if (whichWin) {
- Rect widths;
+ MacDrawable *macWin = (MacDrawable *) w;
+ NSWindow *win = TkMacOSXDrawableWindow(w);
- ChkErr(GetWindowStructureWidths, whichWin, &widths);
- local.h -= widths.left;
- local.v -= widths.top;
- }
- } else {
- local = where;
- if (whichWin) {
- QDGlobalToLocalPoint(GetWindowPort(whichWin), &local);
+ if (win) {
+ NSPoint local;
+
+ local = [win convertScreenToBase:global];
+ local.y = [win frame].size.height - local.y;
+ if (macWin->winPtr && macWin->winPtr->wmInfoPtr) {
+ local.x -= macWin->winPtr->wmInfoPtr->xInParent;
+ local.y -= macWin->winPtr->wmInfoPtr->yInParent;
}
+ *win_x_return = local.x;
+ *win_y_return = local.y;
}
}
if (getGlobal) {
- *root_x_return = where.h;
- *root_y_return = where.v;
- }
- if (getLocal) {
- *win_x_return = local.h;
- *win_y_return = local.v;
+ *root_x_return = global.x;
+ *root_y_return = tkMacOSXZeroScreenHeight - global.y;
}
}
if (mask_return) {
@@ -964,35 +396,34 @@ XQueryPointer(
*
* TkGenerateButtonEventForXPointer --
*
- * This procedure generates an X button event for the current
- * pointer state as reported by XQueryPointer().
+ * This procedure generates an X button event for the current pointer
+ * state as reported by XQueryPointer().
*
* 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.
+ * Additional events may be place on the Tk event queue. Grab state may
+ * also change.
*
*----------------------------------------------------------------------
*/
MODULE_SCOPE int
TkGenerateButtonEventForXPointer(
- Window window) /* X Window containing button event. */
+ Window window) /* X Window containing button event. */
{
MouseEventData med;
int global_x, global_y, local_x, local_y;
bzero(&med, sizeof(MouseEventData));
- XQueryPointer(NULL, None, NULL, NULL, &global_x, &global_y,
+ XQueryPointer(NULL, window, NULL, NULL, &global_x, &global_y,
&local_x, &local_y, &med.state);
med.global.h = global_x;
med.global.v = global_y;
med.local.h = local_x;
med.local.v = local_y;
med.window = window;
- med.activeNonFloating = ActiveNonFloatingWindow();
return GenerateButtonEvent(&med);
}
@@ -1002,27 +433,29 @@ TkGenerateButtonEventForXPointer(
*
* 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.
+ * 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.
+ * 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.
+ * 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 */
+ 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. */
{
+ MacDrawable *macWin = (MacDrawable *) window;
+ NSWindow *win = TkMacOSXDrawableWindow(window);
MouseEventData med;
bzero(&med, sizeof(MouseEventData));
@@ -1030,10 +463,20 @@ TkGenerateButtonEvent(
med.window = window;
med.global.h = x;
med.global.v = y;
- FindWindow(med.global, &med.whichWin);
- med.activeNonFloating = ActiveNonFloatingWindow();
med.local = med.global;
- QDGlobalToLocalPoint(GetWindowPort(med.whichWin), &med.local);
+
+ if (win) {
+ NSPoint local = NSMakePoint(x, tkMacOSXZeroScreenHeight - y);
+
+ local = [win convertScreenToBase:local];
+ local.y = [win frame].size.height - local.y;
+ if (macWin->winPtr && macWin->winPtr->wmInfoPtr) {
+ local.x -= macWin->winPtr->wmInfoPtr->xInParent;
+ local.y -= macWin->winPtr->wmInfoPtr->yInParent;
+ }
+ med.local.h = local.x;
+ med.local.v = tkMacOSXZeroScreenHeight - local.y;
+ }
return GenerateButtonEvent(&med);
}
@@ -1043,21 +486,22 @@ TkGenerateButtonEvent(
*
* GenerateButtonEvent --
*
- * Generate an X button event from a MouseEventData structure.
- * Handles the state changes needed to implement implicit grabs.
+ * Generate an X button event from a MouseEventData structure. 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.
+ * Additional events may be place on the Tk event queue. Grab state may
+ * also change.
*
*----------------------------------------------------------------------
*/
static int
-GenerateButtonEvent(MouseEventData * medPtr)
+GenerateButtonEvent(
+ MouseEventData *medPtr)
{
Tk_Window tkwin;
int dummy;
@@ -1065,11 +509,12 @@ GenerateButtonEvent(MouseEventData * medPtr)
#if UNUSED
/*
- * 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.
+ * 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.
*/
+
if ((medPtr->activeNonFloating == NULL)
|| ((!(TkpIsWindowFloating(medPtr->whichWin))
&& (medPtr->activeNonFloating != medPtr->whichWin))
@@ -1087,61 +532,48 @@ GenerateButtonEvent(MouseEventData * medPtr)
}
Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v, medPtr->state);
-
return true;
}
-/*
- *----------------------------------------------------------------------
- *
- * GenerateToolbarButtonEvent --
- *
- * Generates a "ToolbarButton" virtual event.
- * This can be used to manage disappearing toolbars.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Places a virtual event on the event queue.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GenerateToolbarButtonEvent(MouseEventData * medPtr)
+void
+TkpWarpPointer(
+ TkDisplay *dispPtr)
{
- Tk_Window rootwin, tkwin = NULL;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
- XVirtualEvent event;
+ CGPoint pt;
+ UInt32 buttonState;
- dispPtr = TkGetDisplayList();
- rootwin = Tk_IdToWindow(dispPtr->display, medPtr->window);
- if (rootwin) {
- tkwin = Tk_TopCoordsToWindow(rootwin,
- medPtr->local.h, medPtr->local.v, &event.x, &event.y);
- }
- if (!tkwin) {
- return true;
+ if (dispPtr->warpWindow) {
+ int x, y;
+
+ Tk_GetRootCoords(dispPtr->warpWindow, &x, &y);
+ pt.x = x + dispPtr->warpX;
+ pt.y = y + dispPtr->warpY;
+ } else {
+ pt.x = dispPtr->warpX;
+ pt.y = dispPtr->warpY;
}
- winPtr = (TkWindow *)tkwin;
- bzero(&event, sizeof(XVirtualEvent));
- event.type = VirtualEvent;
- event.serial = LastKnownRequestProcessed(winPtr->display);
- event.send_event = false;
- event.display = winPtr->display;
- event.event = winPtr->window;
- event.root = XRootWindow(winPtr->display, 0);
- event.subwindow = None;
- event.time = TkpGetMS();
- event.x_root = medPtr->global.h;
- event.y_root = medPtr->global.v;
- event.state = medPtr->state;
- event.same_screen = true;
- event.name = Tk_GetUid("ToolbarButton");
+ /*
+ * Tell the OSX core to generate the events to make it happen. This is
+ * fairly ugly, but means that under most circumstances we'll register all
+ * the events that would normally be generated correctly. If we use
+ * CGWarpMouseCursorPosition instead, strange things happen.
+ */
- Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
- return true;
+ buttonState = (GetCurrentEvent() && Tk_MacOSXIsAppInFront())
+ ? GetCurrentEventButtonState() : GetCurrentButtonState();
+
+ CGPostMouseEvent(pt, 1 /* generate motion events */, 5,
+ buttonState&1 ? 1 : 0, buttonState&2 ? 1 : 0,
+ buttonState&4 ? 1 : 0, buttonState&8 ? 1 : 0,
+ buttonState&16 ? 1 : 0);
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index d368292..689f45e 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -2,11 +2,11 @@
* tkMacOSXNotify.c --
*
* This file contains the implementation of a tcl event source
- * for the Carbon event loop.
+ * for the AppKit event loop.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -14,29 +14,121 @@
#include "tkMacOSXPrivate.h"
#include "tkMacOSXEvent.h"
+#include <tclInt.h>
#include <pthread.h>
-
-/*
- * The following static indicates whether this module has been initialized
- * in the current thread.
- */
+#import <objc/objc-auto.h>
typedef struct ThreadSpecificData {
- int initialized;
+ int initialized, sendEventNestingLevel;
+ NSEvent *currentEvent;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+#define TSD_INIT() ThreadSpecificData *tsdPtr = \
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData))
+
static void TkMacOSXNotifyExitHandler(ClientData clientData);
-static void CarbonEventsSetupProc(ClientData clientData, int flags);
-static void CarbonEventsCheckProc(ClientData clientData, int flags);
+static void TkMacOSXEventsSetupProc(ClientData clientData, int flags);
+static void TkMacOSXEventsCheckProc(ClientData clientData, int flags);
+
+#pragma mark TKApplication(TKNotify)
- /*
+@interface NSApplication(TKNotify)
+- (void) _modalSession: (NSModalSession) session sendEvent: (NSEvent *) event;
+@end
+
+@implementation NSWindow(TKNotify)
+- (id) tkDisplayIfNeeded
+{
+ if (![self isAutodisplay]) {
+ [self displayIfNeeded];
+ }
+ return nil;
+}
+@end
+
+@implementation TKApplication(TKNotify)
+- (NSEvent *) nextEventMatchingMask: (NSUInteger) mask
+ untilDate: (NSDate *) expiration inMode: (NSString *) mode
+ dequeue: (BOOL) deqFlag
+{
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
+
+ [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO];
+
+ int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ NSEvent *event = [[super nextEventMatchingMask:mask untilDate:expiration
+ inMode:mode dequeue:deqFlag] retain];
+
+ Tcl_SetServiceMode(oldMode);
+ if (event) {
+ TSD_INIT();
+ if (tsdPtr->sendEventNestingLevel) {
+ if (![NSApp tkProcessEvent:event]) {
+ [event release];
+ event = nil;
+ }
+ }
+ }
+ [pool drain];
+ return [event autorelease];
+}
+
+- (void) sendEvent: (NSEvent *) theEvent
+{
+ TSD_INIT();
+ int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+
+ tsdPtr->sendEventNestingLevel++;
+ [super sendEvent:theEvent];
+ tsdPtr->sendEventNestingLevel--;
+ Tcl_SetServiceMode(oldMode);
+ [NSApp tkCheckPasteboard];
+}
+@end
+
+#pragma mark -
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetRunLoopMode --
+ *
+ * Results:
+ * RunLoop mode that should be passed to -nextEventMatchingMask:
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static NSString *
+GetRunLoopMode(NSModalSession modalSession)
+{
+ NSString *runLoopMode = nil;
+
+ if (modalSession) {
+ runLoopMode = NSModalPanelRunLoopMode;
+ } else if (TkMacOSXGetCapture()) {
+ runLoopMode = NSEventTrackingRunLoopMode;
+ }
+ if (!runLoopMode) {
+ runLoopMode = [[NSRunLoop currentRunLoop] currentMode];
+ }
+ if (!runLoopMode) {
+ runLoopMode = NSDefaultRunLoopMode;
+ }
+ return runLoopMode;
+}
+
+/*
*----------------------------------------------------------------------
*
* Tk_MacOSXSetupTkNotifier --
*
* This procedure is called during Tk initialization to create
- * the event source for Carbon events.
+ * the event source for TkAqua events.
*
* Results:
* None.
@@ -50,35 +142,30 @@ static void CarbonEventsCheckProc(ClientData clientData, int flags);
void
Tk_MacOSXSetupTkNotifier(void)
{
- ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey,
- sizeof(ThreadSpecificData));
+ TSD_INIT();
if (!tsdPtr->initialized) {
- /* 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.
+ tsdPtr->initialized = 1;
+
+ /*
+ * Install TkAqua event source in main event loop thread.
*/
- GetMainEventQueue();
- tsdPtr->initialized = 1;
- /* Install Carbon events event source in main event loop thread. */
- if (GetCurrentEventLoop() == GetMainEventLoop()) {
+ if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) {
if (!pthread_main_np()) {
/*
- * Panic if the Carbon main event loop thread (i.e. the
- * thread where HIToolbox was first loaded) is not the
- * main application thread, as Carbon does not support
- * this properly.
+ * Panic if main runloop is not on the main application thread.
*/
+
Tcl_Panic("Tk_MacOSXSetupTkNotifier: %s",
"first [load] of TkAqua has to occur in the main thread!");
}
- Tcl_CreateEventSource(CarbonEventsSetupProc,
- CarbonEventsCheckProc, GetMainEventQueue());
+ Tcl_CreateEventSource(TkMacOSXEventsSetupProc,
+ TkMacOSXEventsCheckProc, GetMainEventQueue());
TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL);
+ Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ TclMacOSXNotifierAddRunLoopMode(NSEventTrackingRunLoopMode);
+ TclMacOSXNotifierAddRunLoopMode(NSModalPanelRunLoopMode);
}
}
}
@@ -101,89 +188,136 @@ Tk_MacOSXSetupTkNotifier(void)
*/
static void
-TkMacOSXNotifyExitHandler(clientData)
- ClientData clientData; /* Not used. */
+TkMacOSXNotifyExitHandler(
+ ClientData clientData) /* Not used. */
{
- ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey,
- sizeof(ThreadSpecificData));
+ TSD_INIT();
- Tcl_DeleteEventSource(CarbonEventsSetupProc,
- CarbonEventsCheckProc, GetMainEventQueue());
+ Tcl_DeleteEventSource(TkMacOSXEventsSetupProc,
+ TkMacOSXEventsCheckProc, GetMainEventQueue());
tsdPtr->initialized = 0;
}
/*
*----------------------------------------------------------------------
*
- * CarbonEventsSetupProc --
+ * TkMacOSXEventsSetupProc --
*
- * This procedure implements the setup part of the Carbon Events
- * event source. It is invoked by Tcl_DoOneEvent before entering
- * the notifier to check for events.
+ * This procedure implements the setup part of the TkAqua Events event
+ * source. It is invoked by Tcl_DoOneEvent before entering the notifier
+ * to check for events.
*
* Results:
* None.
*
* Side effects:
- * If Carbon events are queued, then the maximum block time will be
- * set to 0 to ensure that the notifier returns control to Tcl.
+ * If TkAqua events are queued, then the maximum block time will be set
+ * to 0 to ensure that the notifier returns control to Tcl.
*
*----------------------------------------------------------------------
*/
static void
-CarbonEventsSetupProc(clientData, flags)
- ClientData clientData;
- int flags;
+TkMacOSXEventsSetupProc(
+ ClientData clientData,
+ int flags)
{
- static Tcl_Time blockTime = { 0, 0 };
+ if (flags & TCL_WINDOW_EVENTS &&
+ ![[NSRunLoop currentRunLoop] currentMode]) {
+ static const Tcl_Time zeroBlockTime = { 0, 0 };
+ TSD_INIT();
- if (!(flags & TCL_WINDOW_EVENTS)) {
- return;
- }
+ if (!tsdPtr->currentEvent) {
+ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantPast]
+ inMode:GetRunLoopMode(TkMacOSXGetModalSession())
+ dequeue:YES];
- if (GetNumEventsInQueue((EventQueueRef)clientData)) {
- Tcl_SetMaxBlockTime(&blockTime);
+ if (currentEvent) {
+ tsdPtr->currentEvent =
+ TkMacOSXMakeUncollectableAndRetain(currentEvent);
+ }
+ }
+ if (tsdPtr->currentEvent) {
+ Tcl_SetMaxBlockTime(&zeroBlockTime);
+ }
}
}
/*
*----------------------------------------------------------------------
*
- * CarbonEventsCheckProc --
+ * TkMacOSXEventsCheckProc --
*
- * This procedure processes events sitting in the Carbon event
- * queue.
+ * This procedure processes events sitting in the TkAqua event queue.
*
* Results:
* None.
*
* Side effects:
- * Moves applicable queued Carbon events onto the Tcl event queue.
+ * Moves applicable queued TkAqua events onto the Tcl event queue.
*
*----------------------------------------------------------------------
*/
static void
-CarbonEventsCheckProc(clientData, flags)
- ClientData clientData;
- int flags;
+TkMacOSXEventsCheckProc(
+ ClientData clientData,
+ int flags)
{
- int numFound;
- OSStatus err = noErr;
-
- if (!(flags & TCL_WINDOW_EVENTS)) {
- return;
- }
-
- numFound = GetNumEventsInQueue((EventQueueRef)clientData);
+ if (flags & TCL_WINDOW_EVENTS &&
+ ![[NSRunLoop currentRunLoop] currentMode]) {
+ NSEvent *currentEvent = nil;
+ NSAutoreleasePool *pool = nil;
+ NSModalSession modalSession;
- /* Avoid starving other event sources: */
- if (numFound > 4) {
- numFound = 4;
- }
- while (numFound > 0 && err == noErr) {
- err = TkMacOSXReceiveAndDispatchEvent();
- numFound--;
+ TSD_INIT();
+ if (tsdPtr->currentEvent) {
+ currentEvent = TkMacOSXMakeCollectableAndAutorelease(
+ tsdPtr->currentEvent);
+ }
+ do {
+ modalSession = TkMacOSXGetModalSession();
+ if (!currentEvent) {
+ currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantPast]
+ inMode:GetRunLoopMode(modalSession) dequeue:YES];
+ }
+ if (!currentEvent) {
+ break;
+ }
+ [currentEvent retain];
+ pool = [NSAutoreleasePool new];
+ if (tkMacOSXGCEnabled) {
+ objc_clear_stack(0);
+ }
+ if (![NSApp tkProcessEvent:currentEvent]) {
+ [currentEvent release];
+ currentEvent = nil;
+ }
+ if (currentEvent) {
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@" event: %@", currentEvent);
+#endif
+ if (modalSession) {
+ [NSApp _modalSession:modalSession sendEvent:currentEvent];
+ } else {
+ [NSApp sendEvent:currentEvent];
+ }
+ [currentEvent release];
+ currentEvent = nil;
+ }
+ [pool drain];
+ pool = nil;
+ } while (1);
}
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h
index 85213ab..b457711 100644
--- a/macosx/tkMacOSXPort.h
+++ b/macosx/tkMacOSXPort.h
@@ -6,8 +6,8 @@
* #includes for system include files and a few other things.
*
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -16,21 +16,6 @@
#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
-
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
@@ -138,9 +123,6 @@
* 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) {}
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index 0059038..347f448 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -3,88 +3,38 @@
*
* Macros and declarations that are purely internal & private to TkAqua.
*
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple 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 _TKMACPRIV
#define _TKMACPRIV
-#ifndef _TKMACINT
-#include "tkMacOSXInt.h"
+#if !__OBJC__
+#error Objective-C compiler required
#endif
-/* Define constants only available on Mac OS X 10.3 or later */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
- #define kEventAppAvailableWindowBoundsChanged 110
- #define kEventParamTransactionID 'trns'
- #define kEventParamWindowPartCode 'wpar'
- #define typeWindowPartCode 'wpar'
- #define kMenuAttrDoNotUseUserCommandKeys (1 << 7)
- #define kSimpleWindowClass 18
- #define kWindowDoesNotCycleAttribute (1L << 15)
- #define kWindowAsyncDragAttribute (1L << 23)
- #define kThemeBrushAlternatePrimaryHighlightColor -5
- #define kThemeResizeUpCursor 19
- #define kThemeResizeDownCursor 19
- #define kThemeResizeUpDownCursor 19
- #define kThemePoofCursor 19
- #define kThemeBackgroundMetal 6
- #define kThemeIncDecButtonSmall 21
- #define kThemeIncDecButtonMini 22
- #define kThemeComboBox 16
- #define kThemeMiniSystemFont 109
- #define kAppearancePartUpButton 20
- #define kAppearancePartDownButton 21
- #define kAppearancePartPageUpArea 22
- #define kAppearancePartPageDownArea 23
- #define kAppearancePartIndicator 129
- #define kUIModeAllSuppressed 4
- #define FixedToInt(a) ((short)(((Fixed)(a) + fixed1/2) >> 16))
- #define IntToFixed(a) ((Fixed)(a) << 16)
-#endif
-/* Define constants only available on Mac OS X 10.4 or later */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
- #define kWindowNoTitleBarAttribute (1L << 9)
- #define kWindowMetalNoContentSeparatorAttribute (1L << 11)
- #define kThemeDisclosureTriangle 6
- #define kThemeBrushListViewOddRowBackground 56
- #define kThemeBrushListViewEvenRowBackground 57
- #define kThemeBrushListViewColumnDivider 58
- #define kThemeMetricScrollBarMinThumbHeight 132
- #define kThemeMetricSmallScrollBarMinThumbHeight 134
- #define kThemeScrollBarMedium kThemeMediumScrollBar
- #define kThemeScrollBarSmall kThemeSmallScrollBar
- #ifdef __BIG_ENDIAN__
- #define kCGBitmapByteOrder32Host (4 << 12)
- #else
- #define kCGBitmapByteOrder32Host (2 << 12)
- #endif
-#endif
-/* Define constants only available on Mac OS X 10.5 or later */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
- #define kWindowUnifiedTitleAndToolbarAttribute (1L << 7)
- #define kWindowTexturedSquareCornersAttribute (1L << 10)
+#define TextStyle MacTextStyle
+#import <ApplicationServices/ApplicationServices.h>
+#import <Cocoa/Cocoa.h>
+#ifndef NO_CARBON_H
+#import <Carbon/Carbon.h>
#endif
-/* HIToolbox version constants */
-#ifndef kHIToolboxVersionNumber10_3
- #define kHIToolboxVersionNumber10_3 (145)
-#endif
-#ifndef kHIToolboxVersionNumber10_4
- #define kHIToolboxVersionNumber10_4 (219)
+#undef TextStyle
+#import <objc/runtime.h> /* for sel_isEqual() */
+
+#ifndef _TKMACINT
+#include "tkMacOSXInt.h"
#endif
-#ifndef kHIToolboxVersionNumber10_5
- #define kHIToolboxVersionNumber10_5 (343)
+#ifndef _TKMACDEFAULT
+#include "tkMacOSXDefault.h"
#endif
-/* Macros for HIToolbox runtime version checking */
-MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
-#define TK_IF_HI_TOOLBOX(vers, ...) \
- tk_if_mac_os_x_min_10_##vers(tkMacOSXToolboxVersionNumber >= \
- kHIToolboxVersionNumber10_##vers, 1, __VA_ARGS__)
-#define TK_ELSE_HI_TOOLBOX(vers, ...) \
- tk_else_mac_os_x_min_10_##vers(__VA_ARGS__)
+
/* Macros for Mac OS X API availability checking */
#define TK_IF_MAC_OS_X_API(vers, symbol, ...) \
tk_if_mac_os_x_10_##vers(symbol != NULL, 1, __VA_ARGS__)
@@ -110,46 +60,6 @@ MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
#define tk_else_mac_os_x_no(...) \
} else { __VA_ARGS__
/* Private mapping macros defined according to Mac OS X version requirements */
-/* 10.3 Panther */
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1030
-#define tk_if_mac_os_x_min_10_3 tk_if_mac_os_x_yes
-#define tk_else_mac_os_x_min_10_3 tk_else_mac_os_x_yes
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_yes
-#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_yes
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
-#else /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#define tk_if_mac_os_x_min_10_3 tk_if_mac_os_x_chk
-#define tk_else_mac_os_x_min_10_3 tk_else_mac_os_x_chk
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_chk
-#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_chk
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
-#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
-#define tk_if_mac_os_x_10_3 tk_if_mac_os_x_no
-#define tk_else_mac_os_x_10_3 tk_else_mac_os_x_no
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
-/* 10.4 Tiger */
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1040
-#define tk_if_mac_os_x_min_10_4 tk_if_mac_os_x_yes
-#define tk_else_mac_os_x_min_10_4 tk_else_mac_os_x_yes
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_yes
-#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_yes
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
-#else /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#define tk_if_mac_os_x_min_10_4 tk_if_mac_os_x_chk
-#define tk_else_mac_os_x_min_10_4 tk_else_mac_os_x_chk
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_chk
-#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_chk
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
-#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
-#define tk_if_mac_os_x_10_4 tk_if_mac_os_x_no
-#define tk_else_mac_os_x_10_4 tk_else_mac_os_x_no
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
/* 10.5 Leopard */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
#define tk_if_mac_os_x_min_10_5 tk_if_mac_os_x_yes
@@ -185,26 +95,25 @@ MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
*/
#ifdef TK_MAC_DEBUG
+#define TKLog(f, ...) NSLog(f, ##__VA_ARGS__)
+
/*
* Macro to do debug message output.
*/
-#define TkMacOSXDbgMsg(m, ...) do { \
- fprintf(stderr, "%s:%d: %s(): " m "\n", strrchr(__FILE__, '/')+1, \
- __LINE__, __func__, ##__VA_ARGS__); \
- } while (0)
+#define TkMacOSXDbgMsg(m, ...) \
+ do { \
+ TKLog(@"%s:%d: %s(): " m, strrchr(__FILE__, '/')+1, \
+ __LINE__, __func__, ##__VA_ARGS__); \
+ } while (0)
+
/*
* Macro to do debug API failure message output.
*/
-#if !defined(DEBUGLEVEL) || !DEBUGLEVEL
-#define TkMacOSXDbgOSErr(f, err) do { \
- TkMacOSXDbgMsg("%s failed: %ld", #f, err); \
- } while (0)
-#else
-#define TkMacOSXDbgOSErr(f, err) do { \
- DEBUG_ASSERT_MESSAGE(kComponentSignatureString, #f " failed:", \
- __func__, 0, strrchr(__FILE__, '/')+1, __LINE__, err); \
- } while (0)
-#endif
+#define TkMacOSXDbgOSErr(f, err) \
+ do { \
+ TkMacOSXDbgMsg("%s failed: %d", #f, (int)(err)); \
+ } while (0)
+
/*
* Macro to do very common check for noErr return from given API and output
* debug message in case of failure.
@@ -215,19 +124,12 @@ MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
TkMacOSXDbgOSErr(f, err); \
} \
err;})
-/*
- * Macro to check emptyness of shared QD tmp region before use in debug builds.
- */
-#define TkMacOSXCheckTmpQdRgnEmpty() do { \
- if (!EmptyRgn(tkMacOSXtmpQdRgn)) { \
- Tcl_Panic("tkMacOSXtmpQdRgn nonempty"); \
- } \
- } while(0)
+
#else /* TK_MAC_DEBUG */
+#define TKLog(f, ...)
#define TkMacOSXDbgMsg(m, ...)
#define TkMacOSXDbgOSErr(f, err)
#define ChkErr(f, ...) ({f(__VA_ARGS__);})
-#define TkMacOSXCheckTmpQdRgnEmpty()
#endif /* TK_MAC_DEBUG */
/*
@@ -238,10 +140,25 @@ MODULE_SCOPE float tkMacOSXToolboxVersionNumber;
static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
if (symbol == (void*)(-1L)) { \
symbol = TkMacOSXGetNamedSymbol(STRINGIFY(module), \
- STRINGIFY(_##symbol)); \
+ STRINGIFY(symbol)); \
}
-MODULE_SCOPE void* TkMacOSXGetNamedSymbol(const char* module,
- const char* symbol);
+
+/*
+ * Macros for GC
+ */
+
+#define TkMacOSXMakeUncollectable(x) ({ id o = (id)(x); \
+ if (o) { if(tkMacOSXGCEnabled) CFRetain(o); } o; })
+#define TkMacOSXMakeUncollectableAndRetain(x) ({ id o = (id)(x); \
+ if (o) { if(tkMacOSXGCEnabled) CFRetain(o); else [o retain]; } o; })
+#define TkMacOSXMakeCollectable(x) ({ id o = (id)(x); \
+ if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); } o; })
+#define TkMacOSXMakeCollectableAndRelease(x) ({ id o = (id)(x); \
+ if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \
+ else [o release]; } o; })
+#define TkMacOSXMakeCollectableAndAutorelease(x) ({ id o = (id)(x); \
+ if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \
+ else [o autorelease]; } o; })
/*
* Structure encapsulating current drawing environment.
@@ -249,90 +166,198 @@ MODULE_SCOPE void* TkMacOSXGetNamedSymbol(const char* module,
typedef struct TkMacOSXDrawingContext {
CGContextRef context;
- CGrafPtr port, savePort;
- ThemeDrawingState saveState;
- RgnHandle saveClip;
+ NSView *view;
HIShapeRef clipRgn;
- PixPatHandle penPat;
- Rect portBounds;
- Boolean portChanged;
+ CGRect portBounds;
+ int focusLocked;
} TkMacOSXDrawingContext;
/*
* Variables internal to TkAqua.
*/
-MODULE_SCOPE RgnHandle tkMacOSXtmpQdRgn;
-MODULE_SCOPE int tkMacOSXUseCGDrawing;
+MODULE_SCOPE CGFloat tkMacOSXZeroScreenHeight;
+MODULE_SCOPE CGFloat tkMacOSXZeroScreenTop;
+MODULE_SCOPE int tkMacOSXGCEnabled;
+MODULE_SCOPE long tkMacOSXMacOSXVersion;
+#if TK_MAC_BUTTON_USE_COMPATIBILITY_METRICS
+MODULE_SCOPE int tkMacOSXUseCompatibilityMetrics;
+#endif
/*
* Prototypes for TkMacOSXRegion.c.
*/
#if 0
-MODULE_SCOPE void TkMacOSXEmtpyRegion(TkRegion r);
-MODULE_SCOPE int TkMacOSXIsEmptyRegion(TkRegion r);
+MODULE_SCOPE void TkMacOSXEmtpyRegion(TkRegion r);
+MODULE_SCOPE int TkMacOSXIsEmptyRegion(TkRegion r);
#endif
-MODULE_SCOPE HIShapeRef TkMacOSXGetNativeRegion(TkRegion r);
-MODULE_SCOPE void TkMacOSXSetWithNativeRegion(TkRegion r, HIShapeRef rgn);
-MODULE_SCOPE void TkMacOSXOffsetRegion(TkRegion r, short dx, short dy);
-MODULE_SCOPE HIShapeRef TkMacOSXHIShapeCreateEmpty(void);
+MODULE_SCOPE HIShapeRef TkMacOSXGetNativeRegion(TkRegion r);
+MODULE_SCOPE void TkMacOSXSetWithNativeRegion(TkRegion r,
+ HIShapeRef rgn);
+MODULE_SCOPE void TkMacOSXOffsetRegion(TkRegion r, short dx, short dy);
+MODULE_SCOPE HIShapeRef TkMacOSXHIShapeCreateEmpty(void);
MODULE_SCOPE HIMutableShapeRef TkMacOSXHIShapeCreateMutableWithRect(
- const CGRect *inRect);
-MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithShape(
- HIMutableShapeRef inDestShape, HIShapeRef inSrcShape);
+ const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithShape(
+ HIMutableShapeRef inDestShape,
+ HIShapeRef inSrcShape);
#if 0
-MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithRect(HIMutableShapeRef inShape,
- const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithRect(HIMutableShapeRef inShape,
+ const CGRect *inRect);
#endif
-MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect(
- HIMutableShapeRef inShape, const CGRect *inRect);
-MODULE_SCOPE OSStatus TkMacOSHIShapeUnionWithRect(HIMutableShapeRef inShape,
- const CGRect *inRect);
-MODULE_SCOPE OSStatus TkMacOSHIShapeUnion(HIShapeRef inShape1,
- HIShapeRef inShape2, HIMutableShapeRef outResult);
+MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect(
+ HIMutableShapeRef inShape, const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSHIShapeUnionWithRect(HIMutableShapeRef inShape,
+ const CGRect *inRect);
+MODULE_SCOPE OSStatus TkMacOSHIShapeUnion(HIShapeRef inShape1,
+ HIShapeRef inShape2, HIMutableShapeRef outResult);
/*
* Prototypes of TkAqua internal procs.
*/
-MODULE_SCOPE void TkMacOSXDisplayChanged(Display *display);
-MODULE_SCOPE void TkMacOSXInitScrollbarMetrics(void);
-MODULE_SCOPE int TkMacOSXUseAntialiasedText(Tcl_Interp *interp, int enable);
-MODULE_SCOPE void TkMacOSXInitCarbonEvents(Tcl_Interp *interp);
-MODULE_SCOPE int TkMacOSXInitCGDrawing(Tcl_Interp *interp, int enable,
- int antiAlias);
-MODULE_SCOPE void TkMacOSXInitKeyboard(Tcl_Interp *interp);
-MODULE_SCOPE int TkMacOSXGenerateFocusEvent(Window window, int activeFlag);
-MODULE_SCOPE int TkMacOSXGenerateParentMenuSelectEvent(MenuRef menu);
-MODULE_SCOPE int TkMacOSXGenerateMenuSelectEvent(MenuRef menu,
- MenuItemIndex index);
-MODULE_SCOPE void TkMacOSXClearActiveMenu(MenuRef menu);
+MODULE_SCOPE void * TkMacOSXGetNamedSymbol(const char *module,
+ const char *symbol);
+MODULE_SCOPE void TkMacOSXDisplayChanged(Display *display);
+MODULE_SCOPE int TkMacOSXUseAntialiasedText(Tcl_Interp *interp,
+ int enable);
+MODULE_SCOPE int TkMacOSXInitCGDrawing(Tcl_Interp *interp, int enable,
+ int antiAlias);
+MODULE_SCOPE int TkMacOSXGenerateFocusEvent(TkWindow *winPtr,
+ int activeFlag);
MODULE_SCOPE WindowClass TkMacOSXWindowClass(TkWindow *winPtr);
-MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr);
-MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window);
+MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr);
+MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window);
MODULE_SCOPE EventModifiers TkMacOSXModifierState(void);
-MODULE_SCOPE int TkMacOSXSetupDrawingContext(Drawable d, GC gc, int useCG,
- TkMacOSXDrawingContext *dcPtr);
-MODULE_SCOPE void TkMacOSXRestoreDrawingContext(TkMacOSXDrawingContext *dcPtr);
-MODULE_SCOPE void TkMacOSXSetColorInPort(unsigned long pixel, int fg,
- PixPatHandle penPat, CGrafPtr port);
-MODULE_SCOPE void TkMacOSXSetColorInContext(unsigned long pixel,
- CGContextRef context);
-MODULE_SCOPE int TkMacOSXRunTclEventLoop(void);
-MODULE_SCOPE OSStatus TkMacOSXStartTclEventLoopCarbonTimer(void);
-MODULE_SCOPE OSStatus TkMacOSXStopTclEventLoopCarbonTimer(void);
-MODULE_SCOPE void TkMacOSXTrackingLoop(int tracking);
-MODULE_SCOPE OSStatus TkMacOSXReceiveAndDispatchEvent(void);
-MODULE_SCOPE void TkMacOSXInstallWindowCarbonEventHandler(Tcl_Interp *interp,
- WindowRef window);
-MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr, WindowRef window,
- int fullscreen, Tcl_Interp *interp);
-MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr, int active);
-MODULE_SCOPE void TkMacOSXBringWindowForward(WindowRef wRef);
-MODULE_SCOPE WindowRef TkMacOSXDrawableWindow(Drawable drawable);
-MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
-MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
-MODULE_SCOPE Tcl_Obj* TkMacOSXGetStringObjFromCFString(CFStringRef str);
+MODULE_SCOPE int TkMacOSXSetupDrawingContext(Drawable d, GC gc,
+ int useCG, TkMacOSXDrawingContext *dcPtr);
+MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
+ TkMacOSXDrawingContext *dcPtr);
+MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel,
+ CGContextRef context);
+MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr,
+ NSWindow *window, int fullscreen,
+ Tcl_Interp *interp);
+MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr,
+ int active);
+MODULE_SCOPE NSWindow* TkMacOSXDrawableWindow(Drawable drawable);
+MODULE_SCOPE NSView* TkMacOSXDrawableView(MacDrawable *macWin);
+MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
+MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
+MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view,
+ HIShapeRef rgn);
+MODULE_SCOPE CGImageRef TkMacOSXCreateCGImageWithDrawable(Drawable drawable);
+MODULE_SCOPE NSImage* TkMacOSXGetNSImageWithTkImage(Display *display,
+ Tk_Image image, int width, int height);
+MODULE_SCOPE NSImage* TkMacOSXGetNSImageWithBitmap(Display *display,
+ Pixmap bitmap, GC gc, int width, int height);
+MODULE_SCOPE CGColorRef TkMacOSXCreateCGColor(GC gc, unsigned long pixel);
+MODULE_SCOPE NSColor* TkMacOSXGetNSColor(GC gc, unsigned long pixel);
+MODULE_SCOPE Tcl_Obj * TkMacOSXGetStringObjFromCFString(CFStringRef str);
+MODULE_SCOPE TkWindow* TkMacOSXGetTkWindow(NSWindow *w);
+MODULE_SCOPE NSFont* TkMacOSXNSFontForFont(Tk_Font tkfont);
+MODULE_SCOPE NSDictionary* TkMacOSXNSFontAttributesForFont(Tk_Font tkfont);
+MODULE_SCOPE NSModalSession TkMacOSXGetModalSession(void);
+MODULE_SCOPE void TkMacOSXSelDeadWindow(TkWindow *winPtr);
+MODULE_SCOPE void TkMacOSXApplyWindowAttributes(TkWindow *winPtr,
+ NSWindow *macWindow);
+MODULE_SCOPE int TkMacOSXStandardAboutPanelObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int TkMacOSXIconBitmapObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+
+#pragma mark Private Objective-C Classes
+
+#define VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+
+enum { tkMainMenu = 1, tkApplicationMenu, tkWindowsMenu, tkHelpMenu};
+
+VISIBILITY_HIDDEN
+@interface TKMenu : NSMenu {
+@private
+ void *_tkMenu;
+ NSUInteger _tkOffset, _tkItemCount, _tkSpecial;
+}
+- (void)setSpecial:(NSUInteger)special;
+- (BOOL)isSpecial:(NSUInteger)special;
+@end
+
+VISIBILITY_HIDDEN
+@interface TKApplication : NSApplication {
+@private
+ Tcl_Interp *_eventInterp;
+ NSMenu *_servicesMenu;
+ TKMenu *_defaultMainMenu, *_defaultApplicationMenu;
+ NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems;
+ NSArray *_defaultHelpMenuItems;
+}
+@end
+@interface TKApplication(TKInit)
+- (NSString *)tkFrameworkImagePath:(NSString*)image;
+@end
+@interface TKApplication(TKEvent)
+- (NSEvent *)tkProcessEvent:(NSEvent *)theEvent;
+@end
+@interface TKApplication(TKMouseEvent)
+- (NSEvent *)tkProcessMouseEvent:(NSEvent *)theEvent;
+@end
+@interface TKApplication(TKKeyEvent)
+- (NSEvent *)tkProcessKeyEvent:(NSEvent *)theEvent;
+@end
+@interface TKApplication(TKMenu)
+- (void)tkSetMainMenu:(TKMenu *)menu;
+@end
+@interface TKApplication(TKClipboard)
+- (void)tkProvidePasteboard:(TkDisplay *)dispPtr;
+- (void)tkCheckPasteboard;
+@end
+
+VISIBILITY_HIDDEN
+@interface TKContentView : NSView {
+@private
+ id _savedSubviews;
+ BOOL _subviewsSetAside;
+}
+@end
+
+VISIBILITY_HIDDEN
+@interface TKWindow : NSWindow
+@end
+
+#pragma mark NSMenu & NSMenuItem Utilities
+
+@interface NSMenu(TKUtils)
++ (id)menuWithTitle:(NSString *)title;
++ (id)menuWithTitle:(NSString *)title menuItems:(NSArray *)items;
++ (id)menuWithTitle:(NSString *)title submenus:(NSArray *)submenus;
+- (NSMenuItem *)itemWithSubmenu:(NSMenu *)submenu;
+- (NSMenuItem *)itemInSupermenu;
+@end
+
+@interface NSMenuItem(TKUtils)
++ (id)itemWithSubmenu:(NSMenu *)submenu;
++ (id)itemWithTitle:(NSString *)title submenu:(NSMenu *)submenu;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action
+ target:(id)target;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action
+ keyEquivalent:(NSString *)keyEquivalent;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action
+ target:(id)target keyEquivalent:(NSString *)keyEquivalent;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action
+ keyEquivalent:(NSString *)keyEquivalent
+ keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask;
++ (id)itemWithTitle:(NSString *)title action:(SEL)action
+ target:(id)target keyEquivalent:(NSString *)keyEquivalent
+ keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask;
+@end
+
+/* From WebKit/WebKit/mac/WebCoreSupport/WebChromeClient.mm: */
+@interface NSWindow(TKGrowBoxRect)
+- (NSRect)_growBoxRect;
+@end
#endif /* _TKMACPRIV */
diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c
index 4c480c6..ff5944f 100644
--- a/macosx/tkMacOSXRegion.c
+++ b/macosx/tkMacOSXRegion.c
@@ -4,8 +4,8 @@
* Implements X window calls for manipulating regions
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -19,8 +19,8 @@
*
* TkCreateRegion --
*
- * Implements the equivelent of the X window function
- * XCreateRegion. See X window documentation for more details.
+ * Implements the equivelent of the X window function XCreateRegion. See
+ * Xwindow documentation for more details.
*
* Results:
* Returns an allocated region handle.
@@ -42,8 +42,8 @@ TkCreateRegion(void)
*
* TkDestroyRegion --
*
- * Implements the equivelent of the X window function
- * XDestroyRegion. See X window documentation for more details.
+ * Implements the equivelent of the X window function XDestroyRegion. See
+ * Xwindow documentation for more details.
*
* Results:
* None.
@@ -68,8 +68,8 @@ TkDestroyRegion(
*
* TkIntersectRegion --
*
- * Implements the equivalent of the X window function
- * XIntersectRegion. See X window documentation for more details.
+ * Implements the equivalent of the X window function XIntersectRegion.
+ * See Xwindow documentation for more details.
*
* Results:
* None.
@@ -95,8 +95,8 @@ TkIntersectRegion(
*
* TkSubtractRegion --
*
- * Implements the equivalent of the X window function
- * XSubtractRegion. See X window documentation for more details.
+ * Implements the equivalent of the X window function XSubtractRegion.
+ * See X window documentation for more details.
*
* Results:
* None.
@@ -123,8 +123,7 @@ TkSubtractRegion(
* TkUnionRectWithRegion --
*
* Implements the equivelent of the X window function
- * XUnionRectWithRegion. See X window documentation for more
- * details.
+ * XUnionRectWithRegion. See Xwindow documentation for more details.
*
* Results:
* None.
@@ -161,8 +160,8 @@ TkUnionRectWithRegion(
*
* TkRectInRegion --
*
- * Implements the equivelent of the X window function
- * XRectInRegion. See X window documentation for more details.
+ * Implements the equivelent of the X window function XRectInRegion. See
+ * Xwindow documentation for more details.
*
* Results:
* Returns RectanglePart or RectangleOut. Note that this is not a
@@ -185,38 +184,8 @@ TkRectInRegion(
int result;
const CGRect r = CGRectMake(x, y, width, height);
- TK_IF_MAC_OS_X_API (4, HIShapeIntersectsRect,
- result = HIShapeIntersectsRect((HIShapeRef) region, &r) ?
- RectanglePart : RectangleOut;
- ) TK_ELSE_MAC_OS_X (4,
- HIShapeRef rectRgn = HIShapeCreateWithRect(&r);
- HIShapeRef sectRgn = HIShapeCreateIntersection((HIShapeRef) region,
- rectRgn);
-
-#if 1
- result = !HIShapeIsEmpty(sectRgn) ? RectanglePart : RectangleOut;
-#else
- /*
- * More expensive full implementation that tests for RectangleIn,
- * unused by Tk at present.
- */
-
- if (!HIShapeIsEmpty(sectRgn)) {
- HIShapeRef diffRgn = HIShapeCreateDifference(rectRgn, sectRgn);
-
- if (HIShapeIsEmpty(diffRgn)) {
- result = RectangleIn;
- } else {
- result = RectanglePart;
- }
- CFRelease(diffRgn);
- } else {
- result = RectangleOut;
- }
-#endif
- CFRelease(sectRgn);
- CFRelease(rectRgn);
- ) TK_ENDIF
+ result = HIShapeIntersectsRect((HIShapeRef) region, &r) ?
+ RectanglePart : RectangleOut;
return result;
}
@@ -225,8 +194,8 @@ TkRectInRegion(
*
* TkClipBox --
*
- * Implements the equivelent of the X window function XClipBox.
- * See X window documentation for more details.
+ * Implements the equivelent of the X window function XClipBox. See
+ * Xwindow documentation for more details.
*
* Results:
* None.
@@ -243,7 +212,7 @@ TkClipBox(
XRectangle* rect_return)
{
CGRect rect;
-
+
HIShapeGetBounds((HIShapeRef) r, &rect);
rect_return->x = rect.origin.x;
rect_return->y = rect.origin.y;
@@ -256,8 +225,8 @@ TkClipBox(
*
* TkpBuildRegionFromAlphaData --
*
- * Set up a rectangle of the given region based on the supplied
- * alpha data.
+ * Set up a rectangle of the given region based on the supplied alpha
+ * data.
*
* Results:
* None
@@ -288,13 +257,20 @@ TkpBuildRegionFromAlphaData(
for (y1 = 0; y1 < height; y1++) {
lineDataPtr = dataPtr;
for (x1 = 0; x1 < width; x1 = end) {
- /* search for first non-transparent pixel */
+ /*
+ * Search for first non-transparent pixel.
+ */
+
while ((x1 < width) && !*lineDataPtr) {
x1++;
lineDataPtr += pixelStride;
}
end = x1;
- /* search for first transparent pixel */
+
+ /*
+ * Search for first transparent pixel.
+ */
+
while ((end < width) && *lineDataPtr) {
end++;
lineDataPtr += pixelStride;
@@ -495,20 +471,7 @@ TkMacOSXHIShapeCreateEmpty(void)
{
HIShapeRef result;
- TK_IF_MAC_OS_X_API (4, HIShapeCreateEmpty,
- result = HIShapeCreateEmpty();
- ) TK_ELSE_MAC_OS_X (4,
- static HIShapeRef emptyRgn = NULL;
-
- if (!emptyRgn) {
- HIMutableShapeRef rgn = HIShapeCreateMutable();
-
- emptyRgn = HIShapeCreateCopy(rgn);
- CFRelease(rgn);
- }
- result = HIShapeCreateCopy(emptyRgn);
- ) TK_ENDIF
-
+ result = HIShapeCreateEmpty();
return result;
}
@@ -518,15 +481,7 @@ TkMacOSXHIShapeCreateMutableWithRect(
{
HIMutableShapeRef result;
- TK_IF_MAC_OS_X_API (5, HIShapeCreateMutableWithRect,
- result = HIShapeCreateMutableWithRect(inRect);
- ) TK_ELSE_MAC_OS_X (5,
- HIShapeRef rgn = HIShapeCreateWithRect(inRect);
-
- result = HIShapeCreateMutableCopy(rgn);
- CFRelease(rgn);
- ) TK_ENDIF
-
+ result = HIShapeCreateMutableWithRect(inRect);
return result;
}
@@ -537,15 +492,7 @@ TkMacOSXHIShapeSetWithShape(
{
OSStatus result;
- TK_IF_MAC_OS_X_API (5, HIShapeSetWithShape,
- result = HIShapeSetWithShape(inDestShape, inSrcShape);
- ) TK_ELSE_MAC_OS_X (5,
- result = HIShapeSetEmpty(inDestShape);
- if (result == noErr) {
- result = HIShapeDifference(inSrcShape, inDestShape, inDestShape);
- }
- ) TK_ENDIF
-
+ result = HIShapeSetWithShape(inDestShape, inSrcShape);
return result;
}
@@ -586,15 +533,7 @@ TkMacOSHIShapeUnionWithRect(
{
OSStatus result;
- TK_IF_MAC_OS_X_API (5, HIShapeUnionWithRect,
- result = HIShapeUnionWithRect(inShape, inRect);
- ) TK_ELSE_MAC_OS_X (5,
- HIShapeRef rgn = HIShapeCreateWithRect(inRect);
-
- result = TkMacOSHIShapeUnion(rgn, inShape, inShape);
- CFRelease(rgn);
- ) TK_ENDIF
-
+ result = HIShapeUnionWithRect(inShape, inRect);
return result;
}
@@ -606,21 +545,15 @@ TkMacOSHIShapeUnion(
{
OSStatus result;
- TK_IF_HI_TOOLBOX (4,
- result = HIShapeUnion(inShape1, inShape2, outResult);
- ) TK_ELSE_HI_TOOLBOX (4,
- /* Workaround HIShapeUnion bug in 10.3 and earlier */
- HIShapeRef rgn = HIShapeCreateCopy(outResult);
-
- result = HIShapeUnion(inShape1, inShape2, (HIMutableShapeRef) rgn);
- if (result == noErr) {
- result = HIShapeSetEmpty(outResult);
- if (result == noErr) {
- result = HIShapeDifference(rgn, outResult, outResult);
- }
- }
- CFRelease(rgn);
- ) TK_ENDIF
-
+ result = HIShapeUnion(inShape1, inShape2, outResult);
return result;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c
index c63df02..d69d6a1 100644
--- a/macosx/tkMacOSXScale.c
+++ b/macosx/tkMacOSXScale.c
@@ -6,7 +6,8 @@
*
* Copyright (c) 1996 by Sun Microsystems, Inc.
* Copyright (c) 1998-2000 by Scriptics Corporation.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,6 +16,7 @@
#include "tkMacOSXPrivate.h"
#include "tkScale.h"
+#ifdef MAC_OSX_TK_TODO
/*
#ifdef TK_MAC_DEBUG
#define TK_MAC_DEBUG_SCALE
@@ -74,7 +76,7 @@ TkScale *
TkpCreateScale(
Tk_Window tkwin)
{
- MacScale *macScalePtr = (MacScale *) ckalloc(sizeof(MacScale));
+ MacScale *macScalePtr = ckalloc(sizeof(MacScale));
macScalePtr->scaleHandle = NULL;
if (scaleActionProc == NULL) {
@@ -172,7 +174,7 @@ TkpDisplayScale(
result = Tcl_VarEval(interp, scalePtr->command, " ", string, NULL);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp, "\n (command executed by scale)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, result);
}
Tcl_Release((ClientData) interp);
}
@@ -479,4 +481,13 @@ ScaleActionProc(
TkMacOSXRunTclEventLoop();
Tcl_Release((ClientData) scalePtr);
}
-
+#endif
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c
index 820bec3..77b89e7 100644
--- a/macosx/tkMacOSXScrlbr.c
+++ b/macosx/tkMacOSXScrlbr.c
@@ -2,12 +2,11 @@
* 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.
+ * widget.
*
* Copyright (c) 1996 by Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,95 +14,147 @@
#include "tkMacOSXPrivate.h"
#include "tkScrollbar.h"
-#include "tkMacOSXDebug.h"
-#define MIN_SCROLLBAR_VALUE 0
-#define SCROLLBAR_SCALING_VALUE ((double)(LONG_MAX>>1))
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_SCROLLBAR
+#endif
+*/
/*
* Declaration of Mac specific scrollbar structure.
*/
typedef struct MacScrollbar {
- TkScrollbar info; /* Generic scrollbar info */
- ControlRef sbHandle; /* Scrollbar control */
- int macFlags; /* Various flags; see below */
- Rect eraseRect; /* Rect to erase before drawing control */
+ TkScrollbar info;
+ NSScroller *scroller;
+ int variant;
} MacScrollbar;
-/*
- * 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).
- */
-
-#define ALREADY_DEAD 1
-#define IN_MODAL_LOOP 2
-#define ACTIVE 4
-
-/*
- * Globals uses locally in this file.
- */
-static ControlActionUPP scrollActionProc = NULL; /* Pointer to func. */
-static ControlActionUPP thumbActionProc = NULL; /* Pointer to func. */
-static Point mouseDownPoint; /* Used to store the coordinates where the */
- /* mouse was first pressed to begin */
- /* dragging the thumb, because */
- /* ThumbActionProc can't take any args. */
-
typedef struct ScrollbarMetrics {
- SInt32 width, minHeight, minThumbHeight;
- short topArrowHeight, bottomArrowHeight;
- ControlSize size;
+ SInt32 width, minThumbHeight;
+ int minHeight, topArrowHeight, bottomArrowHeight;
+ NSControlSize controlSize;
} ScrollbarMetrics;
static ScrollbarMetrics metrics[2] = {
- {15, 54, 26, 14, 14, kControlSizeNormal}, /* kThemeScrollBarMedium */
- {11, 40, 20, 10, 10, kControlSizeSmall}, /* kThemeScrollBarSmall */
+ {15, 54, 26, 14, 14, NSRegularControlSize}, /* kThemeScrollBarMedium */
+ {11, 40, 20, 10, 10, NSSmallControlSize}, /* kThemeScrollBarSmall */
};
/*
- * This variable holds the default width for a scrollbar in string form for
- * use in a Tk_ConfigSpec.
+ * Declarations for functions defined in this file.
*/
-static char defWidth[TCL_INTEGER_SPACE];
+static void UpdateScrollbarMetrics(void);
+static void ScrollbarEventProc(ClientData clientData,
+ XEvent *eventPtr);
/*
- * Forward declarations for procedures defined later in this file:
+ * The class procedure table for the scrollbar widget.
*/
-static pascal void ScrollbarActionProc(ControlRef theControl,
- ControlPartCode partCode);
-static pascal void ThumbActionProc(ControlRef theControl,
- ControlPartCode partCode);
-static int ScrollbarBindProc(ClientData clientData, Tcl_Interp *interp,
- XEvent *eventPtr, Tk_Window tkwin, KeySym keySym);
-static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr);
-static void UpdateControlValues(MacScrollbar *macScrollPtr);
+const Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ NULL, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
+};
+
+#pragma mark TKApplication(TKScrlbr)
+
+#define NSAppleAquaScrollBarVariantChanged @"AppleAquaScrollBarVariantChanged"
-/*
- * 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.
- */
+@implementation TKApplication(TKScrlbr)
+- (void) tkScroller: (NSScroller *) scroller
+{
+ NSScrollerPart hitPart = [scroller hitPart];
+ TkScrollbar *scrollPtr = (TkScrollbar *)[scroller tag];
+ Tcl_DString cmdString;
+ Tcl_Interp *interp;
+ int result;
-Tk_ClassProcs tkpScrollbarProcs = {
- sizeof(Tk_ClassProcs) /* size */
-};
+ if (!scrollPtr || !scrollPtr->command || !scrollPtr->commandSize ||
+ hitPart == NSScrollerNoPart) {
+ return;
+ }
+
+ Tcl_DStringInit(&cmdString);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ scrollPtr->commandSize);
+ switch (hitPart) {
+ case NSScrollerKnob:
+ case NSScrollerKnobSlot: {
+ char valueString[TCL_DOUBLE_SPACE];
+
+ Tcl_PrintDouble(NULL, [scroller doubleValue] *
+ (1.0 - [scroller knobProportion]), valueString);
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+ break;
+ }
+ case NSScrollerDecrementLine:
+ case NSScrollerIncrementLine:
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (hitPart == NSScrollerDecrementLine) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "unit");
+ break;
+ case NSScrollerDecrementPage:
+ case NSScrollerIncrementPage:
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (hitPart == NSScrollerDecrementPage) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "page");
+ break;
+ }
+ interp = scrollPtr->interp;
+ Tcl_Preserve(interp);
+ Tcl_Preserve(scrollPtr);
+ result = Tcl_EvalEx(interp, Tcl_DStringValue(&cmdString),
+ Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
+ if (result != TCL_OK && result != TCL_CONTINUE && result != TCL_BREAK) {
+ Tcl_AddErrorInfo(interp, "\n (scrollbar command)");
+ Tcl_BackgroundException(interp, result);
+ }
+ Tcl_Release(scrollPtr);
+ Tcl_Release(interp);
+ Tcl_DStringFree(&cmdString);
+#ifdef TK_MAC_DEBUG_SCROLLBAR
+ TKLog(@"scroller %s value %f knobProportion %f",
+ ((TkWindow *)scrollPtr->tkwin)->pathName, [scroller doubleValue],
+ [scroller knobProportion]);
+#endif
+}
+
+- (void) scrollBarVariantChanged: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ UpdateScrollbarMetrics();
+}
+
+- (void) _setupScrollBarNotifications
+{
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+
+#define observe(n, s) [nc addObserver:self selector:@selector(s) name:(n) object:nil]
+ observe(NSAppleAquaScrollBarVariantChanged, scrollBarVariantChanged:);
+#undef observe
+ UpdateScrollbarMetrics();
+}
+@end
+
+#pragma mark -
+
/*
*----------------------------------------------------------------------
*
- * TkMacOSXInitScrollbarMetrics --
+ * UpdateScrollbarMetrics --
*
- * This function initializes the current system metrics for a
- * scrollbar.
+ * This function retrieves the current system metrics for a scrollbar.
*
* Results:
* None.
@@ -114,41 +165,44 @@ Tk_ClassProcs tkpScrollbarProcs = {
*----------------------------------------------------------------------
*/
-void
-TkMacOSXInitScrollbarMetrics(void)
+static void
+UpdateScrollbarMetrics(void)
{
const short height = 100, width = 50;
- ThemeTrackDrawInfo info = {0, {0, 0, height, width}, 0, 1, 0, 0,
- kThemeTrackShowThumb, kThemeTrackActive, 0, {{1, 0}}};
- Rect bounds;
- Tk_ConfigSpec *specPtr;
+ HIThemeTrackDrawInfo info = {
+ .version = 0,
+ .bounds = {{0, 0}, {width, height}},
+ .min = 0,
+ .max = 1,
+ .value = 0,
+ .attributes = kThemeTrackShowThumb,
+ .enableState = kThemeTrackActive,
+ .trackInfo.scrollbar = {.viewsize = 1, .pressState = 0},
+ };
+ CGRect bounds;
ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &metrics[0].width);
ChkErr(GetThemeMetric, kThemeMetricScrollBarMinThumbHeight,
&metrics[0].minThumbHeight);
info.kind = kThemeScrollBarMedium;
- ChkErr(GetThemeTrackDragRect, &info, &bounds);
- metrics[0].topArrowHeight = bounds.top;
- metrics[0].bottomArrowHeight = height - bounds.bottom;
+ ChkErr(HIThemeGetTrackDragRect, &info, &bounds);
+ metrics[0].topArrowHeight = bounds.origin.y;
+ metrics[0].bottomArrowHeight = height - (bounds.origin.y +
+ bounds.size.height);
metrics[0].minHeight = metrics[0].minThumbHeight +
metrics[0].topArrowHeight + metrics[0].bottomArrowHeight;
ChkErr(GetThemeMetric, kThemeMetricSmallScrollBarWidth, &metrics[1].width);
ChkErr(GetThemeMetric, kThemeMetricSmallScrollBarMinThumbHeight,
&metrics[1].minThumbHeight);
info.kind = kThemeScrollBarSmall;
- ChkErr(GetThemeTrackDragRect, &info, &bounds);
- metrics[1].topArrowHeight = bounds.top;
- metrics[1].bottomArrowHeight = height - bounds.bottom;
+ ChkErr(HIThemeGetTrackDragRect, &info, &bounds);
+ metrics[1].topArrowHeight = bounds.origin.y;
+ metrics[1].bottomArrowHeight = height - (bounds.origin.y +
+ bounds.size.height);
metrics[1].minHeight = metrics[1].minThumbHeight +
metrics[1].topArrowHeight + metrics[1].bottomArrowHeight;
- sprintf(defWidth, "%ld", metrics[0].width);
- for (specPtr = tkpScrollbarConfigSpecs; specPtr->type != TK_CONFIG_END;
- specPtr++) {
- if (specPtr->offset == Tk_Offset(TkScrollbar, width)) {
- specPtr->defValue = defWidth;
- }
- }
+ sprintf(tkDefScrollbarWidth, "%d", (int)(metrics[0].width));
}
/*
@@ -162,45 +216,46 @@ TkMacOSXInitScrollbarMetrics(void)
* Returns a newly allocated TkScrollbar structure.
*
* Side effects:
- * None.
+ * Registers an event handler for the widget.
*
*----------------------------------------------------------------------
*/
TkScrollbar *
TkpCreateScrollbar(
- Tk_Window tkwin) /* New Tk Window. */
+ Tk_Window tkwin)
{
- static int initialized = 0;
- MacScrollbar * macScrollPtr;
- TkWindow *winPtr = (TkWindow *)tkwin;
+ MacScrollbar *scrollPtr = ckalloc(sizeof(MacScrollbar));
- if (scrollActionProc == NULL) {
- scrollActionProc = NewControlActionUPP(ScrollbarActionProc);
- thumbActionProc = NewControlActionUPP(ThumbActionProc);
- }
- if (!initialized) {
- TkMacOSXInitScrollbarMetrics();
- initialized = 1;
- }
- macScrollPtr = (MacScrollbar *) ckalloc(sizeof(MacScrollbar));
- macScrollPtr->sbHandle = NULL;
- macScrollPtr->macFlags = 0;
- SetRect(&macScrollPtr->eraseRect, 0, 0, 0, 0);
+ scrollPtr->scroller = nil;
+ Tk_CreateEventHandler(tkwin, StructureNotifyMask|FocusChangeMask|
+ ActivateMask|ExposureMask, ScrollbarEventProc, scrollPtr);
+ return (TkScrollbar *) scrollPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyScrollbar --
+ *
+ * Free data structures associated with the scrollbar control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
- Tk_CreateEventHandler(tkwin, ActivateMask|ExposureMask|
- StructureNotifyMask|FocusChangeMask,
- ScrollbarEventProc, (ClientData) macScrollPtr);
+void
+TkpDestroyScrollbar(
+ TkScrollbar *scrollPtr)
+{
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
- 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;
+ TkMacOSXMakeCollectableAndRelease(macScrollPtr->scroller);
}
/*
@@ -208,9 +263,9 @@ TkpCreateScrollbar(
*
* 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.
+ * 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.
@@ -225,111 +280,87 @@ void
TkpDisplayScrollbar(
ClientData clientData) /* Information about window. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
- MacScrollbar *macScrollPtr = (MacScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
+ MacScrollbar *macScrollPtr = clientData;
+ NSScroller *scroller = macScrollPtr->scroller;
Tk_Window tkwin = scrollPtr->tkwin;
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- WindowRef windowRef;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ MacDrawable *macWin = (MacDrawable *) winPtr->window;
+ TkMacOSXDrawingContext dc;
+ NSView *view = TkMacOSXDrawableView(macWin);
+ CGFloat viewHeight = [view bounds].size.height;
+ CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0,
+ .ty = viewHeight};
+ NSRect frame;
+ double knobProportion = scrollPtr->lastFraction - scrollPtr->firstFraction;
- if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- goto done;
+ scrollPtr->flags &= ~REDRAW_PENDING;
+ if (!scrollPtr->tkwin || !Tk_IsMapped(tkwin) || !view ||
+ !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) {
+ return;
}
-
- /*
- * Draw the focus or any 3D relief we may have.
- */
+ CGContextConcatCTM(dc.context, t);
if (scrollPtr->highlightWidth != 0) {
GC fgGC, bgGC;
- bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr,
- Tk_WindowId(tkwin));
-
+ bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr, (Pixmap) macWin);
if (scrollPtr->flags & GOT_FOCUS) {
- fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr,
- Tk_WindowId(tkwin));
- TkpDrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth,
- Tk_WindowId(tkwin));
+ fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr, (Pixmap) macWin);
} else {
- TkpDrawHighlightBorder(tkwin, bgGC, bgGC, scrollPtr->highlightWidth,
- Tk_WindowId(tkwin));
+ fgGC = bgGC;
}
- }
- 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);
-
- if (macScrollPtr->sbHandle == NULL) {
- Rect r = {0, 0, 1, 1};
-
- windowRef = TkMacOSXDrawableWindow(Tk_WindowId(tkwin));
- CreateScrollBarControl(windowRef, &r, 0, 0, 0, 0, true, NULL,
- &(macScrollPtr->sbHandle));
- SetControlReference(macScrollPtr->sbHandle, (SInt32) scrollPtr);
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth,
+ (Pixmap) macWin);
+ }
+ Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder,
+ scrollPtr->highlightWidth, scrollPtr->highlightWidth,
+ Tk_Width(tkwin) - 2*scrollPtr->highlightWidth,
+ Tk_Height(tkwin) - 2*scrollPtr->highlightWidth,
+ scrollPtr->borderWidth, scrollPtr->relief);
+ Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder,
+ scrollPtr->inset, scrollPtr->inset,
+ Tk_Width(tkwin) - 2*scrollPtr->inset,
+ Tk_Height(tkwin) - 2*scrollPtr->inset, 0, TK_RELIEF_FLAT);
+ if ([scroller superview] != view) {
+ [view addSubview:scroller];
+ }
+ frame = NSMakeRect(macWin->xOff, macWin->yOff, Tk_Width(tkwin),
+ Tk_Height(tkwin));
+ frame = NSInsetRect(frame, scrollPtr->inset, scrollPtr->inset);
+ frame.origin.y = viewHeight - (frame.origin.y + frame.size.height);
+
+ NSWindow *w = [view window];
+
+ if ([w showsResizeIndicator]) {
+ NSRect growBox = [view convertRect:[w _growBoxRect] fromView:nil];
+
+ if (NSIntersectsRect(growBox, frame)) {
+ if (scrollPtr->vertical) {
+ CGFloat y = frame.origin.y;
- if (IsWindowActive(windowRef)) {
- macScrollPtr->macFlags |= ACTIVE;
+ frame.origin.y = growBox.origin.y + growBox.size.height;
+ frame.size.height -= frame.origin.y - y;
+ } else {
+ frame.size.width = growBox.origin.x - frame.origin.x;
+ }
+ TkMacOSXSetScrollbarGrow(winPtr, true);
}
}
-
- /*
- * Update the control values before we draw.
- */
-
- UpdateControlValues(macScrollPtr);
-
- /*
- * Set up port for drawing Macintosh control.
- */
- destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
- portChanged = QDSwapPort(destPort, &savePort);
- TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
-
- /*
- * Scrollbars do not erase the complete control bounds if they are wider
- * than the standard width, so manually erase the extra space.
- */
-
- if (!EmptyRect(&macScrollPtr->eraseRect)) {
- EraseRect(&macScrollPtr->eraseRect);
- }
-
- Draw1Control(macScrollPtr->sbHandle);
-
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
-
- 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. */
-{
+ if (!NSEqualRects(frame, [scroller frame])) {
+ [scroller setFrame:frame];
+ }
+ [scroller setEnabled:(knobProportion < 1.0 &&
+ (scrollPtr->vertical ? frame.size.height : frame.size.width) >
+ metrics[macScrollPtr->variant].minHeight)];
+ [scroller setDoubleValue:scrollPtr->firstFraction / (1.0 - knobProportion)];
+ [scroller setKnobProportion:knobProportion];
+ [scroller displayRectIgnoringOpacity:[scroller bounds]];
+ TkMacOSXRestoreDrawingContext(&dc);
+#ifdef TK_MAC_DEBUG_SCROLLBAR
+ TKLog(@"scroller %s frame %@ width %d height %d",
+ ((TkWindow *)scrollPtr->tkwin)->pathName, NSStringFromRect(frame),
+ Tk_Width(tkwin), Tk_Height(tkwin));
+#endif
}
/*
@@ -337,9 +368,9 @@ TkpConfigureScrollbar(scrollPtr)
*
* TkpComputeScrollbarGeometry --
*
- * After changes in a scrollbar's size or configuration, this
- * procedure recomputes various geometry information used in
- * displaying the scrollbar.
+ * After changes in a scrollbar's size or configuration, this procedure
+ * recomputes various geometry information used in displaying the
+ * scrollbar.
*
* Results:
* None.
@@ -352,18 +383,59 @@ TkpConfigureScrollbar(scrollPtr)
void
TkpComputeScrollbarGeometry(
- register TkScrollbar *scrollPtr) /* Scrollbar whose geometry may
- * have changed. */
+ register TkScrollbar *scrollPtr)
+ /* Scrollbar whose geometry may have
+ * changed. */
{
- int variant, fieldLength;
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
+ NSScroller *scroller = macScrollPtr->scroller;
+ int width, height, variant, fieldLength;
if (scrollPtr->highlightWidth < 0) {
scrollPtr->highlightWidth = 0;
}
scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth;
- variant = ((scrollPtr->vertical ? Tk_Width(scrollPtr->tkwin) :
- Tk_Height(scrollPtr->tkwin)) - 2 * scrollPtr->inset
- < metrics[0].width) ? 1 : 0;
+ width = Tk_Width(scrollPtr->tkwin) - 2 * scrollPtr->inset;
+ height = Tk_Height(scrollPtr->tkwin) - 2 * scrollPtr->inset;
+ variant = ((scrollPtr->vertical ? width : height) < metrics[0].width) ?
+ 1 : 0;
+ macScrollPtr->variant = variant;
+ if (scroller) {
+ NSSize size = [scroller frame].size;
+
+ if ((size.width > size.height) ^ !scrollPtr->vertical) {
+ /*
+ * Orientation changed, need new scroller.
+ */
+
+ if ([scroller superview]) {
+ [scroller removeFromSuperviewWithoutNeedingDisplay];
+ }
+ TkMacOSXMakeCollectableAndRelease(scroller);
+ }
+ }
+ if (!scroller) {
+ if ((width > height) ^ !scrollPtr->vertical) {
+ /* -[NSScroller initWithFrame:] determines horizonalness for the
+ * lifetime of the scroller via isHoriz = (width > height) */
+ if (scrollPtr->vertical) {
+ width = height;
+ } else if (width > 1) {
+ height = width - 1;
+ } else {
+ height = 1;
+ width = 2;
+ }
+ }
+ scroller = [[NSScroller alloc] initWithFrame:
+ NSMakeRect(0, 0, width, height)];
+ macScrollPtr->scroller = TkMacOSXMakeUncollectable(scroller);
+ [scroller setAction:@selector(tkScroller:)];
+ [scroller setTarget:NSApp];
+ [scroller setTag:(NSInteger)scrollPtr];
+ }
+ [[scroller cell] setControlSize:metrics[variant].controlSize];
+
scrollPtr->arrowLength = (metrics[variant].topArrowHeight +
metrics[variant].bottomArrowHeight) / 2;
fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin)
@@ -376,9 +448,9 @@ TkpComputeScrollbarGeometry(
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).
+ * 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)) {
@@ -401,10 +473,9 @@ TkpComputeScrollbarGeometry(
metrics[variant].bottomArrowHeight;
/*
- * 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.
+ * 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) {
@@ -419,14 +490,22 @@ TkpComputeScrollbarGeometry(
2 * scrollPtr->inset);
}
Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset);
+#ifdef TK_MAC_DEBUG_SCROLLBAR
+ TKLog(@"scroller %s bounds %@ width %d height %d inset %d borderWidth %d",
+ ((TkWindow *)scrollPtr->tkwin)->pathName,
+ NSStringFromRect([scroller bounds]),
+ width, height, scrollPtr->inset, scrollPtr->borderWidth);
+#endif
}
/*
*----------------------------------------------------------------------
*
- * TkpDestroyScrollbar --
+ * TkpConfigureScrollbar --
*
- * Free data structures associated with the scrollbar control.
+ * This procedure is called after the generic code has finished
+ * processing configuration options, in order to configure platform
+ * specific options.
*
* Results:
* None.
@@ -438,18 +517,11 @@ TkpComputeScrollbarGeometry(
*/
void
-TkpDestroyScrollbar(
- TkScrollbar *scrollPtr) /* Scrollbar to destroy. */
+TkpConfigureScrollbar(
+ register TkScrollbar *scrollPtr)
+ /* Information about widget; may or may not
+ * already have values for some fields. */
{
- MacScrollbar *macScrollPtr = (MacScrollbar *)scrollPtr;
-
- if (macScrollPtr->sbHandle != NULL) {
- if (!(macScrollPtr->macFlags & IN_MODAL_LOOP)) {
- DisposeControl(macScrollPtr->sbHandle);
- macScrollPtr->sbHandle = NULL;
- }
- }
- macScrollPtr->macFlags |= ALREADY_DEAD;
}
/*
@@ -457,14 +529,12 @@ TkpDestroyScrollbar(
*
* TkpScrollbarPosition --
*
- * Determine the scrollbar element corresponding to a
- * given position.
+ * 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.
+ * 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.
@@ -474,402 +544,32 @@ TkpDestroyScrollbar(
int
TkpScrollbarPosition(
- TkScrollbar *scrollPtr, /* Scrollbar widget record. */
- int x, int y) /* Coordinates within scrollPtr's
- * window. */
+ register TkScrollbar *scrollPtr,
+ /* Scrollbar widget record. */
+ int x, int y) /* Coordinates within scrollPtr's window. */
{
- MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- int inactive = 0;
- ControlPartCode part;
- Point where = {y, x};
- Rect bounds;
-
- if ((x < scrollPtr->inset) || (x >= (Tk_Width(scrollPtr->tkwin) -
- scrollPtr->inset)) || (y < scrollPtr->inset) ||
- (y >= (Tk_Height(scrollPtr->tkwin) - scrollPtr->inset))) {
+ NSScroller *scroller = ((MacScrollbar *) scrollPtr)->scroller;
+ MacDrawable *macWin = (MacDrawable *)
+ ((TkWindow *) scrollPtr->tkwin)->window;
+ NSView *view = TkMacOSXDrawableView(macWin);
+
+ switch ([scroller testPart:NSMakePoint(macWin->xOff + x,
+ [view bounds].size.height - (macWin->yOff + y))]) {
+ case NSScrollerDecrementLine:
+ return TOP_ARROW;
+ case NSScrollerDecrementPage:
+ return TOP_GAP;
+ case NSScrollerKnob:
+ return SLIDER;
+ case NSScrollerIncrementPage:
+ return BOTTOM_GAP;
+ case NSScrollerIncrementLine:
+ return BOTTOM_ARROW;
+ case NSScrollerKnobSlot:
+ case NSScrollerNoPart:
+ default:
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));
- portChanged = QDSwapPort(destPort, &savePort);
- UpdateControlValues(macScrollPtr);
- if (!IsControlActive(macScrollPtr->sbHandle)) {
- inactive = true;
- ActivateControl(macScrollPtr->sbHandle);
- }
- TkMacOSXWinBounds((TkWindow *) scrollPtr->tkwin, &bounds);
- where.h += bounds.left;
- where.v += bounds.top;
- part = TestControl(((MacScrollbar *) scrollPtr)->sbHandle, where);
- if (inactive) {
- DeactivateControl(macScrollPtr->sbHandle);
- }
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
- switch (part) {
- case kAppearancePartUpButton:
- return TOP_ARROW;
- case kAppearancePartPageUpArea:
- return TOP_GAP;
- case kAppearancePartIndicator:
- return SLIDER;
- case kAppearancePartPageDownArea:
- return BOTTOM_GAP;
- case kAppearancePartDownButton:
- return BOTTOM_ARROW;
- default:
- return OUTSIDE;
- }
-}
-
-/*
- *--------------------------------------------------------------
- *
- * ThumbActionProc --
- *
- * Callback procedure used by the Macintosh toolbox call
- * HandleControlClick. 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(ControlRef theControl, ControlPartCode partCode)
-{
- TkScrollbar *scrollPtr = (TkScrollbar *)(intptr_t)GetControlReference(
- theControl);
- MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
- Tcl_DString cmdString;
- int origValue, variant;
- short trackBarSize;
- double oldFirstFraction, newFirstFraction;
- char valueString[40];
- Point currentPoint = { 0, 0 };
- Rect trackRect;
- Tcl_Interp *interp;
- MouseTrackingResult trackingResult;
- OSStatus err;
-
- if (scrollPtr == NULL) {
- return;
- }
-
- Tcl_DStringInit(&cmdString);
- origValue = GetControl32BitValue(macScrollPtr->sbHandle);
- GetControlBounds(macScrollPtr->sbHandle, &trackRect);
-
- if (scrollPtr->vertical) {
- variant = (trackRect.right - trackRect.left) < metrics[0].width ? 1 : 0;
- trackBarSize = trackRect.bottom - trackRect.top -
- metrics[variant].topArrowHeight -
- metrics[variant].bottomArrowHeight;
- InsetRect(&trackRect, -25, -113);
- } else {
- variant = (trackRect.bottom - trackRect.top) < metrics[0].width ? 1 : 0;
- trackBarSize = trackRect.right - trackRect.left -
- metrics[variant].topArrowHeight -
- metrics[variant].bottomArrowHeight;
- 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. Since the mouse may move a distance too small to
- * cause a change to the first fraction, each calculation must be done
- * versus what the first fraction was when the mouse button was
- * initially pressed. Otherwise, moving the mouse too slowly will
- * cause the calculated fraction delta to be zero and the scrollbar
- * won't respond.
- */
-
- oldFirstFraction = scrollPtr->firstFraction;
-
- TkMacOSXTrackingLoop(1);
- do {
- err = ChkErr(TrackMouseLocationWithOptions, NULL,
- kTrackMouseLocationOptionDontConsumeMouseUp,
- kEventDurationForever, &currentPoint, NULL, &trackingResult);
- if ((err == noErr) && ((trackingResult == kMouseTrackingMouseDragged)
- || (trackingResult == kMouseTrackingMouseMoved))) {
-
- /*
- * Calculate where the scrollbar should move to, based on
- * where the mouse button was pressed and where the scrollbar
- * initially was at that time. Note that PtInRect() will
- * return false if currentPoint or trackRect are not in
- * is not in current graphics port, which may happen if any
- * of the waiting idle events change the port (e.g. with
- * SetPort()) but fail to restore it before returning and the
- * scrollbar will lock in place.
- */
- newFirstFraction = oldFirstFraction;
- if (PtInRect(currentPoint, &trackRect)) {
- short pixDiff;
-
- if (scrollPtr->vertical) {
- pixDiff = currentPoint.v - mouseDownPoint.v;
- } else {
- pixDiff = currentPoint.h - mouseDownPoint.h;
- }
- newFirstFraction += (double)pixDiff / trackBarSize;
- if (newFirstFraction > 1.0) {
- newFirstFraction = 1.0;
- } else if (newFirstFraction < 0.0) {
- newFirstFraction = 0.0;
- }
- }
-
- /*
- * Move the scrollbar thumb to the new first fraction given
- * its position when initially pressed and how far the mouse
- * has moved. Process waiting idle tasks afterward to allow
- * for the display to update.
- */
-
- Tcl_PrintDouble(NULL, newFirstFraction, valueString);
- 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_EvalEx(interp, Tcl_DStringValue(&cmdString),
- Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
- Tcl_Release((ClientData) interp);
- TkMacOSXRunTclEventLoop();
- }
- } while ((err == noErr) && trackingResult != kMouseTrackingMouseReleased);
- TkMacOSXTrackingLoop(0);
- Tcl_DStringFree(&cmdString);
- return;
-}
-
-/*
- *--------------------------------------------------------------
- *
- * ScrollbarActionProc --
- *
- * Callback procedure used by the Macintosh toolbox call
- * HandleControlClick. 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 *)(intptr_t)
- GetControlReference(theControl);
- MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
- Tcl_DString cmdString;
-
- Tcl_DStringInit(&cmdString);
- Tcl_DStringAppend(&cmdString, scrollPtr->command,
- scrollPtr->commandSize);
-
- if (partCode == kAppearancePartUpButton ||
- partCode == kAppearancePartDownButton ) {
- Tcl_DStringAppendElement(&cmdString, "scroll");
- Tcl_DStringAppendElement(&cmdString,
- (partCode == kAppearancePartUpButton) ? "-1" : "1");
- Tcl_DStringAppendElement(&cmdString, "unit");
- } else if (partCode == kAppearancePartPageUpArea ||
- partCode == kAppearancePartPageDownArea ) {
- Tcl_DStringAppendElement(&cmdString, "scroll");
- Tcl_DStringAppendElement(&cmdString,
- (partCode == kAppearancePartPageUpArea) ? "-1" : "1");
- Tcl_DStringAppendElement(&cmdString, "page");
- } else if (partCode == kAppearancePartIndicator) {
- char valueString[TCL_DOUBLE_SPACE];
-
- Tcl_PrintDouble(NULL,
- (GetControl32BitValue(macScrollPtr->sbHandle) -
- MIN_SCROLLBAR_VALUE) / SCROLLBAR_SCALING_VALUE, valueString);
- Tcl_DStringAppendElement(&cmdString, "moveto");
- Tcl_DStringAppendElement(&cmdString, valueString);
- }
- Tcl_Preserve(scrollPtr->interp);
- Tcl_EvalEx(scrollPtr->interp, Tcl_DStringValue(&cmdString),
- Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
- Tcl_Release(scrollPtr->interp);
- Tcl_DStringFree(&cmdString);
- TkMacOSXRunTclEventLoop();
-}
-
-/*
- *--------------------------------------------------------------
- *
- * 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(scrollPtr);
- macScrollPtr->macFlags |= IN_MODAL_LOOP;
-
- if (eventPtr->type == ButtonPress) {
- Point where;
- Rect bounds;
- ControlPartCode part;
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- 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));
- portChanged = QDSwapPort(destPort, &savePort);
- 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);
- TkMacOSXTrackingLoop(1);
- if (part == kAppearancePartIndicator && 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.
- */
-
- mouseDownPoint.h = where.h;
- mouseDownPoint.v = where.v;
- part = HandleControlClick(macScrollPtr->sbHandle, where,
- TkMacOSXModifierState(), thumbActionProc);
- } else if (part == kAppearancePartIndicator) {
- /*
- * Case 2: in thumb with jump scrolling. Call HandleControlClick
- * with a NULL action proc. Use the new value of the control to
- * set update the control.
- */
-
- part = HandleControlClick(macScrollPtr->sbHandle, where,
- TkMacOSXModifierState(), NULL);
- if (part == kAppearancePartIndicator) {
- Tcl_DString cmdString;
- char valueString[TCL_DOUBLE_SPACE];
-
- Tcl_PrintDouble(NULL,
- (GetControl32BitValue(macScrollPtr->sbHandle) -
- MIN_SCROLLBAR_VALUE) / SCROLLBAR_SCALING_VALUE,
- valueString);
- Tcl_DStringInit(&cmdString);
- Tcl_DStringAppend(&cmdString, scrollPtr->command,
- strlen(scrollPtr->command));
- Tcl_DStringAppendElement(&cmdString, "moveto");
- Tcl_DStringAppendElement(&cmdString, valueString);
-
- interp = scrollPtr->interp;
- Tcl_Preserve(interp);
- Tcl_EvalEx(interp, Tcl_DStringValue(&cmdString),
- Tcl_DStringLength(&cmdString), TCL_EVAL_GLOBAL);
- Tcl_Release(interp);
- Tcl_DStringFree(&cmdString);
- TkMacOSXRunTclEventLoop();
- }
- } else if (part != 0) {
- /*
- * Case 3: in any other part of the scrollbar. We call
- * HandleControlClick with the scrollActionProc which will do
- * most all the work.
- */
-
- HandleControlClick(macScrollPtr->sbHandle, where,
- TkMacOSXModifierState(), scrollActionProc);
-
- /*
- * Workaround for Carbon bug where the scrollbar down arrow
- * sometimes gets "stuck" after the mousebutton has been released.
- */
-
- if (scrollPtr->tkwin) {
- TkMacOSXSetUpClippingRgn(Tk_WindowId(scrollPtr->tkwin));
- }
- Draw1Control(macScrollPtr->sbHandle);
- }
- TkMacOSXTrackingLoop(0);
-
- /*
- * The HandleControlClick call will "eat" the ButtonUp event. We now
- * generate a ButtonUp event so Tk will unset implicit grabs etc.
- */
-
- if (scrollPtr->tkwin) {
- window = Tk_WindowId(scrollPtr->tkwin);
- TkGenerateButtonEventForXPointer(window);
- }
-
- if (portChanged) {
- QDSwapPort(savePort, NULL);
- }
- }
-
- if (macScrollPtr->sbHandle && (macScrollPtr->macFlags & ALREADY_DEAD)) {
- DisposeControl(macScrollPtr->sbHandle);
- macScrollPtr->sbHandle = NULL;
- }
- macScrollPtr->macFlags &= ~IN_MODAL_LOOP;
- Tcl_Release(scrollPtr);
-
- return TCL_OK;
}
/*
@@ -877,15 +577,15 @@ ScrollbarBindProc(
*
* ScrollbarEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on scrollbars.
+ * 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.
+ * When the window gets deleted, internal structures get cleaned up. When
+ * it gets exposed, it is redisplayed.
*
*--------------------------------------------------------------
*/
@@ -895,156 +595,26 @@ ScrollbarEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
- MacScrollbar *macScrollPtr = (MacScrollbar *) clientData;
+ TkScrollbar *scrollPtr = clientData;
- if (eventPtr->type == UnmapNotify) {
+ switch (eventPtr->type) {
+ case 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 {
+ break;
+ case ActivateNotify:
+ case DeactivateNotify:
+ TkScrollbarEventuallyRedraw(scrollPtr);
+ break;
+ default:
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.
- *
- *--------------------------------------------------------------
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
*/
-
-static void
-UpdateControlValues(
- MacScrollbar *macScrollPtr) /* Scrollbar data struct. */
-{
- TkScrollbar *scrollPtr = (TkScrollbar *) macScrollPtr;
- Tk_Window tkwin = scrollPtr->tkwin;
- MacDrawable * macDraw = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin);
- double dViewSize;
- Rect contrlRect, portRect;
- int variant, active;
- short width, height;
-
- 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;
-
- GetPortBounds (GetWindowPort(GetControlOwner(macScrollPtr->sbHandle)),
- &portRect);
-
- /*
- * If the scrollbar is flush against the bottom right hand corner then
- * we leave space to draw the grow region for the window.
- */
- if (portRect.bottom == contrlRect.bottom &&
- portRect.right == contrlRect.right) {
- TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, true);
- if (macDraw->toplevel &&
- TkMacOSXResizable(macDraw->toplevel->winPtr)) {
- int growSize;
-
- switch (TkMacOSXWindowClass(macDraw->toplevel->winPtr)) {
- case kFloatingWindowClass:
- case kUtilityWindowClass:
- growSize = metrics[1].width - 1;
- break;
- case kDocumentWindowClass:
- case kMovableAlertWindowClass:
- case kMovableModalWindowClass:
- default:
- growSize = metrics[0].width - 1;
- break;
- }
- if (scrollPtr->vertical) {
- contrlRect.bottom -= growSize;
- } else {
- contrlRect.right -= growSize;
- }
- }
- } else {
- TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, false);
- }
-
- if (IsControlVisible (macScrollPtr->sbHandle)) {
- SetControlVisibility(macScrollPtr->sbHandle, false, false);
- }
-
- if (scrollPtr->vertical) {
- width = contrlRect.right - contrlRect.left;
- height = contrlRect.bottom - contrlRect.top;
- } else {
- width = contrlRect.bottom - contrlRect.top;
- height = contrlRect.right - contrlRect.left;
- }
- variant = width < metrics[0].width ? 1 : 0;
- SetControlData(macScrollPtr->sbHandle, kControlEntireControl,
- kControlSizeTag, sizeof(ControlSize),
- &(metrics[variant].size));
-
- macScrollPtr->eraseRect = contrlRect;
- if (scrollPtr->vertical) {
- macScrollPtr->eraseRect.left += metrics[variant].width;
- } else {
- macScrollPtr->eraseRect.top += metrics[variant].width;
- }
-
- /*
- * Ensure we set scrollbar control bounds only once all size
- * adjustments have been computed.
- */
-
- SetControlBounds(macScrollPtr->sbHandle, &contrlRect);
-
- /*
- * Given the Tk parameters for the fractions of the start and
- * end of the thumb, the following calculation determines the
- * location for the Macintosh thumb.
- * The Aqua scroll control works as follows.
- * The scrollbar's value is the position of the left (or top) side of
- * the view area in the content area being scrolled.
- * The maximum value of the control is therefore the dimension of
- * the content area less the size of the view area.
- * Since these values are all integers, and Tk gives the thumb position
- * as fractions, we have introduced a scaling factor.
- */
-
- dViewSize = (scrollPtr->lastFraction - scrollPtr->firstFraction)
- * SCROLLBAR_SCALING_VALUE;
- SetControl32BitMinimum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE);
- SetControl32BitMaximum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE +
- SCROLLBAR_SCALING_VALUE - dViewSize);
- SetControlViewSize(macScrollPtr->sbHandle, dViewSize);
- SetControl32BitValue(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE +
- SCROLLBAR_SCALING_VALUE * scrollPtr->firstFraction);
-
- if((scrollPtr->firstFraction <= 0.0 && scrollPtr->lastFraction >= 1.0)
- || height <= metrics[variant].minHeight) {
- /* Disable scrollbar */
- SetControl32BitMaximum(macScrollPtr->sbHandle, MIN_SCROLLBAR_VALUE);
- }
- active = ((macScrollPtr->macFlags & ACTIVE) != 0);
- if (active != IsControlActive(macScrollPtr->sbHandle)) {
- if (active) {
- ActivateControl(macScrollPtr->sbHandle);
- } else {
- DeactivateControl(macScrollPtr->sbHandle);
- }
- }
- SetControlVisibility(macScrollPtr->sbHandle, true, false);
-}
diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c
index a8077cb..b48a8a0 100644
--- a/macosx/tkMacOSXSend.c
+++ b/macosx/tkMacOSXSend.c
@@ -24,11 +24,11 @@
*
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXInt.h"
@@ -78,7 +78,7 @@ typedef struct NameRegistry {
* XFree; zero means use ckfree. */
} NameRegistry;
-static int initialized = false; /* A flag to denote if we have initialized
+static int initialized = 0; /* A flag to denote if we have initialized
* yet. */
static RegisteredInterp *interpListPtr = NULL;
@@ -198,12 +198,12 @@ static int SendInit(Tcl_Interp *interp);
*--------------------------------------------------------------
*/
-CONST 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. */
- CONST char *name) /* The name that will be used to refer to the
+ const char *name) /* The name that will be used to refer to the
* interpreter in later "send" commands. Must
* be globally unique. */
{
@@ -254,7 +254,7 @@ Tk_SetAppName(
Tcl_IncrRefCount(resultObjPtr);
for (i = 0; ; ) {
result = Tcl_ListObjIndex(NULL, resultObjPtr, i, &interpNamePtr);
- if (interpNamePtr == NULL) {
+ if (result != TCL_OK || interpNamePtr == NULL) {
break;
}
interpName = Tcl_GetString(interpNamePtr);
@@ -281,7 +281,7 @@ Tk_SetAppName(
* We have found a unique name. Now add it to the registry.
*/
- riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr = ckalloc(sizeof(RegisteredInterp));
riPtr->interp = interp;
riPtr->name = ckalloc(strlen(actualName) + 1);
riPtr->nextPtr = interpListPtr;
@@ -323,14 +323,14 @@ 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 */
+ Tcl_Obj *const objv[]) /* The arguments */
{
- const char *sendOptions[] = {"-async", "-displayof", "-", NULL};
+ const char *const sendOptions[] = {"-async", "-displayof", "-", NULL};
char *stringRep, *destName;
- int async = 0;
+ /*int async = 0;*/
int i, index, firstArg;
RegisteredInterp *riPtr;
- Tcl_Obj *resultPtr, *listObjPtr;
+ Tcl_Obj *listObjPtr;
int result = TCL_OK;
for (i = 1; i < (objc - 1); ) {
@@ -341,7 +341,7 @@ Tk_SendObjCmd(
return TCL_ERROR;
}
if (index == 0) {
- async = 1;
+ /*async = 1;*/
i++;
} else if (index == 1) {
i += 2;
@@ -355,15 +355,13 @@ Tk_SendObjCmd(
if (objc < (i + 2)) {
Tcl_WrongNumArgs(interp, 1, objv,
- "?options? interpName arg ?arg ...?");
+ "?-option value ...? interpName arg ?arg ...?");
return TCL_ERROR;
}
destName = Tcl_GetString(objv[i]);
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
@@ -506,3 +504,12 @@ SendInit(
{
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 3c93feb..2933876 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -4,8 +4,8 @@
* Implements subwindows for the macintosh version of Tk.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -25,10 +25,12 @@
* Prototypes for functions used only in this file.
*/
-static void MoveResizeWindow(MacDrawable *macWin);
-static void GenerateConfigureNotify(TkWindow *winPtr, int includeWin);
-static void UpdateOffsets(TkWindow *winPtr, int deltaX, int deltaY);
-static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr);
+static void MoveResizeWindow(MacDrawable *macWin);
+static void GenerateConfigureNotify(TkWindow *winPtr,
+ int includeWin);
+static void UpdateOffsets(TkWindow *winPtr, int deltaX,
+ int deltaY);
+static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr);
/*
@@ -49,130 +51,21 @@ static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr);
void
XDestroyWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *) window;
/*
- * Remove any dangling pointers that may exist if
- * the window we are deleting is being tracked by
- * the grab code.
+ * Remove any dangling pointers that may exist if the window we are
+ * deleting is being tracked by the grab code.
*/
TkPointerDeadWindow(macWin->winPtr);
+ TkMacOSXSelDeadWindow(macWin->winPtr);
macWin->toplevel->referenceCount--;
- if (Tk_IsTopLevel(macWin->winPtr)) {
- WindowRef winRef;
- /*
- * We are relying on the Activate Mac OS event to pass the
- * focus away from a window that is getting Destroyed to the
- * Front non-floating window. BUT we don't get activate events
- * when a floating window is destroyed - since the front non-floating
- * window doesn't in fact get activated... So maybe we can check here
- * and if we are destroying a floating window, we can pass the focus
- * back to the front non-floating window...
- */
-
- if (macWin->grafPtr != NULL) {
- TkWindow *focusPtr = TkGetFocusWin(macWin->winPtr);
- if (focusPtr == NULL || (focusPtr->mainPtr->winPtr == macWin->winPtr)) {
- winRef = TkMacOSXDrawableWindow(window);
- if (TkpIsWindowFloating (winRef)) {
- Window window;
-
- window = TkMacOSXGetXWindow(ActiveNonFloatingWindow());
- if (window != None) {
- TkMacOSXGenerateFocusEvent(window, 1);
- }
- }
- }
- }
- if (macWin->visRgn) {
- CFRelease(macWin->visRgn);
- }
- if (macWin->aboveVisRgn) {
- CFRelease(macWin->aboveVisRgn);
- }
-
- /*
- * 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))) {
- WindowRef winRef = TkMacOSXDrawableWindow(window);
-
- if (winRef) {
- TkMacOSXWindowList *listPtr, *prevPtr;
- WindowGroupRef group;
-
- if (GetWindowProperty(winRef, 'Tk ', 'TsGp', sizeof(group),
- NULL, &group) == noErr) {
- TkDisplay *dispPtr = TkGetDisplayList();
- ItemCount i = CountWindowGroupContents(group,
- kWindowGroupContentsReturnWindows);
-
- while (i > 0) {
- WindowRef macWin;
-
- ChkErr(GetIndexedWindow, group, i--, 0, &macWin);
- if (macWin) {
- WindowGroupRef newGroup = NULL;
- Window window = TkMacOSXGetXWindow(macWin);
-
- if (window != None) {
- TkWindow * winPtr = (TkWindow *)Tk_IdToWindow(
- dispPtr->display, window);
-
- if (winPtr && winPtr->wmInfoPtr) {
- newGroup = GetWindowGroupOfClass(
- winPtr->wmInfoPtr->macClass);
- }
- }
- if (!newGroup) {
- newGroup = GetWindowGroupOfClass(
- kDocumentWindowClass);
- }
- ChkErr(SetWindowGroup, macWin, newGroup);
- }
-
- }
- ChkErr(SetWindowGroupOwner, group, NULL);
- ChkErr(ReleaseWindowGroup, group);
- }
- 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 {
+ if (!Tk_IsTopLevel(macWin->winPtr)) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macWin->winPtr->parentPtr != NULL) {
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
@@ -183,11 +76,34 @@ XDestroyWindow(
if (macWin->aboveVisRgn) {
CFRelease(macWin->aboveVisRgn);
}
+ if (macWin->drawRgn) {
+ CFRelease(macWin->drawRgn);
+ }
if (macWin->toplevel->referenceCount == 0) {
- ckfree((char *) macWin->toplevel);
+ ckfree(macWin->toplevel);
}
- ckfree((char *) macWin);
+ ckfree(macWin);
+ return;
+ }
+ if (macWin->visRgn) {
+ CFRelease(macWin->visRgn);
+ }
+ if (macWin->aboveVisRgn) {
+ CFRelease(macWin->aboveVisRgn);
+ }
+ if (macWin->drawRgn) {
+ CFRelease(macWin->drawRgn);
+ }
+ macWin->view = nil;
+
+ /*
+ * Delay deletion of a toplevel data structure untill all children have
+ * been deleted.
+ */
+
+ if (macWin->toplevel->referenceCount == 0) {
+ ckfree(macWin->toplevel);
}
}
@@ -196,8 +112,8 @@ XDestroyWindow(
*
* XMapWindow --
*
- * Map the given X Window to the screen. See X window documentation
- * for more details.
+ * Map the given X Window to the screen. See X window documentation for
+ * more details.
*
* Results:
* None.
@@ -210,19 +126,20 @@ XDestroyWindow(
void
XMapWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *) window;
XEvent event;
/*
- * 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.
+ * 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);
}
@@ -231,28 +148,19 @@ XMapWindow(
macWin->winPtr->flags |= TK_MAPPED;
if (Tk_IsTopLevel(macWin->winPtr)) {
if (!Tk_IsEmbedded(macWin->winPtr)) {
- /*
- * XXX This should be ShowSheetWindow for kSheetWindowClass
- * XXX windows that have a wmPtr->master parent set.
- */
- WindowRef wRef = TkMacOSXDrawableWindow(window);
-
- if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
- && (macWin->winPtr->wmInfoPtr->master != None)) {
- ShowSheetWindow(wRef, TkMacOSXDrawableWindow(
- macWin->winPtr->wmInfoPtr->master));
- } else {
- ShowWindow(wRef);
- }
+ NSWindow *win = TkMacOSXDrawableWindow(window);
+
+ [win makeKeyAndOrderFront:NSApp];
+ [win windowRef];
+ TkMacOSXApplyWindowAttributes(macWin->winPtr, win);
}
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr);
/*
- * We only need to send the MapNotify event
- * for toplevel windows.
+ * We only need to send the MapNotify event for toplevel windows.
*/
- event.xany.serial = display->request;
+ event.xany.serial = LastKnownRequestProcessed(display);
event.xany.send_event = False;
event.xany.display = display;
@@ -263,7 +171,7 @@ XMapWindow(
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
} else {
/*
- * Generate damage for that area of the window
+ * Generate damage for that area of the window.
*/
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
@@ -287,7 +195,7 @@ XMapWindow(
* NotifyVisibility --
*
* Recursively called helper proc for XMapWindow().
-
+ *
* Results:
* None.
*
@@ -320,8 +228,8 @@ NotifyVisibility(
*
* XUnmapWindow --
*
- * Unmap the given X Window to the screen. See X window
- * documentation for more details.
+ * Unmap the given X Window to the screen. See X window documentation for
+ * more details.
*
* Results:
* None.
@@ -334,7 +242,7 @@ NotifyVisibility(
void
XUnmapWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *) window;
@@ -343,28 +251,22 @@ XUnmapWindow(
display->request++;
macWin->winPtr->flags &= ~TK_MAPPED;
if (Tk_IsTopLevel(macWin->winPtr)) {
- if (!Tk_IsEmbedded(macWin->winPtr)
- && macWin->winPtr->wmInfoPtr->hints.initial_state != IconicState) {
- /*
- * XXX This should be HideSheetWindow for kSheetWindowClass
- * XXX windows that have a wmPtr->master parent set.
- */
- WindowRef wref = TkMacOSXDrawableWindow(window);
+ if (!Tk_IsEmbedded(macWin->winPtr) &&
+ macWin->winPtr->wmInfoPtr->hints.initial_state!=IconicState) {
+ NSWindow *win = TkMacOSXDrawableWindow(window);
- if ((macWin->winPtr->wmInfoPtr->macClass == kSheetWindowClass)
- && (macWin->winPtr->wmInfoPtr->master != None)) {
- HideSheetWindow(wref);
- } else {
- HideWindow(wref);
+ if ([win isVisible]) {
+ [[win parentWindow] removeChildWindow:win];
+ [win orderOut:NSApp];
}
}
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr);
/*
- * We only need to send the UnmapNotify event
- * for toplevel windows.
+ * We only need to send the UnmapNotify event for toplevel windows.
*/
- event.xany.serial = display->request;
+
+ event.xany.serial = LastKnownRequestProcessed(display);
event.xany.send_event = False;
event.xany.display = display;
@@ -388,8 +290,8 @@ XUnmapWindow(
*
* XResizeWindow --
*
- * Resize a given X window. See X windows documentation for
- * further details.
+ * Resize a given X window. See X windows documentation for further
+ * details.
*
* Results:
* None.
@@ -402,7 +304,7 @@ XUnmapWindow(
void
XResizeWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window, /* Window. */
unsigned int width,
unsigned int height)
@@ -411,15 +313,14 @@ XResizeWindow(
display->request++;
if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
- WindowRef w = TkMacOSXDrawableWindow(window);
+ NSWindow *w = macWin->winPtr->wmInfoPtr->window;
if (w) {
- Rect bounds;
-
- ChkErr(GetWindowBounds, w, kWindowContentRgn, &bounds);
- bounds.right = bounds.left + width;
- bounds.bottom = bounds.top + height;
- ChkErr(SetWindowBounds, w, kWindowContentRgn, &bounds);
+ NSRect r = [w contentRectForFrameRect:[w frame]];
+ r.origin.y += r.size.height - height;
+ r.size.width = width;
+ r.size.height = height;
+ [w setFrame:[w frameRectForContentRect:r] display:YES];
}
} else {
MoveResizeWindow(macWin);
@@ -445,26 +346,24 @@ XResizeWindow(
void
XMoveResizeWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window, /* Window. */
int x, int y,
unsigned int width,
unsigned int height)
{
- MacDrawable * macWin = (MacDrawable *) window;
+ MacDrawable *macWin = (MacDrawable *) window;
display->request++;
if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
- WindowRef w = TkMacOSXDrawableWindow(window);
+ NSWindow *w = macWin->winPtr->wmInfoPtr->window;
if (w) {
- Rect bounds;
-
- bounds.left = x + macWin->winPtr->wmInfoPtr->xInParent;
- bounds.right = bounds.left + width;
- bounds.top = y + macWin->winPtr->wmInfoPtr->yInParent;
- bounds.bottom = bounds.top + height;
- ChkErr(SetWindowBounds, w, kWindowContentRgn, &bounds);
+ NSRect r = NSMakeRect(x + macWin->winPtr->wmInfoPtr->xInParent,
+ tkMacOSXZeroScreenHeight - (y +
+ macWin->winPtr->wmInfoPtr->yInParent + height),
+ width, height);
+ [w setFrame:[w frameRectForContentRect:r] display:YES];
}
} else {
MoveResizeWindow(macWin);
@@ -490,19 +389,18 @@ XMoveResizeWindow(
void
XMoveWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window, /* Window. */
- int x,
- int y)
+ int x, int y)
{
MacDrawable *macWin = (MacDrawable *) window;
display->request++;
if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
- WindowRef w = TkMacOSXDrawableWindow(window);
+ NSWindow *w = macWin->winPtr->wmInfoPtr->window;
if (w) {
- ChkErr(MoveWindowStructure, w, x, y);
+ [w setFrameTopLeftPoint:NSMakePoint(x, tkMacOSXZeroScreenHeight - y)];
}
} else {
MoveResizeWindow(macWin);
@@ -531,11 +429,12 @@ MoveResizeWindow(
{
int deltaX = 0, deltaY = 0, parentBorderwidth = 0;
MacDrawable *macParent = NULL;
- CGrafPtr destPort = TkMacOSXGetDrawablePort((Drawable) macWin);
+ NSWindow *macWindow = TkMacOSXDrawableWindow((Drawable) macWin);
/*
* Find the Parent window, for an embedded window it will be its container.
*/
+
if (Tk_IsEmbedded(macWin->winPtr)) {
TkWindow *contWinPtr = TkpGetOtherWindow(macWin->winPtr);
@@ -543,10 +442,10 @@ MoveResizeWindow(
macParent = contWinPtr->privatePtr;
} else {
/*
- * Here we should handle out of process embedding.
- * 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.
+ * Here we should handle out of process embedding. 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.
*/
}
} else {
@@ -557,20 +456,21 @@ MoveResizeWindow(
macParent = macWin->winPtr->parentPtr->privatePtr;
parentBorderwidth = macWin->winPtr->parentPtr->changes.border_width;
}
+
if (macParent) {
deltaX = macParent->xOff + parentBorderwidth +
macWin->winPtr->changes.x - macWin->xOff;
deltaY = macParent->yOff + parentBorderwidth +
macWin->winPtr->changes.y - macWin->yOff;
}
- if (destPort) {
+ if (macWindow) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
if (macParent) {
TkMacOSXInvalClipRgns((Tk_Window) macParent->winPtr);
}
}
UpdateOffsets(macWin->winPtr, deltaX, deltaY);
- if (destPort) {
+ if (macWindow) {
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
}
GenerateConfigureNotify(macWin->winPtr, 0);
@@ -581,10 +481,9 @@ MoveResizeWindow(
*
* GenerateConfigureNotify --
*
- * Generates ConfigureNotify events for all the child widgets
- * of the widget passed in the winPtr parameter. If includeWin
- * is true, also generates ConfigureNotify event for the
- * widget itself.
+ * Generates ConfigureNotify events for all the child widgets of the
+ * widget passed in the winPtr parameter. If includeWin is true, also
+ * generates ConfigureNotify event for the widget itself.
*
* Results:
* None.
@@ -596,12 +495,14 @@ MoveResizeWindow(
*/
static void
-GenerateConfigureNotify (TkWindow *winPtr, int includeWin)
+GenerateConfigureNotify(
+ TkWindow *winPtr,
+ int includeWin)
{
TkWindow *childPtr;
for (childPtr = winPtr->childList; childPtr != NULL;
- childPtr = childPtr->nextPtr) {
+ childPtr = childPtr->nextPtr) {
if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) {
continue;
}
@@ -630,7 +531,7 @@ GenerateConfigureNotify (TkWindow *winPtr, int includeWin)
void
XRaiseWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *) window;
@@ -664,7 +565,7 @@ XRaiseWindow(
void
XLowerWindow(
- Display* display, /* Display. */
+ Display *display, /* Display. */
Window window) /* Window. */
{
MacDrawable *macWin = (MacDrawable *) window;
@@ -685,26 +586,25 @@ XLowerWindow(
*
* XConfigureWindow --
*
- * Change the size, position, stacking, or border of the specified
- * window.
+ * 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.
+ * 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. */
+ Display *display, /* Display. */
Window w, /* Window. */
unsigned int value_mask,
- XWindowChanges* values)
+ XWindowChanges *values)
{
MacDrawable *macWin = (MacDrawable *) w;
TkWindow *winPtr = macWin->winPtr;
@@ -721,20 +621,24 @@ XConfigureWindow(
}
/*
- * 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.
+ * Change the stacking order of the window. Tk actually 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) {
+ NSView *view = TkMacOSXDrawableView(macWin);
Rect bounds;
- WindowRef wRef = TkMacOSXDrawableWindow(w);
+ NSRect r;
- if (wRef) {
+ if (view) {
TkMacOSXInvalClipRgns((Tk_Window) winPtr->parentPtr);
TkMacOSXWinBounds(winPtr, &bounds);
- InvalWindowRect(wRef, &bounds);
+ r = NSMakeRect(bounds.left,
+ [view bounds].size.height - bounds.bottom,
+ bounds.right - bounds.left, bounds.bottom - bounds.top);
+ [view setNeedsDisplayInRect:r];
}
}
@@ -747,10 +651,10 @@ XConfigureWindow(
*
* 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.
+ * 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.
@@ -774,6 +678,9 @@ TkMacOSXUpdateClipRgn(
if (macWin && macWin->flags & TK_CLIP_INVALID) {
TkWindow *win2Ptr;
+#ifdef TK_MAC_DEBUG_CLIP_REGIONS
+ TkMacOSXDbgMsg("%s", winPtr->pathName);
+#endif
if (Tk_IsMapped(winPtr)) {
int rgnChanged = 0;
CGRect bounds;
@@ -787,24 +694,21 @@ TkMacOSXUpdateClipRgn(
rgn = TkMacOSXHIShapeCreateMutableWithRect(&bounds);
/*
- * Clip away the area of any windows that may obscure this
- * window.
+ * Clip away the area of any windows that may obscure this window.
* For a non-toplevel window, first, clip to the parents visible
- * 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.
+ * 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);
if (winPtr->parentPtr) {
ChkErr(HIShapeIntersect,
- winPtr->parentPtr->privatePtr->aboveVisRgn, rgn,
- rgn);
+ winPtr->parentPtr->privatePtr->aboveVisRgn,
+ rgn, rgn);
}
win2Ptr = winPtr;
while ((win2Ptr = win2Ptr->nextPtr)) {
@@ -821,14 +725,14 @@ TkMacOSXUpdateClipRgn(
ChkErr(HIShapeIntersect,
win2Ptr->privatePtr->aboveVisRgn, rgn, rgn);
} else if (tkMacOSXEmbedHandler != NULL) {
+ TkRegion r = TkCreateRegion();
HIShapeRef visRgn;
- TkMacOSXCheckTmpQdRgnEmpty();
- tkMacOSXEmbedHandler->getClipProc((Tk_Window) winPtr,
- tkMacOSXtmpQdRgn);
- visRgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
- SetEmptyRgn(tkMacOSXtmpQdRgn);
+ tkMacOSXEmbedHandler->getClipProc((Tk_Window) winPtr, r);
+ visRgn = TkMacOSXGetNativeRegion(r);
ChkErr(HIShapeIntersect, visRgn, rgn, rgn);
+ CFRelease(visRgn);
+ TkpReleaseRegion(r);
}
/*
@@ -836,26 +740,23 @@ TkMacOSXUpdateClipRgn(
*/
} else if (winPtr->wmInfoPtr->attributes &
kWindowResizableAttribute) {
- HIViewRef growBoxView;
- OSErr err = HIViewFindByID(HIViewGetRoot(
- TkMacOSXDrawableWindow(winPtr->window)),
- kHIViewWindowGrowBoxID, &growBoxView);
-
- if (err == noErr) {
- ChkErr(HIViewGetFrame, growBoxView, &bounds);
- bounds = CGRectOffset(bounds,
- -winPtr->wmInfoPtr->xInParent,
- -winPtr->wmInfoPtr->yInParent);
+ NSWindow *w = TkMacOSXDrawableWindow(winPtr->window);
+
+ if (w) {
+ bounds = NSRectToCGRect([w _growBoxRect]);
+ bounds.origin.y = [w contentRectForFrameRect:
+ [w frame]].size.height - bounds.size.height -
+ bounds.origin.y;
ChkErr(TkMacOSHIShapeDifferenceWithRect, rgn, &bounds);
}
}
macWin->aboveVisRgn = HIShapeCreateCopy(rgn);
/*
- * The final clip region is the aboveVis region (or visible
- * region) minus all the children of this window.
- * If the window is a container, we must also subtract the region
- * of the embedded window.
+ * The final clip region is the aboveVis region (or visible region)
+ * minus all the children of this window. If the window is a
+ * container, we must also subtract the region of the embedded
+ * window.
*/
win2Ptr = winPtr->childList;
@@ -884,6 +785,7 @@ TkMacOSXUpdateClipRgn(
* TODO: Here we should handle out of process embedding.
*/
}
+
if (rgnChanged) {
HIShapeRef diffRgn = HIShapeCreateDifference(
macWin->aboveVisRgn, rgn);
@@ -915,10 +817,6 @@ TkMacOSXUpdateClipRgn(
macWin->visRgn = HIShapeCreateCopy(macWin->aboveVisRgn);
}
macWin->flags &= ~TK_CLIP_INVALID;
-
-#ifdef TK_MAC_DEBUG_CLIP_REGIONS
- TkMacOSXDebugFlashRegion((Drawable) macWin, macWin->visRgn);
-#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
}
}
@@ -927,8 +825,9 @@ TkMacOSXUpdateClipRgn(
*
* TkMacOSXVisableClipRgn --
*
- * This function returnd the Macintosh cliping region for the
- * given window. A NULL Rgn means the window is not visible.
+ * This function returns the Macintosh cliping region for the given
+ * window. The caller is responsible for disposing of the returned
+ * region via TkDestroyRegion().
*
* Results:
* The region.
@@ -939,20 +838,63 @@ TkMacOSXUpdateClipRgn(
*----------------------------------------------------------------------
*/
-RgnHandle
+TkRegion
TkMacOSXVisableClipRgn(
TkWindow *winPtr)
{
- static RgnHandle visQdRgn = NULL;
-
- if (visQdRgn == NULL) {
- visQdRgn = NewRgn();
- }
if (winPtr->privatePtr->flags & TK_CLIP_INVALID) {
TkMacOSXUpdateClipRgn(winPtr);
}
- ChkErr(HIShapeGetAsQDRgn, winPtr->privatePtr->visRgn, visQdRgn);
- return visQdRgn;
+ return (TkRegion)HIShapeCreateMutableCopy(winPtr->privatePtr->visRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInvalidateViewRegion --
+ *
+ * This function invalidates the given region of a view.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Damage is created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSStatus
+InvalViewRect(int msg, HIShapeRef rgn, const CGRect *rect, void *ref) {
+ static CGAffineTransform t;
+ NSView *view = ref;
+
+ if (!view) {
+ return paramErr;
+ }
+ switch (msg) {
+ case kHIShapeEnumerateInit:
+ t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0,
+ NSHeight([view bounds]));
+ break;
+ case kHIShapeEnumerateRect:
+ [view setNeedsDisplayInRect:NSRectFromCGRect(
+ CGRectApplyAffineTransform(*rect, t))];
+ break;
+ }
+ return noErr;
+}
+
+void
+TkMacOSXInvalidateViewRegion(
+ NSView *view,
+ HIShapeRef rgn)
+{
+ if (view && !HIShapeIsEmpty(rgn)) {
+ ChkErr(HIShapeEnumerate, rgn,
+ kHIShapeParseFromBottom|kHIShapeParseFromLeft,
+ InvalViewRect, view);
+ }
}
/*
@@ -960,8 +902,7 @@ TkMacOSXVisableClipRgn(
*
* TkMacOSXInvalidateWindow --
*
- * This function makes the window as invalid will generate damage
- * for the window.
+ * This function invalidates a window and (optionally) its children.
*
* Results:
* None.
@@ -974,38 +915,29 @@ TkMacOSXVisableClipRgn(
void
TkMacOSXInvalidateWindow(
- MacDrawable *macWin, /* Make window that's causing damage. */
+ MacDrawable *macWin, /* Window to be invalidated. */
int flag) /* Should be TK_WINDOW_ONLY or
* TK_PARENT_WINDOW */
{
- WindowRef windowRef;
- HIShapeRef rgn;
-
- windowRef = TkMacOSXDrawableWindow((Drawable)macWin);
+#ifdef TK_MAC_DEBUG_CLIP_REGIONS
+ TkMacOSXDbgMsg("%s", winPtr->pathName);
+#endif
if (macWin->flags & TK_CLIP_INVALID) {
TkMacOSXUpdateClipRgn(macWin->winPtr);
}
- rgn = (flag == TK_WINDOW_ONLY) ? macWin->visRgn : macWin->aboveVisRgn;
- if (!HIShapeIsEmpty(rgn)) {
- TkMacOSXCheckTmpQdRgnEmpty();
- ChkErr(HIShapeGetAsQDRgn, rgn, tkMacOSXtmpQdRgn);
- InvalWindowRgn(windowRef, tkMacOSXtmpQdRgn);
- SetEmptyRgn(tkMacOSXtmpQdRgn);
- }
-#ifdef TK_MAC_DEBUG_CLIP_REGIONS
- TkMacOSXDebugFlashRegion((Drawable) macWin, rgn);
-#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
+ TkMacOSXInvalidateViewRegion(TkMacOSXDrawableView(macWin),
+ (flag == TK_WINDOW_ONLY) ? macWin->visRgn : macWin->aboveVisRgn);
}
/*
*----------------------------------------------------------------------
*
- * TkMacOSXGetDrawableWindow --
+ * TkMacOSXDrawableWindow --
*
- * This function returns the WindowRef for a given X drawable.
+ * This function returns the NSWindow for a given X drawable.
*
* Results:
- * A WindowRef, or NULL for off screen pixmaps.
+ * A NSWindow, or nil for off screen pixmaps.
*
* Side effects:
* None.
@@ -1013,17 +945,27 @@ TkMacOSXInvalidateWindow(
*----------------------------------------------------------------------
*/
-WindowRef
+NSWindow*
TkMacOSXDrawableWindow(
Drawable drawable)
{
MacDrawable *macWin = (MacDrawable *) drawable;
- WindowRef result = NULL;
+ NSWindow *result = nil;
if (!macWin || macWin->flags & TK_IS_PIXMAP) {
- result = NULL;
- } else {
- result = GetWindowFromPort(TkMacOSXGetDrawablePort(drawable));
+ result = nil;
+ } else if (macWin->toplevel && macWin->toplevel->winPtr &&
+ macWin->toplevel->winPtr->wmInfoPtr &&
+ macWin->toplevel->winPtr->wmInfoPtr->window) {
+ result = macWin->toplevel->winPtr->wmInfoPtr->window;
+ } else if (macWin->winPtr && macWin->winPtr->wmInfoPtr &&
+ macWin->winPtr->wmInfoPtr->window) {
+ result = macWin->winPtr->wmInfoPtr->window;
+ } else if (macWin->toplevel && (macWin->toplevel->flags & TK_EMBEDDED)) {
+ TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+ if (contWinPtr) {
+ result = TkMacOSXDrawableWindow((Drawable) contWinPtr->privatePtr);
+ }
}
return result;
}
@@ -1036,7 +978,7 @@ TkMacOSXDrawableWindow(
* This function returns the Graphics Port for a given X drawable.
*
* Results:
- * A CGrafPort . Either an off screen pixmap or a Window.
+ * NULL.
*
* Side effects:
* None.
@@ -1044,73 +986,48 @@ TkMacOSXDrawableWindow(
*----------------------------------------------------------------------
*/
-CGrafPtr
+void *
TkMacOSXGetDrawablePort(
Drawable drawable)
{
- MacDrawable *macWin = (MacDrawable *) drawable;
- CGrafPtr resultPort = NULL;
-
- if (macWin) {
- if (macWin->toplevel) {
- /*
- * 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) {
- TkWindow *contWinPtr;
-
- contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
-
- if (contWinPtr != NULL) {
- resultPort = TkMacOSXGetDrawablePort(
- (Drawable) contWinPtr->privatePtr);
- } else if (tkMacOSXEmbedHandler != NULL) {
- resultPort = tkMacOSXEmbedHandler->getPortProc(
- (Tk_Window) macWin->winPtr);
- }
-
- if (!resultPort) {
- /*
- * 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.
- */
- TkMacOSXDbgMsg("Couldn't find container");
- }
+ return NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDrawableView --
+ *
+ * This function returns the NSView for a given X drawable.
+ *
+ * Results:
+ * A NSView* or nil.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * TODO: Here we should handle out of process embedding.
- */
- } else {
- resultPort = macWin->toplevel->grafPtr;
- }
- } else {
- if ((macWin->flags & TK_IS_PIXMAP) && !macWin->grafPtr) {
- Rect bounds = {0, 0, macWin->size.height, macWin->size.width};
-
- ChkErr(NewGWorld, &macWin->grafPtr,
- (macWin->flags & TK_IS_BW_PIXMAP) ? 1 : 0,
- &bounds, NULL, NULL, 0
-#ifdef __LITTLE_ENDIAN__
- | kNativeEndianPixMap
-#endif
- );
- }
- resultPort = macWin->grafPtr;
+NSView*
+TkMacOSXDrawableView(
+ MacDrawable *macWin)
+{
+ NSView *result = nil;
+
+ if (!macWin) {
+ result = nil;
+ } else if (!macWin->toplevel) {
+ result = macWin->view;
+ } else if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
+ result = macWin->toplevel->view;
+ } else {
+ TkWindow *contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+ if (contWinPtr) {
+ result = TkMacOSXDrawableView(contWinPtr->privatePtr);
}
}
-
- return resultPort;
+ return result;
}
/*
@@ -1118,10 +1035,10 @@ TkMacOSXGetDrawablePort(
*
* TkMacOSXGetRootControl --
*
- * This function returns the Root Control for a given X drawable.
+ * This function returns the NSView for a given X drawable.
*
* Results:
- * A ControlRef .
+ * A NSView* .
*
* Side effects:
* None.
@@ -1129,34 +1046,15 @@ TkMacOSXGetDrawablePort(
*----------------------------------------------------------------------
*/
-ControlRef
+void *
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 (tkMacOSXEmbedHandler != NULL) {
- result = NULL;
- }
- }
- return result;
+ return TkMacOSXDrawableView((MacDrawable *) drawable);
}
/*
@@ -1164,17 +1062,17 @@ TkMacOSXGetRootControl(
*
* 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
- * affect the size or position of windows.
+ * 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 affect 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.)
+ * The cliping regions for the window and its children are mark invalid.
+ * (Make sure they are valid before drawing.)
*
*----------------------------------------------------------------------
*/
@@ -1188,9 +1086,10 @@ TkMacOSXInvalClipRgns(
MacDrawable *macWin = winPtr->privatePtr;
/*
- * If already marked we can stop because all
- * decendants will also already be marked.
+ * If already marked we can stop because all descendants will also already
+ * be marked.
*/
+
if (!macWin || macWin->flags & TK_CLIP_INVALID) {
return;
}
@@ -1204,11 +1103,16 @@ TkMacOSXInvalClipRgns(
CFRelease(macWin->aboveVisRgn);
macWin->aboveVisRgn = NULL;
}
+ if (macWin->drawRgn) {
+ CFRelease(macWin->drawRgn);
+ macWin->drawRgn = NULL;
+ }
/*
- * Invalidate clip regions for all children &
- * their decendants - unless the child is a toplevel.
+ * Invalidate clip regions for all children & their descendants, unless the
+ * child is a toplevel.
*/
+
childPtr = winPtr->childList;
while (childPtr) {
if (!Tk_IsTopLevel(childPtr)) {
@@ -1218,7 +1122,7 @@ TkMacOSXInvalClipRgns(
}
/*
- * Also, if the window is a container, mark its embedded window
+ * Also, if the window is a container, mark its embedded window.
*/
if (Tk_IsContainer(winPtr)) {
@@ -1239,10 +1143,10 @@ TkMacOSXInvalClipRgns(
*
* 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.
+ * 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.
@@ -1256,12 +1160,13 @@ TkMacOSXInvalClipRgns(
void
TkMacOSXWinBounds(
TkWindow *winPtr,
- Rect *bounds)
+ void *bounds)
{
- bounds->left = winPtr->privatePtr->xOff;
- bounds->top = winPtr->privatePtr->yOff;
- bounds->right = bounds->left + winPtr->changes.width;
- bounds->bottom = bounds->top + winPtr->changes.height;
+ Rect *b = (Rect *)bounds;
+ b->left = winPtr->privatePtr->xOff;
+ b->top = winPtr->privatePtr->yOff;
+ b->right = b->left + winPtr->changes.width;
+ b->bottom = b->top + winPtr->changes.height;
}
/*
@@ -1269,10 +1174,10 @@ TkMacOSXWinBounds(
*
* TkMacOSXWinCGBounds --
*
- * 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.
+ * 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.
@@ -1299,15 +1204,15 @@ TkMacOSXWinCGBounds(
*
* UpdateOffsets --
*
- * Updates the X & Y offsets of the given TkWindow from the
- * TopLevel it is a decendant of.
+ * 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.
+ * The xOff & yOff fields for the Mac window datastructure is updated to
+ * the proper offset.
*
*----------------------------------------------------------------------
*/
@@ -1322,11 +1227,12 @@ UpdateOffsets(
if (winPtr->privatePtr == NULL) {
/*
- * We haven'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.)
+ * We haven'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;
}
@@ -1382,29 +1288,19 @@ Tk_GetPixmap(
if (display != NULL) {
display->request++;
}
- macPix = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ macPix = ckalloc(sizeof(MacDrawable));
macPix->winPtr = NULL;
macPix->xOff = 0;
macPix->yOff = 0;
macPix->visRgn = NULL;
macPix->aboveVisRgn = NULL;
- macPix->drawRect = CGRectNull;
+ macPix->drawRgn = NULL;
macPix->referenceCount = 0;
macPix->toplevel = NULL;
macPix->flags = TK_IS_PIXMAP | (depth == 1 ? TK_IS_BW_PIXMAP : 0);
- macPix->grafPtr = NULL;
+ macPix->view = nil;
macPix->context = NULL;
macPix->size = CGSizeMake(width, height);
- {
- Rect bounds = {0, 0, height, width};
-
- ChkErr(NewGWorld, &macPix->grafPtr, depth == 1 ? 1 : 0, &bounds, NULL,
- NULL, 0
-#ifdef __LITTLE_ENDIAN__
- | kNativeEndianPixMap
-#endif
- );
- }
return (Pixmap) macPix;
}
@@ -1433,18 +1329,20 @@ Tk_FreePixmap(
MacDrawable *macPix = (MacDrawable *) pixmap;
display->request++;
- if (macPix->grafPtr) {
- DisposeGWorld(macPix->grafPtr);
- }
if (macPix->context) {
- TkMacOSXDbgMsg("Cannot free CG backed Pixmap");
+ char *data = CGBitmapContextGetData(macPix->context);
+
+ if (data) {
+ ckfree(data);
+ }
+ CFRelease(macPix->context);
}
- ckfree((char *) macPix);
+ ckfree(macPix);
}
/*
* Local Variables:
- * mode: c
+ * mode: objc
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index 76fc150..26885a9 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -5,14 +5,14 @@
* the Macintosh platform.
*
* Copyright (c) 1996 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkMacOSXInt.h"
+#include "tkMacOSXPrivate.h"
/*
* Forward declarations of procedures defined later in this file:
@@ -20,7 +20,6 @@
static int DebuggerCmd (ClientData dummy, Tcl_Interp *interp,
int argc, const char **argv);
-MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
/*
*----------------------------------------------------------------------
@@ -79,3 +78,12 @@ DebuggerCmd(
Debugger();
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 369932c..722ac9d 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -1,58 +1,14 @@
/*
* tkMacOSXWindowEvent.c --
*
- * This file defines the routines for both creating and handling
- * Window Manager class events for Tk.
+ * This file defines the routines for both creating and handling Window
+ * Manager class events for Tk.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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 "tkMacOSXPrivate.h"
@@ -62,7 +18,8 @@
/*
#ifdef TK_MAC_DEBUG
-#define TK_MAC_DEBUG_CLIP_REGIONS
+#define TK_MAC_DEBUG_EVENTS
+#define TK_MAC_DEBUG_DRAWING
#endif
*/
@@ -70,440 +27,281 @@
* Declaration of functions used only in this file
*/
-static int GenerateUpdateEvent(Window window);
-static int GenerateUpdates(HIMutableShapeRef updateRgn, CGRect *updateBounds,
- TkWindow *winPtr);
-static int GenerateActivateEvents(Window window, int activeFlag);
-static void ClearPort(CGrafPtr port, HIShapeRef updateRgn);
+static int GenerateUpdates(HIMutableShapeRef updateRgn,
+ CGRect *updateBounds, TkWindow *winPtr);
+static int GenerateActivateEvents(TkWindow *winPtr,
+ int activeFlag);
+static void DoWindowActivate(ClientData clientData);
+
+#pragma mark TKApplication(TKWindowEvent)
+
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+extern NSString *NSWindowWillOrderOnScreenNotification;
+extern NSString *NSWindowDidOrderOnScreenNotification;
+extern NSString *NSWindowDidOrderOffScreenNotification;
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+#define NSWindowWillStartLiveResizeNotification @"NSWindowWillStartLiveResizeNotification"
+#define NSWindowDidEndLiveResizeNotification @"NSWindowDidEndLiveResizeNotification"
+#endif
+#endif
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXProcessApplicationEvent --
- *
- * This processes Application level events, mainly activate
- * and deactivate.
- *
- * Results:
- * 0.
- *
- * Side effects:
- * Hide or reveal floating windows.
- *
- *----------------------------------------------------------------------
- */
+extern NSString *opaqueTag;
-MODULE_SCOPE int
-TkMacOSXProcessApplicationEvent(
- TkMacOSXEvent *eventPtr,
- MacEventStatus *statusPtr)
+@implementation TKApplication(TKWindowEvent)
+
+- (void) windowActivation: (NSNotification *) notification
{
- Tcl_CmdInfo dummy;
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ BOOL activate = [[notification name]
+ isEqualToString:NSWindowDidBecomeKeyNotification];
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
- /*
- * This is a bit of a hack. We get "show" events both when we come back
- * from being hidden, and whenever we are activated. I only want to run
- * the "show" proc when we have been hidden already, not as a substitute
- * for <Activate>. So I use this toggle...
- */
- static int toggleHide = 0;
-
- switch (eventPtr->eKind) {
- case kEventAppActivated:
- ShowFloatingWindows();
- break;
- case kEventAppDeactivated:
- TkSuspendClipboard();
- HideFloatingWindows();
- break;
- case kEventAppQuit:
- statusPtr->stopProcessing = 1;
- break;
- case kEventAppHidden:
- if (toggleHide == 0) {
- toggleHide = 1;
- if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp,
- "::tk::mac::OnHide", &dummy)) {
- Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnHide");
- }
- }
- statusPtr->stopProcessing = 1;
- break;
- case kEventAppShown:
- if (toggleHide == 1) {
- toggleHide = 0;
- if (eventPtr->interp && Tcl_GetCommandInfo(eventPtr->interp,
- "::tk::mac::OnShow", &dummy)) {
- Tcl_GlobalEval(eventPtr->interp, "::tk::mac::OnShow");
- }
- }
- statusPtr->stopProcessing = 1;
- break;
- case kEventAppAvailableWindowBoundsChanged: {
- static UInt32 prevId = 0;
- UInt32 id;
- OSStatus err;
-
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamTransactionID, typeUInt32,
- NULL, sizeof(id), NULL, &id);
- if (err != noErr || id != prevId) {
- TkDisplay *dispPtr = TkGetDisplayList();
-
- prevId = id;
- TkMacOSXDisplayChanged(dispPtr->display);
- }
+ if (winPtr && Tk_IsMapped(winPtr)) {
+ GenerateActivateEvents(winPtr, activate);
+ }
+}
+
+- (void) windowBoundsChanged: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ BOOL movedOnly = [[notification name]
+ isEqualToString:NSWindowDidMoveNotification];
+
+ if (movedOnly) {
+ /* constraining to screen after move not needed with AppKit */
+ }
+
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ NSRect bounds = [w frame];
+ int x, y, width = -1, height = -1, flags = 0;
+
+ x = bounds.origin.x;
+ y = tkMacOSXZeroScreenHeight - (bounds.origin.y + bounds.size.height);
+ if (winPtr->changes.x != x || winPtr->changes.y != y){
+ flags |= TK_LOCATION_CHANGED;
+ } else {
+ x = y = -1;
+ }
+ if (!movedOnly && (winPtr->changes.width != bounds.size.width ||
+ winPtr->changes.height != bounds.size.height)) {
+ width = bounds.size.width - wmPtr->xInParent;
+ height = bounds.size.height - wmPtr->yInParent;
+ flags |= TK_SIZE_CHANGED;
+ }
+ if (Tcl_GetServiceMode() != TCL_SERVICE_NONE) {
/*
- * Should we call ::tk::mac::OnDisplayChanged?
+ * Propagate geometry changes immediately.
*/
- break;
+
+ flags |= TK_MACOSX_HANDLE_EVENT_IMMEDIATELY;
}
- default:
- break;
+ TkGenWMConfigureEvent((Tk_Window) winPtr, x, y, width, height, flags);
}
- return 0;
}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkMacOSXProcessAppearanceEvent --
- *
- * This processes Appearance events.
- *
- * Results:
- * 0.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-MODULE_SCOPE int
-TkMacOSXProcessAppearanceEvent(
- TkMacOSXEvent *eventPtr,
- MacEventStatus *statusPtr)
+- (void) windowExpanded: (NSNotification *) notification
{
- switch (eventPtr->eKind) {
- case kEventAppearanceScrollBarVariantChanged:
- TkMacOSXInitScrollbarMetrics();
- break;
- default:
- break;
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
+ winPtr->wmInfoPtr->hints.initial_state =
+ TkMacOSXIsWindowZoomed(winPtr) ? ZoomState : NormalState;
+ Tk_MapWindow((Tk_Window) winPtr);
+ if (Tcl_GetServiceMode() != TCL_SERVICE_NONE) {
+ /*
+ * Process all Tk events generated by Tk_MapWindow().
+ */
+
+ while (Tcl_ServiceEvent(0)) {}
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {}
+
+ /*
+ * NSWindowDidDeminiaturizeNotification is received after
+ * NSWindowDidBecomeKeyNotification, so activate manually
+ */
+
+ GenerateActivateEvents(winPtr, 1);
+ } else {
+ Tcl_DoWhenIdle(DoWindowActivate, winPtr);
+ }
}
- 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.
- *
- *----------------------------------------------------------------------
- */
-MODULE_SCOPE int
-TkMacOSXProcessWindowEvent(
- TkMacOSXEvent * eventPtr,
- MacEventStatus * statusPtr)
+- (void) windowCollapsed: (NSNotification *) notification
{
- OSStatus err;
- WindowRef whichWindow;
- Window window;
- int eventFound = false;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
-
- switch (eventPtr->eKind) {
- case kEventWindowActivated:
- case kEventWindowDeactivated:
- case kEventWindowUpdate:
- case kEventWindowExpanding:
- case kEventWindowBoundsChanged:
- case kEventWindowDragStarted:
- case kEventWindowDragCompleted:
- case kEventWindowConstrain:
- case kEventWindowGetRegion:
- case kEventWindowDrawContent:
- break;
- default:
- return 0;
- break;
- }
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamDirectObject, typeWindowRef, NULL, sizeof(whichWindow),
- NULL, &whichWindow);
- if (err != noErr) {
- return 0;
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
+ Tk_UnmapWindow((Tk_Window) winPtr);
}
+}
- window = TkMacOSXGetXWindow(whichWindow);
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
+- (BOOL) windowShouldClose: (NSWindow *) w
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, w);
+#endif
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
- switch (eventPtr->eKind) {
- case kEventWindowActivated:
- case kEventWindowDeactivated:
- if (window != None) {
- int activate = (eventPtr->eKind == kEventWindowActivated);
+ if (winPtr) {
+ TkGenWMDestroyEvent((Tk_Window) winPtr);
+ }
- eventFound |= GenerateActivateEvents(window, activate);
- eventFound |= TkMacOSXGenerateFocusEvent(window, activate);
- if (winPtr) {
- TkMacOSXEnterExitFullscreen(winPtr, activate);
- }
- statusPtr->stopProcessing = 1;
- }
- break;
- case kEventWindowUpdate:
- if (window != None && GenerateUpdateEvent(window)) {
- eventFound = true;
- statusPtr->stopProcessing = 1;
- }
- break;
- case kEventWindowExpanding:
- if (winPtr) {
- winPtr->wmInfoPtr->hints.initial_state =
- TkMacOSXIsWindowZoomed(winPtr) ? ZoomState :
- NormalState;
- Tk_MapWindow((Tk_Window) winPtr);
- /*
- * Need to process all Tk events generated by Tk_MapWindow()
- * before returning to ensure all children are mapped, as
- * otherwise the Activate event that follows Expanding would
- * not be processed by any unmapped children.
- */
- while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {};
- while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {};
- }
- break;
- case kEventWindowBoundsChanged:
- if (winPtr) {
- WmInfo *wmPtr = winPtr->wmInfoPtr;
- UInt32 attr;
- Rect bounds;
- int x = -1, y = -1, width = -1, height = -1, flags = 0;
-
- ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamAttributes, typeUInt32,
- NULL, sizeof(attr), NULL, &attr);
- ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamCurrentBounds, typeQDRectangle,
- NULL, sizeof(bounds), NULL, &bounds);
- if (attr & kWindowBoundsChangeOriginChanged) {
- x = bounds.left - wmPtr->xInParent;
- y = bounds.top - wmPtr->yInParent;
- flags |= TK_LOCATION_CHANGED;
- }
- if (attr & kWindowBoundsChangeSizeChanged) {
- width = bounds.right - bounds.left;
- height = bounds.bottom - bounds.top;
- flags |= TK_SIZE_CHANGED;
- }
- TkMacOSXInvalClipRgns((Tk_Window) winPtr);
- TkMacOSXInvalidateWindow((MacDrawable *) window,
- TK_PARENT_WINDOW);
- TkGenWMConfigureEvent((Tk_Window)winPtr, x, y, width,
- height, flags);
- if (attr & kWindowBoundsChangeUserResize ||
- attr & kWindowBoundsChangeUserDrag) {
- TkMacOSXRunTclEventLoop();
- }
- if (wmPtr->attributes & kWindowResizableAttribute) {
- HIViewRef growBoxView;
-
- err = HIViewFindByID(HIViewGetRoot(whichWindow),
- kHIViewWindowGrowBoxID, &growBoxView);
- if (err == noErr) {
- ChkErr(HIViewSetNeedsDisplay, growBoxView, true);
- }
- }
- }
- break;
- case kEventWindowDragStarted:
- if (!(TkMacOSXModifierState() & cmdKey)) {
- TkMacOSXBringWindowForward(whichWindow);
- }
- TkMacOSXTrackingLoop(1);
- break;
- case kEventWindowDragCompleted: {
- Rect maxBounds, bounds, strWidths;
- int h = 0, v = 0;
-
- TkMacOSXTrackingLoop(0);
- ChkErr(GetWindowGreatestAreaDevice, whichWindow,
- kWindowDragRgn, NULL, &maxBounds);
- ChkErr(GetWindowBounds, whichWindow, kWindowStructureRgn,
- &bounds);
- ChkErr(GetWindowStructureWidths, whichWindow, &strWidths);
- if (bounds.left > maxBounds.right - strWidths.left) {
- h = maxBounds.right
- - (strWidths.left ? strWidths.left : 40)
- - bounds.left;
- } else if (bounds.right < maxBounds.left
- + strWidths.right) {
- h = maxBounds.left
- + (strWidths.right ? strWidths.right : 40)
- - bounds.right;
- }
- if (bounds.top > maxBounds.bottom - strWidths.top) {
- v = maxBounds.bottom
- - (strWidths.top ? strWidths.top : 40)
- - bounds.top;
- } else if (bounds.bottom < maxBounds.top
- + strWidths.bottom) {
- v = maxBounds.top
- + (strWidths.bottom ? strWidths.bottom : 40)
- - bounds.bottom;
- } else if (strWidths.top && bounds.top < maxBounds.top) {
- v = maxBounds.top - bounds.top;
- }
- if (h || v) {
- OffsetRect(&bounds, h, v);
- ChkErr(SetWindowBounds, whichWindow,
- kWindowStructureRgn, &bounds);
- }
- break;
- }
- case kEventWindowConstrain:
- if (winPtr && (winPtr->wmInfoPtr->flags & WM_FULLSCREEN) &&
- TkMacOSXMakeFullscreen(winPtr, whichWindow, 1,
- NULL) == TCL_OK) {
- statusPtr->stopProcessing = 1;
- }
- break;
- case kEventWindowGetRegion:
- if (winPtr && (winPtr->wmInfoPtr->flags & WM_TRANSPARENT)) {
- WindowRegionCode code;
-
- statusPtr->stopProcessing = (CallNextEventHandler(
- eventPtr->callRef, eventPtr->eventRef) == noErr);
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamWindowRegionCode, typeWindowRegionCode,
- NULL, sizeof(code), NULL, &code);
- if (err == noErr && code == kWindowOpaqueRgn) {
- RgnHandle rgn;
-
- err = ChkErr(GetEventParameter, eventPtr->eventRef,
- kEventParamRgnHandle, typeQDRgnHandle, NULL,
- sizeof(rgn), NULL, &rgn);
- if (err == noErr) {
- SetEmptyRgn(rgn);
- statusPtr->stopProcessing = 1;
- }
- }
- }
- break;
- case kEventWindowDrawContent:
- if (winPtr && (winPtr->wmInfoPtr->flags & WM_TRANSPARENT)) {
- CGrafPtr port;
+ /*
+ * If necessary, TkGenWMDestroyEvent() handles [close]ing the window,
+ * so can always return NO from -windowShouldClose: for a Tk window.
+ */
- GetPort(&port);
- ClearPort(port, NULL);
- }
- break;
+ return (winPtr ? NO : YES);
+}
+
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+
+- (void) windowDragStart: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+}
+
+- (void) windowLiveResize: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+ //BOOL start = [[notification name] isEqualToString:NSWindowWillStartLiveResizeNotification];
+}
+
+- (void) windowMapped: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
+ //Tk_MapWindow((Tk_Window) winPtr);
}
+}
- return eventFound;
+- (void) windowBecameVisible: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
}
+
+- (void) windowUnmapped: (NSNotification *) notification
+{
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+
+ if (winPtr) {
+ //Tk_UnmapWindow((Tk_Window) winPtr);
+ }
+}
+#endif /* TK_MAC_DEBUG_NOTIFICATIONS */
+
+- (void) _setupWindowNotifications
+{
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+
+#define observe(n, s) \
+ [nc addObserver:self selector:@selector(s) name:(n) object:nil]
+ observe(NSWindowDidBecomeKeyNotification, windowActivation:);
+ observe(NSWindowDidResignKeyNotification, windowActivation:);
+ observe(NSWindowDidMoveNotification, windowBoundsChanged:);
+ observe(NSWindowDidResizeNotification, windowBoundsChanged:);
+ observe(NSWindowDidDeminiaturizeNotification, windowExpanded:);
+ observe(NSWindowDidMiniaturizeNotification, windowCollapsed:);
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ observe(NSWindowWillMoveNotification, windowDragStart:);
+ observe(NSWindowWillStartLiveResizeNotification, windowLiveResize:);
+ observe(NSWindowDidEndLiveResizeNotification, windowLiveResize:);
+ observe(NSWindowWillOrderOnScreenNotification, windowMapped:);
+ observe(NSWindowDidOrderOnScreenNotification, windowBecameVisible:);
+ observe(NSWindowDidOrderOffScreenNotification, windowUnmapped:);
+#endif
+#undef observe
+}
+@end
-/*
- *----------------------------------------------------------------------
- *
- * GenerateUpdateEvent --
- *
- * Given a Macintosh window update event this function generates
- * all the Expose XEvents 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)
+#pragma mark TKApplication(TKApplicationEvent)
+
+@implementation TKApplication(TKApplicationEvent)
+
+- (void) applicationActivate: (NSNotification *) notification
{
- WindowRef macWindow;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
- int result = 0;
- CGRect updateBounds;
- HIShapeRef rgn;
- HIMutableShapeRef updateRgn;
- int dx, dy;
-
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
-
- if (winPtr ==NULL ){
- return result;
- }
- macWindow = TkMacOSXDrawableWindow(window);
- TK_IF_MAC_OS_X_API (5, HIWindowCopyShape,
- ChkErr(HIWindowCopyShape, macWindow, kWindowUpdateRgn,
- kHICoordSpaceWindow, &rgn);
- dx = -winPtr->wmInfoPtr->xInParent;
- dy = -winPtr->wmInfoPtr->yInParent;
- ) TK_ELSE_MAC_OS_X (5,
- Rect bounds;
-
- TkMacOSXCheckTmpQdRgnEmpty();
- ChkErr(GetWindowRegion, macWindow, kWindowUpdateRgn, tkMacOSXtmpQdRgn);
- rgn = HIShapeCreateWithQDRgn(tkMacOSXtmpQdRgn);
- SetEmptyRgn(tkMacOSXtmpQdRgn);
- ChkErr(GetWindowBounds, macWindow, kWindowContentRgn, &bounds);
- dx = -bounds.left;
- dy = -bounds.top;
- ) TK_ENDIF
- updateRgn = HIShapeCreateMutableCopy(rgn);
- CFRelease(rgn);
- ChkErr(HIShapeOffset, updateRgn, dx, dy);
- HIShapeGetBounds(updateRgn, &updateBounds);
-#ifdef TK_MAC_DEBUG_CLIP_REGIONS
- TkMacOSXDebugFlashRegion(window, updateRgn);
-#endif /* TK_MAC_DEBUG_CLIP_REGIONS */
- BeginUpdate(macWindow);
- if (winPtr->wmInfoPtr->flags & WM_TRANSPARENT) {
- ClearPort(TkMacOSXGetDrawablePort(window), updateRgn);
- }
- result = GenerateUpdates(updateRgn, &updateBounds, winPtr);
- EndUpdate(macWindow);
- CFRelease(updateRgn);
- if (result) {
- /*
- * Ensure there are no pending idle-time redraws that could prevent
- * the just posted Expose events from generating new redraws.
- */
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ [NSApp tkCheckPasteboard];
+}
- Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT);
+- (void) applicationDeactivate: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ TkSuspendClipboard();
+}
+
+- (void) applicationShowHide: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ const char *cmd = ([[notification name] isEqualToString:
+ NSApplicationDidUnhideNotification] ?
+ "::tk::mac::OnShow" : "::tk::mac::OnHide");
+ Tcl_CmdInfo dummy;
+
+ if (_eventInterp && Tcl_GetCommandInfo(_eventInterp, cmd, &dummy)) {
+ int code = Tcl_EvalEx(_eventInterp, cmd, -1, TCL_EVAL_GLOBAL);
+
+ if (code != TCL_OK) {
+ Tcl_BackgroundError(_eventInterp);
+ }
+ Tcl_ResetResult(_eventInterp);
}
- return result;
- }
+}
+
+- (void) displayChanged: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ TkDisplay *dispPtr = TkGetDisplayList();
+
+ if (dispPtr) {
+ TkMacOSXDisplayChanged(dispPtr->display);
+ }
+}
+@end
+
+#pragma mark -
/*
*----------------------------------------------------------------------
*
* GenerateUpdates --
*
- * Given a Macintosh update region and a Tk window this function
- * geneates a X Expose event for the window if it is within the
- * update region. The function will then recursivly have each
- * damaged window generate Expose events for its child windows.
+ * Given a Macintosh update region and a Tk window this function geneates
+ * a X Expose event for the window if it is within the update region. The
+ * function will then recursivly have each damaged window generate Expose
+ * events for its child windows.
*
* Results:
* True if event(s) are generated - false otherwise.
@@ -529,11 +327,9 @@ GenerateUpdates(
if (!CGRectIntersectsRect(bounds, *updateBounds)) {
return 0;
}
- TK_IF_MAC_OS_X_API (4, HIShapeIntersectsRect,
- if (!HIShapeIntersectsRect(updateRgn, &bounds)) {
- return 0;
- }
- ) TK_ENDIF
+ if (!HIShapeIntersectsRect(updateRgn, &bounds)) {
+ return 0;
+ }
/*
* Compute the bounding box of the area that the damage occured in.
@@ -547,12 +343,11 @@ GenerateUpdates(
return 0;
}
HIShapeGetBounds(damageRgn, &damageBounds);
- ChkErr(TkMacOSHIShapeUnion, boundsRgn, updateRgn, updateRgn);
- HIShapeGetBounds(updateRgn, updateBounds);
+
CFRelease(damageRgn);
CFRelease(boundsRgn);
- event.xany.serial = Tk_Display(winPtr)->request;
+ event.xany.serial = LastKnownRequestProcessed(Tk_Display(winPtr));
event.xany.send_event = false;
event.xany.window = Tk_WindowId(winPtr);
event.xany.display = Tk_Display(winPtr);
@@ -563,6 +358,10 @@ GenerateUpdates(
event.xexpose.height = damageBounds.size.height;
event.xexpose.count = 0;
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+#ifdef TK_MAC_DEBUG_DRAWING
+ TKLog(@"Expose %p {{%d, %d}, {%d, %d}}", event.xany.window, event.xexpose.x,
+ event.xexpose.y, event.xexpose.width, event.xexpose.height);
+#endif
/*
* Generate updates for the children of this window
@@ -593,7 +392,7 @@ GenerateUpdates(
return 1;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -613,29 +412,45 @@ GenerateUpdates(
int
GenerateActivateEvents(
- Window window, /* Root X window for event. */
- int activeFlag )
+ TkWindow *winPtr,
+ 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);
+ TkGenerateActivateEvents(winPtr, activeFlag);
+ TkMacOSXGenerateFocusEvent(winPtr, activeFlag);
+ TkMacOSXEnterExitFullscreen(winPtr, activeFlag);
return true;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DoWindowActivate --
+ *
+ * Idle handler that calls GenerateActivateEvents().
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+DoWindowActivate(
+ ClientData clientData)
+{
+ GenerateActivateEvents(clientData, 1);
+}
+
/*
*----------------------------------------------------------------------
*
* TkMacOSXGenerateFocusEvent --
*
- * Given a Macintosh window activate event this function generates all the
- * X Focus events needed by Tk.
+ * 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.
@@ -648,32 +463,24 @@ GenerateActivateEvents(
MODULE_SCOPE int
TkMacOSXGenerateFocusEvent(
- Window window, /* Root X window for event. */
- int activeFlag )
+ TkWindow *winPtr, /* 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;
- }
/*
- * Don't send focus events to windows of class help or to
- * windows with the kWindowNoActivatesAttribute.
+ * Don't send focus events to windows of class help or to windows with the
+ * kWindowNoActivatesAttribute.
*/
- if (((TkWindow *)tkwin)->wmInfoPtr->macClass == kHelpWindowClass ||
- ((TkWindow *)tkwin)->wmInfoPtr->attributes &
- kWindowNoActivatesAttribute) {
+
+ if (winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass == kHelpWindowClass ||
+ winPtr->wmInfoPtr->attributes & kWindowNoActivatesAttribute)) {
return false;
}
/*
- * Generate FocusIn and FocusOut events. This event
- * is only sent to the toplevel window.
+ * Generate FocusIn and FocusOut events. This event is only sent to the
+ * toplevel window.
*/
if (activeFlag) {
@@ -682,10 +489,10 @@ TkMacOSXGenerateFocusEvent(
event.xany.type = FocusOut;
}
- event.xany.serial = dispPtr->display->request;
+ event.xany.serial = LastKnownRequestProcessed(Tk_Display(winPtr));
event.xany.send_event = False;
- event.xfocus.display = dispPtr->display;
- event.xfocus.window = window;
+ event.xfocus.display = Tk_Display(winPtr);
+ event.xfocus.window = winPtr->window;
event.xfocus.mode = NotifyNormal;
event.xfocus.detail = NotifyDetailNone;
@@ -698,9 +505,8 @@ TkMacOSXGenerateFocusEvent(
*
* 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.
+ * 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.
@@ -714,10 +520,8 @@ TkMacOSXGenerateFocusEvent(
void
TkGenWMConfigureEvent(
Tk_Window tkwin,
- int x,
- int y,
- int width,
- int height,
+ int x, int y,
+ int width, int height,
int flags)
{
XEvent event;
@@ -729,7 +533,7 @@ TkGenWMConfigureEvent(
}
event.type = ConfigureNotify;
- event.xconfigure.serial = Tk_Display(tkwin)->request;
+ event.xconfigure.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
event.xconfigure.send_event = False;
event.xconfigure.display = Tk_Display(tkwin);
event.xconfigure.event = Tk_WindowId(tkwin);
@@ -755,11 +559,16 @@ TkGenWMConfigureEvent(
event.xconfigure.width = width;
event.xconfigure.height = height;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ if (flags & TK_MACOSX_HANDLE_EVENT_IMMEDIATELY) {
+ Tk_HandleEvent(&event);
+ } else {
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ }
/*
* Update window manager information.
*/
+
if (Tk_IsTopLevel(winPtr)) {
wmPtr = winPtr->wmInfoPtr;
if (flags & TK_LOCATION_CHANGED) {
@@ -774,33 +583,31 @@ TkGenWMConfigureEvent(
* 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
+ } 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->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
+ } 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;
+ if (wmPtr->height < 0) {
+ wmPtr->height = 0;
}
+ } else {
+ wmPtr->height = height;
}
+
wmPtr->configWidth = width;
wmPtr->configHeight = height;
}
@@ -809,10 +616,11 @@ TkGenWMConfigureEvent(
/*
* 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 visible to the subwindow.
+ * 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
+ * visible to the subwindow.
*/
+
winPtr->changes.x = x;
winPtr->changes.y = y;
winPtr->changes.width = width;
@@ -842,7 +650,7 @@ TkGenWMDestroyEvent(
{
XEvent event;
- event.xany.serial = Tk_Display(tkwin)->request;
+ event.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
event.xany.send_event = False;
event.xany.display = Tk_Display(tkwin);
@@ -851,7 +659,7 @@ TkGenWMDestroyEvent(
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);
+ Tk_HandleEvent(&event);
}
/*
@@ -859,17 +667,15 @@ TkGenWMDestroyEvent(
*
* 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.
+ * 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.
+ * Depends on what sort of handler, if any, was set up for the protocol.
*
*----------------------------------------------------------------------
*/
@@ -891,28 +697,28 @@ TkWmProtocolEventProc(
}
protocol = (Atom) eventPtr->xclient.data.l[0];
for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
+ protPtr = protPtr->nextPtr) {
if (protocol == protPtr->protocol) {
- Tcl_Preserve((ClientData) protPtr);
+ Tcl_Preserve(protPtr);
interp = protPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(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_BackgroundError(interp);
}
- Tcl_Release((ClientData) interp);
- Tcl_Release((ClientData) protPtr);
+ Tcl_Release(interp);
+ Tcl_Release(protPtr);
return;
}
}
/*
- * No handler was present for this protocol. If this is a
- * WM_DELETE_WINDOW message then just destroy the window.
+ * 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")) {
@@ -947,44 +753,354 @@ Tk_MacOSXIsAppInFront(void)
if (err == noErr) {
ChkErr(SameProcess, &frontPsn, &ourPsn, &isFrontProcess);
}
-
+
return (isFrontProcess == true);
}
+#pragma mark TKContentView
+
+#import <ApplicationServices/ApplicationServices.h>
+
/*
- *----------------------------------------------------------------------
- *
- * ClearPort --
- *
- * Clear (i.e. fill with transparent color) the given port.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
+ * Custom content view for Tk NSWindows, containing standard NSView subviews.
+ * The goal is to emulate X11-style drawing in response to Expose events:
+ * during the normal AppKit drawing cycle, we supress drawing of all subviews
+ * (using a technique adapted from WebKit's WebHTMLView) and instead send
+ * Expose events about the subviews that would be redrawn. Tk Expose event
+ * handling and drawing handlers then draw the subviews manually via their
+ * -displayRectIgnoringOpacity:
+ */
+
+@interface TKContentView(TKWindowEvent)
+- (void) drawRect: (NSRect) rect;
+- (void) generateExposeEvents: (HIMutableShapeRef) shape;
+- (BOOL) isOpaque;
+- (BOOL) wantsDefaultClipping;
+- (BOOL) acceptsFirstResponder;
+- (void) keyDown: (NSEvent *) theEvent;
+@end
+
+@implementation TKContentView
+@end
+
+static Tk_RestrictAction
+ExposeRestrictProc(
+ ClientData arg,
+ XEvent *eventPtr)
+{
+ return (eventPtr->type==Expose && eventPtr->xany.serial==PTR2UINT(arg)
+ ? TK_PROCESS_EVENT : TK_DEFER_EVENT);
+}
+
+@implementation TKContentView(TKWindowEvent)
+
+- (void) drawRect: (NSRect) rect
+{
+ const NSRect *rectsBeingDrawn;
+ NSInteger rectsBeingDrawnCount;
+
+ [self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount];
+#ifdef TK_MAC_DEBUG_DRAWING
+ TKLog(@"-[%@(%p) %s%@]", [self class], self, _cmd, NSStringFromRect(rect));
+ [[NSColor colorWithDeviceRed:0.0 green:1.0 blue:0.0 alpha:.1] setFill];
+ NSRectFillListUsingOperation(rectsBeingDrawn, rectsBeingDrawnCount,
+ NSCompositeSourceOver);
+#endif
+
+ NSWindow *w = [self window];
+
+ if ([self isOpaque] && [w showsResizeIndicator]) {
+ NSRect bounds = [self convertRect:[w _growBoxRect] fromView:nil];
+
+ if ([self needsToDrawRect:bounds]) {
+ NSEraseRect(bounds);
+ }
+ }
+
+ CGFloat height = [self bounds].size.height;
+ HIMutableShapeRef drawShape = HIShapeCreateMutable();
+
+ while (rectsBeingDrawnCount--) {
+ CGRect r = NSRectToCGRect(*rectsBeingDrawn++);
+
+ r.origin.y = height - (r.origin.y + r.size.height);
+ HIShapeUnionWithRect(drawShape, &r);
+ }
+ if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) {
+ [self generateExposeEvents:drawShape];
+ } else {
+ [self performSelectorOnMainThread:@selector(generateExposeEvents:)
+ withObject:(id)drawShape waitUntilDone:NO
+ modes:[NSArray arrayWithObjects:NSRunLoopCommonModes,
+ NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode,
+ nil]];
+ }
+ CFRelease(drawShape);
+}
+
+- (void) generateExposeEvents: (HIMutableShapeRef) shape
+{
+ TkWindow *winPtr = TkMacOSXGetTkWindow([self window]);
+ unsigned long serial;
+ CGRect updateBounds;
+
+ if (!winPtr) {
+ return;
+ }
+ HIShapeGetBounds(shape, &updateBounds);
+ serial = LastKnownRequestProcessed(Tk_Display(winPtr));
+ if (GenerateUpdates(shape, &updateBounds, winPtr) &&
+ ![[NSRunLoop currentRunLoop] currentMode] &&
+ Tcl_GetServiceMode() != TCL_SERVICE_NONE) {
+ /*
+ * Ensure there are no pending idle-time redraws that could prevent the
+ * just posted Expose events from generating new redraws.
+ */
+
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {}
+
+ /*
+ * For smoother drawing, process Expose events and resulting redraws
+ * immediately instead of at idle time.
+ */
+
+ ClientData oldArg;
+ Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc,
+ UINT2PTR(serial), &oldArg);
+
+ while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {}
+ Tk_RestrictEvents(oldProc, oldArg, &oldArg);
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {}
+ }
+}
+
+- (void) tkToolbarButton: (id) sender
+{
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd);
+#endif
+ XVirtualEvent event;
+ int x, y;
+ TkWindow *winPtr = TkMacOSXGetTkWindow([self window]);
+ Tk_Window tkwin = (Tk_Window) winPtr;
+
+ bzero(&event, sizeof(XVirtualEvent));
+ event.type = VirtualEvent;
+ event.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
+ 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();
+ XQueryPointer(NULL, winPtr->window, NULL, NULL,
+ &event.x_root, &event.y_root, &x, &y, &event.state);
+ Tk_TopCoordsToWindow(tkwin, x, y, &event.x, &event.y);
+ event.same_screen = true;
+ event.name = Tk_GetUid("ToolbarButton");
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+}
+
+#ifdef TK_MAC_DEBUG_DRAWING
+- (void) setFrameSize: (NSSize) newSize
+{
+ TKLog(@"-[%@(%p) %s%@]", [self class], self, _cmd,
+ NSStringFromSize(newSize));
+ [super setFrameSize:newSize];
+}
+
+- (void) setNeedsDisplayInRect: (NSRect) invalidRect
+{
+ TKLog(@"-[%@(%p) %s%@]", [self class], self, _cmd,
+ NSStringFromRect(invalidRect));
+ [super setNeedsDisplayInRect:invalidRect];
+}
+#endif
+
+- (BOOL) isOpaque
+{
+ NSWindow *w = [self window];
+
+ if (opaqueTag != NULL) {
+ return YES;
+ } else {
+
+ return (w && (([w styleMask] & NSTexturedBackgroundWindowMask) ||
+ ![w isOpaque]) ? NO : YES);
+ }
+}
+
+- (BOOL) wantsDefaultClipping
+{
+ return NO;
+}
+
+- (BOOL) acceptsFirstResponder
+{
+ return YES;
+}
+
+- (void) keyDown: (NSEvent *) theEvent
+{
+#ifdef TK_MAC_DEBUG_EVENTS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
+#endif
+}
+
+@end
+
+#pragma mark TKContentViewPrivate
+
+/*
+ * Technique adapted from WebKit/WebKit/mac/WebView/WebHTMLView.mm to supress
+ * normal AppKit subview drawing and make all drawing go through us.
+ * Overrides NSView internals.
*/
-static void
-ClearPort(
- CGrafPtr port,
- HIShapeRef updateRgn)
-{
- CGContextRef context;
- Rect bounds;
- CGRect rect;
-
- GetPortBounds(port, &bounds);
- QDBeginCGContext(port, &context);
- SyncCGContextOriginWithPort(context, port);
- CGContextConcatCTM(context, CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0,
- bounds.bottom - bounds.top));
- if (updateRgn) {
- ChkErr(HIShapeReplacePathInCGContext, updateRgn, context);
- CGContextEOClip(context);
- }
- rect = CGRectMake(0, 0, bounds.right, bounds.bottom);
- CGContextClearRect(context, rect);
- QDEndCGContext(port, &context);
+
+@interface TKContentView(TKContentViewPrivate)
+- (id) initWithFrame: (NSRect) frame;
+- (void) _setAsideSubviews;
+- (void) _restoreSubviews;
+@end
+
+@interface NSView(TKContentViewPrivate)
+- (void) _recursiveDisplayRectIfNeededIgnoringOpacity: (NSRect) rect
+ isVisibleRect: (BOOL) isVisibleRect
+ rectIsVisibleRectForView: (NSView *) visibleView
+ topView: (BOOL) topView;
+- (void) _recursiveDisplayAllDirtyWithLockFocus: (BOOL) needsLockFocus
+ visRect: (NSRect) visRect;
+- (void) _recursive: (BOOL) recurse
+ displayRectIgnoringOpacity: (NSRect) displayRect
+ inContext: (NSGraphicsContext *) context topView: (BOOL) topView;
+- (void) _lightWeightRecursiveDisplayInRect: (NSRect) visRect;
+- (BOOL) _drawRectIfEmpty;
+- (void) _drawRect: (NSRect) inRect clip: (BOOL) clip;
+- (void) _setDrawsOwnDescendants: (BOOL) drawsOwnDescendants;
+@end
+
+@implementation TKContentView(TKContentViewPrivate)
+
+- (id) initWithFrame: (NSRect) frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ _savedSubviews = nil;
+ _subviewsSetAside = NO;
+ [self _setDrawsOwnDescendants:YES];
+ }
+ return self;
+}
+
+- (void) _setAsideSubviews
+{
+#ifdef TK_MAC_DEBUG
+ if (_subviewsSetAside || _savedSubviews) {
+ Tcl_Panic("TKContentView _setAsideSubviews called incorrectly");
+ }
+#endif
+ _savedSubviews = _subviews;
+ _subviews = nil;
+ _subviewsSetAside = YES;
+}
+
+- (void) _restoreSubviews
+{
+#ifdef TK_MAC_DEBUG
+ if (!_subviewsSetAside || _subviews) {
+ Tcl_Panic("TKContentView _restoreSubviews called incorrectly");
+ }
+#endif
+ _subviews = _savedSubviews;
+ _savedSubviews = nil;
+ _subviewsSetAside = NO;
+}
+
+- (void) _recursiveDisplayRectIfNeededIgnoringOpacity: (NSRect) rect
+ isVisibleRect: (BOOL) isVisibleRect
+ rectIsVisibleRectForView: (NSView *) visibleView
+ topView: (BOOL) topView
+{
+ [self _setAsideSubviews];
+ [super _recursiveDisplayRectIfNeededIgnoringOpacity:rect
+ isVisibleRect:isVisibleRect rectIsVisibleRectForView:visibleView
+ topView:topView];
+ [self _restoreSubviews];
}
+
+- (void) _recursiveDisplayAllDirtyWithLockFocus: (BOOL) needsLockFocus
+ visRect: (NSRect) visRect
+{
+ BOOL needToSetAsideSubviews = !_subviewsSetAside;
+
+ if (needToSetAsideSubviews) {
+ [self _setAsideSubviews];
+ }
+ [super _recursiveDisplayAllDirtyWithLockFocus:needsLockFocus
+ visRect:visRect];
+ if (needToSetAsideSubviews) {
+ [self _restoreSubviews];
+ }
+}
+
+- (void) _recursive: (BOOL) recurse
+ displayRectIgnoringOpacity: (NSRect) displayRect
+ inContext: (NSGraphicsContext *) context topView: (BOOL) topView
+{
+ [self _setAsideSubviews];
+ [super _recursive:recurse
+ displayRectIgnoringOpacity:displayRect inContext:context
+ topView:topView];
+ [self _restoreSubviews];
+}
+
+- (void) _lightWeightRecursiveDisplayInRect: (NSRect) visRect
+{
+ BOOL needToSetAsideSubviews = !_subviewsSetAside;
+
+ if (needToSetAsideSubviews) {
+ [self _setAsideSubviews];
+ }
+ [super _lightWeightRecursiveDisplayInRect:visRect];
+ if (needToSetAsideSubviews) {
+ [self _restoreSubviews];
+ }
+}
+
+- (BOOL) _drawRectIfEmpty
+{
+ /*
+ * Our -drawRect manages subview drawing directly, so it needs to be called
+ * even if the area to be redrawn is completely obscured by subviews.
+ */
+
+ return YES;
+}
+
+- (void) _drawRect: (NSRect) inRect clip: (BOOL) clip
+{
+#ifdef TK_MAC_DEBUG_DRAWING
+ TKLog(@"-[%@(%p) %s%@]", [self class], self, _cmd,
+ NSStringFromRect(inRect));
+#endif
+ BOOL subviewsWereSetAside = _subviewsSetAside;
+
+ if (subviewsWereSetAside) {
+ [self _restoreSubviews];
+ }
+ [super _drawRect:inRect clip:clip];
+ if (subviewsWereSetAside) {
+ [self _setAsideSubviews];
+ }
+}
+
+@end
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 2cb2255..b916de3 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -7,11 +7,12 @@
* manager.
*
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2010 Kevin Walzer/WordTech Communications LLC.
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
@@ -27,29 +28,140 @@
*/
/*
+ * Window attributes and classes
+ */
+
+#define WM_NSMASK_SHIFT 36
+#define tkWindowDoesNotHideAttribute \
+ ((UInt64) 1 << kHIWindowBitDoesNotHide)
+#define tkCanJoinAllSpacesAttribute \
+ ((UInt64) NSWindowCollectionBehaviorCanJoinAllSpaces << 34)
+#define tkMoveToActiveSpaceAttribute \
+ ((UInt64) NSWindowCollectionBehaviorMoveToActiveSpace << 34)
+#define tkNonactivatingPanelAttribute \
+ ((UInt64) NSNonactivatingPanelMask << WM_NSMASK_SHIFT)
+#define tkHUDWindowAttribute \
+ ((UInt64) NSHUDWindowMask << WM_NSMASK_SHIFT)
+#define tkAlwaysValidAttributes (kWindowNoUpdatesAttribute \
+ | kWindowNoActivatesAttribute | kWindowHideOnSuspendAttribute \
+ | kWindowHideOnFullScreenAttribute | kWindowNoConstrainAttribute \
+ | kWindowNoShadowAttribute | kWindowLiveResizeAttribute \
+ | kWindowOpaqueForEventsAttribute | kWindowIgnoreClicksAttribute \
+ | kWindowDoesNotCycleAttribute | tkWindowDoesNotHideAttribute \
+ | tkCanJoinAllSpacesAttribute | tkMoveToActiveSpaceAttribute \
+ | tkNonactivatingPanelAttribute | tkHUDWindowAttribute)
+
+
+/*Objects for use in setting background color and opacity of window.*/
+NSColor *colorName = NULL;
+NSString *opaqueTag = NULL;
+
+static const struct {
+ const UInt64 validAttrs, defaultAttrs, forceOnAttrs, forceOffAttrs;
+ int flags; NSUInteger styleMask;
+} macClassAttrs[] = {
+ [kAlertWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute, },
+ [kMovableAlertWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute, },
+ [kModalWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute, },
+ [kMovableModalWindowClass] = {
+ .validAttrs = kWindowCloseBoxAttribute | kWindowMetalAttribute |
+ kWindowFullZoomAttribute | kWindowResizableAttribute,
+ .defaultAttrs = kWindowDoesNotCycleAttribute, },
+ [kFloatingWindowClass] = {
+ .validAttrs = kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute |
+ kWindowMetalAttribute | kWindowToolbarButtonAttribute |
+ kWindowNoTitleBarAttribute | kWindowFullZoomAttribute |
+ kWindowResizableAttribute | kWindowSideTitlebarAttribute,
+ .defaultAttrs = kWindowStandardFloatingAttributes |
+ kWindowHideOnSuspendAttribute | kWindowDoesNotCycleAttribute,
+ .forceOnAttrs = kWindowResizableAttribute,
+ .forceOffAttrs = kWindowCollapseBoxAttribute,
+ .styleMask = NSUtilityWindowMask, },
+ [kDocumentWindowClass] = {
+ .validAttrs = kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute |
+ kWindowMetalAttribute | kWindowToolbarButtonAttribute |
+ kWindowNoTitleBarAttribute |
+ kWindowUnifiedTitleAndToolbarAttribute |
+ kWindowInWindowMenuAttribute | kWindowFullZoomAttribute |
+ kWindowResizableAttribute,
+ .forceOnAttrs = kWindowResizableAttribute,
+ .defaultAttrs = kWindowStandardDocumentAttributes |
+ kWindowLiveResizeAttribute | kWindowInWindowMenuAttribute, },
+ [kUtilityWindowClass] = {
+ .validAttrs = kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute |
+ kWindowMetalAttribute | kWindowToolbarButtonAttribute |
+ kWindowNoTitleBarAttribute | kWindowFullZoomAttribute |
+ kWindowResizableAttribute | kWindowSideTitlebarAttribute,
+ .defaultAttrs = kWindowStandardFloatingAttributes |
+ kWindowHideOnFullScreenAttribute |
+ tkWindowDoesNotHideAttribute | tkNonactivatingPanelAttribute |
+ kWindowDoesNotCycleAttribute,
+ .forceOnAttrs = kWindowResizableAttribute,
+ .forceOffAttrs = kWindowCollapseBoxAttribute,
+ .flags = WM_TOPMOST,
+ .styleMask = NSUtilityWindowMask, },
+ [kHelpWindowClass] = {
+ .defaultAttrs = kWindowHideOnSuspendAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute,
+ .flags = WM_TOPMOST, },
+ [kSheetWindowClass] = {
+ .validAttrs = kWindowResizableAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute,
+ .styleMask = NSDocModalWindowMask, },
+ [kToolbarWindowClass] = {
+ .defaultAttrs = kWindowHideOnSuspendAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute,
+ .styleMask = NSUtilityWindowMask, },
+ [kPlainWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute, },
+ [kOverlayWindowClass] = {
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute,
+ .flags = WM_TOPMOST | WM_TRANSPARENT, },
+ [kSheetAlertWindowClass] = {
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute,
+ .styleMask = NSDocModalWindowMask, },
+ [kAltPlainWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute, },
+ [kSimpleWindowClass] = {
+ .defaultAttrs = kWindowDoesNotCycleAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute, },
+ [kDrawerWindowClass] = {
+ .validAttrs = kWindowMetalAttribute | kWindowResizableAttribute,
+ .forceOnAttrs = kWindowNoTitleBarAttribute |
+ kWindowDoesNotCycleAttribute, },
+};
+
+#define ForceAttributes(attributes, class) \
+ ((attributes) & (~macClassAttrs[(class)].forceOffAttrs | \
+ (macClassAttrs[(class)].forceOnAttrs & ~kWindowResizableAttribute)))
+
+/*
* Data for [wm attributes] command:
*/
+
typedef enum {
WMATT_ALPHA, WMATT_FULLSCREEN, WMATT_MODIFIED, WMATT_NOTIFY,
WMATT_TITLEPATH, WMATT_TOPMOST, WMATT_TRANSPARENT,
_WMATT_LAST_ATTRIBUTE
} WmAttribute;
-static const char *WmAttributeNames[] = {
+static const char *const WmAttributeNames[] = {
"-alpha", "-fullscreen", "-modified", "-notify",
"-titlepath", "-topmost", "-transparent",
NULL
};
/*
- * 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.
@@ -87,90 +199,287 @@ static int windowHashInit = false;
* Forward declarations for procedures defined in this file:
*/
-static void InitialWindowBounds(TkWindow *winPtr, WindowRef macWindow,
- Rect *geometry);
-static int ParseGeometry(Tcl_Interp *interp, char *string, TkWindow *winPtr);
-static void TopLevelEventProc(ClientData clientData, XEvent *eventPtr);
-static void WmStackorderToplevelWrapperMap(TkWindow *winPtr, Display *display,
- Tcl_HashTable *table);
-static void UpdateGeometryInfo(ClientData clientData);
-static void UpdateSizeHints(TkWindow *winPtr);
-static void UpdateVRootGeometry(WmInfo *wmPtr);
-static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmColormapwindowsCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmOverrideredirectCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
-static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr);
-static int WmWinStyle(Tcl_Interp *interp, TkWindow *winPtr, int objc,
- Tcl_Obj * const objv[]);
-static void ApplyWindowClassAttributeChanges(TkWindow *winPtr,
- WindowRef macWindow, WindowClass oldClass,
- WindowAttributes oldAttributes, int create);
-static void ApplyMasterOverrideChanges(TkWindow *winPtr, WindowRef macWindow);
-static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr);
-static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr);
-static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr);
-static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin);
+static NSRect InitialWindowBounds(TkWindow *winPtr,
+ NSWindow *macWindow);
+static int ParseGeometry(Tcl_Interp *interp, char *string,
+ TkWindow *winPtr);
+static void TopLevelEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void WmStackorderToplevelWrapperMap(TkWindow *winPtr,
+ Display *display, Tcl_HashTable *table);
+static void UpdateGeometryInfo(ClientData clientData);
+static void UpdateSizeHints(TkWindow *winPtr);
+static void UpdateVRootGeometry(WmInfo *wmPtr);
+static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmColormapwindowsCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmOverrideredirectCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr);
+static int WmWinStyle(Tcl_Interp *interp, TkWindow *winPtr,
+ int objc, Tcl_Obj *const objv[]);
+static void ApplyWindowAttributeFlagChanges(TkWindow *winPtr,
+ NSWindow *macWindow, UInt64 oldAttributes,
+ int oldFlags, int create, int initial);
+static void ApplyMasterOverrideChanges(TkWindow *winPtr,
+ NSWindow *macWindow);
+static void GetMinSize(TkWindow *winPtr, int *minWidthPtr,
+ int *minHeightPtr);
+static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr,
+ int *maxHeightPtr);
+static void RemapWindows(TkWindow *winPtr,
+ MacDrawable *parentWin);
+
+#pragma mark TKWindow(TKWm)
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+@interface NSWindow(TkWm)
+- (void) setCanCycle: (BOOL) canCycleFlag;
+@end
+#endif
+
+@interface NSDrawerWindow : NSWindow
+{
+ id _i1, _i2;
+}
+@end
+
+@implementation TKWindow
+@end
+
+@implementation TKWindow(TKWm)
+- (BOOL) canBecomeKeyWindow
+{
+ TkWindow *winPtr = TkMacOSXGetTkWindow(self);
+
+ return (winPtr && winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass ==
+ kHelpWindowClass || winPtr->wmInfoPtr->attributes &
+ kWindowNoActivatesAttribute)) ? NO : YES;
+}
+@end
+
+#pragma mark -
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetWindowSizeLimits --
+ *
+ * Sets NSWindow size limits
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+SetWindowSizeLimits(
+ TkWindow *winPtr)
+{
+ NSWindow *macWindow = TkMacOSXDrawableWindow(winPtr->window);
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int minWidth, minHeight, maxWidth, maxHeight, base;
+
+ if (!macWindow) {
+ return;
+ }
+ GetMinSize(winPtr, &minWidth, &minHeight);
+ GetMaxSize(winPtr, &maxWidth, &maxHeight);
+ if (wmPtr->gridWin) {
+ base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
+ if (base < 0) {
+ base = 0;
+ }
+ minWidth = base + (minWidth * wmPtr->widthInc);
+ maxWidth = base + (maxWidth * wmPtr->widthInc);
+ base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
+ if (base < 0) {
+ base = 0;
+ }
+ minHeight = base + (minHeight * wmPtr->heightInc);
+ maxHeight = base + (maxHeight * wmPtr->heightInc);
+ }
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ minWidth = maxWidth = wmPtr->configWidth;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ minHeight = maxHeight = wmPtr->configHeight;
+ }
+ if (wmPtr->gridWin) {
+ [macWindow setResizeIncrements:NSMakeSize(wmPtr->widthInc,
+ wmPtr->heightInc)];
+ } else if (wmPtr->sizeHintsFlags & PAspect && wmPtr->minAspect.x ==
+ wmPtr->maxAspect.x && wmPtr->minAspect.y == wmPtr->maxAspect.y) {
+ NSSize aspect = NSMakeSize(wmPtr->minAspect.x, wmPtr->minAspect.y);
+ CGFloat ratio = aspect.width/aspect.height;
+ [macWindow setContentAspectRatio:aspect];
+ if ((CGFloat)minWidth/(CGFloat)minHeight > ratio) {
+ minHeight = lround(minWidth / ratio);
+ } else {
+ minWidth = lround(minHeight * ratio);
+ }
+ if ((CGFloat)maxWidth/(CGFloat)maxHeight > ratio) {
+ maxWidth = lround(maxHeight * ratio);
+ } else {
+ maxHeight = lround(maxWidth / ratio);
+ }
+ if ((CGFloat)wmPtr->configWidth/(CGFloat)wmPtr->configHeight > ratio) {
+ wmPtr->configWidth = lround(wmPtr->configHeight * ratio);
+ if (wmPtr->configWidth < minWidth) {
+ wmPtr->configWidth = minWidth;
+ wmPtr->configHeight = minHeight;
+ }
+ } else {
+ wmPtr->configHeight = lround(wmPtr->configWidth / ratio);
+ if (wmPtr->configHeight < minHeight) {
+ wmPtr->configWidth = minWidth;
+ wmPtr->configHeight = minHeight;
+ }
+ }
+ } else {
+ [macWindow setResizeIncrements:NSMakeSize(1.0, 1.0)];
+ }
+ [macWindow setContentMinSize:NSMakeSize(minWidth, minHeight)];
+ [macWindow setContentMaxSize:NSMakeSize(maxWidth, maxHeight)];
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FrontWindowAtPoint --
+ *
+ * Find frontmost toplevel window at a given screen location.
+ *
+ * Results:
+ * TkWindow*.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static TkWindow*
+FrontWindowAtPoint(
+ int x, int y)
+{
+
+ NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y);
+ NSWindow *win = nil;
+ NSInteger windowCount;
+ NSInteger *windowNumbers;
+
+ NSCountWindows(&windowCount);
+ if (windowCount) {
+ windowNumbers = ckalloc(windowCount * sizeof(NSInteger));
+ NSWindowList(windowCount, windowNumbers);
+ for (NSInteger index = 0; index < windowCount; index++) {
+ NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]];
+ if (w && NSMouseInRect(p, [w frame], NO)) {
+ win = w;
+ break;
+ }
+ }
+ ckfree(windowNumbers);
+ }
+ return (win ? TkMacOSXGetTkWindow(win) : NULL);
+}
+
/*
*----------------------------------------------------------------------
@@ -193,7 +502,7 @@ void
TkWmNewWindow(
TkWindow *winPtr) /* Newly-created top-level window. */
{
- WmInfo *wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+ WmInfo *wmPtr = ckalloc(sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
@@ -243,15 +552,16 @@ TkWmNewWindow(
wmPtr->cmdArgv = NULL;
wmPtr->clientMachine = NULL;
wmPtr->flags = WM_NEVER_MAPPED;
- wmPtr->style = -1;
wmPtr->macClass = kDocumentWindowClass;
- wmPtr->attributes = kWindowStandardDocumentAttributes
- | kWindowLiveResizeAttribute;
+ wmPtr->attributes = macClassAttrs[kDocumentWindowClass].defaultAttrs;
wmPtr->scrollWinPtr = NULL;
+ wmPtr->menuPtr = NULL;
+ wmPtr->window = nil;
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.
@@ -299,8 +609,6 @@ TkWmMapWindow(
WmInfo *wmPtr = winPtr->wmInfoPtr;
if (wmPtr->flags & WM_NEVER_MAPPED) {
- wmPtr->flags &= ~WM_NEVER_MAPPED;
-
/*
* Create the underlying Mac window for this Tk window.
*/
@@ -309,9 +617,12 @@ TkWmMapWindow(
TkMacOSXMakeRealWindowExist(winPtr);
}
+ wmPtr->flags &= ~WM_NEVER_MAPPED;
+
/*
* Generate configure event when we first map the window.
*/
+
TkGenWMConfigureEvent((Tk_Window) winPtr, wmPtr->x, wmPtr->y, -1, -1,
TK_LOCATION_CHANGED);
@@ -412,8 +723,7 @@ void
TkWmDeadWindow(
TkWindow *winPtr) /* Top-level window that's being deleted. */
{
- WmInfo *wmPtr = winPtr->wmInfoPtr;
- WmInfo *wmPtr2;
+ WmInfo *wmPtr = winPtr->wmInfoPtr, *wmPtr2;
if (wmPtr == NULL) {
return;
@@ -450,15 +760,34 @@ TkWmDeadWindow(
Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
if (wmPtr->flags & WM_UPDATE_PENDING) {
Tk_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- ckfree((char *) wmPtr);
+
+ /*
+ * Delete the Mac window and remove it from the windowTable. The window
+ * could be nil 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.
+ */
+
+ NSWindow *window = wmPtr->window;
+ if (window && !Tk_IsEmbedded(winPtr) ) {
+ [[window parentWindow] removeChildWindow:window];
+ [window close];
+ TkMacOSXUnregisterMacWindow(window);
+ if (winPtr->window) {
+ ((MacDrawable *)winPtr->window)->view = nil;
+ }
+ TkMacOSXMakeCollectableAndRelease(wmPtr->window);
+ }
+
+ ckfree(wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -514,7 +843,7 @@ Tk_WmObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
"command", "deiconify", "focusmodel", "forget",
"frame", "geometry", "grid", "group",
@@ -737,7 +1066,7 @@ WmAspectCmd(
static int
WmSetAttribute(
TkWindow *winPtr, /* Toplevel to work with */
- WindowRef macWindow,
+ NSWindow *macWindow,
Tcl_Interp *interp, /* Current interpreter */
WmAttribute attribute, /* Code of attribute to set */
Tcl_Obj *value) /* New value */
@@ -762,7 +1091,7 @@ WmSetAttribute(
} else if (dval > 1.0) {
dval = 1.0;
}
- ChkErr(SetWindowAlpha, macWindow, dval);
+ [macWindow setAlphaValue:dval];
break;
}
case WMATT_FULLSCREEN:
@@ -780,8 +1109,8 @@ WmSetAttribute(
if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
return TCL_ERROR;
}
- if (boolean != IsWindowModified(macWindow)) {
- ChkErr(SetWindowModified, macWindow, boolean);
+ if (boolean != [macWindow isDocumentEdited]) {
+ [macWindow setDocumentEdited:boolean];
}
break;
case WMATT_NOTIFY:
@@ -789,54 +1118,26 @@ WmSetAttribute(
return TCL_ERROR;
}
if (boolean == !tkMacOSXWmAttrNotifyVal) {
- static NMRec notifyRec;
+ static NSInteger request = -1;
+ if (request >= 0) {
+ [NSApp cancelUserAttentionRequest:request];
+ request = -1;
+ }
if (boolean) {
- bzero(&notifyRec, sizeof(notifyRec));
- notifyRec.qType = nmType;
- notifyRec.nmMark = 1;
- ChkErr(NMInstall, &notifyRec);
- } else {
- ChkErr(NMRemove, &notifyRec);
+ request = [NSApp requestUserAttention:NSCriticalRequest];
}
tkMacOSXWmAttrNotifyVal = boolean;
}
break;
case WMATT_TITLEPATH: {
const char *path = Tcl_FSGetNativePath(value);
- OSStatus err;
+ NSString *filename = @"";
if (path && *path) {
- FSRef ref;
- Boolean d;
-
- err = ChkErr(FSPathMakeRef, (const unsigned char*)path, &ref, &d);
- if (err == noErr) {
- TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
- err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref);
- ) TK_ELSE_MAC_OS_X (4,
- AliasHandle alias;
-
- err = ChkErr(FSNewAlias, NULL, &ref, &alias);
- if (err == noErr) {
- err = ChkErr(SetWindowProxyAlias, macWindow, alias);
- DisposeHandle((Handle) alias);
- }
- ) TK_ENDIF
- }
- } else {
- int len;
-
- Tcl_GetStringFromObj(value, &len);
- if (!len) {
- err = ChkErr(RemoveWindowProxy, macWindow);
- } else {
- err = fnfErr;
- }
- }
- if (err != noErr) {
- return TCL_ERROR;
+ filename = [NSString stringWithUTF8String:path];
}
+ [macWindow setRepresentedFilename:filename];
break;
}
case WMATT_TOPMOST:
@@ -844,17 +1145,15 @@ WmSetAttribute(
return TCL_ERROR;
}
if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) {
- WindowGroupRef group;
+ int oldFlags = wmPtr->flags;
if (boolean) {
wmPtr->flags |= WM_TOPMOST;
} else {
wmPtr->flags &= ~WM_TOPMOST;
}
- group = WmGetWindowGroup(winPtr);
- if (group && group != GetWindowGroup(macWindow)) {
- ChkErr(SetWindowGroup, macWindow, group);
- }
+ ApplyWindowAttributeFlagChanges(winPtr, macWindow,
+ wmPtr->attributes, oldFlags, 1, 0);
}
break;
case WMATT_TRANSPARENT:
@@ -862,27 +1161,20 @@ WmSetAttribute(
return TCL_ERROR;
}
if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
- WindowAttributes oldAttributes = wmPtr->attributes;
+ UInt64 oldAttributes = wmPtr->attributes;
+ int oldFlags = wmPtr->flags;
if (boolean) {
wmPtr->flags |= WM_TRANSPARENT;
wmPtr->attributes |= kWindowNoShadowAttribute;
- TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures,
- UInt32 features;
-
- ChkErr(GetWindowFeatures, macWindow, &features);
- if (features & kWindowIsOpaque) {
- ChkErr(HIWindowChangeFeatures, macWindow, 0,
- kWindowIsOpaque);
- }
- ) TK_ENDIF
} else {
wmPtr->flags &= ~WM_TRANSPARENT;
wmPtr->attributes &= ~kWindowNoShadowAttribute;
}
- ApplyWindowClassAttributeChanges(winPtr, macWindow,
- wmPtr->macClass, oldAttributes, 1);
- ChkErr(ReshapeCustomWindow, macWindow);
+ ApplyWindowAttributeFlagChanges(winPtr, macWindow, oldAttributes,
+ oldFlags, 1, 0);
+ [macWindow setBackgroundColor:boolean ? [NSColor clearColor] : nil];
+ [macWindow setOpaque:!boolean];
TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
TK_PARENT_WINDOW);
}
@@ -908,54 +1200,29 @@ WmSetAttribute(
static Tcl_Obj *
WmGetAttribute(
TkWindow *winPtr, /* Toplevel to work with */
- WindowRef macWindow,
+ NSWindow *macWindow,
WmAttribute attribute) /* Code of attribute to get */
{
- WmInfo *wmPtr = winPtr->wmInfoPtr;
Tcl_Obj *result = NULL;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
switch (attribute) {
- case WMATT_ALPHA: {
- float fval = 1.0;
-
- ChkErr(GetWindowAlpha, macWindow, &fval);
- result = Tcl_NewDoubleObj(fval);
+ case WMATT_ALPHA:
+ result = Tcl_NewDoubleObj([macWindow alphaValue]);
break;
- }
case WMATT_FULLSCREEN:
result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN);
break;
case WMATT_MODIFIED:
- result = Tcl_NewBooleanObj(IsWindowModified(macWindow));
+ result = Tcl_NewBooleanObj([macWindow isDocumentEdited]);
break;
case WMATT_NOTIFY:
result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal);
break;
- case WMATT_TITLEPATH: {
- FSRef ref;
- UInt8 path[PATH_MAX+1];
- OSStatus err;
-
- TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
- err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref);
- ) TK_ELSE_MAC_OS_X (4,
- Boolean wasChanged;
- AliasHandle alias;
-
- err = ChkErr(GetWindowProxyAlias, macWindow, &alias);
- if (err == noErr) {
- err = ChkErr(FSResolveAlias, NULL, alias, &ref, &wasChanged);
- }
- ) TK_ENDIF
- if (err == noErr) {
- err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX);
- }
- if (err != noErr) {
- *path = 0;
- }
- result = Tcl_NewStringObj((char*) path, -1);
+ case WMATT_TITLEPATH:
+ result = Tcl_NewStringObj([[macWindow representedFilename] UTF8String],
+ -1);
break;
- }
case WMATT_TOPMOST:
result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST);
break;
@@ -995,7 +1262,7 @@ WmAttributesCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
int attribute = 0;
- WindowRef macWindow;
+ NSWindow *macWindow;
if (winPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
@@ -1083,15 +1350,15 @@ WmClientCmd(
argv3 = Tcl_GetStringFromObj(objv[3], &length);
if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
wmPtr->clientMachine = NULL;
}
return TCL_OK;
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
- wmPtr->clientMachine = ckalloc((unsigned) length + 1);
+ wmPtr->clientMachine = ckalloc(length + 1);
strcpy(wmPtr->clientMachine, argv3);
return TCL_OK;
}
@@ -1146,12 +1413,11 @@ WmColormapwindowsCmd(
!= TCL_OK) {
return TCL_ERROR;
}
- cmapList = (TkWindow **) ckalloc((unsigned)
- ((windowObjc+1) * sizeof(TkWindow*)));
+ cmapList = ckalloc((windowObjc+1) * sizeof(TkWindow*));
for (i = 0; i < windowObjc; i++) {
if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
(Tk_Window *) &winPtr2) != TCL_OK) {
- ckfree((char *) cmapList);
+ ckfree(cmapList);
return TCL_ERROR;
}
if (winPtr2 == winPtr) {
@@ -1171,7 +1437,7 @@ WmColormapwindowsCmd(
}
wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
if (wmPtr->cmapList != NULL) {
- ckfree((char *)wmPtr->cmapList);
+ ckfree(wmPtr->cmapList);
}
wmPtr->cmapList = cmapList;
wmPtr->cmapCount = windowObjc;
@@ -1189,8 +1455,8 @@ WmColormapwindowsCmd(
*
* WmCommandCmd --
*
- * This procedure is invoked to process the "wm command" Tcl command.
- * See the user documentation for details on what it does.
+ * 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.
@@ -1220,15 +1486,16 @@ WmCommandCmd(
}
if (objc == 3) {
if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp, Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
- TCL_DYNAMIC);
+ argv3 = Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv);
+ Tcl_SetResult(interp, argv3, TCL_VOLATILE);
+ ckfree(argv3);
}
return TCL_OK;
}
argv3 = Tcl_GetString(objv[3]);
if (argv3[0] == 0) {
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
wmPtr->cmdArgv = NULL;
}
return TCL_OK;
@@ -1237,7 +1504,7 @@ WmCommandCmd(
return TCL_ERROR;
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
wmPtr->cmdArgc = cmdArgc;
wmPtr->cmdArgv = cmdArgv;
@@ -1316,7 +1583,7 @@ WmFocusmodelCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"active", "passive", NULL };
enum options {
OPT_ACTIVE, OPT_PASSIVE };
@@ -1367,43 +1634,30 @@ WmForgetCmd(
TkWindow *winPtr, /* Toplevel or Frame to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
-#if 1
- Tcl_AppendResult(interp, "wm forget is not yet supported", NULL);
- return TCL_ERROR;
-#else
+
register Tk_Window frameWin = (Tk_Window)winPtr;
- char *oldClass = (char*)Tk_Class(frameWin);
if (Tk_IsTopLevel(frameWin)) {
- MacDrawable *macWin = (MacDrawable *) winPtr->window;
- CGrafPtr destPort = TkMacOSXGetDrawablePort(winPtr->window);
-
- TkFocusJoin(winPtr);
- Tk_UnmapWindow(frameWin);
-
- if (destPort != NULL) {
- WindowRef winRef = GetWindowFromPort(destPort);
-
- TkMacOSXUnregisterMacWindow(winRef);
- DisposeWindow(winRef);
- }
- macWin->grafPtr = NULL;
- macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
- macWin->flags &= ~TK_HOST_EXISTS;
+ MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window;
+ TkFocusJoin(winPtr);
+ Tk_UnmapWindow(frameWin);
+ TkWmDeadWindow(macWin);
RemapWindows(winPtr, macWin);
- TkWmDeadWindow(winPtr);
- winPtr->flags &=
- ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+
+ winPtr->flags &=~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+
+ /*
+ * Flags (above) must be cleared before calling TkMapTopFrame (below).
+ */
TkMapTopFrame(frameWin);
} else {
- /* Already not managed by wm - ignore it */
+ /* Already not managed by wm - ignore it */
}
return TCL_OK;
-#endif
}
/*
@@ -1443,7 +1697,7 @@ WmFrameCmd(
if (window == None) {
window = Tk_WindowId((Tk_Window) winPtr);
}
- sprintf(buf, "0x%x", (unsigned int) window);
+ sprintf(buf, "0x%x", (unsigned) window);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_OK;
}
@@ -1658,7 +1912,7 @@ WmGroupCmd(
}
wmPtr->hints.window_group = Tk_WindowId(tkwin2);
wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) (length + 1));
+ wmPtr->leaderName = ckalloc(length + 1);
strcpy(wmPtr->leaderName, argv3);
}
return TCL_OK;
@@ -1737,8 +1991,8 @@ WmIconbitmapCmd(
*
* WmIconifyCmd --
*
- * This procedure is invoked to process the "wm iconify" Tcl command.
- * See the user documentation for details on what it does.
+ * 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.
@@ -1877,19 +2131,20 @@ WmIconnameCmd(
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);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(wmPtr->iconName, -1));
}
+ return TCL_OK;
+ }
+
+ if (wmPtr->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc(length + 1);
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
return TCL_OK;
}
@@ -1900,7 +2155,7 @@ WmIconnameCmd(
* WmIconphotoCmd --
*
* This procedure is invoked to process the "wm iconphoto" Tcl command.
- * See the user documentation for details on what it does. Not yet
+ * See the user documentation for details on what it does. Not yet
* implemented for OS X.
*
* Results:
@@ -2122,12 +2377,9 @@ WmManageCmd(
TkWindow *winPtr, /* Toplevel or Frame to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
-#if 1
- Tcl_AppendResult(interp, "wm manage is not yet supported", NULL);
- return TCL_ERROR;
-#else
+
register Tk_Window frameWin = (Tk_Window)winPtr;
register WmInfo *wmPtr = winPtr->wmInfoPtr;
char *oldClass = (char*)Tk_Class(frameWin);
@@ -2154,7 +2406,6 @@ WmManageCmd(
}
wmPtr = winPtr->wmInfoPtr;
winPtr->flags &= ~TK_MAPPED;
- macWin->grafPtr = NULL;
macWin->toplevel = macWin;
RemapWindows(winPtr, macWin);
winPtr->flags |=
@@ -2164,7 +2415,6 @@ WmManageCmd(
/* Already managed by wm - ignore it */
}
return TCL_OK;
-#endif
}
/*
@@ -2172,8 +2422,8 @@ WmManageCmd(
*
* WmMaxsizeCmd --
*
- * This procedure is invoked to process the "wm maxsize" Tcl command.
- * See the user documentation for details on what it does.
+ * 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.
@@ -2223,8 +2473,8 @@ WmMaxsizeCmd(
*
* WmMinsizeCmd --
*
- * This procedure is invoked to process the "wm minsize" Tcl command.
- * See the user documentation for details on what it does.
+ * 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.
@@ -2302,8 +2552,8 @@ WmOverrideredirectCmd(
return TCL_ERROR;
}
if (objc == 3) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- Tk_Attributes((Tk_Window) winPtr)->override_redirect);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ Tk_Attributes((Tk_Window) winPtr)->override_redirect));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -2320,9 +2570,8 @@ WmOverrideredirectCmd(
*
* WmPositionfromCmd --
*
- * This procedure is invoked to process the "wm positionfrom"
- * Tcl command.
- * See the user documentation for details on what it does.
+ * 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.
@@ -2342,7 +2591,7 @@ WmPositionfromCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
@@ -2462,7 +2711,7 @@ WmProtocolCmd(
}
cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr = ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
@@ -2499,7 +2748,8 @@ WmResizableCmd(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
- WindowAttributes oldAttributes = wmPtr->attributes;
+ UInt64 oldAttributes = wmPtr->attributes;
+ int oldFlags = wmPtr->flags;
if ((objc != 3) && (objc != 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
@@ -2543,8 +2793,7 @@ WmResizableCmd(
wmPtr->scrollWinPtr->instanceData);
}
WmUpdateGeom(wmPtr, winPtr);
- ApplyWindowClassAttributeChanges(winPtr, NULL, wmPtr->macClass,
- oldAttributes, 1);
+ ApplyWindowAttributeFlagChanges(winPtr, NULL, oldAttributes, oldFlags, 1,0);
return TCL_OK;
}
@@ -2574,7 +2823,7 @@ WmSizefromCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
@@ -2639,7 +2888,7 @@ WmStackorderCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
TkWindow **windows, **window_ptr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"isabove", "isbelow", NULL };
enum options {
OPT_ISABOVE, OPT_ISBELOW };
@@ -2659,7 +2908,7 @@ WmStackorderCmd(
for (window_ptr = windows; *window_ptr ; window_ptr++) {
Tcl_AppendElement(interp, (*window_ptr)->pathName);
}
- ckfree((char *) windows);
+ ckfree(windows);
return TCL_OK;
} else {
TkWindow *winPtr2;
@@ -2694,29 +2943,28 @@ WmStackorderCmd(
*/
windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
-
if (windows == NULL) {
Tcl_AppendResult(interp, "TkWmStackorderToplevel failed", 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) {
- Tcl_Panic("winPtr window not found");
+ }
+
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr) {
+ index1 = (window_ptr - windows);
}
- if (index2 == -1) {
- Tcl_Panic("winPtr2 window not found");
+ if (*window_ptr == winPtr2) {
+ index2 = (window_ptr - windows);
}
-
- ckfree((char *) windows);
+ }
+ if (index1 == -1) {
+ Tcl_Panic("winPtr window not found");
+ }
+ if (index2 == -1) {
+ Tcl_Panic("winPtr2 window not found");
}
+ ckfree(windows);
+
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
&index) != TCL_OK) {
return TCL_ERROR;
@@ -2726,7 +2974,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
return TCL_OK;
}
return TCL_OK;
@@ -2758,7 +3006,7 @@ WmStateCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static const char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"normal", "iconic", "withdrawn", "zoomed", NULL };
enum options {
OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED };
@@ -2788,9 +3036,10 @@ WmStateCmd(
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
+ * 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) {
@@ -2809,29 +3058,27 @@ WmStateCmd(
} else { /* OPT_ZOOMED */
TkpWmSetState(winPtr, ZoomState);
}
+ } else if (wmPtr->iconFor != NULL) {
+ Tcl_SetResult(interp, "icon", TCL_STATIC);
} else {
- if (wmPtr->iconFor != NULL) {
- Tcl_SetResult(interp, "icon", TCL_STATIC);
- } else {
- if (wmPtr->hints.initial_state == NormalState ||
- wmPtr->hints.initial_state == ZoomState) {
- wmPtr->hints.initial_state = (TkMacOSXIsWindowZoomed(winPtr) ?
- ZoomState : NormalState);
- }
- 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->hints.initial_state == NormalState ||
+ wmPtr->hints.initial_state == ZoomState) {
+ wmPtr->hints.initial_state = (TkMacOSXIsWindowZoomed(winPtr) ?
+ ZoomState : NormalState);
+ }
+ 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;
@@ -2911,7 +3158,7 @@ WmTransientCmd(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window master;
WmInfo *wmPtr2;
- char *argv3;
+ char *masterWindowName;
int length;
if ((objc != 3) && (objc != 4)) {
@@ -2959,13 +3206,13 @@ WmTransientCmd(
return TCL_ERROR;
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
wmPtr->master = Tk_WindowId(master);
+ masterWindowName = Tcl_GetStringFromObj(objv[3], &length);
if (wmPtr->masterWindowName != NULL) {
ckfree(wmPtr->masterWindowName);
}
- wmPtr->masterWindowName = ckalloc((unsigned) length+1);
- strcpy(wmPtr->masterWindowName, argv3);
+ wmPtr->masterWindowName = ckalloc(length+1);
+ strcpy(wmPtr->masterWindowName, masterWindowName);
}
ApplyMasterOverrideChanges(winPtr, NULL);
return TCL_OK;
@@ -3015,10 +3262,11 @@ WmWithdrawCmd(
* Invoked by those wm subcommands that affect geometry.
* Schedules a geometry update.
*/
+
static void
-WmUpdateGeom(wmPtr, winPtr)
-WmInfo *wmPtr;
-TkWindow *winPtr;
+WmUpdateGeom(
+ WmInfo *wmPtr,
+ TkWindow *winPtr)
{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
@@ -3227,6 +3475,7 @@ TopLevelEventProc(
Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display,
-1, -1, -1, NULL, NULL);
+
Tk_DestroyWindow((Tk_Window) winPtr);
Tk_DeleteErrorHandler(handler);
}
@@ -3301,7 +3550,6 @@ UpdateGeometryInfo(
TkWindow *winPtr = clientData;
WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, min, max;
- unsigned long serial;
wmPtr->flags &= ~WM_UPDATE_PENDING;
@@ -3466,7 +3714,6 @@ UpdateGeometryInfo(
}
return;
}
- serial = NextRequest(winPtr->display);
if (wmPtr->flags & WM_MOVE_PENDING) {
wmPtr->configWidth = width;
wmPtr->configHeight = height;
@@ -3474,9 +3721,10 @@ UpdateGeometryInfo(
TkMacOSXDbgMsg("Moving to %d %d, resizing to %d x %d", x, y,
width, height);
}
+ SetWindowSizeLimits(winPtr);
wmPtr->flags |= WM_SYNC_PENDING;
XMoveResizeWindow(winPtr->display, winPtr->window, x, y,
- (unsigned) width, (unsigned) height);
+ wmPtr->configWidth, wmPtr->configHeight);
wmPtr->flags &= ~WM_SYNC_PENDING;
} else if ((width != wmPtr->configWidth)
|| (height != wmPtr->configHeight)) {
@@ -3485,10 +3733,13 @@ UpdateGeometryInfo(
if (wmTracing) {
TkMacOSXDbgMsg("Resizing to %d x %d\n", width, height);
}
+ SetWindowSizeLimits(winPtr);
wmPtr->flags |= WM_SYNC_PENDING;
- XResizeWindow(winPtr->display, winPtr->window, (unsigned) width,
- (unsigned) height);
+ XResizeWindow(winPtr->display, winPtr->window, wmPtr->configWidth,
+ wmPtr->configHeight);
wmPtr->flags &= ~WM_SYNC_PENDING;
+ } else {
+ SetWindowSizeLimits(winPtr);
}
}
@@ -3699,55 +3950,55 @@ Tk_GetRootCoords(
x += winPtr->changes.x + winPtr->changes.border_width;
y += winPtr->changes.y + winPtr->changes.border_width;
if (winPtr->flags & TK_TOP_LEVEL) {
+ TkWindow *otherPtr;
+
if (!(Tk_IsEmbedded(winPtr))) {
x += winPtr->wmInfoPtr->xInParent;
y += winPtr->wmInfoPtr->yInParent;
break;
- } else {
- TkWindow *otherPtr = TkpGetOtherWindow(winPtr);
-
- if (otherPtr != NULL) {
- /*
- * The container window is in the same application. Query
- * its coordinates.
- */
+ }
- winPtr = otherPtr;
+ otherPtr = TkpGetOtherWindow(winPtr);
+ if (otherPtr == NULL) {
+ if (tkMacOSXEmbedHandler->getOffsetProc != NULL) {
+ Point theOffset;
/*
- * 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...
+ * 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;
+ x -= winPtr->changes.x + winPtr->changes.border_width;
+ y -= winPtr->changes.y + winPtr->changes.border_width;
- } else {
- Point theOffset;
+ tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr,
+ &theOffset);
- if (tkMacOSXEmbedHandler->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 += theOffset.h;
+ y += theOffset.v;
+ }
+ break;
+ }
- x -= winPtr->changes.x + winPtr->changes.border_width;
- y -= winPtr->changes.y + winPtr->changes.border_width;
+ /*
+ * The container window is in the same application. Query its
+ * coordinates.
+ */
- tkMacOSXEmbedHandler->getOffsetProc((Tk_Window) winPtr,
- &theOffset);
+ winPtr = otherPtr;
- x += theOffset.h;
- y += theOffset.v;
- }
- break;
- }
- }
+ /*
+ * 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;
}
winPtr = winPtr->parentPtr;
}
@@ -3785,30 +4036,18 @@ Tk_CoordsToWindow(
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) {
+ winPtr = FrontWindowAtPoint(rootX, rootY);
+ if (!winPtr) {
return NULL;
}
@@ -3840,8 +4079,8 @@ Tk_CoordsToWindow(
bd = childPtr->changes.border_width;
if ((tmpx >= -bd) && (tmpy >= -bd)
- && (tmpx < (childPtr->changes.width + bd))
- && (tmpy < (childPtr->changes.height + bd))) {
+ && (tmpx < (childPtr->changes.width + bd))
+ && (tmpy < (childPtr->changes.height + bd))) {
nextPtr = childPtr;
}
}
@@ -4173,11 +4412,8 @@ TkWmRestackToplevel(
* NULL, then winPtr gets restacked above or
* below *all* siblings. */
{
- WmInfo *wmPtr;
-
- WindowRef macWindow, otherMacWindow, frontWindow, tmpWindow;
-
- wmPtr = winPtr->wmInfoPtr;
+ NSWindow *macWindow;
+ NSInteger otherMacWindowNumber;
/*
* Get the mac window. Make sure it exists & is mapped.
@@ -4208,56 +4444,13 @@ TkWmRestackToplevel(
if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
TkWmMapWindow(otherPtr);
}
- otherMacWindow = TkMacOSXDrawableWindow(otherPtr->window);
- } else {
- otherMacWindow = NULL;
- }
-
- frontWindow = ActiveNonFloatingWindow();
-
- 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 visible 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);
- }
- }
+ otherMacWindowNumber = [TkMacOSXDrawableWindow(otherPtr->window)
+ windowNumber];
} else {
- /*
- * Send behind. If it was in front find another window to make active.
- */
-
- if (macWindow == frontWindow) {
- tmpWindow = GetNextWindow(macWindow);
- if (tmpWindow != NULL) {
- SelectWindow(tmpWindow);
- }
- }
- SendBehind(macWindow, otherMacWindow);
+ otherMacWindowNumber = 0;
}
+ [macWindow orderWindow:(aboveBelow == Above ? NSWindowAbove : NSWindowBelow)
+ relativeTo:otherMacWindowNumber];
}
/*
@@ -4329,7 +4522,7 @@ TkWmAddToColormapWindows(
* add the toplevel itself as the last element of the list.
*/
- newPtr = (TkWindow **) ckalloc((unsigned) (count+2)*sizeof(TkWindow *));
+ newPtr = ckalloc((count+2) * sizeof(TkWindow *));
if (count > 0) {
memcpy(newPtr, oldPtr, count * sizeof(TkWindow *));
}
@@ -4339,7 +4532,7 @@ TkWmAddToColormapWindows(
newPtr[count-1] = winPtr;
newPtr[count] = topPtr;
if (oldPtr != NULL) {
- ckfree((char *) oldPtr);
+ ckfree(oldPtr);
}
topPtr->wmInfoPtr->cmapList = newPtr;
@@ -4459,7 +4652,7 @@ TkGetPointerCoords(
* monitor of the Mac.
*
* Results:
- * The bounds are returned in geometry.
+ * Window bounds.
*
* Side effects:
* None.
@@ -4467,44 +4660,25 @@ TkGetPointerCoords(
*----------------------------------------------------------------------
*/
-static void
+static NSRect
InitialWindowBounds(
TkWindow *winPtr, /* Window to get initial bounds for. */
- WindowRef macWindow,
- Rect *geometry) /* On return the initial bounds. */
+ NSWindow *macWindow)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
if (!(wmPtr->sizeHintsFlags & (USPosition | PPosition))) {
- WindowRef parent;
-
- parent = GetFrontWindowOfClass(wmPtr->macClass, false);
- if (parent && parent == macWindow) {
- parent = GetNextWindowOfClass(parent, wmPtr->macClass, false);
- }
- if (parent && parent != macWindow) {
- Rect bounds;
-
- ChkErr(RepositionWindow, macWindow, parent,
- kWindowCascadeOnParentWindowScreen);
- ChkErr(GetWindowBounds, macWindow, kWindowStructureRgn, &bounds);
- wmPtr->x = bounds.left;
- wmPtr->y = bounds.top;
- } else {
- static SInt16 menuBarHeight = 0;
+ static NSPoint cascadePoint = { .x = 0, .y = 0 };
+ NSRect frame;
- if (!menuBarHeight) {
- ChkErr(GetThemeMenuBarHeight, &menuBarHeight);
- }
- wmPtr->x = 5;
- wmPtr->y = menuBarHeight + 5;
- }
+ cascadePoint = [macWindow cascadeTopLeftFromPoint:cascadePoint];
+ frame = [macWindow frame];
+ wmPtr->x = frame.origin.x;
+ wmPtr->y = tkMacOSXZeroScreenHeight - (frame.origin.y +
+ frame.size.height);
}
-
- geometry->left = wmPtr->x;
- geometry->top = wmPtr->y;
- geometry->right = wmPtr->x + winPtr->changes.width;
- geometry->bottom = wmPtr->y + winPtr->changes.height;
+ return NSMakeRect(wmPtr->x, wmPtr->y, winPtr->changes.width,
+ winPtr->changes.height);
}
/*
@@ -4568,104 +4742,9 @@ TkMacOSXResizable(
int
TkMacOSXGrowToplevel(
- WindowRef whichWindow,
- Point start)
+ void *whichWindow,
+ XPoint start)
{
- Point where = start;
- TkDisplay *dispPtr;
- Rect portRect;
- CGrafPtr destPort = GetWindowPort(whichWindow);
-
- QDGlobalToLocalPoint(destPort, &where);
- GetPortBounds(destPort, &portRect);
- if (where.h > (portRect.right - 16) &&
- where.v > (portRect.bottom - 16)) {
- Window window;
- TkWindow *winPtr;
- WmInfo *wmPtr;
- int minWidth, minHeight, maxWidth, maxHeight;
- Rect limits, bounds, *maxBounds;
- Boolean resizeResult;
-
- window = TkMacOSXGetXWindow(whichWindow);
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
- wmPtr = winPtr->wmInfoPtr;
- maxBounds = (Rect*)(dispPtr->display->screens->ext_data);
-
- if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
- return false;
- }
- GetMinSize(winPtr, &minWidth, &minHeight);
- GetMaxSize(winPtr, &maxWidth, &maxHeight);
- if (wmPtr->gridWin != NULL) {
- int base = winPtr->reqWidth - (wmPtr->reqGridWidth
- * wmPtr->widthInc);
-
- if (base < 0) {
- base = 0;
- }
- limits.left = base + (minWidth * wmPtr->widthInc);
- limits.right = base + (maxWidth * wmPtr->widthInc);
- base = winPtr->reqHeight - (wmPtr->reqGridHeight
- * wmPtr->heightInc);
- if (base < 0) {
- base = 0;
- }
- limits.top = base + (minHeight * wmPtr->heightInc);
- limits.bottom = base + (maxHeight * wmPtr->heightInc);
- } else {
- limits.left = minWidth;
- limits.right = maxWidth;
- limits.top = minHeight;
- limits.bottom = maxHeight;
- }
- if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
- limits.left = limits.right = winPtr->changes.width;
- }
- if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
- limits.top = limits.bottom = winPtr->changes.height;
- }
- if (PtInRect(start, maxBounds)) {
- Rect strBounds, strWidths, limitBounds;
-
- ChkErr(GetWindowBounds, whichWindow, kWindowStructureRgn,
- &strBounds);
- ChkErr(GetWindowStructureWidths, whichWindow, &strWidths);
-
- limitBounds.left = limits.left + (strBounds.left + strWidths.left);
- limitBounds.right = limits.right +
- (strBounds.left + strWidths.left + strWidths.right);
- limitBounds.top = limits.top + (strBounds.top + strWidths.top);
- limitBounds.bottom = limits.bottom +
- (strBounds.top + strWidths.top + strWidths.bottom);
- if (limitBounds.left < maxBounds->left) {
- limitBounds.left = maxBounds->left;
- }
- if (limitBounds.right > maxBounds->right) {
- limitBounds.right = maxBounds->right;
- }
- if (limitBounds.top < maxBounds->top) {
- limitBounds.top = maxBounds->top;
- }
- if (limitBounds.bottom > maxBounds->bottom) {
- limitBounds.bottom = maxBounds->bottom;
- }
- limits.left = limitBounds.left - (strBounds.left + strWidths.left);
- limits.right = limitBounds.right -
- (strBounds.left + strWidths.left + strWidths.right);
- limits.top = limitBounds.top - (strBounds.top + strWidths.top);
- limits.bottom = limitBounds.bottom -
- (strBounds.top + strWidths.top + strWidths.bottom);
- }
- TkMacOSXTrackingLoop(1);
- resizeResult = ResizeWindow(whichWindow, start, &limits, &bounds);
- TkMacOSXTrackingLoop(0);
- if (resizeResult) {
- return true;
- }
- }
return false;
}
@@ -4691,20 +4770,13 @@ TkSetWMName(
TkWindow *winPtr,
Tk_Uid titleUid)
{
- CFStringRef title;
-
if (Tk_IsEmbedded(winPtr)) {
return;
}
- title = CFStringCreateWithBytes(NULL, (const unsigned char *) titleUid,
- strlen(titleUid), kCFStringEncodingUTF8, false);
- if (title) {
- WindowRef macWin = TkMacOSXDrawableWindow(winPtr->window);
-
- SetWindowTitleWithCFString(macWin, title);
- CFRelease(title);
- }
+ NSString *title = [[NSString alloc] initWithUTF8String:titleUid];
+ [TkMacOSXDrawableWindow(winPtr->window) setTitle:title];
+ [title release];
}
/*
@@ -4739,7 +4811,7 @@ TkGetTransientMaster(
*
* TkMacOSXGetXWindow --
*
- * Returns the X window Id associated with the given WindowRef.
+ * Returns the X window Id associated with the given NSWindow*.
*
* Results:
* The window id is returned. None is returned if not a Tk window.
@@ -4752,14 +4824,14 @@ TkGetTransientMaster(
Window
TkMacOSXGetXWindow(
- WindowRef macWinPtr)
+ void *macWinPtr)
{
Tcl_HashEntry *hPtr;
- if ((macWinPtr == NULL) || !windowHashInit) {
+ if (!macWinPtr || !windowHashInit) {
return None;
}
- hPtr = Tcl_FindHashEntry(&windowTable, (char *) macWinPtr);
+ hPtr = Tcl_FindHashEntry(&windowTable, macWinPtr);
if (hPtr == NULL) {
return None;
}
@@ -4769,6 +4841,33 @@ TkMacOSXGetXWindow(
/*
*----------------------------------------------------------------------
*
+ * TkMacOSXGetTkWindow --
+ *
+ * Returns the TkWindow* associated with the given NSWindow*.
+ *
+ * Results:
+ * The TkWindow* returned. NULL is returned if not a Tk window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow*
+TkMacOSXGetTkWindow(
+ NSWindow *w)
+{
+ Window window = TkMacOSXGetXWindow(w);
+ TkDisplay *dispPtr = TkGetDisplayList();
+
+ return (window != None ?
+ (TkWindow *)Tk_IdToWindow(dispPtr->display, window) : NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkMacOSXIsWindowZoomed --
*
* Ask Carbon if the given window is in the zoomed out state. Because
@@ -4788,41 +4887,7 @@ MODULE_SCOPE int
TkMacOSXIsWindowZoomed(
TkWindow *winPtr)
{
- WmInfo *wmPtr = winPtr->wmInfoPtr;
- int maxWidth, maxHeight;
- Point idealSize;
-
- if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
- return false;
- }
- GetMaxSize(winPtr, &maxWidth, &maxHeight);
- if (wmPtr->gridWin != NULL) {
- int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
-
- if (base < 0) {
- base = 0;
- }
- maxWidth = base + (maxWidth * wmPtr->widthInc);
- base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
- if (base < 0) {
- base = 0;
- }
- maxHeight = base + (maxHeight * wmPtr->heightInc);
- }
- if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
- idealSize.h = winPtr->changes.width;
- } else {
- idealSize.h = maxWidth;
- }
- if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
- idealSize.v = winPtr->changes.height;
- } else {
- idealSize.v = maxHeight;
- }
-
- return IsWindowInStandardState(TkMacOSXDrawableWindow(winPtr->window),
- &idealSize, NULL);
+ return [TkMacOSXDrawableWindow(winPtr->window) isZoomed];
}
/*
@@ -4846,61 +4911,30 @@ TkMacOSXIsWindowZoomed(
int
TkMacOSXZoomToplevel(
- WindowRef whichWindow, /* The Macintosh window to zoom. */
+ void *whichWindow, /* The Macintosh window to zoom. */
short zoomPart) /* Either inZoomIn or inZoomOut */
{
- Window window;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
+ NSWindow *window = whichWindow;
+ TkWindow *winPtr = TkMacOSXGetTkWindow(window);
WmInfo *wmPtr;
- Point idealSize;
- int maxWidth, maxHeight;
- OSStatus err;
- window = TkMacOSXGetXWindow(whichWindow);
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ if (!winPtr || !winPtr->wmInfoPtr) {
+ return false;
+ }
wmPtr = winPtr->wmInfoPtr;
-
if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
return false;
}
- GetMaxSize(winPtr, &maxWidth, &maxHeight);
- if (wmPtr->gridWin != NULL) {
- int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
- if (base < 0) {
- base = 0;
- }
- maxWidth = base + (maxWidth * wmPtr->widthInc);
- base = winPtr->reqHeight - (wmPtr->reqGridHeight * wmPtr->heightInc);
- if (base < 0) {
- base = 0;
- }
- maxHeight = base + (maxHeight * wmPtr->heightInc);
- }
- if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
- idealSize.h = winPtr->changes.width;
- } else {
- idealSize.h = maxWidth;
- }
- if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
- idealSize.v = winPtr->changes.height;
- } else {
- idealSize.v = maxHeight;
- }
-
- /* Do nothing if already in desired zoom state */
- if (!IsWindowInStandardState(whichWindow, &idealSize, NULL) ==
- (zoomPart == inZoomIn)) {
- return false;
- }
+ /*
+ * Do nothing if already in desired zoom state.
+ */
- err = ChkErr(ZoomWindowIdeal, whichWindow, zoomPart, &idealSize);
- if (err != noErr) {
+ if (![window isZoomed] == (zoomPart == inZoomIn)) {
return false;
}
+ [window zoom:NSApp];
wmPtr->hints.initial_state =
(zoomPart == inZoomIn ? NormalState : ZoomState);
return true;
@@ -4932,7 +4966,7 @@ TkUnsupported1ObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- static const char *subcmds[] = {
+ static const char *const subcmds[] = {
"style", NULL
};
enum SubCmds {
@@ -4947,6 +4981,62 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
+
+ /* Iterate through objc/objv to set correct background color and toggle opacity of window. */
+ int i;
+ for (i= 0; i < objc; i++) {
+
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*black*") == 1) {
+ colorName = [NSColor blackColor]; // use #000000 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*dark*") == 1) {
+ colorName = [NSColor darkGrayColor]; //use #545454 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*light*") == 1) {
+ colorName = [NSColor lightGrayColor]; //use #ababab in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*white*") == 1) {
+ colorName = [NSColor whiteColor]; //use #ffffff in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "gray*") == 1) {
+ colorName = [NSColor grayColor]; //use #7f7f7f in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*red*") == 1) {
+ colorName = [NSColor redColor]; //use #ff0000 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*green*") == 1) {
+ colorName = [NSColor greenColor]; //use #00ff00 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*blue*") == 1) {
+ colorName = [NSColor blueColor]; //use #0000ff in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*cyan*") == 1) {
+ colorName = [NSColor cyanColor]; //use #00ffff in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*yellow*") == 1) {
+ colorName = [NSColor yellowColor]; //use #ffff00 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*magenta*") == 1) {
+ colorName = [NSColor magentaColor]; //use #ff00ff in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*orange*") == 1) {
+ colorName = [NSColor orangeColor]; //use #ff8000 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*purple*") == 1) {
+ colorName = [NSColor purpleColor]; //use #800080 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*brown*") == 1){
+ colorName = [NSColor brownColor]; //use #996633 in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*clear*") == 1) {
+ colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match
+ }
+ if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*") == 1) {
+ opaqueTag=@"YES";
+ }
+ }
+
+
winPtr = (TkWindow *)
Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
if (winPtr == NULL) {
@@ -4959,8 +5049,8 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
if (((enum SubCmds) index) == TKMWS_STYLE) {
@@ -5001,53 +5091,37 @@ WmWinStyle(
{
struct StrIntMap {
const char *strValue;
- UInt32 intValue;
- };
- static const struct StrIntMap styleMap[] = {
- { "documentProc", documentProc },
- { "noGrowDocProc", documentProc },
- { "dBoxProc", dBoxProc },
- { "plainDBox", plainDBox },
- { "altDBoxProc", altDBoxProc },
- { "movableDBoxProc", movableDBoxProc },
- { "zoomDocProc", zoomDocProc },
- { "zoomNoGrow", zoomNoGrow },
- { "floatProc", floatGrowProc },
- { "floatGrowProc", floatGrowProc },
- { "floatZoomProc", floatZoomGrowProc },
- { "floatZoomGrowProc", floatZoomGrowProc },
- { "floatSideProc", floatSideGrowProc },
- { "floatSideGrowProc", floatSideGrowProc },
- { "floatSideZoomProc", floatSideZoomGrowProc },
- { "floatSideZoomGrowProc", floatSideZoomGrowProc },
- { NULL, 0 }
+ UInt64 intValue;
};
static const struct StrIntMap classMap[] = {
- { "alert", kAlertWindowClass },
- { "moveableAlert", kMovableAlertWindowClass },
- { "modal", kModalWindowClass },
- { "moveableModal", kMovableModalWindowClass },
- { "floating", kFloatingWindowClass },
- { "document", kDocumentWindowClass },
- { "utility", kUtilityWindowClass },
- { "help", kHelpWindowClass },
- { "sheet", kSheetWindowClass },
- { "toolbar", kToolbarWindowClass },
- { "plain", kPlainWindowClass },
- { "overlay", kOverlayWindowClass },
- { "sheetAlert", kSheetAlertWindowClass },
- { "altPlain", kAltPlainWindowClass },
- { "simple", kSimpleWindowClass },
- { "drawer", kDrawerWindowClass },
- { NULL, 0 }
+ { "alert", kAlertWindowClass },
+ { "moveableAlert", kMovableAlertWindowClass },
+ { "modal", kModalWindowClass },
+ { "moveableModal", kMovableModalWindowClass },
+ { "floating", kFloatingWindowClass },
+ { "document", kDocumentWindowClass },
+ { "utility", kUtilityWindowClass },
+ { "help", kHelpWindowClass },
+ { "sheet", kSheetWindowClass },
+ { "toolbar", kToolbarWindowClass },
+ { "plain", kPlainWindowClass },
+ { "overlay", kOverlayWindowClass },
+ { "sheetAlert", kSheetAlertWindowClass },
+ { "altPlain", kAltPlainWindowClass },
+ { "simple", kSimpleWindowClass },
+ { "drawer", kDrawerWindowClass },
+ { NULL }
};
static const struct StrIntMap compositeAttrMap[] = {
- { "none", kWindowNoAttributes },
- { "standardDocument", kWindowStandardDocumentAttributes },
- { "standardFloating", kWindowStandardFloatingAttributes },
- { "fullZoom", kWindowFullZoomAttribute },
- { NULL, 0 }
+ { "none", kWindowNoAttributes },
+ { "standardDocument", kWindowStandardDocumentAttributes },
+ { "standardFloating", kWindowStandardFloatingAttributes },
+ { "fullZoom", kWindowFullZoomAttribute },
+ { NULL }
};
+
+ /* Map window attributes. Color and opacity are mapped to NULL; these are parsed from the objv in TkUnsupported1ObjCmd.*/
+
static const struct StrIntMap attrMap[] = {
{ "closeBox", kWindowCloseBoxAttribute },
{ "horizontalZoom", kWindowHorizontalZoomAttribute },
@@ -5072,107 +5146,120 @@ WmWinStyle(
{ "liveResize", kWindowLiveResizeAttribute },
{ "ignoreClicks", kWindowIgnoreClicksAttribute },
{ "noConstrain", kWindowNoConstrainAttribute },
- { NULL, 0 }
+ { "doesNotHide", tkWindowDoesNotHideAttribute },
+ { "canJoinAllSpaces", tkCanJoinAllSpacesAttribute },
+ { "moveToActiveSpace", tkMoveToActiveSpaceAttribute },
+ { "nonActivating", tkNonactivatingPanelAttribute },
+ { "hud", tkHUDWindowAttribute },
+ { "black", NULL },
+ { "dark", NULL },
+ { "light", NULL },
+ { "gray", NULL },
+ { "red", NULL },
+ { "green", NULL },
+ { "blue", NULL },
+ { "cyan", NULL },
+ { "yellow", NULL },
+ { "magenta", NULL },
+ { "orange", NULL },
+ { "purple", NULL },
+ { "brown", NULL },
+ { "clear", NULL },
+ { "opacity", NULL },
+ { NULL }
};
+
int index, i;
WmInfo *wmPtr = winPtr->wmInfoPtr;
if (objc == 3) {
- if (wmPtr->style != -1) {
- for (i = 0; styleMap[i].strValue != NULL; i++) {
- if (wmPtr->style == (short) styleMap[i].intValue) {
- Tcl_SetObjResult(interp,
- Tcl_NewStringObj(styleMap[i].strValue, -1));
- return TCL_OK;
- }
- }
- Tcl_Panic("invalid style");
- } else {
- Tcl_Obj *attributeList, *newResult = NULL;
- WindowAttributes attributes;
+ Tcl_Obj *attributeList, *newResult = NULL;
+ UInt64 attributes;
- for (i = 0; classMap[i].strValue != NULL; i++) {
- if (wmPtr->macClass == classMap[i].intValue) {
- newResult = Tcl_NewStringObj(classMap[i].strValue, -1);
- break;
- }
- }
- if (newResult == NULL) {
- Tcl_Panic("invalid class");
+ for (i = 0; classMap[i].strValue != NULL; i++) {
+ if (wmPtr->macClass == classMap[i].intValue) {
+ newResult = Tcl_NewStringObj(classMap[i].strValue, -1);
+ break;
}
+ }
+ if (newResult == NULL) {
+ Tcl_Panic("invalid class");
+ }
- attributeList = Tcl_NewListObj(0, NULL);
- attributes = wmPtr->attributes;
- for (i = 0; compositeAttrMap[i].strValue != NULL; i++) {
- UInt32 intValue = compositeAttrMap[i].intValue;
+ attributeList = Tcl_NewListObj(0, NULL);
+ attributes = wmPtr->attributes;
- if (intValue && (attributes & intValue) == intValue) {
- Tcl_ListObjAppendElement(interp, attributeList,
- Tcl_NewStringObj(compositeAttrMap[i].strValue,
- -1));
- attributes &= ~intValue;
- break;
- }
- }
- for (i = 0; attrMap[i].strValue != NULL; i++) {
- if (attributes & attrMap[i].intValue) {
- Tcl_ListObjAppendElement(interp, attributeList,
- Tcl_NewStringObj(attrMap[i].strValue, -1));
- }
+ for (i = 0; compositeAttrMap[i].strValue != NULL; i++) {
+ UInt64 intValue = compositeAttrMap[i].intValue;
+
+ if (intValue && (attributes & intValue) == intValue) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj(compositeAttrMap[i].strValue,
+ -1));
+ attributes &= ~intValue;
+ break;
}
- Tcl_ListObjAppendElement(interp, newResult, attributeList);
- Tcl_SetObjResult(interp, newResult);
}
- } else if (objc == 4) {
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], styleMap,
- sizeof(struct StrIntMap), "style", 0, &index) != TCL_OK) {
- return TCL_ERROR;
+ for (i = 0; attrMap[i].strValue != NULL; i++) {
+ if (attributes & attrMap[i].intValue) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj(attrMap[i].strValue, -1));
+ }
}
- wmPtr->style = styleMap[index].intValue;
- } else if (objc == 5) {
+ Tcl_ListObjAppendElement(interp, newResult, attributeList);
+ Tcl_SetObjResult(interp, newResult);
+ } else {
int attrObjc;
Tcl_Obj **attrObjv = NULL;
- WindowClass oldClass = wmPtr->macClass;
- WindowAttributes oldAttributes = wmPtr->attributes;
+ WindowClass macClass;
+ UInt64 oldAttributes = wmPtr->attributes;
+ int oldFlags = wmPtr->flags;
if (Tcl_GetIndexFromObjStruct(interp, objv[3], classMap,
sizeof(struct StrIntMap), "class", 0, &index) != TCL_OK) {
goto badClassAttrs;
}
- wmPtr->macClass = classMap[index].intValue;
- if (!IsValidWindowClass(wmPtr->macClass)) {
- goto badClassAttrs;
- }
- if (Tcl_ListObjGetElements(interp, objv[4], &attrObjc, &attrObjv)
- != TCL_OK) {
- goto badClassAttrs;
- }
- wmPtr->attributes = kWindowNoAttributes;
- for (i = 0; i < attrObjc; i++) {
- if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
- compositeAttrMap, sizeof(struct StrIntMap),
- "attribute", 0, &index) == TCL_OK) {
- wmPtr->attributes |= compositeAttrMap[index].intValue;
- } else if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
- attrMap, sizeof(struct StrIntMap),
- "attribute", 0, &index) == TCL_OK) {
- Tcl_ResetResult(interp);
- wmPtr->attributes |= attrMap[index].intValue;
- } else {
+ macClass = classMap[index].intValue;
+ if (objc == 5) {
+ if (Tcl_ListObjGetElements(interp, objv[4], &attrObjc, &attrObjv)
+ != TCL_OK) {
goto badClassAttrs;
}
+ wmPtr->attributes = kWindowNoAttributes;
+ for (i = 0; i < attrObjc; i++) {
+ if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
+ compositeAttrMap, sizeof(struct StrIntMap),
+ "attribute", 0, &index) == TCL_OK) {
+ wmPtr->attributes |= compositeAttrMap[index].intValue;
+ } else if (Tcl_GetIndexFromObjStruct(interp, attrObjv[i],
+ attrMap, sizeof(struct StrIntMap),
+ "attribute", 0, &index) == TCL_OK) {
+ Tcl_ResetResult(interp);
+ wmPtr->attributes |= attrMap[index].intValue;
+ } else {
+ goto badClassAttrs;
+ }
+ }
+ } else {
+ wmPtr->attributes = macClassAttrs[macClass].defaultAttrs;
}
- ApplyWindowClassAttributeChanges(winPtr, NULL, oldClass, oldAttributes,
- 0);
- wmPtr->style = -1;
+ wmPtr->attributes &= (tkAlwaysValidAttributes |
+ macClassAttrs[macClass].validAttrs);
+ wmPtr->flags |= macClassAttrs[macClass].flags;
+ wmPtr->macClass = macClass;
+
+ ApplyWindowAttributeFlagChanges(winPtr, NULL, oldAttributes, oldFlags,
+ 0, 1);
+
return TCL_OK;
badClassAttrs:
- wmPtr->macClass = oldClass;
wmPtr->attributes = oldAttributes;
return TCL_ERROR;
}
+
+
return TCL_OK;
}
@@ -5236,13 +5323,7 @@ TkMacOSXMakeRealWindowExist(
TkWindow *winPtr) /* Tk window. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- WindowRef newWindow = NULL;
- ControlRef rootControl = NULL;
MacDrawable *macWin;
- Rect initialBounds = {42, 0, 43, 1}, geometry, strWidths;
- short structureW, structureH;
- TkMacOSXWindowList *listPtr;
- OSStatus err;
if (TkMacOSXHostToplevelExists(winPtr)) {
return;
@@ -5269,8 +5350,8 @@ TkMacOSXMakeRealWindowExist(
Tcl_Panic("TkMacOSXMakeRealWindowExist could not find container");
}
if (tkMacOSXEmbedHandler->containerExistProc &&
- tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr) !=
- TCL_OK) {
+ tkMacOSXEmbedHandler->containerExistProc((Tk_Window) winPtr)
+ != TCL_OK) {
Tcl_Panic("ContainerExistProc could not make container");
}
return;
@@ -5280,89 +5361,86 @@ TkMacOSXMakeRealWindowExist(
*/
}
- if (wmPtr->style == -1) {
- if (!IsValidWindowClass(wmPtr->macClass)) {
- TkMacOSXDbgMsg("Invalid window class: %ld", wmPtr->macClass);
- wmPtr->macClass = kPlainWindowClass;
- }
- wmPtr->attributes = (wmPtr->attributes | kWindowAsyncDragAttribute) &
- GetAvailableWindowAttributes(wmPtr->macClass);
- err = ChkErr(CreateNewWindow, wmPtr->macClass, wmPtr->attributes,
- &initialBounds, &newWindow);
- if (err != noErr) {
- newWindow = NULL;
- }
- } else {
- TkMacOSXDbgMsg("Window creation via NewCWindow API is deprecated, "
- "use a window class instead of style %d", wmPtr->style);
- newWindow = NewCWindow(NULL, &initialBounds, "\p", false,
- wmPtr->style, (WindowRef) -1, true, 0);
- }
-
- if (newWindow == NULL) {
+ WindowClass macClass = wmPtr->macClass;
+ wmPtr->attributes &= (tkAlwaysValidAttributes |
+ macClassAttrs[macClass].validAttrs);
+ wmPtr->flags |= macClassAttrs[macClass].flags |
+ ((wmPtr->attributes & kWindowResizableAttribute) ? 0 :
+ WM_WIDTH_NOT_RESIZABLE|WM_HEIGHT_NOT_RESIZABLE);
+ UInt64 attributes = (wmPtr->attributes &
+ ~macClassAttrs[macClass].forceOffAttrs) |
+ macClassAttrs[macClass].forceOnAttrs;
+ NSUInteger styleMask = macClassAttrs[macClass].styleMask |
+ ((attributes & kWindowNoTitleBarAttribute) ? 0 : NSTitledWindowMask) |
+ ((attributes & kWindowCloseBoxAttribute) ? NSClosableWindowMask : 0) |
+ ((attributes & kWindowCollapseBoxAttribute) ?
+ NSMiniaturizableWindowMask : 0) |
+ ((attributes & kWindowResizableAttribute) ? NSResizableWindowMask : 0) |
+ ((attributes & kWindowMetalAttribute) ?
+ NSTexturedBackgroundWindowMask : 0) |
+ ((attributes & kWindowUnifiedTitleAndToolbarAttribute) ?
+ NSUnifiedTitleAndToolbarWindowMask : 0) |
+ ((attributes & kWindowSideTitlebarAttribute) ? 1 << 9 : 0) |
+ (attributes >> WM_NSMASK_SHIFT);
+ Class winClass = (macClass == kDrawerWindowClass ? [NSDrawerWindow class] :
+ (styleMask & (NSUtilityWindowMask|NSDocModalWindowMask|
+ NSNonactivatingPanelMask|NSHUDWindowMask)) ? [NSPanel class] :
+ [TKWindow class]);
+ NSRect structureRect = [winClass frameRectForContentRect:NSZeroRect
+ styleMask:styleMask];
+ NSRect contentRect = NSMakeRect(5 - structureRect.origin.x,
+ tkMacOSXZeroScreenHeight - (tkMacOSXZeroScreenTop + 5 +
+ structureRect.origin.y + structureRect.size.height + 200), 200, 200);
+ NSWindow *window = [[winClass alloc] initWithContentRect:contentRect
+ styleMask:styleMask backing:NSBackingStoreBuffered defer:YES];
+ if (!window) {
Tcl_Panic("couldn't allocate new Mac window");
}
-
- ChkErr(GetWindowStructureWidths, newWindow, &strWidths);
- if (wmPtr->macClass == kFloatingWindowClass) {
- /*
- * Workaround GetWindowStructureWidths() Carbon bug:
+ TkMacOSXMakeUncollectable(window);
+ TKContentView *contentView = [[TKContentView alloc]
+ initWithFrame:NSZeroRect];
+ [window setContentView:contentView];
+ [contentView release];
+ [window setDelegate:NSApp];
+ [window setAcceptsMouseMovedEvents:YES];
+ [window setReleasedWhenClosed:NO];
+ [window setAutodisplay:NO];
+ if (styleMask & NSUtilityWindowMask) {
+ [(NSPanel*)window setFloatingPanel:YES];
+ }
+ if ((styleMask & (NSTexturedBackgroundWindowMask|NSHUDWindowMask)) &&
+ !(styleMask & NSDocModalWindowMask)) {
+ /*
+ * Workaround for [Bug 2824538]: Texured windows are draggable
+ * from opaque content.
*/
-
- strWidths.top = 16;
- }
- wmPtr->xInParent = strWidths.left;
- wmPtr->yInParent = strWidths.top;
- structureW = strWidths.left + strWidths.right;
- structureH = strWidths.top + strWidths.bottom;
- wmPtr->parentWidth = winPtr->changes.width + structureW;
- wmPtr->parentHeight = winPtr->changes.height + structureH;
- InitialWindowBounds(winPtr, newWindow, &geometry);
- geometry.right += structureW;
- geometry.bottom += structureH;
- ChkErr(SetWindowBounds, newWindow, kWindowStructureRgn, &geometry);
-
- TkMacOSXInstallWindowCarbonEventHandler(NULL, newWindow);
- if (ChkErr(CreateRootControl, newWindow, &rootControl) != noErr ) {
- Tcl_Panic("couldn't create root control for new Mac window");
- }
- if (wmPtr->attributes & kWindowResizableAttribute) {
- HIViewRef growBoxView;
-
- err = HIViewFindByID(HIViewGetRoot(newWindow),
- kHIViewWindowGrowBoxID, &growBoxView);
- if (err == noErr && !HIGrowBoxViewIsTransparent(growBoxView)) {
- ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true);
- }
- }
-
- /*
- * 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;
-
- if (wmPtr->master != None || winPtr->atts.override_redirect) {
- ApplyMasterOverrideChanges(winPtr, newWindow);
- }
- SetWindowModified(newWindow, false);
- TkMacOSXRegisterOffScreenWindow((Window) macWin, (GWorldPtr) newWindow);
+ [window setMovableByWindowBackground:NO];
+ }
+
+
+ /* Set background color and opacity of window if those flags are set. */
+ if (colorName != NULL) {
+ [window setBackgroundColor: colorName];
+ }
+
+ if (opaqueTag != NULL) {
+ [window setOpaque: opaqueTag];
+ }
+
+ [window setDocumentEdited:NO];
+ wmPtr->window = window;
+ macWin->view = contentView;
+ TkMacOSXApplyWindowAttributes(winPtr, window);
+
+ NSRect geometry = InitialWindowBounds(winPtr, window);
+ geometry.size.width += structureRect.size.width;
+ geometry.size.height += structureRect.size.height;
+ geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y +
+ geometry.size.height);
+ [window setFrame:geometry display:NO];
+
+ TkMacOSXRegisterOffScreenWindow((Window) macWin, window);
macWin->flags |= TK_HOST_EXISTS;
- ChkErr(GetWindowClass, newWindow, &(wmPtr->macClass));
- ChkErr(GetWindowAttributes, newWindow, &(wmPtr->attributes));
-
-#ifdef TK_MAC_DEBUG_WINDOWS
- TkMacOSXInitNamedDebugSymbol(HIToolbox, void, DebugPrintWindow, WindowRef);
- if (DebugPrintWindow) {
- DebugPrintWindow(newWindow);
- }
-#endif /* TK_MAC_DEBUG_WINDOWS */
}
/*
@@ -5385,7 +5463,7 @@ TkMacOSXMakeRealWindowExist(
void
TkMacOSXRegisterOffScreenWindow(
Window window, /* Window structure. */
- GWorldPtr portPtr) /* Pointer to a Mac GWorld. */
+ void *portPtr) /* Pointer to a Mac Window. */
{
Tcl_HashEntry *valueHashPtr;
int isNew;
@@ -5420,16 +5498,16 @@ TkMacOSXRegisterOffScreenWindow(
void
TkMacOSXUnregisterMacWindow(
- WindowRef macWinPtr) /* Reference to a Mac Window */
+ void *macWinPtr) /* Reference to a Mac Window */
{
Tcl_HashEntry *entryPtr;
if (!windowHashInit) {
Tcl_Panic("TkMacOSXUnregisterMacWindow: unmapping before inited");
}
- entryPtr = Tcl_FindHashEntry(&windowTable,(char *) macWinPtr);
+ entryPtr = Tcl_FindHashEntry(&windowTable, macWinPtr);
if (!entryPtr) {
- TkMacOSXDbgMsg("Failed to find window %08x", (int) macWinPtr);
+ TkMacOSXDbgMsg("Failed to find window %p", macWinPtr);
} else {
Tcl_DeleteHashEntry(entryPtr);
}
@@ -5554,7 +5632,7 @@ TkpWmSetState(
* or WithdrawnState. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- WindowRef macWin;
+ NSWindow *macWin;
wmPtr->hints.initial_state = state;
if (wmPtr->flags & WM_NEVER_MAPPED) {
@@ -5571,22 +5649,19 @@ TkpWmSetState(
* the window we also collapse it.
*/
- if (IsWindowCollapsable(macWin) && !IsWindowCollapsed(macWin)) {
- CollapseWindow(macWin, true);
+ if (macWin && ([macWin styleMask] & NSMiniaturizableWindowMask) &&
+ ![macWin isMiniaturized]) {
+ [macWin miniaturize:NSApp];
}
Tk_UnmapWindow((Tk_Window) winPtr);
- } else if (state == NormalState) {
- Tk_MapWindow((Tk_Window) winPtr);
- if (IsWindowCollapsable(macWin) && IsWindowCollapsed(macWin)) {
- CollapseWindow(macWin, false);
- }
- TkMacOSXZoomToplevel(macWin, inZoomIn);
- } else if (state == ZoomState) {
+ } else if (state == NormalState || state == ZoomState) {
Tk_MapWindow((Tk_Window) winPtr);
- if (IsWindowCollapsable(macWin) && IsWindowCollapsed(macWin)) {
- CollapseWindow(macWin, false);
+ if (macWin && ([macWin styleMask] & NSMiniaturizableWindowMask) &&
+ [macWin isMiniaturized]) {
+ [macWin deminiaturize:NSApp];
}
- TkMacOSXZoomToplevel(macWin, inZoomOut);
+ TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn :
+ inZoomOut);
}
}
@@ -5608,16 +5683,9 @@ TkpWmSetState(
int
TkpIsWindowFloating(
- WindowRef wRef)
+ void *wRef)
{
- WindowClass class;
-
- if (wRef == NULL) {
- return 0;
- }
-
- GetWindowClass(wRef, &class);
- return (class == kFloatingWindowClass);
+ return [(NSWindow *)wRef level] == kCGFloatingWindowLevel;
}
/*
@@ -5663,19 +5731,19 @@ TkMacOSXWindowClass(
void
TkMacOSXWindowOffset(
- WindowRef wRef,
+ void *wRef,
int *xOffset,
int *yOffset)
{
- Window window;
- TkDisplay *dispPtr;
- TkWindow *winPtr;
+ TkWindow *winPtr = TkMacOSXGetTkWindow(wRef);
- window = TkMacOSXGetXWindow(wRef);
- dispPtr = TkGetDisplayList();
- winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
- *xOffset = winPtr->wmInfoPtr->xInParent;
- *yOffset = winPtr->wmInfoPtr->yInParent;
+ if (winPtr && winPtr->wmInfoPtr) {
+ *xOffset = winPtr->wmInfoPtr->xInParent;
+ *yOffset = winPtr->wmInfoPtr->yInParent;
+ } else {
+ *xOffset = 0;
+ *yOffset = 0;
+ }
}
/*
@@ -5807,15 +5875,12 @@ WmStackorderToplevelWrapperMap(
{
TkWindow *childPtr;
Tcl_HashEntry *hPtr;
- WindowRef macWindow;
int newEntry;
if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr)
&& (winPtr->display == display)) {
- macWindow = TkMacOSXDrawableWindow(winPtr->window);
-
hPtr = Tcl_CreateHashEntry(table,
- (const char *) macWindow, &newEntry);
+ (char*) TkMacOSXDrawableWindow(winPtr->window), &newEntry);
Tcl_SetHashValue(hPtr, winPtr);
}
@@ -5846,11 +5911,12 @@ TkWindow **
TkWmStackorderToplevel(
TkWindow *parentPtr) /* Parent toplevel window. */
{
- WindowRef frontWindow;
TkWindow *childWinPtr, **windows, **window_ptr;
Tcl_HashTable table;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
+ NSInteger windowCount;
+ NSInteger *windowNumbers;
/*
* Map mac windows to a TkWindow of the wrapped toplevel.
@@ -5859,8 +5925,7 @@ TkWmStackorderToplevel(
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
WmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
- windows = (TkWindow **)
- ckalloc((table.numEntries+1) * sizeof(TkWindow *));
+ windows = ckalloc((table.numEntries+1) * sizeof(TkWindow *));
/*
* Special cases: If zero or one toplevels were mapped there is no need to
@@ -5878,25 +5943,31 @@ TkWmStackorderToplevel(
goto done;
}
- frontWindow = GetFrontWindowOfClass(kAllWindowClasses, false);
- if (frontWindow == NULL) {
- ckfree((char *) windows);
+ NSCountWindows(&windowCount);
+ if (!windowCount) {
+ ckfree(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;
+ windowNumbers = ckalloc(windowCount * sizeof(NSInteger));
+ NSWindowList(windowCount, windowNumbers);
+ for (NSInteger index = 0; index < windowCount; index++) {
+ NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]];
+
+ if (w) {
+ hPtr = Tcl_FindHashEntry(&table, (char*) w);
+ if (hPtr != NULL) {
+ childWinPtr = Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
+ }
}
- frontWindow = GetNextWindow(frontWindow);
}
if (window_ptr != (windows-1)) {
Tcl_Panic("num matched toplevel windows does not equal num "
"children");
}
+ ckfree(windowNumbers);
}
done:
@@ -5907,9 +5978,9 @@ TkWmStackorderToplevel(
/*
*----------------------------------------------------------------------
*
- * ApplyWindowClassAttributeChanges --
+ * TkMacOSXApplyWindowAttributes --
*
- * This procedure applies carbon window class and attribute changes.
+ * This procedure applies all window attributes to the NSWindow.
*
* Results:
* None.
@@ -5920,21 +5991,49 @@ TkWmStackorderToplevel(
*----------------------------------------------------------------------
*/
-static void
-ApplyWindowClassAttributeChanges(
+void
+TkMacOSXApplyWindowAttributes(
TkWindow *winPtr,
- WindowRef macWindow,
- WindowClass oldClass,
- WindowAttributes oldAttributes,
- int create)
+ NSWindow *macWindow)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- WindowAttributes newAttributes = wmPtr->attributes |
- kWindowAsyncDragAttribute;
+ ApplyWindowAttributeFlagChanges(winPtr, macWindow, 0, 0, 0, 1);
+ if (wmPtr->master != None || winPtr->atts.override_redirect) {
+ ApplyMasterOverrideChanges(winPtr, macWindow);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ApplyWindowAttributeFlagChanges --
+ *
+ * This procedure applies window attribute and flag changes.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
- if (wmPtr->macClass != oldClass || newAttributes != oldAttributes) {
- Rect strWidths;
+static void
+ApplyWindowAttributeFlagChanges(
+ TkWindow *winPtr,
+ NSWindow *macWindow,
+ UInt64 oldAttributes,
+ int oldFlags,
+ int create,
+ int initial)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ UInt64 newAttributes = ForceAttributes(wmPtr->attributes, wmPtr->macClass);
+ UInt64 changedAttributes = newAttributes ^ ForceAttributes(oldAttributes,
+ wmPtr->macClass);
+ if (changedAttributes || wmPtr->flags != oldFlags || initial) {
if (!macWindow) {
if (winPtr->window == None) {
if (create) {
@@ -5952,32 +6051,98 @@ ApplyWindowClassAttributeChanges(
}
macWindow = TkMacOSXDrawableWindow(winPtr->window);
}
- if (wmPtr->macClass != oldClass) {
- TK_IF_MAC_OS_X_API (4, HIWindowChangeClass,
- ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass);
- ) TK_ENDIF
- ChkErr(GetWindowClass, macWindow, &(wmPtr->macClass));
- }
- if (newAttributes != oldAttributes) {
- newAttributes &= GetAvailableWindowAttributes(wmPtr->macClass);
- ChkErr(ChangeWindowAttributes, macWindow,
- newAttributes & (newAttributes ^ oldAttributes),
- oldAttributes & (newAttributes ^ oldAttributes));
- }
- ChkErr(GetWindowAttributes, macWindow, &(wmPtr->attributes));
- if ((wmPtr->attributes ^ oldAttributes) & kWindowResizableAttribute) {
- if (wmPtr->attributes & kWindowResizableAttribute) {
- HIViewRef growBoxView;
- OSStatus err = HIViewFindByID(HIViewGetRoot(macWindow),
- kHIViewWindowGrowBoxID, &growBoxView);
-
- if (err == noErr && !HIGrowBoxViewIsTransparent(growBoxView)) {
- ChkErr(HIGrowBoxViewSetTransparent, growBoxView, true);
- }
+ if ((changedAttributes & kWindowCloseBoxAttribute) || initial) {
+ [[macWindow standardWindowButton:NSWindowCloseButton]
+ setEnabled:!!(newAttributes & kWindowCloseBoxAttribute)];
+ }
+ if ((changedAttributes & kWindowCollapseBoxAttribute) || initial) {
+ [[macWindow standardWindowButton:NSWindowMiniaturizeButton]
+ setEnabled:!!(newAttributes & kWindowCollapseBoxAttribute)];
+ }
+ if ((changedAttributes & (kWindowResizableAttribute |
+ kWindowFullZoomAttribute)) || initial) {
+ [macWindow setShowsResizeIndicator:
+ !!(newAttributes & kWindowResizableAttribute)];
+ [[macWindow standardWindowButton:NSWindowZoomButton]
+ setEnabled:(newAttributes & kWindowResizableAttribute) &&
+ (newAttributes & kWindowFullZoomAttribute)];
+ if (newAttributes & kWindowResizableAttribute) {
+ wmPtr->flags &= ~(WM_WIDTH_NOT_RESIZABLE |
+ WM_HEIGHT_NOT_RESIZABLE);
+ } else {
+ wmPtr->flags |= (WM_WIDTH_NOT_RESIZABLE |
+ WM_HEIGHT_NOT_RESIZABLE);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ }
+ if ((changedAttributes & kWindowToolbarButtonAttribute) || initial) {
+ [macWindow setShowsToolbarButton:
+ !!(newAttributes & kWindowToolbarButtonAttribute)];
+ if ((newAttributes & kWindowToolbarButtonAttribute) &&
+ ![macWindow toolbar]) {
+ NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@""];
+ [toolbar setVisible:NO];
+ [macWindow setToolbar:toolbar];
+ [toolbar release];
+ NSCell *toolbarButtonCell = [[macWindow standardWindowButton:
+ NSWindowToolbarButton] cell];
+ [toolbarButtonCell setTarget:[macWindow contentView]];
+ [toolbarButtonCell setAction:@selector(tkToolbarButton:)];
}
- TkMacOSXInvalClipRgns((Tk_Window) winPtr);
- TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
- TK_PARENT_WINDOW);
+ }
+ if ((changedAttributes & kWindowNoShadowAttribute) || initial) {
+ [macWindow setHasShadow:
+ !(newAttributes & kWindowNoShadowAttribute)];
+ }
+ if ((changedAttributes & kWindowHideOnSuspendAttribute) || initial) {
+ [macWindow setHidesOnDeactivate:
+ !!(newAttributes & kWindowHideOnSuspendAttribute)];
+ }
+ if ((changedAttributes & kWindowInWindowMenuAttribute) || initial) {
+ [macWindow setExcludedFromWindowsMenu:
+ !(newAttributes & kWindowInWindowMenuAttribute)];
+ }
+ if ((changedAttributes & kWindowIgnoreClicksAttribute) || initial) {
+ [macWindow setIgnoresMouseEvents:
+ !!(newAttributes & kWindowIgnoreClicksAttribute)];
+ }
+ if ((changedAttributes & tkWindowDoesNotHideAttribute) || initial) {
+ [macWindow setCanHide:
+ !(newAttributes & tkWindowDoesNotHideAttribute)];
+ }
+ if ((changedAttributes & (kWindowDoesNotCycleAttribute |
+ tkCanJoinAllSpacesAttribute | tkMoveToActiveSpaceAttribute)) ||
+ initial) {
+ NSWindowCollectionBehavior b = NSWindowCollectionBehaviorDefault;
+ if (newAttributes & tkCanJoinAllSpacesAttribute) {
+ b |= NSWindowCollectionBehaviorCanJoinAllSpaces;
+ } else if (newAttributes & tkMoveToActiveSpaceAttribute) {
+ b |= NSWindowCollectionBehaviorMoveToActiveSpace;
+ }
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+ if (newAttributes & kWindowDoesNotCycleAttribute) {
+ b |= NSWindowCollectionBehaviorIgnoresCycle;
+ } else {
+ b |= NSWindowCollectionBehaviorParticipatesInCycle;
+ }
+#endif
+ [macWindow setCollectionBehavior:b];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ if (((changedAttributes & kWindowDoesNotCycleAttribute) || initial)
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+ && tkMacOSXMacOSXVersion < 1060
+#endif
+ ) {
+ [macWindow setCanCycle:
+ !(newAttributes & kWindowDoesNotCycleAttribute)];
+ }
+#endif
+ }
+ if ((wmPtr->flags & WM_TOPMOST) != (oldFlags & WM_TOPMOST)) {
+ [macWindow setLevel:(wmPtr->flags & WM_TOPMOST) ?
+ kCGUtilityWindowLevel : ([macWindow isKindOfClass:
+ [NSPanel class]] && [macWindow isFloatingPanel] ?
+ kCGFloatingWindowLevel : kCGNormalWindowLevel)];
}
/*
@@ -5985,13 +6150,11 @@ ApplyWindowClassAttributeChanges(
* structure widths:
*/
- GetWindowStructureWidths(macWindow, &strWidths);
- wmPtr->xInParent = strWidths.left;
- wmPtr->yInParent = strWidths.top;
- wmPtr->parentWidth = winPtr->changes.width + strWidths.left
- + strWidths.right;
- wmPtr->parentHeight = winPtr->changes.height + strWidths.top
- + strWidths.bottom;
+ NSRect structureRect = [macWindow frameRectForContentRect:NSZeroRect];
+ wmPtr->xInParent = -structureRect.origin.x;
+ wmPtr->yInParent = structureRect.origin.y + structureRect.size.height;
+ wmPtr->parentWidth = winPtr->changes.width + structureRect.size.width;
+ wmPtr->parentHeight = winPtr->changes.height + structureRect.size.height;
}
}
@@ -6014,28 +6177,28 @@ ApplyWindowClassAttributeChanges(
static void
ApplyMasterOverrideChanges(
TkWindow *winPtr,
- WindowRef macWindow)
+ NSWindow *macWindow)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- WindowClass oldClass = wmPtr->macClass;
- WindowAttributes oldAttributes = wmPtr->attributes;
+ UInt64 oldAttributes = wmPtr->attributes;
+ int oldFlags = wmPtr->flags;
/*
* FIX: We need an UpdateWrapper equivalent to make this 100% correct
*/
if (winPtr->atts.override_redirect) {
- if (oldClass == kDocumentWindowClass) {
+ if (wmPtr->macClass == kDocumentWindowClass) {
wmPtr->macClass = kSimpleWindowClass;
- wmPtr->attributes = kWindowNoAttributes;
+ wmPtr->attributes = macClassAttrs[kSimpleWindowClass].defaultAttrs;
}
wmPtr->attributes |= kWindowNoActivatesAttribute;
} else {
- if (oldClass == kSimpleWindowClass &&
+ if (wmPtr->macClass == kSimpleWindowClass &&
oldAttributes == kWindowNoActivatesAttribute) {
wmPtr->macClass = kDocumentWindowClass;
- wmPtr->attributes = kWindowStandardDocumentAttributes
- | kWindowLiveResizeAttribute;
+ wmPtr->attributes =
+ macClassAttrs[kDocumentWindowClass].defaultAttrs;
}
wmPtr->attributes &= ~kWindowNoActivatesAttribute;
}
@@ -6044,75 +6207,40 @@ ApplyMasterOverrideChanges(
macWindow = TkMacOSXDrawableWindow(winPtr->window);
}
if (macWindow) {
- WindowGroupRef group;
-
- ApplyWindowClassAttributeChanges(winPtr, macWindow, oldClass,
- oldAttributes, 0);
-
if (winPtr->atts.override_redirect && wmPtr->master != None) {
wmPtr->flags |= WM_TOPMOST;
} else {
wmPtr->flags &= ~WM_TOPMOST;
}
- group = WmGetWindowGroup(winPtr);
- if (group && group != GetWindowGroup(macWindow)) {
- ChkErr(SetWindowGroup, macWindow, group);
- }
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * WmGetWindowGroup --
- *
- * Gets the window group a toplevel should be placed in.
- *
- * Results:
- * A WindowGroupRef.
- *
- * Side effects:
- * A transient window group for the master (if any) may be created.
- *
- *----------------------------------------------------------------------
- */
-
-static WindowGroupRef
-WmGetWindowGroup(
- TkWindow *winPtr)
-{
- WmInfo *wmPtr = winPtr->wmInfoPtr;
- WindowGroupRef group = NULL;
-
- if (wmPtr->flags & WM_TOPMOST) {
- group = GetWindowGroupOfClass(kUtilityWindowClass);
- } else if (wmPtr->master != None) {
- TkDisplay *dispPtr = TkGetDisplayList();
- TkWindow *masterWinPtr = (TkWindow *)
- Tk_IdToWindow(dispPtr->display, wmPtr->master);
-
- if (masterWinPtr && masterWinPtr->window != None &&
- TkMacOSXHostToplevelExists(masterWinPtr)) {
- WindowRef masterMacWin =
- TkMacOSXDrawableWindow(masterWinPtr->window);
-
- if (masterMacWin && GetWindowProperty(masterMacWin, 'Tk ', 'TsGp',
- sizeof(group), NULL, &group) != noErr) {
- ChkErr(CreateWindowGroup, 0, &group);
- if (group) {
- ChkErr(SetWindowGroupParent, group,
- GetWindowGroup(masterMacWin));
- ChkErr(SetWindowGroupOwner, group, masterMacWin);
- ChkErr(SetWindowProperty, masterMacWin, 'Tk ', 'TsGp',
- sizeof(group), &group);
+ NSWindow *parentWindow = [macWindow parentWindow];
+ if (wmPtr->master != None) {
+ TkDisplay *dispPtr = TkGetDisplayList();
+ TkWindow *masterWinPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, wmPtr->master);
+
+ if (masterWinPtr && masterWinPtr->window != None &&
+ TkMacOSXHostToplevelExists(masterWinPtr)) {
+ NSWindow *masterMacWin =
+ TkMacOSXDrawableWindow(masterWinPtr->window);
+
+ if (masterMacWin && masterMacWin != parentWindow &&
+ (winPtr->flags & TK_MAPPED)) {
+ if (parentWindow) {
+ [parentWindow removeChildWindow:macWindow];
+ }
+ [masterMacWin addChildWindow:macWindow
+ ordered:NSWindowAbove];
+ if (wmPtr->flags & WM_TOPMOST) {
+ [macWindow setLevel:kCGUtilityWindowLevel];
+ }
}
}
+ } else if (parentWindow) {
+ [parentWindow removeChildWindow:macWindow];
}
+ ApplyWindowAttributeFlagChanges(winPtr, macWindow, oldAttributes,
+ oldFlags, 0, 0);
}
- if (!group) {
- group = GetWindowGroupOfClass(wmPtr->macClass);
- }
- return group;
}
/*
@@ -6134,7 +6262,7 @@ WmGetWindowGroup(
int
TkMacOSXMakeFullscreen(
TkWindow *winPtr,
- WindowRef window,
+ NSWindow *window,
int fullscreen,
Tcl_Interp *interp)
{
@@ -6160,21 +6288,19 @@ TkMacOSXMakeFullscreen(
result = TCL_ERROR;
wmPtr->flags &= ~WM_FULLSCREEN;
} else {
- Rect bounds, screenBounds = {0, 0, screenHeight, screenWidth};
-
- ChkErr(GetWindowBounds, window, kWindowContentRgn, &bounds);
- if (!EqualRect(&bounds, &screenBounds)) {
- if (!wasFullscreen) {
- wmPtr->configX = wmPtr->x;
- wmPtr->configY = wmPtr->y;
- wmPtr->configAttributes = wmPtr->attributes;
- wmPtr->attributes &= ~kWindowResizableAttribute;
- ApplyWindowClassAttributeChanges(winPtr, window,
- wmPtr->macClass, wmPtr->configAttributes, 0);
- }
+ NSRect bounds = [window contentRectForFrameRect:[window frame]];
+ NSRect screenBounds = NSMakeRect(0, 0, screenWidth, screenHeight);
+
+ if (!NSEqualRects(bounds, screenBounds) && !wasFullscreen) {
+ wmPtr->configX = wmPtr->x;
+ wmPtr->configY = wmPtr->y;
+ wmPtr->configAttributes = wmPtr->attributes;
+ wmPtr->attributes &= ~kWindowResizableAttribute;
+ ApplyWindowAttributeFlagChanges(winPtr, window,
+ wmPtr->configAttributes, wmPtr->flags, 1, 0);
wmPtr->flags |= WM_SYNC_PENDING;
- ChkErr(SetWindowBounds, window, kWindowContentRgn,
- &screenBounds);
+ [window setFrame:[window frameRectForContentRect:
+ screenBounds] display:YES];
wmPtr->flags &= ~WM_SYNC_PENDING;
}
wmPtr->flags |= WM_FULLSCREEN;
@@ -6182,21 +6308,22 @@ TkMacOSXMakeFullscreen(
} else {
wmPtr->flags &= ~WM_FULLSCREEN;
}
+ TkMacOSXEnterExitFullscreen(winPtr, [window isKeyWindow]);
if (wasFullscreen && !(wmPtr->flags & WM_FULLSCREEN)) {
- WindowAttributes oldAttributes = wmPtr->attributes;
- Rect bounds = {wmPtr->configY, wmPtr->configX,
- wmPtr->configY + wmPtr->yInParent + wmPtr->configHeight,
- wmPtr->configX + wmPtr->xInParent + wmPtr->configWidth};
+ UInt64 oldAttributes = wmPtr->attributes;
+ NSRect bounds = NSMakeRect(wmPtr->configX, tkMacOSXZeroScreenHeight -
+ (wmPtr->configY + wmPtr->yInParent + wmPtr->configHeight),
+ wmPtr->xInParent + wmPtr->configWidth,
+ wmPtr->yInParent + wmPtr->configHeight);
wmPtr->attributes |= wmPtr->configAttributes &
kWindowResizableAttribute;
- ApplyWindowClassAttributeChanges(winPtr, window, wmPtr->macClass,
- oldAttributes, 0);
+ ApplyWindowAttributeFlagChanges(winPtr, window, oldAttributes,
+ wmPtr->flags, 1, 0);
wmPtr->flags |= WM_SYNC_PENDING;
- ChkErr(SetWindowBounds, window, kWindowStructureRgn, &bounds);
+ [window setFrame:[window frameRectForContentRect:bounds] display:YES];
wmPtr->flags &= ~WM_SYNC_PENDING;
}
- TkMacOSXEnterExitFullscreen(winPtr, IsWindowActive(window));
return result;
}
@@ -6222,24 +6349,25 @@ TkMacOSXEnterExitFullscreen(
int active)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
+ NSWindow *window = TkMacOSXDrawableWindow(winPtr->window);
SystemUIMode mode;
SystemUIOptions options;
GetSystemUIMode(&mode, &options);
- if (wmPtr->flags & WM_FULLSCREEN && active) {
+ if (window && wmPtr && (wmPtr->flags & WM_FULLSCREEN) && active) {
static SystemUIMode fullscreenMode = 0;
static SystemUIOptions fullscreenOptions = 0;
if (!fullscreenMode) {
- TK_IF_HI_TOOLBOX (3,
- fullscreenMode = kUIModeAllSuppressed;
- ) TK_ELSE_HI_TOOLBOX (3,
- fullscreenMode = kUIModeAllHidden;
- fullscreenOptions = kUIOptionAutoShowMenuBar;
- ) TK_ENDIF
+ fullscreenMode = kUIModeAllSuppressed;
}
if (mode != fullscreenMode) {
ChkErr(SetSystemUIMode, fullscreenMode, fullscreenOptions);
+ wmPtr->flags |= WM_SYNC_PENDING;
+ [window setFrame:[window frameRectForContentRect:NSMakeRect(0, 0,
+ WidthOfScreen(Tk_Screen(winPtr)),
+ HeightOfScreen(Tk_Screen(winPtr)))] display:YES];
+ wmPtr->flags &= ~WM_SYNC_PENDING;
}
} else {
if (mode != kUIModeNormal) {
@@ -6375,12 +6503,12 @@ GetMaxSize(
* of the window. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
- Rect *maxBounds = (Rect*)(winPtr->display->screens->ext_data);
+ NSRect *maxBounds = (NSRect*)(winPtr->display->screens->ext_data);
if (wmPtr->maxWidth > 0) {
*maxWidthPtr = wmPtr->maxWidth;
} else {
- int maxWidth = maxBounds->right - maxBounds->left - wmPtr->xInParent;
+ int maxWidth = maxBounds->size.width - wmPtr->xInParent;
if (wmPtr->gridWin != NULL) {
maxWidth = wmPtr->reqGridWidth
@@ -6391,7 +6519,7 @@ GetMaxSize(
if (wmPtr->maxHeight > 0) {
*maxHeightPtr = wmPtr->maxHeight;
} else {
- int maxHeight = maxBounds->bottom - maxBounds->top - wmPtr->yInParent;
+ int maxHeight = maxBounds->size.height - wmPtr->yInParent;
if (wmPtr->gridWin != NULL) {
maxHeight = wmPtr->reqGridHeight
@@ -6432,7 +6560,6 @@ RemapWindows(
if (winPtr->window != None) {
MacDrawable *macWin = (MacDrawable *) winPtr->window;
- macWin->grafPtr = NULL;
macWin->toplevel = parentWin->toplevel;
winPtr->flags &= ~TK_MAPPED;
#ifdef TK_REBUILD_TOPLEVEL
@@ -6442,7 +6569,18 @@ RemapWindows(
/* Repeat for all the children */
for (childPtr = winPtr->childList; childPtr != NULL;
- childPtr = childPtr->nextPtr) {
+ childPtr = childPtr->nextPtr) {
RemapWindows(childPtr, (MacDrawable *) winPtr->window);
}
}
+
+
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXWm.h b/macosx/tkMacOSXWm.h
index ce4bede..bfc7fac 100644
--- a/macosx/tkMacOSXWm.h
+++ b/macosx/tkMacOSXWm.h
@@ -3,61 +3,18 @@
*
* Declarations of Macintosh specific window manager structures.
*
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * 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.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKMACWM
#define _TKMACWM
#include "tkMacOSXInt.h"
+#include "tkMenu.h"
/*
* A data structure of the following type holds information for
@@ -232,9 +189,10 @@ typedef struct TkWmInfo {
* Macintosh information.
*/
WindowClass macClass;
- WindowAttributes attributes, configAttributes;
+ UInt64 attributes, configAttributes;
TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */
- short style; /* Legacy window style. */
+ TkMenu *menuPtr;
+ NSWindow *window;
} WmInfo;
diff --git a/macosx/tkMacOSXXCursors.h b/macosx/tkMacOSXXCursors.h
new file mode 100644
index 0000000..1363bee
--- /dev/null
+++ b/macosx/tkMacOSXXCursors.h
@@ -0,0 +1,711 @@
+/*
+ * tkMacOSXXCursors.h --
+ *
+ * This file defines a set of Macintosh cursors 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.
+ * Copyright 2008-2009, Apple Inc.
+ * Copyright (c) 2008-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+static const unsigned char tkMacOSXXCursors[][68] = {
+
+#define TK_MAC_XCURSOR_X_cursor 0
+[TK_MAC_XCURSOR_X_cursor] = {
+ 0xE0, 0x07, 0xF0, 0x0F, 0xF8, 0x1F, 0x7C, 0x3E, 0x3E, 0x7C, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, 0xE0,
+ 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3E, 0x7C, 0x7C, 0x3E, 0xF8, 0x1F, 0xF0, 0x0F, 0xE0, 0x07,
+ 0xE0, 0x07, 0xF0, 0x0F, 0xF8, 0x1F, 0x7C, 0x3E, 0x3E, 0x7C, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, 0xE0,
+ 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3E, 0x7C, 0x7C, 0x3E, 0xF8, 0x1F, 0xF0, 0x0F, 0xE0, 0x07,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_arrow 1
+[TK_MAC_XCURSOR_arrow] = {
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x1E, 0x00, 0x7C, 0x01, 0xFC, 0x07, 0xF8, 0x00, 0xF8, 0x01, 0xF0,
+ 0x03, 0xB0, 0x07, 0x20, 0x0E, 0x20, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x1F, 0x00, 0x7F, 0x01, 0xFE, 0x07, 0xFE, 0x1F, 0xFC, 0x7F, 0xFC, 0x03, 0xF8,
+ 0x07, 0xF8, 0x0F, 0xF0, 0x1F, 0x70, 0x3E, 0x60, 0x7C, 0x60, 0xF8, 0x40, 0x70, 0x40, 0x20, 0x00,
+ 0x00, 0x01, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_based_arrow_down 2
+[TK_MAC_XCURSOR_based_arrow_down] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x03, 0x00, 0x03, 0x00,
+ 0x03, 0x00, 0x0B, 0x40, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x07, 0x80, 0x07, 0x80,
+ 0x3F, 0xF0, 0x1F, 0xE0, 0x0F, 0xC0, 0x07, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0B, 0x00, 0x06,
+},
+
+#define TK_MAC_XCURSOR_based_arrow_up 3
+[TK_MAC_XCURSOR_based_arrow_up] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x80, 0x0B, 0x40, 0x03, 0x00,
+ 0x03, 0x00, 0x03, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x80, 0x0F, 0xC0, 0x1F, 0xE0, 0x3F, 0xF0,
+ 0x07, 0x80, 0x07, 0x80, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x06,
+},
+
+#define TK_MAC_XCURSOR_boat 4
+[TK_MAC_XCURSOR_boat] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0xC0, 0x84, 0x60, 0xFF, 0xFF,
+ 0x00, 0x18, 0x00, 0x20, 0x00, 0x40, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0xC0, 0x87, 0xE0, 0xFF, 0xFF,
+ 0xFF, 0xF8, 0xFF, 0xE0, 0xFF, 0xC0, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x0F,
+},
+
+#define TK_MAC_XCURSOR_bogosity 5
+[TK_MAC_XCURSOR_bogosity] = {
+ 0x00, 0x00, 0x71, 0x1C, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x7F, 0xFC, 0x51, 0x14, 0x51, 0x14,
+ 0x51, 0x14, 0x51, 0x14, 0x7F, 0xFC, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x71, 0x1C, 0x00, 0x00,
+ 0x00, 0x00, 0x71, 0x1C, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC,
+ 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x11, 0x10, 0x11, 0x10, 0x11, 0x10, 0x71, 0x1C, 0x00, 0x00,
+ 0x00, 0x01, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_bottom_left_corner 6
+[TK_MAC_XCURSOR_bottom_left_corner] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0xC0, 0x20, 0xC8, 0x40, 0xC8, 0x80,
+ 0xC9, 0x00, 0xCA, 0x00, 0xCC, 0x00, 0xCF, 0xC0, 0xC0, 0x00, 0xC0, 0x00, 0xFF, 0xF0, 0xFF, 0xF0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0xC0, 0x20, 0xC8, 0x40, 0xC8, 0x80,
+ 0xC9, 0x00, 0xCA, 0x00, 0xCC, 0x00, 0xCF, 0xC0, 0xC0, 0x00, 0xC0, 0x00, 0xFF, 0xF0, 0xFF, 0xF0,
+ 0x00, 0x0F, 0x00, 0x00,
+},
+
+#define TK_MAC_XCURSOR_bottom_right_corner 7
+[TK_MAC_XCURSOR_bottom_right_corner] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x03, 0x02, 0x13, 0x01, 0x13,
+ 0x00, 0x93, 0x00, 0x53, 0x00, 0x33, 0x03, 0xF3, 0x00, 0x03, 0x00, 0x03, 0x0F, 0xFF, 0x0F, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x03, 0x02, 0x13, 0x01, 0x13,
+ 0x00, 0x93, 0x00, 0x53, 0x00, 0x33, 0x03, 0xF3, 0x00, 0x03, 0x00, 0x03, 0x0F, 0xFF, 0x0F, 0xFF,
+ 0x00, 0x0F, 0x00, 0x0F,
+},
+
+#define TK_MAC_XCURSOR_bottom_side 8
+[TK_MAC_XCURSOR_bottom_side] = {
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x11, 0x10,
+ 0x09, 0x20, 0x05, 0x40, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xFC, 0x7F, 0xFC, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x11, 0x10,
+ 0x09, 0x20, 0x05, 0x40, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00, 0x7F, 0xFC, 0x7F, 0xFC, 0x00, 0x00,
+ 0x00, 0x0B, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_bottom_tee 9
+[TK_MAC_XCURSOR_bottom_tee] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
+ 0x01, 0x80, 0x01, 0x80, 0x7F, 0xFE, 0x7F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80,
+ 0x01, 0x80, 0x01, 0x80, 0x7F, 0xFE, 0x7F, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0B, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_box_spiral 10
+[TK_MAC_XCURSOR_box_spiral] = {
+ 0xFF, 0xFE, 0x80, 0x00, 0xBF, 0xFE, 0xA0, 0x02, 0xAF, 0xFA, 0xA8, 0x0A, 0xAB, 0xEA, 0xAA, 0x2A,
+ 0xAA, 0xAA, 0xAB, 0xAA, 0xA8, 0x2A, 0xAF, 0xEA, 0xA0, 0x0A, 0xBF, 0xFA, 0x80, 0x02, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0x80, 0x00, 0xBF, 0xFE, 0xA0, 0x02, 0xAF, 0xFA, 0xA8, 0x0A, 0xAB, 0xEA, 0xAA, 0x2A,
+ 0xAA, 0xAA, 0xAB, 0xAA, 0xA8, 0x2A, 0xAF, 0xEA, 0xA0, 0x0A, 0xBF, 0xFA, 0x80, 0x02, 0xFF, 0xFE,
+ 0x00, 0x08, 0x00, 0x08,
+},
+
+#define TK_MAC_XCURSOR_center_ptr 11
+[TK_MAC_XCURSOR_center_ptr] = {
+ 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x07, 0x80, 0x07, 0x80, 0x0F, 0xC0, 0x0F, 0xC0, 0x1F, 0xE0,
+ 0x1F, 0xE0, 0x33, 0x30, 0x23, 0x10, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x07, 0x80, 0x07, 0x80, 0x0F, 0xC0, 0x0F, 0xC0, 0x1F, 0xE0, 0x1F, 0xE0, 0x3F, 0xF0,
+ 0x3F, 0xF0, 0x7F, 0xF8, 0x77, 0xB8, 0x67, 0x98, 0x07, 0x80, 0x07, 0x80, 0x07, 0x80, 0x07, 0x80,
+ 0x00, 0x01, 0x00, 0x06,
+},
+
+#define TK_MAC_XCURSOR_circle 12
+[TK_MAC_XCURSOR_circle] = {
+ 0x00, 0x00, 0x03, 0xC0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3C, 0x3C, 0x38, 0x1C, 0x70, 0x0E, 0x70, 0x0E,
+ 0x70, 0x0E, 0x70, 0x0E, 0x38, 0x1C, 0x3C, 0x3C, 0x1F, 0xF8, 0x0F, 0xF0, 0x03, 0xC0, 0x00, 0x00,
+ 0x03, 0xC0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3F, 0xFC, 0x7F, 0xFE, 0x7C, 0x3E, 0xF8, 0x1F, 0xF8, 0x1F,
+ 0xF8, 0x1F, 0xF8, 0x1F, 0x7C, 0x3E, 0x7F, 0xFE, 0x3F, 0xFC, 0x1F, 0xF8, 0x0F, 0xF0, 0x03, 0xC0,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_clock 13
+[TK_MAC_XCURSOR_clock] = {
+ 0x1F, 0xF8, 0x33, 0xCC, 0x64, 0x66, 0x49, 0x92, 0x4F, 0x12, 0x44, 0x22, 0x63, 0xC6, 0x3F, 0xFC,
+ 0x29, 0x94, 0x29, 0x94, 0x29, 0x94, 0x2B, 0xD4, 0x69, 0x96, 0x78, 0x1E, 0x7F, 0xFE, 0x7F, 0xFE,
+ 0x1F, 0xF8, 0x3F, 0xFC, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x3F, 0xFC,
+ 0x3F, 0xFC, 0x3F, 0xFC, 0x3F, 0xFC, 0x3F, 0xFC, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE, 0x7F, 0xFE,
+ 0x00, 0x04, 0x00, 0x08,
+},
+
+#define TK_MAC_XCURSOR_coffee_mug 14
+[TK_MAC_XCURSOR_coffee_mug] = {
+ 0x03, 0xF8, 0x0C, 0x06, 0x10, 0x01, 0x1C, 0x07, 0x33, 0xF9, 0x70, 0x01, 0xD0, 0x01, 0x90, 0x01,
+ 0x96, 0x0D, 0xDA, 0x55, 0x7A, 0x55, 0x36, 0xED, 0x10, 0xA1, 0x10, 0x01, 0x08, 0x02, 0x07, 0xFC,
+ 0x03, 0xF8, 0x0F, 0xFE, 0x1F, 0xFF, 0x1F, 0xFF, 0x3F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x3F, 0xFF, 0x1F, 0xFF, 0x1F, 0xFF, 0x0F, 0xFE, 0x07, 0xFC,
+ 0x00, 0x04, 0x00, 0x03,
+},
+
+#define TK_MAC_XCURSOR_cross 15
+[TK_MAC_XCURSOR_cross] = {
+ 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0xFE, 0xFE, 0x00, 0x00,
+ 0xFE, 0xFE, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x00, 0x00,
+ 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_cross_reverse 16
+[TK_MAC_XCURSOR_cross_reverse] = {
+ 0x42, 0x84, 0xA2, 0x8A, 0x52, 0x94, 0x2A, 0xA8, 0x16, 0xD0, 0x0A, 0xA0, 0xFD, 0x7E, 0x02, 0x80,
+ 0xFD, 0x7E, 0x0A, 0xA0, 0x16, 0xD0, 0x2A, 0xA8, 0x52, 0x94, 0xA2, 0x8A, 0x42, 0x84, 0x00, 0x00,
+ 0x43, 0x84, 0xE3, 0x8E, 0x73, 0x9C, 0x3B, 0xB8, 0x1F, 0xF0, 0x0F, 0xE0, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0x0F, 0xE0, 0x1F, 0xF0, 0x3B, 0xB8, 0x73, 0x9C, 0xE3, 0x8E, 0x43, 0x84, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_crosshair 17
+[TK_MAC_XCURSOR_crosshair] = {
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFE, 0xFE,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFE, 0xFE,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_diamond_cross 18
+[TK_MAC_XCURSOR_diamond_cross] = {
+ 0x02, 0x80, 0x06, 0xC0, 0x0A, 0xA0, 0x12, 0x90, 0x22, 0x88, 0x42, 0x84, 0xFE, 0xFE, 0x00, 0x00,
+ 0xFE, 0xFE, 0x42, 0x84, 0x22, 0x88, 0x12, 0x90, 0x0A, 0xA0, 0x06, 0xC0, 0x02, 0x80, 0x00, 0x00,
+ 0x02, 0x80, 0x06, 0xC0, 0x0E, 0xE0, 0x1E, 0xF0, 0x3E, 0xF8, 0x7E, 0xFC, 0xFE, 0xFE, 0x00, 0x00,
+ 0xFE, 0xFE, 0x7E, 0xFC, 0x3E, 0xF8, 0x1E, 0xF0, 0x0E, 0xE0, 0x06, 0xC0, 0x02, 0x80, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_dot 19
+[TK_MAC_XCURSOR_dot] = {
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x1F, 0xE0, 0x1F, 0xE0, 0x3F, 0xF0, 0x3F, 0xF0, 0x3F, 0xF0,
+ 0x3F, 0xF0, 0x1F, 0xE0, 0x1F, 0xE0, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x3F, 0xF0, 0x7F, 0xF8, 0x7F, 0xF8, 0x7F, 0xF8,
+ 0x7F, 0xF8, 0x3F, 0xF0, 0x3F, 0xF0, 0x1F, 0xE0, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x06,
+},
+
+#define TK_MAC_XCURSOR_dotbox 20
+[TK_MAC_XCURSOR_dotbox] = {
+ 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x21, 0x84,
+ 0x21, 0x84, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x20, 0x04, 0x3F, 0xFC, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x3F, 0xFC, 0x30, 0x0C, 0x30, 0x0C, 0x31, 0x8C, 0x33, 0xCC,
+ 0x33, 0xCC, 0x31, 0x8C, 0x30, 0x0C, 0x30, 0x0C, 0x3F, 0xFC, 0x3F, 0xFC, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_double_arrow 21
+[TK_MAC_XCURSOR_double_arrow] = {
+ 0x00, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x0D, 0xB0, 0x19, 0x98, 0x01, 0x80, 0x01, 0x80,
+ 0x01, 0x80, 0x01, 0x80, 0x19, 0x98, 0x0D, 0xB0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00, 0x00,
+ 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3F, 0xFC, 0x3B, 0xDC, 0x03, 0xC0,
+ 0x03, 0xC0, 0x3B, 0xDC, 0x3F, 0xFC, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_draft_large 22
+[TK_MAC_XCURSOR_draft_large] = {
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x3C, 0x00, 0xF8, 0x03, 0xF8, 0x0F, 0xF0, 0x00, 0xF0,
+ 0x01, 0x60, 0x02, 0x60, 0x04, 0x40, 0x08, 0x40, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x00, 0x0F, 0x00, 0x3E, 0x00, 0xFE, 0x03, 0xFC, 0x0F, 0xFC, 0x3F, 0xF8, 0xFF, 0xF8,
+ 0x03, 0xF0, 0x07, 0xF0, 0x0E, 0xE0, 0x1C, 0xE0, 0x38, 0xC0, 0x70, 0xC0, 0xE0, 0x80, 0x40, 0x80,
+ 0x00, 0x01, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_draft_small 23
+[TK_MAC_XCURSOR_draft_small] = {
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x3C, 0x00, 0xF8, 0x03, 0xF8, 0x00, 0x70, 0x00, 0xB0,
+ 0x01, 0x20, 0x02, 0x20, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x00, 0x0F, 0x00, 0x3E, 0x00, 0xFE, 0x03, 0xFC, 0x0F, 0xFC, 0x3F, 0xF8, 0x01, 0xF8,
+ 0x03, 0xF0, 0x07, 0x70, 0x0E, 0x60, 0x1C, 0x60, 0x38, 0x40, 0x70, 0x40, 0xE0, 0x00, 0x40, 0x00,
+ 0x00, 0x01, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_draped_box 24
+[TK_MAC_XCURSOR_draped_box] = {
+ 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x22, 0x44, 0x26, 0x64, 0x2C, 0x34, 0x38, 0x1C, 0x21, 0x84,
+ 0x21, 0x84, 0x38, 0x1C, 0x2C, 0x34, 0x26, 0x64, 0x22, 0x44, 0x3F, 0xFC, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x3E, 0x7C, 0x3E, 0x7C, 0x3C, 0x3C, 0x39, 0x9C, 0x23, 0xC4,
+ 0x23, 0xC4, 0x39, 0x9C, 0x3C, 0x3C, 0x3E, 0x7C, 0x3E, 0x7C, 0x3F, 0xFC, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_exchange 25
+[TK_MAC_XCURSOR_exchange] = {
+ 0x00, 0x00, 0x47, 0xC0, 0x6F, 0xE0, 0x7C, 0x30, 0x48, 0x10, 0x4C, 0x00, 0x7E, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xFC, 0x00, 0x64, 0x10, 0x24, 0x18, 0x7C, 0x0F, 0xEC, 0x07, 0xC4, 0x00, 0x00,
+ 0xC7, 0xC0, 0xEF, 0xE0, 0xFF, 0xF0, 0xFF, 0xF8, 0xFC, 0x38, 0xFE, 0x10, 0xFF, 0x00, 0xFF, 0x80,
+ 0x03, 0xFE, 0x01, 0xFE, 0x10, 0xFE, 0x38, 0x7E, 0x3F, 0xFE, 0x1F, 0xFE, 0x0F, 0xEE, 0x07, 0xC6,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_fleur 26
+[TK_MAC_XCURSOR_fleur] = {
+ 0x00, 0x00, 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x01, 0x80, 0x11, 0x88, 0x31, 0x8C, 0x7F, 0xFE,
+ 0x7F, 0xFE, 0x31, 0x8C, 0x11, 0x88, 0x01, 0x80, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80, 0x00, 0x00,
+ 0x01, 0x80, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x17, 0xE8, 0x3B, 0xDC, 0x7F, 0xFE, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x7F, 0xFE, 0x3B, 0xDC, 0x17, 0xE8, 0x0F, 0xF0, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0x80,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_gobbler 27
+[TK_MAC_XCURSOR_gobbler] = {
+ 0x00, 0x00, 0x00, 0x78, 0x00, 0x70, 0x40, 0x36, 0x4F, 0xB0, 0x7F, 0xF0, 0x7E, 0x30, 0x7C, 0x30,
+ 0x30, 0x38, 0x00, 0xF0, 0x0F, 0xE0, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00,
+ 0x00, 0xFC, 0x00, 0xFC, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xF8, 0xFF, 0xF8,
+ 0xFF, 0xFC, 0x7F, 0xFC, 0x3F, 0xF8, 0x1F, 0xF0, 0x0E, 0x00, 0x1F, 0x80, 0x1F, 0x80, 0x1F, 0x80,
+ 0x00, 0x03, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_gumby 28
+[TK_MAC_XCURSOR_gumby] = {
+ 0x3F, 0x00, 0x10, 0xC0, 0xC8, 0x20, 0xEA, 0xA0, 0xC8, 0x20, 0xCB, 0xA0, 0xF8, 0x38, 0x38, 0x3E,
+ 0x08, 0x26, 0x08, 0x26, 0x09, 0x2E, 0x09, 0x26, 0x09, 0x20, 0x11, 0x10, 0x21, 0x08, 0x3E, 0xF8,
+ 0x3F, 0x00, 0x1F, 0xC0, 0xCF, 0xE0, 0xEF, 0xE0, 0xCF, 0xE0, 0xCF, 0xE0, 0xFF, 0xF8, 0x3F, 0xFE,
+ 0x0F, 0xE6, 0x0F, 0xE6, 0x0F, 0xEE, 0x0F, 0xE6, 0x0F, 0xE0, 0x1F, 0xF0, 0x3F, 0xF8, 0x3E, 0xF8,
+ 0x00, 0x00, 0x00, 0x02,
+},
+
+#define TK_MAC_XCURSOR_hand1 29
+[TK_MAC_XCURSOR_hand1] = {
+ 0x00, 0x0C, 0x00, 0x3C, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x2F, 0xE0,
+ 0x7F, 0xF0, 0x5F, 0xF0, 0x07, 0xE0, 0x07, 0xC0, 0x4A, 0x00, 0x62, 0x00, 0x34, 0x00, 0x18, 0x00,
+ 0x00, 0x0C, 0x00, 0x3C, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x2F, 0xE0,
+ 0x7F, 0xF0, 0x7F, 0xF0, 0x7F, 0xE0, 0x7F, 0xC0, 0x7E, 0x00, 0x7E, 0x00, 0x3C, 0x00, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x0D,
+},
+
+#define TK_MAC_XCURSOR_hand2 30
+[TK_MAC_XCURSOR_hand2] = {
+ 0x00, 0x00, 0x3F, 0xC0, 0x40, 0x20, 0x3F, 0x10, 0x08, 0x08, 0x07, 0x08, 0x08, 0x08, 0x07, 0x14,
+ 0x08, 0x22, 0x06, 0x41, 0x01, 0x82, 0x01, 0x24, 0x00, 0x88, 0x00, 0x50, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x3F, 0xC0, 0x7F, 0xE0, 0x3F, 0xF0, 0x0F, 0xF8, 0x07, 0xF8, 0x0F, 0xF8, 0x07, 0xFC,
+ 0x0F, 0xFE, 0x07, 0xFF, 0x01, 0xFE, 0x01, 0xFC, 0x00, 0xF8, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x02, 0x00, 0x01,
+},
+
+#define TK_MAC_XCURSOR_heart 31
+[TK_MAC_XCURSOR_heart] = {
+ 0x00, 0x00, 0x3E, 0xF8, 0x63, 0x8C, 0xC1, 0x06, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02,
+ 0xC0, 0x06, 0x60, 0x0C, 0x30, 0x18, 0x18, 0x30, 0x0C, 0x60, 0x06, 0xC0, 0x03, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x3E, 0xF8, 0x7F, 0xFC, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0x7F, 0xFC, 0x3F, 0xF8, 0x1F, 0xF0, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x00, 0x00,
+ 0x00, 0x03, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_icon 32
+[TK_MAC_XCURSOR_icon] = {
+ 0xFF, 0xFF, 0xD5, 0x55, 0xAA, 0xAB, 0xD5, 0x55, 0xA0, 0x0B, 0xD0, 0x05, 0xA0, 0x0B, 0xD0, 0x05,
+ 0xA0, 0x0B, 0xD0, 0x05, 0xA0, 0x0B, 0xD0, 0x05, 0xAA, 0xAB, 0xD5, 0x55, 0xAA, 0xAB, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F,
+ 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_iron_cross 33
+[TK_MAC_XCURSOR_iron_cross] = {
+ 0x00, 0x00, 0x3F, 0xFC, 0x1F, 0xF8, 0x4F, 0xF2, 0x67, 0xE6, 0x73, 0xCE, 0x79, 0x9E, 0x7F, 0xFE,
+ 0x7F, 0xFE, 0x79, 0x9E, 0x73, 0xCE, 0x67, 0xE6, 0x4F, 0xF2, 0x1F, 0xF8, 0x3F, 0xFC, 0x00, 0x00,
+ 0x7F, 0xFE, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0x7F, 0xFE,
+ 0x00, 0x07, 0x00, 0x06,
+},
+
+#define TK_MAC_XCURSOR_left_ptr 34
+[TK_MAC_XCURSOR_left_ptr] = {
+ 0x00, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x0F, 0x80, 0x0F, 0xC0, 0x0F, 0xE0,
+ 0x0F, 0xF0, 0x0F, 0x80, 0x0D, 0x80, 0x08, 0xC0, 0x00, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00,
+ 0x18, 0x00, 0x1C, 0x00, 0x1E, 0x00, 0x1F, 0x00, 0x1F, 0x80, 0x1F, 0xC0, 0x1F, 0xE0, 0x1F, 0xF0,
+ 0x1F, 0xF8, 0x1F, 0xFC, 0x1F, 0xC0, 0x1D, 0xE0, 0x19, 0xE0, 0x10, 0xF0, 0x00, 0xF0, 0x00, 0x70,
+ 0x00, 0x01, 0x00, 0x04,
+},
+
+#define TK_MAC_XCURSOR_left_side 35
+[TK_MAC_XCURSOR_left_side] = {
+ 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x80, 0x61, 0x00, 0x62, 0x00, 0x64, 0x00, 0x6F, 0xFC,
+ 0x64, 0x00, 0x62, 0x00, 0x61, 0x00, 0x60, 0x80, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x80, 0x61, 0x00, 0x62, 0x00, 0x64, 0x00, 0x6F, 0xFC,
+ 0x64, 0x00, 0x62, 0x00, 0x61, 0x00, 0x60, 0x80, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x04,
+},
+
+#define TK_MAC_XCURSOR_left_tee 36
+[TK_MAC_XCURSOR_left_tee] = {
+ 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0F, 0xF8,
+ 0x0F, 0xF8, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0F, 0xF8,
+ 0x0F, 0xF8, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x04,
+},
+
+#define TK_MAC_XCURSOR_leftbutton 37
+[TK_MAC_XCURSOR_leftbutton] = {
+ 0x80, 0x02, 0x7F, 0xFC, 0x7F, 0xFC, 0x44, 0x44, 0x45, 0x54, 0x45, 0x54, 0x45, 0x54, 0x45, 0x54,
+ 0x44, 0x44, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x80, 0x02,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0x00, 0x04, 0x00, 0x03,
+},
+
+#define TK_MAC_XCURSOR_ll_angle 38
+[TK_MAC_XCURSOR_ll_angle] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00,
+ 0x0C, 0x00, 0x0C, 0x00, 0x0F, 0xF8, 0x0F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00,
+ 0x0C, 0x00, 0x0C, 0x00, 0x0F, 0xF8, 0x0F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0B, 0x00, 0x04,
+},
+
+#define TK_MAC_XCURSOR_lr_angle 39
+[TK_MAC_XCURSOR_lr_angle] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30,
+ 0x00, 0x30, 0x00, 0x30, 0x1F, 0xF0, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30,
+ 0x00, 0x30, 0x00, 0x30, 0x1F, 0xF0, 0x1F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0B, 0x00, 0x0B,
+},
+
+#define TK_MAC_XCURSOR_man 40
+[TK_MAC_XCURSOR_man] = {
+ 0x03, 0x80, 0x1E, 0xF0, 0x02, 0x80, 0x81, 0x00, 0x43, 0x87, 0x24, 0x4B, 0x1D, 0x70, 0x05, 0x40,
+ 0x04, 0x40, 0x02, 0x80, 0x04, 0x40, 0x09, 0x20, 0x12, 0x90, 0x14, 0x50, 0x78, 0x3C, 0xF8, 0x3F,
+ 0x03, 0x80, 0x1F, 0xF0, 0x03, 0x80, 0x81, 0x00, 0x43, 0x87, 0x27, 0xCB, 0x1F, 0xF0, 0x07, 0xC0,
+ 0x07, 0xC0, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0, 0x1E, 0xF0, 0x1C, 0x70, 0x78, 0x3C, 0xF8, 0x3F,
+ 0x00, 0x01, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_middlebutton 41
+[TK_MAC_XCURSOR_middlebutton] = {
+ 0x80, 0x02, 0x7F, 0xFC, 0x7F, 0xFC, 0x44, 0x44, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
+ 0x44, 0x44, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x80, 0x02,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0x00, 0x04, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_mouse 42
+[TK_MAC_XCURSOR_mouse] = {
+ 0x06, 0x00, 0x01, 0x00, 0x01, 0x80, 0x0F, 0xF0, 0x10, 0x08, 0x17, 0xE8, 0x14, 0x28, 0x14, 0x28,
+ 0x17, 0xE8, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x0F, 0xF0,
+ 0x06, 0x00, 0x01, 0x00, 0x01, 0x80, 0x0F, 0xF0, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8,
+ 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x0F, 0xF0,
+ 0x00, 0x00, 0x00, 0x00,
+},
+
+#define TK_MAC_XCURSOR_pencil 43
+[TK_MAC_XCURSOR_pencil] = {
+ 0x00, 0x00, 0x00, 0xF0, 0x00, 0x88, 0x01, 0x08, 0x01, 0x90, 0x02, 0x70, 0x02, 0x20, 0x04, 0x40,
+ 0x04, 0x40, 0x08, 0x80, 0x08, 0x80, 0x11, 0x00, 0x1E, 0x00, 0x1C, 0x00, 0x18, 0x00, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0xF0, 0x00, 0xF8, 0x01, 0xF8, 0x01, 0xF0, 0x03, 0xF0, 0x03, 0xE0, 0x07, 0xC0,
+ 0x07, 0xC0, 0x0F, 0x80, 0x0F, 0x80, 0x1F, 0x00, 0x1E, 0x00, 0x1C, 0x00, 0x18, 0x00, 0x10, 0x00,
+ 0x00, 0x0F, 0x00, 0x03,
+},
+
+#define TK_MAC_XCURSOR_pirate 44
+[TK_MAC_XCURSOR_pirate] = {
+ 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xF0, 0x19, 0x98, 0x19, 0x98, 0x0F, 0xF0, 0x07, 0xE0, 0x03, 0xC0,
+ 0x43, 0xC2, 0x43, 0xC3, 0x21, 0x84, 0x1C, 0x38, 0x03, 0xC0, 0x0F, 0xF1, 0x78, 0x1F, 0x40, 0x02,
+ 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x3F, 0xFC, 0x3F, 0xFC, 0x1F, 0xF8, 0x0F, 0xF0, 0x47, 0xE2,
+ 0xE7, 0xE7, 0xE7, 0xE7, 0x7F, 0xFF, 0x3F, 0xFC, 0x1F, 0xF9, 0x7F, 0xFF, 0xFF, 0xFF, 0xF8, 0x1F,
+ 0x00, 0x0A, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_plus 45
+[TK_MAC_XCURSOR_plus] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x1F, 0xF8,
+ 0x1F, 0xF8, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x1F, 0xF8,
+ 0x1F, 0xF8, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_question_arrow 46
+[TK_MAC_XCURSOR_question_arrow] = {
+ 0x07, 0xC0, 0x0F, 0xE0, 0x1C, 0x70, 0x18, 0x30, 0x1C, 0x30, 0x0C, 0x70, 0x00, 0xE0, 0x03, 0xC0,
+ 0x03, 0x80, 0x02, 0x80, 0x02, 0x80, 0x0E, 0xE0, 0x06, 0xC0, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00,
+ 0x07, 0xC0, 0x0F, 0xE0, 0x1C, 0x70, 0x18, 0x30, 0x1C, 0x30, 0x0C, 0x70, 0x00, 0xE0, 0x03, 0xC0,
+ 0x03, 0x80, 0x02, 0x80, 0x3F, 0xF8, 0x1F, 0xF0, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x01, 0x00,
+ 0x00, 0x0E, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_right_ptr 47
+[TK_MAC_XCURSOR_right_ptr] = {
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x30, 0x00, 0x70, 0x00, 0xF0, 0x01, 0xF0, 0x03, 0xF0, 0x07, 0xF0,
+ 0x0F, 0xF0, 0x01, 0xF0, 0x01, 0xB0, 0x03, 0x10, 0x03, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0x38, 0x00, 0x78, 0x00, 0xF8, 0x01, 0xF8, 0x03, 0xF8, 0x07, 0xF8, 0x0F, 0xF8,
+ 0x1F, 0xF8, 0x3F, 0xF8, 0x03, 0xF8, 0x07, 0xB8, 0x07, 0x98, 0x0F, 0x08, 0x0F, 0x00, 0x0E, 0x00,
+ 0x00, 0x01, 0x00, 0x0B,
+},
+
+#define TK_MAC_XCURSOR_right_side 48
+[TK_MAC_XCURSOR_right_side] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x01, 0x06, 0x00, 0x86, 0x00, 0x46, 0x00, 0x26,
+ 0x3F, 0xF6, 0x00, 0x26, 0x00, 0x46, 0x00, 0x86, 0x01, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x01, 0x06, 0x00, 0x86, 0x00, 0x46, 0x00, 0x26,
+ 0x3F, 0xF6, 0x00, 0x26, 0x00, 0x46, 0x00, 0x86, 0x01, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x0B,
+},
+
+#define TK_MAC_XCURSOR_right_tee 49
+[TK_MAC_XCURSOR_right_tee] = {
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x1F, 0xF0,
+ 0x1F, 0xF0, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x1F, 0xF0,
+ 0x1F, 0xF0, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x0A,
+},
+
+#define TK_MAC_XCURSOR_rightbutton 50
+[TK_MAC_XCURSOR_rightbutton] = {
+ 0x80, 0x02, 0x7F, 0xFC, 0x7F, 0xFC, 0x44, 0x44, 0x55, 0x44, 0x55, 0x44, 0x55, 0x44, 0x55, 0x44,
+ 0x44, 0x44, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFC, 0x80, 0x02,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE,
+ 0x00, 0x04, 0x00, 0x03,
+},
+
+#define TK_MAC_XCURSOR_rtl_logo 51
+[TK_MAC_XCURSOR_rtl_logo] = {
+ 0x00, 0x00, 0x7F, 0xFE, 0x40, 0x22, 0x40, 0x22, 0x40, 0x22, 0x7F, 0xE2, 0x44, 0x22, 0x44, 0x22,
+ 0x44, 0x22, 0x44, 0x22, 0x47, 0xFE, 0x44, 0x02, 0x44, 0x02, 0x44, 0x02, 0x7F, 0xFE, 0x00, 0x00,
+ 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFE, 0x60, 0x76, 0x7F, 0xF6, 0x7F, 0xF6, 0x7C, 0x36, 0x6C, 0x36,
+ 0x6C, 0x36, 0x6C, 0x3E, 0x6F, 0xFE, 0x6F, 0xFE, 0x6E, 0x06, 0x7F, 0xFE, 0x7F, 0xFE, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_sailboat 52
+[TK_MAC_XCURSOR_sailboat] = {
+ 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01, 0x60, 0x01, 0x60, 0x03, 0x60, 0x03, 0x70, 0x07, 0x70,
+ 0x07, 0x70, 0x0F, 0x78, 0x0F, 0x78, 0x1F, 0x78, 0x1F, 0x7C, 0x3E, 0x38, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x40, 0x00, 0xE0, 0x01, 0xE0, 0x03, 0xF0, 0x03, 0xF0, 0x07, 0xF0, 0x07, 0xF8, 0x0F, 0xF8,
+ 0x0F, 0xF8, 0x1F, 0xFC, 0x1F, 0xFC, 0x3F, 0xFC, 0x3F, 0xFE, 0x7F, 0x7C, 0x7E, 0x38, 0x00, 0x00,
+ 0x00, 0x0C, 0x00, 0x08,
+},
+
+#define TK_MAC_XCURSOR_sb_down_arrow 53
+[TK_MAC_XCURSOR_sb_down_arrow] = {
+ 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80,
+ 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80,
+ 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x1F, 0xF0, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x01, 0x00,
+ 0x00, 0x0E, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_sb_h_double_arrow 54
+[TK_MAC_XCURSOR_sb_h_double_arrow] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x18, 0x18, 0x3F, 0xFC, 0x78, 0x1E,
+ 0x3F, 0xFC, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x18, 0x18, 0x38, 0x1C, 0x7F, 0xFE, 0xFF, 0xFF,
+ 0x7F, 0xFE, 0x38, 0x1C, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_sb_left_arrow 55
+[TK_MAC_XCURSOR_sb_left_arrow] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x3F, 0xFF, 0x78, 0x00,
+ 0x3F, 0xFF, 0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x38, 0x00, 0x7F, 0xFF, 0xFF, 0xFF,
+ 0x7F, 0xFF, 0x38, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x01,
+},
+
+#define TK_MAC_XCURSOR_sb_right_arrow 56
+[TK_MAC_XCURSOR_sb_right_arrow] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0xFF, 0xFC,
+ 0x00, 0x1E, 0xFF, 0xFC, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x1C, 0xFF, 0xFE,
+ 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x1C, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_sb_up_arrow 57
+[TK_MAC_XCURSOR_sb_up_arrow] = {
+ 0x00, 0x00, 0x00, 0x80, 0x01, 0xC0, 0x03, 0xE0, 0x07, 0xF0, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40,
+ 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40,
+ 0x00, 0x80, 0x01, 0xC0, 0x03, 0xE0, 0x07, 0xF0, 0x0F, 0xF8, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0,
+ 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0, 0x01, 0xC0,
+ 0x00, 0x01, 0x00, 0x08,
+},
+
+#define TK_MAC_XCURSOR_sb_v_double_arrow 58
+[TK_MAC_XCURSOR_sb_v_double_arrow] = {
+ 0x00, 0x00, 0x01, 0x00, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80,
+ 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0, 0x1F, 0xF0, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80,
+ 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x1F, 0xF0, 0x0F, 0xE0, 0x07, 0xC0, 0x03, 0x80, 0x01, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_shuttle 59
+[TK_MAC_XCURSOR_shuttle] = {
+ 0x00, 0x20, 0x00, 0x70, 0x00, 0xF8, 0x01, 0xDE, 0x05, 0xDE, 0x09, 0xDE, 0x11, 0xDE, 0x11, 0xDE,
+ 0x11, 0xDE, 0x11, 0xDE, 0x31, 0xDE, 0x71, 0xDE, 0xFD, 0xDE, 0x18, 0x88, 0x00, 0x78, 0x00, 0x30,
+ 0x00, 0x20, 0x00, 0x70, 0x00, 0xF8, 0x01, 0xFE, 0x07, 0xFE, 0x0F, 0xFE, 0x1F, 0xFE, 0x1F, 0xFE,
+ 0x1F, 0xFE, 0x1F, 0xFE, 0x3F, 0xFE, 0x7F, 0xFE, 0xFF, 0xFE, 0x18, 0xF8, 0x00, 0x78, 0x00, 0x30,
+ 0x00, 0x00, 0x00, 0x0A,
+},
+
+#define TK_MAC_XCURSOR_sizing 60
+[TK_MAC_XCURSOR_sizing] = {
+ 0x00, 0x00, 0x7F, 0x80, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x47, 0xE0, 0x44, 0x20, 0x44, 0x22,
+ 0x44, 0x22, 0x04, 0x22, 0x07, 0xE2, 0x00, 0x12, 0x00, 0x0A, 0x00, 0x06, 0x01, 0xFE, 0x00, 0x00,
+ 0xFF, 0xC0, 0xFF, 0xC0, 0xFF, 0xC0, 0xE0, 0x00, 0xEF, 0xF0, 0xEF, 0xF0, 0xEC, 0x37, 0xEC, 0x37,
+ 0xEC, 0x37, 0xEC, 0x37, 0x0F, 0xF7, 0x0F, 0xFF, 0x00, 0x1F, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF,
+ 0x00, 0x0E, 0x00, 0x0E,
+},
+
+#define TK_MAC_XCURSOR_spider 61
+[TK_MAC_XCURSOR_spider] = {
+ 0x20, 0x10, 0x10, 0x20, 0x10, 0x20, 0x08, 0x40, 0x08, 0x40, 0x87, 0x87, 0x67, 0x98, 0x1F, 0xE0,
+ 0x1F, 0xE0, 0x67, 0x98, 0x87, 0x87, 0x08, 0x40, 0x08, 0x40, 0x10, 0x20, 0x10, 0x20, 0x20, 0x10,
+ 0x70, 0x38, 0x38, 0x70, 0x38, 0x70, 0x1C, 0xE0, 0x9F, 0xE7, 0xEF, 0xDF, 0xFF, 0xFF, 0x7F, 0xF8,
+ 0x7F, 0xF8, 0xFF, 0xFF, 0xEF, 0xDF, 0x9F, 0xE7, 0x1C, 0xE0, 0x38, 0x70, 0x38, 0x70, 0x70, 0x38,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_spraycan 62
+[TK_MAC_XCURSOR_spraycan] = {
+ 0x00, 0x18, 0x00, 0x40, 0x0D, 0x18, 0x1E, 0x40, 0x1A, 0x18, 0x3F, 0x00, 0x21, 0x00, 0x39, 0x00,
+ 0x29, 0x00, 0x39, 0x00, 0x29, 0x00, 0x39, 0x00, 0x39, 0x00, 0x21, 0x00, 0x21, 0x00, 0x3F, 0x00,
+ 0x00, 0x18, 0x00, 0x40, 0x0D, 0x18, 0x1E, 0x40, 0x1E, 0x18, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00,
+ 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x00,
+ 0x00, 0x02, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_star 63
+[TK_MAC_XCURSOR_star] = {
+ 0x01, 0x00, 0x02, 0x80, 0x02, 0x80, 0x02, 0x80, 0x04, 0x40, 0x04, 0x40, 0x04, 0x40, 0x39, 0x38,
+ 0xC0, 0x06, 0x38, 0x38, 0x09, 0x20, 0x12, 0x90, 0x24, 0x48, 0x28, 0x28, 0x30, 0x18, 0x20, 0x08,
+ 0x01, 0x00, 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x07, 0xC0, 0x07, 0xC0, 0x07, 0xC0, 0x3F, 0xF8,
+ 0xFF, 0xFE, 0x3F, 0xF8, 0x0F, 0xE0, 0x1E, 0xF0, 0x3C, 0x78, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_target 64
+[TK_MAC_XCURSOR_target] = {
+ 0x00, 0x00, 0x03, 0x80, 0x0F, 0xE0, 0x1C, 0x70, 0x30, 0x18, 0x60, 0x0C, 0xC1, 0x06, 0xC2, 0x86,
+ 0xC1, 0x06, 0x60, 0x0C, 0x30, 0x18, 0x1C, 0x70, 0x0F, 0xE0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x80, 0x0F, 0xE0, 0x1F, 0xF0, 0x3C, 0x78, 0x70, 0x1C, 0xE3, 0x8E, 0xE3, 0x8E,
+ 0xE3, 0x8E, 0x70, 0x1C, 0x3C, 0x78, 0x1F, 0xF0, 0x0F, 0xE0, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_tcross 65
+[TK_MAC_XCURSOR_tcross] = {
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFF, 0xFE,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFF, 0xFE,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_top_left_arrow 66
+[TK_MAC_XCURSOR_top_left_arrow] = {
+ 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x3E, 0x00, 0x3F, 0x80, 0x1F, 0xE0, 0x1E, 0x00, 0x0D, 0x00,
+ 0x0C, 0x80, 0x04, 0x40, 0x04, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0xE0, 0x00, 0xF8, 0x00, 0xFE, 0x00, 0x7F, 0x80, 0x7F, 0xE0, 0x3F, 0xF8, 0x3F, 0xFE, 0x1F, 0x80,
+ 0x1F, 0xC0, 0x0E, 0xE0, 0x0E, 0x70, 0x06, 0x38, 0x06, 0x1C, 0x02, 0x0E, 0x02, 0x04, 0x00, 0x00,
+ 0x00, 0x01, 0x00, 0x01,
+},
+
+#define TK_MAC_XCURSOR_top_left_corner 67
+[TK_MAC_XCURSOR_top_left_corner] = {
+ 0xFF, 0xF0, 0xFF, 0xF0, 0xC0, 0x00, 0xC0, 0x00, 0xCF, 0xC0, 0xCC, 0x00, 0xCA, 0x00, 0xC9, 0x00,
+ 0xC8, 0x80, 0xC8, 0x40, 0xC0, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xFF, 0xF0, 0xFF, 0xF0, 0xC0, 0x00, 0xC0, 0x00, 0xCF, 0xC0, 0xCC, 0x00, 0xCA, 0x00, 0xC9, 0x00,
+ 0xC8, 0x80, 0xC8, 0x40, 0xC0, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+},
+
+#define TK_MAC_XCURSOR_top_right_corner 68
+[TK_MAC_XCURSOR_top_right_corner] = {
+ 0x0F, 0xFF, 0x0F, 0xFF, 0x00, 0x03, 0x00, 0x03, 0x03, 0xF3, 0x00, 0x33, 0x00, 0x53, 0x00, 0x93,
+ 0x01, 0x13, 0x02, 0x13, 0x04, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0F, 0xFF, 0x0F, 0xFF, 0x00, 0x03, 0x00, 0x03, 0x03, 0xF3, 0x00, 0x33, 0x00, 0x53, 0x00, 0x93,
+ 0x01, 0x13, 0x02, 0x13, 0x04, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0F,
+},
+
+#define TK_MAC_XCURSOR_top_side 69
+[TK_MAC_XCURSOR_top_side] = {
+ 0x00, 0x00, 0x7F, 0xFC, 0x7F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x03, 0x80, 0x05, 0x40, 0x09, 0x20,
+ 0x11, 0x10, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7F, 0xFC, 0x7F, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x03, 0x80, 0x05, 0x40, 0x09, 0x20,
+ 0x11, 0x10, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_top_tee 70
+[TK_MAC_XCURSOR_top_tee] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFE, 0x01, 0x80, 0x01, 0x80,
+ 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFE, 0x01, 0x80, 0x01, 0x80,
+ 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_trek 71
+[TK_MAC_XCURSOR_trek] = {
+ 0x01, 0x00, 0x00, 0x00, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0, 0x0E, 0xE0, 0x0F, 0xE0, 0x07, 0xC0,
+ 0x03, 0x80, 0x01, 0x00, 0x0B, 0xA0, 0x0D, 0x60, 0x09, 0x20, 0x08, 0x20, 0x08, 0x20, 0x00, 0x00,
+ 0x01, 0x00, 0x03, 0x80, 0x07, 0xC0, 0x0F, 0xE0, 0x1F, 0xF0, 0x1F, 0xF0, 0x1F, 0xF0, 0x0F, 0xE0,
+ 0x07, 0xC0, 0x0B, 0xA0, 0x1F, 0xF0, 0x1F, 0xF0, 0x1F, 0xF0, 0x1D, 0x70, 0x1C, 0x70, 0x08, 0x20,
+ 0x00, 0x00, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_ul_angle 72
+[TK_MAC_XCURSOR_ul_angle] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF8, 0x0F, 0xF8, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00,
+ 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF8, 0x0F, 0xF8, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00,
+ 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x00, 0x04,
+},
+
+#define TK_MAC_XCURSOR_umbrella 73
+[TK_MAC_XCURSOR_umbrella] = {
+ 0x00, 0x00, 0x08, 0x90, 0x02, 0x28, 0x49, 0xA6, 0x27, 0xC8, 0x19, 0x30, 0x61, 0x0C, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x40, 0x01, 0x40, 0x00, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x0F, 0xF0, 0x1F, 0xF8, 0x7F, 0xFE, 0x7F, 0xFC, 0xFF, 0xFE, 0xFB, 0xBE, 0xE3, 0x8E,
+ 0x03, 0x80, 0x03, 0x80, 0x03, 0x80, 0x03, 0xC0, 0x03, 0xE0, 0x03, 0xE0, 0x01, 0xC0, 0x00, 0x80,
+ 0x00, 0x04, 0x00, 0x07,
+},
+
+#define TK_MAC_XCURSOR_ur_angle 74
+[TK_MAC_XCURSOR_ur_angle] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xF0, 0x1F, 0xF0, 0x00, 0x30, 0x00, 0x30,
+ 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xF0, 0x1F, 0xF0, 0x00, 0x30, 0x00, 0x30,
+ 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x00, 0x0B,
+},
+
+#define TK_MAC_XCURSOR_watch 75
+[TK_MAC_XCURSOR_watch] = {
+ 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x08, 0x10, 0x10, 0x88, 0x10, 0x88, 0x10, 0x8C,
+ 0x13, 0x8C, 0x10, 0x08, 0x10, 0x08, 0x08, 0x10, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0,
+ 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x0F, 0xF0, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xFC,
+ 0x1F, 0xFC, 0x1F, 0xF8, 0x1F, 0xF8, 0x0F, 0xF0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0,
+ 0x00, 0x08, 0x00, 0x0D,
+},
+
+#define TK_MAC_XCURSOR_xterm 76
+[TK_MAC_XCURSOR_xterm] = {
+ 0x0C, 0x60, 0x02, 0x80, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x80, 0x0C, 0x60,
+ 0x0C, 0x60, 0x02, 0x80, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x80, 0x0C, 0x60,
+ 0x00, 0x0B, 0x00, 0x07,
+},
+
+};
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index a09501b..37384eb 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -7,17 +7,18 @@
* eventually be moved into other files.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkMacOSXPrivate.h"
#include "tkMacOSXEvent.h"
#include <IOKit/IOKitLib.h>
+#include <IOKit/hidsystem/IOHIDShared.h>
/*
* Because this file is still under major development Debugger statements are
@@ -31,6 +32,9 @@
#define ROOT_ID 10
+CGFloat tkMacOSXZeroScreenHeight = 0;
+CGFloat tkMacOSXZeroScreenTop = 0;
+
/*
* Declarations of static variables used in this file.
*/
@@ -54,13 +58,8 @@ static int DefaultErrorHandler(Display *display,
static int DestroyImage(XImage *image);
static unsigned long ImageGetPixel(XImage *image, int x, int y);
-static int PutPixel(XImage *image, int x, int y,
+static int ImagePutPixel(XImage *image, int x, int y,
unsigned long pixel);
-#if 0
-static XImage * SubImage(XImage *image, int x, int y,
- unsigned int width, unsigned int height);
-static int AddPixel(XImage *image, long value);
-#endif
/*
*----------------------------------------------------------------------
@@ -83,38 +82,35 @@ void
TkMacOSXDisplayChanged(
Display *display)
{
- GDHandle graphicsDevice;
Screen *screen;
- Rect bounds = {0, 0, 0, 0}, *maxBounds;
+ NSArray *nsScreens;
+
if (display == NULL || display->screens == NULL) {
return;
}
screen = display->screens;
- graphicsDevice = GetMainDevice();
- 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;
-
- maxBounds = (Rect *) screen->ext_data;
- *maxBounds = bounds;
- graphicsDevice = GetDeviceList();
- while (graphicsDevice) {
- OSStatus err;
-
- err = ChkErr(GetAvailableWindowPositioningBounds, graphicsDevice,
- &bounds);
- if (err == noErr) {
- UnionRect(&bounds, maxBounds, maxBounds);
+ nsScreens = [NSScreen screens];
+ if (nsScreens && [nsScreens count]) {
+ NSScreen *s = [nsScreens objectAtIndex:0];
+ NSRect bounds = [s frame], visible = [s visibleFrame];
+ NSRect maxBounds = NSZeroRect;
+
+ tkMacOSXZeroScreenHeight = bounds.size.height;
+ tkMacOSXZeroScreenTop = tkMacOSXZeroScreenHeight -
+ (visible.origin.y + visible.size.height);
+
+ screen->root_depth = NSBitsPerPixelFromDepth([s depth]);
+ screen->width = bounds.size.width;
+ screen->height = bounds.size.height;
+ screen->mwidth = (bounds.size.width * 254 + 360) / 720;
+ screen->mheight = (bounds.size.height * 254 + 360) / 720;
+
+ for (s in nsScreens) {
+ maxBounds = NSUnionRect(maxBounds, [s visibleFrame]);
}
- graphicsDevice = GetNextDevice(graphicsDevice);
+ *((NSRect *)screen->ext_data) = maxBounds;
}
}
@@ -137,12 +133,15 @@ TkMacOSXDisplayChanged(
TkDisplay *
TkpOpenDisplay(
- CONST char *display_name)
+ const char *display_name)
{
Display *display;
Screen *screen;
int fd = 0;
- static Rect maxBounds = {0, 0, 0, 0};
+ static NSRect maxBounds = {{0, 0}, {0, 0}};
+ static char vendor[25] = "";
+ NSArray *cgVers;
+ NSAutoreleasePool *pool;
if (gMacDisplay != NULL) {
if (strcmp(gMacDisplay->display->display_name, display_name) == 0) {
@@ -152,8 +151,8 @@ TkpOpenDisplay(
}
}
- display = (Display *) ckalloc(sizeof(Display));
- screen = (Screen *) ckalloc(sizeof(Screen));
+ display = ckalloc(sizeof(Display));
+ screen = ckalloc(sizeof(Screen));
bzero(display, sizeof(Display));
bzero(screen, sizeof(Screen));
@@ -166,11 +165,23 @@ TkpOpenDisplay(
display->default_screen = 0;
display->display_name = (char *) macScreenName;
- Gestalt(gestaltQuickdrawVersion, (long *) &display->proto_minor_version);
- display->proto_major_version = 10;
- display->proto_minor_version -= gestaltMacOSXQD;
- display->vendor = "Apple";
- Gestalt(gestaltSystemVersion, (long *) &display->release);
+ pool = [NSAutoreleasePool new];
+ cgVers = [[[NSBundle bundleWithIdentifier:@"com.apple.CoreGraphics"]
+ objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
+ componentsSeparatedByString:@"."];
+ if ([cgVers count] >= 2) {
+ display->proto_major_version = [[cgVers objectAtIndex:1] integerValue];
+ }
+ if ([cgVers count] >= 3) {
+ display->proto_minor_version = [[cgVers objectAtIndex:2] integerValue];
+ }
+ if (!vendor[0]) {
+ snprintf(vendor, sizeof(vendor), "Apple AppKit %s %g",
+ ([NSGarbageCollector defaultCollector] ? "GC" : "RR"),
+ NSAppKitVersionNumber);
+ }
+ display->vendor = vendor;
+ Gestalt(gestaltSystemVersion, (SInt32 *) &display->release);
/*
* These screen bits never change
@@ -181,7 +192,7 @@ TkpOpenDisplay(
screen->white_pixel = 0x00FFFFFF | PIXEL_MAGIC << 24;
screen->ext_data = (XExtData *) &maxBounds;
- screen->root_visual = (Visual *) ckalloc(sizeof(Visual));
+ screen->root_visual = ckalloc(sizeof(Visual));
screen->root_visual->visualid = 0;
screen->root_visual->class = TrueColor;
screen->root_visual->red_mask = 0x00FF0000;
@@ -196,7 +207,7 @@ TkpOpenDisplay(
TkMacOSXDisplayChanged(display);
- gMacDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ gMacDisplay = ckalloc(sizeof(TkDisplay));
/*
* This is the quickest way to make sure that all the *Init flags get
@@ -205,6 +216,7 @@ TkpOpenDisplay(
bzero(gMacDisplay, sizeof(TkDisplay));
gMacDisplay->display = display;
+ [pool drain];
return gMacDisplay;
}
@@ -237,11 +249,11 @@ TkpCloseDisplay(
gMacDisplay = NULL;
if (display->screens != NULL) {
if (display->screens->root_visual != NULL) {
- ckfree((char *) display->screens->root_visual);
+ ckfree(display->screens->root_visual);
}
- ckfree((char *) display->screens);
+ ckfree(display->screens);
}
- ckfree((char *) display);
+ ckfree(display);
}
/*
@@ -272,7 +284,7 @@ TkClipCleanup(
* needed.
*/
- TkSuspendClipboard();
+ [NSApp tkProvidePasteboard:dispPtr];
if (dispPtr->clipWindow != NULL) {
Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
@@ -321,33 +333,6 @@ MacXIdAlloc(
/*
*----------------------------------------------------------------------
*
- * 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
@@ -432,14 +417,11 @@ XGetGeometry(
*border_width_return = winPtr->changes.border_width;
*depth_return = Tk_Depth(winPtr);
} else {
- Rect boundsRect;
- CGrafPtr destPort = TkMacOSXGetDrawablePort(d);
-
- GetPortBounds(destPort, &boundsRect);
- *x_return = boundsRect.left;
- *y_return = boundsRect.top;
- *width_return = boundsRect.right - boundsRect.left;
- *height_return = boundsRect.bottom - boundsRect.top;
+ CGSize size = ((MacDrawable *) d)->size;
+ *x_return = 0;
+ *y_return = 0;
+ *width_return = size.width;
+ *height_return = size.height;
*border_width_return = 0;
*depth_return = 32;
}
@@ -474,7 +456,7 @@ XBell(
Display* display,
int percent)
{
- SysBeep(percent);
+ NSBeep();
}
#if 0
@@ -651,7 +633,8 @@ XGetWindowProperty(
}
void
-XRefreshKeyboardMapping( XMappingEvent* x)
+XRefreshKeyboardMapping(
+ XMappingEvent *x)
{
/* used by tkXEvent.c */
Debugger();
@@ -716,7 +699,7 @@ XSetClipRectangles(
while (n--) {
XRectangle rect = *rectangles;
-
+
rect.x += clip_x_origin;
rect.y += clip_y_origin;
TkUnionRectWithRegion(&rect, clipRgn, clipRgn);
@@ -753,17 +736,20 @@ TkGetServerInfo(
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];
+ char buffer[5 + TCL_INTEGER_SPACE * 2];
+ char buffer2[11 + TCL_INTEGER_SPACE];
- sprintf(buffer, "QD%dR%x ", ProtocolVersion(Tk_Display(tkwin)),
+ snprintf(buffer, sizeof(buffer), "CG%d.%d ",
+ ProtocolVersion(Tk_Display(tkwin)),
ProtocolRevision(Tk_Display(tkwin)));
- sprintf(buffer2, " %x", VendorRelease(Tk_Display(tkwin)));
+ snprintf(buffer2, sizeof(buffer2), " Mac OS X %x",
+ VendorRelease(Tk_Display(tkwin)));
Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)),
buffer2, NULL);
}
#pragma mark XImage handling
+
/*
*----------------------------------------------------------------------
*
@@ -796,7 +782,7 @@ XCreateImage(
XImage *ximage;
display->request++;
- ximage = (XImage *) ckalloc(sizeof(XImage));
+ ximage = ckalloc(sizeof(XImage));
ximage->height = height;
ximage->width = width;
@@ -839,7 +825,7 @@ XCreateImage(
ximage->f.create_image = NULL;
ximage->f.destroy_image = DestroyImage;
ximage->f.get_pixel = ImageGetPixel;
- ximage->f.put_pixel = PutPixel;
+ ximage->f.put_pixel = ImagePutPixel;
ximage->f.sub_image = NULL;
ximage->f.add_pixel = NULL;
@@ -874,37 +860,45 @@ XGetImage(
unsigned long plane_mask,
int format)
{
+ MacDrawable *macDraw = (MacDrawable *) d;
XImage * imagePtr = NULL;
Pixmap pixmap = (Pixmap) NULL;
- Tk_Window win = (Tk_Window) ((MacDrawable *) d)->winPtr;
+ Tk_Window win = (Tk_Window) macDraw->winPtr;
GC gc;
+ char * data = NULL;
int depth = 32;
int offset = 0;
- int bitmap_pad = 32;
+ int bitmap_pad = 0;
int bytes_per_line = 0;
- if (TkMacOSXGetDrawablePort(d)) {
- if (format == ZPixmap) {
- if (width > 0 && height > 0) {
- /*
- * Tk_GetPixmap fails for zero width or height.
- */
+ if (format == ZPixmap) {
+ if (width > 0 && height > 0) {
+ /*
+ * Tk_GetPixmap fails for zero width or height.
+ */
- pixmap = Tk_GetPixmap(display, d, width, height, depth);
- }
- if (win) {
- XGCValues values;
+ pixmap = Tk_GetPixmap(display, d, width, height, depth);
+ }
+ if (win) {
+ XGCValues values;
- gc = Tk_GetGC(win, 0, &values);
- } else {
- gc = XCreateGC(display, pixmap, 0, NULL);
- }
- if (pixmap) {
- XCopyArea(display, d, pixmap, gc, x, y, width, height, 0, 0);
+ gc = Tk_GetGC(win, 0, &values);
+ } else {
+ gc = XCreateGC(display, pixmap, 0, NULL);
+ }
+ if (pixmap) {
+ CGContextRef context;
+
+ XCopyArea(display, d, pixmap, gc, x, y, width, height, 0, 0);
+ context = ((MacDrawable *) pixmap)->context;
+ if (context) {
+ data = CGBitmapContextGetData(context);
+ bytes_per_line = CGBitmapContextGetBytesPerRow(context);
}
+ }
+ if (data) {
imagePtr = XCreateImage(display, NULL, depth, format, offset,
- (char *) TkMacOSXGetDrawablePort(pixmap),
- width, height, bitmap_pad, bytes_per_line);
+ data, width, height, bitmap_pad, bytes_per_line);
/*
* Track Pixmap underlying the XImage in the unused obdata field
@@ -912,14 +906,14 @@ XGetImage(
*/
imagePtr->obdata = (XPointer) pixmap;
- if (!win) {
- XFreeGC(display, gc);
- }
- } else {
- TkpDisplayWarning(
- "XGetImage: only ZPixmap types are implemented",
- "XGetImage Failure");
+ } else if (pixmap) {
+ Tk_FreePixmap(display, pixmap);
}
+ if (!win) {
+ XFreeGC(display, gc);
+ }
+ } else {
+ TkMacOSXDbgMsg("Invalid image format");
}
return imagePtr;
}
@@ -950,7 +944,7 @@ DestroyImage(
} else if (image->data) {
ckfree(image->data);
}
- ckfree((char*) image);
+ ckfree(image);
}
return 0;
}
@@ -977,38 +971,57 @@ ImageGetPixel(
int x,
int y)
{
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- RGBColor cPix;
- unsigned long r, g, b, c;
-
- destPort = (CGrafPtr) image->data;
- portChanged = QDSwapPort(destPort, &savePort);
- GetCPixel(x, y, &cPix);
- if (image->obdata) {
- /*
- * Image from XGetImage, 16 bit color values.
- */
-
- r = (cPix . red) >> 8;
- g = (cPix . green) >> 8;
- b = (cPix . blue) >> 8;
- } else {
- r = cPix . red;
- g = cPix . green;
- b = cPix . blue;
- }
- c = (r<<16)|(g<<8)|(b);
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ unsigned char r = 0, g = 0, b = 0;
+
+ if (image && image->data) {
+ unsigned char *srcPtr = ((unsigned char*) image->data)
+ + (y * image->bytes_per_line)
+ + (((image->xoffset + x) * image->bits_per_pixel) / NBBY);
+
+ switch (image->bits_per_pixel) {
+ case 32: {
+ r = (*((unsigned int*) srcPtr) >> 16) & 0xff;
+ g = (*((unsigned int*) srcPtr) >> 8) & 0xff;
+ b = (*((unsigned int*) srcPtr) ) & 0xff;
+ /*if (image->byte_order == LSBFirst) {
+ r = srcPtr[2]; g = srcPtr[1]; b = srcPtr[0];
+ } else {
+ r = srcPtr[1]; g = srcPtr[2]; b = srcPtr[3];
+ }*/
+ break;
+ }
+ case 16:
+ r = (*((unsigned short*) srcPtr) >> 7) & 0xf8;
+ g = (*((unsigned short*) srcPtr) >> 2) & 0xf8;
+ b = (*((unsigned short*) srcPtr) << 3) & 0xf8;
+ break;
+ case 8:
+ r = (*srcPtr << 2) & 0xc0;
+ g = (*srcPtr << 4) & 0xc0;
+ b = (*srcPtr << 6) & 0xc0;
+ r |= r >> 2 | r >> 4 | r >> 6;
+ g |= g >> 2 | g >> 4 | g >> 6;
+ b |= b >> 2 | b >> 4 | b >> 6;
+ break;
+ case 4: {
+ unsigned char c = (x % 2) ? *srcPtr : (*srcPtr >> 4);
+ r = (c & 0x04) ? 0xff : 0;
+ g = (c & 0x02) ? 0xff : 0;
+ b = (c & 0x01) ? 0xff : 0;
+ break;
+ }
+ case 1:
+ r = g = b = ((*srcPtr) & (0x80 >> (x % 8))) ? 0xff : 0;
+ break;
+ }
}
- return c;
+ return (PIXEL_MAGIC << 24) | (r << 16) | (g << 8) | b;
}
/*
*----------------------------------------------------------------------
*
- * PutPixel --
+ * ImagePutPixel --
*
* Set a single pixel in an image.
*
@@ -1022,64 +1035,53 @@ ImageGetPixel(
*/
static int
-PutPixel(
+ImagePutPixel(
XImage *image,
int x,
int y,
unsigned long pixel)
{
- CGrafPtr destPort, savePort;
- Boolean portChanged;
- RGBColor cPix;
- unsigned long r, g, b;
-
- destPort = (CGrafPtr)image->data;
- portChanged = QDSwapPort(destPort, &savePort);
- r = (pixel & image->red_mask)>>16;
- g = (pixel & image->green_mask)>>8;
- b = (pixel & image->blue_mask);
- if (image->obdata) {
- /*
- * Image from XGetImage, 16 bit color values.
- */
-
- cPix.red = r << 8;
- cPix.green = g << 8;
- cPix.blue = b << 8;
- } else {
- cPix.red = r;
- cPix.green = g;
- cPix.blue = b;
- }
- SetCPixel(x, y, &cPix);
- if (portChanged) {
- QDSwapPort(savePort, NULL);
+ if (image && image->data) {
+ unsigned char r = ((pixel & image->red_mask) >> 16) & 0xff;
+ unsigned char g = ((pixel & image->green_mask) >> 8) & 0xff;
+ unsigned char b = ((pixel & image->blue_mask) ) & 0xff;
+ unsigned char *dstPtr = ((unsigned char*) image->data)
+ + (y * image->bytes_per_line)
+ + (((image->xoffset + x) * image->bits_per_pixel) / NBBY);
+
+ switch (image->bits_per_pixel) {
+ case 32:
+ *((unsigned int*) dstPtr) = (0xff << 24) | (r << 16) |
+ (g << 8) | b;
+ /*if (image->byte_order == LSBFirst) {
+ dstPtr[3] = 0xff; dstPtr[2] = r; dstPtr[1] = g; dstPtr[0] = b;
+ } else {
+ dstPtr[0] = 0xff; dstPtr[1] = r; dstPtr[2] = g; dstPtr[3] = b;
+ }*/
+ break;
+ case 16:
+ *((unsigned short*) dstPtr) = ((r & 0xf8) << 7) |
+ ((g & 0xf8) << 2) | ((b & 0xf8) >> 3);
+ break;
+ case 8:
+ *dstPtr = ((r & 0xc0) >> 2) | ((g & 0xc0) >> 4) |
+ ((b & 0xc0) >> 6);
+ break;
+ case 4: {
+ unsigned char c = ((r & 0x80) >> 5) | ((g & 0x80) >> 6) |
+ ((b & 0x80) >> 7);
+ *dstPtr = (x % 2) ? ((*dstPtr & 0xf0) | (c & 0x0f)) :
+ ((*dstPtr & 0x0f) | ((c << 4) & 0xf0));
+ break;
+ }
+ case 1:
+ *dstPtr = ((r|g|b) & 0x80) ? (*dstPtr | (0x80 >> (x % 8))) :
+ (*dstPtr & ~(0x80 >> (x % 8)));
+ break;
+ }
}
return 0;
}
-
-#if 0
-static XImage *
-SubImage(
- XImage *image,
- int x,
- int y,
- unsigned int width,
- unsigned int height)
-{
- Debugger();
- return NULL;
-}
-
-static int
-AddPixel(
- XImage *image,
- long value)
-{
- Debugger();
- return 0;
-}
-#endif
/*
*----------------------------------------------------------------------
@@ -1102,24 +1104,24 @@ AddPixel(
void
XChangeWindowAttributes(
- Display* display,
+ Display *display,
Window w,
unsigned long value_mask,
- XSetWindowAttributes* attributes)
+ XSetWindowAttributes *attributes)
{
}
void
XSetWindowBackground(
- Display *display,
- Window window,
- unsigned long value)
+ Display *display,
+ Window window,
+ unsigned long value)
{
}
void
XSetWindowBackgroundPixmap(
- Display* display,
+ Display *display,
Window w,
Pixmap background_pixmap)
{
@@ -1127,7 +1129,7 @@ XSetWindowBackgroundPixmap(
void
XSetWindowBorder(
- Display* display,
+ Display *display,
Window w,
unsigned long border_pixel)
{
@@ -1135,7 +1137,7 @@ XSetWindowBorder(
void
XSetWindowBorderPixmap(
- Display* display,
+ Display *display,
Window w,
Pixmap border_pixmap)
{
@@ -1143,7 +1145,7 @@ XSetWindowBorderPixmap(
void
XSetWindowBorderWidth(
- Display* display,
+ Display *display,
Window w,
unsigned int width)
{
@@ -1151,7 +1153,7 @@ XSetWindowBorderWidth(
void
XSetWindowColormap(
- Display* display,
+ Display *display,
Window w,
Colormap colormap)
{
@@ -1160,24 +1162,25 @@ XSetWindowColormap(
Status
XStringListToTextProperty(
- char** list,
+ char **list,
int count,
- XTextProperty* text_prop_return)
+ XTextProperty *text_prop_return)
{
Debugger();
return (Status) 0;
}
+
void
XSetWMClientMachine(
- Display* display,
+ Display *display,
Window w,
- XTextProperty* text_prop)
+ XTextProperty *text_prop)
{
Debugger();
}
+
XIC
-XCreateIC(
- void)
+XCreateIC(void)
{
Debugger();
return (XIC) 0;
@@ -1200,10 +1203,10 @@ XCreateIC(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
TkGetDefaultScreenName(
Tcl_Interp *interp, /* Not used. */
- CONST char *screenName) /* If NULL, use default string. */
+ const char *screenName) /* If NULL, use default string. */
{
#if 0
if ((screenName == NULL) || (screenName[0] == '\0')) {
@@ -1304,5 +1307,35 @@ void
Tk_ResetUserInactiveTime(
Display *dpy)
{
- UpdateSystemActivity(UsrActivity);
+ IOGPoint loc;
+ kern_return_t kr;
+ NXEvent nullEvent = {NX_NULLEVENT, {0, 0}, 0, -1, 0};
+ enum { kNULLEventPostThrottle = 10 };
+ static io_connect_t io_connection = MACH_PORT_NULL;
+
+ if (io_connection == MACH_PORT_NULL) {
+ io_service_t service = IOServiceGetMatchingService(
+ kIOMasterPortDefault, IOServiceMatching(kIOHIDSystemClass));
+
+ if (service == MACH_PORT_NULL) {
+ return;
+ }
+ kr = IOServiceOpen(service, mach_task_self(), kIOHIDParamConnectType,
+ &io_connection);
+ IOObjectRelease(service);
+ if (kr != KERN_SUCCESS) {
+ return;
+ }
+ }
+ kr = IOHIDPostEvent(io_connection, NX_NULLEVENT, loc, &nullEvent.data,
+ FALSE, 0, FALSE);
}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index e5ae257..fe873f3 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -5,7 +5,9 @@
*
* Copyright (c) 2004 Joe English
* Copyright (c) 2005 Neil Madden
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple Inc.
+ * Copyright 2009 Kevin Walzer/WordTech Communications LLC.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -31,28 +33,16 @@
#include "tkMacOSXPrivate.h"
#include "ttk/ttkTheme.h"
-#if !defined(BUILD_tile)
/*
* Use this version in the core:
*/
#define BEGIN_DRAWING(d) { \
TkMacOSXDrawingContext dc; \
- if (!TkMacOSXSetupDrawingContext((d), NULL, 0, &dc)) {return;}
+ if (!TkMacOSXSetupDrawingContext((d), NULL, 1, &dc)) {return;}
#define END_DRAWING \
TkMacOSXRestoreDrawingContext(&dc); }
-#else /* BUILD_tile */
-/*
- * TkMacOSXSetupDrawingContext is not available to extensions,
- * need to do this the hard way in Tile:
- */
-#define BEGIN_DRAWING(d) { \
- CGrafPtr saveWorld; GDHandle saveDevice; \
- GetGWorld(&saveWorld, &saveDevice); \
- SetGWorld(TkMacOSXGetDrawablePort(d), 0); \
- TkMacOSXSetUpClippingRgn(d);
-#define END_DRAWING \
- SetGWorld(saveWorld,saveDevice); }
-#endif /* defined(BUILD_TILE) */
+
+#define HIOrientation kHIThemeOrientationNormal
#ifdef __LP64__
#define RangeToFactor(maximum) (((double) (INT_MAX >> 1)) / (maximum))
@@ -69,48 +59,20 @@
* Convert a Ttk_Box in Tk coordinates relative to the given Drawable
* to a native Rect relative to the containing port.
*/
-static inline Rect BoxToRect(Drawable d, Ttk_Box b)
+static inline CGRect BoxToRect(Drawable d, Ttk_Box b)
{
MacDrawable *md = (MacDrawable*)d;
- Rect rect;
+ CGRect rect;
- rect.top = b.y + md->yOff;
- rect.left = b.x + md->xOff;
- rect.bottom = rect.top + b.height;
- rect.right = rect.left + b.width;
+ rect.origin.y = b.y + md->yOff;
+ rect.origin.x = b.x + md->xOff;
+ rect.size.height = b.height;
+ rect.size.width = b.width;
return rect;
}
/*
- * PatternOrigin --
- * Compute brush pattern origin for a Drawable relative to a Tk_Window.
- *
- * Notes: This will only be nonzero if the Drawable is an off-screen pixmap.
- * See also SF bug #1157739.
- */
-static Point PatternOrigin(Tk_Window tkwin, Drawable d)
-{
- MacDrawable *md = (MacDrawable*)d;
- Rect bounds;
- Point origin;
-
- TkMacOSXWinBounds((TkWindow *) tkwin, &bounds);
- origin.h = md->xOff - bounds.left;
- origin.v = md->yOff - bounds.top;
-
- return origin;
-}
-
-/*
- * DontErase --
- * No-op ThemeEraseProc, can be passed to DrawThemeButton &c.
- */
-static void DontErase(
- const Rect *bounds, UInt32 eraseData, SInt16 depth, Boolean isColorDev)
-{ }
-
-/*
* Table mapping Tk states to Appearance manager ThemeStates
*/
@@ -145,16 +107,16 @@ static Ttk_Padding ButtonMargins = {2,2,2,2};
typedef struct {
ThemeButtonKind kind;
ThemeMetric heightMetric;
-} ThemeButtonParms;
+} ThemeButtonParams;
-static ThemeButtonParms
- PushButtonParms = { kThemePushButton, kThemeMetricPushButtonHeight },
- CheckBoxParms = { kThemeCheckBox, kThemeMetricCheckBoxHeight },
- RadioButtonParms = { kThemeRadioButton, kThemeMetricRadioButtonHeight },
- BevelButtonParms = { kThemeBevelButton, NoThemeMetric },
- PopupButtonParms = { kThemePopupButton, kThemeMetricPopupButtonHeight },
- DisclosureParms = { kThemeDisclosureButton, kThemeMetricDisclosureTriangleHeight },
- ListHeaderParms = { kThemeListHeaderButton, kThemeMetricListHeaderHeight };
+static ThemeButtonParams
+ PushButtonParams = { kThemePushButton, kThemeMetricPushButtonHeight },
+ CheckBoxParams = { kThemeCheckBox, kThemeMetricCheckBoxHeight },
+ RadioButtonParams = { kThemeRadioButton, kThemeMetricRadioButtonHeight },
+ BevelButtonParams = { kThemeBevelButton, NoThemeMetric },
+ PopupButtonParams = { kThemePopupButton, kThemeMetricPopupButtonHeight },
+ DisclosureParams = { kThemeDisclosureButton, kThemeMetricDisclosureTriangleHeight },
+ ListHeaderParams = { kThemeListHeaderButton, kThemeMetricListHeaderHeight };
static Ttk_StateTable ButtonValueTable[] = {
{ kThemeButtonMixed, TTK_STATE_ALTERNATE, 0 },
@@ -173,16 +135,18 @@ static Ttk_StateTable ButtonAdornmentTable[] = {
/*
* computeButtonDrawInfo --
- * Fill in an appearance manager ThemeButtonDrawInfo record.
+ * Fill in an appearance manager HIThemeButtonDrawInfo record.
*/
-static ThemeButtonDrawInfo computeButtonDrawInfo(
- ThemeButtonParms *parms, Ttk_State state)
+static inline HIThemeButtonDrawInfo computeButtonDrawInfo(
+ ThemeButtonParams *params, Ttk_State state)
{
- ThemeButtonDrawInfo info;
-
- info.state = Ttk_StateTableLookup(ThemeStateTable, state);
- info.value = Ttk_StateTableLookup(ButtonValueTable, state);
- info.adornment = Ttk_StateTableLookup(ButtonAdornmentTable, state);
+ const HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .kind = params ? params->kind : 0,
+ .value = Ttk_StateTableLookup(ButtonValueTable, state),
+ .adornment = Ttk_StateTableLookup(ButtonAdornmentTable, state),
+ };
return info;
}
@@ -190,12 +154,12 @@ static void ButtonElementSizeNoPadding(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ThemeButtonParms *parms = clientData;
+ ThemeButtonParams *params = clientData;
- if (parms->heightMetric != NoThemeMetric) {
+ if (params->heightMetric != NoThemeMetric) {
SInt32 height;
- ChkErr(GetThemeMetric, parms->heightMetric, &height);
+ ChkErr(GetThemeMetric, params->heightMetric, &height);
*heightPtr = height;
}
}
@@ -204,10 +168,10 @@ static void ButtonElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- ThemeButtonParms *parms = clientData;
- ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, 0);
- static const Rect scratchBounds = {0, 0, 100, 100};
- Rect contentBounds;
+ ThemeButtonParams *params = clientData;
+ const HIThemeButtonDrawInfo info = computeButtonDrawInfo(params, 0);
+ static const CGRect scratchBounds = {{0, 0}, {100, 100}};
+ CGRect contentBounds;
ButtonElementSizeNoPadding(
clientData, elementRecord, tkwin,
@@ -218,13 +182,13 @@ static void ButtonElementSize(
* for the content bounds of a dummy rectangle, then use
* the difference as the padding.
*/
- ChkErr(GetThemeButtonContentBounds,
- &scratchBounds, parms->kind, &info, &contentBounds);
+ ChkErr(HIThemeGetButtonContentBounds,
+ &scratchBounds, &info, &contentBounds);
- paddingPtr->left = contentBounds.left;
- paddingPtr->top = contentBounds.top;
- paddingPtr->right = scratchBounds.right - contentBounds.right + 1;
- paddingPtr->bottom = scratchBounds.bottom - contentBounds.bottom;
+ paddingPtr->left = CGRectGetMinX(contentBounds);
+ paddingPtr->top = CGRectGetMinY(contentBounds);
+ paddingPtr->right = CGRectGetMaxX(scratchBounds) - CGRectGetMaxX(contentBounds) + 1;
+ paddingPtr->bottom = CGRectGetMaxY(scratchBounds) - CGRectGetMaxY(contentBounds);
/*
* Now add a little extra padding to account for drop shadows.
@@ -240,12 +204,12 @@ static void ButtonElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- ThemeButtonParms *parms = clientData;
- ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, state);
- Rect bounds = BoxToRect(d, Ttk_PadBox(b, ButtonMargins));
+ ThemeButtonParams *params = clientData;
+ CGRect bounds = BoxToRect(d, Ttk_PadBox(b, ButtonMargins));
+ const HIThemeButtonDrawInfo info = computeButtonDrawInfo(params, state);
BEGIN_DRAWING(d)
- ChkErr(DrawThemeButton, &bounds, parms->kind, &info, NULL, NULL, NULL, 0);
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}
@@ -261,26 +225,77 @@ static Ttk_ElementSpec ButtonElementSpec = {
* +++ Notebook elements.
*/
+
+/* Tab position logic, c.f. ttkNotebook.c TabState() */
+
+#define TTK_STATE_NOTEBOOK_FIRST TTK_STATE_USER1
+#define TTK_STATE_NOTEBOOK_LAST TTK_STATE_USER2
static Ttk_StateTable TabStyleTable[] = {
- { kThemeTabFrontInactive, TTK_STATE_SELECTED|TTK_STATE_BACKGROUND, 0 },
- { kThemeTabNonFrontInactive, TTK_STATE_BACKGROUND, 0 },
- { kThemeTabFrontUnavailable, TTK_STATE_DISABLED|TTK_STATE_SELECTED, 0 },
- { kThemeTabNonFrontUnavailable, TTK_STATE_DISABLED, 0 },
- { kThemeTabFront, TTK_STATE_SELECTED, 0 },
- { kThemeTabNonFrontPressed, TTK_STATE_PRESSED, 0 },
- { kThemeTabNonFront, 0,0 }
+ { kThemeTabFrontInactive, TTK_STATE_SELECTED|TTK_STATE_BACKGROUND},
+ { kThemeTabNonFrontInactive, TTK_STATE_BACKGROUND},
+ { kThemeTabFrontUnavailable, TTK_STATE_DISABLED|TTK_STATE_SELECTED},
+ { kThemeTabNonFrontUnavailable, TTK_STATE_DISABLED},
+ { kThemeTabFront, TTK_STATE_SELECTED},
+ { kThemeTabNonFrontPressed, TTK_STATE_PRESSED},
+ { kThemeTabNonFront, 0}
+};
+
+static Ttk_StateTable TabAdornmentTable[] = {
+ { kHIThemeTabAdornmentNone,
+ TTK_STATE_NOTEBOOK_FIRST|TTK_STATE_NOTEBOOK_LAST},
+ {kHIThemeTabAdornmentTrailingSeparator, TTK_STATE_NOTEBOOK_FIRST},
+ {kHIThemeTabAdornmentNone, TTK_STATE_NOTEBOOK_LAST},
+ {kHIThemeTabAdornmentTrailingSeparator, 0 },
+};
+
+static Ttk_StateTable TabPositionTable[] = {
+ { kHIThemeTabPositionOnly,
+ TTK_STATE_NOTEBOOK_FIRST|TTK_STATE_NOTEBOOK_LAST},
+ { kHIThemeTabPositionFirst, TTK_STATE_NOTEBOOK_FIRST},
+ { kHIThemeTabPositionLast, TTK_STATE_NOTEBOOK_LAST},
+ { kHIThemeTabPositionMiddle, 0 },
};
/*
- * Quoth DrawThemeTab() reference manual:
- * "Small tabs have a height of 16 pixels large tabs have a height of
- * 21 pixels. (The widths of tabs are variable.) Additionally, the
- * distance that the tab overlaps the pane must be included in the tab
- * rectangle this overlap distance is always 3 pixels, although the
- * 3-pixel overlap is only drawn for the front tab."
+ * Apple XHIG Tab View Specifications:
+ *
+ * Control sizes: Tab views are available in regular, small, and mini sizes.
+ * The tab height is fixed for each size, but you control the size of the pane
+ * area. The tab heights for each size are listed below:
+ * - Regular size: 20 pixels.
+ * - Small: 17 pixels.
+ * - Mini: 15 pixels.
+ *
+ * Label spacing and fonts: The tab labels should be in a font that’s
+ * proportional to the size of the tab view control. In addition, the label
+ * should be placed so that there are equal margins of space before and after
+ * it. The guidelines below provide the specifications you should use for tab
+ * labels:
+ * - Regular size: System font. Center in tab, leaving 12 pixels on each side.
+ * - Small: Small system font. Center in tab, leaving 10 pixels on each side.
+ * - Mini: Mini system font. Center in tab, leaving 8 pixels on each side.
+ *
+ * Control spacing: Whether you decide to inset a tab view in a window or
+ * extend its edges to the window sides and bottom, you should place the top
+ * edge of the tab view 12 or 14 pixels below the bottom edge of the title bar
+ * (or toolbar, if there is one). If you choose to inset a tab view in a
+ * window, you should leave a margin of 20 pixels between the sides and bottom
+ * of the tab view and the sides and bottom of the window (although 16 pixels
+ * is also an acceptable margin-width). If you need to provide controls below
+ * the tab view, leave enough space below the tab view so the controls are 20
+ * pixels above the bottom edge of the window and 12 pixels between the tab
+ * view and the controls.
+ * If you choose to extend the tab view sides and bottom so that they meet the
+ * window sides and bottom, you should leave a margin of at least 20 pixels
+ * between the content in the tab view and the tab-view edges.
+ *
+ * <URL: http://developer.apple.com/documentation/userexperience/Conceptual/
+ * AppleHIGuidelines/XHIGControls/XHIGControls.html#//apple_ref/doc/uid/
+ * TP30000359-TPXREF116>
*/
-static const int TAB_HEIGHT = 21;
-static const int TAB_OVERLAP = 3;
+
+static const int TAB_HEIGHT = 10;
+static const int TAB_OVERLAP = 10;
static void TabElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
@@ -293,12 +308,20 @@ static void TabElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, b);
- ThemeTabStyle tabStyle = Ttk_StateTableLookup(TabStyleTable, state);
-
- bounds.bottom += TAB_OVERLAP;
+ CGRect bounds = BoxToRect(d, b);
+ HIThemeTabDrawInfo info = {
+ .version = 1,
+ .style = Ttk_StateTableLookup(TabStyleTable, state),
+ .direction = kThemeTabNorth,
+ .size = kHIThemeTabSizeNormal,
+ .adornment = Ttk_StateTableLookup(TabAdornmentTable, state),
+ .kind = kHIThemeTabKindNormal,
+ .position = Ttk_StateTableLookup(TabPositionTable, state),
+ };
+
+ bounds.size.height += TAB_OVERLAP;
BEGIN_DRAWING(d)
- ChkErr(DrawThemeTab, &bounds, tabStyle, kThemeTabNorth, 0, 0);
+ ChkErr(HIThemeDrawTab, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}
@@ -317,19 +340,27 @@ static void PaneElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- /* Padding determined by trial-and-error */
- *paddingPtr = Ttk_MakePadding(2, 8, 2, 2);
+ *paddingPtr = Ttk_MakePadding(9, 5, 9, 9);
}
static void PaneElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, b);
- ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
-
+ CGRect bounds = BoxToRect(d, b);
+ HIThemeTabPaneDrawInfo info = {
+ .version = 1,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .direction = kThemeTabNorth,
+ .size = kHIThemeTabSizeNormal,
+ .kind = kHIThemeTabKindNormal,
+ .adornment = kHIThemeTabPaneAdornmentNormal,
+ };
+
+ bounds.origin.y -= TAB_OVERLAP;
+ bounds.size.height += TAB_OVERLAP;
BEGIN_DRAWING(d)
- ChkErr(DrawThemeTabPane, &bounds, drawState);
+ ChkErr(HIThemeDrawTabPane, &bounds, &info, dc.context, HIOrientation);
END_DRAWING
}
@@ -362,11 +393,15 @@ static void GroupElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, b);
- ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+ CGRect bounds = BoxToRect(d, b);
+ const HIThemeGroupBoxDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .kind = kHIThemeGroupBoxKindPrimaryOpaque,
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemePrimaryGroup, &bounds, drawState);
+ ChkErr(HIThemeDrawGroupBox, &bounds, &info, dc.context, HIOrientation);
END_DRAWING
}
@@ -408,8 +443,13 @@ static void EntryElementDraw(
EntryElement *e = elementRecord;
Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin,e->backgroundObj);
Ttk_Box inner = Ttk_PadBox(b, Ttk_UniformPadding(3));
- Rect bounds = BoxToRect(d, inner);
- ThemeDrawState drawState = Ttk_StateTableLookup(ThemeStateTable, state);
+ CGRect bounds = BoxToRect(d, inner);
+ const HIThemeFrameDrawInfo info = {
+ .version = 0,
+ .kind = kHIThemeFrameTextFieldSquare,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .isFocused = state & TTK_STATE_FOCUS,
+ };
/*
* Erase w/background color:
@@ -419,10 +459,10 @@ static void EntryElementDraw(
inner.x,inner.y, inner.width, inner.height);
BEGIN_DRAWING(d)
- ChkErr(DrawThemeEditTextFrame, &bounds, drawState);
- if (state & TTK_STATE_FOCUS) {
+ ChkErr(HIThemeDrawFrame, &bounds, &info, dc.context, HIOrientation);
+ /*if (state & TTK_STATE_FOCUS) {
ChkErr(DrawThemeFocusRect, &bounds, 1);
- }
+ }*/
END_DRAWING
}
@@ -458,13 +498,17 @@ static void ComboboxElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- ThemeButtonParms *parms = clientData;
- ThemeButtonDrawInfo info = computeButtonDrawInfo(parms, state);
- Rect bounds = BoxToRect(d, Ttk_PadBox(b, ComboboxMargins));
+ CGRect bounds = BoxToRect(d, Ttk_PadBox(b, ComboboxMargins));
+ const HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .kind = kThemeComboBox,
+ .value = Ttk_StateTableLookup(ButtonValueTable, state),
+ .adornment = Ttk_StateTableLookup(ButtonAdornmentTable, state),
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemeButton,
- &bounds, kThemeComboBox, &info, NULL, NULL, NULL, 0);
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}
@@ -501,20 +545,20 @@ static void SpinButtonElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, Ttk_PadBox(b, SpinbuttonMargins));
- ThemeButtonDrawInfo info;
-
+ CGRect bounds = BoxToRect(d, Ttk_PadBox(b, SpinbuttonMargins));
/* @@@ can't currently distinguish PressedUp (== Pressed) from PressedDown;
* ignore this bit for now [see #2219588]
*/
- info.state = Ttk_StateTableLookup(ThemeStateTable,
- state & ~TTK_STATE_PRESSED);
- info.value = Ttk_StateTableLookup(ButtonValueTable, state);
- info.adornment = kThemeAdornmentNone;
+ const HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state & ~TTK_STATE_PRESSED),
+ .kind = kThemeIncDecButton,
+ .value = Ttk_StateTableLookup(ButtonValueTable, state),
+ .adornment = kThemeAdornmentNone,
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemeButton,
- &bounds, kThemeIncDecButton, &info, NULL, NULL, NULL, 0);
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}
@@ -580,40 +624,37 @@ static void TrackElementDraw(
{
TrackElementData *data = clientData;
TrackElement *elem = elementRecord;
- double from = 0, to = 100, value = 0, factor;
int orientation = TTK_ORIENT_HORIZONTAL;
- ThemeTrackDrawInfo info;
+ double from = 0, to = 100, value = 0, factor;
+ Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation);
Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from);
Tcl_GetDoubleFromObj(NULL, elem->toObj, &to);
Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value);
- Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation);
factor = RangeToFactor(to - from);
- info.kind = data->kind;
- info.bounds = BoxToRect(d, b);
- info.min = (int) from * factor;
- info.max = (int) to * factor;
- info.value = (int) value * factor;
-
- info.attributes = orientation == TTK_ORIENT_HORIZONTAL
- ? kThemeTrackHorizontal : 0;
- info.attributes |= kThemeTrackShowThumb;
- info.enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state);
-
- switch (data->kind) {
- case kThemeProgressBar:
- info.trackInfo.progress.phase = 0; /* 1-4: animation phase */
- break;
- case kThemeSlider:
- info.trackInfo.slider.pressState = 0; /* @@@ fill this in */
- info.trackInfo.slider.thumbDir = kThemeThumbPlain;
- /* kThemeThumbUpward, kThemeThumbDownward, kThemeThumbPlain */
- break;
+ HIThemeTrackDrawInfo info = {
+ .version = 0,
+ .kind = data->kind,
+ .bounds = BoxToRect(d, b),
+ .min = from * factor,
+ .max = to * factor,
+ .value = value * factor,
+ .attributes = kThemeTrackShowThumb |
+ (orientation == TTK_ORIENT_HORIZONTAL ?
+ kThemeTrackHorizontal : 0),
+ .enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state),
+ .trackInfo.progress.phase = 0,
+ };
+
+ if (info.kind == kThemeSlider) {
+ info.trackInfo.slider.pressState = state & TTK_STATE_PRESSED ?
+ kThemeThumbPressed : 0;
+ info.trackInfo.slider.thumbDir = kThemeThumbPlain;
}
BEGIN_DRAWING(d)
- ChkErr(DrawThemeTrack, &info, NULL, NULL, 0);
+ ChkErr(HIThemeDrawTrack, &info, NULL, dc.context, HIOrientation);
END_DRAWING
}
@@ -695,10 +736,8 @@ static void PbarElementDraw(
Drawable d, Ttk_Box b, Ttk_State state)
{
PbarElement *pbar = elementRecord;
- int orientation = TTK_ORIENT_HORIZONTAL;
+ int orientation = TTK_ORIENT_HORIZONTAL, phase = 0;
double value = 0, maximum = 100, factor;
- int phase = 0;
- ThemeTrackDrawInfo info;
Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation);
Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
@@ -706,23 +745,23 @@ static void PbarElementDraw(
Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
factor = RangeToFactor(maximum);
- if (!strcmp("indeterminate", Tcl_GetString(pbar->modeObj)) && value) {
- info.kind = kThemeIndeterminateBar;
- } else {
- info.kind = kThemeProgressBar;
- }
- info.bounds = BoxToRect(d, b);
- info.min = 0;
- info.max = (int) maximum * factor;
- info.value = (int) value * factor;
- info.attributes = orientation == TTK_ORIENT_HORIZONTAL
- ? kThemeTrackHorizontal : 0;
- info.attributes |= kThemeTrackShowThumb;
- info.enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state);
- info.trackInfo.progress.phase = phase;
+ HIThemeTrackDrawInfo info = {
+ .version = 0,
+ .kind = (!strcmp("indeterminate", Tcl_GetString(pbar->modeObj)) && value) ?
+ kThemeIndeterminateBar : kThemeProgressBar,
+ .bounds = BoxToRect(d, b),
+ .min = 0,
+ .max = maximum * factor,
+ .value = value * factor,
+ .attributes = kThemeTrackShowThumb |
+ (orientation == TTK_ORIENT_HORIZONTAL ?
+ kThemeTrackHorizontal : 0),
+ .enableState = Ttk_StateTableLookup(ThemeTrackEnableTable, state),
+ .trackInfo.progress.phase = phase,
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemeTrack, &info, NULL, NULL, 0);
+ ChkErr(HIThemeDrawTrack, &info, NULL, dc.context, HIOrientation);
END_DRAWING
}
@@ -753,16 +792,15 @@ static void SeparatorElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- Rect bounds = BoxToRect(d, b);
- ThemeDrawState drawState;
+ CGRect bounds = BoxToRect(d, b);
+ const HIThemeSeparatorDrawInfo info = {
+ .version = 0,
+ /* Separator only supports kThemeStateActive, kThemeStateInactive */
+ .state = Ttk_StateTableLookup(ThemeStateTable, state & TTK_STATE_BACKGROUND),
+ };
- /*
- * DrawThemeSeparator only supports kThemeStateActive / kThemeStateInactive
- */
- state &= TTK_STATE_BACKGROUND;
- drawState = Ttk_StateTableLookup(ThemeStateTable, state);
BEGIN_DRAWING(d)
- ChkErr(DrawThemeSeparator, &bounds, drawState);
+ ChkErr(HIThemeDrawSeparator, &bounds, &info, dc.context, HIOrientation);
END_DRAWING
}
@@ -784,29 +822,36 @@ static void SizegripElementSize(
void *clientData, void *elementRecord, Tk_Window tkwin,
int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr)
{
- Point origin = {0, 0};
- Rect bounds;
-
- ChkErr(GetThemeStandaloneGrowBoxBounds,
- origin, sizegripGrowDirection, false, &bounds);
- *widthPtr = bounds.right - bounds.left;
- *heightPtr = bounds.bottom - bounds.top;
+ HIThemeGrowBoxDrawInfo info = {
+ .version = 0,
+ .state = kThemeStateActive,
+ .kind = kHIThemeGrowBoxKindNormal,
+ .direction = sizegripGrowDirection,
+ .size = kHIThemeGrowBoxSizeNormal,
+ };
+ CGRect bounds = CGRectZero;
+
+ ChkErr(HIThemeGetGrowBoxBounds, &bounds.origin, &info, &bounds);
+ *widthPtr = bounds.size.width;
+ *heightPtr = bounds.size.height;
}
static void SizegripElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, unsigned int state)
{
- Rect bounds = BoxToRect(d, b);
- Point origin = {bounds.top, bounds.left};
-
- /* Grow box only supports kThemeStateActive, kThemeStateInactive */
- state &= TTK_STATE_BACKGROUND;
+ CGRect bounds = BoxToRect(d, b);
+ HIThemeGrowBoxDrawInfo info = {
+ .version = 0,
+ /* Grow box only supports kThemeStateActive, kThemeStateInactive */
+ .state = Ttk_StateTableLookup(ThemeStateTable, state & TTK_STATE_BACKGROUND),
+ .kind = kHIThemeGrowBoxKindNormal,
+ .direction = sizegripGrowDirection,
+ .size = kHIThemeGrowBoxSizeNormal,
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemeStandaloneGrowBox,
- origin, sizegripGrowDirection, false,
- Ttk_StateTableLookup(ThemeStateTable, state));
+ ChkErr(HIThemeDrawGrowBox, &bounds.origin, &info, dc.context, HIOrientation);
END_DRAWING
}
@@ -834,15 +879,15 @@ static void FillElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, b);
+ CGRect bounds = BoxToRect(d, b);
ThemeBrush brush = (state & TTK_STATE_BACKGROUND)
? kThemeBrushModelessDialogBackgroundInactive
: kThemeBrushModelessDialogBackgroundActive;
BEGIN_DRAWING(d)
- ChkErr(SetThemeBackground, brush, 32, true);
- QDSetPatternOrigin(PatternOrigin(tkwin, d));
- EraseRect(&bounds);
+ ChkErr(HIThemeSetFill, brush, NULL, dc.context, HIOrientation);
+ //QDSetPatternOrigin(PatternOrigin(tkwin, d));
+ CGContextFillRect(dc.context, bounds);
END_DRAWING
}
@@ -889,12 +934,12 @@ static void ToolbarBackgroundElementDraw(
Drawable d, Ttk_Box b, Ttk_State state)
{
ThemeBrush brush = kThemeBrushToolbarBackground;
- Rect bounds = BoxToRect(d, Ttk_WinBox(tkwin));
+ CGRect bounds = BoxToRect(d, Ttk_WinBox(tkwin));
BEGIN_DRAWING(d)
- ChkErr(SetThemeBackground, brush, 32, true);
- QDSetPatternOrigin(PatternOrigin(tkwin, d));
- EraseRect(&bounds);
+ ChkErr(HIThemeSetFill, brush, NULL, dc.context, HIOrientation);
+ //QDSetPatternOrigin(PatternOrigin(tkwin, d));
+ CGContextFillRect(dc.context, bounds);
END_DRAWING
}
@@ -911,26 +956,39 @@ static Ttk_ElementSpec ToolbarBackgroundElementSpec = {
* Redefine the header to use a kThemeListHeaderButton.
*/
+#define TTK_TREEVIEW_STATE_SORTARROW TTK_STATE_USER1
+static Ttk_StateTable TreeHeaderValueTable[] = {
+ { kThemeButtonOn, TTK_STATE_ALTERNATE},
+ { kThemeButtonOn, TTK_STATE_SELECTED},
+ { kThemeButtonOff, 0}
+};
static Ttk_StateTable TreeHeaderAdornmentTable[] = {
- { kThemeAdornmentHeaderButtonSortUp, TTK_STATE_ALTERNATE, 0 },
- { kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 },
- { kThemeAdornmentNone, 0, 0 }
+ { kThemeAdornmentHeaderButtonSortUp,
+ TTK_STATE_ALTERNATE|TTK_TREEVIEW_STATE_SORTARROW},
+ { kThemeAdornmentDefault,
+ TTK_STATE_SELECTED|TTK_TREEVIEW_STATE_SORTARROW},
+ { kThemeAdornmentHeaderButtonNoSortArrow, TTK_STATE_ALTERNATE},
+ { kThemeAdornmentHeaderButtonNoSortArrow, TTK_STATE_SELECTED},
+ { kThemeAdornmentFocus, TTK_STATE_FOCUS},
+ { kThemeAdornmentNone, 0}
};
static void TreeHeaderElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- ThemeButtonParms *parms = clientData;
- Rect bounds = BoxToRect(d, b);
- ThemeButtonDrawInfo info;
-
- info.state = Ttk_StateTableLookup(ThemeStateTable, state);
- info.value = Ttk_StateTableLookup(ButtonValueTable, state);
- info.adornment = Ttk_StateTableLookup(TreeHeaderAdornmentTable, state);
+ ThemeButtonParams *params = clientData;
+ CGRect bounds = BoxToRect(d, b);
+ const HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .kind = params->kind,
+ .value = Ttk_StateTableLookup(TreeHeaderValueTable, state),
+ .adornment = Ttk_StateTableLookup(TreeHeaderAdornmentTable, state),
+ };
BEGIN_DRAWING(d)
- ChkErr(DrawThemeButton, &bounds, parms->kind, &info, NULL, NULL, NULL, 0);
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
END_DRAWING
}
@@ -945,8 +1003,8 @@ static Ttk_ElementSpec TreeHeaderElementSpec = {
/*
* Disclosure triangle:
*/
-#define TTK_TREEVIEW_STATE_OPEN TTK_STATE_USER1
-#define TTK_TREEVIEW_STATE_LEAF TTK_STATE_USER2
+#define TTK_TREEVIEW_STATE_OPEN TTK_STATE_USER1
+#define TTK_TREEVIEW_STATE_LEAF TTK_STATE_USER2
static Ttk_StateTable DisclosureValueTable[] = {
{ kThemeDisclosureDown, TTK_TREEVIEW_STATE_OPEN, 0 },
{ kThemeDisclosureRight, 0, 0 },
@@ -968,21 +1026,20 @@ static void DisclosureElementDraw(
void *clientData, void *elementRecord, Tk_Window tkwin,
Drawable d, Ttk_Box b, Ttk_State state)
{
- Rect bounds = BoxToRect(d, b);
- ThemeButtonDrawInfo info;
-
- if (state & TTK_TREEVIEW_STATE_LEAF) {
- return;
+ if (!(state & TTK_TREEVIEW_STATE_LEAF)) {
+ CGRect bounds = BoxToRect(d, b);
+ const HIThemeButtonDrawInfo info = {
+ .version = 0,
+ .state = Ttk_StateTableLookup(ThemeStateTable, state),
+ .kind = kThemeDisclosureTriangle,
+ .value = Ttk_StateTableLookup(DisclosureValueTable, state),
+ .adornment = kThemeAdornmentDrawIndicatorOnly,
+ };
+
+ BEGIN_DRAWING(d)
+ ChkErr(HIThemeDrawButton, &bounds, &info, dc.context, HIOrientation, NULL);
+ END_DRAWING
}
-
- info.state = Ttk_StateTableLookup(ThemeStateTable, state);
- info.value = Ttk_StateTableLookup(DisclosureValueTable, state);
- info.adornment = kThemeAdornmentDrawIndicatorOnly;
-
- BEGIN_DRAWING(d)
- ChkErr(DrawThemeButton,
- &bounds, kThemeDisclosureTriangle, &info, NULL, DontErase, NULL, 0);
- END_DRAWING
}
static Ttk_ElementSpec DisclosureElementSpec = {
@@ -1078,23 +1135,23 @@ static int AquaTheme_Init(Tcl_Interp *interp)
&ToolbarBackgroundElementSpec, 0);
Ttk_RegisterElementSpec(themePtr, "Button.button",
- &ButtonElementSpec, &PushButtonParms);
+ &ButtonElementSpec, &PushButtonParams);
Ttk_RegisterElementSpec(themePtr, "Checkbutton.button",
- &ButtonElementSpec, &CheckBoxParms);
+ &ButtonElementSpec, &CheckBoxParams);
Ttk_RegisterElementSpec(themePtr, "Radiobutton.button",
- &ButtonElementSpec, &RadioButtonParms);
+ &ButtonElementSpec, &RadioButtonParams);
Ttk_RegisterElementSpec(themePtr, "Toolbutton.border",
- &ButtonElementSpec, &BevelButtonParms);
+ &ButtonElementSpec, &BevelButtonParams);
Ttk_RegisterElementSpec(themePtr, "Menubutton.button",
- &ButtonElementSpec, &PopupButtonParms);
+ &ButtonElementSpec, &PopupButtonParams);
Ttk_RegisterElementSpec(themePtr, "Spinbox.spinbutton",
&SpinButtonElementSpec, 0);
Ttk_RegisterElementSpec(themePtr, "Combobox.button",
&ComboboxElementSpec, 0);
Ttk_RegisterElementSpec(themePtr, "Treeitem.indicator",
- &DisclosureElementSpec, &DisclosureParms);
+ &DisclosureElementSpec, &DisclosureParams);
Ttk_RegisterElementSpec(themePtr, "Treeheading.cell",
- &TreeHeaderElementSpec, &ListHeaderParms);
+ &TreeHeaderElementSpec, &ListHeaderParams);
Ttk_RegisterElementSpec(themePtr, "Notebook.tab", &TabElementSpec, 0);
Ttk_RegisterElementSpec(themePtr, "Notebook.client", &PaneElementSpec, 0);
@@ -1134,4 +1191,13 @@ int Ttk_MacOSXPlatformInit(Tcl_Interp *interp)
{
return AquaTheme_Init(interp);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/tests/bell.test b/tests/bell.test
index 16fea0f..4f7df97 100644
--- a/tests/bell.test
+++ b/tests/bell.test
@@ -5,32 +5,40 @@
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test bell-1.1 {bell command} {
- list [catch {bell a} msg] $msg
-} {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 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} {
+test bell-1.1 {bell command} -body {
+ bell a
+} -returnCodes {error} -result {bad option "a": must be -displayof or -nice}
+
+test bell-1.2 {bell command} -body {
+ bell a b
+} -returnCodes {error} -result {bad option "a": must be -displayof or -nice}
+
+test bell-1.3 {bell command} -body {
+ bell -displayof gorp
+} -returnCodes {error} -result {bad window path name "gorp"}
+
+test bell-1.4 {bell command} -body {
+ bell -nice -displayof
+} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"}
+
+test bell-1.5 {bell command} -body {
+ bell -nice -nice -nice
+} -returnCodes {ok} -result {} ;#keep -result {} and -retutnCodes {ok} for clarity?
+
+test bell-1.6 {bell command} -body {
+ bell -displayof . -nice
+} -returnCodes {ok} -result {}
+
+test bell-1.7 {bell command} -body {
+ bell -nice -displayof . -nice
+} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"}
+
+test bell-1.8 {bell command} -body {
puts "Bell should ring now ..."
flush stdout
after 200
@@ -39,8 +47,7 @@ test bell-1.8 {bell command} {
bell -nice
after 200
bell
-} {}
+} -result {}
-# cleanup
cleanupTests
return
diff --git a/tests/bgerror.test b/tests/bgerror.test
index fa33d31..fd9594a 100644
--- a/tests/bgerror.test
+++ b/tests/bgerror.test
@@ -5,49 +5,58 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test bgerror-1.1 {bgerror / tkerror compat} {
+test bgerror-1.1 {bgerror / tkerror compat} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- set errRes $err;
+ global errRes;
+ set errRes $err;
}
+} -body {
after 0 {error err1}
vwait errRes;
- set errRes;
-} err1
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1}
-test bgerror-1.2 {bgerror / tkerror compat / accumulation} {
+test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- lappend errRes $err;
+ global errRes;
+ lappend errRes $err;
}
+} -body {
after 0 {error err1}
after 0 {error err2}
after 0 {error err3}
update
- set errRes;
-} {err1 err2 err3}
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1 err2 err3}
-test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} {
+test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- lappend errRes $err;
- return -code break "skip!";
+ global errRes;
+ lappend errRes $err;
+ return -code break "skip!";
}
+} -body {
after 0 {error err1}
after 0 {error err2}
after 0 {error err3}
update
- set errRes;
-} err1
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1}
-catch {rename tkerror {}}
# some testing of the default error dialog
# would be needed too, but that's not easy at all
diff --git a/tests/bind.test b/tests/bind.test
index 9892fec..c777d66 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -7,2741 +7,6051 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
tk useinputmethods 0
-catch {destroy .b}
-toplevel .b -width 100 -height 50
-wm geom .b +0+0
+toplevel .t -width 100 -height 50
+wm geom .t +0+0
update idletasks
-proc setup {} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- pack .b.f
- focus -force .b.f
- foreach p [event info] {event delete $p}
- update
+foreach p [event info] {event delete $p}
+foreach event [bind Test] {
+ bind Test $event {}
}
-setup
-
-foreach i [bind Test] {
- bind Test $i {}
+foreach event [bind all] {
+ bind all $event {}
}
-foreach i [bind all] {
- bind all $i {}
+
+
+proc unsetBindings {} {
+ bind all <Enter> {}
+ bind Test <Enter> {}
+ bind Toplevel <Enter> {}
+ bind xyz <Enter> {}
+ bind {a b} <Enter> {}
+ bind .t <Enter> {}
}
-test bind-1.1 {bind command} {
- list [catch {bind} msg] $msg
-} {1 {wrong # args: should be "bind window ?pattern? ?command?"}}
-test bind-1.2 {bind command} {
- list [catch {bind a b c d} msg] $msg
-} {1 {wrong # args: should be "bind window ?pattern? ?command?"}}
-test bind-1.3 {bind command} {
- list [catch {bind .gorp} msg] $msg
-} {1 {bad window path name ".gorp"}}
-test bind-1.4 {bind command} {
- list [catch {bind foo} msg] $msg
-} {0 {}}
-test bind-1.5 {bind command} {
- list [catch {bind .b <gorp-> {}} msg] $msg
-} {0 {}}
-test bind-1.6 {bind command} {
- catch {destroy .b.f}
- frame .b.f
- bind .b.f <Enter> {test script}
- set result [bind .b.f <Enter>]
- bind .b.f <Enter> {}
- list $result [bind .b.f <Enter>]
-} {{test script} {}}
-test bind-1.7 {bind command} {
- catch {destroy .b.f}
- frame .b.f
- bind .b.f <Enter> {test script}
- bind .b.f <Enter> {+more text}
- bind .b.f <Enter>
-} {test script
+
+test bind-1.1 {bind command} -body {
+ bind
+} -returnCodes error -result {wrong # args: should be "bind window ?pattern? ?command?"}
+test bind-1.2 {bind command} -body {
+ bind a b c d
+} -returnCodes error -result {wrong # args: should be "bind window ?pattern? ?command?"}
+test bind-1.3 {bind command} -body {
+ bind .gorp
+} -returnCodes error -result {bad window path name ".gorp"}
+test bind-1.4 {bind command} -body {
+ bind foo
+} -returnCodes ok -result {}
+test bind-1.5 {bind command} -body {
+ bind .t <gorp-> {}
+} -returnCodes ok -result {}
+test bind-1.6 {bind command} -body {
+ frame .t.f
+ bind .t.f <Enter> {test script}
+ set result [bind .t.f <Enter>]
+ bind .t.f <Enter> {}
+ list $result [bind .t.f <Enter>]
+} -cleanup {
+ destroy .t.f
+} -result {{test script} {}}
+test bind-1.7 {bind command} -body {
+ frame .t.f
+ bind .t.f <Enter> {test script}
+ bind .t.f <Enter> {+more text}
+ bind .t.f <Enter>
+} -cleanup {
+ destroy .t.f
+} -result {test script
more text}
-test bind-1.8 {bind command} {
- list [catch {bind .b <gorp-> {test script}} msg] $msg [bind .b]
-} {1 {bad event type or keysym "gorp"} {}}
-test bind-1.9 {bind command} {
- list [catch {bind .b <gorp->} msg] $msg
-} {0 {}}
-test bind-1.10 {bind command} {
- catch {destroy .b.f}
- frame .b.f
- bind .b.f <Enter> {script 1}
- bind .b.f <Leave> {script 2}
- bind .b.f a {script for a}
- bind .b.f b {script for b}
- lsort [bind .b.f]
-} {<Enter> <Leave> a b}
-
-test bind-2.1 {bindtags command} {
- list [catch {bindtags} msg] $msg
-} {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 ?taglist?"}}
-test bind-2.3 {bindtags command} {
- list [catch {bindtags .foo} msg] $msg
-} {1 {bad window path name ".foo"}}
-test bind-2.4 {bindtags command} {
- bindtags .b
-} {.b Toplevel all}
-test bind-2.5 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f
-} {.b.f Frame .b all}
-test bind-2.6 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f {{x y z} b c d}
- bindtags .b.f
-} {{x y z} b c d}
-test bind-2.7 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f {x y z}
- bindtags .b.f {}
- bindtags .b.f
-} {.b.f Frame .b all}
-test bind-2.8 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f {x y z}
- bindtags .b.f {a b c d}
- bindtags .b.f
-} {a b c d}
-test bind-2.9 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f {a b c}
- list [catch {bindtags .b.f "\{"} msg] $msg [bindtags .b.f]
-} {1 {unmatched open brace in list} {.b.f Frame .b all}}
-test bind-2.10 {bindtags command} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f {a b c}
- list [catch {bindtags .b.f "a .gorp b"} msg] $msg [bindtags .b.f]
-} {0 {} {a .gorp b}}
-test bind-3.1 {TkFreeBindingTags procedure} {
- catch {destroy .b.f}
- frame .b.f
- bindtags .b.f "a b c d"
- destroy .b.f
-} {}
-test bind-3.2 {TkFreeBindingTags procedure} {
- catch {destroy .b.f}
- frame .b.f
- catch {bindtags .b.f "a .gorp b .b.f"}
- destroy .b.f
-} {}
-
-bind all <Enter> {lappend x "%W enter all"}
-bind Test <Enter> {lappend x "%W enter frame"}
-bind Toplevel <Enter> {lappend x "%W enter toplevel"}
-bind xyz <Enter> {lappend x "%W enter xyz"}
-bind {a b} <Enter> {lappend x "%W enter {a b}"}
-bind .b <Enter> {lappend x "%W enter .b"}
-test bind-4.1 {TkBindEventProc procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- pack .b.f
- update
- bind .b.f <Enter> {lappend x "%W enter .b.f"}
- set x {}
- event gen .b.f <Enter>
- set x
-} {{.b.f enter .b.f} {.b.f enter frame} {.b.f enter .b} {.b.f enter all}}
-test bind-4.2 {TkBindEventProc procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- pack .b.f
- update
- bind .b.f <Enter> {lappend x "%W enter .b.f"}
- bindtags .b.f {.b.f {a b} xyz}
- set x {}
- event gen .b.f <Enter>
- set x
-} {{.b.f enter .b.f} {.b.f enter {a b}} {.b.f enter xyz}}
-test bind-4.3 {TkBindEventProc procedure} {
- set x {}
- event gen .b <Enter>
- set x
-} {{.b enter .b} {.b enter toplevel} {.b enter all}}
-test bind-4.4 {TkBindEventProc procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- pack .b.f
- update
- bindtags .b.f {.b.f .b.f2 .b.f3}
- frame .b.f3 -width 50 -height 50
- pack .b.f3
- bind .b.f <Enter> {lappend x "%W enter .b.f"}
- bind .b.f3 <Enter> {lappend x "%W enter .b.f3"}
- set x {}
- event gen .b.f <Enter>
- destroy .b.f3
- set x
-} {{.b.f enter .b.f} {.b.f enter .b.f3}}
-test bind-4.5 {TkBindEventProc procedure} {
+test bind-1.8 {bind command} -body {
+ bind .t <gorp-> {test script}
+} -returnCodes error -result {bad event type or keysym "gorp"}
+test bind-1.9 {bind command} -body {
+ catch {bind .t <gorp-> {test script}}
+ bind .t
+} -result {}
+test bind-1.10 {bind command} -body {
+ bind .t <gorp->
+} -returnCodes ok -result {}
+test bind-1.11 {bind command} -body {
+ frame .t.f
+ bind .t.f <Enter> {script 1}
+ bind .t.f <Leave> {script 2}
+ bind .t.f a {script for a}
+ bind .t.f b {script for b}
+ lsort [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {<Enter> <Leave> a b}
+
+test bind-2.1 {bindtags command} -body {
+ bindtags
+} -returnCodes error -result {wrong # args: should be "bindtags window ?taglist?"}
+test bind-2.2 {bindtags command} -body {
+ bindtags a b c
+} -returnCodes error -result {wrong # args: should be "bindtags window ?taglist?"}
+test bind-2.3 {bindtags command} -body {
+ bindtags .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test bind-2.4 {bindtags command} -body {
+ bindtags .t
+} -result {.t Toplevel all}
+test bind-2.5 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {.t.f Frame .t all}
+test bind-2.6 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {{x y z} b c d}
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {{x y z} b c d}
+test bind-2.7 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {x y z}
+ bindtags .t.f {}
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {.t.f Frame .t all}
+test bind-2.8 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {x y z}
+ bindtags .t.f {a b c d}
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {a b c d}
+test bind-2.9 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {a b c}
+ bindtags .t.f "\{"
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {unmatched open brace in list}
+test bind-2.10 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {a b c}
+ catch {bindtags .t.f "\{"}
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {.t.f Frame .t all}
+test bind-2.11 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {a b c}
+ bindtags .t.f "a .gorp b"
+} -cleanup {
+ destroy .t.f
+} -returnCodes ok
+test bind-2.12 {bindtags command} -body {
+ frame .t.f
+ bindtags .t.f {a b c}
+ catch {bindtags .t.f "a .gorp b"}
+ bindtags .t.f
+} -cleanup {
+ destroy .t.f
+} -result {a .gorp b}
+
+
+test bind-3.1 {TkFreeBindingTags procedure} -body {
+ frame .t.f
+ bindtags .t.f "a b c d"
+ destroy .t.f
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-3.2 {TkFreeBindingTags procedure} -body {
+ frame .t.f
+ catch {bindtags .t.f "a .gorp b .t.f"}
+ destroy .t.f
+} -cleanup {
+ destroy .t.f
+} -result {}
+
+
+test bind-4.1 {TkBindEventProc procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ update
+ set x {}
+} -body {
+ bind all <Enter> {lappend x "%W enter all"}
+ bind Test <Enter> {lappend x "%W enter frame"}
+ bind Toplevel <Enter> {lappend x "%W enter toplevel"}
+ bind xyz <Enter> {lappend x "%W enter xyz"}
+ bind {a b} <Enter> {lappend x "%W enter {a b}"}
+ bind .t <Enter> {lappend x "%W enter .t"}
+ bind .t.f <Enter> {lappend x "%W enter .t.f"}
+
+ event generate .t.f <Enter>
+ return $x
+} -cleanup {
+ destroy .t.f
+ unsetBindings
+} -result {{.t.f enter .t.f} {.t.f enter frame} {.t.f enter .t} {.t.f enter all}}
+test bind-4.2 {TkBindEventProc procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ update
+ set x {}
+} -body {
+ bind all <Enter> {lappend x "%W enter all"}
+ bind Test <Enter> {lappend x "%W enter frame"}
+ bind Toplevel <Enter> {lappend x "%W enter toplevel"}
+ bind xyz <Enter> {lappend x "%W enter xyz"}
+ bind {a b} <Enter> {lappend x "%W enter {a b}"}
+ bind .t <Enter> {lappend x "%W enter .t"}
+ bind .t.f <Enter> {lappend x "%W enter .t.f"}
+
+ bindtags .t.f {.t.f {a b} xyz}
+ event generate .t.f <Enter>
+ return $x
+} -cleanup {
+ destroy .t.f
+ unsetBindings
+} -result {{.t.f enter .t.f} {.t.f enter {a b}} {.t.f enter xyz}}
+test bind-4.3 {TkBindEventProc procedure} -body {
+ set x {}
+ bind all <Enter> {lappend x "%W enter all"}
+ bind Test <Enter> {lappend x "%W enter frame"}
+ bind Toplevel <Enter> {lappend x "%W enter toplevel"}
+ bind xyz <Enter> {lappend x "%W enter xyz"}
+ bind {a b} <Enter> {lappend x "%W enter {a b}"}
+ bind .t <Enter> {lappend x "%W enter .t"}
+
+ event generate .t <Enter>
+ return $x
+} -cleanup {
+ unsetBindings
+} -result {{.t enter .t} {.t enter toplevel} {.t enter all}}
+test bind-4.4 {TkBindEventProc procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ frame .t.f3 -width 50 -height 50
+ pack .t.f3
+ update
+ set x {}
+} -body {
+ bind all <Enter> {lappend x "%W enter all"}
+ bind Test <Enter> {lappend x "%W enter frame"}
+ bind Toplevel <Enter> {lappend x "%W enter toplevel"}
+ bind xyz <Enter> {lappend x "%W enter xyz"}
+ bind {a b} <Enter> {lappend x "%W enter {a b}"}
+ bind .t <Enter> {lappend x "%W enter .t"}
+
+ bindtags .t.f {.t.f .t.f2 .t.f3}
+ bind .t.f <Enter> {lappend x "%W enter .t.f"}
+ bind .t.f3 <Enter> {lappend x "%W enter .t.f3"}
+ event generate .t.f <Enter>
+ return $x
+} -cleanup {
+ destroy .t.f .t.f3
+ unsetBindings
+} -result {{.t.f enter .t.f} {.t.f enter .t.f3}}
+test bind-4.5 {TkBindEventProc procedure} -setup {
# This tests memory allocation for objPtr; it won't serve any useful
# purpose unless run with some sort of allocation checker turned on.
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- pack .b.f
- update
- bindtags .b.f {a b c d e f g h i j k l m n o p q r s t u v w x y z}
- event gen .b.f <Enter>
-} {}
-bind all <Enter> {}
-bind Test <Enter> {}
-bind Toplevel <Enter> {}
-bind xyz <Enter> {}
-bind {a b} <Enter> {}
-bind .b <Enter> {}
-
-test bind-5.1 {Tk_CreateBindingTable procedure} {
- catch {destroy .b.c}
- canvas .b.c
- .b.c bind foo
-} {}
-
-test bind-6.1 {Tk_DeleteBindTable procedure} {
- catch {destroy .b.c}
- canvas .b.c
- .b.c bind foo <1> {string 1}
- .b.c create rectangle 0 0 100 100
- .b.c bind 1 <2> {string 2}
- destroy .b.c
-} {}
-test bind-6.2 {Tk_DeleteBindTable procedure: pending bindings deleted later} testcbind {
- catch {interp delete foo}
- interp create foo
- foo eval {
- load {} Tk
- tk useinputmethods 0
- load {} Tktest
- wm geometry . +0+0
- frame .t -width 50 -height 50
- bindtags .t {a b c d}
- pack .t
- update
- set x {}
- testcbind a <1> "lappend x a1; destroy ." "lappend x bye.a1"
- bind b <1> "lappend x b1"
- testcbind c <1> "lappend x c1" "lappend x bye.c1"
- testcbind c <2> "lappend x all2" "lappend x bye.all2"
- event gen .t <1>
- }
- set x [foo eval set x]
- interp delete foo
- set x
-} {a1 bye.all2 bye.a1 b1 bye.c1}
-
-test bind-7.1 {Tk_CreateBinding procedure: bad binding} {
- catch {destroy .b.c}
- 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} testcbind {
- catch {destroy .b.f}
- frame .b.f
- testcbind .b.f <1> "xyz" "lappend x bye.1"
- set x {}
- bind .b.f <1> "abc"
- destroy .b.f
- set x
-} {bye.1}
-test bind-7.3 {Tk_CreateBinding procedure: append} {
- catch {destroy .b.c}
- canvas .b.c
- .b.c bind foo <1> "button 1"
- .b.c bind foo <1> "+more button 1"
- .b.c bind foo <1>
-} {button 1
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ update
+} -body {
+ bind all <Enter> {lappend x "%W enter all"}
+ bind Test <Enter> {lappend x "%W enter frame"}
+ bind Toplevel <Enter> {lappend x "%W enter toplevel"}
+ bind xyz <Enter> {lappend x "%W enter xyz"}
+ bind {a b} <Enter> {lappend x "%W enter {a b}"}
+ bind .t <Enter> {lappend x "%W enter .t"}
+ bindtags .t.f {a b c d e f g h i j k l m n o p q r s t u v w x y z}
+
+ event generate .t.f <Enter>
+} -cleanup {
+ destroy .t.f
+ unsetBindings
+} -result {}
+
+
+test bind-5.1 {Tk_CreateBindingTable procedure} -body {
+ canvas .t.c
+ .t.c bind foo
+} -cleanup {
+ destroy .t.c
+} -result {}
+
+
+test bind-6.1 {Tk_DeleteBindTable procedure} -body {
+ canvas .t.c
+ .t.c bind foo <1> {string 1}
+ .t.c create rectangle 0 0 100 100
+ .t.c bind 1 <2> {string 2}
+ destroy .t.c
+} -cleanup {
+ destroy .t.c
+} -result {}
+test bind-7.1 {Tk_CreateBinding procedure: bad binding} -body {
+ canvas .t.c
+ .t.c bind foo <
+} -cleanup {
+ destroy .t.c
+} -returnCodes error -result {no event type or button # or keysym}
+test bind-7.3 {Tk_CreateBinding procedure: append} -body {
+ canvas .t.c
+ .t.c bind foo <1> "button 1"
+ .t.c bind foo <1> "+more button 1"
+ .t.c bind foo <1>
+} -cleanup {
+ destroy .t.c
+} -result {button 1
more button 1}
-test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} {
- catch {destroy .b.c}
- canvas .b.c
- .b.c bind foo <1> "+button 1"
- .b.c bind foo <1>
-} {button 1}
-
-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} testcbind {
- catch {destroy .b.f}
- frame .b.f
- testcbind .b.f <1> "lappend x 1" "lappend x bye.1"
- set x {}
- event gen .b.f <1>
- destroy .b.f
- set x
-} {bye.1}
-test bind-8.3 {TkCreateBindingProcedure: replace existing} testcbind {
- catch {destroy .b.f}
- frame .b.f
- pack .b.f
- set x {}
- testcbind .b.f <1> "lappend x old1" "lappend x bye.old1"
- testcbind .b.f <1> "lappend x new1" "lappend x bye.new1"
- set x
-} {bye.old1}
-test bind-8.4 {TkCreateBindingProcedure: replace existing while pending} testcbind {
- catch {destroy .b.f}
- frame .b.f
- pack .b.f
- update
- testcbind .b.f <1> "lappend x .b.f; testcbind Frame <1> {lappend x Frame}"
- testcbind Frame <1> "lappend x never"
- set x {}
- event gen .b.f <1>
- bind .b.f <1> {}
- set x
-} {.b.f Frame}
-
-test bind-9.1 {Tk_DeleteBinding procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- list [catch {bind .b.f <} msg] $msg
-} {0 {}}
-test bind-9.2 {Tk_DeleteBinding procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} -body {
+ canvas .t.c
+ .t.c bind foo <1> "+button 1"
+ .t.c bind foo <1>
+} -cleanup {
+ destroy .t.c
+} -result {button 1}
+
+test bind-8.1 {Tk_CreateBinding: error} -body {
+ bind . <xyz> "xyz"
+} -returnCodes error -result {bad event type or keysym "xyz"}
+
+test bind-9.1 {Tk_DeleteBinding procedure} -body {
+ frame .t.f -class Test -width 150 -height 100
+ bind .t.f <
+} -cleanup {
+ destroy .t.f
+} -returnCodes ok
+test bind-9.2 {Tk_DeleteBinding procedure} -setup {
+ set result {}
+} -body {
+ frame .t.f -class Test -width 150 -height 100
foreach i {a b c d} {
- bind .b.f $i "binding for $i"
+ bind .t.f $i "binding for $i"
}
- set result {}
foreach i {b d a c} {
- bind .b.f $i {}
- lappend result [lsort [bind .b.f]]
+ bind .t.f $i {}
+ lappend result [lsort [bind .t.f]]
}
- set result
-} {{a c d} {a c} c {}}
-test bind-9.3 {Tk_DeleteBinding procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ return $result
+} -cleanup {
+ destroy .t.f
+} -result {{a c d} {a c} c {}}
+test bind-9.3 {Tk_DeleteBinding procedure} -setup {
+ set result {}
+} -body {
+ frame .t.f -class Test -width 150 -height 100
foreach i {<1> <Meta-1> <Control-1> <Double-Alt-1>} {
- bind .b.f $i "binding for $i"
+ bind .t.f $i "binding for $i"
}
- set result {}
foreach i {<Control-1> <Double-Alt-1> <1> <Meta-1>} {
- bind .b.f $i {}
- lappend result [lsort [bind .b.f]]
+ bind .t.f $i {}
+ lappend result [lsort [bind .t.f]]
}
- 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} testcbind {
- catch {destroy .b.f}
- frame .b.f
- pack .b.f
- update
- bindtags .b.f {a b c}
- testcbind a <1> {lappend x a1; bind c <1> {}; bind c <2> {}} {lappend x bye.a1}
- bind b <1> {lappend x b1}
- testcbind c <1> {lappend x c1} {lappend x bye.c1}
- testcbind c <2> {lappend x c2} {lappend x bye.c2}
- set x {}
- event gen .b.f <1>
- bind a <1> {}
- bind b <1> {}
- set x
-} {a1 bye.c2 b1 bye.c1 bye.a1}
-
-test bind-10.1 {Tk_GetBinding procedure} {
- catch {destroy .b.c}
- canvas .b.c
- list [catch {.b.c bind foo <} msg] $msg
-} {1 {no event type or button # or keysym}}
-test bind-10.2 {Tk_GetBinding procedure} {
- catch {destroy .b.c}
- canvas .b.c
- .b.c bind foo a Test
- .b.c bind foo a
-} {Test}
-test bind-10.3 {Tk_GetBinding procedure: C binding} testcbind {
- catch {destroy .b.f}
- frame .b.f
- testcbind .b.f <1> "foo"
- list [bind .b.f] [bind .b.f <1>]
-} {<Button-1> {}}
-
-test bind-11.1 {Tk_GetAllBindings procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ return $result
+} -cleanup {
+ destroy .t.f
+} -result {{<Button-1> <Double-Alt-Button-1> <Meta-Button-1>} {<Button-1> <Meta-Button-1>} <Meta-Button-1> {}}
+
+test bind-10.1 {Tk_GetBinding procedure} -body {
+ canvas .t.c
+ .t.c bind foo <
+} -cleanup {
+ destroy .t.c
+} -returnCodes error -result {no event type or button # or keysym}
+test bind-10.2 {Tk_GetBinding procedure} -body {
+ canvas .t.c
+ .t.c bind foo a Test
+ .t.c bind foo a
+} -cleanup {
+ destroy .t.c
+} -result {Test}
+
+test bind-11.1 {Tk_GetAllBindings procedure} -body {
+ frame .t.f
foreach i "! a \\\{ ~ <Delete> <space> <<Paste>> <Tab> <Linefeed> <less> <Meta-a> <Acircumflex>" {
- bind .b.f $i Test
+ bind .t.f $i Test
}
- lsort [bind .b.f]
-} {! <<Paste>> <Key-Acircumflex> <Key-Delete> <Key-Linefeed> <Key-Tab> <Key-less> <Key-space> <Meta-Key-a> a \{ ~}
-test bind-11.2 {Tk_GetAllBindings procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ lsort [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {! <<Paste>> <Key-Acircumflex> <Key-Delete> <Key-Linefeed> <Key-Tab> <Key-less> <Key-space> <Meta-Key-a> a \{ ~}
+test bind-11.2 {Tk_GetAllBindings procedure} -body {
+ frame .t.f
foreach i "<Double-1> <Triple-1> <Meta-Control-a> <Double-Alt-Enter> <1>" {
- bind .b.f $i Test
+ bind .t.f $i Test
}
- lsort [bind .b.f]
-} {<Button-1> <Control-Meta-Key-a> <Double-Alt-Enter> <Double-Button-1> <Triple-Button-1>}
-test bind-11.3 {Tk_GetAllBindings procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ lsort [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {<Button-1> <Control-Meta-Key-a> <Double-Alt-Enter> <Double-Button-1> <Triple-Button-1>}
+test bind-11.3 {Tk_GetAllBindings procedure} -body {
+ frame .t.f
foreach i "<Double-Triple-1> abcd a<Leave>b" {
- bind .b.f $i Test
+ bind .t.f $i Test
}
- lsort [bind .b.f]
-} {<Triple-Button-1> a<Leave>b abcd}
-
-
-test bind-12.1 {Tk_DeleteAllBindings procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- destroy .b.f
-} {}
-test bind-12.2 {Tk_DeleteAllBindings procedure} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ lsort [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {<Triple-Button-1> a<Leave>b abcd}
+
+
+test bind-12.1 {Tk_DeleteAllBindings procedure} -body {
+ frame .t.f -class Test -width 150 -height 100
+ destroy .t.f
+} -result {}
+test bind-12.2 {Tk_DeleteAllBindings procedure} -body {
+ frame .t.f -class Test -width 150 -height 100
foreach i "a b c <Meta-1> <Alt-a> <Control-a>" {
- bind .b.f $i x
+ bind .t.f $i x
}
- destroy .b.f
-} {}
-test bind-12.3 {Tk_DeleteAllBindings procedure: pending bindings deleted later} testcbind {
- catch {destroy .b.f}
- frame .b.f
- pack .b.f
+ destroy .t.f
+} -result {}
+
+test bind-13.1 {Tk_BindEvent procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
update
- testcbind .b.f <1> {lappend x before; event gen .b.f <2>; lappend x after} {lappend x bye.f1}
- testcbind .b.f <2> {destroy .b.f} {lappend x bye.f2}
- bind .b.f <Destroy> {lappend x fDestroy}
- testcbind .b.f <3> {foo} {lappend x bye.f3}
set x {}
- event gen .b.f <1>
- set x
-} {before fDestroy bye.f3 bye.f2 after bye.f1}
-
-bind Test <KeyPress> {lappend x "%W %K Test press any"}
-bind all <KeyPress> {lappend x "%W %K all press any"}
-bind Test a {lappend x "%W %K Test press a"}
-bind all x {lappend x "%W %K all press x"}
+} -body {
+ bind Test <KeyPress> {lappend x "%W %K Test KeyPress"}
+ bind all <KeyPress> {lappend x "%W %K all KeyPress"}
+ bind Test : {lappend x "%W %K Test :"}
+ bind all _ {lappend x "%W %K all _"}
+ bind .t.f : {lappend x "%W %K .t.f :"}
+
+ event generate .t.f <Key-colon>
+ event generate .t.f <Key-plus>
+ event generate .t.f <Key-underscore>
+ return $x
+} -cleanup {
+ destroy .t.f
+ bind all <KeyPress> {}
+ bind Test <KeyPress> {}
+ bind all _ {}
+ bind Test : {}
+} -result {{.t.f colon .t.f :} {.t.f colon Test :} {.t.f colon all KeyPress} {.t.f plus Test KeyPress} {.t.f plus all KeyPress} {.t.f underscore Test KeyPress} {.t.f underscore all _}}
-test bind-13.1 {Tk_BindEvent procedure} {
- setup
- bind .b.f a {lappend x "%W %K .b.f press a"}
+test bind-13.2 {Tk_BindEvent procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Key-a>
- event gen .b.f <Key-b>
- event gen .b.f <Key-x>
- set x
-} {{.b.f a .b.f press a} {.b.f a Test press a} {.b.f a all press any} {.b.f b Test press any} {.b.f b all press any} {.b.f x Test press any} {.b.f x all press x}}
-
-bind Test <KeyPress> {lappend x "%W %K Test press any"; break}
-bind all <KeyPress> {continue; lappend x "%W %K all press any"}
+} -body {
+ bind Test <KeyPress> {lappend x "%W %K Test press any"; break}
+ bind all <KeyPress> {continue; lappend x "%W %K all press any"}
+ bind .t.f : {lappend x "%W %K .t.f pressed colon"}
+
+ event generate .t.f <Key-colon>
+ return $x
+} -cleanup {
+ destroy .t.f
+ bind all <KeyPress> {}
+ bind Test <KeyPress> {}
+} -result {{.t.f colon .t.f pressed colon} {.t.f colon Test press any}}
-test bind-13.2 {Tk_BindEvent procedure} {
- setup
- bind .b.f b {lappend x "%W %K .b.f press a"}
- set x {}
- event gen .b.f <Key-b>
- set x
-} {{.b.f b .b.f press a} {.b.f b Test press any}}
-if {[info procs bgerror] == "bgerror"} {
- rename bgerror {}
-}
-proc bgerror args {}
-bind Test <KeyPress> {lappend x "%W %K Test press any"; error Test}
-test bind-13.3 {Tk_BindEvent procedure} {
- setup
- bind .b.f b {lappend x "%W %K .b.f press a"}
+test bind-13.3 {Tk_BindEvent procedure} -setup {
+ proc bgerror args {}
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Key-b>
+} -body {
+ bind Test <KeyPress> {lappend x "%W %K Test press any"; error Test}
+ bind .t.f : {lappend x "%W %K .t.f pressed colon"}
+ event generate .t.f <Key-colon>
update
list $x $errorInfo
-} {{{.b.f b .b.f press a} {.b.f b Test press any}} {Test
+} -cleanup {
+ destroy .t.f
+ bind Test <KeyPress> {}
+ rename bgerror {}
+} -result {{{.t.f colon .t.f pressed colon} {.t.f colon Test press any}} {Test
while executing
"error Test"
(command bound to event)}}
-rename bgerror {}
-test bind-13.4 {Tk_BindEvent procedure} {
+test bind-13.4 {Tk_BindEvent procedure} -setup {
proc foo {} {
- set x 44
- event gen .b.f <Key-a>
+ set x 44
+ event generate .t.f <Key-colon>
}
- setup
- bind .b.f a {lappend x "%W %K .b.f press a"}
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
+} -body {
+ bind Test : {lappend x "%W %K Test"}
+ bind .t.f : {lappend x "%W %K .t.f"}
foo
- set x
-} {{.b.f a .b.f press a} {.b.f a Test press a}}
-test bind-13.5 {Tk_BindEvent procedure} {
+ return $x
+} -cleanup {
+ destroy .t.f
+ bind Test : {}
+} -result {{.t.f colon .t.f} {.t.f colon Test}}
+
+test bind-13.5 {Tk_BindEvent procedure} -body {
bind all <Destroy> {lappend x "%W destroyed"}
set x {}
- list [catch {frame .b.g -gorp foo} msg] $msg $x
-} {1 {unknown option "-gorp"} {{.b.g destroyed}}}
-foreach i [bind all] {
- bind all $i {}
-}
-foreach i [bind Test] {
- bind Test $i {}
-}
-test bind-13.6 {Tk_BindEvent procedure} {
- setup
- bind .b.f z {lappend x "%W z (.b.f binding)"}
- bind Test z {lappend x "%W z (.b.f binding)"}
- bind all z {bind .b.f z {}; lappend x "%W z (.b.f binding)"}
- set x {}
- event gen .b.f <Key-z>
- bind Test z {}
- bind all z {}
- set x
-} {{.b.f z (.b.f binding)} {.b.f z (.b.f binding)} {.b.f z (.b.f binding)}}
-test bind-13.7 {Tk_BindEvent procedure} {
- setup
- bind .b.f z {lappend x "%W z (.b.f binding)"}
- bind Test z {lappend x "%W z (.b.f binding)"}
- bind all z {destroy .b.f; lappend x "%W z (.b.f binding)"}
- set x {}
- event gen .b.f <Key-z>
- bind Test z {}
- bind all z {}
- set x
-} {{.b.f z (.b.f binding)} {.b.f z (.b.f binding)} {.b.f z (.b.f binding)}}
-test bind-13.8 {Tk_BindEvent procedure} {
- setup
- bind .b.f <1> {lappend x "%W z (.b.f <1> binding)"}
- bind .b.f <ButtonPress> {lappend x "%W z (.b.f <ButtonPress> binding)"}
- set x {}
- event gen .b.f <Button-1>
- event gen .b.f <Button-2>
- set x
-} {{.b.f z (.b.f <1> binding)} {.b.f z (.b.f <ButtonPress> binding)}}
-test bind-13.9 {Tk_BindEvent procedure: ignore NotifyInferior} {
- setup
- bind .b.f <Enter> "lappend x Enter%#"
- bind .b.f <Leave> "lappend x Leave%#"
- set x {}
- event gen .b.f <Enter> -serial 100 -detail NotifyAncestor
- event gen .b.f <Enter> -serial 101 -detail NotifyInferior
- event gen .b.f <Leave> -serial 102 -detail NotifyAncestor
- event gen .b.f <Leave> -serial 103 -detail NotifyInferior
- set x
-} {Enter100 Leave102}
-test bind-13.10 {Tk_BindEvent procedure: collapse Motions} {
- setup
- bind .b.f <Motion> "lappend x Motion%#(%x,%y)"
- set x {}
- event gen .b.f <Motion> -serial 100 -x 100 -y 200 -when tail
- update
- event gen .b.f <Motion> -serial 101 -x 200 -y 300 -when tail
- event gen .b.f <Motion> -serial 102 -x 300 -y 400 -when tail
- update
- set x
-} {Motion100(100,200) Motion102(300,400)}
-test bind-13.11 {Tk_BindEvent procedure: collapse repeating modifiers} {
- setup
- bind .b.f <Key> "lappend x %K%#"
- bind .b.f <KeyRelease> "lappend x %K%#"
- event gen .b.f <Key-Shift_L> -serial 100 -when tail
- event gen .b.f <KeyRelease-Shift_L> -serial 101 -when tail
- event gen .b.f <Key-Shift_L> -serial 102 -when tail
- event gen .b.f <KeyRelease-Shift_L> -serial 103 -when tail
- update
-} {}
-test bind-13.12 {Tk_BindEvent procedure: valid key detail} {
- setup
- bind .b.f <Key> "lappend x Key%K"
- bind .b.f <KeyRelease> "lappend x Release%K"
- set x {}
- event gen .b.f <Key> -keysym a
- event gen .b.f <KeyRelease> -keysym a
- set x
-} {Keya Releasea}
-test bind-13.13 {Tk_BindEvent procedure: invalid key detail} {
- setup
- bind .b.f <Key> "lappend x Key%K"
- bind .b.f <KeyRelease> "lappend x Release%K"
- set x {}
- event gen .b.f <Key> -keycode 0
- event gen .b.f <KeyRelease> -keycode 0
- set x
-} {Key?? Release??}
-test bind-13.14 {Tk_BindEvent procedure: button detail} {
- setup
- bind .b.f <Button> "lappend x Button%b"
- bind .b.f <ButtonRelease> "lappend x Release%b"
- set x {}
- event gen .b.f <Button> -button 1
- event gen .b.f <ButtonRelease> -button 3
- set x
-} {Button1 Release3}
-test bind-13.15 {Tk_BindEvent procedure: virtual detail} {
- setup
- bind .b.f <<Paste>> "lappend x Paste"
- set x {}
- event gen .b.f <<Paste>>
- set x
-} {Paste}
-test bind-13.16 {Tk_BindEvent procedure: virtual event in event stream} {
- setup
- bind .b.f <<Paste>> "lappend x Paste"
- set x {}
- event gen .b.f <<Paste>>
- set x
-} {Paste}
-test bind-13.17 {Tk_BindEvent procedure: match detail physical} {
- setup
- bind .b.f <Button-2> {set x Button-2}
- event add <<Paste>> <Button-2>
- bind .b.f <<Paste>> {set x Paste}
+ frame .t.g -gorp foo
+} -cleanup {
+ bind all <Destroy> {}
+} -returnCodes error -result {unknown option "-gorp"}
+test bind-13.6 {Tk_BindEvent procedure} -body {
+ bind all <Destroy> {lappend x "%W destroyed"}
+ set x {}
+ catch {frame .t.g -gorp foo}
+ return $x
+} -cleanup {
+ bind all <Destroy> {}
+} -result {{.t.g destroyed}}
+
+test bind-13.7 {Tk_BindEvent procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f : {lappend x "%W (.t.f binding)"}
+ bind Test : {lappend x "%W (Test binding)"}
+ bind all : {bind .t.f : {}; lappend x "%W (all binding)"}
+ event generate .t.f <Key-colon>
+ return $x
+} -cleanup {
+ bind Test : {}
+ bind all : {}
+ destroy .t.f
+} -result {{.t.f (.t.f binding)} {.t.f (Test binding)} {.t.f (all binding)}}
+test bind-13.8 {Tk_BindEvent procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f : {lappend x "%W (.t.f binding)"}
+ bind Test : {lappend x "%W (Test binding)"}
+ bind all : {destroy .t.f; lappend x "%W (all binding)"}
+ event generate .t.f <Key-colon>
+ return $x
+} -cleanup {
+ bind Test : {}
+ bind all : {}
+ destroy .t.f
+} -result {{.t.f (.t.f binding)} {.t.f (Test binding)} {.t.f (all binding)}}
+
+test bind-13.9 {Tk_BindEvent procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <1> {lappend x "%W z (.t.f <1> binding)"}
+ bind .t.f <ButtonPress> {lappend x "%W z (.t.f <ButtonPress> binding)"}
+ event generate .t.f <Button-1>
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {{.t.f z (.t.f <1> binding)} {.t.f z (.t.f <ButtonPress> binding)}}
+test bind-13.10 {Tk_BindEvent procedure: ignore NotifyInferior} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x Enter%#"
+ bind .t.f <Leave> "lappend x Leave%#"
+ event generate .t.f <Enter> -serial 100 -detail NotifyAncestor
+ event generate .t.f <Enter> -serial 101 -detail NotifyInferior
+ event generate .t.f <Leave> -serial 102 -detail NotifyAncestor
+ event generate .t.f <Leave> -serial 103 -detail NotifyInferior
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Enter100 Leave102}
+test bind-13.11 {Tk_BindEvent procedure: collapse Motions} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x Motion%#(%x,%y)"
+ event generate .t.f <Motion> -serial 100 -x 100 -y 200 -when tail
+ update
+ event generate .t.f <Motion> -serial 101 -x 200 -y 300 -when tail
+ event generate .t.f <Motion> -serial 102 -x 300 -y 400 -when tail
+ update
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Motion100(100,200) Motion102(300,400)}
+test bind-13.12 {Tk_BindEvent procedure: collapse repeating modifiers} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> "lappend x %K%#"
+ bind .t.f <KeyRelease> "lappend x %K%#"
+ event generate .t.f <Key-Shift_L> -serial 100 -when tail
+ event generate .t.f <KeyRelease-Shift_L> -serial 101 -when tail
+ event generate .t.f <Key-Shift_L> -serial 102 -when tail
+ event generate .t.f <KeyRelease-Shift_L> -serial 103 -when tail
+ update
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-13.13 {Tk_BindEvent procedure: valid key detail} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
+} -body {
+ bind .t.f <Key> "lappend x Key%K"
+ bind .t.f <KeyRelease> "lappend x Release%K"
+ event generate .t.f <Key> -keysym colon
+ event generate .t.f <KeyRelease> -keysym colon
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Keycolon Releasecolon}
+test bind-13.14 {Tk_BindEvent procedure: invalid key detail} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x Key%K"
+ bind .t.f <KeyRelease> "lappend x Release%K"
+ event generate .t.f <Key> -keycode 0
+ event generate .t.f <KeyRelease> -keycode 0
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Key?? Release??}
+test bind-13.15 {Tk_BindEvent procedure: button detail} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x Button%b"
+ bind .t.f <ButtonRelease> "lappend x Release%b"
+ event generate .t.f <Button> -button 1
+ event generate .t.f <ButtonRelease> -button 3
set x
-} {Button-2}
-test bind-13.18 {Tk_BindEvent procedure: no match detail physical} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {Button1 Release3}
+test bind-13.16 {Tk_BindEvent procedure: virtual detail} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <<Paste>>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Paste}
+test bind-13.17 {Tk_BindEvent procedure: virtual event in event stream} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <<Paste>>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Paste}
+test bind-13.18 {Tk_BindEvent procedure: match detail physical} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-2> {set x Button-2}
event add <<Paste>> <Button-2>
- bind .b.f <<Paste>> {set x Paste}
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+} -result {Button-2}
+
+test bind-13.19 {Tk_BindEvent procedure: no match detail physical} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.19 {Tk_BindEvent procedure: match detail virtual} {
- setup
+} -body {
event add <<Paste>> <Button-2>
- bind .b.f <<Paste>> "lappend x Paste"
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+} -result {Paste}
+test bind-13.20 {Tk_BindEvent procedure: match detail virtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.20 {Tk_BindEvent procedure: no match detail virtual} {
- setup
+} -body {
event add <<Paste>> <Button-2>
- bind .b.f <<Paste>> "lappend x Paste"
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+} -result {Paste}
+test bind-13.21 {Tk_BindEvent procedure: no match detail virtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button>
- set x
-} {}
-test bind-13.21 {Tk_BindEvent procedure: match no-detail physical} {
- setup
- bind .b.f <Button> {set x Button}
+} -body {
+ event add <<Paste>> <Button-2>
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <Button>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+} -result {}
+test bind-13.22 {Tk_BindEvent procedure: match no-detail physical} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> {set x Button}
event add <<Paste>> <Button>
- bind .b.f <<Paste>> {set x Paste}
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button>
+} -result {Button}
+test bind-13.23 {Tk_BindEvent procedure: no match no-detail physical} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Button}
-test bind-13.22 {Tk_BindEvent procedure: no match no-detail physical} {
- setup
+} -body {
event add <<Paste>> <Button>
- bind .b.f <<Paste>> {set x Paste}
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button>
+} -result {Paste}
+test bind-13.24 {Tk_BindEvent procedure: match no-detail virtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.23 {Tk_BindEvent procedure: match no-detail virtual} {
- setup
+} -body {
event add <<Paste>> <Button>
- bind .b.f <<Paste>> "lappend x Paste"
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button>
+} -result {Paste}
+test bind-13.25 {Tk_BindEvent procedure: no match no-detail virtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.24 {Tk_BindEvent procedure: no match no-detail virtual} {
- setup
+} -body {
event add <<Paste>> <Key>
- bind .b.f <<Paste>> "lappend x Paste"
+ bind .t.f <<Paste>> "lappend x Paste"
+ event generate .t.f <Button>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Key>
+} -result {}
+test bind-13.26 {Tk_BindEvent procedure: precedence} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button>
- set x
-} {}
-test bind-13.25 {Tk_BindEvent procedure: precedence} {
- setup
+} -body {
event add <<Paste>> <Button-2>
event add <<Copy>> <Button>
- bind .b.f <Button-2> "lappend x Button-2"
- bind .b.f <<Paste>> "lappend x Paste"
- bind .b.f <Button> "lappend x Button"
- bind .b.f <<Copy>> "lappend x Copy"
-
- set x {}
- event gen .b.f <Button-2>
- bind .b.f <Button-2> {}
- event gen .b.f <Button-2>
- bind .b.f <<Paste>> {}
- event gen .b.f <Button-2>
- bind .b.f <Button> {}
- event gen .b.f <Button-2>
- bind .b.f <<Copy>> {}
- event gen .b.f <Button-2>
- set x
-} {Button-2 Paste Button Copy}
-test bind-13.26 {Tk_BindEvent procedure: no detail virtual pattern list} {
- setup
- bind .b.f <Button-2> {set x Button-2}
- set x {}
- event gen .b.f <Button-2>
- set x
-} {Button-2}
-test bind-13.27 {Tk_BindEvent procedure: detail virtual pattern list} {
- setup
+ bind .t.f <Button-2> "lappend x Button-2"
+ bind .t.f <<Paste>> "lappend x Paste"
+ bind .t.f <Button> "lappend x Button"
+ bind .t.f <<Copy>> "lappend x Copy"
+
+ event generate .t.f <Button-2>
+ bind .t.f <Button-2> {}
+ event generate .t.f <Button-2>
+ bind .t.f <<Paste>> {}
+ event generate .t.f <Button-2>
+ bind .t.f <Button> {}
+ event generate .t.f <Button-2>
+ bind .t.f <<Copy>> {}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+ event delete <<Copy>> <Button>
+} -result {Button-2 Paste Button Copy}
+test bind-13.27 {Tk_BindEvent procedure: no detail virtual pattern list} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-2> {set x Button-2}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Button-2}
+test bind-13.28 {Tk_BindEvent procedure: detail virtual pattern list} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
event add <<Paste>> <Button-2>
- bind .b.f <<Paste>> {set x Paste}
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-2>
+} -result {Paste}
+test bind-13.29 {Tk_BindEvent procedure: no no-detail virtual pattern list} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.28 {Tk_BindEvent procedure: no no-detail virtual pattern list} {
- setup
- bind .b.f <Button> {set x Button}
+} -body {
+ bind .t.f <Button> {set x Button}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Button}
+test bind-13.30 {Tk_BindEvent procedure: no-detail virtual pattern list} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- set x
-} {Button}
-test bind-13.29 {Tk_BindEvent procedure: no-detail virtual pattern list} {
- setup
+} -body {
event add <<Paste>> <Button>
- bind .b.f <<Paste>> {set x Paste}
- set x {}
- event gen .b.f <Button-2>
- set x
-} {Paste}
-test bind-13.30 {Tk_BindEvent procedure: no match} {
- setup
- event gen .b.f <Button-2>
-} {}
-test bind-13.31 {Tk_BindEvent procedure: match} {
- setup
- bind .b.f <Button-2> {set x Button-2}
- set x {}
- event gen .b.f <Button-2>
- set x
-} {Button-2}
-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] {
- testcbind $p <1> "lappend x $p"
- }
+ bind .t.f <<Paste>> {set x Paste}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button>
+} -result {Paste}
+test bind-13.31 {Tk_BindEvent procedure: no match} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ event generate .t.f <Button-2>
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-13.32 {Tk_BindEvent procedure: match} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-2> {set x Button-2}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {Button-2}
+test bind-13.33 {Tk_BindEvent procedure: many C bindings cause realloc} -setup {
+ # this test might not be useful anymore [#3009998]
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <1>
- foreach p [bindtags .b.f] {
- bind $p <1> {}
+} -body {
+ bindtags .t.f {a b c d e f g h i j k l m n o p}
+ foreach p [bindtags .t.f] {
+ bind $p <1> "lappend x $p"
}
- set x
-} {a b c d e f g h i j k l m n o p}
-test bind-13.33 {Tk_BindEvent procedure: multiple tags} {
- setup
- bind .b.f <Button-2> {lappend x .b.f}
- bind Test <Button-2> {lappend x Button}
+ event generate .t.f <1>
+ return $x
+} -cleanup {
+ foreach p [bindtags .t.f] {bind $p <1> {}}
+ destroy .t.f
+} -result {a b c d e f g h i j k l m n o p}
+test bind-13.34 {Tk_BindEvent procedure: multiple tags} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
+} -body {
+ bind .t.f <Button-2> {lappend x .t.f}
+ bind Test <Button-2> {lappend x Button}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
bind Test <Button-2> {}
- set x
-} {.b.f Button}
-test bind-13.34 {Tk_BindEvent procedure: execute C binding} testcbind {
- setup
- testcbind .b.f <1> {lappend x 1}
+} -result {.t.f Button}
+test bind-13.35 {Tk_BindEvent procedure: execute binding} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <1>
- set x
-} {1}
-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}
+} -body {
+ bind .t.f <1> {lappend x 1}
+ event generate .t.f <1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-13.38 {Tk_BindEvent procedure: binding gets to run} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <1>
- set y [list $x [bind Test]]
- bind Test <1> {}
- set y
-} {.b.f <Button-1>}
-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}
- set x {}
- event gen .b.f <1>
- set x
-} {.b.f after Deleted}
-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}
- set x {}
- event gen .b.f <1>
+} -body {
+ bind Test <1> {lappend x Test}
+ bind .t.f <1> {lappend x .t.f}
+ event generate .t.f <1>
+ return $x
+} -cleanup {
+ destroy .t.f
bind Test <1> {}
- set x
-} {.b.f Test}
-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} testcbind {
- setup
- testcbind .b.f <1> {
- lappend x before$n
- if {$n==0} {
- bind .b.f <1> {}
- } else {
- set n [expr $n-1]
- event gen .b.f <1>
- }
- lappend x after$n
- } {lappend x Deleted}
- set n 3
- set x {}
- event gen .b.f <1>
- set x
-} {before3 before2 before1 before0 after0 after0 after0 after0 Deleted}
-test bind-13.40 {Tk_BindEvent procedure: continue in script} {
- setup
- bind .b.f <Button-2> {lappend x b1; continue; lappend x b2}
- bind Test <Button-2> {lappend x B1; continue; lappend x B2}
+} -result {.t.f Test}
+test bind-13.41 {Tk_BindEvent procedure: continue in script} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
+} -body {
+ bind .t.f <Button-2> {lappend x b1; continue; lappend x b2}
+ bind Test <Button-2> {lappend x B1; continue; lappend x B2}
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
bind Test <Button-2> {}
- set x
-} {b1 B1}
-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}
+} -result {b1 B1}
+test bind-13.43 {Tk_BindEvent procedure: break in script} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- bind Test <Button-2> {}
- set x
-} {b1 B1}
-test bind-13.42 {Tk_BindEvent procedure: break in script} {
- setup
- bind .b.f <Button-2> {lappend x b1; break; lappend x b2}
+} -body {
+ bind .t.f <Button-2> {lappend x b1; break; lappend x b2}
bind Test <Button-2> {lappend x B1; break; lappend x B2}
- set x {}
- event gen .b.f <Button-2>
+ event generate .t.f <Button-2>
+ return $x
+} -cleanup {
+ destroy .t.f
bind Test <Button-2> {}
- set x
-} {b1}
-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}
+} -result {b1}
+test bind-13.45 {Tk_BindEvent procedure: error in script} -setup {
+ proc bgerror msg {
+ global x
+ lappend x $msg
+ }
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2>
- bind Test <Button-2> {}
- set x
-} {b1}
-
-proc bgerror msg {
- global x
- lappend x $msg
-}
-test bind-13.44 {Tk_BindEvent procedure: error in script} {
- setup
- bind .b.f <Button-2> {lappend x b1; blap}
+} -body {
+ bind .t.f <Button-2> {lappend x b1; blap}
bind Test <Button-2> {lappend x B1}
- set x {}
- event gen .b.f <Button-2>
+ event generate .t.f <Button-2>
update
+ return $x
+} -cleanup {
+ destroy .t.f
bind Test <Button-2> {}
- set x
-} {b1 {invalid command name "blap"}}
-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}
- set x {}
- event gen .b.f <Button-2>
+ proc bgerror args {}
+} -result {b1 {invalid command name "blap"}}
+
+test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
update
- bind Test <Button-2> {}
- set x
-} {b1 {invalid command name "blap"}}
-
-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>} testcbind {
- setup
- testcbind .b.f <Destroy> "lappend x .b.f"
- testcbind Test <Destroy> "lappend x Test"
- set x {}
- destroy .b.f
- bind Test <Destroy> {}
- set x
-} {.b.f Test}
-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"
- testcbind b <1> "destroy .b.f; lappend x b1" "lappend x bye.b1"
- testcbind c <1> "lappend x c1" "lappend x bye.c1"
- testcbind d <1> "lappend x d1" "lappend x bye.d1"
- bind a <2> "event gen .b.f <1>"
- testcbind b <2> "lappend x b2" "lappend x bye.b2"
- testcbind c <2> "lappend x c2" "lappend x bye.d2"
- bind d <2> "lappend x d2"
- testcbind a <3> "event gen .b.f <2>"
- set x {}
- event gen .b.f <3>
- set y $x
- foreach tag {a b c d} {
- foreach event {<1> <2> <3>} {
- bind $tag $event {}
- }
- }
- set y
-} {a1 b1 d2}
-
-test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f ab {set x 1}
+} -body {
+ bind .t.f 12 {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <KeyRelease-a>
- event gen .b.f <Key-b>
- event gen .b.f <KeyRelease-b>
- set x
-} 1
-test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f ab {set x 1}
+ event generate .t.f <Key-1>
+ event generate .t.f <KeyRelease-1>
+ event generate .t.f <Key-2>
+ event generate .t.f <KeyRelease-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f 12 {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <Enter>
- event gen .b.f <KeyRelease-a>
- event gen .b.f <Leave>
- event gen .b.f <Key-b>
- event gen .b.f <KeyRelease-b>
- set x
-} 1
-test bind-15.3 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f ab {set x 1}
+ event generate .t.f <Key-1>
+ event generate .t.f <Enter>
+ event generate .t.f <KeyRelease-1>
+ event generate .t.f <Leave>
+ event generate .t.f <Key-2>
+ event generate .t.f <KeyRelease-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.3 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f 12 {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <Button-1>
- event gen .b.f <Key-b>
- set x
-} 0
-test bind-15.4 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Key-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <Key-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.4 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.5 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f <Double-ButtonRelease> {set x 1}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.5 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-ButtonRelease> {set x 1}
set x 0
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- set x
-} 1
-test bind-15.6 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.6 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-1>
- event gen .b.f <Key-a>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.7 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-1>
+ event generate .t.f <Key-a>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.7 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-1>
- event gen .b.f <Key-Shift_L>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.8 {MatchPatterns procedure, ignoring type mismatches} {
- setup
- bind .b.f ab {set x 1}
+ event generate .t.f <Button-1>
+ event generate .t.f <Key-Shift_L>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.8 {MatchPatterns procedure, ignoring type mismatches} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f ab {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <Key-c>
- event gen .b.f <Key-b>
- set x
-} 0
-test bind-15.9 {MatchPatterns procedure, modifier checks} {
- setup
- bind .b.f <M1-M2-Key> {set x 1}
+ event generate .t.f <Key-a>
+ event generate .t.f <Key-c>
+ event generate .t.f <Key-b>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.9 {MatchPatterns procedure, modifier checks} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event gen .b.f <Key-a> -state 0x18
- set x
-} 1
-test bind-15.10 {MatchPatterns procedure, modifier checks} {
- setup
- bind .b.f <M1-M2-Key> {set x 1}
+ event generate .t.f <Key-a> -state 0x18
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.10 {MatchPatterns procedure, modifier checks} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event gen .b.f <Key-a> -state 0xfc
- set x
-} 1
-test bind-15.11 {MatchPatterns procedure, modifier checks} {
- setup
- bind .b.f <M1-M2-Key> {set x 1}
+ event generate .t.f <Key-a> -state 0xfc
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.11 {MatchPatterns procedure, modifier checks} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <M1-M2-Key> {set x 1}
set x 0
- event gen .b.f <Key-a> -state 0x8
- set x
-} 0
-test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} {nonPortable} {
+ event generate .t.f <Key-a> -state 0x8
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} -constraints {
+ nonPortable
+} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
# This test is non-portable because the Shift_L keysym may behave
# differently on some platforms.
- setup
- bind .b.f aB {set x 1}
+ bind .t.f aB {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <Key-Shift_L>
- event gen .b.f <Key-b> -state 1
- set x
-} 1
-test bind-15.13 {MatchPatterns procedure, checking detail} {
- setup
- bind .b.f ab {set x 1}
+ event generate .t.f <Key-a>
+ event generate .t.f <Key-Shift_L>
+ event generate .t.f <Key-b> -state 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.13 {MatchPatterns procedure, checking detail} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f ab {set x 1}
set x 0
- event gen .b.f <Key-a>
- event gen .b.f <Key-c>
- set x
-} 0
-test bind-15.14 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Key-a>
+ event generate .t.f <Key-c>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.14 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 31 -y 39
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.15 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 31 -y 39
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.15 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 29 -y 41
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.16 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 29 -y 41
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.16 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 40 -y 40
- event gen .b.f <ButtonRelease-2>
- set x
-} 0
-test bind-15.17 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 40 -y 40
+ event generate .t.f <ButtonRelease-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.17 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 20 -y 40
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.18 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 20 -y 40
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.18 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 30 -y 30
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.19 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 30 -y 30
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.19 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -x 30 -y 40
- event gen .b.f <Button-1> -x 30 -y 50
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.20 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -x 30 -y 40
+ event generate .t.f <Button-1> -x 30 -y 50
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.20 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -time 300
- event gen .b.f <Button-1> -time 700
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.21 {MatchPatterns procedure, checking "nearby"} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -time 300
+ event generate .t.f <Button-1> -time 700
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.21 {MatchPatterns procedure, checking "nearby"} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1> -time 300
- event gen .b.f <Button-1> -time 900
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.22 {MatchPatterns procedure, time wrap-around} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1> -time 300
+ event generate .t.f <Button-1> -time 900
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.22 {MatchPatterns procedure, time wrap-around} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-1> -time [expr -100]
- event gen .b.f <Button-1> -time 200
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.23 {MatchPatterns procedure, time wrap-around} {
- setup
- bind .b.f <Double-1> {set x 1}
+ event generate .t.f <Button-1> -time [expr -100]
+ event generate .t.f <Button-1> -time 200
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.23 {MatchPatterns procedure, time wrap-around} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Double-1> {set x 1}
set x 0
- event gen .b.f <Button-1> -time -100
- event gen .b.f <Button-1> -time 500
- event gen .b.f <ButtonRelease-1>
- set x
-} 0
-test bind-15.24 {MatchPatterns procedure, virtual event} {
- setup
- event add <<Paste>> <Button-1>
- bind .b.f <<Paste>> {lappend x paste}
+ event generate .t.f <Button-1> -time -100
+ event generate .t.f <Button-1> -time 500
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+
+test bind-15.24 {MatchPatterns procedure, virtual event} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+} -body {
+ event add <<Paste>> <Button-1>
+ bind .t.f <<Paste>> {lappend x paste}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
set x
-} {paste}
-test bind-15.25 {MatchPatterns procedure, reject a virtual event} {
- setup
- event add <<Paste>> <Shift-Button-1>
- bind .b.f <<Paste>> {lappend x paste}
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Button-1>
+} -result {paste}
+test bind-15.25 {MatchPatterns procedure, reject a virtual event} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+} -body {
+ event add <<Paste>> <Shift-Button-1>
+ bind .t.f <<Paste>> {lappend x paste}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
set x
-} {}
-test bind-15.26 {MatchPatterns procedure, reject a virtual event} {
- setup
+} -cleanup {
+ destroy .t.f
+ event delete <<Paste>> <Shift-Button-1>
+} -result {}
+test bind-15.26 {MatchPatterns procedure, reject a virtual event} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
event add <<V1>> <Button>
event add <<V2>> <Button-1>
event add <<V3>> <Shift-Button-1>
- bind .b.f <<V2>> "lappend x V2%#"
- set x {}
- event gen .b.f <Button> -serial 101
- event gen .b.f <Button-1> -serial 102
- event gen .b.f <Shift-Button-1> -serial 103
- event gen .b.f <ButtonRelease-1>
- bind .b.f <Shift-Button-1> "lappend x Shift-Button-1"
- event gen .b.f <Button> -serial 104
- event gen .b.f <Button-1> -serial 105
- event gen .b.f <Shift-Button-1> -serial 106
- event gen .b.f <ButtonRelease-1>
- set x
-} {V2102 V2103 V2105 Shift-Button-1}
-test bind-15.27 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <KeyPress> {set x 0}
- bind .b.f a {set x 1}
- set x none
- event gen .b.f <Key-a>
+ bind .t.f <<V2>> "lappend x V2%#"
+ event generate .t.f <Button> -serial 101
+ event generate .t.f <Button-1> -serial 102
+ event generate .t.f <Shift-Button-1> -serial 103
+ event generate .t.f <ButtonRelease-1>
+ bind .t.f <Shift-Button-1> "lappend x Shift-Button-1"
+ event generate .t.f <Button> -serial 104
+ event generate .t.f <Button-1> -serial 105
+ event generate .t.f <Shift-Button-1> -serial 106
+ event generate .t.f <ButtonRelease-1>
set x
-} 1
-test bind-15.28 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <KeyPress> {set x 0}
- bind .b.f a {set x 1}
- set x none
- event gen .b.f <Key-b>
- set x
-} 0
-test bind-15.29 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <KeyPress> {lappend x 0}
- bind .b.f a {lappend x 1}
- bind .b.f ba {lappend x 2}
+} -cleanup {
+ destroy .t.f
+ event delete <<V1>> <Button>
+ event delete <<V2>> <Button-1>
+ event delete <<V3>> <Shift-Button-1>
+} -result {V2102 V2103 V2105 Shift-Button-1}
+test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <KeyPress> {set x 0}
+ bind .t.f 1 {set x 1}
set x none
- event gen .b.f <Key-b>
- event gen .b.f <KeyRelease-b>
- event gen .b.f <Key-a>
- set x
-} {none 0 2}
-test bind-15.30 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <ButtonPress> {set x 0}
- bind .b.f <1> {set x 1}
+ event generate .t.f <Key-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <KeyPress> {set x 0}
+ bind .t.f 1 {set x 1}
set x none
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} 1
-test bind-15.31 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <M1-Key> {set x 0}
- bind .b.f <M2-Key> {set x 1}
+ event generate .t.f <Key-2>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {0}
+test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <KeyPress> {lappend x 0}
+ bind .t.f 1 {lappend x 1}
+ bind .t.f 21 {lappend x 2}
set x none
- event gen .b.f <Key-a> -state 0x18
+ event generate .t.f <Key-2>
+ event generate .t.f <KeyRelease-2>
+ event generate .t.f <Key-1>
set x
-} 1
-test bind-15.32 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <M2-Key> {set x 0}
- bind .b.f <M1-Key> {set x 1}
+} -cleanup {
+ destroy .t.f
+} -result {none 0 2}
+test bind-15.30 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <ButtonPress> {set x 0}
+ bind .t.f <1> {set x 1}
set x none
- event gen .b.f <Key-a> -state 0x18
- set x
-} 1
-test bind-15.33 {MatchPatterns procedure, conflict resolution} {
- setup
- bind .b.f <1> {lappend x single}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.31 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <M1-Key> {set x 0}
+ bind .t.f <M2-Key> {set x 1}
+ event generate .t.f <Key-a> -state 0x18
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.32 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <M2-Key> {set x 0}
+ bind .t.f <M1-Key> {set x 1}
+ set x none
+ event generate .t.f <Key-a> -state 0x18
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-15.33 {MatchPatterns procedure, conflict resolution} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <1> {lappend x single}
bind Test <1> {lappend x single(Test)}
bind Test <Double-1> {lappend x double(Test)}
- set x {}
- event gen .b.f <Button-1>
- event gen .b.f <Button-1>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
set x
-} {single single(Test) single double(Test) single double(Test)}
-foreach i [bind Test] {
- bind Test $i {}
-}
-test bind-16.1 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x abcd}
+} -cleanup {
+ destroy .t.f
+ bind Test <1> {}
+ bind Test <Double-1> {}
+} -result {single single(Test) single double(Test) single double(Test)}
+
+
+test bind-16.1 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x abcd}
set x none
- event gen .b.f <Enter>
+ event generate .t.f <Enter>
set x
-} abcd
-test bind-16.2 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %#}
+} -cleanup {
+ destroy .t.f
+} -result {abcd}
+test bind-16.2 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %#}
set x none
- event gen .b.f <Enter> -serial 1234
+ event generate .t.f <Enter> -serial 1234
set x
-} 1234
-test bind-16.3 {ExpandPercents procedure} {
- setup
- bind .b.f <Configure> {set x %a}
+} -cleanup {
+ destroy .t.f
+} -result {1234}
+test bind-16.3 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Configure> {set x %a}
set x none
- event gen .b.f <Configure> -above .b -window .b.f
+ event generate .t.f <Configure> -above .t -window .t.f
set x
-} [winfo id .b]
-test bind-16.4 {ExpandPercents procedure} {
- setup
- bind .b.f <Button> {set x %b}
+} -cleanup {
+ destroy .t.f
+} -result [winfo id .t]
+test bind-16.4 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {set x %b}
set x none
- event gen .b.f <Button-3>
- event gen .b.f <ButtonRelease-3>
+ event generate .t.f <Button-3>
+ event generate .t.f <ButtonRelease-3>
set x
-} 3
-test bind-16.5 {ExpandPercents procedure} {
- setup
- bind .b.f <Expose> {set x %c}
+} -cleanup {
+ destroy .t.f
+} -result {3}
+test bind-16.5 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Expose> {set x %c}
set x none
- event gen .b.f <Expose> -count 47
+ event generate .t.f <Expose> -count 47
set x
-} 47
-test bind-16.6 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {47}
+test bind-16.6 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyAncestor
+ event generate .t.f <Enter> -detail NotifyAncestor
set x
-} NotifyAncestor
-test bind-16.7 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyAncestor}
+test bind-16.7 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyVirtual
+ event generate .t.f <Enter> -detail NotifyVirtual
set x
-} NotifyVirtual
-test bind-16.8 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyVirtual}
+test bind-16.8 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyNonlinear
+ event generate .t.f <Enter> -detail NotifyNonlinear
set x
-} NotifyNonlinear
-test bind-16.9 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyNonlinear}
+test bind-16.9 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyNonlinearVirtual
+ event generate .t.f <Enter> -detail NotifyNonlinearVirtual
set x
-} NotifyNonlinearVirtual
-test bind-16.10 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyNonlinearVirtual}
+test bind-16.10 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyPointer
+ event generate .t.f <Enter> -detail NotifyPointer
set x
-} NotifyPointer
-test bind-16.11 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyPointer}
+test bind-16.11 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyPointerRoot
+ event generate .t.f <Enter> -detail NotifyPointerRoot
set x
-} NotifyPointerRoot
-test bind-16.12 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %d}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyPointerRoot}
+test bind-16.12 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %d}
set x none
- event gen .b.f <Enter> -detail NotifyDetailNone
+ event generate .t.f <Enter> -detail NotifyDetailNone
set x
-} NotifyDetailNone
-test bind-16.13 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x %f}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyDetailNone}
+test bind-16.13 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x %f}
set x none
- event gen .b.f <Enter> -focus 1
- set x
-} 1
-test bind-16.14 {ExpandPercents procedure} {
- setup
- bind .b.f <Expose> {set x "%x %y %w %h"}
+ event generate .t.f <Enter> -focus 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-16.14 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Expose> {set x "%x %y %w %h"}
set x none
- event gen .b.f <Expose> -x 24 -y 18 -width 147 -height 61
+ event generate .t.f <Expose> -x 24 -y 18 -width 147 -height 61
set x
-} {24 18 147 61}
-test bind-16.15 {ExpandPercents procedure} {
- setup
- bind .b.f <Configure> {set x "%x %y %w %h"}
+} -cleanup {
+ destroy .t.f
+} -result {24 18 147 61}
+test bind-16.15 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Configure> {set x "%x %y %w %h"}
set x none
- event gen .b.f <Configure> -x 24 -y 18 -width 147 -height 61 -window .b.f
+ event generate .t.f <Configure> -x 24 -y 18 -width 147 -height 61 -window .t.f
set x
-} {24 18 147 61}
-test bind-16.16 {ExpandPercents procedure} {
- setup
- bind .b.f <Key> {set x "%k"}
+} -cleanup {
+ destroy .t.f
+} -result {24 18 147 61}
+test bind-16.16 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> {set x "%k"}
set x none
- event gen .b.f <Key> -keycode 146
+ event generate .t.f <Key> -keycode 146
set x
-} 146
-test bind-16.17 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%m"}
+} -cleanup {
+ destroy .t.f
+} -result {146}
+test bind-16.17 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%m"}
set x none
- event gen .b.f <Enter> -mode NotifyNormal
+ event generate .t.f <Enter> -mode NotifyNormal
set x
-} NotifyNormal
-test bind-16.18 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%m"}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyNormal}
+test bind-16.18 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%m"}
set x none
- event gen .b.f <Enter> -mode NotifyGrab
+ event generate .t.f <Enter> -mode NotifyGrab
set x
-} NotifyGrab
-test bind-16.19 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%m"}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyGrab}
+test bind-16.19 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%m"}
set x none
- event gen .b.f <Enter> -mode NotifyUngrab
+ event generate .t.f <Enter> -mode NotifyUngrab
set x
-} NotifyUngrab
-test bind-16.20 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%m"}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyUngrab}
+test bind-16.20 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> {set x "%m"}
set x none
- event gen .b.f <Enter> -mode NotifyWhileGrabbed
+ event generate .t.f <Enter> -mode NotifyWhileGrabbed
set x
-} NotifyWhileGrabbed
-test bind-16.21 {ExpandPercents procedure} {
- setup
- bind .b.f <Map> {set x "%o"}
+} -cleanup {
+ destroy .t.f
+} -result {NotifyWhileGrabbed}
+test bind-16.21 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Map> {set x "%o"}
set x none
- event gen .b.f <Map> -override 1 -window .b.f
- set x
-} 1
-test bind-16.22 {ExpandPercents procedure} {
- setup
- bind .b.f <Reparent> {set x "%o"}
+ event generate .t.f <Map> -override 1 -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-16.22 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Reparent> {set x "%o"}
set x none
- event gen .b.f <Reparent> -override true -window .b.f
- set x
-} 1
-test bind-16.23 {ExpandPercents procedure} {
- setup
- bind .b.f <Configure> {set x "%o"}
+ event generate .t.f <Reparent> -override true -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-16.23 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Configure> {set x "%o"}
set x none
- event gen .b.f <Configure> -override 1 -window .b.f
- set x
-} 1
-test bind-16.24 {ExpandPercents procedure} {
- setup
- bind .b.f <Circulate> {set x "%p"}
+ event generate .t.f <Configure> -override 1 -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-16.24 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Circulate> {set x "%p"}
set x none
- event gen .b.f <Circulate> -place PlaceOnTop -window .b.f
+ event generate .t.f <Circulate> -place PlaceOnTop -window .t.f
set x
-} PlaceOnTop
-test bind-16.25 {ExpandPercents procedure} {
- setup
- bind .b.f <Circulate> {set x "%p"}
+} -cleanup {
+ destroy .t.f
+} -result {PlaceOnTop}
+test bind-16.25 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Circulate> {set x "%p"}
set x none
- event gen .b.f <Circulate> -place PlaceOnBottom -window .b.f
+ event generate .t.f <Circulate> -place PlaceOnBottom -window .t.f
set x
-} PlaceOnBottom
-test bind-16.26 {ExpandPercents procedure} {
- setup
- bind .b.f <1> {set x "%s"}
+} -cleanup {
+ destroy .t.f
+} -result {PlaceOnBottom}
+test bind-16.26 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <1> {set x "%s"}
set x none
- event gen .b.f <Button-1> -state 1402
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1> -state 1402
+ event generate .t.f <ButtonRelease-1>
set x
-} 1402
-test bind-16.27 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%s"}
+} -cleanup {
+ destroy .t.f
+} -result {1402}
+test bind-16.27 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%s"}
set x none
- event gen .b.f <Enter> -state 0x3ff
+ event generate .t.f <Enter> -state 0x3ff
set x
-} 1023
-test bind-16.28 {ExpandPercents procedure} {
- setup
- bind .b.f <Visibility> {set x "%s"}
+} -cleanup {
+ destroy .t.f
+} -result {1023}
+test bind-16.28 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Visibility> {set x "%s"}
set x none
- event gen .b.f <Visibility> -state VisibilityPartiallyObscured
+ event generate .t.f <Visibility> -state VisibilityPartiallyObscured
set x
-} VisibilityPartiallyObscured
-test bind-16.29 {ExpandPercents procedure} {
- setup
- bind .b.f <Visibility> {set x "%s"}
+} -cleanup {
+ destroy .t.f
+} -result {VisibilityPartiallyObscured}
+test bind-16.29 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Visibility> {set x "%s"}
set x none
- event gen .b.f <Visibility> -state VisibilityUnobscured
+ event generate .t.f <Visibility> -state VisibilityUnobscured
set x
-} VisibilityUnobscured
-test bind-16.30 {ExpandPercents procedure} {
- setup
- bind .b.f <Visibility> {set x "%s"}
+} -cleanup {
+ destroy .t.f
+} -result {VisibilityUnobscured}
+test bind-16.30 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Visibility> {set x "%s"}
set x none
- event gen .b.f <Visibility> -state VisibilityFullyObscured
+ event generate .t.f <Visibility> -state VisibilityFullyObscured
set x
-} VisibilityFullyObscured
-test bind-16.31 {ExpandPercents procedure} {
- setup
- bind .b.f <Button> {set x "%t"}
+} -cleanup {
+ destroy .t.f
+} -result {VisibilityFullyObscured}
+test bind-16.31 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {set x "%t"}
set x none
- event gen .b.f <Button> -time 4294
- event gen .b.f <ButtonRelease>
+ event generate .t.f <Button> -time 4294
+ event generate .t.f <ButtonRelease>
set x
-} 4294
-test bind-16.32 {ExpandPercents procedure} {
- setup
- bind .b.f <Button> {set x "%x %y"}
+} -cleanup {
+ destroy .t.f
+} -result {4294}
+test bind-16.32 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {set x "%x %y"}
set x none
- event gen .b.f <Button> -x 881 -y 432
- event gen .b.f <ButtonRelease>
+ event generate .t.f <Button> -x 881 -y 432
+ event generate .t.f <ButtonRelease>
set x
-} {881 432}
-test bind-16.33 {ExpandPercents procedure} {
- setup
- bind .b.f <Reparent> {set x "%x %y"}
+} -cleanup {
+ destroy .t.f
+} -result {881 432}
+test bind-16.33 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Reparent> {set x "%x %y"}
set x none
- event gen .b.f <Reparent> -x 882 -y 431 -window .b.f
+ event generate .t.f <Reparent> -x 882 -y 431 -window .t.f
set x
-} {882 431}
-test bind-16.34 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%x %y"}
+} -cleanup {
+ destroy .t.f
+} -result {882 431}
+test bind-16.34 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%x %y"}
set x none
- event gen .b.f <Enter> -x 781 -y 632
- set x
-} {781 632}
-test bind-16.35 {ExpandPercents procedure} {nonPortable} {
- setup
- bind .b.f <Key> {lappend x "%A"}
- set x {}
- event gen .b.f <Key-a>
- event gen .b.f <Key-A> -state 1
- event gen .b.f <Key-Tab>
- event gen .b.f <Key-Return>
- event gen .b.f <Key-F1>
- event gen .b.f <Key-Shift_L>
- event gen .b.f <Key-space>
- event gen .b.f <Key-dollar> -state 1
- event gen .b.f <Key-braceleft> -state 1
- event gen .b.f <Key-Multi_key>
- event gen .b.f <Key-e>
- event gen .b.f <Key-apostrophe>
- set x
-} "a A { } {\r} {{}} {{}} { } {\$} \\\{ {{}} {{}} \u00e9"
-test bind-16.36 {ExpandPercents procedure} {
- setup
- bind .b.f <Configure> {set x "%B"}
+ event generate .t.f <Enter> -x 781 -y 632
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {781 632}
+test bind-16.35 {ExpandPercents procedure} -constraints {
+ nonPortable
+} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> {lappend x "%A"}
+ event generate .t.f <Key-a>
+ event generate .t.f <Key-A> -state 1
+ event generate .t.f <Key-Tab>
+ event generate .t.f <Key-Return>
+ event generate .t.f <Key-F1>
+ event generate .t.f <Key-Shift_L>
+ event generate .t.f <Key-space>
+ event generate .t.f <Key-dollar> -state 1
+ event generate .t.f <Key-braceleft> -state 1
+ event generate .t.f <Key-Multi_key>
+ event generate .t.f <Key-e>
+ event generate .t.f <Key-apostrophe>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {a A { } {\r} {{}} {{}} { } {\$} \\\{ {{}} {{}} \u00e9}
+test bind-16.36 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Configure> {set x "%B"}
set x none
- event gen .b.f <Configure> -borderwidth 24 -window .b.f
+ event generate .t.f <Configure> -borderwidth 24 -window .t.f
set x
-} 24
-test bind-16.37 {ExpandPercents procedure} {
- setup
- bind .b.f <Enter> {set x "%E"}
+} -cleanup {
+ destroy .t.f
+} -result {24}
+test bind-16.37 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> {set x "%E"}
set x none
- event gen .b.f <Enter> -sendevent 1
- set x
-} 1
-test bind-16.38 {ExpandPercents procedure} {nonPortable} {
- setup
- bind .b.f <Key> {lappend x %K}
- set x {}
- event gen .b.f <Key-a>
- event gen .b.f <Key-A> -state 1
- event gen .b.f <Key-Tab>
- event gen .b.f <Key-F1>
- event gen .b.f <Key-Shift_L>
- event gen .b.f <Key-space>
- event gen .b.f <Key-dollar> -state 1
- event gen .b.f <Key-braceleft> -state 1
- set x
-} {a A Tab F1 Shift_L space dollar braceleft}
-test bind-16.39 {ExpandPercents procedure} {
- setup
- bind .b.f <Key> {set x "%N"}
+ event generate .t.f <Enter> -sendevent 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-16.38 {ExpandPercents procedure} -constraints {
+ nonPortable
+} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> {lappend x %K}
+ event generate .t.f <Key-a>
+ event generate .t.f <Key-A> -state 1
+ event generate .t.f <Key-Tab>
+ event generate .t.f <Key-F1>
+ event generate .t.f <Key-Shift_L>
+ event generate .t.f <Key-space>
+ event generate .t.f <Key-dollar> -state 1
+ event generate .t.f <Key-braceleft> -state 1
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {a A Tab F1 Shift_L space dollar braceleft}
+test bind-16.39 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> {set x "%N"}
set x none
- event gen .b.f <Key-a>
+ event generate .t.f <Key-space>
set x
-} 97
-test bind-16.40 {ExpandPercents procedure} {
- setup
- bind .b.f <Key> {set x "%S"}
+} -cleanup {
+ destroy .t.f
+} -result {32}
+test bind-16.40 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> {set x "%S"}
set x none
- event gen .b.f <Key-a> -subwindow .b
+ event generate .t.f <Key-space> -subwindow .t
set x
-} [winfo id .b]
-test bind-16.41 {ExpandPercents procedure} {
- setup
- bind .b.f <Key> {set x "%T"}
+} -cleanup {
+ destroy .t.f
+} -result [winfo id .t]
+test bind-16.41 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> {set x "%T"}
set x none
- event gen .b.f <Key>
+ event generate .t.f <Key>
set x
-} 2
-test bind-16.42 {ExpandPercents procedure} {
- setup
- bind .b.f <Key> {set x "%W"}
+} -cleanup {
+ destroy .t.f
+} -result {2}
+test bind-16.42 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> {set x "%W"}
set x none
- event gen .b.f <Key>
+ event generate .t.f <Key>
set x
-} .b.f
-test bind-16.43 {ExpandPercents procedure} {
- setup
- bind .b.f <Button> {set x "%X %Y"}
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+test bind-16.43 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {set x "%X %Y"}
set x none
- event gen .b.f <Button> -rootx 422 -rooty 13
- event gen .b.f <ButtonRelease>
+ event generate .t.f <Button> -rootx 422 -rooty 13
+ event generate .t.f <ButtonRelease>
set x
-} {422 13}
-test bind-16.44 {ExpandPercents procedure} {
- setup
- bind .b.f <Gravity> {set x "%R %S"}
+} -cleanup {
+ destroy .t.f
+} -result {422 13}
+test bind-16.44 {ExpandPercents procedure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Gravity> {set x "%R %S"}
set x none
- event gen .b.f <Gravity>
- set x
-} {?? ??}
-
-
-test bind-17.1 {event command} {
- list [catch {event} msg] $msg
-} {1 {wrong # args: should be "event option ?arg?"}}
-test bind-17.2 {event command} {
- list [catch {event xyz} msg] $msg
-} {1 {bad option "xyz": must be add, delete, generate, or info}}
-test bind-17.3 {event command: add} {
- list [catch {event add} msg] $msg
-} {1 {wrong # args: should be "event add virtual sequence ?sequence ...?"}}
-test bind-17.4 {event command: add 1} {
- setup
+ event generate .t.f <Gravity>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {?? ??}
+
+
+test bind-17.1 {event command} -body {
+ event
+} -returnCodes error -result {wrong # args: should be "event option ?arg?"}
+test bind-17.2 {event command} -body {
+ event xyz
+} -returnCodes error -result {bad option "xyz": must be add, delete, generate, or info}
+test bind-17.3 {event command: add} -body {
+ event add
+} -returnCodes error -result {wrong # args: should be "event add virtual sequence ?sequence ...?"}
+test bind-17.4 {event command: add 1} -body {
+ event delete <<Paste>>
event add <<Paste>> <Control-v>
event info <<Paste>>
-} {<Control-Key-v>}
-test bind-17.5 {event command: add 2} {
- setup
+} -cleanup {
+ event delete <<Paste>> <Control-v>
+} -result {<Control-Key-v>}
+test bind-17.5 {event command: add 2} -body {
+ event delete <<Paste>>
event add <<Paste>> <Control-v> <Button-2>
lsort [event info <<Paste>>]
-} {<Button-2> <Control-Key-v>}
-test bind-17.6 {event command: add with error} {
- setup
- list [catch {event add <<Paste>> <Control-v> <Button-2> abc <xyz> <1>} \
- msg] $msg [lsort [event info <<Paste>>]]
-} {1 {bad event type or keysym "xyz"} {<Button-2> <Control-Key-v> abc}}
-test bind-17.7 {event command: delete} {
- list [catch {event delete} msg] $msg
-} {1 {wrong # args: should be "event delete virtual ?sequence sequence ...?"}}
-test bind-17.8 {event command: delete many} {
- setup
+} -cleanup {
+ event delete <<Paste>> <Control-v> <Button-2>
+} -result {<Button-2> <Control-Key-v>}
+
+test bind-17.6 {event command: add with error} -body {
+ event add <<Paste>> <Control-v> <Button-2> abc <xyz> <1>
+} -cleanup {
+ event delete <<Paste>>
+} -returnCodes error -result {bad event type or keysym "xyz"}
+test bind-17.7 {event command: add with error} -body {
+ event delete <<Paste>>
+ catch {event add <<Paste>> <Control-v> <Button-2> abc <xyz> <1>}
+ lsort [event info <<Paste>>]
+} -cleanup {
+ event delete <<Paste>>
+} -result {<Button-2> <Control-Key-v> abc}
+
+test bind-17.8 {event command: delete} -body {
+ event delete
+} -returnCodes error -result {wrong # args: should be "event delete virtual ?sequence ...?"}
+test bind-17.9 {event command: delete many} -body {
+ event delete <<Paste>>
event add <<Paste>> <3> <1> <2> t
event delete <<Paste>> <1> <2>
lsort [event info <<Paste>>]
-} {<Button-3> t}
-test bind-17.9 {event command: delete all} {
- setup
+} -cleanup {
+ event delete <<Paste>> <3> t
+} -result {<Button-3> t}
+test bind-17.10 {event command: delete all} -body {
event add <<Paste>> a b
event delete <<Paste>>
event info <<Paste>>
-} {}
-test bind-17.10 {event command: delete 1} {
- setup
+} -cleanup {
+ event delete <<Paste>> a b
+} -result {}
+test bind-17.11 {event command: delete 1} -body {
+ event delete <<Paste>>
event add <<Paste>> a b c
event delete <<Paste>> b
lsort [event info <<Paste>>]
-} {a c}
-test bind-17.11 {event command: info name} {
- setup
+} -cleanup {
+ event delete <<Paste>>
+} -result {a c}
+test bind-17.12 {event command: info name} -body {
+ event delete <<Paste>>
event add <<Paste>> a b c
lsort [event info <<Paste>>]
-} {a b c}
-test bind-17.12 {event command: info all} {
- setup
+} -cleanup {
+ event delete <<Paste>>
+} -result {a b c}
+test bind-17.13 {event command: info all} -body {
+ foreach p [event info] {event delete $p}
event add <<Paste>> a
event add <<Alive>> b
lsort [event info]
-} {<<Alive>> <<Paste>>}
-test bind-17.13 {event command: info error} {
- list [catch {event info <<Paste>> <Control-v>} msg] $msg
-} {1 {wrong # args: should be "event info ?virtual?"}}
-test bind-17.14 {event command: generate} {
- list [catch {event generate} msg] $msg
-} {1 {wrong # args: should be "event generate window event ?options?"}}
-test bind-17.15 {event command: generate} {
- setup
- bind .b.f <1> "lappend x 1"
- set x {}
- event generate .b.f <1>
- set x
-} {1}
-test bind-17.16 {event command: generate} {
- list [catch {event generate .b.f <xyz>} msg] $msg
-} {1 {bad event type or keysym "xyz"}}
-test bind-17.17 {event command} {
- list [catch {event foo} msg] $msg
-} {1 {bad option "foo": must be add, delete, generate, or info}}
-
-test bind-18.1 {CreateVirtualEvent procedure: GetVirtualEventUid} {
- list [catch {event add asd <Ctrl-v>} msg] $msg
-} {1 {virtual event "asd" is badly formed}}
-test bind-18.2 {CreateVirtualEvent procedure: FindSequence} {
- list [catch {event add <<asd>> <Ctrl-v>} msg] $msg
-} {1 {bad event type or keysym "Ctrl"}}
-test bind-18.3 {CreateVirtualEvent procedure: new physical} {
- setup
+} -cleanup {
+ event delete <<Paste>>
+ event delete <<Alive>>
+} -result {<<Alive>> <<Paste>>}
+
+test bind-17.14 {event command: info error} -body {
+ event info <<Paste>> <Control-v>
+} -returnCodes error -result {wrong # args: should be "event info ?virtual?"}
+test bind-17.15 {event command: generate} -body {
+ event generate
+} -returnCodes error -result {wrong # args: should be "event generate window event ?-option value ...?"}
+
+test bind-17.16 {event command: generate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <1> "lappend x 1"
+ event generate .t.f <1>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-17.17 {event command: generate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ event generate .t.f <xyz>
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad event type or keysym "xyz"}
+test bind-17.18 {event command} -body {
+ event foo
+} -returnCodes error -result {bad option "foo": must be add, delete, generate, or info}
+
+
+test bind-18.1 {CreateVirtualEvent procedure: GetVirtualEventUid} -body {
+ event add asd <Ctrl-v>
+} -returnCodes error -result {virtual event "asd" is badly formed}
+test bind-18.2 {CreateVirtualEvent procedure: FindSequence} -body {
+ event add <<asd>> <Ctrl-v>
+} -returnCodes error -result {bad event type or keysym "Ctrl"}
+test bind-18.3 {CreateVirtualEvent procedure: new physical} -body {
+ event delete <<xyz>>
event add <<xyz>> <Control-v>
event info <<xyz>>
-} {<Control-Key-v>}
-test bind-18.4 {CreateVirtualEvent procedure: duplicate physical} {
- setup
+} -cleanup {
+ event delete <<xyz>>
+} -result {<Control-Key-v>}
+test bind-18.4 {CreateVirtualEvent procedure: duplicate physical} -body {
+ event delete <<xyz>>
event add <<xyz>> <Control-v>
event add <<xyz>> <Control-v>
event info <<xyz>>
-} {<Control-Key-v>}
-test bind-18.5 {CreateVirtualEvent procedure: existing physical} {
- setup
+} -cleanup {
+ event delete <<xyz>>
+} -result {<Control-Key-v>}
+test bind-18.5 {CreateVirtualEvent procedure: existing physical} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event add <<abc>> <Control-v>
list [lsort [event info]] [event info <<xyz>>] [event info <<abc>>]
-} {{<<abc>> <<xyz>>} <Control-Key-v> <Control-Key-v>}
-test bind-18.6 {CreateVirtualEvent procedure: new virtual} {
- setup
+} -cleanup {
+ event delete <<xyz>>
+ event delete <<abc>>
+} -result {{<<abc>> <<xyz>>} <Control-Key-v> <Control-Key-v>}
+test bind-18.6 {CreateVirtualEvent procedure: new virtual} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
list [event info] [event info <<xyz>>]
-} {<<xyz>> <Control-Key-v>}
-test bind-18.7 {CreateVirtualEvent procedure: existing virtual} {
- setup
+} -cleanup {
+ event delete <<abc>>
+} -result {<<xyz>> <Control-Key-v>}
+test bind-18.7 {CreateVirtualEvent procedure: existing virtual} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event add <<xyz>> <Button-2>
list [event info] [lsort [event info <<xyz>>]]
-} {<<xyz>> {<Button-2> <Control-Key-v>}}
+} -cleanup {
+ event delete <<xyz>>
+} -result {<<xyz>> {<Button-2> <Control-Key-v>}}
-test bind-19.1 {DeleteVirtualEvent procedure: GetVirtualEventUid} {
- list [catch {event add xyz {}} msg] $msg
-} {1 {virtual event "xyz" is badly formed}}
-test bind-19.2 {DeleteVirtualEvent procedure: non-existent virtual} {
- setup
+test bind-19.1 {DeleteVirtualEvent procedure: GetVirtualEventUid} -body {
+ event add xyz {}
+} -returnCodes error -result {virtual event "xyz" is badly formed}
+test bind-19.2 {DeleteVirtualEvent procedure: non-existent virtual} -setup {
+ foreach p [event info] {event delete $p}
+} -body {
event delete <<xyz>>
event info
-} {}
-test bind-19.3 {DeleteVirtualEvent procedure: delete 1} {
- setup
+} -result {}
+test bind-19.3 {DeleteVirtualEvent procedure: delete 1} -setup {
+ event delete <<xyz>>
+} -body {
event add <<xyz>> <Control-v>
event delete <<xyz>> <Control-v>
event info <<xyz>>
-} {}
-test bind-19.4 {DeleteVirtualEvent procedure: delete 1, not owned} {
- setup
+} -result {}
+test bind-19.4 {DeleteVirtualEvent procedure: delete 1, not owned} -setup {
+ event delete <<xyz>>
+} -body {
event add <<xyz>> <Control-v>
event delete <<xyz>> <Button-1>
event info <<xyz>>
-} {<Control-Key-v>}
-test bind-19.5 {DeleteVirtualEvent procedure: delete 1, badly formed} {
- setup
+} -result {<Control-Key-v>}
+test bind-19.5 {DeleteVirtualEvent procedure: delete 1, badly formed} -body {
event add <<xyz>> <Control-v>
- list [catch {event delete <<xyz>> <xyz>} msg] $msg
-} {1 {bad event type or keysym "xyz"}}
-test bind-19.6 {DeleteVirtualEvent procedure: delete 1, badly formed} {
- setup
+ event delete <<xyz>> <xyz>
+} -cleanup {
+ event delete <<xyz>>
+} -returnCodes error -result {bad event type or keysym "xyz"}
+test bind-19.6 {DeleteVirtualEvent procedure: delete 1, badly formed} -body {
event add <<xyz>> <Control-v>
- list [catch {event delete <<xyz>> <<Paste>>} msg] $msg
-} {1 {virtual event not allowed in definition of another virtual event}}
-test bind-19.7 {DeleteVirtualEvent procedure: owns 1, delete all} {
- setup
+ event delete <<xyz>> <<Paste>>
+} -cleanup {
+ event delete <<xyz>>
+} -returnCodes error -result {virtual event not allowed in definition of another virtual event}
+test bind-19.7 {DeleteVirtualEvent procedure: owns 1, delete all} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event delete <<xyz>>
event info
-} {}
-test bind-19.8 {DeleteVirtualEvent procedure: owns 1, delete 1} {
- setup
+} -result {}
+test bind-19.8 {DeleteVirtualEvent procedure: owns 1, delete 1} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event delete <<xyz>> <Control-v>
event info
-} {}
-test bind-19.9 {DeleteVirtualEvent procedure: owns many, delete all} {
- setup
+} -result {}
+test bind-19.9 {DeleteVirtualEvent procedure: owns many, delete all} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v> <Control-w> <Control-x>
event delete <<xyz>>
event info
-} {}
-test bind-19.10 {DeleteVirtualEvent procedure: owns many, delete 1} {
- setup
+} -result {}
+test bind-19.10 {DeleteVirtualEvent procedure: owns many, delete 1} -body {
+ event delete <<xyz>>
event add <<xyz>> <Control-v> <Control-w> <Control-x>
event delete <<xyz>> <Control-w>
lsort [event info <<xyz>>]
-} {<Control-Key-v> <Control-Key-x>}
-test bind-19.11 {DeleteVirtualEvent procedure: owned by 1, only} {
- setup
- event add <<xyz>> <Button-2>
- bind .b.f <<xyz>> {lappend x %#}
+} -cleanup {
+ event delete <<xyz>>
+} -result {<Control-Key-v> <Control-Key-x>}
+test bind-19.11 {DeleteVirtualEvent procedure: owned by 1, only} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button-2> -serial 101
- event gen .b.f <ButtonRelease-2>
event delete <<xyz>>
- event gen .b.f <Button-2> -serial 102
- event gen .b.f <ButtonRelease-2>
+} -body {
+ event add <<xyz>> <Button-2>
+ bind .t.f <<xyz>> {lappend x %#}
+ event generate .t.f <Button-2> -serial 101
+ event generate .t.f <ButtonRelease-2>
+ event delete <<xyz>>
+ event generate .t.f <Button-2> -serial 102
+ event generate .t.f <ButtonRelease-2>
set x
-} {101}
-test bind-19.12 {DeleteVirtualEvent procedure: owned by 1, first in chain} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {101}
+test bind-19.12 {DeleteVirtualEvent procedure: owned by 1, first in chain} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<abc>> <Control-Button-2>
event add <<xyz>> <Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.f <<abc>> {lappend x abc}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Control-ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.f <<abc>> {lappend x abc}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Control-ButtonRelease-2>
event delete <<xyz>>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Control-ButtonRelease-2>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Control-ButtonRelease-2>
list $x [event info <<abc>>]
-} {{xyz abc abc} <Control-Button-2>}
-test bind-19.13 {DeleteVirtualEvent procedure: owned by 1, second in chain} {
- setup
+} -cleanup {
+ destroy .t.f
+ event delete <<abc>>
+} -result {{xyz abc abc} <Control-Button-2>}
+test bind-19.13 {DeleteVirtualEvent procedure: owned by 1, second in chain} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+ event delete <<def>>
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<def>> <Shift-Button-2>
event add <<xyz>> <Button-2>
event add <<abc>> <Control-Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.f <<abc>> {lappend x abc}
- bind .b.f <<def>> {lappend x def}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Control-ButtonRelease-2>
- event gen .b.f <Shift-Button-2>
- event gen .b.f <Shift-ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.f <<abc>> {lappend x abc}
+ bind .t.f <<def>> {lappend x def}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Control-ButtonRelease-2>
+ event generate .t.f <Shift-Button-2>
+ event generate .t.f <Shift-ButtonRelease-2>
event delete <<xyz>>
- event gen .b.f <Button-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Shift-Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-ButtonRelease-2>
- event gen .b.f <Shift-ButtonRelease-2>
+ event generate .t.f <Button-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Shift-Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-ButtonRelease-2>
+ event generate .t.f <Shift-ButtonRelease-2>
list $x [event info <<def>>] [event info <<xyz>>] [event info <<abc>>]
-} {{xyz abc def abc def} <Shift-Button-2> {} <Control-Button-2>}
-test bind-19.14 {DeleteVirtualEvent procedure: owned by 1, last in chain} {
- setup
+} -cleanup {
+ destroy .t.f
+ event delete <<abc>>
+ event delete <<def>>
+} -result {{xyz abc def abc def} <Shift-Button-2> {} <Control-Button-2>}
+test bind-19.14 {DeleteVirtualEvent procedure: owned by 1, last in chain} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+ event delete <<def>>
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<xyz>> <Button-2>
event add <<abc>> <Control-Button-2>
event add <<def>> <Shift-Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.f <<abc>> {lappend x abc}
- bind .b.f <<def>> {lappend x def}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Control-ButtonRelease-2>
- event gen .b.f <Shift-Button-2>
- event gen .b.f <Shift-ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.f <<abc>> {lappend x abc}
+ bind .t.f <<def>> {lappend x def}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Control-ButtonRelease-2>
+ event generate .t.f <Shift-Button-2>
+ event generate .t.f <Shift-ButtonRelease-2>
event delete <<xyz>>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Control-Button-2>
- event gen .b.f <Control-ButtonRelease-2>
- event gen .b.f <Shift-Button-2>
- event gen .b.f <Shift-ButtonRelease-2>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Control-Button-2>
+ event generate .t.f <Control-ButtonRelease-2>
+ event generate .t.f <Shift-Button-2>
+ event generate .t.f <Shift-ButtonRelease-2>
list $x [event info <<xyz>>] [event info <<abc>>] [event info <<def>>]
-} {{xyz abc def abc def} {} <Control-Button-2> <Shift-Button-2>}
-test bind-19.15 {DeleteVirtualEvent procedure: owned by many, first} {
- setup
- pack [frame .b.g -class Test -width 150 -height 100]
- pack [frame .b.h -class Test -width 150 -height 100]
+} -cleanup {
+ destroy .t.f
+ event delete <<def>>
+ event delete <<abc>>
+} -result {{xyz abc def abc def} {} <Control-Button-2> <Shift-Button-2>}
+test bind-19.15 {DeleteVirtualEvent procedure: owned by many, first} -setup {
+ pack [frame .t.f -class Test -width 150 -height 100]
+ pack [frame .t.g -class Test -width 150 -height 100]
+ pack [frame .t.h -class Test -width 150 -height 100]
+ focus -force .t.f
update
+ set x {}
+ event delete <<def>>
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<xyz>> <Button-2>
event add <<abc>> <Button-2>
event add <<def>> <Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.g <<abc>> {lappend x abc}
- bind .b.h <<def>> {lappend x def}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.g <<abc>> {lappend x abc}
+ bind .t.h <<def>> {lappend x def}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
event delete <<xyz>>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
- destroy .b.g
- destroy .b.h
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
list $x [event info <<xyz>>] [event info <<abc>>] [event info <<def>>]
-} {{xyz abc def abc def} {} <Button-2> <Button-2>}
-test bind-19.16 {DeleteVirtualEvent procedure: owned by many, middle} {
- setup
- pack [frame .b.g -class Test -width 150 -height 100]
- pack [frame .b.h -class Test -width 150 -height 100]
+} -cleanup {
+ destroy .t.f .t.g .t.h
+ event delete <<def>>
+ event delete <<abc>>
+} -result {{xyz abc def abc def} {} <Button-2> <Button-2>}
+test bind-19.16 {DeleteVirtualEvent procedure: owned by many, middle} -setup {
+ pack [frame .t.f -class Test -width 150 -height 100]
+ pack [frame .t.g -class Test -width 150 -height 100]
+ pack [frame .t.h -class Test -width 150 -height 100]
+ focus -force .t.f
update
+ set x {}
+ event delete <<def>>
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<xyz>> <Button-2>
event add <<abc>> <Button-2>
event add <<def>> <Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.g <<abc>> {lappend x abc}
- bind .b.h <<def>> {lappend x def}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.g <<abc>> {lappend x abc}
+ bind .t.h <<def>> {lappend x def}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
event delete <<abc>>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
- destroy .b.g
- destroy .b.h
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
list $x [event info <<xyz>>] [event info <<abc>>] [event info <<def>>]
-} {{xyz abc def xyz def} <Button-2> {} <Button-2>}
-test bind-19.17 {DeleteVirtualEvent procedure: owned by many, last} {
- setup
- pack [frame .b.g -class Test -width 150 -height 100]
- pack [frame .b.h -class Test -width 150 -height 100]
+} -cleanup {
+ destroy .t.f .t.g .t.h
+ event delete <<def>>
+ event delete <<xyz>>
+} -result {{xyz abc def xyz def} <Button-2> {} <Button-2>}
+test bind-19.17 {DeleteVirtualEvent procedure: owned by many, last} -setup {
+ pack [frame .t.f -class Test -width 150 -height 100]
+ pack [frame .t.g -class Test -width 150 -height 100]
+ pack [frame .t.h -class Test -width 150 -height 100]
+ focus -force .t.f
update
+ set x {}
+ event delete <<def>>
+ event delete <<xyz>>
+ event delete <<abc>>
+} -body {
event add <<xyz>> <Button-2>
event add <<abc>> <Button-2>
event add <<def>> <Button-2>
- bind .b.f <<xyz>> {lappend x xyz}
- bind .b.g <<abc>> {lappend x abc}
- bind .b.h <<def>> {lappend x def}
- set x {}
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
+ bind .t.f <<xyz>> {lappend x xyz}
+ bind .t.g <<abc>> {lappend x abc}
+ bind .t.h <<def>> {lappend x def}
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
event delete <<def>>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.g <Button-2>
- event gen .b.g <ButtonRelease-2>
- event gen .b.h <Button-2>
- event gen .b.h <ButtonRelease-2>
- destroy .b.g
- destroy .b.h
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.g <Button-2>
+ event generate .t.g <ButtonRelease-2>
+ event generate .t.h <Button-2>
+ event generate .t.h <ButtonRelease-2>
list $x [event info <<xyz>>] [event info <<abc>>] [event info <<def>>]
-} {{xyz abc def xyz abc} <Button-2> <Button-2> {}}
+} -cleanup {
+ destroy .t.f .t.g .t.h
+ event delete <<xyz>>
+ event delete <<abc>>
+} -result {{xyz abc def xyz abc} <Button-2> <Button-2> {}}
-test bind-20.1 {GetVirtualEvent procedure: GetVirtualEventUid} {
- list [catch {event info asd} msg] $msg
-} {1 {virtual event "asd" is badly formed}}
-test bind-20.2 {GetVirtualEvent procedure: non-existent event} {
+test bind-20.1 {GetVirtualEvent procedure: GetVirtualEventUid} -body {
+ event info asd
+} -returnCodes error -result {virtual event "asd" is badly formed}
+test bind-20.2 {GetVirtualEvent procedure: non-existent event} -body {
+ event delete <<asd>>
event info <<asd>>
-} {}
-test bind-20.3 {GetVirtualEvent procedure: owns 1} {
- setup
+} -result {}
+test bind-20.3 {GetVirtualEvent procedure: owns 1} -setup {
+ event delete <<xyz>>
+} -body {
event add <<xyz>> <Control-Key-v>
event info <<xyz>>
-} {<Control-Key-v>}
-test bind-20.4 {GetVirtualEvent procedure: owns many} {
- setup
+} -cleanup {
+ event delete <<xyz>>
+} -result {<Control-Key-v>}
+test bind-20.4 {GetVirtualEvent procedure: owns many} -setup {
+ event delete <<xyz>>
+} -body {
event add <<xyz>> <Control-v> <Button-2> spack
event info <<xyz>>
-} {<Control-Key-v> <Button-2> spack}
+} -cleanup {
+ event delete <<xyz>>
+} -result {<Control-Key-v> <Button-2> spack}
-test bind-21.1 {GetAllVirtualEvents procedure: no events} {
- setup
+test bind-21.1 {GetAllVirtualEvents procedure: no events} -body {
+ foreach p [event info] {event delete $p}
event info
-} {}
-test bind-21.2 {GetAllVirtualEvents procedure: 1 event} {
- setup
+} -result {}
+test bind-21.2 {GetAllVirtualEvents procedure: 1 event} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event info
-} {<<xyz>>}
-test bind-21.3 {GetAllVirtualEvents procedure: many events} {
- setup
+} -cleanup {
+ event delete <<xyz>>
+} -result {<<xyz>>}
+test bind-21.3 {GetAllVirtualEvents procedure: many events} -body {
+ foreach p [event info] {event delete $p}
event add <<xyz>> <Control-v>
event add <<xyz>> <Button-2>
event add <<abc>> <Control-v>
event add <<def>> <Key-F6>
lsort [event info]
-} {<<abc>> <<def>> <<xyz>>}
-
-test bind-22.1 {HandleEventGenerate} {
- list [catch {event gen .xyz <Control-v>} msg] $msg
-} {1 {bad window path name ".xyz"}}
-test bind-22.2 {HandleEventGenerate} {
- list [catch {event gen zzz <Control-v>} msg] $msg
-} {1 {bad window name/identifier "zzz"}}
-test bind-22.3 {HandleEventGenerate} {
- list [catch {event gen 47 <Control-v>} msg] $msg
-} {1 {bad window name/identifier "47"}}
-test bind-22.4 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {set x "%s %b"}
- set x {}
- event gen [winfo id .b.f] <Control-Button-1> -state 260
- set x
-} {260 1}
-test bind-22.5 {HandleEventGenerate} {
- list [catch {event gen . <xyz>} msg] $msg
-} {1 {bad event type or keysym "xyz"}}
-test bind-22.6 {HandleEventGenerate} {
- list [catch {event gen . <Double-Button-1>} msg] $msg
-} {1 {Double or Triple modifier not allowed}}
-test bind-22.7 {HandleEventGenerate} {
- list [catch {event gen . xyz} msg] $msg
-} {1 {only one event specification allowed}}
-test bind-22.8 {HandleEventGenerate} {
- list [catch {event gen . <Button> -button} msg] $msg
-} {1 {value for "-button" missing}}
-test bind-22.9 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {set x "%s %b"}
- set x {}
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <ButtonRelease-3>
- event gen .b.f <Control-Button-1>
- event gen .b.f <Control-ButtonRelease-1>
- set x
-} {4 1}
-test bind-22.10 {HandleEventGenerate} {
- setup
- bind .b.f <Key> {set x "%s %K"}
- set x {}
- event gen .b.f <Control-Key-1>
- set x
-} {4 1}
-test bind-22.11 {HandleEventGenerate} {
- setup
- bind .b.f <<Paste>> {set x "%s"}
- set x {}
- event gen .b.f <<Paste>> -state 1
- set x
-} {1}
-test bind-22.12 {HandleEventGenerate} {
- setup
- bind .b.f <Motion> {set x "%s"}
- set x {}
- event gen .b.f <Control-Motion>
- set x
-} {4}
-test bind-22.13 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {lappend x %#}
- set x {}
- event gen .b.f <Button> -when now -serial 100
- event gen .b.f <ButtonRelease> -when now
- set x
-} {100}
-test bind-22.14 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {lappend x %#}
- set x {}
- event gen .b.f <Button> -when head -serial 100
- event gen .b.f <Button> -when head -serial 101
- event gen .b.f <Button> -when head -serial 102
- event gen .b.f <ButtonRelease> -when tail
+} -cleanup {
+ event delete <<xyz>>
+ event delete <<abc>>
+ event delete <<def>>
+} -result {<<abc>> <<def>> <<xyz>>}
+
+test bind-22.1 {HandleEventGenerate} -setup {
+ destroy .xyz
+} -body {
+ event generate .xyz <Control-v>
+} -returnCodes error -result {bad window path name ".xyz"}
+test bind-22.2 {HandleEventGenerate} -body {
+ event generate zzz <Control-v>
+} -returnCodes error -result {bad window name/identifier "zzz"}
+test bind-22.3 {HandleEventGenerate} -body {
+ event generate 47 <Control-v>
+} -returnCodes error -result {bad window name/identifier "47"}
+test bind-22.4 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> {set x "%s %b"}
+ event generate [winfo id .t.f] <Control-Button-1> -state 260
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {260 1}
+test bind-22.5 {HandleEventGenerate} -body {
+ event generate . <xyz>
+} -returnCodes error -result {bad event type or keysym "xyz"}
+test bind-22.6 {HandleEventGenerate} -body {
+ event generate . <Double-Button-1>
+} -returnCodes error -result {Double or Triple modifier not allowed}
+test bind-22.7 {HandleEventGenerate} -body {
+ event generate . xyz
+} -returnCodes error -result {only one event specification allowed}
+test bind-22.8 {HandleEventGenerate} -body {
+ event generate . <Button> -button
+} -returnCodes error -result {value for "-button" missing}
+test bind-22.9 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> {set x "%s %b"}
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <ButtonRelease-3>
+ event generate .t.f <Control-Button-1>
+ event generate .t.f <Control-ButtonRelease-1>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {4 1}
+test bind-22.10 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> {set x "%s %K"}
+ event generate .t.f <Control-Key-space>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {4 space}
+test bind-22.11 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> {set x "%s"}
+ event generate .t.f <<Paste>> -state 1
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+test bind-22.12 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> {set x "%s"}
+ event generate .t.f <Control-Motion>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {4}
+test bind-22.13 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> {lappend x %#}
+ event generate .t.f <Button> -when now -serial 100
+ event generate .t.f <ButtonRelease> -when now
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+test bind-22.14 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> {lappend x %#}
+ event generate .t.f <Button> -when head -serial 100
+ event generate .t.f <Button> -when head -serial 101
+ event generate .t.f <Button> -when head -serial 102
+ event generate .t.f <ButtonRelease> -when tail
lappend x foo
update
set x
-} {foo 102 101 100}
-test bind-22.15 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {lappend x %#}
+} -cleanup {
+ destroy .t.f
+} -result {foo 102 101 100}
+test bind-22.15 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button> -when head -serial 99
- event gen .b.f <Button> -when mark -serial 100
- event gen .b.f <Button> -when mark -serial 101
- event gen .b.f <Button> -when mark -serial 102
- event gen .b.f <ButtonRelease> -when tail
+} -body {
+ bind .t.f <Button> {lappend x %#}
+ event generate .t.f <Button> -when head -serial 99
+ event generate .t.f <Button> -when mark -serial 100
+ event generate .t.f <Button> -when mark -serial 101
+ event generate .t.f <Button> -when mark -serial 102
+ event generate .t.f <ButtonRelease> -when tail
lappend x foo
update
set x
-} {foo 100 101 102 99}
-test bind-22.16 {HandleEventGenerate} {
- setup
- bind .b.f <Button> {lappend x %#}
+} -cleanup {
+ destroy .t.f
+} -result {foo 100 101 102 99}
+test bind-22.16 {HandleEventGenerate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- event gen .b.f <Button> -when head -serial 99
- event gen .b.f <Button> -when tail -serial 100
- event gen .b.f <Button> -when tail -serial 101
- event gen .b.f <Button> -when tail -serial 102
- event gen .b.f <ButtonRelease> -when tail
+} -body {
+ bind .t.f <Button> {lappend x %#}
+ event generate .t.f <Button> -when head -serial 99
+ event generate .t.f <Button> -when tail -serial 100
+ event generate .t.f <Button> -when tail -serial 101
+ event generate .t.f <Button> -when tail -serial 102
+ event generate .t.f <ButtonRelease> -when tail
lappend x foo
update
set x
-} {foo 99 100 101 102}
-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}}
-test bind-22.18 {HandleEventGenerate} {
+} -cleanup {
+ destroy .t.f
+} -result {foo 99 100 101 102}
+test bind-22.17 {HandleEventGenerate} -body {
+ event generate . <Button> -when xyz
+} -returnCodes error -result {bad -when value "xyz": must be now, head, mark, or tail}
+test bind-22.18 {HandleEventGenerate} -body {
# Bug 411307
- list [catch {event gen . <a> -root 98765} msg] $msg
-} {1 {bad window name/identifier "98765"}}
-foreach check {
- {bind-22.19 <Configure> %a {-above .xyz} {{1 {bad window path name ".xyz"}}}}
- {bind-22.20 <Configure> %a {-above .b} {[winfo id .b]}}
- {bind-22.21 <Configure> %a {-above xyz} {{1 {bad window name/identifier "xyz"}}}}
- {bind-22.22 <Configure> %a {-above [winfo id .b]} {[winfo id .b]}}
- {bind-22.23 <Key> %b {-above .} {{1 {<Key> event doesn't accept "-above" option}}}}
-
- {bind-22.24 <Configure> %B {-borderwidth xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.25 <Configure> %B {-borderwidth 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.26 <Key> %k {-borderwidth 2i} {{1 {<Key> event doesn't accept "-borderwidth" option}}}}
-
- {bind-22.27 <Button> %b {-button xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.28 <Button> %b {-button 1} 1}
- {bind-22.29 <ButtonRelease> %b {-button 1} 1}
- {bind-22.30 <Key> %k {-button 1} {{1 {<Key> event doesn't accept "-button" option}}}}
-
- {bind-22.31 <Expose> %c {-count xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.32 <Expose> %c {-count 20} 20}
- {bind-22.33 <Key> %b {-count 20} {{1 {<Key> event doesn't accept "-count" option}}}}
-
- {bind-22.34 <Enter> %d {-detail xyz} {{1 {bad -detail value "xyz": must be NotifyAncestor, NotifyVirtual, NotifyInferior, NotifyNonlinear, NotifyNonlinearVirtual, NotifyPointer, NotifyPointerRoot, or NotifyDetailNone}}}}
- {bind-22.35 <FocusIn> %d {-detail NotifyVirtual} {{}}}
- {bind-22.36 <Enter> %d {-detail NotifyVirtual} NotifyVirtual}
- {bind-22.37 <Key> %k {-detail NotifyVirtual} {{1 {<Key> event doesn't accept "-detail" option}}}}
-
- {bind-22.38 <Enter> %f {-focus xyz} {{1 {expected boolean value but got "xyz"}}}}
- {bind-22.39 <Enter> %f {-focus 1} 1}
- {bind-22.40 <Key> %k {-focus 1} {{1 {<Key> event doesn't accept "-focus" option}}}}
-
- {bind-22.41 <Expose> %h {-height xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.42 <Expose> %h {-height 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.43 <Configure> %h {-height 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.44 <Key> %k {-height 2i} {{1 {<Key> event doesn't accept "-height" option}}}}
-
- {bind-22.45 <Key> %k {-keycode xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.46 <Key> %k {-keycode 20} 20}
- {bind-22.47 <Button> %b {-keycode 20} {{1 {<Button> event doesn't accept "-keycode" option}}}}
-
- {bind-22.48 <Key> %K {-keysym xyz} {{1 {unknown keysym "xyz"}}}}
- {bind-22.49 <Key> %K {-keysym a} a}
- {bind-22.50 <Button> %b {-keysym a} {{1 {<Button> event doesn't accept "-keysym" option}}}}
-
- {bind-22.51 <Enter> %m {-mode xyz} {{1 {bad -mode value "xyz": must be NotifyNormal, NotifyGrab, NotifyUngrab, or NotifyWhileGrabbed}}}}
- {bind-22.52 <Enter> %m {-mode NotifyNormal} NotifyNormal}
- {bind-22.53 <FocusIn> %m {-mode NotifyNormal} {{}}}
- {bind-22.54 <Key> %k {-mode NotifyNormal} {{1 {<Key> event doesn't accept "-mode" option}}}}
-
- {bind-22.55 <Map> %o {-override xyz} {{1 {expected boolean value but got "xyz"}}}}
- {bind-22.56 <Map> %o {-override 1} 1}
- {bind-22.57 <Reparent> %o {-override 1} 1}
- {bind-22.58 <Configure> %o {-override 1} 1}
- {bind-22.59 <Key> %k {-override 1} {{1 {<Key> event doesn't accept "-override" option}}}}
-
- {bind-22.60 <Circulate> %p {-place xyz} {{1 {bad -place value "xyz": must be PlaceOnTop, or PlaceOnBottom}}}}
- {bind-22.61 <Circulate> %p {-place PlaceOnTop} PlaceOnTop}
- {bind-22.62 <Key> %k {-place PlaceOnTop} {{1 {<Key> event doesn't accept "-place" option}}}}
-
- {bind-22.63 <Key> %R {-root .xyz} {{1 {bad window path name ".xyz"}}}}
- {bind-22.64 <Key> %R {-root .b} {[winfo id .b]}}
- {bind-22.65 <Key> %R {-root xyz} {{1 {bad window name/identifier "xyz"}}}}
- {bind-22.66 <Key> %R {-root [winfo id .b]} {[winfo id .b]}}
- {bind-22.67 <Button> %R {-root .b} {[winfo id .b]}}
- {bind-22.68 <ButtonRelease> %R {-root .b} {[winfo id .b]}}
- {bind-22.69 <Motion> %R {-root .b} {[winfo id .b]}}
- {bind-22.70 <<Paste>> %R {-root .b} {[winfo id .b]}}
- {bind-22.71 <Enter> %R {-root .b} {[winfo id .b]}}
- {bind-22.72 <Configure> %R {-root .b} {{1 {<Configure> event doesn't accept "-root" option}}}}
-
- {bind-22.73 <Key> %X {-rootx xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.74 <Key> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.75 <Button> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.76 <ButtonRelease> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.77 <Motion> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.78 <<Paste>> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.79 <Enter> %X {-rootx 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.80 <Configure> %X {-rootx 2i} {{1 {<Configure> event doesn't accept "-rootx" option}}}}
-
- {bind-22.81 <Key> %Y {-rooty xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.82 <Key> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.83 <Button> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.84 <ButtonRelease> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.85 <Motion> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.86 <<Paste>> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.87 <Enter> %Y {-rooty 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.88 <Configure> %Y {-rooty 2i} {{1 {<Configure> event doesn't accept "-rooty" option}}}}
-
- {bind-22.89 <Key> %E {-sendevent xyz} {{1 {expected boolean value but got "xyz"}}}}
- {bind-22.90 <Key> %E {-sendevent 1} 1}
- {bind-22.91 <Key> %E {-sendevent yes} 1}
- {bind-22.92 <Key> %E {-sendevent 43} 43}
-
- {bind-22.93 <Key> %# {-serial xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.94 <Key> %# {-serial 100} 100}
-
- {bind-22.95 <Key> %s {-state xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.96 <Key> %s {-state 1} 1}
- {bind-22.97 <Button> %s {-state 1025} 1025}
- {bind-22.98 <ButtonRelease> %s {-state 1025} 1025}
- {bind-22.99 <Motion> %s {-state 1} 1}
- {bind-22.100 <<Paste>> %s {-state 1} 1}
- {bind-22.101 <Enter> %s {-state 1} 1}
- {bind-22.102 <Visibility> %s {-state xyz} {{1 {bad -state value "xyz": must be VisibilityUnobscured, VisibilityPartiallyObscured, or VisibilityFullyObscured}}}}
- {bind-22.103 <Visibility> %s {-state VisibilityUnobscured} VisibilityUnobscured}
- {bind-22.104 <Configure> %s {-state xyz} {{1 {<Configure> event doesn't accept "-state" option}}}}
-
- {bind-22.105 <Key> %S {-subwindow .xyz} {{1 {bad window path name ".xyz"}}}}
- {bind-22.106 <Key> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.107 <Key> %S {-subwindow xyz} {{1 {bad window name/identifier "xyz"}}}}
- {bind-22.108 <Key> %S {-subwindow [winfo id .b]} {[winfo id .b]}}
- {bind-22.109 <Button> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.110 <ButtonRelease> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.111 <Motion> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.112 <<Paste>> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.113 <Enter> %S {-subwindow .b} {[winfo id .b]}}
- {bind-22.114 <Configure> %S {-subwindow .b} {{1 {<Configure> event doesn't accept "-subwindow" option}}}}
-
- {bind-22.115 <Key> %t {-time xyz} {{1 {expected integer but got "xyz"}}}}
- {bind-22.116 <Key> %t {-time 100} 100}
- {bind-22.117 <Button> %t {-time 100} 100}
- {bind-22.118 <ButtonRelease> %t {-time 100} 100}
- {bind-22.119 <Motion> %t {-time 100} 100}
- {bind-22.120 <<Paste>> %t {-time 100} 100}
- {bind-22.121 <Enter> %t {-time 100} 100}
- {bind-22.122 <Property> %t {-time 100} 100}
- {bind-22.123 <Configure> %t {-time 100} {{1 {<Configure> event doesn't accept "-time" option}}}}
-
- {bind-22.124 <Expose> %w {-width xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.125 <Expose> %w {-width 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.126 <Configure> %w {-width 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.127 <Key> %k {-width 2i} {{1 {<Key> event doesn't accept "-width" option}}}}
-
- {bind-22.128 <Unmap> %W {-window .xyz} {{1 {bad window path name ".xyz"}}}}
- {bind-22.129 <Unmap> %W {-window .b.f} .b.f}
- {bind-22.130 <Unmap> %W {-window xyz} {{1 {bad window name/identifier "xyz"}}}}
- {bind-22.131 <Unmap> %W {-window [winfo id .b.f]} .b.f}
- {bind-22.132 <Unmap> %W {-window .b.f} .b.f}
- {bind-22.133 <Map> %W {-window .b.f} .b.f}
- {bind-22.134 <Reparent> %W {-window .b.f} .b.f}
- {bind-22.135 <Configure> %W {-window .b.f} .b.f}
- {bind-22.136 <Gravity> %W {-window .b.f} .b.f}
- {bind-22.137 <Circulate> %W {-window .b.f} .b.f}
- {bind-22.138 <Key> %W {-window .b.f} {{1 {<Key> event doesn't accept "-window" option}}}}
-
- {bind-22.139 <Key> %x {-x xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.140 <Key> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.141 <Button> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.142 <ButtonRelease> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.143 <Motion> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.144 <<Paste>> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.145 <Enter> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.146 <Expose> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.147 <Configure> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.148 <Gravity> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.149 <Reparent> %x {-x 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.150 <Map> %x {-x 2i} {{1 {<Map> event doesn't accept "-x" option}}}}
-
- {bind-22.151 <Key> %y {-y xyz} {{1 {bad screen distance "xyz"}}}}
- {bind-22.152 <Key> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.153 <Button> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.154 <ButtonRelease> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.155 <Motion> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.156 <<Paste>> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.157 <Enter> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.158 <Expose> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.159 <Configure> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.160 <Gravity> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.161 <Reparent> %y {-y 2i} {[winfo pixels .b.f 2i]}}
- {bind-22.162 <Map> %y {-y 2i} {{1 {<Map> event doesn't accept "-y" option}}}}
-
- {bind-22.163 <Key> %k {-xyz 1} {{1 {bad option "-xyz": must be -when, -above, -borderwidth, -button, -count, -data, -delta, -detail, -focus, -height, -keycode, -keysym, -mode, -override, -place, -root, -rootx, -rooty, -sendevent, -serial, -state, -subwindow, -time, -warp, -width, -window, -x, or -y}}}}
-} {
- lassign $check name event substitution generator result
- test $name "HandleEventGenerate: options $event $generator" {
- setup
- bind .b.f $event "lappend x $substitution"
- set x {}
- if [catch {eval event gen .b.f $event $generator} msg] {
- set x [list 1 $msg]
- }
- set x
- } [eval set x $result]
-}
+ event generate . <a> -root 98765
+} -returnCodes error -result {bad window name/identifier "98765"}
+
+test bind-22.19 {HandleEventGenerate: options <Configure> -above .xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %a"
+ event generate .t.f <Configure> -above .xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window path name ".xyz"}
+test bind-22.20 {HandleEventGenerate: options <Configure> -above .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %a"
+ event generate .t.f <Configure> -above .t
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result [winfo id .t]
+test bind-22.21 {HandleEventGenerate: options <Configure> -above xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %a"
+ event generate .t.f <Configure> -above xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window name/identifier "xyz"}
+test bind-22.22 {HandleEventGenerate: options <Configure> -above [winfo id .t]} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %a"
+ event generate .t.f <Configure> -above [winfo id .t]
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result [winfo id .t]
+
+test bind-22.23 {HandleEventGenerate: options <Key> -above .} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %b"
+ event generate .t.f <Key> -above .
+ return $x
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-above" option}
+
+test bind-22.24 {HandleEventGenerate: options <Configure> -borderwidth xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %B"
+ event generate .t.f <Configure> -borderwidth xyz
+ return $x
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.25 {HandleEventGenerate: options <Configure> -borderwidth 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %B"
+ event generate .t.f <Configure> -borderwidth 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.26 {HandleEventGenerate: options <Key> -borderwidth 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -borderwidth 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-borderwidth" option}
+
+test bind-22.27 {HandleEventGenerate: options <Button> -button xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %b"
+ event generate .t.f <Button> -button xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.28 {HandleEventGenerate: options <Button> -button 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %b"
+ event generate .t.f <Button> -button 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result 1
+
+test bind-22.29 {HandleEventGenerate: options <ButtonRelease> -button 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %b"
+ event generate .t.f <ButtonRelease> -button 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result 1
+
+test bind-22.30 {HandleEventGenerate: options <Key> -button 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -button 1
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-button" option}
+
+test bind-22.31 {HandleEventGenerate: options <Expose> -count xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %c"
+ event generate .t.f <Expose> -count xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.32 {HandleEventGenerate: options <Expose> -count 20} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %c"
+ event generate .t.f <Expose> -count 20
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {20}
+
+test bind-22.33 {HandleEventGenerate: options <Key> -count 20} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %b"
+ event generate .t.f <Key> -count 20
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-count" option}
+
+test bind-22.34 {HandleEventGenerate: options <Enter> -detail xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %d"
+ event generate .t.f <Enter> -detail xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad -detail value "xyz": must be NotifyAncestor, NotifyVirtual, NotifyInferior, NotifyNonlinear, NotifyNonlinearVirtual, NotifyPointer, NotifyPointerRoot, or NotifyDetailNone}
+
+test bind-22.35 {HandleEventGenerate: options <FocusIn> -detail NotifyVirtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <FocusIn> "lappend x FocusIn %d"
+ event generate .t.f <FocusIn> -detail NotifyVirtual
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {FocusIn NotifyVirtual}
+
+test bind-22.35.1 {HandleEventGenerate: options <FocusOut> -detail NotifyVirtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <FocusOut> "lappend x FocusOut %d"
+ event generate .t.f <FocusOut> -detail NotifyVirtual
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {FocusOut NotifyVirtual}
+
+test bind-22.36 {HandleEventGenerate: options <Enter> -detail NotifyVirtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %d"
+ event generate .t.f <Enter> -detail NotifyVirtual
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {NotifyVirtual}
+
+test bind-22.37 {HandleEventGenerate: options <Key> -detail NotifyVirtual} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -detail NotifyVirtual
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-detail" option}
+
+test bind-22.38 {HandleEventGenerate: options <Enter> -focus xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %f"
+ event generate .t.f <Enter> -focus xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected boolean value but got "xyz"}
+
+test bind-22.39 {HandleEventGenerate: options <Enter> -focus 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %f"
+ event generate .t.f <Enter> -focus 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.40 {HandleEventGenerate: options <Key> -focus 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -focus 1
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-focus" option}
+
+test bind-22.41 {HandleEventGenerate: options <Expose> -height xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %h"
+ event generate .t.f <Expose> -height xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.42 {HandleEventGenerate: options <Expose> -height 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %h"
+ event generate .t.f <Expose> -height 2i
+ expr {$x eq [winfo pixels .t.f 2i]}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.43 {HandleEventGenerate: options <Configure> -height 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %h"
+ event generate .t.f <Configure> -height 2i
+ expr {$x eq [winfo pixels .t.f 2i]}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.44 {HandleEventGenerate: options <Key> -height 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -height 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-height" option}
+
+test bind-22.45 {HandleEventGenerate: options <Key> -keycode xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -keycode xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.46 {HandleEventGenerate: options <Key> -keycode 20} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -keycode 20
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {20}
+
+test bind-22.47 {HandleEventGenerate: options <Button> -keycode 20} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %b"
+ event generate .t.f <Button> -keycode 20
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Button> event doesn't accept "-keycode" option}
+
+test bind-22.48 {HandleEventGenerate: options <Key> -keysym xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %K"
+ event generate .t.f <Key> -keysym xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {unknown keysym "xyz"}
+
+test bind-22.49 {HandleEventGenerate: options <Key> -keysym space} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %K"
+ event generate .t.f <Key> -keysym space
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {space}
+
+test bind-22.50 {HandleEventGenerate: options <Button> -keysym space} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %b"
+ event generate .t.f <Button> -keysym space
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Button> event doesn't accept "-keysym" option}
+
+test bind-22.51 {HandleEventGenerate: options <Enter> -mode xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %m"
+ event generate .t.f <Enter> -mode xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad -mode value "xyz": must be NotifyNormal, NotifyGrab, NotifyUngrab, or NotifyWhileGrabbed}
+
+test bind-22.52 {HandleEventGenerate: options <Enter> -mode NotifyNormal} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %m"
+ event generate .t.f <Enter> -mode NotifyNormal
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {NotifyNormal}
+
+test bind-22.53 {HandleEventGenerate: options <FocusIn> -mode NotifyNormal} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <FocusIn> "lappend x %m"
+ event generate .t.f <FocusIn> -mode NotifyNormal
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {NotifyNormal}
+
+test bind-22.54 {HandleEventGenerate: options <Key> -mode NotifyNormal} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -mode NotifyNormal
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-mode" option}
+test bind-22.55 {HandleEventGenerate: options <Map> -override xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Map> "lappend x %o"
+ event generate .t.f <Map> -override xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected boolean value but got "xyz"}
+
+test bind-22.56 {HandleEventGenerate: options <Map> -override 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Map> "lappend x %o"
+ event generate .t.f <Map> -override 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.57 {HandleEventGenerate: options <Reparent> -override 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Reparent> "lappend x %o"
+ event generate .t.f <Reparent> -override 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.58 {HandleEventGenerate: options <Configure> -override 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %o"
+ event generate .t.f <Configure> -override 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.59 {HandleEventGenerate: options <Key> -override 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -override 1
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-override" option}
+
+test bind-22.60 {HandleEventGenerate: options <Circulate> -place xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Circulate> "lappend x %p"
+ event generate .t.f <Circulate> -place xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad -place value "xyz": must be PlaceOnTop, or PlaceOnBottom}
+
+test bind-22.61 {HandleEventGenerate: options <Circulate> -place PlaceOnTop} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Circulate> "lappend x %p"
+ event generate .t.f <Circulate> -place PlaceOnTop
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {PlaceOnTop}
+
+test bind-22.62 {HandleEventGenerate: options <Key> -place PlaceOnTop} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -place PlaceOnTop
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-place" option}
+
+test bind-22.63 {HandleEventGenerate: options <Key> -root .xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %R"
+ event generate .t.f <Key> -root .xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window path name ".xyz"}
+
+test bind-22.64 {HandleEventGenerate: options <Key> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %R"
+ event generate .t.f <Key> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.65 {HandleEventGenerate: options <Key> -root xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %R"
+ event generate .t.f <Key> -root xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window name/identifier "xyz"}
+
+test bind-22.66 {HandleEventGenerate: options <Key> -root [winfo id .t]} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %R"
+ event generate .t.f <Key> -root [winfo id .t]
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.67 {HandleEventGenerate: options <Button> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %R"
+ event generate .t.f <Button> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.68 {HandleEventGenerate: options <ButtonRelease> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %R"
+ event generate .t.f <ButtonRelease> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.69 {HandleEventGenerate: options <Motion> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %R"
+ event generate .t.f <Motion> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.70 {HandleEventGenerate: options <<Paste>> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %R"
+ event generate .t.f <<Paste>> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.71 {HandleEventGenerate: options <Enter> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %R"
+ event generate .t.f <Enter> -root .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.72 {HandleEventGenerate: options <Configure> -root .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %R"
+ event generate .t.f <Configure> -root .t
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-root" option}
+
+test bind-22.73 {HandleEventGenerate: options <Key> -rootx xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %X"
+ event generate .t.f <Key> -rootx xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.74 {HandleEventGenerate: options <Key> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %X"
+ event generate .t.f <Key> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.75 {HandleEventGenerate: options <Button> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %X"
+ event generate .t.f <Button> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.76 {HandleEventGenerate: options <ButtonRelease> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %X"
+ event generate .t.f <ButtonRelease> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.77 {HandleEventGenerate: options <Motion> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %X"
+ event generate .t.f <Motion> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.78 {HandleEventGenerate: options <<Paste>> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %X"
+ event generate .t.f <<Paste>> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.79 {HandleEventGenerate: options <Enter> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %X"
+ event generate .t.f <Enter> -rootx 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.80 {HandleEventGenerate: options <Configure> -rootx 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %X"
+ event generate .t.f <Configure> -rootx 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-rootx" option}
+
+test bind-22.81 {HandleEventGenerate: options <Key> -rooty xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %Y"
+ event generate .t.f <Key> -rooty xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.82 {HandleEventGenerate: options <Key> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %Y"
+ event generate .t.f <Key> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.83 {HandleEventGenerate: options <Button> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %Y"
+ event generate .t.f <Button> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.84 {HandleEventGenerate: options <ButtonRelease> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %Y"
+ event generate .t.f <ButtonRelease> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.85 {HandleEventGenerate: options <Motion> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %Y"
+ event generate .t.f <Motion> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.86 {HandleEventGenerate: options <<Paste>> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %Y"
+ event generate .t.f <<Paste>> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.87 {HandleEventGenerate: options <Enter> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %Y"
+ event generate .t.f <Enter> -rooty 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.88 {HandleEventGenerate: options <Configure> -rooty 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %Y"
+ event generate .t.f <Configure> -rooty 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-rooty" option}
+
+test bind-22.89 {HandleEventGenerate: options <Key> -sendevent xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %E"
+ event generate .t.f <Key> -sendevent xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected boolean value but got "xyz"}
+
+test bind-22.90 {HandleEventGenerate: options <Key> -sendevent 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %E"
+ event generate .t.f <Key> -sendevent 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.91 {HandleEventGenerate: options <Key> -sendevent yes} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %E"
+ event generate .t.f <Key> -sendevent yes
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.92 {HandleEventGenerate: options <Key> -sendevent 43} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %E"
+ event generate .t.f <Key> -sendevent 43
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {43}
+
+test bind-22.93 {HandleEventGenerate: options <Key> -serial xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %#"
+ event generate .t.f <Key> -serial xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.94 {HandleEventGenerate: options <Key> -serial 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %#"
+ event generate .t.f <Key> -serial 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.95 {HandleEventGenerate: options <Key> -state xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %s"
+ event generate .t.f <Key> -state xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.96 {HandleEventGenerate: options <Key> -state 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %s"
+ event generate .t.f <Key> -state 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.97 {HandleEventGenerate: options <Button> -state 1025} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %s"
+ event generate .t.f <Button> -state 1025
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1025}
+
+test bind-22.98 {HandleEventGenerate: options <ButtonRelease> -state 1025} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %s"
+ event generate .t.f <ButtonRelease> -state 1025
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1025}
+
+test bind-22.99 {HandleEventGenerate: options <Motion> -state 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %s"
+ event generate .t.f <Motion> -state 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.100 {HandleEventGenerate: options <<Paste>> -state 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %s"
+ event generate .t.f <<Paste>> -state 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.101 {HandleEventGenerate: options <Enter> -state 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %s"
+ event generate .t.f <Enter> -state 1
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.102 {HandleEventGenerate: options <Visibility> -state xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Visibility> "lappend x %s"
+ event generate .t.f <Visibility> -state xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad -state value "xyz": must be VisibilityUnobscured, VisibilityPartiallyObscured, or VisibilityFullyObscured}
+
+test bind-22.103 {HandleEventGenerate: options <Visibility> -state VisibilityUnobscured} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Visibility> "lappend x %s"
+ event generate .t.f <Visibility> -state VisibilityUnobscured
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {VisibilityUnobscured}
+
+test bind-22.104 {HandleEventGenerate: options <Configure> -state xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %s"
+ event generate .t.f <Configure> -state xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-state" option}
+
+test bind-22.105 {HandleEventGenerate: options <Key> -subwindow .xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %S"
+ event generate .t.f <Key> -subwindow .xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window path name ".xyz"}
+
+test bind-22.106 {HandleEventGenerate: options <Key> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %S"
+ event generate .t.f <Key> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.107 {HandleEventGenerate: options <Key> -subwindow xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %S"
+ event generate .t.f <Key> -subwindow xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window name/identifier "xyz"}
+
+test bind-22.108 {HandleEventGenerate: options <Key> -subwindow [winfo id .t]} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %S"
+ event generate .t.f <Key> -subwindow [winfo id .t]
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.109 {HandleEventGenerate: options <Button> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %S"
+ event generate .t.f <Button> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.110 {HandleEventGenerate: options <ButtonRelease> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %S"
+ event generate .t.f <ButtonRelease> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.111 {HandleEventGenerate: options <Motion> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %S"
+ event generate .t.f <Motion> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.112 {HandleEventGenerate: options <<Paste>> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %S"
+ event generate .t.f <<Paste>> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.113 {HandleEventGenerate: options <Enter> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %S"
+ event generate .t.f <Enter> -subwindow .t
+ expr {[winfo id .t] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.114 {HandleEventGenerate: options <Configure> -subwindow .t} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %S"
+ event generate .t.f <Configure> -subwindow .t
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-subwindow" option}
+
+test bind-22.115 {HandleEventGenerate: options <Key> -time xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %t"
+ event generate .t.f <Key> -time xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "xyz"}
+
+test bind-22.116 {HandleEventGenerate: options <Key> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %t"
+ event generate .t.f <Key> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.117 {HandleEventGenerate: options <Button> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %t"
+ event generate .t.f <Button> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.118 {HandleEventGenerate: options <ButtonRelease> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %t"
+ event generate .t.f <ButtonRelease> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.119 {HandleEventGenerate: options <Motion> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %t"
+ event generate .t.f <Motion> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.120 {HandleEventGenerate: options <<Paste>> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %t"
+ event generate .t.f <<Paste>> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.121 {HandleEventGenerate: options <Enter> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %t"
+ event generate .t.f <Enter> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.122 {HandleEventGenerate: options <Property> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Property> "lappend x %t"
+ event generate .t.f <Property> -time 100
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {100}
+
+test bind-22.123 {HandleEventGenerate: options <Configure> -time 100} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %t"
+ event generate .t.f <Configure> -time 100
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Configure> event doesn't accept "-time" option}
+
+test bind-22.124 {HandleEventGenerate: options <Expose> -width xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %w"
+ event generate .t.f <Expose> -width xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.125 {HandleEventGenerate: options <Expose> -width 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %w"
+ event generate .t.f <Expose> -width 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.126 {HandleEventGenerate: options <Configure> -width 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %w"
+ event generate .t.f <Configure> -width 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.127 {HandleEventGenerate: options <Key> -width 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -width 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-width" option}
+
+test bind-22.128 {HandleEventGenerate: options <Unmap> -window .xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Unmap> "lappend x %W"
+ event generate .t.f <Unmap> -window .xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window path name ".xyz"}
+
+test bind-22.129 {HandleEventGenerate: options <Unmap> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Unmap> "lappend x %W"
+ event generate .t.f <Unmap> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.130 {HandleEventGenerate: options <Unmap> -window xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Unmap> "lappend x %W"
+ event generate .t.f <Unmap> -window xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad window name/identifier "xyz"}
+
+test bind-22.131 {HandleEventGenerate: options <Unmap> -window [winfo id .t.f]} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Unmap> "lappend x %W"
+ event generate .t.f <Unmap> -window [winfo id .t.f]
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.132 {HandleEventGenerate: options <Unmap> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Unmap> "lappend x %W"
+ event generate .t.f <Unmap> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.133 {HandleEventGenerate: options <Map> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Map> "lappend x %W"
+ event generate .t.f <Map> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.134 {HandleEventGenerate: options <Reparent> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Reparent> "lappend x %W"
+ event generate .t.f <Reparent> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.135 {HandleEventGenerate: options <Configure> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %W"
+ event generate .t.f <Configure> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.136 {HandleEventGenerate: options <Gravity> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Gravity> "lappend x %W"
+ event generate .t.f <Gravity> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.137 {HandleEventGenerate: options <Circulate> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Circulate> "lappend x %W"
+ event generate .t.f <Circulate> -window .t.f
+ return $x
+} -cleanup {
+ destroy .t.f
+} -result {.t.f}
+
+test bind-22.138 {HandleEventGenerate: options <Key> -window .t.f} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %W"
+ event generate .t.f <Key> -window .t.f
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Key> event doesn't accept "-window" option}
+
+test bind-22.139 {HandleEventGenerate: options <Key> -x xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %x"
+ event generate .t.f <Key> -x xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.140 {HandleEventGenerate: options <Key> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %x"
+ event generate .t.f <Key> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.141 {HandleEventGenerate: options <Button> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %x"
+ event generate .t.f <Button> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.142 {HandleEventGenerate: options <ButtonRelease> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %x"
+ event generate .t.f <ButtonRelease> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.143 {HandleEventGenerate: options <Motion> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %x"
+ event generate .t.f <Motion> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.144 {HandleEventGenerate: options <<Paste>> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %x"
+ event generate .t.f <<Paste>> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.145 {HandleEventGenerate: options <Enter> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %x"
+ event generate .t.f <Enter> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.146 {HandleEventGenerate: options <Expose> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %x"
+ event generate .t.f <Expose> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.147 {HandleEventGenerate: options <Configure> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %x"
+ event generate .t.f <Configure> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.148 {HandleEventGenerate: options <Gravity> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Gravity> "lappend x %x"
+ event generate .t.f <Gravity> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.149 {HandleEventGenerate: options <Reparent> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Reparent> "lappend x %x"
+ event generate .t.f <Reparent> -x 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.150 {HandleEventGenerate: options <Map> -x 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Map> "lappend x %x"
+ event generate .t.f <Map> -x 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Map> event doesn't accept "-x" option}
+
+test bind-22.151 {HandleEventGenerate: options <Key> -y xyz} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %y"
+ event generate .t.f <Key> -y xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad screen distance "xyz"}
+
+test bind-22.152 {HandleEventGenerate: options <Key> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %y"
+ event generate .t.f <Key> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.153 {HandleEventGenerate: options <Button> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button> "lappend x %y"
+ event generate .t.f <Button> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.154 {HandleEventGenerate: options <ButtonRelease> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <ButtonRelease> "lappend x %y"
+ event generate .t.f <ButtonRelease> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.155 {HandleEventGenerate: options <Motion> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Motion> "lappend x %y"
+ event generate .t.f <Motion> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.156 {HandleEventGenerate: options <<Paste>> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> "lappend x %y"
+ event generate .t.f <<Paste>> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.157 {HandleEventGenerate: options <Enter> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Enter> "lappend x %y"
+ event generate .t.f <Enter> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.158 {HandleEventGenerate: options <Expose> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Expose> "lappend x %y"
+ event generate .t.f <Expose> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.159 {HandleEventGenerate: options <Configure> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Configure> "lappend x %y"
+ event generate .t.f <Configure> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.160 {HandleEventGenerate: options <Gravity> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Gravity> "lappend x %y"
+ event generate .t.f <Gravity> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.161 {HandleEventGenerate: options <Reparent> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Reparent> "lappend x %y"
+ event generate .t.f <Reparent> -y 2i
+ expr {[winfo pixels .t.f 2i] eq $x}
+} -cleanup {
+ destroy .t.f
+} -result {1}
+
+test bind-22.162 {HandleEventGenerate: options <Map> -y 2i} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Map> "lappend x %y"
+ event generate .t.f <Map> -y 2i
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<Map> event doesn't accept "-y" option}
+
+test bind-22.163 {HandleEventGenerate: options <Key> -xyz 1} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Key> "lappend x %k"
+ event generate .t.f <Key> -xyz 1
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad option "-xyz": must be -when, -above, -borderwidth, -button, -count, -data, -delta, -detail, -focus, -height, -keycode, -keysym, -mode, -override, -place, -root, -rootx, -rooty, -sendevent, -serial, -state, -subwindow, -time, -warp, -width, -window, -x, or -y}
# Note that the -data option is tested in bind-32.* because it has
# more demanding requirements in memory handling
-test bind-23.1 {GetVirtualEventUid procedure} {
- list [catch {event info <<asd} msg] $msg
-} {1 {virtual event "<<asd" is badly formed}}
-test bind-23.2 {GetVirtualEventUid procedure} {
- list [catch {event info <<>>} msg] $msg
-} {1 {virtual event "<<>>" is badly formed}}
-test bind-23.3 {GetVirtualEventUid procedure} {
- list [catch {event info <<asd>} msg] $msg
-} {1 {virtual event "<<asd>" is badly formed}}
-test bind-23.4 {GetVirtualEventUid procedure} {
+
+test bind-23.1 {GetVirtualEventUid procedure} -body {
+ event info <<asd
+} -returnCodes error -result {virtual event "<<asd" is badly formed}
+test bind-23.2 {GetVirtualEventUid procedure} -body {
+ event info <<>>
+} -returnCodes error -result {virtual event "<<>>" is badly formed}
+test bind-23.3 {GetVirtualEventUid procedure} -body {
+ event info <<asd>
+} -returnCodes error -result {virtual event "<<asd>" is badly formed}
+test bind-23.4 {GetVirtualEventUid procedure} -setup {
+ event delete <<asd>>
+} -body {
event info <<asd>>
-} {}
-
-
-test bind-24.1 {FindSequence procedure: no event} {
- list [catch {bind .b {} test} msg] $msg
-} {1 {no events specified in binding}}
-test bind-24.2 {FindSequence procedure: bad event} {
- list [catch {bind .b <xyz> test} msg] $msg
-} {1 {bad event type or keysym "xyz"}}
-test bind-24.3 {FindSequence procedure: virtual allowed} {
- bind .b.f <<Paste>> test
-} {}
-test bind-24.4 {FindSequence procedure: virtual not allowed} {
- list [catch {event add <<Paste>> <<Alive>>} msg] $msg
-} {1 {virtual event not allowed in definition of another virtual event}}
-test bind-24.5 {FindSequence procedure, multiple bindings} {
- setup
- bind .b.f <1> {lappend x single}
- bind .b.f <Double-1> {lappend x double}
- bind .b.f <Triple-1> {lappend x triple}
- bind .b.f <Quadruple-1> {lappend x quadruple}
+} -result {}
+
+
+test bind-24.1 {FindSequence procedure: no event} -body {
+ bind .t {} test
+} -returnCodes error -result {no events specified in binding}
+test bind-24.2 {FindSequence procedure: bad event} -body {
+ bind .t <xyz> test
+} -returnCodes error -result {bad event type or keysym "xyz"}
+test bind-24.3 {FindSequence procedure: virtual allowed} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <<Paste>> test
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-24.4 {FindSequence procedure: virtual not allowed} -body {
+ event add <<Paste>> <<Alive>>
+} -returnCodes error -result {virtual event not allowed in definition of another virtual event}
+test bind-24.5 {FindSequence procedure, multiple bindings} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <1> {lappend x single}
+ bind .t.f <Double-1> {lappend x double}
+ bind .t.f <Triple-1> {lappend x triple}
+ bind .t.f <Quadruple-1> {lappend x quadruple}
set x press
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
lappend x press
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
lappend x press
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
lappend x press
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
lappend x press
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} {press single press double press triple press quadruple press quadruple}
-test bind-24.6 {FindSequence procedure: virtual composed} {
- list [catch {bind .b <Control-b><<Paste>> "puts hi"} msg] $msg
-} {1 {virtual events may not be composed}}
-test bind-24.7 {FindSequence procedure: new pattern sequence} {
- setup
- bind .b.f <Button-1><Button-2> {lappend x 1-2}
- set x {}
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- set x
-} {1-2}
-test bind-24.8 {FindSequence procedure: similar pattern sequence} {
- setup
- bind .b.f <Button-1><Button-2> {lappend x 1-2}
- bind .b.f <Button-2> {lappend x 2}
- set x {}
- event gen .b.f <Button-3>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- set x
-} {2 1-2}
-test bind-24.9 {FindSequence procedure: similar pattern sequence} {
- setup
- bind .b.f <Button-1><Button-2> {lappend x 1-2}
- bind .b.f <Button-2><Button-2> {lappend x 2-2}
- set x {}
- event gen .b.f <Button-3>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- set x
-} {2-2 1-2}
-test bind-24.10 {FindSequence procedure: similar pattern sequence} {
- setup
- bind .b.f <Button-2><Button-2> {lappend x 2-2}
- bind .b.f <Double-Button-2> {lappend x d-2}
- set x {}
- event gen .b.f <Button-3>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- event gen .b.f <Button-2> -x 100
- event gen .b.f <ButtonRelease-2>
- event gen .b.f <Button-2> -x 200
- event gen .b.f <ButtonRelease-2>
- set x
-} {d-2 2-2}
-test bind-24.11 {FindSequence procedure: new sequence, don't create} {
- setup
- bind .b.f <Button-2>
-} {}
-test bind-24.12 {FindSequence procedure: not new sequence, don't create} {
- setup
- bind .b.f <Control-Button-2> "foo"
- bind .b.f <Button-2>
-} {}
-test bind-24.13 {FindSequence procedure: no binding} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- list [catch {bind .b.f <a>} msg] $msg
-} {0 {}}
-test bind-24.14 {FindSequence procedure: no binding} {
- catch {destroy .b.f}
- canvas .b.f
- set i [.b.f create rect 10 10 100 100]
- list [catch {.b.f bind $i <a>} msg] $msg
-} {0 {}}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {press single press double press triple press quadruple press quadruple}
+test bind-24.6 {FindSequence procedure: virtual composed} -body {
+ bind .t <Control-b><<Paste>> "puts hi"
+} -returnCodes error -result {virtual events may not be composed}
+test bind-24.7 {FindSequence procedure: new pattern sequence} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-1><Button-2> {lappend x 1-2}
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {1-2}
+test bind-24.8 {FindSequence procedure: similar pattern sequence} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-1><Button-2> {lappend x 1-2}
+ bind .t.f <Button-2> {lappend x 2}
+ event generate .t.f <Button-3>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {2 1-2}
+test bind-24.9 {FindSequence procedure: similar pattern sequence} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-1><Button-2> {lappend x 1-2}
+ bind .t.f <Button-2><Button-2> {lappend x 2-2}
+ event generate .t.f <Button-3>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {2-2 1-2}
+test bind-24.10 {FindSequence procedure: similar pattern sequence} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+ set x {}
+} -body {
+ bind .t.f <Button-2><Button-2> {lappend x 2-2}
+ bind .t.f <Double-Button-2> {lappend x d-2}
+ event generate .t.f <Button-3>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ event generate .t.f <Button-2> -x 100
+ event generate .t.f <ButtonRelease-2>
+ event generate .t.f <Button-2> -x 200
+ event generate .t.f <ButtonRelease-2>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {d-2 2-2}
+test bind-24.11 {FindSequence procedure: new sequence, don't create} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-2>
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-24.12 {FindSequence procedure: not new sequence, don't create} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Control-Button-2> "foo"
+ bind .t.f <Button-2>
+} -cleanup {
+ destroy .t.f
+} -result {}
+test bind-24.13 {FindSequence procedure: no binding} -body {
+ frame .t.f -class Test -width 150 -height 100
+ bind .t.f <a>
+} -cleanup {
+ destroy .t.f
+} -returnCodes ok
+test bind-24.14 {FindSequence procedure: no binding} -body {
+ canvas .t.c
+ set i [.t.c create rect 10 10 100 100]
+ .t.c bind $i <a>
+} -cleanup {
+ destroy .t.c
+} -returnCodes ok
test bind-25.1 {ParseEventDescription procedure} -setup {
- setup
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
} -body {
- bind .b.f a test
- bind .b.f a
+ bind .t.f a test
+ bind .t.f a
+} -cleanup {
+ destroy .t.f
} -result test
test bind-25.2 {ParseEventDescription procedure: misinterpreted modifier} -setup {
- button .x
+ button .b
} -body {
- bind .x <Control-M> a
- bind .x <M-M> b
- lsort [bind .x]
+ bind .b <Control-M> a
+ bind .b <M-M> b
+ lsort [bind .b]
} -cleanup {
- destroy .x
+ destroy .b
} -result {<Control-Key-M> <Meta-Key-M>}
test bind-25.3 {ParseEventDescription procedure} -setup {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
+ frame .t.f -class Test -width 150 -height 100
} -body {
- bind .b.f <a---> {nothing}
- bind .b.f
+ bind .t.f <a---> {nothing}
+ bind .t.f
+} -cleanup {
+ destroy .t.f
} -result a
-test bind-25.4 {ParseEventDescription} -setup {
- setup
-} -body {
- bind .b <<Shift-Paste>> {puts hi}
- bind .b
+test bind-25.4 {ParseEventDescription} -body {
+ bind .t <<Shift-Paste>> {puts hi}
+ bind .t
} -result {<<Shift-Paste>>}
+
# Assorted error cases in event sequence parsing
-foreach {testname testinfo} {
- bind-25.5 {\x7 {bad ASCII character 0x7}}
- bind-25.6 {\x7f {bad ASCII character 0x7f}}
- bind-25.7 {\x4 {bad ASCII character 0x4}}
- bind-25.8 {<<>> {virtual event "<<>>" is badly formed}}
- bind-25.9 {<<Paste {missing ">" in virtual binding}}
- bind-25.10 {<<Paste> {missing ">" in virtual binding}}
- bind-25.11 {<<Paste>>h {virtual events may not be composed}}
- bind-25.12 {<> "no event type or button # or keysym"}
- bind-25.13 {<a-- {missing ">" in binding}}
- bind-25.14 {<a-b> {extra characters after detail in binding}}
- bind-25.15 {<<abc {missing ">" in virtual binding}}
- bind-25.16 {<<abc> {missing ">" in virtual binding}}
-} {
- lassign $testinfo sequence errorMessage
- test $testname {ParseEventDescription procedure error cases} \
- -setup { setup } \
- -body [list bind .b $sequence {puts hi}] \
- -returnCodes error -result $errorMessage
-}
-test bind-25.17 {ParseEventDescription} -setup {
- setup
-} -returnCodes error -body {
+test bind-25.5 {ParseEventDescription procedure error cases} -body {
+ bind .t \x7 {puts hi}
+} -returnCodes error -result {bad ASCII character 0x7}
+test bind-25.6 {ParseEventDescription procedure error cases} -body {
+ bind .t \x7f {puts hi}
+} -returnCodes error -result {bad ASCII character 0x7f}
+test bind-25.7 {ParseEventDescription procedure error cases} -body {
+ bind .t \x4 {puts hi}
+} -returnCodes error -result {bad ASCII character 0x4}
+test bind-25.8 {ParseEventDescription procedure error cases} -body {
+ bind .t <<>> {puts hi}
+} -returnCodes error -result {virtual event "<<>>" is badly formed}
+test bind-25.9 {ParseEventDescription procedure error cases} -body {
+ bind .t <<Paste {puts hi}
+} -returnCodes error -result {missing ">" in virtual binding}
+test bind-25.10 {ParseEventDescription procedure error cases} -body {
+ bind .t <<Paste> {puts hi}
+} -returnCodes error -result {missing ">" in virtual binding}
+test bind-25.11 {ParseEventDescription procedure error cases} -body {
+ bind .t <<Paste>>h {puts hi}
+} -returnCodes error -result {virtual events may not be composed}
+test bind-25.12 {ParseEventDescription procedure error cases} -body {
+ bind .t <> {puts hi}
+} -returnCodes error -result {no event type or button # or keysym}
+test bind-25.13 {ParseEventDescription procedure error cases} -body {
+ bind .t <a-- {puts hi}
+} -returnCodes error -result {missing ">" in binding}
+test bind-25.14 {ParseEventDescription procedure error cases} -body {
+ bind .t <a-b> {puts hi}
+} -returnCodes error -result {extra characters after detail in binding}
+test bind-25.15 {ParseEventDescription procedure error cases} -body {
+ bind .t <<abc {puts hi}
+} -returnCodes error -result {missing ">" in virtual binding}
+test bind-25.16 {ParseEventDescription procedure error cases} -body {
+ bind .t <<abc> {puts hi}
+} -returnCodes error -result {missing ">" in virtual binding}
+test bind-25.17 {ParseEventDescription} -body {
event add <<xyz>> <<abc>>
-} -result {virtual event not allowed in definition of another virtual event}
+} -returnCodes error -result {virtual event not allowed in definition of another virtual event}
+
# Modifier canonicalization tests
-foreach {name check} {
- bind-25.18 {{<Control- a>} <Control-Key-a>}
- bind-25.19 {<Shift-a> <Shift-Key-a>}
- bind-25.20 {<Lock-a> <Lock-Key-a>}
- bind-25.21 {<Meta---a> <Meta-Key-a>}
- bind-25.22 {<M-a> <Meta-Key-a>}
- bind-25.23 {<Alt-a> <Alt-Key-a>}
- bind-25.24 {<B1-a> <B1-Key-a>}
- bind-25.25 {<B2-a> <B2-Key-a>}
- bind-25.26 {<B3-a> <B3-Key-a>}
- bind-25.27 {<B4-a> <B4-Key-a>}
- bind-25.28 {<B5-a> <B5-Key-a>}
- bind-25.29 {<Button1-a> <B1-Key-a>}
- bind-25.30 {<Button2-a> <B2-Key-a>}
- bind-25.31 {<Button3-a> <B3-Key-a>}
- bind-25.32 {<Button4-a> <B4-Key-a>}
- bind-25.33 {<Button5-a> <B5-Key-a>}
- bind-25.34 {<M1-a> <Mod1-Key-a>}
- bind-25.35 {<M2-a> <Mod2-Key-a>}
- bind-25.36 {<M3-a> <Mod3-Key-a>}
- bind-25.37 {<M4-a> <Mod4-Key-a>}
- bind-25.38 {<M5-a> <Mod5-Key-a>}
- bind-25.39 {<Mod1-a> <Mod1-Key-a>}
- bind-25.40 {<Mod2-a> <Mod2-Key-a>}
- bind-25.41 {<Mod3-a> <Mod3-Key-a>}
- bind-25.42 {<Mod4-a> <Mod4-Key-a>}
- bind-25.43 {<Mod5-a> <Mod5-Key-a>}
- bind-25.44 {<Double-a> <Double-Key-a>}
- bind-25.45 {<Triple-a> <Triple-Key-a>}
- bind-25.46 {{<Double 1>} <Double-Button-1>}
- bind-25.47 {<Triple-1> <Triple-Button-1>}
- bind-25.48 {{<M1-M2 M3-M4 B1-Control-a>}
- <Control-B1-Mod1-Mod2-Mod3-Mod4-Key-a>}
- bind-25.49 {<Extended-Return> <Extended-Key-Return>}
-} {
- lassign $check shortBind longBind
- test $name {modifier names} -setup {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- } -body {
- bind .b.f $shortBind foo
- bind .b.f
- } -result $longBind -cleanup {
- bind .b.f [lindex $check 1] {}
- }
-}
-foreach event [bind Test] {
- bind Test $event {}
-}
-foreach event [bind all] {
- bind all $event {}
-}
-test bind-26.1 {event names} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- bind .b.f <FocusIn> {nothing}
- bind .b.f
-} <FocusIn>
-test bind-26.2 {event names} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- bind .b.f <FocusOut> {nothing}
- bind .b.f
-} <FocusOut>
-test bind-26.3 {event names} {
- setup
- bind .b.f <Destroy> {lappend x "destroyed"}
- set x [bind .b.f]
- destroy .b.f
- set x
-} {<Destroy> destroyed}
-foreach check {
- {bind-26.4 Motion Motion}
- {bind-26.5 Button Button}
- {bind-26.6 ButtonPress Button}
- {bind-26.7 ButtonRelease ButtonRelease}
- {bind-26.8 Colormap Colormap}
- {bind-26.9 Enter Enter}
- {bind-26.10 Leave Leave}
- {bind-26.11 Expose Expose}
- {bind-26.12 Key Key}
- {bind-26.13 KeyPress Key}
- {bind-26.14 KeyRelease KeyRelease}
- {bind-26.15 Property Property}
- {bind-26.16 Visibility Visibility}
- {bind-26.17 Activate Activate}
- {bind-26.18 Deactivate Deactivate}
-} {
- lassign $check name event canonicalEvent
- test $name "event names: $event" {
- setup
- bind .b.f <$event> "set x {event $event}"
+test bind-25.18 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f {<Control- a>} foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Control-Key-a>
+
+test bind-25.19 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Shift-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Shift-Key-a>
+
+test bind-25.20 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Lock-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Lock-Key-a>
+
+test bind-25.21 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Meta---a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Meta-Key-a>
+
+test bind-25.22 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Meta-Key-a>
+
+test bind-25.23 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Alt-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Alt-Key-a>
+
+test bind-25.24 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <B1-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B1-Key-a>
+
+test bind-25.25 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <B2-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B2-Key-a>
+
+test bind-25.26 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <B3-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B3-Key-a>
+
+test bind-25.27 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <B4-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B4-Key-a>
+
+test bind-25.28 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <B5-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B5-Key-a>
+
+test bind-25.29 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Button1-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B1-Key-a>
+
+test bind-25.30 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Button2-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B2-Key-a>
+
+test bind-25.31 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Button3-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B3-Key-a>
+
+test bind-25.32 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Button4-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B4-Key-a>
+
+test bind-25.33 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Button5-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <B5-Key-a>
+
+test bind-25.34 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M1-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod1-Key-a>
+
+test bind-25.35 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M2-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod2-Key-a>
+
+test bind-25.36 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M3-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod3-Key-a>
+
+test bind-25.37 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M4-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod4-Key-a>
+
+test bind-25.38 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <M5-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod5-Key-a>
+
+test bind-25.39 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Mod1-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod1-Key-a>
+
+test bind-25.40 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Mod2-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod2-Key-a>
+
+test bind-25.41 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Mod3-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod3-Key-a>
+
+test bind-25.42 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Mod4-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod4-Key-a>
+
+test bind-25.43 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Mod5-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Mod5-Key-a>
+
+test bind-25.44 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Double-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Double-Key-a>
+
+test bind-25.45 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Triple-a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Triple-Key-a>
+
+test bind-25.46 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f {<Double 1>} foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Double-Button-1>
+
+test bind-25.47 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Triple-1> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Triple-Button-1>
+
+test bind-25.48 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f {<M1-M2 M3-M4 B1-Control-a>} foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Control-B1-Mod1-Mod2-Mod3-Mod4-Key-a>
+
+test bind-25.49 {modifier names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <Extended-Return> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <Extended-Key-Return>
+
+
+
+test bind-26.1 {event names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <FocusIn> {nothing}
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <FocusIn>
+test bind-26.2 {event names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+} -body {
+ bind .t.f <FocusOut> {nothing}
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result <FocusOut>
+test bind-26.3 {event names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Destroy> {lappend x "destroyed"}
+ set x [bind .t.f]
+ destroy .t.f
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Destroy> destroyed}
+
+test bind-26.4 {event names: Motion} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Motion> "set x {event Motion}"
set x xyzzy
- event gen .b.f <$event>
- list $x [bind .b.f]
- } [list "event $event" <$canonicalEvent>]
-}
+ event generate .t.f <Motion>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Motion} <Motion>}
+
+test bind-26.5 {event names: Button} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> "set x {event Button}"
+ set x xyzzy
+ event generate .t.f <Button>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Button} <Button>}
+
+test bind-26.6 {event names: ButtonPress} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <ButtonPress> "set x {event ButtonPress}"
+ set x xyzzy
+ event generate .t.f <ButtonPress>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event ButtonPress} <Button>}
+
+test bind-26.7 {event names: ButtonRelease} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <ButtonRelease> "set x {event ButtonRelease}"
+ set x xyzzy
+ event generate .t.f <ButtonRelease>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event ButtonRelease} <ButtonRelease>}
+
+test bind-26.8 {event names: Colormap} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Colormap> "set x {event Colormap}"
+ set x xyzzy
+ event generate .t.f <Colormap>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Colormap} <Colormap>}
+
+test bind-26.9 {event names: Enter} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Enter> "set x {event Enter}"
+ set x xyzzy
+ event generate .t.f <Enter>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Enter} <Enter>}
+
+test bind-26.10 {event names: Leave} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Leave> "set x {event Leave}"
+ set x xyzzy
+ event generate .t.f <Leave>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Leave} <Leave>}
+
+test bind-26.11 {event names: Expose} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Expose> "set x {event Expose}"
+ set x xyzzy
+ event generate .t.f <Expose>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Expose} <Expose>}
+
+test bind-26.12 {event names: Key} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key> "set x {event Key}"
+ set x xyzzy
+ event generate .t.f <Key>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Key} <Key>}
+
+test bind-26.13 {event names: KeyPress} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <KeyPress> "set x {event KeyPress}"
+ set x xyzzy
+ event generate .t.f <KeyPress>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event KeyPress} <Key>}
+
+test bind-26.14 {event names: KeyRelease} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <KeyRelease> "set x {event KeyRelease}"
+ set x xyzzy
+ event generate .t.f <KeyRelease>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event KeyRelease} <KeyRelease>}
+
+test bind-26.15 {event names: Property} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Property> "set x {event Property}"
+ set x xyzzy
+ event generate .t.f <Property>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Property} <Property>}
+
+test bind-26.16 {event names: Visibility} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Visibility> "set x {event Visibility}"
+ set x xyzzy
+ event generate .t.f <Visibility>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Visibility} <Visibility>}
+
+test bind-26.17 {event names: Activate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Activate> "set x {event Activate}"
+ set x xyzzy
+ event generate .t.f <Activate>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Activate} <Activate>}
+
+test bind-26.18 {event names: Deactivate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Deactivate> "set x {event Deactivate}"
+ set x xyzzy
+ event generate .t.f <Deactivate>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Deactivate} <Deactivate>}
+
+
# These events require an extra argument to [event generate]
-foreach check {
- {bind-26.19 Circulate Circulate}
- {bind-26.20 Configure Configure}
- {bind-26.21 Gravity Gravity}
- {bind-26.22 Map Map}
- {bind-26.23 Reparent Reparent}
- {bind-26.24 Unmap Unmap}
-} {
- lassign $check name event canonicalEvent
- test $name "event names: $event" {
- setup
- bind .b.f <$event> "set x {event $event}"
+test bind-26.19 {event names: Circulate} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Circulate> "set x {event Circulate}"
set x xyzzy
- event gen .b.f <$event> -window .b.f
- list $x [bind .b.f]
- } [list "event $event" <$canonicalEvent>]
-}
+ event generate .t.f <Circulate>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Circulate} <Circulate>}
-test bind-27.1 {button names} {
- list [catch {bind .b <Expose-1> foo} msg] $msg
-} {1 {specified button "1" for non-button event}}
-test bind-27.2 {button names} {
- list [catch {bind .b <Button-6> foo} msg] $msg
-} {1 {specified keysym "6" for non-key event}}
-test bind-27.3 {button names} {
- setup
- bind .b.f <Button-1> {lappend x "button 1"}
- set x [bind .b.f]
- event gen .b.f <Button-1>
- event gen .b.f <ButtonRelease-1>
- set x
-} {<Button-1> {button 1}}
-test bind-27.4 {button names} {
- setup
- bind .b.f <Button-2> {lappend x "button 2"}
- set x [bind .b.f]
- event gen .b.f <Button-2>
- event gen .b.f <ButtonRelease-2>
- set x
-} {<Button-2> {button 2}}
-test bind-27.5 {button names} {
- setup
- bind .b.f <Button-3> {lappend x "button 3"}
- set x [bind .b.f]
- event gen .b.f <Button-3>
- event gen .b.f <ButtonRelease-3>
- set x
-} {<Button-3> {button 3}}
-test bind-27.6 {button names} {
- setup
- bind .b.f <Button-4> {lappend x "button 4"}
- set x [bind .b.f]
- event gen .b.f <Button-4>
- event gen .b.f <ButtonRelease-4>
- set x
-} {<Button-4> {button 4}}
-test bind-27.7 {button names} {
- setup
- bind .b.f <Button-5> {lappend x "button 5"}
- set x [bind .b.f]
- event gen .b.f <Button-5>
- event gen .b.f <ButtonRelease-5>
- set x
-} {<Button-5> {button 5}}
-
-test bind-28.1 {keysym names} {
- list [catch {bind .b <Expose-a> foo} msg] $msg
-} {1 {specified keysym "a" for non-key event}}
-test bind-28.2 {keysym names} {
- list [catch {bind .b <Gorp> foo} msg] $msg
-} {1 {bad event type or keysym "Gorp"}}
-test bind-28.3 {keysym names} {
- list [catch {bind .b <Key-Stupid> foo} msg] $msg
-} {1 {bad event type or keysym "Stupid"}}
-test bind-28.4 {keysym names} {
- catch {destroy .b.f}
- frame .b.f -class Test -width 150 -height 100
- bind .b.f <a> foo
- bind .b.f
-} a
-foreach check {
- {bind-28.5 a 0 a}
- {bind-28.6 space 0 <Key-space>}
- {bind-28.7 Return 0 <Key-Return>}
- {bind-28.8 X 1 X}
-} {
- lassign $check name keysym state result
- test $name {keysym names} {
- setup
- bind .b.f <Key-$keysym> "lappend x \"keysym $keysym\""
- bind .b.f <Key-x> "lappend x {bad binding match}"
- set x [lsort [bind .b.f]]
- event gen .b.f <Key-$keysym> -state $state
- set x
- } [concat [lsort "x $result"] "{keysym $keysym}"]
-}
+test bind-26.20 {event names: Configure} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Configure> "set x {event Configure}"
+ set x xyzzy
+ event generate .t.f <Configure>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Configure} <Configure>}
-test bind-29.1 {dummy test to help ensure proper numbering} {} {}
-setup
-bind .b.f <KeyPress> {set x %K}
-foreach check {
- {bind-29.2 a 0 a}
- {bind-29.3 x 1 X}
- {bind-29.4 x 2 X}
- {bind-29.5 space 0 space}
- {bind-29.6 F1 1 F1}
-} {
- lassign $check name keysym state result
- test $name {GetKeySym procedure} nonPortable {
- set x nothing
- event gen .b.f <KeyPress> -keysym $keysym -state $state
- set x
- } $result
-}
+test bind-26.21 {event names: Gravity} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Gravity> "set x {event Gravity}"
+ set x xyzzy
+ event generate .t.f <Gravity>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Gravity} <Gravity>}
-proc bgerror msg {
- global x errorInfo
- set x [list $msg $errorInfo]
-}
-test bind-30.1 {Tk_BackgroundError procedure} {
- setup
- bind .b.f <Button> {error "This is a test"}
+test bind-26.22 {event names: Map} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Map> "set x {event Map}"
+ set x xyzzy
+ event generate .t.f <Map>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Map} <Map>}
+
+test bind-26.23 {event names: Reparent} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Reparent> "set x {event Reparent}"
+ set x xyzzy
+ event generate .t.f <Reparent>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Reparent} <Reparent>}
+
+test bind-26.24 {event names: Unmap} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Unmap> "set x {event Unmap}"
+ set x xyzzy
+ event generate .t.f <Unmap>
+ list $x [bind .t.f]
+} -cleanup {
+ destroy .t.f
+} -result {{event Unmap} <Unmap>}
+
+
+test bind-27.1 {button names} -body {
+ bind .t <Expose-1> foo
+} -returnCodes error -result {specified button "1" for non-button event}
+test bind-27.2 {button names} -body {
+ bind .t <Button-6> foo
+} -returnCodes error -result {specified keysym "6" for non-key event}
+test bind-27.3 {button names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-1> {lappend x "button 1"}
+ set x [bind .t.f]
+ event generate .t.f <Button-1>
+ event generate .t.f <ButtonRelease-1>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Button-1> {button 1}}
+test bind-27.4 {button names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-2> {lappend x "button 2"}
+ set x [bind .t.f]
+ event generate .t.f <Button-2>
+ event generate .t.f <ButtonRelease-2>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Button-2> {button 2}}
+test bind-27.5 {button names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-3> {lappend x "button 3"}
+ set x [bind .t.f]
+ event generate .t.f <Button-3>
+ event generate .t.f <ButtonRelease-3>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Button-3> {button 3}}
+test bind-27.6 {button names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-4> {lappend x "button 4"}
+ set x [bind .t.f]
+ event generate .t.f <Button-4>
+ event generate .t.f <ButtonRelease-4>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Button-4> {button 4}}
+test bind-27.7 {button names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button-5> {lappend x "button 5"}
+ set x [bind .t.f]
+ event generate .t.f <Button-5>
+ event generate .t.f <ButtonRelease-5>
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Button-5> {button 5}}
+
+test bind-28.1 {keysym names} -body {
+ bind .t <Expose-a> foo
+} -returnCodes error -result {specified keysym "a" for non-key event}
+test bind-28.2 {keysym names} -body {
+ bind .t <Gorp> foo
+} -returnCodes error -result {bad event type or keysym "Gorp"}
+test bind-28.3 {keysym names} -body {
+ bind .t <Key-Stupid> foo
+} -returnCodes error -result {bad event type or keysym "Stupid"}
+test bind-28.4 {keysym names} -body {
+ frame .t.f -class Test -width 150 -height 100
+ bind .t.f <a> foo
+ bind .t.f
+} -cleanup {
+ destroy .t.f
+} -result {a}
+
+test bind-28.5 {keysym names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key-colon> "lappend x \"keysym received\""
+ bind .t.f <Key-underscore> "lappend x {bad binding match}"
+ set x [lsort [bind .t.f]]
+ event generate .t.f <Key-colon> ;# -state 0
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {: _ {keysym received}}
+test bind-28.6 {keysym names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key-Return> "lappend x \"keysym Return\""
+ bind .t.f <Key-x> "lappend x {bad binding match}"
+ set x [lsort [bind .t.f]]
+ event generate .t.f <Key-Return> -state 0
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {<Key-Return> x {keysym Return}}
+test bind-28.7 {keysym names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key-X> "lappend x \"keysym X\""
+ bind .t.f <Key-x> "lappend x {bad binding match}"
+ set x [lsort [bind .t.f]]
+ event generate .t.f <Key-X> -state 1
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {X x {keysym X}}
+test bind-28.8 {keysym names} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Key-X> "lappend x \"keysym X\""
+ bind .t.f <Key-x> "lappend x {bad binding match}"
+ set x [lsort [bind .t.f]]
+ event generate .t.f <Key-X> -state 1
+ set x
+} -cleanup {
+ destroy .t.f
+} -result {X x {keysym X}}
+
+
+test bind-29.1 {Tk_BackgroundError procedure} -setup {
+ proc bgerror msg {
+ global x errorInfo
+ set x [list $msg $errorInfo]
+ }
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {error "This is a test"}
set x none
- event gen .b.f <Button>
- event gen .b.f <ButtonRelease>
+ event generate .t.f <Button>
+ event generate .t.f <ButtonRelease>
update
set x
-} {{This is a test} {This is a test
+} -cleanup {
+ destroy .t.f
+ rename bgerror {}
+} -result {{This is a test} {This is a test
while executing
"error "This is a test""
(command bound to event)}}
-test bind-30.2 {Tk_BackgroundError procedure} {
+
+test bind-29.2 {Tk_BackgroundError procedure} -setup {
proc do {} {
- event gen .b.f <Button>
- event gen .b.f <ButtonRelease>
+ event generate .t.f <Button>
+ event generate .t.f <ButtonRelease>
}
- setup
- bind .b.f <Button> {error Message2}
+ proc bgerror msg {
+ global x errorInfo
+ set x [list $msg $errorInfo]
+ }
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+ bind .t.f <Button> {error Message2}
set x none
do
update
set x
-} {Message2 {Message2
+} -cleanup {
+ destroy .t.f
+ rename bgerror {}
+ rename do {}
+} -result {Message2 {Message2
while executing
"error Message2"
(command bound to event)}}
-rename bgerror {}
-test bind-31.1 {MouseWheel events} {
- setup
+
+test bind-30.1 {MouseWheel events} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <MouseWheel> {set x Wheel}
- event gen .b.f <MouseWheel>
+} -body {
+ bind .t.f <MouseWheel> {set x Wheel}
+ event generate .t.f <MouseWheel>
set x
-} {Wheel}
-test bind-31.2 {MouseWheel events} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {Wheel}
+test bind-30.2 {MouseWheel events} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <MouseWheel> {set x %D}
- event gen .b.f <MouseWheel> -delta 120
+} -body {
+ bind .t.f <MouseWheel> {set x %D}
+ event generate .t.f <MouseWheel> -delta 120
set x
-} {120}
-test bind-31.3 {MouseWheel events} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {120}
+test bind-30.3 {MouseWheel events} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <MouseWheel> {set x "%D %x %y"}
- event gen .b.f <MouseWheel> -delta 240 -x 10 -y 30
+} -body {
+ bind .t.f <MouseWheel> {set x "%D %x %y"}
+ event generate .t.f <MouseWheel> -delta 240 -x 10 -y 30
set x
-} {240 10 30}
+} -cleanup {
+ destroy .t.f
+} -result {240 10 30}
+
-test bind-32.1 {virtual event user_data field - bad generation} {
- setup
- # Check no confusion, since Focus events use %d for something else
- list [catch {event gen .b.f <FocusIn> -data foo} msg] $msg
-} {1 {<FocusIn> event doesn't accept "-data" option}}
-test bind-32.2 {virtual event user_data field - NULL, synch} {
- setup
+test bind-31.1 {virtual event user_data field - bad generation} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
+} -body {
+# Check no confusion, since Focus events use %d for something else
+ event generate .t.f <FocusIn> -data foo
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {<FocusIn> event doesn't accept "-data" option}
+test bind-31.2 {virtual event user_data field - NULL, synch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>>
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>>
set x
-} {TestUserData >{}<}
-test bind-32.3 {virtual event user_data field - shared, synch} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {TestUserData >{}<}
+test bind-31.3 {virtual event user_data field - shared, synch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>> -data "foo bar"
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>> -data "foo bar"
set x
-} {TestUserData >foo bar<}
-test bind-32.4 {virtual event user_data field - unshared, synch} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {TestUserData >foo bar<}
+test bind-31.4 {virtual event user_data field - unshared, synch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>> -data [string index abc 1]
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>> -data [string index abc 1]
set x
-} {TestUserData >b<}
+} -cleanup {
+ destroy .t.f
+} -result {TestUserData >b<}
# Note that asynch event handling can only really catch any potential
# extra errors when used in combination with a tool like Purify or
# Valgrind. Such testing is rarely done, but at least any problem with
# reference handling will eventually show up with these tests...
-test bind-32.5 {virtual event user_data field - NULL, asynch} {
- setup
+test bind-31.5 {virtual event user_data field - NULL, asynch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>> -when head
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>> -when head
list $x [update] $x
-} {{} {} {TestUserData >{}<}}
-test bind-32.6 {virtual event user_data field - shared, asynch} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {{} {} {TestUserData >{}<}}
+test bind-31.6 {virtual event user_data field - shared, asynch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>> -data "foo bar" -when head
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>> -data "foo bar" -when head
list $x [update] $x
-} {{} {} {TestUserData >foo bar<}}
-test bind-32.7 {virtual event user_data field - unshared, asynch} {
- setup
+} -cleanup {
+ destroy .t.f
+} -result {{} {} {TestUserData >foo bar<}}
+test bind-31.7 {virtual event user_data field - unshared, asynch} -setup {
+ frame .t.f -class Test -width 150 -height 100
+ pack .t.f
+ focus -force .t.f
+ update
set x {}
- bind .b.f <<TestUserData>> {set x "TestUserData >%d<"}
- event gen .b.f <<TestUserData>> -data [string index abc 1] -when head
+} -body {
+ bind .t.f <<TestUserData>> {set x "TestUserData >%d<"}
+ event generate .t.f <<TestUserData>> -data [string index abc 1] -when head
list $x [update] $x
-} {{} {} {TestUserData >b<}}
+} -cleanup {
+ destroy .t.f
+} -result {{} {} {TestUserData >b<}}
-destroy .b
# cleanup
cleanupTests
diff --git a/tests/bitmap.test b/tests/bitmap.test
index 6e2255c..80bc114 100644
--- a/tests/bitmap.test
+++ b/tests/bitmap.test
@@ -6,55 +6,71 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} testbitmap {
+test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} -constraints {
+ testbitmap
+} -body {
set x gray25
- lindex $x 0
- destroy .b1
- button .b1 -bitmap $x
+ lindex $x 0
+ button .b -bitmap $x
lindex $x 0
testbitmap gray25
-} {{1 0}}
-test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} testbitmap {
+} -cleanup {
+ destroy .b
+} -result {{1 0}}
+test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} -constraints {
+ testbitmap
+} -setup {
+ set result {}
+} -body {
set x gray25
- destroy .b1 .b2
button .b1 -bitmap $x
destroy .b1
- set result {}
lappend result [testbitmap gray25]
button .b2 -bitmap $x
lappend result [testbitmap gray25]
-} {{} {{1 1}}}
-test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} testbitmap {
- set x gray25
+} -cleanup {
destroy .b1 .b2
- button .b1 -bitmap $x
+} -result {{} {{1 1}}}
+test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} -constraints {
+ testbitmap
+} -setup {
set result {}
+} -body {
+ set x gray25
+ button .b1 -bitmap $x
lappend result [testbitmap gray25]
button .b2 -bitmap $x
pack .b1 .b2 -side top
lappend result [testbitmap gray25]
-} {{{1 1}} {{2 1}}}
+} -cleanup {
+ destroy .b1 .b2
+} -result {{{1 1}} {{2 1}}}
-test bitmap-2.1 {Tk_GetBitmap procedure} {
- destroy .b1
- list [catch {button .b1 -bitmap bad_name} msg] $msg
-} {1 {bitmap "bad_name" not defined}}
-test bitmap-2.2 {Tk_GetBitmap procedure} {
- destroy .b1
- list [catch {button .b1 -bitmap @xyzzy} msg] $msg
-} {1 {error reading bitmap file "xyzzy"}}
+test bitmap-2.1 {Tk_GetBitmap procedure} -body {
+ button .b1 -bitmap bad_name
+} -cleanup {
+ destroy .b1
+} -returnCodes error -result {bitmap "bad_name" not defined}
+test bitmap-2.2 {Tk_GetBitmap procedure} -body {
+ button .b1 -bitmap @xyzzy
+} -cleanup {
+ destroy .b1
+} -returnCodes error -result {error reading bitmap file "xyzzy"}
-test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} testbitmap {
+test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} -constraints {
+ testbitmap
+} -setup {
+ set result {}
+} -body {
set x questhead
- destroy .b1 .b2 .b3
button .b1 -bitmap $x
button .b3 -bitmap $x
button .b2 -bitmap $x
- set result {}
lappend result [testbitmap questhead]
destroy .b1
lappend result [testbitmap questhead]
@@ -62,10 +78,13 @@ test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} testbitmap {
lappend result [testbitmap questhead]
destroy .b3
lappend result [testbitmap questhead]
-} {{{3 1}} {{2 1}} {{1 1}} {}}
+} -cleanup {
+ destroy .b1 .b2 .b3 ;# destroying just in case
+} -result {{{3 1}} {{2 1}} {{1 1}} {}}
-test bitmap-4.1 {FreeBitmapObjProc} testbitmap {
- destroy .b
+test bitmap-4.1 {FreeBitmapObjProc} -constraints {
+ testbitmap
+} -body {
set x [format questhead]
button .b -bitmap $x
set y [format questhead]
@@ -81,10 +100,11 @@ test bitmap-4.1 {FreeBitmapObjProc} testbitmap {
destroy .b
lappend result [testbitmap questhead]
set y bogus
- set result
-} {{{1 3}} {{1 2}} {{1 1}} {}}
+ return $result
+} -cleanup {
+ destroy .b
+} -result {{{1 3}} {{1 2}} {{1 1}} {}}
-destroy .t
# cleanup
cleanupTests
diff --git a/tests/border.test b/tests/border.test
index 30aed91..78d0fcd 100644
--- a/tests/border.test
+++ b/tests/border.test
@@ -5,49 +5,60 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-if {[testConstraint pseudocolor8]} {
- toplevel .t -visual {pseudocolor 8} -colormap new
- wm geom .t +0+0
-}
-
-test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} testborder {
+test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} -constraints {
+ testborder
+} -body {
set x orange
lindex $x 0
- destroy .b1
button .b1 -bg $x -text .b1
lindex $x 0
testborder orange
-} {{1 0}}
-test border-1.3 {Tk_AllocBorderFromObj - discard stale border} testborder {
+} -cleanup {
+ destroy .b1
+} -result {{1 0}}
+test border-1.2 {Tk_AllocBorderFromObj - discard stale border} -constraints {
+ testborder
+} -setup {
+ set result {}
+} -body {
set x orange
- destroy .b1 .b2
button .b1 -bg $x -text First
destroy .b1
- set result {}
lappend result [testborder orange]
button .b2 -bg $x -text Second
lappend result [testborder orange]
-} {{} {{1 1}}}
-test border-1.2 {Tk_AllocBorderFromObj - reuse existing border} testborder {
- set x orange
+} -cleanup {
destroy .b1 .b2
- button .b1 -bg $x -text First
+} -result {{} {{1 1}}}
+test border-1.3 {Tk_AllocBorderFromObj - reuse existing border} -constraints {
+ testborder
+} -setup {
set result {}
+} -body {
+ set x orange
+ button .b1 -bg $x -text First
lappend result [testborder orange]
button .b2 -bg $x -text Second
pack .b1 .b2 -side top
lappend result [testborder orange]
-} {{{1 1}} {{2 1}}}
-test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {pseudocolor8 testborder} {
+} -cleanup {
+ destroy .b1 .b2
+} -result {{{1 1}} {{2 1}}}
+test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} -constraints {
+ testborder pseudocolor8
+} -setup {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ wm geom .t +0+0
+ set result {}
+} -body {
set x purple
- destroy .b1 .b2 .t.b
button .b1 -bg $x -text First
pack .b1 -side top
- set result {}
lappend result [testborder purple]
button .t.b -bg $x -text Second
pack .t.b -side top
@@ -55,18 +66,24 @@ test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {pseudocolor
button .b2 -bg $x -text Third
pack .b2 -side top
lappend result [testborder purple]
-} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
+} -cleanup {
+ destroy .b1 .b2 .t
+} -result {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
-test border-3.1 {Tk_Free3DBorder - reference counts} {pseudocolor8 testborder} {
+test border-2.1 {Tk_Free3DBorder - reference counts} -constraints {
+ testborder pseudocolor8
+} -setup {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ wm geom .t +0+0
+ set result {}
+} -body {
set x purple
- destroy .b1 .b2 .t.b
button .b1 -bg $x -text First
pack .b1 -side top
button .t.b -bg $x -text Second
pack .t.b -side top
button .b2 -bg $x -text Third
pack .b2 -side top
- set result {}
lappend result [testborder purple]
destroy .b1
lappend result [testborder purple]
@@ -74,11 +91,18 @@ test border-3.1 {Tk_Free3DBorder - reference counts} {pseudocolor8 testborder} {
lappend result [testborder purple]
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} {pseudocolor8 testborder} {
- destroy .b .t.b .t2 .t3
+} -cleanup {
+ destroy .b1 .b2 .t
+} -result {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}}
+test border-2.2 {Tk_Free3DBorder - unlinking from list} -constraints {
+ testborder pseudocolor8
+} -setup {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ wm geom .t +0+0
toplevel .t2 -visual {pseudocolor 8} -colormap new
toplevel .t3 -visual {pseudocolor 8} -colormap new
+ set result {}
+} -body {
set x purple
button .b -bg $x -text .b1
button .t.b1 -bg $x -text .t.b1
@@ -90,7 +114,6 @@ test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder
button .t3.b2 -bg $x -text .t3.b2
button .t3.b3 -bg $x -text .t3.b3
button .t3.b4 -bg $x -text .t3.b4
- set result {}
lappend result [testborder purple]
destroy .t2
lappend result [testborder purple]
@@ -100,17 +123,21 @@ test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder
lappend result [testborder purple]
destroy .t
lappend result [testborder purple]
-} {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}}
+} -cleanup {
+ destroy .b .t2 .t3 .t
+} -result {{{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} testborder {
- destroy .b
+test border-3.1 {FreeBorderObjProc} -constraints {
+ testborder
+} -setup {
+ set result {}
+} -body {
set x [format purple]
button .b -bg $x -text .b1
set y [format purple]
.b configure -bg $y
set z [format purple]
.b configure -bg $z
- set result {}
lappend result [testborder purple]
set x red
lappend result [testborder purple]
@@ -119,42 +146,53 @@ test border-4.1 {FreeBorderObjProc} testborder {
destroy .b
lappend result [testborder purple]
set y bogus
- set result
-} {{{1 3}} {{1 2}} {{1 1}} {}}
+ return $result
+} -cleanup {
+ destroy .b
+} -result {{{1 3}} {{1 2}} {{1 1}} {}}
-catch {destroy .b}
-button .b
-test border-5.1 {Tk_GetReliefFromObj} {
- .b configure -relief flat
+test border-4.1 {Tk_GetReliefFromObj} -body {
+ button .b -relief flat
.b cget -relief
-} {flat}
-test border-5.2 {Tk_GetReliefFromObj} {
- .b configure -relief groove
+} -cleanup {
+ destroy .b
+} -result {flat}
+test border-4.2 {Tk_GetReliefFromObj} -body {
+ button .b -relief groove
.b cget -relief
-} {groove}
-test border-5.3 {Tk_GetReliefFromObj} {
- .b configure -relief raised
+} -cleanup {
+ destroy .b
+} -result {groove}
+test border-4.3 {Tk_GetReliefFromObj} -body {
+ button .b -relief raised
.b cget -relief
-} {raised}
-test border-5.4 {Tk_GetReliefFromObj} {
- .b configure -relief ridge
+} -cleanup {
+ destroy .b
+} -result {raised}
+test border-4.4 {Tk_GetReliefFromObj} -body {
+ button .b -relief ridge
.b cget -relief
-} {ridge}
-test border-5.5 {Tk_GetReliefFromObj} {
- .b configure -relief solid
+} -cleanup {
+ destroy .b
+} -result {ridge}
+test border-4.5 {Tk_GetReliefFromObj} -body {
+ button .b -relief solid
.b cget -relief
-} {solid}
-test border-5.6 {Tk_GetReliefFromObj} {
- .b configure -relief sunken
+} -cleanup {
+ destroy .b
+} -result {solid}
+test border-4.6 {Tk_GetReliefFromObj} -body {
+ button .b -relief sunken
.b cget -relief
-} {sunken}
-test border-5.7 {Tk_GetReliefFromObj - error} {
- list [catch {.b configure -relief upanddown} msg] $msg
-} {1 {bad relief "upanddown": must be flat, groove, raised, ridge, solid, or sunken}}
+} -cleanup {
+ destroy .b
+} -result {sunken}
+test border-4.7 {Tk_GetReliefFromObj - error} -body {
+ button .b -relief upanddown
+} -cleanup {
+ destroy .b
+} -returnCodes error -result {bad relief "upanddown": must be flat, groove, raised, ridge, solid, or sunken}
-if {[testConstraint pseudocolor8]} {
- destroy .t
-}
# cleanup
cleanupTests
diff --git a/tests/busy.test b/tests/busy.test
new file mode 100644
index 0000000..304c2eb
--- /dev/null
+++ b/tests/busy.test
@@ -0,0 +1,477 @@
+# Tests for the tk busy 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 Jos Decoster. All rights reserved.
+
+package require tcltest 2.1
+tcltest::configure {*}$argv
+tcltest::loadTestedCommands
+namespace import -force tcltest::test
+
+# 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 busy-1.1 {Tk_BusyObjCmd} -returnCodes error -body {
+ tk busy
+} -result {wrong # args: should be "tk busy options ?arg arg ...?"}
+
+test busy-2.1 {tk busy hold} -returnCodes error -body {
+ tk busy hold
+} -result {wrong # args: should be "tk busy hold window ?option value ...?"}
+test busy-2.2 {tk busy hold root window} -body {
+ tk busy hold .
+ update
+} -cleanup {
+ tk busy forget .
+} -result {}
+test busy-2.3 {tk busy hold root window with shortcut} -body {
+ tk busy .
+ update
+} -cleanup {
+ tk busy forget .
+} -result {}
+test busy-2.4 {tk busy hold nested window} -setup {
+ pack [frame .f]
+} -body {
+ tk busy hold .f
+ update
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {}
+test busy-2.5 {tk busy hold nested window with shortcut} -setup {
+ pack [frame .f]
+} -body {
+ tk busy .f
+ update
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {}
+test busy-2.6 {tk busy hold toplevel window} -setup {
+ toplevel .f
+} -body {
+ tk busy hold .f
+ update
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {}
+test busy-2.7 {tk busy hold toplevel window with shortcut} -setup {
+ toplevel .f
+} -body {
+ tk busy .f
+ update
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {}
+test busy-2.8 {tk busy hold non existing window} -body {
+ tk busy hold .f
+ update
+} -returnCodes error -result {bad window path name ".f"}
+test busy-2.9 {tk busy hold (shortcut) non existing window} -body {
+ tk busy .f
+ update
+} -returnCodes {error} -result {bad window path name ".f"}
+test busy-2.10 {tk busy hold root window with cursor} -body {
+ tk busy hold . -cursor arrow
+ update
+} -cleanup {
+ tk busy forget .
+} -result {}
+test busy-2.11 {tk busy hold (shortcut) root window, cursor} -body {
+ tk busy . -cursor arrow
+ update
+} -cleanup {
+ tk busy forget .
+} -result {}
+test busy-2.12 {tk busy hold root window, invalid cursor} -body {
+ tk busy hold . -cursor nonExistingCursor
+ update
+} -constraints tempNotMac -returnCodes error -cleanup {
+ tk busy forget .
+} -result {bad cursor spec "nonExistingCursor"}
+test busy-2.13 {tk busy hold (shortcut) root window, invalid cursor} -body {
+ tk busy . -cursor nonExistingCursor
+ update
+} -constraints tempNotMac -returnCodes error -cleanup {
+ tk busy forget .
+} -result {bad cursor spec "nonExistingCursor"}
+test busy-2.14 {tk busy hold root window, invalid option} -body {
+ tk busy hold . -invalidOption 1
+ update
+} -constraints tempNotMac -returnCodes error -cleanup {
+ tk busy forget .
+} -result {unknown option "-invalidOption"}
+test busy-2.15 {tk busy hold (shortcut) root window, invalid option} -body {
+ tk busy . -invalidOption 1
+ update
+} -constraints tempNotMac -returnCodes error -cleanup {
+ tk busy forget .
+} -result {unknown option "-invalidOption"}
+
+test busy-3.1 {tk busy cget no window} -returnCodes error -body {
+ tk busy cget
+} -result {wrong # args: should be "tk busy cget window option"}
+test busy-3.2 {tk busy cget no option} -returnCodes error -body {
+ tk busy cget
+} -result {wrong # args: should be "tk busy cget window option"}
+test busy-3.3 {tk busy cget invalid window} -returnCodes error -body {
+ tk busy cget .f -cursor
+} -result {bad window path name ".f"}
+test busy-3.4 {tk busy cget non-busy window} -setup {
+ pack [frame .f]
+} -body {
+ tk busy cget .f -cursor
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {can't find busy window ".f"}
+test busy-3.5 {tk busy cget invalid option} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy cget .f -invalidOption
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -returnCodes error -result {unknown option "-invalidOption"}
+test busy-3.6unix {tk busy cget unix} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy cget .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {watch} -constraints unix
+test busy-3.6win {tk busy cget win} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy cget .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {wait} -constraints win
+test busy-3.7 {tk busy cget unix} -setup {
+ pack [frame .f]
+ tk busy hold .f -cursor hand1
+ update
+} -body {
+ tk busy cget .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {hand1} -constraints tempNotMac
+
+test busy-4.1 {tk busy configure no window} -returnCodes error -body {
+ tk busy configure
+} -result {wrong # args: should be "tk busy configure window ?option? ?value ...?"}
+
+test busy-4.2 {tk busy configure invalid window} -body {
+ tk busy configure .f
+} -returnCodes error -result {bad window path name ".f"}
+
+test busy-4.3 {tk busy configure non-busy window} -setup {
+ pack [frame .f]
+} -body {
+ tk busy configure .f
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {can't find busy window ".f"}
+
+test busy-4.4 {tk busy configure} -constraints {nonwin} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {{-cursor cursor Cursor watch watch}}
+
+test busy-4.4-win {tk busy configure} -constraints {win} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {{-cursor cursor Cursor wait wait}}
+
+test busy-4.5 {tk busy configure} -constraints {nonwin tempNotMac} -setup {
+ pack [frame .f]
+ tk busy hold .f -cursor hand2
+ update
+} -body {
+ tk busy configure .f
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {{-cursor cursor Cursor watch hand2}}
+
+test busy-4.5-win {tk busy configure} -constraints win -setup {
+ pack [frame .f]
+ tk busy hold .f -cursor hand2
+ update
+} -body {
+ tk busy configure .f
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {{-cursor cursor Cursor wait hand2}}
+
+test busy-4.6 {tk busy configure invalid option} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f -invalidOption
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -returnCodes error -result {unknown option "-invalidOption"}
+
+test busy-4.7 {tk busy configure valid option} -constraints {nonwin} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {-cursor cursor Cursor watch watch}
+
+test busy-4.7-win {tk busy configure valid option} -constraints {win} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {-cursor cursor Cursor wait wait}
+
+test busy-4.8 {tk busy configure valid option} -constraints {
+ nonwin tempNotMac
+} -setup {
+ pack [frame .f]
+ tk busy hold .f -cursor circle
+ update
+} -body {
+ tk busy configure .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {-cursor cursor Cursor watch circle}
+
+test busy-4.8-win {tk busy configure valid option} -constraints win -setup {
+ pack [frame .f]
+ tk busy hold .f -cursor circle
+ update
+} -body {
+ tk busy configure .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {-cursor cursor Cursor wait circle}
+
+test busy-4.9 {tk busy configure valid option with value} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f -cursor pencil
+ tk busy cget .f -cursor
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {pencil} -constraints tempNotMac
+
+test busy-4.10 {tk busy configure valid option with invalid value} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy configure .f -cursor nonExistingCursor
+} -constraints tempNotMac -returnCodes error -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {bad cursor spec "nonExistingCursor"}
+
+test busy-5.1 {tk busy forget} -returnCodes error -body {
+ tk busy forget
+} -result {wrong # args: should be "tk busy forget window"}
+test busy-5.2 {tk busy forget non existing window} -body {
+ tk busy forget .f
+} -returnCodes error -result {bad window path name ".f"}
+test busy-5.3 {tk busy forget non busy window} -setup {
+ pack [frame .f]
+} -body {
+ tk busy forget .f
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {can't find busy window ".f"}
+test busy-5.4 {tk busy forget window} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ set r [tk busy status .f]
+ tk busy forget .f
+ lappend r [tk busy status .f]
+} -cleanup {
+ destroy .f
+} -result {1 0}
+
+test busy-6.1 {tk busy status} -returnCodes error -body {
+ tk busy status
+} -result {wrong # args: should be "tk busy status window"}
+test busy-6.2 {tk busy status non existing window} -body {
+ tk busy status .f
+} -result {0}
+test busy-6.3 {tk busy status non busy window} -setup {
+ pack [frame .f]
+} -body {
+ tk busy status .f
+} -cleanup {
+ destroy .f
+} -result {0}
+test busy-6.4 {tk busy status busy window} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy status .f
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {1}
+test busy-6.5 {tk busy status forgotten busy window} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+ tk busy forget .f
+} -body {
+ tk busy status .f
+} -cleanup {
+ destroy .f
+} -result {0}
+
+test busy-7.1 {tk busy current no busy} -body {
+ tk busy current
+} -result {}
+test busy-7.2 {tk busy current 1 busy} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+} -body {
+ tk busy current
+} -cleanup {
+ tk busy forget .f
+ destroy .f
+} -result {.f}
+test busy-7.3 {tk busy current 2 busy} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+} -body {
+ lsort [tk busy current]
+} -cleanup {
+ tk busy forget .f1
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {.f1 .f2}
+test busy-7.4 {tk busy current 2 busy with matching filter} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+} -body {
+ lsort [tk busy current *2*]
+} -cleanup {
+ tk busy forget .f1
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {.f2}
+test busy-7.5 {tk busy current 2 busy with non matching filter} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+} -body {
+ lsort [tk busy current *3*]
+} -cleanup {
+ tk busy forget .f1
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {}
+test busy-7.6 {tk busy current 1 busy after forget} -setup {
+ pack [frame .f]
+ tk busy hold .f
+ update
+ tk busy forget .f
+} -body {
+ tk busy current
+} -cleanup {
+ destroy .f
+} -result {}
+test busy-7.7 {tk busy current 2 busy after forget} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+ tk busy forget .f1
+} -body {
+ lsort [tk busy current]
+} -cleanup {
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {.f2}
+test busy-7.8 {tk busy current 2 busy with matching filter after forget} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+ tk busy forget .f1
+} -body {
+ lsort [tk busy current *2*]
+} -cleanup {
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {.f2}
+test busy-7.9 {tk busy current 2 busy with non matching filter after forget} -setup {
+ pack [frame .f1]
+ pack [frame .f2]
+ tk busy hold .f1
+ tk busy hold .f2
+ update
+ tk busy forget .f1
+} -body {
+ lsort [tk busy current *3*]
+} -cleanup {
+ tk busy forget .f2
+ destroy .f1 .f2
+} -result {}
+
+::tcltest::cleanupTests
+return
diff --git a/tests/button.test b/tests/button.test
index 927aac0..984fd43 100644
--- a/tests/button.test
+++ b/tests/button.test
@@ -7,427 +7,3201 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
proc bogusTrace args {
error "trace aborted"
}
-catch {unset value}
-catch {unset value2}
-# Create entries in the option database to be sure that geometry options
-# like border width have predictable values.
+test button-1.1 {configuration option: "activebackground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -activebackground #012345
+ .l cget -activebackground
+} -cleanup {
+ destroy .l
+} -result {#012345}
+test button-1.2 {configuration option: "activebackground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -activebackground non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.3 {configuration option: "activebackground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -activebackground #012345
+ .b cget -activebackground
+} -cleanup {
+ destroy .b
+} -result {#012345}
+test button-1.4 {configuration option: "activebackground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -activebackground non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.5 {configuration option: "activebackground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -activebackground #012345
+ .c cget -activebackground
+} -cleanup {
+ destroy .c
+} -result {#012345}
+test button-1.6 {configuration option: "activebackground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -activebackground non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.7 {configuration option: "activebackground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -activebackground #012345
+ .r cget -activebackground
+} -cleanup {
+ destroy .r
+} -result {#012345}
+test button-1.8 {configuration option: "activebackground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -activebackground non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.9 {configuration option: "activeforeground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -activeforeground #ff0000
+ .l cget -activeforeground
+} -cleanup {
+ destroy .l
+} -result {#ff0000}
+test button-1.10 {configuration option: "activeforeground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -activeforeground non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.11 {configuration option: "activeforeground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -activeforeground #ff0000
+ .b cget -activeforeground
+} -cleanup {
+ destroy .b
+} -result {#ff0000}
+test button-1.12 {configuration option: "activeforeground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -activeforeground non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.13 {configuration option: "activeforeground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -activeforeground #ff0000
+ .c cget -activeforeground
+} -cleanup {
+ destroy .c
+} -result {#ff0000}
+test button-1.14 {configuration option: "activeforeground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -activeforeground non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.15 {configuration option: "activeforeground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -activeforeground #ff0000
+ .r cget -activeforeground
+} -cleanup {
+ destroy .r
+} -result {#ff0000}
+test button-1.16 {configuration option: "activeforeground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -activeforeground non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.17 {configuration option: "anchor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -anchor nw
+ .l cget -anchor
+} -cleanup {
+ destroy .l
+} -result {nw}
+test button-1.18 {configuration option: "anchor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -anchor bogus
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+test button-1.19 {configuration option: "anchor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -anchor nw
+ .b cget -anchor
+} -cleanup {
+ destroy .b
+} -result {nw}
+test button-1.20 {configuration option: "anchor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -anchor bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+test button-1.21 {configuration option: "anchor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -anchor nw
+ .c cget -anchor
+} -cleanup {
+ destroy .c
+} -result {nw}
+test button-1.22 {configuration option: "anchor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -anchor bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+test button-1.23 {configuration option: "anchor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -anchor nw
+ .r cget -anchor
+} -cleanup {
+ destroy .r
+} -result {nw}
+test button-1.24 {configuration option: "anchor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -anchor bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+
+test button-1.25 {configuration option: "background" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -background #ff0000
+ .l cget -background
+} -cleanup {
+ destroy .l
+} -result {#ff0000}
+test button-1.26 {configuration option: "background" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -background non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.27 {configuration option: "background" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -background #ff0000
+ .b cget -background
+} -cleanup {
+ destroy .b
+} -result {#ff0000}
+test button-1.28 {configuration option: "background" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -background non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.29 {configuration option: "background" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -background #ff0000
+ .c cget -background
+} -cleanup {
+ destroy .c
+} -result {#ff0000}
+test button-1.30 {configuration option: "background" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -background non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.31 {configuration option: "background" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -background #ff0000
+ .r cget -background
+} -cleanup {
+ destroy .r
+} -result {#ff0000}
+test button-1.32 {configuration option: "background" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -background non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.33 {configuration option: "bd" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bd 4
+ .l cget -bd
+} -cleanup {
+ destroy .l
+} -result {4}
+test button-1.34 {configuration option: "bd" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bd badValue
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.35 {configuration option: "bd" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bd 4
+ .b cget -bd
+} -cleanup {
+ destroy .b
+} -result {4}
+test button-1.36 {configuration option: "bd" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bd badValue
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.37 {configuration option: "bd" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bd 4
+ .c cget -bd
+} -cleanup {
+ destroy .c
+} -result {4}
+test button-1.38 {configuration option: "bd" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bd badValue
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.39 {configuration option: "bd" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bd 4
+ .r cget -bd
+} -cleanup {
+ destroy .r
+} -result {4}
+test button-1.40 {configuration option: "bd" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bd badValue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test button-1.41 {configuration option: "bg" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bg #ff0000
+ .l cget -bg
+} -cleanup {
+ destroy .l
+} -result {#ff0000}
+test button-1.42 {configuration option: "bg" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bg non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.43 {configuration option: "bg" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bg #ff0000
+ .b cget -bg
+} -cleanup {
+ destroy .b
+} -result {#ff0000}
+test button-1.44 {configuration option: "bg" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bg non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.45 {configuration option: "bg" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bg #ff0000
+ .c cget -bg
+} -cleanup {
+ destroy .c
+} -result {#ff0000}
+test button-1.46 {configuration option: "bg" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bg non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.47 {configuration option: "bg" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bg #ff0000
+ .r cget -bg
+} -cleanup {
+ destroy .r
+} -result {#ff0000}
+test button-1.48 {configuration option: "bg" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bg non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.49 {configuration option: "bitmap" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bitmap questhead
+ .l cget -bitmap
+} -cleanup {
+ destroy .l
+} -result {questhead}
+test button-1.50 {configuration option: "bitmap" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -bitmap badValue
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bitmap "badValue" not defined}
+test button-1.51 {configuration option: "bitmap" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bitmap questhead
+ .b cget -bitmap
+} -cleanup {
+ destroy .b
+} -result {questhead}
+test button-1.52 {configuration option: "bitmap" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -bitmap badValue
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bitmap "badValue" not defined}
+test button-1.53 {configuration option: "bitmap" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bitmap questhead
+ .c cget -bitmap
+} -cleanup {
+ destroy .c
+} -result {questhead}
+test button-1.54 {configuration option: "bitmap" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -bitmap badValue
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bitmap "badValue" not defined}
+test button-1.55 {configuration option: "bitmap" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bitmap questhead
+ .r cget -bitmap
+} -cleanup {
+ destroy .r
+} -result {questhead}
+test button-1.56 {configuration option: "bitmap" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -bitmap badValue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bitmap "badValue" not defined}
+
+test button-1.57 {configuration option: "borderwidth" for label} -setup {
+ label .l -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -borderwidth 1.3
+ .l cget -borderwidth
+} -cleanup {
+ destroy .l
+} -result {1.3}
+test button-1.58 {configuration option: "borderwidth" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -borderwidth badValue
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.59 {configuration option: "borderwidth" for button} -setup {
+ button .b -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -borderwidth 1.3
+ .b cget -borderwidth
+} -cleanup {
+ destroy .b
+} -result {1.3}
+test button-1.60 {configuration option: "borderwidth" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -borderwidth badValue
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.61 {configuration option: "borderwidth" for checkbutton} -setup {
+ checkbutton .c -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -borderwidth 1.3
+ .c cget -borderwidth
+} -cleanup {
+ destroy .c
+} -result {1.3}
+test button-1.62 {configuration option: "borderwidth" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -borderwidth badValue
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.63 {configuration option: "borderwidth" for radiobutton} -setup {
+ radiobutton .r -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -borderwidth 1.3
+ .r cget -borderwidth
+} -cleanup {
+ destroy .r
+} -result {1.3}
+test button-1.64 {configuration option: "borderwidth" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -borderwidth badValue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test button-1.65 {configuration option: "command" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -command {set x}
+ .b cget -command
+} -cleanup {
+ destroy .b
+} -result {set x}
+test button-1.66 {configuration option: "command" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -command {set x}
+ .b cget -command
+} -cleanup {
+ destroy .b
+} -result {set x}
+test button-1.67 {configuration option: "command" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -command {set x}
+ .c cget -command
+} -cleanup {
+ destroy .c
+} -result {set x}
+test button-1.68 {configuration option: "command" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -command {set x}
+ .r cget -command
+} -cleanup {
+ destroy .r
+} -result {set x}
+
+test button-1.69 {configuration option: "compound" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -compound left
+ .l cget -compound
+} -cleanup {
+ destroy .l
+} -result {left}
+test button-1.70 {configuration option: "compound" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -compound bogus
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
+test button-1.71 {configuration option: "compound" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -compound left
+ .b cget -compound
+} -cleanup {
+ destroy .b
+} -result {left}
+test button-1.72 {configuration option: "compound" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -compound bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
+test button-1.73 {configuration option: "compound" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -compound left
+ .c cget -compound
+} -cleanup {
+ destroy .c
+} -result {left}
+test button-1.74 {configuration option: "compound" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -compound bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
+test button-1.75 {configuration option: "compound" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -compound left
+ .r cget -compound
+} -cleanup {
+ destroy .r
+} -result {left}
+test button-1.76 {configuration option: "compound" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -compound bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top}
+
+test button-1.77 {configuration option: "cursor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -cursor arrow
+ .l cget -cursor
+} -cleanup {
+ destroy .l
+} -result {arrow}
+test button-1.78 {configuration option: "cursor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -cursor badValue
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+test button-1.79 {configuration option: "cursor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -cursor arrow
+ .b cget -cursor
+} -cleanup {
+ destroy .b
+} -result {arrow}
+test button-1.80 {configuration option: "cursor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -cursor badValue
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+test button-1.81 {configuration option: "cursor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -cursor arrow
+ .c cget -cursor
+} -cleanup {
+ destroy .c
+} -result {arrow}
+test button-1.82 {configuration option: "cursor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -cursor badValue
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+test button-1.83 {configuration option: "cursor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -cursor arrow
+ .r cget -cursor
+} -cleanup {
+ destroy .r
+} -result {arrow}
+test button-1.84 {configuration option: "cursor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -cursor badValue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+
+test button-1.85 {configuration option: "default" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -default active
+ .b cget -default
+} -cleanup {
+ destroy .b
+} -result {active}
+test button-1.86 {configuration option: "default" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -default huh?
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal}
+
+test button-1.87 {configuration option: "disabledforeground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -disabledforeground #00ff00
+ .l cget -disabledforeground
+} -cleanup {
+ destroy .l
+} -result {#00ff00}
+test button-1.88 {configuration option: "disabledforeground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -disabledforeground non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.89 {configuration option: "disabledforeground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -disabledforeground #00ff00
+ .b cget -disabledforeground
+} -cleanup {
+ destroy .b
+} -result {#00ff00}
+test button-1.90 {configuration option: "disabledforeground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -disabledforeground non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.91 {configuration option: "disabledforeground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -disabledforeground #00ff00
+ .c cget -disabledforeground
+} -cleanup {
+ destroy .c
+} -result {#00ff00}
+test button-1.92 {configuration option: "disabledforeground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -disabledforeground non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.93 {configuration option: "disabledforeground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -disabledforeground #00ff00
+ .r cget -disabledforeground
+} -cleanup {
+ destroy .r
+} -result {#00ff00}
+test button-1.94 {configuration option: "disabledforeground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -disabledforeground non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.95 {configuration option: "fg" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -fg #110022
+ .l cget -fg
+} -cleanup {
+ destroy .l
+} -result {#110022}
+test button-1.96 {configuration option: "fg" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -fg non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.97 {configuration option: "fg" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -fg #110022
+ .b cget -fg
+} -cleanup {
+ destroy .b
+} -result {#110022}
+test button-1.98 {configuration option: "fg" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -fg non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.99 {configuration option: "fg" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -fg #110022
+ .c cget -fg
+} -cleanup {
+ destroy .c
+} -result {#110022}
+test button-1.100 {configuration option: "fg" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -fg non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.101 {configuration option: "fg" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -fg #110022
+ .r cget -fg
+} -cleanup {
+ destroy .r
+} -result {#110022}
+test button-1.102 {configuration option: "fg" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -fg non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.103 {configuration option: "font" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2
+ pack .l
+ update
+} -body {
+ .l configure -font {Helvetica -12}
+ .l cget -font
+} -cleanup {
+ destroy .l
+} -result {Helvetica -12}
+test button-1.104 {configuration option: "activebackground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2
+ pack .l
+ update
+} -body {
+ .l configure -font {}
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {font "" doesn't exist}
+test button-1.105 {configuration option: "font" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2
+ pack .b
+ update
+} -body {
+ .b configure -font {Helvetica -12}
+ .b cget -font
+} -cleanup {
+ destroy .b
+} -result {Helvetica -12}
+test button-1.106 {configuration option: "activebackground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2
+ pack .b
+ update
+} -body {
+ .b configure -font {}
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {font "" doesn't exist}
+test button-1.107 {configuration option: "font" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2
+ pack .c
+ update
+} -body {
+ .c configure -font {Helvetica -12}
+ .c cget -font
+} -cleanup {
+ destroy .c
+} -result {Helvetica -12}
+test button-1.108 {configuration option: "activebackground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2
+ pack .c
+ update
+} -body {
+ .c configure -font {}
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {font "" doesn't exist}
+test button-1.109 {configuration option: "font" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2
+ pack .r
+ update
+} -body {
+ .r configure -font {Helvetica -12}
+ .r cget -font
+} -cleanup {
+ destroy .r
+} -result {Helvetica -12}
+test button-1.110 {configuration option: "activebackground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2
+ pack .r
+ update
+} -body {
+ .r configure -font {}
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {font "" doesn't exist}
-option add *Button.borderWidth 2
-option add *Button.highlightThickness 2
-option add *Button.font {Helvetica -12 bold}
+test button-1.111 {configuration option: "foreground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -foreground #110022
+ .l cget -foreground
+} -cleanup {
+ destroy .l
+} -result {#110022}
+test button-1.112 {configuration option: "foreground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -foreground non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.113 {configuration option: "foreground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -foreground #110022
+ .b cget -foreground
+} -cleanup {
+ destroy .b
+} -result {#110022}
+test button-1.114 {configuration option: "foreground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -foreground non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.115 {configuration option: "foreground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -foreground #110022
+ .c cget -foreground
+} -cleanup {
+ destroy .c
+} -result {#110022}
+test button-1.116 {configuration option: "foreground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -foreground non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.117 {configuration option: "foreground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -foreground #110022
+ .r cget -foreground
+} -cleanup {
+ destroy .r
+} -result {#110022}
+test button-1.118 {configuration option: "foreground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -foreground non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
-eval image delete [image names]
-if {[testConstraint testImageType]} {
+test button-1.119 {configuration option: "height" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -height 18
+ .l cget -height
+} -cleanup {
+ destroy .l
+} -result {18}
+test button-1.120 {configuration option: "height" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -height 20.0
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {expected integer but got "20.0"}
+test button-1.121 {configuration option: "height" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -height 18
+ .b cget -height
+} -cleanup {
+ destroy .b
+} -result {18}
+test button-1.122 {configuration option: "height" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -height 20.0
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "20.0"}
+test button-1.123 {configuration option: "height" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -height 18
+ .c cget -height
+} -cleanup {
+ destroy .c
+} -result {18}
+test button-1.124 {configuration option: "height" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -height 20.0
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {expected integer but got "20.0"}
+test button-1.125 {configuration option: "height" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -height 18
+ .r cget -height
+} -cleanup {
+ destroy .r
+} -result {18}
+test button-1.126 {configuration option: "height" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -height 20.0
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {expected integer but got "20.0"}
+
+test button-1.127 {configuration option: "highlightbackground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightbackground #110022
+ .l cget -highlightbackground
+} -cleanup {
+ destroy .l
+} -result {#110022}
+test button-1.128 {configuration option: "highlightbackground" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightbackground non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.129 {configuration option: "highlightbackground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightbackground #110022
+ .b cget -highlightbackground
+} -cleanup {
+ destroy .b
+} -result {#110022}
+test button-1.130 {configuration option: "highlightbackground" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightbackground non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.131 {configuration option: "highlightbackground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightbackground #110022
+ .c cget -highlightbackground
+} -cleanup {
+ destroy .c
+} -result {#110022}
+test button-1.132 {configuration option: "highlightbackground" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightbackground non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.133 {configuration option: "highlightbackground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightbackground #110022
+ .r cget -highlightbackground
+} -cleanup {
+ destroy .r
+} -result {#110022}
+test button-1.134 {configuration option: "highlightbackground" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightbackground non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.135 {configuration option: "highlightcolor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightcolor #110022
+ .l cget -highlightcolor
+} -cleanup {
+ destroy .l
+} -result {#110022}
+test button-1.136 {configuration option: "highlightcolor" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightcolor non-existent
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.137 {configuration option: "highlightcolor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightcolor #110022
+ .b cget -highlightcolor
+} -cleanup {
+ destroy .b
+} -result {#110022}
+test button-1.138 {configuration option: "highlightcolor" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightcolor non-existent
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.139 {configuration option: "highlightcolor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightcolor #110022
+ .c cget -highlightcolor
+} -cleanup {
+ destroy .c
+} -result {#110022}
+test button-1.140 {configuration option: "highlightcolor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightcolor non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.141 {configuration option: "highlightcolor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightcolor #110022
+ .r cget -highlightcolor
+} -cleanup {
+ destroy .r
+} -result {#110022}
+test button-1.142 {configuration option: "highlightcolor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightcolor non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.143 {configuration option: "highlightthickness" for label} -setup {
+ label .l -borderwidth 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightthickness 6m
+ .l cget -highlightthickness
+} -cleanup {
+ destroy .l
+} -result {6m}
+test button-1.144 {configuration option: "highlightthickness" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -highlightthickness badValue
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.145 {configuration option: "highlightthickness" for button} -setup {
+ button .b -borderwidth 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightthickness 6m
+ .b cget -highlightthickness
+} -cleanup {
+ destroy .b
+} -result {6m}
+test button-1.146 {configuration option: "highlightthickness" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -highlightthickness badValue
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.147 {configuration option: "highlightthickness" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightthickness 6m
+ .c cget -highlightthickness
+} -cleanup {
+ destroy .c
+} -result {6m}
+test button-1.148 {configuration option: "highlightthickness" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -highlightthickness badValue
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "badValue"}
+test button-1.149 {configuration option: "highlightthickness" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightthickness 6m
+ .r cget -highlightthickness
+} -cleanup {
+ destroy .r
+} -result {6m}
+test button-1.150 {configuration option: "highlightthickness" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -highlightthickness badValue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test button-1.151 {configuration option: "image" for label} -constraints {
+ testImageType
+} -setup {
image create test image1
-}
-label .l -text Label
-button .b -text Button
-checkbutton .c -text Checkbutton
-radiobutton .r -text Radiobutton
-pack .l .b .c .r
-update
-set i 1
-foreach test {
- {-activebackground #012345 #012345 non-existent
- {unknown color name "non-existent"} {1 1 1 1}}
- {-activeforeground #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"} {1 1 1 1}}
- {-anchor nw nw bogus
- {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
- {1 1 1 1}}
- {-background #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"} {1 1 1 1}}
- {-bd 4 4 badValue {bad screen distance "badValue"} {1 1 1 1}}
- {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}
- {1 1 1 1}}
- {-bitmap questhead questhead badValue {bitmap "badValue" not defined}
- {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}
- {0 1 0 0}}
- {-disabledforeground #00ff00 #00ff00 xyzzy {unknown color name "xyzzy"}
- {1 1 1 1}}
- {-fg #110022 #110022 bogus {unknown color name "bogus"} {1 1 1 1}}
- {-font {Helvetica 12} {Helvetica 12} {} {font "" doesn't exist} {1 1 1 1}}
- {-foreground #110022 #110022 bogus {unknown color name "bogus"} {1 1 1 1}}
- {-height 18 18 20.0 {expected integer but got "20.0"} {1 1 1 1}}
- {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}
- {1 1 1 1}}
- {-highlightcolor #110022 #110022 bogus {unknown color name "bogus"}
- {1 1 1 1}}
- {-highlightthickness 6m 6m badValue {bad screen distance "badValue"}
- {1 1 1 1}}
- {-image image1 image1 bogus {image "bogus" doesn't exist} {1 1 1 1}}
- {-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}}
- {-onvalue 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}}
- {-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}}
- {-takefocus "any string" "any string" {} {} {1 1 1 1}}
- {-text "Sample text" {Sample text} {} {} {1 1 1 1}}
- {-textvariable i i {} {} {1 1 1 1}}
- {-tristateimage image1 image1 bogus {image "bogus" doesn't exist}
- {0 0 1 1}}
- {-tristatevalue unknowable unknowable {} {} {0 0 1 1}}
- {-underline 5 5 3p {expected integer but got "3p"} {1 1 1 1}}
- {-value anyString anyString {} {} {0 0 0 1}}
- {-width 402 402 3p {expected integer but got "3p"} {1 1 1 1}}
- {-wraplength 100 100 6x {bad screen distance "6x"} {1 1 1 1}}
-} {
- lassign $test name value okResult badValue badResult classes
- foreach w {.l .b .c .r} hasOption $classes {
- set classname [winfo class $w]
- if {$hasOption} {
- test button-1.$i "configuration option $name for $classname" \
- -constraints testImageType -body "
- $w configure $name [list $value]
- lindex \[$w configure $name] 4
- " -result $okResult
- incr i
- if {$badValue ne ""} {
- test button-1.$i "configuration option $name for $classname" \
- -constraints testImageType \
- -body [list $w configure $name $badValue] \
- -returnCodes error -result $badResult
- incr i
- }
- $w configure $name [lindex [$w configure $name] 3]
- } else {
- test button-1.$i "configuration option $name for $classname" \
- -constraints testImageType \
- -body [list $w configure $name $value] \
- -returnCodes error -result "unknown option \"$name\""
- incr i
- }
- }
-}
-test button-1.$i {configuration options} {
- # Additional check to make sure that -selectcolor may be empty in
- # checkbox widgets
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -image image1
+ .l cget -image
+} -cleanup {
+ destroy .l
+ image delete image1
+} -result {image1}
+test button-1.152 {configuration option: "image" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -image bogus
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+test button-1.153 {configuration option: "image" for button} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -image image1
+ .b cget -image
+} -cleanup {
+ destroy .b
+ image delete image1
+} -result {image1}
+test button-1.154 {configuration option: "image" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -image bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+test button-1.155 {configuration option: "image" for checkbutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -image image1
+ .c cget -image
+} -cleanup {
+ destroy .c
+ image delete image1
+} -result {image1}
+test button-1.156 {configuration option: "image" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -image bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+test button-1.157 {configuration option: "image" for radiobutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -image image1
+ .r cget -image
+} -cleanup {
+ destroy .r
+ image delete image1
+} -result {image1}
+test button-1.158 {configuration option: "image" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -image bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+
+test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -indicatoron yes
+ .c cget -indicatoron
+} -cleanup {
+ destroy .c
+} -result {1}
+test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -indicatoron no_way
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {expected boolean value but got "no_way"}
+test button-1.161 {configuration option: "indicatoron" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -indicatoron yes
+ .r cget -indicatoron
+} -cleanup {
+ destroy .r
+} -result {1}
+test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -indicatoron no_way
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {expected boolean value but got "no_way"}
+
+test button-1.163 {configuration option: "justify" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -justify right
+ .l cget -justify
+} -cleanup {
+ destroy .l
+} -result {right}
+test button-1.164 {configuration option: "justify" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -justify bogus
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+test button-1.165 {configuration option: "justify" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -justify right
+ .b cget -justify
+} -cleanup {
+ destroy .b
+} -result {right}
+test button-1.166 {configuration option: "justify" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -justify bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+test button-1.167 {configuration option: "justify" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -justify right
+ .c cget -justify
+} -cleanup {
+ destroy .c
+} -result {right}
+test button-1.168 {configuration option: "justify" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -justify bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+test button-1.169 {configuration option: "justify" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -justify right
+ .r cget -justify
+} -cleanup {
+ destroy .r
+} -result {right}
+test button-1.170 {configuration option: "justify" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -justify bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+
+test button-1.171 {configuration option: "offrelief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -offrelief flat
+ .c cget -offrelief
+} -cleanup {
+ destroy .c
+} -result {flat}
+test button-1.172 {configuration option: "offrelief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -offrelief 1.5
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.173 {configuration option: "offrelief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -offrelief flat
+ .r cget -offrelief
+} -cleanup {
+ destroy .r
+} -result {flat}
+test button-1.174 {configuration option: "offrelief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -offrelief 1.5
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+
+test button-1.175 {configuration option: "offvalue" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -offvalue lousy
+ .c cget -offvalue
+} -cleanup {
+ destroy .c
+} -result {lousy}
+
+test button-1.176 {configuration option: "onvalue" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -onvalue fantastic
+ .c cget -onvalue
+} -cleanup {
+ destroy .c
+} -result {fantastic}
+
+test button-1.177 {configuration option: "overrelief" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -overrelief ""
+ .b cget -overrelief
+} -cleanup {
+ destroy .b
+} -result {}
+test button-1.178 {configuration option: "overrelief" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -overrelief 1.5
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.179 {configuration option: "overrelief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -overrelief ""
+ .c cget -overrelief
+} -cleanup {
+ destroy .c
+} -result {}
+test button-1.180 {configuration option: "overrelief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -overrelief 1.5
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.181 {configuration option: "overrelief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -overrelief ""
+ .r cget -overrelief
+} -cleanup {
+ destroy .r
+} -result {}
+test button-1.182 {configuration option: "overrelief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -overrelief 1.5
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+
+test button-1.183 {configuration option: "padx" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -padx 12m
+ .l cget -padx
+} -cleanup {
+ destroy .l
+} -result {12m}
+test button-1.184 {configuration option: "padx" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -padx 420x
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.185 {configuration option: "padx" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -padx 12m
+ .b cget -padx
+} -cleanup {
+ destroy .b
+} -result {12m}
+test button-1.186 {configuration option: "padx" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -padx 420x
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.187 {configuration option: "padx" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -padx 12m
+ .c cget -padx
+} -cleanup {
+ destroy .c
+} -result {12m}
+test button-1.188 {configuration option: "padx" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -padx 420x
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.189 {configuration option: "padx" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -padx 12m
+ .r cget -padx
+} -cleanup {
+ destroy .r
+} -result {12m}
+test button-1.190 {configuration option: "padx" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -padx 420x
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "420x"}
+
+test button-1.191 {configuration option: "pady" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -pady 12m
+ .l cget -pady
+} -cleanup {
+ destroy .l
+} -result {12m}
+test button-1.192 {configuration option: "pady" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -pady 420x
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.193 {configuration option: "pady" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -pady 12m
+ .b cget -pady
+} -cleanup {
+ destroy .b
+} -result {12m}
+test button-1.194 {configuration option: "pady" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -pady 420x
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.195 {configuration option: "pady" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -pady 12m
+ .c cget -pady
+} -cleanup {
+ destroy .c
+} -result {12m}
+test button-1.196 {configuration option: "pady" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -pady 420x
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "420x"}
+test button-1.197 {configuration option: "pady" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -pady 12m
+ .r cget -pady
+} -cleanup {
+ destroy .r
+} -result {12m}
+test button-1.198 {configuration option: "pady" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -pady 420x
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "420x"}
+
+test button-1.199 {configuration option: "repeatdelay" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -repeatdelay 100
+ .b cget -repeatdelay
+} -cleanup {
+ destroy .b
+} -result {100}
+test button-1.200 {configuration option: "repeatdelay" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -repeatdelay foo
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "foo"}
+
+test button-1.201 {configuration option: "repeatinterval" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -repeatinterval 100
+ .b cget -repeatinterval
+} -cleanup {
+ destroy .b
+} -result {100}
+test button-1.202 {configuration option: "repeatinterval" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -repeatinterval foo
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "foo"}
+
+test button-1.203 {configuration option: "relief" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -relief flat
+ .l cget -relief
+} -cleanup {
+ destroy .l
+} -result {flat}
+test button-1.204 {configuration option: "relief" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -relief 1.5
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.205 {configuration option: "relief" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -relief flat
+ .b cget -relief
+} -cleanup {
+ destroy .b
+} -result {flat}
+test button-1.206 {configuration option: "relief" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -relief 1.5
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.207 {configuration option: "relief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -relief flat
+ .c cget -relief
+} -cleanup {
+ destroy .c
+} -result {flat}
+test button-1.208 {configuration option: "relief" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -relief 1.5
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test button-1.209 {configuration option: "relief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -relief flat
+ .r cget -relief
+} -cleanup {
+ destroy .r
+} -result {flat}
+test button-1.210 {configuration option: "relief" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -relief 1.5
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+
+test button-1.211 {configuration option: "selectcolor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -selectcolor #110022
+ .c cget -selectcolor
+} -cleanup {
+ destroy .c
+} -result {#110022}
+test button-1.212 {configuration option: "selectcolor" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -selectcolor non-existent
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown color name "non-existent"}
+test button-1.213 {configuration option: "selectcolor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -selectcolor #110022
+ .r cget -selectcolor
+} -cleanup {
+ destroy .r
+} -result {#110022}
+test button-1.214 {configuration option: "selectcolor" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -selectcolor non-existent
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test button-1.215 {configuration option: "selectimage" for checkbutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -selectimage image1
+ .c cget -selectimage
+} -cleanup {
+ destroy .c
+ image delete image1
+} -result {image1}
+test button-1.216 {configuration option: "selectimage" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -selectimage bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+test button-1.217 {configuration option: "selectimage" for radiobutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -selectimage image1
+ .r cget -selectimage
+} -cleanup {
+ destroy .r
+ image delete image1
+} -result {image1}
+test button-1.218 {configuration option: "selectimage" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -selectimage bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+
+test button-1.219 {configuration option: "state" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -state normal
+ .l cget -state
+} -cleanup {
+ destroy .l
+} -result {normal}
+test button-1.220 {configuration option: "state" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -state bogus
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
+test button-1.221 {configuration option: "state" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -state normal
+ .b cget -state
+} -cleanup {
+ destroy .b
+} -result {normal}
+test button-1.222 {configuration option: "state" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -state bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
+test button-1.223 {configuration option: "state" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -state normal
+ .c cget -state
+} -cleanup {
+ destroy .c
+} -result {normal}
+test button-1.224 {configuration option: "state" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -state bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
+test button-1.225 {configuration option: "state" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -state normal
+ .r cget -state
+} -cleanup {
+ destroy .r
+} -result {normal}
+test button-1.226 {configuration option: "state" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -state bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal}
+
+test button-1.227 {configuration option: "takefocus" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -takefocus "any string"
+ .l cget -takefocus
+} -cleanup {
+ destroy .l
+} -result {any string}
+test button-1.228 {configuration option: "takefocus" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -takefocus "any string"
+ .b cget -takefocus
+} -cleanup {
+ destroy .b
+} -result {any string}
+test button-1.229 {configuration option: "takefocus" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -takefocus "any string"
+ .c cget -takefocus
+} -cleanup {
+ destroy .c
+} -result {any string}
+test button-1.230 {configuration option: "takefocus" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -takefocus "any string"
+ .r cget -takefocus
+} -cleanup {
+ destroy .r
+} -result {any string}
+
+test button-1.231 {configuration option: "text" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -text "Sample text"
+ .l cget -text
+} -cleanup {
+ destroy .l
+} -result {Sample text}
+test button-1.232 {configuration option: "text" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -text "Sample text"
+ .b cget -text
+} -cleanup {
+ destroy .b
+} -result {Sample text}
+test button-1.233 {configuration option: "text" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -text "Sample text"
+ .c cget -text
+} -cleanup {
+ destroy .c
+} -result {Sample text}
+test button-1.234 {configuration option: "text" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -text "Sample text"
+ .r cget -text
+} -cleanup {
+ destroy .r
+} -result {Sample text}
+
+test button-1.235 {configuration option: "textvariable" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -textvariable i
+ .l cget -textvariable
+} -cleanup {
+ destroy .l
+} -result {i}
+test button-1.236 {configuration option: "textvariable" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -textvariable i
+ .b cget -textvariable
+} -cleanup {
+ destroy .b
+} -result {i}
+test button-1.237 {configuration option: "textvariable" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -textvariable i
+ .c cget -textvariable
+} -cleanup {
+ destroy .c
+} -result {i}
+test button-1.238 {configuration option: "textvariable" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -textvariable i
+ .r cget -textvariable
+} -cleanup {
+ destroy .r
+} -result {i}
+
+test button-1.239 {configuration option: "tristateimage" for checkbutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -tristateimage image1
+ .c cget -tristateimage
+} -cleanup {
+ destroy .c
+ image delete image1
+} -result {image1}
+test button-1.240 {configuration option: "tristateimage" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -tristateimage bogus
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+test button-1.241 {configuration option: "tristateimage" for radiobutton} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -tristateimage image1
+ .r cget -tristateimage
+} -cleanup {
+ destroy .r
+ image delete image1
+} -result {image1}
+test button-1.242 {configuration option: "tristateimage" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -tristateimage bogus
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+
+test button-1.243 {configuration option: "underline" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -underline 5
+ .l cget -underline
+} -cleanup {
+ destroy .l
+} -result {5}
+test button-1.244 {configuration option: "underline" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -underline 3p
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.245 {configuration option: "underline" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -underline 5
+ .b cget -underline
+} -cleanup {
+ destroy .b
+} -result {5}
+test button-1.246 {configuration option: "underline" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -underline 3p
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.247 {configuration option: "underline" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -underline 5
+ .c cget -underline
+} -cleanup {
+ destroy .c
+} -result {5}
+test button-1.248 {configuration option: "underline" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -underline 3p
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.249 {configuration option: "underline" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -underline 5
+ .r cget -underline
+} -cleanup {
+ destroy .r
+} -result {5}
+test button-1.250 {configuration option: "underline" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -underline 3p
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test button-1.251 {configuration option: "tristatevalue" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -tristatevalue unknowable
+ .c cget -tristatevalue
+} -cleanup {
+ destroy .c
+} -result {unknowable}
+test button-1.252 {configuration option: "tristatevalue" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -tristatevalue unknowable
+ .r cget -tristatevalue
+} -cleanup {
+ destroy .r
+} -result {unknowable}
+
+test button-1.253 {configuration option: "value" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -value anyString
+ .r cget -value
+} -cleanup {
+ destroy .r
+} -result {anyString}
+
+test button-1.254 {configuration option: "width" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -width 402
+ .l cget -width
+} -cleanup {
+ destroy .l
+} -result {402}
+test button-1.255 {configuration option: "width" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -width 3p
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.256 {configuration option: "width" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -width 402
+ .b cget -width
+} -cleanup {
+ destroy .b
+} -result {402}
+test button-1.257 {configuration option: "width" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -width 3p
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.258 {configuration option: "width" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -width 402
+ .c cget -width
+} -cleanup {
+ destroy .c
+} -result {402}
+test button-1.259 {configuration option: "width" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -width 3p
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {expected integer but got "3p"}
+test button-1.260 {configuration option: "width" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -width 402
+ .r cget -width
+} -cleanup {
+ destroy .r
+} -result {402}
+test button-1.261 {configuration option: "width" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -width 3p
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test button-1.262 {configuration option: "wraplength" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -wraplength 100
+ .l cget -wraplength
+} -cleanup {
+ destroy .l
+} -result {100}
+test button-1.263 {configuration option: "wraplength" for label} -setup {
+ label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .l
+ update
+} -body {
+ .l configure -wraplength 6x
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad screen distance "6x"}
+test button-1.264 {configuration option: "wraplength" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -wraplength 100
+ .b cget -wraplength
+} -cleanup {
+ destroy .b
+} -result {100}
+test button-1.265 {configuration option: "wraplength" for button} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .b
+ update
+} -body {
+ .b configure -wraplength 6x
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "6x"}
+test button-1.266 {configuration option: "wraplength" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -wraplength 100
+ .c cget -wraplength
+} -cleanup {
+ destroy .c
+} -result {100}
+test button-1.267 {configuration option: "wraplength" for checkbutton} -setup {
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .c
+ update
+} -body {
+ .c configure -wraplength 6x
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {bad screen distance "6x"}
+test button-1.268 {configuration option: "wraplength" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -wraplength 100
+ .r cget -wraplength
+} -cleanup {
+ destroy .r
+} -result {100}
+test button-1.269 {configuration option: "wraplength" for radiobutton} -setup {
+ radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .r
+ update
+} -body {
+ .r configure -wraplength 6x
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad screen distance "6x"}
+
+test button-1.270 {configuration options} -body {
+# Additional check to make sure that -selectcolor may be empty in
+# checkbox widgets
+ checkbutton .c
.c configure -selectcolor {}
-} {}
-
-test button-3.1 {ButtonCreate - not enough cd ../unix
-} {
- list [catch {button} msg] $msg
-} {1 {wrong # args: should be "button pathName ?options?"}}
-test button-3.2 {ButtonCreate procedure - setting label class} {
- catch {destroy .x}
+} -cleanup {
+ destroy .c
+} -result {}
+
+# ex-tests 3.*
+test button-2.1 {ButtonCreate - not enough arguments} -body {
+ button
+} -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"}
+
+test button-2.2 {ButtonCreate procedure - setting label class} -body {
label .x
winfo class .x
-} {Label}
-test button-3.3 {ButtonCreate - setting button class} {
- catch {destroy .x}
+} -cleanup {
+ destroy .x
+} -result {Label}
+test button-2.3 {ButtonCreate - setting button class} -body {
button .x
winfo class .x
-} {Button}
-test button-3.4 {ButtonCreate - setting checkbutton class} {
- catch {destroy .x}
+} -cleanup {
+ destroy .x
+} -result {Button}
+test button-2.4 {ButtonCreate - setting checkbutton class} -body {
checkbutton .x
winfo class .x
-} {Checkbutton}
-test button-3.5 {ButtonCreate - setting radiobutton class} {
- catch {destroy .x}
+} -cleanup {
+ destroy .x
+} -result {Checkbutton}
+test button-2.5 {ButtonCreate - setting radiobutton class} -body {
radiobutton .x
winfo class .x
-} {Radiobutton}
-rename button gorp
-test button-3.6 {ButtonCreate - setting class} {
- catch {destroy .x}
+} -cleanup {
+ destroy .x
+} -result {Radiobutton}
+test button-2.6 {ButtonCreate - setting class} -body {
+ rename button gorp
gorp .x
winfo class .x
-} {Button}
-rename gorp button
-test button-3.7 {ButtonCreate - bad window name} {
- list [catch {button foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test button-3.8 {ButtonCreate procedure - error in default option value} {
- catch {destroy .funny}
+} -cleanup {
+ destroy .x
+ rename gorp button
+} -result {Button}
+
+test button-2.7 {ButtonCreate - bad window name} -body {
+ button foo
+} -cleanup {
+ destroy foo
+} -returnCodes {error} -result {bad window path name "foo"}
+######### test ex 3.8
+test button-2.8 {ButtonCreate procedure - error in default option value} -body {
option add *funny.background bogus
- list [catch {button .funny} msg] $msg $errorInfo
-} {1 {unknown color name "bogus"} {unknown color name "bogus"
+ button .funny
+} -cleanup {
+ option clear
+ destroy .funny
+} -returnCodes {error} -result {unknown color name "bogus"}
+test button-2.9 {ButtonCreate procedure - error in default option value} -body {
+ option add *funny.background bogus
+ catch {button .funny}
+ return $errorInfo
+} -cleanup {
+ option clear
+ destroy .funny
+} -result {unknown color name "bogus"
(database entry for "-background" in widget ".funny")
invoked from within
-"button .funny"}}
-test button-3.9 {ButtonCreate procedure - option error} {
- catch {destroy .x}
- list [catch {button .x -gorp foo} msg] $msg [winfo exists .x]
-} {1 {unknown option "-gorp"} 0}
-test button-3.10 {ButtonCreate procedure - return value} {
- catch {destroy .abcd}
+"button .funny"}
+
+test button-2.10 {ButtonCreate procedure - option error} -body {
+ button .x -gorp foo
+} -cleanup {
+ destroy .x
+} -returnCodes {error} -result {unknown option "-gorp"}
+test button-2.11 {ButtonCreate procedure - option error} -body {
+ catch {button .x -gorp foo}
+ winfo exists .x
+} -cleanup {
+ destroy .x
+} -result 0
+######### ex 3.10
+test button-2.12 {ButtonCreate procedure - return value} -body {
set x [button .abcd]
- destroy .abc
- set x
-} {.abcd}
-
-test button-4.1 {ButtonWidgetCmd - too few arguments} {
- list [catch {.b} msg] $msg
-} {1 {wrong # args: should be ".b option ?arg arg ...?"}}
-test button-4.2 {ButtonWidgetCmd - bad option name} {
- list [catch {.b c} msg] $msg
-} {1 {ambiguous option "c": must be cget, configure, flash, or invoke}}
-test button-4.3 {ButtonWidgetCmd - bad option name} {
- list [catch {.b bogus} msg] $msg
-} {1 {bad option "bogus": must be cget, configure, flash, or invoke}}
-test button-4.4 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.b cget a b} msg] $msg
-} {1 {wrong # args: should be ".b cget option"}}
-test button-4.5 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.b cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test button-4.6 {ButtonWidgetCmd procedure, "cget" option} {
- .b configure -highlightthickness 3
- .b cget -highlightthickness
-} {3}
-test button-4.7 {ButtonWidgetCmd procedure, "cget" option} {
- catch {.l cget -disabledforeground}
-} {0}
-test button-4.8 {ButtonWidgetCmd procedure, "cget" option} {
- catch {.b cget -disabledforeground}
-} {0}
-test button-4.9 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.b cget -variable} msg] $msg
-} {1 {unknown option "-variable"}}
-test button-4.10 {ButtonWidgetCmd procedure, "cget" option} {
- catch {.c cget -variable}
-} {0}
-test button-4.11 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.c cget -value} msg] $msg
-} {1 {unknown option "-value"}}
-test button-4.12 {ButtonWidgetCmd procedure, "cget" option} {
- catch {.r cget -value}
-} {0}
-test button-4.13 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.r cget -onvalue} msg] $msg
-} {1 {unknown option "-onvalue"}}
-test button-4.14 {ButtonWidgetCmd procedure, "configure" option} {
+ return $x
+} -cleanup {
+ destroy .abcd
+} -result {.abcd}
+
+######### ex 4.*
+test button-3.1 {ButtonWidgetCmd - too few arguments} -body {
+ button .b
+ .b
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {wrong # args: should be ".b option ?arg ...?"}
+test button-3.2 {ButtonWidgetCmd - bad option name} -body {
+ button .b
+ .b c
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {ambiguous option "c": must be cget, configure, flash, or invoke}
+test button-3.3 {ButtonWidgetCmd - bad option name} -body {
+ button .b
+ .b bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad option "bogus": must be cget, configure, flash, or invoke}
+test button-3.4 {ButtonWidgetCmd procedure, "cget" option} -body {
+ button .b
+ .b cget a b
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {wrong # args: should be ".b cget option"}
+test button-3.5 {ButtonWidgetCmd procedure, "cget" option} -body {
+ button .b
+ .b cget -gorp
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown option "-gorp"}
+
+#ex 4.7
+test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
+ label .l
+ .l cget -disabledforeground
+} -cleanup {
+ destroy .l
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body {
+ button .b
+ .b cget -disabledforeground
+} -cleanup {
+ destroy .b
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body {
+ button .b
+ .b cget -variable
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown option "-variable"}
+
+test button-3.9 {ButtonWidgetCmd procedure, "cget" option} -body {
+ checkbutton .c
+ .c cget -variable
+} -cleanup {
+ destroy .c
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.10 {ButtonWidgetCmd procedure, "cget" option} -body {
+ checkbutton .c
+ .c cget -value
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {unknown option "-value"}
+
+test button-3.11 {ButtonWidgetCmd procedure, "cget" option} -body {
+ radiobutton .r
+ .r cget -value
+} -cleanup {
+ destroy .r
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.12 {ButtonWidgetCmd procedure, "cget" option} -body {
+ radiobutton .r
+ .r cget -onvalue
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {unknown option "-onvalue"}
+
+# ex 4.6
+test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body {
+ button .b -highlightthickness 3
+ lindex [.b configure -highlightthickness] 4
+} -cleanup {
+ destroy .b
+} -result {3}
+test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body {
+ checkbutton .c
llength [.c configure]
-} {41}
-test button-4.15 {ButtonWidgetCmd procedure, "configure" option} {
- list [catch {.b configure -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test button-4.16 {ButtonWidgetCmd procedure, "configure" option} {
- list [catch {.b co -bg #ffffff -fg} msg] $msg
-} {1 {value for "-fg" missing}}
-test button-4.17 {ButtonWidgetCmd procedure, "configure" option} {
+} -cleanup {
+ destroy .c
+} -result {41}
+test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body {
+ button .b
+ .b configure -gorp
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown option "-gorp"}
+test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup {
+ button .b
+} -body {
+ .b co -bg #ffffff -fg
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {value for "-fg" missing}
+test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup {
+ button .b
+} -body {
.b configure -fg #123456
.b configure -bg #654321
lindex [.b configure -fg] 4
-} {#123456}
-.c configure -variable value -onvalue 1 -offvalue 0
-.r configure -variable value2 -value red
-test button-4.18 {ButtonWidgetCmd procedure, "deselect" option} {
- list [catch {.c deselect foo} msg] $msg
-} {1 {wrong # args: should be ".c deselect"}}
-test button-4.19 {ButtonWidgetCmd procedure, "deselect" option} {
- list [catch {.l deselect} msg] $msg
-} {1 {bad option "deselect": must be cget or configure}}
-test button-4.20 {ButtonWidgetCmd procedure, "deselect" option} {
- list [catch {.b deselect} msg] $msg
-} {1 {bad option "deselect": must be cget, configure, flash, or invoke}}
-test button-4.21 {ButtonWidgetCmd procedure, "deselect" option} {
- set value 1
+} -cleanup {
+ destroy .b
+} -result {#123456}
+test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ checkbutton .c
+ .c deselect foo
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {wrong # args: should be ".c deselect"}
+test button-3.19 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ label .l
+ .l deselect
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad option "deselect": must be cget or configure}
+test button-3.20 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ button .b
+ .b deselect
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad option "deselect": must be cget, configure, flash, or invoke}
+
+test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
+ set checkvar 1
.c d
- set value
-} {0}
-test button-4.22 {ButtonWidgetCmd procedure, "deselect" option} {
- set value2 green
+ return $checkvar
+} -cleanup {
+ destroy .c
+} -result {0}
+test button-3.22 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar green
.r deselect
- set value2
-} {green}
-test button-4.23 {ButtonWidgetCmd procedure, "deselect" option} {
- set value2 red
+ return $radiovar
+} -cleanup {
+ destroy .r
+} -result {green}
+test button-3.23 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar red
.r deselect
- set value2
-} {}
-test button-4.24 {ButtonWidgetCmd procedure, "deselect" option} -body {
- set value 1
- trace variable value w bogusTrace
- set result [list [catch {.c deselect} msg] $msg $errorInfo $value]
- trace vdelete value w bogusTrace
- set result
-} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted
+ return $radiovar
+} -cleanup {
+ destroy .r
+} -result {}
+
+test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
+ set checkvar 1
+ trace variable checkvar w bogusTrace
+ .c deselect
+} -cleanup {
+ destroy .c
+ trace vdelete checkvar w bogusTrace
+} -returnCodes {error} -result {can't set "checkvar": trace aborted}
+test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ checkbutton .c -variable checkvar -onvalue 1 -offvalue 0
+ set checkvar 1
+ trace variable checkvar w bogusTrace
+ catch {.c deselect}
+ list $errorInfo $checkvar
+} -cleanup {
+ trace vdelete checkvar w bogusTrace
+ destroy .c
+} -match {glob} -result {{*trace aborted
while executing
*
".c deselect"} 0}
-test button-4.25 {ButtonWidgetCmd procedure, "deselect" option} -body {
- set value2 red
- trace variable value2 w bogusTrace
- set result [list [catch {.r deselect} msg] $msg $errorInfo $value2]
- trace vdelete value2 w bogusTrace
- set result
-} -match glob -result {1 {can't set "value2": trace aborted} {*trace aborted
+test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar red
+ trace variable radiovar w bogusTrace
+ .r deselect
+} -cleanup {
+ destroy .r
+ trace vdelete radiovar w bogusTrace
+} -match {glob} -returnCodes {error} -result {can't set "radiovar": trace aborted}
+test button-3.27 {ButtonWidgetCmd procedure, "deselect" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar red
+ trace variable radiovar w bogusTrace
+ catch {.r deselect}
+ list $errorInfo $radiovar
+} -cleanup {
+ destroy .r
+ trace vdelete radiovar w bogusTrace
+} -match glob -result {{*trace aborted
while executing
*
".r deselect"} {}}
-test button-4.26 {ButtonWidgetCmd procedure, "flash" option} {
- list [catch {.b flash foo} msg] $msg
-} {1 {wrong # args: should be ".b flash"}}
-test button-4.27 {ButtonWidgetCmd procedure, "flash" option} {
- list [catch {.l flash} msg] $msg
-} {1 {bad option "flash": must be cget or configure}}
-test button-4.28 {ButtonWidgetCmd procedure, "flash" option} {
- list [catch {.b flash} msg] $msg
-} {0 {}}
-test button-4.29 {ButtonWidgetCmd procedure, "flash" option} {
- list [catch {.c flash} msg] $msg
-} {0 {}}
-test button-4.30 {ButtonWidgetCmd procedure, "flash" option} {
- list [catch {.r f} msg] $msg
-} {0 {}}
-test button-4.31 {ButtonWidgetCmd procedure, "invoke" option} {
- list [catch {.b invoke foo} msg] $msg
-} {1 {wrong # args: should be ".b invoke"}}
-test button-4.32 {ButtonWidgetCmd procedure, "invoke" option} {
- list [catch {.l invoke} msg] $msg
-} {1 {bad option "invoke": must be cget or configure}}
-test button-4.33 {ButtonWidgetCmd procedure, "invoke" option} {
+
+test button-3.28 {ButtonWidgetCmd procedure, "flash" option} -body {
+ button .b
+ .b flash foo
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {wrong # args: should be ".b flash"}
+test button-3.29 {ButtonWidgetCmd procedure, "flash" option} -body {
+ label .l
+ .l flash
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad option "flash": must be cget or configure}
+test button-3.30 {ButtonWidgetCmd procedure, "flash" option} -body {
+ button .b
+ catch {.b flash}
+} -cleanup {
+ destroy .b
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.31 {ButtonWidgetCmd procedure, "flash" option} -body {
+ checkbutton .c
+ catch {.c flash}
+} -cleanup {
+ destroy .c
+} -returnCodes {ok} -match {glob} -result {*}
+test button-3.32 {ButtonWidgetCmd procedure, "flash" option} -body {
+ radiobutton .r
+ catch {.r f}
+} -cleanup {
+ destroy .r
+} -returnCodes {ok} -match {glob} -result {*}
+
+test button-3.33 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ label .l
+ .l invoke
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad option "invoke": must be cget or configure}
+test button-3.34 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ button .b
+ .b invoke foo
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {wrong # args: should be ".b invoke"}
+test button-3.35 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ button .b
.b configure -command {set x invoked}
set x "not invoked"
.b invoke
- set x
-} {invoked}
-test button-4.34 {ButtonWidgetCmd procedure, "invoke" option} {
+ return $x
+} -cleanup {
+ destroy .b
+} -result {invoked}
+test button-3.36 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ button .b
.b configure -command {set x invoked} -state disabled
set x "not invoked"
.b invoke
- set x
-} {not invoked}
-test button-4.35 {ButtonWidgetCmd procedure, "invoke" option} {
- set value bogus
- .c configure -command {set x invoked} -variable value -onvalue 1 \
- -offvalue 0
+ return $x
+} -cleanup {
+ destroy .b
+} -result {not invoked}
+test button-3.37 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 \
+ -command {set x invoked}
+ set checkvar bogus
set x "not invoked"
.c invoke
- list $x $value
-} {invoked 1}
-test button-4.36 {ButtonWidgetCmd procedure, "invoke" option} {
- set value2 green
- .r configure -command {set x invoked} -variable value2 -value red
+ list $x $checkvar
+} -cleanup {
+ destroy .c
+} -result {invoked 1}
+test button-3.38 {ButtonWidgetCmd procedure, "invoke" option} -body {
+ radiobutton .r -command {set x invoked} -variable radiovar -value red
+ set radiovar green
set x "not invoked"
.r i
- list $x $value2
-} {invoked red}
-test button-4.37 {ButtonWidgetCmd procedure, "select" option} {
- list [catch {.l select} msg] $msg
-} {1 {bad option "select": must be cget or configure}}
-test button-4.38 {ButtonWidgetCmd procedure, "select" option} {
- list [catch {.b select} msg] $msg
-} {1 {bad option "select": must be cget, configure, flash, or invoke}}
-test button-4.39 {ButtonWidgetCmd procedure, "select" option} {
- list [catch {.c select foo} msg] $msg
-} {1 {wrong # args: should be ".c select"}}
-test button-4.40 {ButtonWidgetCmd procedure, "select" option} {
- set value bogus
- .c configure -command {} -variable value -onvalue lovely -offvalue 0
+ list $x $radiovar
+} -cleanup {
+ destroy .r
+} -result {invoked red}
+
+test button-3.39 {ButtonWidgetCmd procedure, "select" option} -body {
+ label .l
+ .l select
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad option "select": must be cget or configure}
+test button-3.40 {ButtonWidgetCmd procedure, "select" option} -body {
+ button .b
+ .b select
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad option "select": must be cget, configure, flash, or invoke}
+test button-3.41 {ButtonWidgetCmd procedure, "select" option} -body {
+ checkbutton .c
+ .c select foo
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {wrong # args: should be ".c select"}
+test button-3.42 {ButtonWidgetCmd procedure, "select" option} -body {
+ checkbutton .c -variable checkvar -onvalue lovely -offvalue 0
+ set checkvar bogus
.c s
- set value
-} {lovely}
-test button-4.41 {ButtonWidgetCmd procedure, "select" option} {
- set value2 green
- .r configure -command {} -variable value2 -value red
+ return $checkvar
+} -cleanup {
+ destroy .c
+} -result {lovely}
+test button-3.43 {ButtonWidgetCmd procedure, "select" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar green
+ .r select
+ return $radiovar
+} -cleanup {
+ destroy .r
+} -result {red}
+test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar yellow
+ trace variable radiovar w bogusTrace
.r select
- set value2
-} {red}
-test button-4.42 {ButtonWidgetCmd procedure, "select" option} -body {
- set value2 yellow
- trace variable value2 w bogusTrace
- set result [list [catch {.r select} msg] $msg $errorInfo $value2]
- trace vdelete value2 w bogusTrace
- set result
-} -match glob -result {1 {can't set "value2": trace aborted} {*trace aborted
+} -cleanup {
+ destroy .r
+ trace vdelete radiovar w bogusTrace
+} -returnCodes {error} -result {can't set "radiovar": trace aborted}
+test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body {
+ radiobutton .r -variable radiovar -value red
+ set radiovar yellow
+ trace variable radiovar w bogusTrace
+ catch {.r select}
+ list $errorInfo $radiovar
+} -cleanup {
+ destroy .r
+ trace vdelete radiovar w bogusTrace
+} -match {glob} -result {{*trace aborted
while executing
*
".r select"} red}
-test button-4.43 {ButtonWidgetCmd procedure, "toggle" option} {
- list [catch {.l toggle} msg] $msg
-} {1 {bad option "toggle": must be cget or configure}}
-test button-4.44 {ButtonWidgetCmd procedure, "toggle" option} {
- list [catch {.b toggle} msg] $msg
-} {1 {bad option "toggle": must be cget, configure, flash, or invoke}}
-test button-4.45 {ButtonWidgetCmd procedure, "toggle" option} {
- list [catch {.r toggle} msg] $msg
-} {1 {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select}}
-test button-4.46 {ButtonWidgetCmd procedure, "toggle" option} {
- list [catch {.c toggle foo} msg] $msg
-} {1 {wrong # args: should be ".c toggle"}}
-test button-4.47 {ButtonWidgetCmd procedure, "toggle" option} {
- set value bogus
- .c configure -command {} -variable value -onvalue sunshine -offvalue rain
+
+# ex 4.43
+test button-3.46 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ label .l
+ .l toggle
+} -cleanup {
+ destroy .l
+} -returnCodes {error} -result {bad option "toggle": must be cget or configure}
+test button-3.47 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ button .b
+ .b toggle
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad option "toggle": must be cget, configure, flash, or invoke}
+test button-3.48 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ radiobutton .r
+ .r toggle
+} -cleanup {
+ destroy .r
+} -returnCodes {error} -result {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select}
+test button-3.49 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ checkbutton .c
+ .c toggle foo
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {wrong # args: should be ".c toggle"}
+test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ set checkvar bogus
+ checkbutton .c -variable checkvar -onvalue sunshine -offvalue rain
.c toggle
- set result $value
+ set result $checkvar
.c toggle
- lappend result $value
+ lappend result $checkvar
.c toggle
- lappend result $value
-} {sunshine rain sunshine}
-test button-4.48 {ButtonWidgetCmd procedure, "toggle" option} -body {
- .c configure -onvalue xyz -offvalue abc
- set value xyz
- trace variable value w bogusTrace
- set result [list [catch {.c toggle} msg] $msg $errorInfo $value]
- trace vdelete value w bogusTrace
- set result
-} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted
+ lappend result $checkvar
+ return $result
+} -cleanup {
+ destroy .c
+} -result {sunshine rain sunshine}
+test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ set checkvar xyz
+ trace variable checkvar w bogusTrace
+ .c toggle
+} -cleanup {
+ destroy .c
+ trace vdelete checkvar w bogusTrace
+} -returnCodes {error} -result {can't set "checkvar": trace aborted}
+test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ set checkvar xyz
+ trace variable checkvar w bogusTrace
+ catch {.c toggle}
+ list $errorInfo $checkvar
+} -cleanup {
+ trace vdelete checkvar w bogusTrace
+ destroy .c
+} -match {glob} -result {{*trace aborted
while executing
*
".c toggle"} abc}
-test button-4.49 {ButtonWidgetCmd procedure, "toggle" option} -body {
- .c configure -onvalue xyz -offvalue abc
- set value abc
- trace variable value w bogusTrace
- set result [list [catch {.c toggle} msg] $msg $errorInfo $value]
- trace vdelete value w bogusTrace
- set result
-} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted
+test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ set checkvar abc
+ trace variable checkvar w bogusTrace
+ .c toggle
+} -cleanup {
+ trace vdelete checkvar w bogusTrace
+ destroy .c
+} -returnCodes {error} -result {can't set "checkvar": trace aborted}
+test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ set checkvar abc
+ trace variable checkvar w bogusTrace
+ catch {.c toggle}
+ list $errorInfo $checkvar
+} -cleanup {
+ trace vdelete checkvar w bogusTrace
+ destroy .c
+} -match {glob} -result {{*trace aborted
while executing
*
".c toggle"} xyz}
-test button-4.50 {ButtonWidgetCmd procedure, "toggle" option} {
- catch {unset value}; set value(1) 1;
- set result [list [catch {.c toggle} msg] $msg $errorInfo]
- unset value;
- set result
-} {1 {can't set "value": variable is array} {can't set "value": variable is array
+test button-3.55 {ButtonWidgetCmd procedure, "toggle" option} -setup {
+ unset -nocomplain checkvar
+} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ unset checkvar
+ set checkvar(1) 1
+ .c toggle
+} -cleanup {
+ destroy .c
+} -returnCodes {error} -result {can't set "checkvar": variable is array}
+test button-3.56 {ButtonWidgetCmd procedure, "toggle" option} -setup {
+ unset -nocomplain checkvar
+} -body {
+ checkbutton .c -variable checkvar -onvalue xyz -offvalue abc
+ unset checkvar
+ set checkvar(1) 1
+ catch {.c toggle}
+ return $errorInfo
+} -cleanup {
+ destroy .c
+} -match {glob} -result {can't set "checkvar": variable is array
while executing
-".c toggle"}}
+".c toggle"}
-test button-5.1 {DestroyButton procedure} testImageType {
+test button-4.1 {DestroyButton procedure} -constraints {
+ testImageType
+} -setup {
image create test image1
+ unset -nocomplain x
+} -body {
button .b1 -image image1
button .b2 -fg #ff0000 -text "Button 2"
button .b3 -state active -text "Button 3"
@@ -435,402 +3209,709 @@ test button-5.1 {DestroyButton procedure} testImageType {
checkbutton .b5 -variable x -text "Checkbutton 5"
set x 1
pack .b1 .b2 .b3 .b4 .b5
- update
- deleteWindows
-} {}
-
-test button-6.1 {ConfigureButton - textvariable trace} {
- catch {destroy .b1}
- button .b1 -bd 4 -bg green
- catch {.b1 configure -bd 7 -bg green -fg bogus}
- list [catch {.b1 configure -bd 7 -bg red -fg bogus} msg] \
- $msg [.b1 cget -bd] [.b1 cget -bg]
-} {1 {unknown color name "bogus"} 4 green}
-test button-6.2 {ConfigureButton - textvariable trace} {
- catch {destroy .b1}
+ update
+ deleteWindows
+} -cleanup {
+ destroy .b1 .b2 .b3 .b4 .b5
+ image delete image1
+} -result {}
+
+test button-5.1 {ConfigureButton - textvariable trace} -body {
+ button .b -bd 4 -bg green
+ .b configure -bd 7 -bg red -fg bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {unknown color name "bogus"}
+test button-5.2 {ConfigureButton - textvariable trace} -body {
+ button .b -bd 4 -bg green
+ catch {.b configure -bd 7 -bg red -fg bogus}
+ list [.b cget -bd] [.b cget -bg]
+} -cleanup {
+ destroy .b
+} -result {4 green}
+test button-5.3 {ConfigureButton - textvariable trace} -body {
+ button .b -textvariable x
set x From-x
set y From-y
- button .b1 -textvariable x
- .b1 configure -textvariable y
+ .b configure -textvariable y
set x New
- lindex [.b1 configure -text] 4
-} {From-y}
-test button-6.2a {ConfigureButton - variable traces} {
- catch {destroy .b1}
- catch {unset x}
- checkbutton .b1 -variable x
+ lindex [.b configure -text] 4
+} -cleanup {
+ destroy .b
+} -result {From-y}
+test button-5.4 {ConfigureButton - variable trace} -body { ;# ex 6.2a
+ checkbutton .c -variable x
set x 1
set y 1
- .b1 configure -textvariable y
+ .c configure -textvariable y
set x 0
- .b1 toggle
- set y
-} {1}
-test button-6.3 {ConfigureButton - image handling} testImageType {
- catch {destroy .b1}
- eval image delete [image names]
+ .c toggle
+ return $y
+} -cleanup {
+ destroy .c
+} -result {1}
+
+test button-5.5 {ConfigureButton - image handling} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
image create test image1
image create test image2
- button .b1 -image image1
+} -body {
+ button .b -image image1
image delete image1
- .b1 configure -image image2
- image names
-} {image2}
-test button-6.5 {ConfigureButton - default value for variable} {
- catch {destroy .b1}
- checkbutton .b1
- .b1 cget -variable
-} {b1}
-test button-6.6 {ConfigureButton - setting selected state from variable} {
- catch {destroy .b1}
+ .b configure -image image2
+ imageNames
+} -cleanup {
+ destroy .b
+ imageCleanup
+} -result {image2}
+
+test button-5.6 {ConfigureButton - default value for variable} -body {
+ checkbutton .c
+ .c cget -variable
+} -cleanup {
+ destroy .c
+} -result {c}
+test button-5.7 {ConfigureButton - setting selected state from variable} -body {
set x 0
set y Shiny
- checkbutton .b1 -variable x
- .b1 configure -variable y -onvalue Shiny
- .b1 toggle
- set y
-} 0
-test button-6.7 {ConfigureButton - setting selected state from variable} {
- catch {destroy .b1}
- catch {unset x}
- checkbutton .b1 -variable x -offvalue Bogus
- set x
-} Bogus
-test button-6.8 {ConfigureButton - setting selected state from variable} {
- catch {destroy .b1}
- catch {unset x}
- radiobutton .b1 -variable x
- set x
-} {}
-test button-6.9 {ConfigureButton - error in setting variable} {
- catch {destroy .b1}
- catch {unset x}
+ checkbutton .c -variable x
+ .c configure -variable y -onvalue Shiny
+ .c toggle
+ return $y
+} -cleanup {
+ destroy .c
+} -result {0}
+test button-5.8 {ConfigureButton - setting selected state from variable} -setup {
+ unset -nocomplain x
+} -body {
+ checkbutton .c -variable x -offvalue Bogus
+ return $x
+} -cleanup {
+ destroy .c
+} -result {Bogus}
+
+test button-5.9 {ConfigureButton - setting selected state from variable} -setup {
+ unset -nocomplain x
+} -body {
+ radiobutton .r -variable x
+ return $x
+} -cleanup {
+ destroy .r
+} -result {}
+
+test button-5.10 {ConfigureButton - error in setting variable} -setup {
+ unset -nocomplain x
+} -body {
trace variable x w bogusTrace
- set result [list [catch {radiobutton .b1 -variable x} msg] $msg]
+ radiobutton .r -variable x
+} -cleanup {
+ destroy .r
trace vdelete x w bogusTrace
- set result
-} {1 {can't set "x": trace aborted}}
-test button-6.10 {ConfigureButton - bad image name} {
- catch {destroy .b1}
- list [catch {button .b1 -image bogus} msg] $msg
-} {1 {image "bogus" doesn't exist}}
-test button-6.11 {ConfigureButton - setting variable from current text value} {
- catch {destroy .b1}
- catch {unset x}
- button .b1 -textvariable x -text "Button 1"
- set x
-} {Button 1}
-test button-6.12 {ConfigureButton - using current value of variable} {
- catch {destroy .b1}
+} -returnCodes {error} -result {can't set "x": trace aborted}
+
+test button-5.11 {ConfigureButton - bad image name} -body {
+ button .b -image bogus
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {image "bogus" doesn't exist}
+
+test button-5.12 {ConfigureButton - setting variable from current text value} -setup {
+ unset -nocomplain x
+} -body {
+ button .b -textvariable x -text "Button 1"
+ return $x
+} -cleanup {
+ destroy .b
+} -result {Button 1}
+
+test button-5.13 {ConfigureButton - using current value of variable} -body {
set x Override
- button .b1 -textvariable x -text "Button 1"
- set x
-} {Override}
-test button-6.13 {ConfigureButton - variable handling} {
- catch {destroy .b1}
- catch {unset x}
+ button .b -textvariable x -text "Button 1"
+ return $x
+} -cleanup {
+ destroy .b
+} -result {Override}
+
+test button-5.14 {ConfigureButton - variable handling} -setup {
+ unset -nocomplain x
+} -body {
+ trace variable x w bogusTrace
+ radiobutton .r -text foo -textvariable x
+} -cleanup {
+ trace vdelete x w bogusTrace
+ destroy .r
+} -returnCodes {error} -result {can't set "x": trace aborted}
+test button-5.15 {ConfigureButton - variable handling} -setup {
+ unset -nocomplain x
+} -body {
trace variable x w bogusTrace
- set result [list [catch {radiobutton .b1 -text foo -textvariable x} msg] \
- $msg $x]
+ catch {radiobutton .r -text foo -textvariable x}
+ return $x
+} -cleanup {
trace vdelete x w bogusTrace
- set result
-} {1 {can't set "x": trace aborted} foo}
-test button-6.14 {ConfigureButton - -width option} {
- catch {destroy .b1}
- button .b1 -text "Button 1"
- list [catch {.b1 configure -width 1i} msg] $msg $errorInfo
-} {1 {expected integer but got "1i"} {expected integer but got "1i"
+ destroy .r
+} -result {foo}
+
+#ex 6.14
+test button-5.16 {ConfigureButton - -width option} -body {
+ button .b -text "Button 1"
+ .b configure -width 1i
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "1i"}
+test button-5.17 {ConfigureButton - -width option} -body {
+ button .b -text "Button 1"
+ catch {.b configure -width 1i}
+ return $errorInfo
+} -cleanup {
+ destroy .b
+} -result {expected integer but got "1i"
(processing -width option)
invoked from within
-".b1 configure -width 1i"}}
-test button-6.15 {ConfigureButton - -height option} {
- catch {destroy .b1}
- button .b1 -text "Button 1"
- list [catch {.b1 configure -height 0.5c} msg] $msg $errorInfo
-} {1 {expected integer but got "0.5c"} {expected integer but got "0.5c"
+".b configure -width 1i"}
+test button-5.18 {ConfigureButton - -height option} -body {
+ button .b -text "Button 1"
+ .b configure -height 0.5c
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {expected integer but got "0.5c"}
+test button-5.19 {ConfigureButton - -height option} -body {
+ button .b -text "Button 1"
+ catch {.b configure -height 0.5c}
+ return $errorInfo
+} -cleanup {
+ destroy .b
+} -result {expected integer but got "0.5c"
(processing -height option)
invoked from within
-".b1 configure -height 0.5c"}}
-test button-6.16 {ConfigureButton - -width option} {
- catch {destroy .b1}
- button .b1 -bitmap questhead
- list [catch {.b1 configure -width abc} msg] $msg $errorInfo
-} {1 {bad screen distance "abc"} {bad screen distance "abc"
+".b configure -height 0.5c"}
+#ex 6.16
+test button-5.20 {ConfigureButton - -width option} -body {
+ button .b -bitmap questhead
+ .b configure -width abc
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad screen distance "abc"}
+test button-5.21 {ConfigureButton - -width option} -body {
+ button .b -bitmap questhead
+ catch {.b configure -width abc}
+ return $errorInfo
+} -cleanup {
+ destroy .b
+} -result {bad screen distance "abc"
(processing -width option)
invoked from within
-".b1 configure -width abc"}}
-test button-6.17 {ConfigureButton - -height option} testImageType {
- catch {destroy .b1}
- eval image delete [image names]
+".b configure -width abc"}
+test button-5.22 {ConfigureButton - -height option} -constraints {
+ testImageType
+} -setup {
image create test image1
- button .b1 -image image1
- list [catch {.b1 configure -height 0.5x} msg] $msg $errorInfo
-} {1 {bad screen distance "0.5x"} {bad screen distance "0.5x"
+} -body {
+ button .b -image image1
+ .b configure -height 0.5x
+} -cleanup {
+ destroy .b
+ image delete image1
+} -returnCodes {error} -result {bad screen distance "0.5x"}
+test button-5.23 {ConfigureButton - -height option} -constraints {
+ testImageType
+} -setup {
+ image create test image1
+} -body {
+#ztestImageType
+ button .b -image image1
+ catch {.b configure -height 0.5x}
+ return $errorInfo
+} -cleanup {
+ destroy .b
+ image delete image1
+} -result {bad screen distance "0.5x"
(processing -height option)
invoked from within
-".b1 configure -height 0.5x"}}
-test button-6.18 {ConfigureButton - computing geometry} {nonPortable fonts} {
- catch {destroy .b1}
- button .b1 -text "Sample text" -width 10 -height 2
- pack .b1
- set result "[winfo reqwidth .b1] [winfo reqheight .b1]"
- .b1 configure -bitmap questhead
- lappend result [winfo reqwidth .b1] [winfo reqheight .b1]
-} {102 46 20 12}
-test button-6.19 {ConfigureButton - computing geometry} {
- catch {destroy .b1}
- button .b1 -text "Button 1"
- set old [winfo reqwidth .b1]
- .b1 configure -text "Much longer text"
- set new [winfo reqwidth .b1]
- expr $old == $new
-} {0}
-
-test button-7.1 {ButtonEventProc procedure} {
- catch {destroy .b1}
- button .b1 -text "Test Button" -command {
- destroy .b1
- set x [list [winfo exists .b1] [info commands .b1]]
- }
- .b1 invoke
- set x
-} {0 {}}
-test button-7.2 {ButtonEventProc procedure} {
- deleteWindows
+".b configure -height 0.5x"}
+#ex 6.18
+test button-5.24 {ConfigureButton - computing geometry} -constraints {
+ fonts
+} -body {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ .b configure -text "Sample text" -width 10 -height 2
+ pack .b
+ set result "[winfo reqwidth .b] [winfo reqheight .b]"
+ .b configure -bitmap questhead
+ lappend result [winfo reqwidth .b] [winfo reqheight .b]
+} -cleanup {
+ destroy .b
+} -result {104 46 20 12}
+
+test button-5.25 {ConfigureButton - computing geometry} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+} -body {
+ .b configure -text "Button 1"
+ set old [winfo reqwidth .b]
+ .b configure -text "Much longer text"
+ set new [winfo reqwidth .b]
+ expr {$old == $new}
+} -cleanup {
+ destroy .b
+} -result {0}
+
+test button-6.1 {ButtonEventProc procedure} -body {
+ button .b -text "Test Button" -command {
+ destroy .b
+ set x [list [winfo exists .b] [info commands .b]]
+}
+ .b invoke
+ return $x
+} -cleanup {
+ destroy .b
+} -result {0 {}}
+
+test button-6.2 {ButtonEventProc procedure} -setup {
+ set x {}
+} -body {
button .b1 -bg #543210
rename .b1 .b2
- set x {}
lappend x [winfo children .]
lappend x [.b2 cget -bg]
destroy .b1
lappend x [info command .b*] [winfo children .]
-} {.b1 #543210 {} {}}
+} -cleanup {
+ destroy .b1
+} -result {.b1 #543210 {} {}}
-test button-8.1 {ButtonCmdDeletedProc procedure} {
- deleteWindows
- button .b1
- rename .b1 {}
+test button-7.1 {ButtonCmdDeletedProc procedure} -body {
+ button .b
+ rename .b {}
list [info command .b*] [winfo children .]
-} {{} {}}
+} -cleanup {
+ destroy .b
+} -result {{} {}}
-test button-9.1 {TkInvokeButton procedure} {
- catch {destroy .b1}
+test button-8.1 {TkInvokeButton procedure} -setup {
set x 0
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set result $x
- .b1 invoke
+ .c invoke
lappend result $x
- .b1 invoke
+ .c invoke
lappend result $x
-} {0 1 0}
-test button-9.2 {TkInvokeButton procedure} {
- catch {destroy .b1}
+} -cleanup {
+ destroy .c
+} -result {0 1 0}
+
+test button-8.2 {TkInvokeButton procedure} -setup {
+ set x 0
+} -body {
+ checkbutton .c -variable x
+ trace variable x w bogusTrace
+ .c invoke
+} -cleanup {
+ destroy .c
+ trace vdelete x w bogusTrace
+} -returnCodes {error} -result {can't set "x": trace aborted}
+test button-8.3 {TkInvokeButton procedure} -setup {
set x 0
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
trace variable x w bogusTrace
- set result [list [catch {.b1 invoke} msg] $msg $x]
+ catch {.c invoke}
+ return $x
+} -cleanup {
+ destroy .c
trace vdelete x w bogusTrace
- set result
-} {1 {can't set "x": trace aborted} 1}
-test button-9.3 {TkInvokeButton procedure} {
- catch {destroy .b1}
+} -result {1}
+test button-8.4 {TkInvokeButton procedure} -setup {
set x 1
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
trace variable x w bogusTrace
- set result [list [catch {.b1 invoke} msg] $msg $x]
+ .c invoke
+} -cleanup {
+ destroy .c
+ trace vdelete x w bogusTrace
+} -returnCodes {error} -result {can't set "x": trace aborted}
+test button-8.5 {TkInvokeButton procedure} -setup {
+ set x 1
+} -body {
+ checkbutton .c -variable x
+ trace variable x w bogusTrace
+ catch {.c invoke}
+ return $x
+} -cleanup {
+ destroy .c
trace vdelete x w bogusTrace
- set result
-} {1 {can't set "x": trace aborted} 0}
-test button-9.4 {TkInvokeButton procedure} {
- catch {destroy .b1}
+} -result {0}
+
+test button-8.6 {TkInvokeButton procedure} -setup {
set x 0
- radiobutton .b1 -variable x -value red
+} -body {
+ radiobutton .r -variable x -value red
set result $x
- .b1 invoke
+ .r invoke
lappend result $x
- .b1 invoke
+ .r invoke
lappend result $x
-} {0 red red}
-test button-9.5 {TkInvokeButton procedure} -body {
- catch {destroy .b1}
- radiobutton .b1 -variable x -value red
+} -cleanup {
+ destroy .r
+} -result {0 red red}
+
+test button-8.7 {TkInvokeButton procedure} -body {
+ radiobutton .r -variable x -value red
+ set x green
+ trace variable x w bogusTrace
+ .r invoke
+} -cleanup {
+ destroy .r
+ trace vdelete x w bogusTrace
+} -returnCodes {error} -result {can't set "x": trace aborted}
+test button-8.8 {TkInvokeButton procedure} -body {
+ radiobutton .r -variable x -value red
set x green
trace variable x w bogusTrace
- set result [list [catch {.b1 invoke} msg] $msg $errorInfo $x]
+ catch {.r invoke}
+ list $errorInfo $x
+} -cleanup {
+ destroy .r
trace vdelete x w bogusTrace
- set result
-} -match glob -result {1 {can't set "x": trace aborted} {*trace aborted
+} -match {glob} -result {{*trace aborted
while executing
*
-".b1 invoke"} red}
-test button-9.6 {TkInvokeButton procedure} {
- deleteWindows
+".r invoke"} red}
+
+#ex 9.6
+test button-8.9 {TkInvokeButton procedure} -setup {
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} {
- deleteWindows
+} -body {
+ button .b -command {set result invoked}
+ set msg [.b invoke]
+ list $msg $result
+} -cleanup {
+ destroy .b
+} -result {invoked invoked}
+test button-8.10 {TkInvokeButton procedure} -setup {
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} {
- deleteWindows
+} -body {
+ checkbutton .c -variable x -command {set result "invoked $x"}
+ set msg [.c invoke]
+ list $msg $result
+} -cleanup {
+ destroy .c
+} -result {{invoked 1} {invoked 1}}
+test button-8.11 {TkInvokeButton procedure} -setup {
set result untouched
set x 0
- radiobutton .b1 -variable x -value red -command {set result "invoked $x"}
- list [catch {.b1 invoke} msg] $msg $result
-} {0 {invoked red} {invoked red}}
+} -body {
+ radiobutton .r -variable x -value red -command {set result "invoked $x"}
+ set msg [.r invoke]
+ list $msg $result
+} -cleanup {
+ destroy .r
+} -result {{invoked red} {invoked red}}
-test button-10.1 {ButtonVarProc procedure} {
- deleteWindows
+test button-9.1 {ButtonVarProc procedure} -body {
set x 1
- checkbutton .b1 -variable x
+ checkbutton .c -variable x
unset x
set result [info exists x]
- .b1 toggle
+ .c toggle
lappend result $x
set x 0
- .b1 toggle
+ .c toggle
lappend result $x
-} {0 1 1}
-test button-10.2 {ButtonVarProc procedure} {
- deleteWindows
+} -cleanup {
+ destroy .c
+} -result {0 1 1}
+test button-9.2 {ButtonVarProc procedure} -body {
set x 0
- checkbutton .b1 -variable x
+ checkbutton .c -variable x
set x 44
- .b1 toggle
- set x
-} {1}
-test button-10.3 {ButtonVarProc procedure} {
- deleteWindows
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {1}
+test button-9.3 {ButtonVarProc procedure} -setup {
set x 1
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set x 44
- .b1 toggle
- set x
-} {1}
-test button-10.4 {ButtonVarProc procedure} {
- deleteWindows
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {1}
+test button-9.4 {ButtonVarProc procedure} -setup {
set x 0
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set x 1
- .b1 toggle
- set x
-} {0}
-test button-10.5 {ButtonVarProc procedure} {
- deleteWindows
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {0}
+test button-9.5 {ButtonVarProc procedure} -setup {
set x 1
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set x 1
- .b1 toggle
- set x
-} {0}
-test button-10.6 {ButtonVarProc procedure} {
- deleteWindows
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {0}
+test button-9.6 {ButtonVarProc procedure} -setup {
set x 0
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set x 0
- .b1 toggle
- set x
-} {1}
-test button-10.7 {ButtonVarProc procedure} {
- deleteWindows
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {1}
+test button-9.7 {ButtonVarProc procedure} -setup {
set x 1
- checkbutton .b1 -variable x
+} -body {
+ checkbutton .c -variable x
set x 0
- .b1 toggle
- set x
-} {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.
- deleteWindows
- catch {unset a}
- checkbutton .b1 -variable a
+ .c toggle
+ return $x
+} -cleanup {
+ destroy .c
+} -result {1}
+test button-9.8 {ButtonVarProc procedure, can't read variable} -setup {
+# This test does nothing but produce a core dump if there's a prbblem.
+ unset -nocomplain a
+} -body {
+ checkbutton .c -variable a
unset a
set a(32) 0
unset a
-} {}
+} -cleanup {
+ destroy .c
+} -result {}
-test button-11.1 {ButtonTextVarProc procedure} {
- deleteWindows
+test button-10.1 {ButtonTextVarProc procedure} -body {
set x Label
- button .b1 -textvariable x
+ button .b -textvariable x
unset x
- set result [list $x [lindex [.b1 configure -text] 4]]
+ set result [list $x [.b cget -text]]
set x New
- lappend result [lindex [.b1 configure -text] 4]
-} {Label Label New}
-test button-11.2 {ButtonTextVarProc procedure} {
- deleteWindows
- # Windows buttons have a default min width, so we have to
- # set this to be longer to force the wider button.
+ lappend result [.b cget -text]
+} -cleanup {
+ destroy .b
+} -result {Label Label New}
+test button-10.2 {ButtonTextVarProc procedure} -setup {
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+} -body {
+# 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]
+ .b configure -textvariable x
+ set old [winfo reqwidth .b]
set x New
- set new [winfo reqwidth .b1]
- list [lindex [.b1 configure -text] 4] [expr $old == $new]
-} {New 0}
+ set new [winfo reqwidth .b]
+ expr {$old == $new}
+} -cleanup {
+ destroy .b
+} -result {0}
-test button-12.1 {ButtonImageProc procedure} testImageType {
- deleteWindows
- eval image delete [image names]
+test button-11.1 {ButtonImageProc procedure} -constraints {
+ testImageType
+} -setup {
+ label .l -highlightthickness 0 -font {Helvetica -12 bold}
image create test image1
- label .b1 -image image1 -padx 0 -pady 0 -bd 0
- pack .b1
- set result "[winfo reqwidth .b1] [winfo reqheight .b1]"
+} -body {
+ .l configure -image image1 -padx 0 -pady 0 -bd 0
+ pack .l
+ set result "[winfo reqwidth .l] [winfo reqheight .l]"
image1 changed 0 0 0 0 80 100
- lappend result [winfo reqwidth .b1] [winfo reqheight .b1]
-} {30 15 80 100}
-
-deleteWindows
-set l [interp hidden]
+ lappend result [winfo reqwidth .l] [winfo reqheight .l]
+} -cleanup {
+ destroy .l
+ image delete image1
+} -result {30 15 80 100}
-test button-13.1 {button widget vs hidden commands} {
- catch {destroy .b}
+test button-12.1 {button widget vs hidden commands} -body {
button .b -text hello
+ set l [interp hidden]
interp hide {} .b
destroy .b
- list [winfo children .] [interp hidden]
-} [list {} $l]
-
-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
+
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 == $res2}
+} -cleanup {
+ destroy .b
+} -result {1}
+
+test button-13.1 {size behaviouor: label} -setup {
+ label .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ label .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ label .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+test button-13.2 {size behaviouor: label} -setup {
+ label .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ label .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ label .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+test button-13.3 {size behaviouor: button} -setup {
+ button .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ button .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+test button-13.4 {size behaviouor: button} -setup {
+ button .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ button .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ button .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+test button-13.5 {size behaviouor: radiobutton} -setup {
+ radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+test button-13.6 {size behaviouor: radiobutton} -setup {
+ radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+test button-13.7 {size behaviouor: checkbutton} -setup {
+ checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+test button-13.8 {size behaviouor: checkbutton} -setup {
+ checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20}
+ set result {}
+} -body {
+ .a configure -text Hej
+ .b configure -text Hej -width 10 -height 1
+ .c configure -text "" -width 10 -height 1
+
+# With -width, width should not be affected by text change
+ lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+# With -height, height should not be affected by text change
+ lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+# A one line text should be as high as -height 1
+ lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+} -cleanup {
+ destroy .a .b .c
+} -result {1 1 1}
+
+imageFinish
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/canvImg.test b/tests/canvImg.test
index 1dffc5e..776d268 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -7,103 +7,161 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
-eval image delete [image names]
+# Canvas used in every test case of the whole file
canvas .c
pack .c
update
-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
+
+
+test canvImg-1.1 {options for image items} -body {
.c create image 50 50 -anchor nw -tags i1
.c itemconfigure i1 -anchor
-} {-anchor {} {} center nw}
-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} testImageType {
- .c delete all
+} -cleanup {
+ .c delete all
+} -result {-anchor {} {} center nw}
+test canvImg-1.2 {options for image items} -body {
+ .c create image 50 50 -anchor gorp -tags i1
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {bad anchor position "gorp": must be n, ne, e, se, s, sw, w, nw, or center}
+test canvImg-1.3 {options for image items} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.c create image 50 50 -image foo -tags i1
.c itemconfigure i1 -image
-} {-image {} {} {} foo}
-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} testImageType {
- .c delete all
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {-image {} {} {} foo}
+test canvImg-1.4 {options for image items} -body {
+ .c create image 50 50 -image unknown -tags i1
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {image "unknown" doesn't exist}
+test canvImg-1.5 {options for image items} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.c create image 50 50 -image foo -tags {i1 foo}
.c itemconfigure i1 -tags
-} {-tags {} {} {} {i1 foo}}
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {-tags {} {} {} {i1 foo}}
-test canvImg-2.1 {CreateImage procedure} {
- list [catch {.c create image 40} msg] $msg
-} {1 {wrong # coordinates: expected 2, got 1}}
-test canvImg-2.2 {CreateImage procedure} {
- list [catch {.c create image 40 50 60} msg] $msg
-} {1 {unknown option "60"}}
-test canvImg-2.3 {CreateImage procedure} {
+test canvImg-2.1 {CreateImage procedure} -body {
+ .c create image 40
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1}
+test canvImg-2.2 {CreateImage procedure} -body {
+ .c create image 40 50 60
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {unknown option "60"}
+test canvImg-2.3 {CreateImage procedure} -body {
.c delete all
set i [.c create image 50 50]
list [lindex [.c itemconf $i -anchor] 4] \
[lindex [.c itemconf $i -image] 4] \
[lindex [.c itemconf $i -tags] 4]
-} {center {} {}}
-test canvImg-2.4 {CreateImage procedure} {
- list [catch {.c create image xyz 40} msg] $msg
-} {1 {bad screen distance "xyz"}}
-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} testImageType {
- list [catch {.c create image 50 50 -gorp foo} msg] $msg
-} {1 {unknown option "-gorp"}}
-
-test canvImg-3.1 {ImageCoords procedure} testImageType {
+} -cleanup {
.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} testImageType {
+} -result {center {} {}}
+test canvImg-2.4 {CreateImage procedure} -body {
+ .c create image xyz 40
+} -cleanup {
.c delete all
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test canvImg-2.5 {CreateImage procedure} -body {
+ .c create image 50 qrs
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {bad screen distance "qrs"}
+test canvImg-2.6 {CreateImage procedure} -constraints testImageType -body {
+ .c create image 50 50 -gorp foo
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {unknown option "-gorp"}
+
+
+test canvImg-3.1 {ImageCoords procedure} -constraints testImageType -setup {
+ image create test foo
+} -body {
+ .c create image 50 100 -image foo -tags i1
+ format {%.6g %.6g} {*}[.c coords i1]
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {50 100}
+test canvImg-3.2 {ImageCoords procedure} -constraints testImageType -setup {
+ image create test foo
+} -body {
.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} testImageType {
+ .c coords i1 dumb 100
+} -cleanup {
+ .c delete all
+ image delete foo
+} -returnCodes {error} -result {bad screen distance "dumb"}
+test canvImg-3.3 {ImageCoords procedure} -constraints testImageType -setup {
+ image create test foo
+} -body {
.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} testImageType {
+ .c coords i1 250 dumb0
+} -cleanup {
+ .c delete all
+ image delete foo
+} -returnCodes {error} -result {bad screen distance "dumb0"}
+test canvImg-3.4 {ImageCoords procedure} -constraints testImageType -setup {
+ image create test foo
+} -body {
.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} testImageType {
+ .c coords i1 250
+} -cleanup {
+ .c delete all
+ image delete foo
+} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1}
+test canvImg-3.5 {ImageCoords procedure} -constraints testImageType -setup {
+ image create test foo
+} -body {
.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}}
+ .c coords i1 250 300 400
+} -cleanup {
+ .c delete all
+ image delete foo
+} -returnCodes {error} -result {wrong # coordinates: expected 0 or 2, got 3}
+
-test canvImg-4.1 {ConfiugreImage procedure} testImageType {
+test canvImg-4.1 {ConfiugreImage procedure} -constraints testImageType -setup {
.c delete all
+} -body {
+ image create test foo -variable x
.c create image 50 100 -image foo -tags i1
update
set x {}
.c itemconfigure i1 -image {}
update
list $x [.c bbox i1]
-} {{{foo free}} {}}
-test canvImg-4.2 {ConfiugreImage procedure} testImageType {
- .c delete all
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {{{foo free}} {}}
+test canvImg-4.2 {ConfiugreImage procedure} -constraints testImageType -setup {
+ .c delete all
+} -body {
+ image create test foo -variable x
+ image create test foo2 -variable y
+ foo2 changed 0 0 0 0 80 60
.c create image 50 100 -image foo -tags i1 -anchor nw
update
set x {}
@@ -111,281 +169,628 @@ test canvImg-4.2 {ConfiugreImage procedure} testImageType {
.c itemconfigure i1 -image foo2
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} testImageType {
- .c delete all
+} -cleanup {
+ .c delete all
+ image delete foo
+ image delete foo2
+} -result {{{foo free}} {{foo2 get} {foo2 display 0 0 80 60 30 30}} {50 100 130 160}}
+test canvImg-4.3 {ConfiugreImage procedure} -constraints testImageType -setup {
+ .c delete all
+} -body {
+ image create test foo -variable x
+ image create test foo2 -variable y
+ foo2 changed 0 0 0 0 80 60
.c create image 50 100 -image foo -tags i1 -anchor nw
update
set x {}
set y {}
- list [catch {.c itemconfigure i1 -image lousy} msg] $msg
-} {1 {image "lousy" doesn't exist}}
+ .c itemconfigure i1 -image lousy
+} -cleanup {
+ .c delete all
+ image delete foo foo2
+} -returnCodes {error} -result {image "lousy" doesn't exist}
-test canvImg-5.1 {DeleteImage procedure} testImageType {
- image create test xyzzy -variable z
+
+test canvImg-5.1 {DeleteImage procedure} -constraints testImageType -setup {
.c delete all
+ imageCleanup
+} -body {
+ image create test foo -variable x
+ image create test foo2 -variable y
+ image create test xyzzy -variable z
.c create image 50 100 -image xyzzy -tags i1
update
- set names [lsort [image names]]
+ set names [lsort [imageNames]]
image delete xyzzy
set z {}
- set names2 [lsort [image names]]
+ set names2 [lsort [imageNames]]
.c delete i1
update
- list $names $names2 $z [lsort [image names]]
-} {{foo foo2 xyzzy} {foo foo2} {} {foo foo2}}
-test canvImg-5.2 {DeleteImage procedure (don't delete non-existent image)} {
+ list $names $names2 $z [lsort [imageNames]]
+} -cleanup {
+ imageCleanup
+ .c delete all
+} -result {{foo foo2 xyzzy} {foo foo2} {} {foo foo2}}
+test canvImg-5.2 {DeleteImage procedure (don't delete non-existent image)} -body {
.c delete all
.c create image 50 100 -tags i1
update
.c delete i1
update
-} {}
+} -result {}
+
-test canvImg-6.1 {ComputeImageBbox procedure} testImageType {
+test canvImg-6.1 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
.c delete all
+} -body {
.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} testImageType {
+} -cleanup {
.c delete all
+ imageCleanup
+} -result {16 18 46 33}
+test canvImg-6.2 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.c create image 15.49 17.49 -image foo -tags i1 -anchor nw
.c bbox i1
-} {15 17 45 32}
-test canvImg-6.3 {ComputeImageBbox procedure} {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {15 17 45 32}
+test canvImg-6.3 {ComputeImageBbox procedure} -setup {
.c delete all
+} -body {
.c create image 20 30 -tags i1 -anchor nw
.c bbox i1
-} {}
-test canvImg-6.4 {ComputeImageBbox procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-6.4 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {20 30 50 45}
+test canvImg-6.5 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {5 30 35 45}
+test canvImg-6.6 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {-10 30 20 45}
+test canvImg-6.7 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {-10 23 20 38}
+test canvImg-6.8 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {-10 15 20 30}
+test canvImg-6.9 {ComputeImageBbox procedure} -constraints testImageType -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {5 15 35 30}
+test canvImg-6.10 {ComputeImageBbox procedure} -constraints {
+ testImageType
+} -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {20 15 50 30}
+test canvImg-6.11 {ComputeImageBbox procedure} -constraints {
+ testImageType
+} -setup {
+ image create test foo
+ .c delete all
+} -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {20 23 50 38}
+test canvImg-6.12 {ComputeImageBbox procedure} -constraints {
+ testImageType
+} -setup {
+ image create test foo
+ .c delete all
+} -body {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor center
.c bbox i1
-} {5 23 35 38}
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {5 23 35 38}
# 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 testImageType} {
+test canvImg-7.1 {DisplayImage procedure} -constraints {
+ nonPortable testImageType
+} -setup {
.c delete all
+} -body {
+ image create test foo -variable x
.c create image 50 100 -image foo -tags i1 -anchor nw
update
set x {}
.c create rect 55 110 65 115 -width 1 -outline black -fill white
update
set x
-} {{foo display 4 9 12 6 30 30}}
-test canvImg-7.2 {DisplayImage procedure, no image} {
+} -result {{foo display 4 9 12 6 30 30}}
+test canvImg-7.2 {DisplayImage procedure, no image} -body {
.c delete all
.c create image 50 100 -tags i1
update
.c create rect 55 110 65 115 -width 1 -outline black -fill white
update
-} {}
+} -result {}
-.c delete all
+
+# image used in 8.* test cases
if {[testConstraint testImageType]} {
- .c create image 50 100 -image foo -tags image -anchor nw
+ image create test foo
}
-.c create rect 10 10 20 20 -tags rect -fill black -width 0 -outline {}
-foreach check {
- {canvImg-8.1 {50 70 80 81} {70 90} rect}
- {canvImg-8.2 {50 70 80 79} {70 90} image}
- {canvImg-8.3 {99 70 110 81} {90 90} rect}
- {canvImg-8.4 {101 70 110 79} {90 90} image}
- {canvImg-8.5 {99 100 110 115} {90 110} rect}
- {canvImg-8.6 {101 100 110 115} {90 110} image}
- {canvImg-8.7 {99 134 110 145} {90 125} rect}
- {canvImg-8.8 {101 136 110 145} {90 125} image}
- {canvImg-8.9 {50 134 80 145} {70 125} rect}
- {canvImg-8.10 {50 136 80 145} {70 125} image}
- {canvImg-8.11 {20 134 31 145} {40 125} rect}
- {canvImg-8.12 {20 136 29 145} {40 125} image}
- {canvImg-8.13 {20 100 31 115} {40 110} rect}
- {canvImg-8.14 {20 100 29 115} {40 110} image}
- {canvImg-8.15 {20 70 31 80} {40 90} rect}
- {canvImg-8.16 {20 70 29 79} {40 90} image}
- {canvImg-8.17 {60 70 69 109} {70 110} image}
- {canvImg-8.18 {60 70 71 111} {70 110} rect}
-} {
- lassign $check name rectCoords testPoint result
- test $name {ImageToPoint procedure} testImageType {
- .c coords rect {*}$rectCoords
- .c gettags [.c find closest {*}$testPoint]
- } $result
-}
-
+test canvImg-8.1 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect 50 70 80 81
+ .c gettags [.c find closest 70 90]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.2 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{50 70 80 79}
+ .c gettags [.c find closest {*}{70 90}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.3 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{99 70 110 81}
+ .c gettags [.c find closest {*}{90 90}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.4 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{101 70 110 79}
+ .c gettags [.c find closest {*}{90 90}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.5 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{99 100 110 115}
+ .c gettags [.c find closest {*}{90 110}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.6 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{101 100 110 115}
+ .c gettags [.c find closest {*}{90 110}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.7 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{99 134 110 145}
+ .c gettags [.c find closest {*}{90 125}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.8 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{101 136 110 145}
+ .c gettags [.c find closest {*}{90 125}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.9 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{50 134 80 145}
+ .c gettags [.c find closest {*}{70 125}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.10 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{50 136 80 145}
+ .c gettags [.c find closest {*}{70 125}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.11 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 134 31 145}
+ .c gettags [.c find closest {*}{40 125}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.12 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 136 29 145}
+ .c gettags [.c find closest {*}{40 125}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.13 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 100 31 115}
+ .c gettags [.c find closest {*}{40 110}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.14 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 100 29 115}
+ .c gettags [.c find closest {*}{40 110}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.15 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 70 31 80}
+ .c gettags [.c find closest {*}{40 90}]
+} -cleanup {
+ .c delete all
+} -result {rect}
+test canvImg-8.16 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{20 70 29 79}
+ .c gettags [.c find closest {*}{40 90}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.17 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{60 70 69 109}
+ .c gettags [.c find closest {*}{70 110}]
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.18 {ImageToArea procedure} -constraints testImageType -setup {
+ .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 {}
+} -body {
+ .c coords rect {*}{60 70 71 111}
+ .c gettags [.c find closest {*}{70 110}]
+} -cleanup {
+ .c delete all
+} -result {rect}
.c delete all
-if {[testConstraint testImageType]} {
+
+test canvImg-8.19 {ImageToArea procedure} -constraints testImageType -body {
.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} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.20 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 60 0 70 99.999]
-} {}
-test canvImg-8.21 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.21 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 60 0 70 101]
-} {image}
-test canvImg-8.22 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.22 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 81 105 120 115]
-} {}
-test canvImg-8.23 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.23 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 80.001 105 120 115]
-} {}
-test canvImg-8.24 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.24 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 79 105 120 115]
-} {image}
-test canvImg-8.25 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.25 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 60 116 70 150]
-} {}
-test canvImg-8.26 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.26 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 60 115.001 70 150]
-} {}
-test canvImg-8.27 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.27 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 60 114 70 150]
-} {image}
-test canvImg-8.28 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.28 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 105 49 115]
-} {}
-test canvImg-8.29 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.29 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 105 50 114.999]
-} {}
-test canvImg-8.30 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.30 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 105 51 115]
-} {image}
-test canvImg-8.31 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.31 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 0 49.999 99.999]
-} {}
-test canvImg-8.32 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.32 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 0 51 101]
-} {image}
-test canvImg-8.33 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.33 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 80 0 150 100]
-} {}
-test canvImg-8.34 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.34 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 79 0 150 101]
-} {image}
-test canvImg-8.35 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.35 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 80.001 115.001 150 180]
-} {}
-test canvImg-8.36 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.36 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 79 114 150 180]
-} {image}
-test canvImg-8.37 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.37 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 115 50 180]
-} {}
-test canvImg-8.38 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.38 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find overlapping 0 114 51 180]
-} {image}
-test canvImg-8.39 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.39 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 0 0 200 200]
-} {image}
-test canvImg-8.40 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.40 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 49.999 99.999 80.001 115.001]
-} {image}
-test canvImg-8.41 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {image}
+test canvImg-8.41 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 51 100 80 115]
-} {}
-test canvImg-8.42 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.42 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 50 101 80 115]
-} {}
-test canvImg-8.43 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.43 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 50 100 79 115]
-} {}
-test canvImg-8.44 {ImageToArea procedure} testImageType {
+} -cleanup {
+ .c delete all
+} -result {}
+test canvImg-8.44 {ImageToArea procedure} -constraints testImageType -body {
+ .c create image 50 100 -image foo -tags image -anchor nw
.c gettags [.c find enclosed 50 100 80 114]
-} {}
+} -cleanup {
+ .c delete all
+} -result {}
+if {[testConstraint testImageType]} {
+ image delete foo
+}
+
-test canvImg-9.1 {DisplayImage procedure} testImageType {
+test canvImg-9.1 {DisplayImage procedure} -constraints testImageType -setup {
.c delete all
+ image create test foo
+} -body {
.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}
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {75 150 105 165}
-test canvImg-10.1 {TranslateImage procedure} testImageType {
+test canvImg-10.1 {TranslateImage procedure} -constraints testImageType -setup {
.c delete all
+} -body {
+ image create test foo -variable x
.c create image 50 100 -image foo -tags image -anchor nw
update
set x {}
foo changed 2 4 6 8 30 15
update
- set x
-} {{foo display 2 4 6 8 30 30}}
+ return $x
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {{foo display 2 4 6 8 30 30}}
-test canvImg-11.1 {TranslateImage procedure} testImageType {
+test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
.c delete all
+} -body {
+ image create test foo -variable x
.c create image 50 100 -image foo -tags image -anchor nw
update
set x {}
foo changed 2 4 6 8 40 50
update
- set x
-} {{foo display 0 0 40 50 30 30}}
-test canvImg-11.2 {ImageChangedProc procedure} testImageType {
- .c delete all
+ return $x
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {{foo display 0 0 40 50 30 30}}
+test canvImg-11.2 {ImageChangedProc procedure} -constraints {
+ testImageType
+} -setup {
+ .c delete all
+} -body {
image create test foo -variable x
.c create image 50 100 -image foo -tags image -anchor center
update
set x {}
foo changed 0 0 0 0 40 50
.c bbox image
-} {30 75 70 125}
-test canvImg-11.3 {ImageChangedProc procedure} testImageType {
- .c delete all
+} -cleanup {
+ .c delete all
+ image delete foo
+} -result {30 75 70 125}
+test canvImg-11.3 {ImageChangedProc procedure} -constraints {
+ testImageType
+} -setup {
+ .c delete all
+} -body {
image create test foo -variable x
+ image create test foo2 -variable y
foo changed 0 0 0 0 40 50
+ foo2 changed 0 0 0 0 80 60
+
.c create image 50 100 -image foo -tags image -anchor nw
.c create image 70 110 -image foo2 -anchor nw
update
set y {}
image create test foo -variable x
update
- set y
-} {{foo2 display 0 0 20 40 50 40}}
+ return $y
+} -cleanup {
+ .c delete all
+ image delete foo foo2
+} -result {{foo2 display 0 0 20 40 50 40}}
# cleanup
+imageFinish
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/canvMoveto.test b/tests/canvMoveto.test
new file mode 100644
index 0000000..79761a4
--- /dev/null
+++ b/tests/canvMoveto.test
@@ -0,0 +1,56 @@
+# This file is a Tcl script to test out the canvas "moveto" command. It is
+# derived from canvRect.test.
+#
+# Copyright (c) 1994-1996 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2004 Neil McKay.
+# All rights reserved.
+
+package require tcltest 2.1
+eval tcltest::configure $argv
+tcltest::loadTestedCommands
+
+canvas .c -width 400 -height 300 -bd 2 -relief sunken
+.c create rectangle 20 20 80 80 -tag {test rect1}
+.c create rectangle 40 40 90 100 -tag {test rect2}
+
+test canvMoveto-1.1 {Bad args handling for "moveto" command} -body {
+ .c moveto test
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.2 {Bad args handling for "moveto" command} -body {
+ .c moveto rect
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.3 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+test canvMoveto-1.4 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12 y
+} -returnCodes error -result {bad screen distance "y"}
+test canvMoveto-1.5 {Bad args handling for "moveto" command} -body {
+ .c moveto test 12 20 -anchor
+} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
+
+test canvMoveto-2.1 {Canvas "moveto" command coordinates} {
+ .c moveto test 200 150
+ .c bbox test
+} {200 150 272 232}
+test canvMoveto-2.2 {Canvas "moveto" command, blank y coordinate} {
+ .c moveto test 200 150
+ .c moveto test 150 {}
+ .c bbox test
+} {150 150 222 232}
+test canvMoveto-2.3 {Canvas "moveto" command, blank x coordinate} {
+ .c moveto test 200 150
+ .c moveto test {} 200
+ .c bbox test
+} {200 200 272 282}
+
+.c delete withtag all
+
+# cleanup
+cleanupTests
+return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/canvPs.test b/tests/canvPs.test
index f2df447..c7ba958 100644
--- a/tests/canvPs.test
+++ b/tests/canvPs.test
@@ -6,10 +6,13 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
+# canvas used in 1.* and 2.* test cases
canvas .c -width 400 -height 300 -bd 2 -relief sunken
.c create rectangle 20 20 80 80 -fill red
pack .c
@@ -43,6 +46,7 @@ test canvPs-1.2 {test writing to a file, idempotency} -constraints {
removeFile bar.ps
} -result ok
+
test canvPs-2.1 {test writing to a channel} -constraints {
unixOrPc
} -setup {
@@ -75,7 +79,7 @@ test canvPs-2.2 {test writing to channel, idempotency} -constraints {
close $c2
set status ok
if {[file size $bar] != [file size $foo]} {
- set status broken
+ set status broken
}
set status
} -cleanup {
@@ -97,7 +101,7 @@ test canvPs-2.3 {test writing to channel and file, same output} -constraints {
.c postscript -file $bar
set status ok
if {[file size $foo] != [file size $bar]} {
- set status broken
+ set status broken
}
set status
} -cleanup {
@@ -119,21 +123,22 @@ test canvPs-2.4 {test writing to channel and file, same output} -constraints {
.c postscript -file $bar
set status ok
if {[file size $foo] != [file size $bar]} {
- set status broken
+ set status broken
}
set status
} -cleanup {
removeFile foo.ps
removeFile bar.ps
} -result ok
+destroy .c
+
-test canvPs-3.1 {test ps generation with an embedded window} -setup {
+test canvPs-3.1 {test ps generation with an embedded window} -constraints {
+ notAqua
+} -setup {
set bar [makeFile {} bar.ps]
file delete $bar
-} -constraints {
- notAqua
} -body {
- destroy .c
pack [canvas .c -width 200 -height 200 -background white]
.c create rect 20 20 150 150 -tags rect0 -dash . -width 2
.c create arc 0 50 200 200 -tags arc0 \
@@ -150,13 +155,14 @@ test canvPs-3.1 {test ps generation with an embedded window} -setup {
.c postscript -file $bar
file exists $bar
} -cleanup {
+ destroy .c
+ imageCleanup
removeFile bar.ps
-} -result 1
+} -result {1}
test canvPs-3.2 {test ps generation with an embedded window not mapped} -setup {
set bar [makeFile {} bar.ps]
file delete $bar
} -body {
- destroy .c
pack [canvas .c -width 200 -height 200 -background white]
entry .c.e -background pink -foreground blue -width 14
.c.e insert 0 "we gonna be postscripted"
@@ -164,18 +170,27 @@ test canvPs-3.2 {test ps generation with an embedded window not mapped} -setup {
.c postscript -file $bar
file exists $bar
} -cleanup {
+ destroy .c
removeFile bar.ps
-} -result 1
+} -result {1}
-test canvPs-4.1 {test ps generation with single-point uncolored poly, bug 734498} {} {
- destroy .c
+
+test canvPs-4.1 {test ps generation with single-point uncolored poly, bug 734498} -body {
pack [canvas .c]
.c create poly 10 20 10 20
- catch {.c postscript}
-} 0
+ .c postscript
+} -cleanup {
+ destroy .c
+} -returnCodes ok -match glob -result *
+
# cleanup
unset -nocomplain foo bar
+imageFinish
deleteWindows
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/canvRect.test b/tests/canvRect.test
index b6c828e..a2cc51c 100644
--- a/tests/canvRect.test
+++ b/tests/canvRect.test
@@ -6,301 +6,444 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+# Canvas used in every test case of the whole file
canvas .c -width 400 -height 300 -bd 2 -relief sunken
pack .c
-bind .c <1> {
- puts "button down at (%x,%y)"
-}
update
-set i 1
+# Rectangle used in canvRect-1.* tests
.c create rectangle 20 20 80 80 -tag test
-foreach test {
- {-fill #ff0000 #ff0000
- non-existent {unknown color name "non-existent"}}
- {-outline #123456 #123456
- bad_color {unknown color name "bad_color"}}
- {-stipple gray50 gray50
- bogus {bitmap "bogus" not defined}}
- {-tags {test a b c} {test a b c}
- {} {}}
- {-width 6.0 6.0
- abc {bad screen distance "abc"}}
-} {
- lassign $test name goodValue goodResult badValue badResult
- test canvRect-1.$i "configuration options: good value for $name" {
- .c itemconfigure test $name $goodValue
- list [lindex [.c itemconfigure test $name] 4] [.c itemcget test $name]
- } [list $goodResult $goodResult]
- incr i
- if {$badValue ne ""} {
- test canvRect-1.$i "configuration options: bad value for $name" -body {
- .c itemconfigure test $name $badValue
- } -returnCodes error -result $badResult
- }
- incr i
-}
-test canvRect-1.$i {configuration options} {
+test canvRect-1.1 {configuration options: good value for -fill} -body {
+ .c itemconfigure test -fill #ff0000
+ list [.c itemcget test -fill] [lindex [.c itemconfigure test -fill] 4]
+} -result {{#ff0000} #ff0000}
+test canvRect-1.2 {configuration options: bad value for -fill} -body {
+ .c itemconfigure test -fill non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test canvRect-1.3 {configuration options: good value for -outline} -body {
+ .c itemconfigure test -outline #123456
+ list [.c itemcget test -outline] [lindex [.c itemconfigure test -outline] 4]
+} -result {{#123456} #123456}
+test canvRect-1.4 {configuration options: bad value for -outline} -body {
+ .c itemconfigure test -outline non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test canvRect-1.5 {configuration options: good value for -stipple } -body {
+ .c itemconfigure test -stipple gray50
+ list [.c itemcget test -stipple ] [lindex [.c itemconfigure test -stipple ] 4]
+} -result {gray50 gray50}
+test canvRect-1.6 {configuration options: bad value for -stipple } -body {
+ .c itemconfigure test -stipple bogus
+} -returnCodes error -result {bitmap "bogus" not defined}
+test canvRect-1.7 {configuration options: good value for -tags} -body {
+ .c itemconfigure test -tags {test a b c}
+ list [.c itemcget test -tags] [lindex [.c itemconfigure test -tags] 4]
+} -result {{test a b c} {test a b c}}
+test canvRect-1.8 {configuration options} -body {
.c itemconfigure test -tags {test xyz}
.c itemcget xyz -tags
-} {test xyz}
+} -result {test xyz}
+test canvRect-1.9 {configuration options: good value for -width} -body {
+ .c itemconfigure test -width 6.0
+ list [.c itemcget test -width] [lindex [.c itemconfigure test -width] 4]
+} -result {6.0 6.0}
+test canvRect-1.10 {configuration options: bad value for -width} -body {
+ .c itemconfigure test -width abc
+} -returnCodes error -result {bad screen distance "abc"}
+.c delete withtag all
+
-test canvRect-2.1 {CreateRectOval procedure} {
- list [catch {.c create rect} msg] $msg
-} {1 {wrong # args: should be ".c create rect coords ?arg arg ...?"}}
-test canvRect-2.2 {CreateRectOval procedure} {
- list [catch {.c create oval x y z} msg] $msg
-} {1 {wrong # coordinates: expected 0 or 4, got 3}}
-test canvRect-2.3 {CreateRectOval procedure} {
- list [catch {.c create rectangle x 2 3 4} msg] $msg
-} {1 {bad screen distance "x"}}
-test canvRect-2.4 {CreateRectOval procedure} {
- list [catch {.c create rectangle 1 y 3 4} msg] $msg
-} {1 {bad screen distance "y"}}
-test canvRect-2.5 {CreateRectOval procedure} {
- list [catch {.c create rectangle 1 2 z 4} msg] $msg
-} {1 {bad screen distance "z"}}
-test canvRect-2.6 {CreateRectOval procedure} {
- list [catch {.c create rectangle 1 2 3 q} msg] $msg
-} {1 {bad screen distance "q"}}
-test canvRect-2.7 {CreateRectOval procedure} {
+test canvRect-2.1 {CreateRectOval procedure} -body {
+ .c create rect
+} -returnCodes error -result {wrong # args: should be ".c create rect coords ?arg ...?"}
+test canvRect-2.2 {CreateRectOval procedure} -body {
+ .c create oval x y z
+} -returnCodes error -result {wrong # coordinates: expected 0 or 4, got 3}
+test canvRect-2.3 {CreateRectOval procedure} -body {
+ .c create rectangle x 2 3 4
+} -returnCodes error -result {bad screen distance "x"}
+test canvRect-2.4 {CreateRectOval procedure} -body {
+ .c create rectangle 1 y 3 4
+} -returnCodes error -result {bad screen distance "y"}
+test canvRect-2.5 {CreateRectOval procedure} -body {
+ .c create rectangle 1 2 z 4
+} -returnCodes error -result {bad screen distance "z"}
+test canvRect-2.6 {CreateRectOval procedure} -body {
+ .c create rectangle 1 2 3 q
+} -returnCodes error -result {bad screen distance "q"}
+test canvRect-2.7 {CreateRectOval procedure} -body {
.c create rectangle 1 2 3 4 -tags x
set result {}
foreach element [.c coords x] {
- lappend result [format %.1f $element]
+ lappend result [format %.1f $element]
}
set result
-} {1.0 2.0 3.0 4.0}
-test canvRect-2.8 {CreateRectOval procedure} {
- list [catch {.c create rectangle 1 2 3 4 -gorp foo} msg] $msg
-} {1 {unknown option "-gorp"}}
-
+} -result {1.0 2.0 3.0 4.0}
+test canvRect-2.8 {CreateRectOval procedure} -body {
+ .c create rectangle 1 2 3 4 -gorp foo
+} -returnCodes error -result {unknown option "-gorp"}
.c delete withtag all
-.c create rectangle 10 20 30 40 -tags x
-test canvRect-3.1 {RectOvalCoords procedure} {
+
+
+test canvRect-3.1 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
set result {}
foreach element [.c coords x] {
- lappend result [format %.1f $element]
+ lappend result [format %.1f $element]
}
- set result
-} {10.0 20.0 30.0 40.0}
-test canvRect-3.2 {RectOvalCoords procedure} {
- list [catch {.c coords x a 2 3 4} msg] $msg
-} {1 {bad screen distance "a"}}
-test canvRect-3.3 {RectOvalCoords procedure} {
- list [catch {.c coords x 1 b 3 4} msg] $msg
-} {1 {bad screen distance "b"}}
-test canvRect-3.4 {RectOvalCoords procedure} {
- list [catch {.c coords x 1 2 c 4} msg] $msg
-} {1 {bad screen distance "c"}}
-test canvRect-3.5 {RectOvalCoords procedure} {
- list [catch {.c coords x 1 2 3 d} msg] $msg
-} {1 {bad screen distance "d"}}
-test canvRect-3.6 {RectOvalCoords procedure} {nonPortable} {
+ return $result
+} -cleanup {
+ .c delete withtag all
+} -result {10.0 20.0 30.0 40.0}
+test canvRect-3.2 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
+ .c coords x a 2 3 4
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "a"}
+test canvRect-3.3 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
+ .c coords x 1 b 3 4
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "b"}
+test canvRect-3.4 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
+ .c coords x 1 2 c 4
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "c"}
+test canvRect-3.5 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
+ .c coords x 1 2 3 d
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "d"}
+test canvRect-3.6 {RectOvalCoords procedure} -constraints {
+ nonPortable
+} -body {
+ .c create rectangle 10 20 30 40 -tags x
# Non-portable due to rounding differences.
.c coords x 10 25 15 40
.c bbox x
-} {9 24 16 41}
-test canvRect-3.7 {RectOvalCoords procedure} {
- list [catch {.c coords x 1 2 3 4 5} msg] $msg
-} {1 {wrong # coordinates: expected 0 or 4, got 5}}
+} -cleanup {
+ .c delete withtag all
+} -result {9 24 16 41}
+test canvRect-3.7 {RectOvalCoords procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x
+ .c coords x 1 2 3 4 5
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {wrong # coordinates: expected 0 or 4, got 5}
-.c delete withtag all
-.c create rectangle 10 20 30 40 -tags x -width 1
-test canvRect-4.1 {ConfigureRectOval procedure} {
- list [catch {.c itemconfigure x -width abc} msg] $msg \
- [.c itemcget x -width]
-} {1 {bad screen distance "abc"} 1.0}
-test canvRect-4.2 {ConfigureRectOval procedure} {
- list [catch {.c itemconfigure x -width -5} msg] $msg
-} {1 {bad screen distance "-5"}}
-test canvRect-4.3 {ConfigureRectOval procedure} {nonPortable} {
- # Non-portable due to rounding differences.
+
+test canvRect-4.1 {ConfigureRectOval procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x -width 1
+ .c itemconfigure x -width abc
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "abc"}
+test canvRect-4.2 {ConfigureRectOval procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x -width 1
+ catch {.c itemconfigure x -width abc}
+ .c itemcget x -width
+} -cleanup {
+ .c delete withtag all
+} -result {1.0}
+test canvRect-4.3 {ConfigureRectOval procedure} -body {
+ .c create rectangle 10 20 30 40 -tags x -width 1
+ .c itemconfigure x -width -5
+} -cleanup {
+ .c delete withtag all
+} -returnCodes error -result {bad screen distance "-5"}
+test canvRect-4.4 {ConfigureRectOval procedure} -constraints nonPortable -body {
+ # Non-portable due to rounding differences
+ .c create rectangle 10 20 30 40 -tags x -width 1
.c itemconfigure x -width 10
.c bbox x
-} {5 15 35 45}
+} -cleanup {
+ .c delete withtag all
+} -result {5 15 35 45}
+
# I can't come up with any good tests for DeleteRectOval.
-.c delete withtag all
-.c create rectangle 10 20 30 40 -tags x -width 1 -outline {}
-test canvRect-5.1 {ComputeRectOvalBbox procedure} {nonPortable} {
+test canvRect-5.1 {ComputeRectOvalBbox procedure} -constraints nonPortable -body {
# Non-portable due to rounding differences:
+ .c create rectangle 10 20 30 40 -tags x -width 1 -outline {}
.c coords x 20 15 10 5
.c bbox x
-} {10 5 20 15}
-test canvRect-5.2 {ComputeRectOvalBbox procedure} {nonPortable} {
+} -cleanup {
+ .c delete withtag all
+} -result {10 5 20 15}
+test canvRect-5.2 {ComputeRectOvalBbox procedure} -constraints nonPortable -body {
# Non-portable due to rounding differences:
+ .c create rectangle 10 20 30 40 -tags x -width 1 -outline {}
.c coords x 10 20 30 10
.c itemconfigure x -width 1 -outline red
.c bbox x
-} {9 9 31 21}
-test canvRect-5.3 {ComputeRectOvalBbox procedure} {nonPortable} {
+} -cleanup {
+ .c delete withtag all
+} -result {9 9 31 21}
+test canvRect-5.3 {ComputeRectOvalBbox procedure} -constraints nonPortable -body {
# Non-portable due to rounding differences:
+ .c create rectangle 10 20 30 40 -tags x -width 1 -outline {}
.c coords x 10 20 30 10
.c itemconfigure x -width 2 -outline red
.c bbox x
-} {9 9 31 21}
-test canvRect-5.4 {ComputeRectOvalBbox procedure} {nonPortable} {
+} -cleanup {
+ .c delete withtag all
+} -result {9 9 31 21}
+test canvRect-5.4 {ComputeRectOvalBbox procedure} -constraints nonPortable -body {
# Non-portable due to rounding differences:
+ .c create rectangle 10 20 30 40 -tags x -width 1 -outline {}
.c coords x 10 20 30 10
.c itemconfigure x -width 3 -outline red
.c bbox x
-} {8 8 32 22}
+} -cleanup {
+ .c delete withtag all
+} -result {8 8 32 22}
# I can't come up with any good tests for DisplayRectOval.
-.c delete withtag all
-set x [.c create rectangle 10 20 30 35 -tags x -fill green]
-set y [.c create rectangle 15 25 25 30 -tags y -fill red]
-test canvRect-6.1 {RectToPoint procedure} {
+test canvRect-6.1 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
.c itemconfigure y -outline {}
- list [.c find closest 14.9 28] [.c find closest 15.1 28] \
- [.c find closest 24.9 28] [.c find closest 25.1 28]
-} "$x $y $y $x"
-test canvRect-6.2 {RectToPoint procedure} {
+ list [expr {[.c find closest 14.9 28] eq $xId}] \
+ [expr {[.c find closest 15.1 28] eq $yId}] \
+ [expr {[.c find closest 24.9 28] eq $yId}] \
+ [expr {[.c find closest 25.1 28] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
+test canvRect-6.2 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
.c itemconfigure y -outline {}
- list [.c find closest 20 24.9] [.c find closest 20 25.1] \
- [.c find closest 20 29.9] [.c find closest 20 30.1]
-} "$x $y $y $x"
-test canvRect-6.3 {RectToPoint procedure} {
+ list [expr {[.c find closest 20 24.9] eq $xId}] \
+ [expr {[.c find closest 20 25.1] eq $yId}] \
+ [expr {[.c find closest 20 29.9] eq $yId}] \
+ [expr {[.c find closest 20 30.1] eq $xId}]
+
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
+test canvRect-6.3 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
.c itemconfigure y -width 1 -outline black
- list [.c find closest 14.4 28] [.c find closest 14.6 28] \
- [.c find closest 25.4 28] [.c find closest 25.6 28]
-} "$x $y $y $x"
-test canvRect-6.4 {RectToPoint procedure} {
+ list [expr {[.c find closest 14.4 28] eq $xId}] \
+ [expr {[.c find closest 14.6 28] eq $yId}] \
+ [expr {[.c find closest 25.4 28] eq $yId}] \
+ [expr {[.c find closest 25.6 28] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
+test canvRect-6.4 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
.c itemconfigure y -width 1 -outline black
- list [.c find closest 20 24.4] [.c find closest 20 24.6] \
- [.c find closest 20 30.4] [.c find closest 20 30.6]
-} "$x $y $y $x"
-.c itemconfigure x -fill {} -outline black -width 3
-.c itemconfigure y -outline {}
-test canvRect-6.5 {RectToPoint procedure} {
- list [.c find closest 13.2 28] [.c find closest 13.3 28] \
- [.c find closest 26.7 28] [.c find closest 26.8 28]
-} "$x $y $y $x"
-test canvRect-6.6 {RectToPoint procedure} {
- list [.c find closest 20 23.2] [.c find closest 20 23.3] \
- [.c find closest 20 31.7] [.c find closest 20 31.8]
-} "$x $y $y $x"
-.c delete withtag all
-set x [.c create rectangle 10 20 30 40 -outline {} -fill black]
-set y [.c create rectangle 40 40 50 50 -outline {} -fill black]
-test canvRect-6.7 {RectToPoint procedure} {
- list [.c find closest 35 35] [.c find closest 36 36] \
- [.c find closest 37 37] [.c find closest 38 38]
-} "$x $y $y $y"
+ list [expr {[.c find closest 20 24.4] eq $xId}] \
+ [expr {[.c find closest 20 24.6] eq $yId}] \
+ [expr {[.c find closest 20 30.4] eq $yId}] \
+ [expr {[.c find closest 20 30.6] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
-.c delete withtag all
-set x [.c create rectangle 10 20 30 35 -fill green -outline {}]
-set y [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
-set z [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
-test canvRect-7.1 {RectToArea procedure} {
- list [.c find overlapping 20 50 38 60] \
- [.c find overlapping 20 50 39 60] \
- [.c find overlapping 20 50 70 60] \
- [.c find overlapping 61 50 70 60] \
- [.c find overlapping 62 50 70 60]
-} "{} $y $y $y {}"
-test canvRect-7.2 {RectToArea procedure} {
- list [.c find overlapping 45 20 55 43] \
- [.c find overlapping 45 20 55 44] \
- [.c find overlapping 45 20 55 80] \
- [.c find overlapping 45 71 55 80] \
- [.c find overlapping 45 72 55 80]
-} "{} $y $y $y {}"
-test canvRect-7.3 {RectToArea procedure} {
- list [.c find overlapping 5 25 9.9 30] [.c find overlapping 5 25 10.1 30]
-} "{} $x"
-test canvRect-7.4 {RectToArea procedure} {
- list [.c find overlapping 102 152 118 168] \
- [.c find overlapping 101 152 118 168] \
- [.c find overlapping 102 151 118 168] \
- [.c find overlapping 102 152 119 168] \
- [.c find overlapping 102 152 118 169]
-} "{} $z $z $z $z"
-test canvRect-7.5 {RectToArea procedure} {
- list [.c find enclosed 20 40 38 80] \
- [.c find enclosed 20 40 39 80] \
- [.c find enclosed 20 40 70 80] \
- [.c find enclosed 61 40 70 80] \
- [.c find enclosed 62 40 70 80]
-} "{} {} $y {} {}"
-test canvRect-7.6 {RectToArea procedure} {
- list [.c find enclosed 20 20 65 43] \
- [.c find enclosed 20 20 65 44] \
- [.c find enclosed 20 20 65 80] \
- [.c find enclosed 20 71 65 80] \
- [.c find enclosed 20 72 65 80]
-} "{} {} $y {} {}"
+test canvRect-6.5 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
+ .c itemconfigure x -fill {} -outline black -width 3
+ .c itemconfigure y -outline {}
+ list [expr {[.c find closest 13.2 28] eq $xId}] \
+ [expr {[.c find closest 13.3 28] eq $yId}] \
+ [expr {[.c find closest 26.7 28] eq $yId}] \
+ [expr {[.c find closest 26.8 28] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
+test canvRect-6.6 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -tags x -fill green]
+ set yId [.c create rectangle 15 25 25 30 -tags y -fill red]
+ .c itemconfigure x -fill {} -outline black -width 3
+ .c itemconfigure y -outline {}
+ list [expr {[.c find closest 20 23.2] eq $xId}] \
+ [expr {[.c find closest 20 23.3] eq $yId}] \
+ [expr {[.c find closest 20 31.7] eq $yId}] \
+ [expr {[.c find closest 20 31.8] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
+
+test canvRect-6.7 {RectToPoint procedure} -body {
+ set xId [.c create rectangle 10 20 30 40 -outline {} -fill black]
+ set yId [.c create rectangle 40 40 50 50 -outline {} -fill black]
+ list [expr {[.c find closest 35 35] eq $xId}] \
+ [expr {[.c find closest 36 36] eq $yId}] \
+ [expr {[.c find closest 37 37] eq $yId}] \
+ [expr {[.c find closest 38 38] eq $yId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1}
-.c delete withtag all
-set x [.c create oval 50 100 200 150 -fill green -outline {}]
-set y [.c create oval 50 100 200 150 -fill red -outline black -width 3]
-set z [.c create oval 50 100 200 150 -fill {} -outline black -width 3]
-test canvRect-8.1 {OvalToArea procedure} {
- list [.c find overlapping 20 120 48 130] \
- [.c find overlapping 20 120 49 130] \
- [.c find overlapping 20 120 50.2 130] \
- [.c find overlapping 20 120 300 130] \
- [.c find overlapping 60 120 190 130] \
- [.c find overlapping 199.9 120 300 130] \
- [.c find overlapping 201 120 300 130] \
- [.c find overlapping 202 120 300 130]
-} "{} {$y $z} {$x $y $z} {$x $y $z} {$x $y} {$x $y $z} {$y $z} {}"
-test canvRect-8.2 {OvalToArea procedure} {
- list [.c find overlapping 100 50 150 98] \
- [.c find overlapping 100 50 150 99] \
- [.c find overlapping 100 50 150 100.1] \
- [.c find overlapping 100 50 150 200] \
- [.c find overlapping 100 110 150 140] \
- [.c find overlapping 100 149.9 150 200] \
- [.c find overlapping 100 151 150 200] \
- [.c find overlapping 100 152 150 200]
-} "{} {$y $z} {$x $y $z} {$x $y $z} {$x $y} {$x $y $z} {$y $z} {}"
-test canvRect-8.3 {OvalToArea procedure} {
- list [.c find overlapping 176 104 177 105] \
- [.c find overlapping 187 116 188 117] \
- [.c find overlapping 192 142 193 143] \
- [.c find overlapping 180 138 181 139] \
- [.c find overlapping 61 142 62 143] \
- [.c find overlapping 65 137 66 136] \
- [.c find overlapping 62 108 63 109] \
- [.c find overlapping 68 115 69 116]
-} "{} {$x $y} {} {$x $y} {} {$x $y} {} {$x $y}"
-test canvRect-9.1 {ScaleRectOval procedure} {
+test canvRect-7.1 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 20 50 38 60] eq {}}] \
+ [expr {[.c find overlapping 20 50 39 60] eq $yId}] \
+ [expr {[.c find overlapping 20 50 70 60] eq $yId}] \
+ [expr {[.c find overlapping 61 50 70 60] eq $yId}] \
+ [expr {[.c find overlapping 62 50 70 60] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1}
+test canvRect-7.2 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 45 20 55 43] eq {}}] \
+ [expr {[.c find overlapping 45 20 55 44] eq $yId}] \
+ [expr {[.c find overlapping 45 20 55 80] eq $yId}] \
+ [expr {[.c find overlapping 45 71 55 80] eq $yId}] \
+ [expr {[.c find overlapping 45 72 55 80] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1}
+test canvRect-7.3 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 5 25 9.9 30] eq {}}] \
+ [expr {[.c find overlapping 5 25 10.1 30] eq $xId}]
+} -cleanup {
+ .c delete all
+} -result {1 1}
+test canvRect-7.4 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 102 152 118 168] eq {}}]\
+ [expr {[.c find overlapping 101 152 118 168] eq $zId}] \
+ [expr {[.c find overlapping 102 151 118 168] eq $zId}] \
+ [expr {[.c find overlapping 102 152 119 168] eq $zId}] \
+ [expr {[.c find overlapping 102 152 118 169] eq $zId}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1}
+test canvRect-7.5 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find enclosed 20 40 38 80] eq {}}] \
+ [expr {[.c find enclosed 20 40 39 80] eq {}}] \
+ [expr {[.c find enclosed 20 40 70 80] eq $yId}] \
+ [expr {[.c find enclosed 61 40 70 80] eq {}}] \
+ [expr {[.c find enclosed 62 40 70 80] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1}
+test canvRect-7.6 {RectToArea procedure} -body {
+ set xId [.c create rectangle 10 20 30 35 -fill green -outline {}]
+ set yId [.c create rectangle 40 45 60 70 -fill red -outline black -width 3]
+ set zId [.c create rectangle 100 150 120 170 -fill {} -outline black -width 3]
+ list [expr {[.c find enclosed 20 20 65 43] eq {}}] \
+ [expr {[.c find enclosed 20 20 65 44] eq {}}] \
+ [expr {[.c find enclosed 20 20 65 80] eq $yId}] \
+ [expr {[.c find enclosed 20 71 65 80] eq {}}] \
+ [expr {[.c find enclosed 20 72 65 80] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1}
+
+
+test canvRect-8.1 {OvalToArea procedure} -body {
+ set xId [.c create oval 50 100 200 150 -fill green -outline {}]
+ set yId [.c create oval 50 100 200 150 -fill red -outline black -width 3]
+ set zId [.c create oval 50 100 200 150 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 20 120 48 130] eq {}}] \
+ [expr {[.c find overlapping 20 120 49 130] eq "$yId $zId"}] \
+ [expr {[.c find overlapping 20 120 50.2 130] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 20 120 300 130] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 60 120 190 130] eq "$xId $yId"}] \
+ [expr {[.c find overlapping 199.9 120 300 130] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 201 120 300 130] eq "$yId $zId"}] \
+ [expr {[.c find overlapping 202 120 300 130] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1 1 1 1}
+test canvRect-8.2 {OvalToArea procedure} -body {
+ set xId [.c create oval 50 100 200 150 -fill green -outline {}]
+ set yId [.c create oval 50 100 200 150 -fill red -outline black -width 3]
+ set zId [.c create oval 50 100 200 150 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 100 50 150 98] eq {}}] \
+ [expr {[.c find overlapping 100 50 150 99] eq "$yId $zId"}] \
+ [expr {[.c find overlapping 100 50 150 100.1] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 100 50 150 200] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 100 110 150 140] eq "$xId $yId"}] \
+ [expr {[.c find overlapping 100 149.9 150 200] eq "$xId $yId $zId"}] \
+ [expr {[.c find overlapping 100 151 150 200] eq "$yId $zId"}] \
+ [expr {[.c find overlapping 100 152 150 200] eq {}}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1 1 1 1}
+test canvRect-8.3 {OvalToArea procedure} -body {
+ set xId [.c create oval 50 100 200 150 -fill green -outline {}]
+ set yId [.c create oval 50 100 200 150 -fill red -outline black -width 3]
+ set zId [.c create oval 50 100 200 150 -fill {} -outline black -width 3]
+ list [expr {[.c find overlapping 176 104 177 105] eq {}}] \
+ [expr {[.c find overlapping 187 116 188 117] eq "$xId $yId"}] \
+ [expr {[.c find overlapping 192 142 193 143] eq {}}] \
+ [expr {[.c find overlapping 180 138 181 139] eq "$xId $yId"}] \
+ [expr {[.c find overlapping 61 142 62 143] eq {}}] \
+ [expr {[.c find overlapping 65 137 66 136] eq "$xId $yId"}] \
+ [expr {[.c find overlapping 62 108 63 109] eq {}}] \
+ [expr {[.c find overlapping 68 115 69 116] eq "$xId $yId"}]
+} -cleanup {
+ .c delete all
+} -result {1 1 1 1 1 1 1 1}
+
+
+test canvRect-9.1 {ScaleRectOval procedure} -setup {
.c delete withtag all
+} -body {
.c create rect 100 300 200 350 -tags x
.c scale x 50 100 2 4
- .c coords x
-} {150.0 900.0 350.0 1100.0}
+ format {%.6g %.6g %.6g %.6g} {*}[.c coords x]
+} -result {150 900 350 1100}
-test canvRect-10.1 {TranslateRectOval procedure} {
+test canvRect-10.1 {TranslateRectOval procedure} -setup {
.c delete withtag all
+} -body {
.c create rect 100 300 200 350 -tags x
.c move x 100 -10
- .c coords x
-} {200.0 290.0 300.0 340.0}
+ format {%.6g %.6g %.6g %.6g} {*}[.c coords x]
+} -result {200 290 300 340}
+
-# This test is non-portable because different color information
-# will get generated on different displays (e.g. mono displays
-# vs. color).
-test canvRect-11.1 {RectOvalToPostscript procedure} {nonPortable macCrash} {
+test canvRect-11.1 {RectOvalToPostscript procedure} -constraints {
+ nonPortable macCrash
+} -setup {
+ .c delete withtag all
+} -body {
# Crashes on Mac because the XGetImage() call isn't implemented, causing a
# dereference of NULL.
-
+ # This test is non-portable because different color information
+ # will get generated on different displays (e.g. mono displays
+ # vs. color).
.c configure -bd 0 -highlightthickness 0
- .c delete withtag all
.c create rect 50 60 90 80 -fill black -stipple gray50 -outline {}
.c create oval 100 150 200 200 -fill {} -outline #ff0000 -width 5
update
set x [.c postscript]
string range $x [string first "-200 -150 translate" $x] end
-} {-200 -150 translate
+} -result {-200 -150 translate
0 300 moveto 400 300 lineto 400 0 lineto 0 0 lineto closepath clip newpath
gsave
50 240 moveto 40 0 rlineto 0 -20 rlineto -40 0 rlineto closepath
@@ -326,3 +469,7 @@ end
# cleanup
cleanupTests
return
+
+
+
+
diff --git a/tests/canvText.test b/tests/canvText.test
index 070011b..f0c677f 100644
--- a/tests/canvText.test
+++ b/tests/canvText.test
@@ -6,134 +6,220 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+# Canvas used in 1.* - 17.* tests
canvas .c -width 400 -height 300 -bd 2 -relief sunken
pack .c
update
-set i 1
+# Item used in 1.* tests
.c create text 20 20 -tag test
-
-set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
-set ay [font metrics $font -linespace]
-set ax [font measure $font 0]
-
-
-foreach test {
- {-anchor nw nw xyz {bad anchor position "xyz": must be n, ne, e, se, s, sw, w, nw, or center}}
- {-fill #ff0000 #ff0000 xyz {unknown color name "xyz"}}
- {-fill {} {} {} {}}
- {-font {Times 40} {Times 40} {} {font "" doesn't exist}}
- {-justify left left xyz {bad justification "xyz": must be left, right, or center}}
- {-stipple gray50 gray50 xyz {bitmap "xyz" not defined}}
- {-tags {test a b c} {test a b c} {} {}}
- {-text xyz xyz {} {}}
- {-underline 0 0 xyz {expected integer but got "xyz"}}
- {-width 6 6 xyz {bad screen distance "xyz"}}
-} {
- lassign $test name goodValue goodResult badValue badResult
- test canvText-1.$i "configuration options: good value for $name" {
- .c itemconfigure test $name $goodValue
- list [lindex [.c itemconfigure test $name] 4] [.c itemcget test $name]
- } [list $goodResult $goodResult]
- incr i
- if {$badValue ne ""} {
- test canvText-1.$i "configuration options: bad value for $name" -body {
- .c itemconfigure test $name $badValue
- } -returnCodes error -result $badResult
- }
- incr i
-}
-test canvText-1.$i {configuration options} {
- .c itemconfigure test -tags {test xyz}
- .c itemcget xyz -tags
-} {test xyz}
-
+test canvText-1.1 {configuration options: good value for "anchor"} -body {
+ .c itemconfigure test -anchor nw
+ list [lindex [.c itemconfigure test -anchor] 4] [.c itemcget test -anchor]
+} -result {nw nw}
+test canvasText-1.2 {configuration options: bad value for "anchor"} -body {
+ .c itemconfigure test -anchor xyz
+} -returnCodes error -result {bad anchor position "xyz": must be n, ne, e, se, s, sw, w, nw, or center}
+test canvText-1.3 {configuration options: good value for "fill"} -body {
+ .c itemconfigure test -fill #ff0000
+ list [lindex [.c itemconfigure test -fill] 4] [.c itemcget test -fill]
+} -result {{#ff0000} #ff0000}
+test canvasText-1.4 {configuration options: bad value for "fill"} -body {
+ .c itemconfigure test -fill xyz
+} -returnCodes error -result {unknown color name "xyz"}
+test canvText-1.5 {configuration options: good value for "fill"} -body {
+ .c itemconfigure test -fill {}
+ list [lindex [.c itemconfigure test -fill] 4] [.c itemcget test -fill]
+} -result {{} {}}
+test canvText-1.6 {configuration options: good value for "font"} -body {
+ .c itemconfigure test -font {Times 40}
+ list [lindex [.c itemconfigure test -font] 4] [.c itemcget test -font]
+} -result {{Times 40} {Times 40}}
+test canvasText-1.7 {configuration options: bad value for "font"} -body {
+ .c itemconfigure test -font {}
+} -returnCodes error -result {font "" doesn't exist}
+test canvText-1.8 {configuration options: good value for "justify"} -body {
+ .c itemconfigure test -justify left
+ list [lindex [.c itemconfigure test -justify] 4] [.c itemcget test -justify]
+} -result {left left}
+test canvasText-1.9 {configuration options: bad value for "justify"} -body {
+ .c itemconfigure test -justify xyz
+} -returnCodes error -result {bad justification "xyz": must be left, right, or center}
+test canvText-1.10 {configuration options: good value for "stipple"} -body {
+ .c itemconfigure test -stipple gray50
+ list [lindex [.c itemconfigure test -stipple] 4] [.c itemcget test -stipple]
+} -result {gray50 gray50}
+test canvasText-1.11 {configuration options: bad value for "stipple"} -body {
+ .c itemconfigure test -stipple xyz
+} -returnCodes error -result {bitmap "xyz" not defined}
+test canvText-1.12 {configuration options: good value for "underline"} -body {
+ .c itemconfigure test -underline 0
+ list [lindex [.c itemconfigure test -underline] 4] [.c itemcget test -underline]
+} -result {0 0}
+test canvasText-1.13 {configuration options: bad value for "underline"} -body {
+ .c itemconfigure test -underline xyz
+} -returnCodes error -result {expected integer but got "xyz"}
+test canvText-1.14 {configuration options: good value for "width"} -body {
+ .c itemconfigure test -width 6
+ list [lindex [.c itemconfigure test -width] 4] [.c itemcget test -width]
+} -result {6 6}
+test canvasText-1.15 {configuration options: bad value for "width"} -body {
+ .c itemconfigure test -width xyz
+} -returnCodes error -result {bad screen distance "xyz"}
+test canvText-1.16 {configuration options: good value for "tags"} -body {
+ .c itemconfigure test -tags {test a b c}
+ list [lindex [.c itemconfigure test -tags] 4] [.c itemcget test -tags]
+} -result {{test a b c} {test a b c}}
+test canvasText-1.17 {configuration options: bad value for "angle"} -body {
+ .c itemconfigure test -angle xyz
+} -returnCodes error -result {expected floating-point number but got "xyz"}
+test canvasText-1.18 {configuration options: good value for "angle"} -body {
+ .c itemconfigure test -angle 32.5
+ list [lindex [.c itemconfigure test -angle] 4] [.c itemcget test -angle]
+} -result {32.5 32.5}
+test canvasText-1.19 {configuration options: bounding of "angle"} -body {
+ .c itemconfigure test -angle 390
+ set result [.c itemcget test -angle]
+ .c itemconfigure test -angle -30
+ lappend result [.c itemcget test -angle]
+ .c itemconfigure test -angle -360
+ lappend result [.c itemcget test -angle]
+} -result {30.0 330.0 0.0}
.c delete test
-.c create text 20 20 -tag test
-test canvText-2.1 {CreateText procedure: args} {
- list [catch {.c create text} msg] $msg
-} {1 {wrong # args: should be ".c create text coords ?arg arg ...?"}}
-test canvText-2.2 {CreateText procedure: args} {
- list [catch {.c create text xyz 0} msg] $msg
-} {1 {bad screen distance "xyz"}}
-test canvText-2.3 {CreateText procedure: args} {
- list [catch {.c create text 0 xyz} msg] $msg
-} {1 {bad screen distance "xyz"}}
-test canvText-2.4 {CreateText procedure: args} {
- list [catch {.c create text 0 0 -xyz xyz} msg] $msg
-} {1 {unknown option "-xyz"}}
-test canvText-2.5 {CreateText procedure} {
+
+test canvText-2.1 {CreateText procedure: args} -body {
+ .c create text
+} -returnCodes {error} -result {wrong # args: should be ".c create text coords ?arg ...?"}
+test canvText-2.2 {CreateText procedure: args} -body {
+ .c create text xyz 0
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test canvText-2.3 {CreateText procedure: args} -body {
+ .c create text 0 xyz
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test canvText-2.4 {CreateText procedure: args} -body {
+ .c create text 0 0 -xyz xyz
+} -cleanup {
+ .c delete all
+} -returnCodes {error} -result {unknown option "-xyz"}
+test canvText-2.5 {CreateText procedure} -body {
.c create text 0 0 -tags x
- set x [.c coords x]
+ .c coords x
+} -cleanup {
.c delete x
- set x
-} {0.0 0.0}
+} -result {0.0 0.0}
-focus -force .c
-.c focus test
-.c coords test 0 0
-update
-test canvText-3.1 {TextCoords procedure} {
+test canvText-3.1 {TextCoords procedure} -body {
+ .c create text 20 20 -tag test
+ .c coords test 0 0
+ update
.c coords test
-} {0.0 0.0}
-test canvText-3.2 {TextCoords procedure} {
- list [catch {.c coords test xyz 0} msg] $msg
-} {1 {bad screen distance "xyz"}}
-test canvText-3.3 {TextCoords procedure} {
- list [catch {.c coords test 0 xyz} msg] $msg
-} {1 {bad screen distance "xyz"}}
-test canvText-3.4 {TextCoords procedure} {
+} -cleanup {
+ .c delete test
+} -result {0.0 0.0}
+test canvText-3.2 {TextCoords procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
+ .c coords test xyz 0
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test canvText-3.3 {TextCoords procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
+ .c coords test 0 xyz
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test canvText-3.4 {TextCoords procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
.c coords test 10 10
set result {}
foreach element [.c coords test] {
lappend result [format %.1f $element]
}
- set result
-} {10.0 10.0}
-test canvText-3.5 {TextCoords procedure} {
- list [catch {.c coords test 10} msg] $msg
-} {1 {wrong # coordinates: expected 2, got 1}}
-test canvText-3.6 {TextCoords procedure} {
- list [catch {.c coords test 10 10 10} msg] $msg
-} {1 {wrong # coordinates: expected 0 or 2, got 3}}
-
-test canvText-4.1 {ConfigureText procedure} {
- list [catch {.c itemconfig test -fill xyz} msg] $msg
-} {1 {unknown color name "xyz"}}
-test canvText-4.2 {ConfigureText procedure} {
+ return $result
+} -cleanup {
+ .c delete test
+} -result {10.0 10.0}
+test canvText-3.5 {TextCoords procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
+ .c coords test 10
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {wrong # coordinates: expected 2, got 1}
+test canvText-3.6 {TextCoords procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
+ .c coords test 10 10 10
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {wrong # coordinates: expected 0 or 2, got 3}
+
+
+test canvText-4.1 {ConfigureText procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
+ .c itemconfig test -fill xyz
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {unknown color name "xyz"}
+test canvText-4.2 {ConfigureText procedure} -setup {
+ .c create text 20 20 -tag test
+} -body {
.c itemconfig test -fill blue
.c itemcget test -fill
-} {blue}
-test canvText-4.3 {ConfigureText procedure: construct font gcs} {
+} -cleanup {
+ .c delete test
+} -result {blue}
+test canvText-4.3 {ConfigureText procedure: construct font gcs} -setup {
+ .c create text 20 20 -tag test
+} -body {
.c itemconfig test -font "times 20" -fill black -stipple gray50
list [.c itemcget test -font] [.c itemcget test -fill] [.c itemcget test -stipple]
-} {{times 20} black gray50}
-test canvText-4.4 {ConfigureText procedure: construct cursor gc} {
+} -cleanup {
+ .c delete test
+} -result {{times 20} black gray50}
+test canvText-4.4 {ConfigureText procedure: construct cursor gc} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c icursor test 3
-
# Both black -> cursor becomes white.
.c config -insertbackground black
.c config -selectbackground black
.c itemconfig test -just left
update
-
# Both same color (and not black) -> cursor becomes black.
.c config -insertbackground red
.c config -selectbackground red
.c itemconfig test -just left
update
-} {}
-test canvText-4.5 {ConfigureText procedure: adjust selection} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-4.5 {ConfigureText procedure: adjust selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
set x {}
+} -body {
.c itemconfig test -text "abcdefghi"
.c select from test 2
.c select to test 6
@@ -152,89 +238,250 @@ test canvText-4.5 {ConfigureText procedure: adjust selection} {
lappend x [selection get]
.c dchars test 4 end
lappend x [selection get]
-} {cdefg 1 cdefg cd cdef cd}
-test canvText-4.6 {ConfigureText procedure: adjust cursor} {
+} -cleanup {
+ .c delete test
+} -result {cdefg 1 cdefg cd cdef cd}
+test canvText-4.6 {ConfigureText procedure: adjust cursor} -setup {
+ .c create text 20 20 -tag test
+} -body {
.c itemconfig test -text "abcdefghi"
- set x {}
.c icursor test 6
.c dchars test 4 end
.c index test insert
-} {4}
+} -cleanup {
+ .c delete test
+} -result {4}
+
-test canvText-5.1 {ConfigureText procedure: adjust cursor} {
- .c create text 10 10 -tag x -fill blue -font "times 40" -stipple gray50 -text "xyz"
+test canvText-5.1 {ConfigureText procedure: adjust cursor} -body {
+ .c create text 10 10 -tag x -fill blue -font "times 40" -stipple gray50 \
+ -text "xyz"
.c delete x
-} {}
+} -result {}
+
-test canvText-6.1 {ComputeTextBbox procedure} {fonts nonPortable} {
+test canvText-6.1 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
.c itemconfig test -font $font -text 0
- .c coords test 0 0
- set x {}
- lappend x [.c itemconfig test -anchor n; .c bbox test]
- lappend x [.c itemconfig test -anchor nw; .c bbox test]
- lappend x [.c itemconfig test -anchor w; .c bbox test]
- lappend x [.c itemconfig test -anchor sw; .c bbox test]
- lappend x [.c itemconfig test -anchor s; .c bbox test]
- lappend x [.c itemconfig test -anchor se; .c bbox test]
- lappend x [.c itemconfig test -anchor e; .c bbox test]
- lappend x [.c itemconfig test -anchor ne; .c bbox test]
- lappend x [.c itemconfig test -anchor center; .c bbox test]
-} "{[expr -$ax/2-1] 0 [expr $ax/2+1] $ay}\
-{-1 0 [expr $ax+1] $ay}\
-{-1 [expr -$ay/2] [expr $ax+1] [expr $ay/2]}\
-{-1 -$ay [expr $ax+1] 0}\
-{[expr -$ax/2-1] -$ay [expr $ax/2+1] 0}\
-{[expr -$ax-1] -$ay 1 0}\
-{[expr -$ax-1] [expr -$ay/2] 1 [expr $ay/2]}\
-{[expr -$ax-1] 0 1 $ay}\
-{[expr -$ax/2-1] [expr -$ay/2] [expr $ax/2+1] [expr $ay/2]}"
+ expr {[.c itemconfig test -anchor n; .c bbox test] \
+ eq "[expr -$ax/2-1] 0 [expr $ax/2+1] $ay"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.2 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor nw; .c bbox test] \
+ eq "-1 0 [expr $ax+1] $ay"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.3 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor w; .c bbox test] \
+ eq "-1 [expr -$ay/2] [expr $ax+1] [expr $ay/2]"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.4 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor sw; .c bbox test] \
+ eq "-1 -$ay [expr $ax+1] 0"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.5 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor s; .c bbox test] \
+ eq "[expr -$ax/2-1] -$ay [expr $ax/2+1] 0"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.6 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor se; .c bbox test] \
+ eq "[expr -$ax-1] -$ay 1 0"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.7 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor e; .c bbox test]\
+ eq "[expr -$ax-1] [expr -$ay/2] 1 [expr $ay/2]"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.8 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor ne; .c bbox test] \
+ eq "[expr -$ax-1] 0 1 $ay"}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-6.9 {ComputeTextBbox procedure} -constraints fonts -setup {
+ .c delete test
+} -body {
+ set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
+ set ay [font metrics $font -linespace]
+ set ax [font measure $font 0]
+ .c create text 0 0 -tag test
+ .c itemconfig test -font $font -text 0
+ expr {[.c itemconfig test -anchor center; .c bbox test] \
+ eq "[expr -$ax/2-1] [expr -$ay/2] [expr $ax/2+1] [expr $ay/2]"}
+} -cleanup {
+ .c delete test
+} -result 1
+
+#.c delete test
+#.c create text 20 20 -tag test
+#focus -force .c
+#.c focus test
focus .c
.c focus test
.c itemconfig test -text "abcd\nefghi\njklmnopq"
-test canvText-7.0 {DisplayText procedure: stippling} {
+test canvText-7.1 {DisplayText procedure: stippling} -body {
+ .c create text 20 20 -tag test
.c itemconfig test -stipple gray50
update
.c itemconfig test -stipple {}
update
-} {}
-test canvText-7.2 {DisplayText procedure: draw selection} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.2 {DisplayText procedure: draw selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
.c select from test 0
.c select to test end
update
selection get
-} "abcd\nefghi\njklmnopq"
-test canvText-7.3 {DisplayText procedure: selection} {
+} -cleanup {
+ .c delete test
+} -result "abcd\nefghi\njklmnopq"
+test canvText-7.3 {DisplayText procedure: selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
.c select from test 0
.c select to test end
update
selection get
-} "abcd\nefghi\njklmnopq"
-test canvText-7.4 {DisplayText procedure: one line selection} {
+} -cleanup {
+ .c delete test
+} -result "abcd\nefghi\njklmnopq"
+test canvText-7.4 {DisplayText procedure: one line selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
.c select from test 2
.c select to test 3
update
-} {}
-test canvText-7.5 {DisplayText procedure: multi-line selection} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.5 {DisplayText procedure: multi-line selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
.c select from test 2
.c select to test 12
update
-} {}
-test canvText-7.6 {DisplayText procedure: draw cursor} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.6 {DisplayText procedure: draw cursor} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
.c icursor test 3
update
-} {}
-test canvText-7.7 {DisplayText procedure: selected text different color} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.7 {DisplayText procedure: selected text different color} -setup {
+ .c create text 20 20 -tag test
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
+ focus .c
+ .c focus test
+} -body {
.c config -selectforeground blue
.c itemconfig test -anchor n
update
-} {}
-test canvText-7.8 {DisplayText procedure: not selected} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.8 {DisplayText procedure: not selected} -setup {
+ .c create text 20 20 -tag test
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
+ focus .c
+ .c focus test
+} -body {
.c select clear
update
-} {}
-test canvText-7.9 {DisplayText procedure: select end} {
- catch {destroy .t}
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-7.9 {DisplayText procedure: select end} -setup {
+ destroy .t
+} -body {
toplevel .t
wm geometry .t +0+0
canvas .t.c
@@ -246,287 +493,398 @@ test canvText-7.9 {DisplayText procedure: select end} {
update
#catch {destroy .t}
update
-} {}
-
-test canvText-8.1 {TextInsert procedure: 0 length insert} {
+} -cleanup {
+ destroy .t
+} -result {}
+
+test canvText-8.1 {TextInsert procedure: 0 length insert} -setup {
+ .c create text 20 20 -tag test
+ .c itemconfig test -text "abcd\nefghi\njklmnopq"
+ focus .c
+ .c focus test
+} -body {
.c insert test end {}
-} {}
-test canvText-8.2 {TextInsert procedure: before beginning/after end} {
+} -cleanup {
+ .c delete test
+} -result {}
+test canvText-8.2 {TextInsert procedure: before beginning/after end} -body {
# Can't test this because GetTextIndex filters out those numbers.
-} {}
-test canvText-8.3 {TextInsert procedure: inserting in a selected item} {
+} -result {}
+test canvText-8.3 {TextInsert procedure: inserting in a selected item} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c insert test 1 "xyz"
.c itemcget test -text
-} {axyzbcdefg}
-test canvText-8.4 {TextInsert procedure: inserting before selection} {
+} -result {axyzbcdefg}
+test canvText-8.4 {TextInsert procedure: inserting before selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c insert test 1 "xyz"
list [.c index test sel.first] [.c index test sel.last]
-} {5 7}
-test canvText-8.5 {TextInsert procedure: inserting in selection} {
+} -result {5 7}
+test canvText-8.5 {TextInsert procedure: inserting in selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c insert test 3 "xyz"
list [.c index test sel.first] [.c index test sel.last]
-} {2 7}
-test canvText-8.6 {TextInsert procedure: inserting after selection} {
+} -result {2 7}
+test canvText-8.6 {TextInsert procedure: inserting after selection} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c insert test 5 "xyz"
list [.c index test sel.first] [.c index test sel.last]
-} {2 4}
-test canvText-8.7 {TextInsert procedure: inserting in unselected item} {
+} -result {2 4}
+test canvText-8.7 {TextInsert procedure: inserting in unselected item} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c select clear
.c insert test 5 "xyz"
.c itemcget test -text
-} {abcdexyzfg}
-test canvText-8.8 {TextInsert procedure: inserting before cursor} {
+} -result {abcdexyzfg}
+test canvText-8.8 {TextInsert procedure: inserting before cursor} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c icursor test 3
.c insert test 2 "xyz"
.c index test insert
-} {6}
-test canvText-8.9 {TextInsert procedure: inserting after cursor} {
+} -result {6}
+test canvText-8.9 {TextInsert procedure: inserting after cursor} -setup {
+ .c create text 20 20 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefg"
.c icursor test 3
.c insert test 4 "xyz"
.c index test insert
-} {3}
+} -result {3}
-test canvText-9.1 {TextInsert procedure: before beginning/after end} {
+# Item used in 9.* tests
+.c create text 20 20 -tag test
+test canvText-9.1 {TextInsert procedure: before beginning/after end} -body {
# Can't test this because GetTextIndex filters out those numbers.
-} {}
-test canvText-9.2 {TextInsert procedure: start > end} {
+} -result {}
+test canvText-9.2 {TextInsert procedure: start > end} -body {
.c itemconfig test -text "abcdefg"
.c dchars test 4 2
.c itemcget test -text
-} {abcdefg}
-test canvText-9.3 {TextInsert procedure: deleting from a selected item} {
+} -result {abcdefg}
+test canvText-9.3 {TextInsert procedure: deleting from a selected item} -body {
.c itemconfig test -text "abcdefg"
.c select from test 2
.c select to test 4
.c dchars test 3 5
.c itemcget test -text
-} {abcg}
-test canvText-9.4 {TextInsert procedure: deleting before start} {
+} -result {abcg}
+test canvText-9.4 {TextInsert procedure: deleting before start} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 1 1
list [.c index test sel.first] [.c index test sel.last]
-} {3 7}
-test canvText-9.5 {TextInsert procedure: keep start > first char deleted} {
+} -result {3 7}
+test canvText-9.5 {TextInsert procedure: keep start > first char deleted} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 2 6
list [.c index test sel.first] [.c index test sel.last]
-} {2 3}
-test canvText-9.6 {TextInsert procedure: deleting inside selection} {
+} -result {2 3}
+test canvText-9.6 {TextInsert procedure: deleting inside selection} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 6 6
list [.c index test sel.first] [.c index test sel.last]
-} {4 7}
-test canvText-9.7 {TextInsert procedure: keep end > first char deleted} {
+} -result {4 7}
+test canvText-9.7 {TextInsert procedure: keep end > first char deleted} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 6 10
list [.c index test sel.first] [.c index test sel.last]
-} {4 5}
-test canvText-9.8 {TextInsert procedure: selectFirst > selectLast: deselect} {
+} -result {4 5}
+test canvText-9.8 {TextInsert procedure: selectFirst > selectLast: deselect} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 3 10
- list [catch {.c index test sel.first} msg] $msg
-} {1 {selection isn't in item}}
-test canvText-9.9 {TextInsert procedure: selectFirst <= selectLast} {
+ .c index test sel.first
+} -returnCodes {error} -result {selection isn't in item}
+test canvText-9.9 {TextInsert procedure: selectFirst <= selectLast} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 4
.c select to test 8
.c dchars test 4 7
list [.c index test sel.first] [.c index test sel.last]
-} {4 4}
-test canvText-9.10 {TextInsert procedure: move anchor} {
+} -result {4 4}
+test canvText-9.10 {TextInsert procedure: move anchor} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 6
.c select to test 8
.c dchars test 2 4
.c select to test 1
list [.c index test sel.first] [.c index test sel.last]
-} {1 2}
-test canvText-9.11 {TextInsert procedure: keep anchor >= first} {
+} -result {1 2}
+test canvText-9.11 {TextInsert procedure: keep anchor >= first} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 6
.c select to test 8
.c dchars test 5 7
.c select to test 1
list [.c index test sel.first] [.c index test sel.last]
-} {1 4}
-test canvText-9.12 {TextInsert procedure: anchor doesn't move} {
+} -result {1 4}
+test canvText-9.12 {TextInsert procedure: anchor doesn't move} -body {
.c itemconfig test -text "abcdefghijk"
.c select from test 2
.c select to test 5
.c dchars test 6 8
.c select to test 8
list [.c index test sel.first] [.c index test sel.last]
-} {2 8}
-test canvText-9.13 {TextInsert procedure: move cursor} {
+} -result {2 8}
+test canvText-9.13 {TextInsert procedure: move cursor} -body {
.c itemconfig test -text "abcdefghijk"
.c icursor test 6
.c dchars test 2 4
.c index test insert
-} {3}
-test canvText-9.14 {TextInsert procedure: keep cursor >= first} {
+} -result {3}
+test canvText-9.14 {TextInsert procedure: keep cursor >= first} -body {
.c itemconfig test -text "abcdefghijk"
.c icursor test 6
.c dchars test 2 10
.c index test insert
-} {2}
-test canvText-9.15 {TextInsert procedure: cursor doesn't move} {
+} -result {2}
+test canvText-9.15 {TextInsert procedure: cursor doesn't move} -body {
.c itemconfig test -text "abcdefghijk"
.c icursor test 5
.c dchars test 7 9
.c index test insert
-} {5}
+} -result {5}
+.c delete test
-test canvText-10.1 {TextToPoint procedure} {
- .c coords test 0 0
+
+test canvText-10.1 {TextToPoint procedure} -body {
+ .c create text 0 0 -tag test
.c itemconfig test -text 0 -anchor center
.c index test @0,0
-} {0}
+} -cleanup {
+ .c delete test
+} -result {0}
-test canvText-11.1 {TextToArea procedure} {
- .c coords test 0 0
+
+test canvText-11.1 {TextToArea procedure} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text 0 -anchor center
- .c find overlapping 0 0 1 1
-} [.c find withtag test]
-test canvText-11.2 {TextToArea procedure} {
- .c coords test 0 0
+ set res1 [.c find overlapping 0 0 1 1]
+ set res2 [.c find withtag test]
+ expr {$res1 eq $res2}
+} -cleanup {
+ .c delete test
+} -result 1
+test canvText-11.2 {TextToArea procedure} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text 0 -anchor center
.c find overlapping 1000 1000 1001 1001
-} {}
+} -cleanup {
+ .c delete test
+} -result {}
-test canvText-12.1 {ScaleText procedure} {
- .c coords test 100 100
+
+test canvText-12.1 {ScaleText procedure} -body {
+ .c create text 100 100 -tag test
.c scale all 50 50 2 2
format {%.6g %.6g} {*}[.c coords test]
-} {150 150}
+} -cleanup {
+ .c delete test
+} -result {150 150}
+
-test canvText-13.1 {TranslateText procedure} {
- .c coords test 100 100
+test canvText-13.1 {TranslateText procedure} -body {
+ .c create text 100 100 -tag test
.c move all 10 10
format {%.6g %.6g} {*}[.c coords test]
-} {110 110}
-
-.c itemconfig test -text "abcdefghijklmno" -anchor nw
-.c select from test 5
-.c select to test 8
-.c icursor test 12
-.c coords test 0 0
-test canvText-14.1 {GetTextIndex procedure} {
+} -cleanup {
+ .c delete test
+} -result {110 110}
+
+
+test canvText-14.1 {GetTextIndex procedure} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcdefghijklmno" -anchor nw
+ .c select from test 5
+ .c select to test 8
+ .c icursor test 12
+ .c coords test 0 0
list [.c index test end] [.c index test insert] \
[.c index test sel.first] [.c index test sel.last] \
[.c index test @0,0] \
[.c index test -1] [.c index test 10] [.c index test 100]
-} {15 12 5 8 0 0 10 15}
-test canvText-14.2 {GetTextIndex procedure: select error} {
+} -cleanup {
+ .c delete test
+} -result {15 12 5 8 0 0 10 15}
+test canvText-14.2 {GetTextIndex procedure: select error} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c select clear
- list [catch {.c index test sel.first} msg] $msg
-} {1 {selection isn't in item}}
-test canvText-14.3 {GetTextIndex procedure: select error} {
+ .c index test sel.first
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {selection isn't in item}
+test canvText-14.3 {GetTextIndex procedure: select error} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c select clear
- list [catch {.c index test sel.last} msg] $msg
-} {1 {selection isn't in item}}
-test canvText-14.4 {GetTextIndex procedure: select error} {
+ .c index test sel.last
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {selection isn't in item}
+test canvText-14.4 {GetTextIndex procedure: select error} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c select clear
- list [catch {.c index test sel.} msg] $msg
-} {1 {bad index "sel."}}
-test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} {
- list [catch {.c index test xyz} msg] $msg
-} {1 {bad index "xyz"}}
-test canvText-14.6 {select clear errors} -body {
+ .c index test sel.
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {bad index "sel."}
+test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c index test xyz
+} -cleanup {
+ .c delete test
+} -returnCodes {error} -result {bad index "xyz"}
+test canvText-14.6 {select clear errors} -setup {
+ .c create text 0 0 -tag test
+} -body {
.c select clear test
+} -cleanup {
+ .c delete test
} -returnCodes error -result "wrong \# args: should be \".c select clear\""
-test canvText-15.1 {SetTextCursor procedure} {
+test canvText-15.1 {SetTextCursor procedure} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
+ .c itemconfig test -text "abcdefghijklmno" -anchor nw
.c itemconfig -text "abcdefg"
.c icursor test 3
.c index test insert
-} {3}
-
-test canvText-16.1 {GetSelText procedure} {
+} -cleanup {
+ .c delete test
+} -result {3}
+
+test canvText-16.1 {GetSelText procedure} -setup {
+ .c create text 0 0 -tag test
+ focus .c
+ .c focus test
+} -body {
.c itemconfig test -text "abcdefghijklmno" -anchor nw
.c select from test 5
.c select to test 8
selection get
-} {fghi}
+} -cleanup {
+ .c delete test
+} -result {fghi}
-set font {Courier 12 italic}
-set ax [font measure $font 0]
-set ay [font metrics $font -linespace]
-
-test canvText-17.1 {TextToPostscript procedure} {
+test canvText-17.1 {TextToPostscript procedure} -setup {
.c delete all
- .c config -height 300 -highlightthickness 0 -bd 0
- update
- .c create text 100 100 -tags test
- .c itemconfig test -font $font -text "00000000" -width [expr 3*$ax]
- .c itemconfig test -anchor n -fill black
- set x [.c postscript]
- set x [string range $x [string first "/Courier-Oblique" $x] end]
-} "/Courier-Oblique findfont [font actual $font -size] scalefont ISOEncode setfont
+ set result {/Courier-Oblique findfont [font actual $font -size] scalefont ISOEncode setfont
0.000 0.000 0.000 setrgbcolor AdjustColor
-100 200 \[
+0 100 200 \[
\[(000)\]
\[(000)\]
\[(00)\]
-] $ay -0.5 0.0 0 false DrawText
+\] $ay -0.5 0 0 false DrawText
grestore
restore showpage
%%Trailer
end
%%EOF
-"
+}
+} -body {
+ set font {Courier 12 italic}
+ set ax [font measure $font 0]
+ set ay [font metrics $font -linespace]
+ .c config -height 300 -highlightthickness 0 -bd 0
+ update
+ .c create text 100 100 -tags test
+ .c itemconfig test -font $font -text "00000000" -width [expr 3*$ax]
+ .c itemconfig test -anchor n -fill black
+ set x [.c postscript]
+ set x [string range $x [string first "/Courier-Oblique" $x] end]
+ expr {$x eq [subst $result] ? "ok" : $x}
+} -result ok
-test canvText-18.1 {bug fix 2525, find enclosed on text with newlines} {
- catch {destroy .c}
- canvas .c
- pack .c
- .c delete all
+test canvText-18.1 {bug fix 2525, find enclosed on text with newlines} -setup {
+ destroy .c
+} -body {
+ pack [canvas .c]
.c create text 100 100 -text Hello\n -anchor nw
set bbox [.c bbox 1]
set x2 [lindex $bbox 2]
set y2 [lindex $bbox 3]
incr y2
update
- .c find enclosed 99 99 [expr $x2 + $i] [expr $y2 + 1]
-} 1
+ .c find enclosed 99 99 [expr $x2 + 1] [expr $y2 + 1]
+} -cleanup {
+ destroy .c
+} -result 1
-test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} {
- catch {destroy .c}
+test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup {
+ destroy .c
set c [canvas .c -bg black -width 964]
pack $c
$c delete all
- after 1000 "set done 1" ; vwait done
-
+ after 100 "set done 1"; vwait done
+} -body {
set f {Arial 28 bold}
-
set s1 { Yeah-ah-ah-ah-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-Yow}
set s2 { Yeah ah ah ah oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh Yow}
-
$c create text 21 18 \
-font $f \
-text $s1 \
@@ -534,8 +892,7 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} {
-width 922 \
-anchor nw \
-tags tbox1
- eval {$c create rect} [$c bbox tbox1] -outline red
-
+ $c create rect {*}[$c bbox tbox1] -outline red
$c create text 21 160 \
-font $f \
-text $s2 \
@@ -543,32 +900,49 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} {
-width 922 \
-anchor nw \
-tags tbox2
- eval {$c create rect} [$c bbox tbox2] -outline red
-
- after 1000 "set done 1" ; vwait done
-
+ $c create rect {*}[$c bbox tbox2] -outline red
+ after 500 "set done 1" ; vwait done
set results [list]
-
$c select from tbox2 4
$c select to tbox2 8
lappend results [selection get]
-
$c select from tbox1 4
$c select to tbox1 8
lappend results [selection get]
-
array set metrics [font metrics $f]
set x [expr {21 + [font measure $f " "] \
+ ([font measure {Arial 28 bold} "Y"] / 2)}]
set y1 [expr {18 + ($metrics(-linespace) / 2)}]
set y2 [expr {160 + ($metrics(-linespace) / 2)}]
-
lappend results [$c index tbox1 @$x,$y1]
lappend results [$c index tbox2 @$x,$y2]
+} -cleanup {
+ destroy .c
+} -result {{Yeah } Yeah- 4 4}
- set results
-} {{Yeah } Yeah- 4 4}
-
+test canvText-20.1 {angled text bounding box} -setup {
+ destroy .c
+ canvas .c
+ proc transpose {bbox} {
+ lassign $bbox a b c d
+ list $b $a $d $c
+ }
+} -body {
+ .c create text 2 2 -tag t -anchor center -text 0 -font {Helvetica 24}
+ set bb0 [.c bbox t]
+ .c itemconf t -angle 90
+ set bb1 [.c bbox t]
+ .c itemconf t -angle 180
+ set bb2 [.c bbox t]
+ .c itemconf t -angle 270
+ set bb3 [.c bbox t]
+ list [expr {$bb0 eq $bb2 ? "ok" : "$bb0,$bb2"}] \
+ [expr {$bb1 eq $bb3 ? "ok" : "$bb1,$bb3"}] \
+ [expr {$bb0 eq [transpose $bb1] ? "ok" : "$bb0,$bb1"}] \
+} -cleanup {
+ destroy .c
+ rename transpose {}
+} -result {ok ok ok}
# cleanup
cleanupTests
diff --git a/tests/canvWind.test b/tests/canvWind.test
index 9844ff0..436ee2c 100644
--- a/tests/canvWind.test
+++ b/tests/canvWind.test
@@ -6,12 +6,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} {
- catch {destroy .t}
+test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} -setup {
+ destroy .t
+} -body {
toplevel .t
canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
-relief sunken -xscrollincrement 1 -yscrollincrement 1 \
@@ -37,9 +39,13 @@ test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} {
.t.c yview scroll -1 units
update
lappend x [list [winfo ismapped $f] [winfo y $f]]
-} {{1 23} {1 -29} {0 -29} {1 225} {0 225}}
-test canvWind-1.2 {DisplayWinItem, windows off-screen vertically} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {{1 23} {1 -29} {0 -29} {1 225} {0 225}}
+
+test canvWind-1.2 {DisplayWinItem, windows off-screen vertically} -setup {
+ destroy .t
+} -body {
toplevel .t
canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
-relief sunken -xscrollincrement 1 -yscrollincrement 1 \
@@ -65,9 +71,13 @@ test canvWind-1.2 {DisplayWinItem, windows off-screen vertically} {
.t.c yview scroll -1 units
update
lappend x [list [winfo ismapped $f] [winfo y $f]]
-} {{1 3} {1 -49} {0 -49} {1 205} {0 205}}
-test canvWind-1.3 {DisplayWinItem, windows off-screen horizontally} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {{1 3} {1 -49} {0 -49} {1 205} {0 205}}
+
+test canvWind-1.3 {DisplayWinItem, windows off-screen horizontally} -setup {
+ destroy .t
+} -body {
toplevel .t
canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
-relief sunken -xscrollincrement 1 -yscrollincrement 1 \
@@ -93,9 +103,13 @@ test canvWind-1.3 {DisplayWinItem, windows off-screen horizontally} {
.t.c xview scroll -1 units
update
lappend x [list [winfo ismapped $f] [winfo x $f]]
-} {{1 23} {1 -59} {0 -59} {1 275} {0 275}}
-test canvWind-1.4 {DisplayWinItem, windows off-screen horizontally} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {{1 23} {1 -59} {0 -59} {1 275} {0 275}}
+
+test canvWind-1.4 {DisplayWinItem, windows off-screen horizontally} -setup {
+ destroy .t
+} -body {
toplevel .t
canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
-relief sunken -xscrollincrement 1 -yscrollincrement 1 \
@@ -121,8 +135,9 @@ test canvWind-1.4 {DisplayWinItem, windows off-screen horizontally} {
.t.c xview scroll -1 units
update
lappend x [list [winfo ismapped $f] [winfo x $f]]
-} {{1 3} {1 -79} {0 -79} {1 255} {0 255}}
-catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {{1 3} {1 -79} {0 -79} {1 255} {0 255}}
# cleanup
cleanupTests
diff --git a/tests/canvas.test b/tests/canvas.test
index 6fea894..f5b33cc 100644
--- a/tests/canvas.test
+++ b/tests/canvas.test
@@ -1,95 +1,213 @@
-# This file is a Tcl script to test out the procedures in tkCanvas.c,
-# which implements generic code for canvases. It is organized in the
-# standard fashion for Tcl tests.
+# This file is a Tcl script to test out the procedures in tkCanvas.c, which
+# implements generic code for canvases. It is organized in the standard
+# fashion for Tcl tests.
#
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
+# Copyright (c) 2008 Donal K. Fellows
# All rights reserved.
package require tcltest 2.1
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
-# XXX - This test file is woefully incomplete. At present, only a
-# few of the features are tested.
+# XXX - This test file is woefully incomplete. At present, only a few of the
+# features are tested.
+# Canvas used in 1.* test cases
canvas .c
pack .c
update
-set i 1
-foreach {testname testinfo} {
- canvas-1.1 {-background #ff0000 #ff0000
- non-existent {unknown color name "non-existent"}}
- canvas-1.2 {-bg #ff0000 #ff0000
- non-existent {unknown color name "non-existent"}}
- canvas-1.3 {-bd 4 4 badValue {bad screen distance "badValue"}}
- canvas-1.4 {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
- canvas-1.5 {-closeenough 24 24.0
- bogus {expected floating-point number but got "bogus"}}
- canvas-1.6 {-confine true 1 silly {expected boolean value but got "silly"}}
- canvas-1.7 {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
- canvas-1.8 {-height 2.1 2 x42 {bad screen distance "x42"}}
- canvas-1.9 {-highlightbackground #112233 #112233
- ugly {unknown color name "ugly"}}
- canvas-1.10 {-highlightcolor #110022 #110022
- bogus {unknown color name "bogus"}}
- canvas-1.11 {-highlightthickness 18 18
- badValue {bad screen distance "badValue"}}
- canvas-1.12 {-insertbackground #110022 #110022
- bogus {unknown color name "bogus"}}
- canvas-1.13 {-insertborderwidth 1.3 1 2.6x {bad screen distance "2.6x"}}
- canvas-1.14 {-insertofftime 100 100 3.2 {expected integer but got "3.2"}}
- canvas-1.15 {-insertontime 100 100 3.2 {expected integer but got "3.2"}}
- canvas-1.16 {-insertwidth 1.3 1 6x {bad screen distance "6x"}}
- canvas-1.17 {-relief groove groove
- 1.5 {bad relief type "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
- canvas-1.18 {-selectbackground #110022 #110022
- bogus {unknown color name "bogus"}}
- canvas-1.19 {-selectborderwidth 1.3 1
- badValue {bad screen distance "badValue"}}
- canvas-1.20 {-selectforeground #654321 #654321
- bogus {unknown color name "bogus"}}
- canvas-1.21 {-takefocus "any string" "any string" {} {}}
- canvas-1.22 {-width 402 402 xyz {bad screen distance "xyz"}}
- canvas-1.23 {-xscrollcommand {Some command} {Some command} {} {}}
- canvas-1.24 {-yscrollcommand {Another command} {Another command} {} {}}
-} {
- lassign $testinfo name goodValue goodResult badValue badResult
- test $testname-good "configuration options: good value for $name" {
- .c configure $name $goodValue
- lindex [.c configure $name] 4
- } $goodResult
- incr i
- if {$badValue ne ""} {
- test $testname-bad "configuration options: bad value for $name" -body {
- .c configure $name $badValue
- } -returnCodes error -result $badResult
- }
- .c configure $name [lindex [.c configure $name] 3]
- incr i
-}
-test canvas-1.25 {configure throws error on bad option} {
- set res [list [catch {.c configure -gorp foo}]]
- .c create rect 10 10 100 100
- lappend res [catch {.c configure -gorp foo}]
- set res
-} [list 1 1]
+test canvas-1.1 {configuration options: good value for "background"} -body {
+ .c configure -background #ff0000
+ .c cget -background
+} -result {#ff0000}
+test canvas-1.2 {configuration options: bad value for "background"} -body {
+ .c configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test canvas-1.3 {configuration options: good value for "bg"} -body {
+ .c configure -bg #ff0000
+ .c cget -bg
+} -result {#ff0000}
+test canvas-1.4 {configuration options: bad value for "bg"} -body {
+ .c configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test canvas-1.5 {configuration options: good value for "bd"} -body {
+ .c configure -bd 4
+ .c cget -bd
+} -result {4}
+test canvas-1.6 {configuration options: bad value for "bd"} -body {
+ .c configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test canvas-1.7 {configuration options: good value for "borderwidth"} -body {
+ .c configure -borderwidth 1.3
+ .c cget -borderwidth
+} -result {1}
+test canvas-1.8 {configuration options: bad value for "borderwidth"} -body {
+ .c configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test canvas-1.9 {configuration options: good value for "closeenough"} -body {
+ .c configure -closeenough 24
+ .c cget -closeenough
+} -result {24.0}
+test canvas-1.10 {configuration options: bad value for "closeenough"} -body {
+ .c configure -closeenough bogus
+} -returnCodes error -result {expected floating-point number but got "bogus"}
+test canvas-1.11 {configuration options: good value for "confine"} -body {
+ .c configure -confine true
+ .c cget -confine
+} -result {1}
+test canvas-1.12 {configuration options: bad value for "confine"} -body {
+ .c configure -confine silly
+} -returnCodes error -result {expected boolean value but got "silly"}
+test canvas-1.13 {configuration options: good value for "cursor"} -body {
+ .c configure -cursor arrow
+ .c cget -cursor
+} -result {arrow}
+test canvas-1.14 {configuration options: bad value for "cursor"} -body {
+ .c configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test canvas-1.15 {configuration options: good value for "height"} -body {
+ .c configure -height 2.1
+ .c cget -height
+} -result {2}
+test canvas-1.16 {configuration options: bad value for "height"} -body {
+ .c configure -height x42
+} -returnCodes error -result {bad screen distance "x42"}
+test canvas-1.17 {configuration options: good value for "highlightbackground"} -body {
+ .c configure -highlightbackground #112233
+ .c cget -highlightbackground
+} -result {#112233}
+test canvas-1.18 {configuration options: bad value for "highlightbackground"} -body {
+ .c configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test canvas-1.19 {configuration options: good value for "highlightcolor"} -body {
+ .c configure -highlightcolor #110022
+ .c cget -highlightcolor
+} -result {#110022}
+test canvas-1.20 {configuration options: bad value for "highlightcolor"} -body {
+ .c configure -highlightcolor bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test canvas-1.21 {configuration options: good value for "highlightthickness"} -body {
+ .c configure -highlightthickness 18
+ .c cget -highlightthickness
+} -result {18}
+test canvas-1.22 {configuration options: bad value for "highlightthickness"} -body {
+ .c configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test canvas-1.23 {configuration options: good value for "insertbackground"} -body {
+ .c configure -insertbackground #110022
+ .c cget -insertbackground
+} -result {#110022}
+test canvas-1.24 {configuration options: bad value for "insertbackground"} -body {
+ .c configure -insertbackground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test canvas-1.25 {configuration options: good value for "insertborderwidth"} -body {
+ .c configure -insertborderwidth 1.3
+ .c cget -insertborderwidth
+} -result {1}
+test canvas-1.26 {configuration options: bad value for "insertborderwidth"} -body {
+ .c configure -insertborderwidth 2.6x
+} -returnCodes error -result {bad screen distance "2.6x"}
+test canvas-1.27 {configuration options: good value for "insertofftime"} -body {
+ .c configure -insertofftime 100
+ .c cget -insertofftime
+} -result {100}
+test canvas-1.28 {configuration options: bad value for "insertofftime"} -body {
+ .c configure -insertofftime 3.2
+} -returnCodes error -result {expected integer but got "3.2"}
+test canvas-1.29 {configuration options: good value for "insertontime"} -body {
+ .c configure -insertontime 100
+ .c cget -insertontime
+} -result {100}
+test canvas-1.30 {configuration options: bad value for "insertontime"} -body {
+ .c configure -insertontime 3.2
+} -returnCodes error -result {expected integer but got "3.2"}
+test canvas-1.31 {configuration options: good value for "insertwidth"} -body {
+ .c configure -insertwidth 1.3
+ .c cget -insertwidth
+} -result {1}
+test canvas-1.32 {configuration options: bad value for "insertwidth"} -body {
+ .c configure -insertwidth 6x
+} -returnCodes error -result {bad screen distance "6x"}
+test canvas-1.33 {configuration options: good value for "relief"} -body {
+ .c configure -relief groove
+ .c cget -relief
+} -result {groove}
+test canvas-1.34 {configuration options: bad value for "relief"} -body {
+ .c configure -relief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test canvas-1.35 {configuration options: good value for "selectbackground"} -body {
+ .c configure -selectbackground #110022
+ .c cget -selectbackground
+} -result {#110022}
+test canvas-1.36 {configuration options: bad value for "selectbackground"} -body {
+ .c configure -selectbackground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test canvas-1.37 {configuration options: good value for "selectborderwidth"} -body {
+ .c configure -selectborderwidth 1.3
+ .c cget -selectborderwidth
+} -result {1}
+test canvas-1.38 {configuration options: bad value for "selectborderwidth"} -body {
+ .c configure -selectborderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test canvas-1.39 {configuration options: good value for "selectforeground"} -body {
+ .c configure -selectforeground #654321
+ .c cget -selectforeground
+} -result {#654321}
+test canvas-1.40 {configuration options: bad value for "selectforeground"} -body {
+ .c configure -selectforeground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test canvas-1.41 {configuration options: good value for "takefocus"} -body {
+ .c configure -takefocus "any string"
+ .c cget -takefocus
+} -result {any string}
+test canvas-1.42 {configuration options: good value for "width"} -body {
+ .c configure -width 402
+ .c cget -width
+} -result {402}
+test canvas-1.43 {configuration options: bad value for "width"} -body {
+ .c configure -width xyz
+} -returnCodes error -result {bad screen distance "xyz"}
+test canvas-1.44 {configuration options: good value for "xscrollcommand"} -body {
+ .c configure -xscrollcommand {Some command}
+ .c cget -xscrollcommand
+} -result {Some command}
+test canvas-1.45 {configuration options: good value for "yscrollcommand"} -body {
+ .c configure -yscrollcommand {Another command}
+ .c cget -yscrollcommand
+} -result {Another command}
+test canvas-1.46 {configure throws error on bad option} -body {
+ .c configure -gorp foo
+} -returnCodes error -match glob -result {*}
+test canvas-1.47 {configure throws error on bad option} -body {
+ catch {.c configure -gorp foo}
+ .c create rect 10 10 100 100
+ .c configure -gorp foo
+} -returnCodes error -match glob -result {*}
catch {destroy .c}
+
+# Canvas used in 2.* test cases
canvas .c -width 60 -height 40 -scrollregion {0 0 200 150} -bd 0 \
-highlightthickness 0
pack .c
update
-test canvas-2.1 {CanvasWidgetCmd, bind option} {
+test canvas-2.1 {CanvasWidgetCmd, bind option} -body {
set i [.c create rect 10 10 100 100]
- list [catch {.c bind $i <a>} msg] $msg
-} {0 {}}
-test canvas-2.2 {CanvasWidgetCmd, bind option} {
+ .c bind $i <a>
+} -cleanup {
+ .c delete $i
+} -returnCodes ok
+test canvas-2.2 {CanvasWidgetCmd, bind option} -body {
set i [.c create rect 10 10 100 100]
- list [catch {.c bind $i <} msg] $msg
-} {1 {no event type or button # or keysym}}
-test canvas-2.3 {CanvasWidgetCmd, xview option} {
+ .c bind $i <
+} -cleanup {
+ .c delete $i
+} -returnCodes error -result {no event type or button # or keysym}
+test canvas-2.3 {CanvasWidgetCmd, xview option} -body {
.c configure -xscrollincrement 40 -yscrollincrement 5
.c xview moveto 0
update
@@ -97,10 +215,10 @@ test canvas-2.3 {CanvasWidgetCmd, xview option} {
.c xview scroll 2 units
update
lappend x [.c xview]
-} {{0.0 0.3} {0.4 0.7}}
-test canvas-2.4 {CanvasWidgetCmd, xview option} {nonPortable} {
- # This test gives slightly different results on platforms such
- # as NetBSD. I don't know why...
+} -result {{0.0 0.3} {0.4 0.7}}
+test canvas-2.4 {CanvasWidgetCmd, xview option} -constraints nonPortable -body {
+ # This test gives slightly different results on platforms such as NetBSD.
+ # I don't know why...
.c configure -xscrollincrement 0 -yscrollincrement 5
.c xview moveto 0.6
update
@@ -108,14 +226,16 @@ test canvas-2.4 {CanvasWidgetCmd, xview option} {nonPortable} {
.c xview scroll 2 units
update
lappend x [.c xview]
-} {{0.6 0.9} {0.66 0.96}}
-
+} -result {{0.6 0.9} {0.66 0.96}}
catch {destroy .c}
+
+# Canvas used in 3.* test cases
canvas .c -width 60 -height 40 -scrollregion {0 0 200 80} \
-borderwidth 0 -highlightthickness 0
pack .c
update
-test canvas-3.1 {CanvasWidgetCmd, yview option} {
+
+test canvas-3.1 {CanvasWidgetCmd, yview option} -body {
.c configure -xscrollincrement 40 -yscrollincrement 5
.c yview moveto 0
update
@@ -123,8 +243,8 @@ test canvas-3.1 {CanvasWidgetCmd, yview option} {
.c yview scroll 3 units
update
lappend x [.c yview]
-} {{0.0 0.5} {0.1875 0.6875}}
-test canvas-3.2 {CanvasWidgetCmd, yview option} {
+} -result {{0.0 0.5} {0.1875 0.6875}}
+test canvas-3.2 {CanvasWidgetCmd, yview option} -body {
.c configure -xscrollincrement 40 -yscrollincrement 0
.c yview moveto 0
update
@@ -132,39 +252,43 @@ test canvas-3.2 {CanvasWidgetCmd, yview option} {
.c yview scroll 2 units
update
lappend x [.c yview]
-} {{0.0 0.5} {0.1 0.6}}
+} -result {{0.0 0.5} {0.1 0.6}}
+destroy .c
-test canvas-4.1 {ButtonEventProc procedure} {
+test canvas-4.1 {ButtonEventProc procedure} -setup {
deleteWindows
+ set x {}
+} -body {
canvas .c1 -bg #543210
rename .c1 .c2
- set x {}
lappend x [winfo children .]
lappend x [.c2 cget -bg]
destroy .c1
lappend x [info command .c*] [winfo children .]
-} {.c1 #543210 {} {}}
+} -result {.c1 #543210 {} {}}
-test canvas-5.1 {ButtonCmdDeletedProc procedure} {
- deleteWindows
+test canvas-5.1 {ButtonCmdDeletedProc procedure} -body {
canvas .c1
rename .c1 {}
list [info command .c*] [winfo children .]
-} {{} {}}
+} -cleanup {
+ destroy .c1
+} -result {{} {}}
-catch {destroy .c}
+# Canvas used in 6.* test cases
canvas .c -width 100 -height 50 -scrollregion {-200 -100 305 102} \
-borderwidth 2 -highlightthickness 3
pack .c
update
-test canvas-6.1 {CanvasSetOrigin procedure} {
+
+test canvas-6.1 {CanvasSetOrigin procedure} -body {
.c configure -xscrollincrement 0 -yscrollincrement 0
.c xview moveto 0
.c yview moveto 0
update
list [.c canvasx 0] [.c canvasy 0]
-} {-205.0 -105.0}
-test canvas-6.2 {CanvasSetOrigin procedure} {
+} -result {-205.0 -105.0}
+test canvas-6.2 {CanvasSetOrigin procedure} -body {
.c configure -xscrollincrement 20 -yscrollincrement 10
set x ""
foreach i {.08 .10 .48 .50} {
@@ -172,9 +296,9 @@ test canvas-6.2 {CanvasSetOrigin procedure} {
update
lappend x [.c canvasx 0]
}
- set x
-} {-165.0 -145.0 35.0 55.0}
-test canvas-6.3 {CanvasSetOrigin procedure} {
+ return $x
+} -result {-165.0 -145.0 35.0 55.0}
+test canvas-6.3 {CanvasSetOrigin procedure} -body {
.c configure -xscrollincrement 20 -yscrollincrement 10
set x ""
foreach i {.06 .08 .70 .72} {
@@ -182,30 +306,29 @@ test canvas-6.3 {CanvasSetOrigin procedure} {
update
lappend x [.c canvasy 0]
}
- set x
-} {-95.0 -85.0 35.0 45.0}
-test canvas-6.4 {CanvasSetOrigin procedure} {
+ return $x
+} -result {-95.0 -85.0 35.0 45.0}
+test canvas-6.4 {CanvasSetOrigin procedure} -body {
.c configure -xscrollincrement 20 -yscrollincrement 10
.c xview moveto 1.0
.c canvasx 0
-} {215.0}
-test canvas-6.5 {CanvasSetOrigin procedure} {
+} -result {215.0}
+test canvas-6.5 {CanvasSetOrigin procedure} -body {
.c configure -xscrollincrement 20 -yscrollincrement 10
.c yview moveto 1.0
.c canvasy 0
-} {55.0}
-
+} -result {55.0}
deleteWindows
-set l [lsort [interp hidden]]
test canvas-7.1 {canvas widget vs hidden commands} -setup {
- catch {destroy .c}
-} -body {
canvas .c
+} -body {
interp hide {} .c
destroy .c
list [winfo children .] [lsort [interp hidden]]
-} -result [list {} $l]
+} -cleanup {
+ destroy .c
+} -result [list {} [lsort [interp hidden]]]
test canvas-8.1 {canvas arc bbox} -setup {
catch {destroy .c}
@@ -224,11 +347,10 @@ test canvas-9.1 {canvas id creation and deletion} -setup {
catch {destroy .c}
canvas .c
} -body {
- # With Tk 8.0.4 the ids are now stored in a hash table. You
- # can use this test as a performance test with older versions
- # by changing the value of size.
+ # With Tk 8.0.4 the ids are now stored in a hash table. You can use this
+ # test as a performance test with older versions by changing the value of
+ # size.
set size 15
-
for {set i 0} {$i < $size} {incr i} {
set x [expr {-10 + 3*$i}]
for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
@@ -238,10 +360,8 @@ test canvas-9.1 {canvas id creation and deletion} -setup {
-anchor center -tags text
}
}
-
- # The actual bench mark - this code also exercises all the hash
- # table changes.
-
+ # The actual bench mark - this code also exercises all the hash table
+ # changes.
set time [lindex [time {
foreach id [.c find withtag all] {
.c lower $id
@@ -251,12 +371,13 @@ test canvas-9.1 {canvas id creation and deletion} -setup {
.c delete $id
}
}] 0]
-
set x ""
} -result {}
+
test canvas-10.1 {find items using tag expressions} -setup {
catch {destroy .c}
canvas .c
+ set res {}
} -body {
.c create oval 20 20 40 40 -fill red -tag [list a b c d]
.c create oval 20 60 40 80 -fill yellow -tag [list b a]
@@ -265,7 +386,6 @@ test canvas-10.1 {find items using tag expressions} -setup {
.c create oval 20 180 40 200 -fill bisque -tag [list a d e]
.c create oval 20 220 40 240 -fill bisque -tag b
.c create oval 20 260 40 280 -fill bisque -tag [list d "tag with spaces"]
- set res {}
lappend res [.c find withtag {!a}]
lappend res [.c find withtag {b&&c}]
lappend res [.c find withtag {b||c}]
@@ -332,9 +452,9 @@ test canvas-10.8 {check errors from tag expressions} -setup {
canvas .c
.c create oval 20 20 40 40 -fill red -tag [list a b c d]
.c create oval 20 260 40 280 -fill bisque -tag [list d "tag with spaces"]
-} -body {
+} -returnCodes error -body {
.c find withtag {a&&"tag with spaces"z}
-} -returnCodes error -result {Invalid boolean operator in tag search expression}
+} -result {Invalid boolean operator in tag search expression}
test canvas-10.9 {check errors from tag expressions} -setup {
catch {destroy .c}
canvas .c
@@ -354,7 +474,8 @@ test canvas-10.10 {check errors from tag expressions} -setup {
test canvas-10.11 {backward compatility - strange tags that are not expressions} -setup {
catch {destroy .c}
canvas .c
- .c create oval 20 20 40 40 -fill red -tag [list { strange tag(xxx&yyy|zzz) " && \" || ! ^ " }]
+ .c create oval 20 20 40 40 -fill red \
+ -tag [list { strange tag(xxx&yyy|zzz) " && \" || ! ^ " }]
} -body {
.c find withtag { strange tag(xxx&yyy|zzz) " && \" || ! ^ " }
} -result 1
@@ -386,22 +507,22 @@ test canvas-11.1 {canvas poly fill check, bug 5783} -setup {
test canvas-11.2 {canvas poly overlap fill check, bug 226357} -setup {
destroy .c
pack [canvas .c]
-} -body {
set result {}
+} -body {
.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
+ 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
+ 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
+ lappend result [.c find over 45 50 45 50]; # outside poly
} -result {1 1 {} 1 {} 1 1 {} 1 {} 1}
test canvas-11.3 {canvas poly dchars, bug 3291543} {
# This would crash
@@ -434,6 +555,7 @@ test canvas-12.2 {canvas mm obj, patch SF-403327, 102471} -setup {
incr val
} -result 12
+# procedure used in 13.1 test case
proc kill_canvas {w} {
destroy $w
pack [canvas $w -height 200 -width 200] -fill both -expand yes
@@ -443,11 +565,9 @@ proc kill_canvas {w} {
$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} {
+test canvas-13.1 {canvas delete during event, SF bug-228024} -body {
kill_canvas .c
set ::x {}
# do this many times to improve chances of triggering the crash
@@ -455,27 +575,27 @@ test canvas-13.1 {canvas delete during event, SF bug-228024} {
event generate .c <1> -x 100 -y 100
event generate .c <ButtonRelease-1> -x 100 -y 100
}
- set ::x
-} okokokokokokokokokokokokokokokokokokokokokokokokokokokokokok
+ return $::x
+} -result {okokokokokokokokokokokokokokokokokokokokokokokokokokokokokok}
test canvas-14.1 {canvas scan SF bug 581560} -setup {
destroy .c
canvas .c
-} -body {
+} -returnCodes error -body {
.c scan
-} -returnCodes error -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
+} -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
test canvas-14.2 {canvas scan} -setup {
destroy .c
canvas .c
-} -body {
+} -returnCodes error -body {
.c scan bogus
-} -returnCodes error -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
+} -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
test canvas-14.3 {canvas scan} -setup {
destroy .c
canvas .c
-} -body {
+} -returnCodes error -body {
.c scan mark
-} -returnCodes error -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
+} -result {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}
test canvas-14.4 {canvas scan} -setup {
destroy .c
canvas .c
@@ -495,37 +615,133 @@ test canvas-14.6 {canvas scan} -setup {
.c scan dragto 10 10 5
} -result {}
-set i 0
-proc create {w type args} {
- eval [list $w create $type] $args
-}
-foreach type {arc bitmap image line oval polygon rect text window} {
- incr i
- test canvas-15.$i "basic types check: $type requires coords" -setup {
- destroy .c
- canvas .c
- } -body {
- .c create $type
- } -returnCodes error -result [format {wrong # args: should be ".c create %s coords ?arg arg ...?"} $type]
- incr i
- test canvas-15.$i "basic coords check: $type coords are paired" -setup {
- destroy .c
- canvas .c
- } -match glob -body {
- .c create $type 0
- } -returnCodes error -result "wrong # coordinates: expected*"
-}
+test canvas-15.1 {basic types check: arc requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create arc
+} -result {wrong # args: should be ".c create arc coords ?arg ...?"}
+test canvas-15.2 "basic coords check: arc coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -body {
+ .c create arc 0
+} -returnCodes error -result {wrong # coordinates: expected 4, got 1}
+test canvas-15.3 {basic types check: bitmap requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create bitmap
+} -result {wrong # args: should be ".c create bitmap coords ?arg ...?"}
+test canvas-15.4 "basic coords check: bitmap coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -body {
+ .c create bitmap 0
+} -returnCodes error -result {wrong # coordinates: expected 2, got 1}
+test canvas-15.5 {basic types check: image requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create image
+} -result {wrong # args: should be ".c create image coords ?arg ...?"}
+test canvas-15.6 "basic coords check: image coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create image 0
+} -result {wrong # coordinates: expected 2, got 1}
+test canvas-15.7 {basic types check: line requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create line
+} -result {wrong # args: should be ".c create line coords ?arg ...?"}
+test canvas-15.8 "basic coords check: line coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create line 0
+} -result {wrong # coordinates: expected an even number, got 1}
+test canvas-15.9 {basic types check: oval requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create oval
+} -result {wrong # args: should be ".c create oval coords ?arg ...?"}
+test canvas-15.10 "basic coords check: oval coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create oval 0
+} -result {wrong # coordinates: expected 0 or 4, got 1}
+test canvas-15.11 {basic types check: polygon requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create polygon
+} -result {wrong # args: should be ".c create polygon coords ?arg ...?"}
+test canvas-15.12 "basic coords check: polygon coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create polygon 0
+} -result {wrong # coordinates: expected an even number, got 1}
+test canvas-15.13 {basic types check: rect requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create rect
+} -result {wrong # args: should be ".c create rect coords ?arg ...?"}
+test canvas-15.14 "basic coords check: rect coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create rect 0
+} -result {wrong # coordinates: expected 0 or 4, got 1}
+test canvas-15.15 {basic types check: text requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create text
+} -result {wrong # args: should be ".c create text coords ?arg ...?"}
+test canvas-15.16 "basic coords check: text coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create text 0
+} -result {wrong # coordinates: expected 2, got 1}
+test canvas-15.17 {basic types check: window requires coords} -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create window
+} -result {wrong # args: should be ".c create window coords ?arg ...?"}
+test canvas-15.18 "basic coords check: window coords are paired" -setup {
+ destroy .c
+ canvas .c
+} -returnCodes error -body {
+ .c create window 0
+} -result {wrong # coordinates: expected 2, got 1}
+test canvas-15.19 "basic coords check: centimeters are larger than pixels" -setup {
+ destroy .c
+ canvas .c
+} -body {
+ set id [.c create rect 0 0 1cm 1cm]
+ expr {[lindex [.c coords $id] 2]>1}
+} -result {1}
+destroy .c
test canvas-16.1 {arc coords check} -setup {
- destroy .c
canvas .c
} -body {
set id [.c create arc {0 10 20 30} -start 33]
.c itemcget $id -start
+} -cleanup {
+ destroy .c
} -result {33.0}
test canvas-17.1 {default smooth method handling} -setup {
- destroy .c
canvas .c
} -body {
set id [.c create line {0 0 1 1 2 2 3 3 4 4 5 5 6 6}]
@@ -534,11 +750,211 @@ test canvas-17.1 {default smooth method handling} -setup {
.c itemconfigure $id -smooth $smoother
lappend result [.c itemcget $id -smooth]
}
- set result
+ return $result
+} -cleanup {
+ destroy .c
} -result {0 true true true raw raw true}
-destroy .c
+test canvas-18.1 {imove method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id 0 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {4.0 4.0 1.0 1.0 2.0 2.0 3.0 3.0}
+test canvas-18.2 {imove method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1]
+ .c imove $id 0 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {4.0 4.0 1.0 1.0}
+test canvas-18.3 {imove method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id @1,1 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 4.0 4.0 2.0 2.0 3.0 3.0}
+test canvas-18.4 {imove method - lines} -constraints knownBug -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id end 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 1.0 1.0 2.0 2.0 4.0 4.0}
+test canvas-18.5 {imove method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c imove $id 0 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {4.0 4.0 1.0 1.0 2.0 2.0 3.0 3.0}
+test canvas-18.6 {imove method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1]
+ .c imove $id 0 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {4.0 4.0 1.0 1.0}
+test canvas-18.7 {imove method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c imove $id @1,1 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 4.0 4.0 2.0 2.0 3.0 3.0}
+test canvas-18.8 {imove method - polygon} -constraints knownBug -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c imove $id end 4 4
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 1.0 1.0 2.0 2.0 4.0 4.0}
+test canvas-18.9 {imove method - errors} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id foobar 4 4
+} -cleanup {
+ destroy .c
+} -returnCodes error -result {bad index "foobar"}
+test canvas-18.10 {imove method - errors} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id 0 foobar 4
+} -cleanup {
+ destroy .c
+} -returnCodes error -result {bad screen distance "foobar"}
+test canvas-18.11 {imove method - errors} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c imove $id 0 4 foobar
+} -cleanup {
+ destroy .c
+} -returnCodes error -result {bad screen distance "foobar"}
+
+test canvas-19.1 {rchars method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {4 4}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 4.0 4.0 3.0 3.0}
+test canvas-19.2 {rchars method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 3.0 3.0}
+test canvas-19.3 {rchars method - lines} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {10 11 12 13 14 15}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 10.0 11.0 12.0 13.0 14.0 15.0 3.0 3.0}
+test canvas-19.4 {rchars method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {4 4}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 4.0 4.0 3.0 3.0}
+test canvas-19.5 {rchars method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 3.0 3.0}
+test canvas-19.6 {rchars method - polygon} -setup {
+ canvas .c
+} -body {
+ set id [.c create polygon 0 0 1 1 2 2 3 3]
+ .c rchars $id 2 4 {10 11 12 13 14 15}
+ .c coords $id
+} -cleanup {
+ destroy .c
+} -result {0.0 0.0 10.0 11.0 12.0 13.0 14.0 15.0 3.0 3.0}
+test canvas-19.7 {rchars method - text} -setup {
+ canvas .c
+} -body {
+ set id [.c create text 0 0 -text abcde]
+ .c rchars $id 1 3 XYZ
+ .c itemcget $id -text
+} -cleanup {
+ destroy .c
+} -result aXYZe
+test canvas-19.8 {rchars method - text} -setup {
+ canvas .c
+} -body {
+ set id [.c create text 0 0 -text abcde]
+ .c rchars $id 1 3 {}
+ .c itemcget $id -text
+} -cleanup {
+ destroy .c
+} -result ae
+test canvas-19.9 {rchars method - text} -setup {
+ canvas .c
+} -body {
+ set id [.c create text 0 0 -text abcde]
+ .c rchars $id 1 3 FOOBAR
+ .c itemcget $id -text
+} -cleanup {
+ destroy .c
+} -result aFOOBARe
+test canvas-19.10 {rchars method - errors} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1]
+ .c rchars $id foo 1 {2 2}
+} -cleanup {
+ destroy .c
+} -returnCodes error -result {bad index "foo"}
+test canvas-19.11 {rchars method - errors} -setup {
+ canvas .c
+} -body {
+ set id [.c create line 0 0 1 1]
+ .c rchars $id 1 foo {2 2}
+} -cleanup {
+ destroy .c
+} -returnCodes error -result {bad index "foo"}
# cleanup
+imageCleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/choosedir.test b/tests/choosedir.test
index 01a319f..fb6e62d 100644
--- a/tests/choosedir.test
+++ b/tests/choosedir.test
@@ -5,7 +5,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -84,61 +85,86 @@ set fake [file join $dir non-existant]
set parent .
-foreach opt {-initialdir -mustexist -parent -title} {
- test choosedir-1.1$opt "tk_chooseDirectory command" unix {
- list [catch {tk_chooseDirectory $opt} msg] $msg
- } [list 1 "value for \"$opt\" missing"]
-}
-test choosedir-1.2 "tk_chooseDirectory command" unix {
- list [catch {tk_chooseDirectory -foo bar} msg] $msg
-} [list 1 "bad option \"-foo\": must be -initialdir, -mustexist, -parent, or -title"]
-test choosedir-1.3 "tk_chooseDirectory command" unix {
- list [catch {tk_chooseDirectory -parent foo.bar} msg] $msg
-} {1 {bad window path name "foo.bar"}}
-
-
-test choosedir-2.1 "tk_chooseDirectory command, cancel gives null" {unix notAqua} {
+test choosedir-1.1 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -initialdir
+} -returnCodes error -result {value for "-initialdir" missing}
+test choosedir-1.2 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -mustexist
+} -returnCodes error -result {value for "-mustexist" missing}
+test choosedir-1.3 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -parent
+} -returnCodes error -result {value for "-parent" missing}
+test choosedir-1.4 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -title
+} -returnCodes error -result {value for "-title" missing}
+
+test choosedir-1.5 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -foo bar
+} -returnCodes error -result {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title}
+test choosedir-1.6 {tk_chooseDirectory command} -constraints unix -body {
+ tk_chooseDirectory -parent foo.bar
+} -returnCodes error -result {bad window path name "foo.bar"}
+
+
+test choosedir-2.1 {tk_chooseDirectory command, cancel gives null} -constraints {
+ unix notAqua
+} -body {
ToPressButton $parent cancel
tk_chooseDirectory -title "Press Cancel" -parent $parent
-} ""
+} -result {}
-test choosedir-3.1 "tk_chooseDirectory -mustexist 1" {unix notAqua} {
+
+test choosedir-3.1 {tk_chooseDirectory -mustexist 1} -constraints {
+ unix notAqua
+} -body {
# first enter a bogus dirname, then enter a real one.
ToEnterDirsByKey $parent [list $fake $real $real]
set result [tk_chooseDirectory \
-title "Enter \"$fake\", press OK, enter \"$real\", press OK" \
-parent $parent -mustexist 1]
set result
-} $real
-test choosedir-3.2 "tk_chooseDirectory -mustexist 0" {unix notAqua} {
+} -result $real
+test choosedir-3.2 {tk_chooseDirectory -mustexist 0} -constraints {
+ unix notAqua
+} -body {
ToEnterDirsByKey $parent [list $fake $fake]
tk_chooseDirectory -title "Enter \"$fake\", press OK" \
-parent $parent -mustexist 0
-} $fake
+} -result $fake
+
-test choosedir-4.1 "tk_chooseDirectory command, initialdir" {unix notAqua} {
+test choosedir-4.1 {tk_chooseDirectory command, initialdir} -constraints {
+ unix notAqua
+} -body {
ToPressButton $parent ok
tk_chooseDirectory -title "Press Ok" -parent $parent -initialdir $real
-} $real
-test choosedir-4.2 "tk_chooseDirectory command, initialdir" {unix notAqua} {
+} -result $real
+test choosedir-4.2 {tk_chooseDirectory command, initialdir} -constraints {
+ unix notAqua
+} -body {
ToEnterDirsByKey $parent [list $fake $fake]
tk_chooseDirectory \
-title "Enter \"$fake\" and press Ok" \
-parent $parent -initialdir $real
-} $fake
-test choosedir-4.3 "tk_chooseDirectory, -initialdir {}" {unix notAqua} {
+} -result $fake
+test choosedir-4.3 {tk_chooseDirectory command, {} initialdir} -constraints {
+ unix notAqua
+} -body {
catch {unset ::tk::dialog::file::__tk_choosedir}
ToPressButton $parent ok
tk_chooseDirectory \
-title "Press OK" \
-parent $parent -initialdir ""
-} [pwd]
+} -result [pwd]
+
-test choosedir-5.1 "tk_chooseDirectory, handles {} entry text" {unix notAqua} {
+test choosedir-5.1 {tk_chooseDirectory, handles {} entry text} -constraints {
+ unix notAqua
+} -body {
ToEnterDirsByKey $parent [list "" $real $real]
tk_chooseDirectory -title "Clear entry, Press OK; Enter $real, press OK" \
-parent $parent
-} $real
+} -result $real
# cleanup
removeDirectory choosedirTest
diff --git a/tests/clipboard.test b/tests/clipboard.test
index 37e45a3..6077940 100644
--- a/tests/clipboard.test
+++ b/tests/clipboard.test
@@ -11,7 +11,8 @@
# environment variable TK_ALT_DISPLAY is set to an alternate display.
#
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -23,124 +24,189 @@ 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} {
}
# Now we start the main body of the test code
-
-test clipboard-1.1 {ClipboardHandler procedure} {
+
+test clipboard-1.1 {ClipboardHandler procedure} -setup {
clipboard clear
+} -body {
clipboard append "test"
clipboard get
-} {test}
-test clipboard-1.2 {ClipboardHandler procedure} {
+} -cleanup {
+ clipboard clear
+} -result {test}
+test clipboard-1.2 {ClipboardHandler procedure} -setup {
clipboard clear
+} -body {
clipboard append "test"
clipboard append "ing"
clipboard get
-} {testing}
-test clipboard-1.3 {ClipboardHandler procedure} {
+} -cleanup {
clipboard clear
+} -result {testing}
+test clipboard-1.3 {ClipboardHandler procedure} -setup {
+ clipboard clear
+} -body {
clipboard append "t"
clipboard append "e"
clipboard append "s"
clipboard append "t"
clipboard get
-} {test}
-test clipboard-1.4 {ClipboardHandler procedure} {
+} -cleanup {
+ clipboard clear
+} -result {test}
+test clipboard-1.4 {ClipboardHandler procedure} -setup {
clipboard clear
+} -body {
clipboard append $longValue
clipboard get
-} "$longValue"
-test clipboard-1.5 {ClipboardHandler procedure} {
+} -cleanup {
clipboard clear
+} -result "$longValue"
+test clipboard-1.5 {ClipboardHandler procedure} -setup {
+ clipboard clear
+} -body {
clipboard append $longValue
clipboard append "test"
clipboard get
-} "${longValue}test"
-test clipboard-1.6 {ClipboardHandler procedure} {
+} -cleanup {
+ clipboard clear
+} -result "${longValue}test"
+test clipboard-1.6 {ClipboardHandler procedure} -setup {
clipboard clear
+} -body {
clipboard append -t TEST $longValue
clipboard append -t STRING "test"
- list [clipboard get -t STRING] \
- [clipboard get -t TEST]
-} [list test $longValue]
-test clipboard-1.7 {ClipboardHandler procedure} {
+ list [clipboard get -t STRING] [clipboard get -t TEST]
+} -cleanup {
clipboard clear
+} -result [list test $longValue]
+test clipboard-1.7 {ClipboardHandler procedure} -setup {
+ clipboard clear
+} -body {
clipboard append -t TEST [string range $longValue 1 4000]
clipboard append -t STRING "test"
- list [clipboard get -t STRING] \
- [clipboard get -t TEST]
-} [list test [string range $longValue 1 4000]]
-test clipboard-1.8 {ClipboardHandler procedure} {
+ list [clipboard get -t STRING] [clipboard get -t TEST]
+} -cleanup {
+ clipboard clear
+} -result [list test [string range $longValue 1 4000]]
+test clipboard-1.8 {ClipboardHandler procedure} -setup {
clipboard clear
+} -body {
clipboard append ""
clipboard get
-} {}
-test clipboard-1.9 {ClipboardHandler procedure} {
+} -cleanup {
clipboard clear
+} -result {}
+test clipboard-1.9 {ClipboardHandler procedure} -setup {
+ clipboard clear
+} -body {
clipboard append ""
clipboard append "Test"
clipboard get
-} {Test}
+} -cleanup {
+ clipboard clear
+} -result {Test}
##############################################################################
-test clipboard-2.1 {ClipboardAppHandler procedure} {
+test clipboard-2.1 {ClipboardAppHandler procedure} -setup {
set oldAppName [tk appname]
- tk appname UnexpectedName
clipboard clear
+} -body {
+ tk appname UnexpectedName
clipboard append -type NEW_TYPE Data
- set result [selection get -selection CLIPBOARD -type TK_APPLICATION]
+ selection get -selection CLIPBOARD -type TK_APPLICATION
+} -cleanup {
tk appname $oldAppName
- set result
-} {UnexpectedName}
+ clipboard clear
+} -result {UnexpectedName}
##############################################################################
-test clipboard-3.1 {ClipboardWindowHandler procedure} {
+test clipboard-3.1 {ClipboardWindowHandler procedure} -setup {
set oldAppName [tk appname]
- tk appname UnexpectedName
clipboard clear
+} -body {
+ tk appname UnexpectedName
clipboard append -type NEW_TYPE Data
- set result [selection get -selection CLIPBOARD -type TK_WINDOW]
+ selection get -selection CLIPBOARD -type TK_WINDOW
+} -cleanup {
tk appname $oldAppName
- set result
-} {.}
+ clipboard clear
+} -result {.}
##############################################################################
-test clipboard-4.1 {ClipboardLostSel procedure} {
+test clipboard-4.1 {ClipboardLostSel procedure} -setup {
clipboard clear
+} -body {
clipboard append "Test"
selection clear -s CLIPBOARD
- list [catch {clipboard get} msg] $msg
-} {1 {CLIPBOARD selection doesn't exist or form "STRING" not defined}}
-test clipboard-4.2 {ClipboardLostSel procedure} {
+ clipboard get
+} -cleanup {
+ clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "STRING" not defined}
+test clipboard-4.2 {ClipboardLostSel procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append "Test"
+ clipboard append -t TEST "Test2"
+ selection clear -s CLIPBOARD
+ clipboard get
+} -cleanup {
+ clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "STRING" not defined}
+test clipboard-4.3 {ClipboardLostSel procedure} -setup {
clipboard clear
+} -body {
clipboard append "Test"
clipboard append -t TEST "Test2"
selection clear -s CLIPBOARD
- 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} {
+ catch {clipboard get}
+ clipboard get -t TEST
+} -cleanup {
+ clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "TEST" not defined}
+test clipboard-4.4 {ClipboardLostSel procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append "Test"
+ clipboard append -t TEST "Test2"
+ clipboard append "Test3"
+ selection clear -s CLIPBOARD
+ clipboard get
+} -cleanup {
clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "STRING" not defined}
+test clipboard-4.5 {ClipboardLostSel procedure} -setup {
+ clipboard clear
+} -body {
clipboard append "Test"
clipboard append -t TEST "Test2"
clipboard append "Test3"
selection clear -s CLIPBOARD
- 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}}
+ catch {clipboard get}
+ clipboard get -t TEST
+} -cleanup {
+ clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "TEST" not defined}
+
+
##############################################################################
-test clipboard-5.1 {Tk_ClipboardClear procedure} {
+test clipboard-5.1 {Tk_ClipboardClear procedure} -setup {
clipboard clear
+} -body {
clipboard append -t TEST "test"
set result [lsort [clipboard get TARGETS]]
clipboard clear
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} {
+} -cleanup {
clipboard clear
+} -result {{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test clipboard-5.2 {Tk_ClipboardClear procedure} -setup {
+ clipboard clear
+} -body {
clipboard append -t TEST "test"
set result [lsort [clipboard get TARGETS]]
selection own -s CLIPBOARD .
@@ -148,97 +214,148 @@ test clipboard-5.2 {Tk_ClipboardClear procedure} {
clipboard clear
clipboard append -t TEST "test"
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}}
+} -cleanup {
+ clipboard clear
+} -result {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
##############################################################################
-test clipboard-6.1 {Tk_ClipboardAppend procedure} {
+test clipboard-6.1 {Tk_ClipboardAppend procedure} -setup {
clipboard clear
+} -body {
clipboard append "first chunk"
selection own -s CLIPBOARD .
- list [catch {
clipboard append " second chunk"
clipboard get
- } msg] $msg
-} {0 {first chunk second chunk}}
-test clipboard-6.2 {Tk_ClipboardAppend procedure} unix {
- setupbg
+} -cleanup {
+ clipboard clear
+} -returnCodes ok -result {first chunk second chunk}
+test clipboard-6.2 {Tk_ClipboardAppend procedure} -constraints unix -setup {
clipboard clear
+} -body {
+ setupbg
clipboard append -f INTEGER -t TEST "16"
set result [dobg {clipboard get TEST}]
+ return $result
+} -cleanup {
+ clipboard clear
cleanupbg
- set result
-} {0x10 }
-test clipboard-6.3 {Tk_ClipboardAppend procedure} {
+} -result {0x10 }
+test clipboard-6.3 {Tk_ClipboardAppend procedure} -setup {
clipboard clear
+} -body {
clipboard append -f INTEGER -t TEST "16"
- list [catch {clipboard append -t TEST "test"} msg] $msg
-} {1 {format "STRING" does not match current format "INTEGER" for TEST}}
+ clipboard append -t TEST "test"
+} -cleanup {
+ clipboard clear
+} -returnCodes error -result {format "STRING" does not match current format "INTEGER" for TEST}
##############################################################################
-test clipboard-7.1 {Tk_ClipboardCmd procedure} {
- list [catch {clipboard} msg] $msg
-} {1 {wrong # args: should be "clipboard option ?arg arg ...?"}}
-test clipboard-7.2 {Tk_ClipboardCmd procedure} {
- clipboard clear
- list [catch {clipboard append --} msg] $msg \
- [selection get -selection CLIPBOARD]
-} {0 {} --}
-test clipboard-7.3 {Tk_ClipboardCmd procedure} {
- clipboard clear
- list [catch {clipboard append -- information} msg] $msg \
- [selection get -selection CLIPBOARD]
-} {0 {} information}
-test clipboard-7.4 {Tk_ClipboardCmd procedure} {
- list [catch {clipboard append --x a b} msg] $msg
-} {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"}}
-test clipboard-7.6 {Tk_ClipboardCmd procedure} {
- clipboard clear
- list [catch {clipboard append -format} msg] $msg \
- [selection get -selection CLIPBOARD]
-} {0 {} -format}
-test clipboard-7.7 {Tk_ClipboardCmd procedure} {
- list [catch {clipboard append -displayofoo f} msg] $msg
-} {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"}}
-test clipboard-7.9 {Tk_ClipboardCmd procedure} {
- list [catch {clipboard append -displayof foo "test"} msg] $msg
-} {1 {bad window path name "foo"}}
-
-test clipboard-7.10 {Tk_ClipboardCmd procedure} {
- list [catch {clipboard clear -displayof} msg] $msg
-} {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 {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 ?-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 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}
-
+test clipboard-7.1 {Tk_ClipboardCmd procedure} -body {
+ clipboard
+} -returnCodes error -result {wrong # args: should be "clipboard option ?arg ...?"}
+test clipboard-7.2 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append --
+} -cleanup {
+ clipboard clear
+} -returnCodes ok -result {}
+test clipboard-7.3 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append --
+ selection get -selection CLIPBOARD
+} -cleanup {
+ clipboard clear
+} -result {--}
+test clipboard-7.4 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -- information
+ selection get -selection CLIPBOARD
+} -cleanup {
+ clipboard clear
+} -result {information}
+test clipboard-7.5 {Tk_ClipboardCmd procedure} -body {
+ clipboard append --x a b
+} -returnCodes error -result {bad option "--x": must be -displayof, -format, or -type}
+test clipboard-7.6 {Tk_ClipboardCmd procedure} -body {
+ clipboard append -- a b
+} -returnCodes error -result {wrong # args: should be "clipboard append ?-option value ...? data"}
+test clipboard-7.7 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -format
+} -returnCodes ok -result {}
+test clipboard-7.8 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -format
+ selection get -selection CLIPBOARD
+} -cleanup {
+ clipboard clear
+} -result {-format}
+test clipboard-7.9 {Tk_ClipboardCmd procedure} -body {
+ clipboard append -displayofoo f
+} -returnCodes error -result {bad option "-displayofoo": must be -displayof, -format, or -type}
+test clipboard-7.10 {Tk_ClipboardCmd procedure} -body {
+ clipboard append -type TEST
+} -returnCodes error -result {wrong # args: should be "clipboard append ?-option value ...? data"}
+test clipboard-7.11 {Tk_ClipboardCmd procedure} -body {
+ clipboard append -displayof foo "test"
+} -returnCodes error -result {bad window path name "foo"}
+test clipboard-7.12 {Tk_ClipboardCmd procedure} -body {
+ clipboard clear -displayof
+} -returnCodes error -result {wrong # args: should be "clipboard clear ?-displayof window?"}
+test clipboard-7.13 {Tk_ClipboardCmd procedure} -body {
+ clipboard clear -displayofoo f
+} -returnCodes error -result {bad option "-displayofoo": must be -displayof}
+test clipboard-7.14 {Tk_ClipboardCmd procedure} -body {
+ clipboard clear foo
+} -returnCodes error -result {wrong # args: should be "clipboard clear ?-displayof window?"}
+test clipboard-7.15 {Tk_ClipboardCmd procedure} -body {
+ clipboard clear -displayof foo
+} -returnCodes error -result {bad window path name "foo"}
+test clipboard-7.16 {Tk_ClipboardCmd procedure} -body {
+ clipboard error
+} -returnCodes error -result {bad option "error": must be append, clear, or get}
+test clipboard-7.17 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -displayof
+} -cleanup {
+ clipboard clear
+} -returnCodes ok -result {}
+test clipboard-7.18 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -displayof
+ selection get -selection CLIPBOARD
+} -cleanup {
+ clipboard clear
+} -result {-displayof}
+test clipboard-7.19 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -type
+} -cleanup {
+ clipboard clear
+} -returnCodes ok -result {}
+test clipboard-7.20 {Tk_ClipboardCmd procedure} -setup {
+ clipboard clear
+} -body {
+ clipboard append -type
+ selection get -selection CLIPBOARD
+} -cleanup {
+ clipboard clear
+} -result {-type}
+
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/clrpick.test b/tests/clrpick.test
index 8b3769e..5f1b8b5 100644
--- a/tests/clrpick.test
+++ b/tests/clrpick.test
@@ -5,9 +5,10 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
if {[testConstraint defaultPseudocolor8]} {
# let's soak up a bunch of colors...so that
@@ -43,51 +44,54 @@ if {[testConstraint defaultPseudocolor8]} {
testConstraint colorsLeftover 0
}
-test clrpick-1.1 {tk_chooseColor command} {
- list [catch {tk_chooseColor -foo} msg] $msg
-} {1 {bad option "-foo": must be -initialcolor, -parent, or -title}}
-
-catch {tk_chooseColor -foo 1} msg
-regsub -all , $msg "" options
-regsub \"-foo\" $options "" options
-
-foreach option $options {
- if {[string index $option 0] eq "-"} {
- test clrpick-1.2$option {tk_chooseColor command} -body {
- tk_chooseColor $option
- } -returnCodes error -result "value for \"$option\" missing"
- }
-}
-
-test clrpick-1.3 {tk_chooseColor command} {
- list [catch {tk_chooseColor -foo bar} msg] $msg
-} {1 {bad option "-foo": must be -initialcolor, -parent, or -title}}
-test clrpick-1.4 {tk_chooseColor command} {
- list [catch {tk_chooseColor -initialcolor} msg] $msg
-} {1 {value for "-initialcolor" missing}}
-test clrpick-1.5 {tk_chooseColor command} {
- list [catch {tk_chooseColor -parent foo.bar} msg] $msg
-} {1 {bad window path name "foo.bar"}}
-test clrpick-1.6 {tk_chooseColor command} {
- list [catch {tk_chooseColor -initialcolor badbadbaadcolor} msg] $msg
-} {1 {unknown color name "badbadbaadcolor"}}
-test clrpick-1.7 {tk_chooseColor command} {
- list [catch {tk_chooseColor -initialcolor ##badbadbaadcolor} msg] $msg
-} {1 {invalid color name "##badbadbaadcolor"}}
-
+test clrpick-1.1 {tk_chooseColor command} -body {
+ tk_chooseColor -foo
+} -returnCodes error -result {bad option "-foo": must be -initialcolor, -parent, or -title}
+
+test clrpick-1.2 {tk_chooseColor command } -body {
+ tk_chooseColor -initialcolor
+} -returnCodes error -result {value for "-initialcolor" missing}
+test clrpick-1.2.1 {tk_chooseColor command } -body {
+ tk_chooseColor -parent
+} -returnCodes error -result {value for "-parent" missing}
+test clrpick-1.2.2 {tk_chooseColor command } -body {
+ tk_chooseColor -title
+} -returnCodes error -result {value for "-title" missing}
+
+test clrpick-1.3 {tk_chooseColor command} -body {
+ tk_chooseColor -foo bar
+} -returnCodes error -result {bad option "-foo": must be -initialcolor, -parent, or -title}
+test clrpick-1.4 {tk_chooseColor command} -body {
+ tk_chooseColor -initialcolor
+} -returnCodes error -result {value for "-initialcolor" missing}
+test clrpick-1.5 {tk_chooseColor command} -body {
+ tk_chooseColor -parent foo.bar
+} -returnCodes error -result {bad window path name "foo.bar"}
+test clrpick-1.6 {tk_chooseColor command} -body {
+ tk_chooseColor -initialcolor badbadbaadcolor
+} -returnCodes error -result {unknown color name "badbadbaadcolor"}
+test clrpick-1.7 {tk_chooseColor command} -body {
+ tk_chooseColor -initialcolor ##badbadbaadcolor
+} -returnCodes error -result {invalid color name "##badbadbaadcolor"}
+
+
+# tests 3.1 and 3.2 fail when individually run
+# if there is no catch {tk_chooseColor -foo 1} msg
+# before settin isNative
+catch {tk_chooseColor -foo 1} msg
set isNative [expr {[info commands tk::dialog::color::] eq ""}]
proc ToPressButton {parent btn} {
global isNative
if {!$isNative} {
- after 200 "SendButtonPress $parent $btn mouse"
+ after 200 "SendButtonPress . $btn mouse"
}
}
proc ToChooseColorByKey {parent r g b} {
global isNative
if {!$isNative} {
- after 200 ChooseColorByKey $parent $r $g $b
+ after 200 ChooseColorByKey . $r $g $b
}
}
@@ -115,7 +119,7 @@ proc ChooseColorByKey {parent r g b} {
# the values for us.
tk::dialog::color::HandleRGBEntry $w
- SendButtonPress $parent ok mouse
+ SendButtonPress . ok mouse
}
proc SendButtonPress {parent btn type} {
@@ -137,65 +141,76 @@ proc SendButtonPress {parent btn type} {
}
}
-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
-# Interesting thing...when this is too long, the
-# delay caused in processing it kills the automated testing,
-# and makes a lot of the test cases fail.
-#set verylongstring $verylongstring$verylongstring
-#set verylongstring $verylongstring$verylongstring
-#set verylongstring $verylongstring$verylongstring
-#set verylongstring $verylongstring$verylongstring
-
-set color #404040
-test clrpick-2.1 {tk_chooseColor command} \
- {nonUnixUserInteraction colorsLeftover} {
- ToPressButton $parent ok
- tk_chooseColor -title "Press Ok $verylongstring" -initialcolor $color \
- -parent $parent
-} "$color"
-set color #808040
-test clrpick-2.2 {tk_chooseColor command} \
- {nonUnixUserInteraction colorsLeftover} {
+
+
+test clrpick-2.1 {tk_chooseColor command} -constraints {
+ nonUnixUserInteraction colorsLeftover
+} -setup {
+ set verylongstring longstring:
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ #set verylongstring $verylongstring$verylongstring
+ # Interesting thing...when this is too long, the
+ # delay caused in processing it kills the automated testing,
+ # and makes a lot of the test cases fail.
+ #set verylongstring $verylongstring$verylongstring
+ #set verylongstring $verylongstring$verylongstring
+ #set verylongstring $verylongstring$verylongstring
+ #set verylongstring $verylongstring$verylongstring
+} -body {
+ ToPressButton . ok
+ tk_chooseColor -title "Press Ok $verylongstring" -initialcolor #404040 \
+ -parent .
+} -result {#404040}
+test clrpick-2.2 {tk_chooseColor command} -constraints {
+ nonUnixUserInteraction colorsLeftover
+} -body {
set colors "128 128 64"
- ToChooseColorByKey $parent 128 128 64
- tk_chooseColor -parent $parent -title "choose $colors"
-} "$color"
-test clrpick-2.3 {tk_chooseColor command} \
- {nonUnixUserInteraction colorsLeftover} {
- ToPressButton $parent ok
- tk_chooseColor -parent $parent -title "Press OK"
-} "$color"
-test clrpick-2.4 {tk_chooseColor command} {nonUnixUserInteraction} {
- ToPressButton $parent cancel
- tk_chooseColor -parent $parent -title "Press Cancel"
-} ""
-
-set color "#000000"
-test clrpick-3.1 {tk_chooseColor: background events} {nonUnixUserInteraction} {
+ ToChooseColorByKey . 128 128 64
+ tk_chooseColor -parent . -title "choose #808040"
+} -result {#808040}
+test clrpick-2.3 {tk_chooseColor command} -constraints {
+ nonUnixUserInteraction colorsLeftover
+} -body {
+ ToPressButton . ok
+ tk_chooseColor -parent . -title "Press OK"
+} -result {#808040}
+test clrpick-2.4 {tk_chooseColor command} -constraints {
+ nonUnixUserInteraction colorsLeftover
+} -body {
+ ToPressButton . cancel
+ tk_chooseColor -parent . -title "Press Cancel"
+} -result {}
+
+
+test clrpick-3.1 {tk_chooseColor: background events} -constraints {
+ nonUnixUserInteraction
+} -body {
after 1 {set x 53}
- ToPressButton $parent ok
- tk_chooseColor -parent $parent -title "Press OK" -initialcolor $color
-} "#000000"
-test clrpick-3.2 {tk_chooseColor: background events} {nonUnixUserInteraction} {
+ ToPressButton . ok
+ tk_chooseColor -parent . -title "Press OK" -initialcolor #000000
+} -result {#000000}
+test clrpick-3.2 {tk_chooseColor: background events} -constraints {
+ nonUnixUserInteraction
+} -body {
after 1 {set x 53}
- ToPressButton $parent cancel
- tk_chooseColor -parent $parent -title "Press Cancel"
-} ""
+ ToPressButton . cancel
+ tk_chooseColor -parent . -title "Press Cancel"
+} -result {}
-test clrpick-4.1 {tk_chooseColor: screen is inherited from parent} {unix notAqua} {
+
+test clrpick-4.1 {tk_chooseColor: screen is inherited from parent} -constraints {
+ unix notAqua
+} -body {
after 50 {set ::scr [winfo screen .__tk__color]}
- ToPressButton $parent cancel
- tk_chooseColor -parent $parent
+ ToPressButton . cancel
+ tk_chooseColor -parent .
set ::scr
-} [winfo screen $parent]
+} -result [winfo screen .]
# cleanup
cleanupTests
return
+
diff --git a/tests/cmds.test b/tests/cmds.test
index f630209..fa7e788 100644
--- a/tests/cmds.test
+++ b/tests/cmds.test
@@ -5,38 +5,56 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
update
-test cmds-1.1 {tkwait visibility, argument errors} {
- list [catch {tkwait visibility} msg] $msg
-} {1 {wrong # args: should be "tkwait variable|visibility|window name"}}
-test cmds-1.2 {tkwait visibility, argument errors} {
- list [catch {tkwait visibility foo bar} msg] $msg
-} {1 {wrong # args: should be "tkwait variable|visibility|window name"}}
-test cmds-1.3 {tkwait visibility, argument errors} {
- list [catch {tkwait visibility bad_window} msg] $msg
-} {1 {bad window path name "bad_window"}}
-test cmds-1.4 {tkwait visibility, waiting for window to be mapped} {
+test cmds-1.1 {tkwait visibility, argument errors} -body {
+ tkwait visibility
+} -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"}
+test cmds-1.2 {tkwait visibility, argument errors} -body {
+ tkwait visibility foo bar
+} -returnCodes {error} -result {wrong # args: should be "tkwait variable|visibility|window name"}
+test cmds-1.3 {tkwait visibility, argument errors} -body {
+ tkwait visibility bad_window
+} -returnCodes {error} -result {bad window path name "bad_window"}
+test cmds-1.4 {tkwait visibility, waiting for window to be mapped} -setup {
button .b -text "Test"
set x init
+} -body {
after 100 {set x delay; place .b -x 0 -y 0}
tkwait visibility .b
+ return $x
+} -cleanup {
destroy .b
- set x
-} {delay}
-test cmds-1.5 {tkwait visibility, window gets deleted} {
+} -result {delay}
+test cmds-1.5 {tkwait visibility, window gets deleted} -setup {
frame .f
button .f.b -text "Test"
pack .f.b
set x init
+} -body {
after 100 {set x deleted; destroy .f}
- list [catch {tkwait visibility .f.b} msg] $msg $x
-} {1 {window ".f.b" was deleted before its visibility changed} deleted}
+ tkwait visibility .f.b
+} -returnCodes {error} -result {window ".f.b" was deleted before its visibility changed}
+test cmds-1.6 {tkwait visibility, window gets deleted} -setup {
+ frame .f
+ button .f.b -text "Test"
+ pack .f.b
+ set x init
+} -body {
+ after 100 {set x deleted; destroy .f}
+ catch {tkwait visibility .f.b}
+ return $x
+} -cleanup {
+ destroy .f
+} -result {deleted}
+
# cleanup
cleanupTests
return
+
diff --git a/tests/config.test b/tests/config.test
index 0d1e0e1..8f7aa9f 100644
--- a/tests/config.test
+++ b/tests/config.test
@@ -6,7 +6,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -14,436 +15,1038 @@ proc killTables {} {
# Note: it's important to delete chain2 before chain1, because
# chain2 depends on chain1. If chain1 is deleted first, the
# delete of chain2 will crash.
-
+ deleteWindows
foreach t {alltypes chain2 chain1 configerror internal new notenoughparams
twowindows} {
- while {[testobjconfig info $t] != ""} {
- testobjconfig delete $t
- }
+ while {[testobjconfig info $t] != ""} {
+ testobjconfig delete $t
+ }
}
}
+
+option clear
+deleteWindows
if {[testConstraint testobjconfig]} {
killTables
}
-test config-1.1 {Tk_CreateOptionTable - reference counts} testobjconfig {
- deleteWindows
- killTables
+test config-1.1 {Tk_CreateOptionTable - reference counts} -constraints {
+ testobjconfig
+} -body {
set x {}
testobjconfig alltypes .a
lappend x [testobjconfig info alltypes]
testobjconfig alltypes .b
lappend x [testobjconfig info alltypes]
- deleteWindows
set x
-} {{1 16 -boolean} {2 16 -boolean}}
-test config-1.2 {Tk_CreateOptionTable - synonym initialization} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+} -result {{1 16 -boolean} {2 16 -boolean}}
+test config-1.2 {Tk_CreateOptionTable - synonym initialization} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .a -synonym green
.a cget -color
-} {green}
-test config-1.3 {Tk_CreateOptionTable - option database initialization} testobjconfig {
- deleteWindows
- option clear
+} -cleanup {
+ killTables
+} -result {green}
+test config-1.3 {Tk_CreateOptionTable - option database initialization} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
option clear
+} -result {foo different}
+test config-1.4 {Tk_CreateOptionTable - option database initialization} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+ option clear
+} -result {foo bar}
+test config-1.5 {Tk_CreateOptionTable - default initialization} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .a
.a cget -relief
-} {raised}
-test config-1.6 {Tk_CreateOptionTable - chained tables} testobjconfig {
- deleteWindows
+} -cleanup {
killTables
+} -result {raised}
+test config-1.6 {Tk_CreateOptionTable - chained tables} -constraints {
+ testobjconfig
+} -body {
testobjconfig chain1 .a
testobjconfig chain2 .b
testobjconfig info chain2
-} {1 4 -three 2 2 -one}
-test config-1.7 {Tk_CreateOptionTable - chained tables} testobjconfig {
- deleteWindows
+} -cleanup {
killTables
+} -result {1 4 -three 2 2 -one}
+test config-1.7 {Tk_CreateOptionTable - chained tables} -constraints {
+ testobjconfig
+} -body {
testobjconfig chain2 .b
testobjconfig chain1 .a
testobjconfig info chain2
-} {1 4 -three 2 2 -one}
-test config-1.8 {Tk_CreateOptionTable - chained tables} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+} -result {1 4 -three 2 2 -one}
+test config-1.8 {Tk_CreateOptionTable - chained tables} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ .a cget -four
+} -cleanup {
killTables
+} -returnCodes error -result {unknown option "-four"}
+test config-1.9 {Tk_CreateOptionTable - chained tables} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig chain1 .a
+ testobjconfig chain2 .b
+ catch {.a cget -four}
+ list [.a cget -one] [.b cget -four] [.b cget -one]
+} -cleanup {
+ killTables
+} -result {one four one}
+
+
+test config-2.1 {Tk_DeleteOptionTable - reference counts} -constraints {
+ testobjconfig
+} -body {
+ set x {}
testobjconfig chain1 .a
testobjconfig chain2 .b
testobjconfig chain2 .c
deleteWindows
- set x {}
testobjconfig delete chain2
lappend x [testobjconfig info chain2] [testobjconfig info chain1]
testobjconfig delete chain2
lappend x [testobjconfig info chain2] [testobjconfig info chain1]
-} {{1 4 -three 2 2 -one} {2 2 -one} {} {1 2 -one}}
+} -cleanup {
+ killTables
+} -result {{1 4 -three 2 2 -one} {2 2 -one} {} {1 2 -one}}
# No tests for DestroyOptionHashTable; couldn't figure out how to test.
-test config-3.1 {Tk_InitOptions - priority of chained tables} testobjconfig {
- deleteWindows
+test config-3.1 {Tk_InitOptions - priority of chained tables} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
- option clear
+} -cleanup {
+ killTables
+} -result {two {two and a half}}
+test config-3.2 {Tk_InitOptions - initialize from database} -constraints {
+ testobjconfig
+} -body {
option add *a.color blue
testobjconfig alltypes .a
list [.a cget -color]
-} {blue}
-test config-3.3 {Tk_InitOptions - initialize from database} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
option clear
+} -result {blue}
+test config-3.3 {Tk_InitOptions - initialize from database} -constraints {
+ testobjconfig
+} -body {
option add *a.justify bogus
testobjconfig alltypes .a
list [.a cget -justify]
-} {left}
-test config-3.4 {Tk_InitOptions - initialize from widget class} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+ option clear
+} -result {left}
+test config-3.4 {Tk_InitOptions - initialize from widget class} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .a
list [.a cget -color]
-} {red}
-test config-3.5 {Tk_InitOptions - no initial value} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+} -result {red}
+test config-3.5 {Tk_InitOptions - no initial value} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .a
.a cget -anchor
-} {}
-test config-3.6 {Tk_InitOptions - bad initial value} testobjconfig {
- deleteWindows
+} -cleanup {
+ killTables
+} -result {}
+test config-3.6 {Tk_InitOptions - bad initial value} -constraints {
+ testobjconfig
+} -body {
+ option add *a.color non-existent
+ testobjconfig alltypes .a
+} -cleanup {
+ killTables
option clear
+} -returnCodes error -result {unknown color name "non-existent"}
+test config-3.7 {Tk_InitOptions - bad initial value} -constraints {
+ testobjconfig
+} -body {
option add *a.color non-existent
- list [catch {testobjconfig alltypes .a} msg] $msg $errorInfo
-} {1 {unknown color name "non-existent"} {unknown color name "non-existent"
+ catch {testobjconfig alltypes .a}
+ return $errorInfo
+} -cleanup {
+ killTables
+ option clear
+} -result {unknown color name "non-existent"
(database entry for "-color" in widget ".a")
invoked from within
-"testobjconfig alltypes .a"}}
-option clear
-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"
+"testobjconfig alltypes .a"}
+
+test config-3.8 {Tk_InitOptions - bad initial value} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig configerror
+} -returnCodes error -result {expected integer but got "bogus"}
+test config-3.9 {Tk_InitOptions - bad initial value} -constraints {
+ testobjconfig
+} -body {
+ catch {testobjconfig configerror}
+ return $errorInfo
+} -result {expected integer but got "bogus"
(default value for "-int")
invoked from within
-"testobjconfig configerror"}}
-option clear
+"testobjconfig configerror"}
-test config-4.1 {DoObjConfig - boolean} testobjconfig {
+test config-4.1 {DoObjConfig - boolean} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -boolean 0
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.2 {DoObjConfig - boolean} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -boolean 0
+ .foo cget -boolean
+} -cleanup {
+ killTables
+} -returnCodes ok -result {0}
+test config-4.3 {DoObjConfig - boolean} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -boolean 0
+ .foo cget -boolean
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.4 {DoObjConfig - boolean} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -boolean 1
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.5 {DoObjConfig - boolean} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -boolean 1
+ .foo cget -boolean
+} -cleanup {
+ killTables
+} -returnCodes ok -result {1}
+test config-4.6 {DoObjConfig - boolean} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -boolean 1
+ .foo cget -boolean
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.7 {DoObjConfig - invalid boolean} -constraints {
+ testobjconfig
+} -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -boolean {}
+} -cleanup {
+ killTables
+} -returnCodes error -result {expected boolean value but got ""}
+test config-4.8 {DoObjConfig - boolean internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -boolean 0
.foo cget -boolean
-} {0}
-test config-4.5 {DoObjConfig - integer} testobjconfig {
+} -cleanup {
+ killTables
+} -result {0}
+
+test config-4.9 {DoObjConfig - integer} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -integer 3
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.10 {DoObjConfig - integer} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -integer 3
+ .foo cget -integer
+} -cleanup {
+ killTables
+} -returnCodes ok -result {3}
+test config-4.11 {DoObjConfig - integer} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -integer 3
+ .foo cget -integer
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.12 {DoObjConfig - invalid integer} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -integer bar
+} -cleanup {
+ killTables
+} -cleanup {
+ killTables
+} -returnCodes error -result {expected integer but got "bar"}
+test config-4.13 {DoObjConfig - integer internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -integer 421
.foo cget -integer
-} {421}
-test config-4.8 {DoObjConfig - double} testobjconfig {
+} -cleanup {
+ killTables
+} -result {421}
+
+test config-4.14 {DoObjConfig - double} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -double 3.14
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.15 {DoObjConfig - double} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -double 3.14
+ .foo cget -double
+} -cleanup {
+ killTables
+} -returnCodes ok -result {3.14}
+test config-4.16 {DoObjConfig - double} -constraints testobjconfig -setup {
catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -double 3.14
+ .foo cget -double
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.17 {DoObjConfig - invalid double} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -double bar
+} -cleanup {
+ killTables
+} -returnCodes error -result {expected floating-point number but got "bar"}
+test config-4.18 {DoObjConfig - double internal value} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -double 62.75
.foo cget -double
-} {62.75}
-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} 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} testobjconfig {
+} -cleanup {
+ killTables
+} -result {62.75}
+
+test config-4.19 {DoObjConfig - string} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string test
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.20 {DoObjConfig - string} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string test
+ .foo cget -string
+} -cleanup {
+ killTables
+} -returnCodes ok -result {test}
+test config-4.21 {DoObjConfig - string} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string test
+ .foo cget -string
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.22 {DoObjConfig - null string} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.23 {DoObjConfig - null string} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string {}
+ .foo cget -string
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.24 {DoObjConfig - null string} -constraints testobjconfig -setup {
catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -string {}
+ .foo cget -string
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+
+test config-4.25 {DoObjConfig - string internal value} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -string "this is a test"
.foo cget -string
-} {this is a test}
-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} 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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {this is a test}
+
+test config-4.26 {DoObjConfig - string table} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -stringtable two
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.27 {DoObjConfig - string table} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -stringtable two
+ .foo cget -stringtable
+} -cleanup {
+ killTables
+} -returnCodes ok -result {two}
+test config-4.28 {DoObjConfig - string table} -constraints testobjconfig -body {
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} testobjconfig {
+ .foo cget -stringtable
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.29 {DoObjConfig - invalid string table} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -stringtable foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad stringtable "foo": must be one, two, three, or four}
+
+test config-4.30 {DoObjConfig - new string table} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -stringtable two
+ .foo configure -stringtable three
+} -cleanup {
+ killTables
+} -returnCodes ok -result {16}
+test config-4.31 {DoObjConfig - new string table} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -stringtable two
+ .foo configure -stringtable three
+ .foo cget -stringtable
+} -cleanup {
+ killTables
+} -returnCodes ok -result {three}
+test config-4.32 {DoObjConfig - new string table} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -stringtable two
+ .foo configure -stringtable three
+ .foo cget -stringtable
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.33 {DoObjConfig - stringtable internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -stringtable "four"
.foo cget -stringtable
-} {four}
-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} 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} testobjconfig {
+} -cleanup {
+ killTables
+} -result {four}
+
+test config-4.34 {DoObjConfig - color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color blue
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.35 {DoObjConfig - color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color blue
+ .foo cget -color
+} -cleanup {
+ killTables
+} -returnCodes ok -result {blue}
+test config-4.36 {DoObjConfig - color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color blue
+ .foo cget -color
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.37 {DoObjConfig - invalid color} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -color xxx
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown color name "xxx"}
+test config-4.38 {DoObjConfig - color internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -color purple
.foo cget -color
-} {purple}
-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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {purple}
+
+test config-4.39 {DoObjConfig - null color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.40 {DoObjConfig - null color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color {}
+ .foo cget -color
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.41 {DoObjConfig - null color} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -color {}
+ .foo cget -color
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+test config-4.42 {DoObjConfig - getting rid of old color} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
+ .foo configure -color #444444
+} -cleanup {
+ killTables
+} -returnCodes ok -result {32}
+test config-4.43 {DoObjConfig - getting rid of old color} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -color #333333
+ .foo configure -color #444444
+ .foo cget -color
+} -cleanup {
+ killTables
+} -returnCodes ok -result {#444444}
+test config-4.44 {DoObjConfig - getting rid of old color} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -color #333333
+ .foo configure -color #444444
+ .foo cget -color
+ rename .foo {}
+} -cleanup {
+ killTables
+} -returnCodes ok
+
+test config-4.45 {DoObjConfig - font} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -font {Helvetica 72}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.46 {DoObjConfig - font} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -font {Helvetica 72}
+ .foo cget -font
+} -cleanup {
+ killTables
+} -returnCodes ok -result {Helvetica 72}
+test config-4.47 {DoObjConfig - new font} -constraints testobjconfig -setup {
catch {rename .foo {}}
+} -body {
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} testobjconfig {
+ .foo configure -font {Helvetica 72}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {64}
+test config-4.48 {DoObjConfig - new font} -constraints testobjconfig -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -font {Courier 12}
+ .foo configure -font {Helvetica 72}
+ .foo cget -font
+} -cleanup {
+ killTables
+} -returnCodes ok -result {Helvetica 72}
+test config-4.49 {DoObjConfig - invalid font} -constraints {
+ testobjconfig
+} -setup {
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} testobjconfig {
+} -body {
+ testobjconfig alltypes .foo -font {Helvetica 12 foo}
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown font style "foo"}
+test config-4.50 {DoObjConfig - null font} -constraints testobjconfig -setup {
catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -font {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.51 {DoObjConfig - null font} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -font {}
+ .foo cget -font
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.52 {DoObjConfig - font internal value} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -font {Times 16}
.foo cget -font
-} {Times 16}
-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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {Times 16}
+
+test config-4.53 {DoObjConfig - bitmap} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -bitmap gray75
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.54 {DoObjConfig - bitmap} -constraints testobjconfig -body {
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} 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} 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} testobjconfig {
+ .foo cget -bitmap
+} -cleanup {
+ killTables
+} -returnCodes ok -result {gray75}
+test config-4.55 {DoObjConfig - new bitmap} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -bitmap gray75
+ .foo configure -bitmap gray50
+} -cleanup {
+ killTables
+} -returnCodes ok -result {128}
+test config-4.56 {DoObjConfig - new bitmap} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -bitmap gray75
+ .foo configure -bitmap gray50
+ .foo cget -bitmap
+} -cleanup {
+ killTables
+} -returnCodes ok -result {gray50}
+test config-4.57 {DoObjConfig - invalid bitmap} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -bitmap foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bitmap "foo" not defined}
+test config-4.58 {DoObjConfig - null bitmap} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -bitmap {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.59 {DoObjConfig - null bitmap} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -bitmap {}
+ .foo cget -bitmap
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.60 {DoObjConfig - bitmap internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -bitmap gray25
.foo cget -bitmap
-} {gray25}
-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} 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} 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} testobjconfig {
+} -cleanup {
+ killTables
+} -result {gray25}
+
+test config-4.61 {DoObjConfig - border} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -border green
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.62 {DoObjConfig - border} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -border green
+ .foo cget -border
+} -cleanup {
+ killTables
+} -returnCodes ok -result {green}
+test config-4.63 {DoObjConfig - invalid border} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -border xxx
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown color name "xxx"}
+test config-4.64 {DoObjConfig - null border} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -border {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.65 {DoObjConfig - null border} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -border {}
+ .foo cget -border
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.66 {DoObjConfig - border internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -border #123456
.foo cget -border
-} {#123456}
-test config-4.37 {DoObjConfig - getting rid of old border} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {#123456}
+test config-4.67 {DoObjConfig - getting rid of old border} -constraints {
+ testobjconfig
+} -body {
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} 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} 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} 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} testobjconfig {
+ .foo configure -border #444444
+} -cleanup {
+ killTables
+} -returnCodes ok -result {256}
+test config-4.68 {DoObjConfig - getting rid of old border} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -border #333333
+ .foo configure -border #444444
+ .foo cget -border
+} -cleanup {
+ killTables
+} -returnCodes ok -result {#444444}
+
+test config-4.69 {DoObjConfig - relief} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -relief flat
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.70 {DoObjConfig - relief} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -relief flat
+ .foo cget -relief
+} -cleanup {
+ killTables
+} -returnCodes ok -result {flat}
+test config-4.71 {DoObjConfig - invalid relief} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -relief foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad relief "foo": must be flat, groove, raised, ridge, solid, or sunken}
+test config-4.72 {DoObjConfig - relief internal value} -constraints testobjconfig -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -relief ridge
.foo cget -relief
-} {ridge}
-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} 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} 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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {ridge}
+test config-4.73 {DoObjConfig - new relief} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -relief raised
+ .foo configure -relief flat
+} -cleanup {
+ killTables
+} -returnCodes ok -result {512}
+test config-4.74 {DoObjConfig - new relief} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -relief raised
+ .foo configure -relief flat
+ .foo cget -relief
+} -cleanup {
+ killTables
+} -returnCodes ok -result {flat}
+
+test config-4.75 {DoObjConfig - cursor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -cursor arrow
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.76 {DoObjConfig - cursor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -cursor arrow
+ .foo cget -cursor
+} -cleanup {
+ killTables
+} -returnCodes ok -result {arrow}
+test config-4.77 {DoObjConfig - invalid cursor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -cursor foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad cursor spec "foo"}
+test config-4.78 {DoObjConfig - null cursor} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -cursor {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.79 {DoObjConfig - null cursor} -constraints testobjconfig -setup {
+ catch {rename .foo {}}
+} -body {
+ testobjconfig alltypes .foo -cursor {}
+ .foo cget -cursor
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.80 {DoObjConfig - new cursor} -constraints testobjconfig -body {
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} testobjconfig {
+ .foo configure -cursor arrow
+} -cleanup {
+ killTables
+} -returnCodes ok -result {1024}
+test config-4.81 {DoObjConfig - new cursor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -cursor xterm
+ .foo configure -cursor arrow
+ .foo cget -cursor
+} -cleanup {
+ killTables
+} -returnCodes ok -result {arrow}
+test config-4.82 {DoObjConfig - cursor internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -cursor watch
.foo cget -cursor
-} {watch}
-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} 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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {watch}
+
+test config-4.83 {DoObjConfig - justify} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -justify center
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.84 {DoObjConfig - justify} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -justify center
+ .foo cget -justify
+} -cleanup {
+ killTables
+} -returnCodes ok -result {center}
+test config-4.85 {DoObjConfig - invalid justify} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -justify foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad justification "foo": must be left, right, or center}
+test config-4.86 {DoObjConfig - new justify} -constraints testobjconfig -body {
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} testobjconfig {
+ .foo configure -justify right
+} -cleanup {
+ killTables
+} -returnCodes ok -result {2048}
+test config-4.87 {DoObjConfig - new justify} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -justify left
+ .foo configure -justify right
+ .foo cget -justify
+} -cleanup {
+ killTables
+} -returnCodes ok -result {right}
+test config-4.88 {DoObjConfig - justify internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -justify center
.foo cget -justify
-} {center}
-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} 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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {center}
+
+test config-4.89 {DoObjConfig - anchor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -anchor center
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.90 {DoObjConfig - anchor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -anchor center
+ .foo cget -anchor
+} -cleanup {
+ killTables
+} -returnCodes ok -result {center}
+test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -anchor foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, or center}
+test config-4.92 {DoObjConfig - new anchor} -constraints testobjconfig -body {
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} testobjconfig {
+ .foo configure -anchor n
+} -cleanup {
+ killTables
+} -returnCodes ok -result {4096}
+test config-4.93 {DoObjConfig - new anchor} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -anchor e
+ .foo configure -anchor n
+ .foo cget -anchor
+} -cleanup {
+ killTables
+} -returnCodes ok -result {n}
+test config-4.94 {DoObjConfig - anchor internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -anchor sw
.foo cget -anchor
-} {sw}
-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} 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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {sw}
+test config-4.95 {DoObjConfig - pixel} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -pixel 42
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.96 {DoObjConfig - pixel} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -pixel 42
+ .foo cget -pixel
+} -cleanup {
+ killTables
+} -returnCodes ok -result {42}
+test config-4.97 {DoObjConfig - invalid pixel} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -pixel foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad screen distance "foo"}
+test config-4.98 {DoObjConfig - new pixel} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -pixel 42m
+ .foo configure -pixel 3c
+} -cleanup {
+ killTables
+} -returnCodes ok -result {8192}
+test config-4.99 {DoObjConfig - new pixel} -constraints testobjconfig -body {
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} testobjconfig {
+ .foo configure -pixel 3c
+ .foo cget -pixel
+} -cleanup {
+ killTables
+} -returnCodes ok -result {3c}
+test config-4.100 {DoObjConfig - pixel internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -pixel [winfo screenmmwidth .]m
- .foo cget -pixel
-} [winfo screenwidth .]
-test config-4.59 {DoObjConfig - window} testobjconfig {
- catch {destroy .foo}
- catch {destroy .bar}
+ set screenW [winfo screenwidth .]
+ set result [.foo cget -pixel]
+ expr {$screenW eq $result}
+} -cleanup {
+ killTables
+} -result {1}
+
+test config-4.101 {DoObjConfig - window} -constraints testobjconfig -body {
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} testobjconfig {
- catch {destroy .foo}
+ testobjconfig twowindows .foo -window .bar
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.102 {DoObjConfig - window} -constraints testobjconfig -body {
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} testobjconfig {
- catch {destroy .foo}
- catch {destroy .bar}
+ testobjconfig twowindows .foo -window .bar
+ .foo cget -window
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.bar}
+test config-4.103 {DoObjConfig - invalid window} -constraints testobjconfig -body {
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} testobjconfig {
- catch {destroy .foo}
- catch {destroy .bar}
- catch {destroy .blamph}
+ testobjconfig twowindows .foo -window foo
+} -cleanup {
+ killTables
+} -returnCodes error -result {bad window path name "foo"}
+test config-4.104 {DoObjConfig - null window} -constraints testobjconfig -body {
+ toplevel .bar
+ testobjconfig twowindows .foo -window {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.105 {DoObjConfig - null window} -constraints testobjconfig -body {
+ toplevel .bar
+ testobjconfig twowindows .foo -window {}
+ .foo cget -window
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.106 {DoObjConfig - new window} -constraints testobjconfig -body {
toplevel .bar
toplevel .blamph
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} testobjconfig {
+ .foo configure -window .blamph
+} -cleanup {
+ killTables
+} -returnCodes ok -result {0}
+test config-4.107 {DoObjConfig - new window} -constraints testobjconfig -body {
+ toplevel .bar
+ toplevel .blamph
+ testobjconfig twowindows .foo -window .bar
+ .foo configure -window .blamph
+ .foo cget -window
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.blamph}
+test config-4.108 {DoObjConfig - window internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -window .
.foo cget -window
-} {.}
-test config-4.64 {DoObjConfig - releasing old values} testobjconfig {
+} -cleanup {
+ killTables
+} -result {.}
+
+test config-4.109 {DoObjConfig - releasing old values} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
# 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 \
-custom foobar
@@ -451,13 +1054,18 @@ test config-4.64 {DoObjConfig - releasing old values} testobjconfig {
-font {Times 8} -bitmap gray75 -border pink -cursor watch \
-custom barbaz
concat {}
-} {}
-test config-4.65 {DoObjConfig - releasing old values} testobjconfig {
+} -cleanup {
+ killTables
+} -result {}
+test config-4.110 {DoObjConfig - releasing old values} -constraints {
+ testobjconfig
+} -setup {
+ catch {rename .foo {}}
+} -body {
# 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 \
-custom foobar
@@ -465,421 +1073,844 @@ test config-4.65 {DoObjConfig - releasing old values} testobjconfig {
-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 {
+} -cleanup {
+ killTables
+} -result {}
+
+test config-4.111 {DoObjConfig - custom} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -custom test
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.112 {DoObjConfig - custom} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -custom test
+ .foo cget -custom
+} -cleanup {
+ killTables
+} -returnCodes ok -result {TEST}
+test config-4.113 {DoObjConfig - null custom} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -custom {}
+} -cleanup {
+ killTables
+} -returnCodes ok -result {.foo}
+test config-4.114 {DoObjConfig - null custom} -constraints testobjconfig -body {
+ testobjconfig alltypes .foo -custom {}
+ .foo cget -custom
+} -cleanup {
+ killTables
+} -returnCodes ok -result {}
+test config-4.115 {DoObjConfig - custom internal value} -constraints {
+ testobjconfig
+} -setup {
catch {rename .foo {}}
+} -body {
testobjconfig internal .foo -custom "this is a test"
.foo cget -custom
-} {THIS IS A TEST}
+} -cleanup {
+ killTables
+} -result {THIS IS A TEST}
-test config-5.1 {ObjectIsEmpty - object is already string} testobjconfig {
- catch {destroy .foo}
+
+test config-5.1 {ObjectIsEmpty - object is already string} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo -color [format ""]
.foo cget -color
-} {}
-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} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ killTables
+} -result {}
+test config-5.2 {ObjectIsEmpty - object is already string} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .foo -color [format " "]
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown color name " "}
+test config-5.3 {ObjectIsEmpty - must convert back to string} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo -color [list]
.foo cget -color
-} {}
+} -cleanup {
+ killTables
+} -result {}
-deleteWindows
-if {[testConstraint testobjconfig]} {
+
+test config-6.1 {GetOptionFromObj - cached answer} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
+} -cleanup {
+ killTables
+} -result {three three}
+test config-6.2 {GetOptionFromObj - exact match} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig chain2 .a
.a cget -one
-} {one}
-test config-6.3 {GetOptionFromObj - abbreviation} testobjconfig {
+} -cleanup {
+ killTables
+} -result {one}
+test config-6.3 {GetOptionFromObj - abbreviation} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig chain2 .a
.a cget -fo
-} {four}
-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} testobjconfig {
+} -cleanup {
+ killTables
+} -result {four}
+test config-6.4 {GetOptionFromObj - ambiguous abbreviation} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig chain2 .a
+ .a cget -on
+} -cleanup {
+ killTables
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown option "-on"}
+test config-6.5 {GetOptionFromObj - duplicate options in different tables} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig chain2 .a
.a cget -tw
-} {two and a half}
-test config-6.6 {GetOptionFromObj - synonym} testobjconfig {
+} -cleanup {
+ killTables
+} -result {two and a half}
+test config-6.6 {GetOptionFromObj - synonym} -constraints testobjconfig -body {
+ testobjconfig alltypes .b
.b cget -synonym
-} {red}
+} -cleanup {
+ killTables
+} -result {red}
+
-deleteWindows
if {[testConstraint testobjconfig]} {
testobjconfig alltypes .a
}
-test config-7.1 {Tk_SetOptions - basics} testobjconfig {
+test config-7.1 {Tk_SetOptions - basics} -constraints testobjconfig -body {
.a configure -color green -rel sunken
list [.a cget -color] [.a cget -relief]
-} {green sunken}
-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} testobjconfig {
+} -result {green sunken}
+test config-7.2 {Tk_SetOptions - bogus option name} -constraints {
+ testobjconfig
+} -body {
+ .a configure -bogus
+} -returnCodes error -result {unknown option "-bogus"}
+test config-7.3 {Tk_SetOptions - synonym} -constraints testobjconfig -body {
.a configure -synonym blue
.a cget -color
-} {blue}
-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} testobjconfig {
+} -result {blue}
+test config-7.4 {Tk_SetOptions - missing value} -constraints {
+ testobjconfig
+} -body {
+ .a configure -color green -relief
+} -returnCodes error -result {value for "-relief" missing}
+test config-7.5 {Tk_SetOptions - missing value} -constraints {
+ testobjconfig
+} -body {
+ catch {.a configure -color green -relief}
+ .a cget -color
+} -result {green}
+test config-7.6 {Tk_SetOptions - saving old values} -constraints {
+ testobjconfig
+} -body {
+ .a configure -color red -int 7 -relief raised -double 3.14159
+ .a csave -color green -int 432 -relief sunken -double 2.0 -color bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test config-7.7 {Tk_SetOptions - saving old values} -constraints {
+ testobjconfig
+} -body {
.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} testobjconfig {
- list [catch {.a configure -color bogus} msg] $msg $errorInfo
-} {1 {unknown color name "bogus"} {unknown color name "bogus"
+ catch {.a csave -color green -int 432 -relief sunken -double 2.0 -color bogus}
+ list [.a cget -color] [.a cget -int] [.a cget -relief] [.a cget -double]
+} -result {red 7 raised 3.14159}
+
+test config-7.8 {Tk_SetOptions - error in DoObjConfig call} -constraints {
+ testobjconfig
+} -body {
+ .a configure -color bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test config-7.9 {Tk_SetOptions - error in DoObjConfig call} -constraints {
+ testobjconfig
+} -body {
+ catch {.a configure -color bogus}
+ return $errorInfo
+} -result {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} testobjconfig {
- list [catch {.a configure -synonym bogus} msg] $msg $errorInfo
-} {1 {unknown color name "bogus"} {unknown color name "bogus"
+".a configure -color bogus"}
+
+test config-7.10 {Tk_SetOptions - synonym name in error message} -constraints {
+ testobjconfig
+} -body {
+ .a configure -synonym bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test config-7.11 {Tk_SetOptions - synonym name in error message} -constraints {
+ testobjconfig
+} -body {
+ catch {.a configure -synonym bogus}
+ return $errorInfo
+} -result {unknown color name "bogus"
(processing "-synonym" option)
invoked from within
-".a configure -synonym bogus"}}
-test config-7.8 {Tk_SetOptions - returning mask} testobjconfig {
+".a configure -synonym bogus"}
+test config-7.12 {Tk_SetOptions - returning mask} -constraints testobjconfig -body {
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"
+} -result {226}
+test config-7.13 {Tk_SetOptions - error in DoObjConfig with custom option} -constraints {
+ testobjconfig
+} -body {
+ .a configure -custom bad
+} -returnCodes error -result {expected good value, got "BAD"}
+test config-7.14 {Tk_SetOptions - error in DoObjConfig with custom option} -constraints {
+ testobjconfig
+} -body {
+ catch {.a configure -custom bad}
+ return $errorInfo
+} -result {expected good value, got "BAD"
(processing "-custom" option)
invoked from within
-".a configure -custom bad"}}
+".a configure -custom bad"}
+if {[testConstraint testobjconfig]} {
+ killTables
+}
-test config-8.1 {Tk_RestoreSavedOptions - restore in proper order} testobjconfig {
- deleteWindows
+
+test config-8.1 {Tk_RestoreSavedOptions - restore in proper order} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ .a csave -color green -color black -color blue \
+ -color #ffff00 -color #ff00ff -color bogus \
+} -cleanup {
+ killTables
+} -returnCodes error -result {unknown color name "bogus"}
+test config-8.2 {Tk_RestoreSavedOptions - restore in proper order} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -color green -color black -color blue \
+ -color #ffff00 -color #ff00ff -color bogus}
+ .a cget -color
+} -cleanup {
+ killTables
+} -result {red}
+test config-8.3 {Tk_RestoreSavedOptions - freeing object memory} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig alltypes .a
+ .a csave -color green -color black -color blue -color #ffff00 -color #ff00ff
+} -cleanup {
+ killTables
+} -result {32}
+test config-8.4 {Tk_RestoreSavedOptions - boolean internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ .a csave -boolean 0 -color bogus
+} -cleanup {
+ killTables
+} -returnCodes error -match glob -result *
+test config-8.5 {Tk_RestoreSavedOptions - boolean internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -boolean 0 -color bogus}
+ .a cget -boolean
+} -cleanup {
+ killTables
+} -result {1}
+test config-8.6 {Tk_RestoreSavedOptions - integer internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ .a csave -integer 24 -color bogus
+} -cleanup {
+ killTables
+} -returnCodes error -match glob -result *
+test config-8.7 {Tk_RestoreSavedOptions - integer internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -integer 24 -color bogus}
+ .a cget -integer
+} -cleanup {
+ killTables
+} -result {148962237}
+test config-8.8 {Tk_RestoreSavedOptions - double internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -double 62.4 -color bogus}
+ .a cget -double
+} -cleanup {
+ killTables
+} -result {3.14159}
+test config-8.9 {Tk_RestoreSavedOptions - string internal form} -constraints {
+ testobjconfig
+} -body {
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} {testobjconfig nonPortable} {
- deleteWindows
+ catch {.a csave -string "A long string" -color bogus}
+ .a cget -string
+} -cleanup {
+ killTables
+} -result {foo}
+test config-8.10 {Tk_RestoreSavedOptions - string table internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -stringtable three -color bogus}
+ .a cget -stringtable
+} -cleanup {
+ killTables
+} -result {one}
+test config-8.11 {Tk_RestoreSavedOptions - color internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -color green -color bogus}
+ .a cget -color
+} -cleanup {
+ killTables
+} -result {red}
+test config-8.12 {Tk_RestoreSavedOptions - font internal form} -constraints {
+ testobjconfig nonPortable
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -font {Times 12} -color bogus}
+ .a cget -font
+} -cleanup {
+ killTables
+} -result {Helvetica 12}
+test config-8.13 {Tk_RestoreSavedOptions - bitmap internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -bitmap questhead -color bogus}
+ .a cget -bitmap
+} -cleanup {
+ killTables
+} -result {gray50}
+test config-8.14 {Tk_RestoreSavedOptions - border internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -border brown -color bogus}
+ .a cget -border
+} -cleanup {
+ killTables
+} -result {blue}
+test config-8.15 {Tk_RestoreSavedOptions - relief internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -relief sunken -color bogus}
+ .a cget -relief
+} -cleanup {
+ killTables
+} -result {raised}
+test config-8.16 {Tk_RestoreSavedOptions - cursor internal form} -constraints {
+ testobjconfig
+} -body {
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} testobjconfig {
- deleteWindows
+ catch {.a csave -cursor watch -color bogus}
+ .a cget -cursor
+} -cleanup {
+ killTables
+} -result {xterm}
+test config-8.17 {Tk_RestoreSavedOptions - justify internal form} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig internal .a
+ catch {.a csave -justify right -color bogus}
+ .a cget -justify
+} -cleanup {
+ killTables
+} -result {left}
+test config-8.18 {Tk_RestoreSavedOptions - anchor internal form} -constraints {
+ testobjconfig
+} -body {
+ testobjconfig internal .a
+ catch {.a csave -anchor center -color bogus}
+ .a cget -anchor
+} -cleanup {
+ killTables
+} -result {n}
+test config-8.19 {Tk_RestoreSavedOptions - window internal form} -constraints {
+ testobjconfig
+} -body {
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
+ catch {.a csave -window .a -color bogus}
+ .a cget -window
+} -cleanup {
+ killTables
+} -result {.a}
+test config-8.20 {Tk_RestoreSavedOptions - custom internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .a -custom "foobar"
- list [catch {.a csave -custom "barbaz" -color bogus}] [.a cget -custom]
-} {1 FOOBAR}
+ catch {.a csave -custom "barbaz" -color bogus}
+ .a cget -custom
+} -cleanup {
+ killTables
+} -result {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} testobjconfig {
- catch {destroy .foo}
+test config-9.1 {Tk_FreeConfigOptions/FreeResources - string internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -string "two words"
destroy .foo
-} {}
-test config-9.2 {Tk_FreeConfigOptions/FreeResources - color internal form} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.2 {Tk_FreeConfigOptions/FreeResources - color internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -color yellow
destroy .foo
-} {}
-test config-9.3 {Tk_FreeConfigOptions/FreeResources - color} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.3 {Tk_FreeConfigOptions/FreeResources - color} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -color [format blue]
destroy .foo
-} {}
-test config-9.4 {Tk_FreeConfigOptions/FreeResources - font internal form} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.4 {Tk_FreeConfigOptions/FreeResources - font internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -font {Courier 20}
destroy .foo
-} {}
-test config-9.5 {Tk_FreeConfigOptions/FreeResources - font} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.5 {Tk_FreeConfigOptions/FreeResources - font} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -font [format {Courier 24}]
destroy .foo
-} {}
-test config-9.6 {Tk_FreeConfigOptions/FreeResources - bitmap internal form} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.6 {Tk_FreeConfigOptions/FreeResources - bitmap internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -bitmap gray75
destroy .foo
-} {}
-test config-9.7 {Tk_FreeConfigOptions/FreeResources - bitmap} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.7 {Tk_FreeConfigOptions/FreeResources - bitmap} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -bitmap [format gray75]
destroy .foo
-} {}
-test config-9.8 {Tk_FreeConfigOptions/FreeResources - border internal form} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.8 {Tk_FreeConfigOptions/FreeResources - border internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -border orange
destroy .foo
-} {}
-test config-9.9 {Tk_FreeConfigOptions/FreeResources - border} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.9 {Tk_FreeConfigOptions/FreeResources - border} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -border [format blue]
destroy .foo
-} {}
-test config-9.10 {Tk_FreeConfigOptions/FreeResources - cursor internal form} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.10 {Tk_FreeConfigOptions/FreeResources - cursor internal form} -constraints {
+ testobjconfig
+} -body {
testobjconfig internal .foo
.foo configure -cursor cross
destroy .foo
-} {}
-test config-9.11 {Tk_FreeConfigOptions/FreeResources - cursor} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.11 {Tk_FreeConfigOptions/FreeResources - cursor} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -cursor [format watch]
destroy .foo
-} {}
-test config-9.12 {Tk_FreeConfigOptions/FreeResources - not special} testobjconfig {
- catch {destroy .foo}
+} -result {}
+test config-9.12 {Tk_FreeConfigOptions/FreeResources - not special} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -integer [format 27]
destroy .foo
-} {}
-test config-9.13 {Tk_FreeConfigOptions/FreeResources - custom internal form} testobjconfig {
+} -result {}
+test config-9.13 {Tk_FreeConfigOptions/FreeResources - custom internal form} -constraints {
+ testobjconfig
+} -body {
catch {destroy .fpp}
testobjconfig internal .foo
.foo configure -custom "foobar"
destroy .foo
-} {}
+} -result {}
+if {[testConstraint testobjconfig]} {
+ killTables
+}
+
-test config-10.1 {Tk_GetOptionInfo - one item} testobjconfig {
- catch {destroy .foo}
+test config-10.1 {Tk_GetOptionInfo - one item} -constraints testobjconfig -body {
testobjconfig alltypes .foo
.foo configure -relief groove
.foo configure -relief
-} {-relief relief Relief raised groove}
-test config-10.2 {Tk_GetOptionInfo - one item, synonym} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ destroy .foo
+} -result {-relief relief Relief raised groove}
+test config-10.2 {Tk_GetOptionInfo - one item, synonym} -constraints {
+ testobjconfig
+} -body {
testobjconfig alltypes .foo
.foo configure -color black
.foo configure -synonym
-} {-color color Color red black}
-test config-10.3 {Tk_GetOptionInfo - all items} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ destroy .foo
+} -result {-color color Color red black}
+test config-10.3 {Tk_GetOptionInfo - all items} -constraints {
+ testobjconfig
+} -body {
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} {-custom {} {} {} {}} {-synonym -color}}
-test config-10.4 {Tk_GetOptionInfo - chaining through tables} testobjconfig {
- catch {destroy .foo}
+} -cleanup {
+ destroy .foo
+} -result {{-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} -constraints testobjconfig -body {
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}}}
+} -cleanup {
+ destroy .foo
+} -result {{-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}}}
+if {[testConstraint testobjconfig]} {
+ killTables
+}
+
-deleteWindows
if {[testConstraint testobjconfig]} {
testobjconfig alltypes .a
}
-test config-11.1 {GetConfigList - synonym} testobjconfig {
+test config-11.1 {GetConfigList - synonym} -constraints testobjconfig -body {
lindex [.a configure] end
-} {-synonym -color}
-test config-11.2 {GetConfigList - null database names} testobjconfig {
+} -result {-synonym -color}
+test config-11.2 {GetConfigList - null database names} -constraints {
+ testobjconfig
+} -body {
.a configure -justify
-} {-justify {} {} left left}
-test config-11.3 {GetConfigList - null default and current value} testobjconfig {
+} -result {-justify {} {} left left}
+test config-11.3 {GetConfigList - null default and current value} -constraints {
+ testobjconfig
+} -body {
.a configure -anchor
-} {-anchor anchor Anchor {} {}}
+} -result {-anchor anchor Anchor {} {}}
+if {[testConstraint testobjconfig]} {
+ killTables
+}
+
-deleteWindows
if {[testConstraint testobjconfig]} {
testobjconfig internal .a
}
-test config-12.1 {GetObjectForOption - boolean} testobjconfig {
+test config-12.1 {GetObjectForOption - boolean} -constraints testobjconfig -body {
.a configure -boolean 0
.a cget -boolean
-} {0}
-test config-12.2 {GetObjectForOption - integer} testobjconfig {
+} -result {0}
+test config-12.2 {GetObjectForOption - integer} -constraints testobjconfig -body {
.a configure -integer 1247
.a cget -integer
-} {1247}
-test config-12.3 {GetObjectForOption - double} testobjconfig {
+} -result {1247}
+test config-12.3 {GetObjectForOption - double} -constraints testobjconfig -body {
.a configure -double -88.82
.a cget -double
-} {-88.82}
-test config-12.4 {GetObjectForOption - string} testobjconfig {
+} -result {-88.82}
+test config-12.4 {GetObjectForOption - string} -constraints testobjconfig -body {
.a configure -string "test value"
.a cget -string
-} {test value}
-test config-12.5 {GetObjectForOption - stringTable} testobjconfig {
+} -result {test value}
+test config-12.5 {GetObjectForOption - stringTable} -constraints {
+ testobjconfig
+} -body {
.a configure -stringtable "two"
.a cget -stringtable
-} {two}
-test config-12.6 {GetObjectForOption - color} testobjconfig {
+} -result {two}
+test config-12.6 {GetObjectForOption - color} -constraints testobjconfig -body {
.a configure -color "green"
.a cget -color
-} {green}
-test config-12.7 {GetObjectForOption - font} testobjconfig {
+} -result {green}
+test config-12.7 {GetObjectForOption - font} -constraints testobjconfig -body {
.a configure -font {Times 36}
.a cget -font
-} {Times 36}
-test config-12.8 {GetObjectForOption - bitmap} testobjconfig {
+} -result {Times 36}
+test config-12.8 {GetObjectForOption - bitmap} -constraints testobjconfig -body {
.a configure -bitmap "questhead"
.a cget -bitmap
-} {questhead}
-test config-12.9 {GetObjectForOption - border} testobjconfig {
+} -result {questhead}
+test config-12.9 {GetObjectForOption - border} -constraints testobjconfig -body {
.a configure -border #33217c
.a cget -border
-} {#33217c}
-test config-12.10 {GetObjectForOption - relief} testobjconfig {
+} -result {#33217c}
+test config-12.10 {GetObjectForOption - relief} -constraints {
+ testobjconfig
+} -body {
.a configure -relief groove
.a cget -relief
-} {groove}
-test config-12.11 {GetObjectForOption - cursor} testobjconfig {
+} -result {groove}
+test config-12.11 {GetObjectForOption - cursor} -constraints {
+ testobjconfig
+} -body {
.a configure -cursor watch
.a cget -cursor
-} {watch}
-test config-12.12 {GetObjectForOption - justify} testobjconfig {
+} -result {watch}
+test config-12.12 {GetObjectForOption - justify} -constraints {
+ testobjconfig
+} -body {
.a configure -justify right
.a cget -justify
-} {right}
-test config-12.13 {GetObjectForOption - anchor} testobjconfig {
+} -result {right}
+test config-12.13 {GetObjectForOption - anchor} -constraints testobjconfig -body {
.a configure -anchor e
.a cget -anchor
-} {e}
-test config-12.14 {GetObjectForOption - pixels} testobjconfig {
+} -result {e}
+test config-12.14 {GetObjectForOption - pixels} -constraints testobjconfig -body {
.a configure -pixel 193.2
.a cget -pixel
-} {193}
-test config-12.15 {GetObjectForOption - window} testobjconfig {
+} -result {193}
+test config-12.15 {GetObjectForOption - window} -constraints testobjconfig -body {
.a configure -window .a
.a cget -window
-} {.a}
-test config-12.16 {GetObjectForOption -custom} testobjconfig {
+} -result {.a}
+test config-12.16 {GetObjectForOption -custom} -constraints testobjconfig -body {
.a configure -custom foobar
.a cget -custom
-} {FOOBAR}
-test config-12.17 {GetObjectForOption - null values} testobjconfig {
+} -result {FOOBAR}
+test config-12.17 {GetObjectForOption - null values} -constraints {
+ testobjconfig
+} -body {
.a configure -string {} -color {} -font {} -bitmap {} -border {} \
-cursor {} -window {} -custom {}
list [.a cget -string] [.a cget -color] [.a cget -font] \
[.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} {
- foreach type {
- button canvas entry frame listbox menu menubutton message
- scale scrollbar text radiobutton checkbutton
- } {
- destroy .w
- $type .w -cursor crosshair
- destroy .w
- }
-} {}
+} -result {{} {} {} {} {} {} {} {}}
+if {[testConstraint testobjconfig]} {
+ killTables
+}
-deleteWindows
-test config-14.1 {Tk_CreateOptionTable - use with namespace import} {
+test config-13.1 {proper cleanup of options with widget destroy} -body {
+ button .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.2 {proper cleanup of options with widget destroy} -body {
+ canvas .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.3 {proper cleanup of options with widget destroy} -body {
+ entry .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.4 {proper cleanup of options with widget destroy} -body {
+ frame .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.5 {proper cleanup of options with widget destroy} -body {
+ listbox .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.6 {proper cleanup of options with widget destroy} -body {
+ menu .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.7 {proper cleanup of options with widget destroy} -body {
+ menubutton .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.8 {proper cleanup of options with widget destroy} -body {
+ message .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.9 {proper cleanup of options with widget destroy} -body {
+ scale .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.10 {proper cleanup of options with widget destroy} -body {
+ scrollbar .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.11 {proper cleanup of options with widget destroy} -body {
+ text .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.12 {proper cleanup of options with widget destroy} -body {
+ radiobutton .w -cursor crosshair
+ destroy .w
+} -result {}
+test config-13.13 {proper cleanup of options with widget destroy} -body {
+ checkbutton .w -cursor crosshair
+ destroy .w
+} -result {}
+
+test config-14.1 {Tk_CreateOptionTable - use with namespace import} -setup {
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
- }
-} {}
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::button
+ ::foo::button .a
+ ::foo::button .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.2 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::canvas
+ ::foo::canvas .a
+ ::foo::canvas .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.3 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::entry
+ ::foo::entry .a
+ ::foo::entry .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.4 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::frame
+ ::foo::frame .a
+ ::foo::frame .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.5 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::listbox
+ ::foo::listbox .a
+ ::foo::listbox .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.6 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::menu
+ ::foo::menu .a
+ ::foo::menu .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.7 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::menubutton
+ ::foo::menubutton .a
+ ::foo::menubutton .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.8 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::message
+ ::foo::message .a
+ ::foo::message .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.9 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::scale
+ ::foo::scale .a
+ ::foo::scale .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.10 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::scrollbar
+ ::foo::scrollbar .a
+ ::foo::scrollbar .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.11 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::spinbox
+ ::foo::spinbox .a
+ ::foo::spinbox .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.12 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::text
+ ::foo::text .a
+ ::foo::text .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.13 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::radiobutton
+ ::foo::radiobutton .a
+ ::foo::radiobutton .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+test config-14.14 {Tk_CreateOptionTable - use with namespace import} -setup {
+ namespace export -clear *
+} -body {
+ namespace eval ::foo [subst {
+ namespace import -force ::checkbutton
+ ::foo::checkbutton .a
+ ::foo::checkbutton .b
+ }
+ ]
+ destroy .a .b
+} -result {}
+
# cleanup
deleteWindows
@@ -888,3 +1919,11 @@ if {[testConstraint testobjconfig]} {
}
cleanupTests
return
+
+
+
+
+
+
+
+
diff --git a/tests/constraints.tcl b/tests/constraints.tcl
index 843ee4d..ac32852 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -138,6 +138,42 @@ namespace eval tk {
focus -force .focus.e
destroy .focus
}
+
+
+ namespace export imageInit imageFinish imageCleanup imageNames
+ variable ImageNames
+ proc imageInit {} {
+ variable ImageNames
+ if {![info exists ImageNames]} {
+ set ImageNames [lsort [image names]]
+ }
+ imageCleanup
+ if {[lsort [image names]] ne $ImageNames} {
+ return -code error "IMAGE NAMES mismatch: [image names] != $ImageNames"
+ }
+ }
+ proc imageFinish {} {
+ variable ImageNames
+ if {[lsort [image names]] ne $ImageNames} {
+ return -code error "images remaining: [image names] != $ImageNames"
+ }
+ imageCleanup
+ }
+ proc imageCleanup {} {
+ variable ImageNames
+ foreach img [image names] {
+ if {$img ni $ImageNames} {image delete $img}
+ }
+ }
+ proc imageNames {} {
+ variable ImageNames
+ set r {}
+ foreach img [image names] {
+ if {$img ni $ImageNames} {lappend r $img}
+ }
+ return $r
+ }
+
}
}
@@ -182,7 +218,7 @@ testConstraint testwrapper [llength [info commands testwrapper]]
# constraint to see what sort of fonts are available
testConstraint fonts 1
destroy .e
-entry .e -width 0 -font {Helvetica -12} -bd 1
+entry .e -width 0 -font {Helvetica -12} -bd 1 -highlightthickness 1
.e insert end a.bcd
if {([winfo reqwidth .e] != 37) || ([winfo reqheight .e] != 20)} {
testConstraint fonts 0
@@ -242,7 +278,6 @@ namespace import -force tcltest::removeDirectory
namespace import -force tcltest::interpreter
namespace import -force tcltest::testsDirectory
namespace import -force tcltest::cleanupTests
-namespace import -force tcltest::bytestring
deleteWindows
wm geometry . {}
diff --git a/tests/cursor.test b/tests/cursor.test
index 539e933..1039b52 100644
--- a/tests/cursor.test
+++ b/tests/cursor.test
@@ -6,96 +6,133 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} {testcursor} {
+
+# Tests 2.3 and 2.4 need a helper file with a very specific name and
+# controlled format.
+proc setWincur {wincurName} {
+ upvar $wincurName wincur
+ 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 [scan $wincur(num) %o]]
+ }
+ set wincur(dir) [makeDirectory {dir with spaces}]
+ set wincur(file) [makeFile $wincur(data_binary) "test file.cur" $wincur(dir)]
+}
+
+
+test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} -constraints {
+ testcursor
+} -body {
set x watch
lindex $x 0
- destroy .b1
- button .b1 -cursor $x
+ button .b -cursor $x
lindex $x 0
testcursor watch
-} {{1 0}}
-test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} {testcursor} {
+} -cleanup {
+ destroy .b
+} -result {{1 0}}
+test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} -constraints {
+ testcursor
+} -body {
set x watch
- destroy .b1 .b2
+ set result {}
button .b1 -cursor $x
destroy .b1
- set result {}
lappend result [testcursor watch]
button .b2 -cursor $x
lappend result [testcursor watch]
-} {{} {{1 1}}}
-test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} {testcursor} {
+} -cleanup {
+ destroy .b2
+} -result {{} {{1 1}}}
+test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} -constraints {
+ testcursor
+} -body {
set x watch
- destroy .b1 .b2
- button .b1 -cursor $x
set result {}
+ button .b1 -cursor $x
lappend result [testcursor watch]
button .b2 -cursor $x
pack .b1 .b2 -side top
lappend result [testcursor watch]
-} {{{1 1}} {{2 1}}}
+} -cleanup {
+ destroy .b1 .b2
+} -result {{{1 1}} {{2 1}}}
-test cursor-2.1 {Tk_GetCursor procedure} {
- destroy .b1
- list [catch {button .b1 -cursor bad_name} msg] $msg
-} {1 {bad cursor spec "bad_name"}}
-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 [scan $wincur(num) %o]]
-}
-set wincur(dir) [makeDirectory {dir with spaces}]
-set wincur(file) [makeFile $wincur(data_binary) "test file.cur" $wincur(dir)]
-test cursor-2.3 {Tk_GetCursor procedure: cursor specs are lists} win {
- destroy .b1
- button .b1 -cursor [list @$wincur(file)]
-} {.b1}
-test cursor-2.4 {Tk_GetCursor procedure: cursor specs are lists} win {
- destroy .b1
- button .b1 -cursor @[regsub -all {[][ \\{}""$#]} $wincur(file) {\\&}]
-} {.b1}
-removeDirectory $wincur(dir)
-unset wincur
+test cursor-2.1 {Tk_GetCursor procedure} -body {
+ button .b -cursor bad_name
+} -cleanup {
+ destroy .b
+} -returnCodes error -result {bad cursor spec "bad_name"}
+test cursor-2.2 {Tk_GetCursor procedure} -body {
+ button .b -cursor @xyzzy
+} -cleanup {
+ destroy .b
+} -returnCodes error -result {bad cursor spec "@xyzzy"}
-test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} {testcursor} {
+test cursor-2.3 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
+ win
+} -setup {
+ unset -nocomplain wincur
+ set wincur(file) ""
+} -body {
+ setWincur wincur
+ button .b -cursor [list @$wincur(file)]
+} -cleanup {
+ destroy .b
+ removeDirectory $wincur(dir)
+ unset wincur
+} -result {.b}
+test cursor-2.4 {Tk_GetCursor procedure: cursor specs are lists} -constraints {
+ win
+} -setup {
+ unset -nocomplain wincur
+ set wincur(file) ""
+} -body {
+ setWincur wincur
+ button .b -cursor @[regsub -all {[][ \\{}""$#]} $wincur(file) {\\&}]
+} -cleanup {
+ destroy .b
+ removeDirectory $wincur(dir)
+ unset wincur
+} -result {.b}
+
+test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} -constraints {
+ testcursor
+} -setup {
set x heart
- destroy .b1 .b2 .b3
+ set result {}
+} -body {
button .b1 -cursor $x
button .b3 -cursor $x
button .b2 -cursor $x
- set result {}
lappend result [testcursor heart]
destroy .b1
lappend result [testcursor heart]
@@ -103,10 +140,11 @@ test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} {testcursor} {
lappend result [testcursor heart]
destroy .b3
lappend result [testcursor heart]
-} {{{3 1}} {{2 1}} {{1 1}} {}}
+} -result {{{3 1}} {{2 1}} {{1 1}} {}}
-test cursor-4.1 {FreeCursorObjProc} {testcursor} {
- destroy .b
+test cursor-4.1 {FreeCursorObjProc} -constraints {
+ testcursor
+} -body {
set x [format heart]
button .b -cursor $x
set y [format heart]
@@ -123,10 +161,11 @@ test cursor-4.1 {FreeCursorObjProc} {testcursor} {
lappend result [testcursor heart]
set y bogus
set result
-} {{{1 3}} {{1 2}} {{1 1}} {}}
+} -cleanup {
+ destroy .b
+} -result {{{1 3}} {{1 2}} {{1 1}} {}}
# -------------------------------------------------------------------------
-
test cursor-5.1 {assert consistent cursor configuration command} -setup {
button .b
} -body {
@@ -137,101 +176,551 @@ test cursor-5.1 {assert consistent cursor configuration command} -setup {
# -------------------------------------------------------------------------
# Check for the standard set of cursors.
-
-foreach {testName cursor} {
- cursor-6.1 X_cursor
- cursor-6.2 arrow
- cursor-6.3 based_arrow_down
- cursor-6.4 based_arrow_up
- cursor-6.5 boat
- cursor-6.6 bogosity
- cursor-6.7 bottom_left_corner
- cursor-6.8 bottom_right_corner
- cursor-6.9 bottom_side
- cursor-6.10 bottom_tee
- cursor-6.11 box_spiral
- cursor-6.12 center_ptr
- cursor-6.13 circle
- cursor-6.14 clock
- cursor-6.15 coffee_mug
- cursor-6.16 cross
- cursor-6.17 cross_reverse
- cursor-6.18 crosshair
- cursor-6.19 diamond_cross
- cursor-6.20 dot
- cursor-6.21 dotbox
- cursor-6.22 double_arrow
- cursor-6.23 draft_large
- cursor-6.24 draft_small
- cursor-6.25 draped_box
- cursor-6.26 exchange
- cursor-6.27 fleur
- cursor-6.28 gobbler
- cursor-6.29 gumby
- cursor-6.30 hand1
- cursor-6.31 hand2
- cursor-6.32 heart
- cursor-6.33 icon
- cursor-6.34 iron_cross
- cursor-6.35 left_ptr
- cursor-6.36 left_side
- cursor-6.37 left_tee
- cursor-6.38 leftbutton
- cursor-6.39 ll_angle
- cursor-6.40 lr_angle
- cursor-6.41 man
- cursor-6.42 middlebutton
- cursor-6.43 mouse
- cursor-6.44 pencil
- cursor-6.45 pirate
- cursor-6.46 plus
- cursor-6.47 question_arrow
- cursor-6.48 right_ptr
- cursor-6.49 right_side
- cursor-6.50 right_tee
- cursor-6.51 rightbutton
- cursor-6.52 rtl_logo
- cursor-6.53 sailboat
- cursor-6.54 sb_down_arrow
- cursor-6.55 sb_h_double_arrow
- cursor-6.56 sb_left_arrow
- cursor-6.57 sb_right_arrow
- cursor-6.58 sb_up_arrow
- cursor-6.59 sb_v_double_arrow
- cursor-6.60 shuttle
- cursor-6.61 sizing
- cursor-6.62 spider
- cursor-6.63 spraycan
- cursor-6.64 star
- cursor-6.65 target
- cursor-6.66 tcross
- cursor-6.67 top_left_arrow
- cursor-6.68 top_left_corner
- cursor-6.69 top_right_corner
- cursor-6.70 top_side
- cursor-6.71 top_tee
- cursor-6.72 trek
- cursor-6.73 ul_angle
- cursor-6.74 umbrella
- cursor-6.75 ur_angle
- cursor-6.76 watch
- cursor-6.77 xterm
-} {
- test $testName "check cursor-font cursor $cursor" -setup {
- button .b -text $cursor
- } -body {
- .b configure -cursor $cursor
- } -cleanup {
- destroy .b
- } -result {}
-}
+test cursor-6.1 {check cursor-font cursor X_cursor} -setup {
+ button .b -text X_cursor
+} -body {
+ .b configure -cursor X_cursor
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.2 {check cursor-font cursor arrow} -setup {
+ button .b -text arrow
+} -body {
+ .b configure -cursor arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.3 {check cursor-font cursor based_arrow_down} -setup {
+ button .b -text based_arrow_down
+} -body {
+ .b configure -cursor based_arrow_down
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.4 {check cursor-font cursor based_arrow_up} -setup {
+ button .b -text based_arrow_up
+} -body {
+ .b configure -cursor based_arrow_up
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.5 {check cursor-font cursor boat} -setup {
+ button .b -text boat
+} -body {
+ .b configure -cursor boat
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.6 {check cursor-font cursor bogosity} -setup {
+ button .b -text bogosity
+} -body {
+ .b configure -cursor bogosity
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.7 {check cursor-font cursor bottom_left_corner} -setup {
+ button .b -text bottom_left_corner
+} -body {
+ .b configure -cursor bottom_left_corner
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.8 {check cursor-font cursor bottom_right_corner} -setup {
+ button .b -text bottom_right_corner
+} -body {
+ .b configure -cursor bottom_right_corner
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.9 {check cursor-font cursor bottom_side} -setup {
+ button .b -text bottom_side
+} -body {
+ .b configure -cursor bottom_side
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.10 {check cursor-font cursor bottom_tee} -setup {
+ button .b -text bottom_tee
+} -body {
+ .b configure -cursor bottom_tee
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.11 {check cursor-font cursor box_spiral} -setup {
+ button .b -text box_spiral
+} -body {
+ .b configure -cursor box_spiral
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.12 {check cursor-font cursor center_ptr} -setup {
+ button .b -text center_ptr
+} -body {
+ .b configure -cursor center_ptr
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.13 {check cursor-font cursor circle} -setup {
+ button .b -text circle
+} -body {
+ .b configure -cursor circle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.14 {check cursor-font cursor clock} -setup {
+ button .b -text clock
+} -body {
+ .b configure -cursor clock
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.15 {check cursor-font cursor coffee_mug} -setup {
+ button .b -text coffee_mug
+} -body {
+ .b configure -cursor coffee_mug
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.16 {check cursor-font cursor cross} -setup {
+ button .b -text cross
+} -body {
+ .b configure -cursor cross
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.17 {check cursor-font cursor cross_reverse} -setup {
+ button .b -text cross_reverse
+} -body {
+ .b configure -cursor cross_reverse
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.18 {check cursor-font cursor crosshair} -setup {
+ button .b -text crosshair
+} -body {
+ .b configure -cursor crosshair
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.19 {check cursor-font cursor diamond_cross} -setup {
+ button .b -text diamond_cross
+} -body {
+ .b configure -cursor diamond_cross
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.20 {check cursor-font cursor dot} -setup {
+ button .b -text dot
+} -body {
+ .b configure -cursor dot
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.21 {check cursor-font cursor dotbox} -setup {
+ button .b -text dotbox
+} -body {
+ .b configure -cursor dotbox
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.22 {check cursor-font cursor double_arrow} -setup {
+ button .b -text double_arrow
+} -body {
+ .b configure -cursor double_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.23 {check cursor-font cursor draft_large} -setup {
+ button .b -text draft_large
+} -body {
+ .b configure -cursor draft_large
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.24 {check cursor-font cursor draft_small} -setup {
+ button .b -text draft_small
+} -body {
+ .b configure -cursor draft_small
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.25 {check cursor-font cursor draped_box} -setup {
+ button .b -text draped_box
+} -body {
+ .b configure -cursor draped_box
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.26 {check cursor-font cursor exchange} -setup {
+ button .b -text exchange
+} -body {
+ .b configure -cursor exchange
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.27 {check cursor-font cursor fleur} -setup {
+ button .b -text fleur
+} -body {
+ .b configure -cursor fleur
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.28 {check cursor-font cursor gobbler} -setup {
+ button .b -text gobbler
+} -body {
+ .b configure -cursor gobbler
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.29 {check cursor-font cursor gumby} -setup {
+ button .b -text gumby
+} -body {
+ .b configure -cursor gumby
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.30 {check cursor-font cursor hand1} -setup {
+ button .b -text hand1
+} -body {
+ .b configure -cursor hand1
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.31 {check cursor-font cursor hand2} -setup {
+ button .b -text hand2
+} -body {
+ .b configure -cursor hand2
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.32 {check cursor-font cursor heart} -setup {
+ button .b -text heart
+} -body {
+ .b configure -cursor heart
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.33 {check cursor-font cursor icon} -setup {
+ button .b -text icon
+} -body {
+ .b configure -cursor icon
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.34 {check cursor-font cursor iron_cross} -setup {
+ button .b -text iron_cross
+} -body {
+ .b configure -cursor iron_cross
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.35 {check cursor-font cursor left_ptr} -setup {
+ button .b -text left_ptr
+} -body {
+ .b configure -cursor left_ptr
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.36 {check cursor-font cursor left_side} -setup {
+ button .b -text left_side
+} -body {
+ .b configure -cursor left_side
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.37 {check cursor-font cursor left_tee} -setup {
+ button .b -text left_tee
+} -body {
+ .b configure -cursor left_tee
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.38 {check cursor-font cursor leftbutton} -setup {
+ button .b -text leftbutton
+} -body {
+ .b configure -cursor leftbutton
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.39 {check cursor-font cursor ll_angle} -setup {
+ button .b -text ll_angle
+} -body {
+ .b configure -cursor ll_angle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.40 {check cursor-font cursor lr_angle} -setup {
+ button .b -text lr_angle
+} -body {
+ .b configure -cursor lr_angle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.41 {check cursor-font cursor man} -setup {
+ button .b -text man
+} -body {
+ .b configure -cursor man
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.42 {check cursor-font cursor middlebutton} -setup {
+ button .b -text middlebutton
+} -body {
+ .b configure -cursor middlebutton
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.43 {check cursor-font cursor mouse} -setup {
+ button .b -text mouse
+} -body {
+ .b configure -cursor mouse
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.44 {check cursor-font cursor pencil} -setup {
+ button .b -text pencil
+} -body {
+ .b configure -cursor pencil
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.45 {check cursor-font cursor pirate} -setup {
+ button .b -text pirate
+} -body {
+ .b configure -cursor pirate
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.46 {check cursor-font cursor plus} -setup {
+ button .b -text plus
+} -body {
+ .b configure -cursor plus
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.47 {check cursor-font cursor question_arrow} -setup {
+ button .b -text question_arrow
+} -body {
+ .b configure -cursor question_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.48 {check cursor-font cursor right_ptr} -setup {
+ button .b -text right_ptr
+} -body {
+ .b configure -cursor right_ptr
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.49 {check cursor-font cursor right_side} -setup {
+ button .b -text right_side
+} -body {
+ .b configure -cursor right_side
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.50 {check cursor-font cursor right_tee} -setup {
+ button .b -text right_tee
+} -body {
+ .b configure -cursor right_tee
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.51 {check cursor-font cursor rightbutton} -setup {
+ button .b -text rightbutton
+} -body {
+ .b configure -cursor rightbutton
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.52 {check cursor-font cursor rtl_logo} -setup {
+ button .b -text rtl_logo
+} -body {
+ .b configure -cursor rtl_logo
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.53 {check cursor-font cursor sailboat} -setup {
+ button .b -text sailboat
+} -body {
+ .b configure -cursor sailboat
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.54 {check cursor-font cursor sb_down_arrow} -setup {
+ button .b -text sb_down_arrow
+} -body {
+ .b configure -cursor sb_down_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.55 {check cursor-font cursor sb_h_double_arrow} -setup {
+ button .b -text sb_h_double_arrow
+} -body {
+ .b configure -cursor sb_h_double_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.56 {check cursor-font cursor sb_left_arrow} -setup {
+ button .b -text sb_left_arrow
+} -body {
+ .b configure -cursor sb_left_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.57 {check cursor-font cursor sb_right_arrow} -setup {
+ button .b -text sb_right_arrow
+} -body {
+ .b configure -cursor sb_right_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.58 {check cursor-font cursor sb_up_arrow} -setup {
+ button .b -text sb_up_arrow
+} -body {
+ .b configure -cursor sb_up_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.59 {check cursor-font cursor sb_v_double_arrow} -setup {
+ button .b -text sb_v_double_arrow
+} -body {
+ .b configure -cursor sb_v_double_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.60 {check cursor-font cursor shuttle} -setup {
+ button .b -text shuttle
+} -body {
+ .b configure -cursor shuttle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.61 {check cursor-font cursor sizing} -setup {
+ button .b -text sizing
+} -body {
+ .b configure -cursor sizing
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.62 {check cursor-font cursor spider} -setup {
+ button .b -text spider
+} -body {
+ .b configure -cursor spider
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.63 {check cursor-font cursor spraycan} -setup {
+ button .b -text spraycan
+} -body {
+ .b configure -cursor spraycan
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.64 {check cursor-font cursor star} -setup {
+ button .b -text star
+} -body {
+ .b configure -cursor star
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.65 {check cursor-font cursor target} -setup {
+ button .b -text target
+} -body {
+ .b configure -cursor target
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.66 {check cursor-font cursor tcross} -setup {
+ button .b -text tcross
+} -body {
+ .b configure -cursor tcross
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.67 {check cursor-font cursor top_left_arrow} -setup {
+ button .b -text top_left_arrow
+} -body {
+ .b configure -cursor top_left_arrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.68 {check cursor-font cursor top_left_corner} -setup {
+ button .b -text top_left_corner
+} -body {
+ .b configure -cursor top_left_corner
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.69 {check cursor-font cursor top_right_corner} -setup {
+ button .b -text top_right_corner
+} -body {
+ .b configure -cursor top_right_corner
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.70 {check cursor-font cursor top_side} -setup {
+ button .b -text top_side
+} -body {
+ .b configure -cursor top_side
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.71 {check cursor-font cursor top_tee} -setup {
+ button .b -text top_tee
+} -body {
+ .b configure -cursor top_tee
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.72 {check cursor-font cursor trek} -setup {
+ button .b -text trek
+} -body {
+ .b configure -cursor trek
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.73 {check cursor-font cursor ul_angle} -setup {
+ button .b -text ul_angle
+} -body {
+ .b configure -cursor ul_angle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.74 {check cursor-font cursor umbrella} -setup {
+ button .b -text umbrella
+} -body {
+ .b configure -cursor umbrella
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.75 {check cursor-font cursor ur_angle} -setup {
+ button .b -text ur_angle
+} -body {
+ .b configure -cursor ur_angle
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.76 {check cursor-font cursor watch} -setup {
+ button .b -text watch
+} -body {
+ .b configure -cursor watch
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-6.77 {check cursor-font cursor xterm} -setup {
+ button .b -text xterm
+} -body {
+ .b configure -cursor xterm
+} -cleanup {
+ destroy .b
+} -result {}
# Test cursor named "none", it is not defined in
# the X cursor table. It is defined in a Tk specific
# table of named cursors and should be available on
# all platforms.
-
-test cursor-6.80 {} -setup {
+test cursor-6.78 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
@@ -240,7 +729,7 @@ test cursor-6.80 {} -setup {
destroy .b
} -result none
-test cursor-6.81 {} -setup {
+test cursor-6.79 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
@@ -250,7 +739,7 @@ test cursor-6.81 {} -setup {
destroy .b
} -result {}
-test cursor-6.82 {} -setup {
+test cursor-6.80 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
.b configure -cursor none
@@ -261,7 +750,7 @@ test cursor-6.82 {} -setup {
destroy .b
} -result none
-test cursor-6.83 {} -setup {
+test cursor-6.81 {test cursor named "none"} -setup {
button .b -text CButton
} -body {
# Setting fg and bg does nothing for the none cursor
@@ -283,31 +772,72 @@ test cursor-6.83 {} -setup {
# -------------------------------------------------------------------------
# Check the Windows specific cursors
-
-foreach {testName cursor} {
- cursor-7.1 no
- cursor-7.2 starting
- cursor-7.3 size
- cursor-7.4 size_ne_sw
- cursor-7.5 size_ns
- cursor-7.6 size_nw_se
- cursor-7.7 size_we
- cursor-7.8 uparrow
- cursor-7.9 wait
-} {
- test $testName "check Windows cursor $cursor" -constraints win -setup {
- button .b -text $cursor
- } -body {
- .b configure -cursor $cursor
- } -cleanup {
- destroy .b
- } -result {}
-}
+test cursor-7.1 {check Windows cursor no} -constraints win -setup {
+ button .b -text no
+} -body {
+ .b configure -cursor no
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.2 {check Windows cursor starting} -constraints win -setup {
+ button .b -text starting
+} -body {
+ .b configure -cursor starting
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.3 {check Windows cursor size} -constraints win -setup {
+ button .b -text size
+} -body {
+ .b configure -cursor size
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.4 {check Windows cursor size_ne_sw} -constraints win -setup {
+ button .b -text size_ne_sw
+} -body {
+ .b configure -cursor size_ne_sw
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.5 {check Windows cursor size_ns} -constraints win -setup {
+ button .b -text size_ns
+} -body {
+ .b configure -cursor size_ns
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.6 {check Windows cursor size_nw_se} -constraints win -setup {
+ button .b -text size_nw_se
+} -body {
+ .b configure -cursor size_nw_se
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.7 {check Windows cursor size_we} -constraints win -setup {
+ button .b -text size_we
+} -body {
+ .b configure -cursor size_we
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.8 {check Windows cursor uparrow} -constraints win -setup {
+ button .b -text uparrow
+} -body {
+ .b configure -cursor uparrow
+} -cleanup {
+ destroy .b
+} -result {}
+test cursor-7.9 {check Windows cursor wait} -constraints win -setup {
+ button .b -text wait
+} -body {
+ .b configure -cursor wait
+} -cleanup {
+ destroy .b
+} -result {}
# -------------------------------------------------------------------------
-destroy .t
-
# cleanup
cleanupTests
return
diff --git a/tests/dialog.test b/tests/dialog.test
index f47296e..78b6620 100644
--- a/tests/dialog.test
+++ b/tests/dialog.test
@@ -1,58 +1,67 @@
# This file is a Tcl script to test out Tk's "tk_dialog" command.
# It is organized in the standard fashion for Tcl tests.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
test dialog-1.1 {tk_dialog command} -body {
- list [catch {tk_dialog} msg] $msg
-} -match glob -result {1 {wrong # args: should be "tk_dialog w title text bitmap default *"}}
-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]
+ tk_dialog
+} -match glob -returnCodes error -result {wrong # args: should be "tk_dialog w title text bitmap default *"}
+test dialog-1.2 {tk_dialog command} -body {
+ tk_dialog foo foo foo foo foo
+} -returnCodes error -result {bad window path name "foo"}
+test dialog-1.3 {tk_dialog command} -body {
+ tk_dialog .d foo foo fooBitmap foo
+} -cleanup {
destroy .d
- set res
-} {1 {bitmap "foo" not defined}}
+} -returnCodes error -result {bitmap "fooBitmap" 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} {
+test dialog-2.1 {tk_dialog operation} -setup {
+ 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
+ }
+} -body {
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} {
+ return $res
+} -cleanup {
+ destroy .d
+} -result {0}
+test dialog-2.2 {tk_dialog operation} -setup {
+ proc HitReturn {w} {
+ event generate $w <Enter>
+ focus -force $w
+ event generate $w <KeyPress> -keysym Return
+ }
+} -body {
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} {
+ return $res
+} -cleanup {
+ destroy .d
+} -result {1}
+test dialog-2.3 {tk_dialog operation} -body {
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}
+ return $res
+} -cleanup {
+ destroy .b
+} -result {-1}
cleanupTests
return
+
diff --git a/tests/embed.test b/tests/embed.test
index bac2675..8a29862 100644
--- a/tests/embed.test
+++ b/tests/embed.test
@@ -4,67 +4,85 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-global tcl_platform
-test embed-1.1 {TkpUseWindow procedure, bad window identifier} {
+test embed-1.1 {TkpUseWindow procedure, bad window identifier} -setup {
deleteWindows
- list [catch {toplevel .t -use xyz} msg] $msg
-} {1 {expected integer but got "xyz"}}
+} -body {
+ toplevel .t -use xyz
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "xyz"}
-test embed-1.2 {CreateFrame procedure, bad window identifier} {
+test embed-1.2 {CreateFrame procedure, bad window identifier} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -container xyz
+} -cleanup {
deleteWindows
- list [catch {toplevel .t -container xyz} msg] $msg
-} {1 {expected boolean value but got "xyz"}}
+} -returnCodes error -result {expected boolean value but got "xyz"}
-test embed-1.3 {CreateFrame procedure, both -use and
- -container is invalid } {
+test embed-1.3 {CreateFrame procedure, both -use and -container is invalid} -setup {
deleteWindows
+} -body {
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.}}
-
-if {$tcl_platform(platform) == "windows"} {
-
-# testing window embedding for Windows platform
+ toplevel .t -use [winfo id .container] -container 1
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {A window cannot have both the -use and the -container option set.}
-test embed-1.4.win {TkpUseWindow procedure, -container must be set} {
+# testing window embedding for win platforms
+test embed-1.4.win {TkpUseWindow procedure, -container must be set} -constraints {
+ win
+} -setup {
deleteWindows
+} -body {
toplevel .container
- list [catch {toplevel .embd -use [winfo id .container]} err] $err
-} {1 {the window to use is not a Tk container}}
-
-test embed-1.5.win {TkpUseWindow procedure, -container must be set} {
+ toplevel .embd -use [winfo id .container]
+} -cleanup {
deleteWindows
+} -returnCodes error -result {the window to use is not a Tk container}
+# testing window embedding for win platforms
+test embed-1.5.win {TkpUseWindow procedure, -container must be set} -constraints {
+ win
+} -setup {
+ deleteWindows
+} -body {
frame .container
- list [catch {toplevel .embd -use [winfo id .container]} err] $err
-} {1 {the window to use is not a Tk container}}
-
-} else {
-
-# testing window embedding for other platforms
+ toplevel .embd -use [winfo id .container]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {the window to use is not a Tk container}
-test embed-1.4.nonwin {TkpUseWindow procedure, -container must be set} {
+# testing window embedding for other than win platforms
+test embed-1.4.nonwin {TkpUseWindow procedure, -container must be set} -constraints {
+ nonwin
+} -setup {
deleteWindows
+} -body {
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.nonwin {TkpUseWindow procedure, -container must be set} {
+ toplevel .embd -use [winfo id .container]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {window ".container" doesn't have -container option set}
+# testing window embedding for other than win platforms
+test embed-1.5.nonwin {TkpUseWindow procedure, -container must be set} -constraints {
+ nonwin
+} -setup {
deleteWindows
+} -body {
frame .container
- list [catch {toplevel .embd -use [winfo id .container]} err] $err
-} {1 {window ".container" doesn't have -container option set}}
-
-}
+ toplevel .embd -use [winfo id .container]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {window ".container" doesn't have -container option set}
-# FIXME: test cases common to unixEmbed.test and macEmbed.test should
-# be moved here.
cleanupTests
return
+
diff --git a/tests/entry.test b/tests/entry.test
index ffdbf45..11408ac 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -6,221 +6,880 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+# For xscrollcommand
proc scroll args {
- global scrollInfo
- set scrollInfo $args
+ global scrollInfo
+ set scrollInfo $args
+}
+# For trace variable
+proc override args {
+ global x
+ set x 12345
}
-# Create additional widget that's used to hold the selection at times.
-
-entry .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 *Entry.borderWidth 2
-option add *Entry.highlightThickness 2
-option add *Entry.font {Helvetica -12}
-
-entry .e -bd 2 -relief sunken
-pack .e
-update
-
-set i 1
-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"}}
- {-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-*-*-*-*-*-*
- -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* {}
- {font "" doesn't exist}}
- {-foreground #110022 #110022 bogus {unknown color name "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 {} {}}
- {-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 "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, normal, or readonly}}
- {-takefocus "any string" "any string" {} {}}
- {-textvariable i i {} {}}
- {-width 402 402 3p {expected integer but got "3p"}}
- {-xscrollcommand {Some command} {Some command} {} {}}
-} {
- lassign $test name goodValue goodResult badValue badResult
- test entry-1.$i {configuration options} {
- .e configure $name $goodValue
- list [lindex [.e configure $name] 4] [.e cget $name]
- } [list $goodResult $goodResult]
- incr i
- if {$badValue ne ""} {
- test entry-1.$i {configuration options} -body {
- .e configure $name $badValue
- } -returnCodes error -result $badResult
- }
- .e configure $name [lindex [.e configure $name] 3]
- incr i
+# Procedures used in widget VALIDATION tests
+proc doval {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 1
+}
+proc doval2 {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ set ::e mydata
+ return 1
+}
+proc doval3 {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 0
}
-test entry-2.1 {Tk_EntryCmd procedure} {
- list [catch {entry} msg] $msg
-} {1 {wrong # args: should be "entry pathName ?options?"}}
-test entry-2.2 {Tk_EntryCmd procedure} {
- list [catch {entry gorp} msg] $msg
-} {1 {bad window path name "gorp"}}
-test entry-2.3 {Tk_EntryCmd procedure} {
- catch {destroy .e}
+set cy [font metrics {Courier -12} -linespace]
+
+
+test entry-1.1 {configuration option: "background" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -background #ff0000
+ .e cget -background
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test entry-1.2 {configuration option: "background" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -background non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.3 {configuration option: "bd" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -bd 4
+ .e cget -bd
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-1.4 {configuration option: "bd" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -bd badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test entry-1.5 {configuration option: "bg" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -bg #ff0000
+ .e cget -bg
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test entry-1.6 {configuration option: "bg" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -bg non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.7 {configuration option: "borderwidth" for entry} -setup {
+ entry .e -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -borderwidth 1.3
+ .e cget -borderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-1.8 {configuration option: "borderwidth" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -borderwidth badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test entry-1.9 {configuration option: "cursor" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -cursor arrow
+ .e cget -cursor
+} -cleanup {
+ destroy .e
+} -result {arrow}
+test entry-1.10 {configuration option: "cursor" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -cursor badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+
+test entry-1.11 {configuration option: "disabledbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -disabledbackground green
+ .e cget -disabledbackground
+} -cleanup {
+ destroy .e
+} -result {green}
+test entry-1.12 {configuration option: "disabledbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -disabledbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.13 {configuration option: "disabledforeground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -disabledforeground blue
+ .e cget -disabledforeground
+} -cleanup {
+ destroy .e
+} -result {blue}
+test entry-1.14 {configuration option: "disabledforeground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -disabledforeground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.15 {configuration option: "exportselection" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -exportselection yes
+ .e cget -exportselection
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-1.16 {configuration option: "exportselection" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -exportselection xyzzy
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected boolean value but got "xyzzy"}
+
+test entry-1.17 {configuration option: "fg" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -fg #110022
+ .e cget -fg
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.18 {configuration option: "fg" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -fg non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.19 {configuration option: "font" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e configure -font {Helvetica -12}
+ .e cget -font
+} -cleanup {
+ destroy .e
+} -result {Helvetica -12}
+test entry-1.20 {configuration option: "font" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e configure -font {}
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {font "" doesn't exist}
+
+test entry-1.21 {configuration option: "foreground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -foreground #110022
+ .e cget -foreground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.22 {configuration option: "foreground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -foreground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.23 {configuration option: "highlightbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightbackground #110022
+ .e cget -highlightbackground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.24 {configuration option: "highlightbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.25 {configuration option: "highlightcolor" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightcolor #110022
+ .e cget -highlightcolor
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.26 {configuration option: "highlightcolor" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightcolor non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.27 {configuration option: "highlightthickness" for entry} -setup {
+ entry .e -borderwidth 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness 6
+ .e cget -highlightthickness
+} -cleanup {
+ destroy .e
+} -result {6}
+test entry-1.28 {configuration option: "highlightthickness" for entry} -setup {
+ entry .e -borderwidth 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness -2
+ .e cget -highlightthickness
+} -cleanup {
+ destroy .e
+} -result {0}
+test entry-1.29 {configuration option: "highlightthickness" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test entry-1.30 {configuration option: "insertbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertbackground #110022
+ .e cget -insertbackground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.31 {configuration option: "insertbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertborderwidth 1.3
+ .e cget -insertborderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertborderwidth 2.6x
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "2.6x"}
+
+test entry-1.34 {configuration option: "insertofftime" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertofftime 100
+ .e cget -insertofftime
+} -cleanup {
+ destroy .e
+} -result {100}
+test entry-1.35 {configuration option: "insertofftime" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertofftime 3.2
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3.2"}
+
+test entry-1.36 {configuration option: "insertontime" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertontime 100
+ .e cget -insertontime
+} -cleanup {
+ destroy .e
+} -result {100}
+test entry-1.37 {configuration option: "insertontime" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -insertontime 3.2
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3.2"}
+
+test entry-1.38 {configuration option: "invalidcommand" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -invalidcommand "any string"
+ .e cget -invalidcommand
+} -cleanup {
+ destroy .e
+} -result {any string}
+
+test entry-1.39 {configuration option: "invcmd" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -invcmd "any string"
+ .e cget -invcmd
+} -cleanup {
+ destroy .e
+} -result {any string}
+
+test entry-1.40 {configuration option: "justify" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -justify right
+ .e cget -justify
+} -cleanup {
+ destroy .e
+} -result {right}
+test entry-1.41 {configuration option: "justify" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -justify bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+
+test entry-1.42 {configuration option: "readonlybackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -readonlybackground green
+ .e cget -readonlybackground
+} -cleanup {
+ destroy .e
+} -result {green}
+test entry-1.43 {configuration option: "readonlybackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -readonlybackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.44 {configuration option: "relief" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -relief flat
+ .e cget -relief
+} -cleanup {
+ destroy .e
+} -result {flat}
+
+test entry-1.45 {configuration option: "selectbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectbackground #110022
+ .e cget -selectbackground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.46 {configuration option: "selectbackground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectborderwidth 1.3
+ .e cget -selectborderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectborderwidth badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test entry-1.49 {configuration option: "selectforeground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectforeground #110022
+ .e cget -selectforeground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test entry-1.50 {configuration option: "selectforeground" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -selectforeground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test entry-1.51 {configuration option: "show" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -show *
+ .e cget -show
+} -cleanup {
+ destroy .e
+} -result {*}
+
+test entry-1.52 {configuration option: "state" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -state n
+ .e cget -state
+} -cleanup {
+ destroy .e
+} -result {normal}
+test entry-1.53 {configuration option: "state" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -state bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly}
+
+test entry-1.54 {configuration option: "takefocus" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -takefocus "any string"
+ .e cget -takefocus
+} -cleanup {
+ destroy .e
+} -result {any string}
+
+test entry-1.55 {configuration option: "textvariable" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -textvariable i
+ .e cget -textvariable
+} -cleanup {
+ destroy .e
+} -result {i}
+
+test entry-1.56 {configuration option: "width" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -width 402
+ .e cget -width
+} -cleanup {
+ destroy .e
+} -result {402}
+test entry-1.57 {configuration option: "width" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -width 3p
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .e
+ update
+} -body {
+ .e configure -xscrollcommand {Some command}
+ .e cget -xscrollcommand
+} -cleanup {
+ destroy .e
+} -result {Some command}
+
+
+
+test entry-2.1 {Tk_EntryCmd procedure} -body {
+ entry
+} -returnCodes error -result {wrong # args: should be "entry pathName ?-option value ...?"}
+test entry-2.2 {Tk_EntryCmd procedure} -body {
+ entry gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test entry-2.3 {Tk_EntryCmd procedure} -body {
entry .e
+ pack .e
+ update
list [winfo exists .e] [winfo class .e] [info commands .e]
-} {1 Entry .e}
-test entry-2.4 {Tk_EntryCmd procedure} {
- catch {destroy .e}
- list [catch {entry .e -gorp foo} msg] $msg [winfo exists .e] \
- [info commands .e]
-} {1 {unknown option "-gorp"} 0 {}}
-test entry-2.5 {Tk_EntryCmd procedure} {
- catch {destroy .e}
+} -cleanup {
+ destroy .e
+} -result {1 Entry .e}
+test entry-2.4 {Tk_EntryCmd procedure} -body {
+ entry .e -gorp foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-gorp"}
+test entry-2.4.1 {Tk_EntryCmd procedure} -body {
+ catch {entry .e -gorp foo}
+ list [winfo exists .e] [info commands .e]
+} -cleanup {
+ destroy .e
+} -result {0 {}}
+test entry-2.5 {Tk_EntryCmd procedure} -body {
entry .e
-} {.e}
-
-catch {destroy .e}
-entry .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 entry-3.1 {EntryWidgetCmd procedure} {
- list [catch {.e} msg] $msg
-} {1 {wrong # args: should be ".e option ?arg arg ...?"}}
-test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} {
- list [catch {.e bbox} msg] $msg
-} {1 {wrong # args: should be ".e bbox index"}}
-test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} {
- list [catch {.e bbox a b} msg] $msg
-} {1 {wrong # args: should be ".e bbox index"}}
-test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} {
- list [catch {.e bbox bogus} msg] $msg
-} {1 {bad entry index "bogus"}}
-test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} {
- .e delete 0 end
- .e bbox 0
-} [list 5 5 0 $cy]
-test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} {
- # Tcl_UtfAtIndex(): no utf chars
+} -cleanup {
+ destroy .e
+} -result {.e}
- .e delete 0 end
+
+test entry-3.1 {EntryWidgetCmd procedure} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"}
+test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e bbox index"}
+test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox a b
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e bbox index"}
+test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e bbox bogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "bogus"}
+test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox 0
+} -cleanup {
+ destroy .e
+} -result [list 5 5 0 $cy]
+
+# Previously the result was count using previousli counted font measurements
+# and metrics. It was changed to less verbose solution - the result is the one
+# that passes fonts constraint (this concerns tests 3.6, 3.7, 3.8, 3.10)
+test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): no utf chars
.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 entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} {
- # Tcl_UtfAtIndex(): utf at end
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {{19 5 7 13} {19 5 7 13}}
+test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): utf at end
.e insert 0 "ab\u4e4e"
.e bbox end
-} "[expr 5+2*$cx] 5 $ux $cy"
-test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} {
- # Tcl_UtfAtIndex(): utf before index
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {19 5 12 13}
+test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): utf before index
.e insert 0 "ab\u4e4ec"
.e bbox 3
-} "[expr 5+2*$cx+$ux] 5 $cx $cy"
-test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} {
- # Tcl_UtfAtIndex(): no chars
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {31 5 7 13}
+test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): no chars
.e bbox end
-} "5 5 0 $cy"
-test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result "5 5 0 $cy"
+test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
.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 entry-3.11 {EntryWidgetCmd procedure, "cget" widget command} {
- list [catch {.e cget} msg] $msg
-} {1 {wrong # args: should be ".e cget option"}}
-test entry-3.12 {EntryWidgetCmd procedure, "cget" widget command} {
- list [catch {.e cget a b} msg] $msg
-} {1 {wrong # args: should be ".e cget option"}}
-test entry-3.13 {EntryWidgetCmd procedure, "cget" widget command} {
- list [catch {.e cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} {
+} -cleanup {
+ destroy .e
+} -result {{5 5 7 13} {12 5 7 13} {75 5 12 13} {122 5 7 13}}
+test entry-3.11 {EntryWidgetCmd procedure, "cget" widget command} -setup {
+ entry .e
+} -body {
+ .e cget
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e cget option"}
+test entry-3.12 {EntryWidgetCmd procedure, "cget" widget command} -setup {
+ entry .e
+} -body {
+ .e cget a b
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e cget option"}
+test entry-3.13 {EntryWidgetCmd procedure, "cget" widget command} -setup {
+ entry .e
+} -body {
+ .e cget -gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-gorp"}
+test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup {
+ entry .e
+} -body {
.e configure -bd 4
.e cget -bd
-} {4}
-test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
llength [.e configure]
-} {36}
-test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} {
- list [catch {.e configure -foo} msg] $msg
-} {1 {unknown option "-foo"}}
-test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} {
+} -cleanup {
+ destroy .e
+} -result {36}
+test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} -setup {
+ entry .e
+} -body {
+ .e configure -foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-foo"}
+test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup {
+ entry .e
+} -body {
.e configure -bd 4
.e configure -bg #ffffff
lindex [.e configure -bd] 4
-} {4}
-test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} {
- list [catch {.e delete} msg] $msg
-} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}}
-test entry-3.19 {EntryWidgetCmd procedure, "delete" widget command} {
- list [catch {.e delete a b c} msg] $msg
-} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}}
-test entry-3.20 {EntryWidgetCmd procedure, "delete" widget command} {
- list [catch {.e delete foo} msg] $msg
-} {1 {bad entry index "foo"}}
-test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} {
- list [catch {.e delete 0 bar} msg] $msg
-} {1 {bad entry index "bar"}}
-test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+} -body {
+ .e delete
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"}
+test entry-3.19 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+} -body {
+ .e delete a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"}
+test entry-3.20 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+} -body {
+ .e delete foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "foo"}
+test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+} -body {
+ .e delete 0 bar
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "bar"}
+test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e delete 2 4
.e get
-} {014567890}
-test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {014567890}
+test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+} -body {
.e insert end "01234567890"
.e delete 6
.e get
-} {0123457890}
-test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} {
- # UTF
+} -cleanup {
+ destroy .e
+} -result {0123457890}
+test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+ pack .e
+ update
set x {}
- .e delete 0 end
+} -body {
+# UTF
.e insert end "01234\u4e4e67890"
.e delete 6
lappend x [.e get]
@@ -232,311 +891,659 @@ test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} {
.e insert end "0123456\u4e4e890"
.e delete 6
lappend x [.e get]
-} [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"]
-test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"]
+test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e delete 6 5
.e get
-} {01234567890}
-test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e configure -state disabled
.e delete 2 8
.e configure -state normal
.e get
-} {01234567890}
-test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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"}}
-test entry-3.28 {EntryWidgetCmd procedure, "icursor" widget command} {
- list [catch {.e icursor} msg] $msg
-} {1 {wrong # args: should be ".e icursor pos"}}
-test entry-3.29 {EntryWidgetCmd procedure, "icursor" widget command} {
- list [catch {.e icursor foo} msg] $msg
-} {1 {bad entry index "foo"}}
-test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test entry-3.27 {EntryWidgetCmd procedure, "get" widget command} -setup {
+ entry .e
+} -body {
+ .e get foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e get"}
+test entry-3.28 {EntryWidgetCmd procedure, "icursor" widget command} -setup {
+ entry .e
+} -body {
+ .e icursor
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e icursor pos"}
+test entry-3.29 {EntryWidgetCmd procedure, "icursor" widget command} -setup {
+ entry .e
+} -body {
+ .e icursor foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "foo"}
+test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} -setup {
+ entry .e
+} -body {
.e insert end "01234567890"
.e icursor 4
.e index insert
-} {4}
-test entry-3.31 {EntryWidgetCmd procedure, "index" widget command} {
- list [catch {.e in} msg] $msg
-} {1 {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}}
-test entry-3.32 {EntryWidgetCmd procedure, "index" widget command} {
- list [catch {.e index} msg] $msg
-} {1 {wrong # args: should be ".e index string"}}
-test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} {
- list [catch {.e index foo} msg] $msg
-} {1 {bad entry index "foo"}}
-test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} {
- list [catch {.e index 0} msg] $msg
-} {0 0}
-test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} {
- # UTF
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-3.31 {EntryWidgetCmd procedure, "index" widget command} -setup {
+ entry .e
+} -body {
+ .e in
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}
+test entry-3.32 {EntryWidgetCmd procedure, "index" widget command} -setup {
+ entry .e
+} -body {
+ .e index
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e index string"}
+test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup {
+ entry .e
+} -body {
+ .e index foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "foo"}
+test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e index 0
+} -cleanup {
+ destroy .e
+} -returnCodes {ok} -match glob -result {*}
+test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+# UTF
.e insert 0 abc\u4e4e\u0153def
list [.e index 3] [.e index 4] [.e index end]
-} {3 4 8}
-test entry-3.36 {EntryWidgetCmd procedure, "insert" widget command} {
- list [catch {.e insert a} msg] $msg
-} {1 {wrong # args: should be ".e insert index text"}}
-test entry-3.37 {EntryWidgetCmd procedure, "insert" widget command} {
- list [catch {.e insert a b c} msg] $msg
-} {1 {wrong # args: should be ".e insert index text"}}
-test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} {
- list [catch {.e insert foo Text} msg] $msg
-} {1 {bad entry index "foo"}}
-test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {3 4 8}
+test entry-3.36 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+} -body {
+ .e insert a
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test entry-3.37 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+} -body {
+ .e insert a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+} -body {
+ .e insert foo Text
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "foo"}
+test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e insert 3 xxx
.e get
-} {012xxx34567890}
-test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {012xxx34567890}
+test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e configure -state disabled
.e insert 3 xxx
.e configure -state normal
.e get
-} {01234567890}
-test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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"}}
-test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} {
- list [catch {.e scan a} msg] $msg
-} {1 {wrong # args: should be ".e scan mark|dragto x"}}
-test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} {
- list [catch {.e scan a b c} msg] $msg
-} {1 {wrong # args: should be ".e scan mark|dragto x"}}
-test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} {
- list [catch {.e scan foobar 20} msg] $msg
-} {1 {bad scan option "foobar": must be mark or dragto}}
-test entry-3.45 {EntryWidgetCmd 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.
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} -setup {
+ entry .e
+} -body {
+ .e insert a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e scan a
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"}
+test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e scan a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"}
+test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e scan foobar 20
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad scan option "foobar": must be mark or dragto}
+test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e scan mark 20.1
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected integer but got "20.1"}
-test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} {fonts} {
- .e delete 0 end
+# This test is non-portable because character sizes vary.
+test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} -constraints {
+ fonts
+} -setup {
+ entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2
+ pack .e
update
+} -body {
.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 entry-3.47 {EntryWidgetCmd procedure, "select" widget command} {
- list [catch {.e select} msg] $msg
-} {1 {wrong # args: should be ".e selection option ?index?"}}
-test entry-3.48 {EntryWidgetCmd procedure, "select" widget command} {
- list [catch {.e select foo} msg] $msg
-} {1 {bad selection option "foo": must be adjust, clear, from, present, range, or to}}
-test entry-3.49 {EntryWidgetCmd procedure, "select clear" widget command} {
- list [catch {.e select clear gorp} msg] $msg
-} {1 {wrong # args: should be ".e selection clear"}}
-test entry-3.50 {EntryWidgetCmd procedure, "select clear" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {2}
+test entry-3.47 {EntryWidgetCmd procedure, "select" widget command} -setup {
+ entry .e
+} -body {
+ .e select
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection option ?index?"}
+test entry-3.48 {EntryWidgetCmd procedure, "select" widget command} -setup {
+ entry .e
+} -body {
+ .e select foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad selection option "foo": must be adjust, clear, from, present, range, or to}
+
+test entry-3.49 {EntryWidgetCmd procedure, "select clear" widget command} -setup {
+ entry .e
+} -body {
+ .e select clear gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection clear"}
+test entry-3.50 {EntryWidgetCmd procedure, "select clear" widget command} -setup {
+ entry .e
+} -body {
.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 entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} {
- list [catch {.e selection present foo} msg] $msg
-} {1 {wrong # args: should be ".e selection present"}}
-test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} {
- .e delete 0 end
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test entry-3.50.1 {EntryWidgetCmd procedure, "select clear" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 4
+ update
+ .e select clear
+ catch {selection get}
+ selection own
+} -cleanup {
+ destroy .e
+} -result {.e}
+
+test entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} -setup {
+ entry .e
+} -body {
+ .e selection present foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection present"}
+test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end 0123456789
.e select from 3
.e select to 6
.e selection present
-} {1}
-test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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 entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end 0123456789
.e select from 3
.e select to 6
.e delete 0 end
.e selection present
-} {0}
-test entry-3.55 {EntryWidgetCmd procedure, "selection adjust" widget command} {
- list [catch {.e select adjust x} msg] $msg
-} {1 {bad entry index "x"}}
-test entry-3.56 {EntryWidgetCmd procedure, "selection adjust" widget command} {
- list [catch {.e select adjust 2 3} msg] $msg
-} {1 {wrong # args: should be ".e selection adjust index"}}
-test entry-3.57 {EntryWidgetCmd procedure, "selection adjust" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0}
+test entry-3.55 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup {
+ entry .e
+} -body {
+ .e select adjust x
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "x"}
+test entry-3.56 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup {
+ entry .e
+} -body {
+ .e select adjust 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection adjust index"}
+test entry-3.57 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "0123456789"
.e select from 1
.e select to 5
update
.e select adjust 4
selection get
-} {123}
-test entry-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {123}
+test entry-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.e insert end "0123456789"
.e select from 1
.e select to 5
update
.e select adjust 2
selection get
-} {234}
-test entry-3.59 {EntryWidgetCmd procedure, "selection from" widget command} {
- list [catch {.e select from 2 3} msg] $msg
-} {1 {wrong # args: should be ".e selection from index"}}
-test entry-3.60 {EntryWidgetCmd procedure, "selection range" widget command} {
- list [catch {.e select range 2} msg] $msg
-} {1 {wrong # args: should be ".e selection range start end"}}
-test entry-3.61 {EntryWidgetCmd 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 entry-3.62 {EntryWidgetCmd procedure, "selection range" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {234}
+test entry-3.59 {EntryWidgetCmd procedure, "selection from" widget command} -setup {
+ entry .e
+} -body {
+ .e select from 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection from index"}
+
+test entry-3.60 {EntryWidgetCmd procedure, "selection range" widget command} -setup {
+ entry .e
+} -body {
+ .e select range 2
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection range start end"}
+test entry-3.61 {EntryWidgetCmd procedure, "selection range" widget command} -setup {
+ entry .e
+} -body {
+ .e selection range 2 3 4
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection range start end"}
+test entry-3.62 {EntryWidgetCmd procedure, "selection range" widget command} -setup {
+ entry .e
+} -body {
.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 entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} {
- .e delete 0 end
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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}
-test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {2 9 3}
+test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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.64a {EntryWidgetCmd procedure, "selection" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0 10}
+test entry-3.64a {EntryWidgetCmd procedure, "selection" widget command} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
.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."
-test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} {
- list [catch {.e select to 2 3} msg] $msg
-} {1 {wrong # args: should be ".e selection to index"}}
-test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {2 4}
+test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} -setup {
+ entry .e
+ pack .e
+ update
+ .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."
+} -body {
+ .e select to 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection to index"}
+
+test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 5
format {%.7f %.7f} {*}[.e xview]
-} {0.0537634 0.2688172}
-test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview gorp} msg] $msg
-} {1 {bad entry index "gorp"}}
-test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.0537634 0.2688172}
+test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "gorp"}
+test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 0
.e icursor 10
.e xview insert
format {%.6f %.6f} {*}[.e xview]
-} {0.107527 0.322581}
-test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview moveto foo bar} msg] $msg
-} {1 {wrong # args: should be ".e xview moveto fraction"}}
-test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview moveto foo} msg] $msg
-} {1 {expected floating-point number but got "foo"}}
-test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.107527 0.322581}
+test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview moveto foo bar
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"}
+test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview moveto foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected floating-point number but got "foo"}
+test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview moveto 0.5
format {%.6f %.6f} {*}[.e xview]
-} {0.505376 0.720430}
-test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview scroll 24} msg] $msg
-} {1 {wrong # args: should be ".e xview scroll number units|pages"}}
-test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview scroll gorp units} msg] $msg
-} {1 {expected integer but got "gorp"}}
-test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.505376 0.720430}
+test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
+ .e xview scroll 24
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"}
+test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview scroll gorp units
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected integer but got "gorp"}
+test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview moveto 0
.e xview scroll 1 pages
format {%.6f %.6f} {*}[.e xview]
-} {0.193548 0.408602}
-test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.193548 0.408602}
+test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview moveto .9
update
.e xview scroll -2 p
format {%.6f %.6f} {*}[.e xview]
-} {0.397849 0.612903}
-test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.397849 0.612903}
+test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview 30
update
.e xview scroll 2 units
.e index @0
-} {32}
-test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {32}
+test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview 30
update
.e xview scroll -1 units
.e index @0
-} {29}
-test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview scroll 23 foobars} msg] $msg
-} {1 {bad argument "foobars": must be units or pages}}
-test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} {
- list [catch {.e xview eat 23 hamburgers} msg] $msg
-} {1 {unknown option "eat": must be moveto or scroll}}
-test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {29}
+test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview scroll 23 foobars
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad argument "foobars": must be units or pages}
+test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview eat 23 hamburgers
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "eat": must be moveto or scroll}
+test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 0
update
.e xview -4
.e index @0
-} {0}
-test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0}
+test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview 300
.e index @0
-} {73}
-.e insert 10 \u4e4e
-test entry-3.81 {EntryWidgetCmd procedure, "xview" widget command} {
- # UTF
- # If Tcl_NumUtfChars wasn't used, wrong answer would be:
- # 0.106383 0.117021 0.117021
-
+} -cleanup {
+ destroy .e
+} -result {73}
+test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ .e insert 10 \u4e4e
+ update
+# 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 [format {%.6f} [lindex [.e xview] 0]]
@@ -544,261 +1551,382 @@ test entry-3.81 {EntryWidgetCmd procedure, "xview" widget command} {
lappend x [format {%.6f} [lindex [.e xview] 0]]
.e xview moveto .12
lappend x [format {%.6f} [lindex [.e xview] 0]]
-} {0.095745 0.106383 0.117021}
-test entry-3.82 {EntryWidgetCmd procedure} {
- list [catch {.e gorp} msg] $msg
-} {1 {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}}
+} -cleanup {
+ destroy .e
+} -result {0.095745 0.106383 0.117021}
+
+test entry-3.82 {EntryWidgetCmd procedure} -setup {
+ entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}
# The test below doesn't actually check anything directly, but if run
# with Purify or some other memory-allocation-checking program it will
# ensure that resources get properly freed.
-test entry-4.1 {DestroyEntry procedure} {
- catch {destroy .e}
+test entry-4.1 {DestroyEntry procedure} -body {
entry .e -textvariable x -show *
pack .e
.e insert end "Sample text"
update
destroy .e
-} {}
+} -result {}
-frame .f -width 200 -height 50 -relief raised -bd 2
-pack .f -side right
-test entry-5.1 {ConfigureEntry procedure, -textvariable} {
- catch {destroy .e}
+test entry-5.1 {ConfigureEntry procedure, -textvariable} -body {
set x 12345
entry .e -textvariable x
.e get
-} {12345}
-test entry-5.2 {ConfigureEntry procedure, -textvariable} {
- catch {destroy .e}
+} -cleanup {
+ destroy .e
+} -result {12345}
+test entry-5.2 {ConfigureEntry procedure, -textvariable} -body {
set x 12345
entry .e -textvariable x
set y abcde
.e configure -textvariable y
set x 54321
.e get
-} {abcde}
-test entry-5.3 {ConfigureEntry procedure, -textvariable} {
- catch {destroy .e}
- catch {unset x}
+} -cleanup {
+ destroy .e
+} -result {abcde}
+test entry-5.3 {ConfigureEntry procedure, -textvariable} -setup {
+ unset -nocomplain x
entry .e
+} -body {
.e insert 0 "Some text"
.e configure -textvariable x
- set x
-} {Some text}
-test entry-5.4 {ConfigureEntry procedure, -textvariable} {
- proc override args {
- global x
- set x 12345
- }
- catch {destroy .e}
- catch {unset x}
- trace variable x w override
+ return $x
+} -cleanup {
+ destroy .e
+} -result {Some text}
+test entry-5.4 {ConfigureEntry procedure, -textvariable} -setup {
+ unset -nocomplain x
entry .e
+} -body {
+ trace variable x w override
.e insert 0 "Some text"
.e configure -textvariable x
- set result [list $x [.e get]]
- unset x; rename override {}
- set result
-} {12345 12345}
-test entry-5.5 {ConfigureEntry procedure} {
- catch {destroy .e}
- entry .e -exportselection false
- pack .e
- .e insert end "0123456789"
- .sel select from 0
- .sel select to 10
+ list $x [.e get]
+} -cleanup {
+ destroy .e
+ trace vdelete x w override
+ unset x;
+} -result {12345 12345}
+
+test entry-5.5 {ConfigureEntry procedure} -setup {
set x {}
+ entry .e1
+ entry .e2
+} -body {
+ .e2 insert end "This is some sample text"
+ .e1 configure -exportselection false
+ .e1 insert end "0123456789"
+ pack .e1 .e2
+ .e2 select from 0
+ .e2 select to 10
lappend x [selection get]
- .e select from 1
- .e select to 5
+ .e1 select from 1
+ .e1 select to 5
lappend x [selection get]
- .e configure -exportselection 1
+ .e1 configure -exportselection 1
lappend x [selection get]
- set x
-} {{This is so} {This is so} 1234}
-test entry-5.6 {ConfigureEntry procedure} {
- catch {destroy .e}
+ return $x
+} -cleanup {
+ destroy .e1 .e2
+} -result {{This is so} {This is so} 1234}
+test entry-5.6 {ConfigureEntry procedure} -setup {
+ entry .e
+ pack .e
+} -body {
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 5
+ .e configure -exportselection 0
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test entry-5.6.1 {ConfigureEntry procedure} -setup {
entry .e
pack .e
+} -body {
.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 entry-5.7 {ConfigureEntry procedure} {
- catch {destroy .e}
- entry .e -font $fixed -width 4 -xscrollcommand scroll
+ catch {selection get}
+ list [.e index sel.first] [.e index sel.last]
+} -cleanup {
+ destroy .e
+} -result {1 5}
+
+test entry-5.7 {ConfigureEntry procedure} -setup {
+ entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
update
.e configure -width 5
format {%.6f %.6f} {*}$scrollInfo
-} {0.000000 0.363636}
-test entry-5.8 {ConfigureEntry procedure} {fonts} {
- catch {destroy .e}
- entry .e -width 0
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.363636}
+
+
+test entry-5.8 {ConfigureEntry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -width 0 -font {Helvetica -12}
.e insert end "0123"
update
- .e configure -font $big
+ .e configure -font {Helvetica -24}
update
winfo geom .e
-} {62x37+0+0}
-test entry-5.9 {ConfigureEntry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised
+} -cleanup {
+ destroy .e
+} -result {62x37+0+0}
+test entry-5.9 {ConfigureEntry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised
.e insert end "0123"
update
list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
-} {0 0 1 1}
-test entry-5.10 {ConfigureEntry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief flat
+} -cleanup {
+ destroy .e
+} -result {0 0 1 1}
+test entry-5.10 {ConfigureEntry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief flat
.e insert end "0123"
update
list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
-} {0 0 1 1}
-test entry-5.11 {ConfigureEntry procedure} {
- # If "0" in selected font had 0 width, caused divide-by-zero error.
-
- catch {destroy .e}
- pack [entry .e -font {{open look glyph}}]
+} -cleanup {
+ destroy .e
+} -result {0 0 1 1}
+test entry-5.11 {ConfigureEntry procedure} -setup {
+ entry .e -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+# If "0" in selected font had 0 width, caused divide-by-zero error.
+ .e configure -font {{open look glyph}}
.e scan dragto 30
update
-} {}
+} -cleanup {
+ destroy .e
+} -result {}
# No tests for DisplayEntry.
-test entry-6.1 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 20 -highlightthickness 3
+test entry-6.1 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
+ -highlightthickness 3
.e insert end 012\t45
update
list [.e index @61] [.e index @62]
-} {3 4}
-test entry-6.2 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 20 -justify center \
- -highlightthickness 3
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test entry-6.2 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
+ -justify center -highlightthickness 3
.e insert end 012\t45
update
list [.e index @96] [.e index @97]
-} {3 4}
-test entry-6.3 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 20 -justify right \
- -highlightthickness 3
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test entry-6.3 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
+ -justify right -highlightthickness 3
.e insert end 012\t45
update
list [.e index @131] [.e index @132]
-} {3 4}
-test entry-6.4 {EntryComputeGeometry procedure} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 5
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test entry-6.4 {EntryComputeGeometry procedure} -setup {
+ entry .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 5
.e insert end "01234567890"
update
.e xview 6
.e index @0
-} {6}
-test entry-6.5 {EntryComputeGeometry procedure} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 5
+} -cleanup {
+ destroy .e
+} -result {6}
+test entry-6.5 {EntryComputeGeometry procedure} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 5
.e insert end "01234567890"
update
.e xview 7
.e index @0
-} {6}
-test entry-6.6 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $fixed -bd 2 -relief raised -width 10
+} -cleanup {
+ destroy .e
+} -result {6}
+test entry-6.6 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 10
.e insert end "01234\t67890"
update
.e xview 3
list [.e index @39] [.e index @40]
-} {5 6}
-test entry-6.7 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $big -bd 3 -relief raised -width 5
+} -cleanup {
+ destroy .e
+} -result {5 6}
+test entry-6.7 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5
.e insert end "01234567"
update
list [winfo reqwidth .e] [winfo reqheight .e]
-} {77 39}
-test entry-6.8 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $big -bd 3 -relief raised -width 0
+} -cleanup {
+ destroy .e
+} -result {77 39}
+test entry-6.8 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
.e insert end "01234567"
update
list [winfo reqwidth .e] [winfo reqheight .e]
-} {116 39}
-test entry-6.9 {EntryComputeGeometry procedure} {fonts} {
- catch {destroy .e}
- entry .e -font $big -bd 3 -relief raised -width 0 -highlightthickness 2
+} -cleanup {
+ destroy .e
+} -result {116 39}
+test entry-6.9 {EntryComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
update
list [winfo reqwidth .e] [winfo reqheight .e]
-} {25 39}
-test entry-6.10 {EntryComputeGeometry procedure} {unix fonts} {
- catch {destroy .e}
- entry .e -bd 1 -relief raised -width 0 -show .
- .e insert 0 12345
+} -cleanup {
+ destroy .e
+} -result {25 39}
+test entry-6.10 {EntryComputeGeometry procedure} -constraints {
+ unix fonts
+} -setup {
+ entry .e -highlightthickness 2 -font {Helvetica -12}
pack .e
+} -body {
+ .e configure -bd 1 -relief raised -width 0 -show .
+ .e insert 0 12345
update
set x [winfo reqwidth .e]
.e configure -show X
lappend x [winfo reqwidth .e]
.e configure -show ""
lappend x [winfo reqwidth .e]
-} {23 53 43}
-test entry-6.11 {EntryComputeGeometry procedure} win {
- catch {destroy .e}
- entry .e -bd 1 -relief raised -width 0 -show . -font {helvetica 12}
- .e insert 0 12345
+} -cleanup {
+ destroy .e
+} -result {23 53 43}
+test entry-6.11 {EntryComputeGeometry procedure} -constraints {
+ win
+} -setup {
+ entry .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -bd 1 -relief raised -width 0 -show . -font {helvetica 12}
+ .e insert 0 12345
update
- set x [winfo reqwidth .e]
+ set x1 [winfo reqwidth .e]
+ set x2 [expr {8+5*[font measure {helvetica 12} .]}]
+ set x [expr {$x1 eq $x2}]
.e configure -show X
- lappend x [winfo reqwidth .e]
+ set x1 [winfo reqwidth .e]
+ set x2 [expr {8+5*[font measure {helvetica 12} X]}]
+ lappend x [expr {$x1 eq $x2}]
.e configure -show ""
- lappend x [winfo reqwidth .e]
-} [list \
- [expr 8+5*[font measure {helvetica 12} .]] \
- [expr 8+5*[font measure {helvetica 12} X]] \
- [expr 8+[font measure {helvetica 12} 12345]]]
-
-catch {destroy .e}
-entry .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll
-pack .e
-focus .e
-test entry-7.1 {InsertChars procedure} {
- .e delete 0 end
+ set x1 [winfo reqwidth .e]
+ set x2 [expr {8+[font measure {helvetica 12} 12345]}]
+ lappend x [expr {$x1 eq $x2}]
+} -cleanup {
+ destroy .e
+} -result {1 1 1}
+
+
+test entry-7.1 {InsertChars procedure} -setup {
+ unset -nocomplain contents
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 2 XXX
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abXXXcde abXXXcde {0.000000 1.000000}}
-test entry-7.2 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abXXXcde abXXXcde {0.000000 1.000000}}
+
+test entry-7.2 {InsertChars procedure} -setup {
+ unset -nocomplain contents
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 500 XXX
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abcdeXXX abcdeXXX {0.000000 1.000000}}
-test entry-7.3 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
+test entry-7.3 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -806,9 +1934,13 @@ test entry-7.3 {InsertChars procedure} {
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 entry-7.4 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {5 9 5 8}
+test entry-7.4 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -816,9 +1948,13 @@ test entry-7.4 {InsertChars procedure} {
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 entry-7.5 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {2 9 2 8}
+test entry-7.5 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -826,9 +1962,13 @@ test entry-7.5 {InsertChars procedure} {
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 entry-7.6 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {2 9 2 8}
+test entry-7.6 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -836,70 +1976,118 @@ test entry-7.6 {InsertChars procedure} {
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 entry-7.7 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {2 6 2 5}
+test entry-7.7 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -xscrollcommand scroll
.e insert 0 0123456789
.e icursor 4
.e insert 4 XXX
.e index insert
-} {7}
-test entry-7.8 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {7}
+test entry-7.8 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e icursor 4
.e insert 5 XXX
.e index insert
-} {4}
-test entry-7.9 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-7.9 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 "This is a very long string"
update
.e xview 4
.e insert 3 XXX
.e index @0
-} {7}
-test entry-7.10 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {7}
+test entry-7.10 {InsertChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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 entry-7.11 {InsertChars procedure} {fonts} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+
+test entry-7.11 {InsertChars procedure} -constraints {
+ fonts
+} -setup {
+ entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 "xyzzy"
update
.e insert 2 00
winfo reqwidth .e
-} {59}
+} -cleanup {
+ destroy .e
+} -result {59}
-.e configure -width 10
-test entry-8.1 {DeleteChars procedure} {
- .e delete 0 end
+test entry-8.1 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 2 4
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abe abe {0.000000 1.000000}}
-test entry-8.2 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abe abe {0.000000 1.000000}}
+test entry-8.2 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete -2 2
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {cde cde {0.000000 1.000000}}
-test entry-8.3 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {cde cde {0.000000 1.000000}}
+test entry-8.3 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 3 1000
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abc abc {0.000000 1.000000}}
-test entry-8.4 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abc abc {0.000000 1.000000}}
+test entry-8.4 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -908,9 +2096,14 @@ test entry-8.4 {DeleteChars procedure} {
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 entry-8.5 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1 6 1 5}
+test entry-8.5 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -919,9 +2112,14 @@ test entry-8.5 {DeleteChars procedure} {
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 entry-8.6 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1 5 1 4}
+test entry-8.6 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -930,17 +2128,28 @@ test entry-8.6 {DeleteChars procedure} {
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 entry-8.7 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1 2 1 5}
+test entry-8.7 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.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 entry-8.8 {DeleteChars procedure} {
- .e delete 0 end
+ update
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test entry-8.8 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -949,17 +2158,27 @@ test entry-8.8 {DeleteChars procedure} {
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 entry-8.9 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {3 4 3 8}
+test entry-8.9 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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 entry-8.10 {DeleteChars procedure} {
- .e delete 0 end
+ update
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test entry-8.10 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 8
.e select to 3
@@ -968,9 +2187,14 @@ test entry-8.10 {DeleteChars procedure} {
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 entry-8.11 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {3 5 5 8}
+test entry-8.11 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 8
.e select to 3
@@ -979,124 +2203,186 @@ test entry-8.11 {DeleteChars procedure} {
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 entry-8.12 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {3 8 4 8}
+test entry-8.12 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 1 4
+ update
.e index insert
-} {1}
-test entry-8.13 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-8.13 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 1 5
+ update
.e index insert
-} {1}
-test entry-8.14 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-8.14 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 4 6
+ update
.e index insert
-} {4}
-test entry-8.15 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-8.15 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 1 4
+ update
.e index @0
-} {1}
-test entry-8.16 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-8.16 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 1 5
+ update
.e index @0
-} {1}
-test entry-8.17 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-8.17 {DeleteChars procedure} -setup {
+ entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 4 6
+ update
.e index @0
-} {4}
-.e configure -width 0
-test entry-8.18 {DeleteChars procedure} {fonts} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-8.18 {DeleteChars procedure} -setup {
+ entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "xyzzy"
update
.e delete 2 4
winfo reqwidth .e
-} {31}
+} -cleanup {
+ destroy .e
+} -result {31}
-test entry-9.1 {EntryValueChanged procedure} {
- catch {destroy .e}
- proc override args {
- global x
- set x 12345
- }
- catch {unset x}
+test entry-9.1 {EntryValueChanged procedure} -setup {
+ unset -nocomplain x
+} -body {
trace variable x w override
- entry .e -textvariable x
+ entry .e -textvariable x -width 0
.e insert 0 foo
- set result [list $x [.e get]]
- unset x; rename override {}
- set result
-} {12345 12345}
-
-catch {destroy .e}
-entry .e
-pack .e
-.e configure -width 0
-test entry-10.1 {EntrySetValue procedure} {fonts} {
+ list $x [.e get]
+} -cleanup {
+ destroy .e
+ trace vdelete x w override
+ unset x
+} -result {12345 12345}
+
+
+test entry-10.1 {EntrySetValue procedure} -constraints fonts -body {
set x abcde
set y ab
- .e configure -textvariable x
- update
+ entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0
+ pack .e
+ .e configure -textvariable x
.e configure -textvariable y
update
list [.e get] [winfo reqwidth .e]
-} {ab 24}
-test entry-10.2 {EntrySetValue procedure, updating selection} {
- catch {destroy .e}
- entry .e -textvariable x
+} -cleanup {
+ destroy .e
+} -result {ab 24}
+test entry-10.2 {EntrySetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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 entry-10.3 {EntrySetValue procedure, updating selection} {
- catch {destroy .e}
- entry .e -textvariable x
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test entry-10.3 {EntrySetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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 entry-10.4 {EntrySetValue procedure, updating selection} {
- catch {destroy .e}
- entry .e -textvariable x
+} -cleanup {
+ destroy .e
+} -result {4 7}
+test entry-10.4 {EntrySetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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 entry-10.5 {EntrySetValue procedure, updating display position} {
- catch {destroy .e}
- entry .e -width 10 -font $fixed -textvariable x
+} -cleanup {
+ destroy .e
+} -result {4 10}
+test entry-10.5 {EntrySetValue procedure, updating display position} -setup {
+ unset -nocomplain x
+ entry .e -highlightthickness 2 -bd 2
pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e xview 10
update
set x "abcdefg"
update
.e index @0
-} {0}
-test entry-10.6 {EntrySetValue procedure, updating display position} {
- catch {destroy .e}
- entry .e -width 10 -font $fixed -textvariable x
+} -cleanup {
+ destroy .e
+} -result {0}
+test entry-10.6 {EntrySetValue procedure, updating display position} -setup {
+ unset -nocomplain x
+ entry .e -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
pack .e
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e xview 10
@@ -1104,192 +2390,472 @@ test entry-10.6 {EntrySetValue procedure, updating display position} {
set x "1234567890123456789012"
update
.e index @0
-} {10}
-test entry-10.7 {EntrySetValue procedure, updating insertion cursor} {
- catch {destroy .e}
- entry .e -width 10 -font $fixed -textvariable x
+} -cleanup {
+ destroy .e
+} -result {10}
+test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup {
+ unset -nocomplain x
+ entry .e -highlightthickness 2 -bd 2
+ pack .e
+ update
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
pack .e
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e icursor 5
set x "123"
.e index insert
-} {3}
-test entry-10.8 {EntrySetValue procedure, updating insertion cursor} {
- catch {destroy .e}
- entry .e -width 10 -font $fixed -textvariable x
+} -cleanup {
+ destroy .e
+} -result {3}
+test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup {
+ unset -nocomplain x
+ entry .e -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
pack .e
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e icursor 5
set x "123456"
.e index insert
-} {5}
+} -cleanup {
+ destroy .e
+} -result {5}
-test entry-11.1 {EntryEventProc procedure} {
- catch {destroy .e}
- entry .e
+test entry-11.1 {EntryEventProc procedure} -setup {
+ entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
+ pack .e
+} -body {
.e insert 0 abcdefg
destroy .e
update
-} {}
-test entry-11.2 {EntryEventProc procedure} {
- deleteWindows
+} -cleanup {
+ destroy .e
+} -result {}
+test entry-11.2 {EntryEventProc procedure} -setup {
+ set x {}
+} -body {
entry .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 entry-12.1 {EntryCmdDeletedProc procedure} {
- deleteWindows
- button .e1 -text "xyz_123"
- rename .e1 {}
- list [info command .e*] [winfo children .]
-} {{} {}}
-
-catch {destroy .e}
-entry .e -font $fixed -width 5 -bd 2 -relief sunken
-pack .e
-.e insert 0 012345678901234567890
-.e xview 4
-update
-test entry-13.1 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e1
+} -result {.e1 #112233 {} {}}
+
+test entry-12.1 {EntryCmdDeletedProc procedure} -body {
+ button .b -text "xyz_123"
+ rename .b {}
+ list [info command .b*] [winfo children .]
+} -cleanup {
+ destroy .b
+} -result {{} {}}
+
+
+test entry-13.1 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index end
-} {21}
-test entry-13.2 {GetEntryIndex procedure} {
- list [catch {.e index abogus} msg] $msg
-} {1 {bad entry index "abogus"}}
-test entry-13.3 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {21}
+test entry-13.2 {GetEntryIndex procedure} -body {
+ entry .e
+ .e index abogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "abogus"}
+test entry-13.3 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 1
.e select to 6
.e index anchor
-} {1}
-test entry-13.4 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {1}
+test entry-13.4 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 4
.e select to 1
.e index anchor
-} {4}
-test entry-13.5 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-13.5 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 3
.e select to 15
.e select adjust 4
.e index anchor
-} {15}
-test entry-13.6 {GetEntryIndex procedure} {
- list [catch {.e index ebogus} msg] $msg
-} {1 {bad entry index "ebogus"}}
-test entry-13.7 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {15}
+test entry-13.6 {GetEntryIndex procedure} -setup {
+ entry .e
+} -body {
+ .e index ebogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "ebogus"}
+test entry-13.7 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e icursor 2
.e index insert
-} {2}
-test entry-13.8 {GetEntryIndex procedure} {
- list [catch {.e index ibogus} msg] $msg
-} {1 {bad entry index "ibogus"}}
-test entry-13.9 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {2}
+test entry-13.8 {GetEntryIndex procedure} -setup {
+ entry .e
+} -body {
+ .e index ibogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "ibogus"}
+test entry-13.9 {GetEntryIndex procedure} -setup {
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+} -cleanup {
+ destroy .e
+} -result {1 6}
+
+
+
+
+
+
+test entry-13.10 {GetEntryIndex procedure} -constraints unix -body {
+# On unix, when selection is cleared, entry widget's internal
+# selection range is reset.
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+
+test entry-13.11 {GetEntryIndex procedure} -constraints win -body {
+# On mac and pc, when selection is cleared, entry widget remembers
+# last selected range. When selection ownership is restored to
+# entry, the old range will be rehighlighted.
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ catch {selection get}
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -result {1}
+
+test entry-13.12 {GetEntryIndex procedure} -constraints unix -body {
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+
+# why when string in .e index changed to not beginning with s,
+# it behaves differently?
+test entry-13.12.1 {GetEntryIndex procedure} -constraints unix -body {
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index bogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "bogus"}
+
+test entry-13.13 {GetEntryIndex procedure} -constraints win -body {
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "sbogus"}
+
+test entry-13.14 {GetEntryIndex procedure} -constraints win -body {
+# On mac and pc, when selection is cleared, entry widget remembers
+# last selected range. When selection ownership is restored to
+# entry, the old range will be rehighlighted.
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -match glob -result {*}
+
+test entry-13.14.1 {GetEntryIndex procedure} -constraints win -body {
+# On mac and pc, when selection is cleared, entry widget remembers
+# last selected range. When selection ownership is restored to
+# entry, the old range will be rehighlighted.
+# Previous settings:
+ entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 1
.e select to 6
list [.e index sel.first] [.e index sel.last]
-} {1 6}
-selection clear .e
-test entry-13.10 {GetEntryIndex procedure} unix {
- # On unix, when selection is cleared, entry widget's internal
- # selection range is reset.
-
- list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in widget .e}}
-test entry-13.11 {GetEntryIndex procedure} win {
- # On mac and pc, when selection is cleared, entry widget remembers
- # last selected range. When selection ownership is restored to
- # entry, the old range will be rehighlighted.
-
- list [catch {selection get}] [.e index sel.first]
-} {1 1}
-test entry-13.12 {GetEntryIndex procedure} unix {
- list [catch {.e index sbogus} msg] $msg
-} {1 {selection isn't in widget .e}}
-test entry-13.13 {GetEntryIndex procedure} win {
- list [catch {.e index sbogus} msg] $msg
-} {1 {bad entry index "sbogus"}}
-test entry-13.14 {GetEntryIndex procedure} win {
- list [catch {selection get}] [catch {.e index sbogus}]
-} {1 1}
-test entry-13.15 {GetEntryIndex procedure} {
- list [catch {.e index @xyz} msg] $msg
-} {1 {bad entry index "@xyz"}}
-test entry-13.16 {GetEntryIndex procedure} {fonts} {
+# Testing:
+ selection clear .e
+ catch {selection get}
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -match glob -result {*}
+
+test entry-13.15 {GetEntryIndex procedure} -body {
+ entry .e
+ selection clear .e
+ .e index @xyz
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "@xyz"}
+
+test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @4
-} {4}
-test entry-13.17 {GetEntryIndex procedure} {fonts} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @11
-} {4}
-test entry-13.18 {GetEntryIndex procedure} {fonts} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @12
-} {5}
-test entry-13.19 {GetEntryIndex procedure} {fonts} {
- .e index @[expr [winfo width .e] - 6]
-} {8}
-test entry-13.20 {GetEntryIndex procedure} {fonts} {
- .e index @[expr [winfo width .e] - 5]
-} {9}
-test entry-13.21 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {5}
+test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e index @[expr {[winfo width .e] - 6}]
+} -cleanup {
+ destroy .e
+} -result {8}
+test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e index @[expr {[winfo width .e] - 5}]
+} -cleanup {
+ destroy .e
+} -result {9}
+test entry-13.21 {GetEntryIndex procedure} -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @1000
-} {9}
-test entry-13.22 {GetEntryIndex procedure} {
- list [catch {.e index 1xyz} msg] $msg
-} {1 {bad entry index "1xyz"}}
-test entry-13.23 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {9}
+test entry-13.22 {GetEntryIndex procedure} -setup {
+ entry .e
+ pack .e
+ update
+} -body {
+ .e index 1xyz
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad entry index "1xyz"}
+test entry-13.23 {GetEntryIndex procedure} -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index -10
-} {0}
-test entry-13.24 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {0}
+test entry-13.24 {GetEntryIndex procedure} -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index 12
-} {12}
-test entry-13.25 {GetEntryIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {12}
+test entry-13.25 {GetEntryIndex procedure} -body {
+ entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index 49
-} {21}
-test entry-13.26 {GetEntryIndex procedure} {fonts} {
- catch {destroy .e}
- entry .e -show .
+} -cleanup {
+ destroy .e
+} -result {21}
+test entry-13.26 {GetEntryIndex procedure} -constraints fonts -body {
+ entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
+ selection clear .e
+ .e configure -show .
.e insert 0 XXXYZZY
pack .e
update
list [.e index @7] [.e index @8]
-} {0 1}
+} -cleanup {
+ destroy .e
+} -result {0 1}
# XXX Still need to write tests for EntryScanTo and EntrySelectTo.
-set x {}
-for {set i 1} {$i <= 500} {incr i} {
- append x "This is line $i, out of 500\n"
-}
-test entry-14.1 {EntryFetchSelection procedure} {
- catch {destroy .e}
+
+test entry-14.1 {EntryFetchSelection procedure} -body {
entry .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 entry-14.2 {EntryFetchSelection procedure} {
- catch {destroy .e}
+} -cleanup {
+ destroy .e
+} -result {his is a test str}
+test entry-14.2 {EntryFetchSelection procedure} -body {
entry .e -show *
.e insert end "This is a test string"
.e select from 1
.e select to 18
selection get
-} {*****************}
-test entry-14.3 {EntryFetchSelection procedure} {
- catch {destroy .e}
+} -cleanup {
+ destroy .e
+} -result {*****************}
+test entry-14.3 {EntryFetchSelection procedure} -setup {
+ set x {}
+ for {set i 1} {$i <= 500} {incr i} {
+ append x "This is line $i, out of 500\n"
+}
+} -body {
entry .e
- .e insert end $x
+ .e insert end $x
.e select from 0
.e select to end
string compare [selection get] $x
-} 0
+} -cleanup {
+ destroy .e
+} -result {0}
-test entry-15.1 {EntryLostSelection} {
- catch {destroy .e}
+test entry-15.1 {EntryLostSelection} -body {
entry .e
.e insert 0 "Text"
.e select from 0
@@ -1299,334 +2865,617 @@ test entry-15.1 {EntryLostSelection} {
.e select from 0
.e select to 4
lappend result [selection get]
-} {Text Text}
-
-# No tests for EventuallyRedraw.
-
-catch {destroy .e}
-entry .e -width 10 -xscrollcommand scroll
-pack .e
-update
+} -cleanup {
+ destroy .e
+} -result {Text Text}
-test entry-16.1 {EntryVisibleRange procedure} {fonts} {
- .e delete 0 end
- .e insert 0 .............................
+# is scrollcommand needed here??
+test entry-16.1 {EntryVisibleRange procedure} -constraints fonts -body {
+ entry .e -width 10 -font {Helvetica -12}
+ pack .e
+ update
+ .e insert 0 "............................."
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 0.827586}
-test entry-16.2 {EntryVisibleRange procedure} {unix fonts} {
- .e configure -show X
- .e delete 0 end
- .e insert 0 .............................
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.827586}
+test entry-16.2 {EntryVisibleRange procedure} -constraints {
+ unix fonts
+} -body {
+ entry .e -show X -width 10 -font {Helvetica -12}
+ pack .e
+ update
+ .e insert 0 "............................."
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 0.275862}
-test entry-16.3 {EntryVisibleRange procedure} win {
- .e configure -show .
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.275862}
+test entry-16.3 {EntryVisibleRange procedure} -constraints {
+ win
+} -body {
+ entry .e -show . -width 10 -font {Helvetica -12}
+ pack .e
+ update
.e insert 0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 0.827586}
-.e configure -show ""
-test entry-16.4 {EntryVisibleRange procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.827586}
+test entry-16.4 {EntryVisibleRange procedure} -body {
+ entry .e -show ""
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 1.000000}
+} -cleanup {
+ destroy .e
+} -result {0.000000 1.000000}
+
-catch {destroy .e}
-entry .e -width 10 -xscrollcommand scroll -font $fixed
-pack .e
-update
-test entry-17.1 {EntryUpdateScrollbar procedure} {
+test entry-17.1 {EntryUpdateScrollbar procedure} -body {
+ entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e delete 0 end
.e insert 0 123
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.000000 1.000000}
-test entry-17.2 {EntryUpdateScrollbar procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.000000 1.000000}
+test entry-17.2 {EntryUpdateScrollbar procedure} -body {
+ entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e insert 0 0123456789abcdef
.e xview 3
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.187500 0.812500}
-test entry-17.3 {EntryUpdateScrollbar procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.187500 0.812500}
+test entry-17.3 {EntryUpdateScrollbar procedure} -body {
+ entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e insert 0 abcdefghijklmnopqrs
.e xview 6
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.315789 0.842105}
-test entry-17.4 {EntryUpdateScrollbar procedure} {
+} -cleanup {
destroy .e
+} -result {0.315789 0.842105}
+test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
proc bgerror msg {
global x
set x $msg
- }
+}
+} -body {
entry .e -width 5 -xscrollcommand thisisnotacommand
pack .e
update
- rename bgerror {}
list $x $errorInfo
-} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
+} -cleanup {
+ destroy .e
+ rename bgerror {}
+} -result {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
while executing
"thisisnotacommand 0.0 1.0"
(horizontal scrolling command executed by .e)}}
-set l [interp hidden]
-deleteWindows
-test entry-18.1 {Entry widget vs hiding} {
- destroy .e
+test entry-18.1 {Entry widget vs hiding} -setup {
entry .e
+} -body {
+ set l [interp hidden]
interp hide {} .e
destroy .e
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 == $res2}
+} -result {1}
##
## Entry widget VALIDATION tests
##
-
-destroy .e
-catch {unset ::e}
-catch {unset ::vVals}
-entry .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 entry-19.1 {entry widget validation} {
+
+# 19.* test cases in previous version highly depended on the previous
+# test cases. This was replaced by inserting recently set configurations
+# that matters for the test case
+test entry-19.1 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
.e insert 0 a
- set ::vVals
-} {.e 1 0 a {} a all key}
-test entry-19.2 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e 1 0 a {} a all key}
+
+test entry-19.2 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 a ;# previous settings
.e insert 1 b
- set ::vVals
-} {.e 1 1 ab a b all key}
-test entry-19.3 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e 1 1 ab a b all key}
+
+test entry-19.3 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 ab ;# previous settings
.e insert end c
- set ::vVals
-} {.e 1 2 abc ab c all key}
-test entry-19.4 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e 1 2 abc ab c all key}
+
+test entry-19.4 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 abc ;# previous settings
.e insert 1 123
list $::vVals $::e
-} {{.e 1 1 a123bc abc 123 all key} a123bc}
-test entry-19.5 {entry widget validation} {
+} -cleanup {
+ destroy .e
+} -result {{.e 1 1 a123bc abc 123 all key} a123bc}
+
+test entry-19.5 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 a123bc ;# previous settings
.e delete 2
- set ::vVals
-} {.e 0 2 a13bc a123bc 2 all key}
-test entry-19.6 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e 0 2 a13bc a123bc 2 all key}
+
+test entry-19.6 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 a13bc ;# previous settings
.e configure -validate key
.e delete 1 3
- set ::vVals
-} {.e 0 1 abc a13bc 13 key key}
-test entry-19.7 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e 0 1 abc a13bc 13 key key}
+
+test entry-19.7 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focus \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abc ;# previous settings
set ::vVals {}
- .e configure -validate focus
.e insert end d
- set ::vVals
-} {}
-test entry-19.8 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {}
+
+test entry-19.8 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e configure -validate focus ;# previous settings
+ .e insert end abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} focus focusin}
-test entry-19.9 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focus focusin}
+
+test entry-19.9 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focus \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ focus -force .e ;# previous settings
+ update ;# previous settings
+# update necessary to process FocusIn event
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} focus focusout}
-.e configure -validate all
-test entry-19.10 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focus focusout}
+
+test entry-19.10 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} all focusin}
-test entry-19.11 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} all focusin}
+
+test entry-19.11 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} all focusout}
-.e configure -validate focusin
-test entry-19.12 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} all focusout}
+
+test entry-19.12 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focusin \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} focusin focusin}
-test entry-19.13 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focusin focusin}
+
+test entry-19.13 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focusin \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
set ::vVals {}
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
update
- set ::vVals
-} {}
-.e configure -validate focuso
-test entry-19.14 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {}
+
+test entry-19.14 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
- set ::vVals
-} {}
-test entry-19.15 {entry widget validation} {
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {}
+
+test entry-19.15 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
+ update
+ return $::vVals
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focusout focusout}
+
+# the same as 19.16 but added [.e validate] to returned list
+test entry-19.16 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
+ focus -force .
+# update necessary to process FocusOut event
update
- set ::vVals
-} {.e -1 -1 abcd abcd {} focusout focusout}
-test entry-19.16 {entry widget validation} {
list [.e validate] $::vVals
-} {1 {.e -1 -1 abcd abcd {} all forced}}
-test entry-19.17 {entry widget validation} {
+} -cleanup {
+ destroy .e
+} -result {1 {.e -1 -1 abcd abcd {} all forced}}
+
+
+test entry-19.17 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
set ::e newdata
list [.e cget -validate] $::vVals
-} {focusout {.e -1 -1 newdata abcd {} focusout forced}}
+} -cleanup {
+ destroy .e
+} -result {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
-}
-test entry-19.18 {entry widget validation} {
+# proc doval changed - returns 0
+test entry-19.18 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ set ::e newdata ;# previous settings
.e configure -validate all
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
-}
+} -cleanup {
+ destroy .e
+} -result {none {.e -1 -1 nextdata newdata {} all forced}}
## 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
+# proc doval2 used
+test entry-19.19 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ set ::e nextdata ;# previous settings
+
+ .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V]
.e validate
list [.e cget -validate] [.e get] $::vVals
-} {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
+} -cleanup {
+ destroy .e
+} -result {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
## 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} {
+test entry-19.20 {entry widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ entry .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ set ::e nextdata ;# previous settings
+ .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev
+ .e validate ;# previous settings
+
.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}}
-
-destroy .e
-catch {unset ::e ::vVals}
-
+} -cleanup {
+ destroy .e
+} -result {all testdata mydata {.e -1 -1 testdata mydata {} all forced}}
##
## End validation tests
##
-test entry-20.1 {widget deletion while active} {
- destroy .e
+test entry-20.1 {widget deletion while active} -body {
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} {
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.2 {widget deletion while active} -body {
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} {
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.3 {widget deletion while active} -body {
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} {
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.4 {widget deletion while active} -body {
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} {
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.5 {widget deletion while active} -body {
entry .e -validatecommand { destroy .e ; return 0 }
.e validate
winfo exists .e
-} 0
-test entry-20.6 {widget deletion while active} {
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.6 {widget deletion while active} -body {
pack [entry .e]
update
.e config -xscrollcommand { destroy .e }
update idle
winfo exists .e
-} 0
-test entry-20.7 {widget deletion with textvariable active} {
- # SF bugs 607390 and 617446
+} -cleanup {
destroy .e
+} -result {0}
+
+test entry-20.7 {widget deletion with textvariable active} -body {
+# SF bugs 607390 and 617446
set FOO init
entry .e -textvariable FOO -validate all \
-vcmd {%W configure -bg white; format 1}
bind .e <Destroy> { set FOO hello }
destroy .e
winfo exists .e
-} 0
-
-test entry-21.1 {selection present while disabled, bug 637828} {
+} -cleanup {
destroy .e
+} -result {0}
+
+
+test entry-21.1 {selection present while disabled, bug 637828} -body {
entry .e
.e insert end 0123456789
.e select from 3
.e select to 6
set out [.e selection present]
.e configure -state disabled
- # still return 1 when disabled, because 'selection get' will work,
- # but selection cannot be changed (new behavior since 8.4)
+# still return 1 when disabled, because 'selection get' will work,
+# but selection cannot be changed (new behavior since 8.4)
.e select to 9
lappend out [.e selection present] [selection get]
-} {1 1 345}
-
-test entry-22.1 {lost namespaced textvar} {
+} -cleanup {
destroy .e
+} -result {1 1 345}
+
+test entry-22.1 {lost namespaced textvar} -body {
namespace eval test { variable foo {a b} }
entry .e -textvariable ::test::foo
namespace delete test
.e insert end "more stuff"
.e delete 5 end
- catch {set ::test::foo} result
- list [.e get] [.e cget -textvar] $result
-} [list "a bmo" ::test::foo \
- {can't read "::test::foo": no such variable}]
-
-destroy .e
+ set ::test::foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {can't read "::test::foo": no such variable}
+test entry-22.2 {lost namespaced textvar} -body {
+ namespace eval test { variable foo {a b} }
+ entry .e -textvariable ::test::foo
+ namespace delete test
+ .e insert end "more stuff"
+ .e delete 5 end
+ catch {set ::test::foo}
+ list [.e get] [.e cget -textvar]
+} -cleanup {
+ destroy .e
+} -result [list "a bmo" ::test::foo]
+# Gathered comments about lacks
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
# and EntryTextVarProc.
+# No tests for DisplayEntry.
+# XXX Still need to write tests for EntryScanTo and EntrySelectTo.
+# No tests for EventuallyRedraw
-option clear
-
+# option clear
# cleanup
cleanupTests
return
+
+
+
diff --git a/tests/event.test b/tests/event.test
index fa75610..1548467 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -6,9 +6,10 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
# 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
@@ -183,37 +184,49 @@ proc _get_selection {widget} {
# Begining of the actual tests
-test event-1.1 {Tk_HandleEvent procedure, filter events for dead windows} {
+test event-1.1 {Tk_HandleEvent procedure, filter events for dead windows} -setup {
+ deleteWindows
+ set x {}
+} -body {
button .b -text Test
pack .b
bindtags .b .b
update
bind .b <Destroy> {
- lappend x destroy
- event generate .b <1>
- event generate .b <ButtonRelease-1>
+ lappend x destroy
+ event generate .b <1>
+ event generate .b <ButtonRelease-1>
}
bind .b <1> {
- lappend x button
+ lappend x button
}
- set x {}
+
destroy .b
- set x
-} {destroy}
-test event-1.2 {event generate <Alt-z>} {
- catch {destroy .e}
- catch {unset ::event12result}
+ return $x
+} -cleanup {
+ deleteWindows
+} -result {destroy}
+test event-1.2 {event generate <Alt-z>} -setup {
+ deleteWindows
+ catch {unset ::event12result}
+} -body {
set ::event12result 0
pack [entry .e]
update
bind .e <Alt-z> {set ::event12result "1"}
- focus -force .e ; event generate .e <Alt-z>
+
+ focus -force .e
+ event generate .e <Alt-z>
destroy .e
set ::event12result
-} 1
+} -cleanup {
+ deleteWindows
+} -result 1
+
-test event-2.1(keypress) {type into entry widget and hit Return} {
- destroy .t
+test event-2.1(keypress) {type into entry widget and hit Return} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -222,9 +235,12 @@ test event-2.1(keypress) {type into entry widget and hit Return} {
tkwait visibility $e
_keypress_string $e HELLO\n
list [$e get] $return_binding
-} {HELLO 1}
-test event-2.2(keypress) {type into entry widget and then delete some text} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {HELLO 1}
+test event-2.2(keypress) {type into entry widget and then delete some text} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -233,10 +249,13 @@ test event-2.2(keypress) {type into entry widget and then delete some text} {
_keypress $e BackSpace
_keypress $e BackSpace
$e get
-} MEL
-test event-2.3(keypress) {type into entry widget, triple click,\
- hit Delete key, and then type some more} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {MEL}
+test event-2.3(keypress) {type into entry widget, triple click, hit Delete key,
+ and then type some more} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -256,9 +275,12 @@ test event-2.3(keypress) {type into entry widget, triple click,\
_keypress $e Delete
_keypress_string $e UP
lappend result [$e get]
-} {JUMP UP}
-test event-1.4(keypress) {type into text widget and hit Return} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {JUMP UP}
+test event-2.4(keypress) {type into text widget and hit Return} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -267,9 +289,12 @@ test event-1.4(keypress) {type into text widget and hit Return} {
tkwait visibility $e
_keypress_string $e HELLO\n
list [$e get 1.0 end] $return_binding
-} [list "HELLO\n\n" 1]
-test event-2.5(keypress) {type into text widget and then delete some text} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result [list "HELLO\n\n" 1]
+test event-2.5(keypress) {type into text widget and then delete some text} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -278,10 +303,13 @@ test event-2.5(keypress) {type into text widget and then delete some text} {
_keypress $e BackSpace
_keypress $e BackSpace
$e get 1.0 1.end
-} MEL
-test event-2.6(keypress) {type into text widget, triple click,\
- hit Delete key, and then type some more} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {MEL}
+test event-2.6(keypress) {type into text widget, triple click,
+ hit Delete key, and then type some more} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -301,11 +329,14 @@ test event-2.6(keypress) {type into text widget, triple click,\
_keypress $e Delete
_keypress_string $e UP
lappend result [$e get 1.0 1.end]
-} {JUMP UP}
-
-test event-3.1(click-drag) {click and drag in a text widget, this tests\
- tkTextSelectTo in text.tcl} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {JUMP UP}
+
+test event-3.1(click-drag) {click and drag in a text widget, this tests
+ tkTextSelectTo in text.tcl} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -366,10 +397,13 @@ test event-3.1(click-drag) {click and drag in a text widget, this tests\
# 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-3.2(click-drag) {click and drag in an entry widget, this\
- tests tkEntryMouseSelect in entry.tcl} {
- destroy .t
+} -cleanup {
+ deleteWindows
+} -result {{A Tcl/Tk selection test!} 1.6 1.18 {Tk selection} 1.2 {Tcl/Tk selection}}
+ test event-3.2(click-drag) {click and drag in an entry widget, this
+ tests tkEntryMouseSelect in entry.tcl} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -430,11 +464,15 @@ test event-3.2(click-drag) {click and drag in an entry widget, this\
# Save the highlighted text
lappend result [_get_selection $e]
-} {{A Tcl/Tk selection!} 6 18 {Tk selection} 2 {Tcl/Tk selection}}
+} -cleanup {
+ deleteWindows
+} -result {{A Tcl/Tk selection!} 6 18 {Tk selection} 2 {Tcl/Tk selection}}
-test event-4.1(double-click-drag) {click down, click up, click down again,\
- then drag in a text widget} {
- destroy .t
+
+test event-4.1(double-click-drag) {click down, click up, click down again,
+ then drag in a text widget} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -497,11 +535,14 @@ test event-4.1(double-click-drag) {click down, click up, click down again,\
# Insert cursor should be before the r in "Word"
lappend result [$e index insert]
- set result
-} {select 1.5 1.7 select 1.4 { select} {Word select} 1.2}
-test event-4.2(double-click-drag) {click down, click up, click down again,\
- then drag in an entry widget} {
- destroy .t
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {select 1.5 1.7 select 1.4 { select} {Word select} 1.2}
+test event-4.2(double-click-drag) {click down, click up, click down again,
+ then drag in an entry widget} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -564,12 +605,15 @@ test event-4.2(double-click-drag) {click down, click up, click down again,\
# 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}
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {select 11 7 select 4 { select} {Word select} 2}
-test event-5.1(triple-click-drag) {Triple click and drag across lines in\
- a text widget, this should extend the selection to the new line} {
- destroy .t
+test event-5.1(triple-click-drag) {Triple click and drag across lines in a
+ text widget, this should extend the selection to the new line} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -620,16 +664,18 @@ test event-5.1(triple-click-drag) {Triple click and drag across lines in\
lappend result [_get_selection $e]
- set result
-
-} [list "LINE THREE\n" "LINE TWO\nLINE THREE\n" \
+ return $result
+} -cleanup {
+ deleteWindows
+} -result [list "LINE THREE\n" "LINE TWO\nLINE THREE\n" \
"LINE ONE\nLINE TWO\nLINE THREE\n"]
-test event-6.1(button-state) {button press in a window that is then\
- destroyed, when the mouse is moved into another window it\
- should not generate a <B1-motion> event since the mouse\
- was not pressed down in that window} {
- destroy .t
+test event-6.1(button-state) {button press in a window that is then
+ destroyed, when the mouse is moved into another window it
+ should not generate a <B1-motion> event since the mouse
+ was not pressed down in that window} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
event generate $t <ButtonPress-1>
@@ -638,12 +684,15 @@ test event-6.1(button-state) {button press in a window that is then\
set motion nomotion
bind $t <B1-Motion> {set motion inmotion}
event generate $t <Motion>
- set motion
-} nomotion
+ return $motion
+} -cleanup {
+ deleteWindows
+} -result {nomotion}
test event-7.1(double-click) {A double click on a lone character
- in a text widget should select that character} {
- destroy .t
+ in a text widget should select that character} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [text $t.e]
pack $e
@@ -702,11 +751,16 @@ test event-7.1(double-click) {A double click on a lone character
lappend result [$e index insert]
lappend result [_get_selection $e]
- set result
-} {1.3 A 1.3 A}
-test event-7.2(double-click) {A double click on a lone character\
- in an entry widget should select that character} {knownBug} {
- destroy .t
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {1.3 A 1.3 A}
+test event-7.2(double-click) {A double click on a lone character
+ in an entry widget should select that character} -constraints {
+ knownBug
+} -setup {
+ deleteWindows
+} -body {
set t [toplevel .t]
set e [entry $t.e]
pack $e
@@ -765,13 +819,12 @@ test event-7.2(double-click) {A double click on a lone character\
lappend result [$e index insert]
lappend result [_get_selection $e]
- set result
-} {3 A 4 A}
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {3 A 4 A}
# cleanup
-
-destroy .t
-
unset -nocomplain keypress_lookup
rename _init_keypress_lookup {}
rename _keypress_lookup {}
@@ -782,3 +835,5 @@ rename _get_selection {}
cleanupTests
return
+
+
diff --git a/tests/focus.test b/tests/focus.test
index 5cc3abe..45cf73b 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -6,26 +6,24 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
-
-button .b -text .b -relief raised -bd 2
-pack .b
+namespace import -force tcltest::test
proc focusSetup {} {
- catch {destroy .t}
+ destroy .t
toplevel .t
wm geom .t +0+0
foreach i {b1 b2 b3 b4} {
- button .t.$i -text .t.$i -relief raised -bd 2
- pack .t.$i
+ button .t.$i -text .t.$i -relief raised -bd 2
+ pack .t.$i
}
tkwait visibility .t.b4
}
proc focusSetupAlt {} {
global env
- catch {destroy .alt}
+ destroy .alt
toplevel .alt -screen $env(TK_ALT_DISPLAY)
foreach i {a b c d} {
button .alt.$i -text .alt.$i -relief raised -bd 2
@@ -34,8 +32,6 @@ proc focusSetupAlt {} {
tkwait visibility .alt.d
}
-# Make sure the window manager knows who has focus
-catch {fixfocus}
# The following procedure ensures that there is no input focus
# in this application. It does it by arranging for another
@@ -43,7 +39,6 @@ catch {fixfocus}
# is needed to wait long enough for pending actions to get through
# the X server and possibly also the window manager.
-setupbg
proc focusClear {} {
global x;
after 200 {set x 1}
@@ -52,12 +47,17 @@ proc focusClear {} {
update
}
-focusSetup
-if {[testConstraint altDisplay]} {
- focusSetupAlt
-}
-update
+# Button used in some tests in the whole test file
+button .b -text .b -relief raised -bd 2
+pack .b
+
+# Make sure the window manager knows who has focus
+catch {fixfocus}
+
+# cleanupbg will be after 4.3 test
+setupbg
+update
bind all <FocusIn> {
append focusInfo "in %W %d\n"
}
@@ -67,36 +67,48 @@ bind all <FocusOut> {
bind all <KeyPress> {
append focusInfo "press %W %K"
}
+focusSetup
+if {[testConstraint altDisplay]} {
+ focusSetupAlt
+}
-test focus-1.1 {Tk_FocusCmd procedure} unix {
+
+test focus-1.1 {Tk_FocusCmd procedure} -constraints unix -body {
focusClear
focus
-} {}
-test focus-1.2 {Tk_FocusCmd procedure} {unix altDisplay} {
+} -result {}
+test focus-1.2 {Tk_FocusCmd procedure} -constraints {
+ unix altDisplay
+} -body {
focus .alt.b
focus
-} {}
-test focus-1.3 {Tk_FocusCmd procedure} unix {
+} -result {}
+test focus-1.3 {Tk_FocusCmd procedure} -constraints unix -body {
focusClear
focus .t.b3
focus
-} {}
-test focus-1.4 {Tk_FocusCmd procedure} unix {
- list [catch {focus ""} msg] $msg
-} {0 {}}
-test focus-1.5 {Tk_FocusCmd procedure} unix {
+} -result {}
+test focus-1.4 {Tk_FocusCmd procedure} -constraints unix -body {
+ focus ""
+} -returnCodes ok -result {}
+test focus-1.5 {Tk_FocusCmd procedure} -constraints unix -body {
focusClear
focus -force .t
focus .t.b3
focus
-} {.t.b3}
-test focus-1.6 {Tk_FocusCmd procedure} unix {
- list [catch {focus .gorp} msg] $msg
-} {1 {bad window path name ".gorp"}}
-test focus-1.7 {Tk_FocusCmd procedure} unix {
- list [catch {focus .gorp a} msg] $msg
-} {1 {bad option ".gorp": must be -displayof, -force, or -lastfor}}
-test focus-1.8 {Tk_FocusCmd procedure, focussing on dead window} unix {
+} -result {.t.b3}
+test focus-1.6 {Tk_FocusCmd procedure} -constraints unix -body {
+ focus .gorp
+} -returnCodes error -result {bad window path name ".gorp"}
+test focus-1.7 {Tk_FocusCmd procedure} -constraints unix -body {
+ focus .gorp a
+} -returnCodes error -result {bad option ".gorp": must be -displayof, -force, or -lastfor}
+test focus-1.8 {Tk_FocusCmd procedure, focussing on dead window} -constraints {
+ unix
+} -setup {
+ destroy .t2
+} -body {
+ focusClear
toplevel .t2
wm geom .t2 +10+10
frame .t2.f -width 200 -height 100 -bd 2 -relief raised
@@ -113,109 +125,146 @@ test focus-1.8 {Tk_FocusCmd procedure, focussing on dead window} unix {
destroy .t2.f
lappend x [focus]
destroy .t2
- set x
-} {.t2.f2 .t2 .t2}
-test focus-1.9 {Tk_FocusCmd procedure, -displayof option} unix {
- list [catch {focus -displayof} msg] $msg
-} {1 {wrong # args: should be "focus -displayof window"}}
-test focus-1.10 {Tk_FocusCmd procedure, -displayof option} unix {
- list [catch {focus -displayof a b} msg] $msg
-} {1 {wrong # args: should be "focus -displayof window"}}
-test focus-1.11 {Tk_FocusCmd procedure, -displayof option} unix {
- list [catch {focus -displayof .lousy} msg] $msg
-} {1 {bad window path name ".lousy"}}
-test focus-1.12 {Tk_FocusCmd procedure, -displayof option} unix {
+ return $x
+} -cleanup {
+ destroy .t2
+} -result {.t2.f2 .t2 .t2}
+test focus-1.9 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix
+} -body {
+ focus -displayof
+} -returnCodes error -result {wrong # args: should be "focus -displayof window"}
+test focus-1.10 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix
+} -body {
+ focus -displayof a b
+} -returnCodes error -result {wrong # args: should be "focus -displayof window"}
+test focus-1.11 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix
+} -body {
+ focus -displayof .lousy
+} -returnCodes error -result {bad window path name ".lousy"}
+test focus-1.12 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix
+} -body {
focusClear
focus .t
focus -displayof .t.b3
-} {}
-test focus-1.13 {Tk_FocusCmd procedure, -displayof option} unix {
+} -result {}
+test focus-1.13 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix
+} -body {
focusClear
focus -force .t
focus -displayof .t.b3
-} {.t}
-test focus-1.14 {Tk_FocusCmd procedure, -displayof option} {unix altDisplay} {
+} -result {.t}
+test focus-1.14 {Tk_FocusCmd procedure, -displayof option} -constraints {
+ unix altDisplay
+} -body {
+ focusClear
focus -force .alt.c
focus -displayof .alt
-} {.alt.c}
-test focus-1.15 {Tk_FocusCmd procedure, -force option} unix {
- list [catch {focus -force} msg] $msg
-} {1 {wrong # args: should be "focus -force window"}}
-test focus-1.16 {Tk_FocusCmd procedure, -force option} unix {
- list [catch {focus -force a b} msg] $msg
-} {1 {wrong # args: should be "focus -force window"}}
-test focus-1.17 {Tk_FocusCmd procedure, -force option} unix {
- list [catch {focus -force foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test focus-1.18 {Tk_FocusCmd procedure, -force option} unix {
- list [catch {focus -force ""} msg] $msg
-} {0 {}}
-test focus-1.19 {Tk_FocusCmd procedure, -force option} unix {
+} -result {.alt.c}
+test focus-1.15 {Tk_FocusCmd procedure, -force option} -constraints unix -body {
+ focus -force
+} -returnCodes error -result {wrong # args: should be "focus -force window"}
+test focus-1.16 {Tk_FocusCmd procedure, -force option} -constraints unix -body {
+ focus -force a b
+} -returnCodes error -result {wrong # args: should be "focus -force window"}
+test focus-1.17 {Tk_FocusCmd procedure, -force option} -constraints unix -body {
+ focus -force foo
+} -returnCodes error -result {bad window path name "foo"}
+test focus-1.18 {Tk_FocusCmd procedure, -force option} -constraints unix -body {
+ focus -force ""
+} -returnCodes ok -result {}
+test focus-1.19 {Tk_FocusCmd procedure, -force option} -constraints unix -body {
focusClear
focus .t.b1
set x [list [focus]]
focus -force .t.b1
lappend x [focus]
-} {{} .t.b1}
-test focus-1.20 {Tk_FocusCmd procedure, -lastfor option} unix {
- list [catch {focus -lastfor} msg] $msg
-} {1 {wrong # args: should be "focus -lastfor window"}}
-test focus-1.21 {Tk_FocusCmd procedure, -lastfor option} unix {
- list [catch {focus -lastfor 1 2} msg] $msg
-} {1 {wrong # args: should be "focus -lastfor window"}}
-test focus-1.22 {Tk_FocusCmd procedure, -lastfor option} unix {
- list [catch {focus -lastfor who_knows?} msg] $msg
-} {1 {bad window path name "who_knows?"}}
-test focus-1.23 {Tk_FocusCmd procedure, -lastfor option} unix {
+} -result {{} .t.b1}
+test focus-1.20 {Tk_FocusCmd procedure, -lastfor option} -constraints {
+ unix
+} -body {
+ focus -lastfor
+} -returnCodes error -result {wrong # args: should be "focus -lastfor window"}
+test focus-1.21 {Tk_FocusCmd procedure, -lastfor option} -constraints {
+ unix
+} -body {
+ focus -lastfor 1 2
+} -returnCodes error -result {wrong # args: should be "focus -lastfor window"}
+test focus-1.22 {Tk_FocusCmd procedure, -lastfor option} -constraints {
+ unix
+} -body {
+ focus -lastfor who_knows?
+} -returnCodes error -result {bad window path name "who_knows?"}
+test focus-1.23 {Tk_FocusCmd procedure, -lastfor option} -constraints {
+ unix
+} -body {
+ focusClear
+ focusSetup
focus .b
focus .t.b1
list [focus -lastfor .] [focus -lastfor .t.b3]
-} {.b .t.b1}
-test focus-1.24 {Tk_FocusCmd procedure, -lastfor option} unix {
- destroy .t
+} -result {.b .t.b1}
+test focus-1.24 {Tk_FocusCmd procedure, -lastfor option} -constraints {
+ unix
+} -body {
+ focusClear
focusSetup
update
focus -lastfor .t.b2
-} {.t}
-test focus-1.25 {Tk_FocusCmd procedure} unix {
- list [catch {focus -unknown} msg] $msg
-} {1 {bad option "-unknown": must be -displayof, -force, or -lastfor}}
+} -result {.t}
+test focus-1.25 {Tk_FocusCmd procedure} -constraints unix -body {
+ focus -unknown
+} -returnCodes error -result {bad option "-unknown": must be -displayof, -force, or -lastfor}
+
-test focus-2.1 {TkFocusFilterEvent procedure} {unix nonPortable testwrapper} {
+focusSetup
+test focus-2.1 {TkFocusFilterEvent procedure} -constraints {
+ unix nonPortable testwrapper
+} -body {
+ focusClear
focus -force .b
- destroy .t
focusSetup
update
set focusInfo {}
event gen [testwrapper .t] <FocusIn> -detail NotifyAncestor \
-sendevent 0x54217567
- list $focusInfo
-} {{}}
-test focus-2.2 {TkFocusFilterEvent procedure} {unix nonPortable testwrapper} {
+ return $focusInfo
+} -result {}
+test focus-2.2 {TkFocusFilterEvent procedure} -constraints {
+ unix nonPortable testwrapper
+} -body {
+ focusClear
focus -force .b
- destroy .t
focusSetup
update
set focusInfo {}
event gen .t <FocusIn> -detail NotifyAncestor -sendevent 0x547321ac
list $focusInfo [focus]
-} {{in .t NotifyAncestor
+} -result {{in .t NotifyAncestor
} .b}
-test focus-2.3 {TkFocusFilterEvent procedure} {unix nonPortable testwrapper} {
+test focus-2.3 {TkFocusFilterEvent procedure} -constraints {
+ unix nonPortable testwrapper
+} -body {
+ focusClear
focus -force .b
- destroy .t
focusSetup
update
set focusInfo {}
event gen [testwrapper .t] <FocusIn> -detail NotifyAncestor
update
list $focusInfo [focus -lastfor .t]
-} {{out .b NotifyNonlinear
+} -result {{out .b NotifyNonlinear
out . NotifyNonlinearVirtual
in .t NotifyNonlinear
} .t}
-test focus-2.4 {TkFocusFilterEvent procedure, FocusIn events} \
- {unix nonPortable testwrapper} {
+test focus-2.4 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
+ unix nonPortable testwrapper
+} -body {
+ focusClear
set result {}
focus .t.b1
# Important to end with NotifyAncestor, which is an
@@ -231,8 +280,8 @@ test focus-2.4 {TkFocusFilterEvent procedure, FocusIn events} \
update
lappend result $focusInfo
}
- set result
-} {{out . NotifyNonlinear
+ return $result
+} -result {{out . NotifyNonlinear
in .t NotifyNonlinearVirtual
in .t.b1 NotifyNonlinear
} {out . NotifyNonlinear
@@ -245,19 +294,22 @@ in .t.b1 NotifyNonlinear
in .t NotifyNonlinearVirtual
in .t.b1 NotifyNonlinear
}}
-test focus-2.5 {TkFocusFilterEvent procedure, creating FocusInfo struct} \
- {unix nonPortable testwrapper} {
+test focus-2.5 {TkFocusFilterEvent procedure, creating FocusInfo struct} -constraints {
+ unix nonPortable testwrapper
+} -body {
focusSetup
focus .t.b1
update
event gen [testwrapper .t] <FocusIn> -detail NotifyAncestor
list $focusInfo [focus]
-} {{out . NotifyNonlinear
+} -result {{out . NotifyNonlinear
in .t NotifyNonlinearVirtual
in .t.b1 NotifyNonlinear
} .t.b1}
-test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} \
- {unix testwrapper} {
+
+test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
+ unix testwrapper
+} -body {
focus .t.b1
focus .
update
@@ -266,117 +318,131 @@ test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} \
set x [focus]
event gen . <KeyPress-x>
list $x $focusInfo
-} {.t.b1 {press .t.b1 x}}
-test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} \
- {unix testwrapper} {
+} -result {.t.b1 {press .t.b1 x}}
+test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
+ unix testwrapper
+} -body {
set result {}
foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear
NotifyNonlinearVirtual NotifyPointer NotifyPointerRoot
NotifyVirtual} {
- focus -force .t.b1
- event gen [testwrapper .t] <FocusOut> -detail $detail
- update
- lappend result [focus]
+ focus -force .t.b1
+ event gen [testwrapper .t] <FocusOut> -detail $detail
+ update
+ lappend result [focus]
}
- set result
-} {{} .t.b1 {} {} .t.b1 .t.b1 {}}
-test focus-2.8 {TkFocusFilterEvent procedure, FocusOut events} \
- {unix testwrapper} {
+ return $result
+} -result {{} .t.b1 {} {} .t.b1 .t.b1 {}}
+test focus-2.8 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
+ unix testwrapper
+} -body {
focus -force .t.b1
event gen .t.b1 <FocusOut> -detail NotifyAncestor
focus
-} {.t.b1}
-test focus-2.9 {TkFocusFilterEvent procedure, FocusOut events} \
- {unix testwrapper} {
+} -result {.t.b1}
+test focus-2.9 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
+ unix testwrapper
+} -body {
focus .t.b1
event gen [testwrapper .] <FocusOut> -detail NotifyAncestor
focus
-} {}
-test focus-2.10 {TkFocusFilterEvent procedure, Enter events} \
- {unix testwrapper} {
+} -result {}
+test focus-2.10 {TkFocusFilterEvent procedure, Enter events} -constraints {
+ unix testwrapper
+} -body {
set result {}
focus .t.b1
focusClear
foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear
- NotifyNonlinearVirtual NotifyVirtual} {
- event gen [testwrapper .t] <Enter> -detail $detail -focus 1
- update
- lappend result [focus]
- event gen [testwrapper .t] <Leave> -detail NotifyAncestor
- update
+ NotifyNonlinearVirtual NotifyVirtual} {
+ event gen [testwrapper .t] <Enter> -detail $detail -focus 1
+ update
+ lappend result [focus]
+ event gen [testwrapper .t] <Leave> -detail NotifyAncestor
+ update
}
- set result
-} {.t.b1 {} .t.b1 .t.b1 .t.b1}
-test focus-2.11 {TkFocusFilterEvent procedure, Enter events} \
- {unix testwrapper} {
+ return $result
+} -result {.t.b1 {} .t.b1 .t.b1 .t.b1}
+test focus-2.11 {TkFocusFilterEvent procedure, Enter events} -constraints {
+ unix testwrapper
+} -body {
focusClear
set focusInfo {}
event gen [testwrapper .t] <Enter> -detail NotifyAncestor
update
- set focusInfo
-} {}
-test focus-2.12 {TkFocusFilterEvent procedure, Enter events} \
- {unix testwrapper} {
+ return $focusInfo
+} -result {}
+test focus-2.12 {TkFocusFilterEvent procedure, Enter events} -constraints {
+ unix testwrapper
+} -body {
focus -force .b
update
set focusInfo {}
event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
update
- set focusInfo
-} {}
-test focus-2.13 {TkFocusFilterEvent procedure, Enter events} \
- {unix testwrapper} {
+ return $focusInfo
+} -result {}
+test focus-2.13 {TkFocusFilterEvent procedure, Enter events} -constraints {
+ unix testwrapper
+} -body {
focus .t.b1
focusClear
event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
set focusInfo {}
update
- set focusInfo
-} {in .t NotifyVirtual
+ return $focusInfo
+} -result {in .t NotifyVirtual
in .t.b1 NotifyAncestor
}
-test focus-2.14 {TkFocusFilterEvent procedure, Enter events, ignore errors when setting focus due to implicit focus} {unix testwrapper} {
+test focus-2.14 {TkFocusFilterEvent procedure, Enter events, ignore errors when setting focus due to implicit focus} -constraints {
+ unix testwrapper
+} -setup {
+ destroy .t2
+ set focusInfo {}
+} -body {
focusClear
- catch {destroy .t2}
toplevel .t2
wm withdraw .t2
update
- set focusInfo {}
event gen [testwrapper .t2] <Enter> -detail NotifyAncestor -focus 1
update
+} -cleanup {
destroy .t2
-} {}
-test focus-2.15 {TkFocusFilterEvent procedure, Leave events} \
- {unix testwrapper} {
+} -result {}
+test focus-2.15 {TkFocusFilterEvent procedure, Leave events} -constraints {
+ unix testwrapper
+} -body {
set result {}
focus .t.b1
foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear
NotifyNonlinearVirtual NotifyVirtual} {
- focusClear
- event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
- update
- event gen [testwrapper .t] <Leave> -detail $detail
- update
- lappend result [focus]
+ focusClear
+ event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
+ update
+ event gen [testwrapper .t] <Leave> -detail $detail
+ update
+ lappend result [focus]
}
- set result
-} {{} .t.b1 {} {} {}}
-test focus-2.16 {TkFocusFilterEvent procedure, Leave events} \
- {unix testwrapper} {
- set result {}
+ return $result
+} -result {{} .t.b1 {} {} {}}
+test focus-2.16 {TkFocusFilterEvent procedure, Leave events} -constraints {
+ unix testwrapper
+} -body {
+ focusClear
focus .t.b1
event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
update
set focusInfo {}
event gen [testwrapper .t] <Leave> -detail NotifyAncestor
update
- set focusInfo
-} {out .t.b1 NotifyAncestor
+ return $focusInfo
+} -result {out .t.b1 NotifyAncestor
out .t NotifyVirtual
}
-test focus-2.17 {TkFocusFilterEvent procedure, Leave events} \
- {unix testwrapper} {
- set result {}
+test focus-2.17 {TkFocusFilterEvent procedure, Leave events} -constraints {
+ unix testwrapper
+} -body {
+ focusClear
focus .t.b1
event gen [testwrapper .t] <Enter> -detail NotifyAncestor -focus 1
update
@@ -385,41 +451,49 @@ test focus-2.17 {TkFocusFilterEvent procedure, Leave events} \
event gen [testwrapper .] <Leave> -detail NotifyAncestor
update
list $focusInfo [focus]
-} {{out .t.b1 NotifyAncestor
+} -result {{out .t.b1 NotifyAncestor
out .t NotifyVirtual
} {}}
-test focus-3.1 {SetFocus procedure, create record on focus} \
- {unix testwrapper} {
+
+test focus-3.1 {SetFocus procedure, create record on focus} -constraints {
+ unix testwrapper
+} -body {
toplevel .t2 -width 250 -height 100
wm geometry .t2 +0+0
update
focus -force .t2
update
focus
-} {.t2}
-catch {destroy .t2}
+} -cleanup {
+ destroy .t2
+} -result {.t2}
# This test produces no result, but it will generate a protocol
# error if Tk forgets to make the window exist before focussing
# on it.
-test focus-3.2 {SetFocus procedure, making window exist} {unix testwrapper} {
+test focus-3.2 {SetFocus procedure, making window exist} -constraints {
+ unix testwrapper
+} -body {
update
button .b2 -text "Another button"
focus .b2
update
-} {}
-catch {destroy .b2}
-update
+} -cleanup {
+ destroy .b2
+ update
+} -result {}
# The following test doesn't produce a check-able result, but if
# there are bugs it may generate an X protocol error.
-test focus-3.3 {SetFocus procedure, delaying claim of X focus} \
- {unix testwrapper} {
+test focus-3.3 {SetFocus procedure, delaying claim of X focus} -constraints {
+ unix testwrapper
+} -body {
focusSetup
focus -force .t.b2
update
-} {}
-test focus-3.4 {SetFocus procedure, delaying claim of X focus} \
- {unix testwrapper} {
+} -result {}
+test focus-3.4 {SetFocus procedure, delaying claim of X focus} -constraints {
+ unix testwrapper
+} -body {
focusSetup
wm withdraw .t
focus -force .t.b2
@@ -430,52 +504,62 @@ test focus-3.4 {SetFocus procedure, delaying claim of X focus} \
update
wm deiconify .t2
wm deiconify .t
-} {}
-catch {destroy .t2}
-test focus-3.5 {SetFocus procedure, generating events} {unix testwrapper} {
+} -cleanup {
+ destroy .t2
+} -result {}
+test focus-3.5 {SetFocus procedure, generating events} -constraints {
+ unix testwrapper
+} -body {
focusSetup
focusClear
set focusInfo {}
focus -force .t.b2
update
- set focusInfo
-} {in .t NotifyVirtual
+ return $focusInfo
+} -result {in .t NotifyVirtual
in .t.b2 NotifyAncestor
}
-test focus-3.6 {SetFocus procedure, generating events} {unix testwrapper} {
+test focus-3.6 {SetFocus procedure, generating events} -constraints {
+ unix testwrapper
+} -body {
focusSetup
focus -force .b
update
set focusInfo {}
focus .t.b2
update
- set focusInfo
-} {out .b NotifyNonlinear
+ return $focusInfo
+} -result {out .b NotifyNonlinear
out . NotifyNonlinearVirtual
in .t NotifyNonlinearVirtual
in .t.b2 NotifyNonlinear
}
-test focus-3.7 {SetFocus procedure, generating events} \
- {unix nonPortable testwrapper} {
+test focus-3.7 {SetFocus procedure, generating events} -constraints {
+unix nonPortable testwrapper
+} -body {
# Non-portable because some platforms generate extra events.
-
focusSetup
focusClear
set focusInfo {}
focus .t.b2
update
- set focusInfo
-} {}
+ return $focusInfo
+} -result {}
+
-test focus-4.1 {TkFocusDeadWindow procedure} {unix testwrapper} {
+test focus-4.1 {TkFocusDeadWindow procedure} -constraints {
+ unix testwrapper
+} -body {
focusSetup
update
focus -force .b
update
destroy .t
focus
-} {.b}
-test focus-4.2 {TkFocusDeadWindow procedure} {unix testwrapper} {
+} -result {.b}
+test focus-4.2 {TkFocusDeadWindow procedure} -constraints {
+ unix testwrapper
+} -body {
focusSetup
update
focus -force .t.b2
@@ -484,12 +568,12 @@ test focus-4.2 {TkFocusDeadWindow procedure} {unix testwrapper} {
destroy .t.b2
update
focus
-} {.b}
-
+} -result {.b}
# Non-portable due to wm-specific redirection of input focus when
# windows are deleted:
-
-test focus-4.3 {TkFocusDeadWindow procedure} {unix nonPortable testwrapper} {
+test focus-4.3 {TkFocusDeadWindow procedure} -constraints {
+ unix nonPortable testwrapper
+} -body {
focusSetup
update
focus .t
@@ -497,21 +581,27 @@ test focus-4.3 {TkFocusDeadWindow procedure} {unix nonPortable testwrapper} {
destroy .t
update
focus
-} {}
-test focus-4.4 {TkFocusDeadWindow procedure} {unix testwrapper} {
+} -result {}
+test focus-4.4 {TkFocusDeadWindow procedure} -constraints {
+ unix testwrapper
+} -body {
focusSetup
focus -force .t.b2
update
destroy .t.b2
focus
-} {.t}
+} -result {.t}
+cleanupbg
+
# 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.
-setupbg
-test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} \
- {unix testwrapper secureserver} {
+# Test 5.1 fails (before and after update)
+test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} -constraints {
+ unix testwrapper secureserver
+} -body {
+ setupbg
focusSetup
focus -force .t
update
@@ -521,19 +611,21 @@ test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} \
focus .t.b2
update
lappend result [focus]
-} {.t {} {}}
-
-catch {destroy .t}
+} -cleanup {
+ cleanupbg
+} -result {.t {} {}}
+destroy .t
bind all <FocusIn> {}
bind all <FocusOut> {}
bind all <KeyPress> {}
-cleanupbg
-fixfocus
-test focus-6.1 {miscellaneous - embedded application in same process} \
- {unix testwrapper} {
+
+fixfocus
+test focus-6.1 {miscellaneous - embedded application in same process} -constraints {
+ unix testwrapper
+} -setup {
eval interp delete [interp slaves]
- catch {destroy .t}
+} -body {
toplevel .t
wm geometry .t +0+0
frame .t.f1 -container 1
@@ -547,11 +639,11 @@ test focus-6.1 {miscellaneous - embedded application in same process} \
child eval "set argv {-use [winfo id .t.f1]}"
load {} Tk child
child eval {
- entry .e1 -bg lightBlue
- pack .e1
- bind all <FocusIn> {lappend x "focus in %W %d"}
- bind all <FocusOut> {lappend x "focus out %W %d"}
- set x {}
+ entry .e1 -bg lightBlue
+ pack .e1
+ bind all <FocusIn> {lappend x "focus in %W %d"}
+ bind all <FocusOut> {lappend x "focus out %W %d"}
+ set x {}
}
# Claim the focus and wait long enough for it to really arrive.
@@ -577,13 +669,17 @@ test focus-6.1 {miscellaneous - embedded application in same process} \
after 300 {set timer 1}
vwait timer
set result [list $x [child eval {set x}]]
+ return $result
+} -cleanup {
interp delete child
- 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}}}
-test focus-6.2 {miscellaneous - embedded application in different process} \
- {unix testwrapper} {
- eval interp delete [interp slaves]
- catch {destroy .t}
+ destroy .t
+ bind all <FocusIn> {}
+ bind all <FocusOut> {}
+} -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}}}
+
+test focus-6.2 {miscellaneous - embedded application in different process} -constraints {
+ unix testwrapper
+} -body {
setupbg
toplevel .t
wm geometry .t +0+0
@@ -596,11 +692,11 @@ test focus-6.2 {miscellaneous - embedded application in different process} \
bind all <FocusOut> {lappend x "focus out %W %d"}
setupbg -use [winfo id .t.f1]
dobg {
- entry .e1 -bg lightBlue
- pack .e1
- bind all <FocusIn> {lappend x "focus in %W %d"}
- bind all <FocusOut> {lappend x "focus out %W %d"}
- set x {}
+ entry .e1 -bg lightBlue
+ pack .e1
+ bind all <FocusIn> {lappend x "focus in %W %d"}
+ bind all <FocusOut> {lappend x "focus out %W %d"}
+ set x {}
}
# Claim the focus and wait long enough for it to really arrive.
@@ -626,13 +722,17 @@ test focus-6.2 {miscellaneous - embedded application in different process} \
after 300 {set timer 1}
vwait timer
set result [list $x [dobg {set x}]]
+ return $result
+} -cleanup {
+ destroy .t
cleanupbg
- 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}}}
+ bind all <FocusIn> {}
+ bind all <FocusOut> {}
+} -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}}}
+
+
deleteWindows
-bind all <FocusIn> {}
-bind all <FocusOut> {}
# cleanup
cleanupTests
diff --git a/tests/focusTcl.test b/tests/focusTcl.test
index 1f5eed5..ef848bb 100644
--- a/tests/focusTcl.test
+++ b/tests/focusTcl.test
@@ -7,131 +7,262 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+
+option add *takeFocus 1
+option add *highlightThickness 2
+. configure -takefocus 1 -highlightthickness 2
proc setup1 w {
if {$w == "."} {
- set w ""
+ set w ""
}
foreach i {a b c d} {
- frame $w.$i -width 200 -height 50 -bd 2 -relief raised
- pack $w.$i
+ destroy $w.$i
+ frame $w.$i -width 200 -height 50 -bd 2 -relief raised
+ pack $w.$i
}
.b configure -width 0 -height 0
foreach i {x y z} {
- button $w.b.$i -text "Button $w.b.$i"
- pack $w.b.$i -side left
+ destroy $w.b.$i
+ button $w.b.$i -text "Button $w.b.$i"
+ pack $w.b.$i -side left
}
if {![winfo ismapped $w.b.z]} {
- tkwait visibility $w.b.z
+ tkwait visibility $w.b.z
}
}
-option add *takeFocus 1
-option add *highlightThickness 2
-. configure -takefocus 1 -highlightthickness 2
-test focusTcl-1.1 {tk_focusNext procedure, no children} {
+proc cleanup1 w {
+ if {$w == "."} {
+ set w ""
+ }
+ foreach i {a b c d} {
+ destroy $w.$i
+ }
+ foreach i {x y z} {
+ destroy $w.b.$i
+ }
+}
+
+
+test focusTcl-1.1 {tk_focusNext procedure, no children} -body {
tk_focusNext .
-} {.}
-setup1 .
-test focusTcl-1.2 {tk_focusNext procedure, basic tree traversal} {
+} -result {.}
+
+test focusTcl-1.2 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .
-} {.a}
-test focusTcl-1.3 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.a}
+test focusTcl-1.3 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .a
-} {.b}
-test focusTcl-1.4 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b}
+test focusTcl-1.4 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .b
-} {.b.x}
-test focusTcl-1.5 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.x}
+test focusTcl-1.5 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .b.x
-} {.b.y}
-test focusTcl-1.6 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-1.6 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .b.y
-} {.b.z}
-test focusTcl-1.7 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.z}
+test focusTcl-1.7 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .b.z
-} {.c}
-test focusTcl-1.8 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.c}
+test focusTcl-1.8 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .c
-} {.d}
-test focusTcl-1.9 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.d}
+test focusTcl-1.9 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
tk_focusNext .d
-} {.}
-foreach w {.b .b.x .b.y .c .d} {
- $w configure -takefocus 0
-}
-test focusTcl-1.10 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.}
+
+test focusTcl-1.10 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
+ foreach w {.b .b.x .b.y .c .d} {
+ $w configure -takefocus 0
+ }
tk_focusNext .a
-} {.b.z}
-test focusTcl-1.11 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.z}
+test focusTcl-1.11 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
+ foreach w {.b .b.x .b.y .c .d} {
+ $w configure -takefocus 0
+ }
tk_focusNext .b.z
-} {.}
-test focusTcl-1.12 {tk_focusNext procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.}
+
+test focusTcl-1.12 {tk_focusNext procedure, basic tree traversal} -body {
+ setup1 .
deleteWindows
setup1 .
update
. configure -takefocus 0
tk_focusNext .d
-} {.a}
-. configure -takefocus 1
+} -cleanup {
+ . configure -takefocus 1
+ cleanup1 .
+} -result {.a}
+
+
+test focusTcl-2.1 {tk_focusNext procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
-deleteWindows
-setup1 .
-toplevel .t
-wm geom .t +0+0
-toplevel .t2
-wm geom .t2 -0+0
-raise .t .a
-test focusTcl-2.1 {tk_focusNext procedure, toplevels} {
tk_focusNext .a
-} {.b}
-test focusTcl-2.2 {tk_focusNext procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.b}
+test focusTcl-2.2 {tk_focusNext procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+
tk_focusNext .d
-} {.}
-test focusTcl-2.3 {tk_focusNext procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.}
+test focusTcl-2.3 {tk_focusNext procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+
tk_focusNext .t
-} {.t}
-setup1 .t
-raise .t.b
-test focusTcl-2.4 {tk_focusNext procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.t}
+test focusTcl-2.4 {tk_focusNext procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+ setup1 .t
+ raise .t.b
+
tk_focusNext .t
-} {.t.a}
-test focusTcl-2.5 {tk_focusNext procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.t.a}
+test focusTcl-2.5 {tk_focusNext procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+ setup1 .t
+ raise .t.b
+
tk_focusNext .t.b.z
-} {.t}
+} -cleanup {
+ deleteWindows
+} -result {.t}
-deleteWindows
-test focusTcl-3.1 {tk_focusPrev procedure, no children} {
+
+test focusTcl-3.1 {tk_focusPrev procedure, no children} -body {
tk_focusPrev .
-} {.}
-setup1 .
-test focusTcl-3.2 {tk_focusPrev procedure, basic tree traversal} {
+} -result {.}
+
+test focusTcl-3.2 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .
-} {.d}
-test focusTcl-3.3 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.d}
+test focusTcl-3.3 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .d
-} {.c}
-test focusTcl-3.4 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.c}
+test focusTcl-3.4 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .c
-} {.b.z}
-test focusTcl-3.5 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.z}
+test focusTcl-3.5 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .b.z
-} {.b.y}
-test focusTcl-3.6 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-3.6 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .b.y
-} {.b.x}
-test focusTcl-3.7 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.x}
+test focusTcl-3.7 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .b.x
-} {.b}
-test focusTcl-3.8 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.b}
+test focusTcl-3.8 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .b
-} {.a}
-test focusTcl-3.9 {tk_focusPrev procedure, basic tree traversal} {
+} -cleanup {
+ cleanup1 .
+} -result {.a}
+test focusTcl-3.9 {tk_focusPrev procedure, basic tree traversal} -body {
+ setup1 .
tk_focusPrev .a
-} {.}
+} -cleanup {
+ cleanup1 .
+} -result {.}
+
deleteWindows
setup1 .
@@ -140,35 +271,95 @@ wm geom .t +0+0
toplevel .t2
wm geom .t2 -0+0
raise .t .a
-test focusTcl-4.1 {tk_focusPrev procedure, toplevels} {
+test focusTcl-4.1 {tk_focusPrev procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+
tk_focusPrev .
-} {.d}
-test focusTcl-4.2 {tk_focusPrev procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.d}
+test focusTcl-4.2 {tk_focusPrev procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+
tk_focusPrev .b
-} {.a}
-test focusTcl-4.3 {tk_focusPrev procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.a}
+test focusTcl-4.3 {tk_focusPrev procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+
tk_focusPrev .t
-} {.t}
-setup1 .t
-update
-.t configure -takefocus 0
-raise .t.b
-test focusTcl-4.4 {tk_focusPrev procedure, toplevels} {
+} -cleanup {
+ deleteWindows
+} -result {.t}
+
+test focusTcl-4.4 {tk_focusPrev procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+ setup1 .t
+ update
+ .t configure -takefocus 0
+ raise .t.b
+
tk_focusPrev .t
-} {.t.b.z}
-test focusTcl-4.5 {tk_focusPrev procedure, toplevels} {
- tk_focusPrev .t.a
-} {.t.b.z}
+} -cleanup {
+ deleteWindows
+} -result {.t.b.z}
+test focusTcl-4.5 {tk_focusPrev procedure, toplevels} -setup {
+ deleteWindows
+} -body {
+ setup1 .
+ toplevel .t
+ wm geom .t +0+0
+ toplevel .t2
+ wm geom .t2 -0+0
+ raise .t .a
+ setup1 .t
+ update
+ .t configure -takefocus 0
+ raise .t.b
-deleteWindows
-test focusTcl-5.1 {tkFocusOK procedure, -takefocus 0} {
+ tk_focusPrev .t.a
+} -cleanup {
deleteWindows
+} -result {.t.b.z}
+
+
+test focusTcl-5.1 {tkFocusOK procedure, -takefocus 0} -body {
setup1 .
.b.x configure -takefocus 0
tk_focusNext .b
-} {.b.y}
-test focusTcl-5.2 {tkFocusOK procedure, -takefocus 1} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-5.2 {tkFocusOK procedure, -takefocus 1} -body {
setup1 .
pack forget .b
update
@@ -176,103 +367,119 @@ test focusTcl-5.2 {tkFocusOK procedure, -takefocus 1} {
.b.y configure -takefocus ""
.b.z configure -takefocus ""
list [tk_focusNext .a] [tk_focusNext .b.x]
-} {.c .c}
-test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} {
+} -cleanup {
+ cleanup1 .
+} -result {.c .c}
+test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} -body {
proc t w {
- if {$w == ".b.x"} {
- return 1
- } elseif {$w == ".b.y"} {
- return ""
- }
- return 0
+ if {$w == ".b.x"} {
+ return 1
+ } elseif {$w == ".b.y"} {
+ return ""
}
- deleteWindows
+ return 0
+ }
+
setup1 .
pack forget .b.y
update
.b configure -takefocus ""
foreach w {.b.x .b.y .b.z .c} {
- $w configure -takefocus t
+ $w configure -takefocus t
}
list [tk_focusNext .a] [tk_focusNext .b.x]
-} {.b.x .d}
-test focusTcl-5.4 {tkFocusOK procedure, -takefocus ""} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.x .d}
+test focusTcl-5.4 {tkFocusOK procedure, -takefocus ""} -body {
setup1 .
.b.x configure -takefocus ""
update
tk_focusNext .b
-} {.b.x}
-test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.x}
+test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} -body {
setup1 .
.b.x configure -takefocus ""
pack unpack .b.x
update
tk_focusNext .b
-} {.b.y}
-test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} -body {
setup1 .
foreach w {.b.x .b.y .b.z} {
- $w configure -takefocus ""
+ $w configure -takefocus ""
}
pack unpack .b
update
tk_focusNext .b
-} {.c}
-test focusTcl-5.7 {tkFocusOK procedure, -takefocus "", not mapped} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.c}
+test focusTcl-5.7 {tkFocusOK procedure, -takefocus "", not mapped} -body {
setup1 .
.b.y configure -takefocus 1
pack unpack .b.y
update
tk_focusNext .b.x
-} {.b.z}
-test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} {
+} -cleanup {
+ cleanup1 .
+} -result {.b.z}
+test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} -body {
proc always args {return 1}
- deleteWindows
setup1 .
.b.y configure -takefocus always
pack unpack .b.y
update
tk_focusNext .b.x
-} {.b.y}
-test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} -body {
setup1 .
foreach w {.b.x .b.y .b.z} {
- $w configure -takefocus ""
+ $w configure -takefocus ""
}
update
.b.x configure -state disabled
tk_focusNext .b
-} {.b.y}
-test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.b.y}
+test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} -body {
setup1 .
foreach w {.a .b .c .d} {
- $w configure -takefocus ""
+ $w configure -takefocus ""
}
update
bind .a <Key> {foo}
list [tk_focusNext .] [tk_focusNext .a]
-} {.a .b.x}
-test focusTcl-5.11 {tkFocusOK procedure, -takefocus "", check for bindings} {
- deleteWindows
+} -cleanup {
+ cleanup1 .
+} -result {.a .b.x}
+test focusTcl-5.11 {tkFocusOK procedure, -takefocus "", check for bindings} -body {
setup1 .
foreach w {.a .b .c .d} {
- $w configure -takefocus ""
+ $w configure -takefocus ""
}
update
bind Frame <Key> {foo}
list [tk_focusNext .] [tk_focusNext .a]
-} {.a .b}
+} -cleanup {
+ cleanup1 .
+ bind Frame <Key> {}
+} -result {.a .b}
+
-bind Frame <Key> {}
. configure -takefocus 0 -highlightthickness 0
option clear
# cleanup
cleanupTests
return
+
+
+
diff --git a/tests/font.test b/tests/font.test
index 34e4b83..3a2568c 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -6,45 +6,18 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-catch {destroy .b}
-toplevel .b
-wm geom .b +0+0
-update idletasks
-
-proc setup {} {
- catch {destroy .b.f}
- catch {eval font delete [font names]}
- label .b.f
- pack .b.f
- update
-}
-
-label .b.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left -text "0" -font "Courier -12"
-pack .b.l
-canvas .b.c -closeenough 0
-.b.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
-pack .b.c
-update
-
-set ax [winfo reqwidth .b.l]
-set ay [winfo reqheight .b.l]
-proc getsize {} {
- update
- return "[winfo reqwidth .b.l] [winfo reqheight .b.l]"
-}
-proc csetup {{str ""}} {
- focus -force .b.c
- .b.c dchars text 0 end
- .b.c insert text 0 $str
- .b.c focus text
-}
-
-setup
+catch {eval font delete [font names]}
+deleteWindows
+# Toplevel used (in some tests) of the whole file
+toplevel .t
+wm geom .t +0+0
+update idletasks
case [tk windowingsystem] {
x11 {set fixed "fixed"}
@@ -54,195 +27,242 @@ case [tk windowingsystem] {
}
-set times [font actual {times 0} -family]
+# Procedure used in tests: 24.15, 26.*, 28.*, 30.*, 31.*, 32.1
+proc csetup {{str ""}} {
+ focus -force .t.c
+ .t.c dchars text 0 end
+ .t.c insert text 0 $str
+ .t.c focus text
+}
-test font-1.1 {TkFontPkgInit} {
+
+test font-1.1 {TkFontPkgInit} -setup {
catch {interp delete foo}
+} -body {
interp create foo
foo eval {
- load {} Tk
- wm geometry . +0+0
- update
+ load {} Tk
+ wm geometry . +0+0
+ update
}
interp delete foo
-} {}
+} -result {}
-test font-2.1 {TkFontPkgFree} {
+
+test font-2.1 {TkFontPkgFree} -setup {
catch {interp delete foo}
- interp create foo
set x {}
+} -body {
+ interp create foo
# Makes sure that named font was visible only to child interp.
-
foo eval {
- load {} Tk
- wm geometry . +0+0
- button .b -font {times 16} -text "hi"
- pack .b
- font create wiggles -family courier -underline 1
- update
+ load {} Tk
+ wm geometry . +0+0
+ button .b -font {times 16} -text "hi"
+ pack .b
+ font create wiggles -family courier -underline 1
+ update
}
lappend x [catch {font configure wiggles} msg; set msg]
# Tests cancelling the idle handler for TheWorldHasChanged,
# because app goes away before idle serviced.
-
foo eval {
- .b config -font wiggles
- font config wiggles -size 24
- destroy .
+ .b config -font wiggles
+ font config wiggles -size 24
+ destroy .
}
lappend x [foo eval {catch {font families} msg; set msg}]
+} -cleanup {
+ interp delete foo
+} -result {{named font "wiggles" doesn't exist} {can't invoke "font" command: application has been destroyed}}
- interp delete foo
- set x
-} {{named font "wiggles" doesn't exist} {can't invoke "font" command: application has been destroyed}}
+test font-3.1 {font command: general} -body {
+ font
+} -returnCodes error -result {wrong # args: should be "font option ?arg?"}
+test font-3.2 {font command: general} -body {
+ font xyz
+} -returnCodes error -result {bad option "xyz": must be actual, configure, create, delete, families, measure, metrics, or names}
-test font-3.1 {font command: general} {
- list [catch {font} msg] $msg
-} {1 {wrong # args: should be "font option ?arg?"}}
-test font-3.2 {font command: general} {
- list [catch {font xyz} msg] $msg
-} {1 {bad option "xyz": must be actual, configure, create, delete, families, measure, metrics, or names}}
-test font-4.1 {font command: actual: arguments} {
+test font-4.1 {font command: actual: arguments} -body {
# (skip < 0)
- list [catch {font actual xyz -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test font-4.2 {font command: actual: arguments} {
+ font actual xyz -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test font-4.2 {font command: actual: arguments} -body {
# (objc < 3)
- list [catch {font actual} msg] $msg
-} {1 {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}}
-test font-4.3 {font command: actual: arguments} {
+ font actual
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+test font-4.3 {font command: actual: arguments} -body {
# (objc - skip > 4) when skip == 0
- list [catch {font actual xyz abc def} msg] $msg
-} {1 {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}}
-test font-4.4 {font command: actual: displayof specified, so skip to next} {
+ font actual xyz abc def
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+test font-4.4 {font command: actual: displayof specified, so skip to next} -body {
catch {font actual xyz -displayof . -size}
-} {0}
-test font-4.5 {font command: actual: displayof specified, so skip to next} {
+} -result {0}
+test font-4.5 {font command: actual: displayof specified, so skip to next} -body {
lindex [font actual xyz -displayof .] 0
-} {-family}
-test font-4.6 {font command: actual: arguments} {
+} -result {-family}
+test font-4.6 {font command: actual: arguments} -body {
# (objc - skip > 4) when skip == 2
- list [catch {font actual xyz -displayof . abc def} msg] $msg
-} {1 {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}}
-test font-4.7 {font command: actual: arguments} {noExceed} {
+ font actual xyz -displayof . abc def
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+test font-4.7 {font command: actual: arguments} -constraints noExceed -body {
# (tkfont == NULL)
- list [catch {font actual "\{xyz"} msg] $msg
-} [list 1 "font \"{xyz\" doesn't exist"]
-test font-4.8 {font command: actual: all attributes} {
+ font actual "\{xyz"
+} -returnCodes error -result "font \"{xyz\" doesn't exist"
+test font-4.8 {font command: actual: all attributes} -body {
# not (objc > 3) so objPtr = NULL
lindex [font actual {-family times}] 0
-} {-family}
-test font-4.9 {font command: actual} {unix noExceed} {
+} -result {-family}
+test font-4.9 {font command: actual} -constraints {unix noExceed} -body {
# (objc > 3) so objPtr = objv[3 + skip]
string tolower [font actual {-family times} -family]
-} {times}
-test font-4.10 {font command: actual} win {
+} -result {times}
+test font-4.10 {font command: actual} -constraints win -body {
# (objc > 3) so objPtr = objv[3 + skip]
font actual {-family times} -family
-} {Times New Roman}
-test font-4.11 {font command: bad option} {
- list [catch {font actual xyz -style} msg] $msg
-} {1 {bad option "-style": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
+} -result {Times New Roman}
+test font-4.11 {font command: bad option} -body {
+ font actual xyz -style
+} -returnCodes error -result {bad option "-style": must be -family, -size, -weight, -slant, -underline, or -overstrike}
-test font-5.1 {font command: configure} {
+
+test font-5.1 {font command: configure} -body {
# (objc < 3)
- list [catch {font configure} msg] $msg
-} {1 {wrong # args: should be "font configure fontname ?options?"}}
-test font-5.2 {font command: configure: non-existent font} {
+ font configure
+} -returnCodes error -result {wrong # args: should be "font configure fontname ?-option value ...?"}
+test font-5.2 {font command: configure: non-existent font} -body {
# (namedHashPtr == NULL)
- list [catch {font configure xyz} msg] $msg
-} {1 {named font "xyz" doesn't exist}}
-test font-5.3 {font command: configure: "deleted" font} {
+ font configure xyz
+} -returnCodes error -result {named font "xyz" doesn't exist}
+test font-5.3 {font command: configure: "deleted" font} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
# (nfPtr->deletePending != 0)
- setup
font create xyz
- .b.f configure -font xyz
+ .t.f configure -font xyz
font delete xyz
- list [catch {font configure xyz} msg] $msg
-} {1 {named font "xyz" doesn't exist}}
-test font-5.4 {font command: configure: get all options} {
+ font configure xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {named font "xyz" doesn't exist}
+test font-5.4 {font command: configure: get all options} -setup {
+ catch {font delete xyz}
+} -body {
# (objc == 3) so objPtr = NULL
- setup
font create xyz -family xyz
lindex [font configure xyz] 1
-} xyz
-test font-5.5 {font command: configure: get one option} {
+} -cleanup {
+ font delete xyz
+} -result xyz
+test font-5.5 {font command: configure: get one option} -setup {
+ catch {eval font delete [font names]}
+} -body {
# (objc == 4) so objPtr = objv[3]
- setup
font create xyz -family xyz
font configure xyz -family
-} xyz
-test font-5.6 {font command: configure: update existing font} {
+ font names
+} -cleanup {
+ font delete xyz
+} -result xyz
+test font-5.6 {font command: configure: update existing font} -setup {
+ catch {font delete xyz}
+} -body {
# else result = ConfigAttributesObj()
- setup
font create xyz
font configure xyz -family xyz
update
font configure xyz -family
-} xyz
-test font-5.7 {font command: configure: bad option} {
- setup
+} -cleanup {
+ font delete xyz
+} -result xyz
+test font-5.7 {font command: configure: bad option} -setup {
+ catch {font delete xyz}
+} -body {
font create xyz
- list [catch {font configure xyz -style} msg] $msg
-} {1 {bad option "-style": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
+ font configure xyz -style
+} -cleanup {
+ font delete xyz
+} -returnCodes error -result {bad option "-style": must be -family, -size, -weight, -slant, -underline, or -overstrike}
+
-test font-6.1 {font command: create: make up name} {
+test font-6.1 {font command: create: make up name} -setup {
+ catch {eval font delete [font names]}
+} -body {
# (objc < 3) so name = NULL
- setup
font create
font names
-} {font1}
-test font-6.2 {font command: create: name specified} {
+} -cleanup {
+ font delete font1
+} -result {font1}
+test font-6.2 {font command: create: name specified} -setup {
+ catch {eval font delete [font names]}
+} -body {
# not (objc < 3)
- setup
font create xyz
font names
-} {xyz}
-test font-6.3 {font command: create: name not really specified} {
+} -cleanup {
+ font delete xyz
+} -result {xyz}
+test font-6.3 {font command: create: name not really specified} -setup {
+ catch {eval font delete [font names]}
+} -body {
# (name[0] == '-') so name = NULL
- setup
font create -family xyz
font names
-} {font1}
-test font-6.4 {font command: create: generate name} {
+} -cleanup {
+ font delete font1
+} -result {font1}
+test font-6.4 {font command: create: generate name} -setup {
+ catch {eval font delete [font names]}
+} -body {
# (name == NULL)
- setup
font create -family one
font create -family two
font create -family three
font delete font2
font create -family four
font configure font2 -family
-} {four}
-test font-6.5 {font command: create: bad option creating new font} {
+} -cleanup {
+ catch {eval font delete [font names]}
+} -result {four}
+test font-6.5 {font command: create: bad option creating new font} -setup {
+ catch {font delete xyz}
+} -body {
# name was specified so skip = 3
- setup
- list [catch {font create xyz -xyz times} msg] $msg
-} {1 {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
-test font-6.6 {font command: create: bad option creating new font} {
+ font create xyz -xyz times
+} -returnCodes error -result {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}
+test font-6.6 {font command: create: bad option creating new font} -setup {
+ catch {eval font delete [font names]}
+} -body {
# name was not specified so skip = 2
- setup
- list [catch {font create -xyz times} msg] $msg
-} {1 {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
-test font-6.7 {font command: create: already exists} {
+ font create -xyz times
+} -returnCodes error -result {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}
+test font-6.7 {font command: create: already exists} -setup {
+ catch {font delete xyz}
+} -body {
# (CreateNamedFont() != TCL_OK)
- setup
font create xyz
- list [catch {font create xyz} msg] $msg
-} {1 {named font "xyz" already exists}}
+ font create xyz
+} -cleanup {
+ font delete xyz
+} -returnCodes error -result {named font "xyz" already exists}
-test font-7.1 {font command: delete: arguments} {
+test font-7.1 {font command: delete: arguments} -body {
# (objc < 3)
- list [catch {font delete} msg] $msg
-} {1 {wrong # args: should be "font delete fontname ?fontname ...?"}}
-test font-7.2 {font command: delete: loop test} {
+ font delete
+} -returnCodes error -result {wrong # args: should be "font delete fontname ?fontname ...?"}
+test font-7.2 {font command: delete: loop test} -setup {
+ catch {eval font delete [font names]}
+ set x {}
+} -body {
# for (i = 2; i < objc; i++)
- setup
- set x {}
font create a -underline 1
font create b -underline 1
font create c -underline 1
@@ -251,11 +271,14 @@ test font-7.2 {font command: delete: loop test} {
lappend x [lsort [font names]]
font delete a e c b
lappend x [lsort [font names]]
-} {{a b c d e} d}
-test font-7.3 {font command: delete: loop test} {
+} -cleanup {
+ catch {eval font delete [font names]}
+} -result {{a b c d e} d}
+test font-7.3 {font command: delete: loop test} -setup {
+ catch {eval font delete [font names]}
+ set x {}
+} -body {
# (namedHashPtr == NULL) in middle of loop
- setup
- set x {}
font create a -underline 1
font create b -underline 1
font create c -underline 1
@@ -264,299 +287,440 @@ test font-7.3 {font command: delete: loop test} {
lappend x [lsort [font names]]
catch {font delete a d q c e b}
lappend x [lsort [font names]]
-} {{a b c d e} {b c e}}
-test font-7.4 {font command: delete: non-existent} {
+} -cleanup {
+ catch {eval font delete [font names]}
+} -result {{a b c d e} {b c e}}
+test font-7.4 {font command: delete: non-existent} -setup {
+ catch {font delete xyz}
+} -body {
# (namedHashPtr == NULL)
- setup
- list [catch {font delete xyz} msg] $msg
-} {1 {named font "xyz" doesn't exist}}
-test font-7.5 {font command: delete: mark for later deletion} {
+ font delete xyz
+} -returnCodes error -result {named font "xyz" doesn't exist}
+test font-7.5 {font command: delete: mark for later deletion} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
# (nfPtr->refCount != 0)
- setup
font create xyz
- .b.f configure -font xyz
+ .t.f configure -font xyz
font delete xyz
font actual xyz
- list [catch {font configure xyz} msg] $msg [.b.f cget -font]
-} {1 {named font "xyz" doesn't exist} xyz}
-test font-7.6 {font command: delete: actually delete} {
+ font configure xyz
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {named font "xyz" doesn't exist}
+test font-7.6 {font command: delete: mark for later deletion} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
+ # (nfPtr->refCount != 0)
+ font create xyz
+ .t.f configure -font xyz
+ font delete xyz
+ font actual xyz
+ catch {font configure xyz}
+ .t.f cget -font
+} -cleanup {
+ destroy .t.f
+} -result xyz
+test font-7.7 {font command: delete: actually delete} -setup {
+ catch {font delete xyz}
+} -body {
# not (nfPtr->refCount != 0)
- setup
font create xyz -underline 1
font delete xyz
- catch {font config xyz}
-} {1}
-setup
+ font config xyz
+} -returnCodes error -match glob -result {*}
-test font-8.1 {font command: families: arguments} {
+
+test font-8.1 {font command: families: arguments} -body {
# (skip < 0)
- list [catch {font families -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test font-8.2 {font command: families: arguments} {
+ font families -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test font-8.2 {font command: families: arguments} -body {
# (objc - skip != 2) when skip == 0
- list [catch {font families xyz} msg] $msg
-} {1 {wrong # args: should be "font families ?-displayof window?"}}
-test font-8.3 {font command: families: arguments} {
+ font families xyz
+} -returnCodes error -result {wrong # args: should be "font families ?-displayof window?"}
+test font-8.3 {font command: families: arguments} -body {
# (objc - skip != 2) when skip == 2
- list [catch {font families -displayof . xyz} msg] $msg
-} {1 {wrong # args: should be "font families ?-displayof window?"}}
-test font-8.4 {font command: families} {
+ font families -displayof . xyz
+} -returnCodes error -result {wrong # args: should be "font families ?-displayof window?"}
+test font-8.4 {font command: families} -body {
# TkpGetFontFamilies()
regexp -nocase times [font families]
-} {1}
+} -result 1
+
-test font-9.1 {font command: measure: arguments} {
+test font-9.1 {font command: measure: arguments} -body {
# (skip < 0)
- list [catch {expr {[font measure xyz -displayof]>0}} msg] $msg
-} {0 1}
-test font-9.2 {font command: measure: arguments} {
+ expr {[font measure xyz -displayof] > 0}
+} -returnCodes ok -result 1
+test font-9.2 {font command: measure: arguments} -body {
# (objc - skip != 4)
- list [catch {font measure} msg] $msg
-} {1 {wrong # args: should be "font measure font ?-displayof window? text"}}
-test font-9.3 {font command: measure: arguments} {
+ font measure
+} -returnCodes error -result {wrong # args: should be "font measure font ?-displayof window? text"}
+test font-9.3 {font command: measure: arguments} -body {
# (objc - skip != 4)
- list [catch {font measure xyz abc def} msg] $msg
-} {1 {wrong # args: should be "font measure font ?-displayof window? text"}}
-test font-9.4 {font command: measure: arguments} {noExceed} {
+ font measure xyz abc def
+} -returnCodes error -result {wrong # args: should be "font measure font ?-displayof window? text"}
+test font-9.4 {font command: measure: arguments} -constraints noExceed -body {
# (tkfont == NULL)
- list [catch {font measure "\{xyz" abc} msg] $msg
-} [list 1 "font \"{xyz\" doesn't exist"]
-test font-9.5 {font command: measure} {
+ font measure "\{xyz" abc
+} -returnCodes error -result "font \"{xyz\" doesn't exist"
+test font-9.5 {font command: measure} -body {
# Tk_TextWidth()
- expr [font measure $fixed "abcdefg"]==[font measure $fixed "a"]*7
-} {1}
-test font-9.6 {font command: measure -d} {
- list [catch {expr {[font measure $fixed -d] > 0}} msg] $msg
-} {0 1}
-test font-9.7 {font command: measure -d with -displayof} {
- list [catch {expr {[font measure $fixed -displayof . -d] > 0}} msg] $msg
-} {0 1}
-test font-9.8 {font command: measure: arguments} {
- list [catch {font measure $fixed -displayof .} msg] $msg
-} {1 {wrong # args: should be "font measure font ?-displayof window? text"}}
-
-test font-10.1 {font command: metrics: arguments} {
- list [catch {font metrics xyz -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test font-10.2 {font command: metrics: arguments} {
+ expr {[font measure $fixed "abcdefg"] == [font measure $fixed "a"]*7 }
+} -result 1
+test font-9.6 {font command: measure -d} -body {
+ expr {[font measure $fixed -d] > 0}
+} -returnCodes ok -result 1
+test font-9.7 {font command: measure -d with -displayof} -body {
+ expr {[font measure $fixed -displayof . -d] > 0}
+} -returnCodes ok -result 1
+test font-9.8 {font command: measure: arguments} -body {
+ font measure $fixed -displayof .
+} -returnCodes error -result {wrong # args: should be "font measure font ?-displayof window? text"}
+
+
+test font-10.1 {font command: metrics: arguments} -body {
+ font metrics xyz -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test font-10.2 {font command: metrics: arguments} -body {
# (skip < 0)
- list [catch {font metrics xyz -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test font-10.3 {font command: metrics: arguments} {
+ font metrics xyz -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test font-10.3 {font command: metrics: arguments} -body {
# (objc < 3)
- list [catch {font metrics} msg] $msg
-} {1 {wrong # args: should be "font metrics font ?-displayof window? ?option?"}}
-test font-10.4 {font command: metrics: arguments} {
+ font metrics
+} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"}
+test font-10.4 {font command: metrics: arguments} -body {
# (objc - skip) > 4) when skip == 0
- list [catch {font metrics xyz abc def} msg] $msg
-} {1 {wrong # args: should be "font metrics font ?-displayof window? ?option?"}}
-test font-10.5 {font command: metrics: arguments} {
+ font metrics xyz abc def
+} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"}
+test font-10.5 {font command: metrics: arguments} -body {
# (objc - skip) > 4) when skip == 2
- list [catch {font metrics xyz -displayof . abc} msg] $msg
-} {1 {bad metric "abc": must be -ascent, -descent, -linespace, or -fixed}}
-test font-10.6 {font command: metrics: bad font} {noExceed} {
+ font metrics xyz -displayof . abc
+} -returnCodes error -result {bad metric "abc": must be -ascent, -descent, -linespace, or -fixed}
+test font-10.6 {font command: metrics: bad font} -constraints noExceed -body {
# (tkfont == NULL)
- list [catch {font metrics "\{xyz"} msg] $msg
-} [list 1 "font \"{xyz\" doesn't exist"]
-test font-10.7 {font command: metrics: get all metrics} {
- # (objc == 3)
+ font metrics "\{xyz"
+} -returnCodes error -result "font \"{xyz\" doesn't exist"
+test font-10.7 {font command: metrics: get all metrics} -setup {
catch {unset a}
+} -body {
+ # (objc == 3)
array set a [font metrics {-family xyz}]
- set x [lsort [array names a]]
+ lsort [array names a]
+} -cleanup {
unset a
- set x
-} {-ascent -descent -fixed -linespace}
-test font-10.8 {font command: metrics: bad metric} {
+} -result {-ascent -descent -fixed -linespace}
+test font-10.8 {font command: metrics: bad metric} -body {
# (Tcl_GetIndexFromObj() != TCL_OK)
- list [catch {font metrics $fixed -xyz} msg] $msg
-} {1 {bad metric "-xyz": must be -ascent, -descent, -linespace, or -fixed}}
-test font-10.9 {font command: metrics: get individual metrics} {
+ font metrics $fixed -xyz
+} -returnCodes error -result {bad metric "-xyz": must be -ascent, -descent, -linespace, or -fixed}
+test font-10.9 {font command: metrics: get individual metrics} -body {
font metrics $fixed -ascent
font metrics $fixed -descent
font metrics $fixed -linespace
font metrics $fixed -fixed
-} {1}
+} -result 1
+
-test font-11.1 {font command: names: arguments} {
+test font-11.1 {font command: names: arguments} -body {
# (objc != 2)
- list [catch {font names xyz} msg] $msg
-} {1 {wrong # args: should be "font names"}}
-test font-11.2 {font command: names: loop test: no passes} {
- setup
+ font names xyz
+} -returnCodes error -result {wrong # args: should be "font names"}
+test font-11.2 {font command: names: loop test: no passes} -setup {
+ catch {eval font delete [font names]}
+} -body {
font names
-} {}
-test font-11.3 {font command: names: loop test: one pass} {
- setup
+} -result {}
+test font-11.3 {font command: names: loop test: one pass} -setup {
+ catch {eval font delete [font names]}
+} -body {
font create
font names
-} {font1}
-test font-11.4 {font command: names: loop test: multiple passes} {
- setup
+} -result {font1}
+test font-11.4 {font command: names: loop test: multiple passes} -setup {
+ catch {eval font delete [font names]}
+} -body {
font create xyz
font create abc
font create def
lsort [font names]
-} {abc def xyz}
-test font-11.5 {font command: names: skip deletePending fonts} {
- # (nfPtr->deletePending == 0)
- setup
+} -cleanup {
+ catch {eval font delete [font names]}
+} -result {abc def xyz}
+test font-11.5 {font command: names: skip deletePending fonts} -setup {
+ destroy .t.f
+ catch {eval font delete [font names]}
+ pack [label .t.f]
+ update
set x {}
+} -body {
+ # (nfPtr->deletePending == 0)
font create xyz
font create abc
lappend x [lsort [font names]]
- .b.f config -font xyz
+ .t.f config -font xyz
font delete xyz
lappend x [font names]
-} {{abc xyz} abc}
+} -cleanup {
+ catch {eval font delete [font names]}
+} -result {{abc xyz} abc}
-test font-12.1 {UpdateDependantFonts procedure: no users} {
+
+test font-12.1 {UpdateDependantFonts procedure: no users} -setup {
+ catch {font delete xyz}
+} -body {
# (nfPtr->refCount == 0)
- setup
font create xyz
font configure xyz -family times
-} {}
-test font-12.2 {UpdateDependantFonts procedure: pings the widgets} {
- setup
+} -cleanup {
+ font delete xyz
+} -result {}
+test font-12.2 {UpdateDependantFonts procedure: pings the widgets} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
font create xyz -family times -size 20
- .b.f config -font xyz -text "abcd" -padx 0 -bd 0 -highlightthickness 0
+ .t.f config -font xyz -text "abcd" -padx 0 -bd 0 -highlightthickness 0
set a1 [font measure xyz "abcd"]
update
- set b1 [winfo reqwidth .b.f]
+ set b1 [winfo reqwidth .t.f]
font configure xyz -family helvetica -size 20
set a2 [font measure xyz "abcd"]
update
- set b2 [winfo reqwidth .b.f]
+ set b2 [winfo reqwidth .t.f]
expr {$a1==$b1 && $a2==$b2}
-} {1}
+} -cleanup {
+ destroy .t.f
+ font delete xyz
+} -result {1}
+
-test font-13.1 {CreateNamedFont: new named font} {
+test font-13.1 {CreateNamedFont: new named font} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
# not (new == 0)
- setup
- set x {}
lappend x [font names]
font create xyz
lappend x [font names]
-} {{} xyz}
-test font-13.2 {CreateNamedFont: named font already exists} {
+} -cleanup {
+ font delete xyz
+} -result {{} xyz}
+test font-13.2 {CreateNamedFont: named font already exists} -setup {
+ catch {font delete xyz}
+} -body {
# (new == 0)
- setup
font create xyz
- list [catch {font create xyz} msg] $msg
-} {1 {named font "xyz" already exists}}
-test font-13.3 {CreateNamedFont: named font already exists} {
+ font create xyz
+} -cleanup {
+ font delete xyz
+} -returnCodes error -result {named font "xyz" already exists}
+test font-13.3 {CreateNamedFont: named font already exists} -setup {
+ catch {font delete xyz}
+} -body {
# (nfPtr->deletePending == 0)
- setup
font create xyz
- list [catch {font create xyz} msg] $msg
-} {1 {named font "xyz" already exists}}
-test font-13.4 {CreateNamedFont: recreate "deleted" font} {
+ font create xyz
+} -cleanup {
+ font delete xyz
+} -returnCodes error -result {named font "xyz" already exists}
+test font-13.4 {CreateNamedFont: recreate "deleted" font} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
# not (nfPtr->deletePending == 0)
- setup
font create xyz -family times
- .b.f configure -font xyz
+ .t.f configure -font xyz
font delete xyz
font create xyz -family courier
font configure xyz -family
-} {courier}
+} -cleanup {
+ font delete xyz
+ destroy .t.f
+} -result {courier}
+
+
+test font-14.1 {Tk_GetFont procedure} -body {
+} -result {}
-test font-14.1 {Tk_GetFont procedure} {
-} {}
-test font-15.1 {Tk_AllocFontFromObj - converting internal reps} testfont {
+test font-15.1 {Tk_AllocFontFromObj - converting internal reps} -constraints {
+ testfont
+} -setup {
+ destroy .b1 .b2
+} -body {
set x {Times 16}
lindex $x 0
- destroy .b1 .b2
button .b1 -font $x
lindex $x 0
testfont counts {Times 16}
-} {{1 0}}
-test font-15.2 {Tk_AllocFontFromObj - discard stale font} testfont {
- set x {Times 16}
+} -cleanup {
+ destroy .b1 .b2
+} -result {{1 0}}
+test font-15.2 {Tk_AllocFontFromObj - discard stale font} -constraints {
+ testfont
+} -setup {
destroy .b1 .b2
+ set result {}
+} -body {
+ set x {Times 16}
button .b1 -font $x
destroy .b1
- set result {}
lappend result [testfont counts {Times 16}]
button .b2 -font $x
lappend result [testfont counts {Times 16}]
-} {{} {{1 1}}}
-test font-15.3 {Tk_AllocFontFromObj - reuse existing font} testfont {
- set x {Times 16}
+} -cleanup {
+ destroy .b2
+} -result {{} {{1 1}}}
+test font-15.3 {Tk_AllocFontFromObj - reuse existing font} -constraints {
+ testfont
+} -setup {
destroy .b1 .b2
- button .b1 -font $x
set result {}
+} -body {
+ set x {Times 16}
+ button .b1 -font $x
lappend result [testfont counts {Times 16}]
button .b2 -font $x
pack .b1 .b2 -side top
lappend result [testfont counts {Times 16}]
-} {{{1 1}} {{2 1}}}
-test font-15.4 {Tk_AllocFontFromObj procedure: bump ref count} {
+} -cleanup {
+ destroy .b1 .b2
+} -result {{{1 1}} {{2 1}}}
+test font-15.4 {Tk_AllocFontFromObj procedure: bump ref count} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# (new == 0)
- setup
- .b.f config -font {-family fixed}
+ .t.f config -font {-family fixed}
lindex [font actual {-family fixed}] 0
-} {-family}
-test font-15.5 {Tk_AllocFontFromObj procedure: get named font} {
+} -cleanup {
+ destroy .t.f
+} -result {-family}
+test font-15.5 {Tk_AllocFontFromObj procedure: get named font} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
# (namedHashPtr != NULL)
- setup
font create xyz
- .b.f config -font xyz
-} {}
-test font-15.6 {Tk_AllocFontFromObj procedure: not a named font} {
+ .t.f config -font xyz
+} -cleanup {
+ destroy .t.f
+ font delete xyz
+} -result {}
+test font-15.6 {Tk_AllocFontFromObj procedure: not a named font} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# not (namedHashPtr != NULL)
- setup
- .b.f config -font {times 20}
-} {}
-test font-15.7 {Tk_AllocFontFromObj procedure: get native font} unix {
+ .t.f config -font {times 20}
+} -cleanup {
+ destroy .t.f
+} -result {-family} -result {}
+test font-15.7 {Tk_AllocFontFromObj procedure: get native font} -constraints {
+ unix
+} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# not (fontPtr == NULL)
- setup
- .b.f config -font fixed
-} {}
-test font-15.8 {Tk_AllocFontFromObj procedure: get native font} win {
+ .t.f config -font fixed
+} -result {}
+test font-15.8 {Tk_AllocFontFromObj procedure: get native font} -constraints {
+ win
+} -setup {
+ destroy .t.f
+ catch {eval font delete [font names]}
+ pack [label .t.f]
+ update
+} -body {
# not (fontPtr == NULL)
- setup
- .b.f config -font oemfixed
-} {}
-test font-15.10 {Tk_AllocFontFromObj procedure: get attribute font} {
+ .t.f config -font oemfixed
+} -cleanup {
+ destroy .t.f
+} -result {}
+test font-15.9 {Tk_AllocFontFromObj procedure: get attribute font} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# (fontPtr == NULL)
- list [catch {.b.f config -font {xxx yyy zzz}} msg] $msg
-} {1 {expected integer but got "yyy"}}
-test font-15.11 {Tk_AllocFontFromObj procedure: no match} {noExceed} {
+ .t.f config -font {xxx yyy zzz}
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {expected integer but got "yyy"}
+test font-15.10 {Tk_AllocFontFromObj procedure: no match} -constraints noExceed -body {
# (ParseFontNameObj() != TCL_OK)
- list [catch {font actual "\{xyz"} msg] $msg
-} [list 1 "font \"{xyz\" doesn't exist"]
-test font-15.12 {Tk_AllocFontFromObj procedure: get attribute font} {
+ font actual "\{xyz"
+} -returnCodes error -result "font \"{xyz\" doesn't exist"
+test font-15.11 {Tk_AllocFontFromObj procedure: get attribute font} -body {
# not (ParseFontNameObj() != TCL_OK)
lindex [font actual {plan 9}] 0
-} {-family}
-test font-15.13 {Tk_AllocFontFromObj procedure: setup tab width} {
+} -result {-family}
+test font-15.12 {Tk_AllocFontFromObj procedure: setup tab width} -setup {
+ destroy .l
+} -body {
# Tk_MeasureChars(fontPtr, "0", ...)
label .l -bd 0 -padx 0 -highlightthickness 0 -font $fixed -text "a\tb"
update
- set x [winfo reqwidth .l]
- destroy .l
- set x
-} [expr [font measure $fixed "0"]*9]
-test font-15.14 {Tk_AllocFontFromObj procedure: underline position} {
+ set res1 [winfo reqwidth .l]
+ set res2 [expr [font measure $fixed "0"]*9]
+ expr {$res1 eq $res2}
+} -cleanup {
+ destroy .l
+} -result 1
+test font-15.13 {Tk_AllocFontFromObj procedure: underline position} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# (fontPtr->underlineHeight == 0) because size was < 10
- setup
- .b.f config -text "underline" -font "times -8 underline"
+ .t.f config -text "underline" -font "times -8 underline"
update
-} {}
+} -cleanup {
+ destroy .t.f
+} -result {}
-test font-16.1 {Tk_NameOfFont procedure} {
- setup
- .b.f config -font -family\ fixed
- .b.f cget -font
-} {-family fixed}
-test font-17.1 {Tk_FreeFontFromObj - reference counts} testfont {
- set x {Courier 12}
+test font-16.1 {Tk_NameOfFont procedure} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
+ .t.f config -font -family\ fixed
+ .t.f cget -font
+} -cleanup {
+ destroy .t.f
+} -result {-family fixed}
+
+
+test font-17.1 {Tk_FreeFontFromObj - reference counts} -constraints {
+ testfont
+} -setup {
destroy .b1 .b2 .b3
+ set result {}
+} -body {
+ set x {Courier 12}
button .b1 -font $x
button .b3 -font $x
button .b2 -font $x
- set result {}
lappend result [testfont counts {Courier 12}]
destroy .b1
lappend result [testfont counts {Courier 12}]
@@ -564,61 +728,83 @@ test font-17.1 {Tk_FreeFontFromObj - reference counts} testfont {
lappend result [testfont counts {Courier 12}]
destroy .b3
lappend result [testfont counts {Courier 12}]
-} {{{3 1}} {{2 1}} {{1 1}} {}}
-test font-17.2 {Tk_FreeFont procedure: one ref} {
+} -result {{{3 1}} {{2 1}} {{1 1}} {}}
+test font-17.2 {Tk_FreeFont procedure: one ref} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
# (fontPtr->refCount == 0)
- setup
- .b.f config -font {-family fixed}
- destroy .b.f
-} {}
-test font-17.3 {Tk_FreeFont procedure: multiple ref} {
+ .t.f config -font {-family fixed}
+ destroy .t.f
+} -result {}
+test font-17.3 {Tk_FreeFont procedure: multiple ref} -setup {
+ destroy .t.f .t.b
+ pack [label .t.f]
+ update
+} -body {
# not (fontPtr->refCount == 0)
- setup
- .b.f config -font {-family fixed}
- button .b.b -font {-family fixed}
- destroy .b.f
- set x [.b.b cget -font]
- destroy .b.b
- set x
-} {-family fixed}
-test font-17.4 {Tk_FreeFont procedure: named font} {
+ .t.f config -font {-family fixed}
+ button .t.b -font {-family fixed}
+ destroy .t.f
+ .t.b cget -font
+} -cleanup {
+ destroy .t.b
+} -result {-family fixed}
+test font-17.4 {Tk_FreeFont procedure: named font} -setup {
+ destroy .t.f
+ catch {eval font delete [font names]}
+ pack [label .t.f]
+ update
+} -body {
# (fontPtr->namedHashPtr != NULL)
- setup
font create xyz
- .b.f config -font xyz
- destroy .b.f
+ .t.f config -font xyz
+ destroy .t.f
font names
-} {xyz}
-test font-17.5 {Tk_FreeFont procedure: named font} {
+} -result {xyz}
+test font-17.5 {Tk_FreeFont procedure: named font} -setup {
+ destroy .t.f
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
# not (fontPtr->refCount == 0)
- setup
font create xyz -underline 1
- .b.f config -font xyz
+ .t.f config -font xyz
font delete xyz
set x [font actual xyz -underline]
- destroy .b.f
+ destroy .t.f
list [font actual xyz -underline] $x
-} {0 1}
-test font-17.6 {Tk_FreeFont procedure: named font not deleted yet} {
- setup
+} -result {0 1}
+test font-17.6 {Tk_FreeFont procedure: named font not deleted yet} -setup {
+ destroy .t.f .t.b
+ catch {font delete xyz}
+ pack [label .t.f]
+ update
+} -body {
font create xyz
- .b.f config -font xyz
- button .b.b -font xyz
+ .t.f config -font xyz
+ button .t.b -font xyz
font delete xyz
set x [font actual xyz]
- destroy .b.b
+ destroy .t.b
list [lindex [font actual xyz] 0] [lindex $x 0]
-} {-family -family}
+} -cleanup {
+ destroy .t.f
+} -result {-family -family}
-test font-18.1 {FreeFontObjProc} testfont {
+
+test font-18.1 {FreeFontObjProc} -constraints testfont -setup {
destroy .b1
+ set result {}
+} -body {
set x [format {Courier 12}]
button .b1 -font $x
set y [format {Courier 12}]
.b1 configure -font $y
set z [format {Courier 12}]
.b1 configure -font $z
- set result {}
lappend result [testfont counts {Courier 12}]
set x red
lappend result [testfont counts {Courier 12}]
@@ -627,275 +813,864 @@ test font-18.1 {FreeFontObjProc} testfont {
destroy .b1
lappend result [testfont counts {Courier 12}]
set y bogus
- set result
-} {{{1 3}} {{1 2}} {{1 1}} {}}
+ return $result
+} -result {{{1 3}} {{1 2}} {{1 1}} {}}
+
-test font-19.1 {Tk_FontId} {
- .b.f config -font "times 20"
+test font-19.1 {Tk_FontId} -setup {
+ destroy .t.f
+ pack [label .t.f]
update
-} {}
+} -body {
+ .t.f config -font "times 20"
+ update
+} -cleanup {
+ destroy .t.f
+} -result {}
+
-test font-20.1 {Tk_GetFontMetrics procedure} {
- button .b.w1 -text abc
- entry .b.w2 -text abcd
+test font-20.1 {Tk_GetFontMetrics procedure} -setup {
+ destroy .t.w1 .t.w2
+} -body {
+ button .t.w1 -text abc
+ entry .t.w2 -text abcd
update
- destroy .b.w1 .b.w2
-} {}
+ destroy .t.w1 .t.w2
+} -result {}
+
+# Procedure used in 21.* tests
proc psfontname {name} {
- set a [.b.c itemcget text -font]
- .b.c itemconfig text -text "We need text" -font $name
- set post [.b.c postscript]
- .b.c itemconfig text -font $a
+ destroy .t.c
+ canvas .t.c -closeenough 0
+ .t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+ pack .t.c
+ update
+ set a [.t.c itemcget text -font]
+ .t.c itemconfig text -text "We need text" -font $name
+ set post [.t.c postscript]
+ .t.c itemconfig text -font $a
set end [string first "findfont" $post]
incr end -2
set post [string range $post [expr $end-70] $end]
set start [string first "gsave" $post]
+ destroy .t.c
return [string range $post [expr $start+7] end]
}
-test font-21.1 {Tk_PostscriptFontName procedure: native} unix {
+test font-21.1 {Tk_PostscriptFontName procedure: native} -constraints {
+ unix
+} -body {
set x [font actual {{itc avant garde} 10} -family]
if {[string match *avant*garde $x]} {
- psfontname "{itc avant garde} 10"
+ psfontname "{itc avant garde} 10"
} else {
- set x {AvantGarde-Book}
+ set x {AvantGarde-Book}
}
-} {AvantGarde-Book}
-test font-21.2 {Tk_PostscriptFontName procedure: native} win {
+} -result {AvantGarde-Book}
+test font-21.2 {Tk_PostscriptFontName procedure: native} -constraints {
+ win
+} -body {
psfontname "arial 10"
-} {Helvetica}
-test font-21.3 {Tk_PostscriptFontName procedure: native} win {
+} -result {Helvetica}
+test font-21.3 {Tk_PostscriptFontName procedure: native} -constraints {
+ win
+} -body {
psfontname "{times new roman} 10"
-} {Times-Roman}
-test font-21.4 {Tk_PostscriptFontName procedure: native} win {
+} -result {Times-Roman}
+test font-21.4 {Tk_PostscriptFontName procedure: native} -constraints {
+ win
+} -body {
psfontname "{courier new} 10"
-} {Courier}
-test font-21.8 {Tk_PostscriptFontName procedure: spaces} unix {
+} -result {Courier}
+test font-21.5 {Tk_PostscriptFontName procedure: spaces} -constraints {
+ unix
+} -body {
set x [font actual {{lucida bright} 10} -family]
if {[string match lucida*bright $x]} {
- psfontname "{lucida bright} 10"
+ psfontname "{lucida bright} 10"
} else {
- set x {LucidaBright}
+ set x {LucidaBright}
}
-} {LucidaBright}
-test font-21.9 {Tk_PostscriptFontName procedure: spaces} unix {
+} -result {LucidaBright}
+test font-21.6 {Tk_PostscriptFontName procedure: spaces} -constraints {
+ unix
+} -body {
psfontname "{new century schoolbook} 10"
-} {NewCenturySchlbk-Roman}
-set i 10
-foreach p {
- {font-21.10 "avantgarde"
- AvantGarde-Book AvantGarde-Demi
- AvantGarde-BookOblique AvantGarde-DemiOblique}
- {font-21.11 "bookman"
- Bookman-Light Bookman-Demi Bookman-LightItalic Bookman-DemiItalic}
- {font-21.12 "courier"
- Courier Courier-Bold Courier-Oblique Courier-BoldOblique}
- {font-21.13 "helvetica"
- Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique}
- {font-21.14 "new century schoolbook"
- NewCenturySchlbk-Roman NewCenturySchlbk-Bold
- NewCenturySchlbk-Italic NewCenturySchlbk-BoldItalic}
- {font-21.15 "palatino"
- Palatino-Roman Palatino-Bold Palatino-Italic Palatino-BoldItalic}
- {font-21.16 "symbol"
- Symbol Symbol Symbol Symbol}
- {font-21.17 "times"
- Times-Roman Times-Bold Times-Italic Times-BoldItalic}
- {font-21.18 "zapfchancery"
- ZapfChancery-MediumItalic ZapfChancery-MediumItalic
- ZapfChancery-MediumItalic ZapfChancery-MediumItalic}
- {font-21.19 "zapfdingbats"
- ZapfDingbats ZapfDingbats ZapfDingbats ZapfDingbats}
-} {
- set values [lassign $p testName family]
- test $testName {Tk_PostscriptFontName procedure: exhaustive} unix {
- set x {}
- set j 0
- foreach slant {roman italic} {
- foreach weight {normal bold} {
- set name [list $family 12 $slant $weight]
- if {[font actual $name -family] == $family} {
- lappend x [psfontname $name]
- } else {
- lappend x [lindex $values $j]
- }
- incr j
- }
- }
- set x
- } $values
-}
-foreach p {
- {font-21.20 "arial"
- Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique}
- {font-21.21 "courier new"
- Courier Courier-Bold Courier-Oblique Courier-BoldOblique}
- {font-21.22 "helvetica"
- Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique}
- {font-21.23 "symbol"
- Symbol Symbol-Bold Symbol-Italic Symbol-BoldItalic}
- {font-21.24 "times new roman"
- Times-Roman Times-Bold Times-Italic Times-BoldItalic}
-} {
- set values [lassign $p testName family]
- test $testName {Tk_PostscriptFontName procedure: exhaustive} win {
- set x {}
- foreach slant {roman italic} {
- foreach weight {normal bold} {
- lappend x [psfontname [list $family 12 "$slant $weight"]]
- }
- }
- set x
- } $values
-}
+} -result {NewCenturySchlbk-Roman}
+
+test font-21.7 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {avantgarde 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x AvantGarde-Book
+ }
+} -result {AvantGarde-Book}
+test font-21.8 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {avantgarde 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x AvantGarde-Demi
+ }
+} -result {AvantGarde-Demi}
+test font-21.9 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {avantgarde 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x AvantGarde-BookOblique
+ }
+} -result {AvantGarde-BookOblique}
+test font-21.10 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {avantgarde 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "avantgarde"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x AvantGarde-DemiOblique
+ }
+} -result {AvantGarde-DemiOblique}
+
+test font-21.11 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {bookman 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Bookman-Light
+ }
+} -result {Bookman-Light}
+test font-21.12 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {bookman 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Bookman-Demi
+ }
+} -result {Bookman-Demi}
+test font-21.13 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {bookman 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Bookman-LightItalic
+ }
+} -result {Bookman-LightItalic}
+test font-21.14 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {bookman 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "bookman"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Bookman-DemiItalic
+ }
+} -result {Bookman-DemiItalic}
+
+test font-21.15 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {courier 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "courier"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Courier
+ }
+} -result {Courier}
+test font-21.16 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {courier 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "courier"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Courier-Bold
+ }
+} -result {Courier-Bold}
+test font-21.17 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {courier 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "courier"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Courier-Oblique
+ }
+} -result {Courier-Oblique}
+test font-21.18 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {courier 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "courier"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Courier-BoldOblique
+ }
+} -result {Courier-BoldOblique}
+
+test font-21.19 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {helvetica 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Helvetica
+ }
+} -result {Helvetica}
+test font-21.20 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {helvetica 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Helvetica-Bold
+ }
+} -result {Helvetica-Bold}
+test font-21.21 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {helvetica 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Helvetica-Oblique
+ }
+} -result {Helvetica-Oblique}
+test font-21.22 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {helvetica 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "helvetica"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Helvetica-BoldOblique
+ }
+} -result {Helvetica-BoldOblique}
+
+test font-21.23 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {{new century schoolbook} 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x NewCenturySchlbk-Roman
+ }
+} -result {NewCenturySchlbk-Roman}
+test font-21.24 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {{new century schoolbook} 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x NewCenturySchlbk-Bold
+ }
+} -result {NewCenturySchlbk-Bold}
+test font-21.25 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {{new century schoolbook} 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x NewCenturySchlbk-Italic
+ }
+} -result {NewCenturySchlbk-Italic}
+test font-21.26 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {{new century schoolbook} 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "new century schoolbook"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x NewCenturySchlbk-BoldItalic
+ }
+} -result {NewCenturySchlbk-BoldItalic}
+
+test font-21.27 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {palatino 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Palatino-Roman
+ }
+} -result {Palatino-Roman}
+test font-21.28 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {palatino 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Palatino-Bold
+ }
+} -result {Palatino-Bold}
+test font-21.29 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {palatino 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Palatino-Italic
+ }
+} -result {Palatino-Italic}
+test font-21.30 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {palatino 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "palatino"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Palatino-BoldItalic
+ }
+} -result {Palatino-BoldItalic}
+
+test font-21.31 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {symbol 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Symbol
+ }
+} -result {Symbol}
+test font-21.32 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {symbol 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Symbol
+ }
+} -result {Symbol}
+test font-21.33 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {symbol 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Symbol
+ }
+} -result {Symbol}
+test font-21.34 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {symbol 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "symbol"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Symbol
+ }
+} -result {Symbol}
+
+test font-21.35 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {times 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "times"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Times-Roman
+ }
+} -result {Times-Roman}
+test font-21.36 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {times 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "times"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Times-Bold
+ }
+} -result {Times-Bold}
+test font-21.37 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {times 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "times"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Times-Italic
+ }
+} -result {Times-Italic}
+test font-21.38 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {times 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "times"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x Times-BoldItalic
+ }
+} -result {Times-BoldItalic}
+
+test font-21.39 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfchancery 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfChancery-MediumItalic
+ }
+} -result {ZapfChancery-MediumItalic}
+test font-21.40 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfchancery 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfChancery-MediumItalic
+ }
+} -result {ZapfChancery-MediumItalic}
+test font-21.41 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfchancery 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfChancery-MediumItalic
+ }
+} -result {ZapfChancery-MediumItalic}
+test font-21.42 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfchancery 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfchancery"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfChancery-MediumItalic
+ }
+} -result {ZapfChancery-MediumItalic}
+
+test font-21.43 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfdingbats 12 roman normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfDingbats
+ }
+} -result {ZapfDingbats}
+test font-21.44 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfdingbats 12 roman bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfDingbats
+ }
+} -result {ZapfDingbats}
+test font-21.45 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfdingbats 12 italic normal}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfDingbats
+ }
+} -result {ZapfDingbats}
+test font-21.46 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ unix
+} -body {
+ set name {zapfdingbats 12 italic bold}
+ if {[font actual {avantgarde 12 roman normal} -family] == "zapfdingbats"} {
+ set x [psfontname avantgarde 12 roman normal]
+ } else {
+ set x ZapfDingbats
+ }
+} -result {ZapfDingbats}
+
+test font-21.47 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {arial 12 roman normal}]
+} -result {Helvetica}
+test font-21.48 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {arial 12 roman bold}]
+} -result {Helvetica-Bold}
+test font-21.49 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {arial 12 italic normal}]
+} -result {Helvetica-Oblique}
+test font-21.50 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {arial 12 italic bold}]
+} -result {Helvetica-BoldOblique}
+
+test font-21.51 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{courier new} 12 roman normal}]
+} -result {Courier}
+test font-21.52 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{courier new} 12 roman bold}]
+} -result {Courier-Bold}
+test font-21.53 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{courier new} 12 italic normal}]
+} -result {Courier-Oblique}
+test font-21.54 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{courier new} 12 italic bold}]
+} -result {Courier-BoldOblique}
+
+test font-21.55 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {helvetica 12 roman normal}]
+} -result {Helvetica}
+test font-21.56 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {helvetica 12 roman bold}]
+} -result {Helvetica-Bold}
+test font-21.57 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {helvetica 12 italic normal}]
+} -result {Helvetica-Oblique}
+test font-21.58 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {helvetica 12 italic bold}]
+} -result {Helvetica-BoldOblique}
+
+test font-21.59 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {symbol 12 roman normal}]
+} -result {Symbol}
+test font-21.60 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {symbol 12 roman bold}]
+} -result {Symbol-Bold}
+test font-21.61 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {symbol 12 italic normal}]
+} -result {Symbol-Italic}
+test font-21.62 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {symbol 12 italic bold}]
+} -result {Symbol-BoldItalic}
+
+test font-21.63 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{times new roman} 12 roman normal}]
+} -result {Times-Roman}
+test font-21.64 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{times new roman} 12 roman bold}]
+} -result {Times-Bold}
+test font-21.65 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{times new roman} 12 italic normal}]
+} -result {Times-Italic}
+test font-21.66 {Tk_PostscriptFontName procedure: exhaustive} -constraints {
+ win
+} -body {
+ set x [psfontname {{times new roman} 12 italic bold}]
+} -result {Times-BoldItalic}
+
+
+test font-22.1 {Tk_TextWidth procedure} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font "Courier -12"
+ pack .t.l
+ set ax [winfo reqwidth .t.l]
+ expr {[font measure [.t.l cget -font] "000"] eq $ax*3}
+} -cleanup {
+ destroy .t.l
+} -result 1
+
+
+test font-23.1 {Tk_UnderlineChars procedure} -setup {
+ destroy .t.t
+} -body {
+ text .t.t
+ .t.t insert 1.0 abc\tdefg
+ .t.t tag config sel -underline 1
+ .t.t tag add sel 1.0 end
+ update
+} -cleanup {
+ destroy .t.t
+} -result {}
-test font-22.1 {Tk_TextWidth procedure} {
- font measure [.b.l cget -font] "000"
-} [expr $ax*3]
-test font-23.1 {Tk_UnderlineChars procedure} {
- text .b.t
- .b.t insert 1.0 abc\tdefg
- .b.t tag config sel -underline 1
- .b.t tag add sel 1.0 end
- update
-} {}
-
-setup
-test font-24.1 {Tk_ComputeTextLayout: empty string} {
- .b.l config -text ""
-} {}
-test font-24.2 {Tk_ComputeTextLayout: simple string} {
- .b.l config -text "000"
- getsize
-} "[expr $ax*3] $ay"
-test font-24.3 {Tk_ComputeTextLayout: find special chars} {
- .b.l config -text "000\n000"
- getsize
-} "[expr $ax*3] [expr $ay*2]"
-test font-24.4 {Tk_ComputeTextLayout: calls Tk_MeasureChars} {
- .b.l config -text "000\n000"
- getsize
-} "[expr $ax*3] [expr $ay*2]"
-test font-24.5 {Tk_ComputeTextLayout: break line} {
- .b.l config -text "000\t00000" -wrap [expr 9*$ax]
- set x [getsize]
- .b.l config -wrap 0
- set x
-} "[expr 8*$ax] [expr 2*$ay]"
-test font-24.6 {Tk_ComputeTextLayout: normal ended on special char} {
- .b.l config -text "000\n000"
-} {}
-test font-24.7 {Tk_ComputeTextLayout: special char was \n} {
- .b.l config -text "000\n0000"
- getsize
-} "[expr $ax*4] [expr $ay*2]"
-test font-24.8 {Tk_ComputeTextLayout: special char was \t} {
- .b.l config -text "000\t00"
- getsize
-} "[expr $ax*10] $ay"
-test font-24.9 {Tk_ComputeTextLayout: tab didn't cause break} {
+# Data used in 24.* tests
+destroy .t.l
+label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font "Courier -12"
+pack .t.l
+update
+set ax [winfo reqwidth .t.l]
+set ay [winfo reqheight .t.l]
+test font-24.1 {Tk_ComputeTextLayout: empty string} -body {
+ .t.l config -text ""
+} -result {}
+test font-24.2 {Tk_ComputeTextLayout: simple string} -body {
+ .t.l config -text "000"
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}] \
+ [expr {[winfo reqheight .t.l] eq $ay}]
+} -result {1 1}
+test font-24.3 {Tk_ComputeTextLayout: find special chars} -body {
+ .t.l config -text "000\n000"
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}] \
+ [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+} -result {1 1}
+test font-24.4 {Tk_ComputeTextLayout: calls Tk_MeasureChars} -body {
+ .t.l config -text "000\n000"
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}] \
+ [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+} -result {1 1}
+test font-24.5 {Tk_ComputeTextLayout: break line} -body {
+ .t.l config -text "000\t00000" -wrap [expr 9 * $ax]
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 8}]}] \
+ [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+} -cleanup {
+ .t.l config -wrap 0
+} -result {1 1}
+test font-24.6 {Tk_ComputeTextLayout: normal ended on special char} -body {
+ .t.l config -text "000\n000"
+} -result {}
+test font-24.7 {Tk_ComputeTextLayout: special char was \n} -body {
+ .t.l config -text "000\n0000"
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 4}]}] \
+ [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+} -result {1 1}
+test font-24.8 {Tk_ComputeTextLayout: special char was \t} -body {
+ .t.l config -text "000\t00"
+ update
+ list [expr {[winfo reqwidth .t.l] eq [expr {$ax * 10}]}] \
+ [expr {[winfo reqheight .t.l] eq $ay}]
+} -result {1 1}
+test font-24.9 {Tk_ComputeTextLayout: tab didn't cause break} -body {
set x {}
- .b.l config -text "000\t000"
- lappend x [getsize]
- .b.l config -text "000\t000" -wrap [expr 100*$ax]
- lappend x [getsize]
- .b.l config -wrap 0
- set x
-} "{[expr $ax*11] $ay} {[expr $ax*11] $ay}"
-test font-24.10 {Tk_ComputeTextLayout: tab caused break} {
+ .t.l config -text "000\t000"
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 11}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq $ay}]
+ .t.l config -text "000\t000" -wrap [expr 100 * $ax]
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 11}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq $ay}]
+ return $x
+} -cleanup {
+ .t.l config -wrap 0
+} -result {1 1 1 1}
+test font-24.10 {Tk_ComputeTextLayout: tab caused break} -body {
set x {}
- .b.l config -text "000\t"
- lappend x [getsize]
- .b.l config -text "000\t00" -wrap [expr $ax*6]
- lappend x [getsize]
- .b.l config -wrap 0
- set x
-} "{[expr $ax*3] $ay} {[expr $ax*3] [expr $ay*2]}"
-test font-24.11 {Tk_ComputeTextLayout: absorb spaces at eol} {
+ .t.l config -text "000\t"
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq $ay}]
+ .t.l config -text "000\t00" -wrap [expr $ax * 6]
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+ return $x
+} -cleanup {
+ .t.l config -wrap 0
+} -result {1 1 1 1}
+test font-24.11 {Tk_ComputeTextLayout: absorb spaces at eol} -body {
set x {}
- .b.l config -text "000 000" -wrap [expr $ax*5]
- lappend x [getsize]
- .b.l config -text "000 "
- lappend x [getsize]
- .b.l config -wrap 0
- set x
-} "{[expr $ax*3] [expr $ay*2]} {[expr $ax*3] $ay}"
-test font-24.12 {Tk_ComputeTextLayout: append non-printing spaces to chunk} {
+ .t.l config -text "000 000" -wrap [expr {$ax * 5}]
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+ .t.l config -text "000 "
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq $ay}]
+ return $x
+} -cleanup {
+ .t.l config -wrap 0
+} -result {1 1 1 1}
+test font-24.12 {Tk_ComputeTextLayout: append non-printing spaces to chunk} -body {
set x {}
- .b.l config -text "000 0000" -wrap [expr $ax*5]
- lappend x [getsize]
- .b.l config -text "000\t00 0000" -wrap [expr $ax*12]
- lappend x [getsize]
- .b.l config -wrap 0
- set x
-} "{[expr $ax*4] [expr $ay*2]} {[expr $ax*10] [expr $ay*2]}"
-test font-24.13 {Tk_ComputeTextLayout: many lines -> realloc line array} {
- .b.l config -text "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
- getsize
-} "1 [expr $ay*129]"
-test font-24.14 {Tk_ComputeTextLayout: text ended with \n} {
- list [.b.l config -text "0000"; getsize] [.b.l config -text "0000\n"; getsize]
-} "{[expr $ax*4] $ay} {[expr $ax*4] [expr $ay*2]}"
-test font-24.15 {Tk_ComputeTextLayout: justification} {
- csetup "000\n00000"
+ .t.l config -text "000 0000" -wrap [expr {$ax * 5}]
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 4}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+ .t.l config -text "000\t00 0000" -wrap [expr {$ax * 12}]
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 10}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+ return $x
+} -cleanup {
+ .t.l config -wrap 0
+} -result {1 1 1 1}
+test font-24.13 {Tk_ComputeTextLayout: many lines -> realloc line array} -body {
+ .t.l config -text "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
+ update
+ list [expr {[winfo reqwidth .t.l] eq 1}] \
+ [expr {[winfo reqheight .t.l] eq [expr {$ay * 129}]}]
+} -result {1 1}
+test font-24.14 {Tk_ComputeTextLayout: text ended with \n} -body {
+ set x {}
+ .t.l config -text "0000"
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 4}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq $ay}]
+ .t.l config -text "0000\n"
+ update
+ lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 4}]}]
+ lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}]
+ return $x
+} -result {1 1 1 1}
+destroy .t.l
+
+test font-24.15 {Tk_ComputeTextLayout: justification} -setup {
set x {}
- .b.c itemconfig text -just left
- lappend x [.b.c index text @[expr $ax*2],0]
- .b.c itemconfig text -just center
- lappend x [.b.c index text @[expr $ax*2],0]
- .b.c itemconfig text -just right
- lappend x [.b.c index text @[expr $ax*2],0]
- .b.c itemconfig text -just left
- set x
-} {2 1 0}
-
-test font-25.1 {Tk_FreeTextLayout procedure} {
- setup
- .b.f config -text foo
- .b.f config -text boo
-} {}
+ destroy .t.c
+ canvas .t.c -closeenough 0
+ .t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+ pack .t.c
+ update
+} -body {
+ csetup "000\n00000"
+ .t.c itemconfig text -just left
+ lappend x [.t.c index text @[expr $ax*2],0]
+ .t.c itemconfig text -just center
+ lappend x [.t.c index text @[expr $ax*2],0]
+ .t.c itemconfig text -just right
+ lappend x [.t.c index text @[expr $ax*2],0]
+ .t.c itemconfig text -just left
+ return $x
+} -cleanup {
+ destroy .t.c
+} -result {2 1 0}
+
+
+test font-25.1 {Tk_FreeTextLayout procedure} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
+ .t.f config -text foo
+ .t.f config -text boo
+} -cleanup {
+ destroy .t.f
+} -result {}
-test font-26.1 {Tk_DrawTextLayout procedure: auto-detect last char} {
- .b.f config -text foo
-} {}
-test font-26.2 {Tk_DrawTextLayout procedure: multiple chunks} {
+
+# Canvas created for tests: 26.*
+destroy .t.c
+canvas .t.c -closeenough 0
+.t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+pack .t.c
+update
+test font-26.1 {Tk_DrawTextLayout procedure: auto-detect last char} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
+ .t.f config -text foo
+} -cleanup {
+ destroy .t.f
+} -result {}
+test font-26.2 {Tk_DrawTextLayout procedure: multiple chunks} -body {
csetup "000\t00\n000"
-} {}
-test font-26.3 {Tk_DrawTextLayout: draw subset of chunk: numDisplay <= 0} {
+} -result {}
+test font-26.3 {Tk_DrawTextLayout: draw subset of chunk: numDisplay <= 0} -body {
csetup "000\t00"
- .b.c select from text 3
- .b.c select to text 5
-} {}
-test font-26.4 {Tk_DrawTextLayout: draw subset of chunk: firstChar <= 0} {
- .b.c select from text 3
- .b.c select to text 5
-} {}
-test font-26.5 {Tk_DrawTextLayout: draw subset of chunk: firstChar > 0} {
- .b.c select from text 2
- .b.c select to text 2
-} {}
-test font-26.6 {Tk_DrawTextLayout: draw subset of chunk: lastChar < numChars} {
- .b.c select from text 4
- .b.c select to text 4
-} {}
-
-test font-27.1 {Tk_UnderlineTextLayout procedure: no underline chosen} {
- .b.f config -text "foo" -under -1
-} {}
-test font-27.2 {Tk_UnderlineTextLayout procedure: underline not visible} {
- .b.f config -text "000 00000" -wrap [expr $ax*7] -under 10
-} {}
-test font-27.3 {Tk_UnderlineTextLayout procedure: underline is visible} {
- .b.f config -text "000 00000" -wrap [expr $ax*7] -under 5
- .b.f config -wrap -1 -under -1
-} {}
-
-test font-28.1 {Tk_PointToChar procedure: above all lines} {
+ .t.c select from text 3
+ .t.c select to text 5
+} -result {}
+test font-26.4 {Tk_DrawTextLayout: draw subset of chunk: firstChar <= 0} -body {
+ csetup "000\t00"
+ .t.c select from text 3
+ .t.c select to text 5
+} -result {}
+test font-26.5 {Tk_DrawTextLayout: draw subset of chunk: firstChar > 0} -body {
+ csetup "000\t00"
+ .t.c select from text 2
+ .t.c select to text 2
+} -result {}
+test font-26.6 {Tk_DrawTextLayout: draw subset of chunk: lastChar < numChars} -body {
+ csetup "000\t00"
+ .t.c select from text 4
+ .t.c select to text 4
+} -result {}
+destroy .t.c
+
+# Label used in 27.* tests
+destroy .t.f
+pack [label .t.f]
+update
+test font-27.1 {Tk_UnderlineTextLayout procedure: no underline chosen} -body {
+ .t.f config -text "foo" -under -1
+} -result {}
+test font-27.2 {Tk_UnderlineTextLayout procedure: underline not visible} -body {
+ .t.f config -text "000 00000" -wrap [expr $ax*7] -under 10
+} -result {}
+test font-27.3 {Tk_UnderlineTextLayout procedure: underline is visible} -body {
+ .t.f config -text "000 00000" -wrap [expr $ax*7] -under 5
+ .t.f config -wrap -1 -under -1
+} -result {}
+destroy .t.f
+
+
+
+# Canvas created for tests: 28.*
+destroy .t.c
+canvas .t.c -closeenough 0
+.t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+pack .t.c
+update
+test font-28.1 {Tk_PointToChar procedure: above all lines} -body {
csetup "000"
- .b.c index text @-1,0
-} {0}
-test font-28.2 {Tk_PointToChar procedure: no chars} {
+ .t.c index text @-1,0
+} -result {0}
+test font-28.2 {Tk_PointToChar procedure: no chars} -body {
# After fixing the following bug:
#
# In canvas text item, it was impossible to click to position the
@@ -905,206 +1680,277 @@ test font-28.2 {Tk_PointToChar procedure: no chars} {
# index of 1 if TextLayout contained 0 characters.
csetup ""
- .b.c index text @100,100
-} {0}
-test font-28.3 {Tk_PointToChar procedure: loop test} {
+ .t.c index text @100,100
+} -result {0}
+test font-28.3 {Tk_PointToChar procedure: loop test} -body {
csetup "000\n000\n000\n000"
- .b.c index text @10000,0
-} {3}
-test font-28.4 {Tk_PointToChar procedure: intersect line} {
+ .t.c index text @10000,0
+} -result {3}
+test font-28.4 {Tk_PointToChar procedure: intersect line} -body {
csetup "000\n000\n000"
- .b.c index text @0,$ay
-} {4}
-test font-28.5 {Tk_PointToChar procedure: to the left of all chunks} {
- .b.c index text @-100,$ay
-} {4}
-test font-28.6 {Tk_PointToChar procedure: past any possible chunk} {
- .b.c index text @100000,$ay
-} {7}
-test font-28.7 {Tk_PointToChar procedure: which chunk on this line} {
+ .t.c index text @0,$ay
+} -result {4}
+test font-28.5 {Tk_PointToChar procedure: to the left of all chunks} -body {
+ csetup "000\n000\n000"
+ .t.c index text @-100,$ay
+} -result {4}
+test font-28.6 {Tk_PointToChar procedure: past any possible chunk} -body {
+ csetup "000\n000\n000"
+ .t.c index text @100000,$ay
+} -result {7}
+test font-28.7 {Tk_PointToChar procedure: which chunk on this line} -body {
csetup "000\n000\t000\t000\n000"
- .b.c index text @[expr $ax*2],$ay
-} {6}
-test font-28.8 {Tk_PointToChar procedure: which chunk on this line} {
+ .t.c index text @[expr $ax*2],$ay
+} -result {6}
+test font-28.8 {Tk_PointToChar procedure: which chunk on this line} -body {
csetup "000\n000\t000\t000\n000"
- .b.c index text @[expr $ax*10],$ay
-} {10}
-test font-28.9 {Tk_PointToChar procedure: in special chunk} {
+ .t.c index text @[expr $ax*10],$ay
+} -result {10}
+test font-28.9 {Tk_PointToChar procedure: in special chunk} -body {
csetup "000\n000\t000\t000\n000"
- .b.c index text @[expr $ax*6],$ay
-} {7}
-test font-28.10 {Tk_PointToChar procedure: past all chars in chunk} {
+ .t.c index text @[expr $ax*6],$ay
+} -result {7}
+test font-28.10 {Tk_PointToChar procedure: past all chars in chunk} -body {
csetup "000 0000000"
- .b.c itemconfig text -width [expr $ax*5]
- set x [.b.c index text @[expr $ax*5],0]
- .b.c itemconfig text -width 0
- set x
-} {3}
-test font-28.11 {Tk_PointToChar procedure: below all chunks} {
+ .t.c itemconfig text -width [expr $ax*5]
+ set x [.t.c index text @[expr $ax*5],0]
+ .t.c itemconfig text -width 0
+ return $x
+} -result {3}
+test font-28.11 {Tk_PointToChar procedure: below all chunks} -body {
csetup "000 0000000"
- .b.c index text @0,1000000
-} {11}
-
-test font-29.1 {Tk_CharBBox procedure: index < 0} {
- .b.f config -text "000" -underline -1
-} {}
-test font-29.2 {Tk_CharBBox procedure: loop} {
- .b.f config -text "000\t000\t000\t000" -underline 9
-} {}
-test font-29.3 {Tk_CharBBox procedure: special char} {
- .b.f config -text "000\t000\t000" -underline 7
-} {}
-test font-29.4 {Tk_CharBBox procedure: normal char} {
- .b.f config -text "000" -underline 1
-} {}
-test font-29.5 {Tk_CharBBox procedure: right edge of bbox truncated} {
- .b.f config -text "0 0000" -wrap [expr $ax*4] -under 2
- .b.f config -wrap 0
-} {}
-test font-29.6 {Tk_CharBBox procedure: bbox pegged to right edge} {
- .b.f config -text "0 0000" -wrap [expr $ax*4] -under 3
- .b.f config -wrap 0
-} {}
-
-.b.c bind all <Enter> {lappend x [.b.c index current @%x,%y]}
-
-test font-30.1 {Tk_DistanceToTextLayout procedure: loop once} {
+ .t.c index text @0,1000000
+} -result {11}
+destroy .t.c
+
+
+# Label used in 29.* tests
+destroy .t.f
+pack [label .t.f]
+update
+test font-29.1 {Tk_CharBBox procedure: index < 0} -body {
+ .t.f config -text "000" -underline -1
+} -result {}
+test font-29.2 {Tk_CharBBox procedure: loop} -body {
+ .t.f config -text "000\t000\t000\t000" -underline 9
+} -result {}
+test font-29.3 {Tk_CharBBox procedure: special char} -body {
+ .t.f config -text "000\t000\t000" -underline 7
+} -result {}
+test font-29.4 {Tk_CharBBox procedure: normal char} -body {
+ .t.f config -text "000" -underline 1
+} -result {}
+test font-29.5 {Tk_CharBBox procedure: right edge of bbox truncated} -body {
+ .t.f config -text "0 0000" -wrap [expr $ax*4] -under 2
+ .t.f config -wrap 0
+} -result {}
+test font-29.6 {Tk_CharBBox procedure: bbox pegged to right edge} -body {
+ .t.f config -text "0 0000" -wrap [expr $ax*4] -under 3
+ .t.f config -wrap 0
+} -result {}
+destroy .t.f
+
+
+
+# Canvas created for tests: 30.*
+destroy .t.c
+canvas .t.c -closeenough 0
+.t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+pack .t.c
+update
+test font-30.1 {Tk_DistanceToTextLayout procedure: loop once} -body {
csetup "000\n000\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x 0 -y 0
- set x
-} {0}
-test font-30.2 {Tk_DistanceToTextLayout procedure: loop multiple} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x 0 -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {0}
+test font-30.2 {Tk_DistanceToTextLayout procedure: loop multiple} -body {
csetup "000\n000\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x $ax -y $ay
- set x
-} {5}
-test font-30.3 {Tk_DistanceToTextLayout procedure: loop to end} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x $ax -y $ay
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {5}
+test font-30.3 {Tk_DistanceToTextLayout procedure: loop to end} -body {
csetup "000\n0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x [expr $ax*2] -y $ay
- set x
-} {}
-test font-30.4 {Tk_DistanceToTextLayout procedure: hit a special char (tab)} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x [expr $ax*2] -y $ay
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.4 {Tk_DistanceToTextLayout procedure: hit a special char (tab)} -body {
csetup "000\t000\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x [expr $ax*6] -y 0
- set x
-} {3}
-test font-30.5 {Tk_DistanceToTextLayout procedure: ignore newline} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x [expr $ax*6] -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {3}
+test font-30.5 {Tk_DistanceToTextLayout procedure: ignore newline} -body {
csetup "000\n0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x [expr $ax*2] -y $ay
- set x
-} {}
-test font-30.6 {Tk_DistanceToTextLayout procedure: ignore spaces at eol} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x [expr $ax*2] -y $ay
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.6 {Tk_DistanceToTextLayout procedure: ignore spaces at eol} -body {
csetup "000\n000 000000000"
- .b.c itemconfig text -width [expr $ax*10]
+ .t.c itemconfig text -width [expr $ax*10]
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x [expr $ax*5] -y $ay
- .b.c itemconfig text -width 0
- set x
-} {}
-.b.c itemconfig text -justify center
-test font-30.7 {Tk_DistanceToTextLayout procedure: on left side} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x [expr $ax*5] -y $ay
+ .t.c itemconfig text -width 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+.t.c itemconfig text -justify center
+test font-30.7 {Tk_DistanceToTextLayout procedure: on left side} -body {
csetup "0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x 0 -y 0
- set x
-} {}
-test font-30.8 {Tk_DistanceToTextLayout procedure: on right side} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x 0 -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.8 {Tk_DistanceToTextLayout procedure: on right side} -body {
csetup "0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x [expr $ax*2] -y 0
- set x
-} {}
-test font-30.9 {Tk_DistanceToTextLayout procedure: inside line} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x [expr $ax*2] -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.9 {Tk_DistanceToTextLayout procedure: inside line} -body {
csetup "0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x $ax -y 0
- set x
-} {0}
-test font-30.10 {Tk_DistanceToTextLayout procedure: above line} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x $ax -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {0}
+test font-30.10 {Tk_DistanceToTextLayout procedure: above line} -body {
csetup "0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x 0 -y 0
- set x
-} {}
-test font-30.11 {Tk_DistanceToTextLayout procedure: below line} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x 0 -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.11 {Tk_DistanceToTextLayout procedure: below line} -body {
csetup "000\n0"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x 0 -y $ay
- set x
-} {}
-test font-30.12 {Tk_DistanceToTextLayout procedure: in line} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x 0 -y $ay
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {}
+test font-30.12 {Tk_DistanceToTextLayout procedure: in line} -body {
csetup "0\n000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x $ax -y $ay
- set x
-} {3}
-.b.c itemconfig text -justify left
-test font-30.13 {Tk_DistanceToTextLayout procedure: exact hit} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x $ax -y $ay
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {3}
+.t.c itemconfig text -justify left
+test font-30.13 {Tk_DistanceToTextLayout procedure: exact hit} -body {
csetup "000"
+ .t.c bind all <Enter> {lappend x [.t.c index current @%x,%y]}
set x {}
- event generate .b.c <Leave>
- event generate .b.c <Enter> -x $ax -y 0
- set x
-} {1}
-
-test font-31.1 {Tk_IntersectTextLayout procedure: loop once} {
+ event generate .t.c <Leave>
+ event generate .t.c <Enter> -x $ax -y 0
+ return $x
+} -cleanup {
+ bind all <Enter> {}
+} -result {1}
+destroy .t.c
+
+
+# Canvas created for tests 31.*
+destroy .t.c
+canvas .t.c -closeenough 0
+.t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+pack .t.c
+update
+test font-31.1 {Tk_IntersectTextLayout procedure: loop once} -body {
csetup "000\n000\n000"
- .b.c find overlapping 0 0 0 0
-} [.b.c find withtag text]
-test font-31.2 {Tk_IntersectTextLayout procedure: loop multiple} {
+ .t.c find overlapping 0 0 0 0
+} -result [.t.c find withtag text]
+test font-31.2 {Tk_IntersectTextLayout procedure: loop multiple} -body {
csetup "000\t000\t000"
- .b.c find overlapping [expr $ax*10] 0 [expr $ax*10] 0
-} [.b.c find withtag text]
-test font-31.3 {Tk_IntersectTextLayout procedure: loop to end} {
+ .t.c find overlapping [expr $ax*10] 0 [expr $ax*10] 0
+} -result [.t.c find withtag text]
+test font-31.3 {Tk_IntersectTextLayout procedure: loop to end} -body {
csetup "0\n000"
- .b.c find overlapping [expr $ax*2] 0 [expr $ax*2] 0
-} {}
-test font-31.4 {Tk_IntersectTextLayout procedure: hit a special char (tab)} {
+ .t.c find overlapping [expr $ax*2] 0 [expr $ax*2] 0
+} -result {}
+test font-31.4 {Tk_IntersectTextLayout procedure: hit a special char (tab)} -body {
csetup "000\t000"
- .b.c find overlapping [expr $ax*6] 0 [expr $ax*6] 0
-} [.b.c find withtag text]
-test font-31.5 {Tk_IntersectTextLayout procedure: ignore newlines} {
+ .t.c find overlapping [expr $ax*6] 0 [expr $ax*6] 0
+} -result [.t.c find withtag text]
+test font-31.5 {Tk_IntersectTextLayout procedure: ignore newlines} -body {
csetup "000\n0\n000"
- .b.c find overlapping $ax $ay $ax $ay
-} {}
-test font-31.6 {Tk_IntersectTextLayout procedure: ignore spaces at eol} {
+ .t.c find overlapping $ax $ay $ax $ay
+} -result {}
+test font-31.6 {Tk_IntersectTextLayout procedure: ignore spaces at eol} -body {
csetup "000\n000 000000000"
- .b.c itemconfig text -width [expr $ax*10]
- set x [.b.c find overlapping [expr $ax*5] $ay [expr $ax*5] $ay]
- .b.c itemconfig text -width 0
- set x
-} {}
-
-test font-32.1 {Tk_TextLayoutToPostscript: ensure buffer doesn't overflow} {
+ .t.c itemconfig text -width [expr $ax*10]
+ set x [.t.c find overlapping [expr $ax*5] $ay [expr $ax*5] $ay]
+ .t.c itemconfig text -width 0
+ return $x
+} -result {}
+destroy .t.c
+
+
+test font-32.1 {Tk_TextLayoutToPostscript: ensure buffer doesn't overflow} -setup {
+ destroy .t.c
+ canvas .t.c -closeenough 0
+ .t.c create text 0 0 -tags text -anchor nw -just left -font "Courier -12"
+ pack .t.c
+ update
+} -body {
# If there were a whole bunch of returns or tabs in a row, then the
# temporary buffer could overflow and write on the stack.
-
csetup "qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm\n"
- .b.c itemconfig text -width 800
- .b.c insert text end "qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm\n"
- .b.c insert text end "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
- .b.c insert text end "end"
- set x [.b.c postscript]
+ .t.c itemconfig text -width 800
+ .t.c insert text end "qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm\n"
+ .t.c insert text end "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
+ .t.c insert text end "end"
+ set x [.t.c postscript]
set i [string first "(qwerty" $x]
string range $x $i [expr {$i + 278}]
-} {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
+} -cleanup {
+ destroy .t.c
+} -result {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
[(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
[()]
[()]
@@ -1139,248 +1985,372 @@ test font-32.1 {Tk_TextLayoutToPostscript: ensure buffer doesn't overflow} {
[(end)]
}
-test font-33.1 {Tk_TextWidth procedure} {
-} {}
-test font-34.1 {ConfigAttributesObj procedure: arguments} {
+test font-33.1 {Tk_TextWidth procedure} -body {
+} -result {}
+
+
+test font-34.1 {ConfigAttributesObj procedure: arguments} -setup {
+ catch {font delete xyz}
+} -body {
# (Tcl_GetIndexFromObj() != TCL_OK)
- setup
- list [catch {font create xyz -xyz} msg] $msg
-} {1 {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
-test font-34.2 {ConfigAttributesObj procedure: arguments} {
+ font create xyz -xyz
+} -returnCodes {
+ error
+} -result {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}
+test font-34.2 {ConfigAttributesObj procedure: arguments} -setup {
+ catch {font delete xyz}
+} -body {
# (objc & 1)
- setup
- list [catch {font create xyz -family} msg] $msg
-} {1 {value for "-family" option missing}}
-foreach p {
- {font-34.3 family xyz times}
- {font-34.4 size 20 40}
- {font-34.5 weight normal bold}
- {font-34.6 slant roman italic}
- {font-34.7 underline 0 1}
- {font-34.8 overstrike 0 1}
-} {
- lassign $p testName opt val1 val2
- test $testName "ConfigAttributesObj procedure: $opt" {
- setup
- set x {}
- font create xyz -$opt $val1
- lappend x [font config xyz -$opt]
- font config xyz -$opt $val2
- lappend x [font config xyz -$opt]
- } [list $val1 $val2]
-}
-foreach p {
- {font-34.9 size xyz {expected integer but got "xyz"}}
- {font-34.10 weight xyz {bad -weight value "xyz": must be normal, or bold}}
- {font-34.11 slant xyz {bad -slant value "xyz": must be roman, or italic}}
- {font-34.12 underline xyz {expected boolean value but got "xyz"}}
- {font-34.13 overstrike xyz {expected boolean value but got "xyz"}}
-} {
- lassign $p testName opt val result
- test $testName "ConfigAttributesObj procedure: $opt" -setup {
- setup
- } -body {
- font create xyz -$opt $val
- } -returnCodes error -result $result
-}
+ font create xyz -family
+} -returnCodes error -result {value for "-family" option missing}
-test font-35.1 {GetAttributeInfoObj procedure: one attribute} {
+test font-34.3 {ConfigAttributesObj procedure: family} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -family xyz
+ lappend x [font config xyz -family]
+ font config xyz -family times
+ lappend x [font config xyz -family]
+} -cleanup {
+ font delete xyz
+} -result {xyz times}
+test font-34.4 {ConfigAttributesObj procedure: size} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -size 20
+ lappend x [font config xyz -size]
+ font config xyz -size 40
+ lappend x [font config xyz -size]
+} -cleanup {
+ font delete xyz
+} -result {20 40}
+test font-34.5 {ConfigAttributesObj procedure: weight} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -weight normal
+ lappend x [font config xyz -weight]
+ font config xyz -weight bold
+ lappend x [font config xyz -weight]
+} -cleanup {
+ font delete xyz
+} -result {normal bold}
+test font-34.6 {ConfigAttributesObj procedure: slant} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -slant roman
+ lappend x [font config xyz -slant]
+ font config xyz -slant italic
+ lappend x [font config xyz -slant]
+} -cleanup {
+ font delete xyz
+} -result {roman italic}
+test font-34.7 {ConfigAttributesObj procedure: underline} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -underline 0
+ lappend x [font config xyz -underline]
+ font config xyz -underline 1
+ lappend x [font config xyz -underline]
+} -cleanup {
+ font delete xyz
+} -result {0 1}
+test font-34.8 {ConfigAttributesObj procedure: overstrike} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -overstrike 0
+ lappend x [font config xyz -overstrike]
+ font config xyz -overstrike 1
+ lappend x [font config xyz -overstrike]
+} -cleanup {
+ font delete xyz
+} -result {0 1}
+
+test font-34.9 {ConfigAttributesObj procedure: size} -body {
+ font create xyz -size xyz
+} -returnCodes error -result {expected integer but got "xyz"}
+test font-34.10 {ConfigAttributesObj procedure: weight} -body {
+ font create xyz -weight xyz
+} -returnCodes error -result {bad -weight value "xyz": must be normal, or bold}
+test font-34.11 {ConfigAttributesObj procedure: slant} -body {
+ font create xyz -slant xyz
+} -returnCodes error -result {bad -slant value "xyz": must be roman, or italic}
+test font-34.12 {ConfigAttributesObj procedure: underline} -body {
+ font create xyz -underline xyz
+} -returnCodes error -result {expected boolean value but got "xyz"}
+test font-34.13 {ConfigAttributesObj procedure: overstrike} -body {
+ font create xyz -overstrike xyz
+} -returnCodes error -result {expected boolean value but got "xyz"}
+
+
+test font-35.1 {GetAttributeInfoObj procedure: one attribute} -setup {
+ catch {font delete xyz}
+} -body {
# (objPtr != NULL)
- setup
font create xyz -family xyz
font config xyz -family
-} {xyz}
+} -cleanup {
+ font delete xyz
+} -result {xyz}
+
-test font-36.1 {GetAttributeInfoObj procedure: unknown attribute} {
+test font-36.1 {GetAttributeInfoObj procedure: unknown attribute} -setup {
+ catch {font delete xyz}
+} -body {
# (Tcl_GetIndexFromObj() != TCL_OK)
- setup
font create xyz
- list [catch {font config xyz -xyz} msg] $msg
-} {1 {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}}
-
-test font-37.1 {GetAttributeInfoObj procedure: all attributes} {
- # not (objPtr != NULL)
- setup
+ font config xyz -xyz
+} -cleanup {
+ font delete xyz
+} -returnCodes {
+ error
+} -result {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}
+
+
+test font-37.1 {GetAttributeInfoObj procedure: all attributes} -setup {
+ catch {font delete xyz}
+} -body {
+ # not (objPtr != NULL)
font create xyz -family xyz
font config xyz
-} {-family xyz -size 0 -weight normal -slant roman -underline 0 -overstrike 0}
-set i 4
-foreach p {
- {font-37.2 family xyz xyz}
- {font-37.3 size 20 20}
- {font-37.4 weight normal normal}
- {font-37.5 slant italic italic}
- {font-37.6 underline yes 1}
- {font-37.7 overstrike false 0}
-} {
- lassign $p testName opt val expected
- test $testName "GetAttributeInfo procedure: $opt" -setup {
- setup
- } -body {
- font create xyz -$opt $val
- font config xyz -$opt
- } -result $expected
-}
+} -cleanup {
+ font delete xyz
+} -result {-family xyz -size 0 -weight normal -slant roman -underline 0 -overstrike 0}
+test font-37.2 {GetAttributeInfo procedure: family} -setup {
+ catch {font delete xyz}
+} -body {
+ font create xyz -family xyz
+ font config xyz -family
+} -cleanup {
+ font delete xyz
+} -result {xyz}
+test font-37.3 {GetAttributeInfo procedure: size} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -size 20
+ font config xyz -size
+} -cleanup {
+ font delete xyz
+} -result {20}
+test font-37.4 {GetAttributeInfo procedure: weight} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -weight normal
+ font config xyz -weight
+} -cleanup {
+ font delete xyz
+} -result {normal}
+test font-37.5 {GetAttributeInfo procedure: slant} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -slant italic
+ font config xyz -slant
+} -cleanup {
+ font delete xyz
+} -result {italic}
+test font-37.6 {GetAttributeInfo procedure: underline} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -underline yes
+ font config xyz -underline
+} -cleanup {
+ font delete xyz
+} -result {1}
+test font-37.7 {GetAttributeInfo procedure: overstrike} -setup {
+ catch {font delete xyz}
+ set x {}
+} -body {
+ font create xyz -overstrike no
+ font config xyz -overstrike
+} -cleanup {
+ font delete xyz
+} -result {0}
+
# In tests below, one field is set to "xyz" so that font name doesn't
# look like a native X font, so that ParseFontNameObj or TkParseXLFD will
# be called.
-setup
-
-test font-38.1 {ParseFontNameObj procedure: begins with -} {
+test font-38.1 {ParseFontNameObj procedure: begins with -} -body {
lindex [font actual -xyz-times-*-*-*-*-*-*-*-*-*-*-*-*] 1
-} $times
-test font-38.2 {ParseFontNameObj procedure: begins with -*} {
+} -result [font actual {times 0} -family]
+test font-38.2 {ParseFontNameObj procedure: begins with -*} -body {
lindex [font actual -*-times-xyz-*-*-*-*-*-*-*-*-*-*-*] 1
-} $times
-test font-38.3 {ParseFontNameObj procedure: begins with -, doesn't look like list} {
+} -result [font actual {times 0} -family]
+test font-38.3 {ParseFontNameObj procedure: begins with -, doesn't look like list} -body {
lindex [font actual -xyz-times-*-*-*-*-*-*-*-*-*-*-*-*] 1
-} $times
-test font-38.4 {ParseFontNameObj procedure: begins with -, looks like list} {
+} -result [font actual {times 0} -family]
+test font-38.4 {ParseFontNameObj procedure: begins with -, looks like list} -body {
lindex [font actual {-family times}] 1
-} $times
-test font-38.5 {ParseFontNameObj procedure: begins with *} {
+} -result [font actual {times 0} -family]
+test font-38.5 {ParseFontNameObj procedure: begins with *} -body {
lindex [font actual *-times-xyz-*-*-*-*-*-*-*-*-*-*-*] 1
-} $times
-test font-38.6 {ParseFontNameObj procedure: begins with *} {
+} -result [font actual {times 0} -family]
+test font-38.6 {ParseFontNameObj procedure: begins with *} -body {
font actual *-times-xyz -family
-} $times
-test font-38.7 {ParseFontNameObj procedure: arguments} {noExceed} {
- list [catch {font actual "\{xyz"} msg] $msg
-} [list 1 "font \"{xyz\" doesn't exist"]
-test font-38.8 {ParseFontNameObj procedure: arguments} {noExceed} {
- list [catch {font actual ""} msg] $msg
-} {1 {font "" doesn't exist}}
-test font-38.9 {ParseFontNameObj procedure: arguments} {
- list [catch {font actual {times 20 xyz xyz}} msg] $msg
-} {1 {unknown font style "xyz"}}
-test font-38.10 {ParseFontNameObj procedure: arguments} {
- list [catch {font actual {times xyz xyz}} msg] $msg
-} {1 {expected integer but got "xyz"}}
-test font-38.12 {ParseFontNameObj procedure: stylelist loop} {unixOrPc} {
+} -result [font actual {times 0} -family]
+test font-38.7 {ParseFontNameObj procedure: arguments} -constraints noExceed -body {
+ font actual "\{xyz"
+} -returnCodes error -result "font \"{xyz\" doesn't exist"
+test font-38.8 {ParseFontNameObj procedure: arguments} -constraints noExceed -body {
+ font actual ""
+} -returnCodes error -result {font "" doesn't exist}
+test font-38.9 {ParseFontNameObj procedure: arguments} -body {
+ font actual {times 20 xyz xyz}
+} -returnCodes error -result {unknown font style "xyz"}
+test font-38.10 {ParseFontNameObj procedure: arguments} -body {
+ font actual {times xyz xyz}
+} -returnCodes error -result {expected integer but got "xyz"}
+test font-38.11 {ParseFontNameObj procedure: stylelist loop} -constraints {
+ unixOrPc
+} -body {
lrange [font actual {times 12 bold italic overstrike underline}] 4 end
-} {-weight bold -slant italic -underline 1 -overstrike 1}
-test font-38.13 {ParseFontNameObj procedure: stylelist error} {
- list [catch {font actual {times 12 bold xyz}} msg] $msg
-} {1 {unknown font style "xyz"}}
-test font-38.14 "ParseFontNameObj: options with hyphenated family: bug #2791352" -body {
+} -result {-weight bold -slant italic -underline 1 -overstrike 1}
+test font-38.12 {ParseFontNameObj procedure: stylelist error} -body {
+ font actual {times 12 bold xyz}
+} -returnCodes error -result {unknown font style "xyz"}
+test font-38.13 "ParseFontNameObj: options with hyphenated family: bug #2791352" -body {
font actual {-family sans-serif -size 12 -weight bold -slant roman -underline 0 -overstrike 0}
} -returnCodes ok -result [font actual {sans-serif 12 bold}]
-test font-38.15 "ParseFontNameObj: bug #2791352" -body {
+test font-38.14 "ParseFontNameObj: bug #2791352" -body {
font actual {-invalidfont 8 bold}
} -returnCodes error -match glob -result {bad option "-invalidfont": *}
-test font-39.1 {NewChunk procedure: test realloc} {
- .b.f config -text "xxx\nxxx\txxx\nxxx\t\t\t"
-} {}
-test font-40.1 {TkFontParseXLFD procedure: initial dash} {
+test font-39.1 {NewChunk procedure: test realloc} -setup {
+ destroy .t.f
+ pack [label .t.f]
+ update
+} -body {
+ .t.f config -text "xxx\nxxx\txxx\nxxx\t\t\t"
+} -cleanup {
+ destroy .t.f
+} -result {}
+
+
+test font-40.1 {TkFontParseXLFD procedure: initial dash} -body {
font actual -xyz-times-*-*-*-*-*-*-*-*-*-*-*-* -family
-} $times
-test font-40.2 {TkFontParseXLFD procedure: no initial dash} {
+} -result [font actual {times 0} -family]
+test font-40.2 {TkFontParseXLFD procedure: no initial dash} -body {
font actual *-times-*-*-*-*-*-*-*-*-*-*-*-xyz -family
-} $times
-test font-40.3 {TkFontParseXLFD procedure: not enough fields} {
+} -result [font actual {times 0} -family]
+test font-40.3 {TkFontParseXLFD procedure: not enough fields} -body {
font actual -xyz-times-*-*-* -family
-} $times
-test font-40.4 {TkFontParseXLFD procedure: all fields unspecified} {
+} -result [font actual {times 0} -family]
+test font-40.4 {TkFontParseXLFD procedure: all fields unspecified} -body {
lindex [font actual -xyz-*-*-*-*-*-*-*-*-*-*-*-*-*] 0
-} {-family}
-test font-40.5 {TkFontParseXLFD procedure: all fields specified} {
- lindex [font actual -foundry-times-weight-slant-setwidth-addstyle-10-10-10-10-spacing-avgwidth-registry-encoding] 1
-} $times
-test font-41.1 {TkParseXLFD procedure: arguments} {
+} -result {-family}
+test font-40.5 {TkFontParseXLFD procedure: all fields specified} -body {
+ lindex [font actual \
+ -foundry-times-weight-slant-setwidth-addstyle-10-10-10-10-spacing-avgwidth-registry-encoding] 1
+} -result [font actual {times 0} -family]
+
+
+test font-41.1 {TkParseXLFD procedure: arguments} -body {
# XLFD with bad pointsize: fallback to some system font.
font actual -*-*-*-*-*-*-xyz-*-*-*-*-*-*-*
set x {}
-} {}
-test font-42.1 {TkFontParseXLFD procedure: arguments} {
+} -result {}
+
+
+test font-42.1 {TkFontParseXLFD procedure: arguments} -body {
# XLFD with bad pixelsize: fallback to some system font.
font actual -*-*-*-*-*-*-*-xyz-*-*-*-*-*-*
set x {}
-} {}
-test font-42.2 {TkFontParseXLFD procedure: pixelsize specified} {
+} -result {}
+test font-42.2 {TkFontParseXLFD procedure: pixelsize specified} -body {
font metrics -xyz-times-*-*-*-*-12-*-*-*-*-*-*-* -linespace
set x {}
-} {}
-test font-42.3 {TkFontParseXLFD procedure: weird pixelsize specified} {
+} -result {}
+test font-42.3 {TkFontParseXLFD procedure: weird pixelsize specified} -body {
font metrics {-xyz-times-*-*-*-*-[ 12.0 0 12.0 0]-*-*-*-*-*-*-*} -linespace
set x {}
-} {}
-test font-42.4 {TkFontParseXLFD procedure: pointsize specified} {
+} -result {}
+test font-42.4 {TkFontParseXLFD procedure: pointsize specified} -body {
font metrics -xyz-times-*-*-*-*-*-120-*-*-*-*-*-* -linespace
set x {}
-} {}
-test font-42.5 {TkFontParseXLFD procedure: weird pointsize specified} {
+} -result {}
+test font-42.5 {TkFontParseXLFD procedure: weird pointsize specified} -body {
font metrics {-xyz-times-*-*-*-*-*-[ 12.0 0 12.0 0]-*-*-*-*-*-*} -linespace
set x {}
-} {}
+} -result {}
-test font-43.1 {FieldSpecified procedure: specified vs. non-specified} {
+
+test font-43.1 {FieldSpecified procedure: specified vs. non-specified} -body {
font actual -xyz--*-*-*-*-*-*-*-*-*-*-*-*
font actual -xyz-*-*-*-*-*-*-*-*-*-*-*-*-*
font actual -xyz-?-*-*-*-*-*-*-*-*-*-*-*-*
lindex [font actual -xyz-times-*-*-*-*-*-*-*-*-*-*-*-*] 1
-} $times
+} -result [font actual {times 0} -family]
+
-set oldscale [tk scaling]
-tk scaling 0.5
-test font-44.1 {TkFontGetPixels: size < 0} {
+test font-44.1 {TkFontGetPixels: size < 0} -setup {
+ set oldscale [tk scaling]
+} -body {
+ tk scaling 0.5
font actual {times -12} -size
-} {24}
-test font-44.2 {TkFontGetPoints: size >= 0} {noExceed} {
+} -cleanup {
+ tk scaling $oldscale
+} -result {24}
+test font-44.2 {TkFontGetPoints: size >= 0} -constraints noExceed -setup {
+ set oldscale [tk scaling]
+} -body {
+ tk scaling 0.5
font actual {times 12} -size
-} {12}
+} -cleanup {
+ tk scaling $oldscale
+} -result {12}
-tk scaling $oldscale
-test font-45.1 {TkFontGetAliasList: no match} {
+test font-45.1 {TkFontGetAliasList: no match} -body {
font actual {snarky 10} -family
-} [font actual {-size 10} -family]
-test font-45.3 {TkFontGetAliasList: match} win {
+} -result [font actual {-size 10} -family]
+test font-45.2 {TkFontGetAliasList: match} -constraints win -body {
font actual {times 10} -family
-} {Times New Roman}
-test font-45.4 {TkFontGetAliasList: match} {unix noExceed} {
+} -result {Times New Roman}
+test font-45.3 {TkFontGetAliasList: match} -constraints {unix noExceed} -body {
# can fail on Unix systems that have a real "times new roman" font
font actual {{times new roman} 10} -family
-} [font actual {times 10} -family]
+} -result [font actual {times 10} -family]
-test font-46.1 {font actual, with character, no option, no --} \
- -body {
+
+test font-46.1 {font actual, with character, no option, no --} -body {
font actual {times 10} a
- } \
- -match glob \
- -result [list -family [font actual {times 10} -family] -size *\
+} -match glob -result [list -family [font actual {times 10} -family] -size *\
-slant roman -underline 0 -overstrike 0]
-test font-46.2 {font actual, with character introduced by --} \
- -body {
+test font-46.2 {font actual, with character introduced by --} -body {
font actual {times 10} -- -
- } \
- -match glob \
- -result [list -family [font actual {times 10} -family] -size *\
+} -match glob -result [list -family [font actual {times 10} -family] -size *\
-slant roman -underline 0 -overstrike 0]
-test font-46.3 {font actual, with character and option} {
+test font-46.3 {font actual, with character and option} -body {
font actual {times 10} -family a
-} [font actual {times 10} -family]
+} -result [font actual {times 10} -family]
-test font-46.4 {font actual, with character, option and --} {
+test font-46.4 {font actual, with character, option and --} -body {
font actual {times 10} -family -- -
-} [font actual {times 10} -family]
-
-test font-46.5 {font actual, too many chars} {
- list [catch {
- font actual {times 10} 123456789012345678901234567890123456789012345678901
- } result] $result
-} {1 {expected a single character but got "1234567890123456789012345678901234567..."}}
+} -result [font actual {times 10} -family]
-setup
+test font-46.5 {font actual, too many chars} -body {
+ font actual {times 10} 123456789012345678901234567890123456789012345678901
+} -returnCodes error -result {expected a single character but got "1234567890123456789012345678901234567..."}
-destroy .b
# cleanup
cleanupTests
return
+
+
+
+
diff --git a/tests/fontchooser.test b/tests/fontchooser.test
new file mode 100644
index 0000000..4dad5da
--- /dev/null
+++ b/tests/fontchooser.test
@@ -0,0 +1,201 @@
+# Test the "tk::fontchooser" command
+#
+# Copyright (c) 2008 Pat Thoyts
+
+package require tcltest 2.1
+eval tcltest::configure $argv
+tcltest::loadTestedCommands
+
+# the following helper functions are related to the functions used
+# in winDialog.test where they are used to send messages to the win32
+# dialog (hence the wierdness).
+
+proc start {cmd} {
+ set ::tk_dialog {}
+ set ::iter_after 0
+ after 1 $cmd
+}
+proc then {cmd} {
+ set ::command $cmd
+ set ::dialogresult {}
+ set ::testfont {}
+ afterbody
+ vwait ::dialogresult
+ return $::dialogresult
+}
+proc afterbody {} {
+ if {$::tk_dialog == {}} {
+ if {[incr ::iter_after] > 30} {
+ set ::dialogresult ">30 iterations waiting for tk_dialog"
+ return
+ }
+ after 150 {afterbody}
+ return
+ }
+ uplevel #0 {set dialogresult [eval $command]}
+}
+proc Click {button} {
+ switch -exact -- $button {
+ ok { $::tk_dialog.ok invoke }
+ cancel { $::tk_dialog.cancel invoke }
+ apply { $::tk_dialog.apply invoke }
+ default { return -code error "invalid button name \"$button\"" }
+ }
+}
+proc ApplyFont {font} {
+# puts stderr "apply: $font"
+ set ::testfont $font
+}
+
+# -------------------------------------------------------------------------
+
+test fontchooser-1.1 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser -z
+} -result {unknown or ambiguous subcommand "-z": must be configure, hide, or show}
+
+test fontchooser-1.2 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -z
+} -match glob -result {bad option "-z":*}
+
+test fontchooser-1.3 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -parent . -font
+} -result {value for "-font" missing}
+
+test fontchooser-1.4 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -parent . -title
+} -result {value for "-title" missing}
+
+test fontchooser-1.5 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -parent . -command
+} -result {value for "-command" missing}
+
+test fontchooser-1.6 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -title . -parent
+} -result {value for "-parent" missing}
+
+test fontchooser-1.7 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -parent abc
+} -result {bad window path name "abc"}
+
+test fontchooser-1.8 {tk fontchooser: usage} -returnCodes ok -body {
+ tk fontchooser configure -visible
+} -result {0}
+
+test fontchooser-1.9 {tk fontchooser: usage} -returnCodes error -body {
+ tk fontchooser configure -visible 1
+} -match glob -result {*}
+
+# -------------------------------------------------------------------------
+#
+# The remaining tests in this file are only relevant for the script
+# implementation. They can be tested by sourcing the script file but
+# the Tk tests are run with -singleproc 1 and doing this affects the
+# result of later attempts to test the native implementations.
+#
+testConstraint scriptImpl [llength [info proc ::tk::fontchooser::Configure]]
+
+test fontchooser-2.0 {fontchooser -title} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -title "Hello"
+ tk::fontchooser::Show
+ }
+ then {
+ set x [wm title $::tk_dialog]
+ Click cancel
+ }
+ set x
+} -result {Hello}
+
+test fontchooser-2.1 {fontchooser -title (cyrillic)} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure \
+ -title "\u041f\u0440\u0438\u0432\u0435\u0442"
+ tk::fontchooser::Show
+ }
+ then {
+ set x [wm title $::tk_dialog]
+ Click cancel
+ }
+ set x
+} -result "\u041f\u0440\u0438\u0432\u0435\u0442"
+
+test fontchooser-3.0 {fontchooser -parent} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -parent .
+ tk::fontchooser::Show
+ }
+ then {
+ set x [winfo parent $::tk_dialog]
+ Click cancel
+ }
+ set x
+} -result {.}
+
+test fontchooser-3.1 {fontchooser -parent (invalid)} -constraints scriptImpl -body {
+ tk::fontchooser::Configure -parent junk
+} -returnCodes error -match glob -result {bad window path *}
+
+test fontchooser-4.0 {fontchooser -font} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -command ApplyFont -font courier
+ tk::fontchooser::Show
+ }
+ then {
+ Click cancel
+ }
+ set ::testfont
+} -result {}
+
+test fontchooser-4.1 {fontchooser -font} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -command ApplyFont -font courier
+ tk::fontchooser::Show
+ }
+ then {
+ Click ok
+ }
+ expr {$::testfont ne {}}
+} -result {1}
+
+test fontchooser-4.2 {fontchooser -font} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -command ApplyFont -font TkDefaultFont
+ tk::fontchooser::Show
+ }
+ then {
+ Click ok
+ }
+ expr {$::testfont ne {}}
+} -result {1}
+
+test fontchooser-4.3 {fontchooser -font} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -command ApplyFont -font {times 14 bold}
+ tk::fontchooser::Show
+ }
+ then {
+ Click ok
+ }
+ expr {$::testfont ne {}}
+} -result {1}
+
+test fontchooser-4.4 {fontchooser -font} -constraints scriptImpl -body {
+ start {
+ tk::fontchooser::Configure -command ApplyFont -font {times 14 bold}
+ tk::fontchooser::Show
+ }
+ then {
+ Click ok
+ }
+ lrange $::testfont 1 end
+} -result {14 bold}
+
+# -------------------------------------------------------------------------
+
+cleanupTests
+return
+
+# Local Variables:
+# mode: tcl
+# indent-tabs-mode: nil
+# End:
diff --git a/tests/frame.test b/tests/frame.test
index affdac6..35b9605 100644
--- a/tests/frame.test
+++ b/tests/frame.test
@@ -7,7 +7,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -51,40 +52,98 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
&& ([lindex $vals 2]/256 == $blue)
}
-test frame-1.1 {frame configuration options} {
+
+test frame-1.1 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -class NewFrame
+ .f configure -class
+} -cleanup {
+ deleteWindows
+} -result {-class class Class Frame NewFrame}
+test frame-1.2 {frame configuration options} -setup {
+ deleteWindows
+} -body {
frame .f -class NewFrame
- list [.f configure -class] [catch {.f configure -class Different} msg] $msg
-} {{-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} {
+ .f configure -class Different
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -class option after widget is created}
+
+test frame-1.3 {frame configuration options} -setup {
+ deleteWindows
+} -body {
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} {
+ .f configure -colormap
+} -cleanup {
+ deleteWindows
+} -result {-colormap colormap Colormap {} new}
+test frame-1.4 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -colormap new
+ .f configure -colormap .
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -colormap option after widget is created}
+
+test frame-1.5 {frame configuration options} -setup {
+ deleteWindows
+} -body {
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
-} {1 {unknown option "-screen"}}
-test frame-1.5 {frame configuration options} {
- set result [list [catch {frame .f -container true} msg] $msg \
- [.f configure -container]]
- destroy .f
- set result
-} {0 .f {-container container Container 0 1}}
-test frame-1.6 {frame configuration options} {
- list [catch {frame .f -container bogus} msg] $msg
-} {1 {expected boolean value but got "bogus"}}
-test frame-1.7 {frame configuration options} {
+ .f configure -visual
+} -cleanup {
+ deleteWindows
+} -result {-visual visual Visual {} default}
+test frame-1.6 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -visual default
+ .f configure -visual best
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -visual option after widget is created}
+
+test frame-1.7 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -screen bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-screen"}
+test frame-1.8 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -container true
+} -cleanup {
+ deleteWindows
+} -result {.f}
+test frame-1.9 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -container true
+ .f configure -container
+} -cleanup {
+ deleteWindows
+} -result {-container container Container 0 1}
+test frame-1.10 {frame configuration options} -setup {
+ deleteWindows
+} -body {
+ frame .f -container bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected boolean value but got "bogus"}
+test frame-1.11 {frame configuration options} -setup {
+ deleteWindows
+} -body {
frame .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}}
-test frame-1.8 {frame configuration options} {
+ .f configure -container 1
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -container option after widget is created}
+test frame-1.12 {frame configuration options} -setup {
+ deleteWindows
+} -body {
# Make sure all options can be set to the default value
frame .f
set opts {}
@@ -95,120 +154,327 @@ test frame-1.8 {frame configuration options} {
}
eval frame .g $opts
destroy .f .g
-} {}
+} -cleanup {
+ deleteWindows
+} -result {}
+destroy .f
frame .f
-set i 9
-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"}}
- {-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"}}
- {-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"}}
-} {
- lassign $test opt goodValue goodResult badValue badResult
- test frame-1.$i {frame configuration options} {
- .f configure $opt $goodValue
- lindex [.f configure $opt] 4
- } $goodResult
- incr i
- if {$badValue ne ""} {
- test frame-1.$i {frame configuration options} -body {
- .f configure $opt $badValue
- } -returnCodes error -result $badResult
- }
- .f configure $opt [lindex [.f configure $opt] 3]
- incr i
-}
+test frame-1.13 {frame configuration options} -body {
+ .f configure -background #ff0000
+ lindex [.f configure -background] 4
+} -cleanup {
+ .f configure -background [lindex [.f configure -background] 3]
+} -result {#ff0000}
+test frame-1.14 {frame configuration options} -body {
+ .f configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-1.15 {frame configuration options} -body {
+ .f configure -bd 4
+ lindex [.f configure -bd] 4
+} -cleanup {
+ .f configure -bd [lindex [.f configure -bd] 3]
+} -result {4}
+test frame-1.16 {frame configuration options} -body {
+ .f configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-1.17 {frame configuration options} -body {
+ .f configure -bg #00ff00
+ lindex [.f configure -bg] 4
+} -cleanup {
+ .f configure -bg [lindex [.f configure -bg] 3]
+} -result {#00ff00}
+test frame-1.18 {frame configuration options} -body {
+ .f configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-1.19 {frame configuration options} -body {
+ .f configure -borderwidth 1.3
+ lindex [.f configure -borderwidth] 4
+} -cleanup {
+ .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
+} -result {1}
+test frame-1.20 {frame configuration options} -body {
+ .f configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-1.21 {frame configuration options} -body {
+ .f configure -cursor arrow
+ lindex [.f configure -cursor] 4
+} -cleanup {
+ .f configure -cursor [lindex [.f configure -cursor] 3]
+} -result {arrow}
+test frame-1.22 {frame configuration options} -body {
+ .f configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test frame-1.23 {frame configuration options} -body {
+ .f configure -height 100
+ lindex [.f configure -height] 4
+} -cleanup {
+ .f configure -height [lindex [.f configure -height] 3]
+} -result {100}
+test frame-1.24 {frame configuration options} -body {
+ .f configure -height not_a_number
+} -returnCodes error -result {bad screen distance "not_a_number"}
+test frame-1.25 {frame configuration options} -body {
+ .f configure -highlightbackground #112233
+ lindex [.f configure -highlightbackground] 4
+} -cleanup {
+ .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3]
+} -result {#112233}
+test frame-1.26 {frame configuration options} -body {
+ .f configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test frame-1.27 {frame configuration options} -body {
+ .f configure -highlightcolor #123456
+ lindex [.f configure -highlightcolor] 4
+} -cleanup {
+ .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3]
+} -result {#123456}
+test frame-1.28 {frame configuration options} -body {
+ .f configure -highlightcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-1.29 {frame configuration options} -body {
+ .f configure -highlightthickness 6
+ lindex [.f configure -highlightthickness] 4
+} -cleanup {
+ .f configure -highlightthickness [lindex [.f configure -highlightthickness] 3]
+} -result {6}
+test frame-1.30 {frame configuration options} -body {
+ .f configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-1.31 {frame configuration options} -body {
+ .f configure -padx 3
+ lindex [.f configure -padx] 4
+} -cleanup {
+ .f configure -padx [lindex [.f configure -padx] 3]
+} -result {3}
+test frame-1.32 {frame configuration options} -body {
+ .f configure -padx badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-1.33 {frame configuration options} -body {
+ .f configure -pady 4
+ lindex [.f configure -pady] 4
+} -cleanup {
+ .f configure -pady [lindex [.f configure -pady] 3]
+} -result {4}
+test frame-1.34 {frame configuration options} -body {
+ .f configure -pady badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-1.35 {frame configuration options} -body {
+ .f configure -relief ridge
+ lindex [.f configure -relief] 4
+} -cleanup {
+ .f configure -relief [lindex [.f configure -relief] 3]
+} -result {ridge}
+test frame-1.36 {frame configuration options} -body {
+ .f configure -relief badValue
+} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+test frame-1.37 {frame configuration options} -body {
+ .f configure -takefocus {any string}
+ lindex [.f configure -takefocus] 4
+} -cleanup {
+ .f configure -takefocus [lindex [.f configure -takefocus] 3]
+} -result {any string}
+test frame-1.38 {frame configuration options} -body {
+ .f configure -width 32
+ lindex [.f configure -width] 4
+} -cleanup {
+ .f configure -width [lindex [.f configure -width] 3]
+} -result {32}
+test frame-1.39 {frame configuration options} -body {
+ .f configure -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
destroy .f
-test frame-2.1 {toplevel configuration options} {
- catch {destroy .t}
+
+test frame-2.1 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 200 -height 100 -class NewClass
wm geometry .t +0+0
- list [.t configure -class] [catch {.t configure -class Another} msg] $msg
-} {{-class class Class Toplevel NewClass} 1 {can't modify -class option after widget is created}}
-test frame-2.2 {toplevel configuration options} {
- catch {destroy .t}
+ .t configure -class
+} -cleanup {
+ deleteWindows
+} -result {-class class Class Toplevel NewClass}
+test frame-2.2 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -class NewClass
+ wm geometry .t +0+0
+ .t configure -class Another
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -class option after widget is created}
+
+test frame-2.3 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 200 -height 100 -colormap new
wm geometry .t +0+0
- list [.t configure -colormap] [catch {.t configure -colormap .} msg] $msg
-} {{-colormap colormap Colormap {} new} 1 {can't modify -colormap option after widget is created}}
-test frame-2.3 {toplevel configuration options} {
+ .t configure -colormap
+} -cleanup {
+ deleteWindows
+} -result {-colormap colormap Colormap {} new}
+test frame-2.4 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -colormap new
+ wm geometry .t +0+0
+ .t configure -colormap .
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -colormap option after widget is created}
+
+test frame-2.5 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100
+ wm geometry .t +0+0
+ .t configure -container 1
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -container option after widget is created}
+test frame-2.6 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +0+0
- list [catch {.t configure -container 1} msg] $msg [.t configure -container]
-} {1 {can't modify -container option after widget is created} {-container container Container 0 0}}
-test frame-2.4 {toplevel configuration options} {
+ catch {.t configure -container 1}
+ .t configure -container
+} -cleanup {
+ deleteWindows
+} -result {-container container Container 0 0}
+
+test frame-2.7 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -colormap bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad window path name "bogus"}
+
+
+test frame-2.8 {toplevel configuration options} -constraints {
+ win
+} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
- list [catch {toplevel .t -width 200 -height 100 -colormap bogus} msg] $msg
-} {1 {bad window path name "bogus"}}
-set default "[winfo visual .] [winfo depth .]"
-if {$tcl_platform(platform) == "windows"} {
-test frame-2.5 {toplevel configuration options} {
+ toplevel .t -width 200 -height 100
+ wm geometry .t +0+0
+ .t configure -use 0x44022
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {window "0x44022" doesn't exist}
+test frame-2.9 {toplevel configuration options} -constraints {
+ win
+} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +0+0
- list [catch {.t configure -use 0x44022} msg] $msg [.t configure -use]
-} {1 {window "0x44022" doesn't exist} {-use use Use {} {}}}
-} else {
-test frame-2.5 {toplevel configuration options} {
+ catch {.t configure -use 0x44022}
+ .t configure -use
+} -cleanup {
+ deleteWindows
+} -result {-use use Use {} {}}
+
+test frame-2.10 {toplevel configuration options} -constraints {
+ nonwin
+} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +0+0
- list [catch {.t configure -use 0x44022} msg] $msg [.t configure -use]
-} {1 {can't modify -use option after widget is created} {-use use Use {} {}}}
-}
+ .t configure -use 0x44022
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -use option after widget is created}
+test frame-2.11 {toplevel configuration options} -constraints {
+ nonwin
+} -setup {
+ deleteWindows
+} -body {
+ catch {destroy .t}
+ toplevel .t -width 200 -height 100
+ wm geometry .t +0+0
+ catch {.t configure -use 0x44022}
+ .t configure -use
+} -cleanup {
+ deleteWindows
+} -result {-use use Use {} {}}
-test frame-2.6 {toplevel configuration options} {
+test frame-2.12 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100 -visual default
wm geometry .t +0+0
- list [.t configure -visual] [catch {.t configure -visual best} msg] $msg
-} {{-visual visual Visual {} default} 1 {can't modify -visual option after widget is created}}
-test frame-2.7 {toplevel configuration options} {
- catch {destroy .t}
- list [catch {toplevel .t -width 200 -height 100 -visual who_knows?} msg] $msg
-} {1 {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}}
-test frame-2.8 {toplevel configuration options} haveDISPLAY {
+ .t configure -visual
+} -cleanup {
+ deleteWindows
+} -result {-visual visual Visual {} default}
+test frame-2.13 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
catch {destroy .t}
+ toplevel .t -width 200 -height 100 -visual default
+ wm geometry .t +0+0
+ .t configure -visual best
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -visual option after widget is created}
+
+test frame-2.14 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -visual who_knows?
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}
+test frame-2.15 {toplevel configuration options} -constraints haveDISPLAY -setup {
+ deleteWindows
+} -body {
toplevel .t -width 200 -height 100 -screen $env(DISPLAY)
wm geometry .t +0+0
- set cfg [string compare [.t configure -screen] \
- "-screen screen Screen {} $env(DISPLAY)"]
- list $cfg [catch {.t configure -screen another} msg] $msg
-} {0 1 {can't modify -screen option after widget is created}}
-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}
+ string compare [.t configure -screen] "-screen screen Screen {} $env(DISPLAY)"
+} -cleanup {
+ deleteWindows
+} -result {0}
+test frame-2.16 {toplevel configuration options} -constraints haveDISPLAY -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -screen $env(DISPLAY)
+ wm geometry .t +0+0
+ .t configure -screen another
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -screen option after widget is created}
+
+test frame-2.17 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -width 200 -height 100 -screen bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {couldn't connect to display "bogus"}
+test frame-2.18 {toplevel configuration options} -setup {
+ deleteWindows
+} -body {
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.}}
-test frame-2.11 {toplevel configuration options} {
+ toplevel .x -container 1 -use [winfo id .t]
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {A window cannot have both the -use and the -container option set.}
+test frame-2.19 {toplevel configuration options} -setup {
+ deleteWindows
+ set opts {}
+} -body {
# Make sure all options can be set to the default value
toplevel .f
- set opts {}
foreach opt [.f configure] {
if {[llength $opt] == 5} {
lappend opts [lindex $opt 0] [lindex $opt 4]
@@ -216,112 +482,184 @@ test frame-2.11 {toplevel configuration options} {
}
eval toplevel .g $opts
destroy .f .g
-} {}
+} -cleanup {
+ deleteWindows
+} -result {}
+
-catch {destroy .t}
+destroy .t
toplevel .t -width 300 -height 150
wm geometry .t +0+0
update
-set i 12
-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"}}
- {-height 100 100 not_a_number {bad screen distance "not_a_number"}}
- {-highlightcolor #123456 #123456 non-existent
- {unknown color name "non-existent"}}
- {-highlightthickness 3 3 badValue {bad screen distance "badValue"}}
- {-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"}}
-} {
- lassign $test opt goodValue goodResult badValue badResult
- test frame-2.$i {toplevel configuration options} {
- .t configure $opt $goodValue
- lindex [.t configure $opt] 4
- } $goodResult
- incr i
- if {$badValue ne ""} {
- test frame-2.$i {toplevel configuration options} -body {
- .t configure $opt $badValue
- } -returnCodes error -result $badResult
- }
- .t configure $opt [lindex [.t configure $opt] 3]
- incr i
-}
+test frame-2.20 {toplevel configuration options} -body {
+ .t configure -background #ff0000
+ lindex [.t configure -background] 4
+} -result {#ff0000}
+test frame-2.21 {toplevel configuration options} -body {
+ .t configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-2.22 {toplevel configuration options} -body {
+ .t configure -bd 4
+ lindex [.t configure -bd] 4
+} -result {4}
+test frame-2.23 {toplevel configuration options} -body {
+ .t configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-2.24 {toplevel configuration options} -body {
+ .t configure -bg #00ff00
+ lindex [.t configure -bg] 4
+} -result {#00ff00}
+test frame-2.25 {toplevel configuration options} -body {
+ .t configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-2.26 {toplevel configuration options} -body {
+ .t configure -borderwidth 1.3
+ lindex [.t configure -borderwidth] 4
+} -result {1}
+test frame-2.27 {toplevel configuration options} -body {
+ .t configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-2.28 {toplevel configuration options} -body {
+ .t configure -cursor arrow
+ lindex [.t configure -cursor] 4
+} -result {arrow}
+test frame-2.29 {toplevel configuration options} -body {
+ .t configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test frame-2.30 {toplevel configuration options} -body {
+ .t configure -height 100
+ lindex [.t configure -height] 4
+} -result {100}
+test frame-2.31 {toplevel configuration options} -body {
+ .t configure -height not_a_number
+} -returnCodes error -result {bad screen distance "not_a_number"}
+test frame-2.32 {toplevel configuration options} -body {
+ .t configure -highlightcolor #123456
+ lindex [.t configure -highlightcolor] 4
+} -result {#123456}
+test frame-2.33 {toplevel configuration options} -body {
+ .t configure -highlightcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-2.34 {toplevel configuration options} -body {
+ .t configure -highlightthickness 3
+ lindex [.t configure -highlightthickness] 4
+} -result {3}
+test frame-2.35 {toplevel configuration options} -body {
+ .t configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-2.36 {toplevel configuration options} -body {
+ .t configure -padx 3
+ lindex [.t configure -padx] 4
+} -result {3}
+test frame-2.37 {toplevel configuration options} -body {
+ .t configure -padx badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-2.38 {toplevel configuration options} -body {
+ .t configure -pady 4
+ lindex [.t configure -pady] 4
+} -result {4}
+test frame-2.39 {toplevel configuration options} -body {
+ .t configure -pady badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-2.40 {toplevel configuration options} -body {
+ .t configure -relief ridge
+ lindex [.t configure -relief] 4
+} -result {ridge}
+test frame-2.41 {toplevel configuration options} -body {
+ .t configure -relief badValue
+} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+test frame-2.42 {toplevel configuration options} -body {
+ .t configure -width 32
+ lindex [.t configure -width] 4
+} -result {32}
+test frame-2.43 {toplevel configuration options} -body {
+ .t configure -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+destroy .t
+
test frame-3.1 {TkCreateFrame procedure} -body {
frame
-} -returnCodes error -result {wrong # args: should be "frame pathName ?options?"}
+} -returnCodes error -result {wrong # args: should be "frame pathName ?-option value ...?"}
test frame-3.2 {TkCreateFrame procedure} -setup {
- catch {destroy .f}
+ deleteWindows
frame .f
} -body {
.f configure -class
} -cleanup {
- destroy .f
+ deleteWindows
} -result {-class class Class Frame Frame}
test frame-3.3 {TkCreateFrame procedure} -setup {
- catch {destroy .t}
+ deleteWindows
toplevel .t
wm geometry .t +0+0
} -body {
.t configure -class
} -cleanup {
- destroy .t
+ deleteWindows
} -result {-class class Class Toplevel Toplevel}
-test frame-3.4 {TkCreateFrame procedure} {
- catch {destroy .t}
+test frame-3.4 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 350 -class NewClass -bg black -visual default -height 90
wm geometry .t +0+0
update
list [lindex [.t configure -width] 4] \
[lindex [.t configure -background] 4] \
[lindex [.t configure -height] 4]
-} {350 black 90}
+} -cleanup {
+ deleteWindows
+} -result {350 black 90}
# Be sure that the -class, -colormap, and -visual options are processed
# before configuring the widget.
-
-test frame-3.5 {TkCreateFrame procedure} {
- catch {destroy .f}
+test frame-3.5 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
option add *NewFrame.background #123456
frame .f -class NewFrame
- option clear
lindex [.f configure -background] 4
-} {#123456}
-test frame-3.6 {TkCreateFrame procedure} {
- catch {destroy .f}
+} -cleanup {
+ deleteWindows
+ option clear
+} -result {#123456}
+test frame-3.6 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
option add *NewFrame.background #123456
frame .f -class NewFrame
- option clear
lindex [.f configure -background] 4
-} {#123456}
-test frame-3.7 {TkCreateFrame procedure} {
- catch {destroy .f}
+} -cleanup {
+ deleteWindows
+ option clear
+} -result {#123456}
+test frame-3.7 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
option add *NewFrame.background #332211
option add *f.class NewFrame
frame .f
- option clear
list [lindex [.f configure -class] 4] [lindex [.f configure -background] 4]
-} {NewFrame #332211}
-test frame-3.8 {TkCreateFrame procedure} {
- catch {destroy .f}
+} -cleanup {
+ deleteWindows
+ option clear
+} -result {NewFrame #332211}
+test frame-3.8 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
option add *Silly.background #122334
option add *f.Class Silly
frame .f
- option clear
list [lindex [.f configure -class] 4] [lindex [.f configure -background] 4]
-} {Silly #122334}
-test frame-3.9 {TkCreateFrame procedure, -use option} -setup {
- catch {destroy .t}
- catch {destroy .x}
-} -constraints unix -body {
+} -cleanup {
+ deleteWindows
+ option clear
+} -result {Silly #122334}
+test frame-3.9 {TkCreateFrame procedure, -use option} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -container 1 -width 300 -height 120
wm geometry .t +0+0
toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green
@@ -330,12 +668,13 @@ test frame-3.9 {TkCreateFrame procedure, -use option} -setup {
[expr {[winfo rooty .x] - [winfo rooty .t]}] \
[winfo width .t] [winfo height .t]
} -cleanup {
- destroy .t
+ deleteWindows
} -result {0 0 140 300}
-test frame-3.10 {TkCreateFrame procedure, -use option} -setup {
- catch {destroy .t}
- catch {destroy .x}
-} -constraints unix -body {
+test frame-3.10 {TkCreateFrame procedure, -use option} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -container 1 -width 300 -height 120
wm geometry .t +0+0
option add *x.use [winfo id .t]
@@ -353,26 +692,38 @@ test frame-3.10 {TkCreateFrame procedure, -use option} -setup {
# they are run on a pseudocolor display of depth 8). Even so, they
# are non-portable: some machines don't seem to ever run out of
# colors.
-
if {[testConstraint defaultPseudocolor8]} {
eatColors .t1
}
-test frame-3.11 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+test frame-3.11 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 300 -height 200 -bg #475601
wm geometry .t +0+0
update
colorsFree .t
-} {0}
-test frame-3.12 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {0}
+test frame-3.12 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 300 -height 200 -bg #475601 -colormap new
wm geometry .t +0+0
update
colorsFree .t
-} {1}
-test frame-3.13 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test frame-3.13 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
option add *t.class Toplevel2
option add *Toplevel2.colormap new
toplevel .t -width 300 -height 200 -bg #475601
@@ -380,9 +731,14 @@ test frame-3.13 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
update
option clear
colorsFree .t
-} {1}
-test frame-3.14 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test frame-3.14 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
option add *t.class Toplevel3
option add *Toplevel3.Colormap new
toplevel .t -width 300 -height 200 -bg #475601 -colormap new
@@ -390,11 +746,14 @@ test frame-3.14 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
update
option clear
colorsFree .t
-} {1}
-test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -setup {
- catch {destroy .t}
- catch {destroy .x}
-} -constraints {defaultPseudocolor8 unix nonPortable} -body {
+} -cleanup {
+ deleteWindows
+} -result {1}
+test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints {
+ defaultPseudocolor8 unix nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -container 1 -width 300 -height 120
wm geometry .t +0+0
toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green -colormap new
@@ -403,30 +762,48 @@ test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -setup {
} -cleanup {
destroy .t
} -result {0 1}
-test frame-3.16 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+test frame-3.16 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 300 -height 200 -bg #475601 -visual default
wm geometry .t +0+0
update
colorsFree .t
-} {0}
-test frame-3.17 {TkCreateFrame procedure} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {0}
+test frame-3.17 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 300 -height 200 -bg #475601 -visual default \
-colormap new
wm geometry .t +0+0
update
colorsFree .t
-} {1}
-test frame-3.18 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test frame-3.18 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 haveGrayscale8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
wm geometry .t +0+0
update
colorsFree .t 131 131 131
-} {1}
-test frame-3.19 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test frame-3.19 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 haveGrayscale8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
option add *t.class T4
option add *T4.visual {grayscale 8}
toplevel .t -width 300 -height 200 -bg #434343
@@ -434,9 +811,14 @@ test frame-3.19 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 no
update
option clear
list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4]
-} {1 {grayscale 8}}
-test frame-3.20 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1 {grayscale 8}}
+test frame-3.20 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 haveGrayscale8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
set x ok
option add *t.class T5
option add *T5.Visual {grayscale 8}
@@ -445,20 +827,28 @@ test frame-3.20 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 no
update
option clear
list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4]
-} {1 {grayscale 8}}
-test frame-3.21 {TkCreateFrame procedure} {defaultPseudocolor8 haveGrayscale8 nonPortable} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {1 {grayscale 8}}
+test frame-3.21 {TkCreateFrame procedure} -constraints {
+ defaultPseudocolor8 haveGrayscale8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
set x ok
toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
wm geometry .t +0+0
update
colorsFree .t 131 131 131
-} {1}
+} -cleanup {
+ deleteWindows
+} -result {1}
if {[testConstraint defaultPseudocolor8]} {
destroy .t1
}
+
test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup {
- catch {destroy .t}
+ deleteWindows
} -body {
toplevel .t
wm geometry .t +0+0
@@ -469,87 +859,103 @@ test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup {
update
lappend result [winfo reqwidth .t.f] [winfo reqheight .t.f]
} -cleanup {
- destroy .t
+ deleteWindows
} -result {200 200 1 1}
test frame-3.23 {TkCreateFrame procedure} -setup {
- catch {destroy .f}
+ deleteWindows
} -body {
frame .f -gorp glob
} -returnCodes error -result {unknown option "-gorp"}
test frame-3.24 {TkCreateFrame procedure} -setup {
- catch {destroy .t}
+ deleteWindows
} -body {
toplevel .t -width 300 -height 200 -colormap new -bogus option
wm geometry .t +0+0
} -returnCodes error -result {unknown option "-bogus"}
-test frame-4.1 {TkCreateFrame procedure} {
- catch {destroy .f}
+
+test frame-4.1 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
catch {frame .f -gorp glob}
winfo exists .f
-} 0
-test frame-4.2 {TkCreateFrame procedure} {
- catch {destroy .f}
+} -result 0
+test frame-4.2 {TkCreateFrame procedure} -setup {
+ deleteWindows
+} -body {
list [frame .f -width 200 -height 100] [winfo exists .f]
-} {.f 1}
+} -cleanup {
+ deleteWindows
+} -result {.f 1}
+
-catch {destroy .f}
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 frame-5.2 {FrameWidgetCommand procedure, cget option} {
- list [catch {.f cget} msg] $msg
-} {1 {wrong # args: should be ".f 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 frame-5.4 {FrameWidgetCommand procedure, cget option} {
- list [catch {.f cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test frame-5.5 {FrameWidgetCommand procedure, cget option} {
+test frame-5.1 {FrameWidgetCommand procedure} -body {
+ .f
+} -returnCodes error -result {wrong # args: should be ".f option ?arg ...?"}
+test frame-5.2 {FrameWidgetCommand procedure, cget option} -body {
+ .f cget
+} -returnCodes error -result {wrong # args: should be ".f cget option"}
+test frame-5.3 {FrameWidgetCommand procedure, cget option} -body {
+ .f cget a b
+} -returnCodes error -result {wrong # args: should be ".f cget option"}
+test frame-5.4 {FrameWidgetCommand procedure, cget option} -body {
+ .f cget -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test frame-5.5 {FrameWidgetCommand procedure, cget option} -body {
.f cget -highlightcolor
-} {black}
-test frame-5.6 {FrameWidgetCommand procedure, cget option} {
- list [catch {.f cget -screen} msg] $msg
-} {1 {unknown option "-screen"}}
-test frame-5.7 {FrameWidgetCommand procedure, cget option} {
- catch {destroy .t}
+} -result {black}
+test frame-5.6 {FrameWidgetCommand procedure, cget option} -body {
+ .f cget -screen
+} -returnCodes error -result {unknown option "-screen"}
+test frame-5.7 {FrameWidgetCommand procedure, cget option} -setup {
+ destroy .t
+} -body {
toplevel .t
- catch {.t cget -screen}
-} {0}
-catch {destroy .t}
-test frame-5.8 {FrameWidgetCommand procedure, configure option} {
+ .t cget -screen
+} -cleanup {
+ destroy .t
+} -returnCodes ok -match glob -result *
+
+test frame-5.8 {FrameWidgetCommand procedure, configure option} -body {
llength [.f configure]
-} {18}
-test frame-5.9 {FrameWidgetCommand procedure, configure option} {
- list [catch {.f configure -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test frame-5.10 {FrameWidgetCommand procedure, configure option} {
- list [catch {.f configure -gorp bogus} msg] $msg
-} {1 {unknown option "-gorp"}}
-test frame-5.11 {FrameWidgetCommand procedure, configure option} {
- list [catch {.f configure -width 200 -height} msg] $msg
-} {1 {value for "-height" missing}}
-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} {
+} -result {18}
+test frame-5.9 {FrameWidgetCommand procedure, configure option} -body {
+ .f configure -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test frame-5.10 {FrameWidgetCommand procedure, configure option} -body {
+ .f configure -gorp bogus
+} -returnCodes error -result {unknown option "-gorp"}
+test frame-5.11 {FrameWidgetCommand procedure, configure option} -body {
+ .f configure -width 200 -height
+} -returnCodes error -result {value for "-height" missing}
+test frame-5.12 {FrameWidgetCommand procedure} -body {
+ .f swizzle
+} -returnCodes error -result {bad option "swizzle": must be cget or configure}
+test frame-5.13 {FrameWidgetCommand procedure, configure option} -body {
llength [. configure]
-} {21}
+} -result {21}
+destroy .f
-test frame-6.1 {ConfigureFrame procedure} {
- catch {destroy .f}
+test frame-6.1 {ConfigureFrame procedure} -setup {
+ deleteWindows
+} -body {
frame .f -width 150
list [winfo reqwidth .f] [winfo reqheight .f]
-} {150 1}
-test frame-6.2 {ConfigureFrame procedure} {
- catch {destroy .f}
+} -cleanup {
+ deleteWindows
+} -result {150 1}
+test frame-6.2 {ConfigureFrame procedure} -setup {
+ deleteWindows
+} -body {
frame .f -height 97
list [winfo reqwidth .f] [winfo reqheight .f]
-} {1 97}
-test frame-6.3 {ConfigureFrame procedure} {
- catch {destroy .f}
+} -cleanup {
+ deleteWindows
+} -result {1 97}
+test frame-6.3 {ConfigureFrame procedure} -setup {
+ deleteWindows
+} -body {
frame .f
set result {}
lappend result [winfo reqwidth .f] [winfo reqheight .f]
@@ -557,77 +963,98 @@ test frame-6.3 {ConfigureFrame procedure} {
lappend result [winfo reqwidth .f] [winfo reqheight .f]
.f configure -width 0 -height 0
lappend result [winfo reqwidth .f] [winfo reqheight .f]
-} {1 1 100 180 100 180}
+} -cleanup {
+ deleteWindows
+} -result {1 1 100 180 100 180}
-test frame-7.1 {FrameEventProc procedure} {
+test frame-7.1 {FrameEventProc procedure} -setup {
+ deleteWindows
+} -body {
frame .frame2
set result [info commands .frame2]
destroy .frame2
lappend result [info commands .frame2]
-} {.frame2 {}}
-test frame-7.2 {FrameEventProc procedure} {
- deleteWindows
+} -result {.frame2 {}}
+test frame-7.2 {FrameEventProc procedure} -setup {
+ deleteWindows
+ set x {}
+} -body {
frame .f1 -bg #543210
rename .f1 .f2
- set x {}
lappend x [winfo children .]
lappend x [.f2 cget -bg]
destroy .f1
lappend x [info command .f*] [winfo children .]
-} {.f1 #543210 {} {}}
-
-test frame-8.1 {FrameCmdDeletedProc procedure} {
+} -cleanup {
deleteWindows
+} -result {.f1 #543210 {} {}}
+
+test frame-8.1 {FrameCmdDeletedProc procedure} -setup {
+ deleteWindows
+} -body {
frame .f1
rename .f1 {}
list [info command .f*] [winfo children .]
-} {{} {}}
-test frame-8.2 {FrameCmdDeletedProc procedure} {
+} -cleanup {
deleteWindows
+} -result {{} {}}
+test frame-8.2 {FrameCmdDeletedProc procedure} -setup {
+ deleteWindows
+} -body {
toplevel .f1 -menu .m
wm geometry .f1 +0+0
update
rename .f1 {}
update
list [info command .f*] [winfo children .]
-} {{} {}}
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
#
# This one fails with the dash-patch!!!! Still don't know why :-(
#
-#test frame-8.3 {FrameCmdDeletedProc procedure} {
+#test frame-8.3 {FrameCmdDeletedProc procedure} -setup {
# eval destroy [winfo children .]
+# deleteWindows
+#} -body {
# toplevel .f1 -menu .m
# wm geometry .f1 +0+0
# menu .m
# update
# rename .f1 {}
# update
-# set result [list [info command .f*] [winfo children .]]
+# list [info command .f*] [winfo children .]
+#} -cleanup {
# eval destroy [winfo children .]
-# set result
-#} {{} .m}
+# deleteWindows
+#} -result {{} .m}
-test frame-9.1 {MapFrame procedure} {
- catch {destroy .t}
+test frame-9.1 {MapFrame procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 100 -height 400
wm geometry .t +0+0
set result [winfo ismapped .t]
update idletasks
lappend result [winfo ismapped .t]
-} {0 1}
-test frame-9.2 {MapFrame procedure} {
- catch {destroy .t}
+} -cleanup {
+ deleteWindows
+} -result {0 1}
+test frame-9.2 {MapFrame procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t -width 100 -height 400
wm geometry .t +0+0
destroy .t
update
winfo exists .t
-} {0}
-test frame-9.3 {MapFrame procedure, window deleted while mapping} {
+} -result {0}
+test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -width 200 -height 200
wm geometry .t2 +0+0
tkwait visibility .t2
- catch {destroy .t}
toplevel .t -width 100 -height 400
wm geometry .t +0+0
frame .t2.f -width 50 -height 50
@@ -635,53 +1062,66 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} {
pack .t2.f -side top
update idletasks
winfo exists .t
-} {0}
+} -cleanup {
+ deleteWindows
+} -result {0}
-set l [interp hidden]
-deleteWindows
-test frame-10.1 {frame widget vs hidden commands} {
- catch {destroy .t}
+test frame-10.1 {frame widget vs hidden commands} -setup {
+ deleteWindows
+} -body {
+ set l [interp hidden]
frame .t
interp hide {} .t
destroy .t
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 eq $res2}
+} -result 1
-test frame-11.1 {TkInstallFrameMenu} {
- catch {destroy .t}
+
+test frame-11.1 {TkInstallFrameMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m1.system
menu .m1.system -tearoff 0
.m1.system add command -label foo
- list [toplevel .t -menu .m1] [destroy .m1] [destroy .t]
-} {.t {} {}}
-test frame-11.2 {TkInstallFrameMenu - frame renamed} {
- catch {destroy .t}
+ toplevel .t -menu .m1
+} -cleanup {
+ deleteWindows
+} -result {.t}
+test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup {
+ deleteWindows
+} -body {
catch {rename foo {}}
menu .m1
.m1 add cascade -menu .m1.system
menu .m1.system -tearoff 0
.m1.system add command -label foo
toplevel .t
- list [rename .t foo] [destroy .t] [destroy foo] [destroy .m1]
-} {{} {} {} {}}
+ rename .t foo
+} -cleanup {
+ deleteWindows
+} -result {}
+
-test frame-12.1 {FrameWorldChanged procedure} {
+test frame-12.1 {FrameWorldChanged procedure} -setup {
+ deleteWindows
+} -body {
# 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} {
+ list [winfo x .f.f] [winfo y .f.f] [winfo width .f.f] [winfo height .f.f]
+} -cleanup {
+ deleteWindows
+} -result {5 6 30 28}
+test frame-12.2 {FrameWorldChanged procedure} -setup {
+ deleteWindows
+} -body {
# Test all -labelanchor positions
- destroy .f
set font {helvetica 12}
labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \
-text "Mupp"
@@ -710,12 +1150,14 @@ test frame-12.2 {FrameWorldChanged procedure} {
[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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {1 1 1 1 1 1 1 1 1 1 1 1}
+test frame-12.3 {FrameWorldChanged procedure} -setup {
+ deleteWindows
+} -body {
# 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
@@ -727,103 +1169,267 @@ test frame-12.3 {FrameWorldChanged procedure} {
update
set h2 [font metrics myfont -linespace]
set y2 [winfo y .f.f]
- destroy .f
- font delete myfont
expr {($h2 - $h1) - ($y2 - $y1)}
-} {0}
+} -cleanup {
+ deleteWindows
+ font delete myfont
+} -result {0}
+
-test frame-13.1 {labelframe configuration options} {
+test frame-13.1 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
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} {
+ .f configure -class
+} -cleanup {
+ deleteWindows
+} -result {-class class Class Labelframe NewFrame}
+test frame-13.2 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -class NewFrame
+ .f configure -class Different
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -class option after widget is created}
+test frame-13.3 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -colormap new
+} -cleanup {
+ deleteWindows
+} -result {.f}
+test frame-13.4 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -visual default
+} -cleanup {
+ deleteWindows
+} -result {.f}
+test frame-13.5 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -screen bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-screen"}
+test frame-13.6 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -container true
+} -cleanup {
+ deleteWindows
+} -result {.f}
+test frame-13.7 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -container true
+ .f configure -container
+} -cleanup {
+ deleteWindows
+} -result {-container container Container 0 1}
+test frame-13.8 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
+ labelframe .f -container bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected boolean value but got "bogus"}
+test frame-13.9 {labelframe configuration options} -setup {
+ deleteWindows
+} -body {
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}}
+ .f configure -container 1
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't modify -container option after widget is created}
+
+destroy .f
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"}}
-} {
- lassign $test name goodValue goodResult badValue badResult
- test frame-13.$i {labelframe configuration options} {
- .f configure $name $goodValue
- lindex [.f configure $name] 4
- } $goodResult
- incr i
- if {$badValue ne ""} {
- test frame-13.$i {labelframe configuration options} -body {
- .f configure $name $badValue
- } -returnCodes error -result $badResult
- }
- .f configure $name [lindex [.f configure $name] 3]
- incr i
-}
+test frame-13.10 {labelframe configuration options} -body {
+ .f configure -background #ff0000
+ lindex [.f configure -background] 4
+} -cleanup {
+ .f configure -background [lindex [.f configure -background] 3]
+} -result {#ff0000}
+test frame-13.11 {labelframe configuration options} -body {
+ .f configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-13.12 {labelframe configuration options} -body {
+ .f configure -bd 4
+ lindex [.f configure -bd] 4
+} -cleanup {
+ .f configure -bd [lindex [.f configure -bd] 3]
+} -result {4}
+test frame-13.13 {labelframe configuration options} -body {
+ .f configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-13.14 {labelframe configuration options} -body {
+ .f configure -bg #00ff00
+ lindex [.f configure -bg] 4
+} -cleanup {
+ .f configure -bg [lindex [.f configure -bg] 3]
+} -result {#00ff00}
+test frame-13.15 {labelframe configuration options} -body {
+ .f configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-13.16 {labelframe configuration options} -body {
+ .f configure -borderwidth 1.3
+ lindex [.f configure -borderwidth] 4
+} -cleanup {
+ .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
+} -result {1}
+test frame-13.17 {labelframe configuration options} -body {
+ .f configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-13.18 {labelframe configuration options} -body {
+ .f configure -cursor arrow
+ lindex [.f configure -cursor] 4
+} -cleanup {
+ .f configure -cursor [lindex [.f configure -cursor] 3]
+} -result {arrow}
+test frame-13.19 {labelframe configuration options} -body {
+ .f configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test frame-13.20 {labelframe configuration options} -body {
+ .f configure -fg #0000ff
+ lindex [.f configure -fg] 4
+} -cleanup {
+ .f configure -fg [lindex [.f configure -fg] 3]
+} -result {#0000ff}
+test frame-13.21 {labelframe configuration options} -body {
+ .f configure -fg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-13.22 {labelframe configuration options} -body {
+ .f configure -font {courier 8}
+ lindex [.f configure -font] 4
+} -cleanup {
+ .f configure -font [lindex [.f configure -font] 3]
+} -result {courier 8}
+test frame-13.23 {labelframe configuration options} -body {
+ .f configure -foreground #ff0000
+ lindex [.f configure -foreground] 4
+} -cleanup {
+ .f configure -foreground [lindex [.f configure -foreground] 3]
+} -result {#ff0000}
+test frame-13.24 {labelframe configuration options} -body {
+ .f configure -foreground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-13.25 {labelframe configuration options} -body {
+ .f configure -height 100
+ lindex [.f configure -height] 4
+} -cleanup {
+ .f configure -height [lindex [.f configure -height] 3]
+} -result {100}
+test frame-13.26 {labelframe configuration options} -body {
+ .f configure -height not_a_number
+} -returnCodes error -result {bad screen distance "not_a_number"}
+test frame-13.27 {labelframe configuration options} -body {
+ .f configure -highlightbackground #112233
+ lindex [.f configure -highlightbackground] 4
+} -cleanup {
+ .f configure -highlightbackground [lindex [.f configure -highlightbackground] 3]
+} -result {#112233}
+test frame-13.28 {labelframe configuration options} -body {
+ .f configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test frame-13.29 {labelframe configuration options} -body {
+ .f configure -highlightcolor #123456
+ lindex [.f configure -highlightcolor] 4
+} -cleanup {
+ .f configure -highlightcolor [lindex [.f configure -highlightcolor] 3]
+} -result {#123456}
+test frame-13.30 {labelframe configuration options} -body {
+ .f configure -highlightcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test frame-13.31 {labelframe configuration options} -body {
+ .f configure -highlightthickness 6
+ lindex [.f configure -highlightthickness] 4
+} -cleanup {
+ .f configure -highlightthickness [lindex [.f configure -highlightthickness] 3]
+} -result {6}
+test frame-13.32 {labelframe configuration options} -body {
+ .f configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-13.33 {labelframe configuration options} -body {
+ .f configure -labelanchor se
+ lindex [.f configure -labelanchor] 4
+} -cleanup {
+ .f configure -labelanchor [lindex [.f configure -labelanchor] 3]
+} -result {se}
+test frame-13.34 {labelframe configuration options} -body {
+ .f configure -labelanchor badValue
+} -returnCodes error -result {bad labelanchor "badValue": must be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws}
+test frame-13.35 {labelframe configuration options} -body {
+ .f configure -padx 3
+ lindex [.f configure -padx] 4
+} -cleanup {
+ .f configure -padx [lindex [.f configure -padx] 3]
+} -result {3}
+test frame-13.36 {labelframe configuration options} -body {
+ .f configure -padx badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-13.37 {labelframe configuration options} -body {
+ .f configure -pady 4
+ lindex [.f configure -pady] 4
+} -cleanup {
+ .f configure -pady [lindex [.f configure -pady] 3]
+} -result {4}
+test frame-13.38 {labelframe configuration options} -body {
+ .f configure -pady badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test frame-13.39 {labelframe configuration options} -body {
+ .f configure -relief ridge
+ lindex [.f configure -relief] 4
+} -cleanup {
+ .f configure -relief [lindex [.f configure -relief] 3]
+} -result {ridge}
+test frame-13.40 {labelframe configuration options} -body {
+ .f configure -relief badValue
+} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+test frame-13.41 {labelframe configuration options} -body {
+ .f configure -takefocus {any string}
+ lindex [.f configure -takefocus] 4
+} -cleanup {
+ .f configure -takefocus [lindex [.f configure -takefocus] 3]
+} -result {any string}
+test frame-13.42 {labelframe configuration options} -body {
+ .f configure -text {any string}
+ lindex [.f configure -text] 4
+} -cleanup {
+ .f configure -text [lindex [.f configure -text] 3]
+} -result {any string}
+test frame-13.43 {labelframe configuration options} -body {
+ .f configure -width 32
+ lindex [.f configure -width] 4
+} -cleanup {
+ .f configure -width [lindex [.f configure -width] 3]
+} -result {32}
+test frame-13.44 {labelframe configuration options} -body {
+ .f configure -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
destroy .f
-test frame-14.1 {labelframe labelwidget option} {
+
+test frame-14.1 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# Test that label is moved in stacking order
- destroy .f .l
label .l -text Mupp -font {helvetica 8}
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} {
+ list [winfo children .] [winfo width .f] \
+ [expr {[winfo height .f] - [winfo height .l]}]
+} -cleanup {
+ deleteWindows
+} -result {{.f .l} 54 52}
+test frame-14.2 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# Test the labelframe's reaction if the label is destroyed
- destroy .f .l
label .l -text Aratherlonglabel
labelframe .f -labelwidget .l
pack .f
@@ -836,12 +1442,13 @@ test frame-14.2 {labelframe labelwidget option} {
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} {
+} -cleanup {
+ deleteWindows
+} -result {.l 12 {} 4}
+test frame-14.3 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# Test the labelframe's reaction if the label is stolen
- destroy .f .l
label .l -text Aratherlonglabel
labelframe .f -labelwidget .l
pack .f
@@ -854,12 +1461,13 @@ test frame-14.3 {labelframe labelwidget option} {
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} {
+} -cleanup {
+ deleteWindows
+} -result {.l 12 {} 4}
+test frame-14.4 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# Test the label's reaction if the labelframe is destroyed
- destroy .f .l
label .l -text Mupp
labelframe .f -labelwidget .l
pack .f
@@ -867,12 +1475,13 @@ test frame-14.4 {labelframe labelwidget option} {
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} {
+} -cleanup {
+ deleteWindows
+} -result {labelframe {}}
+test frame-14.5 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# Test that the labelframe reacts on changes in label
- destroy .f .l
label .l -text Aratherlonglabel
labelframe .f -labelwidget .l
pack .f
@@ -889,24 +1498,25 @@ test frame-14.5 {labelframe labelwidget option} {
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} {
+} -cleanup {
+ deleteWindows
+} -result {12 12 1 12 1}
+test frame-14.6 {labelframe labelwidget option} -setup {
+ deleteWindows
+} -body {
# 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}
+} -cleanup {
+ deleteWindows
+} -result {}
+deleteWindows
rename eatColors {}
rename colorsFree {}
@@ -914,3 +1524,6 @@ rename colorsFree {}
cleanupTests
return
+
+
+
diff --git a/tests/geometry.test b/tests/geometry.test
index 04ab578..13cc515 100644
--- a/tests/geometry.test
+++ b/tests/geometry.test
@@ -7,9 +7,16 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+proc getsize w {
+ regexp {(^[^+-]*)} [wm geometry $w] foo x
+ return $x
+}
+
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+
wm geometry . 300x300
raise .
@@ -23,15 +30,20 @@ button .b2 -text .b2
button .b3 -text .b3
button .f.f.b4 -text .b4
-test geometry-1.1 {Tk_ManageGeometry procedure} {
+test geometry-1.1 {Tk_ManageGeometry procedure} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
+ }
+} -body {
place .b1 -x 120 -y 80
update
list [winfo x .b1] [winfo y .b1]
-} {120 80}
-test geometry-1.2 {Tk_ManageGeometry procedure} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+} -result {120 80}
+test geometry-1.2 {Tk_ManageGeometry procedure} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .b1 -in .f -x 40 -y 30
update
@@ -39,28 +51,37 @@ test geometry-1.2 {Tk_ManageGeometry procedure} {
place .f -x 30 -y 40
update
list [winfo x .b1] [winfo y .b1]
-} {0 0}
+} -result {0 0}
-test geometry-2.1 {Tk_GeometryRequest procedure} {
+
+test geometry-2.1 {Tk_GeometryRequest procedure} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
+ }
+ destroy .f2
+} -body {
frame .f2
set result [list [winfo reqwidth .f2] [winfo reqheight .f2]]
.f2 configure -width 150 -height 300
update
lappend result [winfo reqwidth .f2] [winfo reqheight .f2] \
- [winfo geom .f2]
+ [winfo geom .f2]
place .f2 -x 10 -y 20
update
lappend result [winfo geom .f2]
.f2 configure -width 100 -height 80
update
lappend result [winfo geom .f2]
-} {1 1 150 300 1x1+0+0 150x300+10+20 100x80+10+20}
-catch {destroy .f2}
+} -cleanup {
+ destroy .f2
+} -result {1 1 150 300 1x1+0+0 150x300+10+20 100x80+10+20}
+
-test geometry-3.1 {Tk_SetInternalBorder procedure} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+test geometry-3.1 {Tk_SetInternalBorder procedure} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .b1 -in .f -x 50 -y 5
update
@@ -68,24 +89,28 @@ test geometry-3.1 {Tk_SetInternalBorder procedure} {
.f configure -bd 5
update
lappend x [winfo x .b1] [winfo y .b1]
-} {72 37 75 40}
-.f configure -bd 2
+} -cleanup {
+ .f configure -bd 2
+} -result {72 37 75 40}
-test geometry-4.1 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+
+test geometry-4.1 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
place .b1 -in .f.f.f -x 50 -y 5
update
list [winfo x .b1] [winfo y .b1]
-} {91 46}
-test geometry-4.2 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+} -result {91 46}
+test geometry-4.2 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -96,12 +121,13 @@ test geometry-4.2 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f -x 30 -y 25
update
list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \
- [winfo x .b3] [winfo y .b3]
-} {101 41 61 61 101 61}
-test geometry-4.3 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+ [winfo x .b3] [winfo y .b3]
+} -result {101 41 61 61 101 61}
+test geometry-4.3 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -114,12 +140,13 @@ test geometry-4.3 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f.f -x 10 -y 25
update
list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \
- [winfo x .b3] [winfo y .b3]
-} {0 0 46 86 86 86}
-test geometry-4.4 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+ [winfo x .b3] [winfo y .b3]
+} -result {0 0 46 86 86 86}
+test geometry-4.4 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -132,12 +159,13 @@ test geometry-4.4 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f.f.f -x 2 -y 3
update
list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \
- [winfo x .b3] [winfo y .b3]
-} {93 49 0 0 93 69}
-test geometry-4.5 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+ [winfo x .b3] [winfo y .b3]
+} -result {93 49 0 0 93 69}
+test geometry-4.5 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -150,11 +178,15 @@ test geometry-4.5 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f.f.f -x 2 -y 3
update
list [winfo x .b1] [winfo y .b1] [winfo x .b2] [winfo y .b2] \
- [winfo x .b3] [winfo y .b3]
-} {93 49 53 69 0 0}
-test geometry-4.6 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
+ [winfo x .b3] [winfo y .b3]
+} -result {93 49 53 69 0 0}
+test geometry-4.6 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
+ }
+} -body {
foreach w {.f .f.f .f.f.f .b1 .b2 .b3 .f.f.b4} {
- place forget $w
+ place forget $w
}
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
@@ -165,11 +197,12 @@ test geometry-4.6 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f -x 25 -y 35
update
list [winfo x .f.f.b4] [winfo y .f.f.b4] [winfo x .b2] [winfo y .b2]
-} {54 9 56 71}
-test geometry-4.7 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3 .f.f.b4} {
- place forget $w
+} -result {54 9 56 71}
+test geometry-4.7 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
bind .b1 <Configure> {lappend x configure}
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
@@ -184,13 +217,15 @@ test geometry-4.7 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f -x 30 -y 40
place .f.f -x 10 -y 0
update
+ return $x
+} -cleanup {
bind .b1 <Configure> {}
- set x
-} {init configure |}
-test geometry-4.8 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+} -result {init configure |}
+test geometry-4.8 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -204,13 +239,14 @@ test geometry-4.8 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f -x 30 -y 25
update
list [winfo x .b1] [winfo y .b1] [winfo ismapped .b1] \
- [winfo x .b2] [winfo y .b2] [winfo ismapped .b2] \
- [winfo x .b3] [winfo y .b3] [winfo ismapped .b3]
-} {91 46 0 51 66 0 91 66 0}
-test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
- foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
- place forget $w
+ [winfo x .b2] [winfo y .b2] [winfo ismapped .b2] \
+ [winfo x .b3] [winfo y .b3] [winfo ismapped .b3]
+} -result {91 46 0 51 66 0 91 66 0}
+test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
}
+} -body {
place .f -x 20 -y 30 -width 200 -height 200
place .f.f -x 15 -y 5 -width 150 -height 120
place .f.f.f -width 100 -height 80
@@ -223,14 +259,18 @@ test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
place .f.f -x 15 -y 5 -width 150 -height 120
update
lappend result [winfo ismapped .b1]
-} {1 0 1}
-test geometry-4.10 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
+} -result {1 0 1}
+test geometry-4.10 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
+ foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
+ place forget $w
+ }
+ destroy .t
+} -body {
toplevel .t
wm geometry .t +0+0
tkwait visibility .t
update
- frame .t.f
- pack .t.f
+ pack [frame .t.f]
button .t.quit -text Quit -command exit
pack .t.quit -in .t.f
wm iconify .t
@@ -240,10 +280,12 @@ test geometry-4.10 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} {
wm deiconify .t
update
winfo ismapped .t.quit
-} {1}
+} -cleanup {
+ destroy .t
+} -result {1}
-catch {destroy .t}
# cleanup
cleanupTests
return
+
diff --git a/tests/get.test b/tests/get.test
index d3a4228..ea08c8c 100644
--- a/tests/get.test
+++ b/tests/get.test
@@ -6,73 +6,133 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
-button .b
-test get-1.1 {Tk_GetAnchorFromObj} {
+test get-1.1 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor n
.b cget -anchor
-} {n}
-test get-1.2 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {n}
+test get-1.2 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor ne
.b cget -anchor
-} {ne}
-test get-1.3 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {ne}
+test get-1.3 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor e
.b cget -anchor
-} {e}
-test get-1.4 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {e}
+test get-1.4 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor se
.b cget -anchor
-} {se}
-test get-1.5 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {se}
+test get-1.5 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor s
.b cget -anchor
-} {s}
-test get-1.6 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {s}
+test get-1.6 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor sw
.b cget -anchor
-} {sw}
-test get-1.7 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {sw}
+test get-1.7 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor w
.b cget -anchor
-} {w}
-test get-1.8 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {w}
+test get-1.8 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor nw
.b cget -anchor
-} {nw}
-test get-1.9 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {nw}
+test get-1.9 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor n
.b cget -anchor
-} {n}
-test get-1.10 {Tk_GetAnchorFromObj} {
+} -cleanup {
+ destroy .b
+} -result {n}
+test get-1.10 {Tk_GetAnchorFromObj} -setup {
+ button .b
+} -body {
.b configure -anchor center
.b cget -anchor
-} {center}
-test get-1.11 {Tk_GetAnchorFromObj - error} {
- list [catch {.b configure -anchor unknown} msg] $msg
-} {1 {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center}}
+} -cleanup {
+ destroy .b
+} -result {center}
+test get-1.11 {Tk_GetAnchorFromObj - error} -setup {
+ button .b
+} -body {
+ .b configure -anchor unknown
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad anchor "unknown": must be n, ne, e, se, s, sw, w, nw, or center}
-catch {destroy .b}
-button .b
-test get-2.1 {Tk_GetJustifyFromObj} {
+
+test get-2.1 {Tk_GetJustifyFromObj} -setup {
+ button .b
+} -body {
.b configure -justify left
.b cget -justify
-} {left}
-test get-2.2 {Tk_GetJustifyFromObj} {
+} -cleanup {
+ destroy .b
+} -result {left}
+test get-2.2 {Tk_GetJustifyFromObj} -setup {
+ button .b
+} -body {
.b configure -justify right
.b cget -justify
-} {right}
-test get-2.3 {Tk_GetJustifyFromObj} {
+} -cleanup {
+ destroy .b
+} -result {right}
+test get-2.3 {Tk_GetJustifyFromObj} -setup {
+ button .b
+} -body {
.b configure -justify center
.b cget -justify
-} {center}
-test get-2.4 {Tk_GetJustifyFromObj - error} {
- list [catch {.b configure -justify stupid} msg] $msg
-} {1 {bad justification "stupid": must be left, right, or center}}
+} -cleanup {
+ destroy .b
+} -result {center}
+test get-2.4 {Tk_GetJustifyFromObj - error} -setup {
+ button .b
+} -body {
+ .b configure -justify stupid
+} -cleanup {
+ destroy .b
+} -returnCodes {error} -result {bad justification "stupid": must be left, right, or center}
# cleanup
cleanupTests
return
+
diff --git a/tests/grab.test b/tests/grab.test
index 2f4f73b..33399cb 100644
--- a/tests/grab.test
+++ b/tests/grab.test
@@ -7,140 +7,145 @@
# Copyright (c) 1998-2000 by Ajuba Solutions.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
# 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} {
+
+test grab-1.1 {Tk_GrabObjCmd} -body {
+ grab
+} -returnCodes error -result {wrong # args: should be "grab ?-global? window" or "grab option ?arg ...?"}
+test grab-1.2 {Tk_GrabObjCmd} -body {
rename grab grabTest1.2
- set res [list [catch {grabTest1.2} msg] $msg]
+ grabTest1.2
+} -cleanup {
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} {
+} -returnCodes error -result {wrong # args: should be "grabTest1.2 ?-global? window" or "grabTest1.2 option ?arg ...?"}
+
+test grab-1.3 {Tk_GrabObjCmd, "grab ?-global? window"} -body {
+ grab .foo bar baz
+} -returnCodes error -result {wrong # args: should be "grab ?-global? window"}
+test grab-1.4 {Tk_GrabObjCmd, "grab ?-global? window"} -body {
+ destroy .foo
+ grab .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test grab-1.5 {Tk_GrabObjCmd, "grab ?-global? window"} -body {
+ grab -foo bar
+} -returnCodes error -result {bad option "-foo": must be -global}
+test grab-1.6 {Tk_GrabObjCmd, "grab ?-global? window"} -body {
+ destroy .foo
+ grab -global .foo
+} -returnCodes error -result {bad window path name ".foo"}
+
+test grab-1.7 {Tk_GrabObjCmd} -body {
+ grab foo
+} -returnCodes error -result {bad option "foo": must be current, release, set, or status}
+
+test grab-1.8 {Tk_GrabObjCmd, "grab current ?window?"} -body {
+ grab current foo bar
+} -returnCodes error -result {wrong # args: should be "grab current ?window?"}
+test grab-1.9 {Tk_GrabObjCmd, "grab current ?window?"} -body {
+ destroy .foo
+ grab current .foo
+} -returnCodes error -result {bad window path name ".foo"}
+
+test grab-1.10 {Tk_GrabObjCmd, "grab release window"} -body {
+ grab release
+} -returnCodes error -result {wrong # args: should be "grab release window"}
+test grab-1.11 {Tk_GrabObjCmd, "grab release window"} -body {
+ destroy .foo
+ grab release .foo
+} -returnCodes ok -result {}
+test grab-1.12 {Tk_GrabObjCmd, "grab release window"} -body {
+ grab release foo
+} -returnCodes ok -result {}
+
+test grab-1.13 {Tk_GrabObjCmd, "grab set ?-global? window"} -body {
+ grab set
+} -returnCodes error -result {wrong # args: should be "grab set ?-global? window"}
+test grab-1.14 {Tk_GrabObjCmd, "grab set ?-global? window"} -body {
+ grab set foo bar baz
+} -returnCodes error -result {wrong # args: should be "grab set ?-global? window"}
+test grab-1.15 {Tk_GrabObjCmd, "grab set ?-global? window"} -body {
+ destroy .foo
+ grab set .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test grab-1.16 {Tk_GrabObjCmd, "grab set ?-global? window"} -body {
+ grab set -foo bar
+} -returnCodes error -result {bad option "-foo": must be -global}
+test grab-1.17 {Tk_GrabObjCmd, "grab set ?-global? window"} -body {
+ destroy .foo
+ grab set -global .foo
+} -returnCodes error -result {bad window path name ".foo"}
+
+test grab-1.18 {Tk_GrabObjCmd, "grab status window"} -body {
+ grab status
+} -returnCodes error -result {wrong # args: should be "grab status window"}
+test grab-1.19 {Tk_GrabObjCmd, "grab status window"} -body {
+ grab status foo bar
+} -returnCodes error -result {wrong # args: should be "grab status window"}
+test grab-1.20 {Tk_GrabObjCmd, "grab status window"} -body {
+ destroy .foo
+ grab status .foo
+} -returnCodes error -result {bad window path name ".foo"}
+
+
+test grab-2.1 {Tk_GrabObjCmd, grab status gives correct status} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
- set result [grab status .]
+ grab status .
+} -cleanup {
grab release .
- set result
-} "none"
-test grab-2.2 {Tk_GrabObjCmd, grab status gives correct status} {
+} -result {none}
+test grab-2.2 {Tk_GrabObjCmd, grab status gives correct status} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
grab .
- set result [grab status .]
+ grab status .
+} -cleanup {
grab release .
- set result
-} "local"
-test grab-2.3 {Tk_GrabObjCmd, grab status gives correct status} {
+} -result {local}
+test grab-2.3 {Tk_GrabObjCmd, grab status gives correct status} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
grab -global .
- set result [grab status .]
+ grab status .
+} -cleanup {
grab release .
- set result
-} "global"
+} -result {global}
+
-test grab-3.1 {Tk_GrabObjCmd, grab current gives correct information} {
+test grab-3.1 {Tk_GrabObjCmd, grab current gives correct information} -body {
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} {
+ return $curr
+} -result {}
+test grab-3.2 {Tk_GrabObjCmd, grab current gives correct information} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
grab .
- set curr [grab current]
+ grab current
+} -cleanup {
grab release .
- set curr
-} "."
+} -result {.}
-test grab-4.1 {Tk_GrabObjCmd, grab release releases grab} {
+
+test grab-4.1 {Tk_GrabObjCmd, grab release releases grab} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
@@ -153,28 +158,31 @@ test grab-4.1 {Tk_GrabObjCmd, grab release releases grab} {
lappend result [grab status .]
grab release .
lappend result [grab status .]
-} [list "local" "none" "global" "none"]
+} -result {local none global none}
+
-test grab-5.1 {Tk_GrabObjCmd, grab set} {
+test grab-5.1 {Tk_GrabObjCmd, grab set} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
grab set .
- set result [list [grab current .] [grab status .]]
+ list [grab current .] [grab status .]
+} -cleanup {
grab release .
- set result
-} [list "." "local"]
-test grab-5.2 {Tk_GrabObjCmd, grab set} {
+} -result {. local}
+test grab-5.2 {Tk_GrabObjCmd, grab set} -body {
set curr [grab current .]
if { [string length $curr] > 0 } {
grab release $curr
}
grab set -global .
- set result [list [grab current .] [grab status .]]
+ list [grab current .] [grab status .]
+} -cleanup {
grab release .
- set result
-} [list "." "global"]
+} -result {. global}
+
cleanupTests
return
+
diff --git a/tests/grid.test b/tests/grid.test
index fee81b5..b27318e 100644
--- a/tests/grid.test
+++ b/tests/grid.test
@@ -5,9 +5,11 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+
# helper routine to return "." to a sane state after a test
# The variable GRID_VERBOSE can be used to "look" at the result
@@ -39,87 +41,78 @@ proc grid_reset {{test ?} {top .}} {
grid_reset 0.0
wm geometry . {}
-test grid-1.1 {basic argument checking} {
- list [catch grid msg] $msg
-} {1 {wrong # args: should be "grid option arg ?arg ...?"}}
-
-test grid-1.2 {basic argument checking} {
- list [catch {grid foo bar} msg] $msg
-} {1 {bad option "foo": must be anchor, bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves}}
-
-test grid-1.3 {basic argument checking} {
+test grid-1.1 {basic argument checking} -body {
+ grid
+} -returnCodes error -result {wrong # args: should be "grid option arg ?arg ...?"}
+test grid-1.2 {basic argument checking} -body {
+ grid foo bar
+} -returnCodes error -result {bad option "foo": must be anchor, bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves}
+test grid-1.3 {basic argument checking} -body {
button .b
- list [catch {grid .b -row 0 -column} msg] $msg
-} {1 {extra option or option with no value}}
-grid_reset 1.3
+ grid .b -row 0 -column
+} -cleanup {
+ grid_reset 1.3
+} -returnCodes error -result {extra option or option with no value}
-test grid-1.4 {basic argument checking} {
+test grid-1.4 {basic argument checking} -body {
button .b
- list [catch {grid configure .b - foo} msg] $msg
-} {1 {unexpected parameter, "foo", in configure list. Should be window name or option}}
-grid_reset 1.4
-
-test grid-1.5 {basic argument checking} {
- list [catch {grid .} msg] $msg
-} {1 {can't manage ".": it's a top-level window}}
-
-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} {
+ grid configure .b - foo
+} -cleanup {
+ grid_reset 1.4
+} -returnCodes error -result {unexpected parameter, "foo", in configure list. Should be window name or option}
+test grid-1.5 {basic argument checking} -body {
+ grid .
+} -returnCodes error -result {can't manage ".": it's a top-level window}
+test grid-1.6 {basic argument checking} -body {
+ grid x
+} -returnCodes error -result {can't determine master window}
+test grid-1.7 {basic argument checking} -body {
+ grid configure x
+} -returnCodes error -result {can't determine master window}
+test grid-1.8 {basic argument checking} -body {
button .b
- list [catch {grid x .b} msg] $msg
-} {0 {}}
-grid_reset 1.8
+ grid x .b
+} -cleanup {
+ grid_reset 1.8
+} -returnCodes ok -result {}
-test grid-1.9 {basic argument checking} {
+test grid-1.9 {basic argument checking} -body {
button .b
- list [catch {grid configure x .b} msg] $msg
-} {0 {}}
-grid_reset 1.9
+ grid configure x .b
+} -cleanup {
+ grid_reset 1.9
+} -returnCodes ok -result {}
-test grid-2.1 {bbox} {
- list [catch {grid bbox .} msg] $msg
-} {0 {0 0 0 0}}
-test grid-2.2 {bbox} {
+test grid-2.1 {bbox} -body {
+ grid bbox .
+} -result {0 0 0 0}
+test grid-2.2 {bbox} -body {
button .b
grid .b
destroy .b
update
- list [catch {grid bbox .} msg] $msg
-} {0 {0 0 0 0}}
-
-test grid-2.3 {bbox: argument checking} {
- list [catch {grid bbox . 0 0 5} msg] $msg
-} {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
-} {1 {bad window path name ".bad"}}
-
-test grid-2.5 {bbox} {
- list [catch {grid bbox . x 0} msg] $msg
-} {1 {expected integer but got "x"}}
-
-test grid-2.6 {bbox} {
- list [catch {grid bbox . 0 x} msg] $msg
-} {1 {expected integer but got "x"}}
-
-test grid-2.7 {bbox} {
- list [catch {grid bbox . 0 0 x 0} msg] $msg
-} {1 {expected integer but got "x"}}
-
-test grid-2.8 {bbox} {
- list [catch {grid bbox . 0 0 0 x} msg] $msg
-} {1 {expected integer but got "x"}}
-
-test grid-2.9 {bbox} {
+ grid bbox .
+} -result {0 0 0 0}
+test grid-2.3 {bbox: argument checking} -body {
+ grid bbox . 0 0 5
+} -returnCodes error -result {wrong # args: should be "grid bbox master ?column row ?column row??"}
+test grid-2.4 {bbox} -body {
+ grid bbox .bad 0 0
+} -returnCodes error -result {bad window path name ".bad"}
+test grid-2.5 {bbox} -body {
+ grid bbox . x 0
+} -returnCodes error -result {expected integer but got "x"}
+test grid-2.6 {bbox} -body {
+ grid bbox . 0 x
+} -returnCodes error -result {expected integer but got "x"}
+test grid-2.7 {bbox} -body {
+ grid bbox . 0 0 x 0
+} -returnCodes error -result {expected integer but got "x"}
+test grid-2.8 {bbox} -body {
+ grid bbox . 0 0 0 x
+} -returnCodes error -result {expected integer but got "x"}
+test grid-2.9 {bbox} -body {
frame .1 -width 75 -height 75 -bg red
frame .2 -width 90 -height 90 -bg red
grid .1 -row 0 -column 0
@@ -131,10 +124,11 @@ test grid-2.9 {bbox} {
lappend a [grid bbox . 0 0 1 1]
lappend a [grid bbox . 1 1]
set a
-} {{0 0 165 165} {0 0 75 75} {0 0 165 165} {75 75 90 90}}
-grid_reset 2.9
+} -cleanup {
+ grid_reset 2.9
+} -result {{0 0 165 165} {0 0 75 75} {0 0 165 165} {75 75 90 90}}
-test grid-2.10 {bbox} {
+test grid-2.10 {bbox} -body {
frame .1 -width 75 -height 75 -bg red
frame .2 -width 90 -height 90 -bg red
grid .1 -row 0 -column 0
@@ -145,97 +139,109 @@ test grid-2.10 {bbox} {
lappend a [grid bbox . -2 -2 -1 -1]
lappend a [grid bbox . 10 10 12 12]
set a
-} {{0 0 165 165} {0 0 0 0} {165 165 0 0}}
-grid_reset 2.10
+} -cleanup {
+ grid_reset 2.10
+} -result {{0 0 165 165} {0 0 0 0} {165 165 0 0}}
-test grid-3.1 {configure: basic argument checking} {
- list [catch {grid configure foo} msg] $msg
-} {1 {bad argument "foo": must be name of window}}
-test grid-3.2 {configure: basic argument checking} {
+test grid-3.1 {configure: basic argument checking} -body {
+ grid configure foo
+} -returnCodes error -result {bad argument "foo": must be name of window}
+test grid-3.2 {configure: basic argument checking} -body {
button .b
grid configure .b
grid slaves .
-} {.b}
-grid_reset 3.2
+} -cleanup {
+ grid_reset 3.2
+} -result {.b}
-test grid-3.3 {configure: basic argument checking} {
+test grid-3.3 {configure: basic argument checking} -body {
button .b
- list [catch {grid .b -row -1} msg] $msg
-} {1 {bad row value "-1": must be a non-negative integer}}
-grid_reset 3.3
+ grid .b -row -1
+} -cleanup {
+ grid_reset 3.3
+} -returnCodes error -result {bad row value "-1": must be a non-negative integer}
-test grid-3.4 {configure: basic argument checking} {
+test grid-3.4 {configure: basic argument checking} -body {
button .b
- list [catch {grid .b -column -1} msg] $msg
-} {1 {bad column value "-1": must be a non-negative integer}}
-grid_reset 3.4
+ grid .b -column -1
+} -cleanup {
+ grid_reset 3.4
+} -returnCodes error -result {bad column value "-1": must be a non-negative integer}
-test grid-3.5 {configure: basic argument checking} {
+test grid-3.5 {configure: basic argument checking} -body {
button .b
- list [catch {grid .b -rowspan 0} msg] $msg
-} {1 {bad rowspan value "0": must be a positive integer}}
-grid_reset 3.5
+ grid .b -rowspan 0
+} -cleanup {
+ grid_reset 3.5
+} -returnCodes error -result {bad rowspan value "0": must be a positive integer}
-test grid-3.6 {configure: basic argument checking} {
+test grid-3.6 {configure: basic argument checking} -body {
button .b
- list [catch {grid .b -columnspan 0} msg] $msg
-} {1 {bad columnspan value "0": must be a positive integer}}
-grid_reset 3.6
+ grid .b -columnspan 0
+} -cleanup {
+ grid_reset 3.6
+} -returnCodes error -result {bad columnspan value "0": must be a positive integer}
-test grid-3.7 {configure: basic argument checking} {
+test grid-3.7 {configure: basic argument checking} -body {
frame .f
button .f.b
- list [catch {grid .f .f.b} msg] $msg
-} {1 {can't put .f.b inside .}}
-grid_reset 3.7
+ grid .f .f.b
+} -cleanup {
+ grid_reset 3.7
+} -returnCodes error -result {can't put .f.b inside .}
-test grid-3.8 {configure: basic argument checking} {
+test grid-3.8 {configure: basic argument checking} -body {
button .b
grid configure x .b
grid slaves .
-} {.b}
-grid_reset 3.8
+} -cleanup {
+ grid_reset 3.8
+} -result {.b}
-test grid-3.9 {configure: basic argument checking} {
+test grid-3.9 {configure: basic argument checking} -body {
button .b
- list [catch {grid configure y .b} msg] $msg
-} {1 {invalid window shortcut, "y" should be '-', 'x', or '^'}}
-grid_reset 3.9
+ grid configure y .b
+} -cleanup {
+ grid_reset 3.9
+} -returnCodes error -result {invalid window shortcut, "y" should be '-', 'x', or '^'}
-test grid-4.1 {forget: basic argument checking} {
- list [catch {grid forget foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test grid-4.2 {forget} {
+test grid-4.1 {forget: basic argument checking} -body {
+ grid forget foo
+} -returnCodes error -result {bad window path name "foo"}
+test grid-4.2 {forget} -body {
button .c
grid [button .b]
set a [grid slaves .]
grid forget .b .c
lappend a [grid slaves .]
set a
-} {.b {}}
-grid_reset 4.2
+} -cleanup {
+ grid_reset 4.2
+} -result {.b {}}
-test grid-4.3 {forget} {
+test grid-4.3 {forget} -body {
button .c
grid .c -row 2 -column 2 -rowspan 2 -columnspan 2 -padx 3 -pady 4 -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
+} -cleanup {
+ grid_reset 4.3
+} -result {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
-test grid-4.3.1 {forget} {
+test grid-4.4 {forget} -body {
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
+} -cleanup {
+ grid_reset 4.3.1
+} -result {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
-test grid-4.4 {forget, calling Tk_UnmaintainGeometry} {
+test grid-4.5 {forget, calling Tk_UnmaintainGeometry} -body {
frame .f -bd 2 -relief raised
place .f -x 10 -y 20 -width 200 -height 100
frame .f2 -width 50 -height 30 -bg red
@@ -246,59 +252,61 @@ test grid-4.4 {forget, calling Tk_UnmaintainGeometry} {
place .f -x 30
update
lappend x [winfo ismapped .f2]
-} {1 0}
-grid_reset 4.4
+} -cleanup {
+ grid_reset 4.4
+} -result {1 0}
-test grid-5.1 {info: basic argument checking} {
- list [catch {grid info a b} msg] $msg
-} {1 {wrong # args: should be "grid info window"}}
-test grid-5.2 {info} {
+test grid-5.1 {info: basic argument checking} -body {
+ grid info a b
+} -returnCodes error -result {wrong # args: should be "grid info window"}
+test grid-5.2 {info} -body {
frame .1 -width 75 -height 75 -bg red
grid .1 -row 0 -column 0
update
- list [catch {grid info .x} msg] $msg
-} {1 {bad window path name ".x"}}
-grid_reset 5.2
+ grid info .x
+} -cleanup {
+ grid_reset 5.2
+} -returnCodes error -result {bad window path name ".x"}
-test grid-5.3 {info} {
+test grid-5.3 {info} -body {
frame .1 -width 75 -height 75 -bg red
grid .1 -row 0 -column 0
update
- list [catch {grid info .1} msg] $msg
-} {0 {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}}
-grid_reset 5.3
+ grid info .1
+} -cleanup {
+ grid_reset 5.3
+} -result {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
-test grid-5.4 {info} {
+test grid-5.4 {info} -body {
frame .1 -width 75 -height 75 -bg red
update
- list [catch {grid info .1} msg] $msg
-} {0 {}}
-grid_reset 5.4
-
-test grid-6.1 {location: basic argument checking} {
- list [catch "grid location ." msg] $msg
-} {1 {wrong # args: should be "grid location master x y"}}
-
-test grid-6.2 {location: basic argument checking} {
- list [catch "grid location .bad 0 0" msg] $msg
-} {1 {bad window path name ".bad"}}
-
-test grid-6.3 {location: basic argument checking} {
- list [catch "grid location . x y" msg] $msg
-} {1 {bad screen distance "x"}}
-
-test grid-6.4 {location: basic argument checking} {
- list [catch "grid location . 1c y" msg] $msg
-} {1 {bad screen distance "y"}}
-
-test grid-6.5 {location: basic argument checking} {
+ grid info .1
+} -cleanup {
+ grid_reset 5.4
+} -returnCodes ok -result {}
+
+
+test grid-6.1 {location: basic argument checking} -body {
+ grid location .
+} -returnCodes error -result {wrong # args: should be "grid location master x y"}
+test grid-6.2 {location: basic argument checking} -body {
+ grid location .bad 0 0
+} -returnCodes error -result {bad window path name ".bad"}
+test grid-6.3 {location: basic argument checking} -body {
+ grid location . x y
+} -returnCodes error -result {bad screen distance "x"}
+test grid-6.4 {location: basic argument checking} -body {
+ grid location . 1c y
+} -returnCodes error -result {bad screen distance "y"}
+test grid-6.5 {location: basic argument checking} -body {
frame .f
grid location .f 10 10
-} {-1 -1}
-grid_reset 6.5
+} -cleanup {
+ grid_reset 6.5
+} -result {-1 -1}
-test grid-6.6 {location (x)} {
+test grid-6.6 {location (x)} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -312,10 +320,11 @@ test grid-6.6 {location (x)} {
}
}
set result
-} {{-10->-1 0} {0->0 0} {201->1 0}}
-grid_reset 6.6
+} -cleanup {
+ grid_reset 6.6
+} -result {{-10->-1 0} {0->0 0} {201->1 0}}
-test grid-6.7 {location (y)} {
+test grid-6.7 {location (y)} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -329,10 +338,11 @@ test grid-6.7 {location (y)} {
}
}
set result
-} {{-10->0 -1} {0->0 0} {101->0 1}}
-grid_reset 6.7
+} -cleanup {
+ grid_reset 6.7
+} -result {{-10->0 -1} {0->0 0} {101->0 1}}
-test grid-6.8 {location (weights)} {
+test grid-6.8 {location (weights)} -body {
frame .f -width 300 -height 100 -highlightthickness 0 -bg red
frame .a
grid .a
@@ -352,10 +362,13 @@ test grid-6.8 {location (weights)} {
}
}
set result
-} {{-10->-1 -1} {0->0 0} {16->0 1} {201->1 1}}
-grid_reset 6.8
+} -cleanup {
+ grid_reset 6.8
+} -result {{-10->-1 -1} {0->0 0} {16->0 1} {201->1 1}}
-test grid-6.9 {location: check updates pending} {nonPortable} {
+test grid-6.9 {location: check updates pending} -constraints {
+ nonPortable
+} -body {
set a ""
foreach i {0 1 2} {
frame .$i -width 120 -height 75 -bg red
@@ -363,35 +376,42 @@ test grid-6.9 {location: check updates pending} {nonPortable} {
grid .$i -row $i -column $i
}
set a
-} {{0 0} {1 1} {1 1}}
-grid_reset 6.9
-
-test grid-7.1 {propagate} {
- list [catch {grid propagate . 1 xxx} msg] $msg
-} {1 {wrong # args: should be "grid propagate window ?boolean?"}}
-grid_reset 7.1
-
-test grid-7.2 {propagate} {
- list [catch {grid propagate .} msg] $msg
-} {0 1}
-grid_reset 7.2
-
-test grid-7.3 {propagate} {
- list [catch {grid propagate . 0;grid propagate .} msg] $msg
-} {0 0}
-grid_reset 7.3
-
-test grid-7.4 {propagate} {
- list [catch {grid propagate .x} msg] $msg
-} {1 {bad window path name ".x"}}
-grid_reset 7.4
-
-test grid-7.5 {propagate} {
- list [catch {grid propagate . x} msg] $msg
-} {1 {expected boolean value but got "x"}}
-grid_reset 7.5
-
-test grid-7.6 {propagate} {
+} -cleanup {
+ grid_reset 6.9
+} -result {{0 0} {1 1} {1 1}}
+
+
+test grid-7.1 {propagate} -body {
+ grid propagate . 1 xxx
+} -cleanup {
+ grid_reset 7.1
+} -returnCodes error -result {wrong # args: should be "grid propagate window ?boolean?"}
+
+test grid-7.2 {propagate} -body {
+ grid propagate .
+} -cleanup {
+ grid_reset 7.2
+} -result {1}
+
+test grid-7.3 {propagate} -body {
+ grid propagate . 0;grid propagate .
+} -cleanup {
+ grid_reset 7.3
+} -result {0}
+
+test grid-7.4 {propagate} -body {
+ grid propagate .x
+} -cleanup {
+ grid_reset 7.4
+} -returnCodes error -result {bad window path name ".x"}
+
+test grid-7.5 {propagate} -body {
+ grid propagate . x
+} -cleanup {
+ grid_reset 7.5
+} -returnCodes error -result {expected boolean value but got "x"}
+
+test grid-7.6 {propagate} -body {
frame .f -width 100 -height 100 -bg red
grid .f -row 0 -column 0
update
@@ -405,9 +425,10 @@ test grid-7.6 {propagate} {
update
lappend a [winfo width .f]x[winfo height .f]
set a
-} {100x100 100x100 75x85}
-grid_reset 7.6
-test grid-7.7 {propagate} {
+} -cleanup {
+ grid_reset 7.6
+} -result {100x100 100x100 75x85}
+test grid-7.7 {propagate} -body {
grid propagate . 1
set res [list [grid propagate .]]
grid propagate . 0
@@ -415,26 +436,31 @@ test grid-7.7 {propagate} {
grid propagate . 0
lappend res [grid propagate .]
set res
-} [list 1 0 0]
-grid_reset 7.7
+} -cleanup {
+ grid_reset 7.7
+} -result [list 1 0 0]
+
-test grid-8.1 {size} {
- list [catch {grid size . foo} msg] $msg
-} {1 {wrong # args: should be "grid size window"}}
-grid_reset 8.1
+test grid-8.1 {size} -body {
+ grid size . foo
+} -cleanup {
+ grid_reset 8.1
+} -returnCodes error -result {wrong # args: should be "grid size window"}
-test grid-8.2 {size} {
- list [catch {grid size .x} msg] $msg
-} {1 {bad window path name ".x"}}
-grid_reset 8.2
+test grid-8.2 {size} -body {
+ grid size .x
+} -cleanup {
+ grid_reset 8.2
+} -returnCodes error -result {bad window path name ".x"}
-test grid-8.3 {size} {
+test grid-8.3 {size} -body {
frame .f
- list [catch {grid size .f} msg] $msg
-} {0 {0 0}}
-grid_reset 8.3
+ grid size .f
+} -cleanup {
+ grid_reset 8.3
+} -result {0 0}
-test grid-8.4 {size} {
+test grid-8.4 {size} -body {
catch {unset a}
scale .f
grid .f -row 0 -column 0
@@ -450,10 +476,11 @@ test grid-8.4 {size} {
update
lappend a [grid size .]
set a
-} {{1 1} {6 5} {664 948} {1 1}}
-grid_reset 8.4
+} -cleanup {
+ grid_reset 8.4
+} -result {{1 1} {6 5} {664 948} {1 1}}
-test grid-8.5 {size} {
+test grid-8.5 {size} -body {
catch {unset a}
scale .f
grid .f -row 0 -column 0
@@ -470,10 +497,11 @@ test grid-8.5 {size} {
update
lappend a [grid size .]
set a
-} {{1 1} {1 18} {64 18} {1 1}}
-grid_reset 8.5
+} -cleanup {
+ grid_reset 8.5
+} -result {{1 1} {1 18} {64 18} {1 1}}
-test grid-8.6 {size} {
+test grid-8.6 {size} -body {
catch {unset a}
scale .f
grid .f -row 10 -column 50
@@ -496,55 +524,49 @@ test grid-8.6 {size} {
update
lappend a [grid size .]
set a
-} {{51 11} {51 11} {31 11} {21 11} {16 1} {1 1}}
-grid_reset 8.6
-
-test grid-9.1 {slaves} {
- list [catch {grid slaves .} msg] $msg
-} {0 {}}
-
-test grid-9.2 {slaves} {
- list [catch {grid slaves .foo} msg] $msg
-} {1 {bad window path name ".foo"}}
-
-test grid-9.3 {slaves} {
- list [catch {grid slaves a b} msg] $msg
-} {1 {wrong # args: should be "grid slaves window ?-option value...?"}}
-
-test grid-9.4 {slaves} {
- list [catch {grid slaves . a b} msg] $msg
-} {1 {bad option "a": must be -column or -row}}
-
-test grid-9.5 {slaves} {
- list [catch {grid slaves . -column x} msg] $msg
-} {1 {expected integer but got "x"}}
-
-test grid-9.6 {slaves} {
- 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 {bad option "-foo": must be -column or -row}}
-
-test grid-9.8 {slaves} {
- list [catch {grid slaves .x -row 3} msg] $msg
-} {1 {bad window path name ".x"}}
-
-test grid-9.9 {slaves} {
- list [catch {grid slaves . -row 3} msg] $msg
-} {0 {}}
-
-test grid-9.10 {slaves} {
+} -cleanup {
+ grid_reset 8.6
+} -result {{51 11} {51 11} {31 11} {21 11} {16 1} {1 1}}
+
+
+test grid-9.1 {slaves} -body {
+ grid slaves .
+} -returnCodes ok -result {}
+test grid-9.2 {slaves} -body {
+ grid slaves .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test grid-9.3 {slaves} -body {
+ grid slaves a b
+} -returnCodes error -result {wrong # args: should be "grid slaves window ?-option value ...?"}
+test grid-9.4 {slaves} -body {
+ grid slaves . a b
+} -returnCodes error -result {bad option "a": must be -column or -row}
+test grid-9.5 {slaves} -body {
+ grid slaves . -column x
+} -returnCodes error -result {expected integer but got "x"}
+test grid-9.6 {slaves} -body {
+ grid slaves . -row -3
+} -returnCodes error -result {-row is an invalid value: should NOT be < 0}
+test grid-9.7 {slaves} -body {
+ grid slaves . -foo 3
+} -returnCodes error -result {bad option "-foo": must be -column or -row}
+test grid-9.8 {slaves} -body {
+ grid slaves .x -row 3
+} -returnCodes error -result {bad window path name ".x"}
+test grid-9.9 {slaves} -body {
+ grid slaves . -row 3
+} -returnCodes ok -result {}
+test grid-9.10 {slaves} -body {
foreach i {0 1 2} {
label .$i -text $i
grid .$i -row $i -column $i
}
- list [catch {grid slaves .} msg] $msg
-} {0 {.2 .1 .0}}
-grid_reset 9.10
+ grid slaves .
+} -cleanup {
+ grid_reset 9.10
+} -result {.2 .1 .0}
-test grid-9.11 {slaves} {
+test grid-9.11 {slaves} -body {
catch {unset a}
foreach i {0 1 2} {
label .$i -text $i
@@ -559,95 +581,112 @@ test grid-9.11 {slaves} {
lappend a $col{[grid slaves . -column $col]}
}
set a
-} {{0{.0-x .0}} {1{.1-x .1}} {2{.2-x .2}} 3{} 0{.0} {1{.1 .0-x}} {2{.2 .1-x}} 3{.2-x}}
-grid_reset 9.11
+} -cleanup {
+ grid_reset 9.11
+} -result {{0{.0-x .0}} {1{.1-x .1}} {2{.2-x .2}} 3{} 0{.0} {1{.1 .0-x}} {2{.2 .1-x}} 3{.2-x}}
-# column/row configure
-test grid-10.1 {column/row configure} {
- list [catch {grid columnconfigure .} msg] $msg
-} {1 {wrong # args: should be "grid columnconfigure master index ?-option value...?"}}
-grid_reset 10.1
-
-test grid-10.2 {column/row configure} {
- list [catch {grid columnconfigure . 0 -weight 0 -pad} msg] $msg
-} {1 {wrong # args: should be "grid columnconfigure master index ?-option value...?"}}
-grid_reset 10.2
-
-test grid-10.3 {column/row configure} {
- list [catch {grid columnconfigure .f 0 -weight} msg] $msg
-} {1 {bad window path name ".f"}}
-grid_reset 10.3
-
-test grid-10.4 {column/row configure} {
- list [catch {grid columnconfigure . nine -weight} msg] $msg
-} {1 {expected integer but got "nine" (when retreiving options only integer indices are allowed)}}
-grid_reset 10.4
-
-test grid-10.5 {column/row configure} {
- list [catch {grid columnconfigure . 265 -weight} msg] $msg
-} {0 0}
-grid_reset 10.5
-
-test grid-10.6 {column/row configure} {
- list [catch {grid columnconfigure . 0} msg] $msg
-} {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 {bad option "-foo": must be -minsize, -pad, -uniform, or -weight}}
-grid_reset 10.7
-
-test grid-10.8 {column/row configure} {
- list [catch {grid columnconfigure . 0 -minsize foo} msg] $msg
-} {1 {bad screen distance "foo"}}
-grid_reset 10.8
-
-test grid-10.9 {column/row configure} {
- list [catch {grid columnconfigure . 0 -minsize foo} msg] $msg
-} {1 {bad screen distance "foo"}}
-grid_reset 10.9
-
-test grid-10.10 {column/row configure} {
+# column/row configure
+test grid-10.1 {column/row configure} -body {
+ grid columnconfigure .
+} -cleanup {
+ grid_reset 10.1
+} -returnCodes error -result {wrong # args: should be "grid columnconfigure master index ?-option value ...?"}
+
+test grid-10.2 {column/row configure} -body {
+ grid columnconfigure . 0 -weight 0 -pad
+} -cleanup {
+ grid_reset 10.2
+} -returnCodes error -result {wrong # args: should be "grid columnconfigure master index ?-option value ...?"}
+
+test grid-10.3 {column/row configure} -body {
+ grid columnconfigure .f 0 -weight
+} -cleanup {
+ grid_reset 10.3
+} -returnCodes error -result {bad window path name ".f"}
+
+test grid-10.4 {column/row configure} -body {
+ grid columnconfigure . nine -weight
+} -cleanup {
+ grid_reset 10.4
+} -returnCodes error -result {expected integer but got "nine" (when retreiving options only integer indices are allowed)}
+
+test grid-10.5 {column/row configure} -body {
+ grid columnconfigure . 265 -weight
+} -cleanup {
+ grid_reset 10.5
+} -result {0}
+
+test grid-10.6 {column/row configure} -body {
+ grid columnconfigure . 0
+} -cleanup {
+ grid_reset 10.6
+} -result {-minsize 0 -pad 0 -uniform {} -weight 0}
+
+test grid-10.7 {column/row configure} -body {
+ grid columnconfigure . 0 -foo
+} -cleanup {
+ grid_reset 10.7
+} -returnCodes error -result {bad option "-foo": must be -minsize, -pad, -uniform, or -weight}
+
+test grid-10.8 {column/row configure} -body {
+ grid columnconfigure . 0 -minsize foo
+} -cleanup {
+ grid_reset 10.8
+} -returnCodes error -result {bad screen distance "foo"}
+
+test grid-10.9 {column/row configure} -body {
+ grid columnconfigure . 0 -minsize foo
+} -cleanup {
+ grid_reset 10.9
+} -returnCodes error -result {bad screen distance "foo"}
+
+test grid-10.10 {column/row configure} -body {
grid columnconfigure . 0 -minsize 10
grid columnconfigure . 0 -minsize
-} {10}
-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.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.12
-
-test grid-10.13 {column/row configure} {
+} -cleanup {
+ grid_reset 10.10
+} -result {10}
+
+test grid-10.11 {column/row configure} -body {
+ grid columnconfigure . 0 -weight bad
+} -cleanup {
+ grid_reset 10.11
+} -returnCodes error -result {expected integer but got "bad"}
+
+test grid-10.12 {column/row configure} -body {
+ grid columnconfigure . 0 -weight -3
+} -cleanup {
+ grid_reset 10.12
+} -returnCodes error -result {invalid arg "-weight": should be non-negative}
+
+test grid-10.13 {column/row configure} -body {
grid columnconfigure . 0 -weight 3
grid columnconfigure . 0 -weight
-} {3}
-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.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.15
-
-test grid-10.16 {column/row configure} {
+} -cleanup {
+ grid_reset 10.13
+} -result {3}
+
+test grid-10.14 {column/row configure} -body {
+ grid columnconfigure . 0 -pad foo
+} -cleanup {
+ grid_reset 10.14
+} -returnCodes error -result {bad screen distance "foo"}
+
+test grid-10.15 {column/row configure} -body {
+ grid columnconfigure . 0 -pad -3
+} -cleanup {
+ grid_reset 10.15
+} -returnCodes error -result {invalid arg "-pad": should be non-negative}
+
+test grid-10.16 {column/row configure} -body {
grid columnconfigure . 0 -pad 3
grid columnconfigure . 0 -pad
-} {3}
-grid_reset 10.16
+} -cleanup {
+ grid_reset 10.16
+} -result {3}
-test grid-10.17 {column/row configure} {
+test grid-10.17 {column/row configure} -body {
frame .f
set a ""
grid columnconfigure .f 0 -weight 0
@@ -660,10 +699,11 @@ test grid-10.17 {column/row configure} {
lappend a [grid columnconfigure .f 0 -weight]
grid columnconfigure .f 0 -weight 0
set a
-} {0 1 0 1}
-grid_reset 10.17
+} -cleanup {
+ grid_reset 10.17
+} -result {0 1 0 1}
-test grid-10.18 {column/row configure} {
+test grid-10.18 {column/row configure} -body {
frame .f
grid columnconfigure .f {0 2} -minsize 10 -weight 1
list [grid columnconfigure .f 0 -minsize] \
@@ -672,32 +712,37 @@ test grid-10.18 {column/row configure} {
[grid columnconfigure .f 0 -weight] \
[grid columnconfigure .f 1 -weight] \
[grid columnconfigure .f 2 -weight]
-} {10 0 10 1 0 1}
-grid_reset 10.18
+} -cleanup {
+ grid_reset 10.18
+} -result {10 0 10 1 0 1}
-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.19 {column/row configure} -body {
+ grid columnconfigure . {0 -1 2} -weight 1
+} -cleanup {
+ grid_reset 10.19
+} -returnCodes error -result {grid columnconfigure: "-1" is out of range}
-test grid-10.20 {column/row configure} {
+test grid-10.20 {column/row configure} -body {
grid columnconfigure . 0 -uniform foo
grid columnconfigure . 0 -uniform
-} {foo}
-grid_reset 10.20
+} -cleanup {
+ grid_reset 10.20
+} -result {foo}
-test grid-10.21 {column/row configure} {
- list [catch {grid columnconfigure . .b -weight 1} msg] $msg
-} {1 {grid columnconfigure: illegal index ".b"}}
-grid_reset 10.21
+test grid-10.21 {column/row configure} -body {
+ grid columnconfigure . .b -weight 1
+} -cleanup {
+ grid_reset 10.21
+} -returnCodes error -result {grid columnconfigure: illegal index ".b"}
-test grid-10.22 {column/row configure} {
+test grid-10.22 {column/row configure} -body {
button .b
- list [catch {grid columnconfigure . .b -weight 1} msg] $msg
-} {1 {grid columnconfigure: the window ".b" is not managed by "."}}
-grid_reset 10.22
+ grid columnconfigure . .b -weight 1
+} -cleanup {
+ grid_reset 10.22
+} -returnCodes error -result {grid columnconfigure: the window ".b" is not managed by "."}
-test grid-10.23 {column/row configure} {
+test grid-10.23 {column/row configure} -body {
button .b
grid .b -column 1 -columnspan 2
grid columnconfigure . .b -weight 1
@@ -706,10 +751,11 @@ test grid-10.23 {column/row configure} {
lappend res [grid columnconfigure . $i -weight]
}
set res
-} {0 1 1 0}
-grid_reset 10.23
+} -cleanup {
+ grid_reset 10.23
+} -result {0 1 1 0}
-test grid-10.24 {column/row configure} {
+test grid-10.24 {column/row configure} -body {
button .b
button .c
button .d
@@ -723,10 +769,11 @@ test grid-10.24 {column/row configure} {
lappend res [grid columnconfigure . $i -weight]
}
set res
-} {0 1 2 2 2 1 0}
-grid_reset 10.24
+} -cleanup {
+ grid_reset 10.24
+} -result {0 1 2 2 2 1 0}
-test grid-10.25 {column/row configure} {
+test grid-10.25 {column/row configure} -body {
button .b
button .c
button .d
@@ -740,46 +787,43 @@ test grid-10.25 {column/row configure} {
lappend res [grid rowconfigure . $i -weight]
}
set res
-} {0 2 1 1 2 2 0 1}
-grid_reset 10.25
+} -cleanup {
+ grid_reset 10.25
+} -result {0 2 1 1 2 2 0 1}
-test grid-10.26 {column/row configure} {
+test grid-10.26 {column/row configure} -body {
button .b
grid columnconfigure .b 0
-} {-minsize 0 -pad 0 -uniform {} -weight 0}
-grid_reset 10.26
+} -cleanup {
+ grid_reset 10.26
+} -result {-minsize 0 -pad 0 -uniform {} -weight 0}
-test grid-10.30 {column/row configure - no indices} {
+test grid-10.27 {column/row configure - no indices} -body {
# Bug 1422430
set t [toplevel .test]
- set res [list [catch {grid columnconfigure $t "" -weight 1} msg] $msg]
+ grid columnconfigure $t "" -weight 1
+} -cleanup {
destroy $t
- set res
-} {1 {no column indices specified}}
-
-test grid-10.31 {column/row configure - no indices} {
+} -returnCodes error -result {no column indices specified}
+test grid-10.28 {column/row configure - no indices} -body {
set t [toplevel .test]
- set res [list [catch {grid rowconfigure $t "" -weight 1} msg] $msg]
+ grid rowconfigure $t "" -weight 1
+} -cleanup {
destroy $t
- set res
-} {1 {no row indices specified}}
-
-test grid-10.32 {column/row configure - invalid indices} {
- list [catch {grid columnconfigure . {0 1 2} -weight} msg] $msg
-} {1 {grid columnconfigure: must specify a single element on retrieval}}
-
-test grid-10.33 {column/row configure - invalid indices} {
- list [catch {grid rowconfigure . {0 1 2} -weight} msg] $msg
-} {1 {grid rowconfigure: must specify a single element on retrieval}}
-
-test grid-10.34 {column/row configure - empty 'all' configure} {
+} -returnCodes error -result {no row indices specified}
+test grid-10.29 {column/row configure - invalid indices} -body {
+ grid columnconfigure . {0 1 2} -weight
+} -returnCodes error -result {grid columnconfigure: must specify a single element on retrieval}
+test grid-10.30 {column/row configure - invalid indices} -body {
+ grid rowconfigure . {0 1 2} -weight
+} -returnCodes error -result {grid rowconfigure: must specify a single element on retrieval}
+test grid-10.31 {column/row configure - empty 'all' configure} -body {
# Bug 1422430
set t [toplevel .test]
grid rowconfigure $t all -weight 1
destroy $t
-} {}
-
-test grid-10.35 {column/row configure} {
+} -result {}
+test grid-10.32 {column/row configure} -body {
# Test that no lingering message is there
frame .f
set res [grid columnconfigure .f all -weight 1]
@@ -791,20 +835,23 @@ test grid-10.35 {column/row configure} {
append res [grid columnconfigure .f {2 .f.f} -weight 1]
destroy .f
set res
-} {}
-grid_reset 10.35
-
-test grid-10.36 {column/row configure} {
- list [catch {grid columnconfigure . all} msg] $msg
-} {1 {expected integer but got "all" (when retreiving options only integer indices are allowed)}}
-grid_reset 10.36
-
-test grid-10.37 {column/row configure} {
- list [catch {grid columnconfigure . 100000} msg] $msg
-} {0 {-minsize 0 -pad 0 -uniform {} -weight 0}}
-grid_reset 10.37
-
-test grid-10.38 {column/row configure} -body {
+} -cleanup {
+ grid_reset 10.35
+} -result {}
+
+test grid-10.33 {column/row configure} -body {
+ grid columnconfigure . all
+} -cleanup {
+ grid_reset 10.36
+} -returnCodes error -result {expected integer but got "all" (when retreiving options only integer indices are allowed)}
+
+test grid-10.34 {column/row configure} -body {
+ grid columnconfigure . 100000
+} -cleanup {
+ grid_reset 10.37
+} -result {-minsize 0 -pad 0 -uniform {} -weight 0}
+
+test grid-10.35 {column/row configure} -body {
# This is a test for bug 1423666 where a column >= 10000 caused
# a crash in layout. The update is needed to reach the layout stage.
# Test different combinations of row/column overflow
@@ -827,7 +874,7 @@ test grid-10.38 {column/row configure} -body {
} 0 end]
grid_reset 10.38
-test grid-10.39 {column/row configure} -body {
+test grid-10.36 {column/row configure} -body {
# Additional tests for row/column overflow
frame .f
frame .g
@@ -849,38 +896,43 @@ test grid-10.39 {column/row configure} -body {
} 0 end]
grid_reset 10.39
-# auto-placement tests
-test grid-11.1 {default widget placement} {
- list [catch {grid ^} msg] $msg
-} {1 {can't use '^', cant find master}}
-grid_reset 11.1
+# auto-placement tests
+test grid-11.1 {default widget placement} -body {
+ grid ^
+} -cleanup {
+ grid_reset 11.1
+} -returnCodes error -result {can't use '^', cant find master}
-test grid-11.2 {default widget placement} {
+test grid-11.2 {default widget placement} -body {
button .b
- list [catch {grid .b ^} msg] $msg
-} {1 {can't find slave to extend with "^".}}
-grid_reset 11.2
+ grid .b ^
+} -cleanup {
+ grid_reset 11.2
+} -returnCodes error -result {can't find slave to extend with "^".}
-test grid-11.3 {default widget placement} {
+test grid-11.3 {default widget placement} -body {
button .b
- list [catch {grid .b - - .c} msg] $msg
-} {1 {bad window path name ".c"}}
-grid_reset 11.3
+ grid .b - - .c
+} -cleanup {
+ grid_reset 11.3
+} -returnCodes error -result {bad window path name ".c"}
-test grid-11.4 {default widget placement} {
+test grid-11.4 {default widget placement} -body {
button .b
- list [catch {grid .b - - = -} msg] $msg
-} {1 {invalid window shortcut, "=" should be '-', 'x', or '^'}}
-grid_reset 11.4
+ grid .b - - = -
+} -cleanup {
+ grid_reset 11.4
+} -returnCodes error -result {invalid window shortcut, "=" should be '-', 'x', or '^'}
-test grid-11.5 {default widget placement} {
+test grid-11.5 {default widget placement} -body {
button .b
- list [catch {grid .b - x -} msg] $msg
-} {1 {Must specify window before shortcut '-'.}}
-grid_reset 11.5
+ grid .b - x -
+} -cleanup {
+ grid_reset 11.5
+} -returnCodes error -result {Must specify window before shortcut '-'.}
-test grid-11.6 {default widget placement} {
+test grid-11.6 {default widget placement} -body {
foreach i {1 2 3 4 5 6} {
frame .f$i -width 50 -height 50 -highlightthickness 0 -bg red
}
@@ -893,31 +945,35 @@ test grid-11.6 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,50 100,50} {150,50 50,50}}
-grid_reset 11.6
+} -cleanup {
+ grid_reset 11.6
+} -result {{0,50 100,50} {150,50 50,50}}
-test grid-11.7 {default widget placement} {
+test grid-11.7 {default widget placement} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
grid .f -row 5 -column 5
- list [catch "grid .f x -" msg] $msg
-} {1 {Must specify window before shortcut '-'.}}
-grid_reset 11.7
+ grid .f x -
+} -cleanup {
+ grid_reset 11.7
+} -returnCodes error -result {Must specify window before shortcut '-'.}
-test grid-11.8 {default widget placement} {
+test grid-11.8 {default widget placement} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
grid .f -row 5 -column 5
- list [catch "grid .f ^ -" msg] $msg
-} {1 {Must specify window before shortcut '-'.}}
-grid_reset 11.8
+ grid .f ^ -
+} -cleanup {
+ grid_reset 11.8
+} -returnCodes error -result {Must specify window before shortcut '-'.}
-test grid-11.9 {default widget placement} {
+test grid-11.9 {default widget placement} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
grid .f -row 5 -column 5
- list [catch "grid .f x ^" msg] $msg
-} {1 {can't find slave to extend with "^".}}
-grid_reset 11.9
+ grid .f x ^
+} -cleanup {
+ grid_reset 11.9
+} -returnCodes error -result {can't find slave to extend with "^".}
-test grid-11.10 {default widget placement} {
+test grid-11.10 {default widget placement} -body {
foreach i {1 2 3} {
frame .f$i -width 100 -height 50 -highlightthickness 0 -bg red
}
@@ -930,10 +986,11 @@ test grid-11.10 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,0 100,50} {100,0 100,100} {0,50 100,50}}
-grid_reset 11.10
+} -cleanup {
+ grid_reset 11.10
+} -result {{0,0 100,50} {100,0 100,100} {0,50 100,50}}
-test grid-11.11 {default widget placement} {
+test grid-11.11 {default widget placement} -body {
foreach i {1 2 3 4 5 6 7 8 9 10 11 12} {
frame .f$i -width 50 -height 50 -highlightthickness 1 -highlightbackground black
}
@@ -949,10 +1006,11 @@ test grid-11.11 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,50 50,50} {50,50 100,150} {150,50 50,50} {0,100 50,50} {150,100 50,50} {0,150 50,50} {150,150 50,50} {0,200 200,50}}
-grid_reset 11.11
+} -cleanup {
+ grid_reset 11.11
+} -result {{0,50 50,50} {50,50 100,150} {150,50 50,50} {0,100 50,50} {150,100 50,50} {0,150 50,50} {150,150 50,50} {0,200 200,50}}
-test grid-11.12 {default widget placement} {
+test grid-11.12 {default widget placement} -body {
foreach i {1 2 3 4} {
frame .f$i -width 75 -height 50 -highlightthickness 1 -highlightbackground black
}
@@ -971,10 +1029,11 @@ test grid-11.12 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,0 75,50} {75,0 75,100} {150,0 75,50} {0,50 75,50} {0,0 75,50} {75,0 75,100} {150,0 75,100} {75,50 75,50}}
-grid_reset 11.12
+} -cleanup {
+ grid_reset 11.12
+} -result {{0,0 75,50} {75,0 75,100} {150,0 75,50} {0,50 75,50} {0,0 75,50} {75,0 75,100} {150,0 75,100} {75,50 75,50}}
-test grid-11.13 {default widget placement} {
+test grid-11.13 {default widget placement} -body {
foreach i {1 2 3 4 5 6 7} {
frame .f$i -width 40 -height 50 -highlightthickness 1 -highlightbackground black
}
@@ -987,10 +1046,11 @@ test grid-11.13 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,50 120,50} {120,50 80,50}}
-grid_reset 11.13
+} -cleanup {
+ grid_reset 11.13
+} -result {{0,50 120,50} {120,50 80,50}}
-test grid-11.14 {default widget placement} {
+test grid-11.14 {default widget placement} -body {
foreach i {1 2 3} {
frame .f$i -width 60 -height 60 -highlightthickness 0 -bg red
}
@@ -1003,10 +1063,11 @@ test grid-11.14 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,30 60,60} {60,0 60,60} {60,60 60,60}}
-grid_reset 11.14
+} -cleanup {
+ grid_reset 11.14
+} -result {{0,30 60,60} {60,0 60,60} {60,60 60,60}}
-test grid-11.15 {^ ^ test with multiple windows} {
+test grid-11.15 {^ ^ test with multiple windows} -body {
foreach i {1 2 3 4} {
frame .f$i -width 50 -height 50 -bd 1 -relief solid
}
@@ -1019,24 +1080,26 @@ test grid-11.15 {^ ^ test with multiple windows} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,0 50,50} {50,0 50,100} {100,0 50,100} {0,50 50,50}}
-grid_reset 11.15
+} -cleanup {
+ grid_reset 11.15
+} -result {{0,0 50,50} {50,0 50,100} {100,0 50,100} {0,50 50,50}}
-test grid-11.16 {default widget placement} {
+test grid-11.16 {default widget placement} -body {
foreach l {a b c d e} {
frame .$l -width 50 -height 50
}
- grid .a .b .c .d -sticky news
+ 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
+} -cleanup {
+ grid_reset 11.16
+} -result {50 100 50}
-test grid-11.17 {default widget placement} {
+test grid-11.17 {default widget placement} -body {
foreach l {a b c d e} {
frame .$l -width 50 -height 50
}
@@ -1047,10 +1110,11 @@ test grid-11.17 {default widget placement} {
lappend res [winfo height .a]
lappend res [winfo height .b]
lappend res [winfo height .c]
-} {100 50 100}
-grid_reset 11.17
+} -cleanup {
+ grid_reset 11.17
+} -result {100 50 100}
-test grid-11.18 {default widget placement} {
+test grid-11.18 {default widget placement} -body {
foreach l {a b c d e} {
frame .$l -width 50 -height 50
}
@@ -1063,10 +1127,11 @@ test grid-11.18 {default widget placement} {
lappend res [winfo height .b]
lappend res [winfo height .c]
lappend res [winfo height .d]
-} {100 100 100 50}
-grid_reset 11.18
+} -cleanup {
+ grid_reset 11.18
+} -result {100 100 100 50}
-test grid-11.19 {default widget placement} {
+test grid-11.19 {default widget placement} -body {
foreach l {a b c d e} {
frame .$l -width 50 -height 50
}
@@ -1082,10 +1147,12 @@ test grid-11.19 {default widget placement} {
lappend res [winfo height .b]
lappend res [winfo height .c]
lappend res [winfo height .d]
-} {50 100 100 50}
-grid_reset 11.19
+} -cleanup {
+ grid_reset 11.19
+} -result {50 100 100 50}
+
-test grid-12.1 {-sticky} {
+test grid-12.1 {-sticky} -body {
catch {unset data}
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
set a ""
@@ -1101,7 +1168,9 @@ test grid-12.1 {-sticky} {
append a "($data(-sticky)) [winfo x .f] [winfo y .f] [winfo width .f] [winfo height .f]\n"
}
set a
-} {() 25 25 200 100
+} -cleanup {
+ grid_reset 12.1
+} -result {() 25 25 200 100
(n) 25 0 200 100
(s) 25 50 200 100
(e) 50 25 200 100
@@ -1118,63 +1187,71 @@ test grid-12.1 {-sticky} {
(new) 0 0 250 100
(nesw) 0 0 250 150
}
-grid_reset 12.1
-
-test grid-12.2 {-sticky} {
+
+test grid-12.2 {-sticky} -body {
frame .f -bg red
- list [catch "grid .f -sticky glue" msg] $msg
-} {1 {bad stickyness value "glue": must be a string containing n, e, s, and/or w}}
-grid_reset 12.2
-
-test grid-12.3 {-sticky} {
+ grid .f -sticky glue
+} -cleanup {
+ grid_reset 12.2
+} -returnCodes error -result {bad stickyness value "glue": must be a string containing n, e, s, and/or w}
+
+test grid-12.3 {-sticky} -body {
frame .f -bg red
grid .f -sticky {n,s,e,w}
array set A [grid info .f]
set A(-sticky)
-} {nesw}
-grid_reset 12.3
+} -cleanup {
+ grid_reset 12.3
+} -result {nesw}
-test grid-13.1 {-in} {
+
+test grid-13.1 {-in} -body {
frame .f -bg red
- list [catch "grid .f -in .f" msg] $msg
-} {1 {Window can't be managed in itself}}
-grid_reset 13.1
+ grid .f -in .f
+} -cleanup {
+ grid_reset 13.1
+} -returnCodes error -result {Window can't be managed in itself}
-test grid-13.1.1 {-in} {
+test grid-13.2 {-in} -body {
frame .f -bg red
list [winfo manager .f] \
[catch {grid .f -in .f} err] $err \
[winfo manager .f]
-} {{} 1 {Window can't be managed in itself} {}}
-grid_reset 13.1.1
+} -cleanup {
+ grid_reset 13.1.1
+} -result {{} 1 {Window can't be managed in itself} {}}
-test grid-13.2 {-in} {
+test grid-13.3 {-in} -body {
frame .f -bg red
- list [catch "grid .f -in .bad" msg] $msg
-} {1 {bad window path name ".bad"}}
-grid_reset 13.2
+ grid .f -in .bad
+} -cleanup {
+ grid_reset 13.2
+} -returnCodes error -result {bad window path name ".bad"}
-test grid-13.3 {-in} {
+test grid-13.4 {-in} -body {
frame .f -bg red
toplevel .top
- list [catch "grid .f -in .top" msg] $msg
-} {1 {can't put .f inside .top}}
+ grid .f -in .top
+} -cleanup {
+ grid_reset 13.3
+} -returnCodes error -result {can't put .f inside .top}
destroy .top
-grid_reset 13.3
-test grid-13.4 {-ipadx} {
+test grid-13.5 {-ipadx} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
- list [catch "grid .f -ipadx x" msg] $msg
-} {1 {bad ipadx value "x": must be positive screen distance}}
-grid_reset 13.4
+ grid .f -ipadx x
+} -cleanup {
+ grid_reset 13.4
+} -returnCodes error -result {bad ipadx value "x": must be positive screen distance}
-test grid-13.4.1 {-ipadx} {
+test grid-13.6 {-ipadx} -body {
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
+ grid .f -ipadx {5 5}
+} -cleanup {
+ grid_reset 13.4.1
+} -returnCodes error -result {bad ipadx value "5 5": must be positive screen distance}
-test grid-13.5 {-ipadx} {
+test grid-13.7 {-ipadx} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1182,22 +1259,25 @@ test grid-13.5 {-ipadx} {
grid .f -ipadx 1
update
list $a [winfo width .f]
-} {200 202}
-grid_reset 13.5
+} -cleanup {
+ grid_reset 13.5
+} -result {200 202}
-test grid-13.6 {-ipady} {
+test grid-13.8 {-ipady} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
- list [catch "grid .f -ipady x" msg] $msg
-} {1 {bad ipady value "x": must be positive screen distance}}
-grid_reset 13.6
+ grid .f -ipady x
+} -cleanup {
+ grid_reset 13.6
+} -returnCodes error -result {bad ipady value "x": must be positive screen distance}
-test grid-13.6.1 {-ipady} {
+test grid-13.9 {-ipady} -body {
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
+ grid .f -ipady {5 5}
+} -cleanup {
+ grid_reset 13.6.1
+} -returnCodes error -result {bad ipady value "5 5": must be positive screen distance}
-test grid-13.7 {-ipady} {
+test grid-13.10 {-ipady} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1205,22 +1285,25 @@ test grid-13.7 {-ipady} {
grid .f -ipady 1
update
list $a [winfo height .f]
-} {100 102}
-grid_reset 13.7
+} -cleanup {
+ grid_reset 13.7
+} -result {100 102}
-test grid-13.8 {-padx} {
+test grid-13.11 {-padx} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
- list [catch "grid .f -padx x" msg] $msg
-} {1 {bad pad value "x": must be positive screen distance}}
-grid_reset 13.8
+ grid .f -padx x
+} -cleanup {
+ grid_reset 13.8
+} -returnCodes error -result {bad pad value "x": must be positive screen distance}
-test grid-13.8.1 {-padx} {
+test grid-13.12 {-padx} -body {
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
+ grid .f -padx {10 x}
+} -cleanup {
+ grid_reset 13.8.1
+} -returnCodes error -result {bad 2nd pad value "x": must be positive screen distance}
-test grid-13.9 {-padx} {
+test grid-13.13 {-padx} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1228,10 +1311,11 @@ test grid-13.9 {-padx} {
grid .f -padx 1
update
list $a "[winfo width .f] [winfo width .] [winfo x .f]"
-} {{200 200} {200 202 1}}
-grid_reset 13.9
+} -cleanup {
+ grid_reset 13.9
+} -result {{200 200} {200 202 1}}
-test grid-13.9.1 {-padx} {
+test grid-13.14 {-padx} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1239,22 +1323,25 @@ test grid-13.9.1 {-padx} {
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
+} -cleanup {
+ grid_reset 13.9.1
+} -result {{200 200} {200 215 10}}
-test grid-13.10 {-pady} {
+test grid-13.15 {-pady} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
- list [catch "grid .f -pady x" msg] $msg
-} {1 {bad pad value "x": must be positive screen distance}}
-grid_reset 13.10
+ grid .f -pady x
+} -cleanup {
+ grid_reset 13.10
+} -returnCodes error -result {bad pad value "x": must be positive screen distance}
-test grid-13.10.1 {-pady} {
+test grid-13.16 {-pady} -body {
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
+ grid .f -pady {10 x}
+} -cleanup {
+ grid_reset 13.10.1
+} -returnCodes error -result {bad 2nd pad value "x": must be positive screen distance}
-test grid-13.11 {-pady} {
+test grid-13.17 {-pady} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1262,10 +1349,11 @@ test grid-13.11 {-pady} {
grid .f -pady 1
update
list $a "[winfo height .f] [winfo height .] [winfo y .f]"
-} {{100 100} {100 102 1}}
-grid_reset 13.11
+} -cleanup {
+ grid_reset 13.11
+} -result {{100 100} {100 102 1}}
-test grid-13.11.1 {-pady} {
+test grid-13.18 {-pady} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
update
@@ -1273,10 +1361,11 @@ test grid-13.11.1 {-pady} {
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
+} -cleanup {
+ grid_reset 13.11.1
+} -result {{100 100} {100 120 4}}
-test grid-13.12 {-ipad x and y} {
+test grid-13.19 {-ipad x and y} -body {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
grid columnconfigure . 0 -minsize 150
grid rowconfigure . 0 -minsize 100
@@ -1292,10 +1381,11 @@ test grid-13.12 {-ipad x and y} {
}
}
set a
-} { 0,0:,65,40,20,20 0,5:,65,35,20,30 5,0:,60,40,30,20 5,5:,60,35,30,30}
-grid_reset 13.12
+} -cleanup {
+ grid_reset 13.12
+} -result { 0,0:,65,40,20,20 0,5:,65,35,20,30 5,0:,60,40,30,20 5,5:,60,35,30,30}
-test grid-13.13 {reparenting} {
+test grid-13.20 {reparenting} -body {
frame .1
frame .2
button .b
@@ -1309,14 +1399,16 @@ test grid-13.13 {reparenting} {
lappend a [grid slaves .1],[grid slaves .2],$info(-in)
unset info
set a
-} {.b,,.1 ,.b,.2}
-grid_reset 13.13
+} -cleanup {
+ grid_reset 13.13
+} -result {.b,,.1 ,.b,.2}
+
-test grid-14.1 {structure notify} {
+test grid-14.1 {structure notify} -body {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
frame .g -width 200 -height 100 -highlightthickness 0 -bg red
- grid .f
- grid .g -in .f
+ grid .f
+ grid .g -in .f
update
set a ""
lappend a "[winfo x .g],[winfo y .g] \
@@ -1326,13 +1418,14 @@ test grid-14.1 {structure notify} {
lappend a "[winfo x .g],[winfo y .g] \
[winfo width .g],[winfo height .g]"
set a
-} {{0,0 200,100} {5,5 200,100}}
-grid_reset 14.1
+} -cleanup {
+ grid_reset 14.1
+} -result {{0,0 200,100} {5,5 200,100}}
-test grid-14.2 {structure notify} {
- frame .f -width 200 -height 100
- frame .f.g -width 200 -height 100
- grid .f
+test grid-14.2 {structure notify} -body {
+ frame .f -width 200 -height 100
+ frame .f.g -width 200 -height 100
+ grid .f
grid .f.g
update
set a ""
@@ -1340,10 +1433,13 @@ test grid-14.2 {structure notify} {
.f config -bd 20
update
lappend a [grid bbox .],[grid bbox .f]
-} {{0 0 200 100,0 0 200 100} {0 0 240 140,20 20 200 100}}
-grid_reset 14.2
+} -cleanup {
+ grid_reset 14.2
+} -result {{0 0 200 100,0 0 200 100} {0 0 240 140,20 20 200 100}}
-test grid-14.3 {map notify: bug 1648} {nonPortable} {
+test grid-14.3 {map notify: bug 1648} -constraints {
+ nonPortable
+} -body {
# This test is nonPortable because the number of times
# A(.) will be incremented is unspecified--the behavior
# is different accross window managers.
@@ -1362,10 +1458,12 @@ test grid-14.3 {map notify: bug 1648} {nonPortable} {
update
bind . <Configure> {}
array get A
-} {.2 2 .0 1 . 2 .1 1}
-grid_reset 14.3
+} -cleanup {
+ grid_reset 14.3
+} -result {.2 2 .0 1 . 2 .1 1}
+
-test grid-15.1 {lost slave} {
+test grid-15.1 {lost slave} -body {
button .b
grid .b
set a [grid slaves .]
@@ -1373,23 +1471,26 @@ test grid-15.1 {lost slave} {
lappend a [grid slaves .]
grid .b
lappend a [grid slaves .]
-} {.b {} .b}
-grid_reset 15.1
+} -cleanup {
+ grid_reset 15.1
+} -result {.b {} .b}
-test grid-15.2 {lost slave} {
+test grid-15.2 {lost slave} -body {
frame .f
grid .f
button .b
grid .b -in .f
set a [grid slaves .f]
- pack .b
+ pack .b -in .f
lappend a [grid slaves .f]
grid .b -in .f
lappend a [grid slaves .f]
-} {.b {} .b}
-grid_reset 15.2
+} -cleanup {
+ grid_reset 15.2
+} -result {.b {} .b}
+
-test grid-16.1 {layout centering} {
+test grid-16.1 {layout centering} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 75 -height 50 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1399,10 +1500,11 @@ test grid-16.1 {layout centering} {
. configure -width 300 -height 250
update
grid bbox .
-} {37 50 225 150}
-grid_reset 16.1
+} -cleanup {
+ grid_reset 16.1
+} -result {37 50 225 150}
-test grid-16.2 {layout weights (expanding)} {
+test grid-16.2 {layout weights (expanding)} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 75 -height 50 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1417,12 +1519,13 @@ test grid-16.2 {layout weights (expanding)} {
lappend a [winfo width .$i]-[winfo height .$i]
}
set a
-} {120-75 167-100 213-125}
-grid_reset 16.2
+} -cleanup {
+ grid_reset 16.2
+} -result {120-75 167-100 213-125}
-test grid-16.3 {layout weights (shrinking)} {
+test grid-16.3 {layout weights (shrinking)} -body {
foreach i {0 1 2} {
- frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
+ frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
grid rowconfigure . $i -weight [expr $i + 1]
grid columnconfigure . $i -weight [expr $i + 1]
@@ -1435,10 +1538,11 @@ test grid-16.3 {layout weights (shrinking)} {
lappend a [winfo width .$i]-[winfo height .$i]
}
set a
-} {84-63 66-50 50-37}
-grid_reset 16.3
+} -cleanup {
+ grid_reset 16.3
+} -result {84-63 66-50 50-37}
-test grid-16.4 {layout weights (shrinking with minsize)} {
+test grid-16.4 {layout weights (shrinking with minsize)} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1453,10 +1557,11 @@ test grid-16.4 {layout weights (shrinking with minsize)} {
lappend a [winfo width .$i]-[winfo height .$i]
}
set a
-} {70-60 65-45 65-45}
-grid_reset 16.4
+} -cleanup {
+ grid_reset 16.4
+} -result {70-60 65-45 65-45}
-test grid-16.5 {layout weights (shrinking at minsize)} {
+test grid-16.5 {layout weights (shrinking at minsize)} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1471,11 +1576,12 @@ test grid-16.5 {layout weights (shrinking at minsize)} {
lappend a [winfo width .$i]-[winfo height .$i]
}
set a
-} {100-75 100-75 100-75}
-grid_reset 16.5
+} -cleanup {
+ grid_reset 16.5
+} -result {100-75 100-75 100-75}
-test grid-16.6 {layout weights (shrinking at minsize)} {
+test grid-16.6 {layout weights (shrinking at minsize)} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1490,10 +1596,17 @@ test grid-16.6 {layout weights (shrinking at minsize)} {
lappend a [winfo width .$i]-[winfo height .$i]
}
set a
-} {69-52 69-52 69-52}
-grid_reset 16.6
-
-test grid-16.7 {layout weights (shrinking at minsize)} {
+} -cleanup {
+ grid_reset 16.6
+} -result {69-52 69-52 69-52}
+
+# test fails when run alone
+# reason (I think): -minsize 0 causes both:
+# [winfo ismapped .$i] => 0 and
+# not responding for width ang height settings, so that
+# [winfo width .$i] [winfo height .$i] take different values
+# That doesn't happen if previous tests run
+test grid-16.7 {layout weights (shrinking at minsize)} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1501,17 +1614,18 @@ test grid-16.7 {layout weights (shrinking at minsize)} {
grid propagate . 0
grid columnconfigure . 1 -weight 1 -minsize 0
grid rowconfigure . 1 -weight 1 -minsize 0
- . configure -width 100 -height 75
+ . configure -width 100 -height 1
set a ""
update
foreach i {0 1 2} {
lappend a [winfo width .$i]-[winfo height .$i]-[winfo ismapped .$i]
}
set a
-} {100-75-1 1-1-0 100-75-1}
-grid_reset 16.7
+} -cleanup {
+ grid_reset 16.7
+} -result {100-75-1 1-1-0 100-75-1}
-test grid-16.8 {layout internal constraints} {
+test grid-16.8 {layout internal constraints} -body {
foreach i {0 1 2 3 4} {
frame .$i -bg gray -width 30 -height 25 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1547,10 +1661,11 @@ test grid-16.8 {layout internal constraints} {
append a "[winfo x .$i] "
}
set a
-} {0 30 130 230 280 , 0 30 130 230 260 , 0 30 113 196 280 , 0 30 60 90 120 }
-grid_reset 16.8
+} -cleanup {
+ grid_reset 16.8
+} -result {0 30 130 230 280 , 0 30 130 230 260 , 0 30 113 196 280 , 0 30 60 90 120 }
-test grid-16.9 {layout uniform} {
+test grid-16.9 {layout uniform} -body {
frame .f1 -width 75 -height 50
frame .f2 -width 60 -height 25
frame .f3 -width 95 -height 75
@@ -1564,10 +1679,11 @@ test grid-16.9 {layout uniform} {
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
+} -cleanup {
+ grid_reset 16.9
+} -result {{0 0 135 75} {0 75 135 100} {0 175 135 75} {0 250 135 100} {0 350 135 40}}
-test grid-16.10 {layout uniform} {
+test grid-16.10 {layout uniform} -body {
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
@@ -1585,10 +1701,11 @@ test grid-16.10 {layout uniform} {
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
+} -cleanup {
+ grid_reset 16.10
+} -result {{0 0 75 60} {170 60 150 30} {75 90 95 90} {390 180 140 100} {320 280 70 45}}
-test grid-16.11 {layout uniform (shrink)} {
+test grid-16.11 {layout uniform (shrink)} -body {
frame .f1 -width 75 -height 50
frame .f2 -width 100 -height 95
grid .f1 .f2 -sticky news
@@ -1601,10 +1718,11 @@ test grid-16.11 {layout uniform (shrink)} {
. 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
+} -cleanup {
+ grid_reset 16.11
+} -result {{0 0 100 95} {100 0 100 95} {0 0 50 95} {50 0 100 95}}
-test grid-16.12 {layout uniform (grow)} {
+test grid-16.12 {layout uniform (grow)} -body {
frame .f1 -width 40 -height 50
frame .f2 -width 50 -height 95
frame .f3 -width 60 -height 50
@@ -1625,11 +1743,12 @@ test grid-16.12 {layout uniform (grow)} {
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} \
+} -cleanup {
+ grid_reset 16.12
+} -result [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-16.13 {layout span} {
+test grid-16.13 {layout span} -body {
frame .f1 -width 24 -height 20
frame .f2 -width 38 -height 20
frame .f3 -width 150 -height 20
@@ -1652,11 +1771,12 @@ test grid-16.13 {layout span} {
set res
# The last result below should ideally be 8 8 8 126 but the current
# implementation is not exact enough.
-} [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \
+} -cleanup {
+ grid_reset 16.13
+} -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \
[list 18 38 18 76 0] [list 7 8 9 126 0]]
-grid_reset 16.13
-test grid-16.14 {layout span} {
+test grid-16.14 {layout span} -body {
frame .f1 -width 110 -height 20
frame .f2 -width 38 -height 20
frame .f3 -width 150 -height 20
@@ -1677,11 +1797,12 @@ test grid-16.14 {layout span} {
lappend res $res2
}
set res
-} [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \
+} -cleanup {
+ grid_reset 16.14
+} -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 14 42 56 38 0] \
[list 27 55 28 40 0] [list 36 37 37 40 0]]
-grid_reset 16.14
-test grid-16.15 {layout span} {
+test grid-16.15 {layout span} -body {
frame .f1 -width 24 -height 20
frame .f2 -width 38 -height 20
frame .f3 -width 150 -height 20
@@ -1702,11 +1823,12 @@ test grid-16.15 {layout span} {
lappend res $res2
}
set res
-} [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 0 0 112 38 0] \
+} -cleanup {
+ grid_reset 16.15
+} -result [list [list 0 112 0 38 0] [list 0 0 112 38 0] [list 0 0 112 38 0] \
[list 0 37 37 76 0] [list 0 12 12 126 0]]
-grid_reset 16.15
-test grid-16.16 {layout span} {
+test grid-16.16 {layout span} -body {
frame .f1 -width 64 -height 20
frame .f2 -width 38 -height 20
frame .f3 -width 150 -height 20
@@ -1731,11 +1853,12 @@ test grid-16.16 {layout span} {
lappend res $res2
}
set res
-} [list [list 30 34 43 43 0] [list 30 34 48 38 0] [list 22 42 48 38 0] \
+} -cleanup {
+ grid_reset 16.16
+} -result [list [list 30 34 43 43 0] [list 30 34 48 38 0] [list 22 42 48 38 0] \
[list 25 39 29 57 0] [list 30 34 22 64 0]]
-grid_reset 16.16
-test grid-16.17 {layout weights (shrinking at minsize)} {
+test grid-16.17 {layout weights (shrinking at minsize)} -body {
foreach i {0 1 2 3} {
frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1755,10 +1878,11 @@ test grid-16.17 {layout weights (shrinking at minsize)} {
lappend a [winfo width .$i]-[winfo height .$i]-[winfo ismapped .$i]
}
set a
-} {25-25-1 25-25-1 100-75-1 100-75-1 25-25-0 25-25-0 100-75-1 100-75-1}
-grid_reset 16.17
+} -cleanup {
+ grid_reset 16.17
+} -result {25-25-1 25-25-1 100-75-1 100-75-1 25-25-0 25-25-0 100-75-1 100-75-1}
-test grid-16.18 {layout span} {
+test grid-16.18 {layout span} -body {
frame .f1 -width 30 -height 20
frame .f2 -width 166 -height 20
frame .f3 -width 39 -height 20
@@ -1781,10 +1905,36 @@ test grid-16.18 {layout span} {
lappend res $res2
}
set res
-} [list [list 137 29 10] [list 30 136 10] [list 98 68 10]]
-grid_reset 16.18
+} -cleanup {
+ grid_reset 16.18
+} -result [list [list 137 29 10] [list 30 136 10] [list 98 68 10]]
+
+test grid-16.19 {layout span} -constraints { knownBug } -body {
+ # This test shows the problem in Bug 2075285
+ # Several overlapping multi-span widgets is a weak spot
+ # in the current implementation.
+ # Test present as a reminder in case a future algorithm update is made.
+ frame .f1 -width 100 -height 20
+ frame .f2 -width 20 -height 20
+ frame .f3 -width 10 -height 20
+ frame .f4 -width 20 -height 20
+
+ grid .f1 - - - - - -sticky we
+ grid .f2 - .f3 - .f4 - -sticky we
+ grid columnconfigure . {1 5} -weight 1
-test grid-17.1 {forget and pending idle handlers} {
+ set res {}
+ update
+ for {set c 0} {$c <= 5} {incr c} {
+ lappend res [lindex [grid bbox . $c 0] 2]
+ }
+ set res
+} -cleanup {
+ grid_reset 16.19
+} -result [list 0 45 5 5 0 45]
+
+
+test grid-17.1 {forget and pending idle handlers} -body {
# This test is intended to detect a crash caused by a failure to remove
# pending idle handlers when grid forget is invoked.
@@ -1805,9 +1955,10 @@ test grid-17.1 {forget and pending idle handlers} {
grid .t.f.l
destroy .t
set result ok
-} ok
+} -result ok
+
-test grid-18.1 {test respect for internalborder} {
+test grid-18.1 {test respect for internalborder} -body {
toplevel .pack
wm geometry .pack 200x200
frame .pack.l -width 15 -height 10
@@ -1824,8 +1975,8 @@ test grid-18.1 {test respect for internalborder} {
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} {
+} -result {196x188+2+10 177x186+5+7}
+test grid-18.2 {test support for minreqsize} -body {
toplevel .pack
wm geometry .pack {}
frame .pack.l -width 150 -height 100
@@ -1840,9 +1991,10 @@ test grid-18.2 {test support for minreqsize} {
lappend res [winfo geometry .pack.lf]
destroy .pack
set res
-} {162x127+0+0 172x112+0+0}
+} -result {162x127+0+0 172x112+0+0}
-test grid-19.1 {uniform realloc} {
+
+test grid-19.1 {uniform realloc} -body {
# 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
@@ -1852,55 +2004,65 @@ test grid-19.1 {uniform realloc} {
}
update
grid bbox .
-} {0 0 600 20}
-grid_reset 19.1
+} -cleanup {
+ grid_reset 19.1
+} -result {0 0 600 20}
+
-test grid-20.1 {recalculate size after removal (destroy)} {
+test grid-20.1 {recalculate size after removal (destroy)} -body {
label .l1 -text l1
grid .l1 -row 2 -column 2
destroy .l1
label .l2 -text l2
grid .l2
grid size .
-} {1 1}
-grid_reset 20.1
+} -cleanup {
+ grid_reset 20.1
+} -result {1 1}
-test grid-20.2 {recalculate size after removal (forget)} {
+test grid-20.2 {recalculate size after removal (forget)} -body {
label .l1 -text l1
grid .l1 -row 2 -column 2
grid forget .l1
label .l2 -text l2
grid .l2
grid size .
-} {1 1}
-grid_reset 20.2
-
-test grid-21.1 {anchor} {
- list [catch {grid anchor . 1 xxx} msg] $msg
-} {1 {wrong # args: should be "grid anchor window ?anchor?"}}
-grid_reset 21.1
-
-test grid-21.2 {anchor} {
- list [catch {grid anchor .} msg] $msg
-} {0 nw}
-grid_reset 21.2
-
-test grid-21.3 {anchor} {
- list [catch {grid anchor . se;grid anchor .} msg] $msg
-} {0 se}
-grid_reset 21.3
-
-test grid-21.4 {anchor} {
- list [catch {grid anchor .x} msg] $msg
-} {1 {bad window path name ".x"}}
-grid_reset 21.4
-
-test grid-21.5 {anchor} {
- list [catch {grid anchor . x} msg] $msg
-} {1 {bad anchor "x": must be n, ne, e, se, s, sw, w, nw, or center}}
-grid_reset 21.5
-
-test grid-21.6 {anchor} {
+} -cleanup {
+ grid_reset 20.2
+} -result {1 1}
+
+
+test grid-21.1 {anchor} -body {
+ grid anchor . 1 xxx
+} -cleanup {
+ grid_reset 21.1
+} -returnCodes error -result {wrong # args: should be "grid anchor window ?anchor?"}
+
+test grid-21.2 {anchor} -body {
+ grid anchor .
+} -cleanup {
+ grid_reset 21.2
+} -result {nw}
+
+test grid-21.3 {anchor} -body {
+ grid anchor . se;grid anchor .
+} -cleanup {
+ grid_reset 21.3
+} -result {se}
+
+test grid-21.4 {anchor} -body {
+ grid anchor .x
+} -cleanup {
+ grid_reset 21.4
+} -returnCodes error -result {bad window path name ".x"}
+
+test grid-21.5 {anchor} -body {
+ grid anchor . x
+} -cleanup {
+ grid_reset 21.5
+} -returnCodes error -result {bad anchor "x": must be n, ne, e, se, s, sw, w, nw, or center}
+
+test grid-21.6 {anchor} -body {
foreach i {0 1 2} {
frame .$i -bg gray -width 75 -height 50 -bd 2 -relief ridge
grid .$i -row $i -column $i -sticky nswe
@@ -1915,12 +2077,13 @@ test grid-21.6 {anchor} {
lappend res [grid bbox .]
}
set res
-} [list {37 0 225 150} {75 0 225 150} {75 50 225 150} {75 100 225 150} \
+} -cleanup {
+ grid_reset 21.6
+} -result [list {37 0 225 150} {75 0 225 150} {75 50 225 150} {75 100 225 150} \
{37 100 225 150} {0 100 225 150} {0 50 225 150} {0 0 225 150} \
{37 50 225 150}]
-grid_reset 21.6
-test grid-21.7 {anchor} {
+test grid-21.7 {anchor} -body {
# Test with a non-symmetric internal border.
# This only tests vertically, there is currently no way to get
# it assymetric horizontally.
@@ -1945,10 +2108,11 @@ test grid-21.7 {anchor} {
}
pack propagate . 1 ; wm geometry . {}
set res
-} [list {37 20 225 150} {75 20 225 150} {75 60 225 150} {75 100 225 150} \
+} -cleanup {
+ grid_reset 21.7
+} -result [list {37 20 225 150} {75 20 225 150} {75 60 225 150} {75 100 225 150} \
{37 100 225 150} {0 100 225 150} {0 60 225 150} {0 20 225 150} \
{37 60 225 150}]
-grid_reset 21.7
test grid-22.1 {remove: basic argument checking} {
list [catch {grid remove foo} msg] $msg
diff --git a/tests/id.test b/tests/id.test
deleted file mode 100644
index de0d965..0000000
--- a/tests/id.test
+++ /dev/null
@@ -1,91 +0,0 @@
-# This file is a Tcl script to test out the procedures in the file
-# tkId.c, which recycle X resource identifiers. It is organized in
-# the standard fashion for Tcl tests.
-#
-# Copyright (c) 1995 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
-
-package require tcltest 2.1
-eval tcltest::configure $argv
-tcltest::loadTestedCommands
-
-test id-1.1 {WindowIdCleanup, delaying window release} {unix testwrapper} {
- bind all <Destroy> {lappend x %W}
- catch {unset map}
- frame .f
- set j 0
- foreach i {a b c d e f g h i j k l m n o p q} {
- toplevel .f.$i -height 50 -width 100
- wm geometry .f.$i +$j+$j
- incr j 10
- update
- set map([winfo id .f.$i]) .f.$i
- set map([testwrapper .f.$i]) wrapper.f.$i
- }
- set x {}
- destroy .f
-
- # Destroy events should have occurred for all windows.
- set result [list [lsort $x]]
-
- set x {}
- update idletasks
- set reused {}
- foreach i {a b c d e} {
- set w .${i}2
- frame $w -height 20 -width 100 -bd 2 -relief raised
- pack $w
- if [info exists map([winfo id $w])] {
- lappend reused $map([winfo id $w])
- }
- set map([winfo id $w]) $w
- }
-
- # No window ids should have been reused: stale Destroy events still
- # pending in queue.
- lappend result [lsort $reused]
-
- # Wait a few seconds, then try again; ids should still not have
- # been re-used.
-
- set y 0
- after 2000 {set y 1}
- tkwait variable y
- foreach i {a b c} {
- set w .${i}3
- frame $w -height 20 -width 100 -bd 2 -relief raised
- pack $w
- if [info exists map([winfo id $w])] {
- lappend reused $map([winfo id $w])
- }
- set map([winfo id $w])] $w
- }
-
- # Ids should not yet have been reused.
- lappend result [lsort $reused]
-
-
- # Wait a few more seconds, to give ids enough time to be recycled.
- set y 0
- after 6000 {set y 1}
- tkwait variable y
- foreach i {a b c d e f} {
- set w .${i}4
- frame $w -height 20 -width 100 -bd 2 -relief raised
- pack $w
- if [info exists map([winfo id $w])] {
- lappend reused $map([winfo id $w])
- }
- set map([winfo id $w])] $w
- }
-
- # Ids should be reused now, due to time delay. Destroy events should
- # have been discarded.
- lappend result [lsort $reused] [lsort $x]
-} {{.f .f.a .f.b .f.c .f.d .f.e .f.f .f.g .f.h .f.i .f.j .f.k .f.l .f.m .f.n .f.o .f.p .f.q} {} {} {.f.o .f.p .f.q wrapper.f.p wrapper.f.q} {}}
-bind all <Destroy> {}
-
-# cleanup
-cleanupTests
-return
diff --git a/tests/image.test b/tests/image.test
index c6c4f8a..3134ee8 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -7,38 +7,56 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-namespace import -force ::tk::test::loadTkCommand
-eval image delete [image names]
+imageInit
+
+# Canvas used in some tests in the whole file
canvas .c -highlightthickness 2
pack .c
update
-test image-1.1 {Tk_ImageCmd procedure, "create" option} {
- list [catch image msg] $msg
-} {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, 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} testImageType {
- list [image create test myimage] [image names]
-} {myimage myimage}
-test image-1.6 {Tk_ImageCmd procedure, "create" option} testImageType {
+
+
+test image-1.1 {Tk_ImageCmd procedure, "create" option} -body {
+ image
+} -returnCodes error -result {wrong # args: should be "image option ?args?"}
+test image-1.2 {Tk_ImageCmd procedure, "create" option} -body {
+ image gorp
+} -returnCodes error -result {bad option "gorp": must be create, delete, height, inuse, names, type, types, or width}
+test image-1.3 {Tk_ImageCmd procedure, "create" option} -body {
+ image create
+} -returnCodes error -result {wrong # args: should be "image create type ?name? ?-option value ...?"}
+test image-1.4 {Tk_ImageCmd procedure, "create" option} -body {
+ image c bad_type
+} -returnCodes error -result {image type "bad_type" doesn't exist}
+test image-1.5 {Tk_ImageCmd procedure, "create" option} -constraints {
+ testImageType
+} -body {
+ list [image create test myimage] [imageNames]
+} -cleanup {
+ imageCleanup
+} -result {myimage myimage}
+test image-1.6 {Tk_ImageCmd procedure, "create" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
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} testImageType {
- image delete myimage
+} -cleanup {
+ imageCleanup
+} -result {1}
+
+test image-1.7 {Tk_ImageCmd procedure, "create" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage -variable x
.c create image 100 50 -image myimage
.c create image 100 150 -image myimage
@@ -46,10 +64,16 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} testImageType {
set x {}
image create test myimage -variable x
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} testImageType {
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{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} -constraints {
+ testImageType
+} -setup {
.c delete all
+ imageCleanup
+} -body {
image create test myimage -variable x
.c create image 100 50 -image myimage
.c create image 100 150 -image myimage
@@ -58,185 +82,289 @@ test image-1.8 {Tk_ImageCmd procedure, "create" option} testImageType {
set x {}
image create test myimage -variable x
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} testImageType {
+ return $x
+} -cleanup {
.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 same name as main window} {
+ imageCleanup
+} -result {{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} -constraints {
+ testImageType
+} -body {
+ image create test -badName foo
+} -returnCodes error -result {bad option name "-badName"}
+test image-1.10 {Tk_ImageCmd procedure, "create" option} -constraints {
+ testImageType
+} -body {
+ catch {image create test -badName foo}
+ imageNames
+} -result {}
+test image-1.11 {Tk_ImageCmd procedure, "create" option with same name as main window} -body {
set code [loadTkCommand]
append code {
- update
- puts [list [catch {image create photo .} msg] $msg]
- exit
+ update
+ puts [list [catch {image create photo .} msg] $msg]
+ exit
}
set script [makeFile $code script]
- set x [list [catch {exec [interpreter] <$script} msg] $msg]
+ exec [interpreter] <$script
+} -cleanup {
removeFile script
- set x
-} {0 {1 {images may not be named the same as the main window}}}
-test image-1.11 {Tk_ImageCmd procedure, "create" option with same name as main window after renaming} {
+} -result {1 {images may not be named the same as the main window}}
+test image-1.12 {Tk_ImageCmd procedure, "create" option with same name as main window after renaming} -body {
set code [loadTkCommand]
append code {
- update
- puts [list [catch {rename . foo;image create photo foo} msg] $msg]
- exit
+ update
+ puts [list [catch {rename . foo;image create photo foo} msg] $msg]
+ exit
}
set script [makeFile $code script]
- set x [list [catch {exec [interpreter] <$script} msg] $msg]
+ exec [interpreter] <$script
+} -cleanup {
removeFile script
- set x
-} {0 {1 {images may not be named the same as the main window}}}
-test image-1.12 {Tk_ImageCmd, "create" option: do not generated command name in use} -setup {
+} -result {1 {images may not be named the same as the main window}}
+test image-1.13 {Tk_ImageCmd, "create" option: do not generated command name in use} -setup {
+ .c delete all
+ imageCleanup
+} -body {
set i [image create bitmap]
regexp {^image(\d+)$} $i -> serial
incr serial
proc image$serial {} {return works}
set j [image create bitmap]
-} -body {
+
image$serial
} -cleanup {
rename image$serial {}
image delete $i $j
} -result works
-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} testImageType {
- .c delete all
- eval image delete [image names]
+test image-2.1 {Tk_ImageCmd procedure, "delete" option} -body {
+ image delete
+} -result {}
+test image-2.2 {Tk_ImageCmd procedure, "delete" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+ set result {}
+} -body {
image create test myimage
image create test img2
- set result {}
- lappend result [lsort [image names]]
+ lappend result [lsort [imageNames]]
image d myimage img2
- lappend result [image names]
-} {{img2 myimage} {}}
-test image-2.3 {Tk_ImageCmd procedure, "delete" option} testImageType {
- .c delete all
- eval image delete [image names]
+ lappend result [imageNames]
+} -cleanup {
+ imageCleanup
+} -result {{img2 myimage} {}}
+test image-2.3 {Tk_ImageCmd procedure, "delete" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage
image create test img2
- list [catch {image delete myimage gorp img2} msg] $msg [image names]
-} {1 {image "gorp" doesn't exist} img2}
-
-test image-3.1 {Tk_ImageCmd procedure, "height" option} {
- list [catch {image height} msg] $msg
-} {1 {wrong # args: should be "image height name"}}
-test image-3.2 {Tk_ImageCmd procedure, "height" option} {
- list [catch {image height a b} msg] $msg
-} {1 {wrong # args: should be "image height name"}}
-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} testImageType {
+ image delete myimage gorp img2
+} -cleanup {
+ imageCleanup
+} -returnCodes error -result {image "gorp" doesn't exist}
+test image-2.4 {Tk_ImageCmd procedure, "delete" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
+ image create test myimage
+ image create test img2
+ catch {image delete myimage gorp img2}
+ imageNames
+} -cleanup {
+ imageCleanup
+} -result {img2}
+
+
+test image-3.1 {Tk_ImageCmd procedure, "height" option} -body {
+ image height
+} -returnCodes error -result {wrong # args: should be "image height name"}
+test image-3.2 {Tk_ImageCmd procedure, "height" option} -body {
+ image height a b
+} -returnCodes error -result {wrong # args: should be "image height name"}
+test image-3.3 {Tk_ImageCmd procedure, "height" option} -body {
+ image height foo
+} -returnCodes error -result {image "foo" doesn't exist}
+test image-3.4 {Tk_ImageCmd procedure, "height" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage
set x [image h myimage]
myimage changed 0 0 0 0 60 50
list $x [image height myimage]
-} {15 50}
+} -cleanup {
+ imageCleanup
+} -result {15 50}
-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} testImageType {
- .c delete all
- eval image delete [image names]
- image create test myimage
- image create test img2
- image create test 24613
- lsort [image names]
-} {24613 img2 myimage}
-test image-4.3 {Tk_ImageCmd procedure, "names" option} {
- .c delete all
- eval image delete [image names]
- lsort [image names]
-} {}
-
-test image-5.1 {Tk_ImageCmd procedure, "type" option} {
- list [catch {image type} msg] $msg
-} {1 {wrong # args: should be "image type name"}}
-test image-5.2 {Tk_ImageCmd procedure, "type" option} {
- list [catch {image type a b} msg] $msg
-} {1 {wrong # args: should be "image type name"}}
-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} testImageType {
+
+test image-4.1 {Tk_ImageCmd procedure, "names" option} -body {
+ image names x
+} -returnCodes error -result {wrong # args: should be "image names"}
+test image-4.2 {Tk_ImageCmd procedure, "names" option} -constraints {
+ testImageType
+} -setup {
+ catch {interp delete testinterp}
+} -body {
+ interp create testinterp
+ load {} Tk testinterp
+ interp eval testinterp {
+ image delete {*}[image names]
+ image create test myimage
+ image create test img2
+ image create test 24613
+ lsort [image names]
+ }
+} -cleanup {
+ interp delete testinterp
+} -result {24613 img2 myimage}
+test image-4.3 {Tk_ImageCmd procedure, "names" option} -setup {
+ catch {interp delete testinterp}
+} -body {
+ interp create testinterp
+ load {} Tk testinterp
+ interp eval testinterp {
+ image delete {*}[image names]
+ eval image delete [image names] [image names]
+ lsort [image names]
+ }
+} -cleanup {
+ interp delete testinterp
+} -result {}
+
+
+test image-5.1 {Tk_ImageCmd procedure, "type" option} -body {
+ image type
+} -returnCodes error -result {wrong # args: should be "image type name"}
+test image-5.2 {Tk_ImageCmd procedure, "type" option} -body {
+ image type a b
+} -returnCodes error -result {wrong # args: should be "image type name"}
+test image-5.3 {Tk_ImageCmd procedure, "type" option} -body {
+ image type foo
+} -returnCodes error -result {image "foo" doesn't exist}
+
+test image-5.4 {Tk_ImageCmd procedure, "type" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage
image type myimage
-} {test}
-test image-5.5 {Tk_ImageCmd procedure, "type" option} testImageType {
+} -cleanup {
+ imageCleanup
+} -result {test}
+test image-5.5 {Tk_ImageCmd procedure, "type" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage
.c create image 50 50 -image myimage
image delete myimage
- list [catch {image type myimage} msg] $msg
-} {1 {image "myimage" doesn't exist}}
-test image-5.6 {Tk_ImageCmd procedure, "type" option} testOldImageType {
+ image type myimage
+} -cleanup {
+ imageCleanup
+} -returnCodes error -result {image "myimage" doesn't exist}
+test image-5.6 {Tk_ImageCmd procedure, "type" option} -constraints {
+ testOldImageType
+} -setup {
+ imageCleanup
+} -body {
image create oldtest myimage
image type myimage
-} {oldtest}
-test image-5.7 {Tk_ImageCmd procedure, "type" option} testOldImageType {
+} -cleanup {
+ imageCleanup
+} -result {oldtest}
+test image-5.7 {Tk_ImageCmd procedure, "type" option} -constraints {
+ testOldImageType
+} -setup {
+ .c delete all
+ imageCleanup
+} -body {
image create oldtest myimage
.c create image 50 50 -image myimage
image delete myimage
- list [catch {image type myimage} msg] $msg
-} {1 {image "myimage" doesn't exist}}
+ image type myimage
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -returnCodes error -result {image "myimage" doesn't exist}
-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} testImageType {
+
+test image-6.1 {Tk_ImageCmd procedure, "types" option} -body {
+ image types x
+} -returnCodes error -result {wrong # args: should be "image types"}
+test image-6.2 {Tk_ImageCmd procedure, "types" option} -constraints {
+ testImageType
+} -body {
lsort [image types]
-} {bitmap oldtest photo test}
-
-test image-7.1 {Tk_ImageCmd procedure, "width" option} {
- list [catch {image width} msg] $msg
-} {1 {wrong # args: should be "image width name"}}
-test image-7.2 {Tk_ImageCmd procedure, "width" option} {
- list [catch {image width a b} msg] $msg
-} {1 {wrong # args: should be "image width name"}}
-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} testImageType {
+} -result {bitmap oldtest photo test}
+
+
+test image-7.1 {Tk_ImageCmd procedure, "width" option} -body {
+ image width
+} -returnCodes error -result {wrong # args: should be "image width name"}
+test image-7.2 {Tk_ImageCmd procedure, "width" option} -body {
+ image width a b
+} -returnCodes error -result {wrong # args: should be "image width name"}
+test image-7.3 {Tk_ImageCmd procedure, "width" option} -body {
+ image width foo
+} -returnCodes error -result {image "foo" doesn't exist}
+test image-7.4 {Tk_ImageCmd procedure, "width" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
+} -body {
image create test myimage
set x [image w myimage]
myimage changed 0 0 0 0 60 50
list $x [image width myimage]
-} {30 60}
+} -cleanup {
+ imageCleanup
+} -result {30 60}
-test image-8.1 {Tk_ImageCmd procedure, "inuse" option} testImageType {
- catch {image delete myimage2}
- image create test myimage2
+
+test image-8.1 {Tk_ImageCmd procedure, "inuse" option} -constraints {
+ testImageType
+} -setup {
+ imageCleanup
set res {}
+ destroy .b
+} -body {
+ image create test myimage2
lappend res [image inuse myimage2]
- catch {destroy .b}
button .b -image myimage2
lappend res [image inuse myimage2]
+} -cleanup {
+ imageCleanup
catch {destroy .b}
- image delete myimage2
- set res
-} [list 0 1]
+} -result [list 0 1]
-test image-9.1 {Tk_ImageChanged procedure} testImageType {
+test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 50 -image foo
update
set x {}
foo changed 5 6 7 8 30 15
update
- set x
-} {{foo display 5 6 7 8 30 30}}
-test image-9.2 {Tk_ImageChanged procedure} testImageType {
+ return $x
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {{foo display 5 6 7 8 30 30}}
+test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 50 -image foo
.c create image 90 100 -image foo
@@ -244,25 +372,38 @@ test image-9.2 {Tk_ImageChanged procedure} testImageType {
set x {}
foo changed 5 6 7 8 30 15
update
- set x
-} {{foo display 5 6 25 9 30 30} {foo display 0 0 12 14 65 74}}
+ return $x
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {{foo display 5 6 25 9 30 30} {foo display 0 0 12 14 65 74}}
+
-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-10.2 {Tk_GetImage procedure} testImageType {
+test image-10.1 {Tk_GetImage procedure} -setup {
+ imageCleanup
+} -body {
+ .c create image 100 10 -image bad_name
+} -cleanup {
+ imageCleanup
+} -returnCodes error -result {image "bad_name" doesn't exist}
+test image-10.2 {Tk_GetImage procedure} -constraints testImageType -setup {
+ destroy .l
+ imageCleanup
+} -body {
image create test mytest
- catch {destroy .l}
label .l -image mytest
image delete mytest
- set result [list [catch {label .l2 -image mytest} msg] $msg]
+ label .l2 -image mytest
+} -cleanup {
destroy .l
- set result
-} {1 {image "mytest" doesn't exist}}
+ imageCleanup
+} -returnCodes error -result {image "mytest" doesn't exist}
+
-test image-11.1 {Tk_FreeImage procedure} testImageType {
+test image-11.1 {Tk_FreeImage procedure} -constraints testImageType -setup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 50 -image foo -tags i1
.c create image 90 100 -image foo -tags i2
@@ -272,168 +413,214 @@ test image-11.1 {Tk_FreeImage procedure} testImageType {
.c delete i1
pack .c
update
- list [image names] $x
-} {foo {{foo free} {foo display 0 0 30 15 103 121}}}
-test image-11.2 {Tk_FreeImage procedure} testImageType {
+ list [imageNames] $x
+} -cleanup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -result {foo {{foo free} {foo display 0 0 30 15 103 121}}}
+test image-11.2 {Tk_FreeImage procedure} -constraints testImageType -setup {
+ .c delete all
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 50 -image foo -tags i1
- set names [image names]
+ set names [imageNames]
image delete foo
update
- set names2 [image names]
+ set names2 [imageNames]
set x {}
.c delete i1
pack forget .c
pack .c
update
- list $names $names2 [image names] $x
-} {foo {} {} {}}
+ list $names $names2 [imageNames] $x
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {foo {} {} {}}
-# Non-portable, apparently due to differences in rounding:
-test image-12.1 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+# Non-portable, apparently due to differences in rounding:
+test image-12.1 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 30 40 55 65 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 0 0 5 5 50 50}}
-test image-12.2 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 0 0 5 5 50 50}}
+test image-12.2 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 60 40 100 65 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 10 0 20 5 30 50}}
-test image-12.3 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 10 0 20 5 30 50}}
+test image-12.3 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 60 70 100 200 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 10 10 20 5 30 30}}
-test image-12.4 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 10 10 20 5 30 30}}
+test image-12.4 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 30 70 55 200 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 0 10 5 5 50 30}}
-test image-12.5 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 0 10 5 5 50 30}}
+test image-12.5 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 10 20 120 130 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 0 0 30 15 70 70}}
-test image-12.6 {Tk_RedrawImage procedure, redisplay area clipping} \
- {testImageType nonPortable} {
- .c delete all
- eval image delete [image names]
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 0 0 30 15 70 70}}
+test image-12.6 {Tk_RedrawImage procedure, redisplay area clipping} -constraints {
+ testImageType nonPortable
+} -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
.c create rectangle 55 65 75 70 -width 0 -fill black -outline {}
set x {}
update
- set x
-} {{foo display 5 5 20 5 30 30}}
+ return $x
+} -cleanup {
+ imageCleanup
+} -result {{foo display 5 5 20 5 30 30}}
-test image-13.1 {Tk_SizeOfImage procedure} testImageType {
- eval image delete [image names]
+
+test image-13.1 {Tk_SizeOfImage procedure} -constraints testImageType -setup {
+ imageCleanup
+} -body {
image create test foo -variable x
set result [list [image width foo] [image height foo]]
foo changed 0 0 0 0 85 60
lappend result [image width foo] [image height foo]
-} {30 15 85 60}
+} -cleanup {
+ imageCleanup
+} -result {30 15 85 60}
-test image-13.2 {DeleteImage procedure} testImageType {
+test image-13.2 {DeleteImage procedure} -constraints testImageType -setup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -body {
image create test foo -variable x
.c create image 50 50 -image foo -tags i1
.c create image 90 100 -image foo -tags i2
set x {}
image delete foo
- lappend x | [image names] | [catch {image delete foo} msg] | $msg | [image names] |
-} {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" doesn't exist} | {} |}
+ lappend x | [imageNames] | [catch {image delete foo} msg] | $msg | [imageNames] |
+} -cleanup {
+ imageCleanup
+} -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" doesn't exist} | {} |}
-test image-13.3 {Tk_SizeOfImage procedure} testOldImageType {
- eval image delete [image names]
+test image-13.3 {Tk_SizeOfImage procedure} -constraints testOldImageType -setup {
+ imageCleanup
+} -body {
image create oldtest foo -variable x
set result [list [image width foo] [image height foo]]
foo changed 0 0 0 0 85 60
lappend result [image width foo] [image height foo]
-} {30 15 85 60}
+} -cleanup {
+ imageCleanup
+} -result {30 15 85 60}
-test image-13.4 {DeleteImage procedure} testOldImageType {
+test image-13.4 {DeleteImage procedure} -constraints testOldImageType -setup {
.c delete all
- eval image delete [image names]
+ imageCleanup
+} -body {
image create oldtest foo -variable x
.c create image 50 50 -image foo -tags i1
.c create image 90 100 -image foo -tags i2
set x {}
image delete foo
- lappend x | [image names] | [catch {image delete foo} msg] | $msg | [image names] |
-} {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" doesn't exist} | {} |}
-
-
-catch {image delete hidden}
-set l [image names]
-set h [interp hidden]
+ lappend x | [imageNames] | [catch {image delete foo} msg] | $msg | [imageNames] |
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" doesn't exist} | {} |}
-test image-14.1 {image command vs hidden commands} {
+test image-14.1 {image command vs hidden commands} -body {
catch {image delete hidden}
+ set l [imageNames]
+ set h [interp hidden]
image create photo hidden
interp hide {} hidden
image delete hidden
- list [image names] [interp hidden]
-} [list $l $h]
+ set res1 [list [imageNames] [interp hidden]]
+ set res2 [list $l $h]
+ expr {$res1 eq $res2}
+} -result 1
-eval image delete [image names]
-test image-15.1 {deleting image does not make widgets forget about it} {
+test image-15.1 {deleting image does not make widgets forget about it} -setup {
.c delete all
+ imageCleanup
+} -body {
image create photo foo -width 10 -height 10
.c create image 10 10 -image foo -tags i1 -anchor nw
update
set x [.c bbox i1]
- lappend x [image names]
+ lappend x [imageNames]
image delete foo
- lappend x [image names]
+ lappend x [imageNames]
image create photo foo -width 20 -height 20
- lappend x [.c bbox i1] [image names]
-} {10 10 20 20 foo {} {10 10 30 30} foo}
+ lappend x [.c bbox i1] [imageNames]
+} -cleanup {
+ .c delete all
+ imageCleanup
+} -result {10 10 20 20 foo {} {10 10 30 30} foo}
destroy .c
-eval image delete [image names]
+imageFinish
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/imgBmap.test b/tests/imgBmap.test
index edbb8c3..5ffd7c4 100644
--- a/tests/imgBmap.test
+++ b/tests/imgBmap.test
@@ -7,9 +7,11 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
set data1 {#define foo_width 16
#define foo_height 16
@@ -31,123 +33,153 @@ set data2 {
makeFile $data1 foo.bm
makeFile $data2 foo2.bm
-eval image delete [image names]
-canvas .c
-pack .c
-update
-image create bitmap i1
-.c create image 200 100 -image i1
+imageCleanup
+#canvas .c
+#pack .c
+#update
+#image create bitmap i1
+#.c create image 200 100 -image i1
update
proc bgerror msg {
global errMsg
set errMsg $msg
}
-test imageBmap-1.1 {options for bitmap images} {
+
+test imageBmap-1.1 {options for bitmap images} -body {
image create bitmap i1 -background #123456
lindex [i1 configure -background] 4
-} {#123456}
-test imageBmap-1.2 {options for bitmap images} {
+} -cleanup {
+ image delete i1
+} -result {#123456}
+test imageBmap-1.2 {options for bitmap images} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
set errMsg {}
image create bitmap i1 -background lousy
+ .c create image 200 100 -image i1
update
list $errMsg $errorInfo
-} {{unknown color name "lousy"} {unknown color name "lousy"
+} -cleanup {
+ image delete i1
+ destroy .c
+} -result {{unknown color name "lousy"} {unknown color name "lousy"
(while configuring image "i1")}}
-test imageBmap-1.3 {options for bitmap images} {
+test imageBmap-1.3 {options for bitmap images} -body {
image create bitmap i1 -data $data1
lindex [i1 configure -data] 4
-} $data1
-test imageBmap-1.4 {options for bitmap images} {
- list [catch {image create bitmap i1 -data bogus} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-1.5 {options for bitmap images} {
+} -result $data1
+test imageBmap-1.4 {options for bitmap images} -body {
+ image create bitmap i1 -data bogus
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-1.5 {options for bitmap images} -body {
image create bitmap i1 -file foo.bm
lindex [i1 configure -file] 4
-} foo.bm
-test imageBmap-1.6 {options for bitmap images} {
+} -result foo.bm
+test imageBmap-1.6 {options for bitmap images} -body {
list [catch {image create bitmap i1 -file bogus} msg] [string tolower $msg]
-} {1 {couldn't read bitmap file "bogus": no such file or directory}}
-test imageBmap-1.7 {options for bitmap images} {
+} -result {1 {couldn't read bitmap file "bogus": no such file or directory}}
+test imageBmap-1.7 {options for bitmap images} -body {
image create bitmap i1 -foreground #00ff00
lindex [i1 configure -foreground] 4
-} {#00ff00}
-test imageBmap-1.8 {options for bitmap images} {
+} -cleanup {
+ image delete i1
+} -result {#00ff00}
+test imageBmap-1.8 {options for bitmap images} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
set errMsg {}
image create bitmap i1 -foreground bad_color
+ .c create image 200 100 -image i1
update
list $errMsg $errorInfo
-} {{unknown color name "bad_color"} {unknown color name "bad_color"
+} -cleanup {
+ destroy .c
+ image delete i1
+} -result {{unknown color name "bad_color"} {unknown color name "bad_color"
(while configuring image "i1")}}
-test imageBmap-1.9 {options for bitmap images} {
+test imageBmap-1.9 {options for bitmap images} -body {
image create bitmap i1 -data $data1 -maskdata $data2
lindex [i1 configure -maskdata] 4
-} $data2
-test imageBmap-1.10 {options for bitmap images} {
- list [catch {image create bitmap i1 -data $data1 -maskdata bogus} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-1.11 {options for bitmap images} {
+} -result $data2
+test imageBmap-1.10 {options for bitmap images} -body {
+ image create bitmap i1 -data $data1 -maskdata bogus
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-1.11 {options for bitmap images} -body {
image create bitmap i1 -file foo.bm -maskfile foo2.bm
lindex [i1 configure -maskfile] 4
-} foo2.bm
-test imageBmap-1.12 {options for bitmap images} {
+} -result foo2.bm
+test imageBmap-1.12 {options for bitmap images} -body {
list [catch {image create bitmap i1 -data $data1 -maskfile bogus} msg] \
[string tolower $msg]
-} {1 {couldn't read bitmap file "bogus": no such file or directory}}
+} -result {1 {couldn't read bitmap file "bogus": no such file or directory}}
rename bgerror {}
-test imageBmap-2.1 {ImgBmapCreate procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -gorp dum} msg] $msg [image names]
-} {1 {unknown option "-gorp"} {}}
-test imageBmap-2.2 {ImgBmapCreate procedure} {
- eval image delete [image names]
- .c delete all
+
+test imageBmap-2.1 {ImgBmapCreate procedure} -setup {
+ imageCleanup
+} -body {
+ list [catch {image create bitmap -gorp dum} msg] $msg [imageNames]
+} -result {1 {unknown option "-gorp"} {}}
+test imageBmap-2.2 {ImgBmapCreate procedure} -setup {
+ imageCleanup
+} -body {
image create bitmap image1
- list [info commands image1] [image names] \
+ list [info commands image1] [imageNames] \
[image width image1] [image height image1] \
[lindex [image1 configure -foreground] 4] \
[lindex [image1 configure -background] 4]
-} {image1 image1 0 0 #000000 {}}
+} -cleanup {
+ image delete image1
+} -result {image1 image1 0 0 #000000 {}}
-test imageBmap-3.1 {ImgBmapConfigureMaster procedure, memory de-allocation} {
+
+test imageBmap-3.1 {ImgBmapConfigureMaster procedure, memory de-allocation} -body {
image create bitmap i1 -data $data1
i1 configure -data $data1
-} {}
-test imageBmap-3.2 {ImgBmapConfigureMaster procedure} {
+} -cleanup {
+ image delete i1
+} -result {}
+test imageBmap-3.2 {ImgBmapConfigureMaster procedure} -body {
image create bitmap i1 -data $data1
list [catch {i1 configure -data bogus} msg] $msg [image width i1] \
[image height i1]
-} {1 {format error in bitmap data} 16 16}
-test imageBmap-3.3 {ImgBmapConfigureMaster procedure, memory de-allocation} {
+} -result {1 {format error in bitmap data} 16 16}
+test imageBmap-3.3 {ImgBmapConfigureMaster procedure, memory de-allocation} -body {
image create bitmap i1 -data $data1 -maskdata $data2
i1 configure -maskdata $data2
-} {}
-test imageBmap-3.4 {ImgBmapConfigureMaster procedure} {
+} -cleanup {
+ image delete i1
+} -result {}
+test imageBmap-3.4 {ImgBmapConfigureMaster procedure} -body {
image create bitmap i1
- list [catch {i1 configure -maskdata $data2} msg] $msg
-} {1 {can't have mask without bitmap}}
-test imageBmap-3.5 {ImgBmapConfigureMaster procedure} {
- list [catch {image create bitmap i1 -data $data1 -maskdata {
+ i1 configure -maskdata $data2
+} -returnCodes error -result {can't have mask without bitmap}
+test imageBmap-3.5 {ImgBmapConfigureMaster procedure} -body {
+ image create bitmap i1 -data $data1 -maskdata {
#define foo_width 8
#define foo_height 16
static char foo_bits[] = {
0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
0x81, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81, 0x81};
}
- } msg] $msg
-} {1 {bitmap and mask have different sizes}}
-test imageBmap-3.6 {ImgBmapConfigureMaster procedure} {
- list [catch {image create bitmap i1 -data $data1 -maskdata {
+} -returnCodes error -result {bitmap and mask have different sizes}
+test imageBmap-3.6 {ImgBmapConfigureMaster procedure} -body {
+ image create bitmap i1 -data $data1 -maskdata {
#define foo_width 16
#define foo_height 8
static char foo_bits[] = {
0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
0x81, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81, 0x81};
}
- } msg] $msg
-} {1 {bitmap and mask have different sizes}}
-test imageBmap-3.7 {ImgBmapConfigureMaster procedure} {
+} -returnCodes error -result {bitmap and mask have different sizes}
+test imageBmap-3.7 {ImgBmapConfigureMaster procedure} -setup {
+ destroy .c
+ pack [canvas .c]
+} -body {
image create bitmap i1 -data $data1
.c create image 100 100 -image i1 -tags i1.1 -anchor nw
.c create image 200 100 -image i1 -tags i1.2 -anchor nw
@@ -163,63 +195,58 @@ test imageBmap-3.7 {ImgBmapConfigureMaster procedure} {
}
update
list [image width i1] [image height i1] [.c bbox i1.1] [.c bbox i1.2]
-} {15 14 {100 100 115 114} {200 100 215 114}}
+} -cleanup {
+ image delete i1
+ destroy .c
+} -result {15 14 {100 100 115 114} {200 100 215 114}}
-test imageBmap-4.1 {ImgBmapConfigureInstance procedure: check error handling} {
+
+test imageBmap-4.1 {ImgBmapConfigureInstance procedure: check error handling} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
proc bgerror args {}
- .c delete all
image create bitmap i1 -file foo.bm
.c create image 100 100 -image i1
update
i1 configure -foreground bogus
update
-} {}
+} -cleanup {
+ image delete i1
+ destroy .c
+} -result {}
+
-test imageBmap-5.1 {GetBitmapData procedure} {
+test imageBmap-5.1 {GetBitmapData procedure} -body {
list [catch {image create bitmap -file ~bad_user/a/b} msg] \
[string tolower $msg]
-} {1 {user "bad_user" doesn't exist}}
-test imageBmap-5.2 {GetBitmapData procedure} {
+} -result {1 {user "bad_user" doesn't exist}}
+test imageBmap-5.2 {GetBitmapData procedure} -body {
list [catch {image create bitmap -file bad_name} msg] [string tolower $msg]
-} {1 {couldn't read bitmap file "bad_name": no such file or directory}}
-test imageBmap-5.3 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data { }} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.4 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_width}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.5 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_width gorp}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.6 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_width 1.4}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.7 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_height}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.8 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_height gorp}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.9 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap -data {#define foo2_height 1.4}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.10 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
+} -result {1 {couldn't read bitmap file "bad_name": no such file or directory}}
+test imageBmap-5.3 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data { }
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.4 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_width"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.5 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_width gorp"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.6 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_width 1.4"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.7 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_height"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.8 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_height gorp"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.9 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap -data "#define foo2_height 1.4"
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.10 {GetBitmapData procedure} -setup {imageCleanup} -body {
image create bitmap i1 -data {
#define foo2_height 14
#define foo2_width 15 xx _widtg 18 xwidth 18 _heighz 18 xheight 18
@@ -230,10 +257,10 @@ test imageBmap-5.10 {GetBitmapData procedure} {
0xff, 0xff};
}
list [image width i1] [image height i1]
-} {15 14}
-test imageBmap-5.11 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
+} -cleanup {
+ image delete i1
+} -result {15 14}
+test imageBmap-5.11 {GetBitmapData procedure} -setup {imageCleanup} -body {
image create bitmap i1 -data {
_height 14 _width 15
char {
@@ -243,11 +270,11 @@ test imageBmap-5.11 {GetBitmapData procedure} {
0xff, 0xff}
}
list [image width i1] [image height i1]
-} {15 14}
-test imageBmap-5.12 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {
+} -cleanup {
+ image delete i1
+} -result {15 14}
+test imageBmap-5.12 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {
#define foo2_height 14
#define foo2_width 15
static short foo2_bits[] = {
@@ -255,12 +282,10 @@ test imageBmap-5.12 {GetBitmapData procedure} {
0xff, 0x81, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81,
0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81,
0xff, 0xff};
- }} msg] $msg
-} {1 {format error in bitmap data; looks like it's an obsolete X10 bitmap file}}
-test imageBmap-5.13 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {
+ }
+} -returnCodes error -result {format error in bitmap data; looks like it's an obsolete X10 bitmap file}
+test imageBmap-5.13 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {
#define foo2_height 16
#define foo2_width 16
static char foo2_bits[] =
@@ -268,28 +293,22 @@ test imageBmap-5.13 {GetBitmapData procedure} {
0xff, 0x81, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81,
0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81,
0xff, 0xff;
- }} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.14 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {
+ }
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.14 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {
#define foo2_width 16
static char foo2_bits[] = {
- 0xff, 0xff, 0xff, }}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.15 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {
+ 0xff, 0xff, 0xff, }}
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.15 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {
#define foo2_height 16
static char foo2_bits[] = {
- 0xff, 0xff, 0xff, }}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.16 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {
+ 0xff, 0xff, 0xff, }}
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.16 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {
#define foo2_height 16
#define foo2_width 16
static char foo2_bits[] = {
@@ -297,12 +316,10 @@ test imageBmap-5.16 {GetBitmapData procedure} {
0xff, 0x81, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81,
0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81,
0xff, foo};
- }} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-5.17 {GetBitmapData procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data "
+ }
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-5.17 {GetBitmapData procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data "
#define foo2_height 16
#define foo2_width 16
static char foo2_bits[] = \{
@@ -310,67 +327,66 @@ test imageBmap-5.17 {GetBitmapData procedure} {
0xff, 0x81, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81,
0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81, 0xff, 0x81,
0xff
- "} msg] $msg
-} {1 {format error in bitmap data}}
+ "
+} -returnCodes error -result {format error in bitmap data}
-test imageBmap-6.1 {NextBitmapWord procedure} {
- eval image delete [image names]
- .c delete all
- list [catch {image create bitmap i1 -data {1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890}} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-6.2 {NextBitmapWord procedure} {
- eval image delete [image names]
- .c delete all
+
+test imageBmap-6.1 {NextBitmapWord procedure} -setup {imageCleanup} -body {
+ image create bitmap i1 -data {1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890}
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-6.2 {NextBitmapWord procedure} -setup {imageCleanup} -body {
makeFile {1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890} foo3.bm
- list [catch {image create bitmap i1 -file foo3.bm} msg] $msg
-} {1 {format error in bitmap data}}
-test imageBmap-6.3 {NextBitmapWord procedure} {
- eval image delete [image names]
- .c delete all
+ image create bitmap i1 -file foo3.bm
+} -returnCodes error -result {format error in bitmap data}
+test imageBmap-6.3 {NextBitmapWord procedure} -setup {imageCleanup} -body {
makeFile { } foo3.bm
- list [catch {image create bitmap i1 -file foo3.bm} msg] $msg
-} {1 {format error in bitmap data}}
+ image create bitmap i1 -file foo3.bm
+} -returnCodes error -result {format error in bitmap data}
removeFile foo3.bm
-eval image delete [image names]
-.c delete all
+
+imageCleanup
+# Image used in 7.* tests
image create bitmap i1
-test imageBmap-7.1 {ImgBmapCmd procedure} {
- list [catch {i1} msg] $msg
-} {1 {wrong # args: should be "i1 option ?arg arg ...?"}}
-test imageBmap-7.2 {ImgBmapCmd procedure, "cget" option} {
- list [catch {i1 cget} msg] $msg
-} {1 {wrong # args: should be "i1 cget option"}}
-test imageBmap-7.3 {ImgBmapCmd procedure, "cget" option} {
- list [catch {i1 cget a b} msg] $msg
-} {1 {wrong # args: should be "i1 cget option"}}
-test imageBmap-7.4 {ImgBmapCmd procedure, "cget" option} {
+test imageBmap-7.1 {ImgBmapCmd procedure} -body {
+ i1
+} -returnCodes error -result {wrong # args: should be "i1 option ?arg ...?"}
+test imageBmap-7.2 {ImgBmapCmd procedure, "cget" option} -body {
+ i1 cget
+} -returnCodes error -result {wrong # args: should be "i1 cget option"}
+test imageBmap-7.3 {ImgBmapCmd procedure, "cget" option} -body {
+ i1 cget a b
+} -returnCodes error -result {wrong # args: should be "i1 cget option"}
+test imageBmap-7.4 {ImgBmapCmd procedure, "cget" option} -body {
i1 co -foreground #123456
i1 cget -foreground
-} {#123456}
-test imageBmap-7.5 {ImgBmapCmd procedure, "cget" option} {
- list [catch {i1 cget -stupid} msg] $msg
-} {1 {unknown option "-stupid"}}
-test imageBmap-7.6 {ImgBmapCmd procedure} {
+} -result {#123456}
+test imageBmap-7.5 {ImgBmapCmd procedure, "cget" option} -body {
+ i1 cget -stupid
+} -returnCodes error -result {unknown option "-stupid"}
+test imageBmap-7.6 {ImgBmapCmd procedure} -body {
llength [i1 configure]
-} {6}
-test imageBmap-7.7 {ImgBmapCmd procedure} {
+} -result {6}
+test imageBmap-7.7 {ImgBmapCmd procedure} -body {
i1 co -foreground #001122
i1 configure -foreground
-} {-foreground {} {} #000000 #001122}
-test imageBmap-7.8 {ImgBmapCmd procedure} {
- list [catch {i1 configure -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test imageBmap-7.9 {ImgBmapCmd procedure} {
- list [catch {i1 configure -foreground #221100 -background} msg] $msg
-} {1 {value for "-background" missing}}
-test imageBmap-7.10 {ImgBmapCmd procedure} {
- list [catch {i1 gorp} msg] $msg
-} {1 {bad option "gorp": must be cget or configure}}
+} -result {-foreground {} {} #000000 #001122}
+test imageBmap-7.8 {ImgBmapCmd procedure} -body {
+ i1 configure -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test imageBmap-7.9 {ImgBmapCmd procedure} -body {
+ i1 configure -foreground #221100 -background
+} -returnCodes error -result {value for "-background" missing}
+test imageBmap-7.10 {ImgBmapCmd procedure} -body {
+ i1 gorp
+} -returnCodes error -result {bad option "gorp": must be cget or configure}
-test imageBmap-8.1 {ImgBmapGet/Free procedures, shared instances} {
- eval image delete [image names]
- .c delete all
+
+test imageBmap-8.1 {ImgBmapGet/Free procedures, shared instances} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
image create bitmap i1 -data $data1
.c create image 50 100 -image i1 -tags i1.1
.c create image 150 100 -image i1 -tags i1.2
@@ -386,43 +402,68 @@ test imageBmap-8.1 {ImgBmapGet/Free procedures, shared instances} {
i1 configure -background black
update
image delete i1
-} {}
+} -cleanup {
+ destroy .c
+} -result {}
+
-test imageBmap-9.1 {ImgBmapDisplay procedure, nothing to display} {
+test imageBmap-9.1 {ImgBmapDisplay procedure, nothing to display} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
proc bgerror args {}
- eval image delete [image names]
- .c delete all
+ imageCleanup
image create bitmap i1 -data $data1
.c create image 50 100 -image i1 -tags i1.1
i1 configure -data {}
update
-} {}
-test imageBmap-9.2 {ImgBmapDisplay procedure, nothing to display} {
+} -cleanup {
+ image delete i1
+ destroy .c
+} -result {}
+test imageBmap-9.2 {ImgBmapDisplay procedure, nothing to display} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
proc bgerror args {}
- eval image delete [image names]
+ imageCleanup
.c delete all
image create bitmap i1 -data $data1
.c create image 50 100 -image i1 -tags i1.1
i1 configure -foreground bogus
update
-} {}
+} -cleanup {
+ image delete i1
+ destroy .c
+} -result {}
if {[info exists bgerror]} {
rename bgerror {}
}
-test imageBmap-10.1 {ImgBmapFree procedure, resource freeing} {
- eval image delete [image names]
- .c delete all
+
+test imageBmap-10.1 {ImgBmapFree procedure, resource freeing} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
+ imageCleanup
image create bitmap i1 -data $data1 -maskdata $data2 -foreground #112233 \
-background #445566
.c create image 100 100 -image i1
update
.c delete all
image delete i1
-} {}
-test imageBmap-10.2 {ImgBmapFree procedures, unlinking} {
- eval image delete [image names]
- .c delete all
+} -cleanup {
+ destroy .c
+} -result {}
+test imageBmap-10.2 {ImgBmapFree procedures, unlinking} -setup {
+ destroy .c
+ pack [canvas .c]
+ update
+} -body {
+ imageCleanup
image create bitmap i1 -data $data1 -maskdata $data2 -foreground #112233 \
-background #445566
.c create image 100 100 -image i1
@@ -438,32 +479,41 @@ test imageBmap-10.2 {ImgBmapFree procedures, unlinking} {
destroy .b1
update
.c delete all
-} {}
+} -cleanup {
+ image delete i1
+ deleteWindows
+} -result {}
-test imageBmap-11.1 {ImgBmapDelete procedure} {
+
+test imageBmap-11.1 {ImgBmapDelete procedure} -body {
image create bitmap i2 -file foo.bm -maskfile foo2.bm
image delete i2
info command i2
-} {}
-test imageBmap-11.2 {ImgBmapDelete procedure} {
+} -result {}
+test imageBmap-11.2 {ImgBmapDelete procedure} -body {
image create bitmap i2 -file foo.bm -maskfile foo2.bm
rename i2 newi2
set x [list [info command i2] [info command new*] [newi2 cget -file]]
image delete i2
lappend x [info command new*]
-} {{} newi2 foo.bm {}}
+} -result {{} newi2 foo.bm {}}
+
-test imageBmap-12.1 {ImgBmapCmdDeletedProc procedure} {
+test imageBmap-12.1 {ImgBmapCmdDeletedProc procedure} -body {
image create bitmap i2 -file foo.bm -maskfile foo2.bm
rename i2 {}
- list [lsearch -exact [image names] i2] [catch {i2 foo} msg] $msg
-} {-1 1 {invalid command name "i2"}}
+ list [lsearch -exact [imageNames] i2] [catch {i2 foo} msg] $msg
+} -result {-1 1 {invalid command name "i2"}}
removeFile foo.bm
removeFile foo2.bm
-destroy .c
-eval image delete [image names]
+imageFinish
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# fill-column: 78
+# End:
diff --git a/tests/imgPNG.test b/tests/imgPNG.test
new file mode 100644
index 0000000..0757411
--- /dev/null
+++ b/tests/imgPNG.test
@@ -0,0 +1,1116 @@
+# This file is a Tcl script to test out the code in tkImgFmtPNG.c, which reads
+# and write PNG-format image files for photo widgets. The files is organized
+# in the standard fashion for Tcl tests.
+#
+# Copyright (c) 1994-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998 Willem van Schaik (images only)
+# Copyright (c) 2008 Donal K. Fellows
+# All rights reserved.
+
+package require tcltest 2.2
+namespace import ::tcltest::*
+eval tcltest::configure $argv
+tcltest::loadTestedCommands
+imageInit
+
+namespace eval png {
+ variable encoded
+ # Key names are from the names of the source images, which come from
+ # http://www.schaik.com/pngsuite/pngsuite.html
+ # The exception is "BadX", which is used to test handling badly compressed
+ # images.
+ array set encoded {
+ basn0g08 "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAAAAABWESUoAAAABGdBTUEAAYag
+MeiWXwAAAEFJREFUeJxjZGAkABQIyLMMBQWMDwgp+PcfP2B5MBwUMMoRkGdkonlcDAYFjI/wyv7/z/
+iH5nExGBQwyuCVZWQEAFDl/nE14thZAAAAAElFTkSuQmCC"
+ basn2c08 "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAABGdBTUEAAYag
+MeiWXwAAAEhJREFUeJzt1cEJADAMAkCF7JH9t3ITO0Qr9KH4zuErtA0EO4AKFPgcoO3kfUx4QIECD0
+qHH8KEBxQo8KB0OCOpQIG7cHejwAGCsfleD0DPSwAAAABJRU5ErkJggg=="
+ basn3p08 "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAAYag
+MeiWXwAAAwBQTFRFIkQA9f/td/93y///EQoAOncAIiL//xH/EQAAIiIA/6xVZv9m/2Zm/wH/IhIA3P
+//zP+ZRET/AFVVIgAAy8v/REQAVf9Vy8sAMxoA/+zc7f//5P/L/9zcRP9EZmb/MwAARCIA7e3/ZmYA
+/6RE//+q7e0AAMvL/v///f/+//8BM/8zVSoAAQH/iIj/AKqqAQEARAAAiIgA/+TLulsAIv8iZjIA//
++Zqqr/VQAAqqoAy2MAEf8R1P+qdzoA/0RE3GsAZgAAAf8BiEIA7P/ca9wA/9y6ADMzAO0A7XMA//+I
+mUoAEf//dwAA/4MB/7q6/nsA//7/AMsA/5mZIv//iAAA//93AIiI/9z/GjMAAACqM///AJkAmQAAAA
+ABMmYA/7r/RP///6r/AHcAAP7+qgAASpkA//9m/yIiAACZi/8RVf///wEB/4j/AFUAABER///+//3+
+pP9EZv///2b/ADMA//9V/3d3AACI/0T/ABEAd///AGZm///tAAEA//XtERH///9E/yL//+3tEREAiP
+//AAB3k/8iANzcMzP//gD+urr/mf//MzMAY8sAuroArP9V///c//8ze/4A7QDtVVX/qv//3Nz/VVUA
+AABm3NwA3ADcg/8Bd3f//v7////L/1VVd3cA/v4AywDLAAD+AQIAAQAAEiIA//8iAEREm/8z/9SqAA
+BVmZn/mZkAugC6KlUA/8vLtP9m/5sz//+6qgCqQogAU6oA/6qqAADtALq6//8RAP4AAABEAJmZmQCZ
+/8yZugAAiACIANwA/5MiAADc/v/+qlMAdwB3AgEAywAAAAAz/+3/ALoA/zMz7f/t/8SIvP93AKoAZg
+BmACIi3AAA/8v/3P/c/4sRAADLAAEBVQBVAIgAAAAiAf//y//L7QAA/4iIRABEW7oA/7x3/5n/AGYA
+uv+6AHd3c+0A/gAAMwAzAAC6/3f/AEQAqv+q//7+AAARIgAixP+IAO3tmf+Z/1X/ACIA/7RmEQARCh
+EA/xER3P+6uv//iP+IAQAB/zP/uY7TYgAAAbFJREFUeJwNwQcACAQQAMBHqIxIZCs7Mwlla1hlZ+8V
+itCw9yoqNGiYDatsyt6jjIadlVkysve+u5jC9xTmV/qyl6bcJR7kAQZzg568xXmuE2lIyUNM5So7OM
+AFIhvp+YgGvEtFNnOKeJonSEvwP9NZzhHiOfLzBXPoxKP8yD6iPMXITjP+oTdfsp14lTJMJjGtOMFQ
+fiFe4wWK8BP7qUd31hBNqMos2tKYFbRnJdGGjTzPz2yjEA1ZSKymKCM5ylaWcJrZxCZK8jgfU4vc/M
+W3xE7K8RUvsZb3Wc/XxCEqk4v/qMQlFvMZcZIafMOnLKM13zGceJNqPMU4KnCQAqQgbrKHpXSgFK/Q
+n6REO9YxjWE8Sx2SMJD4jfl8wgzy0YgPuEeUJQcD6EoWWpCaHsQkHuY9RpGON/icK0RyrvE680jG22
+TlHaIbx6jLnySkF+M5QxzmD6pwkTsMoSAdidqsojipuMyHzOQ4sYgfyElpzjKGErQkqvMyC7jFv9xm
+BM2JuTzDRDLxN4l4jF1EZjIwmhfZzSOMpT4xiH70IQG/k5En2UKcowudycsG8jCBmtwHgRv+EIeWyO
+AAAAAASUVORK5CYII="
+ basn6a08 "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAAYag
+MeiWXwAAAG9JREFUeJzt1jEKgDAMRuEnZGhPofc/VQSPIcTdxUV4HVLoUCj8H00o2YoBMF57fpz/uj
+ODHXUFRwPKBqj5DVigB041HiJ9gFyCVOMbsEIPXNwuAHkgiJL/4qABNqB7QAeUPBAE2QAZUDZAfwEb
+8ABSIBqcFg+4TAAAAABJRU5ErkJggg=="
+
+ BadX "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAABHNCSVQICAgIfAhk
+iAAAABN0RVh0U29mdHdhcmUAVGsgOC42YjEuMcrtT1oAAAAcSURBVHicYmBgYPjPgAr+ozP+o0uj68
+BUiWEmAAAA//8SozfjAAAAAElFTkSuQmCC"
+ MultiIDAT "iVBORw0KGgoAAAANSUhEUgAAAN8AAADUCAYAAAAcPvbvAAAAAXNSR0IArs4
+c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oEGQQKMpLRO
+uoAACAASURBVHja7L158GbZWd/3ec45977bb+2e7p7pnu7ZNzFaRhJCwggjsHqUCgUhiWMSJymwUoV
+UlkumJChCHFWBywQQNqhYpFDB2Ljs2EWqiAmphMQVO2ATQMJCQsuMZrp7lt5++7ve9957lid/3Ptbu
+tWjGRAgZvo9XW//3vXe973nfM/zPN9nE1VlMf58RwHkgFMgJhDAQg0EAJQ+FuYekgVrCBope5YK6F3
+8Vw9UCdbvOnuBwbH2aDnBKy7rtkcA357PYHC0B0/t2xfjaz7M4hJ8jS+6fPnriqKqxLqG1IDTGINpP
+9vtds8bY85j5ABoYBAxX3ly5dbnW4wF+G7PoTcDpvnnYyDEeACYJOlgsozN3xMS71Fx7RQaFIOIbY6
+n5iaMpQX4/gIOt7gEf/7jyzFgQMFIAxODQSShmYXcgICmRr5F9dlwPH3XaFJw3LgMjFcsgiDtcZAG1
+HIEsArIAnwLybcA30urnQcPjSHr5GBNK7kSgpLq6h0XLz63fP36xjKYd4AlYUgYdF/t1MPJlVtJv8V
+YgO92vujmFmJQblAUFbWmfXPCZQaH4mezJ5/+wtM8//yLBJ+ePFQ7pQGdtjhTGkl49LiSFuBbgG8h+
+V5OJU0CAQVJJBQxIBqY7uw8+fyFS2xcvkooqycPxBzSqJU3MjcHE5yOAnAxFjbf7bzjyVG06Y07YWy
+ghEps3AUaMJpB7U8Ue8MnptvbpKSkyj9BTCewbMm+TccR6WdvBLoutM6F5FtIvpvuHFE7DaAaMRiCJ
+hKxnSUlFMW7r1+8ZIrNberhmPHWhsHIu20r16K2yE2HgL55khd+3QX4FuMWNh8KouDUoijG2saWA9B
+EPR6f37t8Fb+zTbW1wdVnn0GHu+eJFYaAMa0uc8MxzWKiF2rnYtys/+nNkjA1Dw4kIAaIiCYAmW3vv
+Pv6xUuc7uY4Z5ltXENC9W6siKKaNEEAK6ZVZxVEDjRbARC7uP4LybcY6WYNsbXVGuDpwStiFIJ//Wh
+r+/Tw6nXcdEI2m7B96Vn8aPc0qX49VIjEBls36pmAaX2A5gZ1dDEW4LvtheCNd1ppqPsATc39afHke
+GsLijlrKXDMKDoZUY92INZPQiASUEmo6OEBAJI2t1ucZzEW4Lttgbcv/W54UsEeqIsREWE2Gp7fvbZ
+BR4S7Bl1ODnosWaXY2wZfnBcCSiRoA8B9cuWQYJEF8BbgW4yviMZDbbMJsEYRUm+8s/fOzWtX6RmHK
+Ut0NiVMp1x5/iJpMn4n0LMI1jQ2nR7x56nqIfAWbr4F+BbjKxuDgrR2HwDvms7GnclwhBXDXXcc5/j
+qEsu9LnVRoMF3IL1LSXitSC3CVF5Kx12MBfhu0xGlSa2LBKDCUIH4AxdBSFABdcrpsgTT4jxXL3C3v
+8bXZZsMj09YX4k8sLfLGy9sYj//AuxMzqc4oxTLmEQtYKRJMxIR1OjNwZ6LsQDf7TteCge29QZYAxC
+Z7e6cH+/tYpLSzRyDwQDnGi9RWZawuwfz+Xln7a1z+F7JSRdjAb7b5aLv+/LM/hTI4ZNiGxUxA/D1u
+d3rVx/b29zAxJqBc2TWISJ0Oh2cs1DMoJw/ZpKegxpzk355g/q5AN8CfLe7xDMcDURpH7VPqECMYAH
+q8vxo8zrz4R5dha4xTQRM5ED61eMRTKcQ03nRwIGr70gcm+4ffzEW4Luth+4D0HBDzvlB1nozMY5Em
+k+fjJMxnbqmbw0dlH7Ww4khxkgxn7K7s0Xc3QEfnlyRDHcTpalH/y4AuADf7Q6+fQA2twaKKg0Zo4C
+zQArWj4bfJtMZfWDZGnoiZGJxJsN1crLMYjWRiikUs2+DZDNNByFl+ypnkhuBuBgL8C2YliM1WBJNU
+kIEnCSopm8rtjfXw2iPzNd0ETpJMcmRuR5Z3qXb79HJLTIvYTRap6ze5lLCHg1wOfJ34eZbgG8x4KD
+Y0X7mwWEiekSIUM7P+71dwniErSqcD1iUvhuQGUeISlGW1MWMajyC8QSinicq0sIs3ax7LsYCfLf3a
+GWQ3giK/SBrQUE9Ops+GcZj0nRGR5WOs0iM+DJRFDVBlYQS64o4HsHuLoTwZBNMLU1qX2qSbJsSobr
+A4AJ8t7vamb7M/jsqnCwKKa2HWfE2PxqSh0DXGHKxZFlGbvt08iUkyxFrsMYQZwVxcwf2Rm+j9uu0M
+Z37Np+9UQ4uxgJ8ty/f8mUA5KbEdu+/rdjdttPtHZxP9GyGMYYsy8ntgKwzQIxDrSOzllTMKba3YDS
+yhPBtaGyO1TKn5sDODIsJWIDv9h3xqPK3z3weAaABKOsnp7tDyuEIGyNWDClBQDBqMZIRsCQBay3UN
+Wk8g2IOSZ9EBYNytGqEFV0Yfwvw3e7gS4dB00cyGQ4iXxRiMTtfjsdQB3JjceIa+w4BzYjJUadETBB
+jRLwnFQVMphDj+abOpxwCW0FIB0TMYizAd9uqnfHmJ/SGx4/NJ9Nz1bRo7Lw2nAzjSEZAHT4mklpqj
+YS6JtWeOJ/D1jaU1TlCfOzgcAnQ2E72AnwL8N3Wki+2ki/emMPXOt6T9+dHe0PqYk4mBougqhjnMFm
+OkYwUmyBQwRBCgBShDky3d2E6AV+dv6FIRVKU2HoTF2MBvttY8qVbsjDN8N6fn02mVPOySQdKiZRS0
+6nIZs3bVZvHzrb2nGBIzGeTxu6r6/OKNhKzJXgWZQP/Yo1F9bI/T9C1iz/Spw9NQz4FejAlUlOzCp1
+sd/td/UtXcFtzenPBxBx1UKSaEC1djWQmI9VgnWsKdkahmxx6bQR/+Hm489S7TLXbKaypCrcK5Aw0x
+4XFrC8k3+180aWtLn1TcmvTaUjfWRVFz1c1GiOookkQNc0tQUqJGCMpNLcYAr6uqeYlVTEnDIcwnvS
+I+k5n7H7vzS8vJ78YC/DdbkP21U5p9M0YIwI4BI3x/GS3sfdSiKR0o7qoKRFCQFOCmNCgaB1IPhCqm
+nI+Z+vaBmzvQEznu8YtBN0CfIuxPxKHlfxAG3uulU5pXj052xsR5h4TFQJoBFFBkqBBCSkRQ0JTQkL
+CREGiIjGhdWCyNyRt7UDpn2wmObah24uxAN9C8jXgsxyEnhgEB6fDdP76+d4YrTwOi2jjXNckEA2xB
+u89IQRSSGhImKRYFSQKEiCVNeONbZjOX0/ktNOI1bb+52LGF+C77S/6fkiLE0S0aXEZw7vr4Uj8aIq
+UHptAVIkxIckiScAnfB3RoCSfSJUn1REJNFLRe0IZ2L56Hba2BR/f7ZKQyyKTfQG+xbhRBLZ/LKDz6
+vx8e0iazJEqYqOgEVLQJjtBHRrb/D9tX/OJWEeiT3gfqavAbDrl6vMvMrx6HWbz88S238OiR9hfqLG
+wxb9GmFONIK5pfpkClszovH63H02xRY2tIyYKISopAmohKkYdYiwiilElJYtGJSbFR8XHyHQ2Z4Qy2
+tpjbVa+m17f4DQhsWFOv+peKYs9eyH5/oKOl3Jmi0jr9G4c5sH7ZhIUqMMTroontp+/Qr03oRMgzit
+iHRFxzOcVVeUbuy8m6ipSzCrms5JyXlNUNUVVMatqyhjx3vO5T3+GsL17gpSeIDVBnokvZ1CPfu/91
+24sNX8TYXTkPTd/fuHIX0i+vzDgk1s41ywGS8LmFjRhswxierIajTCzCqkjztOQJ6ntdxkVrRMEJXR
+NWwLekKIwrz0xRqqYmMbAqC7Y8yXF5hbj3T2ORX0STX+AGoy1reRtgHZ0U9i/LQC0kHyvOsAd3fmP/
+r35BhFNjQM91XWDsKp6cu/aJmkypxPABcUkwbSFADUJMYKvE7WPhAAhQFlFJvOaYVGyPZuyM59RG2F
+rOOTChQtcfPYCeP8kIpRlgVd/ADhjDMaYryitF0BcSL5XpYr50he9bWiibYSnmGVieke5N6YTIasTJ
+iQ0RKIoUSAmg8QGp943sZ6+qqnnJfO6Yh49Y18zToFpmdiaTCh9xYULl3jrpHgHa6vLeZ5PklhU9Yb
+vt39/X53cB+TR3yiL8JiF5HtVECrtQr1ZnTskXJSjmeaQ3uWHw2y0tUU1miCVR+cBX3qqsmZeeXxM+
+AAxKAlH8IlyXjOrAkVITENi5Gt25gWX93YpgqesPBcuXOC5S5cy6vpdMTbnjDEeqJxHpbOINIm5Cwm
+4AN+rSeodVStvBtuXfS4F9jl/cRnU/j17W9vMRmPK0QSqQKw9ofZ4HwkpNfl7SQkRYoI6wLyqmc5Lp
+mXFuCzZLefszAtmGilCYFRMufDsRa5duwZJ35PlOYmm0vVR6bYfK3qzyvxSqvViLMD3qrL/jt72e+g
+RA8TIfDw+v7O13YSKKahP0AZNp5RIsZFWPgbqumY2K5jNCiazOZNpwd5kyt5sxrAoGFZzJlXF3mzGX
+jHl0vPP8cUvfpFrl198/7ycU6Wasizx3h+omfsbxa1s1sVY2HyvKgl4VPW81YKeT6agynhv7wlV/Ya
+969f/zQvPPTfU0fj1/WKe+yph6pqQwoHNl2IilR5becblDF/VFMWcopgz9XOmEijUU2lgHEpCo9zyw
+niHX//1X+daXXDPGx+v1s/c9Uf3nzr7h4PB4FMrKyu/NxgMPu2cwzl3S9fBwtb7MzRPbscdzlPSRFO
+aI38P1QCNbRl3A02nythkipvGZhqSYxBsW+jdtoX5AjAPje/cojjGOPbohhKmNWyPHg07o/Ofuv573
+7o3nn7zZ75waf36iyNOd0/zsDvDyT3D8V3F7pXEqqSQinIgTLPIuJ4xns+oqhK7u0WZAsN6zrYv2CO
+wZwK7WrMdPMMI0UEQRx2UGJU867O+ssbS0hIPn+rz0GOPcuaBezlx7vTeg48/9ltn7z/3/ywtLf1fn
+az7FFHJbQeNhgiI7Ta/jcbtkamSidzQ7OWw6xJH7NkbukQcGenI1ZYjStjLKWLpNaWw3Zbgq6jbhXM
+IQMNhuOWhbdZEoohpc89Nk3M3ItEhawsSgfcRUUfHWaxAVU2QuEcoNvCTjbcVm1e/a+u5y99++UuXH
+r/+4iYvzq+zNRrzhWcuU0yFJ+59gneefTPn/CprY5CdKZoC01QwEc/c1BSpYjgaMRmPSeWYOkUmqWY
+nzNlNnqEJ7BLYS0oBeAvBCDEJITaL3ZGRGYtJBYOOpb/SY+3EKg8/+iCPPPoADz14P/efPfu5+++5/
+zeOrR3/Nddf+X1sBlmHGou3FiHD4m6AzAHAUkA14lrSRm6IZTsKmHgL4L0cqNJrzlq6TcHnj8i8tk+
+QHpnQtp7KfqMRNTe2NDcpYo0AHsE3z6YAsznMZ8StF+4bbVz861svPvXXtq9deny4vcHu9h67uyOKW
+c0w9bi6tculywUuc7zjsb/EW8+9kfWxhetTBkGwBiZhxrCcUlASY2Syt8vuzg4TG6lJzJJnV0tGePb
+wTEiMUGY0SfLxoAeZgaStImpY7TqCr0kR+haODWCtC2dO9Xjg7N08cP+9PPzIYzz2xjd97tT9D/4LT
+p75p7jOJRBULOgpVJu+7yL7x20u3H5VNmk3twOJdnSZSbgFkF6p1HvtgO82tfluVnnayT2KMGsQOSx
+BFI/clpNAqoESZAr1FN3dZHb58neEjSt/Y/vZz3+n33qR6d5lUjFC5gXMSsxc6aqBaYbfKuiUcO7Yn
+Zxbu4s128ekmipFJnUAo5QamMaaedWoodW0REjsGcUnmAFjDEOUCcIMocYQ24bT+z9HJGEyg2gTvbJ
+X1ViFdQd3rcCprjBQZX06x12/wAubz+CvfJ7RC59+/OzDjz1+92Ov+7vH7773X9r1E/9Qlld+nbSMq
+B5tMAjGHdm72n6AB1scN25scjOAbk/ez92e0DMI6aVblB9ZC0nbGs/7QFTAz0Dn4PeIwxcZXr34vtE
+LF95fXn3hDW64Q9q6gp2PWKkndDVA9IwrD7PGRTAZlexsNsdblyVWgiXtzWAcyZNlWhZ4qSnwFMkzr
+ucUkwmhKhCUXQNVikzVM6RmTGRKokLwCMFkHJZpSqhCjG0omQHpOGyK9HJhJXesW+VkFjnWSwxSYm0
+1o6NTphvPcLHeZDp6jjvP3fudJ+8+951rJ05+llP242SdT5D3GgMXA9GRxCKmAxgS9gB+B3gT/hj23
+QJ8r02W6dDK+/IXbnYZxIATwVjXqqEK0yvocIPR1qXvn2xc+v5y44WzYesyDHeQ2YQVEwlaMI0zijI
+yKyF4MGLIxDH2iQgcy7ucXT/NcVlC9mrCzpxU1oToKaiYSs1Ua4ahZuQLEjUWx9B6ilgzoaYgMkWpM
+FTtlhL2u6NYB/ijafONHZsCSZuKZxmGnhGOLy9xetWRuznS9ayudxkc72P74OIOxcacYbmB7Ky/QWL
+28cHy2g/btVM/TW/tp2EA0sPQBTVoS0Dtb1iHXXJTWyb/FstO+YpzcWuyZgG+V92wuh9QbA/L+N2kg
+RpRNNU49U2ty5iI8wnFeEJ1+ffft7dx5YcmVy/eY4Zb9OsJy7MZqS4Ifs60mlJrzRSYOYPv9pDkSHN
+lOvW8MJxQAnf2V1npr9IjR7ynqiLldM48VhQ2sMuMnThjr55RSMCTSMzZTCVlrCgIrdUp1AgRQY1tf
+1DznTGmTZtoMtnFgBihK8rqYIn15S494zHGoM4QMsfa8SX6x3p0VnJsR+h3PaudwHo+Z9V1uT7890h
+YP7vM3f+AcOcH6Zz4cczxT+COgeSI2ltgK+z3TfryZfeytEO6hd23AN+rlGVKLdjsQUNKPaIeGQOWi
+EgNWkAsYLrH9Nrz37Fx5fJH0uan36LFBDcZ0asn5NMZZlpAVWI1kfX6zNVQzBOjOlImQ6kZ89ozmwa
+qXh8NJaY/oPbKbFzSKZt4zTIFtmdjZnlgK824Vo8Yqyc4YZ4ikzhjO84plZbqab51gAZ8GhBnm7DRl
+A515f3OtAoaFTHQdZa15WVWTc3yQFm/Y0BvOTK4w+JWLLan5B1YXepyrJuz5BLEGb1sE9KUqpjjdHy
+Pqacfl+78v4Hwo7j06yI9mgbW2WsSNAvwfTUjNRJBUZLIAQD3BWAiYuIMW4+h3Ibh1fuKjed/bHbtu
+e/WvW1s8RzG13RTSV8rnHiSDXgjRHGUoaJMileDOiEGZV6VVHVNSoGRF3LJGKwdww6W2B3P6UWBHK7
+MR2zHgpRnjHxkbGGKMEmBUgIlllFqgCcCLoOyVoxNaFSyrI+v64boNwZSQjGINmqvoOSZspxZus7Qz
+ZTVnqWbFVhJrK320Kyg03EsrfUYDPr084yutdi8C3kXK2NyF8nzHIwlxkis5m+xMvuXRsb/XNz6Dwv
+LlwyDFoCNA1/bPhN64Ae0yH4ZRb1xeg6y/EURMUfUzbQA36tb9DWz29DkcgMJZ1BsKrA6g2obf/2pD
+46e//xPVpvP5VIOOUbAxjEpVKR6TvB1E6isieQcRjIk1oSipJ6XWGdY63aRgbC7MWW4B0Nfs2oyKjX
+43DHLEluTMbP5jE07Z8fOSNFyfb7HOFbQ7zGtE8NQNYm1rcljLYS2sW2336GqPDE0Va7RdGDrNUlJr
+i1HL9RVhSeBRnKTWOrC8Z5yYiVyx3LN8vGM0A3YvMJZQ+YsttODTg42I3OGzAIyBzGIqREzJ8kUTXv
+fLXr8P0bWf1BY/5hhHRgg0kWTQxRS62o4dMLfWF9GzCthqhfge5WCzzZkgAZUTLs0E4aIY474PardF
+x6eXnnqY9X1Z99jhpfpVtvkYYyJFbaqqOuKOpTU0RNRojT0ukk16gPLWYbVxMx7dveG7OzCuICQQd9
+06Ls+UWCzmOKLis3xFrNQE9YMS3ece6q/tvTUkvpn8l7/uc7S8uU/evrpjd/77L//3Vrrg3CSKBAjd
+JY6fPO3fMuJc2fuXo0+3THaG5+ajEZ3b23u3Luzs/fQbDZ7tKrqR0MIxBhxNgOBmBI2h7X1LneuCHc
+szRnIlCUyEgmkQ6fTpbvSxXT6YHLAkuUDxLomKkHmiKkwpkB1SEo7aNjJxdzxM87e+R4IHwT5EmRNf
+bZWrVf0IKVK1dyU4vSKmJcF+F6dvgaDpoSmiDEBZxJCDWEGfkSx+dx7Z9ee/bnx5ae7rthg3VYsDyJ
+pVlHNh2SlI0aPpAhWiQplnYihRjxIEqRWxCsSG4d5tMokwmYJ8+Dp9hMboxEu2904duyO3zr3yFt+5
+/RD937y9EP3ffrYqfXi+PHjdJ2lm/eoysg//p//GV+4fIW92QzyDnjfBGarcseps3zHd/4n2+e/9V3
+bBrkgQDGZsru9x+bmNpevXOPixUv9C89eemJjY+Prr2xe+cZquPHNV7bGpy5kJWeWTnLfqRWOHV9ib
+bkGU2CyRNYdQLcPuYPctO1tFekstd6CACYh1mNsRZI56BzROaqepOY9Iu4zQvYBcL/UuCVsa52apn/
+EgU1oX0aqvbZUztsWfIojSUBMwJg2arHcJY2u4UdXPjG6/PT32XKXVbYxZoKppsx9Ab5ADaTUVBNTb
+cu4ix7s1knbiM9sQDIdirJmo665XldMctDj8ODxR/+/1z382P/+5te98TcffvCxT9197330T6xjVwf
+kq31cblnpdluvvqEeTukeW8esLLF+Yp2uXaGazyhGOzAe0ukf5/S5+7nn3gcwGknRI0mRRwUxOSkoe
++NJsbmx9e92h6N/90dPf+5nXrzwFNe++Om3msnVJ6cu/YdX5913dAtLbTJO33kS20vQyyBzIBaVCHl
+AugZxDjWpkX42gDGISVgCQoVSoalAdEiQvCti/ycj+vXG1O9D+kB2xIbTWwDLvOZVztsWfHPAiWlqW
+VJBtQd7zz1aXnv6l8vtS2/PptfpMselOeiUyk/xddXszXkHnxlCisRQQ1JcVLrR4MURbM64ipTGsVV
+HLk2Va2VOOvXIH77hG5/453edffh/eewvv/PCmROnOLZ8nMzmuF4fBpZKGrwFLfExkAXAC5Um8rVV7
+nrsIY7dcxab7mVvZ4MvffGP2KmewWTLiPRIgPeBbu7Q1BRRIkXE5Kyur7C8tsq5mPj6b3or0/GI7Su
+XPrV3+eKnys0X/l7Yu/rAeLr1nxbl9nfX4+xNK0lZ7hq6YsAl6CSkGyBXou01G45regY2RWEExGI0A
++2ACEkr0DFJLMmF77OM3yh0vxfufWq/M4U0RRPZDwpQFUQSt4MT/jUJvpeLV40iCIaUPKYcwfDFb68
+2nv0Vv/XsOpMXWLMVUo9JZUEIjVoaOzlRwUdIVommsfFcFKQ22EqoS6FMQpUN2IqWra4je+TRf/ime
+9/8j85+3Tf/9j0Pv50Tp45R5nss5V26ptfEkDZNhvCAp6YvOU4S2MYeTbZElvpkp44zOHsX9698E9e
+vPM/m9RE717fodI/h8iUUyPIOPswRgayTN61XmpK8GCBzlmExpjvocu9jb+Khx95ELArKve0L843LP
+1EPr/3E6NqX3jk1o++Jcfw3+n5GT2qyvIasBOMJrkNmsobxwYI6iFlbCrELKQOTY6xBxZNkiEpFJH8
+7uN+RdOa/NuJ+A5Ebgq8PokTV3kB/vlbTmm5Lybcfr+m9J4333ldtXft42r2GLXcZaImLM0hzjFYkj
+fgEPik+WRKCTwmDkIklw2A1EatELAJTn9A7jg3veuihn/26173548cee+u1/pk3YPp3NKU3gdwsE1E
+CYAViVDxNFGSHHEtTidq6DggY5+gsD+jfsU7v5B1kaRmbL4Prg+nT7awgJqMO4AQ6rnPg0E5AUI/Sq
+I8isNJfImGoGrlP3u/T651j6fg5mIw48+Djv11vf+m397Y/83cm1XPvD8Xsbw365VreqxDjUeNJhiY
+bXg0kBykH6YDpgGaNamkMxiTU1CQ8ikGRdav6vyXC+61kn3jpzVNf08B79YJvvwqD9e3yAchQ7SAJJ
+ArYCLZsJzEj0iGmhqdYtQEtrzLa/cxH6tFnf8RMn6ZXX6cfZ0gSfJ0obZ9pp0dpA9YnlufC2qhGxhU
+lV1HXpzJ9rqaMzbpDOThJ/4GHx71TD/3kfW96x0/nayeLwYk7sUsDkgMvTZKgQ8lxbZ/0ANpMglODi
+rRqZ02n1yrIyeJiYnloeHh4kjPXTrF5WgkZdPo5xIKODUg9o2MgaSK0PWj3SQyR5p7d5w6DHDpXjq7
+tDDi2SvI9smOnOH7u8WvzyfWPlNPNH9+bTr4/K/wPZo6V3ul/g8O0Lc48SAVmBq4HdkCswMgAMdrcp
+ImmbTx9guN3ENP9OKyfhGM/CisoPSIdVBwqTXaEIbZpW9I0isEiWJLsZ078yYApC/B9te6C/f/slxv
+j+2GbakEjSZp+JAo4Azq9wGx67aeqyZUP6XwHG0qESJSEswnNlTpUpKT0nMUqkDxBlV43Y7V3jp3xn
+J1xzYQeq2fu4aGH3vrROx/9hh+zZx4eki9DtgydHvsmTRZBTERECAJW0k0exsNhxZJISPIYDMEp3kQ
+K8RR4MitkxmBMw8tHX0NsAsWN2T9iOrg2+6CT/dOZfXLDHqRN7Wt5AuAskvdxA8Pyas7yfLmoJtt/b
+z7d+fl5Wfywq9Z+IDlwRKyNDetJajYTX2Ftv81yaG8KaERN2w5bPRoFMdMfQbIVcB9uokw7RBXMfgG
+q1haUtsOuIK8gFG0h+f5sh6V1lBug0+oqDXOmZr9ymG1CqVTa8KoKp03C53Dvkz/rp1sfCNMX6NSbd
+MIEazyaRbxJBOtxNtANHkJC50qswbgOMe+wOYRa+3ROrnLs9P3/6/GH3vjfZw++/nOcvB/cEtAjkLX
+2C809kWaVByXkiUQi22dJ9cbNoyEhEl4jmc0JTihsZCaeWRbpSEKMtv3VI1U9b8kfMPaw6bS0f00b4
+bKPdTWpfbW5hnqTOBDTgN9gIetBZuj0u8jy8tCWxQ/aNPsVpfi73k/+o8gYxwxjQTUQqXFm0Pye1Ep
+eEsZEwKMSkDRHqUjJIzZ9SIx0IP9bhlZl1X1Hu6EtGdyUtDiQ1LIA39eMUJF547DVjJuFh0pE2x0ds
+RhjMeIhjonVNn4+J3sJbgAAIABJREFU/NlUfOYDzIfk5R7dMKUrFUYitVWCicTocSZh1aNlRNWQXId
+5EPZmJTtylpN3n9u4/9HHf0Duf/SfcOpuyFaBjEnlMZ0ugYjRSKd16DdxlglEiSQEPSKb2kWv+w5m0
+6Y9WRQhWqU2kXmm1B2l20qPFGvQSDkbU/s5KQasNBn3rtmBjli5h6RiPKD19QCeHKE4BAiqaFSMCJn
+t4lxOvrKCWwmYSfY50vi76nj9vwrp6keTyCljSqwJGDJiDIh4DB6MYIySSFiNDfDjtJG2Mm/iZ0U/A
+A6kBWBsxbc1bXpuBGl8s41/cAG+ryFh0qhjIhxGRQtgpM1gO3zKCkANYZs4e+an5uPLH3DheVwqcDq
+lpw1IkiYSihdFxaC+Iq+bWibRdBipY6w5dZ5z7Bu+/Z8eP3P2b8vZe7dZPtYSDTlITt/mBG1URyMGQ
+0JpJFUjftJB5rfZ93UdyaK3R1RqJ225Bm0kurTEIqmGUKOxAgJlNaepyZluTS+puQXlZI58hxslbyO
+Vs0b9pAsonsi+NdntPAQ6Jo8r/4TY+z986v5MiLt/3eoca1oVX6vGpEw1ooLR/VqlCU1jjLUtW1pBi
+IB8ANOpMJ0Po71Gapo2/pNmbjD7W9YipehrNmK7Z7tDjvpAcqiYg8zzxtyKiB+ixYsf8ZMvfShNnqe
+fxmgscVpiUmx6HqREVEXFNZ2AEjgMErvsjj1b04yVux/jode9+f2Tx5/8RKe/3BAMCKlOmJSD67R9G
+A4MLwJKTSTRqJj7nq3GDjOHdSqO/pbUSC2TBJzgIvRsRs/aRnUOnhjqJspGhBBC6+iX/RZINyauSqu
+WS2Pv2S9LZk1HFDnTxp3LQV5e0ERKbeNq0za1dl3IeuSpv23Cyn9Zh+v/Noatj4c4otcFk+qmxIaax
+vYODqKgSUhujN23CdVCjCQVjMs+hMgYWf1RzKBlgATIDtzxr6Vws1en2vlSmdCt8RKOTJEPu6TJc+9
+jfPFHtHge569hIxAFm1rbMQWSCjZZjOSot5jYJ3rLtHSUrsvKubOfPfvGd75Xvu6tn6q7ZxDyFkSCZ
+IlcHfhIrCtsp7VDTaNm7meTpta+6rYK5Q3kkd78O2zj/EuJgeQcz/usZl160RKDPyiqiyg+xTYKxbS
+M4iGQ9i1D3Y/AwbTf/Oj5jtRY0YTRhtiQNpLHqGCMO/CnRwtGOohkYLs4WQGz/gnPyqdSuvpLyvANa
+iqgQJI2dnnqQuo0THQ+B8kgGdCMpAG0CfcTnf8I9uQm3PEJdBW0ByYjteqnvobaW79K2c7OgdUkN/U
+VkNausQYsM2J9/dt98cLHmT6HrTfpM8FUHVJSotQEqcFEUhKcZOTapyoFX+UMx0rJEicefOJXV5/4l
+u/hjvsKasF0+wcY8YBR25wvd1h3ZGGL4MQcQC0QGtuHnMOaMY1E0v2sb23ivg90Z4XMZKznfdZsn34
+URi3wQghoagKkkzSbUkwRZ83BJpUOKIvDQ+b70360sp+mG8GvjQFqjuLUt691laAGSQ5DjrErOFlG6
+HwqRvuOmMI/Smb2V50qIv5Q8pomtlNMTdKExPyAmVWzAzIlMsTK9ONodRmV34CcGDKikYbDIZG/1sB
+3tLDrrRybL9f26o/jEH25CJSXjVAxDqsJlYi0/jNSE6lvAavg8IhuPTqdXviVevw0Hb9BHqeIn4NfJ
+USP63ZJpmY+HZNj6CRHmM4JswHDMcSl05x93dv+fufhN3+YpbtAl6HfZ0X3yZ1WmphmXdZteUHVgJN
+G/TSAbdVKpzn4gHZa8kAEpKmNWbU5bM6AltB1NDaRb36fVpHZ7hBnB9SDQdNUM0aoSmK0iHUETZgYM
+GIx4g7jTTks/qRAaIkd00pc2S9Sqgl8aM7bBLG2z9/o4gkkjEgjuBKkYBBdRWwgz1JRFJP/zMTqp3y
+qPiQpkhEwWjUbjQkELTHSO5BgST2aiqaqmdlkVmzR78VfEbvyjcSVp6CLNU1MbqBC94k2ubWvT1/OH
+6GvbH3eqpnMV7O+bz6GO/rCX5QKxS/3HSQJxtiWSq9bQ1zaSAvIUkLDFuX04i+H0TPrprqG9buYUKK
+1hyAkLFNfoXlJNrD0Uo5MHTY5ikli9eR9LD/wlh/iwdf/BMfOkOwSUfqoQB4OzSkVmqrSbU55Aqy4w
+2jFqNgUW58jkFwjicy+2zkREWJLFhmg26XJWKjnzTMB6nJO9IGUEpkzDLo9+v1uQzKlRF2XWIROp9t
+8NsXGxhJFbNt3r2mNSSA/IPGlrYZtDDhjkI5raf023We/h98NpE2jQps2takJSHGIDIBj9HoPkEL3w
+7HubqFbP56kwEhoik6RwDbBAJKkFbgBbIExU8SCsVO8H6xnaf2Xxa6+w2oPHzKS9dibuiztO+5fMfD
++hOvvZuHzUs1Fb/X5l1rP7uY3vZI6ni91kldaA/Tl3vdy4LOpZTFl/2InEgHBYlSwcUQ5fv4Txe4X3
+h6nF+nGLWycoqEE39gW2IBPJZo8Wcfii0Q9KYhTh1s+zfI9r/ubPPaGX2DtLtT0KVu/nblpBxVpiB9
+7YJHs49K2722/6JEAfm0dx1E9QSMYiyUjxzblKzSBLyDMweYwnzOa7jGtZlCMkXyV2XREVZUQPcZ28
+VWJL+d0yKGqGollLc4KzjTpO40rXKlCxDmLaVVdrNnfxg4k+kFFQLtPc8QDTtSQHS73NhNdm8A5lFV
+EcqzrIaH/E1H6E5Gdn4ddMGPQEpXG79g0+GxYUCMek0rU1DjxBH8FwvG3590Tn8D03mdjF0mCtY2mc
+HQN3gy4l11fXyVpc6v2AEcfH+1S9cey+f44nUn/pJLyZSXby33pVhtCLJGGZDBGMaaCWMP88nvj+NL
+3yeh5OmGbrpnhYgU+NiUK4ghjPZkoSS2pFHb2avykS69zgpNf943fx+lHf5GlY2Ac03bh2YazBBdvs
+o9AVHF6hI61rSonN15lVZAUcAYy0UNLLHn8tKAeTxDvcbEexNnsLWUVX//czviR55979r4gHula+ks
+ZOzs1KZTgIDeJK5cuvPj7//Zfby0hV06vrV9a6fafXhks/RHdzh/QdTP6GS6zoIG8dxxIhNRE/9AWk
+lKagsLuyBc2R5z1+56drC2QpHJoUR4GrPWBHmgXMX2s7f4C2gkq+j8iHpGIamgiXlqXkW0rCxAbkid
+Tj4YRKV0hsf59puM+aczJXzLSBbIb1sefhbZ2Kwy8Ekwc7U71Sr7TV0243OrH/1mrrkY4Qih0G3cCC
+Sgg7T48Hz3zc2lygbzaoisVOYEUEj427B1phI1CRyHFLlUtlJMe3eX7OXnfN/5NHnvHL5Ktg+lRqCB
+isEdyA8qWUbStH1H22Yx4pPx5MgcZ59q+FFoZ3Q+xKfHgmwrXlCVhOGTvyvUnh1evvHu6ufmXs1S/d
+Xt7m0sbm3zu2i6f3Z4RTtxD7+RJlk2grqfU9RSKERvPX+VX/9k/vvu3fi2/u1f5J+4/eSf3nDjJfWf
+Ocufpuzh5+tSn7rr37v83O3Pq/2Z58JvIDKzBSeuwbsPUQsuGtl3jOdobQY644yW2Es82AFL2k2JzI
+jkSwNJBshyxFoL+Yki1A//zog7STlPZU2qMaTYEUgahf3DBslBR+WuUlaU/kJ9jIL+NnPwSVUI63a9
+q836lNt8fR7rdvCG8kk3B/XFVwj9NCfgn35oOJU5DrxsSFXUcYYvnPlbsPdXNi8t0w5CcAgioT8QQC
+Ah9U0MEVxl8mROrHl13huN3v/2HePibfoHeGdTk1NZisY2/jyYoWtQQJR7MYcQ0sfpiGpZyH22tmpm
+SIpaDpiqIgaKCvR2Kay8yvX71yXo0/Gv17u53za5vrs23tqEsMAaK7Q02r1zhwuVNNjTn1PG7yHOwL
+tEfZJw8tcbOtSXqnRFXLj7DKFQci5Bdu4ZdP4k+/yKbS0ssrQzeevyuE289fueJD/VW+sO1Bx75tWM
+nT/2L7Mzp32RlDYwF63DG4Iw9KPLHkQYy0jrkD2NEE6i2Vb1N6wDIGvZVW/85A8juAJ0hqfgFH+Ny0
+v6PO7fX2HmprasdXbMz+W5zXwIiAak3CbGkVNPtuqWPkS//B8T8K649Qf5U7L6vBg+vlKR0f5onOto
+W66vZmV7281oB3QM1LkkTMjWfbnwwbT/7nlC8QF5vYutJo4a2XiJVIRIQmWNqgxQd/NjQc6dYvvdtf
+597/tJP0HuAQrt4m2GBjERGQmJqYxWhk9mWRVQSBm8EPbKhxnbBWtXGPk2KpECal1RlSe+ZC4ONF59
+//+aFp98737j6qJsWZPM5bjpjuZiT+Rok0h9uszyZ0pmUKCVaFxSzEWa0RVVPIFWkOMeIkpnIshVWj
+GBnE2zWxboMZjPme5a94TbF1Rewzq25Zy587513n/3eex58+KnVc/f8EsdPfJyllRm9JXAGZ8CKaWy
+/g4Brc0TNrg9tWFw7n47U0r/Slg5tNJQMslWsnqIO+hPR908489SHNNaEUGJjxHiL+D7UDfhSmhFkQ
+qljqrhLVUbUr7ynt3L8g3TXPnYrhv6l7L8/TcB9JSLmK61ZERE9fENPmgMVr9jV8Oe1W7yikWqQHFV
+DbON3vff3TabDn6z3rrAUx0icIqGEOrZrRA4CSUJdYKocKTNc1aEzOP2rnH3zh1l/CFgi5IelBM1Bn
+ficI+Kuec3YFvjtxn1EUcuATJqQMMqaajRmtLGxMtkd/kD1yT/44Gjj6nKxcY1+PWcZGJQVrvBk85o
+uiUkxwQ3HdMuKbmqOlwOZgLWCMeB9RZgMkQRdJ3TEYuaBPIMlY1jPM1Z6A/KOJe900JiIoaS4fp1r4
+zGTzZ1Hj794+aMnH3jkI8fuf/BjnHAfpefGGHNY0u9A05BDt4Np07hkP5nWNoqpHrg3CandfCwgPch
+Wcd7ja/fhFPRcivVfTfUEao+pM1xtMFUO0VCUFTUTStnCG4iaKKcnOBUe/Mn8xH2/Dlz6arrkyks3C
+UhH1m9HRPbz1dZEZNZO8TERWQMuA7mqPqSqQVU3gHuBu4wxW+3xHgeSqu4A94vIOeAZ4F8BTzXcfDB
+9iaIk5tLk3giaFCeNgh9KxMQmUxPYMeGgO52haRuV7cdNaLsDxcP5kXaBHmiLDcF3JLjpkF1LNz2+l
+bY5dT2WrCEHuuUYW41h5+kf8xc/mevms6juMPVzbL/LbDRkdWUZrSMSPC4lOuEBtvdKtuou6w9+w2f
+v/Pr3fA8n7yfhCVlFB0enVaYEiEZucHd5tP3VYFKiiyG0wcwekKgsKZi6hs3r8NyzuMvPfdhcufTfh
+Ssvrg2KbU7UEHYnyLiiqxmxKvGxxvU6bO/uIcYy3J1TxUYF7HYGhAxkxeHSEK3HGFUGa2cotrcYT3M
+GuaUT5tRqCHUkD4HV6OnOazq1xznX9Fxfyumh2Osj4m5BcfH6sr3/0t9ZfeSRD3Dv6b/HXad+in6Xm
+TFEDF3pNo5t38xKMA3pYWj7zRMRIN/v856aKAfV1IRtsgRmmdQ9g5qa8rnf+p6Ujj8ymY3fsLm9waD
+XJTeGrRcvMBCHqQJhpiR/Apd3yQZLXJt+hs215/O3nH/+x6aD7/7PnTEYYzoGU7VOmxzVgaruNQSuv
+SdBGVLYxshZhzsJbHpiqsget41M34B4nyBnLGwJ0aZUvz4zRGLcc3C/GLmLFDeoqi4hfh1QlfnWrkl
+6j/PhjPH+ReY+ow4PoBIxnU0/nJ6oxA0KsbO57SRZXV9eO3MWZOkLFenasShBRHBN3TbuxfJXCOmhe
+lK8kCRdNJbjucNA/Bz4RMedoI7XmIyfO35icAqs06TPpCC1VXc3JgzB7aImQ+yAyLDhoLUDVC7UjY5
+oxGCzdFCcsa15KSJou9Ua85Uj153N0JiQELC2C+Od77hy4ep3b17axPmKoIlMG1KyLjsMQ6AsC7Lco
+GJIwTMsEv0Td3HnPQ+/l8FagVpM1m0Dec0BvX60n9GhVLOkFKk1YK29octcjtK1ApMZYeM64y899eT
+u5z/7P8Rrl5/ozEbEYooNNeoTqYqkOpJiatVnS/IROl08Qr6ySpzMmAOTqqCbIikFOp2MTsciLhHFo
+5LwyVPWkb4Gsu4ynW63KSPhGqlknSXLWqYwyxCbgRFCiISiwF/bZmazNR2OPnpHFf+L/K6T/+1gde0
+3yZoolBgb+87YW/Wbb6+SafuqmUZsitjW4dIGutqmH3zgdPH5L372vdvb258cj4eUxRT1gfloSCoq4
+rTCNoQoSQXJOkyqimMnT5Fl93z3I39lXnT6/UhmniPEjKRvwNqalPaoyvuAu3HuslFyF/zjpDTHmG1
+SOi11fVdP9Wq79k7XdUUK9V4KfjWG2sTgVVVDDHUmMYCGqD5YXzZpW6rKXrhOMZ3h56WapMdS5ZmOZ
+0wmU3zg3sIntouSwuSDux5+HW/8xm8ql1ZO/EZ/dfmjFvf7+6qTCz7hjA0YlqpUfevGePN1v//7v0t
+ZTCYrvdycOrYyyJOfGV9tHVvqn7xjbd3ygr9gjPFG3FkVc0Vs53nT6R0jH3Sw7vMELcGcwtprOHcRY
+9ZRtaj+ESIRl5/AmCtgLqHplAHBuc+Jyw1GTjIbb2Lci1hzByJdMM+3qFzHmFnecTVFaBLs5tPq4qe
+++JHf/de/zXTzixwbVOQyoyORfidnHxp1rDl2bA0xifFsgnTXeOz0o+/n3td/iv7xJv7QdJA2/lKOE
+A2N3RMPOtCikLB4E4kHCZ+JTBM2CTocM3rxMnuXLv703jNP/e3Js1+iu7vNegwMFOaxRH0T+WJtjg8
+BtRlJEsO6IACzsmQkym5o+ujWAqbTZHGrlKjU+FDgfYlYxWWCNYY86xCtEl3TOdCnSMdYTJaTd7qIQ
+rSdRiUxGc5ajOsgAdJuga+Umek/Yefyf7q77c+wsvL90usgInjTBGwfePn0JjNlP33qSHaFtBRNg8n
+/n7k3DbYsLet8f++whj2decw5a8ya54GiKCiGy9iIeJ3AFrBDxBuBjY3YHd1BBNGhtqKCVyIE2w4pR
+em4tnJF7QtGKyiFRQ1Q85BT5XTy5Dl55n32tNZ6p/thrX3yZIFfbDvo+lJVmZVZO9dez/s+z//5D4p
+IBhozr6L/7c1vP/rYsZ89eeLYZ7vbbYIpML1A5EtuQVTtc60tDdSsg5HxjKz7LMI98lOjo6M00hrOF
+igPSRQHEZzI+wNsnoVYRzcqITCmwBlLCOGg9x7rClpZb48QAZzH2BxnzLjzecnxtVZ4m0WuyEtjZGe
+UNwVFUewUHyLHGUev1xVb3R6Z92Qe1rt9lre7FHHKzOGr2XfkCq49fM3Rq/dd+btj6dgfEcQagK+el
+w5BeCfCcSnFr5iIv3Gp/Nhm1n7Hdx5/uLVw7CVaEiYT3WgF0ZhIE8YbDeZ1uD5NU5K0HmSkJ5SObkr
+qDRrNEeKkdkdpAy6dkpGK45hIxUYIpaWUQkrpXXOiLaUcr76iC0Jp4ijdoyK9JIS6gFRTUquaUPHzC
+FUg2AfqPEqdRspxW1OxQj0rVN30Fxd/+cRjL7H4/CL9rS3W2Mb0V1EyoIQkjlOEVOhYMz4lsd7QTR2
+33HnrH4/uv+VzNOdBjoBPL6PsDmPExM4iePi2lTsDGZdyl4KCgCfBorICujnrz710++rpU7+7dX7hT
+tobNK2hiaRlPEme47XG5AZvJcZKusbjRSAjsNrLaI6NsrzdZ90Flo0hB0KiQQaMzUvwxQ/Iiw4u2wQ
+PA2vZdgHhAgfmZhG1BNFMkTouS0BHFD7graMWSlqAlBod19H1BrLWRKkU52LUagfHKmrgPiJm8/vZM
+/MzshU/GYSgAJLqEBqCGyUN9PIkJMTuG7JESX0IZVczdgOHr8swf/vS55567rH77aB4r3BQBKhzyfJ
+iSJ9vRnV0UOQXJC88sQorf8xIs0WjlqKlItWKZpwKFTy+yBlrNEWqVZmQaw3B2WpPWyJIPlsr52YR8
+N4SfKmDFMKhgkW6HOEtwReltX1wRK40HPbekm4VZM5AYbBFRmYsfR8wSpEkCQeuvY4H3/mDxc33Pfj
+fmZz+JLXRRxEaslDupnQ5muko0riKmyhT/fjo7MTPvvEdb/qHgwenf+bbf//1I8ce/Rar58+i4xpFr
+cb68hL1rI1vtQjNhpC63ABlSYxptEjqtdLXMihFkEgZoYSOyn9WKBVJ35gcF1WYYgjsCUIhVQTIeR/
+EvPG+5CYq/XqPJARCQN4ohEBKGfKJpnCFfzdW011rs/jyacIGuC3F+nqXZnMECBTGImSMFQERSc4ub
+ZKZnMl7r7w4de29H5EHbgBXA1GHSFO4EiIXQ3uTcGmlcRmI5i79u8WW2y1vsReX6J84+xObzx/7/GB
+xUdPeoOYtaZ6T5gW6nyH7A/JIk2cOKSKciihSTRFFdDCsqR5nN7dYaW/TMZaztmANGODoFQOCy8t5W
+wyItNsR8jdHWjQD0O5ybnOdVDgSKSjqDaaSOjJOGEnqJErRiJt4qRAiBhUjiBBOIgpB7ANprFBtgwv
+bBC/u1JF+DDX+AVHXf6SE+se2r5ev0XaSoAShCuUU1crGOMWBa2/njle/iaeePfGR488//0YT8lkP9
+BDEOi5vcRWhnYS4UTF3HFknsH5umbZcpZ7GjNabjKQ1CiVJpCAm0FFtrJLESiC9QwZf3fCqnHllmyB
+FSQn0BQSLV6VjOcGQ5Z2y6ERFIJCOEALO5BhnmcwU/U4Hgiet1ZAqkDlDfW6ewzfczL1vffvTh2+/9
+z8zOfeHWNHbATiUqDSK5cGkh7YYttJXp1FtTc9M/tb0/a969PqDe3/xxcMH3/7M178ed86dI/WBuk6
+p56vUQ04jSKQD7y2R0NRUThISIh1jfSB4RRAaQlxaqcsYJSP6WwOElAhRra2FREiN9RLrPEJEOCHxT
+uACWI+wLuB9IIQgtluaYhDAxQiriLswJiap1SStmREGRRfjyodWBEXfFJjc0+5vMT41w76bH/jYnhv
+uW6M1j80kUuoStQwVMUVUKGfYDfVcGl3QQ1JvICIQY2Frg/bJY/9+7Ylnf9ktrZBsbJEUBZG3+O42R
+a9P6ktl+GDgsSjQMSaKWA+WC9ttzm6us7i5wUp/q1Qf1Jv0k5ioFtMaqaG1pNlImRyt0WsnjDajSnY
+OQQaS5gjWONCKdec5enGJJRkxGafsG5/k4Px+picmGScpleEyAZXiZYStDhgZFErFEJVkNz8wmI22R
+okvqMnWgbhV/5VhV7mDGsrvxRCRVcBJRT8rY5OQUtLXnlpS574HH+Dc2dNri+fOfuziRv6HzTSlk2U
+MQo4WEc0oKm+ioo8WnoZQ1KVkc6MDwVFPUtyIxSR9YgENJWhEGpWm5Q2HRxGIZCjzFSMNkSSvuTIqM
+Bh8MCjp0TgEFu8zorreIS2GapfssFgFRW5YMV36iWfLedZsh2xsgsNHjnDo3vv8/I23f3nP7Xd+kqj
+5eGa99zoi0RWKUIVjiZ22cxch1VftQUyKSMKje/bu/5fzb3nLT16/7+AHTzzx+K3nXzjG5vIyjZkx4
+jghisseXgtNLZLUIkkiA/3+JsILPBohI7xISmsHYUBHNAa2/IKkqiDsCCk11guMBYSlsJA7CM6DlwQ
+fsMZgrGN7JUfJFFdEmEJS5I5+v0fhCmScsr3ZpT3IcTomE9DJAoVw5D7mrlvv//M7HnzbFxpzh0HW8
+VEJBLwyoy9Q5thdgl7lkMS4o/FUeOI8I1tdYvvYS7+x+fSzHzWnz9Bs99HdjMg5grPkvT7O5uRa4YU
+k0zUGzrHZ67JuLBezgjOdLdbyHJOm7D1yN5PTU4xOTy7oVv3RIo2evlh0jy52239W1xJfdAi2TxpBs
+yYIkeZNb3nzHW978I2H6qgj3cWlW+3m5r356tr+fGWVfL3NxSzHdtps6YjECXRaI1UpkYiRKiFEETK
+pIdMaQSlEpCFKStex3BM6GUrrXxYqniDSv7CL6LlzKA278/LlEpdZQ4UQSo1HKMkIBsPcgTne+JY38
+OzTT3zhq1/563fnPnuXoVxTBGtAeyIHkbUEGYhI0DbDGEUaJ8Q6KWdY5xFSILRESolUIIJDCI+S1d5
+SuYqSKPBBE4IjeIFElmEwFXBmiSgGHZywWG+w3uBF6bmTmYIsy7gQOXwck8cJjE9w4IabueaBB5/Yd
+8sdnxNTc1+0spkNkLgoIqZW6ksDeOOJlKRSfJVLdgUkaCy2rHBvSaVG1kZ6RPXf3Xfn2FN7Zvf94qk
+Dz/7A0Wefl/n5fyh9J4MnDo7WUOLvLN4UNKMIHASh8SrCCYVBlR9CBlpxWXTOhfKGDKakJTuBM5X63
+AaC8eAFIiiEC4TC4KwhjQ1xlLDZ6dJez0DEOAKdXkbP9vCJpp05Qk2QIdiyYLSkMT7FHQ++/uNX3XQ
+bVicQJHJXhJz6Hq1UEENx6qXK7HiIBSTBItvbrL700m8vPvrYh83p00z0C2r9gribo205RQovGKiIL
+RzbRYctH7Pe73FqbZWVIseNjhIfPsid1x7h2ltufvi6W27+8+nZ2a/Wm/UX09E6XTPgO0ef5Utf+Qt
+st0NzrlHKdFxB0S/9XGZnZ5981WsffHJ+fIoUgW1vUWy2r+8sr7xl8cTJd507euI13fUt+kJy5uVNa
+i3DRJrScqArNb0TEqEjBiIQi4ASAa80SqqSydC3EHofZWY0RvBzO7jK7uy/nZtuF/F6SLnaxQ91BJI
+o5qZbb+Ud73gnR1889vGjZ868S2jQGrIccuOIiEijmKaskRZAL0fZhGYSM5Y0SQTEzpNqTUPHpBKiA
+FEoV0WR8MRaVvYWrvxgeUzwgeBceSPHlO+B92ALalGK9wWFFxgv8KqMW5PaoKKE9cMNNvoDRuf2cc+
+b3uyveNVr/oqpuU8SNx51suUMcUVEjMpLLQhSASKSVcb4TvGVT0xVaJSvAPbSc8OXfg210Uflodp7r
+mpNvmf6yE0fWnwqvuvCmTNsLS8zJkEnMSFclcyBAAAgAElEQVTLsL0+0gZM3qdZaxAlKbkXFMZhRAC
+VlL22KZBSo2QJa1hX0rAioYgSTadr0FJTjyIy68kLj7UWUxQUucGYrDQosim1KKaXOTJbYELACMHFr
+XVcFBO0ZBA8F/0WI40Jbnngnl+/6f67nk/qjYoU5odr9J3TCMA6uyNIdVTzZygTgbQqldwaT1jZYOm
+xp39j8fFHP+wvnGckK9D9Ab3VDUaiJqGXM8hy9GiTrrCc7G3S1YEzFxZZbm/QlZLpI1dz0wMPdG589
+X2fO3Dt9Q+Nzcy8mDSaCCUr4qgh8QkTUxOM1uvEiUb7jEYsqxcFigzStE69OUrcGsEai05T9NTsi/X
+DV744e/Mtn7pldeP6pbML71+/uPKhTfdY69zSRZYvXmB/HDEmFKmIUPWy+SJK6HqHDh4pBdp54qKag
+YKhaHc/HCdJQRL9wk7xKS6pJLh0Iw6LUEu98wNWSFLKApDUec39b+Q7jz/3/KmHfv/XpdIfa2d9lNB
+oH1OTCZFPCIUiISEmpk5M2veksWeknqJxJLmgJgOJD0R4arEm1WXBae/RIpRWi9ZTeEG9lmC9RcvAe
+KOOsz16nQFRBKY3KLkDwWOtY+B9+d4KSQgxq/UJrr/nJnfLPa9+bOzKI7/D2NQfE9eBhKIIECuScgt
+caktDxf99hSxGD+OCGQYoBlWuz+UwRSZCqABRPSOp/0FzbOrYdRNv+8XaiePvOP/iC9KtrjHIcoTto
+5IYKS2pLpEll5fCTSUjUp1gpMQNeUcyVK0u2ODYmenKFMeKKlQJVqUoX0atEM4TnMd7S5Zn9AeBTmY
+ZeEPH9en6LlEzpe8K2v1NehI26XBw39Xb9735Nb8yd/Veimo1IIYeyhVdYJiYIxW74qKjHacFKirbw
+HeJs4L+saP/fvU7T39UnlqikXXR+QDyjGa9xvb6Nk2RktZHOLvd4RR9ToQBR5dXaK+nXHPzDbz29a/
+tXH//q351/w03/Nb4/n19kTbKT1Be+JW7Q0A4i9aaWEMqBc2aJlGgnEFVB0KsYhCKzCt0VHYZKqpSe
+NM6amz8xX1zc7840+l+ws7v/8j5k6f/3eLL51rrW336W1tMeolIGihlGBlPCHGMiyK8kGUQSoCosJB
+bQipBqI8SRRvAr+y0nvry9WwQl9Y1lxGaK2ArVgJRi9k7fwWvuvd1PPf8sV958fixnwkuHXHWoq1Ai
+5iEGk2Z0hApTRXTKhyicCR9y0gtRgqHNAVaOVIRkXhB7MqbO9YSrQRxJAjBYYVHxR6hS82jMTndgUE
+Fg0wEUZqgRESn36FvHCaKsUAePGmzxfjEOG94948yv2fvX7b2H/oUrfFHEUnJPxIJtUgRnLwkLduxC
+AmXuHpVBZZYZZCXhh5BOShXg6YVpf+WlgJU5Ega/yDGrv+Bw+N73zsxc/j/Wj1+9J7OyVOqXywhVEQ
+kIA5lgQgf0D6UPpBClR6a3uOjMo65TPvxGFdasgt0RU0yeCkonMdYT+HBBI/Fl6RmKTAOCmPoG0dmD
+T1XMGDAIOTkHtqmz4Yt8HGM1hFH7rz+k69+06u3ZCuqhuuww2AZvhFDAEEisZVbyHC5LocKoQCxGTB
+YvPATq8+98MvF8ZcZ2dqm5gryojwxe6aMZu52MgwFy8Hz3OYqz9otsskmDzzwDu5+8LWfufuNr/1E4
+9D+DZIYh8IBxcCSpro8lHxVfKJ0ftaA8oY4glhZlLQlCQmIVUmKhhKy95XaQgZBrASRkjA+Rjw21o8
+nx3/lmmsOf6750sufWHz22Ic3Tl+gv7aKCZJ9I1dgjcdpXybOWtBG4rWqZjGHGOR4IZFS/TJJdA4p/
+qiyGi0d1v4xMnz1fOtyV0F6UKnmjjvu4DUvPbC1cPb8J8n5JYGn5iUTKmUkJNRDTCOuMZo2GJEGYww
+1nVKPEmSwWGfBC5SQKCkJwVZc3kp1HwTOB4x1GJmjQ4SKSx1oVhSlhSGObOBRaUxPeXpBkEkwKqI+O
+cGBI9ebuWuPPMLdD36GevPPiNLKHEpWORWVT6m8dPiEnUWx37WOkbuI1eEVJ1P1tg2Nd1xlShQA7z1
+NX0eON/5ktDZ1brQ18282GnPv2mqeIDt/ns2NDQpnGU01dR2TBo8xhtxYNIFIKbyUeAc2WGwozWFLj
+01QWmMHBdYV5CaQm0BmPcYHcmvJTY7XksJb+tYxcJ5BMGTSkGMx0tHOe3R8To7DC8HeK/Zv3XbvHZ+
+ePTDPoOgRx+muE9nvMqy87Ecr0VKl7fKgREA4T7yxdvu5p57+fOelo0xkBeNFwPZ6ZH6ASWNWum1at
+Ql6ec7KZo9zZsDLuSW96mrueevrn/uJd/yrj8wd2v81OTeBVYGezdE6IUJSS0rGX6hWil6UWsWyQzE
+IFzDBIGTJ4dSq7AZV8ERCElVroyFGVCUPwrC1doGiIUnSqY35RuPnJmZm//z8M8d/6+UnX7hpNeszZ
+sqViNIS6SKcDdjc4JQijkvGjM4KnChRarz9PLX4RSL95BB0eSU3MFQD4fDdU0LgnccF0EJAJLjimkO
+85jWv4qknHv30M99+8hdSGY2NpTXGRY16EVC5QQZLFElCocsxKYkujVBKIOME4qgiwEqc9DtKe+Md3
+nu8EMTelI4GMiBDgfWDkoMqAwNTYHNLoSOyWDHQmtbefVx9y+3M3H7HV9i3/zdpzT2KrjaRjtImvAo
+cDVXtuF2+POEVUpx0p+3cbQ8gLqFWvvryA1wW4iSlwPo6cZCGuPYwe656eGJ05ocm9h/68Mpzz9538
+djRqNfZIgSPEYLUlbptCUhX0sh6Rcn7FxXxWHqFcyWB1psCpUTZngaH8wYfwHmHcxbvCzo5dAcF2wN
+HpwgMgicXhlwYCixWOTwO6z3G5Ry58chnbr3j1r4Qcif55zIj2WFfOUQLRDXzivJze2dLNXjw2H6X9
+lPP/u7y49/WyZkF6gMHm1vYvAuxYLXYpi0lq2bAQAleLnqc2t5m9u7beN37fvT3rnvg3g/tmbnekyq
+8khg8Wqc7i+UhP3Z403qhEGiiSBGpsrgKv4mMLGlNksSQZUCRI60lGn53cpe6YvjHLOcKnIzJVSCdi
+EibI1+7amru1nR0/HOnXzrx0+fbm4zIQCPWNBp1IhlhAtjcErxAxxGJc5Dn5cEgUk2sfxe4i8qx0Iv
+wXQqPIRpTjoeGgEUqXa48coeoaw4d3suRa6/qXzh+4jNy4D5ed566dCS+XIYZk5ObjCIzJEmEEYHtr
+I93BbVU04g1XitCVD5bpQJBeIpQgHMopVBRTNPn5PkAby2I8rvVWuJLoxiKADaqU5uYYHb/oezALbd
+8s3HT7Z9hcuovEIJyviv/TEHLnRHJDf1x5OWrYf/dLQBDPchug/+y7dTDX+SrGVGidnk7ep1UDzUgE
+glx9Jek6epUEn1Uz068c+3kSQbrF+lurJMUBU0FKaXnii0yrBXlg5AKrUuU1BmPMRneFyRpnWA9prJ
+EF2HYJjokju2BKYsv92ROYISgCI6cghzDwGYYAkJJWqOj3HXXPZ+94vA1BASxqjGM4RBhF0S3CzuXF
+YtfVYZMerg07ndZO3f605uPP3WnWrhA2uliO33c5lZF/VJs9npsNxssZT1eOr/CSi/nyL2v5p0/9VM
+fvfOtb/hUfXYajMKJco4IojSgsN6g8gJFBDJCiPJWs0N9mhRILdBSIBOPrgmiNBApyAVIb5DOgC1n2
+FAFyVo8zjtE5Q0hdqhzGqtduejdO+73xbd90I42j144cfY3V7e7DLoKF2laYhQda6zz+OBA6PImDhY
+bAkoIVKTvJIk/jeTnv+vWC+VkP+w6Q/XeREpirUXqmCIYkiCZ37uH++66h1Pffv6z3cW1j7utLkJ4E
+hUTSY1UEVYIamlCVIsRkabwFm8NkRdVEI5ByUCkS/K7FKG8jV35AZRSYCTClN6sURwhYkXhDZ1+Tl8
+qXKNOc89B9t12O5O33/kVDh7+NPXWY2UvL3Gu7IZKFUcJxiBFNaeHXQYiofIdF99TKqB34Jfhzwu/Q
++AIuMrc1SJDQFYWc0bWKuMgURJ0nStULf6GPLD3GxNzY++Mplof3j5z6v7Nl0+lZn2VojBl22AcPli
+ULjmXIZSkYudc6RcpBFIFgrcI5/G2wJoM5xzBBbyxOFvQyx29PGdgAhaFkYo8WAahoOf69MkpkFgvO
+TS/9/evufrIktYxphgGOsqSElWZ+Ow8mF1tJ/7SjFdadDnaS4tvfv7bT3xk/OQZJnJHnBe47S6xD7j
+CsJF36eE4s7nBmcJyMu9z+PbbeOfPfvC9973pLV9U9WY5I8iKSSOGiKsnFpIo1mDkzm5ReHDK4LF4X
+4as6DiiPpqwvd0F4fABIgX1pARhcIY4jncZB5cvRrTL8kIZj44CQSr60oIP1OZazEZHPhWNjy6fee7
+4H2edPpsbW4ggaDabJejlAKGxwZQng1dY4VDKk+jwERq1r5LovxY7raffMQpmt++JVwgpKUwfqSTIF
+GOAEDE9MUci60uW2u8bb3+qplISUUNpiJKUen2M0bT8vSOp0FLiCKV8y/kK8fEEawlWoqPSXMuZQLA
+WZ6AXwAuNI+CERuuY7QIGkSKZnmLq6qsHk9de+3D9jrs+zd4DXyVOGSDpywiJZrxCAkP16vjd7bW4t
+JiSiFewpORlKlp9mUF/lZFty3sDWUZIVhbml2aj4a55KP9RKsYjiLVEJOKrrRuObDYb8c8nmh/Mzml
+YWydstQkGIjTaxWUmXV5QFAZrLCpExHFEpFO2tvsUhSUfZBRZjnEe4z3WOIwpyEwgN5aCgKXcFRYYM
+nIysp2Tp4+lXm9+IU1rdLa2GZ+eKjV41aPyQZWOmsN2c7cL1hCccq5k95qMtQsX/tNLzz3Nvett6kp
+hsgxX5CRpwtLWOgtbK/SmRljudTi+bZm/7Tp++EM//UN3v/ENX9Kt0UtpQOHybCKNJBaU7GF3yftly
+C0NovTlFFoRx5q4FiNUILcDnC/3YrUkRkVx5e1XHjKqaj3V8H/sPThPolKwDqcVSmuGQWvxbJ1xsfe
+Lzvhs7eTCn/UurjPo9kikRkW63I0pRW4zdBpXyU4KIwIukiSR+k8qkn8t1NB24pK4tZQeVc/WCIgkU
+qQYK9nu9Dl/6hwLR0/x2Fe+Nr292fs//cD/VEKdWNXASaxzyDQhrY8SD3rkgz4+BKJ6Sk3rcp8nNQ2
+tkMGhnCSSksiXgiMTFCE3YApMM8F5QzfLwDkSrTA6pjU3w6HbbqTxqvu/wp49n2Zs8nFURBtJLmsMg
+AwYt0NEvjrMhC9HJkLl0you8cu9vDT4+Uuo8PB7v2ypLIBkSBj8R+h7tpLaaGS5wwiyMrJN8LJZWGE
+f5oqZh5uzN75FLV38+Y1jJ1+zeezlmlvZQFnLjc+9TKgn9Gopg7SgW7Nli+kFsTF4Z1CFoDaIKPrQR
+9KNIja0YxtHMThJYQu8gjxWbHjDVihoY2hbT88DkSLoJt88efJvLvzHT37lvte+5aH7X/PGvzp0+Kp
+8vtVlz8wkcSoIhUV4Vy5dhMLLCEO1yxMgXcn9C+dO/cLZR/72ttb6ecZWF2jUWyxsroGucS5zbMcTL
+DTrHF/vcizXTF5zAz/y0z/33vvf8q4vqZExXCX2UwGyaGvHvzoiQdIsB/WozJgsDXAtEo0mRRpPLUh
+qaZ+QrNLoDEh7OSNyjCLvEEdj9PQMfRGTJgEhsqExYKW6jKpTNxqGV5QAVxWmOYTDPZBMpMzcePWXO
+iq8d00Uf2ysw8cFdRlKoKJf0GKblhwtV0kOokaDYiNHNPPbOHzgF5D8hiJAQ4Hw9Is+cT3FESjI6Xe
+atDsZy+sXWVg8x8mTJ/Y8//RTP3r06ed+cv302VvrxnPt9F4iI8m2+sQqoqU0jWCo5X0W4i5JBKMom
+jhaARpB0rSCNJLk3hBisMrhKBDOoPBEKhBLyfb2RWwcYeoRvVYTuX+e5jVX9mq33Pz3+vqbPuXHx/7
+WqKhSbSpqQtCoDhGFKPMy2C06lyXK+r3qRf4vMFDa6VLFrnt3F7qjdETUbH0t3au641H68716892Lz
+x9j6cwZzMwoubAYEZAioHND0R1grCcScRkSqSV5bOnnnn5e0CsyBtaSFzmFMRgcJihyZxmYnH7IyHA
+4IIkkPevwto/JnHrumWfesd3z71i+uMGhw1f9j/Hx+KGD++a+fOXB/b0D81PMTo6iRelPGyqvWudKe
+RpIWNsYefnFF//D+sJ5+hubbNqCXtZjzfTxhSFHs4Vkqb3Kqhuga01e++YHP3rXfXd+sTGSoqLyFho
+iH4KkojL4Sox8qW+RogJMqmyHshFO0aqGVnW0Aik3gT4+DEpARTmCLzA2J/aq8k8Rl+CWoC/np6piV
+2P03byeNIWrrrrqiyNxMrf88unf3G63CTpCpTUIhl6vQKkC4wP9Isd3+6XaIW+xZ6z5Hxhp/Gdq8fa
+QvSDjBlvdAaub6ywuLXHieMHyysWD5y8svGd9a/0nep3t6zeWl1lv9+j0DY2ojgoRtaRGXIuoW0Ejx
+DRkgio0iS/1mlJ6nHRkyNLzpdreogQhlLxMjUTrGOkNWEtuDIyM0LcFPQSN6Wmuvvte5m6/9a+Yn/t
+tRka/7aXaSdQQQlUd4P+85eA/S/Hp6mOo4QS9y/lYiHLnEfB4pQtZq32TvfPfbDQbbzicpv9GjzZfe
+/7JbzUGnQF+UFCTklrQKKvKwBEV2BoMMGi60tKWBd1gyK2HrJwdCxlwXhC0xIlAESwZbgd2zm354IW
+U6KRGXKvTrNeQItDe2HjT8RX1piePr1DXz39j79TIQ1cfPvClwwfm2wcO7GPPngamKjypyiX70umzH
+3vsG98cW3jpGHZ7i0VnYFDQVeC8xUURG3nBBdel0Jrr7rrx9970L/6PTx268RqsKOU2oZp7yvarhqx
+sisSQWLor7EUKv0OGEL7S/YUU6RsoL4hTQ5wURFFGnEJaEyhtCcEipdgxtRVVyAjD2WPn5MyGE8nO6
+R6ErhJgS5g8GZHM7pn+lOm1j6yY/k9ngwzXGyB8YIYWg1xQGMtmv8fWoMfmYJuQRiy018bueu39H5M
+y+fjK6hZbvYyVrU1OnllgYWn56jPnzr63Z/a+N7f5VYiI2vh+0pEcHxLWVzp4sYV1EYVVJHGd0Vqdt
+O9peEVLJtSKiHEUUkoSytnRKUmmAjJSeFmyFIQrXQucKhOelCj3N0EIVqRk7MBBZg7u783fcN3fNW6
+/7dfZv/fv0XGJhleO38Ojr5Ix7hAIwvez+Ia2eWJ3XJO4JMUJDHeDpd1eIj2Mth6OrrtmcMWe2c7Ku
+P/RlTMLbJ04i11t0xhYdAaiACMKullOHjm2hWdbFPQpysAOa4itwWqBEVCIQIEnrzxUdtmrVCOcwAw
+GeBIatYTZiQlGxiZoNG8g67Zpry0/cGqh88D62qnfP3ps6bHx8RN/MDU9/t8OHZhbG2ulzI/UaYZB4
+4knX/jX33z8SczqBZQ15L5yP9MxwQvyvMfi5hbLwJ6r9j/31h/7oQ9dcdMRgixDtSQO43IiNEpopCj
+DkeXueLBdaLMSnhBM1S4ObQk1wkUEG5PGhiQ2aF2QJFCvS5IIlHAVxStUFILSRPiyutu13S7/G7cjB
+g4IvBDoWIGFuBWz79DeDwlv7l04fuamTq9PGicsbbYRGx16eY/17gar3XWWtlbp+Iz0+Cgn2yv/ujU
+986tnL6z22n17w3Zm/+X6eu/HVVI/UJgR6hP7acjS38X5jPXVRVa3umxs9xg4S4ak188IqaKW1onzD
+JV7oqDRSjMWRdX2WiGjCBJJUIJcljtQiox6JEmiMhOjbzJcsIhIoiKNP7CHvXfewewdd36Z/Xs/Q6v
+xHYQEF7BSlmLNIeGimv3F7iFdfB+Lb+hfuds0dvcH8jtlGRG0xOOQRVFQTx4hnXlk5g33f7Z2auFjS
+XP0dZtPH20Mzq2QVC+OwxOkJJeBgXP0Q0HXZaXhrTHYYMgU9KyhXxT0RCDDVlkJ5YLZhdLuQMcxuSm
+t17c3N9jaWKeWJAzyjEbSojVVQ9oBSgac7d+ztNS559z51d959PGnnhodrf3heE3/Pw1RvPelxx9tP
+XdqCd3v4vMes2mEzQtGR0fBCzpZn5XMMLVnmrvf9taPvPrtb/PJ1Dg9a9C6thPWqVS0wzIqCfbye/T
+yHsiro6sA4urULW/NcoYboJRBi6LM5o1A6aFr9CvM/sTlXqdlJTZ3LZJ8dXQNvU9D5b8dEFFEPFb3j
+dGxj3gd/e1WzyB7jni9YHvQYWVzhdXeKhuDLdYGm3RdhktiXri42Jrad7C72S2WonR8fmRkDp1OMju
+zD9Bs2IQ8H9DpbLK5scy5c8c5f+YUnc4WUsB2aLM90BRhCpHUEap0IsidIE4EDSJcGHrrSNAR6IBxh
+pAbkgBaxeg4wYaCbihwUUx9coT65Hj30Nvf8HezV13xa+w/8E3SuFy1VWwuVBXeMgyX8t+DhKK+j8W
+3U/yvFJuKS21pDpgqe7VAIGOBkIZISKxoPdI4fMUv7Ze1drM2+p6t5gn6Z5cYrKzR6/UYCInxUBSGL
+DfkpsA7h8XgsPSFpBMK+nj6oQwo2Z3EQ+U5Yge9yrouZmnxHNZ4Zmb2MDmT4MfGaTVToliSpglWxRi
+ZYAK0B93b2oPt207b/qdD1qHbCfjpq+i2N+isr9KxA7quoNUuVzCZtwShefX9D37mwR/8sa+N7jlAo
+cvtaJlcDtFw82ov6QEvfWK96/AqsccgKsRZlsigji1RYlGJQyJIdFQaIklLEmuSeOguuptZcinJ1Q+
+PAOHB65KzuSNZlEBR2dh7HA6PR3uHiGvM7N/7tX7PfGZpZfPDLzz7EubiKpvtTTb7m+TC4FIQTU1ja
+hLVbFAfn6Q2MY5qRfON5gyNxgzOxOSZZ21thbX2NlvtDdbWl9jcWmZtbQGzdgGybXyw1HTM+HyT+nR
+CcI4iLlCRwQoFqSh9aaTYSRKVPiBdifIGF0jjlBAEnTxnIC22VWfk4BwHbr6G+cMH/zS+587foTXyF
+FqXaySlsKoE2iSXi6hF+F+XCPhPKr5hVK8YBi76sLN/kG4YKlruV4oqxDIiQmpVtYdNI0cbj6ZXjz4
+6Pzb72dG5/f924cnnX7f6zPPNjYXzmFDuzYrc43JbriUEmEgw8NDH0cfRw5GhyAjlMlqU/J7Z+Wmmp
+ma+luXm9ReX1xlkjvbmKu2NDc6efpnxkQ5jI03Gx8eZnZ1lZn6OWrNBiGNarRbpSJPcW/J8QNZtMzq
+1h/1X3sz6hUV67S3WF49iLq6w5gy2yHFopqenOodvv+8TM1deR89FeClLVkxF89A7ySRcXmhi11ch2
+GmgQ3XzhaEZr+4TdB90j0jFNGp10jhBS0sUlfYFWqvv8V0NjW5LHqPE4UPzslM0EHHJe82WDasOl1y
+jmoL6RPSJQnXff271ROv0C89TeEfaqtGaHqMxOUJrZoKxuRnikRGCroFISVyMtbC+tkKv41ld2uT8+
+UWK7jprG6usbyxBvlUC+DXB7IEx5qcmeM2tt27ftO+K/3cklw8tPXPi79r99rJ2zA7jybJQtsZKCax
+z+J5BKkEsA4oIGSS5s7hEE81NM3vtoe78bdd+ffbGa36N+Zl/IB2BuHzeXmg8ijx4nCvpj1oMxyouy
+6T436L4dkaUncK7/Ea0hSOOy+bUIHDBVQi3onCGhqpRmAKlJGrf3kfrU1P/cWZsdK072nx/fOocRx9
+7EhEGBDK8E1gvKKSgB/S1p+ctfSwZkOPISk/qHSLrvgP7/9t7fuzHf+Tw4StrR186+S+OHT/9/nNnl
+968cH5ZdvsZ7c4ZNhdzTp+D1tg4k1Oz1OojpCPjjE5PMTY9h0wSarUacdKildRIhMDbGlNTMHNoP4s
+LZ9lYW6O3vYG1GeP7Z3916vDVGzZOMdUtF1fPKSkRd0zXEzVk1eyZCnSRpXJiZzCLKwv24T7SIvFYB
+tjQQdJDSkkUxWitKUUHsiS+7xC69I7RbbjMkLFSk1f/qRue7jvDYIwkJs8z4qj0R+22l1i6cI7jx17
+ceHnp8V/rydO/NH/jDHEtZXJ2htHpKYyUFEJAHJMHgR0UbHc7FLlgdWmT5cU18oFje6PL+vomorOMk
+I6JkRozh+bZe2CaK686sH7zLdf92ZGrDj90xdz8tw7vu4LNl07z1e1ttpeWvyGK8MMiSKy0ZMZQRxA
+FhcsNIc9K4XMSQSzpmRw/EtPYO83+O2+0h+679b9G1x3+HKO1p0vLCE0QEuMcQVc5vUIi9K6iC7u44
+GL3QfXPh7jof2rTGYZxwzJclmwqBNQjtQN+yF18NUnZi3vjUaqBkx6LtKKePDF2+60fODI7/18G55b
++7WbhH1x8+oVmZ6tLxwuM1Kxsr+EixcBZOi6jR2VgFMr1glQRloAQnkMHr3jkne/6ASbGJgevfeDBP
++l2sz85dux0dPr0ubedOHnq/U8ce+btx4+fiBbPLrHR6bDRuQjGQ22E1vgUoxMztFqjjI9PMDM1C3G
+d7cJS03UipQlxwTWTY1xcvoB3BUoYrMkOfv2Rb9x2eunUUzfeeB1HrrmKvXvmqKsEbwzBOKJmCs4Tc
+JgwQAWPFgkylETzAMgoYmAlKI0SUVkMpoOQEuMKmmkEQmHMAKUkWkOcSGr1qPRWHapFUHgPWpdB1LJ
+KRaJ66XYsDytrA1kRkK0JBOdpdzdZWDzOiy8+rk+eePat65vn3+9s/917r4EknmNkbIxac4yB8XQ6A
+wqnybqWzfYaKxc3ubC4ysZam/Zmu7QkGBSopIbLB0zXNVdecxW33HLD8m133vQnt9554x8evmr/d5o
+jdSIt0dUYOj45xp5985xLjj4SJ+6H6yHFDzxWBApnsXlGZD31OCGSgqCgiBWmmbLntmt7+++8/m/nb
+7vuVzly+FtEYIUlyARdcUu0luyW2Yldxk2XuSMKf8lWAtBCfz+LT0OZsBwAACAASURBVO4C6OR3X8k
+Vy0eLS9KKy0pXVU7TSPLq98tljJyb+VYtTj/xwI//yPIL84984JmH/0Ff+PZ36Pc6yKRGUJCZHoUKZ
+Uiq8NhwSQ3lQ+nVUavVnoiiiFotIY5rjI6NMT42YW699dYvb21tf/l1qyfEyydPv/npp154/wsvHH3
+nyRPnaqvLq9Bfp2N7dJZPQdqg0RhhrDVGo9ZgtD7C9OQMzVqTYiynNdJgZn6MRiPFu5yLFxc+uLm98
+sH8+MbaqZef+dMn5qb/4ODeuUdvue56rjl8iInREZAZOEvh4lICJFRJYneXoGxvIdEjFH6AcwKtU6Q
+MxFGLOB1FiII0rSNVjoo0JbuvVHsMD0Yty1iXIcteCHBWY51ExhBH2U6RImUVVhLobm+y3d7g1Omj6
+cLiyXecWzj2gazYeHNaD+rA5BhC1ksdpWtQmIIts06/71la22Zpqc3S8hbrGz02ltfRSQOfG+j10El
+C1AwcuXqe+bm5hfvvvvu/XnPN1V+45rorn5+fn2Z0cgQdicpzRV6SBkQNmvVxmvHIE9guFBKdg0sCk
+VQI4bG2oGMLRCTQtQQ50eSmN93P3juv+0Lj0PxnmRp5lnjIolQ77BO5SyrmX7ETF2E3HdrvYMPhu0j
+S36dVw3fZSO/OFReXO36JV0C0QVyea7BjixIlPp6dfrIxOf3B21utz4/tm/93anz0nc889i3a5xdLG
+7gKXDGVM/LQor1UYghirZnfu+epVqtFHMc7XLE4UdSbMSOjNSbm6uGuG2/56psfeP1XT718nmeff+n
+BZ5958f3PPPfsu86cOTOy3RlAb5teb4neWrn3iZMmzeYIWseM7m0wOTnJ2HiLOJqjXo+ZnEgBSz2RU
+4TiQ93txQ+9uH6qvXr++S+9MD350L75mW9cd/XVzMzMYNIDpPX6DkkhVEz44QtgHChZYyj+Fq5OsC0
+a0Tyx6BPEFkJb0toE9foqOkqRsgyNNDsuARWNbXgQStCilL04u47SCikdLu+ytrXC8vK55vnFUz+wt
+r70gU5n6w29bItaU7N/dpLmSIPBYMDqxjqD7ja9osfLp86yeH6N7e2C9dWM9Y2MPJMEp6BnsEWAIie
+txdx5+w0vH7n6ii/ed++df3TjTTccn5o7zOzMVBnuWSVeWG8qdU5StpBCQZQwPbqXqdbsU73gifqO2
+GhMVAJDSil8GmGFIY8CphbwNcc9Nx2mcfdNn2a0dtxgCaJE5/WuOOxKo11BguzkMu20mrtjsnc17+H
+7XXy73S3DK6/of6QAd/9V+HKBLQQkHpy85MNTAF4GWlfs/9at81Mfj0brt6/3t/adv7hE3s/QaBxmJ
++bYV6o77yAIQZrUj05MTPWVkJVdXUnKds6XangEYyKFNGJyb4srpvdy1/W3fX3xgaWvv/jSS5w8ffy
++xx9/5H3PvPD0BxeXzmNMBh4Ku83G5jIIRS+vsbVcZ2SsxfbqNKNjLWq1mPGJBs36CM36CIn2mKw76
+oreB86eu/CBhQXbu7D0/F/MTE19ft+1b/ofY2MjjLeaxLpGpMZRjO1wu6X3BEcVTVbmkrh+naLXoL2
++jXAdlhZ7LC4atrZAKEGeS3xQpFGCD+Hy5z/EzN2AYDJULZB1lllcOjW2sPDSD62tnXp/P1u93/suQ
+lqmZmtMyZg4aaCUZqvdZXFxk6XlLfqDghdefpGzZ5dYXytv6iIHBiXpWuk6KkkYa7U4dPB6Xv/gA2u
+ve/C+qw7u38P8/DSjo02sGi3hpgB5btBaInVSuh8gLr2UacTY2Axjo9N9o7eOCt87EoVSHeO9x0ooE
+uhJWHV9VrbX6YQVbgldZurymiA5bquSqg13qu5SjyleEYR2ufHoP3bdhO/zzRfkZWyl3Q57Qrxi9fA
+9UCJZ/fIYiHfxTi1gfcmxyhWkrfTZycP7fj2ZGvm/iygwoKBGhA/msotWUjLbhZDU6/WjY2Nj5e0aP
+EKVLIgkKsvbq5I9P0w3kQHGR2PGxw9y7aGD9Af3PnL3rdc883v/5Xc++HebC2wYhxXVHR2AOCZb79B
+fg/5GnfbKMkktpjnaYHZ6nK2pcQ7sn2ZyrEE9UaSNFm5E0h+0G2tbF378/PLJH3/66GI+PTP+36++8
+tDnrzx09Vdnpw5aFfcp7QgCWmsICmvqmFxRdGFrpWD9fM75hSWeV4ssnF3h9Ol1Tp2FsdU2Dz/83Pv
+m5q//g9vvugPnHPVGRc4OWVV8A5xbY9Dbmt5eXfvhxYVT7zt16vm7tzrnSZOc0TFNrS6QKqI/6OGCo
+b9tWN/YZPFCxulTm7x8ZoWVi1t0Bz0626Wdu1YQm7KbSVSCkopmrcnYSJMH7r2Hn/5X75u64urDDXz
+RQ4nyMCuFHThf2l8oLXa+/1C9R7p6O3WrTjrSgISjVtojTnu8lmTK03OG9aLNUrbF6d4qS7ZLv6l5V
+96lr/wVEo+uIt7kUB1+WZHJaq96qcFUwxMwfPeF879F23k5ZeLy61hcsur/7gV89fdoqKOrwiSrC6k
+0862gOOMNuXf0XX5gc7DNZtEruZvSs5u5WAbUKowrJTfNZvPE3Mxs+QIPBY/Bl0bTrtzkxPjSrirVl
+z6jgyiF0doYN191xR2TiSYtchpF1Rqb8uVI8AgfkWOwnQFbnRyLI04jVhcuMjZWZ3VxhumpJiMjmun
+JJhNTNUbHRhmbaJQyKhuSbLD87hPHTr373KlH3MTI7Ffn5654aP+Bq/5ydn5PHpxCqEl0JBlsxZw7u
+f6+Yy+8+InzL69z8WKPMxcdFy4Etjuj+HyEtYuCL/3pNx5aXOp+4i1vPfWJt7ztwT+opSCUJ7BJ0W3
+vLfLVH93YPPuT2+2Lt1y4eA5vc0bHDXv2TVNLFcFl9Lpdup0+vU5gfX2b4ycv8sKLy5xbyNnahn4Gh
+amCeT3UY0FCSpABrWLiuNRopxq6G+t0NjcIzmOy4o4gwzdiFaMjTSgMMopKBLwM5qms7cMO8dsIqEV
+gmwI/IrBNfyKvDcBAB4P1sFJsc3Z7hVOdiyzQZgDEssF6dxN8OCC8Q8uojKCuXjkpL38fPfKy1zl8r
+/ui2qSpf+aNwz+t+Pylt19cdiL4S9zd6id38+GGp4by5pJLkKgwJlFZaAuB84ZUlgLefNDbu97eoJA
+Op6BT6XEqDyakkAQpwXmEkNRqjTPNZhMlSoUxIlSaMkmky3jHPvmO7AjKYEYtS8UB3rG6sHDT4OI6z
+aK0LweQKiV3noYcxU02Wd/cQKYpmTVsFz18rtjM+mytdVk4tcT4WDkH7t0/xtyeUabnxzh81X4mJkd
+I9AqtCVcJiQfKmrNvP39h6e0Xlr4DSv3Nddff9tDE+OEvx/qK7qmj+W8//a1zH37hmaOcO32WfrfN4
+oVxCFOMt2qMjyiMz1nfXOSr/9/Dh86eO/VQWnd33HTT4U/t2TPynnyw8hPd7YXrev8/e28eZFl213d
++zna3t+XLvaqylt6rW71Uq1d1awGEBwxjjywghmHMIDuMgcByGBs8eBx2yGMTMTM2HhxjkOzANjMsM
+RgBZgsQGgNSIwn13tXd1VXVtee+v/fyrffec878ce/LzKpuCUd4PN0KkREvKpeot9x7fuf8lu8yWKL
+bXWTQ32VqtpSKFwEuy2ltt1hd3GJ9tUOv63j55cv0hpJW27K5k7HdglEOKjBMNCocCef+OE3T9wdGE
+5mALB0yGgwZjQaMRiPae216bsTlSxdZW17h6InjD0Rx5fPjMsHIHGx+SD2ghCOoAmMzAtCOWEhs3eG
+aYCfsteFOn7yfsdTrs5cPWOu3WU53WKdLD8g1BFqxurQMg/SYiRQm8IxGGSqMsLqENLiDscHbnWbqM
+IjkluRTinfLyecPg+VvPr4p0RWHc+rxB1V5IYJUtENLJUc7jqjCghmpIE3Za7fmBqM+1WaNkRG0W32
+w5aknCx0RJwrOthCCIAiWwjBESllAj3A4Z0u2uEdqTZe05FJ5BJ5QF0aYWPC7exgv7mlGFU5OzpLuD
+Rn2U4QvEBAVl7CRS7Q3NKqTv6LC8H8cefs9Toq/vNtpnR72O0hl6e7t0dpJ2d7pcOkaRBU4crxOc6r
+BfSeGLCxMc+zoJNVKiJYBAkGajuin+TdfvvLcN19XN8gHF7l6znLp9T1uXFpjdWmJne01dtNTzM0cp
+RrXccozOVNlPj3O5evPcf3aDf7X/+1/+fif+3OPfvz9T72HxoRDqxZJPGB6VhKGEwzyFbrtAZubfTZ
+X+yxe3uXSG1tcuQQ7m5Bn0NqDYQZBBWanZ5icnfuPR46f+Ln5o0f+wx3Jfd2rVy//++Wlxe/a3d6i3
+RthhynSe2Kj6Q9HVGSITUfs7e1hrb/HAcMyTd0PPJsVR5E0Bal2DJaAEhdbKPlTBVdjKYtysnzE6uo
+2W3mbFbbZJScTGieL589bHXa3ttGOuUiWGFDn9/VUUqB2iAT7pzZRbmkminca24l565Por0JcuhV3M
+QhLzRLvUGMjEqVASJwQ5ELhbYFXbLf3pqYDhYwcw05BXbniCkJ4Xzr6mcPbLg0KNbOqyNddGLBrYoL
+CewiZF7o6Vhe7amwDjBKFjK/N8dLhhGIoc3zg2N1Zv23OpcwkhnDQxgQZg1GfAZJBugdpyAX6zB+7/
+eX7v+cjVzdC9RO91P7E6sVrxzbPX/3u/vrm965vrD60trfJVs+BNYgduL6UEqs2F051OHHMc9eddU4
+en2J2JmKmCRNVmG5W6bfg9bNXWFpc5Nqi4/zlHa5vbrLSWgfbh6CBVnWkrDNXn6GuYDKZZP7Ox9ncW
+eXcyy/xu5tfpOL2+IvfcTuzM22E7ZD3HNuX21zdqXJ9cYerVzdYXGlzY7HP4ir0BmCMIXOG6YVj9vT
+xE585fnzh3915x22/ffr03cOTp47RbNQRnYw/+n3xssr4rqgXY7KQCd8kiCzejNgx2+QRjPp7LC/dQ
+OX5bcpBRQBZjg+H44ofV64cAcTOEXtLb9CnUp0oHKNVHTVznFbl3PpVUtY3r/J74TJeAVagbIzwAmE
+1FZmBcOSjIRutralKs1kIZgRh4RBcME6h9AlRXw2mKfgvhyv7z0W4/Jf8kqJUf7IZWTZq2jxFSAhDi
+KpwNC8pJLlHSchGB7iOahRsBao4PeW+QdXhwtnhyjRHlSh+xFjavGjOxHF8LI5jdLVGDU9NaJwvZpF
+D59lZ7rGXRzx05sHz3/YX/iL5/DRDB7tLG8ujle2fXH7z0k8u3bg2e+76he+6tr32fVt7rcd2d3fp7
+XQYDoe8eQHWl7a4cWWL4wvTHJmvcmQu4MTRCeanpxB5he3tISsrPa5dGbC81KY9SBE+xlRrNJLbmGr
+OUw/qxIkhCD2GiDCcxVrDyaOW9uASb15a49q1GsNhl531RVavbLJ6o8XrK0O2tmBzq7CH9wLmZivMz
+N2ZTs+e/J0773rg380fOf67p06dyo8cOcL0VJPGRIUg0IUO6F7GiRM3zu8ud8jbHruXkfY1Uo8YCk8
+tqjKSRbMryzKstccO0ypECTR/W6apEERRVBiT5IIgKBoyu7vbW6urS+x0NshVCcn0viQdKxwZ1lncC
+IbDIaPRqOkK0We8EwcqUuLds87fkeC7iYh7uC1++O+iFN+xeRWbE0iBiTVS5xjdoO8yonzA0FqGXRj
+0YOSgEYh2oosdTpSOemNFMC0sFouUJVMAhRB2H4blhS/k8Kyb0UJidOEJUNUhQmkyGTD04NqSyiCnF
+iXXZiencI0ZUiRHGzNU7xb4xx5je3tz4/rm4k8v7Wz+9Hprq7m6vPodS1evf9/26ub7r1z9Mq1Wi5X
+ljNXlLaJgi4k6LByBhSMzVKMpdtYkmxsxi4tDNlspQyRBOMVko0mzcpJGtU4sFFoWAsJOCjRVjA6p1
+yTrO2u8dnaNuN6iVt1me7XD5jK0N2AYFUSA6emIqdnj/WPH7/7NE6fu/3cnTp7+7NTMgp87cpx6Y4p
+ms0kYjMm++T5KRmQB1Wr1mkDhnCP1tpDmS0f0bI8hPfbsCD/ssbi4yNbuzkxSqyKDoEAU7LfLvkKmp
+DXWOryXBKEmy4esbyy31zaW8GRUwyJzFbYAxAkh8V6TYbES8mxEno2qztqbrMtK3fp3TQC+K08+50G
+4IiMXzsZ4i5aeJNAEypJoqEpNQkiGI69Z0m7Ods9T07ZXlQ5TMun0GB3si7mOOkS88RSuQXCzB7tWq
+hFHAZVanQmhqMqCIJypEO0gPtKg09ZMJNU17Rx9NySXIYFUBRXMx8wmC0ydmOdeMoY22+22Oz+7sbz
++s1sra9XV1T//keXl5b9y9erVb1peucH29iK9vRXevJJz9compJuQV9BygV43AKoYAiJVoxbNUw2bR
+CpAuCHWZmQ+I88dLhe0O46dHY+zk+zs7PLFL95ASks1grn6BCdOzTBzx5H23Nz8rx+/7c6fO3Hizs/
+NHb2N5vQxKtVJtEkwYbzfKMvzDOsytCzk1kubNpKkumbxpM4zSlMyl+N8TppldO2AvWwAuWZzc5PRa
+NQQquzOGQ0+Rwh1kx/iPhrDg3dF098EApdBng4Y9Ns9QUoFqGpIbSFhIRghUUhVQOl8AMpbJC4uOuk
+HXvE36df/WfB9hZOxBB3afEQ2Ghg7GqCcxUhPJBXOD4gDRSg8TkJQiRANw+pOj4nAp5HICEgLFAxmn
+04gfCFbsd8A8qWr7FjcxxX/uiyPA22oV6rUECSZxXmJMSFGSAZ9x0Slxky10ZImIpGmWAAcKBQLrVB
+SFKYdQcRE0uDo1FHS2/vd0YBf6PeHv7C1sx2tr6/+hc3tpb+ysvbmt1y99LpcWrzGm69fZXsrx7k9Y
+JaECXTSIKomJGqSSmSItMDnpYU2MEhH9PYGbG0N2On0cDJmonqS6ckppudy7r3rju37Tz/66bmpkz8
+3vTD9J41Gg8bENFG1igkSZBABhsz5cfe/uHraoPCF0psohG+F0CSVWguhyF2hJGfTEdYPGdi0ICS5o
+tHVardJ0zQ+cK+9qZ94SxOvtChwbv9zCeGJEkVzKkk7kyF6NKIZF6OIXIIvx1VeOLwez3EzvHVGlCO
+C/fGC//+4Xfk1nXaOZxH+rQ0ai8NmKaNhT9pRH+1yYiWIPQhbOBNpmeEE1KOAOIiQ1jKZKBeSgstQt
+wJgvS3HDmX24YoxhBcl87vEYgkhVKACwiBA9wdQWn0hLFIWEnXGC5T1Q/ojbGSQiS4oVN4ThuqQXY/
+EOYdRGm0UQSOgWoEpBcdPzg/7w/f8Sub6v9If7OqVlWvftnzj+sf++A+/8Jd+97c+z5Vr24QIavUqj
+eYcYaVKGCdEwQCtDHme461gaHP2eh3ae3tsd9qMrMd7S6N5nA9+8CGeeOruR267febFo3OzNBuTiKC
++Lw6MAGc9zolCeFkKsnLxj2FXGlkqr/nSqVUQBNEwy3L6o5R2v0uWDnB2jx5tEClDn0FqabVaDNORy
+qxHK4/NHVp/FWUhIZFS7KujC5EzMVHlxPFZN1iu0VkfMV0R+FDhrMbnisw6BvmQkacAROQp3qbS2xz
+MAbZYiP8fuihfC8H31nDztzRdCtGhUEoXBkbFpjBc0i4nMuBkhpQeHUqaMWjl6RpHM1JSZanFu0ODf
+nnAxBjvu4eEcguq3QEQdao5aZuNCV3Pc+JhirICm4MzEVZqajM1er1dEl1IjRlbbCR5eYNH1hXS8hQ
+2yNJLcMVJJXJ3MGKRECYQqYTqRJLPzE3/5ul73/ObSdxMX33tqlld3aOWxDRqMfVaQlSto1WEFKsIn
+2BTT5p5+r09dtsb9Ifb9OwODk1gakxOz/PQg9+Yvu+pR16caAKqg9AO0gLQ7csY8FIU7lilvfOYh+i
+xBZy4hFspoUrfdUUQhIVIrfeFdLzR5EIXU4Ryqi100XARQlhT8ueULtJODgHy3a1dx3JDdi5HkhMGj
+lpDy0bDwBBy5fHCgpQ4KRiMUpwvMhohi9peFrnrLeNpf8tI/es47RRv94PwJfzOEQQBSSXKGpVE6Sz
+ADPv4HMIIrPAYA9XEUEs0djQicBmR8oH0+WAfn7evfFtKoXAg8SZ8aYBZOhX5EvVtgnCgg7AmS/dcJ
+TU6NIggJpUa1/fY1EKaR1j6lIZjY0NItY9qtkUjXch97wSMBF22GIVCCkXmLLm1COmI4oTmdHM5jM2
+pSlUzORkTKAkiQ3pXdGj9XuE/kEuGfUervUer0yL1O+Rsk+NoVCJmZhs0J2dX4rhgdWXCIRgVkhPuQ
+CO4PKCLsYsYa74ckspDgvM4Uaa5qSfPXNQbjhilOTkCYwKE0Phc7s/UpPeMRiPSNB1kuUUbhfPuEMD
+hoATz4mBDtNYihCqV8SxZ3sfZXhAmOdNTAm8F3ilsLsjSgiAsFEQKbChLIxmZqbdTzxbvnrNPviOv6
+r9CoScL9rtzrqjHrCXQauBdTiUMMEpST1Thg+EhCQXKpTRCzWQlYrZZZbZRqwibg1TkWRmA5UnjRKH
+FaG0ZeGIs++1w3iGEAiXxUrTjSo3cK4TUmDCiWmugg4ikUsO6Yh6mvZqgnxap5bDQUyn454VXRKG/6
+Q+5Ro5Bghn4FOdHeDKkLNgYRhZ2zWEcvrBwfBbr+vT7WzQahuZETCVJUELjc0E6yun19mh1dukN+gz
+SId2sS8aQZjPg+Kk6tYZAB/aFKC5eV8kAhy9ItJKbFJcFoJVEF0rB+9A959x+MEipca6QpVhdXptIR
+zn9NGOYpfSyEb10yJCUgS2A74M0p1avoLVuj2u+fIxsGm9+4hbWi/cHgectUnlq1Yjp6WplomEwxpM
+YT6QzarEj0hnVGOamJBM1qFc0jVqMkG5QKKEfBLgUEv8uOvnekeAT4qvnoUoqhJLk3uGc6zqXY7O8u
+BkelBKEBiItCRWE0hIrT6QELssaNktvfmI/dlySeGThOckBYxlf/L7gBSp0EG4KrZEmIEhqqCBBhTG
+mUiv+jWOQimFvME+vD6lHe3lI23Gs1ywOlK+4BeNa8ujEWOChtEpz1nH82MJvve99j3Dq1CzIPrnbw
++YDbJrS2W2TD0N63ZxWe5et1jrbvQ32GGBRGJmwsHCM6ZmYkycjji8Ev4UowCSisI3cP/GKE2osoJT
+DIaMAX/oXCiEK3Ut54P6Rjzzd7mA+yyzWwcg6Bnla2qod2EEbCXEYoaXaPLj3f4r+ni/YKO6QlqLSj
+iD0jSSBWg2qMVQDSEJHNYZaFep1zUTD0GzEVBJDGOiuKY++cfA53l1f8p16UfW2AG2/D/cRJTYzDMP
+dMAyRCoxUKAmqtKsKjcEoMMITKQiFJe3vTbs0KyDzohjmukMXP983Az1UCYiCjmRlaQRpgmVfmANgk
+mrhU65DVJQgggpBtYpUIb3e4BS7e+Vr6QMW9L7dZqnjViLn3RhLno/tV1RZcxaSgqE0GKWpJcH/ee/
+dJzdPnprC21263XWs7xIYTxgG5KMq3U5Gp9ein25jGaAJiMUkE/UjTDdnmJk0LCxI5uaHn1a6j6eHw
+CCo4USGF7cGXAHBE5Spsh+feGJfmGlcRWWDjN3N3VODQeGjMXIZgzzDygJDK8vucagVlUoFpdTy+Jo
+L+dWXnBfjgU+JzZWFGUwSi+l6TVFvQC1RVCqCJIZKpQi+Rl1Tr2uqNUO9GpGEwS5S3hTo/yWEb7/ma
+j75dk0XX8jcHZ63KW2o1+vbExMTyLRFYAO0A2MkJlZEgUD5jFB6QiGpGEVn1J8bDfrgCgHew3g8dQg
+Tvs9WFjdnw1ZIZBhfVXEFGUUYHRU6MmhMWMU5j6poVNJilNnTg96AOBf7SF0v3Fvhup6SWSHJAenDf
+VrW2BNCjmXbsUg/JFDDmePHEs4GHW4svki7NWSyYVFimtZOznZnk/ZgkwEtCvnYKlLH1KoRlcQwN6u
+Jky36o3O/VPXZfxMGM0AFn0uUtrfsfGOe9sGpJYXCy4PAs9bjfdFAGg1Strd3Tw/6I1Jryy1mHLqFC
+JHNc5RS1Ks1IhNcVWpcFY8Vlt9uEbj9X+43wZ1FSEtg/FycSORIk0rDaMg+CdkpUJEjt4VLUBQbtJH
+bX7nB92cNl6+Yerr9FghESWU9jivk0qB1EXxRpIliQxBZAm+JjSIS0EhC+riFbNgDm6O0vAkbWwR9X
+uIK2S84itpMlsEHYaV6oT45SbaxjcwsKgebK4hibOrQCVQbEzgdnEmHGXG5Y4jcj12kkftLeXy6Kmz
+J5RSl37uzkDtbaIcIifcjhN2j01784V73Oo8+ukCrfTv/z2fPs9u6QKeTUq0cZ9CpszfcwIkO3u/hh
+CUOKkw2a9x9ep57Toc8+LChUt1kdfmLfzGJ/Q9X6+ankRW0CN8m4yvO6XF+JoS6CUDsfclHkID09Dt
+ddrZ2zwwGRcNFK03qJNZ7LA4jZUGUDgImJyYIw/DCzXxU9zaoSsdbUlPAW4u1GUK6hTAQiAgSYVDag
+RdI47ACZCTJRoU6tQkEQrA+Fsa5yar6Jjfir9dRg//KfZiiVyhL8Vu1LJXC+nL2JFTR7NASLSyhURj
+h0DhiExBJfyrr7UE+hKBseZdiHbJEuAh/06xhv9O5byITRq82ZmZoL63A3gAVV3ApOB2Q+2JxRY0GA
+62fHHQHNEYpuAqoAmCe75/fHJLS8GV9JQ/SYO8Q5GglEMKSDzqMeivvWbzx4r+0bpWHH54jTB5mY2u
+RZ7/co9O6xGDUJc+n6bOOEF10YDEG4kgRVTOakzkPnJnjsccrpOkNdttX2N1q/kujJv4oTOLXURM33
+XaBKsEGB8FXSLvIg8ATrrB7do4sT1ldWWdna/vJ4XDIcDhEmgDlMvK8tx+xWkOtVmN+fp5qUnl17Mx
+0kx/0ftXjbi4DxaHupLd4lyOlO6WNgFAgrcUgC689U5zbBIqRKHC7URSitVweP2nJLHtXdTrfseArU
+i3PLcXXWy6Ml4IwjG/EcYVMBwQ+LAwy1Njt1JWdT1v40qmAQKq7RoMejEYQpQU73BYkTbGv+RCpogA
+AIABJREFU/hK+5UX3hfUEiEC/0JiaZhAn5L0RYRiRCY9TpkB6KEUQJ3T6g+M7Ozv3zXd655hrFt1ac
+3PDYjzu8OVRMtab8SWKR2kQwuLzPq2dRbbXz//aXmeRRn3EKN/C+WV00MPEcM/CJLXkGJ5prq/sEVY
+TGtOTTE+eJB8GrCxe5Prys7T27sIyT3MqLwSG2ssI3vy12SPVe4KKw7s5xs7AeHGoDzROMQ+QEM45l
+CpSRetS2u1drl+7dt/29u7x4TBlMBghRPG5rHcYrXEuIwoDZianOHbkKNVq9YXieR1Cy1tOO/n262O
+M7XUO7x1KiruiUOHSAG0NJvDoIECnKZn3OK0JpcUTUK0mhJG5wf4Gwj64gq/3Od9N2Na3QZqPZTaMC
+qhUKleq1SppFKFlisodWhYSgUIUkgtKgHSeQCtCqU7naVrkdM4f+Ao6QLmipym+yuRDgNRhL6rXnw+
+TyqNCddHaEErIlEFLCp86IRmMhrR2O9867HbPRbkFLYq/SV92zcvk2XNw/OKRWpT1ngORF/qYnW1WV
+678qxtXz949N2epVjwvvPIlXnn1DVp7cPwkfN//8N/z4P0f/kJ/aI699Orzp5zM0mMn71g5ceL+F1Y
+Xt5779P/9s5+4ce13o2dfuMLxk6d575nbqdciNtZ2SNOlu6v1o/8qCNUPeDFfSNU73gJq520RWMUFT
+NMh7c4ua2tr39rf65JlGWmaQiD3RzZKKWzmMCakXq8zOTn5fBRFPcqxhWYs3aBuOvXcIQsC5zjolZT
+mMkqp08YYfKiJCREl+yFNDakrRJVH5HgfkFQiVBheKe2a3irJ8vUcfKmEEIHIS2076UDZ8g0plJcYw
+Mkqo2T6YrBwEn/tZaqjPpNpiwSL0Ak2jOk5zcgIKgkEPqeRbZ+WS+cSrl3o89BxkJJeVNzqyIXoVJI
+GpVmjUCgUykOMA+eRzuJ9yiBUn8vvvv3RvSCm1e5SywRhmhMNU/biGdAJQS8jbw8/Mrix/s+j40dgr
+o7MLanyBCpkLP0yppBpVfyYihYBFYYDB5kkSTTLN85+54U3f/Ov1yfbRJMxV9Y2WVp3PP88rC/Ct//
+5v8wHHv/vvvO2k6d/tc0WJ2d2aeo+jfn3kMk72V44TRwOL/3Sp65/evH5F3lhokYQTnDi9pijJx071
+5/jytk/+OsPnTn9Wdn8xKeFq+NJCjsyDY52KT9skNSQGLJ8SKwt3o4QvkKNGV54eYXnFrsf2RIJ7Wy
+dIMgZDrdIyKkJR3fURaEZpJ6w2WTmtuOfs5FEkBMYRZ5l5Kbg8GknitvuKOaruksuhgyVIaSB0TGZ6
+5LLi0kwsXTa9S2IBayyRMZhzAjLHmGWY1QNX2nSiG9n5ugDZLJ20UvPINujYirlri7Ah++aTod8R1/
+9K7i+jAtkqSCO44tJkqSBidBBSBAnJElCHFcITIRSCi1VaREsMEqj8A+TDcCm+8+/70ki8v3BrvSH+
+y5iv9gXUUJSq362UqsT1yqEcYWwkhAkFUyc4AVESUJjahpp9Ad2O+376PZBCLQxhaTdeLrrfIkNdfv
+i3hLFKBuRJAFR4nn5xT8+8ual135+cqrB1NQM7c6Iy5fXef7ZC7R34cyZB3niqff965m56V81kSSKE
+oIgwhgDQYCJQyYmAm677bZffeyxx/51pVrn1Vff4E++9CJr67vgAyq1CWwOZ18/9/OrK+ePONoInY1
+RbuRekDmNJN6vWMc6OEIZEJLdrS6rq6v39fv9D0hZYFaF89TCGpGJEEJRD+pUq1WOHDnGfQ/cz9Tsz
+GeVUiVOU2CMKQcxvrgnkkNqYqqUOlL7521u+1g3elhIhwkNcRLSbNap1RIqlZg4DjGRIUkSqtUqQRy
+RJElqguCiQh1o+Yxr2ndR0feOBZ/jLXPwA4/NQ2lCEIVUqrVXTRjhhUIYgw6KoBOiMLwX3hagaTxae
+mzafcx2d2DUBj/c/5CeFFRhcy39W4f9Qgi8KNOhKP5MUq+2giRBVyJ0kmAqFVQU44xBVRLiRg2nNOu
+t3Y+12i2wviB5HkbtKwFGFWMUMYZshXib41yX5ZVzvHnl2U9nbjtqTlZxVvDa2at88ZlzPPvl4mmef
+vrDFx5/4skfaE7VIQSlo2KGOV5MqtCDWji5wJPve/oHzjz02IX19TbPPPM6L750nrX1PaK4Sa0xQ6c
+zjG6sPvfpwfAysE2WtwslOVFH+zoQo7wpEC9l17nQuRHcuHGDxcXrHxsNh8Um5cRYtIogCBBCUKvVm
+Zqa4vjx4zz00EOtWq32GUqWw1tXQH4YZV8uR40UukTXFGBt5wePKe2JYk1cjWlMVAoScawxYWFZHcY
+RSbWCMYYkSV6lvI/ysBOUeFeVfO9M8N0ceG9VvPbe77cegyCgVmu8bOK4sPnwpoRIFfWcQqBK5TMlP
+Eo6+r3WU53tVRhsAz0UQwrPpBy0f1uUjUCUQ93SGlZJdBT/uqlUEHGCqMSISgyVCFOt4sMQmSTIJKa
+f5z+42+kkfjjEubHmalnMloiCYi0U8zSbeeIoZHn5As8997v/aGSXn5qaMXT6O1y6tMTzz17m7MtF2
+frwmQ/x8KNPf3Rmdr5QeZJ5oaGBwjqKBexSnC/QJHfeeTcf+sZv/eip2+5nawv+5EvneOXlK/R7gnp
+9nonJOTZ3XnlqY+eVf+TcDYKgC+RID4E05MMD52gAlwtwmvZOl4sXriQrKys/2Nvr0u928d4ThiFKG
+YwJqVarVKtVpqdnOXZ8gRMnTvy6EALrCnn6/Xu7P4axRckhDy9Hg9536+1j/R6IwVPaeII4IIwNYQQ
+q8CgDKpSoQKEDgwkiTBChTfgy3iORCHeIuCvkn518b2lyeFl66ZTpjjroCUsTUWtOPp/UpsDEZMJgy
++6hlJIwMEShIdKa2BQP8vSDw84WpB2QA7QYIkixpAdpJrdsuuUfhBB4KcAE6Erll4N6nbBeR1Sq5FG
+MjRNUNUHEAUGzQW1uFhGEtZ1252+1W3vFmWdBOFHIse/DyYoOqMcirKPf3eHNN1/4wOLyy/9QBy1U0
+GNp6Qavnr3E66/32NmG0/few3/1rf/t37jzngfPCRPgpMOKHHyAkmGxoFVhDZX7YkzeaE7zwAOPnXv
+6qW/5G82JSV5/zfLl5y5y5foO3b6nUptFBzssLj/3D7d2X/uAEB1gSDYqHKZiU7x/l5fluAjJB5LrV
+ze4dOnq39rYWq912x12t3cQOOIwwmY5xhimp6ep1Ko0mhOcPHWKI0eP/vL4RCyCz92y6HJgdJDqeIM
+kLIW3MqANooNUow8GgSQIFTpQxXglcJgAwlgT1xJ0FKLCgEq9ThTFz+M91tt9rua7iEP7zgbfPp31r
+av/pmGrLzg6VOuNL9eaU4i4RiZD8nIZSykwRhEbXULNCumHJFRz2ajzKKM2uAGSERJHZn3hYeD9/g7
+8dpvCPus6jD4TNOrng2YDl0TkUUAWB+QSRBQS1+tUpyZRccz2TufH11bWJ7NuVliiydIkJs/BFZpcu
+lQv8S7jueeeSc6ff/bTQdwnqmQMRi02N7d5440lrl8FEygeevCDv3H/g0/+9ERzFq80QhgKGSANsrB
+GLi0A8SIvvA6ihOn5Uzz88Ad++s47HvmNzh68/tomr7x8haXVLlo3WVios7NzmVdf/6NPt/YuJLCHG
+kvLl5msliCFRiDZ3cp58+LS5OrK5o93u12ydIjEkUQxUVRIvhtjqNSqxHFMc2qKe++99/zMzNxntCl
+QB7mzZd13q0qmLaJ9vAK8RHpVBKVrg2s/qtVoLggVJtQIDVKN0JFHBA4dG6JqBWE0XhkmpqaJK7UvI
+03RUBPyJnzn133a+Xap55hrJzgAY1pbcLaS2sRLjekju2FtChdWEabAiokyzSx8yMtdVUISB+SjvW+
+huwODNti0kJPwGntoxufLhkgxEjiMrhmXH5qgVvs3wUQDWa2QxyGuEiNCg4wCbKBQcUhUrZJntra5s
+vGJ9cVV6HPgxVeqtY7TrOFoj6tXXuONc8//Yq+3OTs9WwGRce3aNS5evMHFiyOUgofPfGjz8ce/4Xs
+mp+bxSkPpI2cxxYkkA2wxiKOQTSzx+kJD0uT2Ox/iqff/199zzz13bW5uwzN//BovvXiRlfU9tNREs
+WJx+cLsl5/9zC9urJ9D6UHB6csOBtM2g34bLl1c49xr1z/RaQ9qaZqSjQbUKgnVOMYoQRzHRElIFEU
+0mk3uu+8+Hjjz8L8xUVgO7YtxwbjuEzd12Q7VfmPLMgfCD7D5Ls63v0UqSxBoTBCgAomOHHFFokKJD
+DVhNcHpAK80UzNHdnUUv8T+ehIH91r82cnHzR6yb9cFLY02ZdEKM9UGyeTM58PGNCJpIEODCCTSlLo
+issAcClU8jFHkw+632+4O9DowZjl4c0id/wBgLTw3nYSWwkfAKtBJ9ElTq+7JaoKoJahGlbhWxSQRO
+YJcSiq1Okkck/WGH99d2vimvNWHgTsUyQ68Jx3s0dnZ5oWXPv9Dw3T3IzOzdRqNGp12j5devsBzz2+
+wtAS33XYX3/hNf/67Hnn8ff1qfaJkXGhSK7EEKHWAQMHbW8FZ4AOmpk/w1NPf3H//+7/1u5QMeOlsh
+z959jyvnL3G8mKHuenjJJHm3Lkvf+SNi1/4oe7wGkL00QE4nwMw7Fk2VoZcPr/yTdcurX2830uxmaO
+7t0tgJFp5nLNUa0lhKprEzMzNct/979m7/c47PmmdY5QVxFkp5KG6j30FMz+OOH+wLIQHXA/vWnjX/
+XZBgROVRiINhJEkSgwmlOhQEyQJ6BBhYmoTU58vLOkk3vp9ZgnvQqDnO0MpOvzC/nCna7/KL3oVRpB
+lKeiA6WMLf2CDCn1ZqES7EuSL8OR5yjAbknkHWhHGAaGR7+vsrN5B3gPlwHqiMCoZE2IfMT+eOxzGE
+7r9YTv4QPaIzL8QSYiqxqhaQrVeK+pCDSYJCMOQSlQhRpHu7v3UztKqREjIIB/2S3MKz/rKMl/8/Of
+ufePCCz8TRpDUYhZvrPPqq1d5/rk2F87D9DQ8+eQ3/JMPfeM3f26i2SB3GbKkOykV4q0iyyDP80Ntd
+I8qxRIRAUiwTrKwcBdPvf/Pfe7+B5/6J87C+Yu7nDu3xPK1nL2OZmZqgUo14MrVl37mued/+17LKsg
+Web4L5HR2u3zhj5+XL714/qc67QFbGzsMBiNmmg2UsHibEoWKOA6IooBGo8bc3Bx3n77nX3T7/Z5Si
+sAEN3WTnbVFiedFybIo9eUOS5/LDG9b2HzrDmz3fbIo/pFaIQOBI8X6DBMaknoDKw1htc7CiTuJk8Y
+foCvgBEoeCMwqJf4s+N6263KLpEPhY1VeKKVBKWRS//1gYhIbVBAmAG0QsgBDS63QUYCMIrxRqEgSV
+iTCD7+TwW6B8xS+8PF0tyJa3P57uHXsaAFXQG3+qYyClkxCZBygAo2OA3QcoLRGh5o4jEh0RGDFA6O
+d7qdYb0N/hNYG8pyl61d57ewrvPHqq79WaWh0JOgPc65e3eDF56/z5oVC2Pf++x//0mNPPP0Pji4cJ
+apEqNLk0LuS/+1LnIy3SO9KnNqYpHUw4tABRLHh9jvv4f0f/PA/uOPOO7/UasHZ167z+tltttYE2kw
+yPTtL7tpcX37p164uPotnkzB27O3ucOHCm1y6cOVTm2ubDzgHRsfkuaNRj1HeEgaSiWYVoyXWpcwem
+eV973+qNTM/908r1fgQUcnvk1jlTbo64/csbzbWsT2gA77znUKMSsU0jdAKYWyBYAkUXhU247nXoBJ
+0Uiepzfz+fiGMRPh3K6fhHePz/SnIcun30ymhdLGz1Zvna3MLr/mkjgwiVBQhTFCkmkajkwqqGkOs0
+RVFpaaQYu+7/d4qpK2igD9kqeS/ygU5LHbliu5DR8fBT+g4QEQGHQiCikHFBh9IlNbEcUxiQoyF1ur
+G9y++eflvd9c3QSm6ey1efuVFXn311U922runZ+Ynsc5z7doGL7x0lddfg0EfTp48Mnr0sQ98x4NnH
+qZar+83J6z3+6lTAQworKIPZmf6kAit3BdFcQLmjy7wwQ99M08++Q3fYQI9unChxzOfv8jLL6+ytWG
+pV2eQWrKxdeX0y6/+wSevL72C911efP5P+OIzf/y311dXvr/X77KztclgMKCeNAi0Q4gUE0AlCanWI
+hYWjnLmzIM89sSjP1Ft1jtSqQPTSSkPLCmFKIx0PHg/DpJb2s++hXdbCL/73YIRSsgi+JRHBUX9V3R
+6NUIF5GicCgmixmsyqZ+HALzaDzzBuzPtfMf4fPJPAb0c7g1nAoKkxsT8wm+b+uX7ZRZjjEGZUiZAC
+YgMMg6KeVokiBLBQHXPDPpLH0hGG89QP47wk6W68a2v7/Z3X/E2aBupwXn5z8jU9/hMPGyVRUqFQjN
+yOVaUilxKYr2g096jPWz/5MZgd22O7i9d2bjGl5977qOt9vYPHpmfQZic1s6AS1fWuXhhh70unDjV5
+Mmnv/l7n3j6g6szc3NF3WVBaUNui8G92Mc95nhXdka8Lh7i0NUt5N+K/6cEx0+c4IPf8OHVa9evfu/
+nv/Af//2Fiy2a05cR2vHex26jWm/S6fW4eOmVHxwO/GePza3/2u//zsvfc/7szk9qMcug7+n2d4gCS
+Rw16HevUatG1OtVlPYEQch977mbBx564KXaRP2fjSea42iSZeA55woVcSnK2ytKROchfp8c4fMtvF/
+/AOye0SItwO5SgnI4leJQCKUJdIC3MQxDEBVUUPttZAzW7F+Tgs3gDwLcf90HnzvYCQ/ZiN1cB/r97
+NMKDWFEdXb+16szR35ctCvFridTvHPksjBK1IFChEULWiYjlMhwdvNjjJafwd4GagLBxAHO+u0CkJu
+tgsfq2VICyv69nPT3clkYbQohsSOPlQ4lix3e+eJ02lhbZ+X6+V9Mz4nhSnvtC0sbN35hfnaS2kSNl
+fWrLC1tc+3qDsvLYLTg/vuf+Nmnn/7GX3nve99LY6IGvrRrLv3UnbcF+MoP8aR4nxUB6kUxHxuTT8d
+plixqJ0dGGIa899En2Frf/pWlleWfffHl83/tjfNLCO2ZnJnixG1NZmccmxtv8MrZF3/hmY3X/87rr
++z8zMZSTmymiaMmlaROEifYzBJHiulmjVq9wmg0oN6scccdt3P02OzfQwq8z3He4w+deAV9aoxuyIr
+T2hUzVS98ybP04NpYv4n3Gx9DtNAqwypTsBtUjpBDRFZHSYEyMcNhSOYVQVAljCd+vWCsqFv6CYeyn
+a93ASXBf8LMRcp93SGLxCpDZWLq2cmjx18L4yZSRXhvEDpEGEOuFM4IZKSQiUVGGWEyQunWX/Xp+hH
+SNRAdlBx+hUH/oS5soXhcEoCKh5QSpdRnlFI/JQLwRuCMKCSzAl0Ag73H5ZZBv8/a2hpfevbL/Mbv/
+PavvvDaK2smjuLmzDTdQZ8r19c4+8plzr5+jdEA5o/c/uYjj7zv++99z/3UGtUy6Iqgwkmw43nViCj
+KQWSF6rPzZVEqbybll4tOiXKIo+DI/DEeefR9PPDg49/fmKq8ub414I0Lq7z6yhKbGylRNMH0zDxRF
+MXtdvtnOp0W2zsr7LYXcW4bE6YERhBFCadOHCWKNVk2YGp6gvc+8hAPnLnvp6qTE58Bh5ASIcUBRQl
+3wBmEcrCe3fSGiw2lB+zg/fYRz+5fFbKLNjkmKDCaQlukHqCUwUtF7iTD1JJmAh1WX4uixrNj256b7
+AfehQP2d0/D5dZUvBSv9YfYlQ6BrtaZXVj45Xp9FmUqeGHQQUgUVwiSCEKFiCUyBEyKruTESY7NNn+
+I4SbQRtD9yrZQb2dj7UuJBekJAk0chz8iQ/W8U55cOVSgMUmA1II0T+mXgXf1+jWuL96gN+hTnWgwe
+3QeGRqW1ld5881lzl24wd421KameOKJb/joo48/xbFjx0owcY7NC61Qm5VBpASFwdUAIR2erKz5xP4
+xvX+9nAPlcQwRWKTWIDVHjhzjQx/8Jt772JmPBqFme6vPSy9f5uyr19jc6DLRmOXY0ROcOnU78/OzR
+LECOcCLHsPhDtZlNJtT1KoxlSRkemqCM2ce5EMf+sDzx+6640fQemxyeGiCVwSeFKrIHjzF5xjX9GW
+e4clx9HC2g/OtH/K+hZJDjPFEJsAYhTYCFTqkVGXjRuK9wgQJjebML1eqjXK8I99md3V/Fnz7L/q2i
+IPy7Vi7/6fxWNYKCWFAY2LyF2vVCQITI5TGmJAwqRBEETowyFAVKhHaQiggBuv7H8+yTgIpvrBe/E8
+6mcddxfEJKLQkigOklj/gsLnDg1GYMEBoRZ7n9Ed9NjY3WV1dZZRlHDtxnDvuup24UmG31WJlbY2rV
+xdp7WYkzRoPn3n8bz7yyKOvnbztFLWJGqExCFnyFFWZQI0vSz7A00f68UlyCA10eOPQ5QjGF3WhFgp
+vLbVqg8cff5InnnjstZmZmb+ZpnDt2hoX3rjO1Wsr5JknjitEUcSxo0eZmm4wGLbYba2R2wFaKwIT0
+e12mJyc4MyZMzz5xGP5kbvu+AGUgnRQvE9nb5LoU0Lt19JZNhZtyt8y+3UuxbpBYl3/454hQuZIJRB
+aFcoFZtz8Vihl0CYkiGJqjQmmpqZ/ERUVPixfI1/qE5/4xDuQduoC5CoPuuPyUMXlpS5nb4XTQuA90
+oH1El9rtLZH6cMrvn+6l+wQz3YIKm0ikyN1FVwdTANbNaSVjGGlRx7lkVJyoG34jMCg9GzZeJGkXpB
+7gSu9rCUjsCOEzRAOpC9kY610DEXOUFl80lzt7PWupp32R6elRLRbdLdX6Yz2eG31Gp+/dI4L3T1qd
+9zO9Kk7IaySecHiyhoXr13jxpUbuB4cq8a/9ReefupHvvPDH+au+QUCpxEmJs0FmOKiCJ3jRQoix0t
+FZg2hW6fd2qNPjXpzChFmBPQKx1eZk7kBSkuMC9DESKsQowxlJBWl2DbrrG6tPLu4eP2R9ra/Z9AVB
+O4YWh0jrEwhKgqf9GgPltnY6uJHQ+aqUxxJJqjkOcGs476HTnPmqYeZvfv49+m6+kyqLGkg8TIAYVB
+eoZ1AO4l0IJwtJPyVpS/fRIoIKWr4AchUI6REuXOMss/9XSfOfptUu8W19xLPEKfaePZw3tExQ4gT+
+nmT1c0a1fojvzF37MlPWVtD6hCUR0hbnsLyJnFQ946ne++WtPMrAlzEWx5Syv3H5MyxfzsxPUcQVwr
+Le60h1BAqqBgINcqE6CBG6QStQqSUfxc/mMB3y/QtO9DUPFyUe1EQCUU5fxKy+N6LciAMLrdMTEz8w
+sTExN/PnCN3FhMVttHLa+vsDQYktTozs/M0mlMArK2s8vqrr3Pu7OtkHYgjmGpO/3AtblANq8ioCio
+Gq9AEaK8LZWerkFYjvEEREagqvp/hcomRIUJHjI0mfQb5yGF0AtbQ7aQwUoABk7C33eP8+Wu88OzrY
+KPJk8fv3IwjydraLq+ff50bS4t0ukOcVTQnj3LqztPMHq2jQkOGQ8aa6lSFhRPHufPuuzh1x51/v9J
+o/ELRryxgem8RpZVvxfAq6ngMzrGvbk2+TZ7vTuR28HeldwXGE4UUAVKZQk1NGBwKoysIDN4rJhpTN
+Kdm/q2RIYEOb6YQvTuX9zt78v3nBqMR8oJm8NE03ZzTskMlFqhIgTLFqo4kVBQyUUijQcUoUQ2lTBR
+CfhZ9tAQQKpwvRg/7IwZfCsp7WcwYhCpP6bHaceFHVAkDDOKZYbdba+/uPbW10+Liles8/+p51vf6J
+JNTzJ08gYlDOu1dFm9c5eqlC4xaXZAw15ylYap/TaUIMRIvuH6WiVxQSaoIr/alHIQXYBXeSlzuyXM
+QvR3a7T54TTWZQOoaiBghE6SICi09IRAuJEsFO+tdXn3pDZ555sv84R9+IXnu7Cs/trXa/rTI1ZN5m
+jPo9un1e2QuJfOWI8ePU7AeY/AR/Z6j2xkw0ZzkPQ/czwc//BR3v+fen4wnm/8A4XDC7WuPeu9Ronj
+/N/mSiLINLMFhEFQQXpeSiW2su0JuL//PgpVv8r6FwqK9QYgAUHjvcCWk3ooGo1FIrxdTb9x5dnb23
+h9RqsnhTqfYZ1DfjGzx76KQ1HwNfe3DwsIJqs1jnxz0Fj7p+tuIpA1iVHQnTApRDMaAUgXx1Osy4Wj
+/GM7/X7jd1xBJ2RGsFqcGY1V3PRauvAl5IUqiiwfCkh6jtSZM6j+aq1ZweWX94y9fvMz6Xp/a7BHmb
+jtFc2aenc4Gq6trXLt8lc5aIdwchwmJqiBSVdtd3v2JN8+++eNpK//U4tG1n5u/vn7u2G0niWt16hN
+VVFLcJSEEikKvBlUnlD2814g0hjwqNh4LaR9GGYxGltWVTa5cucaVNy+zdGPxvs3N7Y+1d1s/uL2b1
+ZYXt9DKksRVJpsjttsdLl++gTWS6YWTBGGM1k3mF+6hvSPYFpvUjk1zxyN3c/qhB/6PaKLxo2BJh0N
+UGCDL2b4U/q2LWx40zYpB02SR0guHND3IlshGV+53buXHtOrhshzhBF4U4xyEQhAgVYQS4PM6o1STp
+wGN2vwnA9Mgtx6txjYo4mtiPb/rg2+ffHl4+q0TRHX2U3Fz4X8aitXjqbJIYZHGISoCtCsq81JEUwi
+P9znQBj/6x7iNv4SsI0QB+C1GvxonwIlCAkK+jXWZRJUSCK50ZlRUGhNMHsn/pqhcS9u5+DtUatTmj
+lCbmQcTsrXTYWV5g531bcigUokIZUx/tw/ZgMnpGLuX1Vqr2z+2ubz7YxfPXXmmeXT+P1QnGr83N3/
+03Mz8DPWJBiaJkIFGakWc5vQ7HqSjZVJUp0V/aNnZ7bG2vsva+g6t3S5raxv3ra5sfGu/O/iItfYDo
+/6QdCRQgwq+a+i7AcoqlNAIB8M+7HWGfP7zz3Pv/Q9x2x13E9QSmscGzBw5zqMffD/3v/+xn5RR8qO
+FOJEniCtFs6QMd7CqAAAgAElEQVT0u9CH8JRe3Nxn3G8PZeWGpgfAOrm7zCi7+I+lWyIQe0hhSxn/g
+yGrUBpJBWSAyCdRKKJodrFanfkUhDhfKoB/FTiZe5dVffprIfBu/V4YAbJO1Fz43zO3+s/T0RCpIY4
+sVIKCkqSLG+d8wU4vArCPEIOP2HztexWjn8cUO6uiqCVUKS447m8qcauf+7g+yYqftEIoxeTRY8zfd
+vePNo4u/p1+PMHUseP4MGJ1c5tLl6+ydGOZdJgRmJiZyWm6OwMG3S7Ga/J+ytbKGoOtPVLg/2XvzYM
+sO8/zvt+3nO3uvffsCzBYBhgsFCASkLGQEjeTFBHGiu3EkURWYkk2VYq1REuKTiKpXLTlhFoiS1YiW
++WyltiyRFKiJHCTCHMndhDAYJkZzNbTMz293P2c823545zuGVByySXHBinNnbrV042pRve95z3f973
+v8/weF8X3TZ95/j6VZv9HZ6Z3dmZu9ovNbufJuJkdj7P0FZmo1eWW27q0vj5xNsg066SlpTeZ2uWtr
+enBi2sbN507t3pHWbg3gNxX5AYtNFprBlsDptMpURQxm87Sn1jGgy2SDLrtBluTCSvn15AbE5Jsns7
+MXmZ68yzsqkBX7aVlOruWflhuGza8QEiPFLLaKPgrssFw1QV/BaZYX3Rqu8E2AVZx/vR/L7j4kKSP8
+EUdRSbrrX+lqQv1GdyHiCJvAykzvf0f0tFcvT2OK+XL1WUe5NdMtfy14vtPXf2CAiETos6uD2X2uh+
+YDooDIk6hOQU5BeEIqkqt3RbXCukRopo8uXLlZ6Qo/1Co+DIyQ5IhRIwjqofC1cnB1rvPP/MILytOe
+WFgamDoecg1mix05+nML7K2scbZlQucOnWa8aW1ykyrNG5cko/6NEXMnrklds3OYCcTNjYGmCAoBBi
+lMcFz/rTcp5N4n4j0d6AlPlIIrZhpSfpbA0IQSBEzzQ0hVFuz8WgKKLyDWCcMBiNcaWikGd57GkmCx
+JPOzZConPPDdaTTzPYWyM0lJtMpTnhefvkkcaPLHXfeRdbusbm5yUtnVnny+dMPfdP1Bz4cAc5W/Jx
+GGgESuS0sCY6A2g4jqoFMcieQWwXwGIpiFWdPzXu3+jNajomEqYxG23lhMlRUOwHeawoH1mnGw4Qon
+T09M3PoQ9DBWomSMcFXvk4h/qNGy9eK7887421zG69+FHi0AJ3NELcPfDA3o1/yOiFEmxTlCmlTVTz
+MbV2fkFdScBEEf3lJePWz+O7fIXRBtBCigZJRxVgh4HZSCq5u2lUYCGQEQWI8DKaWC2uDxRdOr/z6W
+n/MwZsOcfbSKufPn+XUmdOMt7YAaDdbRD6nmOZEGpT3aGVxJmc8yMF40Amj6RSnFWNjKI3DSwVSUOB
+rcK8gEpWlKEubaB2Rj0sEEbGOsaWrAE5Bolst4nKCFIJunAKBNAXSQJY1SPUMG8Nz2NLhSkEr66Cyj
+OFoxHj9MmdOnWRufoHdew8jVINzF4d86jOP/fpc1ji0b8/CpUaiUehKsxlsdWiWsgZRXcl+qGmcr7r
+wbbHKZHIGY87/rJYbS42oQAtZAY6pi06Fyg6GxlhBWWqKUpOXTZJ07oNRuhto4J0mSqLqfy/kFV7rn
+yEx+3oqv6/Lbmf4c4AbRpZ18EmE1OmjaZK+y+F2lz5HJ2BFUTUplKgCSepmCaGCEikC+bi4zU3ERa1
+7jxKaVbdQRBWhWSqMLypVxrYaNzicKVBSQtCsbw7IWglnV4d87ON/8gfnLm1e3+jNMzGWV06fYXNzn
+ZdefJawtorINDONBF/kuKIktzlHDu5ld28OP5lUX3cGhKc922a9vw44bDBM7IjcjfHeErBYlzPOc7z
+b1t55nLEU5ZRQGlIliUWgGUlS5YiFYbYV02vFaEoSLO2ZQJYpApY4iplOCzbHA5IkIWs2MKHEllPG0
+yFSRczP72J+bi/exaxeHEb5ZOP1+w8d+bVWo3pNtRA7xlXqcE3na4Mz4JwlOEusJBqJMGucPPFlTp7
+83Pe68vyPtzJLIivDsVRRta2PAFnibI4NEqE7GNNiNIJO65sfW1q6/u+qaL4qvpAglaop15W5+lWzj
+Z0cm6qw5Z/KibhWfP/RDyfyajtJjBQx3olV5/3f9qIkqBIV+4rytb1qCV2lpgaJM6AxiKA598rGO9c
+v5B+bbe9dIZ0Fux1b7BDyivBabHfxts+AUqOShAtrOZ/74pMfeOHUue9WSRsRJWwNBpw9d5pnn3kce
++Yk2fIc33TbUdtOI9nfWGcyHTE/n9HOUqLgiQOkUYSOFIUv2Bz3afRa5C6nKKdsB1XmTMj9GOdLkqi
+B1hIlBTIE8JZYSBqRohEpEulItKedSNIIOg1Nu6HIYs9MNyHuGZqtGB1r4jSj2emxuGs3Nx69ietvO
+Ex/sG63xluSvGBaGoKP6XV30WwuMR0HJsXmgUbW8nt3Lz4SKXAF6EhW81E8Qmp88FgfUEgiJdFSIox
+lstnnpec/xdNPfuau0yce/4iSQ+a6GY0kRoc6FDMClIHIIWOFlwl5nlGaLkrN02nf9X1pY/4FZLc67
+4loZ6tZZQp+jVbpWvH9pw3Zr34GDJXaP0ZUw9cXvAg3BWFuFcqitEfWtDDhq+G4EJVI2TtJsGO21ic
+88aWXeeIrJ97gpum/2t3ba0TcrIp621ERLNZbvLeIUHVARQgMC804hy89/vS9X3r8q/96aqDZnmVSl
+pw6eYKXXniO0Ssvg4b77nv9//Tud7z1HbfdcuO4mSXfLIJPk5ai02wy0+yQKMV0PGaSjzHCY5Vnfdx
+naqdYTIXFl67GJAaUqpQ+Eg++xJkC6Q1ppGjEmkQHOs2UZqrptBMamaLR0MSJR2lPp9tAtRxRlpC1O
+xy64Sbe8Nfu58E3fxv3v/GBrdtfd9sHSjd5+3S0tbU53HqbMR7nI+Zm97Br6RBx1GaYb1JMyzcePHj
+9J+ba8iwVQOCqpJtKFKGlxDuLrPscfqvPKy+8zMN/9KuNrz7xxY9evnRqababsHd5gWYjQ2mFiBRog
+w85QTpElFCWGYN+incLNLN9v9Xu3fGPEC0QGT7E1d6kHtaHYOsZ6X9o5bti2b525vsLyXIqUuw2Nkm
+qFBV3fyKI+fcQJrHzplav1RSsUP2qQkiUCkhpuLxyjrMnz/Lo5y/fduY4v9ZSB/+bW9+0F+JK76bwe
+BxKVYRlXEBIBd6RO3j+5dPJ408d/+3cwszcEkFKRlt9Lq2cZ/2VExAJjt127GPvfPubf+6d3/YAzST
+6p3fedvRXXjx+/Eeee/GJH1h75Vx7cuEyRV7ghEc2EqSWmGLK+tYWnd4MqUyZDIYUZVHhGAIUdoqSA
+i0jtIyQIhCrmHYW0UpjYqVpJDFCBJKGJo4laTOrViY8ndku01jSm1mks7CPIze/joM3HRv2FhZ/Lmr
+onxnn/UHhBpTl9OcGg8mbz13aesfWxTVeeO5Z0nSR/ftvoNVa4OzKOo899uxvzzdvP7TQoSCAMwEVS
+4wx6KgC72LrzIyi5OWnnuWPH/44f/LHn/g164e37dqb4aaKcipxVkMSqrx6ESomqVA4FzMtUkrbJos
+Wy2Z64CdQHfAK79VOvLX31Cd1f1VfWn7Nue9qs9i1le8vtjIikFXYV71SgpB+S2CHAfc2ZwtUrUQRo
+U7iqVqkVe76tODZJ0/x9KNnefaxDS6c7t+CbbTnm72Pzy0uV99QB7xzaFXh87yv1Ca2tKyMNI898dX
+feunUudfPzC7SaHTZ2NjizOnTvPT8V5leXmHPgeWNd7/9Tfc99M63lTceOUirmTE7P1McveXoH1935
+Iafn59b3Gynrf1JnM4TJE5KchxDU2IiiU4TvLcYW6KVJGtkJEmMEoJOK6bTSul1mvQ6LWY6LeZmOsz
+MdOl1OzTbDeI0Jm6lxM2UxmyP9uwMrbkec3t2ceOtxzj2uru4/a7XH7/u1lv+cWt+5m/5KDwsElXIS
+NCd6SCC5MLKpd9bObf2PfmwyDaGEzyC2blZ4laP6WjC2oUL7WbauGl5cf7fxqpi7jgPKlIUhSE4R6R
+jmOacf/Y4n/jwR3n4dz/yT0+eOPc/SA+znSZzcx3mF7p0ZxrEDY9jjNAWYomQKca1MMU8kTpAu3njD
+8XNw3+EnK1VPDF10FI1NxShHg/5GsKlrr5oroqgE9eK7y9cfF7twFB97firXvDwJUJ4g7f+ei1kxUe
+q5f47CDnvGaxu8exTZ3j2sbNcPOMRZZP1C5N7NzfG+fWHDn+uPdeBJAZnCVIS0AQnUFoyHOT8yWMv/
+I8vvHz6R41TdGcWGY7GvPD8cZ7/6jNcfOEZFvct8+1vf9M7/+uH/voLNx05iFQBFwxxEpM1Wswu7jb
+79x38/NEjR3/xhsM3fXH3nr2mMz97KJuZSRuzPbxWjPKc4XCIVppGo0kkI6RUxHGCllNUcCgZSGNNF
+kfEUYXWi2JN0qhy41szM7QXF9h16BCHbr6R/TffxI233bZ1y7G7fnPfkaM/3ty96x/IVvZ5EmFKYdG
+xRmhBGmV0O3OMx2W5cn7t0fXB6Lt8XlBiSVsR3ZnraDWb9Dc2sNPp0dlOb2V2pv14hasJKF0Bg+M4g
+iBYefY4n/zwR/nCw5/80ZUTr/zD3OWkKqKRxbTbCfMLDRZ2tUg6npIBIrYEpTAhw5gekj000hv+KEu
+PfD9yHnyCJ6pOeK/yYzsk9kqP9c8svvB1U3zfkNvOba9RtbW0eCrrjJQRUrZ/QEbmKRVkiqvORUI6I
+MeZkqKYMuyXDDZzcDGzrSbCzDHZnPL0V57+4L//5CPDBzL5z5aOXYeKr6S4Si0opoETJ07f8NjTz/6
+KKT3d3jxFYTh75jwvPPcC506cJGq1efMD933wPe/665++55vuJFBgyylp1qjGym6KoEmWdWktN9i9s
+P/hY6+/9+Giv/m+l8+cfOvZyxfe/PzLxx84f/b0XZdXVis3gvWMB0OKyRiAVKxTFAYhFN1Wh05nhjR
+pk6VtskabKGvR7PaY372bzuwMy/v3Prr7wL7PNDrtTyS95sMMgAjKvCAIi0gEKha42ubjPCwu7eVb7
+n0jq6uDT5fuTz74/MmXfmwwuMjLLz1Bb/Eu9u9aYKY3z4WVSzz62FO/MtPJPnPocO9FpMCG6tyej8e
+ce/5lPv3hj/L5P3z47108dfqDDaGxYonEB9xUMt6y9LdGDEd9MqMgNRgc1gS8VcjQIUl25ane9QPIO
+fAdvKjyZUO4oneoqIRVAKl6tZ7mz9K6XSu+v/DjStRdNVCnCkmRaFDJizK034/J/x/vYvBxlbKDwTl
+DXkxYX+tz/txqDTXTjLYmQMxwY8inPv6pX/QN7IMN9SvzB5YQjQxEpZU8dfI0n/j4p36nYI5ms03Wb
+HBxdYPV1UusrKyAdbzh3ru/8sYH7//xG66/niSW+KCI45SAoMAQqRjrIUoqPguj6ndJZma4qXPs4Rv
+S2x++c+tuRqNBc7y+8U3Tzf6xyVb/xvFm/9B0NN5jjFmQ5enu1tYgCxY1N7vk5ueWpllzpt9sdNbSV
+u981uye6iwsvdBdXnoGpR8ji8ckUJZVYam0eudjmeA0WAwWg0Lhg0AnCTFw7NY7GQxKVi9v/vjFzbV
+v3ZwO7u4PLnH+/AVSpTiw3GNtbYXjx1/g+kPLv9Pp3njrzHxGaT0mzzn5wnE+9ZGP8bnf+4O/u3Hy9
+C/qSQEURCyjvEf6QLCKySRnc3OdxkJMM6vSi0zhCQ6ypEWazL4f2XsRm4KrzdL1TaJC2m/3VARfX6a
+hv4zFJ0bVNkLIeqOR1JniIEMKpL8aVHK3S7LvkaKLzc8TucvErsRcXOHlF5usXZhhOikwE0/iI5Zb8
+1Bq5DNDzpon//nZUUfPPfC6f6aP7IL5FpMLF/jov/k3v/DyK6dvKW+9hyiTXMo3OXHhZV448RQmv8x
+dd99sHnrr/e9554P3MtOJoazU/iDxEjQRpQOlxgQdY4QjtASxjiAofFlFac3Oz9Ob6405eOARoXjEe
+EthSnywBCEo8xGXXvwEXbPKof134GdvZ121CZGj6R0ZTbxImUYOKUs0AeUTdARWGMp4vLMB2+4Iylq
+LEomKFk2ISBPLHcf2c/ny/WxtbL7nsSefP7l2fjN6KvwuStxOt3eMqBd46ZUT/Pbv9W9RvOsX3nDbs
+e/X0zGnnnycL37sY3z1Tz7196YnT/xi25cktcjMxCfZ1ztIK8yRXkxxl2bIxwm5yZnBIwcSVRzCJm/
+ANe//51ty/69qoCk8Qk3xIdk566fR1czVqH7+6UWuDnO6Vnz/f/Q7r3yUyLoBI+p5uJARQqXfi0tvl
+7LxBmwDSQM73mI0sozWJ/jcEYqA8pJIJyQ6whlBpCRnT53kjz9R/uI4jNoPdL/1H/vJkM9+5o+//dH
+Pfun9QUnSvSMKr1lf2+DFp5/m0tlX6M51ef29d3/Xt77tW8/F7aSyOGl21BZSSKLtzreOqlVGCoLzO
+BcIrto/JVFc/3oxzlUgolgpoiitxyyeqUrIG7O0TYlo9FBZl4Zsg7JkOFQZoUQMosJNyKB3On4BUGT
+sRFTvkFJ9/WoGnDEQKZJGytLuDnfeeTtrG8NzIoq+6/Nf+Mpv9C+scKbVJA2eTMesnjvN+ePHyYx9f
++hvfSIui49+/pMf50uf+tSPDi6ufDDTEcoEQjBodJ0EBT4vmQ4dww3NsO+ZjGA4gaZuEiVddNr9otH
+x95Y7IyjJTpz1X4LHN+jKF+3YfMTVbs0aQ159KUHSfC/Sfl5GvRlnpvTHigsXc0aXxqhSk3gIWtOKu
+rSSjNJ5GklK2omY9vs8+9gTH7TCLAxE8cEvPv3Ub5z76suoJKHVeJlps8XJs6c5/eyzdLtt3vaWB3/
+tzW97428evGkJHWp5FGabXQciQYTqvuy8IkhR+d9UHaCJwgePs5YQqlQfESofm0ShZKXOMaUh012ya
+JaUAnQXaBELTUBXYMQ6CksLWXnnRI1FrM9ikUuuOA7E10roQEVxzaUQKA37D+zlgQfvpQzmN8+tnHn
+Ls8+Nvnv99Gm+cu4MmY5x+ZTpeJPpygrTc+d/Iwv+4MvPPPljq2dO/VALiVQagiAmodfuUGpDR7dIZ
+ULw4EeeyaZnMs7IywbNZAGd7tkkW3zvdljnzqolrhXfa92kfdXsZpvTXNlQxI4RNsjsuCB8J6r4vdK
+N2dySnD43ZXpxSlREZE6hgqalYxJAK0UrTVAV0ZXBpTVOPPPcDxWKH2rbmEPtBS5cvszpR75M3My4s
+HGZFMf933bnyb/x7ne879gdN1OGgFIei6nmTsLXQ34JIULUANyrcyIAgvD0tza4cOEi7XabLK2CHoM
+QqCih2UxRCiIZ4S3gEqRPwMYVp7L+1V8FDwrU7oCvmZK6qzg1r0qJuvLF4KocBqEVOpbs27/Esdtu4
+Olnrnvf5NLW/aurq4eLcoLF0yBmVqTYwYBnvvTlpsyna9pZZuMusbco70hURitNyOKUTtaiFzVpxU1
+E6hFFYHw5MB61COyBdA+kB74TZo9LYpQHvQPUlfxleXyDrnxy5/r62rs2VIGOMo7wZCjk7yPt9wUx/
+aXxtM36uqLlW4g0Im8HjNQkokumWuiGot1uU9qcsSkxhSMpPbGOSOM2Ytf17Ern+czzLzHsXyai4Na
+bb+ftf+1b3nPn0RvDbLcy4loqSJDHVnFhQtacegNOoCK90zlyziK8wzvHhdWzfOGLX0CrmE6nQ7vdJ
+Y4atDodFheWmZmZQydxNXP0dcu8XsLUTvHVPQexXX+vWjcq09TXXsDh1WqsKtG6ztRTgiTWCN3ghiM
+HuP++u8Pqky+9Z+PMqScTAomMEd4x32jTUAqz2SdyjkgrkiDQVpDphJlmk1QrvHXMp7M0UHRlglaCQ
+T6h7GtCuYyKb0Rle74Pln8fOgQv0dsKmlf9kNeK77WctO98CFff6eutlUfVsyCJlPyy0uWiihb/d8Q
+CXZWTxJY886BipE9IZEYjaRDHMT4ouiJha9yHYcm0HJN2uhxsL7A7mydTXY6fOsFYGL719ff84Dvuv
+fepvQtNxgZkHHA4rgAL6qP+dgC5EoRtbJ64kk+nooDUHmMnDEcbKO1pdxo0WpJWOyFOBEp7Yg2TwoE
+oa/ZlCcHipa6htG5nZ1A56AxBOISMaqW/qVwZf87rWsWu1ZOx4Ei14sCeZe6755tZf+LEU2unT/zg5
+tbW/9lSEutLVDFBCIW0JR3dQJgSgSMloqVTmjKhnTRIOhFLrR6xDbRUhYDXskXa2suu2WP0Zm79X6H
+3y5YGmgbCS6KrwMqvis29VnyvzZwvAG4HzhxePUmtJUc2VJKyBEGSLPxkp7n79m5733ui/BTTcYnMK
+6ye8IJYC9JEYcsxG/1N5udnaSmNDBJJRDMkxCEmNyWvO3iYxUaDsTR/eMvu3R9ajBOkhcQanA/oVNU
+6iiqa2AeB8PXXZKU/tNZWmQNa4pxFKsmufcvcfuctXLp0iV5vlsXFRXrdWZKkiVACE6Z4U+JlIOgcX
+F75F+WEIDv1lKtEygiEJghHwBBQtc3H4TEEPb6y5d3Zpm7fKGqynAJjApSOEDyCgHKOXpZx683Xs2/
+3wofsePTmRIW3K2IyKQhFTlckNGoXSUZEJ0lpRzGZjOkmDWa7PTpJRKI9LSkJ2jM7O8Oe6+5iz4G7f
+0cke34yJ8LVISq6ErOC8wQpEDWc+FX3i2/QM+A3ZPEFcTUtwFWev+Drs15FHAtU71nFAtEI1RLtZO5
+f9hqL72kkW1glsDqQZS2CV7SyKk+837fMdJtEKuBLQyNtEmuBH+fkY0PwgtKVHF5cxGbqY/RHnH3qW
+Q6Lo8TLXdARFGFHyOsFuCBqvkmVXamErnDqtdbCuoBQ0OvOcOOtRzlUXo+UVRc2jpNKEhckcZwQ6Yh
+BvglRgVAlaAPaEESoBOfCsY14qP6I6qMItY87YITZwdTInSK8khZkCk+UVt1VLXSF5Chyhpc3WD1zl
+ueee5rxpI/S7mPCh7drBJQez4RW3CYLklglZAjaMmY2bdJptGjoGDEpkcGTKEVa13u32WXv7uugd/h
+fYmJhIxHc9tAgVO8xwRIQVQMpfOMX3jds8W3T4bab5UpsJ5xUhx3rDEFERLIWljkBpQvjtdF9o7URc
+piTyJgkk0Rao6Um+JxBf4qSEik8ZZHTzFKEs0QiRiqFdxJPIDjLeLCJ9sn/Nb44/bZnPjv+wOba2lc
+PH7uR3vICemm+0iZGgjpMh6CrwBdb7wyTONqZtUVxmxAMFk+vt4y1ZRUGKarsh8pQrBBIXAjotCJDu
++BrIphgW1Zs8CQIgqiARdXaK/FB44WtBwox4NAEfI2d10rWoSugoqiiZVtPaQxmPOLC2Vf4yhc/xxO
+PPcpnPvGpW6ej6U+5snio+u4RGsGs7NKQkqj0zGUtmlLRkBEdFdMUikxKmlkDbQsaqSSRgSiOcJMJ0
+7MXyUb+PmLx+9ujuh3mSrAgPEJUcncp1Dd84X3jrnxXSV3kqyJN62y6SGO2GzEehHG49a3rB6tr7wt
+bY9IoxkkHSLSWFRHC1Yk6UkKIdy54WW8XvQuVodU5nHdgJGZsKHMesoP+Q3Yy/ZnR2uY/StrtrSPHb
+mHx4AHY16pWwClMhIeGpAafVabPegWvBOLxVSL8KgY6IPChXtmvijcugsUEgduGPHmJU3WAJhkhVNH
+RQUe1jSZCBoEXMRJwxDsCoUhYnC/xtqJIl8ZjvUZJjbWei+fP8/gXv8BnP/0Jnnr0i72L58/9hED9S
+JHnSOdRIiVSglQqUimJgYaSNISgFcV0opi5dptGHKGEJMYTR5JECaR0SFXtWszWiGxt8300s/9bxbz
+s1JVgk+09chAe93Xjxvur3HB5FRPr6r9fsZN4AgkCjBXDldV3bL5yRoitMVmkCVrVYKUauSPrTHexH
+aioELV41ztwweOExdeQCWs9zkFuDZMyZ7i++SPr5y59T9DRP1k7c+lDh4/eOLnujqM0980jZmKaXYm
+ThpySlGZdSPUY8KqObZAgRXTVKEDtQLy2bzzexRBiJA0QKXiNldRhKhLh69m+Ay8rUbivx3/oajIa3
+DbIWVdzSVmxPtMQGE1Lnnn2eZ588mmee/opnnv8scbLzz71D6bjwf+cSTrBKwSeGE0qNZmKaHhFS0U
+0hGK+3aCrU5pS0U5juo2YRpSAt4gAWaxJYk3AoyKJloJicwPOrwj27H5H4vj5oHZSxF41D/Ffh5kLf
+7W2nfV2Tb5Kx+d3znq2fpOEr+VdRZ5MVi8dzVcvzjXKnFhHV2BMoQqZ9FTbGikCvj4/BukrQhcgpEN
+XzVPiSID1eGvxJsdOppSTknJcdpyQP315de2HL54/9wunz7z4S/NHli4s3bjM0k2LpPMpUhYgFisWp
+VTgVXUnD7U/zV81+5NXwk/U1f0kkSCICV6D11VE2HbM2tUJRRK8kCh5BWQSqDSTwdSNqpBDKMGVbKx
+f5vS5C3zuK4/z5S8/xZcfe3zX5qXL3xem0+/35bCXAJGsUjcTUlpRSlvFZF7SEJqGUnRUxHK3R0trY
+g+JEMQyEElLEB4pBFF9RPBSEJREKUE56JOfOz2X3nLkqGx3kxhyBzUfpj4s/+VpdH5jr3zbBXhltZM
+7e7lqmxYqu633MBzvyS9ffC/9LbrOEym/U3zOORSeIEQNSAoVk0RUhelCteohAjKqCq8IlaNdElAhE
+EyVCe8nE4yHcZH3htOND5xefe4D/jHzL3oHm7929J4b/v3tf+0W9hxeBj0EkVRPFVORliNkqLDvOJB
+U2IsrAKkq09o7V3M2RW1UrVYCvTPkNGBrXikGIad1vrUGaYlCDqEHlOBGUPTxeZ+Lqys88vkv8IlHP
+sfnvvzMfZc2p989GJj3SXQ1La1faWsDs8S0dZNO0iAJksh5WlIzGzeYSVI6cUwnTolw6BCq11tWabp
+KKZSXlQFWK7yO8ALMaMBk5SzppfPvZfVX5S0AACAASURBVD79J5rohKcSpm+Ha1a3QXut+L4uDn3bs
+7N6K1J196qEHomsLsjphMml1b8/vnhZJnlBSnUnrjieAYUlyFDL1KphuNQRPkisr7EE3mNDdecOQlC
+OC6zJcQRwDucsRTGltFB6S+Es07UNpusD8qj/vt4wel/aPf/k0u6t3+o0Dv52b37hhFApRA3QTRAdK
+hZJC0hROgF0JZUL/qo9p0Xi0DTRuDpQ0lVFJRICFilzoGLcICZIOa32mEFCKMBPYHqeUAwxky3K8Tr
+DrTXOnDt93cvPf+5vPPf0U39r/TJ3GF9BsIO1FMESI4lJaTUa9CaBjmrQlQ0iD7H29OKUhaxFL0nRP
+pAoyOKYWAh0tN0cE2gNDdmgjAQiq3I1pIqQZU6xcQnOn5YcmP37JO0flFETJwTCKZTabqdpvr4AgH8
+Vi09ckU1eLV/3XOVUDuBG40OXzq0cmmxcVqmHjhB44eviq3LhJKCkrs93onZMCEQQeCGxwhCCw3tbU
+a2LHFeWWOkw1lGaCYU1dTRcQATLJN+iVH26PTiwO2PPLHckdvWO8aXJB2Xc/IJSyce0bj0sVPdRrWc
+QqodQMwjZAtWugjG3CcxCbOeVIbCEoIEcRQF+CmZYEfdUDnZcubxxYIe4coswzTHTkrwckTMkv3SKf
+NzHTvt3+aL/1vGo/4619fV7YnmB66+DzSms9WFaVq9xJGNSH6NkhHGKGRLaMqMlEiIZaOqI+VaTuax
+BpgQ6OGIpiIVAKo/Scmf11rEgFilWemSaISKNlBBLiZsMyVdOq3Sw/xANechHyakg9I5hlr80ZfcN3
+3DhyqD4yj70VYEYhEAxmswMNta/vRhPmBGCTCsmZVHTAB34ahsXCQg+YEPAW0+okxyFEFWR1zh0hyO
+SgpJtZF9OnueUxiB0hNAKpav7s04li4sN9u+aYdd8g3bmScSU8Xj1HimSe1Ctn5aic1HquUe0mvm8i
+kZfEar3hNbjSSAl7HBnFLrWVzlvMDatVl5bQD6EsMFA5IgoJ7Mjys0xzhsmfoNxvkq+tcVoa9jYGq/
+fOXabd6v+iXvLyfD+RNqlRuSZjIas90cEH9i9nHBwVGDPwKSoFsxEJ8QhQRMTxwkdH9PUGamISJWgE
+yf0Gm2acYz2hkxFaFnZo4K3SKXQuiKNy0jhS4/1vsL1I7CuMsD6PGe0uUY6Hny7K9o/RSucEuJKNPd
+2k+pa8b2WD2MhhlxAiSRBkriKk6sFFDEYB9p6wvrgR5PVTblsPc0ENtYuEssmWmucUlgnyEuPk55UR
+TSFrhiYoUCEymbqlKWILQOfM7QFZXtEbidELsKNHfHQ0kTTV5Zhq+RyvIndPWXXkZT2zU26Bxxzu9Z
+ZSjZoTQ39eBcwwoUBQqwsRVH0HVEUfUd1BvXoqHHcWY5L3XhJiuQV79S5INKLSiWXcaHvB+fHifXl0
+AY/GH1J+qDivAzNydR0TennN/qjJVO6vcPh6GC/3z9SFMVNwYubiqJgmo/Joo3qeAzEcYVfdLaN8Io
+ZmbBPXCSJA3MKhjlIMySLNFmakkQtjgymRJHEZBLbUESdmBCD9o45H9EKAu0VIY4pYgiRIsQRSipcg
+LxxHh81KLUHnyBKyYzz9LKI0eo67sQpqeaXflSF6G8aD6qeiygzpKEMQcxcK77XtNvCq+Bwr/pvzlX
+HQZfndxeDwUEzyVGlwTpLrOrcu51/X1mhvajOdYSAweFDRafWWqJCwBcG70oiAsPcMp1YnI8QcUzUi
+7DBYooBuR/S7Dhm9qUcuq7H4f0ddi/HtNsgoup7OlvNGEIAX+stfbB477HGMw7jm6zhJoGGEFOWjuC
+r2V1ZWkajAQ5BPrVMpiXWVVrWae4Zj3JWL22wtTmkMJY0TQHJeDzGW0eSJIzqOWMcQ9Z0RFFlYxJUO
+InDN+xjbsHS7m5x4sSEyxvgzSaNVoP2TBc/SBCNhFYzQzdisigmEwKpJGQJ1lXAXKkFiZIgBUorZL1
+6i5rPKWsBgQ+WMjiEFZTGs7W2Rm9r66BaMHdLGX0l1PmWqKhq54ZrK9/XQfFJoquHrpIqn0FV/UMzG
+e8era/f7qdTlDV4Z4iTiNhHBARlcHhV6S1FqMYT1nmCtjjrcd7jrcfZkmI6xJqCoATFBMpc4ZViag0
+jM2HoBozEJqprmNsVceONPY7c2GJpOWJ5JiNVAes8LkqQchvs6ncQGN56rDUYY3AuYMqqILyT5FNDW
+XrKwjKZTOn3DVJqxtOCrf6I0ggCMaNxyfrmiNGwaoQ6BwRTZaFTfe5cTltXwTFxQxFEio4CzhXo2NG
+KI8ZmSNJusetgB6dBvTJhPIRCXGZrWjBs7SdppzSaTVpRRCoVWgaiSCFaGYUtEUJUNi0CWqmK4amp9
+JkuqmRrQlb6XAU2VDkapZNML14kvXz59uae6W7VjCq7owAhNdvJD9eK77V6SMnVbZbt4gsCrNzWK3r
+Ga2vvH11YTcR0irKWYC1KS2IUxjmUr9DikoAXlb3HBl9hA4PHuJK8NBRFgTAObT2+CBRT8CLFxgljY
+DM4xqEgNAzz+yUHDkfcfH3MgWXIspxWFCFFggkxZdxGUNQz7QpDDwEfSgiO4F1lgK8s+bh6oBKswZc
+Wm+dMxwVSakzpqsDM0lGWnn5/ytZmrYuWCuccZbkdoSBxzpPngGojhKclIqJEIWyOcY4YRxSmBG1wj
+NDtlKX9TYglK+dG9DcLxqOCc/EScUMz18wq8bSUxInGKY8RDhFJSjzaByIX0Hhk3Sl2ArRUFXYfWcn
+5tMNLsKq6IRX9LdzaesJo8H6yzkeErAYMob5ko2vF91oWXz1Irgkp29sQLyungwSKwdZbBmfP3TK5e
+JFWnhN7hzMlLoC3Ed5XWQhBhtoB4XGumptZ65BCYrAVOdp5lKhyH2w+wQuNShOKNKYfpgy0gqzJzFL
+MwZuaXHdQcGBPi4UOCGmJtcNLQSk0RZRAUSJE7XBAgHdVBzPESF8NlqsbvAYX8IXDFxG28LhSoVSEt
+R7vQcoq3dWUpsL2SXBOsN535CWkicB5wXBY/ftmU7I5lOhI4aQgRCCUxQCZAl1OSJoZ1njiSNOamSF
+qesqwihF9ihzU3mWypT0ksgFbOcIJsjjCYZmUOTpRKAJBVnoUrxxSGVCKEBzGVTcUhScoj1cOpz1BB
+YT2MBliL12Ctcu30J17i4iyj1tZye5CrTu6Vnyv1aRBVFtOEXgVIc7tGEhtOllfv3WyeqEnhgNSZ0m
+EYFpN5gjegncIb1GiTo5zFu9KvAfrHUIoSu8oXMnIGArrGRclk7xk0jQcOXojSzfeyKqZcrp/ga18l
+UZzzNLhBnv2CbodTxoVKFmidEKpIpxUjDE0VMWl9EIQgq9XvmpvJYQmeA9BE7zEm4ApDDb3uFwRygQ
+tHCY4TOkoC8d0ahlPLc4qojhi0i8wFoyB0gacDeR5LcQTgThUWQrSQBgZgi4Rqlp5/DgQ+5LgFRkSF
+ac0eg2uu3mJG25t0m7NcfD6N7EUZYiVTTaffpH+2haRV7SkJpEVLkNIUUXZK4+PFD4WICwieGyo9sA
+imGq1jwKFMkhliBBEpac4fw7OnO6xuHgrWfQISufVHkFdm/O9ps1OKruJuMpAi9zmkVjsdGDGF1beV
+Vy6mMXjEYmzRK6swA6hEuiGYBCyyj8IziBsXkMgQSrJJC8YWcM4OPrOMDIGkaRksz0OHJnhW97xxsk
+db/q278yj+HOvbF566OS5F7/v8qWXblvulizMlmi9hVADhJrgJXilKo+csChtkdIjQhX15Zyt/RkOL
+yobUjXeU/hgcU5Q2kDwleazdKN6wCmZ5lNGY0NegHGK0kBpBSqJUXjGI0Npqu/lPAzHjpmWw0mYWMN
+0nCMiT5JVxyk3EcwkPdKsTaO9RNZeZKa7l11L13Po0M3sWt77dJku/ZK24cNbJ05/i86ifzV9/nTDr
+o+QhaMrU7A5XkjKSOAij0tBaon0DmUcQcfEVV5R1eiSDhdZgvJELhA5z3T1PMPTJ7L2dYfexVzn54h
+afM299lrxvRaPbSm1ugqZcKUX4zGDzXdN1y48aC9fJJ0OEYXHljnOF7gAxutKoBscwllwJaLIq3OVB
+BGnjMsJW4WhUBGjVDDUETNLiywfPOhe99++8SuHj97yAXbPfVIZx/7lI7+864YDv9zfuPXb26p433T
+txLspL2DDBugRjhFOGnTi8cEQ3CZeiKq7KSpIbPCh0piGgPMB7yUEh/GO0o4xzuKEx0vHNDfEUYpQC
+usm5CVYLymtYDg1GK/Y2CrIS4h0jBewNSgJARpZwsiMUV4QyhInAkkKMslIRAOIcWGG5d1HufnoHRz
+YfxOLi/uZm939ER01/4WzfHRU096iRvzvombW35yb/anp0y/dXZ5dV8F6lFdIGXBK4aJAiCTIil0jh
+SdKmkTeowk4GbDaU+pQB9EGdDBM+jl27SIM1h+kXH6XSOIPOxlfK77/7MXl/Z/yal39udv+wbczh23
+FENIK8umgM127+NbJ+TMlW+txIxhi4Sl8jjMFhfGUItDMGrjSMO5vIQXV3Cp4ptOS8WTM0AXGArZ8o
+C8FjX3L4egD94l7H3zwl9qvO/BvUfoRpEM1YiBCRglLy9lHpTUfbSZzh0Sx+d+Z6crfzPOVW0t3Cee
+28GWO0A4nN6rsOi2Q0gIFNpSE4BBS4pxBSMl0lNMfjzAYVKYwefWzTUswLlCUgdJLSge5CYwLz7QUD
+IYGJyRBCoa5pcirZoeOIoSOOb82ZHYWOp123cJXJI1FDh26gT37DnDkhps5fPgGDhy87qtJ1v5/Bfr
+XpUpPVYm3ZdXtl4K402bh6HWfnJ+fLYu9e75j89Hn3r/51RdDpr3oNloEkTOcrIN3NLpNhHcMR2NCL
+NFxghSC3E4oMZBUZ2CbF6iyYCZJmVw8y8zKqZIbD75Vm/jTOokHAXb0rl8bnPq1CcbXiu8vMkm46sX
+7s15I97V7fr3dALWosmiXq6u3i/WNWE2GaGdrf41B14JqG0kmZogtSlQsEc4zHo6Y2BLZyOgPpqxbw
+0peUrRbHLrrbr7lrW+/fMvd3/yb6cLCj+WZnlb709rxgK0HHhFCxUSd5ins4k/r9u6fju3lb7blxf/
+KuovvdHbjVhcmmNIRXKi9gdX80IWC0hUE6yjtlOA8uXFMnaAMIIJj6g3TYEE1MUimzpIbzdQqcgOlU
+1VSQaRwhaCwlkkRKG31OqooRWVtFnfB0tIudu/bz8L8IosLuzl4+DqOXH8TS7t2fzVOG7/f6XR/N0r
+TLztjKL0jkqC0IErjClAYAiZU57l4ef4RncRf8Yn2arH9t7eef3khH/TRBXQ7c2hpCEWOd45Ob4ZBE
+XDBUtbjBaVcpTgyHm8sOIsUloQcu7Ea67WV23XWaqdJGJTXAEr/5YrvP7Tx9Nt8zu0ZkKja8W5z64H
+R2bP3hI3LJOUE6as32ocqzVZLjUsCRZlTmAmp0EgpmDpDfzrFhkCZJAwJpHtmueWee7jrLW99/PDtd
+/zrZHb2Q15IjEpqnb1DBoMMtqZXVF4KG4A4RsRzaGa+rMPClzG7fhy7eRNu/Ja83P+msizvN/l0xro
+cR4FngrADSj/ChkphU4YRRmQ4keOFxzCmRGNCRlFaBhPHuFAUJmFqAqXXBBVTmDGGCJU16LZikrhJs
+91hbnaeTqfD/v372bVrD9ddd4R9ew9uzs8tP9Jo9T4dR8nHkRwX+so8VWpFJKqcQE+ODx5NE+XrAbm
+WeB3Bwuw0a2U/oPctvJLPZH9n8sKJ15VnV2g4T+ShsAU2SFSqifEEW2IpEJFHa4mzFudKpK0FByEnQ
+tNfOcns6b33iKXdD0Rp5zeCSq4V32s7Y6+REWGHJ1HZf6bTrt3YfK9ZuRBUf1MkZoqUUDrD1JYEL5B
+SMTUeGwwGgzUlUZRgIs1QwMZ4wpZWqKVFbn/g/vL+h959eu7WY9/thTw59o4ky7gSOqyQ+OoZLEJIA
+oqpZ8cAK4UkYRYRZaDnjhPM8TSLfj4tS0w2udPZ/PXel3dZM76jyIfHymIYb/XX8G6KFwOCGGBtXmk
+kozFejTBmgKEgzkpmdKA1oymdJIgUqRtMCk+StunNLDC/uMzi4i4WFhdZXFwue73eM1naezKJs0ezr
+PklrdUT28YQ52uHUllvFlQgikVt0rVVkIpwkBvQGi0jcIGJspRC4rIGan/yK91UfjLpZP9uqMSB0em
+V2E4CUZIi0Iy9JYlDZd4KHhUJNI6yLBHWIp3Ay4DHosgZXTpLdPZE6By9/b005j6m0H2uQXP/M44S/
+hz1rKzV1J4qLRZVZeeRT47ZjY0lsdkXyXhMUuecG0oKnyO8QlrJ0E8AsKLK5ekXlo1pzrq3jLOEeHk
+Xtz744Pib3vqWj8xdf+Qn0dELQick242eq54aXSMAq+6PoJKwuat6QdZDFDIIWW0RkhBBpHgigicQt
+bvV5YRQ3LAHe0Pw+eGiGO83xWRPwC3h3VxR5jOTyag13VrN+qNhVBovG62ez7KuCSqdKpWNdNrcTNL
+2ulDxxTjJzsdp64zW+qRQ6kWl1Itaa7RIdzbuvg4bCaFizWyT+XwA5331XoiaXk1U0cLVtsui9lK6q
+mliqsnrOF5cfKYR1Lua6H84TpJ3mwurzbKYYF1OYXJ0UeCFwUmLEJ5gHaK0RF4QaQW+pJQGrKeclBQ
+XVwRba0v0lo8pGX/W6/ha8b1WRRiEZ8chtsOr9NjJ9Nbi0tqxeDIls5YYg5DVaEHEAll6hAsYW2K9x
+3tBieLyeMK5rQF0Z5m74fpwz7veLQ7dfdf/0rvxpj9A6pdyG0h0VWy28MSJrIfE9bKLfBV4Vl1lbJJ
+chZp0QJB4VceX7+ji6k+iFAEvgnlReE+aGFJntznv4BxlWSCWVlhfX6c0gdm5RVqzC4AiyASRNCgmO
+UHUPjmtqpHFdhNLSiZTi1KKKBJXDOLbXBl5lY5BVr9QCBCCQso6pTdy9TIZQEbEWte58WAJKDTp7Ow
+L7dtv+d+6s70vb7z0ws9eevnFMNkohUPTnBY4THV6dwZlHdo6tIjRIqKQghJHMFOkMZSXV+Hs2WMsH
+rqVrPPZa9vO/8Jnv6sL0WOri03Usz0BFKY92uz/8PrZ8zSKksj8f+2deYxd1X3HP2e5975t/Gb1jMf
+GO/bYYBswBgMBgp0GXBkqIG2DQqqoahU1SEGqUrXqH5XaP6q2qVSlCKqqTdp/0gZFbYIapS1UJUogU
+kRD2Yyx8Ybt8Xj29S13O6d/nPvevJkxhQQCM9Yc6cqekWd83znnt/9+32+MTGJSz84PwgImTklkndh
+YapGhZgSJ79G1dRO9u/ey5cAtr+07dPffic7OJ/F9Ujw8PV9TzCkJhNlLqayZVC+IR62JkVI4DvcmY
+G72zyxYlSzoUBTY+c9nRJYJVWAD0C1zUp5rhsZKgqogIcTPd0LQ4cQlAWxAUMjPW7amwnLT4xII8u5
+9LWBMTGpcptXzPCwQRTFaa5T0nRIxztLYJKMY81OHxy1sw4ijwHFfpILUZvRnnWve9kr6a+1tKgkL8
+rft6bP76hOT+PUJIhJiU8fGMaQpOTQa6cotys2HRVGITRLmRi8z+tYxejbv+grl7m+igtlV4fsIhW5
+BBrTBrdMAP7IQ1asPzExOBBMjo+TDkDSsY6IakTDURUoUG2RdYKshdS/CCkW1HjOXWDo2bmH7gdsZu
+OuefyvdcMM36Oz6Ll6+OStO6p55sORaNhnugfUXwq1LiZQqQ45OsTbJujL8ZqiSMtNA03Q8Dg0uBwR
+WuQkFgUQK6XA3WzCirAVlNWEkqdddQd3HA6EyRGpJmmRVmAzHxS4a/4jTEGtTlJIZv7uLow11LBLfl
+xm7qyWNXWyttNtuN1GegM4m7RHExuLHGUW3BWkERkIoDcLXBFvWP7mxlBssFwu/OXLi9P2FmWGkgSS
+qYxLXbKCFRBhBkiSInHQOfBohjaEyOUH4zjk6J8YD1V95gKDtm6vC9zHFfIIqxiT4op0kAc8z0s4Mb
+UtffX7D9qkTeLODzMkKM4FApAG52EfUq4zXp5iws4xX11CVkqjcSXnnLq755Kemtn7i0E9yG7Z8oWb
+9GV/7CJM5gxJQCVbFJKSkJAS0z88zyXfbVk1DP4iFL49P5/v7/FkW12Hm2qb0TSd5/MIMXbWTlAIP0
+k5Cr43UM+i0ii8KrglLgSFGk1lo6XgkAtkSM1lwOJ4tDerWzusT1cgutwiwyTewrZu/xHhLUaQ94/j
+yrChgutq+J29a+8O2nTf+0+Dz6taRc+fak0vQqTyCoIZOK/jxKH5SpTZdJwk8ZizUdY6a9fCGh1Gv/
+M8GOjq2xR1dErRJjCEQHtpCGjokNGwK2pJgSRzKJxqBb7XzDBIgvzzu+YqkfHFWwfUnWgG1arU0Nnj
+5sdr0LPVqhSiqY5IQEYdYE1ELq0xVK1TSBOvnifwcaZCjf9sODh05OnT7PYef6OhZ+6hBTPg5fyFCj
+23dKpFhiHzMhyZla0dCE0RJNHBHPwTP44M81s670Y0/lVJJEAQTxWLx0YFbDj5xzcDAUKFvHUmxjbo
+fEHoBsQyIYoGnAmQsCKx0j4QorDJ86RwMX3jM1GslZWOkSR2AgQDlzHdDW2S6US694GLV8n2gFeAhh
+EeMa96tTc598fLp8+3x+BRerYaKaigiZAqVeoQ1PmngMx3GDE1OEXetY+CmG5NbPv3p6rqDt32Btf0
+/RQfjAq/ZKqpFa8CkmxZMLoMGJyll85Jn2ZCs/CGQQr4v4fpFhw3N92tZvu+jlBpTW7Z9bYPnvVDqK
+H979u2ThcqpN3U4WmeN9WkL1hDOzhDVq2jPR4kITynCNGb48hl6x8+167D+RR0EX5VCZDGBahj2pqK
+UGV43GTTW/++prArfksvxbu6nNpBKSSwEnqG3Mjq2Y+r0ed+bmCap10jSCGvqCCMRVlJJYMJqZoMct
+tDHtbffw8HDh/+j97bb/oZi8dkkjLG6gEETpZacEu5MRUvWQmoH374MhG9JHCzEPFvTMjm/xVaw0Qo
+mpSQWwXhu/aZn17d3PDLb3f07Fz19dFoopseGSecU2sbYNCGnPMKw5mYfpWVq5B3Mhbd8Oz2xg2KhV
+0o1bI0AqZro1q4yIskqUFhMJn6mOQe6Knzv8xCvKICRhJxwEVi1LiuDg/dHg4MEk9OYKKQe1wmjKsY
+oIlFiNIwYlYKe3ddx860HuO7wI38ddHb9I6X2/8XTGN8B8hlALaagaiQbLRngj1w2wpeZwWbiyeKGg
+OVH+f+/h3JoIoIb0yx3xCrASMi1dX2/uNUf2uDlzhS7er48/uorXDp2jK5iBzmr3VlUa5i4jhIxszM
+Vzrz+El0HL9zvl9f8EcUSQlhSFFa62qpqfHgrUYKFkxCrlu9D0PjksjpaQmVy+PHqhbO9ufExctU5S
+GNmowiLZC5MmQgrRJ39XHvzAa47/KlTG/fs+T7X7H7cUfBIUqFIgSjLSTZZbiVLEQvs8ooZhGhkZJZ
+Xx4fJYlApZdNFbgihEC5HaqxPJA1+oeOV0rbc46q4hkh6v1yzcvvEmTN4oaEeVYmNwCQGKRL8esLYq
+bcRZ071dmza8Dj5/B841kxL3CJbooXPT0iZEQeAEGa+7LMqfD9v0OOBNQjCHZVLZ/fXzr1JYXoEXZk
+iVhEzRpJIn1Brgu51XHvbXey5/+gbwXW7/xIveLoeC3KlwKYCIqCWuKJzE6buXYJzK+Y7XJZNzLc44
+fIRXK73ihmVUk0BXPwzUkpUAkJlfbBgY51H9m74/e4b9culrt6vXPjJj6+ffPMNpi6eI+fn8UyIjiN
+yQhGNRpw79jrbdu/aT3f3Dqw+CZDYFIxECYHXCvJpnABaTKZLzUIArVXh+xldTwtxGAnSuZ760Ok90
+cUTFGaHiecmmckZ5vw8w3Mp5a713HToaGX3ffedYWDnQ5QK5xFEAUFz6l0CBa3nU78mRUm1VPjE/AT
+Tsst2tuyPWAamWQhHKf2uMXt2hm6YClKh8b1SvdS/+Z/b2jtfzLWX//WY1lsvRNViPCVR4zGqWiOXK
+irTKZffeoupSxf2tG/a2EObfBuVs1JohMqSKylLqK6Xy9ktOMeV4mouiCEM5PzAzgy+87lLb7zUy9Q
+lVDzNXHWKyPcZsz7d19/KgQd/I9195OGvs3Pv5ymWT1nhRQjXFS9tk7C5WZVTGHzZ4ANwnHDuaSXj/
+OgSFo3Pv3gPkiSZF0AhIFMey43BZ/Fo2Pw7O/g/bSGXPa6fW0dJvu2U6lv/+X33/8rXdx05mkbrrmG
+yWGaqUGYoEkwJOHP6NC+//HIvlcrn0J6N0ihrS1hZa0W6nWkMyk/3MjV+pHb5ohUz4yKVMWkhYDQRd
+F9/k73urqN25x33fpn+Dc8QyMFQOrg8kaR4mWFTC7SjWagfRUOFZow6SOyyKDRcBUulWYlEo6xAGde
+iZiSkeBTKPa+qtra/2HHnPSeKa8pPHP/Bf4sTP/qBmJyN0RGcPHuR7teP213nLx5Zt37z3kAHr0WZE
+xBHDt7zSmGDWBW+D8EaarSZntk/cup0KRyfFCKOGDEp+S3buHbnXrYfeuCF7t23Pk3/5qfwJLMYlHB
+IZ0lcw5OLTqS1f2vJKdmMvNK0JMs+Xh0rRFbBWqGjNREpSkiUSDPUJgfJr1KXrTRKE1s1mF/b/9TWg
+0Xht5V/XZTa73zthR9x/q0TyHrIifPnxevHT5a6du/b73cV3tQ40g0dLHI5pSs3yOa3VhMuH8xX9kk
+qg6N3D588212drCBybei+NWy865fYfNd9/86Om/8UEbyQ2pSahVTLZiIl7+Xnhcs2BI+MlTIbArpCV
+lM2I4flcXgrmRK50UKkGi5oY8+zM5GAEAFWJMi2zievueHAq6We/j9Myj1HzsbfQQ5e5NTQCC+/ebx
+74M7xu9eXu//BWOnQBNRSwTPNLKhcViZwRbaXhcns/qnR4UdmHKb3TAAAAyxJREFUhsZJ04Dyjr1sP
+/qZoc1HP/MMu29+GL/0IkqDD1obRwNm4/lTb8Zyi6ydzWjCMuoxmz1iwbMqeB/80mVN5I0bqLJG2gy
+PlTh1uKbCB+ljc20vdm4deHjPoXuf+cSvPTpU3riJmvQ5fXGIS8Njj2D1fl8pTBS30PwaUtyzINGyj
+OKGlWj5vJnK2IOnjx+L49nQ37nrAAOH75xuv/XmP6Nv078YE9RkaEGnSBUCKRqBFj5e1o1ksxMQjYK
+elQuEsLUwK2m1kpmlVB+/8K1kAQxaNtBmjeMOl8LtcRzV8WQuG6FQGIQVWtbW79zz2L19Gx/uL5f+J
+P+fz5YHR8Z56aevxNt37n2wu7fnNd/TsfNaXBiRZiGDwKDRLbB3q8L3867y+MTlXdMTo8WBbbvi/Qf
+vGOLAvt+qrl37w3EIcxLag4x11laIRAWPAI8Ot/ExpH6jWC8yF2devkyLrInFgmeWh7OwRPBWGG+Wi
+F0jppWWRJBNHxikcD21XjFwUpk6AkatJEkC1orBclf73x564IHjhb7+v3/uv55fNz45VRy+fHlXd09
+PmSgZc0hPNhvYAruYN27V8n2gtXV8fOShnq5O9t+492kG9n2LQv65KWAaWAMUDPhEaG0oIFyOMgkhy
+YOaz2HKRVHc4lqQbf3LMisUrWjrl9XhhBCkwnWnNLiFDVCParR5BeeRJE47aungOASE1gueu+OTh76
+0dt3Gzx47dvzRUnHNQ8Cf2yQZE7mg+XtslqVWi5XocjlDu7K0pgS+dfbs2V8tFotPlUqlr+ZyuXNO+
+duFtaSrZF3pfCpiGjN2imToJJ39m6BjG1XZRwrkAI8YUKSZWlEZQDAIrNArHnyvpXtmM/B7wJeAbwO
+fBcxKuQMrzfLdBoz29fX9led5v6u1XnBJW7vnr/YlrXEoNo22LRYOYlxZ1S6rkOfDcLvPAY/hGmWC7
+H68uFI+x0oSPg2MAN/L5/M/vtqSED/T5cMu9J4Wf7HMGsB/4TEv/DFwe3Y/NPN57VXh+5BWApwFLlh
+r661tV1eju/ne8YJrkWtES0tmRe2VOviv2j2aBp5nHihiRaz/A4oCnsAsje/+AAAAAElFTkSuQmCC"
+ }
+
+# $encoded(basn0g08), $encoded(basn2c08), $encoded(basn3p08), $encoded(basn6a08)
+test imgPNG-1.1 {reading basic images; grayscale} -setup {
+ catch {rename foo ""}
+} -body {
+ image create photo foo -data $encoded(basn0g08)
+ list [image width foo] [image height foo]
+} -cleanup {
+ rename foo ""
+} -result {32 32}
+test imgPNG-1.2 {reading basic images; color} -setup {
+ catch {rename foo ""}
+} -body {
+ image create photo foo -data $encoded(basn2c08)
+ list [image width foo] [image height foo]
+} -cleanup {
+ rename foo ""
+} -result {32 32}
+test imgPNG-1.3 {reading basic images; color with palette} -setup {
+ catch {rename foo ""}
+} -body {
+ image create photo foo -data $encoded(basn3p08)
+ list [image width foo] [image height foo]
+} -cleanup {
+ rename foo ""
+} -result {32 32}
+test imgPNG-1.4 {reading basic images; alpha} -setup {
+ catch {rename foo ""}
+} -body {
+ image create photo foo -data $encoded(basn6a08)
+ list [image width foo] [image height foo]
+} -cleanup {
+ rename foo ""
+} -result {32 32}
+
+test imgPNG-2.1 {reading a bad image} -body {
+ image create photo -data $encoded(BadX)
+} -returnCodes error -result {unfinalized data stream in PNG data}
+test imgPNG-2.2 {reading a good image with multiple IDATs} -setup {
+ set i [image create photo]
+} -body {
+ $i put $encoded(MultiIDAT)
+ return [image width $i]x[image height $i]
+} -cleanup {
+ image delete $i
+} -result 223x212
+
+}
+namespace delete png
+imageFinish
+cleanupTests
+return
+
+# Local Variables:
+# mode: tcl
+# fill-column: 78
+# End:
diff --git a/tests/imgPPM.test b/tests/imgPPM.test
index a9e9dc0..456427f 100644
--- a/tests/imgPPM.test
+++ b/tests/imgPPM.test
@@ -6,11 +6,12 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-eval image delete [image names]
+imageInit
# Note that we do not use [tcltest::makeFile] because it is
# only suitable for text files
@@ -21,145 +22,150 @@ proc put {file data} {
close $f
}
-test imgPPM-1.1 {FileReadPPM procedure} {
+test imgPPM-1.1 {FileReadPPM procedure} -body {
put test.ppm "P6\n0 256\n255\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has dimension(s) <= 0}}
-test imgPPM-1.2 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has dimension(s) <= 0}
+test imgPPM-1.2 {FileReadPPM procedure} -body {
put test.ppm "P6\n-2 256\n255\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has dimension(s) <= 0}}
-test imgPPM-1.3 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has dimension(s) <= 0}
+test imgPPM-1.3 {FileReadPPM procedure} -body {
put test.ppm "P6\n10 0\n255\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has dimension(s) <= 0}}
-test imgPPM-1.4 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has dimension(s) <= 0}
+test imgPPM-1.4 {FileReadPPM procedure} -body {
put test.ppm "P6\n10 -2\n255\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has dimension(s) <= 0}}
-test imgPPM-1.5 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has dimension(s) <= 0}
+test imgPPM-1.5 {FileReadPPM procedure} -body {
put test.ppm "P6\n10 20\n256\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has bad maximum intensity value 256}}
-test imgPPM-1.6 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has bad maximum intensity value 256}
+test imgPPM-1.6 {FileReadPPM procedure} -body {
put test.ppm "P6\n10 20\n0\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {PPM image file "test.ppm" has bad maximum intensity value 0}}
-test imgPPM-1.7 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {PPM image file "test.ppm" has bad maximum intensity value 0}
+test imgPPM-1.7 {FileReadPPM procedure} -body {
put test.ppm "P6\n10 10\n255\nabcdef"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {error reading PPM image file "test.ppm": not enough data}}
-test imgPPM-1.8 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {error reading PPM image file "test.ppm": not enough data}
+test imgPPM-1.8 {FileReadPPM procedure} -body {
put test.ppm "P6\n5 4\n255\n01234567890123456789012345678901234567890123456789012345678"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {error reading PPM image file "test.ppm": not enough data}}
-test imgPPM-1.9 {FileReadPPM procedure} {
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {error reading PPM image file "test.ppm": not enough data}
+test imgPPM-1.9 {FileReadPPM procedure} -body {
put test.ppm "P6\n5 4\n150\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg \
- [image width p1] [image height p1]
-} {0 p1 5 4}
+ list [image create photo p1 -file test.ppm] \
+ [image width p1] [image height p1]
+} -returnCodes ok -result {p1 5 4}
-catch {image delete p1}
-put test.ppm "P6\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
-image create photo p1 -file test.ppm
-test imgPPM-2.1 {FileWritePPM procedure} {
+
+test imgPPM-2.1 {FileWritePPM procedure} -setup {
+ catch {image delete p1}
+} -body {
+ put test.ppm "P6\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
+ image create photo p1 -file test.ppm
list [catch {p1 write not_a_dir/bar/baz/gorp} msg] [string tolower $msg] \
- [string tolower $errorCode]
-} {1 {couldn't open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}}
-test imgPPM-2.2 {FileWritePPM procedure} {
+ [string tolower $errorCode]
+} -cleanup {
+ image delete p1
+} -result {1 {couldn't open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}}
+
+test imgPPM-2.2 {FileWritePPM procedure} -setup {
+ catch {image delete p1}
catch {unset data}
+} -body {
+ put test.ppm "P6\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
+ image create photo p1 -file test.ppm
p1 write -format ppm test.ppm
set fd [open test.ppm]
set data [read $fd]
close $fd
set data
-} {P6
+} -cleanup {
+ image delete p1
+} -result {P6
5 4
255
012345678901234567890123456789012345678901234567890123456789}
-test imgPPM-3.1 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+
+test imgPPM-3.1 {ReadPPMFileHeader procedure} -body {
put test.ppm "# \n#\n#\nP6\n#\n##\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {0 p1}
-test imgPPM-3.2 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -cleanup {
+ image delete p1
+} -returnCodes ok -result p1
+test imgPPM-3.2 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6\n5\n 4 255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {0 p1}
-test imgPPM-3.3 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -cleanup {
+ image delete p1
+} -returnCodes ok -result p1
+test imgPPM-3.3 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6\n# asdfasdf\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {0 p1}
-test imgPPM-3.4 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -cleanup {
+ image delete p1
+} -returnCodes ok -result p1
+test imgPPM-3.4 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6 \n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {0 p1}
-test imgPPM-3.5 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -cleanup {
+ image delete p1
+} -returnCodes ok -result p1
+test imgPPM-3.5 {ReadPPMFileHeader procedure} -body {
put test.ppm "P5\n5 4\n255\n01234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {0 p1}
-test imgPPM-3.6 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -cleanup {
+ image delete p1
+} -returnCodes ok -result p1
+test imgPPM-3.6 {ReadPPMFileHeader procedure} -body {
put test.ppm "P3\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.7 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.7 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6x\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.8 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.8 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6\nxy5 4\n255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.9 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.9 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6\n5\n255\n!012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.10 {ReadPPMFileHeader procedure} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.10 {ReadPPMFileHeader procedure} -body {
put test.ppm "P6\n5 4\nzz255\n012345678901234567890123456789012345678901234567890123456789"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.11 {ReadPPMFileHeader procedure, empty file} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.11 {ReadPPMFileHeader procedure, empty file} -body {
put test.ppm " "
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.12 {ReadPPMFileHeader procedure, file ends too soon} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.12 {ReadPPMFileHeader procedure, file ends too soon} -body {
put test.ppm "P6\n566"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
-test imgPPM-3.13 {ReadPPMFileHeader procedure, file ends too soon} {
- catch {image delete p1}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
+test imgPPM-3.13 {ReadPPMFileHeader procedure, file ends too soon} -body {
put test.ppm "P6\n566\n#asdf"
- list [catch {image create photo p1 -file test.ppm} msg] $msg
-} {1 {couldn't recognize data in image file "test.ppm"}}
+ image create photo p1 -file test.ppm
+} -returnCodes error -result {couldn't recognize data in image file "test.ppm"}
-test imgPPM-4.1 {StringReadPPM procedure, data too short [Bug 1822391]} \
- -setup {
- image create photo I -width 1103 -height 997
- } \
- -cleanup {
- image delete I
- } \
- -body {
- I put "P5\n1103 997\n255\n"
- } \
- -returnCodes error \
- -result {truncated PPM data}
-eval image delete [image names]
+test imgPPM-4.1 {StringReadPPM procedure, data too short [Bug 1822391]} -body {
+ image create photo I -width 1103 -height 997
+ I put "P5\n1103 997\n255\n"
+} -cleanup {
+ image delete I
+} -returnCodes error -result {truncated PPM data}
+
+imageFinish
# cleanup
catch {file delete test.ppm}
cleanupTests
return
+
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index d4118b0..e85f512 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1,486 +1,867 @@
-# This file is a Tcl script to test out the "photo" image type and the
-# other procedures in the file tkImgPhoto.c. It is organized in the
-# standard fashion for Tcl tests.
+# This file is a Tcl script to test out the "photo" image type and the other
+# procedures in the file tkImgPhoto.c. It is organized in the standard fashion
+# for Tcl tests.
#
# Copyright (c) 1994 The Australian National University
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2002-2008 Donal K. Fellows
# All rights reserved.
#
# Author: Paul Mackerras (paulus@cs.anu.edu.au)
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
-eval image delete [image names]
-
-canvas .c
-pack .c
-update
+# Used for 4.65 - 4.73 tests
+# Now for some heftier testing, checking that setting and resetting of pixels'
+# transparency status doesn't "leak" with any one-off errors.
+proc foreachPixel {img xVar yVar script} {
+ upvar 1 $xVar x $yVar y
+ set width [image width $img]
+ set height [image height $img]
+ for {set x 0} {$x<$width} {incr x} {
+ for {set y 0} {$y<$height} {incr y} {
+ uplevel 1 $script
+ }
+ }
+}
+proc checkImgTrans {img} {
+ set result {}
+ foreachPixel $img x y {
+ if {[$img transparency get $x $y]} {
+ lappend result $x,$y
+ }
+ }
+ return $result
+}
+proc checkImgTransLoop {img script1 script2} {
+ set result {}
+ foreachPixel $img x y {
+ eval $script1
+ lappend result {*}[checkImgTrans $img]
+ append result :
+ eval $script2
+ lappend result {*}[checkImgTrans $img]
+ append result .
+ }
+ return $result
+}
+imageInit
set README [makeFile {
-README -- Tk test suite design document.
+ README -- Tk test suite design document.
} README-imgPhoto]
# find the teapot.ppm file for use in these tests
set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm]
testConstraint hasTeapotPhoto [file exists $teapotPhotoFile]
-test imgPhoto-1.1 {options for photo images} {
- image create photo p1 -width 79 -height 83
- list [lindex [p1 configure -width] 4] [lindex [p1 configure -height] 4] \
- [image width p1] [image height p1]
-} {79 83 79 83}
-test imgPhoto-1.2 {options for photo images} {
- list [catch {image create photo p1 -file no.such.file} err] \
+# ----------------------------------------------------------------------
+
+test imgPhoto-1.1 {options for photo images} -body {
+ image create photo photo1 -width 79 -height 83
+ list [photo1 cget -width] [photo1 cget -height] \
+ [image width photo1] [image height photo1]
+} -cleanup {
+ image delete photo1
+} -result {79 83 79 83}
+test imgPhoto-1.2 {options for photo images} -body {
+ list [catch {image create photo photo1 -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} 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} hasTeapotPhoto {
- image create photo p1 -file $teapotPhotoFile
- list [image width p1] [image height p1]
-} {256 256}
-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] \
- [lindex [p1 configure -file] 4] [lindex [p1 configure -format] 4]
-} [list 79 83 $teapotPhotoFile ppm]
-test imgPhoto-1.6 {options for photo images} {
- image create photo p1 -palette 2/2/2 -gamma 2.2
- list [format %.1f [lindex [p1 configure -gamma] 4]] \
- [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
-} [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"}}
-test imgPhoto-1.9 {options for photo images - error case} {
- list [catch {image create photo -format} err] $err
-} {1 {value for "-format" missing}}
-test imgPhoto-1.10 {options for photo images - error case} {
- list [catch {image create photo -data} err] $err
-} {1 {value for "-data" missing}}
-test imgPhoto-1.11 {options for photo images - error case} {
- list [catch {image create photo p1 -format} err] $err
-} {1 {value for "-format" missing}}
+} -result {1 {couldn't open "no.such.file": no such file or directory}}
+test imgPhoto-1.3 {options for photo images} -constraints hasTeapotPhoto -body {
+ image create photo photo1 -file $teapotPhotoFile -format no.such.format
+} -returnCodes error -result {image file format "no.such.format" is not supported}
+test imgPhoto-1.4 {options for photo images} -constraints hasTeapotPhoto -body {
+ image create photo photo1 -file $teapotPhotoFile
+ list [image width photo1] [image height photo1]
+} -cleanup {
+ image delete photo1
+} -result {256 256}
+test imgPhoto-1.5 {options for photo images} -constraints hasTeapotPhoto -body {
+ image create photo photo1 -file $teapotPhotoFile \
+ -format ppm -width 79 -height 83
+ list [image width photo1] [image height photo1] [photo1 cget -file] [photo1 cget -format]
+} -cleanup {
+ image delete photo1
+} -result [list 79 83 $teapotPhotoFile ppm]
+test imgPhoto-1.6 {options for photo images} -body {
+ image create photo photo1 -palette 2/2/2 -gamma 2.2
+ list [format %.1f [photo1 cget -gamma]] [photo1 cget -palette]
+} -cleanup {
+ image delete photo1
+} -result {2.2 2/2/2}
+test imgPhoto-1.7 {options for photo images} -returnCodes error -body {
+ image create photo photo1 -file $README
+} -result [subst {couldn't recognize data in image file "$README"}]
+test imgPhoto-1.8 {options for photo images} -body {
+ image create photo -blah blah
+} -returnCodes error -result {unknown option "-blah"}
+test imgPhoto-1.9 {options for photo images - error case} -body {
+ image create photo -format
+} -returnCodes error -result {value for "-format" missing}
+test imgPhoto-1.10 {options for photo images - error case} -body {
+ image create photo -data
+} -returnCodes error -result {value for "-data" missing}
+test imgPhoto-1.11 {options for photo images - error case} -body {
+ image create photo photo1 -format
+} -returnCodes error -result {value for "-format" missing}
-test imgPhoto-2.1 {ImgPhotoCreate procedure} {
- eval image delete [image names]
+test imgPhoto-2.1 {ImgPhotoCreate procedure} -setup {
+ imageCleanup
+} -body {
catch {image create photo -blah blah}
- image names
-} {}
-test imgPhoto-2.2 {ImgPhotoCreate procedure} {
- eval image delete [image names]
+ imageNames
+} -result {}
+test imgPhoto-2.2 {ImgPhotoCreate procedure} -setup {
+ imageCleanup
+} -body {
image create photo image1
- list [info commands image1] [image names] \
- [image width image1] [image height image1]
-} {image1 image1 0 0}
+ list [info commands image1] [imageNames] \
+ [image width image1] [image height image1]
+} -cleanup {
+ image delete image1
+} -result {image1 image1 0 0}
# test imgPhoto-2.3 {ImgPhotoCreate procedure: creation failure} {
-# image create photo p1
-# image create photo p2 -width 10 -height 10
-# catch {image create photo p2 -file bogus.img} msg
-# p1 copy p2
+# image create photo photo1
+# image create photo photo2 -width 10 -height 10
+# catch {image create photo photo2 -file bogus.img} msg
+# photo1 copy photo2
# set msg
# } {couldn't open "bogus.img": no such file or directory}
-test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} hasTeapotPhoto {
- image create photo p1 -file $teapotPhotoFile
- p1 configure -file $teapotPhotoFile
-} {}
-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} 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
+test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} -constraints {
+ hasTeapotPhoto
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ photo1 configure -file $teapotPhotoFile
+} -cleanup {
+ image delete photo1
+} -result {}
+test imgPhoto-3.2 {ImgPhotoConfigureMaster procedure} -constraints {
+ hasTeapotPhoto
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ list [catch {photo1 configure -file bogus} err] [string tolower $err] \
+ [image width photo1] [image height photo1]
+} -cleanup {
+ image delete photo1
+} -result {1 {couldn't open "bogus": no such file or directory} 256 256}
+test imgPhoto-3.3 {ImgPhotoConfigureMaster procedure} -constraints {
+ hasTeapotPhoto
+} -setup {
+ destroy .c
+ pack [canvas .c]
update
- p1 configure -file $teapotPhotoFile
+} -body {
+ image create photo photo1
+ .c create image 10 10 -image photo1 -tags photo1.1 -anchor nw
+ .c create image 300 10 -image photo1 -tags photo1.2 -anchor nw
update
- list [image width p1] [image height p1] [.c bbox p1.1] [.c bbox p1.2]
-} {256 256 {10 10 266 266} {300 10 556 266}}
-
-eval image delete [image names]
-image create photo p1
-.c create image 10 10 -image p1
-update
+ photo1 configure -file $teapotPhotoFile
+ update
+ list [image width photo1] [image height photo1] [.c bbox photo1.1] [.c bbox photo1.2]
+} -cleanup {
+ destroy .c
+ image delete photo1
+} -result {256 256 {10 10 266 266} {300 10 556 266}}
-test imgPhoto-4.1 {ImgPhotoCmd procedure} {
- list [catch {p1} err] $err
-} {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, transparency, or write}}
-test imgPhoto-4.3 {ImgPhotoCmd procedure: blank option} {
- p1 blank
- list [catch {p1 blank x} err] $err
-} {1 {wrong # args: should be "p1 blank"}}
-test imgPhoto-4.4 {ImgPhotoCmd procedure: cget option} {
- list [catch {p1 cget} msg] $msg
-} {1 {wrong # args: should be "p1 cget option"}}
-test imgPhoto-4.5 {ImgPhotoCmd procedure: cget option} {
- image create photo p2 -width 25 -height 30
- list [p2 cget -width] [p2 cget -height]
-} {25 30}
-test imgPhoto-4.6 {ImgPhotoCmd procedure: configure option} {
- llength [p1 configure]
-} {7}
-test imgPhoto-4.7 {ImgPhotoCmd procedure: configure option} {
- p1 conf -palette 3/4/2
- p1 configure -palette
-} {-palette {} {} {} 3/4/2}
-test imgPhoto-4.8 {ImgPhotoCmd procedure: configure option} {
- list [catch {p1 configure -blah} msg] $msg
-} {1 {unknown option "-blah"}}
-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} hasTeapotPhoto {
- image create photo p2 -file $teapotPhotoFile
- p1 configure -width 0 -height 0 -palette {} -gamma 1
- p1 copy p2
- list [image width p1] [image height p1] [p1 get 100 100]
-} {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 ?-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 -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}}
-test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2
- p1 copy p2 -from 0 70 60 120 -shrink
- list [image width p1] [image height p1] [p1 get 20 10]
-} {60 50 {215 154 120}}
-test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2 -from 60 120 0 70 -to 20 50
- list [image width p1] [image height p1] [p1 get 40 80]
-} {80 100 {19 92 192}}
-test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2 -from 0 120 60 70 -to 0 0 100 100
- list [image width p1] [image height p1] [p1 get 80 60]
-} {100 100 {215 154 120}}
-test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2 -from 60 70 0 120 -zoom 2
- list [image width p1] [image height p1] [p1 get 100 50]
-} {120 100 {169 99 47}}
-test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2 -from 0 70 60 120
- list [image width p1] [image height p1] [p1 get 100 50]
-} {120 100 {169 99 47}}
-test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2 -from 20 20 200 180 -subsample 2 -shrink
- list [image width p1] [image height p1] [p1 get 50 30]
-} {90 80 {207 146 112}}
-test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} {
- p1 copy p2
- set result [list [image width p1] [image height p1]]
- p1 conf -width 49 -height 51
- lappend result [image width p1] [image height p1]
- p1 copy p2
- lappend result [image width p1] [image height p1]
- p1 copy p2 -from 0 0 10 10 -shrink
- lappend result [image width p1] [image height p1]
- p1 conf -width 0
- p1 copy p2 -from 0 0 10 10 -shrink
- lappend result [image width p1] [image height p1]
- p1 conf -height 0
- 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} 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}}
-test imgPhoto-4.23 {ImgPhotoCmd procedure: get option} {
- list [catch {p1 get 256 0} err] $err
-} {1 {p1 get: coordinates out of range}}
-test imgPhoto-4.24 {ImgPhotoCmd procedure: get option} {
- list [catch {p1 get 0 -1} err] $err
-} {1 {p1 get: coordinates out of range}}
-test imgPhoto-4.25 {ImgPhotoCmd procedure: get option} {
- list [catch {p1 get} err] $err
-} {1 {wrong # args: should be "p1 get x y"}}
-test imgPhoto-4.26 {ImgPhotoCmd procedure: put option} {
- list [catch {p1 put} err] $err
-} {1 {wrong # args: should be "p1 put data ?options?"}}
-test imgPhoto-4.27 {ImgPhotoCmd procedure: put option} {
- list [catch {p1 put {{white} {white white}}} err] $err
-} {1 {all elements of color list must have the same number of elements}}
-test imgPhoto-4.28 {ImgPhotoCmd procedure: put option} {
- list [catch {p1 put {{blahgle}}} err] $err
-} {1 {can't parse color "blahgle"}}
-test imgPhoto-4.29 {ImgPhotoCmd procedure: put option} {
- p1 put -to 10 10 20 20 {{white}}
- p1 get 19 19
-} {255 255 255}
-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} 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} 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
-} [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} 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}}
-test imgPhoto-4.37 {ImgPhotoCmd procedure: redither option} {
- p1 redither
- list [catch {p1 redither x} err] $err
-} {1 {wrong # args: should be "p1 redither"}}
-test imgPhoto-4.38 {ImgPhotoCmd procedure: write option} {
- list [catch {p1 write} err] $err
-} {1 {wrong # args: should be "p1 write fileName ?options?"}}
-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}}
-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 .
- }
+test imgPhoto-4.1 {ImgPhotoCmd procedure} -setup {
+ image create photo photo1
+} -body {
+ photo1
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 option ?arg ...?"}
+test imgPhoto-4.2 {ImgPhotoCmd procedure} -setup {
+ image create photo photo1
+} -body {
+ photo1 blah
+} -returnCodes error -cleanup {
+ image delete photo1
+} -match glob -result {bad option "blah": must be *}
+test imgPhoto-4.3 {ImgPhotoCmd procedure: blank option} -setup {
+ image create photo photo1
+} -body {
+ photo1 blank
+ photo1 blank x
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {wrong # args: should be "photo1 blank"}
+test imgPhoto-4.4 {ImgPhotoCmd procedure: cget option} -setup {
+ image create photo photo1
+} -body {
+ photo1 cget
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {wrong # args: should be "photo1 cget option"}
+test imgPhoto-4.5 {ImgPhotoCmd procedure: cget option} -setup {
+ image create photo photo2 -width 25 -height 30
+} -body {
+ list [photo2 cget -width] [photo2 cget -height]
+} -cleanup {
+ image delete photo2
+} -result {25 30}
+test imgPhoto-4.6 {ImgPhotoCmd procedure: configure option} -setup {
+ image create photo photo1
+} -body {
+ llength [photo1 configure]
+} -cleanup {
+ image delete photo1
+} -result 7
+test imgPhoto-4.7 {ImgPhotoCmd procedure: configure option} -setup {
+ image create photo photo1
+} -body {
+ photo1 conf -palette 3/4/2
+ photo1 configure -palette
+} -cleanup {
+ image delete photo1
+} -result {-palette {} {} {} 3/4/2}
+test imgPhoto-4.8 {ImgPhotoCmd procedure: configure option} -setup {
+ image create photo photo1
+} -body {
+ photo1 configure -blah
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {unknown option "-blah"}
+test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} -setup {
+ image create photo photo1
+} -body {
+ photo1 configure -palette {} -gamma
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {value for "-gamma" missing}
+test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -width 25 -height 30
+} -body {
+ image create photo photo2 -file $teapotPhotoFile
+ photo1 configure -width 0 -height 0 -palette {} -gamma 1
+ photo1 copy photo2
+ list [image width photo1] [image height photo1] [photo1 get 100 100]
+} -cleanup {
+ image delete photo1 photo2
+} -result {256 256 {169 117 90}}
+test imgPhoto-4.11 {ImgPhotoCmd procedure: copy option} -setup {
+ image create photo photo1
+} -body {
+ photo1 copy
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 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} -setup {
+ image create photo photo1
+} -body {
+ photo1 copy blah
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {image "blah" doesn't exist or is not a photo image}
+test imgPhoto-4.13 {ImgPhotoCmd procedure: copy option} -setup {
+ image create photo photo1
+ image create photo photo2
+} -body {
+ photo1 copy photo2 -blah
+} -returnCodes error -cleanup {
+ image delete photo1 photo2
+} -result {unrecognized option "-blah": must be -compositingrule, -from, -shrink, -subsample, -to, or -zoom}
+test imgPhoto-4.14 {ImgPhotoCmd procedure: copy option} -setup {
+ image create photo photo1
+ image create photo photo2
+} -body {
+ photo1 copy photo2 -from -to
+} -returnCodes error -cleanup {
+ image delete photo1 photo2
+} -result {the "-from" option requires one to four integer values}
+test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2
+ photo1 copy photo2 -from 0 70 60 120 -shrink
+ list [image width photo1] [image height photo1] [photo1 get 20 10]
+} -cleanup {
+ image delete photo1 photo2
+} -result {60 50 {215 154 120}}
+test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2 -from 60 120 0 70 -to 20 50
+ list [image width photo1] [image height photo1] [photo1 get 40 80]
+} -cleanup {
+ image delete photo1 photo2
+} -result {80 100 {19 92 192}}
+test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2 -from 0 120 60 70 -to 0 0 100 100
+ list [image width photo1] [image height photo1] [photo1 get 80 60]
+} -cleanup {
+ image delete photo1 photo2
+} -result {100 100 {215 154 120}}
+test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2 -from 60 70 0 120 -zoom 2
+ list [image width photo1] [image height photo1] [photo1 get 100 50]
+} -cleanup {
+ image delete photo1 photo2
+} -result {120 100 {169 99 47}}
+test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2 -from 0 70 60 120 -zoom 2
+ list [image width photo1] [image height photo1] [photo1 get 100 50]
+} -cleanup {
+ image delete photo1 photo2
+} -result {120 100 {169 99 47}}
+test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2 -from 20 20 200 180 -subsample 2 -shrink
+ list [image width photo1] [image height photo1] [photo1 get 50 30]
+} -cleanup {
+ image delete photo1 photo2
+} -result {90 80 {207 146 112}}
+test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+ image create photo photo2 -file $teapotPhotoFile
+} -body {
+ photo1 copy photo2
+ set result [list [image width photo1] [image height photo1]]
+ photo1 conf -width 49 -height 51
+ lappend result [image width photo1] [image height photo1]
+ photo1 copy photo2
+ lappend result [image width photo1] [image height photo1]
+ photo1 copy photo2 -from 0 0 10 10 -shrink
+ lappend result [image width photo1] [image height photo1]
+ photo1 conf -width 0
+ photo1 copy photo2 -from 0 0 10 10 -shrink
+ lappend result [image width photo1] [image height photo1]
+ photo1 conf -height 0
+ photo1 copy photo2 -from 0 0 10 10 -shrink
+ lappend result [image width photo1] [image height photo1]
+} -cleanup {
+ image delete photo1 photo2
+} -result {256 256 49 51 49 51 49 51 10 51 10 10}
+test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $teapotPhotoFile
+ list [photo1 get 100 100] [photo1 get 150 100] [photo1 get 100 150]
+} -cleanup {
+ image delete photo1
+} -result {{169 117 90} {172 115 84} {35 35 35}}
+test imgPhoto-4.23 {ImgPhotoCmd procedure: get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 get 256 0
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {photo1 get: coordinates out of range}
+test imgPhoto-4.24 {ImgPhotoCmd procedure: get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 get 0 -1
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {photo1 get: coordinates out of range}
+test imgPhoto-4.25 {ImgPhotoCmd procedure: get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 get
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {wrong # args: should be "photo1 get x y"}
+test imgPhoto-4.26 {ImgPhotoCmd procedure: put option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 put data ?-option value ...?"}
+test imgPhoto-4.27 {ImgPhotoCmd procedure: put option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put {{white} {white white}}
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {all elements of color list must have the same number of elements}
+test imgPhoto-4.28 {ImgPhotoCmd procedure: put option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put {{blahgle}}
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {can't parse color "blahgle"}
+test imgPhoto-4.29 {ImgPhotoCmd procedure: put option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put -to 10 10 20 20 {{white}}
+ photo1 get 19 19
+} -cleanup {
+ image delete photo1
+} -result {255 255 255}
+test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} -setup {
+ image create photo photo1
+} -body {
+ photo1 read
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 read fileName ?-option value ...?"}
+test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $teapotPhotoFile -zoom 2
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {unrecognized option "-zoom": must be -format, -from, -shrink, or -to}
+test imgPhoto-4.32 {ImgPhotoCmd procedure: read option} -setup {
+ image create photo photo1
+} -body {
+ list [catch {photo1 read bogus} err] [string tolower $err]
+} -cleanup {
+ image delete photo1
+} -result {1 {couldn't open "bogus": no such file or directory}}
+test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $teapotPhotoFile -format bogus
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {image file format "bogus" is not supported}
+test imgPhoto-4.34 {ImgPhotoCmd procedure: read option} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $README
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result [subst {couldn't recognize data in image file "$README"}]
+test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $teapotPhotoFile
+ list [image width photo1] [image height photo1] [photo1 get 120 120]
+} -cleanup {
+ image delete photo1
+} -result {256 256 {161 109 82}}
+test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -constraints {
+ hasTeapotPhoto
+} -setup {
+ image create photo photo1
+} -body {
+ photo1 read $teapotPhotoFile -from 0 70 60 120 -to 10 10 -shrink
+ list [image width photo1] [image height photo1] [photo1 get 29 19]
+} -cleanup {
+ image delete photo1
+} -result {70 60 {244 180 144}}
+test imgPhoto-4.37 {ImgPhotoCmd procedure: redither option} -setup {
+ image create photo photo1
+} -body {
+ photo1 redither
+ photo1 redither x
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {wrong # args: should be "photo1 redither"}
+test imgPhoto-4.38 {ImgPhotoCmd procedure: write option} -setup {
+ image create photo photo1
+} -body {
+ photo1 write
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 write fileName ?-option value ...?"}
+test imgPhoto-4.39 {ImgPhotoCmd procedure: write option} -setup {
+ image create photo photo1
+} -body {
+ photo1 write teapot.tmp -format bogus
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {image file format "bogus" is unknown}
+test imgPhoto-4.40 {ImgPhotoCmd procedure: transparency option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency option ?arg ...?"}
+test imgPhoto-4.41 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency get x y"}
+test imgPhoto-4.42 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency get x y"}
+test imgPhoto-4.43 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 0 0 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency get x y"}
+test imgPhoto-4.44 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get bogus 0
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {expected integer but got "bogus"}
+test imgPhoto-4.45 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 0 bogus
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {expected integer but got "bogus"}
+test imgPhoto-4.46 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white
+ photo1 transparency get 0 0
+} -cleanup {
+ image delete photo1
+} -result 0
+test imgPhoto-4.47 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 1 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency get: coordinates out of range}
+test imgPhoto-4.48 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get -1 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency get: coordinates out of range}
+test imgPhoto-4.49 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 0 1
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency get: coordinates out of range}
+test imgPhoto-4.50 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency get 0 -1
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency get: coordinates out of range}
+test imgPhoto-4.51 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white
+ photo1 blank
+ photo1 transparency get 0 0
+} -cleanup {
+ image delete photo1
+} -result 1
+test imgPhoto-4.52 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency set x y boolean"}
+test imgPhoto-4.53 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency set x y boolean"}
+test imgPhoto-4.54 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency set x y boolean"}
+test imgPhoto-4.55 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 0 0 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {wrong # args: should be "photo1 transparency set x y boolean"}
+test imgPhoto-4.56 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set bogus 0 0
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {expected integer but got "bogus"}
+test imgPhoto-4.57 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 bogus 0
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {expected integer but got "bogus"}
+test imgPhoto-4.58 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 0 bogus
+} -cleanup {
+ image delete photo1
+} -returnCodes error -result {expected boolean value but got "bogus"}
+test imgPhoto-4.59 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 1 0 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency set: coordinates out of range}
+test imgPhoto-4.60 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set -1 0 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency set: coordinates out of range}
+test imgPhoto-4.61 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 1 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency set: coordinates out of range}
+test imgPhoto-4.62 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 transparency set 0 -1 0
+} -returnCodes error -cleanup {
+ image delete photo1
+} -result {photo1 transparency set: coordinates out of range}
+test imgPhoto-4.63 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white
+ photo1 transparency set 0 0 false
+ photo1 transparency get 0 0
+} -cleanup {
+ image delete photo1
+} -result 0
+test imgPhoto-4.64 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white
+ photo1 transparency set 0 0 true
+ photo1 transparency get 0 0
+} -cleanup {
+ image delete photo1
+} -result 1
+# Now for some heftier testing, checking that setting and resetting of pixels'
+# transparency status doesn't "leak" with any one-off errors.
+test imgPhoto-4.65 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white -to 0 0 3 3
+ checkImgTrans photo1
+} -cleanup {
+ image delete photo1
+} -result {}
+test imgPhoto-4.66 {ImgPhotoCmd procedure: transparency get option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white -to 0 0 3 3
+ photo1 blank
+ checkImgTrans photo1
+} -result {0,0 0,1 0,2 1,0 1,1 1,2 2,0 2,1 2,2}
+test imgPhoto-4.67 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white -to 0 0 3 3
+ checkImgTransLoop photo1 {
+ photo1 put white -to 0 0 3 3
+ photo1 transparency set $x $y 1
+ } {
+ photo1 transparency set $x $y 0
}
- 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 .
- }
+} -cleanup {
+ image delete photo1
+} -result {0,0:. 0,1:. 0,2:. 1,0:. 1,1:. 1,2:. 2,0:. 2,1:. 2,2:.}
+test imgPhoto-4.68 {ImgPhotoCmd procedure: transparency set option} -setup {
+ image create photo photo1
+} -body {
+ photo1 put white -to 0 0 3 3
+ checkImgTransLoop photo1 {
+ photo1 blank
+ photo1 transparency set $x $y 0
+ } {
+ photo1 transparency set $x $y 1
}
- return $result
-}
-test imgPhoto-4.67a {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} {
+} -cleanup {
+ image delete photo1
+} -result {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.}
+test imgPhoto-4.69 {ImgPhotoCmd procedure: copy with -compositingrule} -setup {
+ # Test the compositing rules for copying images
+ image create photo photo1 -width 3 -height 3
+ image create photo photo2 -width 2 -height 2
+} -body {
+ photo1 copy photo2 -to 1 1 -compositingrule
+} -cleanup {
+ image delete photo1 photo2
+} -returnCodes error -result {the "-compositingrule" option requires a value}
+test imgPhoto-4.70 {ImgPhotoCmd procedure: copy with -compositingrule} -setup {
+ # Test the compositing rules for copying images
+ image create photo photo1 -width 3 -height 3
+ image create photo photo2 -width 2 -height 2
+} -body {
+ photo1 copy photo2 -to 1 1 -compositingrule BAD
+} -returnCodes error -cleanup {
+ image delete photo1 photo2
+} -result {bad compositing rule "BAD": must be overlay or set}
+test imgPhoto-4.71 {ImgPhotoCmd procedure: copy with -compositingrule} -setup {
+ # Test the compositing rules for copying images
+ image create photo photo1 -width 3 -height 3
+ image create photo photo2 -width 2 -height 2
+} -body {
# 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 {}}
+ photo1 blank
+ photo2 blank
+ photo1 put white -to 0 0 2 2
+ photo2 put white -to 0 0 2 2
+ photo2 transparency set 0 0 true
+ photo1 copy photo2 -to 1 1
+ checkImgTrans photo1
+} -cleanup {
+ image delete photo1 photo2
+} -result {0,2 2,0}
+test imgPhoto-4.72 {ImgPhotoCmd procedure: copy with -compositingrule} -setup {
+ # Test the compositing rules for copying images
+ image create photo photo1 -width 3 -height 3
+ image create photo photo2 -width 2 -height 2
+} -body {
+ photo1 blank
+ photo2 blank
+ photo1 put white -to 0 0 2 2
+ photo2 put white -to 0 0 2 2
+ photo2 transparency set 0 0 true
+ photo1 copy photo2 -to 1 1 -compositingrule overlay
+ checkImgTrans photo1
+} -cleanup {
+ image delete photo1 photo2
+} -result {0,2 2,0}
+test imgPhoto-4.73 {ImgPhotoCmd procedure: copy with -compositingrule} -setup {
+ # Test the compositing rules for copying images
+ image create photo photo1 -width 3 -height 3
+ image create photo photo2 -width 2 -height 2
+} -body {
+ photo1 blank
+ photo2 blank
+ photo1 put white -to 0 0 2 2
+ photo2 put white -to 0 0 2 2
+ photo2 transparency set 0 0 true
+ photo1 copy photo2 -to 1 1 -compositingrule set
+ checkImgTrans photo1
+} -cleanup {
+ image delete photo1 photo2
+} -result {0,2 1,1 2,0}
-test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} hasTeapotPhoto {
- eval image delete [image names]
- .c delete all
- image create photo p1 -file $teapotPhotoFile
- .c create image 0 0 -image p1 -tags p1.1
- .c create image 256 0 -image p1 -tags p1.2
- .c create image 0 256 -image p1 -tags p1.3
+test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -constraints {
+ hasTeapotPhoto
+} -setup {
+ destroy .c
+ pack [canvas .c]
+ imageCleanup
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ .c create image 0 0 -image photo1 -tags photo1.1
+ .c create image 256 0 -image photo1 -tags photo1.2
+ .c create image 0 256 -image photo1 -tags photo1.3
update
.c delete i1.1
- p1 configure -width 1
+ photo1 configure -width 1
update
.c delete i1.2
- p1 configure -height 1
+ photo1 configure -height 1
update
- image delete p1
-} {}
+ image delete photo1
+} -cleanup {
+ destroy .c
+} -result {}
-test imgPhoto-6.1 {ImgPhotoDisplay procedure, blank display} {
- .c delete all
- image create photo p1 -width 10 -height 10
- p1 blank
- .c create image 10 10 -image p1
+test imgPhoto-6.1 {ImgPhotoDisplay procedure, blank display} -setup {
+ destroy .c
+ pack [canvas .c]
+ imageCleanup
+} -body {
+ image create photo photo1 -width 10 -height 10
+ photo1 blank
+ .c create image 10 10 -image photo1
update
-} {}
+} -cleanup {
+ destroy .c
+ image delete photo1
+} -result {}
-test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} hasTeapotPhoto {
- eval image delete [image names]
- .c delete all
- image create photo p1 -file $teapotPhotoFile
- .c create image 0 0 -image p1 -anchor nw
+test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -constraints {
+ hasTeapotPhoto
+} -setup {
+ destroy .c
+ pack [canvas .c]
+ imageCleanup
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ .c create image 0 0 -image photo1 -anchor nw
update
.c delete all
- image delete p1
-} {}
-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
- button .b2 -image p1
- button .b3 -image p1
+ image delete photo1
+} -cleanup {
+ destroy .c
+} -result {}
+test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -constraints {
+ hasTeapotPhoto
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ pack [canvas .c]
+ .c create image 10 10 -image photo1 -anchor nw
+ button .b1 -image photo1
+ button .b2 -image photo1
+ button .b3 -image photo1
pack .b1 .b2 .b3
update
destroy .b2
@@ -490,12 +871,20 @@ test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} hasTeapotPhoto {
destroy .b1
update
.c delete all
-} {}
-test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} hasTeapotPhoto {
- image create photo p1 -file $teapotPhotoFile
- button .b1 -image p1
+} -cleanup {
+ destroy .c
+ image delete photo1
+} -result {}
+test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -constraints {
+ hasTeapotPhoto
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
+ image create photo photo1 -file $teapotPhotoFile
+ button .b1 -image photo1
frame .f -visual best
- button .f.b2 -image p1
+ button .f.b2 -image photo1
pack .f.b2
pack .b1 .f
update
@@ -504,59 +893,71 @@ test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} hasTeapotPhoto {
.f.b2 configure -image {}
update
destroy .f
- image delete p1
-} {}
+ image delete photo1
+} -result {}
-test imgPhoto-8.1 {ImgPhotoDelete procedure} hasTeapotPhoto {
- image create photo p2 -file $teapotPhotoFile
- image delete p2
-} {}
-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]]
- image delete p2
- append x [info command new*]
-} [list {} newp2 $teapotPhotoFile]
-test imagePhoto-8.3 {ImgPhotoDelete procedure, name cleanup} {
- image create photo p1
- image create photo p2 -width 10 -height 10
- image delete p2
- list [catch {p1 copy p2} msg] $msg
-} {1 {image "p2" doesn't exist or is not a photo image}}
+test imgPhoto-8.1 {ImgPhotoDelete procedure} -constraints hasTeapotPhoto -body {
+ image create photo photo2 -file $teapotPhotoFile
+ image delete photo2
+} -result {}
+test imgPhoto-8.2 {ImgPhotoDelete procedure} -constraints {
+ hasTeapotPhoto
+} -setup {
+ set x {}
+} -body {
+ image create photo photo2 -file $teapotPhotoFile
+ rename photo2 newphoto2
+ lappend x [info command photo2] [info command new*] [newphoto2 cget -file]
+ image delete photo2
+ lappend x [info command new*]
+} -result [list {} newphoto2 $teapotPhotoFile {}]
+test imgPhoto-8.3 {ImgPhotoDelete procedure, name cleanup} -body {
+ image create photo photo1
+ image create photo photo2 -width 10 -height 10
+ image delete photo2
+ photo1 copy photo2
+} -returnCodes error -cleanup {
+ imageCleanup
+} -result {image "photo2" doesn't exist or is not a photo image}
-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
-} {-1 1 {invalid command name "p2"}}
+test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -constraints {
+ hasTeapotPhoto
+} -body {
+ image create photo photo2 -file $teapotPhotoFile
+ rename photo2 {}
+ list [lsearch -exact [imageNames] photo2] [catch {photo2 foo} msg] $msg
+} -result {-1 1 {invalid command name "photo2"}}
-test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} {
- eval image delete [image names]
- image create photo p1
- p1 put {{#ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000}} -to 0 0
- p1 put {{#00ff00 #00ff00}} -to 2 0
- list [p1 get 2 0] [p1 get 3 0] [p1 get 4 0]
-} {{0 255 0} {0 255 0} {255 0 0}}
+test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup {
+ imageCleanup
+} -body {
+ image create photo photo1
+ photo1 put "{#ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000}" -to 0 0
+ photo1 put "{#00ff00 #00ff00}" -to 2 0
+ list [photo1 get 2 0] [photo1 get 3 0] [photo1 get 4 0]
+} -result {{0 255 0} {0 255 0} {255 0 0}}
-test imgPhoto-11.1 {Tk_FindPhoto} {
- eval image delete [image names]
+test imgPhoto-11.1 {Tk_FindPhoto} -setup {
+ imageCleanup
+} -body {
image create bitmap i1
- image create photo p1
- list [catch {p1 copy i1} msg] $msg
-} {1 {image "i1" doesn't exist or is not a photo image}}
+ image create photo photo1
+ photo1 copy i1
+} -cleanup {
+ imageCleanup
+} -returnCodes error -result {image "i1" doesn't exist or is not a photo image}
-test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} hasTeapotPhoto {
+test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body {
image create photo p3 -file $teapotPhotoFile
set result [list [p3 get 50 50] [p3 get 100 100]]
p3 copy p3 -zoom 2
lappend result [image width p3] [image height p3] [p3 get 100 100]
+} -cleanup {
image delete p3
- set result
-} {{19 92 192} {169 117 90} 512 512 {19 92 192}}
+} -result {{19 92 192} {169 117 90} 512 512 {19 92 192}}
-test imgPhoto-13.1 {check separation of images in different interpreters} {
- image delete {*}[image names]
+test imgPhoto-13.1 {check separation of images in different interpreters} -setup {
+ imageCleanup
set data {
R0lGODlhQgBkAPUAANbWxs7Wxs7OxsbOxsbGxsbGvb3Gvca9vcDAwL21vbW1vbW1tbWtta2t
ta2ltaWltaWlraWctaWcrZycrZyUrZSUrZSMrZSMpYyMrYyMpYyEpYSEpYR7pYR7nHp7pYRz
@@ -592,82 +993,79 @@ test imgPhoto-13.1 {check separation of images in different interpreters} {
interp create x2
x1 eval {load {} Tk}
x2 eval {load {} Tk}
+} -body {
x1 eval [list image create photo T1_data -data $data]
x2 eval [list image create photo T1_data -data $data]
- unset data
+} -cleanup {
interp delete x1
interp delete x2
-} {}
+} -result T1_data
-test imgPhoto-14.1 {GIF writes work correctly} {
- set data "R0lGODlhYwA5APcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgAysnGy8hKzM
-hASs3MTcjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-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-14.2 {GIF -index handler buffer sizing} -setup {
- set i [image create photo]
+test imgPhoto-14.1 {GIF writes work correctly} -setup {
+ set data {
+ R0lGODlhYwA5APcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgAysnGy8hKzM
+ hASs3MTcjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAwP8AAAD/
+ AP//AAAA//8A/wD//////ywAAAAAYwA5AAAI/wAZCBxIsKDBgwgTKlzIsKHD
+ hxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bN
+ mzhz6tzJs6fPn0CDCh1KtKhRiwoSKEXAtGlTpUqPGkyagOmCq1edNsWalWkC
+ BUSXIuDqFepBqFWtZv3KU+zYrkrBSqT6dgECtjOTbu16NwFHvV3lshRLti/J
+ qlgRCE6ZuO9ik4Dt+k0ZVyZiyVIvXr77ODPEy5g9T4zMWfTEzXdNz1VbWvXn
+ uqldP1TAOrbshqBb314Y2W7n3Qdpv7UNPCHpycUVbv6dnODy5sqzQldIe8H0
+ hciva9/Ovbv37+BzBgEEADs=
+ }
+ set tmpfilename [makeFile {} imgPhoto-14.1.gif]
+ removeFile $tmpfilename
} -body {
- # Bug 1458234 makes this crash when trying to access buffers of the
- # wrong size, caused when the initial frame is not the largest frame.
+ image create photo photo1 -data $data
+ photo1 write $tmpfilename -format gif
+ image create photo photo2 -file $tmpfilename
+ string equal [photo1 data] [photo2 data]
+} -cleanup {
+ catch {image delete photo1 photo2}
+ catch {file delete -force $tmpfilename}
+} -result 1
+test imgPhoto-14.2 {GIF -index handler buffer sizing} -setup {
set data {
R0lGODlhIAAgAKEAAPkOSQsi7////////yH/C05FVFNDQVBFMi4wAwEAAAAh
+QQJMgAAACwGAAYAFAAUAAACEYyPqcvtD6OctNqLs968+68VACH5BAkyAAEA
LAMAAwAaABoAAAI0jH+gq+gfmFzQzUsr3gBybn1gIm5kaUaoubbuC8fyTNel
Ohv1CSO533u8KrgbUfc5Ci/EAgA7
}
+} -body {
+ # Bug 1458234 makes this crash when trying to access buffers of the wrong
+ # size, caused when the initial frame is not the largest frame.
+ set i [image create photo]
$i configure -data $data -format {gif -index 2}
} -cleanup {
image delete $i
} -returnCodes error -result {no image data for this index}
-
-test imgPhoto-14.3 {GIF -index interleaving and small frames} -setup {
+test imgPhoto-14.3 {GIF -index interleaving and small frames} -body {
+ # Interleaved GIFs used to crash us when a smaller subsequent frame was
+ # accessed.
set i [image create photo]
-} -body {
- # Interleaved GIFs used to crash us when a smaller subsequent frame
- # was accessed.
$i configure -format {GIF -index 1} -data {
R0lGODdhAQAFAPAAAP8AAAAAACwAAAAAAQAFAEACAoRdACwAAAAAAQAEAEACAoRRADs=
}
} -cleanup {
image delete $i
}
-
test imgPhoto-14.4 {GIF buffer overflow} -setup {
- set i [image create photo]
-} -body {
- # This crashes Tk up to 8.4.17 and 8.5.0
- $i configure -data {
+ set data {
R0lGODlhCgAKAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/
AP//AAAA//8A/wD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -687,30 +1085,85 @@ test imgPhoto-14.4 {GIF buffer overflow} -setup {
mf9mzP9m//+ZAP+ZM/+ZZv+Zmf+ZzP+Z///MAP/MM//MZv/Mmf/MzP/M////
AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAKAAoAABUSAAD/HEiwoMGD
CBMqXMiwYcKAADs=
- }
+ }
+} -body {
+ # This crashes Tk up to 8.4.17 and 8.5.0
+ set i [image create photo]
+ $i configure -data $data
} -cleanup {
image delete $i
} -returnCodes error -result {malformed image}
-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}}
+test imgPhoto-15.1 {photo images can fail to allocate memory gracefully} -constraints {
+ nonPortable
+} -body {
+ # This is not portable to very large machines with more than around 3GB of
+ # free memory available...
+ image create photo -width 32000 -height 32000
+} -returnCodes error -result {not enough free memory for image buffer}
-test imgPhoto-16.1 {copying to self doesn't access freed memory} {
- # Bug 877950 makes this crash when trying to copy out of a deallocated area
+test imgPhoto-16.1 {copying to self doesn't access freed memory} -setup {
set i [image create photo]
+} -body {
+ # Bug 877950 makes this crash when trying to copy out of a deallocated
+ # area.
$i put red -to 0 0 1000 1000
$i copy $i -from 0 0 1000 1000 -to 500 0
+} -cleanup {
+ image delete $i
+} -result {}
+
+# Check that we can guess our supported output formats [Bug 2983824]
+test imgPhoto-17.1 {photo write: format guessing from filename} -setup {
+ set i [image create photo -width 3 -height 3]
+} -body {
+ set f [makeFile {} test.png]
+ $i write $f
+ set fd [open $f]
+ seek $fd 1
+ read $fd 3
+} -cleanup {
+ catch {close $fd}
+ image delete $i
+ catch {removeFile $f}
+} -result PNG
+test imgPhoto-17.2 {photo write: format guessing from filename} -setup {
+ set i [image create photo -width 3 -height 3]
+} -body {
+ set f [makeFile {} test.gif]
+ $i write $f
+ set fd [open $f]
+ read $fd 3
+} -cleanup {
+ catch {close $fd}
+ image delete $i
+ catch {removeFile $f}
+} -result GIF
+test imgPhoto-17.3 {photo write: format guessing from filename} -setup {
+ set i [image create photo -width 3 -height 3]
+} -body {
+ set f [makeFile {} test.ppm]
+ $i write $f
+ set fd [open $f]
+ read $fd 3
+} -cleanup {
+ catch {close $fd}
image delete $i
-} {}
+ catch {removeFile $f}
+} -result "P6\n"
-destroy .c
-eval image delete [image names]
+# ----------------------------------------------------------------------
+
+catch {rename foreachPixel {}}
+catch {rename checkImgTrans {}}
+catch {rename checkImgTransLoop {}}
+imageFinish
# cleanup
removeFile README-imgPhoto
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/listbox.test b/tests/listbox.test
index 25bc606..0805528 100644
--- a/tests/listbox.test
+++ b/tests/listbox.test
@@ -6,9 +6,10 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
set fixed {Courier -12}
@@ -39,7 +40,7 @@ proc resetGridInfo {} {
# to partially visible lines.
proc mkPartial {{w .partial}} {
- catch {destroy $w}
+ destroy $w
toplevel $w
wm geometry $w +0+0
listbox $w.l -width 30 -height 5
@@ -59,128 +60,332 @@ option add *Listbox.borderWidth 2
option add *Listbox.highlightThickness 2
option add *Listbox.font {Helvetica -12 bold}
+# Listbox used in 3.* configuration options tests
listbox .l
pack .l
update
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}}
- {-foreground #110022 #110022 bogus {unknown color name "bogus"}}
- {-height 30 30 20p {expected integer but got "20p"}}
- {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}}
- {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}}
- {-highlightthickness 6 6 bogus {bad screen distance "bogus"}}
- {-highlightthickness -2 0 {} {}}
- {-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"}}
- {-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} {} {}}
- {-yscrollcommand {Another command} {Another command} {} {}}
- {-listvar testVariable testVariable {} {}}
-} {
- set name [lindex $test 0]
- test listbox-1.$i {configuration options} {
- .l configure $name [lindex $test 1]
- list [lindex [.l configure $name] 4] [.l cget $name]
- } [list [lindex $test 2] [lindex $test 2]]
- incr i
- if {[lindex $test 3] != ""} {
- test listbox-1.$i {configuration options} {
- list [catch {.l configure $name [lindex $test 3]} msg] $msg
- } [list 1 [lindex $test 4]]
- }
- .l configure $name [lindex [.l configure $name] 3]
- incr i
-}
+test listbox-1.1 {configuration options} -body {
+ .l configure -activestyle under
+ list [lindex [.l configure -activestyle] 4] [.l cget -activestyle]
+} -cleanup {
+ .l configure -activestyle [lindex [.l configure -activestyle] 3]
+} -result {underline underline}
+test listbox-1.2 {configuration options} -body {
+ .l configure -activestyle foo
+} -returnCodes error -result {bad activestyle "foo": must be dotbox, none, or underline}
+test listbox-1.3 {configuration options} -body {
+ .l configure -background #ff0000
+ list [lindex [.l configure -background] 4] [.l cget -background]
+} -cleanup {
+ .l configure -background [lindex [.l configure -background] 3]
+} -result {{#ff0000} #ff0000}
+test listbox-1.4 {configuration options} -body {
+ .l configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test listbox-1.5 {configuration options} -body {
+ .l configure -bd 4
+ list [lindex [.l configure -bd] 4] [.l cget -bd]
+} -cleanup {
+ .l configure -bd [lindex [.l configure -bd] 3]
+} -result {4 4}
+test listbox-1.6 {configuration options} -body {
+ .l configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test listbox-1.7 {configuration options} -body {
+ .l configure -bg #ff0000
+ list [lindex [.l configure -bg] 4] [.l cget -bg]
+} -cleanup {
+ .l configure -bg [lindex [.l configure -bg] 3]
+} -result {{#ff0000} #ff0000}
+test listbox-1.8 {configuration options} -body {
+ .l configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test listbox-1.9 {configuration options} -body {
+ .l configure -borderwidth 1.3
+ list [lindex [.l configure -borderwidth] 4] [.l cget -borderwidth]
+} -cleanup {
+ .l configure -borderwidth [lindex [.l configure -borderwidth] 3]
+} -result {1 1}
+test listbox-1.10 {configuration options} -body {
+ .l configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test listbox-1.11 {configuration options} -body {
+ .l configure -cursor arrow
+ list [lindex [.l configure -cursor] 4] [.l cget -cursor]
+} -cleanup {
+ .l configure -cursor [lindex [.l configure -cursor] 3]
+} -result {arrow arrow}
+test listbox-1.12 {configuration options} -body {
+ .l configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test listbox-1.13 {configuration options} -body {
+ .l configure -disabledforeground #110022
+ list [lindex [.l configure -disabledforeground] 4] [.l cget -disabledforeground]
+} -cleanup {
+ .l configure -disabledforeground [lindex [.l configure -disabledforeground] 3]
+} -result {{#110022} #110022}
+test listbox-1.14 {configuration options} -body {
+ .l configure -disabledforeground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.15 {configuration options} -body {
+ .l configure -exportselection yes
+ list [lindex [.l configure -exportselection] 4] [.l cget -exportselection]
+} -cleanup {
+ .l configure -exportselection [lindex [.l configure -exportselection] 3]
+} -result {1 1}
+test listbox-1.16 {configuration options} -body {
+ .l configure -exportselection xyzzy
+} -returnCodes error -result {expected boolean value but got "xyzzy"}
+test listbox-1.17 {configuration options} -body {
+ .l configure -fg #110022
+ list [lindex [.l configure -fg] 4] [.l cget -fg]
+} -cleanup {
+ .l configure -fg [lindex [.l configure -fg] 3]
+} -result {{#110022} #110022}
+test listbox-1.18 {configuration options} -body {
+ .l configure -fg bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.19 {configuration options} -body {
+ .l configure -font {Helvetica 12}
+ list [lindex [.l configure -font] 4] [.l cget -font]
+} -cleanup {
+ .l configure -font [lindex [.l configure -font] 3]
+} -result {{Helvetica 12} {Helvetica 12}}
+test listbox-1.21 {configuration options} -body {
+ .l configure -foreground #110022
+ list [lindex [.l configure -foreground] 4] [.l cget -foreground]
+} -cleanup {
+ .l configure -foreground [lindex [.l configure -foreground] 3]
+} -result {{#110022} #110022}
+test listbox-1.22 {configuration options} -body {
+ .l configure -foreground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.23 {configuration options} -body {
+ .l configure -height 30
+ list [lindex [.l configure -height] 4] [.l cget -height]
+} -cleanup {
+ .l configure -height [lindex [.l configure -height] 3]
+} -result {30 30}
+test listbox-1.24 {configuration options} -body {
+ .l configure -height 20p
+} -returnCodes error -result {expected integer but got "20p"}
+test listbox-1.25 {configuration options} -body {
+ .l configure -highlightbackground #112233
+ list [lindex [.l configure -highlightbackground] 4] [.l cget -highlightbackground]
+} -cleanup {
+ .l configure -highlightbackground [lindex [.l configure -highlightbackground] 3]
+} -result {{#112233} #112233}
+test listbox-1.26 {configuration options} -body {
+ .l configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test listbox-1.27 {configuration options} -body {
+ .l configure -highlightcolor #123456
+ list [lindex [.l configure -highlightcolor] 4] [.l cget -highlightcolor]
+} -cleanup {
+ .l configure -highlightcolor [lindex [.l configure -highlightcolor] 3]
+} -result {{#123456} #123456}
+test listbox-1.28 {configuration options} -body {
+ .l configure -highlightcolor bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.29 {configuration options} -body {
+ .l configure -highlightthickness 6
+ list [lindex [.l configure -highlightthickness] 4] [.l cget -highlightthickness]
+} -cleanup {
+ .l configure -highlightthickness [lindex [.l configure -highlightthickness] 3]
+} -result {6 6}
+test listbox-1.30 {configuration options} -body {
+ .l configure -highlightthickness bogus
+} -returnCodes error -result {bad screen distance "bogus"}
+test listbox-1.31 {configuration options} -body {
+ .l configure -highlightthickness -2
+ list [lindex [.l configure -highlightthickness] 4] [.l cget -highlightthickness]
+} -cleanup {
+ .l configure -highlightthickness [lindex [.l configure -highlightthickness] 3]
+} -result {0 0}
+test listbox-1.33 {configuration options} -body {
+ .l configure -relief groove
+ list [lindex [.l configure -relief] 4] [.l cget -relief]
+} -cleanup {
+ .l configure -relief [lindex [.l configure -relief] 3]
+} -result {groove groove}
+test listbox-1.34 {configuration options} -body {
+ .l configure -relief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test listbox-1.35 {configuration options} -body {
+ .l configure -selectbackground #110022
+ list [lindex [.l configure -selectbackground] 4] [.l cget -selectbackground]
+} -cleanup {
+ .l configure -selectbackground [lindex [.l configure -selectbackground] 3]
+} -result {{#110022} #110022}
+test listbox-1.36 {configuration options} -body {
+ .l configure -selectbackground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.37 {configuration options} -body {
+ .l configure -selectborderwidth 1.3
+ list [lindex [.l configure -selectborderwidth] 4] [.l cget -selectborderwidth]
+} -cleanup {
+ .l configure -selectborderwidth [lindex [.l configure -selectborderwidth] 3]
+} -result {1 1}
+test listbox-1.38 {configuration options} -body {
+ .l configure -selectborderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test listbox-1.39 {configuration options} -body {
+ .l configure -selectforeground #654321
+ list [lindex [.l configure -selectforeground] 4] [.l cget -selectforeground]
+} -cleanup {
+ .l configure -selectforeground [lindex [.l configure -selectforeground] 3]
+} -result {{#654321} #654321}
+test listbox-1.40 {configuration options} -body {
+ .l configure -selectforeground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-1.41 {configuration options} -body {
+ .l configure -selectmode string
+ list [lindex [.l configure -selectmode] 4] [.l cget -selectmode]
+} -cleanup {
+ .l configure -selectmode [lindex [.l configure -selectmode] 3]
+} -result {string string}
+test listbox-1.43 {configuration options} -body {
+ .l configure -setgrid false
+ list [lindex [.l configure -setgrid] 4] [.l cget -setgrid]
+} -cleanup {
+ .l configure -setgrid [lindex [.l configure -setgrid] 3]
+} -result {0 0}
+test listbox-1.44 {configuration options} -body {
+ .l configure -setgrid lousy
+} -returnCodes error -result {expected boolean value but got "lousy"}
+test listbox-1.45 {configuration options} -body {
+ .l configure -state disabled
+ list [lindex [.l configure -state] 4] [.l cget -state]
+} -cleanup {
+ .l configure -state [lindex [.l configure -state] 3]
+} -result {disabled disabled}
+test listbox-1.46 {configuration options} -body {
+ .l configure -state foo
+} -returnCodes error -result {bad state "foo": must be disabled or normal}
+test listbox-1.47 {configuration options} -body {
+ .l configure -takefocus {any string}
+ list [lindex [.l configure -takefocus] 4] [.l cget -takefocus]
+} -cleanup {
+ .l configure -takefocus [lindex [.l configure -takefocus] 3]
+} -result {{any string} {any string}}
+test listbox-1.49 {configuration options} -body {
+ .l configure -width 45
+ list [lindex [.l configure -width] 4] [.l cget -width]
+} -cleanup {
+ .l configure -width [lindex [.l configure -width] 3]
+} -result {45 45}
+test listbox-1.50 {configuration options} -body {
+ .l configure -width 3p
+} -returnCodes error -result {expected integer but got "3p"}
+test listbox-1.51 {configuration options} -body {
+ .l configure -xscrollcommand {Some command}
+ list [lindex [.l configure -xscrollcommand] 4] [.l cget -xscrollcommand]
+} -cleanup {
+ .l configure -xscrollcommand [lindex [.l configure -xscrollcommand] 3]
+} -result {{Some command} {Some command}}
+test listbox-1.53 {configuration options} -body {
+ .l configure -yscrollcommand {Another command}
+ list [lindex [.l configure -yscrollcommand] 4] [.l cget -yscrollcommand]
+} -cleanup {
+ .l configure -yscrollcommand [lindex [.l configure -yscrollcommand] 3]
+} -result {{Another command} {Another command}}
+test listbox-1.55 {configuration options} -body {
+ .l configure -listvar testVariable
+ list [lindex [.l configure -listvar] 4] [.l cget -listvar]
+} -cleanup {
+ .l configure -listvar [lindex [.l configure -listvar] 3]
+} -result {testVariable testVariable}
+
-test listbox-2.1 {Tk_ListboxCmd procedure} {
- list [catch {listbox} msg] $msg
-} {1 {wrong # args: should be "listbox pathName ?options?"}}
-test listbox-2.2 {Tk_ListboxCmd procedure} {
- list [catch {listbox gorp} msg] $msg
-} {1 {bad window path name "gorp"}}
-test listbox-2.3 {Tk_ListboxCmd procedure} {
- catch {destroy .l}
+test listbox-2.1 {Tk_ListboxCmd procedure} -body {
+ listbox
+} -returnCodes error -result {wrong # args: should be "listbox pathName ?-option value ...?"}
+test listbox-2.2 {Tk_ListboxCmd procedure} -body {
+ listbox gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test listbox-2.3 {Tk_ListboxCmd procedure} -setup {
+ destroy .l
+} -body {
listbox .l
list [winfo exists .l] [winfo class .l] [info commands .l]
-} {1 Listbox .l}
-test listbox-2.4 {Tk_ListboxCmd procedure} {
- catch {destroy .l}
- list [catch {listbox .l -gorp foo} msg] $msg [winfo exists .l] \
- [info commands .l]
-} {1 {unknown option "-gorp"} 0 {}}
-test listbox-2.5 {Tk_ListboxCmd procedure} {
- catch {destroy .l}
+} -result {1 Listbox .l}
+test listbox-2.4 {Tk_ListboxCmd procedure} -setup {
+ destroy .l
+} -body {
+ listbox .l -gorp foo
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {unknown option "-gorp"}
+test listbox-2.4.1 {Tk_ListboxCmd procedure} -setup {
+ destroy .l
+} -body {
+ catch {listbox .l -gorp foo}
+ list [winfo exists .l] [info commands .l]
+} -cleanup {
+ destroy .l
+} -result {0 {}}
+test listbox-2.5 {Tk_ListboxCmd procedure} -setup {
+ destroy .l
+} -body {
listbox .l
-} {.l}
+} -cleanup {
+ destroy .l
+} -result {.l}
-catch {destroy .l}
+
+# Listbox used in 3.1 -3.115 tests
+destroy .l
listbox .l -width 20 -height 5 -bd 4 -highlightthickness 1 -selectborderwidth 2
pack .l
.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11 el12 el13 el14 \
el15 el16 el17
update
-test listbox-3.1 {ListboxWidgetCmd procedure} {
- list [catch .l msg] $msg
-} {1 {wrong # args: should be ".l option ?arg arg ...?"}}
-test listbox-3.2 {ListboxWidgetCmd procedure, "activate" option} {
- list [catch {.l activate} msg] $msg
-} {1 {wrong # args: should be ".l activate index"}}
-test listbox-3.3 {ListboxWidgetCmd procedure, "activate" option} {
- list [catch {.l activate a b} msg] $msg
-} {1 {wrong # args: should be ".l activate index"}}
-test listbox-3.4 {ListboxWidgetCmd procedure, "activate" option} {
- list [catch {.l activate fooey} msg] $msg
-} {1 {bad listbox index "fooey": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.5 {ListboxWidgetCmd procedure, "activate" option} {
+test listbox-3.1 {ListboxWidgetCmd procedure} -body {
+ .l
+} -returnCodes error -result {wrong # args: should be ".l option ?arg ...?"}
+test listbox-3.2 {ListboxWidgetCmd procedure, "activate" option} -body {
+ .l activate
+} -returnCodes error -result {wrong # args: should be ".l activate index"}
+test listbox-3.3 {ListboxWidgetCmd procedure, "activate" option} -body {
+ .l activate a b
+} -returnCodes error -result {wrong # args: should be ".l activate index"}
+test listbox-3.4 {ListboxWidgetCmd procedure, "activate" option} -body {
+ .l activate fooey
+} -returnCodes error -result {bad listbox index "fooey": must be active, anchor, end, @x,y, or a number}
+test listbox-3.5 {ListboxWidgetCmd procedure, "activate" option} -body {
.l activate 3
.l index active
-} 3
-test listbox-3.6 {ListboxWidgetCmd procedure, "activate" option} {
+} -result 3
+test listbox-3.6 {ListboxWidgetCmd procedure, "activate" option} -body {
.l activate -1
.l index active
-} {0}
-test listbox-3.7 {ListboxWidgetCmd procedure, "activate" option} {
+} -result {0}
+test listbox-3.7 {ListboxWidgetCmd procedure, "activate" option} -body {
.l activate 30
.l index active
-} {17}
-test listbox-3.8 {ListboxWidgetCmd procedure, "activate" option} {
+} -result {17}
+test listbox-3.8 {ListboxWidgetCmd procedure, "activate" option} -body {
.l activate end
.l index active
-} {17}
-test listbox-3.9 {ListboxWidgetCmd procedure, "bbox" option} {
- list [catch {.l bbox} msg] $msg
-} {1 {wrong # args: should be ".l bbox index"}}
-test listbox-3.10 {ListboxWidgetCmd procedure, "bbox" option} {
- list [catch {.l bbox a b} msg] $msg
-} {1 {wrong # args: should be ".l bbox index"}}
-test listbox-3.11 {ListboxWidgetCmd procedure, "bbox" option} {
- list [catch {.l bbox fooey} msg] $msg
-} {1 {bad listbox index "fooey": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.12 {ListboxWidgetCmd procedure, "bbox" option} {
+} -result {17}
+test listbox-3.9 {ListboxWidgetCmd procedure, "bbox" option} -body {
+ .l bbox
+} -returnCodes error -result {wrong # args: should be ".l bbox index"}
+test listbox-3.10 {ListboxWidgetCmd procedure, "bbox" option} -body {
+ .l bbox a b
+} -returnCodes error -result {wrong # args: should be ".l bbox index"}
+test listbox-3.11 {ListboxWidgetCmd procedure, "bbox" option} -body {
+ .l bbox fooey
+} -returnCodes error -result {bad listbox index "fooey": must be active, anchor, end, @x,y, or a number}
+test listbox-3.12 {ListboxWidgetCmd procedure, "bbox" option} -body {
.l yview 3
update
list [.l bbox 2] [.l bbox 8]
-} {{} {}}
-test listbox-3.13 {ListboxWidgetCmd procedure, "bbox" option} {
+} -result {{} {}}
+test listbox-3.13 {ListboxWidgetCmd procedure, "bbox" option} -cleanup {
+ destroy .l2
+} -body {
# Used to generate a core dump before a bug was fixed (the last
# element would be on-screen if it existed, but it doesn't exist).
@@ -190,24 +395,35 @@ test listbox-3.13 {ListboxWidgetCmd procedure, "bbox" option} {
set x [.l2 bbox 0]
destroy .l2
set x
-} {}
-test listbox-3.14 {ListboxWidgetCmd procedure, "bbox" option} {fonts} {
+} -cleanup {
+ destroy .l2
+} -result {}
+test listbox-3.14 {ListboxWidgetCmd procedure, "bbox" option} -constraints {
+ fonts
+} -body {
.l yview 3
update
list [.l bbox 3] [.l bbox 4]
-} {{7 7 17 14} {7 26 17 14}}
-test listbox-3.15 {ListboxWidgetCmd procedure, "bbox" option} {fonts} {
+} -result {{7 7 17 14} {7 26 17 14}}
+test listbox-3.15 {ListboxWidgetCmd procedure, "bbox" option} -constraints {
+ fonts
+} -body {
.l yview 0
update
list [.l bbox -1] [.l bbox 0]
-} {{} {7 7 17 14}}
-test listbox-3.16 {ListboxWidgetCmd procedure, "bbox" option} {fonts} {
+} -result {{} {7 7 17 14}}
+test listbox-3.16 {ListboxWidgetCmd procedure, "bbox" option} -constraints {
+ fonts
+} -body {
.l yview end
update
list [.l bbox 17] [.l bbox end] [.l bbox 18]
-} {{7 83 24 14} {7 83 24 14} {}}
-test listbox-3.17 {ListboxWidgetCmd procedure, "bbox" option} {fonts} {
- catch {destroy .t}
+} -result {{7 83 24 14} {7 83 24 14} {}}
+test listbox-3.17 {ListboxWidgetCmd procedure, "bbox" option} -constraints {
+ fonts
+} -setup {
+ destroy .t
+} -body {
toplevel .t
wm geom .t +0+0
listbox .t.l -width 10 -height 5
@@ -216,255 +432,307 @@ test listbox-3.17 {ListboxWidgetCmd procedure, "bbox" option} {fonts} {
update
.t.l xview moveto .2
.t.l bbox 2
-} {-72 39 393 14}
-test listbox-3.18 {ListboxWidgetCmd procedure, "bbox" option, partial last line} {fonts} {
+} -cleanup {
+ destroy .t
+} -result {-72 39 393 14}
+test listbox-3.18 {ListboxWidgetCmd procedure, "bbox" option, partial last line} -constraints {
+ fonts
+} -body {
mkPartial
list [.partial.l bbox 3] [.partial.l bbox 4]
-} {{5 56 24 14} {5 73 23 14}}
-test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} {
- list [catch {.l cget} msg] $msg
-} {1 {wrong # args: should be ".l cget option"}}
-test listbox-3.20 {ListboxWidgetCmd procedure, "cget" option} {
- list [catch {.l cget a b} msg] $msg
-} {1 {wrong # args: should be ".l cget option"}}
-test listbox-3.21 {ListboxWidgetCmd procedure, "cget" option} {
- list [catch {.l cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test listbox-3.22 {ListboxWidgetCmd procedure, "cget" option} {
+} -result {{5 56 24 14} {5 73 23 14}}
+test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body {
+ .l cget
+} -returnCodes error -result {wrong # args: should be ".l cget option"}
+test listbox-3.20 {ListboxWidgetCmd procedure, "cget" option} -body {
+ .l cget a b
+} -returnCodes error -result {wrong # args: should be ".l cget option"}
+test listbox-3.21 {ListboxWidgetCmd procedure, "cget" option} -body {
+ .l cget -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test listbox-3.22 {ListboxWidgetCmd procedure, "cget" option} -body {
.l cget -setgrid
-} {0}
-test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} {
+} -result {0}
+test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} -body {
llength [.l configure]
-} {27}
-test listbox-3.24 {ListboxWidgetCmd procedure, "configure" option} {
- list [catch {.l configure -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test listbox-3.25 {ListboxWidgetCmd procedure, "configure" option} {
+} -result {27}
+test listbox-3.24 {ListboxWidgetCmd procedure, "configure" option} -body {
+ .l configure -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test listbox-3.25 {ListboxWidgetCmd procedure, "configure" option} -body {
.l configure -setgrid
-} {-setgrid setGrid SetGrid 0 0}
-test listbox-3.26 {ListboxWidgetCmd procedure, "configure" option} {
- list [catch {.l configure -gorp is_messy} msg] $msg
-} {1 {unknown option "-gorp"}}
-test listbox-3.27 {ListboxWidgetCmd procedure, "configure" option} {
+} -result {-setgrid setGrid SetGrid 0 0}
+test listbox-3.26 {ListboxWidgetCmd procedure, "configure" option} -body {
+ .l configure -gorp is_messy
+} -returnCodes error -result {unknown option "-gorp"}
+test listbox-3.27 {ListboxWidgetCmd procedure, "configure" option} -body {
set oldbd [.l cget -bd]
set oldht [.l cget -highlightthickness]
.l configure -bd 3 -highlightthickness 0
set x "[.l cget -bd] [.l cget -highlightthickness]"
.l configure -bd $oldbd -highlightthickness $oldht
set x
-} {3 0}
-test listbox-3.28 {ListboxWidgetCmd procedure, "curselection" option} {
- list [catch {.l curselection a} msg] $msg
-} {1 {wrong # args: should be ".l curselection"}}
-test listbox-3.29 {ListboxWidgetCmd procedure, "curselection" option} {
+} -result {3 0}
+test listbox-3.28 {ListboxWidgetCmd procedure, "curselection" option} -body {
+ .l curselection a
+} -returnCodes error -result {wrong # args: should be ".l curselection"}
+test listbox-3.29 {ListboxWidgetCmd procedure, "curselection" option} -body {
.l selection clear 0 end
.l selection set 3 6
.l selection set 9
.l curselection
-} {3 4 5 6 9}
-test listbox-3.30 {ListboxWidgetCmd procedure, "delete" option} {
- list [catch {.l delete} msg] $msg
-} {1 {wrong # args: should be ".l delete firstIndex ?lastIndex?"}}
-test listbox-3.31 {ListboxWidgetCmd procedure, "delete" option} {
- list [catch {.l delete a b c} msg] $msg
-} {1 {wrong # args: should be ".l delete firstIndex ?lastIndex?"}}
-test listbox-3.32 {ListboxWidgetCmd procedure, "delete" option} {
- list [catch {.l delete badIndex} msg] $msg
-} {1 {bad listbox index "badIndex": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.33 {ListboxWidgetCmd procedure, "delete" option} {
- list [catch {.l delete 2 123ab} msg] $msg
-} {1 {bad listbox index "123ab": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.34 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -result {3 4 5 6 9}
+test listbox-3.30 {ListboxWidgetCmd procedure, "delete" option} -body {
+ .l delete
+} -returnCodes error -result {wrong # args: should be ".l delete firstIndex ?lastIndex?"}
+test listbox-3.31 {ListboxWidgetCmd procedure, "delete" option} -body {
+ .l delete a b c
+} -returnCodes error -result {wrong # args: should be ".l delete firstIndex ?lastIndex?"}
+test listbox-3.32 {ListboxWidgetCmd procedure, "delete" option} -body {
+ .l delete badIndex
+} -returnCodes error -result {bad listbox index "badIndex": must be active, anchor, end, @x,y, or a number}
+test listbox-3.33 {ListboxWidgetCmd procedure, "delete" option} -body {
+ .l delete 2 123ab
+} -returnCodes error -result {bad listbox index "123ab": must be active, anchor, end, @x,y, or a number}
+test listbox-3.34 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete 3
list [.l2 get 2] [.l2 get 3] [.l2 index end]
-} {el2 el4 7}
-test listbox-3.35 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el2 el4 7}
+test listbox-3.35 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete 2 4
list [.l2 get 1] [.l2 get 2] [.l2 index end]
-} {el1 el5 5}
-test listbox-3.36 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el1 el5 5}
+test listbox-3.36 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete -3 2
.l2 get 0 end
-} {el3 el4 el5 el6 el7}
-test listbox-3.37 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el3 el4 el5 el6 el7}
+test listbox-3.37 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete -3 -1
.l2 get 0 end
-} {el0 el1 el2 el3 el4 el5 el6 el7}
-test listbox-3.38 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el1 el2 el3 el4 el5 el6 el7}
+test listbox-3.38 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete 2 end
.l2 get 0 end
-} {el0 el1}
-test listbox-3.39 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el1}
+test listbox-3.39 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete 5 20
.l2 get 0 end
-} {el0 el1 el2 el3 el4}
-test listbox-3.40 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el1 el2 el3 el4}
+test listbox-3.40 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete end 20
.l2 get 0 end
-} {el0 el1 el2 el3 el4 el5 el6}
-test listbox-3.41 {ListboxWidgetCmd procedure, "delete" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el1 el2 el3 el4 el5 el6}
+test listbox-3.41 {ListboxWidgetCmd procedure, "delete" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
.l2 delete 8 20
.l2 get 0 end
-} {el0 el1 el2 el3 el4 el5 el6 el7}
-test listbox-3.42 {ListboxWidgetCmd procedure, "get" option} {
- list [catch {.l get} msg] $msg
-} {1 {wrong # args: should be ".l get firstIndex ?lastIndex?"}}
-test listbox-3.43 {ListboxWidgetCmd procedure, "get" option} {
- list [catch {.l get a b c} msg] $msg
-} {1 {wrong # args: should be ".l get firstIndex ?lastIndex?"}}
-test listbox-3.44 {ListboxWidgetCmd procedure, "get" option} {
- list [catch {.l get 2.4} msg] $msg
-} {1 {bad listbox index "2.4": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.45 {ListboxWidgetCmd procedure, "get" option} {
- list [catch {.l get end bogus} msg] $msg
-} {1 {bad listbox index "bogus": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.46 {ListboxWidgetCmd procedure, "get" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el1 el2 el3 el4 el5 el6 el7}
+test listbox-3.42 {ListboxWidgetCmd procedure, "get" option} -body {
+ .l get
+} -returnCodes error -result {wrong # args: should be ".l get firstIndex ?lastIndex?"}
+test listbox-3.43 {ListboxWidgetCmd procedure, "get" option} -body {
+ .l get a b c
+} -returnCodes error -result {wrong # args: should be ".l get firstIndex ?lastIndex?"}
+test listbox-3.44 {ListboxWidgetCmd procedure, "get" option} -body {
+ .l get 2.4
+} -returnCodes error -result {bad listbox index "2.4": must be active, anchor, end, @x,y, or a number}
+test listbox-3.45 {ListboxWidgetCmd procedure, "get" option} -body {
+ .l get end bogus
+} -returnCodes error -result {bad listbox index "bogus": must be active, anchor, end, @x,y, or a number}
+test listbox-3.46 {ListboxWidgetCmd procedure, "get" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 el3 el4 el5 el6 el7
list [.l2 get 0] [.l2 get 3] [.l2 get end]
-} {el0 el3 el7}
-test listbox-3.47 {ListboxWidgetCmd procedure, "get" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {el0 el3 el7}
+test listbox-3.47 {ListboxWidgetCmd procedure, "get" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
list [.l2 get 0] [.l2 get end]
-} {{} {}}
-test listbox-3.48 {ListboxWidgetCmd procedure, "get" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {{} {}}
+test listbox-3.48 {ListboxWidgetCmd procedure, "get" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 el0 el1 el2 "two words" el4 el5 el6 el7
.l2 get 3 end
-} {{two words} el4 el5 el6 el7}
-test listbox-3.49 {ListboxWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .l2
+} -result {{two words} el4 el5 el6 el7}
+test listbox-3.49 {ListboxWidgetCmd procedure, "get" option} -body {
.l get -1
-} {}
-test listbox-3.50 {ListboxWidgetCmd procedure, "get" option} {
+} -result {}
+test listbox-3.50 {ListboxWidgetCmd procedure, "get" option} -body {
.l get -2 -1
-} {}
-test listbox-3.51 {ListboxWidgetCmd procedure, "get" option} {
+} -result {}
+test listbox-3.51 {ListboxWidgetCmd procedure, "get" option} -body {
.l get -2 3
-} {el0 el1 el2 el3}
-test listbox-3.52 {ListboxWidgetCmd procedure, "get" option} {
+} -result {el0 el1 el2 el3}
+test listbox-3.52 {ListboxWidgetCmd procedure, "get" option} -body {
.l get 12 end
-} {el12 el13 el14 el15 el16 el17}
-test listbox-3.53 {ListboxWidgetCmd procedure, "get" option} {
+} -result {el12 el13 el14 el15 el16 el17}
+test listbox-3.53 {ListboxWidgetCmd procedure, "get" option} -body {
.l get 12 20
-} {el12 el13 el14 el15 el16 el17}
-test listbox-3.54 {ListboxWidgetCmd procedure, "get" option} {
+} -result {el12 el13 el14 el15 el16 el17}
+test listbox-3.54 {ListboxWidgetCmd procedure, "get" option} -body {
.l get end
-} {el17}
-test listbox-3.55 {ListboxWidgetCmd procedure, "get" option} {
+} -result {el17}
+test listbox-3.55 {ListboxWidgetCmd procedure, "get" option} -body {
.l get 30
-} {}
-test listbox-3.56 {ListboxWidgetCmd procedure, "get" option} {
+} -result {}
+test listbox-3.56 {ListboxWidgetCmd procedure, "get" option} -body {
.l get 30 35
-} {}
-test listbox-3.57 {ListboxWidgetCmd procedure, "index" option} {
- list [catch {.l index} msg] $msg
-} {1 {wrong # args: should be ".l index index"}}
-test listbox-3.58 {ListboxWidgetCmd procedure, "index" option} {
- list [catch {.l index a b} msg] $msg
-} {1 {wrong # args: should be ".l index index"}}
-test listbox-3.59 {ListboxWidgetCmd procedure, "index" option} {
- list [catch {.l index @} msg] $msg
-} {1 {bad listbox index "@": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.60 {ListboxWidgetCmd procedure, "index" option} {
+} -result {}
+test listbox-3.57 {ListboxWidgetCmd procedure, "index" option} -body {
+ .l index
+} -returnCodes error -result {wrong # args: should be ".l index index"}
+test listbox-3.58 {ListboxWidgetCmd procedure, "index" option} -body {
+ .l index a b
+} -returnCodes error -result {wrong # args: should be ".l index index"}
+test listbox-3.59 {ListboxWidgetCmd procedure, "index" option} -body {
+ .l index @
+} -returnCodes error -result {bad listbox index "@": must be active, anchor, end, @x,y, or a number}
+test listbox-3.60 {ListboxWidgetCmd procedure, "index" option} -body {
.l index 2
-} 2
-test listbox-3.61 {ListboxWidgetCmd procedure, "index" option} {
+} -result 2
+test listbox-3.61 {ListboxWidgetCmd procedure, "index" option} -body {
.l index -1
-} -1
-test listbox-3.62 {ListboxWidgetCmd procedure, "index" option} {
+} -result {-1}
+test listbox-3.62 {ListboxWidgetCmd procedure, "index" option} -body {
.l index end
-} 18
-test listbox-3.63 {ListboxWidgetCmd procedure, "index" option} {
+} -result 18
+test listbox-3.63 {ListboxWidgetCmd procedure, "index" option} -body {
.l index 34
-} 34
-test listbox-3.64 {ListboxWidgetCmd procedure, "insert" option} {
- list [catch {.l insert} msg] $msg
-} {1 {wrong # args: should be ".l insert index ?element element ...?"}}
-test listbox-3.65 {ListboxWidgetCmd procedure, "insert" option} {
- list [catch {.l insert badIndex} msg] $msg
-} {1 {bad listbox index "badIndex": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.66 {ListboxWidgetCmd procedure, "insert" option} {
- catch {destroy .l2}
+} -result 34
+test listbox-3.64 {ListboxWidgetCmd procedure, "insert" option} -body {
+ .l insert
+} -returnCodes error -result {wrong # args: should be ".l insert index ?element ...?"}
+test listbox-3.65 {ListboxWidgetCmd procedure, "insert" option} -body {
+ .l insert badIndex
+} -returnCodes error -result {bad listbox index "badIndex": must be active, anchor, end, @x,y, or a number}
+test listbox-3.66 {ListboxWidgetCmd procedure, "insert" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert end a b c d e
.l2 insert 3 x y z
.l2 get 0 end
-} {a b c x y z d e}
-test listbox-3.67 {ListboxWidgetCmd procedure, "insert" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {a b c x y z d e}
+test listbox-3.67 {ListboxWidgetCmd procedure, "insert" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert end a b c
.l2 insert -1 x
.l2 get 0 end
-} {x a b c}
-test listbox-3.68 {ListboxWidgetCmd procedure, "insert" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {x a b c}
+test listbox-3.68 {ListboxWidgetCmd procedure, "insert" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert end a b c
.l2 insert end x
.l2 get 0 end
-} {a b c x}
-test listbox-3.69 {ListboxWidgetCmd procedure, "insert" option} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {a b c x}
+test listbox-3.69 {ListboxWidgetCmd procedure, "insert" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert end a b c
.l2 insert 43 x
.l2 get 0 end
-} {a b c x}
-test listbox-3.70 {ListboxWidgetCmd procedure, "nearest" option} {
- list [catch {.l nearest} msg] $msg
-} {1 {wrong # args: should be ".l nearest y"}}
-test listbox-3.71 {ListboxWidgetCmd procedure, "nearest" option} {
- list [catch {.l nearest a b} msg] $msg
-} {1 {wrong # args: should be ".l nearest y"}}
-test listbox-3.72 {ListboxWidgetCmd procedure, "nearest" option} {
- list [catch {.l nearest 20p} msg] $msg
-} {1 {expected integer but got "20p"}}
-test listbox-3.73 {ListboxWidgetCmd procedure, "nearest" option} {
+} -cleanup {
+ destroy .l2
+} -result {a b c x}
+test listbox-3.70 {ListboxWidgetCmd procedure, "nearest" option} -body {
+ .l nearest
+} -returnCodes error -result {wrong # args: should be ".l nearest y"}
+test listbox-3.71 {ListboxWidgetCmd procedure, "nearest" option} -body {
+ .l nearest a b
+} -returnCodes error -result {wrong # args: should be ".l nearest y"}
+test listbox-3.72 {ListboxWidgetCmd procedure, "nearest" option} -body {
+ .l nearest 20p
+} -returnCodes error -result {expected integer but got "20p"}
+test listbox-3.73 {ListboxWidgetCmd procedure, "nearest" option} -body {
.l yview 3
.l nearest 1000
-} {7}
-test listbox-3.74 {ListboxWidgetCmd procedure, "scan" option} {
- list [catch {.l scan a b} msg] $msg
-} {1 {wrong # args: should be ".l scan mark|dragto x y"}}
-test listbox-3.75 {ListboxWidgetCmd procedure, "scan" option} {
- list [catch {.l scan a b c d} msg] $msg
-} {1 {wrong # args: should be ".l scan mark|dragto x y"}}
-test listbox-3.76 {ListboxWidgetCmd procedure, "scan" option} {
- list [catch {.l scan foo bogus 2} msg] $msg
-} {1 {expected integer but got "bogus"}}
-test listbox-3.77 {ListboxWidgetCmd procedure, "scan" option} {
- list [catch {.l scan foo 2 2.3} msg] $msg
-} {1 {expected integer but got "2.3"}}
-test listbox-3.78 {ListboxWidgetCmd procedure, "scan" option} {fonts} {
- catch {destroy .t}
+} -result {7}
+test listbox-3.74 {ListboxWidgetCmd procedure, "scan" option} -body {
+ .l scan a b
+} -returnCodes error -result {wrong # args: should be ".l scan mark|dragto x y"}
+test listbox-3.75 {ListboxWidgetCmd procedure, "scan" option} -body {
+ .l scan a b c d
+} -returnCodes error -result {wrong # args: should be ".l scan mark|dragto x y"}
+test listbox-3.76 {ListboxWidgetCmd procedure, "scan" option} -body {
+ .l scan foo bogus 2
+} -returnCodes error -result {expected integer but got "bogus"}
+test listbox-3.77 {ListboxWidgetCmd procedure, "scan" option} -body {
+ .l scan foo 2 2.3
+} -returnCodes error -result {expected integer but got "2.3"}
+test listbox-3.78 {ListboxWidgetCmd procedure, "scan" option} -constraints {
+ fonts
+} -setup {
+ destroy .t
+} -body {
toplevel .t
wm geom .t +0+0
listbox .t.l -width 10 -height 5
@@ -475,312 +743,461 @@ test listbox-3.78 {ListboxWidgetCmd procedure, "scan" option} {fonts} {
.t.l scan dragto 90 137
update
list [format {%.6g %.6g} {*}[.t.l xview]] [format {%.6g %.6g} {*}[.t.l yview]]
-} {{0.249364 0.427481} {0.0714286 0.428571}}
-test listbox-3.79 {ListboxWidgetCmd procedure, "scan" option} {
- list [catch {.l scan foo 2 4} msg] $msg
-} {1 {bad option "foo": must be mark or dragto}}
-test listbox-3.80 {ListboxWidgetCmd procedure, "see" option} {
- list [catch {.l see} msg] $msg
-} {1 {wrong # args: should be ".l see index"}}
-test listbox-3.81 {ListboxWidgetCmd procedure, "see" option} {
- list [catch {.l see a b} msg] $msg
-} {1 {wrong # args: should be ".l see index"}}
-test listbox-3.82 {ListboxWidgetCmd procedure, "see" option} {
- list [catch {.l see gorp} msg] $msg
-} {1 {bad listbox index "gorp": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.83 {ListboxWidgetCmd procedure, "see" option} {
+} -cleanup {
+ destroy .t
+} -result {{0.249364 0.427481} {0.0714286 0.428571}}
+test listbox-3.79 {ListboxWidgetCmd procedure, "scan" option} -body {
+ .l scan foo 2 4
+} -returnCodes error -result {bad option "foo": must be mark or dragto}
+test listbox-3.80 {ListboxWidgetCmd procedure, "see" option} -body {
+ .l see
+} -returnCodes error -result {wrong # args: should be ".l see index"}
+test listbox-3.81 {ListboxWidgetCmd procedure, "see" option} -body {
+ .l see a b
+} -returnCodes error -result {wrong # args: should be ".l see index"}
+test listbox-3.82 {ListboxWidgetCmd procedure, "see" option} -body {
+ .l see gorp
+} -returnCodes error -result {bad listbox index "gorp": must be active, anchor, end, @x,y, or a number}
+test listbox-3.83 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 7
.l index @0,0
-} {7}
-test listbox-3.84 {ListboxWidgetCmd procedure, "see" option} {
+} -result {7}
+test listbox-3.84 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 11
.l index @0,0
-} {7}
-test listbox-3.85 {ListboxWidgetCmd procedure, "see" option} {
+} -result {7}
+test listbox-3.85 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 6
.l index @0,0
-} {6}
-test listbox-3.86 {ListboxWidgetCmd procedure, "see" option} {
+} -result {6}
+test listbox-3.86 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 5
.l index @0,0
-} {3}
-test listbox-3.87 {ListboxWidgetCmd procedure, "see" option} {
+} -result {3}
+test listbox-3.87 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 12
.l index @0,0
-} {8}
-test listbox-3.88 {ListboxWidgetCmd procedure, "see" option} {
+} -result {8}
+test listbox-3.88 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 13
.l index @0,0
-} {11}
-test listbox-3.89 {ListboxWidgetCmd procedure, "see" option} {
+} -result {11}
+test listbox-3.89 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see -1
.l index @0,0
-} {0}
-test listbox-3.90 {ListboxWidgetCmd procedure, "see" option} {
+} -result {0}
+test listbox-3.90 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see end
.l index @0,0
-} {13}
-test listbox-3.91 {ListboxWidgetCmd procedure, "see" option} {
+} -result {13}
+test listbox-3.91 {ListboxWidgetCmd procedure, "see" option} -body {
.l yview 7
.l see 322
.l index @0,0
-} {13}
-test listbox-3.92 {ListboxWidgetCmd procedure, "see" option, partial last line} {
+} -result {13}
+test listbox-3.92 {ListboxWidgetCmd procedure, "see" option, partial last line} -body {
mkPartial
.partial.l see 4
.partial.l index @0,0
-} {1}
-test listbox-3.93 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l select a} msg] $msg
-} {1 {wrong # args: should be ".l selection option index ?index?"}}
-test listbox-3.94 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l select a b c d} msg] $msg
-} {1 {wrong # args: should be ".l selection option index ?index?"}}
-test listbox-3.95 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l selection a bogus} msg] $msg
-} {1 {bad listbox index "bogus": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.96 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l selection a 0 lousy} msg] $msg
-} {1 {bad listbox index "lousy": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.97 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l selection anchor 0 0} msg] $msg
-} {1 {wrong # args: should be ".l selection anchor index"}}
-test listbox-3.98 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {1}
+test listbox-3.93 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l select a
+} -returnCodes error -result {wrong # args: should be ".l selection option index ?index?"}
+test listbox-3.94 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l select a b c d
+} -returnCodes error -result {wrong # args: should be ".l selection option index ?index?"}
+test listbox-3.95 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection a bogus
+} -returnCodes error -result {bad listbox index "bogus": must be active, anchor, end, @x,y, or a number}
+test listbox-3.96 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection a 0 lousy
+} -returnCodes error -result {bad listbox index "lousy": must be active, anchor, end, @x,y, or a number}
+test listbox-3.97 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection anchor 0 0
+} -returnCodes error -result {wrong # args: should be ".l selection anchor index"}
+test listbox-3.98 {ListboxWidgetCmd procedure, "selection" option} -body {
list [.l selection anchor 5; .l index anchor] \
[.l selection anchor 0; .l index anchor]
-} {5 0}
-test listbox-3.99 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {5 0}
+test listbox-3.99 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection anchor -1
.l index anchor
-} {0}
-test listbox-3.100 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {0}
+test listbox-3.100 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection anchor end
.l index anchor
-} {17}
-test listbox-3.101 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {17}
+test listbox-3.101 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection anchor 44
.l index anchor
-} {17}
-test listbox-3.102 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {17}
+test listbox-3.102 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection clear 0 end
.l selection set 2 8
.l selection clear 3 4
.l curselection
-} {2 5 6 7 8}
-test listbox-3.103 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l selection includes 0 0} msg] $msg
-} {1 {wrong # args: should be ".l selection includes index"}}
-test listbox-3.104 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {2 5 6 7 8}
+test listbox-3.103 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection includes 0 0
+} -returnCodes error -result {wrong # args: should be ".l selection includes index"}
+test listbox-3.104 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection clear 0 end
.l selection set 2 8
.l selection clear 4
list [.l selection includes 3] [.l selection includes 4] \
[.l selection includes 5]
-} {1 0 1}
-test listbox-3.105 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {1 0 1}
+test listbox-3.105 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection set 0 end
.l selection includes -1
-} {0}
-test listbox-3.106 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {0}
+test listbox-3.106 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection clear 0 end
.l selection set end
.l selection includes end
-} {1}
-test listbox-3.107 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {1}
+test listbox-3.107 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection set 0 end
.l selection includes 44
-} {0}
-test listbox-3.108 {ListboxWidgetCmd procedure, "selection" option} {
- catch {destroy .l2}
+} -result {0}
+test listbox-3.108 {ListboxWidgetCmd procedure, "selection" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 selection includes 0
-} {0}
-test listbox-3.109 {ListboxWidgetCmd procedure, "selection" option} {
+} -cleanup {
+ destroy .l2
+} -result {0}
+test listbox-3.109 {ListboxWidgetCmd procedure, "selection" option} -body {
.l selection clear 0 end
.l selection set 2
.l selection set 5 7
.l curselection
-} {2 5 6 7}
-test listbox-3.110 {ListboxWidgetCmd procedure, "selection" option} {
+} -result {2 5 6 7}
+test listbox-3.110 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection clear 0 end
+ .l selection set 2
+ .l selection set 5 7
.l selection set 5 7
.l curselection
-} {2 5 6 7}
-test listbox-3.111 {ListboxWidgetCmd procedure, "selection" option} {
- list [catch {.l selection badOption 0 0} msg] $msg
-} {1 {bad option "badOption": must be anchor, clear, includes, or set}}
-test listbox-3.112 {ListboxWidgetCmd procedure, "size" option} {
- list [catch {.l size a} msg] $msg
-} {1 {wrong # args: should be ".l size"}}
-test listbox-3.113 {ListboxWidgetCmd procedure, "size" option} {
+} -result {2 5 6 7}
+test listbox-3.111 {ListboxWidgetCmd procedure, "selection" option} -body {
+ .l selection badOption 0 0
+} -returnCodes error -result {bad option "badOption": must be anchor, clear, includes, or set}
+test listbox-3.112 {ListboxWidgetCmd procedure, "size" option} -body {
+ .l size a
+} -returnCodes error -result {wrong # args: should be ".l size"}
+test listbox-3.113 {ListboxWidgetCmd procedure, "size" option} -body {
.l size
-} {18}
-test listbox-3.114 {ListboxWidgetCmd procedure, "xview" option} {
- catch {destroy .l2}
+} -result {18}
+test listbox-3.114 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+} -body {
listbox .l2
update
format {%.6g %.6g} {*}[.l2 xview]
-} {0 1}
-test listbox-3.115 {ListboxWidgetCmd procedure, "xview" option} {
- catch {destroy .l}
- listbox .l -width 10 -height 5 -font $fixed
- .l insert 0 a b c d e f g h i j k l m n o p q r s t
- pack .l
+} -cleanup {
+ destroy .l2
+} -result {0 1}
+test listbox-3.115 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+} -body {
+ listbox .l2 -width 10 -height 5 -font $fixed
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ pack .l2
update
- format {%.6g %.6g} {*}[.l xview]
-} {0 1}
-catch {destroy .l}
-listbox .l -width 10 -height 5 -font $fixed
-.l insert 0 a b c d e f g h i j k l m n o p q r s t
-.l insert 1 "0123456789a123456789b123456789c123456789d123456789"
-pack .l
-update
-test listbox-3.116 {ListboxWidgetCmd procedure, "xview" option} {fonts} {
- .l xview 4
- format {%.6g %.6g} {*}[.l xview]
-} {0.08 0.28}
-test listbox-3.117 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l xview foo} msg] $msg
-} {1 {expected integer but got "foo"}}
-test listbox-3.118 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l xview zoom a b} msg] $msg
-} {1 {unknown option "zoom": must be moveto or scroll}}
-test listbox-3.119 {ListboxWidgetCmd procedure, "xview" option} {fonts} {
- .l xview 0
- .l xview moveto .4
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0 1}
+
+test listbox-3.116 {ListboxWidgetCmd procedure, "xview" option} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
update
- format {%.6g %.6g} {*}[.l xview]
-} {0.4 0.6}
-test listbox-3.120 {ListboxWidgetCmd procedure, "xview" option} {fonts} {
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 insert 1 "0123456789a123456789b123456789c123456789d123456789"
+ .l2 xview 4
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0.08 0.28}
+test listbox-3.117 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l xview foo
+} -returnCodes error -result {expected integer but got "foo"}
+test listbox-3.118 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l xview zoom a b
+} -returnCodes error -result {unknown option "zoom": must be moveto or scroll}
+test listbox-3.119 {ListboxWidgetCmd procedure, "xview" option} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 insert 1 "0123456789a123456789b123456789c123456789d123456789"
.l xview 0
- .l xview scroll 2 units
- update
- format {%.6g %.6g} {*}[.l xview]
-} {0.04 0.24}
-test listbox-3.121 {ListboxWidgetCmd procedure, "xview" option} {fonts} {
- .l xview 30
- .l xview scroll -1 pages
- update
- format {%.6g %.6g} {*}[.l xview]
-} {0.44 0.64}
-test listbox-3.122 {ListboxWidgetCmd procedure, "xview" option} {fonts} {
- .l configure -width 1
- update
- .l xview 30
- .l xview scroll -4 pages
- update
- format {%.6g %.6g} {*}[.l xview]
-} {0.52 0.54}
-test listbox-3.123 {ListboxWidgetCmd procedure, "yview" option} {
- catch {destroy .l}
- listbox .l
- pack .l
+ .l2 xview moveto .4
update
- format {%.6g %.6g} {*}[.l yview]
-} {0 1}
-test listbox-3.124 {ListboxWidgetCmd procedure, "yview" option} {
- catch {destroy .l}
- listbox .l
- .l insert 0 el1
- pack .l
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0.4 0.6}
+test listbox-3.120 {ListboxWidgetCmd procedure, "xview" option} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
update
- format {%.6g %.6g} {*}[.l yview]
-} {0 1}
-catch {destroy .l}
-listbox .l -width 10 -height 5 -font $fixed
-.l insert 0 a b c d e f g h i j k l m n o p q r s t
-pack .l
-update
-test listbox-3.125 {ListboxWidgetCmd procedure, "yview" option} {
- .l yview 4
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 insert 1 "0123456789a123456789b123456789c123456789d123456789"
+ .l2 xview 0
+ .l2 xview scroll 2 units
+ update
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0.04 0.24}
+test listbox-3.121 {ListboxWidgetCmd procedure, "xview" option} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 insert 1 "0123456789a123456789b123456789c123456789d123456789"
+ .l2 xview 30
+ .l2 xview scroll -1 pages
+ update
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0.44 0.64}
+test listbox-3.122 {ListboxWidgetCmd procedure, "xview" option} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
update
- format {%.6g %.6g} {*}[.l yview]
-} {0.2 0.45}
-test listbox-3.126 {ListboxWidgetCmd procedure, "yview" option, partial last line} {
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 insert 1 "0123456789a123456789b123456789c123456789d123456789"
+ .l2 configure -width 1
+ update
+ .l2 xview 30
+ .l2 xview scroll -4 pages
+ update
+ format {%.6g %.6g} {*}[.l2 xview]
+} -cleanup {
+ destroy .l2
+} -result {0.52 0.54}
+test listbox-3.123 {ListboxWidgetCmd procedure, "yview" option} -setup {
+ destroy .l2
+} -body {
+ listbox .l2
+ pack .l2
+ update
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0 1}
+test listbox-3.124 {ListboxWidgetCmd procedure, "yview" option} -setup {
+ destroy .l2
+} -body {
+ listbox .l2
+ .l2 insert 0 el1
+ pack .l2
+ update
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0 1}
+
+test listbox-3.125 {ListboxWidgetCmd procedure, "yview" option} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 yview 4
+ update
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0.2 0.45}
+test listbox-3.126 {ListboxWidgetCmd procedure, "yview" option, partial last line} -setup {
+ destroy .l
+ listbox .l -width 10 -height 5 -font $fixed
+ pack .l
+ update
+} -body {
+ .l insert 0 a b c d e f g h i j k l m n o p q r s t
mkPartial
format {%.6g %.6g} {*}[.partial.l yview]
-} {0 0.266667}
-test listbox-3.127 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l yview foo} msg] $msg
-} {1 {bad listbox index "foo": must be active, anchor, end, @x,y, or a number}}
-test listbox-3.128 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l yview foo a b} msg] $msg
-} {1 {unknown option "foo": must be moveto or scroll}}
-test listbox-3.129 {ListboxWidgetCmd procedure, "xview" option} {
- .l yview 0
- .l yview moveto .31
- format {%.6g %.6g} {*}[.l yview]
-} {0.3 0.55}
-test listbox-3.130 {ListboxWidgetCmd procedure, "xview" option} {
- .l yview 2
- .l yview scroll 2 pages
- format {%.6g %.6g} {*}[.l yview]
-} {0.4 0.65}
-test listbox-3.131 {ListboxWidgetCmd procedure, "xview" option} {
- .l yview 10
- .l yview scroll -3 units
- format {%.6g %.6g} {*}[.l yview]
-} {0.35 0.6}
-test listbox-3.132 {ListboxWidgetCmd procedure, "xview" option} {
- .l configure -height 2
- update
- .l yview 15
- .l yview scroll -4 pages
- format {%.6g %.6g} {*}[.l yview]
-} {0.55 0.65}
-test listbox-3.133 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l whoknows} msg] $msg
-} {1 {bad option "whoknows": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}}
-test listbox-3.134 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l c} msg] $msg
-} {1 {ambiguous option "c": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}}
-test listbox-3.135 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l in} msg] $msg
-} {1 {ambiguous option "in": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}}
-test listbox-3.136 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l s} msg] $msg
-} {1 {ambiguous option "s": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}}
-test listbox-3.137 {ListboxWidgetCmd procedure, "xview" option} {
- list [catch {.l se} msg] $msg
-} {1 {ambiguous option "se": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}}
+} -cleanup {
+ destroy .l
+} -result {0 0.266667}
+
+# Listbox used in 3.127 -3.137 tests
+destroy .l
+listbox .l -width 20 -height 5 -bd 4 -highlightthickness 1 -selectborderwidth 2
+pack .l
+.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11 el12 el13 el14 \
+ el15 el16 el17
+update
+test listbox-3.127 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l yview foo
+} -returnCodes error -result {bad listbox index "foo": must be active, anchor, end, @x,y, or a number}
+test listbox-3.128 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l yview foo a b
+} -returnCodes error -result {unknown option "foo": must be moveto or scroll}
+test listbox-3.129 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 yview 0
+ .l2 yview moveto .31
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0.3 0.55}
+test listbox-3.130 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 yview 2
+ .l2 yview scroll 2 pages
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0.4 0.65}
+test listbox-3.131 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 yview 10
+ .l2 yview scroll -3 units
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0.35 0.6}
+test listbox-3.132 {ListboxWidgetCmd procedure, "xview" option} -setup {
+ destroy .l2
+ listbox .l2 -width 10 -height 5 -font $fixed
+ pack .l2
+ update
+} -body {
+ .l2 insert 0 a b c d e f g h i j k l m n o p q r s t
+ .l2 configure -height 2
+ update
+ .l2 yview 15
+ .l2 yview scroll -4 pages
+ format {%.6g %.6g} {*}[.l2 yview]
+} -cleanup {
+ destroy .l2
+} -result {0.55 0.65}
+test listbox-3.133 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l whoknows
+} -returnCodes error -result {bad option "whoknows": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}
+test listbox-3.134 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l c
+} -returnCodes error -result {ambiguous option "c": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}
+test listbox-3.135 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l in
+} -returnCodes error -result {ambiguous option "in": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}
+test listbox-3.136 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l s
+} -returnCodes error -result {ambiguous option "s": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}
+test listbox-3.137 {ListboxWidgetCmd procedure, "xview" option} -body {
+ .l se
+} -returnCodes error -result {ambiguous option "se": must be activate, bbox, cget, configure, curselection, delete, get, index, insert, itemcget, itemconfigure, nearest, scan, see, selection, size, xview, or yview}
# No tests for DestroyListbox: I can't come up with anything to test
# in this procedure.
-test listbox-4.1 {ConfigureListbox procedure} {fonts} {
- catch {destroy .l}
+
+test listbox-4.1 {ConfigureListbox procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+ destroy .l
listbox .l -setgrid 1 -width 25 -height 15
pack .l
update
+} -body {
set x [getsize .]
.l configure -setgrid 0
update
list $x [getsize .]
-} {25x15 185x263}
+} -cleanup {
+ deleteWindows
+} -result {25x15 185x263}
resetGridInfo
-test listbox-4.2 {ConfigureListbox procedure} {
+test listbox-4.2 {ConfigureListbox procedure} -setup {
+ deleteWindows
+ destroy .l
+ listbox .l -setgrid 1 -width 25 -height 15
+ pack .l
+ update
+} -body {
.l configure -highlightthickness -3
.l cget -highlightthickness
-} {0}
-test listbox-4.3 {ConfigureListbox procedure} {
+} -cleanup {
+ deleteWindows
+} -result {0}
+test listbox-4.3 {ConfigureListbox procedure} -setup {
+ deleteWindows
+ destroy .l
+ listbox .l -setgrid 1 -width 25 -height 15
+ pack .l
+ update
+} -body {
.l configure -exportselection 0
.l delete 0 end
.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8
.l selection set 3 5
.l configure -exportselection 1
selection get
-} {el3
+} -cleanup {
+ deleteWindows
+} -result {el3
el4
el5}
-test listbox-4.4 {ConfigureListbox procedure} {
- catch {destroy .e}
+test listbox-4.4 {ConfigureListbox procedure} -setup {
+ deleteWindows
+ listbox .l -setgrid 1 -width 25 -height 15
+ pack .l
+ update
+} -body {
entry .e
.e insert 0 abc
.e select from 0
@@ -792,8 +1209,15 @@ test listbox-4.4 {ConfigureListbox procedure} {
.l selection clear 3 5
.l configure -exportselection 1
list [selection own] [selection get]
-} {.e ab}
-test listbox-4.5 {-exportselection option} {
+} -cleanup {
+ deleteWindows
+} -result {.e ab}
+test listbox-4.5 {-exportselection option} -setup {
+ deleteWindows
+ listbox .l -setgrid 1 -width 25 -height 15
+ pack .l
+ update
+} -body {
selection clear .
.l configure -exportselection 1
.l delete 0 end
@@ -809,11 +1233,16 @@ test listbox-4.5 {-exportselection option} {
lappend x [catch {selection get} msg] $msg [.l curselection]
.l config -exportselection 1
lappend x [catch {selection get} msg] $msg [.l curselection]
-} {0 el1 1 1 {PRIMARY selection doesn't exist or form "STRING" not defined} 1 1 {PRIMARY selection doesn't exist or form "STRING" not defined} {} 1 {PRIMARY selection doesn't exist or form "STRING" not defined} {1 2 3} 0 {el1
+} -cleanup {
+ deleteWindows
+} -result {0 el1 1 1 {PRIMARY selection doesn't exist or form "STRING" not defined} 1 1 {PRIMARY selection doesn't exist or form "STRING" not defined} {} 1 {PRIMARY selection doesn't exist or form "STRING" not defined} {1 2 3} 0 {el1
el2
el3} {1 2 3}}
-test listbox-4.6 {ConfigureListbox procedure} {fonts} {
- catch {destroy .l}
+test listbox-4.6 {ConfigureListbox procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
# The following code (reset geometry, withdraw, etc.) is necessary
# to reset the state of some window managers like olvwm under
@@ -823,246 +1252,307 @@ test listbox-4.6 {ConfigureListbox procedure} {fonts} {
update
wm geom . {}
wm withdraw .
- listbox .l -font $fixed -width 15 -height 20
- pack .l
+ listbox .l2 -font $fixed -width 15 -height 20
+ pack .l2
update
wm deiconify .
set x [getsize .]
- .l configure -setgrid 1
+ .l2 configure -setgrid 1
update
list $x [getsize .]
-} {115x328 15x20}
-test listbox-4.7 {ConfigureListbox procedure} {
- catch {destroy .l}
+} -cleanup {
+ deleteWindows
+} -result {115x328 15x20}
+test listbox-4.7 {ConfigureListbox procedure} -setup {
+ deleteWindows
+} -body {
wm withdraw .
- listbox .l -font $fixed -width 30 -height 20 -setgrid 1
+ listbox .l2 -font $fixed -width 30 -height 20 -setgrid 1
wm geom . +25+25
- pack .l
+ pack .l2
update
wm deiconify .
set result [getsize .]
wm geom . 26x15
update
lappend result [getsize .]
- .l configure -setgrid 1
+ .l2 configure -setgrid 1
update
lappend result [getsize .]
-} {30x20 26x15 26x15}
-wm geom . {}
-catch {destroy .l}
+} -cleanup {
+ deleteWindows
+ wm geom . {}
+} -result {30x20 26x15 26x15}
+
resetGridInfo
-test listbox-4.8 {ConfigureListbox procedure} {
- catch {destroy .l}
- listbox .l -width 15 -height 20 -xscrollcommand "record x" \
+test listbox-4.8 {ConfigureListbox procedure} -setup {
+ destroy .l2
+} -body {
+ listbox .l2 -width 15 -height 20 -xscrollcommand "record x" \
-yscrollcommand "record y"
- pack .l
+ pack .l2
update
- .l configure -fg black
+ .l2 configure -fg black
set log {}
update
set log
-} {{y 0 1} {x 0 1}}
-test listbox-4.9 {ConfigureListbox procedure, -listvar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l2
+} -result {{y 0 1} {x 0 1}}
+test listbox-4.9 {ConfigureListbox procedure, -listvar} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
- listbox .l -listvar x
- .l get 0 end
-} [list a b c d]
-test listbox-4.10 {ConfigureListbox, no listvar -> existing listvar} {
- catch {destroy .l}
+ listbox .l2 -listvar x
+ .l2 get 0 end
+} -cleanup {
+ destroy .l2
+} -result [list a b c d]
+test listbox-4.10 {ConfigureListbox, no listvar -> existing listvar} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
- listbox .l
- .l insert end 1 2 3 4
- .l configure -listvar x
- .l get 0 end
-} [list a b c d]
-test listbox-4.11 {ConfigureListbox procedure, listvar -> no listvar} {
- catch {destroy .l}
+ listbox .l2
+ .l2 insert end 1 2 3 4
+ .l2 configure -listvar x
+ .l2 get 0 end
+} -cleanup {
+ destroy .l2
+} -result [list a b c d]
+test listbox-4.11 {ConfigureListbox procedure, listvar -> no listvar} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
- listbox .l -listvar x
- .l configure -listvar {}
- .l insert end 1 2 3 4
- list $x [.l get 0 end]
-} [list [list a b c d] [list a b c d 1 2 3 4]]
-test listbox-4.12 {ConfigureListbox procedure, listvar -> different listvar} {
- catch {destroy .l}
+ listbox .l2 -listvar x
+ .l2 configure -listvar {}
+ .l2 insert end 1 2 3 4
+ list $x [.l2 get 0 end]
+} -cleanup {
+ destroy .l2
+} -result [list [list a b c d] [list a b c d 1 2 3 4]]
+test listbox-4.12 {ConfigureListbox procedure, listvar -> different listvar} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
set y [list 1 2 3 4]
- listbox .l
- .l configure -listvar x
- .l configure -listvar y
- .l insert end 5 6 7 8
+ listbox .l2
+ .l2 configure -listvar x
+ .l2 configure -listvar y
+ .l2 insert end 5 6 7 8
list $x $y
-} [list [list a b c d] [list 1 2 3 4 5 6 7 8]]
-test listbox-4.13 {ConfigureListbox, no listvar -> non-existant listvar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l2
+} -result [list [list a b c d] [list 1 2 3 4 5 6 7 8]]
+test listbox-4.13 {ConfigureListbox, no listvar -> non-existant listvar} -setup {
+ destroy .l2
+} -body {
catch {unset x}
- listbox .l
- .l insert end a b c d
- .l configure -listvar x
+ listbox .l2
+ .l2 insert end a b c d
+ .l2 configure -listvar x
set x
-} [list a b c d]
-test listbox-4.14 {ConfigureListbox, non-existant listvar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l2
+} -result [list a b c d]
+test listbox-4.14 {ConfigureListbox, non-existant listvar} -setup {
+ destroy .l2
+} -body {
catch {unset x}
- listbox .l -listvar x
+ listbox .l2 -listvar x
list [info exists x] $x
-} [list 1 {}]
-test listbox-4.15 {ConfigureListbox, listvar -> non-existant listvar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l2
+} -result [list 1 {}]
+test listbox-4.15 {ConfigureListbox, listvar -> non-existant listvar} -setup {
+ destroy .l2
+} -body {
catch {unset y}
set x [list a b c d]
- listbox .l -listvar x
- .l configure -listvar y
+ listbox .l2 -listvar x
+ .l2 configure -listvar y
list [info exists y] $y
-} [list 1 [list a b c d]]
-test listbox-4.16 {ConfigureListbox, listvar -> same listvar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l2
+} -result [list 1 [list a b c d]]
+test listbox-4.16 {ConfigureListbox, listvar -> same listvar} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
- listbox .l -listvar x
- .l configure -listvar x
+ listbox .l2 -listvar x
+ .l2 configure -listvar x
set x
-} [list a b c d]
-test listbox-4.17 {ConfigureListbox, no listvar -> no listvar} {
- catch {destroy .l}
- listbox .l
- .l insert end a b c d
- .l configure -listvar {}
- .l get 0 end
-} [list a b c d]
-test listbox-4.18 {ConfigureListbox, no listvar -> bad listvar} {
- catch {destroy .l}
- listbox .l
- .l insert end a b c d
+} -cleanup {
+ destroy .l2
+} -result [list a b c d]
+test listbox-4.17 {ConfigureListbox, no listvar -> no listvar} -setup {
+ destroy .l2
+} -body {
+ listbox .l2
+ .l2 insert end a b c d
+ .l2 configure -listvar {}
+ .l2 get 0 end
+} -cleanup {
+ destroy .l2
+} -result [list a b c d]
+test listbox-4.18 {ConfigureListbox, no listvar -> bad listvar} -setup {
+ destroy .l2
+} -body {
+ listbox .l2
+ .l2 insert end a b c d
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] {} \
+ catch {.l2 configure -listvar x} result
+ list [.l2 get 0 end] [.l2 cget -listvar] $result
+} -cleanup {
+ destroy .l2
+} -result [list [list a b c d] {} \
"unmatched open quote in list: invalid -listvariable value"]
-test listbox-4.19 {ConfigureListbox, no listvar -> bad non-existent listvar} {
- catch {destroy .l}
+test listbox-4.19 {ConfigureListbox, no listvar -> bad non-existent listvar} -setup {
+ destroy .l2
+} -body {
unset -nocomplain ::foo
- 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] \
+ listbox .l2 -listvar foo
+ .l2 insert end a b c d
+ catch {.l2 configure -listvar ::zoo::bar::foo} result
+ list [.l2 get 0 end] [.l2 cget -listvar] $foo $result
+} -cleanup {
+ destroy .l2
+} -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.
-test listbox-5.1 {ListboxComputeGeometry procedure} {fonts} {
- catch {destroy .l}
+test listbox-5.1 {ListboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -font $fixed -width 15 -height 20
pack .l
list [winfo reqwidth .l] [winfo reqheight .l]
-} {115 328}
-test listbox-5.2 {ListboxComputeGeometry procedure} {fonts} {
- catch {destroy .l}
+} -result {115 328}
+test listbox-5.2 {ListboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -font $fixed -width 0 -height 10
pack .l
update
list [winfo reqwidth .l] [winfo reqheight .l]
-} {17 168}
-test listbox-5.3 {ListboxComputeGeometry procedure} {fonts} {
- catch {destroy .l}
+} -result {17 168}
+test listbox-5.3 {ListboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -font $fixed -width 0 -height 10 -bd 3
.l insert 0 Short "Really much longer" Longer
pack .l
update
list [winfo reqwidth .l] [winfo reqheight .l]
-} {138 170}
-test listbox-5.4 {ListboxComputeGeometry procedure} {fonts} {
- catch {destroy .l}
+} -result {138 170}
+test listbox-5.4 {ListboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -font $fixed -width 10 -height 0
pack .l
update
list [winfo reqwidth .l] [winfo reqheight .l]
-} {80 24}
-test listbox-5.5 {ListboxComputeGeometry procedure} {fonts} {
- catch {destroy .l}
+} -result {80 24}
+test listbox-5.5 {ListboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -font $fixed -width 10 -height 0 -highlightthickness 0
.l insert 0 Short "Really much longer" Longer
pack .l
update
list [winfo reqwidth .l] [winfo reqheight .l]
-} {76 52}
-test listbox-5.6 {ListboxComputeGeometry procedure} {
+} -result {76 52}
+test listbox-5.6 {ListboxComputeGeometry procedure} -setup {
+ destroy .l
+} -body {
# If "0" in selected font had 0 width, caused divide-by-zero error.
- catch {destroy .l}
pack [listbox .l -font {{open look glyph}}]
update
-} {}
+} -cleanup {
+ destroy .l
+} -result {}
-catch {destroy .l}
+# Listbox used in 6.*, 7.* tests
+destroy .l
listbox .l -height 2 -xscrollcommand "record x" -yscrollcommand "record y"
pack .l
update
-test listbox-6.1 {InsertEls procedure} {
+test listbox-6.1 {InsertEls procedure} -body {
.l delete 0 end
.l insert end a b c d
.l insert 5 x y z
.l insert 2 A
.l insert 0 q r s
.l get 0 end
-} {q r s a b A c d x y z}
-test listbox-6.2 {InsertEls procedure} {
+} -result {q r s a b A c d x y z}
+test listbox-6.2 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 2
.l insert 2 A B
.l index anchor
-} {4}
-test listbox-6.3 {InsertEls procedure} {
+} -result {4}
+test listbox-6.3 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 2
.l insert 3 A B
.l index anchor
-} {2}
-test listbox-6.4 {InsertEls procedure} {
+} -result {2}
+test listbox-6.4 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l insert 2 A B
.l index @0,0
-} {5}
-test listbox-6.5 {InsertEls procedure} {
+} -result {5}
+test listbox-6.5 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l insert 3 A B
.l index @0,0
-} {3}
-test listbox-6.6 {InsertEls procedure} {
+} -result {3}
+test listbox-6.6 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 5
.l insert 5 A B
.l index active
-} {7}
-test listbox-6.7 {InsertEls procedure} {
+} -result {7}
+test listbox-6.7 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 5
.l insert 6 A B
.l index active
-} {5}
-test listbox-6.8 {InsertEls procedure} {
+} -result {5}
+test listbox-6.8 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b c
.l index active
-} {2}
-test listbox-6.9 {InsertEls procedure} {
+} -result {2}
+test listbox-6.9 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0
.l index active
-} {0}
-test listbox-6.10 {InsertEls procedure} {
+} -result {0}
+test listbox-6.10 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b "two words" c d e f g h i j
update
@@ -1070,8 +1560,8 @@ test listbox-6.10 {InsertEls procedure} {
.l insert 0 word
update
set log
-} {{y 0 0.166667}}
-test listbox-6.11 {InsertEls procedure} {
+} -result {{y 0 0.166667}}
+test listbox-6.11 {InsertEls procedure} -body {
.l delete 0 end
.l insert 0 a b "two words" c d e f g h i j
update
@@ -1079,9 +1569,12 @@ test listbox-6.11 {InsertEls procedure} {
.l insert 0 "much longer entry"
update
set log
-} {{y 0 0.166667} {x 0 1}}
-test listbox-6.12 {InsertEls procedure} {fonts} {
- catch {destroy .l2}
+} -result {{y 0 0.166667} {x 0 1}}
+test listbox-6.12 {InsertEls procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+} -body {
listbox .l2 -width 0 -height 0
pack .l2 -side top
.l2 insert 0 a b "two words" c d
@@ -1089,23 +1582,31 @@ test listbox-6.12 {InsertEls procedure} {fonts} {
lappend x [winfo reqwidth .l2] [winfo reqheight .l2]
.l2 insert 0 "much longer entry"
lappend x [winfo reqwidth .l2] [winfo reqheight .l2]
-} {80 93 122 110}
-test listbox-6.13 {InsertEls procedure, check -listvar update} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result {80 93 122 110}
+test listbox-6.13 {InsertEls procedure, check -listvar update} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
listbox .l2 -listvar x
.l2 insert 0 1 2 3 4
set x
-} [list 1 2 3 4 a b c d]
-test listbox-6.14 {InsertEls procedure, check selection update} {
- catch {destroy .l2}
+} -cleanup {
+ destroy .l2
+} -result [list 1 2 3 4 a b c d]
+test listbox-6.14 {InsertEls procedure, check selection update} -setup {
+ destroy .l2
+} -body {
listbox .l2
.l2 insert 0 0 1 2 3 4
.l2 selection set 2 4
.l2 insert 0 a
.l2 curselection
-} [list 3 4 5]
-test listbox-6.15 {InsertEls procedure, lost namespaced listvar} {
+} -cleanup {
+ destroy .l2
+} -result [list 3 4 5]
+test listbox-6.15 {InsertEls procedure, lost namespaced listvar} -body {
destroy .l2
namespace eval test { variable foo {a b} }
listbox .l2 -listvar ::test::foo
@@ -1115,137 +1616,139 @@ test listbox-6.15 {InsertEls procedure, lost namespaced listvar} {
.l2 insert end e f
catch {set ::test::foo} result
list [.l2 get 0 end] [.l2 cget -listvar] $result
-} [list [list a b c e f] ::test::foo \
+} -cleanup {
+ destroy .l2
+} -result [list [list a b c e f] ::test::foo \
{can't read "::test::foo": no such variable}]
-test listbox-7.1 {DeleteEls procedure} {
+test listbox-7.1 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection set 1 6
.l delete 4 3
list [.l size] [selection get]
-} {10 {b
+} -result {10 {b
c
d
e
f
g}}
-test listbox-7.2 {DeleteEls procedure} {
+test listbox-7.2 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection set 3 6
.l delete 4 4
list [.l size] [.l get 4] [.l curselection]
-} {9 f {3 4 5}}
-test listbox-7.3 {DeleteEls procedure} {
+} -result {9 f {3 4 5}}
+test listbox-7.3 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l delete 0 3
list [.l size] [.l get 0] [.l get 1]
-} {6 e f}
-test listbox-7.4 {DeleteEls procedure} {
+} -result {6 e f}
+test listbox-7.4 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l delete 8 1000
list [.l size] [.l get 7]
-} {8 h}
-test listbox-7.5 {DeleteEls procedure} {
+} -result {8 h}
+test listbox-7.5 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 2
.l delete 0 1
.l index anchor
-} {0}
-test listbox-7.6 {DeleteEls procedure} {
+} -result {0}
+test listbox-7.6 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 2
.l delete 2
.l index anchor
-} {2}
-test listbox-7.7 {DeleteEls procedure} {
+} -result {2}
+test listbox-7.7 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 4
.l delete 2 5
.l index anchor
-} {2}
-test listbox-7.8 {DeleteEls procedure} {
+} -result {2}
+test listbox-7.8 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l selection anchor 3
.l delete 4 5
.l index anchor
-} {3}
-test listbox-7.9 {DeleteEls procedure} {
+} -result {3}
+test listbox-7.9 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l delete 1 2
.l index @0,0
-} {1}
-test listbox-7.10 {DeleteEls procedure} {
+} -result {1}
+test listbox-7.10 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l delete 3 4
.l index @0,0
-} {3}
-test listbox-7.11 {DeleteEls procedure} {
+} -result {3}
+test listbox-7.11 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l delete 4 6
.l index @0,0
-} {3}
-test listbox-7.12 {DeleteEls procedure} {
+} -result {3}
+test listbox-7.12 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l yview 3
update
.l delete 3 end
.l index @0,0
-} {1}
-test listbox-7.13 {DeleteEls procedure, updating view with partial last line} {
+} -result {1}
+test listbox-7.13 {DeleteEls procedure, updating view with partial last line} -body {
mkPartial
.partial.l yview 8
update
.partial.l delete 10 13
.partial.l index @0,0
-} {7}
-test listbox-7.14 {DeleteEls procedure} {
+} -result {7}
+test listbox-7.14 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 6
.l delete 3 4
.l index active
-} {4}
-test listbox-7.15 {DeleteEls procedure} {
+} -result {4}
+test listbox-7.15 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 6
.l delete 5 7
.l index active
-} {5}
-test listbox-7.16 {DeleteEls procedure} {
+} -result {5}
+test listbox-7.16 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 6
.l delete 5 end
.l index active
-} {4}
-test listbox-7.17 {DeleteEls procedure} {
+} -result {4}
+test listbox-7.17 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j
.l activate 6
.l delete 0 end
.l index active
-} {0}
-test listbox-7.18 {DeleteEls procedure} {
+} -result {0}
+test listbox-7.18 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c "two words" d e f g h i j
update
@@ -1253,8 +1756,8 @@ test listbox-7.18 {DeleteEls procedure} {
.l delete 4 6
update
set log
-} {{y 0 0.25}}
-test listbox-7.19 {DeleteEls procedure} {
+} -result {{y 0 0.25}}
+test listbox-7.19 {DeleteEls procedure} -body {
.l delete 0 end
.l insert 0 a b c "two words" d e f g h i j
update
@@ -1262,9 +1765,12 @@ test listbox-7.19 {DeleteEls procedure} {
.l delete 3
update
set log
-} {{y 0 0.2} {x 0 1}}
-test listbox-7.20 {DeleteEls procedure} {fonts} {
- catch {destroy .l2}
+} -result {{y 0 0.2} {x 0 1}}
+test listbox-7.20 {DeleteEls procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l2
+} -body {
listbox .l2 -width 0 -height 0
pack .l2 -side top
.l2 insert 0 a b "two words" c d e f g
@@ -1272,28 +1778,37 @@ test listbox-7.20 {DeleteEls procedure} {fonts} {
lappend x [winfo reqwidth .l2] [winfo reqheight .l2]
.l2 delete 2 4
lappend x [winfo reqwidth .l2] [winfo reqheight .l2]
-} {80 144 17 93}
-catch {destroy .l2}
-test listbox-7.21 {DeleteEls procedure, check -listvar update} {
- catch {destroy .l2}
+} -result {80 144 17 93}
+test listbox-7.21 {DeleteEls procedure, check -listvar update} -setup {
+ destroy .l2
+} -body {
set x [list a b c d]
listbox .l2 -listvar x
.l2 delete 0 1
set x
-} [list c d]
+} -result [list c d]
-test listbox-8.1 {ListboxEventProc procedure} {fonts} {
- catch {destroy .l}
+
+test listbox-8.1 {ListboxEventProc procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -setgrid 1
pack .l
update
set x [getsize .]
destroy .l
list $x [getsize .] [winfo exists .l] [info command .l]
-} {20x10 150x178 0 {}}
+} -cleanup {
+ destroy .l
+} -result {20x10 150x178 0 {}}
resetGridInfo
-test listbox-8.2 {ListboxEventProc procedure} {fonts} {
- catch {destroy .l}
+test listbox-8.2 {ListboxEventProc procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
listbox .l -height 5 -width 10
.l insert 0 a b c "A string that is very very long" d e f g h i j k
pack .l
@@ -1301,9 +1816,12 @@ test listbox-8.2 {ListboxEventProc procedure} {fonts} {
place .l -width 50 -height 80
update
list [format {%.6g %.6g} {*}[.l xview]] [format {%.6g %.6g} {*}[.l yview]]
-} {{0 0.222222} {0 0.333333}}
-test listbox-8.3 {ListboxEventProc procedure} {
+} -cleanup {
+ destroy .l
+} -result {{0 0.222222} {0 0.333333}}
+test listbox-8.3 {ListboxEventProc procedure} -setup {
deleteWindows
+} -body {
listbox .l1 -bg #543210
rename .l1 .l2
set x {}
@@ -1311,107 +1829,257 @@ test listbox-8.3 {ListboxEventProc procedure} {
lappend x [.l2 cget -bg]
destroy .l1
lappend x [info command .l*] [winfo children .]
-} {.l1 #543210 {} {}}
+} -cleanup {
+ deleteWindows
+} -result {.l1 #543210 {} {}}
+
-test listbox-9.1 {ListboxCmdDeletedProc procedure} {
+test listbox-9.1 {ListboxCmdDeletedProc procedure} -setup {
deleteWindows
+} -body {
listbox .l1
rename .l1 {}
list [info command .l*] [winfo children .]
-} {{} {}}
-test listbox-9.2 {ListboxCmdDeletedProc procedure, disabling -setgrid} fonts {
- catch {destroy .top}
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test listbox-9.2 {ListboxCmdDeletedProc procedure, disabling -setgrid} -constraints {
+ fonts
+} -setup {
+ destroy .top
+} -body {
toplevel .top
wm geom .top +0+0
listbox .top.l -setgrid 1 -width 20 -height 10
pack .top.l
update
- set x [wm geometry .top]
+ set x [getsize .top]
rename .top.l {}
update
- lappend x [wm geometry .top]
+ lappend x [getsize .top]
+} -cleanup {
destroy .top
- set x
-} {20x10+0+0 150x178+0+0}
+} -result {20x10 150x178}
-catch {destroy .l}
-listbox .l
-pack .l
-.l delete 0 end
-.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
-test listbox-10.1 {GetListboxIndex procedure} {
+
+# Listbox used in 10.* tests
+destroy .l
+test listbox-10.1 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
.l activate 3
+ update
list [.l activate 3; .l index active] [.l activate 6; .l index active]
-} {3 6}
-test listbox-10.2 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {3 6}
+test listbox-10.2 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
.l selection anchor 2
+ update
.l index anchor
-} 2
-test listbox-10.3 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result 2
+test listbox-10.3 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
.l insert end A B C D E
.l selection anchor end
+ update
.l delete 12 end
list [.l index anchor] [.l index end]
-} {12 12}
-test listbox-10.4 {GetListboxIndex procedure} {
- list [catch {.l index a} msg] $msg
-} {1 {bad listbox index "a": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.5 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {12 12}
+test listbox-10.4 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index a
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "a": must be active, anchor, end, @x,y, or a number}
+test listbox-10.5 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l index end
-} {12}
-test listbox-10.6 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {12}
+test listbox-10.6 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l get end
-} {el11}
-test listbox-10.7 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {el11}
+test listbox-10.7 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
.l delete 0 end
+ update
.l index end
-} 0
-.l delete 0 end
-.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
-update
-test listbox-10.8 {GetListboxIndex procedure} {
- list [catch {.l index @} msg] $msg
-} {1 {bad listbox index "@": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.9 {GetListboxIndex procedure} {
- list [catch {.l index @foo} msg] $msg
-} {1 {bad listbox index "@foo": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.10 {GetListboxIndex procedure} {
- list [catch {.l index @1x3} msg] $msg
-} {1 {bad listbox index "@1x3": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.11 {GetListboxIndex procedure} {
- list [catch {.l index @1,} msg] $msg
-} {1 {bad listbox index "@1,": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.12 {GetListboxIndex procedure} {
- list [catch {.l index @1,foo} msg] $msg
-} {1 {bad listbox index "@1,foo": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.13 {GetListboxIndex procedure} {
- list [catch {.l index @1,2x} msg] $msg
-} {1 {bad listbox index "@1,2x": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.14 {GetListboxIndex procedure} {fonts} {
+} -cleanup {
+ destroy .l
+} -result 0
+test listbox-10.8 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@": must be active, anchor, end, @x,y, or a number}
+test listbox-10.9 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @foo
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@foo": must be active, anchor, end, @x,y, or a number}
+test listbox-10.10 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @1x3
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@1x3": must be active, anchor, end, @x,y, or a number}
+test listbox-10.11 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @1,
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@1,": must be active, anchor, end, @x,y, or a number}
+test listbox-10.12 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @1,foo
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@1,foo": must be active, anchor, end, @x,y, or a number}
+test listbox-10.13 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index @1,2x
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "@1,2x": must be active, anchor, end, @x,y, or a number}
+test listbox-10.14 {GetListboxIndex procedure} -constraints {
+ fonts
+} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
list [.l index @5,57] [.l index @5,58]
-} {3 3}
-test listbox-10.15 {GetListboxIndex procedure} {
- list [catch {.l index 1xy} msg] $msg
-} {1 {bad listbox index "1xy": must be active, anchor, end, @x,y, or a number}}
-test listbox-10.16 {GetListboxIndex procedure} {
+} -cleanup {
+ .l delete 0 end
+} -cleanup {
+ destroy .l
+} -result {3 3}
+test listbox-10.15 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
+ .l index 1xy
+} -cleanup {
+ destroy .l
+} -returnCodes error -result {bad listbox index "1xy": must be active, anchor, end, @x,y, or a number}
+test listbox-10.16 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l index 3
-} {3}
-test listbox-10.17 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {3}
+test listbox-10.17 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l index 20
-} {20}
-test listbox-10.18 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {20}
+test listbox-10.18 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l get 20
-} {}
-test listbox-10.19 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-10.19 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
+ update
.l index -2
-} -2
-test listbox-10.20 {GetListboxIndex procedure} {
+} -cleanup {
+ destroy .l
+} -result -2
+test listbox-10.20 {GetListboxIndex procedure} -setup {
+ destroy .l
+} -body {
+ pack [listbox .l]
+ .l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11
.l delete 0 end
+ update
.l index 1
-} 1
+} -cleanup {
+ destroy .l
+} -result 1
+
-test listbox-11.1 {ChangeListboxView procedure, boundary conditions for index} {
- catch {destroy .l}
+test listbox-11.1 {ChangeListboxView procedure, boundary conditions for index} -setup {
+ destroy .l
+} -body {
listbox .l -height 5
pack .l
.l insert 0 a b c d e f g h i j
@@ -1421,9 +2089,12 @@ test listbox-11.1 {ChangeListboxView procedure, boundary conditions for index} {
.l yview -1
update
lappend x [.l index @0,0]
-} {3 0}
-test listbox-11.2 {ChangeListboxView procedure, boundary conditions for index} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {3 0}
+test listbox-11.2 {ChangeListboxView procedure, boundary conditions for index} -setup {
+ destroy .l
+} -body {
listbox .l -height 5
pack .l
.l insert 0 a b c d e f g h i j
@@ -1433,9 +2104,12 @@ test listbox-11.2 {ChangeListboxView procedure, boundary conditions for index} {
.l yview 20
update
lappend x [.l index @0,0]
-} {3 5}
-test listbox-11.3 {ChangeListboxView procedure} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {3 5}
+test listbox-11.3 {ChangeListboxView procedure} -setup {
+ destroy .l
+} -body {
listbox .l -height 5 -yscrollcommand "record y"
pack .l
.l insert 0 a b c d e f g h i j
@@ -1444,9 +2118,12 @@ test listbox-11.3 {ChangeListboxView procedure} {
.l yview 2
update
list [format {%.6g %.6g} {*}[.l yview]] $log
-} {{0.2 0.7} {{y 0.2 0.7}}}
-test listbox-11.4 {ChangeListboxView procedure} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {{0.2 0.7} {{y 0.2 0.7}}}
+test listbox-11.4 {ChangeListboxView procedure} -setup {
+ destroy .l
+} -body {
listbox .l -height 5 -yscrollcommand "record y"
pack .l
.l insert 0 a b c d e f g h i j
@@ -1455,9 +2132,12 @@ test listbox-11.4 {ChangeListboxView procedure} {
.l yview 8
update
list [format {%.6g %.6g} {*}[.l yview]] $log
-} {{0.5 1} {{y 0.5 1}}}
-test listbox-11.5 {ChangeListboxView procedure} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {{0.5 1} {{y 0.5 1}}}
+test listbox-11.5 {ChangeListboxView procedure} -setup {
+ destroy .l
+} -body {
listbox .l -height 5 -yscrollcommand "record y"
pack .l
.l insert 0 a b c d e f g h i j
@@ -1467,40 +2147,55 @@ test listbox-11.5 {ChangeListboxView procedure} {
.l yview 3
update
list [format {%.6g %.6g} {*}[.l yview]] $log
-} {{0.3 0.8} {}}
-test listbox-11.6 {ChangeListboxView procedure, partial last line} {
+} -cleanup {
+ destroy .l
+} -result {{0.3 0.8} {}}
+test listbox-11.6 {ChangeListboxView procedure, partial last line} -body {
mkPartial
.partial.l yview 13
.partial.l index @0,0
-} {11}
+} -cleanup {
+ destroy .l
+} -result {11}
-catch {destroy .l}
+
+# Listbox used in 12.* tests
+destroy .l
listbox .l -font $fixed -xscrollcommand "record x" -width 10
.l insert 0 0123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789i123456789
pack .l
update
-test listbox-12.1 {ChangeListboxOffset procedure} {fonts} {
+test listbox-12.1 {ChangeListboxOffset procedure} -constraints {
+ fonts
+} -body {
set log {}
.l xview 99
update
list [format {%.6g %.6g} {*}[.l xview]] $log
-} {{0.9 1} {{x 0.9 1}}}
-test listbox-12.2 {ChangeListboxOffset procedure} {fonts} {
+} -result {{0.9 1} {{x 0.9 1}}}
+test listbox-12.2 {ChangeListboxOffset procedure} -constraints {
+ fonts
+} -body {
set log {}
+ .l xview 99
.l xview moveto -.25
update
list [format {%.6g %.6g} {*}[.l xview]] $log
-} {{0 0.1} {{x 0 0.1}}}
-test listbox-12.3 {ChangeListboxOffset procedure} {fonts} {
+} -result {{0 0.1} {{x 0 0.1}}}
+test listbox-12.3 {ChangeListboxOffset procedure} -constraints {
+ fonts
+} -body {
.l xview 10
update
set log {}
.l xview 10
update
list [format {%.6g %.6g} {*}[.l xview]] $log
-} {{0.1 0.2} {}}
+} -result {{0.1 0.2} {}}
+
-catch {destroy .l}
+# Listbox used in 13.* tests
+destroy .l
listbox .l -font $fixed -width 10 -height 5
pack .l
.l insert 0 a bb c d e f g h i j k l m n o p q r s
@@ -1508,15 +2203,19 @@ pack .l
update
set width [expr [lindex [.l bbox 2] 2] - [lindex [.l bbox 1] 2]]
set height [expr [lindex [.l bbox 2] 1] - [lindex [.l bbox 1] 1]]
-test listbox-13.1 {ListboxScanTo procedure} {fonts} {
+test listbox-13.1 {ListboxScanTo procedure} -constraints {
+ fonts
+} -body {
.l yview 0
.l xview 0
.l scan mark 10 20
.l scan dragto [expr 10-$width] [expr 20-$height]
update
list [format {%.6g %.6g} {*}[.l xview]] [format {%.6g %.6g} {*}[.l yview]]
-} {{0.2 0.4} {0.5 0.75}}
-test listbox-13.2 {ListboxScanTo procedure} {fonts} {
+} -result {{0.2 0.4} {0.5 0.75}}
+test listbox-13.2 {ListboxScanTo procedure} -constraints {
+ fonts
+} -body {
.l yview 5
.l xview 10
.l scan mark 10 20
@@ -1526,8 +2225,10 @@ test listbox-13.2 {ListboxScanTo procedure} {fonts} {
.l scan dragto [expr 20-$width] [expr 40-$height]
update
lappend x [format {%.6g %.6g} {*}[.l xview]] [format {%.6g %.6g} {*}[.l yview]]
-} {{0 0.2} {0 0.25} {0.2 0.4} {0.5 0.75}}
-test listbox-13.3 {ListboxScanTo procedure} {fonts} {
+} -result {{0 0.2} {0 0.25} {0.2 0.4} {0.5 0.75}}
+test listbox-13.3 {ListboxScanTo procedure} -constraints {
+ fonts
+} -body {
.l yview moveto 1.0
.l xview moveto 1.0
.l scan mark 10 20
@@ -1537,40 +2238,55 @@ test listbox-13.3 {ListboxScanTo procedure} {fonts} {
.l scan dragto [expr 5+$width] [expr 10+$height]
update
lappend x [format {%.6g %.6g} {*}[.l xview]] [format {%.6g %.6g} {*}[.l yview]]
-} {{0.8 1} {0.75 1} {0.64 0.84} {0.25 0.5}}
+} -result {{0.8 1} {0.75 1} {0.64 0.84} {0.25 0.5}}
-test listbox-14.1 {NearestListboxElement procedure, partial last line} {
+
+test listbox-14.1 {NearestListboxElement procedure, partial last line} -body {
mkPartial
.partial.l nearest [winfo height .partial.l]
-} {4}
-catch {destroy .l}
+} -result {4}
+# Listbox used in 14.* tests
+destroy .l
listbox .l -font $fixed -width 20 -height 10
.l insert 0 a b c d e f g h i j k l m n o p q r s t
.l yview 4
pack .l
update
-test listbox-14.2 {NearestListboxElement procedure} {fonts} {
+test listbox-14.2 {NearestListboxElement procedure} -constraints {
+ fonts
+} -body {
.l index @50,0
-} {4}
-test listbox-14.3 {NearestListboxElement procedure} {fonts} {
+} -result {4}
+test listbox-14.3 {NearestListboxElement procedure} -constraints {
+ fonts
+} -body {
list [.l index @50,35] [.l index @50,36]
-} {5 6}
-test listbox-14.4 {NearestListboxElement procedure} {fonts} {
+} -result {5 6}
+test listbox-14.4 {NearestListboxElement procedure} -constraints {
+ fonts
+} -body {
.l index @50,200
-} {13}
+} -result {13}
+
-test listbox-15.1 {ListboxSelect procedure} {
+# Listbox used in 15.* 16.* and 17.* tests
+destroy .l
+listbox .l -font $fixed -width 20 -height 10
+pack .l
+update
+test listbox-15.1 {ListboxSelect procedure} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j k l m n o p
.l select set 2 4
.l select set 7 12
.l select clear 4 7
.l curselection
-} {2 3 8 9 10 11 12}
-test listbox-15.2 {ListboxSelect procedure} {
+} -result {2 3 8 9 10 11 12}
+test listbox-15.2 {ListboxSelect procedure} -setup {
+ destroy .e
+} -body {
.l delete 0 end
.l insert 0 a b c d e f g h i j k l m n o p
- catch {destroy .e}
entry .e
.e insert 0 "This is some text"
.e select from 0
@@ -1579,78 +2295,81 @@ test listbox-15.2 {ListboxSelect procedure} {
set x [selection own]
.l selection set 3
list $x [selection own] [selection get]
-} {.e .l d}
-test listbox-15.3 {ListboxSelect procedure} {
+} -cleanup {
+ destroy .e
+} -result {.e .l d}
+test listbox-15.3 {ListboxSelect procedure} -body {
.l delete 0 end
.l selection clear 0 end
.l select set 0 end
.l curselection
-} {}
-test listbox-15.4 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {}
+test listbox-15.4 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set -2 -1
.l curselection
-} {}
-test listbox-15.5 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {}
+test listbox-15.5 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set -1 3
.l curselection
-} {0 1 2 3}
-test listbox-15.6 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {0 1 2 3}
+test listbox-15.6 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set 2 4
.l curselection
-} {2 3 4}
-test listbox-15.7 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {2 3 4}
+test listbox-15.7 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set 4 end
.l curselection
-} {4 5}
-test listbox-15.8 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {4 5}
+test listbox-15.8 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set 4 30
.l curselection
-} {4 5}
-test listbox-15.9 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {4 5}
+test listbox-15.9 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set end 30
.l curselection
-} {5}
-test listbox-15.10 {ListboxSelect procedure, boundary conditions for indices} {
+} -result {5}
+test listbox-15.10 {ListboxSelect procedure, boundary conditions for indices} -body {
.l delete 0 end
.l insert 0 a b c d e f
.l select clear 0 end
.l select set 20 25
.l curselection
-} {}
+} -result {}
+
-test listbox-16.1 {ListboxFetchSelection procedure} {
+test listbox-16.1 {ListboxFetchSelection procedure} -body {
.l delete 0 end
.l insert 0 a b c "two words" e f g h i \\ k l m n o p
.l selection set 2 4
.l selection set 9
.l selection set 11 12
selection get
-} "c\ntwo words\ne\n\\\nl\nm"
-test listbox-16.2 {ListboxFetchSelection procedure} {
+} -result "c\ntwo words\ne\n\\\nl\nm"
+test listbox-16.2 {ListboxFetchSelection procedure} -body {
.l delete 0 end
.l insert 0 a b c "two words" e f g h i \\ k l m n o p
.l selection set 3
selection get
-} "two words"
-test listbox-16.3 {ListboxFetchSelection procedure, retrieve in several parts} {
+} -result "two words"
+test listbox-16.3 {ListboxFetchSelection procedure, retrieve in several parts} -body {
set long "This is quite a long string\n"
append long $long $long $long $long
append long $long $long $long $long
@@ -1660,38 +2379,48 @@ test listbox-16.3 {ListboxFetchSelection procedure, retrieve in several parts} {
.l selection set 0 end
set sel [selection get]
string compare 1$long\n2$long\n3$long\n4$long\n5$long $sel
-} {0}
-catch {unset long sel}
+} -cleanup {
+ catch {unset long sel}
+} -result {0}
+
-test listbox-17.1 {ListboxLostSelection procedure} {
+test listbox-17.1 {ListboxLostSelection procedure} -setup {
+ destroy .e
+} -body {
.l delete 0 end
.l insert 0 a b c d e
.l select set 0 end
- catch {destroy .e}
entry .e
.e insert 0 "This is some text"
.e select from 0
.e select to 5
.l curselection
-} {}
-test listbox-17.2 {ListboxLostSelection procedure} {
+} -cleanup {
+ destroy .e
+} -result {}
+test listbox-17.2 {ListboxLostSelection procedure} -setup {
+ destroy .e
+} -body {
.l delete 0 end
.l insert 0 a b c d e
.l select set 0 end
.l configure -exportselection 0
- catch {destroy .e}
entry .e
.e insert 0 "This is some text"
.e select from 0
.e select to 5
.l curselection
-} {0 1 2 3 4}
+} -cleanup {
+ destroy .e
+} -result {0 1 2 3 4}
-catch {destroy .l}
+
+# Listbox used in 18.* tests
+destroy .l
listbox .l -font $fixed -width 10 -height 5
pack .l
update
-test listbox-18.1 {ListboxUpdateVScrollbar procedure} {
+test listbox-18.1 {ListboxUpdateVScrollbar procedure} -body {
.l configure -yscrollcommand "record y"
set log {}
.l insert 0 a b c
@@ -1701,37 +2430,40 @@ test listbox-18.1 {ListboxUpdateVScrollbar procedure} {
.l delete 0 end
update
set log
-} {{y 0 1} {y 0 0.625} {y 0 1}}
-test listbox-18.2 {ListboxUpdateVScrollbar procedure, partial last line} {
+} -result {{y 0 1} {y 0 0.625} {y 0 1}}
+test listbox-18.2 {ListboxUpdateVScrollbar procedure, partial last line} -body {
mkPartial
.partial.l configure -yscrollcommand "record y"
set log {}
.partial.l yview 3
update
set log
-} {{y 0.2 0.466667}}
-test listbox-18.3 {ListboxUpdateVScrollbar procedure} {
+} -result {{y 0.2 0.466667}}
+test listbox-18.3 {ListboxUpdateVScrollbar procedure} -body {
proc bgerror args {
- global x errorInfo
- set x [list $args $errorInfo]
+ global x errorInfo
+ set x [list $args $errorInfo]
}
.l configure -yscrollcommand gorp
.l insert 0 foo
update
set x
-} {{{invalid command name "gorp"}} {invalid command name "gorp"
+} -cleanup {
+ rename bgerror {}
+} -result {{{invalid command name "gorp"}} {invalid command name "gorp"
while executing
"gorp 0.0 1.0"
(vertical scrolling command executed by listbox)}}
-if {[info exists bgerror]} {
- rename bgerror {}
-}
-catch {destroy .l}
+
+# Listbox used in 19.* tests
+destroy .l
listbox .l -font $fixed -width 10 -height 5
pack .l
update
-test listbox-19.1 {ListboxUpdateVScrollbar procedure} {fonts} {
+test listbox-19.1 {ListboxUpdateVScrollbar procedure} -constraints {
+ fonts
+} -body {
.l configure -xscrollcommand "record x"
set log {}
.l insert 0 abc
@@ -1741,97 +2473,125 @@ test listbox-19.1 {ListboxUpdateVScrollbar procedure} {fonts} {
.l delete 0 end
update
set log
-} {{x 0 1} {x 0 0.322581} {x 0 1}}
-test listbox-19.2 {ListboxUpdateVScrollbar procedure} {
+} -result {{x 0 1} {x 0 0.322581} {x 0 1}}
+test listbox-19.2 {ListboxUpdateVScrollbar procedure} -body {
proc bgerror args {
- global x errorInfo
- set x [list $args $errorInfo]
+ global x errorInfo
+ set x [list $args $errorInfo]
}
.l configure -xscrollcommand bogus
.l insert 0 foo
update
set x
-} {{{invalid command name "bogus"}} {invalid command name "bogus"
+} -result {{{invalid command name "bogus"}} {invalid command name "bogus"
while executing
"bogus 0.0 1.0"
(horizontal scrolling command executed by listbox)}}
-set l [interp hidden]
-deleteWindows
-test listbox-20.1 {listbox vs hidden commands} {
- catch {destroy .l}
+test listbox-20.1 {listbox vs hidden commands} -setup {
+ deleteWindows
+} -body {
+ set l [interp hidden]
listbox .l
interp hide {} .l
destroy .l
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 eq $res2}
+} -result 1
+
# tests for ListboxListVarProc
-test listbox-21.1 {ListboxListVarProc} {
- catch {destroy .l}
+test listbox-21.1 {ListboxListVarProc} -setup {
+ destroy .l
+} -body {
catch {unset x}
listbox .l -listvar x
set x [list a b c d]
.l get 0 end
-} [list a b c d]
-test listbox-21.2 {ListboxListVarProc} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result [list a b c d]
+test listbox-21.2 {ListboxListVarProc} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
unset x
set x
-} [list a b c d]
-test listbox-21.3 {ListboxListVarProc} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result [list a b c d]
+test listbox-21.3 {ListboxListVarProc} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
.l configure -listvar {}
unset x
info exists x
-} 0
-test listbox-21.4 {ListboxListVarProc} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result 0
+test listbox-21.4 {ListboxListVarProc} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
lappend x e f g
.l size
-} 7
-test listbox-21.5 {ListboxListVarProc, test selection after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result 7
+test listbox-21.5 {ListboxListVarProc, test selection after listvar mod} -setup {
+ destroy .l
+} -body {
set x [list a b c d e f g]
listbox .l -listvar x
.l selection set end
set x [list a b c d]
set x [list 0 1 2 3 4 5 6]
.l curselection
-} {}
-test listbox-21.6 {ListboxListVarProc, test selection after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-21.6 {ListboxListVarProc, test selection after listvar mod} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
.l selection set 3
lappend x e f g
.l curselection
-} 3
-test listbox-21.7 {ListboxListVarProc, test selection after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result 3
+test listbox-21.7 {ListboxListVarProc, test selection after listvar mod} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
.l selection set 0
set x [linsert $x 0 1 2 3 4]
.l curselection
-} 0
-test listbox-21.8 {ListboxListVarProc, test selection after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result 0
+test listbox-21.8 {ListboxListVarProc, test selection after listvar mod} -setup {
+ destroy .l
+} -body {
set x [list a b c d]
listbox .l -listvar x
.l selection set 2
set x [list a b c]
.l curselection
-} 2
-test listbox-21.9 {ListboxListVarProc, test hscrollbar after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result 2
+test listbox-21.9 {ListboxListVarProc, test hscrollbar after listvar mod} -setup {
+ destroy .l
+} -body {
catch {unset x}
set log {}
listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x
@@ -1842,9 +2602,12 @@ test listbox-21.9 {ListboxListVarProc, test hscrollbar after listvar mod} {
lappend x "00000000000000000000"
update
set log
-} [list {x 0 1} {x 0 1} {x 0 0.5}]
-test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result [list {x 0 1} {x 0 1} {x 0 0.5}]
+test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} -setup {
+ destroy .l
+} -body {
catch {unset x}
set log {}
listbox .l -font $fixed -width 10 -xscrollcommand "record x" -listvar x
@@ -1857,53 +2620,71 @@ test listbox-21.10 {ListboxListVarProc, test hscrollbar after listvar mod} {
set x [list "0000000000"]
update
set log
-} [list {x 0 1} {x 0 1} {x 0 0.5} {x 0 1}]
-test listbox-21.11 {ListboxListVarProc, bad list} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result [list {x 0 1} {x 0 1} {x 0 0.5} {x 0 1}]
+test listbox-21.11 {ListboxListVarProc, bad list} -setup {
+ destroy .l
+} -body {
catch {unset x}
listbox .l -listvar x
set x [list a b c d]
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} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {can't set "x": invalid listvar value}
+test listbox-21.12 {ListboxListVarProc, cleanup item attributes} -setup {
+ destroy .l
+} -body {
set x [list a b c d e f g]
listbox .l -listvar x
.l itemconfigure end -fg red
set x [list a b c d]
set x [list 0 1 2 3 4 5 6]
.l itemcget end -fg
-} {}
-test listbox-21.12a {ListboxListVarProc, cleanup item attributes} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-21.12a {ListboxListVarProc, cleanup item attributes} -setup {
+ destroy .l
+} -body {
set x [list a b c d e f g]
listbox .l -listvar x
.l itemconfigure end -fg red
set x [list a b c d]
set x [list 0 1 2 3 4 5 6]
.l itemcget end -fg
-} {}
-test listbox-21.13 {listbox item configurations and listvar based deletions} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-21.13 {listbox item configurations and listvar based deletions} -setup {
+ destroy .l
+} -body {
catch {unset x}
listbox .l -listvar x
.l insert end a b c
.l itemconfigure 1 -fg red
set x [list b c]
.l itemcget 1 -fg
-} red
-test listbox-21.14 {listbox item configurations and listvar based inserts} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result red
+test listbox-21.14 {listbox item configurations and listvar based inserts} -setup {
+ destroy .l
+} -body {
catch {unset x}
listbox .l -listvar x
.l insert end a b c
.l itemconfigure 0 -fg red
set x [list 1 2 3 4 a b c]
.l itemcget 0 -fg
-} red
-test listbox-21.15 {ListboxListVarProc, update vertical scrollbar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result red
+test listbox-21.15 {ListboxListVarProc, update vertical scrollbar} -setup {
+ destroy .l
+} -body {
catch {unset x}
set log {}
listbox .l -listvar x -yscrollcommand "record y" -font fixed -height 3
@@ -1912,9 +2693,12 @@ test listbox-21.15 {ListboxListVarProc, update vertical scrollbar} {
lappend x a b c d e f
update
set log
-} [list {y 0 1} {y 0 0.5}]
-test listbox-21.16 {ListboxListVarProc, update vertical scrollbar} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result [list {y 0 1} {y 0 0.5}]
+test listbox-21.16 {ListboxListVarProc, update vertical scrollbar} -setup {
+ destroy .l
+} -body {
catch {unset x}
listbox .l -listvar x -height 3
pack .l
@@ -1930,11 +2714,15 @@ test listbox-21.16 {ListboxListVarProc, update vertical scrollbar} {
update
lappend result [format {%.6g %.6g} {*}[.l yview]]
set result
-} [list {0.5 1} {0 1}]
+} -cleanup {
+ destroy .l
+} -result [list {0.5 1} {0 1}]
+
# UpdateHScrollbar
-test listbox-22.1 {UpdateHScrollbar} {
- catch {destroy .l}
+test listbox-22.1 {UpdateHScrollbar} -setup {
+ destroy .l
+} -body {
set log {}
listbox .l -font $fixed -width 10 -xscrollcommand "record x"
pack .l
@@ -1944,41 +2732,57 @@ test listbox-22.1 {UpdateHScrollbar} {
.l insert end "00000000000000000000"
update
set log
-} [list {x 0 1} {x 0 1} {x 0 0.5}]
+} -cleanup {
+ destroy .l
+} -result [list {x 0 1} {x 0 1} {x 0 0.5}]
+
# ConfigureListboxItem
-test listbox-23.1 {ConfigureListboxItem} {
- catch {destroy .l}
+test listbox-23.1 {ConfigureListboxItem} -setup {
+ destroy .l
+} -body {
listbox .l
catch {.l itemconfigure 0} result
set result
-} {item number "0" out of range}
-test listbox-23.2 {ConfigureListboxItem} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {item number "0" out of range}
+test listbox-23.2 {ConfigureListboxItem} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
.l itemconfigure 0
-} [list {-background background Background {} {}} \
+} -cleanup {
+ destroy .l
+} -result [list {-background background Background {} {}} \
{-bg -background} \
{-fg -foreground} \
{-foreground foreground Foreground {} {}} \
{-selectbackground selectBackground Foreground {} {}} \
{-selectforeground selectForeground Background {} {}}]
-test listbox-23.3 {ConfigureListboxItem, itemco shortcut} {
- catch {destroy .l}
+test listbox-23.3 {ConfigureListboxItem, itemco shortcut} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
.l itemco 0 -background
-} {-background background Background {} {}}
-test listbox-23.4 {ConfigureListboxItem, wrong num args} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {-background background Background {} {}}
+test listbox-23.4 {ConfigureListboxItem, wrong num args} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a
catch {.l itemco} result
set result
-} {wrong # args: should be ".l itemconfigure index ?option? ?value? ?option value ...?"}
-test listbox-23.5 {ConfigureListboxItem, multiple calls} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {wrong # args: should be ".l itemconfigure index ?-option? ?value? ?-option value ...?"}
+test listbox-23.5 {ConfigureListboxItem, multiple calls} -setup {
+ destroy .l
+} -body {
listbox .l
set i 0
foreach color {red orange yellow green blue white violet} {
@@ -1991,102 +2795,164 @@ 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 white violet}
-catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {red orange yellow green blue white violet}
+
+# Listbox used in 23.6 -23.17 tests
+destroy .l
listbox .l
.l insert end a b c d
-set i 6
-foreach test {
- {-background #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}}
- {-fg #110022 #110022 bogus {unknown color name "bogus"}}
- {-foreground #110022 #110022 bogus {unknown color name "bogus"}}
- {-selectbackground #110022 #110022 bogus {unknown color name "bogus"}}
- {-selectforeground #654321 #654321 bogus {unknown color name "bogus"}}
-} {
- set name [lindex $test 0]
- test listbox-23.$i {configuration options} {
- .l itemconfigure 0 $name [lindex $test 1]
- list [lindex [.l itemconfigure 0 $name] 4] [.l itemcget 0 $name]
- } [list [lindex $test 2] [lindex $test 2]]
- incr i
- if {[lindex $test 3] != ""} {
- test listbox-23.$i {configuration options} {
- list [catch {.l configure $name [lindex $test 3]} msg] $msg
- } [list 1 [lindex $test 4]]
- }
- .l configure $name [lindex [.l configure $name] 3]
- incr i
-}
+test listbox-23.6 {configuration options} -body {
+ .l itemconfigure 0 -background #ff0000
+ list [lindex [.l itemconfigure 0 -background] 4] [.l itemcget 0 -background]
+} -cleanup {
+ .l configure -background #ffffff
+} -result {{#ff0000} #ff0000}
+test listbox-23.7 {configuration options} -body {
+ .l configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test listbox-23.8 {configuration options} -body {
+ .l itemconfigure 0 -bg #ff0000
+ list [lindex [.l itemconfigure 0 -bg] 4] [.l itemcget 0 -bg]
+} -cleanup {
+ .l configure -bg #ffffff
+} -result {{#ff0000} #ff0000}
+test listbox-23.9 {configuration options} -body {
+ .l configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test listbox-23.10 {configuration options} -body {
+ .l itemconfigure 0 -fg #110022
+ list [lindex [.l itemconfigure 0 -fg] 4] [.l itemcget 0 -fg]
+} -cleanup {
+ .l configure -fg #000000
+} -result {{#110022} #110022}
+test listbox-23.11 {configuration options} -body {
+ .l configure -fg bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-23.12 {configuration options} -body {
+ .l itemconfigure 0 -foreground #110022
+ list [lindex [.l itemconfigure 0 -foreground] 4] [.l itemcget 0 -foreground]
+} -cleanup {
+ .l configure -foreground #000000
+} -result {{#110022} #110022}
+test listbox-23.13 {configuration options} -body {
+ .l configure -foreground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-23.14 {configuration options} -body {
+ .l itemconfigure 0 -selectbackground #110022
+ list [lindex [.l itemconfigure 0 -selectbackground] 4] [.l itemcget 0 -selectbackground]
+} -cleanup {
+ .l configure -selectbackground #c3c3c3
+} -result {{#110022} #110022}
+test listbox-23.15 {configuration options} -body {
+ .l configure -selectbackground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test listbox-23.16 {configuration options} -body {
+ .l itemconfigure 0 -selectforeground #654321
+ list [lindex [.l itemconfigure 0 -selectforeground] 4] [.l itemcget 0 -selectforeground]
+} -cleanup {
+ .l configure -selectforeground #000000
+} -result {{#654321} #654321}
+test listbox-23.17 {configuration options} -body {
+ .l configure -selectforeground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+
# ListboxWidgetObjCmd, itemcget
-test listbox-24.1 {itemcget} {
- catch {destroy .l}
+test listbox-24.1 {itemcget} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
.l itemcget 0 -fg
-} {}
-test listbox-24.2 {itemcget} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-24.2 {itemcget} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
.l itemconfigure 0 -fg red
.l itemcget 0 -fg
-} red
-test listbox-24.3 {itemcget} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result red
+test listbox-24.3 {itemcget} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
catch {.l itemcget 0} result
set result
-} {wrong # args: should be ".l itemcget index option"}
-test listbox-24.4 {itemcget, itemcg shortcut} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {wrong # args: should be ".l itemcget index option"}
+test listbox-24.4 {itemcget, itemcg shortcut} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c d
catch {.l itemcg 0} result
set result
-} {wrong # args: should be ".l itemcget index option"}
+} -cleanup {
+ destroy .l
+} -result {wrong # args: should be ".l itemcget index option"}
+
# General item configuration issues
-test listbox-25.1 {listbox item configurations and widget based deletions} {
- catch {destroy .l}
+test listbox-25.1 {listbox item configurations and widget based deletions} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a
.l itemconfigure 0 -fg red
.l delete 0 end
.l insert end a
.l itemcget 0 -fg
-} {}
-test listbox-25.2 {listbox item configurations and widget based inserts} {
- catch {destroy .l}
+} -cleanup {
+ destroy .l
+} -result {}
+test listbox-25.2 {listbox item configurations and widget based inserts} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c
.l itemconfigure 0 -fg red
.l insert 0 1 2 3 4
list [.l itemcget 0 -fg] [.l itemcget 4 -fg]
-} [list {} red]
+} -cleanup {
+ destroy .l
+} -result {{} red}
+
# state issues
-test listbox-26.1 {listbox disabled state disallows inserts} {
- catch {destroy .l}
+test listbox-26.1 {listbox disabled state disallows inserts} -setup {
+ destroy .l
+} -body {
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}
+} -cleanup {
+ destroy .l
+} -result [list a b c]
+test listbox-26.2 {listbox disabled state disallows deletions} -setup {
+ destroy .l
+} -body {
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}
+} -cleanup {
+ destroy .l
+} -result [list a b c]
+test listbox-26.3 {listbox disabled state disallows selection modification} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c
.l selection set 0
@@ -2095,58 +2961,89 @@ test listbox-26.3 {listbox disabled state disallows selection modification} {
.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}
+} -cleanup {
+ destroy .l
+} -result [list 0 2]
+test listbox-26.4 {listbox disabled state disallows anchor modification} -setup {
+ destroy .l
+} -body {
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}
+} -cleanup {
+ destroy .l
+} -result 0
+test listbox-26.5 {listbox disabled state disallows active modification} -setup {
+ destroy .l
+} -body {
listbox .l
.l insert end a b c
.l activate 0
.l configure -state disabled
.l activate 2
.l index active
-} 0
+} -cleanup {
+ destroy .l
+} -result 0
-test listbox-27.1 {widget deletion while active} {
+
+test listbox-27.1 {widget deletion while active} -setup {
destroy .l
+} -body {
pack [listbox .l]
update
.l configure -cursor xterm -xscrollcommand { destroy .l }
update idle
winfo exists .l
-} 0
+} -cleanup {
+ destroy .l
+} -result 0
-test listbox-28.1 {listbox -activestyle} {
+
+test listbox-28.1 {listbox -activestyle} -setup {
destroy .l
+} -body {
listbox .l -activ non
.l cget -activestyle
-} none
-test listbox-28.2-nonwin {listbox -activestyle} {nonwin} {
+} -cleanup {
+ destroy .l
+} -result none
+test listbox-28.2 {listbox -activestyle} -constraints {
+ nonwin
+} -setup {
destroy .l
+} -body {
listbox .l
.l cget -activestyle
-} dotbox
-test listbox-28.2-win {listbox -activestyle} {win} {
+} -cleanup {
destroy .l
+} -result dotbox
+test listbox-28.3 {listbox -activestyle} -constraints {
+ win
+} -setup {
+ destroy .l
+} -body {
listbox .l
.l cget -activestyle
-} underline
-test listbox-28.3 {listbox -activestyle} {
+} -cleanup {
+ destroy .l
+} -result underline
+test listbox-28.4 {listbox -activestyle} -setup {
destroy .l
+} -body {
listbox .l -activestyle und
.l cget -activestyle
-} underline
+} -cleanup {
+ destroy .l
+} -result underline
-test listbox-29.1 {listbox selection behavior, -state disabled} {
+
+test listbox-29.1 {listbox selection behavior, -state disabled} -setup {
destroy .l
+} -body {
listbox .l
.l insert end 1 2 3
.l selection set 2
@@ -2156,7 +3053,9 @@ test listbox-29.1 {listbox selection behavior, -state disabled} {
# but selection cannot be changed (new behavior since 8.4)
.l selection set 3
lappend out [.l selection includes 2] [.l curselection]
-} {1 1 2}
+} -cleanup {
+ destroy .l
+} -result {1 1 2}
resetGridInfo
deleteWindows
@@ -2165,3 +3064,8 @@ option clear
# cleanup
cleanupTests
return
+
+
+
+
+
diff --git a/tests/main.test b/tests/main.test
index 1d33fbb..7ab624f 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -8,59 +8,55 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
test main-1.1 {StdinProc} -constraints stdio -setup {
- set script [makeFile {
- close stdin; exit
- } script]
+ set script [makeFile {close stdin; exit} script]
} -body {
- list [catch {exec [interpreter] <$script} msg] $msg
+ exec [interpreter] <$script
} -cleanup {
removeFile script
-} -result {0 {}}
+} -returnCodes ok
-test main-2.1 {Tk_MainEx: -encoding option} -constraints {
- stdio
- } -setup {
- set script [makeFile {} script]
- file delete $script
- set f [open $script w]
- fconfigure $f -encoding utf-8
- puts $f {puts [list $argv0 $argv $tcl_interactive]}
- puts -nonewline $f {puts [string equal \u20ac }
- puts $f "\u20ac]; exit"
- close $f
- catch {set f [open "|[list [interpreter] -encoding utf-8 script]" r]}
- } -body {
- read $f
- } -cleanup {
- close $f
- removeFile script
- } -result [list script {} 0]\n1\n
+test main-2.1 {Tk_MainEx: -encoding option} -constraints stdio -setup {
+ set script [makeFile {} script]
+ file delete $script
+ set f [open $script w]
+ fconfigure $f -encoding utf-8
+ puts $f {puts [list $argv0 $argv $tcl_interactive]}
+ puts -nonewline $f {puts [string equal \u20ac }
+ puts $f "\u20ac]; exit"
+ close $f
+ catch {set f [open "|[list [interpreter] -encoding utf-8 script]" r]}
+} -body {
+ read $f
+} -cleanup {
+ close $f
+ removeFile script
+} -result "script {} 0\n1\n"
-test main-2.2 {Tk_MainEx: -encoding option} -constraints {
- stdio
- } -setup {
- set script [makeFile {} script]
- file delete $script
- set f [open $script w]
- fconfigure $f -encoding utf-8
- puts $f {puts [list $argv0 $argv $tcl_interactive]}
- puts -nonewline $f {puts [string equal \u20ac }
- puts $f "\u20ac]; exit"
- close $f
- catch {set f [open "|[list [interpreter] -encoding ascii script]" r]}
- } -body {
- read $f
- } -cleanup {
- close $f
- removeFile script
- } -result [list script {} 0]\n0\n
+test main-2.2 {Tk_MainEx: -encoding option} -constraints stdio -setup {
+ set script [makeFile {} script]
+ file delete $script
+ set f [open $script w]
+ fconfigure $f -encoding utf-8
+ puts $f {puts [list $argv0 $argv $tcl_interactive]}
+ puts -nonewline $f {puts [string equal \u20ac }
+ puts $f "\u20ac]; exit"
+ close $f
+ catch {set f [open "|[list [interpreter] -encoding ascii script]" r]}
+} -body {
+ read $f
+} -cleanup {
+ close $f
+ removeFile script
+} -result "script {} 0\n0\n"
- # Procedure to simulate interactive typing of commands, line by line
+ # Procedure to simulate interactive typing of commands, line by line,
+ # for test 2.3
proc type {chan script} {
foreach line [split $script \n] {
if {[catch {
@@ -74,52 +70,50 @@ test main-2.2 {Tk_MainEx: -encoding option} -constraints {
}
}
-test main-2.3 {Tk_MainEx: -encoding option} -constraints {
- stdio
- } -setup {
- set script [makeFile {} script]
- file delete $script
- set f [open $script w]
- fconfigure $f -encoding utf-8
- puts $f {puts [list $argv0 $argv $tcl_interactive]}
- puts -nonewline $f {puts [string equal \u20ac }
- puts $f "\u20ac]"
- close $f
- catch {set f [open "|[list [interpreter] -enc utf-8 script]" r+]}
- } -body {
- type $f {
- puts $argv
- exit
- }
- list [catch {gets $f} line] $line
- } -cleanup {
- close $f
- removeFile script
- } -result {0 {-enc utf-8 script}}
+test main-2.3 {Tk_MainEx: -encoding option} -constraints stdio -setup {
+ set script [makeFile {} script]
+ file delete $script
+ set f [open $script w]
+ fconfigure $f -encoding utf-8
+ puts $f {puts [list $argv0 $argv $tcl_interactive]}
+ puts -nonewline $f {puts [string equal \u20ac }
+ puts $f "\u20ac]"
+ close $f
+ catch {set f [open "|[list [interpreter] -enc utf-8 script]" r+]}
+} -body {
+ type $f {
+ puts $argv
+ exit
+ }
+ gets $f
+} -cleanup {
+ close $f
+ removeFile script
+} -returnCodes ok -result {-enc utf-8 script}
test main-3.1 {Tk_ParseArgv: -help option} -constraints unix -body {
# Run only on unix as Win32 pops up native dialog
- list [catch {exec [interpreter] -help} msg] $msg
-} -match glob -result {1 {% Application initialization failed: Command-specific options:*}}
+ exec [interpreter] -help
+} -returnCodes error -match glob -result {% application-specific initialization failed: Command-specific options:*}
test main-3.2 {Tk_ParseArgv: -help option} -setup {
set maininterp [interp create]
} -body {
$maininterp eval { set argc 1 ; set argv -help }
- list [catch {load {} Tk $maininterp} msg] $msg
+ load {} Tk $maininterp
} -cleanup {
interp delete $maininterp
-} -match glob -result {1 {Command-specific options:*}}
+} -returnCodes error -match glob -result {Command-specific options:*}
test main-3.3 {Tk_ParseArgv: -help option} -setup {
set maininterp [interp create]
} -body {
# Repeat of 3.2 to catch cleanup, eg Bug 1927135
$maininterp eval { set argc 1 ; set argv -help }
- list [catch {load {} Tk $maininterp} msg] $msg
+ load {} Tk $maininterp
} -cleanup {
interp delete $maininterp
-} -match glob -result {1 {Command-specific options:*}}
+} -returnCodes error -match glob -result {Command-specific options:*}
# cleanup
cleanupTests
diff --git a/tests/menu.test b/tests/menu.test
index 3cb47c3..595a21b 100644
--- a/tests/menu.test
+++ b/tests/menu.test
@@ -5,95 +5,103 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
-# find the earth.gif file for use in these tests
+# find the earth.gif file for use in these tests (tests 2.*)
set earthPhotoFile [file join [file dirname [info script]] earth.gif]
testConstraint hasEarthPhoto [file exists $earthPhotoFile]
-test menu-1.1 {Tk_MenuCmd procedure} {
- list [catch menu msg] $msg
-} {1 {wrong # args: should be "menu pathName ?options?"}}
-test menu-1.2 {Tk_MenuCmd procedure} {
- list [catch "menu bogus" msg] $msg
-} {1 {bad window path name "bogus"}}
-test menu-1.3 {Tk_MenuCmd procedure} {
- list [catch "menu .m1 foo" msg] $msg
-} {1 {unknown option "foo"}}
-test menu-1.4 {Tk_MenuCmd procedure} {
- catch {destroy .m1}
- list [catch {menu .m1} msg] $msg [destroy .m1]
-} {0 .m1 {}}
-test menu-1.5 {Tk_MenuCmd - creating menubar} {
- catch {destroy .m1}
+test menu-1.1 {Tk_MenuCmd procedure} -body {
+ menu
+} -returnCodes error -result {wrong # args: should be "menu pathName ?-option value ...?"}
+test menu-1.2 {Tk_MenuCmd procedure} -body {
+ menu bogus
+} -returnCodes error -result {bad window path name "bogus"}
+test menu-1.3 {Tk_MenuCmd procedure} -body {
+ destroy .m1
+ menu .m1 foo
+} -returnCodes error -result {unknown option "foo"}
+test menu-1.4 {Tk_MenuCmd procedure} -body {
+ destroy .m1
+ menu .m1
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menu-1.5 {Tk_MenuCmd - creating menubar} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label Test -menu ""
- list [. configure -menu .m1] [. configure -menu ""] [destroy .m1]
-} {{} {} {}}
-test menu-1.6 {Tk_MenuCmd procedure menu ref no cascade} {
- catch {destroy .t2}
- catch {destroy .m1}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-1.6 {Tk_MenuCmd procedure menu ref no cascade} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
- list [catch {menu .m1} msg] $msg [destroy .m1 .t2]
-} {0 .m1 {}}
-test menu-1.7 {Tk_MenuCmd procedure one clone cascade} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
+ menu .m1
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menu-1.7 {Tk_MenuCmd procedure one clone cascade} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
menu .m1
.m1 add cascade -menu .m2
- list [catch {menu .m2} msg] $msg [destroy .t2 .m1 .m2]
-} {0 .m2 {}}
-test menu-1.8 {Tk_MenuCmd procedure two clone cascades} {
- catch {destroy .m1}
- catch {destroy .t2}
- catch {destroy .t3}
- catch {destroy .m2}
+ menu .m2
+} -cleanup {
+ deleteWindows
+} -result {.m2}
+test menu-1.8 {Tk_MenuCmd procedure two clone cascades} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {menu .m2} msg] $msg [destroy .t2 .t3 .m1 .m2]
-} {0 .m2 {}}
-test menu-1.9 {Tk_MenuCmd procedure two clone cascades different order} {
- catch {destroy .t2}
- catch {destroy .m1}
- catch {destroy .t3}
- catch {destroy .m2}
+ menu .m2
+} -cleanup {
+ deleteWindows
+} -result {.m2}
+test menu-1.9 {Tk_MenuCmd procedure two clone cascades different order} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
menu .m1
.m1 add cascade -menu .m2
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {menu .m2} msg] $msg [destroy .t2 .t3 .m1 .m2]
-} {0 .m2 {}}
-test menu-1.10 {Tk_MenuCmd procedure two clone cascades menus last} {
- catch {destroy .t2}
- catch {destroy .t3}
- catch {destroy .m1}
- catch {destroy .m2}
+ list [menu .m2]
+} -cleanup {
+ deleteWindows
+} -result {.m2}
+test menu-1.10 {Tk_MenuCmd procedure two clone cascades menus last} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
menu .m1
.m1 add cascade -menu .m2
- list [catch {menu .m2} msg] $msg [destroy .t2 .t3 .m1 .m2]
-} {0 .m2 {}}
-test menu-1.11 {Tk_MenuCmd procedure three clones cascades} {
- catch {destroy .t2}
- catch {destroy .t3}
- catch {destroy .t4}
- catch {destroy .m1}
- catch {destroy .m2}
+ list [menu .m2]
+} -cleanup {
+ deleteWindows
+} -result {.m2}
+test menu-1.11 {Tk_MenuCmd procedure three clones cascades} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
@@ -102,93 +110,175 @@ test menu-1.11 {Tk_MenuCmd procedure three clones cascades} {
wm geometry .t4 +0+0
menu .m1
.m1 add cascade -menu .m2
- list [catch {menu .m2} msg] $msg [destroy .t2 .t3 .t4 .m1 .m2]
-} {0 .m2 {}}
-test menu-1.12 {Tk_MenuCmd procedure} {
- catch {destroy .t2}
- catch {destroy .m1}
+ list [menu .m2]
+} -cleanup {
+ deleteWindows
+} -result {.m2}
+test menu-1.12 {Tk_MenuCmd procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
- list [catch {menu .m1} msg] $msg [destroy .t2 .m1]
-} {0 .m1 {}}
-test menu-1.13 {Tk_MenuCmd procedure} {
- catch {destroy .t2}
- catch {destroy .t3}
- catch {destroy .m1}
+ list [menu .m1]
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menu-1.13 {Tk_MenuCmd procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {menu .m1} msg] $msg [destroy .t2 .t3 .m1]
-} {0 .m1 {}}
-test menu-1.14 {Tk_MenuCmd procedure} {
- catch {destroy .t2}
- catch {destroy .t3}
- catch {destroy .t4}
- catch {destroy .m1}
+ list [menu .m1]
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menu-1.14 {Tk_MenuCmd procedure} -setup {
+ deleteWindows
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
toplevel .t4 -menu .m1
wm geometry .t4 +0+0
- list [catch {menu .m1} msg] $msg [destroy .t2 .t3 .t4 .m1]
-} {0 .m1 {}}
+ list [menu .m1]
+} -cleanup {
+ deleteWindows
+} -result {.m1}
-catch {destroy .m1}
+# Used for 2.1 - 2.30 tests
+destroy .m1
menu .m1
-set i 1
-foreach configTest {
- {-activebackground #012345 #012345 non-existent
- {unknown color name "non-existent"}}
- {-activeborderwidth 1.3 1.3 badValue {bad screen distance "badValue"}}
- {-activeforeground #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-background #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-bg #110022 #110022 bogus {unknown color name "bogus"}}
- {-borderwidth 1.3 1.3 badValue {bad screen distance "badValue"}}
- {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
- {-disabledforeground #00ff00 #00ff00 xyzzy {unknown color name "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"}}
- {-postcommand "any old string" "any old string" {} {}}
- {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
- {-selectcolor #110022 #110022 bogus {unknown color name "bogus"}}
- {-takefocus "any string" "any string" {} {}}
- {-tearoff 0 0}
- {-tearoff 1 1}
- {-tearoffcommand "any old string" "any old string" {} {}}
-} {
- set name [lindex $configTest 0]
- set value [lindex $configTest 1]
- set result [lindex $configTest 2]
- test menu-2.$i [list configuration options $name $value $result] {
- .m1 configure $name $value
- lindex [.m1 configure $name] 4
- } $result
- incr i
- if {[lindex $configTest 3] != ""} {
- set value [lindex $configTest 3]
- set result [lindex $configTest 4]
- test menu-2.$i [list configuration options $name $value $result] {
- list [catch {.m1 configure $name $value} msg] $msg
- } [list 1 $result]
- }
- .m1 configure $name [lindex [.m1 configure $name] 3]
- incr i
-}
+test menu-2.1 {configuration options -activebackground #012345} -body {
+ .m1 configure -activebackground #012345
+ .m1 cget -activebackground
+} -result {#012345}
+test menu-2.2 {configuration options -activebackground non-existent} -body {
+ .m1 configure -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.3 {configuration options -activeborderwidth 1.3} -body {
+ .m1 configure -activeborderwidth 1.3
+ .m1 cget -activeborderwidth
+} -result {1.3}
+test menu-2.4 {configuration options -activeborderwidth badValue} -body {
+ .m1 configure -activeborderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+
+test menu-2.5 {configuration options -activeforeground #ff0000} -body {
+ .m1 configure -activeforeground #ff0000
+ .m1 cget -activeforeground
+} -result {#ff0000}
+test menu-2.6 {configuration options -activeforeground non-existent} -body {
+ .m1 configure -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.7 {configuration options -background #ff0000} -body {
+ .m1 configure -background #ff0000
+ .m1 cget -background
+} -result {#ff0000}
+test menu-2.8 {configuration options -background non-existent} -body {
+ .m1 configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.9 {configuration options -bg #110022} -body {
+ .m1 configure -bg #110022
+ .m1 cget -bg
+} -result {#110022}
+test menu-2.10 {configuration options -bg bogus} -body {
+ .m1 configure -bg bogus
+} -returnCodes error -result {unknown color name "bogus"}
+
+test menu-2.11 {configuration options -borderwidth 1.3} -body {
+ .m1 configure -borderwidth 1.3
+ .m1 cget -borderwidth
+} -result {1.3}
+test menu-2.12 {configuration options -borderwidth badValue} -body {
+ .m1 configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+
+test menu-2.13 {configuration options -cursor arrow} -body {
+ .m1 configure -cursor arrow
+ .m1 cget -cursor
+} -result {arrow}
+test menu-2.14 {configuration options -cursor badValue} -body {
+ .m1 configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+
+test menu-2.15 {configuration options -disabledforeground #00ff00} -body {
+ .m1 configure -disabledforeground #00ff00
+ .m1 cget -disabledforeground
+} -result {#00ff00}
+test menu-2.16 {configuration options -disabledforeground xyzzy} -body {
+ .m1 configure -disabledforeground xyzzy
+} -returnCodes error -result {unknown color name "xyzzy"}
+
+test menu-2.17 {configuration options -fg #110022} -body {
+ .m1 configure -fg #110022
+ .m1 cget -fg
+} -result {#110022}
+test menu-2.18 {configuration options -fg bogus} -body {
+ .m1 configure -fg bogus
+} -returnCodes error -result {unknown color name "bogus"}
+
+test menu-2.19 {configuration options -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*} -body {
+ .m1 configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ .m1 cget -font
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+test menu-2.20 {configuration options -foreground #110022} -body {
+ .m1 configure -foreground #110022
+ .m1 cget -foreground
+} -result {#110022}
+test menu-2.21 {configuration options -foreground bogus} -body {
+ .m1 configure -foreground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+
+test menu-2.22 {configuration options -postcommand {any old string}} -body {
+ .m1 configure -postcommand {any old string}
+ .m1 cget -postcommand
+} -result {any old string}
+test menu-2.23 {configuration options -relief groove} -body {
+ .m1 configure -relief groove
+ .m1 cget -relief
+} -result {groove}
+test menu-2.24 {configuration options -relief 1.5} -body {
+ .m1 configure -relief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+
+test menu-2.25 {configuration options -selectcolor #110022} -body {
+ .m1 configure -selectcolor #110022
+ .m1 cget -selectcolor
+} -result {#110022}
+test menu-2.26 {configuration options -selectcolor bogus} -body {
+ .m1 configure -selectcolor bogus
+} -returnCodes error -result {unknown color name "bogus"}
+
+test menu-2.27 {configuration options -takefocus {any string}} -body {
+ .m1 configure -takefocus {any string}
+ .m1 cget -takefocus
+} -result {any string}
+test menu-2.28 {configuration options -tearoff 0} -body {
+ .m1 configure -tearoff 0
+ .m1 cget -tearoff
+} -result {0}
+test menu-2.29 {configuration options -tearoff 1} -body {
+ .m1 configure -tearoff 1
+ .m1 cget -tearoff
+} -result {1}
+test menu-2.30 {configuration options -tearoffcommand {any old string}} -body {
+ .m1 configure -tearoffcommand {any old string}
+ .m1 cget -tearoffcommand
+} -result {any old string}
destroy .m1
# We need to test all of the options with all of the different types of
# menu entries. The following code sets up .m1 with 6 items. It then
-# runs through the big table below it.
+# runs through the 2.31 - 2.228 tests below
# index 0 is tearoff, 1 command, 2 cascade, 3 separator, 4 checkbutton,
# 5 radiobutton
-
+deleteWindows
menu .m1
.m1 add command -label "command"
menu .m2
@@ -197,488 +287,1172 @@ menu .m2
.m1 add separator
.m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off
.m1 add radiobutton -label "radiobutton" -variable radio
+
if {[testConstraint hasEarthPhoto]} {
image create photo image1 -file $earthPhotoFile
}
-foreach configTest {
- {-activebackground
- {{#012345
- {{unknown option "-activebackground"} #012345 #012345
- {unknown option "-activebackground"} #012345 #012345
- }
- }
- {non-existent
- {{unknown option "-activebackground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown option "-activebackground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- }
- }}
- }
- {-activeforeground
- {{#ff0000
- {{unknown option "-activeforeground"}
- #ff0000 #ff0000 {unknown option "-activeforeground"} #ff0000 #ff0000
- }
- }
- {non-existent
- {{unknown option "-activeforeground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown option "-activeforeground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- }
- }}
- }
- {-accelerator
- {{"Ctrl+S"
- {{unknown option "-accelerator"}
- "Ctrl+S" "Ctrl+S" {unknown option "-accelerator"}
- "Ctrl+S" "Ctrl+S"
- }
- }}
- }
- {-background
- {{#ff0000
- {#ff0000 #ff0000 #ff0000 #ff0000 #ff0000 #ff0000
- }
- }
- {non-existent
- {{unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- }
- }}
- }
- {-bitmap
- {{questhead
- {{unknown option "-bitmap"} questhead questhead
- {unknown option "-bitmap"} questhead questhead
- }
- }
- {badValue
- {{unknown option "-bitmap"}
- {bitmap "badValue" not defined}
- {bitmap "badValue" not defined}
- {unknown option "-bitmap"}
- {bitmap "badValue" not defined}
- {bitmap "badValue" not defined}
- }
- }}
- }
- {-columnbreak
- {{1
- {{unknown option "-columnbreak"} 1 1
- {unknown option "-columnbreak"} 1 1}
- }}
- }
- {-command
- {{beep
- {{unknown option "-command"} beep beep
- {unknown option "-command"} beep beep
- }
- }}
- }
- {-font
- {{-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
- {{unknown option "-font"}
- -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
- -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
- {unknown option "-font"}
- -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
- -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
- }
- }
- {{kill rock stars}
- {{unknown option "-font"}
- {expected integer but got "rock"}
- {expected integer but got "rock"}
- {unknown option "-font"}
- {expected integer but got "rock"}
- {expected integer but got "rock"}
- }
- }}
- }
- {-foreground
- {{#110022
- {{unknown option "-foreground"} #110022 #110022
- {unknown option "-foreground"} #110022 #110022
- }
- }
- {non-existent
- {{unknown option "-foreground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- {unknown option "-foreground"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- }
- }}
- }
- {-image
- {{image1
- {{unknown option "-image"} image1 image1
- {unknown option "-image"} image1 image1
- }
- }
- {bogus
- {{unknown option "-image"}
- {image "bogus" doesn't exist}
- {image "bogus" doesn't exist}
- {unknown option "-image"}
- {image "bogus" doesn't exist}
- {image "bogus" doesn't exist}
- }
- }
- {""
- {{unknown option "-image"}
- {}
- {}
- {unknown option "-image"}
- {}
- {}
- }
- }}
- }
- {-indicatoron
- {{1
- {{unknown option "-indicatoron"}
- {unknown option "-indicatoron"}
- {unknown option "-indicatoron"}
- {unknown option "-indicatoron"} 1 1
- }
- }}
- }
- {-label
- {{test
- {{unknown option "-label"} test test
- {unknown option "-label"} test test
- }
- }}
- }
- {-menu
- {{.m2
- {{unknown option "-menu"}
- {unknown option "-menu"} .m2
- {unknown option "-menu"}
- {unknown option "-menu"}
- {unknown option "-menu"}
- }
- }}
- }
- {-offvalue
- {{off
- {{unknown option "-offvalue"}
- {unknown option "-offvalue"}
- {unknown option "-offvalue"}
- {unknown option "-offvalue"}
- off
- {unknown option "-offvalue"}
- }
- }}
- }
- {-onvalue
- {{on
- {{unknown option "-onvalue"}
- {unknown option "-onvalue"}
- {unknown option "-onvalue"}
- {unknown option "-onvalue"}
- on
- {unknown option "-onvalue"}
- }
- }}
- }
- {-selectcolor
- {{#110022
- {{unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- #110022
- #110022
- }
- }
- {non-existent
- {{unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- {unknown option "-selectcolor"}
- {unknown color name "non-existent"}
- {unknown color name "non-existent"}
- }
- }}
- }
- {-selectimage
- {{image1
- {{unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"} image1 image1
- }
- }
- {bogus
- {{unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {image "bogus" doesn't exist}
- {image "bogus" doesn't exist}
- }
- }
- {""
- {{unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {unknown option "-selectimage"}
- {}
- {}
- }
- }}
- }
- {-state
- {{normal
- {normal normal normal {unknown option "-state"} normal normal
- }
- }}
- }
- {-value
- {{"any string"
- {{unknown option "-value"}
- {unknown option "-value"}
- {unknown option "-value"}
- {unknown option "-value"}
- {unknown option "-value"} "any string"
- }
- }}
- }
- {-variable
- {{"any string"
- {{unknown option "-variable"}
- {unknown option "-variable"}
- {unknown option "-variable"}
- {unknown option "-variable"}
- "any string"
- "any string"
- }
- }}
- }
- {-underline
- {{0
- {{unknown option "-underline"} 0 0
- {unknown option "-underline"} 0 0
- }
- }
- {3p
- {{unknown option "-underline"}
- {expected integer but got "3p"}
- {expected integer but got "3p"}
- {unknown option "-underline"}
- {expected integer but got "3p"}
- {expected integer but got "3p"}
- }
- }}
- }
-} {
- set name [lindex $configTest 0]
- foreach attempt [lindex $configTest 1] {
- set value [lindex $attempt 0]
- set options [lindex $attempt 1]
- foreach item {0 1 2 3 4 5} {
- catch {unset msg}
- # OK, it's an overeager constraint, but it should also
- # normally hold anyway
- test menu-2.$i [list entry configuration options $name $item $value [.m1 type $item]] hasEarthPhoto {
- set result [catch {.m1 entryconfigure $item $name $value} msg]
- if {$result == 1} {
- set msg
- } else {
- lindex [.m1 entryconfigure $item $name] 4
- }
- } [lindex $options $item]
- incr i
- }
- }
-}
+test menu-2.31 {entry configuration options 0 -activebackground #012345 tearoff} -body {
+ .m1 entryconfigure 0 -activebackground #012345
+} -returnCodes error -result {unknown option "-activebackground"}
+
+test menu-2.32 {entry configuration options 1 -activebackground #012345 command} -body {
+ .m1 entryconfigure 1 -activebackground #012345
+ lindex [.m1 entryconfigure 1 -activebackground] 4
+} -result {#012345}
+
+test menu-2.33 {entry configuration options 2 -activebackground #012345 cascade} -body {
+ .m1 entryconfigure 2 -activebackground #012345
+ lindex [.m1 entryconfigure 2 -activebackground] 4
+} -result {#012345}
+
+test menu-2.34 {entry configuration options 3 -activebackground #012345 separator} -body {
+ .m1 entryconfigure 3 -activebackground #012345
+} -returnCodes error -result {unknown option "-activebackground"}
+
+test menu-2.35 {entry configuration options 4 -activebackground #012345 checkbutton} -body {
+ .m1 entryconfigure 4 -activebackground #012345
+ lindex [.m1 entryconfigure 4 -activebackground] 4
+} -result {#012345}
+
+test menu-2.36 {entry configuration options 5 -activebackground #012345 radiobutton} -body {
+ .m1 entryconfigure 5 -activebackground #012345
+ lindex [.m1 entryconfigure 5 -activebackground] 4
+} -result {#012345}
+
+test menu-2.37 {entry configuration options 0 -activebackground non-existent tearoff} -body {
+ .m1 entryconfigure 0 -activebackground non-existent
+} -returnCodes error -result {unknown option "-activebackground"}
+
+test menu-2.38 {entry configuration options 1 -activebackground non-existent command} -body {
+ .m1 entryconfigure 1 -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.39 {entry configuration options 2 -activebackground non-existent cascade} -body {
+ .m1 entryconfigure 2 -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.40 {entry configuration options 3 -activebackground non-existent separator} -body {
+ .m1 entryconfigure 3 -activebackground non-existent
+} -returnCodes error -result {unknown option "-activebackground"}
+
+test menu-2.41 {entry configuration options 4 -activebackground non-existent checkbutton} -body {
+ .m1 entryconfigure 4 -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.42 {entry configuration options 5 -activebackground non-existent radiobutton} -body {
+ .m1 entryconfigure 5 -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.43 {entry configuration options 0 -activeforeground #ff0000 tearoff} -body {
+ .m1 entryconfigure 0 -activeforeground #ff0000
+} -returnCodes error -result {unknown option "-activeforeground"}
+
+test menu-2.44 {entry configuration options 1 -activeforeground #ff0000 command} -body {
+ .m1 entryconfigure 1 -activeforeground #ff0000
+ lindex [.m1 entryconfigure 1 -activeforeground] 4
+} -result {#ff0000}
+
+test menu-2.45 {entry configuration options 2 -activeforeground #ff0000 cascade} -body {
+ .m1 entryconfigure 2 -activeforeground #ff0000
+ lindex [.m1 entryconfigure 2 -activeforeground] 4
+} -result {#ff0000}
+
+test menu-2.46 {entry configuration options 3 -activeforeground #ff0000 separator} -body {
+ .m1 entryconfigure 3 -activeforeground #ff0000
+} -returnCodes error -result {unknown option "-activeforeground"}
+
+test menu-2.47 {entry configuration options 4 -activeforeground #ff0000 checkbutton} -body {
+ .m1 entryconfigure 4 -activeforeground #ff0000
+ lindex [.m1 entryconfigure 4 -activeforeground] 4
+} -result {#ff0000}
+
+test menu-2.48 {entry configuration options 5 -activeforeground #ff0000 radiobutton} -body {
+ .m1 entryconfigure 5 -activeforeground #ff0000
+ lindex [.m1 entryconfigure 5 -activeforeground] 4
+} -result {#ff0000}
+
+test menu-2.49 {entry configuration options 0 -activeforeground non-existent tearoff} -body {
+ .m1 entryconfigure 0 -activeforeground non-existent
+} -returnCodes error -result {unknown option "-activeforeground"}
+
+test menu-2.50 {entry configuration options 1 -activeforeground non-existent command} -body {
+ .m1 entryconfigure 1 -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.51 {entry configuration options 2 -activeforeground non-existent cascade} -body {
+ .m1 entryconfigure 2 -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.52 {entry configuration options 3 -activeforeground non-existent separator} -body {
+ .m1 entryconfigure 3 -activeforeground non-existent
+} -returnCodes error -result {unknown option "-activeforeground"}
+
+test menu-2.53 {entry configuration options 4 -activeforeground non-existent checkbutton} -body {
+ .m1 entryconfigure 4 -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.54 {entry configuration options 5 -activeforeground non-existent radiobutton} -body {
+ .m1 entryconfigure 5 -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.55 {entry configuration options 0 -accelerator Ctrl+S tearoff} -body {
+ .m1 entryconfigure 0 -accelerator Ctrl+S
+} -returnCodes error -result {unknown option "-accelerator"}
+
+test menu-2.56 {entry configuration options 1 -accelerator Ctrl+S command} -body {
+ .m1 entryconfigure 1 -accelerator Ctrl+S
+ lindex [.m1 entryconfigure 1 -accelerator] 4
+} -result {Ctrl+S}
+
+test menu-2.57 {entry configuration options 2 -accelerator Ctrl+S cascade} -body {
+ .m1 entryconfigure 2 -accelerator Ctrl+S
+ lindex [.m1 entryconfigure 2 -accelerator] 4
+} -result {Ctrl+S}
+
+test menu-2.58 {entry configuration options 3 -accelerator Ctrl+S separator} -body {
+ .m1 entryconfigure 3 -accelerator Ctrl+S
+} -returnCodes error -result {unknown option "-accelerator"}
+
+test menu-2.59 {entry configuration options 4 -accelerator Ctrl+S checkbutton} -body {
+ .m1 entryconfigure 4 -accelerator Ctrl+S
+ lindex [.m1 entryconfigure 4 -accelerator] 4
+} -result {Ctrl+S}
+
+test menu-2.60 {entry configuration options 5 -accelerator Ctrl+S radiobutton} -body {
+ .m1 entryconfigure 5 -accelerator Ctrl+S
+ lindex [.m1 entryconfigure 5 -accelerator] 4
+} -result {Ctrl+S}
+
+test menu-2.61 {entry configuration options 0 -background #ff0000 tearoff} -body {
+ .m1 entryconfigure 0 -background #ff0000
+ lindex [.m1 entryconfigure 0 -background] 4
+} -result {#ff0000}
+
+test menu-2.62 {entry configuration options 1 -background #ff0000 command} -body {
+ .m1 entryconfigure 1 -background #ff0000
+ lindex [.m1 entryconfigure 1 -background] 4
+} -result {#ff0000}
+
+test menu-2.63 {entry configuration options 2 -background #ff0000 cascade} -body {
+ .m1 entryconfigure 2 -background #ff0000
+ lindex [.m1 entryconfigure 2 -background] 4
+} -result {#ff0000}
+
+test menu-2.64 {entry configuration options 3 -background #ff0000 separator} -body {
+ .m1 entryconfigure 3 -background #ff0000
+ lindex [.m1 entryconfigure 3 -background] 4
+} -result {#ff0000}
+
+test menu-2.65 {entry configuration options 4 -background #ff0000 checkbutton} -body {
+ .m1 entryconfigure 4 -background #ff0000
+ lindex [.m1 entryconfigure 4 -background] 4
+} -result {#ff0000}
+
+test menu-2.66 {entry configuration options 5 -background #ff0000 radiobutton} -body {
+ .m1 entryconfigure 5 -background #ff0000
+ lindex [.m1 entryconfigure 5 -background] 4
+} -result {#ff0000}
+
+test menu-2.67 {entry configuration options 0 -background non-existent tearoff} -body {
+ .m1 entryconfigure 0 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.68 {entry configuration options 1 -background non-existent command} -body {
+ .m1 entryconfigure 1 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.69 {entry configuration options 2 -background non-existent cascade} -body {
+ .m1 entryconfigure 2 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.70 {entry configuration options 3 -background non-existent separator} -body {
+ .m1 entryconfigure 3 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.71 {entry configuration options 4 -background non-existent checkbutton} -body {
+ .m1 entryconfigure 4 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.72 {entry configuration options 5 -background non-existent radiobutton} -body {
+ .m1 entryconfigure 5 -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.73 {entry configuration options 0 -bitmap questhead tearoff} -body {
+ .m1 entryconfigure 0 -bitmap questhead
+} -returnCodes error -result {unknown option "-bitmap"}
+
+test menu-2.74 {entry configuration options 1 -bitmap questhead command} -body {
+ .m1 entryconfigure 1 -bitmap questhead
+ lindex [.m1 entryconfigure 1 -bitmap] 4
+} -result {questhead}
+
+test menu-2.75 {entry configuration options 2 -bitmap questhead cascade} -body {
+ .m1 entryconfigure 2 -bitmap questhead
+ lindex [.m1 entryconfigure 2 -bitmap] 4
+} -result {questhead}
+
+test menu-2.76 {entry configuration options 3 -bitmap questhead separator} -body {
+ .m1 entryconfigure 3 -bitmap questhead
+} -returnCodes error -result {unknown option "-bitmap"}
+
+test menu-2.77 {entry configuration options 4 -bitmap questhead checkbutton} -body {
+ .m1 entryconfigure 4 -bitmap questhead
+ lindex [.m1 entryconfigure 4 -bitmap] 4
+} -result {questhead}
+
+test menu-2.78 {entry configuration options 5 -bitmap questhead radiobutton} -body {
+ .m1 entryconfigure 5 -bitmap questhead
+ lindex [.m1 entryconfigure 5 -bitmap] 4
+} -result {questhead}
+
+test menu-2.79 {entry configuration options 0 -bitmap badValue tearoff} -body {
+ .m1 entryconfigure 0 -bitmap badValue
+} -returnCodes error -result {unknown option "-bitmap"}
+
+test menu-2.80 {entry configuration options 1 -bitmap badValue command} -body {
+ .m1 entryconfigure 1 -bitmap badValue
+} -returnCodes error -result {bitmap "badValue" not defined}
+
+test menu-2.81 {entry configuration options 2 -bitmap badValue cascade} -body {
+ .m1 entryconfigure 2 -bitmap badValue
+} -returnCodes error -result {bitmap "badValue" not defined}
+
+test menu-2.82 {entry configuration options 3 -bitmap badValue separator} -body {
+ .m1 entryconfigure 3 -bitmap badValue
+} -returnCodes error -result {unknown option "-bitmap"}
+
+test menu-2.83 {entry configuration options 4 -bitmap badValue checkbutton} -body {
+ .m1 entryconfigure 4 -bitmap badValue
+} -returnCodes error -result {bitmap "badValue" not defined}
+
+test menu-2.84 {entry configuration options 5 -bitmap badValue radiobutton} -body {
+ .m1 entryconfigure 5 -bitmap badValue
+} -returnCodes error -result {bitmap "badValue" not defined}
+
+test menu-2.85 {entry configuration options 0 -columnbreak 1 tearoff} -body {
+ .m1 entryconfigure 0 -columnbreak 1
+} -returnCodes error -result {unknown option "-columnbreak"}
+test menu-2.86 {entry configuration options 1 -columnbreak 1 command} -body {
+ .m1 entryconfigure 1 -columnbreak 1
+ lindex [.m1 entryconfigure 1 -columnbreak] 4
+} -result {1}
+
+test menu-2.87 {entry configuration options 2 -columnbreak 1 cascade} -body {
+ .m1 entryconfigure 2 -columnbreak 1
+ lindex [.m1 entryconfigure 2 -columnbreak] 4
+} -result {1}
+
+test menu-2.88 {entry configuration options 3 -columnbreak 1 separator} -body {
+ .m1 entryconfigure 3 -columnbreak 1
+} -returnCodes error -result {unknown option "-columnbreak"}
+
+test menu-2.89 {entry configuration options 4 -columnbreak 1 checkbutton} -body {
+ .m1 entryconfigure 4 -columnbreak 1
+ lindex [.m1 entryconfigure 4 -columnbreak] 4
+} -result {1}
+
+test menu-2.90 {entry configuration options 5 -columnbreak 1 radiobutton} -body {
+ .m1 entryconfigure 5 -columnbreak 1
+ lindex [.m1 entryconfigure 5 -columnbreak] 4
+} -result {1}
+
+test menu-2.91 {entry configuration options 0 -command beep tearoff} -body {
+ .m1 entryconfigure 0 -command beep
+} -returnCodes error -result {unknown option "-command"}
+
+test menu-2.92 {entry configuration options 1 -command beep command} -body {
+ .m1 entryconfigure 1 -command beep
+ lindex [.m1 entryconfigure 1 -command] 4
+} -result {beep}
+
+test menu-2.93 {entry configuration options 2 -command beep cascade} -body {
+ .m1 entryconfigure 2 -command beep
+ lindex [.m1 entryconfigure 2 -command] 4
+} -result {beep}
+
+test menu-2.94 {entry configuration options 3 -command beep separator} -body {
+ .m1 entryconfigure 3 -command beep
+} -returnCodes error -result {unknown option "-command"}
+
+test menu-2.95 {entry configuration options 4 -command beep checkbutton} -body {
+ .m1 entryconfigure 4 -command beep
+ lindex [.m1 entryconfigure 4 -command] 4
+} -result {beep}
+
+test menu-2.96 {entry configuration options 5 -command beep radiobutton} -body {
+ .m1 entryconfigure 5 -command beep
+ lindex [.m1 entryconfigure 5 -command] 4
+} -result {beep}
+
+test menu-2.97 {entry configuration options 0 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* tearoff} -body {
+ .m1 entryconfigure 0 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+} -returnCodes error -result {unknown option "-font"}
+
+test menu-2.98 {entry configuration options 1 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* command} -body {
+ .m1 entryconfigure 1 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ lindex [.m1 entryconfigure 1 -font] 4
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+
+test menu-2.99 {entry configuration options 2 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* cascade} -body {
+ .m1 entryconfigure 2 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ lindex [.m1 entryconfigure 2 -font] 4
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+
+test menu-2.100 {entry configuration options 3 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* separator} -body {
+ .m1 entryconfigure 3 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+} -returnCodes error -result {unknown option "-font"}
+
+test menu-2.101 {entry configuration options 4 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* checkbutton} -body {
+ .m1 entryconfigure 4 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ lindex [.m1 entryconfigure 4 -font] 4
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+
+test menu-2.102 {entry configuration options 5 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* radiobutton} -body {
+ .m1 entryconfigure 5 -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ lindex [.m1 entryconfigure 5 -font] 4
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+
+test menu-2.103 {entry configuration options 0 -font {kill rock stars} tearoff} -body {
+ .m1 entryconfigure 0 -font {kill rock stars}
+} -returnCodes error -result {unknown option "-font"}
+
+test menu-2.104 {entry configuration options 1 -font {kill rock stars} command} -body {
+ .m1 entryconfigure 1 -font {kill rock stars}
+} -returnCodes error -result {expected integer but got "rock"}
+
+test menu-2.105 {entry configuration options 2 -font {kill rock stars} cascade} -body {
+ .m1 entryconfigure 2 -font {kill rock stars}
+} -returnCodes error -result {expected integer but got "rock"}
+
+test menu-2.106 {entry configuration options 3 -font {kill rock stars} separator} -body {
+ .m1 entryconfigure 3 -font {kill rock stars}
+} -returnCodes error -result {unknown option "-font"}
+
+test menu-2.107 {entry configuration options 4 -font {kill rock stars} checkbutton} -body {
+ .m1 entryconfigure 4 -font {kill rock stars}
+} -returnCodes error -result {expected integer but got "rock"}
+
+test menu-2.108 {entry configuration options 5 -font {kill rock stars} radiobutton} -body {
+ .m1 entryconfigure 5 -font {kill rock stars}
+} -returnCodes error -result {expected integer but got "rock"}
+
+test menu-2.109 {entry configuration options 0 -foreground #110022 tearoff} -body {
+ .m1 entryconfigure 0 -foreground #110022
+} -returnCodes error -result {unknown option "-foreground"}
+
+test menu-2.110 {entry configuration options 1 -foreground #110022 command} -body {
+ .m1 entryconfigure 1 -foreground #110022
+ lindex [.m1 entryconfigure 1 -foreground] 4
+} -result {#110022}
+
+test menu-2.111 {entry configuration options 2 -foreground #110022 cascade} -body {
+ .m1 entryconfigure 2 -foreground #110022
+ lindex [.m1 entryconfigure 2 -foreground] 4
+} -result {#110022}
+
+test menu-2.112 {entry configuration options 3 -foreground #110022 separator} -body {
+ .m1 entryconfigure 3 -foreground #110022
+} -returnCodes error -result {unknown option "-foreground"}
+
+test menu-2.113 {entry configuration options 4 -foreground #110022 checkbutton} -body {
+ .m1 entryconfigure 4 -foreground #110022
+ lindex [.m1 entryconfigure 4 -foreground] 4
+} -result {#110022}
+
+test menu-2.114 {entry configuration options 5 -foreground #110022 radiobutton} -body {
+ .m1 entryconfigure 5 -foreground #110022
+ lindex [.m1 entryconfigure 5 -foreground] 4
+} -result {#110022}
+
+test menu-2.115 {entry configuration options 0 -foreground non-existent tearoff} -body {
+ .m1 entryconfigure 0 -foreground non-existent
+} -returnCodes error -result {unknown option "-foreground"}
+
+test menu-2.116 {entry configuration options 1 -foreground non-existent command} -body {
+ .m1 entryconfigure 1 -foreground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.117 {entry configuration options 2 -foreground non-existent cascade} -body {
+ .m1 entryconfigure 2 -foreground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.118 {entry configuration options 3 -foreground non-existent separator} -body {
+ .m1 entryconfigure 3 -foreground non-existent
+} -returnCodes error -result {unknown option "-foreground"}
+
+test menu-2.119 {entry configuration options 4 -foreground non-existent checkbutton} -body {
+ .m1 entryconfigure 4 -foreground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.120 {entry configuration options 5 -foreground non-existent radiobutton} -body {
+ .m1 entryconfigure 5 -foreground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.121 {entry configuration options 0 -image image1 tearoff} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 0 -image image1
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.122 {entry configuration options 1 -image image1 command} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 1 -image {}
+} -body {
+ .m1 entryconfigure 1 -image image1
+ lindex [.m1 entryconfigure 1 -image] 4
+} -cleanup {
+ .m1 entryconfigure 1 -image {}
+} -result {image1}
+
+test menu-2.123 {entry configuration options 2 -image image1 cascade} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 2 -image {}
+} -body {
+ .m1 entryconfigure 2 -image image1
+ lindex [.m1 entryconfigure 2 -image] 4
+} -cleanup {
+ .m1 entryconfigure 2 -image {}
+} -result {image1}
+
+test menu-2.124 {entry configuration options 3 -image image1 separator} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 3 -image image1
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 4 -image {}
+} -body {
+ .m1 entryconfigure 4 -image image1
+ lindex [.m1 entryconfigure 4 -image] 4
+} -cleanup {
+ .m1 entryconfigure 4 -image {}
+} -result {image1}
+
+test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 5 -image {}
+} -body {
+ .m1 entryconfigure 5 -image image1
+ lindex [.m1 entryconfigure 5 -image] 4
+} -cleanup {
+ .m1 entryconfigure 5 -image {}
+} -result {image1}
+
+test menu-2.127 {entry configuration options 0 -image bogus tearoff} -body {
+ .m1 entryconfigure 0 -image bogus
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.128 {entry configuration options 1 -image bogus command} -body {
+ .m1 entryconfigure 1 -image bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.129 {entry configuration options 2 -image bogus cascade} -body {
+ .m1 entryconfigure 2 -image bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.130 {entry configuration options 3 -image bogus separator} -body {
+ .m1 entryconfigure 3 -image bogus
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.131 {entry configuration options 4 -image bogus checkbutton} -body {
+ .m1 entryconfigure 4 -image bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.132 {entry configuration options 5 -image bogus radiobutton} -body {
+ .m1 entryconfigure 5 -image bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.133 {entry configuration options 0 -image {} tearoff} -body {
+ .m1 entryconfigure 0 -image
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.134 {entry configuration options 1 -image {} command} -setup {
+ .m1 entryconfigure 1 -image {}
+} -body {
+ .m1 entryconfigure 1 -image
+ lindex [.m1 entryconfigure 1 -image] 4
+} -result {}
+
+test menu-2.135 {entry configuration options 2 -image {} cascade} -setup {
+ .m1 entryconfigure 2 -image {}
+} -body {
+ .m1 entryconfigure 2 -image
+ lindex [.m1 entryconfigure 2 -image] 4
+} -result {}
+
+test menu-2.136 {entry configuration options 3 -image {} separator} -body {
+ .m1 entryconfigure 3 -image
+} -returnCodes error -result {unknown option "-image"}
+
+test menu-2.137 {entry configuration options 4 -image {} checkbutton} -body {
+ .m1 entryconfigure 4 -image
+ lindex [.m1 entryconfigure 4 -image] 4
+} -result {}
+
+test menu-2.138 {entry configuration options 5 -image {} radiobutton} -body {
+ .m1 entryconfigure 5 -image
+ lindex [.m1 entryconfigure 5 -image] 4
+} -result {}
+
+test menu-2.139 {entry configuration options 0 -indicatoron 1 tearoff} -body {
+ .m1 entryconfigure 0 -indicatoron 1
+} -returnCodes error -result {unknown option "-indicatoron"}
+
+test menu-2.140 {entry configuration options 1 -indicatoron 1 command} -body {
+ .m1 entryconfigure 1 -indicatoron 1
+} -returnCodes error -result {unknown option "-indicatoron"}
+
+test menu-2.141 {entry configuration options 2 -indicatoron 1 cascade} -body {
+ .m1 entryconfigure 2 -indicatoron 1
+} -returnCodes error -result {unknown option "-indicatoron"}
+
+test menu-2.142 {entry configuration options 3 -indicatoron 1 separator} -body {
+ .m1 entryconfigure 3 -indicatoron 1
+} -returnCodes error -result {unknown option "-indicatoron"}
+
+test menu-2.143 {entry configuration options 4 -indicatoron 1 checkbutton} -body {
+ .m1 entryconfigure 4 -indicatoron 1
+ lindex [.m1 entryconfigure 4 -indicatoron] 4
+} -result {1}
+
+test menu-2.144 {entry configuration options 5 -indicatoron 1 radiobutton} -body {
+ .m1 entryconfigure 5 -indicatoron 1
+ lindex [.m1 entryconfigure 5 -indicatoron] 4
+} -result {1}
+
+test menu-2.145 {entry configuration options 0 -label test tearoff} -body {
+ .m1 entryconfigure 0 -label test
+} -returnCodes error -result {unknown option "-label"}
+
+test menu-2.146 {entry configuration options 1 -label test command} -body {
+ .m1 entryconfigure 1 -label test
+ lindex [.m1 entryconfigure 1 -label] 4
+} -result {test}
+
+test menu-2.147 {entry configuration options 2 -label test cascade} -body {
+ .m1 entryconfigure 2 -label test
+ lindex [.m1 entryconfigure 2 -label] 4
+} -result {test}
+
+test menu-2.148 {entry configuration options 3 -label test separator} -body {
+ .m1 entryconfigure 3 -label test
+} -returnCodes error -result {unknown option "-label"}
+
+test menu-2.149 {entry configuration options 4 -label test checkbutton} -body {
+ .m1 entryconfigure 4 -label test
+ lindex [.m1 entryconfigure 4 -label] 4
+} -result {test}
+
+test menu-2.150 {entry configuration options 5 -label test radiobutton} -body {
+ .m1 entryconfigure 5 -label test
+ lindex [.m1 entryconfigure 5 -label] 4
+} -result {test}
+
+test menu-2.151 {entry configuration options 0 -menu .m2 tearoff} -body {
+ .m1 entryconfigure 0 -menu .m2
+} -returnCodes error -result {unknown option "-menu"}
+
+test menu-2.152 {entry configuration options 1 -menu .m2 command} -body {
+ .m1 entryconfigure 1 -menu .m2
+} -returnCodes error -result {unknown option "-menu"}
+
+test menu-2.153 {entry configuration options 2 -menu .m2 cascade} -body {
+ .m1 entryconfigure 2 -menu .m2
+ lindex [.m1 entryconfigure 2 -menu] 4
+} -result {.m2}
+
+test menu-2.154 {entry configuration options 3 -menu .m2 separator} -body {
+ .m1 entryconfigure 3 -menu .m2
+} -returnCodes error -result {unknown option "-menu"}
+
+test menu-2.155 {entry configuration options 4 -menu .m2 checkbutton} -body {
+ .m1 entryconfigure 4 -menu .m2
+} -returnCodes error -result {unknown option "-menu"}
+
+test menu-2.156 {entry configuration options 5 -menu .m2 radiobutton} -body {
+ .m1 entryconfigure 5 -menu .m2
+} -returnCodes error -result {unknown option "-menu"}
+
+test menu-2.157 {entry configuration options 0 -offvalue off tearoff} -body {
+ .m1 entryconfigure 0 -offvalue off
+} -returnCodes error -result {unknown option "-offvalue"}
+
+test menu-2.158 {entry configuration options 1 -offvalue off command} -body {
+ .m1 entryconfigure 1 -offvalue off
+} -returnCodes error -result {unknown option "-offvalue"}
+
+test menu-2.159 {entry configuration options 2 -offvalue off cascade} -body {
+ .m1 entryconfigure 2 -offvalue off
+} -returnCodes error -result {unknown option "-offvalue"}
+
+test menu-2.160 {entry configuration options 3 -offvalue off separator} -body {
+ .m1 entryconfigure 3 -offvalue off
+} -returnCodes error -result {unknown option "-offvalue"}
+
+test menu-2.161 {entry configuration options 4 -offvalue off checkbutton} -body {
+ .m1 entryconfigure 4 -offvalue off
+ lindex [.m1 entryconfigure 4 -offvalue] 4
+} -result {off}
+
+test menu-2.162 {entry configuration options 5 -offvalue off radiobutton} -body {
+ .m1 entryconfigure 5 -offvalue off
+} -returnCodes error -result {unknown option "-offvalue"}
+
+test menu-2.163 {entry configuration options 0 -onvalue on tearoff} -body {
+ .m1 entryconfigure 0 -onvalue on
+} -returnCodes error -result {unknown option "-onvalue"}
+
+test menu-2.164 {entry configuration options 1 -onvalue on command} -body {
+ .m1 entryconfigure 1 -onvalue on
+} -returnCodes error -result {unknown option "-onvalue"}
+
+test menu-2.165 {entry configuration options 2 -onvalue on cascade} -body {
+ .m1 entryconfigure 2 -onvalue on
+} -returnCodes error -result {unknown option "-onvalue"}
+
+test menu-2.166 {entry configuration options 3 -onvalue on separator} -body {
+ .m1 entryconfigure 3 -onvalue on
+} -returnCodes error -result {unknown option "-onvalue"}
+
+test menu-2.167 {entry configuration options 4 -onvalue on checkbutton} -body {
+ .m1 entryconfigure 4 -onvalue on
+ lindex [.m1 entryconfigure 4 -onvalue] 4
+} -result {on}
+
+test menu-2.168 {entry configuration options 5 -onvalue on radiobutton} -body {
+ .m1 entryconfigure 5 -onvalue on
+} -returnCodes error -result {unknown option "-onvalue"}
+
+test menu-2.169 {entry configuration options 0 -selectcolor #110022 tearoff} -body {
+ .m1 entryconfigure 0 -selectcolor #110022
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.170 {entry configuration options 1 -selectcolor #110022 command} -body {
+ .m1 entryconfigure 1 -selectcolor #110022
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.171 {entry configuration options 2 -selectcolor #110022 cascade} -body {
+ .m1 entryconfigure 2 -selectcolor #110022
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.172 {entry configuration options 3 -selectcolor #110022 separator} -body {
+ .m1 entryconfigure 3 -selectcolor #110022
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.173 {entry configuration options 4 -selectcolor #110022 checkbutton} -body {
+ .m1 entryconfigure 4 -selectcolor #110022
+ lindex [.m1 entryconfigure 4 -selectcolor] 4
+} -result {#110022}
+
+test menu-2.174 {entry configuration options 5 -selectcolor #110022 radiobutton} -body {
+ .m1 entryconfigure 5 -selectcolor #110022
+ lindex [.m1 entryconfigure 5 -selectcolor] 4
+} -result {#110022}
+
+test menu-2.175 {entry configuration options 0 -selectcolor non-existent tearoff} -body {
+ .m1 entryconfigure 0 -selectcolor non-existent
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.176 {entry configuration options 1 -selectcolor non-existent command} -body {
+ .m1 entryconfigure 1 -selectcolor non-existent
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.177 {entry configuration options 2 -selectcolor non-existent cascade} -body {
+ .m1 entryconfigure 2 -selectcolor non-existent
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.178 {entry configuration options 3 -selectcolor non-existent separator} -body {
+ .m1 entryconfigure 3 -selectcolor non-existent
+} -returnCodes error -result {unknown option "-selectcolor"}
+
+test menu-2.179 {entry configuration options 4 -selectcolor non-existent checkbutton} -body {
+ .m1 entryconfigure 4 -selectcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobutton} -body {
+ .m1 entryconfigure 5 -selectcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+
+test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 0 -selectimage image1
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.182 {entry configuration options 1 -selectimage image1 command} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 1 -selectimage image1
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 2 -selectimage image1
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -constraints {
+ hasEarthPhoto
+} -body {
+ .m1 entryconfigure 3 -selectimage image1
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 4 -selectimage {}
+} -body {
+ .m1 entryconfigure 4 -selectimage image1
+ lindex [.m1 entryconfigure 4 -selectimage] 4
+} -cleanup {
+ .m1 entryconfigure 4 -selectimage {}
+} -result {image1}
+
+test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -constraints {
+ hasEarthPhoto
+} -setup {
+ .m1 entryconfigure 5 -selectimage {}
+} -body {
+ .m1 entryconfigure 5 -selectimage image1
+ lindex [.m1 entryconfigure 5 -selectimage] 4
+} -cleanup {
+ .m1 entryconfigure 5 -selectimage {}
+} -result {image1}
+
+test menu-2.187 {entry configuration options 0 -selectimage bogus tearoff} -body {
+ .m1 entryconfigure 0 -selectimage bogus
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.188 {entry configuration options 1 -selectimage bogus command} -body {
+ .m1 entryconfigure 1 -selectimage bogus
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.189 {entry configuration options 2 -selectimage bogus cascade} -body {
+ .m1 entryconfigure 2 -selectimage bogus
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.190 {entry configuration options 3 -selectimage bogus separator} -body {
+ .m1 entryconfigure 3 -selectimage bogus
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.191 {entry configuration options 4 -selectimage bogus checkbutton} -body {
+ .m1 entryconfigure 4 -selectimage bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.192 {entry configuration options 5 -selectimage bogus radiobutton} -body {
+ .m1 entryconfigure 5 -selectimage bogus
+} -returnCodes error -result {image "bogus" doesn't exist}
+
+test menu-2.193 {entry configuration options 0 -selectimage {} tearoff} -body {
+ .m1 entryconfigure 0 -selectimage
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.194 {entry configuration options 1 -selectimage {} command} -body {
+ .m1 entryconfigure 1 -selectimage
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.195 {entry configuration options 2 -selectimage {} cascade} -body {
+ .m1 entryconfigure 2 -selectimage
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.196 {entry configuration options 3 -selectimage {} separator} -body {
+ .m1 entryconfigure 3 -selectimage
+} -returnCodes error -result {unknown option "-selectimage"}
+
+test menu-2.197 {entry configuration options 4 -selectimage {} checkbutton} -body {
+ .m1 entryconfigure 4 -selectimage
+ lindex [.m1 entryconfigure 4 -selectimage] 4
+} -result {}
+
+test menu-2.198 {entry configuration options 5 -selectimage {} radiobutton} -body {
+ .m1 entryconfigure 5 -selectimage
+ lindex [.m1 entryconfigure 5 -selectimage] 4
+} -result {}
+
+test menu-2.199 {entry configuration options 0 -state normal tearoff} -body {
+ .m1 entryconfigure 0 -state normal
+ lindex [.m1 entryconfigure 0 -state] 4
+} -result {normal}
+
+test menu-2.200 {entry configuration options 1 -state normal command} -body {
+ .m1 entryconfigure 1 -state normal
+ lindex [.m1 entryconfigure 1 -state] 4
+} -result {normal}
+
+test menu-2.201 {entry configuration options 2 -state normal cascade} -body {
+ .m1 entryconfigure 2 -state normal
+ lindex [.m1 entryconfigure 2 -state] 4
+} -result {normal}
+
+test menu-2.202 {entry configuration options 3 -state normal separator} -body {
+ .m1 entryconfigure 3 -state normal
+} -returnCodes error -result {unknown option "-state"}
+
+test menu-2.203 {entry configuration options 4 -state normal checkbutton} -body {
+ .m1 entryconfigure 4 -state normal
+ lindex [.m1 entryconfigure 4 -state] 4
+} -result {normal}
+
+test menu-2.204 {entry configuration options 5 -state normal radiobutton} -body {
+ .m1 entryconfigure 5 -state normal
+ lindex [.m1 entryconfigure 5 -state] 4
+} -result {normal}
+
+test menu-2.205 {entry configuration options 0 -value {any string} tearoff} -body {
+ .m1 entryconfigure 0 -value {any string}
+} -returnCodes error -result {unknown option "-value"}
+
+test menu-2.206 {entry configuration options 1 -value {any string} command} -body {
+ .m1 entryconfigure 1 -value {any string}
+} -returnCodes error -result {unknown option "-value"}
+
+test menu-2.207 {entry configuration options 2 -value {any string} cascade} -body {
+ .m1 entryconfigure 2 -value {any string}
+} -returnCodes error -result {unknown option "-value"}
+
+test menu-2.208 {entry configuration options 3 -value {any string} separator} -body {
+ .m1 entryconfigure 3 -value {any string}
+} -returnCodes error -result {unknown option "-value"}
+
+test menu-2.209 {entry configuration options 4 -value {any string} checkbutton} -body {
+ .m1 entryconfigure 4 -value {any string}
+} -returnCodes error -result {unknown option "-value"}
+
+test menu-2.210 {entry configuration options 5 -value {any string} radiobutton} -body {
+ .m1 entryconfigure 5 -value {any string}
+ lindex [.m1 entryconfigure 5 -value] 4
+} -result {any string}
+
+test menu-2.211 {entry configuration options 0 -variable {any string} tearoff} -body {
+ .m1 entryconfigure 0 -variable {any string}
+} -returnCodes error -result {unknown option "-variable"}
+
+test menu-2.212 {entry configuration options 1 -variable {any string} command} -body {
+ .m1 entryconfigure 1 -variable {any string}
+} -returnCodes error -result {unknown option "-variable"}
+
+test menu-2.213 {entry configuration options 2 -variable {any string} cascade} -body {
+ .m1 entryconfigure 2 -variable {any string}
+} -returnCodes error -result {unknown option "-variable"}
+
+test menu-2.214 {entry configuration options 3 -variable {any string} separator} -body {
+ .m1 entryconfigure 3 -variable {any string}
+} -returnCodes error -result {unknown option "-variable"}
+
+test menu-2.215 {entry configuration options 4 -variable {any string} checkbutton} -body {
+ .m1 entryconfigure 4 -variable {any string}
+ lindex [.m1 entryconfigure 4 -variable] 4
+} -result {any string}
+
+test menu-2.216 {entry configuration options 5 -variable {any string} radiobutton} -body {
+ .m1 entryconfigure 5 -variable {any string}
+ lindex [.m1 entryconfigure 5 -variable] 4
+} -result {any string}
+
+test menu-2.217 {entry configuration options 0 -underline 0 tearoff} -body {
+ .m1 entryconfigure 0 -underline 0
+} -returnCodes error -result {unknown option "-underline"}
+
+test menu-2.218 {entry configuration options 1 -underline 0 command} -body {
+ .m1 entryconfigure 1 -underline 0
+ lindex [.m1 entryconfigure 1 -underline] 4
+} -result {0}
+
+test menu-2.219 {entry configuration options 2 -underline 0 cascade} -body {
+ .m1 entryconfigure 2 -underline 0
+ lindex [.m1 entryconfigure 2 -underline] 4
+} -result {0}
+
+test menu-2.220 {entry configuration options 3 -underline 0 separator} -body {
+ .m1 entryconfigure 3 -underline 0
+} -returnCodes error -result {unknown option "-underline"}
+
+test menu-2.221 {entry configuration options 4 -underline 0 checkbutton} -body {
+ .m1 entryconfigure 4 -underline 0
+ lindex [.m1 entryconfigure 4 -underline] 4
+} -result {0}
+
+test menu-2.222 {entry configuration options 5 -underline 0 radiobutton} -body {
+ .m1 entryconfigure 5 -underline 0
+ lindex [.m1 entryconfigure 5 -underline] 4
+} -result {0}
+
+test menu-2.223 {entry configuration options 0 -underline 3p tearoff} -body {
+ .m1 entryconfigure 0 -underline 3p
+} -returnCodes error -result {unknown option "-underline"}
+
+test menu-2.224 {entry configuration options 1 -underline 3p command} -body {
+ .m1 entryconfigure 1 -underline 3p
+} -returnCodes error -result {expected integer but got "3p"}
+
+test menu-2.225 {entry configuration options 2 -underline 3p cascade} -body {
+ .m1 entryconfigure 2 -underline 3p
+} -returnCodes error -result {expected integer but got "3p"}
+
+test menu-2.226 {entry configuration options 3 -underline 3p separator} -body {
+ .m1 entryconfigure 3 -underline 3p
+} -returnCodes error -result {unknown option "-underline"}
+
+test menu-2.227 {entry configuration options 4 -underline 3p checkbutton} -body {
+ .m1 entryconfigure 4 -underline 3p
+} -returnCodes error -result {expected integer but got "3p"}
+
+test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body {
+ .m1 entryconfigure 5 -underline 3p
+} -returnCodes error -result {expected integer but got "3p"}
+
+deleteWindows
if {[testConstraint hasEarthPhoto]} {
image delete image1
}
-destroy .m1
-destroy .m2
-test menu-3.1 {MenuWidgetCmd procedure} {
- catch {destroy .m1}
+
+
+test menu-3.1 {MenuWidgetCmd procedure} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 option ?arg arg ...?"} {}}
-test menu-3.2 {MenuWidgetCmd, Tcl_Preserve and Tcl_Release} {nonUnixUserInteraction } {
- catch {destroy .m1}
+ .m1
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 option ?arg ...?"}
+test menu-3.2 {MenuWidgetCmd, Tcl_Preserve and Tcl_Release} -constraints {
+ nonUnixUserInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -postcommand "destroy .m1"
.m1 add command -label "menu-3.2: Hit Escape"
- list [catch {.m1 post 40 40} msg] $msg
-} {0 {}}
-test menu-3.3 {MenuWidgetCmd procedure, "activate" option} {
- catch {destroy .m1}
+ .m1 post 40 40
+} -cleanup {
+ destroy .m1
+} -returnCodes ok -result {}
+test menu-3.3 {MenuWidgetCmd procedure, "activate" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 activate} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 activate index"} {}}
-test menu-3.4 {MenuWidgetCmd procedure, "activate" option} {
- catch {destroy .m1}
+ .m1 activate
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 activate index"}
+test menu-3.4 {MenuWidgetCmd procedure, "activate" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 activate "foo"} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.5 {MenuWidgetCmd procedure, "activate" option} {
- catch {destroy .m1}
+ .m1 activate "foo"
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.5 {MenuWidgetCmd procedure, "activate" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add separator
- list [catch {.m1 activate 2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.6 {MenuWidgetCmd procedure, "activate" option} {
- catch {destroy .m1}
+ .m1 activate 2
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.6 {MenuWidgetCmd procedure, "activate" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 entryconfigure 1 -state disabled
- list [catch {.m1 activate 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.7 {MenuWidgetCmd procedure, "activate" option} {
- catch {destroy .m1}
+ .m1 activate 1
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.7 {MenuWidgetCmd procedure, "activate" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 activate 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.8 {MenuWidgetCmd procedure, "add" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 add type ?options?"} {}}
-test menu-3.9 {MenuWidgetCmd procedure, "add" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry type "foo": must be cascade, checkbutton, command, radiobutton, or separator} {}}
-test menu-3.10 {MenuWidgetCmd procedure, "add" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add separator} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.11 {MenuWidgetCmd procedure, "cget" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 cget} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 cget option"} {}}
-test menu-3.12 {MenuWidgetCmd procedure, "cget" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 cget -gorp} msg] $msg [destroy .m1]
-} {1 {unknown option "-gorp"} {}}
-test menu-3.13 {MenuWidgetCmd procedure, "cget" option} {
- catch {destroy .m1}
+ .m1 activate 1
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.8 {MenuWidgetCmd procedure, "add" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 add
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 add type ?-option value ...?"}
+test menu-3.9 {MenuWidgetCmd procedure, "add" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 add foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {bad menu entry type "foo": must be cascade, checkbutton, command, radiobutton, or separator}
+test menu-3.10 {MenuWidgetCmd procedure, "add" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 add separator
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.11 {MenuWidgetCmd procedure, "cget" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 cget
+} -returnCodes error -result {wrong # args: should be ".m1 cget option"}
+test menu-3.12 {MenuWidgetCmd procedure, "cget" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 cget -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test menu-3.13 {MenuWidgetCmd procedure, "cget" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 configure -postcommand "Some string"
- list [catch {.m1 cget -postcommand} msg] $msg [destroy .m1]
-} {0 {Some string} {}}
-test menu-3.14 {MenuWidgetCmd procedure, "clone" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 clone} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 clone newMenuName ?menuType?"} {}}
-test menu-3.15 {MenuWidgetCmd procedure, "clone" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 clone a b c d} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 clone newMenuName ?menuType?"} {}}
-test menu-3.16 {MenuWidgetCmd procedure, "clone" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 clone .m1.clone1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.17 {MenuWidgetCmd procedure, "clone" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 clone .m1.clone1 tearoff} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.18 {MenuWidgetCmd procedure, "configure" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {llength [.m1 configure]} msg] $msg [destroy .m1]
-} {0 20 {}}
-test menu-3.19 {MenuWidgetCmd procedure, "configure" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 configure -gorp} msg] $msg [destroy .m1]
-} {1 {unknown option "-gorp"} {}}
-test menu-3.20 {MenuWidgetCmd procedure, "configure" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 configure -postcommand "A random String"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.21 {MenuWidgetCmd procedure, "configure" option} {
- catch {destroy .m1}
+ .m1 cget -postcommand
+} -cleanup {
+ destroy .m1
+} -result {Some string}
+test menu-3.14 {MenuWidgetCmd procedure, "clone" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 clone
+} -returnCodes error -result {wrong # args: should be ".m1 clone newMenuName ?menuType?"}
+test menu-3.15 {MenuWidgetCmd procedure, "clone" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 clone a b c d
+} -returnCodes error -result {wrong # args: should be ".m1 clone newMenuName ?menuType?"}
+test menu-3.16 {MenuWidgetCmd procedure, "clone" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 clone .m1.clone1
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.17 {MenuWidgetCmd procedure, "clone" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 clone .m1.clone1 tearoff
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.18 {MenuWidgetCmd procedure, "configure" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ llength [.m1 configure]
+} -cleanup {
+ destroy .m1
+} -result {20}
+test menu-3.19 {MenuWidgetCmd procedure, "configure" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 configure -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test menu-3.20 {MenuWidgetCmd procedure, "configure" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 configure -postcommand "A random String"
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.21 {MenuWidgetCmd procedure, "configure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 configure -postcommand "Another string"
- list [catch {lindex [.m1 configure -postcommand] 4} msg] $msg [destroy .m1]
-} {0 {Another string} {}}
-test menu-3.22 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 delete} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 delete first ?last?"} {}}
-test menu-3.23 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 delete foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.24 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 delete 0 "foo"} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.25 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 delete 0} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.26 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
+ lindex [.m1 configure -postcommand] 4
+} -cleanup {
+ destroy .m1
+} -result {Another string}
+test menu-3.22 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 delete
+} -returnCodes error -result {wrong # args: should be ".m1 delete first ?last?"}
+test menu-3.23 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 delete foo
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.24 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 delete 0 "foo"
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.25 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 delete 0
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.26 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "foo"
- list [catch {.m1 delete 1 0} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.27 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
+ .m1 delete 1 0
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.27 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "1"
.m1 add command -label "2"
.m1 add command -label "3"
- list [catch {.m1 delete 1 3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.28 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
+ .m1 delete 1 3
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.28 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "1"
.m1 add command -label "2"
.m1 add command -label "3"
.m1 activate 2
- list [catch {.m1 delete 1 3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.29 {MenuWidgetCmd procedure, "delete" option} {
- catch {destroy .m1}
+ .m1 delete 1 3
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.29 {MenuWidgetCmd procedure, "delete" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "1"
.m1 add command -label "2"
.m1 add command -label "3"
.m1 activate 3
- list [catch {.m1 delete 1} msg] $msg [destroy .m1]
-} {0 {} {}}
+ .m1 delete 1
+} -cleanup {
+ destroy .m1
+} -result {}
test menu-3.29+1 {MenuWidgetCmd, "delete", Bug 220950} -setup {
destroy .m1
} -body {
@@ -690,224 +1464,328 @@ test menu-3.29+1 {MenuWidgetCmd, "delete", Bug 220950} -setup {
} -cleanup {
destroy .m1
} -result ok
-test menu-3.30 {MenuWidgetCmd procedure, "entrycget" option} {
- catch {destroy .m1}
+test menu-3.30 {MenuWidgetCmd procedure, "entrycget" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 entrycget} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 entrycget index option"} {}}
-test menu-3.31 {MenuWidgetCmd procedure, "entrycget" option} {
- catch {destroy .m1}
+ .m1 entrycget
+} -returnCodes error -result {wrong # args: should be ".m1 entrycget index option"}
+test menu-3.31 {MenuWidgetCmd procedure, "entrycget" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 entrycget index option foo} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 entrycget index option"} {}}
-test menu-3.32 {MenuWidgetCmd procedure, "entrycget" option} {
- catch {destroy .m1}
+ .m1 entrycget index option foo
+} -returnCodes error -result {wrong # args: should be ".m1 entrycget index option"}
+test menu-3.32 {MenuWidgetCmd procedure, "entrycget" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 entrycget foo -label} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.33 {MenuWidgetCmd procedure, "entrycget" option} {
- catch {destroy .m1}
+ .m1 entrycget foo -label
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.33 {MenuWidgetCmd procedure, "entrycget" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 entrycget 1 -label} msg] $msg [destroy .m1]
-} {0 test {}}
-test menu-3.34 {MenuWidgetCmd procedure, "entryconfigure" option} {
- catch {destroy .m1}
+ .m1 entrycget 1 -label
+} -cleanup {
+ destroy .m1
+} -result {test}
+test menu-3.34 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 entryconfigure} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 entryconfigure index ?option value ...?"} {}}
-test menu-3.35 {MenuWidgetCmd procedure, "entryconfigure" option} {
- catch {destroy .m1}
+ .m1 entryconfigure
+} -returnCodes error -result {wrong # args: should be ".m1 entryconfigure index ?-option value ...?"}
+test menu-3.35 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 entryconfigure foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} {
- catch {destroy .m1}
+ .m1 entryconfigure foo
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {llength [.m1 entryconfigure 1]} msg] $msg [destroy .m1]
-} {0 15 {}}
-test menu-3.37 {MenuWidgetCmd procedure, "entryconfigure" option} {
- catch {destroy .m1}
+ llength [.m1 entryconfigure 1]
+} -cleanup {
+ destroy .m1
+} -result {15}
+test menu-3.37 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {lindex [.m1 entryconfigure 1 -label] 4} msg] $msg [destroy .m1]
-} {0 test {}}
-test menu-3.38 {MenuWidgetCmd procedure, "entryconfigure" option} {
- catch {destroy .m1}
+ lindex [.m1 entryconfigure 1 -label] 4
+} -cleanup {
+ destroy .m1
+} -result {test}
+test menu-3.38 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 entryconfigure 1 -label "changed"
- list [catch {lindex [.m1 entryconfigure 1 -label] 4} msg] $msg [destroy .m1]
-} {0 changed {}}
-test menu-3.39 {MenuWidgetCmd procedure, "index" option} {
- catch {destroy .m1}
+ lindex [.m1 entryconfigure 1 -label] 4
+} -cleanup {
+ destroy .m1
+} -result {changed}
+test menu-3.39 {MenuWidgetCmd procedure, "index" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 index} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 index string"} {}}
-test menu-3.40 {MenuWidgetCmd procedure, "index" option} {
- catch {destroy .m1}
+ .m1 index
+} -returnCodes error -result {wrong # args: should be ".m1 index string"}
+test menu-3.40 {MenuWidgetCmd procedure, "index" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 index foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.41 {MenuWidgetCmd procedure, "index" option} {
- catch {destroy .m1}
+ .m1 index foo
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.41 {MenuWidgetCmd procedure, "index" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 index "test"} msg] $msg [destroy .m1]
-} {0 1 {}}
-test menu-3.42 {MenuWidgetCmd procedure, "insert" option} {
- catch {destroy .m1}
+ .m1 index "test"
+} -cleanup {
+ destroy .m1
+} -result {1}
+test menu-3.42 {MenuWidgetCmd procedure, "insert" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 insert} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 insert index type ?options?"} {}}
-test menu-3.43 {MenuWidgetCmd procedure, "insert" option} {
- catch {destroy .m1}
+ .m1 insert
+} -returnCodes error -result {wrong # args: should be ".m1 insert index type ?-option value ...?"}
+test menu-3.43 {MenuWidgetCmd procedure, "insert" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 insert 1 command -label "test"
- list [catch {.m1 entrycget 1 -label} msg] $msg [destroy .m1]
-} {0 test {}}
-test menu-3.44 {MenuWidgetCmd procedure, "invoke" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 invoke} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 invoke index"} {}}
-test menu-3.45 {MenuWidgetCmd procedure, "invoke" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 invoke foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.46 {MenuWidgetCmd procedure, "invoke" option} {
- catch {destroy .m1}
+ .m1 entrycget 1 -label
+} -cleanup {
+ destroy .m1
+} -result {test}
+test menu-3.44 {MenuWidgetCmd procedure, "invoke" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 invoke
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 invoke index"}
+test menu-3.45 {MenuWidgetCmd procedure, "invoke" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 invoke foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.46 {MenuWidgetCmd procedure, "invoke" option} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add command -label "set foo" -command "set foo hello"
- list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 hello 0 hello 0 {} {}}
-test menu-3.47 {MenuWidgetCmd procedure, "post" option} {
- catch {destroy .m1}
+ list [.m1 invoke 1] [set foo] [unset foo]
+} -cleanup {
+ destroy .m1
+} -returnCodes ok -result {hello hello {}}
+test menu-3.47 {MenuWidgetCmd procedure, "post" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "On Windows, hit Escape to get this menu to go away"
- list [catch {.m1 post} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 post x y"} {}}
-test menu-3.48 {MenuWidgetCmd procedure, "post" option} {
- catch {destroy .m1}
+ .m1 post
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 post x y"}
+test menu-3.48 {MenuWidgetCmd procedure, "post" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 post foo 40} msg] $msg [destroy .m1]
-} {1 {expected integer but got "foo"} {}}
-test menu-3.49 {MenuWidgetCmd procedure, "post" option} {
- catch {destroy .m1}
+ .m1 post foo 40
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {expected integer but got "foo"}
+test menu-3.49 {MenuWidgetCmd procedure, "post" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 post 40 bar} msg] $msg [destroy .m1]
-} {1 {expected integer but got "bar"} {}}
-test menu-3.50 {MenuWidgetCmd procedure, "post" option} {nonUnixUserInteraction } {
- catch {destroy .m1}
+ .m1 post 40 bar
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {expected integer but got "bar"}
+test menu-3.50 {MenuWidgetCmd procedure, "post" option} -constraints {
+ nonUnixUserInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "menu-3.53: hit Escape" -command "puts hello"
- list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.51 {MenuWidgetCmd procedure, "postcascade" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 postcascade} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 postcascade index"} {}}
-test menu-3.52 {MenuWidgetCmd procedure, "postcascade" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 postcascade foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.53 {MenuWidgetCmd procedure, "postcascade" option} {nonUnixUserInteraction } {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 post 40 40
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.51 {MenuWidgetCmd procedure, "postcascade" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 postcascade
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 postcascade index"}
+test menu-3.52 {MenuWidgetCmd procedure, "postcascade" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 postcascade foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.53 {MenuWidgetCmd procedure, "postcascade" option} -constraints {
+ nonUnixUserInteraction
+} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 add command -label "menu-3.56 - hit Escape"
menu .m2
.m1 post 40 40
.m1 add cascade -menu .m2
- list [catch {.m1 postcascade 1} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-3.54 {MenuWidgetCmd procedure, "postcascade" option} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 postcascade 1
+} -cleanup {
+ destroy .m1 .m2
+} -result {}
+test menu-3.54 {MenuWidgetCmd procedure, "postcascade" option} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2 -label "menu-3.57 - hit Escape"
.m1 postcascade 1
- list [catch {.m1 postcascade none} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-3.55 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 postcascade none
+} -cleanup {
+ destroy .m1 .m2
+} -result {}
+test menu-3.55 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 type} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 type index"} {}}
-test menu-3.56 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 type index"}
+test menu-3.56 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 type foo} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-3.57 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-3.57 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 type 1} msg] $msg [destroy .m1]
-} {0 command {}}
-test menu-3.58 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type 1
+} -cleanup {
+ destroy .m1
+} -result {command}
+test menu-3.58 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
- list [catch {.m1 type 1} msg] $msg [destroy .m1]
-} {0 separator {}}
-test menu-3.59 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type 1
+} -cleanup {
+ destroy .m1
+} -result {separator}
+test menu-3.59 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label "test"
- list [catch {.m1 type 1} msg] $msg [destroy .m1]
-} {0 checkbutton {}}
-test menu-3.60 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type 1
+} -cleanup {
+ destroy .m1
+} -result {checkbutton}
+test menu-3.60 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label "test"
- list [catch {.m1 type 1} msg] $msg [destroy .m1]
-} {0 radiobutton {}}
-test menu-3.61 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type 1
+} -cleanup {
+ destroy .m1
+} -result {radiobutton}
+test menu-3.61 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label "test"
- list [catch {.m1 type 1} msg] $msg [destroy .m1]
-} {0 cascade {}}
-test menu-3.62 {MenuWidgetCmd procedure, "type" option} {
- catch {destroy .m1}
+ .m1 type 1
+} -cleanup {
+ destroy .m1
+} -result {cascade}
+test menu-3.62 {MenuWidgetCmd procedure, "type" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 type 0} msg] $msg [destroy .m1]
-} {0 tearoff {}}
-test menu-3.63 {MenuWidgetCmd procedure, "unpost" option} {
- catch {destroy .m1}
+ .m1 type 0
+} -cleanup {
+ destroy .m1
+} -result {tearoff}
+test menu-3.63 {MenuWidgetCmd procedure, "unpost" option} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 unpost foo} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 unpost"} {}}
-test menu-3.64 {MenuWidgetCmd procedure, "unpost" option} {nonUnixUserInteraction } {
- catch {destroy .m1}
+ .m1 unpost foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 unpost"}
+test menu-3.64 {MenuWidgetCmd procedure, "unpost" option} -constraints {
+ nonUnixUserInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "menu-3.68 - hit Escape"
.m1 post 40 40
- list [catch {.m1 unpost} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-3.65 {MenuWidgetCmd procedure, "yposition" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 yposition} msg] $msg [destroy .m1]
-} {1 {wrong # args: should be ".m1 yposition index"} {}}
-test menu-3.66 {MenuWidgetCmd procedure, "yposition" option} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 yposition 1}] [destroy .m1]
-} {0 {}}
-test menu-3.67 {MenuWidgetCmd procedure, bad option} {
- catch {destroy .m1}
- 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, xposition, or yposition} {}}
-test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} {
+ .m1 unpost
+} -cleanup {
+ destroy .m1
+} -result {}
+test menu-3.65 {MenuWidgetCmd procedure, "yposition" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 yposition
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {wrong # args: should be ".m1 yposition index"}
+test menu-3.66 {MenuWidgetCmd procedure, "yposition" option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 yposition 1
+} -cleanup {
+ destroy .m1
+} -result {1}
+test menu-3.67 {MenuWidgetCmd procedure, bad option} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ .m1 foo
+} -cleanup {
+ destroy .m1
+} -returnCodes error -result {bad option "foo": must be activate, add, cget, clone, configure, delete, entrycget, entryconfigure, index, insert, invoke, post, postcascade, type, unpost, xposition, or yposition}
+test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} -setup {
+ deleteWindows
+} -body {
set t .t
set m1 .t.m1
set c1 .t.c1
@@ -922,12 +1800,12 @@ test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} {
$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}
+ list [winfo exists $c1] [winfo exists $c2]
+} -cleanup {
+ deleteWindows
+} -result {1 1}
test menu-3.69 {MenuWidgetCmd procedure, "xposition" option} -setup {
- catch {destroy .m1}
+ destroy .m1
menu .m1
} -body {
.m1 xposition
@@ -935,7 +1813,7 @@ test menu-3.69 {MenuWidgetCmd procedure, "xposition" option} -setup {
destroy .m1
} -returnCodes error -result {wrong # args: should be ".m1 xposition index"}
test menu-3.70 {MenuWidgetCmd procedure, "xposition" option} -setup {
- catch {destroy .m1}
+ destroy .m1
menu .m1
} -body {
.m1 xposition 1
@@ -944,126 +1822,162 @@ test menu-3.70 {MenuWidgetCmd procedure, "xposition" option} -setup {
destroy .m1
} -result {}
-test menu-4.1 {TkInvokeMenu: disabled} {
- catch {destroy .m1}
+
+test menu-4.1 {TkInvokeMenu: disabled} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off \
-state disabled
- list [catch {.m1 invoke 1} msg] [destroy .m1] $foo
-} {0 {} off}
-test menu-4.2 {TkInvokeMenu: tearoff} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 invoke 0} msg] [destroy .m1]
-} {0 {}}
-test menu-4.3 {TkInvokeMenu: checkbutton -on} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $foo
+} -cleanup {
+ destroy .m1
+} -result {0 off}
+test menu-4.2 {TkInvokeMenu: tearoff} -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ catch {.m1 invoke 0}
+} -cleanup {
+ deleteWindows
+} -result {0}
+test menu-4.3 {TkInvokeMenu: checkbutton -on} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off
- list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 on 0 {} {}}
-test menu-4.4 {TkInvokeMenu: checkbutton -off} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 \
+ [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 on 0 {}}
+test menu-4.4 {TkInvokeMenu: checkbutton -off} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -label "test" -variable foo -onvalue on -offvalue off
.m1 invoke 1
- list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 off 0 {} {}}
-test menu-4.5 {TkInvokeMenu: checkbutton array element} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 off 0 {}}
+test menu-4.5 {TkInvokeMenu: checkbutton array element} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -label "test" -variable foo(1) -onvalue on
- list [catch {.m1 invoke 1} msg] $msg [catch {set foo(1)} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 on 0 {} {}}
-test menu-4.6 {TkInvokeMenu: radiobutton} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg [catch {set foo(1)} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 on 0 {}}
+test menu-4.6 {TkInvokeMenu: radiobutton} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add radiobutton -label "1" -variable foo -value one
.m1 add radiobutton -label "2" -variable foo -value two
.m1 add radiobutton -label "3" -variable foo -value three
- list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 one 0 {} {}}
-test menu-4.7 {TkInvokeMenu: radiobutton} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 one 0 {}}
+test menu-4.7 {TkInvokeMenu: radiobutton} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add radiobutton -label "1" -variable foo -value one
.m1 add radiobutton -label "2" -variable foo -value two
.m1 add radiobutton -label "3" -variable foo -value three
- list [catch {.m1 invoke 2} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 two 0 {} {}}
-test menu-4.8 {TkInvokeMenu: radiobutton} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 2} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 two 0 {}}
+test menu-4.8 {TkInvokeMenu: radiobutton} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add radiobutton -label "1" -variable foo -value one
.m1 add radiobutton -label "2" -variable foo -value two
.m1 add radiobutton -label "3" -variable foo -value three
- list [catch {.m1 invoke 3} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 three 0 {} {}}
-test menu-4.9 {TkInvokeMenu: radiobutton array element} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 3} msg] $msg [catch {set foo} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 three 0 {}}
+test menu-4.9 {TkInvokeMenu: radiobutton array element} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add radiobutton -label "1" -variable foo(2) -value one
.m1 add radiobutton -label "2" -variable foo(2) -value two
.m1 add radiobutton -label "3" -variable foo(2) -value three
- list [catch {.m1 invoke 3} msg] $msg [catch {set foo(2)} msg2] $msg2 [catch {unset foo} msg3] $msg3 [destroy .m1]
-} {0 {} 0 three 0 {} {}}
-test menu-4.10 {TkInvokeMenu} {
- catch {destroy .m1}
- catch {unset menu_test}
+ list [catch {.m1 invoke 3} msg] $msg [catch {set foo(2)} msg2] $msg2 [catch {unset foo} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 {} 0 three 0 {}}
+test menu-4.10 {TkInvokeMenu} -setup {
+ destroy .m1
+} -body {
+ catch {unset foo}
menu .m1
.m1 add command -label "test" -command "set menu_test menu-4.8"
- list [catch {.m1 invoke 1} msg] $msg [catch {set menu_test} msg2] $msg2 [catch {unset menu_test} msg3] $msg3 [destroy .m1]
-} {0 menu-4.8 0 menu-4.8 0 {} {}}
-test menu-4.11 {TkInvokeMenu} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg [catch {set menu_test} msg2] $msg2 [catch {unset menu_test} msg3] $msg3
+} -cleanup {
+ destroy .m1
+} -result {0 menu-4.8 0 menu-4.8 0 {}}
+test menu-4.11 {TkInvokeMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label "test" -menu .m1.m2
- list [catch {.m1 invoke 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-4.12 {TkInvokeMenu} {
- catch {destroy .m1}
+ list [catch {.m1 invoke 1} msg] $msg
+} -cleanup {
+ destroy .m1
+} -result {0 {}}
+test menu-4.12 {TkInvokeMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test" -command ".m1 delete 1"
- list [catch {.m1 invoke 1} msg] $msg [catch {.m1 type "test"} msg2] $msg2 [destroy .m1]
-} {0 {} 1 {bad menu entry index "test"} {}}
+ list [catch {.m1 invoke 1} msg] $msg [catch {.m1 type "test"} msg2] $msg2
+} -cleanup {
+ destroy .m1
+} -result {0 {} 1 {bad menu entry index "test"}}
-test menu-5.1 {DestroyMenuInstance} {
- catch {destroy .m1}
+test menu-5.1 {DestroyMenuInstance} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-5.2 {DestroyMenuInstance - cascade menu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -returnCodes ok
+test menu-5.2 {DestroyMenuInstance - cascade menu} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 add cascade -menu .m2
menu .m2
- list [catch {destroy .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-5.3 {DestroyMenuInstance - multiple cascade parents} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ destroy .m1 .m2
+} -returnCodes ok
+test menu-5.3 {DestroyMenuInstance - multiple cascade parents} -setup {
+ destroy .m1 .m2 .m3
+} -body {
menu .m1
.m1 add cascade -menu .m3
menu .m2
.m2 add cascade -menu .m3
menu .m3
- list [catch {destroy .m3} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-5.4 {DestroyMenuInstance - multiple cascade parents} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ list [destroy .m3] [destroy .m1 .m2]
+} -returnCodes ok -result {{} {}}
+test menu-5.4 {DestroyMenuInstance - multiple cascade parents} -setup {
+ destroy .m1 .m2 .m3 .m4
+} -body {
menu .m1
.m1 add cascade -menu .m4
menu .m2
@@ -1071,21 +1985,20 @@ test menu-5.4 {DestroyMenuInstance - multiple cascade parents} {
menu .m3
.m3 add cascade -menu .m4
menu .m4
- list [catch {destroy .m4} msg] $msg [destroy .m1 .m2 .m3]
-} {0 {} {}}
-test menu-5.5 {DestroyMenuInstance - cascades of cloned menus} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [destroy .m4] [destroy .m1 .m2 .m3]
+} -returnCodes ok -result {{} {}}
+test menu-5.5 {DestroyMenuInstance - cascades of cloned menus} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2
. configure -menu .m1
- list [catch {destroy .m2} msg] $msg [.m1 entrycget 1 -menu] [. configure -menu ""] [destroy .m1]
-} {0 {} .m2 {} {}}
-test menu-5.6 {DestroyMenuInstance - cascades of cloned menus} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
+ list [destroy .m2] [.m1 entrycget 1 -menu] [. configure -menu ""] [destroy .m1]
+} -returnCodes ok -result {{} .m2 {} {}}
+test menu-5.6 {DestroyMenuInstance - cascades of cloned menus} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
menu .m2
@@ -1093,190 +2006,190 @@ test menu-5.6 {DestroyMenuInstance - cascades of cloned menus} {
toplevel .t2
wm geometry .t2 +0+0
.t2 configure -menu .m1
- list [catch {destroy .m2} msg] $msg [. configure -menu ""] [destroy .t2 .m1]
-} {0 {} {} {}}
-test menu-5.7 {DestroyMenuInstance - basic clones} {
- catch {destroy .m1}
+ list [destroy .m2] [. configure -menu ""] [destroy .t2 .m1]
+} -returnCodes ok -result {{} {} {}}
+test menu-5.7 {DestroyMenuInstance - basic clones} -setup {
+ destroy .m1
+} -body {
menu .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}
+ list [destroy $tearoff] [destroy .m1]
+} -result {{} {}}
+test menu-5.8 {DestroyMenuInstance - multiple clones} -setup {
+ destroy .m1
+} -body {
menu .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}
+ list [destroy $tearoff1] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test menu-5.9 {DestroyMenuInstace - master menu} -setup {
+ destroy .m1
+} -body {
menu .m1
tk::TearOffMenu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-5.10 {DestroyMenuInstance - freeing entries} {
- catch {destroy .m1}
+ destroy .m1
+} -returnCodes ok
+test menu-5.10 {DestroyMenuInstance - freeing entries} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "foo"
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-5.11 {DestroyMenuInstace - no entries} {
- catch {destroy .m1}
+ destroy .m1
+} -returnCodes ok
+test menu-5.11 {DestroyMenuInstace - no entries} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 configure -tearoff 0
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-5.12 {DestroyMenuInstance - platform data} {
- catch {destroy .m1}
+ destroy .m1
+} -returnCodes ok
+test menu-5.12 {DestroyMenuInstance - platform data} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-5.13 {DestroyMenuInstance - clones when mismatched tearoffs} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -returnCodes ok
+test menu-5.13 {DestroyMenuInstance - clones when mismatched tearoffs} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2
set tearoff [tk::TearOffMenu .m1 40 40]
list [destroy .m2] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test menu-6.1 {TkDestroyMenu} {
- catch {destroy .m1}
+test menu-6.1 {TkDestroyMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-6.2 {TkDestroyMenu - reentrancy} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -returnCodes ok
+test menu-6.2 {TkDestroyMenu - reentrancy} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
bind .m1 <Destroy> {destroy .m1}
menu .m2
bind .m2 <Destroy> {destroy .m2}
- list [catch {destroy .m1} msg] $msg [destroy .m2]
-} {0 {} {}}
-test menu-6.3 {TkDestroyMenu - reentrancy} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [destroy .m1] [destroy .m2]
+} -returnCodes ok -result {{} {}}
+test menu-6.3 {TkDestroyMenu - reentrancy} -setup {
+ destroy .m1 .m2 .m3
+} -body {
menu .m1
bind .m1 <Destroy> {destroy .m2}
.m1 clone .m2
.m1 clone .m3
- list [catch {destroy .m1} msg] $msg [winfo exists .m2]
-} {0 {} 0}
-test menu-6.4 {TkDestroyMenu - reentrancy - clones} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [destroy .m1] [winfo exists .m2]
+} -returnCodes ok -result {{} 0}
+test menu-6.4 {TkDestroyMenu - reentrancy - clones} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m1.m3
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-6.5 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -cleanup {
+ deleteWindows
+} -returnCodes ok
+test menu-6.5 {TkDestroyMenu} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 clone .m2
destroy .m1
winfo exists .m2
-} {0}
-test menu-6.6 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+} -result {0}
+test menu-6.6 {TkDestroyMenu} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 clone .m2 tearoff
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-6.7 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -result {}
+test menu-6.7 {TkDestroyMenu} -setup {
+ destroy .m1 .m2
+} -body {
menu .m1
.m1 clone .m2
destroy .m2
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-6.8 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ destroy .m1
+} -returnCodes ok -result {}
+test menu-6.8 {TkDestroyMenu} -setup {
+ destroy .m1 .m2 .m3
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
destroy .m1
list [winfo exists .m2] [winfo exists .m3]
-} {0 0}
-test menu-6.9 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+} -result {0 0}
+test menu-6.9 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
- list [catch {destroy .m2} msg] $msg [catch {destroy .m3} msg2] $msg2 [catch {destroy .m1} msg3] $msg3
-} {0 {} 0 {} 0 {}}
-test menu-6.10 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [destroy .m2] [destroy .m3] [destroy .m1]
+} -returnCodes ok -result {{} {} {}}
+test menu-6.10 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
- list [catch {destroy .m3} msg] $msg [catch {destroy .m1} msg2] $msg2
-} {0 {} 0 {}}
-test menu-6.11 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ list [destroy .m3] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test menu-6.11 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
.m1 clone .m4
- list [catch {destroy .m2} msg1] $msg1 [catch {destroy .m1} msg2] $msg2
-} {0 {} 0 {}}
-test menu-6.12 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ list [destroy .m2] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test menu-6.12 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
.m1 clone .m4
- list [catch {destroy .m3} msg1] $msg1 [catch {destroy .m1} msg2] $msg2
-} {0 {} 0 {}}
-test menu-6.13 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ list [destroy .m3] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test menu-6.13 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 clone .m3
.m1 clone .m4
- list [catch {destroy .m4} msg1] $msg1 [catch {destroy .m1} msg2] $msg2
-} {0 {} 0 {}}
-test menu-6.14 {TkDestroyMenu} {
- catch {destroy .m1}
+ list [destroy .m4] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test menu-6.14 {TkDestroyMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
. configure -menu .m1
- list [catch {destroy .m1} msg] $msg [. configure -menu ""]
-} {0 {} {}}
-test menu-6.15 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .t2}
+ list [destroy .m1] [. configure -menu ""]
+} -returnCodes ok -result {{} {}}
+test menu-6.15 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
toplevel .t2
wm geometry .t2 +0+0
. configure -menu .m1
.t2 configure -menu .m1
- list [catch {destroy .m1} msg] $msg [destroy .t2] [. configure -menu ""]
-} {0 {} {} {}}
-test menu-6.16 {TkDestroyMenu} {
- catch {destroy .m1}
- catch {destroy .t2}
- catch {destroy .t3}
+ list [destroy .m1] [destroy .t2] [. configure -menu ""]
+} -result {{} {} {}}
+test menu-6.16 {TkDestroyMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
toplevel .t2
wm geometry .t2 +0+0
@@ -1285,298 +2198,367 @@ test menu-6.16 {TkDestroyMenu} {
. configure -menu .m1
.t2 configure -menu .m1
.t3 configure -menu .m1
- list [catch {destroy .m1} msg] $msg [destroy .t2] [destroy .t3] [. configure -menu ""]
-} {0 {} {} {} {}}
+ list [destroy .m1] [destroy .t2] [destroy .t3] [. configure -menu ""]
+} -result {{} {} {} {}}
-test menu-7.1 {UnhookCascadeEntry} {
- catch {destroy .m1}
+test menu-7.1 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-7.2 {UnhookCascadeEntry} {
- catch {destroy .m1}
+ destroy .m1
+} -returnCodes ok
+test menu-7.2 {UnhookCascadeEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -menu .m2
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-7.3 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ destroy .m1
+} -returnCodes ok
+test menu-7.3 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m2 add cascade -menu .cascade
.m1 add cascade -menu .cascade
- list [catch {destroy .m1} msg] $msg [destroy .m2]
-} {0 {} {}}
-test menu-7.4 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [destroy .m1] [destroy .m2]
+} -returnCodes ok -result {{} {}}
+test menu-7.4 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .cascade
.m2 add cascade -menu .cascade
- list [catch {destroy .m1} msg] $msg [destroy .m2]
-} {0 {} {}}
-test menu-7.5 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [destroy .m1] [destroy .m2]
+} -returnCodes ok -result {{} {}}
+test menu-7.5 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
menu .m3
.m1 add cascade -menu .cascade
.m2 add cascade -menu .cascade
.m3 add cascade -menu .cascade
- list [catch {destroy .m1} msg] $msg [destroy .m2 .m3]
-} {0 {} {}}
-test menu-7.6 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [destroy .m1] [destroy .m2 .m3]
+} -returnCodes ok -result {{} {}}
+test menu-7.6 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
menu .m3
.m1 add cascade -menu .cascade
.m2 add cascade -menu .cascade
.m3 add cascade -menu .cascade
- list [catch {destroy .m2} msg] $msg [destroy .m1 .m3]
-} {0 {} {}}
-test menu-7.7 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [destroy .m2] [destroy .m1 .m3]
+} -returnCodes ok -result {{} {}}
+test menu-7.7 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
menu .m3
.m1 add cascade -menu .cascade
.m2 add cascade -menu .cascade
.m3 add cascade -menu .cascade
- list [catch {destroy .m3} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-7.8 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [destroy .m3] [destroy .m1 .m2]
+} -returnCodes ok -result {{} {}}
+test menu-7.8 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2
- list [catch {destroy .m1} msg] $msg [destroy .m2]
-} {0 {} {}}
-test menu-7.9 {UnhookCascadeEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [destroy .m1] [destroy .m2]
+} -returnCodes ok -result {{} {}}
+test menu-7.9 {UnhookCascadeEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2
destroy .m1
- list [catch {destroy .m2} msg] $msg
-} {0 {}}
+ destroy .m2
+} -returnCodes ok
-test menu-8.1 {DestroyMenuEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+test menu-8.1 {DestroyMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m1 add cascade -menu .m2
- list [catch {.m1 delete 1} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-8.2 {DestroyMenuEntry} hasEarthPhoto {
+ list [.m1 delete 1] [destroy .m1 .m2]
+} -result {{} {}}
+test menu-8.2 {DestroyMenuEntry} -constraints hasEarthPhoto -setup {
+ deleteWindows
catch {image delete image1a}
- catch {destroy .m1}
+} -body {
image create photo image1a -file $earthPhotoFile
menu .m1
.m1 add command -image image1a
- list [catch {.m1 delete 1} msg] $msg [destroy .m1] [image delete image1a]
-} {0 {} {} {}}
-test menu-8.3 {DestroyMenuEntry} testImageType {
- catch {eval image delete [image names]}
- catch {destroy .m1}
+ list [.m1 delete 1] [destroy .m1] [image delete image1a]
+} -result {{} {} {}}
+test menu-8.3 {DestroyMenuEntry} -constraints testImageType -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
image create test image2
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
.m1 invoke 1
- list [catch {.m1 delete 1} msg] $msg [destroy .m1] [eval image delete [image names]]
-} {0 {} {} {}}
-test menu-8.4 {DestroyMenuEntry} {
- catch {destroy .m1}
+ list [.m1 delete 1] [destroy .m1]
+} -cleanup {
+ imageCleanup
+ deleteWindows
+} -result {{} {}}
+test menu-8.4 {DestroyMenuEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -variable foo
- list [catch {.m1 delete 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-8.5 {DestroyMenuEntry} {
- catch {destroy .m1}
+ list [.m1 delete 1] [destroy .m1]
+} -result {{} {}}
+test menu-8.5 {DestroyMenuEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 delete 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-8.6 {DestroyMenuEntry} {
- catch {destroy .m1}
+ list [.m1 delete 1] [destroy .m1]
+} -result {{} {}}
+test menu-8.6 {DestroyMenuEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
- list [catch {.m1 delete 1} msg] $msg [.m1 entrycget 1 -label] [destroy .m1]
-} {0 {} two {}}
-test menu-8.7 {DestroyMenuEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [.m1 delete 1] [.m1 entrycget 1 -label] [destroy .m1]
+} -result {{} two {}}
+test menu-8.7 {DestroyMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
.m1 clone .m2 tearoff
- list [catch {.m2 delete 0} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [.m2 delete 1] [destroy .m1]
+} -result {{} {}}
+
# test menu-9 - Can only change when fonts change on system, which cannot
# be done from tcl.
-
-test menu-9.1 {ConfigureMenu} {
- catch {destroy .m1}
+test menu-9.1 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 configure -postcommand "beep"} msg] $msg [.m1 cget -postcommand] [destroy .m1]
-} {0 {} beep {}}
-test menu-9.2 {ConfigureMenu} {
- catch {destroy .m1}
+ list [.m1 configure -postcommand "beep"] [.m1 cget -postcommand]
+} -cleanup {
+ deleteWindows
+} -result {{} beep}
+test menu-9.2 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 configure -tearoff 0} msg] $msg [.m1 entrycget 1 -label] [destroy .m1]
-} {0 {} test {}}
-test menu-9.3 {ConfigureMenu} {
- catch {destroy .m1}
+ list [.m1 configure -tearoff 0] [.m1 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-9.3 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {.m1 configure -postcommand "beep"} msg] $msg [.m1 cget -postcommand] [destroy .m1]
-} {0 {} beep {}}
-test menu-9.4 {ConfigureMenu} {
- catch {destroy .m1}
+ list [.m1 configure -postcommand "beep"] [.m1 cget -postcommand]
+} -cleanup {
+ deleteWindows
+} -result {{} beep}
+test menu-9.4 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 configure -fg red} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-9.5 {ConfigureMenu} {
- catch {destroy .m1}
+ .m1 configure -fg red
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-9.5 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "two"
- list [catch {.m1 configure -fg red} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-9.6 {ConfigureMenu} {
- catch {destroy .m1}
+ .m1 configure -fg red
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-9.6 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "two"
.m1 add command -label "three"
- list [catch {.m1 configure -fg red} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-9.7 {ConfigureMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 configure -fg red
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-9.7 {ConfigureMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2 tearoff
- list [catch {.m1 configure -fg red} msg] $msg [.m2 cget -fg] [destroy .m1]
-} {0 {} red {}}
-test menu-9.8 {ConfigureMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [.m1 configure -fg red] [.m2 cget -fg]
+} -cleanup {
+ deleteWindows
+} -result {{} red}
+test menu-9.8 {ConfigureMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2 tearoff
- list [catch {.m2 configure -fg red} msg] $msg [.m1 cget -fg] [destroy .m1]
-} {0 {} red {}}
-test menu-9.9 {ConfigureMenu} {
- catch {destroy .m1}
+ list [.m2 configure -fg red] [.m1 cget -fg]
+} -cleanup {
+ deleteWindows
+} -result {{} red}
+test menu-9.9 {ConfigureMenu} -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+
-test menu-10.1 {PostProcessEntry: array variable} {
- catch {destroy .m1}
+test menu-10.1 {PostProcessEntry: array variable} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
set foo(1) on
.m1 add checkbutton -variable foo(1) -onvalue on -offvalue off -label "Nonsense"
- list [catch {set foo(1)} msg] $msg [destroy .m1]
-} {0 on {}}
-test menu-10.2 {PostProcessEntry: array variable} {
- catch {destroy .m1}
+ set foo(1)
+} -cleanup {
+ deleteWindows
+} -result {on}
+test menu-10.2 {PostProcessEntry: array variable} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -variable foo(1) -onvalue on -offvalue off -label "Nonsense"
- list [catch {set foo(1)} msg] $msg [destroy .m1]
-} {0 off {}}
+ set foo(1)
+} -cleanup {
+ deleteWindows
+} -result {off}
-test menu-11.1 {ConfigureMenuEntry} {
- catch {destroy .m1}
+
+test menu-11.1 {ConfigureMenuEntry} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -variable foo -onvalue on -offvalue off -label "Nonsense"
- list [catch {.m1 entryconfigure 1 -variable bar} msg] $msg [.m1 entrycget 1 -variable] [destroy .m1]
-} {0 {} bar {}}
-test menu-11.2 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -variable bar] [.m1 entrycget 1 -variable]
+} -cleanup {
+ deleteWindows
+} -result {{} bar}
+test menu-11.2 {ConfigureMenuEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 entryconfigure 1 -label ""} msg] $msg [.m1 entrycget 1 -label] [destroy .m1]
-} {0 {} {} {}}
-test menu-11.3 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -label ""] [.m1 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-11.3 {ConfigureMenuEntry} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command
- list [catch {.m1 entryconfigure 1 -label "test"} cmd] $cmd [.m1 entrycget 1 -label] [destroy .m1]
-} {0 {} test {}}
-test menu-11.4 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -label "test"] [.m1 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-11.4 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command
- list [catch {.m1 entryconfigure 1 -accel "S"} msg] $msg [.m1 entrycget 1 -accel] [destroy .m1]
-} {0 {} S {}}
-test menu-11.5 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -accel "S"] [.m1 entrycget 1 -accel]
+} -cleanup {
+ deleteWindows
+} -result {{} S}
+test menu-11.5 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command
- list [catch {.m1 entryconfigure 1 -label "test"} msg] $msg [.m1 entrycget 1 -label] [destroy .m1]
-} {0 {} test {}}
-test menu-11.6 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -label "test"] [.m1 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-11.6 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command
- list [catch {.m1 entryconfigure 1 -label "test"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.7 {ConfigureMenuEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 entryconfigure 1 -label "test"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.7 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m2
menu .m1
.m1 add cascade
- list [catch {.m1 entryconfigure 1 -label "test" -menu .m2} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-11.8 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -label "test" -menu .m2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.8 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade
- list [catch {.m1 entryconfigure 1 -label "test" -menu .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.9 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -label "test" -menu .m2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.9 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m3
- list [catch {.m1 entryconfigure 1 -label "test" -menu .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.10 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -label "test" -menu .m2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.10 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade
- list [catch {.m1 entryconfigure 1 -label "test" -menu .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.11 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -label "test" -menu .m2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.11 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
- list [catch {.m1 entryconfigure 1 -label "test" -menu .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.12 {ConfigureMenuEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
- catch {destroy .m5}
+ .m1 entryconfigure 1 -label "test" -menu .m2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.12 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m2 add cascade -menu .m1
@@ -1586,13 +2568,13 @@ test menu-11.12 {ConfigureMenuEntry} {
.m4 add cascade -menu .m1
menu .m5
.m5 add cascade
- list [catch {.m5 entryconfigure 1 -label "test" -menu .m1} msg] $msg [destroy .m1 .m2 .m3 .m4 .m5]
-} {0 {} {}}
-test menu-11.13 {ConfigureMenuEntry} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ .m5 entryconfigure 1 -label "test" -menu .m1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.13 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
.m2 add cascade -menu .m1
@@ -1600,360 +2582,489 @@ test menu-11.13 {ConfigureMenuEntry} {
.m3 add cascade -menu .m1
menu .m4
.m4 add cascade -menu .m1
- list [catch {.m3 entryconfigure 1 -label "test" -menu .m1} msg] $msg [destroy .m1 .m2 .m3 .m4]
-} {0 {} {}}
-test menu-11.14 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m3 entryconfigure 1 -label "test" -menu .m1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.14 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add checkbutton
- list [catch {.m1 entryconfigure 1 -variable "test"} msg] $msg [.m1 entrycget 1 -variable] [destroy .m1]
-} {0 {} test {}}
-test menu-11.15 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 entryconfigure 1 -variable "test"] [.m1 entrycget 1 -variable]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-11.15 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 add checkbutton -label "test"} msg] $msg [.m1 entrycget 1 -variable] [destroy .m1]
-} {0 {} test {}}
-test menu-11.16 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ list [.m1 add checkbutton -label "test"] [.m1 entrycget 1 -variable]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-11.16 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 add radiobutton -label "test"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-11.17 {ConfigureMenuEntry} {
- catch {destroy .m1}
+ .m1 add radiobutton -label "test"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-11.17 {ConfigureMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.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} testImageType {
- catch {destroy .m1}
- catch {image delete image1}
+ list [.m1 entryconfigure 1 -onvalue "test"] [.m1 entrycget 1 -onvalue]
+} -cleanup {
+ deleteWindows
+} -result {{} test}
+test menu-11.18 {ConfigureMenuEntry} -constraints testImageType -setup {
+ deleteWindows
+ imageCleanup
+} -body {
menu .m1
.m1 add command
image create test image1
- list [catch {.m1 entryconfigure 1 -image image1} msg] $msg [destroy .m1] [image delete image1]
-} {0 {} {} {}}
-test menu-11.19 {ConfigureMenuEntry} {testImageType hasEarthPhoto} {
- catch {destroy .m1}
- catch {image delete image1}
- catch {image delete image2}
+ .m1 entryconfigure 1 -image image1
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {}
+test menu-11.19 {ConfigureMenuEntry} -constraints {
+ testImageType hasEarthPhoto
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
image create photo image2 -file $earthPhotoFile
menu .m1
.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} {testImageType hasEarthPhoto} {
- catch {destroy .m1}
- catch {image delete image1}
- catch {image delete image2}
+ .m1 entryconfigure 1 -image image2
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {}
+test menu-11.20 {ConfigureMenuEntry} -constraints {
+ testImageType hasEarthPhoto
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create photo image1 -file $earthPhotoFile
image create test image2
menu .m1
.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} {testImageType hasEarthPhoto} {
- catch {destroy .m1}
- catch {image delete image1}
- catch {image delete image2}
- catch {image delete image3}
+ .m1 entryconfigure 1 -selectimage image2
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {}
+test menu-11.21 {ConfigureMenuEntry} -constraints {
+ testImageType hasEarthPhoto
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create photo image1 -file $earthPhotoFile
image create test image2
image create test image3
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
- list [catch {.m1 entryconfigure 1 -selectimage image3} msg] $msg [destroy .m1] [image delete image1] [image delete image2] [image delete image3]
-} {0 {} {} {} {} {}}
+ .m1 entryconfigure 1 -selectimage image3
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {}
-test menu-12.1 {ConfigureMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+
+test menu-12.1 {ConfigureMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m2 configure -tearoff 0
.m1 clone .m3
.m1 add command -label "test"
.m1 add command -label "test2"
- list [list [catch {.m1 entryconfigure 1 -gork "foo"} msg] $msg] [destroy .m1]
-} {{1 {unknown option "-gork"}} {}}
-test menu-12.2 {ConfigureMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
- catch {destroy .m4}
+ .m1 entryconfigure 1 -gork "foo"
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-gork"}
+test menu-12.2 {ConfigureMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
menu .m3
.m1 add cascade -menu .m3
menu .m4
- list [catch {.m1 entryconfigure 1 -menu .m4} msg] $msg [destroy .m1] [destroy .m3] [destroy .m4]
-} {0 {} {} {} {}}
-test menu-12.3 {ConfigureMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 entryconfigure 1 -menu .m4
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-12.3 {ConfigureMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m1 add cascade -label dummy
- list [catch {.m1 entryconfigure dummy -menu .m3} msg] $msg [destroy .m1]
-} {0 {} {}}
-
-test menu-12.4 {ConfigureMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 entryconfigure dummy -menu .m3
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-12.4 {ConfigureMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label File -menu .m1.foo
menu .m1.foo
.m1.foo add command -label bar
.m1 clone .m2
- list [catch {.m1 entryconfigure File -state disabled} msg1] $msg1 [destroy .m1]
-} {0 {} {}}
+ .m1 entryconfigure File -state disabled
+} -cleanup {
+ deleteWindows
+} -result {}
-test menu-13.1 {TkGetMenuIndex} {
- catch {destroy .m1}
+
+test menu-13.1 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "active"
.m1 add command -label "test2"
.m1 add command -label "test3"
.m1 activate 2
- list [catch {.m1 entrycget active -label} msg] $msg [destroy .m1]
-} {0 test2 {}}
-test menu-13.2 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget active -label
+} -cleanup {
+ deleteWindows
+} -result {test2}
+test menu-13.2 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "last"
.m1 add command -label "test2"
.m1 add command -label "test3"
.m1 activate 2
- list [catch {.m1 entrycget last -label} msg] $msg [destroy .m1]
-} {0 test3 {}}
-test menu-13.3 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget last -label
+} -cleanup {
+ deleteWindows
+} -result {test3}
+test menu-13.3 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "last"
.m1 add command -label "test2"
.m1 add command -label "test3"
.m1 activate 2
- list [catch {.m1 entrycget end -label} msg] $msg [destroy .m1]
-} {0 test3 {}}
-test menu-13.4 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget end -label
+} -cleanup {
+ deleteWindows
+} -result {test3}
+test menu-13.4 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 insert last command -label "test2"} msg] $msg [.m1 entrycget last -label] [destroy .m1]
-} {0 {} test2 {}}
-test menu-13.5 {TkGetMenuIndex} {
- catch {destroy .m1}
+ list [.m1 insert last command -label "test2"] [.m1 entrycget last -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test2}
+test menu-13.5 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 insert end command -label "test2"} msg] $msg [.m1 entrycget end -label] [destroy .m1]
-} {0 {} test2 {}}
-test menu-13.6 {TkGetMenuIndex} {
- catch {destroy .m1}
+ list [.m1 insert end command -label "test2"] [.m1 entrycget end -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test2}
+test menu-13.6 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "active"
.m1 add command -label "test2"
.m1 add command -label "test3"
.m1 activate 2
- list [catch {.m1 entrycget none -label} msg] $msg [destroy .m1]
-} {0 {} {}}
+ .m1 entrycget none -label
+} -cleanup {
+ deleteWindows
+} -result {}
#test menu-13.7 - Need to add @test here.
-test menu-13.7 {TkGetMenuIndex} {
- catch {destroy .m1}
+test menu-13.7 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "active"
.m1 add command -label "test2"
.m1 add command -label "test3"
- list [catch {.m1 entrycget 1 -label} msg] $msg [destroy .m1]
-} {0 active {}}
-test menu-13.8 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget 1 -label
+} -cleanup {
+ deleteWindows
+} -result {active}
+test menu-13.8 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "active"
- list [catch {.m1 entrycget -1 -label} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "-1"} {}}
-test menu-13.9 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget -1 -label
+} -returnCodes error -result {bad menu entry index "-1"}
+test menu-13.9 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test2"
- list [catch {.m1 entrycget 999 -label} msg] $msg [destroy .m1]
-} {0 test2 {}}
-test menu-13.10 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget 999 -label
+} -cleanup {
+ deleteWindows
+} -result {test2}
+test menu-13.10 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 insert 999 command -label "test"
- list [catch {.m1 entrycget 1 -label} msg] $msg [destroy .m1]
-} {0 test {}}
-test menu-13.11 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget 1 -label
+} -cleanup {
+ deleteWindows
+} -result {test}
+test menu-13.11 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "1test"
- list [catch {.m1 entrycget 1test -label} msg] $msg [destroy .m1]
-} {0 1test {}}
-test menu-13.12 {TkGetMenuIndex} {
- catch {destroy .m1}
+ .m1 entrycget 1test -label
+} -cleanup {
+ deleteWindows
+} -result {1test}
+test menu-13.12 {TkGetMenuIndex} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test2" -command "beep"
.m1 add command -label "test3"
- list [catch {.m1 entrycget test2 -command} msg] $msg [destroy .m1]
-} {0 beep {}}
+ .m1 entrycget test2 -command
+} -cleanup {
+ deleteWindows
+} -result {beep}
-test menu-14.1 {MenuCmdDeletedProc} {
- catch {destroy .m1}
+test menu-14.1 {MenuCmdDeletedProc} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-14.2 {MenuCmdDeletedProc} {
- catch {destroy .m1}
+ destroy .m1
+} -cleanup {
+ deleteWindows
+} -returnCodes ok
+test menu-14.2 {MenuCmdDeletedProc} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
+ destroy .m1
+} -cleanup {
+ deleteWindows
+} -returnCodes ok
-test menu-15.1 {MenuNewEntry} {
- catch {destroy .m1}
+test menu-15.1 {MenuNewEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 add command -label "test"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-15.2 {MenuNewEntry} {
- catch {destroy .m1}
+ .m1 add command -label "test"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-15.2 {MenuNewEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test3"
- list [catch {.m1 insert 2 command -label "test2"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-15.3 {MenuNewEntry} {
- catch {destroy .m1}
+ .m1 insert 2 command -label "test2"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-15.3 {MenuNewEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 add command -label "test2"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-15.4 {MenuNewEntry} {
- catch {destroy .m1}
+ .m1 add command -label "test2"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-15.4 {MenuNewEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 add command -label "test"} msg] $msg [destroy .m1]
-} {0 {} {}}
+ .m1 add command -label "test"
+} -cleanup {
+ deleteWindows
+} -result {}
-test menu-16.1 {MenuAddOrInsert} {
- catch {destroy .m1}
+test menu-16.1 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 insert foo command -label "test"} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "foo"} {}}
-test menu-16.2 {MenuAddOrInsert} {
- catch {destroy .m1}
+ .m1 insert foo command -label "test"
+} -returnCodes error -result {bad menu entry index "foo"}
+test menu-16.2 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 insert test command -label "foo"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.3 {MenuAddOrInsert} {
- catch {destroy .m1}
+ .m1 insert test command -label "foo"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.3 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 insert -1 command -label "test"} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "-1"} {}}
-test menu-16.4 {MenuAddOrInsert} {
- catch {destroy .m1}
+ .m1 insert -1 command -label "test"
+} -returnCodes error -result {bad menu entry index "-1"}
+test menu-16.4 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 insert 0 command -label "test2"
- list [catch {.m1 entrycget 1 -label} msg] $msg [destroy .m1]
-} {0 test2 {}}
-test menu-16.5 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add cascade} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.6 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add checkbutton} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.7 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add command} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.8 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add radiobutton} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.9 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add separator} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.10 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add blork} msg] $msg [destroy .m1]
-} {1 {bad menu entry type "blork": must be cascade, checkbutton, command, radiobutton, or separator} {}}
-test menu-16.11 {MenuAddOrInsert} {
- catch {destroy .m1}
- menu .m1
- list [catch {.m1 add command} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-16.12 {MenuAddOrInsert} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ .m1 entrycget 1 -label
+} -cleanup {
+ deleteWindows
+} -result {test2}
+test menu-16.5 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add cascade
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.6 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add checkbutton
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.7 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.8 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add radiobutton
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.9 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add separator
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.10 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add blork
+} -returnCodes error -result {bad menu entry type "blork": must be cascade, checkbutton, command, radiobutton, or separator}
+test menu-16.11 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-16.12 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m2 clone .m3
- list [catch {.m2 add command -label "test"} msg1] $msg1 [catch {.m1 entrycget 1 -label} msg2] $msg2 [catch {.m3 entrycget 1 -label} msg3] $msg3 [destroy .m1]
-} {0 {} 0 test 0 test {}}
-test menu-16.13 {MenuAddOrInsert} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [.m2 add command -label "test"] [.m1 entrycget 1 -label] [.m3 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test test}
+test menu-16.13 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
.m2 clone .m3
- list [catch {.m3 add command -label "test"} msg1] $msg1 [catch {.m1 entrycget 1 -label} msg2] $msg2 [catch {.m2 entrycget 1 -label} msg3] $msg3 [destroy .m1]
-} {0 {} 0 test 0 test {}}
-test menu-16.14 {MenuAddOrInsert} {
- catch {destroy .m1}
+ list [.m3 add command -label "test"] [.m1 entrycget 1 -label] [.m2 entrycget 1 -label]
+} -cleanup {
+ deleteWindows
+} -result {{} test test}
+test menu-16.14 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 add command -blork} msg] $msg [destroy .m1]
-} {1 {unknown option "-blork"} {}}
-test menu-16.15 {MenuAddOrInsert} {
- catch {destroy .m1}
- catch {destroy .container}
+ .m1 add command -blork
+} -returnCodes error -result {unknown option "-blork"}
+test menu-16.15 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "File"
menu .container
. configure -menu .container
- list [catch {.container add cascade -label "File" -menu .m1} msg] $msg [. configure -menu ""] [destroy .container .m1]
-} {0 {} {} {}}
-test menu-16.16 {MenuAddOrInsert} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-16.16 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .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} {
- catch {destroy .m1}
- catch {destroy .container}
+ list [.m2 add cascade -menu .m1] [$tearoff unpost]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-16.17 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .container
. configure -menu .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} {
- catch {destroy .m1}
- catch {destroy .container}
+ list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-16.18 {MenuAddOrInsert} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .container
.container add cascade -menu .m1
. configure -menu .container
- list [catch {.container add cascade -label "File" -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1 .container]
-} {0 {} {} {}}
-test menu-16.19 {MenuAddOrInsert - Insert a cascade deep into the tree} {
- catch {destroy .menubar}
+ list [.container add cascade -label "File" -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-16.19 {MenuAddOrInsert - Insert a cascade deep into the tree} -setup {
+ deleteWindows
+} -body {
menu .menubar
menu .menubar.test -tearoff 0
.menubar add cascade -label Test -underline 0 -menu .menubar.test
@@ -1961,198 +3072,270 @@ test menu-16.19 {MenuAddOrInsert - Insert a cascade deep into the tree} {
.menubar.test.cascade add command -label SubItem -command "puts SubItemSelected"
. configure -menu .menubar
list [catch {.menubar.test add cascade -label SubMenu \
- -menu .menubar.test.cascade} msg] \
- [info commands .\#menubar.\#menubar\#test.\#menubar\#test\#cascade] \
- [. configure -menu ""] [destroy .menubar]
-} {0 .#menubar.#menubar#test.#menubar#test#cascade {} {}}
+ -menu .menubar.test.cascade}] \
+ [info commands .\#menubar.\#menubar\#test.\#menubar\#test\#cascade] \
+ [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {0 .#menubar.#menubar#test.#menubar#test#cascade {}}
-test menu-17.1 {MenuVarProc} {
- catch {destroy .m1}
+
+test menu-17.1 {MenuVarProc} -setup {
+ deleteWindows
+} -body {
catch {unset foo}
menu .m1
set foo "hello"
- list [catch {.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye} msg] $msg [catch {unset foo} msg2] $msg2 [destroy .m1]
-} {0 {} 0 {} {}}
+ list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
+ [unset foo]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
# menu-17.2 - Don't know how to generate the flags in the if
-test menu-17.2 {MenuVarProc} {
- catch {destroy .m1}
+test menu-17.2 {MenuVarProc} -setup {
+ deleteWindows
+} -body {
catch {unset foo}
menu .m1
- list [catch {.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye} msg] $msg [set foo ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-17.3 {MenuVarProc} {
- catch {destroy .m1}
+ list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
+ [set foo ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-17.3 {MenuVarProc} -setup {
+ deleteWindows
+} -body {
catch {unset foo}
menu .m1
set foo "hello"
- list [catch {.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye} msg] $msg [set foo "hello"] [destroy .m1] [catch {unset foo} msg2] $msg2
-} {0 {} hello {} 0 {}}
-test menu-17.4 {MenuVarProc} {
- catch {destroy .m1}
+ list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
+ [set foo "hello"] [unset foo]
+} -cleanup {
+ deleteWindows
+} -result {{} hello {}}
+test menu-17.4 {MenuVarProc} -setup {
+ deleteWindows
+} -body {
menu .m1
set foo "goodbye"
- list [catch {.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye} msg] $msg [set foo "hello"] [destroy .m1] [catch {unset foo} msg2] $msg2
-} {0 {} hello {} 0 {}}
-test menu-17.5 {MenuVarProc} {
- catch {destroy .m1}
+ list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
+ [set foo "hello"] [unset foo]
+} -cleanup {
+ deleteWindows
+} -result {{} hello {}}
+test menu-17.5 {MenuVarProc} -setup {
+ deleteWindows
+} -body {
menu .m1
set foo "hello"
- list [catch {.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye} msg] $msg [set foo "goodbye"] [destroy .m1] [catch {unset foo} msg2] $msg2
-} {0 {} goodbye {} 0 {}}
+ list [.m1 add checkbutton -variable foo -onvalue hello -offvalue goodbye] \
+ [set foo "goodbye"] [unset foo]
+} -cleanup {
+ deleteWindows
+} -result {{} goodbye {}}
+
-test menu-18.1 {TkActivateMenuEntry} {
- catch {destroy .m1}
+test menu-18.1 {TkActivateMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 activate 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-18.2 {TkActivateMenuEntry} {
- catch {destroy .m1}
+ .m1 activate 1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-18.2 {TkActivateMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
- list [catch {.m1 activate 0} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-18.3 {TkActivateMenuEntry} {
- catch {destroy .m1}
+ .m1 activate 0
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-18.3 {TkActivateMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test2"
.m1 activate 1
- list [catch {.m1 activate 2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-18.4 {TkActivateMenuEntry} {
- catch {destroy .m1}
+ .m1 activate 2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-18.4 {TkActivateMenuEntry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test2"
.m1 activate 1
- list [catch {.m1 activate 1} msg] $msg [destroy .m1]
-} {0 {} {}}
+ .m1 activate 1
+} -cleanup {
+ deleteWindows
+} -result {}
-test menu-19.1 {TkPostCommand} {nonUnixUserInteraction } {
- catch {destroy .m1}
+
+test menu-19.1 {TkPostCommand} -constraints nonUnixUserInteraction -setup {
+ deleteWindows
+} -body {
menu .m1 -postcommand "set menu_test menu-19.1"
.m1 add command -label "menu-19.1 - hit Escape"
- list [catch {.m1 post 40 40} msg] $msg [.m1 unpost] [set menu_test] [destroy .m1]
-} {0 menu-19.1 {} menu-19.1 {}}
-test menu-19.2 {TkPostCommand} {nonUnixUserInteraction } {
- catch {destroy .m1}
+ list [.m1 post 40 40] [.m1 unpost] [set menu_test]
+} -cleanup {
+ deleteWindows
+} -result {menu-19.1 {} menu-19.1}
+test menu-19.2 {TkPostCommand} -constraints nonUnixUserInteraction -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "menu-19.2 - hit Escape"
- list [catch {.m1 post 40 40} msg] $msg [.m1 unpost] [destroy .m1]
-} {0 {} {} {}}
-
-test menu-20.1 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2} msg1] $msg1 [destroy .m1]
-} {0 {} {}}
-test menu-20.2 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2 normal} msg1] $msg1 [destroy .m1]
-} {0 {} {}}
-test menu-20.3 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2 tearoff} msg1] $msg1 [destroy .m1]
-} {0 {} {}}
-test menu-20.4 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2 menubar} msg1] $msg1 [destroy .m1]
-} {0 {} {}}
-test menu-20.5 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2 foo} msg1] $msg1 [destroy .m1]
-} {1 {bad menu type "foo": must be normal, tearoff, or menubar} {}}
-test menu-20.6 {CloneMenu - hooking up bookeeping ptrs} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-20.7 {CloneMenu - hooking up bookeeping ptrs - multiple children} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [.m1 post 40 40] [.m1 unpost]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+
+test menu-20.1 {CloneMenu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2]
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.2 {CloneMenu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2 normal
+ deleteWindows
+} -result {}
+test menu-20.3 {CloneMenu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2 tearoff
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.4 {CloneMenu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2 menubar
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.5 {CloneMenu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2 foo
+} -returnCodes error -result {bad menu type "foo": must be normal, tearoff, or menubar}
+test menu-20.6 {CloneMenu - hooking up bookeeping ptrs} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 clone .m2
- list [catch {.m1 clone .m3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-20.8 {CloneMenu - cascade entries} {
- catch {destroy .m1}
- catch {destroy .foo}
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.7 {CloneMenu - hooking up bookeeping ptrs - multiple children} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 clone .m2
+ .m1 clone .m3
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.8 {CloneMenu - cascade entries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
- list [catch {.m1 clone .foo} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-20.9 {CloneMenu - cascades entries} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .foo}
+ .m1 clone .foo
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.9 {CloneMenu - cascades entries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
menu .m2
- list [catch {.m1 clone .foo} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
-test menu-20.10 {CloneMenu - tearoff fields} {
- catch {destroy .m1}
- catch {destroy .m2}
- menu .m1
- list [catch {.m1 clone .m2 normal} msg1] $msg1 [catch {.m2 cget -tearoff} msg2] $msg2 [destroy .m1]
-} {0 {} 0 1 {}}
-test menu-20.11 {CloneMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 clone .foo
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-20.10 {CloneMenu - tearoff fields} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ list [.m1 clone .m2 normal] [.m2 cget -tearoff]
+} -cleanup {
+ deleteWindows
+} -result {{} 1}
+test menu-20.11 {CloneMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m2
- list [catch {.m1 clone .m2} msg] $msg [destroy .m1 .m2]
-} {1 {window name "m2" already exists in parent} {}}
+ .m1 clone .m2
+} -returnCodes error -result {window name "m2" already exists in parent}
-test menu-21.1 {MenuDoYPosition} {
- catch {destroy .m1}
+test menu-21.1 {MenuDoYPosition} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {.m1 yposition glorp} msg] $msg [destroy .m1]
-} {1 {bad menu entry index "glorp"} {}}
-test menu-21.2 {MenuDoYPosition} {
- catch {destroy .m1}
+ .m1 yposition glorp
+} -returnCodes error -result {bad menu entry index "glorp"}
+test menu-21.2 {MenuDoYPosition} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "Test"
- list [catch {.m1 yposition 1}] [destroy .m1]
-} {0 {}}
+ .m1 yposition 1
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -match glob -result {*}
-test menu-22.1 {GetIndexFromCoords} {
- catch {destroy .m1}
+test menu-22.1 {GetIndexFromCoords} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 configure -tearoff 0
- list [catch {.m1 index @5} msg] $msg [destroy .m1]
-} {0 0 {}}
-test menu-22.2 {GetIndexFromCoords} {
- catch {destroy .m1}
+ .m1 index @5
+} -cleanup {
+ deleteWindows
+} -result {0}
+test menu-22.2 {GetIndexFromCoords} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "test"
.m1 configure -tearoff 0
- list [catch {.m1 index @5,5} msg] $msg [destroy .m1]
-} {0 0 {}}
-test menu-22.3 {GetIndexFromCoords: mapped window, y only} unix {
- catch {destroy .m1}
+ .m1 index @5,5
+} -cleanup {
+ deleteWindows
+} -result {0}
+test menu-22.3 {GetIndexFromCoords: mapped window, y only} -setup {
+ deleteWindows
+} -constraints {unix} -body {
menu .m1
.m1 add command -label "test"
.m1 configure -tearoff 0
tk_popup .m1 0 0
tkwait visibility .m1
- list [catch {.m1 index @5} msg] $msg [destroy .m1]
-} {0 0 {}}
-test menu-22.4 {GetIndexFromCoords: mapped window x,y} unix {
- catch {destroy .m1}
+ .m1 index @5
+} -cleanup {
+ deleteWindows
+} -result {0}
+test menu-22.4 {GetIndexFromCoords: mapped window x,y} -setup {
+ deleteWindows
+} -constraints {unix} -body {
menu .m1
.m1 add command -label "test"
.m1 configure -tearoff 0
@@ -2160,10 +3343,13 @@ test menu-22.4 {GetIndexFromCoords: mapped window x,y} unix {
tkwait visibility .m1
update
set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}]
- list [catch {.m1 index @$x,5} msg] $msg [destroy .m1]
-} {0 0 {}}
-test menu-22.5 {GetIndexFromCoords: mapped wide window} unix {
- catch {destroy .m1}
+ .m1 index @$x,5
+} -cleanup {
+ deleteWindows
+} -result {0}
+test menu-22.5 {GetIndexFromCoords: mapped wide window} -setup {
+ deleteWindows
+} -constraints {unix} -body {
menu .m1
.m1 add command -label "test"
.m1 configure -tearoff 0
@@ -2172,105 +3358,137 @@ test menu-22.5 {GetIndexFromCoords: mapped wide window} unix {
wm geometry .m1 200x100
update
set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}]
- list [catch {.m1 index @$x,5} msg] $msg [destroy .m1]
-} {0 0 {}}
+ .m1 index @$x,5
+} -cleanup {
+ deleteWindows
+} -result {0}
-test menu-23.1 {RecursivelyDeleteMenu} {
- catch {destroy .m1}
+test menu-23.1 {RecursivelyDeleteMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
. configure -menu .m1
- list [catch {. configure -menu ""} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-23.2 {RecursivelyDeleteMenu} {
- catch {destroy .m1}
- catch {destroy .m2}
+ . configure -menu ""
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-23.2 {RecursivelyDeleteMenu} -setup {
+ deleteWindows
+} -body {
menu .m2
.m2 add command -label "test2"
menu .m1
.m1 add cascade -label "test1" -menu .m2
. configure -menu .m1
- list [catch {. configure -menu ""} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
+ . configure -menu ""
+} -cleanup {
+ deleteWindows
+} -result {}
-test menu-24.1 {TkNewMenuName} {
- catch {destroy .m1}
+test menu-24.1 {TkNewMenuName} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-24.2 {TkNewMenuName} {
- catch {destroy .m1}
- catch {destroy .m1\#0}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-24.2 {TkNewMenuName} -setup {
+ deleteWindows
+} -body {
menu .m1
menu .m1\#0
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-24.3 {TkNewMenuName} {
- catch {destroy .#m}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-24.3 {TkNewMenuName} -setup {
+ deleteWindows
+} -body {
menu .#m
rename .#m hideme
- list [catch {. configure -menu [menu .m]} $msg] [. configure -menu ""] [destroy .#m] [destroy .m] [destroy hideme]
-} {0 {} {} {} {}}
+ list [catch {. configure -menu [menu .m]}] [. configure -menu ""] [destroy .#m] \
+ [destroy .m] [destroy hideme]
+} -result {0 {} {} {} {}}
-test menu-25.1 {TkSetWindowMenuBar} {
+
+test menu-25.1 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""]
-} {0 {} {}}
-test menu-25.2 {TkSetWindowMenuBar} {
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.2 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""]
-} {0 {} {}}
-test menu-25.3 {TkSetWindowMenuBar} {
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.3 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
- catch {destroy .m1}
+ destroy .m1
menu .m1
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-25.4 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.4 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
. configure -menu .m1
menu .m2
- list [catch {. configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .m1 .m2]
-} {0 {} {} {}}
-test menu-25.5 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [. configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.5 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
. configure -menu .m1
.m1 clone .m2
menu .m3
- list [catch {. configure -menu .m3} msg] $msg [. configure -menu ""] [destroy .m1 .m3]
-} {0 {} {} {}}
-test menu-25.6 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ list [. configure -menu .m3] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.6 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
.m1 clone .m2
. configure -menu .m2
menu .m3
- list [catch {. configure -menu .m3} msg] $msg [. configure -menu ""] [destroy .m1 .m3]
-} {0 {} {} {}}
-test menu-25.7 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [. configure -menu .m3] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.7 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
. configure -menu .m1
toplevel .t2
.t2 configure -menu .m1
- list [catch {.t2 configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .t2 .m1 .m2]
-} {0 {} {} {}}
-test menu-25.8 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
+ list [.t2 configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.8 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
@@ -2278,13 +3496,13 @@ test menu-25.8 {TkSetWindowMenuBar} {
toplevel .t2
wm geometry .t2 +0+0
.t2 configure -menu .m1
- list [catch {. configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .t2 .m1 .m2]
-} {0 {} {} {}}
-test menu-25.9 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
- catch {destroy .t3}
+ list [. configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.9 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
@@ -2293,13 +3511,13 @@ test menu-25.9 {TkSetWindowMenuBar} {
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {.t3 configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .t2 .t3 .m1 .m2]
-} {0 {} {} {}}
-test menu-25.10 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
- catch {destroy .t3}
+ list [.t3 configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.10 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
@@ -2308,13 +3526,13 @@ test menu-25.10 {TkSetWindowMenuBar} {
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {.t2 configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .t2 .t3 .m1 .m2]
-} {0 {} {} {}}
-test menu-25.11 {TkSetWindowMenuBar} {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .t2}
- catch {destroy .t3}
+ list [.t2 configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.11 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
@@ -2323,128 +3541,188 @@ test menu-25.11 {TkSetWindowMenuBar} {
wm geometry .t2 +0+0
toplevel .t3 -menu .m1
wm geometry .t3 +0+0
- list [catch {. configure -menu .m2} msg] $msg [. configure -menu ""] [destroy .t2 .t3 .m1 .m2]
-} {0 {} {} {}}
-test menu-25.12 {TkSetWindowMenuBar} {
- catch {destroy .m1}
+ list [. configure -menu .m2] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.12 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-25.13 {TkSetWindowMenuBar} {
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.13 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""]
-} {0 {} {}}
-test menu-25.14 {TkSetWindowMenuBar} {
- catch {destroy .m1}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.14 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-25.15 {TkSetWindowMenuBar} {
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.15 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""]
-} {0 {} {}}
-test menu-25.16 {TkSetWindowMenuBar} {
- catch {destroy .m1}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menu-25.16 {TkSetWindowMenuBar} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
. configure -menu .m1
- list [catch {toplevel .t2 -menu m1} msg] $msg [. configure -menu ""] [destroy .t2 .m1]
-} {0 .t2 {} {}}
+ list [toplevel .t2 -menu m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {.t2 {}}
+
-test menu-26.1 {DestroyMenuHashTable} {
- catch {interp destroy testinterp}
+test menu-26.1 {DestroyMenuHashTable} -setup {
+ catch {interp delete testinterp}
+ deleteWindows
+} -body {
interp create testinterp
load {} Tk testinterp
interp eval testinterp {menu .m1}
- list [catch {interp delete testinterp} msg] $msg
-} {0 {}}
+ interp delete testinterp
+} -returnCodes ok -result {}
+
-test menu-27.1 {GetMenuHashTable} {
- catch {interp destroy testinterp}
+test menu-27.1 {GetMenuHashTable} -setup {
+ catch {interp delete testinterp}
+ deleteWindows
+} -body {
interp create testinterp
load {} Tk testinterp
list [catch {interp eval testinterp {menu .m1}} msg] $msg [interp delete testinterp]
-} {0 .m1 {}}
+} -cleanup {
+ deleteWindows
+} -result {0 .m1 {}}
-test menu-28.1 {TkCreateMenuReferences - not there before} {
- catch {destroy .m1}
- list [catch {menu .m1} msg] $msg [destroy .m1]
-} {0 .m1 {}}
-test menu-28.2 {TkCreateMenuReferences - there already} {
- catch {destroy .m1}
- catch {destroy .m2}
+
+test menu-28.1 {TkCreateMenuReferences - not there before} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menu-28.2 {TkCreateMenuReferences - there already} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m2
- list [catch {menu .m2} msg] $msg [destroy .m1 .m2]
-} {0 .m2 {}}
+ menu .m2
+} -cleanup {
+ deleteWindows
+} -result {.m2}
-test menu-29.1 {TkFindMenuReferences - not there} {
- catch {destroy .m1}
+
+test menu-29.1 {TkFindMenuReferences - not there} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
.m1 add cascade -menu .m2
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test menu-30.1 {TkFindMenuReferences - there already} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+
+
+test menu-30.1 {TkFindMenuReferences - there already} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
menu .m2
.m1 add cascade -menu .m2
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1 .m2]
-} {0 {} {} {}}
+ list [. configure -menu .m1] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+
-test menu-31.1 {TkFreeMenuReferences - menuPtr} {
- catch {destroy .m1}
+test menu-31.1 {TkFreeMenuReferences - menuPtr} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test menu-31.2 {TkFreeMenuReferences - cascadePtr} {
- catch {destroy .m1}
+ destroy .m1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-31.2 {TkFreeMenuReferences - cascadePtr} -setup {
+ deleteWindows
+} -body {
. configure -menu ""
menu .m1
.m1 add cascade -menu .m2
- list [catch {.m1 entryconfigure 1 -menu .m3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-31.3 {TkFreeMenuReferences - topLevelListPtr} {
+ .m1 entryconfigure 1 -menu .m3
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-31.3 {TkFreeMenuReferences - topLevelListPtr} -setup {
+ deleteWindows
+} -body {
. configure -menu .m1
- list [catch {. configure -menu ""} msg] $msg
-} {0 {}}
-test menu-31.4 {TkFreeMenuReferences - not empty} {
- catch {destroy .m1}
- catch {destroy .m2}
+ . configure -menu ""
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -result {}
+test menu-31.4 {TkFreeMenuReferences - not empty} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -menu .m3
menu .m2
.m2 add cascade -menu .m3
- list [catch {.m2 entryconfigure 1 -menu ".foo"} msg] $msg [destroy .m1 .m2]
-} {0 {} {}}
+ .m2 entryconfigure 1 -menu ".foo"
+} -cleanup {
+ deleteWindows
+} -result {}
+
-test menu-32.1 {DeleteMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+test menu-32.1 {DeleteMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label foo
.m1 clone .m2
- list [catch {.m1 delete 1} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.2 {DeleteMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 delete 1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.2 {DeleteMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
+
menu .m1
.m1 add command -label one
.m1 add command -label two
.m1 add command -label three
.m1 add command -label four
.m1 clone .m2
- list [catch {.m1 delete 2 3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.3 {DeleteMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 delete 2 3
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.3 {DeleteMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two
@@ -2452,11 +3730,13 @@ test menu-32.3 {DeleteMenuCloneEntries} {
.m1 add command -label four
.m1 clone .m2
.m2 configure -tearoff 1
- list [catch {.m1 delete 1 2} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.4 {DeleteMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 delete 1 2
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.4 {DeleteMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label one
.m1 add command -label two
@@ -2464,49 +3744,62 @@ test menu-32.4 {DeleteMenuCloneEntries} {
.m1 add command -label four
.m1 clone .m2
.m2 configure -tearoff 0
- list [catch {.m1 delete 2 3} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.5 {DeleteMenuCloneEntries} {
- catch {destroy .m1}
- catch {destroy .m2}
+ .m1 delete 2 3
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.5 {DeleteMenuCloneEntries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label one
.m1 add command -label two
.m1 clone .m2
.m1 activate one
- list [catch {.m1 delete one} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.6 {DeleteMenuCloneEntries - reentrancy - crashes tk8.0} {
- catch {destroy .m1}
- menu .m1
- .m1 add command -label test -command ".m1 delete test ; .m1 add command -label test -command \".m1 delete test\"; .m1 delete test"
- list [catch {.m1 invoke test} msg] $msg [destroy .m1]
-} {0 {} {}}
-test menu-32.7 {DeleteMenuCloneEntries - one entry} {
- catch {destroy .m1}
+ .m1 delete one
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.6 {DeleteMenuCloneEntries - reentrancy - crashes tk8.0} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label test \
+ -command ".m1 delete test ; .m1 add command -label test -command \".m1 delete test\"; .m1 delete test"
+ .m1 invoke test
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.7 {DeleteMenuCloneEntries - one entry} -setup {
+ deleteWindows
+} -body {
menu .m1 -tearoff 0
.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} {
+ .m1 delete Hello
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.8 {Ensure all menu clone commands are deleted} -setup {
+ deleteWindows
+} -body {
# 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
+ .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}
-
+} -cleanup {
+ deleteWindows
+} -result {}
+test menu-32.9 {Ensure deleting of clones doesn't corrupt menu refs} -setup {
+ set res {}
+ deleteWindows
+} -body {
menu .menubar
. configure -menu .menubar
menu .menubar.test
@@ -2514,7 +3807,6 @@ test menu-32.9 {Ensure deleting of clones doesn't corrupt menu refs} {
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
@@ -2522,46 +3814,60 @@ test menu-32.9 {Ensure deleting of clones doesn't corrupt menu refs} {
.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}
+ return $res
+} -cleanup {
+ deleteWindows
+} -result {.menubar.cascade .#menubar.#menubar#test.#menubar#cascade .menubar.cascade .#menubar.#menubar#test.#menubar#cascade}
-set l [interp hidden]
-deleteWindows
-test menu-33.1 {menu vs command hiding} {
- catch {destroy .m}
+test menu-33.1 {menu vs command hiding} -setup {
+ deleteWindows
+} -body {
+ set l [interp hidden]
menu .m
interp hide {} .m
destroy .m
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set result [list [winfo children .] [interp hidden]]
+ expr {$result eq [list {} $l]}
+} -result 1
# menu-34 MenuInit only called at boot time
# 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} \
- {altDisplay} {
+test menu-34.1 {menus on multiple screens - crashes tk8.3.1, Bug 5454} -constraints {
+ altDisplay
+} -setup {
+ deleteWindows
+} -body {
toplevel .one
menu .one.m
toplevel .two -screen $::env(TK_ALT_DISPLAY)
menu .two.m
destroy .one
destroy .two
-} {}
+} -result {}
-test menu-36.1 {menu -underline string overruns Bug 1599877} {} {
+test menu-35.1 {menu -underline string overruns Bug 1599877} -setup {
+ destroy .m
+} -body {
# ensure that -underline does not do string overruns [Bug 1599877]
- catch {destroy .m}
menu .m
.m add command -label "File" -underline [expr {1<<30}]
. configure -menu .m
update
tk::TraverseToMenu . "e"
-} {}
+} -cleanup {
+ deleteWindows
+} -result {}
# cleanup
+imageFinish
deleteWindows
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/menuDraw.test b/tests/menuDraw.test
index 225223c..bb632c6 100644
--- a/tests/menuDraw.test
+++ b/tests/menuDraw.test
@@ -5,173 +5,260 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+imageInit
-test menuDraw-1.1 {TkMenuInitializeDrawingFields} {
- catch {destroy .m1}
- list [menu .m1] [destroy .m1]
-} {.m1 {}}
-
-test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} {
- catch {destroy .m1}
+test menuDraw-1.1 {TkMenuInitializeDrawingFields} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [.m1 add command] [destroy .m1]
-} {{} {}}
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+
+
+test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command
+} -cleanup {
+ deleteWindows
+} -result {}
+
-test menuDraw-3.1 {TkMenuFreeDrawOptions} {
- catch {destroy .m1}
+test menuDraw-3.1 {TkMenuFreeDrawOptions} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [destroy .m1]
-} {{}}
+ destroy .m1
+} -result {}
-test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} {
- catch {destroy .m1}
+
+test menuDraw-4.1 {TkMenuEntryFreeDrawOptions} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "This is a test"
- list [destroy .m1]
-} {{}}
-test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} {
- catch {destroy .m1}
- menu .m1
- .m1 add checkbutton -label "This is a test." -font "Courier 12" -activeforeground red -background green -selectcolor purple
- list [destroy .m1]
-} {{}}
-
-test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} {
- catch {destroy .m1}
- list [menu .m1] [destroy .m1]
-} {.m1 {}}
-test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} {
- catch {destroy .m1}
- menu .m1
- list [.m1 configure -fg red] [destroy .m1]
-} {{} {}}
-test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} {
- catch {destroy .m1}
- list [menu .m1 -disabledforeground ""] [destroy .m1]
-} {.m1 {}}
-
-test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} {
- catch {destroy .m1}
+ destroy .m1
+} -result {}
+test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add checkbutton -label "This is a test." -font "Courier 12" \
+ -activeforeground red -background green -selectcolor purple
+ destroy .m1
+} -result {}
+
+
+test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 configure -fg red
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} -setup {
+ deleteWindows
+} -body {
+ menu .m1 -disabledforeground ""
+} -cleanup {
+ deleteWindows
+} -result {.m1}
+
+
+test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.2 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -font "Courier 12"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.3 {TkMenuConfigureEntryDrawOptions - active state - wrong entry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
- list [.m1 entryconfigure 1 -state active] [destroy .m1]
-} {{} {}}
-test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -state active
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.4 {TkMenuConfigureEntryDrawOptions - active state - correct entry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
.m1 activate 1
- list [.m1 entryconfigure 1 -state active] [destroy .m1]
-} {{} {}}
-test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -state active
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.5 {TkMenuConfigureEntryDrawOptions - deactivate entry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
.m1 activate 1
- list [.m1 entryconfigure 1 -state normal] [destroy .m1]
-} {{} {}}
-test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -state normal
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.6 {TkMenuConfigureEntryDrawOptions - bad state} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
- list [catch {.m1 entryconfigure 1 -state foo} msg] $msg [destroy .m1]
-} {1 {bad state "foo": must be active, normal, or disabled} {}}
-test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -font "Courier 12"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -background "red"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -foreground "red"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -activebackground "red"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add command -label "foo" -activeforeground "red"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} {
- catch {destroy .m1}
- menu .m1
- list [.m1 add radiobutton -label "foo" -selectcolor "red"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -state foo
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad state "foo": must be active, normal, or disabled}
+test menuDraw-6.7 {TkMenuConfigureEntryDrawOptions - tkfont specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -font "Courier 12"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.8 {TkMenuConfigureEntryDrawOptions - border specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -background "red"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -foreground "red"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -activebackground "red"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add command -label "foo" -activeforeground "red"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} -setup {
+ deleteWindows
+} -body {
+ menu .m1
+ .m1 add radiobutton -label "foo" -selectcolor "red"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.13 {TkMenuConfigureEntryDrawOptions - textGC disposal} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo" -font "Helvetica 12"
- list [.m1 entryconfigure 1 -font "Courier 12"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -font "Courier 12"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo" -activeforeground "red"
- list [.m1 entryconfigure 1 -activeforeground "green"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -activeforeground "green"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} -setup {
+ deleteWindows
+} -body {
menu .m1 -disabledforeground "red"
.m1 add command -label "foo"
- list [.m1 configure -disabledforeground "green"] [destroy .m1]
-} {{} {}}
-test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} {
- catch {destroy .m1}
+ .m1 configure -disabledforeground "green"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add radiobutton -label "foo" -selectcolor "red"
- list [.m1 entryconfigure 1 -selectcolor "green"] [destroy .m1]
-} {{} {}}
+ .m1 entryconfigure 1 -selectcolor "green"
+} -cleanup {
+ deleteWindows
+} -result {}
-test menuDraw-7.1 {TkEventuallyRecomputeMenu} {
- catch {destroy .m1}
+
+test menuDraw-7.1 {TkEventuallyRecomputeMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "This is a long label"
set tearoff [tk::TearOffMenu .m1]
update idletasks
- list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
-} {{} {}}
-test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} {
- catch {destroy .m1}
+ .m1 entryconfigure 1 -label "foo"
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "This is a long label"
set tearoff [tk::TearOffMenu .m1]
- list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
-} {{} {}}
+ .m1 entryconfigure 1 -label "foo"
+} -cleanup {
+ deleteWindows
+} -result {}
-test menuDraw-8.1 {TkRecomputeMenu} {win userInteraction} {
- catch {destroy .m1}
+test menuDraw-8.1 {TkRecomputeMenu} -constraints {
+ win userInteraction
+} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 configure -postcommand [.m1 add command -label foo]
.m1 add command -label "Hit ESCAPE to make this menu go away."
- list [.m1 post 0 0] [destroy .m1]
-} {{} {}}
+ .m1 post 0 0
+} -cleanup {
+ deleteWindows
+} -result {}
-test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} {
- catch {destroy .m1}
+test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} -setup {
+ deleteWindows
+} -body {
catch {unset foo}
menu .m1
set foo 0
@@ -179,46 +266,66 @@ test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} {
tk::TearOffMenu .m1
update idletasks
list [set foo test] [destroy .m1] [unset foo]
-} {test {} {}}
-test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} {
- catch {destroy .m1}
+} -result {test {} {}}
+test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [catch {tk::TearOffMenu .m1}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -match glob -result *
+
# Don't know how to test when window has been deleted and ComputeMenuGeometry
# gets called.
-test menuDraw-10.1 {ComputeMenuGeometry - menubar} {
- catch {destroy .m1}
+test menuDraw-10.1 {ComputeMenuGeometry - menubar} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label test
. configure -menu .m1
- list [update idletasks] [. configure -menu ""] [destroy .m1]
-} {{} {} {}}
-test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} {
- catch {destroy .m1}
+ list [update idletasks] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menuDraw-10.2 {ComputeMenuGeometry - non-menubar} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label test
- list [update idletasks] [destroy .m1]
-} {{} {}}
-test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} {
- catch {destroy .m1}
+ update idletasks
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-10.3 {ComputeMenuGeometry - Resize necessary} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label test
- list [update idletasks] [destroy .m1]
-} {{} {}}
-test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} {
- catch {destroy .m1}
+ update idletasks
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label test
update idletasks
.m1 entryconfigure 1 -label test
- list [update idletasks] [destroy .m1]
-} {{} {}}
+ update idletasks
+} -cleanup {
+ deleteWindows
+} -result {}
-test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} testImageType {
- catch {destroy .m1}
- catch {eval image delete [image names]}
+
+test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
image create test image2
menu .m1
@@ -226,80 +333,111 @@ test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending}
.m1 invoke 1
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} testImageType {
- catch {destroy .m1}
- catch {eval image delete [image names]}
+ list [image delete image2] [destroy .m1]
+} -cleanup {
+ imageCleanup
+} -result {{} {}}
+test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
image create test image2
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
.m1 invoke 1
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} testImageType {
- catch {destroy .m1}
- catch {eval image delete [image names]}
+ list [image delete image2] [destroy .m1]
+} -cleanup {
+ imageCleanup
+} -result {{} {}}
+test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
image create test image2
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
set tearoff [tk::TearOffMenu .m1 40 40]
update idletasks
- list [image delete image2] [destroy .m1] [eval image delete [image names]]
-} {{} {} {}}
+ list [image delete image2] [destroy .m1]
+} -cleanup {
+ imageCleanup
+} -result {{} {}}
#Don't know how to test missing tkwin in DisplayMenu
-test menuDraw-12.1 {DisplayMenu - menubar background} unix {
- catch {destroy .m1}
+test menuDraw-12.1 {DisplayMenu - menubar background} -constraints unix -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label foo -menu .m2
. configure -menu .m1
- list [update] [. configure -menu ""] [destroy .m1]
-} {{} {} {}}
-test menuDraw-12.2 {Display menu - no entries} {
- catch {destroy .m1}
+ list [update] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menuDraw-12.2 {Display menu - no entries} -setup {
+ deleteWindows
+} -body {
menu .m1
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw-12.3 {DisplayMenu - one entry} {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-12.3 {DisplayMenu - one entry} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw-12.4 {DisplayMenu - two entries} {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-12.4 {DisplayMenu - two entries} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw.12.5 {DisplayMenu - two columns - first bigger} {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw.12.5 {DisplayMenu - two columns - first bigger} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
.m1 add command -label "three" -columnbreak 1
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw-12.5 {DisplayMenu - two column - second bigger} {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-12.5 {DisplayMenu - two column - second bigger} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two" -columnbreak 1
.m1 add command -label "three"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw.12.7 {DisplayMenu - three columns} {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw.12.7 {DisplayMenu - three columns} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two" -columnbreak 1
@@ -308,133 +446,175 @@ test menuDraw.12.7 {DisplayMenu - three columns} {
.m1 add command -label "five"
.m1 add command -label "six"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [update] [destroy .m1]
-} {{} {}}
-test menuDraw-12.6 {Display menu - testing for extra space and menubars} unix {
- catch {destroy .m1}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-12.6 {Display menu - testing for extra space and menubars} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label foo
. configure -menu .m1
- list [update] [. configure -menu ""] [destroy .m1]
-} {{} {} {}}
-test menuDraw-12.7 {Display menu - extra space at end of menu} {
- catch {destroy .m1}
+ update
+ . configure -menu ""
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-12.7 {Display menu - extra space at end of menu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
wm geometry $tearoff 200x100
- list [update] [destroy .m1]
-} {{} {}}
+ update
+} -cleanup {
+ deleteWindows
+} -result {}
+
-test menuDraw-13.1 {TkMenuEventProc - Expose} {
- catch {destroy .m1}
- catch {destroy .m2}
+test menuDraw-13.1 {TkMenuEventProc - Expose} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "one"
menu .m2
.m2 add command -label "two"
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}
+ list [raise $tearoff2] [update]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [wm geometry $tearoff 200x100] [update] [destroy .m1]
-} {{} {} {}}
+ list [wm geometry $tearoff 200x100] [update]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
# Testing deletes is hard, and I am going to do my best. Don't know how
# to test the case where we have already cleared the tkwin field in the
# menuPtr.
-test menuDraw-13.4 {TkMenuEventProc - simple delete} {
- catch {destroy .m1}
+test menuDraw-13.4 {TkMenuEventProc - simple delete} -setup {
+ deleteWindows
+} -body {
menu .m1
- list [destroy .m1]
-} {{}}
-test menuDraw-13.5 {TkMenuEventProc - nothing pending} {
- catch {destroy .m1}
+ destroy .m1
+} -result {}
+test menuDraw-13.5 {TkMenuEventProc - nothing pending} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label foo
update idletasks
- list [destroy .m1]
-} {{}}
+ destroy .m1
+} -result {}
-test menuDraw-14.1 {TkMenuImageProc} testImageType {
- catch {destroy .m1}
+
+test menuDraw-14.1 {TkMenuImageProc} -constraints testImageType -setup {
+ deleteWindows
+} -body {
catch {image delete image1}
menu .m1
image create test image1
.m1 add command -image image1
update idletasks
- list [image delete image1] [destroy .m1]
-} {{} {}}
-test menuDraw-14.2 {TkMenuImageProc} testImageType {
- catch {destroy .m1}
+ image delete image1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-14.2 {TkMenuImageProc} -constraints testImageType -setup {
+ deleteWindows
+} -body {
catch {image delete image1}
menu .m1
image create test image1
.m1 add command -image image1
- list [image delete image1] [destroy .m1]
-} {{} {}}
+ image delete image1
+} -cleanup {
+ deleteWindows
+} -result {}
+
-test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} {
- catch {destroy .m1}
+test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -match glob -result *
+test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo" -state active
set tearoff [tk::TearOffMenu .m1 40 40]
- list [$tearoff index active] [destroy .m1]
-} {none {}}
-test menuDraw-15.3 {TkPostTearoffMenu - post command} {
- catch {destroy .m1}
+ $tearoff index active
+} -cleanup {
+ deleteWindows
+} -result {none}
+test menuDraw-15.3 {TkPostTearoffMenu - post command} -setup {
+ deleteWindows
+} -body {
catch {unset foo}
menu .m1 -postcommand "set foo .m1"
.m1 add command -label "foo"
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}
+} -result {0 .m1 {} {}}
+test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} -setup {
+ deleteWindows
+} -body {
menu .m1 -postcommand "destroy .m1"
.m1 add command -label "foo"
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}
+} -result {0 {} 0}
+test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
set height [winfo screenheight .m1]
- list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1]
-} {0 {}}
-test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 $height
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -match glob -result *
+test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add command -label "foo"
set width [winfo screenwidth .m1]
- list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 $width 40
+} -cleanup {
+ deleteWindows
+} -returnCodes ok -match glob -result *
-test menuDraw-16.1 {TkPostSubmenu} nonUnixUserInteraction {
- catch {destroy .m1}
- catch {destroy .m2}
+test menuDraw-16.1 {TkPostSubmenu} -constraints nonUnixUserInteraction -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to make this menu go away."
set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff postcascade 0
- list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
-} {{} {} {}}
-test menuDraw-16.2 {TkPostSubMenu} nonUnixUserInteraction {
- catch {destroy .m1}
- catch {destroy .m2}
- catch {destroy .m3}
+ $tearoff postcascade 0
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-16.2 {TkPostSubMenu} -constraints nonUnixUserInteraction -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label "two" -menu .m2
.m1 add cascade -label "three" -menu .m3
@@ -444,68 +624,94 @@ test menuDraw-16.2 {TkPostSubMenu} nonUnixUserInteraction {
.m3 add command -label "three"
set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff postcascade 0
- list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3]
-} {{} {} {} {}}
-test menuDraw-16.3 {TkPostSubMenu} {
- catch {destroy .m1}
+ $tearoff postcascade 1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-16.3 {TkPostSubMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test -menu .m2
- list [.m1 postcascade 1] [destroy .m1]
-} {{} {}}
-test menuDraw-16.4 {TkPostSubMenu} {
- catch {destroy .m1}
+ .m1 postcascade 1
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-16.4 {TkPostSubMenu} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test
set tearoff [tk::TearOffMenu .m1 40 40]
- list [$tearoff postcascade 0] [destroy .m1]
-} {{} {}}
-test menuDraw-16.5 {TkPostSubMenu} unix {
- catch {destroy .m1}
- catch {destroy .m2}
+ $tearoff postcascade 0
+} -cleanup {
+ deleteWindows
+} -result {}
+test menuDraw-16.5 {TkPostSubMenu} -constraints unix -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test -menu .m2
menu .m2 -postcommand "glorp"
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} {win userInteraction} {
- catch {destroy .m1}
- catch {destroy .m2}
+ $tearoff postcascade test
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid command name "glorp"}
+test menuDraw-16.6 {TkPostSubMenu} -constraints {
+ win userInteraction
+} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to get rid of this menu"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
-} {{} {} {}}
+ $tearoff postcascade 0
+} -cleanup {
+ deleteWindows
+} -result {}
-test menuDraw-17.1 {AdjustMenuCoords - menubar} unix {
- catch {destroy .m1}
- catch {destroy .m2}
+
+test menuDraw-17.1 {AdjustMenuCoords - menubar} -constraints unix -setup {
+ deleteWindows
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label test -menu .m2
menu .m2 -tearoff 0
.m2 add command -label foo
. configure -menu .m1
foreach w [winfo children .] {
- if {[$w cget -type] == "menubar"} {
- break
- }
+ if {[$w cget -type] == "menubar"} {
+ break
+ }
}
- list [$w postcascade 0] [. configure -menu ""] [destroy .m1] [destroy .m2]
-} {{} {} {} {}}
-test menuDraw-17.2 {AdjustMenuCoords - menu} {win userInteraction} {
- catch {destroy .m1}
- catch {destroy .m2}
+ list [$w postcascade 0] [. configure -menu ""]
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
+test menuDraw-17.2 {AdjustMenuCoords - menu} -constraints {
+ win userInteraction
+} -setup {
+ deleteWindows
+} -body {
menu .m1
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to make this menu go away"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
-} {{} {} {}}
+ $tearoff postcascade 0
+} -cleanup {
+ deleteWindows
+} -result {}
# cleanup
+imageFinish
deleteWindows
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/menubut.test b/tests/menubut.test
index 3dfa1b5..6efdb0f 100644
--- a/tests/menubut.test
+++ b/tests/menubut.test
@@ -10,9 +10,11 @@
# XXX of a procedure has tests then the whole procedure has tests,
# XXX but many procedures have no tests.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+imageInit
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -24,318 +26,737 @@ option add *Button.borderWidth 2
option add *Button.highlightThickness 2
option add *Button.font {Helvetica -12 bold}
-eval image delete [image names]
-if {[testConstraint testImageType]} {
+
+menubutton .mb -text "Test"
+pack .mb
+update
+test menubutton-1.1 {configuration options} -body {
+ .mb configure -activebackground #012345
+ .mb cget -activebackground
+} -cleanup {
+ .mb configure -activebackground [lindex [.mb configure -activebackground] 3]
+} -result {#012345}
+test menubutton-1.2 {configuration options} -body {
+ .mb configure -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test menubutton-1.3 {configuration options} -body {
+ .mb configure -activeforeground #ff0000
+ .mb cget -activeforeground
+} -cleanup {
+ .mb configure -activeforeground [lindex [.mb configure -activeforeground] 3]
+} -result {#ff0000}
+test menubutton-1.4 {configuration options} -body {
+ .mb configure -activeforeground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test menubutton-1.5 {configuration options} -body {
+ .mb configure -anchor nw
+ .mb cget -anchor
+} -cleanup {
+ .mb configure -anchor [lindex [.mb configure -anchor] 3]
+} -result {nw}
+test menubutton-1.6 {configuration options} -body {
+ .mb configure -anchor bogus
+} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+test menubutton-1.7 {configuration options} -body {
+ .mb configure -background #ff0000
+ .mb cget -background
+} -cleanup {
+ .mb configure -background [lindex [.mb configure -background] 3]
+} -result {#ff0000}
+test menubutton-1.8 {configuration options} -body {
+ .mb configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test menubutton-1.9 {configuration options} -body {
+ .mb configure -bd 4
+ .mb cget -bd
+} -cleanup {
+ .mb configure -bd [lindex [.mb configure -bd] 3]
+} -result {4}
+test menubutton-1.10 {configuration options} -body {
+ .mb configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test menubutton-1.11 {configuration options} -body {
+ .mb configure -bg #ff0000
+ .mb cget -bg
+} -cleanup {
+ .mb configure -bg [lindex [.mb configure -bg] 3]
+} -result {#ff0000}
+test menubutton-1.12 {configuration options} -body {
+ .mb configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test menubutton-1.13 {configuration options} -body {
+ .mb configure -bitmap questhead
+ .mb cget -bitmap
+} -cleanup {
+ .mb configure -bitmap [lindex [.mb configure -bitmap] 3]
+} -result {questhead}
+test menubutton-1.14 {configuration options} -body {
+ .mb configure -bitmap badValue
+} -returnCodes error -result {bitmap "badValue" not defined}
+test menubutton-1.15 {configuration options} -body {
+ .mb configure -borderwidth 1.3
+ .mb cget -borderwidth
+} -cleanup {
+ .mb configure -borderwidth [lindex [.mb configure -borderwidth] 3]
+} -result {1}
+test menubutton-1.16 {configuration options} -body {
+ .mb configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test menubutton-1.17 {configuration options} -body {
+ .mb configure -cursor arrow
+ .mb cget -cursor
+} -cleanup {
+ .mb configure -cursor [lindex [.mb configure -cursor] 3]
+} -result {arrow}
+test menubutton-1.18 {configuration options} -body {
+ .mb configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test menubutton-1.19 {configuration options} -body {
+ .mb configure -direction below
+ .mb cget -direction
+} -cleanup {
+ .mb configure -direction [lindex [.mb configure -direction] 3]
+} -result {below}
+test menubutton-1.20 {configuration options} -body {
+ .mb configure -direction badValue
+} -returnCodes error -result {bad direction "badValue": must be above, below, flush, left, or right}
+test menubutton-1.21 {configuration options} -body {
+ .mb configure -disabledforeground #00ff00
+ .mb cget -disabledforeground
+} -cleanup {
+ .mb configure -disabledforeground [lindex [.mb configure -disabledforeground] 3]
+} -result {#00ff00}
+test menubutton-1.22 {configuration options} -body {
+ .mb configure -disabledforeground xyzzy
+} -returnCodes error -result {unknown color name "xyzzy"}
+test menubutton-1.23 {configuration options} -body {
+ .mb configure -fg #110022
+ .mb cget -fg
+} -cleanup {
+ .mb configure -fg [lindex [.mb configure -fg] 3]
+} -result {#110022}
+test menubutton-1.24 {configuration options} -body {
+ .mb configure -fg bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test menubutton-1.25 {configuration options} -body {
+ .mb configure -font {Helvetica 12}
+ .mb cget -font
+} -cleanup {
+ .mb configure -font [lindex [.mb configure -font] 3]
+} -result {Helvetica 12}
+test menubutton-1.26 {configuration options} -body {
+ .mb configure -foreground #110022
+ .mb cget -foreground
+} -cleanup {
+ .mb configure -foreground [lindex [.mb configure -foreground] 3]
+} -result {#110022}
+test menubutton-1.27 {configuration options} -body {
+ .mb configure -foreground bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test menubutton-1.28 {configuration options} -body {
+ .mb configure -height 18
+ .mb cget -height
+} -cleanup {
+ .mb configure -height [lindex [.mb configure -height] 3]
+} -result {18}
+test menubutton-1.29 {configuration options} -body {
+ .mb configure -height 20.0
+} -returnCodes error -result {expected integer but got "20.0"}
+test menubutton-1.30 {configuration options} -body {
+ .mb configure -highlightbackground #112233
+ .mb cget -highlightbackground
+} -cleanup {
+ .mb configure -highlightbackground [lindex [.mb configure -highlightbackground] 3]
+} -result {#112233}
+test menubutton-1.31 {configuration options} -body {
+ .mb configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test menubutton-1.32 {configuration options} -body {
+ .mb configure -highlightcolor #110022
+ .mb cget -highlightcolor
+} -cleanup {
+ .mb configure -highlightcolor [lindex [.mb configure -highlightcolor] 3]
+} -result {#110022}
+test menubutton-1.33 {configuration options} -body {
+ .mb configure -highlightcolor bogus
+} -returnCodes error -result {unknown color name "bogus"}
+test menubutton-1.34 {configuration options} -body {
+ .mb configure -highlightthickness 18
+ .mb cget -highlightthickness
+} -cleanup {
+ .mb configure -highlightthickness [lindex [.mb configure -highlightthickness] 3]
+} -result {18}
+test menubutton-1.35 {configuration options} -body {
+ .mb configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test menubutton-1.36 {configuration options} -constraints {
+ testImageType
+} -setup {
+ catch {image delete image1}
+ image create test image1
+} -body {
+ .mb configure -image image1
+ .mb cget -image
+} -cleanup {
+ .mb configure -image [lindex [.mb configure -image] 3]
image create test image1
-}
+} -result {image1}
+test menubutton-1.37 {configuration options} -setup {
+ catch {image delete bogus}
+} -body {
+ .mb configure -image bogus
+} -cleanup {
+ .mb configure -image [lindex [.mb configure -image] 3]
+} -returnCodes error -result {image "bogus" doesn't exist}
+test menubutton-1.38 {configuration options} -body {
+ .mb configure -indicatoron yes
+ .mb cget -indicatoron
+} -cleanup {
+ .mb configure -indicatoron [lindex [.mb configure -indicatoron] 3]
+} -result {1}
+test menubutton-1.39 {configuration options} -body {
+ .mb configure -indicatoron no_way
+} -returnCodes error -result {expected boolean value but got "no_way"}
+test menubutton-1.40 {configuration options} -body {
+ .mb configure -justify right
+ .mb cget -justify
+} -cleanup {
+ .mb configure -justify [lindex [.mb configure -justify] 3]
+} -result {right}
+test menubutton-1.41 {configuration options} -body {
+ .mb configure -justify bogus
+} -returnCodes error -result {bad justification "bogus": must be left, right, or center}
+test menubutton-1.42 {configuration options} -body {
+ .mb configure -menu {any old string}
+ .mb cget -menu
+} -cleanup {
+ .mb configure -menu [lindex [.mb configure -menu] 3]
+} -result {any old string}
+test menubutton-1.43 {configuration options} -body {
+ .mb configure -padx 12
+ .mb cget -padx
+} -cleanup {
+ .mb configure -padx [lindex [.mb configure -padx] 3]
+} -result {12}
+test menubutton-1.44 {configuration options} -body {
+ .mb configure -padx 420x
+} -returnCodes error -result {bad screen distance "420x"}
+test menubutton-1.45 {configuration options} -body {
+ .mb configure -pady 12
+ .mb cget -pady
+} -cleanup {
+ .mb configure -pady [lindex [.mb configure -pady] 3]
+} -result {12}
+test menubutton-1.46 {configuration options} -body {
+ .mb configure -pady 420x
+} -returnCodes error -result {bad screen distance "420x"}
+test menubutton-1.47 {configuration options} -body {
+ .mb configure -relief groove
+ .mb cget -relief
+} -cleanup {
+ .mb configure -relief [lindex [.mb configure -relief] 3]
+} -result {groove}
+test menubutton-1.48 {configuration options} -body {
+ .mb configure -relief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test menubutton-1.49 {configuration options} -body {
+ .mb configure -state normal
+ .mb cget -state
+} -cleanup {
+ .mb configure -state [lindex [.mb configure -state] 3]
+} -result {normal}
+test menubutton-1.50 {configuration options} -body {
+ .mb configure -state bogus
+} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal}
+test menubutton-1.51 {configuration options} -body {
+ .mb configure -takefocus {any string}
+ .mb cget -takefocus
+} -cleanup {
+ .mb configure -takefocus [lindex [.mb configure -takefocus] 3]
+} -result {any string}
+test menubutton-1.52 {configuration options} -body {
+ .mb configure -text {Sample text}
+ .mb cget -text
+} -cleanup {
+ .mb configure -text [lindex [.mb configure -text] 3]
+} -result {Sample text}
+test menubutton-1.53 {configuration options} -body {
+ .mb configure -textvariable i
+ .mb cget -textvariable
+} -cleanup {
+ .mb configure -textvariable [lindex [.mb configure -textvariable] 3]
+} -result {i}
+test menubutton-1.54 {configuration options} -body {
+ .mb configure -underline 5
+ .mb cget -underline
+} -cleanup {
+ .mb configure -underline [lindex [.mb configure -underline] 3]
+} -result {5}
+test menubutton-1.55 {configuration options} -body {
+ .mb configure -underline 3p
+} -returnCodes error -result {expected integer but got "3p"}
+test menubutton-1.56 {configuration options} -body {
+ .mb configure -width 402
+ .mb cget -width
+} -cleanup {
+ .mb configure -width [lindex [.mb configure -width] 3]
+} -result {402}
+test menubutton-1.57 {configuration options} -body {
+ .mb configure -width 3p
+} -returnCodes error -result {expected integer but got "3p"}
+test menubutton-1.58 {configuration options} -body {
+ .mb configure -wraplength 100
+ .mb cget -wraplength
+} -cleanup {
+ .mb configure -wraplength [lindex [.mb configure -wraplength] 3]
+} -result {100}
+test menubutton-1.59 {configuration options} -body {
+ .mb configure -wraplength 6x
+} -returnCodes error -result {bad screen distance "6x"}
+
+
+deleteWindows
menubutton .mb -text "Test"
pack .mb
update
-set i 1
-foreach test {
- {-activebackground #012345 #012345 non-existent
- {unknown color name "non-existent"}}
- {-activeforeground #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-anchor nw nw bogus {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}}
- {-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"}}
- {-bitmap questhead questhead badValue {bitmap "badValue" not defined}}
- {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
- {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
- {-direction below below badValue {bad direction "badValue": must be above, below, flush, left, or right}}
- {-disabledforeground #00ff00 #00ff00 xyzzy {unknown color name "xyzzy"}}
- {-fg #110022 #110022 bogus {unknown color name "bogus"}}
- {-font {Helvetica 12} {Helvetica 12} {} {font "" doesn't exist}}
- {-foreground #110022 #110022 bogus {unknown color name "bogus"}}
- {-height 18 18 20.0 {expected integer but got "20.0"}}
- {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}}
- {-highlightcolor #110022 #110022 bogus {unknown color name "bogus"}}
- {-highlightthickness 18 18 badValue {bad screen distance "badValue"}}
- {-image image1 image1 bogus {image "bogus" doesn't exist}}
- {-indicatoron yes 1 no_way {expected boolean value but got "no_way"}}
- {-justify right right bogus {bad justification "bogus": must be left, right, or center}}
- {-menu "any old string" "any old string" {} {}}
- {-padx 12 12 420x {bad screen distance "420x"}}
- {-pady 12 12 420x {bad screen distance "420x"}}
- {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
- {-state normal normal bogus {bad state "bogus": must be active, disabled, or normal}}
- {-takefocus "any string" "any string" {} {}}
- {-text "Sample text" {Sample text} {} {}}
- {-textvariable i i {} {}}
- {-underline 5 5 3p {expected integer but got "3p"}}
- {-width 402 402 3p {expected integer but got "3p"}}
- {-wraplength 100 100 6x {bad screen distance "6x"}}
-} {
- set name [lindex $test 0]
- test menubutton-1.$i {configuration options} testImageType {
- .mb configure $name [lindex $test 1]
- lindex [.mb configure $name] 4
- } [lindex $test 2]
- incr i
- if {[lindex $test 3] != ""} {
- test menubutton-1.$i {configuration options} {
- list [catch {.mb configure $name [lindex $test 3]} msg] $msg
- } [list 1 [lindex $test 4]]
- }
- .mb configure $name [lindex [.mb configure $name] 3]
- incr i
-}
-
-test menubutton-2.1 {Tk_MenubuttonCmd procedure} {
- list [catch {menubutton} msg] $msg
-} {1 {wrong # args: should be "menubutton pathName ?options?"}}
-test menubutton-2.2 {Tk_MenubuttonCmd procedure} {
- list [catch {menubutton foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test menubutton-2.3 {Tk_MenubuttonCmd procedure} {
+test menubutton-2.1 {Tk_MenubuttonCmd procedure} -body {
+ menubutton
+} -returnCodes error -result {wrong # args: should be "menubutton pathName ?-option value ...?"}
+test menubutton-2.2 {Tk_MenubuttonCmd procedure} -body {
+ menubutton foo
+} -returnCodes error -result {bad window path name "foo"}
+test menubutton-2.3 {Tk_MenubuttonCmd procedure} -body {
catch {destroy .mb}
menubutton .mb
winfo class .mb
-} {Menubutton}
-test menubutton-2.4 {Tk_ButtonCmd procedure} {
- catch {destroy .mb}
- list [catch {menubutton .mb -gorp foo} msg] $msg [winfo exists .mb]
-} {1 {unknown option "-gorp"} 0}
+} -result {Menubutton}
+test menubutton-2.4 {Tk_ButtonCmd procedure} -setup {
+ destroy .mb
+} -body {
+ menubutton .mb -gorp foo
+} -returnCodes error -result {unknown option "-gorp"}
+test menubutton-2.5 {Tk_ButtonCmd procedure} -setup {
+ destroy .mb
+} -body {
+ catch {menubutton .mb -gorp foo}
+ winfo exists .mb
+} -result 0
-catch {destroy .mb}
+
+deleteWindows
menubutton .mb -text "Test Menu"
pack .mb
-test menubutton-3.1 {MenuButtonWidgetCmd procedure} {
- list [catch {.mb} msg] $msg
-} {1 {wrong # args: should be ".mb option ?arg arg ...?"}}
-test menubutton-3.2 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.mb c} msg] $msg
-} {1 {ambiguous option "c": must be cget or configure}}
-test menubutton-3.3 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.mb cget} msg] $msg
-} {1 {wrong # args: should be ".mb cget option"}}
-test menubutton-3.4 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.mb cget a b} msg] $msg
-} {1 {wrong # args: should be ".mb cget option"}}
-test menubutton-3.5 {ButtonWidgetCmd procedure, "cget" option} {
- list [catch {.mb cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test menubutton-3.6 {ButtonWidgetCmd procedure, "cget" option} {
+test menubutton-3.1 {MenuButtonWidgetCmd procedure} -body {
+ .mb
+} -returnCodes error -result {wrong # args: should be ".mb option ?arg ...?"}
+test menubutton-3.2 {ButtonWidgetCmd procedure, "cget" option} -body {
+ .mb c
+} -returnCodes error -result {ambiguous option "c": must be cget or configure}
+test menubutton-3.3 {ButtonWidgetCmd procedure, "cget" option} -body {
+ .mb cget
+} -returnCodes error -result {wrong # args: should be ".mb cget option"}
+test menubutton-3.4 {ButtonWidgetCmd procedure, "cget" option} -body {
+ .mb cget a b
+} -returnCodes error -result {wrong # args: should be ".mb cget option"}
+test menubutton-3.5 {ButtonWidgetCmd procedure, "cget" option} -body {
+ .mb cget -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test menubutton-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
.mb configure -highlightthickness 3
.mb cget -highlightthickness
-} {3}
-test menubutton-3.7 {ButtonWidgetCmd procedure, "configure" option} {
+} -result {3}
+test menubutton-3.7 {ButtonWidgetCmd procedure, "configure" option} -body {
llength [.mb configure]
-} {33}
-test menubutton-3.8 {ButtonWidgetCmd procedure, "configure" option} {
- list [catch {.mb configure -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test menubutton-3.9 {ButtonWidgetCmd procedure, "configure" option} {
- list [catch {.mb co -bg #ffffff -fg} msg] $msg
-} {1 {value for "-fg" missing}}
-test menubutton-3.10 {ButtonWidgetCmd procedure, "configure" option} {
+} -result {33}
+test menubutton-3.8 {ButtonWidgetCmd procedure, "configure" option} -body {
+ .mb configure -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test menubutton-3.9 {ButtonWidgetCmd procedure, "configure" option} -body {
+ .mb co -bg #ffffff -fg
+} -returnCodes error -result {value for "-fg" missing}
+test menubutton-3.10 {ButtonWidgetCmd procedure, "configure" option} -body {
.mb configure -fg #123456
.mb configure -bg #654321
lindex [.mb configure -fg] 4
-} {#123456}
-test menubutton-3.11 {ButtonWidgetCmd procedure, "configure" option} {
- list [catch {.mb foobar} msg] $msg
-} {1 {bad option "foobar": must be cget or configure}}
+} -result {#123456}
+test menubutton-3.11 {ButtonWidgetCmd procedure, "configure" option} -body {
+ .mb foobar
+} -returnCodes error -result {bad option "foobar": must be cget or configure}
+deleteWindows
# XXX Need to add tests for several procedures here. The tests for XXX
# XXX ConfigureMenuButton aren't complete either. XXX
-test menubutton-4.1 {ConfigureMenuButton procedure} {
- catch {destroy .mb1}
+test menubutton-4.1 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
+ button .mb1 -text "Menubutton 1"
+ .mb1 configure -width 1i
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "1i"}
+test menubutton-4.2 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
button .mb1 -text "Menubutton 1"
- list [catch {.mb1 configure -width 1i} msg] $msg $errorInfo
-} {1 {expected integer but got "1i"} {expected integer but got "1i"
+ catch {.mb1 configure -width 1i}
+ return $errorInfo
+} -cleanup {
+ deleteWindows
+} -result {expected integer but got "1i"
(processing -width option)
invoked from within
-".mb1 configure -width 1i"}}
-test menubutton-4.2 {ConfigureMenuButton procedure} {
- catch {destroy .mb1}
+".mb1 configure -width 1i"}
+
+test menubutton-4.3 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
button .mb1 -text "Menubutton 1"
- list [catch {.mb1 configure -height 0.5c} msg] $msg $errorInfo
-} {1 {expected integer but got "0.5c"} {expected integer but got "0.5c"
+ .mb1 configure -height 0.5c
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "0.5c"}
+test menubutton-4.4 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
+ button .mb1 -text "Menubutton 1"
+ catch {.mb1 configure -height 0.5c}
+ return $errorInfo
+} -cleanup {
+ deleteWindows
+} -result {expected integer but got "0.5c"
(processing -height option)
invoked from within
-".mb1 configure -height 0.5c"}}
-test menubutton-4.3 {ConfigureMenuButton procedure} {
- catch {destroy .mb1}
+".mb1 configure -height 0.5c"}
+
+test menubutton-4.5 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
+ button .mb1 -bitmap questhead
+ .mb1 configure -width abc
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad screen distance "abc"}
+test menubutton-4.6 {ConfigureMenuButton procedure} -setup {
+ deleteWindows
+} -body {
button .mb1 -bitmap questhead
- list [catch {.mb1 configure -width abc} msg] $msg $errorInfo
-} {1 {bad screen distance "abc"} {bad screen distance "abc"
+ catch {.mb1 configure -width abc}
+ return $errorInfo
+} -cleanup {
+ deleteWindows
+} -result {bad screen distance "abc"
(processing -width option)
invoked from within
-".mb1 configure -width abc"}}
-test menubutton-4.4 {ConfigureMenuButton procedure} testImageType {
- catch {destroy .mb1}
- eval image delete [image names]
+".mb1 configure -width abc"}
+
+test menubutton-4.7 {ConfigureMenuButton procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
image create test image1
button .mb1 -image image1
- list [catch {.mb1 configure -height 0.5x} msg] $msg $errorInfo
-} {1 {bad screen distance "0.5x"} {bad screen distance "0.5x"
+ .mb1 configure -height 0.5x
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -returnCodes error -result {bad screen distance "0.5x"}
+test menubutton-4.8 {ConfigureMenuButton procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ imageCleanup
+} -body {
+ image create test image1
+ button .mb1 -image image1
+ catch {.mb1 configure -height 0.5x}
+ return $errorInfo
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {bad screen distance "0.5x"
(processing -height option)
invoked from within
-".mb1 configure -height 0.5x"}}
-test menubutton-4.5 {ConfigureMenuButton procedure} {nonPortable fonts} {
- catch {destroy .mb1}
+".mb1 configure -height 0.5x"}
+
+test menubutton-4.9 {ConfigureMenuButton procedure} -constraints {
+ nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
button .mb1 -text "Sample text" -width 10 -height 2
pack .mb1
set result "[winfo reqwidth .mb1] [winfo reqheight .mb1]"
.mb1 configure -bitmap questhead
lappend result [winfo reqwidth .mb1] [winfo reqheight .mb1]
-} {102 46 20 12}
-test menubutton-4.6 {ConfigureMenuButton procedure - bad direction} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {102 46 20 12}
+
+test menubutton-4.10 {ConfigureMenuButton procedure - bad direction} -setup {
+ deleteWindows
+} -body {
+ menubutton .mb -text "Test"
+ .mb configure -direction badValue
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad direction "badValue": must be above, below, flush, left, or right}
+test menubutton-4.11 {ConfigureMenuButton procedure - bad direction} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text "Test"
- list [catch {.mb configure -direction badValue} msg] $msg \
- [.mb cget -direction] [destroy .mb]
-} {1 {bad direction "badValue": must be above, below, flush, left, or right} below {}}
+ catch {.mb configure -direction badValue}
+ list [.mb cget -direction] [destroy .mb]
+} -cleanup {
+ deleteWindows
+} -result {below {}}
+
+
# XXX Need to add tests for several procedures here. XXX
-test menubutton-5.1 {MenuButtonEventProc procedure} {
+test menubutton-5.1 {MenuButtonEventProc procedure} -setup {
deleteWindows
+ set x {}
+} -body {
menubutton .mb1 -bg #543210
rename .mb1 .mb2
- set x {}
lappend x [winfo children .]
lappend x [.mb2 cget -bg]
destroy .mb1
lappend x [info command .mb*] [winfo children .]
-} {.mb1 #543210 {} {}}
+} -cleanup {
+ deleteWindows
+} -result {.mb1 #543210 {} {}}
+
-test menubutton-6.1 {MenuButtonCmdDeletedProc procedure} {
+test menubutton-6.1 {MenuButtonCmdDeletedProc procedure} -setup {
deleteWindows
+} -body {
menubutton .mb1
rename .mb1 {}
list [info command .mb*] [winfo children .]
-} {{} {}}
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
-test menubutton-7.1 {ComputeMenuButtonGeometry procedure} testImageType {
- catch {destroy .mb}
+
+test menubutton-7.1 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
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} testImageType {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {38 23}
+test menubutton-7.2 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
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} testImageType {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {36 21}
+test menubutton-7.3 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
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} testImageType {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {34 19}
+test menubutton-7.4 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
menubutton .mb -image image1 -bd 2 -relief raised -width 40 \
- -highlightthickness 2
+ -highlightthickness 2
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {48 23}
-test menubutton-7.5 {ComputeMenuButtonGeometry procedure} testImageType {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {48 23}
+test menubutton-7.5 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
menubutton .mb -image image1 -bd 2 -relief raised -height 30 \
- -highlightthickness 2
+ -highlightthickness 2
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {38 38}
-test menubutton-7.6 {ComputeMenuButtonGeometry procedure} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {38 38}
+test menubutton-7.6 {ComputeMenuButtonGeometry procedure} -setup {
+ deleteWindows
+} -body {
menubutton .mb -bitmap question -bd 2 -relief raised \
- -highlightthickness 2
+ -highlightthickness 2
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {25 35}
-test menubutton-7.7 {ComputeMenuButtonGeometry procedure} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {25 35}
+test menubutton-7.7 {ComputeMenuButtonGeometry procedure} -setup {
+ deleteWindows
+} -body {
menubutton .mb -bitmap question -bd 2 -relief raised -width 40 \
- -highlightthickness 1
+ -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {46 33}
-test menubutton-7.8 {ComputeMenuButtonGeometry procedure} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {46 33}
+test menubutton-7.8 {ComputeMenuButtonGeometry procedure} -setup {
+ deleteWindows
+} -body {
menubutton .mb -bitmap question -bd 2 -relief raised -height 50 \
- -highlightthickness 1
+ -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {23 56}
-test menubutton-7.9 {ComputeMenuButtonGeometry procedure} {fonts} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {23 56}
+test menubutton-7.9 {ComputeMenuButtonGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text String -bd 2 -relief raised -padx 0 -pady 0 \
- -highlightthickness 1
+ -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {42 20}
-test menubutton-7.10 {ComputeMenuButtonGeometry procedure} {fonts} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {42 20}
+test menubutton-7.10 {ComputeMenuButtonGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text String -bd 2 -relief raised -width 20 \
- -padx 0 -pady 0 -highlightthickness 1
+ -padx 0 -pady 0 -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {146 20}
-test menubutton-7.11 {ComputeMenuButtonGeometry procedure} {fonts} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {146 20}
+test menubutton-7.11 {ComputeMenuButtonGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text String -bd 2 -relief raised -height 2 \
- -padx 0 -pady 0 -highlightthickness 1
+ -padx 0 -pady 0 -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {42 34}
-test menubutton-7.12 {ComputeMenuButtonGeometry procedure} {fonts} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {42 34}
+test menubutton-7.12 {ComputeMenuButtonGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text String -bd 2 -relief raised -padx 10 -pady 5 \
- -highlightthickness 1
+ -highlightthickness 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {62 30}
-test menubutton-7.13 {ComputeMenuButtonGeometry procedure} {nonPortable fonts} {
- catch {destroy .mb}
+} -cleanup {
+ deleteWindows
+} -result {62 30}
+test menubutton-7.13 {ComputeMenuButtonGeometry procedure} -constraints {
+ nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
menubutton .mb -text String -bd 2 -relief raised \
- -highlightthickness 1 -indicatoron 1
+ -highlightthickness 1 -indicatoron 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {78 28}
-test menubutton-7.14 {ComputeMenuButtonGeometry procedure} {testImageType unix nonPortable} {
+} -cleanup {
+ deleteWindows
+} -result {78 28}
+test menubutton-7.14 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType unix nonPortable
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
# The following test is non-portable because the indicator's pixel
# size varies to maintain constant absolute size.
- catch {destroy .mb}
menubutton .mb -image image1 -bd 2 -relief raised \
- -highlightthickness 2 -indicatoron 1
+ -highlightthickness 2 -indicatoron 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {64 23}
-test menubutton-7.15 {ComputeMenuButtonGeometry procedure} {testImageType win nonPortable} {
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {64 23}
+test menubutton-7.15 {ComputeMenuButtonGeometry procedure} -constraints {
+ testImageType win nonPortable
+} -setup {
+ deleteWindows
+ image create test image1
+} -body {
# The following test is non-portable because the indicator's pixel
# size varies to maintain constant absolute size.
- catch {destroy .mb}
menubutton .mb -image image1 -bd 2 -relief raised \
- -highlightthickness 2 -indicatoron 1
+ -highlightthickness 2 -indicatoron 1
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
-} {65 23}
+} -cleanup {
+ deleteWindows
+ imageCleanup
+} -result {65 23}
-set l [interp hidden]
-deleteWindows
-test menubutton-8.1 {menubutton vs hidden commands} {
- catch {destroy .mb}
+test menubutton-8.1 {menubutton vs hidden commands} -body {
+ set l [interp hidden]
+ deleteWindows
menubutton .mb
interp hide {} .mb
destroy .mb
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 eq $res2}
+} -result 1
+
+
-eval image delete [image names]
deleteWindows
option clear
+imageFinish
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/message.test b/tests/message.test
index 93344c4..dcffc72 100644
--- a/tests/message.test
+++ b/tests/message.test
@@ -6,115 +6,469 @@
# Copyright (c) 1998-2000 by Ajuba Solutions.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
tcltest::loadTestedCommands
+eval tcltest::configure $argv
+
+
+test message-1.1 {configuration option: "anchor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -anchor w
+ .m cget -anchor
+} -cleanup {
+ destroy .m
+} -result {w}
+test message-1.2 {configuration option: "anchor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -anchor bogus
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
+
+test message-1.3 {configuration option: "aspect"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -aspect 3
+ .m cget -aspect
+} -cleanup {
+ destroy .m
+} -result {3}
+test message-1.4 {configuration option: "aspect"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -aspect bogus
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {expected integer but got "bogus"}
+
+test message-1.5 {configuration option: "background"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -background #ff0000
+ .m cget -background
+} -cleanup {
+ destroy .m
+} -result {#ff0000}
+test message-1.6 {configuration option: "background"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -background non-existent
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test message-1.7 {configuration option: "bd"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -bd 4
+ .m cget -bd
+} -cleanup {
+ destroy .m
+} -result {4}
+test message-1.8 {configuration option: "bd"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -bd badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test message-1.9 {configuration option: "bg"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -bg #ff0000
+ .m cget -bg
+} -cleanup {
+ destroy .m
+} -result {#ff0000}
+test message-1.10 {configuration option: "bg"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -bg non-existent
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test message-1.11 {configuration option: "borderwidth"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -borderwidth 1.3
+ .m cget -borderwidth
+} -cleanup {
+ destroy .m
+} -result {1}
+test message-1.12 {configuration option: "borderwidth"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -borderwidth badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test message-1.13 {configuration option: "cursor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -cursor arrow
+ .m cget -cursor
+} -cleanup {
+ destroy .m
+} -result {arrow}
+test message-1.14 {configuration option: "cursor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -cursor badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+
+test message-1.15 {configuration option: "fg"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -fg #00ff00
+ .m cget -fg
+} -cleanup {
+ destroy .m
+} -result {#00ff00}
+test message-1.16 {configuration option: "fg"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -fg badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "badValue"}
+
+test message-1.17 {configuration option: "font"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -font fixed
+ .m cget -font
+} -cleanup {
+ destroy .m
+} -result {fixed}
+test message-1.18 {configuration option: "font"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -font {}
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {font "" doesn't exist}
+
+test message-1.19 {configuration option: "-foreground"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -foreground green
+ .m cget -foreground
+} -cleanup {
+ destroy .m
+} -result {green}
+test message-1.20 {configuration option: "-foreground"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -foreground badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "badValue"}
-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} {
+test message-1.21 {configuration option: "highlightbackground"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightbackground #112233
+ .m cget -highlightbackground
+} -cleanup {
+ destroy .m
+} -result {#112233}
+test message-1.22 {configuration option: "highlightbackground"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightbackground ugly
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "ugly"}
+
+test message-1.23 {configuration option: "highlightcolor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightcolor #123456
+ .m cget -highlightcolor
+} -cleanup {
+ destroy .m
+} -result {#123456}
+test message-1.24 {configuration option: "highlightcolor"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightcolor non-existent
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test message-1.25 {configuration option: "highlightthickness"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightthickness 2
+ .m cget -highlightthickness
+} -cleanup {
+ destroy .m
+} -result {2}
+test message-1.26 {configuration option: "highlightthickness"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -highlightthickness badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test message-1.27 {configuration option: "justify"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -justify right
+ .m cget -justify
+} -cleanup {
+ destroy .m
+} -result {right}
+test message-1.28 {configuration option: "justify"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -justify bogus
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+
+test message-1.29 {configuration option: "padx"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -padx 12m
+ .m cget -padx
+} -cleanup {
+ destroy .m
+} -result {12m}
+test message-1.30 {configuration option: "padx"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -padx 420x
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "420x"}
+
+test message-1.31 {configuration option: "pady"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -pady 12m
+ .m cget -pady
+} -cleanup {
+ destroy .m
+} -result {12m}
+test message-1.32 {configuration option: "pady"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -pady 420x
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "420x"}
+
+test message-1.33 {configuration option: "relief"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -relief ridge
+ .m cget -relief
+} -cleanup {
+ destroy .m
+} -result {ridge}
+test message-1.34 {configuration option: "relief"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -relief badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+
+test message-1.35 {configuration options: "text"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -text "Sample text"
+ .m cget -text
+} -cleanup {
+ destroy .m
+} -result {Sample text}
+
+test message-1.36 {configuration option: "textvariable"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -textvariable i
+ .m cget -textvariable
+} -cleanup {
+ destroy .m
+} -result {i}
+
+test message-1.37 {configuration option: "width"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -width 2
+ .m cget -width
+} -cleanup {
+ destroy .m
+} -result {2}
+test message-1.38 {configuration option: "width"} -setup {
+ message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
+ pack .m
+ update
+} -body {
+ .m configure -width badValue
+} -cleanup {
+ destroy .m
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+
+test message-2.1 {Tk_MessageObjCmd procedure} -body {
+ message
+} -returnCodes {error} -result {wrong # args: should be "message pathName ?-option value ...?"}
+
+test message-2.2 {Tk_MessageObjCmd procedure} -body {
+ message foo
+} -returnCodes {error} -result {bad window path name "foo"}
+test message-2.3 {Tk_MessageObjCmd procedure} -body {
+ catch {message foo}
+ winfo child .
+} -result {}
+
+test message-2.4 {Tk_MessageObjCmd procedure} -body {
+ message .s -gorp dump
+} -returnCodes {error} -result {unknown option "-gorp"}
+test message-2.5 {Tk_MessageObjCmd procedure} -body {
+ catch {message .s -gorp dump}
+ winfo child .
+} -result {}
+
+
+test message-3.1 {MessageWidgetObjCmd procedure} -setup {
message .m
- set result [list [catch {.m} msg] $msg]
+} -body {
+ .m
+} -cleanup {
destroy .m
- set result
-} {1 {wrong # args: should be ".m option ?arg arg ...?"}}
-test message-3.2 {MessageWidgetObjCmd procedure, "cget"} {
+} -returnCodes error -result {wrong # args: should be ".m option ?arg ...?"}
+test message-3.2 {MessageWidgetObjCmd procedure, "cget"} -setup {
message .m
- set result [list [catch {.m cget} msg] $msg]
+} -body {
+ .m cget
+} -cleanup {
destroy .m
- set result
-} {1 {wrong # args: should be ".m cget option"}}
-test message-3.3 {MessageWidgetObjCmd procedure, "cget"} {
+} -returnCodes error -result {wrong # args: should be ".m cget option"}
+test message-3.3 {MessageWidgetObjCmd procedure, "cget"} -setup {
message .m
- set result [list [catch {.m cget -gorp} msg] $msg]
+} -body {
+ .m cget -gorp
+} -cleanup {
destroy .m
- set result
-} {1 {unknown option "-gorp"}}
-test message-3.4 {MessageWidgetObjCmd procedure, "cget"} {
+} -returnCodes error -result {unknown option "-gorp"}
+
+test message-3.4 {MessageWidgetObjCmd procedure, "configure"} -setup {
message .m
+} -body {
.m configure -text foobar
- set result [.m cget -text]
+ lindex [.m configure -text] 4
+} -cleanup {
destroy .m
- set result
-} "foobar"
-test message-3.5 {MessageWidgetObjCmd procedure, "configure"} {
+} -result {foobar}
+test message-3.5 {MessageWidgetObjCmd procedure, "configure"} -setup {
message .m
- set result [llength [.m configure]]
+} -body {
+ llength [.m configure]
+} -cleanup {
destroy .m
- set result
-} 21
-test message-3.6 {MessageWidgetObjCmd procedure, "configure"} {
+} -result {21}
+test message-3.6 {MessageWidgetObjCmd procedure, "configure"} -setup {
message .m
- set result [list [catch {.m configure -foo} msg] $msg]
+} -body {
+ .m configure -foo
+} -cleanup {
destroy .m
- set result
-} {1 {unknown option "-foo"}}
-test message-3.7 {MessageWidgetObjCmd procedure, "configure"} {
+} -returnCodes error -result {unknown option "-foo"}
+test message-3.7 {MessageWidgetObjCmd procedure, "configure"} -setup {
message .m
+} -body {
.m configure -bd 4
.m configure -bg #ffffff
- set result [lindex [.m configure -bd] 4]
+ lindex [.m configure -bd] 4
+} -cleanup {
destroy .m
- set result
-} {4}
+} -result {4}
-# cleanup
cleanupTests
return
diff --git a/tests/msgbox.test b/tests/msgbox.test
index ec98c89..643ae2c 100644
--- a/tests/msgbox.test
+++ b/tests/msgbox.test
@@ -5,65 +5,79 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
-test msgbox-1.1 {tk_messageBox command} {
- list [catch {tk_messageBox -foo} msg] $msg
-} {1 {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}}
-test msgbox-1.2 {tk_messageBox command} {
- list [catch {tk_messageBox -foo bar} msg] $msg
-} {1 {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}}
-
-catch {tk_messageBox -foo bar} msg
-regsub -all , $msg "" options
-regsub \"-foo\" $options "" options
-
-foreach option $options {
- if {[string index $option 0] eq "-"} {
- test msgbox-1.3$option {tk_messageBox command} -body {
- tk_messageBox $option
- } -returnCodes error -result "value for \"$option\" missing"
- }
-}
-test msgbox-1.4 {tk_messageBox command} {
- list [catch {tk_messageBox -default} msg] $msg
-} {1 {value for "-default" missing}}
+test msgbox-1.1 {tk_messageBox command} -body {
+ tk_messageBox -foo
+} -returnCodes error -result {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}
+test msgbox-1.2 {tk_messageBox command} -body {
+ tk_messageBox -foo bar
+} -returnCodes error -result {bad option "-foo": must be -default, -detail, -icon, -message, -parent, -title, or -type}
-test msgbox-1.5 {tk_messageBox command} {
- list [catch {tk_messageBox -type foo} msg] $msg
-} {1 {bad -type value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}}
+test msgbox-1.3 {tk_messageBox command} -body {
+ tk_messageBox -default
+} -returnCodes error -result {value for "-default" missing}
+test msgbox-1.4 {tk_messageBox command} -body {
+ tk_messageBox -detail
+} -returnCodes error -result {value for "-detail" missing}
+test msgbox-1.5 {tk_messageBox command} -body {
+ tk_messageBox -icon
+} -returnCodes error -result {value for "-icon" missing}
+test msgbox-1.6 {tk_messageBox command} -body {
+ tk_messageBox -message
+} -returnCodes error -result {value for "-message" missing}
+test msgbox-1.7 {tk_messageBox command} -body {
+ tk_messageBox -parent
+} -returnCodes error -result {value for "-parent" missing}
+test msgbox-1.8 {tk_messageBox command} -body {
+ tk_messageBox -title
+} -returnCodes error -result {value for "-title" missing}
+test msgbox-1.9 {tk_messageBox command} -body {
+ tk_messageBox -type
+} -returnCodes error -result {value for "-type" missing}
-proc createPlatformMsg {val} {
- global tcl_platform
- if {$tcl_platform(platform) == "unix"} {
- return "invalid default button \"$val\""
- }
- return "bad -default value \"$val\": must be abort, retry, ignore, ok, cancel, no, or yes"
-}
+test msgbox-1.10 {tk_messageBox command} -body {
+ tk_messageBox -default
+} -returnCodes error -result {value for "-default" missing}
+
+test msgbox-1.11 {tk_messageBox command} -body {
+ tk_messageBox -type foo
+} -returnCodes error -result {bad -type value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}
-test msgbox-1.6 {tk_messageBox command} {
- list [catch {tk_messageBox -default 1.1} msg] $msg
-} [list 1 [createPlatformMsg "1.1"]]
+test msgbox-1.12 {tk_messageBox command} -constraints unix -body {
+ tk_messageBox -default 1.1
+} -returnCodes error -result {invalid default button "1.1"}
+test msgbox-1.13 {tk_messageBox command} -constraints macOrWin -body {
+ tk_messageBox -default 1.1
+} -returnCodes error -result {bad -default value "1.1": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.7 {tk_messageBox command} {
- list [catch {tk_messageBox -default foo} msg] $msg
-} [list 1 [createPlatformMsg "foo"]]
+test msgbox-1.14 {tk_messageBox command} -constraints unix -body {
+ tk_messageBox -default foo
+} -returnCodes error -result {invalid default button "foo"}
+test msgbox-1.15 {tk_messageBox command} -constraints macOrWin -body {
+ tk_messageBox -default foo
+} -returnCodes error -result {bad -default value "foo": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.8 {tk_messageBox command} {
- list [catch {tk_messageBox -type yesno -default 3} msg] $msg
-} [list 1 [createPlatformMsg "3"]]
+test msgbox-1.16 {tk_messageBox command} -constraints unix -body {
+ tk_messageBox -type yesno -default 3
+} -returnCodes error -result {invalid default button "3"}
+test msgbox-1.17 {tk_messageBox command} -constraints macOrWin -body {
+ tk_messageBox -type yesno -default 3
+} -returnCodes error -result {bad -default value "3": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.9 {tk_messageBox command} {
- list [catch {tk_messageBox -icon foo} msg] $msg
-} {1 {bad -icon value "foo": must be error, info, question, or warning}}
+test msgbox-1.18 {tk_messageBox command} -body {
+ tk_messageBox -icon foo
+} -returnCodes error -result {bad -icon value "foo": must be error, info, question, or warning}
+test msgbox-1.19 {tk_messageBox command} -body {
+ tk_messageBox -parent foo.bar
+} -returnCodes error -result {bad window path name "foo.bar"}
-test msgbox-1.10 {tk_messageBox command} {
- list [catch {tk_messageBox -parent foo.bar} msg] $msg
-} {1 {bad window path name "foo.bar"}}
+catch {tk_messageBox -foo bar}
set isNative [expr {[info commands tk::MessageBox] == ""}]
proc ChooseMsg {parent btn} {
@@ -104,72 +118,332 @@ proc SendEventToMsg {parent btn type} {
event generate $w <KeyPress> -keysym Return
}
}
-
-set parent .
-
-set specs {
- {"abortretryignore" MB_ABORTRETRYIGNORE 3 {"abort" "retry" "ignore"}}
- {"ok" MB_OK 1 {"ok" }}
- {"okcancel" MB_OKCANCEL 2 {"ok" "cancel" }}
- {"retrycancel" MB_RETRYCANCEL 2 {"retry" "cancel" }}
- {"yesno" MB_YESNO 2 {"yes" "no" }}
- {"yesnocancel" MB_YESNOCANCEL 3 {"yes" "no" "cancel"}}
-}
-
#
# Try out all combinations of (type) x (default button) and
# (type) x (icon).
#
-set count 1
-foreach spec $specs {
- set type [lindex $spec 0]
- set buttons [lindex $spec 3]
-
- set button [lindex $buttons 0]
- test msgbox-2.$count {tk_messageBox command} nonUnixUserInteraction {
- ChooseMsg $parent $button
- tk_messageBox -title Hi -message "Please press $button" \
- -type $type
- } $button
- incr count
-
- foreach icon {warning error info question} {
- test msgbox-2.$count {tk_messageBox command -icon option} \
- nonUnixUserInteraction {
- ChooseMsg $parent $button
- tk_messageBox -title Hi -message "Please press $button" \
- -type $type -icon $icon
- } $button
- incr count
- }
+test msgbox-2.1 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" -type abortretryignore
+} -result {abort}
+test msgbox-2.2 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" \
+ -type abortretryignore -icon warning
+} -result {abort}
+test msgbox-2.3 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" \
+ -type abortretryignore -icon error
+} -result {abort}
+test msgbox-2.4 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" \
+ -type abortretryignore -icon info
+} -result {abort}
+test msgbox-2.5 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" \
+ -type abortretryignore -icon question
+} -result {abort}
+test msgbox-2.6 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . abort
+ tk_messageBox -title Hi -message "Please press abort" \
+ -type abortretryignore -default abort
+} -result {abort}
+test msgbox-2.7 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type abortretryignore -default retry
+} -result {retry}
+test msgbox-2.8 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ignore
+ tk_messageBox -title Hi -message "Please press ignore" \
+ -type abortretryignore -default ignore
+} -result {ignore}
+test msgbox-2.9 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" -type ok
+} -result {ok}
+test msgbox-2.10 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type ok -icon warning
+} -result {ok}
+test msgbox-2.11 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type ok -icon error
+} -result {ok}
+test msgbox-2.12 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type ok -icon info
+} -result {ok}
+test msgbox-2.13 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type ok -icon question
+} -result {ok}
+test msgbox-2.14 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type ok -default ok
+} -result {ok}
+test msgbox-2.15 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" -type okcancel
+} -result {ok}
+test msgbox-2.16 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type okcancel -icon warning
+} -result {ok}
+test msgbox-2.17 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type okcancel -icon error
+} -result {ok}
+test msgbox-2.18 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type okcancel -icon info
+} -result {ok}
+test msgbox-2.19 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type okcancel -icon question
+} -result {ok}
+test msgbox-2.20 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . ok
+ tk_messageBox -title Hi -message "Please press ok" \
+ -type okcancel -default ok
+} -result {ok}
+test msgbox-2.21 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . cancel
+ tk_messageBox -title Hi -message "Please press cancel" \
+ -type okcancel -default cancel
+} -result {cancel}
+test msgbox-2.22 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" -type retrycancel
+} -result {retry}
+test msgbox-2.23 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type retrycancel -icon warning
+} -result {retry}
+test msgbox-2.24 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type retrycancel -icon error
+} -result {retry}
+test msgbox-2.25 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type retrycancel -icon info
+} -result {retry}
+test msgbox-2.26 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type retrycancel -icon question
+} -result {retry}
+test msgbox-2.27 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . retry
+ tk_messageBox -title Hi -message "Please press retry" \
+ -type retrycancel -default retry
+} -result {retry}
+test msgbox-2.28 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . cancel
+ tk_messageBox -title Hi -message "Please press cancel" \
+ -type retrycancel -default cancel
+} -result {cancel}
+test msgbox-2.29 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" -type yesno
+} -result {yes}
+test msgbox-2.30 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesno -icon warning
+} -result {yes}
+test msgbox-2.31 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesno -icon error
+} -result {yes}
+test msgbox-2.32 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesno -icon info
+} -result {yes}
+test msgbox-2.33 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesno -icon question
+} -result {yes}
+test msgbox-2.34 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesno -default yes
+} -result {yes}
+test msgbox-2.35 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . no
+ tk_messageBox -title Hi -message "Please press no" \
+ -type yesno -default no
+} -result {no}
+test msgbox-2.36 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" -type yesnocancel
+} -result {yes}
+test msgbox-2.37 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesnocancel -icon warning
+} -result {yes}
+test msgbox-2.38 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesnocancel -icon error
+} -result {yes}
+test msgbox-2.39 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesnocancel -icon info
+} -result {yes}
+test msgbox-2.40 {tk_messageBox command -icon option} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesnocancel -icon question
+} -result {yes}
+test msgbox-2.41 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . yes
+ tk_messageBox -title Hi -message "Please press yes" \
+ -type yesnocancel -default yes
+} -result {yes}
+test msgbox-2.42 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . no
+ tk_messageBox -title Hi -message "Please press no" \
+ -type yesnocancel -default no
+} -result {no}
+test msgbox-2.43 {tk_messageBox command} -constraints {
+ nonUnixUserInteraction
+} -body {
+ ChooseMsg . cancel
+ tk_messageBox -title Hi -message "Please press cancel" \
+ -type yesnocancel -default cancel
+} -result {cancel}
- foreach button $buttons {
- test msgbox-2.$count {tk_messageBox command} nonUnixUserInteraction {
- ChooseMsg $parent $button
- tk_messageBox -title Hi -message "Please press $button" \
- -type $type -default $button
- } "$button"
- incr count
- }
-}
# These tests will hang your test suite if they fail.
-test msgbox-3.1 {tk_messageBox handles withdrawn parent} nonUnixUserInteraction {
+test msgbox-3.1 {tk_messageBox handles withdrawn parent} -constraints {
+ nonUnixUserInteraction
+} -body {
wm withdraw .
ChooseMsg . "ok"
tk_messageBox -title Hi -message "Please press ok" \
-type ok -default ok
-} "ok"
-wm deiconify .
+} -cleanup {
+ wm deiconify .
+} -result {ok}
-test msgbox-3.2 {tk_messageBox handles iconified parent} nonUnixUserInteraction {
+test msgbox-3.2 {tk_messageBox handles iconified parent} -constraints {
+ nonUnixUserInteraction
+} -body {
wm iconify .
ChooseMsg . "ok"
tk_messageBox -title Hi -message "Please press ok" \
-type ok -default ok
-} "ok"
-wm deiconify .
+} -cleanup {
+ wm deiconify .
+} -result {ok}
# cleanup
cleanupTests
return
+
+
diff --git a/tests/obj.test b/tests/obj.test
index 25bd70f..eece58e 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -5,26 +5,24 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test obj-1.1 {TkGetPixelsFromObj} {
-} {}
+test obj-1.1 {TkGetPixelsFromObj} -body {
+} -result {}
-test obj-2.1 {FreePixelInternalRep} {
-} {}
+test obj-2.1 {FreePixelInternalRep} -body {
+} -result {}
-test obj-3.1 {DupPixelInternalRep} {
-} {}
+test obj-3.1 {DupPixelInternalRep} -body {
+} -result {}
-test obj-4.1 {SetPixelFromAny} {
-} {}
+test obj-4.1 {SetPixelFromAny} -body {
+} -result {}
-
-deleteWindows
-
# cleanup
cleanupTests
return
diff --git a/tests/oldpack.test b/tests/oldpack.test
index 2f9b979..72ec065 100644
--- a/tests/oldpack.test
+++ b/tests/oldpack.test
@@ -7,13 +7,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
# First, test a single window packed in various ways in a parent
-catch {destroy .pack}
+destroy .pack
frame .pack
place .pack -width 100 -height 100
frame .pack.red -width 10 -height 20
@@ -29,189 +30,189 @@ frame .pack.violet -width 80 -height 20
label .pack.violet.l -text P -bd 2 -relief raised
place .pack.violet.l -relwidth 1.0 -relheight 1.0
-test oldpack-1.1 {basic positioning} {
+test oldpack-1.1 {basic positioning} -body {
pack ap .pack .pack.red top
update
winfo geometry .pack.red
-} 10x20+45+0
-test oldpack-1.2 {basic positioning} {
+} -result 10x20+45+0
+test oldpack-1.2 {basic positioning} -body {
pack append .pack .pack.red bottom
update
winfo geometry .pack.red
-} 10x20+45+80
-test oldpack-1.3 {basic positioning} {
+} -result 10x20+45+80
+test oldpack-1.3 {basic positioning} -body {
pack append .pack .pack.red left
update
winfo geometry .pack.red
-} 10x20+0+40
-test oldpack-1.4 {basic positioning} {
+} -result 10x20+0+40
+test oldpack-1.4 {basic positioning} -body {
pack append .pack .pack.red right
update
winfo geometry .pack.red
-} 10x20+90+40
+} -result 10x20+90+40
# Try adding padding around the window and make sure that the
# window gets a larger frame.
-test oldpack-2.1 {padding} {
+test oldpack-2.1 {padding} -body {
pack append .pack .pack.red {t padx 20}
update
winfo geometry .pack.red
-} 10x20+45+0
-test oldpack-2.2 {padding} {
+} -result 10x20+45+0
+test oldpack-2.2 {padding} -body {
pack append .pack .pack.red {top pady 20}
update
winfo geometry .pack.red
-} 10x20+45+10
-test oldpack-2.3 {padding} {
+} -result 10x20+45+10
+test oldpack-2.3 {padding} -body {
pack append .pack .pack.red {l padx 20}
update
winfo geometry .pack.red
-} 10x20+10+40
-test oldpack-2.4 {padding} {
+} -result 10x20+10+40
+test oldpack-2.4 {padding} -body {
pack append .pack .pack.red {left pady 20}
update
winfo geometry .pack.red
-} 10x20+0+40
+} -result 10x20+0+40
# Position the window at different positions in its frame to
# make sure they all work. Try two differenet frame locations,
# to make sure that frame offsets are being added in correctly.
-test oldpack-3.1 {framing} {
+test oldpack-3.1 {framing} -body {
pack append .pack .pack.red {b padx 20 pady 30}
update
winfo geometry .pack.red
-} 10x20+45+65
-test oldpack-3.2 {framing} {
+} -result 10x20+45+65
+test oldpack-3.2 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 fr n}
update
winfo geometry .pack.red
-} 10x20+45+50
-test oldpack-3.3 {framing} {
+} -result 10x20+45+50
+test oldpack-3.3 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame ne}
update
winfo geometry .pack.red
-} 10x20+90+50
-test oldpack-3.4 {framing} {
+} -result 10x20+90+50
+test oldpack-3.4 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame e}
update
winfo geometry .pack.red
-} 10x20+90+65
-test oldpack-3.5 {framing} {
+} -result 10x20+90+65
+test oldpack-3.5 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame se}
update
winfo geometry .pack.red
-} 10x20+90+80
-test oldpack-3.6 {framing} {
+} -result 10x20+90+80
+test oldpack-3.6 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame s}
update
winfo geometry .pack.red
-} 10x20+45+80
-test oldpack-3.7 {framing} {
+} -result 10x20+45+80
+test oldpack-3.7 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame sw}
update
winfo geometry .pack.red
-} 10x20+0+80
-test oldpack-3.8 {framing} {
+} -result 10x20+0+80
+test oldpack-3.8 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame w}
update
winfo geometry .pack.red
-} 10x20+0+65
-test oldpack-3.9 {framing} {
+} -result 10x20+0+65
+test oldpack-3.9 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame nw}
update
winfo geometry .pack.red
-} 10x20+0+50
-test oldpack-3.10 {framing} {
+} -result 10x20+0+50
+test oldpack-3.10 {framing} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 frame c}
update
winfo geometry .pack.red
-} 10x20+45+65
-test oldpack-3.11 {framing} {
+} -result 10x20+45+65
+test oldpack-3.11 {framing} -body {
pack append .pack .pack.red {r padx 20 pady 30}
update
winfo geometry .pack.red
-} 10x20+80+40
-test oldpack-3.12 {framing} {
+} -result 10x20+80+40
+test oldpack-3.12 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame n}
update
winfo geometry .pack.red
-} 10x20+80+0
-test oldpack-3.13 {framing} {
+} -result 10x20+80+0
+test oldpack-3.13 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame ne}
update
winfo geometry .pack.red
-} 10x20+90+0
-test oldpack-3.14 {framing} {
+} -result 10x20+90+0
+test oldpack-3.14 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame e}
update
winfo geometry .pack.red
-} 10x20+90+40
-test oldpack-3.15 {framing} {
+} -result 10x20+90+40
+test oldpack-3.15 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame se}
update
winfo geometry .pack.red
-} 10x20+90+80
-test oldpack-3.16 {framing} {
+} -result 10x20+90+80
+test oldpack-3.16 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame s}
update
winfo geometry .pack.red
-} 10x20+80+80
-test oldpack-3.17 {framing} {
+} -result 10x20+80+80
+test oldpack-3.17 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame sw}
update
winfo geometry .pack.red
-} 10x20+70+80
-test oldpack-3.18 {framing} {
+} -result 10x20+70+80
+test oldpack-3.18 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame w}
update
winfo geometry .pack.red
-} 10x20+70+40
-test oldpack-3.19 {framing} {
+} -result 10x20+70+40
+test oldpack-3.19 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame nw}
update
winfo geometry .pack.red
-} 10x20+70+0
-test oldpack-3.20 {framing} {
+} -result 10x20+70+0
+test oldpack-3.20 {framing} -body {
pack append .pack .pack.red {right padx 20 pady 30 frame center}
update
winfo geometry .pack.red
-} 10x20+80+40
+} -result 10x20+80+40
# Try out various filling combinations in a couple of different
# frame locations.
-test oldpack-4.1 {filling} {
+test oldpack-4.1 {filling} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 fillx}
update
winfo geometry .pack.red
-} 100x20+0+65
-test oldpack-4.2 {filling} {
+} -result 100x20+0+65
+test oldpack-4.2 {filling} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 filly}
update
winfo geometry .pack.red
-} 10x50+45+50
-test oldpack-4.3 {filling} {
+} -result 10x50+45+50
+test oldpack-4.3 {filling} -body {
pack append .pack .pack.red {bottom padx 20 pady 30 fill}
update
winfo geometry .pack.red
-} 100x50+0+50
-test oldpack-4.4 {filling} {
+} -result 100x50+0+50
+test oldpack-4.4 {filling} -body {
pack append .pack .pack.red {right padx 20 pady 30 fillx}
update
winfo geometry .pack.red
-} 30x20+70+40
-test oldpack-4.5 {filling} {
+} -result 30x20+70+40
+test oldpack-4.5 {filling} -body {
pack append .pack .pack.red {right padx 20 pady 30 filly}
update
winfo geometry .pack.red
-} 10x100+80+0
-test oldpack-4.6 {filling} {
+} -result 10x100+80+0
+test oldpack-4.6 {filling} -body {
pack append .pack .pack.red {right padx 20 pady 30 fill}
update
winfo geometry .pack.red
-} 30x100+70+0
+} -result 30x100+70+0
# Multiple windows: make sure that space is properly subtracted
# from the cavity as windows are positioned inwards from all
@@ -219,57 +220,128 @@ test oldpack-4.6 {filling} {
# there isn't enough space for them.
pack append .pack .pack.red top .pack.green top .pack.blue top \
- .pack.violet top
+ .pack.violet top
update
-test oldpack-5.1 {multiple windows} {winfo geometry .pack.red} 10x20+45+0
-test oldpack-5.2 {multiple windows} {winfo geometry .pack.green} 30x40+35+20
-test oldpack-5.3 {multiple windows} {winfo geometry .pack.blue} 40x40+30+60
-test oldpack-5.4 {multiple windows} {winfo ismapped .pack.violet} 0
+test oldpack-5.1 {multiple windows} -body {
+ winfo geometry .pack.red
+} -result 10x20+45+0
+test oldpack-5.2 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 30x40+35+20
+test oldpack-5.3 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x40+30+60
+test oldpack-5.4 {multiple windows} -body {
+ winfo ismapped .pack.violet
+} -result 0
+
pack b .pack.blue .pack.violet top
update
-test oldpack-5.5 {multiple windows} {winfo ismapped .pack.violet} 1
-test oldpack-5.6 {multiple windows} {winfo geometry .pack.violet} 80x20+10+60
-test oldpack-5.7 {multiple windows} {winfo geometry .pack.blue} 40x20+30+80
+test oldpack-5.5 {multiple windows} -body {
+ winfo ismapped .pack.violet
+} -result 1
+test oldpack-5.6 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 80x20+10+60
+test oldpack-5.7 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x20+30+80
+
pack after .pack.blue .pack.red top
update
-test oldpack-5.8 {multiple windows} {winfo geometry .pack.green} 30x40+35+0
-test oldpack-5.9 {multiple windows} {winfo geometry .pack.violet} 80x20+10+40
-test oldpack-5.10 {multiple windows} {winfo geometry .pack.blue} 40x40+30+60
-test oldpack-5.11 {multiple windows} {winfo ismapped .pack.red} 0
+test oldpack-5.8 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 30x40+35+0
+test oldpack-5.9 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 80x20+10+40
+test oldpack-5.10 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x40+30+60
+test oldpack-5.11 {multiple windows} -body {
+ winfo ismapped .pack.red
+} -result 0
+
pack before .pack.green .pack.red right .pack.blue left
update
-test oldpack-5.12 {multiple windows} {winfo ismapped .pack.red} 1
-test oldpack-5.13 {multiple windows} {winfo geometry .pack.red} 10x20+90+40
-test oldpack-5.14 {multiple windows} {winfo geometry .pack.blue} 40x40+0+30
-test oldpack-5.15 {multiple windows} {winfo geometry .pack.green} 30x40+50+0
-test oldpack-5.16 {multiple windows} {winfo geometry .pack.violet} 50x20+40+40
+test oldpack-5.12 {multiple windows} -body {
+ winfo ismapped .pack.red
+} -result 1
+test oldpack-5.13 {multiple windows} -body {
+ winfo geometry .pack.red
+} -result 10x20+90+40
+test oldpack-5.14 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x40+0+30
+test oldpack-5.15 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 30x40+50+0
+test oldpack-5.16 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 50x20+40+40
+
pack append .pack .pack.violet left .pack.green bottom .pack.red bottom \
- .pack.blue bottom
+ .pack.blue bottom
update
-test oldpack-5.17 {multiple windows} {winfo geometry .pack.violet} 80x20+0+40
-test oldpack-5.18 {multiple windows} {winfo geometry .pack.green} 20x40+80+60
-test oldpack-5.19 {multiple windows} {winfo geometry .pack.red} 10x20+85+40
-test oldpack-5.20 {multiple windows} {winfo geometry .pack.blue} 20x40+80+0
+test oldpack-5.17 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 80x20+0+40
+test oldpack-5.18 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 20x40+80+60
+test oldpack-5.19 {multiple windows} -body {
+ winfo geometry .pack.red
+} -result 10x20+85+40
+test oldpack-5.20 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 20x40+80+0
+
pack after .pack.blue .pack.blue top .pack.red right .pack.green right \
- .pack.violet right
+ .pack.violet right
update
-test oldpack-5.21 {multiple windows} {winfo geometry .pack.blue} 40x40+30+0
-test oldpack-5.22 {multiple windows} {winfo geometry .pack.red} 10x20+90+60
-test oldpack-5.23 {multiple windows} {winfo geometry .pack.green} 30x40+60+50
-test oldpack-5.24 {multiple windows} {winfo geometry .pack.violet} 60x20+0+60
+test oldpack-5.21 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x40+30+0
+test oldpack-5.22 {multiple windows} -body {
+ winfo geometry .pack.red
+} -result 10x20+90+60
+test oldpack-5.23 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 30x40+60+50
+test oldpack-5.24 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 60x20+0+60
+
pack after .pack.blue .pack.red left .pack.green left .pack.violet left
update
-test oldpack-5.25 {multiple windows} {winfo geometry .pack.blue} 40x40+30+0
-test oldpack-5.26 {multiple windows} {winfo geometry .pack.red} 10x20+0+60
-test oldpack-5.27 {multiple windows} {winfo geometry .pack.green} 30x40+10+50
-test oldpack-5.28 {multiple windows} {winfo geometry .pack.violet} 60x20+40+60
+test oldpack-5.25 {multiple windows} -body {
+ winfo geometry .pack.blue
+} -result 40x40+30+0
+test oldpack-5.26 {multiple windows} -body {
+ winfo geometry .pack.red
+} -result 10x20+0+60
+test oldpack-5.27 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 30x40+10+50
+test oldpack-5.28 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 60x20+40+60
+
pack append .pack .pack.violet left .pack.green left .pack.blue left \
- .pack.red left
+ .pack.red left
update
-test oldpack-5.29 {multiple windows} {winfo geometry .pack.violet} 80x20+0+40
-test oldpack-5.30 {multiple windows} {winfo geometry .pack.green} 20x40+80+30
-test oldpack-5.31 {multiple windows} {winfo ismapped .pack.blue} 0
-test oldpack-5.32 {multiple windows} {winfo ismapped .pack.red} 0
+test oldpack-5.29 {multiple windows} -body {
+ winfo geometry .pack.violet
+} -result 80x20+0+40
+test oldpack-5.30 {multiple windows} -body {
+ winfo geometry .pack.green
+} -result 20x40+80+30
+test oldpack-5.31 {multiple windows} -body {
+ winfo ismapped .pack.blue
+} -result 0
+test oldpack-5.32 {multiple windows} -body {
+ winfo ismapped .pack.red
+} -result 0
# Test the ability of the packer to propagate geometry information
@@ -279,84 +351,92 @@ test oldpack-5.32 {multiple windows} {winfo ismapped .pack.red} 0
# "left" and "right" windows).
pack append .pack .pack.red top .pack.green top .pack.blue top \
- .pack.violet top
+ .pack.violet top
update
-test oldpack-6.1 {geometry propagation} {winfo reqwidth .pack} 80
-test oldpack-6.2 {geometry propagation} {winfo reqheight .pack} 120
+test oldpack-6.1 {geometry propagation} -body {
+ winfo reqwidth .pack} -result 80
+test oldpack-6.2 {geometry propagation} -body {
+ winfo reqheight .pack} -result 120
destroy .pack.violet
update
-test oldpack-6.3 {geometry propagation} {winfo reqwidth .pack} 40
-test oldpack-6.4 {geometry propagation} {winfo reqheight .pack} 100
+test oldpack-6.3 {geometry propagation} -body {
+ winfo reqwidth .pack} -result 40
+test oldpack-6.4 {geometry propagation} -body {
+ winfo reqheight .pack} -result 100
frame .pack.violet -width 80 -height 20 -bg violet
label .pack.violet.l -text P -bd 2 -relief raised
place .pack.violet.l -relwidth 1.0 -relheight 1.0
pack append .pack .pack.red left .pack.green right .pack.blue bottom \
- .pack.violet top
+ .pack.violet top
update
-test oldpack-6.5 {geometry propagation} {winfo reqwidth .pack} 120
-test oldpack-6.6 {geometry propagation} {winfo reqheight .pack} 60
+test oldpack-6.5 {geometry propagation} -body {
+ winfo reqwidth .pack} -result 120
+test oldpack-6.6 {geometry propagation} -body {
+ winfo reqheight .pack} -result 60
pack append .pack .pack.violet top .pack.green top .pack.blue left \
- .pack.red left
+ .pack.red left
update
-test oldpack-6.7 {geometry propagation} {winfo reqwidth .pack} 80
-test oldpack-6.8 {geometry propagation} {winfo reqheight .pack} 100
+test oldpack-6.7 {geometry propagation} -body {
+ winfo reqwidth .pack} -result 80
+test oldpack-6.8 {geometry propagation} -body {
+ winfo reqheight .pack} -result 100
# Test the "expand" option, and make sure space is evenly divided
# when several windows request expansion.
pack append .pack .pack.violet top .pack.green {left e} \
- .pack.blue {left expand} .pack.red {left expand}
+ .pack.blue {left expand} .pack.red {left expand}
update
-test oldpack-7.1 {multiple expanded windows} {
+test oldpack-7.1 {multiple expanded windows} -body {
pack append .pack .pack.violet top .pack.green {left e} \
- .pack.blue {left expand} .pack.red {left expand}
+ .pack.blue {left expand} .pack.red {left expand}
update
list [winfo geometry .pack.green] [winfo geometry .pack.blue] \
- [winfo geometry .pack.red]
-} {30x40+3+40 40x40+39+40 10x20+86+50}
-test oldpack-7.2 {multiple expanded windows} {
+ [winfo geometry .pack.red]
+} -result {30x40+3+40 40x40+39+40 10x20+86+50}
+test oldpack-7.2 {multiple expanded windows} -body {
pack append .pack .pack.green left .pack.violet {bottom expand} \
- .pack.blue {bottom expand} .pack.red {bottom expand}
+ .pack.blue {bottom expand} .pack.red {bottom expand}
update
list [winfo geometry .pack.violet] [winfo geometry .pack.blue] \
- [winfo geometry .pack.red]
-} {70x20+30+77 40x40+45+30 10x20+60+3}
-test oldpack-7.3 {multiple expanded windows} {
+ [winfo geometry .pack.red]
+} -result {70x20+30+77 40x40+45+30 10x20+60+3}
+test oldpack-7.3 {multiple expanded windows} -body {
foreach i [winfo child .pack] {
- pack unpack $i
+ pack unpack $i
}
pack append .pack .pack.green {left e fill} .pack.red {left expand fill} \
- .pack.blue {top fill}
+ .pack.blue {top fill}
update
list [winfo geometry .pack.green] [winfo geometry .pack.red] \
- [winfo geometry .pack.blue]
-} {40x100+0+0 20x100+40+0 40x40+60+0}
-test oldpack-7.4 {multiple expanded windows} {
+ [winfo geometry .pack.blue]
+} -result {40x100+0+0 20x100+40+0 40x40+60+0}
+test oldpack-7.4 {multiple expanded windows} -body {
foreach i [winfo child .pack] {
- pack unpack $i
+ pack unpack $i
}
pack append .pack .pack.red {top expand} .pack.violet {top expand} \
- .pack.blue {right fill}
+ .pack.blue {right fill}
update
list [winfo geometry .pack.red] [winfo geometry .pack.violet] \
- [winfo geometry .pack.blue]
-} {10x20+45+5 80x20+10+35 40x40+60+60}
-test oldpack-7.5 {multiple expanded windows} {
+ [winfo geometry .pack.blue]
+} -result {10x20+45+5 80x20+10+35 40x40+60+60}
+test oldpack-7.5 {multiple expanded windows} -body {
foreach i [winfo child .pack] {
- pack unpack $i
+ pack unpack $i
}
pack append .pack .pack.green {right frame s} .pack.red {top expand}
update
list [winfo geometry .pack.green] [winfo geometry .pack.red]
-} {30x40+70+60 10x20+30+40}
-test oldpack-7.6 {multiple expanded windows} {
+} -result {30x40+70+60 10x20+30+40}
+test oldpack-7.6 {multiple expanded windows} -body {
foreach i [winfo child .pack] {
- pack unpack $i
+ pack unpack $i
}
pack append .pack .pack.violet {bottom frame e} .pack.red {right expand}
update
list [winfo geometry .pack.violet] [winfo geometry .pack.red]
-} {80x20+20+80 10x20+45+30}
+} -result {80x20+20+80 10x20+45+30}
# Need more bizarre tests with combinations of expanded windows and
# windows in opposing directions! Also, include padding in expanded
@@ -364,146 +444,109 @@ test oldpack-7.6 {multiple expanded windows} {
# Syntax errors on pack commands
-test oldpack-8.1 {syntax errors} {
- set msg ""
- set result [catch {pack} msg]
- concat $result $msg
-} {1 wrong # args: should be "pack option arg ?arg ...?"}
-test oldpack-8.2 {syntax errors} {
- set msg ""
- set result [catch {pack append} msg]
- concat $result $msg
-} {1 wrong # args: should be "pack option arg ?arg ...?"}
-test oldpack-8.3 {syntax errors} {
- set msg ""
- set result [catch {pack gorp foo} msg]
- concat $result $msg
-} {1 bad option "gorp": must be configure, forget, info, propagate, or slaves}
-test oldpack-8.4 {syntax errors} {
- set msg ""
- set result [catch {pack a .pack} msg]
- concat $result $msg
-} {1 bad option "a": must be configure, forget, info, propagate, or slaves}
-test oldpack-8.5 {syntax errors} {
- set msg ""
- set result [catch {pack after foobar} msg]
- concat $result $msg
-} {1 bad window path name "foobar"}
-test oldpack-8.6 {syntax errors} {
+test oldpack-8.1 {syntax errors} -body {
+ pack
+} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
+test oldpack-8.2 {syntax errors} -body {
+ pack append
+} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
+test oldpack-8.3 {syntax errors} -body {
+ pack gorp foo
+} -returnCodes error -result {bad option "gorp": must be configure, forget, info, propagate, or slaves}
+test oldpack-8.4 {syntax errors} -body {
+ pack a .pack
+} -returnCodes error -result {bad option "a": must be configure, forget, info, propagate, or slaves}
+test oldpack-8.5 {syntax errors} -body {
+ pack after foobar
+} -returnCodes error -result {bad window path name "foobar"}
+test oldpack-8.6 {syntax errors} -setup {
+ destroy .pack.yellow
+} -body {
frame .pack.yellow -bg yellow
- set msg ""
- set result [catch {pack after .pack.yellow} msg]
+ pack after .pack.yellow
+} -cleanup {
destroy .pack.yellow
- concat $result $msg
-} {1 window ".pack.yellow" isn't packed}
-test oldpack-8.7 {syntax errors} {
- set msg ""
- set result [catch {pack append foobar} msg]
- concat $result $msg
-} {1 bad window path name "foobar"}
-test oldpack-8.8 {syntax errors} {
- set msg ""
- set result [catch {pack before foobar} msg]
- concat $result $msg
-} {1 bad window path name "foobar"}
-test oldpack-8.9 {syntax errors} {
+} -returnCodes error -result {window ".pack.yellow" isn't packed}
+test oldpack-8.7 {syntax errors} -body {
+ pack append foobar
+} -returnCodes error -result {bad window path name "foobar"}
+test oldpack-8.8 {syntax errors} -body {
+ pack before foobar
+} -returnCodes error -result {bad window path name "foobar"}
+test oldpack-8.9 {syntax errors} -setup {
+ destroy .pack.yellow
+} -body {
frame .pack.yellow -bg yellow
- set msg ""
- set result [catch {pack before .pack.yellow} msg]
+ pack before .pack.yellow
+} -cleanup {
destroy .pack.yellow
- concat $result $msg
-} {1 window ".pack.yellow" isn't packed}
-test oldpack-8.10 {syntax errors} {
- set msg ""
- set result [catch {pack info .pack help} msg]
- concat $result $msg
-} {1 wrong # args: should be "pack info window"}
-test oldpack-8.11 {syntax errors} {
- set msg ""
- set result [catch {pack info foobar} msg]
- concat $result $msg
-} {1 bad window path name "foobar"}
-test oldpack-8.12 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue} msg]
- concat $result $msg
-} {1 wrong # args: window ".pack.blue" should be followed by options}
-test oldpack-8.13 {syntax errors} {
- set msg ""
- set result [catch {pack append . .pack.blue top} msg]
- concat $result $msg
-} {1 can't pack .pack.blue inside .}
-test oldpack-8.14 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue f} msg]
- concat $result $msg
-} {1 bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame}
-test oldpack-8.15 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue pad} msg]
- concat $result $msg
-} {1 bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame}
-test oldpack-8.16 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue {frame south}} msg]
- concat $result $msg
-} {1 bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center}
-test oldpack-8.17 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue {padx -2}} msg]
- concat $result $msg
-} {1 bad pad value "-2": must be positive screen distance}
-test oldpack-8.18 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue {padx}} msg]
- concat $result $msg
-} {1 wrong # args: "padx" option must be followed by screen distance}
-test oldpack-8.19 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue {pady -2}} msg]
- concat $result $msg
-} {1 bad pad value "-2": must be positive screen distance}
-test oldpack-8.20 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue {pady}} msg]
- concat $result $msg
-} {1 wrong # args: "pady" option must be followed by screen distance}
-test oldpack-8.21 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue "\{abc"} msg]
- concat $result $msg
-} {1 unmatched open brace in list}
-test oldpack-8.22 {syntax errors} {
- set msg ""
- set result [catch {pack append .pack .pack.blue frame} msg]
- concat $result $msg
-} {1 wrong # args: "frame" option must be followed by anchor point}
+} -returnCodes error -result {window ".pack.yellow" isn't packed}
+test oldpack-8.10 {syntax errors} -body {
+ pack info .pack help
+} -returnCodes error -result {wrong # args: should be "pack info window"}
+test oldpack-8.11 {syntax errors} -body {
+ pack info foobar
+} -returnCodes error -result {bad window path name "foobar"}
+test oldpack-8.12 {syntax errors} -body {
+ pack append .pack .pack.blue
+} -returnCodes error -result {wrong # args: window ".pack.blue" should be followed by options}
+test oldpack-8.13 {syntax errors} -body {
+ pack append . .pack.blue top
+} -returnCodes error -result {can't pack .pack.blue inside .}
+test oldpack-8.14 {syntax errors} -body {
+ pack append .pack .pack.blue f
+} -returnCodes error -result {bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame}
+test oldpack-8.15 {syntax errors} -body {
+ pack append .pack .pack.blue pad
+} -returnCodes error -result {bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame}
+test oldpack-8.16 {syntax errors} -body {
+ pack append .pack .pack.blue {frame south}
+} -returnCodes error -result {bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center}
+test oldpack-8.17 {syntax errors} -body {
+ pack append .pack .pack.blue {padx -2}
+} -returnCodes error -result {bad pad value "-2": must be positive screen distance}
+test oldpack-8.18 {syntax errors} -body {
+ pack append .pack .pack.blue {padx}
+} -returnCodes error -result {wrong # args: "padx" option must be followed by screen distance}
+test oldpack-8.19 {syntax errors} -body {
+ pack append .pack .pack.blue {pady -2}
+} -returnCodes error -result {bad pad value "-2": must be positive screen distance}
+test oldpack-8.20 {syntax errors} -body {
+ pack append .pack .pack.blue {pady}
+} -returnCodes error -result {wrong # args: "pady" option must be followed by screen distance}
+test oldpack-8.21 {syntax errors} -body {
+ pack append .pack .pack.blue "\{abc"
+} -returnCodes error -result {unmatched open brace in list}
+test oldpack-8.22 {syntax errors} -body {
+ pack append .pack .pack.blue frame
+} -returnCodes error -result {wrong # args: "frame" option must be followed by anchor point}
# Test "pack info" command output.
-test oldpack-9.1 {information output} {
+test oldpack-9.1 {information output} -body {
pack append .pack .pack.blue {top fillx frame n} \
- .pack.red {bottom filly frame s} .pack.green {left fill frame w} \
- .pack.violet {right expand frame e}
+ .pack.red {bottom filly frame s} .pack.green {left fill frame w} \
+ .pack.violet {right expand frame e}
list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \
- [pack info .pack.green] [pack info .pack.violet]
-} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}}
-test oldpack-9.2 {information output} {
+ [pack info .pack.green] [pack info .pack.violet]
+} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}}
+test oldpack-9.2 {information output} -body {
pack append .pack .pack.blue {padx 10 frame nw} \
- .pack.red {pady 20 frame ne} .pack.green {frame se} \
- .pack.violet {frame sw}
+ .pack.red {pady 20 frame ne} .pack.green {frame se} \
+ .pack.violet {frame sw}
list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \
- [pack info .pack.green] [pack info .pack.violet]
-} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}}
-test oldpack-9.3 {information output} {
+ [pack info .pack.green] [pack info .pack.violet]
+} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}}
+test oldpack-9.3 {information output} -body {
pack append .pack .pack.blue {frame center} .pack.red {frame center} \
- .pack.green {frame c} .pack.violet {frame c}
+ .pack.green {frame c} .pack.violet {frame c}
list [pack slaves .pack] [pack info .pack.blue] [pack info .pack.red] \
- [pack info .pack.green] [pack info .pack.violet]
-} {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}}
+ [pack info .pack.green] [pack info .pack.violet]
+} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}}
-catch {destroy .pack}
+destroy .pack
# cleanup
cleanupTests
return
+
diff --git a/tests/option.test b/tests/option.test
index 49d2975..66df70c 100644
--- a/tests/option.test
+++ b/tests/option.test
@@ -6,14 +6,14 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
testConstraint appNameIsTktest [expr {[winfo name .] eq "tktest"}]
-catch {destroy .op1}
-catch {destroy .op2}
+deleteWindows
set appName [winfo name .]
# First, test basic retrievals, being sure to trigger all the various
@@ -27,6 +27,7 @@ frame .op1.op4 -class Class3
frame .op2.op5 -class Class2
frame .op1.op3.op6 -class Class4
+# Configurations for tests 1.* - 12.*
option clear
option add *Color1 red
option add *x blue
@@ -38,97 +39,254 @@ option add $appName.Class1.Class3.y brown
option add $appName*op6*Color2 black
option add $appName*Class1.op1.Color2 grey
-test option-1.1 {basic option retrieval} {option get . x Color1} blue
-test option-1.2 {basic option retrieval} {option get . y Color1} red
-test option-1.3 {basic option retrieval} {option get . z Color1} red
-test option-1.4 {basic option retrieval} {option get . x Color2} blue
-test option-1.5 {basic option retrieval} {option get . y Color2} {}
-test option-1.6 {basic option retrieval} {option get . z Color2} {}
-
-test option-2.1 {basic option retrieval} {option get .op1 x Color1} green
-test option-2.2 {basic option retrieval} {option get .op1 y Color1} red
-test option-2.3 {basic option retrieval} {option get .op1 z Color1} red
-test option-2.4 {basic option retrieval} {option get .op1 x Color2} green
-test option-2.5 {basic option retrieval} {option get .op1 y Color2} {}
-test option-2.6 {basic option retrieval} {option get .op1 z Color2} {}
-
-test option-3.1 {basic option retrieval} {option get .op1.op3 x Color1} yellow
-test option-3.2 {basic option retrieval} {option get .op1.op3 y Color1} red
-test option-3.3 {basic option retrieval} {option get .op1.op3 z Color1} red
-test option-3.4 {basic option retrieval} {option get .op1.op3 x Color2} yellow
-test option-3.5 {basic option retrieval} {option get .op1.op3 y Color2} {}
-test option-3.6 {basic option retrieval} {option get .op1.op3 z Color2} {}
-
-test option-4.1 {basic option retrieval} {option get .op1.op3.op6 x Color1} blue
-test option-4.2 {basic option retrieval} {option get .op1.op3.op6 y Color1} red
-test option-4.3 {basic option retrieval} {option get .op1.op3.op6 z Color1} red
-test option-4.4 {basic option retrieval} {option get .op1.op3.op6 x Color2} black
-test option-4.5 {basic option retrieval} {option get .op1.op3.op6 y Color2} black
-test option-4.6 {basic option retrieval} {option get .op1.op3.op6 z Color2} black
-
-test option-5.1 {basic option retrieval} {option get .op1.op4 x Color1} blue
-test option-5.2 {basic option retrieval} {option get .op1.op4 y Color1} brown
-test option-5.3 {basic option retrieval} {option get .op1.op4 z Color1} red
-test option-5.4 {basic option retrieval} {option get .op1.op4 x Color2} blue
-test option-5.5 {basic option retrieval} {option get .op1.op4 y Color2} brown
-test option-5.6 {basic option retrieval} {option get .op1.op4 z Color2} {}
-
-test option-6.1 {basic option retrieval} {option get .op2 x Color1} orange
-test option-6.2 {basic option retrieval} {option get .op2 y Color1} orange
-test option-6.3 {basic option retrieval} {option get .op2 z Color1} orange
-test option-6.4 {basic option retrieval} {option get .op2 x Color2} blue
-test option-6.5 {basic option retrieval} {option get .op2 y Color2} {}
-test option-6.6 {basic option retrieval} {option get .op2 z Color2} {}
-
-test option-7.1 {basic option retrieval} {option get .op2.op5 x Color1} orange
-test option-7.2 {basic option retrieval} {option get .op2.op5 y Color1} orange
-test option-7.3 {basic option retrieval} {option get .op2.op5 z Color1} orange
-test option-7.4 {basic option retrieval} {option get .op2.op5 x Color2} purple
-test option-7.5 {basic option retrieval} {option get .op2.op5 y Color2} purple
-test option-7.6 {basic option retrieval} {option get .op2.op5 z Color2} purple
+test option-1.1 {basic option retrieval} -body {
+ option get . x Color1
+} -result blue
+test option-1.2 {basic option retrieval} -body {
+ option get . y Color1
+} -result red
+test option-1.3 {basic option retrieval} -body {
+ option get . z Color1
+} -result red
+test option-1.4 {basic option retrieval} -body {
+ option get . x Color2
+} -result blue
+test option-1.5 {basic option retrieval} -body {
+ option get . y Color2
+} -result {}
+test option-1.6 {basic option retrieval} -body {
+ option get . z Color2
+} -result {}
+
+
+test option-2.1 {basic option retrieval} -body {
+ option get .op1 x Color1
+} -result green
+test option-2.2 {basic option retrieval} -body {
+ option get .op1 y Color1
+} -result red
+test option-2.3 {basic option retrieval} -body {
+ option get .op1 z Color1
+} -result red
+test option-2.4 {basic option retrieval} -body {
+ option get .op1 x Color2
+} -result green
+test option-2.5 {basic option retrieval} -body {
+ option get .op1 y Color2
+} -result {}
+test option-2.6 {basic option retrieval} -body {
+ option get .op1 z Color2
+} -result {}
+
+
+test option-3.1 {basic option retrieval} -body {
+ option get .op1.op3 x Color1
+} -result yellow
+test option-3.2 {basic option retrieval} -body {
+ option get .op1.op3 y Color1
+} -result red
+test option-3.3 {basic option retrieval} -body {
+ option get .op1.op3 z Color1
+} -result red
+test option-3.4 {basic option retrieval} -body {
+ option get .op1.op3 x Color2
+} -result yellow
+test option-3.5 {basic option retrieval} -body {
+ option get .op1.op3 y Color2
+} -result {}
+test option-3.6 {basic option retrieval} -body {
+ option get .op1.op3 z Color2
+} -result {}
+
+
+test option-4.1 {basic option retrieval} -body {
+ option get .op1.op3.op6 x Color1
+} -result blue
+test option-4.2 {basic option retrieval} -body {
+ option get .op1.op3.op6 y Color1
+} -result red
+test option-4.3 {basic option retrieval} -body {
+ option get .op1.op3.op6 z Color1
+} -result red
+test option-4.4 {basic option retrieval} -body {
+ option get .op1.op3.op6 x Color2
+} -result black
+test option-4.5 {basic option retrieval} -body {
+ option get .op1.op3.op6 y Color2
+} -result black
+test option-4.6 {basic option retrieval} -body {
+ option get .op1.op3.op6 z Color2
+} -result black
+
+
+test option-5.1 {basic option retrieval} -body {
+ option get .op1.op4 x Color1
+} -result blue
+test option-5.2 {basic option retrieval} -body {
+ option get .op1.op4 y Color1
+} -result brown
+test option-5.3 {basic option retrieval} -body {
+ option get .op1.op4 z Color1
+} -result red
+test option-5.4 {basic option retrieval} -body {
+ option get .op1.op4 x Color2
+} -result blue
+test option-5.5 {basic option retrieval} -body {
+ option get .op1.op4 y Color2
+} -result brown
+test option-5.6 {basic option retrieval} -body {
+ option get .op1.op4 z Color2
+} -result {}
+
+
+test option-6.1 {basic option retrieval} -body {
+ option get .op2 x Color1
+} -result orange
+test option-6.2 {basic option retrieval} -body {
+ option get .op2 y Color1
+} -result orange
+test option-6.3 {basic option retrieval} -body {
+ option get .op2 z Color1
+} -result orange
+test option-6.4 {basic option retrieval} -body {
+ option get .op2 x Color2
+} -result blue
+test option-6.5 {basic option retrieval} -body {
+ option get .op2 y Color2
+} -result {}
+test option-6.6 {basic option retrieval} -body {
+ option get .op2 z Color2
+} -result {}
+
+
+test option-7.1 {basic option retrieval} -body {
+ option get .op2.op5 x Color1
+} -result orange
+test option-7.2 {basic option retrieval} -body {
+ option get .op2.op5 y Color1
+} -result orange
+test option-7.3 {basic option retrieval} -body {
+ option get .op2.op5 z Color1
+} -result orange
+test option-7.4 {basic option retrieval} -body {
+ option get .op2.op5 x Color2
+} -result purple
+test option-7.5 {basic option retrieval} -body {
+ option get .op2.op5 y Color2
+} -result purple
+test option-7.6 {basic option retrieval} -body {
+ option get .op2.op5 z Color2
+} -result purple
+
# Now try similar tests to above, except jump around non-hierarchically
# between windows to make sure that the option stacks are pushed and
# popped correctly.
option get . foo Foo
-test option-8.1 {stack pushing/popping} {option get .op2.op5 x Color1} orange
-test option-8.2 {stack pushing/popping} {option get .op2.op5 y Color1} orange
-test option-8.3 {stack pushing/popping} {option get .op2.op5 z Color1} orange
-test option-8.4 {stack pushing/popping} {option get .op2.op5 x Color2} purple
-test option-8.5 {stack pushing/popping} {option get .op2.op5 y Color2} purple
-test option-8.6 {stack pushing/popping} {option get .op2.op5 z Color2} purple
-
-test option-9.1 {stack pushing/popping} {option get . x Color1} blue
-test option-9.2 {stack pushing/popping} {option get . y Color1} red
-test option-9.3 {stack pushing/popping} {option get . z Color1} red
-test option-9.4 {stack pushing/popping} {option get . x Color2} blue
-test option-9.5 {stack pushing/popping} {option get . y Color2} {}
-test option-9.6 {stack pushing/popping} {option get . z Color2} {}
-
-test option-10.1 {stack pushing/popping} {option get .op1.op3.op6 x Color1} blue
-test option-10.2 {stack pushing/popping} {option get .op1.op3.op6 y Color1} red
-test option-10.3 {stack pushing/popping} {option get .op1.op3.op6 z Color1} red
-test option-10.4 {stack pushing/popping} {option get .op1.op3.op6 x Color2} black
-test option-10.5 {stack pushing/popping} {option get .op1.op3.op6 y Color2} black
-test option-10.6 {stack pushing/popping} {option get .op1.op3.op6 z Color2} black
-
-test option-11.1 {stack pushing/popping} {option get .op1.op3 x Color1} yellow
-test option-11.2 {stack pushing/popping} {option get .op1.op3 y Color1} red
-test option-11.3 {stack pushing/popping} {option get .op1.op3 z Color1} red
-test option-11.4 {stack pushing/popping} {option get .op1.op3 x Color2} yellow
-test option-11.5 {stack pushing/popping} {option get .op1.op3 y Color2} {}
-test option-11.6 {stack pushing/popping} {option get .op1.op3 z Color2} {}
-
-test option-12.1 {stack pushing/popping} {option get .op1 x Color1} green
-test option-12.2 {stack pushing/popping} {option get .op1 y Color1} red
-test option-12.3 {stack pushing/popping} {option get .op1 z Color1} red
-test option-12.4 {stack pushing/popping} {option get .op1 x Color2} green
-test option-12.5 {stack pushing/popping} {option get .op1 y Color2} {}
-test option-12.6 {stack pushing/popping} {option get .op1 z Color2} {}
+test option-8.1 {stack pushing/popping} -body {
+ option get .op2.op5 x Color1
+} -result orange
+test option-8.2 {stack pushing/popping} -body {
+ option get .op2.op5 y Color1
+} -result orange
+test option-8.3 {stack pushing/popping} -body {
+ option get .op2.op5 z Color1
+} -result orange
+test option-8.4 {stack pushing/popping} -body {
+ option get .op2.op5 x Color2
+} -result purple
+test option-8.5 {stack pushing/popping} -body {
+ option get .op2.op5 y Color2
+} -result purple
+test option-8.6 {stack pushing/popping} -body {
+ option get .op2.op5 z Color2
+} -result purple
+
+
+test option-9.1 {stack pushing/popping} -body {
+ option get . x Color1
+} -result blue
+test option-9.2 {stack pushing/popping} -body {
+ option get . y Color1
+} -result red
+test option-9.3 {stack pushing/popping} -body {
+ option get . z Color1
+} -result red
+test option-9.4 {stack pushing/popping} -body {
+ option get . x Color2
+} -result blue
+test option-9.5 {stack pushing/popping} -body {
+ option get . y Color2
+} -result {}
+test option-9.6 {stack pushing/popping} -body {
+ option get . z Color2
+} -result {}
+
+
+test option-10.1 {stack pushing/popping} -body {
+ option get .op1.op3.op6 x Color1
+} -result blue
+test option-10.2 {stack pushing/popping} -body {
+ option get .op1.op3.op6 y Color1
+} -result red
+test option-10.3 {stack pushing/popping} -body {
+ option get .op1.op3.op6 z Color1
+} -result red
+test option-10.4 {stack pushing/popping} -body {
+ option get .op1.op3.op6 x Color2
+} -result black
+test option-10.5 {stack pushing/popping} -body {
+ option get .op1.op3.op6 y Color2
+} -result black
+test option-10.6 {stack pushing/popping} -body {
+ option get .op1.op3.op6 z Color2
+} -result black
+
+
+test option-11.1 {stack pushing/popping} -body {
+ option get .op1.op3 x Color1
+} -result yellow
+test option-11.2 {stack pushing/popping} -body {
+ option get .op1.op3 y Color1
+} -result red
+test option-11.3 {stack pushing/popping} -body {
+ option get .op1.op3 z Color1
+} -result red
+test option-11.4 {stack pushing/popping} -body {
+ option get .op1.op3 x Color2
+} -result yellow
+test option-11.5 {stack pushing/popping} -body {
+ option get .op1.op3 y Color2
+} -result {}
+test option-11.6 {stack pushing/popping} -body {
+ option get .op1.op3 z Color2
+} -result {}
+
+
+test option-12.1 {stack pushing/popping} -body {
+ option get .op1 x Color1
+} -result green
+test option-12.2 {stack pushing/popping} -body {
+ option get .op1 y Color1
+} -result red
+test option-12.3 {stack pushing/popping} -body {
+ option get .op1 z Color1
+} -result red
+test option-12.4 {stack pushing/popping} -body {
+ option get .op1 x Color2
+} -result green
+test option-12.5 {stack pushing/popping} -body {
+ option get .op1 y Color2
+} -result {}
+test option-12.6 {stack pushing/popping} -body {
+ option get .op1 z Color2
+} -result {}
# Test the major priority levels (widgetDefault, etc.)
+# Configurations for tests 13.*
+option clear
option add $appName.op1.a 100 100
option add $appName.op1.A interactive interactive
option add $appName.op1.b userDefault userDefault
@@ -136,92 +294,127 @@ option add $appName.op1.B startupFile startupFile
option add $appName.op1.c widgetDefault widgetDefault
option add $appName.op1.C 0 0
-test option-13.1 {priority levels} {option get .op1 a A} 100
-test option-13.2 {priority levels} {option get .op1 b A} interactive
-test option-13.3 {priority levels} {option get .op1 b B} userDefault
-test option-13.4 {priority levels} {option get .op1 c B} startupFile
-test option-13.5 {priority levels} {option get .op1 c C} widgetDefault
+test option-13.1 {priority levels} -body {
+ option get .op1 a A
+} -result 100
+test option-13.2 {priority levels} -body {
+ option get .op1 b A
+} -result interactive
+test option-13.3 {priority levels} -body {
+ option get .op1 b B
+} -result userDefault
+test option-13.4 {priority levels} -body {
+ option get .op1 c B
+} -result startupFile
+test option-13.5 {priority levels} -body {
+ option get .op1 c C
+} -result widgetDefault
option add $appName.op1.B file2 widget
-test option-13.6 {priority levels} {option get .op1 c B} startupFile
+test option-13.6 {priority levels} -body {
+ option get .op1 c B
+} -result startupFile
option add $appName.op1.B file2 startupFile
-test option-13.7 {priority levels} {option get .op1 c B} file2
+test option-13.7 {priority levels} -body {
+ option get .op1 c B
+} -result file2
+
# Test various error conditions
-test option-14.1 {error conditions} {
- list [catch {option} msg] $msg
-} {1 {wrong # args: should be "option cmd arg ?arg ...?"}}
-test option-14.2 {error conditions} {
- list [catch {option x} msg] $msg
-} {1 {bad option "x": must be add, clear, get, or readfile}}
-test option-14.3 {error conditions} {
- list [catch {option foo 3} msg] $msg
-} {1 {bad option "foo": must be add, clear, get, or readfile}}
-test option-14.4 {error conditions} {
- list [catch {option add 3} msg] $msg
-} {1 {wrong # args: should be "option add pattern value ?priority?"}}
-test option-14.5 {error conditions} {
- list [catch {option add . a b c} msg] $msg
-} {1 {wrong # args: should be "option add pattern value ?priority?"}}
-test option-14.6 {error conditions} {
- list [catch {option add . a -1} msg] $msg
-} {1 {bad priority level "-1": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}}
-test option-14.7 {error conditions} {
- list [catch {option add . a 101} msg] $msg
-} {1 {bad priority level "101": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}}
-test option-14.8 {error conditions} {
- list [catch {option add . a gorp} msg] $msg
-} {1 {bad priority level "gorp": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}}
-test option-14.9 {error conditions} {
- list [catch {option get 3} msg] $msg
-} {1 {wrong # args: should be "option get window name class"}}
-test option-14.10 {error conditions} {
- list [catch {option get 3 4} msg] $msg
-} {1 {wrong # args: should be "option get window name class"}}
-test option-14.11 {error conditions} {
- list [catch {option get 3 4 5 6} msg] $msg
-} {1 {wrong # args: should be "option get window name class"}}
-test option-14.12 {error conditions} {
- list [catch {option get .gorp.gorp a A} msg] $msg
-} {1 {bad window path name ".gorp.gorp"}}
+test option-14.1 {error conditions} -body {
+ option
+} -returnCodes error -result {wrong # args: should be "option cmd arg ?arg ...?"}
+test option-14.2 {error conditions} -body {
+ option x
+} -returnCodes error -result {bad option "x": must be add, clear, get, or readfile}
+test option-14.3 {error conditions} -body {
+ option foo 3
+} -returnCodes error -result {bad option "foo": must be add, clear, get, or readfile}
+test option-14.4 {error conditions} -body {
+ option add 3
+} -returnCodes error -result {wrong # args: should be "option add pattern value ?priority?"}
+test option-14.5 {error conditions} -body {
+ option add . a b c
+} -returnCodes error -result {wrong # args: should be "option add pattern value ?priority?"}
+test option-14.6 {error conditions} -body {
+ option add . a -1
+} -returnCodes error -result {bad priority level "-1": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}
+test option-14.7 {error conditions} -body {
+ option add . a 101
+} -returnCodes error -result {bad priority level "101": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}
+test option-14.8 {error conditions} -body {
+ option add . a gorp
+} -returnCodes error -result {bad priority level "gorp": must be widgetDefault, startupFile, userDefault, interactive, or a number between 0 and 100}
+test option-14.9 {error conditions} -body {
+ option get 3
+} -returnCodes error -result {wrong # args: should be "option get window name class"}
+test option-14.10 {error conditions} -body {
+ option get 3 4
+} -returnCodes error -result {wrong # args: should be "option get window name class"}
+test option-14.11 {error conditions} -body {
+ option get 3 4 5 6
+} -returnCodes error -result {wrong # args: should be "option get window name class"}
+test option-14.12 {error conditions} -body {
+ option get .gorp.gorp a A
+} -returnCodes error -result {bad window path name ".gorp.gorp"}
+
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
-} {1 {couldn't open "non-existent": no such file or directory}}
-option read $option1
-test option-15.2 {database files} {option get . x1 color} blue
-test option-15.3 {database files} appNameIsTktest {option get . x2 color} green
-test option-15.4 {database files} {option get . x3 color} purple
-test option-15.5 {database files} {option get . {x 4} color} brown
-test option-15.6 {database files} {option get . x6 color} {}
-test option-15.7 {database files} {
- list [catch {option read $option1 widget foo} msg] $msg
-} {1 {wrong # args: should be "option readfile fileName ?priority?"}}
-option add *x3 burgundy
-catch {option read $option1 userDefault}
-test option-15.8 {database files} {option get . x3 color} burgundy
-test option-15.9 {database files} {
- list [catch {option read $option2} msg] $msg
-} {1 {missing colon on line 2}}
-
-test option-16.1 {ReadOptionFile} {
+test option-15.1 {database files} -body {
+ option read non-existent
+} -returnCodes error -result {couldn't open "non-existent": no such file or directory}
+test option-15.2 {database files} -body {
+ option read $option1
+ option get . x1 color
+} -result blue
+test option-15.3 {database files} -constraints appNameIsTktest -body {
+ option read $option1
+ option get . x2 color
+} -result green
+test option-15.4 {database files} -body {
+ option read $option1
+ option get . x3 color
+} -result purple
+test option-15.5 {database files} -body {
+ option read $option1
+ option get . {x 4} color
+} -result brown
+test option-15.6 {database files} -body {
+ option read $option1
+ option get . x6 color
+} -result {}
+test option-15.7 {database files} -body {
+ option read $option1 widget foo
+} -returnCodes error -result {wrong # args: should be "option readfile fileName ?priority?"}
+
+test option-15.8 {database files} -body {
+ option add *x3 burgundy
+ catch {option read $option1 userDefault}
+ option get . x3 color
+} -result burgundy
+test option-15.9 {database files} -body {
+ set option2 [file join [testsDirectory] option.file2]
+ option read $option2
+} -returnCodes error -result {missing colon on line 2}
+
+
+test option-16.1 {ReadOptionFile} -body {
set option3 [makeFile {} option.file3]
set file [open $option3 w]
fconfigure $file -translation crlf
puts $file "*x7: true\n*x8: false"
close $file
option read $option3 userDefault
- set result [list [option get . x7 color] [option get . x8 color]]
+ list [option get . x7 color] [option get . x8 color]
+} -cleanup {
removeFile $option3
- set result
-} {true false}
+} -result {true false}
-catch {destroy .op1}
-catch {destroy .op2}
+deleteWindows
# cleanup
cleanupTests
return
+
+
+
diff --git a/tests/pack.test b/tests/pack.test
index edb9f18..eac1562 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -6,43 +6,15 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
-# Utility procedures:
-
-proc pack1 {args} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- eval pack .pack.a $args
- pack .pack.b -expand yes -fill both
- update
- list [winfo geometry .pack.a] [winfo geometry .pack.b]
-}
-proc pack2 {args} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- eval pack .pack.a $args
- update
- winfo geometry .pack.a
-}
-proc pack3 {args} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- pack .pack.a -side top
- pack .pack.c -side left
- eval pack .pack.b $args
- update
- winfo geometry .pack.b
-}
-proc pack4 {option value} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- pack .pack.a $option $value
- set i [pack info .pack.a]
- lindex $i [expr [lsearch -exact $i $option]+1]
-}
# Create some test windows.
-catch {destroy .pack}
+destroy .pack
toplevel .pack
wm geom .pack 300x200+0+0
wm minsize .pack 1 1
@@ -57,400 +29,767 @@ foreach i {a b c d} {
.pack.c config -width 80 -height 80
.pack.d config -width 40 -height 30
-test pack-1.1 {-side option} {
- pack1 -side top
-} {20x40+140+0 300x160+0+40}
-test pack-1.2 {-side option} {
- pack1 -side bottom
-} {20x40+140+160 300x160+0+0}
-test pack-1.3 {-side option} {
- pack1 -side left
-} {20x40+0+80 280x200+20+0}
-test pack-1.4 {-side option} {
- pack1 -side right
-} {20x40+280+80 280x200+0+0}
+test pack-1.1 {-side option} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+0 300x160+0+40}
+test pack-1.2 {-side option} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side bottom
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+160 300x160+0+0}
+test pack-1.3 {-side option} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side left
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+0+80 280x200+20+0}
+test pack-1.4 {-side option} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+280+80 280x200+0+0}
-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}
-test pack-2.3 {x padding and filling} {
- pack1 -side right -ipadx 5 -padx 10
-} {30x40+260+80 250x200+0+0}
-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.12a {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} {
+
+test pack-2.1 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -padx 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+260+80 240x200+0+0}
+test pack-2.2 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -padx {10 30}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+250+80 240x200+0+0}
+test pack-2.3 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -padx {35 5}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+275+80 240x200+0+0}
+test pack-2.4 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipadx 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {60x40+240+80 240x200+0+0}
+test pack-2.5 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipadx 5 -padx 10
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {30x40+260+80 250x200+0+0}
+test pack-2.6 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -padx 20 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+260+80 240x200+0+0}
+test pack-2.7 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -padx {9 31} -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+249+80 240x200+0+0}
+test pack-2.8 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipadx 20 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {60x40+240+80 240x200+0+0}
+test pack-2.9 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipadx 5 -padx 10 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {30x40+260+80 250x200+0+0}
+test pack-2.10 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipadx 5 -padx {5 15} -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {30x40+255+80 250x200+0+0}
+test pack-2.11 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -padx 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+0 300x160+0+40}
+test pack-2.12 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -padx {0 40}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+120+0 300x160+0+40}
+test pack-2.13 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -padx {31 9}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+151+0 300x160+0+40}
+test pack-2.14 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {60x40+120+0 300x160+0+40}
+test pack-2.15 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {30x40+135+0 300x160+0+40}
+test pack-2.16 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx {5 15}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {30x40+130+0 300x160+0+40}
+test pack-2.17 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -padx 20 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {260x40+20+0 300x160+0+40}
+test pack-2.18 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -padx {25 15} -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {260x40+25+0 300x160+0+40}
+test pack-2.19 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 20 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {300x40+0+0 300x160+0+40}
+test pack-2.20 {x padding and filling} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {280x40+10+0 300x160+0+40}
+test pack-2.21 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx {5 15} -fill x
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {280x40+5+0 300x160+0+40}
+
+test pack-2.22 {x padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -padx 1c
set x [pack info .pack.a]
- lindex $x [expr [lsearch -exact $x -padx]+1]
-} $pad
-test pack-2.14 {x padding and filling} {
+ set res1 [lindex $x [expr [lsearch -exact $x -padx]+1]]
+ set res2 [winfo pixels .pack 1c]
+ expr {$res1 eq $res2}
+} -result 1
+test pack-2.23 {x padding and filling} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -ipadx 1c
set x [pack info .pack.a]
- lindex $x [expr [lsearch -exact $x -ipadx]+1]
-} $pad
+ set res1 [lindex $x [expr [lsearch -exact $x -ipadx]+1]]
+ set res2 [winfo pixels .pack 1c]
+ expr {$res1 eq $res2}
+} -result 1
-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} {
+
+test pack-3.1 {y padding and filling} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -pady 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+280+80 280x200+0+0}
+test pack-3.2 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -pady {5 35}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+280+65 280x200+0+0}
+test pack-3.3 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -pady {40 0}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+280+100 280x200+0+0}
+test pack-3.4 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x80+280+60 280x200+0+0}
+test pack-3.5 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 5 -pady 10
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+280+75 280x200+0+0}
+test pack-3.6 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 5 -pady {5 15}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+280+70 280x200+0+0}
+test pack-3.7 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -pady 20 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x160+280+20 280x200+0+0}
+test pack-3.8 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -pady {35 5} -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x160+280+35 280x200+0+0}
+test pack-3.9 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 20 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x200+280+0 280x200+0+0}
+test pack-3.10 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 5 -pady 10 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x180+280+10 280x200+0+0}
+test pack-3.11 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side right -ipady 5 -pady {0 20} -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x180+280+0 280x200+0+0}
+test pack-3.12 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -pady 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+20 300x120+0+80}
+test pack-3.13 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -pady {40 0}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+40 300x120+0+80}
+test pack-3.14 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 20
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x80+140+0 300x120+0+80}
+test pack-3.15 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 5 -pady 10
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+140+10 300x130+0+70}
+test pack-3.16 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 5 -pady {3 17}
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+140+3 300x130+0+70}
+test pack-3.17 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -pady 20 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+20 300x120+0+80}
+test pack-3.18 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -pady {39 1} -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x40+140+39 300x120+0+80}
+test pack-3.19 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 20 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x80+140+0 300x120+0+80}
+test pack-3.20 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 5 -pady 10 -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+140+10 300x130+0+70}
+test pack-3.21 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipady 5 -pady {1 19} -fill y
+ pack .pack.b -expand yes -fill both
+ update
+ list [winfo geometry .pack.a] [winfo geometry .pack.b]
+} -result {20x50+140+1 300x130+0+70}
+
+test pack-3.22 {y padding and filling} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -pady 1c
set x [pack info .pack.a]
- lindex $x [expr [lsearch -exact $x -pady]+1]
-} $pad
-test pack-3.14 {y padding and filling} {
+ set res1 [lindex $x [expr [lsearch -exact $x -pady]+1]]
+ set res2 [winfo pixels .pack 1c]
+ expr {$res1 eq $res2}
+} -result 1
+test pack-3.23 {y padding and filling} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -ipady 1c
set x [pack info .pack.a]
- lindex $x [expr [lsearch -exact $x -ipady]+1]
-} $pad
+ set res1 [lindex $x [expr [lsearch -exact $x -ipady]+1]]
+ set res2 [winfo pixels .pack 1c]
+ expr {$res1 eq $res2}
+} -result 1
+
+
+test pack-4.1 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n
+ update
+ winfo geometry .pack.a
+} -result {30x70+135+20}
+test pack-4.2 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne
+ update
+ winfo geometry .pack.a
+} -result {30x70+260+20}
+test pack-4.3 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e
+ update
+ winfo geometry .pack.a
+} -result {30x70+260+65}
+test pack-4.4 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se
+ update
+ winfo geometry .pack.a
+} -result {30x70+260+110}
+test pack-4.5 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s
+ update
+ winfo geometry .pack.a
+} -result {30x70+135+110}
+test pack-4.6 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw
+ update
+ winfo geometry .pack.a
+} -result {30x70+10+110}
+test pack-4.7 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w
+ update
+ winfo geometry .pack.a
+} -result {30x70+10+65}
+test pack-4.8 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw
+ update
+ winfo geometry .pack.a
+} -result {30x70+10+20}
+test pack-4.9 {anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center
+ update
+ winfo geometry .pack.a
+} -result {30x70+135+65}
-test pack-4.1 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n
-} {30x70+135+20}
-test pack-4.2 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne
-} {30x70+260+20}
-test pack-4.3 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e
-} {30x70+260+65}
-test pack-4.4 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se
-} {30x70+260+110}
-test pack-4.5 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s
-} {30x70+135+110}
-test pack-4.6 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw
-} {30x70+10+110}
-test pack-4.7 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w
-} {30x70+10+65}
-test pack-4.8 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw
-} {30x70+10+20}
-test pack-4.9 {anchors} {
- pack2 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center
-} {30x70+135+65}
# Repeat above tests, but with a frame that isn't at (0,0), so that
# we can be sure that the frame offset is being added in correctly.
-test pack-5.1 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n
-} {60x60+160+60}
-test pack-5.2 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne
-} {60x60+230+60}
-test pack-5.3 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e
-} {60x60+230+90}
-test pack-5.4 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se
-} {60x60+230+120}
-test pack-5.5 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s
-} {60x60+160+120}
-test pack-5.6 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw
-} {60x60+90+120}
-test pack-5.7 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w
-} {60x60+90+90}
-test pack-5.8 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw
-} {60x60+90+60}
-test pack-5.9 {more anchors} {
- pack3 -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center
-} {60x60+160+90}
+test pack-5.1 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor n
+ update
+ winfo geometry .pack.b
+} -result {60x60+160+60}
+test pack-5.2 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor ne
+ update
+ winfo geometry .pack.b
+} -result {60x60+230+60}
+test pack-5.3 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor e
+ update
+ winfo geometry .pack.b
+} -result {60x60+230+90}
+test pack-5.4 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor se
+ update
+ winfo geometry .pack.b
+} -result {60x60+230+120}
+test pack-5.5 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor s
+ update
+ winfo geometry .pack.b
+} -result {60x60+160+120}
+test pack-5.6 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor sw
+ update
+ winfo geometry .pack.b
+} -result {60x60+90+120}
+test pack-5.7 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor w
+ update
+ winfo geometry .pack.b
+} -result {60x60+90+90}
+test pack-5.8 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor nw
+ update
+ winfo geometry .pack.b
+} -result {60x60+90+60}
+test pack-5.9 {more anchors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side top
+ pack .pack.c -side left
+ pack .pack.b -side top -ipadx 5 -padx 10 -ipady 15 -pady 20 -expand y -anchor center
+ update
+ winfo geometry .pack.b
+} -result {60x60+160+90}
+
-test pack-6.1 {-expand option} {
+test pack-6.1 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side left
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+0+80 50x30+20+85 80x80+70+60 40x30+150+85}
-test pack-6.2 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+0+80 50x30+20+85 80x80+70+60 40x30+150+85}
+test pack-6.2 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side left -expand yes
pack .pack.b -side left
pack .pack.c .pack.d -side left -expand 1
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+18+80 50x30+56+85 80x80+124+60 40x30+241+85}
-test pack-6.3 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+18+80 50x30+56+85 80x80+124+60 40x30+241+85}
+test pack-6.3 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+140+0 50x30+125+40 80x80+110+70 40x30+130+150}
-test pack-6.4 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+140+0 50x30+125+40 80x80+110+70 40x30+130+150}
+test pack-6.4 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side top -expand yes
pack .pack.b -side top
pack .pack.c .pack.d -side top -expand 1
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+140+3 50x30+125+46 80x80+110+79 40x30+130+166}
-test pack-6.5 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+140+3 50x30+125+46 80x80+110+79 40x30+130+166}
+test pack-6.5 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side right
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+280+80 50x30+230+85 80x80+150+60 40x30+110+85}
-test pack-6.6 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+280+80 50x30+230+85 80x80+150+60 40x30+110+85}
+test pack-6.6 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side right -expand yes
pack .pack.b -side right
pack .pack.c .pack.d -side right -expand 1
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+262+80 50x30+194+85 80x80+95+60 40x30+18+85}
-test pack-6.7 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+262+80 50x30+194+85 80x80+95+60 40x30+18+85}
+test pack-6.7 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side bottom
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+140+160 50x30+125+130 80x80+110+50 40x30+130+20}
-test pack-6.8 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+140+160 50x30+125+130 80x80+110+50 40x30+130+20}
+test pack-6.8 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side bottom -expand yes
pack .pack.b -side bottom
pack .pack.c .pack.d -side bottom -expand 1
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {20x40+140+157 50x30+125+124 80x80+110+40 40x30+130+3}
-test pack-6.9 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {20x40+140+157 50x30+125+124 80x80+110+40 40x30+130+3}
+test pack-6.9 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side bottom -expand yes -fill both
pack .pack.b -side right
pack .pack.c -side top -expand 1 -fill both
pack .pack.d -side left
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {300x65+0+135 50x30+250+52 250x105+0+0 40x30+0+105}
-test pack-6.10 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {300x65+0+135 50x30+250+52 250x105+0+0 40x30+0+105}
+test pack-6.10 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side left -expand yes -fill both
pack .pack.b -side top
pack .pack.c -side right -expand 1 -fill both
pack .pack.d -side bottom
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {100x200+0+0 50x30+175+0 160x170+140+30 40x30+100+170}
-test pack-6.11 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {100x200+0+0 50x30+175+0 160x170+140+30 40x30+100+170}
+test pack-6.11 {-expand option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side left -expand yes -fill both
pack .pack.b -side top -expand yes -fill both
pack .pack.c -side right -expand 1 -fill both
pack .pack.d -side bottom -expand yes -fill both
update
list [winfo geometry .pack.a] [winfo geometry .pack.b] \
- [winfo geometry .pack.c] [winfo geometry .pack.d]
-} {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100}
-catch {destroy .pack2}
-toplevel .pack2 -height 400 -width 400
-wm geometry .pack2 +0+0
-pack propagate .pack2 0
-pack forget .pack2.a .pack2.b .pack2.c .pack2.d
-foreach i {w1 w2 w3} {
- frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised
- label .pack2.$i.l -text $i
- place .pack2.$i.l -relwidth 1.0 -relheight 1.0
-}
-test pack-6.12 {-expand option} {
+ [winfo geometry .pack.c] [winfo geometry .pack.d]
+} -result {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100}
+
+test pack-6.12 {-expand option} -setup {
+ toplevel .pack2 -height 400 -width 400
+ wm geometry .pack2 +0+0
+ pack propagate .pack2 0
+ foreach i {w1 w2 w3} {
+ frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised
+ label .pack2.$i.l -text $i
+ place .pack2.$i.l -relwidth 1.0 -relheight 1.0
+ }
+} -body {
pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 -ipady 6 -expand 1 -side left
update
list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3]
-} {38x42+47+179 38x42+180+179 38x42+314+179}
-test pack-6.13 {-expand option} {
- pack forget .pack2.w1 .pack2.w2 .pack2.w3
+} -cleanup {
+ destroy .pack2
+} -result {38x42+47+179 38x42+180+179 38x42+314+179}
+test pack-6.13 {-expand option} -setup {
+ toplevel .pack2 -height 400 -width 400
+ wm geometry .pack2 +0+0
+ pack propagate .pack2 0
+ foreach i {w1 w2 w3} {
+ frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised
+ label .pack2.$i.l -text $i
+ place .pack2.$i.l -relwidth 1.0 -relheight 1.0
+ }
+} -body {
pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 \
- -ipady 6 -expand 1 -side top
+ -ipady 6 -expand 1 -side top
update
list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3]
-} {38x42+181+45 38x42+181+178 38x42+181+312}
-catch {destroy .pack2}
+} -cleanup {
+ destroy .pack2
+} -result {38x42+181+45 38x42+181+178 38x42+181+312}
+
wm geometry .pack {}
-test pack-7.1 {requesting size for parent} {
+test pack-7.1 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side left -padx 5 -pady 10
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {230 100}
-test pack-7.2 {requesting size for parent} {
+} -result {230 100}
+test pack-7.2 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top -padx 5 -pady 10
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {90 260}
-test pack-7.3 {requesting size for parent} {
+} -result {90 260}
+test pack-7.3 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side right -padx 5 -pady 10
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {230 100}
-test pack-7.4 {requesting size for parent} {
+} -result {230 100}
+test pack-7.4 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side bottom -padx 5 -pady 10
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {90 260}
-test pack-7.5 {requesting size for parent} {
+} -result {90 260}
+test pack-7.5 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side top -padx 5 -pady 10
pack .pack.b -side right -padx 5 -pady 10
pack .pack.c -side bottom -padx 5 -pady 10
pack .pack.d -side left -padx 5 -pady 10
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {150 210}
-test pack-7.6 {requesting size for parent} {
+} -result {150 210}
+test pack-7.6 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side top
pack .pack.c -side left
pack .pack.d -side bottom
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {120 120}
-test pack-7.7 {requesting size for parent} {
+} -result {120 120}
+test pack-7.7 {requesting size for parent} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side right
pack .pack.c -side bottom
pack .pack.d -side top
update
list [winfo reqwidth .pack] [winfo reqheight .pack]
-} {100 110}
+} -result {100 110}
# For the tests below, create a couple of "pad" windows to shrink
@@ -466,363 +805,496 @@ pack .pack.right -side right
pack .pack.bottom -side bottom
pack .pack.a .pack.b .pack.c -side top
update
-test pack-8.1 {insufficient space} {
+test pack-8.1 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+30+0 1 50x30+15+40 1 80x80+0+70 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+30+0 1 50x30+15+40 1 80x80+0+70 1}
wm geom .pack 270x250
update
-test pack-8.2 {insufficient space} {
+test pack-8.2 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+25+0 1 50x30+10+40 1 70x30+0+70 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+25+0 1 50x30+10+40 1 70x30+0+70 1}
wm geom .pack 240x220
update
-test pack-8.3 {insufficient space} {
+test pack-8.3 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+10+0 1 40x30+0+40 1 70x30+0+70 0}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+10+0 1 40x30+0+40 1 70x30+0+70 0}
wm geom .pack 350x350
update
-test pack-8.4 {insufficient space} {
+test pack-8.4 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+65+0 1 50x30+50+40 1 80x80+35+70 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+65+0 1 50x30+50+40 1 80x80+35+70 1}
wm geom .pack {}
pack .pack.a -side left
pack .pack.b -side right
pack .pack.c -side left
update
-test pack-8.5 {insufficient space} {
+test pack-8.5 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1}
wm geom .pack 320x180
update
-test pack-8.6 {insufficient space} {
+test pack-8.6 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x30+0+0 1 50x30+70+0 1 50x30+20+0 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x30+0+0 1 50x30+70+0 1 50x30+20+0 1}
wm geom .pack 250x180
update
-test pack-8.7 {insufficient space} {
+test pack-8.7 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x30+0+0 1 30x30+20+0 1 50x30+20+0 0}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x30+0+0 1 30x30+20+0 1 50x30+20+0 0}
pack forget .pack.b
update
-test pack-8.8 {insufficient space} {
+test pack-8.8 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x30+0+0 1 30x30+20+0 0 30x30+20+0 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x30+0+0 1 30x30+20+0 0 30x30+20+0 1}
pack .pack.b -side right -after .pack.a
wm geom .pack {}
update
-test pack-8.9 {insufficient space} {
+test pack-8.9 {insufficient space} -body {
list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
- [winfo geometry .pack.b] [winfo ismapped .pack.b] \
- [winfo geometry .pack.c] [winfo ismapped .pack.c]
-} {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1}
+ [winfo geometry .pack.b] [winfo ismapped .pack.b] \
+ [winfo geometry .pack.c] [winfo ismapped .pack.c]
+} -result {20x40+0+20 1 50x30+100+25 1 80x80+20+0 1}
pack forget .pack.right .pack.bottom
-test pack-9.1 {window ordering} {
+
+test pack-9.1 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.a -after .pack.b
pack slaves .pack
-} {.pack.b .pack.a .pack.c .pack.d}
-test pack-9.2 {window ordering} {
+} -result {.pack.b .pack.a .pack.c .pack.d}
+test pack-9.2 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.a -after .pack.a
pack slaves .pack
-} {.pack.a .pack.b .pack.c .pack.d}
-test pack-9.3 {window ordering} {
+} -result {.pack.a .pack.b .pack.c .pack.d}
+test pack-9.3 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.a -before .pack.d
pack slaves .pack
-} {.pack.b .pack.c .pack.a .pack.d}
-test pack-9.4 {window ordering} {
+} -result {.pack.b .pack.c .pack.a .pack.d}
+test pack-9.4 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.d -before .pack.a
pack slaves .pack
-} {.pack.d .pack.a .pack.b .pack.c}
-test pack-9.5 {window ordering} {
+} -result {.pack.d .pack.a .pack.b .pack.c}
+test pack-9.5 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack propagate .pack.c 0
pack .pack.a -in .pack.c
list [pack slaves .pack] [pack slaves .pack.c]
-} {{.pack.b .pack.c .pack.d} .pack.a}
-test pack-9.6 {window ordering} {
+} -result {{.pack.b .pack.c .pack.d} .pack.a}
+test pack-9.6 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.a -in .pack
pack slaves .pack
-} {.pack.b .pack.c .pack.d .pack.a}
-test pack-9.7 {window ordering} {
+} -result {.pack.b .pack.c .pack.d .pack.a}
+test pack-9.7 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d -side top
pack .pack.a -padx 0
pack slaves .pack
-} {.pack.a .pack.b .pack.c .pack.d}
-test pack-9.8 {window ordering} {
+} -result {.pack.a .pack.b .pack.c .pack.d}
+test pack-9.8 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c
pack .pack.d
pack slaves .pack
-} {.pack.a .pack.b .pack.c .pack.d}
-test pack-9.9 {window ordering} {
+} -result {.pack.a .pack.b .pack.c .pack.d}
+test pack-9.9 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d
pack .pack.b .pack.d .pack.c -before .pack.a
pack slaves .pack
-} {.pack.b .pack.d .pack.c .pack.a}
-test pack-9.10 {window ordering} {
+} -result {.pack.b .pack.d .pack.c .pack.a}
+test pack-9.10 {window ordering} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d
pack .pack.a .pack.c .pack.d .pack.b -after .pack.a
pack slaves .pack
-} {.pack.a .pack.c .pack.d .pack.b}
+} -result {.pack.a .pack.c .pack.d .pack.b}
+
-test pack-10.1 {retaining/clearing configuration state} {
+test pack-10.1 {retaining/clearing configuration state} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side bottom -anchor n -padx 1 -pady 2 -ipadx 3 -ipady 4 \
- -fill both -expand 1
+ -fill both -expand 1
pack forget .pack.a
pack .pack.a
pack info .pack.a
-} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}
-test pack-10.2 {retaining/clearing configuration state} {
+} -result {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}
+test pack-10.2 {retaining/clearing configuration state} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a -side bottom -anchor n -padx 1 -pady 2 -ipadx 3 -ipady 4 \
- -fill both -expand 1
+ -fill both -expand 1
pack .pack.a -pady 14
pack info .pack.a
-} {-in .pack -anchor n -expand 1 -fill both -ipadx 3 -ipady 4 -padx 1 -pady 14 -side bottom}
-test pack-10.3 {bad -in window does not change master} {
+} -result {-in .pack -anchor n -expand 1 -fill both -ipadx 3 -ipady 4 -padx 1 -pady 14 -side bottom}
+test pack-10.3 {bad -in window does not change master} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [winfo manager .pack.a] \
- [catch {pack .pack.a -in .pack.a} err] $err \
- [winfo manager .pack.a]
-} {{} 1 {can't pack .pack.a inside itself} {}}
+} -body {
+ set result [list [winfo manager .pack.a]]
+ catch {pack .pack.a -in .pack.a}
+ lappend result [winfo manager .pack.a]
+} -result {{} {}}
+test pack-10.4 {bad -in window does not change master} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ winfo manager .pack.a
+ pack .pack.a -in .pack.a
+} -returnCodes error -result {can't pack .pack.a inside itself}
-test pack-11.1 {info option} {
- pack4 -in .pack
-} .pack
-test pack-11.2 {info option} {
- pack4 -anchor n
-} n
-test pack-11.3 {info option} {
- pack4 -anchor sw
-} sw
-test pack-11.4 {info option} {
- pack4 -expand yes
-} 1
-test pack-11.5 {info option} {
- pack4 -expand no
-} 0
-test pack-11.6 {info option} {
- pack4 -fill x
-} x
-test pack-11.7 {info option} {
- pack4 -fill y
-} y
-test pack-11.8 {info option} {
- pack4 -fill both
-} both
-test pack-11.9 {info option} {
- pack4 -fill none
-} none
-test pack-11.10 {info option} {
- pack4 -ipadx 14
-} 14
-test pack-11.11 {info option} {
- pack4 -ipady 22
-} 22
-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
-test pack-11.15 {info option} {
- pack4 -side bottom
-} bottom
-test pack-11.16 {info option} {
- pack4 -side left
-} left
-test pack-11.17 {info option} {
- pack4 -side right
-} right
-test pack-12.1 {command options and errors} {
- list [catch {pack} msg] $msg
-} {1 {wrong # args: should be "pack option arg ?arg ...?"}}
-test pack-12.2 {command options and errors} {
- list [catch {pack foo} msg] $msg
-} {1 {wrong # args: should be "pack option arg ?arg ...?"}}
-test pack-12.3 {command options and errors} {
- list [catch {pack configure x} msg] $msg
-} {1 {bad argument "x": must be name of window}}
-test pack-12.4 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- pack configure .pack.b .pack.c
- pack slaves .pack
-} {.pack.b .pack.c}
-test pack-12.5 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .foo} msg] $msg
-} {1 {bad window path name ".foo"}}
-test pack-12.6 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack} msg] $msg
-} {1 {can't pack ".pack": it's a top-level window}}
-test pack-12.7 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -after .foo} msg] $msg
-} {1 {bad window path name ".foo"}}
-test pack-12.8 {command options and errors} {
+test pack-11.1 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -after .pack.b} msg] $msg
-} {1 {window ".pack.b" isn't packed}}
-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 "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
-} {1 {bad window path name "gorp"}}
-test pack-12.11 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -before .pack.b} msg] $msg
-} {1 {window ".pack.b" isn't packed}}
-test pack-12.12 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -expand "who cares?"} msg] $msg
-} {1 {expected boolean value but got "who cares?"}}
-test pack-12.13 {command options and errors} {
+} -body {
+ pack .pack.a -in .pack
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -in]+1]
+} -result .pack
+test pack-11.2 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -fill z} msg] $msg
-} {1 {bad fill style "z": must be none, x, y, or both}}
-test pack-12.14 {command options and errors} {
+} -body {
+ pack .pack.a -anchor n
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -anchor]+1]
+} -result n
+test pack-11.3 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -in z} msg] $msg
-} {1 {bad window path name "z"}}
-set pad [winfo pixels .pack 1c]
-test pack-12.15 {command options and errors} {
+} -body {
+ pack .pack.a -anchor sw
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -anchor]+1]
+} -result sw
+test pack-11.4 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -expand yes
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -expand]+1]
+} -result 1
+test pack-11.5 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -expand no
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -expand]+1]
+} -result 0
+test pack-11.6 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -fill x
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -fill]+1]
+} -result x
+test pack-11.7 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -fill y
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -fill]+1]
+} -result y
+test pack-11.8 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -fill both
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -fill]+1]
+} -result both
+test pack-11.9 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -fill none
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -fill]+1]
+} -result none
+test pack-11.10 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -ipadx 14
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -ipadx]+1]
+} -result 14
+test pack-11.11 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -ipady 22
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -ipady]+1]
+} -result 22
+test pack-11.12 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -ipadx abc} msg] $msg
-} {1 {bad ipadx value "abc": must be positive screen distance}}
-test pack-12.20 {command options and errors} {
+} -body {
+ pack .pack.a -padx 2
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -padx]+1]
+} -result 2
+test pack-11.13 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -ipadx -1} msg] $msg
-} {1 {bad ipadx value "-1": must be positive screen distance}}
-test pack-12.20.1 {command options and errors} {
+} -body {
+ pack .pack.a -padx {2 9}
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -padx]+1]
+} -result {2 9}
+test pack-11.14 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -pady 3
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -pady]+1]
+} -result 3
+test pack-11.15 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -ipady abc} msg] $msg
-} {1 {bad ipady value "abc": must be positive screen distance}}
-test pack-12.22 {command options and errors} {
+} -body {
+ pack .pack.a -pady {3 11}
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -pady]+1]
+} -result {3 11}
+test pack-11.16 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -ipady -1} msg] $msg
-} {1 {bad ipady value "-1": must be positive screen distance}}
-test pack-12.22.1 {command options and errors} {
+} -body {
+ pack .pack.a -side top
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -side]+1]
+} -result top
+test pack-11.17 {info option} -setup {
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} {
+} -body {
+ pack .pack.a -side bottom
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -side]+1]
+} -result bottom
+test pack-11.18 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -side bac} msg] $msg
-} {1 {bad side "bac": must be top, bottom, left, or right}}
-test pack-12.24 {command options and errors} {
+} -body {
+ pack .pack.a -side left
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -side]+1]
+} -result left
+test pack-11.19 {info option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -lousy bac} msg] $msg
-} {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} {
+} -body {
+ pack .pack.a -side right
+ set i [pack info .pack.a]
+ lindex $i [expr [lsearch -exact $i -side]+1]
+} -result right
+
+
+test pack-12.1 {command options and errors} -body {
+ pack
+} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
+test pack-12.2 {command options and errors} -body {
+ pack foo
+} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
+test pack-12.3 {command options and errors} -body {
+ pack configure x
+} -returnCodes error -result {bad argument "x": must be name of window}
+test pack-12.4 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack configure .pack.b .pack.c
+ pack slaves .pack
+} -result {.pack.b .pack.c}
+test pack-12.5 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -padx} msg] $msg
-} {1 {extra option "-padx" (option with no value?)}}
-test pack-12.26 {command options and errors} {
+} -body {
+ pack .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test pack-12.6 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a ? 22} msg] $msg
-} {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} {
+} -body {
+ pack .pack
+} -returnCodes error -result {can't pack ".pack": it's a top-level window}
+test pack-12.7 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -in .} msg] $msg
-} {1 {can't pack .pack.a inside .}}
-test pack-12.28 {command options and errors} {
+} -body {
+ pack .pack.a -after .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test pack-12.8 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -after .pack.b
+} -returnCodes error -result {window ".pack.b" isn't packed}
+test pack-12.9 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -anchor gorp
+} -returnCodes error -result {bad anchor "gorp": must be n, ne, e, se, s, sw, w, nw, or center}
+test pack-12.10 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -before gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test pack-12.11 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -before .pack.b
+} -returnCodes error -result {window ".pack.b" isn't packed}
+test pack-12.12 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -expand "who cares?"
+} -returnCodes error -result {expected boolean value but got "who cares?"}
+test pack-12.13 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -fill z
+} -returnCodes error -result {bad fill style "z": must be none, x, y, or both}
+test pack-12.14 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -in z
+} -returnCodes error -result {bad window path name "z"}
+set pad [winfo pixels .pack 1c]
+test pack-12.15 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -padx abc
+} -returnCodes error -result {bad pad value "abc": must be positive screen distance}
+test pack-12.16 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -padx {5 abc}
+} -returnCodes error -result {bad 2nd pad value "abc": must be positive screen distance}
+test pack-12.17 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -padx -1
+} -returnCodes error -result {bad pad value "-1": must be positive screen distance}
+test pack-12.18 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -padx {5 -1}
+} -returnCodes error -result {bad 2nd pad value "-1": must be positive screen distance}
+test pack-12.19 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -pady abc
+} -returnCodes error -result {bad pad value "abc": must be positive screen distance}
+test pack-12.20 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -pady {0 abc}
+} -returnCodes error -result {bad 2nd pad value "abc": must be positive screen distance}
+test pack-12.21 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -pady -1
+} -returnCodes error -result {bad pad value "-1": must be positive screen distance}
+test pack-12.22 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -pady {0 -1}
+} -returnCodes error -result {bad 2nd pad value "-1": must be positive screen distance}
+test pack-12.23 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipadx abc
+} -returnCodes error -result {bad ipadx value "abc": must be positive screen distance}
+test pack-12.24 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipadx -1
+} -returnCodes error -result {bad ipadx value "-1": must be positive screen distance}
+test pack-12.25 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipadx {5 5}
+} -returnCodes error -result {bad ipadx value "5 5": must be positive screen distance}
+test pack-12.26 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipady abc
+} -returnCodes error -result {bad ipady value "abc": must be positive screen distance}
+test pack-12.27 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipady -1
+} -returnCodes error -result {bad ipady value "-1": must be positive screen distance}
+test pack-12.28 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -ipady {5 5}
+} -returnCodes error -result {bad ipady value "5 5": must be positive screen distance}
+test pack-12.29 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -side bac
+} -returnCodes error -result {bad side "bac": must be top, bottom, left, or right}
+test pack-12.30 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -lousy bac
+} -returnCodes error -result {bad option "-lousy": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}
+test pack-12.31 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -padx
+} -returnCodes error -result {extra option "-padx" (option with no value?)}
+test pack-12.32 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a ? 22
+} -returnCodes error -result {bad option "?": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}
+test pack-12.33 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a -in .
+} -returnCodes error -result {can't pack .pack.a inside .}
+test pack-12.34 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
frame .pack.a.a
- list [catch {pack .pack.a.a -in .pack.b} msg] $msg
-} {1 {can't pack .pack.a.a inside .pack.b}}
-test pack-12.29 {command options and errors} {
+ pack .pack.a.a -in .pack.b
+} -returnCodes error -result {can't pack .pack.a.a inside .pack.b}
+test pack-12.35 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack .pack.a -in .pack.a} msg] $msg
-} {1 {can't pack .pack.a inside itself}}
-test pack-12.30 {command options and errors} {
+} -body {
+ pack .pack.a -in .pack.a
+} -returnCodes error -result {can't pack .pack.a inside itself}
+test pack-12.36 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a .pack.b .pack.c .pack.d
pack forget .pack.a .pack.d
pack slaves .pack
-} {.pack.b .pack.c}
-test pack-12.31 {command options and errors} {
+} -result {.pack.b .pack.c}
+test pack-12.37 {command options and errors} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
.pack configure -width 300 -height 200
pack propagate .pack 0
pack .pack.a
@@ -831,63 +1303,77 @@ test pack-12.31 {command options and errors} {
pack propagate .pack 1
update
lappend result [winfo reqwidth .pack] [winfo reqheight .pack]
- set result
-} {300 200 20 40}
-test pack-12.32 {command options and errors} {
+ return $result
+} -result {300 200 20 40}
+test pack-12.38 {command options and errors} -body {
set result [pack propagate .pack.d]
pack propagate .pack.d 0
lappend result [pack propagate .pack.d]
pack propagate .pack.d 1
lappend result [pack propagate .pack.d]
- set result
-} {1 0 1}
-test pack-12.33 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack propagate .dum} msg] $msg
-} {1 {bad window path name ".dum"}}
-test pack-12.34 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack propagate .pack foo} msg] $msg
-} {1 {expected boolean value but got "foo"}}
-test pack-12.35 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack propagate .pack foo bar} msg] $msg
-} {1 {wrong # args: should be "pack propagate window ?boolean?"}}
-test pack-12.36 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack slaves} msg] $msg
-} {1 {wrong # args: should be "pack option arg ?arg ...?"}}
-test pack-12.37 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack slaves a b} msg] $msg
-} {1 {wrong # args: should be "pack slaves window"}}
-test pack-12.38 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack slaves .x} msg] $msg
-} {1 {bad window path name ".x"}}
-test pack-12.39 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack slaves .pack.a} msg] $msg
-} {0 {}}
-test pack-12.40 {command options and errors} {
- pack forget .pack.a .pack.b .pack.c .pack.d
- list [catch {pack lousy .pack} msg] $msg
-} {1 {bad option "lousy": must be configure, forget, info, propagate, or slaves}}
+ return $result
+} -result {1 0 1}
+test pack-12.39 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack propagate .dum
+} -returnCodes error -result {bad window path name ".dum"}
+test pack-12.40 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack propagate .pack foo
+} -returnCodes error -result {expected boolean value but got "foo"}
+test pack-12.41 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack propagate .pack foo bar
+} -returnCodes error -result {wrong # args: should be "pack propagate window ?boolean?"}
+test pack-12.42 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack slaves
+} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"}
+test pack-12.43 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack slaves a b
+} -returnCodes error -result {wrong # args: should be "pack slaves window"}
+test pack-12.44 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack slaves .x
+} -returnCodes error -result {bad window path name ".x"}
+test pack-12.45 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack slaves .pack.a
+} -returnCodes ok -result {}
+test pack-12.46 {command options and errors} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack lousy .pack
+} -returnCodes error -result {bad option "lousy": must be configure, forget, info, propagate, or slaves}
-pack .pack.right -side right
-pack .pack.bottom -side bottom
-test pack-13.1 {window deletion} {
- pack forget .pack.a .pack.b .pack.c .pack.d
+
+test pack-13.1 {window deletion} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom
+} -body {
+ pack .pack.right -side right
+ pack .pack.bottom -side bottom
pack .pack.a .pack.d .pack.b .pack.c -side top
update
destroy .pack.d
update
set result [list [pack slaves .pack] [winfo geometry .pack.a] \
- [winfo geometry .pack.b] [winfo geometry .pack.c]]
-} {{.pack.right .pack.bottom .pack.a .pack.b .pack.c} 20x40+30+0 50x30+15+40 80x80+0+70}
+ [winfo geometry .pack.b] [winfo geometry .pack.c]]
+} -result {{.pack.right .pack.bottom .pack.a .pack.b .pack.c} 20x40+30+0 50x30+15+40 80x80+0+70}
-test pack-14.1 {respond to changes in expansion} {
- pack forget .pack.a .pack.b .pack.c .pack.d
+
+test pack-14.1 {respond to changes in expansion} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d .pack.right .pack.bottom
+} -body {
+ pack .pack.right -side right
+ pack .pack.bottom -side bottom
wm geom .pack {}
pack .pack.a
update
@@ -898,11 +1384,15 @@ test pack-14.1 {respond to changes in expansion} {
pack .pack.a -expand true -fill both
update
lappend result [winfo geom .pack.a]
-} {20x40+0+0 20x40+90+0 200x150+0+0}
-wm geom .pack {}
+} -cleanup {
+ wm geom .pack {}
+} -result {20x40+0+0 20x40+90+0 200x150+0+0}
-test pack-15.1 {managing geometry with -in option} {
+
+test pack-15.1 {managing geometry with -in option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+ destroy .pack.f
+} -body {
pack .pack.a -side top
frame .pack.f
lower .pack.f
@@ -916,10 +1406,13 @@ test pack-15.1 {managing geometry with -in option} {
pack unpack .pack.a
update
lappend result [winfo geom .pack.b]
-} {50x30+0+40 50x30+0+0}
-catch {destroy .pack.f}
-test pack-15.2 {managing geometry with -in option} {
+} -cleanup {
+ destroy .pack.f
+} -result {50x30+0+40 50x30+0+0}
+test pack-15.2 {managing geometry with -in option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+ destroy .pack.f
+} -body {
frame .pack.f
lower .pack.f
pack .pack.a -in .pack.f -side top
@@ -931,10 +1424,13 @@ test pack-15.2 {managing geometry with -in option} {
place forget .pack.f
update
lappend result [winfo ismapped .pack.a]
-} {0 1 20x40+30+45 0}
-catch {destroy .pack.f}
-test pack-15.3 {managing geometry with -in option} {
+} -cleanup {
+ destroy .pack.f
+} -result {0 1 20x40+30+45 0}
+test pack-15.3 {managing geometry with -in option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+ destroy .pack.f
+} -body {
pack .pack.a -side top
frame .pack.f
lower .pack.f
@@ -948,15 +1444,18 @@ test pack-15.3 {managing geometry with -in option} {
pack unpack .pack.f
update
lappend result [winfo ismapped .pack.b]
-} {1 0}
-catch {destroy .pack.f}
-test pack-15.4 {managing geometry with -in option} {
+} -cleanup {
+ destroy .pack.f
+} -result {1 0}
+test pack-15.4 {managing geometry with -in option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+ destroy .pack.f1 .pack.f2
+} -body {
foreach i {1 2} {
- frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised
- lower .pack.f$i
- pack propagate .pack.f$i 0
- pack .pack.f$i -side top
+ frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised
+ lower .pack.f$i
+ pack propagate .pack.f$i 0
+ pack .pack.f$i -side top
}
pack .pack.b -in .pack.f1 -side right
update
@@ -971,15 +1470,18 @@ test pack-15.4 {managing geometry with -in option} {
pack forget .pack.b
update
lappend result [winfo geometry .pack.b] [winfo ismapped .pack.b]
-} {50x30+48+5 1 50x30+25+48 1 50x30+25+28 1 50x30+25+28 0}
-catch {destroy .pack.f1 .pack.f2}
-test pack-15.5 {managing geometry with -in option} {
+} -cleanup {
+ destroy .pack.f1 .pack.f2
+} -result {50x30+48+5 1 50x30+25+48 1 50x30+25+28 1 50x30+25+28 0}
+test pack-15.5 {managing geometry with -in option} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+ destroy .pack.f1 .pack.f2
+} -body {
foreach i {1 2} {
- frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised
- lower .pack.f$i
- pack propagate .pack.f$i 0
- pack .pack.f$i -side top
+ frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised
+ lower .pack.f$i
+ pack propagate .pack.f$i 0
+ pack .pack.f$i -side top
}
pack .pack.b -in .pack.f2 -side top
update
@@ -988,30 +1490,50 @@ test pack-15.5 {managing geometry with -in option} {
pack .pack.a -before .pack.b -side top
update
lappend result [winfo geometry .pack.b] [winfo ismapped .pack.b]
-} {50x16+25+22 1 50x16+25+22 0}
-catch {destroy .pack.f1 .pack.f2}
+} -cleanup {
+ destroy .pack.f1 .pack.f2
+} -result {50x16+25+22 1 50x16+25+22 0}
+
-test pack-16.1 {geometry manager name} {
+test pack-16.1 {geometry manager name} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
set result {}
+} -body {
lappend result [winfo manager .pack.a]
pack .pack.a
lappend result [winfo manager .pack.a]
pack forget .pack.a
lappend result [winfo manager .pack.a]
-} {{} pack {}}
+} -result {{} pack {}}
+
-test pack-17.1 {PackLostSlaveProc procedure} {
+test pack-17.1 {PackLostSlaveProc procedure} -setup {
pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
pack .pack.a
update
place .pack.a -x 40 -y 10
update
- list [winfo manager .pack.a] [winfo geometry .pack.a] \
- [catch {pack info .pack.a} msg] $msg
-} {place 20x40+40+10 1 {window ".pack.a" isn't packed}}
+ list [winfo manager .pack.a] [winfo geometry .pack.a]
+} -result {place 20x40+40+10}
+test pack-17.2 {PackLostSlaveProc procedure} -setup {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+} -body {
+ pack .pack.a
+ update
+ place .pack.a -x 40 -y 10
+ update
+ winfo manager .pack.a
+ winfo geometry .pack.a
+ pack info .pack.a
+} -returnCodes error -result {window ".pack.a" isn't packed}
+
-test pack-18.1 {unmap slaves when master unmapped} {tempNotPc} {
+test pack-18.1 {unmap slaves when master unmapped} -constraints {
+ tempNotPc
+} -setup {
+ eval destroy [winfo child .pack]
+} -body {
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
@@ -1034,19 +1556,20 @@ test pack-18.1 {unmap slaves when master unmapped} {tempNotPc} {
.pack.a configure -width 200 -height 75
update
lappend result [winfo width .pack.a ] [winfo height .pack.a] \
- [winfo ismapped .pack.a]
+ [winfo ismapped .pack.a]
wm deiconify .pack
update
lappend result [winfo ismapped .pack.a]
-} {1 0 200 75 0 1}
-test pack-18.2 {unmap slaves when master unmapped} {
+} -result {1 0 200 75 0 1}
+test pack-18.2 {unmap slaves when master unmapped} -setup {
+ eval destroy [winfo child .pack]
+} -body {
# adjust the position of .pack before test to avoid a screen switch
# that occurs with window managers that have desktops four times as big
# as the screen (screen switch causes scale and other tests to fail).
wm geometry .pack +100+100
- eval destroy [winfo child .pack]
frame .pack.a -relief raised -bd 2
frame .pack.b -width 70 -height 30 -relief sunken -bd 2
pack .pack.a
@@ -1059,15 +1582,17 @@ test pack-18.2 {unmap slaves when master unmapped} {
.pack.b configure -width 100 -height 30
update
lappend result [winfo width .pack.b ] [winfo height .pack.b] \
- [winfo ismapped .pack.b]
+ [winfo ismapped .pack.b]
wm deiconify .pack
update
lappend result [winfo ismapped .pack.b]
-} {1 0 100 30 0 1}
+} -result {1 0 100 30 0 1}
+
-test pack-19.1 {test respect for internalborder} {
+test pack-19.1 {test respect for internalborder} -setup {
catch {eval pack forget [pack slaves .pack]}
destroy .pack.l .pack.lf
+} -body {
wm geometry .pack 200x200
frame .pack.l -width 15 -height 10
labelframe .pack.lf -labelwidget .pack.l
@@ -1079,12 +1604,13 @@ test pack-19.1 {test respect for internalborder} {
.pack.lf configure -labelanchor e -padx 3 -pady 5
update
lappend res [winfo geometry .pack.lf.f]
+} -cleanup {
destroy .pack.l .pack.lf
- set res
-} {196x188+2+10 177x186+5+7}
-test pack-19.2 {test support for minreqsize} {
+} -result {196x188+2+10 177x186+5+7}
+test pack-19.2 {test support for minreqsize} -setup {
catch {eval pack forget [pack slaves .pack]}
destroy .pack.l .pack.lf
+} -body {
wm geometry .pack {}
frame .pack.l -width 150 -height 100
labelframe .pack.lf -labelwidget .pack.l
@@ -1096,15 +1622,14 @@ test pack-19.2 {test support for minreqsize} {
.pack.lf configure -labelanchor ws
update
lappend res [winfo geometry .pack.lf]
+} -cleanup {
destroy .pack.l .pack.lf
- set res
-} {162x127+0+0 172x112+0+0}
+} -result {162x127+0+0 172x112+0+0}
-destroy .pack
-foreach i {pack1 pack2 pack3 pack4} {
- rename $i {}
-}
# cleanup
cleanupTests
return
+
+
+
diff --git a/tests/packgrid.test b/tests/packgrid.test
new file mode 100644
index 0000000..355b49d
--- /dev/null
+++ b/tests/packgrid.test
@@ -0,0 +1,250 @@
+# This file is a Tcl script to test out interaction between Tk's "pack" and
+# "grid" commands.
+# It is organized in the standard fashion for Tcl tests.
+#
+# Copyright (c) 2008 Peter Spjuth
+# All rights reserved.
+
+package require tcltest 2.2
+eval tcltest::configure $argv
+tcltest::loadTestedCommands
+namespace import -force tcltest::*
+
+test packgrid-1.1 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Basic conflict
+ grid .g
+ pack .p
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager pack inside . which already has slaves managed by grid}
+
+test packgrid-1.2 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Basic conflict
+ pack .p
+ grid .g
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager grid inside . which already has slaves managed by pack}
+
+test packgrid-1.3 {pack and grid in same master} -setup {
+ grid propagate . false
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok if one is non-propagating
+ grid .g
+ pack .p
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-1.4 {pack and grid in same master} -setup {
+ grid propagate . false
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok if one is non-propagating
+ pack .p
+ grid .g
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-1.5 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . false
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok if one is non-propagating
+ grid .g
+ pack .p
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-1.6 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . false
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok if one is non-propagating
+ pack .p
+ grid .g
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-1.7 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Basic conflict should stop widget from being handled
+ grid .g
+ catch { pack .p }
+ pack slaves .
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-1.8 {pack and grid in same master} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Basic conflict should stop widget from being handled
+ pack .p
+ catch { grid .g }
+ grid slaves .
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-2.1 {pack and grid in same master, change propagation} -setup {
+ grid propagate . false
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+ pack .p
+ grid .g
+ update
+} -body {
+ grid propagate . true
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager grid inside . which already has slaves managed by pack}
+
+test packgrid-2.2 {pack and grid in same master, change propagation} -setup {
+ grid propagate . true
+ pack propagate . false
+ label .p -text PACK
+ label .g -text GRID
+ pack .p
+ grid .g
+ update
+} -body {
+ pack propagate . true
+} -returnCodes error -cleanup {
+ destroy .p
+ update
+ destroy .g
+} -result {cannot use geometry manager pack inside . which already has slaves managed by grid}
+
+test packgrid-2.3 {pack and grid in same master, change propagation} -setup {
+ grid propagate . false
+ pack propagate . false
+ label .p -text PACK
+ label .g -text GRID
+ pack .p
+ grid .g
+ update
+} -body {
+ grid propagate . true
+ update
+ pack propagate . true
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager pack inside . which already has slaves managed by grid}
+
+test packgrid-2.4 {pack and grid in same master, change propagation} -setup {
+ grid propagate . false
+ pack propagate . false
+ label .p -text PACK
+ label .g -text GRID
+ pack .p
+ grid .g
+ update
+} -body {
+ pack propagate . true
+ grid propagate . true
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager grid inside . which already has slaves managed by pack}
+
+test packgrid-3.1 {stealing slave} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok to steal if the other one is emptied
+ grid .g
+ pack .g
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-3.2 {stealing slave} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Ok to steal if the other one is emptied
+ pack .g
+ grid .g
+} -cleanup {
+ destroy .p
+ destroy .g
+} -result {}
+
+test packgrid-3.3 {stealing slave} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Not ok to steal if the other one is not emptied
+ grid .g
+ grid .p
+ pack .g
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager pack inside . which already has slaves managed by grid}
+
+test packgrid-3.4 {stealing slave} -setup {
+ grid propagate . true
+ pack propagate . true
+ label .p -text PACK
+ label .g -text GRID
+} -body {
+ # Not ok to steal if the other one is not emptied
+ pack .g
+ pack .p
+ grid .g
+} -returnCodes error -cleanup {
+ destroy .p
+ destroy .g
+} -result {cannot use geometry manager grid inside . which already has slaves managed by pack}
+
+cleanupTests
+return
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index c7d84b8..f2e01e8 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -6,123 +6,312 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
-set i 1
+deleteWindows
+# Panedwindow for tests 1.*
panedwindow .p
-foreach {testName testData} {
- panedwindow-1.1 {-background
- "#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
- panedwindow-1.2 {-bd
- 4 4 badValue {bad screen distance "badValue"}}
- panedwindow-1.3 {-bg
- "#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
- panedwindow-1.4 {-borderwidth
- 1.3 1 badValue {bad screen distance "badValue"}}
- panedwindow-1.5 {-cursor
- arrow arrow badValue {bad cursor spec "badValue"}}
- panedwindow-1.6 {-handlesize
- 20 20 badValue {bad screen distance "badValue"}}
- panedwindow-1.7 {-height
- 20 20 badValue {bad screen distance "badValue"}}
- panedwindow-1.8 {-opaqueresize
- true 1 foo {expected boolean value but got "foo"}}
- panedwindow-1.9 {-orient
- horizontal horizontal
- badValue {bad orient "badValue": must be horizontal or vertical}}
- panedwindow-1.10 {-relief
- groove groove
- 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
- panedwindow-1.11 {-sashcursor
- arrow arrow badValue {bad cursor spec "badValue"}}
- panedwindow-1.12 {-sashpad
- 1.3 1 badValue {bad screen distance "badValue"}}
- panedwindow-1.13 {-sashrelief
- groove groove
- 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
- panedwindow-1.14 {-sashwidth
- 10 10 badValue {bad screen distance "badValue"}}
- panedwindow-1.15 {-showhandle
- true 1 foo {expected boolean value but got "foo"}}
- panedwindow-1.16 {-width
- 402 402 badValue {bad screen distance "badValue"}}
-} {
- lassign $testData optionName goodIn goodOut badIn badOut
- test ${testName}(good) "configuration options: $optionName" {
- .p configure $optionName $goodIn
- list [lindex [.p configure $optionName] 4] [.p cget $optionName]
- } [list $goodOut $goodOut]
- test ${testName}(bad) "configuration options: $optionName" -body {
- .p configure $optionName $badIn
- } -returnCodes error -result $badOut
- # Reset to default
- .p configure $optionName [lindex [.p configure $optionName] 3]
-}
+# Buttons for tests 1.33 - 1.52
.p add [button .b]
.p add [button .c]
-foreach {testName testData} {
- panedwindow-1a.1 {-after .c .c badValue {bad window path name "badValue"}}
- panedwindow-1a.2 {-before .c .c badValue {bad window path name "badValue"}}
- panedwindow-1a.3 {-height 10 10 badValue {bad screen distance "badValue"}}
- panedwindow-1a.4 {-hide false 0 foo {expected boolean value but got "foo"}}
- panedwindow-1a.5 {-minsize 10 10 badValue {bad screen distance "badValue"}}
- panedwindow-1a.6 {-padx 1.3 1 badValue {bad screen distance "badValue"}}
- panedwindow-1a.7 {-pady 1.3 1 badValue {bad screen distance "badValue"}}
- panedwindow-1a.8 {-sticky nsew nesw abcd {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}}
- panedwindow-1a.9 {-stretch alw always foo {bad stretch "foo": must be always, first, last, middle, or never}}
- panedwindow-1a.10 {-width 10 10 badValue {bad screen distance "badValue"}}
-} {
- lassign $testData optionName goodIn goodOut badIn badOut
- test ${testName}(good) "configuration options: $optionName" {
- .p paneconfigure .b $optionName $goodIn
- list [lindex [.p paneconfigure .b $optionName] 4] \
- [.p panecget .b $optionName]
- } [list $goodOut $goodOut]
- test ${testName}(bad) "configuration options: $optionName" -body {
- .p paneconfigure .b $optionName $badIn
- } -returnCodes error -result $badOut
- # Reset to default
- .p paneconfig .b $optionName [lindex [.p paneconfig .b $optionName] 3]
-}
-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-1.1 {configuration options: -background (good)} -body {
+ .p configure -background #ff0000
+ list [lindex [.p configure -background] 4] [.p cget -background]
+} -cleanup {
+ .p configure -background [lindex [.p configure -background] 3]
+} -result {{#ff0000} #ff0000}
+test panedwindow-1.2 {configuration options: -background (bad)} -body {
+ .p configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test panedwindow-1.3 {configuration options: -bd (good)} -body {
+ .p configure -bd 4
+ list [lindex [.p configure -bd] 4] [.p cget -bd]
+} -cleanup {
+ .p configure -bd [lindex [.p configure -bd] 3]
+} -result {4 4}
+test panedwindow-1.4 {configuration options: -bd (bad)} -body {
+ .p configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.5 {configuration options: -bg (good)} -body {
+ .p configure -bg #ff0000
+ list [lindex [.p configure -bg] 4] [.p cget -bg]
+} -cleanup {
+ .p configure -bg [lindex [.p configure -bg] 3]
+} -result {{#ff0000} #ff0000}
+test panedwindow-1.6 {configuration options: -bg (bad)} -body {
+ .p configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test panedwindow-1.7 {configuration options: -borderwidth (good)} -body {
+ .p configure -borderwidth 1.3
+ list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth]
+} -cleanup {
+ .p configure -borderwidth [lindex [.p configure -borderwidth] 3]
+} -result {1 1}
+test panedwindow-1.8 {configuration options: -borderwidth (bad)} -body {
+ .p configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.9 {configuration options: -cursor (good)} -body {
+ .p configure -cursor arrow
+ list [lindex [.p configure -cursor] 4] [.p cget -cursor]
+} -cleanup {
+ .p configure -cursor [lindex [.p configure -cursor] 3]
+} -result {arrow arrow}
+test panedwindow-1.10 {configuration options: -cursor (bad)} -body {
+ .p configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test panedwindow-1.11 {configuration options: -handlesize (good)} -body {
+ .p configure -handlesize 20
+ list [lindex [.p configure -handlesize] 4] [.p cget -handlesize]
+} -cleanup {
+ .p configure -handlesize [lindex [.p configure -handlesize] 3]
+} -result {20 20}
+test panedwindow-1.12 {configuration options: -handlesize (bad)} -body {
+ .p configure -handlesize badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.13 {configuration options: -height (good)} -body {
+ .p configure -height 20
+ list [lindex [.p configure -height] 4] [.p cget -height]
+} -cleanup {
+ .p configure -height [lindex [.p configure -height] 3]
+} -result {20 20}
+test panedwindow-1.14 {configuration options: -height (bad)} -body {
+ .p configure -height badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.15 {configuration options: -opaqueresize (good)} -body {
+ .p configure -opaqueresize true
+ list [lindex [.p configure -opaqueresize] 4] [.p cget -opaqueresize]
+} -cleanup {
+ .p configure -opaqueresize [lindex [.p configure -opaqueresize] 3]
+} -result {1 1}
+test panedwindow-1.16 {configuration options: -opaqueresize (bad)} -body {
+ .p configure -opaqueresize foo
+} -returnCodes error -result {expected boolean value but got "foo"}
+test panedwindow-1.17 {configuration options: -orient (good)} -body {
+ .p configure -orient horizontal
+ list [lindex [.p configure -orient] 4] [.p cget -orient]
+} -cleanup {
+ .p configure -orient [lindex [.p configure -orient] 3]
+} -result {horizontal horizontal}
+test panedwindow-1.18 {configuration options: -orient (bad)} -body {
+ .p configure -orient badValue
+} -returnCodes error -result {bad orient "badValue": must be horizontal or vertical}
+test panedwindow-1.19 {configuration options: -relief (good)} -body {
+ .p configure -relief groove
+ list [lindex [.p configure -relief] 4] [.p cget -relief]
+} -cleanup {
+ .p configure -relief [lindex [.p configure -relief] 3]
+} -result {groove groove}
+test panedwindow-1.20 {configuration options: -relief (bad)} -body {
+ .p configure -relief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test panedwindow-1.21 {configuration options: -sashcursor (good)} -body {
+ .p configure -sashcursor arrow
+ list [lindex [.p configure -sashcursor] 4] [.p cget -sashcursor]
+} -cleanup {
+ .p configure -sashcursor [lindex [.p configure -sashcursor] 3]
+} -result {arrow arrow}
+test panedwindow-1.22 {configuration options: -sashcursor (bad)} -body {
+ .p configure -sashcursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test panedwindow-1.23 {configuration options: -sashpad (good)} -body {
+ .p configure -sashpad 1.3
+ list [lindex [.p configure -sashpad] 4] [.p cget -sashpad]
+} -cleanup {
+ .p configure -sashpad [lindex [.p configure -sashpad] 3]
+} -result {1 1}
+test panedwindow-1.24 {configuration options: -sashpad (bad)} -body {
+ .p configure -sashpad badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.25 {configuration options: -sashrelief (good)} -body {
+ .p configure -sashrelief groove
+ list [lindex [.p configure -sashrelief] 4] [.p cget -sashrelief]
+} -cleanup {
+ .p configure -sashrelief [lindex [.p configure -sashrelief] 3]
+} -result {groove groove}
+test panedwindow-1.26 {configuration options: -sashrelief (bad)} -body {
+ .p configure -sashrelief 1.5
+} -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+test panedwindow-1.27 {configuration options: -sashwidth (good)} -body {
+ .p configure -sashwidth 10
+ list [lindex [.p configure -sashwidth] 4] [.p cget -sashwidth]
+} -cleanup {
+ .p configure -sashwidth [lindex [.p configure -sashwidth] 3]
+} -result {10 10}
+test panedwindow-1.28 {configuration options: -sashwidth (bad)} -body {
+ .p configure -sashwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.29 {configuration options: -showhandle (good)} -body {
+ .p configure -showhandle true
+ list [lindex [.p configure -showhandle] 4] [.p cget -showhandle]
+} -cleanup {
+ .p configure -showhandle [lindex [.p configure -showhandle] 3]
+} -result {1 1}
+test panedwindow-1.30 {configuration options: -showhandle (bad)} -body {
+ .p configure -showhandle foo
+} -returnCodes error -result {expected boolean value but got "foo"}
+test panedwindow-1.31 {configuration options: -width (good)} -body {
+ .p configure -width 402
+ list [lindex [.p configure -width] 4] [.p cget -width]
+} -cleanup {
+ .p configure -width [lindex [.p configure -width] 3]
+} -result {402 402}
+test panedwindow-1.32 {configuration options: -width (bad)} -body {
+ .p configure -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+
+test panedwindow-1.33 {configuration options: -after (good)} -body {
+ .p paneconfigure .b -after .c
+ list [lindex [.p paneconfigure .b -after] 4] \
+ [.p panecget .b -after]
+} -cleanup {
+ .p paneconfig .b -after [lindex [.p paneconfig .b -after] 3]
+} -result {.c .c}
+test panedwindow-1.34 {configuration options: -after (bad)} -body {
+ .p paneconfigure .b -after badValue
+} -returnCodes error -result {bad window path name "badValue"}
+test panedwindow-1.35 {configuration options: -before (good)} -body {
+ .p paneconfigure .b -before .c
+ list [lindex [.p paneconfigure .b -before] 4] \
+ [.p panecget .b -before]
+} -cleanup {
+ .p paneconfig .b -before [lindex [.p paneconfig .b -before] 3]
+} -result {.c .c}
+test panedwindow-1.36 {configuration options: -before (bad)} -body {
+ .p paneconfigure .b -before badValue
+} -returnCodes error -result {bad window path name "badValue"}
+test panedwindow-1.37 {configuration options: -height (good)} -body {
+ .p paneconfigure .b -height 10
+ list [lindex [.p paneconfigure .b -height] 4] \
+ [.p panecget .b -height]
+} -cleanup {
+ .p paneconfig .b -height [lindex [.p paneconfig .b -height] 3]
+} -result {10 10}
+test panedwindow-1.38 {configuration options: -height (bad)} -body {
+ .p paneconfigure .b -height badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.39 {configuration options: -hide (good)} -body {
+ .p paneconfigure .b -hide false
+ list [lindex [.p paneconfigure .b -hide] 4] \
+ [.p panecget .b -hide]
+} -cleanup {
+ .p paneconfig .b -hide [lindex [.p paneconfig .b -hide] 3]
+} -result {0 0}
+test panedwindow-1.40 {configuration options: -hide (bad)} -body {
+ .p paneconfigure .b -hide foo
+} -returnCodes error -result {expected boolean value but got "foo"}
+test panedwindow-1.41 {configuration options: -minsize (good)} -body {
+ .p paneconfigure .b -minsize 10
+ list [lindex [.p paneconfigure .b -minsize] 4] \
+ [.p panecget .b -minsize]
+} -cleanup {
+ .p paneconfig .b -minsize [lindex [.p paneconfig .b -minsize] 3]
+} -result {10 10}
+test panedwindow-1.42 {configuration options: -minsize (bad)} -body {
+ .p paneconfigure .b -minsize badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.43 {configuration options: -padx (good)} -body {
+ .p paneconfigure .b -padx 1.3
+ list [lindex [.p paneconfigure .b -padx] 4] \
+ [.p panecget .b -padx]
+} -cleanup {
+ .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3]
+} -result {1 1}
+test panedwindow-1.44 {configuration options: -padx (bad)} -body {
+ .p paneconfigure .b -padx badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.45 {configuration options: -pady (good)} -body {
+ .p paneconfigure .b -pady 1.3
+ list [lindex [.p paneconfigure .b -pady] 4] \
+ [.p panecget .b -pady]
+} -cleanup {
+ .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3]
+} -result {1 1}
+test panedwindow-1.46 {configuration options: -pady (bad)} -body {
+ .p paneconfigure .b -pady badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test panedwindow-1.47 {configuration options: -sticky (good)} -body {
+ .p paneconfigure .b -sticky nsew
+ list [lindex [.p paneconfigure .b -sticky] 4] \
+ [.p panecget .b -sticky]
+} -cleanup {
+ .p paneconfig .b -sticky [lindex [.p paneconfig .b -sticky] 3]
+} -result {nesw nesw}
+test panedwindow-1.48 {configuration options: -sticky (bad)} -body {
+ .p paneconfigure .b -sticky abcd
+} -returnCodes error -result {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}
+test panedwindow-1.49 {configuration options: -stretch (good)} -body {
+ .p paneconfigure .b -stretch alw
+ list [lindex [.p paneconfigure .b -stretch] 4] \
+ [.p panecget .b -stretch]
+} -cleanup {
+ .p paneconfig .b -stretch [lindex [.p paneconfig .b -stretch] 3]
+} -result {always always}
+test panedwindow-1.50 {configuration options: -stretch (bad)} -body {
+ .p paneconfigure .b -stretch foo
+} -returnCodes error -result {bad stretch "foo": must be always, first, last, middle, or never}
+test panedwindow-1.51 {configuration options: -width (good)} -body {
+ .p paneconfigure .b -width 10
+ list [lindex [.p paneconfigure .b -width] 4] \
+ [.p panecget .b -width]
+} -cleanup {
+ .p paneconfig .b -width [lindex [.p paneconfig .b -width] 3]
+} -result {10 10}
+test panedwindow-1.52 {configuration options: -width (bad)} -body {
+ .p paneconfigure .b -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+deleteWindows
+
+
+test panedwindow-2.1 {panedwindow widget command} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p
+ .p foo
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}
-test panedwindow-3.1 {panedwindow panes subcommand} {
+
+test panedwindow-3.1 {panedwindow panes subcommand} -setup {
+ deleteWindows
+} -body {
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]]
+} -cleanup {
+ deleteWindows
+} -result [list [list .b .c] [list .c]]
+
-test panedwindow-4.1 {forget subcommand} {
+test panedwindow-4.1 {forget subcommand} -setup {
+ deleteWindows
+} -body {
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} {
+ .p forget
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p forget widget ?widget ...?"}
+test panedwindow-4.2 {forget subcommand, forget one from start} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list {.b .c} .c]
+test panedwindow-4.3 {forget subcommand, forget one from end} -setup {
+ deleteWindows
+} -body {
panedwindow .p
.p add [button .b]
.p add [button .c]
@@ -131,10 +320,12 @@ test panedwindow-4.3 {forget subcommand, forget one from end} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list {.b .c .d} {.b .c}]
+test panedwindow-4.4 {forget subcommand, forget multiple} -setup {
+ deleteWindows
+} -body {
panedwindow .p
.p add [button .b]
.p add [button .c]
@@ -143,317 +334,401 @@ test panedwindow-4.4 {forget subcommand, forget multiple} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list {.b .c .d} .d]
+test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list 1 1 0 1]
+test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup {
+ deleteWindows
+} -body {
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]
+} -cleanup {
+ deleteWindows
+} -result [list 44 20]
+
-test panedwindow-5.1 {sash subcommand} {
+test panedwindow-5.1 {sash subcommand} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p sash option ?arg ...?"}
+test panedwindow-5.2 {sash subcommand} -setup {
+ deleteWindows
+} -body {
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"]
+ .p sash foo
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad option "foo": must be coord, dragto, mark, or place}
-test panedwindow-6.1 {sash coord subcommand, errors} {
+
+test panedwindow-6.1 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p sash coord index"}
+test panedwindow-6.2 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid sash index}
+test panedwindow-6.3 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord foo
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 22 0]
+test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 50 0]
+test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 22]
+test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 0 50]
+test panedwindow-6.8 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ list [catch {.p sash coord -1} msg] $msg \
+ [catch {.p sash coord 0} msg] $msg \
+ [catch {.p sash coord 1} msg] $msg
+} -cleanup {
+ deleteWindows
+} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
+test panedwindow-6.9 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
# There are no sashes until you have 2 panes
panedwindow .p
.p add [frame .p.f]
- set result [list \
- [catch {.p sash coord -1} msg] $msg \
+ 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.10 {sash coord subcommand, errors} {
+ [catch {.p sash coord 1} msg] $msg
+} -cleanup {
+ deleteWindows
+} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
+test panedwindow-6.10 {sash coord subcommand, errors} -setup {
+ deleteWindows
+} -body {
# There are no sashes until you have 2 panes
panedwindow .p
.p add [frame .p.f] [frame .p.f2]
- set result [list \
- [catch {.p sash coord -1} msg] $msg \
+ list [catch {.p sash coord -1} msg] $msg \
[catch {.p sash coord 0} msg] \
[catch {.p sash coord 1} msg] $msg \
- [catch {.p sash coord 2} msg] $msg \
- ]
- destroy .p
- set result
-} [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]
+ [catch {.p sash coord 2} msg] $msg
+} -cleanup {
+ deleteWindows
+} -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]
+
-test panedwindow-8.1 {sash mark subcommand, errors} {
+test panedwindow-7.1 {sash mark subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p sash mark index ?x y?"}
+test panedwindow-7.2 {sash mark subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark foo
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-7.3 {sash mark subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid sash index}
+test panedwindow-7.4 {sash mark subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-7.5 {sash mark subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark 0 0 bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "bar"}
+test panedwindow-7.6 {sash mark subcommand, mark defaults to 0 0} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash mark 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 0]
+test panedwindow-7.7 {sash mark subcommand, set mark} -setup {
+ deleteWindows
+} -body {
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]
+ .p sash mark 0
+} -cleanup {
+ deleteWindows
+} -result [list 10 10]
+
-test panedwindow-9.1 {sash dragto subcommand, errors} {
+test panedwindow-8.1 {sash dragto subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash dragto
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p sash dragto index x y"}
+test panedwindow-8.2 {sash dragto subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash dragto foo bar baz
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-8.3 {sash dragto subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash dragto 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid sash index}
+test panedwindow-8.4 {sash dragto subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash dragto 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-8.5 {sash dragto subcommand, errors} -setup {
+ deleteWindows
+} -body {
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\""]
+ .p sash dragto 0 0 bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "bar"}
-test panedwindow-10.1 {sash mark/sash dragto interaction} {
+
+test panedwindow-9.1 {sash mark/sash dragto interaction} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 30 0]
+test panedwindow-9.2 {sash mark/sash dragto interaction} -setup {
+ deleteWindows
+} -body {
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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 30]
+test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup {
+ deleteWindows
+} -body {
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]
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 15 0]
+
-test panedwindow-11.1 {sash place subcommand, errors} {
+test panedwindow-10.1 {sash place subcommand, errors} -setup {
+ deleteWindows
+} -body {
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} {
- destroy .p
+ .p sash place
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p sash place index x y"}
+test panedwindow-10.2 {sash place subcommand, errors} -setup {
+ deleteWindows
+} -body {
panedwindow .p
- list [catch {.p sash place foo bar baz} msg] $msg
-} [list 1 "expected integer but got \"foo\""]
-test panedwindow-11.3 {sash place subcommand, errors} {
- destroy .p
+ .p sash place foo bar baz
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-10.3 {sash place subcommand, errors} -setup {
+ deleteWindows
+} -body {
panedwindow .p
- list [catch {.p sash place 0 foo bar} msg] $msg
-} [list 1 "invalid sash index"]
-test panedwindow-11.4 {sash place subcommand, errors} {
- destroy .p .b .c
+ .p sash place 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid sash index}
+test panedwindow-10.4 {sash place subcommand, errors} -setup {
+ deleteWindows
+} -body {
panedwindow .p
.p add [button .b] [button .c]
- list [catch {.p sash place 0 foo bar} msg] $msg
-} [list 1 "expected integer but got \"foo\""]
-test panedwindow-11.5 {sash place subcommand, errors} {
- destroy .p .f .c .b
+ .p sash place 0 foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-10.5 {sash place subcommand, errors} -setup {
+ deleteWindows
+} -body {
panedwindow .p
.p add [button .b] [button .c]
- list [catch {.p sash place 0 0 bar} msg] $msg
-} [list 1 "expected integer but got \"bar\""]
-test panedwindow-11.6 {sash place subcommand, moves sash} {
- destroy .p .f .c .b
+ .p sash place 0 0 bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "bar"}
+test panedwindow-10.6 {sash place subcommand, moves sash} -setup {
+ deleteWindows
+} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 20] [button .c]
.p sash place 0 10 0
.p sash coord 0
-} [list 10 0]
-test panedwindow-11.7 {sash place subcommand, moves sash} {
- destroy .p .f .c
+} -cleanup {
+ deleteWindows
+} -result [list 10 0]
+test panedwindow-10.7 {sash place subcommand, moves sash} -setup {
+ deleteWindows
+} -body {
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
.p sash coord 0
-} [list 0 10]
-test panedwindow-11.8 {sash place subcommand, respects minsize} {
- destroy .p .f .c
+} -cleanup {
+ deleteWindows
+} -result [list 0 10]
+test panedwindow-10.8 {sash place subcommand, respects minsize} -setup {
+ deleteWindows
+} -body {
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
.p sash coord 0
-} [list 15 0]
-test panedwindow-11.9 {sash place subcommand, respects minsize} {
- destroy .p .f .c
+} -cleanup {
+ deleteWindows
+} -result [list 15 0]
+test panedwindow-10.9 {sash place subcommand, respects minsize} -setup {
+ deleteWindows
+} -body {
panedwindow .p
.p add [frame .f -width 20 -height 20 -bg pink]
- list [catch {.p sash place 0 2 0} msg] $msg
-} [list 1 {invalid sash index}]
+ .p sash place 0 2 0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {invalid sash index}
+
-test panedwindow-12.1 {moving sash changes size of pane to left} {
- destroy .p .f .c
+test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
+ deleteWindows
+} -body {
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
winfo width .f
-} 30
-test panedwindow-12.2 {moving sash changes size of pane to right} {
- destroy .p .f .f2
+} -result 30
+test panedwindow-11.2 {moving sash changes size of pane to right} -setup {
+ deleteWindows
+} -body {
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
@@ -462,16 +737,20 @@ test panedwindow-12.2 {moving sash changes size of pane to right} {
.p sash place 0 30 0
update
lappend result [winfo width .f2]
-} {20 10}
-test panedwindow-12.3 {moving sash does not change reqsize of panedwindow} {
- destroy .p .f .f2
+} -cleanup {
+ deleteWindows
+} -result {20 10}
+test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setup {
+ deleteWindows
+} -body {
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
winfo reqwidth .p
-} 44
-test panedwindow-12.4 {moving sash changes size of pane above} {
- destroy .p .f .c
+} -result 44
+test panedwindow-11.4 {moving sash changes size of pane above} -setup {
+ deleteWindows
+} -body {
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
@@ -479,11 +758,11 @@ test panedwindow-12.4 {moving sash changes size of pane above} {
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} {
- destroy .p .f .f2
+} -result 20
+test panedwindow-11.5 {moving sash changes size of pane below} -setup {
+ deleteWindows
+} -body {
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]
@@ -493,81 +772,92 @@ test panedwindow-12.5 {moving sash changes size of pane below} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result {10 5}
+test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setup {
+ deleteWindows
+} -body {
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} {
- destroy .p .f .f2
+} -cleanup {
+ deleteWindows
+} -result [list 24 24]
+test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup {
+ deleteWindows
+} -body {
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} {
- destroy .p .f .c
+} -cleanup {
+ deleteWindows
+} -result [list 10 10]
+test panedwindow-11.8 {moving sash restricted to minsize} -setup {
+ deleteWindows
+} -body {
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} {
- destroy .p .f .c
+ winfo width .f
+} -result 15
+test panedwindow-11.9 {moving sash restricted to minsize} -setup {
+ deleteWindows
+} -body {
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} {
+ winfo height .f
+} -result 10
+test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list {20 0} {40 0}]
+test panedwindow-11.11 {moving sash right pushes other sashes} -setup {
+ deleteWindows
+} -body {
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} {
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{60 0} {64 0}}
+test panedwindow-11.12 {moving sash left pushes other sashes} -setup {
+ deleteWindows
+} -body {
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} {
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 0} {4 0}}
+test panedwindow-11.13 {move sash in mapped window restricted to visible win} -setup {
+ deleteWindows
+} -body {
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]
@@ -575,11 +865,13 @@ test panedwindow-12.15 {move sash in mapped window restricted to visible win} {
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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result {46 0}
+test panedwindow-11.14 {move sash in mapped window restricted to visible win} -setup {
+ deleteWindows
+} -body {
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]
@@ -587,12 +879,13 @@ test panedwindow-12.16 {move sash in mapped window restricted to visible win} {
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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result {96 0}
+test panedwindow-11.15 {moving sash into "virtual" space on last pane increases reqsize} -setup {
+ deleteWindows
+} -body {
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]
@@ -602,36 +895,45 @@ test panedwindow-12.17 {moving sash into "virtual" space on \
.p sash place 1 200 0
update
lappend result [winfo reqwidth .p]
- destroy .p .f .f2 .f3
- set result
-} {68 100}
+} -cleanup {
+ deleteWindows
+} -result {68 100}
-test panedwindow-13.1 {horizontal panedwindow lays out widgets properly} {
+
+test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup {
+ deleteWindows
+ set result {}
+} -body {
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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result [list 2 2 28 2 54 2]
+test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup {
+ deleteWindows
+ set result {}
+} -body {
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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result [list 2 2 2 18 2 34]
+test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup {
+ deleteWindows
+} -body {
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 ""
+ .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
+ -sticky ""
}
pack .p
update
@@ -641,10 +943,13 @@ test panedwindow-13.3 {horizontal panedwindow lays out widgets properly} {
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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result [list 80 30 10 5 50 5 60 30 0 5 30 5]
+test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach win {.p.f .p.f2} {
@@ -658,10 +963,13 @@ test panedwindow-13.4 {vertical panedwindow lays out widgets properly} {
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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result [list 40 60 10 5 10 35 40 50 10 0 10 25]
+test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -sticky ""
place .p -width 40
@@ -670,10 +978,12 @@ test panedwindow-13.5 {panedwindow respects reqsize of panes when possible} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list 20 30]
+test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -setup {
+ deleteWindows
+} -body {
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
@@ -682,29 +992,35 @@ test panedwindow-13.6 {panedwindow takes explicit widget width over reqwidth} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list 20 20]
+test panedwindow-12.7 {horizontal panedwindow reqheight is max slave height} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result {20 40}
+test panedwindow-12.8 {horizontal panedwindow reqheight is max slave height} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup {
+ deleteWindows
+} -body {
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
@@ -713,10 +1029,12 @@ test panedwindow-13.9 {panedwindow pane width overrides widget width} {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list 10 10]
+test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -sticky ""
place .p -height 40
@@ -725,10 +1043,12 @@ test panedwindow-13.10 {panedwindow respects reqsize of panes when possible} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list 20 30]
+test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup {
+ deleteWindows
+} -body {
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
@@ -737,20 +1057,24 @@ test panedwindow-13.11 {panedwindow takes explicit height over reqheight} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result [list 20 20]
+test panedwindow-12.12 {vertical panedwindow reqwidth is max slave width} -setup {
+ deleteWindows
+} -body {
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} {
+} -cleanup {
+ deleteWindows
+} -result {20 40}
+test panedwindow-12.13 {vertical panedwindow reqwidth is max slave width} -setup {
+ deleteWindows
+} -body {
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]}
@@ -758,11 +1082,12 @@ test panedwindow-13.13 {vertical panedwindow reqwidth is max slave width} {
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} {
- destroy .p
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup {
+ deleteWindows
+} -body {
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]}
@@ -772,32 +1097,34 @@ test panedwindow-13.14 {panedwindow pane height overrides widget width} {
set result [winfo height .p.f]
.p paneconfigure .p.f -height 30
lappend result [winfo height .p.f]
- destroy .p
- set result
-} [list 10 10]
+} -cleanup {
+ deleteWindows
+} -result [list 10 10]
-test panedwindow-14.1 {PanestructureProc, widget yields managements} {
+test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup {
+ deleteWindows
+} -body {
# 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.
- destroy .p .b
panedwindow .p
.p add [button .b]
destroy .p
pack .b
destroy .b
set result ""
-} ""
-test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} {
+} -result {}
+test panedwindow-13.2 {PanedWindowLostSlaveProc, widget yields management} -setup {
+ deleteWindows
+} -body {
# 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.
- destroy .p .b
panedwindow .p
.p add [button .b]
pack .p
@@ -807,56 +1134,359 @@ test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} {
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} {
- destroy .p .b
- 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} {
+} -result {}
+
+
+test panedwindow-14.1 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky n
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {n}
+test panedwindow-14.2 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky s
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {s}
+test panedwindow-14.3 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky e
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {e}
+test panedwindow-14.4 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky w
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {w}
+test panedwindow-14.5 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky sn
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {ns}
+test panedwindow-14.6 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky ns
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {ns}
+test panedwindow-14.7 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky en
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {ne}
+test panedwindow-14.8 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky ne
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {ne}
+test panedwindow-14.9 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky wn
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nw}
+test panedwindow-14.10 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky nw
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nw}
+test panedwindow-14.11 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky esn
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nes}
+test panedwindow-14.12 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky nse
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nes}
+test panedwindow-14.13 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky nsw
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nsw}
+test panedwindow-14.14 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky nsew
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {nesw}
+test panedwindow-14.15 {panedwindow sticky settings} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky ""
+ .p panecget .b -sticky
+} -cleanup {
+ deleteWindows
+} -result {}
+
+
+test panedwindow-15.1 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky {}
+ place .p -width 40 -height 40
+ update
+ list {} [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {{} 10 10 20 20}
+test panedwindow-15.2 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky n
+ place .p -width 40 -height 40
+ update
+ list n [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {n 10 0 20 20}
+test panedwindow-15.3 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ 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
+ list s [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {s 10 20 20 20}
+test panedwindow-15.4 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky e
+ place .p -width 40 -height 40
+ update
+ list e [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {e 20 10 20 20}
+test panedwindow-15.5 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky w
+ place .p -width 40 -height 40
+ update
+ list w [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {w 0 10 20 20}
+test panedwindow-15.6 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ns
+ place .p -width 40 -height 40
+ update
+ list ns [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {ns 10 0 20 40}
+test panedwindow-15.7 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ew
+ place .p -width 40 -height 40
+ update
+ list ew [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {ew 0 10 40 20}
+test panedwindow-15.8 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nw
+ place .p -width 40 -height 40
+ update
+ list nw [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {nw 0 0 20 20}
+test panedwindow-15.9 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ne
+ place .p -width 40 -height 40
+ update
+ list ne [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {ne 20 0 20 20}
+test panedwindow-15.10 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky se
+ place .p -width 40 -height 40
+ update
+ list se [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {se 20 20 20 20}
+test panedwindow-15.11 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sw
+ place .p -width 40 -height 40
+ update
+ list sw [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {sw 0 20 20 20}
+test panedwindow-15.12 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nse
+ place .p -width 40 -height 40
+ update
+ list nse [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {nse 20 0 20 40}
+test panedwindow-15.13 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nsw
+ place .p -width 40 -height 40
+ update
+ list nsw [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {nsw 0 0 20 40}
+test panedwindow-15.14 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sew
+ place .p -width 40 -height 40
+ update
+ list sew [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {sew 0 20 40 20}
+test panedwindow-15.15 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky new
+ place .p -width 40 -height 40
+ update
+ list new [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {new 0 0 40 20}
+test panedwindow-15.16 {panedwindow sticky works} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky news
+ place .p -width 40 -height 40
+ update
+ list news [winfo x .p.f] [winfo y .p.f] [winfo width .p.f] [winfo height .p.f]
+} -cleanup {
+ deleteWindows
+} -result {news 0 0 40 40}
+
+
+test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup {
+ deleteWindows
+} -body {
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]
+} -cleanup {
+ deleteWindows
+} -result [list 20 40]
+
-test panedwindow-18.1 {MoveSash, move right} {
+test panedwindow-17.1 {MoveSash, move right} -setup {
+ deleteWindows
set result {}
+} -body {
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 add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -869,33 +1499,31 @@ test panedwindow-18.1 {MoveSash, move right} {
# 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} {
+} -cleanup {
+ deleteWindows
+} -result [list 42 42 {30 0}]
+test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 40 0]
+test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup {
+ deleteWindows
+} -body {
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 add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width < reqwidth
@@ -906,17 +1534,16 @@ test panedwindow-18.3 {MoveSash, move right (mapped, width < reqwidth) clipped b
# 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 30 0]
+test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup {
+ deleteWindows
+} -body {
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 add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width > reqwidth
@@ -927,121 +1554,114 @@ test panedwindow-18.4 {MoveSash, move right (mapped, width > reqwidth) clipped b
# 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 100 0]
+test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 30 0]
+test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 40 0]
+test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 62 0]
+test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 52 0]
+test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 50 0]
+test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup {
+ deleteWindows
+} -body {
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 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} {
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result [list [list 50 0] [list 52 0]]
+test panedwindow-17.11 {MoveSash, move left} -setup {
+ deleteWindows
+} -body {
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
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1054,139 +1674,132 @@ test panedwindow-18.11 {MoveSash, move left} {
# 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} {
+} -cleanup {
+ deleteWindows
+} -result [list 42 42 {10 0}]
+test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 0]
+test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 10 0]
+test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 22 0]
+test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 0]
+test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 10 0]
+test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 42 0]
+test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup {
+ deleteWindows
+} -body {
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 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
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result [list [list 8 0] [list 10 0]]
- set result
-} [list [list 8 0] [list 10 0]]
-test panedwindow-19.1 {MoveSash, move down} {
+test panedwindow-18.1 {MoveSash, move down} -setup {
+ deleteWindows
+} -body {
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
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1199,35 +1812,33 @@ test panedwindow-19.1 {MoveSash, move down} {
# 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} {
+} -cleanup {
+ deleteWindows
+} -result [list 42 42 {0 30}]
+test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 40]
+test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup {
+ deleteWindows
+} -body {
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 add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a height < reqheight
@@ -1238,18 +1849,17 @@ test panedwindow-19.3 {MoveSash, move down (mapped, height < reqheight) clipped
# 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 30]
+test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup {
+ deleteWindows
+} -body {
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 add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width > reqwidth
@@ -1260,129 +1870,122 @@ test panedwindow-19.4 {MoveSash, move down (mapped, height > reqheight) clipped
# 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 100]
+test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 30]
+test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 40]
+test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 0 62]
+test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 0 52]
+test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 50]
+test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup {
+ deleteWindows
+} -body {
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 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} {
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result [list [list 0 50] [list 0 52]]
+test panedwindow-18.11 {MoveSash, move up} -setup {
+ deleteWindows
+} -body {
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
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1395,178 +1998,180 @@ test panedwindow-19.11 {MoveSash, move up} {
# 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} {
+} -cleanup {
+ deleteWindows
+} -result [list 42 42 {0 10}]
+test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 0]
+test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 10]
+test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 0 22]
+test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 0]
+test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 0
+} -cleanup {
+ deleteWindows
+} -result [list 0 10]
+test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup {
+ deleteWindows
+} -body {
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 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} {
+ .p sash coord 1
+} -cleanup {
+ deleteWindows
+} -result [list 0 42]
+test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
+ deleteWindows
+} -body {
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 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
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result [list [list 0 8] [list 0 10]]
- 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} {
+test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup {
+ deleteWindows
+} -body {
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]
+ .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} {
+} -cleanup {
+ deleteWindows
+} -result [list [list 60 20] [list 60 40]]
+
+test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup {
+ deleteWindows
+} -body {
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]
+ .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} {
+} -cleanup {
+ deleteWindows
+} -result [list [list 60 20] [list 60 40]]
+
+test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup {
+ deleteWindows
+} -body {
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
+ .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} {
+} -cleanup {
+ deleteWindows
+} -result [list [list 60 60] [list 60 80]]
+
+test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
@@ -1575,10 +2180,13 @@ test panedwindow-20.4 {ComputeGeometry, reqwidth taken from widgets} {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list [list 20 60] [list 40 60]]
+
+test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
@@ -1587,10 +2195,13 @@ test panedwindow-20.5 {ComputeGeometry, reqwidth taken from widgets} {
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} {
+} -cleanup {
+ deleteWindows
+} -result [list [list 20 60] [list 40 60]]
+
+test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
@@ -1599,219 +2210,2153 @@ test panedwindow-20.6 {ComputeGeometry, reqwidth taken from widgets} {
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 \
+} -cleanup {
+ deleteWindows
+} -result [list [list 60 60] [list 80 60]]
+
+test panedwindow-19.7 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.8 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {60 20}
+
+test panedwindow-19.9 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{20 0} {40 0}}
+
+test panedwindow-19.10 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {53 3 20 20} {95 3 20 20}}
+
+test panedwindow-19.11 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.12 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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 .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 \
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 60}
+
+test panedwindow-19.13 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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 .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} {
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 20} {0 40}}
+
+test panedwindow-19.14 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 53 20 20} {3 95 20 20}}
+test panedwindow-19.15 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {22 20}
+
+test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {72 20}
+
+test panedwindow-19.17 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{23 0} {49 0}}
+
+test panedwindow-19.18 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}
+
+test panedwindow-19.19 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 22}
+
+test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 72}
+
+test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 23} {0 49}}
+
+test panedwindow-19.22 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
+test panedwindow-19.23 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {66 20}
+
+test panedwindow-19.25 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{20 0} {43 0}}
+
+test panedwindow-19.26 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {56 3 20 20} {101 3 20 20}}
+
+test panedwindow-19.27 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 66}
+
+test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 20} {0 43}}
+
+test panedwindow-19.30 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 56 20 20} {3 101 20 20}}
+test panedwindow-19.31 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {22 20}
+
+test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {72 20}
+
+test panedwindow-19.33 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{21 0} {47 0}}
+
+test panedwindow-19.34 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {59 3 20 20} {107 3 20 20}}
+
+test panedwindow-19.35 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 22}
+
+test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 72}
+
+test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 21} {0 47}}
+
+test panedwindow-19.38 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 59 20 20} {3 107 20 20}}
+test panedwindow-19.39 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {80 20}
+
+test panedwindow-19.41 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{25 0} {55 0}}
+
+test panedwindow-19.42 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {63 3 20 20} {115 3 20 20}}
+
+test panedwindow-19.43 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 80}
+
+test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 25} {0 55}}
+
+test panedwindow-19.46 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 63 20 20} {3 115 20 20}}
+test panedwindow-19.47 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {22 20}
+
+test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {92 20}
+
+test panedwindow-19.49 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{28 0} {64 0}}
+
+test panedwindow-19.50 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}
+
+test panedwindow-19.51 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 22}
+
+test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 92}
+
+test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 28} {0 64}}
+
+test panedwindow-19.54 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
+test panedwindow-19.55 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {86 20}
+
+test panedwindow-19.57 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{25 0} {58 0}}
+
+test panedwindow-19.58 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {66 3 20 20} {121 3 20 20}}
+
+test panedwindow-19.59 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 20}
+
+test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 86}
+
+test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 25} {0 58}}
+
+test panedwindow-19.62 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 66 20 20} {3 121 20 20}}
+test panedwindow-19.63 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {22 20}
+
+test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {92 20}
+
+test panedwindow-19.65 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{26 0} {62 0}}
+
+test panedwindow-19.66 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{11 3 20 20} {69 3 20 20} {127 3 20 20}}
+
+test panedwindow-19.67 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 22}
+
+test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {20 92}
+
+test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{0 26} {0 62}}
+
+test panedwindow-19.70 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 0 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{3 11 20 20} {3 69 20 20} {3 127 20 20}}
+test panedwindow-19.71 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {64 24}
+
+test panedwindow-19.73 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{22 2} {42 2}}
+
+test panedwindow-19.74 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {55 5 20 20} {97 5 20 20}}
+
+test panedwindow-19.75 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 64}
+
+test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 22} {2 42}}
+
+test panedwindow-19.78 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 55 20 20} {5 97 20 20}}
+test panedwindow-19.79 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {26 24}
+
+test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {76 24}
+
+test panedwindow-19.81 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{25 2} {51 2}}
+
+test panedwindow-19.82 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}
+
+test panedwindow-19.83 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 26}
+
+test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 76}
+
+test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 25} {2 51}}
+
+test panedwindow-19.86 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
+test panedwindow-19.87 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {70 24}
+
+test panedwindow-19.89 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{22 2} {45 2}}
+
+test panedwindow-19.90 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {58 5 20 20} {103 5 20 20}}
+
+test panedwindow-19.91 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 70}
+
+test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 22} {2 45}}
+
+test panedwindow-19.94 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 58 20 20} {5 103 20 20}}
+test panedwindow-19.95 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {26 24}
+
+test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {76 24}
+
+test panedwindow-19.97 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{23 2} {49 2}}
+
+test panedwindow-19.98 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {61 5 20 20} {109 5 20 20}}
+
+test panedwindow-19.99 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 26}
+
+test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 76}
+
+test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 23} {2 49}}
+
+test panedwindow-19.102 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 0 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 61 20 20} {5 109 20 20}}
+test panedwindow-19.103 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {84 24}
+
+test panedwindow-19.105 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{27 2} {57 2}}
+
+test panedwindow-19.106 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {65 5 20 20} {117 5 20 20}}
+
+test panedwindow-19.107 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 84}
+
+test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 27} {2 57}}
+
+test panedwindow-19.110 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 65 20 20} {5 117 20 20}}
+test panedwindow-19.111 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {26 24}
+
+test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {96 24}
+
+test panedwindow-19.113 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{30 2} {66 2}}
+
+test panedwindow-19.114 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}
+
+test panedwindow-19.115 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -orient vertical -sashwidth 0 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 26}
+
+test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 96}
+
+test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 30} {2 66}}
+
+test panedwindow-19.118 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 0 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}
+test panedwindow-19.119 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {90 24}
+
+test panedwindow-19.121 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{27 2} {60 2}}
+
+test panedwindow-19.122 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {68 5 20 20} {123 5 20 20}}
+
+test panedwindow-19.123 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 0
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 24}
+
+test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 90}
+
+test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 27} {2 60}}
+
+test panedwindow-19.126 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 0 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 68 20 20} {5 123 20 20}}
+test panedwindow-19.127 {ComputeGeometry, one slave, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {26 24}
+
+test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {96 24}
+
+test panedwindow-19.129 {ComputeGeometry, sash coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{28 2} {64 2}}
+
+test panedwindow-19.130 {ComputeGeometry/ArrangePanes, slave coords} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1
+ 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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{13 5 20 20} {71 5 20 20} {129 5 20 20}}
+
+test panedwindow-19.131 {ComputeGeometry, one slave, vertical} -setup {
+ deleteWindows
+} -body {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -orient vertical -sashwidth 3 -handlesize 6 \
+ -showhandle 1
+ .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
+ -sticky ""
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 26}
+
+test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [winfo reqwidth .p] [winfo reqheight .p]
+} -cleanup {
+ deleteWindows
+} -result {24 96}
+
+test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ list [.p sash coord 0] [.p sash coord 1]
+} -cleanup {
+ deleteWindows
+} -result {{2 28} {2 64}}
+
+test panedwindow-19.134 {ComputeGeometry/ArrangePanes, slave coords, vert} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -borderwidth 2 -sashpad 5 \
+ -sashwidth 3 -handlesize 6 -showhandle 1 \
+ -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]]
+ }
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}
+
+
+test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-20.2 {destroyed slave causes geometry recomputation} -setup {
+ deleteWindows
+} -body {
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
+ winfo reqwidth .p
+} -cleanup {
+ deleteWindows
+} -result 20
-test panedwindow-22.1 {ArrangePanes, extra space is given to the last pane} {
+
+test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup {
+ deleteWindows
+} -body {
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} {
+ winfo width .f2
+} -cleanup {
+ deleteWindows
+} -result 78
+test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup {
+ deleteWindows
+} -body {
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} {
+ winfo height .f2
+} -cleanup {
+ deleteWindows
+} -result 78
+test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup {
+ deleteWindows
+} -body {
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} {
+ list [winfo width .f1] [winfo height .f1]
+} -cleanup {
+ deleteWindows
+} -result {10 15}
+test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup {
+ deleteWindows
+} -body {
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} {
+ list [winfo width .f1] [winfo height .f1]
+} -cleanup {
+ deleteWindows
+} -result {10 20}
+test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
.p add [frame .f1 -width 20 -height 20 -bg blue] \
@@ -1819,32 +4364,38 @@ test panedwindow-22.5 {ArrangePanes, panes clipped by size of pane} {
.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} {
+ list [winfo width .f1] [winfo height .f1]
+} -cleanup {
+ deleteWindows
+} -result {20 10}
+test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup {
+ deleteWindows
+} -body {
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} {
+ winfo y .p.f1
+} -cleanup {
+ deleteWindows
+} -result 10
+test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup {
+ deleteWindows
+} -body {
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} {
+ winfo x .p.f1
+} -cleanup {
+ deleteWindows
+} -result 10
+test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
+ deleteWindows
+} -body {
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]
@@ -1854,10 +4405,12 @@ test panedwindow-22.9 {ArrangePanes, panes with width <= 0 are unmapped} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result {1 0}
+test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
+ deleteWindows
+} -body {
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]
@@ -1867,10 +4420,12 @@ test panedwindow-22.10 {ArrangePanes, panes with width <= 0 are unmapped} {
.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} {
+} -cleanup {
+ deleteWindows
+} -result {1 0}
+test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
+ deleteWindows
+} -body {
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]
@@ -1880,32 +4435,37 @@ test panedwindow-22.11 {ArrangePanes, panes with width <= 0 are unmapped} {
.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.12 {ArrangePanes, last pane shrinks} {
+} -cleanup {
+ deleteWindows
+} -result {1 0}
+test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
+ deleteWindows
+} -body {
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 40 -x 0 -y 0
update
- set result [winfo width .f2]
- destroy .p .f1 .f2
- set result
-} 18
-test panedwindow-22.13 {ArrangePanes, last pane shrinks} {
+ winfo width .f2
+} -cleanup {
+ deleteWindows
+} -result 18
+test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
+ deleteWindows
+} -body {
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 40 -x 0 -y 0
update
- set result [winfo height .f2]
- destroy .p .f1 .f2
- set result
-} 18
-test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
- -body {
+ winfo height .f2
+} -cleanup {
+ deleteWindows
+} -result 18
+test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup {
+ deleteWindows
+} -body {
panedwindow .p -width 200 -borderwidth 0
frame .f1 -height 50 -bg blue
set result [list]
@@ -1913,12 +4473,12 @@ test panedwindow-22.14 {ArrangePanes, panedwindow resizes} {
.p add .f1
pack .p
lappend result [winfo reqwidth .p] [winfo reqheight .p]
- }
- -cleanup {destroy .p .f1}
- -result {200 1 200 50}
-}
-test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {200 1 200 50}
+test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup {
+ deleteWindows
+} -body {
panedwindow .p -height 200 -borderwidth 0 -orient vertical
frame .f1 -width 50 -bg blue
set result [list]
@@ -1926,12 +4486,12 @@ test panedwindow-22.15 {ArrangePanes, panedwindow resizes} {
.p add .f1
pack .p
lappend result [winfo reqwidth .p] [winfo reqheight .p]
- }
- -cleanup {destroy .p .f1}
- -result {1 200 50 200}
-}
-test panedwindow-22.16 {ArrangePanes, last pane grows} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {1 200 50 200}
+test panedwindow-21.15 {ArrangePanes, last pane grows} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -height 50
.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
@@ -1945,13 +4505,14 @@ test panedwindow-22.16 {ArrangePanes, last pane grows} {
update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4] [winfo width .p]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {50 150 1 1 211 50 150 1 89 300}
-}
+} -cleanup {
+ deleteWindows
+} -result {50 150 1 1 211 50 150 1 89 300}
-test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
+test panedwindow-22.1 {PanedWindowReqProc, react to slave geometry changes} -setup {
+ deleteWindows
+} -body {
# 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] \
@@ -1959,10 +4520,12 @@ test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
set result [winfo reqheight .p]
.f1 configure -height 80
lappend result [winfo reqheight .p]
- destroy .p .f1 .f2
- set result
-} {40 80}
-test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
+} -cleanup {
+ deleteWindows
+} -result {40 80}
+test panedwindow-22.2 {PanedWindowReqProc, react to slave geometry changes} -setup {
+ deleteWindows
+} -body {
panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 10] [frame .f2 -width 10]
set result [winfo reqwidth .p]
@@ -1970,111 +4533,139 @@ test panedwindow-23.2 {PanedWindowReqProc, react to slave geometry changes} {
lappend result [winfo reqwidth .p]
destroy .p .f1 .f2
expr {[lindex $result 1] - [lindex $result 0]}
-} {10}
+} -cleanup {
+ deleteWindows
+} -result {10}
-test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
+test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup {
+ deleteWindows
+} -body {
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} {
+ .p add .p
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't add .p to itself}
+test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup {
+ deleteWindows
+} -body {
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} {
+ .p add .b
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad window path name ".b"}
+test panedwindow-23.3 {ConfigurePanes, bad window aborts processing} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-23.4 {ConfigurePanes, bad option aborts processing} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-23.5 {ConfigurePanes, after win isn't managed by panedwin} -setup {
+ deleteWindows
+} -body {
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} {
+ .p add .b -after .c
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {window ".c" is not managed by .p}
+test panedwindow-23.6 {ConfigurePanes, before win isn't managed by panedwin} -setup {
+ deleteWindows
+} -body {
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} {
+ .p add .b -before .c
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {window ".c" is not managed by .p}
+test panedwindow-23.7 {ConfigurePanes, -after {} is a no-op} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.b .c}
+test panedwindow-23.8 {ConfigurePanes, -before {} is a no-op} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.b .c}
+test panedwindow-23.9 {ConfigurePanes, new panes are added} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.b .c}
+test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup {
+ deleteWindows
+} -body {
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
+ 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} {
+ return $result
+} -cleanup {
+ deleteWindows
+} -result {.b {-sticky ne -height 5 -width 5 -minsize 10} .c {-sticky ne -height 5 -width 5 -minsize 10}}
+
+test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup {
+ deleteWindows
+} -body {
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} {
+ list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \
+ [.p panecget .c -sticky] [.p panecget .c -height]
+} -cleanup {
+ deleteWindows
+} -result [list {.b .c} es 2 es 2]
+test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup {
+ deleteWindows
+} -body {
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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.b .c .d}
+test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2082,11 +4673,13 @@ test panedwindow-24.13 {ConfigurePanes, -after, single addition} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .c .b}
+test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2095,11 +4688,13 @@ test panedwindow-24.14 {ConfigurePanes, -after, multiple additions} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .c .d .b}
+test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2108,11 +4703,13 @@ test panedwindow-24.15 {ConfigurePanes, -after, relocates existing widget} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .d .b .c}
+test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2121,11 +4718,13 @@ test panedwindow-24.16 {ConfigurePanes, -after, relocates existing widgets} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .b .d .c}
+test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2134,11 +4733,13 @@ test panedwindow-24.17 {ConfigurePanes, -after, relocates existing widgets} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.b .d .a .c}
+test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2147,11 +4748,13 @@ test panedwindow-24.18 {ConfigurePanes, -after, relocates existing widgets} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.d .a .b .c}
+test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2160,11 +4763,13 @@ test panedwindow-24.19 {ConfigurePanes, -after, after last window} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .b .c .d}
+test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2173,11 +4778,13 @@ test panedwindow-24.20 {ConfigurePanes, -before, before first window} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.d .a .b .c}
+test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -setup {
+ deleteWindows
+} -body {
panedwindow .p
button .a
button .b
@@ -2186,11 +4793,13 @@ test panedwindow-24.21 {ConfigurePanes, -before, relocate existing windows} {
.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} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.d .b .a .c}
+test panedwindow-23.22 {ConfigurePanes, slave specified multiple times} -setup {
+ deleteWindows
+} -body {
# This test should not cause a core dump
panedwindow .p
@@ -2199,11 +4808,13 @@ test panedwindow-24.22 {ConfigurePanes, slave specified multiple times} {
button .c
.p add .a .a .b .c
- set result [.p panes]
- destroy .p .a .b .c
- set result
-} {.a .b .c}
-test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.a .b .c}
+test panedwindow-23.23 {ConfigurePanes, slave specified multiple times} -setup {
+ deleteWindows
+} -body {
# This test should not cause a core dump
panedwindow .p
@@ -2213,52 +4824,63 @@ test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} {
.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-24.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
+ .p panes
+} -cleanup {
+ deleteWindows
+} -result {.c .a .b}
+test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup {
+ deleteWindows
+} -body {
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-24.25 {ConfigurePanes, restrict possible panes} {
+ .p add .t
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't add toplevel .t to .p}
+test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup {
+ deleteWindows
+} -body {
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-24.26 {ConfigurePanes, restrict possible panes} {
+ .p add .f.b
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't add .f.b to .p}
+test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup {
+ deleteWindows
+} -body {
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-24.27 {ConfigurePanes, restrict possible panes} {
+ .f.p add .b
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup {
+ deleteWindows
+} -body {
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-24.28 {ConfigurePanes, restrict possible panes} {
+ .p add .p.b
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup {
+ deleteWindows
+} -body {
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-24.29.1 {ConfigurePanes, -hide works} {
- -body {
+ .f.f.f.p add .b
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-23.29 {ConfigurePanes, -hide works} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false
frame .f1 -width 40 -height 100 -bg red
frame .f2 -width 40 -height 100 -bg white
@@ -2278,12 +4900,12 @@ test panedwindow-24.29.1 {ConfigurePanes, -hide works} {
[winfo ismapped .f3] [winfo ismapped .f4]
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4] [winfo width .p]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
-}
-test panedwindow-24.29.2 {ConfigurePanes, -hide works} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
+test panedwindow-23.30 {ConfigurePanes, -hide works} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -width 130 -height 100
frame .f1 -width 40 -bg red
frame .f2 -width 40 -bg white
@@ -2303,12 +4925,12 @@ test panedwindow-24.29.2 {ConfigurePanes, -hide works} {
[winfo ismapped .f3] [winfo ismapped .f4]
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4] [winfo width .p]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
-}
-test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
+test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
frame .f1 -width 50 -bg red
frame .f2 -width 50 -bg green
@@ -2320,13 +4942,13 @@ test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} {
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
.p paneconfigure .f2 -hide 1
update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
- }
- -cleanup {destroy .p .f1 .f2 .f3}
- -result {50 50 94 50 50 147}
-}
-test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} {
- -body {
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
+} -cleanup {
+ deleteWindows
+} -result {50 50 94 50 50 147}
+test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -width 200 -height 200 \
-borderwidth 0 -orient vertical
frame .f1 -height 50 -bg red
@@ -2340,13 +4962,13 @@ test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} {
.p paneconfigure .f2 -hide 1
update
lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
- }
- -cleanup {destroy .p .f1 .f2 .f3}
- -result {50 50 94 50 50 147}
-}
+} -cleanup {
+ deleteWindows
+} -result {50 50 94 50 50 147}
-test panedwindow-24.30 {ConfigurePanes, -stretch first} {
- -body {
+test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -height 100 -width 182
frame .f1 -width 40 -bg red
frame .f2 -width 40 -bg white
@@ -2362,12 +4984,12 @@ test panedwindow-24.30 {ConfigurePanes, -stretch first} {
update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {51 40 40 40 94 40 40 40}
-}
-test panedwindow-24.31 {ConfigurePanes, -stretch middle} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {51 40 40 40 94 40 40 40}
+test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -height 100 -width 182
frame .f1 -width 40 -bg red
frame .f2 -width 40 -bg white
@@ -2383,12 +5005,12 @@ test panedwindow-24.31 {ConfigurePanes, -stretch middle} {
update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {40 45 46 40 40 45 94 40}
-}
-test panedwindow-24.32 {ConfigurePanes, -stretch always} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {40 45 46 40 40 45 94 40}
+test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -height 100 -width 182
frame .f1 -width 40 -bg red
frame .f2 -width 40 -bg white
@@ -2404,12 +5026,12 @@ test panedwindow-24.32 {ConfigurePanes, -stretch always} {
update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {42 43 43 43 58 43 58 58}
-}
-test panedwindow-24.33 {ConfigurePanes, -stretch never} {
- -body {
+} -cleanup {
+ deleteWindows
+} -result {42 43 43 43 58 43 58 58}
+test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup {
+ deleteWindows
+} -body {
panedwindow .p -showhandle false -height 100 -width 182
frame .f1 -width 40 -bg red
frame .f2 -width 40 -bg white
@@ -2425,12 +5047,14 @@ test panedwindow-24.33 {ConfigurePanes, -stretch never} {
update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
[winfo width .f4]
- }
- -cleanup {destroy .p .f1 .f2 .f3 .f4}
- -result {40 40 40 40 40 40 40 40}
-}
+} -cleanup {
+ deleteWindows
+} -result {40 40 40 40 40 40 40 40}
+
-test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} {
+test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup {
+ deleteWindows
+} -body {
# Bug 928413
set result {}
panedwindow .pw
@@ -2445,315 +5069,386 @@ test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} {
lappend result [.pw panecget .pw.l2 -before]
.pw paneconfigure .pw.l2 -before .pw.l1
lappend result [.pw panecget .pw.l2 -before]
- destroy .pw
- set result
-} {.pw.l3 {} .pw.l1}
+} -cleanup {
+ deleteWindows
+} -result {.pw.l3 {} .pw.l1}
-test panedwindow-26.1 {DestroyPanedWindow} {
+
+test panedwindow-25.1 {DestroyPanedWindow} -setup {
+ deleteWindows
+} -body {
# 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]
+ .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
+ destroy $w
}
set result {}
-} {}
+} -result {}
+
-test panedwindow-27.1 {PanedWindowIdentifyCoords} {
+test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 0
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 20 0
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 22 0
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 24 0
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 26 0
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 26 -1
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 26 100
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 22 4
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 22 5
+} -cleanup {
+ deleteWindows
+} -result {0 handle}
+test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 20 5
+} -cleanup {
+ deleteWindows
+} -result {0 handle}
+test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 20 0
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 48 0
+} -cleanup {
+ deleteWindows
+} -result {1 sash}
+test panedwindow-26.13 {identify subcommand errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {wrong # args: should be ".p identify x y"}
+test panedwindow-26.14 {identify subcommand errors} -setup {
+ deleteWindows
+} -body {
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.14a {identify subcommand errors} {
+ .p identify foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "foo"}
+test panedwindow-26.15 {identify subcommand errors} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "bar"}
+test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 0
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 20
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 22
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 24
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 26
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify -1 26
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 100 26
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 4 22
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 5 22
+} -cleanup {
+ deleteWindows
+} -result {0 handle}
+test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 5 20
+} -cleanup {
+ deleteWindows
+} -result {0 handle}
+test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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} {
+ .p identify 0 20
+} -cleanup {
+ deleteWindows
+} -result {0 sash}
+test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup {
+ deleteWindows
+} -body {
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}
-
-test panedwindow-28.1 {destroy the window cleanly on error [Bug #616589]} {
- list [catch {panedwindow .p -bogusopt bogus} msg] $msg
-} {1 {unknown option "-bogusopt"}}
-test panedwindow-28.2 {destroy the window cleanly on rename [Bug #616589]} {
+ .p identify 0 48
+} -cleanup {
+ deleteWindows
+} -result {1 sash}
+
+
+test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -bogusopt bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-bogusopt"}
+test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setup {
+ deleteWindows
+} -body {
destroy .p
panedwindow .p
rename .p {}
winfo exists .p
-} {0}
-
-
-test panedwindow-29.1 {resizing width} {
- -body {
- panedwindow .p -bd 5
- frame .f1 -width 100 -height 50 -bg blue
- frame .f2 -width 100 -height 50 -bg red
-
- .p add .f1 -sticky news
- .p add .f2 -sticky news
- pack .p -side top -fill both -expand 1
- wm geometry . ""
- update
- # Note the width
- set a [winfo width .f2]
- # Increase the size by 10
- regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
- wm geometry . [expr {$w + 10}]x$h
- update
- set b "$a [winfo width .f2]"
- }
- -cleanup {destroy .p .f1 .f2}
- -result {100 110}
-}
-
-test panedwindow-29.2 {resizing height} {
- -body {
- panedwindow .p -orient vertical -bd 5
- frame .f1 -width 50 -height 100 -bg blue
- frame .f2 -width 50 -height 100 -bg red
-
- .p add .f1 -sticky news
- .p add .f2 -sticky news
- pack .p -side top -fill both -expand 1
- wm geometry . ""
- update
- # Note the height
- set a [winfo height .f2]
- # Increase the size by 10
- regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
- wm geometry . ${w}x[expr {$h + 10}]
- update
- set b "$a [winfo height .f2]"
- }
- -cleanup {destroy .p .f1 .f2}
- -result {100 110}
-}
-
-test panedwindow-30.1 {display on depths other than the default one} {
- -constraints {pseudocolor8 haveTruecolor24}
- -body {
+} -cleanup {
+ deleteWindows
+} -result {0}
+
+
+test panedwindow-28.1 {resizing width} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -bd 5
+ frame .f1 -width 100 -height 50 -bg blue
+ frame .f2 -width 100 -height 50 -bg red
+
+ .p add .f1 -sticky news
+ .p add .f2 -sticky news
+ pack .p -side top -fill both -expand 1
+ wm geometry . ""
+ update
+ # Note the width
+ set a [winfo width .f2]
+ # Increase the size by 10
+ regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
+ wm geometry . [expr {$w + 10}]x$h
+ update
+ set b "$a [winfo width .f2]"
+} -cleanup {
+ deleteWindows
+} -result {100 110}
+
+test panedwindow-28.2 {resizing height} -setup {
+ deleteWindows
+} -body {
+ panedwindow .p -orient vertical -bd 5
+ frame .f1 -width 50 -height 100 -bg blue
+ frame .f2 -width 50 -height 100 -bg red
+
+ .p add .f1 -sticky news
+ .p add .f2 -sticky news
+ pack .p -side top -fill both -expand 1
+ wm geometry . ""
+ update
+ # Note the height
+ set a [winfo height .f2]
+ # Increase the size by 10
+ regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
+ wm geometry . ${w}x[expr {$h + 10}]
+ update
+ set b "$a [winfo height .f2]"
+} -cleanup {
+ deleteWindows
+} -result {100 110}
+
+
+test panedwindow-29.1 {display on depths other than the default one} -constraints {
+ pseudocolor8 haveTruecolor24
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -visual {truecolor 24}
pack [panedwindow .t.p]
.t.p add [frame .t.p.f1] [frame .t.p.f2]
update
# If we got here, we didn't crash and that's good
- }
- -cleanup {destroy .t}
- -result {}
-}
-test panedwindow-30.2 {display on depths other than the default one} {
- -constraints {pseudocolor8 haveTruecolor24}
- -body {
+} -cleanup {
+ deleteWindows
+} -result {}
+test panedwindow-29.2 {display on depths other than the default one} -constraints {
+ pseudocolor8 haveTruecolor24
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -visual {pseudocolor 8}
pack [frame .t.f -visual {truecolor 24}]
pack [panedwindow .t.f.p]
@@ -2764,11 +5459,13 @@ test panedwindow-30.2 {display on depths other than the default one} {
.t.f.p proxy forget
update
# If we got here, we didn't crash and that's good
- }
- -cleanup {destroy .t}
- -result {}
-}
+} -cleanup {
+ deleteWindows
+} -result {}
+
# cleanup
cleanupTests
return
+
+
diff --git a/tests/place.test b/tests/place.test
index ac2ece7..ddfa64c 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -5,7 +5,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -15,6 +16,7 @@ testConstraint memory [llength [info commands memory]]
# XXX - This test file is woefully incomplete. At present, only a
# few of the features are tested.
+# Widgets used in tests 1.* - 8.*
toplevel .t -width 300 -height 200 -bd 0
wm geom .t +0+0
frame .t.f -width 154 -height 84 -bd 2 -relief raised
@@ -22,145 +24,181 @@ place .t.f -x 48 -y 38
frame .t.f2 -width 30 -height 60 -bd 2 -relief raised
update
-test place-1.1 {Tk_PlaceCmd procedure, "info" option} {
+test place-1.1 {Tk_PlaceCmd procedure, "info" option} -setup {
+ place forget .t.f2
+} -body {
place .t.f2 -x 0
place info .t.f2
-} {-in .t -x 0 -relx 0 -y 0 -rely 0 -width {} -relwidth {} -height {} -relheight {} -anchor nw -bordermode inside}
-test place-1.2 {Tk_PlaceCmd procedure, "info" option} {
+} -result {-in .t -x 0 -relx 0 -y 0 -rely 0 -width {} -relwidth {} -height {} -relheight {} -anchor nw -bordermode inside}
+test place-1.2 {Tk_PlaceCmd procedure, "info" option} -setup {
+ place forget .t.f2
+} -body {
place .t.f2 -x 1 -y 2 -width 3 -height 4 -relx 0.1 -rely 0.2 \
- -relwidth 0.3 -relheight 0.4 -anchor se -in .t.f \
- -bordermode outside
+ -relwidth 0.3 -relheight 0.4 -anchor se -in .t.f \
+ -bordermode outside
place info .t.f2
-} {-in .t.f -x 1 -relx 0.1 -y 2 -rely 0.2 -width 3 -relwidth 0.3 -height 4 -relheight 0.4 -anchor se -bordermode outside}
-test place-1.3 {Tk_PlaceCmd procedure, "info" option} {
+} -result {-in .t.f -x 1 -relx 0.1 -y 2 -rely 0.2 -width 3 -relwidth 0.3 -height 4 -relheight 0.4 -anchor se -bordermode outside}
+test place-1.3 {Tk_PlaceCmd procedure, "info" option} -setup {
+ place forget .t.f2
+ destroy .t.a.b
+} -body {
# Make sure the result is built as a proper list by using a space in parent
frame ".t.a b"
place .t.f2 -x 1 -y 2 -width {} -height 4 -relx 0.2 -rely 0.2 \
- -relwidth 0.3 -relheight {} -anchor w -in ".t.a b" \
- -bordermode ignore
- set res [place info .t.f2]
- destroy ".t.a b"
- set res
-} {-in {.t.a b} -x 1 -relx 0.2 -y 2 -rely 0.2 -width {} -relwidth 0.3 -height 4 -relheight {} -anchor w -bordermode ignore}
-
-test place-2.1 {ConfigureSlave procedure, -height option} {
- list [catch {place .t.f2 -height abcd} msg] $msg
-} {1 {bad screen distance "abcd"}}
-test place-2.2 {ConfigureSlave procedure, -height option} {
+ -relwidth 0.3 -relheight {} -anchor w -in ".t.a b" \
+ -bordermode ignore
+ place info .t.f2
+} -cleanup {
+ destroy ".t.a.b"
+} -result {-in {.t.a b} -x 1 -relx 0.2 -y 2 -rely 0.2 -width {} -relwidth 0.3 -height 4 -relheight {} -anchor w -bordermode ignore}
+
+
+test place-2.1 {ConfigureSlave procedure, -height option} -body {
+ place .t.f2 -height abcd
+} -returnCodes error -result {bad screen distance "abcd"}
+test place-2.2 {ConfigureSlave procedure, -height option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -height 40
update
winfo height .t.f2
-} {40}
-test place-2.3 {ConfigureSlave procedure, -height option} {
+} -result {40}
+test place-2.3 {ConfigureSlave procedure, -height option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -height 120
update
place .t.f2 -height {}
update
winfo height .t.f2
-} {60}
+} -result {60}
-test place-3.1 {ConfigureSlave procedure, -relheight option} {
- list [catch {place .t.f2 -relheight abcd} msg] $msg
-} {1 {expected floating-point number but got "abcd"}}
-test place-3.2 {ConfigureSlave procedure, -relheight option} {
+
+test place-3.1 {ConfigureSlave procedure, -relheight option} -body {
+ place .t.f2 -relheight abcd
+} -returnCodes error -result {expected floating-point number but got "abcd"}
+test place-3.2 {ConfigureSlave procedure, -relheight option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -relheight .5
update
winfo height .t.f2
-} {40}
-test place-3.3 {ConfigureSlave procedure, -relheight option} {
+} -result {40}
+test place-3.3 {ConfigureSlave procedure, -relheight option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -relheight .8
update
place .t.f2 -relheight {}
update
winfo height .t.f2
-} {60}
+} -result {60}
+
-test place-4.1 {ConfigureSlave procedure, bad -in options} {
+test place-4.1 {ConfigureSlave procedure, bad -in options} -setup {
+ place forget .t.f2
+} -body {
+ place .t.f2 -in .t.f2
+} -returnCodes error -result {can't place .t.f2 relative to itself}
+test place-4.2 {ConfigureSlave procedure, bad -in option} -setup {
place forget .t.f2
- list [catch {place .t.f2 -in .t.f2} msg] $msg
-} [list 1 "can't place .t.f2 relative to itself"]
-test place-4.2 {ConfigureSlave procedure, bad -in option} {
+} -body {
+ set result [list [winfo manager .t.f2]]
+ catch {place .t.f2 -in .t.f2}
+ lappend result [winfo manager .t.f2]
+} -result {{} {}}
+test place-4.3 {ConfigureSlave procedure, bad -in option} -setup {
place forget .t.f2
- list [winfo manager .t.f2] \
- [catch {place .t.f2 -in .t.f2} err] $err \
- [winfo manager .t.f2]
-} {{} 1 {can't place .t.f2 relative to itself} {}}
-test place-4.3 {ConfigureSlave procedure, bad -in option} {
+} -body {
+ winfo manager .t.f2
+ place .t.f2 -in .t.f2
+} -returnCodes error -result {can't place .t.f2 relative to itself}
+test place-4.4 {ConfigureSlave procedure, bad -in option} -setup {
place forget .t.f2
- list [catch {place .t.f2 -in .} msg] $msg
-} [list 1 "can't place .t.f2 relative to ."]
+} -body {
+ place .t.f2 -in .
+} -returnCodes error -result {can't place .t.f2 relative to .}
-test place-5.1 {ConfigureSlave procedure, -relwidth option} {
- list [catch {place .t.f2 -relwidth abcd} msg] $msg
-} {1 {expected floating-point number but got "abcd"}}
-test place-5.2 {ConfigureSlave procedure, -relwidth option} {
+
+test place-5.1 {ConfigureSlave procedure, -relwidth option} -body {
+ place .t.f2 -relwidth abcd
+} -returnCodes error -result {expected floating-point number but got "abcd"}
+test place-5.2 {ConfigureSlave procedure, -relwidth option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -relwidth .5
update
winfo width .t.f2
-} {75}
-test place-5.3 {ConfigureSlave procedure, -relwidth option} {
+} -result {75}
+test place-5.3 {ConfigureSlave procedure, -relwidth option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -relwidth .8
update
place .t.f2 -relwidth {}
update
winfo width .t.f2
-} {30}
+} -result {30}
-test place-6.1 {ConfigureSlave procedure, -width option} {
- list [catch {place .t.f2 -width abcd} msg] $msg
-} {1 {bad screen distance "abcd"}}
-test place-6.2 {ConfigureSlave procedure, -width option} {
+test place-6.1 {ConfigureSlave procedure, -width option} -body {
+ place .t.f2 -width abcd
+} -returnCodes error -result {bad screen distance "abcd"}
+test place-6.2 {ConfigureSlave procedure, -width option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -width 100
update
winfo width .t.f2
-} {100}
-test place-6.3 {ConfigureSlave procedure, -width option} {
+} -result {100}
+test place-6.3 {ConfigureSlave procedure, -width option} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -width 120
update
place .t.f2 -width {}
update
winfo width .t.f2
-} {30}
+} -result {30}
+
-test place-7.1 {ReconfigurePlacement procedure, computing position} {
+test place-7.1 {ReconfigurePlacement procedure, computing position} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -x -2 -relx .5 -y 3 -rely .4
update
winfo geometry .t.f2
-} {30x60+123+75}
-test place-7.2 {ReconfigurePlacement procedure, position rounding} {
+} -result {30x60+123+75}
+test place-7.2 {ReconfigurePlacement procedure, position rounding} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -x -1.4 -y -2.3
update
winfo geometry .t.f2
-} {30x60+49+38}
-test place-7.3 {ReconfigurePlacement procedure, position rounding} {
+} -result {30x60+49+38}
+test place-7.3 {ReconfigurePlacement procedure, position rounding} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -x 1.4 -y 2.3
update
winfo geometry .t.f2
-} {30x60+51+42}
-test place-7.4 {ReconfigurePlacement procedure, position rounding} {
+} -result {30x60+51+42}
+test place-7.4 {ReconfigurePlacement procedure, position rounding} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -x -1.6 -y -2.7
update
winfo geometry .t.f2
-} {30x60+48+37}
-test place-7.5 {ReconfigurePlacement procedure, position rounding} {
+} -result {30x60+48+37}
+test place-7.5 {ReconfigurePlacement procedure, position rounding} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -x 1.6 -y 2.7
update
winfo geometry .t.f2
-} {30x60+52+43}
-test place-7.6 {ReconfigurePlacement procedure, position rounding} {
+} -result {30x60+52+43}
+test place-7.6 {ReconfigurePlacement procedure, position rounding} -setup {
+ destroy .t.f3
+} -body {
frame .t.f3 -width 100 -height 100 -bg #f00000 -bd 0
place .t.f3 -x 0 -y 0
raise .t.f2
@@ -168,38 +206,44 @@ test place-7.6 {ReconfigurePlacement procedure, position rounding} {
place .t.f2 -in .t.f3 -relx .303 -rely .406 -relwidth .304 -relheight .206
update
winfo geometry .t.f2
-} {31x20+30+41}
-catch {destroy .t.f3}
-test place-7.7 {ReconfigurePlacement procedure, computing size} {
+} -cleanup {
+ destroy .t.f3
+} -result {31x20+30+41}
+test place-7.7 {ReconfigurePlacement procedure, computing size} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -width 120 -height 89
update
list [winfo width .t.f2] [winfo height .t.f2]
-} {120 89}
-test place-7.8 {ReconfigurePlacement procedure, computing size} {
+} -result {120 89}
+test place-7.8 {ReconfigurePlacement procedure, computing size} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -relwidth .4 -relheight .5
update
list [winfo width .t.f2] [winfo height .t.f2]
-} {60 40}
-test place-7.9 {ReconfigurePlacement procedure, computing size} {
+} -result {60 40}
+test place-7.9 {ReconfigurePlacement procedure, computing size} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -width 10 -relwidth .4 -height -4 -relheight .5
update
list [winfo width .t.f2] [winfo height .t.f2]
-} {70 36}
-test place-7.10 {ReconfigurePlacement procedure, computing size} {
+} -result {70 36}
+test place-7.10 {ReconfigurePlacement procedure, computing size} -setup {
place forget .t.f2
+} -body {
place .t.f2 -in .t.f -width 10 -relwidth .4 -height -4 -relheight .5
place .t.f2 -width {} -relwidth {} -height {} -relheight {}
update
list [winfo width .t.f2] [winfo height .t.f2]
-} {30 60}
+} -result {30 60}
-test place-8.1 {MasterStructureProc, mapping and unmapping slaves} {
+test place-8.1 {MasterStructureProc, mapping and unmapping slaves} -setup {
place forget .t.f2
place forget .t.f
+} -body {
place .t.f2 -relx 1.0 -rely 1.0 -anchor sw
update
set result [winfo ismapped .t.f2]
@@ -212,10 +256,11 @@ test place-8.1 {MasterStructureProc, mapping and unmapping slaves} {
wm deiconify .t
update
lappend result [winfo ismapped .t.f2]
-} {1 0 40 30 0 1}
-test place-8.2 {MasterStructureProc, mapping and unmapping slaves} {
+} -result {1 0 40 30 0 1}
+test place-8.2 {MasterStructureProc, mapping and unmapping slaves} -setup {
place forget .t.f2
place forget .t.f
+} -body {
place .t.f -x 0 -y 0 -width 200 -height 100
place .t.f2 -in .t.f -relx 1.0 -rely 1.0 -anchor sw -width 50 -height 20
update
@@ -229,130 +274,153 @@ test place-8.2 {MasterStructureProc, mapping and unmapping slaves} {
wm deiconify .t
update
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}
+} -result {1 0 42 32 0 1}
+destroy .t
+
+
+test place-9.1 {PlaceObjCmd} -body {
+ place
+} -returnCodes error -result {wrong # args: should be "place option|pathName args"}
+test place-9.2 {PlaceObjCmd} -body {
+ place foo
+} -returnCodes error -result {wrong # args: should be "place option|pathName args"}
+test place-9.3 {PlaceObjCmd} -setup {
+ destroy .foo
+} -body {
+ place .foo bar
+} -returnCodes error -result {bad window path name ".foo"}
+test place-9.4 {PlaceObjCmd} -setup {
+ destroy .foo
+} -body {
+ place bar .foo
+} -cleanup {
+ destroy .foo
+} -returnCodes error -result {bad window path name ".foo"}
+test place-9.5 {PlaceObjCmd} -setup {
+ destroy .foo
+} -body {
frame .foo
- set res [list [catch {place badopt .foo} msg] $msg]
+ place badopt .foo
+} -cleanup {
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}
+} -returnCodes error -result {bad option "badopt": must be configure, forget, info, or slaves}
+test place-9.6 {PlaceObjCmd, configure errors} -setup {
+ destroy .foo
+} -body {
frame .foo
- set res [list [catch {place configure .foo} msg] $msg]
+ place configure .foo
+} -cleanup {
+ destroy .foo
+} -returnCodes ok -result {}
+test place-9.7 {PlaceObjCmd, configure errors} -setup {
destroy .foo
- set res
-} [list 0 ""]
-test place-9.7 {PlaceObjCmd, configure errors} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [list [catch {place configure .foo bar} msg] $msg]
+ place configure .foo bar
+} -cleanup {
+ destroy .foo
+} -returnCodes ok -result {}
+test place-9.8 {PlaceObjCmd, configure} -setup {
destroy .foo
- set res
-} [list 0 ""]
-test place-9.8 {PlaceObjCmd, configure} {
- catch {destroy .foo}
+} -body {
frame .foo
place .foo -x 0 -y 0
- set res [place configure .foo]
+ place configure .foo
+} -cleanup {
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}
+} -result [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} -setup {
+ destroy .foo
+} -body {
frame .foo
place .foo -x 0 -y 0
- set res [place configure .foo -x]
+ place configure .foo -x
+} -cleanup {
+ destroy .foo
+} -result {-x {} {} 0 0}
+test place-9.10 {PlaceObjCmd, forget errors} -setup {
destroy .foo
- set res
-} [list -x {} {} 0 0]
-test place-9.10 {PlaceObjCmd, forget errors} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [list [catch {place forget .foo bar} msg] $msg]
+ place forget .foo bar
+} -cleanup {
destroy .foo
- set res
-} [list 1 "wrong # args: should be \"place forget pathName\""]
-test place-9.11 {PlaceObjCmd, info errors} {
- catch {destroy .foo}
+} -returnCodes error -result {wrong # args: should be "place forget pathName"}
+test place-9.11 {PlaceObjCmd, info errors} -setup {
+ destroy .foo
+} -body {
frame .foo
- set res [list [catch {place info .foo bar} msg] $msg]
+ place info .foo bar
+} -cleanup {
+ destroy .foo
+} -returnCodes error -result {wrong # args: should be "place info pathName"}
+test place-9.12 {PlaceObjCmd, slaves errors} -setup {
destroy .foo
- set res
-} [list 1 "wrong # args: should be \"place info pathName\""]
-test place-9.12 {PlaceObjCmd, slaves errors} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [list [catch {place slaves .foo bar} msg] $msg]
+ place slaves .foo bar
+} -cleanup {
destroy .foo
- set res
-} [list 1 "wrong # args: should be \"place slaves pathName\""]
-
-test place-10.1 {ConfigureSlave} {
- catch {destroy .foo}
+} -returnCodes error -result {wrong # args: should be "place slaves pathName"}
+
+
+test place-10.1 {ConfigureSlave} -setup {
+ destroy .foo
+} -body {
frame .foo
- set res [list [catch {place .foo -badopt} msg] $msg]
+ place .foo -badopt
+} -cleanup {
destroy .foo
- set res
-} [list 1 "unknown option \"-badopt\""]
-test place-10.2 {ConfigureSlave} {
- catch {destroy .foo}
+} -returnCodes error -result {unknown option "-badopt"}
+test place-10.2 {ConfigureSlave} -setup {
+ destroy .foo
+} -body {
frame .foo
- set res [list [catch {place .foo -anchor} msg] $msg]
+ place .foo -anchor
+} -cleanup {
+ destroy .foo
+} -returnCodes error -result {value for "-anchor" missing}
+test place-10.3 {ConfigureSlave} -setup {
destroy .foo
- set res
-} [list 1 "value for \"-anchor\" missing"]
-test place-10.3 {ConfigureSlave} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [list [catch {place .foo -bordermode j} msg] $msg]
+ place .foo -bordermode j
+} -cleanup {
+ destroy .foo
+} -returnCodes error -result {bad bordermode "j": must be inside, outside, or ignore}
+test place-10.4 {ConfigureSlave} -setup {
destroy .foo
- set res
-} [list 1 "bad bordermode \"j\": must be inside, outside, or ignore"]
-test place-10.4 {ConfigureSlave} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [list [catch {place configure .foo -x 0 -y} msg] $msg]
+ place configure .foo -x 0 -y
+} -cleanup {
+ destroy .foo
+} -returnCodes error -result {value for "-y" missing}
+
+
+test place-11.1 {PlaceObjCmd, slaves command} -setup {
destroy .foo
- set res
-} [list 1 "value for \"-y\" missing"]
-
-test place-11.1 {PlaceObjCmd, slaves command} {
- catch {destroy .foo}
+} -body {
frame .foo
- set res [place slaves .foo]
+ place slaves .foo
+} -cleanup {
destroy .foo
- set res
-} {}
-test place-11.2 {PlaceObjCmd, slaves command} {
- catch {destroy .foo .bar}
+} -result {}
+test place-11.2 {PlaceObjCmd, slaves command} -setup {
+ destroy .foo .bar
+} -body {
frame .foo
frame .bar
place .bar -in .foo
- set res [place slaves .foo]
- destroy .foo
- destroy .bar
- set res
-} [list .bar]
+ place slaves .foo
+} -cleanup {
+ destroy .foo .bar
+} -result [list .bar]
+
-test place-12.1 {PlaceObjCmd, forget command} {
- catch {destroy .foo}
+test place-12.1 {PlaceObjCmd, forget command} -setup {
+ destroy .foo
+} -body {
frame .foo
place .foo -width 50 -height 50
update
@@ -360,11 +428,14 @@ test place-12.1 {PlaceObjCmd, forget command} {
place forget .foo
update
lappend res [winfo ismapped .foo]
+} -cleanup {
destroy .foo
- set res
-} [list 1 0]
+} -result {1 0}
+
-test place-13.1 {test respect for internalborder} {
+test place-13.1 {test respect for internalborder} -setup {
+ destroy .pack
+} -body {
toplevel .pack
wm geometry .pack 200x200
frame .pack.l -width 15 -height 10
@@ -377,11 +448,13 @@ test place-13.1 {test respect for internalborder} {
.pack.lf configure -labelanchor e -padx 3 -pady 5
update
lappend res [winfo geometry .pack.lf.f]
+} -cleanup {
destroy .pack
- set res
-} {196x188+2+10 177x186+5+7}
+} -result {196x188+2+10 177x186+5+7}
-test place-14.1 {memory leak testing} -setup {
+
+test place-14.1 {memory leak testing} -constraints memory -setup {
+ destroy .f
proc getbytes {} {
set lines [split [memory info] "\n"]
lindex [lindex $lines 3] 3
@@ -400,7 +473,7 @@ test place-14.1 {memory leak testing} -setup {
}
return $res
}
-} -constraints memory -body {
+} -body {
# Test all manners of forgetting a slave
frame .f
frame .f.f
@@ -416,14 +489,16 @@ test place-14.1 {memory leak testing} -setup {
frame .f
frame .f.f
}
-} -result {0 0 0} -cleanup {
+} -cleanup {
destroy .f
rename getbytes {}
rename stress {}
-}
+} -result {0 0 0}
-catch {destroy .t}
# cleanup
cleanupTests
return
+
+
+
diff --git a/tests/raise.test b/tests/raise.test
index a17fa2e..461ccbf 100644
--- a/tests/raise.test
+++ b/tests/raise.test
@@ -8,19 +8,20 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
# Procedure to create a bunch of overlapping windows, which should
# make it easy to detect differences in order.
proc raise_setup {} {
foreach i [winfo child .raise] {
- destroy $i
- }
+ destroy $i
+ }
foreach i {a b c d e} {
- label .raise.$i -text $i -relief raised -bd 2
+ label .raise.$i -text $i -relief raised -bd 2
}
place .raise.a -x 20 -y 60 -width 60 -height 80
place .raise.b -x 60 -y 60 -width 60 -height 80
@@ -59,149 +60,173 @@ proc raise_makeToplevels {} {
toplevel .raise
wm geom .raise 250x200+0+0
-test raise-1.1 {preserve creation order} {
+
+test raise-1.1 {preserve creation order} -body {
raise_setup
tkwait visibility .raise.e
raise_getOrder
-} {d d d b c e e e}
-test raise-1.2 {preserve creation order} testmakeexist {
+} -result {d d d b c e e e}
+test raise-1.2 {preserve creation order} -constraints testmakeexist -body {
raise_setup
testmakeexist .raise.a
update
raise_getOrder
-} {d d d b c e e e}
-test raise-1.3 {preserve creation order} testmakeexist {
+} -result {d d d b c e e e}
+test raise-1.3 {preserve creation order} -constraints testmakeexist -body {
raise_setup
testmakeexist .raise.c
update
raise_getOrder
-} {d d d b c e e e}
-test raise-1.4 {preserve creation order} testmakeexist {
+} -result {d d d b c e e e}
+test raise-1.4 {preserve creation order} -constraints testmakeexist -body {
raise_setup
testmakeexist .raise.e
update
raise_getOrder
-} {d d d b c e e e}
-test raise-1.5 {preserve creation order} testmakeexist {
+} -result {d d d b c e e e}
+test raise-1.5 {preserve creation order} -constraints testmakeexist -body {
raise_setup
testmakeexist .raise.d .raise.c .raise.b
update
raise_getOrder
-} {d d d b c e e e}
+} -result {d d d b c e e e}
-test raise-2.1 {raise internal windows before creation} {
+
+test raise-2.1 {raise internal windows before creation} -body {
raise_setup
raise .raise.a
update
raise_getOrder
-} {a d d a c a e e}
-test raise-2.2 {raise internal windows before creation} {
+} -result {a d d a c a e e}
+test raise-2.2 {raise internal windows before creation} -body {
raise_setup
raise .raise.c
update
raise_getOrder
-} {d d c b c e e c}
-test raise-2.3 {raise internal windows before creation} {
+} -result {d d c b c e e c}
+test raise-2.3 {raise internal windows before creation} -body {
raise_setup
raise .raise.e
update
raise_getOrder
-} {d d d b c e e e}
-test raise-2.4 {raise internal windows before creation} {
+} -result {d d d b c e e e}
+test raise-2.4 {raise internal windows before creation} -body {
raise_setup
raise .raise.e .raise.a
update
raise_getOrder
-} {d d d b c e b c}
-test raise-2.5 {raise internal windows before creation} {
+} -result {d d d b c e b c}
+test raise-2.5 {raise internal windows before creation} -body {
raise_setup
raise .raise.a .raise.d
update
raise_getOrder
-} {a d d a c e e e}
+} -result {a d d a c e e e}
+
-test raise-3.1 {raise internal windows after creation} {
+test raise-3.1 {raise internal windows after creation} -body {
raise_setup
update
raise .raise.a .raise.d
raise_getOrder
-} {a d d a c e e e}
-test raise-3.2 {raise internal windows after creation} testmakeexist {
+} -result {a d d a c e e e}
+test raise-3.2 {raise internal windows after creation} -constraints {
+ testmakeexist
+} -body {
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} testmakeexist {
+} -result {d d d a c e e e}
+test raise-3.3 {raise internal windows after creation} -constraints {
+ testmakeexist
+} -body {
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} testmakeexist {
+} -result {d d d a c e e e}
+test raise-3.4 {raise internal windows after creation} -constraints {
+ testmakeexist
+} -body {
raise_setup
testmakeexist .raise.a .raise.c .raise.d
raise .raise.a .raise.b
update
raise_getOrder
-} {d d d a c e e e}
+} -result {d d d a c e e e}
-test raise-4.1 {raise relative to nephews} {
+
+test raise-4.1 {raise relative to nephews} -body {
raise_setup
update
frame .raise.d.child
raise .raise.a .raise.d.child
raise_getOrder
-} {a d d a c e e e}
-test raise-4.2 {raise relative to nephews} {
+} -result {a d d a c e e e}
+test raise-4.2 {raise relative to nephews} -setup {
+ destroy .raise2
+} -body {
raise_setup
update
frame .raise2
- list [catch {raise .raise.a .raise2} msg] $msg
-} {1 {can't raise ".raise.a" above ".raise2"}}
-catch {destroy .raise2}
+ raise .raise.a .raise2
+} -cleanup {
+ destroy .raise2
+} -returnCodes error -result {can't raise ".raise.a" above ".raise2"}
-test raise-5.1 {lower internal windows} {
+
+test raise-5.1 {lower internal windows} -body {
raise_setup
update
lower .raise.d
raise_getOrder
-} {a b c b c e e e}
-test raise-5.2 {lower internal windows} {
+} -result {a b c b c e e e}
+test raise-5.2 {lower internal windows} -body {
raise_setup
update
lower .raise.d .raise.b
raise_getOrder
-} {d b c b c e e e}
-test raise-5.3 {lower internal windows} {
+} -result {d b c b c e e e}
+test raise-5.3 {lower internal windows} -body {
raise_setup
update
lower .raise.a .raise.e
raise_getOrder
-} {a d d a c e e e}
-test raise-5.4 {lower internal windows} {
+} -result {a d d a c e e e}
+test raise-5.4 {lower internal windows} -setup {
+ destroy .raise2
+} -body {
raise_setup
update
frame .raise2
- list [catch {lower .raise.a .raise2} msg] $msg
-} {1 {can't lower ".raise.a" below ".raise2"}}
-catch {destroy .raise2}
+ lower .raise.a .raise2
+} -cleanup {
+ destroy .raise2
+} -returnCodes error -result {can't lower ".raise.a" below ".raise2"}
-test raise-6.1 {raise/lower toplevel windows} {nonPortable} {
+
+test raise-6.1 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
update
raise .raise1
winfo containing [winfo rootx .raise1] [winfo rooty .raise1]
-} .raise1
-test raise-6.2 {raise/lower toplevel windows} {nonPortable} {
+} -result {.raise1}
+test raise-6.2 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
update
raise .raise2
winfo containing [winfo rootx .raise1] [winfo rooty .raise1]
-} .raise2
-test raise-6.3 {raise/lower toplevel windows} {nonPortable} {
+} -result {.raise2}
+test raise-6.3 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
update
raise .raise3
@@ -214,8 +239,10 @@ test raise-6.3 {raise/lower toplevel windows} {nonPortable} {
after 500
list $result [winfo containing [winfo rootx .raise1] \
[winfo rooty .raise1]]
-} {.raise2 .raise1}
-test raise-6.4 {raise/lower toplevel windows} {nonPortable} {
+} -result {.raise2 .raise1}
+test raise-6.4 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
update
raise .raise2
@@ -230,14 +257,18 @@ test raise-6.4 {raise/lower toplevel windows} {nonPortable} {
after 500
list $result [winfo containing [winfo rootx .raise2] \
[winfo rooty .raise2]]
-} {.raise1 .raise3}
-test raise-6.5 {raise/lower toplevel windows} {nonPortable} {
+} -result {.raise1 .raise3}
+test raise-6.5 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
raise .raise1
set time [lindex [time {raise .raise1}] 0]
expr {$time < 2000000}
-} 1
-test raise-6.6 {raise/lower toplevel windows} {nonPortable} {
+} -result 1
+test raise-6.6 {raise/lower toplevel windows} -constraints {
+ nonPortable
+} -body {
raise_makeToplevels
update
raise .raise2
@@ -253,35 +284,37 @@ test raise-6.6 {raise/lower toplevel windows} {nonPortable} {
after 500
list $result [winfo containing [winfo rootx .raise2] \
[winfo rooty .raise2]]
-} {.raise1 .raise3}
+} -result {.raise1 .raise3}
+
-test raise-7.1 {errors in raise/lower commands} {
- list [catch {raise} msg] $msg
-} {1 {wrong # args: should be "raise window ?aboveThis?"}}
-test raise-7.2 {errors in raise/lower commands} {
- list [catch {raise a b c} msg] $msg
-} {1 {wrong # args: should be "raise window ?aboveThis?"}}
-test raise-7.3 {errors in raise/lower commands} {
- list [catch {raise badName} msg] $msg
-} {1 {bad window path name "badName"}}
-test raise-7.4 {errors in raise/lower commands} {
- list [catch {raise . badName2} msg] $msg
-} {1 {bad window path name "badName2"}}
-test raise-7.5 {errors in raise/lower commands} {
- list [catch {lower} msg] $msg
-} {1 {wrong # args: should be "lower window ?belowThis?"}}
-test raise-7.6 {errors in raise/lower commands} {
- list [catch {lower a b c} msg] $msg
-} {1 {wrong # args: should be "lower window ?belowThis?"}}
-test raise-7.7 {errors in raise/lower commands} {
- list [catch {lower badName3} msg] $msg
-} {1 {bad window path name "badName3"}}
-test raise-7.8 {errors in raise/lower commands} {
- list [catch {lower . badName4} msg] $msg
-} {1 {bad window path name "badName4"}}
+test raise-7.1 {errors in raise/lower commands} -body {
+ raise
+} -returnCodes error -result {wrong # args: should be "raise window ?aboveThis?"}
+test raise-7.2 {errors in raise/lower commands} -body {
+ raise a b c
+} -returnCodes error -result {wrong # args: should be "raise window ?aboveThis?"}
+test raise-7.3 {errors in raise/lower commands} -body {
+ raise badName
+} -returnCodes error -result {bad window path name "badName"}
+test raise-7.4 {errors in raise/lower commands} -body {
+ raise . badName2
+} -returnCodes error -result {bad window path name "badName2"}
+test raise-7.5 {errors in raise/lower commands} -body {
+ lower
+} -returnCodes error -result {wrong # args: should be "lower window ?belowThis?"}
+test raise-7.6 {errors in raise/lower commands} -body {
+ lower a b c
+} -returnCodes error -result {wrong # args: should be "lower window ?belowThis?"}
+test raise-7.7 {errors in raise/lower commands} -body {
+ lower badName3
+} -returnCodes error -result {bad window path name "badName3"}
+test raise-7.8 {errors in raise/lower commands} -body {
+ lower . badName4
+} -returnCodes error -result {bad window path name "badName4"}
deleteWindows
# cleanup
cleanupTests
return
+
diff --git a/tests/safe.test b/tests/safe.test
index 3e9f716..99681ee 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -6,9 +6,10 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
## NOTE: Any time tests fail here with an error like:
@@ -41,99 +42,117 @@ if {[string equal $tcl_platform(platform) "windows"]} {
set saveAutoPath $::auto_path
set auto_path [list [info library] $::tk_library]
-test safe-1.1 {Safe Tk loading into an interpreter} {
- catch {safe::interpDelete a}
+test safe-1.1 {Safe Tk loading into an interpreter} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::loadTk [safe::interpCreate a]
safe::interpDelete a
set x {}
- set x
-} ""
-test safe-1.2 {Safe Tk loading into an interpreter} {
- catch {safe::interpDelete a}
+ return $x
+} -result {}
+test safe-1.2 {Safe Tk loading into an interpreter} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
- set l [lsort [interp hidden a]]
+ lsort [interp hidden a]
+} -cleanup {
safe::interpDelete a
- set l
-} $hidden_cmds
-test safe-1.3 {Safe Tk loading into an interpreter} -body {
- catch {safe::interpDelete a}
+} -result $hidden_cmds
+test safe-1.3 {Safe Tk loading into an interpreter} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
- set l [lsort [interp aliases a]]
+ lsort [interp aliases a]
+} -cleanup {
safe::interpDelete a
- set l
} -match glob -result {*encoding*exit*file*load*source*}
-test safe-2.1 {Unsafe commands not available} {
- catch {safe::interpDelete a}
+
+test safe-2.1 {Unsafe commands not available} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
set status broken
if {[catch {interp eval a {toplevel .t}} msg]} {
set status ok
}
+ return $status
+} -cleanup {
safe::interpDelete a
- set status
-} ok
-test safe-2.2 {Unsafe commands not available} {
- catch {safe::interpDelete a}
+} -result ok
+test safe-2.2 {Unsafe commands not available} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
set status broken
if {[catch {interp eval a {menu .m}} msg]} {
set status ok
}
+ return $status
+} -cleanup {
safe::interpDelete a
- set status
-} ok
-test safe-2.3 {Unsafe subcommands not available} {
- catch {safe::interpDelete a}
+} -result ok
+test safe-2.3 {Unsafe subcommands not available} -setup {
+ catch {safe::interpDelete a}
+} -body {
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}
+} -cleanup {
+ safe::interpDelete a
+} -result {ok {appname not accessible in a safe interpreter}}
+test safe-2.4 {Unsafe subcommands not available} -setup {
+ catch {safe::interpDelete a}
+} -body {
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}}
+} -cleanup {
+ safe::interpDelete a
+} -result {ok {scaling not accessible in a safe interpreter}}
+
-test safe-3.1 {Unsafe commands are available hidden} {
- catch {safe::interpDelete a}
+test safe-3.1 {Unsafe commands are available hidden} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
set status ok
if {[catch {interp invokehidden a toplevel .t} msg]} {
set status broken
}
+ return $status
+} -cleanup {
safe::interpDelete a
- set status
-} ok
-test safe-3.2 {Unsafe commands are available hidden} {
- catch {safe::interpDelete a}
+} -result ok
+test safe-3.2 {Unsafe commands are available hidden} -setup {
+ catch {safe::interpDelete a}
+} -body {
safe::interpCreate a
safe::loadTk a
set status ok
if {[catch {interp invokehidden a menu .m} msg]} {
set status broken
}
+ return $status
+} -cleanup {
safe::interpDelete a
- set status
-} ok
+} -result ok
-test safe-4.1 {testing loadTk} {
+
+test safe-4.1 {testing loadTk} -body {
# no error shall occur, the user will
# eventually see a new toplevel
set i [safe::loadTk [safe::interpCreate]]
@@ -142,27 +161,28 @@ test safe-4.1 {testing loadTk} {
# to position the window (if the wm does not do it automatically)
# and thus make the test suite not runable non interactively
safe::interpDelete $i
-} {}
+} -result {}
-test safe-4.2 {testing loadTk -use} {
+test safe-4.2 {testing loadTk -use} -body {
set w .safeTkFrame
- catch {destroy $w}
+ destroy $w
frame $w -container 1;
pack .safeTkFrame
set i [safe::loadTk [safe::interpCreate] -use [winfo id $w]]
interp eval $i {button .b -text "hello world!"; pack .b}
safe::interpDelete $i
destroy $w
-} {}
+} -result {}
+
-test safe-5.1 {loading Tk in safe interps without master's clearance} {
+test safe-5.1 {loading Tk in safe interps without master's clearance} -body {
set i [safe::interpCreate]
- catch {interp eval $i {load {} Tk}} msg
+ interp eval $i {load {} Tk}
+} -cleanup {
safe::interpDelete $i
- set msg
-} {not allowed to start Tk by master's safe::TkInit}
+} -returnCodes error -result {not allowed to start Tk by master's safe::TkInit}
-test safe-5.2 {multi-level Tk loading with clearance} {
+test safe-5.2 {multi-level Tk loading with clearance} -body {
# No error shall occur in that test and no window
# shall remain at the end.
set i [safe::interpCreate]
@@ -170,47 +190,52 @@ test safe-5.2 {multi-level Tk loading with clearance} {
set j [safe::interpCreate $j]
safe::loadTk $j
interp eval $j {
- button .b -text Ok -command {destroy .}
- pack .b
-# tkwait window . ; # for interactive testing/debugging
+ button .b -text Ok -command {destroy .}
+ pack .b
+# tkwait window . ; # for interactive testing/debugging
}
+} -cleanup {
safe::interpDelete $j
safe::interpDelete $i
-} {}
+} -result {}
-test safe-6.1 {loadTk -use windowPath} {
+
+test safe-6.1 {loadTk -use windowPath} -body {
set w .safeTkFrame
- catch {destroy $w}
+ destroy $w
frame $w -container 1;
pack .safeTkFrame
set i [safe::loadTk [safe::interpCreate] -use $w]
interp eval $i {button .b -text "hello world!"; pack .b}
safe::interpDelete $i
destroy $w
-} {}
+} -result {}
-test safe-6.2 {loadTk -use windowPath, conflicting -display} {
+test safe-6.2 {loadTk -use windowPath, conflicting -display} -body {
set w .safeTkFrame
- catch {destroy $w}
+ destroy $w
frame $w -container 1;
pack .safeTkFrame
set i [safe::interpCreate]
catch {safe::loadTk $i -use $w -display :23.56} msg
+ string range $msg 0 36
+} -cleanup {
safe::interpDelete $i
destroy $w
- string range $msg 0 36
-} {conflicting -display :23.56 and -use }
+} -result {conflicting -display :23.56 and -use }
-test safe-7.1 {canvas printing} {
+test safe-7.1 {canvas printing} -body {
set i [safe::loadTk [safe::interpCreate]]
- set r [catch {interp eval $i {canvas .c; .c postscript}}]
+ interp eval $i {canvas .c; .c postscript}
+} -cleanup {
safe::interpDelete $i
- set r
-} 0
+} -returnCodes ok -match glob -result *
# cleanup
set ::auto_path $saveAutoPath
unset hidden_cmds
cleanupTests
return
+
+
diff --git a/tests/scale.test b/tests/scale.test
index 657f668..13ccb4d 100644
--- a/tests/scale.test
+++ b/tests/scale.test
@@ -6,7 +6,8 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
@@ -17,220 +18,497 @@ option add *Scale.borderWidth 2
option add *Scale.highlightThickness 2
option add *Scale.font {Helvetica -12 bold}
+# Widget used in 1.* tests
scale .s -from 100 -to 300
pack .s
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"}}
- {-bigincrement 12.5 12.5 badValue
- {expected floating-point number but got "badValue"}}
- {-bg #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
- {-command "set x" {set x} {} {}}
- {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
- {-digits 5 5 badValue {expected integer but got "badValue"}}
- {-fg #00ff00 #00ff00 badValue {unknown color name "badValue"}}
- {-font fixed fixed {} {font "" doesn't exist}}
- {-foreground green green badValue {unknown color name "badValue"}}
- {-from -15.0 -15.0 badValue
- {expected floating-point number but got "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"}}
- {-label "Some text" {Some text} {} {}}
- {-length 130 130 badValue {bad screen distance "badValue"}}
- {-orient horizontal horizontal badValue
- {bad orient "badValue": must be horizontal or vertical}}
- {-orient horizontal horizontal {} {}}
- {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
- {-repeatdelay 14 14 bogus {expected integer but got "bogus"}}
- {-repeatinterval 14 14 bogus {expected integer but got "bogus"}}
- {-resolution 2.0 2.0 badValue
- {expected floating-point number but got "badValue"}}
- {-showvalue 0 0 badValue {expected boolean value but got "badValue"}}
- {-sliderlength 86 86 badValue {bad screen distance "badValue"}}
- {-sliderrelief raised raised badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
- {-state d disabled badValue
- {bad state "badValue": must be active, disabled, or normal}}
- {-state n normal {} {}}
- {-takefocus "any string" "any string" {} {}}
- {-tickinterval 4.3 4.0 badValue
- {expected floating-point number but got "badValue"}}
- {-to 14.9 15.0 badValue
- {expected floating-point number but got "badValue"}}
- {-troughcolor #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
- {-variable x x {} {}}
- {-width 32 32 badValue {bad screen distance "badValue"}}
-} {
- set name [lindex $test 0]
- test scale-1.$i {configuration options} {
- .s configure $name [lindex $test 1]
- lindex [.s configure $name] 4
- } [lindex $test 2]
- incr i
- if {[lindex $test 3] ne ""} {
- test scale-1.$i {configuration options} {
- list [catch {.s configure $name [lindex $test 3]} msg] $msg
- } [list 1 [lindex $test 4]]
- }
- .s configure $name [lindex [.s configure $name] 3]
- incr i
-}
+
+test scale-1.1 {configuration options} -body {
+ .s configure -activebackground #ff0000
+ .s cget -activebackground
+} -cleanup {
+ .s configure -activebackground [lindex [.s configure -activebackground] 3]
+} -result {#ff0000}
+test scale-1.2 {configuration options} -body {
+ .s configure -activebackground non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test scale-1.3 {configuration options} -body {
+ .s configure -background #ff0000
+ .s cget -background
+} -cleanup {
+ .s configure -background [lindex [.s configure -background] 3]
+} -result {#ff0000}
+test scale-1.4 {configuration options} -body {
+ .s configure -background non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test scale-1.5 {configuration options} -body {
+ .s configure -bd 4
+ .s cget -bd
+} -cleanup {
+ .s configure -bd [lindex [.s configure -bd] 3]
+} -result {4}
+test scale-1.6 {configuration options} -body {
+ .s configure -bd badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test scale-1.7 {configuration options} -body {
+ .s configure -bigincrement 12.5
+ .s cget -bigincrement
+} -cleanup {
+ .s configure -bigincrement [lindex [.s configure -bigincrement] 3]
+} -result {12.5}
+test scale-1.8 {configuration options} -body {
+ .s configure -bigincrement badValue
+} -returnCodes error -result {expected floating-point number but got "badValue"}
+test scale-1.9 {configuration options} -body {
+ .s configure -bg #ff0000
+ .s cget -bg
+} -cleanup {
+ .s configure -bg [lindex [.s configure -bg] 3]
+} -result {#ff0000}
+test scale-1.10 {configuration options} -body {
+ .s configure -bg non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test scale-1.11 {configuration options} -body {
+ .s configure -borderwidth 1.3
+ .s cget -borderwidth
+} -cleanup {
+ .s configure -borderwidth [lindex [.s configure -borderwidth] 3]
+} -result {1}
+test scale-1.12 {configuration options} -body {
+ .s configure -borderwidth badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test scale-1.13 {configuration options} -body {
+ .s configure -command {set x}
+ .s cget -command
+} -cleanup {
+ .s configure -command [lindex [.s configure -command] 3]
+} -result {set x}
+test scale-1.15 {configuration options} -body {
+ .s configure -cursor arrow
+ .s cget -cursor
+} -cleanup {
+ .s configure -cursor [lindex [.s configure -cursor] 3]
+} -result {arrow}
+test scale-1.16 {configuration options} -body {
+ .s configure -cursor badValue
+} -returnCodes error -result {bad cursor spec "badValue"}
+test scale-1.17 {configuration options} -body {
+ .s configure -digits 5
+ .s cget -digits
+} -cleanup {
+ .s configure -digits [lindex [.s configure -digits] 3]
+} -result {5}
+test scale-1.18 {configuration options} -body {
+ .s configure -digits badValue
+} -returnCodes error -result {expected integer but got "badValue"}
+test scale-1.19 {configuration options} -body {
+ .s configure -fg #00ff00
+ .s cget -fg
+} -cleanup {
+ .s configure -fg [lindex [.s configure -fg] 3]
+} -result {#00ff00}
+test scale-1.20 {configuration options} -body {
+ .s configure -fg badValue
+} -returnCodes error -result {unknown color name "badValue"}
+test scale-1.21 {configuration options} -body {
+ .s configure -font fixed
+ .s cget -font
+} -cleanup {
+ .s configure -font [lindex [.s configure -font] 3]
+} -result {fixed}
+test scale-1.23 {configuration options} -body {
+ .s configure -foreground green
+ .s cget -foreground
+} -cleanup {
+ .s configure -foreground [lindex [.s configure -foreground] 3]
+} -result {green}
+test scale-1.24 {configuration options} -body {
+ .s configure -foreground badValue
+} -returnCodes error -result {unknown color name "badValue"}
+test scale-1.25 {configuration options} -body {
+ .s configure -from -15.0
+ .s cget -from
+} -cleanup {
+ .s configure -from [lindex [.s configure -from] 3]
+} -result {-15.0}
+test scale-1.26 {configuration options} -body {
+ .s configure -from badValue
+} -returnCodes error -result {expected floating-point number but got "badValue"}
+test scale-1.27 {configuration options} -body {
+ .s configure -highlightbackground #112233
+ .s cget -highlightbackground
+} -cleanup {
+ .s configure -highlightbackground [lindex [.s configure -highlightbackground] 3]
+} -result {#112233}
+test scale-1.28 {configuration options} -body {
+ .s configure -highlightbackground ugly
+} -returnCodes error -result {unknown color name "ugly"}
+test scale-1.29 {configuration options} -body {
+ .s configure -highlightcolor #123456
+ .s cget -highlightcolor
+} -cleanup {
+ .s configure -highlightcolor [lindex [.s configure -highlightcolor] 3]
+} -result {#123456}
+test scale-1.30 {configuration options} -body {
+ .s configure -highlightcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test scale-1.31 {configuration options} -body {
+ .s configure -highlightthickness 2
+ .s cget -highlightthickness
+} -cleanup {
+ .s configure -highlightthickness [lindex [.s configure -highlightthickness] 3]
+} -result {2}
+test scale-1.32 {configuration options} -body {
+ .s configure -highlightthickness badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test scale-1.33 {configuration options} -body {
+ .s configure -label {Some text}
+ .s cget -label
+} -cleanup {
+ .s configure -label [lindex [.s configure -label] 3]
+} -result {Some text}
+test scale-1.35 {configuration options} -body {
+ .s configure -length 130
+ .s cget -length
+} -cleanup {
+ .s configure -length [lindex [.s configure -length] 3]
+} -result {130}
+test scale-1.36 {configuration options} -body {
+ .s configure -length badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test scale-1.37 {configuration options} -body {
+ .s configure -orient horizontal
+ .s cget -orient
+} -cleanup {
+ .s configure -orient [lindex [.s configure -orient] 3]
+} -result {horizontal}
+test scale-1.38 {configuration options} -body {
+ .s configure -orient badValue
+} -returnCodes error -result {bad orient "badValue": must be horizontal or vertical}
+test scale-1.39 {configuration options} -body {
+ .s configure -orient horizontal
+ .s cget -orient
+} -cleanup {
+ .s configure -orient [lindex [.s configure -orient] 3]
+} -result {horizontal}
+test scale-1.41 {configuration options} -body {
+ .s configure -relief ridge
+ .s cget -relief
+} -cleanup {
+ .s configure -relief [lindex [.s configure -relief] 3]
+} -result {ridge}
+test scale-1.42 {configuration options} -body {
+ .s configure -relief badValue
+} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+test scale-1.43 {configuration options} -body {
+ .s configure -repeatdelay 14
+ .s cget -repeatdelay
+} -cleanup {
+ .s configure -repeatdelay [lindex [.s configure -repeatdelay] 3]
+} -result {14}
+test scale-1.44 {configuration options} -body {
+ .s configure -repeatdelay bogus
+} -returnCodes error -result {expected integer but got "bogus"}
+test scale-1.45 {configuration options} -body {
+ .s configure -repeatinterval 14
+ .s cget -repeatinterval
+} -cleanup {
+ .s configure -repeatinterval [lindex [.s configure -repeatinterval] 3]
+} -result {14}
+test scale-1.46 {configuration options} -body {
+ .s configure -repeatinterval bogus
+} -returnCodes error -result {expected integer but got "bogus"}
+test scale-1.47 {configuration options} -body {
+ .s configure -resolution 2.0
+ .s cget -resolution
+} -cleanup {
+ .s configure -resolution [lindex [.s configure -resolution] 3]
+} -result {2.0}
+test scale-1.48 {configuration options} -body {
+ .s configure -resolution badValue
+} -returnCodes error -result {expected floating-point number but got "badValue"}
+test scale-1.49 {configuration options} -body {
+ .s configure -showvalue 0
+ .s cget -showvalue
+} -cleanup {
+ .s configure -showvalue [lindex [.s configure -showvalue] 3]
+} -result {0}
+test scale-1.50 {configuration options} -body {
+ .s configure -showvalue badValue
+} -returnCodes error -result {expected boolean value but got "badValue"}
+test scale-1.51 {configuration options} -body {
+ .s configure -sliderlength 86
+ .s cget -sliderlength
+} -cleanup {
+ .s configure -sliderlength [lindex [.s configure -sliderlength] 3]
+} -result {86}
+test scale-1.52 {configuration options} -body {
+ .s configure -sliderlength badValue
+} -returnCodes error -result {bad screen distance "badValue"}
+test scale-1.53 {configuration options} -body {
+ .s configure -sliderrelief raised
+ .s cget -sliderrelief
+} -cleanup {
+ .s configure -sliderrelief [lindex [.s configure -sliderrelief] 3]
+} -result {raised}
+test scale-1.54 {configuration options} -body {
+ .s configure -sliderrelief badValue
+} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}
+test scale-1.55 {configuration options} -body {
+ .s configure -state d
+ .s cget -state
+} -cleanup {
+ .s configure -state [lindex [.s configure -state] 3]
+} -result {disabled}
+test scale-1.56 {configuration options} -body {
+ .s configure -state badValue
+} -returnCodes error -result {bad state "badValue": must be active, disabled, or normal}
+test scale-1.57 {configuration options} -body {
+ .s configure -state n
+ .s cget -state
+} -cleanup {
+ .s configure -state [lindex [.s configure -state] 3]
+} -result {normal}
+test scale-1.59 {configuration options} -body {
+ .s configure -takefocus {any string}
+ .s cget -takefocus
+} -cleanup {
+ .s configure -takefocus [lindex [.s configure -takefocus] 3]
+} -result {any string}
+test scale-1.61 {configuration options} -body {
+ .s configure -tickinterval 4.3
+ .s cget -tickinterval
+} -cleanup {
+ .s configure -tickinterval [lindex [.s configure -tickinterval] 3]
+} -result {4.0}
+test scale-1.62 {configuration options} -body {
+ .s configure -tickinterval badValue
+} -returnCodes error -result {expected floating-point number but got "badValue"}
+test scale-1.63 {configuration options} -body {
+ .s configure -to 14.9
+ .s cget -to
+} -cleanup {
+ .s configure -to [lindex [.s configure -to] 3]
+} -result {15.0}
+test scale-1.64 {configuration options} -body {
+ .s configure -to badValue
+} -returnCodes error -result {expected floating-point number but got "badValue"}
+test scale-1.65 {configuration options} -body {
+ .s configure -troughcolor #ff0000
+ .s cget -troughcolor
+} -cleanup {
+ .s configure -troughcolor [lindex [.s configure -troughcolor] 3]
+} -result {#ff0000}
+test scale-1.66 {configuration options} -body {
+ .s configure -troughcolor non-existent
+} -returnCodes error -result {unknown color name "non-existent"}
+test scale-1.67 {configuration options} -body {
+ .s configure -variable x
+ .s cget -variable
+} -cleanup {
+ .s configure -variable [lindex [.s configure -variable] 3]
+} -result {x}
+test scale-1.69 {configuration options} -body {
+ .s configure -width 32
+ .s cget -width
+} -cleanup {
+ .s configure -width [lindex [.s configure -width] 3]
+} -result {32}
+test scale-1.70 {configuration options} -body {
+ .s configure -width badValue
+} -returnCodes error -result {bad screen distance "badValue"}
destroy .s
-test scale-2.1 {Tk_ScaleCmd procedure} {
- list [catch {scale} msg] $msg
-} {1 {wrong # args: should be "scale pathName ?options?"}}
-test scale-2.2 {Tk_ScaleCmd procedure} {
- list [catch {scale foo} msg] $msg [winfo child .]
-} {1 {bad window path name "foo"} {}}
-test scale-2.3 {Tk_ScaleCmd procedure} {
- list [catch {scale .s -gorp dumb} msg] $msg [winfo child .]
-} {1 {unknown option "-gorp"} {}}
+test scale-2.1 {Tk_ScaleCmd procedure} -body {
+ scale
+} -returnCodes error -result {wrong # args: should be "scale pathName ?-option value ...?"}
+test scale-2.2 {Tk_ScaleCmd procedure} -body {
+ scale foo
+} -returnCodes error -result {bad window path name "foo"}
+test scale-2.3 {Tk_ScaleCmd procedure} -body {
+ catch {scale foo}
+ winfo child .
+} -result {}
+test scale-2.4 {Tk_ScaleCmd procedure} -body {
+ scale .s -gorp dumb
+} -returnCodes error -result {unknown option "-gorp"}
+test scale-2.5 {Tk_ScaleCmd procedure} -body {
+ catch {scale .s -gorp dumb}
+ winfo child .
+} -result {}
+
+
+# Widget used in 3.* tests
+destroy .s
scale .s -from 100 -to 200
pack .s
update idletasks
-test scale-3.1 {ScaleWidgetCmd procedure} {
- list [catch {.s} msg] $msg
-} {1 {wrong # args: should be ".s option ?arg arg ...?"}}
-test scale-3.2 {ScaleWidgetCmd procedure, cget option} {
- list [catch {.s cget} msg] $msg
-} {1 {wrong # args: should be ".s cget option"}}
-test scale-3.3 {ScaleWidgetCmd procedure, cget option} {
- list [catch {.s cget a b} msg] $msg
-} {1 {wrong # args: should be ".s cget option"}}
-test scale-3.4 {ScaleWidgetCmd procedure, cget option} {
- list [catch {.s cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test scale-3.5 {ScaleWidgetCmd procedure, cget option} {
+test scale-3.1 {ScaleWidgetCmd procedure} -body {
+ .s
+} -returnCodes error -result {wrong # args: should be ".s option ?arg ...?"}
+test scale-3.2 {ScaleWidgetCmd procedure, cget option} -body {
+ .s cget
+} -returnCodes error -result {wrong # args: should be ".s cget option"}
+test scale-3.3 {ScaleWidgetCmd procedure, cget option} -body {
+ .s cget a b
+} -returnCodes error -result {wrong # args: should be ".s cget option"}
+test scale-3.4 {ScaleWidgetCmd procedure, cget option} -body {
+ .s cget -gorp
+} -returnCodes error -result {unknown option "-gorp"}
+test scale-3.5 {ScaleWidgetCmd procedure, cget option} -body {
+ .s configure -highlightthickness 2
.s cget -highlightthickness
-} {2}
-test scale-3.6 {ScaleWidgetCmd procedure, configure option} {
+} -result {2}
+test scale-3.6 {ScaleWidgetCmd procedure, configure option} -body {
list [llength [.s configure]] [lindex [.s configure] 6]
-} {33 {-command command Command {} {}}}
-test scale-3.7 {ScaleWidgetCmd procedure, configure option} {
- list [catch {.s configure -foo} msg] $msg
-} {1 {unknown option "-foo"}}
-test scale-3.8 {ScaleWidgetCmd procedure, configure option} {
- list [catch {.s configure -borderwidth 2 -bg} msg] $msg
-} {1 {value for "-bg" missing}}
-test scale-3.9 {ScaleWidgetCmd procedure, coords option} {
- list [catch {.s coords a b} msg] $msg
-} {1 {wrong # args: should be ".s coords ?value?"}}
-test scale-3.10 {ScaleWidgetCmd procedure, coords option} {
- list [catch {.s coords bad} msg] $msg
-} {1 {expected floating-point number but got "bad"}}
-test scale-3.11 {ScaleWidgetCmd procedure} {fonts} {
+} -result {33 {-command command Command {} {}}}
+test scale-3.7 {ScaleWidgetCmd procedure, configure option} -body {
+ .s configure -foo
+} -returnCodes error -result {unknown option "-foo"}
+test scale-3.8 {ScaleWidgetCmd procedure, configure option} -body {
+ .s configure -borderwidth 2 -bg
+} -returnCodes error -result {value for "-bg" missing}
+test scale-3.9 {ScaleWidgetCmd procedure, coords option} -body {
+ .s coords a b
+} -returnCodes error -result {wrong # args: should be ".s coords ?value?"}
+test scale-3.10 {ScaleWidgetCmd procedure, coords option} -body {
+ .s coords bad
+} -returnCodes error -result {expected floating-point number but got "bad"}
+test scale-3.11 {ScaleWidgetCmd procedure} -constraints {
+ fonts
+} -body {
+ .s configure -from 100 -to 200
+ update idletasks
.s set 120
.s coords
-} {38 34}
-test scale-3.12 {ScaleWidgetCmd procedure, coords option} {fonts} {
- .s configure -orient horizontal
- update
+} -result {38 34}
+test scale-3.12 {ScaleWidgetCmd procedure, coords option} -constraints {
+ fonts
+} -body {
+ .s configure -from 100 -to 200 -orient horizontal
+ update idletasks
.s set 120
.s coords
-} {34 31}
-.s configure -orient vertical
-update
-test scale-3.13 {ScaleWidgetCmd procedure, get option} {
- list [catch {.s get a} msg] $msg
-} {1 {wrong # args: should be ".s get ?x y?"}}
-test scale-3.14 {ScaleWidgetCmd procedure, get option} {
- list [catch {.s get a b c} msg] $msg
-} {1 {wrong # args: should be ".s get ?x y?"}}
-test scale-3.15 {ScaleWidgetCmd procedure, get option} {
- list [catch {.s get a 11} msg] $msg
-} {1 {expected integer but got "a"}}
-test scale-3.16 {ScaleWidgetCmd procedure, get option} {
- list [catch {.s get 12 b} msg] $msg
-} {1 {expected integer but got "b"}}
-test scale-3.17 {ScaleWidgetCmd procedure, get option} {
+} -result {34 31}
+test scale-3.13 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical
+ update
+ .s get a
+} -returnCodes error -result {wrong # args: should be ".s get ?x y?"}
+test scale-3.14 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical
+ update
+ .s get a b c
+} -returnCodes error -result {wrong # args: should be ".s get ?x y?"}
+test scale-3.15 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical
+ update
+ .s get a 11
+} -returnCodes error -result {expected integer but got "a"}
+test scale-3.16 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical
+ update
+ .s get 12 b
+} -returnCodes error -result {expected integer but got "b"}
+test scale-3.17 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical
+ update
.s set 133
.s get
-} 133
-test scale-3.18 {ScaleWidgetCmd procedure, get option} {
- .s configure -resolution 0.5
+} -result 133
+test scale-3.18 {ScaleWidgetCmd procedure, get option} -body {
+ .s configure -orient vertical -resolution 0.5
+ update
.s set 150
.s get 37 34
-} 119.5
+} -result {119.5}
.s configure -resolution 1
-test scale-3.19 {ScaleWidgetCmd procedure, identify option} {
- list [catch {.s identify} msg] $msg
-} {1 {wrong # args: should be ".s identify x y"}}
-test scale-3.20 {ScaleWidgetCmd procedure, identify option} {
- list [catch {.s identify 1 2 3} msg] $msg
-} {1 {wrong # args: should be ".s identify x y"}}
-test scale-3.21 {ScaleWidgetCmd procedure, identify option} {
- list [catch {.s identify boo 16} msg] $msg
-} {1 {expected integer but got "boo"}}
-test scale-3.22 {ScaleWidgetCmd procedure, identify option} {
- list [catch {.s identify 17 bad} msg] $msg
-} {1 {expected integer but got "bad"}}
-test scale-3.23 {ScaleWidgetCmd procedure, identify option} {fonts} {
+test scale-3.19 {ScaleWidgetCmd procedure, identify option} -body {
+ .s identify
+} -returnCodes error -result {wrong # args: should be ".s identify x y"}
+test scale-3.20 {ScaleWidgetCmd procedure, identify option} -body {
+ .s identify 1 2 3
+} -returnCodes error -result {wrong # args: should be ".s identify x y"}
+test scale-3.21 {ScaleWidgetCmd procedure, identify option} -body {
+ .s identify boo 16
+} -returnCodes error -result {expected integer but got "boo"}
+test scale-3.22 {ScaleWidgetCmd procedure, identify option} -body {
+ .s identify 17 bad
+} -returnCodes error -result {expected integer but got "bad"}
+test scale-3.23 {ScaleWidgetCmd procedure, identify option} -constraints {
+ fonts
+} -body {
+ .s configure -from 100 -to 200 -orient vertical -resolution 1
+ update
.s set 120
list [.s identify 35 10] [.s identify 35 30] [.s identify 35 80] [.s identify 5 80]
-} {trough1 slider trough2 {}}
-test scale-3.24 {ScaleWidgetCmd procedure, set option} {
- list [catch {.s set} msg] $msg
-} {1 {wrong # args: should be ".s set value"}}
-test scale-3.25 {ScaleWidgetCmd procedure, set option} {
- list [catch {.s set a b} msg] $msg
-} {1 {wrong # args: should be ".s set value"}}
-test scale-3.26 {ScaleWidgetCmd procedure, set option} {
- list [catch {.s set bad} msg] $msg
-} {1 {expected floating-point number but got "bad"}}
-test scale-3.27 {ScaleWidgetCmd procedure, set option} {
+} -result {trough1 slider trough2 {}}
+test scale-3.24 {ScaleWidgetCmd procedure, set option} -body {
+ .s set
+} -returnCodes error -result {wrong # args: should be ".s set value"}
+test scale-3.25 {ScaleWidgetCmd procedure, set option} -body {
+ .s set a b
+} -returnCodes error -result {wrong # args: should be ".s set value"}
+test scale-3.26 {ScaleWidgetCmd procedure, set option} -body {
+ .s set bad
+} -returnCodes error -result {expected floating-point number but got "bad"}
+test scale-3.27 {ScaleWidgetCmd procedure, set option} -body {
+ .s configure -from 100 -to 200 -orient vertical -resolution 0.5
+ update
.s set 142
-} {}
-test scale-3.28 {ScaleWidgetCmd procedure, set option} {
+} -result {}
+test scale-3.28 {ScaleWidgetCmd procedure, set option} -body {
+ .s configure -from 100 -to 200 -orient vertical -resolution 1
+ update
.s set 118
.s configure -state disabled
.s set 181
.s configure -state normal
.s get
-} {118}
-test scale-3.29 {ScaleWidgetCmd procedure} {
- list [catch {.s dumb} msg] $msg
-} {1 {bad option "dumb": must be cget, configure, coords, get, identify, or set}}
-test scale-3.30 {ScaleWidgetCmd procedure} {
- list [catch {.s c} msg] $msg
-} {1 {ambiguous option "c": must be cget, configure, coords, get, identify, or set}}
-test scale-3.31 {ScaleWidgetCmd procedure} {
- list [catch {.s co} msg] $msg
-} {1 {ambiguous option "co": must be cget, configure, coords, get, identify, or set}}
-test scale-3.32 {ScaleWidgetCmd procedure, Tk_Preserve} {
+} -result {118}
+test scale-3.29 {ScaleWidgetCmd procedure} -body {
+ .s dumb
+} -returnCodes error -result {bad option "dumb": must be cget, configure, coords, get, identify, or set}
+test scale-3.30 {ScaleWidgetCmd procedure} -body {
+ .s c
+} -returnCodes error -result {ambiguous option "c": must be cget, configure, coords, get, identify, or set}
+test scale-3.31 {ScaleWidgetCmd procedure} -body {
+ .s co
+} -returnCodes error -result {ambiguous option "co": must be cget, configure, coords, get, identify, or set}
+destroy .s
+
+test scale-3.32 {ScaleWidgetCmd procedure, Tk_Preserve} -setup {
+ destroy .s
+} -body {
proc kill args {
- destroy .s
+ destroy .s
}
- catch {destroy .s}
scale .s -variable x -from 0 -to 100 -orient horizontal
pack .s
update
.s configure -command kill
.s set 55
-} {}
+} -cleanup {
+ destroy .s
+} -result {}
+
-test scale-4.1 {DestroyScale procedure} {
- catch {destroy .s}
+test scale-4.1 {DestroyScale procedure} -setup {
+ deleteWindows
+} -body {
set x 50
scale .s -variable x -from 0 -to 100 -orient horizontal
pack .s
update
destroy .s
list [catch {set x foo} msg] $msg $x
-} {0 foo foo}
+} -result {0 foo foo}
+
-test scale-5.1 {ConfigureScale procedure} {
- catch {destroy .s}
+test scale-5.1 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
set x 66
set y 77
scale .s -variable x -from 0 -to 100
@@ -238,14 +516,20 @@ test scale-5.1 {ConfigureScale procedure} {
update
.s configure -variable y
list [catch {set x foo} msg] $msg $x [.s get]
-} {0 foo foo 77}
-test scale-5.2 {ConfigureScale procedure} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {0 foo foo 77}
+test scale-5.2 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100
- list [catch {.s configure -foo bar} msg] $msg
-} {1 {unknown option "-foo"}}
-test scale-5.3 {ConfigureScale procedure} {
- catch {destroy .s}
+ .s configure -foo bar
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-foo"}
+test scale-5.3 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
catch {unset x}
scale .s -from 0 -to 100 -variable x
set result $x
@@ -255,349 +539,475 @@ test scale-5.3 {ConfigureScale procedure} {
.s set 3
lappend result $x
unset x
- lappend result [catch {set x} msg] $msg
-} {0 0 92 3 0 3}
-test scale-5.4 {ConfigureScale procedure} {
- catch {destroy .s}
+ lappend result [set x]
+} -cleanup {
+ deleteWindows
+} -result {0 0 92 3 3}
+test scale-5.4 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100
- list [catch {.s configure -orient dumb} msg] $msg
-} {1 {bad orient "dumb": must be horizontal or vertical}}
-test scale-5.5 {ConfigureScale procedure} {
- catch {destroy .s}
+ .s configure -orient dumb
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad orient "dumb": must be horizontal or vertical}
+test scale-5.5 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 1.11 -to 1.89 -resolution .1 -tickinterval .76
list [format %.1f [.s cget -from]] [format %.1f [.s cget -to]] \
- [format %.1f [.s cget -tickinterval]]
-} {1.1 1.9 0.8}
-test scale-5.6 {ConfigureScale procedure} {
- catch {destroy .s}
+ [format %.1f [.s cget -tickinterval]]
+} -cleanup {
+ deleteWindows
+} -result {1.1 1.9 0.8}
+test scale-5.6 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 1 -to 10 -tickinterval -2
pack .s
set result [lindex [.s configure -tickinterval] 4]
.s configure -from 10 -to 1 -tickinterval 2
lappend result [lindex [.s configure -tickinterval] 4]
-} {2.0 -2.0}
-test scale-5.7 {ConfigureScale procedure} {
- catch {destroy .s}
- list [catch {scale .s -from 0 -to 100 -state bogus} msg] $msg
-} {1 {bad state "bogus": must be active, disabled, or normal}}
+} -cleanup {
+ deleteWindows
+} -result {2.0 -2.0}
+test scale-5.7 {ConfigureScale procedure} -setup {
+ deleteWindows
+} -body {
+ scale .s -from 0 -to 100 -state bogus
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad state "bogus": must be active, disabled, or normal}
+
-catch {destroy .s}
+# Widget used in 6.* tests
+destroy .s
scale .s -orient horizontal -length 200
pack .s
-test scale-6.1 {ComputeFormat procedure} {
+test scale-6.1 {ComputeFormat procedure} -body {
.s configure -from 10 -to 100 -resolution 10
.s set 49.3
.s get
-} {50}
-test scale-6.2 {ComputeFormat procedure} {
+} -result {50}
+test scale-6.2 {ComputeFormat procedure} -body {
.s configure -from 100 -to 1000 -resolution 100
.s set 493
.s get
-} {500}
-test scale-6.3 {ComputeFormat procedure} {
+} -result {500}
+test scale-6.3 {ComputeFormat procedure} -body {
.s configure -from 1000 -to 10000 -resolution 1000
.s set 4930
.s get
-} {5000}
-test scale-6.4 {ComputeFormat procedure} {
+} -result {5000}
+test scale-6.4 {ComputeFormat procedure} -body {
.s configure -from 10000 -to 100000 -resolution 10000
.s set 49000
.s get
-} {50000}
-test scale-6.5 {ComputeFormat procedure} {
+} -result {50000}
+test scale-6.5 {ComputeFormat procedure} -body {
.s configure -from 100000 -to 1000000 -resolution 100000
.s set 493000
.s get
-} {500000}
-test scale-6.6 {ComputeFormat procedure} {nonPortable} {
+} -result {500000}
+test scale-6.6 {ComputeFormat procedure} -constraints {
+ nonPortable
+} -body {
# This test is non-portable because some platforms format the
# result as 5e+06.
-
.s configure -from 1000000 -to 10000000 -resolution 1000000
.s set 4930000
.s get
-} {5000000}
-test scale-6.7 {ComputeFormat procedure} {
+} -result {5000000}
+test scale-6.7 {ComputeFormat procedure} -body {
.s configure -from 1000000000 -to 10000000000 -resolution 1000000000
.s set 4930000000
expr {[.s get] == 5.0e+09}
-} 1
-test scale-6.8 {ComputeFormat procedure} {
+} -result 1
+test scale-6.8 {ComputeFormat procedure} -body {
.s configure -from .1 -to 1 -resolution .1
.s set .6
.s get
-} {0.6}
-test scale-6.9 {ComputeFormat procedure} {
+} -result {0.6}
+test scale-6.9 {ComputeFormat procedure} -body {
.s configure -from .01 -to .1 -resolution .01
.s set .06
.s get
-} {0.06}
-test scale-6.10 {ComputeFormat procedure} {
+} -result {0.06}
+test scale-6.10 {ComputeFormat procedure} -body {
.s configure -from .001 -to .01 -resolution .001
.s set .006
.s get
-} {0.006}
-test scale-6.11 {ComputeFormat procedure} {
+} -result {0.006}
+test scale-6.11 {ComputeFormat procedure} -body {
.s configure -from .0001 -to .001 -resolution .0001
.s set .0006
.s get
-} {0.0006}
-test scale-6.12 {ComputeFormat procedure} {
+} -result {0.0006}
+test scale-6.12 {ComputeFormat procedure} -body {
.s configure -from .00001 -to .0001 -resolution .00001
.s set .00006
.s get
-} {0.00006}
-test scale-6.13 {ComputeFormat procedure} {
+} -result {0.00006}
+test scale-6.13 {ComputeFormat procedure} -body {
.s configure -from .000001 -to .00001 -resolution .000001
.s set .000006
expr {[.s get] == 6.0e-06}
-} {1}
-test scale-6.14 {ComputeFormat procedure} {
+} -result {1}
+test scale-6.14 {ComputeFormat procedure} -body {
.s configure -to .00001 -from .0001 -resolution .00001
.s set .00006
.s get
-} {0.00006}
-test scale-6.15 {ComputeFormat procedure} {
+} -result {0.00006}
+test scale-6.15 {ComputeFormat procedure} -body {
.s configure -to .000001 -from .00001 -resolution .000001
.s set .000006
expr {[.s get] == 6.0e-06}
-} {1}
-test scale-6.16 {ComputeFormat procedure} {
+} -result {1}
+test scale-6.16 {ComputeFormat procedure} -body {
.s configure -from .00001 -to .0001 -resolution .00001 -digits 1
.s set .00006
expr {[.s get] == 6e-05}
-} {1}
-test scale-6.17 {ComputeFormat procedure} {
+} -result {1}
+test scale-6.17 {ComputeFormat procedure} -body {
.s configure -from 10000000 -to 100000000 -resolution 10000000 -digits 3
.s set 49300000
.s get
-} {50000000}
-test scale-6.18 {ComputeFormat procedure} {
+} -result {50000000}
+test scale-6.18 {ComputeFormat procedure} -body {
.s configure -length 200 -from 0 -to 10 -resolution 0 -digits 0
.s set .111111111
.s get
-} {0.11}
-test scale-6.19 {ComputeFormat procedure} {
+} -result {0.11}
+test scale-6.19 {ComputeFormat procedure} -body {
.s configure -length 200 -from 1000 -to 1002 -resolution 0 -digits 0
.s set 1001.23456789
.s get
-} {1001.23}
-test scale-6.20 {ComputeFormat procedure} {
+} -result {1001.23}
+test scale-6.20 {ComputeFormat procedure} -body {
.s configure -length 200 -from 1000 -to 1001.8 -resolution 0 -digits 0
.s set 1001.23456789
.s get
-} {1001.235}
+} -result {1001.235}
+destroy .s
-test scale-7.1 {ComputeScaleGeometry procedure} {nonPortable fonts} {
- catch {destroy .s}
+
+test scale-7.1 {ComputeScaleGeometry procedure} -constraints {
+ nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 10 -label "Short" -orient vertical -length 5i
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {88 458}
-test scale-7.2 {ComputeScaleGeometry procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {88 458}
+test scale-7.2 {ComputeScaleGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -label "Long string" -orient vertical -tick 200
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {168 108}
-test scale-7.3 {ComputeScaleGeometry procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {168 108}
+test scale-7.3 {ComputeScaleGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -width 10 \
- -sliderlength 10
+ -sliderlength 10
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {22 108}
-test scale-7.4 {ComputeScaleGeometry procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {22 108}
+test scale-7.4 {ComputeScaleGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -bd 5 \
- -relief sunken
+ -relief sunken
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {39 114}
-test scale-7.5 {ComputeScaleGeometry procedure} {nonPortable fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {39 114}
+test scale-7.5 {ComputeScaleGeometry procedure} -constraints {
+ nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 10 -label "Short" -orient horizontal -length 5i
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {458 61}
-test scale-7.6 {ComputeScaleGeometry procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {458 61}
+test scale-7.6 {ComputeScaleGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -label "Long string" -orient horizontal \
- -tick 500
+ -tick 500
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {108 79}
-test scale-7.7 {ComputeScaleGeometry procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {108 79}
+test scale-7.7 {ComputeScaleGeometry procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -orient horizontal -showvalue 0
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {108 27}
-test scale-7.8 {ComputeScaleGeometry procedure} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {108 27}
+test scale-7.8 {ComputeScaleGeometry procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -bd 5 \
- -relief raised -highlightthickness 2
+ -relief raised -highlightthickness 2
pack .s
update
list [winfo reqwidth .s] [winfo reqheight .s]
-} {114 39}
+} -cleanup {
+ deleteWindows
+} -result {114 39}
+
-test scale-8.1 {ScaleElement procedure} {fonts} {
- catch {destroy .s}
+test scale-8.1 {ScaleElement procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
pack .s
.s set 30
update
list [.s identify 53 52] [.s identify 54 52] [.s identify 70 52] \
- [.s identify 71 52]
-} {{} trough1 trough1 {}}
-test scale-8.2 {ScaleElement procedure} {fonts} {
- catch {destroy .s}
+ [.s identify 71 52]
+} -cleanup {
+ deleteWindows
+} -result {{} trough1 trough1 {}}
+test scale-8.2 {ScaleElement procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
pack .s
.s set 30
update
list [.s identify 60 2] [.s identify 60 3] [.s identify 60 302] \
- [.s identify 60 303]
-} {{} trough1 trough2 {}}
-test scale-8.3 {ScaleElement procedure} {fonts} {
- catch {destroy .s}
+ [.s identify 60 303]
+} -cleanup {
+ deleteWindows
+} -result {{} trough1 trough2 {}}
+test scale-8.3 {ScaleElement procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
pack .s
.s set 30
update
list [.s identify 60 83] [.s identify 60 84] [.s identify 60 113] \
- [.s identify 60 114] \
-} {trough1 slider slider trough2}
-test scale-8.4 {ScaleElement procedure} {
- catch {destroy .s}
+ [.s identify 60 114] \
+} -cleanup {
+ deleteWindows
+} -result {trough1 slider slider trough2}
+test scale-8.4 {ScaleElement procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient vertical -bd 4 -width 10 \
- -highlightthickness 1 -length 300 -showvalue 0
+ -highlightthickness 1 -length 300 -showvalue 0
pack .s
.s set 30
update
list [.s identify 4 40] [.s identify 5 40] [.s identify 22 40] \
- [.s identify 23 40] \
-} {{} trough1 trough1 {}}
-test scale-8.5 {ScaleElement procedure} {fonts} {
- catch {destroy .s}
+ [.s identify 23 40] \
+} -cleanup {
+ deleteWindows
+} -result {{} trough1 trough1 {}}
+test scale-8.5 {ScaleElement procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient horizontal -bd 1 \
- -highlightthickness 2 -tick 20 -sliderlength 20 \
- -length 200 -label Test
+ -highlightthickness 2 -tick 20 -sliderlength 20 \
+ -length 200 -label Test
pack .s
.s set 30
update
list [.s identify 150 36] [.s identify 150 37] [.s identify 150 53] \
- [.s identify 150 54]
-} {{} trough2 trough2 {}}
-test scale-8.6 {ScaleElement procedure} {fonts} {
- catch {destroy .s}
+ [.s identify 150 54]
+} -cleanup {
+ deleteWindows
+} -result {{} trough2 trough2 {}}
+test scale-8.6 {ScaleElement procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient horizontal -bd 2 \
- -highlightthickness 1 -tick 20 -length 200
+ -highlightthickness 1 -tick 20 -length 200
pack .s
.s set 30
update
list [.s identify 150 20] [.s identify 150 21] [.s identify 150 39] \
- [.s identify 150 40]
-} {{} trough2 trough2 {}}
-test scale-8.7 {ScaleElement procedure} {
- catch {destroy .s}
+ [.s identify 150 40]
+} -cleanup {
+ deleteWindows
+} -result {{} trough2 trough2 {}}
+test scale-8.7 {ScaleElement procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient horizontal -bd 4 -highlightthickness 2 \
- -length 200 -width 10 -showvalue 0
+ -length 200 -width 10 -showvalue 0
pack .s
.s set 30
update
list [.s identify 30 5] [.s identify 30 6] [.s identify 30 23] \
- [.s identify 30 24]
-} {{} trough1 trough1 {}}
-test scale-8.8 {ScaleElement procedure} {
- catch {destroy .s}
+ [.s identify 30 24]
+} -cleanup {
+ deleteWindows
+} -result {{} trough1 trough1 {}}
+test scale-8.8 {ScaleElement procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
- -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
+ -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
pack .s
.s set 30
update
list [.s identify 2 28] [.s identify 3 28] [.s identify 202 28] \
- [.s identify 203 28]
-} {{} trough1 trough2 {}}
-test scale-8.9 {ScaleElement procedure} {
- catch {destroy .s}
+ [.s identify 203 28]
+} -cleanup {
+ deleteWindows
+} -result {{} trough1 trough2 {}}
+test scale-8.9 {ScaleElement procedure} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
- -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
+ -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
pack .s
.s set 80
update
list [.s identify 145 28] [.s identify 146 28] [.s identify 165 28] \
- [.s identify 166 28]
-} {trough1 slider slider trough2}
+ [.s identify 166 28]
+} -cleanup {
+ deleteWindows
+} -result {trough1 slider slider trough2}
-catch {destroy .s}
-scale .s -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
-pack .s
-update
-test scale-9.1 {PixelToValue procedure} {
+
+#widget used in 9.* tests
+destroy .s
+pack [scale .s]
+test scale-9.1 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get 46 0
-} 0
-test scale-9.2 {PixelToValue procedure} {
+} -result 0
+test scale-9.2 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 9
-} 0
-test scale-9.3 {PixelToValue procedure} {
+} -result 0
+test scale-9.3 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 12
-} 1
-test scale-9.4 {PixelToValue procedure} {
+} -result 1
+test scale-9.4 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 46
-} 35
-test scale-9.5 {PixelToValue procedure} {
+} -result 35
+test scale-9.5 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 110
-} 99
-test scale-9.6 {PixelToValue procedure} {
+} -result 99
+test scale-9.6 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 111
-} 100
-test scale-9.7 {PixelToValue procedure} {
+} -result 100
+test scale-9.7 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 112
-} 100
-test scale-9.8 {PixelToValue procedure} {
+} -result 100
+test scale-9.8 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
+ update
.s get -10 154
-} 100
-.s configure -orient horizontal
-update
-test scale-9.9 {PixelToValue procedure} {
+} -result 100
+test scale-9.9 {PixelToValue procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal
+ update
.s get 76 152
-} 65
+} -result 65
+destroy .s
+
-test scale-10.1 {ValueToPixel procedure} {fonts} {
- catch {destroy .s}
+test scale-10.1 {ValueToPixel procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 0 -to 100 -sliderlength 20 -length 124 -bd 2 \
- -orient horizontal -label Test -tick 20
+ -orient horizontal -label Test -tick 20
pack .s
update
list [.s coords -10] [.s coords 40] [.s coords 1000]
-} {{16 47} {56 47} {116 47}}
-test scale-10.2 {ValueToPixel procedure} {fonts} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {{16 47} {56 47} {116 47}}
+test scale-10.2 {ValueToPixel procedure} -constraints {
+ fonts
+} -setup {
+ deleteWindows
+} -body {
scale .s -from 100 -to 0 -sliderlength 20 -length 122 -bd 1 \
- -orient vertical -label Test -tick 20
+ -orient vertical -label Test -tick 20
pack .s
update
list [.s coords -10] [.s coords 40] [.s coords 1000]
-} {{62 114} {62 74} {62 14}}
+} -cleanup {
+ deleteWindows
+} -result {{62 114} {62 74} {62 14}}
+
-test scale-11.1 {ScaleEventProc procedure} {
+test scale-11.1 {ScaleEventProc procedure} -setup {
+ deleteWindows
+} -body {
proc killScale value {
- global x
- if {$value > 30} {
- destroy .s1
- lappend x [winfo exists .s1] [info commands .s1]
- }
+ global x
+ if {$value > 30} {
+ destroy .s1
+ lappend x [winfo exists .s1] [info commands .s1]
+ }
}
- catch {destroy .s1}
set x initial
scale .s1 -from 0 -to 100 -command killScale
.s1 set 20
@@ -606,60 +1016,74 @@ test scale-11.1 {ScaleEventProc procedure} {
lappend x [winfo exists .s1]
.s1 set 40
update idletasks
+ return $x
+} -cleanup {
rename killScale {}
- set x
-} {initial 1 0 {}}
-test scale-11.2 {ScaleEventProc procedure} {
deleteWindows
+} -result {initial 1 0 {}}
+test scale-11.2 {ScaleEventProc procedure} -setup {
+ deleteWindows
+ set x {}
+} -body {
scale .s1 -bg #543210
rename .s1 .s2
- set x {}
lappend x [winfo children .]
lappend x [.s2 cget -bg]
destroy .s1
lappend x [info command .s*] [winfo children .]
-} {.s1 #543210 {} {}}
+} -cleanup {
+ deleteWindows
+} -result {.s1 #543210 {} {}}
-test scale-12.1 {ScaleCmdDeletedProc procedure} {
+test scale-12.1 {ScaleCmdDeletedProc procedure} -setup {
deleteWindows
+} -body {
scale .s1
rename .s1 {}
list [info command .s*] [winfo children .]
-} {{} {}}
+} -cleanup {
+ deleteWindows
+} -result {{} {}}
-catch {destroy .s}
-scale .s -from 0 -to 100 -command {set x} -variable y
-pack .s
+
+# Widget used in 13.* tests
+destroy .s
+pack [scale .s]
update
-proc varTrace args {
- global traceInfo
- set traceInfo $args
-}
-test scale-13.1 {SetScaleValue procedure} {
+test scale-13.1 {SetScaleValue procedure} -body {
+ .s configure -from 0 -to 100 -command {set x} -variable y
+ update
set x xyzzy
.s set 44
set result [list $x $y]
update
lappend result $x $y
-} {xyzzy 44 44 44}
-test scale-13.2 {SetScaleValue procedure} {
+} -result {xyzzy 44 44 44}
+test scale-13.2 {SetScaleValue procedure} -body {
.s set -3
.s get
-} 0
-test scale-13.3 {SetScaleValue procedure} {
+} -result 0
+test scale-13.3 {SetScaleValue procedure} -body {
.s set 105
.s get
-} 100
+} -result 100
.s configure -from 100 -to 0
-test scale-13.4 {SetScaleValue procedure} {
+test scale-13.4 {SetScaleValue procedure} -body {
.s set -3
.s get
-} 0
-test scale-13.5 {SetScaleValue procedure} {
+} -result 0
+test scale-13.5 {SetScaleValue procedure} -body {
.s set 105
.s get
-} 100
-test scale-13.6 {SetScaleValue procedure} {
+} -result 100
+test scale-13.6 {SetScaleValue procedure} -body {
+ proc varTrace args {
+ global traceInfo
+ set traceInfo $args
+ }
+ .s configure -from 0 -to 100 -command {set x} -variable y
+ update
+
.s set 50
update
trace variable y w varTrace
@@ -668,127 +1092,201 @@ test scale-13.6 {SetScaleValue procedure} {
.s set 50
update
list $x $traceInfo
-} {untouched empty}
+} -result {untouched empty}
-catch {destroy .s}
-scale .s -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 -orient horizontal
-pack .s
-update
-.s configure -resolution 4.0
+
+# Widget used in 14.* tests
+destroy .s
+pack [scale .s]
update
-test scale-14.1 {RoundToResolution procedure} {
+test scale-14.1 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 84 152
-} 72
-test scale-14.2 {RoundToResolution procedure} {
+} -result 72
+test scale-14.2 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 86 152
-} 76
-.s configure -from 100 -to 0
-update
-test scale-14.3 {RoundToResolution procedure} {
+} -result 76
+
+test scale-14.3 {RoundToResolution procedure} -body {
+ .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 84 152
-} 28
-test scale-14.4 {RoundToResolution procedure} {
+} -result 28
+test scale-14.4 {RoundToResolution procedure} -body {
+ .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 86 152
-} 24
-.s configure -from -100 -to 0
-update
-test scale-14.5 {RoundToResolution procedure} {
+} -result 24
+
+test scale-14.5 {RoundToResolution procedure} -body {
+ .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 84 152
-} -28
-test scale-14.6 {RoundToResolution procedure} {
+} -result {-28}
+test scale-14.6 {RoundToResolution procedure} -body {
+ .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 86 152
-} -24
-.s configure -from 0 -to -100
-update
-test scale-14.7 {RoundToResolution procedure} {
+} -result {-24}
+
+test scale-14.7 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 84 152
-} -72
-test scale-14.8 {RoundToResolution procedure} {
+} -result {-72}
+test scale-14.8 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 4.0
+ update
.s get 86 152
-} -76
-.s configure -from 0 -to 2.25 -resolution 0
-update
-test scale-14.9 {RoundToResolution procedure} {
+} -result {-76}
+
+test scale-14.9 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 0
+ update
.s get 84 152
-} 1.64
-test scale-14.10 {RoundToResolution procedure} {
+} -result {1.64}
+test scale-14.10 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 2.25 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 0
+ update
.s get 86 152
-} 1.69
-.s configure -from 0 -to 225 -resolution 0 -digits 5
-update
-test scale-14.11 {RoundToResolution procedure} {
+} -result {1.69}
+
+test scale-14.11 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 0 -digits 5
+ update
.s get 84 152
-} 164.25
-test scale-14.12 {RoundToResolution procedure} {
+} -result {164.25}
+test scale-14.12 {RoundToResolution procedure} -body {
+ .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
+ -orient horizontal -resolution 0 -digits 5
+ update
.s get 86 152
-} 168.75
+} -result {168.75}
+destroy .s
-test scale-15.1 {ScaleVarProc procedure} {
- catch {destroy .s}
+
+test scale-15.1 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
set y -130
scale .s -from 0 -to -200 -variable y -orient horizontal -length 150
pack .s
- set y
-} -130
-test scale-15.2 {ScaleVarProc procedure} {
- catch {destroy .s}
+ return $y
+} -result {-130}
+test scale-15.2 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
set y -130
scale .s -from -200 -to 0 -variable y -orient horizontal -length 150
pack .s
set y -87
.s get
-} -87
-test scale-15.3 {ScaleVarProc procedure} {
- catch {destroy .s}
+} -result {-87}
+test scale-15.3 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
set y -130
scale .s -from -200 -to 0 -variable y -orient horizontal -length 150
pack .s
- list [catch {set y 40q} msg] $msg [.s get]
-} {1 {can't set "y": can't assign non-numeric value to scale variable} -130}
-test scale-15.4 {ScaleVarProc procedure} {
- catch {destroy .s}
+ set y 40q
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't set "y": can't assign non-numeric value to scale variable}
+test scale-15.4 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
+ set y -130
+ scale .s -from -200 -to 0 -variable y -orient horizontal -length 150
+ pack .s
+ catch {set y 40q}
+ .s get
+} -cleanup {
+ deleteWindows
+} -result {-130}
+test scale-15.5 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
+ set y 1
+ scale .s -from 1 -to 0 -variable y -orient horizontal -length 150
+ pack .s
+ set y x
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't set "y": can't assign non-numeric value to scale variable}
+test scale-15.6 {ScaleVarProc procedure} -setup {
+ deleteWindows
+} -body {
set y 1
scale .s -from 1 -to 0 -variable y -orient horizontal -length 150
pack .s
- list [catch {set y x} msg] $msg [.s get]
-} {1 {can't set "y": can't assign non-numeric value to scale variable} 1}
-test scale-15.5 {ScaleVarProc procedure, variable deleted} {
- catch {destroy .s}
+ catch {set y x}
+ .s get
+} -cleanup {
+ deleteWindows
+} -result 1
+test scale-15.7 {ScaleVarProc procedure, variable deleted} -setup {
+ deleteWindows
+} -body {
set y 6
scale .s -from 10 -to 0 -variable y -orient horizontal -length 150 \
- -command "set x"
+ -command "set x"
pack .s
update
set x untouched
unset y
update
list [catch {set y} msg] $msg [.s get] $x
-} {0 6 6 untouched}
-test scale-15.6 {ScaleVarProc procedure, don't call -command} {
- catch {destroy .s}
+} -cleanup {
+ deleteWindows
+} -result {0 6 6 untouched}
+test scale-15.8 {ScaleVarProc procedure, don't call -command} -setup {
+ deleteWindows
+} -body {
set y 6
scale .s -from 0 -to 100 -variable y -orient horizontal -length 150 \
- -command "set x"
+ -command "set x"
pack .s
update
set x untouched
set y 60
update
list $x [.s get]
-} {untouched 60}
+} -cleanup {
+ deleteWindows
+} -result {untouched 60}
-set l [interp hidden]
-deleteWindows
-test scale-16.1 {scale widget vs hidden commands} {
- catch {destroy .s}
+test scale-16.1 {scale widget vs hidden commands} -body {
+ set l [interp hidden]
+ deleteWindows
scale .s
interp hide {} .s
destroy .s
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 eq $res2}
+} -cleanup {
+ deleteWindows
+} -result 1
+
-test scale-17.1 {bug fix 1786} {
+test scale-17.1 {bug fix 1786} -setup {
+ deleteWindows
+} -body {
# Perhaps x is set to {}, depending on what other tests have run.
# If x is unset, or set to something not convertable to a double,
# then the scale try to initialize its value with the contents
@@ -803,66 +1301,62 @@ test scale-17.1 {bug fix 1786} {
# Bug 4833 changed the result to realize that x should pick up
# a value from the scale. In an FPE occurs, it is due to the
# lack of errno being set to 0 by some libc's. (see bug 4942)
- set x
-} {100}
+ return $x
+} -cleanup {
+ deleteWindows
+} -result {100}
+
-test scale-18.1 {DestroyScale, -cursor option [Bug: 3897]} {
- catch {destroy .s}
+test scale-18.1 {DestroyScale, -cursor option [Bug: 3897]} -setup {
+ deleteWindows
+} -body {
scale .s -cursor trek
destroy .s
-} {}
-
-test scale-18.2 {Scale button 1 events [Bug 787065]} \
- -setup {
- catch {destroy .s}
- set y 5
- scale .s -from 0 -to 10 -variable y -orient horizontal -length 150
- pack .s
- tkwait visibility .s
- set ::error {}
- proc bgerror {args} {set ::error $args}
- } \
- -body {
- list [catch {
- event generate .s <1> -x 0 -y 0
- event generate .s <ButtonRelease-1> -x 0 -y 0
- update
- set ::error
- } msg] $msg
- } \
- -cleanup {
- unset ::error
- rename bgerror {}
- catch {destroy .s}
- } \
- -result {0 {}}
-
-test scale-18.3 {Scale button 2 events [Bug 787065]} \
- -setup {
- catch {destroy .s}
- set y 5
- scale .s -from 0 -to 10 -variable y -orient horizontal -length 150
- pack .s
- tkwait visibility .s
- set ::error {}
- proc bgerror {args} {set ::error $args}
- } \
- -body {
- list [catch {
- event generate .s <2> -x 0 -y 0
- event generate .s <ButtonRelease-2> -x 0 -y 0
- update
- set ::error
- } msg] $msg
- } \
- -cleanup {
- unset ::error
- rename bgerror {}
- catch {destroy .s}
- } \
- -result {0 {}}
-
-catch {destroy .s}
+} -result {}
+
+test scale-18.2 {Scale button 1 events [Bug 787065]} -setup {
+ destroy .s
+ set ::error {}
+ proc bgerror {args} {set ::error $args}
+} -body {
+ set y 5
+ scale .s -from 0 -to 10 -variable y -orient horizontal -length 150
+ pack .s
+ tkwait visibility .s
+ list [catch {
+ event generate .s <1> -x 0 -y 0
+ event generate .s <ButtonRelease-1> -x 0 -y 0
+ update
+ set ::error
+ } msg] $msg
+} -cleanup {
+ unset ::error
+ rename bgerror {}
+ destroy .s
+} -result {0 {}}
+
+test scale-18.3 {Scale button 2 events [Bug 787065]} -setup {
+ destroy .s
+ set ::error {}
+ proc bgerror {args} {set ::error $args}
+} -body {
+ set y 5
+ scale .s -from 0 -to 10 -variable y -orient horizontal -length 150
+ pack .s
+ tkwait visibility .s
+ list [catch {
+ event generate .s <2> -x 0 -y 0
+ event generate .s <ButtonRelease-2> -x 0 -y 0
+ update
+ set ::error
+ } msg] $msg
+} -cleanup {
+ unset ::error
+ rename bgerror {}
+ destroy .s
+} -result {0 {}}
+
+
option clear
# cleanup
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 5d4334f..3addd28 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -57,7 +57,7 @@ foreach test {
{-activebackground #ff0000 #ff0000 non-existent
{unknown color name "non-existent"}}
{-activerelief sunken sunken non-existent
- {bad relief type "non-existent": must be flat, groove, raised, ridge, solid, or sunken}}
+ {bad relief "non-existent": must be flat, groove, raised, ridge, solid, or sunken}}
{-background #ff0000 #ff0000 non-existent
{unknown color name "non-existent"}}
{-bd 4 4 badValue {bad screen distance "badValue"}}
@@ -75,7 +75,7 @@ foreach test {
{-orient horizontal horizontal badValue
{bad orientation "badValue": must be vertical or horizontal}}
{-orient horizontal horizontal bogus {bad orientation "bogus": must be vertical or horizontal}}
- {-relief ridge ridge badValue {bad relief type "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
{-repeatdelay 140 140 129.3 {expected integer but got "129.3"}}
{-repeatinterval 140 140 129.3 {expected integer but got "129.3"}}
{-takefocus "any string" "any string" {} {}}
@@ -99,7 +99,7 @@ foreach test {
destroy .s
test scrollbar-2.1 {Tk_ScrollbarCmd procedure} -returnCodes error -body {
scrollbar
-} -result {wrong # args: should be "scrollbar pathName ?options?"}
+} -result {wrong # args: should be "scrollbar pathName ?-option value ...?"}
test scrollbar-2.2 {Tk_ScrollbarCmd procedure} -body {
scrollbar gorp
} -returnCodes error -result {bad window path name "gorp"}
@@ -127,7 +127,7 @@ pack .s -side right -fill y
update
test scrollbar-3.1 {ScrollbarWidgetCmd procedure} {
list [catch {.s} msg] $msg
-} {1 {wrong # args: should be ".s option ?arg arg ...?"}}
+} {1 {wrong # args: should be ".s option ?arg ...?"}}
test scrollbar-3.2 {ScrollbarWidgetCmd procedure, "cget" option} {
list [catch {.s cget} msg] $msg
} {1 {wrong # args: should be ".s cget option"}}
diff --git a/tests/select.test b/tests/select.test
index 8cbfd39..e4c512d 100644
--- a/tests/select.test
+++ b/tests/select.test
@@ -1,6 +1,6 @@
# This file is a Tcl script to test out Tk's selection management code,
-# especially the "selection" command. It is organized in the standard
-# fashion for Tcl tests.
+# especially the "selection" command. It is organized in the standard fashion
+# for Tcl tests.
#
# Copyright (c) 1994 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
@@ -11,12 +11,12 @@
# environment variable TK_ALT_DISPLAY is set to an alternate display.
#
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
+namespace import ::tk::test:loadTkCommand
eval tcltest::configure $argv
tcltest::loadTestedCommands
-namespace import -force ::tk::test:loadTkCommand
-
global longValue selValue selInfo
set selValue {}
@@ -109,48 +109,55 @@ 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} {
}
# Now we start the main body of the test code
-
-test select-1.1 {Tk_CreateSelHandler procedure} {
+
+test select-1.1 {Tk_CreateSelHandler procedure} -setup {
setup
+} -body {
lsort [selection get TARGETS]
-} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}
-test select-1.2 {Tk_CreateSelHandler procedure} {
+} -result {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}
+test select-1.2 {Tk_CreateSelHandler procedure} -setup {
setup
+} -body {
selection handle .f1 {handler TEST} TEST
lsort [selection get TARGETS]
-} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
-test select-1.3 {Tk_CreateSelHandler procedure} {
+} -result {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
+test select-1.3 {Tk_CreateSelHandler procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler TEST} TEST
set selValue "Test value"
set selInfo ""
list [selection get TEST] $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-1.4.1 {Tk_CreateSelHandler procedure} unix {
+} -result {{Test value} {TEST 0 4000}}
+test select-1.4.1 {Tk_CreateSelHandler procedure} -constraints unix -setup {
setup
+} -body {
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} win {
+} -result {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}
+test select-1.4.2 {Tk_CreateSelHandler procedure} -constraints win -setup {
setup
+} -body {
selection handle .f1 {handler TEST} TEST
selection handle .f1 {handler STRING}
lsort [selection get TARGETS]
-} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
-test select-1.5 {Tk_CreateSelHandler procedure} {
+} -result {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
+test select-1.5 {Tk_CreateSelHandler procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler TEST} TEST
selection handle .f1 {handler STRING}
set selValue ""
set selInfo ""
list [selection get] $selInfo
-} {{} {STRING 0 4000}}
-test select-1.6.1 {Tk_CreateSelHandler procedure} unix {
+} -result {{} {STRING 0 4000}}
+test select-1.6.1 {Tk_CreateSelHandler procedure} -constraints unix -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler TEST} TEST
selection handle .f1 {handler STRING}
set selValue ""
@@ -159,11 +166,12 @@ test select-1.6.1 {Tk_CreateSelHandler procedure} unix {
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} win {
+ list $selInfo [lsort [selection get TARGETS]]
+} -result {{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} -constraints win -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler TEST} TEST
selection handle .f1 {handler STRING}
set selValue ""
@@ -172,141 +180,157 @@ test select-1.6.2 {Tk_CreateSelHandler procedure} win {
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}}
-test select-1.7.1 {Tk_CreateSelHandler procedure} unix {
+ list $selInfo [lsort [selection get TARGETS]]
+} -result {{STRING 0 4000 TEST 0 4000 TEST2 0 4000} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-1.7.1 {Tk_CreateSelHandler procedure} -constraints unix -setup {
setup
+} -body {
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} win {
+} -result {{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} -constraints win -setup {
setup
+} -body {
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} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-1.8 {Tk_CreateSelHandler procedure} {
+} -result {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-1.8 {Tk_CreateSelHandler procedure} -setup {
setup
+} -body {
selection handle -format INTEGER -type TEST .f1 {handler TEST}
lsort [selection get TARGETS]
-} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
+} -result {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}
##############################################################################
-test select-2.1 {Tk_DeleteSelHandler procedure} unix {
+test select-2.1 {Tk_DeleteSelHandler procedure} -constraints unix -setup {
setup
+} -body {
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} unix {
+} -result {{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} -constraints unix -setup {
setup
+} -body {
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} unix {
+} -result {{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} -constraints unix -setup {
setup
+} -body {
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} win {
+} -result {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-2.4 {Tk_DeleteSelHandler procedure} -constraints win -setup {
setup
+} -body {
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} {MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW USER}}
-test select-2.5 {Tk_DeleteSelHandler procedure} win {
+} -result {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER} {MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW USER}}
+test select-2.5 {Tk_DeleteSelHandler procedure} -constraints win -setup {
setup
+} -body {
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} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-2.6 {Tk_DeleteSelHandler procedure} win {
+} -result {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-2.6 {Tk_DeleteSelHandler procedure} -constraints win -setup {
setup
+} -body {
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} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-2.7 {Tk_DeleteSelHandler procedure} {
+} -result {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-2.7 {Tk_DeleteSelHandler procedure} -setup {
setup
+} -body {
selection handle .f1 {handler STRING}
list [selection handle .f1 {}] [selection handle .f1 {}]
-} {{} {}}
+} -result {{} {}}
##############################################################################
-test select-3.1 {Tk_OwnSelection procedure} {
+test select-3.1 {Tk_OwnSelection procedure} -setup {
setup
+} -body {
selection own
-} {.f1}
-test select-3.2 {Tk_OwnSelection procedure} {
+} -result {.f1}
+test select-3.2 {Tk_OwnSelection procedure} -body {
setup .f1
set result [selection own]
setup .f2
lappend result [selection own]
-} {.f1 .f2}
-test select-3.3 {Tk_OwnSelection procedure} {
+} -result {.f1 .f2}
+test select-3.3 {Tk_OwnSelection procedure} -setup {
setup .f1
setup .f2
+} -body {
selection own -selection CLIPBOARD .f1
list [selection own] [selection own -selection CLIPBOARD]
-} {.f2 .f1}
-test select-3.4 {Tk_OwnSelection procedure} {
+} -result {.f2 .f1}
+test select-3.4 {Tk_OwnSelection procedure} -setup {
global lostSel
setup
+} -body {
set lostSel {owned}
selection own -command { set lostSel {lost} } .f1
selection clear .f1
set lostSel
-} {lost}
-test select-3.5 {Tk_OwnSelection procedure} {
+} -result {lost}
+test select-3.5 {Tk_OwnSelection procedure} -setup {
global lostSel
setup .f1
setup .f2
+} -body {
set lostSel {owned}
selection own -command { set lostSel {lost1} } .f1
selection own -command { set lostSel {lost2} } .f2
list $lostSel [selection own]
-} {lost1 .f2}
-test select-3.6 {Tk_OwnSelection procedure} {
+} -result {lost1 .f2}
+test select-3.6 {Tk_OwnSelection procedure} -setup {
global lostSel
setup
+} -body {
set lostSel {owned}
selection own -command { set lostSel {lost1} } .f1
selection own -command { set lostSel {lost2} } .f1
set result $lostSel
selection clear .f1
lappend result $lostSel
-} {owned lost2}
-test select-3.7 {Tk_OwnSelection procedure} unix {
+} -result {owned lost2}
+test select-3.7 {Tk_OwnSelection procedure} -constraints unix -setup {
global lostSel
setup
setupbg
+} -body {
set lostSel {owned}
selection own -command { set lostSel {lost1} } .f1
update
@@ -316,60 +340,71 @@ test select-3.7 {Tk_OwnSelection procedure} unix {
update
cleanupbg
lappend result $lostSel
-} {{} . lost1}
+} -result {{} . lost1}
# check reentrancy on selection replacement
-test select-3.8 {Tk_OwnSelection procedure} {
+test select-3.8 {Tk_OwnSelection procedure} -setup {
setup
+} -body {
selection own -selection CLIPBOARD -command { destroy .f1 } .f1
selection own -selection CLIPBOARD .
-} {}
-test select-3.9 {Tk_OwnSelection procedure} {
+} -result {}
+test select-3.9 {Tk_OwnSelection procedure} -setup {
setup .f2
setup .f1
+} -body {
selection own -selection CLIPBOARD -command { destroy .f2 } .f1
selection own -selection CLIPBOARD .f2
-} {}
+} -result {}
# multiple display tests
-test select-3.10 {Tk_OwnSelection procedure} {altDisplay} {
+test select-3.10 {Tk_OwnSelection procedure} -constraints {
+ altDisplay
+} -body {
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} {
+} -result {.f1 .f2}
+test select-3.11 {Tk_OwnSelection procedure} -constraints {
+ altDisplay
+} -setup {
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
setupbg
update
set result ""
+} -body {
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]
+} -cleanup {
cleanupbg
- set result
-} {{} .f1 {}}
+} -result {{} .f1 {}}
##############################################################################
-test select-4.1 {Tk_ClearSelection procedure} {
+test select-4.1 {Tk_ClearSelection procedure} -setup {
setup
+} -body {
set result [selection own]
selection clear .f1
lappend result [selection own]
-} {.f1 {}}
-test select-4.2 {Tk_ClearSelection procedure} {
+} -result {.f1 {}}
+test select-4.2 {Tk_ClearSelection procedure} -setup {
setup
+} -body {
selection own -selection CLIPBOARD .f1
selection clear .f1
selection own -selection CLIPBOARD
-} {.f1}
-test select-4.3 {Tk_ClearSelection procedure} {
+} -result {.f1}
+test select-4.3 {Tk_ClearSelection procedure} -setup {
setup
+} -body {
list [selection clear .f1] [selection clear .f1]
-} {{} {}}
-test select-4.4 {Tk_ClearSelection procedure} unix {
+} -result {{} {}}
+test select-4.4 {Tk_ClearSelection procedure} -constraints unix -setup {
global lostSel
setup
setupbg
+} -body {
set lostSel {owned}
selection own -command { set lostSel {lost1} } .f1
update
@@ -378,12 +413,15 @@ test select-4.4 {Tk_ClearSelection procedure} unix {
update
cleanupbg
lappend result [selection own]
-} {{} {}}
+} -result {{} {}}
# multiple display tests
-test select-4.5 {Tk_ClearSelection procedure} {altDisplay} {
+test select-4.5 {Tk_ClearSelection procedure} -constraints {
+ altDisplay
+} -setup {
global lostSel lostSel2
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
+} -body {
set lostSel {owned}
set lostSel2 {owned2}
selection own -command { set lostSel {lost1} } .f1
@@ -392,11 +430,14 @@ test select-4.5 {Tk_ClearSelection procedure} {altDisplay} {
selection clear -displayof .f2
update
list $lostSel $lostSel2
-} {owned lost2}
-test select-4.6 {Tk_ClearSelection procedure} {unix altDisplay} {
+} -result {owned lost2}
+test select-4.6 {Tk_ClearSelection procedure} -constraints {
+ unix altDisplay
+} -setup {
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
setupbg
+} -body {
set lostSel {owned}
set lostSel2 {owned2}
selection own -command { set lostSel {lost1} } .f1
@@ -408,73 +449,79 @@ test select-4.6 {Tk_ClearSelection procedure} {unix altDisplay} {
[selection own -displayof .f2] $lostSel $lostSel2
cleanupbg
set result
-} {{} .f1 {} owned lost2}
+} -result {{} .f1 {} owned lost2}
##############################################################################
-test select-5.1 {Tk_GetSelection procedure} {
+test select-5.1 {Tk_GetSelection procedure} -returnCodes error -setup {
setup
- list [catch {selection get TEST} msg] $msg
-} {1 {PRIMARY selection doesn't exist or form "TEST" not defined}}
-test select-5.2 {Tk_GetSelection procedure} {
+} -body {
+ selection get TEST
+} -result {PRIMARY selection doesn't exist or form "TEST" not defined}
+test select-5.2 {Tk_GetSelection procedure} -setup {
setup
+} -body {
selection get TK_WINDOW
-} {.f1}
-test select-5.3 {Tk_GetSelection procedure} {
+} -result {.f1}
+test select-5.3 {Tk_GetSelection procedure} -setup {
setup
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
set selValue "Test value"
set selInfo ""
list [selection get TEST] $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-5.4 {Tk_GetSelection procedure} {
+} -result {{Test value} {TEST 0 4000}}
+test select-5.4 {Tk_GetSelection procedure} -setup {
setup
+} -returnCodes error -body {
selection handle .f1 ERROR errHandler
- list [catch {selection get ERROR} msg] $msg
-} {1 {PRIMARY selection doesn't exist or form "ERROR" not defined}}
-test select-5.5 {Tk_GetSelection procedure} {
+ selection get ERROR
+} -result {PRIMARY selection doesn't exist or form "ERROR" not defined}
+test select-5.5 {Tk_GetSelection procedure} -setup {
setup
+} -body {
set selValue $longValue
set selInfo ""
selection handle .f1 {handler STRING}
list [selection get] $selInfo
-} "$longValue {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000}"
-test select-5.6 {Tk_GetSelection procedure} {
- proc weirdHandler {type offset count} {
- selection handle .f1 {}
- handler $type $offset $count
- }
+} -result "$longValue {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000}"
+test select-5.6 {Tk_GetSelection procedure} -setup {
setup
+} -returnCodes error -body {
set selValue $longValue
set selInfo ""
- selection handle .f1 {weirdHandler STRING}
- list [catch {selection get} msg] $msg
-} {1 {PRIMARY selection doesn't exist or form "STRING" not defined}}
-test select-5.7 {Tk_GetSelection procedure} {
- proc weirdHandler {type offset count} {
- destroy .f1
+ selection handle .f1 {apply {{type offset count} {
+ selection handle .f1 {}
handler $type $offset $count
- }
+ }} STRING}
+ selection get
+} -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test select-5.7 {Tk_GetSelection procedure} -setup {
setup
+} -returnCodes error -body {
set selValue "Test Value"
set selInfo ""
- selection handle .f1 {weirdHandler STRING}
- list [catch {selection get} msg] $msg
-} {1 {PRIMARY selection doesn't exist or form "STRING" not defined}}
-test select-5.8 {Tk_GetSelection procedure} {
- proc weirdHandler {type offset count} {
- selection clear
+ selection handle .f1 {apply {{type offset count} {
+ destroy .f1
handler $type $offset $count
- }
+ }} STRING}
+ selection get
+} -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test select-5.8 {Tk_GetSelection procedure} -setup {
setup
+} -body {
set selValue $longValue
set selInfo ""
- selection handle .f1 {weirdHandler STRING}
+ selection handle .f1 {apply {{type offset count} {
+ selection clear
+ handler $type $offset $count
+ }} STRING}
list [selection get] $selInfo [catch {selection get} msg] $msg
-} "$longValue {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000} 1 {PRIMARY selection doesn't exist or form \"STRING\" not defined}"
-test select-5.9 {Tk_GetSelection procedure} unix {
+} -result "$longValue {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000} 1 {PRIMARY selection doesn't exist or form \"STRING\" not defined}"
+test select-5.9 {Tk_GetSelection procedure} -constraints unix -setup {
setup
setupbg
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
update
set selValue "Test value"
@@ -483,10 +530,11 @@ test select-5.9 {Tk_GetSelection procedure} unix {
lappend result [dobg {selection get TEST}]
cleanupbg
lappend result $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-5.10 {Tk_GetSelection procedure} unix {
+} -result {{Test value} {TEST 0 4000}}
+test select-5.10 {Tk_GetSelection procedure} -constraints unix -setup {
setup
setupbg
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
update
set selValue "Test value"
@@ -496,11 +544,14 @@ test select-5.10 {Tk_GetSelection procedure} unix {
lappend result [dobg {selection get TEST} 1]
cleanupbg
lappend result $selInfo
-} {{selection owner didn't respond} {}}
+} -result {{selection owner didn't respond} {}}
# multiple display tests
-test select-5.11 {Tk_GetSelection procedure} {altDisplay} {
+test select-5.11 {Tk_GetSelection procedure} -constraints {
+ altDisplay
+} -setup {
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
selection handle -selection PRIMARY .f2 {handler TEST2} TEST
set selValue "Test value"
@@ -509,11 +560,14 @@ test select-5.11 {Tk_GetSelection procedure} {altDisplay} {
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} {
+} -result {{Test value} {TEST 0 4000} {Test value2} {TEST2 0 4000}}
+test select-5.12 {Tk_GetSelection procedure} -constraints {
+ altDisplay
+} -setup {
global lostSel lostSel2
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
selection handle -selection PRIMARY .f2 {} TEST
set selValue "Test value"
@@ -523,11 +577,14 @@ test select-5.12 {Tk_GetSelection procedure} {altDisplay} {
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} {unix altDisplay} {
+} -result {0 {Test value} {TEST 0 4000} 1 {PRIMARY selection doesn't exist or form "TEST" not defined} {}}
+test select-5.13 {Tk_GetSelection procedure} -constraints {
+ unix altDisplay
+} -setup {
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
setupbg
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
selection own .f1
selection handle -selection PRIMARY .f2 {handler TEST2} TEST
@@ -541,11 +598,14 @@ test select-5.13 {Tk_GetSelection procedure} {unix altDisplay} {
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} {unix altDisplay} {
+} -result {{Test value} {Test value2} {TEST2 0 4000 TEST 0 4000}}
+test select-5.14 {Tk_GetSelection procedure} -constraints {
+ unix altDisplay
+} -setup {
setup .f1
setup .f2 $env(TK_ALT_DISPLAY)
setupbg
+} -body {
selection handle -selection PRIMARY .f1 {handler TEST} TEST
selection own .f1
selection handle -selection PRIMARY .f2 {} TEST
@@ -559,215 +619,244 @@ test select-5.14 {Tk_GetSelection procedure} {unix altDisplay} {
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}}
+} -result {{PRIMARY selection doesn't exist or form "TEST" not defined} {Test value2} {TEST 0 4000}}
+test select-5.15 {Tk_GetSelection procedure} -setup {
+ setup
+ if {[llength [info command ::bgerror]]} {
+ rename ::bgerror ::TMPbgerror
+ }
+ set ::bgerrors {}
+} -body {
+ proc ::bgerror msg {lappend ::bgerrors $msg}
+ selection handle .f1 ERROR errHandler
+ list [catch {selection get ERROR} msg] $msg [update] {*}$::bgerrors
+} -cleanup {
+ rename ::bgerror {}
+ if {[llength [info command ::TMPbgerror]]} {
+ rename ::TMPbgerror ::bgerror
+ }
+} -result {1 {PRIMARY selection doesn't exist or form "ERROR" not defined} {} {selection handler aborted}}
##############################################################################
-test select-6.1 {Tk_SelectionCmd procedure} {
- list [catch {selection} cmd] $cmd
-} {1 {wrong # args: should be "selection option ?arg arg ...?"}}
+test select-6.1 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection
+} -result {wrong # args: should be "selection option ?arg ...?"}
# selection clear
-test select-6.2 {Tk_SelectionCmd procedure} {
- list [catch {selection clear -selection} cmd] $cmd
-} {1 {value for "-selection" missing}}
-test select-6.3 {Tk_SelectionCmd procedure} {
+test select-6.2 {Tk_SelectionCmd procedure} -body {
+ selection clear -selection
+} -returnCodes error -result {value for "-selection" missing}
+test select-6.3 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own .
set result [selection own]
selection clear -displayof .f1
lappend result [selection own]
-} {. {}}
-test select-6.4 {Tk_SelectionCmd procedure} {
+} -result {. {}}
+test select-6.4 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own -selection CLIPBOARD .f1
set result [list [selection own] [selection own -selection CLIPBOARD]]
selection clear -selection CLIPBOARD .f1
lappend result [selection own] [selection own -selection CLIPBOARD]
-} {.f1 .f1 .f1 {}}
-test select-6.5 {Tk_SelectionCmd procedure} {
+} -result {.f1 .f1 .f1 {}}
+test select-6.5 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own -selection CLIPBOARD .
set result [list [selection own] [selection own -selection CLIPBOARD]]
selection clear -selection CLIPBOARD -displayof .f1
lappend result [selection own] [selection own -selection CLIPBOARD]
-} {.f1 . .f1 {}}
-test select-6.6 {Tk_SelectionCmd procedure} {
- list [catch {selection clear -badopt foo} cmd] $cmd
-} {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 {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
-} {1 {bad window path name ".f2"}}
-test select-6.9 {Tk_SelectionCmd procedure} {
- catch {destroy .f2}
- list [catch {selection clear .f2} cmd] $cmd
-} {1 {bad window path name ".f2"}}
-test select-6.10 {Tk_SelectionCmd procedure} {
+} -result {.f1 . .f1 {}}
+test select-6.6 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection clear -badopt foo
+} -result {bad option "-badopt": must be -displayof or -selection}
+test select-6.7 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection clear -selectionfoo foo
+} -result {bad option "-selectionfoo": must be -displayof or -selection}
+test select-6.8 {Tk_SelectionCmd procedure} -body {
+ destroy .f2
+ selection clear -displayof .f2
+} -returnCodes error -result {bad window path name ".f2"}
+test select-6.9 {Tk_SelectionCmd procedure} -body {
+ destroy .f2
+ selection clear .f2
+} -returnCodes error -result {bad window path name ".f2"}
+test select-6.10 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
set result [selection own -selection PRIMARY]
selection clear
lappend result [selection own -selection PRIMARY]
-} {.f1 {}}
-test select-6.11 {Tk_SelectionCmd procedure} {
+} -result {.f1 {}}
+test select-6.11 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own -selection CLIPBOARD .f1
set result [selection own -selection CLIPBOARD]
selection clear -selection CLIPBOARD
lappend result [selection own -selection CLIPBOARD]
-} {.f1 {}}
-test select-6.12 {Tk_SelectionCmd procedure} {
- list [catch {selection clear foo bar} cmd] $cmd
-} {1 {wrong # args: should be "selection clear ?options?"}}
+} -result {.f1 {}}
+test select-6.12 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection clear foo bar
+} -result {wrong # args: should be "selection clear ?-option value ...?"}
# selection get
-test select-6.13 {Tk_SelectionCmd procedure} {
- list [catch {selection get -selection} cmd] $cmd
-} {1 {value for "-selection" missing}}
-test select-6.14 {Tk_SelectionCmd procedure} {
+test select-6.13 {Tk_SelectionCmd procedure} -body {
+ selection get -selection
+} -returnCodes error -result {value for "-selection" missing}
+test select-6.14 {Tk_SelectionCmd procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler TEST}
set selValue "Test value"
set selInfo ""
list [selection get -displayof .f1] $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-6.15 {Tk_SelectionCmd procedure} {
+} -result {{Test value} {TEST 0 4000}}
+test select-6.15 {Tk_SelectionCmd procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle .f1 {handler STRING}
selection handle -selection CLIPBOARD .f1 {handler TEST}
selection own -selection CLIPBOARD .f1
set selValue "Test value"
set selInfo ""
list [selection get -selection CLIPBOARD] $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-6.16 {Tk_SelectionCmd procedure} {
+} -result {{Test value} {TEST 0 4000}}
+test select-6.16 {Tk_SelectionCmd procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle -type TEST .f1 {handler TEST}
selection handle -type STRING .f1 {handler STRING}
set selValue "Test value"
set selInfo ""
list [selection get -type TEST] $selInfo
-} {{Test value} {TEST 0 4000}}
-test select-6.17 {Tk_SelectionCmd procedure} {
- list [catch {selection get -badopt foo} cmd] $cmd
-} {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 {bad option "-selectionfoo": must be -displayof, -selection, or -type}}
-test select-6.19 {Tk_SelectionCmd procedure} {
+} -result {{Test value} {TEST 0 4000}}
+test select-6.17 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection get -badopt foo
+} -result {bad option "-badopt": must be -displayof, -selection, or -type}
+test select-6.18 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection get -selectionfoo foo
+} -result {bad option "-selectionfoo": must be -displayof, -selection, or -type}
+test select-6.19 {Tk_SelectionCmd procedure} -body {
catch { destroy .f2 }
- list [catch {selection get -displayof .f2} cmd] $cmd
-} {1 {bad window path name ".f2"}}
-test select-6.20 {Tk_SelectionCmd procedure} {
- list [catch {selection get foo bar} cmd] $cmd
-} {1 {wrong # args: should be "selection get ?options?"}}
-test select-6.21 {Tk_SelectionCmd procedure} {
+ selection get -displayof .f2
+} -returnCodes error -result {bad window path name ".f2"}
+test select-6.20 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection get foo bar
+} -result {wrong # args: should be "selection get ?-option value ...?"}
+test select-6.21 {Tk_SelectionCmd procedure} -setup {
global selValue selInfo
setup
+} -body {
selection handle -type TEST .f1 {handler TEST}
selection handle -type STRING .f1 {handler STRING}
set selValue "Test value"
set selInfo ""
list [selection get TEST] $selInfo
-} {{Test value} {TEST 0 4000}}
+} -result {{Test value} {TEST 0 4000}}
# selection handle
# most of the handle section has been covered earlier
-test select-6.22 {Tk_SelectionCmd procedure} {
- list [catch {selection handle -selection} cmd] $cmd
-} {1 {value for "-selection" missing}}
-test select-6.23 {Tk_SelectionCmd procedure} {
+test select-6.22 {Tk_SelectionCmd procedure} -body {
+ selection handle -selection
+} -returnCodes error -result {value for "-selection" missing}
+test select-6.23 {Tk_SelectionCmd procedure} -setup {
global selValue selInfo
setup
+} -body {
set selValue "Test value"
set selInfo ""
list [selection handle -format INTEGER .f1 {handler TEST}] [selection get -displayof .f1] $selInfo
-} {{} {Test value} {TEST 0 4000}}
-test select-6.24 {Tk_SelectionCmd procedure} {
- list [catch {selection handle -badopt foo} cmd] $cmd
-} {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 {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"}}
-test select-6.27 {Tk_SelectionCmd procedure} {
- list [catch {selection handle .} cmd] $cmd
-} {1 {wrong # args: should be "selection handle ?options? window command"}}
-test select-6.28 {Tk_SelectionCmd procedure} {
- list [catch {selection handle . foo bar baz blat} cmd] $cmd
-} {1 {wrong # args: should be "selection handle ?options? window command"}}
-test select-6.29 {Tk_SelectionCmd procedure} {
+} -result {{} {Test value} {TEST 0 4000}}
+test select-6.24 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection handle -badopt foo
+} -result {bad option "-badopt": must be -format, -selection, or -type}
+test select-6.25 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection handle -selectionfoo foo
+} -result {bad option "-selectionfoo": must be -format, -selection, or -type}
+test select-6.26 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection handle
+} -result {wrong # args: should be "selection handle ?-option value ...? window command"}
+test select-6.27 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection handle .
+} -result {wrong # args: should be "selection handle ?-option value ...? window command"}
+test select-6.28 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection handle . foo bar baz blat
+} -result {wrong # args: should be "selection handle ?-option value ...? window command"}
+test select-6.29 {Tk_SelectionCmd procedure} -body {
catch { destroy .f2 }
- list [catch {selection handle .f2 dummy} cmd] $cmd
-} {1 {bad window path name ".f2"}}
+ selection handle .f2 dummy
+} -returnCodes error -result {bad window path name ".f2"}
# selection own
-test select-6.30 {Tk_SelectionCmd procedure} {
- list [catch {selection own -selection} cmd] $cmd
-} {1 {value for "-selection" missing}}
-test select-6.31 {Tk_SelectionCmd procedure} {
+test select-6.30 {Tk_SelectionCmd procedure} -body {
+ selection own -selection
+} -returnCodes error -result {value for "-selection" missing}
+test select-6.31 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own .
selection own -displayof .f1
-} {.}
-test select-6.32 {Tk_SelectionCmd procedure} {
+} -result {.}
+test select-6.32 {Tk_SelectionCmd procedure} -setup {
setup
+} -body {
selection own .
selection own -selection CLIPBOARD .f1
list [selection own] [selection own -selection CLIPBOARD]
-} {. .f1}
-test select-6.33 {Tk_SelectionCmd procedure} {
+} -result {. .f1}
+test select-6.33 {Tk_SelectionCmd procedure} -setup {
global lostSel
setup
+} -body {
set lostSel owned
selection own -command { set lostSel lost } .
selection own -selection CLIPBOARD .f1
set result $lostSel
selection own .f1
lappend result $lostSel
-} {owned lost}
-test select-6.34 {Tk_SelectionCmd procedure} {
- list [catch {selection own -badopt foo} cmd] $cmd
-} {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 {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
-} {1 {bad window path name ".f2"}}
-test select-6.37 {Tk_SelectionCmd procedure} {
- catch {destroy .f2}
- list [catch {selection own .f2} cmd] $cmd
-} {1 {bad window path name ".f2"}}
-test select-6.38 {Tk_SelectionCmd procedure} {
- list [catch {selection own foo bar baz} cmd] $cmd
-} {1 {wrong # args: should be "selection own ?options? ?window?"}}
-test select-6.39 {Tk_SelectionCmd procedure} {
- list [catch {selection foo} cmd] $cmd
-} {1 {bad option "foo": must be clear, get, handle, or own}}
+} -result {owned lost}
+test select-6.34 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection own -badopt foo
+} -result {bad option "-badopt": must be -command, -displayof, or -selection}
+test select-6.35 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection own -selectionfoo foo
+} -result {bad option "-selectionfoo": must be -command, -displayof, or -selection}
+test select-6.36 {Tk_SelectionCmd procedure} -body {
+ destroy .f2
+ selection own -displayof .f2
+} -returnCodes error -result {bad window path name ".f2"}
+test select-6.37 {Tk_SelectionCmd procedure} -body {
+ destroy .f2
+ selection own .f2
+} -returnCodes error -result {bad window path name ".f2"}
+test select-6.38 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection own foo bar baz
+} -result {wrong # args: should be "selection own ?-option value ...? ?window?"}
+test select-6.39 {Tk_SelectionCmd procedure} -returnCodes error -body {
+ selection foo
+} -result {bad option "foo": must be clear, get, handle, or own}
##############################################################################
-# This test is non-portable because some old X11/News servers ignore
-# a selection request when the window doesn't exist, which causes a
-# different error message.
-test select-7.1 {TkSelDeadWindow procedure} nonPortable {
+# This test is non-portable because some old X11/News servers ignore a
+# selection request when the window doesn't exist, which causes a different
+# error message.
+test select-7.1 {TkSelDeadWindow procedure} -constraints nonPortable -setup {
setup
+} -body {
selection handle .f1 { handler TEST }
set result [selection own]
destroy .f1
lappend result [selection own] [catch {selection get} msg] $msg
-} {.f1 {} 1 {PRIMARY selection doesn't exist or form "STRING" not defined}}
+} -result {.f1 {} 1 {PRIMARY selection doesn't exist or form "STRING" not defined}}
##############################################################################
# Check reentrancy on losing selection
-
test select-8.1 {TkSelEventProc procedure} -constraints unix -setup {
setup
setupbg
@@ -788,16 +877,17 @@ test select-9.1 {SelCvtToX and SelCvtFromX procedures} -setup {
set selValue "1024"
set selInfo ""
selection handle -selection PRIMARY -format INTEGER -type TEST \
- .f1 {handler TEST}
+ .f1 {handler TEST}
update
set result ""
lappend result [dobg {selection get TEST}]
cleanupbg
lappend result $selInfo
} -result {{0x400 } {TEST 0 4000}}
-test select-9.2 {SelCvtToX and SelCvtFromX procedures} unix {
+test select-9.2 {SelCvtToX and SelCvtFromX procedures} -setup {
setup
setupbg
+} -constraints unix -body {
set selValue "1024 0xffff 2048 -2 "
set selInfo ""
selection handle -selection PRIMARY -format INTEGER -type TEST \
@@ -806,10 +896,11 @@ test select-9.2 {SelCvtToX and SelCvtFromX procedures} unix {
lappend result [dobg {selection get TEST}]
cleanupbg
lappend result $selInfo
-} {{0x400 0xffff 0x800 0xfffffffe } {TEST 0 4000}}
-test select-9.3 {SelCvtToX and SelCvtFromX procedures} unix {
+} -result {{0x400 0xffff 0x800 0xfffffffe } {TEST 0 4000}}
+test select-9.3 {SelCvtToX and SelCvtFromX procedures} -setup {
setup
setupbg
+} -constraints unix -body {
set selValue " "
set selInfo ""
selection handle -selection PRIMARY -format INTEGER -type TEST \
@@ -818,10 +909,11 @@ test select-9.3 {SelCvtToX and SelCvtFromX procedures} unix {
lappend result [dobg {selection get TEST}]
cleanupbg
lappend result $selInfo
-} {{ } {TEST 0 4000}}
-test select-9.4 {SelCvtToX and SelCvtFromX procedures} unix {
+} -result {{ } {TEST 0 4000}}
+test select-9.4 {SelCvtToX and SelCvtFromX procedures} -setup {
setup
setupbg
+} -constraints unix -body {
set selValue "16 foobar 32"
set selInfo ""
selection handle -selection PRIMARY -format INTEGER -type TEST \
@@ -830,7 +922,7 @@ test select-9.4 {SelCvtToX and SelCvtFromX procedures} unix {
lappend result [dobg {selection get TEST}]
cleanupbg
lappend result $selInfo
-} {{0x10 0x0 0x20 } {TEST 0 4000}}
+} -result {{0x10 0x0 0x20 } {TEST 0 4000}}
test select-9.5 {SelCvtToX and SelCvtFromX procedures} -setup {
setup
setupbg
@@ -841,19 +933,21 @@ test select-9.5 {SelCvtToX and SelCvtFromX procedures} -setup {
set selInfo ""
set selType {text/x-tk-test;detail="foo bar"}
selection handle -selection PRIMARY -format STRING -type $selType \
- .f1 [list handler $selType]
+ .f1 [list handler $selType]
lsort [dobg {selection get TARGETS}]
} -cleanup {
cleanupbg
} -result {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW {text/x-tk-test;detail="foo bar"}}
##############################################################################
-
# note, we are not testing MULTIPLE style selections
# most control paths have been exercised above
-test select-10.1 {ConvertSelection procedure, race with selection clear} unix {
+test select-10.1 {ConvertSelection procedure, race with selection clear} -constraints {
+ unix
+} -setup {
setup
+} -body {
proc Ready {fd} {
variable x
lappend x [gets $fd]
@@ -867,7 +961,7 @@ test select-10.1 {ConvertSelection procedure, race with selection clear} unix {
set selInfo ""
selection handle .f1 {handler STRING}
update
- puts $fd {puts "[catch {selection get} msg] $msg"; puts **DONE**; flush stdout}
+ puts $fd {puts "[catch {selection get} msg]:$msg"; puts **DONE**; flush stdout}
flush $fd
after 200
selection own .
@@ -879,10 +973,11 @@ test select-10.1 {ConvertSelection procedure, race with selection clear} unix {
# a "broken pipe" error when Tk was actually [load]ed in the child.
catch {close $fd}
lappend x $selInfo
-} {{1 PRIMARY selection doesn't exist or form "STRING" not defined} {}}
-test select-10.2 {ConvertSelection procedure} unix {
+} -result {{1:PRIMARY selection doesn't exist or form "STRING" not defined} {}}
+test select-10.2 {ConvertSelection procedure} -constraints unix -setup {
setup
setupbg
+} -body {
set selValue [string range $longValue 0 3999]
set selInfo ""
selection handle .f1 {handler STRING}
@@ -890,21 +985,24 @@ test select-10.2 {ConvertSelection procedure} unix {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} [list [string range $longValue 0 3999] {STRING 0 4000 STRING 4000 4000 STRING 0 4000 STRING 4000 4000}]
-test select-10.3 {ConvertSelection procedure} unix {
+} -result [list [string range $longValue 0 3999] {STRING 0 4000 STRING 4000 4000 STRING 0 4000 STRING 4000 4000}]
+test select-10.3 {ConvertSelection procedure} -constraints unix -setup {
setup
setupbg
+} -body {
selection handle .f1 ERROR errHandler
- set result ""
- lappend result [dobg {selection get ERROR}]
+ dobg {selection get ERROR}
+} -cleanup {
cleanupbg
- set result
-} {{PRIMARY selection doesn't exist or form "ERROR" not defined}}
+} -result {PRIMARY selection doesn't exist or form "ERROR" not defined}
# testing timers
# This one hangs in Exceed
-test select-10.4 {ConvertSelection procedure} {unix noExceed} {
+test select-10.4 {ConvertSelection procedure} -constraints {
+ unix noExceed
+} -setup {
setup
setupbg
+} -body {
set selValue $longValue
set selInfo ""
selection handle .f1 {errIncrHandler STRING}
@@ -913,10 +1011,13 @@ test select-10.4 {ConvertSelection procedure} {unix noExceed} {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} {{selection owner didn't respond} {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000 STRING 0 4000 STRING 4000 4000}}
-test select-10.5 {ConvertSelection procedure, reentrancy issues} unix {
+} -result {{selection owner didn't respond} {STRING 0 4000 STRING 4000 4000 STRING 8000 4000 STRING 12000 4000 STRING 16000 4000 STRING 0 4000 STRING 4000 4000}}
+test select-10.5 {ConvertSelection procedure, reentrancy issues} -constraints {
+ unix
+} -setup {
setup
setupbg
+} -body {
set selValue "Test value"
set selInfo ""
selection handle -type TEST .f1 { handler TEST }
@@ -925,14 +1026,17 @@ test select-10.5 {ConvertSelection procedure, reentrancy issues} unix {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} {{PRIMARY selection doesn't exist or form "STRING" not defined} {.f1 STRING 0 4000}}
-test select-10.6 {ConvertSelection procedure, reentrancy issues} unix {
+} -result {{PRIMARY selection doesn't exist or form "STRING" not defined} {.f1 STRING 0 4000}}
+test select-10.6 {ConvertSelection procedure, reentrancy issues} -constraints {
+ unix
+} -setup {
+ setup
+ setupbg
+} -body {
proc weirdHandler {type offset count} {
destroy .f1
handler $type $offset $count
}
- setup
- setupbg
set selValue $longValue
set selInfo ""
selection handle .f1 {weirdHandler STRING}
@@ -940,14 +1044,15 @@ test select-10.6 {ConvertSelection procedure, reentrancy issues} unix {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} {{PRIMARY selection doesn't exist or form "STRING" not defined} {STRING 0 4000}}
+} -result {{PRIMARY selection doesn't exist or form "STRING" not defined} {STRING 0 4000}}
##############################################################################
# testing reentrancy
-test select-11.1 {TkSelPropProc procedure} unix {
+test select-11.1 {TkSelPropProc procedure} -constraints unix -setup {
setup
setupbg
+} -body {
set selValue $longValue
set selInfo ""
selection handle -type TEST .f1 { handler TEST }
@@ -957,28 +1062,28 @@ test select-11.1 {TkSelPropProc procedure} unix {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} {{selection owner didn't respond} {.f1 STRING 0 4000 .f1 STRING 4000 4000 .f1 STRING 8000 4000 .f1 STRING 12000 4000 .f1 STRING 16000 4000 .f1 STRING 0 4000 .f1 STRING 4000 4000}}
+} -result {{selection owner didn't respond} {.f1 STRING 0 4000 .f1 STRING 4000 4000 .f1 STRING 8000 4000 .f1 STRING 12000 4000 .f1 STRING 16000 4000 .f1 STRING 0 4000 .f1 STRING 4000 4000}}
##############################################################################
# Note, this assumes we are using CurrentTtime
-test select-12.1 {DefaultSelection procedure} unix {
+test select-12.1 {DefaultSelection procedure} -constraints unix -body {
setup
set result [selection get -type TIMESTAMP]
setupbg
lappend result [dobg {selection get -type TIMESTAMP}]
cleanupbg
set result
-} {0x0 {0x0 }}
-test select-12.2 {DefaultSelection procedure} unix {
+} -result {0x0 {0x0 }}
+test select-12.2 {DefaultSelection procedure} -constraints unix -body {
setup
set result [lsort [list [selection get -type TARGETS]]]
setupbg
lappend result [dobg {lsort [selection get -type TARGETS]}]
cleanupbg
set result
-} {{MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-12.3 {DefaultSelection procedure} unix {
+} -result {{MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-12.3 {DefaultSelection procedure} -constraints unix -body {
setup
selection handle .f1 {handler TEST} TEST
set result [list [lsort [selection get -type TARGETS]]]
@@ -986,25 +1091,26 @@ test select-12.3 {DefaultSelection procedure} unix {
lappend result [dobg {lsort [selection get -type TARGETS]}]
cleanupbg
set result
-} {{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-12.4 {DefaultSelection procedure} unix {
+} -result {{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-12.4 {DefaultSelection procedure} -constraints unix -setup {
setup
set result ""
+} -body {
lappend result [selection get -type TK_APPLICATION]
setupbg
lappend result [dobg {selection get -type TK_APPLICATION}]
cleanupbg
set result
-} [list [winfo name .] [winfo name .]]
-test select-12.5 {DefaultSelection procedure} unix {
+} -result [list [winfo name .] [winfo name .]]
+test select-12.5 {DefaultSelection procedure} -constraints unix -body {
setup
set result [selection get -type TK_WINDOW]
setupbg
lappend result [dobg {selection get -type TK_WINDOW}]
cleanupbg
set result
-} {.f1 .f1}
-test select-12.6 {DefaultSelection procedure} {
+} -result {.f1 .f1}
+test select-12.6 {DefaultSelection procedure} -body {
setup
selection handle .f1 {handler TARGETS.f1} TARGETS
set selValue "Targets value"
@@ -1012,9 +1118,14 @@ test select-12.6 {DefaultSelection procedure} {
set result [list [selection get TARGETS] $selInfo]
selection handle .f1 {} TARGETS
lappend result [selection get TARGETS]
-} {{Targets value} {TARGETS.f1 0 4000} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+} -result {{Targets value} {TARGETS.f1 0 4000} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-13.1 {SelectionSize procedure, handler deleted} unix {
+test select-13.1 {SelectionSize procedure, handler deleted} -constraints {
+ unix
+} -setup {
+ setup
+ setupbg
+} -body {
proc badHandler {path type offset count} {
global selValue selInfo abortCount
incr abortCount -1
@@ -1028,8 +1139,6 @@ test select-13.1 {SelectionSize procedure, handler deleted} unix {
}
string range $selValue $offset [expr $numBytes+$offset]
}
- setup
- setupbg
set selValue $longValue
set selInfo ""
selection handle .f1 {badHandler .f1 STRING}
@@ -1038,10 +1147,14 @@ test select-13.1 {SelectionSize procedure, handler deleted} unix {
lappend result [dobg {selection get}]
cleanupbg
lappend result $selInfo
-} {{PRIMARY selection doesn't exist or form "STRING" not defined} {.f1 STRING 0 4000 .f1 STRING 4000 4000}}
-
+} -result {{PRIMARY selection doesn't exist or form "STRING" not defined} {.f1 STRING 0 4000 .f1 STRING 4000 4000}}
+
catch {rename weirdHandler {}}
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/send.test b/tests/send.test
index d3fce3b..e3156a1 100644
--- a/tests/send.test
+++ b/tests/send.test
@@ -230,10 +230,10 @@ test send-8.4 {Tk_SendCmd procedure, options} {secureserver} {
} {1 {bad option "-gorp": must be -async, -displayof, or --}}
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 ...?"}}
+} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}}
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 ...?"}}
+} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}}
test send-8.7 {Tk_SendCmd procedure, local execution} {secureserver} {
set a initial
send [tk appname] {set a new}
diff --git a/tests/spinbox.test b/tests/spinbox.test
index 0fe1c33..b8170c5 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -1,238 +1,1240 @@
# 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.
+# 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.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+# For xscrollcommand
proc scroll args {
- global scrollInfo
- set scrollInfo $args
+ global scrollInfo
+ set scrollInfo $args
+}
+# For trace variable
+proc override args {
+ global x
+ set x 12345
}
-# 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
+# Procedures used in widget VALIDATION tests
+proc doval {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 1
+}
+proc doval2 {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ set ::e mydata
+ return 1
+}
+proc doval3 {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 0
}
-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}
+set cy [font metrics {Courier -12} -linespace]
+
+test spinbox-1.1 {configuration option: "activebackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -activebackground #ff0000
+ .e cget -activebackground
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test spinbox-1.2 {configuration option: "activebackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -activebackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.3 {configuration option: "background"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -background #ff0000
+ .e cget -background
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test spinbox-1.4 {configuration option: "background" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -background non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.5 {configuration option: "bd"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -bd 4
+ .e cget -bd
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-1.6 {configuration option: "bd" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -bd badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test spinbox-1.7 {configuration option: "bg"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -bg #ff0000
+ .e cget -bg
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test spinbox-1.8 {configuration option: "bg" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -bg non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.9 {configuration option: "borderwidth"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -borderwidth 1.3
+ .e cget -borderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-1.10 {configuration option: "borderwidth" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -borderwidth badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test spinbox-1.11 {configuration option: "buttonbackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -buttonbackground #ff0000
+ .e cget -buttonbackground
+} -cleanup {
+ destroy .e
+} -result {#ff0000}
+test spinbox-1.12 {configuration option: "buttonbackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -buttonbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.13 {configuration option: "buttoncursor"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -buttoncursor arrow
+ .e cget -buttoncursor
+} -cleanup {
+ destroy .e
+} -result {arrow}
+test spinbox-1.14 {configuration option: "buttoncursor" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -buttoncursor badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+
+test spinbox-1.15 {configuration option: "command"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -command {a command}
+ .e cget -command
+} -cleanup {
+ destroy .e
+} -result {a command}
+
+test spinbox-1.16 {configuration option: "cursor"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -cursor arrow
+ .e cget -cursor
+} -cleanup {
+ destroy .e
+} -result {arrow}
+test spinbox-1.17 {configuration option: "cursor" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -cursor badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad cursor spec "badValue"}
+
+test spinbox-1.18 {configuration option: "disabledbackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -disabledbackground green
+ .e cget -disabledbackground
+} -cleanup {
+ destroy .e
+} -result {green}
+test spinbox-1.19 {configuration option: "disabledbackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -disabledbackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.20 {configuration option: "disabledforeground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -disabledforeground #110022
+ .e cget -disabledforeground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test spinbox-1.21 {configuration option: "disabledforeground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -disabledforeground bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.22 {configuration option: "exportselection"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -exportselection yes
+ .e cget -exportselection
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-1.23 {configuration option: "exportselection" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -exportselection xyzzy
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected boolean value but got "xyzzy"}
+
+test spinbox-1.24 {configuration option: "fg"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -fg #110022
+ .e cget -fg
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test spinbox-1.25 {configuration option: "fg" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -fg bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.26 {configuration option: "font"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ .e cget -font
+} -cleanup {
+ destroy .e
+} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
+test spinbox-1.27 {configuration option: "font" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -font {}
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {font "" doesn't exist}
+
+test spinbox-1.28 {configuration option: "foreground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -foreground #110022
+ .e cget -foreground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test spinbox-1.29 {configuration option: "foreground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -foreground bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.30 {configuration option: "format"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -format %0.5f
+ .e cget -format
+} -cleanup {
+ destroy .e
+} -result {%0.5f}
+test spinbox-1.31 {configuration option: "format" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -format %d
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad spinbox format specifier "%d"}
+
+test spinbox-1.32 {configuration option: "from"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -from -10
+ .e cget -from
+} -cleanup {
+ destroy .e
+} -result {-10.0}
+test spinbox-1.33 {configuration option: "from" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -from bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected floating-point number but got "bogus"}
+
+test spinbox-1.34 {configuration option: "highlightbackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightbackground #123456
+ .e cget -highlightbackground
+} -cleanup {
+ destroy .e
+} -result {#123456}
+test spinbox-1.35 {configuration option: "highlightbackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightbackground ugly
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "ugly"}
+
+test spinbox-1.36 {configuration option: "highlightcolor"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightcolor #123456
+ .e cget -highlightcolor
+} -cleanup {
+ destroy .e
+} -result {#123456}
+test spinbox-1.37 {configuration option: "highlightcolor" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightcolor bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.38 {configuration option: "highlightthickness"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness 6
+ .e cget -highlightthickness
+} -cleanup {
+ destroy .e
+} -result {6}
+test spinbox-1.39 {configuration option: "highlightthickness" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "bogus"}
+
+test spinbox-1.40 {configuration option: "highlightthickness"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -highlightthickness -2
+ .e cget -highlightthickness
+} -cleanup {
+ destroy .e
+} -result {0}
+
+test spinbox-1.41 {configuration option: "increment"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -increment 1.0
+ .e cget -increment
+} -cleanup {
+ destroy .e
+} -result {1.0}
+test spinbox-1.42 {configuration option: "increment" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -increment bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected floating-point number but got "bogus"}
+
+test spinbox-1.43 {configuration option: "insertbackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertbackground #110022
+ .e cget -insertbackground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test spinbox-1.44 {configuration option: "insertbackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertbackground bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.45 {configuration option: "insertborderwidth"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertborderwidth 1.3
+ .e cget -insertborderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-1.46 {configuration option: "insertborderwidth" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertborderwidth 2.6x
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "2.6x"}
+
+test spinbox-1.47 {configuration option: "insertofftime"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertofftime 100
+ .e cget -insertofftime
+} -cleanup {
+ destroy .e
+} -result {100}
+test spinbox-1.48 {configuration option: "insertofftime" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertofftime 3.2
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3.2"}
+
+test spinbox-1.49 {configuration option: "insertontime"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertontime 100
+ .e cget -insertontime
+} -cleanup {
+ destroy .e
+} -result {100}
+test spinbox-1.50 {configuration option: "insertontime" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -insertontime 3.2
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3.2"}
+
+test spinbox-1.51 {configuration option: "invalidcommand"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -invalidcommand "a command"
+ .e cget -invalidcommand
+} -cleanup {
+ destroy .e
+} -result {a command}
+
+test spinbox-1.52 {configuration option: "invcmd"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -invcmd "a command"
+ .e cget -invcmd
+} -cleanup {
+ destroy .e
+} -result {a command}
+
+test spinbox-1.53 {configuration option: "justify"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -justify right
+ .e cget -justify
+} -cleanup {
+ destroy .e
+} -result {right}
+test spinbox-1.54 {configuration option: "justify" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -justify bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center}
+
+test spinbox-1.55 {configuration option: "readonlybackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -readonlybackground green
+ .e cget -readonlybackground
+} -cleanup {
+ destroy .e
+} -result {green}
+test spinbox-1.56 {configuration option: "readonlybackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -readonlybackground non-existent
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "non-existent"}
+
+test spinbox-1.57 {configuration option: "relief"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -relief groove
+ .e cget -relief
+} -cleanup {
+ destroy .e
+} -result {groove}
+test spinbox-1.58 {configuration option: "relief" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -relief 1.5
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}
+
+test spinbox-1.59 {configuration option: "repeatdelay"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -repeatdelay 500
+ .e cget -repeatdelay
+} -cleanup {
+ destroy .e
+} -result {500}
+test spinbox-1.60 {configuration option: "repeatdelay" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -repeatdelay 3p
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test spinbox-1.61 {configuration option: "repeatinterval"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -repeatinterval -500
+ .e cget -repeatinterval
+} -cleanup {
+ destroy .e
+} -result {-500}
+test spinbox-1.62 {configuration option: "repeatinterval" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -repeatinterval 3p
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test spinbox-1.63 {configuration option: "selectbackground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectbackground #110022
+ .e cget -selectbackground
+} -cleanup {
+ destroy .e
+} -result {#110022}
+test spinbox-1.64 {configuration option: "selectbackground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectbackground bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.65 {configuration option: "selectborderwidth"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectborderwidth 1.3
+ .e cget -selectborderwidth
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-1.66 {configuration option: "selectborderwidth" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectborderwidth badValue
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad screen distance "badValue"}
+
+test spinbox-1.67 {configuration option: "selectforeground"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectforeground #654321
+ .e cget -selectforeground
+} -cleanup {
+ destroy .e
+} -result {#654321}
+test spinbox-1.68 {configuration option: "selectforeground" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -selectforeground bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {unknown color name "bogus"}
+
+test spinbox-1.69 {configuration option: "state"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -state n
+ .e cget -state
+} -cleanup {
+ destroy .e
+} -result {normal}
+test spinbox-1.70 {configuration option: "state" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -state bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly}
+
+test spinbox-1.71 {configuration option: "takefocus"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -takefocus "any string"
+ .e cget -takefocus
+} -cleanup {
+ destroy .e
+} -result {any string}
+
+test spinbox-1.72 {configuration option: "textvariable"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -textvariable i
+ .e cget -textvariable
+} -cleanup {
+ destroy .e
+} -result {i}
+
+test spinbox-1.73 {configuration option: "to"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -to 14.9
+ .e cget -to
+} -cleanup {
+ destroy .e
+} -result {14.9}
+test spinbox-1.74 {configuration option: "to" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -to bogus
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected floating-point number but got "bogus"}
+
+test spinbox-1.75 {configuration option: "validate"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -validate "key"
+ .e cget -validate
+} -cleanup {
+ destroy .e
+} -result {key}
+test spinbox-1.76 {configuration option: "validate" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -validate "bogus"
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none}
+
+test spinbox-1.77 {configuration option: "validatecommand"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -validatecommand "a command"
+ .e cget -validatecommand
+} -cleanup {
+ destroy .e
+} -result {a command}
+
+test spinbox-1.78 {configuration option: "values"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -values {mon tue wed thur}
+ .e cget -values
+} -cleanup {
+ destroy .e
+} -result {mon tue wed thur}
+test spinbox-1.79 {configuration option: "values" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -values {bad {}list}
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {list element in braces followed by "list" instead of space}
+
+test spinbox-1.80 {configuration option: "vcmd"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -vcmd "a command"
+ .e cget -vcmd
+} -cleanup {
+ destroy .e
+} -result {a command}
+
+test spinbox-1.81 {configuration option: "width"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -width 402
+ .e cget -width
+} -cleanup {
+ destroy .e
+} -result {402}
+test spinbox-1.82 {configuration option: "width" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -width 3p
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected integer but got "3p"}
+
+test spinbox-1.83 {configuration option: "wrap"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -wrap yes
+ .e cget -wrap
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-1.84 {configuration option: "wrap" for spinbox} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -wrap xyzzy
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {expected boolean value but got "xyzzy"}
+
+test spinbox-1.85 {configuration option: "xscrollcommand"} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
+ -relief sunken
+ pack .e
+ update
+} -body {
+ .e configure -xscrollcommand {Some command}
+ .e cget -xscrollcommand
+} -cleanup {
+ destroy .e
+} -result {Some command}
+
+
+test spinbox-2.1 {Tk_SpinboxCmd procedure} -body {
+ spinbox
+} -returnCodes error -result {wrong # args: should be "spinbox pathName ?-option value ...?"}
+test spinbox-2.2 {Tk_SpinboxCmd procedure} -body {
+ spinbox gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test spinbox-2.3 {Tk_SpinboxCmd procedure} -body {
spinbox .e
+ pack .e
+ update
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}
+} -cleanup {
+ destroy .e
+} -result {1 Spinbox .e}
+test spinbox-2.4 {Tk_SpinboxCmd procedure} -body {
+ spinbox .e -gorp foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-gorp"}
+test spinbox-2.4.1 {Tk_SpinboxCmd procedure} -body {
+ catch {spinbox .e -gorp foo}
+ list [winfo exists .e] [info commands .e]
+} -cleanup {
+ destroy .e
+} -result {0 {}}
+test spinbox-2.5 {Tk_SpinboxCmd procedure} -body {
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
+} -cleanup {
+ destroy .e
+} -result {.e}
- .e delete 0 end
+
+test spinbox-3.1 {SpinboxWidgetCmd procedure} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"}
+test spinbox-3.2 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e bbox index"}
+test spinbox-3.3 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox a b
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e bbox index"}
+test spinbox-3.4 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e bbox bogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "bogus"}
+test spinbox-3.5 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e bbox 0
+} -cleanup {
+ destroy .e
+} -result [list 5 5 0 $cy]
+
+# Oryginaly the result was count using measurements
+# and metrics. It was changed to less verbose solution - the result is the one
+# that passes fonts constraint (this concerns tests 3.6, 3.7, 3.8, 3.10)
+test spinbox-3.6 {SpinboxWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): no utf chars
.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
+} -cleanup {
+ destroy .e
+} -result {{19 5 7 13} {19 5 7 13}}
+test spinbox-3.7 {SpinboxWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): utf at 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
+} -cleanup {
+ destroy .e
+} -result {19 5 12 13}
+test spinbox-3.8 {SpinboxWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): utf before index
.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
+} -cleanup {
+ destroy .e
+} -result {31 5 7 13}
+test spinbox-3.9 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+# Tcl_UtfAtIndex(): no chars
.e bbox end
-} "5 5 0 $cy"
-test spinbox-3.10 {SpinboxWidgetCmd procedure, "bbox" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result "5 5 0 $cy"
+test spinbox-3.10 {SpinboxWidgetCmd procedure, "bbox" widget command} -constraints {
+ fonts
+} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
.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} {
+} -cleanup {
+ destroy .e
+} -result {{5 5 7 13} {12 5 7 13} {75 5 12 13} {122 5 7 13}}
+test spinbox-3.11 {SpinboxWidgetCmd procedure, "cget" widget command} -setup {
+ spinbox .e
+} -body {
+ .e cget
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e cget option"}
+test spinbox-3.12 {SpinboxWidgetCmd procedure, "cget" widget command} -setup {
+ spinbox .e
+} -body {
+ .e cget a b
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e cget option"}
+test spinbox-3.13 {SpinboxWidgetCmd procedure, "cget" widget command} -setup {
+ spinbox .e
+} -body {
+ .e cget -gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-gorp"}
+test spinbox-3.14 {SpinboxWidgetCmd procedure, "cget" widget command} -setup {
+ spinbox .e
+} -body {
.e configure -bd 4
.e cget -bd
-} {4}
-test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
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} {
+} -cleanup {
+ destroy .e
+} -result {49}
+test spinbox-3.16 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
+ spinbox .e
+} -body {
+ .e configure -foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "-foo"}
+test spinbox-3.17 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
+ spinbox .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-3.18 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+} -body {
+ .e delete
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"}
+test spinbox-3.19 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+} -body {
+ .e delete a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"}
+test spinbox-3.20 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+} -body {
+ .e delete foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "foo"}
+test spinbox-3.21 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+} -body {
+ .e delete 0 bar
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "bar"}
+test spinbox-3.22 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e delete 2 4
.e get
-} {014567890}
-test spinbox-3.23 {SpinboxWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {014567890}
+test spinbox-3.23 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+} -body {
.e insert end "01234567890"
.e delete 6
.e get
-} {0123457890}
-test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} {
- # UTF
+} -cleanup {
+ destroy .e
+} -result {0123457890}
+test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
set x {}
- .e delete 0 end
+} -body {
+# UTF
.e insert end "01234\u4e4e67890"
.e delete 6
lappend x [.e get]
@@ -244,277 +1246,659 @@ test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} {
.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
+} -cleanup {
+ destroy .e
+} -result [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"]
+test spinbox-3.25 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e delete 6 5
.e get
-} {01234567890}
-test spinbox-3.26 {SpinboxWidgetCmd procedure, "delete" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test spinbox-3.26 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test spinbox-3.26.1 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e insert end "01234567890"
+ .e configure -state readonly
+ .e delete 2 8
+ .e configure -state normal
+ .e get
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test spinbox-3.27 {SpinboxWidgetCmd procedure, "get" widget command} -setup {
+ spinbox .e
+} -body {
+ .e get foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e get"}
+test spinbox-3.28 {SpinboxWidgetCmd procedure, "icursor" widget command} -setup {
+ spinbox .e
+} -body {
+ .e icursor
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e icursor pos"}
+test spinbox-3.29 {SpinboxWidgetCmd procedure, "icursor" widget command} -setup {
+ spinbox .e
+} -body {
+ .e icursor foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "foo"}
+test spinbox-3.30 {SpinboxWidgetCmd procedure, "icursor" widget command} -setup {
+ spinbox .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-3.31 {SpinboxWidgetCmd procedure, "index" widget command} -setup {
+ spinbox .e
+} -body {
+ .e in
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {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} -setup {
+ spinbox .e
+} -body {
+ .e index
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e index string"}
+test spinbox-3.33 {SpinboxWidgetCmd procedure, "index" widget command} -setup {
+ spinbox .e
+} -body {
+ .e index foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "foo"}
+test spinbox-3.34 {SpinboxWidgetCmd procedure, "index" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e index 0
+} -cleanup {
+ destroy .e
+} -returnCodes {ok} -match glob -result {*}
+test spinbox-3.35 {SpinboxWidgetCmd procedure, "index" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+# UTF
.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
+} -cleanup {
+ destroy .e
+} -result {3 4 8}
+test spinbox-3.36 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+} -body {
+ .e insert a
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test spinbox-3.37 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+} -body {
+ .e insert a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test spinbox-3.38 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+} -body {
+ .e insert foo Text
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "foo"}
+test spinbox-3.39 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.e insert end "01234567890"
.e insert 3 xxx
.e get
-} {012xxx34567890}
-test spinbox-3.40 {SpinboxWidgetCmd procedure, "insert" widget command} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {012xxx34567890}
+test spinbox-3.40 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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.
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test spinbox-3.40.1 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e insert end "01234567890"
+ .e configure -state readonly
+ .e insert 3 xxx
+ .e configure -state normal
+ .e get
+} -cleanup {
+ destroy .e
+} -result {01234567890}
+test spinbox-3.41 {SpinboxWidgetCmd procedure, "insert" widget command} -setup {
+ spinbox .e
+} -body {
+ .e insert a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e insert index text"}
+test spinbox-3.42 {SpinboxWidgetCmd procedure, "scan" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e scan a
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"}
+test spinbox-3.43 {SpinboxWidgetCmd procedure, "scan" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e scan a b c
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"}
+test spinbox-3.44 {SpinboxWidgetCmd procedure, "scan" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e scan foobar 20
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad scan option "foobar": must be mark or dragto}
+test spinbox-3.45 {SpinboxWidgetCmd procedure, "scan" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e scan mark 20.1
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected integer but got "20.1"}
-test spinbox-3.46 {SpinboxWidgetCmd procedure, "scan" widget command} {fonts} {
- .e delete 0 end
+# This test is non-portable because character sizes vary.
+test spinbox-3.46 {SpinboxWidgetCmd procedure, "scan" widget command} -constraints {
+ fonts
+} -setup {
+ spinbox .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2
+ pack .e
update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {2}
+test spinbox-3.47 {SpinboxWidgetCmd procedure, "select" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection option ?index?"}
+test spinbox-3.48 {SpinboxWidgetCmd procedure, "select" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad selection option "foo": must be adjust, clear, element, from, present, range, or to}
+
+test spinbox-3.49 {SpinboxWidgetCmd procedure, "select clear" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select clear gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection clear"}
+test spinbox-3.50 {SpinboxWidgetCmd procedure, "select clear" widget command} -setup {
+ spinbox .e
+} -body {
.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
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test spinbox-3.50.1 {SpinboxWidgetCmd procedure, "select clear" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 4
+ update
+ .e select clear
+ catch {selection get}
+ selection own
+} -cleanup {
+ destroy .e
+} -result {.e}
+
+test spinbox-3.51 {SpinboxWidgetCmd procedure, "selection present" widget command} -setup {
+ spinbox .e
+} -body {
+ .e selection present foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection present"}
+test spinbox-3.52 {SpinboxWidgetCmd procedure, "selection present" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-3.53 {SpinboxWidgetCmd procedure, "selection present" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-3.54 {SpinboxWidgetCmd procedure, "selection present" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {0}
+test spinbox-3.55 {SpinboxWidgetCmd procedure, "selection adjust" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select adjust x
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "x"}
+test spinbox-3.56 {SpinboxWidgetCmd procedure, "selection adjust" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select adjust 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection adjust index"}
+test spinbox-3.57 {SpinboxWidgetCmd procedure, "selection adjust" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {123}
+test spinbox-3.58 {SpinboxWidgetCmd procedure, "selection adjust" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {234}
+test spinbox-3.59 {SpinboxWidgetCmd procedure, "selection from" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select from 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection from index"}
+
+test spinbox-3.60 {SpinboxWidgetCmd procedure, "selection range" widget command} -setup {
+ spinbox .e
+} -body {
+ .e select range 2
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection range start end"}
+test spinbox-3.61 {SpinboxWidgetCmd procedure, "selection range" widget command} -setup {
+ spinbox .e
+} -body {
+ .e selection range 2 3 4
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection range start end"}
+test spinbox-3.62 {SpinboxWidgetCmd procedure, "selection range" widget command} -setup {
+ spinbox .e
+} -body {
.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 index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test spinbox-3.63 {SpinboxWidgetCmd procedure, "selection range" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
.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} {
+} -cleanup {
+ destroy .e
+} -result {2 9 3}
+test spinbox-3.64 {SpinboxWidgetCmd procedure, "selection to" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+ .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."
+} -body {
+ .e select to 2 3
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e selection to index"}
+test spinbox-3.64.1 {SpinboxWidgetCmd procedure, "selection" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .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]
+} -cleanup {
+ destroy .e
+} -result {0 10}
+test spinbox-3.64.2 {SpinboxWidgetCmd procedure, "selection" widget command} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .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]
+} -cleanup {
+ destroy .e
+} -result {2 4}
+
+test spinbox-3.65 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 5
format {%.6f %.6f} {*}[.e xview]
-} {0.053763 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} {
+} -cleanup {
+ destroy .e
+} -result {0.053763 0.268817}
+test spinbox-3.66 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "gorp"}
+test spinbox-3.67 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 0
.e icursor 10
.e xview insert
format {%.6f %.6f} {*}[.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} {
+} -cleanup {
+ destroy .e
+} -result {0.107527 0.322581}
+test spinbox-3.68 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview moveto foo bar
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"}
+test spinbox-3.69 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e xview moveto foo
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected floating-point number but got "foo"}
+test spinbox-3.70 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview moveto 0.5
format {%.6f %.6f} {*}[.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} {
+} -cleanup {
+ destroy .e
+} -result {0.505376 0.720430}
+test spinbox-3.71 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
+ .e xview scroll 24
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"}
+test spinbox-3.72 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview scroll gorp units
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {expected integer but got "gorp"}
+test spinbox-3.73 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview moveto 0
.e xview scroll 1 pages
format {%.6f %.6f} {*}[.e xview]
-} {0.193548 0.408602}
-test spinbox-3.74 {SpinboxWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.193548 0.408602}
+test spinbox-3.74 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview moveto .9
update
.e xview scroll -2 p
format {%.6f %.6f} {*}[.e xview]
-} {0.397849 0.612903}
-test spinbox-3.75 {SpinboxWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0.397849 0.612903}
+test spinbox-3.75 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.e xview 30
update
.e xview scroll 2 units
.e index @0
-} {32}
-test spinbox-3.76 {SpinboxWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {32}
+test spinbox-3.76 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {29}
+test spinbox-3.77 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview scroll 23 foobars
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad argument "foobars": must be units or pages}
+test spinbox-3.78 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
+ .e xview eat 23 hamburgers
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {unknown option "eat": must be moveto or scroll}
+test spinbox-3.79 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .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."
.e xview 0
update
.e xview -4
.e index @0
-} {0}
-test spinbox-3.80 {SpinboxWidgetCmd procedure, "xview" widget command} {
+} -cleanup {
+ destroy .e
+} -result {0}
+test spinbox-3.80 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ update
.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
-
+} -cleanup {
+ destroy .e
+} -result {73}
+test spinbox-3.81 {SpinboxWidgetCmd procedure, "xview" widget command} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+ .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."
+ .e insert 10 \u4e4e
+ update
+# 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 [format {%.6f} [lindex [.e xview] 0]]
@@ -522,221 +1906,327 @@ test spinbox-3.81 {SpinboxWidgetCmd procedure, "xview" widget command} {
lappend x [format {%.6f} [lindex [.e xview] 0]]
.e xview moveto .12
lappend x [format {%.6f} [lindex [.e xview] 0]]
-} {0.095745 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}
+} -cleanup {
+ destroy .e
+} -result {0.095745 0.106383 0.117021}
+
+test spinbox-3.82 {SpinboxWidgetCmd procedure} -setup {
+ spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .e
+ update
+} -body {
+ .e gorp
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview}
+
+test spinbox-5.1 {ConfigureSpinbox procedure, -textvariable} -body {
set x 12345
spinbox .e -textvariable x
.e get
-} {12345}
-test spinbox-5.2 {ConfigureSpinbox procedure, -textvariable} {
- catch {destroy .e}
+} -cleanup {
+ destroy .e
+} -result {12345}
+test spinbox-5.2 {ConfigureSpinbox procedure, -textvariable} -body {
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}
+} -cleanup {
+ destroy .e
+} -result {abcde}
+test spinbox-5.3 {ConfigureSpinbox procedure, -textvariable} -setup {
+ unset -nocomplain x
spinbox .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {Some text}
+test spinbox-5.4 {ConfigureSpinbox procedure, -textvariable} -setup {
+ unset -nocomplain x
spinbox .e
+} -body {
+ trace variable x w override
.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
+ list $x [.e get]
+} -cleanup {
+ destroy .e
+ trace vdelete x w override
+} -result {12345 12345}
+
+test spinbox-5.5 {ConfigureSpinbox procedure} -setup {
set x {}
+ spinbox .e1
+ spinbox .e2
+} -body {
+ .e2 insert end "This is some sample text"
+ .e1 configure -exportselection false
+ .e1 insert end "0123456789"
+ pack .e1 .e2
+ .e2 select from 0
+ .e2 select to 10
lappend x [selection get]
- .e select from 1
- .e select to 5
+ .e1 select from 1
+ .e1 select to 5
lappend x [selection get]
- .e configure -exportselection 1
+ .e1 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}
+} -cleanup {
+ destroy .e1 .e2
+} -result {{This is so} {This is so} 1234}
+test spinbox-5.6 {ConfigureSpinbox procedure} -setup {
+ spinbox .e
+ pack .e
+} -body {
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 5
+ .e configure -exportselection 0
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test spinbox-5.6.1 {ConfigureSpinbox procedure} -setup {
spinbox .e
pack .e
+} -body {
.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
+ catch {selection get}
+ list [.e index sel.first] [.e index sel.last]
+} -cleanup {
+ destroy .e
+} -result {1 5}
+
+test spinbox-5.7 {ConfigureSpinbox procedure} -setup {
+ spinbox .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
update
.e configure -width 5
format {%.6f %.6f} {*}$scrollInfo
-} {0.000000 0.363636}
-test spinbox-5.8 {ConfigureSpinbox procedure} {fonts} {
- catch {destroy .e}
- spinbox .e -width 0
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.363636}
+
+test spinbox-5.8 {ConfigureSpinbox procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -width 0 -font {Helvetica -12}
.e insert end "0123"
update
- .e configure -font $big
+ .e configure -font {Helvetica -24}
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
+} -cleanup {
+ destroy .e
+} -result {79x37+0+0}
+test spinbox-5.9 {ConfigureSpinbox procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised
.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
+} -cleanup {
+ destroy .e
+} -result {0 0 1 1}
+test spinbox-5.10 {ConfigureSpinbox procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief flat
.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}}]
+} -cleanup {
+ destroy .e
+} -result {0 0 1 1}
+test spinbox-5.11 {ConfigureSpinbox procedure} -setup {
+ spinbox .e -borderwidth 2 -highlightthickness 2
+ pack .e
+} -body {
+# If "0" in selected font had 0 width, caused divide-by-zero error.
+ .e configure -font {{open look glyph}}
.e scan dragto 30
update
-} {}
+} -cleanup {
+ destroy .e
+} -result {}
# 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
+test spinbox-6.1 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -highlightthickness 3
.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
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test spinbox-6.2 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify center \
+ -highlightthickness 3
.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
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test spinbox-6.3 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify right \
+ -highlightthickness 3
.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
+} -cleanup {
+ destroy .e
+} -result {3 4}
+test spinbox-6.4 {SpinboxComputeGeometry procedure} -setup {
+ spinbox .e
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 5
.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
+} -cleanup {
+ destroy .e
+} -result {6}
+test spinbox-6.5 {SpinboxComputeGeometry procedure} -setup {
+ spinbox .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 5
.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
+} -cleanup {
+ destroy .e
+} -result {6}
+test spinbox-6.6 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Courier -12} -bd 2 -relief raised -width 10
.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
+} -cleanup {
+ destroy .e
+} -result {5 6}
+test spinbox-6.7 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5
.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
+} -cleanup {
+ destroy .e
+} -result {94 39}
+test spinbox-6.8 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
.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
+} -cleanup {
+ destroy .e
+} -result {133 39}
+test spinbox-6.9 {SpinboxComputeGeometry procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -highlightthickness 2
pack .e
+} -body {
+ .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
update
list [winfo reqwidth .e] [winfo reqheight .e]
-} {42 39}
+} -cleanup {
+ destroy .e
+} -result {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
+
+test spinbox-7.1 {InsertChars procedure} -setup {
+ unset -nocomplain contents
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 2 XXX
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abXXXcde abXXXcde {0.000000 1.000000}}
-test spinbox-7.2 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abXXXcde abXXXcde {0.000000 1.000000}}
+
+test spinbox-7.2 {InsertChars procedure} -setup {
+ unset -nocomplain contents
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e insert 500 XXX
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abcdeXXX abcdeXXX {0.000000 1.000000}}
-test spinbox-7.3 {InsertChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
+test spinbox-7.3 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -744,9 +2234,13 @@ test spinbox-7.3 {InsertChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {5 9 5 8}
+test spinbox-7.4 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -754,9 +2248,13 @@ test spinbox-7.4 {InsertChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {2 9 2 8}
+test spinbox-7.5 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -764,9 +2262,13 @@ test spinbox-7.5 {InsertChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {2 9 2 8}
+test spinbox-7.6 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 0123456789
.e select from 2
.e select to 6
@@ -774,70 +2276,118 @@ test spinbox-7.6 {InsertChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {2 6 2 5}
+test spinbox-7.7 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -xscrollcommand scroll
.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
+} -cleanup {
+ destroy .e
+} -result {7}
+test spinbox-7.8 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-7.9 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {7}
+test spinbox-7.10 {InsertChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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
+} -cleanup {
+ destroy .e
+} -result {4}
+
+test spinbox-7.11 {InsertChars procedure} -constraints {
+ fonts
+} -setup {
+ spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.e insert 0 "xyzzy"
update
.e insert 2 00
winfo reqwidth .e
-} {70}
+} -cleanup {
+ destroy .e
+} -result {70}
-.e configure -width 10
-test spinbox-8.1 {DeleteChars procedure} {
- .e delete 0 end
+test spinbox-8.1 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 2 4
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abe abe {0.000000 1.000000}}
-test spinbox-8.2 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abe abe {0.000000 1.000000}}
+test spinbox-8.2 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete -2 2
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {cde cde {0.000000 1.000000}}
-test spinbox-8.3 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {cde cde {0.000000 1.000000}}
+test spinbox-8.3 {DeleteChars procedure} -setup {
+ unset -nocomplain contents
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
+ .e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
.e delete 3 1000
update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
-} {abc abc {0.000000 1.000000}}
-test spinbox-8.4 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {abc abc {0.000000 1.000000}}
+test spinbox-8.4 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -846,9 +2396,14 @@ test spinbox-8.4 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {1 6 1 5}
+test spinbox-8.5 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -857,9 +2412,14 @@ test spinbox-8.5 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {1 5 1 4}
+test spinbox-8.6 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -868,17 +2428,28 @@ test spinbox-8.6 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {1 2 1 5}
+test spinbox-8.7 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.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
+ update
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test spinbox-8.8 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 3
.e select to 8
@@ -887,17 +2458,27 @@ test spinbox-8.8 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {3 4 3 8}
+test spinbox-8.9 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
.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
+ update
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test spinbox-8.10 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 8
.e select to 3
@@ -906,9 +2487,14 @@ test spinbox-8.10 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {3 5 5 8}
+test spinbox-8.11 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e select from 8
.e select to 3
@@ -917,124 +2503,185 @@ test spinbox-8.11 {DeleteChars procedure} {
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
+} -cleanup {
+ destroy .e
+} -result {3 8 4 8}
+test spinbox-8.12 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 1 4
+ update
.e index insert
-} {1}
-test spinbox-8.13 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-8.13 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 1 5
+ update
.e index insert
-} {1}
-test spinbox-8.14 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-8.14 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 0123456789abcde
.e icursor 4
.e delete 4 6
+ update
.e index insert
-} {4}
-test spinbox-8.15 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-8.15 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 1 4
+ update
.e index @0
-} {1}
-test spinbox-8.16 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-8.16 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 1 5
+ update
.e index @0
-} {1}
-test spinbox-8.17 {DeleteChars procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-8.17 {DeleteChars procedure} -setup {
+ spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "This is a very long string"
.e xview 4
.e delete 4 6
+ update
.e index @0
-} {4}
-.e configure -width 0
-test spinbox-8.18 {DeleteChars procedure} {fonts} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-8.18 {DeleteChars procedure} -setup {
+ spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
+ pack .e
+ focus .e
+} -body {
.e insert 0 "xyzzy"
update
.e delete 2 4
winfo reqwidth .e
-} {42}
+} -cleanup {
+ destroy .e
+} -result {42}
-test spinbox-9.1 {SpinboxValueChanged procedure} {
- catch {destroy .e}
- proc override args {
- global x
- set x 12345
- }
- catch {unset x}
+test spinbox-9.1 {SpinboxValueChanged procedure} -setup {
+ unset -nocomplain x
+} -body {
trace variable x w override
- spinbox .e -textvariable x
+ spinbox .e -textvariable x -width 0
.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} {
+ list $x [.e get]
+} -cleanup {
+ destroy .e
+ trace vdelete x w override
+} -result {12345 12345}
+
+
+test spinbox-10.1 {SpinboxSetValue procedure} -constraints fonts -body {
set x abcde
set y ab
- .e configure -textvariable x
- update
+ spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0
+ pack .e
+ .e configure -textvariable x
.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
+} -cleanup {
+ destroy .e
+} -result {ab 35}
+test spinbox-10.2 {SpinboxSetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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 index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+test spinbox-10.3 {SpinboxSetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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
+} -cleanup {
+ destroy .e
+} -result {4 7}
+test spinbox-10.4 {SpinboxSetValue procedure, updating selection} -setup {
+ unset -nocomplain x
+ spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -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
+} -cleanup {
+ destroy .e
+} -result {4 10}
+test spinbox-10.5 {SpinboxSetValue procedure, updating display position} -setup {
+ unset -nocomplain x
+ spinbox .e -highlightthickness 2 -bd 2
pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
.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
+} -cleanup {
+ destroy .e
+} -result {0}
+test spinbox-10.6 {SpinboxSetValue procedure, updating display position} -setup {
+ unset -nocomplain x
+ spinbox .e -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
pack .e
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e xview 10
@@ -1042,177 +2689,444 @@ test spinbox-10.6 {SpinboxSetValue procedure, updating display position} {
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
+} -cleanup {
+ destroy .e
+} -result {10}
+test spinbox-10.7 {SpinboxSetValue procedure, updating insertion cursor} -setup {
+ unset -nocomplain x
+ spinbox .e -highlightthickness 2 -bd 2
+ pack .e
+ update
+} -body {
+ .e configure -width 10 -font {Courier -12} -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
+} -cleanup {
+ destroy .e
+} -result {3}
+test spinbox-10.8 {SpinboxSetValue procedure, updating insertion cursor} -setup {
+ unset -nocomplain x
+ spinbox .e -highlightthickness 2 -bd 2
+ pack .e
+} -body {
+ .e configure -width 10 -font {Courier -12} -textvariable x
pack .e
.e insert 0 "abcdefghjklmnopqrstuvwxyz"
.e icursor 5
set x "123456"
.e index insert
-} {5}
+} -cleanup {
+ destroy .e
+} -result {5}
-test spinbox-11.1 {SpinboxEventProc procedure} {
- catch {destroy .e}
- spinbox .e
+test spinbox-11.1 {SpinboxEventProc procedure} -setup {
+ spinbox .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
+ pack .e
+} -body {
.e insert 0 abcdefg
destroy .e
update
-} {}
-test spinbox-11.2 {SpinboxEventProc procedure} {
- deleteWindows
+} -cleanup {
+ destroy .e
+} -result {}
+test spinbox-11.2 {SpinboxEventProc procedure} -setup {
+ set x {}
+} -body {
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} {
+} -cleanup {
+ destroy .e1
+} -result {.e1 #112233 {} {}}
+
+test spinbox-12.1 {SpinboxCmdDeletedProc procedure} -body {
+ button .b -text "xyz_123"
+ rename .b {}
+ list [info command .b*] [winfo children .]
+} -cleanup {
+ destroy .b
+} -result {{} {}}
+
+
+test spinbox-13.1 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {21}
+test spinbox-13.2 {GetSpinboxIndex procedure} -body {
+ spinbox .e
+ .e index abogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "abogus"}
+test spinbox-13.3 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 1
.e select to 6
.e index anchor
-} {1}
-test spinbox-13.4 {GetSpinboxIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {1}
+test spinbox-13.4 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e select from 4
.e select to 1
.e index anchor
-} {4}
-test spinbox-13.5 {GetSpinboxIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-13.5 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {15}
+test spinbox-13.6 {GetSpinboxIndex procedure} -setup {
+ spinbox .e
+} -body {
+ .e index ebogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "ebogus"}
+test spinbox-13.7 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {2}
+test spinbox-13.8 {GetSpinboxIndex procedure} -setup {
+ spinbox .e
+} -body {
+ .e index ibogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "ibogus"}
+test spinbox-13.9 {GetSpinboxIndex procedure} -setup {
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+} -body {
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+} -cleanup {
+ destroy .e
+} -result {1 6}
+
+test spinbox-13.10 {GetSpinboxIndex procedure} -constraints unix -body {
+# On unix, when selection is cleared, spinbox widget's internal
+# selection range is reset.
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+
+test spinbox-13.11 {GetSpinboxIndex procedure} -constraints win -body {
+# 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.
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ catch {selection get}
+ .e index sel.first
+} -cleanup {
+ destroy .e
+} -result {1}
+
+test spinbox-13.12 {GetSpinboxIndex procedure} -constraints unix -body {
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {selection isn't in widget .e}
+
+test spinbox-13.12.1 {GetSpinboxIndex procedure} -constraints unix -body {
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index bogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "bogus"}
+
+test spinbox-13.13 {GetSpinboxIndex procedure} -constraints win -body {
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "sbogus"}
+
+test spinbox-13.14 {GetSpinboxIndex procedure} -constraints win -body {
+# 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.
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+# Testing:
+ selection clear .e
+ selection get
+} -cleanup {
+ destroy .e
+} -returnCodes error -match glob -result {*}
+
+test spinbox-13.14.1 {GetSpinboxIndex procedure} -constraints win -body {
+# 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.
+# Previous settings:
+ spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} unix {
- # 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} win {
- # 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} unix {
- list [catch {.e index sbogus} msg] $msg
-} {1 {selection isn't in widget .e}}
-test spinbox-13.13 {GetSpinboxIndex procedure} win {
- list [catch {.e index sbogus} msg] $msg
-} {1 {bad spinbox index "sbogus"}}
-test spinbox-13.14 {GetSpinboxIndex procedure} win {
- 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} {
+# Testing:
+ selection clear .e
+ catch {selection get}
+ .e index sbogus
+} -cleanup {
+ destroy .e
+} -returnCodes error -match glob -result {*}
+
+test spinbox-13.15 {GetSpinboxIndex procedure} -body {
+ spinbox .e
+ selection clear .e
+ .e index @xyz
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "@xyz"}
+
+test spinbox-13.16 {GetSpinboxIndex procedure} -constraints fonts -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @4
-} {4}
-test spinbox-13.17 {GetSpinboxIndex procedure} {fonts} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-13.17 {GetSpinboxIndex procedure} -constraints fonts -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index @11
-} {4}
-test spinbox-13.18 {GetSpinboxIndex procedure} {fonts} {
+} -cleanup {
+ destroy .e
+} -result {4}
+test spinbox-13.18 {GetSpinboxIndex procedure} -constraints fonts -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {5}
+test spinbox-13.19 {GetSpinboxIndex procedure} -constraints fonts -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e index @[expr {[winfo width .e] - 6-11}]
+} -cleanup {
+ destroy .e
+} -result {8}
+test spinbox-13.20 {GetSpinboxIndex procedure} -constraints fonts -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
+ .e index @[expr {[winfo width .e] - 5}]
+} -cleanup {
+ destroy .e
+} -result {9}
+test spinbox-13.21 {GetSpinboxIndex procedure} -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.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} {
+} -cleanup {
+ destroy .e
+} -result {9}
+test spinbox-13.22 {GetSpinboxIndex procedure} -setup {
+ spinbox .e
+ pack .e
+ update
+} -body {
+ .e index 1xyz
+} -cleanup {
+ destroy .e
+} -returnCodes error -result {bad spinbox index "1xyz"}
+test spinbox-13.23 {GetSpinboxIndex procedure} -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index -10
-} {0}
-test spinbox-13.24 {GetSpinboxIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {0}
+test spinbox-13.24 {GetSpinboxIndex procedure} -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index 12
-} {12}
-test spinbox-13.25 {GetSpinboxIndex procedure} {
+} -cleanup {
+ destroy .e
+} -result {12}
+test spinbox-13.25 {GetSpinboxIndex procedure} -body {
+ spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
+ -font {Courier -12}
+ pack .e
+ .e insert 0 012345678901234567890
+ .e xview 4
+ update
.e index 49
-} {21}
+} -cleanup {
+ destroy .e
+} -result {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}
+test spinbox-14.1 {SpinboxFetchSelection procedure} -body {
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}
+} -cleanup {
+ destroy .e
+} -result {his is a test str}
+test spinbox-14.3 {SpinboxFetchSelection procedure} -setup {
+ set x {}
+ for {set i 1} {$i <= 500} {incr i} {
+ append x "This is line $i, out of 500\n"
+}
+} -body {
spinbox .e
- .e insert end $x
+ .e insert end $x
.e select from 0
.e select to end
string compare [selection get] $x
-} 0
+} -cleanup {
+ destroy .e
+} -result {0}
-test spinbox-15.1 {SpinboxLostSelection} {
- catch {destroy .e}
+test spinbox-15.1 {SpinboxLostSelection} -body {
spinbox .e
.e insert 0 "Text"
.e select from 0
@@ -1222,265 +3136,546 @@ test spinbox-15.1 {SpinboxLostSelection} {
.e select from 0
.e select to 4
lappend result [selection get]
-} {Text Text}
-
-# No tests for EventuallyRedraw.
+} -cleanup {
+ destroy .e
+} -result {Text Text}
-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 .............................
+test spinbox-16.1 {SpinboxVisibleRange procedure} -constraints fonts -body {
+ spinbox .e -width 10 -font {Helvetica -12}
+ pack .e
+ update
+ .e insert 0 "............................."
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 0.827586}
-test spinbox-16.2 {SpinboxVisibleRange procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.000000 0.827586}
+test spinbox-16.2 {SpinboxVisibleRange procedure} -body {
+ spinbox .e
format {%.6f %.6f} {*}[.e xview]
-} {0.000000 1.000000}
+} -cleanup {
+ destroy .e
+} -result {0.000000 1.000000}
-catch {destroy .e}
-spinbox .e -width 10 -xscrollcommand scroll -font $fixed
-pack .e
-update
-test spinbox-17.1 {SpinboxUpdateScrollbar procedure} {
+
+test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body {
+ spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e delete 0 end
.e insert 0 123
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.000000 1.000000}
-test spinbox-17.2 {SpinboxUpdateScrollbar procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.000000 1.000000}
+test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body {
+ spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e insert 0 0123456789abcdef
.e xview 3
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.187500 0.812500}
-test spinbox-17.3 {SpinboxUpdateScrollbar procedure} {
- .e delete 0 end
+} -cleanup {
+ destroy .e
+} -result {0.187500 0.812500}
+test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body {
+ spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
+ pack .e
.e insert 0 abcdefghijklmnopqrs
.e xview 6
update
format {%.6f %.6f} {*}$scrollInfo
-} {0.315789 0.842105}
-test spinbox-17.4 {SpinboxUpdateScrollbar procedure} {
+} -cleanup {
destroy .e
- set x "Background error did not happen"
+} -result {0.315789 0.842105}
+test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
proc bgerror msg {
global x
set x $msg
- }
+}
+} -body {
spinbox .e -width 5 -xscrollcommand thisisnotacommand
pack .e
update
- rename bgerror {}
list $x $errorInfo
-} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
+} -cleanup {
+ destroy .e
+ rename bgerror {}
+} -result {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
while executing
"thisisnotacommand 0.0 1.0"
(horizontal scrolling command executed by .e)}}
-set l [interp hidden]
-deleteWindows
-test spinbox-18.1 {Spinbox widget vs hiding} {
- destroy .e
+test spinbox-18.1 {Spinbox widget vs hiding} -setup {
spinbox .e
+} -body {
+ set l [interp hidden]
interp hide {} .e
destroy .e
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set res1 [list [winfo children .] [interp hidden]]
+ set res2 [list {} $l]
+ expr {$res1 == $res2}
+} -result {1}
##
## 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} {
+# 19.* test cases in previous version highly depended on the previous
+# test cases. This was replaced by inserting recently set configurations
+# that matters for the test case
+test spinbox-19.1 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
.e insert 0 a
set ::vVals
-} {.e 1 0 a {} a all key}
-test spinbox-19.2 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e 1 0 a {} a all key}
+
+test spinbox-19.2 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert 0 a ;# previous settings
.e insert 1 b
set ::vVals
-} {.e 1 1 ab a b all key}
-test spinbox-19.3 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e 1 1 ab a b all key}
+
+test spinbox-19.3 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert 0 ab ;# previous settings
.e insert end c
set ::vVals
-} {.e 1 2 abc ab c all key}
-test spinbox-19.4 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e 1 2 abc ab c all key}
+
+test spinbox-19.4 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert 0 abc ;# previous settings
.e insert 1 123
list $::vVals $::e
-} {{.e 1 1 a123bc abc 123 all key} a123bc}
-test spinbox-19.5 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {{.e 1 1 a123bc abc 123 all key} a123bc}
+
+test spinbox-19.5 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert 0 a123bc ;# previous settings
.e delete 2
set ::vVals
-} {.e 0 2 a13bc a123bc 2 all key}
-test spinbox-19.6 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e 0 2 a13bc a123bc 2 all key}
+
+test spinbox-19.6 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert 0 a13bc ;# previous settings
.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} {
+} -cleanup {
+ destroy .e
+} -result {.e 0 1 abc a13bc 13 key key}
+
+test spinbox-19.7 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focus \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abc ;# previous settings
set ::vVals {}
- .e configure -validate focus
.e insert end d
set ::vVals
-} {}
-test spinbox-19.8 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {}
+
+test spinbox-19.8 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e configure -validate focus ;# previous settings
+ .e insert end abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
set ::vVals
-} {.e -1 -1 abcd abcd {} focus focusin}
-test spinbox-19.9 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focus focusin}
+
+test spinbox-19.9 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focus \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ focus -force .e ;# previous settings
+ update ;# previous settings
+# update necessary to process FocusIn event
focus -force .
- # update necessary to process FocusOut event
+# 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} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focus focusout}
+
+test spinbox-19.10 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert end abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
set ::vVals
-} {.e -1 -1 abcd abcd {} all focusin}
-test spinbox-19.11 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} all focusin}
+
+test spinbox-19.11 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ .e insert end abcd ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
focus -force .
- # update necessary to process FocusOut event
+# 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} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} all focusout}
+
+test spinbox-19.12 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focusin \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert 0 abcd ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
set ::vVals
-} {.e -1 -1 abcd abcd {} focusin focusin}
-test spinbox-19.13 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focusin focusin}
+
+test spinbox-19.13 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focusin \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
set ::vVals {}
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
update
set ::vVals
-} {}
-.e configure -validate focuso
-test spinbox-19.14 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {}
+
+test spinbox-19.14 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
focus -force .e
- # update necessary to process FocusIn event
+# update necessary to process FocusIn event
update
set ::vVals
-} {}
-test spinbox-19.15 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {}
+
+test spinbox-19.15 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
focus -force .
- # update necessary to process FocusOut event
+# update necessary to process FocusOut event
update
set ::vVals
-} {.e -1 -1 abcd abcd {} focusout focusout}
-test spinbox-19.16 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {.e -1 -1 abcd abcd {} focusout focusout}
+
+# the same as 19.16 but added [.e validate] to returned list
+test spinbox-19.16 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
+ set ::vVals {} ;# previous settings
+ focus -force .e ;# previous settings
+# update necessary to process FocusIn event
+ update ;# previous settings
+ focus -force .
+# update necessary to process FocusOut event
+ update
list [.e validate] $::vVals
-} {1 {.e -1 -1 abcd abcd {} all forced}}
-test spinbox-19.17 {spinbox widget validation} {
+} -cleanup {
+ destroy .e
+} -result {1 {.e -1 -1 abcd abcd {} all forced}}
+
+
+test spinbox-19.17 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate focuso \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ .e insert end abcd ;# previous settings
set ::e newdata
list [.e cget -validate] $::vVals
-} {focusout {.e -1 -1 newdata abcd {} focusout forced}}
+} -cleanup {
+ destroy .e
+} -result {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} {
+# proc doval changed - returns 0
+test spinbox-19.18 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate all \
+ -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ set ::e newdata ;# previous settings
+ .e configure -validate all
set ::e nextdata
list [.e cget -validate] $::vVals
-} {none {.e -1 -1 nextdata newdata {} all forced}}
+} -cleanup {
+ destroy .e
+} -result {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} {
+# proc doval2 used
+test spinbox-19.19 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ spinbox .e -validate all \
+ -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+ pack .e
+ set ::e nextdata ;# previous settings
+
+ .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V]
.e validate
list [.e cget -validate] [.e get] $::vVals
-} {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
-
-.e configure -validate all
+} -cleanup {
+ destroy .e
+} -result {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
## 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} {
+test spinbox-19.20 {spinbox widget validation} -setup {
+ unset -nocomplain ::e ::vVals
+} -body {
+ 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
+ set ::e nextdata ;# previous settings
+ .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev
+ .e validate ;# previous settings
+
+ .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}}
+} -cleanup {
+ destroy .e
+} -result {all testdata mydata {.e -1 -1 testdata mydata {} all forced}}
+##
+## End validation tests
+##
-# 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} {
+test spinbox-20.1 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %2f
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.2 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %2.2f
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.3 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %.2f
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.4 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %2.f
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.5 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %2e-1f
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad spinbox format specifier "%2e-1f"}
+test spinbox-20.6 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format 2.2
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad spinbox format specifier "2.2"}
+test spinbox-20.7 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %2.-2f
+} -cleanup {
+ destroy .e
+} -returnCodes {error} -result {bad spinbox format specifier "%2.-2f"}
+test spinbox-20.8 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format %-2.02f
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.9 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format "% 2.02f"
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.10 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format "% -2.200f"
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.11 {spinbox config, -format specifier} -body {
+ spinbox .e
+ .e config -format "%09.200f"
+} -cleanup {
+ destroy .e
+} -returnCodes ok
+test spinbox-20.12 {spinbox config, -format specifier does something} -setup {
+ spinbox .e
set out {}
+} -body {
.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
@@ -1489,10 +3684,12 @@ test spinbox-20.12 {spinbox config, -format specifier does something} {
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} {
+} -cleanup {
destroy .e
+} -result {0 01 3 003}
+
+
+test spinbox-21.1 {spinbox button, out of range checking} -body {
spinbox .e -from -10 -to 20 -increment 2
set out {}
lappend out [.e get]; # -10
@@ -1550,50 +3747,60 @@ test spinbox-21.1 {spinbox button, out of range checking} {
lappend out [.e get]; # 18
.e invoke buttonup; # no wrap
lappend out [.e get]; # 20
+} -cleanup {
+ destroy .e
+} -result {-10 20 20 -10 -10 -10 20 20 18 -10 -10 -8 -10 -8 -10 20 18 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} {
+test spinbox-22.1 {spinbox config, -from changes SF bug 559078} -body {
set val 5
- destroy .s
- spinbox .s -from 1 -to 10 -textvariable val
+ spinbox .e -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
+} -cleanup {
+ destroy .e
+} -result {5}
+test spinbox-22.2 {spinbox config, -from changes SF bug 559078} -body {
+ set val 5
+ spinbox .e -from 1 -to 10 -textvariable val
+ .e 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
+} -cleanup {
+ destroy .e
+} -result {5}
+test spinbox-22.3 {spinbox config, -from changes SF bug 559078} -body {
+ set val 5
+ spinbox .e -from 3 -to 10 -textvariable val
+ .e configure -from 6 -to 10
set val
-} {6}
-
-test entry-23.1 {selection present while disabled, bug 637828} {
+} -cleanup {
destroy .e
- entry .e
+} -result {6}
+
+test spinbox-23.1 {selection present while disabled, bug 637828} -body {
+ spinbox .e
.e insert end 0123456789
.e select from 3
.e select to 6
set out [.e selection present]
.e configure -state disabled
- # still return 1 when disabled, because 'selection get' will work,
- # but selection cannot be changed (new behavior since 8.4)
+# still return 1 when disabled, because 'selection get' will work,
+# but selection cannot be changed (new behavior since 8.4)
.e select to 9
lappend out [.e selection present] [selection get]
-} {1 1 345}
+} -cleanup {
+ destroy .e
+} -result {1 1 345}
-destroy .e
-catch {unset ::e ::vVals}
-
-##
-## End validation tests
-##
+# Collected comments about lacks from the test
# XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc,
# and SpinboxTextVarProc.
+# No tests for DisplaySpinbox.
+# XXX Still need to write tests for SpinboxScanTo and SpinboxSelectTo.
+# No tests for EventuallyRedraw
-option clear
-
+# option clear
# cleanup
cleanupTests
return
+
+
diff --git a/tests/text.test b/tests/text.test
index 17fcf29..6cd1a07 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6,344 +6,1443 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
-# Create entries in the option database to be sure that geometry options
-# like border width have predictable values.
-
-option add *Text.borderWidth 2
-option add *Text.highlightThickness 2
-option add *Text.font {Courier -12}
-
-text .t -width 20 -height 10
-pack append . .t {top expand fill}
-update
-.t debug on
-wm geometry . {}
-
# The statements below reset the main window; it's needed if the window
# manager is mwm to make mwm forget about a previous minimum size setting.
-
+wm geometry . {}
wm withdraw .
wm minsize . 1 1
wm positionfrom . user
wm deiconify .
+
+test text-1.1 {configuration option: "autoseparators"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -autoseparators yes
+ .t cget -autoseparators
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-1.2 {configuration option: "autoseparators"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -autoseparators nah
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.3 {configuration option: "background"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -background #ff00ff
+ .t cget -background
+} -cleanup {
+ destroy .t
+} -result {#ff00ff}
+test text-1.4 {configuration option: "background"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -background <gorp>
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.5 {configuration option: "bd"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -bd 4
+ .t cget -bd
+} -cleanup {
+ destroy .t
+} -result {4}
+test text-1.6 {configuration option: "bd"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -bd foo
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.7 {configuration option: "bg"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -bg blue
+ .t cget -bg
+} -cleanup {
+ destroy .t
+} -result {blue}
+test text-1.8 {configuration option: "bg"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -bg #xx
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.9 {configuration option: "blockcursor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -blockcursor 0
+ .t cget -blockcursor
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.10 {configuration option: "blockcursor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -blockcursor xx
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.11 {configuration option: "borderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -borderwidth 7
+ .t cget -borderwidth
+} -cleanup {
+ destroy .t
+} -result {7}
+test text-1.12 {configuration option: "borderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -borderwidth ++
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.13 {configuration option: "cursor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -cursor watch
+ .t cget -cursor
+} -cleanup {
+ destroy .t
+} -result {watch}
+test text-1.14 {configuration option: "cursor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -cursor lousy
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.15 {configuration option: "exportselection"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -exportselection no
+ .t cget -exportselection
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.16 {configuration option: "exportselection"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -exportselection maybe
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.17 {configuration option: "fg"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -fg red
+ .t cget -fg
+} -cleanup {
+ destroy .t
+} -result {red}
+test text-1.18 {configuration option: "fg"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -fg stupid
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.19 {configuration option: "font"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -font fixed
+ .t cget -font
+} -cleanup {
+ destroy .t
+} -result {fixed}
+test text-1.20 {configuration option: "font"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -font {}
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.21 {configuration option: "foreground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -foreground #012
+ .t cget -foreground
+} -cleanup {
+ destroy .t
+} -result {#012}
+test text-1.22 {configuration option: "foreground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -foreground bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.23 {configuration option: "height"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -height 5
+ .t cget -height
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-1.24 {configuration option: "height"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -height bad
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.25 {configuration option: "highlightbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightbackground #123
+ .t cget -highlightbackground
+} -cleanup {
+ destroy .t
+} -result {#123}
+test text-1.26 {configuration option: "highlightbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightbackground bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.27 {configuration option: "highlightcolor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightcolor #234
+ .t cget -highlightcolor
+} -cleanup {
+ destroy .t
+} -result {#234}
+test text-1.28 {configuration option: "highlightcolor"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightcolor bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.29 {configuration option: "highlightthickness"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightthickness -2
+ .t cget -highlightthickness
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.30 {configuration option: "highlightthickness"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -highlightthickness bad
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.31 {configuration option: "inactiveselectbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -inactiveselectbackground #ffff01234567
+ .t cget -inactiveselectbackground
+} -cleanup {
+ destroy .t
+} -result {#ffff01234567}
+test text-1.32 {configuration option: "inactiveselectbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -inactiveselectbackground bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.33 {configuration option: "insertbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertbackground green
+ .t cget -insertbackground
+} -cleanup {
+ destroy .t
+} -result {green}
+test text-1.34 {configuration option: "insertbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertbackground <bogus>
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.35 {configuration option: "insertborderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertborderwidth 45
+ .t cget -insertborderwidth
+} -cleanup {
+ destroy .t
+} -result {45}
+test text-1.36 {configuration option: "insertborderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertborderwidth bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.37 {configuration option: "insertofftime"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertofftime 100
+ .t cget -insertofftime
+} -cleanup {
+ destroy .t
+} -result {100}
+test text-1.38 {configuration option: "insertofftime"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertofftime 2.4
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.39 {configuration option: "insertontime"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertontime 47
+ .t cget -insertontime
+} -cleanup {
+ destroy .t
+} -result {47}
+test text-1.40 {configuration option: "insertontime"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertontime e1
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.41 {configuration option: "insertwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertwidth 2.3
+ .t cget -insertwidth
+} -cleanup {
+ destroy .t
+} -result {2}
+test text-1.42 {configuration option: "insertwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertwidth 47d
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.43 {configuration option: "maxundo"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -maxundo 5
+ .t cget -maxundo
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-1.44 {configuration option: "maxundo"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -maxundo noway
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.45 {configuration option: "padx"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -padx 3.4
+ .t cget -padx
+} -cleanup {
+ destroy .t
+} -result {3}
+test text-1.46 {configuration option: "padx"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -padx 2.4.
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.47 {configuration option: "pady"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -pady 82
+ .t cget -pady
+} -cleanup {
+ destroy .t
+} -result {82}
+test text-1.48 {configuration option: "pady"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -pady bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.49 {configuration option: "relief"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -relief raised
+ .t cget -relief
+} -cleanup {
+ destroy .t
+} -result {raised}
+test text-1.50 {configuration option: "relief"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -relief bumpy
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.51 {configuration option: "selectbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectbackground #ffff01234567
+ .t cget -selectbackground
+} -cleanup {
+ destroy .t
+} -result {#ffff01234567}
+test text-1.52 {configuration option: "selectbackground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectbackground bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.53 {configuration option: "selectborderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectborderwidth 21
+ .t cget -selectborderwidth
+} -cleanup {
+ destroy .t
+} -result {21}
+test text-1.54 {configuration option: "selectborderwidth"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectborderwidth 3x
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.55 {configuration option: "selectforeground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectforeground yellow
+ .t cget -selectforeground
+} -cleanup {
+ destroy .t
+} -result {yellow}
+test text-1.56 {configuration option: "selectforeground"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -selectforeground #12345
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.57 {configuration option: "spacing1"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing1 20
+ .t cget -spacing1
+} -cleanup {
+ destroy .t
+} -result {20}
+test text-1.58 {configuration option: "spacing1"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing1 1.3x
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.59 {configuration option: "spacing1"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing1 -5
+ .t cget -spacing1
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.60 {configuration option: "spacing1"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing1 bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.61 {configuration option: "spacing2"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing2 5
+ .t cget -spacing2
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-1.62 {configuration option: "spacing2"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing2 bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.63 {configuration option: "spacing2"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing2 -1
+ .t cget -spacing2
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.64 {configuration option: "spacing2"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing2 bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.65 {configuration option: "spacing3"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing3 20
+ .t cget -spacing3
+} -cleanup {
+ destroy .t
+} -result {20}
+test text-1.66 {configuration option: "spacing3"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing3 bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.67 {configuration option: "spacing3"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing3 -10
+ .t cget -spacing3
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-1.68 {configuration option: "spacing3"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -spacing3 bogus
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.69 {configuration option: "state"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -state d
+ .t cget -state
+} -cleanup {
+ destroy .t
+} -result {disabled}
+test text-1.70 {configuration option: "state"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -state foo
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.71 {configuration option: "tabs"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -tabs {1i 2i 3i 4i}
+ .t cget -tabs
+} -cleanup {
+ destroy .t
+} -result {1i 2i 3i 4i}
+test text-1.72 {configuration option: "tabs"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -tabs bad_tabs
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.73 {configuration option: "tabstyle"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -tabstyle wordprocessor
+ .t cget -tabstyle
+} -cleanup {
+ destroy .t
+} -result {wordprocessor}
+test text-1.74 {configuration option: "tabstyle"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -tabstyle garbage
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.75 {configuration option: "undo"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -undo 1
+ .t cget -undo
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-1.76 {configuration option: "undo"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -undo eh
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.77 {configuration option: "width"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -width 73
+ .t cget -width
+} -cleanup {
+ destroy .t
+} -result {73}
+test text-1.78 {configuration option: "width"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -width 2.4
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.79 {configuration option: "wrap"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -wrap w
+ .t cget -wrap
+} -cleanup {
+ destroy .t
+} -result {word}
+test text-1.80 {configuration option: "wrap"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -wrap bad_wrap
+} -cleanup {
+ destroy .t
+} -match glob -returnCodes {error} -result {*}
+test text-1.81 {text options} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -takefocus "any old thing"
+ .t cget -takefocus
+} -cleanup {
+ destroy .t
+} -result {any old thing}
+test text-1.82 {text options} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -xscrollcommand "x scroll command"
+ .t configure -xscrollcommand
+} -cleanup {
+ destroy .t
+} -result {-xscrollcommand xScrollCommand ScrollCommand {} {x scroll command}}
+test text-1.83 {text options} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -yscrollcommand "test command"
+ .t configure -yscrollcommand
+} -cleanup {
+ destroy .t
+} -result {-yscrollcommand yScrollCommand ScrollCommand {} {test command}}
+test text-1.83.1 {configuration option: "insertunfocussed"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertunfocussed none
+ .t cget -insertunfocussed
+} -cleanup {
+ destroy .t
+} -result none
+test text-1.84 {configuration option: "insertunfocussed"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertunfocussed hollow
+ .t cget -insertunfocussed
+} -cleanup {
+ destroy .t
+} -result hollow
+test text-1.85 {configuration option: "insertunfocussed"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t configure -insertunfocussed solid
+ .t cget -insertunfocussed
+} -cleanup {
+ destroy .t
+} -result solid
+test text-1.86 {configuration option: "insertunfocussed"} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -returnCodes error -body {
+ .t configure -insertunfocussed gorp
+} -cleanup {
+ destroy .t
+} -result {bad insertunfocussed "gorp": must be hollow, none, or solid}
+
+
+test text-2.1 {Tk_TextCmd procedure} -body {
+ text
+} -returnCodes {error} -result {wrong # args: should be "text pathName ?-option value ...?"}
+test text-2.2 {Tk_TextCmd procedure} -body {
+ text foobar
+} -returnCodes {error} -result {bad window path name "foobar"}
+test text-2.3 {Tk_TextCmd procedure} -body {
+ text .t -gorp nofun
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {unknown option "-gorp"}
+test text-2.4 {Tk_TextCmd procedure} -body {
+ catch {text .t -gorp nofun}
+ winfo exists .t
+} -cleanup {
+ destroy .t
+} -result 0
+test text-2.5 {Tk_TextCmd procedure} -body {
+ text .t -bd 2 -fg red
+} -cleanup {
+ destroy .t
+} -returnCodes ok -result {.t}
+test text-2.6 {Tk_TextCmd procedure} -body {
+ text .t -bd 2 -fg red
+ list [lindex [.t config -bd] 4] [lindex [.t config -fg] 4]
+} -cleanup {
+ destroy .t
+} -result {2 red}
+test text-2.7 {Tk_TextCmd procedure} -constraints {
+ win
+} -body {
+ catch {destroy .t}
+ text .t
+ .t tag cget sel -relief
+} -cleanup {
+ destroy .t
+} -result {flat}
+test text-2.8 {Tk_TextCmd procedure} -constraints {
+ aqua
+} -body {
+ catch {destroy .t}
+ text .t
+ .t tag cget sel -relief
+} -cleanup {
+ destroy .t
+} -result {solid}
+test text-2.9 {Tk_TextCmd procedure} -constraints {
+ unix
+} -body {
+ catch {destroy .t}
+ text .t
+ .t tag cget sel -relief
+} -cleanup {
+ destroy .t
+} -result {raised}
+test text-2.10 {Tk_TextCmd procedure} -body {
+ list [text .t] [winfo class .t]
+} -cleanup {
+ destroy .t
+} -result {.t Text}
+
+
+test text-3.1 {TextWidgetCmd procedure, basics} -setup {
+ text .t
+} -body {
+ .t
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t option ?arg ...?"}
+test text-3.2 {TextWidgetCmd procedure} -setup {
+ text .t
+} -body {
+ .t gorp 1.0 z 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}
+
+test text-4.1 {TextWidgetCmd procedure, "bbox" option} -setup {
+ text .t
+} -body {
+ .t bbox
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t bbox index"}
+test text-4.2 {TextWidgetCmd procedure, "bbox" option} -setup {
+ text .t
+} -body {
+ .t bbox a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t bbox index"}
+test text-4.3 {TextWidgetCmd procedure, "bbox" option} -setup {
+ text .t
+} -body {
+ .t bbox bad_mark
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "bad_mark"}
+
+test text-5.1 {TextWidgetCmd procedure, "cget" option} -setup {
+ text .t
+} -body {
+ .t cget
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t cget option"}
+test text-5.2 {TextWidgetCmd procedure, "cget" option} -setup {
+ text .t
+} -body {
+ .t cget a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t cget option"}
+test text-5.3 {TextWidgetCmd procedure, "cget" option} -setup {
+ text .t
+} -body {
+ .t cget -gorp
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {unknown option "-gorp"}
+test text-5.4 {TextWidgetCmd procedure, "cget" option} -setup {
+ text .t
+} -body {
+ .t configure -bd 17
+ .t cget -bd
+} -cleanup {
+ destroy .t
+} -result {17}
-entry .t.e
-.t.e insert end abcdefg
-.t.e select from 0
-.t insert 1.0 "Line 1
+test text-6.1 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t compare a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t compare index1 op index2"}
+test text-6.2 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t compare a b c d
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t compare index1 op index2"}
+test text-6.3 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t compare @x == 1.0
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@x"}
+test text-6.4 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t compare 1.0 < @y
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@y"}
+test text-6.5 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
abcdefghijklm
12345
Line 4
bOy GIrl .#@? x_yz
!@#$%
Line 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}
- {-blockcursor 0 0 xx}
- {-borderwidth 7 7 ++}
- {-cursor watch watch lousy}
- {-exportselection no 0 maybe}
- {-fg red red stupid}
- {-font fixed fixed {}}
- {-foreground #012 #012 bogus}
- {-height 5 5 bad}
- {-highlightbackground #123 #123 bogus}
- {-highlightcolor #234 #234 bogus}
- {-highlightthickness -2 0 bad}
- {-inactiveselectbackground #ffff01234567 #ffff01234567 bogus}
- {-insertbackground green green <bogus>}
- {-insertborderwidth 45 45 bogus}
- {-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}
- {-selectbackground #ffff01234567 #ffff01234567 bogus}
- {-selectborderwidth 21 21 3x}
- {-selectforeground yellow yellow #12345}
- {-spacing1 20 20 1.3x}
- {-spacing1 -5 0 bogus}
- {-spacing2 5 5 bogus}
- {-spacing2 -1 0 bogus}
- {-spacing3 20 20 bogus}
- {-spacing3 -10 0 bogus}
- {-state d disabled foo}
- {-tabs {1i 2i 3i 4i} {1i 2i 3i 4i} bad_tabs}
- {-tabstyle wordprocessor wordprocessor garbage}
- {-undo 1 1 eh}
- {-width 73 73 2.4}
- {-wrap w word bad_wrap}
-} {
- test text-1.[incr i] {text options} {
- set result {}
- lappend result [catch {.t2 configure [lindex $test 0] [lindex $test 3]}]
- .t2 configure [lindex $test 0] [lindex $test 1]
- lappend result [.t2 cget [lindex $test 0]]
- } [list 1 [lindex $test 2]]
-}
-test text-1.[incr i] {text options} {
- .t2 configure -takefocus "any old thing"
- .t2 cget -takefocus
-} {any old thing}
-test text-1.[incr i] {text options} {
- .t2 configure -xscrollcommand "x scroll command"
- .t2 configure -xscrollcommand
-} {-xscrollcommand xScrollCommand ScrollCommand {} {x scroll command}}
-test text-1.[incr i] {text options} {
- .t2 configure -yscrollcommand "test command"
- .t2 configure -yscrollcommand
-} {-yscrollcommand yScrollCommand ScrollCommand {} {test command}}
-test text-1.[incr i] {text options} {
- set result {}
- foreach i [.t2 configure] {
- lappend result [lindex $i 4]
- }
- set result
-} {1 blue {} {} 0 7 watch {} 0 {} fixed #012 5 #123 #234 0 #ffff01234567 green 45 100 47 2 5 3 82 raised #ffff01234567 21 yellow 0 0 0 0 {} disabled {1i 2i 3i 4i} wordprocessor {any old thing} 1 73 word {x scroll command} {test command}}
-
-test text-2.1 {Tk_TextCmd procedure} {
- list [catch {text} msg] $msg
-} {1 {wrong # args: should be "text pathName ?options?"}}
-test text-2.2 {Tk_TextCmd procedure} {
- list [catch {text foobar} msg] $msg
-} {1 {bad window path name "foobar"}}
-test text-2.3 {Tk_TextCmd procedure} {
- catch {destroy .t2}
- list [catch {text .t2 -gorp nofun} msg] $msg [winfo exists .t2]
-} {1 {unknown option "-gorp"} 0}
-test text-2.4 {Tk_TextCmd procedure} {
- catch {destroy .t2}
- list [catch {text .t2 -bd 2 -fg red} msg] $msg \
- [lindex [.t2 config -bd] 4] [lindex [.t2 config -fg] 4]
-} {0 .t2 2 red}
-if {$tcl_platform(platform) == "windows"} {
- set relief flat
-} elseif {[tk windowingsystem] eq "aqua"} {
- set relief solid
-} else {
- set relief raised
-}
-test text-2.5 {Tk_TextCmd procedure} {
- catch {destroy .t2}
- text .t2
- .t2 tag cget sel -relief
-} $relief
-test text-2.6 {Tk_TextCmd procedure} {
- catch {destroy .t2}
- list [text .t2] [winfo class .t2]
-} {.t2 Text}
-
-test text-3.1 {TextWidgetCmd procedure, basics} {
- list [catch {.t} msg] $msg
-} {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, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}}
-
-test text-4.1 {TextWidgetCmd procedure, "bbox" option} {
- list [catch {.t bbox} msg] $msg
-} {1 {wrong # args: should be ".t bbox index"}}
-test text-4.2 {TextWidgetCmd procedure, "bbox" option} {
- list [catch {.t bbox a b} msg] $msg
-} {1 {wrong # args: should be ".t bbox index"}}
-test text-4.3 {TextWidgetCmd procedure, "bbox" option} {
- list [catch {.t bbox bad_mark} msg] $msg
-} {1 {bad text index "bad_mark"}}
-
-test text-5.1 {TextWidgetCmd procedure, "cget" option} {
- list [catch {.t cget} msg] $msg
-} {1 {wrong # args: should be ".t cget option"}}
-test text-5.2 {TextWidgetCmd procedure, "cget" option} {
- list [catch {.t cget a b} msg] $msg
-} {1 {wrong # args: should be ".t cget option"}}
-test text-5.3 {TextWidgetCmd procedure, "cget" option} {
- list [catch {.t cget -gorp} msg] $msg
-} {1 {unknown option "-gorp"}}
-test text-5.4 {TextWidgetCmd procedure, "cget" option} {
- .t configure -bd 17
- .t cget -bd
-} {17}
-.t configure -bd [lindex [.t configure -bd] 3]
-
-test text-6.1 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare a b} msg] $msg
-} {1 {wrong # args: should be ".t compare index1 op index2"}}
-test text-6.2 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare a b c d} msg] $msg
-} {1 {wrong # args: should be ".t compare index1 op index2"}}
-test text-6.3 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare @x == 1.0} msg] $msg
-} {1 {bad text index "@x"}}
-test text-6.4 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare 1.0 < @y} msg] $msg
-} {1 {bad text index "@y"}}
-test text-6.5 {TextWidgetCmd procedure, "compare" option} {
list [.t compare 1.1 < 1.0] [.t compare 1.1 < 1.1] [.t compare 1.1 < 1.2]
-} {0 0 1}
-test text-6.6 {TextWidgetCmd procedure, "compare" option} {
+} -cleanup {
+ destroy .t
+} -result {0 0 1}
+test text-6.6 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
list [.t compare 1.1 <= 1.0] [.t compare 1.1 <= 1.1] [.t compare 1.1 <= 1.2]
-} {0 1 1}
-test text-6.7 {TextWidgetCmd procedure, "compare" option} {
+} -cleanup {
+ destroy .t
+} -result {0 1 1}
+test text-6.7 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
list [.t compare 1.1 == 1.0] [.t compare 1.1 == 1.1] [.t compare 1.1 == 1.2]
-} {0 1 0}
-test text-6.8 {TextWidgetCmd procedure, "compare" option} {
+} -cleanup {
+ destroy .t
+} -result {0 1 0}
+test text-6.8 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
list [.t compare 1.1 >= 1.0] [.t compare 1.1 >= 1.1] [.t compare 1.1 >= 1.2]
-} {1 1 0}
-test text-6.9 {TextWidgetCmd procedure, "compare" option} {
+} -cleanup {
+ destroy .t
+} -result {1 1 0}
+test text-6.9 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
list [.t compare 1.1 > 1.0] [.t compare 1.1 > 1.1] [.t compare 1.1 > 1.2]
-} {1 0 0}
-test text-6.10 {TextWidgetCmd procedure, "compare" option} {
+} -cleanup {
+ destroy .t
+} -result {1 0 0}
+test text-6.10 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
list [.t com 1.1 != 1.0] [.t compare 1.1 != 1.1] [.t compare 1.1 != 1.2]
-} {1 0 1}
-test text-6.11 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare 1.0 <x 1.2} msg] $msg
-} {1 {bad comparison operator "<x": must be <, <=, ==, >=, >, or !=}}
-test text-6.12 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare 1.0 >> 1.2} msg] $msg
-} {1 {bad comparison operator ">>": must be <, <=, ==, >=, >, or !=}}
-test text-6.13 {TextWidgetCmd procedure, "compare" option} {
- list [catch {.t compare 1.0 z 1.2} msg] $msg
-} {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 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}}
-
+} -cleanup {
+ destroy .t
+} -result {1 0 1}
+test text-6.11 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t compare 1.0 <x 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad comparison operator "<x": must be <, <=, ==, >=, >, or !=}
+test text-6.12 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t compare 1.0 >> 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad comparison operator ">>": must be <, <=, ==, >=, >, or !=}
+test text-6.13 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t compare 1.0 z 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}
+test text-6.14 {TextWidgetCmd procedure, "compare" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t co 1.0 z 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}
# "configure" option is already covered above
-test text-7.1 {TextWidgetCmd procedure, "debug" option} {
- list [catch {.t debug 0 1} msg] $msg
-} {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 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}}
-test text-7.3 {TextWidgetCmd procedure, "debug" option} {
+test text-7.1 {TextWidgetCmd procedure, "debug" option} -setup {
+ text .t
+} -body {
+ .t debug 0 1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t debug boolean"}
+test text-7.2 {TextWidgetCmd procedure, "debug" option} -setup {
+ text .t
+} -body {
+ .t de 0 1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}
+test text-7.3 {TextWidgetCmd procedure, "debug" option} -setup {
+ text .t
+} -body {
.t debug true
.t deb
-} 1
-test text-7.4 {TextWidgetCmd procedure, "debug" option} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-7.4 {TextWidgetCmd procedure, "debug" option} -setup {
+ text .t
+} -body {
.t debug false
.t debug
-} 0
-.t debug
-
-test text-8.1 {TextWidgetCmd procedure, "delete" option} {
- list [catch {.t delete} msg] $msg
-} {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 {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"}}
-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} {
+} -cleanup {
+ destroy .t
+} -result {0}
+
+
+test text-8.1 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t delete
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t delete index1 ?index2 ...?"}
+test text-8.2 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t delete a b c
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "a"}
+test text-8.3 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t delete @x 2.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@x"}
+test text-8.4 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345"
+ .t delete 2.3 @y
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@y"}
+test text-8.5 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t configure -state disabled
.t delete 2.3
.t g 2.0 2.end
-} abcdefghijklm
-.t configure -state normal
-test text-8.6 {TextWidgetCmd procedure, "delete" option} {
+} -cleanup {
+ destroy .t
+} -result {abcdefghijklm}
+test text-8.6 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t delete 2.3
.t get 2.0 2.end
-} abcefghijklm
-test text-8.7 {TextWidgetCmd procedure, "delete" option} {
+} -cleanup {
+ destroy .t
+} -result {abcefghijklm}
+test text-8.7 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t delete 2.1 2.3
.t get 2.0 2.end
-} aefghijklm
-test text-8.8 {TextWidgetCmd procedure, "delete" option} {
+} -cleanup {
+ destroy .t
+} -result {adefghijklm}
+test text-8.8 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345"
# 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} {
+ .t delete 2.1 2.3 foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "foo"}
+test text-8.9 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345"
+# All indices are checked before we actually delete anything
+ catch {.t delete 2.1 2.3 foo}
+ .t get 2.0 2.end
+} -cleanup {
+ destroy .t
+} -result {abcdefghijklm}
+test text-8.10 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
# auto-forward one byte if the last "pair" is just one
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {foo
+aefghijklm}
+test text-8.11 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# all indices will be ordered before deletion
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {foo
+dfgjklm}
+test text-8.12 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# and check again with even pairs
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {foo
+cdfgjklm}
+test text-8.13 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# we should get the longest range on equal start indices
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {foo
+fghijklm}
+test text-8.14 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# we should get the longest range on equal start indices
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {foghijklm}
+test text-8.15 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# we should get the longest range on equal start indices
- .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .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} {
+} -cleanup {
+ destroy .t
+} -result {ffghijklm}
+test text-8.16 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# 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 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} {
+} -cleanup {
+ destroy .t
+} -result {foo
+ijklm}
+test text-8.17 {TextWidgetCmd procedure, "delete" option} -setup {
+ text .t
+} -body {
# 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 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-8.17 {TextWidgetCmd procedure, "replace" option} {
- list [catch {.t replace 1.3 2.3} err] $err
-} {1 {wrong # args: should be ".t replace index1 index2 chars ?tagList chars tagList ...?"}}
-test text-8.18 {TextWidgetCmd procedure, "replace" option} {
- list [catch {.t replace 3.1 2.3 foo} err] $err
-} {1 {Index "2.3" before "3.1" in the text}}
-test text-8.19 {TextWidgetCmd procedure, "replace" option} {
- list [catch {.t replace 2.1 2.3 foo} err] $err
-} {0 {}}
-.t delete 1.0 end; .t insert 1.0 $prevtext
-test text-8.20 {TextWidgetCmd procedure, "replace" option with undo} {
+} -cleanup {
+ destroy .t
+} -result {foo
+ghijklm}
+test text-8.18 {TextWidgetCmd procedure, "replace" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345"
+ .t replace 1.3 2.3
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t replace index1 index2 chars ?tagList chars tagList ...?"}
+test text-8.19 {TextWidgetCmd procedure, "replace" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345"
+ .t replace 3.1 2.3 foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {Index "2.3" before "3.1" in the text}
+test text-8.20 {TextWidgetCmd procedure, "replace" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t replace 2.1 2.3 foo
+} -cleanup {
+ destroy .t
+} -returnCodes ok -result {}
+test text-8.21 {TextWidgetCmd procedure, "replace" option with undo} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+abcdefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ set prevtext [.t get 1.0 end-1c]
.t configure -undo 0
.t configure -undo 1
# Ensure it is treated as a single undo action
.t replace 2.1 2.3 foo
.t edit undo
- .t configure -undo 0
string equal [.t get 1.0 end-1c] $prevtext
-} {1}
-test text-8.21 {TextWidgetCmd procedure, "replace" option with undo} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-8.22 {TextWidgetCmd procedure, "replace" option with undo} -setup {
+ text .t
+ set res {}
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t configure -undo 0
.t configure -undo 1
.t replace 2.1 2.3 foo
@@ -352,15 +1451,25 @@ test text-8.21 {TextWidgetCmd procedure, "replace" option with undo} {
# to do this, then we should be able to change this test. The
# behaviour tested for here is not, strictly speaking, documented.
rename .t test.t
- set res {}
proc .t {args} { lappend ::res $args ; uplevel 1 test.t $args }
.t edit undo
+ return $res
+} -cleanup {
rename .t {}
rename test.t .t
- .t configure -undo 0
- set res
-} {{edit undo} {delete 2.1 2.4} {mark set insert 2.1} {see insert} {insert 2.1 ef} {mark set insert 2.3} {see insert}}
-test text-8.22 {TextWidgetCmd procedure, "replace" option with undo} {
+ destroy .t
+} -result {{edit undo} {delete 2.1 2.4} {mark set insert 2.1} {see insert} {insert 2.1 ef} {mark set insert 2.3} {see insert}}
+test text-8.23 {TextWidgetCmd procedure, "replace" option with undo} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ set prevtext [.t get 1.0 end-1c]
.t configure -undo 0
.t configure -undo 1
# Ensure that undo (even composite undo like 'replace')
@@ -370,330 +1479,1150 @@ test text-8.22 {TextWidgetCmd procedure, "replace" option with undo} {
.t edit undo
.t configure -start {} -end {}
.t configure -undo 0
- if {![string equal [.t get 1.0 end-1c] $prevtext]} {
- set res [list [.t get 1.0 end-1c] ne $prevtext]
- } else {
- set res 1
- }
-} {1}
-.t delete 1.0 end; .t insert 1.0 $prevtext
-test text-8.23 {TextWidgetCmd procedure, "replace" option with peers, undo} {
+ string equal [.t get 1.0 end-1c] $prevtext
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-8.24 {TextWidgetCmd procedure, "replace" option with peers, undo} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ set prevtext [.t get 1.0 end-1c]
.t configure -undo 0
.t configure -undo 1
.t peer create .tt -undo 1
- # Ensure that undo (even composite undo like 'replace')
- # works when the the event took place in one peer, which
- # is then deleted, before the undo takes place in another peer.
+# Ensure that undo (even composite undo like 'replace')
+# works when the the event took place in one peer, which
+# is then deleted, before the undo takes place in another peer.
.tt replace 2.1 2.3 foo
.tt configure -start 1 -end 1
destroy .tt
.t edit undo
.t configure -start {} -end {}
.t configure -undo 0
- if {![string equal [.t get 1.0 end-1c] $prevtext]} {
- set res [list [.t get 1.0 end-1c] ne $prevtext]
- } else {
- set res 1
- }
-} {1}
-.t delete 1.0 end; .t insert 1.0 $prevtext
-test text-8.24 {TextWidgetCmd procedure, "replace" option with peers, undo} {
+ string equal [.t get 1.0 end-1c] $prevtext
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-8.25 {TextWidgetCmd procedure, "replace" option with peers, undo} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ set prevtext [.t get 1.0 end-1c]
.t configure -undo 0
.t configure -undo 1
.t peer create .tt -undo 1
- # Ensure that undo (even composite undo like 'replace')
- # works when the the event took place in one peer, which
- # is then deleted, before the undo takes place in another peer
- # which isn't showing everything.
+# Ensure that undo (even composite undo like 'replace')
+# works when the the event took place in one peer, which
+# is then deleted, before the undo takes place in another peer
+# which isn't showing everything.
.tt replace 2.1 2.3 foo
set res [.tt get 2.1 2.4]
.tt configure -start 1 -end 1
destroy .tt
.t configure -start 3 -end 4
- # msg will actually be set to a silently ignored error message here,
- # (that the .tt command doesn't exist), but that is not important.
- lappend res [catch {.t edit undo} msg]
+# msg will actually be set to a silently ignored error message here,
+# (that the .tt command doesn't exist), but that is not important.
+ lappend res [catch {.t edit undo}]
.t configure -undo 0
.t configure -start {} -end {}
- if {![string equal [.t get 1.0 end-1c] $prevtext]} {
- lappend res [list [.t get 1.0 end-1c] ne $prevtext]
- } else {
- lappend res 1
- }
-} {foo 0 1}
-test text-8.25 {TextWidgetCmd procedure, "replace" option crash} -setup {
- destroy .tt
-} -body {
+ lappend res [string equal [.t get 1.0 end-1c] $prevtext]
+} -cleanup {
+ destroy .t
+} -result {foo 0 1}
+test text-8.26 {TextWidgetCmd procedure, "replace" option crash} -setup {
text .tt
+} -body {
.tt insert 0.0 foo\n
.tt replace end-1l end bar
} -cleanup {
destroy .tt
} -result {}
-.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 ?-displaychars? ?--? index1 ?index2 ...?"}}
-test text-9.2 {TextWidgetCmd procedure, "get" option} {
- list [catch {.t get a b c} msg] $msg
-} {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"}}
-test text-9.4 {TextWidgetCmd procedure, "get" option} {
- list [catch {.t get 3.1 @r} msg] $msg
-} {1 {bad text index "@r"}}
-test text-9.5 {TextWidgetCmd procedure, "get" option} {
+
+test text-9.1 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t get
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t get ?-displaychars? ?--? index1 ?index2 ...?"}
+test text-9.2 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t get a b c
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "a"}
+test text-9.3 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t get @q 3.1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@q"}
+test text-9.4 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t get 3.1 @r
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@r"}
+test text-9.5 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.7 5.3
-} {}
-test text-9.6 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-9.6 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.3 5.5
-} { G}
-test text-9.7 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result { G}
+test text-9.7 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.3 end
-} { GIrl .#@? x_yz
+} -cleanup {
+ destroy .t
+} -result { GIrl .#@? x_yz
!@#$%
Line 7
}
-.t mark set a 5.3
-.t mark set b 5.3
-.t mark set c 5.5
-test text-9.8 {TextWidgetCmd procedure, "get" option} {
+test text-9.8 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.7
-} {y GIr}
-test text-9.9 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {y GIr}
+test text-9.9 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2
-} {y}
-test text-9.10 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {y}
+test text-9.10 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4
-} {y }
-test text-9.11 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {y }
+test text-9.11 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4 5.4
-} {{y } G}
-test text-9.12 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {{y } G}
+test text-9.12 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4 5.4 5.5
-} {{y } G}
-test text-9.13 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {{y } G}
+test text-9.13 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4 5.5 "5.5+5c"
-} {{y } {Irl .}}
-test text-9.14 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {{y } {Irl .}}
+test text-9.14 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4 5.4 5.5 end-3c
-} {{y } G { }}
-test text-9.15 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {{y } G { }}
+test text-9.15 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.4 5.4 5.5 end-3c end
-} {{y } G { 7
+} -cleanup {
+ destroy .t
+} -result {{y } G { 7
}}
-test text-9.16 {TextWidgetCmd procedure, "get" option} {
+test text-9.16 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t get 5.2 5.3 5.4 5.3
-} {y}
-test text-9.17 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {y}
+test text-9.17 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t index "5.2 +3 indices"
-} {5.5}
-test text-9.17a {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5}
+test text-9.18 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t index "5.2 +3chars"
-} {5.5}
-test text-9.17b {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5}
+test text-9.19 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t index "5.2 +3displayindices"
-} {5.5}
-.t tag configure elide -elide 1
-.t tag add elide 5.2 5.4
-test text-9.18 {TextWidgetCmd procedure, "get" option} {
- list [catch {.t get 5.2 5.4 5.5 foo} msg] $msg
-} {1 {bad text index "foo"}}
-test text-9.19 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5}
+test text-9.20 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t get 5.2 5.4 5.5 foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "foo"}
+test text-9.21 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
.t get 5.2 5.4 5.4 5.5 end-3c end
-} {{y } G { 7
+} -cleanup {
+ destroy .t
+} -result {{y } G { 7
}}
-test text-9.20 {TextWidgetCmd procedure, "get" option} {
+test text-9.22 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
.t get -displaychars 5.2 5.4 5.4 5.5 end-3c end
-} {{} G { 7
+} -cleanup {
+ destroy .t
+} -result {{} G { 7
}}
-test text-9.21 {TextWidgetCmd procedure, "get" option} {
+test text-9.23 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
list [.t index "5.1 +4indices"] [.t index "5.1+4d indices"]
-} {5.5 5.7}
-test text-9.22 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5 5.7}
+test text-9.24 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
list [.t index "5.1 +4a chars"] [.t index "5.1+4d chars"]
-} {5.5 5.7}
-test text-9.23 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5 5.7}
+test text-9.25 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
list [.t index "5.5 -4indices"] [.t index "5.7-4d indices"]
-} {5.1 5.1}
-test text-9.24 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.1 5.1}
+test text-9.26 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
list [.t index "5.5 -4a chars"] [.t index "5.7-4d chars"]
-} {5.1 5.1}
-.t window create 5.4
-test text-9.25 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.1 5.1}
+test text-9.27 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t window create 5.4
list [.t index "5.1 +4indices"] [.t index "5.1+4d indices"]
-} {5.5 5.7}
-test text-9.25a {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.5 5.7}
+test text-9.28 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t window create 5.4
list [.t index "5.1 +4a chars"] [.t index "5.1+4d chars"]
-} {5.6 5.8}
-test text-9.26 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.6 5.8}
+test text-9.29 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t window create 5.4
list [.t index "5.5 -4indices"] [.t index "5.7-4d indices"]
-} {5.1 5.1}
-test text-9.26a {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.1 5.1}
+test text-9.30 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t window create 5.4
list [.t index "5.6 -4a chars"] [.t index "5.8-4d chars"]
-} {5.1 5.1}
-.t delete 5.4
-.t tag add elide 5.5 5.6
-test text-9.27 {TextWidgetCmd procedure, "get" option} {
+} -cleanup {
+ destroy .t
+} -result {5.1 5.1}
+test text-9.31 {TextWidgetCmd procedure, "get" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 5.2 5.4
+ .t window create 5.4
+ .t delete 5.4
+ .t tag add elide 5.5 5.6
.t get -displaychars 5.2 5.8
-} {Grl}
-.t tag delete elide
-.t mark unset a
-.t mark unset b
-.t mark unset c
-test text-9.2.1 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count} msg] $msg
-} {1 {wrong # args: should be ".t count ?options? index1 index2"}}
-test text-9.2.2.1 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count blah 1.0 2.0} msg] $msg
-} {1 {bad option "blah" must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels}}
-test text-9.2.2 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count a b} msg] $msg
-} {1 {bad text index "a"}}
-test text-9.2.3 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count @q 3.1} msg] $msg
-} {1 {bad text index "@q"}}
-test text-9.2.4 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count 3.1 @r} msg] $msg
-} {1 {bad text index "@r"}}
-test text-9.2.5 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {Grl}
+
+
+test text-10.1 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t count
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t count ?-option value ...? index1 index2"}
+test text-10.2 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t count blah 1.0 2.0
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad option "blah" must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels}
+test text-10.3 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t count a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "a"}
+test text-10.4 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t count @q 3.1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@q"}
+test text-10.5 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t count 3.1 @r
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@r"}
+test text-10.6 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t count 5.7 5.3
-} {-4}
-test text-9.2.6 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {-4}
+test text-10.7 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t count 5.3 5.5
-} {2}
-test text-9.2.7 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {2}
+test text-10.8 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t count 5.3 end
-} {29}
-.t mark set a 5.3
-.t mark set b 5.3
-.t mark set c 5.5
-test text-9.2.8 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {29}
+test text-10.9 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t count 5.2 5.7
-} {5}
-test text-9.2.9 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-10.10 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t count 5.2 5.3
-} {1}
-test text-9.2.10 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-10.11 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t count 5.2 5.4
-} {2}
-test text-9.2.17 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count 5.2 foo} msg] $msg
-} {1 {bad text index "foo"}}
-.t tag configure elide -elide 1
-.t tag add elide 2.2 3.4
-.t tag add elide 4.0 4.1
-test text-9.2.18 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {2}
+test text-10.12 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
+ .t count 5.2 foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "foo"}
+test text-10.13 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
.t count -displayindices 2.0 3.0
-} {2}
-test text-9.2.19 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {2}
+test text-10.14 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
.t count -displayindices 2.2 3.0
-} {0}
-test text-9.2.20 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-10.15 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
.t count -displayindices 2.0 4.2
-} {5}
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-10.16 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
# Create one visible and one invisible window
-frame .t.w1
-frame .t.w2
-.t mark set a 2.2
+ frame .t.w1
+ frame .t.w2
# Creating this window here means that the elidden text
-# now starts at 2.3, but 'a' is automatically moved to 2.3
-.t window create 2.1 -window .t.w1
-.t window create 3.1 -window .t.w2
-test text-9.2.21 {TextWidgetCmd procedure, "count" option} {
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displayindices 2.0 3.0
-} {3}
-test text-9.2.22 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {3}
+test text-10.17 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displayindices 2.2 3.0
-} {1}
-test text-9.2.23 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-10.18 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+ .t mark set a 2.2
+# Creating this window here means that the elidden text
+# now starts at 2.3, but 'a' is automatically moved to 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displayindices a 3.0
-} {0}
-test text-9.2.24 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-10.19 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displayindices 2.0 4.2
-} {6}
-test text-9.2.25 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {6}
+test text-10.20 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displaychars 2.0 3.0
-} {2}
-test text-9.2.26 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {2}
+test text-10.21 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displaychars 2.2 3.0
-} {1}
-test text-9.2.27 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-10.22 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+ .t mark set a 2.2
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3, but 'a' is automatically moved to 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displaychars a 3.0
-} {0}
-test text-9.2.28 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-10.23 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
+ .t count -displaychars 2.0 4.2
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-10.24 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -displaychars 2.0 4.2
-} {5}
-test text-9.2.29 {TextWidgetCmd procedure, "count" option} {
list [.t count -indices 2.2 3.0] [.t count 2.2 3.0]
-} {10 10}
-test text-9.2.30 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {10 10}
+test text-10.25 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+ .t mark set a 2.2
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3, but 'a' is automatically moved to 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
list [.t count -indices a 3.0] [.t count a 3.0]
-} {9 9}
-test text-9.2.31 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {9 9}
+test text-10.26 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
+ .t count -displaychars 2.0 4.2
.t count -indices 2.0 4.2
-} {21}
-test text-9.2.32 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {21}
+test text-10.27 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
+ .t count -displaychars 2.0 4.2
.t count -chars 2.2 3.0
-} {10}
-test text-9.2.33 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {10}
+test text-10.28 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+ .t mark set a 2.2
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3, but 'a' is automatically moved to 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
.t count -chars a 3.0
-} {9}
-test text-9.2.34 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {9}
+test text-10.29 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+ .t tag configure elide -elide 1
+ .t tag add elide 2.2 3.4
+ .t tag add elide 4.0 4.1
+# Create one visible and one invisible window
+ frame .t.w1
+ frame .t.w2
+# Creating this window here means that the elidden text
+# now starts at 2.3
+ .t window create 2.1 -window .t.w1
+ .t window create 3.1 -window .t.w2
+ .t count -displaychars 2.0 4.2
.t count -chars 2.0 4.2
-} {19}
-destroy .t.w1
-destroy .t.w2
-set current [.t get 1.0 end-1c]
-.t delete 1.0 end
-.t insert end [string repeat "abcde " 50]\n
-.t insert end [string repeat "fghij " 50]\n
-.t insert end [string repeat "klmno " 50]
-test text-9.2.35 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {19}
+test text-10.30 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines 1.0 end
-} {3}
-test text-9.2.36 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {3}
+test text-10.31 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines end 1.0
-} {-3}
-test text-9.2.37 {TextWidgetCmd procedure, "count" option} {
- list [catch {.t count -lines 1.0 2.0 3.0} res] $res
-} {1 {bad option "1.0" must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels}}
-test text-9.2.38 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {-3}
+test text-10.32 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
+ .t count -lines 1.0 2.0 3.0
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad option "1.0" must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels}
+test text-10.33 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines end end
-} {0}
-test text-9.2.39 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-10.34 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines 1.5 2.5
-} {1}
-test text-9.2.40 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-10.35 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines 2.5 "2.5 lineend"
-} {0}
-test text-9.2.41 {TextWidgetCmd procedure, "count" option} {
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-10.36 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines 2.7 "1.0 lineend"
-} {-1}
-test text-9.2.42 {TextWidgetCmd procedure, "count" option} {
- set old_wrap [.t cget -wrap]
+} -cleanup {
+ destroy .t
+} -result {-1}
+test text-10.37 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t
+} -body {
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t configure -wrap none
- set res [.t count -displaylines 1.0 end]
- .t configure -wrap $old_wrap
- set res
-} {3}
-test text-9.2.43 {TextWidgetCmd procedure, "count" option} {
+ .t count -displaylines 1.0 end
+} -cleanup {
+ destroy .t
+} -result {3}
+test text-10.38 {TextWidgetCmd procedure, "count" option} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack append . .t {top expand fill}
+} -body {
+ .t configure -width 20 -height 10
+ update
+ .t insert end [string repeat "abcde " 50]\n
+ .t insert end [string repeat "fghij " 50]\n
+ .t insert end [string repeat "klmno " 50]
.t count -lines -chars -indices -displaylines 1.0 end
-} {3 903 903 45}
-.t configure -wrap none
+} -cleanup {
+ destroy .t
+} -result {3 903 903 45}
-# Newer tags are higher priority
-.t tag configure elide1 -elide 0
-.t tag configure elide2 -elide 1
-.t tag configure elide3 -elide 0
-.t tag configure elide4 -elide 1
-test text-0.2.44.0 {counting with tag priority eliding} {
- .t delete 1.0 end
+test text-11.1 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack append . .t {top expand fill}
+} -body {
.t insert end "hello"
+ .t configure -wrap none
list [.t count -displaychars 1.0 1.0] \
[.t count -displaychars 1.0 1.1] \
[.t count -displaychars 1.0 1.2] \
@@ -702,23 +2631,42 @@ test text-0.2.44.0 {counting with tag priority eliding} {
[.t count -displaychars 1.0 1.5] \
[.t count -displaychars 1.0 1.6] \
[.t count -displaychars 1.0 2.6] \
-} {0 1 2 3 4 5 5 6}
-test text-0.2.44 {counting with tag priority eliding} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {0 1 2 3 4 5 5 6}
+test text-11.2 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack append . .t {top expand fill}
+} -body {
.t insert end "hello"
+ .t tag configure elide1 -elide 0
.t tag add elide1 1.2 1.4
.t count -displaychars 1.0 1.5
-} {5}
-test text-0.2.45 {counting with tag priority eliding} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {5}
+test text-11.3 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
.t insert end "hello"
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
+ .t tag add elide1 1.2 1.4
.t tag add elide2 1.2 1.4
.t count -displaychars 1.0 1.5
-} {3}
-test text-0.2.46 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {3}
+test text-11.4 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
set res {}
- .t delete 1.0 end
+} -body {
.t insert end "hello"
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
+ .t tag add elide1 1.2 1.4
.t tag add elide2 1.2 1.4
.t tag add elide1 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
@@ -727,11 +2675,19 @@ test text-0.2.46 {counting with tag priority eliding} {
.t tag add elide1 1.2 1.4
.t tag add elide2 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
-} {3 3}
-test text-0.2.47 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {3 3}
+test text-11.5 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
set res {}
- .t delete 1.0 end
+} -body {
.t insert end "hello"
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
+ .t tag configure elide3 -elide 0
+ .t tag add elide1 1.2 1.4
.t tag add elide2 1.2 1.4
.t tag add elide3 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
@@ -740,11 +2696,19 @@ test text-0.2.47 {counting with tag priority eliding} {
.t tag add elide3 1.2 1.4
.t tag add elide3 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
-} {5 5}
-test text-0.2.48 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {5 5}
+test text-11.6 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
set res {}
- .t delete 1.0 end
+} -body {
.t insert end "hello"
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
+ .t tag configure elide3 -elide 0
+ .t tag configure elide4 -elide 1
.t tag add elide2 1.2 1.4
.t tag add elide3 1.2 1.4
.t tag add elide4 1.2 1.4
@@ -757,10 +2721,17 @@ test text-0.2.48 {counting with tag priority eliding} {
.t tag add elide2 1.2 1.4
.t tag add elide3 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
-} {3 3}
-test text-0.2.49 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {3 3}
+test text-11.7 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
set res {}
- .t delete 1.0 end
+} -body {
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
+ .t tag configure elide3 -elide 0
.t insert end "hello"
.t tag add elide2 1.2 1.4
.t tag add elide3 1.2 1.4
@@ -772,11 +2743,18 @@ test text-0.2.49 {counting with tag priority eliding} {
.t tag add elide2 1.2 1.4
.t tag add elide3 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
-} {5 5}
-test text-0.2.50 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {5 5}
+test text-11.8 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack append . .t {top expand fill}
set res {}
- .t delete 1.0 end
+} -body {
.t insert end "hello"
+# Newer tags are higher priority
+ .t tag configure elide1 -elide 0
+ .t tag configure elide2 -elide 1
.t tag add elide2 1.0 1.5
.t tag add elide1 1.2 1.4
lappend res [.t count -displaychars 1.0 1.5]
@@ -791,10 +2769,14 @@ test text-0.2.50 {counting with tag priority eliding} {
lappend res [.t count -displaychars 1.1 1.5]
lappend res [.t count -displaychars 1.2 1.5]
lappend res [.t count -displaychars 1.3 1.5]
-} {0 0 0 0 3 2 1 1}
-test text-0.2.51 {counting with tag priority eliding} {
+} -cleanup {
+ destroy .t
+} -result {0 0 0 0 3 2 1 1}
+test text-11.9 {counting with tag priority eliding} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack append . .t {top expand fill}
set res {}
- .t delete 1.0 end
+} -body {
.t tag configure WELCOME -elide 1
.t tag configure SYSTEM -elide 0
.t tag configure TRAFFIC -elide 1
@@ -815,225 +2797,410 @@ test text-0.2.51 {counting with tag priority eliding} {
lappend res [.t index "end -2 indices"]
lappend res [.t index "end -2 display indices"]
lappend res [.t index "end -2 display chars"]
-} {1 0 0 1 0 2.0 4.0 4.0 4.0 3.0 3.0 3.0 2.0 1.0 1.0}
-
-.t delete 1.0 end
-.t insert end $current
-unset current
-
-test text-10.1 {TextWidgetCmd procedure, "index" option} {
- list [catch {.t index} msg] $msg
-} {1 {wrong # args: should be ".t index index"}}
-test text-10.2 {TextWidgetCmd procedure, "index" option} {
- list [catch {.t ind a b} msg] $msg
-} {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 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, 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"}}
-test text-10.5 {TextWidgetCmd procedure, "index" option} {
+} -cleanup {
+ destroy .t
+} -result {1 0 0 1 0 2.0 4.0 4.0 4.0 3.0 3.0 3.0 2.0 1.0 1.0}
+
+
+test text-12.1 {TextWidgetCmd procedure, "index" option} -setup {
+ text .t
+} -body {
+ .t index
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t index index"}
+test text-12.2 {TextWidgetCmd procedure, "index" option} -setup {
+ text .t
+} -body {
+ .t ind a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t index index"}
+test text-12.3 {TextWidgetCmd procedure, "index" option} -setup {
+ text .t
+} -body {
+ .t in a b
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}
+test text-12.4 {TextWidgetCmd procedure, "index" option} -setup {
+ text .t
+} -body {
+ .t index @xyz
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "@xyz"}
+test text-12.5 {TextWidgetCmd procedure, "index" option} -setup {
+ [text .t] insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
.t index 1.2
-} 1.2
+} -cleanup {
+ destroy .t
+} -result 1.2
-test text-11.1 {TextWidgetCmd procedure, "insert" option} {
- list [catch {.t insert 1.2} msg] $msg
-} {1 {wrong # args: should be ".t insert index chars ?tagList chars tagList ...?"}}
-test text-11.2 {TextWidgetCmd procedure, "insert" option} {
+
+test text-13.1 {TextWidgetCmd procedure, "insert" option} -setup {
+ [text .t] insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
+} -body {
+ .t insert 1.2
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t insert index chars ?tagList chars tagList ...?"}
+test text-13.2 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t config -state disabled
.t insert 1.2 xyzzy
.t get 1.0 1.end
-} {Line 1}
-.t config -state normal
-test text-11.3 {TextWidgetCmd procedure, "insert" option} {
+} -cleanup {
+ destroy .t
+} -result {Line 1}
+test text-13.3 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t insert 1.2 xyzzy
.t get 1.0 1.end
-} {Lixyzzyne 1}
-test text-11.4 {TextWidgetCmd procedure, "insert" option} {
+} -cleanup {
+ destroy .t
+} -result {Lixyzzyne 1}
+test text-13.4 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Line 1
+aefghijklm
+12345
+Line 4
+bOy GIrl .#@? x_yz
+!@#$%
+Line 7"
.t delete 1.0 end
.t insert 1.0 "Sample text" x
.t tag ranges x
-} {1.0 1.11}
-test text-11.5 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.0 1.11}
+test text-13.5 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
.t insert 1.0 "Sample text" x
.t insert 1.2 "XYZ" y
list [.t tag ranges x] [.t tag ranges y]
-} {{1.0 1.2 1.5 1.14} {1.2 1.5}}
-test text-11.6 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{1.0 1.2 1.5 1.14} {1.2 1.5}}
+test text-13.6 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
.t insert 1.0 "Sample text" {x y z}
list [.t tag ranges x] [.t tag ranges y] [.t tag ranges z]
-} {{1.0 1.11} {1.0 1.11} {1.0 1.11}}
-test text-11.7 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{1.0 1.11} {1.0 1.11} {1.0 1.11}}
+test text-13.7 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
.t insert 1.0 "Sample text" {x y z}
.t insert 1.3 "A" {a b z}
list [.t tag ranges a] [.t tag ranges b] [.t tag ranges x] [.t tag ranges y] [.t tag ranges z]
-} {{1.3 1.4} {1.3 1.4} {1.0 1.3 1.4 1.12} {1.0 1.3 1.4 1.12} {1.0 1.12}}
-test text-11.8 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
- list [catch {.t insert 1.0 "Sample text" "a \{b"} msg] $msg
-} {1 {unmatched open brace in list}}
-test text-11.9 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{1.3 1.4} {1.3 1.4} {1.0 1.3 1.4 1.12} {1.0 1.3 1.4 1.12} {1.0 1.12}}
+test text-13.8 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
+ .t insert 1.0 "Sample text" "a \{b"
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {unmatched open brace in list}
+test text-13.9 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
.t insert 1.0 "First" bold " " {} second "x y z" " third"
list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges x] \
[.t tag ranges y] [.t tag ranges z]
-} {{First second third} {1.0 1.5} {1.6 1.12} {1.6 1.12} {1.6 1.12}}
-test text-11.10 {TextWidgetCmd procedure, "insert" option} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{First second third} {1.0 1.5} {1.6 1.12} {1.6 1.12} {1.6 1.12}}
+test text-13.10 {TextWidgetCmd procedure, "insert" option} -setup {
+ text .t
+} -body {
.t insert 1.0 "First" bold " second" silly
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}}
+} -cleanup {
+ destroy .t
+} -result {{First second} {1.0 1.5} {1.5 1.12}}
# 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
-} {1 {bad state "foobar": must be disabled or normal}}
-test text-12.2 {ConfigureText procedure} {
- .t2 configure -spacing1 -2 -spacing2 1 -spacing3 1
- list [.t2 cget -spacing1] [.t2 cget -spacing2] [.t2 cget -spacing3]
-} {0 1 1}
-test text-12.3 {ConfigureText procedure} {
- .t2 configure -spacing1 1 -spacing2 -1 -spacing3 1
- list [.t2 cget -spacing1] [.t2 cget -spacing2] [.t2 cget -spacing3]
-} {1 0 1}
-test text-12.4 {ConfigureText procedure} {
- .t2 configure -spacing1 1 -spacing2 1 -spacing3 -3
- list [.t2 cget -spacing1] [.t2 cget -spacing2] [.t2 cget -spacing3]
-} {1 1 0}
-test text-12.5 {ConfigureText procedure} {
- set x [list [catch {.t2 configure -tabs {30 foo}} msg] $msg $errorInfo]
- .t2 configure -tabs {10 20 30}
- set x
-} {1 {bad tab alignment "foo": must be left, right, center, or numeric} {bad tab alignment "foo": must be left, right, center, or numeric
+test text-14.1 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -state foobar
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad state "foobar": must be disabled or normal}
+test text-14.2 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -spacing1 -2 -spacing2 1 -spacing3 1
+ list [.t cget -spacing1] [.t cget -spacing2] [.t cget -spacing3]
+} -cleanup {
+ destroy .t
+} -result {0 1 1}
+test text-14.3 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -spacing1 1 -spacing2 -1 -spacing3 1
+ list [.t cget -spacing1] [.t cget -spacing2] [.t cget -spacing3]
+} -cleanup {
+ destroy .t
+} -result {1 0 1}
+test text-14.4 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -spacing1 1 -spacing2 1 -spacing3 -3
+ list [.t cget -spacing1] [.t cget -spacing2] [.t cget -spacing3]
+} -cleanup {
+ destroy .t
+} -result {1 1 0}
+test text-14.5 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -tabs {30 foo}
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad tab alignment "foo": must be left, right, center, or numeric}
+test text-14.6 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ catch {.t configure -tabs {30 foo}}
+ .t configure -tabs {10 20 30}
+ return $errorInfo
+} -cleanup {
+ destroy .t
+} -result {bad tab alignment "foo": must be left, right, center, or numeric
(while processing -tabs option)
invoked from within
-".t2 configure -tabs {30 foo}"}}
-test text-12.6 {ConfigureText procedure} {
- .t2 configure -tabs {10 20 30}
- .t2 configure -tabs {}
- .t2 cget -tabs
-} {}
-test text-12.7 {ConfigureText procedure} {
- list [catch {.t2 configure -wrap bogus} msg] $msg
-} {1 {bad wrap "bogus": must be char, none, or word}}
-test text-12.8 {ConfigureText procedure} {
- .t2 configure -selectborderwidth 17 -selectforeground #332211 \
+".t configure -tabs {30 foo}"}
+test text-14.7 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -tabs {10 20 30}
+ .t configure -tabs {}
+ .t cget -tabs
+} -cleanup {
+ destroy .t
+} -result {}
+test text-14.8 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -wrap bogus
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad wrap "bogus": must be char, none, or word}
+test text-14.9 {ConfigureText procedure} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
+ .t configure -selectborderwidth 17 -selectforeground #332211 \
-selectbackground #abc
- list [lindex [.t2 tag config sel -borderwidth] 4] \
- [lindex [.t2 tag config sel -foreground] 4] \
- [lindex [.t2 tag config sel -background] 4]
-} {17 #332211 #abc}
-test text-12.9 {ConfigureText procedure} {
- .t2 configure -selectborderwidth {}
- .t2 tag cget sel -borderwidth
-} {}
-test text-12.10 {ConfigureText procedure} {
- list [catch {.t2 configure -selectborderwidth foo} msg] $msg
-} {1 {bad screen distance "foo"}}
-test text-12.11 {ConfigureText procedure} {
- catch {destroy .t2}
+ list [lindex [.t tag config sel -borderwidth] 4] \
+ [lindex [.t tag config sel -foreground] 4] \
+ [lindex [.t tag config sel -background] 4]
+} -cleanup {
+ destroy .t
+} -result {17 #332211 #abc}
+test text-14.10 {ConfigureText procedure} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
+ .t configure -selectborderwidth {}
+ .t tag cget sel -borderwidth
+} -cleanup {
+ destroy .t
+} -result {}
+test text-14.11 {ConfigureText procedure} -setup {
+ text .t
+} -body {
+ .t configure -selectborderwidth foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad screen distance "foo"}
+test text-14.12 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
.t.e select to 2
text .t2 -exportselection 1
selection get
-} {ab}
-test text-12.12 {ConfigureText procedure} {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t .t2
+} -result {ab}
+test text-14.13 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
.t.e select to 2
text .t2 -exportselection 0
.t2 insert insert 1234657890
.t2 tag add sel 1.0 1.4
selection get
-} {ab}
-test text-12.13 {ConfigureText procedure} {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t .t2
+} -result {ab}
+test text-14.14 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
.t.e select to 1
text .t2 -exportselection 1
.t2 insert insert 1234657890
.t2 tag add sel 1.0 1.4
selection get
-} {1234}
-test text-12.14 {ConfigureText procedure} {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t .t2
+} -result {1234}
+test text-14.15 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
.t.e select to 1
text .t2 -exportselection 0
.t2 insert insert 1234657890
.t2 tag add sel 1.0 1.4
.t2 configure -exportselection 1
selection get
-} {1234}
-test text-12.15 {ConfigureText procedure} {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t2 .t
+} -result {1234}
+test text-14.16 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
+ text .t2 -exportselection 1
+ .t2 insert insert 1234657890
+ .t2 tag add sel 1.0 1.4
+ selection get
+ .t2 configure -exportselection 0
+ selection get
+} -cleanup {
+ destroy .t .t2
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test text-14.17 {ConfigureText procedure} -body {
+ text .t
+ entry .t.e
+ .t.e insert end abcdefg
+ .t.e select from 0
text .t2 -exportselection 1
.t2 insert insert 1234657890
.t2 tag add sel 1.0 1.4
set result [selection get]
.t2 configure -exportselection 0
- lappend result [catch {selection get} msg] $msg
-} {1234 1 {PRIMARY selection doesn't exist or form "STRING" not defined}}
-test text-12.16 {ConfigureText procedure} {fonts} {
- # This test is non-portable because the window size will vary depending
- # on the font size, which can vary.
- catch {destroy .t2}
- toplevel .t2
- text .t2.t -width 20 -height 10
- pack append .t2 .t2.t top
- wm geometry .t2 +0+0
- update
- wm geometry .t2
-} {150x140+0+0}
-test text-12.17 {ConfigureText procedure} {
- # This test was failing Windows because the title bar on .t2
- # was a certain minimum size and it was interfering with the size
- # requested by the -setgrid. The "overrideredirect" gets rid of the
- # titlebar so the toplevel can shrink to the appropriate size.
- catch {destroy .t2}
- toplevel .t2
- wm overrideredirect .t2 1
- text .t2.t -width 20 -height 10 -setgrid 1
- pack append .t2 .t2.t top
- wm geometry .t2 +0+0
- update
- wm geometry .t2
-} {20x10+0+0}
-test text-12.18 {ConfigureText procedure} {
- # This test was failing on Windows because the title bar on .t2
- # was a certain minimum size and it was interfering with the size
- # requested by the -setgrid. The "overrideredirect" gets rid of the
- # titlebar so the toplevel can shrink to the appropriate size.
- catch {destroy .t2}
- toplevel .t2
- wm overrideredirect .t2 1
- text .t2.t -width 20 -height 10 -setgrid 1
- pack append .t2 .t2.t top
- wm geometry .t2 +0+0
- update
- set result [wm geometry .t2]
- wm geometry .t2 15x8
- update
- lappend result [wm geometry .t2]
- .t2.t configure -wrap word
- update
- lappend result [wm geometry .t2]
-} {20x10+0+0 15x8+0+0 15x8+0+0}
-
-test text-13.1 {TextWorldChanged procedure, spacing options} fonts {
- catch {destroy .t2}
- text .t2 -width 20 -height 10
- set result [winfo reqheight .t2]
- .t2 configure -spacing1 2
- lappend result [winfo reqheight .t2]
- .t2 configure -spacing3 1
- lappend result [winfo reqheight .t2]
- .t2 configure -spacing1 0
- lappend result [winfo reqheight .t2]
-} {140 160 170 150}
-
-test text-14.1 {TextEventProc procedure} {
+ catch {selection get}
+ return $result
+} -cleanup {
+ destroy .t .t2
+} -result {1234}
+test text-14.18 {ConfigureText procedure} -constraints fonts -setup {
+ toplevel .top
+ text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
+ .top.t configure -width 20 -height 10
+ pack append .top .top.t top
+ update
+ set geom [wm geometry .top]
+ set x [string range $geom 0 [string first + $geom]]
+} -cleanup {
+ destroy .top
+} -result {150x140+}
+# This test was failing Windows because the title bar on .t was a certain
+# minimum size and it was interfering with the size requested by the -setgrid.
+# The "overrideredirect" gets rid of the titlebar so the toplevel can shrink
+# to the appropriate size.
+test text-14.19 {ConfigureText procedure} -setup {
+ toplevel .top
+ text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
+ .top.t configure -width 20 -height 10 -setgrid 1
+ wm overrideredirect .top 1
+ pack append .top .top.t top
+ wm geometry .top +0+0
+ update
+ wm geometry .top
+} -cleanup {
+ destroy .top
+} -result {20x10+0+0}
+# This test was failing on Windows because the title bar on .t was a certain
+# minimum size and it was interfering with the size requested by the -setgrid.
+# The "overrideredirect" gets rid of the titlebar so the toplevel can shrink
+# to the appropriate size.
+test text-14.20 {ConfigureText procedure} -setup {
+ toplevel .top
+ text .top.t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+} -body {
+ .top.t configure -width 20 -height 10 -setgrid 1
+ wm overrideredirect .top 1
+ pack append .top .top.t top
+ wm geometry .top +0+0
+ update
+ set result [wm geometry .top]
+ wm geometry .top 15x8
+ update
+ lappend result [wm geometry .top]
+ .top.t configure -wrap word
+ update
+ lappend result [wm geometry .top]
+} -cleanup {
+ destroy .top
+} -result {20x10+0+0 15x8+0+0 15x8+0+0}
+
+
+test text-15.1 {TextWorldChanged procedure, spacing options} -constraints {
+ fonts
+} -body {
+ text .t -width 20 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ set result [winfo reqheight .t]
+ .t configure -spacing1 2
+ lappend result [winfo reqheight .t]
+ .t configure -spacing3 1
+ lappend result [winfo reqheight .t]
+ .t configure -spacing1 0
+ lappend result [winfo reqheight .t]
+} -cleanup {
+ destroy .t
+} -result {140 160 170 150}
+
+
+test text-16.1 {TextEventProc procedure} -body {
text .tx1 -bg #543210
rename .tx1 .tx2
set x {}
@@ -1041,265 +3208,363 @@ test text-14.1 {TextEventProc procedure} {
lappend x [.tx2 cget -bg]
destroy .tx1
lappend x [info command .tx*] [winfo exists .tx1] [winfo exists .tx2]
-} {1 #543210 {} 0 0}
+} -cleanup {
+ destroy .txt1
+} -result {1 #543210 {} 0 0}
+
-test text-15.1 {TextCmdDeletedProc procedure} {
+test text-17.1 {TextCmdDeletedProc procedure} -body {
text .tx1
rename .tx1 {}
list [info command .tx*] [winfo exists .tx1]
-} {{} 0}
-test text-15.2 {TextCmdDeletedProc procedure, disabling -setgrid} fonts {
- catch {destroy .top}
- toplevel .top
- wm geom .top +0+0
- text .top.t -setgrid 1 -width 20 -height 10
- pack .top.t
- update
- set x [wm geometry .top]
- rename .top.t {}
- update
- lappend x [wm geometry .top]
+} -cleanup {
+ destroy .txt1
+} -result {{} 0}
+test text-17.2 {TextCmdDeletedProc procedure, disabling -setgrid} -constraints {
+ fonts
+} -body {
+ toplevel .top
+ text .top.t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} \
+ -setgrid 1 -width 20 -height 10
+ pack .top.t
+ update
+ set geom [wm geometry .top]
+ set x [string range $geom 0 [string first + $geom]]
+ rename .top.t {}
+ update
+ set geom [wm geometry .top]
+ lappend x [string range $geom 0 [string first + $geom]]
+ return $x
+} -cleanup {
destroy .top
- set x
-} {20x10+0+0 150x140+0+0}
+} -result {20x10+ 150x140+}
-test text-16.1 {InsertChars procedure} {
- catch {destroy .t2}
- text .t2
- .t2 insert 2.0 abcd\n
- .t2 get 1.0 end
-} {abcd
+
+test text-18.1 {InsertChars procedure} -body {
+ text .t
+ .t insert 2.0 abcd\n
+ .t get 1.0 end
+} -cleanup {
+ destroy .t
+} -result {abcd
}
-test text-16.2 {InsertChars procedure} {
- catch {destroy .t2}
- text .t2
- .t2 insert 1.0 abcd\n
- .t2 insert end 123\n
- .t2 get 1.0 end
-} {abcd
+test text-18.2 {InsertChars procedure} -body {
+ text .t
+ .t insert 1.0 abcd\n
+ .t insert end 123\n
+ .t get 1.0 end
+} -cleanup {
+ destroy .t
+} -result {abcd
123
}
-test text-16.3 {InsertChars procedure} {
- catch {destroy .t2}
- text .t2
- .t2 insert 1.0 abcd\n
- .t2 insert 10.0 123
- .t2 get 1.0 end
-} {abcd
+test text-18.3 {InsertChars procedure} -body {
+ text .t
+ .t insert 1.0 abcd\n
+ .t insert 10.0 123
+ .t get 1.0 end
+} -cleanup {
+ destroy .t
+} -result {abcd
123
}
-test text-16.4 {InsertChars procedure, inserting on top visible line} {
- catch {destroy .t2}
- text .t2 -width 20 -height 4 -wrap word
- pack .t2
- .t2 insert insert "Now is the time for all great men to come to the "
- .t2 insert insert "aid of their party.\n"
- .t2 insert insert "Now is the time for all great men.\n"
- .t2 see end
- update
- .t2 insert 1.0 "Short\n"
- .t2 index @0,0
-} {2.56}
-test text-16.5 {InsertChars procedure, inserting on top visible line} {
- catch {destroy .t2}
- text .t2 -width 20 -height 4 -wrap word
- pack .t2
- .t2 insert insert "Now is the time for all great men to come to the "
- .t2 insert insert "aid of their party.\n"
- .t2 insert insert "Now is the time for all great men.\n"
- .t2 see end
- update
- .t2 insert 1.55 "Short\n"
- .t2 index @0,0
-} {2.0}
-test text-16.6 {InsertChars procedure, inserting on top visible line} {
- catch {destroy .t2}
- text .t2 -width 20 -height 4 -wrap word
- pack .t2
- .t2 insert insert "Now is the time for all great men to come to the "
- .t2 insert insert "aid of their party.\n"
- .t2 insert insert "Now is the time for all great men.\n"
- .t2 see end
- update
- .t2 insert 1.56 "Short\n"
- .t2 index @0,0
-} {1.56}
-test text-16.7 {InsertChars procedure, inserting on top visible line} {
- catch {destroy .t2}
- text .t2 -width 20 -height 4 -wrap word
- pack .t2
- .t2 insert insert "Now is the time for all great men to come to the "
- .t2 insert insert "aid of their party.\n"
- .t2 insert insert "Now is the time for all great men.\n"
- .t2 see end
- update
- .t2 insert 1.57 "Short\n"
- .t2 index @0,0
-} {1.56}
-catch {destroy .t2}
-
-proc setup {} {
- .t delete 1.0 end
+test text-18.4 {InsertChars procedure, inserting on top visible line} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .t
+} -body {
+ .t configure -width 20 -height 4 -wrap word
+ .t insert insert "Now is the time for all great men to come to the "
+ .t insert insert "aid of their party.\n"
+ .t insert insert "Now is the time for all great men.\n"
+ .t see end
+ update
+ .t insert 1.0 "Short\n"
+ .t index @0,0
+} -cleanup {
+ destroy .t
+} -result {2.56}
+test text-18.5 {InsertChars procedure, inserting on top visible line} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .t
+} -body {
+ .t configure -width 20 -height 4 -wrap word
+ .t insert insert "Now is the time for all great men to come to the "
+ .t insert insert "aid of their party.\n"
+ .t insert insert "Now is the time for all great men.\n"
+ .t see end
+ update
+ .t insert 1.55 "Short\n"
+ .t index @0,0
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-18.6 {InsertChars procedure, inserting on top visible line} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .t
+} -body {
+ .t configure -width 20 -height 4 -wrap word
+ .t insert insert "Now is the time for all great men to come to the "
+ .t insert insert "aid of their party.\n"
+ .t insert insert "Now is the time for all great men.\n"
+ .t see end
+ update
+ .t insert 1.56 "Short\n"
+ .t index @0,0
+} -cleanup {
+ destroy .t
+} -result {1.56}
+test text-18.7 {InsertChars procedure, inserting on top visible line} -setup {
+ text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .t
+} -body {
+ .t configure -width 20 -height 4 -wrap word
+ .t insert insert "Now is the time for all great men to come to the "
+ .t insert insert "aid of their party.\n"
+ .t insert insert "Now is the time for all great men.\n"
+ .t see end
+ update
+ .t insert 1.57 "Short\n"
+ .t index @0,0
+} -cleanup {
+ destroy .t
+} -result {1.56}
+
+
+test text-19.1 {DeleteChars procedure} -body {
+ text .t
+ .t get 1.0 end
+} -cleanup {
+ destroy .t
+} -result {
+}
+test text-19.2 {DeleteChars procedure} -body {
+ text .t
+ .t delete foobar
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "foobar"}
+test text-19.3 {DeleteChars procedure} -body {
+ text .t
+ .t delete 1.0 lousy
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "lousy"}
+test text-19.4 {DeleteChars procedure} -body {
+ text .t
.t insert 1.0 "Line 1
abcde
12345
Line 4"
-}
-
-.t delete 1.0 end
-test text-17.1 {DeleteChars procedure} {
- .t get 1.0 end
-} {
-}
-test text-17.2 {DeleteChars procedure} {
- list [catch {.t delete foobar} msg] $msg
-} {1 {bad text index "foobar"}}
-test text-17.3 {DeleteChars procedure} {
- list [catch {.t delete 1.0 lousy} msg] $msg
-} {1 {bad text index "lousy"}}
-test text-17.4 {DeleteChars procedure} {
- setup
.t delete 2.1
.t get 1.0 end
-} {Line 1
+} -cleanup {
+ destroy .t
+} -result {Line 1
acde
12345
Line 4
}
-test text-17.5 {DeleteChars procedure} {
- setup
+test text-19.5 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t delete 2.3
.t get 1.0 end
-} {Line 1
+} -cleanup {
+ destroy .t
+} -result {Line 1
abce
12345
Line 4
}
-test text-17.6 {DeleteChars procedure} {
- setup
+test text-19.6 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t delete 2.end
.t get 1.0 end
-} {Line 1
+} -cleanup {
+ destroy .t
+} -result {Line 1
abcde12345
Line 4
}
-test text-17.7 {DeleteChars procedure} {
- setup
+test text-19.7 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t tag add sel 4.2 end
.t delete 4.2 end
list [.t tag ranges sel] [.t get 1.0 end]
-} {{} {Line 1
+} -cleanup {
+ destroy .t
+} -result {{} {Line 1
abcde
12345
Li
}}
-test text-17.8 {DeleteChars procedure} {
- setup
+test text-19.8 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t tag add sel 1.0 end
.t delete 4.0 end
list [.t tag ranges sel] [.t get 1.0 end]
-} {{1.0 3.5} {Line 1
+} -cleanup {
+ destroy .t
+} -result {{1.0 3.5} {Line 1
abcde
12345
}}
-test text-17.9 {DeleteChars procedure} {
- setup
+test text-19.9 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t delete 2.2 2.2
.t get 1.0 end
-} {Line 1
+} -cleanup {
+ destroy .t
+} -result {Line 1
abcde
12345
Line 4
}
-test text-17.10 {DeleteChars procedure} {
- setup
+test text-19.10 {DeleteChars procedure} -body {
+ text .t
+ .t insert 1.0 "Line 1
+abcde
+12345
+Line 4"
.t delete 2.3 2.1
.t get 1.0 end
-} {Line 1
+} -cleanup {
+ destroy .t
+} -result {Line 1
abcde
12345
Line 4
}
-test text-17.11 {DeleteChars procedure} {
- catch {destroy .t2}
- toplevel .t2
- text .t2.t -width 20 -height 5
- pack append .t2 .t2.t top
- wm geometry .t2 +0+0
- .t2.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns"
- update
- .t2.t delete 1.0 3.0
- list [.t2.t index @0,0] [.t2.t get @0,0]
-} {1.0 x}
-test text-17.12 {DeleteChars procedure} {
- catch {destroy .t2}
- toplevel .t2
- text .t2.t -width 20 -height 5
- pack append .t2 .t2.t top
- wm geometry .t2 +0+0
- .t2.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns"
- .t2.t yview 3.0
- update
- .t2.t delete 2.0 4.0
- list [.t2.t index @0,0] [.t2.t get @0,0]
-} {2.0 y}
-catch {destroy .t2}
-toplevel .t2
-text .t2.t -width 1 -height 10 -wrap char
-frame .t2.f -width 200 -height 20 -relief raised -bd 2
-pack .t2.f .t2.t -side left
-wm geometry .t2 +0+0
-update
-test text-17.13 {DeleteChars procedure, updates affecting topIndex} {
- .t2.t delete 1.0 end
- .t2.t insert end "abcde\n12345\nqrstuv"
- .t2.t yview 2.1
- .t2.t delete 1.4 2.3
- .t2.t index @0,0
-} {1.2}
-test text-17.14 {DeleteChars procedure, updates affecting topIndex} {
- .t2.t delete 1.0 end
- .t2.t insert end "abcde\n12345\nqrstuv"
- .t2.t yview 2.1
- .t2.t delete 2.3 2.4
- .t2.t index @0,0
-} {2.0}
-test text-17.15 {DeleteChars procedure, updates affecting topIndex} {
- .t2.t delete 1.0 end
- .t2.t insert end "abcde\n12345\nqrstuv"
- .t2.t yview 1.3
- .t2.t delete 1.0 1.2
- .t2.t index @0,0
-} {1.1}
-test text-17.16 {DeleteChars procedure, updates affecting topIndex} {
- catch {destroy .t2}
- toplevel .t2
- text .t2.t -width 6 -height 10 -wrap word
- frame .t2.f -width 200 -height 20 -relief raised -bd 2
- pack .t2.f .t2.t -side left
- wm geometry .t2 +0+0
- update
- .t2.t insert end "abc def\n01 2345 678 9101112\nLine 3\nLine 4\nLine 5\n6\n7\n8\n"
- .t2.t yview 2.4
- .t2.t delete 2.5
- set x [.t2.t index @0,0]
- .t2.t delete 2.5
- list $x [.t2.t index @0,0]
-} {2.3 2.0}
-
-.t delete 1.0 end
-foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
- .t insert end $i.0$i.1$i.2$i.3$i.4\n
-}
-test text-18.1 {TextFetchSelection procedure} {
+test text-19.11 {DeleteChars procedure} -body {
+ toplevel .top
+ text .top.t -width 20 -height 5
+ pack append .top .top.t top
+ wm geometry .top +0+0
+ .top.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns"
+ update
+ .top.t delete 1.0 3.0
+ list [.top.t index @0,0] [.top.t get @0,0]
+} -cleanup {
+ destroy .top
+} -result {1.0 x}
+test text-19.12 {DeleteChars procedure} -body {
+ toplevel .top
+ text .top.t -width 20 -height 5
+ pack append .top .top.t top
+ wm geometry .top +0+0
+ .top.t insert 1.0 "abc\n123\nx\ny\nz\nq\nr\ns"
+ .top.t yview 3.0
+ update
+ .top.t delete 2.0 4.0
+ list [.top.t index @0,0] [.top.t get @0,0]
+} -cleanup {
+ destroy .top
+} -result {2.0 y}
+test text-19.13 {DeleteChars procedure, updates affecting topIndex} -setup {
+ toplevel .top
+ text .top.t -width 1 -height 10 -wrap char
+ pack .top.t -side left
+ wm geometry .top +0+0
+ update
+} -body {
+ .top.t insert end "abcde\n12345\nqrstuv"
+ .top.t yview 2.1
+ .top.t delete 1.4 2.3
+ .top.t index @0,0
+} -cleanup {
+ destroy .top
+} -result {1.2}
+test text-19.14 {DeleteChars procedure, updates affecting topIndex} -setup {
+ toplevel .top
+ text .top.t -width 1 -height 10 -wrap char
+ pack .top.t -side left
+ wm geometry .top +0+0
+ update
+} -body {
+ .top.t insert end "abcde\n12345\nqrstuv"
+ .top.t yview 2.1
+ .top.t delete 2.3 2.4
+ .top.t index @0,0
+} -cleanup {
+ destroy .top
+} -result {2.0}
+test text-19.15 {DeleteChars procedure, updates affecting topIndex} -setup {
+ toplevel .top
+ text .top.t -width 1 -height 10 -wrap char
+ pack .top.t -side left
+ wm geometry .top +0+0
+ update
+} -body {
+ .top.t insert end "abcde\n12345\nqrstuv"
+ .top.t yview 1.3
+ .top.t delete 1.0 1.2
+ .top.t index @0,0
+} -cleanup {
+ destroy .top
+} -result {1.1}
+test text-19.16 {DeleteChars procedure, updates affecting topIndex} -setup {
+ toplevel .top
+ text .top.t -width 6 -height 10 -wrap word
+ frame .top.f -width 200 -height 20 -relief raised -bd 2
+ pack .top.f .top.t -side left
+ wm geometry .top +0+0
+ update
+} -body {
+ .top.t insert end "abc def\n01 2345 678 9101112\nLine 3\nLine 4\nLine 5\n6\n7\n8\n"
+ .top.t yview 2.4
+ .top.t delete 2.5
+ set x [.top.t index @0,0]
+ .top.t delete 2.5
+ list $x [.top.t index @0,0]
+} -cleanup {
+ destroy .top
+} -result {2.3 2.0}
+
+
+test text-20.1 {TextFetchSelection procedure} -setup {
+ text .t -width 20 -height 10
+ pack append . .t {top expand fill}
+ update
+} -body {
+ foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ .t insert end $i.0$i.1$i.2$i.3$i.4\n
+ }
.t tag add sel 1.3 3.4
selection get
-} {a.1a.2a.3a.4
+} -cleanup {
+ destroy .t
+} -result {a.1a.2a.3a.4
b.0b.1b.2b.3b.4
c.0c}
-test text-18.2 {TextFetchSelection procedure} {
+test text-20.2 {TextFetchSelection procedure} -setup {
+ text .t -width 20 -height 10
+ pack append . .t {top expand fill}
+ update
+} -body {
+ foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ .t insert end $i.0$i.1$i.2$i.3$i.4\n
+ }
.t tag add x 1.2
.t tag add x 1.4
.t tag add x 2.0
@@ -1307,15 +3572,33 @@ test text-18.2 {TextFetchSelection procedure} {
.t tag remove sel 1.0 end
.t tag add sel 1.0 3.4
selection get
-} {a.0a.1a.2a.3a.4
+} -cleanup {
+ destroy .t
+} -result {a.0a.1a.2a.3a.4
b.0b.1b.2b.3b.4
c.0c}
-test text-18.3 {TextFetchSelection procedure} {
+test text-20.3 {TextFetchSelection procedure} -setup {
+ text .t -width 20 -height 10
+ pack append . .t {top expand fill}
+ update
+} -body {
+ foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ .t insert end $i.0$i.1$i.2$i.3$i.4\n
+ }
.t tag remove sel 1.0 end
.t tag add sel 13.3
selection get
-} {m}
-test text-18.4 {TextFetchSelection procedure} {
+} -cleanup {
+ destroy .t
+} -result {m}
+test text-20.4 {TextFetchSelection procedure} -setup {
+ text .t -width 20 -height 10
+ pack append . .t {top expand fill}
+ update
+} -body {
+ foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ .t insert end $i.0$i.1$i.2$i.3$i.4\n
+ }
.t tag remove x 1.0 end
.t tag add sel 1.0 3.4
.t tag remove sel 1.0 end
@@ -1324,674 +3607,1043 @@ test text-18.4 {TextFetchSelection procedure} {
.t tag add sel 10.0 10.end
.t tag add sel 13.3
selection get
-} {0a..1b.2b.3b.4
+} -cleanup {
+ destroy .t
+} -result {0a..1b.2b.3b.4
cj.0j.1j.2j.3j.4m}
-set x ""
-for {set i 1} {$i < 200} {incr i} {
- append x "This is line $i, padded to just about 53 characters.\n"
-}
-test text-18.5 {TextFetchSelection procedure, long selections} {
- .t delete 1.0 end
+test text-20.5 {TextFetchSelection procedure, long selections} -setup {
+ text .t -width 20 -height 10
+ pack append . .t {top expand fill}
+ update
+ set x ""
+} -body {
+ for {set i 1} {$i < 200} {incr i} {
+ append x "This is line $i, padded to just about 53 characters.\n"
+ }
.t insert end $x
.t tag add sel 1.0 end
- selection get
-} $x\n
+ expr {[selection get] eq "$x\n"}
+} -cleanup {
+ destroy .t
+} -result {1}
+
-test text-19.1 {TkTextLostSelection procedure} unix {
- catch {destroy .t2}
+test text-21.1 {TkTextLostSelection procedure} -constraints unix -setup {
+ text .t
+ .t insert 1.0 "Line 1"
+ entry .t.e
+ .t.e insert end "abcdefg"
text .t2
.t2 insert 1.0 "abc\ndef\nghijk\n1234"
+} -body {
.t2 tag add sel 1.2 3.3
+ .t.e select from 0
.t.e select to 1
.t2 tag ranges sel
-} {}
-test text-19.2 {TkTextLostSelection procedure} win {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t .t2
+} -result {}
+test text-21.2 {TkTextLostSelection procedure} -constraints win -setup {
+ text .t
+ .t insert 1.0 "Line 1"
+ entry .t.e
+ .t.e insert end "abcdefg"
text .t2
.t2 insert 1.0 "abc\ndef\nghijk\n1234"
+} -body {
.t2 tag add sel 1.2 3.3
+ .t.e select from 0
.t.e select to 1
.t2 tag ranges sel
-} {1.2 3.3}
-catch {destroy .t2}
-test text-19.3 {TkTextLostSelection procedure} {
- catch {destroy .t2}
- text .t2
- .t2 insert 1.0 "abcdef\nghijk\n1234"
- .t2 tag add sel 1.0 1.3
+} -cleanup {
+ destroy .t .t2
+} -result {1.2 3.3}
+test text-21.3 {TkTextLostSelection procedure} -body {
+ text .t
+ .t insert 1.0 "abcdef\nghijk\n1234"
+ .t tag add sel 1.0 1.3
+ selection get
+ selection clear
+ selection get
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined}
+test text-21.4 {TkTextLostSelection procedure} -body {
+ text .t
+ .t insert 1.0 "abcdef\nghijk\n1234"
+ .t tag add sel 1.0 1.3
set x [selection get]
selection clear
- lappend x [catch {selection get} msg] $msg
- .t2 tag add sel 1.0 1.3
+ catch {selection get}
+ .t tag add sel 1.0 1.3
lappend x [selection get]
-} {abc 1 {PRIMARY selection doesn't exist or form "STRING" not defined} abc}
-
-.t delete 1.0 end
-.t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
-test text-20.1 {TextSearchCmd procedure, argument parsing} {
- list [catch {.t search -} msg] $msg
-} {1 {bad switch "-": must be --, -all, -backward, -count, -elide, -exact, -forward, -nocase, -nolinestop, -overlap, -regexp, or -strictlimits}}
-test text-20.2 {TextSearchCmd procedure, -backwards option} {
+} -cleanup {
+ destroy .t
+} -result {abc abc}
+
+
+test text-22.1 {TextSearchCmd procedure, argument parsing} -body {
+ text .t
+ .t search -
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad switch "-": must be --, -all, -backward, -count, -elide, -exact, -forward, -nocase, -nolinestop, -overlap, -regexp, or -strictlimits}
+test text-22.2 {TextSearchCmd procedure, -backwards option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards xyz 1.4
-} {1.1}
-test text-20.2.1 {TextSearchCmd procedure, -all option} {
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.3 {TextSearchCmd procedure, -all option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -all xyz 1.4
-} {1.5 3.0 3.5 1.1}
-test text-20.3 {TextSearchCmd procedure, -forwards option} {
+} -cleanup {
+ destroy .t
+} -result {1.5 3.0 3.5 1.1}
+test text-22.4 {TextSearchCmd procedure, -forwards option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -forwards xyz 1.4
-} {1.5}
-test text-20.4 {TextSearchCmd procedure, -exact option} {
+} -cleanup {
+ destroy .t
+} -result {1.5}
+test text-22.5 {TextSearchCmd procedure, -exact option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -f -exact x. 1.0
-} {1.9}
-test text-20.5 {TextSearchCmd procedure, -regexp option} {
+} -cleanup {
+ destroy .t
+} -result {1.9}
+test text-22.6 {TextSearchCmd procedure, -regexp option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -b -regexp x.z 1.4
-} {1.1}
-test text-20.6 {TextSearchCmd procedure, -count option} {
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.7 {TextSearchCmd procedure, -count option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
set length unmodified
list [.t search -count length x. 1.4] $length
-} {1.9 2}
-test text-20.7 {TextSearchCmd procedure, -count option} {
- list [catch {.t search -count} msg] $msg
-} {1 {no value given for "-count" option}}
-test text-20.8 {TextSearchCmd procedure, -nocase option} {
+} -cleanup {
+ destroy .t
+} -result {1.9 2}
+test text-22.8 {TextSearchCmd procedure, -count option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search -count
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {no value given for "-count" option}
+test text-22.9 {TextSearchCmd procedure, -nocase option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search -nocase BaR 1.1] [.t search BaR 1.1]
-} {2.13 2.23}
-test text-20.9 {TextSearchCmd procedure, -n ambiguous option} {
- list [catch {.t search -n BaR 1.1} msg] $msg
-} {1 {bad switch "-n": must be --, -all, -backward, -count, -elide, -exact, -forward, -nocase, -nolinestop, -overlap, -regexp, or -strictlimits}}
-test text-20.9.1 {TextSearchCmd procedure, -nocase option} {
+} -cleanup {
+ destroy .t
+} -result {2.13 2.23}
+test text-22.10 {TextSearchCmd procedure, -n ambiguous option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search -n BaR 1.1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad switch "-n": must be --, -all, -backward, -count, -elide, -exact, -forward, -nocase, -nolinestop, -overlap, -regexp, or -strictlimits}
+test text-22.11 {TextSearchCmd procedure, -nocase option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -noc BaR 1.1
-} {2.13}
-test text-20.9.2 {TextSearchCmd procedure, -nolinestop option} {
- list [catch {.t search -nolinestop BaR 1.1} msg] $msg
-} {1 {the "-nolinestop" option requires the "-regexp" option to be present}}
-test text-20.9.3 {TextSearchCmd procedure, -nolinestop option} {
+} -cleanup {
+ destroy .t
+} -result {2.13}
+test text-22.12 {TextSearchCmd procedure, -nolinestop option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search -nolinestop BaR 1.1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {the "-nolinestop" option requires the "-regexp" option to be present}
+test text-22.13 {TextSearchCmd procedure, -nolinestop option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
set msg ""
list [.t search -nolinestop -regexp -count msg e.*o 1.1] $msg
-} {1.14 32}
-test text-20.10 {TextSearchCmd procedure, -- option} {
+} -cleanup {
+ destroy .t
+} -result {1.14 32}
+test text-22.14 {TextSearchCmd procedure, -- option} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -- -forward 1.0
-} {2.4}
-test text-20.11 {TextSearchCmd procedure, argument parsing} {
- list [catch {.t search abc} msg] $msg
-} {1 {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"}}
-test text-20.12 {TextSearchCmd procedure, argument parsing} {
- list [catch {.t search abc d e f} msg] $msg
-} {1 {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"}}
-test text-20.13 {TextSearchCmd procedure, check index} {
- list [catch {.t search abc gorp} msg] $msg
-} {1 {bad text index "gorp"}}
-test text-20.14 {TextSearchCmd procedure, startIndex == "end"} {
+} -cleanup {
+ destroy .t
+} -result {2.4}
+test text-22.15 {TextSearchCmd procedure, argument parsing} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search abc
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"}
+test text-22.16 {TextSearchCmd procedure, argument parsing} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search abc d e f
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t search ?switches? pattern index ?stopIndex?"}
+test text-22.17 {TextSearchCmd procedure, check index} -body {
+ text .t
+ .t search abc gorp
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "gorp"}
+test text-22.18 {TextSearchCmd procedure, startIndex == "end"} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search non-existent end
-} {}
-test text-20.15 {TextSearchCmd procedure, startIndex == "end"} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.19 {TextSearchCmd procedure, startIndex == "end"} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search non-existent end
-} {}
-test text-20.16 {TextSearchCmd procedure, bad stopIndex} {
- list [catch {.t search abc 1.0 lousy} msg] $msg
-} {1 {bad text index "lousy"}}
-test text-20.17 {TextSearchCmd procedure, pattern case conversion} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.20 {TextSearchCmd procedure, bad stopIndex} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search abc 1.0 lousy
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "lousy"}
+test text-22.21 {TextSearchCmd procedure, pattern case conversion} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search -nocase BAR 1.1] [.t search BAR 1.1]
-} {2.13 {}}
-test text-20.18 {TextSearchCmd procedure, bad regular expression pattern} {
- list [catch {.t search -regexp a( 1.0} msg] $msg
-} {1 {couldn't compile regular expression pattern: parentheses () not balanced}}
-test text-20.19 {TextSearchCmd procedure, skip dummy last line} {
+} -cleanup {
+ destroy .t
+} -result {2.13 {}}
+test text-22.22 {TextSearchCmd procedure, bad regular expression pattern} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ .t search -regexp a( 1.0
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {couldn't compile regular expression pattern: parentheses () not balanced}
+test text-22.23 {TextSearchCmd procedure, skip dummy last line} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards BaR end 1.0
-} {2.23}
-test text-20.20 {TextSearchCmd procedure, skip dummy last line} {
+} -cleanup {
+ destroy .t
+} -result {2.23}
+test text-22.24 {TextSearchCmd procedure, skip dummy last line} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards \n end 1.0
-} {3.9}
-test text-20.21 {TextSearchCmd procedure, skip dummy last line} {
+} -cleanup {
+ destroy .t
+} -result {3.9}
+test text-22.25 {TextSearchCmd procedure, skip dummy last line} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search \n end
-} {1.15}
-test text-20.22 {TextSearchCmd procedure, skip dummy last line} {
+} -cleanup {
+ destroy .t
+} -result {1.15}
+test text-22.26 {TextSearchCmd procedure, skip dummy last line} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -back \n 1.0
-} {3.9}
-test text-20.23 {TextSearchCmd procedure, extract line contents} {
+} -cleanup {
+ destroy .t
+} -result {3.9}
+test text-22.27 {TextSearchCmd procedure, extract line contents} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t tag add foo 1.2
.t tag add x 1.3
.t mark set silly 1.2
.t search xyz 3.6
-} {1.1}
-test text-20.24 {TextSearchCmd procedure, stripping newlines} {
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.28 {TextSearchCmd procedure, stripping newlines} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search the\n 1.0
-} {1.12}
-test text-20.25 {TextSearchCmd procedure, handling newlines} {
+} -cleanup {
+ destroy .t
+} -result {1.12}
+test text-22.29 {TextSearchCmd procedure, handling newlines} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -regexp the\n 1.0
-} {1.12}
-test text-20.26 {TextSearchCmd procedure, stripping newlines} {
+} -cleanup {
+ destroy .t
+} -result {1.12}
+test text-22.30 {TextSearchCmd procedure, stripping newlines} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -regexp {the$} 1.0
-} {1.12}
-test text-20.27 {TextSearchCmd procedure, handling newlines} {
+} -cleanup {
+ destroy .t
+} -result {1.12}
+test text-22.31 {TextSearchCmd procedure, handling newlines} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -regexp \n 1.0
-} {1.15}
-test text-20.28 {TextSearchCmd procedure, line case conversion} {
+} -cleanup {
+ destroy .t
+} -result {1.15}
+test text-22.32 {TextSearchCmd procedure, line case conversion} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search -nocase bar 2.18] [.t search bar 2.18]
-} {2.23 2.13}
-test text-20.29 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {2.23 2.13}
+test text-22.33 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards xyz 1.6
-} {1.5}
-test text-20.30 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {1.5}
+test text-22.34 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards xyz 1.5
-} {1.1}
-test text-20.31 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.35 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search xyz 1.5
-} {1.5}
-test text-20.32 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {1.5}
+test text-22.36 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search xyz 1.6
-} {3.0}
-test text-20.33 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {3.0}
+test text-22.37 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search {} 1.end
-} {1.15}
-test text-20.34 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {1.15}
+test text-22.38 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search f 1.end
-} {2.0}
-test text-20.35 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.39 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search {} end
-} {1.0}
-test text-20.35a {TextSearchCmd procedure, regexp finds empty lines} {
- # Test for fix of bug #1643
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.40 {TextSearchCmd procedure, regexp finds empty lines} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+# Test for fix of bug #1643
.t insert end "\n"
tk::TextSetCursor .t 4.0
.t search -forward -regexp {^$} insert end
-} {4.0}
-
-catch {destroy .t2}
-toplevel .t2
-wm geometry .t2 +0+0
-text .t2.t -width 30 -height 10
-pack .t2.t
-.t2.t insert 1.0 "This is a line\nand this is another"
-.t2.t insert end "\nand this is yet another"
-frame .t2.f -width 20 -height 20 -bd 2 -relief raised
-.t2.t window create 2.5 -window .t2.f
-test text-20.36 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search his 2.6
-} {2.6}
-test text-20.37 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search this 2.6
-} {3.4}
-test text-20.38 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search is 2.6
-} {2.7}
-test text-20.39 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search his 2.7
-} {3.5}
-test text-20.40 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search -backwards "his is another" 2.6
-} {2.6}
-test text-20.41 {TextSearchCmd procedure, firstChar and lastChar} {
- .t2.t search -backwards "his is" 2.6
-} {1.1}
-destroy .t2
-test text-20.42 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {4.0}
+test text-22.41 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search his 2.6
+} -cleanup {
+ destroy .top
+} -result {2.6}
+test text-22.42 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search this 2.6
+} -cleanup {
+ destroy .top
+} -result {3.4}
+test text-22.43 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search is 2.6
+} -cleanup {
+ destroy .top
+} -result {2.7}
+test text-22.44 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search his 2.7
+} -cleanup {
+ destroy .top
+} -result {3.5}
+test text-22.45 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search -backwards "his is another" 2.6
+} -cleanup {
+ destroy .top
+} -result {2.6}
+test text-22.46 {TextSearchCmd procedure, firstChar and lastChar} -setup {
+ toplevel .top
+ text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
+ pack .top.t
+} -body {
+ .top.t insert 1.0 "This is a line\nand this is another"
+ .top.t insert end "\nand this is yet another"
+ frame .top.f -width 20 -height 20 -bd 2 -relief raised
+ .top.t window create 2.5 -window .top.f
+ .top.t search -backwards "his is" 2.6
+} -cleanup {
+ destroy .top
+} -result {1.1}
+test text-22.47 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards forw 2.5
-} {2.5}
-test text-20.43 {TextSearchCmd procedure, firstChar and lastChar} {
+} -cleanup {
+ destroy .t
+} -result {2.5}
+test text-22.48 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search forw 2.5
-} {2.5}
-test text-20.44 {TextSearchCmd procedure, firstChar and lastChar} {
- catch {destroy .t2}
+} -cleanup {
+ destroy .t
+} -result {2.5}
+test text-22.49 {TextSearchCmd procedure, firstChar and lastChar} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+ catch {destroy .t}
text .t2
list [.t2 search a 1.0] [.t2 search -backward a 1.0]
-} {{} {}}
-test text-20.45 {TextSearchCmd procedure, regexp match length} {
+} -cleanup {
+ destroy .t .t2
+} -result {{} {}}
+test text-22.50 {TextSearchCmd procedure, regexp match length} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
set length unchanged
list [.t search -regexp -count length x(.)(.*)z 1.1] $length
-} {1.1 7}
-test text-20.46 {TextSearchCmd procedure, regexp match length} {
+} -cleanup {
+ destroy .t
+} -result {1.1 7}
+test text-22.51 {TextSearchCmd procedure, regexp match length} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
set length unchanged
list [.t search -regexp -backward -count length fo* 2.5] $length
-} {2.0 3}
-test text-20.47 {TextSearchCmd procedure, checking stopIndex} {
+} -cleanup {
+ destroy .t
+} -result {2.0 3}
+test text-22.52 {TextSearchCmd procedure, checking stopIndex} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search bar 2.1 2.13] [.t search bar 2.1 2.14] \
[.t search bar 2.12 2.14] [.t search bar 2.14 2.14]
-} {{} 2.13 2.13 {}}
-test text-20.48 {TextSearchCmd procedure, checking stopIndex} {
+} -cleanup {
+ destroy .t
+} -result {{} 2.13 2.13 {}}
+test text-22.53 {TextSearchCmd procedure, checking stopIndex} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search -backwards bar 2.20 2.13] \
[.t search -backwards bar 2.20 2.14] \
[.t search -backwards bar 2.14 2.13] \
[.t search -backwards bar 2.13 2.13]
-} {2.13 {} 2.13 {}}
-test text-20.48.1 {TextSearchCmd procedure, checking stopIndex} {
+} -cleanup {
+ destroy .t
+} -result {2.13 {} 2.13 {}}
+test text-22.54 {TextSearchCmd procedure, checking stopIndex} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
list [.t search -backwards -strict bar 2.20 2.13] \
[.t search -backwards -strict bar 2.20 2.14] \
[.t search -backwards -strict bar 2.14 2.13] \
[.t search -backwards -strict bar 2.13 2.13]
-} {2.13 {} {} {}}
-test text-20.49 {TextSearchCmd procedure, embedded windows and index/count} {
+} -cleanup {
+ destroy .t
+} -result {2.13 {} {} {}}
+test text-22.55 {TextSearchCmd procedure, embedded windows and index/count} -setup {
+ text .t
frame .t.f1 -width 20 -height 20 -relief raised -bd 2
frame .t.f2 -width 20 -height 20 -relief raised -bd 2
frame .t.f3 -width 20 -height 20 -relief raised -bd 2
frame .t.f4 -width 20 -height 20 -relief raised -bd 2
+ set result ""
+} -body {
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t window create 2.10 -window .t.f3
.t window create 2.8 -window .t.f2
.t window create 2.8 -window .t.f1
.t window create 2.1 -window .t.f4
- set result ""
lappend result [.t search -count x forward 1.0] $x
lappend result [.t search -count x wa 1.0] $x
- .t delete 2.1
- .t delete 2.8 2.10
- .t delete 2.10
- set result
-} {2.6 10 2.11 2}
-test text-20.50 {TextSearchCmd procedure, error setting variable} {
- catch {unset a}
+ return $result
+} -cleanup {
+ destroy .t
+} -result {2.6 10 2.11 2}
+test text-22.56 {TextSearchCmd procedure, error setting variable} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
set a 44
- list [catch {.t search -count a(2) xyz 1.0} msg] $msg
-} {1 {can't set "a(2)": variable isn't array}}
-test text-20.51 {TextSearchCmd procedure, wrap-around} {
+ .t search -count a(2) xyz 1.0
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {can't set "a(2)": variable isn't array}
+test text-22.57 {TextSearchCmd procedure, wrap-around} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards xyz 1.1
-} {3.5}
-test text-20.52 {TextSearchCmd procedure, wrap-around} {
+} -cleanup {
+ destroy .t
+} -result {3.5}
+test text-22.58 {TextSearchCmd procedure, wrap-around} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -backwards xyz 1.1 1.0
-} {}
-test text-20.53 {TextSearchCmd procedure, wrap-around} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.59 {TextSearchCmd procedure, wrap-around} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search xyz 3.6
-} {1.1}
-test text-20.54 {TextSearchCmd procedure, wrap-around} {
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.60 {TextSearchCmd procedure, wrap-around} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search xyz 3.6 end
-} {}
-test text-20.55 {TextSearchCmd procedure, no match} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.61 {TextSearchCmd procedure, no match} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search non_existent 3.5
-} {}
-test text-20.56 {TextSearchCmd procedure, no match} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.62 {TextSearchCmd procedure, no match} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -regexp non_existent 3.5
-} {}
-test text-20.57 {TextSearchCmd procedure, special cases} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.63 {TextSearchCmd procedure, special cases} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -back x 1.1
-} {1.0}
-test text-20.58 {TextSearchCmd procedure, special cases} {
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.64 {TextSearchCmd procedure, special cases} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search -back x 1.0
-} {3.8}
-test text-20.59 {TextSearchCmd procedure, special cases} {
+} -cleanup {
+ destroy .t
+} -result {3.8}
+test text-22.65 {TextSearchCmd procedure, special cases} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search \n {end-2c}
-} {3.9}
-test text-20.60 {TextSearchCmd procedure, special cases} {
+} -cleanup {
+ destroy .t
+} -result {3.9}
+test text-22.66 {TextSearchCmd procedure, special cases} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search \n end
-} {1.15}
-test text-20.61 {TextSearchCmd procedure, special cases} {
+} -cleanup {
+ destroy .t
+} -result {1.15}
+test text-22.67 {TextSearchCmd procedure, special cases} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
.t search x 1.0
-} {1.0}
-test text-20.62 {TextSearchCmd, freeing copy of pattern} {
- # This test doesn't return a result, but it will generate
- # a core leak if the pattern copy isn't properly freed.
- # (actually in Tk 8.5 objectification means there is no
- # longer a copy of the pattern, but we leave this test in
- # anyway).
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.68 {TextSearchCmd, freeing copy of pattern} -body {
+ text .t
+ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
+# This test doesn't return a result, but it will generate
+# a core leak if the pattern copy isn't properly freed.
+# (actually in Tk 8.5 objectification means there is no
+# longer a copy of the pattern, but we leave this test in
+# anyway).
set p abcdefg1234567890
set p $p$p$p$p$p$p$p$p
set p $p$p$p$p$p
.t search -nocase $p 1.0
-} {}
-test text-20.63 {TextSearchCmd, unicode} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.69 {TextSearchCmd, unicode} -body {
+ text .t
.t insert end "foo\u30c9\u30cabar"
.t search \u30c9\u30ca 1.0
-} 1.3
-test text-20.64 {TextSearchCmd, unicode} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.70 {TextSearchCmd, unicode} -body {
+ text .t
.t insert end "foo\u30c9\u30cabar"
list [.t search -count n \u30c9\u30ca 1.0] $n
-} {1.3 2}
-test text-20.65 {TextSearchCmd, unicode with non-text segments} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.3 2}
+test text-22.71 {TextSearchCmd, unicode with non-text segments} -body {
+ text .t
button .b1 -text baz
.t insert end "foo\u30c9"
.t window create end -window .b1
.t insert end "\u30cabar"
- set result [list [.t search -count n \u30c9\u30ca 1.0] $n]
- destroy .b1
- set result
-} {1.3 3}
-test text-20.66 {TextSearchCmd, hidden text does not affect match index} {
- 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} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "12345H7890"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.5
- .t2 search 7 1.0
-} 1.6
-test text-20.68 {TextSearchCmd, hidden text does not affect match index} {
- 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} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nbarbaz\nbazboo"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 2.0 3.0
- .t2 search boo 1.0
-} 3.3
-test text-20.70 {TextSearchCmd, -regexp -nocase searches} {
- catch {destroy .t}
+ list [.t search -count n \u30c9\u30ca 1.0] $n
+} -cleanup {
+ destroy .t .b1
+} -result {1.3 3}
+test text-22.72 {TextSearchCmd, hidden text does not affect match index} -body {
+ pack [text .t]
+ .t insert end "12345H7890"
+ .t search 7 1.0
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.73 {TextSearchCmd, hidden text does not affect match index} -body {
+ pack [text .t]
+ .t insert end "12345H7890"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.5
+ .t search 7 1.0
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.74 {TextSearchCmd, hidden text does not affect match index} -body {
+ pack [text .t]
+ .t insert end "foobar\nbarbaz\nbazboo"
+ .t search boo 1.0
+} -cleanup {
+ destroy .t
+} -result {3.3}
+test text-22.75 {TextSearchCmd, hidden text does not affect match index} -body {
+ pack [text .t]
+ .t insert end "foobar\nbarbaz\nbazboo"
+ .t tag configure hidden -elide true
+ .t tag add hidden 2.0 3.0
+ .t search boo 1.0
+} -cleanup {
+ destroy .t
+} -result {3.3}
+test text-22.76 {TextSearchCmd, -regexp -nocase searches} -body {
pack [text .t]
.t insert end "word1 word2"
- set res [.t search -nocase -regexp {\mword.} 1.0 end]
+ .t search -nocase -regexp {\mword.} 1.0 end
+} -cleanup {
destroy .t
- set res
-} 1.0
-test text-20.71 {TextSearchCmd, -regexp -nocase searches} {
- catch {destroy .t}
+} -result {1.0}
+test text-22.77 {TextSearchCmd, -regexp -nocase searches} -body {
pack [text .t]
.t insert end "word1 word2"
- set res [.t search -nocase -regexp {word.\M} 1.0 end]
+ .t search -nocase -regexp {word.\M} 1.0 end
+} -cleanup {
destroy .t
- set res
-} 1.0
-test text-20.72 {TextSearchCmd, -regexp -nocase searches} {
- catch {destroy .t}
+} -result {1.0}
+test text-22.78 {TextSearchCmd, -regexp -nocase searches} -body {
pack [text .t]
.t insert end "word1 word2"
- set res [.t search -nocase -regexp {word.\W} 1.0 end]
- destroy .t
- set res
-} 1.0
-test text-20.73 {TextSearchCmd, hidden text and start index} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search bar 1.3
-} 1.3
-test text-20.74 {TextSearchCmd, hidden text shouldn't influence start index} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.0 1.2
- .t2 search bar 1.3
-} 1.3
-test text-20.75 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- list [.t2 search -count foo foar 1.3] $foo
-} {1.0 6}
-test text-20.75.1 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
+ .t search -nocase -regexp {word.\W} 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.79 {TextSearchCmd, hidden text and start index} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search bar 1.3
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.80 {TextSearchCmd, hidden text shouldn't influence start index} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.0 1.2
+ .t search bar 1.3
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.81 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ list [.t search -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 6}
+test text-22.82 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
list \
- [.t2 search -strict -count foo foar 1.3] \
- [.t2 search -strict -count foo foar 2.3] $foo
-} {{} 1.0 6}
-test text-20.76 {TextSearchCmd, hidden text and start index} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -regexp bar 1.3
-} 1.3
-test text-20.77 {TextSearchCmd, hidden text shouldn't influence start index} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.0 1.2
- .t2 search -regexp bar 1.3
-} 1.3
-test text-20.78 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- list [.t2 search -regexp -count foo foar 1.3] $foo
-} {1.0 6}
-test text-20.78.1 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- list [.t2 search -count foo foar 1.3] $foo
-} {1.0 6}
-test text-20.78.2 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- .t2 search -strict -count foo foar 1.3
-} {}
-test text-20.78.3 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- .t2 tag add hidden 2.2 2.4
- list [.t2 search -regexp -all -count foo foar 1.3] $foo
-} {{2.0 3.0 1.0} {6 4 6}}
-test text-20.78.4 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- .t2 tag add hidden 2.2 2.4
- list [.t2 search -all -count foo foar 1.3] $foo
-} {{2.0 3.0 1.0} {6 4 6}}
-test text-20.78.5 {TextSearchCmd, hidden text inside match must count in length} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoar"
- .t2 tag configure hidden -elide true
- .t2 tag add hidden 1.2 1.4
- .t2 tag add hidden 2.2 2.4
- list [.t2 search -strict -all -count foo foar 1.3] $foo
-} {{2.0 3.0} {6 4}}
-test text-20.78.6 {TextSearchCmd, single line with -all} {
- deleteWindows
- pack [text .t2]
- .t2 insert end " X\n X\n X\n X\n X\n X\n"
- .t2 search -all -regexp { +| *\n} 1.0 end
-} {1.0 1.2 2.0 2.2 3.0 3.2 4.0 4.2 5.0 5.2 6.0 6.2 7.0}
-test text-20.79 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -count foo foobar\nfoo 1.0] $foo
-} {1.0 10}
-test text-20.80 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -count foo bar\nfoo 1.0] $foo
-} {1.3 7}
-test text-20.81 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -count foo \nfoo 1.0] $foo
-} {1.6 4}
-test text-20.82 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -count foo bar\nfoobar\nfoo 1.0] $foo
-} {1.3 14}
-test text-20.83 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -count foo bar\nfoobar\nfoobanearly 1.0
-} {}
-test text-20.84 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -regexp -count foo foobar\nfoo 1.0] $foo
-} {1.0 10}
-test text-20.85 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -regexp -count foo bar\nfoo 1.0] $foo
-} {1.3 7}
-test text-20.86 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -regexp -count foo \nfoo 1.0] $foo
-} {1.6 4}
-test text-20.87 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -regexp -count foo bar\nfoobar\nfoo 1.0] $foo
-} {1.3 14}
-test text-20.88 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -regexp -count foo bar\nfoobar\nfoobanearly 1.0
-} {}
-test text-20.89 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfaoobar\nfoobar"
- .t2 search -regexp -count foo bar\nfoo 1.0
-} {2.4}
-test text-20.90 {TextSearchCmd, multiline matching end of window} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfaoobar\nfoobar"
- .t2 search -regexp -count foo bar\nfoobar\n\n 1.0
-} {}
-test text-20.91 {TextSearchCmd, multiline matching end of window} {
- deleteWindows
- pack [text .t2]
- .t2 search "\n\n" 1.0
-} {}
-test text-20.92 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -count foo foobar\nfoo end] $foo
-} {2.0 10}
-test text-20.93 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -count foo bar\nfoo 1.0] $foo
-} {2.3 7}
-test text-20.94 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -count foo \nfoo 1.0] $foo
-} {2.6 4}
-test text-20.95 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -count foo bar\nfoobar\nfoo 1.0] $foo
-} {1.3 14}
-test text-20.96 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -backwards -count foo bar\nfoobar\nfoobanearly 1.0
-} {}
-test text-20.97 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -regexp -count foo foobar\nfoo end] $foo
-} {2.0 10}
-test text-20.97.1 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -regexp -count foo foobar\nfo end] $foo
-} {2.0 9}
-test text-20.98 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -regexp -count foo bar\nfoo 1.0] $foo
-} {2.3 7}
-test text-20.99 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -regexp -count foo \nfoo 1.0] $foo
-} {2.6 4}
-test text-20.100 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- list [.t2 search -backwards -regexp -count foo bar\nfoobar\nfoo 1.0] $foo
-} {1.3 14}
-test text-20.101 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -backwards -regexp -count foo bar\nfoobar\nfoobanearly 1.0
-} {}
-test text-20.102 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfaoobar\nfoobar"
- .t2 search -backwards -regexp -count foo bar\nfoo 1.0
-} {2.4}
-test text-20.103 {TextSearchCmd, multiline matching end of window} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfaoobar\nfoobar"
- .t2 search -backwards -regexp -count foo bar\nfoobar\n\n 1.0
-} {}
-test text-20.104 {TextSearchCmd, multiline matching end of window} {
- deleteWindows
- pack [text .t2]
- .t2 search -backwards "\n\n" 1.0
-} {}
-test text-20.105 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 { Tcl_Obj *objPtr));
+ [.t search -strict -count foo foar 1.3] \
+ [.t search -strict -count foo foar 2.3] $foo
+} -cleanup {
+ destroy .t
+} -result {{} 1.0 6}
+test text-22.83 {TextSearchCmd, hidden text and start index} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -regexp bar 1.3
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.84 {TextSearchCmd, hidden text shouldn't influence start index} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.0 1.2
+ .t search -regexp bar 1.3
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.85 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ list [.t search -regexp -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 6}
+test text-22.86 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ list [.t search -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 6}
+test text-22.87 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ .t search -strict -count foo foar 1.3
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.88 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ .t tag add hidden 2.2 2.4
+ list [.t search -regexp -all -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {{2.0 3.0 1.0} {6 4 6}}
+test text-22.89 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ .t tag add hidden 2.2 2.4
+ list [.t search -all -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {{2.0 3.0 1.0} {6 4 6}}
+test text-22.90 {TextSearchCmd, hidden text inside match must count in length} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoar"
+ .t tag configure hidden -elide true
+ .t tag add hidden 1.2 1.4
+ .t tag add hidden 2.2 2.4
+ list [.t search -strict -all -count foo foar 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {{2.0 3.0} {6 4}}
+test text-22.91 {TextSearchCmd, single line with -all} -body {
+ pack [text .t]
+ .t insert end " X\n X\n X\n X\n X\n X\n"
+ .t search -all -regexp { +| *\n} 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.0 1.2 2.0 2.2 3.0 3.2 4.0 4.2 5.0 5.2 6.0 6.2 7.0}
+test text-22.92 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -count foo foobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 10}
+test text-22.93 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -count foo bar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 7}
+test text-22.94 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -count foo \nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.6 4}
+test text-22.95 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -count foo bar\nfoobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 14}
+test text-22.96 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -count foo bar\nfoobar\nfoobanearly 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.97 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -regexp -count foo foobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 10}
+test text-22.98 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -regexp -count foo bar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 7}
+test text-22.99 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -regexp -count foo \nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.6 4}
+test text-22.100 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -regexp -count foo bar\nfoobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 14}
+test text-22.101 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -regexp -count foo bar\nfoobar\nfoobanearly 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.102 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfaoobar\nfoobar"
+ .t search -regexp -count foo bar\nfoo 1.0
+} -cleanup {
+ destroy .t
+} -result {2.4}
+test text-22.103 {TextSearchCmd, multiline matching end of window} -body {
+ pack [text .t]
+ .t insert end "foobar\nfaoobar\nfoobar"
+ .t search -regexp -count foo bar\nfoobar\n\n 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.104 {TextSearchCmd, multiline matching end of window} -body {
+ pack [text .t]
+ .t search "\n\n" 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.105 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -count foo foobar\nfoo end] $foo
+} -cleanup {
+ destroy .t
+} -result {2.0 10}
+test text-22.106 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -count foo bar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {2.3 7}
+test text-22.107 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -count foo \nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {2.6 4}
+test text-22.108 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -count foo bar\nfoobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 14}
+test text-22.109 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -backwards -count foo bar\nfoobar\nfoobanearly 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.110 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -regexp -count foo foobar\nfoo end] $foo
+} -cleanup {
+ destroy .t
+} -result {2.0 10}
+test text-22.111 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -regexp -count foo foobar\nfo end] $foo
+} -cleanup {
+ destroy .t
+} -result {2.0 9}
+test text-22.112 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -regexp -count foo bar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {2.3 7}
+test text-22.113 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -regexp -count foo \nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {2.6 4}
+test text-22.114 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ list [.t search -backwards -regexp -count foo bar\nfoobar\nfoo 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 14}
+test text-22.115 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -backwards -regexp -count foo bar\nfoobar\nfoobanearly 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.116 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfaoobar\nfoobar"
+ .t search -backwards -regexp -count foo bar\nfoo 1.0
+} -cleanup {
+ destroy .t
+} -result {2.4}
+test text-22.117 {TextSearchCmd, multiline matching end of window} -body {
+ pack [text .t]
+ .t insert end "foobar\nfaoobar\nfoobar"
+ .t search -backwards -regexp -count foo bar\nfoobar\n\n 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.118 {TextSearchCmd, multiline matching end of window} -body {
+ pack [text .t]
+ .t search -backwards "\n\n" 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.119 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 { Tcl_Obj *objPtr));
static Tcl_Obj* FSNormalizeAbsolutePath
_ANSI_ARGS_((Tcl_Interp* interp, Tcl_Obj *pathPtr));}
set markExpr "^(\[A-Za-z0-9~_\]+\[ \t\n\r\]*\\(|(\[^ \t\(#\n\r/@:\*\]\[^=\(\r\n\]*\[ \t\]+\\*?)?"
append markExpr "(\[A-Za-z0-9~_\]+(<\[^>\]*>)?(::)?(\[A-Za-z0-9~_\]+::)*\[-A-Za-z0-9~_+ <>\|\\*/\]+|\[A-Za-z0-9~_\]+)"
append markExpr "\[ \n\t\r\]*\\()"
- .t2 search -forwards -regexp $markExpr 1.41 end
-} {}
-test text-20.106 {TextSearchCmd, multiline regexp matching} {
- # Practical example which used to crash Tk, but only after the
- # search is complete. This is memory corruption caused by
- # a bug in Tcl's handling of string objects.
- # (Tcl bug 635200)
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 {static int SetFsPathFromAny _ANSI_ARGS_((Tcl_Interp *interp,
+ .t search -forwards -regexp $markExpr 1.41 end
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.120 {TextSearchCmd, multiline regexp matching} -body {
+# Practical example which used to crash Tk, but only after the
+# search is complete. This is memory corruption caused by
+# a bug in Tcl's handling of string objects.
+# (Tcl bug 635200)
+ pack [text .t]
+ .t insert 1.0 {static int SetFsPathFromAny _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
static Tcl_Obj* FSNormalizeAbsolutePath
_ANSI_ARGS_((Tcl_Interp* interp, Tcl_Obj *pathPtr));}
set markExpr "^(\[A-Za-z0-9~_\]+\[ \t\n\r\]*\\(|(\[^ \t\(#\n\r/@:\*\]\[^=\(\r\n\]*\[ \t\]+\\*?)?"
append markExpr "(\[A-Za-z0-9~_\]+(<\[^>\]*>)?(::)?(\[A-Za-z0-9~_\]+::)*\[-A-Za-z0-9~_+ <>\|\\*/\]+|\[A-Za-z0-9~_\]+)"
append markExpr "\[ \n\t\r\]*\\()"
- .t2 search -forwards -regexp $markExpr 1.41 end
-} {}
-test text-20.107 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 {
+ .t search -forwards -regexp $markExpr 1.41 end
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.121 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 {
static int SetFsPathFromAny _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
static Tcl_Obj* FSNormalizeAbsolutePath
@@ -1999,240 +4651,275 @@ static Tcl_Obj* FSNormalizeAbsolutePath
set markExpr "^(\[A-Za-z0-9~_\]+\[ \t\n\r\]*\\(|(\[^ \t\(#\n\r/@:\*\]\[^=\(\r\n\]*\[ \t\]+\\*?)?"
append markExpr "(\[A-Za-z0-9~_\]+(<\[^>\]*>)?(::)?(\[A-Za-z0-9~_\]+::)*\[-A-Za-z0-9~_+ <>\|\\*/\]+|\[A-Za-z0-9~_\]+)"
append markExpr "\[ \n\t\r\]*\\()"
- .t2 search -backwards -all -regexp $markExpr end
-} {2.0}
-test text-20.108 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -all -regexp -count foo bar\nfoo 1.0
-} {1.3 2.3}
-test text-20.109 {TextSearchCmd, multiline matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -all -backwards -regexp -count foo bar\nfoo 1.0
-} {2.3 1.3}
-test text-20.110 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -- "blah" 3.3 1.3
-} {}
-test text-20.111 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "foobar\nfoobar\nfoobar"
- .t2 search -backwards -- "blah" 1.3 3.3
-} {}
-test text-20.112 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -backwards -regexp -- "\[\]\")\}\[(\{\]" "1.32" 1.0
-} {1.31}
-test text-20.113 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -regexp -- "\[\]\")\}\[(\{\]" 1.30 "1.0 lineend"
-} {1.31}
-test text-20.114 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -backwards -all -regexp -- "\[\]\")\}\[(\{\]" "1.32" 1.0
-} {1.31 1.29 1.3}
-test text-20.115 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -all -regexp -- "\[\]\")\}\[(\{\]" 1.0 "1.0 lineend"
-} {1.3 1.29 1.31}
-test text-20.116 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -backwards -- "\{" "1.32" 1.0
-} {1.31}
-test text-20.117 {TextSearchCmd, wrapping and limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert end "if (stringPtr->uallocated > 0) \{x"
- .t2 search -- "\{" 1.30 "1.0 lineend"
-} {1.31}
-test text-20.118 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 {
+ .t search -backwards -all -regexp $markExpr end
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.122 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -all -regexp -count foo bar\nfoo 1.0
+} -cleanup {
+ destroy .t
+} -result {1.3 2.3}
+test text-22.123 {TextSearchCmd, multiline matching} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -all -backwards -regexp -count foo bar\nfoo 1.0
+} -cleanup {
+ destroy .t
+} -result {2.3 1.3}
+test text-22.124 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -- "blah" 3.3 1.3
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.125 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "foobar\nfoobar\nfoobar"
+ .t search -backwards -- "blah" 1.3 3.3
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.126 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -backwards -regexp -- "\[\]\")\}\[(\{\]" "1.32" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.31}
+test text-22.127 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -regexp -- "\[\]\")\}\[(\{\]" 1.30 "1.0 lineend"
+} -cleanup {
+ destroy .t
+} -result {1.31}
+test text-22.128 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -backwards -all -regexp -- "\[\]\")\}\[(\{\]" "1.32" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.31 1.29 1.3}
+test text-22.129 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -all -regexp -- "\[\]\")\}\[(\{\]" 1.0 "1.0 lineend"
+} -cleanup {
+ destroy .t
+} -result {1.3 1.29 1.31}
+test text-22.130 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -backwards -- "\{" "1.32" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.31}
+test text-22.131 {TextSearchCmd, wrapping and limits} -body {
+ pack [text .t]
+ .t insert end "if (stringPtr->uallocated > 0) \{x"
+ .t search -- "\{" 1.30 "1.0 lineend"
+} -cleanup {
+ destroy .t
+} -result {1.31}
+test text-22.132 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 {
void
Tcl_SetObjLength(objPtr, length)
register Tcl_Obj *objPtr; /* Pointer to object. This object must
- * not currently be shared. */
+ * not currently be shared. */
register int length; /* Number of bytes desired for string
* representation of object, not including
- * terminating null byte. */
+ * terminating null byte. */
\{
char *new;
}
set markExpr "^(\[A-Za-z0-9~_\]+\[ \t\n\r\]*\\(|(\[^ \t\(#\n\r/@:\*\]\[^=\(\r\n\]*\[ \t\]+\\*?)?"
append markExpr "(\[A-Za-z0-9~_\]+(<\[^>\]*>)?(::)?(\[A-Za-z0-9~_\]+::)*\[-A-Za-z0-9~_+ <>\|\\*/\]+|\[A-Za-z0-9~_\]+)"
append markExpr "\[ \n\t\r\]*\\()"
- .t2 search -all -regexp -- $markExpr 1.0
-} {4.0}
-test text-20.119 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
+ .t search -all -regexp -- $markExpr 1.0
+} -cleanup {
+ destroy .t
+} -result {4.0}
+test text-22.133 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
set markExpr {^[a-z]+}
- # This should not match, and should not wrap
- .t2 search -regexp -- $markExpr end end
-} {}
-test text-20.120 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
+# This should not match, and should not wrap
+ .t search -regexp -- $markExpr end end
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.134 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
set markExpr {^[a-z]+}
- # This should not match, and should not wrap
- .t2 search -regexp -- $markExpr end+10c end
-} {}
-test text-20.121 {TextSearchCmd, multiline regexp matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
+# This should not match, and should not wrap
+ .t search -regexp -- $markExpr end+10c end
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.135 {TextSearchCmd, multiline regexp matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
set markExpr {^[a-z]+}
- # This should not match, and should not wrap
- .t2 search -regexp -backwards -- $markExpr 1.0 1.0
-} {}
-test text-20.122 {TextSearchCmd, regexp linestop} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- .t2 search -regexp -- {i.*x} 1.0
-} {2.6}
-test text-20.123 {TextSearchCmd, multiline regexp nolinestop matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- .t2 search -regexp -nolinestop -- {i.*x} 1.0
-} {1.1}
-test text-20.124 {TextSearchCmd, regexp linestop} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- .t2 search -regexp -all -overlap -- {i.*x} 1.0
-} {2.6}
-test text-20.124.1 {TextSearchCmd, regexp linestop} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- .t2 search -regexp -all -- {i.*x} 1.0
-} {2.6}
-test text-20.125 {TextSearchCmd, multiline regexp nolinestop matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- list [.t2 search -regexp -all -overlap -count c -nolinestop -- {i.*x} 1.0] $c
-} {{1.1 2.6} {26 10}}
-test text-20.125.1 {TextSearchCmd, multiline regexp nolinestop matching} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "first line\nlast line of text"
- list [.t2 search -regexp -all -count c -nolinestop -- {i.*x} 1.0] $c
-} {1.1 26}
-test text-20.126 {TextSearchCmd, stop at end of line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " \t\n last line of text"
- .t2 search -regexp -nolinestop -- {[^ \t]} 1.0
-} {1.3}
-test text-20.127 {TextSearchCmd, overlapping all matches} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde abcde"
- list [.t2 search -regexp -all -overlap -count c -- {\w+} 1.0] $c
-} {{1.0 1.6} {5 5}}
-test text-20.127.1 {TextSearchCmd, non-overlapping all matches} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde abcde"
- list [.t2 search -regexp -all -count c -- {\w+} 1.0] $c
-} {{1.0 1.6} {5 5}}
-test text-20.128 {TextSearchCmd, stop at end of line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde abcde"
- list [.t2 search -backwards -regexp -all -count c -- {\w+} 1.0] $c
-} {{1.6 1.0} {5 5}}
-test text-20.129 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -regexp -count c -- {Z\w+} 1.21 1.5] $c
-} {1.8 8}
-test text-20.130 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -all -overlap -regexp -count c -- {Z\w+} 1.21 1.5] $c
-} {1.8 8}
-test text-20.130.1 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -all -regexp -count c -- {Z\w+} 1.21 1.5] $c
-} {1.8 8}
-test text-20.131 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -overlap -all -regexp -count c -- {Z\w+} 1.21 1.1] $c
-} {1.4 12}
-test text-20.131.1 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -overlap -all -regexp -count c -- {Z[^Z]+Z} 1.21 1.1] $c
-} {{1.8 1.4} {5 5}}
-test text-20.131.2 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- list [.t2 search -backwards -all -regexp -count c -- {Z\w+} 1.21 1.1] $c
-} {1.4 12}
-test text-20.132 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again\n"
- list [.t2 search -backwards -all -overlap -regexp -count c -- {Z\w+} 2.21 1.5] $c
-} {{2.4 1.8} {12 8}}
-test text-20.132.1 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again\n"
- list [.t2 search -backwards -all -regexp -count c -- {Z\w+} 2.21 1.5] $c
-} {{2.4 1.8} {12 8}}
-test text-20.133 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again\n"
- list [.t2 search -backwards -overlap -all -regexp -count c -- {Z\w+} 2.21 1.1] $c
-} {{2.4 1.4} {12 12}}
-test text-20.133.1 {TextSearchCmd, backwards search stop index } {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again"
- .t2 insert 1.0 "bla ZabcZdefZghi and some text again\n"
- list [.t2 search -backwards -all -regexp -count c -- {Z\w+} 2.21 1.1] $c
-} {{2.4 1.4} {12 12}}
-test text-20.134 {TextSearchCmd, search -all example} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 {
+# This should not match, and should not wrap
+ .t search -regexp -backwards -- $markExpr 1.0 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.136 {TextSearchCmd, regexp linestop} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ .t search -regexp -- {i.*x} 1.0
+} -cleanup {
+ destroy .t
+} -result {2.6}
+test text-22.137 {TextSearchCmd, multiline regexp nolinestop matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ .t search -regexp -nolinestop -- {i.*x} 1.0
+} -cleanup {
+ destroy .t
+} -result {1.1}
+test text-22.138 {TextSearchCmd, regexp linestop} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ .t search -regexp -all -overlap -- {i.*x} 1.0
+} -cleanup {
+ destroy .t
+} -result {2.6}
+test text-22.139 {TextSearchCmd, regexp linestop} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ .t search -regexp -all -- {i.*x} 1.0
+} -cleanup {
+ destroy .t
+} -result {2.6}
+test text-22.140 {TextSearchCmd, multiline regexp nolinestop matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ list [.t search -regexp -all -overlap -count c -nolinestop -- {i.*x} 1.0] $c
+} -cleanup {
+ destroy .t
+} -result {{1.1 2.6} {26 10}}
+test text-22.141 {TextSearchCmd, multiline regexp nolinestop matching} -body {
+ pack [text .t]
+ .t insert 1.0 "first line\nlast line of text"
+ list [.t search -regexp -all -count c -nolinestop -- {i.*x} 1.0] $c
+} -cleanup {
+ destroy .t
+} -result {1.1 26}
+test text-22.142 {TextSearchCmd, stop at end of line} -body {
+ pack [text .t]
+ .t insert 1.0 " \t\n last line of text"
+ .t search -regexp -nolinestop -- {[^ \t]} 1.0
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.143 {TextSearchCmd, overlapping all matches} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde abcde"
+ list [.t search -regexp -all -overlap -count c -- {\w+} 1.0] $c
+} -cleanup {
+ destroy .t
+} -result {{1.0 1.6} {5 5}}
+test text-22.144 {TextSearchCmd, non-overlapping all matches} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde abcde"
+ list [.t search -regexp -all -count c -- {\w+} 1.0] $c
+} -cleanup {
+ destroy .t
+} -result {{1.0 1.6} {5 5}}
+test text-22.145 {TextSearchCmd, stop at end of line} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde abcde"
+ list [.t search -backwards -regexp -all -count c -- {\w+} 1.0] $c
+} -cleanup {
+ destroy .t
+} -result {{1.6 1.0} {5 5}}
+test text-22.146 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -regexp -count c -- {Z\w+} 1.21 1.5] $c
+} -cleanup {
+ destroy .t
+} -result {1.8 8}
+test text-22.147 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -all -overlap -regexp -count c -- {Z\w+} 1.21 1.5] $c
+} -cleanup {
+ destroy .t
+} -result {1.8 8}
+test text-22.148 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -all -regexp -count c -- {Z\w+} 1.21 1.5] $c
+} -cleanup {
+ destroy .t
+} -result {1.8 8}
+test text-22.149 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -overlap -all -regexp -count c -- {Z\w+} 1.21 1.1] $c
+} -cleanup {
+ destroy .t
+} -result {1.4 12}
+test text-22.150 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -overlap -all -regexp -count c -- {Z[^Z]+Z} 1.21 1.1] $c
+} -cleanup {
+ destroy .t
+} -result {{1.8 1.4} {5 5}}
+test text-22.151 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ list [.t search -backwards -all -regexp -count c -- {Z\w+} 1.21 1.1] $c
+} -cleanup {
+ destroy .t
+} -result {1.4 12}
+test text-22.152 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ .t insert 1.0 "bla ZabcZdefZghi and some text again\n"
+ list [.t search -backwards -all -overlap -regexp -count c -- {Z\w+} 2.21 1.5] $c
+} -cleanup {
+ destroy .t
+} -result {{2.4 1.8} {12 8}}
+test text-22.153 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ .t insert 1.0 "bla ZabcZdefZghi and some text again\n"
+ list [.t search -backwards -all -regexp -count c -- {Z\w+} 2.21 1.5] $c
+} -cleanup {
+ destroy .t
+} -result {{2.4 1.8} {12 8}}
+test text-22.154 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ .t insert 1.0 "bla ZabcZdefZghi and some text again\n"
+ list [.t search -backwards -overlap -all -regexp -count c -- {Z\w+} 2.21 1.1] $c
+} -cleanup {
+ destroy .t
+} -result {{2.4 1.4} {12 12}}
+test text-22.155 {TextSearchCmd, backwards search stop index } -body {
+ pack [text .t]
+ .t insert 1.0 "bla ZabcZdefZghi and some text again"
+ .t insert 1.0 "bla ZabcZdefZghi and some text again\n"
+ list [.t search -backwards -all -regexp -count c -- {Z\w+} 2.21 1.1] $c
+} -cleanup {
+ destroy .t
+} -result {{2.4 1.4} {12 12}}
+test text-22.156 {TextSearchCmd, search -all example} -body {
+ pack [text .t]
+ .t insert 1.0 {
See the package: supersearch for more information.
@@ -2246,697 +4933,947 @@ See the package: marks for more information.
}
set pat {package: ([a-zA-Z0-9][-a-zA-Z0-9._+#/]*)}
- list [.t2 search -nolinestop -regexp -nocase -all -forwards \
+ list [.t search -nolinestop -regexp -nocase -all -forwards \
-count c -- $pat 1.0 end] $c
-} {{3.8 6.8 8.0 11.8} {20 26 13 14}}
-test text-20.135 {TextSearchCmd, backwards search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
- .t2 search -backwards -regexp {fooba+rfoo} end
-} {1.6}
-test text-20.135.1 {TextSearchCmd, backwards search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
- .t2 search -backwards -overlap -all -regexp {fooba+rfoo} end
-} {1.6 1.0}
-test text-20.135.2 {TextSearchCmd, backwards search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
- .t2 search -backwards -all -regexp {fooba+rfoo} end
-} {1.6}
-test text-20.135.3 {TextSearchCmd, forwards search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
- .t2 search -all -overlap -regexp {fooba+rfoo} end
-} {1.0 1.6}
-test text-20.135.4 {TextSearchCmd, forwards search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
- .t2 search -all -regexp {fooba+rfoo} end
-} {1.0}
-test text-20.136 {TextSearchCmd, forward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abababab"
- .t2 search -exact -overlap -all {abab} 1.0
-} {1.0 1.2 1.4}
-test text-20.136.1 {TextSearchCmd, forward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abababab"
- .t2 search -exact -all {abab} 1.0
-} {1.0 1.4}
-test text-20.137 {TextSearchCmd, backward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "ababababab"
- .t2 search -exact -overlap -backwards -all {abab} end
-} {1.6 1.4 1.2 1.0}
-test text-20.137.1 {TextSearchCmd, backward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "ababababab"
- .t2 search -exact -backwards -all {abab} end
-} {1.6 1.2}
-test text-20.137.2 {TextSearchCmd, backward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abababababab"
- .t2 search -exact -backwards -all {abab} end
-} {1.8 1.4 1.0}
-test text-20.138 {TextSearchCmd, forward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -exact -overlap -all "foo\nbar\nfoo" 1.0
-} {1.0 3.0 5.0}
-test text-20.138.1 {TextSearchCmd, forward exact search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -exact -all "foo\nbar\nfoo" 1.0
-} {1.0 5.0}
-test text-20.139 {TextSearchCmd, backward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -exact -overlap -backward -all "foo\nbar\nfoo" end
-} {5.0 3.0 1.0}
-test text-20.140 {TextSearchCmd, backward exact search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -exact -backward -all "foo\nbar\nfoo" end
-} {5.0 1.0}
-test text-20.141 {TextSearchCmd, backward exact search overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -regexp -backward -overlap -all "foo\nbar\nfoo" end
-} {5.0 3.0 1.0}
-test text-20.142 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
- .t2 search -regexp -backward -all "foo\nbar\nfoo" end
-} {5.0 1.0}
-test text-20.142a {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -- {(\$)?[\w:_]+} 1.9
-} {1.7}
-test text-20.143 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.5
-} {1.7}
-test text-20.144 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.7
-} {1.7}
-test text-20.145 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.8
-} {1.8}
-test text-20.146 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -all -- {(\$)?[\w:_]+} 1.9 1.3
-} {1.7 1.3}
-test text-20.147 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -all -- {(\$)?[\w:_]+} 1.9 1.13
-} {}
-test text-20.148 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -all -- {(\$)?[\w:_]+} 2.0 1.3
-} {1.12 1.7 1.3}
-test text-20.149 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 " aasda asdj werwer"
- .t2 search -regexp -backward -all -- {(\$)?[\w:_]+} 1.3
-} {1.1 1.12 1.7 1.3}
-test text-20.150 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\n"
- .t2 search -regexp -backward -all -- {(\w+\n)+} end
-} {1.0}
-test text-20.151 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\n"
- .t2 search -regexp -backward -all -- {(\w+\n)+} end 1.5
-} {2.0}
-test text-20.152 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- .t2 search -regexp -backward -all -- {(\w+\n\w)+} end 1.5
-} {2.0}
-test text-20.153 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -all -count foo -- {(\w+\n)+} 1.0] $foo
-} {1.0 20}
-test text-20.154 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
+} -cleanup {
+ destroy .t
+} -result {{3.8 6.8 8.0 11.8} {20 26 13 14}}
+test text-22.157 {TextSearchCmd, backwards search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
+ .t search -backwards -regexp {fooba+rfoo} end
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.158 {TextSearchCmd, backwards search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
+ .t search -backwards -overlap -all -regexp {fooba+rfoo} end
+} -cleanup {
+ destroy .t
+} -result {1.6 1.0}
+test text-22.159 {TextSearchCmd, backwards search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
+ .t search -backwards -all -regexp {fooba+rfoo} end
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.160 {TextSearchCmd, forwards search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
+ .t search -all -overlap -regexp {fooba+rfoo} end
+} -cleanup {
+ destroy .t
+} -result {1.0 1.6}
+test text-22.161 {TextSearchCmd, forwards search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foobarfoobaaaaaaaaaaarfoo"
+ .t search -all -regexp {fooba+rfoo} end
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.162 {TextSearchCmd, forward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abababab"
+ .t search -exact -overlap -all {abab} 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0 1.2 1.4}
+test text-22.163 {TextSearchCmd, forward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abababab"
+ .t search -exact -all {abab} 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0 1.4}
+test text-22.164 {TextSearchCmd, backward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "ababababab"
+ .t search -exact -overlap -backwards -all {abab} end
+} -cleanup {
+ destroy .t
+} -result {1.6 1.4 1.2 1.0}
+test text-22.165 {TextSearchCmd, backward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "ababababab"
+ .t search -exact -backwards -all {abab} end
+} -cleanup {
+ destroy .t
+} -result {1.6 1.2}
+test text-22.166 {TextSearchCmd, backward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abababababab"
+ .t search -exact -backwards -all {abab} end
+} -cleanup {
+ destroy .t
+} -result {1.8 1.4 1.0}
+test text-22.167 {TextSearchCmd, forward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -exact -overlap -all "foo\nbar\nfoo" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0 3.0 5.0}
+test text-22.168 {TextSearchCmd, forward exact search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -exact -all "foo\nbar\nfoo" 1.0
+} -cleanup {
+ destroy .t
+} -result {1.0 5.0}
+test text-22.169 {TextSearchCmd, backward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -exact -overlap -backward -all "foo\nbar\nfoo" end
+} -cleanup {
+ destroy .t
+} -result {5.0 3.0 1.0}
+test text-22.170 {TextSearchCmd, backward exact search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -exact -backward -all "foo\nbar\nfoo" end
+} -cleanup {
+ destroy .t
+} -result {5.0 1.0}
+test text-22.171 {TextSearchCmd, backward exact search overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -regexp -backward -overlap -all "foo\nbar\nfoo" end
+} -cleanup {
+ destroy .t
+} -result {5.0 3.0 1.0}
+test text-22.172 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "foo\nbar\nfoo\nbar\nfoo\nbar\nfoo\n"
+ .t search -regexp -backward -all "foo\nbar\nfoo" end
+} -cleanup {
+ destroy .t
+} -result {5.0 1.0}
+test text-22.173 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -- {(\$)?[\w:_]+} 1.9
+} -cleanup {
+ destroy .t
+} -result {1.7}
+test text-22.174 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.5
+} -cleanup {
+ destroy .t
+} -result {1.7}
+test text-22.175 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.7
+} -cleanup {
+ destroy .t
+} -result {1.7}
+test text-22.176 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -- {(\$)?[\w:_]+} 1.9 1.8
+} -cleanup {
+ destroy .t
+} -result {1.8}
+test text-22.177 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -all -- {(\$)?[\w:_]+} 1.9 1.3
+} -cleanup {
+ destroy .t
+} -result {1.7 1.3}
+test text-22.178 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -all -- {(\$)?[\w:_]+} 1.9 1.13
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.179 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -all -- {(\$)?[\w:_]+} 2.0 1.3
+} -cleanup {
+ destroy .t
+} -result {1.12 1.7 1.3}
+test text-22.180 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 " aasda asdj werwer"
+ .t search -regexp -backward -all -- {(\$)?[\w:_]+} 1.3
+} -cleanup {
+ destroy .t
+} -result {1.1 1.12 1.7 1.3}
+test text-22.181 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\n"
+ .t search -regexp -backward -all -- {(\w+\n)+} end
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.182 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\n"
+ .t search -regexp -backward -all -- {(\w+\n)+} end 1.5
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.183 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ .t search -regexp -backward -all -- {(\w+\n\w)+} end 1.5
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.184 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -all -count foo -- {(\w+\n)+} 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 20}
+test text-22.185 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
set res {}
lappend res \
- [list [.t2 search -regexp -all -count foo -- {(\w+\n)+} 1.0] $foo] \
- [list [.t2 search -regexp -all -count foo -- {(\w+)+} 1.0] $foo]
-} {{1.0 20} {{1.0 2.0 3.0 4.0} {5 5 5 1}}}
-test text-20.155 {TextSearchCmd, regexp search greedy} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -all -nolinestop -count foo -- {.*} 1.0] $foo
-} {1.0 20}
-test text-20.156 {TextSearchCmd, regexp search greedy} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -all -count foo -- {.*} 1.0] $foo
-} {{1.0 2.0 3.0 4.0} {5 5 5 1}}
-test text-20.157 {TextSearchCmd, regexp search greedy multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -count foo -- {(\w+\n\w)+} 1.0] $foo
-} {1.0 19}
-test text-20.158 {TextSearchCmd, regexp search greedy multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -backwards -count foo -- {(\w+\n\w)+} end] $foo
-} {1.0 19}
-test text-20.159 {TextSearchCmd, regexp search greedy multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -all -backwards -count foo -- {(\w+\n\w)+} end] $foo
-} {1.0 19}
-test text-20.160 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- .t2 search -regexp -backward -all -- {(\w+\n\w)+} end 1.5
-} {2.0}
-test text-20.161 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- .t2 search -regexp -backward -all -- {(\w+\n\w)+} end 1.3
-} {1.3}
-test text-20.162 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -forward -count foo -- {(\w+\n\w)+} 1.3] $foo
-} {1.3 16}
-test text-20.163 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -forward -all -count foo -- {(\w+\n\w)+} 1.3] $foo
- # This result is somewhat debatable -- the two results do overlap,
- # but only because the search has totally wrapped around back to
- # the start.
-} {{1.3 1.0} {16 19}}
-test text-20.164 {TextSearchCmd, backward regexp search no-overlaps} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "abcde\nabcde\nabcde\na"
- list [.t2 search -regexp -forward -all -count foo -- {(\w+\n\w)+} 1.0 1.3] $foo
-} {1.0 19}
-test text-20.165 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\naaaa\nbbbb\n"
- list [.t2 search -regexp -forward -all -count foo -- {(a+\n(b+\n))+} 1.0] $foo
-} {1.0 20}
-test text-20.166 {TextSearchCmd, regexp search complex cases} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\naaaa\nbbbb\n"
- list [.t2 search -regexp -forward -all -count foo \
+ [list [.t search -regexp -all -count foo -- {(\w+\n)+} 1.0] $foo] \
+ [list [.t search -regexp -all -count foo -- {(\w+)+} 1.0] $foo]
+} -cleanup {
+ destroy .t
+} -result {{1.0 20} {{1.0 2.0 3.0 4.0} {5 5 5 1}}}
+test text-22.186 {TextSearchCmd, regexp search greedy} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -all -nolinestop -count foo -- {.*} 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 20}
+test text-22.187 {TextSearchCmd, regexp search greedy} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -all -count foo -- {.*} 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {{1.0 2.0 3.0 4.0} {5 5 5 1}}
+test text-22.188 {TextSearchCmd, regexp search greedy multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -count foo -- {(\w+\n\w)+} 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 19}
+test text-22.189 {TextSearchCmd, regexp search greedy multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -backwards -count foo -- {(\w+\n\w)+} end] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 19}
+test text-22.190 {TextSearchCmd, regexp search greedy multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -all -backwards -count foo -- {(\w+\n\w)+} end] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 19}
+test text-22.191 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ .t search -regexp -backward -all -- {(\w+\n\w)+} end 1.5
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.192 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ .t search -regexp -backward -all -- {(\w+\n\w)+} end 1.3
+} -cleanup {
+ destroy .t
+} -result {1.3}
+test text-22.193 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -forward -count foo -- {(\w+\n\w)+} 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {1.3 16}
+test text-22.194 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -forward -all -count foo -- {(\w+\n\w)+} 1.3] $foo
+# This result is somewhat debatable -- the two results do overlap,
+# but only because the search has totally wrapped around back to
+# the start.
+} -cleanup {
+ destroy .t
+} -result {{1.3 1.0} {16 19}}
+test text-22.195 {TextSearchCmd, backward regexp search no-overlaps} -body {
+ pack [text .t]
+ .t insert 1.0 "abcde\nabcde\nabcde\na"
+ list [.t search -regexp -forward -all -count foo -- {(\w+\n\w)+} 1.0 1.3] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 19}
+test text-22.196 {TextSearchCmd, regexp search multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\naaaa\nbbbb\n"
+ list [.t search -regexp -forward -all -count foo -- {(a+\n(b+\n))+} 1.0] $foo
+} -cleanup {
+ destroy .t
+} -result {1.0 20}
+test text-22.197 {TextSearchCmd, regexp search complex cases} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\naaaa\nbbbb\n"
+ list [.t search -regexp -forward -all -count foo \
-- {(a+\n(b+\n))+} 1.0] $foo
-} {1.0 20}
-test text-20.167 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
+} -cleanup {
+ destroy .t
+} -result {1.0 20}
+test text-22.198 {TextSearchCmd, regexp search multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
set foo {}
- list [.t2 search -regexp -forward -all -count foo \
+ list [.t search -regexp -forward -all -count foo \
-- {(b+\nc+\nb+)\na+} 1.0] $foo
-} {2.0 19}
-test text-20.168 {TextSearchCmd, regexp search multi-line} {knownBug} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
+} -cleanup {
+ destroy .t
+} -result {2.0 19}
+test text-22.199 {TextSearchCmd, regexp search multi-line} -constraints {
+ knownBug
+} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
set foo {}
- list [.t2 search -regexp -forward -all -count foo \
+ list [.t search -regexp -forward -all -count foo \
-- {(a+|b+\nc+\nb+)\na+} 1.0] $foo
-} {2.0 19}
-test text-20.169 {TextSearchCmd, regexp search multi-line} {knownBug} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
+} -cleanup {
+ destroy .t
+} -result {2.0 19}
+test text-22.200 {TextSearchCmd, regexp search multi-line} -constraints {
+ knownBug
+} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
set foo {}
- list [.t2 search -regexp -forward -all -count foo \
+ list [.t search -regexp -forward -all -count foo \
-- {(a+|b+\nc+\nb+)+\na+} 1.0] $foo
-} {2.0 19}
-test text-20.170 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
+} -cleanup {
+ destroy .t
+} -result {2.0 19}
+test text-22.201 {TextSearchCmd, regexp search multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\ncccc\nbbbb\naaaa\n"
set foo {}
- list [.t2 search -regexp -forward -all -count foo \
+ list [.t search -regexp -forward -all -count foo \
-- {((a+|b+\nc+\nb+)+\n)+a+} 1.0] $foo
-} {1.0 24}
-test text-20.171 {TextSearchCmd, regexp search multi-line} {knownBug} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\nbbbb\nbbbb\nbbbb\n"
- list [.t2 search -regexp -backward -all -count foo \
+} -cleanup {
+ destroy .t
+} -result {1.0 24}
+test text-22.202 {TextSearchCmd, regexp search multi-line} -constraints {
+ knownBug
+} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\nbbbb\nbbbb\nbbbb\n"
+ list [.t search -regexp -backward -all -count foo \
-- {b+\n|a+\n(b+\n)+} end] $foo
-} {1.0 25}
-test text-20.172 {TextSearchCmd, regexp search multi-line} {knownBug} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aaaa\nbbbb\nbbbb\nbbbb\nbbbb\n"
- .t2 search -regexp -backward -- {b+\n|a+\n(b+\n)+} end
- # Should match at 1.0 for a true greedy match
-} {1.0}
-test text-20.172.1 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "line0\nline1\nline1\nline1\nline1\nline2\nline2\nline2\nline3\n"
- .t2 search -nolinestop -regexp -nocase -forwards -- {^(.*)\n(\1\n)+} 1.0 end
- # Matches at 6.0 currently
-} {2.0}
-test text-20.173 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "\naaaxxx\nyyy\n"
+} -cleanup {
+ destroy .t
+} -result {1.0 25}
+test text-22.203 {TextSearchCmd, regexp search multi-line} -constraints {
+ knownBug
+} -body {
+ pack [text .t]
+ .t insert 1.0 "aaaa\nbbbb\nbbbb\nbbbb\nbbbb\n"
+ .t search -regexp -backward -- {b+\n|a+\n(b+\n)+} end
+# Should match at 1.0 for a true greedy match
+} -cleanup {
+ destroy .t
+} -result {1.0}
+test text-22.204 {TextSearchCmd, regexp search multi-line} -body {
+ pack [text .t]
+ .t insert 1.0 "line0\nline1\nline1\nline1\nline1\nline2\nline2\nline2\nline3\n"
+ .t search -nolinestop -regexp -nocase -forwards -- {^(.*)\n(\1\n)+} 1.0 end
+# Matches at 6.0 currently
+} -cleanup {
+ destroy .t
+} -result {2.0}
+test text-22.205 {TextSearchCmd, regexp search multi-line} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -count c -regexp -- {x*\ny*} 2.0] $c
- lappend res [.t2 search -count c -regexp -- {x*\ny*} 2.1] $c
- set res
-} {2.3 7 2.3 7}
-test text-20.174 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "\naaa\n\n\n\n\nxxx\n"
+} -body {
+ .t insert 1.0 "\naaaxxx\nyyy\n"
+ lappend res [.t search -count c -regexp -- {x*\ny*} 2.0] $c
+ lappend res [.t search -count c -regexp -- {x*\ny*} 2.1] $c
+ return $res
+} -cleanup {
+ destroy .t
+} -result {2.3 7 2.3 7}
+test text-22.206 {TextSearchCmd, regexp search multi-line} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -count c -regexp -- {\n+} 2.0] $c
- lappend res [.t2 search -count c -regexp -- {\n+} 2.1] $c
- set res
-} {2.3 5 2.3 5}
-test text-20.175 {TextSearchCmd, regexp search multi-line} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "\naaa\n\n\t \n\t\t\t \n\nxxx\n"
+} -body {
+ .t insert 1.0 "\naaa\n\n\n\n\nxxx\n"
+ lappend res [.t search -count c -regexp -- {\n+} 2.0] $c
+ lappend res [.t search -count c -regexp -- {\n+} 2.1] $c
+ return $res
+} -cleanup {
+ destroy .t
+} -result {2.3 5 2.3 5}
+test text-22.207 {TextSearchCmd, regexp search multi-line} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -count c -regexp -- {(\n+(\t+ *)*)+} 2.0] $c
- set res
-} {2.3 13}
-test text-20.176 {TextSearchCmd, empty search range} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\na\na\n"
- .t2 search -- a 2.0 1.0
-} {}
-test text-20.177 {TextSearchCmd, empty search range} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\na\na\n"
- .t2 search -backwards -- a 1.0 2.0
-} {}
-test text-20.178 {TextSearchCmd, empty search range} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\na\na\n"
- .t2 search -- a 1.0 1.0
-} {}
-test text-20.179 {TextSearchCmd, empty search range} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\na\na\n"
- .t2 search -backwards -- a 2.0 2.0
-} {}
-test text-20.180 {TextSearchCmd, elide up to match} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\nb\nc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "\naaa\n\n\t \n\t\t\t \n\nxxx\n"
+ lappend res [.t search -count c -regexp -- {(\n+(\t+ *)*)+} 2.0] $c
+ return $res
+} -cleanup {
+ destroy .t
+} -result {2.3 13}
+test text-22.208 {TextSearchCmd, empty search range} -body {
+ pack [text .t]
+ .t insert 1.0 "a\na\na\n"
+ .t search -- a 2.0 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.209 {TextSearchCmd, empty search range} -body {
+ pack [text .t]
+ .t insert 1.0 "a\na\na\n"
+ .t search -backwards -- a 1.0 2.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.210 {TextSearchCmd, empty search range} -body {
+ pack [text .t]
+ .t insert 1.0 "a\na\na\n"
+ .t search -- a 1.0 1.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.211 {TextSearchCmd, empty search range} -body {
+ pack [text .t]
+ .t insert 1.0 "a\na\na\n"
+ .t search -backwards -- a 2.0 2.0
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.212 {TextSearchCmd, elide up to match} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -regexp a 1.0]
- lappend res [.t2 search -regexp b 1.0]
- lappend res [.t2 search -regexp c 1.0]
- .t2 tag add e 1.0 2.0
- lappend res [.t2 search -regexp a 1.0]
- lappend res [.t2 search -regexp b 1.0]
- lappend res [.t2 search -regexp c 1.0]
- lappend res [.t2 search -elide -regexp a 1.0]
- lappend res [.t2 search -elide -regexp b 1.0]
- lappend res [.t2 search -elide -regexp c 1.0]
-} {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
-test text-20.181 {TextSearchCmd, elide up to match, backwards} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\nb\nc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "a\nb\nc"
+ .t tag configure e -elide 1
+ lappend res [.t search -regexp a 1.0]
+ lappend res [.t search -regexp b 1.0]
+ lappend res [.t search -regexp c 1.0]
+ .t tag add e 1.0 2.0
+ lappend res [.t search -regexp a 1.0]
+ lappend res [.t search -regexp b 1.0]
+ lappend res [.t search -regexp c 1.0]
+ lappend res [.t search -elide -regexp a 1.0]
+ lappend res [.t search -elide -regexp b 1.0]
+ lappend res [.t search -elide -regexp c 1.0]
+} -cleanup {
+ destroy .t
+} -result {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
+test text-22.213 {TextSearchCmd, elide up to match, backwards} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -backward -regexp a 1.0]
- lappend res [.t2 search -backward -regexp b 1.0]
- lappend res [.t2 search -backward -regexp c 1.0]
- .t2 tag add e 1.0 2.0
- lappend res [.t2 search -backward -regexp a 1.0]
- lappend res [.t2 search -backward -regexp b 1.0]
- lappend res [.t2 search -backward -regexp c 1.0]
- lappend res [.t2 search -backward -elide -regexp a 1.0]
- lappend res [.t2 search -backward -elide -regexp b 1.0]
- lappend res [.t2 search -backward -elide -regexp c 1.0]
-} {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
-test text-20.182 {TextSearchCmd, elide up to match} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\nb\nc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "a\nb\nc"
+ .t tag configure e -elide 1
+ lappend res [.t search -backward -regexp a 1.0]
+ lappend res [.t search -backward -regexp b 1.0]
+ lappend res [.t search -backward -regexp c 1.0]
+ .t tag add e 1.0 2.0
+ lappend res [.t search -backward -regexp a 1.0]
+ lappend res [.t search -backward -regexp b 1.0]
+ lappend res [.t search -backward -regexp c 1.0]
+ lappend res [.t search -backward -elide -regexp a 1.0]
+ lappend res [.t search -backward -elide -regexp b 1.0]
+ lappend res [.t search -backward -elide -regexp c 1.0]
+} -cleanup {
+ destroy .t
+} -result {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
+test text-22.214 {TextSearchCmd, elide up to match} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search a 1.0]
- lappend res [.t2 search b 1.0]
- lappend res [.t2 search c 1.0]
- .t2 tag add e 1.0 2.0
- lappend res [.t2 search a 1.0]
- lappend res [.t2 search b 1.0]
- lappend res [.t2 search c 1.0]
- lappend res [.t2 search -elide a 1.0]
- lappend res [.t2 search -elide b 1.0]
- lappend res [.t2 search -elide c 1.0]
-} {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
-test text-20.183 {TextSearchCmd, elide up to match, backwards} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "a\nb\nc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "a\nb\nc"
+ .t tag configure e -elide 1
+ lappend res [.t search a 1.0]
+ lappend res [.t search b 1.0]
+ lappend res [.t search c 1.0]
+ .t tag add e 1.0 2.0
+ lappend res [.t search a 1.0]
+ lappend res [.t search b 1.0]
+ lappend res [.t search c 1.0]
+ lappend res [.t search -elide a 1.0]
+ lappend res [.t search -elide b 1.0]
+ lappend res [.t search -elide c 1.0]
+} -cleanup {
+ destroy .t
+} -result {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
+test text-22.215 {TextSearchCmd, elide up to match, backwards} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -backward a 1.0]
- lappend res [.t2 search -backward b 1.0]
- lappend res [.t2 search -backward c 1.0]
- .t2 tag add e 1.0 2.0
- lappend res [.t2 search -backward a 1.0]
- lappend res [.t2 search -backward b 1.0]
- lappend res [.t2 search -backward c 1.0]
- lappend res [.t2 search -backward -elide a 1.0]
- lappend res [.t2 search -backward -elide b 1.0]
- lappend res [.t2 search -backward -elide c 1.0]
-} {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
-test text-20.184 {TextSearchCmd, elide up to match} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aa\nbb\ncc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "a\nb\nc"
+ .t tag configure e -elide 1
+ lappend res [.t search -backward a 1.0]
+ lappend res [.t search -backward b 1.0]
+ lappend res [.t search -backward c 1.0]
+ .t tag add e 1.0 2.0
+ lappend res [.t search -backward a 1.0]
+ lappend res [.t search -backward b 1.0]
+ lappend res [.t search -backward c 1.0]
+ lappend res [.t search -backward -elide a 1.0]
+ lappend res [.t search -backward -elide b 1.0]
+ lappend res [.t search -backward -elide c 1.0]
+} -cleanup {
+ destroy .t
+} -result {1.0 2.0 3.0 {} 2.0 3.0 1.0 2.0 3.0}
+test text-22.216 {TextSearchCmd, elide up to match} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search ab 1.0]
- lappend res [.t2 search bc 1.0]
- .t2 tag add e 1.1 2.1
- lappend res [.t2 search ab 1.0]
- lappend res [.t2 search b 1.0]
- .t2 tag remove e 1.0 end
- .t2 tag add e 2.1 3.1
- lappend res [.t2 search bc 1.0]
- lappend res [.t2 search c 1.0]
- .t2 tag remove e 1.0 end
- .t2 tag add e 2.1 3.0
- lappend res [.t2 search bc 1.0]
- lappend res [.t2 search c 1.0]
-} {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
-test text-20.185 {TextSearchCmd, elide up to match} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "aa\nbb\ncc"
- .t2 tag configure e -elide 1
+} -body {
+ .t insert 1.0 "aa\nbb\ncc"
+ .t tag configure e -elide 1
+ lappend res [.t search ab 1.0]
+ lappend res [.t search bc 1.0]
+ .t tag add e 1.1 2.1
+ lappend res [.t search ab 1.0]
+ lappend res [.t search b 1.0]
+ .t tag remove e 1.0 end
+ .t tag add e 2.1 3.1
+ lappend res [.t search bc 1.0]
+ lappend res [.t search c 1.0]
+ .t tag remove e 1.0 end
+ .t tag add e 2.1 3.0
+ lappend res [.t search bc 1.0]
+ lappend res [.t search c 1.0]
+} -cleanup {
+ destroy .t
+} -result {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
+test text-22.217 {TextSearchCmd, elide up to match} -setup {
+ pack [text .t]
set res {}
- lappend res [.t2 search -regexp ab 1.0]
- lappend res [.t2 search -regexp bc 1.0]
- .t2 tag add e 1.1 2.1
- lappend res [.t2 search -regexp ab 1.0]
- lappend res [.t2 search -regexp b 1.0]
- .t2 tag remove e 1.0 end
- .t2 tag add e 2.1 3.1
- lappend res [.t2 search -regexp bc 1.0]
- lappend res [.t2 search -regexp c 1.0]
- .t2 tag remove e 1.0 end
- .t2 tag add e 2.1 3.0
- lappend res [.t2 search -regexp bc 1.0]
- lappend res [.t2 search -regexp c 1.0]
-} {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
-test text-20.186 {TextSearchCmd, strict limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -- "world" 1.3 1.8
-} {}
-test text-20.187 {TextSearchCmd, strict limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -- "world" 1.3 1.10
-} {}
-test text-20.188 {TextSearchCmd, strict limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -- "world" 1.3 1.11
-} {1.6}
-test text-20.189 {TextSearchCmd, strict limits backwards} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -backward -- "world" 2.3 1.8
-} {}
-test text-20.190 {TextSearchCmd, strict limits backwards} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -backward -- "world" 2.3 1.6
-} {1.6}
-test text-20.191 {TextSearchCmd, strict limits backwards} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -strictlimits -backward -- "world" 2.3 1.7
-} {}
-test text-20.192 {TextSearchCmd, strict limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -regexp -strictlimits -- "world" 1.3 1.8
-} {}
-test text-20.193 {TextSearchCmd, strict limits} {
- deleteWindows
- pack [text .t2]
- .t2 insert 1.0 "Hello world!\nThis is a test\n"
- .t2 search -regexp -strictlimits -backward -- "world" 2.3 1.8
-} {}
-
-deleteWindows
-text .t2 -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
-pack .t2
-.t2 insert end "1\t2\t3\t4\t55.5"
-
-test text-21.1 {TkTextGetTabs procedure} {
- list [catch {.t2 configure -tabs "\{{}"} msg] $msg
-} {1 {unmatched open brace in list}}
-test text-21.2 {TkTextGetTabs procedure} {
- list [catch {.t2 configure -tabs xyz} msg] $msg
-} {1 {bad screen distance "xyz"}}
-test text-21.3 {TkTextGetTabs procedure} {
- .t2 configure -tabs {100 200}
+} -body {
+ .t insert 1.0 "aa\nbb\ncc"
+ .t tag configure e -elide 1
+ lappend res [.t search -regexp ab 1.0]
+ lappend res [.t search -regexp bc 1.0]
+ .t tag add e 1.1 2.1
+ lappend res [.t search -regexp ab 1.0]
+ lappend res [.t search -regexp b 1.0]
+ .t tag remove e 1.0 end
+ .t tag add e 2.1 3.1
+ lappend res [.t search -regexp bc 1.0]
+ lappend res [.t search -regexp c 1.0]
+ .t tag remove e 1.0 end
+ .t tag add e 2.1 3.0
+ lappend res [.t search -regexp bc 1.0]
+ lappend res [.t search -regexp c 1.0]
+} -cleanup {
+ destroy .t
+} -result {{} {} 1.0 2.1 2.0 3.1 2.0 3.0}
+test text-22.218 {TextSearchCmd, strict limits} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -- "world" 1.3 1.8
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.219 {TextSearchCmd, strict limits} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -- "world" 1.3 1.10
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.220 {TextSearchCmd, strict limits} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -- "world" 1.3 1.11
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.221 {TextSearchCmd, strict limits backwards} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -backward -- "world" 2.3 1.8
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.222 {TextSearchCmd, strict limits backwards} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -backward -- "world" 2.3 1.6
+} -cleanup {
+ destroy .t
+} -result {1.6}
+test text-22.223 {TextSearchCmd, strict limits backwards} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -strictlimits -backward -- "world" 2.3 1.7
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.224 {TextSearchCmd, strict limits} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -regexp -strictlimits -- "world" 1.3 1.8
+} -cleanup {
+ destroy .t
+} -result {}
+test text-22.225 {TextSearchCmd, strict limits} -body {
+ pack [text .t]
+ .t insert 1.0 "Hello world!\nThis is a test\n"
+ .t search -regexp -strictlimits -backward -- "world" 2.3 1.8
+} -cleanup {
+ destroy .t
+} -result {}
+
+
+test text-23.1 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs "\{{}"
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {unmatched open brace in list}
+test text-23.2 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs xyz
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad screen distance "xyz"}
+test text-23.3 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs {100 200}
update idletasks
- list [lindex [.t2 bbox 1.2] 0] [lindex [.t2 bbox 1.4] 0]
-} {100 200}
-test text-21.4 {TkTextGetTabs procedure} {
- .t2 configure -tabs {100 right 200 left 300 center 400 numeric}
+ list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0]
+} -cleanup {
+ destroy .t
+} -result {100 200}
+test text-23.4 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs {100 right 200 left 300 center 400 numeric}
update idletasks
- list [expr [lindex [.t2 bbox 1.2] 0] + [lindex [.t2 bbox 1.2] 2]] \
- [lindex [.t2 bbox 1.4] 0] \
- [expr [lindex [.t2 bbox 1.6] 0] + [lindex [.t2 bbox 1.6] 2]/2] \
- [lindex [.t2 bbox 1.10] 0]
-} {100 200 300 400}
-test text-21.5 {TkTextGetTabs procedure} {
- .t2 configure -tabs {105 r 205 l 305 c 405 n}
+ list [expr [lindex [.t bbox 1.2] 0] + [lindex [.t bbox 1.2] 2]] \
+ [lindex [.t bbox 1.4] 0] \
+ [expr [lindex [.t bbox 1.6] 0] + [lindex [.t bbox 1.6] 2]/2] \
+ [lindex [.t bbox 1.10] 0]
+} -cleanup {
+ destroy .t
+} -result {100 200 300 400}
+test text-23.5 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs {105 r 205 l 305 c 405 n}
update idletasks
- list [expr [lindex [.t2 bbox 1.2] 0] + [lindex [.t2 bbox 1.2] 2]] \
- [lindex [.t2 bbox 1.4] 0] \
- [expr [lindex [.t2 bbox 1.6] 0] + [lindex [.t2 bbox 1.6] 2]/2] \
- [lindex [.t2 bbox 1.10] 0]
-} {105 205 305 405}
-test text-21.6 {TkTextGetTabs procedure} {
- list [catch {.t2 configure -tabs {100 left 200 lork}} msg] $msg
-} {1 {bad tab alignment "lork": must be left, right, center, or numeric}}
-test text-21.7 {TkTextGetTabs procedure} {
- list [catch {.t2 configure -tabs {100 !44 200 lork}} msg] $msg
-} {1 {bad screen distance "!44"}}
-
-deleteWindows
-text .t
-pack .t
-.t insert 1.0 "One Line"
-.t mark set insert 1.0
-
-test text-22.1 {TextDumpCmd procedure, bad args} {
- list [catch {.t dump} msg] $msg
-} {1 {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}}
-test text-22.2 {TextDumpCmd procedure, bad args} {
- list [catch {.t dump -all} msg] $msg
-} {1 {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}}
-test text-22.3 {TextDumpCmd procedure, bad args} {
- list [catch {.t dump -command} msg] $msg
-} {1 {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}}
-test text-22.4 {TextDumpCmd procedure, bad args} {
- list [catch {.t dump -bogus} msg] $msg
-} {1 {bad option "-bogus": must be -all, -command, -image, -mark, -tag, -text, or -window}}
-test text-22.5 {TextDumpCmd procedure, bad args} {
- list [catch {.t dump bogus} msg] $msg
-} {1 {bad text index "bogus"}}
-test text-22.6 {TextDumpCmd procedure, one index} {
+ list [expr [lindex [.t bbox 1.2] 0] + [lindex [.t bbox 1.2] 2]] \
+ [lindex [.t bbox 1.4] 0] \
+ [expr [lindex [.t bbox 1.6] 0] + [lindex [.t bbox 1.6] 2]/2] \
+ [lindex [.t bbox 1.10] 0]
+} -cleanup {
+ destroy .t
+} -result {105 205 305 405}
+test text-23.6 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs {100 left 200 lork}
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad tab alignment "lork": must be left, right, center, or numeric}
+test text-23.7 {TkTextGetTabs procedure} -setup {
+ text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
+ pack .t
+} -body {
+ .t insert end "1\t2\t3\t4\t55.5"
+ .t configure -tabs {100 !44 200 lork}
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad screen distance "!44"}
+
+
+test text-24.1 {TextDumpCmd procedure, bad args} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
+ .t dump
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}
+test text-24.2 {TextDumpCmd procedure, bad args} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
+ .t dump -all
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}
+test text-24.3 {TextDumpCmd procedure, bad args} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
+ .t dump -command
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {Usage: .t dump ?-all -image -text -mark -tag -window? ?-command script? index ?index2?}
+test text-24.4 {TextDumpCmd procedure, bad args} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
+ .t dump -bogus
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad option "-bogus": must be -all, -command, -image, -mark, -tag, -text, or -window}
+test text-24.5 {TextDumpCmd procedure, bad args} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
+ .t dump bogus
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad text index "bogus"}
+test text-24.6 {TextDumpCmd procedure, one index} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
.t dump -text 1.2
-} {text e 1.2}
-test text-22.7 {TextDumpCmd procedure, two indices} {
+} -cleanup {
+ destroy .t
+} -result {text e 1.2}
+test text-24.7 {TextDumpCmd procedure, two indices} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
.t dump -text 1.0 1.end
-} {text {One Line} 1.0}
-test text-22.8 {TextDumpCmd procedure, "end" index} {
+} -cleanup {
+ destroy .t
+} -result {text {One Line} 1.0}
+test text-24.8 {TextDumpCmd procedure, "end" index} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
.t dump -text 1.end end
-} {text {
+} -cleanup {
+ destroy .t
+} -result {text {
} 1.8}
-test text-22.9 {TextDumpCmd procedure, same indices} {
+test text-24.9 {TextDumpCmd procedure, same indices} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
.t dump 1.5 1.5
-} {}
-test text-22.10 {TextDumpCmd procedure, negative range} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-24.10 {TextDumpCmd procedure, negative range} -body {
+ pack [text .t]
+ .t insert 1.0 "One Line"
+ .t mark set insert 1.0
.t dump 1.5 1.0
-} {}
-.t delete 1.0 end
-.t insert end "Line One\nLine Two\nLine Three\nLine Four"
-.t mark set insert 1.0
-.t mark set current 1.0
-test text-22.11 {TextDumpCmd procedure, stop at begin-line} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-24.11 {TextDumpCmd procedure, stop at begin-line} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
.t dump -text 1.0 2.0
-} {text {Line One
+} -cleanup {
+ destroy .t
+} -result {text {Line One
} 1.0}
-test text-22.12 {TextDumpCmd procedure, span multiple lines} {
+test text-24.12 {TextDumpCmd procedure, span multiple lines} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
.t dump -text 1.5 3.end
-} {text {One
+} -cleanup {
+ destroy .t
+} -result {text {One
} 1.5 text {Line Two
} 2.0 text {Line Three} 3.0}
-.t tag add x 2.0 2.end
-.t tag add y 1.0 end
-.t mark set m 2.4
-.t mark set n 4.0
-.t mark set END end
-test text-22.13 {TextDumpCmd procedure, tags only} {
+test text-24.13 {TextDumpCmd procedure, tags only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t tag add x 2.0 2.end
+ .t tag add y 1.0 end
.t dump -tag 2.1 2.8
-} {}
-test text-22.14 {TextDumpCmd procedure, tags only} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-24.14 {TextDumpCmd procedure, tags only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t tag add x 2.0 2.end
+ .t tag add y 1.0 end
.t dump -tag 2.0 2.8
-} {tagon x 2.0}
-test text-22.15 {TextDumpCmd procedure, tags only} {
+} -cleanup {
+ destroy .t
+} -result {tagon x 2.0}
+test text-24.15 {TextDumpCmd procedure, tags only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t tag add x 2.0 2.end
+ .t tag add y 1.0 end
.t dump -tag 1.0 4.end
-} {tagon y 1.0 tagon x 2.0 tagoff x 2.8}
-test text-22.16 {TextDumpCmd procedure, tags only} {
+} -cleanup {
+ destroy .t
+} -result {tagon y 1.0 tagon x 2.0 tagoff x 2.8}
+test text-24.16 {TextDumpCmd procedure, tags only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t tag add x 2.0 2.end
+ .t tag add y 1.0 end
.t dump -tag 1.0 end
-} {tagon y 1.0 tagon x 2.0 tagoff x 2.8 tagoff y 5.0}
-.t mark set insert 1.0
-.t mark set current 1.0
-test text-22.17 {TextDumpCmd procedure, marks only} {
+} -cleanup {
+ destroy .t
+} -result {tagon y 1.0 tagon x 2.0 tagoff x 2.8 tagoff y 5.0}
+test text-24.17 {TextDumpCmd procedure, marks only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t mark set m 2.4
+ .t mark set n 4.0
+ .t mark set END end
.t dump -mark 1.1 1.8
-} {}
-test text-22.18 {TextDumpCmd procedure, marks only} {
+} -cleanup {
+ destroy .t
+} -result {}
+test text-24.18 {TextDumpCmd procedure, marks only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t mark set m 2.4
+ .t mark set n 4.0
+ .t mark set END end
.t dump -mark 2.0 2.8
-} {mark m 2.4}
-test text-22.19 {TextDumpCmd procedure, marks only} {
+} -cleanup {
+ destroy .t
+} -result {mark m 2.4}
+test text-24.19 {TextDumpCmd procedure, marks only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t mark set m 2.4
+ .t mark set n 4.0
+ .t mark set END end
.t dump -mark 1.1 4.end
-} {mark m 2.4 mark n 4.0}
-test text-22.20 {TextDumpCmd procedure, marks only} {
+} -cleanup {
+ destroy .t
+} -result {mark m 2.4 mark n 4.0}
+test text-24.20 {TextDumpCmd procedure, marks only} -body {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t mark set m 2.4
+ .t mark set n 4.0
+ .t mark set END end
.t dump -mark 1.0 end
-} {mark current 1.0 mark insert 1.0 mark m 2.4 mark n 4.0 mark END 5.0}
-button .hello -text Hello
-.t window create 3.end -window .hello
-for {set i 0} {$i < 100} {incr i} {
- .t insert end "-\n"
-}
-.t window create 100.0 -create { }
-test text-22.21 {TextDumpCmd procedure, windows only} {
+} -cleanup {
+ destroy .t
+} -result {mark current 1.0 mark insert 1.0 mark m 2.4 mark n 4.0 mark END 5.0}
+test text-24.21 {TextDumpCmd procedure, windows only} -setup {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ for {set i 0} {$i < 100} {incr i} {.t insert end "-\n"}
+ button .hello -text Hello
+} -body {
+ .t window create 3.end -window .hello
+ .t window create 100.0 -create { }
.t dump -window 1.0 5.0
-} {window .hello 3.10}
-test text-22.22 {TextDumpCmd procedure, windows only} {
+} -cleanup {
+ destroy .t
+} -result {window .hello 3.10}
+test text-24.22 {TextDumpCmd procedure, windows only} -setup {
+ pack [text .t]
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ for {set i 0} {$i < 100} {incr i} {.t insert end "-\n"}
+ button .hello -text Hello
+} -body {
+ .t window create 3.end -window .hello
+ .t window create 100.0 -create { }
.t dump -window 5.0 end
-} {window {} 100.0}
-.t delete 1.0 end
-eval {.t mark unset} [.t mark names]
-.t insert end "Line One\nLine Two\nLine Three\nLine Four"
-.t mark set insert 1.0
-.t mark set current 1.0
-.t tag add x 2.0 2.end
-.t mark set m 2.4
-proc Append {varName key value index} {
- upvar #0 $varName x
- lappend x $key $index $value
-}
-test text-22.23 {TextDumpCmd procedure, command script} {
+} -cleanup {
+ destroy .t
+} -result {window {} 100.0}
+test text-24.23 {TextDumpCmd procedure, command script} -setup {
set x {}
+ pack [text .t]
+ proc Append {varName key value index} {
+ upvar #0 $varName x
+ lappend x $key $index $value
+ }
+} -body {
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t tag add x 2.0 2.end
+ .t mark set m 2.4
.t dump -command {Append x} -all 1.0 end
- set x
-} {mark 1.0 current mark 1.0 insert text 1.0 {Line One
+ return $x
+} -cleanup {
+ destroy .t
+ rename Append {}
+} -result {mark 1.0 current mark 1.0 insert text 1.0 {Line One
} tagon 2.0 x text 2.0 Line mark 2.4 m text 2.4 { Two} tagoff 2.8 x text 2.8 {
} text 3.0 {Line Three
} text 4.0 {Line Four
}}
-test text-22.24 {TextDumpCmd procedure, command script} {
+test text-24.24 {TextDumpCmd procedure, command script} -setup {
set x {}
+ pack [text .t]
+ proc Append {varName key value index} {
+ upvar #0 $varName x
+ lappend x $key $index $value
+ }
+} -body {
+ .t insert end "Line One\nLine Two\nLine Three\nLine Four"
+ .t mark set insert 1.0
+ .t mark set current 1.0
+ .t mark set m 2.4
.t dump -mark -command {Append x} 1.0 end
- set x
-} {mark 1.0 current mark 1.0 insert mark 2.4 m}
-catch {unset x}
-test text-22.25 {TextDumpCmd procedure, unicode characters} {
- catch {destroy .t}
+ return $x
+} -cleanup {
+ destroy .t
+ rename Append {}
+} -result {mark 1.0 current mark 1.0 insert mark 2.4 m}
+test text-24.25 {TextDumpCmd procedure, unicode characters} -body {
text .t
- .t delete 1.0 end
.t insert 1.0 \xb1\xb1\xb1
.t dump -all 1.0 2.0
-} "text \xb1\xb1\xb1 1.0 mark insert 1.3 mark current 1.3 text {\n} 1.3"
-test text-22.26 {TextDumpCmd procedure, unicode characters} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result "text \xb1\xb1\xb1 1.0 mark insert 1.3 mark current 1.3 text {\n} 1.3"
+test text-24.26 {TextDumpCmd procedure, unicode characters} -body {
text .t
.t delete 1.0 end
.t insert 1.0 abc\xb1\xb1\xb1
.t dump -all 1.0 2.0
-} "text abc\xb1\xb1\xb1 1.0 mark insert 1.6 mark current 1.6 text {\n} 1.6"
-test text-22.27 {TextDumpCmd procedure, peer present} -setup {
+} -cleanup {
destroy .t
-} -body {
+} -result "text abc\xb1\xb1\xb1 1.0 mark insert 1.6 mark current 1.6 text {\n} 1.6"
+test text-24.27 {TextDumpCmd procedure, peer present} -body {
text .t
.t peer create .t.t
.t dump -all 1.0 end
@@ -2944,21 +5881,18 @@ test text-22.27 {TextDumpCmd procedure, peer present} -setup {
destroy .t
} -result "mark insert 1.0 mark current 1.0 text {\n} 1.0"
-set l [interp hidden]
-deleteWindows
-
-test text-23.1 {text widget vs hidden commands} {
- catch {destroy .t}
+test text-25.1 {text widget vs hidden commands} -body {
text .t
+ set y [list {} [interp hidden]]
interp hide {} .t
destroy .t
- list [winfo children .] [interp hidden]
-} [list {} $l]
+ set x [list [winfo children .] [interp hidden]]
+ expr {$x eq $y}
+} -result {1}
-test text-24.1 {bug fix - 1642} {
- catch {destroy .t}
- text .t
- pack .t
+
+test text-26.1 {bug fix - 1642} -body {
+ pack [text .t]
.t insert end "line 1\n"
.t insert end "line 2\n"
.t insert end "line 3\n"
@@ -2966,16 +5900,24 @@ test text-24.1 {bug fix - 1642} {
.t insert end "line 5\n"
tk::TextSetCursor .t 3.0
.t search -backward -regexp "\$" insert 1.0
-} {2.6}
-
-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}
+} -cleanup {
+ destroy .t
+} -result {2.6}
+
+
+test text-27.1 {TextEditCmd procedure, argument parsing} -body {
+ pack [text .t]
+ .t edit
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t edit option ?arg ...?"}
+test text-27.2 {TextEditCmd procedure, argument parsing} -body {
+ pack [text .t]
+ .t edit gorp
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad edit option "gorp": must be modified, redo, reset, separator, or undo}
+test text-27.3 {TextEditUndo procedure, undoing changes} -body {
text .t -undo 1
pack .t
.t insert end "line 1\n"
@@ -2983,9 +5925,10 @@ test text-25.3 {TextEditUndo procedure, undoing changes} {
.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}
+} -cleanup {
+ destroy .t
+} -result "line\n\n"
+test text-27.4 {TextEditRedo procedure, redoing changes} -body {
text .t -undo 1
pack .t
.t insert end "line 1\n"
@@ -2994,9 +5937,10 @@ test text-25.4 {TextEditRedo procedure, redoing changes} {
.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}
+} -cleanup {
+ destroy .t
+} -result "line\nshould be back after redo\n\n"
+test text-27.5 {TextEditUndo procedure, resetting stack} -body {
text .t -undo 1
pack .t
.t insert end "line 1\n"
@@ -3004,10 +5948,11 @@ test text-25.5 {TextEditUndo procedure, resetting stack} {
.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}
+ return $msg
+} -cleanup {
+ destroy .t
+} -result "nothing to undo"
+test text-27.6 {TextEditCmd procedure, insert separator} -body {
text .t -undo 1
pack .t
.t insert end "line 1\n"
@@ -3015,9 +5960,10 @@ test text-25.6 {TextEditCmd procedure, insert 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}
+} -cleanup {
+ destroy .t
+} -result "line 1\n\n"
+test text-27.7 {-autoseparators configuration option} -body {
text .t -undo 1 -autoseparators 0
pack .t
.t insert end "line 1\n"
@@ -3025,36 +5971,41 @@ test text-25.7 {-autoseparators configuration option} {
.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}
+} -cleanup {
+ destroy .t
+} -result "\n"
+test text-27.8 {TextEditCmd procedure, modified flag} -body {
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}
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-27.9 {TextEditCmd procedure, reset modified flag} -body {
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}
+} -cleanup {
+ destroy .t
+} -result {0}
+test text-27.10 {TextEditCmd procedure, set modified flag} -body {
text .t
pack .t
.t edit modified 1
.t edit modified
-} {1}
-test text-25.10.1 {TextEditCmd procedure, set modified flag repeat} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-27.11 {TextEditCmd procedure, set modified flag repeat} -setup {
text .t
pack .t
set ::retval {}
+} -body {
bind .t <<Modified>> "lappend ::retval modified"
- # Shouldn't require [update idle] to trigger event [Bug 1809538]
+# Shouldn't require [update idle] to trigger event [Bug 1809538]
lappend ::retval [.t edit modified]
.t edit modified 1
update idletasks
@@ -3062,50 +6013,54 @@ test text-25.10.1 {TextEditCmd procedure, set modified flag repeat} {
.t edit modified 1 ; # binding should only fire once [Bug 1799782]
update idletasks
lappend ::retval [.t edit modified]
-} {0 modified 1 1}
-test text-25.11 {<<Modified>> virtual event} {
+} -cleanup {
+ destroy .t
+} -result {0 modified 1 1}
+test text-27.12 {<<Modified>> virtual event} -body {
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.11.1 {<<Modified>> virtual event - insert before Modified} {
- set ::retval {}
+ return $::retval
+} -cleanup {
destroy .t
+} -result {modified}
+test text-27.13 {<<Modified>> virtual event - insert before Modified} -body {
+ set ::retval {}
pack [text .t -undo 1]
bind .t <<Modified>> { set ::retval [.t get 1.0 end-1c] }
update idletasks
.t insert end "nothing special"
- set ::retval
-} {nothing special}
-test text-25.11.2 {<<Modified>> virtual event - delete before Modified} {
- # Bug 1737288, make sure we delete chars before triggering <<Modified>>
- set ::retval {}
+ return $::retval
+} -cleanup {
destroy .t
+} -result {nothing special}
+test text-27.14 {<<Modified>> virtual event - delete before Modified} -body {
+# Bug 1737288, make sure we delete chars before triggering <<Modified>>
+ set ::retval {}
pack [text .t -undo 1]
bind .t <<Modified>> { set ::retval [.t get 1.0 end-1c] }
.t insert end "nothing special"
.t edit modified 0
.t delete 1.0 1.2
set ::retval
-} {thing special}
-test text-25.12 {<<Selection>> virtual event} {
+} -cleanup {
+ destroy .t
+} -result {thing special}
+test text-27.15 {<<Selection>> virtual event} -body {
set ::retval no_selection
- catch {destroy .t}
- text .t -undo 1
- pack .t
+ pack [text .t -undo 1]
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}
+} -cleanup {
+ destroy .t
+} -result {selection_changed}
+test text-27.16 {-maxundo configuration option} -body {
text .t -undo 1 -autoseparators 1 -maxundo 2
pack .t
.t insert end "line 1\n"
@@ -3115,17 +6070,20 @@ test text-25.13 {-maxundo configuration option} {
catch {.t edit undo}
catch {.t edit undo}
.t get 1.0 end
-} "line 1\n\n"
-test text-25.15 {bug fix 1536735 - undo with empty text} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result "line 1\n\n"
+test text-27.17 {bug fix 1536735 - undo with empty text} -body {
text .t -undo 1
set r [.t edit modified]
.t delete 1.0
lappend r [.t edit modified]
lappend r [catch {.t edit undo}]
lappend r [.t edit modified]
-} {0 0 1 0}
-test text-25.18 {patch 1469210 - inserting after undo} -setup {
+} -cleanup {
+ destroy .t
+} -result {0 0 1 0}
+test text-27.18 {patch 1469210 - inserting after undo} -setup {
destroy .t
} -body {
text .t -undo 1
@@ -3138,246 +6096,275 @@ test text-25.18 {patch 1469210 - inserting after undo} -setup {
destroy .t
} -result 1
-test text-26.1 {bug fix - 624372, ControlUtfProc long lines} {
- destroy .t
+test text-28.1 {bug fix - 624372, ControlUtfProc long lines} -body {
pack [text .t -wrap none]
.t insert end [string repeat "\1" 500]
-} {}
-
-test text-27.1 {tabs - must be positive and must be increasing} {
+} -cleanup {
destroy .t
+} -result {}
+
+
+test text-29.1 {tabs - must be positive and must be increasing} -body {
pack [text .t -wrap none]
- list [catch {.t configure -tabs {0}} msg] $msg
-} {1 {tab stop "0" is not at a positive distance}}
-test text-27.2 {tabs - must be positive and must be increasing} {
+ .t configure -tabs {0}
+} -cleanup {
destroy .t
+} -returnCodes {error} -result {tab stop "0" is not at a positive distance}
+test text-29.2 {tabs - must be positive and must be increasing} -body {
pack [text .t -wrap none]
- list [catch {.t configure -tabs {-5}} msg] $msg
-} {1 {tab stop "-5" is not at a positive distance}}
-test text-27.3 {tabs - must be positive and must be increasing} {knownBug} {
- # This bug will be fixed in Tk 9.0, when we can allow a minor
- # incompatibility with Tk 8.x
+ .t configure -tabs {-5}
+} -cleanup {
destroy .t
+} -returnCodes {error} -result {tab stop "-5" is not at a positive distance}
+test text-29.3 {tabs - must be positive and must be increasing} -constraints {
+ knownBug
+} -body {
+# This bug will be fixed in Tk 9.0, when we can allow a minor
+# incompatibility with Tk 8.x
pack [text .t -wrap none]
- list [catch {.t configure -tabs {10c 5c}} msg] $msg
-} {1 {tabs must be monotonically increasing, but "5c" is smaller than or equal to the previous tab}}
-test text-27.4 {tabs - must be positive and must be increasing} {
+ .t configure -tabs {10c 5c}
+} -cleanup {
destroy .t
+} -returnCodes {error} -result {tabs must be monotonically increasing, but "5c" is smaller than or equal to the previous tab}
+test text-29.4 {tabs - must be positive and must be increasing} -body {
pack [text .t -wrap none]
.t insert end "a\tb\tc\td\te"
catch {.t configure -tabs {10c 5c}}
update ; update ; update
- # This test must simply not go into an infinite loop to succeed
+# This test must simply not go into an infinite loop to succeed
set result 1
-} {1}
-
-test text-28.0 {repeated insert and scroll} {
- foreach subcmd {
- {moveto 1}
- {scroll 1 pages}
- {scroll 100 pixels}
- {scroll 10 units}
- } {
- destroy .t
- pack [text .t]
- for {set i 0} {$i < 30} {incr i} {
- .t insert end "blabla\n"
- eval .t yview $subcmd
- }
+} -cleanup {
+ destroy .t
+} -result {1}
+
+
+test text-30.1 {repeated insert and scroll} -body {
+ pack [text .t]
+ for {set i 0} {$i < 30} {incr i} {
+ .t insert end "blabla\n"
+ eval .t yview moveto 1
}
- # This test must simply not crash to succeed
+# This test must simply not crash to succeed
set result 1
-} {1}
-
-test text-29.0 {peer widgets} {
- destroy .t .tt
- toplevel .tt
- pack [text .t]
- pack [.t peer create .tt.t]
- destroy .t .tt
-} {}
-test text-29.1 {peer widgets} {
- destroy .t .t1 .t2
- toplevel .t1
- toplevel .t2
- pack [text .t]
- pack [.t peer create .t1.t]
- pack [.t peer create .t2.t]
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-30.2 {repeated insert and scroll} -body {
+ pack [text .t]
+ for {set i 0} {$i < 30} {incr i} {
+ .t insert end "blabla\n"
+ eval .t yview scroll 1 pages
+ }
+# This test must simply not crash to succeed
+ set result 1
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-30.3 {repeated insert and scroll} -body {
+ pack [text .t]
+ for {set i 0} {$i < 30} {incr i} {
+ .t insert end "blabla\n"
+ eval .t yview scroll 100 pixels
+ }
+# This test must simply not crash to succeed
+ set result 1
+} -cleanup {
+ destroy .t
+} -result {1}
+test text-30.4 {repeated insert and scroll} -body {
+ pack [text .t]
+ for {set i 0} {$i < 30} {incr i} {
+ .t insert end "blabla\n"
+ eval .t yview scroll 10 units
+ }
+# This test must simply not crash to succeed
+ set result 1
+} -cleanup {
+ destroy .t
+} -result {1}
+
+
+test text-31.1 {peer widgets} -body {
+ toplevel .top
+ pack [text .t]
+ pack [.t peer create .top.t]
+ destroy .t .top
+} -result {}
+test text-31.2 {peer widgets} -body {
+ toplevel .top1
+ toplevel .top2
+ pack [text .t]
+ pack [.t peer create .top1.t]
+ pack [.t peer create .top2.t]
.t insert end "abcd\nabcd"
update
- destroy .t1
+ destroy .top1
update
.t insert end "abcd\nabcd"
update
- destroy .t .t2
+ destroy .t .top2
update
-} {}
-test text-29.2 {peer widgets} {
- destroy .t .t1 .t2
- toplevel .t1
- toplevel .t2
+} -result {}
+test text-31.3 {peer widgets} -body {
+ toplevel .top1
+ toplevel .top2
pack [text .t]
- pack [.t peer create .t1.t]
- pack [.t peer create .t2.t]
+ pack [.t peer create .top1.t]
+ pack [.t peer create .top2.t]
.t insert end "abcd\nabcd"
update
destroy .t
update
- .t2.t insert end "abcd\nabcd"
+ .top2.t insert end "abcd\nabcd"
update
- destroy .t .t2
+ destroy .t .top2
update
-} {}
-test text-29.3 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+} -result {}
+test text-31.4 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
+ pack [.t peer create .top.t -start 5 -end 11]
update
- destroy .t .tt
-} {}
-test text-29.4 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ destroy .t .top
+} -result {}
+test text-31.5 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
- pack [.tt.t peer create .tt.t2]
- set res [list [.tt.t index end] [.tt.t2 index end]]
+ pack [.t peer create .top.t -start 5 -end 11]
+ pack [.top.t peer create .top.t2]
+ set res [list [.top.t index end] [.top.t2 index end]]
update
- destroy .t .tt
- set res
-} {7.0 7.0}
-test text-29.4.1 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ return $res
+} -cleanup {
+ destroy .t .top
+} -result {7.0 7.0}
+test text-31.6 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
- pack [.tt.t peer create .tt.t2 -start {} -end {}]
- set res [list [.tt.t index end] [.tt.t2 index end]]
+ pack [.t peer create .top.t -start 5 -end 11]
+ pack [.top.t peer create .top.t2 -start {} -end {}]
+ set res [list [.top.t index end] [.top.t2 index end]]
update
- destroy .t .tt
- set res
-} {7.0 21.0}
-test text-29.5 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ return $res
+} -cleanup {
+ destroy .t .top
+} -result {7.0 21.0}
+test text-31.7 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
+ pack [.t peer create .top.t -start 5 -end 11]
update ; update
- set p1 [.tt.t count -update -ypixels 1.0 end]
+ set p1 [.top.t count -update -ypixels 1.0 end]
set p2 [.t count -update -ypixels 5.0 11.0]
- if {$p1 == $p2} {
- set res "ok"
- } else {
- set res "$p1 and $p2 not equal"
- }
- destroy .t .tt
- set res
-} {ok}
-test text-29.6 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ expr {$p1 eq $p2}
+} -cleanup {
+ destroy .t .top
+} -result {1}
+test text-31.8 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
+ pack [.t peer create .top.t -start 5 -end 11]
update ; update
.t delete 3.0 6.0
- set res [.tt.t index end]
- destroy .t .tt
- set res
-} {6.0}
-test text-29.7 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ .top.t index end
+} -cleanup {
+ destroy .t .top
+} -result {6.0}
+test text-31.9 {peer widgets} -body {
+ toplevel .top
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
+ pack [.t peer create .top.t -start 5 -end 11]
update ; update
.t delete 8.0 12.0
- set res [.tt.t index end]
- destroy .t .tt
- set res
-} {4.0}
-test text-29.8 {peer widgets} {
- destroy .t .tt
- toplevel .tt
+ .top.t index end
+} -cleanup {
+ destroy .t .top
+} -result {4.0}
+test text-31.10 {peer widgets} -body {
+ toplevel .top
pack [text .t]
- for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ for {set i 1} {$i < 20} {incr i} {
+ .t insert end "Line $i\n"
}
- pack [.t peer create .tt.t -start 5 -end 11]
+ pack [.t peer create .top.t -start 5 -end 11]
update ; update
.t delete 3.0 13.0
- set res [.tt.t index end]
- destroy .t .tt
- set res
-} {1.0}
-test text-29.9 {peer widgets} {
- destroy .t
+ .top.t index end
+} -cleanup {
+ destroy .t .top
+} -result {1.0}
+test text-31.11 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 1.0 end-1c
- set res {}
lappend res [.t tag ranges sel]
.t configure -start 10 -end 20
lappend res [.t tag ranges sel]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{1.0 100.0} {1.0 11.0}}
-test text-29.10 {peer widgets} {
- destroy .t
+} -result {{1.0 100.0} {1.0 11.0}}
+test text-31.12 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 1.0 end-1c
- set res {}
lappend res [.t tag ranges sel]
.t configure -start 11
lappend res [.t tag ranges sel]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{1.0 100.0} {1.0 90.0}}
-test text-29.11 {peer widgets} {
- destroy .t
+} -result {{1.0 100.0} {1.0 90.0}}
+test text-31.13 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 1.0 end-1c
- set res {}
lappend res [.t tag ranges sel]
.t configure -end 90
lappend res [.t tag ranges sel]
destroy .t
- set res
-} {{1.0 100.0} {1.0 90.0}}
-test text-29.12 {peer widgets} {
+ return $res
+} -cleanup {
destroy .t
+} -result {{1.0 100.0} {1.0 90.0}}
+test text-31.14 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 1.0 3.0 5.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0
- set res {}
lappend res [.t tag prevrange sel 1.0]
.t configure -start 6 -end 12
lappend res [.t tag ranges sel]
@@ -3387,17 +6374,18 @@ test text-29.12 {peer widgets} {
lappend res "prev" [.t tag prevrange sel 1.0] \
[.t tag prevrange sel 2.0] [.t tag prevrange sel 3.0] \
[.t tag prevrange sel 4.0]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{} {1.0 2.0 4.0 6.0} next {4.0 6.0} {} {} {} prev {} {1.0 2.0} {1.0 2.0} {1.0 2.0}}
-test text-29.13 {peer widgets} {
- destroy .t
+} -result {{} {1.0 2.0 4.0 6.0} next {4.0 6.0} {} {} {} prev {} {1.0 2.0} {1.0 2.0} {1.0 2.0}}
+test text-31.15 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 1.0 3.0 9.0 11.0 13.0 15.0 17.0 19.0
- set res {}
.t configure -start 6 -end 12
lappend res [.t tag ranges sel]
lappend res "next" [.t tag nextrange sel 4.0] \
@@ -3406,17 +6394,18 @@ test text-29.13 {peer widgets} {
lappend res "prev" [.t tag prevrange sel 1.0] \
[.t tag prevrange sel 2.0] [.t tag prevrange sel 3.0] \
[.t tag prevrange sel 4.0]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{4.0 6.0} next {4.0 6.0} {} {} {} prev {} {} {} {}}
-test text-29.14 {peer widgets} {
- destroy .t
+} -result {{4.0 6.0} next {4.0 6.0} {} {} {} prev {} {} {} {}}
+test text-31.16 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 20} {incr i} {
.t insert end "Line $i\n"
}
.t tag add sel 1.0 7.0 9.0 11.0 13.0 15.0 17.0 19.0
- set res {}
.t configure -start 6 -end 12
lappend res [.t tag ranges sel]
lappend res "next" [.t tag nextrange sel 4.0] \
@@ -3425,16 +6414,17 @@ test text-29.14 {peer widgets} {
lappend res "prev" [.t tag prevrange sel 1.0] \
[.t tag prevrange sel 2.0] [.t tag prevrange sel 3.0] \
[.t tag prevrange sel 4.0]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{1.0 2.0 4.0 6.0} next {4.0 6.0} {} {} {} prev {} {1.0 2.0} {1.0 2.0} {1.0 2.0}}
-test text-29.15 {peer widgets} {
- destroy .t
+} -result {{1.0 2.0 4.0 6.0} next {4.0 6.0} {} {} {} prev {} {1.0 2.0} {1.0 2.0} {1.0 2.0}}
+test text-31.17 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- set res {}
.t tag add sel 1.0 11.0
lappend res [.t tag ranges sel]
lappend res [catch {.t configure -start 15 -end 10}]
@@ -3443,58 +6433,61 @@ test text-29.15 {peer widgets} {
lappend res [.t tag ranges sel]
.t configure -start {} -end {}
lappend res [.t tag ranges sel]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {{1.0 11.0} 1 {1.0 11.0} {1.0 6.0} {1.0 11.0}}
-test text-29.16 {peer widgets} {
- destroy .t
+} -result {{1.0 11.0} 1 {1.0 11.0} {1.0 6.0} {1.0 11.0}}
+test text-31.18 {peer widgets} -setup {
pack [text .t]
+ set res {}
+} -body {
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- set res {}
.t tag add sel 1.0 11.0
lappend res [.t index sel.first]
lappend res [.t index sel.last]
+ return $res
+} -cleanup {
destroy .t
- set res
-} {1.0 11.0}
-test text-29.17 {peer widgets} {
- destroy .t
+} -result {1.0 11.0}
+test text-31.19 {peer widgets} -body {
pack [text .t]
for {set i 1} {$i < 20} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- set res {}
.t tag delete sel
- set res [list [catch {.t index sel.first} msg] $msg]
+ .t index sel.first
+} -cleanup {
destroy .t
- set res
-} {1 {text doesn't contain any characters tagged with "sel"}}
+} -returnCodes {error} -result {text doesn't contain any characters tagged with "sel"}
-proc makeText {} {
- set w .g
- set font "Times 11"
- destroy .g
- toplevel .g
- frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken
- set t $w.f.text
- text $t -yscrollcommand "$w.scroll set" -setgrid true -font $font -width 70 \
- -height 35 -wrap word -highlightthickness 0 -borderwidth 0
- pack $t -expand yes -fill both
- scrollbar $w.scroll -command "$t yview"
- pack $w.scroll -side right -fill y
- pack $w.f -expand yes -fill both
- $t tag configure center -justify center -spacing1 5m -spacing3 5m
- $t tag configure buttons -lmargin1 1c -lmargin2 1c -rmargin 1c \
- -spacing1 3m -spacing2 0 -spacing3 0
- for {set i 0} {$i < 40} {incr i} {
- $t insert end "${i}word "
- }
- return $t
-}
-test text-30.1 {line heights on creation} {
+test text-32.1 {line heights on creation} -setup {
+ text .t
+ proc makeText {} {
+ set w .g
+ set font "Times 11"
+ destroy .g
+ toplevel .g
+ frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken
+ set t $w.f.text
+ text $t -yscrollcommand "$w.scroll set" -setgrid true -font $font \
+ -width 70 -height 35 -wrap word -highlightthickness 0 \
+ -borderwidth 0
+ pack $t -expand yes -fill both
+ scrollbar $w.scroll -command "$t yview"
+ pack $w.scroll -side right -fill y
+ pack $w.f -expand yes -fill both
+ $t tag configure center -justify center -spacing1 5m -spacing3 5m
+ $t tag configure buttons -lmargin1 1c -lmargin2 1c -rmargin 1c \
+ -spacing1 3m -spacing2 0 -spacing3 0
+ for {set i 0} {$i < 40} {incr i} {
+ $t insert end "${i}word "
+ }
+ return $t
+ }
+} -body {
set w [makeText]
update ; after 1000 ; update
set before [$w count -ypixels 1.0 2.0]
@@ -3502,63 +6495,88 @@ test text-30.1 {line heights on creation} {
update
set after [$w count -ypixels 1.0 2.0]
destroy .g
- if {$before != $after} {
- set res "Count changed: $before $after"
- } else {
- set res "ok"
- }
-} {ok}
-
-destroy .t
-text .t
-test text-31.1 {TextWidgetCmd procedure, "peer" option} {
- list [catch {.t peer foo 1} msg] $msg
-} {1 {bad peer option "foo": must be create or names}}
-test text-31.2 {TextWidgetCmd procedure, "peer" option} {
- list [catch {.t peer names foo} msg] $msg
-} {1 {wrong # args: should be ".t peer names"}}
-test text-31.3 {TextWidgetCmd procedure, "peer" option} {
- list [catch {.t p names} msg] $msg
-} {0 {}}
-test text-31.4 {TextWidgetCmd procedure, "peer" option} {
+ expr {$before eq $after}
+} -cleanup {
+ destroy .t
+} -result {1}
+
+
+test text-33.1 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
+} -body {
+ .t peer foo 1
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad peer option "foo": must be create or names}
+test text-33.2 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
+} -body {
+ .t peer names foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {wrong # args: should be ".t peer names"}
+test text-33.3 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
+} -body {
+ .t p names
+} -cleanup {
+ destroy .t
+} -returnCodes {ok} -result {}
+test text-33.4 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
+} -body {
.t peer names
-} {}
-test text-31.5 {TextWidgetCmd procedure, "peer" option} {
- list [catch {.t peer create foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test text-31.6 {TextWidgetCmd procedure, "peer" option} {
- .t peer create .t2
+} -cleanup {
+ destroy .t
+} -result {}
+test text-33.5 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
+} -body {
+ .t peer create foo
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {bad window path name "foo"}
+test text-33.6 {TextWidgetCmd procedure, "peer" option} -setup {
+ text .t
set res {}
+} -body {
+ .t peer create .t2
lappend res [.t peer names]
lappend res [.t2 peer names]
destroy .t2
lappend res [.t peer names]
-} {.t2 .t {}}
-test text-31.7 {peer widget -start, -end} {
- set res [list [catch {.t configure -start 10 -end 5} msg] $msg]
- .t configure -start {} -end {}
- set res
-} {0 {}}
-test text-31.8 {peer widget -start, -end} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {.t2 .t {}}
+test text-33.7 {peer widget -start, -end} -body {
+ text .t
+ set res [.t configure -start 10 -end 5]
+ return $res
+} -cleanup {
+ destroy .t
+} -returnCodes {2} -result {}
+test text-33.8 {peer widget -start, -end} -body {
+ text .t
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
- list [catch {.t configure -start 10 -end 5} msg] $msg
-} {1 {-startline must be less than or equal to -endline}}
-test text-31.9 {peer widget -start, -end} {
- .t delete 1.0 end
+ .t configure -start 10 -end 5
+} -cleanup {
+ destroy .t
+} -returnCodes {error} -result {-startline must be less than or equal to -endline}
+test text-33.9 {peer widget -start, -end} -body {
+ text .t
for {set i 1} {$i < 100} {incr i} {
.t insert end "Line $i\n"
}
- set res [list [catch {.t configure -start 5 -end 10} msg] $msg]
- .t configure -start {} -end {}
- set res
-} {0 {}}
-test text-31.10 {peer widget -start, -end} {
- .t delete 1.0 end
+ .t configure -start 5 -end 10
+} -cleanup {
+ destroy .t
+} -returnCodes {ok} -result {}
+test text-33.10 {peer widget -start, -end} -body {
+ text .t
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
set res [.t index end]
lappend res [catch {.t configure -start 5 -end 10 -tab foo}]
@@ -3567,12 +6585,14 @@ test text-31.10 {peer widget -start, -end} {
lappend res [.t index end]
.t configure -start {} -end {}
lappend res [.t index end]
- set res
-} {101.0 1 101.0 1 101.0 101.0}
-test text-31.11 {peer widget -start, -end} {
- .t delete 1.0 end
+ return $res
+} -cleanup {
+ destroy .t
+} -result {101.0 1 101.0 1 101.0 101.0}
+test text-33.11 {peer widget -start, -end} -body {
+ text .t
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
set res [.t index end]
lappend res [catch {.t configure -start 5 -end 15}]
@@ -3581,16 +6601,19 @@ test text-31.11 {peer widget -start, -end} {
lappend res [.t index end]
.t configure -start {} -end {}
lappend res [.t index end]
- set res
-} {101.0 0 11.0 0 31.0 101.0}
+ return $res
+} -cleanup {
+ destroy .t
+} -result {101.0 0 11.0 0 31.0 101.0}
-test text-32.1 {peer widget -start, -end and selection} {
- .t delete 1.0 end
+test text-34.1 {peer widget -start, -end and selection} -setup {
+ text .t
+ set res {}
+} -body {
for {set i 1} {$i < 100} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add sel 10.0 20.0
- set res {}
lappend res [.t tag ranges sel]
.t configure -start 5 -end 30
lappend res [.t tag ranges sel]
@@ -3604,45 +6627,54 @@ test text-32.1 {peer widget -start, -end and selection} {
lappend res [.t tag ranges sel]
.t configure -start {} -end {}
lappend res [.t tag ranges sel]
- set res
-} {{10.0 20.0} {6.0 16.0} {6.0 11.0} {1.0 6.0} {1.0 2.0} {} {10.0 20.0}}
+ return $res
+} -cleanup {
+ destroy .t
+} -result {{10.0 20.0} {6.0 16.0} {6.0 11.0} {1.0 6.0} {1.0 2.0} {} {10.0 20.0}}
-test text-33.1 {widget dump -command alters tags} {
- .t delete 1.0 end
- .t insert end "abc\n" a "---" {} "def" b " \n" {} "ghi\n" c
- .t tag configure b -background red
- proc Dumpy {key value index} {
- #puts "KK: $key, $value"
+test text-35.1 {widget dump -command alters tags} -setup {
+ proc Dumpy {key value index} {
+#puts "KK: $key, $value"
.t tag add $value [list $index linestart] [list $index lineend]
}
- .t dump -all -command Dumpy 1.0 end
- set result "ok"
-} {ok}
-test text-33.2 {widget dump -command makes massive changes} {
- .t delete 1.0 end
+ text .t
+} -body {
.t insert end "abc\n" a "---" {} "def" b " \n" {} "ghi\n" c
.t tag configure b -background red
+ .t dump -all -command Dumpy 1.0 end
+ set result "ok"
+} -cleanup {
+ destroy .t
+} -result {ok}
+test text-35.2 {widget dump -command makes massive changes} -setup {
proc Dumpy {key value index} {
- #puts "KK: $key, $value"
+#puts "KK: $key, $value"
.t delete 1.0 end
}
- .t dump -all -command Dumpy 1.0 end
- set result "ok"
-} {ok}
-test text-33.3 {widget dump -command destroys widget} {
- .t delete 1.0 end
+ text .t
+} -body {
.t insert end "abc\n" a "---" {} "def" b " \n" {} "ghi\n" c
.t tag configure b -background red
+ .t dump -all -command Dumpy 1.0 end
+ set result "ok"
+} -cleanup {
+ destroy .t
+} -result {ok}
+test text-35.3 {widget dump -command destroys widget} -setup {
proc Dumpy {key value index} {
- #puts "KK: $key, $value"
- destroy .t
+#puts "KK: $key, $value"
+ destroy .t
}
+ text .t
+} -body {
+ .t insert end "abc\n" a "---" {} "def" b " \n" {} "ghi\n" c
+ .t tag configure b -background red
.t dump -all -command Dumpy 1.0 end
set result "ok"
-} {ok}
+} -cleanup {
+ destroy .t
+} -result {ok}
-deleteWindows
-option clear
test text-36.1 "bug #1777362: event handling with hyphenated windows" -setup {
proc bgerror {m} {set ::my_error $m}
@@ -3657,7 +6689,6 @@ test text-36.1 "bug #1777362: event handling with hyphenated windows" -setup {
} -cleanup {
destroy .t-1
} -result {}
-
test text-36.2 "bug #1777362: event handling with hyphenated windows" -setup {
proc bgerror {m} {set ::my_error $m}
set ::my_error {}
@@ -3671,7 +6702,6 @@ test text-36.2 "bug #1777362: event handling with hyphenated windows" -setup {
} -cleanup {
destroy $w
} -result {}
-
test text-36.3 "bug #1777362: event handling with hyphenated windows" -setup {
proc bgerror {m} {set ::my_error $m}
set ::my_error {}
@@ -3685,7 +6715,11 @@ test text-36.3 "bug #1777362: event handling with hyphenated windows" -setup {
} -cleanup {
destroy $w
} -result {}
-
+
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/textBTree.test b/tests/textBTree.test
index 3a89e55..41b3d98 100644
--- a/tests/textBTree.test
+++ b/tests/textBTree.test
@@ -8,642 +8,848 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-catch {destroy .t}
+proc setup {} {
+ .t delete 1.0 100000.0
+ .t tag delete x y
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ .t tag add x 1.1
+ .t tag add x 1.5 1.13
+ .t tag add x 2.2 2.6
+ .t tag add y 1.5
+}
+
+# setup procedure for tests 10.*, 11.*, 12.*
+proc msetup {} {
+ .t delete 1.0 100000.0
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ .t mark set m1 1.2
+ .t mark set l1 1.2
+ .t mark gravity l1 left
+ .t mark set next 1.6
+ .t mark set x 1.6
+ .t mark set m2 2.0
+ .t mark set m3 2.100
+ .t tag add x 1.3 1.8
+}
+
+# setup procedure for tests 16.*, 17.*, 18.9
+proc setupBig {} {
+ .t delete 1.0 end
+ .t tag delete x y
+ .t tag configure x -foreground blue
+ .t tag configure y -underline true
+ # Create a Btree with 2002 lines (2000 + already existing + phantom at end)
+ # This generates a level 3 node with 9 children
+ # Most level 2 nodes cover 216 lines and have 6 children, except the last
+ # level 2 node covers 274 lines and has 7 children.
+ # Most level 1 nodes cover 36 lines and have 6 children, except the
+ # rightmost node has 58 lines and 9 children.
+ # Level 2: 2002 = 8*216 + 274
+ # Level 1: 2002 = 54*36 + 58
+ # Level 0: 2002 = 332*6 + 10
+ for {set i 0} {$i < 2000} {incr i} {
+ append x "Line $i abcd efgh ijkl\n"
+ }
+ .t insert insert $x
+ .t debug 1
+}
+
+# Widget used in tests 1.* - 13.*
+destroy .t
text .t
.t debug on
-test btree-1.1 {basic insertions} {
+test btree-1.1 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-1.2 {basic insertions} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-1.2 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 1.3 XXX
.t get 1.0 1000000.0
-} "LinXXXe 1\nLine 2\nLine 3\n"
-test btree-1.3 {basic insertions} {
+} -result "LinXXXe 1\nLine 2\nLine 3\n"
+test btree-1.3 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 3.0 YYY
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nYYYLine 3\n"
-test btree-1.4 {basic insertions} {
+} -result "Line 1\nLine 2\nYYYLine 3\n"
+test btree-1.4 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 2.1 X\nYY
.t get 1.0 1000000.0
-} "Line 1\nLX\nYYine 2\nLine 3\n"
-test btree-1.5 {basic insertions} {
+} -result "Line 1\nLX\nYYine 2\nLine 3\n"
+test btree-1.5 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 2.0 X\n\n\n
.t get 1.0 1000000.0
-} "Line 1\nX\n\n\nLine 2\nLine 3\n"
-test btree-1.6 {basic insertions} {
+} -result "Line 1\nX\n\n\nLine 2\nLine 3\n"
+test btree-1.6 {basic insertions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 2.6 X\n
.t get 1.0 1000000.0
-} "Line 1\nLine 2X\n\nLine 3\n"
-test btree-1.7 {insertion before start of text} {
+} -result "Line 1\nLine 2X\n\nLine 3\n"
+test btree-1.7 {insertion before start of text} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 0.4 XXX
.t get 1.0 1000000.0
-} "XXXLine 1\nLine 2\nLine 3\n"
-test btree-1.8 {insertion past end of text} {
+} -result "XXXLine 1\nLine 2\nLine 3\n"
+test btree-1.8 {insertion past end of text} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 100.0 ZZ
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3ZZ\n"
-test btree-1.9 {insertion before start of line} {
+} -result "Line 1\nLine 2\nLine 3ZZ\n"
+test btree-1.9 {insertion before start of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 2.-3 Q
.t get 1.0 1000000.0
-} "Line 1\nQLine 2\nLine 3\n"
-test btree-1.10 {insertion past end of line} {
+} -result "Line 1\nQLine 2\nLine 3\n"
+test btree-1.10 {insertion past end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 2.40 XYZZY
.t get 1.0 1000000.0
-} "Line 1\nLine 2XYZZY\nLine 3\n"
-test btree-1.11 {insertion past end of last line} {
+} -result "Line 1\nLine 2XYZZY\nLine 3\n"
+test btree-1.11 {insertion past end of last line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t insert 3.40 ABC
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3ABC\n"
+} -result "Line 1\nLine 2\nLine 3ABC\n"
+
-test btree-2.1 {basic deletions} {
+test btree-2.1 {basic deletions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.0 1.3
.t get 1.0 1000000.0
-} "e 1\nLine 2\nLine 3\n"
-test btree-2.2 {basic deletions} {
+} -result "e 1\nLine 2\nLine 3\n"
+test btree-2.2 {basic deletions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 2.2
.t get 1.0 1000000.0
-} "Line 1\nLie 2\nLine 3\n"
-test btree-2.3 {basic deletions} {
+} -result "Line 1\nLie 2\nLine 3\n"
+test btree-2.3 {basic deletions} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 2.0 2.3
.t get 1.0 1000000.0
-} "Line 1\ne 2\nLine 3\n"
-test btree-2.4 {deleting whole lines} {
+} -result "Line 1\ne 2\nLine 3\n"
+test btree-2.4 {deleting whole lines} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.2 3.0
.t get 1.0 1000000.0
-} "LiLine 3\n"
-test btree-2.5 {deleting whole lines} {
+} -result "LiLine 3\n"
+test btree-2.5 {deleting whole lines} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\n\n\nLine 5"
.t delete 1.0 5.2
.t get 1.0 1000000.0
-} "ne 5\n"
-test btree-2.6 {deleting before start of file} {
+} -result "ne 5\n"
+test btree-2.6 {deleting before start of file} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 0.3 1.2
.t get 1.0 1000000.0
-} "ne 1\nLine 2\nLine 3\n"
-test btree-2.7 {deleting after end of file} {
+} -result "ne 1\nLine 2\nLine 3\n"
+test btree-2.7 {deleting after end of file} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 10.3
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.8 {deleting before start of line} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.8 {deleting before start of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.-1 3.3
.t get 1.0 1000000.0
-} "Line 1\nLine 2\ne 3\n"
-test btree-2.9 {deleting before start of line} {
+} -result "Line 1\nLine 2\ne 3\n"
+test btree-2.9 {deleting before start of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.-1 1.0
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.10 {deleting after end of line} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.10 {deleting after end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.8 2.1
.t get 1.0 1000000.0
-} "Line 1ine 2\nLine 3\n"
-test btree-2.11 {deleting after end of last line} {
+} -result "Line 1ine 2\nLine 3\n"
+test btree-2.11 {deleting after end of last line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.8 4.1
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.12 {deleting before start of file} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.12 {deleting before start of file} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.8 0.0
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.13 {deleting past end of file} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.13 {deleting past end of file} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.8 4.0
.t get 1.0 1000000.0
-} "Line 1\n"
-test btree-2.14 {deleting with end before start of line} {
+} -result "Line 1\n"
+test btree-2.14 {deleting with end before start of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.3 2.-3
.t get 1.0 1000000.0
-} "LinLine 2\nLine 3\n"
-test btree-2.15 {deleting past end of line} {
+} -result "LinLine 2\nLine 3\n"
+test btree-2.15 {deleting past end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.3 1.9
.t get 1.0 1000000.0
-} "Lin\nLine 2\nLine 3\n"
-test btree-2.16 {deleting past end of line} {
+} -result "Lin\nLine 2\nLine 3\n"
+test btree-2.16 {deleting past end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.2 3.15
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLi\n"
-test btree-2.17 {deleting past end of line} {
+} -result "Line 1\nLine 2\nLi\n"
+test btree-2.17 {deleting past end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.0 3.15
.t get 1.0 1000000.0
-} "Line 1\nLine 2\n\n"
-test btree-2.18 {deleting past end of line} {
+} -result "Line 1\nLine 2\n\n"
+test btree-2.18 {deleting past end of line} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 1.0 3.15
.t get 1.0 1000000.0
-} "\n"
-test btree-2.19 {deleting with negative range} {
+} -result "\n"
+test btree-2.19 {deleting with negative range} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.2 2.4
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.20 {deleting with negative range} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.20 {deleting with negative range} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.2 3.1
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
-test btree-2.21 {deleting with negative range} {
+} -result "Line 1\nLine 2\nLine 3\n"
+test btree-2.21 {deleting with negative range} -body {
.t delete 1.0 100000.0
.t insert 1.0 "Line 1\nLine 2\nLine 3"
.t delete 3.2 3.2
.t get 1.0 1000000.0
-} "Line 1\nLine 2\nLine 3\n"
+} -result "Line 1\nLine 2\nLine 3\n"
-proc setup {} {
- .t delete 1.0 100000.0
- .t tag delete x y
- .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
- .t tag add x 1.1
- .t tag add x 1.5 1.13
- .t tag add x 2.2 2.6
- .t tag add y 1.5
-}
-test btree-3.1 {inserting with tags} {
+test btree-3.1 {inserting with tags} -body {
setup
.t insert 1.0 XXX
list [.t tag ranges x] [.t tag ranges y]
-} {{1.4 1.5 1.8 1.16 2.2 2.6} {1.8 1.9}}
-test btree-3.2 {inserting with tags} {
+} -result {{1.4 1.5 1.8 1.16 2.2 2.6} {1.8 1.9}}
+test btree-3.2 {inserting with tags} -body {
setup
.t insert 1.15 YYY
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.13 2.2 2.6} {1.5 1.6}}
-test btree-3.3 {inserting with tags} {
+} -result {{1.1 1.2 1.5 1.13 2.2 2.6} {1.5 1.6}}
+test btree-3.3 {inserting with tags} -body {
setup
.t insert 1.7 ZZZZ
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.17 2.2 2.6} {1.5 1.6}}
-test btree-3.4 {inserting with tags} {
+} -result {{1.1 1.2 1.5 1.17 2.2 2.6} {1.5 1.6}}
+test btree-3.4 {inserting with tags} -body {
setup
.t insert 1.7 \n\n
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 3.6 4.2 4.6} {1.5 1.6}}
-test btree-3.5 {inserting with tags} {
+} -result {{1.1 1.2 1.5 3.6 4.2 4.6} {1.5 1.6}}
+test btree-3.5 {inserting with tags} -body {
setup
.t insert 1.5 A\n
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 2.0 2.8 3.2 3.6} {2.0 2.1}}
-test btree-3.6 {inserting with tags} {
+} -result {{1.1 1.2 2.0 2.8 3.2 3.6} {2.0 2.1}}
+test btree-3.6 {inserting with tags} -body {
setup
.t insert 1.13 A\n
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.13 3.2 3.6} {1.5 1.6}}
+} -result {{1.1 1.2 1.5 1.13 3.2 3.6} {1.5 1.6}}
+
-test btree-4.1 {deleting with tags} {
+test btree-4.1 {deleting with tags} -body {
setup
.t delete 1.6 1.9
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.10 2.2 2.6} {1.5 1.6}}
-test btree-4.2 {deleting with tags} {
+} -result {{1.1 1.2 1.5 1.10 2.2 2.6} {1.5 1.6}}
+test btree-4.2 {deleting with tags} -body {
setup
.t delete 1.1 2.3
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.4} {}}
-test btree-4.3 {deleting with tags} {
+} -result {{1.1 1.4} {}}
+test btree-4.3 {deleting with tags} -body {
setup
.t delete 1.4 2.1
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.9} {}}
-test btree-4.4 {deleting with tags} {
+} -result {{1.1 1.2 1.5 1.9} {}}
+test btree-4.4 {deleting with tags} -body {
setup
.t delete 1.14 2.1
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.13 1.15 1.19} {1.5 1.6}}
-test btree-4.5 {deleting with tags} {
+} -result {{1.1 1.2 1.5 1.13 1.15 1.19} {1.5 1.6}}
+test btree-4.5 {deleting with tags} -body {
setup
.t delete 1.0 2.10
list [.t tag ranges x] [.t tag ranges y]
-} {{} {}}
-test btree-4.6 {deleting with tags} {
+} -result {{} {}}
+test btree-4.6 {deleting with tags} -body {
setup
.t delete 1.0 1.5
list [.t tag ranges x] [.t tag ranges y]
-} {{1.0 1.8 2.2 2.6} {1.0 1.1}}
-test btree-4.7 {deleting with tags} {
+} -result {{1.0 1.8 2.2 2.6} {1.0 1.1}}
+test btree-4.7 {deleting with tags} -body {
setup
.t delete 1.6 1.9
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 1.5 1.10 2.2 2.6} {1.5 1.6}}
-test btree-4.8 {deleting with tags} {
+} -result {{1.1 1.2 1.5 1.10 2.2 2.6} {1.5 1.6}}
+test btree-4.8 {deleting with tags} -body {
setup
.t delete 1.5 1.13
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 2.2 2.6} {}}
+} -result {{1.1 1.2 2.2 2.6} {}}
-set bigText1 {}
-for {set i 0} {$i < 10} {incr i} {
- append bigText1 "Line $i\n"
-}
-set bigText2 {}
-for {set i 0} {$i < 200} {incr i} {
- append bigText2 "Line $i\n"
-}
-test btree-5.1 {very large inserts, with tags} {
+
+test btree-5.1 {very large inserts, with tags} -setup {
+ set bigText1 {}
+ for {set i 0} {$i < 10} {incr i} {
+ append bigText1 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.0 $bigText1
list [.t tag ranges x] [.t tag ranges y]
-} {{11.1 11.2 11.5 11.13 12.2 12.6} {11.5 11.6}}
-test btree-5.2 {very large inserts, with tags} {
+} -result {{11.1 11.2 11.5 11.13 12.2 12.6} {11.5 11.6}}
+test btree-5.2 {very large inserts, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.2 $bigText2
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 1.2 201.3 201.11 202.2 202.6} {201.3 201.4}}
-test btree-5.3 {very large inserts, with tags} {
+} -result {{1.1 1.2 201.3 201.11 202.2 202.6} {201.3 201.4}}
+test btree-5.3 {very large inserts, with tags} -body {
setup
for {set i 0} {$i < 200} {incr i} {
- .t insert 1.8 "longer line $i\n"
+ .t insert 1.8 "longer line $i\n"
}
- list [.t tag ranges x] [.t tag ranges y] [.t get 1.0 1.100] [.t get 198.0 198.100]
-} {{1.1 1.2 1.5 201.5 202.2 202.6} {1.5 1.6} {Text forlonger line 199} {longer line 2}}
+ list [.t tag ranges x] [.t tag ranges y] [.t get 1.0 1.100] \
+ [.t get 198.0 198.100]
+} -result {{1.1 1.2 1.5 201.5 202.2 202.6} {1.5 1.6} {Text forlonger line 199} {longer line 2}}
-test btree-6.1 {very large deletes, with tags} {
+
+test btree-6.1 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
.t delete 1.2 201.2
list [.t tag ranges x] [.t tag ranges y]
-} {{1.4 1.12 2.2 2.6} {1.4 1.5}}
-test btree-6.2 {very large deletes, with tags} {
+} -result {{1.4 1.12 2.2 2.6} {1.4 1.5}}
+test btree-6.2 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
for {set i 0} {$i < 200} {incr i} {
- .t delete 1.2 2.2
+ .t delete 1.2 2.2
}
list [.t tag ranges x] [.t tag ranges y]
-} {{1.4 1.12 2.2 2.6} {1.4 1.5}}
-test btree-6.3 {very large deletes, with tags} {
+} -result {{1.4 1.12 2.2 2.6} {1.4 1.5}}
+test btree-6.3 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
.t delete 2.3 10000.0
.t get 1.0 1000.0
-} {TLine 0
+} -result {TLine 0
Lin
}
-test btree-6.4 {very large deletes, with tags} {
+test btree-6.4 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
for {set i 0} {$i < 100} {incr i} {
- .t delete 30.0 31.0
+ .t delete 30.0 31.0
}
list [.t tag ranges x] [.t tag ranges y]
-} {{101.0 101.1 101.4 101.12 102.2 102.6} {101.4 101.5}}
-test btree-6.5 {very large deletes, with tags} {
+} -result {{101.0 101.1 101.4 101.12 102.2 102.6} {101.4 101.5}}
+test btree-6.5 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
for {set i 0} {$i < 100} {incr i} {
- set j [expr $i+2]
- set k [expr 1+2*$i]
- .t tag add x $j.1 $j.3
- .t tag add y $k.1 $k.6
+ set j [expr $i+2]
+ set k [expr 1+2*$i]
+ .t tag add x $j.1 $j.3
+ .t tag add y $k.1 $k.6
}
.t delete 2.0 200.0
list [.t tag ranges x] [.t tag ranges y]
-} {{3.0 3.1 3.4 3.12 4.2 4.6} {1.1 1.6 3.4 3.5}}
-test btree-6.6 {very large deletes, with tags} {
+} -result {{3.0 3.1 3.4 3.12 4.2 4.6} {1.1 1.6 3.4 3.5}}
+test btree-6.6 {very large deletes, with tags} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.1 $bigText2
for {set i 0} {$i < 100} {incr i} {
- set j [expr $i+2]
- set k [expr 1+2*$i]
- .t tag add x $j.1 $j.3
- .t tag add y $k.1 $k.6
+ set j [expr $i+2]
+ set k [expr 1+2*$i]
+ .t tag add x $j.1 $j.3
+ .t tag add y $k.1 $k.6
}
for {set i 199} {$i >= 2} {incr i -1} {
- .t delete $i.0 [expr $i+1].0
+ .t delete $i.0 [expr $i+1].0
}
list [.t tag ranges x] [.t tag ranges y]
-} {{3.0 3.1 3.4 3.12 4.2 4.6} {1.1 1.6 3.4 3.5}}
-
-.t delete 1.0 end
-.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
-set i 1
-foreach check {
- {1.3 1.6 1.7 2.0 {1.3 1.6 1.7 2.0}}
- {1.3 1.6 1.6 2.0 {1.3 2.0}}
- {1.3 1.6 1.4 2.0 {1.3 2.0}}
- {2.0 4.3 1.4 1.10 {1.4 1.10 2.0 4.3}}
- {2.0 4.3 1.4 1.end {1.4 1.19 2.0 4.3}}
- {2.0 4.3 1.4 2.0 {1.4 4.3}}
- {2.0 4.3 1.4 3.0 {1.4 4.3}}
- {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 4.2 {1.1 4.2}}
- {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.3 4.2 {1.2 4.2}}
- {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 3.0 {1.1 4.0}}
- {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.2 3.0 {1.2 4.0}}
-} {
- test btree-7.$i {tag addition and removal} {
- .t tag remove x 1.0 end
- while {[llength $check] > 2} {
- .t tag add x [lindex $check 0] [lindex $check 1]
- set check [lrange $check 2 end]
- }
- .t tag ranges x
- } [lindex $check [expr [llength $check]-1]]
- incr i
-}
+} -result {{3.0 3.1 3.4 3.12 4.2 4.6} {1.1 1.6 3.4 3.5}}
+
+
+test btree-7.1 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.3 1.6 1.7 2.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.3 1.6 1.7 2.0}
+test btree-7.2 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.3 1.6 1.6 2.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.3 2.0}
+test btree-7.3 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.3 1.6 1.4 2.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.3 2.0}
+test btree-7.4 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {2.0 4.3 1.4 1.10}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.4 1.10 2.0 4.3}
+test btree-7.5 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {2.0 4.3 1.4 1.end}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.4 1.19 2.0 4.3}
+test btree-7.6 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {2.0 4.3 1.4 2.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.4 4.3}
+test btree-7.7 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {2.0 4.3 1.4 3.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.4 4.3}
+test btree-7.8 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 4.2}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.1 4.2}
+test btree-7.9 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.3 4.2}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.2 4.2}
+test btree-7.10 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.1 3.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.1 4.0}
+test btree-7.11 {tag addition and removal} -setup {
+ .t delete 1.0 end
+ .t tag remove x 1.0 end
+} -body {
+ .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
+ set check {1.2 1.3 1.6 1.7 1.end 2.0 2.4 2.7 3.0 4.0 1.2 3.0}
+ while {[llength $check]} {
+ .t tag add x [lindex $check 0] [lindex $check 1]
+ set check [lrange $check 2 end]
+ }
+ .t tag ranges x
+} -result {1.2 4.0}
-test btree-8.1 {tag addition and removal, weird ranges} {
+
+test btree-8.1 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 0.0 1.3
.t tag ranges x
-} {1.0 1.3}
-test btree-8.2 {tag addition and removal, weird ranges} {
+} -result {1.0 1.3}
+test btree-8.2 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 1.40 2.4
.t tag ranges x
-} {1.19 2.4}
-test btree-8.3 {tag addition and removal, weird ranges} {
+} -result {1.19 2.4}
+test btree-8.3 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 4.40 4.41
.t tag ranges x
-} {}
-test btree-8.4 {tag addition and removal, weird ranges} {
+} -result {}
+test btree-8.4 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 5.1 5.2
.t tag ranges x
-} {}
-test btree-8.5 {tag addition and removal, weird ranges} {
+} -result {}
+test btree-8.5 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 1.1 9.0
.t tag ranges x
-} {1.1 5.0}
-test btree-8.6 {tag addition and removal, weird ranges} {
+} -result {1.1 5.0}
+test btree-8.6 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 1.1 1.90
.t tag ranges x
-} {1.1 1.19}
-test btree-8.7 {tag addition and removal, weird ranges} {
+} -result {1.1 1.19}
+test btree-8.7 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 1.1 4.90
.t tag ranges x
-} {1.1 4.17}
-test btree-8.8 {tag addition and removal, weird ranges} {
+} -result {1.1 4.17}
+test btree-8.8 {tag addition and removal, weird ranges} -body {
.t delete 1.0 100000.0
.t tag delete x
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 3.0 3.0
.t tag ranges x
-} {}
+} -result {}
+
-test btree-9.1 {tag names} {
+test btree-9.1 {tag names} -body {
setup
.t tag names
-} {sel x y}
-test btree-9.2 {tag names} {
+} -result {sel x y}
+test btree-9.2 {tag names} -body {
setup
.t tag add tag1 1.8
.t tag add tag2 1.8
.t tag add tag3 1.7 1.9
.t tag names 1.8
-} {x tag1 tag2 tag3}
-test btree-9.3 {lots of tag names} {
+} -result {x tag1 tag2 tag3}
+test btree-9.3 {lots of tag names} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.2 $bigText2
foreach i {tag1 foo ThisOne {x space} q r s t} {
- .t tag add $i 150.2
+ .t tag add $i 150.2
}
foreach i {u tagA tagB tagC and more {$} \{} {
- .t tag add $i 150.1 150.3
+ .t tag add $i 150.1 150.3
}
.t tag names 150.2
-} {tag1 foo ThisOne {x space} q r s t u tagA tagB tagC and more {$} \{}
-test btree-9.4 {lots of tag names} {
+} -result {tag1 foo ThisOne {x space} q r s t u tagA tagB tagC and more {$} \{}
+test btree-9.4 {lots of tag names} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.2 $bigText2
.t tag delete tag1 foo ThisOne more {x space} q r s t u
.t tag delete tagA tagB tagC and {$} \{ more
foreach i {tag1 foo ThisOne more {x space} q r s t} {
- .t tag add $i 150.2
+ .t tag add $i 150.2
}
foreach i {foo ThisOne u tagA tagB tagC and more {$} \{} {
- .t tag add $i 150.4
+ .t tag add $i 150.4
}
.t tag delete tag1 more q r tagA
.t tag names 150.2
-} {foo ThisOne {x space} s t}
+} -result {foo ThisOne {x space} s t}
-proc msetup {} {
- .t delete 1.0 100000.0
- .t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
- .t mark set m1 1.2
- .t mark set l1 1.2
- .t mark gravity l1 left
- .t mark set next 1.6
- .t mark set x 1.6
- .t mark set m2 2.0
- .t mark set m3 2.100
- .t tag add x 1.3 1.8
-}
-test btree-10.1 {basic mark facilities} {
+
+test btree-10.1 {basic mark facilities} -body {
msetup
list [lsort [.t mark names]] [.t index m1] [.t index m2] [.t index m3]
-} {{current insert l1 m1 m2 m3 next x} 1.2 2.0 2.11}
-test btree-10.2 {basic mark facilities} {
+} -result {{current insert l1 m1 m2 m3 next x} 1.2 2.0 2.11}
+test btree-10.2 {basic mark facilities} -body {
msetup
.t mark unset m2
lsort [.t mark names]
-} {current insert l1 m1 m3 next x}
-test btree-10.3 {basic mark facilities} {
+} -result {current insert l1 m1 m3 next x}
+test btree-10.3 {basic mark facilities} -body {
msetup
.t mark set m2 1.8
list [lsort [.t mark names]] [.t index m1] [.t index m2] [.t index m3]
-} {{current insert l1 m1 m2 m3 next x} 1.2 1.8 2.11}
+} -result {{current insert l1 m1 m2 m3 next x} 1.2 1.8 2.11}
-test btree-11.1 {marks and inserts} {
+
+test btree-11.1 {marks and inserts} -body {
msetup
.t insert 1.1 abcde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.7 1.7 1.11 1.11 2.0 2.11}
-test btree-11.2 {marks and inserts} {
+} -result {1.7 1.7 1.11 1.11 2.0 2.11}
+test btree-11.2 {marks and inserts} -body {
msetup
.t insert 1.2 abcde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.7 1.11 1.11 2.0 2.11}
-test btree-11.3 {marks and inserts} {
+} -result {1.2 1.7 1.11 1.11 2.0 2.11}
+test btree-11.3 {marks and inserts} -body {
msetup
.t insert 1.3 abcde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.11 1.11 2.0 2.11}
-test btree-11.4 {marks and inserts} {
+} -result {1.2 1.2 1.11 1.11 2.0 2.11}
+test btree-11.4 {marks and inserts} -body {
msetup
.t insert 1.1 ab\n\ncde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {3.4 3.4 3.8 3.8 4.0 4.11}
-test btree-11.5 {marks and inserts} {
+} -result {3.4 3.4 3.8 3.8 4.0 4.11}
+test btree-11.5 {marks and inserts} -body {
msetup
.t insert 1.4 ab\n\ncde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 3.5 3.5 4.0 4.11}
-test btree-11.6 {marks and inserts} {
+} -result {1.2 1.2 3.5 3.5 4.0 4.11}
+test btree-11.6 {marks and inserts} -body {
msetup
.t insert 1.7 ab\n\ncde
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.6 1.6 4.0 4.11}
+} -result {1.2 1.2 1.6 1.6 4.0 4.11}
+
-test btree-12.1 {marks and deletes} {
+test btree-12.1 {marks and deletes} -body {
msetup
.t delete 1.3 1.5
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.4 1.4 2.0 2.11}
-test btree-12.2 {marks and deletes} {
+} -result {1.2 1.2 1.4 1.4 2.0 2.11}
+test btree-12.2 {marks and deletes} -body {
msetup
.t delete 1.3 1.8
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.3 1.3 2.0 2.11}
-test btree-12.3 {marks and deletes} {
+} -result {1.2 1.2 1.3 1.3 2.0 2.11}
+test btree-12.3 {marks and deletes} -body {
msetup
.t delete 1.2 1.8
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.2 1.2 2.0 2.11}
-test btree-12.4 {marks and deletes} {
+} -result {1.2 1.2 1.2 1.2 2.0 2.11}
+test btree-12.4 {marks and deletes} -body {
msetup
.t delete 1.1 1.8
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.1 1.1 1.1 1.1 2.0 2.11}
-test btree-12.5 {marks and deletes} {
+} -result {1.1 1.1 1.1 1.1 2.0 2.11}
+test btree-12.5 {marks and deletes} -body {
msetup
.t delete 1.5 3.1
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.5 1.5 1.5 1.5}
-test btree-12.6 {marks and deletes} {
+} -result {1.2 1.2 1.5 1.5 1.5 1.5}
+test btree-12.6 {marks and deletes} -body {
msetup
.t mark set m2 4.5
.t delete 1.5 4.1
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.2 1.5 1.5 1.9 1.5}
-test btree-12.7 {marks and deletes} {
+} -result {1.2 1.2 1.5 1.5 1.9 1.5}
+test btree-12.7 {marks and deletes} -body {
msetup
.t mark set m2 4.5
.t mark set m3 4.5
.t mark set m1 4.7
.t delete 1.5 4.1
list [.t index l1] [.t index m1] [.t index next] [.t index x] [.t index m2] [.t index m3]
-} {1.2 1.11 1.5 1.5 1.9 1.9}
+} -result {1.2 1.11 1.5 1.5 1.9 1.9}
-destroy .t
-text .t
-test btree-13.1 {tag searching} {
+
+test btree-13.1 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag next x 2.2 2.1
-} {}
-test btree-13.2 {tag searching} {
+} -result {}
+test btree-13.2 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.2 2.4
.t tag next x 2.2 2.3
-} {2.2 2.4}
-test btree-13.3 {tag searching} {
+} -result {2.2 2.4}
+test btree-13.3 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.2 2.4
.t tag next x 2.3 2.6
-} {}
-test btree-13.4 {tag searching} {
+} -result {}
+test btree-13.4 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.5 2.8
.t tag next x 2.1 2.6
-} {2.5 2.8}
-test btree-13.5 {tag searching} {
+} -result {2.5 2.8}
+test btree-13.5 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.5 2.8
.t tag next x 2.1 2.5
-} {}
-test btree-13.6 {tag searching} {
+} -result {}
+test btree-13.6 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.1 2.4
.t tag next x 2.5 2.8
-} {}
-test btree-13.7 {tag searching} {
+} -result {}
+test btree-13.7 {tag searching} -setup {
.t delete 1.0 100000.0
+} -body {
.t insert 1.0 "Text for first line\nSecond line\n\nLast line of info"
.t tag add x 2.5 2.8
.t tag next x 2.1 2.4
-} {}
-test btree-13.8 {tag searching} {
+} -result {}
+test btree-13.8 {tag searching} -setup {
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.2 $bigText2
.t tag add x 190.3 191.2
.t tag next x 3.5
-} {190.3 191.2}
+} -result {190.3 191.2}
+destroy .t
+
-test btree-14.1 {check tag presence} {
+test btree-14.1 {check tag presence} -setup {
+ destroy .t
+ text .t
+ set bigText2 {}
+ for {set i 0} {$i < 200} {incr i} {
+ append bigText2 "Line $i\n"
+ }
+} -body {
setup
.t insert 1.2 $bigText2
.t tag add x 3.5 3.7
@@ -656,242 +862,371 @@ test btree-14.1 {check tag presence} {
.t tag add b 7.5
.t tag add b 140.3
for {set i 120} {$i < 160} {incr i} {
- .t tag add c $i.4
+ .t tag add c $i.4
}
foreach i {a1 a2 a3 a4 a5 a6 a7 a8 a9 10 a11 a12 a13} {
- .t tag add $i 122.2
+ .t tag add $i 122.2
}
.t tag add x 141.3
.t tag names 141.1
-} {x y z}
+} -cleanup {
+ destroy .t
+} -result {x y z}
+
-test btree-15.1 {rebalance with empty node} {
- catch {destroy .t}
+test btree-15.1 {rebalance with empty node} -setup {
+ destroy .t
+} -body {
text .t
.t debug 1
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23"
.t delete 6.0 12.0
.t get 1.0 end
-} "1\n2\n3\n4\n5\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n"
+} -cleanup {
+ destroy .t
+} -result "1\n2\n3\n4\n5\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n"
-proc setupBig {} {
- .t delete 1.0 end
- .t tag delete x y
- .t tag configure x -foreground blue
- .t tag configure y -underline true
- # Create a Btree with 2002 lines (2000 + already existing + phantom at end)
- # This generates a level 3 node with 9 children
- # Most level 2 nodes cover 216 lines and have 6 children, except the last
- # level 2 node covers 274 lines and has 7 children.
- # Most level 1 nodes cover 36 lines and have 6 children, except the
- # rightmost node has 58 lines and 9 children.
- # Level 2: 2002 = 8*216 + 274
- # Level 1: 2002 = 54*36 + 58
- # Level 0: 2002 = 332*6 + 10
- for {set i 0} {$i < 2000} {incr i} {
- append x "Line $i abcd efgh ijkl\n"
- }
- .t insert insert $x
- .t debug 1
-}
-test btree-16.1 {add tag does not push root above level 0} {
- catch {destroy .t}
+test btree-16.1 {add tag does not push root above level 0} -setup {
+ destroy .t
text .t
+} -body {
setupBig
+ .t debug 0
.t tag add x 1.1 1.10
.t tag add x 5.1 5.10
.t tag ranges x
-} {1.1 1.10 5.1 5.10}
-test btree-16.2 {add tag pushes root up to level 1 node} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {1.1 1.10 5.1 5.10}
+test btree-16.2 {add tag pushes root up to level 1 node} -setup {
+ destroy .t
text .t
- .t debug 1
+} -body {
setupBig
.t tag add x 1.1 1.10
.t tag add x 8.1 8.10
.t tag ranges x
-} {1.1 1.10 8.1 8.10}
-test btree-16.3 {add tag pushes root up to level 2 node} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 1.10 8.1 8.10}
+test btree-16.3 {add tag pushes root up to level 2 node} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 8.1 9.10
.t tag add x 180.1 180.end
.t tag ranges x
-} {8.1 9.10 180.1 180.23}
-test btree-16.4 {add tag pushes root up to level 3 node} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {8.1 9.10 180.1 180.23}
+test btree-16.4 {add tag pushes root up to level 3 node} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add y 1.1 2000.0
.t tag add x 1.1 8.10
.t tag add x 180.end 217.0
list [.t tag ranges x] [.t tag ranges y]
-} {{1.1 8.10 180.23 217.0} {1.1 2000.0}}
-test btree-16.5 {add tag doesn't push root up} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{1.1 8.10 180.23 217.0} {1.1 2000.0}}
+test btree-16.5 {add tag doesn't push root up} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 8.10
.t tag add x 2000.0 2000.3
.t tag add x 180.end 217.0
.t tag ranges x
-} {1.1 8.10 180.23 217.0 2000.0 2000.3}
-test btree-16.6 {two node splits at once pushes root up} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 8.10 180.23 217.0 2000.0 2000.3}
+test btree-16.6 {two node splits at once pushes root up} -setup {
+ destroy .t
+ text .t
+} -body {
for {set i 1} {$i < 10} {incr i} {
- .t insert end "Line $i\n"
+ .t insert end "Line $i\n"
}
.t tag add x 8.0 8.end
.t tag add y 9.0 end
set x {}
for {} {$i < 50} {incr i} {
- append x "Line $i\n"
+ append x "Line $i\n"
}
.t insert end $x y
list [.t tag ranges x] [.t tag ranges y]
-} {{8.0 8.6} {9.0 51.0}}
+} -cleanup {
+ destroy .t
+} -result {{8.0 8.6} {9.0 51.0}}
# The following find bugs in the SearchStart procedures
-test btree-16.7 {Partial tag remove from before first range} {
- .t tag remove x 1.0 end
+test btree-16.7 {Partial tag remove from before first range} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 2.0 2.6
.t tag remove x 1.0 2.0
.t tag ranges x
-} {2.0 2.6}
-test btree-16.8 {Partial tag remove from before first range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2.0 2.6}
+test btree-16.8 {Partial tag remove from before first range} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 2.0 2.6
.t tag remove x 1.0 2.1
.t tag ranges x
-} {2.1 2.6}
-test btree-16.9 {Partial tag remove from before first range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2.1 2.6}
+test btree-16.9 {Partial tag remove from before first range} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 2.0 2.6
.t tag remove x 1.0 2.3
.t tag ranges x
-} {2.3 2.6}
-test btree-16.10 {Partial tag remove from before first range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2.3 2.6}
+test btree-16.10 {Partial tag remove from before first range} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 1.0 2.6
.t tag remove x 1.0 2.5
.t tag ranges x
-} {2.5 2.6}
-test btree-16.11 {StartSearchBack boundary case} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2.5 2.6}
+test btree-16.11 {StartSearchBack boundary case} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 1.3 1.4
.t tag prevr x 2.0 1.4
-} {}
-test btree-16.12 {StartSearchBack boundary case} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {}
+test btree-16.12 {StartSearchBack boundary case} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 1.3 1.4
.t tag prevr x 2.0 1.3
-} {1.3 1.4}
-test btree-16.13 {StartSearchBack boundary case} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.3 1.4}
+test btree-16.13 {StartSearchBack boundary case} -setup {
+ destroy .t
+ text .t
+ for {set i 1} {$i < 10} {incr i} {
+ .t insert end "Line $i\n"
+ }
+} -body {
.t tag add x 1.0 1.4
.t tag prevr x 1.3
-} {1.0 1.4}
+} -cleanup {
+ destroy .t
+} -result {1.0 1.4}
-test btree-17.1 {remove tag does not push root down} {
- catch {destroy .t}
+test btree-17.1 {remove tag does not push root down} -setup {
+ destroy .t
text .t
+} -body {
.t debug 0
setupBig
.t tag add x 1.1 5.10
.t tag remove x 3.1 5.end
.t tag ranges x
-} {1.1 3.1}
-test btree-17.2 {remove tag pushes root from level 1 to level 0} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 3.1}
+test btree-17.2 {remove tag pushes root from level 1 to level 0} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 8.10
.t tag remove x 3.1 end
.t tag ranges x
-} {1.1 3.1}
-test btree-17.3 {remove tag pushes root from level 2 to level 1} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 3.1}
+test btree-17.3 {remove tag pushes root from level 2 to level 1} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 180.10
.t tag remove x 35.1 end
.t tag ranges x
-} {1.1 35.1}
-test btree-17.4 {remove tag doesn't change level 2} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 35.1}
+test btree-17.4 {remove tag doesn't change level 2} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 180.10
.t tag remove x 35.1 180.0
.t tag ranges x
-} {1.1 35.1 180.0 180.10}
-test btree-17.5 {remove tag pushes root from level 3 to level 0} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 35.1 180.0 180.10}
+test btree-17.5 {remove tag pushes root from level 3 to level 0} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 1.10
.t tag add x 2000.1 2000.10
.t tag remove x 1.0 2000.0
.t tag ranges x
-} {2000.1 2000.10}
-test btree-17.6 {text deletion pushes root from level 3 to level 0} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2000.1 2000.10}
+test btree-17.6 {text deletion pushes root from level 3 to level 0} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.1 1.10
.t tag add x 2000.1 2000.10
.t delete 1.0 "1000.0 lineend +1 char"
.t tag ranges x
-} {1000.1 1000.10}
+} -cleanup {
+ destroy .t
+} -result {1000.1 1000.10}
-catch {destroy .t}
-text .t
-test btree-18.1 {tag search back, no tag} {
+
+test btree-18.1 {tag search back, no tag} -setup {
+ destroy .t
+ text .t
+} -body {
.t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag prev x 1.1 1.1
-} {}
-test btree-18.2 {tag search back, start at existing range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {}
+test btree-18.2 {tag search back, start at existing range} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.8 1.11
.t tag add x 1.16
.t tag prev x 1.1
-} {}
-test btree-18.3 {tag search back, end at existing range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {}
+test btree-18.3 {tag search back, end at existing range} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.8 1.11
.t tag add x 1.16
.t tag prev x 1.3 1.1
-} {1.1 1.4}
-test btree-18.4 {tag search back, start within range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.1 1.4}
+test btree-18.4 {tag search back, start within range} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.8 1.11
.t tag add x 1.16
.t tag prev x 1.10 1.0
-} {1.8 1.11}
-test btree-18.5 {tag search back, start at end of range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.8 1.11}
+test btree-18.5 {tag search back, start at end of range} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.8 1.11
.t tag add x 1.16
list [.t tag prev x 1.4 1.0] [.t tag prev x 1.11 1.0]
-} {{1.1 1.4} {1.8 1.11}}
-test btree-18.6 {tag search back, start beyond range, same level 0 node} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {{1.1 1.4} {1.8 1.11}}
+test btree-18.6 {tag search back, start beyond range, same level 0 node} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.8 1.11
.t tag add x 1.16
.t tag prev x 3.0
-} {1.16 1.17}
-test btree-18.7 {tag search back, outside any range} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {1.16 1.17}
+test btree-18.7 {tag search back, outside any range} -setup {
+ destroy .t
+ text .t
+} -body {
+ .t insert 1.0 "Line 1 abcd efgh ijkl\n"
.t tag add x 1.1 1.4
.t tag add x 1.16
.t tag prev x 1.8 1.5
-} {}
-test btree-18.8 {tag search back, start at start of node boundary} {
+} -cleanup {
+ destroy .t
+} -result {}
+test btree-18.8 {tag search back, start at start of node boundary} -setup {
+ destroy .t
+ text .t
+} -body {
setupBig
- .t tag remove x 1.0 end
.t tag add x 2.5 2.8
.t tag prev x 19.0
-} {2.5 2.8}
-test btree-18.9 {tag search back, large complex btree spans} {
- .t tag remove x 1.0 end
+} -cleanup {
+ destroy .t
+} -result {2.5 2.8}
+test btree-18.9 {tag search back, large complex btree spans} -setup {
+ destroy .t
+ text .t
+} -body {
+ setupBig
.t tag add x 1.3 1.end
.t tag add x 200.0 220.0
.t tag add x 500.0 520.0
list [.t tag prev x end] [.t tag prev x 433.0]
-} {{500.0 520.0} {200.0 220.0}}
-
-destroy .t
+} -cleanup {
+ destroy .t
+} -result {{500.0 520.0} {200.0 220.0}}
# cleanup
cleanupTests
diff --git a/tests/textImage.test b/tests/textImage.test
index bb5909c..24246cc 100644
--- a/tests/textImage.test
+++ b/tests/textImage.test
@@ -7,349 +7,445 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+imageInit
# One time setup. Create a font to insure the tests are font metric invariant.
-
-catch {destroy .t}
+destroy .t
font create test_font -family courier -size 14
text .t -font test_font
destroy .t
-test textImage-1.1 {basic argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image} msg] $msg
-} {1 {wrong # args: should be ".t image option ?arg arg ...?"}}
-
-test textImage-1.2 {basic argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image c} msg] $msg
-} {1 {ambiguous option "c": must be cget, configure, create, or names}}
-
-test textImage-1.3 {cget argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image cget} msg] $msg
-} {1 {wrong # args: should be ".t image cget index option"}}
-
-test textImage-1.4 {cget argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image cget blurf -flurp} msg] $msg
-} {1 {bad text index "blurf"}}
-
-test textImage-1.5 {cget argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image cget 1.1 -flurp} msg] $msg
-} {1 {no embedded image at index "1.1"}}
-
-test textImage-1.6 {configure argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image configure } msg] $msg
-} {1 {wrong # args: should be ".t image configure index ?option value ...?"}}
-
-test textImage-1.7 {configure argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image configure blurf } msg] $msg
-} {1 {bad text index "blurf"}}
-
-test textImage-1.8 {configure argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image configure 1.1 } msg] $msg
-} {1 {no embedded image at index "1.1"}}
-
-test textImage-1.9 {create argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image create} msg] $msg
-} {1 {wrong # args: should be ".t image create index ?option value ...?"}}
-
-test textImage-1.10 {create argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image create blurf } msg] $msg
-} {1 {bad text index "blurf"}}
-
-test textImage-1.11 {basic argument checking} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image create 1000.1000 -image small} msg] $msg
-} {0 small}
-
-test textImage-1.12 {names argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image names dates places} msg] $msg
-} {1 {wrong # args: should be ".t image names"}}
-
-
-test textImage-1.13 {names argument checking} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- set result ""
- lappend result [.t image names]
- .t image create insert -image small
- lappend result [.t image names]
- .t image create insert -image small
- lappend result [.t image names]
- .t image create insert -image small -name little
- lappend result [.t image names]
-} {{} small {small#1 small} {small#1 small little}}
-
-test textImage-1.14 {basic argument checking} {
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image huh} msg] $msg
-} {1 {bad option "huh": must be cget, configure, create, or names}}
-
-test textImage-1.15 {align argument checking} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- list [catch {.t image create end -image small -align wrong} msg] $msg
-} {1 {bad align "wrong": must be baseline, bottom, center, or top}}
-
-test textImage-1.16 {configure} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -image small
- .t image configure small
-} {{-align {} {} center center} {-padx {} {} 0 0} {-pady {} {} 0 0} {-image {} {} {} small} {-name {} {} {} {}}}
-
-test textImage-1.17 {basic cget options} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -image small
- set result ""
- foreach i {align padx pady image name} {
- lappend result $i:[.t image cget small -$i]
- }
- set result
-} {align:center padx:0 pady:0 image:small name:}
-
-test textImage-1.18 {basic configure options} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- image create photo large -width 50 -height 50
- large put green -to 0 0 50 50
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -image small
- set result ""
- foreach {option value} {align top padx 5 pady 7 image large name none} {
- .t image configure small -$option $value
- }
- update
- .t image configure small
-} {{-align {} {} center top} {-padx {} {} 0 5} {-pady {} {} 0 7} {-image {} {} {} large} {-name {} {} {} none}}
-
-test textImage-1.19 {basic image naming} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -image small
- .t image create end -image small -name small
- .t image create end -image small -name small#6342
- .t image create end -image small -name small
- lsort [.t image names]
-} {small small#1 small#6342 small#6343}
-
-test textImage-2.1 {debug} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t debug 1
- .t insert end front
- .t image create end -image small
- .t insert end back
- .t delete small
- .t image names
- .t debug 0
-} {}
-
-test textImage-3.1 {image change propagation} {
- catch {
- image create photo vary -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -image vary -align top
- update
- set result ""
- lappend result base:[.t bbox vary]
- foreach i {10 20 40} {
- vary configure -width $i -height $i
- update
- lappend result $i:[.t bbox vary]
- }
- set result
-} {{base:0 0 5 5} {10:0 0 10 10} {20:0 0 20 20} {40:0 0 40 40}}
-
-test textImage-3.2 {delayed image management} {
- catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- }
- catch {destroy .t}
- text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
- pack .t
- .t image create end -name test
- update
- set result ""
- lappend result [.t bbox test]
- .t image configure test -image small -align top
- update
- lappend result [.t bbox test]
-} {{} {0 0 5 5}}
+test textImage-1.1 {basic argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be ".t image option ?arg ...?"}
+
+test textImage-1.2 {basic argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image c
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {ambiguous option "c": must be cget, configure, create, or names}
+
+test textImage-1.3 {cget argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image cget
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be ".t image cget index option"}
+
+test textImage-1.4 {cget argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image cget blurf -flurp
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {bad text index "blurf"}
+
+test textImage-1.5 {cget argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image cget 1.1 -flurp
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {no embedded image at index "1.1"}
+
+test textImage-1.6 {configure argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image configure
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be ".t image configure index ?-option value ...?"}
+
+test textImage-1.7 {configure argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image configure blurf
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {bad text index "blurf"}
+
+test textImage-1.8 {configure argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image configure 1.1
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {no embedded image at index "1.1"}
+
+test textImage-1.9 {create argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be ".t image create index ?-option value ...?"}
+
+test textImage-1.10 {create argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create blurf
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {bad text index "blurf"}
+
+test textImage-1.11 {basic argument checking} -setup {
+ destroy .t
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create 1000.1000 -image small
+} -cleanup {
+ destroy .t
+ image delete small
+} -returnCodes ok -result {small}
+
+test textImage-1.12 {names argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image names dates places
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be ".t image names"}
+
+
+test textImage-1.13 {names argument checking} -setup {
+ destroy .t
+ set result ""
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ lappend result [.t image names]
+ .t image create insert -image small
+ lappend result [.t image names]
+ .t image create insert -image small
+ lappend result [lsort [.t image names]]
+ .t image create insert -image small -name little
+ lappend result [lsort [.t image names]]
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {{} small {small small#1} {little small small#1}}
+
+test textImage-1.14 {basic argument checking} -setup {
+ destroy .t
+} -body {
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image huh
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {bad option "huh": must be cget, configure, create, or names}
+
+test textImage-1.15 {align argument checking} -setup {
+ destroy .t
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image small -align wrong
+} -cleanup {
+ destroy .t
+ image delete small
+} -returnCodes error -result {bad align "wrong": must be baseline, bottom, center, or top}
+
+test textImage-1.16 {configure} -setup {
+ destroy .t
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image small
+ .t image configure small
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {{-align {} {} center center} {-padx {} {} 0 0} {-pady {} {} 0 0} {-image {} {} {} small} {-name {} {} {} {}}}
+
+test textImage-1.17 {basic cget options} -setup {
+ destroy .t
+ set result ""
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image small
+ foreach i {align padx pady image name} {
+ lappend result $i:[.t image cget small -$i]
+ }
+ return $result
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {align:center padx:0 pady:0 image:small name:}
+
+test textImage-1.18 {basic configure options} -setup {
+ destroy .t
+ set result ""
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ image create photo large -width 50 -height 50
+ large put green -to 0 0 50 50
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image small
+ foreach {option value} {align top padx 5 pady 7 image large name none} {
+ .t image configure small -$option $value
+ }
+ update
+ .t image configure small
+} -cleanup {
+ destroy .t
+ image delete small large
+} -result {{-align {} {} center top} {-padx {} {} 0 5} {-pady {} {} 0 7} {-image {} {} {} large} {-name {} {} {} none}}
+
+test textImage-1.19 {basic image naming} -setup {
+ destroy .t
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image small
+ .t image create end -image small -name small
+ .t image create end -image small -name small#6342
+ .t image create end -image small -name small
+ lsort [.t image names]
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {small small#1 small#6342 small#6343}
+
+test textImage-2.1 {debug} -setup {
+ destroy .t
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t debug 1
+ .t insert end front
+ .t image create end -image small
+ .t insert end back
+ .t delete small
+ .t image names
+ .t debug 0
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {}
+
+
+test textImage-3.1 {image change propagation} -setup {
+ destroy .t
+ set result ""
+} -body {
+ catch {
+ image create photo vary -width 5 -height 5
+ vary put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -image vary -align top
+ update
+ lappend result base:[.t bbox vary]
+ foreach i {10 20 40} {
+ vary configure -width $i -height $i
+ update
+ lappend result $i:[.t bbox vary]
+ }
+ return $result
+} -cleanup {
+ destroy .t
+ image delete vary
+} -result {{base:0 0 5 5} {10:0 0 10 10} {20:0 0 20 20} {40:0 0 40 40}}
+
+# Fails in some environments (both in Linux and winXP)
+test textImage-3.2 {delayed image management} -setup {
+ destroy .t
+ set result ""
+} -body {
+ catch {
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ }
+ text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
+ pack .t
+ .t image create end -name test
+ update
+ lappend result [.t bbox test]
+ .t image configure test -image small -align top
+ update
+ lappend result [.t bbox test]
+} -cleanup {
+ destroy .t
+ image delete small
+} -result {{} {0 0 5 5}}
+
# some temporary random tests
-test textImage-4.1 {alignment checking - except baseline} {
+test textImage-4.1 {alignment checking - except baseline} -setup {
+ destroy .t
+ set result ""
+} -body {
catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- image create photo large -width 50 -height 50
- large put green -to 0 0 50 50
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ image create photo large -width 50 -height 50
+ large put green -to 0 0 50 50
}
- catch {destroy .t}
text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
pack .t
.t image create end -image large
.t image create end -image small
.t insert end test
update
- set result ""
lappend result default:[.t bbox small]
foreach i {top bottom center} {
- .t image configure small -align $i
- update
- lappend result [.t image cget small -align]:[.t bbox small]
+ .t image configure small -align $i
+ update
+ lappend result [.t image cget small -align]:[.t bbox small]
}
- set result
-} {{default:50 22 5 5} {top:50 0 5 5} {bottom:50 45 5 5} {center:50 22 5 5}}
-
-test textImage-4.2 {alignment checking - baseline} {
+ return $result
+} -cleanup {
+ destroy .t
+ image delete small large
+} -result {{default:50 22 5 5} {top:50 0 5 5} {bottom:50 45 5 5} {center:50 22 5 5}}
+
+test textImage-4.2 {alignment checking - baseline} -setup {
+ destroy .t
+ set result ""
+} -body {
catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- image create photo large -width 50 -height 50
- large put green -to 0 0 50 50
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ image create photo large -width 50 -height 50
+ large put green -to 0 0 50 50
}
- catch {destroy .t}
font create test_font2 -size 5
text .t -font test_font2 -bd 0 -highlightthickness 0 -padx 0 -pady 0
pack .t
.t image create end -image large
.t image create end -image small -align baseline
.t insert end test
- set result ""
# Sizes larger than 25 can be too big and lead to a negative 'norm',
# at least on Windows XP with certain settings.
foreach size {10 15 20 25} {
- font configure test_font2 -size $size
- array set Metrics [font metrics test_font2]
- update
- foreach {x y w h} [.t bbox small] {}
- set norm [expr {
- (([image height large] - $Metrics(-linespace))/2
- + $Metrics(-ascent) - [image height small] - $y)
- }]
- lappend result "$size $norm"
+ font configure test_font2 -size $size
+ array set Metrics [font metrics test_font2]
+ update
+ foreach {x y w h} [.t bbox small] {}
+ set norm [expr {
+ (([image height large] - $Metrics(-linespace))/2
+ + $Metrics(-ascent) - [image height small] - $y)
+ }]
+ lappend result "$size $norm"
}
+ return $result
+} -cleanup {
+ destroy .t
+ image delete small large
font delete test_font2
unset Metrics
- set result
-} {{10 0} {15 0} {20 0} {25 0}}
+} -result {{10 0} {15 0} {20 0} {25 0}}
-test textImage-4.3 {alignment and padding checking} {fonts} {
+test textImage-4.3 {alignment and padding checking} -constraints {
+ fonts
+} -setup {
+ destroy .t
+ set result ""
+} -body {
catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- image create photo large -width 50 -height 50
- large put green -to 0 0 50 50
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ image create photo large -width 50 -height 50
+ large put green -to 0 0 50 50
}
- catch {destroy .t}
text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
pack .t
.t image create end -image large
.t image create end -image small -padx 5 -pady 10
.t insert end test
update
- set result ""
lappend result default:[.t bbox small]
foreach i {top bottom center baseline} {
- .t image configure small -align $i
- update
- lappend result $i:[.t bbox small]
+ .t image configure small -align $i
+ update
+ lappend result $i:[.t bbox small]
}
- set result
-} {{default:55 22 5 5} {top:55 10 5 5} {bottom:55 35 5 5} {center:55 22 5 5} {baseline:55 22 5 5}}
+ return $result
+} -cleanup {
+ destroy .t
+ image delete small large
+} -result {{default:55 22 5 5} {top:55 10 5 5} {bottom:55 35 5 5} {center:55 22 5 5} {baseline:55 22 5 5}}
+
-test textImage-5.0 {peer widget images} {
+test textImage-5.1 {peer widget images} -setup {
+ destroy .t .tt
+} -body {
catch {
- image create photo small -width 5 -height 5
- small put red -to 0 0 4 4
- image create photo large -width 50 -height 50
- large put green -to 0 0 50 50
+ image create photo small -width 5 -height 5
+ small put red -to 0 0 4 4
+ image create photo large -width 50 -height 50
+ large put green -to 0 0 50 50
}
- catch {destroy .t .tt}
pack [text .t]
toplevel .tt
pack [.t peer create .tt.t]
@@ -358,13 +454,19 @@ test textImage-5.0 {peer widget images} {
.t insert end test
update
destroy .t .tt
-} {}
+} -cleanup {
+ image delete small large
+} -result {}
# cleanup
-catch {destroy .t}
-foreach image [image names] {image delete $image}
+destroy .t
font delete test_font
+imageFinish
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/textIndex.test b/tests/textIndex.test
index 6341b6d..a6752cb 100644
--- a/tests/textIndex.test
+++ b/tests/textIndex.test
@@ -782,7 +782,7 @@ test textIndex-19.12 {Display lines} {
} {2.20}
test textIndex-19.13 {Display lines} {
- destroy .t
+ destroy {*}[pack slaves .]
text .txt -height 1 -wrap word -yscroll ".sbar set" -width 400
scrollbar .sbar -command ".txt yview"
grid .txt .sbar -sticky news
diff --git a/tests/textMark.test b/tests/textMark.test
index c2810cc..c83b4c8 100644
--- a/tests/textMark.test
+++ b/tests/textMark.test
@@ -6,29 +6,19 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
-catch {destroy .t}
+destroy .t
text .t -width 20 -height 10
-testConstraint haveCourier12 [expr {[catch {
- .t configure -font {Courier 12}
-}] == 0}]
pack append . .t {top expand fill}
update
.t debug on
wm geometry . {}
-
-# The statements below reset the main window; it's needed if the window
-# manager is mwm to make mwm forget about a previous minimum size setting.
-
-wm withdraw .
-wm minsize . 1 1
-wm positionfrom . user
-wm deiconify .
-
entry .t.e
+
.t insert 1.0 "Line 1
abcdefghijklm
12345
@@ -36,187 +26,226 @@ Line 4
bOy GIrl .#@? x_yz
!@#$%
Line 7"
+
+# The statements below reset the main window; it's needed if the window
+# manager is mwm to make mwm forget about a previous minimum size setting.
-test textMark-1.1 {TkTextMarkCmd - missing option} haveCourier12 {
- list [catch {.t mark} msg] $msg
-} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
-test textMark-1.2 {TkTextMarkCmd - bogus option} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t mark gravity foo} msg] $msg
-} {1 {there is no mark named "foo"}}
-test textMark-1.4 {TkTextMarkCmd - "gravity" option} haveCourier12 {
- .t mark unset x
+wm withdraw .
+wm minsize . 1 1
+wm positionfrom . user
+wm deiconify .
+
+test textMark-1.1 {TkTextMarkCmd - missing option} -returnCodes error -body {
+ .t mark
+} -result {wrong # args: should be ".t mark option ?arg ...?"}
+test textMark-1.2 {TkTextMarkCmd - bogus option} -returnCodes error -body {
+ .t mark gorp
+} -match glob -result {bad mark option "gorp": must be *}
+test textMark-1.3 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
+ .t mark gravity foo
+} -result {there is no mark named "foo"}
+test textMark-1.4 {TkTextMarkCmd - "gravity" option} -body {
.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} haveCourier12 {
- .t mark unset x
+} -result {right 1.4}
+test textMark-1.5 {TkTextMarkCmd - "gravity" option} -body {
.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} haveCourier12 {
- .t mark unset x
+} -result {left 1.3}
+test textMark-1.6 {TkTextMarkCmd - "gravity" option} -body {
.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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t mark gravity} msg] $msg
-} {1 {wrong # args: should be ".t mark gravity markName ?gravity?"}}
+} -result {right 1.4}
+test textMark-1.7 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
+ .t mark set x 1.3
+ .t mark gravity x gorp
+} -result {bad mark gravity "gorp": must be left or right}
+test textMark-1.8 {TkTextMarkCmd - "gravity" option} -returnCodes error -body {
+ .t mark gravity
+} -result {wrong # args: should be ".t mark gravity markName ?gravity?"}
-test textMark-2.1 {TkTextMarkCmd - "names" option} haveCourier12 {
- 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} haveCourier12 {
+test textMark-2.1 {TkTextMarkCmd - "names" option} -body {
+ .t mark names 2
+} -returnCodes error -result {wrong # args: should be ".t mark names"}
+test textMark-2.2 {TkTextMarkCmd - "names" option} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
lsort [.t mark na]
-} {current insert}
-test textMark-2.3 {TkTextMarkCmd - "names" option} haveCourier12 {
+} -result {current insert}
+test textMark-2.3 {TkTextMarkCmd - "names" option} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set a 1.1
.t mark set "b c" 2.3
lsort [.t mark names]
-} {a {b c} current insert}
+} -result {a {b c} current insert}
-test textMark-3.1 {TkTextMarkCmd - "set" option} haveCourier12 {
- 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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t mark set a @x} msg] $msg
-} {1 {bad text index "@x"}}
-test textMark-3.4 {TkTextMarkCmd - "set" option} haveCourier12 {
+test textMark-3.1 {TkTextMarkCmd - "set" option} -returnCodes error -body {
+ .t mark set a
+} -result {wrong # args: should be ".t mark set markName index"}
+test textMark-3.2 {TkTextMarkCmd - "set" option} -returnCodes error -body {
+ .t mark s a b c
+} -result {wrong # args: should be ".t mark set markName index"}
+test textMark-3.3 {TkTextMarkCmd - "set" option} -body {
+ .t mark set a @x
+} -returnCodes error -result {bad text index "@x"}
+test textMark-3.4 {TkTextMarkCmd - "set" option} -body {
.t mark set a 1.2
.t index a
-} 1.2
-test textMark-3.5 {TkTextMarkCmd - "set" option} haveCourier12 {
+} -result 1.2
+test textMark-3.5 {TkTextMarkCmd - "set" option} -body {
.t mark set a end
.t index a
-} {8.0}
+} -result {8.0}
-test textMark-4.1 {TkTextMarkCmd - "unset" option} haveCourier12 {
- list [catch {.t mark unset} msg] $msg
-} {0 {}}
-test textMark-4.2 {TkTextMarkCmd - "unset" option} haveCourier12 {
+test textMark-4.1 {TkTextMarkCmd - "unset" option} -body {
+ .t mark unset
+} -result {}
+test textMark-4.2 {TkTextMarkCmd - "unset" option} -body {
.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} haveCourier12 {
+ .t index a
+} -returnCodes error -result {bad text index "a"}
+test textMark-4.2.1 {TkTextMarkCmd - "unset" option} -body {
+ .t mark set a 1.2
+ .t mark set b 2.3
+ .t mark unset a b
+ .t index b
+} -returnCodes error -result {bad text index "b"}
+test textMark-4.3 {TkTextMarkCmd - "unset" option} -body {
.t mark set a 1.2
.t mark set b 2.3
.t mark set 49ers 3.1
- eval .t mark unset [.t mark names]
+ .t mark unset {*}[.t mark names]
lsort [.t mark names]
-} {current insert}
+} -result {current insert}
-test textMark-5.1 {TkTextMarkCmd - miscellaneous} haveCourier12 {
- list [catch {.t mark} msg] $msg
-} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
-test textMark-5.2 {TkTextMarkCmd - miscellaneous} haveCourier12 {
- list [catch {.t mark foo} msg] $msg
-} {1 {bad mark option "foo": must be gravity, names, next, previous, set, or unset}}
+test textMark-5.1 {TkTextMarkCmd - miscellaneous} -returnCodes error -body {
+ .t mark
+} -result {wrong # args: should be ".t mark option ?arg ...?"}
+test textMark-5.2 {TkTextMarkCmd - miscellaneous} -returnCodes error -body {
+ .t mark foo
+} -result {bad mark option "foo": must be gravity, names, next, previous, set, or unset}
-test textMark-6.1 {TkTextMarkSegToIndex} haveCourier12 {
+test textMark-6.1 {TkTextMarkSegToIndex} -body {
.t mark set a 1.2
.t mark set b 1.2
.t mark set c 1.2
.t mark set d 1.4
list [.t index a] [.t index b] [.t index c ] [.t index d]
-} {1.2 1.2 1.2 1.4}
+} -result {1.2 1.2 1.2 1.4}
-catch {eval {.t mark unset} [.t mark names]}
-test textMark-7.1 {MarkFindNext - invalid mark name} haveCourier12 {
- catch {.t mark next bogus} x
- set x
-} {bad text index "bogus"}
-test textMark-7.2 {MarkFindNext - marks at same location} haveCourier12 {
+test textMark-7.1 {MarkFindNext - invalid mark name} -body {
+ .t mark next bogus
+} -returnCodes error -result {bad text index "bogus"}
+test textMark-7.2 {MarkFindNext - marks at same location} -body {
.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} haveCourier12 {
+} -result {insert}
+test textMark-7.3 {MarkFindNext - numerical starting mark} -body {
.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} haveCourier12 {
+} -result {insert}
+test textMark-7.4 {MarkFindNext - mark on the same line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {insert}
+test textMark-7.5 {MarkFindNext - mark on the next line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {insert}
+test textMark-7.6 {MarkFindNext - mark far away} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {insert}
+test textMark-7.7 {MarkFindNext - mark on top of end} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current end
.t mark next end
-} {current}
-test textMark-7.8 {MarkFindNext - no next mark} haveCourier12 {
+} -result {current}
+test textMark-7.8 {MarkFindNext - no next mark} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.0
.t mark set insert 3.0
.t mark next insert
-} {}
-test textMark-8.1 {MarkFindPrev - invalid mark name} haveCourier12 {
- catch {.t mark prev bogus} x
- set x
-} {bad text index "bogus"}
-test textMark-8.2 {MarkFindPrev - marks at same location} haveCourier12 {
+} -result {}
+
+test textMark-8.1 {MarkFindPrev - invalid mark name} -body {
+ .t mark prev bogus
+} -returnCodes error -result {bad text index "bogus"}
+test textMark-8.2 {MarkFindPrev - marks at same location} -body {
.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} haveCourier12 {
+} -result {current}
+test textMark-8.3 {MarkFindPrev - numerical starting mark} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {current}
+test textMark-8.4 {MarkFindPrev - mark on the same line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {current}
+test textMark-8.5 {MarkFindPrev - mark on the previous line} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {current}
+test textMark-8.6 {MarkFindPrev - mark far away} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.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} haveCourier12 {
+} -result {current}
+test textMark-8.7 {MarkFindPrev - mark on top of end} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set insert 3.0
.t mark set current end
.t mark prev end
-} {insert}
-test textMark-8.8 {MarkFindPrev - no previous mark} haveCourier12 {
+} -result {insert}
+test textMark-8.8 {MarkFindPrev - no previous mark} -setup {
+ .t mark unset {*}[.t mark names]
+} -body {
.t mark set current 1.0
.t mark set insert 3.0
.t mark prev current
-} {}
-
-catch {destroy .t}
+} -result {}
+
+destroy .t
# cleanup
cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tests/textTag.test b/tests/textTag.test
index b112fc2..34ce003 100644
--- a/tests/textTag.test
+++ b/tests/textTag.test
@@ -6,19 +6,21 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-namespace import -force tcltest::test
-catch {destroy .t}
+destroy .t
text .t -width 20 -height 10
testConstraint haveCourier12 [expr {[catch {
.t configure -font {Courier 12}
}] == 0}]
+
pack append . .t {top expand fill}
update
.t debug on
+
wm geometry . {}
set bigFont {Helvetica 24}
@@ -30,9 +32,6 @@ wm minsize . 1 1
wm positionfrom . user
wm deiconify .
-entry .t.e
-.t.e insert 0 "Text"
-
.t insert 1.0 "Line 1
abcdefghijklm
12345
@@ -41,540 +40,1289 @@ bOy GIrl .#@? x_yz
!@#$%
Line 7"
+test textTag-1.1 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -background #012345
+ .t tag cget x -background
+} -cleanup {
+ .t tag configure x -background [lindex [.t tag configure x -background] 3]
+} -result {#012345}
+test textTag-1.2 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -background non-existent
+} -cleanup {
+ .t tag configure x -background [lindex [.t tag configure x -background] 3]
+} -returnCodes error -result {unknown color name "non-existent"}
+test textTag-1.3 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -bgstipple gray50
+ .t tag cget x -bgstipple
+} -cleanup {
+ .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3]
+} -result {gray50}
+test textTag-1.4 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -bgstipple badStipple
+} -cleanup {
+ .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3]
+} -returnCodes error -result {bitmap "badStipple" not defined}
+test textTag-1.5 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -borderwidth 2
+ .t tag cget x -borderwidth
+} -cleanup {
+ .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3]
+} -result {2}
+test textTag-1.6 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -borderwidth 46q
+} -cleanup {
+ .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3]
+} -returnCodes error -result {bad screen distance "46q"}
+test textTag-1.7 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -fgstipple gray25
+ .t tag cget x -fgstipple
+} -cleanup {
+ .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3]
+} -result {gray25}
+test textTag-1.8 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -fgstipple bogus
+} -cleanup {
+ .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3]
+} -returnCodes error -result {bitmap "bogus" not defined}
+test textTag-1.9 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -font fixed
+ .t tag cget x -font
+} -cleanup {
+ .t tag configure x -font [lindex [.t tag configure x -font] 3]
+} -result {fixed}
+test textTag-1.10 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -foreground #001122
+ .t tag cget x -foreground
+} -cleanup {
+ .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3]
+} -result {#001122}
+test textTag-1.11 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -foreground {silly color}
+} -cleanup {
+ .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3]
+} -returnCodes error -result {unknown color name "silly color"}
+test textTag-1.12 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -justify left
+ .t tag cget x -justify
+} -cleanup {
+ .t tag configure x -justify [lindex [.t tag configure x -justify] 3]
+} -result {left}
+test textTag-1.13 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -justify middle
+} -cleanup {
+ .t tag configure x -justify [lindex [.t tag configure x -justify] 3]
+} -returnCodes error -result {bad justification "middle": must be left, right, or center}
+test textTag-1.14 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -lmargin1 10
+ .t tag cget x -lmargin1
+} -cleanup {
+ .t tag configure x -lmargin1 [lindex [.t tag configure x -lmargin1] 3]
+} -result {10}
+test textTag-1.15 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -lmargin1 bad
+} -cleanup {
+ .t tag configure x -lmargin1 [lindex [.t tag configure x -lmargin1] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.16 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -lmargin2 10
+ .t tag cget x -lmargin2
+} -cleanup {
+ .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3]
+} -result {10}
+test textTag-1.17 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -lmargin2 bad
+} -cleanup {
+ .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.18 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -offset 2
+ .t tag cget x -offset
+} -cleanup {
+ .t tag configure x -offset [lindex [.t tag configure x -offset] 3]
+} -result {2}
+test textTag-1.19 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -offset 100xyz
+} -cleanup {
+ .t tag configure x -offset [lindex [.t tag configure x -offset] 3]
+} -returnCodes error -result {bad screen distance "100xyz"}
+test textTag-1.20 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -overstrike on
+ .t tag cget x -overstrike
+} -cleanup {
+ .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3]
+} -result {on}
+test textTag-1.21 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -overstrike stupid
+} -cleanup {
+ .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3]
+} -returnCodes error -result {expected boolean value but got "stupid"}
+test textTag-1.22 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -relief raised
+ .t tag cget x -relief
+} -cleanup {
+ .t tag configure x -relief [lindex [.t tag configure x -relief] 3]
+} -result {raised}
+test textTag-1.23 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -relief stupid
+} -cleanup {
+ .t tag configure x -relief [lindex [.t tag configure x -relief] 3]
+} -returnCodes error -result {bad relief "stupid": must be flat, groove, raised, ridge, solid, or sunken}
+test textTag-1.24 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -rmargin 10
+ .t tag cget x -rmargin
+} -cleanup {
+ .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3]
+} -result {10}
+test textTag-1.25 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -rmargin bad
+} -cleanup {
+ .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.26 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing1 10
+ .t tag cget x -spacing1
+} -cleanup {
+ .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
+} -result {10}
+test textTag-1.27 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing1 bad
+} -cleanup {
+ .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.28 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing2 10
+ .t tag cget x -spacing2
+} -cleanup {
+ .t tag configure x -spacing2 [lindex [.t tag configure x -spacing2] 3]
+} -result {10}
+test textTag-1.29 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing2 bad
+} -cleanup {
+ .t tag configure x -spacing2 [lindex [.t tag configure x -spacing2] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.30 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing3 10
+ .t tag cget x -spacing3
+} -cleanup {
+ .t tag configure x -spacing3 [lindex [.t tag configure x -spacing3] 3]
+} -result {10}
+test textTag-1.31 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -spacing3 bad
+} -cleanup {
+ .t tag configure x -spacing3 [lindex [.t tag configure x -spacing3] 3]
+} -returnCodes error -result {bad screen distance "bad"}
+test textTag-1.32 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -tabs {10 20 30}
+ .t tag cget x -tabs
+} -cleanup {
+ .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3]
+} -result {10 20 30}
+test textTag-1.33 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -tabs {10 fork}
+} -cleanup {
+ .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3]
+} -returnCodes error -result {bad tab alignment "fork": must be left, right, center, or numeric}
+test textTag-1.34 {tag configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -underline no
+ .t tag cget x -underline
+} -cleanup {
+ .t tag configure x -underline [lindex [.t tag configure x -underline] 3]
+} -result {no}
+test textTag-1.35 {configuration options} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -underline stupid
+} -cleanup {
+ .t tag configure x -underline [lindex [.t tag configure x -underline] 3]
+} -returnCodes error -result {expected boolean value but got "stupid"}
+
-set i 1
-foreach test {
- {-background #012345 #012345 non-existent
- {unknown color name "non-existent"}}
- {-bgstipple gray50 gray50 badStipple
- {bitmap "badStipple" not defined}}
- {-borderwidth 2 2 46q
- {bad screen distance "46q"}}
- {-fgstipple gray25 gray25 bogus
- {bitmap "bogus" not defined}}
- {-font fixed fixed {}
- {font "" doesn't exist}}
- {-foreground #001122 #001122 {silly color}
- {unknown color name "silly color"}}
- {-justify left left middle
- {bad justification "middle": must be left, right, or center}}
- {-lmargin1 10 10 bad
- {bad screen distance "bad"}}
- {-lmargin2 10 10 bad
- {bad screen distance "bad"}}
- {-offset 2 2 100xyz
- {bad screen distance "100xyz"}}
- {-overstrike on on stupid
- {expected boolean value but got "stupid"}}
- {-relief raised raised stupid
- {bad relief type "stupid": must be flat, groove, raised, ridge, solid, or sunken}}
- {-rmargin 10 10 bad
- {bad screen distance "bad"}}
- {-spacing1 10 10 bad
- {bad screen distance "bad"}}
- {-spacing2 10 10 bad
- {bad screen distance "bad"}}
- {-spacing3 10 10 bad
- {bad screen distance "bad"}}
- {-tabs {10 20 30} {10 20 30} {10 fork}
- {bad tab alignment "fork": must be left, right, center, or numeric}}
- {-underline no no stupid
- {expected boolean value but got "stupid"}}
-} {
- set name [lindex $test 0]
- test textTag-1.$i {tag configuration options} haveCourier12 {
- .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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t tag} msg] $msg
-} {1 {wrong # args: should be ".t tag option ?arg arg ...?"}}
-test textTag-2.2 {TkTextTagCmd - "add" option} haveCourier12 {
- list [catch {.t tag gorp} msg] $msg
-} {1 {bad tag option "gorp": must be add, bind, cget, configure, delete, lower, names, nextrange, prevrange, raise, ranges, or remove}}
-test textTag-2.3 {TkTextTagCmd - "add" option} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t tag add x gorp} msg] $msg
-} {1 {bad text index "gorp"}}
-test textTag-2.5 {TkTextTagCmd - "add" option} haveCourier12 {
- list [catch {.t tag add x 1.2 gorp} msg] $msg
-} {1 {bad text index "gorp"}}
-test textTag-2.6 {TkTextTagCmd - "add" option} haveCourier12 {
+test textTag-2.1 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag
+} -returnCodes error -result {wrong # args: should be ".t tag option ?arg ...?"}
+test textTag-2.2 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag gorp
+} -returnCodes error -result {bad tag option "gorp": must be add, bind, cget, configure, delete, lower, names, nextrange, prevrange, raise, ranges, or remove}
+test textTag-2.3 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag add foo
+} -returnCodes error -result {wrong # args: should be ".t tag add tagName index1 ?index2 index1 index2 ...?"}
+test textTag-2.4 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag add x gorp
+} -returnCodes error -result {bad text index "gorp"}
+test textTag-2.5 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag add x 1.2 gorp
+} -returnCodes error -result {bad text index "gorp"}
+test textTag-2.6 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete sel
+} -body {
.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} haveCourier12 {
+} -result {3.2 3.4}
+test textTag-2.7 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
.t tag add x 1.0 1.end
.t tag ranges x
-} {1.0 1.6}
-test textTag-2.8 {TkTextTagCmd - "add" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {1.0 1.6}
+test textTag-2.8 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -setup {
.t tag remove x 1.0 end
+} -body {
.t tag add x 1.2
.t tag ranges x
-} {1.2 1.3}
-test textTag-2.9 {TkTextTagCmd - "add" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {1.2 1.3}
+test textTag-2.9 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -setup {
+ destroy .t.e
+} -body {
+ entry .t.e
+ .t.e insert 0 "Text"
.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} haveCourier12 {
+} -cleanup {
+ destroy .t.e
+} -result 34
+test textTag-2.10 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -setup {
+ destroy .t.e
+} -body {
+ entry .t.e
+ .t.e insert 0 "Text"
.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} haveCourier12 {
+} -cleanup {
+ destroy .t.e
+} -result {Text}
+test textTag-2.11 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+} -result {1.1 1.5 2.4 3.1 4.2 4.4}
+test textTag-2.12 {TkTextTagCmd - "add" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
- 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} haveCourier12 {
- 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} haveCourier12 {
+} -cleanup {
+ .t tag remove sel 1.0 end
+} -result {1.1 1.5 2.4 2.5}
+
+
+test textTag-3.1 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag bind
+} -returnCodes error -result {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"}
+test textTag-3.2 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag bind 1 2 3 4
+} -returnCodes error -result {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"}
+test textTag-3.3 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
.t tag bind x <Enter> script1
.t tag bind x <Enter>
-} script1
-test textTag-3.4 {TkTextTagCmd - "bind" option} haveCourier12 {
- list [catch {.t tag bind x <Gorp> script2} msg] $msg
-} {1 {bad event type or keysym "Gorp"}}
-test textTag-3.5 {TkTextTagCmd - "bind" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {script1}
+test textTag-3.4 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag bind x <Gorp> script2
+} -returnCodes error -result {bad event type or keysym "Gorp"}
+test textTag-3.5 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ .t tag bind x <FocusIn> script2
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {requested illegal events; only key, button, motion, enter, leave, and virtual events may be used}
+test textTag-3.6 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag bind x <Enter> script1
+ catch {.t tag bind x <FocusIn> script2}
+ .t tag bind x
+} -cleanup {
+ .t tag delete x
+} -result {<Enter>}
+test textTag-3.7 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {{<Enter> <Leave> a} script1 xyzzy}
+test textTag-3.8 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag bind x <Enter> script1
.t tag bind x <Enter> +script2
.t tag bind x <Enter>
-} {script1
+} -cleanup {
+ .t tag delete x
+} -result {script1
script2}
-test textTag-3.7a {TkTextTagCmd - "bind" option} haveCourier12 {
- .t tag delete x
- list [catch {.t tag bind x <Enter>} msg] $msg
-} {0 {}}
-test textTag-3.8 {TkTextTagCmd - "bind" option} haveCourier12 {
- .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} haveCourier12 {
- 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} haveCourier12 {
- 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} haveCourier12 {
+test textTag-3.9 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag bind x <Enter>
+} -cleanup {
+ .t tag delete x
+} -returnCodes ok -result {}
+test textTag-3.10 {TkTextTagCmd - "bind" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag bind x <
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {no event type or button # or keysym}
+
+
+test textTag-4.1 {TkTextTagCmd - "cget" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag cget a
+} -returnCodes error -result {wrong # args: should be ".t tag cget tagName option"}
+test textTag-4.2 {TkTextTagCmd - "cget" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag cget a b c
+} -returnCodes error -result {wrong # args: should be ".t tag cget tagName option"}
+test textTag-4.3 {TkTextTagCmd - "cget" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
- list [catch {.t tag cget sel bogus} msg] $msg
-} {1 {unknown option "bogus"}}
-test textTag-4.5 {TkTextTagCmd - "cget" option} haveCourier12 {
+ .t tag cget foo bar
+} -returnCodes error -result {tag "foo" isn't defined in text widget}
+test textTag-4.4 {TkTextTagCmd - "cget" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag cget sel bogus
+} -returnCodes error -result {unknown option "bogus"}
+test textTag-4.5 {TkTextTagCmd - "cget" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t tag configure x -foo} msg] $msg
-} {1 {unknown option "-foo"}}
-test textTag-5.3 {TkTextTagCmd - "configure" option} haveCourier12 {
- list [catch {.t tag configure x -background red -underline} msg] $msg
-} {1 {value for "-underline" missing}}
-test textTag-5.4 {TkTextTagCmd - "configure" option} haveCourier12 {
+ .t tag cget x -background
+} -cleanup {
+ .t tag delete x
+} -result {red}
+
+
+test textTag-5.1 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure
+} -returnCodes error -result {wrong # args: should be ".t tag configure tagName ?-option? ?value? ?-option value ...?"}
+test textTag-5.2 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -foo
+} -returnCodes error -result {unknown option "-foo"}
+test textTag-5.3 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -background red -underline
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {value for "-underline" missing}
+test textTag-5.4 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag configure x -underline yes
.t tag configure x -underline
-} {-underline {} {} {} yes}
-test textTag-5.5 {TkTextTagCmd - "configure" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {-underline {} {} {} yes}
+test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag configure x -overstrike on
.t tag cget x -overstrike
-} {on}
-test textTag-5.6 {TkTextTagCmd - "configure" option} haveCourier12 {
- list [catch {.t tag configure x -overstrike foo} msg] $msg
-} {1 {expected boolean value but got "foo"}}
-test textTag-5.7 {TkTextTagCmd - "configure" option} haveCourier12 {
+} -cleanup {
.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} haveCourier12 {
+} -result {on}
+test textTag-5.6 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag configure x -overstrike foo
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {expected boolean value but got "foo"}
+test textTag-5.7 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -underline stupid
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {expected boolean value but got "stupid"}
+test textTag-5.8 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag configure x -justify left
.t tag configure x -justify
-} {-justify {} {} {} left}
-test textTag-5.9 {TkTextTagCmd - "configure" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {-justify {} {} {} left}
+test textTag-5.9 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -justify bogus
+} -cleanup {
.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} haveCourier12 {
+} -returnCodes error -result {bad justification "bogus": must be left, right, or center}
+test textTag-5.10 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ .t tag configure x -justify fill
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad justification "fill": must be left, right, or center}
+test textTag-5.11 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag configure x -offset 2
.t tag configure x -offset
-} {-offset {} {} {} 2}
-test textTag-5.12 {TkTextTagCmd - "configure" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {-offset {} {} {} 2}
+test textTag-5.12 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -offset 1.0q
+} -cleanup {
.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} haveCourier12 {
+} -returnCodes error -result {bad screen distance "1.0q"}
+test textTag-5.13 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ [.t tag configure x -rmargin]
+} -cleanup {
+ .t tag delete x
+} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5}}
+test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -lmargin1 2.0x
+} -cleanup {
.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} haveCourier12 {
+} -returnCodes error -result {bad screen distance "2.0x"}
+test textTag-5.15 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ .t tag configure x -lmargin2 gorp
+} -cleanup {
.t tag delete x
- list [catch {.t tag configure x -rmargin 140.1.1} msg] $msg
-} {1 {bad screen distance "140.1.1"}}
+} -returnCodes error -result {bad screen distance "gorp"}
+test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -rmargin 140.1.1
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad screen distance "140.1.1"}
.t tag delete x
-test textTag-5.17 {TkTextTagCmd - "configure" option} haveCourier12 {
+test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ [.t tag configure x -spacing3]
+} -cleanup {
+ .t tag delete x
+} -result {{-spacing1 {} {} {} 2} {-spacing2 {} {} {} 4} {-spacing3 {} {} {} 6}}
+test textTag-5.18 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete x
+ .t tag configure x -spacing1 2.0x
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad screen distance "2.0x"}
+test textTag-5.19 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ .t tag configure x -spacing1 lousy
+} -cleanup {
.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} haveCourier12 {
+} -returnCodes error -result {bad screen distance "lousy"}
+test textTag-5.20 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.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} haveCourier12 {
+ .t tag configure x -spacing1 4.2.3
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad screen distance "4.2.3"}
+test textTag-5.21 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t configure -selectborderwidth 2 -selectforeground blue \
- -selectbackground black
+ -selectbackground black
.t tag configure sel -borderwidth 4 -foreground green -background yellow
set x {}
foreach i {-selectborderwidth -selectforeground -selectbackground} {
- lappend x [lindex [.t configure $i] 4]
+ lappend x [lindex [.t configure $i] 4]
}
- set x
-} {4 green yellow}
-test textTag-5.22 {TkTextTagCmd - "configure" option} haveCourier12 {
+ return $x
+} -result {4 green yellow}
+test textTag-5.22 {TkTextTagCmd - "configure" option} -constraints {
+ haveCourier12
+} -body {
.t configure -selectborderwidth 20
.t tag configure sel -borderwidth {}
.t cget -selectborderwidth
-} {}
+} -result {}
-test textTag-6.1 {TkTextTagCmd - "delete" option} haveCourier12 {
- list [catch {.t tag delete} msg] $msg
-} {1 {wrong # args: should be ".t tag delete tagName ?tagName ...?"}}
-test textTag-6.2 {TkTextTagCmd - "delete" option} haveCourier12 {
- list [catch {.t tag delete zork} msg] $msg
-} {0 {}}
-test textTag-6.3 {TkTextTagCmd - "delete" option} haveCourier12 {
- .t tag delete x
+
+test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete
+} -returnCodes error -result {wrong # args: should be ".t tag delete tagName ?tagName ...?"}
+test textTag-6.2 {TkTextTagCmd - "delete" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag delete zork
+} -returnCodes ok -result {}
+test textTag-6.3 {TkTextTagCmd - "delete" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+} -body {
.t tag config x -background black
.t tag config y -foreground white
.t tag config z -background black
.t tag delete y z
lsort [.t tag names]
-} {sel x}
-test textTag-6.4 {TkTextTagCmd - "delete" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {sel x}
+test textTag-6.4 {TkTextTagCmd - "delete" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+} -body {
.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} haveCourier12 {
+} -result {sel}
+test textTag-6.5 {TkTextTagCmd - "delete" option} -constraints {
+ haveCourier12
+} -body {
.t tag bind x <Enter> foo
.t tag delete x
.t tag configure x -background black
.t tag bind x
-} {}
+} -cleanup {
+ .t tag delete x
+} -result {}
-proc tagsetup {} {
- .t tag delete x y z a b c d
+
+test textTag-7.1 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag lower
+} -returnCodes error -result {wrong # args: should be ".t tag lower tagName ?belowThis?"}
+test textTag-7.2 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag lower foo
+} -returnCodes error -result {tag "foo" isn't defined in text widget}
+test textTag-7.3 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag lower sel bar
+} -returnCodes error -result {tag "bar" isn't defined in text widget}
+test textTag-7.4 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
.t tag remove sel 1.0 end
foreach i {a b c d} {
- .t tag configure $i -background black
+ .t tag configure $i -background black
}
-}
-test textTag-7.1 {TkTextTagCmd - "lower" option} haveCourier12 {
- list [catch {.t tag lower} msg] $msg
-} {1 {wrong # args: should be ".t tag lower tagName ?belowThis?"}}
-test textTag-7.2 {TkTextTagCmd - "lower" option} haveCourier12 {
- list [catch {.t tag lower foo} msg] $msg
-} {1 {tag "foo" isn't defined in text widget}}
-test textTag-7.3 {TkTextTagCmd - "lower" option} haveCourier12 {
- 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} haveCourier12 {
- tagsetup
+} -body {
.t tag lower c
.t tag names
-} {c sel a b d}
-test textTag-7.5 {TkTextTagCmd - "lower" option} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {c sel a b d}
+test textTag-7.5 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag lower d b
.t tag names
-} {sel a d b c}
-test textTag-7.6 {TkTextTagCmd - "lower" option} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel a d b c}
+test textTag-7.6 {TkTextTagCmd - "lower" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag lower a c
.t tag names
-} {sel b a c d}
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel b a c d}
+
-test textTag-8.1 {TkTextTagCmd - "names" option} haveCourier12 {
- 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} haveCourier12 {
- tagsetup
+test textTag-8.1 {TkTextTagCmd - "names" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag names a b
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -returnCodes error -result {wrong # args: should be ".t tag names ?index?"}
+test textTag-8.2 {TkTextTagCmd - "names" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag names
-} {sel a b c d}
-test textTag-8.3 {TkTextTagCmd - "names" option} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel a b c d}
+test textTag-8.3 {TkTextTagCmd - "names" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag add "a b" 2.1 2.6
.t tag add c 2.4 2.7
.t tag names 2.5
-} {c {a b}}
-
-.t tag delete x y z a b c d {a b}
-.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} haveCourier12 {
- 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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t tag nextrange foo 1.0} msg] $msg
-} {0 {}}
-test textTag-9.4 {TkTextTagCmd - "nextrange" option} haveCourier12 {
- list [catch {.t tag nextrange x foo} msg] $msg
-} {1 {bad text index "foo"}}
-test textTag-9.5 {TkTextTagCmd - "nextrange" option} haveCourier12 {
- list [catch {.t tag nextrange x 1.0 bar} msg] $msg
-} {1 {bad text index "bar"}}
-test textTag-9.6 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {c {a b}}
+
+
+test textTag-9.1 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag nextrange x
+} -returnCodes error -result {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"}
+test textTag-9.2 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag nextrange x 1 2 3
+} -returnCodes error -result {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"}
+test textTag-9.3 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag nextrange foo 1.0
+} -returnCodes ok -result {}
+test textTag-9.4 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag nextrange x foo
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad text index "foo"}
+test textTag-9.5 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
+ .t tag nextrange x 1.0 bar
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad text index "bar"}
+test textTag-9.6 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 1.0
-} {2.3 2.5}
-test textTag-9.7 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-9.7 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.2
-} {2.3 2.5}
-test textTag-9.8 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-9.8 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.3
-} {2.3 2.5}
-test textTag-9.9 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-9.9 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.4
-} {2.9 3.1}
-test textTag-9.10 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.9 3.1}
+test textTag-9.10 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.4 2.9
-} {}
-test textTag-9.11 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {}
+test textTag-9.11 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.4 2.10
-} {2.9 3.1}
-test textTag-9.12 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.9 3.1}
+test textTag-9.12 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 2.4 2.11
-} {2.9 3.1}
-test textTag-9.13 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.9 3.1}
+test textTag-9.13 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 7.0
-} {7.2 7.3}
-test textTag-9.14 {TkTextTagCmd - "nextrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {7.2 7.3}
+test textTag-9.14 {TkTextTagCmd - "nextrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag nextrange x 7.3
-} {}
-
-test textTag-10.1 {TkTextTagCmd - "prevrange" option} haveCourier12 {
- 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} haveCourier12 {
- 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} haveCourier12 {
- list [catch {.t tag prevrange foo end} msg] $msg
-} {0 {}}
-test textTag-10.4 {TkTextTagCmd - "prevrange" option} haveCourier12 {
- list [catch {.t tag prevrange x foo} msg] $msg
-} {1 {bad text index "foo"}}
-test textTag-10.5 {TkTextTagCmd - "prevrange" option} haveCourier12 {
- list [catch {.t tag prevrange x end bar} msg] $msg
-} {1 {bad text index "bar"}}
-test textTag-10.6 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {}
+
+
+test textTag-10.1 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag prevrange x
+} -returnCodes error -result {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"}
+test textTag-10.2 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag prevrange x 1 2 3
+} -returnCodes error -result {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"}
+test textTag-10.3 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag prevrange foo end
+} -cleanup {
+ .t tag delete x
+} -returnCodes ok -result {}
+test textTag-10.4 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
+ .t tag prevrange x foo
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad text index "foo"}
+test textTag-10.5 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
+ .t tag prevrange x end bar
+} -cleanup {
+ .t tag delete x
+} -returnCodes error -result {bad text index "bar"}
+test textTag-10.6 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x end
-} {7.2 7.3}
-test textTag-10.7 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {7.2 7.3}
+test textTag-10.7 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.4
-} {2.3 2.5}
-test textTag-10.8 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-10.8 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.5
-} {2.3 2.5}
-test textTag-10.9 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-10.9 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.9
-} {2.3 2.5}
-test textTag-10.10 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-10.10 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.9 2.6
-} {}
-test textTag-10.11 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {}
+test textTag-10.11 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.9 2.5
-} {}
-test textTag-10.12 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {}
+test textTag-10.12 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.9 2.3
-} {2.3 2.5}
-test textTag-10.13 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.3 2.5}
+test textTag-10.13 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 7.0
-} {2.9 3.1}
-test textTag-10.14 {TkTextTagCmd - "prevrange" option} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.9 3.1}
+test textTag-10.14 {TkTextTagCmd - "prevrange" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete x
+} -body {
+ .t tag add x 2.3 2.5
+ .t tag add x 2.9 3.1
+ .t tag add x 7.2
.t tag prevrange x 2.3
-} {}
-
-test textTag-11.1 {TkTextTagCmd - "raise" option} haveCourier12 {
- list [catch {.t tag raise} msg] $msg
-} {1 {wrong # args: should be ".t tag raise tagName ?aboveThis?"}}
-test textTag-11.2 {TkTextTagCmd - "raise" option} haveCourier12 {
- list [catch {.t tag raise foo} msg] $msg
-} {1 {tag "foo" isn't defined in text widget}}
-test textTag-11.3 {TkTextTagCmd - "raise" option} haveCourier12 {
- 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} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete x
+} -result {}
+
+
+test textTag-11.1 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag raise
+} -returnCodes error -result {wrong # args: should be ".t tag raise tagName ?aboveThis?"}
+test textTag-11.2 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag raise foo
+} -returnCodes error -result {tag "foo" isn't defined in text widget}
+test textTag-11.3 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag raise sel bar
+} -returnCodes error -result {tag "bar" isn't defined in text widget}
+test textTag-11.4 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag raise c
.t tag names
-} {sel a b d c}
-test textTag-11.5 {TkTextTagCmd - "raise" option} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel a b d c}
+test textTag-11.5 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag raise d b
.t tag names
-} {sel a b d c}
-test textTag-11.6 {TkTextTagCmd - "raise" option} haveCourier12 {
- tagsetup
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel a b d c}
+test textTag-11.6 {TkTextTagCmd - "raise" option} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ .t tag remove sel 1.0 end
+ foreach i {a b c d} {
+ .t tag configure $i -background black
+ }
+} -body {
.t tag raise a c
.t tag names
-} {sel b c a d}
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {sel b c a d}
-test textTag-12.1 {TkTextTagCmd - "ranges" option} haveCourier12 {
- list [catch {.t tag ranges} msg] $msg
-} {1 {wrong # args: should be ".t tag ranges tagName"}}
-test textTag-12.2 {TkTextTagCmd - "ranges" option} haveCourier12 {
+
+test textTag-12.1 {TkTextTagCmd - "ranges" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag ranges
+} -returnCodes error -result {wrong # args: should be ".t tag ranges tagName"}
+test textTag-12.2 {TkTextTagCmd - "ranges" option} -constraints {
+ haveCourier12
+} -body {
.t tag delete x
.t tag ranges x
-} {}
-test textTag-12.3 {TkTextTagCmd - "ranges" option} haveCourier12 {
+} -result {}
+test textTag-12.3 {TkTextTagCmd - "ranges" option} -constraints {
+ haveCourier12
+} -setup {
.t tag delete x
+} -body {
.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} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.2 2.3 2.7 4.6 5.2 5.5}
+test textTag-12.4 {TkTextTagCmd - "ranges" option} -constraints {
+ haveCourier12
+} -setup {
.t tag delete x
+} -body {
.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}
+} -cleanup {
+ .t tag delete x
+} -result {1.0 3.0 4.0 8.0}
-test textTag-13.1 {TkTextTagCmd - "remove" option} haveCourier12 {
- 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} haveCourier12 {
+
+test textTag-13.1 {TkTextTagCmd - "remove" option} -constraints {
+ haveCourier12
+} -body {
+ .t tag remove
+} -returnCodes error -result {wrong # args: should be ".t tag remove tagName index1 ?index2 index1 index2 ...?"}
+test textTag-13.2 {TkTextTagCmd - "remove" option} -constraints {
+ haveCourier12
+} -setup {
.t tag delete x
+} -body {
.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} haveCourier12 {
+} -cleanup {
+ .t tag delete x
+} -result {2.2 2.3 2.7 2.11}
+test textTag-13.3 {TkTextTagCmd - "remove" option} -constraints {
+ haveCourier12
+} -setup {
+ destroy .t.e
+} -body {
+ entry .t.e
+ .t.e insert 0 "Text"
.t configure -exportselection 1
.t tag remove sel 1.0 end
.t tag add sel 2.4 3.3
.t.e select to 4
.t tag remove sel 2.7 3.1
selection get
-} Text
+} -cleanup {
+ destroy .t.e
+} -result {Text}
-.t tag delete x a b c d
-test textTag-14.1 {SortTags} haveCourier12 {
+
+test textTag-14.1 {SortTags} -constraints haveCourier12 -setup {
+ .t tag delete a b c d
+} -body {
foreach i {a b c d} {
- .t tag add $i 2.0 2.2
+ .t tag add $i 2.0 2.2
}
.t tag names 2.1
-} {a b c d}
+} -cleanup {
+ .t tag delete a b c d
+} -result {a b c d}
.t tag delete a b c d
-test textTag-14.2 {SortTags} haveCourier12 {
+test textTag-14.2 {SortTags} -constraints haveCourier12 -setup {
+ .t tag delete a b c d
+} -body {
foreach i {a b c d} {
- .t tag configure $i -background black
+ .t tag configure $i -background black
}
foreach i {d c b a} {
- .t tag add $i 2.0 2.2
+ .t tag add $i 2.0 2.2
}
.t tag names 2.1
-} {a b c d}
-.t tag delete x a b c d
-test textTag-14.3 {SortTags} haveCourier12 {
+} -cleanup {
+ .t tag delete a b c d
+} -result {a b c d}
+test textTag-14.3 {SortTags} -constraints haveCourier12 -setup {
+ .t tag delete {*}[.t tag names]
+} -body {
for {set i 0} {$i < 30} {incr i} {
- .t tag add x$i 2.0 2.2
+ .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} haveCourier12 {
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {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} -constraints haveCourier12 -setup {
+ .t tag delete {*}[.t tag names]
+} -body {
for {set i 0} {$i < 30} {incr i} {
- .t tag configure x$i -background black
+ .t tag configure x$i -background black
}
for {set i 29} {$i >= 0} {incr i -1} {
- .t tag add x$i 2.0 2.2
+ .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}
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {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}
+
+
-foreach tag [.t tag names] {
- catch {.t tag delete $tag}
-}
set c [.t bbox 2.1]
set x1 [expr [lindex $c 0] + [lindex $c 2]/2]
set y1 [expr [lindex $c 1] + [lindex $c 3]/2]
@@ -585,7 +1333,10 @@ 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} haveCourier12 {
+test textTag-15.1 {TkTextBindProc} -constraints haveCourier12 -setup {
+ .t tag delete x y
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
.t tag bind y <ButtonRelease> {lappend x y-up}
@@ -601,12 +1352,16 @@ test textTag-15.1 {TkTextBindProc} haveCourier12 {
event gen .t <Button> -x $x2 -y $y2
event gen .t <Motion> -x $x3 -y $y3
event gen .t <ButtonRelease> -x $x3 -y $y3
+ return $x
+} -cleanup {
+ .t tag delete x y
bind .t <ButtonRelease> {}
- set x
-} {x-up up up y-up up}
-test textTag-15.2 {TkTextBindProc} haveCourier12 {
- catch {.t tag delete x}
- catch {.t tag delete y}
+} -result {x-up up up y-up up}
+
+test textTag-15.2 {TkTextBindProc} -constraints haveCourier12 -setup {
+ .t tag delete x y
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
.t tag bind x <Enter> {lappend x x-enter}
.t tag bind x <ButtonPress> {lappend x x-down}
.t tag bind x <ButtonRelease> {lappend x x-up}
@@ -626,11 +1381,15 @@ test textTag-15.2 {TkTextBindProc} haveCourier12 {
event gen .t <Motion> -x $x3 -y $y3 -state 0x100
lappend x |
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} haveCourier12 {
- catch {.t tag delete x}
- catch {.t tag delete y}
+ return $x
+} -cleanup {
+ .t tag delete x y
+} -result {x-enter | x-down | | x-up x-leave y-enter}
+
+test textTag-15.3 {TkTextBindProc} -constraints haveCourier12 -setup {
+ .t tag delete x y
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
.t tag bind x <Enter> {lappend x x-enter}
.t tag bind x <Any-ButtonPress-1> {lappend x x-down}
.t tag bind x <Any-ButtonRelease-1> {lappend x x-up}
@@ -654,14 +1413,18 @@ test textTag-15.3 {TkTextBindProc} haveCourier12 {
event gen .t <ButtonRelease-1> -x $x3 -y $y3 -state 0x300
lappend x |
event gen .t <ButtonRelease-2> -x $x3 -y $y3 -state 0x200
- set x
-} {x-enter | x-down | | | x-up | x-leave y-enter}
-
-foreach tag [.t tag names] {
- catch {.t tag delete $tag}
-}
-.t tag configure big -font $bigFont
-test textTag-16.1 {TkTextPickCurrent procedure} haveCourier12 {
+ return $x
+} -cleanup {
+ .t tag delete x y
+} -result {x-enter | x-down | | | x-up | x-leave y-enter}
+
+
+test textTag-16.1 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
set x [.t index current]
event gen .t <Motion> -x $x2 -y $y2
@@ -676,23 +1439,36 @@ test textTag-16.1 {TkTextPickCurrent procedure} haveCourier12 {
lappend x [.t index current]
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} haveCourier12 {
+} -result {2.1 3.2 3.2 3.2 3.2 3.2 4.3}
+
+test textTag-16.2 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ .t tag delete {*}[.t tag names]
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
+ .t tag configure big -font $bigFont
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
event gen .t <Motion> -x $x2 -y $y2
set x [.t index current]
.t tag add big 3.0
update
lappend x [.t index current]
-} {3.2 3.1}
-.t tag remove big 1.0 end
-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} haveCourier12 {
+} -cleanup {
+ .t tag delete big
+} -result {3.2 3.1}
+
+test textTag-16.3 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ foreach i {a b c d} {
+ .t tag remove $i 1.0 end
+ }
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
foreach i {a b c d} {
- .t tag remove $i 1.0 end
+ .t tag bind $i <Enter> "lappend x enter-$i"
+ .t tag bind $i <Leave> "lappend x leave-$i"
}
.t tag lower b
.t tag lower a
@@ -706,11 +1482,22 @@ test textTag-16.3 {TkTextPickCurrent procedure} haveCourier12 {
event gen .t <Motion> -x $x2 -y $y2
lappend x |
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} haveCourier12 {
+ return $x
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {enter-a enter-b | leave-b enter-c | leave-a leave-c}
+
+test textTag-16.4 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
foreach i {a b c d} {
- .t tag remove $i 1.0 end
+ .t tag remove $i 1.0 end
+ }
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
+ foreach i {a b c d} {
+ .t tag bind $i <Enter> "lappend x enter-$i"
+ .t tag bind $i <Leave> "lappend x leave-$i"
}
.t tag lower b
.t tag lower a
@@ -723,55 +1510,86 @@ test textTag-16.4 {TkTextPickCurrent procedure} haveCourier12 {
lappend x |
.t tag lower c
event gen .t <Motion> -x $x2 -y $y2
- set x
-} {enter-a enter-b enter-c | leave-c leave-b}
-foreach i {a b c d} {
- .t tag delete $i
-}
-test textTag-16.5 {TkTextPickCurrent procedure} haveCourier12 {
- foreach i {a b c d} {
- .t tag remove $i 1.0 end
+ return $x
+} -cleanup {
+ .t tag delete {*}[.t tag names]
+} -result {enter-a enter-b enter-c | leave-c leave-b}
+
+test textTag-16.5 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ foreach i {big a b c d} {
+ .t tag remove $i 1.0 end
}
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
+ .t tag configure big -font $bigFont
event gen .t <Motion> -x $x1 -y $y1
.t tag bind a <Enter> {.t tag add big 3.0 3.2}
.t tag add a 3.2
event gen .t <Motion> -x $x2 -y $y2
.t index current
-} {3.2}
-test textTag-16.6 {TkTextPickCurrent procedure} haveCourier12 {
- foreach i {a b c d} {
- .t tag remove $i 1.0 end
+} -cleanup {
+ .t tag delete a big
+} -result {3.2}
+
+test textTag-16.6 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ foreach i {big a b c d} {
+ .t tag remove $i 1.0 end
}
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
+ .t tag configure big -font $bigFont
event gen .t <Motion> -x $x1 -y $y1
.t tag bind a <Enter> {.t tag add big 3.0 3.2}
.t tag add a 3.2
event gen .t <Motion> -x $x2 -y $y2
update
.t index current
-} {3.1}
-test textTag-16.7 {TkTextPickCurrent procedure} haveCourier12 {
- foreach i {a b c d} {
- .t tag remove $i 1.0 end
+} -cleanup {
+ .t tag delete a big
+} -result {3.1}
+
+test textTag-16.7 {TkTextPickCurrent procedure} -constraints {
+ haveCourier12
+} -setup {
+ foreach i {big a b c d} {
+ .t tag remove $i 1.0 end
}
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
+ .t tag configure big -font $bigFont
+ .t tag bind a <Enter> {.t tag add big 3.0 3.2}
+ .t tag add a 3.2
+
event gen .t <Motion> -x $x1 -y $y1
.t tag bind a <Leave> {.t tag add big 3.0 3.2}
.t tag add a 2.1
event gen .t <Motion> -x $x2 -y $y2
+ update
.t index current
-} {3.1}
+} -cleanup {
+ .t tag delete a big
+} -result {3.1}
+
-test textTag-17.1 {insert procedure inserts tags} {
+test textTag-17.1 {insert procedure inserts tags} -setup {
.t delete 1.0 end
+} -body {
# Objectification of the text widget had a problem
# with inserting tags when using 'end'. Check that
# bug has been fixed.
.t insert end abcd {x} \n {} efgh {y} \n {}
.t dump -tag 1.0 end
-} {tagon x 1.0 tagoff x 1.4 tagon y 2.0 tagoff y 2.4}
+} -result {tagon x 1.0 tagoff x 1.4 tagon y 2.0 tagoff y 2.4}
-catch {destroy .t}
-test textTag-18.1 {TkTextPickCurrent tag bindings} {
+test textTag-18.1 {TkTextPickCurrent tag bindings} -setup {
+ destroy .t
+ event generate {} <Motion> -warp 1 -x -1 -y -1; update
+} -body {
text .t -width 30 -height 4 -relief sunken -borderwidth 10 \
-highlightthickness 10 -pady 2
pack .t
@@ -792,10 +1610,12 @@ test textTag-18.1 {TkTextPickCurrent tag bindings} {
event gen .t <Motion> -warp 1 -x 20 -y 20 ; update
event gen .t <Motion> -warp 1 -x 10 -y 10 ; update
event gen .t <Motion> -warp 1 -x 25 -y 25 ; update
- set res
-} {Enter {25 25 tag-Enter} {20 20 tag-Leave} {25 25 tag-Enter}}
+ return $res
+} -cleanup {
+ destroy .t
+} -result {Enter {25 25 tag-Enter} {20 20 tag-Leave} {25 25 tag-Enter}}
-catch {destroy .t}
+destroy .t
# cleanup
cleanupTests
diff --git a/tests/textWind.test b/tests/textWind.test
index 79dca50..c3483e6 100644
--- a/tests/textWind.test
+++ b/tests/textWind.test
@@ -6,8 +6,9 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
@@ -17,26 +18,21 @@ option add *Text.borderWidth 2
option add *Text.highlightThickness 2
option add *Text.font {Courier -12}
-set fixedFont {Courier -12}
-# 15 on XP, 13 on Solaris 8
-set fixedHeight [font metrics $fixedFont -linespace]
-# 7 on all platforms
-set fixedWidth [font measure $fixedFont m]
-# 12 on XP
-set fixedAscent [font metrics $fixedFont -ascent]
-set fixedDiff [expr {$fixedHeight - 13}] ;# 2 on XP
-
-catch {destroy .f}
-catch {destroy .t}
-catch {destroy .t2}
+deleteWindows
+# Widget used in tests 1.* - 16.*
text .t -width 30 -height 6 -bd 2 -highlightthickness 2
pack append . .t {top expand fill}
update
.t debug on
-wm geometry . {}
+
+# 15 on XP, 13 on Solaris 8
+set fixedHeight [font metrics {Courier -12} -linespace]
+set fixedDiff [expr {$fixedHeight - 13}] ;# 2 on XP
set color [expr {[winfo depth .t] > 1 ? "green" : "black"}]
-
+
+wm geometry . {}
+
# The statements below reset the main window; it's needed if the window
# manager is mwm to make mwm forget about a previous minimum size setting.
@@ -45,206 +41,323 @@ wm minsize . 1 1
wm positionfrom . user
wm deiconify .
-test textWind-1.1 {basic tests of options} {fonts} {
+# ----------------------------------------------------------------------
+
+test textWind-1.1 {basic tests of options} -constraints fonts -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 3 -height 3 -bg $color
.t window create 2.2 -window .f
update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
- [.t window configure .f -window]
-} {1 3x3+19+23 {19 23 3 3} {-window {} {} {} .f}}
-test textWind-1.2 {basic tests of options} {fonts} {
+ [.t window configure .f -window]
+} -result {1 3x3+19+23 {19 23 3 3} {-window {} {} {} .f}}
+test textWind-1.2 {basic tests of options} -constraints fonts -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 3 -height 3 -bg $color
.t window create 2.2 -window .f -align top
update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
- [.t window configure .f -align]
-} {1 3x3+19+18 {19 18 3 3} {-align {} {} center top}}
-test textWind-1.3 {basic tests of options} {
+ [.t window configure .f -align]
+} -result {1 3x3+19+18 {19 18 3 3} {-align {} {} center top}}
+test textWind-1.3 {basic tests of options} -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
.t window create 2.2 -create "Test script"
.t window configure 2.2 -create
-} {-create {} {} {} {Test script}}
-test textWind-1.4 {basic tests of options} {fonts} {
+} -result {-create {} {} {} {Test script}}
+test textWind-1.4 {basic tests of options} -constraints fonts -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 20 -bg $color
.t window create 2.2 -window .f -padx 5
update
list [winfo geom .f] [.t window configure .f -padx] [.t bbox 2.3]
-} {10x20+24+18 {-padx {} {} 0 5} {39 21 7 13}}
-test textWind-1.5 {basic tests of options} {fonts} {
+} -result {10x20+24+18 {-padx {} {} 0 5} {39 21 7 13}}
+test textWind-1.5 {basic tests of options} -constraints fonts -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 20 -bg $color
.t window create 2.2 -window .f -pady 4
update
list [winfo geom .f] [.t window configure .f -pady] [.t bbox 2.31]
-} {10x20+19+22 {-pady {} {} 0 4} {19 46 7 13}}
-test textWind-1.6 {basic tests of options} {fonts} {
+} -result {10x20+19+22 {-pady {} {} 0 4} {19 46 7 13}}
+test textWind-1.6 {basic tests of options} -constraints fonts -setup {
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 5 -height 5 -bg $color
.t window create 2.2 -window .f -stretch 1
update
list [winfo geom .f] [.t window configure .f -stretch]
-} {5x13+19+18 {-stretch {} {} 0 1}}
+} -result {5x13+19+18 {-stretch {} {} 0 1}}
+
.t delete 1.0 end
.t insert end "This is the first line"
-frame .f -width 10 -height 6 -bg $color
-.t window create 1.3 -window .f -padx 1 -pady 2
-test textWind-2.1 {TkTextWindowCmd procedure} {
- list [catch {.t window} msg] $msg
-} {1 {wrong # args: should be ".t window option ?arg arg ...?"}}
-test textWind-2.2 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget} msg] $msg
-} {1 {wrong # args: should be ".t window cget index option"}}
-test textWind-2.3 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget a b c} msg] $msg
-} {1 {wrong # args: should be ".t window cget index option"}}
-test textWind-2.4 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget gorp -padx} msg] $msg
-} {1 {bad text index "gorp"}}
-test textWind-2.5 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget 1.2 -padx} msg] $msg
-} {1 {no embedded window at index "1.2"}}
-test textWind-2.6 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget .f -bogus} msg] $msg
-} {1 {unknown option "-bogus"}}
-test textWind-2.7 {TkTextWindowCmd procedure, "cget" option} {
- list [catch {.t window cget .f -pady} msg] $msg
-} {0 2}
-test textWind-2.8 {TkTextWindowCmd procedure} {
- list [catch {.t window co} msg] $msg
-} {1 {wrong # args: should be ".t window configure index ?option value ...?"}}
-test textWind-2.9 {TkTextWindowCmd procedure} {
- list [catch {.t window configure gorp} msg] $msg
-} {1 {bad text index "gorp"}}
-test textWind-2.10 {TkTextWindowCmd procedure} {
- .t delete 1.0 end
- list [catch {.t window configure 1.0} msg] $msg
-} {1 {no embedded window at index "1.0"}}
-test textWind-2.11 {TkTextWindowCmd procedure} {
+test textWind-2.1 {TkTextWindowCmd procedure} -body {
+ .t window
+} -returnCodes error -result {wrong # args: should be ".t window option ?arg ...?"}
+test textWind-2.2 {TkTextWindowCmd procedure, "cget" option} -body {
+ .t window cget
+} -returnCodes error -result {wrong # args: should be ".t window cget index option"}
+test textWind-2.3 {TkTextWindowCmd procedure, "cget" option} -body {
+ .t window cget a b c
+} -returnCodes error -result {wrong # args: should be ".t window cget index option"}
+test textWind-2.4 {TkTextWindowCmd procedure, "cget" option} -body {
+ .t window cget gorp -padx
+} -returnCodes error -result {bad text index "gorp"}
+test textWind-2.5 {TkTextWindowCmd procedure, "cget" option} -body {
+ .t window cget 1.2 -padx
+} -returnCodes error -result {no embedded window at index "1.2"}
+test textWind-2.6 {TkTextWindowCmd procedure, "cget" option} -setup {
+ destroy .f
+} -body {
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 1.3 -window .f -padx 1 -pady 2
+ .t window cget .f -bogus
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {unknown option "-bogus"}
+test textWind-2.7 {TkTextWindowCmd procedure, "cget" option} -setup {
+ destroy .f
+} -body {
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 1.3 -window .f -padx 1 -pady 2
+ .t window cget .f -pady
+} -cleanup {
+ destroy .f
+} -returnCodes ok -result {2}
+test textWind-2.8 {TkTextWindowCmd procedure} -body {
+ .t window co
+} -returnCodes error -result {wrong # args: should be ".t window configure index ?-option value ...?"}
+test textWind-2.9 {TkTextWindowCmd procedure} -body {
+ .t window configure gorp
+} -returnCodes error -result {bad text index "gorp"}
+test textWind-2.10 {TkTextWindowCmd procedure} -body {
+ .t delete 1.0 end
+ .t window configure 1.0
+} -returnCodes error -result {no embedded window at index "1.0"}
+test textWind-2.11 {TkTextWindowCmd procedure} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 1.3 -window .f -padx 1 -pady 2
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
update
- list [catch {.t window configure .f} msg] $msg
-} {0 {{-align {} {} center baseline} {-create {} {} {} foo} {-padx {} {} 0 1} {-pady {} {} 0 2} {-stretch {} {} 0 0} {-window {} {} {} .f}}}
-test textWind-2.12 {TkTextWindowCmd procedure} {
+ .t window configure .f
+} -cleanup {
+ destroy .f
+} -result {{-align {} {} center baseline} {-create {} {} {} foo} {-padx {} {} 0 1} {-pady {} {} 0 2} {-stretch {} {} 0 0} {-window {} {} {} .f}}
+test textWind-2.12 {TkTextWindowCmd procedure} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
update
list [.t window configure .f -padx 33] [.t window configure .f -padx]
-} {{} {-padx {} {} 0 33}}
-test textWind-2.13 {TkTextWindowCmd procedure} {
+} -cleanup {
+ destroy .f
+} -result {{} {-padx {} {} 0 33}}
+test textWind-2.13 {TkTextWindowCmd procedure} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
.t delete 1.0 end
+} -body {
.t insert end "This is the first line"
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2
update
list [.t window configure .f -padx 14 -pady 15] \
- [.t window configure .f -padx] [.t window configure .f -pady]
-} {{} {-padx {} {} 0 14} {-pady {} {} 0 15}}
-test textWind-2.14 {TkTextWindowCmd procedure} {
- list [catch {.t window create} msg] $msg
-} {1 {wrong # args: should be ".t window create index ?option value ...?"}}
-test textWind-2.15 {TkTextWindowCmd procedure} {
- list [catch {.t window create gorp} msg] $msg
-} {1 {bad text index "gorp"}}
-test textWind-2.16 {TkTextWindowCmd procedure, don't insert after end} {
+ [.t window configure .f -padx] [.t window configure .f -pady]
+} -cleanup {
+ destroy .f
+} -result {{} {-padx {} {} 0 14} {-pady {} {} 0 15}}
+test textWind-2.14 {TkTextWindowCmd procedure} -setup {
+ .t delete 1.0 end
+} -body {
+ .t window create
+} -returnCodes error -result {wrong # args: should be ".t window create index ?-option value ...?"}
+test textWind-2.15 {TkTextWindowCmd procedure} -setup {
+ .t delete 1.0 end
+} -body {
+ .t window create gorp
+} -returnCodes error -result {bad text index "gorp"}
+test textWind-2.16 {TkTextWindowCmd procedure, don't insert after end} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 2.2 -window .f -align baseline -padx 1 -pady 2
.t delete 1.0 end
+} -body {
.t insert end "Line 1\nLine 2"
frame .f -width 20 -height 10 -bg $color
.t window create end -window .f
.t index .f
-} {2.6}
-test textWind-2.17 {TkTextWindowCmd procedure} {
+} -result {2.6}
+test textWind-2.17 {TkTextWindowCmd procedure} -setup {
.t delete 1.0 end
+} -body {
list [catch {.t window create 1.0} msg] $msg [.t window configure 1.0]
-} {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 0} {-pady {} {} 0 0} {-stretch {} {} 0 0} {-window {} {} {} {}}}}
-test textWind-2.18 {TkTextWindowCmd procedure} {
+} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 0} {-pady {} {} 0 0} {-stretch {} {} 0 0} {-window {} {} {} {}}}}
+test textWind-2.18 {TkTextWindowCmd procedure} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 20 -height 10 -bg $color
+ .t window create end -window .f
+ .t delete 1.0 end
+} -body {
+ frame .f -width 10 -height 6 -bg $color
+ .t window create 1.0 -window .f -gorp stupid
+} -returnCodes error -result {unknown option "-gorp"}
+test textWind-2.19 {TkTextWindowCmd procedure} -setup {
+# I kept this as it "influenced" the test case in previous releases
+ destroy .f
+ frame .f -width 20 -height 10 -bg $color
+ .t window create end -window .f
+ .t delete 1.0 end
+} -body {
+ frame .f -width 10 -height 6 -bg $color
+ catch {.t window create 1.0 -window .f -gorp stupid}
+ list [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
+} -result {0 1.0 1}
+test textWind-2.20 {TkTextWindowCmd procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
frame .f -width 10 -height 6 -bg $color
- list [catch {.t window create 1.0 -window .f -gorp stupid} msg] $msg \
- [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
-} {1 {unknown option "-gorp"} 0 1.0 1}
-test textWind-2.19 {TkTextWindowCmd procedure} {
+ .t window create 1.0 -gorp -window .f stupid
+} -returnCodes error -result {unknown option "-gorp"}
+test textWind-2.21 {TkTextWindowCmd procedure} -setup {
.t delete 1.0 end
- catch {destroy .f}
+ destroy .f
+} -body {
frame .f -width 10 -height 6 -bg $color
- list [catch {.t window create 1.0 -gorp -window .f stupid} msg] $msg \
- [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
-} {1 {unknown option "-gorp"} 1 1.0 1}
-test textWind-2.20 {TkTextWindowCmd procedure} {
- list [catch {.t window c} msg] $msg
-} {1 {ambiguous window option "c": must be cget, configure, create, or names}}
+ catch {.t window create 1.0 -gorp -window .f stupid}
+ list [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
+} -result {1 1.0 1}
+test textWind-2.22 {TkTextWindowCmd procedure} -setup {
+ .t delete 1.0 end
+} -body {
+ .t window c
+} -returnCodes error -result {ambiguous window option "c": must be cget, configure, create, or names}
destroy .f
-test textWind-2.21 {TkTextWindowCmd procedure, "names" option} {
- list [catch {.t window names foo} msg] $msg
-} {1 {wrong # args: should be ".t window names"}}
-test textWind-2.22 {TkTextWindowCmd procedure, "names" option} {
+test textWind-2.23 {TkTextWindowCmd procedure, "names" option} -setup {
+ .t delete 1.0 end
+} -body {
+ .t window names foo
+} -returnCodes error -result {wrong # args: should be ".t window names"}
+test textWind-2.24 {TkTextWindowCmd procedure, "names" option} -setup {
.t delete 1.0 end
+} -body {
.t window names
-} {}
-test textWind-2.23 {TkTextWindowCmd procedure, "names" option} {
+} -result {}
+test textWind-2.25 {TkTextWindowCmd procedure, "names" option} -setup {
.t delete 1.0 end
+ destroy .f .f2 .t.f .t.f2
+} -body {
foreach i {.f .f2 .t.f .t.f2} {
- frame $i -width 20 -height 20
- .t window create end -window $i
+ frame $i -width 20 -height 20
+ .t window create end -window $i
}
- set result [.t window names]
+ lsort [.t window names]
+} -cleanup {
destroy .f .f2 .t.f .t.f2
- lsort $result
-} {.f .f2 .t.f .t.f2}
+} -result {.f .f2 .t.f .t.f2}
-test textWind-3.1 {EmbWinConfigure procedure} {
- .t delete 1.0 end
+
+test textWind-3.1 {EmbWinConfigure procedure} -setup {
+ destroy .f
+} -body {
frame .f -width 10 -height 6 -bg $color
.t window create 1.0 -window .f
- list [catch {.t window configure 1.0 -foo bar} msg] $msg
-} {1 {unknown option "-foo"}}
-test textWind-3.2 {EmbWinConfigure procedure} {fonts} {
- .t delete 1.0 end
+ .t window configure 1.0 -foo bar
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {unknown option "-foo"}
+test textWind-3.2 {EmbWinConfigure procedure} -constraints fonts -setup {
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.3 -window .f
update
.t window configure 1.3 -window {}
update
- list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4]
-} {1 {bad text index ".f"} 0 {26 5 7 13}}
-catch {destroy .f}
-test textWind-3.3 {EmbWinConfigure procedure} {fonts} {
- .t delete 1.0 end
+ .t index .f
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {bad text index ".f"}
+test textWind-3.3 {EmbWinConfigure procedure} -constraints fonts -setup {
+ destroy .f
+} -body {
+ .t insert 1.0 "Some sample text"
+ frame .f -width 10 -height 20 -bg $color
+ .t window create 1.3 -window .f
+ update
+ .t window configure 1.3 -window {}
+ update
+ catch {.t index .f}
+ list [winfo ismapped .f] [.t bbox 1.4]
+} -cleanup {
+ destroy .f
+} -result {0 {26 5 7 13}}
+test textWind-3.4 {EmbWinConfigure procedure} -constraints fonts -setup {
+ destroy .t.f
+} -body {
.t insert 1.0 "Some sample text"
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.3 -window .t.f
update
.t window configure 1.3 -window {}
update
- list [catch {.t index .t.f} msg] $msg [winfo ismapped .t.f] [.t bbox 1.4]
-} {1 {bad text index ".t.f"} 0 {26 5 7 13}}
-catch {destroy .t.f}
-test textWind-3.4 {EmbWinConfigure procedure} {fonts} {
- .t delete 1.0 end
+ .t index .t.f
+} -cleanup {
+ destroy .t.f
+} -returnCodes error -result {bad text index ".t.f"}
+test textWind-3.5 {EmbWinConfigure procedure} -constraints fonts -setup {
+ destroy .t.f
+} -body {
+ .t insert 1.0 "Some sample text"
+ frame .t.f -width 10 -height 20 -bg $color
+ .t window create 1.3 -window .t.f
+ update
+ .t window configure 1.3 -window {}
+ update
+ catch {.t index .t.f}
+ list [winfo ismapped .t.f] [.t bbox 1.4]
+} -cleanup {
+ destroy .t.f
+} -result {0 {26 5 7 13}}
+test textWind-3.6 {EmbWinConfigure procedure} -constraints fonts -setup {
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.3
@@ -252,89 +365,143 @@ test textWind-3.4 {EmbWinConfigure procedure} {fonts} {
.t window configure 1.3 -window .f
update
list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4]
-} {0 1.3 1 {36 8 7 13}}
-test textWind-3.5 {EmbWinConfigure procedure} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .f
+} -result {0 1.3 1 {36 8 7 13}}
+test textWind-3.7 {EmbWinConfigure procedure} -setup {
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f
frame .f.f -width 15 -height 20 -bg $color
pack .f.f
- list [catch {.t window create 1.3 -window .f.f} msg] $msg
-} {1 {can't embed .f.f in .t}}
-catch {destroy .f}
-test textWind-3.6 {EmbWinConfigure procedure} {
- .t delete 1.0 end
+ .t window create 1.3 -window .f.f
+} -cleanup {
+ destroy .f
+} -returnCodes error -result {can't embed .f.f in .t}
+test textWind-3.8 {EmbWinConfigure procedure} -setup {
+ destroy .t2
+} -body {
.t insert 1.0 "Some sample text"
toplevel .t2 -width 20 -height 10 -bg $color
.t window create 1.3
- list [catch {.t window configure 1.3 -window .t2} msg] $msg \
- [.t window configure 1.3 -window]
-} {1 {can't embed .t2 in .t} {-window {} {} {} {}}}
-catch {destroy .t2}
-test textWind-3.7 {EmbWinConfigure procedure} {
- .t delete 1.0 end
+ .t window configure 1.3 -window .t2
+} -cleanup {
+ destroy .t2
+} -returnCodes error -result {can't embed .t2 in .t}
+test textWind-3.9 {EmbWinConfigure procedure} -setup {
+ destroy .t2
+} -body {
+ .t insert 1.0 "Some sample text"
+ toplevel .t2 -width 20 -height 10 -bg $color
+ .t window create 1.3
+ catch {.t window configure 1.3 -window .t2}
+ .t window configure 1.3 -window
+} -cleanup {
+ destroy .t2
+} -result {-window {} {} {} {}}
+test textWind-3.10 {EmbWinConfigure procedure} -setup {
+ .t delete 1.0 end
+} -body {
.t insert 1.0 "Some sample text"
.t window create 1.3
- list [catch {.t window configure 1.3 -window .t} msg] $msg
-} {1 {can't embed .t in .t}}
-test textWind-3.8 {EmbWinConfigure procedure} {
+ .t window configure 1.3 -window .t
+} -returnCodes error -result {can't embed .t in .t}
+test textWind-3.11 {EmbWinConfigure procedure} -setup {
+ .t delete 1.0 end
+} -body {
# This test checks for various errors when the text claims
# a window away from itself.
- .t delete 1.0 end
.t insert 1.0 "Some sample text"
button .t.b -text "Hello!"
.t window create 1.4 -window .t.b
.t window create 1.6 -window .t.b
update
.t index .t.b
-} {1.6}
+} -result {1.6}
+
.t delete 1.0 end
frame .f -width 10 -height 20 -bg $color
.t window create 1.0 -window .f
-test textWind-4.1 {AlignParseProc and AlignPrintProc procedures} {
+test textWind-4.1 {AlignParseProc and AlignPrintProc procedures} -body {
.t window configure 1.0 -align baseline
.t window configure 1.0 -align
-} {-align {} {} center baseline}
-test textWind-4.2 {AlignParseProc and AlignPrintProc procedures} {
+} -result {-align {} {} center baseline}
+test textWind-4.2 {AlignParseProc and AlignPrintProc procedures} -body {
.t window configure 1.0 -align bottom
.t window configure 1.0 -align
-} {-align {} {} center bottom}
-test textWind-4.3 {AlignParseProc and AlignPrintProc procedures} {
+} -result {-align {} {} center bottom}
+test textWind-4.3 {AlignParseProc and AlignPrintProc procedures} -body {
.t window configure 1.0 -align center
.t window configure 1.0 -align
-} {-align {} {} center center}
-test textWind-4.4 {AlignParseProc and AlignPrintProc procedures} {
+} -result {-align {} {} center center}
+test textWind-4.4 {AlignParseProc and AlignPrintProc procedures} -body {
.t window configure 1.0 -align top
.t window configure 1.0 -align
-} {-align {} {} center top}
-test textWind-4.5 {AlignParseProc and AlignPrintProc procedures} {
+} -result {-align {} {} center top}
+test textWind-4.5 {AlignParseProc and AlignPrintProc procedures} -body {
+ .t window configure 1.0 -align top
+ .t window configure 1.0 -align gorp
+} -returnCodes error -result {bad align "gorp": must be baseline, bottom, center, or top}
+test textWind-4.6 {AlignParseProc and AlignPrintProc procedures} -body {
.t window configure 1.0 -align top
- list [catch {.t window configure 1.0 -align gorp} msg] $msg \
- [.t window configure 1.0 -align]
-} {1 {bad align "gorp": must be baseline, bottom, center, or top} {-align {} {} center top}}
+ catch {.t window configure 1.0 -align gorp}
+ .t window configure 1.0 -align
+} -result {-align {} {} center top}
+
-test textWind-5.1 {EmbWinStructureProc procedure} {fonts} {
+test textWind-5.1 {EmbWinStructureProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
update
destroy .f
- list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3]
-} {1 {bad text index ".f"} {19 11 0 0} {19 5 7 13}}
-test textWind-5.2 {EmbWinStructureProc procedure} {fonts} {
+ .t index .f
+} -returnCodes error -result {bad text index ".f"}
+test textWind-5.2 {EmbWinStructureProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t insert 1.0 "Some sample text"
+ frame .f -width 10 -height 20 -bg $color
+ .t window create 1.2 -window .f
+ update
+ destroy .f
+ catch {.t index .f}
+ list [.t bbox 1.2] [.t bbox 1.3]
+} -result {{19 11 0 0} {19 5 7 13}}
+test textWind-5.3 {EmbWinStructureProc procedure} -constraints fonts -setup {
+ .t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -align bottom
.t window configure 1.2 -window .f
update
destroy .f
- list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3]
-} {1 {bad text index ".f"} {19 18 0 0} {19 5 7 13}}
-test textWind-5.3 {EmbWinStructureProc procedure} {fonts} {
+ .t index .f
+} -returnCodes error -result {bad text index ".f"}
+test textWind-5.4 {EmbWinStructureProc procedure} -constraints fonts -setup {
+ .t delete 1.0 end
+} -body {
+ .t insert 1.0 "Some sample text"
+ frame .f -width 10 -height 20 -bg $color
+ .t window create 1.2 -align bottom
+ .t window configure 1.2 -window .f
+ update
+ destroy .f
+ catch {.t index .f}
+ list [.t bbox 1.2] [.t bbox 1.3]
+} -result {{19 18 0 0} {19 5 7 13}}
+test textWind-5.5 {EmbWinStructureProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
.t window create 1.2 -create {frame .f -width 10 -height 20 -bg $color}
update
@@ -342,21 +509,31 @@ test textWind-5.3 {EmbWinStructureProc procedure} {fonts} {
destroy .f
update
list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3]
-} {0 1.2 {19 6 20 10} {39 5 7 13}}
+} -result {0 1.2 {19 6 20 10} {39 5 7 13}}
+
-test textWind-6.1 {EmbWinRequestProc procedure} {fonts} {
+test textWind-6.1 {EmbWinRequestProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+ set result {}
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
- set result {}
lappend result [.t bbox 1.2] [.t bbox 1.3]
.f configure -width 25 -height 30
lappend result [.t bbox 1.2] [.t bbox 1.3]
-} {{19 5 10 20} {29 8 7 13} {19 5 25 30} {44 13 7 13}}
+} -cleanup {
+ destroy .f
+} -result {{19 5 10 20} {29 8 7 13} {19 5 25 30} {44 13 7 13}}
-test textWind-7.1 {EmbWinLostSlaveProc procedure} {textfonts} {
+
+test textWind-7.1 {EmbWinLostSlaveProc procedure} -constraints {
+ textfonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
@@ -364,9 +541,15 @@ test textWind-7.1 {EmbWinLostSlaveProc procedure} {textfonts} {
place .f -in .t -x 100 -y 50
update
list [winfo geom .f] [.t bbox 1.2]
-} [list 10x20+105+55 [list 19 [expr {11+$fixedDiff/2}] 0 0]]
-test textWind-7.2 {EmbWinLostSlaveProc procedure} {textfonts} {
+} -cleanup {
+ destroy .f
+} -result [list 10x20+105+55 [list 19 [expr {11+$fixedDiff/2}] 0 0]]
+test textWind-7.2 {EmbWinLostSlaveProc procedure} -constraints {
+ textfonts
+} -setup {
.t delete 1.0 end
+ destroy .t.f
+} -body {
.t insert 1.0 "Some sample text"
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.2 -window .t.f
@@ -374,76 +557,124 @@ test textWind-7.2 {EmbWinLostSlaveProc procedure} {textfonts} {
place .t.f -x 100 -y 50
update
list [winfo geom .t.f] [.t bbox 1.2]
-} [list 10x20+105+55 [list 19 [expr {11+$fixedDiff/2}] 0 0]]
-catch {destroy .f}
-catch {destroy .t.f}
+} -cleanup {
+ destroy .t.f
+} -result [list 10x20+105+55 [list 19 [expr {11+$fixedDiff/2}] 0 0]]
-test textWind-8.1 {EmbWinDeleteProc procedure} {fonts} {
+
+test textWind-8.1 {EmbWinDeleteProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
bind .f <Destroy> {set x destroyed}
set x XXX
.t delete 1.2
- list $x [.t bbox 1.2] [.t bbox 1.3] [catch {.t index .f} msg] $msg \
- [winfo exists .f]
-} {destroyed {19 5 7 13} {26 5 7 13} 1 {bad text index ".f"} 0}
+ list $x [.t bbox 1.2] [.t bbox 1.3] [winfo exists .f]
+} -result {destroyed {19 5 7 13} {26 5 7 13} 0}
+test textWind-8.2 {EmbWinDeleteProc procedure} -constraints fonts -setup {
+ .t delete 1.0 end
+ destroy .f
+} -body {
+ .t insert 1.0 "Some sample text"
+ frame .f -width 10 -height 20 -bg $color
+ .t window create 1.2 -window .f
+ bind .f <Destroy> {set x destroyed}
+ set x XXX
+ .t delete 1.2
+ .t index .f
+} -returnCodes error -result {bad text index ".f"}
-test textWind-9.1 {EmbWinCleanupProc procedure} {
+
+test textWind-9.1 {EmbWinCleanupProc procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text\nA second line."
frame .f -width 10 -height 20 -bg $color
.t window create 2.3 -window .f
.t delete 1.5 2.1
.t index .f
-} 1.7
+} -cleanup {
+ destroy .f
+} -result {1.7}
-proc bgerror args {
- global msg
- set msg $args
-}
-test textWind-10.1 {EmbWinLayoutProc procedure} {
+test textWind-10.1 {EmbWinLayoutProc procedure} -setup {
.t delete 1.0 end
- .t insert 1.0 "Some sample text"
destroy .f
+} -body {
+ .t insert 1.0 "Some sample text"
.t window create 1.5 -create {
- frame .f -width 10 -height 20 -bg $color
+ frame .f -width 10 -height 20 -bg $color
}
update
list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f]
-} {1 10 20 1.5}
-test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} {fonts} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .f
+} -result {1 10 20 1.5}
+test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ fonts
+} -setup {
+ .t delete 1.0 end
+ proc bgerror args {
+ global msg
+ set msg $args
+ }
+} -body {
.t insert 1.0 "Some sample text"
- .t window create 1.5 -create {
- error "couldn't create window"
+ .t window create 1.5 -create {
+ error "couldn't create window"
}
set msg xyzzy
update
list $msg [.t bbox 1.5]
-} {{{couldn't create window}} {40 11 0 0}}
-test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} {fonts} {
- .t delete 1.0 end
+} -cleanup {
+ rename bgerror {}
+} -result {{{couldn't create window}} {40 11 0 0}}
+test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ fonts
+} -setup {
+ .t delete 1.0 end
+ proc bgerror args {
+ global msg
+ set msg $args
+ }
+} -body {
.t insert 1.0 "Some sample text"
.t window create 1.5 -create {
- concat gorp
+ concat gorp
}
set msg xyzzy
update
list $msg [.t bbox 1.5]
-} {{{bad window path name "gorp"}} {40 11 0 0}}
-proc bgerror args {
- global msg
- if {[lsearch -exact $msg $args] == -1} {
- lappend msg $args
+} -cleanup {
+ rename bgerror {}
+} -result {{{bad window path name "gorp"}} {40 11 0 0}}
+ .t delete 1.0 end
+ destroy .t.f
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
}
-}
-test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} {textfonts} {
- .t delete 1.0 end
+
+test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ textfonts
+} -setup {
+ .t delete 1.0 end
+ destroy .t.f
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
+ }
+} -body {
.t insert 1.0 "Some sample text"
- catch {destroy .t.f}
set msg {}
after idle {
.t window create 1.5 -create {
@@ -453,68 +684,116 @@ test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} {textf
}
set count 0
while {([llength $msg] < 2) && ($count < 100)} {
- update ; incr count; .t bbox 1.5 ; after 10
+ update
+ incr count
+ .t bbox 1.5
+ after 10
}
lappend msg [.t bbox 1.5] [winfo exists .t.f.f]
-} [list {{can't embed .t.f.f relative to .t}} {{window name "f" already exists in parent}} [list 40 [expr {11+$fixedDiff/2}] 0 0] 1]
-test textWind-10.4.1 {EmbWinLayoutProc procedure, error in creating window} {textfonts} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .t.f
+ rename bgerror {}
+} -result [list {{can't embed .t.f.f relative to .t}} {{window name "f" already exists in parent}} [list 40 [expr {11+$fixedDiff/2}] 0 0] 1]
+test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ textfonts
+} -setup {
+ .t delete 1.0 end
+ destroy .t.f
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
+ }
+} -body {
.t insert 1.0 "Some sample text"
- catch {destroy .t.f}
.t window create 1.5 -create {
- frame .t.f
- frame .t.f.f -width 10 -height 20 -bg $color
+ frame .t.f
+ frame .t.f.f -width 10 -height 20 -bg $color
}
set msg {}
update idletasks
lappend msg [winfo exists .t.f.f]
-} [list {{can't embed .t.f.f relative to .t}} 1]
+} -cleanup {
+ destroy .t.f
+ rename bgerror {}
+} -result {{{can't embed .t.f.f relative to .t}} 1}
catch {destroy .t.f}
-test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} {textfonts} {
- .t delete 1.0 end
+test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ textfonts
+} -setup {
+ .t delete 1.0 end
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
+ }
+} -body {
.t insert 1.0 "Some sample text"
.t window create 1.5 -create {
- concat .t
+ concat .t
}
set msg {}
update
lappend msg [.t bbox 1.5]
-} [list {{can't embed .t relative to .t}} [list 40 [expr {11+$fixedDiff/2}] 0 0]]
-test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} {textfonts} {
- .t delete 1.0 end
+} -cleanup {
+ rename bgerror {}
+} -result [list {{can't embed .t relative to .t}} [list 40 [expr {11+$fixedDiff/2}] 0 0]]
+test textWind-10.7 {EmbWinLayoutProc procedure, error in creating window} -constraints {
+ textfonts
+} -setup {
+ .t delete 1.0 end
+ destroy .t2
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
+ }
+} -body {
.t insert 1.0 "Some sample text"
- catch {destroy .t2}
.t window create 1.5 -create {
- toplevel .t2 -width 100 -height 150
- wm geom .t2 +0+0
- concat .t2
+ toplevel .t2 -width 100 -height 150
+ wm geom .t2 +0+0
+ concat .t2
}
set msg {}
update
lappend msg [.t bbox 1.5]
-} [list {{can't embed .t2 relative to .t}} {{window name "t2" already exists in parent}} [list 40 [expr {11+$fixedDiff/2}] 0 0]]
-test textWind-10.6.1 {EmbWinLayoutProc procedure, error in creating window} {
- .t delete 1.0 end
+} -cleanup {
+ rename bgerror {}
+} -result [list {{can't embed .t2 relative to .t}} {{window name "t2" already exists in parent}} [list 40 [expr {11+$fixedDiff/2}] 0 0]]
+test textWind-10.8 {EmbWinLayoutProc procedure, error in creating window} -setup {
+ .t delete 1.0 end
+ destroy .t2
+ proc bgerror args {
+ global msg
+ if {[lsearch -exact $msg $args] == -1} {
+ lappend msg $args
+ }
+ }
+} -body {
.t insert 1.0 "Some sample text"
- catch {destroy .t2}
.t window create 1.5 -create {
- toplevel .t2 -width 100 -height 150
- wm geom .t2 +0+0
- concat .t2
+ toplevel .t2 -width 100 -height 150
+ wm geom .t2 +0+0
+ concat .t2
}
set msg {}
update
set i 0
while {[llength $msg] == 1 && [incr i] < 200} { update }
- set msg
-} {{{can't embed .t2 relative to .t}} {{window name "t2" already exists in parent}}}
+ return $msg
+} -cleanup {
+ destroy .t2
+ rename bgerror {}
+} -result {{{can't embed .t2 relative to .t}} {{window name "t2" already exists in parent}}}
-proc bgerror args {
- global msg
- set msg $args
-}
-test textWind-10.7 {EmbWinLayoutProc procedure, steal window from self} {
+test textWind-10.9 {EmbWinLayoutProc procedure, steal window from self} -setup {
.t delete 1.0 end
+ destroy .t.b
+} -body {
.t insert 1.0 ABCDEFGHIJKLMNOP
button .t.b -text "Hello!"
.t window create 1.5 -window .t.b
@@ -522,64 +801,104 @@ test textWind-10.7 {EmbWinLayoutProc procedure, steal window from self} {
.t window create 1.3 -create {concat .t.b}
update
.t index .t.b
-} {1.3}
-catch {destroy .t2}
-test textWind-10.8 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} {
- .t configure -wrap char
+} -cleanup {
+ destroy .t.b
+} -result {1.3}
+test textWind-10.10 {EmbWinLayoutProc procedure, doesn't fit on line} -constraints {
+ fonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap char
.t insert 1.0 "Some sample text"
frame .f -width 125 -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
list [.t bbox .f] [.t bbox 1.13]
-} {{89 5 126 20} {5 25 7 13}}
-test textWind-10.9 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} {
- .t configure -wrap char
+} -cleanup {
+ destroy .f
+} -result {{89 5 126 20} {5 25 7 13}}
+test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} -constraints {
+ fonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap char
.t insert 1.0 "Some sample text"
frame .f -width 126 -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
update
list [.t bbox .f] [.t bbox 1.13]
-} {{89 5 126 20} {5 25 7 13}}
-test textWind-10.10 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} {
- .t configure -wrap char
+} -cleanup {
+ destroy .f
+} -result {{89 5 126 20} {5 25 7 13}}
+test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} -constraints {
+ fonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap char
.t insert 1.0 "Some sample text"
frame .f -width 127 -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
update
list [.t bbox .f] [.t bbox 1.13]
-} {{5 18 127 20} {132 21 7 13}}
-test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} {
- .t configure -wrap none
+} -cleanup {
+ destroy .f
+} -result {{5 18 127 20} {132 21 7 13}}
+test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap none
.t insert 1.0 "Some sample text"
frame .f -width 130 -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
update
list [.t bbox .f] [.t bbox 1.13]
-} {{89 5 126 20} {}}
-test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} {
- .t configure -wrap none
+} -cleanup {
+ destroy .f
+} -result {{89 5 126 20} {}}
+test textWind-10.14 {EmbWinLayoutProc procedure, doesn't fit on line} -constraints {
+ fonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap none
.t insert 1.0 "Some sample text"
frame .f -width 130 -height 220 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
update
list [.t bbox .f] [.t bbox 1.13]
-} {{89 5 126 78} {}}
-test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} {fonts} {
- .t configure -wrap char
+} -cleanup {
+ destroy .f
+} -result {{89 5 126 78} {}}
+test textWind-10.15 {EmbWinLayoutProc procedure, doesn't fit on line} -constraints {
+ fonts
+} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap char
.t insert 1.0 "Some sample text"
frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
update
list [.t bbox .f] [.t bbox 1.13]
-} {{5 18 210 65} {}}
+} -cleanup {
+ destroy .f
+} -result {{5 18 210 65} {}}
+
-test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} {
+test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup {
.t delete 1.0 end
+ destroy .f
+ place forget .t
+ pack .t
+} -body {
.t insert 1.0 "Some sample text"
pack forget .t
place .t -x 30 -y 50
@@ -587,11 +906,16 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} {
.t window create 1.12 -window .f
update
winfo geom .f
-} {30x20+119+55}
-place forget .t
-pack .t
-test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .f
+ place forget .t
+} -result {30x20+119+55}
+test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup {
+ .t delete 1.0 end
+ destroy .t.f
+ place forget .t
+ pack .t
+} -body {
.t insert 1.0 "Some sample text"
pack forget .t
place .t -x 30 -y 50
@@ -599,11 +923,17 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} {
.t window create 1.12 -window .t.f
update
winfo geom .t.f
-} {30x20+89+5}
-place forget .t
-pack .t
-test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} {
+} -cleanup {
+ destroy .t.f
+ place forget .t
+ pack .t
+} -result {30x20+89+5}
+test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -setup {
.t delete 1.0 end
+ destroy .f
+ place forget .t
+ pack .t
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.12 -window .f
@@ -613,10 +943,18 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} {
.t delete 1.0
.t insert 1.0 "X"
update
- set x
-} {no configures}
-test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} {
- .t delete 1.0 end
+ return $x
+} -cleanup {
+ destroy .f
+ place forget .t
+ pack .t
+} -result {no configures}
+test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} -constraints {
+ fonts
+} -setup {
+ .t delete 1.0 end
+ destroy .f .f2
+} -body {
.t insert 1.0 "xyzzy\nFirst window here: "
.t configure -wrap none
frame .f -width 30 -height 20 -bg $color
@@ -629,9 +967,15 @@ test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} {
.t xview scroll 5 units
update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2]
-} {1 30x20+103+18 {103 18 30 20} 0}
-test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} {
- .t delete 1.0 end
+} -cleanup {
+ destroy .f .f2
+} -result {1 30x20+103+18 {103 18 30 20} 0}
+test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} -constraints {
+ fonts
+} -setup {
+ .t delete 1.0 end
+ destroy .f .f2
+} -body {
.t insert 1.0 "xyzzy\nFirst window here: "
.t configure -wrap none
frame .f -width 30 -height 20 -bg $color
@@ -645,11 +989,16 @@ test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} {fonts} {
.t xview scroll 25 units
update
list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2]
-} {0 1 40x10+119+23 {119 23 40 10}}
+} -cleanup {
+ destroy .f .f2
+} -result {0 1 40x10+119+23 {119 23 40 10}}
.t configure -wrap char
-test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} {
+
+test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
@@ -669,74 +1018,114 @@ test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} {
.t configure -wrap none
.t insert 1.0 "Enough text to make the line run off-screen"
update
- set x
-} {created mapped modified replaced unmapped mapped off-screen unmapped}
+ return $x
+} -cleanup {
+ destroy .f
+} -result {created mapped modified replaced unmapped mapped off-screen unmapped}
+
-test textWind-13.1 {EmbWinBboxProc procedure} {
+test textWind-13.1 {EmbWinBboxProc procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align top -padx 2 -pady 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x5+21+6 {21 6 5 5}}
-test textWind-13.2 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x5+21+6 {21 6 5 5}}
+test textWind-13.2 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align center -padx 2 -pady 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x5+21+9 {21 9 5 5}}
-test textWind-13.3 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x5+21+9 {21 9 5 5}}
+test textWind-13.3 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align baseline -padx 2 -pady 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x5+21+10 {21 10 5 5}}
-test textWind-13.4 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x5+21+10 {21 10 5 5}}
+test textWind-13.4 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align bottom -padx 2 -pady 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x5+21+12 {21 12 5 5}}
-test textWind-13.5 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x5+21+12 {21 12 5 5}}
+test textWind-13.5 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x11+21+6 {21 6 5 11}}
-test textWind-13.6 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x11+21+6 {21 6 5 11}}
+test textWind-13.6 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x11+21+6 {21 6 5 11}}
-test textWind-13.7 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x11+21+6 {21 6 5 11}}
+test textWind-13.7 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x9+21+6 {21 6 5 9}}
-test textWind-13.8 {EmbWinBboxProc procedure} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x9+21+6 {21 6 5 9}}
+test textWind-13.8 {EmbWinBboxProc procedure} -constraints fonts -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x11+21+6 {21 6 5 11}}
-test textWind-13.9 {EmbWinBboxProc procedure, spacing options} {fonts} {
+} -cleanup {
+ destroy .f
+} -result {5x11+21+6 {21 6 5 11}}
+test textWind-13.9 {EmbWinBboxProc procedure, spacing options} -constraints {
+ fonts
+} -setup {
+ .t delete 1.0 end
+ destroy .f
+} -body {
.t configure -spacing1 5 -spacing3 2
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -744,11 +1133,15 @@ test textWind-13.9 {EmbWinBboxProc procedure, spacing options} {fonts} {
.t window create 1.2 -window .f -align center -padx 2 -pady 1
update
list [winfo geom .f] [.t bbox .f]
-} {5x5+21+14 {21 14 5 5}}
-.t configure -spacing1 0 -spacing2 0 -spacing3 0
+} -cleanup {
+ destroy .f
+} -result {5x5+21+14 {21 14 5 5}}
+
-test textWind-14.1 {EmbWinDelayedUnmap procedure} {
+test textWind-14.1 {EmbWinDelayedUnmap procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
@@ -760,11 +1153,14 @@ test textWind-14.1 {EmbWinDelayedUnmap procedure} {
.t window configure .f -window {}
lappend x updated
update
- set x
-} {modified removed unmapped updated}
-catch {destroy .f}
-test textWind-14.2 {EmbWinDelayedUnmap procedure} {
+ return $x
+} -cleanup {
+ destroy .f
+} -result {modified removed unmapped updated}
+test textWind-14.2 {EmbWinDelayedUnmap procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
@@ -776,10 +1172,14 @@ test textWind-14.2 {EmbWinDelayedUnmap procedure} {
.t delete .f
lappend x updated
update
- set x
-} {modified deleted updated}
-test textWind-14.3 {EmbWinDelayedUnmap procedure} {
+ return $x
+} -cleanup {
+ destroy .f
+} -result {modified deleted updated}
+test textWind-14.3 {EmbWinDelayedUnmap procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
.t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
@@ -788,9 +1188,13 @@ test textWind-14.3 {EmbWinDelayedUnmap procedure} {
set result [winfo ismapped .f]
update ; after 10
list $result [winfo ismapped .f]
-} {1 0}
-test textWind-14.4 {EmbWinDelayedUnmap procedure} {
+} -cleanup {
+ destroy .f
+} -result {1 0}
+test textWind-14.4 {EmbWinDelayedUnmap procedure} -setup {
.t delete 1.0 end
+ destroy .t.f
+} -body {
.t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
frame .t.f -width 30 -height 20 -bg $color
.t window create 1.2 -window .t.f
@@ -799,27 +1203,38 @@ test textWind-14.4 {EmbWinDelayedUnmap procedure} {
set result [winfo ismapped .t.f]
update
list $result [winfo ismapped .t.f]
-} {1 0}
-catch {destroy .t.f}
-catch {destroy .f}
+} -cleanup {
+ destroy .t.f
+} -result {1 0}
-test textWind-15.1 {TkTextWindowIndex procedure} {
- list [catch {.t index .foo} msg] $msg
-} {1 {bad text index ".foo"}}
-test textWind-15.2 {TkTextWindowIndex procedure} {fonts} {
- .t configure -wrap none
+
+test textWind-15.1 {TkTextWindowIndex procedure} -setup {
.t delete 1.0 end
+} -body {
+ .t index .foo
+} -returnCodes error -result {bad text index ".foo"}
+test textWind-15.2 {TkTextWindowIndex procedure} -constraints fonts -setup {
+ .t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
+ -wrap none
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.6 -window .f
.t tag add a 1.1
.t tag add a 1.3
list [.t index .f] [.t bbox 1.7]
-} {1.6 {77 8 7 13}}
+} -cleanup {
+ destroy .f
+} -result {1.6 {77 8 7 13}}
-test textWind-16.1 {EmbWinTextStructureProc procedure} {
- .t configure -wrap none
+
+test textWind-16.1 {EmbWinTextStructureProc procedure} -setup {
.t delete 1.0 end
+ destroy .f
+} -body {
+ .t configure -wrap none
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.6 -window .f
@@ -827,11 +1242,15 @@ test textWind-16.1 {EmbWinTextStructureProc procedure} {
pack forget .t
update
winfo ismapped .f
-} 0
-pack .t
-test textWind-16.2 {EmbWinTextStructureProc procedure} {
- .t configure -wrap none
- .t delete 1.0 end
+} -cleanup {
+ pack .t
+} -result 0
+test textWind-16.2 {EmbWinTextStructureProc procedure} -setup {
+ .t delete 1.0 end
+ destroy .f .f2
+} -body {
+ .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
+ -wrap none
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.6 -window .f
@@ -842,21 +1261,26 @@ test textWind-16.2 {EmbWinTextStructureProc procedure} {
pack .f2 -before .t
update
lappend result [winfo geom .f] [.t bbox .f]
-} {30x20+47+5 {47 5 30 20} 30x20+47+35 {47 5 30 20}}
-catch {destroy .f2}
-test textWind-16.3 {EmbWinTextStructureProc procedure} {
- .t configure -wrap none
+} -cleanup {
+ destroy .f .f2
+} -result {30x20+47+5 {47 5 30 20} 30x20+47+35 {47 5 30 20}}
+test textWind-16.3 {EmbWinTextStructureProc procedure} -setup {
.t delete 1.0 end
+} -body {
+ .t configure -wrap none
.t insert 1.0 "Some sample text"
.t window create 1.6
update
pack forget .t
update
-} {}
-pack .t
-test textWind-16.4 {EmbWinTextStructureProc procedure} {
- .t configure -wrap none
+} -cleanup {
+ pack .t
+} -result {}
+test textWind-16.4 {EmbWinTextStructureProc procedure} -setup {
.t delete 1.0 end
+} -body {
+ .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
+ -wrap none
.t insert 1.0 "Some sample text"
frame .t.f -width 30 -height 20 -bg $color
.t window create 1.6 -window .t.f
@@ -864,13 +1288,15 @@ test textWind-16.4 {EmbWinTextStructureProc procedure} {
pack forget .t
update
list [winfo ismapped .t.f] [.t bbox .t.f]
-} {1 {47 5 30 20}}
-pack .t
+} -cleanup {
+ pack .t
+} -result {1 {47 5 30 20}}
-test textWind-17.1 {peer widgets and embedded windows} {
- catch {destroy .t .tt}
+
+test textWind-17.1 {peer widgets and embedded windows} -setup {
+ destroy .t .tt .f
+} -body {
pack [text .t]
- .t delete 1.0 end
.t insert end "Line 1"
frame .f -width 20 -height 10 -bg blue
.t window create 1.3 -window .f
@@ -879,12 +1305,12 @@ test textWind-17.1 {peer widgets and embedded windows} {
update ; update
destroy .t .tt
winfo exists .f
-} {0}
+} -result {0}
-test textWind-17.2 {peer widgets and embedded windows} {
- catch {destroy .t .f}
+test textWind-17.2 {peer widgets and embedded windows} -setup {
+ destroy .t .f .tt
+} -body {
pack [text .t]
- .t delete 1.0 end
.t insert end "Line 1\nLine 2"
frame .f -width 20 -height 10 -bg blue
.t window create 1.4 -window .f
@@ -895,10 +1321,11 @@ test textWind-17.2 {peer widgets and embedded windows} {
.tt.t insert 1.0 "foo"
update
destroy .tt
-} {}
+} -result {}
-test textWind-17.3 {peer widget and -create} {
- catch {destroy .t}
+test textWind-17.3 {peer widget and -create} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -908,10 +1335,12 @@ test textWind-17.3 {peer widget and -create} {
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
update
destroy .t .tt
-} {}
+} -result {}
-test textWind-17.4 {peer widget deleted one window shouldn't delete others} {
- catch {destroy .t .tt}
+test textWind-17.4 {peer widget deleted one window shouldn't delete others} -setup {
+ destroy .t .tt
+ set res {}
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -920,14 +1349,16 @@ test textWind-17.4 {peer widget deleted one window shouldn't delete others} {
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
update ; update
destroy .tt
- set res {}
lappend res [.t get 1.2]
update
lappend res [.t get 1.2]
-} {{} {}}
+} -cleanup {
+ destroy .t
+} -result {{} {}}
-test textWind-17.5 {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.5 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -935,13 +1366,14 @@ test textWind-17.5 {peer widget window configuration} {
pack [.t peer create .tt.t]
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
update ; update
- set res [list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]]
+ list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {.t.f .tt.t.f}
+} -result {.t.f .tt.t.f}
-test textWind-17.6 {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.6 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -949,14 +1381,15 @@ test textWind-17.6 {peer widget window configuration} {
pack [.t peer create .tt.t]
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
update ; update
- set res [list [.t window configure 1.2 -window] \
- [.tt.t window configure 1.2 -window]]
+ list [.t window configure 1.2 -window] \
+ [.tt.t window configure 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
+} -result {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
-test textWind-17.7 {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.7 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -964,13 +1397,14 @@ test textWind-17.7 {peer widget window configuration} {
pack [.t peer create .tt.t]
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
update ; update
- set res [list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]]
+ list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {.t.f {}}
+} -result {.t.f {}}
-test textWind-17.8 {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.8 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -978,14 +1412,15 @@ test textWind-17.8 {peer widget window configuration} {
pack [.t peer create .tt.t]
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
update ; update
- set res [list [.t window configure 1.2 -window] \
- [.tt.t window configure 1.2 -window]]
+ list [.t window configure 1.2 -window] \
+ [.tt.t window configure 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {{-window {} {} {} .t.f} {-window {} {} {} {}}}
+} -result {{-window {} {} {} .t.f} {-window {} {} {} {}}}
-test textWind-17.8a {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.9 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -994,14 +1429,14 @@ test textWind-17.8a {peer widget window configuration} {
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
update ; update
.tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red]
- set res [list [.t window configure 1.2 -window] \
- [.tt.t window configure 1.2 -window]]
+ list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
+} -result {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
-test textWind-17.9 {peer widget window configuration} {
- catch {destroy .t .tt}
+test textWind-17.10 {peer widget window configuration} -setup {
+ destroy .t .tt
+} -body {
pack [text .t]
.t delete 1.0 end
.t insert 1.0 "Some sample text"
@@ -1015,15 +1450,14 @@ test textWind-17.9 {peer widget window configuration} {
.tt.t window configure 1.2 -window {}
.t window configure 1.2 -window {}
set res [list [.t window configure 1.2 -window] \
- [.tt.t window configure 1.2 -window]]
+ [.tt.t window configure 1.2 -window]]
update
lappend res [.t window configure 1.2 -window] \
- [.tt.t window configure 1.2 -window]
+ [.tt.t window configure 1.2 -window]
+} -cleanup {
destroy .tt .t
- set res
-} {{-window {} {} {} {}} {-window {} {} {} {}} {-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
+} -result {{-window {} {} {} {}} {-window {} {} {} {}} {-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}
-catch {destroy .t}
option clear
# cleanup
diff --git a/tests/tk.test b/tests/tk.test
index 02b4257..748a6cf 100644
--- a/tests/tk.test
+++ b/tests/tk.test
@@ -5,135 +5,147 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2002 ActiveState Corporation.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
-test tk-1.1 {tk command: general} \
- -body {tk} -returnCodes 1 \
- -result {wrong # args: should be "tk option ?arg?"}
-test tk-1.2 {tk command: general} \
- -body {tk xyz} -returnCodes 1 \
- -result {bad option "xyz": must be appname, caret, scaling, useinputmethods, windowingsystem, or inactive}
+test tk-1.1 {tk command: general} -body {
+ tk
+} -returnCodes error -result {wrong # args: should be "tk subcommand ?arg ...?"}
+test tk-1.2 {tk command: general} -body {
+ tk xyz
+} -returnCodes error -result {unknown or ambiguous subcommand "xyz": must be appname, busy, caret, fontchooser, inactive, scaling, useinputmethods, or windowingsystem}
+# Value stored to restore default settings after 2.* tests
set appname [tk appname]
-test tk-2.1 {tk command: appname} {
- list [catch {tk appname xyz abc} msg] $msg
-} {1 {wrong # args: should be "tk appname ?newName?"}}
-test tk-2.2 {tk command: appname} {
+test tk-2.1 {tk command: appname} -body {
+ tk appname xyz abc
+} -returnCodes error -result {wrong # args: should be "tk appname ?newName?"}
+test tk-2.2 {tk command: appname} -body {
tk appname foobazgarply
-} {foobazgarply}
-test tk-2.3 {tk command: appname} unix {
+} -result {foobazgarply}
+test tk-2.3 {tk command: appname} -constraints unix -body {
tk appname bazfoogarply
expr {[lsearch -exact [winfo interps] [tk appname]] >= 0}
-} {1}
-test tk-2.4 {tk command: appname} {
- tk appname $appname
-} $appname
+} -result {1}
+test tk-2.4 {tk command: appname} -body {
+ tk appname [tk appname]
+} -result [tk appname]
tk appname $appname
+# Value stored to restore default settings after 3.* tests
set scaling [tk scaling]
-test tk-3.1 {tk command: scaling} {
- list [catch {tk scaling -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test tk-3.2 {tk command: scaling: get current} {
+test tk-3.1 {tk command: scaling} -body {
+ tk scaling -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test tk-3.2 {tk command: scaling: get current} -body {
tk scaling 1
format %.2g [tk scaling]
-} 1
-test tk-3.3 {tk command: scaling: get current} {
+} -result 1
+test tk-3.3 {tk command: scaling: get current} -body {
tk scaling -displayof . 1.25
format %.3g [tk scaling]
-} 1.25
-test tk-3.4 {tk command: scaling: set new} {
- list [catch {tk scaling xyz} msg] $msg
-} {1 {expected floating-point number but got "xyz"}}
-test tk-3.5 {tk command: scaling: set new} {
- list [catch {tk scaling -displayof . xyz} msg] $msg
-} {1 {expected floating-point number but got "xyz"}}
-test tk-3.6 {tk command: scaling: set new} {
+} -result 1.25
+test tk-3.4 {tk command: scaling: set new} -body {
+ tk scaling xyz
+} -returnCodes error -result {expected floating-point number but got "xyz"}
+test tk-3.5 {tk command: scaling: set new} -body {
+ tk scaling -displayof . xyz
+} -returnCodes error -result {expected floating-point number but got "xyz"}
+test tk-3.6 {tk command: scaling: set new} -body {
tk scaling 1
format %.2g [tk scaling]
-} 1
-test tk-3.7 {tk command: scaling: set new} {
+} -result 1
+test tk-3.7 {tk command: scaling: set new} -body {
tk scaling -displayof . 1.25
format %.3g [tk scaling]
-} 1.25
-test tk-3.8 {tk command: scaling: negative} {
+} -result 1.25
+test tk-3.8 {tk command: scaling: negative} -body {
tk scaling -1
expr {[tk scaling] > 0}
-} {1}
-test tk-3.9 {tk command: scaling: too big} {
+} -result {1}
+test tk-3.9 {tk command: scaling: too big} -body {
tk scaling 1000000
expr {[tk scaling] < 10000}
-} {1}
-test tk-3.10 {tk command: scaling: widthmm} {
+} -result {1}
+test tk-3.10 {tk command: scaling: widthmm} -body {
tk scaling 1.25
- expr {int((25.4*[winfo screenwidth .])/(72*1.25)+0.5)-[winfo screenmmwidth .]}
-} {0}
-test tk-3.11 {tk command: scaling: heightmm} {
+ expr {int((25.4*[winfo screenwidth .])/(72*1.25) + 0.5) \
+ - [winfo screenmmwidth .]}
+} -result {0}
+test tk-3.11 {tk command: scaling: heightmm} -body {
tk scaling 1.25
- expr {int((25.4*[winfo screenheight .])/(72*1.25)+0.5)-[winfo screenmmheight .]}
-} {0}
+ expr {int((25.4*[winfo screenheight .])/(72*1.25) + 0.5) \
+ - [winfo screenmmheight .]}
+} -result {0}
tk scaling $scaling
+# Value stored to restore default settings after 4.* tests
set useim [tk useinputmethods]
-test tk-4.1 {tk command: useinputmethods} {
- list [catch {tk useinputmethods -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
-test tk-4.2 {tk command: useinputmethods: get current} {
+test tk-4.1 {tk command: useinputmethods} -body {
+ tk useinputmethods -displayof
+} -returnCodes error -result {value for "-displayof" missing}
+test tk-4.2 {tk command: useinputmethods: get current} -body {
+ tk useinputmethods no
+} -cleanup {
+ tk useinputmethods $useim
+} -result 0
+test tk-4.3 {tk command: useinputmethods: get current} -body {
tk useinputmethods no
-} 0
-test tk-4.3 {tk command: useinputmethods: get current} {
tk useinputmethods -displayof .
-} 0
-test tk-4.4 {tk command: useinputmethods: set new} {
- list [catch {tk useinputmethods xyz} msg] $msg
-} {1 {expected boolean value but got "xyz"}}
-test tk-4.5 {tk command: useinputmethods: set new} {
- list [catch {tk useinputmethods -displayof . xyz} msg] $msg
-} {1 {expected boolean value but got "xyz"}}
-test tk-4.6 {tk command: useinputmethods: set new} unix {
- # This isn't really a test, but more of a check...
- # The answer is what was given, because we may be on a Unix
- # system that doesn't have the XIM stuff
+} -cleanup {
+ tk useinputmethods $useim
+} -result 0
+test tk-4.4 {tk command: useinputmethods: set new} -body {
+ tk useinputmethods xyz
+} -returnCodes error -result {expected boolean value but got "xyz"}
+test tk-4.5 {tk command: useinputmethods: set new} -body {
+ tk useinputmethods -displayof . xyz
+} -returnCodes error -result {expected boolean value but got "xyz"}
+test tk-4.6 {tk command: useinputmethods: set new} -body {
+ # This isn't really a test, but more of a check... The answer is what was
+ # given, because we may be on a Unix system that doesn't have the XIM
+ # stuff
if {[tk useinputmethods 1] == 0} {
puts "this wish doesn't have XIM (X Input Methods) support"
}
- set useim
-} $useim
-test tk-4.7 {tk command: useinputmethods: set new} win {
- # Mac and Windows don't have X Input Methods, so this should
- # always return 0
+ return $useim
+} -result $useim
+test tk-4.7 {tk command: useinputmethods: set new} -constraints win -body {
+ # Mac and Windows don't have X Input Methods, so this should always return
+ # 0
tk useinputmethods 1
-} 0
-tk useinputmethods $useim
+} -cleanup {
+ tk useinputmethods $useim
+} -result 0
-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}
+test tk-5.1 {tk caret} -body {
+ tk caret
+} -returnCodes error -result {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}
+test tk-5.2 {tk caret} -body {
+ tk caret bogus
+} -returnCodes error -result {bad window path name "bogus"}
+test tk-5.3 {tk caret} -body {
+ tk caret . -foo
+} -returnCodes error -result {bad caret option "-foo": must be -x, -y, or -height}
+test tk-5.4 {tk caret} -body {
+ tk caret . -x 0 -y
+} -returnCodes error -result {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}
+test tk-5.5 {tk caret} -body {
+ tk caret . -x 10 -y 11 -h 12; tk caret .
+} -result {-height 12 -x 10 -y 11}
+test tk-5.6 {tk caret} -body {
+ tk caret . -x 20 -y 25 -h 30; tk caret . -hei
+} -result {30}
# tk inactive
test tk-6.1 {tk inactive} -body {
string is integer [tk inactive]
} -result 1
test tk-6.2 {tk inactive reset} -body {
- catch {tk inactive reset}
-} -result 0
+ tk inactive reset
+} -returnCodes ok -match glob -result *
test tk-6.3 {tk inactive wrong argument} -body {
tk inactive foo
} -returnCodes 1 -result {bad option "foo": must be reset}
@@ -148,16 +160,24 @@ test tk-6.5 {tk inactive} -body {
expr {$i == -1 || ( $i > 90 && $i < 200 )}
} -result 1
-# tk inactive in safe interpreters
-safe::interpCreate foo
-safe::loadTk foo
test tk-7.1 {tk inactive in a safe interpreter} -body {
+# tk inactive in safe interpreters
+ safe::interpCreate foo
+ safe::loadTk foo
foo eval {tk inactive}
+} -cleanup {
+ ::safe::interpDelete foo
} -result -1
test tk-7.2 {tk inactive reset in a safe interpreter} -body {
+# tk inactive in safe interpreters
+ safe::interpCreate foo
+ safe::loadTk foo
foo eval {tk inactive reset}
+} -cleanup {
+ ::safe::interpDelete foo
} -returnCodes 1 -result {resetting the user inactivity timer is not allowed in a safe interpreter}
-::safe::interpDelete foo
+
+# tests of [tk busy] in busy.test
# cleanup
cleanupTests
diff --git a/tests/unixButton.test b/tests/unixButton.test
index a51e259..137ef33 100644
--- a/tests/unixButton.test
+++ b/tests/unixButton.test
@@ -8,9 +8,11 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
+imageInit
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -32,19 +34,14 @@ option add *Radiobutton.font {Helvetica -12 bold}
proc bogusTrace args {
error "trace aborted"
}
-catch {unset value}
-catch {unset value2}
-eval image delete [image names]
-label .l -text Label
-button .b -text Button
-checkbutton .c -text Checkbutton
-radiobutton .r -text Radiobutton
-pack .l .b .c .r
-update
-test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {unix testImageType} {
+test unixbutton-1.1 {TkpComputeButtonGeometry procedure} -constraints {
+ unix testImageType
+} -setup {
deleteWindows
+ imageCleanup
+} -body {
image create test image1
image1 changed 0 0 0 0 60 40
label .b1 -image image1 -bd 4 -padx 0 -pady 2
@@ -54,12 +51,18 @@ test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {unix testImageType} {
pack .b1 .b2 .b3 .b4
update
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 74 54 112 52 112 52}
-test unixbutton-1.2 {TkpComputeButtonGeometry procedure} unix {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+ image delete image1
+} -result {68 48 74 54 112 52 112 52}
+test unixbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
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
@@ -67,27 +70,37 @@ test unixbutton-1.2 {TkpComputeButtonGeometry procedure} unix {
pack .b1 .b2 .b3 .b4
update
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 29 39 54 37 54 37}
-test unixbutton-1.3 {TkpComputeButtonGeometry procedure} unix {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {23 33 29 39 54 37 54 37}
+test unixbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints {
+ unix
+} -setup {
deleteWindows
+} -body {
label .b1 -bitmap question -bd 3 -highlightthickness 4
button .b2 -bitmap question -bd 3 -highlightthickness 0
checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
- -indicatoron 0
+ -indicatoron 0
radiobutton .b4 -bitmap question -bd 3 -highlightthickness 1 \
- -indicatoron false
+ -indicatoron false
pack .b1 .b2 .b3 .b4
update
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 25 35 25 35 25 35}
-test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+} -result {31 41 25 35 25 35 25 35}
+test unixbutton-1.4 {TkpComputeButtonGeometry procedure} -constraints {
+ unix nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
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}
@@ -95,26 +108,41 @@ test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts
pack .b1 .b2 .b3 .b4
update
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]
-} {82 29 88 35 114 31 121 29}
-test unixbutton-1.5 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {82 29 88 35 114 31 121 29}
+test unixbutton-1.5 {TkpComputeButtonGeometry procedure} -constraints {
+ unix nonPortable fonts
+} -setup {
deleteWindows
+} -body {
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} {unix nonPortable fonts} {
+} -cleanup {
deleteWindows
+} -result {136 88}
+test unixbutton-1.6 {TkpComputeButtonGeometry procedure} -constraints {
+ unix nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
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} {unix nonPortable fonts} {
+} -cleanup {
+ deleteWindows
+} -result {231 46}
+test unixbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints {
+ unix nonPortable fonts
+} -setup {
deleteWindows
+} -body {
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
@@ -122,73 +150,106 @@ test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts
pack .b1 .b2 .b3 .b4
update
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]
-} {74 22 60 84 168 38 61 22}
-test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+} -result {74 22 60 84 168 38 61 22}
+test unixbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints {
+ unix nonPortable fonts
+} -setup {
+ deleteWindows
+} -body {
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
- -highlightthickness 4
+ -highlightthickness 4
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
- -highlightthickness 0
+ -highlightthickness 0
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 \
- -highlightthickness 1 -indicatoron no
+ -highlightthickness 1 -indicatoron no
radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -indicatoron 0
pack .b1 .b2 .b3 .b4
update
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]
-} {62 30 56 24 58 22 62 22}
-test unixbutton-1.9 {TkpComputeButtonGeometry procedure} unix {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {62 30 56 24 58 22 62 22}
+test unixbutton-1.9 {TkpComputeButtonGeometry procedure} -constraints {
+ unix
+} -setup {
deleteWindows
+} -body {
button .b2 -bitmap question -default active
list [winfo reqwidth .b2] [winfo reqheight .b2]
-} {37 47}
-test unixbutton-1.10 {TkpComputeButtonGeometry procedure} unix {
+} -cleanup {
deleteWindows
+} -result {37 47}
+test unixbutton-1.10 {TkpComputeButtonGeometry procedure} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
button .b2 -bitmap question -default normal
list [winfo reqwidth .b2] [winfo reqheight .b2]
-} {37 47}
-test unixbutton-1.11 {TkpComputeButtonGeometry procedure} unix {
+} -cleanup {
+ deleteWindows
+} -result {37 47}
+test unixbutton-1.11 {TkpComputeButtonGeometry procedure} -constraints {
+ unix
+} -setup {
deleteWindows
+} -body {
button .b2 -bitmap question -default disabled
list [winfo reqwidth .b2] [winfo reqheight .b2]
-} {27 37}
+} -cleanup {
+ deleteWindows
+} -result {27 37}
-test unixbutton-2.1 {disabled coloring check, bug 669595} unix {
- # this was just a visual bug, but at least this shows the visual
+
+test unixbutton-2.1 {disabled coloring check, bug 669595} -constraints {
+ unix
+} -setup {
deleteWindows
+ catch {unset value}
+} -body {
+ # this was just a visual bug, but at least this shows the visual
set on 1
set off 0
label .l -text "The following widgets should\
- \nshow significant visible diffs\
- \nfor selected vs unselected."
+ \nshow significant visible diffs\
+ \nfor selected vs unselected."
checkbutton .cb0 -anchor w -state disabled \
- -text Unselected -variable off
+ -text Unselected -variable off
checkbutton .cb1 -anchor w -state disabled \
- -text Selected -variable on
+ -text Selected -variable on
checkbutton .cb2 -anchor w -state disabled \
- -text Unselected -variable off -disabledforeground ""
+ -text Unselected -variable off -disabledforeground ""
checkbutton .cb3 -anchor w -state disabled \
- -text Selected -variable on -disabledforeground ""
+ -text Selected -variable on -disabledforeground ""
radiobutton .rb0 -anchor w -state disabled \
- -text Unselected -variable off
+ -text Unselected -variable off
radiobutton .rb1 -anchor w -state disabled \
- -text Selected -variable on -value 1
+ -text Selected -variable on -value 1
radiobutton .rb2 -anchor w -state disabled \
- -text Unselected -variable off -disabledforeground ""
+ -text Unselected -variable off -disabledforeground ""
radiobutton .rb3 -anchor w -state disabled \
- -text Selected -variable on -value 1 -disabledforeground ""
+ -text Selected -variable on -value 1 -disabledforeground ""
pack .l .cb0 .cb1 .cb2 .cb3 .rb0 .rb1 .rb2 .rb3 -side top -fill x
after 400
set on
-} 1
+} -cleanup {
+ deleteWindows
+} -result 1
-deleteWindows
# cleanup
+imageFinish
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index 1e8f03b..8aaa3c4 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -6,9 +6,10 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
setupbg
dobg {wm withdraw .}
@@ -53,41 +54,53 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
&& ([lindex $vals 2]/256 == $blue)
}
-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} 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} {unix nonPortable} {
- catch {destroy .t}
- catch {destroy .x}
+test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -use xyz
+} -returnCodes error -result {expected integer but got "xyz"}
+test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t -use 47
+} -returnCodes error -result {couldn't create child of window "47"}
+test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints {
+ unix nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -colormap new
wm geometry .t +0+0
eatColors .t.t
frame .t.f -container 1
toplevel .x -use [winfo id .t.f]
- set result [colorsFree .x]
- destroy .t
- set result
-} {0}
-test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} {unix nonPortable} {
- catch {destroy .t}
- catch {destroy .t2}
- catch {destroy .x}
+ colorsFree .x
+} -cleanup {
+ deleteWindows
+} -result {0}
+test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints {
+ unix nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t -container 1 -colormap new
wm geometry .t +0+0
eatColors .t2
toplevel .x -use [winfo id .t]
- set result [colorsFree .x]
- destroy .t
- set result
-} {1}
+ colorsFree .x
+} -cleanup {
+ deleteWindows
+} -result {1}
-test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {unix testembed} {
- deleteWindows
+test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -97,74 +110,103 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {unix te
toplevel .t -use $w
list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w]
}
-} {{{XXX {} {} .t}} 0}
-test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {unix testembed} {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {{{XXX {} {} .t}} 0}
+test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
dobg "set w1 [winfo id .f1]"
dobg "set w2 [winfo id .f2]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- toplevel .t2 -use $w2
- testembed
- }
-} {{XXX {} {} .t2} {XXX {} {} .t1}}
-test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} {unix testembed} {
- deleteWindows
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ toplevel .t2 -use $w2
+ testembed
+ }
+} -cleanup {
+ deleteWindows
+} -result {{XXX {} {} .t2} {XXX {} {} .t1}}
+test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
toplevel .t1 -use [winfo id .f1]
toplevel .t2 -use [winfo id .f2]
testembed
-} {{XXX .f2 {} .t2} {XXX .f1 {} .t1}}
+} -cleanup {
+ deleteWindows
+} -result {{XXX .f2 {} .t2} {XXX .f1 {} .t1}}
# Can't think of any way to test the procedures TkpMakeWindow,
# TkpMakeContainer, or EmbedErrorProc.
-test unixEmbed-2.1 {EmbeddedEventProc procedure} {unix testembed} {
- deleteWindows
+
+test unixEmbed-2.1 {EmbeddedEventProc procedure} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- testembed
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ testembed
}
destroy .f1
update
dobg {
- testembed
+ testembed
}
-} {}
-test unixEmbed-2.2 {EmbeddedEventProc procedure} {unix testembed} {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {}
+test unixEmbed-2.2 {EmbeddedEventProc procedure} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- testembed
- destroy .t1
- testembed
- }
-} {}
-test unixEmbed-2.3 {EmbeddedEventProc procedure} {unix testembed} {
- deleteWindows
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ testembed
+ destroy .t1
+ testembed
+ }
+} -cleanup {
+ deleteWindows
+} -result {}
+test unixEmbed-2.3 {EmbeddedEventProc procedure} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
update
destroy .f1
testembed
-} {}
-test unixEmbed-2.4 {EmbeddedEventProc procedure} {unix testembed} {
- deleteWindows
+} -result {}
+test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -173,166 +215,221 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} {unix testembed} {
set x [testembed]
update
list $x [testembed]
-} {{{XXX .f1 {} {}}} {}}
+} -cleanup {
+ deleteWindows
+} -result {{{XXX .f1 {} {}}} {}}
-test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} \
- {unix testembed nonPortable} {
- deleteWindows
+
+test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} -constraints {
+ unix testembed nonPortable
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
set x [testembed]
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- wm withdraw .t1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ wm withdraw .t1
}
list $x [testembed]
-} {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}}
-test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}}
+test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
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.2a {ContainerEventProc procedure, disallow position changes} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {200x200+0+0}
+test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -bd 2 -relief raised
- update
- wm geometry .t1 +30+40
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -bd 2 -relief raised
+ update
+ wm geometry .t1 +30+40
}
update
dobg {
- wm geometry .t1
+ wm geometry .t1
}
-} {200x200+0+0}
-test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {200x200+0+0}
+test unixEmbed-3.4 {ContainerEventProc procedure, disallow position changes} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- update
- wm geometry .t1 300x100+30+40
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ update
+ wm geometry .t1 300x100+30+40
}
update
dobg {
- wm geometry .t1
+ wm geometry .t1
}
-} {300x100+0+0}
-test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {300x100+0+0}
+test unixEmbed-3.5 {ContainerEventProc procedure, geometry requests} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- .t1 configure -width 300 -height 80
+ .t1 configure -width 300 -height 80
}
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} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {300 80 300x80+0+0}
+test unixEmbed-3.6 {ContainerEventProc procedure, map requests} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- set x unmapped
- bind .t1 <Map> {set x mapped}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ set x unmapped
+ bind .t1 <Map> {set x mapped}
}
update
dobg {
- after 100
- update
- set x
+ after 100
+ update
+ set x
}
-} {mapped}
-test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {mapped}
+test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
bind .f1 <Destroy> {set x dead}
set x alive
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- destroy .t1
+ destroy .t1
}
update
list $x [winfo exists .f1]
-} {dead 0}
+} -cleanup {
+ deleteWindows
+} -result {dead 0}
-test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} unix {
- deleteWindows
+
+test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- .t1 configure -width 180 -height 100
+ .t1 configure -width 180 -height 100
}
update
dobg {
- winfo geometry .t1
+ winfo geometry .t1
}
-} {180x100+0+0}
-test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {unix testembed} {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {180x100+0+0}
+test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
set x [testembed]
destroy .f1
list $x [testembed]
-} {{{XXX .f1 XXX {}}} {}}
+} -cleanup {
+ deleteWindows
+} -result {{{XXX .f1 XXX {}}} {}}
-test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} unix {
- deleteWindows
+
+test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- bind .t1 <FocusIn> {lappend x "focus in %W"}
- bind .t1 <FocusOut> {lappend x "focus out %W"}
- set x {}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ bind .t1 <FocusIn> {lappend x "focus in %W"}
+ bind .t1 <FocusOut> {lappend x "focus out %W"}
+ set x {}
}
focus -force .f1
update
dobg {set x}
-} {{focus in .t1}}
-test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {{focus in .t1}}
+test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -342,23 +439,28 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} unix {
}
update
dobg {
- after 200 {destroy .t1}
+ after 200 {destroy .t1}
}
after 400
focus -force .f1
update
-} {}
-test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {}
+test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- bind .t1 <FocusIn> {lappend x "focus in %W"}
- bind .t1 <FocusOut> {lappend x "focus out %W"}
- set x {}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ bind .t1 <FocusIn> {lappend x "focus in %W"}
+ bind .t1 <FocusOut> {lappend x "focus out %W"}
+ set x {}
}
focus -force .f1
update
@@ -366,79 +468,102 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} unix {
focus .
update
list $x [dobg {update; set x}]
-} {{{focus in .t1}} {{focus in .t1} {focus out .t1}}}
+} -cleanup {
+ deleteWindows
+} -result {{{focus in .t1}} {{focus in .t1} {focus out .t1}}}
-test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} unix {
- deleteWindows
+
+test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
- set x {}
- .t1 configure -width 300 -height 120
- update
- list $x [winfo geom .t1]
+ bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
+ set x {}
+ .t1 configure -width 300 -height 120
+ update
+ list $x [winfo geom .t1]
}
-} {{{configure .t1 300 120}} 300x120+0+0}
-test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {{{configure .t1 300 120}} 300x120+0+0}
+test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
place .f1 -width 200 -height 200
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
after 300 {set x done}
vwait x
dobg {
- bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
- set x {}
- .t1 configure -width 300 -height 120
- update
- list $x [winfo geom .t1]
+ bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
+ set x {}
+ .t1 configure -width 300 -height 120
+ update
+ list $x [winfo geom .t1]
}
-} {{{configure .t1 200 200}} 200x200+0+0}
+} -cleanup {
+ deleteWindows
+} -result {{{configure .t1 200 200}} 200x200+0+0}
# Can't think up any tests for TkpGetOtherWindow procedure.
-test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} unix {
+
+test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
focus -force .
bind . <KeyPress> {lappend x {key %A %E}}
set x {}
set y [dobg {
- update
- bind .t1 <KeyPress> {lappend y {key %A}}
- set y {}
- event generate .t1 <KeyPress> -keysym a
- set y
+ update
+ bind .t1 <KeyPress> {lappend y {key %A}}
+ set y {}
+ event generate .t1 <KeyPress> -keysym a
+ set y
}]
update
- bind . <KeyPress> {}
list $x $y
-} {{{key a 1}} {}}
-test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+ bind . <KeyPress> {}
+} -result {{{key a 1}} {}}
+test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
focus -force .f1
@@ -446,41 +571,49 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
bind . <KeyPress> {lappend x {key %A}}
set x {}
set y [dobg {
- update
- bind .t1 <KeyPress> {lappend y {key %A}}
- set y {}
- event generate .t1 <KeyPress> -keysym b
- set y
+ update
+ bind .t1 <KeyPress> {lappend y {key %A}}
+ set y {}
+ event generate .t1 <KeyPress> -keysym b
+ set y
}]
update
- bind . <KeyPress> {}
list $x $y
-} {{} {{key b}}}
+} -cleanup {
+ deleteWindows
+ bind . <KeyPress> {}
+} -result {{} {{key b}}}
-test unixEmbed-8.1 {TkpClaimFocus procedure} unix {
- deleteWindows
+
+test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints unix -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
}
focus -force .f2
update
list [dobg {
- focus .t1
- set x [list [focus]]
- update
- after 500
- update
- lappend x [focus]
+ focus .t1
+ set x [list [focus]]
+ update
+ after 500
+ update
+ lappend x [focus]
}] [focus]
-} {{{} .t1} .f1}
-test unixEmbed-8.2 {TkpClaimFocus procedure} unix {
+} -cleanup {
+ deleteWindows
+} -result {{{} .t1} .f1}
+test unixEmbed-8.2 {TkpClaimFocus procedure} -constraints unix -setup {
+ deleteWindows
catch {interp delete child}
deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
@@ -488,21 +621,27 @@ test unixEmbed-8.2 {TkpClaimFocus procedure} unix {
child eval "set argv {-use [winfo id .f1]}"
load {} Tk child
child eval {
- . configure -bd 2 -highlightthickness 2 -relief sunken
+ . configure -bd 2 -highlightthickness 2 -relief sunken
}
focus -force .f2
update
list [child eval {
- focus .
- set x [list [focus]]
- update
- lappend x [focus]
+ focus .
+ set x [list [focus]]
+ update
+ lappend x [focus]
}] [focus]
-} {{{} .} .f1}
+} -cleanup {
+ deleteWindows
+} -result {{{} .} .f1}
catch {interp delete child}
-test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {unix testembed} {
- deleteWindows
+
+test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
frame .f3 -container 1 -width 200 -height 50
@@ -511,28 +650,39 @@ test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {unix testemb
set x {}
lappend x [testembed]
foreach w {.f3 .f4 .f1 .f2} {
- destroy $w
- lappend x [testembed]
+ destroy $w
+ lappend x [testembed]
}
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} {unix testembed} {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {{{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} -constraints {
+ unix testembed
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
- set x {}
- lappend x [testembed]
- destroy .t1
- lappend x [testembed]
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
+ set x {}
+ lappend x [testembed]
+ destroy .t1
+ lappend x [testembed]
}
-} {{{XXX {} {} .t1}} {}}
+} -cleanup {
+ deleteWindows
+} -result {{{XXX {} {} .t1}} {}}
-test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
- deleteWindows
+
+test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -540,9 +690,14 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix
wm geometry .t1 +40+50
update
wm geometry .t1
-} {150x80+0+0}
-test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
- deleteWindows
+} -cleanup {
+ deleteWindows
+} -result {150x80+0+0}
+test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
+ unix
+} -setup {
+ deleteWindows
+} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -550,10 +705,13 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix
wm geometry .t1 70x300+10+20
update
wm geometry .t1
-} {70x300+0+0}
+} -cleanup {
+ deleteWindows
+} -result {70x300+0+0}
# cleanup
deleteWindows
cleanupbg
cleanupTests
return
+
diff --git a/tests/unixMenu.test b/tests/unixMenu.test
index 802a7c2..3d655e4 100644
--- a/tests/unixMenu.test
+++ b/tests/unixMenu.test
@@ -7,474 +7,648 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-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} unix {
- catch {destroy .m1}
+
+test unixMenu-1.1 {TkpNewMenu - normal menu} -constraints unix -setup {
+ destroy .m1
+} -body {
+ list [menu .m1] [destroy .m1]
+} -returnCodes ok -result {.m1 {}}
+test unixMenu-1.2 {TkpNewMenu - help menu} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
. configure -menu .m1
.m1 add cascade -label Help -menu .m1.help
- list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 .m1.help {} {}}
+ list [menu .m1.help] [. configure -menu ""] [destroy .m1]
+} -returnCodes ok -result {.m1.help {} {}}
+
+
+test unixMenu-2.1 {TkpDestroyMenu - nothing to do} -constraints unix -body {}
-test unixMenu-2.1 {TkpDestroyMenu - nothing to do} {} {}
-test unixMenu-3.1 {TkpDestroymenuEntry - nothing to do} {} {}
-test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} unix {
- catch {destroy .m1}
+test unixMenu-3.1 {TkpDestroymenuEntry - nothing to do} -constraints unix -body {}
+
+
+test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [.m1 entryconfigure test -label foo] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -menu .m2 -label test
menu .m1.foo -tearoff 0
- list [catch {.m1 entryconfigure test -menu .m1.foo} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [.m1 entryconfigure test -menu .m1.foo] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+
-test unixMenu-5.1 {TkpMenuNewEntry - nothing to do} {} {}
+test unixMenu-5.1 {TkpMenuNewEntry - nothing to do} -constraints unix -body {}
-test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} unix {
- catch {destroy .m1}
+
+test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} -constraints unix -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [. configure -menu ""] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test unixMenu-6.2 {TkpSetWindowMenuBar - menu} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
- list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [. configure -menu .m1] [. configure -menu ""] [destroy .m1]
+} -returnCodes ok -result {{} {} {}}
+
+
+test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} -constraints unix -body {}
-test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} {} {}
-test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} unix {
- catch {destroy .m1}
+test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} {unix testImageType} {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} -constraints {
+ unix testImageType
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
menu .m1
image create test image1
.m1 add checkbutton -image image1 -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
-} {0 {} {}}
-test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -cleanup {
+ image delete image1
+} -returnCodes ok
+test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -bitmap questhead -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} {unix testImageType} {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} -constraints {
+ unix testImageType
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
menu .m1
image create test image1
.m1 add radiobutton -image image1 -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
-} {0 {} {}}
-test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+ image delete image1
+} -returnCodes ok
+test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -bitmap questhead -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo -hidemargin 1
.m1 invoke foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
-test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} unix {
- catch {destroy .m1}
+
+test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -accel "Ctrl+S"
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test unixMenu-9.3 {GetMenuAccelGeometry - null label} unix {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test unixMenu-9.3 {GetMenuAccelGeometry - null label} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+
-test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} unix {
- catch {destroy .m1}
+test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
. configure -menu .m1
.m1 activate 1
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-10.2 {DrawMenuEntryBackground - active} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -returnCodes ok -result {{} {} {}}
+test unixMenu-10.2 {DrawMenuEntryBackground - active} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
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} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+test unixMenu-10.3 {DrawMenuEntryBackground - non-active} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -returnCodes ok -result {{} {}}
+
-test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} unix {
- catch {destroy .m1}
+test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
. configure -menu .m1
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
# drawArrow parameter is never false under Unix
-test unixMenu-11.2 {DrawMenuEntryAccelerator - cascade entry} unix {
- catch {destroy .m1}
+test unixMenu-11.2 {DrawMenuEntryAccelerator - cascade entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
+
-test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} unix {
- catch {destroy .m1}
+test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo -indicatoron 0
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
-test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} unix {
- catch {destroy .m1}
+ list [update] [destroy .m1]
+} -result {{} {}}
+test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
+
-test unixMenu-13.1 {DrawMenuSeparator - menubar case} unix {
- catch {destroy .m1}
+test unixMenu-13.1 {DrawMenuSeparator - menubar case} -constraints unix -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-13.2 {DrawMenuSepartor - normal menu} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
+
-test unixMenu-14.1 {DrawMenuEntryLabel} unix {
- catch {destroy .m1}
+test unixMenu-14.1 {DrawMenuEntryLabel} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
-test unixMenu-15.1 {DrawMenuUnderline - menubar} unix {
- catch {destroy .m1}
+
+test unixMenu-15.1 {DrawMenuUnderline - menubar} -constraints unix -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-15.2 {DrawMenuUnderline - no menubar} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -underline 0
set tearoff [tk::TearOffMenu .m1 40 40]
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
+
-test unixMenu-16.1 {TkpPostMenu} unix {
- catch {destroy .m1}
+test unixMenu-16.1 {TkpPostMenu} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
-test unixMenu-17.1 {GetMenuSeparatorGeometry} unix {
- catch {destroy .m1}
+
+test unixMenu-17.1 {GetMenuSeparatorGeometry} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+
-test unixMenu-18.1 {GetTearoffEntryGeometry} {unix nonUnixUserInteraction} {
- catch {destroy .m1}
+test unixMenu-18.1 {GetTearoffEntryGeometry} -constraints {
+ unix nonUnixUserInteraction
+} -setup {
+ destroy .mb
+} -body {
menubutton .mb -text "test" -menu .mb.m
menu .mb.m
.mb.m add command -label test
pack .mb
raise .
- list [catch {tk::MbPost .mb} msg] $msg [tk::MenuUnpost .mb.m] [destroy .mb]
-} {0 {} {} {}}
+ list [tk::MbPost .mb] [tk::MenuUnpost .mb.m] [destroy .mb]
+} -result {{} {} {}}
+
# Don't know how to reproduce the case where the tkwin has been deleted.
-test unixMenu-19.1 {TkpComputeMenubarGeometry - zero entries} unix {
- catch {destroy .m1}
+
+test unixMenu-19.1 {TkpComputeMenubarGeometry - zero entries} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
. configure -menu .m1
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
# Don't know how to generate one width windows
-test unixMenu-19.2 {TkpComputeMenubarGeometry - one entry} unix {
- catch {destroy .m1}
+test unixMenu-19.2 {TkpComputeMenubarGeometry - one entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.3 {TkpComputeMenubarGeometry - entry with different font} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.4 {TkpComputeMenubarGeometry - separator} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.5 {TkpComputeMenubarGeometry - First entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.6 {TkpComputeMenubarGeometry - First entry too wide} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File -font "Times 72"
. configure -menu .m1
wm geometry . 10x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File
.m1 add cascade -label Edit
. configure -menu .m1
wm geometry . 200x200
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File
.m1 add cascade -label Edit -font "Times 72"
. configure -menu .m1
wm geometry . 100x100
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File -font "Times 72"
.m1 add cascade -label Edit
. configure -menu .m1
wm geometry . 100x100
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0 -font "Times 72"
.m1 add cascade -label File
.m1 add cascade -label Edit
. configure -menu .m1
wm geometry . 10x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
# 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} unix {
- catch {destroy .m1}
+test unixMenu-19.11 {TkpComputeMenubarGeometry - abc} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0 -font "Times 72"
.m1 add cascade -label "aaaaa"
.m1 add cascade -label "bbbbb"
.m1 add cascade -label "ccccc"
. configure -menu .m1
wm geometry . 10x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
.m1 add cascade -label "bbbbb" -font "Times 72"
.m1 add cascade -label "C"
. configure -menu .m1
wm geometry . 10x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
.m1 add cascade -label "B"
.m1 add cascade -label "ccccc" -font "Times 72"
. configure -menu .m1
wm geometry . 10x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
.m1 add cascade -label "B"
.m1 add cascade -label "C"
. configure -menu .m1
wm geometry . 60x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "A"
.m1 add cascade -label "bbbbb" -font "Times 72"
.m1 add cascade -label "ccccc" -font "Times 72"
. configure -menu .m1
wm geometry . 60x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "A"
.m1 add cascade -label "bbbbb" -font "Times 72"
.m1 add cascade -label "C"
. configure -menu .m1
wm geometry . 60x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "A"
.m1 add cascade -label "B"
.m1 add cascade -label "ccccc" -font "Times 72"
. configure -menu .m1
wm geometry . 60x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label "A"
.m1 add cascade -label "B"
.m1 add cascade -label "C"
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label Help -menu .m1.help
menu .m1.help -tearoff 0
@@ -484,10 +658,13 @@ test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} un
menu .m1.edit -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label Edit -menu .m1.edit
menu .m1.edit -tearoff 0
@@ -497,10 +674,13 @@ test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} unix {
menu .m1.file -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
menu .m1.file -tearoff 0
@@ -510,10 +690,13 @@ test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} un
menu .m1.help -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
menu .m1.file -tearoff 0
@@ -521,10 +704,13 @@ test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} unix {
menu .m1.help -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
menu .m1.file -tearoff 0
@@ -532,215 +718,283 @@ test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} unix {
menu .m1.help -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} unix {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label Help -menu .m1.help
menu .m1.help -tearoff 0
. configure -menu .m1
wm geometry . 100x10
- list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+
-test unixMenu-20.1 {DrawTearoffEntry - menubar} unix {
- catch {destroy .m1}
+test unixMenu-20.1 {DrawTearoffEntry - menubar} -constraints unix -setup {
+ destroy .m1
+} -body {
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} {unix nonUnixUserInteraction} {
- catch {destroy .m1}
+ list [update] [. configure -menu ""] [destroy .m1]
+} -result {{} {} {}}
+test unixMenu-20.2 {DrawTearoffEntry - non-menubar} -constraints {
+ unix nonUnixUserInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
.m1 post 40 40
- list [catch {update} msg] $msg [destroy .m1]
-} {0 {} {}}
+ list [update] [destroy .m1]
+} -result {{} {}}
-test unixMenu-21.1 {TkpInitializeMenuBindings - nothing to do} {} {}
-test unixMenu-22.1 {SetHelpMenu - no menubars} unix {
- catch {destroy .m1}
+test unixMenu-21.1 {TkpInitializeMenuBindings - nothing to do} -constraints unix -body {}
+
+
+test unixMenu-22.1 {SetHelpMenu - no menubars} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label test -menu .m1.test
- list [catch {menu .m1.test} msg] $msg [destroy .m1]
-} {0 .m1.test {}}
+ list [menu .m1.test] [destroy .m1]
+} -result {.m1.test {}}
# Don't know how to automate missing tkwins
-test unixMenu-22.2 {SetHelpMenu - menubar but no help menu} unix {
- catch {destroy .m1}
+test unixMenu-22.2 {SetHelpMenu - menubar but no help menu} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+ list [menu .m1.file] [. configure -menu ""] [destroy .m1]
+} -result {.m1.file {} {}}
+test unixMenu-22.3 {SetHelpMenu - menubar with help menu} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
- catch {destroy .t2}
+ list [menu .m1.help] [. configure -menu ""] [destroy .m1]
+} -result {.m1.help {} {}}
+test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} -constraints {
+ unix
+} -setup {
+ destroy .m1 .t2
+} -body {
toplevel .t2
wm geometry .t2 +40+40
menu .m1 -tearoff 0
. configure -menu .m1
.t2 configure -menu .m1
.m1 add cascade -label .m1.help
- list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .t2]
-} {0 .m1.help {} {} {}}
+ list [menu .m1.help] [. configure -menu ""] [destroy .m1] [destroy .t2]
+} -result {.m1.help {} {} {}}
+
-test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} unix {
- catch {destroy .m1}
+test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activeforeground red
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.3 {TkpDrawMenuEntry - gc for active and strict motif} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
set tk_strictMotif 1
.m1 add command -label foo
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} unix {
- catch {destroy .m1}
+} -result {{} {} 0}
+test unixMenu-23.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled -background red
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -foreground red
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -selectcolor orange
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activebackground green
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.12 {TkpDrawMenuEntry - border} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.12 {TkpDrawMenuEntry - border} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.13 {TkpDrawMenuEntry - active border - strict motif} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
set tk_strictMotif 1
menu .m1
.m1 add command -label foo
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} unix {
- catch {destroy .m1}
+} -result {{} {} 0}
+test unixMenu-23.14 {TkpDrawMenuEntry - active border - custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activeforeground yellow
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.15 {TkpDrawMenuEntry - active border} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.15 {TkpDrawMenuEntry - active border} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.16 {TkpDrawMenuEntry - font - custom entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.16 {TkpDrawMenuEntry - font - custom entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -font "Helvectica 72"
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.17 {TkpDrawMenuEntry - font} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.17 {TkpDrawMenuEntry - font} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1 -font "Courier 72"
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.18 {TkpDrawMenuEntry - separator} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.18 {TkpDrawMenuEntry - separator} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.19 {TkpDrawMenuEntry - standard} unix {
- catch {destroy .mb}
+} -result {{} {}}
+test unixMenu-23.19 {TkpDrawMenuEntry - standard} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label File -menu .m1.file
menu .m1.file
@@ -748,140 +1002,192 @@ test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} unix {
.m1 entryconfigure File -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.21 {TkpDrawMenuEntry - indicator} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.21 {TkpDrawMenuEntry - indicator} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label Foo
.m1 invoke Foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label Foo -hidemargin 1
.m1 invoke Foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test unixMenu-24.1 {GetMenuLabelGeometry - image} {testImageType unix} {
- catch {destroy .m1}
+
+test unixMenu-24.1 {GetMenuLabelGeometry - image} -constraints {
+ testImageType unix
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
menu .m1
image create test image1
.m1 add command -image image1
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test unixMenu-24.2 {GetMenuLabelGeometry - bitmap} unix {
- catch {destroy .m1}
+} -result {{} {} {}}
+test unixMenu-24.2 {GetMenuLabelGeometry - bitmap} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -bitmap questhead
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-24.3 {GetMenuLabelGeometry - no text} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-24.3 {GetMenuLabelGeometry - no text} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-24.4 {GetMenuLabelGeometry - text} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-24.4 {GetMenuLabelGeometry - text} -constraints unix -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "This is a test."
list [update idletasks] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} unix {
- catch {destroy .m1}
+test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.2 {TkpComputeStandardMenuGeometry - one entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.2 {TkpComputeStandardMenuGeometry - one entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "one"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.3 {TkpComputeStandardMenuGeometry - more than one entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.3 {TkpComputeStandardMenuGeometry - more than one entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.4 {TkpComputeStandardMenuGeometry - separator} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.4 {TkpComputeStandardMenuGeometry - separator} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.5 {TkpComputeStandardMenuGeometry - tearoff entry} {unix nonUnixUserInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.5 {TkpComputeStandardMenuGeometry - tearoff entry} -constraints {
+ unix nonUnixUserInteraction
+} -setup {
+ destroy .mb
+} -body {
menubutton .mb -text "test" -menu .mb.m
menu .mb.m
.mb.m add command -label test
pack .mb
catch {tk::MbPost .mb}
list [update] [tk::MenuUnpost .mb.m] [destroy .mb]
-} {{} {} {}}
-test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} unix {
- catch {destroy .m1}
+} -result {{} {} {}}
+test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.7 {TkpComputeStandardMenuGeometry - different font for entry} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.7 {TkpComputeStandardMenuGeometry - different font for entry} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.8 {TkpComputeStandardMenuGeometry - second entry larger} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.9 {TkpComputeStandardMenuGeometry - first entry larger} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test test"
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.10 {TkpComputeStandardMenuGeometry - accelerator} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.10 {TkpComputeStandardMenuGeometry - accelerator} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test" -accel "Ctrl+S"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.11 {TkpComputeStandardMenuGeometry - second accel larger} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.11 {TkpComputeStandardMenuGeometry - second accel larger} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.12 {TkpComputeStandardMenuGeometry - second accel smaller} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.13 {TkpComputeStandardMenuGeometry - indicator} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
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 } {unix testImageType} {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or equal } -constraints {
+ unix testImageType
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
image create test image1
menu .m1
.m1 add checkbutton -image image1
@@ -889,10 +1195,13 @@ test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or e
.m1 add checkbutton -label test
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger } {unix testImageType} {
- catch {destroy .m1}
+} -result {{} {} {}}
+test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger } -constraints {
+ unix testImageType
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
image create test image1
menu .m1
.m1 add checkbutton -image image1
@@ -900,30 +1209,42 @@ test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger }
.m1 add checkbutton -label test
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test unixMenu-25.16 {TkpComputeStandardMenuGeometry - zero sized menus} unix {
- catch {destroy .m1}
+} -result {{} {} {}}
+test unixMenu-25.16 {TkpComputeStandardMenuGeometry - zero sized menus} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label one
.m1 add command -label two
.m1 add command -label three -columnbreak 1
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two -columnbreak 1
.m1 add command -label three
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two -columnbreak 1
@@ -932,15 +1253,21 @@ test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} unix {
.m1 add command -label five -columnbreak 1
.m1 add command -label six
list [update idletasks] [destroy .m1]
-} {{} {}}
-test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} unix {
- catch {destroy .m1}
+} -result {{} {}}
+test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} -constraints {
+ unix
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add checkbutton -label one -hidemargin 1
list [update idletasks] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
+
+test unixMenu-26.1 {TkpMenuInit - nothing to do} -constraints unix -body {}
+
-test unixMenu-26.1 {TkpMenuInit - nothing to do} {} {}
# cleanup
deleteWindows
diff --git a/tests/unixSelect.test b/tests/unixSelect.test
index c3ed11d..53ae006 100644
--- a/tests/unixSelect.test
+++ b/tests/unixSelect.test
@@ -9,8 +9,9 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
global longValue selValue selInfo
@@ -23,7 +24,7 @@ proc handler {type offset count} {
lappend selInfo $type $offset $count
set numBytes [expr {[string length $selValue] - $offset}]
if {$numBytes <= 0} {
- return ""
+ return ""
}
string range $selValue $offset [expr $numBytes+$offset]
}
@@ -31,18 +32,18 @@ proc handler {type offset count} {
proc errIncrHandler {type offset count} {
global selValue selInfo pass
if {$offset == 4000} {
- if {$pass == 0} {
- # Just sizing the selection; don't do anything here.
- set pass 1
- } else {
- # Fetching the selection; wait long enough to cause a timeout.
- after 6000
- }
+ if {$pass == 0} {
+ # Just sizing the selection; don't do anything here.
+ set pass 1
+ } else {
+ # Fetching the selection; wait long enough to cause a timeout.
+ after 6000
+ }
}
lappend selInfo $type $offset $count
set numBytes [expr {[string length $selValue] - $offset}]
if {$numBytes <= 0} {
- return ""
+ return ""
}
string range $selValue $offset [expr $numBytes+$offset]
}
@@ -57,23 +58,23 @@ proc badHandler {path type offset count} {
lappend selInfo $path $type $offset $count
set numBytes [expr {[string length $selValue] - $offset}]
if {$numBytes <= 0} {
- return ""
+ return ""
}
string range $selValue $offset [expr $numBytes+$offset]
}
proc reallyBadHandler {path type offset count} {
global selValue selInfo pass
if {$offset == 4000} {
- if {$pass == 0} {
- set pass 1
- } else {
- selection handle -type $type $path {}
- }
+ if {$pass == 0} {
+ set pass 1
+ } else {
+ selection handle -type $type $path {}
+ }
}
lappend selInfo $path $type $offset $count
set numBytes [expr {[string length $selValue] - $offset}]
if {$numBytes <= 0} {
- return ""
+ return ""
}
string range $selValue $offset [expr $numBytes+$offset]
}
@@ -89,10 +90,10 @@ after 1500
proc setup {{path .f1} {display {}}} {
catch {destroy $path}
if {$display == {}} {
- frame $path
+ frame $path
} else {
- toplevel $path -screen $display
- wm geom $path +0+0
+ toplevel $path -screen $display
+ wm geom $path +0+0
}
selection own $path
}
@@ -104,255 +105,332 @@ 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} {
append longValue A$j B$j C$j D$j E$j F$j G$j H$j I$j K$j L$j M$j N$j
}
-test unixSelect-1.1 {TkSelGetSelection procedure: simple i18n text} unix {
+# ----------------------------------------------------------------------
+
+test unixSelect-1.1 {TkSelGetSelection procedure: simple i18n text} -constraints {
+ unix
+} -setup {
+ destroy .e
setupbg
- entry .e
- pack .e
+} -body {
+ pack [entry .e]
update
- .e insert 0 [encoding convertfrom identity \u00fcber]
+ .e insert 0 \u00fcber
.e selection range 0 end
- set result [dobg {string bytelength [selection get]}]
+ dobg {string length [selection get]}
+} -cleanup {
cleanupbg
destroy .e
- set result
-} {5}
-test unixSelect-1.2 {TkSelGetSelection procedure: simple i18n text, iso8859-1} unix {
+} -result {4}
+
+test unixSelect-1.2 {TkSelGetSelection procedure: simple i18n text, iso8859-1} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 \u00fc\u0444
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 \u00fc\u0444
+ .e selection range 0 end
}
- set x [selection get]
+ selection get
+} -cleanup {
cleanupbg
- list [string equal \u00fc? $x] \
- [string length $x] [string bytelength $x]
-} {1 2 3}
-test unixSelect-1.4 {TkSelGetSelection procedure: simple i18n text, iso2022} unix {
+} -result \u00fc?
+
+test unixSelect-1.3 {TkSelGetSelection procedure: simple i18n text, iso2022} -constraints {
+ unix
+} -setup {
setupbg
setup
+} -body {
selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \
- {handler COMPOUND_TEXT}
+ {handler COMPOUND_TEXT}
selection own .
set selValue \u00fc\u0444
set selInfo {}
set result [dobg {
- set x [selection get -type COMPOUND_TEXT]
- list [string equal \u00fc\u0444 $x] \
- [string length $x] [string bytelength $x]
+ set x [selection get -type COMPOUND_TEXT]
+ list [string equal \u00fc\u0444 $x] [string length $x]
}]
- cleanupbg
lappend result $selInfo
-} {1 2 4 {COMPOUND_TEXT 0 4000}}
-test unixSelect-1.5 {TkSelGetSelection procedure: INCR i18n text, iso2022} unix {
+} -cleanup {
+ cleanupbg
+} -result {1 2 {COMPOUND_TEXT 0 4000}}
+test unixSelect-1.4 {TkSelGetSelection procedure: INCR i18n text, iso2022} -constraints {
+ unix
+} -setup {
+ setupbg
+ setup
+} -body {
# This test is subtle. The selection ends up getting fetched twice by
# Tk: once to compute the length, and again to actually send the data.
# The first time through, we don't convert the data to ISO2022, so the
# buffer boundaries end up being different in the two passes.
-
- setupbg
- setup
selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \
- {handler COMPOUND_TEXT}
+ {handler COMPOUND_TEXT}
selection own .
set selValue [string repeat x 3999]\u00fc\u0444[string repeat x 3999]
set selInfo {}
set result [dobg {
- set x [selection get -type COMPOUND_TEXT]
- list [string equal \
- [string repeat x 3999]\u00fc\u0444[string repeat x 3999] $x] \
- [string length $x] [string bytelength $x]
+ set x [selection get -type COMPOUND_TEXT]
+ list [string equal \
+ [string repeat x 3999]\u00fc\u0444[string repeat x 3999] $x] \
+ [string length $x]
}]
- cleanupbg
lappend result $selInfo
-} {1 8000 8002 {COMPOUND_TEXT 0 4000 COMPOUND_TEXT 4000 3999 COMPOUND_TEXT 7998 4000 COMPOUND_TEXT 0 4000 COMPOUND_TEXT 4000 3998 COMPOUND_TEXT 7997 4000}}
-test unixSelect-1.6 {TkSelGetSelection procedure: simple i18n text, iso2022} unix {
+} -cleanup {
+ cleanupbg
+} -result {1 8000 {COMPOUND_TEXT 0 4000 COMPOUND_TEXT 4000 3999 COMPOUND_TEXT 7998 4000 COMPOUND_TEXT 0 4000 COMPOUND_TEXT 4000 3998 COMPOUND_TEXT 7997 4000}}
+
+test unixSelect-1.5 {TkSelGetSelection procedure: simple i18n text, iso2022} -constraints {
+ unix
+} -setup {
setupbg
setup
+} -body {
selection handle -type COMPOUND_TEXT -format COMPOUND_TEXT . \
- {handler COMPOUND_TEXT}
+ {handler COMPOUND_TEXT}
selection own .
set selValue \u00fc\u0444
set selInfo {}
set result [dobg {
- set x [selection get -type COMPOUND_TEXT]
- list [string equal \u00fc\u0444 $x] \
- [string length $x] [string bytelength $x]
+ set x [selection get -type COMPOUND_TEXT]
+ list [string equal \u00fc\u0444 $x] [string length $x]
}]
- cleanupbg
lappend result $selInfo
-} {1 2 4 {COMPOUND_TEXT 0 4000}}
-test unixSelect-1.7 {TkSelGetSelection procedure: INCR i18n text} unix {
+} -cleanup {
+ cleanupbg
+} -result {1 2 {COMPOUND_TEXT 0 4000}}
+
+test unixSelect-1.6 {TkSelGetSelection procedure: INCR i18n text} -constraints {
+ unix
+} -setup {
setupbg
- dobg "entry .e; pack .e; update
- .e insert 0 \[encoding convertfrom identity \\u00fcber\]$longValue
- .e selection range 0 end"
- set result [string bytelength [selection get]]
+} -body {
+ dobg [subst -nobackslashes {entry .e; pack .e; update
+ .e insert 0 \u00fcber$longValue
+ .e selection range 0 end}]
+ string length [selection get]
+} -cleanup {
cleanupbg
- set result
-} [expr {5 + [string bytelength $longValue]}]
-test unixSelect-1.8 {TkSelGetSelection procedure: INCR i18n text} unix {
+} -result [expr {4 + [string length $longValue]}]
+
+test unixSelect-1.7 {TkSelGetSelection procedure: INCR i18n text} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 [string repeat x 3999]\u00fc
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 [string repeat x 3999]\u00fc
+ .e selection range 0 end
}
- set x [selection get]
+ selection get
+} -cleanup {
cleanupbg
- list [string equal [string repeat x 3999]\u00fc $x] \
- [string length $x] [string bytelength $x]
-} {1 4000 4001}
-test unixSelect-1.9 {TkSelGetSelection procedure: INCR i18n text} unix {
+} -result [string repeat x 3999]\u00fc
+
+test unixSelect-1.8 {TkSelGetSelection procedure: INCR i18n text} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 \u00fc[string repeat x 3999]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 \u00fc[string repeat x 3999]
+ .e selection range 0 end
}
- set x [selection get]
+ selection get
+} -cleanup {
cleanupbg
- list [string equal \u00fc[string repeat x 3999] $x] \
- [string length $x] [string bytelength $x]
-} {1 4000 4001}
-test unixSelect-1.10 {TkSelGetSelection procedure: INCR i18n text} unix {
+} -result \u00fc[string repeat x 3999]
+
+test unixSelect-1.9 {TkSelGetSelection procedure: INCR i18n text} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 [string repeat x 3999]\u00fc[string repeat x 4000]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 [string repeat x 3999]\u00fc[string repeat x 4000]
+ .e selection range 0 end
}
- set x [selection get]
+ selection get
+} -cleanup {
cleanupbg
- list [string equal [string repeat x 3999]\u00fc[string repeat x 4000] $x] \
- [string length $x] [string bytelength $x]
-} {1 8000 8001}
+} -result [string repeat x 3999]\u00fc[string repeat x 4000]
# Now some tests to make sure that the right thing is done when
# transferring UTF8 selections, to prevent [Bug 614650] and its ilk
# from rearing its ugly head again.
-test unixSelect-1.11 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+
+test unixSelect-1.10 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 [string repeat x 3999]\u00fc
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 [string repeat x 3999]\u00fc
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal [string repeat x 3999]\u00fc $x] \
- [string length $x] [string bytelength $x]
-} {1 4000 4001}
-test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result [string repeat x 3999]\u00fc
+
+test unixSelect-1.11 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 \u00fc[string repeat x 3999]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 \u00fc[string repeat x 3999]
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal \u00fc[string repeat x 3999] $x] \
- [string length $x] [string bytelength $x]
-} {1 4000 4001}
-test unixSelect-1.13 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result \u00fc[string repeat x 3999]
+
+test unixSelect-1.12 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 [string repeat x 3999]\u00fc[string repeat x 4000]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 [string repeat x 3999]\u00fc[string repeat x 4000]
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal [string repeat x 3999]\u00fc[string repeat x 4000] $x] \
- [string length $x] [string bytelength $x]
-} {1 8000 8001}
-test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} unix {
+} -result [string repeat x 3999]\u00fc[string repeat x 4000]
+
+test unixSelect-1.13 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints {
+ unix
+} -setup {
+ destroy .e
setupbg
- entry .e
- pack .e
+} -body {
+ pack [entry .e]
update
- .e insert 0 [encoding convertfrom identity \u00fcber\u0444]
+ .e insert 0 \u00fcber\u0444
.e selection range 0 end
- set result [dobg {string bytelength [selection get -type UTF8_STRING]}]
- cleanupbg
+ dobg {string length [selection get -type UTF8_STRING]}
+} -cleanup {
destroy .e
- set result
-} {5}
-test unixSelect-1.15 {TkSelGetSelection procedure: simple i18n text, utf-8} unix {
+ cleanupbg
+} -result {5}
+
+test unixSelect-1.14 {TkSelGetSelection procedure: simple i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 \u00fc\u0444
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 \u00fc\u0444
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal \u00fc\u0444 $x] \
- [string length $x] [string bytelength $x]
-} {1 2 4}
-test unixSelect-1.16 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result \u00fc\u0444
+
+test unixSelect-1.15 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 [string repeat [string repeat \u00c4\u00e4 50]\n 21]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 [string repeat [string repeat \u00c4\u00e4 50]\n 21]
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal [string repeat [string repeat \u00c4\u00e4 50]\n 21] $x] \
- [string length $x] [string bytelength $x]
-} {1 2121 4221}
-test unixSelect-1.17 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result [string repeat [string repeat \u00c4\u00e4 50]\n 21]
+
+test unixSelect-1.16 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- entry .e; pack .e; update
- .e insert 0 i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
- .e selection range 0 end
+ pack [entry .e]
+ update
+ .e insert 0 i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
+ .e selection range 0 end
}
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal i[string repeat [string repeat \u00c4\u00e4 50]\n 21] $x] \
- [string length $x] [string bytelength $x]
-} {1 2122 4222}
-test unixSelect-1.18 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
+
+test unixSelect-1.17 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- text .t; pack .t; update
- .t insert 1.0 [string repeat [string repeat \u00c4\u00e4 50]\n 21]
- # Has to be selected in a separate stage
- .t tag add sel 1.0 21.end+1c
+ pack [text .t]
+ update
+ .t insert 1.0 [string repeat [string repeat \u00c4\u00e4 50]\n 21]
+ # Has to be selected in a separate stage
+ .t tag add sel 1.0 21.end+1c
}
after 10
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal [string repeat [string repeat \u00c4\u00e4 50]\n 21] $x] \
- [string length $x] [string bytelength $x]
-} {1 2121 4221}
-test unixSelect-1.19 {TkSelGetSelection procedure: INCR i18n text, utf-8} unix {
+} -result [string repeat [string repeat \u00c4\u00e4 50]\n 21]
+
+test unixSelect-1.18 {TkSelGetSelection procedure: INCR i18n text, utf-8} -constraints {
+ unix
+} -setup {
setupbg
+} -body {
dobg {
- text .t; pack .t; update
- .t insert 1.0 i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
- # Has to be selected in a separate stage
- .t tag add sel 1.0 21.end+1c
+ pack [text .t]
+ update
+ .t insert 1.0 i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
+ # Has to be selected in a separate stage
+ .t tag add sel 1.0 21.end+1c
}
after 10
- set x [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
cleanupbg
- list [string equal i[string repeat [string repeat \u00c4\u00e4 50]\n 21] $x] \
- [string length $x] [string bytelength $x]
-} {1 2122 4222}
-test unixSelect-1.20 {Automatic UTF8_STRING support for selection handle} unix {
+} -result i[string repeat [string repeat \u00c4\u00e4 50]\n 21]
+
+test unixSelect-1.19 {Automatic UTF8_STRING support for selection handle} -constraints {
+ unix
+} -setup {
+ destroy .l
+} -body {
# See Bug #666346 "Selection handling crashes under KDE 3.0"
- label .l
+ label .l
selection handle .l [list handler STRING]
set selValue "This is the selection value"
selection own .l
- set result [selection get -type UTF8_STRING]
+ selection get -type UTF8_STRING
+} -cleanup {
destroy .l
- set result
-} "This is the selection value"
+} -result {This is the selection value}
# cleanup
cleanupTests
diff --git a/tests/util.test b/tests/util.test
index 86271c5..c1ec6a5 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -6,61 +6,63 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
listbox .l -width 20 -height 5 -relief sunken -bd 2
pack .l
.l insert 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
update
-test util-1.1 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview moveto a b} msg] $msg
-} {1 {wrong # args: should be ".l yview moveto fraction"}}
-test util-1.2 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview moveto xyz} msg] $msg
-} {1 {expected floating-point number but got "xyz"}}
-test util-1.3 {Tk_GetScrollInfo procedure} {
+test util-1.1 {Tk_GetScrollInfo procedure} -body {
+ .l yview moveto a b
+} -returnCodes error -result {wrong # args: should be ".l yview moveto fraction"}
+test util-1.2 {Tk_GetScrollInfo procedure} -body {
+ .l yview moveto xyz
+} -returnCodes error -result {expected floating-point number but got "xyz"}
+test util-1.3 {Tk_GetScrollInfo procedure} -body {
.l yview 0
.l yview moveto .5
.l yview
-} {0.5 0.75}
-test util-1.4 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview scroll a} msg] $msg
-} {1 {wrong # args: should be ".l yview scroll number units|pages"}}
-test util-1.5 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview scroll a b c} msg] $msg
-} {1 {wrong # args: should be ".l yview scroll number units|pages"}}
-test util-1.6 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview scroll xyz units} msg] $msg
-} {1 {expected integer but got "xyz"}}
-test util-1.7 {Tk_GetScrollInfo procedure} {
+} -result {0.5 0.75}
+test util-1.4 {Tk_GetScrollInfo procedure} -body {
+ .l yview scroll a
+} -returnCodes error -result {wrong # args: should be ".l yview scroll number units|pages"}
+test util-1.5 {Tk_GetScrollInfo procedure} -body {
+ .l yview scroll a b c
+} -returnCodes error -result {wrong # args: should be ".l yview scroll number units|pages"}
+test util-1.6 {Tk_GetScrollInfo procedure} -body {
+ .l yview scroll xyz units
+} -returnCodes error -result {expected integer but got "xyz"}
+test util-1.7 {Tk_GetScrollInfo procedure} -body {
.l yview 0
.l yview scroll 2 pages
.l nearest 0
-} {6}
-test util-1.8 {Tk_GetScrollInfo procedure} {
+} -result {6}
+test util-1.8 {Tk_GetScrollInfo procedure} -body {
.l yview 15
.l yview scroll -2 pages
.l nearest 0
-} {9}
-test util-1.9 {Tk_GetScrollInfo procedure} {
+} -result {9}
+test util-1.9 {Tk_GetScrollInfo procedure} -body {
.l yview 0
.l yview scroll 2 units
.l nearest 0
-} {2}
-test util-1.10 {Tk_GetScrollInfo procedure} {
+} -result {2}
+test util-1.10 {Tk_GetScrollInfo procedure} -body {
.l yview 15
.l yview scroll -2 units
.l nearest 0
-} {13}
-test util-1.11 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview scroll 3 zips} msg] $msg
-} {1 {bad argument "zips": must be units or pages}}
-test util-1.12 {Tk_GetScrollInfo procedure} {
- list [catch {.l yview dropdead 3 times} msg] $msg
-} {1 {unknown option "dropdead": must be moveto or scroll}}
+} -result {13}
+test util-1.11 {Tk_GetScrollInfo procedure} -body {
+ .l yview scroll 3 zips
+} -returnCodes error -result {bad argument "zips": must be units or pages}
+test util-1.12 {Tk_GetScrollInfo procedure} -body {
+ .l yview dropdead 3 times
+} -returnCodes error -result {unknown option "dropdead": must be moveto or scroll}
# cleanup
cleanupTests
return
+
diff --git a/tests/visual.test b/tests/visual.test
index 1006e18..2f5c34a 100644
--- a/tests/visual.test
+++ b/tests/visual.test
@@ -7,8 +7,9 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
update
@@ -18,7 +19,7 @@ update
# use up all the slots in the colormap.
#
# Arguments:
-# w - Name of toplevel window to create.
+# w - Name of toplevel window to create.
proc eatColors {w} {
catch {destroy $w}
@@ -27,12 +28,12 @@ proc eatColors {w} {
canvas $w.c -width 400 -height 200 -bd 0
pack $w.c
for {set y 0} {$y < 8} {incr y} {
- for {set x 0} {$x < 40} {incr x} {
- set color [format #%02x%02x%02x [expr $x*6] [expr $y*30] 0]
- $w.c create rectangle [expr 10*$x] [expr 20*$y] \
- [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
- -fill $color
- }
+ for {set x 0} {$x < 40} {incr x} {
+ set color [format #%02x%02x%02x [expr $x*6] [expr $y*30] 0]
+ $w.c create rectangle [expr 10*$x] [expr 20*$y] \
+ [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
+ -fill $color
+ }
}
update
}
@@ -43,14 +44,14 @@ proc eatColors {w} {
# 0 otherwise.
#
# Arguments:
-# w - Name of window in which to check.
-# red, green, blue - Intensities to use in a trial color allocation
-# to see if there are colormap entries free.
+# w - Name of window in which to check.
+# red, green, blue - Intensities to use in a trial color allocation
+# to see if there are colormap entries free.
proc colorsFree {w {red 31} {green 245} {blue 192}} {
set vals [winfo rgb $w [format #%02x%02x%02x $red $green $blue]]
expr ([lindex $vals 0]/256 == $red) && ([lindex $vals 1]/256 == $green) \
- && ([lindex $vals 2]/256 == $blue)
+ && ([lindex $vals 2]/256 == $blue)
}
# If more than one visual type is available for the screen, pick one
@@ -61,233 +62,500 @@ set avail [winfo visualsavailable .]
set other {}
if {[llength $avail] > 1} {
foreach visual $avail {
- if {$visual != $default} {
- set other $visual
- break
- }
+ if {$visual != $default} {
+ set other $visual
+ break
+ }
}
}
testConstraint haveOtherVisual [expr {$other ne ""}]
testConstraint havePseudocolorVisual [string match *pseudocolor* $avail]
testConstraint haveMultipleVisuals [expr {[llength $avail] > 1}]
-test visual-1.1 {Tk_GetVisual, copying from other window} {
- list [catch {toplevel .t -visual .foo.bar} msg] $msg
-} {1 {bad window path name ".foo.bar"}}
-test visual-1.2 {Tk_GetVisual, copying from other window} {haveOtherVisual nonPortable} {
- catch {destroy .t1}
- catch {destroy .t2}
+# ----------------------------------------------------------------------
+
+test visual-1.1 {Tk_GetVisual, copying from other window} -body {
+ toplevel .t -visual .foo.bar
+} -returnCodes error -result {bad window path name ".foo.bar"}
+test visual-1.2 {Tk_GetVisual, copying from other window} -constraints {
+ haveOtherVisual nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 -visual $other
wm geom .t1 +0+0
toplevel .t2 -width 200 -height 80 -visual .t1
wm geom .t2 +5+5
concat "[winfo visual .t2] [winfo depth .t2]"
-} $other
-test visual-1.3 {Tk_GetVisual, copying from other window} haveOtherVisual {
- catch {destroy .t1}
- catch {destroy .t2}
+} -cleanup {
+ deleteWindows
+} -result $other
+test visual-1.3 {Tk_GetVisual, copying from other window} -constraints {
+ haveOtherVisual
+} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 -visual $other
wm geom .t1 +0+0
toplevel .t2 -width 200 -height 80 -visual .
wm geom .t2 +5+5
concat "[winfo visual .t2] [winfo depth .t2]"
-} $default
+} -cleanup {
+ deleteWindows
+} -result $default
# Make sure reference count is incremented when copying visual (the
# following test will cause the colormap to be freed prematurely if
# the reference count isn't incremented).
-test visual-1.4 {Tk_GetVisual, colormap reference count} haveOtherVisual {
- catch {destroy .t1}
- catch {destroy .t2}
+test visual-1.4 {Tk_GetVisual, colormap reference count} -constraints {
+ haveOtherVisual
+} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 -visual $other
wm geom .t1 +0+0
- set result [list [catch {toplevel .t2 -gorp 80 -visual .t1} msg] $msg]
+ set result [toplevel .t2 -gorp 80 -visual .t1]
update
- set result
-} {1 {unknown option "-gorp"}}
-test visual-1.5 {Tk_GetVisual, default colormap} {
- catch {destroy .t1}
+ return $result
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown option "-gorp"}
+test visual-1.5 {Tk_GetVisual, default colormap} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 -visual default
wm geometry .t1 +0+0
update
concat "[winfo visual .t1] [winfo depth .t1]"
-} $default
+} -cleanup {
+ deleteWindows
+} -result $default
+
+
+test visual-2.1 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.2 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.3 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.4 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.5 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.6 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.7 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.8 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 24}
+test visual-2.9 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.10 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.11 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.12 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.13 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.14 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.15 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.16 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {directcolor 24}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {directcolor 24}
+test visual-2.17 {Tk_GetVisual, different visual types} -constraints {
+ nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual {truecolor 32}
+ wm geometry .t1 +0+0
+ update
+ concat "[winfo visual .t1] [winfo depth .t1]"
+} -cleanup {
+ deleteWindows
+} -result {truecolor 32}
-set i 1
-foreach visual $avail {
- test visual-2.$i {Tk_GetVisual, different visual types} {nonPortable} {
- catch {destroy .t1}
- toplevel .t1 -width 250 -height 100 -visual $visual
- wm geometry .t1 +0+0
- update
- concat "[winfo visual .t1] [winfo depth .t1]"
- } $visual
- incr i
-}
-test visual-3.1 {Tk_GetVisual, parsing visual string} {
- catch {destroy .t1}
+test visual-3.1 {Tk_GetVisual, parsing visual string} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 \
- -visual "[winfo visual .][winfo depth .]"
+ -visual "[winfo visual .][winfo depth .]"
wm geometry .t1 +0+0
update
concat "[winfo visual .t1] [winfo depth .t1]"
-} $default
-test visual-3.2 {Tk_GetVisual, parsing visual string} {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 250 -height 100 -visual goop20
- wm geometry .t1 +0+0
- } msg] $msg
-} {1 {unknown or ambiguous visual name "goop20": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}}
-test visual-3.3 {Tk_GetVisual, parsing visual string} {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 250 -height 100 -visual d
- wm geometry .t1 +0+0
- } msg] $msg
-} {1 {unknown or ambiguous visual name "d": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}}
-test visual-3.4 {Tk_GetVisual, parsing visual string} {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 250 -height 100 -visual static
- wm geometry .t1 +0+0
- } msg] $msg
-} {1 {unknown or ambiguous visual name "static": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}}
-test visual-3.5 {Tk_GetVisual, parsing visual string} {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 250 -height 100 -visual "pseudocolor 48x"
- wm geometry .t1 +0+0
- } msg] $msg
-} {1 {expected integer but got "48x"}}
+} -cleanup {
+ deleteWindows
+} -result $default
+test visual-3.2 {Tk_GetVisual, parsing visual string} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual goop20
+ wm geometry .t1 +0+0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown or ambiguous visual name "goop20": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}
+test visual-3.3 {Tk_GetVisual, parsing visual string} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual d
+ wm geometry .t1 +0+0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown or ambiguous visual name "d": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}
+test visual-3.4 {Tk_GetVisual, parsing visual string} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual static
+ wm geometry .t1 +0+0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {unknown or ambiguous visual name "static": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}
+test visual-3.5 {Tk_GetVisual, parsing visual string} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual "pseudocolor 48x"
+ wm geometry .t1 +0+0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {expected integer but got "48x"}
-test visual-4.1 {Tk_GetVisual, numerical visual id} -setup {
- catch {destroy .t1}
- catch {destroy .t2}
- catch {destroy .t3}
+
+test visual-4.1 {Tk_GetVisual, numerical visual id} -constraints {
+ haveOtherVisual nonPortable
+} -setup {
+ deleteWindows
toplevel .t1 -width 250 -height 100 -visual $other
wm geom .t1 +0+0
toplevel .t2 -width 200 -height 80 -visual [winfo visual .]
wm geom .t2 +5+5
toplevel .t3 -width 150 -height 250 -visual [winfo visual .t1]
wm geom .t3 +10+10
-} -constraints {haveOtherVisual nonPortable} -body {
+} -body {
set v1 [list [winfo visualid .t2] [winfo visualid .t3]]
set v2 [list [winfo visualid .] [winfo visualid .t1]]
expr {$v1 eq $v2 ? "OK" : "[list $v1] ne [list $v2]"}
-} -result OK -cleanup {
- destroy .t1 .t2 .t3
-}
-test visual-4.2 {Tk_GetVisual, numerical visual id} {
- catch {destroy .t1}
- list [catch {toplevel .t1 -visual 12xyz} msg] $msg
-} {1 {bad X identifier for visual: "12xyz"}}
-test visual-4.3 {Tk_GetVisual, numerical visual id} {
- catch {destroy .t1}
- list [catch {toplevel .t1 -visual 1291673} msg] $msg
-} {1 {couldn't find an appropriate visual}}
+} -cleanup {
+ deleteWindows
+} -result OK
+test visual-4.2 {Tk_GetVisual, numerical visual id} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -visual 12xyz
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad X identifier for visual: "12xyz"}
+test visual-4.3 {Tk_GetVisual, numerical visual id} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -visual 1291673
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {couldn't find an appropriate visual}
+
-test visual-5.1 {Tk_GetVisual, no matching visual} !havePseudocolorVisual {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 250 -height 100 -visual "pseudocolor 8"
- wm geometry .t1 +0+0
- } msg] $msg
-} {1 {couldn't find an appropriate visual}}
+test visual-5.1 {Tk_GetVisual, no matching visual} -constraints {
+ !havePseudocolorVisual
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 250 -height 100 -visual "pseudocolor 8"
+ wm geometry .t1 +0+0
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {couldn't find an appropriate visual}
-test visual-6.1 {Tk_GetVisual, no matching visual} {havePseudocolorVisual haveMultipleVisuals nonPortable} {
- catch {destroy .t1}
+
+test visual-6.1 {Tk_GetVisual, no matching visual} -constraints {
+ havePseudocolorVisual haveMultipleVisuals nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 250 -height 100 -visual "best"
wm geometry .t1 +0+0
update
winfo visual .t1
-} {pseudocolor}
+} -cleanup {
+ deleteWindows
+} -result {pseudocolor}
+
# These tests are non-portable due to variations in how many colors
# are already in use on the screen.
-
-if {[testConstraint defaultPseudocolor8]} {
+test visual-7.1 {Tk_GetColormap, "new"} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
eatColors .t1
-}
-test visual-7.1 {Tk_GetColormap, "new"} {defaultPseudocolor8 nonPortable} {
toplevel .t2 -width 30 -height 20
wm geom .t2 +0+0
update
colorsFree .t2
-} {0}
-test visual-7.2 {Tk_GetColormap, "new"} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t2}
+} -cleanup {
+ deleteWindows
+} -result {0}
+test visual-7.2 {Tk_GetColormap, "new"} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ eatColors .t1
toplevel .t2 -width 30 -height 20 -colormap new
wm geom .t2 +0+0
update
colorsFree .t2
-} {1}
-test visual-7.3 {Tk_GetColormap, copy from other window} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t2}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test visual-7.3 {Tk_GetColormap, copy from other window} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ eatColors .t1
toplevel .t3 -width 400 -height 50 -colormap new
wm geom .t3 +0+0
- catch {destroy .t2}
toplevel .t2 -width 30 -height 20 -colormap .t3
wm geom .t2 +0+0
update
destroy .t3
colorsFree .t2
-} {1}
-test visual-7.4 {Tk_GetColormap, copy from other window} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t2}
+} -cleanup {
+ deleteWindows
+} -result {1}
+test visual-7.4 {Tk_GetColormap, copy from other window} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ eatColors .t1
toplevel .t3 -width 400 -height 50 -colormap new
wm geom .t3 +0+0
- catch {destroy .t2}
toplevel .t2 -width 30 -height 20 -colormap .
wm geom .t2 +0+0
update
destroy .t3
colorsFree .t2
-} {0}
-test visual-7.5 {Tk_GetColormap, copy from other window} {defaultPseudocolor8 nonPortable} {
- catch {destroy .t1}
- list [catch {
- toplevel .t1 -width 400 -height 50 -colormap .choke.lots
- } msg] $msg
-} {1 {bad window path name ".choke.lots"}}
-test visual-7.6 {Tk_GetColormap, copy from other window} {defaultPseudocolor8 haveOtherVisual nonPortable} {
- catch {destroy .t1}
- catch {destroy .t2}
+} -cleanup {
+ deleteWindows
+} -result {0}
+test visual-7.5 {Tk_GetColormap, copy from other window} -constraints {
+ defaultPseudocolor8 nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ toplevel .t1 -width 400 -height 50 -colormap .choke.lots
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {bad window path name ".choke.lots"}
+test visual-7.6 {Tk_GetColormap, copy from other window} -constraints {
+ defaultPseudocolor8 haveOtherVisual nonPortable
+} -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 300 -height 150 -visual $other
wm geometry .t1 +0+0
- list [catch {toplevel .t2 -width 400 -height 50 -colormap .t1} msg] $msg
-} {1 {can't use colormap for .t1: incompatible visuals}}
-if {[testConstraint defaultPseudocolor8]} {
- catch {destroy .t1}
- catch {destroy .t2}
-}
+ toplevel .t2 -width 400 -height 50 -colormap .t1
+} -cleanup {
+ deleteWindows
+} -returnCodes error -result {can't use colormap for .t1: incompatible visuals}
+
-test visual-8.1 {Tk_FreeColormap procedure} {
+test visual-8.1 {Tk_FreeColormap procedure} -setup {
deleteWindows
+} -body {
toplevel .t1 -width 300 -height 180 -colormap new
wm geometry .t1 +0+0
foreach i {.t2 .t3 .t4} {
- toplevel $i -width 250 -height 150 -colormap .t1
- wm geometry $i +0+0
+ toplevel $i -width 250 -height 150 -colormap .t1
+ wm geometry $i +0+0
}
destroy .t1
destroy .t3
destroy .t4
update
-} {}
-test visual-8.2 {Tk_FreeColormap procedure} haveOtherVisual {
+} -cleanup {
deleteWindows
+} -result {}
+test visual-8.2 {Tk_FreeColormap procedure} -constraints haveOtherVisual -setup {
+ deleteWindows
+} -body {
toplevel .t1 -width 300 -height 180 -visual $other
wm geometry .t1 +0+0
foreach i {.t2 .t3 .t4} {
- toplevel $i -width 250 -height 150 -visual $other
- wm geometry $i +0+0
+ toplevel $i -width 250 -height 150 -visual $other
+ wm geometry $i +0+0
}
destroy .t2
destroy .t3
destroy .t4
update
-} {}
+} -cleanup {
+ deleteWindows
+} -result {}
+
deleteWindows
rename eatColors {}
@@ -296,3 +564,7 @@ rename colorsFree {}
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/visual_bb.test b/tests/visual_bb.test
index 6b10f76..2b06d05 100644
--- a/tests/visual_bb.test
+++ b/tests/visual_bb.test
@@ -6,10 +6,12 @@
# at the window to make sure it appears as expected. Individual tests
# are kept in separate ".tcl" files in this directory.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
+
set auto_path ". $auto_path"
wm title . "Visual Tests for Tk"
@@ -21,8 +23,8 @@ proc runTest {file} {
global testNum
test "2.$testNum" "testing $file" {userInteraction} {
- uplevel \#0 source [file join [testsDirectory] $file]
- concat ""
+ uplevel \#0 source [file join [testsDirectory] $file]
+ concat ""
} {}
incr testNum
}
@@ -38,7 +40,9 @@ proc end {} {
set ::EndOfVisualTests 1
}
-test 1.1 "running visual tests" {userInteraction} {
+# ----------------------------------------------------------------------
+
+test 1.1 {running visual tests} -constraints userInteraction -body {
#-------------------------------------------------------
# The code below create the main window, consisting of a
# menu bar and a message explaining the basic operation
@@ -47,8 +51,8 @@ test 1.1 "running visual tests" {userInteraction} {
frame .menu -relief raised -borderwidth 1
message .msg -font {Times 18} -relief raised -width 4i \
- -borderwidth 1 -text "This application provides a collection of visual tests for the Tk toolkit. Each menu entry invokes a test, which displays information on the screen. You can then verify visually that the information is being displayed in the correct way. The tests under the \"Postscript\" menu exercise the Postscript-generation capabilities of canvas widgets."
-
+ -borderwidth 1 -text "This application provides a collection of visual tests for the Tk toolkit. Each menu entry invokes a test, which displays information on the screen. You can then verify visually that the information is being displayed in the correct way. The tests under the \"Postscript\" menu exercise the Postscript-generation capabilities of canvas widgets."
+
pack .menu -side top -fill x
pack .msg -side bottom -expand yes -fill both
@@ -60,40 +64,40 @@ 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 end
-
+
menubutton .menu.group1 -text "Group 1" -menu .menu.group1.m
menu .menu.group1.m
.menu.group1.m add command -label "Canvas arcs" -command {runTest arc.tcl}
.menu.group1.m add command -label "Beveled borders in text widgets" \
- -command {runTest bevel.tcl}
+ -command {runTest bevel.tcl}
.menu.group1.m add command -label "Colormap management" \
- -command {runTest cmap.tcl}
+ -command {runTest cmap.tcl}
.menu.group1.m add command -label "Label/button geometry" \
- -command {runTest butGeom.tcl}
+ -command {runTest butGeom.tcl}
.menu.group1.m add command -label "Label/button colors" \
- -command {runTest butGeom2.tcl}
-
+ -command {runTest butGeom2.tcl}
+
menubutton .menu.ps -text "Canvas Postscript" -menu .menu.ps.m
menu .menu.ps.m
.menu.ps.m add command -label "Rectangles and other graphics" \
- -command {runTest canvPsGrph.tcl}
+ -command {runTest canvPsGrph.tcl}
.menu.ps.m add command -label "Text" \
- -command {runTest canvPsText.tcl}
+ -command {runTest canvPsText.tcl}
.menu.ps.m add command -label "Bitmaps" \
- -command {runTest canvPsBmap.tcl}
+ -command {runTest canvPsBmap.tcl}
.menu.ps.m add command -label "Images" \
- -command {runTest canvPsImg.tcl}
+ -command {runTest canvPsImg.tcl}
.menu.ps.m add command -label "Arcs" \
- -command {runTest canvPsArc.tcl}
-
+ -command {runTest canvPsArc.tcl}
+
pack .menu.file .menu.group1 .menu.ps -side left -padx 1m
-
+
# Set up for keyboard-based menu traversal
-
+
bind . <Any-FocusIn> {
- if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} {
- focus .menu
- }
+ if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} {
+ focus .menu
+ }
}
tk_menuBar .menu .menu.file .menu.group1 .menu.ps
@@ -103,7 +107,7 @@ test 1.1 "running visual tests" {userInteraction} {
bind Canvas <1> {%W delete [%W find closest %x %y]}
concat ""
-} {}
+} -result {}
if {![testConstraint userInteraction]} {
cleanupTests
diff --git a/tests/winButton.test b/tests/winButton.test
index 5bf6867..8bf1d01 100644
--- a/tests/winButton.test
+++ b/tests/winButton.test
@@ -8,77 +8,91 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
+imageInit
proc bogusTrace args {
error "trace aborted"
}
-catch {unset value}
-catch {unset value2}
option clear
-eval image delete [image names]
-if {[testConstraint testImageType]} {
- image create test image1
-}
-label .l -text Label
-button .b -text Button
-checkbutton .c -text Checkbutton
-radiobutton .r -text Radiobutton
-pack .l .b .c .r
-update
-test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win} {
+# ----------------------------------------------------------------------
+
+test winbutton-1.1 {TkpComputeButtonGeometry procedure} -constraints {
+ testImageType win
+} -setup {
deleteWindows
+} -body {
image create test image1
image1 changed 0 0 0 0 60 40
label .b1 -image image1 -bd 4 -padx 0 -pady 2
button .b2 -image image1 -bd 4 -padx 0 -pady 2
- checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
- radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
+ checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1 \
+ -font {{MS Sans Serif} 8}
+ radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0 \
+ -font {{MS Sans Serif} 8}
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 70 50 90 52 90 52}
-test winbutton-1.2 {TkpComputeButtonGeometry procedure} win {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+ image delete image1
+} -result {68 48 70 50 90 52 90 52}
+
+test winbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints win -setup {
+ deleteWindows
+} -body {
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 -font {{MS Sans Serif} 8}
- radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
+ checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1 \
+ -font {{MS Sans Serif} 8}
+ radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0 \
+ -font {{MS Sans Serif} 8}
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 25 35 45 37 45 37}
-test winbutton-1.3 {TkpComputeButtonGeometry procedure} win {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+} -result {23 33 25 35 45 37 45 37}
+
+test winbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints win -setup {
+ deleteWindows
+} -body {
label .b1 -bitmap question -bd 3 -highlightthickness 4
button .b2 -bitmap question -bd 3 -highlightthickness 0
checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
- -indicatoron 0
+ -indicatoron 0
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 23 33 27 37 27 37}
-test winbutton-1.4 {TkpComputeButtonGeometry procedure} {win nonPortable} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {31 41 23 33 27 37 27 37}
+
+test winbutton-1.4 {TkpComputeButtonGeometry procedure} -constraints {
+ win nonPortable
+} -setup {
deleteWindows
+} -body {
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}
@@ -86,26 +100,46 @@ test winbutton-1.4 {TkpComputeButtonGeometry procedure} {win nonPortable} {
pack .b1 .b2 .b3 .b4
update
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]
-} {58 24 67 33 88 30 90 28}
-test winbutton-1.5 {TkpComputeButtonGeometry procedure} {win nonPortable} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {58 24 67 33 88 30 90 28}
+
+test winbutton-1.5 {TkpComputeButtonGeometry procedure} -constraints {
+ win nonPortable
+} -setup {
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
+} -body {
+ label .l1 -wraplength 1.5i -padx 0 -pady 0 \
+ -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)."
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
-} {178 84}
-test winbutton-1.6 {TkpComputeButtonGeometry procedure} {win nonPortable} {
+} -cleanup {
deleteWindows
- label .l1 -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." -padx 0 -pady 0
+} -result {178 84}
+
+test winbutton-1.6 {TkpComputeButtonGeometry procedure} -constraints {
+ win nonPortable
+} -setup {
+ deleteWindows
+} -body {
+ label .l1 -padx 0 -pady 0 \
+ -text "This is a long string without wrapping.\n\nIt also has a blank line (above)."
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
-} {222 52}
-test winbutton-1.7 {TkpComputeButtonGeometry procedure} {win nonPortable} {
+} -cleanup {
+ deleteWindows
+} -result {222 52}
+
+test winbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints {
+ win nonPortable
+} -setup {
deleteWindows
+} -body {
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
@@ -113,33 +147,51 @@ test winbutton-1.7 {TkpComputeButtonGeometry procedure} {win nonPortable} {
pack .b1 .b2 .b3 .b4
update
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]
-} {74 24 67 97 174 46 64 28}
-test winbutton-1.8 {TkpComputeButtonGeometry procedure} {win nonPortable} {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
+ deleteWindows
+} -result {74 24 67 97 174 46 64 28}
+
+test winbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints {
+ win nonPortable
+} -setup {
deleteWindows
+} -body {
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
- -highlightthickness 4
+ -highlightthickness 4
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
- -highlightthickness 0
+ -highlightthickness 0
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 \
- -highlightthickness 1 -indicatoron no
+ -highlightthickness 1 -indicatoron no
radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -indicatoron 0
pack .b1 .b2 .b3 .b4
update
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]
-} {66 32 65 31 69 31 71 29}
-test winbutton-1.9 {TkpComputeButtonGeometry procedure} win {
+ [winfo reqwidth .b2] [winfo reqheight .b2] \
+ [winfo reqwidth .b3] [winfo reqheight .b3] \
+ [winfo reqwidth .b4] [winfo reqheight .b4]
+} -cleanup {
deleteWindows
+} -result {66 32 65 31 69 31 71 29}
+
+test winbutton-1.9 {TkpComputeButtonGeometry procedure} -constraints win -setup {
+ deleteWindows
+} -body {
button .b2 -bitmap question -default normal
list [winfo reqwidth .b2] [winfo reqheight .b2]
-} {23 33}
+} -cleanup {
+ deleteWindows
+} -result {23 33}
# cleanup
+imageFinish
deleteWindows
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/winClipboard.test b/tests/winClipboard.test
index ec84362..2a7ad73 100644
--- a/tests/winClipboard.test
+++ b/tests/winClipboard.test
@@ -10,67 +10,113 @@
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
+namespace import -force tcltest::test
# Note that these tests may fail if another application is grabbing the
# clipboard (e.g. an X server)
-test winClipboard-1.1 {TkSelGetSelection} win {
+test winClipboard-1.1 {TkSelGetSelection} -constraints win -setup {
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} {win testclipboard} {
+} -body {
+ selection get -selection CLIPBOARD
+} -cleanup {
clipboard clear
+} -returnCodes error -result {CLIPBOARD selection doesn't exist or form "STRING" not defined}
+
+test winClipboard-1.2 {TkSelGetSelection} -constraints {
+ win testclipboard
+} -setup {
+ clipboard clear
+} -body {
clipboard append {}
- catch {selection get -selection CLIPBOARD} r1
- catch {testclipboard} r2
- list $r1 $r2
-} {{} {}}
-test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {win testclipboard} {
+ list [selection get -selection CLIPBOARD] [testclipboard]
+} -cleanup {
+ clipboard clear
+} -result {{} {}}
+
+test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} -constraints {
+ win testclipboard
+} -setup {
clipboard clear
+} -body {
clipboard append abcd
update
- catch {selection get -selection CLIPBOARD} r1
- catch {testclipboard} r2
- list $r1 $r2
-} {abcd abcd}
-test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {win testclipboard} {
+ list [selection get -selection CLIPBOARD] [testclipboard]
+} -cleanup {
clipboard clear
+} -result {abcd abcd}
+
+test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} -constraints {
+ win testclipboard
+} -setup {
+ clipboard clear
+} -body {
+ set map [list "\r" "\\r" "\n" "\\n"]
clipboard append "line 1\nline 2"
- 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} {win testclipboard} {
+ list [string map $map [selection get -selection CLIPBOARD]]\
+ [string map $map [testclipboard]]
+} -cleanup {
+ clipboard clear
+} -result [list "line 1\\nline 2" "line 1\\nline 2"]
+
+test winClipboard-1.5 {TkSelGetSelection & TkWinClipboardRender} -constraints {
+ win testclipboard
+} -setup {
clipboard clear
+} -body {
+ set map [list "\r" "\\r" "\n" "\\n"]
clipboard append "line 1\u00c7\nline 2"
- 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"]]
+ list [string map $map [selection get -selection CLIPBOARD]]\
+ [string map $map [testclipboard]]
+} -cleanup {
+ clipboard clear
+} -result [list "line 1\u00c7\\nline 2" "line 1\u00c7\\nline 2"]
+
+test winClipboard-1.6 {TkSelGetSelection & TkWinClipboardRender} -constraints {
+ win testclipboard
+} -setup {
+ clipboard clear
+} -body {
+ clipboard append "\u043f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0444"
+ list [selection get -selection CLIPBOARD] [testclipboard]
+} -cleanup {
+ clipboard clear
+} -result [list "\u043f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0444"\
+ "\u043f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0444"]
-test winClipboard-2.1 {TkSelUpdateClipboard reentrancy problem} {win testclipboard} {
+test winClipboard-2.1 {TkSelUpdateClipboard reentrancy problem} -constraints {
+ win testclipboard
+} -setup {
clipboard clear
+} -body {
clipboard append -type OUR_ACTION "action data"
clipboard append "string data"
update
- 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} {win testclipboard} {
+ list [selection get -selection CLIPBOARD -type OUR_ACTION] [testclipboard]
+} -cleanup {
clipboard clear
+} -result {{action data} {string data}}
+
+test winClipboard-2.2 {TkSelUpdateClipboard reentrancy problem} -constraints {
+ win testclipboard
+} -setup {
+ clipboard clear
+} -body {
clipboard append -type OUR_ACTION "new data"
clipboard append "more data in string"
update
- catch {testclipboard} r1
- catch {selection get -selection CLIPBOARD -type OUR_ACTION} r2
- list $r1 $r2
-} [list "more data in string" "new data"]
+ list [testclipboard] [selection get -selection CLIPBOARD -type OUR_ACTION]
+} -cleanup {
+ clipboard clear
+} -result {{more data in string} {new data}}
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/winDialog.test b/tests/winDialog.test
index d340aee..c092e76 100644
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -7,8 +7,9 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 1998-1999 ActiveState Corporation.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
if {[testConstraint testwinevent]} {
@@ -31,6 +32,7 @@ proc start {arg} {
proc then {cmd} {
set ::command $cmd
set ::dialogresult {}
+ set ::testfont {}
afterbody
vwait ::dialogresult
@@ -39,12 +41,12 @@ proc then {cmd} {
proc afterbody {} {
if {$::tk_dialog == 0} {
- if {[incr ::iter_after] > 30} {
- set ::dialogresult ">30 iterations waiting on tk_dialog"
- return
- }
- after 150 {afterbody}
- return
+ if {[incr ::iter_after] > 30} {
+ set ::dialogresult ">30 iterations waiting on tk_dialog"
+ return
+ }
+ after 150 {afterbody}
+ return
}
uplevel #0 {set dialogresult [eval $command]}
}
@@ -70,7 +72,13 @@ proc SetText {id text} {
return [testwinevent $::tk_dialog $id WM_SETTEXT $text]
}
-test winDialog-1.1.0 {Tk_ChooseColorObjCmd} -constraints {
+proc ApplyFont {font} {
+ set ::testfont $font
+}
+
+# ----------------------------------------------------------------------
+
+test winDialog-1.1 {Tk_ChooseColorObjCmd} -constraints {
testwinevent
} -body {
start {tk_chooseColor}
@@ -78,7 +86,7 @@ test winDialog-1.1.0 {Tk_ChooseColorObjCmd} -constraints {
Click cancel
}
} -result {0}
-test winDialog-1.1.1 {Tk_ChooseColorObjCmd} -constraints {
+test winDialog-1.2 {Tk_ChooseColorObjCmd} -constraints {
testwinevent
} -body {
start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
@@ -87,7 +95,7 @@ test winDialog-1.1.1 {Tk_ChooseColorObjCmd} -constraints {
}
list $x $clr
} -result {0 {}}
-test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints {
+test winDialog-1.3 {Tk_ChooseColorObjCmd} -constraints {
testwinevent
} -body {
start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
@@ -96,9 +104,11 @@ test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints {
}
list $x $clr
} -result [list 0 "#ff9933"]
-test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints {
+test winDialog-1.4 {Tk_ChooseColorObjCmd: -title} -constraints {
testwinevent
-} -setup {unset -nocomplain a x} -body {
+} -setup {
+ catch {unset a x}
+} -body {
set x {}
start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]}
then {
@@ -110,9 +120,11 @@ test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints {
}
lappend x $clr
} -result [list Hello 0 "#ff9933"]
-test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints {
+test winDialog-1.5 {Tk_ChooseColorObjCmd: -title} -constraints {
testwinevent
-} -setup {unset -nocomplain a x} -body {
+} -setup {
+ catch {unset a x}
+} -body {
set x {}
start {
set clr [tk_chooseColor -initialcolor "#ff9933" \
@@ -127,9 +139,11 @@ test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints {
}
lappend x $clr
} -result [list "\u041f\u0440\u0438\u0432\u0435\u0442" 0 "#ff9933"]
-test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints {
+test winDialog-1.6 {Tk_ChooseColorObjCmd: -parent} -constraints {
testwinevent
-} -setup {unset -nocomplain a x} -body {
+} -setup {
+ catch {unset a x}
+} -body {
start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]}
set x {}
then {
@@ -143,292 +157,478 @@ test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints {
}
list $x $clr
} -result [list 1 "#ff9933"]
-test winDialog-1.1.6 {Tk_ChooseColorObjCmd: -parent} -constraints {
+test winDialog-1.7 {Tk_ChooseColorObjCmd: -parent} -constraints {
testwinevent
} -body {
tk_chooseColor -initialcolor "#ff9933" -parent .xyzzy12
} -returnCodes error -match glob -result {bad window path name*}
-test winDialog-2.1 {ColorDlgHookProc} {emptyTest nt} {
-} {}
-test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt testwinevent english} {
+test winDialog-2.1 {ColorDlgHookProc} -constraints {emptyTest nt} -body {}
+
+test winDialog-3.1 {Tk_GetOpenFileObjCmd} -constraints {
+ nt testwinevent english
+} -body {
start {tk_getOpenFile}
then {
- set x [GetText cancel]
- Click cancel
+ set x [GetText cancel]
+ Click cancel
}
- set x
-} {Cancel}
+ return $x
+} -result {Cancel}
+
-test winDialog-4.1 {Tk_GetSaveFileObjCmd} {nt testwinevent english} {
+test winDialog-4.1 {Tk_GetSaveFileObjCmd} -constraints {
+ nt testwinevent english
+} -body {
start {tk_getSaveFile}
then {
- set x [GetText cancel]
- Click cancel
+ set x [GetText cancel]
+ Click cancel
}
- set x
-} {Cancel}
+ return $x
+} -result {Cancel}
-test winDialog-5.1 {GetFileName: no arguments} {nt testwinevent} {
+test winDialog-5.1 {GetFileName: no arguments} -constraints {
+ nt testwinevent
+} -body {
start {tk_getOpenFile -title Open}
then {
- Click cancel
+ Click cancel
}
-} {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, -multiple, -parent, -title, or -typevariable}}
-test winDialog-5.4 {GetFileName: many arguments} {nt testwinevent} {
+} -result {0}
+test winDialog-5.2 {GetFileName: one argument} -constraints {
+ nt
+} -body {
+ tk_getOpenFile -foo
+} -returnCodes error -result {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
+test winDialog-5.3 {GetFileName: many arguments} -constraints {
+ nt testwinevent
+} -body {
start {tk_getOpenFile -initialdir c:/ -parent . -title test -initialfile foo}
then {
- Click cancel
+ Click cancel
}
-} {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, -multiple, -parent, -title, or -typevariable}}
-test winDialog-5.6 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} {nt testwinevent} {
+} -result {0}
+test winDialog-5.4 {GetFileName: Tcl_GetIndexFromObj() != TCL_OK} -constraints {
+ nt
+} -body {
+ tk_getOpenFile -foo bar -abc
+} -returnCodes error -result {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
+test winDialog-5.5 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} -constraints {
+ nt testwinevent
+} -body {
start {tk_getOpenFile -title bar}
then {
- Click cancel
+ Click cancel
}
-} {0}
-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 testwinevent} {
+} -result {0}
+test winDialog-5.6 {GetFileName: valid option, but missing value} -constraints {
+ nt
+} -body {
+ tk_getOpenFile -initialdir bar -title
+} -returnCodes error -result {value for "-title" missing}
+test winDialog-5.7 {GetFileName: extension begins with .} -constraints {
+ nt testwinevent
+} -body {
# if (string[0] == '.') {
-# string++;
+# string++;
# }
start {set x [tk_getSaveFile -defaultextension .foo -title Save]}
then {
- SetText 0x480 bar
- Click ok
+ SetText 0x480 bar
+ Click ok
}
string totitle $x
-} [string totitle [file join [pwd] bar.foo]]
-test winDialog-5.9 {GetFileName: extension doesn't begin with .} {nt testwinevent} {
+} -result [string totitle [file join [pwd] bar.foo]]
+test winDialog-5.8 {GetFileName: extension doesn't begin with .} -constraints {
+ nt testwinevent
+} -body {
start {set x [tk_getSaveFile -defaultextension foo -title Save]}
then {
- SetText 0x480 bar
- Click ok
+ SetText 0x480 bar
+ Click ok
}
string totitle $x
-} [string totitle [file join [pwd] bar.foo]]
-test winDialog-5.10 {GetFileName: file types} {nt testwinevent} {
-# case FILE_TYPES:
+} -result [string totitle [file join [pwd] bar.foo]]
+test winDialog-5.9 {GetFileName: file types} -constraints {
+ nt testwinevent
+} -body {
+# case FILE_TYPES:
start {tk_getSaveFile -filetypes {{"foo files" .foo FOOF}} -title Foo}
then {
- set x [GetText 0x470]
- Click cancel
+ set x [GetText 0x470]
+ Click cancel
}
- set x
-} {foo files (*.foo)}
-test winDialog-5.11 {GetFileName: file types: MakeFilter() fails} {nt} {
-# if (MakeFilter(interp, string, &utfFilterString) != TCL_OK)
+ return $x
+} -result {foo files (*.foo)}
+test winDialog-5.10 {GetFileName: file types: MakeFilter() fails} -constraints {
+ nt
+} -body {
+# if (MakeFilter(interp, string, &utfFilterString) != TCL_OK)
- list [catch {tk_getSaveFile -filetypes {{"foo" .foo FOO}}} msg] $msg
-} {1 {bad Macintosh file type "FOO"}}
+ tk_getSaveFile -filetypes {{"foo" .foo FOO}}
+} -returnCodes error -result {bad Macintosh file type "FOO"}
if {[info exists ::env(TEMP)]} {
-test winDialog-5.12 {GetFileName: initial directory} {nt testwinevent} {
-# case FILE_INITDIR:
+test winDialog-5.11 {GetFileName: initial directory} -constraints {
+ nt testwinevent
+} -body {
+# case FILE_INITDIR:
start {set x [tk_getSaveFile \
-initialdir [file normalize $::env(TEMP)] \
-initialfile "12x 455" -title Foo]}
then {
- Click ok
+ Click ok
}
- set x
-} [file join [file normalize $::env(TEMP)] "12x 455"]
+ return $x
+} -result [file join [file normalize $::env(TEMP)] "12x 455"]
}
-test winDialog-5.13 {GetFileName: initial directory: Tcl_TranslateFilename()} \
- {nt} {
-# if (Tcl_TranslateFileName(interp, string, &ds) == NULL)
-
- list [catch {tk_getOpenFile -initialdir ~12x/455} msg] $msg
-} {1 {user "12x" doesn't exist}}
-test winDialog-5.14 {GetFileName: initial file} {nt testwinevent} {
-# case FILE_INITFILE:
+test winDialog-5.12 {GetFileName: initial directory: Tcl_TranslateFilename()} -constraints {
+ nt
+} -body {
+# if (Tcl_TranslateFileName(interp, string, &ds) == NULL)
+
+ tk_getOpenFile -initialdir ~12x/455
+} -returnCodes error -result {user "12x" doesn't exist}
+test winDialog-5.13 {GetFileName: initial file} -constraints {
+ nt testwinevent
+} -body {
+# case FILE_INITFILE:
start {set x [tk_getSaveFile -initialfile "12x 456" -title Foo]}
then {
- Click ok
+ Click ok
}
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
-} {1 {user "12x" doesn't exist}}
-test winDialog-5.16 {GetFileName: initial file: long name} {nt testwinevent} {
+} -result [string totitle [file join [pwd] "12x 456"]]
+test winDialog-5.14 {GetFileName: initial file: Tcl_TranslateFileName()} -constraints {
+ nt
+} -body {
+# if (Tcl_TranslateFileName(interp, string, &ds) == NULL)
+ tk_getOpenFile -initialfile ~12x/455
+} -returnCodes error -result {user "12x" doesn't exist}
+test winDialog-5.15 {GetFileName: initial file: long name} -constraints {
+ nt testwinevent
+} -body {
start {
set dialogresult [catch {
tk_getSaveFile -initialfile [string repeat a 1024] -title Long
} x]
}
then {
- Click ok
+ Click ok
}
list $dialogresult [string match "invalid filename *" $x]
-} {1 1}
-test winDialog-5.17 {GetFileName: parent} {nt} {
-# case FILE_PARENT:
+} -result {1 1}
+test winDialog-5.16 {GetFileName: parent} -constraints {
+ nt
+} -body {
+# case FILE_PARENT:
toplevel .t
set x 0
start {tk_getOpenFile -parent .t -title Parent; set x 1}
then {
- destroy .t
+ destroy .t
}
- set x
-} {1}
-test winDialog-5.18 {GetFileName: title} {nt testwinevent} {
-# case FILE_TITLE:
-
+ return $x
+} -result {1}
+test winDialog-5.17 {GetFileName: title} -constraints {
+ nt testwinevent
+} -body {
+# case FILE_TITLE:
+
start {tk_getOpenFile -title Narf}
then {
- Click cancel
+ Click cancel
}
-} {0}
-test winDialog-5.19 {GetFileName: no filter specified} {nt testwinevent} {
-# if (ofn.lpstrFilter == NULL)
+} -result {0}
+test winDialog-5.18 {GetFileName: no filter specified} -constraints {
+ nt testwinevent
+} -body {
+# if (ofn.lpstrFilter == NULL)
- start {tk_getOpenFile -title Filter}
+ start {tk_getOpenFile -title Filter}
then {
- set x [GetText 0x470]
- Click cancel
+ set x [GetText 0x470]
+ Click cancel
}
- set x
-} {All Files (*.*)}
-test winDialog-5.20 {GetFileName: parent HWND doesn't yet exist} {nt} {
-# if (Tk_WindowId(parent) == None)
+ return $x
+} -result {All Files (*.*)}
+test winDialog-5.19 {GetFileName: parent HWND doesn't yet exist} -constraints {
+ nt
+} -setup {
+ destroy .t
+} -body {
+# if (Tk_WindowId(parent) == None)
toplevel .t
start {tk_getOpenFile -parent .t -title Open}
then {
- destroy .t
+ destroy .t
}
-} {}
-test winDialog-5.21 {GetFileName: parent HWND already exists} {nt} {
+} -result {}
+test winDialog-5.20 {GetFileName: parent HWND already exists} -constraints {
+ nt
+} -setup {
+ destroy .t
+} -body {
toplevel .t
update
start {tk_getOpenFile -parent .t -title Open}
then {
- destroy .t
+ destroy .t
}
-} {}
-test winDialog-5.22 {GetFileName: call GetOpenFileName} {nt testwinevent english} {
-# winCode = GetOpenFileName(&ofn);
-
+} -result {}
+test winDialog-5.21 {GetFileName: call GetOpenFileName} -constraints {
+ nt testwinevent english
+} -body {
+# winCode = GetOpenFileName(&ofn);
+
start {tk_getOpenFile -title Open}
then {
- set x [GetText ok]
- Click cancel
+ set x [GetText ok]
+ Click cancel
}
- set x
-} {&Open}
-test winDialog-5.23 {GetFileName: call GetSaveFileName} {nt testwinevent english} {
-# winCode = GetSaveFileName(&ofn);
+ return $x
+} -result {&Open}
+test winDialog-5.22 {GetFileName: call GetSaveFileName} -constraints {
+ nt testwinevent english
+} -body {
+# winCode = GetSaveFileName(&ofn);
start {tk_getSaveFile -title Save}
then {
- set x [GetText ok]
- Click cancel
+ set x [GetText ok]
+ Click cancel
}
- set x
-} {&Save}
+ return $x
+} -result {&Save}
if {[info exists ::env(TEMP)]} {
-test winDialog-5.24 {GetFileName: convert \ to /} {nt testwinevent} {
+test winDialog-5.23 {GetFileName: convert \ to /} -constraints {
+ nt testwinevent
+} -body {
start {set x [tk_getSaveFile -title Back]}
then {
- SetText 0x480 [file nativename \
+ SetText 0x480 [file nativename \
[file join [file normalize $::env(TEMP)] "12x 457"]]
- Click ok
+ Click ok
}
- set x
-} [file join [file normalize $::env(TEMP)] "12x 457"]
+ return $x
+} -result [file join [file normalize $::env(TEMP)] "12x 457"]
}
-test winDialog-5.25 {GetFileName: file types: MakeFilter() succeeds} {nt} {
+test winDialog-5.24 {GetFileName: file types: MakeFilter() succeeds} -constraints {
+ nt
+} -body {
# MacOS type that is correct, but has embedded nulls.
start {set x [catch {tk_getSaveFile -filetypes {{"foo" .foo {\0\0\0\0}}}}]}
then {
- Click cancel
+ Click cancel
}
- set x
-} {0}
-test winDialog-5.26 {GetFileName: file types: MakeFilter() succeeds} {nt} {
+ return $x
+} -result {0}
+test winDialog-5.25 {GetFileName: file types: MakeFilter() succeeds} -constraints {
+ nt
+} -body {
# MacOS type that is correct, but has embedded high-bit chars.
start {set x [catch {tk_getSaveFile -filetypes {{"foo" .foo {\u2022\u2022\u2022\u2022}}}}]}
then {
- Click cancel
+ Click cancel
}
- set x
-} {0}
+ return $x
+} -result {0}
+
+
+test winDialog-6.1 {MakeFilter} -constraints {emptyTest nt} -body {}
+
+
+test winDialog-7.1 {Tk_MessageBoxObjCmd} -constraints {emptyTest nt} -body {}
-test winDialog-6.1 {MakeFilter} {emptyTest nt} {} {}
-test winDialog-7.1 {Tk_MessageBoxObjCmd} {emptyTest nt} {} {}
+test winDialog-8.1 {OFNHookProc} -constraints {emptyTest nt} -body {}
-test winDialog-8.1 {OFNHookProc} {emptyTest nt} {} {}
## The Tk_ChooseDirectoryObjCmd hang on the static build of Windows
## because somehow the GetOpenFileName ends up a noop in the static
## build.
##
-test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} {nt testwinevent} {
+test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} -constraints {
+ nt testwinevent
+} -body {
start {tk_chooseDirectory}
then {
- Click cancel
+ Click cancel
}
-} {0}
-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 testwinevent} {
+} -result {0}
+test winDialog-9.2 {Tk_ChooseDirectoryObjCmd: one argument} -constraints {
+ nt
+} -body {
+ tk_chooseDirectory -foo
+} -returnCodes error -result {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title}
+test winDialog-9.3 {Tk_ChooseDirectoryObjCmd: many arguments} -constraints {
+ nt testwinevent
+} -body {
start {
- tk_chooseDirectory -initialdir c:/ -mustexist 1 -parent . -title test
+ tk_chooseDirectory -initialdir c:/ -mustexist 1 -parent . -title test
}
then {
- Click cancel
+ Click cancel
}
-} {0}
-test winDialog-9.4 {Tk_ChooseDirectoryObjCmd:\
- Tcl_GetIndexFromObj() != TCL_OK} {nt} {
- 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 testwinevent} {
+} -result {0}
+test winDialog-9.4 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() != TCL_OK} -constraints {
+ nt
+} -body {
+ tk_chooseDirectory -foo bar -abc
+} -returnCodes error -result {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title}
+test winDialog-9.5 {Tk_ChooseDirectoryObjCmd: Tcl_GetIndexFromObj() == TCL_OK} -constraints {
+ nt testwinevent
+} -body {
start {tk_chooseDirectory -title bar}
then {
- Click cancel
+ Click cancel
}
-} {0}
-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 testwinevent} {
-# case DIR_INITIAL:
+} -result {0}
+test winDialog-9.6 {Tk_ChooseDirectoryObjCmd: valid option, but missing value} -constraints {
+ nt
+} -body {
+ tk_chooseDirectory -initialdir bar -title
+} -returnCodes error -result {value for "-title" missing}
+test winDialog-9.7 {Tk_ChooseDirectoryObjCmd: -initialdir} -constraints {
+ nt testwinevent
+} -body {
+# case DIR_INITIAL:
start {set x [tk_chooseDirectory -initialdir c:/ -title Foo]}
then {
- Click ok
+ Click ok
}
string tolower [set x]
-} {c:/}
-test winDialog-9.8 {Tk_ChooseDirectoryObjCmd:\
- initial directory: Tcl_TranslateFilename()} {nt} {
-# if (Tcl_TranslateFileName(interp, string,
-# &utfDirString) == NULL)
-
- list [catch {tk_chooseDirectory -initialdir ~12x/455} msg] $msg
-} {1 {user "12x" doesn't exist}}
+} -result {c:/}
+test winDialog-9.8 {Tk_ChooseDirectoryObjCmd: initial directory: Tcl_TranslateFilename()} -constraints {
+ nt
+} -body {
+# if (Tcl_TranslateFileName(interp, string,
+# &utfDirString) == NULL)
+
+ tk_chooseDirectory -initialdir ~12x/455
+} -returnCodes error -result {user "12x" doesn't exist}
+
+
+test winDialog-10.1 {Tk_FontchooserObjCmd: no arguments} -constraints {
+ nt testwinevent
+} -body {
+ start {tk fontchooser show}
+ list [then {
+ Click cancel
+ }] $::testfont
+} -result {0 {}}
+test winDialog-10.2 {Tk_FontchooserObjCmd: -initialfont} -constraints {
+ nt testwinevent
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -font system
+ tk fontchooser show
+ }
+ list [then {
+ Click cancel
+ }] $::testfont
+} -result {0 {}}
+test winDialog-10.3 {Tk_FontchooserObjCmd: -initialfont} -constraints {
+ nt testwinevent
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -font system
+ tk fontchooser show
+ }
+ list [then {
+ Click 1
+ }] [expr {[llength $::testfont] ne {}}]
+} -result {0 1}
+test winDialog-10.4 {Tk_FontchooserObjCmd: -title} -constraints {
+ nt testwinevent
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -title "tk test"
+ tk fontchooser show
+ }
+ list [then {
+ Click cancel
+ }] $::testfont
+} -result {0 {}}
+test winDialog-10.5 {Tk_FontchooserObjCmd: -parent} -constraints {
+ nt testwinevent
+} -setup {
+ array set a {parent {}}
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -parent .
+ tk fontchooser show
+ }
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ Click cancel
+ }
+ list [expr {$a(parent) == [wm frame .]}] $::testfont
+} -result {1 {}}
+test winDialog-10.6 {Tk_FontchooserObjCmd: -apply} -constraints {
+ nt testwinevent
+} -body {
+ start {
+ tk fontchooser configure -command FooBarBaz
+ tk fontchooser show
+ }
+ then {
+ Click cancel
+ }
+} -result 0
+test winDialog-10.7 {Tk_FontchooserObjCmd: -apply} -constraints {
+ nt testwinevent
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -parent .
+ tk fontchooser show
+ }
+ list [then {
+ Click [expr {0x0402}] ;# value from XP
+ Click cancel
+ }] [expr {[llength $::testfont] > 0}]
+} -result {0 1}
+test winDialog-10.8 {Tk_FontchooserObjCmd: -title} -constraints {
+ nt testwinevent
+} -setup {
+ array set a {text failed}
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont -title "Hello"
+ tk fontchooser show
+ }
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ Click cancel
+ }
+ set a(text)
+} -result "Hello"
+test winDialog-10.9 {Tk_FontchooserObjCmd: -title} -constraints {
+ nt testwinevent
+} -setup {
+ array set a {text failed}
+} -body {
+ start {
+ tk fontchooser configure -command ApplyFont \
+ -title "\u041f\u0440\u0438\u0432\u0435\u0442"
+ tk fontchooser show
+ }
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ Click cancel
+ }
+ set a(text)
+} -result "\u041f\u0440\u0438\u0432\u0435\u0442"
if {[testConstraint testwinevent]} {
catch {testwinevent debug 0}
@@ -437,3 +637,8 @@ if {[testConstraint testwinevent]} {
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/winFont.test b/tests/winFont.test
index c61d124..8039426 100644
--- a/tests/winFont.test
+++ b/tests/winFont.test
@@ -1,48 +1,28 @@
-# This file is a Tcl script to test out the procedures in tkWinFont.c.
+# This file is a Tcl script to test out the procedures in tkWinFont.c.
# It is organized in the standard fashion for Tcl tests.
#
# Many of these tests are visually oriented and cannot be checked
# programmatically (such as "does an underlined font appear to be
# underlined?"); these tests attempt to exercise the code in question,
-# but there are no results that can be checked.
+# but there are no results that can be checked.
#
# Copyright (c) 1996-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
-catch {destroy .b}
-catch {font delete xyz}
-toplevel .b
-wm geometry .b +0+0
-update idletasks
-
-set courier {Courier 14}
-set cx [font measure $courier 0]
-
-label .b.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left -text "0" -font systemfixed
-pack .b.l
-canvas .b.c -closeenough 0
-
-set t [.b.c create text 0 0 -anchor nw -just left -font $courier]
-pack .b.c
-update
-
-set ax [winfo reqwidth .b.l]
-set ay [winfo reqheight .b.l]
-proc getsize {} {
- update
- return "[winfo reqwidth .b.l] [winfo reqheight .b.l]"
-}
-
-test winfont-1.1 {TkpGetNativeFont procedure: not native} win {
- list [catch {font measure {} xyz} msg] $msg
-} {1 {font "" doesn't exist}}
-test winfont-1.2 {TkpGetNativeFont procedure: native} win {
+test winfont-1.1 {TkpGetNativeFont procedure: not native} -constraints {
+ win
+} -body {
+ catch {font delete xyz}
+ font measure {} xyz
+} -returnCodes error -result {font "" doesn't exist}
+test winfont-1.2 {TkpGetNativeFont procedure: native} -constraints win -body {
font measure ansifixed 0
font measure ansi 0
font measure device 0
@@ -50,135 +30,363 @@ test winfont-1.2 {TkpGetNativeFont procedure: native} win {
font measure systemfixed 0
font measure system 0
set x {}
-} {}
-
-test winfont-2.1 {TkpGetFontFromAttributes procedure: pointsize} win {
- expr [font actual {-size -10} -size]>0
-} {1}
-test winfont-2.2 {TkpGetFontFromAttributes procedure: pointsize} win {
- expr [font actual {-family Arial} -size]>0
-} {1}
-test winfont-2.3 {TkpGetFontFromAttributes procedure: normal weight} win {
+} -result {}
+
+
+test winfont-2.1 {TkpGetFontFromAttributes procedure: pointsize} -constraints {
+ win
+} -body {
+ expr {[font actual {-size -10} -size] > 0}
+} -result {1}
+test winfont-2.2 {TkpGetFontFromAttributes procedure: pointsize} -constraints {
+ win
+} -body {
+ expr {[font actual {-family Arial} -size] > 0}
+} -result {1}
+test winfont-2.3 {TkpGetFontFromAttributes procedure: normal weight} -constraints {
+ win
+} -body {
font actual {-weight normal} -weight
-} {normal}
-test winfont-2.4 {TkpGetFontFromAttributes procedure: bold weight} win {
+} -result {normal}
+test winfont-2.4 {TkpGetFontFromAttributes procedure: bold weight} -constraints {
+ win
+} -body {
font actual {-weight bold} -weight
-} {bold}
-test winfont-2.5 {TkpGetFontFromAttributes procedure: no family} win {
+} -result {bold}
+test winfont-2.5 {TkpGetFontFromAttributes procedure: no family} -constraints {
+ win
+} -body {
catch {expr {[font actual {-size 10} -size]}}
-} 0
-test winfont-2.6 {TkpGetFontFromAttributes procedure: family} win {
+} -result 0
+test winfont-2.6 {TkpGetFontFromAttributes procedure: family} -constraints {
+ win
+} -body {
font actual {-family Arial} -family
-} {Arial}
-test winfont-2.7 {TkpGetFontFromAttributes procedure: Times fonts} win {
+} -result {Arial}
+test winfont-2.7 {TkpGetFontFromAttributes procedure: Times fonts} -constraints {
+ win
+} -setup {
set x {}
+} -body {
lappend x [font actual {-family "Times"} -family]
lappend x [font actual {-family "New York"} -family]
lappend x [font actual {-family "Times New Roman"} -family]
-} {{Times New Roman} {Times New Roman} {Times New Roman}}
-test winfont-2.8 {TkpGetFontFromAttributes procedure: Courier fonts} win {
+} -result {{Times New Roman} {Times New Roman} {Times New Roman}}
+test winfont-2.8 {TkpGetFontFromAttributes procedure: Courier fonts} -constraints {
+ win
+} -setup {
set x {}
+} -body {
lappend x [font actual {-family "Courier"} -family]
lappend x [font actual {-family "Monaco"} -family]
lappend x [font actual {-family "Courier New"} -family]
-} {{Courier New} {Courier New} {Courier New}}
-test winfont-2.9 {TkpGetFontFromAttributes procedure: Helvetica fonts} win {
+} -result {{Courier New} {Courier New} {Courier New}}
+test winfont-2.9 {TkpGetFontFromAttributes procedure: Helvetica fonts} -constraints {
+ win
+} -setup {
set x {}
+} -body {
lappend x [font actual {-family "Helvetica"} -family]
lappend x [font actual {-family "Geneva"} -family]
lappend x [font actual {-family "Arial"} -family]
-} {Arial Arial Arial}
-test winfont-2.10 {TkpGetFontFromAttributes procedure: fallback} win {
+} -result {Arial Arial Arial}
+test winfont-2.10 {TkpGetFontFromAttributes procedure: fallback} -constraints {
+ win
+} -body {
# No way to get it to fail! Any font name is acceptable.
-} {}
+} -result {}
-test winfont-3.1 {TkpDeleteFont procedure} win {
+
+test winfont-3.1 {TkpDeleteFont procedure} -constraints win -body {
+ catch {font delete xyz}
font actual {-family xyz}
set x {}
-} {}
+} -result {}
+
-test winfont-4.1 {TkpGetFontFamilies procedure} win {
+test winfont-4.1 {TkpGetFontFamilies procedure} -constraints win -body {
font families
set x {}
-} {}
-
-test winfont-5.1 {Tk_MeasureChars procedure: unbounded right margin} win {
- .b.l config -wrap 0 -text "000000"
- getsize
-} "[expr $ax*6] $ay"
-test winfont-5.2 {Tk_MeasureChars procedure: static width buffer exceeded} win {
- .b.l config -wrap 100000 -text "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
- getsize
-} "[expr $ax*256] $ay"
-test winfont-5.3 {Tk_MeasureChars procedure: all chars did fit} win {
- .b.l config -wrap [expr $ax*10] -text "00000000"
- getsize
-} "[expr $ax*8] $ay"
-test winfont-5.4 {Tk_MeasureChars procedure: not all chars fit} win {
- .b.l config -wrap [expr $ax*6] -text "00000000"
- getsize
-} "[expr $ax*6] [expr $ay*2]"
-test winfont-5.5 {Tk_MeasureChars procedure: include last partial char} win {
- .b.c dchars $t 0 end
- .b.c insert $t 0 "0000"
- .b.c index $t @[expr int($cx*2.5)],1
-} {2}
-test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} win {
- .b.l config -text "000000" -wrap 1
- getsize
-} "$ax [expr $ay*6]"
-test winfont-5.7 {Tk_MeasureChars procedure: whole words} win {
- .b.l config -wrap [expr $ax*8] -text "000000 0000"
- getsize
-} "[expr $ax*6] [expr $ay*2]"
-test winfont-5.8 {Tk_MeasureChars procedure: already saw space in line} win {
- .b.l config -wrap [expr $ax*12] -text "000000 0000000"
- getsize
-} "[expr $ax*7] [expr $ay*2]"
-test winfont-5.9 {Tk_MeasureChars procedure: internal spaces significant} win {
- .b.l config -wrap [expr $ax*12] -text "000 00 00000"
- getsize
-} "[expr $ax*7] [expr $ay*2]"
-test winfont-5.10 {Tk_MeasureChars procedure: make first part of word fit} win {
- .b.l config -wrap [expr $ax*12] -text "0000000000000000"
- getsize
-} "[expr $ax*12] [expr $ay*2]"
-test winfont-5.11 {Tk_MeasureChars procedure: check for kerning} \
- {win nonPortable} {
- set font [.b.l cget -font]
- .b.l config -font {{MS Sans Serif} 8} -text "W"
- set width [winfo reqwidth .b.l]
- .b.l config -text "XaYoYaKaWx"
+} -result {}
+
+destroy .t
+toplevel .t
+wm geometry .t +0+0
+update idletasks
+label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left -text "0" -font systemfixed
+pack .t.l
+canvas .t.c -closeenough 0
+
+set courier {Courier 14}
+set cx [font measure $courier 0]
+set t [.t.c create text 0 0 -anchor nw -just left -font $courier]
+pack .t.c
+update
+
+set ax [winfo reqwidth .t.l]
+set ay [winfo reqheight .t.l]
+proc getsize {} {
+ update
+ return "[winfo reqwidth .t.l] [winfo reqheight .t.l]"
+}
+
+test winfont-5.1 {Tk_MeasureChars procedure: unbounded right margin} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap 0 -text "000000"
+ list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \
+ [expr {[winfo reqheight .t.l] eq $ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.2 {Tk_MeasureChars procedure: static width buffer exceeded} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap 100000 -text "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+ list [expr {[winfo reqwidth .t.l] eq 256*$ax}] \
+ [expr {[winfo reqheight .t.l] eq $ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.3 {Tk_MeasureChars procedure: all chars did fit} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*10] -text "00000000"
+ list [expr {[winfo reqwidth .t.l] eq 8*$ax}] \
+ [expr {[winfo reqheight .t.l] eq $ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.4 {Tk_MeasureChars procedure: not all chars fit} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*6] -text "00000000"
+ list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \
+ [expr {[winfo reqheight .t.l] eq 2*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.5 {Tk_MeasureChars procedure: include last partial char} -constraints {
+ win
+} -setup {
+ destroy .t.c
+} -body {
+ canvas .t.c -closeenough 0
+ set t [.t.c create text 0 0 -anchor nw -just left -font $courier]
+ pack .t.c
+ update
+
+ .t.c dchars $t 0 end
+ .t.c insert $t 0 "0000"
+ .t.c index $t @[expr int($cx*2.5)],1
+} -cleanup {
+ destroy .t.c
+} -result {2}
+
+test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -text "000000" -wrap 1
+ list [expr {[winfo reqwidth .t.l] eq $ax}] \
+ [expr {[winfo reqheight .t.l] eq 6*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.7 {Tk_MeasureChars procedure: whole words} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*8] -text "000000 0000"
+ list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \
+ [expr {[winfo reqheight .t.l] eq 2*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.8 {Tk_MeasureChars procedure: already saw space in line} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*12] -text "000000 0000000"
+ list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \
+ [expr {[winfo reqheight .t.l] eq 2*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.9 {Tk_MeasureChars procedure: internal spaces significant} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*12] -text "000 00 00000"
+ list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \
+ [expr {[winfo reqheight .t.l] eq 2*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.10 {Tk_MeasureChars procedure: make first part of word fit} -constraints {
+ win
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ set ax [winfo reqwidth .t.l]
+ set ay [winfo reqheight .t.l]
+
+ .t.l config -wrap [expr $ax*12] -text "0000000000000000"
+ list [expr {[winfo reqwidth .t.l] eq 12*$ax}] \
+ [expr {[winfo reqheight .t.l] eq 2*$ay}]
+} -cleanup {
+ destroy .t.l
+} -result {1 1}
+
+test winfont-5.11 {Tk_MeasureChars procedure: check for kerning} -constraints {
+ win nonPortable
+} -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+
+ set font [.t.l cget -font]
+ .t.l config -font {{MS Sans Serif} 8} -text "W"
+ set width [winfo reqwidth .t.l]
+ .t.l config -text "XaYoYaKaWx"
set x [lindex [getsize] 0]
- .b.l config -font $font
+ .t.l config -font $font
expr $x < ($width*10)
-} 1
+} -cleanup {
+ destroy .t.l
+} -result {1}
-test winfont-6.1 {Tk_DrawChars procedure: loop test} win {
- .b.l config -text "a"
+
+test winfont-6.1 {Tk_DrawChars procedure: loop test} -constraints win -setup {
+ destroy .t.l
+} -body {
+ label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
+ -text "0" -font systemfixed
+ pack .t.l
+ update
+ .t.l config -text "a"
update
-} {}
+} -cleanup {
+ destroy .t.l
+} -result {}
+
-test winfont-7.1 {AllocFont procedure: use old font} win {
+test winfont-7.1 {AllocFont procedure: use old font} -constraints win -setup {
+ destroy .c
+} -setup {
+ catch {font delete xyz}
+} -body {
font create xyz
- catch {destroy .c}
button .c -font xyz
font configure xyz -family times
update
destroy .c
font delete xyz
-} {}
-test winfont-7.2 {AllocFont procedure: extract info from logfont} win {
+} -result {}
+test winfont-7.2 {AllocFont procedure: extract info from logfont} -constraints {
+ win
+} -body {
font actual {arial 10 bold italic underline overstrike}
-} {-family Arial -size 10 -weight bold -slant italic -underline 1 -overstrike 1}
-test winfont-7.3 {AllocFont procedure: extract info from textmetric} win {
+} -result {-family Arial -size 10 -weight bold -slant italic -underline 1 -overstrike 1}
+test winfont-7.3 {AllocFont procedure: extract info from textmetric} -constraints {
+ win
+} -body {
font metric {arial 10 bold italic underline overstrike} -fixed
-} {0}
-test winfont-7.4 {AllocFont procedure: extract info from textmetric} win {
+} -result {0}
+test winfont-7.4 {AllocFont procedure: extract info from textmetric} -constraints {
+ win
+} -body {
font metric systemfixed -fixed
-} {1}
+} -result {1}
# cleanup
-destroy .b
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/winMenu.test b/tests/winMenu.test
index 7240bf5..ce2069f 100644
--- a/tests/winMenu.test
+++ b/tests/winMenu.test
@@ -7,140 +7,183 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
-test winMenu-1.1 {GetNewID} win {
- catch {destroy .m1}
- list [catch {menu .m1} msg] $msg [destroy .m1]
-} {0 .m1 {}}
+test winMenu-1.1 {GetNewID} -constraints win -setup {
+ destroy .m1
+} -body {
+ menu .m1
+} -cleanup {
+ destroy .m1
+} -returnCodes ok -result {.m1}
+test winMenu-1.2 {GetNewID} -constraints win -setup {
+ destroy .m1
+} -body {
+ menu .m1
+ destroy .m1
+} -result {}
+
+
# Basically impossible to test menu IDs wrapping.
-test winMenu-2.1 {FreeID} win {
- catch {destroy .m1}
+test winMenu-2.1 {FreeID} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
+ destroy .m1
+} -returnCodes ok
-test winMenu-3.1 {TkpNewMenu} win {
- catch {destroy .m1}
+
+test winMenu-3.1 {TkpNewMenu} -constraints win -setup {
+ destroy .m1
+} -body {
list [catch {menu .m1} msg] $msg [catch {destroy .m1} msg2] $msg2
-} {0 .m1 0 {}}
-test winMenu-3.2 {TkpNewMenu} win {
- catch {destroy .m1}
+} -result {0 .m1 0 {}}
+test winMenu-3.2 {TkpNewMenu} -constraints win -setup {
+ destroy .m1
+} -body {
. configure -menu ""
menu .m1
.m1 add command -label "foo"
list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [catch {destroy .m1} msg2] $msg2
-} {0 {} {} 0 {}}
+} -result {0 {} {} 0 {}}
+
-test winMenu-4.1 {TkpDestroyMenu} win {
- catch {destroy .m1}
+test winMenu-4.1 {TkpDestroyMenu} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
- list [catch {destroy .m1} msg] $msg
-} {0 {}}
-test winMenu-4.2 {TkpDestroyMenu - help menu} win {
- catch {destroy .m1}
+ destroy .m1
+} -returnCodes ok
+test winMenu-4.2 {TkpDestroyMenu - help menu} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -menu .m1.system
. configure -menu .m1
list [catch {destroy .m1.system} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+} -result {0 {} {} {}}
+
-test winMenu-5.1 {TkpDestroyMenuEntry} win {
- catch {destroy .m1}
+test winMenu-5.1 {TkpDestroyMenuEntry} -constraints win -setup {
+ destroy .m1
+} -body {
. configure -menu ""
menu .m1
.m1 add command -label "test"
update idletasks
list [catch {.m1 delete 1} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
-test winMenu-6.1 {GetEntryText} win {
- catch {destroy .m1}
+
+test winMenu-6.1 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
list [catch {menu .m1} msg] $msg [destroy .m1]
-} {0 .m1 {}}
-test winMenu-6.2 {GetEntryText} {testImageType win} {
- catch {destroy .m1}
+} -result {0 .m1 {}}
+test winMenu-6.2 {GetEntryText} -constraints {
+ testImageType win
+} -setup {
+ destroy .m1
+} -body {
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 winMenu-6.3 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-6.3 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -bitmap questhead} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.4 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.4 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.5 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.5 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "foo"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.6 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.6 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "This string has one & in it"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.7 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.7 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The & should be underlined." -underline 4} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.8 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.8 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The * should be underlined." -underline 4} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.9 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.9 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "foo" -accel "bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.10 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.10 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "This string has one & in it" -accel "bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.11 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.11 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The & should be underlined." -underline 4 -accel "bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.12 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.12 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The * should be underlined." -underline 4 -accel "bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.13 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.13 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "foo" -accel "&bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.14 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.14 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "This string has one & in it" -accel "&bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.15 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.15 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The & should be underlined." -underline 4 -accel "&bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-6.16 {GetEntryText} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-6.16 {GetEntryText} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command -label "The * should be underlined." -underline 4 -accel "&bar"} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
-test winMenu-7.1 {ReconfigureWindowsMenu - system menu item removal} win {
- catch {destroy .m1}
+test winMenu-7.1 {ReconfigureWindowsMenu - system menu item removal} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -menu .m1.system
menu .m1.system
@@ -148,103 +191,140 @@ test winMenu-7.1 {ReconfigureWindowsMenu - system menu item removal} win {
update idletasks
.m1.system add command -label bar
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test winMenu-7.2 {ReconfigureWindowsMenu - menu item removal} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.2 {ReconfigureWindowsMenu - menu item removal} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label Hello
update idletasks
.m1 add command -label foo
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.3 {ReconfigureWindowsMenu - zero items} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.3 {ReconfigureWindowsMenu - zero items} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label Hello
.m1 delete Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.4 {ReconfigureWindowsMenu - one item} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.4 {ReconfigureWindowsMenu - one item} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.5 {ReconfigureWindowsMenu - two items} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.5 {ReconfigureWindowsMenu - two items} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label One
.m1 add command -label Two
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.6 {ReconfigureWindowsMenu - separator item} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.6 {ReconfigureWindowsMenu - separator item} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add separator
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.7 {ReconfigureWindowsMenu - non-text item} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.7 {ReconfigureWindowsMenu - non-text item} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.8 {ReconfigureWindowsMenu - disabled item} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.8 {ReconfigureWindowsMenu - disabled item} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label Hello -state disabled
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.9 {ReconfigureWindowsMenu - non-selected checkbutton} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.9 {ReconfigureWindowsMenu - non-selected checkbutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add checkbutton -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.10 {ReconfigureWindowsMenu - non-selected radiobutton} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.10 {ReconfigureWindowsMenu - non-selected radiobutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add radiobutton -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.11 {ReconfigureWindowsMenu - selected checkbutton} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.11 {ReconfigureWindowsMenu - selected checkbutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add checkbutton -label Hello
.m1 invoke Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.12 {ReconfigureWindowsMenu - selected radiobutton} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.12 {ReconfigureWindowsMenu - selected radiobutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add radiobutton -label Hello
.m1 invoke Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.13 {ReconfigureWindowsMenu - cascade missing} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.13 {ReconfigureWindowsMenu - cascade missing} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-7.14 {ReconfigureWindowsMenu - cascade} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-7.14 {ReconfigureWindowsMenu - cascade} -constraints win -setup {
+ destroy .m1
+} -body {
catch {destroy .m2}
menu .m1 -tearoff 0
menu .m2
.m1 add cascade -menu .m2 -label Hello
list [catch {update idletasks} msg] $msg [destroy .m1] [destroy .m2]
-} {0 {} {} {}}
-test winMenu-7.15 {ReconfigureWindowsMenu - menubar without system menu} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.15 {ReconfigureWindowsMenu - menubar without system menu} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.file
menu .m1.file -tearoff 0
. configure -menu .m1
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test winMenu-7.16 {ReconfigureWindowsMenu - system menu already created} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.16 {ReconfigureWindowsMenu - system menu already created} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.system
menu .m1.system -tearoff 0
@@ -252,17 +332,23 @@ test winMenu-7.16 {ReconfigureWindowsMenu - system menu already created} win {
update idletasks
.m1.system add command -label Hello
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test winMenu-7.17 {ReconfigureWindowsMenu - system menu update pending} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.17 {ReconfigureWindowsMenu - system menu update pending} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.system
menu .m1.system -tearoff 0
. configure -menu .m1
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test winMenu-7.18 {ReconfigureWindowsMenu - system menu update not pending} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.18 {ReconfigureWindowsMenu - system menu update not pending} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.system
menu .m1.system -tearoff 0
@@ -270,521 +356,717 @@ test winMenu-7.18 {ReconfigureWindowsMenu - system menu update not pending} win
update idletasks
. configure -menu .m1
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
-test winMenu-7.19 {ReconfigureWindowsMenu - column break} win {
- catch {destroy .m1}
+} -result {0 {} {} {}}
+test winMenu-7.19 {ReconfigureWindowsMenu - column break} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two -columnbreak 1
list [catch {update idletasks} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
+
#Don't know how to generate nested post menus
-test winMenu-8.1 {TkpPostMenu} win {
- catch {destroy .m1}
+
+test winMenu-8.1 {TkpPostMenu} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -postcommand "blork"
- list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
-} {1 {invalid command name "blork"} {}}
-test winMenu-8.2 {TkpPostMenu} win {
- catch {destroy .m1}
+ .m1 post 40 40
+} -returnCodes error -result {invalid command name "blork"}
+test winMenu-8.2 {TkpPostMenu} -constraints win -setup {
+ destroy .m1
+} -body {
+ menu .m1 -postcommand "blork"
+ .m1 post 40 40
+ destroy .m1
+} -returnCodes error -result {invalid command name "blork"}
+test winMenu-8.3 {TkpPostMenu} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -postcommand "destroy .m1"
list [.m1 post 40 40] [winfo exists .m1]
-} {{} 0}
-test winMenu-8.3 {TkpPostMenu - popup menu} {win userInteraction} {
- catch {destroy .m1}
+} -result {{} 0}
+test winMenu-8.4 {TkpPostMenu - popup menu} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-8.3: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
-test winMenu-8.4 {TkpPostMenu - menu button} {win userInteraction} {
- catch {destroy .mb}
+} -result {{} {}}
+test winMenu-8.5 {TkpPostMenu - menu button} -constraints {
+ win userInteraction
+} -setup {
+ destroy .mb
+} -body {
menubutton .mb -text test -menu .mb.menu
menu .mb.menu
.mb.menu add command -label "winMenu-8.4 - Hit ESCAPE."
pack .mb
- list [tk::MbPost .mb] [destroy .m1]
-} {{} {}}
-test winMenu-8.5 {TkpPostMenu - update not pending} {win userInteraction} {
- catch {destroy .m1}
+ list [tk::MbPost .mb] [destroy .mb]
+} -result {{} {}}
+test winMenu-8.6 {TkpPostMenu - update not pending} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-8.5 - Hit ESCAPE."
update idletasks
list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
-test winMenu-9.1 {TkpMenuNewEntry} win {
- catch {destroy .m1}
+
+test winMenu-9.1 {TkpMenuNewEntry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
list [catch {.m1 add command} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
+
-test winMenu-10.1 {TkwinMenuProc} {win userInteraction} {
- catch {destroy .m1}
+test winMenu-10.1 {TkwinMenuProc} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-10.1: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
# Can't generate a WM_INITMENU without a Tk menu yet.
-test winMenu-11.1 {TkWinHandleMenuEvent - WM_INITMENU} {win userInteraction} {
- catch {destroy .m1}
+
+test winMenu-11.1 {TkWinHandleMenuEvent - WM_INITMENU} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1 -postcommand "set foo test"
.m1 add command -label "winMenu-11.1: Hit ESCAPE."
list [.m1 post 40 40] [set foo] [unset foo] [destroy .m1]
-} {test test {} {}}
-test winMenu-11.2 {TkWinHandleMenuEvent - WM_COMMAND} {win userInteraction} {
- catch {destroy .m1}
+} -result {test test {} {}}
+test winMenu-11.2 {TkWinHandleMenuEvent - WM_COMMAND} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
menu .m1
.m1 add checkbutton -variable foo -label "winMenu-11.2: Please select this menu item."
list [.m1 post 40 40] [update] [set foo] [unset foo] [destroy .m1]
-} {{} {} 1 {} {}}
-test winMenu-11.3 {TkWinHandleMenuEvent - WM_COMMAND} {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {} 1 {} {}}
+test winMenu-11.3 {TkWinHandleMenuEvent - WM_COMMAND} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
catch {unset foo}
proc bgerror {args} {
- global foo errorInfo
- set foo [list $args $errorInfo]
+ global foo errorInfo
+ set foo [list $args $errorInfo]
}
menu .m1
.m1 add command -command {error 1} -label "winMenu-11.2: Please select this menu item."
list [.m1 post 40 40] [update] [set foo] [unset foo] [destroy .m1]
-} {{} {} {1 {1
+} -result {{} {} {1 {1
while executing
"error 1"
(menu invoke)}} {} {}}
+
# Can't test WM_MENUCHAR
-test winMenu-11.4 {TkWinHandleMenuEvent - WM_MEASUREITEM} {win userInteraction} {
- catch {destroy .m1}
+
+test winMenu-11.4 {TkWinHandleMenuEvent - WM_MEASUREITEM} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-11.3: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
-test winMenu-11.5 {TkWinHandleMenuEvent - WM_MEASUREITEM} {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-11.5 {TkWinHandleMenuEvent - WM_MEASUREITEM} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label "winMenu-11.4: Hit ESCAPE" -hidemargin 1
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
-test winMenu-11.6 {TkWinHandleMenuEvent - WM_DRAWITEM} {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-11.6 {TkWinHandleMenuEvent - WM_DRAWITEM} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-11.5: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
-test winMenu-11.7 {TkWinHandleMenuEvent - WM_DRAWITEM - item disabled} \
- {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-11.7 {TkWinHandleMenuEvent - WM_DRAWITEM - item disabled} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-11.6: Hit ESCAPE." -state disabled
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
-test winMenu-11.8 {TkWinHandleMenuEvent - WM_INITMENU - not pending} \
- {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-11.8 {TkWinHandleMenuEvent - WM_INITMENU - not pending} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label "winMenu-11.7: Hit ESCAPE"
update idletasks
list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
-test winMenu-12.1 {TkpSetWindowMenuBar} win {
- catch {destroy .m1}
+
+test winMenu-12.1 {TkpSetWindowMenuBar} -constraints win -setup {
+ destroy .m1
+} -body {
. configure -menu ""
menu .m1
.m1 add command -label foo
list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [catch {destroy .m1} msg2] $msg2
-} {0 {} {} 0 {}}
-test winMenu-12.2 {TkpSetWindowMenuBar} win {
- catch {destroy .m1}
+} -result {0 {} {} 0 {}}
+test winMenu-12.2 {TkpSetWindowMenuBar} -constraints win -setup {
+ destroy .m1
+} -body {
. configure -menu ""
menu .m1
.m1 add command -label foo
. configure -menu .m1
list [catch {. configure -menu ""} msg] $msg [catch {destroy .m1} msg2] $msg2
-} {0 {} 0 {}}
-test winMenu-12.3 {TkpSetWindowMenuBar - no update pending} win {
- catch {destroy .m1}
+} -result {0 {} 0 {}}
+test winMenu-12.3 {TkpSetWindowMenuBar - no update pending} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
. configure -menu ""
menu .m1 -tearoff 0
.m1 add command -label foo
update idletasks
list [catch {. configure -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1]
-} {0 {} {} {}}
+} -result {0 {} {} {}}
+
+
+test winMenu-13.1 {TkpSetMainMenubar - nothing to do} -constraints {
+ emptyTest win
+} -body {}
-test winMenu-13.1 {TkpSetMainMenubar - nothing to do} {emptyTest win} {} {}
-test winMenu-14.1 {GetMenuIndicatorGeometry} win {
- catch {destroy .m1}
+test winMenu-14.1 {GetMenuIndicatorGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test winMenu-14.2 {GetMenuIndicatorGeometry} win {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test winMenu-14.2 {GetMenuIndicatorGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -hidemargin 1
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
-test winMenu-15.1 {GetMenuAccelGeometry} win {
- catch {destroy .m1}
+
+test winMenu-15.1 {GetMenuAccelGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo -accel Ctrl+U
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test winMenu-15.2 {GetMenuAccelGeometry} win {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test winMenu-15.2 {GetMenuAccelGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
-test winMenu-15.3 {GetMenuAccelGeometry} win {
- catch {destroy .m1}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+test winMenu-15.3 {GetMenuAccelGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+
-test winMenu-16.1 {GetTearoffEntryGeometry} {win userInteraction} {
- catch {destroy .m1}
+test winMenu-16.1 {GetTearoffEntryGeometry} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-19.1: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test winMenu-17.1 {GetMenuSeparatorGeometry} win {
- catch {destroy .m1}
+
+test winMenu-17.1 {GetMenuSeparatorGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
- list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
-} {0 {}}
+ tk::TearOffMenu .m1 40 40
+ destroy .m1
+} -returnCodes ok
+
# Currently, the only callers to DrawWindowsSystemBitmap want things
# centered vertically, and either centered or right aligned horizontally.
-test winMenu-18.1 {DrawWindowsSystemBitmap - center aligned} win {
- catch {destroy .m1}
+test winMenu-18.1 {DrawWindowsSystemBitmap - center aligned} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-19.1 {DrawMenuEntryIndicator - not checkbutton or radiobutton} \
- win {
- catch {destroy .m1}
+test winMenu-19.1 {DrawMenuEntryIndicator - not checkbutton or radiobutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-19.2 {DrawMenuEntryIndicator - not selected} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-19.2 {DrawMenuEntryIndicator - not selected} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add radiobutton -label foo
.m1 invoke foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-19.5 {DrawMenuEntryIndicator - disabled} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-19.5 {DrawMenuEntryIndicator - disabled} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
.m1 entryconfigure foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
.m1 invoke foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test winMenu-20.1 {DrawMenuEntryAccelerator - disabled} win {
- catch {destroy .m1}
+
+test winMenu-20.1 {DrawMenuEntryAccelerator - disabled} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground red
.m1 add command -label foo -accel "Ctrl+U" -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground ""
.m1 add command -label foo -accel "Ctrl+U" -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} \
- {win userInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label "winMenu-23.5: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-21.1 {DrawMenuSeparator} win {
- catch {destroy .m1}
+test winMenu-21.1 {DrawMenuSeparator} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-22.1 {DrawMenuUnderline} win {
- catch {destroy .m1}
+test winMenu-22.1 {DrawMenuUnderline} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -underline 0
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test winMenu-23.1 {Don't know how to test MenuKeyBindProc} \
- {win emptyTest} {} {}
-test winMenu-24.1 {TkpInitializeMenuBindings called at boot time} \
- {win emptyTest} {} {}
-test winMenu-25.1 {DrawMenuEntryLabel - normal} win {
- catch {destroy .m1}
+test winMenu-23.1 {Don't know how to test MenuKeyBindProc} -constraints {
+ win emptyTest
+} -body {}
+
+
+test winMenu-24.1 {TkpInitializeMenuBindings called at boot time} -constraints {
+ win emptyTest
+} -body {}
+
+
+test winMenu-25.1 {DrawMenuEntryLabel - normal} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground red
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-26.1 {TkpComputeMenubarGeometry} win {
- catch {destroy .m1}
+test winMenu-26.1 {TkpComputeMenubarGeometry} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label File
list [. configure -menu .m1] [. configure -menu ""] [destroy .m1]
-} {{} {} {}}
+} -result {{} {} {}}
-test winMenu-27.1 {DrawTearoffEntry} {win userInteraction} {
- catch {destroy .m1}
+
+test winMenu-27.1 {DrawTearoffEntry} -constraints {
+ win userInteraction
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "winMenu-24.4: Hit ESCAPE."
list [.m1 post 40 40] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-28.1 {TkpConfigureMenuEntry - update pending} win {
- catch {destroy .m1}
+test winMenu-28.1 {TkpConfigureMenuEntry - update pending} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label Hello
list [catch {.m1 add command -label Two} msg] $msg [destroy .m1]
-} {0 {} {}}
-test winMenu-28.2 {TkpConfigureMenuEntry - update not pending} win {
- catch {destroy .m1}
+} -result {0 {} {}}
+test winMenu-28.2 {TkpConfigureMenuEntry - update not pending} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label One
update idletasks
list [catch {.m1 add command -label Two} msg] $msg [destroy .m1]
-} {0 {} {}}
+} -result {0 {} {}}
+
-test winMenu-29.1 {TkpDrawMenuEntry - gc for active and not strict motif} win {
- catch {destroy .m1}
+test winMenu-29.1 {TkpDrawMenuEntry - gc for active and not strict motif} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activeforeground red
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.3 {TkpDrawMenuEntry - gc for active and strict motif} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.3 {TkpDrawMenuEntry - gc for active and strict motif} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
set tk_strictMotif 1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
-} {{} {} 0}
-test winMenu-29.4 \
- {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} \
- win {
- catch {destroy .m1}
+} -result {{} {} 0}
+test winMenu-29.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled -background red
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -foreground red
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo -selectcolor orange
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.11 {TkpDrawMenuEntry - border - custom entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.11 {TkpDrawMenuEntry - border - custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activebackground green
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.12 {TkpDrawMenuEntry - border} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.12 {TkpDrawMenuEntry - border} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.13 {TkpDrawMenuEntry - active border - strict motif} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.13 {TkpDrawMenuEntry - active border - strict motif} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
set tk_strictMotif 1
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
-} {{} {} 0}
-test winMenu-29.14 {TkpDrawMenuEntry - active border - custom entry} win {
- catch {destroy .m1}
+} -result {{} {} 0}
+test winMenu-29.14 {TkpDrawMenuEntry - active border - custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -activeforeground yellow
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.15 {TkpDrawMenuEntry - active border} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.15 {TkpDrawMenuEntry - active border} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.16 {TkpDrawMenuEntry - font - custom entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.16 {TkpDrawMenuEntry - font - custom entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo -font "Helvectica 72"
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.17 {TkpDrawMenuEntry - font} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.17 {TkpDrawMenuEntry - font} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1 -font "Courier 72"
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.18 {TkpDrawMenuEntry - separator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.18 {TkpDrawMenuEntry - separator} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.19 {TkpDrawMenuEntry - standard} win {
- catch {destroy .mb}
+} -result {{} {}}
+test winMenu-29.19 {TkpDrawMenuEntry - standard} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add cascade -label File -menu .m1.file
menu .m1.file
@@ -792,160 +1074,211 @@ test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} win {
.m1 entryconfigure File -state disabled
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.21 {TkpDrawMenuEntry - indicator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.21 {TkpDrawMenuEntry - indicator} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label winMenu-31.20
.m1 invoke winMenu-31.20
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-29.22 {TkpDrawMenuEntry - indicator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-29.22 {TkpDrawMenuEntry - indicator} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label winMenu-31.21 -hidemargin 1
.m1 invoke winMenu-31.21
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test winMenu-30.1 {GetMenuLabelGeometry - image} {testImageType win} {
- catch {destroy .m1}
+
+test winMenu-30.1 {GetMenuLabelGeometry - image} -constraints {
+ testImageType win
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
menu .m1
image create test image1
.m1 add command -image image1
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test winMenu-30.2 {GetMenuLabelGeometry - bitmap} win {
- catch {destroy .m1}
+} -result {{} {} {}}
+test winMenu-30.2 {GetMenuLabelGeometry - bitmap} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -bitmap questhead
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-30.3 {GetMenuLabelGeometry - no text} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-30.3 {GetMenuLabelGeometry - no text} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-30.4 {GetMenuLabelGeometry - text} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-30.4 {GetMenuLabelGeometry - text} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "This is a test."
list [update idletasks] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
+
-test winMenu-31.1 {DrawMenuEntryBackground} win {
- catch {destroy .m1}
+test winMenu-31.1 {DrawMenuEntryBackground} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
-} {{} {}}
-test winMenu-31.2 {DrawMenuEntryBackground} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-31.2 {DrawMenuEntryBackground} -constraints win -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label foo
set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff activate 0
list [update] [destroy .m1]
-} {{} {}}
+} -result {{} {}}
-test winMenu-32.1 {TkpComputeStandardMenuGeometry - no entries} win {
- catch {destroy .m1}
+
+test winMenu-32.1 {TkpComputeStandardMenuGeometry - no entries} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.2 {TkpComputeStandardMenuGeometry - one entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.2 {TkpComputeStandardMenuGeometry - one entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "one"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.3 {TkpComputeStandardMenuGeometry - more than one entry} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.3 {TkpComputeStandardMenuGeometry - more than one entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.4 {TkpComputeStandardMenuGeometry - separator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.4 {TkpComputeStandardMenuGeometry - separator} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add separator
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.5 {TkpComputeStandardMenuGeometry - tearoff entry} {unix nonUnixUserInteraction} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.5 {TkpComputeStandardMenuGeometry - tearoff entry} -constraints {
+ unix nonUnixUserInteraction
+} -setup {
+ destroy .mb
+} -body {
menubutton .mb -text "test" -menu .mb.m
menu .mb.m
.mb.m add command -label test
pack .mb
catch {tk::MbPost .mb}
list [update] [destroy .mb]
-} {{} {}}
-test winMenu-32.6 {TkpComputeStandardMenuGeometry - standard label geometry} \
- win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.6 {TkpComputeStandardMenuGeometry - standard label geometry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.7 {TkpComputeStandardMenuGeometry - different font for entry} \
- win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.7 {TkpComputeStandardMenuGeometry - different font for entry} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -font "Helvetica 12"
.m1 add command -label "test" -font "Courier 12"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.8 {TkpComputeStandardMenuGeometry - second entry larger} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.8 {TkpComputeStandardMenuGeometry - second entry larger} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test"
.m1 add command -label "test test"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.9 {TkpComputeStandardMenuGeometry - first entry larger} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.9 {TkpComputeStandardMenuGeometry - first entry larger} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test test"
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.10 {TkpComputeStandardMenuGeometry - accelerator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.10 {TkpComputeStandardMenuGeometry - accelerator} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test" -accel "Ctrl+S"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.11 {TkpComputeStandardMenuGeometry - second accel larger} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.11 {TkpComputeStandardMenuGeometry - second accel larger} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test" -accel "1"
.m1 add command -label "test" -accel "1 1"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.12 {TkpComputeStandardMenuGeometry - second accel smaller} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.12 {TkpComputeStandardMenuGeometry - second accel smaller} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label "test" -accel "1 1"
.m1 add command -label "test" -accel "1"
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.13 {TkpComputeStandardMenuGeometry - indicator} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.13 {TkpComputeStandardMenuGeometry - indicator} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add checkbutton -label test
.m1 invoke 1
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.14 \
- {TkpComputeStandardMenuGeometry - second indicator less or equal} \
- {testImageType win} {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.14 {TkpComputeStandardMenuGeometry - second indicator less or equal} -constraints {
+ testImageType win
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
image create test image1
menu .m1
.m1 add checkbutton -image image1
@@ -953,11 +1286,13 @@ test winMenu-32.14 \
.m1 add checkbutton -label test
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test winMenu-32.15 {TkpComputeStandardMenuGeometry - second indicator larger} \
- {testImageType unix} {
- catch {destroy .m1}
+} -result {{} {} {}}
+test winMenu-32.15 {TkpComputeStandardMenuGeometry - second indicator larger} -constraints {
+ testImageType unix
+} -setup {
+ destroy .m1
catch {image delete image1}
+} -body {
image create test image1
menu .m1
.m1 add checkbutton -image image1
@@ -965,31 +1300,42 @@ test winMenu-32.15 {TkpComputeStandardMenuGeometry - second indicator larger} \
.m1 add checkbutton -label test
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
-} {{} {} {}}
-test winMenu-32.16 {TkpComputeStandardMenuGeometry - zero sized menus} win {
- catch {destroy .m1}
+} -result {{} {} {}}
+test winMenu-32.16 {TkpComputeStandardMenuGeometry - zero sized menus} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.17 {TkpComputeStandardMenuGeometry - first column bigger} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.17 {TkpComputeStandardMenuGeometry - first column bigger} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1
.m1 add command -label one
.m1 add command -label two
.m1 add command -label three -columnbreak 1
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.18 {TkpComputeStandardMenuGeometry - second column bigger} \
- win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.18 {TkpComputeStandardMenuGeometry - second column bigger} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two -columnbreak 1
.m1 add command -label three
list [update idletasks] [destroy .m1]
-} {{} {}}
-test winMenu-32.19 {TkpComputeStandardMenuGeometry - three columns} win {
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-32.19 {TkpComputeStandardMenuGeometry - three columns} -constraints {
+ win
+} -setup {
+ destroy .m1
+} -body {
menu .m1 -tearoff 0
.m1 add command -label one
.m1 add command -label two -columnbreak 1
@@ -997,19 +1343,22 @@ test winMenu-32.19 {TkpComputeStandardMenuGeometry - three columns} win {
.m1 add command -label four
.m1 add command -label five -columnbreak 1
.m1 add command -label six
- list [update idletasks] [destroy .m1]
-} {{} {}}
+ list [update idletasks] [destroy .m1]
+} -result {{} {}}
+
-test winMenu-33.1 {TkpNotifyTopLevelCreate - no menu yet} win {
- catch {destroy .t2}
- catch {destroy .m1}
+test winMenu-33.1 {TkpNotifyTopLevelCreate - no menu yet} -constraints {
+ win
+} -setup {
+ destroy .m1 .t2
+} -body {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
list [update idletasks] [destroy .t2]
-} {{} {}}
-test winMenu-33.2 {TkpNotifyTopLevelCreate - menu} win {
- catch {destroy .t2}
- catch {destroy .m1}
+} -result {{} {}}
+test winMenu-33.2 {TkpNotifyTopLevelCreate - menu} -constraints win -setup {
+ destroy .m1 .t2
+} -body {
menu .m1
menu .m1.system
.m1 add cascade -menu .m1.system
@@ -1018,11 +1367,19 @@ test winMenu-33.2 {TkpNotifyTopLevelCreate - menu} win {
toplevel .t2 -menu .m1
wm geometry .t2 +0+0
list [update idletasks] [destroy .m1] [destroy .t2]
-} {{} {} {}}
+} -result {{} {} {}}
+
-test winMenu-34.1 {TkpMenuInit called at boot time} {emptyTest win} {} {}
+test winMenu-34.1 {TkpMenuInit called at boot time} -constraints {
+ emptyTest win
+} -body {}
# cleanup
deleteWindows
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/winMsgbox.test b/tests/winMsgbox.test
index f467896..0181103 100644
--- a/tests/winMsgbox.test
+++ b/tests/winMsgbox.test
@@ -2,8 +2,9 @@
#
# Copyright (c) 2007 Pat Thoyts <patthoyts@users.sourceforge.net>
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
testConstraint getwindowinfo [expr {[llength [info command ::testgetwindowinfo]] > 0}]
@@ -38,7 +39,7 @@ proc GetWindowInfo {title button} {
# -------------------------------------------------------------------------
-test winMsgbox-1.0 {tk_messageBox ok} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.1 {tk_messageBox ok} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -49,7 +50,7 @@ test winMsgbox-1.0 {tk_messageBox ok} -constraints {win getwindowinfo} -setup {
wm deiconify .
} -result {ok}
-test winMsgbox-1.1 {tk_messageBox okcancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.2 {tk_messageBox okcancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -60,7 +61,7 @@ test winMsgbox-1.1 {tk_messageBox okcancel} -constraints {win getwindowinfo} -se
wm deiconify .
} -result {ok}
-test winMsgbox-1.2 {tk_messageBox okcancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.3 {tk_messageBox okcancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -71,7 +72,7 @@ test winMsgbox-1.2 {tk_messageBox okcancel} -constraints {win getwindowinfo} -se
wm deiconify .
} -result {cancel}
-test winMsgbox-1.3 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.4 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -82,7 +83,7 @@ test winMsgbox-1.3 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup
wm deiconify .
} -result {yes}
-test winMsgbox-1.4 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.5 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -93,7 +94,7 @@ test winMsgbox-1.4 {tk_messageBox yesno} -constraints {win getwindowinfo} -setup
wm deiconify .
} -result {no}
-test winMsgbox-1.5 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.6 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -104,7 +105,7 @@ test winMsgbox-1.5 {tk_messageBox abortretryignore} -constraints {win getwindowi
wm deiconify .
} -result {abort}
-test winMsgbox-1.6 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.7 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -115,7 +116,7 @@ test winMsgbox-1.6 {tk_messageBox abortretryignore} -constraints {win getwindowi
wm deiconify .
} -result {retry}
-test winMsgbox-1.7 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.8 {tk_messageBox abortretryignore} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -126,7 +127,7 @@ test winMsgbox-1.7 {tk_messageBox abortretryignore} -constraints {win getwindowi
wm deiconify .
} -result {ignore}
-test winMsgbox-1.8 {tk_messageBox retrycancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.9 {tk_messageBox retrycancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -137,7 +138,7 @@ test winMsgbox-1.8 {tk_messageBox retrycancel} -constraints {win getwindowinfo}
wm deiconify .
} -result {retry}
-test winMsgbox-1.9 {tk_messageBox retrycancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.10 {tk_messageBox retrycancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -148,7 +149,7 @@ test winMsgbox-1.9 {tk_messageBox retrycancel} -constraints {win getwindowinfo}
wm deiconify .
} -result {cancel}
-test winMsgbox-1.10 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.11 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -159,7 +160,7 @@ test winMsgbox-1.10 {tk_messageBox yesnocancel} -constraints {win getwindowinfo}
wm deiconify .
} -result {yes}
-test winMsgbox-1.11 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.12 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -170,7 +171,7 @@ test winMsgbox-1.11 {tk_messageBox yesnocancel} -constraints {win getwindowinfo}
wm deiconify .
} -result {no}
-test winMsgbox-1.12 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
+test winMsgbox-1.13 {tk_messageBox yesnocancel} -constraints {win getwindowinfo} -setup {
wm iconify .
} -body {
global windowInfo
@@ -183,7 +184,7 @@ test winMsgbox-1.12 {tk_messageBox yesnocancel} -constraints {win getwindowinfo}
# -------------------------------------------------------------------------
-test winMsgbox-2.0 {tk_messageBox message} -constraints {win getwindowinfo} -setup {
+test winMsgbox-2.1 {tk_messageBox message} -constraints {win getwindowinfo} -setup {
wm iconify .
unset -nocomplain info
} -body {
@@ -198,7 +199,7 @@ test winMsgbox-2.0 {tk_messageBox message} -constraints {win getwindowinfo} -set
wm deiconify .
} -result [list ok "message"]
-test winMsgbox-2.1 {tk_messageBox message (long)} -constraints {
+test winMsgbox-2.2 {tk_messageBox message (long)} -constraints {
win getwindowinfo
} -setup {
wm iconify .
@@ -215,7 +216,7 @@ test winMsgbox-2.1 {tk_messageBox message (long)} -constraints {
wm deiconify .
} -result [list ok [string repeat Ab 80]]
-test winMsgbox-2.2 {tk_messageBox message (unicode)} -constraints {
+test winMsgbox-2.3 {tk_messageBox message (unicode)} -constraints {
win getwindowinfo
} -setup {
wm iconify .
@@ -232,7 +233,7 @@ test winMsgbox-2.2 {tk_messageBox message (unicode)} -constraints {
wm deiconify .
} -result [list ok "\u041f\u043e\u0438\u0441\u043a\u0020\u0441\u0442\u0440\u0430\u043d\u0438\u0446"]
-test winMsgbox-2.3 {tk_messageBox message (empty)} -constraints {
+test winMsgbox-2.4 {tk_messageBox message (empty)} -constraints {
win getwindowinfo
} -setup {
wm iconify .
@@ -248,7 +249,9 @@ test winMsgbox-2.3 {tk_messageBox message (empty)} -constraints {
wm deiconify .
} -result [list ok ""]
-test winMsgbox-3.0 {tk_messageBox detail (sourceforge bug #1692927)} -constraints {
+# -------------------------------------------------------------------------
+
+test winMsgbox-3.1 {tk_messageBox detail (sourceforge bug #1692927)} -constraints {
win getwindowinfo
} -setup {
wm iconify .
@@ -265,7 +268,7 @@ test winMsgbox-3.0 {tk_messageBox detail (sourceforge bug #1692927)} -constraint
wm deiconify .
} -result [list ok "Hello\n\nPleased to meet you"]
-test winMsgbox-3.1 {tk_messageBox detail (unicode)} -constraints {
+test winMsgbox-3.2 {tk_messageBox detail (unicode)} -constraints {
win getwindowinfo
} -setup {
wm iconify .
diff --git a/tests/winSend.test b/tests/winSend.test
index cd130fb..0f3baf8 100644
--- a/tests/winSend.test
+++ b/tests/winSend.test
@@ -96,7 +96,7 @@ test winSend-1.6 {Tk_SetAppName - safe interps} winSend {
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 ...?"}}
+} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}}
test winSend-2.1a {Tk_SendObjCmd: arguments} winSend {
list [catch {send -bogus tktest} msg] $msg
} {1 {bad option "-bogus": must be -async, -displayof, or --}}
diff --git a/tests/winWm.test b/tests/winWm.test
index 2864418..a4d2669 100644
--- a/tests/winWm.test
+++ b/tests/winWm.test
@@ -9,37 +9,26 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
-# Measure the height of a single menu line
-
-toplevel .t
-frame .t.f -width 100 -height 50
-pack .t.f
-menu .t.m
-.t.m add command -label "thisisreallylong"
-.t configure -menu .t.m
-wm geometry .t -0-0
-update
-set menuheight [winfo y .t]
-.t.m add command -label "thisisreallylong"
-wm geometry .t -0-0
-update
-set menuheight [expr {$menuheight - [winfo y .t]}]
-destroy .t
-test winWm-1.1 {TkWmMapWindow} win {
+test winWm-1.1 {TkWmMapWindow} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm override .t 1
wm geometry .t +0+0
update
- set result [list [winfo rootx .t] [winfo rooty .t]]
+ list [winfo rootx .t] [winfo rooty .t]
+} -cleanup {
destroy .t
- set result
-} {0 0}
-test winWm-1.2 {TkWmMapWindow} win {
+} -result {0 0}
+test winWm-1.2 {TkWmMapWindow} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm transient .t .
update
@@ -47,40 +36,47 @@ test winWm-1.2 {TkWmMapWindow} win {
update
wm deiconify .
update
- catch {wm iconify .t} msg
+ wm iconify .t
+} -cleanup {
destroy .t
- set msg
-} {can't iconify ".t": it is a transient}
-test winWm-1.3 {TkWmMapWindow} win {
+} -returnCodes error -result {can't iconify ".t": it is a transient}
+test winWm-1.3 {TkWmMapWindow} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
update
toplevel .t2
update
- set result [expr {[winfo x .t] != [winfo x .t2]}]
+ expr {[winfo x .t] != [winfo x .t2]}
+} -cleanup {
destroy .t .t2
- set result
-} 1
-test winWm-1.4 {TkWmMapWindow} win {
+} -result 1
+test winWm-1.4 {TkWmMapWindow} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm geometry .t +10+10
update
toplevel .t2
wm geometry .t2 +40+10
update
- set result [list [winfo x .t] [winfo x .t2]]
+ list [winfo x .t] [winfo x .t2]
+} -cleanup {
destroy .t .t2
- set result
-} {10 40}
-test winWm-1.5 {TkWmMapWindow} win {
+} -result {10 40}
+test winWm-1.5 {TkWmMapWindow} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm iconify .t
update
- set result [wm state .t]
- destroy .t
- set result
-} iconic
+ wm state .t
+} -result {iconic}
+
-test winWm-2.1 {TkpWmSetState} win {
+test winWm-2.1 {TkpWmSetState} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm geometry .t 150x50+10+10
update
@@ -91,10 +87,12 @@ test winWm-2.1 {TkpWmSetState} win {
wm deiconify .t
update
lappend result [wm state .t]
+} -cleanup {
+ destroy .t
+} -result {normal iconic normal}
+test winWm-2.2 {TkpWmSetState} -constraints win -setup {
destroy .t
- set result
-} {normal iconic normal}
-test winWm-2.2 {TkpWmSetState} win {
+} -body {
toplevel .t
wm geometry .t 150x50+10+10
update
@@ -106,12 +104,14 @@ test winWm-2.2 {TkpWmSetState} win {
update
lappend result [wm state .t]
wm deiconify .t
- update
+ update
lappend result [wm state .t]
+} -cleanup {
+ destroy .t
+} -result {normal withdrawn iconic normal}
+test winWm-2.3 {TkpWmSetState} -constraints win -setup {
destroy .t
- set result
-} {normal withdrawn iconic normal}
-test winWm-2.3 {TkpWmSetState} win {
+} -body {
toplevel .t
wm geometry .t 150x50+10+10
update
@@ -123,13 +123,15 @@ test winWm-2.3 {TkpWmSetState} win {
update
lappend result [wm state .t]
wm state .t normal
- update
+ update
lappend result [wm state .t]
+} -cleanup {
+ destroy .t
+} -result {normal withdrawn iconic normal}
+test winWm-2.4 {TkpWmSetState} -constraints win -setup {
destroy .t
- set result
-} {normal withdrawn iconic normal}
-test winWm-2.4 {TkpWmSetState} win {
set result {}
+} -body {
toplevel .t
wm geometry .t 150x50+10+10
update
@@ -143,11 +145,16 @@ test winWm-2.4 {TkpWmSetState} win {
wm deiconify .t
update
lappend result [list [wm state .t] [wm geometry .t]]
+} -cleanup {
destroy .t
- set result
-} {{normal 150x50+10+10} {iconic 150x50+10+10} {iconic 150x50+10+10} {normal 200x50+10+10}}
+} -result {{normal 150x50+10+10} {iconic 150x50+10+10} {iconic 150x50+10+10} {normal 200x50+10+10}}
+
-test winWm-3.1 {ConfigureTopLevel: window geometry propagation} win {
+test winWm-3.1 {ConfigureTopLevel: window geometry propagation} -constraints {
+ win
+} -setup {
+ destroy .t
+} -body {
toplevel .t
wm geometry .t +0+0
button .t.b
@@ -161,13 +168,30 @@ test winWm-3.1 {ConfigureTopLevel: window geometry propagation} win {
update
pack .t.b
update
- set x [expr {$x == [winfo x .t.b]}]
+ expr {$x == [winfo x .t.b]}
+} -cleanup {
+ destroy .t
+} -result 1
+
+
+test winWm-4.1 {ConfigureTopLevel: menu resizing} -constraints win -setup {
+ destroy .t
+} -body {
+ toplevel .t
+ frame .t.f -width 100 -height 50
+ pack .t.f
+ menu .t.m
+ .t.m add command -label "thisisreallylong"
+ .t configure -menu .t.m
+ wm geometry .t -0-0
+ update
+ set menuheight [winfo y .t]
+ .t.m add command -label "thisisreallylong"
+ wm geometry .t -0-0
+ update
+ set menuheight [expr {$menuheight - [winfo y .t]}]
destroy .t
- set x
-} 1
-test winWm-4.1 {ConfigureTopLevel: menu resizing} win {
- set result {}
toplevel .t
frame .t.f -width 150 -height 50 -background red
pack .t.f
@@ -178,18 +202,21 @@ test winWm-4.1 {ConfigureTopLevel: menu resizing} win {
.t.m add command -label foo
.t configure -menu .t.m
update
- set result [expr {$y - [winfo y .t]}]
+ expr {$y - [winfo y .t] eq $menuheight + 1}
+} -cleanup {
destroy .t
- set result
-} [expr {$menuheight + 1}]
+} -result 1
+
# This test works on 8.0p2 but has not worked on anything since 8.2.
# It would be very strange to have a windows application increase the size
# of the clientarea when a menu wraps so I believe this test to be wrong.
# Original result was {50 50 50} new result may depend on the default menu
# font
-test winWm-5.1 {UpdateGeometryInfo: menu resizing} win {
+test winWm-5.1 {UpdateGeometryInfo: menu resizing} -constraints win -setup {
+ destroy .t
set result {}
+} -body {
toplevel .t
frame .t.f -width 150 -height 50 -background red
pack .t.f
@@ -204,11 +231,12 @@ test winWm-5.1 {UpdateGeometryInfo: menu resizing} win {
.t.m add command -label "thisisreallylong"
update
lappend result [winfo height .t]
+} -cleanup {
+ destroy .t
+} -result {50 50 31}
+test winWm-5.2 {UpdateGeometryInfo: menu resizing} -constraints win -setup {
destroy .t
-
- set result
-} {50 50 31}
-test winWm-5.2 {UpdateGeometryInfo: menu resizing} win {
+} -body {
set result {}
toplevel .t
frame .t.f -width 150 -height 50 -background red
@@ -226,29 +254,41 @@ test winWm-5.2 {UpdateGeometryInfo: menu resizing} win {
lappend result [winfo height .t]
lappend result [expr {$y - [winfo rooty .t]}]
destroy .t
- set result
-} {50 50 0}
+ return $result
+} -cleanup {
+ destroy .t
+} -result {50 50 0}
-test winWm-6.1 {wm attributes} win {
+test winWm-6.1 {wm attributes} -constraints win -setup {
destroy .t
+} -body {
toplevel .t
wm attributes .t
-} {-alpha 1.0 -transparentcolor {} -disabled 0 -fullscreen 0 -toolwindow 0 -topmost 0}
-test winWm-6.2 {wm attributes} win {
+} -cleanup {
destroy .t
+} -result {-alpha 1.0 -transparentcolor {} -disabled 0 -fullscreen 0 -toolwindow 0 -topmost 0}
+test winWm-6.2 {wm attributes} -constraints win -setup {
+ destroy .t
+} -body {
toplevel .t
wm attributes .t -disabled
-} {0}
-test winWm-6.3 {wm attributes} win {
- # This isn't quite the correct error message yet, but it works.
+} -cleanup {
destroy .t
+} -result {0}
+test winWm-6.3 {wm attributes} -constraints win -setup {
+ destroy .t
+} -body {
+ # This isn't quite the correct error message yet, but it works.
toplevel .t
- list [catch {wm attributes .t -foo} msg] $msg
-} {1 {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+ wm attributes .t -foo
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}
-test winWm-6.4 {wm attributes -alpha} win {
- # Expect this to return all 1.0 {} on pre-2K/XP
+test winWm-6.4 {wm attributes -alpha} -constraints win -setup {
destroy .t
+} -body {
+ # Expect this to return all 1.0 {} on pre-2K/XP
toplevel .t
set res [wm attributes .t -alpha]
# we don't return on set yet
@@ -258,72 +298,94 @@ test winWm-6.4 {wm attributes -alpha} win {
lappend res [wm attributes .t -alpha]
lappend res [wm attributes .t -alpha 100]
lappend res [wm attributes .t -alpha]
- set res
-} {1.0 {} 0.5 {} 0.0 {} 1.0}
+ return $res
+} -cleanup {
+ destroy .t
+} -result {1.0 {} 0.5 {} 0.0 {} 1.0}
-test winWm-6.5 {wm attributes -alpha} win {
+test winWm-6.5 {wm attributes -alpha} -constraints win -setup {
destroy .t
+} -body {
toplevel .t
- list [catch {wm attributes .t -alpha foo} msg] $msg
-} {1 {expected floating-point number but got "foo"}}
+ wm attributes .t -alpha foo
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {expected floating-point number but got "foo"}
-test winWm-6.6 {wm attributes -alpha} win {
- # This test is just to show off -alpha
+test winWm-6.6 {wm attributes -alpha} -constraints win -setup {
destroy .t
+} -body {
+ # This test is just to show off -alpha
toplevel .t
wm attributes .t -alpha 0.2
pack [label .t.l -text "Alpha Toplevel" -font "Helvetica 18 bold"]
tk::PlaceWindow .t center
update
if {$::tcl_platform(osVersion) >= 5.0} {
- for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} {
- wm attributes .t -alpha $i
- update idle
- after 20
- }
- for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} {
- wm attributes .t -alpha $i
- update idle
- after 20
- }
+ for {set i 0.2} {$i < 0.99} {set i [expr {$i+0.02}]} {
+ wm attributes .t -alpha $i
+ update idle
+ after 20
+ }
+ for {set i 0.99} {$i > 0.2} {set i [expr {$i-0.02}]} {
+ wm attributes .t -alpha $i
+ update idle
+ after 20
}
-} {}
+ }
+} -cleanup {
+ destroy .t
+} -result {}
-test winWm-6.7 {wm attributes -transparentcolor} win {
- # Expect this to return all "" on pre-2K/XP
+test winWm-6.7 {wm attributes -transparentcolor} -constraints win -setup {
destroy .t
- toplevel .t
set res {}
+} -body {
+ # Expect this to return all "" on pre-2K/XP
+ toplevel .t
lappend res [wm attributes .t -transparentcolor]
# we don't return on set yet
lappend res [wm attributes .t -trans black]
lappend res [wm attributes .t -trans]
lappend res [wm attributes .t -trans "#FFFFFF"]
lappend res [wm attributes .t -trans]
+} -cleanup {
destroy .t
- set res
-} [list {} {} black {} "#FFFFFF"]
+} -result [list {} {} black {} "#FFFFFF"]
-test winWm-6.8 {wm attributes -transparentcolor} win {
+test winWm-6.8 {wm attributes -transparentcolor} -constraints win -setup {
+ destroy .t
+} -body {
destroy .t
toplevel .t
- list [catch {wm attributes .t -tr foo} msg] $msg
-} {1 {unknown color name "foo"}}
+ wm attributes .t -tr foo
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {unknown color name "foo"}
-test winWm-7.1 {deiconify on an unmapped toplevel\
- will raise the window and set the focus} win {
+
+test winWm-7.1 {deiconify on an unmapped toplevel will raise \
+ the window and set the focus} -constraints {
+ win
+} -setup {
destroy .t
+} -body {
toplevel .t
lower .t
focus -force .
wm deiconify .t
update
list [wm stackorder .t isabove .] [focus]
-} {1 .t}
+} -cleanup {
+ destroy .t
+} -result {1 .t}
test winWm-7.2 {deiconify on an already mapped toplevel\
- will raise the window and set the focus} win {
+ will raise the window and set the focus} -constraints {
+ win
+} -setup {
destroy .t
+} -body {
toplevel .t
lower .t
update
@@ -331,9 +393,13 @@ test winWm-7.2 {deiconify on an already mapped toplevel\
wm deiconify .t
update
list [wm stackorder .t isabove .] [focus]
-} {1 .t}
+} -cleanup {
+ destroy .t
+} -result {1 .t}
-test winWm-7.3 {UpdateWrapper must maintain Z order} win {
+test winWm-7.3 {UpdateWrapper must maintain Z order} -constraints win -setup {
+ destroy .t
+} -body {
destroy .t
toplevel .t
lower .t
@@ -342,10 +408,13 @@ test winWm-7.3 {UpdateWrapper must maintain Z order} win {
wm resizable .t 0 0
update
list $res [wm stackorder .t isbelow .]
-} {1 1}
+} -cleanup {
+ destroy .t
+} -result {1 1}
-test winWm-7.4 {UpdateWrapper must maintain focus} win {
+test winWm-7.4 {UpdateWrapper must maintain focus} -constraints win -setup {
destroy .t
+} -body {
toplevel .t
focus -force .t
update
@@ -353,20 +422,26 @@ test winWm-7.4 {UpdateWrapper must maintain focus} win {
wm resizable .t 0 0
update
list $res [focus]
-} {.t .t}
+} -cleanup {
+ destroy .t
+} -result {.t .t}
-test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} win {
- list [catch {wm iconph .} msg] $msg
-} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}}
-test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} win {
+
+test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} -constraints win -body {
+ wm iconph .
+} -returnCodes error -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}
+test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} -constraints win -setup {
destroy .t
+} -body {
toplevel .t
image create photo blank16 -width 16 -height 16
image create photo blank32 -width 32 -height 32
# This should just make blank icons for the window
wm iconphoto .t blank16 blank32
image delete blank16 blank32
-} {}
+} -cleanup {
+ destroy .t
+} -result {}
test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constraints win -setup {
proc winwm90click {w} {
@@ -396,7 +471,6 @@ test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constrai
pack [button $w.b -text "Do dialog" -command [list winwm90proc2 $w]]
bind $w.b <Map> {bind %W <Map> {}; after idle {winwm90click %W}}
}
- destroy .t
global winwm90done
set winwm90done wait
toplevel .t
@@ -411,7 +485,7 @@ test winWm-9.0 "Bug #2799589 - delayed activation of destroyed window" -constrai
rename winwm90$cmd {}
}
destroy .tx .t .sd
-} -result {ok}
+} -result {ok}
test winWm-9.1 "delayed activation of grabbed destroyed window" -constraints win -setup {
proc winwm91click {w} {
@@ -497,3 +571,4 @@ return
# Local variables:
# mode: tcl
# End:
+
diff --git a/tests/window.test b/tests/window.test
index 2c8f19d..876ba81 100644
--- a/tests/window.test
+++ b/tests/window.test
@@ -5,42 +5,51 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
testConstraint unthreaded [expr {
(![info exist tcl_platform(threaded)] || !$tcl_platform(threaded))
}]
-namespace import -force ::tk::test::loadTkCommand
+namespace import ::tk::test::loadTkCommand
update
# XXX This file is woefully incomplete. Right now it only tests
# a few parts of a few procedures in tkWindow.c
-test window-1.1 {Tk_CreateWindowFromPath procedure, parent dead} {
+# ----------------------------------------------------------------------
+
+test window-1.1 {Tk_CreateWindowFromPath procedure, parent dead} -setup {
+ destroy .t
+} -body {
proc bgerror msg {
- global x errorInfo
- set x [list $msg $errorInfo]
+ global x errorInfo
+ set x [list $msg $errorInfo]
}
+
set x unchanged
- catch {destroy .t}
frame .t -width 100 -height 50
place .t -x 10 -y 10
bind .t <Destroy> {button .t.b -text hello; pack .t.b}
update
destroy .t
update
- rename bgerror {}
set x
-} {{can't create window: parent has been destroyed} {can't create window: parent has been destroyed
+} -cleanup {
+ rename bgerror {}
+} -result {{can't create window: parent has been destroyed} {can't create window: parent has been destroyed
while executing
"button .t.b -text hello"
(command bound to event)}}
+
# Most of the tests below don't produce meaningful results; they
# will simply dump core if there are bugs.
-test window-2.1 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
+test window-2.1 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
+ destroy .t
+} -body {
toplevel .t -width 300 -height 200
wm geometry .t +0+0
frame .t.f -width 200 -height 200 -relief raised -bd 2
@@ -50,8 +59,10 @@ test window-2.1 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
bind .t.f <Destroy> {destroy .t}
update
destroy .t.f
-} {}
-test window-2.2 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
+} -result {}
+test window-2.2 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
+ destroy .t
+} -body {
toplevel .t -width 300 -height 200
wm geometry .t +0+0
frame .t.f -width 200 -height 200 -relief raised -bd 2
@@ -61,8 +72,10 @@ test window-2.2 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
bind .t.f.f <Destroy> {destroy .t}
update
destroy .t.f
-} {}
-test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
+} -result {}
+test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
+ destroy .f
+} -body {
frame .f -width 80 -height 120 -relief raised -bd 2
place .f -relx 0.5 -rely 0.5 -anchor center
toplevel .f.t -width 300 -height 200
@@ -73,10 +86,11 @@ test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
place .f.t.f.f -relx 1 -rely 1 -anchor se
update
destroy .f
-} {}
+} -result {}
-test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \
- unixOrWin {
+test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
update
@@ -85,16 +99,17 @@ test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {}}
+} -result {0 {}}
-test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \
- unixOrWin {
+test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
toplevel .t
@@ -104,16 +119,17 @@ test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {}}
+} -result {0 {}}
-test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \
- unixOrWin {
+test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
toplevel .t
@@ -123,16 +139,17 @@ test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {}}
+} -result {0 {}}
-test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \
- unixOrWin {
+test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
toplevel .t
@@ -143,16 +160,17 @@ test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {}}
+} -result {0 {}}
-test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
- unixOrWin {
+test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
toplevel .t1
@@ -166,17 +184,18 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {}}
+} -result {0 {}}
# window-2.9 deadlocks threaded Tk [Bug 1715716]
-test window-2.9 {Tk_DestroyWindow, Destroy bindings
- evaluated after exit} {unixOrWin unthreaded} {
+test window-2.9 {Tk_DestroyWindow, Destroy bindings evaluated after exit} -constraints {
+ unixOrWin unthreaded
+} -body {
set code [loadTkCommand]
append code {
toplevel .t1
@@ -188,17 +207,18 @@ test window-2.9 {Tk_DestroyWindow, Destroy bindings
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {Destroy .t2
+} -result {0 {Destroy .t2
Destroy .t1}}
-test window-2.10 {Tk_DestroyWindow, Destroy binding
- evaluated once} unixOrWin {
+test window-2.10 {Tk_DestroyWindow, Destroy binding evaluated once} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
update
@@ -211,16 +231,17 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 {Destroy .}}
+} -result {0 {Destroy .}}
-test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \
- unixOrWin {
+test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} -constraints {
+ unixOrWin
+} -body {
set code [loadTkCommand]
append code {
toplevel .t1
@@ -238,17 +259,20 @@ test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \
}
set script [makeFile $code script]
if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
- set error 1
+ set error 1
} else {
- set error 0
+ set error 0
}
removeFile script
list $error $msg
-} {0 YES}
+} -result {0 YES}
-test window-3.1 {Tk_MakeWindowExist procedure, stacking order and menubars} \
- {unix testmenubar} {
- catch {destroy .t}
+
+test window-3.1 {Tk_MakeWindowExist procedure, stacking order and menubars} -constraints {
+ unix testmenubar
+} -setup {
+ destroy .t
+} -body {
toplevel .t -width 300 -height 200
wm geometry .t +0+0
pack [entry .t.e]
@@ -256,10 +280,14 @@ test window-3.1 {Tk_MakeWindowExist procedure, stacking order and menubars} \
testmenubar window .t .t.f
update
# If stacking order isn't handle properly, generates an X error.
-} {}
-test window-3.2 {Tk_MakeWindowExist procedure, stacking order and menubars} \
- {unix testmenubar} {
- catch {destroy .t}
+} -cleanup {
+ destroy .t
+} -result {}
+test window-3.2 {Tk_MakeWindowExist procedure, stacking order and menubars} -constraints {
+ unix testmenubar
+} -setup {
+ destroy .t
+} -body {
toplevel .t -width 300 -height 200
wm geometry .t +0+0
pack [entry .t.e]
@@ -270,23 +298,39 @@ test window-3.2 {Tk_MakeWindowExist procedure, stacking order and menubars} \
testmenubar window .t .t.f
update
# If stacking order isn't handled properly, generates an X error.
-} {}
+} -cleanup {
+ destroy .t
+} -result {}
+
-test window-4.1 {Tk_NameToWindow procedure} {testmenubar} {
- catch {destroy .t}
- list [catch {winfo geometry .t} msg] $msg
-} {1 {bad window path name ".t"}}
-test window-4.2 {Tk_NameToWindow procedure} {testmenubar} {
- catch {destroy .t}
+test window-4.1 {Tk_NameToWindow procedure} -constraints {
+ testmenubar
+} -setup {
+ destroy .t
+} -body {
+ winfo geometry .t
+} -cleanup {
+ destroy .t
+} -returnCodes error -result {bad window path name ".t"}
+test window-4.2 {Tk_NameToWindow procedure} -constraints {
+ testmenubar
+} -setup {
+ destroy .t
+} -body {
frame .t -width 100 -height 50
place .t -x 10 -y 10
update
- list [catch {winfo geometry .t} msg] $msg
-} {0 100x50+10+10}
+ winfo geometry .t
+} -cleanup {
+ destroy .t
+} -returnCodes ok -result {100x50+10+10}
+
-test window-5.1 {Tk_MakeWindowExist procedure, stacking order and menubars} \
- {unix testmenubar} {
- catch {destroy .t}
+test window-5.1 {Tk_MakeWindowExist procedure, stacking order and menubars} -constraints {
+ unix testmenubar
+} -setup {
+ destroy .t
+} -body {
toplevel .t -width 300 -height 200
wm geometry .t +0+0
pack [entry .t.e]
@@ -297,8 +341,15 @@ test window-5.1 {Tk_MakeWindowExist procedure, stacking order and menubars} \
lower .t.e2 .t.f
update
# If stacking order isn't handled properly, generates an X error.
-} {}
+} -cleanup {
+ destroy .t
+} -result {}
+
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/winfo.test b/tests/winfo.test
index 4ce87eb..14c2838 100644
--- a/tests/winfo.test
+++ b/tests/winfo.test
@@ -6,8 +6,9 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
# eatColors --
@@ -15,22 +16,22 @@ tcltest::loadTestedCommands
# use up all the slots in the colormap.
#
# Arguments:
-# w - Name of toplevel window to create.
-# options - Options for w, such as "-colormap new".
+# w - Name of toplevel window to create.
+# options - Options for w, such as "-colormap new".
proc eatColors {w {options ""}} {
- catch {destroy $w}
+ destroy $w
eval toplevel $w $options
wm geom $w +0+0
canvas $w.c -width 400 -height 200 -bd 0
pack $w.c
for {set y 0} {$y < 8} {incr y} {
- for {set x 0} {$x < 40} {incr x} {
- set color [format #%02x%02x%02x [expr $x*6] [expr $y*30] 0]
- $w.c create rectangle [expr 10*$x] [expr 20*$y] \
- [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
- -fill $color
- }
+ for {set x 0} {$x < 40} {incr x} {
+ set color [format #%02x%02x%02x [expr $x*6] [expr $y*30] 0]
+ $w.c create rectangle [expr 10*$x] [expr 20*$y] \
+ [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
+ -fill $color
+ }
}
update
}
@@ -38,57 +39,69 @@ proc eatColors {w {options ""}} {
# XXX - This test file is woefully incomplete. At present, only a
# few of the winfo options are tested.
-test winfo-1.1 {"winfo atom" command} {
- list [catch {winfo atom} msg] $msg
-} {1 {wrong # args: should be "winfo atom ?-displayof window? name"}}
-test winfo-1.2 {"winfo atom" command} {
- list [catch {winfo atom a b} msg] $msg
-} {1 {wrong # args: should be "winfo atom ?-displayof window? name"}}
-test winfo-1.3 {"winfo atom" command} {
- list [catch {winfo atom a b c d} msg] $msg
-} {1 {wrong # args: should be "winfo atom ?-displayof window? name"}}
-test winfo-1.4 {"winfo atom" command} {
- list [catch {winfo atom -displayof geek foo} msg] $msg
-} {1 {bad window path name "geek"}}
-test winfo-1.5 {"winfo atom" command} {
+# ----------------------------------------------------------------------
+
+test winfo-1.1 {"winfo atom" command} -body {
+ winfo atom
+} -returnCodes error -result {wrong # args: should be "winfo atom ?-displayof window? name"}
+test winfo-1.2 {"winfo atom" command} -body {
+ winfo atom a b
+} -returnCodes error -result {wrong # args: should be "winfo atom ?-displayof window? name"}
+test winfo-1.3 {"winfo atom" command} -body {
+ winfo atom a b c d
+} -returnCodes error -result {wrong # args: should be "winfo atom ?-displayof window? name"}
+test winfo-1.4 {"winfo atom" command} -body {
+ winfo atom -displayof geek foo
+} -returnCodes error -result {bad window path name "geek"}
+test winfo-1.5 {"winfo atom" command} -body {
winfo atom PRIMARY
-} 1
-test winfo-1.6 {"winfo atom" command} {
+} -result 1
+test winfo-1.6 {"winfo atom" command} -body {
winfo atom -displayof . PRIMARY
-} 1
-
-test winfo-2.1 {"winfo atomname" command} {
- list [catch {winfo atomname} msg] $msg
-} {1 {wrong # args: should be "winfo atomname ?-displayof window? id"}}
-test winfo-2.2 {"winfo atomname" command} {
- list [catch {winfo atomname a b} msg] $msg
-} {1 {wrong # args: should be "winfo atomname ?-displayof window? id"}}
-test winfo-2.3 {"winfo atomname" command} {
- list [catch {winfo atomname a b c d} msg] $msg
-} {1 {wrong # args: should be "winfo atomname ?-displayof window? id"}}
-test winfo-2.4 {"winfo atomname" command} {
- list [catch {winfo atomname -displayof geek foo} msg] $msg
-} {1 {bad window path name "geek"}}
-test winfo-2.5 {"winfo atomname" command} {
- list [catch {winfo atomname 44215} msg] $msg
-} {1 {no atom exists with id "44215"}}
-test winfo-2.6 {"winfo atomname" command} {
+} -result 1
+
+
+test winfo-2.1 {"winfo atomname" command} -body {
+ winfo atomname
+} -returnCodes error -result {wrong # args: should be "winfo atomname ?-displayof window? id"}
+test winfo-2.2 {"winfo atomname" command} -body {
+ winfo atomname a b
+} -returnCodes error -result {wrong # args: should be "winfo atomname ?-displayof window? id"}
+test winfo-2.3 {"winfo atomname" command} -body {
+ winfo atomname a b c d
+} -returnCodes error -result {wrong # args: should be "winfo atomname ?-displayof window? id"}
+test winfo-2.4 {"winfo atomname" command} -body {
+ winfo atomname -displayof geek foo
+} -returnCodes error -result {bad window path name "geek"}
+test winfo-2.5 {"winfo atomname" command} -body {
+ winfo atomname 44215
+} -returnCodes error -result {no atom exists with id "44215"}
+test winfo-2.6 {"winfo atomname" command} -body {
winfo atomname 2
-} SECONDARY
-test winfo-2.7 {"winfo atom" command} {
+} -result SECONDARY
+test winfo-2.7 {"winfo atom" command} -body {
winfo atomname -displayof . 2
-} SECONDARY
-
-test winfo-3.1 {"winfo colormapfull" command} defaultPseudocolor8 {
- list [catch {winfo colormapfull} msg] $msg
-} {1 {wrong # args: should be "winfo colormapfull window"}}
-test winfo-3.2 {"winfo colormapfull" command} defaultPseudocolor8 {
- list [catch {winfo colormapfull a b} msg] $msg
-} {1 {wrong # args: should be "winfo colormapfull window"}}
-test winfo-3.3 {"winfo colormapfull" command} defaultPseudocolor8 {
- list [catch {winfo colormapfull foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test winfo-3.4 {"winfo colormapfull" command} {unix defaultPseudocolor8} {
+} -result SECONDARY
+
+
+test winfo-3.1 {"winfo colormapfull" command} -constraints {
+ defaultPseudocolor8
+} -body {
+ winfo colormapfull
+} -returnCodes error -result {wrong # args: should be "winfo colormapfull window"}
+test winfo-3.2 {"winfo colormapfull" command} -constraints {
+ defaultPseudocolor8
+} -body {
+ winfo colormapfull a b
+} -returnCodes error -result {wrong # args: should be "winfo colormapfull window"}
+test winfo-3.3 {"winfo colormapfull" command} -constraints {
+ defaultPseudocolor8
+} -body {
+ winfo colormapfull foo
+} -returnCodes error -result {bad window path name "foo"}
+test winfo-3.4 {"winfo colormapfull" command} -constraints {
+ unix defaultPseudocolor8
+} -body {
eatColors .t {-colormap new}
set result [list [winfo colormapfull .] [winfo colormapfull .t]]
.t.c delete 34
@@ -99,69 +112,103 @@ test winfo-3.4 {"winfo colormapfull" command} {unix defaultPseudocolor8} {
lappend result [winfo colormapfull .t]
destroy .t.c
lappend result [winfo colormapfull .t]
-} {0 1 0 0 1 0}
-catch {destroy .t}
-
-toplevel .t -width 550 -height 400
-frame .t.f -width 80 -height 60 -bd 2 -relief raised
-place .t.f -x 50 -y 50
-wm geom .t +0+0
-update
-test winfo-4.1 {"winfo containing" command} {
- list [catch {winfo containing 22} msg] $msg
-} {1 {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}}
-test winfo-4.2 {"winfo containing" command} {
- list [catch {winfo containing a b c} msg] $msg
-} {1 {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}}
-test winfo-4.3 {"winfo containing" command} {
- list [catch {winfo containing a b c d e} msg] $msg
-} {1 {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}}
-test winfo-4.4 {"winfo containing" command} {
- list [catch {winfo containing -displayof geek 25 30} msg] $msg
-} {1 {bad window path name "geek"}}
-test winfo-4.5 {"winfo containing" command} {
+} -cleanup {
+ destroy .t
+} -result {0 1 0 0 1 0}
+
+
+
+test winfo-4.1 {"winfo containing" command} -body {
+ winfo containing 22
+} -returnCodes error -result {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}
+test winfo-4.2 {"winfo containing" command} -body {
+ winfo containing a b c
+} -returnCodes error -result {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}
+test winfo-4.3 {"winfo containing" command} -body {
+ winfo containing a b c d e
+} -returnCodes error -result {wrong # args: should be "winfo containing ?-displayof window? rootX rootY"}
+test winfo-4.4 {"winfo containing" command} -body {
+ winfo containing -displayof geek 25 30
+} -returnCodes error -result {bad window path name "geek"}
+test winfo-4.5 {"winfo containing" command} -body {
+} -setup {
+ destroy .t
+} -body {
+ toplevel .t -width 550 -height 400
+ frame .t.f -width 80 -height 60 -bd 2 -relief raised
+ place .t.f -x 50 -y 50
+ wm geom .t +0+0
+ update
+
raise .t
winfo containing [winfo rootx .t.f] [winfo rooty .t.f]
-} .t.f
-test winfo-4.6 {"winfo containing" command} {nonPortable} {
+} -cleanup {
+ destroy .t
+} -result .t.f
+test winfo-4.6 {"winfo containing" command} -constraints {
+ nonPortable
+} -setup {
+ destroy .t
+} -body {
+ toplevel .t -width 550 -height 400
+ frame .t.f -width 80 -height 60 -bd 2 -relief raised
+ place .t.f -x 50 -y 50
+ wm geom .t +0+0
+ update
+
winfo containing [expr [winfo rootx .t.f]-1] [expr [winfo rooty .t.f]-1]
-} .t
-test winfo-4.7 {"winfo containing" command} {
+} -cleanup {
+ destroy .t
+} -result .t
+test winfo-4.7 {"winfo containing" command} -setup {
+ destroy .t
+} -body {
+ toplevel .t -width 550 -height 400
+ frame .t.f -width 80 -height 60 -bd 2 -relief raised
+ place .t.f -x 50 -y 50
+ wm geom .t +0+0
+ update
+
set x [winfo containing -display .t.f [expr [winfo rootx .t]+600] \
- [expr [winfo rooty .t.f]+450]]
+ [expr [winfo rooty .t.f]+450]]
expr {($x == ".") || ($x == "")}
-} {1}
-destroy .t
-
-test winfo-5.1 {"winfo interps" command} {
- list [catch {winfo interps a} msg] $msg
-} {1 {wrong # args: should be "winfo interps ?-displayof window?"}}
-test winfo-5.2 {"winfo interps" command} {
- list [catch {winfo interps a b c} msg] $msg
-} {1 {wrong # args: should be "winfo interps ?-displayof window?"}}
-test winfo-5.3 {"winfo interps" command} {
- list [catch {winfo interps -displayof geek} msg] $msg
-} {1 {bad window path name "geek"}}
-test winfo-5.4 {"winfo interps" command} unix {
- expr [lsearch -exact [winfo interps] [tk appname]] >= 0
-} {1}
-test winfo-5.5 {"winfo interps" command} unix {
- expr [lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0
-} {1}
-
-test winfo-6.1 {"winfo exists" command} {
- list [catch {winfo exists} msg] $msg
-} {1 {wrong # args: should be "winfo exists window"}}
-test winfo-6.2 {"winfo exists" command} {
- list [catch {winfo exists a b} msg] $msg
-} {1 {wrong # args: should be "winfo exists window"}}
-test winfo-6.3 {"winfo exists" command} {
+} -cleanup {
+ destroy .t
+} -result {1}
+
+
+test winfo-5.1 {"winfo interps" command} -body {
+ winfo interps a
+} -returnCodes error -result {wrong # args: should be "winfo interps ?-displayof window?"}
+test winfo-5.2 {"winfo interps" command} -body {
+ winfo interps a b c
+} -returnCodes error -result {wrong # args: should be "winfo interps ?-displayof window?"}
+test winfo-5.3 {"winfo interps" command} -body {
+ winfo interps -displayof geek
+} -returnCodes error -result {bad window path name "geek"}
+test winfo-5.4 {"winfo interps" command} -constraints unix -body {
+ expr {[lsearch -exact [winfo interps] [tk appname]] >= 0}
+} -result {1}
+test winfo-5.5 {"winfo interps" command} -constraints unix -body {
+ expr {[lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0}
+} -result {1}
+
+
+test winfo-6.1 {"winfo exists" command} -body {
+ winfo exists
+} -returnCodes error -result {wrong # args: should be "winfo exists window"}
+test winfo-6.2 {"winfo exists" command} -body {
+ winfo exists a b
+} -returnCodes error -result {wrong # args: should be "winfo exists window"}
+test winfo-6.3 {"winfo exists" command} -body {
winfo exists gorp
-} {0}
-test winfo-6.4 {"winfo exists" command} {
+} -result {0}
+test winfo-6.4 {"winfo exists" command} -body {
winfo exists .
-} {1}
-test winfo-6.5 {"winfo exists" command} {
+} -result {1}
+test winfo-6.5 {"winfo exists" command} -setup {
+ destroy .b
+} -body {
button .b -text "Test button"
set x [winfo exists .b]
pack .b
@@ -169,78 +216,113 @@ test winfo-6.5 {"winfo exists" command} {
bind .b <Destroy> {lappend x [winfo exists .x]}
destroy .b
lappend x [winfo exists .x]
-} {1 0 0}
-
-catch {destroy .b}
-button .b -text "Help"
-update
-test winfo-7.1 {"winfo pathname" command} {
- list [catch {winfo pathname} msg] $msg
-} {1 {wrong # args: should be "winfo pathname ?-displayof window? id"}}
-test winfo-7.2 {"winfo pathname" command} {
- list [catch {winfo pathname a b} msg] $msg
-} {1 {wrong # args: should be "winfo pathname ?-displayof window? id"}}
-test winfo-7.3 {"winfo pathname" command} {
- list [catch {winfo pathname a b c d} msg] $msg
-} {1 {wrong # args: should be "winfo pathname ?-displayof window? id"}}
-test winfo-7.4 {"winfo pathname" command} {
- list [catch {winfo pathname -displayof geek 25} msg] $msg
-} {1 {bad window path name "geek"}}
-test winfo-7.5 {"winfo pathname" command} {
- list [catch {winfo pathname xyz} msg] $msg
-} {1 {expected integer but got "xyz"}}
-test winfo-7.6 {"winfo pathname" command} {
- list [catch {winfo pathname 224} msg] $msg
-} {1 {window id "224" doesn't exist in this application}}
-test winfo-7.7 {"winfo pathname" command} {
+} -result {1 0 0}
+
+
+test winfo-7.1 {"winfo pathname" command} -body {
+ winfo pathname
+} -returnCodes error -result {wrong # args: should be "winfo pathname ?-displayof window? id"}
+test winfo-7.2 {"winfo pathname" command} -body {
+ winfo pathname a b
+} -returnCodes error -result {wrong # args: should be "winfo pathname ?-displayof window? id"}
+test winfo-7.3 {"winfo pathname" command} -body {
+ winfo pathname a b c d
+} -returnCodes error -result {wrong # args: should be "winfo pathname ?-displayof window? id"}
+test winfo-7.4 {"winfo pathname" command} -body {
+ winfo pathname -displayof geek 25
+} -returnCodes error -result {bad window path name "geek"}
+test winfo-7.5 {"winfo pathname" command} -body {
+ winfo pathname xyz
+} -returnCodes error -result {expected integer but got "xyz"}
+test winfo-7.6 {"winfo pathname" command} -body {
+ winfo pathname 224
+} -returnCodes error -result {window id "224" doesn't exist in this application}
+test winfo-7.7 {"winfo pathname" command} -setup {
+ destroy .b
+ button .b -text "Help"
+ update
+} -body {
winfo pathname -displayof .b [winfo id .]
-} {.}
-test winfo-7.8 {"winfo pathname" command} {unix testwrapper} {
+} -cleanup {
+ destroy .b
+} -result {.}
+test winfo-7.8 {"winfo pathname" command} -constraints {
+ unix testwrapper
+} -body {
winfo pathname [testwrapper .]
-} {}
+} -result {}
-test winfo-8.1 {"winfo pointerx" command} {
+
+test winfo-8.1 {"winfo pointerx" command} -setup {
+ destroy .b
+ button .b -text "Help"
+ update
+} -body {
+ catch [winfo pointerx .b]
+} -body {
catch [winfo pointerx .b]
-} 1
-test winfo-8.2 {"winfo pointery" command} {
+} -result 1
+test winfo-8.2 {"winfo pointery" command} -setup {
+ destroy .b
+ button .b -text "Help"
+ update
+} -body {
catch [winfo pointery .b]
-} 1
-test winfo-8.3 {"winfo pointerxy" command} {
+} -body {
+ catch [winfo pointerx .b]
+} -result 1
+test winfo-8.3 {"winfo pointerxy" command} -setup {
+ destroy .b
+ button .b -text "Help"
+ update
+} -body {
catch [winfo pointerxy .b]
-} 1
-
-test winfo-9.1 {"winfo viewable" command} {
- list [catch {winfo viewable} msg] $msg
-} {1 {wrong # args: should be "winfo viewable window"}}
-test winfo-9.2 {"winfo viewable" command} {
- list [catch {winfo viewable foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test winfo-9.3 {"winfo viewable" command} {
+} -body {
+ catch [winfo pointerx .b]
+} -result 1
+
+
+test winfo-9.1 {"winfo viewable" command} -body {
+ winfo viewable
+} -returnCodes error -result {wrong # args: should be "winfo viewable window"}
+test winfo-9.2 {"winfo viewable" command} -body {
+ winfo viewable foo
+} -returnCodes error -result {bad window path name "foo"}
+test winfo-9.3 {"winfo viewable" command} -body {
winfo viewable .
-} {1}
-test winfo-9.4 {"winfo viewable" command} {
+} -result {1}
+test winfo-9.4 {"winfo viewable" command} -body {
wm iconify .
winfo viewable .
-} {0}
-wm deiconify .
-test winfo-9.5 {"winfo viewable" command} {
+} -cleanup {
+ wm deiconify .
+} -result {0}
+test winfo-9.5 {"winfo viewable" command} -setup {
+ deleteWindows
+} -body {
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
place .f1.f2 -x 0 -y 0
update
list [winfo viewable .f1] [winfo viewable .f1.f2]
-} {1 1}
-test winfo-9.6 {"winfo viewable" command} {
+} -cleanup {
+ deleteWindows
+} -result {1 1}
+test winfo-9.6 {"winfo viewable" command} -setup {
deleteWindows
+} -body {
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
update
list [winfo viewable .f1] [winfo viewable .f1.f2]
-} {0 0}
-test winfo-9.7 {"winfo viewable" command} {
+} -cleanup {
+ deleteWindows
+} -result {0 0}
+test winfo-9.7 {"winfo viewable" command} -setup {
deleteWindows
+} -body {
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
@@ -248,121 +330,156 @@ test winfo-9.7 {"winfo viewable" command} {
update
wm iconify .
list [winfo viewable .f1] [winfo viewable .f1.f2]
-} {0 0}
-wm deiconify .
-deleteWindows
+} -cleanup {
+ wm deiconify .
+ deleteWindows
+} -result {0 0}
-test winfo-10.1 {"winfo visualid" command} {
- list [catch {winfo visualid} msg] $msg
-} {1 {wrong # args: should be "winfo visualid window"}}
-test winfo-10.2 {"winfo visualid" command} {
- list [catch {winfo visualid gorp} msg] $msg
-} {1 {bad window path name "gorp"}}
-test winfo-10.3 {"winfo visualid" command} {
- expr 2+[winfo visualid .]-[winfo visualid .]
-} {2}
-
-test winfo-11.1 {"winfo visualid" command} {
- list [catch {winfo visualsavailable} msg] $msg
-} {1 {wrong # args: should be "winfo visualsavailable window ?includeids?"}}
-test winfo-11.2 {"winfo visualid" command} {
- list [catch {winfo visualsavailable gorp} msg] $msg
-} {1 {bad window path name "gorp"}}
-test winfo-11.3 {"winfo visualid" command} {
- list [catch {winfo visualsavailable . includeids foo} msg] $msg
-} {1 {wrong # args: should be "winfo visualsavailable window ?includeids?"}}
-test winfo-11.4 {"winfo visualid" command} {
+
+test winfo-10.1 {"winfo visualid" command} -body {
+ winfo visualid
+} -returnCodes error -result {wrong # args: should be "winfo visualid window"}
+test winfo-10.2 {"winfo visualid" command} -body {
+ winfo visualid gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test winfo-10.3 {"winfo visualid" command} -body {
+ expr {2 + [winfo visualid .] - [winfo visualid .]}
+} -result {2}
+
+
+test winfo-11.1 {"winfo visualid" command} -body {
+ winfo visualsavailable
+} -returnCodes error -result {wrong # args: should be "winfo visualsavailable window ?includeids?"}
+test winfo-11.2 {"winfo visualid" command} -body {
+ winfo visualsavailable gorp
+} -returnCodes error -result {bad window path name "gorp"}
+test winfo-11.3 {"winfo visualid" command} -body {
+ winfo visualsavailable . includeids foo
+} -returnCodes error -result {wrong # args: should be "winfo visualsavailable window ?includeids?"}
+test winfo-11.4 {"winfo visualid" command} -body {
llength [lindex [winfo visualsa .] 0]
-} {2}
-test winfo-11.5 {"winfo visualid" command} {
+} -result {2}
+test winfo-11.5 {"winfo visualid" command} -body {
llength [lindex [winfo visualsa . includeids] 0]
-} {3}
-test winfo-11.6 {"winfo visualid" command} {
+} -result {3}
+test winfo-11.6 {"winfo visualid" command} -body {
set x [lindex [lindex [winfo visualsa . includeids] 0] 2]
expr $x + 2 - $x
-} {2}
+} -result {2}
+
+
+test winfo-12.1 {GetDisplayOf procedure} -body {
+ winfo atom - foo x
+} -returnCodes error -result {wrong # args: should be "winfo atom ?-displayof window? name"}
+test winfo-12.2 {GetDisplayOf procedure} -body {
+ winfo atom -d bad_window x
+} -returnCodes error -result {bad window path name "bad_window"}
-test winfo-12.1 {GetDisplayOf procedure} {
- list [catch {winfo atom - foo x} msg] $msg
-} {1 {wrong # args: should be "winfo atom ?-displayof window? name"}}
-test winfo-12.2 {GetDisplayOf procedure} {
- list [catch {winfo atom -d bad_window x} msg] $msg
-} {1 {bad window path name "bad_window"}}
# Some embedding tests
-#
+#
+test winfo-13.1 {root coordinates of embedded toplevel} -setup {
+ deleteWindows
+} -body {
+ frame .con -container 1
+ pack .con -expand yes -fill both
+ toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
+ button .emb.b
+ pack .emb.b -expand yes -fill both
+ update
+
+ list rootx [expr {[winfo rootx .emb] == [winfo rootx .con]}] \
+ rooty [expr {[winfo rooty .emb] == [winfo rooty .con]}]
+} -cleanup {
+ deleteWindows
+} -result {rootx 1 rooty 1}
-proc MakeEmbed {} {
+test winfo-13.2 {destroying embedded toplevel} -setup {
+ deleteWindows
+} -body {
frame .con -container 1
pack .con -expand yes -fill both
toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
button .emb.b
pack .emb.b -expand yes -fill both
update
-}
-test winfo-13.1 {root coordinates of embedded toplevel} {
- MakeEmbed
- set z [expr [winfo rootx .emb] == [winfo rootx .con] && \
- [winfo rooty .emb] == [winfo rooty .con]]
- destroy .emb
- destroy .con
- set z
-} {1}
-test winfo-13.2 {destroying embedded toplevel} {
+
destroy .emb
update
- expr [winfo exists .emb.b] || [winfo exists .con]
-} 0
+ list embedded [winfo exists .emb.b] container [winfo exists .con]
+} -cleanup {
+ deleteWindows
+} -result {embedded 0 container 1}
-deleteWindows
+test winfo-13.3 {destroying container window} -setup {
+ deleteWindows
+} -body {
+ frame .con -container 1
+ pack .con -expand yes -fill both
+ toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
+ button .emb.b
+ pack .emb.b -expand yes -fill both
+ update
-test winfo-13.3 {destroying container window} {
- MakeEmbed
destroy .con
update
- set z [expr [winfo exists .emb.b] || [winfo exists .emb]]
- catch {destroy .emb}
- catch {destroy .con}
- set z
-} 0
+ list child [winfo exists .emb.b] parent [winfo exists .emb]
+} -cleanup {
+ deleteWindows
+} -result {child 0 parent 0}
-deleteWindows
+test winfo-13.4 {[winfo containing] with embedded windows} -setup {
+ deleteWindows
+} -body {
+ frame .con -container 1
+ pack .con -expand yes -fill both
+ toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
+ button .emb.b
+ pack .emb.b -expand yes -fill both
+ update
-test winfo-13.4 {[winfo containing] with embedded windows} {
- MakeEmbed
button .b
pack .b -expand yes -fill both
update
+ string compare .emb.b \
+ [winfo containing [winfo rootx .emb.b] [winfo rooty .emb.b]]
+} -cleanup {
+ deleteWindows
+} -result 0
- set z [string compare \
- [winfo containing [winfo rootx .emb.b] [winfo rooty .emb.b]] .emb.b]
- catch {destroy .con}
- catch {destroy .emb}
- set z
-} 0
-test winfo-14.1 {usage} {
- list [catch {winfo ismapped} msg] $msg
-} {1 {wrong # args: should be "winfo ismapped window"}}
+test winfo-14.1 {usage} -body {
+ winfo ismapped
+} -returnCodes error -result {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.2 {usage} -body {
+ winfo ismapped . .
+} -returnCodes error -result {wrong # args: should be "winfo ismapped window"}
-test winfo-14.3 {initially unmapped} {
- catch {destroy .t}
+test winfo-14.3 {initially unmapped} -setup {
+ destroy .t
+} -body {
toplevel .t
winfo ismapped .t
-} 0
+} -cleanup {
+ destroy .t
+} -result 0
-test winfo-14.4 {mapped at idle time} {
- catch {destroy .t}
+test winfo-14.4 {mapped at idle time} -setup {
+ destroy .t
+} -body {
toplevel .t
update idletasks
winfo ismapped .t
-} 1
+} -cleanup {
+ destroy .t
+} -result 1
deleteWindows
# cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/tests/wm.test b/tests/wm.test
index 15526e7..1aa0779 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -641,16 +641,16 @@ test wm-geometry-1.3 {usage} -returnCodes error -body {
wm geometry . bogus
} -result {bad geometry specifier "bogus"}
-test wm-geometry-2.1 {setting values} -setup {
- set result {}
-} -body {
+test wm-geometry-2.1 {setting values} -body {
wm geometry .t 150x150+50+50
update
- lappend result [wm geometry .t]
+ set result [wm geometry .t]
wm geometry .t {}
update
- lappend result [string equal [wm geometry .t] "150x150+50+50"]
-} -result [list 150x150+50+50 0]
+ return [list $result [string equal [wm geometry .t] $result]]
+} -cleanup {
+ unset result
+} -match glob -result [list 150x150+*+* 0]
### wm grid ###
@@ -1354,6 +1354,7 @@ test wm-stackorder-2.3 {stacking order} -body {
toplevel .t ; update
toplevel .t2 ; update
raise .
+ raiseDelay
raise .t2
raiseDelay
wm stackorder .
@@ -1704,6 +1705,7 @@ test wm-transient-4.1 {transient toplevel is withdrawn
test wm-transient-4.2 {already mapped transient toplevel
is withdrawn if master is iconic} -body {
toplevel .master
+ raiseDelay
wm iconify .master
update
toplevel .subject
diff --git a/tests/xmfbox.test b/tests/xmfbox.test
index b60bf48..f50329c 100644
--- a/tests/xmfbox.test
+++ b/tests/xmfbox.test
@@ -1,4 +1,4 @@
-# xmfbox.test --
+# xmfbox.test --
#
# This file is a Tcl script to test the file dialog that's used
# when the tk_strictMotif flag is set. Because the file dialog
@@ -10,89 +10,104 @@
# Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
# All rights reserved.
-package require tcltest 2.1
-eval tcltest::configure $argv
+package require tcltest 2.2
+namespace import ::tcltest::*
+tcltest::configure {*}$argv
tcltest::loadTestedCommands
set testPWD [pwd]
-catch {unset foo}
-
catch {unset data foo}
proc cleanup {} {
global testPWD
set err0 [catch {
- cd $testPWD
+ cd $testPWD
} msg0]
set err1 [catch {
- if [file exists ./~nosuchuser1] {
- file delete ./~nosuchuser1
- }
+ if [file exists ./~nosuchuser1] {
+ file delete ./~nosuchuser1
+ }
} msg1]
set err2 [catch {
- if [file exists ./~nosuchuser2] {
- file delete ./~nosuchuser2
- }
+ if [file exists ./~nosuchuser2] {
+ file delete ./~nosuchuser2
+ }
} msg2]
set err3 [catch {
- if [file exists ./~nosuchuser3] {
- file delete ./~nosuchuser3
- }
+ if [file exists ./~nosuchuser3] {
+ file delete ./~nosuchuser3
+ }
} msg3]
set err4 [catch {
- if [file exists ./~nosuchuser4] {
- file delete ./~nosuchuser4
- }
+ if [file exists ./~nosuchuser4] {
+ file delete ./~nosuchuser4
+ }
} msg4]
if {$err0 || $err1 || $err2 || $err3 || $err4} {
- error [list $msg0 $msg1 $msg2 $msg3 $msg4]
+ error [list $msg0 $msg1 $msg2 $msg3 $msg4]
}
catch {unset foo}
- catch {destroy .foo}
+ destroy .foo
}
-test xmfbox-1.1 {tk::MotifFDialog_Create, -parent switch} unix {
+# ----------------------------------------------------------------------
+
+test xmfbox-1.1 {tk::MotifFDialog_Create, -parent switch} -constraints {
+ unix
+} -setup {
catch {unset foo}
+} -body {
set x [tk::MotifFDialog_Create foo open {-parent .}]
- catch {destroy $x}
- set x
-} .foo
+} -cleanup {
+ destroy $x
+} -result {.foo}
-test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} unix {
+test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} -constraints {
+ unix
+} -setup {
catch {unset foo}
+ deleteWindows
+} -body {
toplevel .bar
wm geometry .bar +0+0
set x [tk::MotifFDialog_Create foo open {-parent .bar}]
- catch {destroy $x}
- catch {destroy .bar}
- set x
-} .bar.foo
+} -cleanup {
+ destroy $x
+ destroy .bar
+} -result {.bar.foo}
-test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} unix {
+
+test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} -constraints {
+ unix
+} -body {
cleanup
file mkdir ./~nosuchuser1
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 [tk::MotifFDialog_InterpFilter $x]
-} [list $testPWD/~nosuchuser1 *]
+} -result "$testPWD/~nosuchuser1 *"
-test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} unix {
+test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} -constraints {
+ unix
+} -body {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
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 [tk::MotifFDialog_InterpFilter $x]
-} [list $testPWD ./~nosuchuser1]
+} -result "$testPWD ./~nosuchuser1"
-test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} unix {
+test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} -constraints {
+ unix
+} -body {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
@@ -101,17 +116,21 @@ test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} unix {
tk::MotifFDialog_InterpFilter $x
tk::MotifFDialog_Update $x
$::tk::dialog::file::foo(fList) get end
-} ~nosuchuser1
+} -result {~nosuchuser1}
-test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} unix {
+test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} -constraints {
+ unix
+} -body {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
expr {$i >= 0}
-} 1
+} -result 1
-test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} unix {
+test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} -constraints {
+ unix
+} -body {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
@@ -120,9 +139,11 @@ test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} unix {
$::tk::dialog::file::foo(fList) selection set $i
tk::MotifFDialog_BrowseFList $x
$::tk::dialog::file::foo(sEnt) get
-} $testPWD/~nosuchuser1
+} -result "$testPWD/~nosuchuser1"
-test xmfbox-2.6 {tk::MotifFDialog_ActivateFList, ~ in file names} unix {
+test xmfbox-2.6 {tk::MotifFDialog_ActivateFList, ~ in file names} -constraints {
+ unix
+} -body {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
set x [tk::MotifFDialog_Create foo open {}]
@@ -133,9 +154,13 @@ test xmfbox-2.6 {tk::MotifFDialog_ActivateFList, ~ in file names} unix {
tk::MotifFDialog_ActivateFList $x
list $::tk::dialog::file::foo(selectPath) \
$::tk::dialog::file::foo(selectFile) $tk::Priv(selectFilePath)
-} [list $testPWD ~nosuchuser1 $testPWD/~nosuchuser1]
+} -result "$testPWD ~nosuchuser1 $testPWD/~nosuchuser1"
# cleanup
cleanup
cleanupTests
return
+
+# Local variables:
+# mode: tcl
+# End:
diff --git a/unix/Makefile.in b/unix/Makefile.in
index fa23848..a38ff74 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -50,7 +50,7 @@ INSTALL_ROOT = $(DESTDIR)
TK_LIBRARY = @TK_LIBRARY@
# Path to use at runtime to refer to LIB_INSTALL_DIR:
-LIB_RUNTIME_DIR = $(libdir)
+LIB_RUNTIME_DIR = @LIB_RUNTIME_DIR@
# Directory in which to install the program wish:
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir)
@@ -129,7 +129,7 @@ CFLAGS_WARNING = @CFLAGS_WARNING@
# The default switches for optimization or debugging
CFLAGS_DEBUG = @CFLAGS_DEBUG@
-CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@
+CFLAGS_OPTIMIZE = -DNDEBUG @CFLAGS_OPTIMIZE@
# To change the compiler switches, for example to change from optimization to
# debugging symbols, change the following line:
@@ -154,7 +154,7 @@ AQUA_INCLUDES = -I$(MAC_OSX_DIR) -I$(XLIB_DIR)
# Linker switch(es) to use to link with the X11 library archive (the
# configure script will try to set this value automatically, but you
# can override it).
-X11_LIB_SWITCHES = @XLIBSW@ $(XFT_LIBS)
+X11_LIB_SWITCHES = $(XFT_LIBS) @XLIBSW@
# To turn off the security checks that disallow incoming sends when
@@ -199,14 +199,16 @@ SHELL = @SHELL@
# path. Targets that need an installed tclsh should not depend
# on this variable.
-BUILD_TCLSH = @BUILD_TCLSH@@EXEEXT@
+BUILD_TCLSH = @BUILD_TCLSH@
# 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. This variable is set to "" if no tclsh is available.
+EXE_SUFFIX = @EXEEXT@
TCL_EXE = @TCLSH_PROG@
+WISH_EXE = wish${EXE_SUFFIX}
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
@@ -216,16 +218,17 @@ TCL_EXE = @TCLSH_PROG@
INSTALL_STRIP_PROGRAM = -s
INSTALL_STRIP_LIBRARY = -S -x
-INSTALL = @srcdir@/install-sh -c
+INSTALL = $(SHELL) $(UNIX_DIR)/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_DATA_DIR = ${INSTALL} -d -m 755
# The symbol below provides support for dynamic loading and shared
# libraries. See configure.in for a description of what it means.
# The value of the symbol is normally set by the configure script.
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
+SHLIB_CFLAGS = @SHLIB_CFLAGS@ -DBUILD_tk
# To enable support for stubs in Tcl.
STUB_LIB_FILE = @TK_STUB_LIB_FILE@
@@ -307,7 +310,7 @@ UNIX_DIR = $(TOP_DIR)/unix
BMAP_DIR = $(TOP_DIR)/bitmaps
TOOL_DIR = @TCL_SRC_DIR@/tools
TEST_DIR = $(TOP_DIR)/tests
-MAC_OSX_DIR = $(TOP_DIR)/macosx
+MAC_OSX_DIR = $(TOP_DIR)/@MACOSX_SRC_DIR@
XLIB_DIR = $(TOP_DIR)/xlib
#----------------------------------------------------------------
@@ -328,7 +331,7 @@ CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@
-CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) ${TCL_STUB_FLAGS}
+CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@
APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@
@@ -350,7 +353,8 @@ CANV_OBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \
tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o \
tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o
-IMAGE_OBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o
+IMAGE_OBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPNG.o tkImgPPM.o \
+ tkImgPhoto.o tkImgPhInstance.o
TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \
tkTextMark.o tkTextTag.o tkTextWind.o
@@ -359,7 +363,8 @@ TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \
#
FONT_OBJS = @UNIX_FONT_OBJS@
-GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o \
+GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.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 \
@@ -374,7 +379,7 @@ TTK_OBJS = \
ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o \
ttkWidget.o ttkStubInit.o
-STUB_OBJS = tkStubInit.o tkStubLib.o
+STUB_OBJS = tkStubInit.o
STUB_LIB_OBJS = tkStubLib.o ttkStubLib.o
@@ -392,7 +397,7 @@ AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \
tkMacOSXMenubutton.o tkMacOSXMenus.o tkMacOSXMouseEvent.o \
tkMacOSXNotify.o tkMacOSXRegion.o tkMacOSXScrlbr.o tkMacOSXSend.o \
tkMacOSXSubwindows.o tkMacOSXWindowEvent.o \
- tkMacOSXWm.o tkMacOSXXStubs.o tkMacOSXCarbonEvents.o \
+ tkMacOSXWm.o tkMacOSXXStubs.o @EXTRA_AQUA_OBJS@ \
tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o tkUnixScale.o \
xcolors.o xdraw.o xgc.o ximage.o xutil.o \
ttkMacOSXTheme.o
@@ -413,7 +418,8 @@ TTK_DECLS = \
GENERIC_SRCS = \
$(GENERIC_DIR)/tk3d.c $(GENERIC_DIR)/tkArgv.c \
$(GENERIC_DIR)/tkAtom.c $(GENERIC_DIR)/tkBind.c \
- $(GENERIC_DIR)/tkBitmap.c $(GENERIC_DIR)/tkClipboard.c \
+ $(GENERIC_DIR)/tkBitmap.c $(GENERIC_DIR)/tkBusy.c \
+ $(GENERIC_DIR)/tkClipboard.c \
$(GENERIC_DIR)/tkCmds.c $(GENERIC_DIR)/tkColor.c \
$(GENERIC_DIR)/tkConfig.c $(GENERIC_DIR)/tkCursor.c \
$(GENERIC_DIR)/tkError.c $(GENERIC_DIR)/tkEvent.c \
@@ -440,15 +446,16 @@ GENERIC_SRCS = \
$(GENERIC_DIR)/tkCanvWind.c $(GENERIC_DIR)/tkRectOval.c \
$(GENERIC_DIR)/tkTrig.c $(GENERIC_DIR)/tkImage.c \
$(GENERIC_DIR)/tkImgBmap.c $(GENERIC_DIR)/tkImgGIF.c \
- $(GENERIC_DIR)/tkImgPPM.c \
- $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkText.c \
+ $(GENERIC_DIR)/tkImgPNG.c $(GENERIC_DIR)/tkImgPPM.c \
+ $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhInstance.c \
+ $(GENERIC_DIR)/tkText.c \
$(GENERIC_DIR)/tkTextBTree.c $(GENERIC_DIR)/tkTextDisp.c \
$(GENERIC_DIR)/tkTextImage.c \
$(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \
$(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \
$(GENERIC_DIR)/tkOldConfig.c $(GENERIC_DIR)/tkOldTest.c \
$(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \
- $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c
+ $(GENERIC_DIR)/tkStubInit.c
TTK_SRCS = \
$(TTK_DIR)/ttkBlink.c \
@@ -518,7 +525,7 @@ AQUA_SRCS = \
$(MAC_OSX_DIR)/tkMacOSXSend.c $(MAC_OSX_DIR)/tkMacOSXSubwindows.c \
$(MAC_OSX_DIR)/tkMacOSXTest.c $(MAC_OSX_DIR)/tkMacOSXWindowEvent.c \
$(MAC_OSX_DIR)/tkMacOSXWm.c $(MAC_OSX_DIR)/tkMacOSXXStubs.c \
- $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c \
+ @EXTRA_AQUA_SRCS@ \
$(GENERIC_DIR)/tkFileFilter.c $(GENERIC_DIR)/tkMacWinMenu.c \
$(GENERIC_DIR)/tkPointer.c $(UNIX_DIR)/tkUnix3d.c \
$(UNIX_DIR)/tkUnixScale.c $(XLIB_DIR)/xcolors.c $(XLIB_DIR)/xdraw.c \
@@ -562,12 +569,11 @@ SHELL_ENV = \
all: binaries libraries doc
-binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish@EXEEXT@
+binaries: ${LIB_FILE} ${STUB_LIB_FILE} ${WISH_EXE}
libraries:
$(TOP_DIR)/doc/man.macros:
- chmod +x $(UNIX_DIR)/install-sh
$(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(TOP_DIR)/doc/man.macros
doc: $(TOP_DIR)/doc/man.macros
@@ -603,9 +609,9 @@ tkLibObjs:
objs: ${OBJS}
-wish@EXEEXT@: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
+${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish@EXEEXT@
+ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE}
# Resetting the LIB_RUNTIME_DIR below is required so that
# the generated tktest executable gets the build directory
@@ -613,21 +619,21 @@ wish@EXEEXT@: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@
# picking up an already installed version of the Tcl or
# Tk shared libraries.
-tktest@EXEEXT@: $(TKTEST_OBJS) $(TK_LIB_FILE)
+tktest${EXE_SUFFIX}: $(TKTEST_OBJS) $(TK_LIB_FILE)
$(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)"
-tktest-real:
- ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest@EXEEXT@
+tktest-real: ${TK_STUB_LIB_FILE}
+ ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \
+ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest${EXE_SUFFIX}
-# 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} ${CFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \
- @TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(LD_SEARCH_FLAGS) -lXt -o xttest
+# # 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) ${TK_STUB_LIB_FILE}
+# ${CC} ${CFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \
+# @TK_BUILD_LIB_SPEC@ ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} \
+# $(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
@@ -638,52 +644,58 @@ xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE)
test: test-classic test-ttk
-test-classic: tktest@EXEEXT@
- $(SHELL_ENV) ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS)
+test-classic: tktest${EXE_SUFFIX}
+ $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS)
-test-ttk: tktest@EXEEXT@
- $(SHELL_ENV) ./tktest@EXEEXT@ $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \
+test-ttk: tktest${EXE_SUFFIX}
+ $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \
$(TESTFLAGS)
# Tests with different languages
-testlang: tktest@EXEEXT@
+testlang: tktest${EXE_SUFFIX}
$(SHELL_ENV) \
for lang in $(LOCALES) ; \
do \
LANG=$(lang); export LANG; \
- ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 \
+ ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 \
$(TESTFLAGS); \
done
# Useful target to launch a built tktest with the proper path,...
-runtest: tktest@EXEEXT@
- $(SHELL_ENV) ./tktest@EXEEXT@
+runtest: tktest${EXE_SUFFIX}
+ $(SHELL_ENV) ./tktest${EXE_SUFFIX}
# This target can be used to run wish from the build directory
# via `make shell` or `make shell SCRIPT=/tmp/foo.tcl`
-shell: wish@EXEEXT@
- $(SHELL_ENV) ./wish@EXEEXT@ $(SCRIPT)
+shell: ${WISH_EXE}
+ $(SHELL_ENV) ./${WISH_EXE} $(SCRIPT)
demo:
- $(SHELL_ENV) ./wish@EXEEXT@ $(TOP_DIR)/library/demos/widget
+ $(SHELL_ENV) ./${WISH_EXE} $(TOP_DIR)/library/demos/widget
# This target can be used to run wish inside either gdb or insight
-gdb: wish@EXEEXT@
- @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
+gdb: ${WISH_EXE}
+ @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@EXEEXT@ --command=gdb.run
+ gdb ./${WISH_EXE} --command=gdb.run
rm gdb.run
VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v
valgrind: tktest@EXEEXT@
- $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest@EXEEXT@ $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS)
+ $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS)
valgrindshell: tktest@EXEEXT@
- $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest@EXEEXT@ $(SCRIPT)
+ $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(SCRIPT)
-INSTALL_TARGETS = install-binaries install-libraries install-demos install-doc @EXTRA_INSTALL@
+INSTALL_BASE_TARGETS = install-binaries install-libraries
+INSTALL_DOC_TARGETS = install-doc
+INSTALL_DEV_TARGETS = install-headers
+INSTALL_DEMO_TARGETS = install-demos
+INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
+INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
+ $(INSTALL_DEMO_TARGETS) $(INSTALL_EXTRA_TARGETS)
install: $(INSTALL_TARGETS)
@@ -696,35 +708,31 @@ install-strip:
# some ranlibs write to current directory, and this might not always be
# possible (e.g. if installing as root).
-install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@
+install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE}
@for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \
"$(PKG_INSTALL_DIR)" "$(CONFIG_INSTALL_DIR)" ; \
do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p "$$i"; \
- chmod 755 "$$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
- fi
@if test "x$(TK_SHARED_BUILD)" = "x1"; then \
echo "Creating package index $(PKG_INDEX)"; \
rm -f "$(PKG_INDEX)"; \
(\
- echo "if {[catch {package present Tcl 8.5.0}]} { return }";\
+ echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\
relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\
echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL)\
[list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\
) > "$(PKG_INDEX)"; \
fi
- @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
+ @echo "Installing $(LIB_FILE) to @DLL_INSTALL_DIR@/"
@@INSTALL_LIB@
- @chmod 555 "$(LIB_INSTALL_DIR)"/$(LIB_FILE)
- @echo "Installing wish@EXEEXT@ as $(BIN_INSTALL_DIR)/wish$(VERSION)@EXEEXT@"
- @$(INSTALL_PROGRAM) wish@EXEEXT@ "$(BIN_INSTALL_DIR)"/wish$(VERSION)@EXEEXT@
+ @chmod 555 "@DLL_INSTALL_DIR@"/$(LIB_FILE)
+ @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}"
+ @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX}
@echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/"
@$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)"/tkConfig.sh
@if test "$(STUB_LIB_FILE)" != "" ; then \
@@ -732,54 +740,41 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) wish@EXEEXT@
@INSTALL_STUB_LIB@ ; \
fi
@EXTRA_INSTALL_BINARIES@
+ @echo "Installing pkg-config file to $(LIB_INSTALL_DIR)/pkgconfig/"
+ @$(INSTALL_DATA_DIR) $(LIB_INSTALL_DIR)/pkgconfig
+ @$(INSTALL_DATA) tk.pc $(LIB_INSTALL_DIR)/pkgconfig/tk.pc
install-libraries: libraries
- @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \
- XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)"/X11; fi; \
- for i in "$(INCLUDE_INSTALL_DIR)" "$${XLIB_INCLUDE_INSTALL_DIR}" \
- "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \
+ @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \
"$(SCRIPT_INSTALL_DIR)"/msgs "$(SCRIPT_INSTALL_DIR)"/ttk; \
do \
if [ -n "$$i" -a ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p "$$i"; \
- chmod 755 "$$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
- fi
- @echo "Installing header files";
- @for i in $(PUBLIC_HDRS); \
- do \
- $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \
- done;
- @list='$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)'; for i in $$list ; \
- do \
- $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"/X11; \
- done;
- @echo "Installing library files to $(SCRIPT_INSTALL_DIR)";
- @for i in $(TOP_DIR)/library/*.tcl \
- $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \
+ @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/";
+ @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \
+ $(UNIX_DIR)/tkAppInit.c; \
do \
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \
done;
- @echo "Installing library ttk directory";
+ @echo "Installing library ttk files to $(SCRIPT_INSTALL_DIR)/ttk/";
@for i in $(TOP_DIR)/library/ttk/*.tcl; \
do \
if [ -f $$i ] ; then \
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/ttk; \
fi; \
done;
- @echo "Installing library images directory";
+ @echo "Installing library image files to $(SCRIPT_INSTALL_DIR)/images/";
@for i in $(TOP_DIR)/library/images/*; \
do \
if [ -f $$i ] ; then \
$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/images; \
fi; \
done;
- @echo "Installing translation directory";
+ @echo "Installing message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/";
@for i in $(TOP_DIR)/library/msgs/*.msg; \
do \
if [ -f $$i ] ; then \
@@ -792,12 +787,11 @@ install-demos:
do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p "$$i"; \
- chmod 755 "$$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
else true; \
fi; \
done;
- @echo "Installing demos to $(DEMO_INSTALL_DIR)/";
+ @echo "Installing demo files to $(DEMO_INSTALL_DIR)/";
@for i in $(TOP_DIR)/library/demos/*; \
do \
if [ -f $$i ] ; then \
@@ -809,7 +803,7 @@ install-demos:
do \
chmod 755 "$(DEMO_INSTALL_DIR)"/$$i; \
done;
- @echo "Installing demo images";
+ @echo "Installing demo images to $(DEMO_INSTALL_DIR)/images/";
@for i in $(TOP_DIR)/library/demos/images/*; \
do \
if [ -f $$i ] ; then \
@@ -822,41 +816,55 @@ install-doc:
do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p "$$i"; \
- chmod 755 "$$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
else true; \
fi; \
done;
- @echo "Installing and cross-linking top-level (.1) docs";
+ @echo "Installing and cross-linking top-level (.1) docs to $(MAN1_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.1; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \
done
-
- @echo "Installing and cross-linking C API (.3) docs";
+ @echo "Installing and cross-linking C API (.3) docs to $(MAN3_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.3; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \
done
-
- @echo "Installing and cross-linking command (.n) docs";
+ @echo "Installing and cross-linking command (.n) docs to $(MANN_INSTALL_DIR)/";
@for i in $(TOP_DIR)/doc/*.n; do \
$(SHELL) $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \
done
+install-headers:
+ @if test "$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)" != ""; then \
+ XLIB_INCLUDE_INSTALL_DIR="$(INCLUDE_INSTALL_DIR)"/X11; fi; \
+ for i in "$(INCLUDE_INSTALL_DIR)" "$${XLIB_INCLUDE_INSTALL_DIR}"; \
+ do \
+ if [ -n "$$i" -a ! -d "$$i" ] ; then \
+ echo "Making directory $$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
+ else true; \
+ fi; \
+ done;
+ @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/";
+ @for i in $(PUBLIC_HDRS); \
+ do \
+ $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \
+ done;
+ @list='$(@TK_WINDOWINGSYSTEM@_XLIB_HDRS)'; for i in $$list ; \
+ do \
+ $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"/X11; \
+ done;
+
# Optional target to install private headers
-install-private-headers: libraries
+install-private-headers:
@for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
do \
if [ ! -d "$$i" ] ; then \
echo "Making directory $$i"; \
- mkdir -p "$$i"; \
- chmod 755 "$$i"; \
+ $(INSTALL_DATA_DIR) "$$i"; \
else true; \
fi; \
done;
- @if test ! -x $(SRC_DIR)/install-sh; then \
- chmod +x $(SRC_DIR)/install-sh; \
- fi
- @echo "Installing private header files";
+ @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/";
@for i in $(PRIVATE_HDRS); \
do \
$(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \
@@ -872,11 +880,11 @@ Makefile: $(UNIX_DIR)/Makefile.in
clean:
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \
- errors wish@EXEEXT@ tktest@EXEEXT@ lib.exp Tk *.rsrc
+ errors ${WISH_EXE} tktest${EXE_SUFFIX} lib.exp Tk *.rsrc
distclean: clean
rm -rf Makefile config.status config.cache config.log tkConfig.sh \
- $(PACKAGE).* prototype tkConfig.h *.plist Tk.framework
+ tkConfig.h *.plist Tk.framework tk.pc
depend:
makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
@@ -889,7 +897,7 @@ depend:
# execute concurrently with the renaming and recompiling of that same object
# file in the target below.
-tkTestInit.o: $(UNIX_DIR)/tkAppInit.c wish@EXEEXT@
+tkTestInit.o: $(UNIX_DIR)/tkAppInit.c ${WISH_EXE}
@if test -f tkAppInit.o ; then \
rm -f tkAppInit.sav; \
mv tkAppInit.o tkAppInit.sav; \
@@ -919,6 +927,9 @@ tkBind.o: $(GENERIC_DIR)/tkBind.c
tkBitmap.o: $(GENERIC_DIR)/tkBitmap.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkBitmap.c
+tkBusy.o: $(GENERIC_DIR)/tkBusy.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkBusy.c
+
tkClipboard.o: $(GENERIC_DIR)/tkClipboard.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkClipboard.c
@@ -1078,12 +1089,18 @@ tkImgBmap.o: $(GENERIC_DIR)/tkImgBmap.c
tkImgGIF.o: $(GENERIC_DIR)/tkImgGIF.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgGIF.c
+tkImgPNG.o: $(GENERIC_DIR)/tkImgPNG.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPNG.c
+
tkImgPPM.o: $(GENERIC_DIR)/tkImgPPM.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPPM.c
-tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c
+tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkImgPhoto.h
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c
+tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c
+
tkOldTest.o: $(GENERIC_DIR)/tkOldTest.c
$(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkOldTest.c
@@ -1200,9 +1217,6 @@ tkMacOSXBitmap.o: $(MAC_OSX_DIR)/tkMacOSXBitmap.c
tkMacOSXButton.o: $(MAC_OSX_DIR)/tkMacOSXButton.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXButton.c
-tkMacOSXCarbonEvents.o: $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c
- $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXCarbonEvents.c
-
tkMacOSXClipboard.o: $(MAC_OSX_DIR)/tkMacOSXClipboard.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXClipboard.c
@@ -1291,6 +1305,9 @@ tkMacOSXWm.o: $(MAC_OSX_DIR)/tkMacOSXWm.c
tkMacOSXXStubs.o: $(MAC_OSX_DIR)/tkMacOSXXStubs.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXXStubs.c
+tkMacOSXCarbonEvents.o: $(TOP_DIR)/carbon/tkMacOSXCarbonEvents.c
+ $(CC) -c $(CC_SWITCHES) $(TOP_DIR)/carbon/tkMacOSXCarbonEvents.c
+
tkFileFilter.o: $(GENERIC_DIR)/tkFileFilter.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFileFilter.c
@@ -1503,7 +1520,7 @@ $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
$(UNIX_DIR)/tkConfig.h.in: $(MAC_OSX_DIR)/configure
cd $(MAC_OSX_DIR); autoheader; touch $@
-dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(MAC_OSX_DIR)/configure genstubs
+dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure genstubs
rm -rf $(DISTDIR)
mkdir -p $(DISTDIR)/unix
cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix
@@ -1513,7 +1530,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(MAC_OSX_DIR)/configure
$(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \
$(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \
$(UNIX_DIR)/README $(UNIX_DIR)/installManPage \
- $(UNIX_DIR)/tkConfig.h.in $(DISTDIR)/unix
+ $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix
chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
chmod +x $(DISTDIR)/unix/install-sh
mkdir $(DISTDIR)/bitmaps
@@ -1555,19 +1572,35 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(MAC_OSX_DIR)/configure
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc
$(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/wish.exe.manifest.in
mkdir $(DISTDIR)/macosx
- cp -p $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \
- $(MAC_OSX_DIR)/Wish.icns $(MAC_OSX_DIR)/*.[chr] \
- $(MAC_OSX_DIR)/*.in $(MAC_OSX_DIR)/*.ac \
- $(MAC_OSX_DIR)/*.xcconfig $(MAC_OSX_DIR)/configure \
+ cp -p $(TOP_DIR)/macosx/GNUmakefile $(TOP_DIR)/macosx/README \
+ $(TOP_DIR)/macosx/*.icns $(TOP_DIR)/macosx/*.tiff \
+ $(TOP_DIR)/macosx/*.[ch] $(TOP_DIR)/macosx/*.in \
+ $(TOP_DIR)/macosx/*.ac $(TOP_DIR)/macosx/*.xcconfig \
+ $(TOP_DIR)/macosx/*.sdef $(TOP_DIR)/macosx/configure \
$(DISTDIR)/macosx
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/macosx
- mkdir $(DISTDIR)/macosx/Wish.pbproj
- cp -p $(MAC_OSX_DIR)/Wish.pbproj/*.pbx* $(DISTDIR)/macosx/Wish.pbproj
- mkdir $(DISTDIR)/macosx/Wish.xcode
- cp -p $(MAC_OSX_DIR)/Wish.xcode/*.pbx* $(DISTDIR)/macosx/Wish.xcode
- mkdir $(DISTDIR)/macosx/Wish.xcodeproj
- cp -p $(MAC_OSX_DIR)/Wish.xcodeproj/*.pbx* \
- $(DISTDIR)/macosx/Wish.xcodeproj
+ mkdir $(DISTDIR)/macosx/Tk.xcode
+ cp -p $(TOP_DIR)/macosx/Tk.xcode/project.pbxproj \
+ $(TOP_DIR)/macosx/Tk.xcode/default.pbxuser \
+ $(DISTDIR)/macosx/Tk.xcode
+ mkdir $(DISTDIR)/macosx/Tk.xcodeproj
+ cp -p $(TOP_DIR)/macosx/Tk.xcodeproj/project.pbxproj \
+ $(TOP_DIR)/macosx/Tk.xcodeproj/default.pbxuser \
+ $(DISTDIR)/macosx/Tk.xcodeproj
+ mkdir $(DISTDIR)/carbon
+ cp -p $(TOP_DIR)/carbon/GNUmakefile $(TOP_DIR)/carbon/README \
+ $(TOP_DIR)/carbon/Wish.icns $(TOP_DIR)/carbon/*.[chr] \
+ $(TOP_DIR)/carbon/*.in $(TOP_DIR)/carbon/*.ac \
+ $(TOP_DIR)/carbon/*.xcconfig $(DISTDIR)/carbon
+ cp -p $(TOP_DIR)/license.terms $(DISTDIR)/carbon
+ mkdir $(DISTDIR)/carbon/Wish.xcode
+ cp -p $(TOP_DIR)/carbon/Wish.xcode/project.pbxproj \
+ $(TOP_DIR)/carbon/Wish.xcode/default.pbxuser \
+ $(DISTDIR)/carbon/Wish.xcode
+ mkdir $(DISTDIR)/carbon/Wish.xcodeproj
+ cp -p $(TOP_DIR)/carbon/Wish.xcodeproj/project.pbxproj \
+ $(TOP_DIR)/carbon/Wish.xcodeproj/default.pbxuser \
+ $(DISTDIR)/carbon/Wish.xcodeproj
mkdir $(DISTDIR)/compat
cp -p $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \
$(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \
@@ -1656,85 +1689,16 @@ BUILD_HTML = \
--srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS)
#
-# Targets to build Solaris package of the distribution for the current
-# architecture. To build stream packages for both sun4 and i86pc
-# architectures:
-#
-# On the sun4 machine, execute the following:
-# make distclean; ./configure
-# make DISTDIR=<distdir> package
-#
-# Once the build is complete, execute the following on the i86pc
-# machine:
-# make DISTDIR=<distdir> package-quick
-#
-# <distdir> is the absolute path to a directory where the build should
-# take place. These steps will generate the $(PACKAGE).sun4 and
-# $(PACKAGE).i86pc stream packages. It is important that the packages be
-# built in this fashion in order to ensure that the architecture
-# independent files are exactly the same, including timestamps, in
-# both packages.
-#
-
-PACKAGE=SCRPtk
-
-package: dist package-config package-common package-binaries package-generate
-package-quick: package-config package-binaries package-generate
-
-#
-# Configure for the current architecture in the dist directory.
-#
-package-config:
- mkdir -p $(DISTDIR)/unix/`arch`
- cd $(DISTDIR)/unix/`arch`; \
- ../configure --prefix=/opt/SUNWtcl/$(TCLVERSION) \
- --exec_prefix=/opt/SUNWtcl/$(TCLVERSION)/`arch` \
- --with-tcl=$(DISTDIR)/../tcl$(TCLVERSION)/unix/`arch` \
- --enable-shared
- mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION)
- mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch`
-
-#
-# Build and install the architecture independent files in the dist directory.
-#
-
-package-common:
- cd $(DISTDIR)/unix/`arch`;\
- $(MAKE); \
- $(MAKE) install-libraries install-doc \
- prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION) \
- exec_prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch`
- mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin
- sed -e "s/TCLVERSION/$(TCLVERSION)/g" \
- -e "s/TKVERSION/$(VERSION)/g" < $(UNIX_DIR)/wish.sh \
- > $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin/wish$(VERSION)
- chmod 755 $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin/wish$(VERSION)
-
-#
-# Build and install the architecture specific files in the dist directory.
-#
-
-package-binaries:
- cd $(DISTDIR)/unix/`arch`; \
- $(MAKE); \
- $(MAKE) install-binaries prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION) \
- exec_prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch`
-
-#
-# Generate a package from the installed files in the dist directory for the
-# current architecture.
+# The list of all the targets that do not correspond to real files. This stops
+# 'make' from getting confused when someone makes an error in a rule.
#
-package-generate:
- pkgproto $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin=bin \
- $(DISTDIR)/SUNWtcl/$(TCLVERSION)/include=include \
- $(DISTDIR)/SUNWtcl/$(TCLVERSION)/lib=lib \
- $(DISTDIR)/SUNWtcl/$(TCLVERSION)/man=man \
- $(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch`=`arch` \
- | $(TCL_EXE) $(TCLDIR)/unix/mkProto.tcl $(TCLVERSION) \
- $(UNIX_DIR) > prototype
- pkgmk -o -d . -f prototype -a `arch`
- pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE)
- rm -rf $(PACKAGE)
+.PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest
+.PHONY: install install-strip install-binaries install-libraries
+.PHONY: install-headers install-private-headers install-doc
+.PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar
+.PHONY: shell gdb valgrind valgrindshell dist alldist rpm
+.PHONY: tkLibObjs tktest-real test-classic test-ttk testlang
+.PHONY: demo install-demos
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/unix/configure b/unix/configure
index b2b6c8b..81bc617 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for tk 8.5.
+# Generated by GNU Autoconf 2.59 for tk 8.6.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tk'
PACKAGE_TARNAME='tk'
-PACKAGE_VERSION='8.5'
-PACKAGE_STRING='tk 8.5'
+PACKAGE_VERSION='8.6'
+PACKAGE_STRING='tk 8.6'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT LIBOBJS XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS EXTRA_AQUA_OBJS EXTRA_AQUA_SRCS CFBUNDLELOCALIZATIONS MACOSX_SRC_DIR TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -777,7 +777,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tk 8.5 to adapt to many kinds of systems.
+\`configure' configures tk 8.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -838,7 +838,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tk 8.5:";;
+ short | recursive ) echo "Configuration of tk 8.6:";;
esac
cat <<\_ACEOF
@@ -852,7 +852,7 @@ Optional Features:
use STRING as a suffix to manpage file names
(default: no, tk if enabled without
specifying STRING)
- --enable-threads build with threads (default: off)
+ --enable-threads build with threads (default: on)
--enable-shared build and link with shared libraries (default: on)
--enable-64bit enable 64bit support (default: off)
--enable-64bit-vis enable 64bit Sparc VIS support (default: off)
@@ -861,7 +861,8 @@ Optional Features:
--enable-load allow dynamic loading and "load" command (default:
on)
--enable-symbols build with debugging symbols (default: off)
- --enable-aqua use Aqua windowingsystem on Mac OS X (default: off)
+ --enable-aqua=yes|carbon|no
+ use Aqua windowingsystem on Mac OS X (default: no)
--enable-xss use XScreenSaver for activity timer (default: on)
--enable-xft use freetype/fontconfig/xft (default: on)
--enable-framework package shared libraries in MacOSX frameworks
@@ -981,7 +982,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-tk configure 8.5
+tk configure 8.6
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -995,7 +996,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tk $as_me 8.5, which was
+It was created by tk $as_me 8.6, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1335,10 +1336,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-TK_VERSION=8.5
+TK_VERSION=8.6
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".10"
+TK_MINOR_VERSION=6
+TK_PATCH_LEVEL="b2"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -1585,16 +1586,6 @@ echo "${ECHO_T}$BUILD_TCLSH" >&6
-if test "${TCL_VERSION}" != "${TK_VERSION}"; then
- { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5
-echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
#------------------------------------------------------------------------
# Handle the --prefix=... option
#------------------------------------------------------------------------
@@ -2615,9 +2606,80 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
# limits header checks must come early to prevent
# an autoconf bug that throws errors on configure
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3544,7 +3606,7 @@ if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
tcl_ok=$enableval
else
- tcl_ok=no
+ tcl_ok=yes
fi;
if test "${TCL_THREADS}" = 1; then
@@ -3959,9 +4021,6 @@ echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you m
# Does the pthread-implementation provide
# 'pthread_attr_setstacksize' ?
- ac_saved_libs=$LIBS
- LIBS="$LIBS $THREADS_LIBS"
-
for ac_func in pthread_attr_setstacksize
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -4063,385 +4122,6 @@ _ACEOF
fi
done
- echo "$as_me:$LINENO: checking for pthread_attr_get_np" >&5
-echo $ECHO_N "checking for pthread_attr_get_np... $ECHO_C" >&6
-if test "${ac_cv_func_pthread_attr_get_np+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pthread_attr_get_np to an innocuous variant, in case <limits.h> declares pthread_attr_get_np.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pthread_attr_get_np innocuous_pthread_attr_get_np
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pthread_attr_get_np (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pthread_attr_get_np
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_attr_get_np ();
-/* 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_pthread_attr_get_np) || defined (__stub___pthread_attr_get_np)
-choke me
-#else
-char (*f) () = pthread_attr_get_np;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != pthread_attr_get_np;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_pthread_attr_get_np=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_pthread_attr_get_np=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_get_np" >&5
-echo "${ECHO_T}$ac_cv_func_pthread_attr_get_np" >&6
-if test $ac_cv_func_pthread_attr_get_np = yes; then
- tcl_ok=yes
-else
- tcl_ok=no
-fi
-
- if test $tcl_ok = yes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_ATTR_GET_NP 1
-_ACEOF
-
- echo "$as_me:$LINENO: checking for pthread_attr_get_np declaration" >&5
-echo $ECHO_N "checking for pthread_attr_get_np declaration... $ECHO_C" >&6
-if test "${tcl_cv_grep_pthread_attr_get_np+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <pthread.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "pthread_attr_get_np" >/dev/null 2>&1; then
- tcl_cv_grep_pthread_attr_get_np=present
-else
- tcl_cv_grep_pthread_attr_get_np=missing
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_attr_get_np" >&5
-echo "${ECHO_T}$tcl_cv_grep_pthread_attr_get_np" >&6
- if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ATTRGETNP_NOT_DECLARED 1
-_ACEOF
-
- fi
- else
- echo "$as_me:$LINENO: checking for pthread_getattr_np" >&5
-echo $ECHO_N "checking for pthread_getattr_np... $ECHO_C" >&6
-if test "${ac_cv_func_pthread_getattr_np+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pthread_getattr_np to an innocuous variant, in case <limits.h> declares pthread_getattr_np.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pthread_getattr_np innocuous_pthread_getattr_np
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pthread_getattr_np (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pthread_getattr_np
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_getattr_np ();
-/* 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_pthread_getattr_np) || defined (__stub___pthread_getattr_np)
-choke me
-#else
-char (*f) () = pthread_getattr_np;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != pthread_getattr_np;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_pthread_getattr_np=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_pthread_getattr_np=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_pthread_getattr_np" >&5
-echo "${ECHO_T}$ac_cv_func_pthread_getattr_np" >&6
-if test $ac_cv_func_pthread_getattr_np = yes; then
- tcl_ok=yes
-else
- tcl_ok=no
-fi
-
- if test $tcl_ok = yes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_GETATTR_NP 1
-_ACEOF
-
- echo "$as_me:$LINENO: checking for pthread_getattr_np declaration" >&5
-echo $ECHO_N "checking for pthread_getattr_np declaration... $ECHO_C" >&6
-if test "${tcl_cv_grep_pthread_getattr_np+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <pthread.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "pthread_getattr_np" >/dev/null 2>&1; then
- tcl_cv_grep_pthread_getattr_np=present
-else
- tcl_cv_grep_pthread_getattr_np=missing
-fi
-rm -f conftest*
-
-fi
-echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_getattr_np" >&5
-echo "${ECHO_T}$tcl_cv_grep_pthread_getattr_np" >&6
- if test $tcl_cv_grep_pthread_getattr_np = missing ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define GETATTRNP_NOT_DECLARED 1
-_ACEOF
-
- fi
- fi
- fi
- if test $tcl_ok = no; then
- # Darwin thread stacksize API
-
-for ac_func in pthread_get_stacksize_np
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* 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 ();
-/* 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
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
- fi
- LIBS=$ac_saved_libs
else
TCL_THREADS=0
fi
@@ -4462,8 +4142,8 @@ echo "${ECHO_T}yes (threaded core)" >&6
echo "${ECHO_T}yes" >&6
fi
else
- echo "$as_me:$LINENO: result: no (default)" >&5
-echo "${ECHO_T}no (default)" >&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
@@ -4636,6 +4316,80 @@ if test "${tcl_cv_cc_visibility_hidden+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ if test "$SHARED_BUILD" = 1; then
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#if !defined(__GNUC__) || __GNUC__ < 4
+#error visibility hidden is not supported for this compiler
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ tcl_cv_cc_visibility_hidden=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_visibility_hidden=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+
+else
+
+ tcl_cv_cc_visibility_hidden=no
+
+fi
+
+
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5
+echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6
+ if test $tcl_cv_cc_visibility_hidden = yes; then
+
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE extern
+_ACEOF
+
+
+else
+
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -4686,10 +4440,7 @@ fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$hold_cflags
-fi
-echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5
-echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6
- if test $tcl_cv_cc_visibility_hidden = yes; then
+ if test $tcl_cv_cc_visibility_hidden = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -4700,6 +4451,9 @@ _ACEOF
fi
+fi
+
+
# Step 0.d: Disable -rpath support?
echo "$as_me:$LINENO: checking if rpath support is requested" >&5
@@ -4826,10 +4580,6 @@ fi
# Require ranlib early so we can override it in special cases below.
- if test x"${SHLIB_VERSION}" = x; then
- SHLIB_VERSION="1.0"
-fi
-
@@ -4848,13 +4598,16 @@ fi
ECHO_VERSION='`echo ${VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
- CFLAGS_OPTIMIZE=-O
if test "$GCC" = yes; then
+ CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall"
else
- CFLAGS_WARNING=""
+
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+
fi
if test -n "$ac_tool_prefix"; then
@@ -4941,6 +4694,10 @@ fi
PLAT_OBJS=""
PLAT_SRCS=""
LDAIX_SRC=""
+ if test x"${SHLIB_VERSION}" = x; then
+ SHLIB_VERSION="1.0"
+fi
+
case $system in
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then
@@ -5340,6 +5097,10 @@ fi
SHLIB_LD='${CC} -shared'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+else
+
+ CFLAGS="$CFLAGS -z"
+
fi
@@ -5472,6 +5233,14 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ case $LIBOBJS in
+ "mkstemp.$ac_objext" | \
+ *" mkstemp.$ac_objext" | \
+ "mkstemp.$ac_objext "* | \
+ *" mkstemp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;;
+esac
+
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
@@ -5485,6 +5254,14 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ case $LIBOBJS in
+ "mkstemp.$ac_objext" | \
+ *" mkstemp.$ac_objext" | \
+ "mkstemp.$ac_objext "* | \
+ *" mkstemp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;;
+esac
+
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
@@ -5518,6 +5295,14 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ case $LIBOBJS in
+ "mkstemp.$ac_objext" | \
+ *" mkstemp.$ac_objext" | \
+ "mkstemp.$ac_objext "* | \
+ *" mkstemp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;;
+esac
+
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
@@ -6219,6 +6004,7 @@ cat >>confdefs.h <<\_ACEOF
#define MODULE_SCOPE __private_extern__
_ACEOF
+ tcl_cv_cc_visibility_hidden=yes
fi
@@ -7091,6 +6877,22 @@ fi
fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE extern
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_VIZ
+_ACEOF
+
+
+fi
+
+
if test "$SHARED_LIB_SUFFIX" = ""; then
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'
@@ -7101,12 +6903,23 @@ fi
UNSHARED_LIB_SUFFIX='${VERSION}.a'
fi
+ DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o $@ ${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)'
+ if test "${SHLIB_SUFFIX}" = ".dll"; then
+
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)"/$(LIB_FILE)'
+ DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
+
+else
+
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
+
+fi
+
else
@@ -7193,6 +7006,7 @@ _ACEOF
+
echo "$as_me:$LINENO: checking for build with symbols" >&5
echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6
# Check whether --enable-symbols or --disable-symbols was given.
@@ -8247,7 +8061,7 @@ esac
# search path to reflect this.
#------------------------------------------------------------------------
-LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
+LIB_RUNTIME_DIR='$(libdir)'
if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib"
@@ -9360,6 +9174,7 @@ fi
# On Mac OS X, we can build either with X11 or with Aqua
#--------------------------------------------------------------------
+MACOSX_SRC_DIR=macosx
if test "`uname -s`" = "Darwin" ; then
echo "$as_me:$LINENO: checking whether to use Aqua" >&5
echo $ECHO_N "checking whether to use Aqua... $ECHO_C" >&6
@@ -9370,12 +9185,19 @@ if test "${enable_aqua+set}" = set; then
else
tk_aqua=no
fi;
- if test $tk_aqua = yes; then
- if test $tcl_corefoundation = no; then
- { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5
-echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;}
+ if test $tk_aqua = yes -o $tk_aqua = cocoa; then
+ tk_aqua=yes
+ if test ! -d /System/Library/Frameworks/Cocoa.framework; then
+ { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Cocoa is available" >&5
+echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;}
+ tk_aqua=no
+ fi
+ if test "`uname -r | awk -F. '{print $1}'`" -lt 9; then
+ { echo "$as_me:$LINENO: WARNING: Aqua requires Mac OS X 10.5 or later" >&5
+echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;}
tk_aqua=no
fi
+ elif test $tk_aqua = carbon; then
if test ! -d /System/Library/Frameworks/Carbon.framework; then
{ echo "$as_me:$LINENO: WARNING: Aqua can only be used when Carbon is available" >&5
echo "$as_me: WARNING: Aqua can only be used when Carbon is available" >&2;}
@@ -9386,9 +9208,22 @@ echo "$as_me: WARNING: Aqua can only be used when Carbon is available" >&2;}
echo "$as_me: WARNING: Aqua requires Mac OS X 10.2 or later" >&2;}
tk_aqua=no
fi
+ else
+ tk_aqua=no
+ fi
+ if test $tk_aqua != no -a $tcl_corefoundation = no; then
+ { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5
+echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;}
+ tk_aqua=no
fi
- echo "$as_me:$LINENO: result: $tk_aqua" >&5
+ if test $tk_aqua = carbon; then
+ MACOSX_SRC_DIR=carbon
+ echo "$as_me:$LINENO: result: yes (deprecated legacy Carbon implementation)" >&5
+echo "${ECHO_T}yes (deprecated legacy Carbon implementation)" >&6
+ else
+ echo "$as_me:$LINENO: result: $tk_aqua" >&5
echo "${ECHO_T}$tk_aqua" >&6
+ fi
if test "$fat_32_64" = yes; then
if test $tk_aqua = no; then
echo "$as_me:$LINENO: checking for 64-bit X11" >&5
@@ -9457,7 +9292,7 @@ echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6
fi
# remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit
# fat builds if configuration does not support 64-bit.
- if test $tk_aqua = yes -o "$tcl_cv_lib_x11_64" = no; then
+ if test $tk_aqua = carbon -o "$tcl_cv_lib_x11_64" = no; then
{ echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5
echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
for v in CFLAGS CPPFLAGS LDFLAGS; do
@@ -9828,14 +9663,19 @@ else
tk_aqua=no
fi
-if test $tk_aqua = yes; then
+if test $tk_aqua != no; then
+ if test $tk_aqua = yes; then
+ LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit"
+ EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c -fobjc-gc'
+ else
+ LIBS="$LIBS -framework Carbon -framework IOKit"
+ CFLAGS="$CFLAGS -fpascal-strings"
+ fi
cat >>confdefs.h <<\_ACEOF
#define MAC_OSX_TK 1
_ACEOF
- LIBS="$LIBS -framework Carbon -framework IOKit"
- CFLAGS="$CFLAGS -fpascal-strings"
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
@@ -10308,7 +10148,9 @@ fi
#--------------------------------------------------------------------
if test "x${x_libraries}" != "x"; then
+ if test "x${x_libraries}" != "xNONE"; then
LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}"
+ fi
fi
if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
@@ -11167,12 +11009,15 @@ echo "${ECHO_T}static library" >&6
fi
TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`"
- TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE} -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[^_] > $$f && echo $$f)'
+ TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}'
+ if test $tk_aqua = yes; then
+ TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[0-9a-f]+ . \.objc/ {print \$$3}" > $$f && echo $$f)'
+ fi
echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000'
TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist'
EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist'
EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic'
- ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in"
+ ac_config_files="$ac_config_files Tk-Info.plist:../${MACOSX_SRC_DIR}/Tk-Info.plist.in Wish-Info.plist:../${MACOSX_SRC_DIR}/Wish-Info.plist.in"
for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}<string>$l</string>"; done
TK_YEAR="`date +%Y`"
@@ -11209,13 +11054,22 @@ _ACEOF
EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
- if test $tk_aqua = yes; then
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"'
+ if test $tk_aqua != no; then
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done'
+ else
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"'
+ fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"'
bindir="${libdir}/Resources/Wish.app/Contents/MacOS"
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"'
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"'
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"'
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources"'
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"'
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"'
+ else
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"'
+ fi
fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
# Don't use AC_DEFINE for the following as the framework version define
@@ -11224,6 +11078,9 @@ _ACEOF
# into CFLAGS as it should not go into tkConfig.sh
EXTRA_CC_SWITCHES="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"'
else
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)" && mkdir -p "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done'
+ fi
# libdir must be a fully qualified path and not ${exec_prefix}/lib
eval libdir="$libdir"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
@@ -11235,8 +11092,10 @@ else
TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
fi
-# Support for building the Aqua resource files
-if test $tk_aqua = yes; then
+# Extra bits for legacy Aqua Carbon build (carbon sources and resource files)
+if test $tk_aqua = carbon; then
+ EXTRA_AQUA_OBJS='tkMacOSXCarbonEvents.o'
+ EXTRA_AQUA_SRCS='$(TOP_DIR)/carbon/tkMacOSXCarbonEvents.c'
LIB_RSRC_FILE='${TK_RSRC_FILE}'
APP_RSRC_FILE='${WISH_RSRC_FILE}'
REZ=/Developer/Tools/Rez
@@ -11329,7 +11188,11 @@ TK_SHARED_BUILD=${SHARED_BUILD}
- ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in"
+
+
+
+
+ ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -11725,7 +11588,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by tk $as_me 8.5, which was
+This file was extended by tk $as_me 8.6, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11783,7 +11646,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-tk config.status 8.5
+tk config.status 8.6
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -11892,10 +11755,11 @@ for ac_config_target in $ac_config_targets
do
case "$ac_config_target" in
# Handling of arguments.
- "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;;
- "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;;
+ "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../${MACOSX_SRC_DIR}/Tk-Info.plist.in" ;;
+ "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../${MACOSX_SRC_DIR}/Wish-Info.plist.in" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
"tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;;
+ "tk.pc" ) CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;;
"Tk.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -12008,6 +11872,7 @@ s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@AR@,$AR,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
s,@TCL_LIBS@,$TCL_LIBS,;t t
s,@DL_LIBS@,$DL_LIBS,;t t
s,@DL_OBJS@,$DL_OBJS,;t t
@@ -12031,10 +11896,10 @@ s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
s,@MAKE_LIB@,$MAKE_LIB,;t t
s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t
s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t
s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t
s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t
s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
s,@XFT_CFLAGS@,$XFT_CFLAGS,;t t
s,@XFT_LIBS@,$XFT_LIBS,;t t
s,@UNIX_FONT_OBJS@,$UNIX_FONT_OBJS,;t t
@@ -12064,6 +11929,7 @@ s,@LOCALES@,$LOCALES,;t t
s,@TK_WINDOWINGSYSTEM@,$TK_WINDOWINGSYSTEM,;t t
s,@TK_PKG_DIR@,$TK_PKG_DIR,;t t
s,@TK_LIBRARY@,$TK_LIBRARY,;t t
+s,@LIB_RUNTIME_DIR@,$LIB_RUNTIME_DIR,;t t
s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t
s,@HTML_DIR@,$HTML_DIR,;t t
s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t
@@ -12072,7 +11938,10 @@ s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t
s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t
s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t
s,@EXTRA_WISH_LIBS@,$EXTRA_WISH_LIBS,;t t
+s,@EXTRA_AQUA_OBJS@,$EXTRA_AQUA_OBJS,;t t
+s,@EXTRA_AQUA_SRCS@,$EXTRA_AQUA_SRCS,;t t
s,@CFBUNDLELOCALIZATIONS@,$CFBUNDLELOCALIZATIONS,;t t
+s,@MACOSX_SRC_DIR@,$MACOSX_SRC_DIR,;t t
s,@TK_RSRC_FILE@,$TK_RSRC_FILE,;t t
s,@WISH_RSRC_FILE@,$WISH_RSRC_FILE,;t t
s,@LIB_RSRC_FILE@,$LIB_RSRC_FILE,;t t
@@ -12432,7 +12301,7 @@ echo "$as_me: executing $ac_dest commands" >&6;}
rm -rf $f && mkdir -p $f/$v/Resources &&
ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
- if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi &&
+ if test $tk_aqua != no; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi &&
unset n f v
;;
esac
@@ -12468,3 +12337,4 @@ if test "$no_create" != yes; then
$ac_cs_success || { (exit 1); exit 1; }
fi
+
diff --git a/unix/configure.in b/unix/configure.in
index 28d1a07..3458dd0 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ 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.
-AC_INIT([tk],[8.5])
+AC_INIT([tk],[8.6])
AC_PREREQ(2.59)
dnl This is only used when included from macosx/configure.ac
@@ -22,10 +22,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
#endif /* _TKCONFIG */])
])
-TK_VERSION=8.5
+TK_VERSION=8.6
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".10"
+TK_MINOR_VERSION=6
+TK_PATCH_LEVEL="b2"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -39,12 +39,6 @@ SC_LOAD_TCLCONFIG
SC_PROG_TCLSH
SC_BUILD_TCLSH
-if test "${TCL_VERSION}" != "${TK_VERSION}"; then
- AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}.
-Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}.
-Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.])
-fi
-
#------------------------------------------------------------------------
# Handle the --prefix=... option
#------------------------------------------------------------------------
@@ -76,6 +70,7 @@ if test "${CFLAGS+set}" != "set" ; then
fi
AC_PROG_CC
+AC_C_INLINE
# limits header checks must come early to prevent
# an autoconf bug that throws errors on configure
@@ -152,7 +147,7 @@ AC_C_BIGENDIAN
# search path to reflect this.
#------------------------------------------------------------------------
-LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
+LIB_RUNTIME_DIR='$(libdir)'
if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib"
@@ -265,17 +260,24 @@ fi
# On Mac OS X, we can build either with X11 or with Aqua
#--------------------------------------------------------------------
+MACOSX_SRC_DIR=macosx
if test "`uname -s`" = "Darwin" ; then
AC_MSG_CHECKING([whether to use Aqua])
AC_ARG_ENABLE(aqua,
- AC_HELP_STRING([--enable-aqua],
- [use Aqua windowingsystem on Mac OS X (default: off)]),
+ AC_HELP_STRING([--enable-aqua=yes|carbon|no],
+ [use Aqua windowingsystem on Mac OS X (default: no)]),
[tk_aqua=$enableval], [tk_aqua=no])
- if test $tk_aqua = yes; then
- if test $tcl_corefoundation = no; then
- AC_MSG_WARN([Aqua can only be used when CoreFoundation is available])
+ if test $tk_aqua = yes -o $tk_aqua = cocoa; then
+ tk_aqua=yes
+ if test ! -d /System/Library/Frameworks/Cocoa.framework; then
+ AC_MSG_WARN([Aqua can only be used when Cocoa is available])
+ tk_aqua=no
+ fi
+ if test "`uname -r | awk -F. '{print [$]1}'`" -lt 9; then
+ AC_MSG_WARN([Aqua requires Mac OS X 10.5 or later])
tk_aqua=no
fi
+ elif test $tk_aqua = carbon; then
if test ! -d /System/Library/Frameworks/Carbon.framework; then
AC_MSG_WARN([Aqua can only be used when Carbon is available])
tk_aqua=no
@@ -284,8 +286,19 @@ if test "`uname -s`" = "Darwin" ; then
AC_MSG_WARN([Aqua requires Mac OS X 10.2 or later])
tk_aqua=no
fi
+ else
+ tk_aqua=no
+ fi
+ if test $tk_aqua != no -a $tcl_corefoundation = no; then
+ AC_MSG_WARN([Aqua can only be used when CoreFoundation is available])
+ tk_aqua=no
+ fi
+ if test $tk_aqua = carbon; then
+ MACOSX_SRC_DIR=carbon
+ AC_MSG_RESULT([yes (deprecated legacy Carbon implementation)])
+ else
+ AC_MSG_RESULT([$tk_aqua])
fi
- AC_MSG_RESULT([$tk_aqua])
if test "$fat_32_64" = yes; then
if test $tk_aqua = no; then
AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
@@ -302,7 +315,7 @@ if test "`uname -s`" = "Darwin" ; then
fi
# remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit
# fat builds if configuration does not support 64-bit.
- if test $tk_aqua = yes -o "$tcl_cv_lib_x11_64" = no; then
+ if test $tk_aqua = carbon -o "$tcl_cv_lib_x11_64" = no; then
AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
for v in CFLAGS CPPFLAGS LDFLAGS; do
eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
@@ -361,10 +374,15 @@ else
tk_aqua=no
fi
-if test $tk_aqua = yes; then
+if test $tk_aqua != no; then
+ if test $tk_aqua = yes; then
+ LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit"
+ EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c -fobjc-gc'
+ else
+ LIBS="$LIBS -framework Carbon -framework IOKit"
+ CFLAGS="$CFLAGS -fpascal-strings"
+ fi
AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?])
- LIBS="$LIBS -framework Carbon -framework IOKit"
- CFLAGS="$CFLAGS -fpascal-strings"
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
AC_DEFINE(TK_MAC_DEBUG, 1, [Are TkAqua debug messages enabled?])
@@ -398,7 +416,9 @@ fi
#--------------------------------------------------------------------
if test "x${x_libraries}" != "x"; then
+ if test "x${x_libraries}" != "xNONE"; then
LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${x_libraries}"
+ fi
fi
if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
@@ -620,12 +640,15 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc'
if test "`uname -s`" = "Darwin" ; then
SC_ENABLE_FRAMEWORK
TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`"
- TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE} -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[[^_]] > $$f && echo $$f)'
+ TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}'
+ if test $tk_aqua = yes; then
+ TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[[0-9a-f]]+ . \.objc/ {print \$$3}" > $$f && echo $$f)'
+ fi
echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000'
TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist'
EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist'
EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic'
- AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in])
+ AC_CONFIG_FILES([Tk-Info.plist:../${MACOSX_SRC_DIR}/Tk-Info.plist.in Wish-Info.plist:../${MACOSX_SRC_DIR}/Wish-Info.plist.in])
for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}<string>$l</string>"; done
TK_YEAR="`date +%Y`"
fi
@@ -639,7 +662,7 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
rm -rf $f && mkdir -p $f/$v/Resources &&
ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v &&
ln -s ../../../../$n-Info.plist $f/$v/Resources/Info.plist &&
- if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi &&
+ if test $tk_aqua != no; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi &&
unset n f v
], VERSION=${TK_VERSION} && tk_aqua=${tk_aqua})
LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH"
@@ -663,13 +686,22 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
- if test $tk_aqua = yes; then
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"'
+ if test $tk_aqua != no; then
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done'
+ else
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"'
+ fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"'
bindir="${libdir}/Resources/Wish.app/Contents/MacOS"
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"'
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources"'
- EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"'
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources"'
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"'
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"'
+ else
+ EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"'
+ fi
fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
# Don't use AC_DEFINE for the following as the framework version define
@@ -678,6 +710,9 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
# into CFLAGS as it should not go into tkConfig.sh
EXTRA_CC_SWITCHES="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"'
else
+ if test $tk_aqua = yes; then
+ EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)" && mkdir -p "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done'
+ fi
# libdir must be a fully qualified path and not ${exec_prefix}/lib
eval libdir="$libdir"
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
@@ -689,8 +724,10 @@ else
TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
fi
-# Support for building the Aqua resource files
-if test $tk_aqua = yes; then
+# Extra bits for legacy Aqua Carbon build (carbon sources and resource files)
+if test $tk_aqua = carbon; then
+ EXTRA_AQUA_OBJS='tkMacOSXCarbonEvents.o'
+ EXTRA_AQUA_SRCS='$(TOP_DIR)/carbon/tkMacOSXCarbonEvents.c'
LIB_RSRC_FILE='${TK_RSRC_FILE}'
APP_RSRC_FILE='${WISH_RSRC_FILE}'
REZ=/Developer/Tools/Rez
@@ -765,6 +802,7 @@ AC_SUBST(LOCALES)
AC_SUBST(TK_WINDOWINGSYSTEM)
AC_SUBST(TK_PKG_DIR)
AC_SUBST(TK_LIBRARY)
+AC_SUBST(LIB_RUNTIME_DIR)
AC_SUBST(PRIVATE_INCLUDE_DIR)
AC_SUBST(HTML_DIR)
@@ -774,8 +812,11 @@ AC_SUBST(EXTRA_INSTALL)
AC_SUBST(EXTRA_INSTALL_BINARIES)
AC_SUBST(EXTRA_BUILD_HTML)
AC_SUBST(EXTRA_WISH_LIBS)
+AC_SUBST(EXTRA_AQUA_OBJS)
+AC_SUBST(EXTRA_AQUA_SRCS)
AC_SUBST(CFBUNDLELOCALIZATIONS)
+AC_SUBST(MACOSX_SRC_DIR)
AC_SUBST(TK_RSRC_FILE)
AC_SUBST(WISH_RSRC_FILE)
AC_SUBST(LIB_RSRC_FILE)
@@ -786,5 +827,10 @@ AC_SUBST(REZ_FLAGS)
AC_CONFIG_FILES([
Makefile:../unix/Makefile.in
tkConfig.sh:../unix/tkConfig.sh.in
+ tk.pc:../unix/tk.pc.in
])
AC_OUTPUT
+
+dnl Local Variables:
+dnl mode: autoconf
+dnl End:
diff --git a/unix/install-sh b/unix/install-sh
index 1572b93..5975819 100755..100644
--- a/unix/install-sh
+++ b/unix/install-sh
@@ -1,122 +1,528 @@
#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-04-20.01; # UTC
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
#
-# install - install a program, script, or datafile
-# This comes from X11R5; it is not part of GNU.
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
-#
+nl='
+'
+IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
-# put in absolute paths if you don't have them in your path; or use env. vars.
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
+posix_mkdir=
-instcmd="$mvprog"
-chmodcmd=""
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -S) stripcmd="$stripprog $2"
- shift
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- dst=$1
- fi
- shift
- continue;;
- esac
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -S $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+-S) stripcmd="$stripprog $2"
+ shift;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
done
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
fi
-if [ x"$dst" = x ]
-then
- echo "install: no destination specified"
- exit 1
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
fi
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
-if [ -d "$dst" ]
-then
- dst="$dst/`basename "$src"`"
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
fi
-# Make a temp file name in the proper directory.
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-dstdir="`dirname "$dst"`"
-dsttmp="$dstdir"/#inst.$$#
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
-# Move or copy the file name to the temp name
+ prefixes=
-$doit $instcmd "$src" "$dsttmp"
+ for d
+ do
+ test -z "$d" && continue
-# and set any options; do chmod last to preserve setuid bits
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
-if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; fi
-if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; fi
-if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; fi
-if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; fi
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
-# Now rename the file to the real destination.
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
-$doit $rmcmd "$dst"
-$doit $mvcmd "$dsttmp" "$dst"
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
-exit 0
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/unix/installManPage b/unix/installManPage
index 6bdccf0..4d615bf 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -59,9 +59,7 @@ test -z "$SymOrLoc" && SymOrLoc="$Dir/"
# backticks which doesn't pass backslashes literally.
#
Names=`sed -n '
-# Look for a line, that starts with .SH NAME
-# optionally allow NAME to be surrounded
-# by quotes.
+# Look for a line that starts with .SH NAME
/^\.SH NAME/{
# Read next line
n
@@ -71,6 +69,9 @@ Names=`sed -n '
s/\\\ //g
# Delete from \- to the end of line
s/ \\\-.*//
+# Convert all non-space non-alphanum sequences
+# to single underscores.
+ s/[^ A-Za-z0-9][^ A-Za-z0-9]*/_/g
# print the result and exit
p;q
}' $ManPage`
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 78eacd9..229e0b8 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -618,8 +618,8 @@ AC_DEFUN([SC_ENABLE_FRAMEWORK], [
AC_DEFUN([SC_ENABLE_THREADS], [
AC_ARG_ENABLE(threads,
AC_HELP_STRING([--enable-threads],
- [build with threads (default: off)]),
- [tcl_ok=$enableval], [tcl_ok=no])
+ [build with threads (default: on)]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
if test "${TCL_THREADS}" = 1; then
tcl_threaded_core=1;
@@ -676,44 +676,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [
# Does the pthread-implementation provide
# 'pthread_attr_setstacksize' ?
-
- ac_saved_libs=$LIBS
- LIBS="$LIBS $THREADS_LIBS"
AC_CHECK_FUNCS(pthread_attr_setstacksize)
- AC_CHECK_FUNC(pthread_attr_get_np,tcl_ok=yes,tcl_ok=no)
- if test $tcl_ok = yes ; then
- AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
- [Do we want a BSD-like thread-attribute interface?])
- AC_CACHE_CHECK([for pthread_attr_get_np declaration],
- tcl_cv_grep_pthread_attr_get_np, [
- AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
- tcl_cv_grep_pthread_attr_get_np=present,
- tcl_cv_grep_pthread_attr_get_np=missing)])
- if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
- AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
- [Is pthread_attr_get_np() declared in <pthread.h>?])
- fi
- else
- AC_CHECK_FUNC(pthread_getattr_np,tcl_ok=yes,tcl_ok=no)
- if test $tcl_ok = yes ; then
- AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
- [Do we want a Linux-like thread-attribute interface?])
- AC_CACHE_CHECK([for pthread_getattr_np declaration],
- tcl_cv_grep_pthread_getattr_np, [
- AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
- tcl_cv_grep_pthread_getattr_np=present,
- tcl_cv_grep_pthread_getattr_np=missing)])
- if test $tcl_cv_grep_pthread_getattr_np = missing ; then
- AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
- [Is pthread_getattr_np declared in <pthread.h>?])
- fi
- fi
- fi
- if test $tcl_ok = no; then
- # Darwin thread stacksize API
- AC_CHECK_FUNCS(pthread_get_stacksize_np)
- fi
- LIBS=$ac_saved_libs
else
TCL_THREADS=0
fi
@@ -727,7 +690,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [
AC_MSG_RESULT([yes])
fi
else
- AC_MSG_RESULT([no (default)])
+ AC_MSG_RESULT([no])
fi
AC_SUBST(TCL_THREADS)
@@ -1079,16 +1042,33 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CACHE_CHECK([if compiler supports visibility "hidden"],
tcl_cv_cc_visibility_hidden, [
+ AS_IF([test "$SHARED_BUILD" = 1], [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fvisibility=hidden -Werror"
+ AC_TRY_COMPILE(,[#if !defined(__GNUC__) || __GNUC__ < 4
+#error visibility hidden is not supported for this compiler
+#endif
+ ], tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
+ CFLAGS=$hold_cflags
+ ], [
+ tcl_cv_cc_visibility_hidden=no
+ ])
+ ])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden])
+ ], [
hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
AC_TRY_LINK([
extern __attribute__((__visibility__("hidden"))) void f(void);
void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
tcl_cv_cc_visibility_hidden=no)
- CFLAGS=$hold_cflags])
- AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
- AC_DEFINE(MODULE_SCOPE,
- [extern __attribute__((__visibility__("hidden")))],
- [Compiler support for module scope symbols])
+ CFLAGS=$hold_cflags
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ ])
])
# Step 0.d: Disable -rpath support?
@@ -1111,7 +1091,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Require ranlib early so we can override it in special cases below.
- AS_IF([test x"${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"])
AC_REQUIRE([AC_PROG_RANLIB])
@@ -1130,16 +1109,20 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
ECHO_VERSION='`echo ${VERSION}`'
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
- CFLAGS_OPTIMIZE=-O
AS_IF([test "$GCC" = yes], [
+ CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall"
- ], [CFLAGS_WARNING=""])
+ ], [
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+ ])
AC_CHECK_TOOL(AR, ar)
STLIB_LD='${AR} cr'
LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
PLAT_OBJS=""
PLAT_SRCS=""
LDAIX_SRC=""
+ AS_IF([test x"${SHLIB_VERSION}" = x], [SHLIB_VERSION="1.0"])
case $system in
AIX-*)
AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
@@ -1290,6 +1273,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$GCC" = yes], [
SHLIB_LD='${CC} -shared'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ CFLAGS="$CFLAGS -z"
])
# Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
@@ -1337,6 +1322,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
@@ -1347,6 +1333,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
@@ -1372,6 +1359,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
+ AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
@@ -1676,6 +1664,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
[Compiler support for module scope symbols])
+ tcl_cv_cc_visibility_hidden=yes
])
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
@@ -2074,15 +2063,27 @@ dnl # preprocessing tests use only CPPFLAGS.
*) SHLIB_CFLAGS="-fPIC" ;;
esac])
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [extern],
+ [No Compiler support for module scope symbols])
+ AC_DEFINE(NO_VIZ, [], [No visibility attribute])
+ ])
+
AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}'])
AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
UNSHARED_LIB_SUFFIX='${VERSION}.a'])
+ DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)"
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o [$]@ ${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)'
+ AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)"/$(LIB_FILE)'
+ DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
+ ], [
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)'
+ ])
], [
LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
@@ -2144,6 +2145,7 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_STUB_LIB)
AC_SUBST(INSTALL_LIB)
+ AC_SUBST(DLL_INSTALL_DIR)
AC_SUBST(INSTALL_STUB_LIB)
AC_SUBST(RANLIB)
])
@@ -2465,11 +2467,6 @@ AC_DEFUN([SC_BLOCKING_STYLE], [
SC_CONFIG_SYSTEM
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
case $system in
- # There used to be code here to use FIONBIO under AIX. However, it
- # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
- # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
- # code (JO, 5/31/97).
-
OSF*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
AC_MSG_RESULT([FIONBIO])
@@ -3011,37 +3008,6 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
])])
#--------------------------------------------------------------------
-# SC_TCL_GETADDRINFO
-#
-# Check if we have 'getaddrinfo'
-#
-# Arguments:
-# None
-#
-# Results:
-# Might define the following vars:
-# HAVE_GETADDRINFO
-#
-#--------------------------------------------------------------------
-
-AC_DEFUN([SC_TCL_GETADDRINFO], [AC_CHECK_FUNC(getaddrinfo, [
- AC_CACHE_CHECK([for working getaddrinfo], tcl_cv_api_getaddrinfo, [
- AC_TRY_COMPILE([
- #include <netdb.h>
- ], [
- const char *name, *port;
- struct addrinfo *aiPtr, hints;
- (void)getaddrinfo(name,port, &hints, &aiPtr);
- (void)freeaddrinfo(aiPtr);
- ], tcl_cv_api_getaddrinfo=yes, tcl_cv_getaddrinfo=no)])
- tcl_ok=$tcl_cv_api_getaddrinfo
- if test "$tcl_ok" = yes; then
- AC_DEFINE(HAVE_GETADDRINFO, 1,
- [Define to 1 if getaddrinfo is available.])
- fi
-])])
-
-#--------------------------------------------------------------------
# SC_TCL_GETPWUID_R
#
# Check if we have MT-safe variant of getpwuid() and if yes,
@@ -3281,6 +3247,25 @@ AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
fi
])])
+AC_DEFUN([SC_TCL_IPV6],[
+ NEED_FAKE_RFC2553=0
+ AC_CHECK_FUNCS(getnameinfo getaddrinfo freeaddrinfo gai_strerror,,[NEED_FAKE_RFC2553=1])
+ AC_CHECK_TYPES([
+ struct addrinfo,
+ struct in6_addr,
+ struct sockaddr_in6,
+ struct sockaddr_storage],,[NEED_FAKE_RFC2553=1],[[
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+]])
+if test "x$NEED_FAKE_RFC2553" = "x1"; then
+ AC_DEFINE(NEED_FAKE_RFC2553)
+ AC_LIBOBJ([fake-rfc2553])
+ AC_CHECK_FUNC(strlcpy)
+fi
+])
# Local Variables:
# mode: autoconf
# End:
diff --git a/unix/tk.pc.in b/unix/tk.pc.in
new file mode 100644
index 0000000..d84a1cf
--- /dev/null
+++ b/unix/tk.pc.in
@@ -0,0 +1,15 @@
+# tk pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: The Tk Toolkit
+Description: Tk is a cross-platform graphical user interface toolkit, the standard GUI not only for Tcl, but for many other dynamic languages as well.
+URL: http://www.tcl.tk/
+Version: @TK_VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} @TK_LIBS@
+Cflags: -I${includedir}
diff --git a/unix/tk.spec b/unix/tk.spec
index 0680d85..88a3007 100644
--- a/unix/tk.spec
+++ b/unix/tk.spec
@@ -4,15 +4,15 @@
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
-Version: 8.5.10
+Version: 8.6b2
Release: 2
License: BSD
Group: Development/Languages
Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz
URL: http://www.tcl.tk/
Buildroot: /var/tmp/%{name}%{version}
-Buildrequires: XFree86-devel tcl >= 8.5.0
-Requires: tcl >= 8.5.0
+Buildrequires: XFree86-devel tcl >= %version
+Requires: tcl >= %version
%description
The Tcl (Tool Command Language) provides a powerful platform for
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index 050e226..5fce66e 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.c
@@ -1,22 +1,49 @@
/*
* tkAppInit.c --
*
- * Provides a default version of the Tcl_AppInit procedure for use in
- * wish and similar Tk-based applications.
+ * Provides a default version of the main program and Tcl_AppInit
+ * procedure for wish and other Tk-based applications.
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998-1999 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#undef BUILD_tk
+#undef STATIC_BUILD
#include "tk.h"
-#include "locale.h"
#ifdef TK_TEST
-extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
+extern Tcl_PackageInitProc Tktest_Init;
#endif /* TK_TEST */
+
+/*
+ * The following #if block allows you to change the AppInit function by using
+ * a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The
+ * #if checks for that #define and uses Tcl_AppInit if it doesn't exist.
+ */
+
+#ifndef TK_LOCAL_APPINIT
+#define TK_LOCAL_APPINIT Tcl_AppInit
+#endif
+#ifndef MODULE_SCOPE
+# define MODULE_SCOPE extern
+#endif
+MODULE_SCOPE int TK_LOCAL_APPINIT(Tcl_Interp *);
+MODULE_SCOPE int main(int, char **);
+
+/*
+ * The following #if block allows you to change how Tcl finds the startup
+ * script, prime the library or encoding paths, fiddle with the argv, etc.,
+ * without needing to rewrite Tk_Main()
+ */
+
+#ifdef TK_LOCAL_MAIN_HOOK
+extern int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
+#endif
/*
*----------------------------------------------------------------------
@@ -30,7 +57,7 @@ extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
* either.
*
* Side effects:
- * Whatever the application does.
+ * Just about anything, since from here we call arbitrary Tcl code.
*
*----------------------------------------------------------------------
*/
@@ -40,26 +67,7 @@ main(
int argc, /* Number of command-line arguments. */
char **argv) /* Values of command-line arguments. */
{
- /*
- * 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));
-
- /*
- * The following #if block allows you to change how Tcl finds the startup
- * script, prime the library or encoding paths, fiddle with the argv,
- * etc., without needing to rewrite Tk_Main()
- */
-
#ifdef TK_LOCAL_MAIN_HOOK
- extern int TK_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
TK_LOCAL_MAIN_HOOK(&argc, &argv);
#endif
@@ -90,19 +98,20 @@ int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
- if (Tcl_Init(interp) == TCL_ERROR) {
+ if ((Tcl_Init)(interp) == TCL_ERROR) {
return TCL_ERROR;
}
+
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
- (Tcl_PackageInitProc *) NULL);
+ Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0);
#endif /* TK_TEST */
/*
@@ -113,7 +122,8 @@ Tcl_AppInit(
* return TCL_ERROR;
* }
*
- * where "Mod" is the name of the module.
+ * where "Mod" is the name of the module. (Dynamically-loadable packages
+ * should have the same entry-point name.)
*/
/*
@@ -125,10 +135,10 @@ Tcl_AppInit(
* 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.
+ * specific startup file will be run under any conditions.
*/
- Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
+ (Tcl_SetVar)(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
}
diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in
index cfa8a32..3318552 100644
--- a/unix/tkConfig.h.in
+++ b/unix/tkConfig.h.in
@@ -4,12 +4,6 @@
#ifndef _TKCONFIG
#define _TKCONFIG
-/* Is pthread_attr_get_np() declared in <pthread.h>? */
-#undef ATTRGETNP_NOT_DECLARED
-
-/* Is pthread_getattr_np declared in <pthread.h>? */
-#undef GETATTRNP_NOT_DECLARED
-
/* Define to 1 if you have the <AvailabilityMacros.h> header file. */
#undef HAVE_AVAILABILITYMACROS_H
@@ -37,18 +31,9 @@
/* Define to 1 if you have the `open64' function. */
#undef HAVE_OPEN64
-/* Do we want a BSD-like thread-attribute interface? */
-#undef HAVE_PTHREAD_ATTR_GET_NP
-
/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
-/* Do we want a Linux-like thread-attribute interface? */
-#undef HAVE_PTHREAD_GETATTR_NP
-
-/* Define to 1 if you have the `pthread_get_stacksize_np' function. */
-#undef HAVE_PTHREAD_GET_STACKSIZE_NP
-
/* Does struct password have a pw_gecos field? */
#undef HAVE_PW_GECOS
@@ -106,7 +91,7 @@
/* Are we building TkAqua? */
#undef MAC_OSX_TK
-/* Compiler support for module scope symbols */
+/* No Compiler support for module scope symbols */
#undef MODULE_SCOPE
/* Is Darwin CoreFoundation unavailable for 64-bit? */
@@ -121,6 +106,9 @@
/* Do we have <stdlib.h>? */
#undef NO_STDLIB_H
+/* No visibility attribute */
+#undef NO_VIZ
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -226,6 +214,12 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
/* Signed integer type wide enough to hold a pointer. */
#undef intptr_t
diff --git a/unix/tkUnix.c b/unix/tkUnix.c
index 3fa7387..841a1b7 100644
--- a/unix/tkUnix.c
+++ b/unix/tkUnix.c
@@ -69,11 +69,11 @@ TkGetServerInfo(
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
TkGetDefaultScreenName(
Tcl_Interp *interp, /* Interp used to find environment
* variables. */
- CONST 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);
diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c
index 417866b..38ce683 100644
--- a/unix/tkUnix3d.c
+++ b/unix/tkUnix3d.c
@@ -46,7 +46,8 @@ typedef struct {
TkBorder *
TkpGetBorder(void)
{
- UnixBorder *borderPtr = (UnixBorder *) ckalloc(sizeof(UnixBorder));
+ UnixBorder *borderPtr = ckalloc(sizeof(UnixBorder));
+
borderPtr->solidGC = None;
return (TkBorder *) borderPtr;
}
@@ -377,7 +378,7 @@ TkpGetShadows(
*/
/*
- * Compute the dark shadow color
+ * Compute the dark shadow color.
*/
r = (int) borderPtr->bgColorPtr->red;
@@ -395,7 +396,7 @@ TkpGetShadows(
}
/*
- * Allocate the dark shadow color and its GC
+ * Allocate the dark shadow color and its GC.
*/
borderPtr->darkColorPtr = Tk_GetColorByValue(tkwin, &darkColor);
@@ -403,7 +404,7 @@ TkpGetShadows(
borderPtr->darkGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
/*
- * Compute the light shadow color
+ * Compute the light shadow color.
*/
if (g > MAX_INTENSITY*0.95) {
@@ -431,9 +432,9 @@ TkpGetShadows(
lightColor.blue = (tmp1 > tmp2) ? tmp1 : tmp2;
}
- /*
- * Allocate the light shadow color and its GC
- */
+ /*
+ * Allocate the light shadow color and its GC.
+ */
borderPtr->lightColorPtr = Tk_GetColorByValue(tkwin, &lightColor);
gcValues.foreground = borderPtr->lightColorPtr->pixel;
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 373f2e3..e45812e 100644
--- a/unix/tkUnixButton.c
+++ b/unix/tkUnixButton.c
@@ -35,9 +35,11 @@ typedef struct UnixButton {
* The class function table for the button widgets.
*/
-Tk_ClassProcs tkpButtonProcs = {
+const Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -55,7 +57,7 @@ Tk_ClassProcs tkpButtonProcs = {
*/
/* XPM */
-static char *button_images[] = {
+static const char *const button_images[] = {
/* width height ncolors chars_per_pixel */
"52 26 7 1",
/* colors */
@@ -279,7 +281,7 @@ TkpDrawCheckIndicator(
for (iy=0 ; iy<dim ; iy++) {
for (ix=0 ; ix<dim ; ix++) {
XPutPixel(img, ix, iy,
- imgColors[button_images[imgstart+iy][imgsel+ix] - 'A'] );
+ imgColors[button_images[imgstart+iy][imgsel+ix] - 'A']);
}
}
@@ -293,9 +295,9 @@ TkpDrawCheckIndicator(
copyGC = Tk_GetGC(tkwin, 0, &gcValues);
XPutImage(display, pixmap, copyGC, img, 0, 0, 0, 0,
- (unsigned int)dim, (unsigned int)dim);
+ (unsigned)dim, (unsigned)dim);
XCopyArea(display, pixmap, d, copyGC, 0, 0,
- (unsigned int)dim, (unsigned int)dim, x, y);
+ (unsigned)dim, (unsigned)dim, x, y);
/*
* Tidy up.
@@ -326,7 +328,8 @@ TkButton *
TkpCreateButton(
Tk_Window tkwin)
{
- UnixButton *butPtr = (UnixButton *) ckalloc(sizeof(UnixButton));
+ UnixButton *butPtr = ckalloc(sizeof(UnixButton));
+
return (TkButton *) butPtr;
}
diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c
index e9fdf11..afa9d24 100644
--- a/unix/tkUnixColor.c
+++ b/unix/tkUnixColor.c
@@ -10,7 +10,7 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkInt.h"
+#include "tkUnixInt.h"
#include "tkColor.h"
/*
@@ -176,7 +176,7 @@ TkpGetColor(
}
}
- tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ tkColPtr = ckalloc(sizeof(TkColor));
tkColPtr->color = color;
return tkColPtr;
@@ -211,7 +211,7 @@ TkpGetColorByValue(
{
Display *display = Tk_Display(tkwin);
Colormap colormap = Tk_Colormap(tkwin);
- TkColor *tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ TkColor *tkColPtr = ckalloc(sizeof(TkColor));
tkColPtr->color.red = colorPtr->red;
tkColPtr->color.green = colorPtr->green;
@@ -269,7 +269,7 @@ FindClosestColor(
for (stressPtr = dispPtr->stressPtr; ; stressPtr = stressPtr->nextPtr) {
if (stressPtr == NULL) {
- stressPtr = (TkStressedCmap *) ckalloc(sizeof(TkStressedCmap));
+ stressPtr = ckalloc(sizeof(TkStressedCmap));
stressPtr->colormap = colormap;
template.visualid = XVisualIDFromVisual(Tk_Visual(tkwin));
@@ -281,8 +281,8 @@ FindClosestColor(
stressPtr->numColors = visInfoPtr->colormap_size;
XFree((char *) visInfoPtr);
- stressPtr->colorPtr = (XColor *) ckalloc((unsigned)
- (stressPtr->numColors * sizeof(XColor)));
+ stressPtr->colorPtr =
+ ckalloc(stressPtr->numColors * sizeof(XColor));
for (i = 0; i < stressPtr->numColors; i++) {
stressPtr->colorPtr[i].pixel = (unsigned long) i;
}
@@ -390,8 +390,8 @@ DeleteStressedCmap(
} else {
prevPtr->nextPtr = stressPtr->nextPtr;
}
- ckfree((char *) stressPtr->colorPtr);
- ckfree((char *) stressPtr);
+ ckfree(stressPtr->colorPtr);
+ ckfree(stressPtr);
return;
}
}
diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c
index 2862eff..bb39127 100644
--- a/unix/tkUnixConfig.c
+++ b/unix/tkUnixConfig.c
@@ -35,8 +35,8 @@
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. */
+ const char *dbName, /* The option database name. */
+ const char *className) /* The name of the option class. */
{
return NULL;
}
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 2169d1c..1603ee3 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -28,8 +28,8 @@ typedef struct {
* the official cursor font:
*/
-static struct CursorName {
- CONST char *name;
+static const struct CursorName {
+ const char *name;
unsigned int shape;
} cursorNames[] = {
{"X_cursor", XC_X_cursor},
@@ -159,9 +159,9 @@ static struct CursorName {
#endif /* DEFINE_MYARROW_CURSOR */
-static struct TkCursorName {
- char *name;
- char *data;
+static const struct TkCursorName {
+ const char *name;
+ const char *data;
char *mask;
} tkCursorNames[] = {
{"none", CURSOR_NONE_DATA, NULL},
@@ -180,9 +180,9 @@ static struct TkCursorName {
#endif
static Cursor CreateCursorFromTableOrFile(Tcl_Interp *interp,
- Tk_Window tkwin, int argc, CONST char **argv,
- struct TkCursorName *tkCursorPtr);
-
+ Tk_Window tkwin, int argc, const char **argv,
+ const struct TkCursorName *tkCursorPtr);
+
/*
*----------------------------------------------------------------------
*
@@ -211,10 +211,10 @@ TkGetCursorByName(
TkUnixCursor *cursorPtr = NULL;
Cursor cursor = None;
int argc;
- CONST char **argv = NULL;
+ const char **argv = NULL;
Display *display = Tk_Display(tkwin);
int inTkTable = 0;
- struct TkCursorName* tkCursorPtr = NULL;
+ const struct TkCursorName *tkCursorPtr = NULL;
if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
return NULL;
@@ -245,7 +245,7 @@ TkGetCursorByName(
if ((argv[0][0] != '@') && !inTkTable) {
XColor fg, bg;
unsigned int maskIndex;
- register struct CursorName *namePtr;
+ register const struct CursorName *namePtr;
TkDisplay *dispPtr;
/*
@@ -332,20 +332,20 @@ TkGetCursorByName(
}
if (cursor != None) {
- cursorPtr = (TkUnixCursor *) ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
cleanup:
if (argv != NULL) {
- ckfree((char *) argv);
+ ckfree(argv);
}
return (TkCursor *) cursorPtr;
badString:
if (argv) {
- ckfree((char *) argv);
+ ckfree(argv);
}
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
return NULL;
@@ -375,8 +375,8 @@ CreateCursorFromTableOrFile(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which cursor will be used. */
int argc,
- CONST char **argv, /* Cursor spec parsed into elements. */
- struct TkCursorName *tkCursorPtr)
+ const char **argv, /* Cursor spec parsed into elements. */
+ const struct TkCursorName *tkCursorPtr)
/* Non-NULL when cursor is defined in Tk
* table. */
{
@@ -386,8 +386,8 @@ CreateCursorFromTableOrFile(
int xHot = -1, yHot = -1;
int dummy1, dummy2;
XColor fg, bg;
- CONST char *fgColor;
- CONST char *bgColor;
+ const char *fgColor;
+ const char *bgColor;
int inTkTable = (tkCursorPtr != NULL);
Display *display = Tk_Display(tkwin);
@@ -428,7 +428,7 @@ CreateCursorFromTableOrFile(
ckfree(data);
} else {
if (TkReadBitmapFile(display, drawable, &argv[0][1],
- (unsigned int *) &width, (unsigned int *) &height,
+ (unsigned *) &width, (unsigned *) &height,
&source, &xHot, &yHot) != BitmapSuccess) {
Tcl_AppendResult(interp, "cleanup reading bitmap file \"",
&argv[0][1], "\"", NULL);
@@ -548,7 +548,7 @@ CreateCursorFromTableOrFile(
}
return cursor;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -568,8 +568,8 @@ CreateCursorFromTableOrFile(
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. */
+ 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. */
@@ -592,13 +592,13 @@ TkCreateCursorFromData(
Tk_FreePixmap(display, maskPixmap);
if (cursor != None) {
- cursorPtr = (TkUnixCursor *) ckalloc(sizeof(TkUnixCursor));
+ cursorPtr = ckalloc(sizeof(TkUnixCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursor;
cursorPtr->display = display;
}
return (TkCursor *) cursorPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -625,7 +625,7 @@ TkpFreeCursor(
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h
index 4eb8778..b922278 100644
--- a/unix/tkUnixDefault.h
+++ b/unix/tkUnixDefault.h
@@ -64,7 +64,7 @@
#define DEF_BUTTON_HIGHLIGHT BLACK
#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
#define DEF_BUTTON_HIGHLIGHT_WIDTH "1"
-#define DEF_BUTTON_IMAGE (char *) NULL
+#define DEF_BUTTON_IMAGE ((char *) NULL)
#define DEF_BUTTON_INDICATOR "1"
#define DEF_BUTTON_JUSTIFY "center"
#define DEF_BUTTON_OFF_VALUE "0"
@@ -81,10 +81,10 @@
#define DEF_BUTTON_REPEAT_INTERVAL "0"
#define DEF_BUTTON_SELECT_COLOR CHECK_INDICATOR
#define DEF_BUTTON_SELECT_MONO BLACK
-#define DEF_BUTTON_SELECT_IMAGE (char *) NULL
+#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_TAKE_FOCUS ((char *) NULL)
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
#define DEF_BUTTON_UNDERLINE "-1"
@@ -122,7 +122,7 @@
#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_TAKE_FOCUS ((char *) NULL)
#define DEF_CANVAS_WIDTH "10c"
#define DEF_CANVAS_X_SCROLL_CMD ""
#define DEF_CANVAS_X_SCROLL_INCREMENT "0"
@@ -163,9 +163,9 @@
#define DEF_ENTRY_SELECT_BD_MONO "0"
#define DEF_ENTRY_SELECT_FG_COLOR BLACK
#define DEF_ENTRY_SELECT_FG_MONO WHITE
-#define DEF_ENTRY_SHOW (char *) NULL
+#define DEF_ENTRY_SHOW ((char *) NULL)
#define DEF_ENTRY_STATE "normal"
-#define DEF_ENTRY_TAKE_FOCUS (char *) NULL
+#define DEF_ENTRY_TAKE_FOCUS ((char *) NULL)
#define DEF_ENTRY_TEXT_VARIABLE ""
#define DEF_ENTRY_WIDTH "20"
@@ -232,36 +232,36 @@
#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_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_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_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_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_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_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_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_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_SELECT ((char *) NULL)
#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
@@ -287,7 +287,7 @@
#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_TEAROFF_CMD ((char *) NULL)
#define DEF_MENU_TITLE ""
#define DEF_MENU_TYPE "normal"
@@ -315,7 +315,7 @@
#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_IMAGE ((char *) NULL)
#define DEF_MENUBUTTON_INDICATOR "0"
#define DEF_MENUBUTTON_JUSTIFY "center"
#define DEF_MENUBUTTON_MENU ""
@@ -415,7 +415,7 @@
#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_DELAY "300"
#define DEF_SCALE_REPEAT_INTERVAL "100"
#define DEF_SCALE_RESOLUTION "1"
#define DEF_SCALE_TROUGH_COLOR TROUGH
@@ -424,7 +424,7 @@
#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_TAKE_FOCUS ((char *) NULL)
#define DEF_SCALE_TICK_INTERVAL "0"
#define DEF_SCALE_TO "100"
#define DEF_SCALE_VARIABLE ""
@@ -451,7 +451,7 @@
#define DEF_SCROLLBAR_RELIEF "sunken"
#define DEF_SCROLLBAR_REPEAT_DELAY "300"
#define DEF_SCROLLBAR_REPEAT_INTERVAL "100"
-#define DEF_SCROLLBAR_TAKE_FOCUS (char *) NULL
+#define DEF_SCROLLBAR_TAKE_FOCUS ((char *) NULL)
#define DEF_SCROLLBAR_TROUGH_COLOR TROUGH
#define DEF_SCROLLBAR_TROUGH_MONO WHITE
#define DEF_SCROLLBAR_WIDTH "11"
@@ -478,8 +478,9 @@
#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_UNFOCUSSED "none"
#define DEF_TEXT_INSERT_WIDTH "2"
-#define DEF_TEXT_MAX_UNDO "0"
+#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
@@ -498,8 +499,8 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TABSTYLE "tabular"
-#define DEF_TEXT_TAKE_FOCUS (char *) NULL
-#define DEF_TEXT_UNDO "0"
+#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 ""
@@ -521,4 +522,10 @@
#define DEF_TOPLEVEL_SCREEN ""
#define DEF_TOPLEVEL_USE ""
+/*
+ * Defaults for busy windows:
+ */
+
+#define DEF_BUSY_CURSOR "watch"
+
#endif /* _TKUNIXDEFAULT */
diff --git a/unix/tkUnixDialog.c b/unix/tkUnixDialog.c
index 2b86ca6..afe443f 100644
--- a/unix/tkUnixDialog.c
+++ b/unix/tkUnixDialog.c
@@ -39,21 +39,21 @@ EvalObjv(
Tcl_Interp *interp, /* Current interpreter. */
char *cmdName, /* Name of the TCL command to call */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Arguments. */
+ Tcl_Obj *const *objv) /* Arguments. */
{
Tcl_Obj *cmdObj, **objs;
int result;
cmdObj = Tcl_NewStringObj(cmdName, -1);
Tcl_IncrRefCount(cmdObj);
- objs = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj*) * (unsigned)(objc+1));
+ objs = ckalloc(sizeof(Tcl_Obj *) * (objc+1));
objs[0] = cmdObj;
memcpy(objs+1, objv, sizeof(Tcl_Obj *) * (unsigned)objc);
result = Tcl_EvalObjv(interp, objc+1, objs, 0);
Tcl_DecrRefCount(cmdObj);
- ckfree((char *) objs);
+ ckfree(objs);
return result;
}
@@ -82,7 +82,7 @@ Tk_ChooseColorObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Arguments. */
+ Tcl_Obj *const *objv) /* Arguments. */
{
return EvalObjv(interp, "tk::ColorDialog", objc-1, objv+1);
}
@@ -111,9 +111,9 @@ Tk_GetOpenFileObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Arguments. */
+ Tcl_Obj *const *objv) /* Arguments. */
{
- Tk_Window tkwin = (Tk_Window)clientData;
+ Tk_Window tkwin = clientData;
if (Tk_StrictMotif(tkwin)) {
return EvalObjv(interp, "tk::MotifOpenFDialog", objc-1, objv+1);
@@ -143,9 +143,9 @@ Tk_GetSaveFileObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Arguments. */
+ Tcl_Obj *const *objv) /* Arguments. */
{
- Tk_Window tkwin = (Tk_Window)clientData;
+ Tk_Window tkwin = clientData;
if (Tk_StrictMotif(tkwin)) {
return EvalObjv(interp, "tk::MotifSaveFDialog", objc-1, objv+1);
@@ -177,7 +177,7 @@ Tk_MessageBoxCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST *objv) /* Arguments. */
+ Tcl_Obj *const *objv) /* Arguments. */
{
return EvalObjv(interp, "tk::MessageBox", objc-1, objv+1);
}
diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c
index c0d4d7f..55f7464 100644
--- a/unix/tkUnixDraw.c
+++ b/unix/tkUnixDraw.c
@@ -32,7 +32,7 @@ typedef struct ScrollInfo {
* Forward declarations for functions declared later in this file:
*/
-static Tk_RestrictAction ScrollRestrictProc(ClientData arg, XEvent *eventPtr);
+static Tk_RestrictProc ScrollRestrictProc;
/*
*----------------------------------------------------------------------
@@ -63,8 +63,8 @@ TkScrollWindow(
int dx, int dy, /* Distance rectangle should be moved. */
TkRegion damageRgn) /* Region to accumulate damage in. */
{
- Tk_RestrictProc *oldProc;
- ClientData oldArg, dummy;
+ Tk_RestrictProc *prevProc;
+ ClientData prevArg;
ScrollInfo info;
XCopyArea(Tk_Display(tkwin), Tk_WindowId(tkwin), Tk_WindowId(tkwin), gc,
@@ -84,12 +84,11 @@ TkScrollWindow(
*/
TkpSync(info.display);
- oldProc = Tk_RestrictEvents(ScrollRestrictProc, (ClientData) &info,
- &oldArg);
+ prevProc = Tk_RestrictEvents(ScrollRestrictProc, &info, &prevArg);
while (!info.done) {
Tcl_ServiceEvent(TCL_WINDOW_EVENTS);
}
- Tk_RestrictEvents(oldProc, oldArg, &dummy);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
if (XEmptyRegion((Region) damageRgn)) {
return 0;
diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c
index 5b5f486..bd5c512 100644
--- a/unix/tkUnixEmbed.c
+++ b/unix/tkUnixEmbed.c
@@ -4,7 +4,7 @@
* This file contains platform-specific functions for UNIX to provide
* basic operations needed for application embedding (where one
* application can use as its main window an internal window from some
- * other application).
+ * other application). Also includes code to support busy windows.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
*
@@ -13,6 +13,7 @@
*/
#include "tkUnixInt.h"
+#include "tkBusy.h"
/*
* One of the following structures exists for each container in this
@@ -95,7 +96,7 @@ TkpUseWindow(
* 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
+ const char *string) /* String identifying an X window to use for
* tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -136,7 +137,7 @@ TkpUseWindow(
anyError = 0;
handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- EmbedErrorProc, (ClientData) &anyError);
+ EmbedErrorProc, &anyError);
if (!XGetWindowAttributes(winPtr->display, parent, &parentAtts)) {
anyError = 1;
}
@@ -158,7 +159,7 @@ TkpUseWindow(
*/
Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbeddedEventProc,
- (ClientData) winPtr);
+ winPtr);
/*
* Save information about the container and the embedded window in a
@@ -176,7 +177,7 @@ TkpUseWindow(
}
}
if (containerPtr == NULL) {
- containerPtr = (Container *) ckalloc(sizeof(Container));
+ containerPtr = ckalloc(sizeof(Container));
containerPtr->parent = parent;
containerPtr->parentRoot = parentAtts.root;
containerPtr->parentPtr = NULL;
@@ -279,7 +280,7 @@ TkpMakeContainer(
*/
Tk_MakeWindowExist(tkwin);
- containerPtr = (Container *) ckalloc(sizeof(Container));
+ containerPtr = ckalloc(sizeof(Container));
containerPtr->parent = Tk_WindowId(tkwin);
containerPtr->parentRoot = RootWindowOfScreen(Tk_Screen(tkwin));
containerPtr->parentPtr = winPtr;
@@ -300,11 +301,11 @@ TkpMakeContainer(
XSelectInput(winPtr->display, winPtr->window, winPtr->atts.event_mask);
Tk_CreateEventHandler(tkwin,
SubstructureNotifyMask|SubstructureRedirectMask,
- ContainerEventProc, (ClientData) winPtr);
+ ContainerEventProc, winPtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbedStructureProc,
- (ClientData) containerPtr);
+ containerPtr);
Tk_CreateEventHandler(tkwin, FocusChangeMask, EmbedFocusProc,
- (ClientData) containerPtr);
+ containerPtr);
}
/*
@@ -405,7 +406,7 @@ ContainerEventProc(
*/
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
- -1, -1, NULL, (ClientData) NULL);
+ -1, -1, NULL, NULL);
/*
* Find the Container structure associated with the parent window.
@@ -508,7 +509,7 @@ EmbedStructureProc(
*/
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
- -1, -1, NULL, (ClientData) NULL);
+ -1, -1, NULL, NULL);
XMoveResizeWindow(eventPtr->xconfigure.display,
containerPtr->wrapper, 0, 0,
(unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr),
@@ -559,7 +560,7 @@ EmbedFocusProc(
if (containerPtr->wrapper != None) {
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
- -1, -1, NULL, (ClientData) NULL);
+ -1, -1, NULL, NULL);
XSetInputFocus(display, containerPtr->wrapper, RevertToParent,
CurrentTime);
Tk_DeleteErrorHandler(errHandler);
@@ -865,7 +866,7 @@ TkpTestembedCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
int all;
Container *containerPtr;
@@ -972,7 +973,7 @@ EmbedWindowDeleted(
} else {
prevPtr->nextPtr = containerPtr->nextPtr;
}
- ckfree((char *) containerPtr);
+ ckfree(containerPtr);
}
}
@@ -1013,6 +1014,176 @@ TkUnixContainerId(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * TkpShowBusyWindow --
+ *
+ * Makes a busy window "appear".
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Arranges for the busy window to start intercepting events and the
+ * cursor to change to the configured "hey, I'm busy!" setting.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpShowBusyWindow(
+ TkBusy busy)
+{
+ Busy *busyPtr = (Busy *) busy;
+
+ if (busyPtr->tkBusy != NULL) {
+ Tk_MapWindow(busyPtr->tkBusy);
+
+ /*
+ * Always raise the busy window just in case new sibling windows have
+ * been created in the meantime. Can't use Tk_RestackWindow because it
+ * doesn't work under Win32.
+ */
+
+ XRaiseWindow(Tk_Display(busyPtr->tkBusy),
+ Tk_WindowId(busyPtr->tkBusy));
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpHideBusyWindow --
+ *
+ * Makes a busy window "disappear".
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Arranges for the busy window to stop intercepting events, and the
+ * cursor to change back to its normal setting.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpHideBusyWindow(
+ TkBusy busy)
+{
+ Busy *busyPtr = (Busy *) busy;
+
+ if (busyPtr->tkBusy != NULL) {
+ Tk_UnmapWindow(busyPtr->tkBusy);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMakeTransparentWindowExist --
+ *
+ * Construct the platform-specific resources for a transparent window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Moves the specified window in the stacking order.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMakeTransparentWindowExist(
+ Tk_Window tkwin, /* Token for window. */
+ Window parent) /* Parent window. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ long int mask = CWDontPropagate | CWEventMask;
+
+ /*
+ * Ignore the important events while the window is mapped.
+ */
+
+#define USER_EVENTS \
+ (EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask | \
+ ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
+#define PROP_EVENTS \
+ (KeyPressMask | KeyReleaseMask | ButtonPressMask | \
+ ButtonReleaseMask | PointerMotionMask)
+
+ winPtr->atts.do_not_propagate_mask = PROP_EVENTS;
+ winPtr->atts.event_mask = USER_EVENTS;
+ winPtr->changes.border_width = 0;
+ winPtr->depth = 0;
+
+ winPtr->window = XCreateWindow(winPtr->display, parent,
+ winPtr->changes.x, winPtr->changes.y,
+ (unsigned) winPtr->changes.width, /* width */
+ (unsigned) winPtr->changes.height, /* height */
+ (unsigned) winPtr->changes.border_width, /* border_width */
+ winPtr->depth, InputOnly, winPtr->visual, mask, &winPtr->atts);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateBusy --
+ *
+ * Construct the platform-specific parts of a busy window. Note that this
+ * postpones the actual creation of the window resource until later. The
+ * GetParent() function is a helper for this.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets up part of the busy window structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static inline Window
+GetParent(
+ Display *display,
+ Window window)
+{
+ Window root, parent;
+ Window *dummy;
+ unsigned int count;
+
+ if (XQueryTree(display, window, &root, &parent, &dummy, &count) > 0) {
+ XFree(dummy);
+ return parent;
+ }
+ return None;
+}
+
+void
+TkpCreateBusy(
+ Tk_FakeWin *winPtr,
+ Tk_Window tkRef,
+ Window *parentPtr,
+ Tk_Window tkParent,
+ TkBusy busy)
+{
+ if (winPtr->flags & TK_REPARENTED) {
+ /*
+ * This works around a bug in the implementation of menubars for
+ * non-MacIntosh window systems (Win32 and X11). Tk doesn't reset the
+ * pointers to the parent window when the menu is reparented (since
+ * winPtr->parentPtr points to the wrong window). We get around this
+ * by determining the parent via the native API calls.
+ */
+
+ *parentPtr = GetParent(Tk_Display(tkRef), Tk_WindowId(tkRef));
+ } else {
+ *parentPtr = Tk_WindowId(tkParent);
+ }
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 09dde72..0987129 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -113,7 +113,7 @@ DisplayExitHandler(
TkDisplay *
TkpOpenDisplay(
- CONST char *displayNameStr)
+ const char *displayNameStr)
{
TkDisplay *dispPtr;
Display *display = XOpenDisplay(displayNameStr);
@@ -121,14 +121,14 @@ TkpOpenDisplay(
if (display == NULL) {
return NULL;
}
- dispPtr = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ dispPtr = 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);
+ DisplayFileProc, dispPtr);
return dispPtr;
}
@@ -154,8 +154,6 @@ TkpCloseDisplay(
{
TkSendCleanup(dispPtr);
- TkFreeXId(dispPtr);
-
TkWmCleanup(dispPtr);
#ifdef TK_USE_INPUT_METHODS
@@ -204,7 +202,7 @@ TkClipCleanup(
dispPtr->windowAtom);
Tk_DestroyWindow(dispPtr->clipWindow);
- Tcl_Release((ClientData) dispPtr->clipWindow);
+ Tcl_Release(dispPtr->clipWindow);
dispPtr->clipWindow = NULL;
}
}
@@ -280,6 +278,9 @@ TransferXEventsToTcl(
int type;
XEvent x;
TkKeyEvent k;
+#ifdef GenericEvent
+ xGenericEvent xge;
+#endif
} event;
Window w;
TkDisplay *dispPtr = NULL;
@@ -297,6 +298,12 @@ TransferXEventsToTcl(
while (QLength(display) > 0) {
XNextEvent(display, &event.x);
+#ifdef GenericEvent
+ if (event.type == GenericEvent) {
+ Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
+ event.xge.extension, event.xge.evtype);
+ }
+#endif
w = None;
if (event.type == KeyPress || event.type == KeyRelease) {
for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {
@@ -545,7 +552,7 @@ TkUnixDoOneXEvent(
index = fd/(NBBY*sizeof(fd_mask));
bit = ((fd_mask)1) << (fd%(NBBY*sizeof(fd_mask)));
if ((readMask[index] & bit) || (QLength(dispPtr->display) > 0)) {
- DisplayFileProc((ClientData)dispPtr, TCL_READABLE);
+ DisplayFileProc(dispPtr, TCL_READABLE);
}
}
if (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {
@@ -688,6 +695,22 @@ error:
}
#endif /* TK_USE_INPUT_METHODS */
+void
+TkpWarpPointer(
+ TkDisplay *dispPtr)
+{
+ Window w; /* Which window to warp relative to. */
+
+ if (dispPtr->warpWindow != NULL) {
+ w = Tk_WindowId(dispPtr->warpWindow);
+ } else {
+ w = RootWindow(dispPtr->display,
+ Tk_ScreenNumber(dispPtr->warpMainwin));
+ }
+ XWarpPointer(dispPtr->display, None, w, 0, 0, 0, 0,
+ (int) dispPtr->warpX, (int) dispPtr->warpY);
+}
+
/*
* Local Variables:
* mode: c
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 897770b..136d69f 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -19,7 +19,7 @@
* The preferred font encodings.
*/
-static CONST char *encodingList[] = {
+static const char *const encodingList[] = {
"iso8859-1", "jis0208", "jis0212", NULL
};
@@ -137,9 +137,9 @@ typedef struct UnixFont {
*/
typedef struct EncodingAlias {
- char *realName; /* The real name of the encoding to load if
+ const char *realName; /* The real name of the encoding to load if
* the provided name matched the pattern. */
- char *aliasPattern; /* Pattern for encoding name, of the form that
+ const char *aliasPattern; /* Pattern for encoding name, of the form that
* is acceptable to Tcl_StringMatch. */
} EncodingAlias;
@@ -205,31 +205,31 @@ static void FontPkgCleanup(ClientData clientData);
static FontFamily * AllocFontFamily(Display *display,
XFontStruct *fontStructPtr, int base);
static SubFont * CanUseFallback(UnixFont *fontPtr,
- CONST char *fallbackName, int ch,
+ const char *fallbackName, int ch,
SubFont **fixSubFontPtrPtr);
static SubFont * CanUseFallbackWithAliases(UnixFont *fontPtr,
- char *fallbackName, int ch,
+ const char *fallbackName, int ch,
Tcl_DString *nameTriedPtr,
SubFont **fixSubFontPtrPtr);
-static int ControlUtfProc(ClientData clientData, CONST char *src,
+static int ControlUtfProc(ClientData clientData, const char *src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
static XFontStruct * CreateClosestFont(Tk_Window tkwin,
- CONST TkFontAttributes *faPtr,
- CONST TkXLFDAttributes *xaPtr);
+ const TkFontAttributes *faPtr,
+ const TkXLFDAttributes *xaPtr);
static SubFont * FindSubFontForChar(UnixFont *fontPtr, int ch,
SubFont **fixSubFontPtrPtr);
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 *afPtr);
-static CONST char * GetEncodingAlias(CONST char *name);
+static const char * GetEncodingAlias(const char *name);
static int GetFontAttributes(Display *display,
XFontStruct *fontStructPtr, FontAttributes *faPtr);
static XFontStruct * GetScreenFont(Display *display,
FontAttributes *wantPtr, char **nameList,
- int bestIdx[], unsigned int bestScore[]);
+ int bestIdx[], unsigned bestScore[]);
static XFontStruct * GetSystemFont(Display *display);
static int IdentifySymbolEncodings(FontAttributes *faPtr);
static void InitFont(Tk_Window tkwin, XFontStruct *fontStructPtr,
@@ -237,21 +237,21 @@ static void InitFont(Tk_Window tkwin, XFontStruct *fontStructPtr,
static void InitSubFont(Display *display,
XFontStruct *fontStructPtr, int base,
SubFont *subFontPtr);
-static char ** ListFonts(Display *display, CONST char *faceName,
+static char ** ListFonts(Display *display, const char *faceName,
int *numNamesPtr);
-static char ** ListFontOrAlias(Display *display, CONST char*faceName,
+static char ** ListFontOrAlias(Display *display, const char*faceName,
int *numNamesPtr);
-static unsigned int RankAttributes(FontAttributes *wantPtr,
+static unsigned RankAttributes(FontAttributes *wantPtr,
FontAttributes *gotPtr);
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
-static int SeenName(CONST char *name, Tcl_DString *dsPtr);
+static int SeenName(const char *name, Tcl_DString *dsPtr);
#ifndef WORDS_BIGENDIAN
-static int Ucs2beToUtfProc(ClientData clientData, CONST char*src,
+static int Ucs2beToUtfProc(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(ClientData clientData, CONST char*src,
+static int UtfToUcs2beProc(ClientData clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -279,7 +279,7 @@ static void
FontPkgCleanup(
ClientData clientData)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->controlFamily.encoding != NULL) {
@@ -318,7 +318,7 @@ void
TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_EncodingType type;
SubFont dummy;
@@ -380,7 +380,7 @@ TkpFontPkgInit(
static int
ControlUtfProc(
ClientData clientData, /* Not used. */
- CONST char *src, /* Source string in UTF-8. */
+ 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
@@ -404,7 +404,7 @@ ControlUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
- CONST char *srcStart, *srcEnd;
+ const char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
Tcl_UniChar ch;
int result;
@@ -473,7 +473,7 @@ ControlUtfProc(
static int
Ucs2beToUtfProc(
ClientData clientData, /* Not used. */
- CONST char *src, /* Source string in Unicode. */
+ 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
@@ -497,7 +497,7 @@ Ucs2beToUtfProc(
* correspond to the bytes stored in the
* output buffer. */
{
- CONST char *srcStart, *srcEnd;
+ const char *srcStart, *srcEnd;
char *dstEnd, *dstStart;
int result, numChars;
@@ -556,7 +556,7 @@ static int
UtfToUcs2beProc(
ClientData clientData, /* TableEncodingData that specifies
* encoding. */
- CONST char *src, /* Source string in UTF-8. */
+ 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
@@ -580,7 +580,7 @@ UtfToUcs2beProc(
* correspond to the bytes stored in the
* output buffer. */
{
- CONST char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
+ const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
Tcl_UniChar ch;
@@ -656,12 +656,12 @@ UtfToUcs2beProc(
TkFont *
TkpGetNativeFont(
Tk_Window tkwin, /* For display where font will be used. */
- CONST char *name) /* Platform-specific font name. */
+ const char *name) /* Platform-specific font name. */
{
UnixFont *fontPtr;
XFontStruct *fontStructPtr;
FontAttributes fa;
- CONST char *p;
+ const char *p;
int hasSpace, dashes, hasWild;
/*
@@ -719,7 +719,7 @@ TkpGetNativeFont(
}
fontStructPtr = CreateClosestFont(tkwin, &fa.fa, &fa.xa);
}
- fontPtr = (UnixFont *) ckalloc(sizeof(UnixFont));
+ fontPtr = ckalloc(sizeof(UnixFont));
InitFont(tkwin, fontStructPtr, fontPtr);
return (TkFont *) fontPtr;
@@ -763,7 +763,7 @@ TkpGetFontFromAttributes(
* will be released. If NULL, a new TkFont
* structure is allocated. */
Tk_Window tkwin, /* For display where font will be used. */
- CONST TkFontAttributes *faPtr)
+ const TkFontAttributes *faPtr)
/* Set of attributes to match. */
{
UnixFont *fontPtr;
@@ -775,7 +775,7 @@ TkpGetFontFromAttributes(
fontPtr = (UnixFont *) tkFontPtr;
if (fontPtr == NULL) {
- fontPtr = (UnixFont *) ckalloc(sizeof(UnixFont));
+ fontPtr = ckalloc(sizeof(UnixFont));
} else {
ReleaseFont(fontPtr);
}
@@ -845,8 +845,6 @@ TkpGetFontFamilies(
Tcl_HashSearch search;
Tcl_Obj *resultPtr, *strPtr;
- resultPtr = Tcl_GetObjResult(interp);
-
Tcl_InitHashTable(&familyTable, TCL_STRING_KEYS);
nameList = ListFonts(Tk_Display(tkwin), "*", &numNames);
for (i = 0; i < numNames; i++) {
@@ -874,11 +872,13 @@ TkpGetFontFamilies(
XFreeFontNames(nameList);
hPtr = Tcl_FirstHashEntry(&familyTable, &search);
+ resultPtr = Tcl_NewObj();
while (hPtr != NULL) {
strPtr = Tcl_NewStringObj(Tcl_GetHashKey(&familyTable, hPtr), -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
hPtr = Tcl_NextHashEntry(&search);
}
+ Tcl_SetObjResult(interp, resultPtr);
Tcl_DeleteHashTable(&familyTable);
}
@@ -911,7 +911,7 @@ TkpGetSubFonts(
UnixFont *fontPtr;
FontFamily *familyPtr;
- resultPtr = Tcl_GetObjResult(interp);
+ resultPtr = Tcl_NewObj();
fontPtr = (UnixFont *) tkfont;
for (i = 0; i < fontPtr->numSubFonts; i++) {
familyPtr = fontPtr->subFontArray[i].familyPtr;
@@ -922,6 +922,7 @@ TkpGetSubFonts(
listPtr = Tcl_NewListObj(3, objv);
Tcl_ListObjAppendElement(NULL, resultPtr, listPtr);
}
+ Tcl_SetObjResult(interp, resultPtr);
}
/*
@@ -958,6 +959,7 @@ TkpGetFontAttrsForChar(
SubFont *thisSubFontPtr = FindSubFontForChar(fontPtr, c, &lastSubFontPtr);
/* Pointer to the subfont to use for the given
* character */
+
GetFontAttributes(Tk_Display(tkwin), thisSubFontPtr->fontStructPtr, &atts);
*faPtr = atts.fa;
}
@@ -986,7 +988,7 @@ TkpGetFontAttrsForChar(
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
+ 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. */
@@ -1025,7 +1027,7 @@ Tk_MeasureChars(
curX = 0;
curByte = 0;
} else if (maxLength < 0) {
- CONST char *p, *end, *next;
+ const char *p, *end, *next;
Tcl_UniChar ch;
SubFont *thisSubFontPtr;
FontFamily *familyPtr;
@@ -1078,11 +1080,11 @@ Tk_MeasureChars(
Tcl_DStringFree(&runString);
curByte = numBytes;
} else {
- CONST char *p, *end, *next, *term;
+ const char *p, *end, *next, *term;
int newX, termX, sawNonSpace, dstWrote;
Tcl_UniChar ch;
FontFamily *familyPtr;
- char buf[16];
+ XChar2b buf[8];
/*
* How many chars will fit in the space allotted? This first version
@@ -1104,14 +1106,14 @@ Tk_MeasureChars(
} else {
lastSubFontPtr = FindSubFontForChar(fontPtr, ch, NULL);
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, next - p, 0, NULL,
+ (char *)&buf[0].byte1, sizeof(buf), NULL, &dstWrote, NULL);
if (familyPtr->isTwoByteFont) {
newX += XTextWidth16(lastSubFontPtr->fontStructPtr,
- (XChar2b *) buf, dstWrote >> 1);
+ buf, dstWrote >> 1);
} else {
- newX += XTextWidth(lastSubFontPtr->fontStructPtr, buf,
- dstWrote);
+ newX += XTextWidth(lastSubFontPtr->fontStructPtr,
+ (char *)&buf[0].byte1, dstWrote);
}
}
if (newX > maxLength) {
@@ -1200,7 +1202,7 @@ Tk_MeasureChars(
int
TkpMeasureCharsInContext(
Tk_Font tkfont, /* Font in which characters will be drawn. */
- CONST char *source, /* UTF-8 string to be displayed. Need not be
+ 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 in all. */
@@ -1253,7 +1255,7 @@ Tk_DrawChars(
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
+ 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
@@ -1264,22 +1266,20 @@ Tk_DrawChars(
int x, int y) /* Coordinates at which to place origin of
* string when drawing. */
{
- UnixFont *fontPtr;
+ UnixFont *fontPtr = (UnixFont *) tkfont;
SubFont *thisSubFontPtr, *lastSubFontPtr;
Tcl_DString runString;
- CONST char *p, *end, *next;
+ const char *p, *end, *next;
int xStart, needWidth, window_width, do_width;
Tcl_UniChar ch;
FontFamily *familyPtr;
#ifdef TK_DRAW_CHAR_XWINDOW_CHECK
int rx, ry;
- unsigned int width, height, border_width, depth;
+ unsigned width, height, border_width, depth;
Drawable root;
#endif
- fontPtr = (UnixFont *) tkfont;
lastSubFontPtr = &fontPtr->subFontArray[0];
-
xStart = x;
#ifdef TK_DRAW_CHAR_XWINDOW_CHECK
@@ -1392,7 +1392,7 @@ TkpDrawCharsInContext(
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
+ 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
@@ -1441,9 +1441,9 @@ TkpDrawCharsInContext(
static XFontStruct *
CreateClosestFont(
Tk_Window tkwin, /* For display where font will be used. */
- CONST TkFontAttributes *faPtr,
+ const TkFontAttributes *faPtr,
/* Set of generic attributes to match. */
- CONST TkXLFDAttributes *xaPtr)
+ const TkXLFDAttributes *xaPtr)
/* Set of X-specific attributes to match. */
{
FontAttributes want;
@@ -1451,7 +1451,7 @@ CreateClosestFont(
int numNames, nameIdx, bestIdx[2];
Display *display;
XFontStruct *fontStructPtr;
- unsigned int bestScore[2];
+ unsigned bestScore[2];
want.fa = *faPtr;
want.xa = *xaPtr;
@@ -1481,9 +1481,9 @@ CreateClosestFont(
nameList = ListFontOrAlias(display, want.fa.family, &numNames);
if (numNames == 0) {
- char ***fontFallbacks;
+ const char *const *const *fontFallbacks;
int i, j;
- char *fallback;
+ const char *fallback;
fontFallbacks = TkFontGetFallbacks();
for (i = 0; fontFallbacks[i] != NULL; i++) {
@@ -1513,12 +1513,12 @@ CreateClosestFont(
found:
bestIdx[0] = -1;
bestIdx[1] = -1;
- bestScore[0] = (unsigned int) -1;
- bestScore[1] = (unsigned int) -1;
+ bestScore[0] = (unsigned) -1;
+ bestScore[1] = (unsigned) -1;
for (nameIdx = 0; nameIdx < numNames; nameIdx++) {
FontAttributes got;
int scalable;
- unsigned int score;
+ unsigned score;
if (TkFontParseXLFD(nameList[nameIdx], &got.fa, &got.xa) != TCL_OK) {
continue;
@@ -1574,7 +1574,7 @@ InitFont(
UnixFont *fontPtr) /* Filled with information constructed from
* the above arguments. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
unsigned long value;
int minHi, maxHi, minLo, maxLo, fixed, width, limit, i, n;
@@ -1727,7 +1727,7 @@ ReleaseFont(
ReleaseSubFont(fontPtr->display, &fontPtr->subFontArray[i]);
}
if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
- ckfree((char *) fontPtr->subFontArray);
+ ckfree(fontPtr->subFontArray);
}
}
@@ -1827,7 +1827,7 @@ AllocFontFamily(
FontFamily *familyPtr;
FontAttributes fa;
Tcl_Encoding encoding;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
GetFontAttributes(display, fontStructPtr, &fa);
@@ -1844,7 +1844,7 @@ AllocFontFamily(
}
}
- familyPtr = (FontFamily *) ckalloc(sizeof(FontFamily));
+ familyPtr = ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -1901,7 +1901,7 @@ FreeFontFamily(
FontFamily *familyPtr) /* The FontFamily to delete. */
{
FontFamily **familyPtrPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int i;
@@ -1931,7 +1931,7 @@ FreeFontFamily(
familyPtrPtr = &(*familyPtrPtr)->nextPtr;
}
- ckfree((char *) familyPtr);
+ ckfree(familyPtr);
}
/*
@@ -1967,7 +1967,11 @@ FindSubFontForChar(
{
int i, j, k, numNames;
Tk_Uid faceName;
- char *fallback, **aliases, **nameList, **anyFallbacks, ***fontFallbacks;
+ const char *fallback;
+ const char *const *aliases;
+ char **nameList;
+ const char *const *anyFallbacks;
+ const char *const *const *fontFallbacks;
SubFont *subFontPtr;
Tcl_DString ds;
@@ -2204,10 +2208,10 @@ FontMapLoadPage(
Tcl_Encoding encoding;
XFontStruct *fontStructPtr;
XCharStruct *widths;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- subFontPtr->fontMap[row] = (char *) ckalloc(FONTMAP_BITSPERPAGE / 8);
+ subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
if (subFontPtr->familyPtr == &tsdPtr->controlFamily) {
@@ -2285,7 +2289,7 @@ static SubFont *
CanUseFallbackWithAliases(
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. */
Tcl_DString *nameTriedPtr, /* Records face names that have already been
@@ -2296,7 +2300,7 @@ CanUseFallbackWithAliases(
* reallocate our subfont table. */
{
SubFont *subFontPtr;
- char **aliases;
+ const char *const *aliases;
int i;
if (SeenName(faceName, nameTriedPtr) == 0) {
@@ -2341,11 +2345,11 @@ CanUseFallbackWithAliases(
static int
SeenName(
- CONST char *name, /* The name to check. */
+ const char *name, /* The name to check. */
Tcl_DString *dsPtr) /* Contains names that have already been
* seen. */
{
- CONST char *seen, *end;
+ const char *seen, *end;
seen = Tcl_DStringValue(dsPtr);
end = seen + Tcl_DStringLength(dsPtr);
@@ -2355,7 +2359,7 @@ SeenName(
}
seen += strlen(seen) + 1;
}
- Tcl_DStringAppend(dsPtr, (char *) name, (int) (strlen(name) + 1));
+ Tcl_DStringAppend(dsPtr, name, (int) (strlen(name) + 1));
return 0;
}
@@ -2390,7 +2394,7 @@ static SubFont *
CanUseFallback(
UnixFont *fontPtr, /* The font object that will own the new
* screen font. */
- CONST 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. */
SubFont **fixSubFontPtrPtr) /* Subfont reference to fix up if we
@@ -2398,9 +2402,11 @@ CanUseFallback(
{
int i, nameIdx, numNames, srcLen, numEncodings, bestIdx[2];
Tk_Uid hateFoundry;
- CONST char *charset, *hateCharset;
- unsigned int bestScore[2];
- char **nameList, **nameListOrig, src[TCL_UTF_MAX];
+ const char *charset, *hateCharset;
+ unsigned bestScore[2];
+ char **nameList;
+ char **nameListOrig;
+ char src[TCL_UTF_MAX];
FontAttributes want, got;
Display *display;
SubFont subFont;
@@ -2448,13 +2454,13 @@ CanUseFallback(
retry:
bestIdx[0] = -1;
bestIdx[1] = -1;
- bestScore[0] = (unsigned int) -1;
- bestScore[1] = (unsigned int) -1;
+ bestScore[0] = (unsigned) -1;
+ bestScore[1] = (unsigned) -1;
for (nameIdx = 0; nameIdx < numNames; nameIdx++) {
Tcl_Encoding encoding;
char dst[16];
int scalable, srcRead, dstWrote;
- unsigned int score;
+ unsigned score;
if (nameList[nameIdx] == NULL) {
continue;
@@ -2537,7 +2543,7 @@ CanUseFallback(
* make a copy.
*/
- nameList = (char **) ckalloc(numNames * sizeof(char *));
+ nameList = ckalloc(numNames * sizeof(char *));
memcpy(nameList, nameListOrig, numNames * sizeof(char *));
}
nameList[nameIdx] = NULL;
@@ -2555,7 +2561,7 @@ CanUseFallback(
if (fontStructPtr == NULL) {
if (nameList != nameListOrig) {
- ckfree((char *) nameList);
+ ckfree(nameList);
}
XFreeFontNames(nameListOrig);
return NULL;
@@ -2575,16 +2581,15 @@ CanUseFallback(
goto retry;
}
if (nameList != nameListOrig) {
- ckfree((char *) nameList);
+ ckfree(nameList);
}
XFreeFontNames(nameListOrig);
if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
SubFont *newPtr;
- newPtr = (SubFont *)
- ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
- memcpy((char *) newPtr, fontPtr->subFontArray,
+ newPtr = ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
+ memcpy(newPtr, fontPtr->subFontArray,
fontPtr->numSubFonts * sizeof(SubFont));
if (fixSubFontPtrPtr != NULL) {
register SubFont *fixSubFontPtr = *fixSubFontPtrPtr;
@@ -2595,7 +2600,7 @@ CanUseFallback(
}
}
if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
- ckfree((char *) fontPtr->subFontArray);
+ ckfree(fontPtr->subFontArray);
}
fontPtr->subFontArray = newPtr;
}
@@ -2622,12 +2627,12 @@ CanUseFallback(
*---------------------------------------------------------------------------
*/
-static unsigned int
+static unsigned
RankAttributes(
FontAttributes *wantPtr, /* The desired attributes. */
FontAttributes *gotPtr) /* The attributes we have to live with. */
{
- unsigned int penalty;
+ unsigned penalty;
penalty = 0;
if (gotPtr->xa.foundry != wantPtr->xa.foundry) {
@@ -2674,7 +2679,7 @@ RankAttributes(
}
if (gotPtr->xa.charset != wantPtr->xa.charset) {
int i;
- CONST char *gotAlias, *wantAlias;
+ const char *gotAlias, *wantAlias;
penalty += 65000;
gotAlias = GetEncodingAlias(gotPtr->xa.charset);
@@ -2719,7 +2724,7 @@ GetScreenFont(
char **nameList, /* Array of XLFDs. */
int bestIdx[2], /* Indices into above array for XLFD of best
* bitmapped and best scalable font. */
- unsigned int bestScore[2]) /* Scores of best bitmapped and best scalable
+ unsigned bestScore[2]) /* Scores of best bitmapped and best scalable
* font. XLFD corresponding to lowest score
* will be constructed. */
{
@@ -2888,7 +2893,7 @@ GetFontAttributes(
static char **
ListFonts(
Display *display, /* Display to query. */
- CONST char *faceName, /* Desired face name, or "*" for all. */
+ const char *faceName, /* Desired face name, or "*" for all. */
int *numNamesPtr) /* Filled with length of returned array, or 0
* if no names were found. */
{
@@ -2901,11 +2906,12 @@ ListFonts(
static char **
ListFontOrAlias(
Display *display, /* Display to query. */
- CONST char *faceName, /* Desired face name, or "*" for all. */
+ const char *faceName, /* Desired face name, or "*" for all. */
int *numNamesPtr) /* Filled with length of returned array, or 0
* if no names were found. */
{
- char **nameList, **aliases;
+ char **nameList;
+ const char *const *aliases;
int i;
nameList = ListFonts(display, faceName, numNamesPtr);
@@ -2954,7 +2960,8 @@ IdentifySymbolEncodings(
FontAttributes *faPtr)
{
int i, j;
- char **aliases, **symbolClass;
+ const char *const *aliases;
+ const char *const *symbolClass;
symbolClass = TkFontGetSymbolClass();
for (i = 0; symbolClass[i] != NULL; i++) {
@@ -2993,14 +3000,14 @@ IdentifySymbolEncodings(
*---------------------------------------------------------------------------
*/
-static CONST char *
+static const char *
GetEncodingAlias(
- CONST char *name) /* The name to look up. */
+ const char *name) /* The name to look up. */
{
EncodingAlias *aliasPtr;
for (aliasPtr = encodingAliases; aliasPtr->aliasPattern != NULL; ) {
- if (Tcl_StringMatch((char *) name, aliasPtr->aliasPattern)) {
+ if (Tcl_StringMatch(name, aliasPtr->aliasPattern)) {
return aliasPtr->realName;
}
aliasPtr++;
@@ -3009,6 +3016,305 @@ GetEncodingAlias(
}
/*
+ *---------------------------------------------------------------------------
+ *
+ * TkDrawAngledChars --
+ *
+ * Draw some characters at an angle. This is awkward here because we have
+ * no reliable way of drawing any characters at an angle in classic X11;
+ * we have to draw on a Pixmap which is converted to an XImage (from
+ * helper function GetImageOfText), rotate the image (hokey code!) onto
+ * another XImage (from helper function InitDestImage), and then use the
+ * rotated image as a mask when drawing. This is pretty awful; improved
+ * versions are welcomed!
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Target drawable is updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static inline XImage *
+GetImageOfText(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ Tk_Font tkfont, /* Font in which characters will be drawn. */
+ 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 *realWidthPtr, int *realHeightPtr)
+{
+ int width, height;
+ TkFont *fontPtr = (TkFont *) tkfont;
+ Pixmap bitmap;
+ GC bitmapGC;
+ XGCValues values;
+ XImage *image;
+
+ (void) Tk_MeasureChars(tkfont, source, numBytes, -1, 0, &width);
+ height = fontPtr->fm.ascent + fontPtr->fm.descent;
+
+ bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
+ values.graphics_exposures = False;
+ values.foreground = BlackPixel(display, DefaultScreen(display));
+ bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
+ &values);
+ XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
+
+ values.font = Tk_FontId(tkfont);
+ values.foreground = WhitePixel(display, DefaultScreen(display));
+ values.background = BlackPixel(display, DefaultScreen(display));
+ XChangeGC(display, bitmapGC, GCFont|GCForeground|GCBackground, &values);
+ Tk_DrawChars(display, bitmap, bitmapGC, tkfont, source, numBytes, 0,
+ fontPtr->fm.ascent);
+ XFreeGC(display, bitmapGC);
+
+ image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
+ ZPixmap);
+ Tk_FreePixmap(display, bitmap);
+
+ *realWidthPtr = width;
+ *realHeightPtr = height;
+ return image;
+}
+
+static inline XImage *
+InitDestImage(
+ Display *display,
+ Drawable drawable,
+ int width,
+ int height,
+ Pixmap *bitmapPtr)
+{
+ Pixmap bitmap;
+ XImage *image;
+ GC bitmapGC;
+ XGCValues values;
+
+ bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
+ values.graphics_exposures = False;
+ values.foreground = BlackPixel(display, DefaultScreen(display));
+ bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
+ &values);
+ XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
+ XFreeGC(display, bitmapGC);
+
+ image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
+ ZPixmap);
+ *bitmapPtr = bitmap;
+ return image;
+}
+
+void
+TkDrawAngledChars(
+ 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. */
+ double x, double y,
+ double angle)
+{
+ if (angle == 0.0) {
+ Tk_DrawChars(display, drawable, gc, tkfont, source, numBytes, x, y);
+ } else {
+ double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
+ int bufHeight, bufWidth, srcWidth, srcHeight, i, j, dx, dy;
+ Pixmap buf;
+ XImage *srcImage = GetImageOfText(display, drawable, tkfont, source,
+ numBytes, &srcWidth, &srcHeight);
+ XImage *dstImage;
+ enum {Q0=1,R1,Q1,R2,Q2,R3,Q3} quadrant;
+ GC bwgc, cpgc;
+ XGCValues values;
+ int ascent = ((TkFont *) tkfont)->fm.ascent;
+
+ /*
+ * First, work out what quadrant we are operating in. We also handle
+ * the rectilinear rotations as special cases. Conceptually, there's
+ * also R0 (angle == 0.0) but that has been already handled as a
+ * special case above.
+ *
+ * R1
+ * Q1 | Q0
+ * |
+ * R2 ----+---- R0
+ * |
+ * Q2 | Q3
+ * R3
+ */
+
+ if (angle < 90.0) {
+ quadrant = Q0;
+ } else if (angle == 90.0) {
+ quadrant = R1;
+ } else if (angle < 180.0) {
+ quadrant = Q1;
+ } else if (angle == 180.0) {
+ quadrant = R2;
+ } else if (angle < 270.0) {
+ quadrant = Q2;
+ } else if (angle == 270.0) {
+ quadrant = R3;
+ } else {
+ quadrant = Q3;
+ }
+
+ if (srcImage == NULL) {
+ return;
+ }
+ bufWidth = srcWidth*fabs(cosA) + srcHeight*fabs(sinA);
+ bufHeight = srcHeight*fabs(cosA) + srcWidth*fabs(sinA);
+ dstImage = InitDestImage(display, drawable, bufWidth,bufHeight, &buf);
+ if (dstImage == NULL) {
+ Tk_FreePixmap(display, buf);
+ XDestroyImage(srcImage);
+ return;
+ }
+
+ /*
+ * Do the rotation, setting or resetting pixels in the destination
+ * image dependent on whether the corresponding pixel (after rotation
+ * to source image space) is set.
+ */
+
+ for (i=0 ; i<srcWidth ; i++) {
+ for (j=0 ; j<srcHeight ; j++) {
+ switch (quadrant) {
+ case Q0:
+ dx = ROUND16(i*cosA + j*sinA);
+ dy = ROUND16(j*cosA + (srcWidth - i)*sinA);
+ break;
+ case R1:
+ dx = j;
+ dy = srcWidth - i;
+ break;
+ case Q1:
+ dx = ROUND16((i - srcWidth)*cosA + j*sinA);
+ dy = ROUND16((srcWidth-i)*sinA + (j-srcHeight)*cosA);
+ break;
+ case R2:
+ dx = srcWidth - i;
+ dy = srcHeight - j;
+ break;
+ case Q2:
+ dx = ROUND16((i-srcWidth)*cosA + (j-srcHeight)*sinA);
+ dy = ROUND16((j - srcHeight)*cosA - i*sinA);
+ break;
+ case R3:
+ dx = srcHeight - j;
+ dy = i;
+ break;
+ default:
+ dx = ROUND16(i*cosA + (j - srcHeight)*sinA);
+ dy = ROUND16(j*cosA - i*sinA);
+ }
+
+ if (dx < 0 || dy < 0 || dx >= bufWidth || dy >= bufHeight) {
+ continue;
+ }
+ XPutPixel(dstImage, dx, dy,
+ XGetPixel(dstImage,dx,dy) | XGetPixel(srcImage,i,j));
+ }
+ }
+ XDestroyImage(srcImage);
+
+ /*
+ * Schlep the data back to the Xserver.
+ */
+
+ values.function = GXcopy;
+ values.foreground = WhitePixel(display, DefaultScreen(display));
+ values.background = BlackPixel(display, DefaultScreen(display));
+ bwgc = XCreateGC(display, buf, GCFunction|GCForeground|GCBackground,
+ &values);
+ XPutImage(display, buf, bwgc, dstImage, 0,0, 0,0, bufWidth,bufHeight);
+ XFreeGC(display, bwgc);
+ XDestroyImage(dstImage);
+
+ /*
+ * Calculate where we want to draw the text.
+ */
+
+ switch (quadrant) {
+ case Q0:
+ dx = x;
+ dy = y - srcWidth*sinA;
+ break;
+ case R1:
+ dx = x;
+ dy = y - srcWidth;
+ break;
+ case Q1:
+ dx = x + srcWidth*cosA;
+ dy = y + srcHeight*cosA - srcWidth*sinA;
+ break;
+ case R2:
+ dx = x - srcWidth;
+ dy = y - srcHeight;
+ break;
+ case Q2:
+ dx = x + srcWidth*cosA + srcHeight*sinA;
+ dy = y + srcHeight*cosA;
+ break;
+ case R3:
+ dx = x - srcHeight;
+ dy = y;
+ break;
+ default:
+ dx = x + srcHeight*sinA;
+ dy = y;
+ }
+
+ /*
+ * Apply a correction to deal with the fact that we aren't told to
+ * draw from our top-left corner but rather from the left-end of our
+ * baseline.
+ */
+
+ dx -= ascent*sinA;
+ dy -= ascent*cosA;
+
+ /*
+ * Transfer the text to the screen. This is done by using it as a mask
+ * and then drawing through that mask with the original drawing color.
+ */
+
+ values.function = GXcopy;
+ values.fill_style = FillSolid;
+ values.clip_mask = buf;
+ values.clip_x_origin = dx;
+ values.clip_y_origin = dy;
+ cpgc = XCreateGC(display, drawable,
+ GCFunction|GCFillStyle|GCClipMask|GCClipXOrigin|GCClipYOrigin,
+ &values);
+ XCopyGC(display, gc, GCForeground, cpgc);
+ XFillRectangle(display, drawable, cpgc, dx, dy, bufWidth,
+ bufHeight);
+ XFreeGC(display, cpgc);
+
+ Tk_FreePixmap(display, buf);
+ return;
+ }
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c
index 1cc90a5..494c227 100644
--- a/unix/tkUnixInit.c
+++ b/unix/tkUnixInit.c
@@ -67,7 +67,7 @@ TkpGetAppName(
Tcl_Interp *interp,
Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */
{
- CONST char *p, *name;
+ const char *p, *name;
name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
if ((name == NULL) || (*name == 0)) {
@@ -100,10 +100,11 @@ TkpGetAppName(
void
TkpDisplayWarning(
- CONST char *msg, /* Message to be displayed. */
- CONST 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) {
Tcl_WriteChars(errChannel, title, -1);
Tcl_WriteChars(errChannel, ": ", 2);
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index 030e472..7461d75 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -22,7 +22,7 @@
* Tk_SetCaretPos --
*
* This enables correct placement of the XIM caret. This is called by
- * widgets to indicate their cursor placement. This is currently only
+ * widgets to indicate their cursor placement. This is currently only
* used for over-the-spot XIM.
*
*----------------------------------------------------------------------
@@ -38,11 +38,10 @@ Tk_SetCaretPos(
TkWindow *winPtr = (TkWindow *) tkwin;
TkDisplay *dispPtr = winPtr->dispPtr;
- if ( dispPtr->caret.winPtr == winPtr
- && dispPtr->caret.x == x
- && dispPtr->caret.y == y
- && dispPtr->caret.height == height)
- {
+ if ((dispPtr->caret.winPtr == winPtr)
+ && (dispPtr->caret.x == x)
+ && (dispPtr->caret.y == y)
+ && (dispPtr->caret.height == height)) {
return;
}
@@ -51,22 +50,21 @@ Tk_SetCaretPos(
dispPtr->caret.y = y;
dispPtr->caret.height = height;
-#ifdef TK_USE_INPUT_METHODS
/*
* Adjust the XIM caret position.
*/
- if ( (dispPtr->flags & TK_DISPLAY_USE_IM)
- && (dispPtr->inputStyle & XIMPreeditPosition)
- && (winPtr->inputContext != NULL) )
- {
+
+#ifdef TK_USE_INPUT_METHODS
+ if ((dispPtr->flags & TK_DISPLAY_USE_IM)
+ && (dispPtr->inputStyle & XIMPreeditPosition)
+ && (winPtr->inputContext != NULL)) {
XVaNestedList preedit_attr;
XPoint spot;
spot.x = dispPtr->caret.x;
spot.y = dispPtr->caret.y + dispPtr->caret.height;
preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, (void *) NULL);
- XSetICValues(winPtr->inputContext,
- XNPreeditAttributes, preedit_attr,
+ XSetICValues(winPtr->inputContext, XNPreeditAttributes, preedit_attr,
(void *) NULL);
XFree(preedit_attr);
}
@@ -91,7 +89,7 @@ Tk_SetCaretPos(
*----------------------------------------------------------------------
*/
-char *
+const char *
TkpGetString(
TkWindow *winPtr, /* Window where event occurred */
XEvent *eventPtr, /* X keyboard event. */
@@ -115,8 +113,7 @@ TkpGetString(
#ifdef TK_USE_INPUT_METHODS
if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
&& (winPtr->inputContext != NULL)
- && (eventPtr->type == KeyPress))
- {
+ && (eventPtr->type == KeyPress)) {
Status status;
#if X_HAVE_UTF8_STRING
@@ -125,10 +122,14 @@ TkpGetString(
Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),
&kePtr->keysym, &status);
- if (status == XBufferOverflow) { /* Expand buffer and try again */
+ if (status == XBufferOverflow) {
+ /*
+ * Expand buffer and try again.
+ */
+
Tcl_DStringSetLength(dsPtr, len);
len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey,
- Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),
+ Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),
&kePtr->keysym, &status);
}
if ((status != XLookupChars) && (status != XLookupBoth)) {
@@ -142,7 +143,6 @@ TkpGetString(
Tcl_DStringInit(&buf);
Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1);
-
len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey,
Tcl_DStringValue(&buf), Tcl_DStringLength(&buf),
&kePtr->keysym, &status);
@@ -159,7 +159,6 @@ TkpGetString(
if ((status != XLookupChars) && (status != XLookupBoth)) {
len = 0;
}
-
Tcl_DStringSetLength(&buf, len);
Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&buf), len, dsPtr);
Tcl_DStringFree(&buf);
@@ -203,7 +202,7 @@ TkpGetString(
* from having to reenter the XIM engine. [Bug 1373712]
*/
- kePtr->charValuePtr = ckalloc((unsigned) len + 1);
+ kePtr->charValuePtr = ckalloc(len + 1);
kePtr->charValueLen = len;
memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), (unsigned) len + 1);
return Tcl_DStringValue(dsPtr);
@@ -221,30 +220,27 @@ TkpSetKeycodeAndState(
KeySym keySym,
XEvent *eventPtr)
{
- Display *display;
+ Display *display = Tk_Display(tkwin);
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;
+ 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 = ((TkWindow *) tkwin)->dispPtr;
+
+ eventPtr->xkey.state |= dispPtr->modeModMask;
+ }
+ break;
}
- break;
}
}
}
@@ -420,7 +416,7 @@ TkpInitKeymapInfo(
dispPtr->metaModMask = 0;
dispPtr->altModMask = 0;
codePtr = modMapPtr->modifiermap;
- max = 8*modMapPtr->max_keypermod;
+ max = 8 * modMapPtr->max_keypermod;
for (i = 0; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -442,12 +438,11 @@ TkpInitKeymapInfo(
*/
if (dispPtr->modKeyCodes != NULL) {
- ckfree((char *) dispPtr->modKeyCodes);
+ ckfree(dispPtr->modKeyCodes);
}
dispPtr->numModKeyCodes = 0;
arraySize = KEYCODE_ARRAY_SIZE;
- dispPtr->modKeyCodes = (KeyCode *)
- ckalloc((unsigned) (KEYCODE_ARRAY_SIZE * sizeof(KeyCode)));
+ dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -459,23 +454,26 @@ TkpInitKeymapInfo(
for (j = 0; j < dispPtr->numModKeyCodes; j++) {
if (dispPtr->modKeyCodes[j] == *codePtr) {
+ /*
+ * 'continue' the outer loop.
+ */
+
goto nextModCode;
}
}
if (dispPtr->numModKeyCodes >= arraySize) {
- KeyCode *new;
+ KeyCode *newCodes;
/*
* Ran out of space in the array; grow it.
*/
arraySize *= 2;
- new = (KeyCode *)
- ckalloc((unsigned) (arraySize * sizeof(KeyCode)));
- memcpy(new, dispPtr->modKeyCodes,
- (dispPtr->numModKeyCodes * sizeof(KeyCode)));
- ckfree((char *) dispPtr->modKeyCodes);
- dispPtr->modKeyCodes = new;
+ newCodes = ckalloc(arraySize * sizeof(KeyCode));
+ memcpy(newCodes, dispPtr->modKeyCodes,
+ dispPtr->numModKeyCodes * sizeof(KeyCode));
+ ckfree(dispPtr->modKeyCodes);
+ dispPtr->modKeyCodes = newCodes;
}
dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr;
dispPtr->numModKeyCodes++;
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index eceb5b2..bc1bd2e 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -51,7 +51,7 @@ MODULE_SCOPE void TkpDrawCheckIndicator(Tk_Window tkwin,
static void SetHelpMenu(TkMenu *menuPtr);
static void DrawMenuEntryAccelerator(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
Tk_3DBorder activeBorder, int x, int y,
int width, int height, int drawArrow);
static void DrawMenuEntryBackground(TkMenu *menuPtr,
@@ -62,42 +62,42 @@ static void DrawMenuEntryIndicator(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d,
Tk_3DBorder border, XColor *indicatorColor,
XColor *disableColor, Tk_Font tkfont,
- CONST Tk_FontMetrics *fmPtr, int x, int y,
+ const Tk_FontMetrics *fmPtr, int x, int y,
int width, int height);
static void DrawMenuEntryLabel(TkMenu * menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
int x, int y, int width, int height);
static void DrawMenuSeparator(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
int x, int y, int width, int height);
static void DrawTearoffEntry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
int x, int y, int width, int height);
static void DrawMenuUnderline(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
int x, int y, int width, int height);
static void GetMenuAccelGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
- CONST Tk_FontMetrics *fmPtr, int *widthPtr,
+ const Tk_FontMetrics *fmPtr, int *widthPtr,
int *heightPtr);
static void GetMenuLabelGeometry(TkMenuEntry *mePtr,
- Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
int *widthPtr, int *heightPtr);
static void GetMenuIndicatorGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
- CONST Tk_FontMetrics *fmPtr,
+ const Tk_FontMetrics *fmPtr,
int *widthPtr, int *heightPtr);
static void GetMenuSeparatorGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
- CONST Tk_FontMetrics *fmPtr,
+ const Tk_FontMetrics *fmPtr,
int *widthPtr, int *heightPtr);
static void GetTearoffEntryGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
- CONST Tk_FontMetrics *fmPtr, int *widthPtr,
+ const Tk_FontMetrics *fmPtr, int *widthPtr,
int *heightPtr);
/*
@@ -294,7 +294,7 @@ void
TkpSetMainMenubar(
Tcl_Interp *interp,
Tk_Window tkwin,
- char *menuName)
+ const char *menuName)
{
/*
* Nothing to do.
@@ -324,10 +324,12 @@ GetMenuIndicatorGeometry(
TkMenu *menuPtr, /* The menu we are drawing. */
TkMenuEntry *mePtr, /* The entry we are interested in. */
Tk_Font tkfont, /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */
+ const Tk_FontMetrics *fmPtr,/* The precalculated metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
+ int borderWidth;
+
if ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY)) {
if (!mePtr->hideMargin && mePtr->indicatorOn) {
@@ -352,23 +354,18 @@ GetMenuIndicatorGeometry(
}
}
} else {
- int borderWidth;
-
- Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
- menuPtr->borderWidthPtr, &borderWidth);
+ Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
+ &borderWidth);
*heightPtr = 0;
*widthPtr = borderWidth;
}
} else {
- int borderWidth;
-
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
&borderWidth);
- *heightPtr = 0;
- *widthPtr = borderWidth;
+ *heightPtr = 0;
+ *widthPtr = borderWidth;
}
}
-
/*
*----------------------------------------------------------------------
@@ -391,18 +388,17 @@ GetMenuAccelGeometry(
TkMenu *menuPtr, /* The menu was are drawing */
TkMenuEntry *mePtr, /* The entry we are getting the geometry for */
Tk_Font tkfont, /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
+ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int *widthPtr, /* The width of the acclerator area */
int *heightPtr) /* The height of the accelerator area */
{
*heightPtr = fmPtr->linespace;
if (mePtr->type == CASCADE_ENTRY) {
*widthPtr = 2 * CASCADE_ARROW_WIDTH;
- } else if ((menuPtr->menuType != MENUBAR)
- && (mePtr->accelPtr != NULL)) {
- char *accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
+ } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) {
+ const char *accel = Tcl_GetString(mePtr->accelPtr);
- *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
} else {
*widthPtr = 0;
}
@@ -483,7 +479,7 @@ DrawMenuEntryAccelerator(
Drawable d, /* The drawable we are drawing into */
GC gc, /* The precalculated gc to draw with */
Tk_Font tkfont, /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */
+ const Tk_FontMetrics *fmPtr,/* The precalculated metrics */
Tk_3DBorder activeBorder, /* The border for an active item */
int x, /* Left coordinate of entry rect */
int y, /* Top coordinate of entry rect */
@@ -508,7 +504,7 @@ DrawMenuEntryAccelerator(
&activeBorderWidth);
if ((mePtr->type == CASCADE_ENTRY) && drawArrow) {
points[0].x = x + width - borderWidth - activeBorderWidth
- - CASCADE_ARROW_WIDTH;
+ - CASCADE_ARROW_WIDTH;
points[0].y = y + (height - CASCADE_ARROW_HEIGHT)/2;
points[1].x = points[0].x;
points[1].y = points[0].y + CASCADE_ARROW_HEIGHT;
@@ -519,9 +515,9 @@ DrawMenuEntryAccelerator(
(menuPtr->postedCascade == mePtr)
? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
} else if (mePtr->accelPtr != NULL) {
- char *accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
+ const char *accel = Tcl_GetString(mePtr->accelPtr);
int left = x + mePtr->labelWidth + activeBorderWidth
- + mePtr->indicatorSpace;
+ + mePtr->indicatorSpace;
if (menuPtr->menuType == MENUBAR) {
left += 5;
@@ -557,7 +553,7 @@ DrawMenuEntryIndicator(
XColor *indicatorColor, /* The color to draw indicators with */
XColor *disableColor, /* The color use use when disabled */
Tk_Font tkfont, /* The font to draw with */
- CONST Tk_FontMetrics *fmPtr,/* The font metrics of the font */
+ const Tk_FontMetrics *fmPtr,/* The font metrics of the font */
int x, /* The left of the entry rect */
int y, /* The top of the entry rect */
int width, /* Width of menu entry */
@@ -629,7 +625,7 @@ DrawMenuSeparator(
Drawable d, /* The drawable we are using */
GC gc, /* The gc to draw into */
Tk_Font tkfont, /* The font to draw with */
- CONST Tk_FontMetrics *fmPtr,/* The font metrics from the font */
+ const Tk_FontMetrics *fmPtr,/* The font metrics from the font */
int x, int y,
int width, int height)
{
@@ -672,7 +668,7 @@ DrawMenuEntryLabel(
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. */
+ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics. */
int x, /* Left edge. */
int y, /* Top edge. */
int width, /* width of entry. */
@@ -701,12 +697,14 @@ DrawMenuEntryLabel(
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);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
+
textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
textHeight = fmPtr->linespace;
haveText = 1;
@@ -719,6 +717,7 @@ DrawMenuEntryLabel(
if (haveImage && haveText) {
int fullWidth = (imageWidth > textWidth ? imageWidth : textWidth);
+
switch ((enum compound) mePtr->compound) {
case COMPOUND_TOP:
textXOffset = (fullWidth - textWidth)/2;
@@ -801,7 +800,7 @@ DrawMenuEntryLabel(
int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
if (mePtr->labelLength > 0) {
- char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
Tk_DrawChars(menuPtr->display, d, gc, tkfont, label,
mePtr->labelLength, leftEdge + textXOffset,
@@ -849,7 +848,7 @@ DrawMenuUnderline(
Drawable d, /* What we are drawing into */
GC gc, /* The gc to draw into */
Tk_Font tkfont, /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
+ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int x, int y,
int width, int height)
{
@@ -863,9 +862,9 @@ DrawMenuUnderline(
Tcl_GetUnicodeFromObj(mePtr->labelPtr, &len);
if (mePtr->underline < len) {
int activeBorderWidth, leftEdge;
- CONST char *label, *start, *end;
+ const char *label, *start, *end;
- label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
+ label = Tcl_GetString(mePtr->labelPtr);
start = Tcl_UtfAtIndex(label, mePtr->underline);
end = Tcl_UtfNext(start);
@@ -929,7 +928,7 @@ GetMenuSeparatorGeometry(
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 precalcualted font metrics */
+ const Tk_FontMetrics *fmPtr,/* The precalcualted font metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
@@ -958,7 +957,7 @@ 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 */
+ const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
@@ -1074,7 +1073,6 @@ TkpComputeMenubarGeometry(
if (mePtr->entryFlags & ENTRY_HELP_MENU) {
helpMenuIndex = i;
} else if (x + mePtr->width + borderWidth > maxWindowWidth) {
-
if (i == lastRowBreak) {
mePtr->y = y;
mePtr->x = x;
@@ -1085,7 +1083,7 @@ TkpComputeMenubarGeometry(
x = borderWidth;
for (j = lastRowBreak; j < i; j++) {
menuPtr->entries[j]->y = y + currentRowHeight
- - menuPtr->entries[j]->height;
+ - menuPtr->entries[j]->height;
menuPtr->entries[j]->x = x;
x += menuPtr->entries[j]->width;
}
@@ -1179,7 +1177,7 @@ DrawTearoffEntry(
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 */
+ const Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */
int x, int y,
int width, int height)
{
@@ -1259,7 +1257,7 @@ TkpInitializeMenuBindings(
static void
SetHelpMenu(
- TkMenu *menuPtr) /* The menu we are checking */
+ TkMenu *menuPtr) /* The menu we are checking */
{
TkMenuEntry *cascadeEntryPtr;
int useMotifHelp = 0;
@@ -1317,25 +1315,25 @@ SetHelpMenu(
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. */
+ 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, indicatorGC;
XColor *indicatorColor, *disableColor = NULL;
TkMenu *menuPtr = mePtr->menuPtr;
Tk_3DBorder bgBorder, activeBorder;
- CONST Tk_FontMetrics *fmPtr;
+ const Tk_FontMetrics *fmPtr;
Tk_FontMetrics entryMetrics;
int padY = (menuPtr->menuType == MENUBAR) ? 3 : 0;
int adjustedY = y + padY;
@@ -1358,7 +1356,7 @@ TkpDrawMenuEntry(
cascadeEntryPtr != NULL;
cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
if (cascadeEntryPtr->namePtr != NULL) {
- char *name = Tcl_GetString(cascadeEntryPtr->namePtr);
+ const char *name = Tcl_GetString(cascadeEntryPtr->namePtr);
if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) {
if (cascadeEntryPtr->state == ENTRY_DISABLED) {
@@ -1470,7 +1468,7 @@ static void
GetMenuLabelGeometry(
TkMenuEntry *mePtr, /* The entry we are computing */
Tk_Font tkfont, /* The precalculated font */
- CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */
+ 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 */
@@ -1483,6 +1481,7 @@ GetMenuLabelGeometry(
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 {
@@ -1501,9 +1500,9 @@ GetMenuLabelGeometry(
if (mePtr->labelPtr != NULL) {
int textWidth;
- char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
- textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
+ textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
if ((mePtr->compound != COMPOUND_NONE) && haveImage) {
switch ((enum compound) mePtr->compound) {
case COMPOUND_TOP:
@@ -1686,8 +1685,8 @@ TkpComputeStandardMenuGeometry(
accelWidth = width;
}
- GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont,
- fmPtr, &width, &height);
+ GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont, fmPtr,
+ &width, &height);
if (height > mePtr->height) {
mePtr->height = height;
}
@@ -1700,7 +1699,7 @@ TkpComputeStandardMenuGeometry(
mePtr->height += 2 * activeBorderWidth + MENU_DIVIDER_HEIGHT;
}
- mePtr->y = y;
+ mePtr->y = y;
y += mePtr->height;
if (y > windowHeight) {
windowHeight = y;
@@ -1759,7 +1758,7 @@ TkpComputeStandardMenuGeometry(
void
TkpMenuNotifyToplevelCreate(
Tcl_Interp *interp, /* The interp the menu lives in. */
- char *menuName) /* The name of the menu to reconfigure. */
+ const char *menuName) /* The name of the menu to reconfigure. */
{
/*
* Nothing to do.
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index 48d3fb9..ad71b7b 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -13,17 +13,6 @@
#include "tkInt.h"
#include "tkMenubutton.h"
-/*
- * The structure below defines menubutton class behavior by means of functions
- * that can be invoked from generic window code.
- */
-
-Tk_ClassProcs tkpMenubuttonClass = {
- sizeof(Tk_ClassProcs), /* size */
- TkMenuButtonWorldChanged, /* worldChangedProc */
- NULL,
- NULL
-};
/*
*----------------------------------------------------------------------
@@ -45,7 +34,7 @@ TkMenuButton *
TkpCreateMenuButton(
Tk_Window tkwin)
{
- return (TkMenuButton *)ckalloc(sizeof(TkMenuButton));
+ return ckalloc(sizeof(TkMenuButton));
}
/*
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index e0dbc8f..64589be 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -17,21 +17,6 @@
#define __UNIX__ 1
-/*
- * 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
-
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
@@ -180,7 +165,7 @@
* These functions do nothing under Unix, so we just eliminate calls to them.
*/
-#define TkpButtonSetDefaults(specPtr) {}
+#define TkpButtonSetDefaults() {}
#define TkpDestroyButton(butPtr) {}
#define TkSelUpdateClipboard(a,b) {}
#define TkSetPixmapColormap(p,c) {}
@@ -202,15 +187,4 @@
#define TkpPrintWindowId(buf,w) \
sprintf((buf), "%#08lx", (unsigned long) (w))
-/*
- * The following declaration is used to get access to a private Tcl interface
- * that is needed for portability reasons.
- *
- * Disabled for now to determined whether we really still need this.
-
-#ifndef _TCLINT
-#include <tclInt.h>
-#endif
- */
-
#endif /* _UNIXPORT */
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 134bb45..bad52d9 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -16,8 +16,10 @@
typedef struct {
XftFont *ftFont;
+ XftFont *ft0Font;
FcPattern *source;
FcCharSet *charset;
+ double angle;
} UnixFtFace;
typedef struct {
@@ -59,13 +61,15 @@ TkpFontPkgInit(
static XftFont *
GetFont(
UnixFtFont *fontPtr,
- FcChar32 ucs4)
+ FcChar32 ucs4,
+ double angle)
{
int i;
if (ucs4) {
for (i = 0; i < fontPtr->nfaces; i++) {
FcCharSet *charset = fontPtr->faces[i].charset;
+
if (charset && FcCharSetHasChar(charset, ucs4)) {
break;
}
@@ -76,34 +80,61 @@ GetFont(
} else {
i = 0;
}
- if (!fontPtr->faces[i].ftFont) {
- FcPattern *pat = FcFontRenderPrepare(0,
- fontPtr->pattern, fontPtr->faces[i].source);
- XftFont *ftFont = XftFontOpenPattern(fontPtr->display, pat);
+ if ((angle == 0.0 && !fontPtr->faces[i].ft0Font) || (angle != 0.0 &&
+ (!fontPtr->faces[i].ftFont || fontPtr->faces[i].angle != angle))){
+ FcPattern *pat = FcFontRenderPrepare(0, fontPtr->pattern,
+ fontPtr->faces[i].source);
+ double s = sin(angle*PI/180.0), c = cos(angle*PI/180.0);
+ FcMatrix mat;
+ XftFont *ftFont;
+ /*
+ * Initialize the matrix manually so this can compile with HP-UX cc
+ * (which does not allow non-constant structure initializers). [Bug
+ * 2978410]
+ */
+
+ mat.xx = mat.yy = c;
+ mat.xy = -(mat.yx = s);
+
+ if (angle != 0.0) {
+ FcPatternAddMatrix(pat, FC_MATRIX, &mat);
+ }
+ ftFont = XftFontOpenPattern(fontPtr->display, pat);
if (!ftFont) {
/*
- * The previous call to XftFontOpenPattern() should not fail,
- * but sometimes does anyway. Usual cause appears to be
- * a misconfigured fontconfig installation; see [Bug 1090382].
- * Try a fallback:
+ * The previous call to XftFontOpenPattern() should not fail, but
+ * sometimes does anyway. Usual cause appears to be a
+ * misconfigured fontconfig installation; see [Bug 1090382]. Try a
+ * fallback:
*/
+
ftFont = XftFontOpen(fontPtr->display, fontPtr->screen,
- FC_FAMILY, FcTypeString, "sans",
- FC_SIZE, FcTypeDouble, 12.0,
- (void *) NULL);
+ FC_FAMILY, FcTypeString, "sans",
+ FC_SIZE, FcTypeDouble, 12.0,
+ FC_MATRIX, FcTypeMatrix, &mat,
+ (void *) NULL);
}
if (!ftFont) {
/*
- * The previous call should definitely not fail.
- * Impossible to proceed at this point.
+ * The previous call should definitely not fail. Impossible to
+ * proceed at this point.
*/
- Tcl_Panic("Cannot find a usable font.");
+
+ Tcl_Panic("Cannot find a usable font");
}
- fontPtr->faces[i].ftFont = ftFont;
+ if (angle == 0.0) {
+ fontPtr->faces[i].ft0Font = ftFont;
+ } else {
+ if (fontPtr->faces[i].ftFont) {
+ XftFontClose(fontPtr->display, fontPtr->faces[i].ftFont);
+ }
+ fontPtr->faces[i].ftFont = ftFont;
+ fontPtr->faces[i].angle = angle;
+ }
}
- return fontPtr->faces[i].ftFont;
+ return (angle==0.0? fontPtr->faces[i].ft0Font : fontPtr->faces[i].ftFont);
}
/*
@@ -118,14 +149,15 @@ GetTkFontAttributes(
XftFont *ftFont,
TkFontAttributes *faPtr)
{
- char *family = "Unknown", **familyPtr = &family;
+ const char *family = "Unknown";
+ const char *const *familyPtr = &family;
int weight, slant, size, pxsize;
double ptsize;
- (void)XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr);
+ (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr);
if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0,
&ptsize) == XftResultMatch) {
- size = (int)ptsize;
+ size = (int) ptsize;
} else if (XftPatternGetInteger(ftFont->pattern, XFT_PIXEL_SIZE, 0,
&pxsize) == XftResultMatch) {
size = -pxsize;
@@ -161,7 +193,8 @@ GetTkFontAttributes(
* Fill in TkFontMetrics from an XftFont.
*/
-static void GetTkFontMetrics(
+static void
+GetTkFontMetrics(
XftFont *ftFont,
TkFontMetrics *fmPtr)
{
@@ -202,10 +235,10 @@ InitFont(
FcCharSet *charset;
FcResult result;
XftFont *ftFont;
- int i;
+ int i, iWidth;
if (!fontPtr) {
- fontPtr = (UnixFtFont *) ckalloc(sizeof(UnixFtFont));
+ fontPtr = ckalloc(sizeof(UnixFtFont));
}
FcConfigSubstitute(0, pattern, FcMatchPattern);
@@ -217,13 +250,13 @@ InitFont(
set = FcFontSort(0, pattern, FcTrue, NULL, &result);
if (!set) {
- ckfree((char *)fontPtr);
+ ckfree(fontPtr);
return NULL;
}
fontPtr->fontset = set;
fontPtr->pattern = pattern;
- fontPtr->faces = (UnixFtFace *) ckalloc(set->nfont * sizeof(UnixFtFace));
+ fontPtr->faces = ckalloc(set->nfont * sizeof(UnixFtFace));
fontPtr->nfaces = set->nfont;
/*
@@ -232,6 +265,7 @@ InitFont(
for (i = 0; i < set->nfont; i++) {
fontPtr->faces[i].ftFont = 0;
+ fontPtr->faces[i].ft0Font = 0;
fontPtr->faces[i].source = set->fonts[i];
if (FcPatternGetCharSet(set->fonts[i], FC_CHARSET, 0,
&charset) == FcResultMatch) {
@@ -239,6 +273,7 @@ InitFont(
} else {
fontPtr->faces[i].charset = 0;
}
+ fontPtr->faces[i].angle = 0.0;
}
fontPtr->display = Tk_Display(tkwin);
@@ -253,7 +288,8 @@ InitFont(
/*
* Fill in platform-specific fields of TkFont.
*/
- ftFont = GetFont(fontPtr, 0);
+
+ ftFont = GetFont(fontPtr, 0, 0.0);
fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
GetTkFontAttributes(ftFont, &fontPtr->font.fa);
GetTkFontMetrics(ftFont, &fontPtr->font.fm);
@@ -279,7 +315,6 @@ InitFont(
{
TkFont *fPtr = &fontPtr->font;
- int iWidth;
fPtr->underlinePos = fPtr->fm.descent / 2;
Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth);
@@ -305,19 +340,22 @@ FinishedWithFont(
{
Display *display = fontPtr->display;
int i;
- Tk_ErrorHandler handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL,
- (ClientData) NULL);
+ Tk_ErrorHandler handler =
+ Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL);
for (i = 0; i < fontPtr->nfaces; i++) {
if (fontPtr->faces[i].ftFont) {
XftFontClose(fontPtr->display, fontPtr->faces[i].ftFont);
}
+ if (fontPtr->faces[i].ft0Font) {
+ XftFontClose(fontPtr->display, fontPtr->faces[i].ft0Font);
+ }
if (fontPtr->faces[i].charset) {
FcCharSetDestroy(fontPtr->faces[i].charset);
}
}
if (fontPtr->faces) {
- ckfree((char *)fontPtr->faces);
+ ckfree(fontPtr->faces);
}
if (fontPtr->pattern) {
FcPatternDestroy(fontPtr->pattern);
@@ -337,7 +375,7 @@ FinishedWithFont(
TkFont *
TkpGetNativeFont(
Tk_Window tkwin, /* For display where font will be used. */
- CONST char *name) /* Platform-specific font name. */
+ const char *name) /* Platform-specific font name. */
{
UnixFtFont *fontPtr;
FcPattern *pattern;
@@ -372,7 +410,7 @@ TkpGetFontFromAttributes(
* will be released. If NULL, a new TkFont
* structure is allocated. */
Tk_Window tkwin, /* For display where font will be used. */
- CONST TkFontAttributes *faPtr)
+ const TkFontAttributes *faPtr)
/* Set of attributes to match. */
{
XftPattern *pattern;
@@ -482,14 +520,15 @@ TkpGetFontFamilies(
resultPtr = Tcl_NewListObj(0, NULL);
list = XftListFonts(Tk_Display(tkwin), Tk_ScreenNumber(tkwin),
- (char*)0, /* pattern elements */
- XFT_FAMILY, (char*)0); /* fields */
+ (char *) 0, /* pattern elements */
+ XFT_FAMILY, (char*) 0); /* fields */
for (i = 0; i < list->nfont; i++) {
char *family, **familyPtr = &family;
+
if (XftPatternGetString(list->fonts[i], XFT_FAMILY, 0, familyPtr)
- == XftResultMatch)
- {
+ == XftResultMatch) {
Tcl_Obj *strPtr = Tcl_NewStringObj(family, -1);
+
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
}
@@ -519,9 +558,12 @@ TkpGetSubFonts(
Tcl_Obj *objv[3], *listPtr, *resultPtr;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
FcPattern *pattern;
- char *family = "Unknown", **familyPtr = &family;
- char *foundry = "Unknown", **foundryPtr = &foundry;
- char *encoding = "Unknown", **encodingPtr = &encoding;
+ const char *family = "Unknown";
+ const char *const *familyPtr = &family;
+ const char *foundry = "Unknown";
+ const char *const *foundryPtr = &foundry;
+ const char *encoding = "Unknown";
+ const char *const *encodingPtr = &encoding;
int i;
resultPtr = Tcl_NewListObj(0, NULL);
@@ -564,7 +606,7 @@ TkpGetFontAttrsForChar(
/* Structure describing the logical font */
FcChar32 ucs4 = (FcChar32) c;
/* UCS-4 character to map */
- XftFont *ftFont = GetFont(fontPtr, ucs4);
+ XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0);
/* Actual font used to render the character */
GetTkFontAttributes(ftFont, faPtr);
@@ -575,7 +617,7 @@ TkpGetFontAttrsForChar(
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
+ 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. */
@@ -613,7 +655,7 @@ Tk_MeasureChars(
Tcl_UniChar unichar;
clen = Tcl_UtfToUniChar(source, &unichar);
- c = (FcChar32)unichar;
+ c = (FcChar32) unichar;
if (clen <= 0) {
/*
@@ -639,7 +681,7 @@ Tk_MeasureChars(
#if DEBUG_FONTSEL
string[len++] = (char) c;
#endif /* DEBUG_FONTSEL */
- ftFont = GetFont(fontPtr, c);
+ ftFont = GetFont(fontPtr, c, 0.0);
XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
@@ -671,7 +713,7 @@ Tk_MeasureChars(
int
TkpMeasureCharsInContext(
Tk_Font tkfont,
- CONST char *source,
+ const char *source,
int numBytes,
int rangeStart,
int rangeLength,
@@ -694,7 +736,7 @@ Tk_DrawChars(
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
+ 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
@@ -721,8 +763,8 @@ Tk_DrawChars(
DefaultVisual(display, fontPtr->screen),
DefaultColormap(display, fontPtr->screen));
} else {
- Tk_ErrorHandler handler = Tk_CreateErrorHandler(display, -1, -1, -1,
- NULL, (ClientData) NULL);
+ Tk_ErrorHandler handler =
+ Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL);
XftDrawChange(fontPtr->ftDraw, drawable);
Tk_DeleteErrorHandler(handler);
@@ -754,7 +796,7 @@ Tk_DrawChars(
source += clen;
numBytes -= clen;
- ftFont = GetFont(fontPtr, c);
+ ftFont = GetFont(fontPtr, c, 0.0);
if (ftFont) {
specs[nspec].font = ftFont;
specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
@@ -789,3 +831,271 @@ Tk_DrawChars(
(unsigned) fontPtr->font.underlineHeight);
}
}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkDrawAngledChars --
+ *
+ * Draw some characters at an angle. This would be simple code, except
+ * Xft has bugs with cumulative errors in character positioning which are
+ * caused by trying to perform all calculations internally with integers.
+ * So we have to do the work ourselves with floating-point math.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Target drawable is updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkDrawAngledChars(
+ 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. */
+ double x, double y, /* Coordinates at which to place origin of
+ * string when drawing. */
+ double angle) /* What angle to put text at, in degrees. */
+{
+ const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */
+ const int minCoord = -1000; /* Should be good enough... */
+ UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
+ XGCValues values;
+ XColor xcolor;
+ int xStart = x, yStart = y;
+#ifdef XFT_HAS_FIXED_ROTATED_PLACEMENT
+ int clen, nglyph;
+ FT_UInt glyphs[NUM_SPEC];
+ XGlyphInfo metrics;
+ XftFont *currentFtFont;
+ int originX, originY;
+
+ if (fontPtr->ftDraw == 0) {
+#if DEBUG_FONTSEL
+ printf("Switch to drawable 0x%x\n", drawable);
+#endif /* DEBUG_FONTSEL */
+ fontPtr->ftDraw = XftDrawCreate(display, drawable,
+ DefaultVisual(display, fontPtr->screen),
+ DefaultColormap(display, fontPtr->screen));
+ } else {
+ Tk_ErrorHandler handler =
+ Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL);
+
+ XftDrawChange(fontPtr->ftDraw, drawable);
+ Tk_DeleteErrorHandler(handler);
+ }
+
+ XGetGCValues(display, gc, GCForeground, &values);
+ if (values.foreground != fontPtr->color.pixel) {
+ xcolor.pixel = values.foreground;
+ XQueryColor(display, DefaultColormap(display, fontPtr->screen),
+ &xcolor);
+ fontPtr->color.color.red = xcolor.red;
+ fontPtr->color.color.green = xcolor.green;
+ fontPtr->color.color.blue = xcolor.blue;
+ fontPtr->color.color.alpha = 0xffff;
+ fontPtr->color.pixel = values.foreground;
+ }
+
+ nglyph = 0;
+ currentFtFont = NULL;
+ originX = originY = 0; /* lint */
+
+ while (numBytes > 0 && x <= maxCoord && x >= minCoord && y <= maxCoord
+ && y >= minCoord) {
+ XftFont *ftFont;
+ FcChar32 c;
+
+ clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ if (clen <= 0) {
+ /*
+ * This should not happen, but it can.
+ */
+
+ goto doUnderlineStrikeout;
+ }
+ source += clen;
+ numBytes -= clen;
+
+ ftFont = GetFont(fontPtr, c, angle);
+ if (!ftFont) {
+ continue;
+ }
+
+ if (ftFont != currentFtFont || nglyph == NUM_SPEC) {
+ if (nglyph) {
+ /*
+ * We pass multiple glyphs at once to enable the code to
+ * perform better rendering of sub-pixel inter-glyph spacing.
+ * If only the current Xft implementation could make use of
+ * this information... but we'll be ready when it does!
+ */
+
+ XftDrawGlyphs(fontPtr->ftDraw, &fontPtr->color, currentFtFont,
+ originX, originY, glyphs, nglyph);
+ }
+ originX = ROUND16(x);
+ originY = ROUND16(y);
+ if (nglyph) {
+ XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
+ nglyph, &metrics);
+ nglyph = 0;
+ x += metrics.xOff;
+ y += metrics.yOff;
+ }
+ currentFtFont = ftFont;
+ }
+ glyphs[nglyph++] = XftCharIndex(fontPtr->display, ftFont, c);
+ }
+ if (nglyph) {
+ XftDrawGlyphs(fontPtr->ftDraw, &fontPtr->color, currentFtFont,
+ originX, originY, glyphs, nglyph);
+ }
+#else /* !XFT_HAS_FIXED_ROTATED_PLACEMENT */
+ int clen, nspec;
+ XftGlyphFontSpec specs[NUM_SPEC];
+ XGlyphInfo metrics;
+ double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
+
+ if (fontPtr->ftDraw == 0) {
+#if DEBUG_FONTSEL
+ printf("Switch to drawable 0x%x\n", drawable);
+#endif /* DEBUG_FONTSEL */
+ fontPtr->ftDraw = XftDrawCreate(display, drawable,
+ DefaultVisual(display, fontPtr->screen),
+ DefaultColormap(display, fontPtr->screen));
+ } else {
+ Tk_ErrorHandler handler =
+ Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL);
+
+ XftDrawChange(fontPtr->ftDraw, drawable);
+ Tk_DeleteErrorHandler(handler);
+ }
+ XGetGCValues(display, gc, GCForeground, &values);
+ if (values.foreground != fontPtr->color.pixel) {
+ xcolor.pixel = values.foreground;
+ XQueryColor(display, DefaultColormap(display, fontPtr->screen),
+ &xcolor);
+ fontPtr->color.color.red = xcolor.red;
+ fontPtr->color.color.green = xcolor.green;
+ fontPtr->color.color.blue = xcolor.blue;
+ fontPtr->color.color.alpha = 0xffff;
+ fontPtr->color.pixel = values.foreground;
+ }
+ nspec = 0;
+ while (numBytes > 0 && x <= maxCoord && x >= minCoord
+ && y <= maxCoord && y >= minCoord) {
+ XftFont *ftFont, *ft0Font;
+ FcChar32 c;
+
+ clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ if (clen <= 0) {
+ /*
+ * This should not happen, but it can.
+ */
+
+ goto doUnderlineStrikeout;
+ }
+ source += clen;
+ numBytes -= clen;
+
+ ftFont = GetFont(fontPtr, c, angle);
+ ft0Font = GetFont(fontPtr, c, 0.0);
+ if (ftFont && ft0Font) {
+ specs[nspec].font = ftFont;
+ specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
+ specs[nspec].x = ROUND16(x);
+ specs[nspec].y = ROUND16(y);
+ XftGlyphExtents(fontPtr->display, ft0Font, &specs[nspec].glyph, 1,
+ &metrics);
+ x += metrics.xOff*cosA + metrics.yOff*sinA;
+ y += metrics.yOff*cosA - metrics.xOff*sinA;
+ nspec++;
+ if (nspec == NUM_SPEC) {
+ XftDrawGlyphFontSpec(fontPtr->ftDraw, &fontPtr->color,
+ specs, nspec);
+ nspec = 0;
+ }
+ }
+ }
+ if (nspec) {
+ XftDrawGlyphFontSpec(fontPtr->ftDraw, &fontPtr->color, specs, nspec);
+ }
+#endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */
+
+ doUnderlineStrikeout:
+ if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) {
+ XPoint points[5];
+ double width = (x - xStart) * cosA + (yStart - y) * sinA;
+ double barHeight = fontPtr->font.underlineHeight;
+ double dy = fontPtr->font.underlinePos;
+
+ if (fontPtr->font.fa.underline != 0) {
+ if (fontPtr->font.underlineHeight == 1) {
+ dy++;
+ }
+ points[0].x = xStart + ROUND16(dy*sinA);
+ points[0].y = yStart + ROUND16(dy*cosA);
+ points[1].x = xStart + ROUND16(dy*sinA + width*cosA);
+ points[1].y = yStart + ROUND16(dy*cosA - width*sinA);
+ if (fontPtr->font.underlineHeight == 1) {
+ XDrawLines(display, drawable, gc, points, 2, CoordModeOrigin);
+ } else {
+ points[2].x = xStart + ROUND16(dy*sinA + width*cosA
+ + barHeight*sinA);
+ points[2].y = yStart + ROUND16(dy*cosA - width*sinA
+ + barHeight*cosA);
+ points[3].x = xStart + ROUND16(dy*sinA + barHeight*sinA);
+ points[3].y = yStart + ROUND16(dy*cosA + barHeight*cosA);
+ points[4].x = points[0].x;
+ points[4].y = points[0].y;
+ XFillPolygon(display, drawable, gc, points, 5, Complex,
+ CoordModeOrigin);
+ XDrawLines(display, drawable, gc, points, 5, CoordModeOrigin);
+ }
+ }
+ if (fontPtr->font.fa.overstrike != 0) {
+ dy = -fontPtr->font.fm.descent
+ - (fontPtr->font.fm.ascent) / 10;
+ points[0].x = xStart + ROUND16(dy*sinA);
+ points[0].y = yStart + ROUND16(dy*cosA);
+ points[1].x = xStart + ROUND16(dy*sinA + width*cosA);
+ points[1].y = yStart + ROUND16(dy*cosA - width*sinA);
+ if (fontPtr->font.underlineHeight == 1) {
+ XDrawLines(display, drawable, gc, points, 2, CoordModeOrigin);
+ } else {
+ points[2].x = xStart + ROUND16(dy*sinA + width*cosA
+ + barHeight*sinA);
+ points[2].y = yStart + ROUND16(dy*cosA - width*sinA
+ + barHeight*cosA);
+ points[3].x = xStart + ROUND16(dy*sinA + barHeight*sinA);
+ points[3].y = yStart + ROUND16(dy*cosA + barHeight*cosA);
+ points[4].x = points[0].x;
+ points[4].y = points[0].y;
+ XFillPolygon(display, drawable, gc, points, 5, Complex,
+ CoordModeOrigin);
+ XDrawLines(display, drawable, gc, points, 5, CoordModeOrigin);
+ }
+ }
+ }
+}
+
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c
index e158549..b156a74 100644
--- a/unix/tkUnixScale.c
+++ b/unix/tkUnixScale.c
@@ -46,7 +46,7 @@ TkScale *
TkpCreateScale(
Tk_Window tkwin)
{
- return (TkScale *) ckalloc(sizeof(TkScale));
+ return ckalloc(sizeof(TkScale));
}
/*
@@ -71,7 +71,7 @@ void
TkpDestroyScale(
TkScale *scalePtr)
{
- Tcl_EventuallyFree((ClientData) scalePtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(scalePtr, TCL_DYNAMIC);
}
/*
@@ -547,24 +547,24 @@ TkpDisplayScale(
* Invoke the scale's command if needed.
*/
- Tcl_Preserve((ClientData) scalePtr);
+ Tcl_Preserve(scalePtr);
if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) {
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(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_BackgroundException(interp, result);
}
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
}
scalePtr->flags &= ~INVOKE_COMMAND;
if (scalePtr->flags & SCALE_DELETED) {
- Tcl_Release((ClientData) scalePtr);
+ Tcl_Release(scalePtr);
return;
}
- Tcl_Release((ClientData) scalePtr);
+ Tcl_Release(scalePtr);
#ifndef TK_NO_DOUBLE_BUFFERING
/*
diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c
index 1e70925..0507211 100644
--- a/unix/tkUnixScrlbr.c
+++ b/unix/tkUnixScrlbr.c
@@ -36,8 +36,11 @@ typedef struct UnixScrollbar {
* variable is declared at this scope.
*/
-Tk_ClassProcs tkpScrollbarProcs = {
- sizeof(Tk_ClassProcs) /* size */
+const Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ NULL, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
@@ -60,13 +63,14 @@ TkScrollbar *
TkpCreateScrollbar(
Tk_Window tkwin)
{
- UnixScrollbar *scrollPtr = (UnixScrollbar *)ckalloc(sizeof(UnixScrollbar));
+ UnixScrollbar *scrollPtr = ckalloc(sizeof(UnixScrollbar));
+
scrollPtr->troughGC = None;
scrollPtr->copyGC = None;
Tk_CreateEventHandler(tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
- TkScrollbarEventProc, (ClientData) scrollPtr);
+ TkScrollbarEventProc, scrollPtr);
return (TkScrollbar *) scrollPtr;
}
@@ -301,14 +305,13 @@ TkpComputeScrollbarGeometry(
* grabbed with the mouse).
*/
- if (scrollPtr->sliderFirst > (fieldLength - MIN_SLIDER_LENGTH)) {
+ if (scrollPtr->sliderFirst > fieldLength - MIN_SLIDER_LENGTH) {
scrollPtr->sliderFirst = fieldLength - MIN_SLIDER_LENGTH;
}
if (scrollPtr->sliderFirst < 0) {
scrollPtr->sliderFirst = 0;
}
- if (scrollPtr->sliderLast < (scrollPtr->sliderFirst
- + MIN_SLIDER_LENGTH)) {
+ if (scrollPtr->sliderLast < scrollPtr->sliderFirst + MIN_SLIDER_LENGTH) {
scrollPtr->sliderLast = scrollPtr->sliderFirst + MIN_SLIDER_LENGTH;
}
if (scrollPtr->sliderLast > fieldLength) {
@@ -404,8 +407,8 @@ TkpConfigureScrollbar(
unixScrollPtr->troughGC = new;
if (unixScrollPtr->copyGC == None) {
gcValues.graphics_exposures = False;
- unixScrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin, GCGraphicsExposures,
- &gcValues);
+ unixScrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin,
+ GCGraphicsExposures, &gcValues);
}
}
@@ -434,6 +437,7 @@ TkpScrollbarPosition(
int x, int y) /* Coordinates within scrollPtr's window. */
{
int length, width, tmp;
+ register const int inset = scrollPtr->inset;
if (scrollPtr->vertical) {
length = Tk_Height(scrollPtr->tkwin);
@@ -446,8 +450,7 @@ TkpScrollbarPosition(
width = Tk_Height(scrollPtr->tkwin);
}
- if ((x < scrollPtr->inset) || (x >= (width - scrollPtr->inset))
- || (y < scrollPtr->inset) || (y >= (length - scrollPtr->inset))) {
+ if (x<inset || x>=width-inset || y<inset || y>=length-inset) {
return OUTSIDE;
}
@@ -456,7 +459,7 @@ TkpScrollbarPosition(
* TkpDisplayScrollbar. Be sure to keep the two consistent.
*/
- if (y < (scrollPtr->inset + scrollPtr->arrowLength)) {
+ if (y < inset + scrollPtr->arrowLength) {
return TOP_ARROW;
}
if (y < scrollPtr->sliderFirst) {
@@ -465,7 +468,7 @@ TkpScrollbarPosition(
if (y < scrollPtr->sliderLast) {
return SLIDER;
}
- if (y >= (length - (scrollPtr->arrowLength + scrollPtr->inset))) {
+ if (y >= length - (scrollPtr->arrowLength + inset)) {
return BOTTOM_ARROW;
}
return BOTTOM_GAP;
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c
index 060fdd1..172d5ca 100644
--- a/unix/tkUnixSelect.c
+++ b/unix/tkUnixSelect.c
@@ -183,7 +183,7 @@ TkSelGetSelection(
*/
retr.timeout = Tcl_CreateTimerHandler(1000, SelTimeoutProc,
- (ClientData) &retr);
+ &retr);
while (retr.result == -1) {
Tcl_DoOneEvent(0);
}
@@ -326,7 +326,7 @@ TkSelPropProc(
length = strlen(incrPtr->converts[i].buffer);
strcpy((char *)buffer, incrPtr->converts[i].buffer);
- numItems = (*selPtr->proc)(selPtr->clientData,
+ numItems = selPtr->proc(selPtr->clientData,
incrPtr->converts[i].offset,
((char *) buffer) + length,
TK_SEL_BYTES_AT_ONCE - length);
@@ -594,7 +594,7 @@ TkSelEventProc(
return;
}
interp = retrPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
/*
* Convert the X selection data into UTF before passing it to the
@@ -617,10 +617,10 @@ TkSelEventProc(
Tcl_FreeEncoding(encoding);
}
- retrPtr->result = (*retrPtr->proc)(retrPtr->clientData,
- interp, Tcl_DStringValue(&ds));
+ retrPtr->result = retrPtr->proc(retrPtr->clientData, interp,
+ Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
} else if (type == dispPtr->utf8Atom) {
/*
* The X selection data is in UTF-8 format already. We can't
@@ -642,14 +642,14 @@ TkSelEventProc(
}
if (propInfo[numItems] != '\0') {
- propData = ckalloc((size_t) numItems + 1);
+ propData = ckalloc(numItems + 1);
strcpy(propData, propInfo);
propData[numItems] = '\0';
}
- retrPtr->result = (*retrPtr->proc)(retrPtr->clientData,
+ retrPtr->result = retrPtr->proc(retrPtr->clientData,
retrPtr->interp, propData);
if (propData != propInfo) {
- ckfree((char *) propData);
+ ckfree(propData);
}
} else if (type == dispPtr->incrAtom) {
@@ -661,14 +661,14 @@ TkSelEventProc(
retrPtr->idleTime = 0;
Tk_CreateEventHandler(tkwin, PropertyChangeMask, SelRcvIncrProc,
- (ClientData) retrPtr);
+ retrPtr);
XDeleteProperty(Tk_Display(tkwin), Tk_WindowId(tkwin),
retrPtr->property);
while (retrPtr->result == -1) {
Tcl_DoOneEvent(0);
}
Tk_DeleteEventHandler(tkwin, PropertyChangeMask, SelRcvIncrProc,
- (ClientData) retrPtr);
+ retrPtr);
} else {
Tcl_DString ds;
@@ -690,10 +690,10 @@ TkSelEventProc(
(Tk_Window) winPtr, &ds);
}
interp = retrPtr->interp;
- Tcl_Preserve((ClientData) interp);
- retrPtr->result = (*retrPtr->proc)(retrPtr->clientData,
+ Tcl_Preserve(interp);
+ retrPtr->result = retrPtr->proc(retrPtr->clientData,
interp, Tcl_DStringValue(&ds));
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
Tcl_DStringFree(&ds);
}
XFree(propInfo);
@@ -791,7 +791,10 @@ ConvertSelection(
register XSelectionRequestEvent *eventPtr)
/* Event describing request. */
{
- XSelectionEvent reply; /* Used to notify requestor that selection
+ union {
+ XSelectionEvent xsel;
+ XEvent ev;
+ } reply; /* Used to notify requestor that selection
* info is ready. */
int multiple; /* Non-zero means a MULTIPLE request is being
* handled. */
@@ -812,18 +815,18 @@ ConvertSelection(
* Initialize the reply event.
*/
- reply.type = SelectionNotify;
- reply.serial = 0;
- reply.send_event = True;
- reply.display = eventPtr->display;
- reply.requestor = eventPtr->requestor;
- reply.selection = eventPtr->selection;
- reply.target = eventPtr->target;
- reply.property = eventPtr->property;
- if (reply.property == None) {
- reply.property = reply.target;
+ reply.xsel.type = SelectionNotify;
+ reply.xsel.serial = 0;
+ reply.xsel.send_event = True;
+ reply.xsel.display = eventPtr->display;
+ reply.xsel.requestor = eventPtr->requestor;
+ reply.xsel.selection = eventPtr->selection;
+ reply.xsel.target = eventPtr->target;
+ reply.xsel.property = eventPtr->property;
+ if (reply.xsel.property == None) {
+ reply.xsel.property = reply.xsel.target;
}
- reply.time = eventPtr->time;
+ reply.xsel.time = eventPtr->time;
for (infoPtr = winPtr->dispPtr->selectionInfoPtr; infoPtr != NULL;
infoPtr = infoPtr->nextPtr) {
@@ -846,8 +849,8 @@ ConvertSelection(
incr.selection = eventPtr->selection;
if (eventPtr->target != winPtr->dispPtr->multipleAtom) {
multiple = 0;
- singleInfo[0] = reply.target;
- singleInfo[1] = reply.property;
+ singleInfo[0] = reply.xsel.target;
+ singleInfo[1] = reply.xsel.property;
incr.multAtoms = singleInfo;
incr.numConversions = 1;
} else {
@@ -881,8 +884,7 @@ ConvertSelection(
* below).
*/
- incr.converts = (ConvertInfo *)
- ckalloc((unsigned) incr.numConversions * sizeof(ConvertInfo));
+ incr.converts = ckalloc(incr.numConversions * sizeof(ConvertInfo));
incr.numIncrs = 0;
for (i = 0; i < incr.numConversions; i++) {
Atom target, property, type;
@@ -922,8 +924,8 @@ ConvertSelection(
ip.nextPtr = TkSelGetInProgress();
TkSelSetInProgress(&ip);
type = selPtr->format;
- numItems = (*selPtr->proc)(selPtr->clientData, 0,
- (char *) buffer, TK_SEL_BYTES_AT_ONCE);
+ numItems = selPtr->proc(selPtr->clientData, 0, (char *) buffer,
+ TK_SEL_BYTES_AT_ONCE);
TkSelSetInProgress(ip.nextPtr);
if ((ip.selPtr == NULL) || (numItems < 0)) {
incr.multAtoms[2*i + 1] = None;
@@ -956,7 +958,7 @@ ConvertSelection(
propPtr = (char *) buffer;
format = 32;
incr.converts[i].offset = 0;
- XChangeProperty(reply.display, reply.requestor,
+ XChangeProperty(reply.xsel.display, reply.xsel.requestor,
property, type, format, PropModeReplace,
(unsigned char *) propPtr, numItems);
} else if (type == winPtr->dispPtr->utf8Atom) {
@@ -965,7 +967,7 @@ ConvertSelection(
* allows us to pass our utf-8 information untouched.
*/
- XChangeProperty(reply.display, reply.requestor, property, type, 8,
+ XChangeProperty(reply.xsel.display, reply.xsel.requestor, property, type, 8,
PropModeReplace, (unsigned char *) buffer, numItems);
} else if ((type == XA_STRING)
|| (type == winPtr->dispPtr->compoundTextAtom)) {
@@ -984,7 +986,7 @@ ConvertSelection(
encoding = Tcl_GetEncoding(NULL, "iso2022");
}
Tcl_UtfToExternalDString(encoding, (char *) buffer, -1, &ds);
- XChangeProperty(reply.display, reply.requestor, property, type, 8,
+ XChangeProperty(reply.xsel.display, reply.xsel.requestor, property, type, 8,
PropModeReplace, (unsigned char *) Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds));
if (encoding) {
@@ -998,7 +1000,7 @@ ConvertSelection(
goto refuse;
}
format = 32;
- XChangeProperty(reply.display, reply.requestor, property, type,
+ XChangeProperty(reply.xsel.display, reply.xsel.requestor, property, type,
format, PropModeReplace, (unsigned char *) propPtr,
numItems);
ckfree(propPtr);
@@ -1012,17 +1014,16 @@ ConvertSelection(
*/
if (incr.numIncrs > 0) {
- XSelectInput(reply.display, reply.requestor, PropertyChangeMask);
- incr.timeout = Tcl_CreateTimerHandler(1000, IncrTimeoutProc,
- (ClientData) &incr);
+ XSelectInput(reply.xsel.display, reply.xsel.requestor, PropertyChangeMask);
+ incr.timeout = Tcl_CreateTimerHandler(1000, IncrTimeoutProc, &incr);
incr.idleTime = 0;
- incr.reqWindow = reply.requestor;
+ incr.reqWindow = reply.xsel.requestor;
incr.time = infoPtr->time;
incr.nextPtr = tsdPtr->pendingIncrs;
tsdPtr->pendingIncrs = &incr;
}
if (multiple) {
- XChangeProperty(reply.display, reply.requestor, reply.property,
+ XChangeProperty(reply.xsel.display, reply.xsel.requestor, reply.xsel.property,
XA_ATOM, 32, PropModeReplace,
(unsigned char *) incr.multAtoms,
(int) incr.numConversions*2);
@@ -1032,9 +1033,9 @@ ConvertSelection(
* to None if there was an error in conversion.
*/
- reply.property = incr.multAtoms[1];
+ reply.xsel.property = incr.multAtoms[1];
}
- XSendEvent(reply.display, reply.requestor, False, 0, (XEvent *) &reply);
+ XSendEvent(reply.xsel.display, reply.xsel.requestor, False, 0, &reply.ev);
Tk_DeleteErrorHandler(errorHandler);
/*
@@ -1052,7 +1053,7 @@ ConvertSelection(
Tcl_DeleteTimerHandler(incr.timeout);
errorHandler = Tk_CreateErrorHandler(winPtr->display,
-1, -1,-1, (int (*)()) NULL, NULL);
- XSelectInput(reply.display, reply.requestor, 0L);
+ XSelectInput(reply.xsel.display, reply.xsel.requestor, 0L);
Tk_DeleteErrorHandler(errorHandler);
if (tsdPtr->pendingIncrs == &incr) {
tsdPtr->pendingIncrs = incr.nextPtr;
@@ -1071,7 +1072,7 @@ ConvertSelection(
* All done. Cleanup and return.
*/
- ckfree((char *) incr.converts);
+ ckfree(incr.converts);
if (multiple) {
XFree((char *) incr.multAtoms);
}
@@ -1082,8 +1083,8 @@ ConvertSelection(
*/
refuse:
- reply.property = None;
- XSendEvent(reply.display, reply.requestor, False, 0, (XEvent *) &reply);
+ reply.xsel.property = None;
+ XSendEvent(reply.xsel.display, reply.xsel.requestor, False, 0, &reply.ev);
Tk_DeleteErrorHandler(errorHandler);
return;
}
@@ -1159,7 +1160,7 @@ SelRcvIncrProc(
goto done;
}
interp = retrPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
if (type == retrPtr->winPtr->dispPtr->compoundTextAtom) {
encoding = Tcl_GetEncoding(NULL, "iso2022");
@@ -1190,7 +1191,7 @@ SelRcvIncrProc(
*/
retrPtr->result = TCL_OK;
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
goto done;
} else {
src = propInfo;
@@ -1231,9 +1232,9 @@ SelRcvIncrProc(
}
Tcl_DStringSetLength(dstPtr, soFar);
- result = (*retrPtr->proc)(retrPtr->clientData, interp,
+ result = retrPtr->proc(retrPtr->clientData, interp,
Tcl_DStringValue(dstPtr));
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
/*
* Copy any unused data into the destination buffer so we can pick it
@@ -1273,10 +1274,10 @@ SelRcvIncrProc(
(Tk_Window) retrPtr->winPtr, &ds);
}
interp = retrPtr->interp;
- Tcl_Preserve((ClientData) interp);
- result = (*retrPtr->proc)(retrPtr->clientData, interp,
+ Tcl_Preserve(interp);
+ result = retrPtr->proc(retrPtr->clientData, interp,
Tcl_DStringValue(&ds));
- Tcl_Release((ClientData) interp);
+ Tcl_Release(interp);
Tcl_DStringFree(&ds);
if (result != TCL_OK) {
retrPtr->result = result;
@@ -1322,7 +1323,7 @@ SelectionSize(
TkSelSetInProgress(&ip);
do {
- chunkSize = (*selPtr->proc)(selPtr->clientData, size, (char *) buffer,
+ chunkSize = selPtr->proc(selPtr->clientData, size, (char *) buffer,
TK_SEL_BYTES_AT_ONCE);
if (ip.selPtr == NULL) {
size = 0;
@@ -1368,7 +1369,7 @@ IncrTimeoutProc(
incrPtr->numIncrs = 0;
} else {
incrPtr->timeout = Tcl_CreateTimerHandler(1000, IncrTimeoutProc,
- (ClientData) incrPtr);
+ incrPtr);
}
}
@@ -1422,7 +1423,7 @@ SelCvtToX(
if (Tcl_SplitList(NULL, string, &numFields, &field) != TCL_OK) {
return NULL;
}
- propPtr = (long *) ckalloc((unsigned) numFields*sizeof(long));
+ propPtr = ckalloc(numFields * sizeof(long));
/*
* Convert the fields one-by-one.
@@ -1447,7 +1448,7 @@ SelCvtToX(
* Release the parsed list.
*/
- ckfree((char *) field);
+ ckfree(field);
*numLongsPtr = i;
return propPtr;
}
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index c073309..be53ec6 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -77,7 +77,7 @@ typedef struct NameRegistry {
typedef struct PendingCommand {
int serial; /* Serial number expected in result. */
TkDisplay *dispPtr; /* Display being used for communication. */
- CONST char *target; /* Name of interpreter command is being sent
+ 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 was
@@ -210,19 +210,18 @@ static void AppendPropCarefully(Display *display,
int length, PendingCommand *pendingPtr);
static void DeleteProc(ClientData clientData);
static void RegAddName(NameRegistry *regPtr,
- CONST char *name, Window commWindow);
+ const char *name, Window commWindow);
static void RegClose(NameRegistry *regPtr);
-static void RegDeleteName(NameRegistry *regPtr, CONST char *name);
-static Window RegFindName(NameRegistry *regPtr, CONST char *name);
+static void RegDeleteName(NameRegistry *regPtr, const char *name);
+static Window RegFindName(NameRegistry *regPtr, const char *name);
static NameRegistry * RegOpen(Tcl_Interp *interp,
TkDisplay *dispPtr, int lock);
static void SendEventProc(ClientData clientData, XEvent *eventPtr);
static int SendInit(Tcl_Interp *interp, TkDisplay *dispPtr);
-static Tk_RestrictAction SendRestrictProc(ClientData clientData,
- XEvent *eventPtr);
+static Tk_RestrictProc SendRestrictProc;
static int ServerSecure(TkDisplay *dispPtr);
static void UpdateCommWindow(TkDisplay *dispPtr);
-static int ValidateName(TkDisplay *dispPtr, CONST char *name,
+static int ValidateName(TkDisplay *dispPtr, const char *name,
Window commWindow, int oldOK);
/*
@@ -267,7 +266,7 @@ RegOpen(
SendInit(interp, dispPtr);
}
- regPtr = (NameRegistry *) ckalloc(sizeof(NameRegistry));
+ regPtr = ckalloc(sizeof(NameRegistry));
regPtr->dispPtr = dispPtr;
regPtr->locked = 0;
regPtr->modified = 0;
@@ -347,7 +346,7 @@ static Window
RegFindName(
NameRegistry *regPtr, /* Pointer to a registry opened with a
* previous call to RegOpen. */
- CONST char *name) /* Name of an application. */
+ const char *name) /* Name of an application. */
{
char *p;
@@ -358,7 +357,7 @@ RegFindName(
p++;
}
if ((*p != 0) && (strcmp(name, p+1) == 0)) {
- unsigned int id;
+ unsigned id;
if (sscanf(entry, "%x", &id) == 1) {
/*
@@ -400,7 +399,7 @@ static void
RegDeleteName(
NameRegistry *regPtr, /* Pointer to a registry opened with a
* previous call to RegOpen. */
- CONST char *name) /* Name of an application. */
+ const char *name) /* Name of an application. */
{
char *p;
@@ -462,7 +461,7 @@ static void
RegAddName(
NameRegistry *regPtr, /* Pointer to a registry opened with a
* previous call to RegOpen. */
- CONST char *name, /* Name of an application. The caller must
+ 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
@@ -471,10 +470,10 @@ RegAddName(
char id[30], *newProp;
int idLength, newBytes;
- sprintf(id, "%x ", (unsigned int) commWindow);
+ sprintf(id, "%x ", (unsigned) commWindow);
idLength = strlen(id);
newBytes = idLength + strlen(name) + 1;
- newProp = ckalloc((unsigned) (regPtr->propLength + newBytes));
+ newProp = ckalloc(regPtr->propLength + newBytes);
strcpy(newProp, id);
strcpy(newProp+idLength, name);
if (regPtr->property != NULL) {
@@ -548,7 +547,7 @@ RegClose(
ckfree(regPtr->property);
}
}
- ckfree((char *) regPtr);
+ ckfree(regPtr);
}
/*
@@ -573,7 +572,7 @@ static int
ValidateName(
TkDisplay *dispPtr, /* Display for which to perform the
* validation. */
- CONST 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 an
@@ -586,7 +585,7 @@ ValidateName(
Atom actualType;
char *property, **propertyPtr = &property;
Tk_ErrorHandler handler;
- CONST char **argv;
+ const char **argv;
property = NULL;
@@ -634,7 +633,7 @@ ValidateName(
break;
}
}
- ckfree((char *) argv);
+ ckfree(argv);
}
} else {
result = 0;
@@ -743,7 +742,7 @@ ServerSecure(
* the side of safety.
*/
- goto insecure;
+ secure = 0;
#endif /* FamilyServerInterpreted */
}
if (addrPtr != NULL) {
@@ -754,7 +753,7 @@ ServerSecure(
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_SetAppName --
*
@@ -775,15 +774,15 @@ ServerSecure(
* registration will be removed automatically if the interpreter is
* deleted or the "send" command is removed.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
-CONST 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. */
- CONST char *name) /* The name that will be used to refer to the
+ const char *name) /* The name that will be used to refer to the
* interpreter in later "send" commands. Must
* be globally unique. */
{
@@ -793,10 +792,10 @@ Tk_SetAppName(
TkDisplay *dispPtr = winPtr->dispPtr;
NameRegistry *regPtr;
Tcl_Interp *interp;
- CONST char *actualName;
+ const char *actualName;
Tcl_DString dString;
int offset, i;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
interp = winPtr->mainPtr->interp;
@@ -818,14 +817,13 @@ Tk_SetAppName(
* the "send" command to the interpreter.
*/
- riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr = ckalloc(sizeof(RegisteredInterp));
riPtr->interp = interp;
riPtr->dispPtr = winPtr->dispPtr;
riPtr->nextPtr = tsdPtr->interpListPtr;
tsdPtr->interpListPtr = riPtr;
riPtr->name = NULL;
- Tcl_CreateCommand(interp, "send", Tk_SendCmd, (ClientData) riPtr,
- DeleteProc);
+ Tcl_CreateCommand(interp, "send", Tk_SendCmd, riPtr, DeleteProc);
if (Tcl_IsSafe(interp)) {
Tcl_HideCommand(interp, "send", "send");
}
@@ -903,7 +901,7 @@ Tk_SetAppName(
RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin));
RegClose(regPtr);
- riPtr->name = (char *) ckalloc((unsigned) (strlen(actualName) + 1));
+ riPtr->name = ckalloc(strlen(actualName) + 1);
strcpy(riPtr->name, actualName);
if (actualName != name) {
Tcl_DStringFree(&dString);
@@ -936,22 +934,22 @@ Tk_SendCmd(
* field is used). */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
TkWindow *winPtr;
Window commWindow;
PendingCommand pending;
register RegisteredInterp *riPtr;
- CONST char *destName;
+ const char *destName;
int result, c, async, i, firstArg;
size_t length;
- Tk_RestrictProc *prevRestrictProc;
+ Tk_RestrictProc *prevProc;
ClientData prevArg;
TkDisplay *dispPtr;
Tcl_Time timeout;
NameRegistry *regPtr;
Tcl_DString request;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Interp *localInterp; /* Used when the interpreter to send the
* command to is within the same process. */
@@ -994,7 +992,7 @@ Tk_SendCmd(
if (argc < (i+2)) {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " ?options? interpName arg ?arg ...?\"", NULL);
+ " ?-option value ...? interpName arg ?arg ...?\"", NULL);
return TCL_ERROR;
}
destName = argv[i];
@@ -1018,9 +1016,9 @@ Tk_SendCmd(
|| (strcmp(riPtr->name, destName) != 0)) {
continue;
}
- Tcl_Preserve((ClientData) riPtr);
+ Tcl_Preserve(riPtr);
localInterp = riPtr->interp;
- Tcl_Preserve((ClientData) localInterp);
+ Tcl_Preserve(localInterp);
if (firstArg == (argc-1)) {
result = Tcl_GlobalEval(localInterp, argv[firstArg]);
} else {
@@ -1056,8 +1054,8 @@ Tk_SendCmd(
Tcl_SetObjResult(interp, Tcl_GetObjResult(localInterp));
Tcl_ResetResult(localInterp);
}
- Tcl_Release((ClientData) riPtr);
- Tcl_Release((ClientData) localInterp);
+ Tcl_Release(riPtr);
+ Tcl_Release(localInterp);
return result;
}
@@ -1086,7 +1084,7 @@ Tk_SendCmd(
char buffer[TCL_INTEGER_SPACE * 2];
sprintf(buffer, "%x %d",
- (unsigned int) Tk_WindowId(dispPtr->commTkwin),
+ (unsigned) Tk_WindowId(dispPtr->commTkwin),
localData.sendSerial);
Tcl_DStringAppend(&request, "\0-r ", 4);
Tcl_DStringAppend(&request, buffer, -1);
@@ -1137,7 +1135,7 @@ Tk_SendCmd(
* other events in the application.
*/
- prevRestrictProc = Tk_RestrictEvents(SendRestrictProc, NULL, &prevArg);
+ prevProc = Tk_RestrictEvents(SendRestrictProc, NULL, &prevArg);
Tcl_GetTime(&timeout);
timeout.sec += 2;
while (!pending.gotResponse) {
@@ -1150,7 +1148,7 @@ Tk_SendCmd(
if (!ValidateName(pending.dispPtr, pending.target,
pending.commWindow, 0)) {
- char *msg;
+ const char *msg;
if (ValidateName(pending.dispPtr, pending.target,
pending.commWindow, 1)) {
@@ -1159,7 +1157,7 @@ Tk_SendCmd(
msg = "target application died";
}
pending.code = TCL_ERROR;
- pending.result = (char *) ckalloc((unsigned) (strlen(msg) + 1));
+ pending.result = ckalloc(strlen(msg) + 1);
strcpy(pending.result, msg);
pending.gotResponse = 1;
} else {
@@ -1168,7 +1166,7 @@ Tk_SendCmd(
}
}
}
- (void) Tk_RestrictEvents(prevRestrictProc, prevArg, &prevArg);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
/*
* Unregister the information about the pending command and return the
@@ -1197,7 +1195,8 @@ Tk_SendCmd(
Tcl_SetObjErrorCode(interp, errorObjPtr);
ckfree(pending.errorCode);
}
- Tcl_SetResult(interp, pending.result, TCL_DYNAMIC);
+ Tcl_SetResult(interp, pending.result, TCL_VOLATILE);
+ ckfree(pending.result);
return pending.code;
}
@@ -1240,9 +1239,9 @@ TkGetInterpNames(
for (p=regPtr->property ; p-regPtr->property<(int)regPtr->propLength ;) {
char *entry = p, *entryName;
Window commWindow;
- unsigned int id;
+ unsigned id;
- if (sscanf(p, "%x",(unsigned int *) &id) != 1) {
+ if (sscanf(p, "%x", (unsigned *) &id) != 1) {
commWindow = None;
} else {
commWindow = id;
@@ -1312,9 +1311,9 @@ TkSendCleanup(
{
if (dispPtr->commTkwin != NULL) {
Tk_DeleteEventHandler(dispPtr->commTkwin, PropertyChangeMask,
- SendEventProc, (ClientData) dispPtr);
+ SendEventProc, dispPtr);
Tk_DestroyWindow(dispPtr->commTkwin);
- Tcl_Release((ClientData) dispPtr->commTkwin);
+ Tcl_Release(dispPtr->commTkwin);
dispPtr->commTkwin = NULL;
}
}
@@ -1355,12 +1354,12 @@ SendInit(
if (dispPtr->commTkwin == NULL) {
Tcl_Panic("Tk_CreateWindow failed in SendInit!");
}
- Tcl_Preserve((ClientData) dispPtr->commTkwin);
+ Tcl_Preserve(dispPtr->commTkwin);
atts.override_redirect = True;
Tk_ChangeWindowAttributes(dispPtr->commTkwin,
CWOverrideRedirect, &atts);
Tk_CreateEventHandler(dispPtr->commTkwin, PropertyChangeMask,
- SendEventProc, (ClientData) dispPtr);
+ SendEventProc, dispPtr);
Tk_MakeWindowExist(dispPtr->commTkwin);
/*
@@ -1401,14 +1400,14 @@ SendEventProc(
ClientData clientData, /* Display information. */
XEvent *eventPtr) /* Information about event. */
{
- TkDisplay *dispPtr = (TkDisplay *) clientData;
+ TkDisplay *dispPtr = clientData;
char *propInfo, **propInfoPtr = &propInfo;
- register char *p;
+ const char *p;
int result, actualFormat;
unsigned long numItems, bytesAfter;
Atom actualType;
Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if ((eventPtr->xproperty.atom != dispPtr->commProperty)
@@ -1458,7 +1457,8 @@ SendEventProc(
if ((*p == 'c') && (p[1] == 0)) {
Window commWindow;
- char *interpName, *script, *serial, *end;
+ const char *interpName, *script, *serial;
+ char *end;
Tcl_DString reply;
RegisteredInterp *riPtr;
@@ -1547,7 +1547,7 @@ SendEventProc(
break;
}
}
- Tcl_Preserve((ClientData) riPtr);
+ Tcl_Preserve(riPtr);
/*
* We must protect the interpreter because the script may enter
@@ -1555,7 +1555,7 @@ SendEventProc(
*/
remoteInterp = riPtr->interp;
- Tcl_Preserve((ClientData) remoteInterp);
+ Tcl_Preserve(remoteInterp);
result = Tcl_GlobalEval(remoteInterp, script);
@@ -1570,7 +1570,7 @@ SendEventProc(
Tcl_DStringAppend(&reply, Tcl_GetStringResult(remoteInterp),
-1);
if (result == TCL_ERROR) {
- CONST char *varValue;
+ const char *varValue;
varValue = Tcl_GetVar2(remoteInterp, "errorInfo",
NULL, TCL_GLOBAL_ONLY);
@@ -1586,8 +1586,8 @@ SendEventProc(
}
}
}
- Tcl_Release((ClientData) remoteInterp);
- Tcl_Release((ClientData) riPtr);
+ Tcl_Release(remoteInterp);
+ Tcl_Release(riPtr);
/*
* Return the result to the sender if a commWindow was specified
@@ -1613,7 +1613,7 @@ SendEventProc(
}
} else if ((*p == 'r') && (p[1] == 0)) {
int serial, code, gotSerial;
- char *errorInfo, *errorCode, *resultString;
+ const char *errorInfo, *errorCode, *resultString;
PendingCommand *pcPtr;
/*
@@ -1679,19 +1679,16 @@ SendEventProc(
}
pcPtr->code = code;
if (resultString != NULL) {
- pcPtr->result = (char *) ckalloc((unsigned)
- (strlen(resultString) + 1));
+ pcPtr->result = ckalloc(strlen(resultString) + 1);
strcpy(pcPtr->result, resultString);
}
if (code == TCL_ERROR) {
if (errorInfo != NULL) {
- pcPtr->errorInfo = (char *) ckalloc((unsigned)
- (strlen(errorInfo) + 1));
+ pcPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
strcpy(pcPtr->errorInfo, errorInfo);
}
if (errorCode != NULL) {
- pcPtr->errorCode = (char *) ckalloc((unsigned)
- (strlen(errorCode) + 1));
+ pcPtr->errorCode = ckalloc(strlen(errorCode) + 1);
strcpy(pcPtr->errorCode, errorCode);
}
}
@@ -1747,7 +1744,7 @@ AppendPropCarefully(
Tk_ErrorHandler handler;
handler = Tk_CreateErrorHandler(display, -1, -1, -1, AppendErrorProc,
- (ClientData) pendingPtr);
+ pendingPtr);
XChangeProperty(display, window, property, XA_STRING, 8,
PropModeAppend, (unsigned char *) value, length);
Tk_DeleteErrorHandler(handler);
@@ -1764,9 +1761,9 @@ AppendErrorProc(
ClientData clientData, /* Command to mark complete, or NULL. */
XErrorEvent *errorPtr) /* Information about error. */
{
- PendingCommand *pendingPtr = (PendingCommand *) clientData;
+ PendingCommand *pendingPtr = clientData;
register PendingCommand *pcPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (pendingPtr == NULL) {
@@ -1780,8 +1777,7 @@ AppendErrorProc(
for (pcPtr = tsdPtr->pendingCommands; pcPtr != NULL;
pcPtr = pcPtr->nextPtr) {
if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) {
- pcPtr->result = (char *) ckalloc((unsigned)
- (strlen(pcPtr->target) + 50));
+ pcPtr->result = ckalloc(strlen(pcPtr->target) + 50);
sprintf(pcPtr->result, "no application named \"%s\"",
pcPtr->target);
pcPtr->code = TCL_ERROR;
@@ -1814,10 +1810,10 @@ DeleteProc(
ClientData clientData) /* Info about registration, passed as
* ClientData. */
{
- RegisteredInterp *riPtr = (RegisteredInterp *) clientData;
+ RegisteredInterp *riPtr = clientData;
register RegisteredInterp *riPtr2;
NameRegistry *regPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1);
@@ -1835,10 +1831,10 @@ DeleteProc(
}
}
}
- ckfree((char *) riPtr->name);
+ ckfree(riPtr->name);
riPtr->interp = NULL;
UpdateCommWindow(riPtr->dispPtr);
- Tcl_EventuallyFree((ClientData) riPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(riPtr, TCL_DYNAMIC);
}
/*
@@ -1906,7 +1902,7 @@ UpdateCommWindow(
{
Tcl_DString names;
RegisteredInterp *riPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DStringInit(&names);
@@ -1945,9 +1941,9 @@ TkpTestsendCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0],
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 1d66412..48d9021 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -28,7 +28,7 @@ typedef struct ProtocolHandler {
* 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
+ char command[1]; /* 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
@@ -36,16 +36,16 @@ typedef struct ProtocolHandler {
} ProtocolHandler;
#define HANDLER_SIZE(cmdLength) \
- ((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength))
+ ((unsigned) ((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength))
/*
* Data for [wm attributes] command:
*/
typedef struct {
- double alpha; /* Transparency; 0.0=transparent, 1.0=opaque */
- int topmost; /* Flag: true=>stay-on-top */
- int zoomed; /* Flag: true=>maximized */
- int fullscreen; /* Flag: true=>fullscreen */
+ double alpha; /* Transparency; 0.0=transparent, 1.0=opaque */
+ int topmost; /* Flag: true=>stay-on-top */
+ int zoomed; /* Flag: true=>maximized */
+ int fullscreen; /* Flag: true=>fullscreen */
} WmAttributes;
typedef enum {
@@ -53,7 +53,7 @@ typedef enum {
WMATT_TYPE, _WMATT_LAST_ATTRIBUTE
} WmAttribute;
-static const char *WmAttributeNames[] = {
+static const char *const WmAttributeNames[] = {
"-alpha", "-topmost", "-zoomed", "-fullscreen",
"-type", NULL
};
@@ -205,7 +205,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. */
- CONST char **cmdArgv; /* Array of strings to store in the WM_COMMAND
+ 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. */
@@ -289,17 +289,18 @@ typedef struct TkWmInfo {
static void TopLevelReqProc(ClientData dummy, Tk_Window tkwin);
static void RemapWindows(TkWindow *winPtr, TkWindow *parentPtr);
-static void MenubarReqProc(ClientData clientData, Tk_Window tkwin);
+static void MenubarReqProc(ClientData clientData,
+ Tk_Window tkwin);
static const Tk_GeomMgr wmMgrType = {
- "wm", /* name */
- TopLevelReqProc, /* requestProc */
- NULL, /* lostSlaveProc */
+ "wm", /* name */
+ TopLevelReqProc, /* requestProc */
+ NULL, /* lostSlaveProc */
};
static const Tk_GeomMgr menubarMgrType = {
- "menubar", /* name */
- MenubarReqProc, /* requestProc */
- NULL, /* lostSlaveProc */
+ "menubar", /* name */
+ MenubarReqProc, /* requestProc */
+ NULL, /* lostSlaveProc */
};
/*
@@ -328,7 +329,7 @@ static void GetMaxSize(WmInfo *wmPtr, int *maxWidthPtr,
int *maxHeightPtr);
static void MenubarDestroyProc(ClientData clientData,
XEvent *eventPtr);
-static int ParseGeometry(Tcl_Interp *interp, char *string,
+static int ParseGeometry(Tcl_Interp *interp, const char *string,
TkWindow *winPtr);
static void ReparentEvent(WmInfo *wmPtr, XReparentEvent *eventPtr);
static void PropertyEvent(WmInfo *wmPtr, XPropertyEvent *eventPtr);
@@ -355,108 +356,107 @@ static void WaitForConfigureNotify(TkWindow *winPtr,
static int WaitForEvent(Display *display,
WmInfo *wmInfoPtr, int type, XEvent *eventPtr);
static void WaitForMapNotify(TkWindow *winPtr, int mapped);
-static Tk_RestrictAction
- WaitRestrictProc(ClientData clientData,
- XEvent *eventPtr);
+static Tk_RestrictProc WaitRestrictProc;
static void WrapperEventProc(ClientData clientData,
XEvent *eventPtr);
-static void WmWaitMapProc(ClientData clientData, XEvent *eventPtr);
+static void WmWaitMapProc(ClientData clientData,
+ XEvent *eventPtr);
static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
-static int WmColormapwindowsCmd(Tk_Window tkwin, TkWindow *winPtr,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
+static int WmColormapwindowsCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
-static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Obj *const objv[]);
+static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
-static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr,
+ Tcl_Obj *const objv[]);
+static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
-static int WmOverrideredirectCmd(Tk_Window tkwin,TkWindow *winPtr,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
+static int WmOverrideredirectCmd(Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr);
/*
@@ -495,7 +495,7 @@ void TkWmCleanup(
ckfree(wmPtr->iconName);
}
if (wmPtr->iconDataPtr != NULL) {
- ckfree((char *) wmPtr->iconDataPtr);
+ ckfree(wmPtr->iconDataPtr);
}
if (wmPtr->leaderName != NULL) {
ckfree(wmPtr->leaderName);
@@ -507,22 +507,21 @@ void TkWmCleanup(
Tk_DestroyWindow((Tk_Window) wmPtr->wrapperPtr);
}
while (wmPtr->protPtr != NULL) {
- ProtocolHandler *protPtr;
+ ProtocolHandler *protPtr = wmPtr->protPtr;
- protPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr->nextPtr;
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
- ckfree((char *) wmPtr);
+ ckfree(wmPtr);
}
if (dispPtr->iconDataPtr != NULL) {
- ckfree((char *) dispPtr->iconDataPtr);
+ ckfree(dispPtr->iconDataPtr);
dispPtr->iconDataPtr = NULL;
}
}
@@ -551,7 +550,7 @@ TkWmNewWindow(
register WmInfo *wmPtr;
TkDisplay *dispPtr = winPtr->dispPtr;
- wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+ wmPtr = ckalloc(sizeof(WmInfo));
memset(wmPtr, 0, sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
@@ -569,6 +568,7 @@ TkWmNewWindow(
/*
* Initialize attributes.
*/
+
wmPtr->attributes.alpha = 1.0;
wmPtr->attributes.topmost = 0;
wmPtr->attributes.zoomed = 0;
@@ -611,7 +611,7 @@ TkWmNewWindow(
* window manager.
*/
- Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0);
+ Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, NULL);
}
/*
@@ -699,8 +699,8 @@ TkWmMapWindow(
unsigned long pid = (unsigned long) getpid();
Atom atom;
- XSetWMClientMachine(winPtr->display, wmPtr->wrapperPtr->window,
- &textProp);
+ XSetWMClientMachine(winPtr->display,
+ wmPtr->wrapperPtr->window, &textProp);
XFree((char *) textProp.value);
/*
@@ -728,16 +728,16 @@ TkWmMapWindow(
*/
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
return;
}
wmPtr->flags |= WM_ABOUT_TO_MAP;
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
wmPtr->flags &= ~WM_ABOUT_TO_MAP;
/*
@@ -840,7 +840,7 @@ TkWmDeadWindow(
ckfree(wmPtr->iconName);
}
if (wmPtr->iconDataPtr != NULL) {
- ckfree((char *) wmPtr->iconDataPtr);
+ ckfree(wmPtr->iconDataPtr);
}
if (wmPtr->hints.flags & IconPixmapHint) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
@@ -879,20 +879,19 @@ TkWmDeadWindow(
Tk_DestroyWindow((Tk_Window) wmPtr->wrapperPtr);
}
while (wmPtr->protPtr != NULL) {
- ProtocolHandler *protPtr;
+ ProtocolHandler *protPtr = wmPtr->protPtr;
- protPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr->nextPtr;
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
/*
@@ -904,8 +903,7 @@ TkWmDeadWindow(
if (wmPtr2->masterPtr == winPtr) {
wmPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr,
- StructureNotifyMask,
- WmWaitMapProc, (ClientData) wmPtr2->winPtr);
+ StructureNotifyMask, WmWaitMapProc, wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
XDeleteProperty(winPtr->display, wmPtr2->wrapperPtr->window,
@@ -932,10 +930,10 @@ TkWmDeadWindow(
wmPtr2->numTransients--;
}
Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
- StructureNotifyMask, WmWaitMapProc, (ClientData) winPtr);
+ StructureNotifyMask, WmWaitMapProc, winPtr);
wmPtr->masterPtr = NULL;
}
- ckfree((char *) wmPtr);
+ ckfree(wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -988,7 +986,7 @@ TkWmSetClass(
*
* Tk_WmObjCmd --
*
- * This function is invoked to process the "wm" Tcl command.
+ * This function is invoked to process the "wm" Tcl command.
*
*----------------------------------------------------------------------
*/
@@ -999,32 +997,30 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
- static CONST char *optionStrings[] = {
+ Tk_Window tkwin = clientData;
+ static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
- "command", "deiconify", "focusmodel", "forget", "frame",
- "geometry", "grid", "group", "iconbitmap",
- "iconify", "iconmask", "iconname",
- "iconphoto", "iconposition",
- "iconwindow", "manage", "maxsize", "minsize", "overrideredirect",
- "positionfrom", "protocol", "resizable", "sizefrom",
- "stackorder", "state", "title", "transient",
- "withdraw", NULL };
+ "command", "deiconify", "focusmodel", "forget",
+ "frame", "geometry", "grid", "group", "iconbitmap",
+ "iconify", "iconmask", "iconname", "iconphoto",
+ "iconposition", "iconwindow", "manage", "maxsize",
+ "minsize", "overrideredirect", "positionfrom",
+ "protocol", "resizable", "sizefrom", "stackorder",
+ "state", "title", "transient", "withdraw", NULL };
enum options {
WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
- WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET, WMOPT_FRAME,
- WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
- WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME,
- WMOPT_ICONPHOTO, WMOPT_ICONPOSITION,
- WMOPT_ICONWINDOW, WMOPT_MANAGE, 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;
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET,
+ WMOPT_FRAME, WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP,
+ WMOPT_ICONBITMAP,
+ WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPHOTO,
+ WMOPT_ICONPOSITION, WMOPT_ICONWINDOW, WMOPT_MANAGE, 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;
+ const char *argv1;
TkWindow *winPtr;
Tk_Window targetWin;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -1039,6 +1035,7 @@ Tk_WmObjCmd(
if ((argv1[0] == 't') && (strncmp(argv1, "tracing", (size_t) length) == 0)
&& (length >= 3)) {
int wmTracing;
+
if ((objc != 2) && (objc != 3)) {
Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
return TCL_ERROR;
@@ -1174,7 +1171,7 @@ WmAspectCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int numer1, denom1, numer2, denom2;
@@ -1245,6 +1242,7 @@ WmSetAttribute(
Tcl_Obj *value) /* New value */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
+
switch (attribute) {
case WMATT_ALPHA: {
unsigned long opacity; /* 0=transparent, 0xFFFFFFFF=opaque */
@@ -1267,27 +1265,26 @@ WmSetAttribute(
opacity = 0xFFFFFFFFul * wmPtr->reqState.alpha;
XChangeProperty(winPtr->display, wmPtr->wrapperPtr->window,
Tk_InternAtom((Tk_Window) winPtr, "_NET_WM_WINDOW_OPACITY"),
- XA_CARDINAL, 32, PropModeReplace,
- (unsigned char *)&opacity, 1L);
+ XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &opacity,
+ 1L);
wmPtr->attributes.alpha = wmPtr->reqState.alpha;
break;
}
case WMATT_TOPMOST:
- if (TCL_OK != Tcl_GetBooleanFromObj(interp, value,
- &wmPtr->reqState.topmost)) {
+ if (Tcl_GetBooleanFromObj(interp, value,
+ &wmPtr->reqState.topmost) != TCL_OK) {
return TCL_ERROR;
}
- SetNetWmState(winPtr, "_NET_WM_STATE_ABOVE",
- wmPtr->reqState.topmost);
+ SetNetWmState(winPtr, "_NET_WM_STATE_ABOVE", wmPtr->reqState.topmost);
break;
case WMATT_TYPE:
if (TCL_OK != SetNetWmType(winPtr, value))
return TCL_ERROR;
break;
case WMATT_ZOOMED:
- if (TCL_OK != Tcl_GetBooleanFromObj(interp, value,
- &wmPtr->reqState.zoomed)) {
+ if (Tcl_GetBooleanFromObj(interp, value,
+ &wmPtr->reqState.zoomed) != TCL_OK) {
return TCL_ERROR;
}
SetNetWmState(winPtr, "_NET_WM_STATE_MAXIMIZED_VERT",
@@ -1296,8 +1293,8 @@ WmSetAttribute(
wmPtr->reqState.zoomed);
break;
case WMATT_FULLSCREEN:
- if (TCL_OK != Tcl_GetBooleanFromObj(interp, value,
- &wmPtr->reqState.fullscreen)) {
+ if (Tcl_GetBooleanFromObj(interp, value,
+ &wmPtr->reqState.fullscreen) != TCL_OK) {
return TCL_ERROR;
}
SetNetWmState(winPtr, "_NET_WM_STATE_FULLSCREEN",
@@ -1377,7 +1374,7 @@ WmAttributesCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int attribute = 0;
@@ -1394,7 +1391,7 @@ WmAttributesCmd(
return TCL_OK;
} else if (objc == 4) { /* wm attributes $win -attribute */
if (Tcl_GetIndexFromObj(interp, objv[3], WmAttributeNames,
- "attribute", 0, &attribute) != TCL_OK) {
+ "attribute", 0, &attribute) != TCL_OK) {
return TCL_ERROR;
}
Tcl_SetObjResult(interp, WmGetAttribute(winPtr, attribute));
@@ -1441,10 +1438,10 @@ WmClientCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
if ((objc != 3) && (objc != 4)) {
@@ -1460,7 +1457,7 @@ WmClientCmd(
argv3 = Tcl_GetStringFromObj(objv[3], &length);
if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
wmPtr->clientMachine = NULL;
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
@@ -1471,9 +1468,9 @@ WmClientCmd(
return TCL_OK;
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
- wmPtr->clientMachine = ckalloc((unsigned) length + 1);
+ wmPtr->clientMachine = ckalloc(length + 1);
strcpy(wmPtr->clientMachine, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XTextProperty textProp;
@@ -1497,8 +1494,7 @@ WmClientCmd(
XChangeProperty(winPtr->display, wmPtr->wrapperPtr->window,
Tk_InternAtom((Tk_Window) winPtr, "_NET_WM_PID"),
- XA_CARDINAL,32, PropModeReplace, (unsigned char *) &pid,
- 1);
+ XA_CARDINAL,32, PropModeReplace, (unsigned char*)&pid, 1);
}
Tcl_DStringFree(&ds);
}
@@ -1528,7 +1524,7 @@ WmColormapwindowsCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Window *cmapList;
@@ -1555,8 +1551,8 @@ WmColormapwindowsCmd(
&& (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
break;
}
- winPtr2 = (TkWindow *) Tk_IdToWindow(winPtr->display,
- cmapList[i]);
+ winPtr2 = (TkWindow *)
+ Tk_IdToWindow(winPtr->display, cmapList[i]);
if (winPtr2 == NULL) {
sprintf(buffer, "0x%lx", cmapList[i]);
Tcl_AppendElement(interp, buffer);
@@ -1571,15 +1567,14 @@ WmColormapwindowsCmd(
!= TCL_OK) {
return TCL_ERROR;
}
- cmapList = (Window *) ckalloc((unsigned)
- (windowObjc+1) * sizeof(Window));
+ cmapList = ckalloc((windowObjc+1) * sizeof(Window));
gotToplevel = 0;
for (i = 0; i < windowObjc; i++) {
Tk_Window mapWin;
if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
&mapWin) != TCL_OK) {
- ckfree((char *) cmapList);
+ ckfree(cmapList);
return TCL_ERROR;
}
winPtr2 = (TkWindow *) mapWin;
@@ -1601,7 +1596,7 @@ WmColormapwindowsCmd(
wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
XSetWMColormapWindows(winPtr->display, wmPtr->wrapperPtr->window,
cmapList, windowObjc);
- ckfree((char *) cmapList);
+ ckfree(cmapList);
return TCL_OK;
}
@@ -1628,12 +1623,12 @@ WmCommandCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int cmdArgc;
- CONST char **cmdArgv;
+ const char **cmdArgv;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
@@ -1641,16 +1636,16 @@ WmCommandCmd(
}
if (objc == 3) {
if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
- TCL_DYNAMIC);
+ char *arg = Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv);
+
+ Tcl_SetResult(interp, arg, TCL_DYNAMIC);
}
return TCL_OK;
}
argv3 = Tcl_GetString(objv[3]);
if (argv3[0] == 0) {
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
wmPtr->cmdArgv = NULL;
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
@@ -1663,7 +1658,7 @@ WmCommandCmd(
return TCL_ERROR;
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
wmPtr->cmdArgc = cmdArgc;
wmPtr->cmdArgv = cmdArgv;
@@ -1696,7 +1691,7 @@ WmDeiconifyCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -1742,10 +1737,10 @@ WmFocusmodelCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"active", "passive", NULL };
enum options {
OPT_ACTIVE, OPT_PASSIVE };
@@ -1779,8 +1774,8 @@ WmFocusmodelCmd(
*
* WmForgetCmd --
*
- * This procedure is invoked to process the "wm forget" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm forget" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1792,12 +1787,12 @@ WmFocusmodelCmd(
*/
static int
-WmForgetCmd(tkwin, winPtr, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- TkWindow *winPtr; /* Toplevel or Frame to work with */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+WmForgetCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Tk_Window frameWin = (Tk_Window) winPtr;
@@ -1805,13 +1800,19 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv)
TkFocusJoin(winPtr);
Tk_UnmapWindow(frameWin);
TkWmDeadWindow(winPtr);
- winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+ winPtr->flags &=
+ ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
RemapWindows(winPtr, winPtr->parentPtr);
- /* flags (above) must be cleared before calling */
- /* TkMapTopFrame (below) */
+
+ /*
+ * Flags (above) must be cleared before calling TkMapTopFrame (below).
+ */
+
TkMapTopFrame(frameWin);
} else {
- /* Already not managed by wm - ignore it */
+ /*
+ * Already not managed by wm - ignore it.
+ */
}
return TCL_OK;
}
@@ -1839,7 +1840,7 @@ WmFrameCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Window window;
@@ -1853,7 +1854,7 @@ WmFrameCmd(
if (window == None) {
window = Tk_WindowId((Tk_Window) winPtr);
}
- sprintf(buf, "0x%x", (unsigned int) window);
+ sprintf(buf, "0x%x", (unsigned) window);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_OK;
}
@@ -1881,12 +1882,12 @@ WmGeometryCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
char xSign, ySign;
int width, height;
- char *argv3;
+ const char *argv3;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
@@ -1944,7 +1945,7 @@ WmGridCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int reqWidth, reqHeight, widthInc, heightInc;
@@ -2034,12 +2035,12 @@ WmGroupCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
WmInfo *wmPtr2;
- char *argv3;
+ const char *argv3;
int length;
if ((objc != 3) && (objc != 4)) {
@@ -2080,7 +2081,7 @@ WmGroupCmd(
}
wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) length + 1);
+ wmPtr->leaderName = ckalloc(length + 1);
strcpy(wmPtr->leaderName, argv3);
}
UpdateHints(winPtr);
@@ -2110,11 +2111,11 @@ WmIconbitmapCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Pixmap pixmap;
- char *argv3;
+ const char *argv3;
if ((objc < 3) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
@@ -2123,7 +2124,8 @@ WmIconbitmapCmd(
if (objc == 3) {
if (wmPtr->hints.flags & IconPixmapHint) {
Tcl_SetResult(interp, (char *)
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
+ Tk_NameOfBitmap(winPtr->display,
+ wmPtr->hints.icon_pixmap),
TCL_STATIC);
}
return TCL_OK;
@@ -2170,9 +2172,10 @@ WmIconifyCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
@@ -2229,11 +2232,11 @@ WmIconmaskCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Pixmap pixmap;
- char *argv3;
+ const char *argv3;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
@@ -2288,10 +2291,10 @@ WmIconnameCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
if (objc > 4) {
@@ -2305,10 +2308,10 @@ WmIconnameCmd(
return TCL_OK;
} else {
if (wmPtr->iconName != NULL) {
- ckfree((char *) wmPtr->iconName);
+ ckfree(wmPtr->iconName);
}
argv3 = Tcl_GetStringFromObj(objv[3], &length);
- wmPtr->iconName = ckalloc((unsigned) length + 1);
+ wmPtr->iconName = ckalloc(length + 1);
strcpy(wmPtr->iconName, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
UpdateTitle(winPtr);
@@ -2340,7 +2343,7 @@ WmIconphotoCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_PhotoHandle photo;
@@ -2391,8 +2394,7 @@ WmIconphotoCmd(
* defines CARD32 arrays to use. [Bug 2902814]
*/
- iconPropertyData = (unsigned long *)
- attemptckalloc(sizeof(unsigned long) * size);
+ iconPropertyData = attemptckalloc(sizeof(unsigned long) * size);
if (iconPropertyData == NULL) {
return TCL_ERROR;
}
@@ -2422,14 +2424,12 @@ WmIconphotoCmd(
* A, low byte being B. The first two cardinals are width, height.
* Data is in rows, left to right and top to bottom. The data will be
* endian-swapped going to the server if necessary. [Bug 2830420]
+ *
+ * The image data will be encoded in the iconPropertyData array.
*/
- /*
- * Encode the image data in the iconPropertyData array.
- */
-
- iconPropertyData[index++] = (unsigned) width;
- iconPropertyData[index++] = (unsigned) height;
+ iconPropertyData[index++] = (unsigned long) width;
+ iconPropertyData[index++] = (unsigned long) height;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
register unsigned char *pixelPtr =
@@ -2445,12 +2445,12 @@ WmIconphotoCmd(
}
}
if (wmPtr->iconDataPtr != NULL) {
- ckfree((char *) wmPtr->iconDataPtr);
+ ckfree(wmPtr->iconDataPtr);
wmPtr->iconDataPtr = NULL;
}
if (isDefault) {
if (winPtr->dispPtr->iconDataPtr != NULL) {
- ckfree((char *) winPtr->dispPtr->iconDataPtr);
+ ckfree(winPtr->dispPtr->iconDataPtr);
}
winPtr->dispPtr->iconDataPtr = (unsigned char *) iconPropertyData;
winPtr->dispPtr->iconDataSize = size;
@@ -2487,7 +2487,7 @@ WmIconpositionCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y;
@@ -2506,11 +2506,11 @@ WmIconpositionCmd(
}
return TCL_OK;
}
- if (*Tcl_GetString(objv[3]) == '\0') {
+ if (Tcl_GetString(objv[3])[0] == '\0') {
wmPtr->hints.flags &= ~IconPositionHint;
} else {
if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
return TCL_ERROR;
}
wmPtr->hints.icon_x = x;
@@ -2544,7 +2544,7 @@ WmIconwindowCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
@@ -2557,7 +2557,7 @@ WmIconwindowCmd(
}
if (objc == 3) {
if (wmPtr->icon != NULL) {
- Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon));
}
return TCL_OK;
}
@@ -2597,6 +2597,7 @@ WmIconwindowCmd(
}
if (wmPtr->icon != NULL) {
WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+
wmPtr3->iconFor = NULL;
wmPtr3->withdrawn = 1;
wmPtr3->hints.initial_state = WithdrawnState;
@@ -2641,8 +2642,8 @@ WmIconwindowCmd(
*
* WmManageCmd --
*
- * This procedure is invoked to process the "wm manage" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm manage" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2654,26 +2655,27 @@ WmIconwindowCmd(
*/
static int
-WmManageCmd(tkwin, winPtr, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- TkWindow *winPtr; /* Toplevel or Frame to work with */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+WmManageCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Tk_Window frameWin = (Tk_Window) winPtr;
register WmInfo *wmPtr = winPtr->wmInfoPtr;
if (!Tk_IsTopLevel(frameWin)) {
if (!Tk_IsManageable(frameWin)) {
- Tcl_AppendResult(interp, "window \"",
- Tk_PathName(frameWin), "\" is not manageable: must be "
- "a frame, labelframe or toplevel", NULL);
+ Tcl_AppendResult(interp, "window \"", Tk_PathName(frameWin),
+ "\" is not manageable: must be a frame, labelframe or "
+ "toplevel", NULL);
return TCL_ERROR;
}
TkFocusSplit(winPtr);
Tk_UnmapWindow(frameWin);
- winPtr->flags |= TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED;
+ winPtr->flags |=
+ TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED;
if (wmPtr == NULL) {
TkWmNewWindow(winPtr);
TkWmMapWindow(winPtr);
@@ -2682,11 +2684,16 @@ WmManageCmd(tkwin, winPtr, interp, objc, objv)
wmPtr = winPtr->wmInfoPtr;
winPtr->flags &= ~TK_MAPPED;
RemapWindows(winPtr, wmPtr->wrapperPtr);
- /* flags (above) must be set before calling */
- /* TkMapTopFrame (below) */
- TkMapTopFrame (frameWin);
+
+ /*
+ * Flags (above) must be set before calling TkMapTopFrame (below).
+ */
+
+ TkMapTopFrame(frameWin);
} else if (Tk_IsTopLevel(frameWin)) {
- /* Already managed by wm - ignore it */
+ /*
+ * Already managed by wm - ignore it.
+ */
}
return TCL_OK;
}
@@ -2714,7 +2721,7 @@ WmMaxsizeCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -2772,7 +2779,7 @@ WmMinsizeCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -2822,7 +2829,7 @@ WmOverrideredirectCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int boolean, curValue;
XSetWindowAttributes atts;
@@ -2833,7 +2840,7 @@ WmOverrideredirectCmd(
}
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
if (objc == 3) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -2880,10 +2887,10 @@ WmPositionfromCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
@@ -2944,12 +2951,12 @@ WmProtocolCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
register ProtocolHandler *protPtr, *prevPtr;
Atom protocol;
- char *cmd;
+ const char *cmd;
int cmdLength;
if ((objc < 3) || (objc > 5)) {
@@ -3007,13 +3014,13 @@ WmProtocolCmd(
} else {
prevPtr->nextPtr = protPtr->nextPtr;
}
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
break;
}
}
cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr = ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
@@ -3049,7 +3056,7 @@ WmResizableCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -3109,10 +3116,10 @@ WmSizefromCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL };
enum options {
OPT_PROGRAM, OPT_USER };
@@ -3174,10 +3181,10 @@ WmStackorderCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
TkWindow **windows, **window_ptr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"isabove", "isbelow", NULL };
enum options {
OPT_ISABOVE, OPT_ISBELOW };
@@ -3195,7 +3202,7 @@ WmStackorderCmd(
for (window_ptr = windows; *window_ptr ; window_ptr++) {
Tcl_AppendElement(interp, (*window_ptr)->pathName);
}
- ckfree((char *) windows);
+ ckfree(windows);
return TCL_OK;
}
} else {
@@ -3236,18 +3243,18 @@ WmStackorderCmd(
if (windows == NULL) {
Tcl_AppendResult(interp, "TkWmStackorderToplevel failed", 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);
- }
+ }
+
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr) {
+ index1 = (window_ptr - windows);
+ }
+ if (*window_ptr == winPtr2) {
+ index2 = (window_ptr - windows);
}
- /* ASSERT: index1 != -1 && index2 != -2 [Bug 1789819] */
- ckfree((char *) windows);
}
+ /* ASSERT: index1 != -1 && index2 != -2 [Bug 1789819] */
+ ckfree(windows);
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
&index) != TCL_OK) {
@@ -3258,7 +3265,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
return TCL_OK;
}
return TCL_OK;
@@ -3287,10 +3294,10 @@ WmStateCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"normal", "iconic", "withdrawn", NULL };
enum options {
OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN };
@@ -3381,10 +3388,10 @@ WmTitleCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
if (objc > 4) {
@@ -3398,10 +3405,10 @@ WmTitleCmd(
return TCL_OK;
} else {
if (wmPtr->title != NULL) {
- ckfree((char *) wmPtr->title);
+ ckfree(wmPtr->title);
}
argv3 = Tcl_GetStringFromObj(objv[3], &length);
- wmPtr->title = ckalloc((unsigned) length + 1);
+ wmPtr->title = ckalloc(length + 1);
strcpy(wmPtr->title, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -3434,7 +3441,7 @@ WmTransientCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow *masterPtr = wmPtr->masterPtr;
@@ -3446,7 +3453,7 @@ WmTransientCmd(
}
if (objc == 3) {
if (masterPtr != NULL) {
- Tcl_SetResult(interp, Tk_PathName(masterPtr), TCL_STATIC);
+ Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr));
}
return TCL_OK;
}
@@ -3459,7 +3466,7 @@ WmTransientCmd(
masterPtr->wmInfoPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) masterPtr, StructureNotifyMask,
- WmWaitMapProc, (ClientData) winPtr);
+ WmWaitMapProc, winPtr);
/*
* FIXME: Need a call like Win32's UpdateWrapper() so we can
@@ -3518,13 +3525,12 @@ WmTransientCmd(
if (wmPtr->masterPtr != NULL) {
wmPtr->masterPtr->wmInfoPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
- StructureNotifyMask,
- WmWaitMapProc, (ClientData) winPtr);
+ StructureNotifyMask, WmWaitMapProc, winPtr);
}
masterPtr->wmInfoPtr->numTransients++;
Tk_CreateEventHandler((Tk_Window) masterPtr,
- StructureNotifyMask, WmWaitMapProc, (ClientData) winPtr);
+ StructureNotifyMask, WmWaitMapProc, winPtr);
wmPtr->masterPtr = masterPtr;
}
@@ -3544,7 +3550,7 @@ WmTransientCmd(
wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window);
} else {
XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
- Tk_InternAtom((Tk_Window) winPtr, "WM_TRANSIENT_FOR"));
+ Tk_InternAtom((Tk_Window) winPtr,"WM_TRANSIENT_FOR"));
}
}
}
@@ -3574,7 +3580,7 @@ WmWithdrawCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -3608,7 +3614,7 @@ WmUpdateGeom(
TkWindow *winPtr)
{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3623,7 +3629,7 @@ WmWaitMapProc(
ClientData clientData, /* Pointer to window. */
XEvent *eventPtr) /* Information about event. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr;
if (masterPtr == NULL) {
@@ -3750,7 +3756,7 @@ Tk_SetGrid(
wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc;
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3818,7 +3824,7 @@ Tk_UnsetGrid(
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -4043,7 +4049,7 @@ ReparentEvent(
Atom actualType;
int actualFormat;
unsigned long numItems, bytesAfter;
- unsigned int dummy;
+ unsigned dummy;
Tk_ErrorHandler handler;
TkDisplay *dispPtr = wmPtr->winPtr->dispPtr;
@@ -4083,7 +4089,7 @@ ReparentEvent(
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);
+ (unsigned) reparentEventPtr->parent, (unsigned) vRoot);
}
/*
@@ -4170,7 +4176,7 @@ ComputeReparentGeometry(
{
TkWindow *wrapperPtr = wmPtr->wrapperPtr;
int width, height, bd;
- unsigned int dummy;
+ unsigned dummy;
int xOffset, yOffset, x, y;
Window dummy2;
Status status;
@@ -4181,8 +4187,8 @@ ComputeReparentGeometry(
(void) XTranslateCoordinates(wrapperPtr->display, wrapperPtr->window,
wmPtr->reparent, 0, 0, &xOffset, &yOffset, &dummy2);
status = XGetGeometry(wrapperPtr->display, wmPtr->reparent,
- &dummy2, &x, &y, (unsigned int *) &width,
- (unsigned int *) &height, (unsigned int *) &bd, &dummy);
+ &dummy2, &x, &y, (unsigned *) &width, (unsigned *) &height,
+ (unsigned *) &bd, &dummy);
Tk_DeleteErrorHandler(handler);
if (status == 0) {
/*
@@ -4308,15 +4314,15 @@ PropertyEvent(
*----------------------------------------------------------------------
*/
-static const unsigned int WrapperEventMask =
- (StructureNotifyMask | PropertyChangeMask);
+static const unsigned WrapperEventMask =
+ (StructureNotifyMask | PropertyChangeMask);
static void
WrapperEventProc(
ClientData clientData, /* Information about toplevel window. */
XEvent *eventPtr) /* Event that just happened. */
{
- WmInfo *wmPtr = (WmInfo *) clientData;
+ WmInfo *wmPtr = clientData;
XEvent mapEvent;
TkDisplay *dispPtr = wmPtr->winPtr->dispPtr;
@@ -4403,10 +4409,11 @@ TopLevelReqProc(
Tk_Window tkwin) /* Information about window. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
- WmInfo *wmPtr;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
- if ((wmPtr = winPtr->wmInfoPtr) == NULL)
+ if (wmPtr == NULL) {
return;
+ }
if ((wmPtr->width >= 0) && (wmPtr->height >= 0)) {
/*
@@ -4426,7 +4433,7 @@ TopLevelReqProc(
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
@@ -4465,7 +4472,7 @@ static void
UpdateGeometryInfo(
ClientData clientData) /* Pointer to the window's record. */
{
- register TkWindow *winPtr = (TkWindow *) clientData;
+ register TkWindow *winPtr = clientData;
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, min, max;
unsigned long serial;
@@ -4594,7 +4601,7 @@ UpdateGeometryInfo(
* Reconfigure the wrapper if it isn't already configured correctly. A few
* tricky points:
*
- * 1. If the window is embeddedand the container is also in this process,
+ * 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.
@@ -4635,7 +4642,7 @@ UpdateGeometryInfo(
height += wmPtr->menuHeight;
if (wmPtr->flags & WM_MOVE_PENDING) {
if ((x + wmPtr->xInParent == winPtr->changes.x) &&
- (y + wmPtr->yInParent + wmPtr->menuHeight == winPtr->changes.y)
+ (y+wmPtr->yInParent+wmPtr->menuHeight == winPtr->changes.y)
&& (width == wmPtr->wrapperPtr->changes.width)
&& (height == wmPtr->wrapperPtr->changes.height)) {
/*
@@ -5158,8 +5165,8 @@ WaitForEvent(
XEvent *eventPtr) /* Place to store event. */
{
WaitRestrictInfo info;
- Tk_RestrictProc *oldRestrictProc;
- ClientData oldRestrictData;
+ Tk_RestrictProc *prevProc;
+ ClientData prevArg;
Tcl_Time timeout;
/*
@@ -5173,8 +5180,7 @@ WaitForEvent(
info.type = type;
info.eventPtr = eventPtr;
info.foundEvent = 0;
- oldRestrictProc = Tk_RestrictEvents(WaitRestrictProc, (ClientData) &info,
- &oldRestrictData);
+ prevProc = Tk_RestrictEvents(WaitRestrictProc, &info, &prevArg);
Tcl_GetTime(&timeout);
timeout.sec += 2;
@@ -5184,8 +5190,7 @@ WaitForEvent(
break;
}
}
- (void) Tk_RestrictEvents(oldRestrictProc, oldRestrictData,
- &oldRestrictData);
+ Tk_RestrictEvents(prevProc, prevArg, &prevArg);
if (info.foundEvent) {
return TCL_OK;
}
@@ -5218,7 +5223,7 @@ WaitRestrictProc(
ClientData clientData, /* Pointer to WaitRestrictInfo structure. */
XEvent *eventPtr) /* Event that is about to be handled. */
{
- WaitRestrictInfo *infoPtr = (WaitRestrictInfo *) clientData;
+ WaitRestrictInfo *infoPtr = clientData;
if (eventPtr->type == ReparentNotify) {
return TK_PROCESS_EVENT;
@@ -5373,13 +5378,14 @@ SetNetWmType(TkWindow *winPtr, Tcl_Obj *typePtr)
}
if (objc > 0) {
- atoms = (Atom *)ckalloc(sizeof(Atom) * objc);
+ atoms = ckalloc(sizeof(Atom) * objc);
}
for (n = 0; n < objc; ++n) {
Tcl_DString ds, dsName;
int len;
char *name = Tcl_GetStringFromObj(objv[n], &len);
+
Tcl_UtfToUpper(name);
Tcl_UtfToExternalDString(NULL, name, len, &dsName);
Tcl_DStringInit(&ds);
@@ -5401,7 +5407,7 @@ SetNetWmType(TkWindow *winPtr, Tcl_Obj *typePtr)
XChangeProperty(Tk_Display(tkwin), wrapperPtr->window, typeAtom,
XA_ATOM, 32, PropModeReplace, (unsigned char *) atoms, objc);
- ckfree((char *)atoms);
+ ckfree(atoms);
return TCL_OK;
}
@@ -5483,7 +5489,7 @@ GetNetWmType(TkWindow *winPtr)
static int
ParseGeometry(
Tcl_Interp *interp, /* Used for error reporting. */
- char *string, /* String containing new geometry. Has the
+ const 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. */
@@ -5491,7 +5497,7 @@ ParseGeometry(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, flags;
char *end;
- register char *p = string;
+ register const char *p = string;
/*
* The leading "=" is optional.
@@ -5584,7 +5590,7 @@ ParseGeometry(
wmPtr->flags = flags;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
return TCL_OK;
@@ -5916,7 +5922,7 @@ UpdateVRootGeometry(
{
TkWindow *winPtr = wmPtr->winPtr;
int bd;
- unsigned int dummy;
+ unsigned dummy;
Window dummy2;
Status status;
Tk_ErrorHandler handler;
@@ -5942,8 +5948,8 @@ UpdateVRootGeometry(
handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, NULL, NULL);
status = XGetGeometry(winPtr->display, wmPtr->vRoot,
&dummy2, &wmPtr->vRootX, &wmPtr->vRootY,
- (unsigned int *) &wmPtr->vRootWidth,
- (unsigned int *) &wmPtr->vRootHeight, (unsigned int *) &bd,
+ (unsigned *) &wmPtr->vRootWidth,
+ (unsigned *) &wmPtr->vRootHeight, (unsigned *) &bd,
&dummy);
if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("UpdateVRootGeometry: x = %d, y = %d, width = %d, ",
@@ -6074,9 +6080,9 @@ Tk_MoveToplevelWindow(
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
}
}
@@ -6119,7 +6125,7 @@ UpdateWmProtocols(
protPtr = protPtr->nextPtr, count++) {
/* Empty loop body; we're just counting the handlers. */
}
- arrayPtr = (Atom *) ckalloc((unsigned) count * sizeof(Atom));
+ arrayPtr = ckalloc(count * sizeof(Atom));
deleteWindowAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr,
"WM_DELETE_WINDOW");
pingAtom = Tk_InternAtom((Tk_Window) wmPtr->winPtr, "_NET_WM_PING");
@@ -6136,7 +6142,7 @@ UpdateWmProtocols(
Tk_InternAtom((Tk_Window) wmPtr->winPtr, "WM_PROTOCOLS"),
XA_ATOM, 32, PropModeReplace, (unsigned char *) arrayPtr,
atomPtr-arrayPtr);
- ckfree((char *) arrayPtr);
+ ckfree(arrayPtr);
}
/*
@@ -6166,7 +6172,7 @@ TkWmProtocolEventProc(
register ProtocolHandler *protPtr;
Atom protocol;
int result;
- CONST char *protocolName;
+ const char *protocolName;
Tcl_Interp *interp;
protocol = (Atom) eventPtr->xclient.data.l[0];
@@ -6203,19 +6209,18 @@ TkWmProtocolEventProc(
for (protPtr = wmPtr->protPtr; protPtr != NULL;
protPtr = protPtr->nextPtr) {
if (protocol == protPtr->protocol) {
- Tcl_Preserve((ClientData) protPtr);
+ Tcl_Preserve(protPtr);
interp = protPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
result = Tcl_GlobalEval(interp, protPtr->command);
if (result != TCL_OK) {
- Tcl_AddErrorInfo(interp, "\n (command for \"");
- Tcl_AddErrorInfo(interp, protocolName);
- Tcl_AddErrorInfo(interp,
- "\" window manager protocol)");
- Tcl_BackgroundError(interp);
+ Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
+ "\n (command for \"%s\" window manager protocol)",
+ protocolName));
+ Tcl_BackgroundException(interp, result);
}
- Tcl_Release((ClientData) interp);
- Tcl_Release((ClientData) protPtr);
+ Tcl_Release(interp);
+ Tcl_Release(protPtr);
return;
}
}
@@ -6300,7 +6305,7 @@ TkWmStackorderToplevel(
{
Window dummy1, dummy2, vRoot;
Window *children;
- unsigned int numChildren, i;
+ unsigned numChildren, i;
TkWindow *childWinPtr, **windows, **window_ptr;
Tcl_HashTable table;
Tcl_HashEntry *hPtr;
@@ -6313,8 +6318,7 @@ TkWmStackorderToplevel(
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
- window_ptr = windows = (TkWindow **)
- ckalloc((table.numEntries+1) * sizeof(TkWindow *));
+ window_ptr = windows = ckalloc((table.numEntries+1) * sizeof(TkWindow *));
/*
* Special cases: If zero or one toplevels were mapped there is no need to
@@ -6339,7 +6343,7 @@ TkWmStackorderToplevel(
if (XQueryTree(parentPtr->display, vRoot, &dummy1, &dummy2,
&children, &numChildren) == 0) {
- ckfree((char *) windows);
+ ckfree(windows);
windows = NULL;
} else {
for (i = 0; i < numChildren; i++) {
@@ -6389,7 +6393,7 @@ TkWmRestackToplevel(
* below *all* siblings. */
{
XWindowChanges changes;
- unsigned int mask;
+ unsigned mask;
TkWindow *wrapperPtr;
memset(&changes, 0, sizeof(XWindowChanges));
@@ -6515,7 +6519,7 @@ TkWmAddToColormapWindows(
* add the toplevel itself as the last element of the list.
*/
- newPtr = (Window *) ckalloc((unsigned) (count+2) * sizeof(Window));
+ newPtr = ckalloc((count+2) * sizeof(Window));
for (i = 0; i < count; i++) {
newPtr[i] = oldPtr[i];
}
@@ -6526,7 +6530,7 @@ TkWmAddToColormapWindows(
newPtr[count] = topPtr->window;
XSetWMColormapWindows(topPtr->display, wrapperPtr->window, newPtr,
count+1);
- ckfree((char *) newPtr);
+ ckfree(newPtr);
if (oldPtr != NULL) {
XFree((char *) oldPtr);
}
@@ -6656,7 +6660,7 @@ TkGetPointerCoords(
WmInfo *wmPtr;
Window w, root, child;
int rootX, rootY;
- unsigned int mask;
+ unsigned mask;
wmPtr = winPtr->wmInfoPtr;
@@ -6765,8 +6769,8 @@ TkSetTransientFor(Tk_Window tkwin, Tk_Window parent)
*
* TkpMakeMenuWindow --
*
- * Configure the window to be either a pull-down (or pop-up) menu, or as
- * a toplevel (torn-off) menu or palette.
+ * Configure the window to be either a pull-down menu, a pop-up menu, or
+ * as a toplevel (torn-off) menu or palette.
*
* Results:
* None.
@@ -6780,11 +6784,14 @@ TkSetTransientFor(Tk_Window tkwin, Tk_Window parent)
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 torn-off menu.
+ int typeFlag) /* TK_MAKE_MENU_DROPDOWN means menu is only
+ * posted briefly as a pulldown or cascade,
+ * TK_MAKE_MENU_POPUP means it is a popup.
+ * TK_MAKE_MENU_TEAROFF means menu is always
+ * visible, e.g. as a torn-off menu.
* Determines whether save_under and
- * override_redirect should be set. */
+ * override_redirect should be set, plus how
+ * to flag it for the window manager. */
{
WmInfo *wmPtr;
XSetWindowAttributes atts;
@@ -6799,15 +6806,19 @@ TkpMakeMenuWindow(
CreateWrapper(wmPtr);
}
wrapperPtr = wmPtr->wrapperPtr;
- if (transient) {
- atts.override_redirect = True;
- atts.save_under = True;
- typeObj = Tcl_NewStringObj("dropdown_menu", -1);
- } else {
+ if (typeFlag == TK_MAKE_MENU_TEAROFF) {
atts.override_redirect = False;
atts.save_under = False;
typeObj = Tcl_NewStringObj("menu", -1);
- TkSetTransientFor(tkwin, None);
+ TkSetTransientFor(tkwin, NULL);
+ } else {
+ atts.override_redirect = True;
+ atts.save_under = True;
+ if (typeFlag == TK_MAKE_MENU_DROPDOWN) {
+ typeObj = Tcl_NewStringObj("dropdown_menu", -1);
+ } else {
+ typeObj = Tcl_NewStringObj("popup_menu", -1);
+ }
}
SetNetWmType((TkWindow *)tkwin, typeObj);
@@ -6920,7 +6931,7 @@ CreateWrapper(
*/
Tk_CreateEventHandler((Tk_Window) wmPtr->wrapperPtr,
- WrapperEventMask, WrapperEventProc, (ClientData) wmPtr);
+ WrapperEventMask, WrapperEventProc, wmPtr);
}
/*
@@ -6989,9 +7000,13 @@ TkUnixSetMenubar(
Tk_Window parent;
TkWindow *menubarPtr = (TkWindow *) menubar;
- /* Could be a Frame (i.e. not a toplevel) */
- if (wmPtr == NULL)
+ /*
+ * Could be a Frame (i.e. not a toplevel).
+ */
+
+ if (wmPtr == NULL) {
return;
+ }
if (wmPtr->menubar != NULL) {
/*
@@ -7013,7 +7028,7 @@ TkUnixSetMenubar(
Tk_WindowId(wmPtr->menubar), Tk_WindowId(parent), 0, 0);
}
Tk_DeleteEventHandler(wmPtr->menubar, StructureNotifyMask,
- MenubarDestroyProc, (ClientData) wmPtr->menubar);
+ MenubarDestroyProc, wmPtr->menubar);
Tk_ManageGeometry(wmPtr->menubar, NULL, NULL);
}
@@ -7039,14 +7054,14 @@ TkUnixSetMenubar(
menubarPtr->wmInfoPtr = wmPtr;
Tk_MoveResizeWindow(menubar, 0, 0, Tk_Width(tkwin), wmPtr->menuHeight);
Tk_MapWindow(menubar);
- Tk_CreateEventHandler(menubar, StructureNotifyMask, MenubarDestroyProc,
- (ClientData) menubar);
- Tk_ManageGeometry(menubar, &menubarMgrType, (ClientData) wmPtr);
+ Tk_CreateEventHandler(menubar, StructureNotifyMask,
+ MenubarDestroyProc, menubar);
+ Tk_ManageGeometry(menubar, &menubarMgrType, wmPtr);
menubarPtr->flags |= TK_REPARENTED;
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) tkwin);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, tkwin);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -7085,7 +7100,7 @@ MenubarDestroyProc(
wmPtr->menuHeight = 0;
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) wmPtr->winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, wmPtr->winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -7113,7 +7128,7 @@ MenubarReqProc(
* for tkwin's toplevel. */
Tk_Window tkwin) /* Handle for menubar window. */
{
- WmInfo *wmPtr = (WmInfo *) clientData;
+ WmInfo *wmPtr = clientData;
wmPtr->menuHeight = Tk_ReqHeight(tkwin);
if (wmPtr->menuHeight <= 0) {
@@ -7121,7 +7136,7 @@ MenubarReqProc(
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) wmPtr->winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, wmPtr->winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -7195,8 +7210,8 @@ UpdateCommand(
* entire DString is done.
*/
- cmdArgv = (char **) ckalloc(sizeof(char *) * wmPtr->cmdArgc);
- offsets = (int *) ckalloc(sizeof(int) * wmPtr->cmdArgc);
+ cmdArgv = ckalloc(sizeof(char *) * wmPtr->cmdArgc);
+ offsets = ckalloc(sizeof(int) * wmPtr->cmdArgc);
Tcl_DStringInit(&cmds);
for (i = 0; i < wmPtr->cmdArgc; i++) {
Tcl_UtfToExternalDString(NULL, wmPtr->cmdArgv[i], -1, &ds);
@@ -7213,8 +7228,8 @@ UpdateCommand(
XSetCommand(winPtr->display, wmPtr->wrapperPtr->window,
cmdArgv, wmPtr->cmdArgc);
Tcl_DStringFree(&cmds);
- ckfree((char *) cmdArgv);
- ckfree((char *) offsets);
+ ckfree(cmdArgv);
+ ckfree(offsets);
}
/*
@@ -7299,10 +7314,10 @@ TkpWmSetState(
*----------------------------------------------------------------------
*/
-static void
-RemapWindows(winPtr, parentPtr)
- TkWindow *winPtr;
- TkWindow *parentPtr;
+static void
+RemapWindows(
+ TkWindow *winPtr,
+ TkWindow *parentPtr)
{
XWindowAttributes win_attr;
@@ -7310,7 +7325,7 @@ RemapWindows(winPtr, parentPtr)
XGetWindowAttributes(winPtr->display, winPtr->window, &win_attr);
if (parentPtr == NULL) {
XReparentWindow(winPtr->display, winPtr->window,
- XRootWindow(winPtr->display, winPtr->screenNum),
+ XRootWindow(winPtr->display, winPtr->screenNum),
win_attr.x, win_attr.y);
} else if (parentPtr->window) {
XReparentWindow(parentPtr->display, winPtr->window,
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 928c4d5..cbc0a5d 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -1,15 +1,6 @@
/*
* tkUnixXId.c --
*
- * This file provides a replacement function for the default X resource
- * allocator (_XAllocID). The problem with the default allocator is that
- * it never re-uses ids, which causes long-lived applications to crash
- * when X resource identifiers wrap around. The replacement functions in
- * this file re-use old identifiers to prevent this problem.
- *
- * The code in this file is based on similar implementations by
- * George C. Kaplan and Michael Hoegeman.
- *
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
@@ -17,170 +8,8 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-/*
- * The definition below is needed on some systems so that we can access the
- * resource_alloc field of Display structures in order to replace the resource
- * allocator.
- */
-
-#define XLIB_ILLEGAL_ACCESS 1
-
#include "tkUnixInt.h"
-/*
- * A structure of the following type is used to hold one or more available
- * resource identifiers. There is a list of these structures for each display.
- */
-
-#define IDS_PER_STACK 10
-typedef struct TkIdStack {
- XID ids[IDS_PER_STACK]; /* Array of free identifiers. */
- int numUsed; /* Indicates how many of the entries in ids
- * are currently in use. */
- TkDisplay *dispPtr; /* Display to which ids belong. */
- struct TkIdStack *nextPtr; /* Next bunch of free identifiers for the same
- * display. */
-} TkIdStack;
-
-/*
- * Forward declarations for functions defined in this file:
- */
-
-static XID AllocXId(Display *display);
-static Tk_RestrictAction CheckRestrictProc(ClientData clientData,
- XEvent *eventPtr);
-static void WindowIdCleanup(ClientData clientData);
-static void WindowIdCleanup2(ClientData clientData);
-
-/*
- *----------------------------------------------------------------------
- *
- * TkInitXId --
- *
- * This function is called to initialize the id allocator for a given
- * display.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The official allocator for the display is set up to be AllocXId.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TkInitXId(
- TkDisplay *dispPtr) /* Tk's information about the display. */
-{
- dispPtr->idStackPtr = NULL;
- dispPtr->defaultAllocProc = (XID (*) _ANSI_ARGS_((Display *display)))
- dispPtr->display->resource_alloc;
- dispPtr->display->resource_alloc = AllocXId;
- dispPtr->windowStackPtr = NULL;
- dispPtr->idCleanupScheduled = (Tcl_TimerToken) 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkFreeXId --
- *
- * This function 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(
- 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;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * AllocXId --
- *
- * This function 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
-AllocXId(
- Display *display) /* Display for which to allocate. */
-{
- TkDisplay *dispPtr;
- TkIdStack *stackPtr;
-
- /*
- * Find Tk's information about the display.
- */
-
- dispPtr = TkGetDisplay(display);
-
- /*
- * If the topmost chunk on the stack is empty then free it. Then check for
- * a free id on the stack and return it if it exists.
- */
-
- stackPtr = dispPtr->idStackPtr;
- if (stackPtr != NULL) {
- while (stackPtr->numUsed == 0) {
- dispPtr->idStackPtr = stackPtr->nextPtr;
- ckfree((char *) stackPtr);
- stackPtr = dispPtr->idStackPtr;
- if (stackPtr == NULL) {
- goto defAlloc;
- }
- }
- stackPtr->numUsed--;
- return stackPtr->ids[stackPtr->numUsed];
- }
-
- /*
- * No free ids in the stack: just get one from the default allocator.
- */
-
- defAlloc:
- return (*dispPtr->defaultAllocProc)(display);
-}
/*
*----------------------------------------------------------------------
@@ -205,268 +34,15 @@ Tk_FreeXId(
Display *display, /* Display for which xid was allocated. */
XID xid) /* Identifier that is no longer in use. */
{
- TkDisplay *dispPtr;
- TkIdStack *stackPtr;
-
- /*
- * Find Tk's information about the display.
- */
-
- dispPtr = TkGetDisplay(display);
-
- /*
- * Add a new chunk to the stack if the current chunk is full.
- */
-
- stackPtr = dispPtr->idStackPtr;
- if ((stackPtr == NULL) || (stackPtr->numUsed >= IDS_PER_STACK)) {
- stackPtr = (TkIdStack *) ckalloc(sizeof(TkIdStack));
- stackPtr->numUsed = 0;
- stackPtr->dispPtr = dispPtr;
- stackPtr->nextPtr = dispPtr->idStackPtr;
- dispPtr->idStackPtr = stackPtr;
- }
-
- /*
- * Add the id to the current chunk.
- */
-
- stackPtr->ids[stackPtr->numUsed] = xid;
- stackPtr->numUsed++;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkFreeWindowId --
- *
- * This function is invoked instead of TkFreeXId for window ids. See
- * below for the reason why.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The id given by w will eventually be freed, so that it can be reused
- * for other resources.
- *
- * Design:
- * Freeing window ids is very tricky because there could still be events
- * pending for a window in the event queue (or even in the server) at the
- * time the window is destroyed. If the window id were to get reused
- * immediately for another window, old events could "drop in" on the new
- * window, causing unexpected behavior.
- *
- * Thus we have to wait to re-use a window id until we know that there
- * are no events left for it. Right now this is done in two steps. First,
- * we wait until we know that the server has seen the XDestroyWindow
- * request, so we can be sure that it won't generate more events for the
- * window and that any existing events are in our queue. Second, we make
- * sure that there are no events whatsoever in our queue (this is
- * conservative but safe).
- *
- * The first step is done by remembering the request id of the
- * XDestroyWindow request and using LastKnownRequestProcessed to see what
- * events the server has processed. If multiple windows get destroyed at
- * about the same time, we just remember the most recent request number
- * for any of them (again, conservative but safe).
- *
- * There are a few other complications as well. When Tk destroys a
- * sub-tree of windows, it only issues a single XDestroyWindow call, at
- * the very end for the root of the subtree. We can't free any of the
- * window ids until the final XDestroyWindow call. To make sure that this
- * happens, we have to keep track of deletions in progress, hence the
- * need for the "destroyCount" field of the display.
- *
- * One final problem. Some servers, like Sun X11/News servers still seem
- * to have problems with ids getting reused too quickly. I'm not
- * completely sure why this is a problem, but delaying the recycling of
- * ids appears to eliminate it. Therefore, we wait an additional few
- * seconds, even after "the coast is clear" before reusing the ids.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TkFreeWindowId(
- TkDisplay *dispPtr, /* Display that w belongs to. */
- Window w) /* X identifier for window on dispPtr. */
-{
- TkIdStack *stackPtr;
-
- /*
- * Put the window id on a separate stack of window ids, rather than the
- * main stack, so it won't get reused right away. Add a new chunk to the
- * stack if the current chunk is full.
- */
-
- stackPtr = dispPtr->windowStackPtr;
- if ((stackPtr == NULL) || (stackPtr->numUsed >= IDS_PER_STACK)) {
- stackPtr = (TkIdStack *) ckalloc(sizeof(TkIdStack));
- stackPtr->numUsed = 0;
- stackPtr->dispPtr = dispPtr;
- stackPtr->nextPtr = dispPtr->windowStackPtr;
- dispPtr->windowStackPtr = stackPtr;
- }
-
- /*
- * Add the id to the current chunk.
- */
-
- stackPtr->ids[stackPtr->numUsed] = w;
- stackPtr->numUsed++;
-
- /*
- * Schedule a call to WindowIdCleanup if one isn't already scheduled.
- */
-
- if (!dispPtr->idCleanupScheduled) {
- dispPtr->idCleanupScheduled = Tcl_CreateTimerHandler(100,
- WindowIdCleanup, (ClientData) dispPtr);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * WindowIdCleanup --
- *
- * See if we can now free up all the accumulated ids of deleted windows.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If it's safe to move the window ids back to the main free list, we
- * schedule this to happen after a few mores seconds of delay. If it's
- * not safe to move them yet, a timer handler gets invoked to try again
- * later.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-WindowIdCleanup(
- ClientData clientData) /* Pointer to TkDisplay for display */
-{
- TkDisplay *dispPtr = (TkDisplay *) clientData;
- int anyEvents, delta;
- Tk_RestrictProc *oldProc;
- ClientData oldData;
- static Tcl_Time timeout = {0, 0};
-
- dispPtr->idCleanupScheduled = (Tcl_TimerToken) 0;
-
- /*
- * See if it's safe to recycle the window ids. It's safe if:
- * (a) no deletions are in progress.
- * (b) the server has seen all of the requests up to the last
- * XDestroyWindow request.
- * (c) there are no events in the event queue; the only way to test for
- * this right now is to create a restrict proc that will filter the
- * events, then call Tcl_DoOneEvent to see if the function gets
- * invoked.
- */
-
- if (dispPtr->destroyCount > 0) {
- goto tryAgain;
- }
- delta = LastKnownRequestProcessed(dispPtr->display)
- - dispPtr->lastDestroyRequest;
- if (delta < 0) {
- XSync(dispPtr->display, False);
- }
- anyEvents = 0;
- oldProc = Tk_RestrictEvents(CheckRestrictProc, (ClientData) &anyEvents,
- &oldData);
- TkUnixDoOneXEvent(&timeout);
- Tk_RestrictEvents(oldProc, oldData, &oldData);
- if (anyEvents) {
- goto tryAgain;
- }
-
- /*
- * These ids look safe to recycle, but we still need to delay a bit more
- * (see comments for TkFreeWindowId). Schedule the final freeing.
- */
-
- if (dispPtr->windowStackPtr != NULL) {
- Tcl_CreateTimerHandler(5000, WindowIdCleanup2,
- (ClientData) dispPtr->windowStackPtr);
- dispPtr->windowStackPtr = NULL;
- }
- return;
-
/*
- * It's still not safe to free up the ids. Try again a bit later.
+ * This does nothing, because the XC-MISC extension takes care of
+ * freeing XIDs for us. It has been a standard X11 extension for
+ * about 15 years as of 2008. Keith Packard and another X.org
+ * developer suggested that we remove the previous code that used:
+ * #define XLIB_ILLEGAL_ACCESS.
*/
-
- tryAgain:
- dispPtr->idCleanupScheduled = Tcl_CreateTimerHandler(500,
- WindowIdCleanup, (ClientData) dispPtr);
}
-
-/*
- *----------------------------------------------------------------------
- *
- * WindowIdCleanup2 --
- *
- * This function is the last one in the chain that recycles window ids.
- * It takes all of the ids indicated by its argument and adds them back
- * to the main id free list.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Window ids get added to the main free list for their display.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-WindowIdCleanup2(
- ClientData clientData) /* Pointer to TkIdStack list. */
-{
- TkIdStack *stackPtr = (TkIdStack *) clientData;
- TkIdStack *lastPtr;
- lastPtr = stackPtr;
- while (lastPtr->nextPtr != NULL) {
- lastPtr = lastPtr->nextPtr;
- }
- lastPtr->nextPtr = stackPtr->dispPtr->idStackPtr;
- stackPtr->dispPtr->idStackPtr = stackPtr;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * CheckRestrictProc --
- *
- * This function is a restrict function, called by Tcl_DoOneEvent to
- * filter X events. All it does is to set a flag to indicate that there
- * are X events present.
- *
- * Results:
- * Sets the integer pointed to by the argument, then returns
- * TK_DEFER_EVENT.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static Tk_RestrictAction
-CheckRestrictProc(
- ClientData clientData, /* Pointer to flag to set. */
- XEvent *eventPtr) /* Event to filter; not used. */
-{
- int *flag = (int *) clientData;
- *flag = 1;
- return TK_DEFER_EVENT;
-}
/*
*----------------------------------------------------------------------
@@ -522,44 +98,7 @@ Tk_FreePixmap(
XFreePixmap(display, pixmap);
Tk_FreeXId(display, (XID) pixmap);
}
-
-/*
- *----------------------------------------------------------------------
- *
- * TkpWindowWasRecentlyDeleted --
- *
- * Checks whether the window was recently deleted. This is called by the
- * generic error handler to detect asynchronous notification of errors
- * due to operations by Tk on a window that was already deleted by the
- * server.
- *
- * Results:
- * 1 if the window was deleted recently, 0 otherwise.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TkpWindowWasRecentlyDeleted(
- Window win, /* The window to check for. */
- TkDisplay *dispPtr) /* The window belongs to this display. */
-{
- TkIdStack *stackPtr;
- int i;
- for (stackPtr = dispPtr->windowStackPtr; stackPtr != NULL;
- stackPtr = stackPtr->nextPtr) {
- for (i = 0; i < stackPtr->numUsed; i++) {
- if ((Window) stackPtr->ids[i] == win) {
- return 1;
- }
- }
- }
- return 0;
-}
/*
*----------------------------------------------------------------------
@@ -583,7 +122,7 @@ TkpWindowWasRecentlyDeleted(
int
TkpScanWindowId(
Tcl_Interp *interp,
- CONST char *string,
+ const char *string,
Window *idPtr)
{
int value;
diff --git a/win/Makefile.in b/win/Makefile.in
index 851566d..cc50160 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -94,10 +94,6 @@ TCL_BIN_DIR = @TCL_BIN_DIR@
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
-# The directory containing the platform specific Tcl sources and headers
-# appropriate for this version of Tk:
-TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win
-
TCL_TOOL_DIR = @TCL_SRC_DIR@/tools
# Converts a POSIX path to a Windows native path.
@@ -124,7 +120,6 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps
XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib
RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc
TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g')
-TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g')
TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g')
DLLSUFFIX = @DLLSUFFIX@
@@ -134,6 +129,8 @@ EXESUFFIX = @EXESUFFIX@
TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
TK_LIB_FILE = @TK_LIB_FILE@
TK_DLL_FILE = @TK_DLL_FILE@
+TEST_DLL_FILE = tktest$(VER)${DLLSUFFIX}
+TEST_LIB_FILE = @LIBPREFIX@tktest$(VER)${LIBSUFFIX}
SHARED_LIBRARIES = $(TK_DLL_FILE) $(TK_STUB_LIB_FILE)
STATIC_LIBRARIES = $(TK_LIB_FILE)
@@ -167,7 +164,7 @@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
#CFLAGS = $(CFLAGS_DEBUG)
#CFLAGS = $(CFLAGS_OPTIMIZE)
#CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE)
-CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@
+CFLAGS = @CFLAGS@ @CFLAGS_DEFAULT@ -DUNICODE -D_UNICODE
# Special compiler flags to use when building man2tcl on Windows.
MAN2TCLFLAGS = @MAN2TCLFLAGS@
@@ -187,12 +184,12 @@ EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
STLIB_LD = @STLIB_LD@
SHLIB_LD = @SHLIB_LD@
-SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ $(TCL_STUB_LIB_FILE) $(LIBS)
+SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
VER = @TK_MAJOR_VERSION@@TK_MINOR_VERSION@
DOTVER = @TK_MAJOR_VERSION@.@TK_MINOR_VERSION@
-LIBS = @LIBS@ @LIBS_GUI@
+LIBS = $(TCL_STUB_LIB_FILE) @LIBS@ @LIBS_GUI@
RMDIR = rm -rf
MKDIR = mkdir -p
SHELL = @SHELL@
@@ -211,14 +208,11 @@ TCL_EXE = @TCLSH_PROG@
CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
-I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \
--I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS}
+-I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS
CC_OBJNAME = @CC_OBJNAME@
CC_EXENAME = @CC_EXENAME@
-STUB_CC_SWITCHES = ${CC_SWITCHES} -DUSE_TCL_STUBS
-CON_CC_SWITCHES = ${CC_SWITCHES} -DCONSOLE
-
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around; better to use the install-sh script that comes
@@ -232,7 +226,6 @@ WISH_OBJS = \
winMain.$(OBJEXT)
TKTEST_OBJS = \
- testMain.$(OBJEXT) \
tkSquare.$(OBJEXT) \
tkTest.$(OBJEXT) \
tkOldTest.$(OBJEXT) \
@@ -280,6 +273,7 @@ TK_OBJS = \
tkAtom.$(OBJEXT) \
tkBind.$(OBJEXT) \
tkBitmap.$(OBJEXT) \
+ tkBusy.$(OBJEXT) \
tkButton.$(OBJEXT) \
tkCanvArc.$(OBJEXT) \
tkCanvBmap.$(OBJEXT) \
@@ -311,12 +305,15 @@ TK_OBJS = \
tkImage.$(OBJEXT) \
tkImgBmap.$(OBJEXT) \
tkImgGIF.$(OBJEXT) \
+ tkImgPNG.$(OBJEXT) \
tkImgPPM.$(OBJEXT) \
tkImgPhoto.$(OBJEXT) \
+ tkImgPhInstance.$(OBJEXT) \
tkImgUtil.$(OBJEXT) \
tkListbox.$(OBJEXT) \
tkMacWinMenu.$(OBJEXT) \
tkMain.$(OBJEXT) \
+ tkMain2.$(OBJEXT) \
tkMenu.$(OBJEXT) \
tkMenubutton.$(OBJEXT) \
tkMenuDraw.$(OBJEXT) \
@@ -346,7 +343,6 @@ TK_OBJS = \
tkUtil.$(OBJEXT) \
tkVisual.$(OBJEXT) \
tkStubInit.$(OBJEXT) \
- tkStubLib.$(OBJEXT) \
tkWindow.$(OBJEXT) \
$(TTK_OBJS)
@@ -428,15 +424,15 @@ $(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c
test: test-classic test-ttk
-test-classic: binaries $(TKTEST)
+test-classic: binaries $(TKTEST) $(TEST_DLL_FILE) $(CAT32)
$(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \
$(TESTFLAGS) | ./$(CAT32)
-test-ttk: binaries $(TKTEST)
+test-ttk: binaries $(TKTEST) $(TEST_DLL_FILE) $(CAT32)
$(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/ttk/all.tcl" \
$(TESTFLAGS) | ./$(CAT32)
-runtest: binaries $(TKTEST)
+runtest: binaries $(TKTEST) $(TEST_DLL_FILE)
$(SHELL_ENV) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT)
# This target can be used to run wish from the build directory
@@ -444,7 +440,7 @@ runtest: binaries $(TKTEST)
shell: binaries
$(SHELL_ENV) ./$(WISH) $(SCRIPT)
-demo: $(WISH)
+demo:
$(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget
# This target can be used to run wish inside either gdb or insight
@@ -477,7 +473,8 @@ install-binaries: binaries
@echo "Creating package index $(PKG_INDEX)";
@$(RM) $(PKG_INDEX);
@(\
- echo "if {[catch {package present Tcl 8.5.0}]} { return }";\
+ echo "if {[catch {package present Tcl\
+ $(TCLVERSION)$(TCLPATCHL)}]} { return }";\
echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL)\
[list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\
) > $(PKG_INDEX);
@@ -513,8 +510,8 @@ install-libraries: libraries
$(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR)/X11; \
done;
@echo "Installing library files to $(SCRIPT_INSTALL_DIR)";
- @for i in $(ROOT_DIR)/library/*.tcl \
- $(ROOT_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \
+ @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex \
+ $(UNIX_DIR)/tkAppInit.c; \
do \
$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
done;
@@ -593,19 +590,23 @@ install-private-headers: libraries
$(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \
done;
-$(WISH): $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(WISH_OBJS) wish.$(RES)
- $(CC) $(CFLAGS) $(WISH_OBJS) $(TCL_LIB_FILE) $(TK_LIB_FILE) $(LIBS) \
+$(WISH): $(WISH_OBJS) @LIBRARIES@ $(TK_STUB_LIB_FILE) wish.$(RES)
+ $(CC) $(CFLAGS) $(WISH_OBJS) $(TK_LIB_FILE) \
+ $(TK_STUB_LIB_FILE) $(TCL_LIB_FILE) $(LIBS) \
wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
@VC_MANIFEST_EMBED_EXE@
-tktest : $(TKTEST)
+tktest: $(TKTEST)
-$(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32)
- $(CC) $(CFLAGS) $(TKTEST_OBJS) $(TCL_LIB_FILE) \
- $(TK_LIB_FILE) $(LIBS) \
+$(TKTEST): testMain.$(OBJEXT) $(TEST_DLL_FILE) @LIBRARIES@ $(TK_STUB_LIB_FILE) wish.$(RES)
+ $(CC) $(CFLAGS) testMain.$(OBJEXT) $(TEST_LIB_FILE) $(TK_LIB_FILE) \
+ $(TK_STUB_LIB_FILE) $(TCL_LIB_FILE) $(LIBS) \
wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
@VC_MANIFEST_EMBED_EXE@
+${TEST_DLL_FILE}: ${TKTEST_OBJS} ${TK_STUB_LIB_FILE}
+ @MAKE_DLL@ ${TKTEST_OBJS} $(TK_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+
# Msys make requires this next rule for some reason.
$(TCL_SRC_DIR)/win/cat.c:
@@ -653,6 +654,9 @@ tkWinTest.$(OBJEXT): tkWinTest.c
tkSquare.$(OBJEXT): tkSquare.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
+tkMain2.$(OBJEXT): tkMain.c
+ $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DTK_ASCII_MAIN @DEPARG@ $(CC_OBJNAME)
+
# Extra dependency info
tkConsole.$(OBJEXT): configure Makefile
tkMain.$(OBJEXT): configure Makefile
@@ -668,10 +672,10 @@ tkWindow.$(OBJEXT): configure Makefile
# Implicit rule for all object files that will end up in the Tcl library
%.$(OBJEXT): %.c
- $(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME)
+ $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME)
.rc.$(RES):
- $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_DEFINES@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(TCL_GENERIC_NATIVE)" @RC_INCLUDE@ "$(TCL_PLATFORM_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:
@@ -704,4 +708,20 @@ genstubs:
$(TCL_EXE) "$(TCL_TOOL_DIR)\genStubs.tcl" \
"$(GENERIC_DIR_NATIVE)" \
"$(GENERIC_DIR_NATIVE)\tk.decls" \
- "$(GENERIC_DIR_NATIVE)\tkInt.decls"
+ "$(GENERIC_DIR_NATIVE)\tkInt.decls"
+ $(TCL_EXE) "$(TTK_DIR)/ttkGenStubs.tcl" \
+ "$(TTK_DIR)" \
+ "$(TTK_DIR)/ttk.decls"
+
+#
+# The list of all the targets that do not correspond to real files. This stops
+# 'make' from getting confused when someone makes an error in a rule.
+#
+
+.PHONY: all binaries libraries doc tkLibObjs objs tktest-real test test-classic
+.PHONY: test-ttk testlang runtest shell demo gdb install install-strip
+.PHONY: install-binaries install-libraries install-demos install-doc
+.PHONY: install-private-headers clean distclean depend genstubs checkstubs
+.PHONY: checkuchar checkexports rpm dist alldist allpatch html html-tcl html-tk
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/win/README b/win/README
index 1d4b27a..8670446 100644
--- a/win/README
+++ b/win/README
@@ -1,4 +1,4 @@
-Tk 8.5 for Windows
+Tk 8.6 for Windows
Originally by Scott Stanton while at Sun Microsystems Labs
diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat
index 16605ee..58360b9 100755
--- a/win/buildall.vc.bat
+++ b/win/buildall.vc.bat
@@ -56,7 +56,7 @@ if "%TCLDIR%" == "" set TCLDIR=..\..\tcl
::
set OPTS=none
if not %SYMBOLS%.==. set OPTS=symbols
-nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1
+nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1
if errorlevel 1 goto error
:: Build the static core, dlls and shell.
diff --git a/win/configure b/win/configure
index b3a6294..0c1f6e7 100755
--- a/win/configure
+++ b/win/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX TK_SHARED_BUILD DEPARG EXTRA_CFLAGS STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES TK_RES RES LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -852,7 +852,7 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-celib=DIR use Windows/CE support library from DIR
- --with-tcl=DIR use Tcl 8.5 binaries from DIR
+ --with-tcl=DIR use Tcl 8.6 binaries from DIR
Some influential environment variables:
CC C compiler command
@@ -1308,10 +1308,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# /bin/sh. The bash shell seems to suffer from some strange failures.
SHELL=/bin/sh
-TK_VERSION=8.5
+TK_VERSION=8.6
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".10"
+TK_MINOR_VERSION=6
+TK_PATCH_LEVEL="b2"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -3033,74 +3033,6 @@ fi
#--------------------------------------------------------------------
-echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5
-echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6
-if test "${ac_cv_cygwin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#ifdef __CYGWIN__
-#error cygwin
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_cygwin=no
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_cygwin=yes
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5
-echo "${ECHO_T}$ac_cv_cygwin" >&6
-if test "$ac_cv_cygwin" = "yes" ; then
- { { echo "$as_me:$LINENO: error: Compiling under Cygwin is not currently supported.
-A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
-file for information about building with Mingw." >&5
-echo "$as_me: error: Compiling under Cygwin is not currently supported.
-A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
-file for information about building with Mingw." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
#--------------------------------------------------------------------
# Determines the correct binary file extension (.o, .obj, .exe etc.)
#--------------------------------------------------------------------
@@ -3120,7 +3052,7 @@ if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
tcl_ok=$enableval
else
- tcl_ok=no
+ tcl_ok=yes
fi;
if test "$tcl_ok" = "yes"; then
@@ -3139,8 +3071,8 @@ _ACEOF
else
TCL_THREADS=0
- echo "$as_me:$LINENO: result: no (default)" >&5
-echo "${ECHO_T}no (default)" >&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
@@ -3307,6 +3239,11 @@ echo "${ECHO_T}$CELIB_DIR" >&6
# Set some defaults (may get changed below)
EXTRA_CFLAGS=""
+cat >>confdefs.h <<\_ACEOF
+#define MODULE_SCOPE extern
+_ACEOF
+
+
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3383,6 +3320,72 @@ echo "${ECHO_T}yes" >&6
cyg_conftest=
fi
+ echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5
+echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6
+if test "${ac_cv_cygwin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #ifdef __CYGWIN__
+ #error cygwin
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_cygwin=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_cygwin=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5
+echo "${ECHO_T}$ac_cv_cygwin" >&6
+ if test "$ac_cv_cygwin" = "yes" ; then
+ { echo "$as_me:$LINENO: WARNING: Compiling under Cygwin is not currently supported.
+If you are not sure you want this, see the README
+file for information about building with Mingw." >&5
+echo "$as_me: WARNING: Compiling under Cygwin is not currently supported.
+If you are not sure you want this, see the README
+file for information about building with Mingw." >&2;}
+ fi
if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then
DEPARG='"$<"'
else
@@ -3395,8 +3398,8 @@ echo "${ECHO_T}yes" >&6
echo $ECHO_N "checking compiler flags... $ECHO_C" >&6
if test "${GCC}" = "yes" ; then
SHLIB_LD=""
- SHLIB_LD_LIBS=""
- LIBS="-lws2_32"
+ SHLIB_LD_LIBS='${LIBS}'
+ LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32"
# mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't
LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32"
STLIB_LD='${AR} cr'
@@ -3428,14 +3431,77 @@ echo $ECHO_N "checking compiler flags... $ECHO_C" >&6
rm -f ac$$.o ac$$.c
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain"
+ echo "$as_me:$LINENO: checking for working -municode linker flag" >&5
+echo $ECHO_N "checking for working -municode linker flag... $ECHO_C" >&6
+if test "${ac_cv_municode+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <windows.h>
+ int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;}
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_municode=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_municode=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_municode" >&5
+echo "${ECHO_T}$ac_cv_municode" >&6
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_municode" = "yes" ; then
+ extra_ldflags="$extra_ldflags -municode"
+ else
+ extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS"
+ fi
+
if test "${SHARED_BUILD}" = "0" ; then
# static
echo "$as_me:$LINENO: result: using static flags" >&5
echo "${ECHO_T}using static flags" >&6
runtime=
- MAKE_DLL="echo "
- LIBSUFFIX="s\${DBGX}.a"
- LIBFLAGSUFFIX="s\${DBGX}"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
else
@@ -3453,30 +3519,30 @@ echo "$as_me: error: ${CC} does not support the -shared option.
fi
runtime=
- # Link with gcc since ld does not link to default libs like
- # -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}'
- SHLIB_LD_LIBS='${LIBS}'
# 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"
- LIBFLAGSUFFIX="\${DBGX}"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # Link with gcc since ld does not link to default libs like
+ # -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}'
+ SHLIB_LD_LIBS='${LIBS}'
+ MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \$@ ${extra_ldflags} \
+ -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\$@)"
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ LIBSUFFIX="\${DBGX}.a"
+ LIBFLAGSUFFIX="\${DBGX}"
SHLIB_SUFFIX=.dll
EXTRA_CFLAGS="${extra_cflags}"
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall"
+ CFLAGS_WARNING="-Wall -Wdeclaration-after-statement"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
@@ -3577,28 +3643,23 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6
echo "$as_me:$LINENO: result: using static flags" >&5
echo "${ECHO_T}using static flags" >&6
runtime=-MT
- MAKE_DLL="echo "
- LIBSUFFIX="s\${DBGX}.lib"
- LIBFLAGSUFFIX="s\${DBGX}"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- SHLIB_LD_LIBS=""
else
# dynamic
echo "$as_me:$LINENO: result: using shared flags" >&5
echo "${ECHO_T}using shared flags" >&6
runtime=-MD
# Add SHLIB_LD_LIBS to the Make rule, not here.
- MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@"
- LIBSUFFIX="\${DBGX}.lib"
- LIBFLAGSUFFIX="\${DBGX}"
- EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
- SHLIB_LD_LIBS='${LIBS}'
+ EXESUFFIX="\${DBGX}.exe"
fi
+ MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@"
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ LIBSUFFIX="\${DBGX}.lib"
+ LIBFLAGSUFFIX="\${DBGX}"
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
@@ -3631,7 +3692,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6
fi
fi
- LIBS="user32.lib advapi32.lib ws2_32.lib"
+ LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib"
if test "$do64bit" != "no" ; then
# The space-based-path will work for the Makefile, but will
# not work if AC_TRY_COMPILE is called. TEA has the
@@ -3829,6 +3890,7 @@ _ACEOF
fi
SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}"
+ SHLIB_LD_LIBS='${LIBS}'
# link -lib only works when -lib is the first arg
STLIB_LD="${LINKBIN} -lib ${lflags}"
RC_OUT=-fo
@@ -4091,6 +4153,63 @@ echo "$as_me: xpnative theme will be unavailable" >&6;}
fi
+echo "$as_me:$LINENO: checking for vssym32.h" >&5
+echo $ECHO_N "checking for vssym32.h... $ECHO_C" >&6
+if test "${ac_cv_header_vssym32_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <windows.h>
+#include <uxtheme.h>
+
+#include <vssym32.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_vssym32_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_vssym32_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_vssym32_h" >&5
+echo "${ECHO_T}$ac_cv_header_vssym32_h" >&6
+if test $ac_cv_header_vssym32_h = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_VSSYM32_H 1
+_ACEOF
+
+fi
+
+
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
@@ -4234,10 +4353,10 @@ echo "${ECHO_T}$result" >&6
echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5
echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6
- if test -d ../../tcl8.5$TK_PATCH_LEVEL/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.5$TK_PATCH_LEVEL/win
- elif test -d ../../tcl8.5/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.5/win
+ if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win
+ elif test -d ../../tcl8.6/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.6/win
else
TCL_BIN_DIR_DEFAULT=../../tcl/win
fi
@@ -4472,6 +4591,7 @@ TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`
+# win/tcl.m4 doesn't set (LDFLAGS)
@@ -4507,10 +4627,15 @@ TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`
+# undefined at this point for win
+
+
+
+
+
-# undefined at this point for win
@@ -5212,27 +5337,21 @@ s,@TCL_DBGX@,$TCL_DBGX,;t t
s,@CFG_TK_SHARED_LIB_SUFFIX@,$CFG_TK_SHARED_LIB_SUFFIX,;t t
s,@CFG_TK_UNSHARED_LIB_SUFFIX@,$CFG_TK_UNSHARED_LIB_SUFFIX,;t t
s,@CFG_TK_EXPORT_FILE_SUFFIX@,$CFG_TK_EXPORT_FILE_SUFFIX,;t t
-s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t
-s,@DEPARG@,$DEPARG,;t t
s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
-s,@STLIB_LD@,$STLIB_LD,;t t
-s,@SHLIB_LD@,$SHLIB_LD,;t t
-s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t
-s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
-s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
+s,@DEPARG@,$DEPARG,;t t
s,@CC_OBJNAME@,$CC_OBJNAME,;t t
s,@CC_EXENAME@,$CC_EXENAME,;t t
s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t
s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t
s,@LDFLAGS_CONSOLE@,$LDFLAGS_CONSOLE,;t t
s,@LDFLAGS_WINDOW@,$LDFLAGS_WINDOW,;t t
-s,@RC_OUT@,$RC_OUT,;t t
-s,@RC_TYPE@,$RC_TYPE,;t t
-s,@RC_INCLUDE@,$RC_INCLUDE,;t t
-s,@RC_DEFINE@,$RC_DEFINE,;t t
-s,@RC_DEFINES@,$RC_DEFINES,;t t
s,@TK_RES@,$TK_RES,;t t
-s,@RES@,$RES,;t t
+s,@STLIB_LD@,$STLIB_LD,;t t
+s,@SHLIB_LD@,$SHLIB_LD,;t t
+s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t
+s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t
+s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t
+s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t
s,@LIBS_GUI@,$LIBS_GUI,;t t
s,@DLLSUFFIX@,$DLLSUFFIX,;t t
s,@LIBPREFIX@,$LIBPREFIX,;t t
@@ -5251,6 +5370,12 @@ s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t
s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t
s,@TK_CC_SEARCH_FLAGS@,$TK_CC_SEARCH_FLAGS,;t t
s,@TK_LD_SEARCH_FLAGS@,$TK_LD_SEARCH_FLAGS,;t t
+s,@RC_OUT@,$RC_OUT,;t t
+s,@RC_TYPE@,$RC_TYPE,;t t
+s,@RC_INCLUDE@,$RC_INCLUDE,;t t
+s,@RC_DEFINE@,$RC_DEFINE,;t t
+s,@RC_DEFINES@,$RC_DEFINES,;t t
+s,@RES@,$RES,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
diff --git a/win/configure.in b/win/configure.in
index bb29f41..e24e2af 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -11,10 +11,10 @@ AC_PREREQ(2.59)
# /bin/sh. The bash shell seems to suffer from some strange failures.
SHELL=/bin/sh
-TK_VERSION=8.5
+TK_VERSION=8.6
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".10"
+TK_MINOR_VERSION=6
+TK_PATCH_LEVEL="b2"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -63,23 +63,6 @@ dnl under autoconf 2.5X.
dnl
dnl AC_CYGWIN
-AC_CACHE_CHECK(for Cygwin version of gcc,
- ac_cv_cygwin,
-AC_TRY_COMPILE([
-#ifdef __CYGWIN__
-#error cygwin
-#endif
-],
-[],
- ac_cv_cygwin=no,
- ac_cv_cygwin=yes)
-)
-if test "$ac_cv_cygwin" = "yes" ; then
- AC_MSG_ERROR([Compiling under Cygwin is not currently supported.
-A maintainer for the Cygwin port of Tcl/Tk is needed. See the README
-file for information about building with Mingw.])
-fi
-
#--------------------------------------------------------------------
# Determines the correct binary file extension (.o, .obj, .exe etc.)
#--------------------------------------------------------------------
@@ -122,6 +105,9 @@ AC_SUBST(MAN2TCLFLAGS)
AC_CHECK_HEADER([uxtheme.h], [AC_DEFINE(HAVE_UXTHEME_H)],
[AC_MSG_NOTICE([xpnative theme will be unavailable])],
[#include <windows.h>])
+AC_CHECK_HEADER([vssym32.h], [AC_DEFINE(HAVE_VSSYM32_H)], [],
+ [#include <windows.h>
+#include <uxtheme.h>])
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols
@@ -243,25 +229,22 @@ AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_MAJOR_VERSION)
AC_SUBST(TCL_MINOR_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
+
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_DBGX)
AC_SUBST(CFG_TK_SHARED_LIB_SUFFIX)
AC_SUBST(CFG_TK_UNSHARED_LIB_SUFFIX)
AC_SUBST(CFG_TK_EXPORT_FILE_SUFFIX)
-AC_SUBST(TK_SHARED_BUILD)
-AC_SUBST(CYGPATH)
-AC_SUBST(DEPARG)
AC_SUBST(CFLAGS_DEFAULT)
AC_SUBST(EXTRA_CFLAGS)
-AC_SUBST(STLIB_LD)
-AC_SUBST(SHLIB_LD)
-AC_SUBST(SHLIB_LD_LIBS)
-AC_SUBST(SHLIB_CFLAGS)
-AC_SUBST(SHLIB_SUFFIX)
+AC_SUBST(CYGPATH)
+AC_SUBST(DEPARG)
AC_SUBST(CC_OBJNAME)
AC_SUBST(CC_EXENAME)
+
+# win/tcl.m4 doesn't set (LDFLAGS)
AC_SUBST(LDFLAGS_DEFAULT)
AC_SUBST(LDFLAGS_DEBUG)
AC_SUBST(LDFLAGS_OPTIMIZE)
@@ -269,14 +252,15 @@ AC_SUBST(LDFLAGS_CONSOLE)
AC_SUBST(LDFLAGS_WINDOW)
AC_SUBST(AR)
AC_SUBST(RANLIB)
-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(STLIB_LD)
+AC_SUBST(SHLIB_LD)
+AC_SUBST(SHLIB_LD_LIBS)
+AC_SUBST(SHLIB_CFLAGS)
+AC_SUBST(SHLIB_SUFFIX)
+AC_SUBST(TK_SHARED_BUILD)
+
AC_SUBST(LIBS)
AC_SUBST(LIBS_GUI)
AC_SUBST(DLLSUFFIX)
@@ -300,7 +284,15 @@ AC_SUBST(TK_BUILD_STUB_LIB_PATH)
AC_SUBST(TK_CC_SEARCH_FLAGS)
AC_SUBST(TK_LD_SEARCH_FLAGS)
-AC_OUTPUT([Makefile tkConfig.sh wish.exe.manifest])
+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(RES)
+
+AC_OUTPUT(Makefile tkConfig.sh wish.exe.manifest)
dnl Local Variables:
dnl mode: autoconf;
diff --git a/win/makefile.bc b/win/makefile.bc
index 12fd5b8..8738da9 100644
--- a/win/makefile.bc
+++ b/win/makefile.bc
@@ -161,6 +161,7 @@ TKOBJS = \
$(TMPDIR)\tkAtom.obj \
$(TMPDIR)\tkBind.obj \
$(TMPDIR)\tkBitmap.obj \
+ $(TMPDIR)\tkBusy.obj \
$(TMPDIR)\tkButton.obj \
$(TMPDIR)\tkCanvArc.obj \
$(TMPDIR)\tkCanvBmap.obj \
@@ -194,6 +195,7 @@ TKOBJS = \
$(TMPDIR)\tkImgGIF.obj \
$(TMPDIR)\tkImgPPM.obj \
$(TMPDIR)\tkImgPhoto.obj \
+ $(TMPDIR)\tkImgPhInstance.obj \
$(TMPDIR)\tkImgUtil.obj \
$(TMPDIR)\tkListbox.obj \
$(TMPDIR)\tkMacWinMenu.obj \
@@ -225,7 +227,6 @@ TKOBJS = \
$(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
diff --git a/win/makefile.vc b/win/makefile.vc
index 89dbe30..14dc2d0 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -1,15 +1,16 @@
-#------------------------------------------------------------------------------
+#------------------------------------------------------------- -*- makefile -*-
# 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-2005 ActiveState Corporation.
# Copyright (c) 2001-2004 David Gravereaux.
+# Copyright (c) 2003-2008 Pat Thoyts.
#------------------------------------------------------------------------------
# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
@@ -85,7 +86,9 @@ the build instructions.
# staticpkg= 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.
-# thrdalloc= Use the thread allocator (shared global free pool).
+# thrdalloc = Use the thread allocator (shared global free pool)
+# This is the default on threaded builds.
+# tclalloc = Use the old non-thread allocator
# symbols = Adds symbols for step debugging.
# profile = Adds profiling hooks. Map file is assumed.
# loimpact = Adds a flag for how NT treats the heap to keep
@@ -111,7 +114,7 @@ the build instructions.
# Sets special macros for checking compatability.
#
# nodep = Turns off compatability macros to ensure Tk isn't
-# being built with deprecated functions.
+# being built with deprecated functions.
# fullwarn = Builds with full compiler and link warnings enabled.
# Very verbose.
#
@@ -124,7 +127,7 @@ the build instructions.
# TMP_DIR=<path>
# OUT_DIR=<path>
# Hooks to allow the intermediate and output directories to be
-# changed. $(OUT_DIR) is assumed 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.
#
@@ -232,6 +235,7 @@ WISHOBJS = \
!if $(TCL_USE_STATIC_PACKAGES)
$(TCLDDELIB) \
$(TCLREGLIB) \
+ $(TCLSTUBLIB) \
!endif
$(TMP_DIR)\wish.res
@@ -284,6 +288,7 @@ TKOBJS = \
$(TMP_DIR)\tkAtom.obj \
$(TMP_DIR)\tkBind.obj \
$(TMP_DIR)\tkBitmap.obj \
+ $(TMP_DIR)\tkBusy.obj \
$(TMP_DIR)\tkButton.obj \
$(TMP_DIR)\tkCanvArc.obj \
$(TMP_DIR)\tkCanvBmap.obj \
@@ -315,12 +320,15 @@ TKOBJS = \
$(TMP_DIR)\tkImage.obj \
$(TMP_DIR)\tkImgBmap.obj \
$(TMP_DIR)\tkImgGIF.obj \
+ $(TMP_DIR)\tkImgPNG.obj \
$(TMP_DIR)\tkImgPPM.obj \
$(TMP_DIR)\tkImgPhoto.obj \
+ $(TMP_DIR)\tkImgPhInstance.obj \
$(TMP_DIR)\tkImgUtil.obj \
$(TMP_DIR)\tkListbox.obj \
$(TMP_DIR)\tkMacWinMenu.obj \
$(TMP_DIR)\tkMain.obj \
+ $(TMP_DIR)\tkMain2.obj \
$(TMP_DIR)\tkMenu.obj \
$(TMP_DIR)\tkMenubutton.obj \
$(TMP_DIR)\tkMenuDraw.obj \
@@ -350,7 +358,6 @@ TKOBJS = \
$(TMP_DIR)\tkUtil.obj \
$(TMP_DIR)\tkVisual.obj \
$(TMP_DIR)\tkStubInit.obj \
- $(TMP_DIR)\tkStubLib.obj \
$(TMP_DIR)\tkWindow.obj \
$(TTK_OBJS) \
!if !$(STATIC_BUILD)
@@ -418,7 +425,7 @@ CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
-DTTK_SQUARE_WIDGET=1 \
!endif
-TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS)
+TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline
#---------------------------------------------------------------------
# Compile flags
@@ -433,7 +440,7 @@ cdebug = $(OPTIMIZATIONS)
cdebug =
!endif
!if $(SYMBOLS)
-cdebug = $(cdebug) -Zi
+cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
@@ -461,11 +468,15 @@ crt = -MT
!endif
BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES)
-TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS
+TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
-STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
+### Stubs files should not be compiled with -GL
+STUB_CFLAGS = $(cflags) $(cdebug:-GL=) $(TK_DEFINES)
+!if !$(STATIC_BUILD)
+TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS
+!endif
#---------------------------------------------------------------------
# Link flags
@@ -475,6 +486,9 @@ STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
ldebug = -debug -debugtype:cv
!else
ldebug = -release -opt:ref -opt:icf,3
+!if $(SYMBOLS)
+ldebug = $(ldebug) -debug -debugtype:cv
+!endif
!endif
### Declarations common to all linker options
@@ -500,7 +514,12 @@ dlllflags = $(lflags) -dll
conlflags = $(lflags) -subsystem:console
guilflags = $(lflags) -subsystem:windows
-baselibs = kernel32.lib user32.lib
+tcllibs = $(TCLIMPLIB)
+!if !$(STATIC_BUILD)
+tcllibs = $(TCLSTUBLIB) $(tcllibs)
+!endif
+
+baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
@@ -544,9 +563,9 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32)
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
!else
- $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
!endif
test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@@ -559,9 +578,9 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
!else
- $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
+ $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
!endif
runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
@@ -573,7 +592,7 @@ runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
- $(TKTEST)
+ $(DEBUGGER) $(TKTEST)
rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@@ -595,21 +614,10 @@ shell: setup $(WISH)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
- $(WISH) <<
+ $(DEBUGGER) $(WISH) <<
console show
<<
-dbgshell: setup $(WISH)
- @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
- @set TK_LIBRARY=$(TK_LIBRARY:\=/)
- @set TCLLIBPATH=
-!if $(TCLINSTALL)
- @set PATH=$(_TCLDIR)\bin;$(PATH)
-!else
- @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
-!endif
- windbg $(WISH)
-
setup:
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
@@ -637,18 +645,18 @@ $(TKSTUBLIB): $(TKSTUBOBJS)
$(lib32) -nologo -out:$@ $**
-$(WISH): $(WISHOBJS) $(TKIMPLIB)
- $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(WISH): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
-$(WISHC): $(WISHOBJS) $(TKIMPLIB)
- $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(WISHC): $(WISHOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
-$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB)
- $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $**
+$(TKTEST): $(TKTESTOBJS) $(TKSTUBLIB) $(TKIMPLIB)
+ $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $**
$(_VC_MANIFEST_EMBED_EXE)
@@ -788,6 +796,9 @@ $(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
+$(TMP_DIR)\tkMain2.obj: $(GENERICDIR)\tkMain.c
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -DTK_ASCII_MAIN -Fo$@ $?
+
# 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.
@@ -897,7 +908,7 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {[catch {package present Tcl 8.5.0}]} { return }
+if {[package vcompare [package provide Tcl] $(TCL_PATCH_LEVEL)] != 0} { return }
package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
<<
@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index f1b5f34..4803b43 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -589,7 +589,10 @@ typedef struct list_item_t {
/* insert a list item into the list (list may be null) */
static list_item_t *
-list_insert(list_item_t **listPtrPtr, const char *key, const char *value)
+list_insert(
+ list_item_t **listPtrPtr,
+ const char *key,
+ const char *value)
{
list_item_t *itemPtr = malloc(sizeof(list_item_t));
if (itemPtr) {
@@ -606,7 +609,8 @@ list_insert(list_item_t **listPtrPtr, const char *key, const char *value)
}
static void
-list_free(list_item_t **listPtrPtr)
+list_free(
+ list_item_t **listPtrPtr)
{
list_item_t *tmpPtr, *listPtr = *listPtrPtr;
while (listPtr) {
diff --git a/win/rc/tk.ico b/win/rc/tk.ico
index 5fdb9a7..e254318 100644
--- a/win/rc/tk.ico
+++ b/win/rc/tk.ico
Binary files differ
diff --git a/win/rc/wish.ico b/win/rc/wish.ico
index 1825751..05cad66 100644
--- a/win/rc/wish.ico
+++ b/win/rc/wish.ico
Binary files differ
diff --git a/win/rules.vc b/win/rules.vc
index e18dca9..01e44e0 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -6,7 +6,7 @@
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
+#
# Copyright (c) 2001-2003 David Gravereaux.
# Copyright (c) 2003-2007 Patrick Thoyts
#------------------------------------------------------------------------------
@@ -159,7 +159,7 @@ DEBUGFLAGS = $(DEBUGFLAGS) -RTC1
DEBUGFLAGS = $(DEBUGFLAGS) -GZ
!endif
-COMPILERFLAGS =-W3
+COMPILERFLAGS =-W3 -DUNICODE -D_UNICODE
# In v13 -GL and -YX are incompatible.
!if [nmakehlp -c -YX]
@@ -213,14 +213,15 @@ LINKERFLAGS =-ltcg
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
STATIC_BUILD = 0
-TCL_THREADS = 0
+TCL_THREADS = 1
DEBUG = 0
SYMBOLS = 0
PROFILE = 0
+PGO = 0
MSVCRT = 0
LOIMPACT = 0
TCL_USE_STATIC_PACKAGES = 0
-USE_THREAD_ALLOC = 0
+USE_THREAD_ALLOC = 1
UNCHECKED = 0
!else
!if [nmakehlp -f $(OPTS) "static"]
@@ -241,11 +242,12 @@ TCL_USE_STATIC_PACKAGES = 1
!else
TCL_USE_STATIC_PACKAGES = 0
!endif
-!if [nmakehlp -f $(OPTS) "threads"]
+!if [nmakehlp -f $(OPTS) "nothreads"]
+TCL_THREADS = 0
+!else
!message *** Doing threads
TCL_THREADS = 1
-!else
-TCL_THREADS = 0
+USE_THREAD_ALLOC= 1
!endif
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
@@ -265,6 +267,15 @@ PROFILE = 1
!else
PROFILE = 0
!endif
+!if [nmakehlp -f $(OPTS) "pgi"]
+!message *** Doing profile guided optimization instrumentation
+PGO = 1
+!elseif [nmakehlp -f $(OPTS) "pgo"]
+!message *** Doing profile guided optimization
+PGO = 2
+!else
+PGO = 0
+!endif
!if [nmakehlp -f $(OPTS) "loimpact"]
!message *** Doing loimpact
LOIMPACT = 1
@@ -274,7 +285,9 @@ LOIMPACT = 0
!if [nmakehlp -f $(OPTS) "thrdalloc"]
!message *** Doing thrdalloc
USE_THREAD_ALLOC = 1
-!else
+!endif
+!if [nmakehlp -f $(OPTS) "tclalloc"]
+!message *** Doing thrdalloc
USE_THREAD_ALLOC = 0
!endif
!if [nmakehlp -f $(OPTS) "unchecked"]
@@ -417,6 +430,24 @@ WARNINGS = $(WARNINGS) -Wp64
!endif
!endif
+!if $(PGO) > 1
+!if [nmakehlp -l -ltcg:pgoptimize]
+LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize
+!else
+MSG=^
+This compiler does not support profile guided optimization.
+!error $(MSG)
+!endif
+!elseif $(PGO) > 0
+!if [nmakehlp -l -ltcg:pginstrument]
+LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument
+!else
+MSG=^
+This compiler does not support profile guided optimization.
+!error $(MSG)
+!endif
+!endif
+
#----------------------------------------------------------
# Set our defines now armed with our options.
#----------------------------------------------------------
@@ -563,7 +594,7 @@ TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe"
TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY = $(_TCLDIR)\lib
-TCLREGLIB = "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib"
+TCLREGLIB = "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib"
TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib"
COFFBASE = \must\have\tcl\sources\to\build\this\target
TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
@@ -576,7 +607,7 @@ TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe"
TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY = $(_TCLDIR)\library
-TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib"
+TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib"
TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib"
COFFBASE = "$(_TCLDIR)\win\coffbase.txt"
TCLTOOLSDIR = $(_TCLDIR)\tools
diff --git a/win/stubs.c b/win/stubs.c
index 1138ccb..7e26d4b 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -252,7 +252,7 @@ void
XSetCommand(
Display *display,
Window w,
- CONST char **argv,
+ const char **argv,
int argc)
{
}
diff --git a/win/tcl.m4 b/win/tcl.m4
index 83a4ea3..72e4fa4 100644
--- a/win/tcl.m4
+++ b/win/tcl.m4
@@ -20,15 +20,15 @@
AC_DEFUN([SC_PATH_TCLCONFIG], [
AC_MSG_CHECKING([the location of tclConfig.sh])
- if test -d ../../tcl8.5$1/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.5$1/win
- elif test -d ../../tcl8.5/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.5/win
+ if test -d ../../tcl8.6$1/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.6$1/win
+ elif test -d ../../tcl8.6/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.6/win
else
TCL_BIN_DIR_DEFAULT=../../tcl/win
fi
- AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.5 binaries from DIR],
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 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,15 +60,15 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
AC_DEFUN([SC_PATH_TKCONFIG], [
AC_MSG_CHECKING([the location of tkConfig.sh])
- if test -d ../../tk8.5$1/win; then
- TK_BIN_DIR_DEFAULT=../../tk8.5$1/win
- elif test -d ../../tk8.5/win; then
- TK_BIN_DIR_DEFAULT=../../tk8.5/win
+ if test -d ../../tk8.6$1/win; then
+ TK_BIN_DIR_DEFAULT=../../tk8.6$1/win
+ elif test -d ../../tk8.6/win; then
+ TK_BIN_DIR_DEFAULT=../../tk8.6/win
else
TK_BIN_DIR_DEFAULT=../../tk/win
fi
- AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.5 binaries from DIR],
+ AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.6 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)
@@ -248,7 +248,7 @@ AC_DEFUN([SC_ENABLE_SHARED], [
AC_DEFUN([SC_ENABLE_THREADS], [
AC_MSG_CHECKING(for building with threads)
AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
- [tcl_ok=$enableval], [tcl_ok=no])
+ [tcl_ok=$enableval], [tcl_ok=yes])
if test "$tcl_ok" = "yes"; then
AC_MSG_RESULT(yes)
@@ -259,7 +259,7 @@ AC_DEFUN([SC_ENABLE_THREADS], [
AC_DEFINE(USE_THREAD_ALLOC)
else
TCL_THREADS=0
- AC_MSG_RESULT([no (default)])
+ AC_MSG_RESULT(no)
fi
AC_SUBST(TCL_THREADS)
])
@@ -402,6 +402,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# Set some defaults (may get changed below)
EXTRA_CFLAGS=""
+ AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden])
AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
@@ -436,6 +437,22 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
cyg_conftest=
fi
+ AC_CACHE_CHECK(for Cygwin version of gcc,
+ ac_cv_cygwin,
+ AC_TRY_COMPILE([
+ #ifdef __CYGWIN__
+ #error cygwin
+ #endif
+ ],
+ [],
+ ac_cv_cygwin=no,
+ ac_cv_cygwin=yes)
+ )
+ if test "$ac_cv_cygwin" = "yes" ; then
+ AC_MSG_WARN([Compiling under Cygwin is not currently supported.
+If you are not sure you want this, see the README
+file for information about building with Mingw.])
+ fi
if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then
DEPARG='"$<"'
else
@@ -447,8 +464,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AC_MSG_CHECKING([compiler flags])
if test "${GCC}" = "yes" ; then
SHLIB_LD=""
- SHLIB_LD_LIBS=""
- LIBS="-lws2_32"
+ SHLIB_LD_LIBS='${LIBS}'
+ LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32"
# mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't
LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32"
STLIB_LD='${AR} cr'
@@ -480,13 +497,28 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
rm -f ac$$.o ac$$.c
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain"
+ AC_CACHE_CHECK(for working -municode linker flag,
+ ac_cv_municode,
+ AC_TRY_LINK([
+ #include <windows.h>
+ int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;}
+ ],
+ [],
+ ac_cv_municode=yes,
+ ac_cv_municode=no)
+ )
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_municode" = "yes" ; then
+ extra_ldflags="$extra_ldflags -municode"
+ else
+ extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS"
+ fi
+
if test "${SHARED_BUILD}" = "0" ; then
# static
AC_MSG_RESULT([using static flags])
runtime=
- MAKE_DLL="echo "
- LIBSUFFIX="s\${DBGX}.a"
- LIBFLAGSUFFIX="s\${DBGX}"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
else
@@ -500,30 +532,30 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
runtime=
- # Link with gcc since ld does not link to default libs like
- # -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}'
- SHLIB_LD_LIBS='${LIBS}'
# 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"
- LIBFLAGSUFFIX="\${DBGX}"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # Link with gcc since ld does not link to default libs like
+ # -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}'
+ SHLIB_LD_LIBS='${LIBS}'
+ MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \
+ -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\[$]@)"
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ LIBSUFFIX="\${DBGX}.a"
+ LIBFLAGSUFFIX="\${DBGX}"
SHLIB_SUFFIX=.dll
EXTRA_CFLAGS="${extra_cflags}"
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
- CFLAGS_WARNING="-Wall"
+ CFLAGS_WARNING="-Wall -Wdeclaration-after-statement"
LDFLAGS_DEBUG=
LDFLAGS_OPTIMIZE=
@@ -578,27 +610,22 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# static
AC_MSG_RESULT([using static flags])
runtime=-MT
- MAKE_DLL="echo "
- LIBSUFFIX="s\${DBGX}.lib"
- LIBFLAGSUFFIX="s\${DBGX}"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- SHLIB_LD_LIBS=""
else
# dynamic
AC_MSG_RESULT([using shared flags])
runtime=-MD
# Add SHLIB_LD_LIBS to the Make rule, not here.
- MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@"
- LIBSUFFIX="\${DBGX}.lib"
- LIBFLAGSUFFIX="\${DBGX}"
- EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
- SHLIB_LD_LIBS='${LIBS}'
+ EXESUFFIX="\${DBGX}.exe"
fi
+ MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@"
# DLLSUFFIX is separate because it is the building block for
# users of tclConfig.sh that may build shared or static.
DLLSUFFIX="\${DBGX}.dll"
+ LIBSUFFIX="\${DBGX}.lib"
+ LIBFLAGSUFFIX="\${DBGX}"
# This is a 2-stage check to make sure we have the 64-bit SDK
# We have to know where the SDK is installed.
@@ -628,7 +655,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
fi
- LIBS="user32.lib advapi32.lib ws2_32.lib"
+ LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib"
if test "$do64bit" != "no" ; then
# The space-based-path will work for the Makefile, but will
# not work if AC_TRY_COMPILE is called. TEA has the
@@ -753,6 +780,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
fi
SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}"
+ SHLIB_LD_LIBS='${LIBS}'
# link -lib only works when -lib is the first arg
STLIB_LD="${LINKBIN} -lib ${lflags}"
RC_OUT=-fo
@@ -817,13 +845,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
#------------------------------------------------------------------------
AC_DEFUN([SC_WITH_TCL], [
- if test -d ../../tcl8.5$1/win; then
- TCL_BIN_DEFAULT=../../tcl8.5$1/win
+ if test -d ../../tcl8.6$1/win; then
+ TCL_BIN_DEFAULT=../../tcl8.6$1/win
else
- TCL_BIN_DEFAULT=../../tcl8.5/win
+ TCL_BIN_DEFAULT=../../tcl8.6/win
fi
- AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.5 binaries from DIR],
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 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)
diff --git a/win/tkWin.h b/win/tkWin.h
index d97adc7..adb943b 100644
--- a/win/tkWin.h
+++ b/win/tkWin.h
@@ -18,14 +18,14 @@
* the SystemParametersInfo API doesn't like to receive structures that
* are larger than it expects which affects the font assignements.
*
- * WINVER = 0x0410 means Windows 98 and above
+ * WINVER = 0x0500 means Windows 2000 and above
*/
#ifndef WINVER
-#define WINVER 0x0410
+#define WINVER 0x0500
#endif
-#ifndef _WIN32_WINDOWS
-#define _WIN32_WINDOWS 0x0410
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0500
#endif
#ifndef _TK
@@ -36,11 +36,6 @@
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
-#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* The following messages are used to communicate between a Tk toplevel
* and its container window. A Tk container may not be able to provide
@@ -83,7 +78,4 @@
#include "tkPlatDecls.h"
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif /* _TKWIN */
diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c
index efefe86..b733f78 100644
--- a/win/tkWin32Dll.c
+++ b/win/tkWin32Dll.c
@@ -133,11 +133,11 @@ DllMain(
"leaq %[registration], %%rdx" "\n\t"
"movq %%gs:0, %%rax" "\n\t"
- "movq %%rax, 0x0(%%edx)" "\n\t" /* link */
+ "movq %%rax, 0x0(%%rdx)" "\n\t" /* link */
"leaq 1f, %%rax" "\n\t"
"movq %%rax, 0x8(%%rdx)" "\n\t" /* handler */
- "movq %%rbp, 0x10(%%rdx)" "\n\t" /* ebp */
- "movq %%rsp, 0x18(%%rdx)" "\n\t" /* esp */
+ "movq %%rbp, 0x10(%%rdx)" "\n\t" /* rbp */
+ "movq %%rsp, 0x18(%%rdx)" "\n\t" /* rsp */
"movl %[error], 0x20(%%rdx)" "\n\t" /* status */
/*
diff --git a/win/tkWin3d.c b/win/tkWin3d.c
index df6aa95..d3c443d 100644
--- a/win/tkWin3d.c
+++ b/win/tkWin3d.c
@@ -43,7 +43,7 @@ typedef struct {
TkBorder *
TkpGetBorder(void)
{
- WinBorder *borderPtr = (WinBorder *) ckalloc(sizeof(WinBorder));
+ WinBorder *borderPtr = ckalloc(sizeof(WinBorder));
borderPtr->light2ColorPtr = NULL;
borderPtr->dark2ColorPtr = NULL;
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index af1058d..ca6d48e 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -86,11 +86,11 @@ static void InitBoxes(void);
* The class procedure table for the button widgets.
*/
-Tk_ClassProcs tkpButtonProcs = {
+const Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
CreateProc, /* createProc */
- NULL
+ NULL /* modalProc */
};
@@ -131,7 +131,7 @@ InitBoxes(void)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- hrsrc = FindResource(module, "buttons", RT_BITMAP);
+ hrsrc = FindResource(module, TEXT("buttons"), RT_BITMAP);
if (hrsrc == NULL) {
Tcl_Panic("FindResource() failed for buttons bitmap resource, "
"resources in tk_base.rc must be linked into Tk dll or static executable");
@@ -148,7 +148,7 @@ InitBoxes(void)
&& !(tsdPtr->boxesPtr->biHeight % 2)) {
size = tsdPtr->boxesPtr->biSize + (1 << tsdPtr->boxesPtr->biBitCount)
* sizeof(RGBQUAD) + tsdPtr->boxesPtr->biSizeImage;
- newBitmap = (LPBITMAPINFOHEADER) ckalloc(size);
+ newBitmap = ckalloc(size);
memcpy(newBitmap, tsdPtr->boxesPtr, size);
tsdPtr->boxesPtr = newBitmap;
tsdPtr->boxWidth = tsdPtr->boxesPtr->biWidth / 4;
@@ -181,15 +181,12 @@ InitBoxes(void)
*/
void
-TkpButtonSetDefaults(
- Tk_OptionSpec *specPtr) /* Points to an array of option specs,
- * terminated by one with type
- * TK_OPTION_END. */
+TkpButtonSetDefaults()
{
int width = GetSystemMetrics(SM_CXEDGE);
- if (width > 0) {
- sprintf(tkDefButtonBorderWidth, "%d", width);
- }
+ if (width > 0) {
+ sprintf(tkDefButtonBorderWidth, "%d", width);
+ }
}
/*
@@ -214,7 +211,7 @@ TkpCreateButton(
{
WinButton *butPtr;
- butPtr = (WinButton *)ckalloc(sizeof(WinButton));
+ butPtr = ckalloc(sizeof(WinButton));
butPtr->hwnd = NULL;
return (TkButton *) butPtr;
}
@@ -244,15 +241,15 @@ CreateProc(
{
Window window;
HWND parent;
- char *class;
+ const TCHAR *class;
WinButton *butPtr = (WinButton *)instanceData;
parent = Tk_GetHWND(parentWin);
if (butPtr->info.type == TYPE_LABEL) {
- class = "STATIC";
+ class = TEXT("STATIC");
butPtr->style = SS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
} else {
- class = "BUTTON";
+ class = TEXT("BUTTON");
butPtr->style = BS_OWNERDRAW | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
}
butPtr->hwnd = CreateWindow(class, NULL, butPtr->style,
@@ -261,7 +258,7 @@ CreateProc(
SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC,
- (INT_PTR) ButtonProc);
+ (LONG_PTR) ButtonProc);
window = Tk_AttachHWND(tkwin, butPtr->hwnd);
return window;
@@ -291,7 +288,7 @@ TkpDestroyButton(
HWND hwnd = winButPtr->hwnd;
if (hwnd) {
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) winButPtr->oldProc);
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc);
}
}
@@ -1277,7 +1274,7 @@ ButtonProc(
if (code != TCL_OK && code != TCL_CONTINUE
&& code != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (button invoke)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
Tcl_Release((ClientData)interp);
}
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c
index 6007e56..cffb0ee 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -104,7 +104,7 @@ TkSelGetSelection(
*/
locale = LANGIDFROMLCID(*((int*)data));
- GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE,
+ GetLocaleInfoA(locale, LOCALE_IDEFAULTANSICODEPAGE,
Tcl_DStringValue(&ds)+2, Tcl_DStringLength(&ds)-2);
GlobalUnlock(handle);
@@ -156,7 +156,7 @@ TkSelGetSelection(
* Pass the data off to the selection procedure.
*/
- result = (*proc)(clientData, interp, Tcl_DStringValue(&ds));
+ result = proc(clientData, interp, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
CloseClipboard();
return result;
@@ -273,7 +273,7 @@ TkWinClipboardRender(
* Copy the data and change EOL characters.
*/
- buffer = rawText = ckalloc((unsigned)length + 1);
+ buffer = rawText = ckalloc(length + 1);
if (targetPtr != NULL) {
for (cbPtr = targetPtr->firstBufferPtr; cbPtr != NULL;
cbPtr = cbPtr->nextPtr) {
@@ -293,7 +293,7 @@ TkWinClipboardRender(
* encoding before placing it on the clipboard.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
+#ifdef UNICODE
Tcl_DStringInit(&ds);
Tcl_UtfToUniCharDString(rawText, -1, &ds);
ckfree(rawText);
@@ -309,7 +309,7 @@ TkWinClipboardRender(
GlobalUnlock(handle);
Tcl_DStringFree(&ds);
SetClipboardData(CF_UNICODETEXT, handle);
- } else {
+#else
Tcl_UtfToExternalDString(NULL, rawText, -1, &ds);
ckfree(rawText);
handle = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
@@ -324,7 +324,7 @@ TkWinClipboardRender(
GlobalUnlock(handle);
Tcl_DStringFree(&ds);
SetClipboardData(CF_TEXT, handle);
- }
+#endif
}
/*
@@ -383,7 +383,7 @@ UpdateClipboard(
* possible.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
+ if (TkWinGetPlatformId() != VER_PLATFORM_WIN32_WINDOWS) {
SetClipboardData(CF_UNICODETEXT, NULL);
} else {
SetClipboardData(CF_TEXT, NULL);
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index 234c736..0057573 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -31,11 +31,11 @@ typedef struct WinColor {
*/
typedef struct {
- char *name;
+ const char *name;
int index;
} SystemColorEntry;
-static SystemColorEntry sysColors[] = {
+static const SystemColorEntry sysColors[] = {
{"3dDarkShadow", COLOR_3DDKSHADOW},
{"3dLight", COLOR_3DLIGHT},
{"ActiveBorder", COLOR_ACTIVEBORDER},
@@ -61,15 +61,9 @@ static SystemColorEntry sysColors[] = {
{"Scrollbar", COLOR_SCROLLBAR},
{"Window", COLOR_WINDOW},
{"WindowFrame", COLOR_WINDOWFRAME},
- {"WindowText", COLOR_WINDOWTEXT},
- {NULL, 0}
+ {"WindowText", COLOR_WINDOWTEXT}
};
-typedef struct ThreadSpecificData {
- int ncolors;
-} ThreadSpecificData;
-static Tcl_ThreadDataKey dataKey;
-
/*
* Forward declarations for functions defined later in this file.
*/
@@ -102,37 +96,15 @@ FindSystemColor(
int *indexPtr) /* Out parameter to store color index. */
{
int l, u, r, i;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- /*
- * Count the number of elements in the color array if we haven't done so
- * yet.
- */
-
- if (tsdPtr->ncolors == 0) {
- SystemColorEntry *ePtr;
- int version;
-
- version = LOBYTE(LOWORD(GetVersion()));
- for (ePtr = sysColors; ePtr->name != NULL; ePtr++) {
- if (version < 4) {
- if (ePtr->index == COLOR_3DDKSHADOW) {
- ePtr->index = COLOR_BTNSHADOW;
- } else if (ePtr->index == COLOR_3DLIGHT) {
- ePtr->index = COLOR_BTNHIGHLIGHT;
- }
- }
- tsdPtr->ncolors++;
- }
- }
+ int index;
+ int version = LOBYTE(LOWORD(GetVersion()));
/*
* Perform a binary search on the sorted array of colors.
*/
l = 0;
- u = tsdPtr->ncolors - 1;
+ u = (sizeof(sysColors) / sizeof(sysColors[0])) - 1;
while (l <= u) {
i = (l + u) / 2;
r = strcasecmp(name, sysColors[i].name);
@@ -148,8 +120,16 @@ FindSystemColor(
return 0;
}
- *indexPtr = sysColors[i].index;
- colorPtr->pixel = GetSysColor(sysColors[i].index);
+ index = sysColors[i].index;
+ if (version < 4) {
+ if (index == COLOR_3DDKSHADOW) {
+ index = COLOR_BTNSHADOW;
+ } else if (index == COLOR_3DLIGHT) {
+ index = COLOR_BTNHIGHLIGHT;
+ }
+ }
+ *indexPtr = index;
+ colorPtr->pixel = GetSysColor(index);
/*
* x257 is (value<<8 + value) to get the properly bit shifted and padded
@@ -202,7 +182,7 @@ TkpGetColor(
&& FindSystemColor(name+6, &color, &index))
|| XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), name,
&color)) {
- winColPtr = (WinColor *) ckalloc(sizeof(WinColor));
+ winColPtr = ckalloc(sizeof(WinColor));
winColPtr->info.color = color;
winColPtr->index = index;
@@ -240,7 +220,7 @@ TkpGetColorByValue(
XColor *colorPtr) /* Red, green, and blue fields indicate
* desired color. */
{
- WinColor *tkColPtr = (WinColor *) ckalloc(sizeof(WinColor));
+ WinColor *tkColPtr = ckalloc(sizeof(WinColor));
tkColPtr->info.color.red = colorPtr->red;
tkColPtr->info.color.green = colorPtr->green;
@@ -375,7 +355,7 @@ XAllocColor(
color->blue = closeEntry.peBlue * 257;
entry = closeEntry;
if (index >= cmap->size) {
- OutputDebugString("XAllocColor: Colormap is bigger than we thought");
+ OutputDebugStringA("XAllocColor: Colormap is bigger than we thought");
}
} else {
cmap->size++;
@@ -454,7 +434,7 @@ XFreeColors(
for (i = 0; i < npixels; i++) {
entryPtr = Tcl_FindHashEntry(&cmap->refCounts, INT2PTR(pixels[i]));
if (!entryPtr) {
- Tcl_Panic("Tried to free a color that isn't allocated.");
+ Tcl_Panic("Tried to free a color that isn't allocated");
}
refCount = PTR2INT(Tcl_GetHashValue(entryPtr)) - 1;
if (refCount == 0) {
@@ -463,14 +443,13 @@ XFreeColors(
GetPaletteEntries(cmap->palette, index, 1, &entry);
if (cref == RGB(entry.peRed, entry.peGreen, entry.peBlue)) {
count = cmap->size - index;
- entries = (PALETTEENTRY *)
- ckalloc(sizeof(PALETTEENTRY) * count);
+ entries = ckalloc(sizeof(PALETTEENTRY) * count);
GetPaletteEntries(cmap->palette, index+1, count, entries);
SetPaletteEntries(cmap->palette, index, count, entries);
- ckfree((char *) entries);
+ ckfree(entries);
cmap->size--;
} else {
- Tcl_Panic("Tried to free a color that isn't allocated.");
+ Tcl_Panic("Tried to free a color that isn't allocated");
}
Tcl_DeleteHashEntry(entryPtr);
} else {
@@ -523,7 +502,7 @@ XCreateColormap(
logPalettePtr->palNumEntries = GetPaletteEntries(sysPal, 0, 256,
logPalettePtr->palPalEntry);
- cmap = (TkWinColormap *) ckalloc(sizeof(TkWinColormap));
+ cmap = ckalloc(sizeof(TkWinColormap));
cmap->size = logPalettePtr->palNumEntries;
cmap->stale = 0;
cmap->palette = CreatePalette(logPalettePtr);
@@ -568,10 +547,10 @@ XFreeColormap(
TkWinColormap *cmap = (TkWinColormap *) colormap;
if (!DeleteObject(cmap->palette)) {
- Tcl_Panic("Unable to free colormap, palette is still selected.");
+ Tcl_Panic("Unable to free colormap, palette is still selected");
}
Tcl_DeleteHashTable(&cmap->refCounts);
- ckfree((char *) cmap);
+ ckfree(cmap);
}
/*
diff --git a/win/tkWinConfig.c b/win/tkWinConfig.c
index 422e399..aeb9405 100644
--- a/win/tkWinConfig.c
+++ b/win/tkWinConfig.c
@@ -35,8 +35,8 @@
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. */
+ const char *dbName, /* The option database name. */
+ const char *className) /* The name of the option class. */
{
Tcl_Obj *valueObjPtr;
Tk_Uid classUid;
diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c
index dee3419..8366db3 100644
--- a/win/tkWinCursor.c
+++ b/win/tkWinCursor.c
@@ -40,7 +40,7 @@ typedef struct {
*/
static struct CursorName {
- char *name;
+ const char *name;
LPCTSTR id;
} cursorNames[] = {
{"starting", IDC_APPSTARTING},
@@ -73,7 +73,7 @@ static struct CursorName {
#define TK_DEFAULT_CURSOR IDC_ARROW
-
+
/*
*----------------------------------------------------------------------
*
@@ -100,7 +100,7 @@ TkGetCursorByName(
struct CursorName *namePtr;
TkWinCursor *cursorPtr;
int argc;
- CONST char **argv = NULL;
+ const char **argv = NULL;
/*
* All cursor names are valid lists of one element (for
@@ -114,7 +114,7 @@ TkGetCursorByName(
goto badCursorSpec;
}
- cursorPtr = (TkWinCursor *) ckalloc(sizeof(TkWinCursor));
+ cursorPtr = ckalloc(sizeof(TkWinCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursorPtr;
cursorPtr->winCursor = NULL;
cursorPtr->system = 0;
@@ -133,11 +133,11 @@ TkGetCursorByName(
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't get cursor from a file in",
" a safe interpreter", NULL);
- ckfree((char *) argv);
- ckfree((char *) cursorPtr);
+ ckfree(argv);
+ ckfree(cursorPtr);
return NULL;
}
- cursorPtr->winCursor = LoadCursorFromFile(&(argv[0][1]));
+ cursorPtr->winCursor = LoadCursorFromFileA(&(argv[0][1]));
} else {
/*
* Check for the cursor in the system cursor set.
@@ -156,24 +156,23 @@ TkGetCursorByName(
* one of our application resources.
*/
- cursorPtr->winCursor = LoadCursor(Tk_GetHINSTANCE(), argv[0]);
+ cursorPtr->winCursor = LoadCursorA(Tk_GetHINSTANCE(), argv[0]);
} else {
cursorPtr->system = 1;
}
}
if (cursorPtr->winCursor == NULL) {
- ckfree((char *) cursorPtr);
+ ckfree(cursorPtr);
badCursorSpec:
- ckfree((char *) argv);
+ ckfree(argv);
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
return NULL;
- } else {
- ckfree((char *) argv);
- return (TkCursor *) cursorPtr;
}
+ ckfree(argv);
+ return (TkCursor *) cursorPtr;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -193,8 +192,8 @@ TkGetCursorByName(
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. */
+ 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. */
@@ -202,7 +201,7 @@ TkCreateCursorFromData(
{
return NULL;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -226,7 +225,7 @@ TkpFreeCursor(
{
/* TkWinCursor *winCursorPtr = (TkWinCursor *) cursorPtr; */
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -261,7 +260,7 @@ TkpSetCursor(
SetCursor(hcursor);
}
}
-
+
/*
* Local Variables:
* mode: c
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index a1a76c7..11c3e6d 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -68,7 +68,7 @@
#define DEF_BUTTON_HIGHLIGHT HIGHLIGHT
#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
#define DEF_BUTTON_HIGHLIGHT_WIDTH "1"
-#define DEF_BUTTON_IMAGE (char *) NULL
+#define DEF_BUTTON_IMAGE ((char *) NULL)
#define DEF_BUTTON_INDICATOR "1"
#define DEF_BUTTON_JUSTIFY "center"
#define DEF_BUTTON_OFF_VALUE "0"
@@ -84,10 +84,10 @@
#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_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_TAKE_FOCUS ((char *) NULL)
#define DEF_BUTTON_TEXT ""
#define DEF_BUTTON_TEXT_VARIABLE ""
#define DEF_BUTTON_TRISTATE_VALUE ""
@@ -126,7 +126,7 @@
#define DEF_CANVAS_SELECT_BD_MONO "0"
#define DEF_CANVAS_SELECT_FG_COLOR SELECT_FG
#define DEF_CANVAS_SELECT_FG_MONO WHITE
-#define DEF_CANVAS_TAKE_FOCUS (char *) NULL
+#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"
@@ -167,9 +167,9 @@
#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_SHOW ((char *) NULL)
#define DEF_ENTRY_STATE "normal"
-#define DEF_ENTRY_TAKE_FOCUS (char *) NULL
+#define DEF_ENTRY_TAKE_FOCUS ((char *) NULL)
#define DEF_ENTRY_TEXT_VARIABLE ""
#define DEF_ENTRY_WIDTH "20"
@@ -235,36 +235,36 @@
#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_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_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_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_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_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_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_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_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_SELECT ((char *) NULL)
#define DEF_MENU_ENTRY_UNDERLINE "-1"
/*
@@ -290,7 +290,7 @@
#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_TEAROFF_CMD ((char *) NULL)
#define DEF_MENU_TITLE ""
#define DEF_MENU_TYPE "normal"
@@ -318,7 +318,7 @@
#define DEF_MENUBUTTON_HIGHLIGHT_BG_MONO DEF_MENUBUTTON_BG_MONO
#define DEF_MENUBUTTON_HIGHLIGHT HIGHLIGHT
#define DEF_MENUBUTTON_HIGHLIGHT_WIDTH "0"
-#define DEF_MENUBUTTON_IMAGE (char *) NULL
+#define DEF_MENUBUTTON_IMAGE ((char *) NULL)
#define DEF_MENUBUTTON_INDICATOR "0"
#define DEF_MENUBUTTON_JUSTIFY "center"
#define DEF_MENUBUTTON_MENU ""
@@ -418,7 +418,7 @@
#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_DELAY "300"
#define DEF_SCALE_REPEAT_INTERVAL "100"
#define DEF_SCALE_RESOLUTION "1"
#define DEF_SCALE_TROUGH_COLOR TROUGH
@@ -427,7 +427,7 @@
#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_TAKE_FOCUS ((char *) NULL)
#define DEF_SCALE_TICK_INTERVAL "0"
#define DEF_SCALE_TO "100"
#define DEF_SCALE_VARIABLE ""
@@ -454,7 +454,7 @@
#define DEF_SCROLLBAR_RELIEF "sunken"
#define DEF_SCROLLBAR_REPEAT_DELAY "300"
#define DEF_SCROLLBAR_REPEAT_INTERVAL "100"
-#define DEF_SCROLLBAR_TAKE_FOCUS (char *) NULL
+#define DEF_SCROLLBAR_TAKE_FOCUS ((char *) NULL)
#define DEF_SCROLLBAR_TROUGH_COLOR TROUGH
#define DEF_SCROLLBAR_TROUGH_MONO WHITE
#define DEF_SCROLLBAR_WIDTH "10"
@@ -481,8 +481,9 @@
#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_UNFOCUSSED "none"
#define DEF_TEXT_INSERT_WIDTH "2"
-#define DEF_TEXT_MAX_UNDO "0"
+#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
@@ -501,8 +502,8 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TABSTYLE "tabular"
-#define DEF_TEXT_TAKE_FOCUS (char *) NULL
-#define DEF_TEXT_UNDO "0"
+#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 ""
@@ -524,4 +525,10 @@
#define DEF_TOPLEVEL_SCREEN ""
#define DEF_TOPLEVEL_USE ""
+/*
+ * Defaults for busy windows:
+ */
+
+#define DEF_BUSY_CURSOR "wait"
+
#endif /* _TKWINDEFAULT */
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 6b50215..9ed5875 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -9,10 +9,9 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#define WINVER 0x0500 /* Requires Windows 2K definitions */
-#define _WIN32_WINNT 0x0500
#include "tkWinInt.h"
#include "tkFileFilter.h"
+#include "tkFont.h"
#include <commdlg.h> /* includes common dialog functionality */
#ifdef _MSC_VER
@@ -53,12 +52,12 @@
/*
* The following structure is used by the new Tk_ChooseDirectoryObjCmd to pass
- * data between it and its callback. Unqiue to Winodws platform.
+ * data between it and its callback. Unique to Windows platform.
*/
typedef struct ChooseDirData {
- TCHAR utfInitDir[MAX_PATH]; /* Initial folder to use */
- TCHAR utfRetDir[MAX_PATH]; /* Returned folder to use */
+ char utfInitDir[MAX_PATH]; /* Initial folder to use */
+ char utfRetDir[MAX_PATH]; /* Returned folder to use */
Tcl_Interp *interp;
int mustExist; /* True if file must exist to return from
* callback */
@@ -139,7 +138,7 @@ static const struct {int type; int btnIds[3];} allowedTypes[] = {
SetWindowLongPtr((to), GWLP_USERDATA, (LPARAM)(what))
/*
- * The value of TK_MULTI_MAX_PATH dictactes how many files can be retrieved
+ * The value of TK_MULTI_MAX_PATH dictates 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
*
@@ -163,7 +162,7 @@ typedef struct ChooseDir {
* directory or return. */
int lastIdx; /* Last item that was selected in directory
* browser listbox. */
- TCHAR path[MAX_PATH]; /* On return from choose directory dialog,
+ char path[MAX_PATH]; /* On return from choose directory dialog,
* holds the selected path. Cannot return
* selected path in ofnPtr->lpstrFile because
* the default dialog proc stores a '\0' in
@@ -173,8 +172,8 @@ typedef struct ChooseDir {
} ChooseDir;
/*
- * The following structure is used to pass information between GetFileName/W
- * functions and OFN dialog hook procedures. [Bug 2896501, Patch 2898255]
+ * The following structure is used to pass information between GetFileName
+ * function and OFN dialog hook procedures. [Bug 2896501, Patch 2898255]
*/
typedef struct OFNData {
@@ -183,8 +182,7 @@ typedef struct OFNData {
int dynFileBufferSize; /* Dynamic filename buffer size, stored to
* avoid shrinking and expanding the buffer
* when selection changes */
- char *dynFileBuffer; /* Dynamic filename buffer, cast to WCHAR* in
- * UNICODE procedures */
+ TCHAR *dynFileBuffer; /* Dynamic filename buffer */
} OFNData;
/*
@@ -195,18 +193,13 @@ static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg,
LPARAM wParam, LPARAM lParam);
static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
-static int GetFileNameA(ClientData clientData,
+static int GetFileName(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], int isOpen);
-static int GetFileNameW(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], int isOpen);
+ Tcl_Obj *const objv[], int isOpen);
static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr,
Tcl_DString *dsPtr, Tcl_Obj *initialPtr,
- int *index);
-static UINT APIENTRY OFNHookProcA(HWND hdlg, UINT uMsg, WPARAM wParam,
- LPARAM lParam);
-static UINT APIENTRY OFNHookProcW(HWND hdlg, UINT uMsg, WPARAM wParam,
+ int *indexPtr);
+static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam);
static void SetTkDialog(ClientData clientData);
@@ -252,10 +245,10 @@ EatSpuriousMessageBugFix(void)
DWORD nTime = GetTickCount() + 250;
while (GetTickCount() < nTime) {
- if (PeekMessage(&msg, 0, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE)){
+ if (PeekMessageA(&msg, 0, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE)){
break;
}
- PeekMessage(&msg, 0, WM_LBUTTONUP, WM_LBUTTONUP, PM_REMOVE);
+ PeekMessageA(&msg, 0, WM_LBUTTONUP, WM_LBUTTONUP, PM_REMOVE);
}
}
@@ -282,7 +275,7 @@ void
TkWinDialogDebug(
int debug)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->debugFlag = debug;
@@ -312,16 +305,16 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData, parent;
+ Tk_Window tkwin = clientData, parent;
HWND hWnd;
int i, oldMode, winCode, result;
CHOOSECOLOR chooseColor;
static int inited = 0;
static COLORREF dwCustColors[16];
static long oldColor; /* the color selected last time */
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-initialcolor", "-parent", "-title", NULL
};
enum options {
@@ -357,7 +350,7 @@ Tk_ChooseColorObjCmd(
for (i = 1; i < objc; i += 2) {
int index;
- char *string;
+ const char *string;
Tcl_Obj *optionPtr, *valuePtr;
optionPtr = objv[i];
@@ -470,7 +463,7 @@ ColorDlgHookProc(
WPARAM wParam, /* First message parameter. */
LPARAM lParam) /* Second message parameter. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
const char *title;
CHOOSECOLOR *ccPtr;
@@ -487,13 +480,12 @@ ColorDlgHookProc(
if ((title != NULL) && (title[0] != '\0')) {
Tcl_DString ds;
- (*tkWinProcs->setWindowText)(hDlg,
- Tcl_WinUtfToTChar(title, -1, &ds));
+ SetWindowText(hDlg, Tcl_WinUtfToTChar(title,-1,&ds));
Tcl_DStringFree(&ds);
}
if (tsdPtr->debugFlag) {
tsdPtr->debugInterp = (Tcl_Interp *) ccPtr->lpTemplateName;
- Tcl_DoWhenIdle(SetTkDialog, (ClientData) hDlg);
+ Tcl_DoWhenIdle(SetTkDialog, hDlg);
}
return TRUE;
}
@@ -522,13 +514,9 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- return GetFileNameW(clientData, interp, objc, objv, 1);
- } else {
- return GetFileNameA(clientData, interp, objc, objv, 1);
- }
+ return GetFileName(clientData, interp, objc, objv, 1);
}
/*
@@ -553,19 +541,15 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- return GetFileNameW(clientData, interp, objc, objv, 0);
- } else {
- return GetFileNameA(clientData, interp, objc, objv, 0);
- }
+ return GetFileName(clientData, interp, objc, objv, 0);
}
/*
*----------------------------------------------------------------------
*
- * GetFileNameW --
+ * GetFileName --
*
* Calls GetOpenFileName() or GetSaveFileName().
*
@@ -579,22 +563,22 @@ Tk_GetSaveFileObjCmd(
*/
static int
-GetFileNameW(
+GetFileName(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
+ Tcl_Obj *const objv[], /* Argument objects. */
int open) /* 1 to call GetOpenFileName(), 0 to call
* GetSaveFileName(). */
{
- OPENFILENAMEW ofn;
- WCHAR file[TK_MULTI_MAX_PATH];
+ OPENFILENAME ofn;
+ TCHAR file[TK_MULTI_MAX_PATH];
OFNData ofnData;
int cdlgerr;
int filterIndex = 0, result = TCL_ERROR, winCode, oldMode, i, multi = 0;
int inValue, confirmOverwrite = 1;
- char *extension = NULL, *title = NULL;
- Tk_Window tkwin = (Tk_Window) clientData;
+ const char *extension = NULL, *title = NULL;
+ Tk_Window tkwin = clientData;
HWND hWnd;
Tcl_Obj *filterObj = NULL, *initialTypeObj = NULL, *typeVariableObj = NULL;
Tcl_DString utfFilterString, utfDirString, ds;
@@ -602,13 +586,13 @@ GetFileNameW(
Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static CONST char *saveOptionStrings[] = {
+ static const char *const saveOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
"-parent", "-title", "-typevariable",
"-confirmoverwrite",
NULL
};
- static CONST char *openOptionStrings[] = {
+ static const char *const openOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
"-parent", "-title", "-typevariable",
"-multiple",
@@ -627,7 +611,7 @@ GetFileNameW(
for (i = 1; i < objc; i += 2) {
int index;
- char *string;
+ const char *string;
Tcl_Obj *optionPtr, *valuePtr;
optionPtr = objv[i];
@@ -708,19 +692,19 @@ GetFileNameW(
Tk_MakeWindowExist(tkwin);
hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- ZeroMemory(&ofn, sizeof(OPENFILENAMEW));
+ ZeroMemory(&ofn, sizeof(OPENFILENAME));
if (LOBYTE(LOWORD(GetVersion())) < 5) {
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
} else {
- ofn.lStructSize = sizeof(OPENFILENAMEW);
+ ofn.lStructSize = sizeof(OPENFILENAME);
}
ofn.hwndOwner = hWnd;
ofn.hInstance = TkWinGetHInstance(ofn.hwndOwner);
- ofn.lpstrFile = (WCHAR *) file;
+ ofn.lpstrFile = file;
ofn.nMaxFile = TK_MULTI_MAX_PATH;
ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR
| OFN_EXPLORER | OFN_ENABLEHOOK| OFN_ENABLESIZING;
- ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProcW;
+ ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProc;
ofn.lCustData = (LPARAM) &ofnData;
if (open != 0) {
@@ -739,19 +723,19 @@ GetFileNameW(
* procedure when necessary
*/
- ofnData.dynFileBufferSize = 1024;
- ofnData.dynFileBuffer = ckalloc(1024);
+ ofnData.dynFileBufferSize = 512;
+ ofnData.dynFileBuffer = ckalloc(512 * sizeof(TCHAR));
}
if (extension != NULL) {
Tcl_UtfToExternalDString(unicodeEncoding, extension, -1, &extString);
- ofn.lpstrDefExt = (WCHAR *) Tcl_DStringValue(&extString);
+ ofn.lpstrDefExt = (TCHAR *) Tcl_DStringValue(&extString);
}
Tcl_UtfToExternalDString(unicodeEncoding,
Tcl_DStringValue(&utfFilterString),
Tcl_DStringLength(&utfFilterString), &filterString);
- ofn.lpstrFilter = (WCHAR *) Tcl_DStringValue(&filterString);
+ ofn.lpstrFilter = (TCHAR *) Tcl_DStringValue(&filterString);
ofn.nFilterIndex = filterIndex;
if (Tcl_DStringValue(&utfDirString)[0] != '\0') {
@@ -777,11 +761,11 @@ GetFileNameW(
}
Tcl_DStringFree(&cwd);
}
- ofn.lpstrInitialDir = (WCHAR *) Tcl_DStringValue(&dirString);
+ ofn.lpstrInitialDir = (TCHAR *) Tcl_DStringValue(&dirString);
if (title != NULL) {
Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString);
- ofn.lpstrTitle = (WCHAR *) Tcl_DStringValue(&titleString);
+ ofn.lpstrTitle = (TCHAR *) Tcl_DStringValue(&titleString);
}
/*
@@ -790,9 +774,9 @@ GetFileNameW(
oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
if (open != 0) {
- winCode = GetOpenFileNameW(&ofn);
+ winCode = GetOpenFileName(&ofn);
} else {
- winCode = GetSaveFileNameW(&ofn);
+ winCode = GetSaveFileName(&ofn);
}
Tcl_SetServiceMode(oldMode);
EatSpuriousMessageBugFix();
@@ -841,7 +825,7 @@ GetFileNameW(
* first element is the directory path.
*/
- WCHAR *files = (WCHAR *) ofnData.dynFileBuffer;
+ TCHAR *files = ofnData.dynFileBuffer;
Tcl_Obj *returnList = Tcl_NewObj();
int count = 0;
@@ -945,7 +929,7 @@ GetFileNameW(
/*
*-------------------------------------------------------------------------
*
- * OFNHookProcW --
+ * OFNHookProc --
*
* Dialog box hook function. This is used to sets the "tk_dialog"
* variable for test/debugging when the dialog is ready to receive
@@ -962,561 +946,13 @@ GetFileNameW(
*/
static UINT APIENTRY
-OFNHookProcW(
+OFNHookProc(
HWND hdlg, /* Handle to child dialog window. */
UINT uMsg, /* Message identifier */
WPARAM wParam, /* Message parameter */
LPARAM lParam) /* Message parameter */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- OPENFILENAMEW *ofnPtr;
- OFNData *ofnData;
-
- if (uMsg == WM_INITDIALOG) {
- TkWinSetUserData(hdlg, lParam);
- } else if (uMsg == WM_NOTIFY) {
- OFNOTIFYW *notifyPtr = (OFNOTIFYW *) lParam;
-
- /*
- * This is weird... or not. The CDN_FILEOK is NOT sent when the selection
- * exceeds declared buffer size (the nMaxFile member of the OPENFILENAMEW
- * struct passed to GetOpenFileNameW function). So, we have to rely on
- * the most recent CDN_SELCHANGE then. Unfortunately this means, that
- * gathering the selected filenames happens twice when they fit into the
- * declared buffer. Luckily, it's not frequent operation so it should
- * not incur any noticeable delay. See [tktoolkit-Bugs-2987995]
- */
- if (notifyPtr->hdr.code == CDN_FILEOK ||
- notifyPtr->hdr.code == CDN_SELCHANGE) {
- int dirsize, selsize;
- WCHAR *buffer;
- int buffersize;
-
- /*
- * Change of selection. Unscramble the unholy mess that's in the
- * selection buffer, resizing it if necessary.
- */
-
- ofnPtr = notifyPtr->lpOFN;
- ofnData = (OFNData *) ofnPtr->lCustData;
- buffer = (WCHAR *) ofnData->dynFileBuffer;
- hdlg = GetParent(hdlg);
-
- selsize = SendMessageW(hdlg, CDM_GETSPEC, 0, 0);
- dirsize = SendMessageW(hdlg, CDM_GETFOLDERPATH, 0, 0);
- buffersize = (selsize + dirsize + 1) * 2;
-
- /*
- * Just empty the buffer if dirsize indicates an error [Bug 3071836]
- */
- if ((selsize > 1) && (dirsize > 0)) {
- if (ofnData->dynFileBufferSize < buffersize) {
- buffer = (WCHAR *) ckrealloc((char *) buffer, buffersize);
- ofnData->dynFileBufferSize = buffersize;
- ofnData->dynFileBuffer = (char *) buffer;
- }
-
- SendMessageW(hdlg, CDM_GETFOLDERPATH, dirsize, PTR2INT(buffer));
- buffer += dirsize;
-
- SendMessageW(hdlg, CDM_GETSPEC, selsize, PTR2INT(buffer));
-
- /*
- * If there are multiple files, delete the quotes and change
- * every second quote to NULL terminator
- */
-
- if (buffer[0] == '"') {
- BOOL findquote = TRUE;
- WCHAR *tmp = buffer;
-
- while(*buffer != '\0') {
- if (findquote) {
- if (*buffer == '"') {
- findquote = FALSE;
- }
- buffer++;
- } else {
- if (*buffer == '"') {
- findquote = TRUE;
- *buffer = '\0';
- }
- *tmp++ = *buffer++;
- }
- }
- *tmp = '\0'; /* Second NULL terminator. */
- } else {
- buffer[selsize] = '\0'; /* Second NULL terminator. */
-
- /*
- * Replace directory terminating NULL with a backslash.
- */
-
- buffer--;
- *buffer = '\\';
- }
- } else {
- /*
- * Nothing is selected, so just empty the string.
- */
-
- if (buffer != NULL) {
- *buffer = '\0';
- }
- }
- }
- } else if (uMsg == WM_WINDOWPOSCHANGED) {
- /*
- * This message is delivered at the right time to enable Tk to set the
- * debug information. Unhooks itself so it won't set the debug
- * information every time it gets a WM_WINDOWPOSCHANGED message.
- */
-
- ofnPtr = (OPENFILENAMEW *) TkWinGetUserData(hdlg);
- if (ofnPtr != NULL) {
- ofnData = (OFNData *) ofnPtr->lCustData;
- if (ofnData->interp != NULL) {
- hdlg = GetParent(hdlg);
- tsdPtr->debugInterp = ofnData->interp;
- Tcl_DoWhenIdle(SetTkDialog, hdlg);
- }
- TkWinSetUserData(hdlg, NULL);
- }
- }
- return 0;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * GetFileNameA --
- *
- * Calls GetOpenFileName() or GetSaveFileName().
- *
- * Results:
- * See user documentation.
- *
- * Side effects:
- * See user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-GetFileNameA(
- ClientData clientData, /* Main window associated with interpreter. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument objects. */
- int open) /* 1 to call GetOpenFileName(), 0 to call
- * GetSaveFileName(). */
-{
- OPENFILENAME ofn;
- TCHAR file[TK_MULTI_MAX_PATH], savePath[MAX_PATH];
- OFNData ofnData;
- int cdlgerr;
- int filterIndex = 0, result = TCL_ERROR, winCode, oldMode, i, multi = 0;
- char *extension = NULL, *title = NULL;
- Tk_Window tkwin = (Tk_Window) clientData;
- HWND hWnd;
- Tcl_Obj *filterObj = NULL, *initialTypeObj = NULL, *typeVariableObj = NULL;
- Tcl_DString utfFilterString, utfDirString, ds;
- Tcl_DString extString, filterString, dirString, titleString;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static CONST char *saveOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", "-typevariable", NULL
- };
- static CONST char *openOptionStrings[] = {
- "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-multiple", "-parent", "-title", "-typevariable", NULL
- };
- CONST char **optionStrings;
-
- enum options {
- FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE,
- FILE_MULTIPLE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE
- };
-
- file[0] = '\0';
- ZeroMemory(&ofnData, sizeof(OFNData));
- Tcl_DStringInit(&utfFilterString);
- Tcl_DStringInit(&utfDirString);
-
- /*
- * Parse the arguments.
- */
-
- if (open) {
- optionStrings = openOptionStrings;
- } else {
- optionStrings = saveOptionStrings;
- }
-
- 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 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_GetString(optionPtr);
- Tcl_AppendResult(interp, "value for \"", string, "\" missing",
- NULL);
- goto end;
- }
-
- string = Tcl_GetString(valuePtr);
- switch ((enum options) index) {
- case FILE_DEFAULT:
- if (string[0] == '.') {
- string++;
- }
- extension = string;
- break;
- case FILE_TYPES:
- filterObj = valuePtr;
- break;
- case FILE_INITDIR:
- Tcl_DStringFree(&utfDirString);
- if (Tcl_TranslateFileName(interp, string, &utfDirString) == NULL) {
- goto end;
- }
- break;
- case FILE_INITFILE:
- if (Tcl_TranslateFileName(interp, string, &ds) == NULL) {
- goto end;
- }
- Tcl_UtfToExternal(NULL, NULL, Tcl_DStringValue(&ds),
- Tcl_DStringLength(&ds), 0, NULL, (char *) file,
- sizeof(file), NULL, NULL, NULL);
- Tcl_DStringFree(&ds);
- 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) {
- goto end;
- }
- break;
- case FILE_TITLE:
- title = string;
- break;
- case FILE_TYPEVARIABLE:
- typeVariableObj = valuePtr;
- initialTypeObj = Tcl_ObjGetVar2(interp, typeVariableObj, NULL,
- TCL_GLOBAL_ONLY);
- break;
- }
- }
-
- if (MakeFilter(interp, filterObj, &utfFilterString, initialTypeObj,
- &filterIndex) != TCL_OK) {
- goto end;
- }
-
- Tk_MakeWindowExist(tkwin);
- hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
-
- ZeroMemory(&ofn, sizeof(OPENFILENAMEA));
- if (LOBYTE(LOWORD(GetVersion())) < 5) {
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- } else {
- ofn.lStructSize = sizeof(ofn);
- }
- ofn.hwndOwner = hWnd;
- ofn.hInstance = TkWinGetHInstance(ofn.hwndOwner);
- ofn.lpstrFilter = NULL;
- ofn.lpstrCustomFilter = NULL;
- ofn.nMaxCustFilter = 0;
- ofn.lpstrFile = (LPTSTR) file;
- ofn.nMaxFile = TK_MULTI_MAX_PATH;
- ofn.lpstrFileTitle = NULL;
- ofn.nMaxFileTitle = 0;
- ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = NULL;
- ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR
- | OFN_EXPLORER | OFN_ENABLEHOOK;
- ofn.nFileOffset = 0;
- ofn.nFileExtension = 0;
- ofn.lpstrDefExt = NULL;
- ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProcA;
- ofn.lCustData = (LPARAM) &ofnData;
- ofn.lpTemplateName = NULL;
-
- if (open != 0) {
- ofn.Flags |= OFN_FILEMUSTEXIST;
- } else {
- ofn.Flags |= OFN_OVERWRITEPROMPT;
- }
-
- if (tsdPtr->debugFlag != 0) {
- ofnData.interp = interp;
- }
-
- if (multi != 0) {
- ofn.Flags |= OFN_ALLOWMULTISELECT;
-
- /*
- * Starting buffer size. The buffer will be expanded by the OFN dialog
- * procedure when necessary
- */
-
- ofnData.dynFileBufferSize = 1024;
- ofnData.dynFileBuffer = ckalloc(1024);
- }
-
- if (extension != NULL) {
- Tcl_UtfToExternalDString(NULL, extension, -1, &extString);
- ofn.lpstrDefExt = (LPTSTR) Tcl_DStringValue(&extString);
- }
- Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&utfFilterString),
- Tcl_DStringLength(&utfFilterString), &filterString);
- ofn.lpstrFilter = (LPTSTR) Tcl_DStringValue(&filterString);
- ofn.nFilterIndex = filterIndex;
-
- if (Tcl_DStringValue(&utfDirString)[0] != '\0') {
- Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&utfDirString),
- Tcl_DStringLength(&utfDirString), &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) == 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.
- */
-
- GetCurrentDirectory(MAX_PATH, savePath);
- oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
- if (open != 0) {
- winCode = GetOpenFileName(&ofn);
- } else {
- winCode = GetSaveFileName(&ofn);
- }
- Tcl_SetServiceMode(oldMode);
- EatSpuriousMessageBugFix();
- SetCurrentDirectory(savePath);
-
- /*
- * 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);
-
- /*
- * Clear the interp result since anything may have happened during the
- * modal loop.
- */
-
- Tcl_ResetResult(interp);
-
- /*
- * Process the results.
- *
- * 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.
- */
-
- cdlgerr = CommDlgExtendedError();
-
- /*
- * We now allow FNERR_BUFFERTOOSMALL when multiselection is enabled. The
- * filename buffer has been dynamically allocated by the OFN dialog
- * procedure to accomodate all selected files.
- */
-
- if ((winCode != 0)
- || ((cdlgerr == FNERR_BUFFERTOOSMALL)
- && (ofn.Flags & OFN_ALLOWMULTISELECT))) {
- if (ofn.Flags & OFN_ALLOWMULTISELECT) {
- /*
- * The result in dynFileBuffer contains many items, separated by
- * NUL characters. It is terminated with two nulls in a row. The
- * first element is the directory path (if multiple files are
- * selected) or the only returned file (if only a single file has
- * been chosen).
- */
-
- char *files = ofnData.dynFileBuffer;
- Tcl_Obj *returnList = Tcl_NewObj();
- int count = 0;
-
- /*
- * Get directory.
- */
-
- (void) ConvertExternalFilename(NULL, (char *) files, &ds);
-
- while (*files != '\0') {
- while (*files != '\0') {
- files++;
- }
- files++;
- if (*files != '\0') {
- Tcl_Obj *fullnameObj;
- Tcl_DString filename;
-
- count++;
- (void) ConvertExternalFilename(NULL, (char *) files,
- &filename);
- fullnameObj = Tcl_NewStringObj(Tcl_DStringValue(&ds),
- Tcl_DStringLength(&ds));
- Tcl_AppendToObj(fullnameObj, "/", -1);
- Tcl_AppendToObj(fullnameObj, Tcl_DStringValue(&filename),
- Tcl_DStringLength(&filename));
- Tcl_DStringFree(&filename);
- Tcl_ListObjAppendElement(NULL, returnList, fullnameObj);
- }
- }
- if (count == 0) {
- /*
- * Only one file was returned.
- */
-
- Tcl_ListObjAppendElement(NULL, returnList, Tcl_NewStringObj(
- Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)));
- }
- Tcl_SetObjResult(interp, returnList);
- Tcl_DStringFree(&ds);
- } else {
- Tcl_AppendResult(interp, ConvertExternalFilename(NULL,
- (char *) ofn.lpstrFile, &ds), NULL);
- Tcl_DStringFree(&ds);
- }
- result = TCL_OK;
- if ((ofn.nFilterIndex > 0) &&
- (Tcl_GetCharLength(Tcl_GetObjResult(interp)) > 0) &&
- typeVariableObj && filterObj) {
- int listObjc, count;
- Tcl_Obj **listObjv = NULL;
- Tcl_Obj **typeInfo = NULL;
-
- if (Tcl_ListObjGetElements(interp, filterObj, &listObjc,
- &listObjv) != TCL_OK) {
- result = TCL_ERROR;
- } else if (Tcl_ListObjGetElements(interp,
- listObjv[ofn.nFilterIndex - 1], &count,
- &typeInfo) != TCL_OK) {
- result = TCL_ERROR;
- } else if (Tcl_ObjSetVar2(interp, typeVariableObj, NULL,
- typeInfo[0], TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) {
- result = TCL_ERROR;
- }
- }
- } else if (cdlgerr == FNERR_INVALIDFILENAME) {
- Tcl_SetResult(interp, "invalid filename \"", TCL_STATIC);
- Tcl_AppendResult(interp, ConvertExternalFilename(NULL,
- (char *) ofn.lpstrFile, &ds), "\"", NULL);
- Tcl_DStringFree(&ds);
- } else {
- result = TCL_OK;
- }
-
- if (ofn.lpstrTitle != NULL) {
- Tcl_DStringFree(&titleString);
- }
- if (ofn.lpstrInitialDir != NULL) {
- Tcl_DStringFree(&dirString);
- }
- Tcl_DStringFree(&filterString);
- if (ofn.lpstrDefExt != NULL) {
- Tcl_DStringFree(&extString);
- }
-
- end:
- Tcl_DStringFree(&utfDirString);
- Tcl_DStringFree(&utfFilterString);
- if (ofnData.dynFileBuffer != NULL) {
- ckfree(ofnData.dynFileBuffer);
- ofnData.dynFileBuffer = NULL;
- }
-
- return result;
-}
-
-/*
- *-------------------------------------------------------------------------
- *
- * OFNHookProcA --
- *
- * Dialog box hook function. This is used to sets the "tk_dialog"
- * variable for test/debugging when the dialog is ready to receive
- * messages. When multiple file selection is enabled this function
- * is used to process the list of names.
- *
- * Results:
- * Returns 0 to allow default processing of messages to occur.
- *
- * Side effects:
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static UINT APIENTRY
-OFNHookProcA(
- HWND hdlg, /* handle to child dialog window */
- UINT uMsg, /* message identifier */
- WPARAM wParam, /* message parameter */
- LPARAM lParam) /* message parameter */
-{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
OPENFILENAME *ofnPtr;
OFNData *ofnData;
@@ -1528,8 +964,8 @@ OFNHookProcA(
/*
* This is weird... or not. The CDN_FILEOK is NOT sent when the selection
- * exceeds declared buffer size (the nMaxFile member of the OPENFILENAMEW
- * struct passed to GetOpenFileNameW function). So, we have to rely on
+ * exceeds declared buffer size (the nMaxFile member of the OPENFILENAME
+ * struct passed to GetOpenFileName function). So, we have to rely on
* the most recent CDN_SELCHANGE then. Unfortunately this means, that
* gathering the selected filenames happens twice when they fit into the
* declared buffer. Luckily, it's not frequent operation so it should
@@ -1538,7 +974,7 @@ OFNHookProcA(
if (notifyPtr->hdr.code == CDN_FILEOK ||
notifyPtr->hdr.code == CDN_SELCHANGE) {
int dirsize, selsize;
- char *buffer;
+ TCHAR *buffer;
int buffersize;
/*
@@ -1553,32 +989,33 @@ OFNHookProcA(
selsize = SendMessage(hdlg, CDM_GETSPEC, 0, 0);
dirsize = SendMessage(hdlg, CDM_GETFOLDERPATH, 0, 0);
- buffersize = selsize + dirsize + 1;
+ buffersize = (selsize + dirsize + 1);
/*
* Just empty the buffer if dirsize indicates an error [Bug 3071836]
*/
if ((selsize > 1) && (dirsize > 0)) {
if (ofnData->dynFileBufferSize < buffersize) {
- buffer = ckrealloc(buffer, buffersize);
+ buffer = ckrealloc(buffer, buffersize * sizeof(TCHAR));
ofnData->dynFileBufferSize = buffersize;
ofnData->dynFileBuffer = buffer;
}
SendMessage(hdlg, CDM_GETFOLDERPATH, dirsize, PTR2INT(buffer));
buffer += dirsize;
+
SendMessage(hdlg, CDM_GETSPEC, selsize, PTR2INT(buffer));
/*
* If there are multiple files, delete the quotes and change
- * every second quote to NULL terminator.
+ * every second quote to NULL terminator
*/
if (buffer[0] == '"') {
BOOL findquote = TRUE;
- char *tmp = buffer;
+ TCHAR *tmp = buffer;
- while (*buffer != '\0') {
+ while(*buffer != '\0') {
if (findquote) {
if (*buffer == '"') {
findquote = FALSE;
@@ -1603,7 +1040,6 @@ OFNHookProcA(
buffer--;
*buffer = '\\';
}
-
} else {
/*
* Nothing is selected, so just empty the string.
@@ -1616,19 +1052,16 @@ OFNHookProcA(
}
} else if (uMsg == WM_WINDOWPOSCHANGED) {
/*
- * This message is delivered at the right time to both old-style and
- * explorer-style hook procs to enable Tk to set the debug
- * information. Unhooks itself so it won't set the debug information
- * every time it gets a WM_WINDOWPOSCHANGED message.
+ * This message is delivered at the right time to enable Tk to set the
+ * debug information. Unhooks itself so it won't set the debug
+ * information every time it gets a WM_WINDOWPOSCHANGED message.
*/
ofnPtr = (OPENFILENAME *) TkWinGetUserData(hdlg);
if (ofnPtr != NULL) {
ofnData = (OFNData *) ofnPtr->lCustData;
if (ofnData->interp != NULL) {
- if (ofnPtr->Flags & OFN_EXPLORER) {
- hdlg = GetParent(hdlg);
- }
+ hdlg = GetParent(hdlg);
tsdPtr->debugInterp = ofnData->interp;
Tcl_DoWhenIdle(SetTkDialog, hdlg);
}
@@ -1661,11 +1094,11 @@ MakeFilter(
Tcl_Obj *valuePtr, /* Value of the -filetypes option */
Tcl_DString *dsPtr, /* Filled with windows filter string. */
Tcl_Obj *initialPtr, /* Initial type name */
- int *index) /* Index of initial type in filter string */
+ int *indexPtr) /* Index of initial type in filter string */
{
char *filterStr;
char *p;
- char *initial = NULL;
+ const char *initial = NULL;
int pass;
int ix = 0; /* index counter */
FileFilterList flist;
@@ -1683,9 +1116,9 @@ MakeFilter(
/*
* Use "All Files (*.*) as the default filter if none is specified
*/
- char *defaultFilter = "All Files (*.*)";
+ const char *defaultFilter = "All Files (*.*)";
- p = filterStr = (char*)ckalloc(30 * sizeof(char));
+ p = filterStr = ckalloc(30);
strcpy(p, defaultFilter);
p+= strlen(defaultFilter);
@@ -1721,20 +1154,22 @@ MakeFilter(
* twice the size of the string to format the filter
*/
- filterStr = ckalloc((unsigned int) len * 3);
+ filterStr = ckalloc(len * 3);
for (filterPtr = flist.filters, p = filterStr; filterPtr;
filterPtr = filterPtr->next) {
- char *sep;
+ const char *sep;
FileFilterClause *clausePtr;
/*
- * Check initial index for match, set index. Filter index is 1
+ * Check initial index for match, set *indexPtr. Filter index is 1
* based so increment first
*/
+
ix++;
- if (index && initial && (strcmp(initial, filterPtr->name) == 0)) {
- *index = ix;
+ if (indexPtr && initial
+ && (strcmp(initial, filterPtr->name) == 0)) {
+ *indexPtr = ix;
}
/*
@@ -1789,7 +1224,7 @@ MakeFilter(
}
Tcl_DStringAppend(dsPtr, filterStr, (int) (p - filterStr));
- ckfree((char *) filterStr);
+ ckfree(filterStr);
TkFreeFileFilters(&flist);
return TCL_OK;
@@ -1861,6 +1296,10 @@ MakeFilter(
* - 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?).
*
*----------------------------------------------------------------------
*/
@@ -1870,22 +1309,22 @@ Tk_ChooseDirectoryObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
char path[MAX_PATH];
int oldMode, result = TCL_ERROR, i;
LPCITEMIDLIST pidl; /* Returned by browser */
- BROWSEINFO bInfo; /* Used by browser */
+ BROWSEINFOA bInfo; /* Used by browser */
CHOOSEDIRDATA cdCBData; /* Structure to pass back and forth */
LPMALLOC pMalloc; /* Used by shell */
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
HWND hWnd;
- char *utfTitle = NULL;/* Title for window */
- TCHAR saveDir[MAX_PATH];
+ const char *utfTitle = NULL;/* Title for window */
+ char saveDir[MAX_PATH];
Tcl_DString titleString; /* UTF Title */
Tcl_DString initDirString; /* Initial directory */
Tcl_Obj *objPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-initialdir", "-mustexist", "-parent", "-title", NULL
};
enum options {
@@ -1906,7 +1345,7 @@ Tk_ChooseDirectoryObjCmd(
for (i = 1; i < objc; i += 2) {
int index;
- char *string;
+ const char *string;
Tcl_Obj *optionPtr, *valuePtr;
optionPtr = objv[i];
@@ -1936,8 +1375,8 @@ Tk_ChooseDirectoryObjCmd(
* happy.
*/
- GetFullPathName(string, MAX_PATH, saveDir, NULL);
- lstrcpyn(cdCBData.utfInitDir, saveDir, MAX_PATH);
+ GetFullPathNameA(string, MAX_PATH, saveDir, NULL);
+ lstrcpynA(cdCBData.utfInitDir, saveDir, MAX_PATH);
Tcl_DStringFree(&initDirString);
break;
case DIR_EXIST:
@@ -1972,14 +1411,14 @@ Tk_ChooseDirectoryObjCmd(
bInfo.hwndOwner = hWnd;
bInfo.pszDisplayName = path;
bInfo.pidlRoot = NULL;
- if (lstrlen(cdCBData.utfInitDir) == 0) {
- GetCurrentDirectory(MAX_PATH, cdCBData.utfInitDir);
+ if (lstrlenA(cdCBData.utfInitDir) == 0) {
+ GetCurrentDirectoryA(MAX_PATH, cdCBData.utfInitDir);
}
bInfo.lParam = (LPARAM) &cdCBData;
if (utfTitle != NULL) {
Tcl_UtfToExternalDString(NULL, utfTitle, -1, &titleString);
- bInfo.lpszTitle = (LPTSTR) Tcl_DStringValue(&titleString);
+ bInfo.lpszTitle = (LPSTR) Tcl_DStringValue(&titleString);
} else {
bInfo.lpszTitle = "Please choose a directory, then select OK.";
}
@@ -2014,9 +1453,9 @@ Tk_ChooseDirectoryObjCmd(
*/
oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
- GetCurrentDirectory(MAX_PATH, saveDir);
+ GetCurrentDirectoryA(MAX_PATH, saveDir);
if (SHGetMalloc(&pMalloc) == NOERROR) {
- pidl = SHBrowseForFolder(&bInfo);
+ pidl = SHBrowseForFolderA(&bInfo);
/*
* This is a fix for Windows 2000, which seems to modify the folder name
@@ -2030,17 +1469,17 @@ Tk_ChooseDirectoryObjCmd(
*/
if (pidl != NULL) {
- if (!SHGetPathFromIDList(pidl, path)) {
+ if (!SHGetPathFromIDListA(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);
+ } else if (lstrlenA(cdCBData.utfRetDir) > 0) {
+ lstrcpyA(path, cdCBData.utfRetDir);
}
pMalloc->lpVtbl->Release(pMalloc);
}
- SetCurrentDirectory(saveDir);
+ SetCurrentDirectoryA(saveDir);
Tcl_SetServiceMode(oldMode);
/*
@@ -2098,16 +1537,16 @@ ChooseDirectoryValidateProc(
LPARAM lParam,
LPARAM lpData)
{
- TCHAR selDir[MAX_PATH];
+ char selDir[MAX_PATH];
CHOOSEDIRDATA *chooseDirSharedData = (CHOOSEDIRDATA *) lpData;
Tcl_DString initDirString;
char string[MAX_PATH];
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->debugFlag) {
tsdPtr->debugInterp = (Tcl_Interp *) chooseDirSharedData->interp;
- Tcl_DoWhenIdle(SetTkDialog, (ClientData) hwnd);
+ Tcl_DoWhenIdle(SetTkDialog, hwnd);
}
chooseDirSharedData->utfRetDir[0] = '\0';
switch (message) {
@@ -2116,7 +1555,7 @@ ChooseDirectoryValidateProc(
* 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
+ * Set/GetCurrentDirectoryA which allows relative path names and names
* with forward slashes. Use Tcl_TranslateFileName to make sure names
* like ~ are converted correctly.
*/
@@ -2131,11 +1570,11 @@ ChooseDirectoryValidateProc(
chooseDirSharedData->utfRetDir[0] = '\0';
return 1;
}
- lstrcpyn(string, Tcl_DStringValue(&initDirString), MAX_PATH);
+ lstrcpynA(string, Tcl_DStringValue(&initDirString), MAX_PATH);
Tcl_DStringFree(&initDirString);
- if (SetCurrentDirectory((char *)string) == 0) {
- LPTSTR lpFilePart[MAX_PATH];
+ if (SetCurrentDirectoryA((char *)string) == 0) {
+ LPSTR lpFilePart[MAX_PATH];
/*
* Get the full path name to the user entry, at this point it does
@@ -2143,15 +1582,15 @@ ChooseDirectoryValidateProc(
* it.
*/
- GetFullPathName(string, MAX_PATH,
+ GetFullPathNameA(string, MAX_PATH,
chooseDirSharedData->utfRetDir, /*unused*/ lpFilePart);
if (chooseDirSharedData->mustExist) {
/*
* User HAS to select a valid directory.
*/
- wsprintf(selDir, TEXT("Directory '%.200s' does not exist,\nplease select or enter an existing directory."), chooseDirSharedData->utfRetDir);
- MessageBox(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK);
+ wsprintfA(selDir, "Directory '%.200s' does not exist,\nplease select or enter an existing directory.", chooseDirSharedData->utfRetDir);
+ MessageBoxA(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK);
chooseDirSharedData->utfRetDir[0] = '\0';
return 1;
}
@@ -2161,7 +1600,7 @@ ChooseDirectoryValidateProc(
* directory in utfRetDir.
*/
- GetCurrentDirectory(MAX_PATH, chooseDirSharedData->utfRetDir);
+ GetCurrentDirectoryA(MAX_PATH, chooseDirSharedData->utfRetDir);
return 0;
}
return 0;
@@ -2176,13 +1615,13 @@ ChooseDirectoryValidateProc(
* Not called when user changes edit box directly.
*/
- if (SHGetPathFromIDList((LPITEMIDLIST) lParam, selDir)) {
- SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir);
+ if (SHGetPathFromIDListA((LPITEMIDLIST) lParam, selDir)) {
+ SendMessageA(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir);
// enable the OK button
- SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
+ SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
} else {
// disable the OK button
- SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0);
+ SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0);
}
UpdateWindow(hwnd);
return 1;
@@ -2195,7 +1634,10 @@ ChooseDirectoryValidateProc(
char *initDir = chooseDirSharedData->utfInitDir;
- SetCurrentDirectory(initDir);
+ Tcl_DString initDirDStr;
+ Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(), initDir, -1, &initDirDStr);
+ SetCurrentDirectoryA(Tcl_DStringValue(&initDirDStr));
+
if (*initDir == '\\') {
/*
* BFFM_SETSELECTION only understands UNC paths as pidls, so
@@ -2209,27 +1651,24 @@ ChooseDirectoryValidateProc(
if (SUCCEEDED(SHGetDesktopFolder(&psfFolder))) {
LPITEMIDLIST pidlMain;
ULONG ulCount, ulAttr;
- Tcl_DString ds;
- Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(),
- initDir, -1, &ds);
if (SUCCEEDED(psfFolder->lpVtbl->ParseDisplayName(
- psfFolder, hwnd, NULL, (WCHAR *)
- Tcl_DStringValue(&ds), &ulCount,&pidlMain,&ulAttr))
+ psfFolder, hwnd, NULL, (TCHAR *)
+ Tcl_DStringValue(&initDirDStr), &ulCount,&pidlMain,&ulAttr))
&& (pidlMain != NULL)) {
- SendMessage(hwnd, BFFM_SETSELECTION, FALSE,
+ SendMessageA(hwnd, BFFM_SETSELECTION, FALSE,
(LPARAM) pidlMain);
pMalloc->lpVtbl->Free(pMalloc, pidlMain);
}
psfFolder->lpVtbl->Release(psfFolder);
- Tcl_DStringFree(&ds);
}
pMalloc->lpVtbl->Release(pMalloc);
}
} else {
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) initDir);
+ SendMessageA(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) Tcl_DStringValue(&initDirDStr));
}
- SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
+ Tcl_DStringFree(&initDirDStr);
+ SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
break;
}
@@ -2260,15 +1699,15 @@ Tk_MessageBoxObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData, parent;
+ Tk_Window tkwin = clientData, parent;
HWND hWnd;
Tcl_Obj *messageObj, *titleObj, *detailObj, *tmpObj;
int defaultBtn, icon, type;
int i, oldMode, winCode;
UINT flags;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"-default", "-detail", "-icon", "-message",
"-parent", "-title", "-type", NULL
};
@@ -2276,7 +1715,7 @@ Tk_MessageBoxObjCmd(
MSG_DEFAULT, MSG_DETAIL, MSG_ICON, MSG_MESSAGE,
MSG_PARENT, MSG_TITLE, MSG_TYPE
};
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
(void) TkWinGetUnicodeEncoding();
@@ -2290,7 +1729,7 @@ Tk_MessageBoxObjCmd(
for (i = 1; i < objc; i += 2) {
int index;
- char *string;
+ const char *string;
Tcl_Obj *optionPtr, *valuePtr;
optionPtr = objv[i];
@@ -2408,7 +1847,7 @@ Tk_MessageBoxObjCmd(
tsdPtr->hBigIcon = TkWinGetIcon(parent, ICON_BIG);
tsdPtr->hMsgBoxHook = SetWindowsHookEx(WH_CBT, MsgBoxCBTProc, NULL,
GetCurrentThreadId());
- winCode = MessageBoxW(hWnd, Tcl_GetUnicode(tmpObj),
+ winCode = MessageBox(hWnd, Tcl_GetUnicode(tmpObj),
titleObj ? Tcl_GetUnicode(titleObj) : L"", flags);
UnhookWindowsHookEx(tsdPtr->hMsgBoxHook);
(void) Tcl_SetServiceMode(oldMode);
@@ -2423,7 +1862,8 @@ Tk_MessageBoxObjCmd(
Tcl_DecrRefCount(tmpObj);
- Tcl_SetResult(interp, TkFindStateString(buttonMap, winCode), TCL_STATIC);
+ Tcl_SetResult(interp,
+ (char *)TkFindStateString(buttonMap, winCode), TCL_STATIC);
return TCL_OK;
}
@@ -2433,8 +1873,8 @@ MsgBoxCBTProc(
WPARAM wParam,
LPARAM lParam)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr =
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (nCode == HCBT_CREATEWND) {
/*
@@ -2450,9 +1890,9 @@ MsgBoxCBTProc(
if (WC_DIALOG == lpcbtcreate->lpcs->lpszClass) {
HWND hwnd = (HWND) wParam;
- SendMessage(hwnd, WM_SETICON, ICON_SMALL,
+ SendMessageA(hwnd, WM_SETICON, ICON_SMALL,
(LPARAM) tsdPtr->hSmallIcon);
- SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon);
+ SendMessageA(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon);
}
}
@@ -2480,7 +1920,7 @@ static void
SetTkDialog(
ClientData clientData)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
char buf[32];
@@ -2514,6 +1954,554 @@ ConvertExternalFilename(
}
/*
+ * ----------------------------------------------------------------------
+ *
+ * GetFontObj --
+ *
+ * Convert a windows LOGFONT into a Tk font description.
+ *
+ * Result:
+ * A list containing a Tk font description.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+GetFontObj(HDC hdc, LOGFONT *plf)
+{
+ Tcl_DString ds;
+ Tcl_Obj *resObj;
+ int pt = 0;
+
+ resObj = Tcl_NewListObj(0, NULL);
+ Tcl_ExternalToUtfDString(TkWinGetUnicodeEncoding(), (char *) plf->lfFaceName, -1, &ds);
+ Tcl_ListObjAppendElement(NULL, resObj,
+ Tcl_NewStringObj(Tcl_DStringValue(&ds), -1));
+ Tcl_DStringFree(&ds);
+ pt = -MulDiv(plf->lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY));
+ Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewIntObj(pt));
+ if (plf->lfWeight >= 700) {
+ Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewStringObj("bold", -1));
+ }
+ if (plf->lfItalic) {
+ Tcl_ListObjAppendElement(NULL, resObj,
+ Tcl_NewStringObj("italic", -1));
+ }
+ if (plf->lfUnderline) {
+ Tcl_ListObjAppendElement(NULL, resObj,
+ Tcl_NewStringObj("underline", -1));
+ }
+ if (plf->lfStrikeOut) {
+ Tcl_ListObjAppendElement(NULL, resObj,
+ Tcl_NewStringObj("overstrike", -1));
+ }
+ return resObj;
+}
+
+static void
+ApplyLogfont(Tcl_Interp *interp, Tcl_Obj *cmdObj, HDC hdc, LOGFONT *logfontPtr)
+{
+ int objc;
+ Tcl_Obj **objv, **tmpv;
+
+ Tcl_ListObjGetElements(NULL, cmdObj, &objc, &objv);
+ tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2));
+ memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc);
+ tmpv[objc] = GetFontObj(hdc, logfontPtr);
+ TkBackgroundEvalObjv(interp, objc+1, tmpv, TCL_EVAL_GLOBAL);
+ ckfree(tmpv);
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * HookProc --
+ *
+ * Font selection hook. If the user selects Apply on the dialog, we call
+ * the applyProc script with the currently selected font as arguments.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+typedef struct HookData {
+ Tcl_Interp *interp;
+ Tcl_Obj *titleObj;
+ Tcl_Obj *cmdObj;
+ Tcl_Obj *parentObj;
+ Tcl_Obj *fontObj;
+ HWND hwnd;
+ Tk_Window parent;
+} HookData;
+
+static UINT_PTR CALLBACK
+HookProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CHOOSEFONT *pcf = (CHOOSEFONT *) lParam;
+ HWND hwndCtrl;
+ static HookData *phd = NULL;
+ ThreadSpecificData *tsdPtr =
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ if (WM_INITDIALOG == msg && lParam != 0) {
+ phd = (HookData *) pcf->lCustData;
+ phd->hwnd = hwndDlg;
+ if (tsdPtr->debugFlag) {
+ tsdPtr->debugInterp = (Tcl_Interp *) phd->interp;
+ Tcl_DoWhenIdle(SetTkDialog, hwndDlg);
+ }
+ if (phd->titleObj != NULL) {
+ Tcl_DString title;
+
+ Tcl_WinUtfToTChar(Tcl_GetString(phd->titleObj), -1, &title);
+ if (Tcl_DStringLength(&title) > 0) {
+ SetWindowText(hwndDlg, (LPCTSTR) Tcl_DStringValue(&title));
+ }
+ Tcl_DStringFree(&title);
+ }
+
+ /*
+ * Disable the colour combobox (0x473) and its label (0x443).
+ */
+
+ hwndCtrl = GetDlgItem(hwndDlg, 0x443);
+ if (IsWindow(hwndCtrl)) {
+ EnableWindow(hwndCtrl, FALSE);
+ }
+ hwndCtrl = GetDlgItem(hwndDlg, 0x473);
+ if (IsWindow(hwndCtrl)) {
+ EnableWindow(hwndCtrl, FALSE);
+ }
+ TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility");
+ return 1; /* we handled the message */
+ }
+
+ if (WM_DESTROY == msg) {
+ phd->hwnd = NULL;
+ TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility");
+ return 0;
+ }
+
+ /*
+ * Handle apply button by calling the provided command script as a
+ * background evaluation (ie: errors dont come back here).
+ */
+
+ if (WM_COMMAND == msg && LOWORD(wParam) == 1026) {
+ LOGFONT lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0}};
+ HDC hdc = GetDC(hwndDlg);
+
+ SendMessage(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf);
+ if (phd && phd->cmdObj) {
+ ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf);
+ }
+ if (phd && phd->parent) {
+ TkSendVirtualEvent(phd->parent, "TkFontchooserFontChanged");
+ }
+ return 1;
+ }
+ return 0; /* pass on for default processing */
+}
+
+/*
+ * Helper for the FontchooserConfigure command to return the current value of
+ * any of the options (which may be NULL in the structure)
+ */
+
+enum FontchooserOption {
+ FontchooserParent, FontchooserTitle, FontchooserFont, FontchooserCmd,
+ FontchooserVisible
+};
+
+static Tcl_Obj *
+FontchooserCget(HookData *hdPtr, int optionIndex)
+{
+ Tcl_Obj *resObj = NULL;
+
+ switch(optionIndex) {
+ case FontchooserParent:
+ if (hdPtr->parentObj) {
+ resObj = hdPtr->parentObj;
+ } else {
+ resObj = Tcl_NewStringObj(".", 1);
+ }
+ break;
+ case FontchooserTitle:
+ if (hdPtr->titleObj) {
+ resObj = hdPtr->titleObj;
+ } else {
+ resObj = Tcl_NewStringObj("", 0);
+ }
+ break;
+ case FontchooserFont:
+ if (hdPtr->fontObj) {
+ resObj = hdPtr->fontObj;
+ } else {
+ resObj = Tcl_NewStringObj("", 0);
+ }
+ break;
+ case FontchooserCmd:
+ if (hdPtr->cmdObj) {
+ resObj = hdPtr->cmdObj;
+ } else {
+ resObj = Tcl_NewStringObj("", 0);
+ }
+ break;
+ case FontchooserVisible:
+ resObj = Tcl_NewBooleanObj(hdPtr->hwnd && IsWindow(hdPtr->hwnd));
+ break;
+ default:
+ resObj = Tcl_NewStringObj("", 0);
+ }
+ return resObj;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserConfigureCmd --
+ *
+ * Implementation of the 'tk fontchooser configure' ensemble command. See
+ * the user documentation for what it does.
+ *
+ * Results:
+ * See the user documentation.
+ *
+ * Side effects:
+ * Per-interp data structure may be modified
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserConfigureCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tk_Window tkwin = clientData;
+ HookData *hdPtr = NULL;
+ int i, r = TCL_OK;
+ static const char *const optionStrings[] = {
+ "-parent", "-title", "-font", "-command", "-visible", NULL
+ };
+
+ hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
+
+ /*
+ * With no arguments we return all the options in a dict.
+ */
+
+ if (objc == 1) {
+ Tcl_Obj *keyObj, *valueObj;
+ Tcl_Obj *dictObj = Tcl_NewDictObj();
+
+ for (i = 0; r == TCL_OK && optionStrings[i] != NULL; ++i) {
+ keyObj = Tcl_NewStringObj(optionStrings[i], -1);
+ valueObj = FontchooserCget(hdPtr, i);
+ r = Tcl_DictObjPut(interp, dictObj, keyObj, valueObj);
+ }
+ if (r == TCL_OK) {
+ Tcl_SetObjResult(interp, dictObj);
+ }
+ return r;
+ }
+
+ for (i = 1; i < objc; i += 2) {
+ int optionIndex, len;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
+ "option", 0, &optionIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ /*
+ * If one option and no arg - return the current value.
+ */
+
+ Tcl_SetObjResult(interp, FontchooserCget(hdPtr, optionIndex));
+ return TCL_OK;
+ }
+ if (i + 1 == objc) {
+ Tcl_AppendResult(interp, "value for \"",
+ Tcl_GetString(objv[i]), "\" missing", NULL);
+ return TCL_ERROR;
+ }
+ switch (optionIndex) {
+ case FontchooserVisible: {
+ const char *msg = "cannot change read-only option "
+ "\"-visible\": use the show or hide command";
+
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(msg, -1));
+ return TCL_ERROR;
+ }
+ case FontchooserParent: {
+ Tk_Window parent = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[i+1]), tkwin);
+
+ if (parent == None) {
+ return TCL_ERROR;
+ }
+ if (hdPtr->parentObj) {
+ Tcl_DecrRefCount(hdPtr->parentObj);
+ }
+ hdPtr->parentObj = objv[i+1];
+ if (Tcl_IsShared(hdPtr->parentObj)) {
+ hdPtr->parentObj = Tcl_DuplicateObj(hdPtr->parentObj);
+ }
+ Tcl_IncrRefCount(hdPtr->parentObj);
+ break;
+ }
+ case FontchooserTitle:
+ if (hdPtr->titleObj) {
+ Tcl_DecrRefCount(hdPtr->titleObj);
+ }
+ hdPtr->titleObj = objv[i+1];
+ if (Tcl_IsShared(hdPtr->titleObj)) {
+ hdPtr->titleObj = Tcl_DuplicateObj(hdPtr->titleObj);
+ }
+ Tcl_IncrRefCount(hdPtr->titleObj);
+ break;
+ case FontchooserFont:
+ if (hdPtr->fontObj) {
+ Tcl_DecrRefCount(hdPtr->fontObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ hdPtr->fontObj = objv[i+1];
+ if (Tcl_IsShared(hdPtr->fontObj)) {
+ hdPtr->fontObj = Tcl_DuplicateObj(hdPtr->fontObj);
+ }
+ Tcl_IncrRefCount(hdPtr->fontObj);
+ } else {
+ hdPtr->fontObj = NULL;
+ }
+ break;
+ case FontchooserCmd:
+ if (hdPtr->cmdObj) {
+ Tcl_DecrRefCount(hdPtr->cmdObj);
+ }
+ Tcl_GetStringFromObj(objv[i+1], &len);
+ if (len) {
+ hdPtr->cmdObj = objv[i+1];
+ if (Tcl_IsShared(hdPtr->cmdObj)) {
+ hdPtr->cmdObj = Tcl_DuplicateObj(hdPtr->cmdObj);
+ }
+ Tcl_IncrRefCount(hdPtr->cmdObj);
+ } else {
+ hdPtr->cmdObj = NULL;
+ }
+ break;
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserShowCmd --
+ *
+ * Implements the 'tk fontchooser show' ensemble command. The per-interp
+ * configuration data for the dialog is held in an interp associated
+ * structure.
+ *
+ * Calls the Win32 FontChooser API which provides a modal dialog. See
+ * HookProc where we make a few changes to the dialog and set some
+ * additional state.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserShowCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ Tcl_DString ds;
+ Tk_Window tkwin = clientData, parent;
+ CHOOSEFONT cf;
+ LOGFONT lf;
+ HDC hdc;
+ HookData *hdPtr;
+ int r = TCL_OK, oldMode = 0;
+
+ hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
+
+ parent = tkwin;
+ if (hdPtr->parentObj) {
+ parent = Tk_NameToWindow(interp, Tcl_GetString(hdPtr->parentObj),
+ tkwin);
+ if (parent == None) {
+ return TCL_ERROR;
+ }
+ }
+
+ Tk_MakeWindowExist(parent);
+
+ ZeroMemory(&cf, sizeof(CHOOSEFONT));
+ ZeroMemory(&lf, sizeof(LOGFONT));
+ lf.lfCharSet = DEFAULT_CHARSET;
+ cf.lStructSize = sizeof(CHOOSEFONT);
+ cf.hwndOwner = Tk_GetHWND(Tk_WindowId(parent));
+ cf.lpLogFont = &lf;
+ cf.nFontType = SCREEN_FONTTYPE;
+ cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_ENABLEHOOK;
+ cf.rgbColors = RGB(0,0,0);
+ cf.lpfnHook = HookProc;
+ cf.lCustData = (INT_PTR) hdPtr;
+ hdPtr->interp = interp;
+ hdPtr->parent = parent;
+ hdc = GetDC(cf.hwndOwner);
+
+ if (hdPtr->fontObj != NULL) {
+ TkFont *fontPtr;
+ Tk_Font f = Tk_AllocFontFromObj(interp, tkwin, hdPtr->fontObj);
+
+ if (f == NULL) {
+ return TCL_ERROR;
+ }
+ fontPtr = (TkFont *) f;
+ cf.Flags |= CF_INITTOLOGFONTSTRUCT;
+ Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(), fontPtr->fa.family, -1, &ds);
+ _tcsncpy(lf.lfFaceName, (TCHAR *)Tcl_DStringValue(&ds), LF_FACESIZE-1);
+ Tcl_DStringFree(&ds);
+ lf.lfFaceName[LF_FACESIZE-1] = 0;
+ lf.lfHeight = -MulDiv(TkFontGetPoints(tkwin, fontPtr->fa.size),
+ GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ if (fontPtr->fa.weight == TK_FW_BOLD) {
+ lf.lfWeight = FW_BOLD;
+ }
+ if (fontPtr->fa.slant != TK_FS_ROMAN) {
+ lf.lfItalic = TRUE;
+ }
+ if (fontPtr->fa.underline) {
+ lf.lfUnderline = TRUE;
+ }
+ if (fontPtr->fa.overstrike) {
+ lf.lfStrikeOut = TRUE;
+ }
+ Tk_FreeFont(f);
+ }
+
+ if (TCL_OK == r && hdPtr->cmdObj != NULL) {
+ int len = 0;
+
+ r = Tcl_ListObjLength(interp, hdPtr->cmdObj, &len);
+ if (len > 0) {
+ cf.Flags |= CF_APPLY;
+ }
+ }
+
+ if (TCL_OK == r) {
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ if (ChooseFont(&cf)) {
+ if (hdPtr->cmdObj) {
+ ApplyLogfont(hdPtr->interp, hdPtr->cmdObj, hdc, &lf);
+ }
+ if (hdPtr->parent) {
+ TkSendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged");
+ }
+ }
+ Tcl_SetServiceMode(oldMode);
+ EnableWindow(cf.hwndOwner, 1);
+ }
+
+ ReleaseDC(cf.hwndOwner, hdc);
+ return r;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * FontchooserHideCmd --
+ *
+ * Implementation of the 'tk fontchooser hide' ensemble. See the user
+ * documentation for details.
+ * As the Win32 FontChooser function is always modal all we do here is
+ * destroy the dialog
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static int
+FontchooserHideCmd(
+ ClientData clientData, /* Main window */
+ Tcl_Interp *interp,
+ int objc,
+ Tcl_Obj *const objv[])
+{
+ HookData *hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
+
+ if (hdPtr->hwnd && IsWindow(hdPtr->hwnd)) {
+ EndDialog(hdPtr->hwnd, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * DeleteHookData --
+ *
+ * Clean up the font chooser configuration data when the interp is
+ * destroyed.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+static void
+DeleteHookData(ClientData clientData, Tcl_Interp *interp)
+{
+ HookData *hdPtr = clientData;
+
+ if (hdPtr->parentObj) {
+ Tcl_DecrRefCount(hdPtr->parentObj);
+ }
+ if (hdPtr->fontObj) {
+ Tcl_DecrRefCount(hdPtr->fontObj);
+ }
+ if (hdPtr->titleObj) {
+ Tcl_DecrRefCount(hdPtr->titleObj);
+ }
+ if (hdPtr->cmdObj) {
+ Tcl_DecrRefCount(hdPtr->cmdObj);
+ }
+ ckfree(hdPtr);
+}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * TkInitFontchooser --
+ *
+ * Associate the font chooser configuration data with the Tcl
+ * interpreter. There is one font chooser per interp.
+ *
+ * ----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE const TkEnsemble tkFontchooserEnsemble[];
+const TkEnsemble tkFontchooserEnsemble[] = {
+ { "configure", FontchooserConfigureCmd, NULL },
+ { "show", FontchooserShowCmd, NULL },
+ { "hide", FontchooserHideCmd, NULL },
+ { NULL, NULL, NULL }
+};
+
+int
+TkInitFontchooser(Tcl_Interp *interp, ClientData clientData)
+{
+ HookData *hdPtr = ckalloc(sizeof(HookData));
+
+ memset(hdPtr, 0, sizeof(HookData));
+ Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteHookData, hdPtr);
+ return TCL_OK;
+}
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 366fc61..f770f15 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -17,7 +17,6 @@
* These macros convert between X's bizarre angle units to radians.
*/
-#define PI 3.14159265358979
#define XAngleToRadians(a) ((double)(a) / 64 * PI / 180);
/*
@@ -101,7 +100,7 @@ int tkpWinBltModes[] = {
* The followng typedef is used to pass Windows GDI drawing functions.
*/
-typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, CONST POINT* points, int npoints);
+typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, const POINT *points, int npoints);
typedef struct ThreadSpecificData {
POINT *winPoints; /* Array of points that is reused. */
@@ -242,9 +241,9 @@ ConvertPoints(
if (npoints > tsdPtr->nWinPoints) {
if (tsdPtr->winPoints != NULL) {
- ckfree((char *) tsdPtr->winPoints);
+ ckfree(tsdPtr->winPoints);
}
- tsdPtr->winPoints = (POINT *) ckalloc(sizeof(POINT) * npoints);
+ tsdPtr->winPoints = ckalloc(sizeof(POINT) * npoints);
if (tsdPtr->winPoints == NULL) {
tsdPtr->nWinPoints = -1;
return NULL;
@@ -551,10 +550,10 @@ TkPutImage(
usePalette = (image->bits_per_pixel < 16);
if (usePalette) {
- infoPtr = (BITMAPINFO *) ckalloc(sizeof(BITMAPINFOHEADER)
+ infoPtr = ckalloc(sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD)*ncolors);
} else {
- infoPtr = (BITMAPINFO *) ckalloc(sizeof(BITMAPINFOHEADER));
+ infoPtr = ckalloc(sizeof(BITMAPINFOHEADER));
}
infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -581,10 +580,10 @@ TkPutImage(
}
bitmap = CreateDIBitmap(dc, &infoPtr->bmiHeader, CBM_INIT,
image->data, infoPtr, DIB_RGB_COLORS);
- ckfree((char *) infoPtr);
+ ckfree(infoPtr);
}
if (!bitmap) {
- Tcl_Panic("Fail to allocate bitmap\n");
+ Tcl_Panic("Fail to allocate bitmap");
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
return;
@@ -744,7 +743,7 @@ RenderObject(
HPEN pen,
WinDrawFunc func)
{
- RECT rect = {0, 0, 0, 0};
+ RECT rect = {0,0,0,0};
HPEN oldPen;
HBRUSH oldBrush;
POINT *winPoints = ConvertPoints(points, npoints, mode, &rect);
@@ -812,7 +811,7 @@ RenderObject(
SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE
: WINDING);
oldMemBrush = SelectObject(dcMem, CreateSolidBrush(gc->foreground));
- (*func)(dcMem, winPoints, npoints);
+ func(dcMem, winPoints, npoints);
BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYFG);
/*
@@ -824,7 +823,7 @@ RenderObject(
if (gc->fill_style == FillOpaqueStippled) {
DeleteObject(SelectObject(dcMem,
CreateSolidBrush(gc->background)));
- (*func)(dcMem, winPoints, npoints);
+ func(dcMem, winPoints, npoints);
BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0,
COPYBG);
}
@@ -840,9 +839,7 @@ RenderObject(
SetPolyFillMode(dc, (gc->fill_rule == EvenOddRule) ? ALTERNATE
: WINDING);
-
- (*func)(dc, winPoints, npoints);
-
+ func(dc, winPoints, npoints);
SelectObject(dc, oldPen);
}
DeleteObject(SelectObject(dc, oldBrush));
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index b7f5085..43cd419 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -69,15 +69,15 @@ void
TkWinCleanupContainerList(void)
{
Container *nextPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- for (; tsdPtr->firstContainerPtr != (Container *) NULL;
+ for (; tsdPtr->firstContainerPtr != NULL;
tsdPtr->firstContainerPtr = nextPtr) {
nextPtr = tsdPtr->firstContainerPtr->nextPtr;
- ckfree((char *) tsdPtr->firstContainerPtr);
+ ckfree(tsdPtr->firstContainerPtr);
}
- tsdPtr->firstContainerPtr = (Container *) NULL;
+ tsdPtr->firstContainerPtr = NULL;
}
/*
@@ -102,7 +102,7 @@ TkpTestembedCmd(
ClientData clientData,
Tcl_Interp *interp,
int argc,
- CONST char **argv)
+ const char **argv)
{
return TCL_OK;
}
@@ -230,7 +230,7 @@ TkpUseWindow(
* 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
+ const char *string) /* String identifying an X window to use for
* tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -298,7 +298,7 @@ TkpUseWindow(
char msg[256];
sprintf(msg, "Unable to get information of window \"%.80s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string);
- if (IDCANCEL == MessageBox(hwnd, msg, "Tk Warning",
+ if (IDCANCEL == MessageBoxA(hwnd, msg, "Tk Warning",
MB_OKCANCEL | MB_ICONWARNING)) {
Tcl_SetResult(interp, "Operation has been canceled", TCL_STATIC);
return TCL_ERROR;
@@ -361,7 +361,7 @@ TkpMakeContainer(
*/
Tk_MakeWindowExist(tkwin);
- containerPtr = (Container *) ckalloc(sizeof(Container));
+ containerPtr = ckalloc(sizeof(Container));
containerPtr->parentPtr = winPtr;
containerPtr->parentHWnd = Tk_GetHWND(Tk_WindowId(tkwin));
containerPtr->embeddedHWnd = NULL;
@@ -1095,7 +1095,7 @@ EmbedWindowDeleted(
} else {
prevPtr->nextPtr = containerPtr->nextPtr;
}
- ckfree((char *) containerPtr);
+ ckfree(containerPtr);
}
}
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index f209716..86f63ac 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -50,7 +50,7 @@ typedef struct FontFamily {
int isSymbolFont; /* Non-zero if this is a symbol font. */
int isWideFont; /* 1 if this is a double-byte font, 0
* otherwise. */
- BOOL (WINAPI *textOutProc)(HDC, int, int, TCHAR *, int);
+ BOOL (WINAPI *textOutProc)(HDC hdc, int x, int y, TCHAR *str, int len);
/* The procedure to use to draw text after it
* has been converted from UTF-8 to the
* encoding of this font. */
@@ -94,10 +94,12 @@ typedef struct FontFamily {
typedef struct SubFont {
char **fontMap; /* Pointer to font map from the FontFamily,
* cached here to save a dereference. */
- HFONT hFont; /* The specific screen font that will be used
+ HFONT hFont0; /* The specific screen font that will be used
* when displaying/measuring chars belonging
* to the FontFamily. */
FontFamily *familyPtr; /* The FontFamily for this SubFont. */
+ HFONT hFontAngled;
+ double angle;
} SubFont;
/*
@@ -123,7 +125,6 @@ typedef struct WinFont {
* attributes. Usually points to
* staticSubFonts, but may point to malloced
* space if there are lots of SubFonts. */
-
HWND hwnd; /* Toplevel window of application that owns
* this font, used for getting HDC for
* offscreen measurements. */
@@ -172,7 +173,7 @@ typedef struct ThreadSpecificData {
* currently loaded. As screen fonts are
* loaded, this list grows to hold information
* about what characters exist in each font
- * family. */
+ * family. */
Tcl_HashTable uidTable;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -189,40 +190,45 @@ static Tcl_Encoding systemEncoding;
static FontFamily * AllocFontFamily(HDC hdc, HFONT hFont, int base);
static SubFont * CanUseFallback(HDC hdc, WinFont *fontPtr,
- char *fallbackName, int ch,
+ const char *fallbackName, int ch,
SubFont **subFontPtrPtr);
static SubFont * CanUseFallbackWithAliases(HDC hdc, WinFont *fontPtr,
- char *faceName, int ch, Tcl_DString *nameTriedPtr,
+ const char *faceName, int ch,
+ Tcl_DString *nameTriedPtr,
SubFont **subFontPtrPtr);
-static int FamilyExists(HDC hdc, CONST char *faceName);
-static char * FamilyOrAliasExists(HDC hdc, CONST char *faceName);
+static int FamilyExists(HDC hdc, const char *faceName);
+static const char * FamilyOrAliasExists(HDC hdc, const char *faceName);
static SubFont * FindSubFontForChar(WinFont *fontPtr, int ch,
SubFont **subFontPtrPtr);
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 HFONT GetScreenFont(CONST TkFontAttributes *faPtr,
- CONST char *faceName, int pixelSize);
+static HFONT GetScreenFont(const TkFontAttributes *faPtr,
+ const char *faceName, int pixelSize,
+ double angle);
static void InitFont(Tk_Window tkwin, HFONT hFont,
int overstrike, WinFont *tkFontPtr);
-static void InitSubFont(HDC hdc, HFONT hFont, int base,
+static inline void InitSubFont(HDC hdc, HFONT hFont, int base,
SubFont *subFontPtr);
static int CreateNamedSystemLogFont(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char* name,
+ Tk_Window tkwin, const char* name,
LOGFONT* logFontPtr);
static int CreateNamedSystemFont(Tcl_Interp *interp,
- Tk_Window tkwin, CONST char* name, HFONT hFont);
+ Tk_Window tkwin, const char* name, HFONT hFont);
static int LoadFontRanges(HDC hdc, HFONT hFont,
USHORT **startCount, USHORT **endCount,
int *symbolPtr);
static void MultiFontTextOut(HDC hdc, WinFont *fontPtr,
- CONST char *source, int numBytes, int x, int y);
+ const char *source, int numBytes, int x, int y,
+ double angle);
static void ReleaseFont(WinFont *fontPtr);
-static void ReleaseSubFont(SubFont *subFontPtr);
-static int SeenName(CONST char *name, Tcl_DString *dsPtr);
-static void SwapLong(PULONG p);
-static void SwapShort(USHORT *p);
+static inline void ReleaseSubFont(SubFont *subFontPtr);
+static int SeenName(const char *name, Tcl_DString *dsPtr);
+static inline HFONT SelectFont(HDC hdc, WinFont *fontPtr,
+ SubFont *subFontPtr, double angle);
+static inline void SwapLong(PULONG p);
+static inline void SwapShort(USHORT *p);
static int CALLBACK WinFontCanUseProc(ENUMLOGFONT *lfPtr,
NEWTEXTMETRIC *tmPtr, int fontType,
LPARAM lParam);
@@ -298,7 +304,7 @@ TkpFontPkgInit(
TkFont *
TkpGetNativeFont(
Tk_Window tkwin, /* For display where font will be used. */
- CONST char *name) /* Platform-specific font name. */
+ const char *name) /* Platform-specific font name. */
{
int object;
WinFont *fontPtr;
@@ -309,7 +315,7 @@ TkpGetNativeFont(
}
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
- fontPtr = (WinFont *) ckalloc(sizeof(WinFont));
+ fontPtr = ckalloc(sizeof(WinFont));
InitFont(tkwin, GetStockObject(object), 0, fontPtr);
return (TkFont *) fontPtr;
@@ -317,13 +323,13 @@ TkpGetNativeFont(
/*
*---------------------------------------------------------------------------
+ *
* CreateNamedSystemFont --
*
* This function registers a Windows logical font description with the Tk
* named font mechanism.
*
- * Side effects
- *
+ * Side effects:
* A new named font is added to the Tk font registry.
*
*---------------------------------------------------------------------------
@@ -333,12 +339,12 @@ static int
CreateNamedSystemLogFont(
Tcl_Interp *interp,
Tk_Window tkwin,
- CONST char* name,
- LOGFONTA* logFontPtr)
+ const char* name,
+ LOGFONT* logFontPtr)
{
HFONT hFont;
int r;
-
+
hFont = CreateFontIndirect(logFontPtr);
r = CreateNamedSystemFont(interp, tkwin, name, hFont);
DeleteObject((HGDIOBJ)hFont);
@@ -347,13 +353,13 @@ CreateNamedSystemLogFont(
/*
*---------------------------------------------------------------------------
- * CreateNamedSystemFont --
*
- * This function registers a Windows font with the Tk
- * named font mechanism.
+ * CreateNamedSystemFont --
*
- * Side effects
+ * This function registers a Windows font with the Tk named font
+ * mechanism.
*
+ * Side effects:
* A new named font is added to the Tk font registry.
*
*---------------------------------------------------------------------------
@@ -363,12 +369,12 @@ static int
CreateNamedSystemFont(
Tcl_Interp *interp,
Tk_Window tkwin,
- CONST char* name,
+ const char* name,
HFONT hFont)
{
WinFont winfont;
int r;
-
+
TkDeleteNamedFont(NULL, tkwin, name);
InitFont(tkwin, hFont, 0, &winfont);
r = TkCreateNamedFont(interp, tkwin, name, &winfont.font.fa);
@@ -378,16 +384,19 @@ CreateNamedSystemFont(
/*
*---------------------------------------------------------------------------
+ *
* TkWinSystemFonts --
*
* Create some platform specific named fonts that to give access to the
- * system fonts. These are all defined for the Windows desktop parameters.
+ * system fonts. These are all defined for the Windows desktop
+ * parameters.
*
*---------------------------------------------------------------------------
*/
void
-TkWinSetupSystemFonts(TkMainInfo *mainPtr)
+TkWinSetupSystemFonts(
+ TkMainInfo *mainPtr)
{
Tcl_Interp *interp;
Tk_Window tkwin;
@@ -401,14 +410,14 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr)
/* force this for now */
if (((TkWindow *) tkwin)->mainPtr == NULL) {
- ((TkWindow *) tkwin)->mainPtr = mainPtr;
+ ((TkWindow *) tkwin)->mainPtr = mainPtr;
}
/*
- * If this API call fails then we will fallback to setting these
- * named fonts from script in ttk/fonts.tcl. So far I've only
- * seen it fail when WINVER has been defined for a higher platform than
- * we are running on. (ie: WINVER=0x0600 and running on XP).
+ * If this API call fails then we will fallback to setting these named
+ * fonts from script in ttk/fonts.tcl. So far I've only seen it fail when
+ * WINVER has been defined for a higher platform than we are running on.
+ * (i.e. WINVER=0x0600 and running on XP).
*/
ZeroMemory(&ncMetrics, sizeof(ncMetrics));
@@ -416,26 +425,26 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr)
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(ncMetrics), &ncMetrics, 0)) {
CreateNamedSystemLogFont(interp, tkwin, "TkDefaultFont",
- &ncMetrics.lfMessageFont);
+ &ncMetrics.lfMessageFont);
CreateNamedSystemLogFont(interp, tkwin, "TkHeadingFont",
- &ncMetrics.lfMessageFont);
+ &ncMetrics.lfMessageFont);
CreateNamedSystemLogFont(interp, tkwin, "TkTextFont",
- &ncMetrics.lfMessageFont);
+ &ncMetrics.lfMessageFont);
CreateNamedSystemLogFont(interp, tkwin, "TkMenuFont",
- &ncMetrics.lfMenuFont);
+ &ncMetrics.lfMenuFont);
CreateNamedSystemLogFont(interp, tkwin, "TkTooltipFont",
- &ncMetrics.lfStatusFont);
+ &ncMetrics.lfStatusFont);
CreateNamedSystemLogFont(interp, tkwin, "TkCaptionFont",
- &ncMetrics.lfCaptionFont);
+ &ncMetrics.lfCaptionFont);
CreateNamedSystemLogFont(interp, tkwin, "TkSmallCaptionFont",
- &ncMetrics.lfSmCaptionFont);
+ &ncMetrics.lfSmCaptionFont);
}
iconMetrics.cbSize = sizeof(iconMetrics);
if (SystemParametersInfo(SPI_GETICONMETRICS, sizeof(iconMetrics),
&iconMetrics, 0)) {
CreateNamedSystemLogFont(interp, tkwin, "TkIconFont",
- &iconMetrics.lfFont);
+ &iconMetrics.lfFont);
}
/*
@@ -444,9 +453,9 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr)
*/
{
- LOGFONTA lfFixed = {
+ LOGFONT lfFixed = {
0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
- 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, ""
+ 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, TEXT("")
};
long pointSize, dpi;
HDC hdc = GetDC(NULL);
@@ -457,13 +466,13 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr)
CreateNamedSystemLogFont(interp, tkwin, "TkFixedFont", &lfFixed);
}
- /*
+ /*
* Setup the remaining standard Tk font names as named fonts.
*/
for (mapPtr = systemMap; mapPtr->strKey != NULL; mapPtr++) {
- hFont = (HFONT)GetStockObject(mapPtr->numKey);
- CreateNamedSystemFont(interp, tkwin, mapPtr->strKey, hFont);
+ hFont = (HFONT) GetStockObject(mapPtr->numKey);
+ CreateNamedSystemFont(interp, tkwin, mapPtr->strKey, hFont);
}
}
@@ -505,7 +514,7 @@ TkpGetFontFromAttributes(
* will be released. If NULL, a new TkFont
* structure is allocated. */
Tk_Window tkwin, /* For display where font will be used. */
- CONST TkFontAttributes *faPtr)
+ const TkFontAttributes *faPtr)
/* Set of attributes to match. */
{
int i, j;
@@ -514,7 +523,7 @@ TkpGetFontFromAttributes(
HFONT hFont;
Window window;
WinFont *fontPtr;
- char ***fontFallbacks;
+ const char *const *const *fontFallbacks;
Tk_Uid faceName, fallback, actualName;
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
@@ -562,9 +571,9 @@ TkpGetFontFromAttributes(
ReleaseDC(hwnd, hdc);
hFont = GetScreenFont(faPtr, faceName,
- TkFontGetPixels(tkwin, faPtr->size));
+ TkFontGetPixels(tkwin, faPtr->size), 0.0);
if (tkFontPtr == NULL) {
- fontPtr = (WinFont *) ckalloc(sizeof(WinFont));
+ fontPtr = ckalloc(sizeof(WinFont));
} else {
fontPtr = (WinFont *) tkFontPtr;
ReleaseFont(fontPtr);
@@ -629,10 +638,12 @@ TkpGetFontFamilies(
HDC hdc;
HWND hwnd;
Window window;
+ Tcl_Obj *resultObj;
window = Tk_WindowId(tkwin);
hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
+ resultObj = Tcl_NewObj();
/*
* On any version NT, there may fonts with international names. Use the
@@ -649,14 +660,10 @@ TkpGetFontFamilies(
* because it only exists under NT.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- EnumFontFamiliesW(hdc, NULL, (FONTENUMPROCW) WinFontFamilyEnumProc,
- (LPARAM) interp);
- } else {
- EnumFontFamiliesA(hdc, NULL, (FONTENUMPROCA) WinFontFamilyEnumProc,
- (LPARAM) interp);
- }
+ EnumFontFamilies(hdc, NULL, (FONTENUMPROC) WinFontFamilyEnumProc,
+ (LPARAM) resultObj);
ReleaseDC(hwnd, hdc);
+ Tcl_SetObjResult(interp, resultObj);
}
static int CALLBACK
@@ -666,17 +673,13 @@ WinFontFamilyEnumProc(
int fontType, /* Type of font (not used). */
LPARAM lParam) /* Result object to hold result. */
{
- char *faceName;
+ char *faceName = (char *) lfPtr->elfLogFont.lfFaceName;
+ Tcl_Obj *resultObj = (Tcl_Obj *) lParam;
Tcl_DString faceString;
- Tcl_Obj *strPtr;
- Tcl_Interp *interp;
- interp = (Tcl_Interp *) lParam;
- faceName = lfPtr->elfLogFont.lfFaceName;
Tcl_ExternalToUtfDString(systemEncoding, faceName, -1, &faceString);
- strPtr = Tcl_NewStringObj(Tcl_DStringValue(&faceString),
- Tcl_DStringLength(&faceString));
- Tcl_ListObjAppendElement(NULL, Tcl_GetObjResult(interp), strPtr);
+ Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj(
+ Tcl_DStringValue(&faceString), Tcl_DStringLength(&faceString)));
Tcl_DStringFree(&faceString);
return 1;
}
@@ -709,13 +712,14 @@ TkpGetSubFonts(
FontFamily *familyPtr;
Tcl_Obj *resultPtr, *strPtr;
- resultPtr = Tcl_GetObjResult(interp);
+ resultPtr = Tcl_NewObj();
fontPtr = (WinFont *) tkfont;
for (i = 0; i < fontPtr->numSubFonts; i++) {
familyPtr = fontPtr->subFontArray[i].familyPtr;
strPtr = Tcl_NewStringObj(familyPtr->faceName, -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
+ Tcl_SetObjResult(interp, resultPtr);
}
/*
@@ -740,7 +744,7 @@ TkpGetFontAttrsForChar(
Tk_Window tkwin, /* Window on the font's display */
Tk_Font tkfont, /* Font to query */
Tcl_UniChar c, /* Character of interest */
- TkFontAttributes* faPtr) /* Output: Font attributes */
+ TkFontAttributes *faPtr) /* Output: Font attributes */
{
WinFont *fontPtr = (WinFont *) tkfont;
/* Structure describing the logical font */
@@ -748,22 +752,22 @@ TkpGetFontAttrsForChar(
/* GDI device context */
SubFont *lastSubFontPtr = &fontPtr->subFontArray[0];
/* Pointer to subfont array in case
- * FindSubFontForChar needs to fix up
- * the memory allocation */
- SubFont *thisSubFontPtr = FindSubFontForChar(fontPtr, c,
- &lastSubFontPtr);
- /* Pointer to the subfont to use for
- * the given character */
+ * FindSubFontForChar needs to fix up the
+ * memory allocation */
+ SubFont *thisSubFontPtr =
+ FindSubFontForChar(fontPtr, c, &lastSubFontPtr);
+ /* Pointer to the subfont to use for the given
+ * character */
FontFamily *familyPtr = thisSubFontPtr->familyPtr;
HFONT oldfont; /* Saved font from the device context */
- TEXTMETRIC tm; /* Font metrics of the selected subfont */
+ TEXTMETRICA tm; /* Font metrics of the selected subfont */
/*
* Get the font attributes.
*/
- oldfont = SelectObject(hdc, thisSubFontPtr->hFont);
- GetTextMetrics(hdc, &tm);
+ oldfont = SelectObject(hdc, thisSubFontPtr->hFont0);
+ GetTextMetricsA(hdc, &tm);
SelectObject(hdc, oldfont);
ReleaseDC(fontPtr->hwnd, hdc);
faPtr->family = familyPtr->faceName;
@@ -778,7 +782,7 @@ TkpGetFontAttrsForChar(
/*
*---------------------------------------------------------------------------
*
- * Tk_MeasureChars --
+ * Tk_MeasureChars --
*
* Determine the number of bytes from the string that will fit in the
* given horizontal span. The measurement is done under the assumption
@@ -798,7 +802,7 @@ TkpGetFontAttrsForChar(
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
+ 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. */
@@ -829,7 +833,7 @@ Tk_MeasureChars(
FontFamily *familyPtr;
Tcl_DString runString;
SubFont *thisSubFontPtr, *lastSubFontPtr;
- CONST char *p, *end, *next = NULL, *start;
+ const char *p, *end, *next = NULL, *start;
if (numBytes == 0) {
*lengthPtr = 0;
@@ -840,7 +844,7 @@ Tk_MeasureChars(
hdc = GetDC(fontPtr->hwnd);
lastSubFontPtr = &fontPtr->subFontArray[0];
- oldFont = SelectObject(hdc, lastSubFontPtr->hFont);
+ oldFont = SelectObject(hdc, lastSubFontPtr->hFont0);
/*
* A three step process:
@@ -862,8 +866,8 @@ Tk_MeasureChars(
Tcl_UtfToExternalDString(familyPtr->encoding, start,
(int) (p - start), &runString);
size.cx = 0;
- (*familyPtr->getTextExtentPoint32Proc)(hdc,
- Tcl_DStringValue(&runString),
+ familyPtr->getTextExtentPoint32Proc(hdc,
+ (TCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
&size);
Tcl_DStringFree(&runString);
@@ -875,7 +879,7 @@ Tk_MeasureChars(
lastSubFontPtr = thisSubFontPtr;
start = p;
- SelectObject(hdc, lastSubFontPtr->hFont);
+ SelectObject(hdc, lastSubFontPtr->hFont0);
}
p = next;
}
@@ -890,8 +894,7 @@ Tk_MeasureChars(
Tcl_UtfToExternalDString(familyPtr->encoding, start,
(int) (p - start), &runString);
size.cx = 0;
- (*familyPtr->getTextExtentPoint32Proc)(hdc,
- Tcl_DStringValue(&runString),
+ familyPtr->getTextExtentPoint32Proc(hdc, (TCHAR *) Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
&size);
Tcl_DStringFree(&runString);
@@ -924,8 +927,8 @@ Tk_MeasureChars(
&dstWrote, NULL);
Tcl_DStringAppend(&runString,buf,dstWrote);
size.cx = 0;
- (*familyPtr->getTextExtentPoint32Proc)(hdc,
- Tcl_DStringValue(&runString),
+ familyPtr->getTextExtentPoint32Proc(hdc,
+ (TCHAR *) Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
&size);
if ((curX+size.cx) > maxLength) {
@@ -966,7 +969,7 @@ Tk_MeasureChars(
* procedure without the maxLength limit or any flags.
*/
- CONST char *lastWordBreak = NULL;
+ const char *lastWordBreak = NULL;
Tcl_UniChar ch2;
end = p;
@@ -1000,7 +1003,7 @@ Tk_MeasureChars(
/*
*---------------------------------------------------------------------------
*
- * TkpMeasureCharsInContext --
+ * TkpMeasureCharsInContext --
*
* Determine the number of bytes from the string that will fit in the
* given horizontal span. The measurement is done under the assumption
@@ -1025,7 +1028,7 @@ Tk_MeasureChars(
int
TkpMeasureCharsInContext(
Tk_Font tkfont, /* Font in which characters will be drawn. */
- CONST char *source, /* UTF-8 string to be displayed. Need not be
+ 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 in all. */
@@ -1077,7 +1080,7 @@ Tk_DrawChars(
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
+ 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
@@ -1104,18 +1107,18 @@ Tk_DrawChars(
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);
+ ((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)
&& gc->stipple != None) {
- TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
+ TkWinDrawable *twdPtr = (TkWinDrawable *) gc->stipple;
HBRUSH oldBrush, stipple;
HBITMAP oldBitmap, bitmap;
HDC dcMem;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
SIZE size;
if (twdPtr->type != TWD_BITMAP) {
@@ -1141,8 +1144,8 @@ Tk_DrawChars(
* Compute the bounding box and create a compatible bitmap.
*/
- GetTextExtentPoint(dcMem, source, numBytes, &size);
- GetTextMetrics(dcMem, &tm);
+ GetTextExtentPointA(dcMem, source, numBytes, &size);
+ GetTextMetricsA(dcMem, &tm);
size.cx -= tm.tmOverhang;
bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy);
oldBitmap = SelectObject(dcMem, bitmap);
@@ -1156,11 +1159,11 @@ Tk_DrawChars(
*/
PatBlt(dcMem, 0, 0, size.cx, size.cy, BLACKNESS);
- MultiFontTextOut(dc, fontPtr, source, numBytes, x, y);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, 0.0);
BitBlt(dc, x, y - tm.tmAscent, size.cx, size.cy, dcMem,
0, 0, 0xEA02E9);
PatBlt(dcMem, 0, 0, size.cx, size.cy, WHITENESS);
- MultiFontTextOut(dc, fontPtr, source, numBytes, x, y);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, 0.0);
BitBlt(dc, x, y - tm.tmAscent, size.cx, size.cy, dcMem,
0, 0, 0x8A0E06);
@@ -1177,11 +1180,11 @@ Tk_DrawChars(
SetTextAlign(dc, TA_LEFT | TA_BASELINE);
SetTextColor(dc, gc->foreground);
SetBkMode(dc, TRANSPARENT);
- MultiFontTextOut(dc, fontPtr, source, numBytes, x, y);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, 0.0);
} else {
HBITMAP oldBitmap, bitmap;
HDC dcMem;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
SIZE size;
dcMem = CreateCompatibleDC(dc);
@@ -1195,13 +1198,14 @@ Tk_DrawChars(
* Compute the bounding box and create a compatible bitmap.
*/
- GetTextExtentPoint(dcMem, source, numBytes, &size);
- GetTextMetrics(dcMem, &tm);
+ GetTextExtentPointA(dcMem, source, numBytes, &size);
+ GetTextMetricsA(dcMem, &tm);
size.cx -= tm.tmOverhang;
bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy);
oldBitmap = SelectObject(dcMem, bitmap);
- MultiFontTextOut(dcMem, fontPtr, source, numBytes, 0, tm.tmAscent);
+ MultiFontTextOut(dcMem, fontPtr, source, numBytes, 0, tm.tmAscent,
+ 0.0);
BitBlt(dc, x, y - tm.tmAscent, size.cx, size.cy, dcMem,
0, 0, (DWORD) tkpWinBltModes[gc->function]);
@@ -1216,6 +1220,154 @@ Tk_DrawChars(
TkWinReleaseDrawableDC(drawable, dc, &state);
}
+void
+TkDrawAngledChars(
+ 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. */
+ double x, double y, /* Coordinates at which to place origin of
+ * string when drawing. */
+ double angle)
+{
+ HDC dc;
+ WinFont *fontPtr;
+ TkWinDCState state;
+
+ fontPtr = (WinFont *) gc->font;
+ display->request++;
+
+ if (drawable == None) {
+ return;
+ }
+
+ 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)
+ && gc->stipple != None) {
+ TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
+ HBRUSH oldBrush, stipple;
+ HBITMAP oldBitmap, bitmap;
+ HDC dcMem;
+ TEXTMETRICA tm;
+ SIZE size;
+
+ if (twdPtr->type != TWD_BITMAP) {
+ Tcl_Panic("unexpected drawable type in stipple");
+ }
+
+ /*
+ * Select stipple pattern into destination dc.
+ */
+
+ dcMem = CreateCompatibleDC(dc);
+
+ stipple = CreatePatternBrush(twdPtr->bitmap.handle);
+ SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL);
+ oldBrush = SelectObject(dc, stipple);
+
+ SetTextAlign(dcMem, TA_LEFT | TA_BASELINE);
+ SetTextColor(dcMem, gc->foreground);
+ SetBkMode(dcMem, TRANSPARENT);
+ SetBkColor(dcMem, RGB(0, 0, 0));
+
+ /*
+ * Compute the bounding box and create a compatible bitmap.
+ */
+
+ GetTextExtentPointA(dcMem, source, numBytes, &size);
+ GetTextMetricsA(dcMem, &tm);
+ size.cx -= tm.tmOverhang;
+ bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy);
+ oldBitmap = SelectObject(dcMem, bitmap);
+
+ /*
+ * The following code is tricky because fonts are rendered in multiple
+ * colors. First we draw onto a black background and copy the white
+ * bits. Then we draw onto a white background and copy the black bits.
+ * Both the foreground and background bits of the font are ANDed with
+ * the stipple pattern as they are copied.
+ */
+
+ PatBlt(dcMem, 0, 0, size.cx, size.cy, BLACKNESS);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ BitBlt(dc, (int)x, (int)y - tm.tmAscent, size.cx, size.cy, dcMem,
+ 0, 0, 0xEA02E9);
+ PatBlt(dcMem, 0, 0, size.cx, size.cy, WHITENESS);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ BitBlt(dc, (int)x, (int)y - tm.tmAscent, size.cx, size.cy, dcMem,
+ 0, 0, 0x8A0E06);
+
+ /*
+ * Destroy the temporary bitmap and restore the device context.
+ */
+
+ SelectObject(dcMem, oldBitmap);
+ DeleteObject(bitmap);
+ DeleteDC(dcMem);
+ SelectObject(dc, oldBrush);
+ DeleteObject(stipple);
+ } else if (gc->function == GXcopy) {
+ SetTextAlign(dc, TA_LEFT | TA_BASELINE);
+ SetTextColor(dc, gc->foreground);
+ SetBkMode(dc, TRANSPARENT);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ } else {
+ HBITMAP oldBitmap, bitmap;
+ HDC dcMem;
+ TEXTMETRICA tm;
+ SIZE size;
+
+ dcMem = CreateCompatibleDC(dc);
+
+ SetTextAlign(dcMem, TA_LEFT | TA_BASELINE);
+ SetTextColor(dcMem, gc->foreground);
+ SetBkMode(dcMem, TRANSPARENT);
+ SetBkColor(dcMem, RGB(0, 0, 0));
+
+ /*
+ * Compute the bounding box and create a compatible bitmap.
+ */
+
+ GetTextExtentPointA(dcMem, source, numBytes, &size);
+ GetTextMetricsA(dcMem, &tm);
+ size.cx -= tm.tmOverhang;
+ bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy);
+ oldBitmap = SelectObject(dcMem, bitmap);
+
+ MultiFontTextOut(dcMem, fontPtr, source, numBytes, 0, tm.tmAscent,
+ angle);
+ BitBlt(dc, (int)x, (int)y - tm.tmAscent, size.cx, size.cy, dcMem,
+ 0, 0, (DWORD) tkpWinBltModes[gc->function]);
+
+ /*
+ * Destroy the temporary bitmap and restore the device context.
+ */
+
+ SelectObject(dcMem, oldBitmap);
+ DeleteObject(bitmap);
+ DeleteDC(dcMem);
+ }
+ TkWinReleaseDrawableDC(drawable, dc, &state);
+}
+
/*
*---------------------------------------------------------------------------
*
@@ -1241,7 +1393,7 @@ TkpDrawCharsInContext(
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
+ 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
@@ -1256,8 +1408,8 @@ TkpDrawCharsInContext(
* drawing. */
{
(void) numBytes; /*unused*/
- Tk_DrawChars(display, drawable, gc, tkfont,
- source + rangeStart, rangeLength, x, y);
+ Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
+ rangeLength, x, y);
}
/*
@@ -1285,23 +1437,24 @@ MultiFontTextOut(
HDC hdc, /* HDC to draw into. */
WinFont *fontPtr, /* Contains set of fonts to use when drawing
* following string. */
- CONST char *source, /* Potentially multilingual UTF-8 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
+ int x, int y, /* Coordinates at which to place origin of
* string when drawing. */
+ double angle)
{
Tcl_UniChar ch;
SIZE size;
HFONT oldFont;
FontFamily *familyPtr;
Tcl_DString runString;
- CONST char *p, *end, *next;
+ const char *p, *end, *next;
SubFont *lastSubFontPtr, *thisSubFontPtr;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
lastSubFontPtr = &fontPtr->subFontArray[0];
- oldFont = SelectObject(hdc, lastSubFontPtr->hFont);
- GetTextMetrics(hdc, &tm);
+ oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle);
+ GetTextMetricsA(hdc, &tm);
end = source + numBytes;
for (p = source; p < end; ) {
@@ -1312,11 +1465,11 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- (*familyPtr->textOutProc)(hdc, x-(tm.tmOverhang/2), y,
- Tcl_DStringValue(&runString),
+ familyPtr->textOutProc(hdc, x-(tm.tmOverhang/2), y,
+ (TCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString)>>familyPtr->isWideFont);
- (*familyPtr->getTextExtentPoint32Proc)(hdc,
- Tcl_DStringValue(&runString),
+ familyPtr->getTextExtentPoint32Proc(hdc,
+ (TCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
&size);
x += size.cx;
@@ -1324,8 +1477,8 @@ MultiFontTextOut(
}
lastSubFontPtr = thisSubFontPtr;
source = p;
- SelectObject(hdc, lastSubFontPtr->hFont);
- GetTextMetrics(hdc, &tm);
+ SelectFont(hdc, fontPtr, lastSubFontPtr, angle);
+ GetTextMetricsA(hdc, &tm);
}
p = next;
}
@@ -1333,13 +1486,38 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- (*familyPtr->textOutProc)(hdc, x-(tm.tmOverhang/2), y,
- Tcl_DStringValue(&runString),
+ familyPtr->textOutProc(hdc, x-(tm.tmOverhang/2), y,
+ (TCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
Tcl_DStringFree(&runString);
}
SelectObject(hdc, oldFont);
}
+
+static inline HFONT
+SelectFont(
+ HDC hdc,
+ WinFont *fontPtr,
+ SubFont *subFontPtr,
+ double angle)
+{
+ if (angle == 0.0) {
+ return SelectObject(hdc, subFontPtr->hFont0);
+ } else if (angle == subFontPtr->angle) {
+ return SelectObject(hdc, subFontPtr->hFontAngled);
+ } else {
+ if (subFontPtr->hFontAngled) {
+ DeleteObject(subFontPtr->hFontAngled);
+ }
+ subFontPtr->hFontAngled = GetScreenFont(&fontPtr->font.fa,
+ subFontPtr->familyPtr->faceName, fontPtr->pixelSize, angle);
+ if (subFontPtr->hFontAngled == NULL) {
+ return SelectObject(hdc, subFontPtr->hFont0);
+ }
+ subFontPtr->angle = angle;
+ return SelectObject(hdc, subFontPtr->hFontAngled);
+ }
+}
/*
*---------------------------------------------------------------------------
@@ -1378,20 +1556,20 @@ InitFont(
HDC hdc;
HWND hwnd;
HFONT oldFont;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
Window window;
TkFontMetrics *fmPtr;
Tcl_Encoding encoding;
Tcl_DString faceString;
TkFontAttributes *faPtr;
- char buf[LF_FACESIZE * sizeof(WCHAR)];
+ TCHAR buf[LF_FACESIZE];
window = Tk_WindowId(tkwin);
hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
oldFont = SelectObject(hdc, hFont);
- GetTextMetrics(hdc, &tm);
+ GetTextMetricsA(hdc, &tm);
/*
* On any version NT, there may fonts with international names. Use the
@@ -1408,12 +1586,8 @@ InitFont(
* GetTextFace because it only exists under NT.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- GetTextFaceW(hdc, LF_FACESIZE, (WCHAR *) buf);
- } else {
- GetTextFaceA(hdc, LF_FACESIZE, (char *) buf);
- }
- Tcl_ExternalToUtfDString(systemEncoding, buf, -1, &faceString);
+ GetTextFace(hdc, LF_FACESIZE, buf);
+ Tcl_ExternalToUtfDString(systemEncoding, (char *) buf, -1, &faceString);
fontPtr->font.fid = (Font) fontPtr;
fontPtr->hwnd = hwnd;
@@ -1423,7 +1597,7 @@ InitFont(
faPtr->family = Tk_GetUid(Tcl_DStringValue(&faceString));
faPtr->size =
- TkFontGetPoints(tkwin, -(fontPtr->pixelSize));
+ TkFontGetPoints(tkwin, -(fontPtr->pixelSize));
faPtr->weight =
(tm.tmWeight > FW_MEDIUM) ? TK_FW_BOLD : TK_FW_NORMAL;
faPtr->slant = (tm.tmItalic != 0) ? TK_FS_ITALIC : TK_FS_ROMAN;
@@ -1442,7 +1616,7 @@ InitFont(
encoding = fontPtr->subFontArray[0].familyPtr->encoding;
if (encoding == TkWinGetUnicodeEncoding()) {
- GetCharWidthW(hdc, 0, BASE_CHARS - 1, fontPtr->widths);
+ GetCharWidth(hdc, 0, BASE_CHARS - 1, fontPtr->widths);
} else {
GetCharWidthA(hdc, 0, BASE_CHARS - 1, fontPtr->widths);
}
@@ -1479,7 +1653,7 @@ ReleaseFont(
ReleaseSubFont(&fontPtr->subFontArray[i]);
}
if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
- ckfree((char *) fontPtr->subFontArray);
+ ckfree(fontPtr->subFontArray);
}
}
@@ -1501,7 +1675,7 @@ ReleaseFont(
*-------------------------------------------------------------------------
*/
-static void
+static inline void
InitSubFont(
HDC hdc, /* HDC in which font can be selected. */
HFONT hFont, /* The screen font. */
@@ -1510,9 +1684,11 @@ InitSubFont(
SubFont *subFontPtr) /* Filled with SubFont constructed from above
* attributes. */
{
- subFontPtr->hFont = hFont;
+ subFontPtr->hFont0 = hFont;
subFontPtr->familyPtr = AllocFontFamily(hdc, hFont, base);
subFontPtr->fontMap = subFontPtr->familyPtr->fontMap;
+ subFontPtr->hFontAngled = NULL;
+ subFontPtr->angle = 0.0;
}
/*
@@ -1532,11 +1708,14 @@ InitSubFont(
*---------------------------------------------------------------------------
*/
-static void
+static inline void
ReleaseSubFont(
SubFont *subFontPtr) /* The SubFont to delete. */
{
- DeleteObject(subFontPtr->hFont);
+ DeleteObject(subFontPtr->hFont0);
+ if (subFontPtr->hFontAngled) {
+ DeleteObject(subFontPtr->hFontAngled);
+ }
FreeFontFamily(subFontPtr->familyPtr);
}
@@ -1579,17 +1758,13 @@ AllocFontFamily(
FontFamily *familyPtr;
Tcl_DString faceString;
Tcl_Encoding encoding;
- char buf[LF_FACESIZE * sizeof(WCHAR)];
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ TCHAR buf[LF_FACESIZE];
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
hFont = SelectObject(hdc, hFont);
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- GetTextFaceW(hdc, LF_FACESIZE, (WCHAR *) buf);
- } else {
- GetTextFaceA(hdc, LF_FACESIZE, (char *) buf);
- }
- Tcl_ExternalToUtfDString(systemEncoding, buf, -1, &faceString);
+ GetTextFace(hdc, LF_FACESIZE, buf);
+ Tcl_ExternalToUtfDString(systemEncoding, (char *) buf, -1, &faceString);
faceName = Tk_GetUid(Tcl_DStringValue(&faceString));
Tcl_DStringFree(&faceString);
hFont = SelectObject(hdc, hFont);
@@ -1602,7 +1777,7 @@ AllocFontFamily(
}
}
- familyPtr = (FontFamily *) ckalloc(sizeof(FontFamily));
+ familyPtr = ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -1688,7 +1863,7 @@ FreeFontFamily(
{
int i;
FontFamily **familyPtrPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (familyPtr == NULL) {
@@ -1704,10 +1879,10 @@ FreeFontFamily(
}
}
if (familyPtr->startCount != NULL) {
- ckfree((char *) familyPtr->startCount);
+ ckfree(familyPtr->startCount);
}
if (familyPtr->endCount != NULL) {
- ckfree((char *) familyPtr->endCount);
+ ckfree(familyPtr->endCount);
}
if (familyPtr->encoding != TkWinGetUnicodeEncoding()) {
Tcl_FreeEncoding(familyPtr->encoding);
@@ -1719,13 +1894,13 @@ FreeFontFamily(
for (familyPtrPtr = &tsdPtr->fontFamilyList; ; ) {
if (*familyPtrPtr == familyPtr) {
- *familyPtrPtr = familyPtr->nextPtr;
+ *familyPtrPtr = familyPtr->nextPtr;
break;
}
familyPtrPtr = &(*familyPtrPtr)->nextPtr;
}
- ckfree((char *) familyPtr);
+ ckfree(familyPtr);
}
/*
@@ -1759,9 +1934,10 @@ FindSubFontForChar(
HDC hdc;
int i, j, k;
CanUse canUse;
- char **aliases, **anyFallbacks;
- char ***fontFallbacks;
- char *fallbackName;
+ const char *const *aliases;
+ const char *const *anyFallbacks;
+ const char *const *const *fontFallbacks;
+ const char *fallbackName;
SubFont *subFontPtr;
Tcl_DString ds;
@@ -1850,13 +2026,8 @@ FindSubFontForChar(
canUse.ch = ch;
canUse.subFontPtr = NULL;
canUse.subFontPtrPtr = subFontPtrPtr;
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- EnumFontFamiliesW(hdc, NULL, (FONTENUMPROCW) WinFontCanUseProc,
- (LPARAM) &canUse);
- } else {
- EnumFontFamiliesA(hdc, NULL, (FONTENUMPROCA) WinFontCanUseProc,
- (LPARAM) &canUse);
- }
+ EnumFontFamilies(hdc, NULL, (FONTENUMPROC) WinFontCanUseProc,
+ (LPARAM) &canUse);
subFontPtr = canUse.subFontPtr;
end:
@@ -1864,7 +2035,7 @@ FindSubFontForChar(
if (subFontPtr == NULL) {
/*
- * No font can display this character. We will use the base font and
+ * No font can display this character. We will use the base font and
* have it display the "unknown" character.
*/
@@ -1897,7 +2068,7 @@ WinFontCanUseProc(
fontPtr = canUsePtr->fontPtr;
nameTriedPtr = canUsePtr->nameTriedPtr;
- fallbackName = lfPtr->elfLogFont.lfFaceName;
+ fallbackName = (char *) lfPtr->elfLogFont.lfFaceName;
Tcl_ExternalToUtfDString(systemEncoding, fallbackName, -1, &faceString);
fallbackName = Tcl_DStringValue(&faceString);
@@ -2022,7 +2193,7 @@ FontMapLoadPage(
USHORT *startCount, *endCount;
int i, j, bitOffset, end, segCount;
- subFontPtr->fontMap[row] = (char *) ckalloc(FONTMAP_BITSPERPAGE / 8);
+ subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
familyPtr = subFontPtr->familyPtr;
@@ -2046,7 +2217,8 @@ FontMapLoadPage(
if (endCount[j] >= i) {
if (startCount[j] <= i) {
bitOffset = i & (FONTMAP_BITSPERPAGE - 1);
- subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7);
+ subFontPtr->fontMap[row][bitOffset >> 3] |=
+ 1 << (bitOffset & 7);
}
break;
}
@@ -2104,7 +2276,7 @@ CanUseFallbackWithAliases(
HDC hdc, /* HDC in which font can be selected. */
WinFont *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. */
Tcl_DString *nameTriedPtr, /* Records face names that have already been
@@ -2115,7 +2287,7 @@ CanUseFallbackWithAliases(
* array of subfonts. */
{
int i;
- char **aliases;
+ const char *const *aliases;
SubFont *subFontPtr;
if (SeenName(faceName, nameTriedPtr) == 0) {
@@ -2160,11 +2332,11 @@ CanUseFallbackWithAliases(
static int
SeenName(
- CONST char *name, /* The name to check. */
+ const char *name, /* The name to check. */
Tcl_DString *dsPtr) /* Contains names that have already been
* seen. */
{
- CONST char *seen, *end;
+ const char *seen, *end;
seen = Tcl_DStringValue(dsPtr);
end = seen + Tcl_DStringLength(dsPtr);
@@ -2174,7 +2346,7 @@ SeenName(
}
seen += strlen(seen) + 1;
}
- Tcl_DStringAppend(dsPtr, (char *) name, (int) (strlen(name) + 1));
+ Tcl_DStringAppend(dsPtr, name, (int) (strlen(name) + 1));
return 0;
}
@@ -2207,7 +2379,7 @@ CanUseFallback(
HDC hdc, /* HDC in which font can be selected. */
WinFont *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. */
SubFont **subFontPtrPtr) /* Variable to fix-up if we realloc the array
@@ -2235,7 +2407,8 @@ CanUseFallback(
* Load this font and see if it has the desired character.
*/
- hFont = GetScreenFont(&fontPtr->font.fa, faceName, fontPtr->pixelSize);
+ hFont = GetScreenFont(&fontPtr->font.fa, faceName, fontPtr->pixelSize,
+ 0.0);
InitSubFont(hdc, hFont, 0, &subFont);
if (((ch < 256) && (subFont.familyPtr->isSymbolFont))
|| (FontMapLookup(&subFont, ch) == 0)) {
@@ -2251,12 +2424,11 @@ CanUseFallback(
if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
SubFont *newPtr;
- newPtr = (SubFont *) ckalloc(sizeof(SubFont)
- * (fontPtr->numSubFonts + 1));
- memcpy((char *) newPtr, fontPtr->subFontArray,
+ newPtr = ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
+ memcpy(newPtr, fontPtr->subFontArray,
fontPtr->numSubFonts * sizeof(SubFont));
if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
- ckfree((char *) fontPtr->subFontArray);
+ ckfree(fontPtr->subFontArray);
}
/*
@@ -2291,22 +2463,24 @@ CanUseFallback(
static HFONT
GetScreenFont(
- CONST TkFontAttributes *faPtr,
+ const TkFontAttributes *faPtr,
/* Desired font attributes for new HFONT. */
- CONST char *faceName, /* Overrides font family specified in font
+ const char *faceName, /* Overrides font family specified in font
* attributes. */
- int pixelSize) /* Overrides size specified in font
+ int pixelSize, /* Overrides size specified in font
* attributes. */
+ double angle) /* What is the desired orientation of the
+ * font. */
{
Tcl_DString ds;
HFONT hFont;
- LOGFONTW lf;
+ LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfHeight = -pixelSize;
lf.lfWidth = 0;
- lf.lfEscapement = 0;
- lf.lfOrientation = 0;
+ lf.lfEscapement = ROUND16(angle * 10);
+ lf.lfOrientation = ROUND16(angle * 10);
lf.lfWeight = (faPtr->weight == TK_FW_NORMAL) ? FW_NORMAL : FW_BOLD;
lf.lfItalic = faPtr->slant;
lf.lfUnderline = faPtr->underline;
@@ -2318,36 +2492,10 @@ GetScreenFont(
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
Tcl_UtfToExternalDString(systemEncoding, faceName, -1, &ds);
-
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- Tcl_UniChar *src, *dst;
-
- /*
- * We can only store up to LF_FACESIZE wide characters
- */
-
- if ((size_t)Tcl_DStringLength(&ds) >= (LF_FACESIZE * sizeof(WCHAR))) {
- Tcl_DStringSetLength(&ds, LF_FACESIZE);
- }
- src = (Tcl_UniChar *) Tcl_DStringValue(&ds);
- dst = (Tcl_UniChar *) lf.lfFaceName;
- while (*src != '\0') {
- *dst++ = *src++;
- }
- *dst = '\0';
- hFont = CreateFontIndirectW(&lf);
- } else {
- /*
- * We can only store up to LF_FACESIZE characters
- */
-
- if (Tcl_DStringLength(&ds) >= LF_FACESIZE) {
- Tcl_DStringSetLength(&ds, LF_FACESIZE);
- }
- strcpy((char *) lf.lfFaceName, Tcl_DStringValue(&ds));
- hFont = CreateFontIndirectA((LOGFONTA *) &lf);
- }
+ _tcsncpy(lf.lfFaceName, (TCHAR *)Tcl_DStringValue(&ds), LF_FACESIZE-1);
Tcl_DStringFree(&ds);
+ lf.lfFaceName[LF_FACESIZE-1] = 0;
+ hFont = CreateFontIndirect(&lf);
return hFont;
}
@@ -2373,7 +2521,7 @@ GetScreenFont(
static int
FamilyExists(
HDC hdc, /* HDC in which font family will be used. */
- CONST char *faceName) /* Font family to query. */
+ const char *faceName) /* Font family to query. */
{
int result;
Tcl_DString faceString;
@@ -2403,27 +2551,22 @@ FamilyExists(
* non-zero value.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- result = EnumFontFamiliesW(hdc, (WCHAR*) Tcl_DStringValue(&faceString),
- (FONTENUMPROCW) WinFontExistProc, 0);
- } else {
- result = EnumFontFamiliesA(hdc, (char *) Tcl_DStringValue(&faceString),
- (FONTENUMPROCA) WinFontExistProc, 0);
- }
+ result = EnumFontFamilies(hdc, (TCHAR*) Tcl_DStringValue(&faceString),
+ (FONTENUMPROC) WinFontExistProc, 0);
Tcl_DStringFree(&faceString);
return (result == 0);
}
-static char *
+static const char *
FamilyOrAliasExists(
HDC hdc,
- CONST char *faceName)
+ const char *faceName)
{
- char **aliases;
+ const char *const *aliases;
int i;
if (FamilyExists(hdc, faceName) != 0) {
- return (char *) faceName;
+ return faceName;
}
aliases = TkFontGetAliasList(faceName);
if (aliases != NULL) {
@@ -2453,7 +2596,7 @@ WinFontExistProc(
#pragma pack(1) /* Structures are byte aligned in file. */
-#define CMAPHEX 0x636d6170 /* Key for character map resource. */
+#define CMAPHEX 0x636d6170 /* Key for character map resource. */
typedef struct CMAPTABLE {
USHORT version; /* Table version number (0). */
@@ -2495,7 +2638,7 @@ typedef struct SUBHEADER {
} SUBHEADER;
typedef struct HIBYTETABLE {
- USHORT format; /* Format number is set to 2. */
+ USHORT format; /* Format number is set to 2. */
USHORT length; /* The actual length in bytes of this
* subtable. */
USHORT version; /* Version number (starts at 0). */
@@ -2613,7 +2756,7 @@ LoadFontRanges(
}
n = GetFontData(hdc, cmapKey, 0, &cmapTable, sizeof(cmapTable));
- if (n != (int)GDI_ERROR) {
+ if (n != (int) GDI_ERROR) {
if (swapped) {
SwapShort(&cmapTable.numTables);
}
@@ -2651,8 +2794,8 @@ LoadFontRanges(
segCount = subTable.segment.segCountX2 / 2;
cbData = segCount * sizeof(USHORT);
- startCount = (USHORT *) ckalloc((unsigned)cbData);
- endCount = (USHORT *) ckalloc((unsigned)cbData);
+ startCount = ckalloc(cbData);
+ endCount = ckalloc(cbData);
offset = encTable.offset + sizeof(subTable.segment);
GetFontData(hdc, cmapKey, (DWORD) offset, endCount, cbData);
@@ -2695,8 +2838,8 @@ LoadFontRanges(
segCount = 1;
cbData = segCount * sizeof(USHORT);
- startCount = (USHORT *) ckalloc((unsigned) cbData);
- endCount = (USHORT *) ckalloc((unsigned) cbData);
+ startCount = ckalloc(cbData);
+ endCount = ckalloc(cbData);
startCount[0] = 0x0000;
endCount[0] = 0x00ff;
}
@@ -2724,14 +2867,14 @@ LoadFontRanges(
*-------------------------------------------------------------------------
*/
-static void
+static inline void
SwapShort(
PUSHORT p)
{
*p = (SHORT)(HIBYTE(*p) + (LOBYTE(*p) << 8));
}
-static void
+static inline void
SwapLong(
PULONG p)
{
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index 8e6ef38..d61b84a 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -39,9 +39,9 @@ DestroyImage(
{
if (imagePtr) {
if (imagePtr->data) {
- ckfree((char*)imagePtr->data);
+ ckfree(imagePtr->data);
}
- ckfree((char*)imagePtr);
+ ckfree(imagePtr);
}
return 0;
}
@@ -211,7 +211,7 @@ XCreateImage(
int bitmap_pad,
int bytes_per_line)
{
- XImage* imagePtr = (XImage *) ckalloc(sizeof(XImage));
+ XImage* imagePtr = ckalloc(sizeof(XImage));
imagePtr->width = width;
imagePtr->height = height;
imagePtr->xoffset = offset;
@@ -301,8 +301,7 @@ XGetImageZPixmap(
BOOL ret;
if (format != ZPixmap) {
- TkpDisplayWarning(
- "XGetImageZPixmap: only ZPixmap types are implemented",
+ TkpDisplayWarning("Only ZPixmap types are implemented",
"XGetImageZPixmap Failure");
return NULL;
}
@@ -350,7 +349,7 @@ XGetImageZPixmap(
if (depth <= 8) {
size += sizeof(unsigned short) * (1 << depth);
}
- bmInfo = (BITMAPINFO *) ckalloc((unsigned)size);
+ bmInfo = ckalloc(size);
bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo->bmiHeader.biWidth = width;
@@ -368,16 +367,16 @@ XGetImageZPixmap(
unsigned char *p, *pend;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, (char *)data,
+ ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, (char *) data,
width, height, 32, (int) ((width + 31) >> 3) & ~1);
if (ret_image == NULL) {
- ckfree((char *)data);
+ ckfree(data);
goto cleanup;
}
@@ -387,8 +386,8 @@ XGetImageZPixmap(
if (GetDIBits(hdcMem, hbmp, 0, height, data, bmInfo,
DIB_PAL_COLORS) == 0) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
ret_image = NULL;
goto cleanup;
}
@@ -404,16 +403,16 @@ XGetImageZPixmap(
unsigned char *p;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, (char *)data,
+ ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, (char *) data,
width, height, 8, (int) width);
if (ret_image == NULL) {
- ckfree((char *) data);
+ ckfree(data);
goto cleanup;
}
@@ -423,8 +422,8 @@ XGetImageZPixmap(
if (GetDIBits(hdcMem, hbmp, 0, height, data, bmInfo,
DIB_PAL_COLORS) == 0) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
ret_image = NULL;
goto cleanup;
}
@@ -435,7 +434,7 @@ XGetImageZPixmap(
}
} else if (depth == 16) {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -444,7 +443,7 @@ XGetImageZPixmap(
ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, (char *) data,
width, height, 16, 0 /* will be calc'ed from bitmap_pad */);
if (ret_image == NULL) {
- ckfree((char *) data);
+ ckfree(data);
goto cleanup;
}
@@ -454,14 +453,14 @@ XGetImageZPixmap(
if (GetDIBits(hdcMem, hbmp, 0, height, ret_image->data, bmInfo,
DIB_RGB_COLORS) == 0) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
ret_image = NULL;
goto cleanup;
}
} else {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = (unsigned char *) ckalloc(width * height * 4);
+ data = ckalloc(width * height * 4);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
@@ -470,7 +469,7 @@ XGetImageZPixmap(
ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, (char *) data,
width, height, 0, (int) width * 4);
if (ret_image == NULL) {
- ckfree((char *) data);
+ ckfree(data);
goto cleanup;
}
@@ -484,10 +483,10 @@ XGetImageZPixmap(
unsigned int byte_width, h, w;
byte_width = ((width * 3 + 3) & ~(unsigned)3);
- smallBitBase = (unsigned char *) ckalloc(byte_width * height);
+ smallBitBase = ckalloc(byte_width * height);
if (!smallBitBase) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
ret_image = NULL;
goto cleanup;
}
@@ -499,9 +498,9 @@ XGetImageZPixmap(
if (GetDIBits(hdcMem, hbmp, 0, height, smallBitData, bmInfo,
DIB_RGB_COLORS) == 0) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
- ckfree((char *) smallBitBase);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
+ ckfree(smallBitBase);
ret_image = NULL;
goto cleanup;
}
@@ -511,7 +510,7 @@ XGetImageZPixmap(
*/
for (h = 0; h < height; h++) {
- bigBitData = (unsigned char *) (ret_image->data + h * ret_image->bytes_per_line);
+ bigBitData = (unsigned char *) ret_image->data + h * ret_image->bytes_per_line;
smallBitData = smallBitBase + h * byte_width;
for (w = 0; w < width; w++) {
@@ -526,7 +525,7 @@ XGetImageZPixmap(
* Free the Device contexts, and the Bitmap.
*/
- ckfree((char *) smallBitBase);
+ ckfree(smallBitBase);
} else {
/*
* Get the BITMAP info directly into the Image.
@@ -534,8 +533,8 @@ XGetImageZPixmap(
if (GetDIBits(hdcMem, hbmp, 0, height, ret_image->data, bmInfo,
DIB_RGB_COLORS) == 0) {
- ckfree((char *) ret_image->data);
- ckfree((char *) ret_image);
+ ckfree(ret_image->data);
+ ckfree(ret_image);
ret_image = NULL;
goto cleanup;
}
@@ -544,7 +543,7 @@ XGetImageZPixmap(
cleanup:
if (bmInfo) {
- ckfree((char *) bmInfo);
+ ckfree(bmInfo);
}
if (hPal) {
SelectPalette(hdcMem, hPalPrev1, FALSE);
@@ -639,7 +638,7 @@ XGetImage(
imagePtr = XGetImageZPixmap(display, d, x, y,
width, height, plane_mask, format);
} else {
- char *errMsg = NULL;
+ const char *errMsg = NULL;
char infoBuf[sizeof(BITMAPINFO) + sizeof(RGBQUAD)];
BITMAPINFO *infoPtr = (BITMAPINFO*)infoBuf;
@@ -661,8 +660,7 @@ XGetImage(
imagePtr = XCreateImage(display, NULL, 1, XYBitmap, 0, NULL,
width, height, 32, 0);
- imagePtr->data =
- ckalloc((unsigned) imagePtr->bytes_per_line*imagePtr->height);
+ imagePtr->data = ckalloc(imagePtr->bytes_per_line * imagePtr->height);
dc = GetDC(NULL);
diff --git a/win/tkWinInit.c b/win/tkWinInit.c
index 19556dd..6535dba 100644
--- a/win/tkWinInit.c
+++ b/win/tkWinInit.c
@@ -68,7 +68,7 @@ TkpGetAppName(
Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */
{
int argc, namelength;
- CONST char **argv = NULL, *name, *p;
+ const char **argv = NULL, *name, *p;
name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
namelength = -1;
@@ -90,7 +90,7 @@ TkpGetAppName(
}
Tcl_DStringAppend(namePtr, name, namelength);
if (argv != NULL) {
- ckfree((char *)argv);
+ ckfree(argv);
}
}
@@ -113,24 +113,35 @@ TkpGetAppName(
void
TkpDisplayWarning(
- CONST char *msg, /* Message to be displayed. */
- CONST char *title) /* Title of warning. */
+ const char *msg, /* Message to be displayed. */
+ const char *title) /* Title of warning. */
{
#define TK_MAX_WARN_LEN 1024
- WCHAR msgString[TK_MAX_WARN_LEN + 5];
- WCHAR titleString[TK_MAX_WARN_LEN + 1];
+ WCHAR titleString[TK_MAX_WARN_LEN];
+ WCHAR *msgString; /* points to titleString, just after title, leaving space for ": " */
+ int len; /* size of title, including terminating NULL */
- MultiByteToWideChar(CP_UTF8, 0, msg, -1, msgString, TK_MAX_WARN_LEN);
- MultiByteToWideChar(CP_UTF8, 0, title, -1, titleString, TK_MAX_WARN_LEN);
+ len = MultiByteToWideChar(CP_UTF8, 0, title, -1, titleString, TK_MAX_WARN_LEN);
+ msgString = &titleString[len + 1];
+ titleString[TK_MAX_WARN_LEN - 1] = L'\0';
+ MultiByteToWideChar(CP_UTF8, 0, msg, -1, msgString, (TK_MAX_WARN_LEN - 1) - len);
/*
* Truncate MessageBox string if it is too long to not overflow the screen
* and cause possible oversized window error.
*/
- memcpy(msgString + TK_MAX_WARN_LEN, L" ...", 5 * sizeof(WCHAR));
- titleString[TK_MAX_WARN_LEN] = L'\0';
- MessageBoxW(NULL, msgString, titleString,
- MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
- | MB_SETFOREGROUND | MB_TOPMOST);
+ if (titleString[TK_MAX_WARN_LEN - 1] != L'\0') {
+ memcpy(titleString + (TK_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR));
+ }
+ if (IsDebuggerPresent()) {
+ titleString[len - 1] = L':';
+ titleString[len] = L' ';
+ OutputDebugStringW(titleString);
+ } else {
+ titleString[len - 1] = L'\0';
+ MessageBoxW(NULL, msgString, titleString,
+ MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
+ | MB_SETFOREGROUND | MB_TOPMOST);
+ }
}
/*
diff --git a/win/tkWinInt.h b/win/tkWinInt.h
index 5616e20..cd4094d 100644
--- a/win/tkWinInt.h
+++ b/win/tkWinInt.h
@@ -26,10 +26,6 @@
#include "tkWin.h"
#endif
-#ifndef _TKPORT
-#include "tkPort.h"
-#endif
-
/*
* Define constants missing from older Win32 SDK header files.
*/
@@ -121,8 +117,8 @@ typedef struct {
* The following macros define the class names for Tk Window types.
*/
-#define TK_WIN_TOPLEVEL_CLASS_NAME "TkTopLevel"
-#define TK_WIN_CHILD_CLASS_NAME "TkChild"
+#define TK_WIN_TOPLEVEL_CLASS_NAME TEXT("TkTopLevel")
+#define TK_WIN_CHILD_CLASS_NAME TEXT("TkChild")
/*
* The following variable is a translation table between X gc functions and
@@ -146,70 +142,33 @@ MODULE_SCOPE int tkpWinBltModes[];
#include "tkIntPlatDecls.h"
-#ifdef BUILD_tk
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-#endif
-
/*
* Special proc needed as tsd accessor function between
* tkWinX.c:GenerateXEvent and tkWinClipboard.c:UpdateClipboard
*/
-EXTERN void TkWinUpdatingClipboard(int mode);
+MODULE_SCOPE void TkWinUpdatingClipboard(int mode);
/*
* Used by tkWinDialog.c to associate the right icon with tk_messageBox
*/
-EXTERN HICON TkWinGetIcon(Tk_Window tkw, DWORD iconsize);
+MODULE_SCOPE HICON TkWinGetIcon(Tk_Window tkw, DWORD iconsize);
/*
* Used by tkWinX.c on for certain system display change messages and cleanup
* up containers
*/
-EXTERN void TkWinDisplayChanged(Display *display);
+MODULE_SCOPE void TkWinDisplayChanged(Display *display);
MODULE_SCOPE void TkWinCleanupContainerList(void);
/*
* Used by tkWinWm.c for embedded menu handling. May become public.
*/
-EXTERN HWND Tk_GetMenuHWND(Tk_Window tkwin);
-EXTERN HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin);
-
-/*
- * 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);
- BOOL (WINAPI *insertMenu)(HMENU hMenu, UINT uPosition, UINT uFlags,
- UINT uIDNewItem, LPCTSTR lpNewItem);
- int (WINAPI *getWindowText)(HWND hWnd, LPCTSTR lpString, int nMaxCount);
-} TkWinProcs;
-
-EXTERN TkWinProcs *tkWinProcs;
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
+MODULE_SCOPE HWND Tk_GetMenuHWND(Tk_Window tkwin);
+MODULE_SCOPE HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin);
/*
* The following allows us to cache these encoding for multiple functions.
@@ -231,15 +190,15 @@ MODULE_SCOPE void TkWinSetupSystemFonts(TkMainInfo *mainPtr);
* The following is implemented in tkWinWm and used by tkWinEmbed.c
*/
-void TkpWinToplevelWithDraw(TkWindow *winPtr);
-void TkpWinToplevelIconify(TkWindow *winPtr);
-void TkpWinToplevelDeiconify(TkWindow *winPtr);
-long TkpWinToplevelIsControlledByWm(TkWindow *winPtr);
-long TkpWinToplevelMove(TkWindow *winPtr, int x, int y);
-long TkpWinToplevelOverrideRedirect(TkWindow *winPtr,
+MODULE_SCOPE void TkpWinToplevelWithDraw(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelIconify(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelDeiconify(TkWindow *winPtr);
+MODULE_SCOPE long TkpWinToplevelIsControlledByWm(TkWindow *winPtr);
+MODULE_SCOPE long TkpWinToplevelMove(TkWindow *winPtr, int x, int y);
+MODULE_SCOPE long TkpWinToplevelOverrideRedirect(TkWindow *winPtr,
int reqValue);
-void TkpWinToplevelDetachWindow(TkWindow *winPtr);
-int TkpWmGetState(TkWindow *winPtr);
+MODULE_SCOPE void TkpWinToplevelDetachWindow(TkWindow *winPtr);
+MODULE_SCOPE int TkpWmGetState(TkWindow *winPtr);
/*
* The following functions are not present in old versions of Windows
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 522bfba..8e66171 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -23,7 +23,7 @@
#define MAX_KEYCODE 145 /* VK_SCROLL is the last entry in our table below */
-static KeySym keymap[] = {
+static const KeySym keymap[] = {
NoSymbol, NoSymbol, NoSymbol, XK_Cancel, NoSymbol,
NoSymbol, NoSymbol, NoSymbol, XK_BackSpace, XK_Tab,
NoSymbol, NoSymbol, XK_Clear, XK_Return, NoSymbol,
@@ -79,7 +79,7 @@ static KeySym KeycodeToKeysym(unsigned int keycode,
*----------------------------------------------------------------------
*/
-char *
+const char *
TkpGetString(
TkWindow *winPtr, /* Window where event occurred: needed to get
* input context. */
@@ -502,12 +502,11 @@ TkpInitKeymapInfo(
*/
if (dispPtr->modKeyCodes != NULL) {
- ckfree((char *) dispPtr->modKeyCodes);
+ ckfree(dispPtr->modKeyCodes);
}
dispPtr->numModKeyCodes = 0;
arraySize = KEYCODE_ARRAY_SIZE;
- dispPtr->modKeyCodes = (KeyCode *) ckalloc((unsigned)
- (KEYCODE_ARRAY_SIZE * sizeof(KeyCode)));
+ dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode));
for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
if (*codePtr == 0) {
continue;
@@ -530,11 +529,10 @@ TkpInitKeymapInfo(
*/
arraySize *= 2;
- new = (KeyCode *) ckalloc((unsigned)
- (arraySize * sizeof(KeyCode)));
- memcpy((void *) new, (void *) dispPtr->modKeyCodes,
- (dispPtr->numModKeyCodes * sizeof(KeyCode)));
- ckfree((char *) dispPtr->modKeyCodes);
+ new = ckalloc(arraySize * sizeof(KeyCode));
+ memcpy(new, dispPtr->modKeyCodes,
+ dispPtr->numModKeyCodes * sizeof(KeyCode));
+ ckfree(dispPtr->modKeyCodes);
dispPtr->modKeyCodes = new;
}
dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr;
@@ -660,11 +658,10 @@ XModifierKeymap *
XGetModifierMapping(
Display *display)
{
- XModifierKeymap *map = (XModifierKeymap *)
- ckalloc(sizeof(XModifierKeymap));
+ XModifierKeymap *map = ckalloc(sizeof(XModifierKeymap));
map->max_keypermod = 1;
- map->modifiermap = (KeyCode *) ckalloc(sizeof(KeyCode)*8);
+ map->modifiermap = ckalloc(sizeof(KeyCode) * 8);
map->modifiermap[ShiftMapIndex] = VK_SHIFT;
map->modifiermap[LockMapIndex] = VK_CAPITAL;
map->modifiermap[ControlMapIndex] = VK_CONTROL;
@@ -696,8 +693,8 @@ void
XFreeModifiermap(
XModifierKeymap *modmap)
{
- ckfree((char *) modmap->modifiermap);
- ckfree((char *) modmap);
+ ckfree(modmap->modifiermap);
+ ckfree(modmap);
}
/*
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 5ad29e1..79642f5 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -11,20 +11,16 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#define WINVER 0x0500 /* Requires Windows 2K definitions */
-#define _WIN32_WINNT 0x0500
#define OEMRESOURCE
#include "tkWinInt.h"
#include "tkMenu.h"
-#include <string.h>
-
/*
* The class of the window for popup menus.
*/
-#define MENU_CLASS_NAME "MenuWindowClass"
-#define EMBEDDED_MENU_CLASS_NAME "EmbeddedMenuWindowClass"
+#define MENU_CLASS_NAME TEXT("MenuWindowClass")
+#define EMBEDDED_MENU_CLASS_NAME TEXT("EmbeddedMenuWindowClass")
/*
* Used to align a windows bitmap inside a rectangle
@@ -159,7 +155,7 @@ static void DrawWindowsSystemBitmap(Display *display,
Drawable drawable, GC gc, const RECT *rectPtr,
int bitmapID, int alignFlags);
static void FreeID(WORD commandID);
-static TCHAR * GetEntryText(TkMenuEntry *mePtr);
+static char * GetEntryText(TkMenuEntry *mePtr);
static void GetMenuAccelGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
const Tk_FontMetrics *fmPtr, int *widthPtr,
@@ -233,7 +229,7 @@ GetNewID(
commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable,
((char *) NULL) + curID, &newEntry);
if (newEntry == 1) {
- Tcl_SetHashValue(commandEntryPtr, (char *) mePtr);
+ Tcl_SetHashValue(commandEntryPtr, mePtr);
*menuIDPtr = curID;
tsdPtr->lastCommandID = curID;
return TCL_OK;
@@ -323,7 +319,7 @@ TkpNewMenu(
hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->winMenuTable,
(char *) winMenuHdl, &newEntry);
- Tcl_SetHashValue(hashEntryPtr, (char *) menuPtr);
+ Tcl_SetHashValue(hashEntryPtr, menuPtr);
menuPtr->platformData = (TkMenuPlatformData) winMenuHdl;
return TCL_OK;
@@ -350,7 +346,7 @@ TkpDestroyMenu(
TkMenu *menuPtr) /* The common menu structure */
{
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
- char *searchName;
+ const char *searchName;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -483,9 +479,9 @@ GetEntryText(
strcpy(itemText, "( )");
} else {
int i;
- char *label = (mePtr->labelPtr == NULL) ? ""
+ const char *label = (mePtr->labelPtr == NULL) ? ""
: Tcl_GetString(mePtr->labelPtr);
- char *accel = (mePtr->accelPtr == NULL) ? ""
+ const char *accel = (mePtr->accelPtr == NULL) ? ""
: Tcl_GetString(mePtr->accelPtr);
const char *p, *next;
Tcl_DString itemString;
@@ -519,7 +515,7 @@ GetEntryText(
}
}
- itemText = ckalloc((unsigned)Tcl_DStringLength(&itemString) + 1);
+ itemText = ckalloc(Tcl_DStringLength(&itemString) + 1);
strcpy(itemText, Tcl_DStringValue(&itemString));
Tcl_DStringFree(&itemString);
}
@@ -550,7 +546,7 @@ ReconfigureWindowsMenu(
TkMenu *menuPtr = (TkMenu *) clientData;
TkMenuEntry *mePtr;
HMENU winMenuHdl = (HMENU) menuPtr->platformData;
- TCHAR *itemText = NULL;
+ char *itemText = NULL;
const TCHAR *lpNewItem;
UINT flags;
UINT itemID;
@@ -588,7 +584,7 @@ ReconfigureWindowsMenu(
if ((menuPtr->menuType == MENUBAR)
|| (menuPtr->menuFlags & MENU_SYSTEM_MENU)) {
Tcl_WinUtfToTChar(itemText, -1, &translatedText);
- lpNewItem = Tcl_DStringValue(&translatedText);
+ lpNewItem = (const TCHAR *) Tcl_DStringValue(&translatedText);
flags |= MF_STRING;
} else {
lpNewItem = (LPCTSTR) mePtr;
@@ -700,8 +696,7 @@ ReconfigureWindowsMenu(
}
}
if (!systemMenu) {
- (*tkWinProcs->insertMenu)(winMenuHdl, 0xFFFFFFFF, flags,
- itemID, lpNewItem);
+ InsertMenu(winMenuHdl, 0xFFFFFFFF, flags, itemID, lpNewItem);
}
Tcl_DStringFree(&translatedText);
if (itemText != NULL) {
@@ -713,8 +708,8 @@ ReconfigureWindowsMenu(
if ((menuPtr->menuType == MENUBAR)
&& (menuPtr->parentTopLevelPtr != NULL)) {
- HANDLE bar;
- bar = TkWinGetWrapperWindow(menuPtr->parentTopLevelPtr);
+ HANDLE bar = TkWinGetWrapperWindow(menuPtr->parentTopLevelPtr);
+
if (bar) {
DrawMenuBar(bar);
}
@@ -893,7 +888,7 @@ TkWinMenuProc(
LRESULT lResult;
if (!TkWinHandleMenuEvent(&hwnd, &message, &wParam, &lParam, &lResult)) {
- lResult = DefWindowProc(hwnd, message, wParam, lParam);
+ lResult = DefWindowProcA(hwnd, message, wParam, lParam);
}
return lResult;
}
@@ -991,7 +986,7 @@ TkWinEmbeddedMenuProc(
}
default:
- lResult = DefWindowProc(hwnd, message, wParam, lParam);
+ lResult = DefWindowProcA(hwnd, message, wParam, lParam);
break;
}
return lResult;
@@ -1070,7 +1065,7 @@ TkWinHandleMenuEvent(
if ((code != TCL_OK) && (code != TCL_CONTINUE)
&& (code != TCL_BREAK)) {
Tcl_AddErrorInfo(interp, "\n (menu preprocess)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
Tcl_Release((ClientData)interp);
}
@@ -1111,7 +1106,7 @@ TkWinHandleMenuEvent(
if ((menuRefPtr != NULL) && (menuRefPtr->parentEntryPtr != NULL)) {
for (parentEntryPtr = menuRefPtr->parentEntryPtr ; ;
parentEntryPtr = parentEntryPtr->nextCascadePtr) {
- char *name = Tcl_GetString(parentEntryPtr->namePtr);
+ const char *name = Tcl_GetString(parentEntryPtr->namePtr);
if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) {
break;
@@ -1129,7 +1124,7 @@ TkWinHandleMenuEvent(
code = TkInvokeMenu(interp, menuPtr, mePtr->index);
if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (menu invoke)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
Tcl_Release((ClientData)interp);
*plResult = 0;
@@ -1212,7 +1207,7 @@ TkWinHandleMenuEvent(
}
mePtr = (TkMenuEntry *) itemPtr->itemData;
menuPtr = mePtr->menuPtr;
- twdPtr = (TkWinDrawable *) ckalloc(sizeof(TkWinDrawable));
+ twdPtr = ckalloc(sizeof(TkWinDrawable));
twdPtr->type = TWD_WINDC;
twdPtr->winDC.hdc = itemPtr->hDC;
@@ -1255,7 +1250,7 @@ TkWinHandleMenuEvent(
itemPtr->rcItem.bottom - itemPtr->rcItem.top,
0, drawingParameters);
- ckfree((char *) twdPtr);
+ ckfree(twdPtr);
}
*plResult = 1;
returnResult = 1;
@@ -1303,7 +1298,7 @@ TkWinHandleMenuEvent(
TkActivateMenuEntry(menuPtr, -1);
} else {
if (mePtr->index >= menuPtr->numEntries) {
- Tcl_Panic("Trying to activate an entry which doesn't exist.");
+ Tcl_Panic("Trying to activate an entry which doesn't exist");
}
TkActivateMenuEntry(menuPtr, mePtr->index);
}
@@ -1398,7 +1393,7 @@ TkpSetWindowMenuBar(
winMenuHdl = CreateMenu();
hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->winMenuTable,
(char *) winMenuHdl, &newEntry);
- Tcl_SetHashValue(hashEntryPtr, (char *) menuPtr);
+ Tcl_SetHashValue(hashEntryPtr, menuPtr);
menuPtr->platformData = (TkMenuPlatformData) winMenuHdl;
TkWinSetMenu(tkwin, winMenuHdl);
if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
@@ -1431,7 +1426,7 @@ 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
+ const char *menuName) /* The name of the menu to put in front. If
* NULL, use the default menu bar. */
{
/*
@@ -1507,7 +1502,7 @@ GetMenuAccelGeometry(
} else if (mePtr->accelPtr == NULL) {
*widthPtr = 0;
} else {
- char *accel = Tcl_GetString(mePtr->accelPtr);
+ const char *accel = Tcl_GetString(mePtr->accelPtr);
*widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
}
@@ -1622,7 +1617,7 @@ DrawWindowsSystemBitmap(
SelectObject(scratchDC, bitmap);
SetMapMode(scratchDC, GetMapMode(hdc));
- GetObject(bitmap, sizeof(BITMAP), &bm);
+ GetObjectA(bitmap, sizeof(BITMAP), &bm);
ptSize.x = bm.bmWidth;
ptSize.y = bm.bmHeight;
DPtoLP(scratchDC, &ptSize, 1);
@@ -1763,7 +1758,7 @@ DrawMenuEntryAccelerator(
{
int baseline;
int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth;
- char *accel;
+ const char *accel;
if (mePtr->accelPtr != NULL) {
accel = Tcl_GetString(mePtr->accelPtr);
@@ -2022,33 +2017,33 @@ TkWinMenuKeyObjCmd(
if (eventPtr->type == KeyPress) {
switch (keySym) {
case XK_Alt_L:
- scanCode = MapVirtualKey(VK_LMENU, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_LMENU, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYDOWN, VK_MENU,
(int) (scanCode << 16) | (1 << 29));
break;
case XK_Alt_R:
- scanCode = MapVirtualKey(VK_RMENU, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_RMENU, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYDOWN, VK_MENU,
(int) (scanCode << 16) | (1 << 29) | (1 << 24));
break;
case XK_F10:
- scanCode = MapVirtualKey(VK_F10, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_F10, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYDOWN, VK_F10, (int) (scanCode << 16));
break;
default:
virtualKey = XKeysymToKeycode(winPtr->display, keySym);
- scanCode = MapVirtualKey(virtualKey, 0);
+ scanCode = MapVirtualKeyA(virtualKey, 0);
if (0 != scanCode) {
XKeyEvent xkey = eventPtr->xkey;
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYDOWN, virtualKey,
(int) ((scanCode << 16) | (1 << 29)));
if (xkey.nbytes > 0) {
for (i = 0; i < xkey.nbytes; i++) {
- CallWindowProc(DefWindowProc,
+ CallWindowProcA(DefWindowProcA,
Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR,
xkey.trans_chars[i],
(int) ((scanCode << 16) | (1 << 29)));
@@ -2059,28 +2054,28 @@ TkWinMenuKeyObjCmd(
} else if (eventPtr->type == KeyRelease) {
switch (keySym) {
case XK_Alt_L:
- scanCode = MapVirtualKey(VK_LMENU, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_LMENU, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16)
| (1 << 29) | (1 << 30) | (1 << 31));
break;
case XK_Alt_R:
- scanCode = MapVirtualKey(VK_RMENU, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_RMENU, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 24)
| (0x111 << 29) | (1 << 30) | (1 << 31));
break;
case XK_F10:
- scanCode = MapVirtualKey(VK_F10, 0);
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ scanCode = MapVirtualKeyA(VK_F10, 0);
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYUP, VK_F10,
(int) (scanCode << 16) | (1 << 30) | (1 << 31));
break;
default:
virtualKey = XKeysymToKeycode(winPtr->display, keySym);
- scanCode = MapVirtualKey(virtualKey, 0);
+ scanCode = MapVirtualKeyA(virtualKey, 0);
if (0 != scanCode) {
- CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)),
+ CallWindowProcA(DefWindowProcA, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYUP, virtualKey, (int) ((scanCode << 16)
| (1 << 29) | (1 << 30) | (1 << 31)));
}
@@ -2211,7 +2206,7 @@ DrawMenuEntryLabel(
}
if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
if (mePtr->labelLength > 0) {
- char *label = Tcl_GetString(mePtr->labelPtr);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
textHeight = fmPtr->linespace;
@@ -2306,7 +2301,7 @@ DrawMenuEntryLabel(
if ((mePtr->compound != COMPOUND_NONE) || !haveImage) {
if (mePtr->labelLength > 0) {
int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
- char *label = Tcl_GetString(mePtr->labelPtr);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
if (TkWinGetPlatformTheme() == TK_THEME_WIN_CLASSIC) {
/*
@@ -2542,7 +2537,7 @@ TkpDrawMenuEntry(
} else {
TkMenuEntry *cascadeEntryPtr;
int parentDisabled = 0;
- char *name;
+ const char *name;
for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr;
cascadeEntryPtr != NULL;
@@ -2688,7 +2683,7 @@ GetMenuLabelGeometry(
if (mePtr->labelPtr != NULL) {
int textWidth;
- char *label = Tcl_GetString(mePtr->labelPtr);
+ const char *label = Tcl_GetString(mePtr->labelPtr);
textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
@@ -3018,7 +3013,7 @@ MenuSelectEvent(
void
TkpMenuNotifyToplevelCreate(
Tcl_Interp *interp, /* The interp the menu lives in. */
- char *menuName) /* The name of the menu to reconfigure. */
+ const char *menuName) /* The name of the menu to reconfigure. */
{
TkMenuReferences *menuRefPtr;
TkMenu *menuPtr;
@@ -3189,7 +3184,7 @@ SetDefaults(
HDC scratchDC;
int bold = 0;
int italic = 0;
- TEXTMETRIC tm;
+ TEXTMETRICA tm;
int pointSize;
HFONT menuFont;
/* See: [Bug #3239768] tk8.4.19 (and later) WIN32 menu font support */
@@ -3211,7 +3206,7 @@ SetDefaults(
defaultBorderWidth = GetSystemMetrics(SM_CYBORDER);
}
- scratchDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ scratchDC = CreateDCA("DISPLAY", NULL, NULL, NULL);
if (!firstTime) {
Tcl_DStringFree(&menuFontDString);
}
@@ -3229,8 +3224,8 @@ SetDefaults(
&nc.metrics, 0);
menuFont = CreateFontIndirect(&nc.metrics.lfMenuFont);
SelectObject(scratchDC, menuFont);
- GetTextMetrics(scratchDC, &tm);
- GetTextFace(scratchDC, LF_FACESIZE, faceName);
+ GetTextMetricsA(scratchDC, &tm);
+ GetTextFaceA(scratchDC, LF_FACESIZE, faceName);
pointSize = MulDiv(tm.tmHeight - tm.tmInternalLeading,
72, GetDeviceCaps(scratchDC, LOGPIXELSY));
if (tm.tmWeight >= 700) {
@@ -3273,17 +3268,11 @@ SetDefaults(
* only way to ensure menu items line up, and is not documented.
*/
- if (TkWinGetPlatformId() >= VER_PLATFORM_WIN32_WINDOWS) {
- indicatorDimensions[0] = GetSystemMetrics(SM_CYMENUCHECK);
- indicatorDimensions[1] = ((GetSystemMetrics(SM_CXFIXEDFRAME) +
- GetSystemMetrics(SM_CXBORDER)
- + GetSystemMetrics(SM_CXMENUCHECK) + 7) & 0xFFF8)
- - GetSystemMetrics(SM_CXFIXEDFRAME);
- } else {
- DWORD dimensions = GetMenuCheckMarkDimensions();
- indicatorDimensions[0] = HIWORD(dimensions);
- indicatorDimensions[1] = LOWORD(dimensions);
- }
+ indicatorDimensions[0] = GetSystemMetrics(SM_CYMENUCHECK);
+ indicatorDimensions[1] = ((GetSystemMetrics(SM_CXFIXEDFRAME) +
+ GetSystemMetrics(SM_CXBORDER)
+ + GetSystemMetrics(SM_CXMENUCHECK) + 7) & 0xFFF8)
+ - GetSystemMetrics(SM_CXFIXEDFRAME);
/*
* Accelerators used to be always underlines until Win2K when a system
@@ -3292,7 +3281,7 @@ SetDefaults(
showMenuAccelerators = TRUE;
if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0);
+ SystemParametersInfoA(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0);
}
}
@@ -3328,13 +3317,13 @@ TkpMenuInit(void)
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = MENU_CLASS_NAME;
if (!RegisterClass(&wndClass)) {
- Tcl_Panic("Failed to register menu window class.");
+ Tcl_Panic("Failed to register menu window class");
}
wndClass.lpfnWndProc = TkWinEmbeddedMenuProc;
wndClass.lpszClassName = EMBEDDED_MENU_CLASS_NAME;
if (!RegisterClass(&wndClass)) {
- Tcl_Panic("Failed to register embedded menu window class.");
+ Tcl_Panic("Failed to register embedded menu window class");
}
TkCreateExitHandler(MenuExitHandler, (ClientData) NULL);
@@ -3364,19 +3353,19 @@ TkpMenuThreadInit(void)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- tsdPtr->menuHWND = CreateWindow(MENU_CLASS_NAME, "MenuWindow", WS_POPUP,
+ tsdPtr->menuHWND = CreateWindow(MENU_CLASS_NAME, TEXT("MenuWindow"), WS_POPUP,
0, 0, 10, 10, NULL, NULL, Tk_GetHINSTANCE(), NULL);
if (!tsdPtr->menuHWND) {
- Tcl_Panic("Failed to create the menu window.");
+ Tcl_Panic("Failed to create the menu window");
}
tsdPtr->embeddedMenuHWND =
- CreateWindow(EMBEDDED_MENU_CLASS_NAME, "EmbeddedMenuWindow",
+ CreateWindow(EMBEDDED_MENU_CLASS_NAME, TEXT("EmbeddedMenuWindow"),
WS_POPUP, 0, 0, 10, 10, NULL, NULL, Tk_GetHINSTANCE(), NULL);
if (!tsdPtr->embeddedMenuHWND) {
- Tcl_Panic("Failed to create the embedded menu window.");
+ Tcl_Panic("Failed to create the embedded menu window");
}
Tcl_InitHashTable(&tsdPtr->winMenuTable, TCL_ONE_WORD_KEYS);
diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c
index 51f0f59..1cf0634 100644
--- a/win/tkWinPixmap.c
+++ b/win/tkWinPixmap.c
@@ -42,7 +42,7 @@ Tk_GetPixmap(
display->request++;
- newTwdPtr = (TkWinDrawable*) ckalloc(sizeof(TkWinDrawable));
+ newTwdPtr = ckalloc(sizeof(TkWinDrawable));
newTwdPtr->type = TWD_BITMAP;
newTwdPtr->bitmap.depth = depth;
twdPtr = (TkWinDrawable *) d;
@@ -100,12 +100,12 @@ Tk_GetPixmap(
LPVOID lpMsgBuf;
repeatError = 1;
- if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf, 0, NULL)) {
- MessageBox(NULL, (LPCTSTR) lpMsgBuf,
+ (LPSTR) &lpMsgBuf, 0, NULL)) {
+ MessageBoxA(NULL, (LPCSTR) lpMsgBuf,
"Tk_GetPixmap: Error from CreateDIBSection",
MB_OK | MB_ICONINFORMATION);
LocalFree(lpMsgBuf);
@@ -114,7 +114,7 @@ Tk_GetPixmap(
}
if (newTwdPtr->bitmap.handle == NULL) {
- ckfree((char *) newTwdPtr);
+ ckfree(newTwdPtr);
return None;
}
@@ -147,7 +147,7 @@ Tk_FreePixmap(
display->request++;
if (twdPtr != NULL) {
DeleteObject(twdPtr->bitmap.handle);
- ckfree((char *) twdPtr);
+ ckfree(twdPtr);
}
}
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index d29e952..c3b3d3c 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -360,6 +360,20 @@ XWarpPointer(
GetWindowRect(Tk_GetHWND(dest_w), &r);
SetCursorPos(r.left+dest_x, r.top+dest_y);
}
+
+void
+TkpWarpPointer(
+ TkDisplay *dispPtr)
+{
+ if (dispPtr->warpWindow) {
+ RECT r;
+
+ GetWindowRect(Tk_GetHWND(Tk_WindowId(dispPtr->warpWindow)), &r);
+ SetCursorPos(r.left + dispPtr->warpX, r.top + dispPtr->warpY);
+ } else {
+ SetCursorPos(dispPtr->warpX, dispPtr->warpY);
+ }
+}
/*
*----------------------------------------------------------------------
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 9deefce..e5ed7de 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -14,21 +14,23 @@
#ifndef _WINPORT
#define _WINPORT
-#include <X11/Xlib.h>
-#include <X11/cursorfont.h>
-#include <X11/keysym.h>
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
+/*
+ *---------------------------------------------------------------------------
+ * The following sets of #includes and #ifdefs are required to get Tcl to
+ * compile under the windows compilers.
+ *---------------------------------------------------------------------------
+ */
-#include <malloc.h>
+#include <wchar.h>
+#include <io.h>
+#include <stdlib.h>
#include <errno.h>
+#include <fcntl.h>
+#include <malloc.h>
#include <ctype.h>
#include <math.h>
-#include <stdlib.h>
#include <string.h>
#include <limits.h>
-#include <fcntl.h>
-#include <io.h>
/*
* Need to block out this include for building extensions with MetroWerks
@@ -50,19 +52,23 @@
/*
* Pull in the typedef of TCHAR for windows.
*/
-#if !defined(_TCHAR_DEFINED)
-# include <tchar.h>
-# ifndef _TCHAR_DEFINED
- /* Borland seems to forget to set this. */
- typedef _TCHAR TCHAR;
-# define _TCHAR_DEFINED
-# endif
-# if defined(_MSC_VER) && defined(__STDC__)
- /* VS2005 SP1 misses this. See [Bug #3110161] */
- typedef _TCHAR TCHAR;
-# endif
+#include <tchar.h>
+#ifndef _TCHAR_DEFINED
+ /* Borland seems to forget to set this. */
+ typedef _TCHAR TCHAR;
+# define _TCHAR_DEFINED
+#endif
+#if defined(_MSC_VER) && defined(__STDC__)
+ /* VS2005 SP1 misses this. See [Bug #3110161] */
+ typedef _TCHAR TCHAR;
#endif
+#include <X11/Xlib.h>
+#include <X11/cursorfont.h>
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
#ifdef __CYGWIN__
# ifndef _vsnprintf
# define _vsnprintf vsnprintf
@@ -107,8 +113,6 @@
* under Windows.
*/
-#define TkFreeWindowId(dispPtr,w)
-#define TkInitXId(dispPtr)
#define TkpCmapStressed(tkwin,colormap) (0)
#define XFlush(display)
#define XGrabServer(display)
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index 5032912..1fd5e13 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -52,27 +52,17 @@ typedef struct WinScrollbar {
static int initialized = 0;
static int hArrowWidth, hThumb; /* Horizontal control metrics. */
-static int vArrowWidth, vArrowHeight, vThumb; /* Vertical control metrics. */
+static int vArrowHeight, vThumb; /* Vertical control metrics. */
TCL_DECLARE_MUTEX(winScrlbrMutex)
/*
- * This variable holds the default width for a scrollbar in string form for
- * use in a Tk_ConfigSpec.
- */
-
-static char defWidth[TCL_INTEGER_SPACE];
-
-/*
* Declarations for functions defined in this file.
*/
static Window CreateProc(Tk_Window tkwin, Window parent,
ClientData instanceData);
-static void ModalLoopProc(Tk_Window tkwin, XEvent *eventPtr);
-static int ScrollbarBindProc(ClientData clientData,
- Tcl_Interp *interp, XEvent *eventPtr,
- Tk_Window tkwin, KeySym keySym);
+static void ModalLoop(WinScrollbar *, XEvent *eventPtr);
static LRESULT CALLBACK ScrollbarProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam);
static void UpdateScrollbar(WinScrollbar *scrollPtr);
@@ -82,13 +72,25 @@ static void UpdateScrollbarMetrics(void);
* The class procedure table for the scrollbar widget.
*/
-Tk_ClassProcs tkpScrollbarProcs = {
+const Tk_ClassProcs tkpScrollbarProcs = {
sizeof(Tk_ClassProcs), /* size */
NULL, /* worldChangedProc */
CreateProc, /* createProc */
- ModalLoopProc, /* modalProc */
+ NULL /* modalProc */
};
+static void
+WinScrollbarEventProc(ClientData clientData, XEvent *eventPtr)
+{
+ WinScrollbar *scrollPtr = clientData;
+
+ if (eventPtr->type == ButtonPress) {
+ ModalLoop(scrollPtr, eventPtr);
+ } else {
+ TkScrollbarEventProc(clientData, eventPtr);
+ }
+}
+
/*
*----------------------------------------------------------------------
@@ -111,7 +113,6 @@ TkpCreateScrollbar(
Tk_Window tkwin)
{
WinScrollbar *scrollPtr;
- TkWindow *winPtr = (TkWindow *)tkwin;
if (!initialized) {
Tcl_MutexLock(&winScrlbrMutex);
@@ -120,22 +121,13 @@ TkpCreateScrollbar(
Tcl_MutexUnlock(&winScrlbrMutex);
}
- scrollPtr = (WinScrollbar *) ckalloc(sizeof(WinScrollbar));
+ scrollPtr = ckalloc(sizeof(WinScrollbar));
scrollPtr->winFlags = 0;
scrollPtr->hwnd = NULL;
Tk_CreateEventHandler(tkwin,
- ExposureMask|StructureNotifyMask|FocusChangeMask,
- TkScrollbarEventProc, (ClientData) scrollPtr);
-
- 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);
- }
+ ExposureMask|StructureNotifyMask|FocusChangeMask|ButtonPressMask,
+ WinScrollbarEventProc, scrollPtr);
return (TkScrollbar *) scrollPtr;
}
@@ -231,7 +223,7 @@ CreateProc(
| SBS_HORZ | SBS_BOTTOMALIGN;
}
- scrollPtr->hwnd = CreateWindow("SCROLLBAR", NULL, style,
+ scrollPtr->hwnd = CreateWindow(TEXT("SCROLLBAR"), NULL, style,
Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),
parent, NULL, Tk_GetHINSTANCE(), NULL);
@@ -254,7 +246,7 @@ CreateProc(
scrollPtr->lastVertical = scrollPtr->info.vertical;
scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd,
- GWLP_WNDPROC, (INT_PTR) ScrollbarProc);
+ GWLP_WNDPROC, (LONG_PTR) ScrollbarProc);
window = Tk_AttachHWND(tkwin, scrollPtr->hwnd);
UpdateScrollbar(scrollPtr);
@@ -299,7 +291,7 @@ TkpDisplayScrollbar(
if (scrollPtr->lastVertical != scrollPtr->info.vertical) {
HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin));
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) scrollPtr->oldProc);
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc);
DestroyWindow(hwnd);
CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)),
@@ -361,21 +353,14 @@ TkpDestroyScrollbar(
void
UpdateScrollbarMetrics(void)
{
- Tk_ConfigSpec *specPtr;
+ int arrowWidth = GetSystemMetrics(SM_CXVSCROLL);
hArrowWidth = GetSystemMetrics(SM_CXHSCROLL);
hThumb = GetSystemMetrics(SM_CXHTHUMB);
- vArrowWidth = GetSystemMetrics(SM_CXVSCROLL);
vArrowHeight = GetSystemMetrics(SM_CYVSCROLL);
vThumb = GetSystemMetrics(SM_CYVTHUMB);
- sprintf(defWidth, "%d", vArrowWidth);
- for (specPtr = tkpScrollbarConfigSpecs; specPtr->type != TK_CONFIG_END;
- specPtr++) {
- if (specPtr->offset == Tk_Offset(TkScrollbar, width)) {
- specPtr->defValue = defWidth;
- }
- }
+ sprintf(tkDefScrollbarWidth, "%d", arrowWidth);
}
/*
@@ -570,7 +555,7 @@ ScrollbarProc(
code = Tcl_GlobalEval(interp, cmdString.string);
if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (scrollbar command)");
- Tcl_BackgroundError(interp);
+ Tcl_BackgroundException(interp, code);
}
Tcl_DStringFree(&cmdString);
@@ -613,66 +598,26 @@ TkpConfigureScrollbar(
}
/*
- *--------------------------------------------------------------
- *
- * 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,
- Tcl_Interp *interp,
- XEvent *eventPtr,
- Tk_Window tkwin,
- KeySym keySym)
-{
- TkWindow *winPtr = (TkWindow *) tkwin;
-
- if (eventPtr->type == ButtonPress) {
- winPtr->flags |= TK_DEFER_MODAL;
- }
- return TCL_OK;
-}
-
-/*
*----------------------------------------------------------------------
*
- * ModalLoopProc --
- *
- * This function is invoked at the end of the event processing whenever
- * the ScrollbarBindProc has been invoked for a ButtonPress event.
+ * ModalLoop --
*
- * Results:
- * None.
- *
- * Side effects:
- * Enters a modal loop.
+ * This function is invoked in response to a ButtonPress event.
+ * It resends the event to the Scrollbar window procedure,
+ * which in turn enters a modal loop.
*
*----------------------------------------------------------------------
*/
static void
-ModalLoopProc(
- Tk_Window tkwin,
+ModalLoop(
+ WinScrollbar *scrollPtr,
XEvent *eventPtr)
{
- TkWindow *winPtr = (TkWindow *) tkwin;
- WinScrollbar *scrollPtr = (WinScrollbar *) winPtr->instanceData;
int oldMode;
if (scrollPtr->hwnd) {
- Tcl_Preserve(scrollPtr);
+ Tcl_Preserve((ClientData)scrollPtr);
scrollPtr->winFlags |= IN_MODAL_LOOP;
oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
TkWinResendEvent(scrollPtr->oldProc, scrollPtr->hwnd, eventPtr);
@@ -681,7 +626,7 @@ ModalLoopProc(
if (scrollPtr->hwnd && scrollPtr->winFlags & ALREADY_DEAD) {
DestroyWindow(scrollPtr->hwnd);
}
- Tcl_Release(scrollPtr);
+ Tcl_Release((ClientData)scrollPtr);
}
}
diff --git a/win/tkWinSend.c b/win/tkWinSend.c
index 4b25963..b3edc62 100644
--- a/win/tkWinSend.c
+++ b/win/tkWinSend.c
@@ -14,10 +14,6 @@
#include "tkInt.h"
#include "tkWinSendCom.h"
-#ifdef _MSC_VER
-#define vsnprintf _vsnprintf
-#endif
-
/*
* Should be defined in WTypes.h but mingw 1.0 is missing them.
*/
@@ -169,7 +165,7 @@ Tk_SetAppName(
if (riPtr == NULL) {
LPUNKNOWN *objPtr;
- riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr = ckalloc(sizeof(RegisteredInterp));
memset(riPtr, 0, sizeof(RegisteredInterp));
riPtr->interp = interp;
@@ -326,7 +322,7 @@ Tk_SendObjCmd(
enum {
SEND_ASYNC, SEND_DISPLAYOF, SEND_LAST
};
- static const char *sendOptions[] = {
+ static const char *const sendOptions[] = {
"-async", "-displayof", "--", NULL
};
int result = TCL_OK;
@@ -367,9 +363,8 @@ Tk_SendObjCmd(
*/
if (displayPtr) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- "option not implemented: \"displayof\" is not available "
- "for this platform.", -1);
+ Tcl_SetResult(interp, "option not implemented: \"displayof\" is "
+ "not available for this platform.", TCL_STATIC);
result = TCL_ERROR;
}
@@ -379,6 +374,7 @@ Tk_SendObjCmd(
/* FIX ME: we need to check for local interp */
if (result == TCL_OK) {
LPDISPATCH pdisp;
+
result = FindInterpreterObject(interp, Tcl_GetString(objv[i]), &pdisp);
if (result == TCL_OK) {
i++;
@@ -791,7 +787,7 @@ Send(
if (ei.bstrSource != NULL) {
int len;
- char *szErrorInfo;
+ const char *szErrorInfo;
opError = Tcl_NewUnicodeObj(ei.bstrSource, -1);
Tcl_ListObjIndex(interp, opError, 0, &opErrorCode);
@@ -839,9 +835,9 @@ Win32ErrorObj(
TCHAR sBuffer[30];
Tcl_Obj* errPtr = NULL;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL, (DWORD)hrError, LANG_NEUTRAL,
- (LPTSTR)&lpBuffer, 0, NULL);
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError,
+ LANG_NEUTRAL, (LPTSTR)&lpBuffer, 0, NULL);
if (lpBuffer == NULL) {
lpBuffer = sBuffer;
@@ -955,7 +951,7 @@ TkWinSend_QueueCommand(
TRACE("SendQueueCommand()\n");
- evPtr = (SendEvent *)ckalloc(sizeof(SendEvent));
+ evPtr = ckalloc(sizeof(SendEvent));
evPtr->header.proc = SendEventProc;
evPtr->header.nextPtr = NULL;
evPtr->interp = interp;
@@ -1035,8 +1031,8 @@ SendTrace(
static char buffer[1024];
va_start(args, format);
- vsnprintf(buffer, 1023, format, args);
- OutputDebugString(buffer);
+ _vsnprintf(buffer, 1023, format, args);
+ OutputDebugStringA(buffer);
va_end(args);
}
diff --git a/win/tkWinSendCom.c b/win/tkWinSendCom.c
index 3bbdd63..c67e533 100644
--- a/win/tkWinSendCom.c
+++ b/win/tkWinSendCom.c
@@ -378,8 +378,8 @@ Async(
hr = VariantChangeType(&vCmd, &Cmd, 0, VT_BSTR);
if (FAILED(hr)) {
- Tcl_SetStringObj(Tcl_GetObjResult(obj->interp),
- "invalid args: Async(command)", -1);
+ Tcl_SetObjResult(obj->interp, Tcl_NewStringObj(
+ "invalid args: Async(command)", -1));
SetExcepInfo(obj->interp, pExcepInfo);
hr = DISP_E_EXCEPTION;
}
@@ -387,13 +387,13 @@ Async(
if (SUCCEEDED(hr)) {
if (obj->interp) {
Tcl_Obj *scriptPtr = Tcl_NewUnicodeObj(vCmd.bstrVal,
- (int)SysStringLen(vCmd.bstrVal));
+ (int) SysStringLen(vCmd.bstrVal));
+
TkWinSend_QueueCommand(obj->interp, scriptPtr);
}
}
VariantClear(&vCmd);
-
return hr;
}
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index d361ad7..d7d4d0f 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -12,6 +12,10 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
+#undef USE_TCL_STUBS
+#define USE_TCL_STUBS
+#undef USE_TK_STUBS
+#define USE_TK_STUBS
#include "tkWinInt.h"
HWND tkWinCurrentDialog;
@@ -22,21 +26,20 @@ HWND tkWinCurrentDialog;
static int TestclipboardObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int TestwineventCmd(ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv);
+ Tcl_Interp *interp, int argc, const char **argv);
static int TestfindwindowObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int TestgetwindowinfoObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int TestwinlocaleObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
-MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
+static Tk_GetSelProc SetSelectionResult;
-
/*
*----------------------------------------------------------------------
*
@@ -99,12 +102,16 @@ AppendSystemError(
{
int length;
WCHAR *wMsgPtr, **wMsgPtrPtr = &wMsgPtr;
- char *msg;
+ const 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
+ if (Tcl_IsShared(resultPtr)) {
+ resultPtr = Tcl_DuplicateObj(resultPtr);
+ }
+ length = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS
| FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) wMsgPtrPtr,
0, NULL);
@@ -112,6 +119,7 @@ AppendSystemError(
char *msgPtr;
length = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS
| FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) &msgPtr,
0, NULL);
@@ -124,36 +132,41 @@ AppendSystemError(
}
if (length == 0) {
if (error == ERROR_CALL_NOT_IMPLEMENTED) {
- msg = "function not supported under Win32s";
+ strcpy(msgBuf, "function not supported under Win32s");
} else {
sprintf(msgBuf, "unknown error: %ld", error);
- msg = msgBuf;
}
+ msg = msgBuf;
} else {
Tcl_Encoding encoding;
+ char *msgPtr;
encoding = Tcl_GetEncoding(NULL, "unicode");
- msg = Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds);
+ Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds);
Tcl_FreeEncoding(encoding);
LocalFree(wMsgPtr);
+ msgPtr = Tcl_DStringValue(&ds);
length = Tcl_DStringLength(&ds);
/*
* Trim the trailing CR/LF from the system message.
*/
- if (msg[length-1] == '\n') {
- msg[--length] = 0;
+ if (msgPtr[length-1] == '\n') {
+ --length;
}
- if (msg[length-1] == '\r') {
- msg[--length] = 0;
+ if (msgPtr[length-1] == '\r') {
+ --length;
}
+ msgPtr[length] = 0;
+ msg = msgPtr;
}
sprintf(id, "%ld", error);
Tcl_SetErrorCode(interp, "WINDOWS", id, msg, NULL);
Tcl_AppendToObj(resultPtr, msg, length);
+ Tcl_SetObjResult(interp, resultPtr);
if (length != 0) {
Tcl_DStringFree(&ds);
@@ -178,44 +191,30 @@ AppendSystemError(
*/
static int
+SetSelectionResult(
+ ClientData dummy,
+ Tcl_Interp *interp,
+ const char *selection)
+{
+ Tcl_AppendResult(interp, selection, NULL);
+ return TCL_OK;
+}
+
+static int
TestclipboardObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
- HGLOBAL handle;
- char *data;
- int code = TCL_OK;
+ Tk_Window tkwin = (Tk_Window) clientData;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
- if (OpenClipboard(NULL)) {
- /*
- * We could consider using CF_UNICODETEXT on NT, but then we would
- * have to convert it from External. Instead we'll just take this and
- * do "bytestring" at the Tcl level for Unicode inclusive text
- */
-
- handle = GetClipboardData(CF_TEXT);
- if (handle != NULL) {
- data = GlobalLock(handle);
- Tcl_AppendResult(interp, data, NULL);
- GlobalUnlock(handle);
- } else {
- Tcl_AppendResult(interp, "null clipboard handle", NULL);
- code = TCL_ERROR;
- }
- CloseClipboard();
- return code;
- } else {
- Tcl_AppendResult(interp, "couldn't open clipboard: ", NULL);
- AppendSystemError(interp, GetLastError());
- return TCL_ERROR;
- }
- return TCL_OK;
+ return TkSelGetSelection(interp, tkwin, Tk_InternAtom(tkwin, "CLIPBOARD"),
+ XA_STRING, SetSelectionResult, NULL);
}
/*
@@ -240,7 +239,7 @@ TestwineventCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- CONST char **argv) /* Argument strings. */
+ const char **argv) /* Argument strings. */
{
HWND hwnd = 0;
HWND child = 0;
@@ -273,9 +272,19 @@ TestwineventCmd(
return TCL_ERROR;
}
- hwnd = (HWND) INT2PTR(strtol(argv[1], &rest, 0));
+#if 0
+ TkpScanWindowId(interp, argv[1], &id);
+ if (
+#ifdef _WIN64
+ (sscanf(string, "0x%p", &number) != 1) &&
+#endif /* _WIN64 */
+ Tcl_GetInt(interp, string, (int *)&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+#endif
+ hwnd = INT2PTR(strtol(argv[1], &rest, 0));
if (rest == argv[1]) {
- hwnd = FindWindow(NULL, argv[1]);
+ hwnd = FindWindowA(NULL, argv[1]);
if (hwnd == NULL) {
Tcl_SetResult(interp, "no such window", TCL_STATIC);
return TCL_ERROR;
@@ -289,7 +298,7 @@ TestwineventCmd(
child = GetWindow(hwnd, GW_CHILD);
while (child != NULL) {
- SendMessage(child, WM_GETTEXT, (WPARAM) sizeof(buf), (LPARAM) buf);
+ SendMessageA(child, WM_GETTEXT, (WPARAM) sizeof(buf), (LPARAM) buf);
if (strcasecmp(buf, argv[2]) == 0) {
id = GetDlgCtrlID(child);
break;
@@ -318,7 +327,7 @@ TestwineventCmd(
Tcl_DString ds;
char buf[256];
- GetDlgItemText(hwnd, id, buf, 256);
+ GetDlgItemTextA(hwnd, id, buf, 256);
Tcl_ExternalToUtfDString(NULL, buf, -1, &ds);
Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
Tcl_DStringFree(&ds);
@@ -328,7 +337,7 @@ TestwineventCmd(
Tcl_DString ds;
Tcl_UtfToExternalDString(NULL, argv[4], -1, &ds);
- SetDlgItemText(hwnd, id, Tcl_DStringValue(&ds));
+ SetDlgItemTextA(hwnd, id, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
break;
}
@@ -338,7 +347,7 @@ TestwineventCmd(
wParam = MAKEWPARAM(id, 0);
lParam = (LPARAM)child;
}
- sprintf(buf, "%d", (int) SendMessage(hwnd, message, wParam, lParam));
+ sprintf(buf, "%d", (int) SendMessageA(hwnd, message, wParam, lParam));
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
}
@@ -346,7 +355,7 @@ TestwineventCmd(
char buf[TCL_INTEGER_SPACE];
sprintf(buf, "%d",
- (int) SendDlgItemMessage(hwnd, id, message, wParam, lParam));
+ (int) SendDlgItemMessageA(hwnd, id, message, wParam, lParam));
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
}
@@ -357,7 +366,7 @@ TestwineventCmd(
/*
* testfindwindow title ?class?
* Find a Windows window using the FindWindow API call. This takes the window
- * title and optionally the window class and if found returns the HWND and
+ * title and optionally the window class and if found returns the HWND and
* raises an error if the window is not found.
* eg: testfindwindow Console TkTopLevel
* Can find the console window if it is visible.
@@ -370,20 +379,27 @@ TestfindwindowObjCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument values. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
- const char *title = NULL, *class = NULL;
+ const TCHAR *title = NULL, *class = NULL;
+ Tcl_DString titleString, classString;
HWND hwnd = NULL;
int r = TCL_OK;
+ Tcl_DStringInit(&classString);
+ Tcl_DStringInit(&titleString);
+
if (objc < 2 || objc > 3) {
Tcl_WrongNumArgs(interp, 1, objv, "title ?class?");
return TCL_ERROR;
}
- title = Tcl_GetString(objv[1]);
- if (objc == 3)
- class = Tcl_GetString(objv[2]);
- hwnd = FindWindowA(class, title);
+
+ title = Tcl_WinUtfToTChar(Tcl_GetString(objv[1]), -1, &titleString);
+ if (objc == 3) {
+ class = Tcl_WinUtfToTChar(Tcl_GetString(objv[2]), -1, &classString);
+ }
+
+ hwnd = FindWindow(class, title);
if (hwnd == NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to find window: ", -1));
@@ -392,14 +408,20 @@ TestfindwindowObjCmd(
} else {
Tcl_SetObjResult(interp, Tcl_NewLongObj(PTR2INT(hwnd)));
}
+
+ Tcl_DStringFree(&titleString);
+ Tcl_DStringFree(&classString);
return r;
-
+
}
static BOOL CALLBACK
-EnumChildrenProc(HWND hwnd, LPARAM lParam)
+EnumChildrenProc(
+ HWND hwnd,
+ LPARAM lParam)
{
- Tcl_Obj *listObj = (Tcl_Obj *)lParam;
+ Tcl_Obj *listObj = (Tcl_Obj *) lParam;
+
Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj(PTR2INT(hwnd)));
return TRUE;
}
@@ -409,13 +431,13 @@ TestgetwindowinfoObjCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
- Tcl_Obj *CONST objv[])
+ Tcl_Obj *const objv[])
{
long hwnd;
- Tcl_Obj *resObj = NULL, *classObj = NULL, *textObj = NULL;
+ Tcl_Obj *dictObj = NULL, *classObj = NULL, *textObj = NULL;
Tcl_Obj *childrenObj = NULL;
- char buf[512];
- int cch, cchBuf = tkWinProcs->useWide ? 256 : 512;
+ TCHAR buf[512];
+ int cch, cchBuf = 256;
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "hwnd");
@@ -424,49 +446,38 @@ TestgetwindowinfoObjCmd(
if (Tcl_GetLongFromObj(interp, objv[1], &hwnd) != TCL_OK)
return TCL_ERROR;
-
- if (tkWinProcs->useWide) {
- cch = GetClassNameW(INT2PTR(hwnd), (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR));
- classObj = Tcl_NewUnicodeObj((LPWSTR)buf, cch);
- } else {
- cch = GetClassNameA(INT2PTR(hwnd), (LPSTR)buf, sizeof(buf));
- classObj = Tcl_NewStringObj((LPSTR)buf, cch);
- }
+
+ cch = GetClassName(INT2PTR(hwnd), buf, cchBuf);
if (cch == 0) {
Tcl_SetResult(interp, "failed to get class name: ", TCL_STATIC);
AppendSystemError(interp, GetLastError());
return TCL_ERROR;
- }
-
- resObj = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("class", -1));
- Tcl_ListObjAppendElement(interp, resObj, classObj);
-
- Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("id", -1));
- Tcl_ListObjAppendElement(interp, resObj,
- Tcl_NewLongObj(GetWindowLong(INT2PTR(hwnd), GWL_ID)));
-
- cch = tkWinProcs->getWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf);
- if (tkWinProcs->useWide) {
- textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch);
} else {
- textObj = Tcl_NewStringObj((LPCSTR)buf, cch);
+ Tcl_DString ds;
+ Tcl_WinTCharToUtf(buf, -1, &ds);
+ classObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
}
- Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("text", -1));
- Tcl_ListObjAppendElement(interp, resObj, textObj);
- Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("parent", -1));
- Tcl_ListObjAppendElement(interp, resObj,
- Tcl_NewLongObj(PTR2INT(GetParent(INT2PTR(hwnd)))));
+ dictObj = Tcl_NewDictObj();
+ Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("class", 5), classObj);
+ Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2),
+ Tcl_NewLongObj(GetWindowLongA(INT2PTR(hwnd), GWL_ID)));
+
+ cch = GetWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf);
+ textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch);
+
+ Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("text", 4), textObj);
+ Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("parent", 6),
+ Tcl_NewLongObj(PTR2INT(GetParent((INT2PTR(hwnd))))));
childrenObj = Tcl_NewListObj(0, NULL);
EnumChildWindows(INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj);
- Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("children", -1));
- Tcl_ListObjAppendElement(interp, resObj, childrenObj);
+ Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("children", -1), childrenObj);
- Tcl_SetObjResult(interp, resObj);
+ Tcl_SetObjResult(interp, dictObj);
return TCL_OK;
-}
+}
static int
TestwinlocaleObjCmd(
@@ -479,7 +490,7 @@ TestwinlocaleObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, NULL);
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj((int)GetSystemDefaultLCID()));
+ Tcl_SetObjResult(interp, Tcl_NewIntObj((int)GetThreadLocale()));
return TCL_OK;
}
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 43ff0aa..ca966fd 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -11,6 +11,7 @@
*/
#include "tkWinInt.h"
+#include "tkBusy.h"
typedef struct ThreadSpecificData {
int initialized; /* 0 means table below needs initializing. */
@@ -65,7 +66,7 @@ Tk_AttachHWND(
*/
if (twdPtr == NULL) {
- twdPtr = (TkWinDrawable *) ckalloc(sizeof(TkWinDrawable));
+ twdPtr = ckalloc(sizeof(TkWinDrawable));
twdPtr->type = TWD_WINDOW;
twdPtr->window.winPtr = (TkWindow *) tkwin;
} else if (twdPtr->window.handle != NULL) {
@@ -80,7 +81,7 @@ Tk_AttachHWND(
twdPtr->window.handle = hwnd;
entryPtr = Tcl_CreateHashEntry(&tsdPtr->windowTable, (char *)hwnd, &new);
- Tcl_SetHashValue(entryPtr, (ClientData)tkwin);
+ Tcl_SetHashValue(entryPtr, tkwin);
return (Window)twdPtr;
}
@@ -172,12 +173,13 @@ TkpPrintWindowId(
/*
* Use pointer representation, because Win64 is P64 (*not* LP64). Windows
* doesn't print the 0x for %p, so we do it.
- * bug #2026405: cygwin does output 0x for %p so test and recover.
+ * Bug 2026405: cygwin does output 0x for %p so test and recover.
*/
sprintf(buf, "0x%p", hwnd);
- if (buf[2] == '0' && buf[3] == 'x')
+ if (buf[2] == '0' && buf[3] == 'x') {
sprintf(buf, "%p", hwnd);
+ }
}
/*
@@ -204,12 +206,15 @@ TkpPrintWindowId(
int
TkpScanWindowId(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
- CONST char *string, /* String containing a (possibly signed)
+ const char *string, /* String containing a (possibly signed)
* integer in a form acceptable to strtol. */
Window *idPtr) /* Place to store converted result. */
{
Tk_Window tkwin;
- void *number, *numberPtr = &number;
+ union {
+ HWND hwnd;
+ int number;
+ } win;
/*
* We want sscanf for the 64-bit check, but if that doesn't work, then
@@ -218,13 +223,13 @@ TkpScanWindowId(
if (
#ifdef _WIN64
- (sscanf(string, "0x%p", &number) != 1) &&
+ (sscanf(string, "0x%p", &win.hwnd) != 1) &&
#endif
- Tcl_GetInt(interp, string, (int *) numberPtr) != TCL_OK) {
+ Tcl_GetInt(interp, string, &win.number) != TCL_OK) {
return TCL_ERROR;
}
- tkwin = Tk_HWNDToWindow((HWND) number);
+ tkwin = Tk_HWNDToWindow(win.hwnd);
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
} else {
@@ -323,7 +328,7 @@ XDestroyWindow(
Tcl_DeleteHashEntry(entryPtr);
}
- ckfree((char *)twdPtr);
+ ckfree(twdPtr);
/*
* Don't bother destroying the window if we are going to destroy the
@@ -784,27 +789,174 @@ TkWinSetWindowPos(
/*
*----------------------------------------------------------------------
*
- * TkpWindowWasRecentlyDeleted --
+ * TkpShowBusyWindow --
*
- * Determines whether we know if the window given as argument was
- * recently deleted. Called by the generic code error handler to handle
- * BadWindow events.
+ * Makes a busy window "appear".
*
* Results:
- * Always 0. We do not keep this information on Windows.
+ * None.
*
* Side effects:
+ * Arranges for the busy window to start intercepting events and the
+ * cursor to change to the configured "hey, I'm busy!" setting.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpShowBusyWindow(
+ TkBusy busy)
+{
+ Busy *busyPtr = (Busy *) busy;
+ HWND hWnd;
+ POINT point;
+ Display *display;
+ Window window;
+
+ if (busyPtr->tkBusy != NULL) {
+ Tk_MapWindow(busyPtr->tkBusy);
+ window = Tk_WindowId(busyPtr->tkBusy);
+ display = Tk_Display(busyPtr->tkBusy);
+ hWnd = Tk_GetHWND(window);
+ display->request++;
+ SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ }
+
+ /*
+ * Under Win32, cursors aren't associated with windows. Tk fakes this by
+ * watching Motion events on its windows. So Tk will automatically change
+ * the cursor when the pointer enters the Busy window. But Windows does
+ * not immediately change the cursor; it waits for the cursor position to
+ * change or a system call. We need to change the cursor before the
+ * application starts processing, so set the cursor position redundantly
+ * back to the current position.
+ */
+
+ GetCursorPos(&point);
+ SetCursorPos(point.x, point.y);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpHideBusyWindow --
+ *
+ * Makes a busy window "disappear".
+ *
+ * Results:
* None.
*
+ * Side effects:
+ * Arranges for the busy window to stop intercepting events, and the
+ * cursor to change back to its normal setting.
+ *
*----------------------------------------------------------------------
*/
-int
-TkpWindowWasRecentlyDeleted(
- Window win,
- TkDisplay *dispPtr)
+void
+TkpHideBusyWindow(
+ TkBusy busy)
{
- return 0;
+ Busy *busyPtr = (Busy *) busy;
+ POINT point;
+
+ if (busyPtr->tkBusy != NULL) {
+ Tk_UnmapWindow(busyPtr->tkBusy);
+ }
+
+ /*
+ * Under Win32, cursors aren't associated with windows. Tk fakes this by
+ * watching Motion events on its windows. So Tk will automatically change
+ * the cursor when the pointer enters the Busy window. But Windows does
+ * not immediately change the cursor: it waits for the cursor position to
+ * change or a system call. We need to change the cursor before the
+ * application starts processing, so set the cursor position redundantly
+ * back to the current position.
+ */
+
+ GetCursorPos(&point);
+ SetCursorPos(point.x, point.y);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMakeTransparentWindowExist --
+ *
+ * Construct the platform-specific resources for a transparent window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Moves the specified window in the stacking order.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMakeTransparentWindowExist(
+ Tk_Window tkwin, /* Token for window. */
+ Window parent) /* Parent window. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ HWND hParent = (HWND) parent, hWnd;
+ int style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ DWORD exStyle = WS_EX_TRANSPARENT | WS_EX_TOPMOST;
+
+ hWnd = CreateWindowEx(exStyle, TK_WIN_CHILD_CLASS_NAME, NULL, style,
+ Tk_X(tkwin), Tk_Y(tkwin), Tk_Width(tkwin), Tk_Height(tkwin),
+ hParent, NULL, Tk_GetHINSTANCE(), NULL);
+ winPtr->window = Tk_AttachHWND(tkwin, hWnd);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateBusy --
+ *
+ * Construct the platform-specific parts of a busy window. Note that this
+ * postpones the actual creation of the window resource until later.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets up part of the busy window structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpCreateBusy(
+ Tk_FakeWin *winPtr,
+ Tk_Window tkRef,
+ Window *parentPtr,
+ Tk_Window tkParent,
+ TkBusy busy)
+{
+ Busy *busyPtr = (Busy *) busy;
+
+ if (winPtr->flags & TK_REPARENTED) {
+ /*
+ * This works around a bug in the implementation of menubars for
+ * non-Macintosh window systems (Win32 and X11). Tk doesn't reset the
+ * pointers to the parent window when the menu is reparented
+ * (winPtr->parentPtr points to the wrong window). We get around this
+ * by determining the parent via the native API calls.
+ */
+
+ HWND hWnd = GetParent(Tk_GetHWND(Tk_WindowId(tkRef)));
+ RECT rect;
+
+ if (GetWindowRect(hWnd, &rect)) {
+ busyPtr->width = rect.right - rect.left;
+ busyPtr->height = rect.bottom - rect.top;
+ }
+ } else {
+ *parentPtr = Tk_WindowId(tkParent);
+ *parentPtr = (Window) Tk_GetHWND(*parentPtr);
+ }
}
/*
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 2df9b2e..e4c9c34 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -34,7 +34,7 @@
* Event structure for synthetic activation events. These events are placed on
* the event queue whenever a toplevel gets a WM_MOUSEACTIVATE message or
* a WM_ACTIVATE. If the window is being moved (*flagPtr will be true)
- * then the handling of this event must be delayed until the operation
+ * then the handling of this event must be delayed until the operation
* has completed to avoid a premature WM_EXITSIZEMOVE event.
*/
@@ -58,7 +58,7 @@ typedef struct ProtocolHandler {
* 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
+ char command[1]; /* 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
@@ -66,7 +66,7 @@ typedef struct ProtocolHandler {
} ProtocolHandler;
#define HANDLER_SIZE(cmdLength) \
- ((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength))
+ ((unsigned) ((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength))
/*
* Helper type passed via lParam to TkWmStackorderToplevelEnumProc
@@ -268,7 +268,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. */
- CONST char **cmdArgv; /* Array of strings to store in the WM_COMMAND
+ 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. */
@@ -395,23 +395,6 @@ static Tcl_ThreadDataKey dataKey;
static int initialized; /* Flag indicating whether module has been
* initialized. */
-/*
- * 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;
-
-/*
- * A pointer to SetLayeredWindowAttributes (user32.dll) which we retrieve
- * dynamically because it is only valid on Win2K+.
- */
-
-BOOL (WINAPI *setLayeredWindowAttributesProc) (HWND hwnd, COLORREF crKey,
- BYTE bAlpha, DWORD dwFlags) = NULL;
-
TCL_DECLARE_MUTEX(winWmMutex)
/*
@@ -432,7 +415,7 @@ static int InstallColormaps(HWND hwnd, int message,
int isForemost);
static void InvalidateSubTree(TkWindow *winPtr, Colormap colormap);
static void InvalidateSubTreeDepth(TkWindow *winPtr);
-static int ParseGeometry(Tcl_Interp *interp, char *string,
+static int ParseGeometry(Tcl_Interp *interp, const char *string,
TkWindow *winPtr);
static void RefreshColormap(Colormap colormap, TkDisplay *dispPtr);
static void SetLimits(HWND hwnd, MINMAXINFO *info);
@@ -466,100 +449,100 @@ static void DecrIconRefCount(WinIconPtr titlebaricon);
static int WmAspectCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmAttributesCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmClientCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmColormapwindowsCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmCommandCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmDeiconifyCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmFocusmodelCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmForgetCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmFrameCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGeometryCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGridCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmGroupCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconbitmapCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconifyCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconmaskCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconnameCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconphotoCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconpositionCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmIconwindowCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmManageCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmMaxsizeCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmMinsizeCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmOverrideredirectCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmPositionfromCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmProtocolCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmResizableCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmSizefromCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmStackorderCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmStateCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmTitleCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmTransientCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static int WmWithdrawCmd(Tk_Window tkwin,
TkWindow *winPtr, Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]);
+ Tcl_Obj *const objv[]);
static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr);
/*
@@ -650,7 +633,7 @@ static LPSTR
FindDIBBits(
LPSTR lpbi)
{
- return lpbi + *(LPDWORD)lpbi + PaletteSize(lpbi);
+ return lpbi + *((LPDWORD) lpbi) + PaletteSize(lpbi);
}
/*
@@ -706,7 +689,7 @@ AdjustIconImagePointers(
* BITMAPINFO is at beginning of bits.
*/
- lpImage->lpbi = (LPBITMAPINFO)lpImage->lpBits;
+ lpImage->lpbi = (LPBITMAPINFO) lpImage->lpBits;
/*
* Width - simple enough.
@@ -732,14 +715,14 @@ AdjustIconImagePointers(
* XOR bits follow the header and color table.
*/
- lpImage->lpXOR = (LPBYTE)FindDIBBits(((LPSTR)lpImage->lpbi));
+ lpImage->lpXOR = (LPBYTE) FindDIBBits((LPSTR) lpImage->lpbi);
/*
* AND bits follow the XOR bits.
*/
- lpImage->lpAND = lpImage->lpXOR + (lpImage->Height*
- BytesPerLine((LPBITMAPINFOHEADER)(lpImage->lpbi)));
+ lpImage->lpAND = lpImage->lpXOR +
+ lpImage->Height*BytesPerLine((LPBITMAPINFOHEADER) lpImage->lpbi);
return TRUE;
}
@@ -762,49 +745,30 @@ MakeIconOrCursorFromResource(
LPICONIMAGE lpIcon,
BOOL isIcon)
{
- HICON hIcon ;
- static FARPROC pfnCreateIconFromResourceEx=NULL;
- static int initinfo=0;
+ HICON hIcon;
/*
* Sanity Check
*/
- if (lpIcon == NULL) {
+ if (lpIcon == NULL || lpIcon->lpBits == 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;
- }
+ hIcon = (HICON) CreateIconFromResourceEx(lpIcon->lpBits,
+ lpIcon->dwNumBytes, isIcon, 0x00030000,
+ (*(LPBITMAPINFOHEADER) lpIcon->lpBits).biWidth,
+ (*(LPBITMAPINFOHEADER) lpIcon->lpBits).biHeight/2, 0);
/*
* It failed, odds are good we're on NT so try the non-Ex way.
*/
- if (hIcon == NULL) {
+ if (hIcon == NULL) {
/*
* We would break on NT if we try with a 16bpp image.
*/
@@ -892,40 +856,20 @@ static int
InitWindowClass(
WinIconPtr titlebaricon)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (! tsdPtr->initialized) {
+ if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
tsdPtr->firstWindow = 1;
tsdPtr->iconPtr = NULL;
}
- if (! initialized) {
+ if (!initialized) {
Tcl_MutexLock(&winWmMutex);
- if (! initialized) {
- Tcl_DString classString;
+ if (!initialized) {
WNDCLASS class;
- initialized = 1;
- 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);
- }
- }
- if (setLayeredWindowAttributesProc == NULL) {
- HINSTANCE hInstance = LoadLibraryA("user32");
- if (hInstance != NULL) {
- setLayeredWindowAttributesProc = (BOOL (WINAPI*)(HWND hwnd,
- COLORREF crKey, BYTE bAlpha, DWORD dwFlags))
- GetProcAddress(hInstance,"SetLayeredWindowAttributes");
- FreeLibrary(hInstance);
- }
- }
+ initialized = 1;
/*
* The only difference between WNDCLASSW and WNDCLASSA are in
@@ -936,11 +880,10 @@ InitWindowClass(
class.style = CS_HREDRAW | CS_VREDRAW;
class.hInstance = Tk_GetHINSTANCE();
- Tcl_WinUtfToTChar(TK_WIN_TOPLEVEL_CLASS_NAME, -1, &classString);
- class.lpszClassName = (LPCTSTR) Tcl_DStringValue(&classString);
+ class.lpszClassName = TK_WIN_TOPLEVEL_CLASS_NAME;
class.lpfnWndProc = WmProc;
if (titlebaricon == NULL) {
- class.hIcon = LoadIcon(Tk_GetHINSTANCE(), "tk");
+ class.hIcon = LoadIcon(Tk_GetHINSTANCE(), TEXT("tk"));
} else {
class.hIcon = GetIcon(titlebaricon, ICON_BIG);
if (class.hIcon == NULL) {
@@ -956,11 +899,9 @@ InitWindowClass(
}
class.hCursor = LoadCursor(NULL, IDC_ARROW);
- if (!(*tkWinProcs->registerClass)(&class)) {
+ if (!RegisterClass(&class)) {
Tcl_Panic("Unable to register TkTopLevel class");
}
-
- Tcl_DStringFree(&classString);
}
Tcl_MutexUnlock(&winWmMutex);
}
@@ -1043,7 +984,7 @@ WinSetIcon(
* We must get the window's wrapper, not the window itself.
*/
- wmPtr = ((TkWindow*)tkw)->wmInfoPtr;
+ wmPtr = ((TkWindow *) tkw)->wmInfoPtr;
hwnd = wmPtr->wrapper;
if (application) {
@@ -1104,7 +1045,7 @@ WinSetIcon(
/*
* The following code is exercised if you do
*
- * toplevel .t ; wm titlebaricon .t foo.icr
+ * 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.
@@ -1117,7 +1058,7 @@ WinSetIcon(
*/
UpdateWrapper(wmPtr->winPtr);
- wmPtr = ((TkWindow*)tkw)->wmInfoPtr;
+ wmPtr = ((TkWindow *) tkw)->wmInfoPtr;
hwnd = wmPtr->wrapper;
if (hwnd == NULL) {
Tcl_AppendResult(interp,
@@ -1176,7 +1117,7 @@ TkWinGetIcon(
{
WmInfo *wmPtr;
HICON icon;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->iconPtr != NULL) {
@@ -1184,7 +1125,7 @@ TkWinGetIcon(
* return default toplevel icon
*/
- return GetIcon(tsdPtr->iconPtr, (int)iconsize);
+ return GetIcon(tsdPtr->iconPtr, (int) iconsize);
}
/*
@@ -1208,7 +1149,7 @@ TkWinGetIcon(
* return window toplevel icon
*/
- return GetIcon(wmPtr->iconPtr, (int)iconsize);
+ return GetIcon(wmPtr->iconPtr, (int) iconsize);
}
/*
@@ -1270,11 +1211,13 @@ ReadIconFromFile(
WinIconPtr titlebaricon = NULL;
BlockOfIconImagesPtr lpIR;
+#if 0 /* TODO: Dead code? */
if (0 /* If we already have an icon for this filename */) {
titlebaricon = NULL; /* Get the real value from a lookup */
titlebaricon->refCount++;
return titlebaricon;
}
+#endif
/*
* First check if it is a .ico file.
@@ -1288,19 +1231,19 @@ ReadIconFromFile(
* switching) display uses the right icon.
*/
- if (lpIR == NULL && shgetfileinfoProc != NULL) {
+ if (lpIR == NULL) {
SHFILEINFO sfiSM;
Tcl_DString ds, ds2;
DWORD *res;
- CONST char *file;
+ const char *file;
file = Tcl_TranslateFileName(interp, Tcl_GetString(fileName), &ds);
if (file == NULL) {
return NULL;
}
- Tcl_UtfToExternalDString(NULL, file, -1, &ds2);
+ Tcl_WinUtfToTChar(file, -1, &ds2);
Tcl_DStringFree(&ds);
- res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfiSM,
+ res = (DWORD *)SHGetFileInfo((TCHAR *)Tcl_DStringValue(&ds2), 0, &sfiSM,
sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_ICON);
if (res != 0) {
@@ -1308,7 +1251,7 @@ ReadIconFromFile(
unsigned size;
Tcl_ResetResult(interp);
- res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfi,
+ res = (DWORD *)SHGetFileInfo((TCHAR *)Tcl_DStringValue(&ds2), 0, &sfi,
sizeof(SHFILEINFO), SHGFI_ICON);
/*
@@ -1317,7 +1260,7 @@ ReadIconFromFile(
size = sizeof(BlockOfIconImages)
+ ((res != 0) ? sizeof(ICONIMAGE) : 0);
- lpIR = (BlockOfIconImagesPtr) ckalloc(size);
+ lpIR = ckalloc(size);
if (lpIR == NULL) {
if (res != 0) {
DestroyIcon(sfi.hIcon);
@@ -1348,7 +1291,7 @@ ReadIconFromFile(
Tcl_DStringFree(&ds2);
}
if (lpIR != NULL) {
- titlebaricon = (WinIconPtr) ckalloc(sizeof(WinIconInstance));
+ titlebaricon = ckalloc(sizeof(WinIconInstance));
titlebaricon->iconBlock = lpIR;
titlebaricon->refCount = 1;
}
@@ -1393,7 +1336,7 @@ GetIconFromPixmap(
Pixmap pixmap)
{
WinIconPtr titlebaricon = NULL;
- TkWinDrawable *twdPtr = (TkWinDrawable*) pixmap;
+ TkWinDrawable *twdPtr = (TkWinDrawable *) pixmap;
BlockOfIconImagesPtr lpIR;
ICONINFO icon;
HICON hIcon;
@@ -1403,11 +1346,13 @@ GetIconFromPixmap(
return NULL;
}
+#if 0 /* TODO: Dead code?*/
if (0 /* If we already have an icon for this pixmap */) {
titlebaricon = NULL; /* Get the real value from a lookup */
titlebaricon->refCount++;
return titlebaricon;
}
+#endif
Tk_SizeOfBitmap(dsPtr, pixmap, &width, &height);
@@ -1422,7 +1367,7 @@ GetIconFromPixmap(
return NULL;
}
- lpIR = (BlockOfIconImagesPtr) ckalloc(sizeof(BlockOfIconImages));
+ lpIR = ckalloc(sizeof(BlockOfIconImages));
if (lpIR == NULL) {
DestroyIcon(hIcon);
return NULL;
@@ -1443,7 +1388,7 @@ GetIconFromPixmap(
lpIR->IconImages[0].lpXOR = 0;
lpIR->IconImages[0].lpAND = 0;
- titlebaricon = (WinIconPtr) ckalloc(sizeof(WinIconInstance));
+ titlebaricon = ckalloc(sizeof(WinIconInstance));
titlebaricon->iconBlock = lpIR;
titlebaricon->refCount = 1;
return titlebaricon;
@@ -1479,7 +1424,7 @@ DecrIconRefCount(
}
titlebaricon->iconBlock = NULL;
- ckfree((char*)titlebaricon);
+ ckfree(titlebaricon);
}
}
@@ -1510,15 +1455,15 @@ FreeIconBlock(
* Free all the bits.
*/
- for (i=0; i< lpIR->nNumImages; i++) {
+ for (i=0 ; i<lpIR->nNumImages ; i++) {
if (lpIR->IconImages[i].lpBits != NULL) {
- ckfree((char*)lpIR->IconImages[i].lpBits);
+ ckfree(lpIR->IconImages[i].lpBits);
}
if (lpIR->IconImages[i].hIcon != NULL) {
DestroyIcon(lpIR->IconImages[i].hIcon);
}
}
- ckfree ((char*)lpIR);
+ ckfree(lpIR);
}
/*
@@ -1540,6 +1485,8 @@ GetIcon(
int icon_size)
{
BlockOfIconImagesPtr lpIR;
+ unsigned int size = (icon_size == 0 ? 16 : 32);
+ int i;
if (titlebaricon == NULL) {
return NULL;
@@ -1548,30 +1495,27 @@ GetIcon(
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;
- }
- }
+ }
+ for (i=0 ; i<lpIR->nNumImages ; i++) {
/*
- * If we get here, then just return the first one, it will have to do!
+ * Take the first or a 32x32 16 color icon
*/
- if (lpIR->nNumImages >= 1) {
- return lpIR->IconImages[0].hIcon;
+ 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;
}
@@ -1589,7 +1533,7 @@ TclWinReadCursorFromFile(
return NULL;
}
if (lpIR->nNumImages >= 1) {
- res = CopyImage(lpIR->IconImages[0].hIcon, IMAGE_CURSOR,0,0,0);
+ res = CopyImage(lpIR->IconImages[0].hIcon, IMAGE_CURSOR, 0, 0, 0);
}
FreeIconBlock(lpIR);
return res;
@@ -1631,7 +1575,7 @@ ReadIconOrCursorFromFile(
channel = Tcl_FSOpenFileChannel(interp, fileName, "r", 0);
if (channel == NULL) {
- Tcl_AppendResult(interp,"Error opening file \"",
+ Tcl_AppendResult(interp, "Error opening file \"",
Tcl_GetString(fileName), "\" for reading", NULL);
return NULL;
}
@@ -1650,16 +1594,17 @@ ReadIconOrCursorFromFile(
* Allocate memory for the resource structure
*/
- lpIR = (BlockOfIconImagesPtr) ckalloc(sizeof(BlockOfIconImages));
+ lpIR = ckalloc(sizeof(BlockOfIconImages));
/*
* Read in the header
*/
- if ((lpIR->nNumImages = ReadICOHeader(channel)) == -1) {
+ lpIR->nNumImages = ReadICOHeader(channel);
+ if (lpIR->nNumImages == -1) {
Tcl_AppendResult(interp, "Invalid file header", NULL);
Tcl_Close(NULL, channel);
- ckfree((char*) lpIR);
+ ckfree(lpIR);
return NULL;
}
@@ -1667,27 +1612,26 @@ ReadIconOrCursorFromFile(
* Adjust the size of the struct to account for the images.
*/
- lpIR = (BlockOfIconImagesPtr) ckrealloc((char*) lpIR,
- sizeof(BlockOfIconImages)
- + ((lpIR->nNumImages - 1) * sizeof(ICONIMAGE)));
+ lpIR = ckrealloc(lpIR, sizeof(BlockOfIconImages)
+ + (lpIR->nNumImages - 1) * sizeof(ICONIMAGE));
/*
* Allocate enough memory for the icon directory entries.
*/
- lpIDE = (LPICONDIRENTRY) ckalloc(lpIR->nNumImages * sizeof(ICONDIRENTRY));
+ lpIDE = ckalloc(lpIR->nNumImages * sizeof(ICONDIRENTRY));
/*
* Read in the icon directory entries.
*/
- dwBytesRead = Tcl_Read(channel, (char*) lpIDE,
- (int)(lpIR->nNumImages * sizeof(ICONDIRENTRY)));
+ dwBytesRead = Tcl_Read(channel, (char *) lpIDE,
+ (int) (lpIR->nNumImages * sizeof(ICONDIRENTRY)));
if (dwBytesRead != lpIR->nNumImages * sizeof(ICONDIRENTRY)) {
Tcl_AppendResult(interp, "Error reading file", NULL);
Tcl_Close(NULL, channel);
- ckfree((char *) lpIDE);
- ckfree((char *) lpIR);
+ ckfree(lpIDE);
+ ckfree(lpIR);
return NULL;
}
@@ -1708,7 +1652,7 @@ ReadIconOrCursorFromFile(
* Allocate memory for the resource.
*/
- lpIR->IconImages[i].lpBits = (LPBYTE) ckalloc(lpIDE[i].dwBytesInRes);
+ lpIR->IconImages[i].lpBits = ckalloc(lpIDE[i].dwBytesInRes);
lpIR->IconImages[i].dwNumBytes = lpIDE[i].dwBytesInRes;
/*
@@ -1724,7 +1668,7 @@ ReadIconOrCursorFromFile(
* Read it in.
*/
- dwBytesRead = Tcl_Read(channel, (char *) lpIR->IconImages[i].lpBits,
+ dwBytesRead = Tcl_Read(channel, (char *)lpIR->IconImages[i].lpBits,
(int) lpIDE[i].dwBytesInRes);
if (dwBytesRead != lpIDE[i].dwBytesInRes) {
Tcl_AppendResult(interp, "Error reading file", NULL);
@@ -1735,22 +1679,22 @@ ReadIconOrCursorFromFile(
* Set the internal pointers appropriately.
*/
- if (!AdjustIconImagePointers( &(lpIR->IconImages[i]))) {
+ if (!AdjustIconImagePointers(&lpIR->IconImages[i])) {
Tcl_AppendResult(interp, "Error converting to internal format",
NULL);
goto readError;
}
lpIR->IconImages[i].hIcon =
- MakeIconOrCursorFromResource(&(lpIR->IconImages[i]), isIcon);
+ MakeIconOrCursorFromResource(&lpIR->IconImages[i], isIcon);
}
/*
* Clean up
*/
- ckfree((char *) lpIDE);
+ ckfree(lpIDE);
Tcl_Close(NULL, channel);
- if (lpIR == NULL){
+ if (lpIR == NULL) {
Tcl_AppendResult(interp, "Reading of ", Tcl_GetString(fileName),
" failed!", NULL);
return NULL;
@@ -1761,11 +1705,11 @@ ReadIconOrCursorFromFile(
Tcl_Close(NULL, channel);
for (i = 0; i < lpIR->nNumImages; i++) {
if (lpIR->IconImages[i].lpBits != NULL) {
- ckfree((char *) lpIR->IconImages[i].lpBits);
+ ckfree(lpIR->IconImages[i].lpBits);
}
}
- ckfree((char *) lpIDE);
- ckfree((char *) lpIR);
+ ckfree(lpIDE);
+ ckfree(lpIR);
return NULL;
}
@@ -1789,7 +1733,7 @@ static TkWindow *
GetTopLevel(
HWND hwnd)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -1931,8 +1875,7 @@ TkWinWmCleanup(
}
initialized = 0;
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
return;
@@ -1963,9 +1906,7 @@ void
TkWmNewWindow(
TkWindow *winPtr) /* Newly-created top-level window. */
{
- register WmInfo *wmPtr;
-
- wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+ register WmInfo *wmPtr = ckalloc(sizeof(WmInfo));
/*
* Initialize full structure, then set what isn't NULL
@@ -2002,7 +1943,7 @@ TkWmNewWindow(
wmPtr->x = winPtr->changes.x;
wmPtr->y = winPtr->changes.y;
wmPtr->crefObj = NULL;
- wmPtr->colorref = (COLORREF)0;
+ wmPtr->colorref = (COLORREF) 0;
wmPtr->alpha = 1.0;
wmPtr->configWidth = -1;
@@ -2017,14 +1958,14 @@ TkWmNewWindow(
*/
Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask,
- TopLevelEventProc, (ClientData) winPtr);
+ TopLevelEventProc, winPtr);
/*
* Arrange for geometry requests to be reflected from the window to the
* window manager.
*/
- Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0);
+ Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, NULL);
}
/*
@@ -2057,9 +1998,9 @@ UpdateWrapper(
WINDOWPLACEMENT place;
HICON hSmallIcon = NULL;
HICON hBigIcon = NULL;
- Tcl_DString titleString, classString;
+ Tcl_DString titleString;
int *childStateInfo = NULL;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (winPtr->window == None) {
@@ -2092,7 +2033,6 @@ UpdateWrapper(
if (!IsWindow(wmPtr->wrapper)) {
Tcl_Panic("UpdateWrapper: Container was destroyed");
}
-
} else {
/*
* Pick the decorative frame style. Override redirect windows get
@@ -2127,8 +2067,8 @@ UpdateWrapper(
wmPtr->style = WM_TRANSIENT_STYLE;
wmPtr->exStyle = EX_TRANSIENT_STYLE;
parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->masterPtr));
- if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) {
+ if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE)
+ && (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) {
wmPtr->style |= WS_THICKFRAME;
}
} else {
@@ -2149,7 +2089,7 @@ UpdateWrapper(
*/
wmPtr->flags |= WM_CREATE_PENDING|WM_MOVE_PENDING;
- UpdateGeometryInfo((ClientData)winPtr);
+ UpdateGeometryInfo(winPtr);
wmPtr->flags &= ~(WM_CREATE_PENDING|WM_MOVE_PENDING);
width = wmPtr->borderWidth + winPtr->changes.width;
@@ -2185,33 +2125,30 @@ UpdateWrapper(
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),
+ wmPtr->wrapper = CreateWindowEx(wmPtr->exStyle,
+ TK_WIN_TOPLEVEL_CLASS_NAME,
(LPCTSTR) Tcl_DStringValue(&titleString),
wmPtr->style, x, y, width, height,
parentHWND, NULL, Tk_GetHINSTANCE(), NULL);
- Tcl_DStringFree(&classString);
Tcl_DStringFree(&titleString);
- SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (INT_PTR) winPtr);
+ SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr);
tsdPtr->createWindow = NULL;
- if ((wmPtr->exStyleConfig & WS_EX_LAYERED)
- && setLayeredWindowAttributesProc != NULL) {
+ if (wmPtr->exStyleConfig & WS_EX_LAYERED) {
/*
* The user supplies a double from [0..1], but Windows wants an
* int (transparent) 0..255 (opaque), so do the translation. Add
* the 0.5 to round the value.
*/
- setLayeredWindowAttributesProc((HWND) wmPtr->wrapper,
+ SetLayeredWindowAttributes((HWND) wmPtr->wrapper,
wmPtr->colorref, (BYTE) (wmPtr->alpha * 255 + 0.5),
(unsigned)(LWA_ALPHA | (wmPtr->crefObj?LWA_COLORKEY:0)));
} else {
/*
* Layering not used or supported.
*/
+
wmPtr->alpha = 1.0;
if (wmPtr->crefObj) {
Tcl_DecrRefCount(wmPtr->crefObj);
@@ -2224,8 +2161,9 @@ UpdateWrapper(
wmPtr->x = place.rcNormalPosition.left;
wmPtr->y = place.rcNormalPosition.top;
- if( !(winPtr->flags & TK_ALREADY_DEAD) )
+ if (!(winPtr->flags & TK_ALREADY_DEAD)) {
TkInstallFrameMenu((Tk_Window) winPtr);
+ }
if (oldWrapper && (oldWrapper != wmPtr->wrapper)
&& !(wmPtr->exStyle & WS_EX_TOPMOST)) {
@@ -2248,20 +2186,20 @@ UpdateWrapper(
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
if (winPtr->flags & TK_EMBEDDED) {
- SetWindowLongPtr(child, GWLP_WNDPROC, (INT_PTR) TopLevelProc);
+ SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc);
}
SetParent(child, wmPtr->wrapper);
if (oldWrapper) {
- hSmallIcon = (HICON) SendMessage(oldWrapper, WM_GETICON, ICON_SMALL,
- (LPARAM) NULL);
- hBigIcon = (HICON) SendMessage(oldWrapper, WM_GETICON, ICON_BIG,
- (LPARAM) NULL);
+ 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())) {
- SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG) 0);
+ SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG_PTR) 0);
if (wmPtr->numTransients > 0) {
/*
@@ -2271,8 +2209,7 @@ UpdateWrapper(
WmInfo *wmPtr2;
- childStateInfo = (int *)
- ckalloc((unsigned) wmPtr->numTransients * sizeof(int));
+ childStateInfo = ckalloc(wmPtr->numTransients * sizeof(int));
state = 0;
for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL;
wmPtr2 = wmPtr2->nextPtr) {
@@ -2294,11 +2231,11 @@ UpdateWrapper(
}
wmPtr->flags &= ~WM_NEVER_MAPPED;
- if (winPtr->flags & TK_EMBEDDED
- && SendMessage(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM)child, 0)){
+ if (winPtr->flags & TK_EMBEDDED &&
+ SendMessage(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM) child, 0)) {
SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ,
- Tk_ReqWidth((Tk_Window)winPtr),
- Tk_ReqHeight((Tk_Window)winPtr));
+ Tk_ReqWidth((Tk_Window) winPtr),
+ Tk_ReqHeight((Tk_Window) winPtr));
SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) wmPtr->hMenu,
(LPARAM) Tk_GetMenuHWND((Tk_Window) winPtr));
}
@@ -2319,10 +2256,11 @@ UpdateWrapper(
wmPtr->hints.initial_state = state;
if (hSmallIcon != NULL) {
- SendMessage(wmPtr->wrapper,WM_SETICON,ICON_SMALL,(LPARAM)hSmallIcon);
+ SendMessage(wmPtr->wrapper, WM_SETICON, ICON_SMALL,
+ (LPARAM) hSmallIcon);
}
if (hBigIcon != NULL) {
- SendMessage(wmPtr->wrapper,WM_SETICON,ICON_BIG,(LPARAM)hBigIcon);
+ SendMessage(wmPtr->wrapper, WM_SETICON, ICON_BIG, (LPARAM) hBigIcon);
}
/*
@@ -2334,7 +2272,7 @@ UpdateWrapper(
*/
if (winPtr->flags & TK_EMBEDDED) {
- if(state+1 != SendMessage(wmPtr->wrapper, TK_STATE, state, 0)) {
+ if (state+1 != SendMessage(wmPtr->wrapper, TK_STATE, state, 0)) {
TkpWmSetState(winPtr, NormalState);
wmPtr->hints.initial_state = NormalState;
}
@@ -2370,7 +2308,7 @@ UpdateWrapper(
}
}
- ckfree((char *) childStateInfo);
+ ckfree(childStateInfo);
}
/*
@@ -2418,7 +2356,7 @@ TkWmMapWindow(
* mapped. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
@@ -2430,8 +2368,7 @@ TkWmMapWindow(
* Don't map a transient if the master is not mapped.
*/
- if (wmPtr->masterPtr != NULL &&
- !Tk_IsMapped(wmPtr->masterPtr)) {
+ if (wmPtr->masterPtr != NULL && !Tk_IsMapped(wmPtr->masterPtr)) {
wmPtr->hints.initial_state = WithdrawnState;
return;
}
@@ -2657,6 +2594,7 @@ TkWmDeadWindow(
winPtr->dispPtr->firstWmPtr = wmPtr->nextPtr;
} else {
register WmInfo *prevPtr;
+
for (prevPtr = winPtr->dispPtr->firstWmPtr; ;
prevPtr = prevPtr->nextPtr) {
if (prevPtr == NULL) {
@@ -2679,7 +2617,7 @@ TkWmDeadWindow(
wmPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr,
VisibilityChangeMask|StructureNotifyMask,
- WmWaitVisibilityOrMapProc, (ClientData) wmPtr2->winPtr);
+ WmWaitVisibilityOrMapProc, wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
if ((wmPtr2->wrapper != None)
&& !(wmPtr2->flags & (WM_NEVER_MAPPED))) {
@@ -2719,16 +2657,16 @@ TkWmDeadWindow(
protPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr->nextPtr;
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
if (wmPtr->masterPtr != NULL) {
wmPtr2 = wmPtr->masterPtr->wmInfoPtr;
@@ -2742,7 +2680,7 @@ TkWmDeadWindow(
}
Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
VisibilityChangeMask|StructureNotifyMask,
- WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+ WmWaitVisibilityOrMapProc, winPtr);
wmPtr->masterPtr = NULL;
}
if (wmPtr->crefObj != NULL) {
@@ -2775,7 +2713,7 @@ TkWmDeadWindow(
DecrIconRefCount(wmPtr->iconPtr);
}
- ckfree((char *) wmPtr);
+ ckfree(wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -2829,10 +2767,10 @@ 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. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
- static CONST char *optionStrings[] = {
+ Tk_Window tkwin = clientData;
+ static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
"command", "deiconify", "focusmodel", "forget", "frame",
"geometry", "grid", "group", "iconbitmap",
@@ -2845,17 +2783,19 @@ Tk_WmObjCmd(
};
enum options {
WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
- WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET, WMOPT_FRAME,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET,
+ WMOPT_FRAME,
WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME,
WMOPT_ICONPHOTO, WMOPT_ICONPOSITION,
- WMOPT_ICONWINDOW, WMOPT_MANAGE, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
+ WMOPT_ICONWINDOW, WMOPT_MANAGE, 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;
+ const char *argv1;
TkWindow *winPtr, **winPtrPtr = &winPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -2904,8 +2844,8 @@ Tk_WmObjCmd(
!= TCL_OK) {
return TCL_ERROR;
}
- if (!Tk_IsTopLevel(winPtr) &&
- (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) {
+ if (!Tk_IsTopLevel(winPtr) && (index != WMOPT_MANAGE)
+ && (index != WMOPT_FORGET)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", NULL);
return TCL_ERROR;
@@ -3005,7 +2945,7 @@ WmAspectCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int numer1, denom1, numer2, denom2;
@@ -3017,12 +2957,9 @@ WmAspectCmd(
}
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d %d",
+ wmPtr->minAspect.x, wmPtr->minAspect.y,
+ wmPtr->maxAspect.x, wmPtr->maxAspect.y));
}
return TCL_OK;
}
@@ -3072,11 +3009,11 @@ WmAttributesCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
LONG style, exStyle, styleBit, *stylePtr = NULL;
- char *string;
+ const char *string;
int i, boolean, length;
int config_fullscreen = 0, updatewrapper = 0;
int fullscreen_attr_changed = 0, fullscreen_attr = 0;
@@ -3190,7 +3127,7 @@ WmAttributesCmd(
}
wmPtr->alpha = dval;
} else { /* -transparentcolor */
- char *crefstr = Tcl_GetStringFromObj(objv[i+1], &length);
+ const char *crefstr = Tcl_GetStringFromObj(objv[i+1], &length);
if (length == 0) {
/* reset to no transparent color */
@@ -3219,15 +3156,15 @@ WmAttributesCmd(
/*
* Only ever add the WS_EX_LAYERED bit, as it can cause
- * flashing to change this window style. This allows things
+ * flashing to change this window style. This allows things
* like fading tooltips to avoid flash ugliness without
* forcing all window to be layered.
*/
+
if ((wmPtr->alpha < 1.0) || (wmPtr->crefObj != NULL)) {
*stylePtr |= styleBit;
}
- if ((setLayeredWindowAttributesProc != NULL)
- && (wmPtr->wrapper != NULL)) {
+ if (wmPtr->wrapper != NULL) {
/*
* Set the window directly regardless of UpdateWrapper.
* The user supplies a double from [0..1], but Windows
@@ -3239,30 +3176,30 @@ WmAttributesCmd(
SetWindowLongPtr(wmPtr->wrapper, GWL_EXSTYLE,
*stylePtr);
}
- setLayeredWindowAttributesProc((HWND) wmPtr->wrapper,
+ SetLayeredWindowAttributes((HWND) wmPtr->wrapper,
wmPtr->colorref, (BYTE) (wmPtr->alpha * 255 + 0.5),
(unsigned) (LWA_ALPHA |
(wmPtr->crefObj ? LWA_COLORKEY : 0)));
}
}
} else {
- if ((i < objc-1) &&
- (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean)
- != TCL_OK)) {
+ if ((i < objc-1)
+ && Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean)
+ != TCL_OK) {
return TCL_ERROR;
}
if (config_fullscreen) {
if (objc == 4) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- (wmPtr->flags & WM_FULLSCREEN));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ wmPtr->flags & WM_FULLSCREEN));
} else {
fullscreen_attr_changed = 1;
fullscreen_attr = boolean;
}
config_fullscreen = 0;
} else if (objc == 4) {
- Tcl_SetIntObj(Tcl_GetObjResult(interp),
- ((*stylePtr & styleBit) != 0));
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(*stylePtr & styleBit));
} else if (boolean) {
*stylePtr |= styleBit;
} else {
@@ -3274,6 +3211,7 @@ WmAttributesCmd(
* Force the topmost position aspect to ensure that switching
* between (no)topmost reflects properly when rewrapped.
*/
+
SetWindowPos(wmPtr->wrapper,
((exStyle & WS_EX_TOPMOST) ?
HWND_TOPMOST : HWND_NOTOPMOST), 0, 0, 0, 0,
@@ -3363,10 +3301,10 @@ WmClientCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
if ((objc != 3) && (objc != 4)) {
@@ -3382,7 +3320,7 @@ WmClientCmd(
argv3 = Tcl_GetStringFromObj(objv[3], &length);
if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
wmPtr->clientMachine = NULL;
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XDeleteProperty(winPtr->display, winPtr->window,
@@ -3392,11 +3330,10 @@ WmClientCmd(
return TCL_OK;
}
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ ckfree(wmPtr->clientMachine);
}
- wmPtr->clientMachine = (char *)
- ckalloc((unsigned) (length + 1));
- strcpy(wmPtr->clientMachine, argv3);
+ wmPtr->clientMachine = ckalloc(length + 1);
+ memcpy(wmPtr->clientMachine, argv3, (unsigned) length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XTextProperty textProp;
@@ -3433,7 +3370,7 @@ WmColormapwindowsCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow **cmapList;
@@ -3460,13 +3397,12 @@ WmColormapwindowsCmd(
!= TCL_OK) {
return TCL_ERROR;
}
- cmapList = (TkWindow **) ckalloc((unsigned)
- ((windowObjc+1)*sizeof(TkWindow*)));
+ cmapList = ckalloc((windowObjc + 1) * sizeof(TkWindow*));
gotToplevel = 0;
for (i = 0; i < windowObjc; i++) {
if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
(Tk_Window *) winPtr2Ptr) != TCL_OK) {
- ckfree((char *) cmapList);
+ ckfree(cmapList);
return TCL_ERROR;
}
if (winPtr2 == winPtr) {
@@ -3486,7 +3422,7 @@ WmColormapwindowsCmd(
}
wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
if (wmPtr->cmapList != NULL) {
- ckfree((char *)wmPtr->cmapList);
+ ckfree(wmPtr->cmapList);
}
wmPtr->cmapList = cmapList;
wmPtr->cmapCount = windowObjc;
@@ -3526,12 +3462,12 @@ WmCommandCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int cmdArgc;
- CONST char **cmdArgv;
+ const char **cmdArgv;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
@@ -3539,15 +3475,15 @@ WmCommandCmd(
}
if (objc == 3) {
if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv), TCL_DYNAMIC);
+ char *merged = Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv);
+ Tcl_SetResult(interp, merged, TCL_DYNAMIC);
}
return TCL_OK;
}
argv3 = Tcl_GetString(objv[3]);
if (argv3[0] == 0) {
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
wmPtr->cmdArgv = NULL;
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XDeleteProperty(winPtr->display, winPtr->window,
@@ -3560,7 +3496,7 @@ WmCommandCmd(
return TCL_ERROR;
}
if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
+ ckfree(wmPtr->cmdArgv);
}
wmPtr->cmdArgc = cmdArgc;
wmPtr->cmdArgv = cmdArgv;
@@ -3593,7 +3529,7 @@ WmDeiconifyCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -3641,10 +3577,10 @@ WmFocusmodelCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"active", "passive", NULL
};
enum options {
@@ -3692,14 +3628,14 @@ WmFocusmodelCmd(
*/
static int
-WmForgetCmd(tkwin, winPtr, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- TkWindow *winPtr; /* Toplevel or Frame to work with */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+WmForgetCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tk_Window frameWin = (Tk_Window)winPtr;
+ register Tk_Window frameWin = (Tk_Window) winPtr;
if (Tk_IsTopLevel(frameWin)) {
Tk_UnmapWindow(frameWin);
@@ -3714,7 +3650,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv)
/* Already not managed by wm - ignore it */
}
return TCL_OK;
-}
+}
+
/*
*----------------------------------------------------------------------
*
@@ -3738,11 +3675,10 @@ WmFrameCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ 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");
@@ -3755,8 +3691,7 @@ WmFrameCmd(
if (hwnd == NULL) {
hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr));
}
- sprintf(buf, "0x%x", PTR2INT(hwnd));
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", PTR2INT(hwnd)));
return TCL_OK;
}
@@ -3783,21 +3718,19 @@ WmGeometryCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
char xSign, ySign;
int width, height;
- char *argv3;
+ const 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];
- int x, y;
+ if (objc == 3) {
xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
if (wmPtr->gridWin != NULL) {
@@ -3809,17 +3742,17 @@ WmGeometryCmd(
width = winPtr->changes.width;
height = winPtr->changes.height;
}
- if(winPtr->flags & TK_EMBEDDED) {
+ if (winPtr->flags & TK_EMBEDDED) {
int result = SendMessage(wmPtr->wrapper, TK_MOVEWINDOW, -1, -1);
+
wmPtr->x = result >> 16;
wmPtr->y = result & 0x0000ffff;
}
- x = wmPtr->x;
- y = wmPtr->y;
- sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, x, ySign, y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%dx%d%c%d%c%d",
+ width, height, xSign, wmPtr->x, ySign, wmPtr->y));
return TCL_OK;
}
+
argv3 = Tcl_GetString(objv[3]);
if (*argv3 == '\0') {
wmPtr->width = -1;
@@ -3853,7 +3786,7 @@ WmGridCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int reqWidth, reqHeight, widthInc, heightInc;
@@ -3865,12 +3798,9 @@ WmGridCmd(
}
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d %d %d",
+ wmPtr->reqGridWidth, wmPtr->reqGridHeight,
+ wmPtr->widthInc, wmPtr->heightInc));
}
return TCL_OK;
}
@@ -3942,11 +3872,11 @@ WmGroupCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
- char *argv3;
+ const char *argv3;
int length;
if ((objc != 3) && (objc != 4)) {
@@ -3976,8 +3906,8 @@ WmGroupCmd(
}
wmPtr->hints.window_group = Tk_WindowId(tkwin2);
wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) (length + 1));
- strcpy(wmPtr->leaderName, argv3);
+ wmPtr->leaderName = ckalloc(length + 1);
+ memcpy(wmPtr->leaderName, argv3, (unsigned) length + 1);
}
return TCL_OK;
}
@@ -4005,11 +3935,11 @@ WmIconbitmapCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */
- char *string;
+ const char *string;
if ((objc < 3) || (objc > 5)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?-default? ?image?");
@@ -4019,7 +3949,7 @@ WmIconbitmapCmd(
* If we have 5 arguments, we must have a '-default' flag.
*/
- char *argv3 = Tcl_GetString(objv[3]);
+ const char *argv3 = Tcl_GetString(objv[3]);
if (strcmp(argv3, "-default")) {
Tcl_AppendResult(interp, "illegal option \"", argv3,
@@ -4139,7 +4069,7 @@ WmIconifyCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
if (objc != 3) {
@@ -4147,7 +4077,7 @@ WmIconifyCmd(
return TCL_ERROR;
}
if (winPtr->flags & TK_EMBEDDED) {
- if(!SendMessage(wmPtr->wrapper, TK_ICONIFY, 0, 0)) {
+ if (!SendMessage(wmPtr->wrapper, TK_ICONIFY, 0, 0)) {
Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
": the container does not support the request", NULL);
return TCL_ERROR;
@@ -4195,11 +4125,11 @@ WmIconmaskCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Pixmap pixmap;
- char *argv3;
+ const char *argv3;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
@@ -4253,10 +4183,10 @@ WmIconnameCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
if (objc > 4) {
@@ -4270,11 +4200,11 @@ WmIconnameCmd(
return TCL_OK;
} else {
if (wmPtr->iconName != NULL) {
- ckfree((char *) wmPtr->iconName);
+ ckfree(wmPtr->iconName);
}
argv3 = Tcl_GetStringFromObj(objv[3], &length);
- wmPtr->iconName = ckalloc((unsigned) (length + 1));
- strcpy(wmPtr->iconName, argv3);
+ wmPtr->iconName = ckalloc(length + 1);
+ memcpy(wmPtr->iconName, argv3, (unsigned) length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
@@ -4305,14 +4235,14 @@ WmIconphotoCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */
Tk_PhotoHandle photo;
Tk_PhotoImageBlock block;
int i, width, height, idx, bufferSize, startObj = 3;
union {unsigned char *ptr; void *voidPtr;} bgraPixel;
- void *bgraMaskPtr;
+ union {unsigned char *ptr; void *voidPtr;} bgraMask;
BlockOfIconImagesPtr lpIR;
WinIconPtr titlebaricon = NULL;
HICON hIcon;
@@ -4354,7 +4284,7 @@ WmIconphotoCmd(
*/
size = sizeof(BlockOfIconImages) + (sizeof(ICONIMAGE) * (objc-startObj-1));
- lpIR = (BlockOfIconImagesPtr) attemptckalloc(size);
+ lpIR = attemptckalloc(size);
if (lpIR == NULL) {
return TCL_ERROR;
}
@@ -4369,18 +4299,19 @@ WmIconphotoCmd(
/*
* Don't use CreateIcon to create the icon, as it requires color
- * bitmap data in device-dependent format. Instead we use
- * CreateIconIndirect which takes device-independent bitmaps
- * and converts them as required. Initialise icon info structure.
+ * bitmap data in device-dependent format. Instead we use
+ * CreateIconIndirect which takes device-independent bitmaps and
+ * converts them as required. Initialise icon info structure.
*/
-
- ZeroMemory( &iconInfo, sizeof iconInfo );
+
+ ZeroMemory(&iconInfo, sizeof(iconInfo));
iconInfo.fIcon = TRUE;
/*
* Create device-independant color bitmap.
*/
- ZeroMemory(&bmInfo,sizeof bmInfo);
+
+ ZeroMemory(&bmInfo, sizeof bmInfo);
bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmInfo.bmiHeader.biWidth = width;
bmInfo.bmiHeader.biHeight = -height;
@@ -4388,18 +4319,19 @@ WmIconphotoCmd(
bmInfo.bmiHeader.biBitCount = 32;
bmInfo.bmiHeader.biCompression = BI_RGB;
- iconInfo.hbmColor = CreateDIBSection( NULL, &bmInfo,
- DIB_RGB_COLORS, &bgraPixel.voidPtr, NULL, 0 );
- if ( !iconInfo.hbmColor ) {
- ckfree((char *) lpIR);
+ iconInfo.hbmColor = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS,
+ &bgraPixel.voidPtr, NULL, 0);
+ if (!iconInfo.hbmColor) {
+ ckfree(lpIR);
Tcl_AppendResult(interp, "failed to create color bitmap for \"",
Tcl_GetString(objv[i]), "\"", NULL);
- return TCL_ERROR;
+ return TCL_ERROR;
}
/*
* Convert the photo image data into BGRA format (RGBQUAD).
*/
+
bufferSize = height * width * 4;
for (idx = 0 ; idx < bufferSize ; idx += 4) {
bgraPixel.ptr[idx] = block.pixelPtr[idx+2];
@@ -4409,28 +4341,30 @@ WmIconphotoCmd(
}
/*
- * Create a dummy mask bitmap. The contents of this don't
- * appear to matter, as CreateIconIndirect will setup the icon
- * mask based on the alpha channel in our color bitmap.
+ * Create a dummy mask bitmap. The contents of this don't appear to
+ * matter, as CreateIconIndirect will setup the icon mask based on the
+ * alpha channel in our color bitmap.
*/
+
bmInfo.bmiHeader.biBitCount = 1;
- iconInfo.hbmMask = CreateDIBSection( NULL, &bmInfo,
- DIB_RGB_COLORS, &bgraMaskPtr, NULL, 0 );
- if ( !iconInfo.hbmMask ) {
+ iconInfo.hbmMask = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS,
+ &bgraMask.voidPtr, NULL, 0);
+ if (!iconInfo.hbmMask) {
DeleteObject(iconInfo.hbmColor);
- ckfree((char *) lpIR);
+ ckfree(lpIR);
Tcl_AppendResult(interp, "failed to create mask bitmap for \"",
Tcl_GetString(objv[i]), "\"", NULL);
- return TCL_ERROR;
+ return TCL_ERROR;
}
-
- ZeroMemory( bgraMaskPtr, width*height/8 );
-
+
+ ZeroMemory(bgraMask.ptr, width*height/8);
+
/*
* Create an icon from the bitmaps.
*/
- hIcon = CreateIconIndirect( &iconInfo);
+
+ hIcon = CreateIconIndirect(&iconInfo);
DeleteObject(iconInfo.hbmColor);
DeleteObject(iconInfo.hbmMask);
if (hIcon == NULL) {
@@ -4438,7 +4372,7 @@ WmIconphotoCmd(
* XXX should free up created icons.
*/
- ckfree((char *) lpIR);
+ ckfree(lpIR);
Tcl_AppendResult(interp, "failed to create icon for \"",
Tcl_GetString(objv[i]), "\"", NULL);
return TCL_ERROR;
@@ -4449,7 +4383,7 @@ WmIconphotoCmd(
lpIR->IconImages[i-startObj].hIcon = hIcon;
}
- titlebaricon = (WinIconPtr) ckalloc(sizeof(WinIconInstance));
+ titlebaricon = ckalloc(sizeof(WinIconInstance));
titlebaricon->iconBlock = lpIR;
titlebaricon->refCount = 1;
if (WinSetIcon(interp, titlebaricon, (Tk_Window) useWinPtr) != TCL_OK) {
@@ -4486,7 +4420,7 @@ WmIconpositionCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y;
@@ -4497,11 +4431,8 @@ WmIconpositionCmd(
}
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d",
+ wmPtr->hints.icon_x, wmPtr->hints.icon_y));
}
return TCL_OK;
}
@@ -4509,7 +4440,7 @@ WmIconpositionCmd(
wmPtr->hints.flags &= ~IconPositionHint;
} else {
if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
return TCL_ERROR;
}
wmPtr->hints.icon_x = x;
@@ -4542,7 +4473,7 @@ WmIconwindowCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
@@ -4644,14 +4575,14 @@ WmIconwindowCmd(
*/
static int
-WmManageCmd(tkwin, winPtr, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- TkWindow *winPtr; /* Toplevel or Frame to work with */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+WmManageCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- register Tk_Window frameWin = (Tk_Window)winPtr;
+ register Tk_Window frameWin = (Tk_Window) winPtr;
register WmInfo *wmPtr = winPtr->wmInfoPtr;
if (!Tk_IsTopLevel(frameWin)) {
@@ -4702,7 +4633,7 @@ WmMaxsizeCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -4712,11 +4643,8 @@ WmMaxsizeCmd(
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d", width, height));
return TCL_OK;
}
if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
@@ -4752,7 +4680,7 @@ WmMinsizeCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -4762,11 +4690,8 @@ WmMinsizeCmd(
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);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d", width, height));
return TCL_OK;
}
if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
@@ -4802,7 +4727,7 @@ WmOverrideredirectCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int boolean, curValue;
@@ -4812,7 +4737,7 @@ WmOverrideredirectCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
return TCL_ERROR;
}
- if(winPtr->flags & TK_EMBEDDED) {
+ if (winPtr->flags & TK_EMBEDDED) {
curValue = SendMessage(wmPtr->wrapper, TK_OVERRIDEREDIRECT, -1, -1)-1;
if (curValue < 0) {
Tcl_AppendResult(interp,
@@ -4823,14 +4748,14 @@ WmOverrideredirectCmd(
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
}
if (objc == 3) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
return TCL_ERROR;
}
if (curValue != boolean) {
- if(winPtr->flags & TK_EMBEDDED) {
+ if (winPtr->flags & TK_EMBEDDED) {
SendMessage(wmPtr->wrapper, TK_OVERRIDEREDIRECT, boolean, 0);
} else {
/*
@@ -4842,7 +4767,7 @@ WmOverrideredirectCmd(
Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
&atts);
if (!(wmPtr->flags & (WM_NEVER_MAPPED))
- && !(winPtr->flags & TK_EMBEDDED)) {
+ && !(winPtr->flags & TK_EMBEDDED)) {
UpdateWrapper(winPtr);
}
}
@@ -4873,10 +4798,10 @@ WmPositionfromCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL
};
enum options {
@@ -4938,12 +4863,12 @@ WmProtocolCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
register ProtocolHandler *protPtr, *prevPtr;
Atom protocol;
- char *cmd;
+ const char *cmd;
int cmdLength;
if ((objc < 3) || (objc > 5)) {
@@ -4991,13 +4916,13 @@ WmProtocolCmd(
} else {
prevPtr->nextPtr = protPtr->nextPtr;
}
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
break;
}
}
cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr = ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
protPtr->nextPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr;
@@ -5030,7 +4955,7 @@ WmResizableCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int width, height;
@@ -5040,12 +4965,9 @@ WmResizableCmd(
return TCL_ERROR;
}
if (objc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d",
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf("%d %d",
(wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1));
return TCL_OK;
}
if ((Tcl_GetBooleanFromObj(interp, objv[3], &width) != TCL_OK)
@@ -5093,10 +5015,10 @@ WmSizefromCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"program", "user", NULL
};
enum options {
@@ -5159,10 +5081,10 @@ WmStackorderCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
TkWindow **windows, **window_ptr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"isabove", "isbelow", NULL
};
enum options {
@@ -5179,13 +5101,12 @@ WmStackorderCmd(
windows = TkWmStackorderToplevel(winPtr);
if (windows == NULL) {
Tcl_Panic("TkWmStackorderToplevel failed");
- } else {
- for (window_ptr = windows; *window_ptr ; window_ptr++) {
- Tcl_AppendElement(interp, (*window_ptr)->pathName);
- }
- ckfree((char *) windows);
- return TCL_OK;
}
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree(windows);
+ return TCL_OK;
} else {
TkWindow *winPtr2, **winPtr2Ptr = &winPtr2;
int index1=-1, index2=-1, result;
@@ -5219,29 +5140,28 @@ WmStackorderCmd(
*/
windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
-
if (windows == NULL) {
Tcl_AppendResult(interp, "TkWmStackorderToplevel failed", 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) {
- Tcl_Panic("winPtr window not found");
+ }
+
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr) {
+ index1 = (window_ptr - windows);
}
- if (index2 == -1) {
- Tcl_Panic("winPtr2 window not found");
+ if (*window_ptr == winPtr2) {
+ index2 = (window_ptr - windows);
}
-
- ckfree((char *) windows);
+ }
+ if (index1 == -1) {
+ Tcl_Panic("winPtr window not found");
+ }
+ if (index2 == -1) {
+ Tcl_Panic("winPtr2 window not found");
}
+ ckfree(windows);
+
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
&index) != TCL_OK) {
return TCL_ERROR;
@@ -5251,10 +5171,9 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
return TCL_OK;
}
- return TCL_OK;
}
/*
@@ -5280,10 +5199,10 @@ WmStateCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- static CONST char *optionStrings[] = {
+ static const char *const optionStrings[] = {
"normal", "iconic", "withdrawn", "zoomed", NULL
};
enum options {
@@ -5422,10 +5341,10 @@ WmTitleCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- char *argv3;
+ const char *argv3;
int length;
HWND wrapper;
@@ -5434,20 +5353,20 @@ WmTitleCmd(
return TCL_ERROR;
}
- if(winPtr->flags & TK_EMBEDDED) {
- wrapper = (HWND)SendMessage(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0);
+ if (winPtr->flags & TK_EMBEDDED) {
+ wrapper = (HWND) SendMessage(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0);
} else {
wrapper = wmPtr->wrapper;
}
if (objc == 3) {
if (wrapper) {
- char buf[512];
+ TCHAR buf[256];
Tcl_DString titleString;
- int size = tkWinProcs->useWide ? 256 : 512;
+ int size = 256;
- (*tkWinProcs->getWindowText)(wrapper, (LPCTSTR)buf, size);
+ GetWindowText(wrapper, buf, size);
Tcl_WinTCharToUtf(buf, -1, &titleString);
- Tcl_SetResult(interp, Tcl_DStringValue(&titleString),TCL_VOLATILE);
+ Tcl_SetResult(interp, Tcl_DStringValue(&titleString), TCL_VOLATILE);
Tcl_DStringFree(&titleString);
} else {
Tcl_SetResult(interp, (char *)
@@ -5456,17 +5375,17 @@ WmTitleCmd(
}
} else {
if (wmPtr->title != NULL) {
- ckfree((char *) wmPtr->title);
+ ckfree(wmPtr->title);
}
argv3 = Tcl_GetStringFromObj(objv[3], &length);
- wmPtr->title = ckalloc((unsigned) (length + 1));
- strcpy(wmPtr->title, argv3);
+ wmPtr->title = ckalloc(length + 1);
+ memcpy(wmPtr->title, argv3, (unsigned) length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED) && wmPtr->wrapper != NULL) {
Tcl_DString titleString;
+
Tcl_WinUtfToTChar(wmPtr->title, -1, &titleString);
- (*tkWinProcs->setWindowText)(wrapper,
- (LPCTSTR) Tcl_DStringValue(&titleString));
+ SetWindowText(wrapper, (LPCTSTR) Tcl_DStringValue(&titleString));
Tcl_DStringFree(&titleString);
}
}
@@ -5496,7 +5415,7 @@ WmTransientCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
TkWindow *masterPtr = wmPtr->masterPtr, **masterPtrPtr = &masterPtr;
@@ -5522,7 +5441,7 @@ WmTransientCmd(
masterPtr->wmInfoPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) masterPtr,
VisibilityChangeMask|StructureNotifyMask,
- WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+ WmWaitVisibilityOrMapProc, winPtr);
}
wmPtr->masterPtr = NULL;
@@ -5571,21 +5490,21 @@ WmTransientCmd(
wmPtr->masterPtr->wmInfoPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
VisibilityChangeMask|StructureNotifyMask,
- WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+ WmWaitVisibilityOrMapProc, winPtr);
}
masterPtr->wmInfoPtr->numTransients++;
Tk_CreateEventHandler((Tk_Window) masterPtr,
VisibilityChangeMask|StructureNotifyMask,
- WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+ WmWaitVisibilityOrMapProc, winPtr);
wmPtr->masterPtr = masterPtr;
}
}
if (!((wmPtr->flags & WM_NEVER_MAPPED)
&& !(winPtr->flags & TK_EMBEDDED))) {
- if (wmPtr->masterPtr != NULL &&
- !Tk_IsMapped(wmPtr->masterPtr)) {
+ if (wmPtr->masterPtr != NULL
+ && !Tk_IsMapped(wmPtr->masterPtr)) {
TkpWmSetState(winPtr, WithdrawnState);
} else {
UpdateWrapper(winPtr);
@@ -5617,7 +5536,7 @@ WmWithdrawCmd(
TkWindow *winPtr, /* Toplevel to work with */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -5655,7 +5574,7 @@ WmUpdateGeom(
TkWindow *winPtr)
{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -5666,7 +5585,7 @@ WmWaitVisibilityOrMapProc(
ClientData clientData, /* Pointer to window. */
XEvent *eventPtr) /* Information about event. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr;
if (masterPtr == NULL)
@@ -5795,7 +5714,7 @@ Tk_SetGrid(
wmPtr->heightInc = heightInc;
wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -5855,7 +5774,7 @@ Tk_UnsetGrid(
wmPtr->heightInc = 1;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -5883,7 +5802,7 @@ TopLevelEventProc(
ClientData clientData, /* Window for which event occurred. */
XEvent *eventPtr) /* Event that just happened. */
{
- register TkWindow *winPtr = (TkWindow *) clientData;
+ register TkWindow *winPtr = clientData;
if (eventPtr->type == DestroyNotify) {
Tk_ErrorHandler handler;
@@ -5898,7 +5817,7 @@ TopLevelEventProc(
*/
handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ NULL, NULL);
Tk_DestroyWindow((Tk_Window) winPtr);
Tk_DeleteErrorHandler(handler);
}
@@ -5974,7 +5893,7 @@ UpdateGeometryInfo(
int width, height; /* Size of client area. */
int min, max;
RECT rect;
- register TkWindow *winPtr = (TkWindow *) clientData;
+ register TkWindow *winPtr = clientData;
register WmInfo *wmPtr = winPtr->wmInfoPtr;
wmPtr->flags &= ~WM_UPDATE_PENDING;
@@ -6250,7 +6169,7 @@ UpdateGeometryInfo(
static int
ParseGeometry(
Tcl_Interp *interp, /* Used for error reporting. */
- char *string, /* String containing new geometry. Has the
+ const 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. */
@@ -6258,7 +6177,7 @@ ParseGeometry(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, flags;
char *end;
- register char *p = string;
+ register const char *p = string;
/*
* The leading "=" is optional.
@@ -6350,7 +6269,7 @@ ParseGeometry(
wmPtr->flags = flags;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
return TCL_OK;
@@ -6545,9 +6464,9 @@ Tk_MoveToplevelWindow(
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
}
}
@@ -6593,20 +6512,20 @@ TkWmProtocolEventProc(
* the eval.
*/
- CONST char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol);
+ const char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol);
- Tcl_Preserve((ClientData) protPtr);
+ Tcl_Preserve(protPtr);
interp = protPtr->interp;
- Tcl_Preserve((ClientData) interp);
+ Tcl_Preserve(interp);
result = Tcl_GlobalEval(interp, protPtr->command);
if (result != TCL_OK) {
- Tcl_AddErrorInfo(interp, "\n (command for \"");
- Tcl_AddErrorInfo(interp, name);
- Tcl_AddErrorInfo(interp, "\" window manager protocol)");
- Tcl_BackgroundError(interp);
+ Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
+ "\n (command for \"%s\" window manager protocol)",
+ name));
+ Tcl_BackgroundException(interp, result);
}
- Tcl_Release((ClientData) interp);
- Tcl_Release((ClientData) protPtr);
+ Tcl_Release(interp);
+ Tcl_Release(protPtr);
return;
}
}
@@ -6653,7 +6572,7 @@ TkWmStackorderToplevelEnumProc(
hPtr = Tcl_FindHashEntry(pair->table, (char *) hwnd);
if (hPtr != NULL) {
- childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ childWinPtr = Tcl_GetHashValue(hPtr);
/*
* Double check that same HWND does not get passed twice.
@@ -6701,8 +6620,8 @@ TkWmStackorderToplevelWrapperMap(
HWND wrapper;
int newEntry;
- if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
- !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) {
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr)
+ && !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) {
wrapper = TkWinGetWrapperWindow((Tk_Window) winPtr);
/*
@@ -6753,8 +6672,7 @@ TkWmStackorderToplevel(
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
- windows = (TkWindow **) ckalloc((table.numEntries+1)
- * sizeof(TkWindow *));
+ windows = ckalloc((table.numEntries+1) * sizeof(TkWindow *));
/*
* Special cases: If zero or one toplevels were mapped there is no need to
@@ -6767,7 +6685,7 @@ TkWmStackorderToplevel(
goto done;
case 1:
hPtr = Tcl_FirstHashEntry(&table, &search);
- windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[0] = Tcl_GetHashValue(hPtr);
windows[1] = NULL;
goto done;
}
@@ -6784,7 +6702,7 @@ TkWmStackorderToplevel(
if (EnumWindows((WNDENUMPROC) TkWmStackorderToplevelEnumProc,
(LPARAM) &pair) == 0) {
- ckfree((char *) windows);
+ ckfree(windows);
windows = NULL;
} else if (pair.window_ptr != (windows-1)) {
Tcl_Panic("num matched toplevel windows does not equal num children");
@@ -6853,7 +6771,7 @@ TkWmRestackToplevel(
if (winPtr->flags & TK_EMBEDDED) {
SendMessage(winPtr->wmInfoPtr->wrapper, TK_RAISEWINDOW,
- (WPARAM)insertAfter, aboveBelow);
+ (WPARAM) insertAfter, aboveBelow);
} else {
TkWinSetWindowPos(hwnd, insertAfter, aboveBelow);
}
@@ -6932,7 +6850,7 @@ TkWmAddToColormapWindows(
* Automatically add the toplevel itself as the last element of the list.
*/
- newPtr = (TkWindow **) ckalloc((unsigned) ((count+2)*sizeof(TkWindow*)));
+ newPtr = ckalloc((count+2) * sizeof(TkWindow *));
if (count > 0) {
memcpy(newPtr, oldPtr, count * sizeof(TkWindow*));
}
@@ -6942,7 +6860,7 @@ TkWmAddToColormapWindows(
newPtr[count-1] = winPtr;
newPtr[count] = topPtr;
if (oldPtr != NULL) {
- ckfree((char *) oldPtr);
+ ckfree(oldPtr);
}
topPtr->wmInfoPtr->cmapList = newPtr;
@@ -7074,12 +6992,12 @@ TkWinSetMenu(
}
if (!(winPtr->flags & TK_EMBEDDED)) {
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING|WM_MOVE_PENDING;
}
} else {
- SendMessage(wmPtr->wrapper, TK_SETMENU,
- (WPARAM)hMenu, (LPARAM)Tk_GetMenuHWND(tkwin));
+ SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) hMenu,
+ (LPARAM) Tk_GetMenuHWND(tkwin));
}
}
@@ -7159,7 +7077,7 @@ ConfigureTopLevel(
*/
if (!(wmPtr->flags & WM_UPDATE_PENDING)) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
/* fall through */
@@ -7362,7 +7280,7 @@ InstallColormaps(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (winPtr == NULL || (winPtr->flags & TK_ALREADY_DEAD) ) {
+ if (winPtr == NULL || (winPtr->flags & TK_ALREADY_DEAD)) {
return 0;
}
@@ -7392,11 +7310,9 @@ InstallColormaps(
SelectPalette(dc, oldPalette, TRUE);
RealizePalette(dc);
ReleaseDC(hwnd, dc);
- SendMessage(hwnd, WM_PALETTECHANGED, (WPARAM)hwnd,
- (LPARAM)NULL);
+ SendMessage(hwnd, WM_PALETTECHANGED, (WPARAM) hwnd, (LPARAM) NULL);
return TRUE;
}
-
} else {
/*
* Window is being notified of a change in the system palette. If this
@@ -7858,7 +7774,7 @@ WmProc(
break;
case WM_ACTIVATE:
- if ( WA_ACTIVE == LOWORD(wParam) ) {
+ if (WA_ACTIVE == LOWORD(wParam)) {
winPtr = GetTopLevel(hwnd);
if (winPtr && (TkGrabState(winPtr) == TK_GRAB_EXCLUDED)) {
/*
@@ -7871,7 +7787,7 @@ WmProc(
}
}
/* fall through */
-
+
case WM_EXITSIZEMOVE:
if (inMoveSize) {
inMoveSize = 0;
@@ -7935,7 +7851,7 @@ WmProc(
case WM_PALETTECHANGED:
result = InstallColormaps(hwnd, WM_PALETTECHANGED,
- hwnd == (HWND)wParam);
+ hwnd == (HWND) wParam);
goto done;
case WM_QUERYNEWPALETTE:
@@ -7981,8 +7897,7 @@ WmProc(
* 2272]
*/
- result = (*tkWinProcs->defWindowProc)(hwnd, message,
- wParam, lParam);
+ result = DefWindowProc(hwnd, message, wParam, lParam);
goto done;
}
@@ -8040,13 +7955,13 @@ WmProc(
&& (winPtr != winPtr->mainPtr->winPtr)) {
goto done;
}
- if (grab == TK_GRAB_EXCLUDED
+ if (grab == TK_GRAB_EXCLUDED
&& !(SC_MOVE == cmd || SC_SIZE == cmd)) {
goto done;
}
}
/* fall through */
-
+
case WM_INITMENU:
case WM_COMMAND:
case WM_MENUCHAR:
@@ -8056,8 +7971,8 @@ WmProc(
case WM_ENTERIDLE:
case WM_INITMENUPOPUP:
if (winPtr) {
- HWND hMenuHWnd = Tk_GetEmbeddedMenuHWND((Tk_Window)winPtr);
-
+ HWND hMenuHWnd = Tk_GetEmbeddedMenuHWND((Tk_Window) winPtr);
+
if (hMenuHWnd) {
if (SendMessage(hMenuHWnd, message, wParam, lParam)) {
goto done;
@@ -8078,11 +7993,10 @@ WmProc(
result = 0;
} else if (!Tk_TranslateWinEvent(child, message, wParam, lParam,
&result)) {
- result = (*tkWinProcs->defWindowProc)(hwnd, message,
- wParam, lParam);
+ result = DefWindowProc(hwnd, message, wParam, lParam);
}
} else {
- result = (*tkWinProcs->defWindowProc)(hwnd, message, wParam, lParam);
+ result = DefWindowProc(hwnd, message, wParam, lParam);
}
done:
@@ -8128,8 +8042,8 @@ TkpMakeMenuWindow(
if ((atts.override_redirect != Tk_Attributes(tkwin)->override_redirect)
|| (atts.save_under != Tk_Attributes(tkwin)->save_under)) {
- Tk_ChangeWindowAttributes(tkwin,
- CWOverrideRedirect|CWSaveUnder, &atts);
+ Tk_ChangeWindowAttributes(tkwin, CWOverrideRedirect|CWSaveUnder,
+ &atts);
}
}
@@ -8154,8 +8068,9 @@ HWND
TkWinGetWrapperWindow(
Tk_Window tkwin) /* The window we need the wrapper from */
{
- TkWindow *winPtr = (TkWindow *)tkwin;
- return (winPtr->wmInfoPtr->wrapper);
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ return winPtr->wmInfoPtr->wrapper;
}
/*
@@ -8231,8 +8146,8 @@ TkpGetWrapperWindow(
static void
GenerateActivateEvent(TkWindow * winPtr, const int *flagPtr)
{
- ActivateEvent *eventPtr;
- eventPtr = (ActivateEvent *)ckalloc(sizeof(ActivateEvent));
+ ActivateEvent *eventPtr = ckalloc(sizeof(ActivateEvent));
+
eventPtr->ev.proc = ActivateWindow;
eventPtr->winPtr = winPtr;
eventPtr->flagPtr = flagPtr;
@@ -8365,6 +8280,7 @@ TkpWinToplevelWithDraw(
TkWindow *winPtr)
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
wmPtr->flags |= WM_WITHDRAWN;
TkpWmSetState(winPtr, WithdrawnState);
}
@@ -8424,10 +8340,10 @@ TkpWinToplevelDeiconify(
* 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 ((wmPtr->flags & WM_UPDATE_PENDING)
+ && !(wmPtr->flags & WM_NEVER_MAPPED)) {
+ Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr);
+ UpdateGeometryInfo(winPtr);
}
/*
@@ -8484,11 +8400,10 @@ TkpWinToplevelIsControlledByWm(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- if (wmPtr) {
- return ((wmPtr->width != -1) && (wmPtr->height != -1))? 1:0;
- } else {
+ if (!wmPtr) {
return 0;
}
+ return ((wmPtr->width != -1) && (wmPtr->height != -1)) ? 1 : 0;
}
/*
@@ -8516,7 +8431,7 @@ TkpWinToplevelMove(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
if (wmPtr && x >= 0 && y >= 0 && !TkpWinToplevelIsControlledByWm(winPtr)) {
- Tk_MoveToplevelWindow((Tk_Window)winPtr, x, y);
+ Tk_MoveToplevelWindow((Tk_Window) winPtr, x, y);
}
return ((winPtr->changes.x << 16) & 0xffff0000)
| (winPtr->changes.y & 0xffff);
@@ -8548,7 +8463,9 @@ TkpWinToplevelOverrideRedirect(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
- if(reqValue < 0) return curValue;
+ if (reqValue < 0) {
+ return curValue;
+ }
if (curValue != reqValue) {
XSetWindowAttributes atts;
@@ -8614,8 +8531,7 @@ TkpWinToplevelDetachWindow(
*
* RemapWindows
*
- * Adjust parent/child relation ships of
- * the given window hierarchy.
+ * Adjust parent/child relation ships of the given window hierarchy.
*
* Results:
* none
@@ -8626,15 +8542,18 @@ TkpWinToplevelDetachWindow(
*----------------------------------------------------------------------
*/
-static void
-RemapWindows(winPtr, parentHWND)
- TkWindow *winPtr;
- HWND parentHWND;
+static void
+RemapWindows(
+ TkWindow *winPtr,
+ HWND parentHWND)
{
TkWindow *childPtr;
const char *className = Tk_Class(winPtr);
- /* Skip Menus as they are handled differently */
+ /*
+ * Skip menus as they are handled differently.
+ */
+
if (className != NULL && strcmp(className, "Menu") == 0) {
return;
}
@@ -8642,9 +8561,12 @@ RemapWindows(winPtr, parentHWND)
SetParent(Tk_GetHWND(winPtr->window), parentHWND);
}
- /* Repeat for all the children */
+ /*
+ * Repeat for all the children.
+ */
+
for (childPtr = winPtr->childList; childPtr != NULL;
- childPtr = childPtr->nextPtr) {
+ childPtr = childPtr->nextPtr) {
RemapWindows(childPtr,
winPtr->window ? Tk_GetHWND(winPtr->window) : NULL);
}
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 2d5f5f5..3a02d05 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -11,14 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-/*
- * Make sure the SendInput API is available (NT SP 3):
- */
-#if (_WIN32_WINNT <= 0x0400)
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0403
-#endif
-
#include "tkWinInt.h"
/*
@@ -28,7 +20,7 @@
*/
#ifndef _WIN32_IE
-#define _WIN32_IE 0x0501 /* IE 5 */
+#define _WIN32_IE 0x0550 /* IE 5.5 */
#endif
#include <commctrl.h>
@@ -61,49 +53,11 @@
#define UNICODE_NOCHAR 0xFFFF
#endif
-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,
- (BOOL (WINAPI *)(HMENU hMenu, UINT uPosition, UINT uFlags,
- UINT uIDNewItem, LPCTSTR lpNewItem)) InsertMenuA,
- (int (WINAPI *)(HWND hWnd, LPCTSTR lpString, int nMaxCount)) GetWindowTextA,
-};
-
-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,
- (BOOL (WINAPI *)(HMENU hMenu, UINT uPosition, UINT uFlags,
- UINT uIDNewItem, LPCTSTR lpNewItem)) InsertMenuW,
- (int (WINAPI *)(HWND hWnd, LPCTSTR lpString, int nMaxCount)) GetWindowTextW,
-};
-
-TkWinProcs *tkWinProcs;
-
/*
* Declarations of static variables used in this file.
*/
-static char winScreenName[] = ":0"; /* Default name of windows display. */
+static const char winScreenName[] = ":0"; /* Default name of windows display. */
static HINSTANCE tkInstance = NULL; /* Application instance handle. */
static int childClassInitialized; /* Registered child class? */
static WNDCLASS childClass; /* Window class for child windows. */
@@ -266,12 +220,6 @@ TkWinXInit(
Tcl_Panic("Unable to load common controls?!");
}
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
- tkWinProcs = &unicodeProcs;
- } else {
- tkWinProcs = &asciiProcs;
- }
-
childClass.style = CS_HREDRAW | CS_VREDRAW;
childClass.cbClsExtra = 0;
childClass.cbWndExtra = 0;
@@ -364,9 +312,10 @@ TkWinXCleanup(
*
* Results:
* The return value is one of:
- * VER_PLATFORM_WIN32s Win32s on Windows 3.1.
- * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95.
- * VER_PLATFORM_WIN32_NT Win32 on Windows NT
+ * VER_PLATFORM_WIN32s Win32s on Windows 3.1 (not supported)
+ * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95, 98, ME (not supported)
+ * VER_PLATFORM_WIN32_NT Win32 on Windows NT, 2000, XP
+ * VER_PLATFORM_WIN32_CE Win32 on Windows CE
*
* Side effects:
* None.
@@ -393,8 +342,8 @@ TkWinGetPlatformId(void)
if ((os.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
(os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) {
HKEY hKey;
- LPCSTR szSubKey = TEXT("Control Panel\\Appearance");
- LPCSTR szCurrent = TEXT("Current");
+ LPCTSTR szSubKey = TEXT("Control Panel\\Appearance");
+ LPCTSTR szCurrent = TEXT("Current");
DWORD dwSize = 200;
char pBuffer[200];
@@ -462,10 +411,10 @@ TkWinGetPlatformTheme(void)
*----------------------------------------------------------------------
*/
-CONST char *
+const char *
TkGetDefaultScreenName(
Tcl_Interp *interp, /* Not used. */
- CONST char *screenName) /* If NULL, use default string. */
+ const char *screenName) /* If NULL, use default string. */
{
if ((screenName == NULL) || (screenName[0] == '\0')) {
screenName = winScreenName;
@@ -523,9 +472,9 @@ TkWinDisplayChanged(
screen->root_depth = GetDeviceCaps(dc, BITSPIXEL) * PTR2INT(screen->ext_data);
if (screen->root_visual != NULL) {
- ckfree((char *) screen->root_visual);
+ ckfree(screen->root_visual);
}
- screen->root_visual = (Visual *) ckalloc(sizeof(Visual));
+ screen->root_visual = ckalloc(sizeof(Visual));
screen->root_visual->visualid = 0;
if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) {
screen->root_visual->map_entries = GetDeviceCaps(dc, SIZEPALETTE);
@@ -587,12 +536,12 @@ TkWinDisplayChanged(
TkDisplay *
TkpOpenDisplay(
- CONST char *display_name)
+ const char *display_name)
{
Screen *screen;
TkWinDrawable *twdPtr;
Display *display;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->winDisplay != NULL) {
@@ -603,10 +552,10 @@ TkpOpenDisplay(
}
}
- display = (Display *) ckalloc(sizeof(Display));
+ display = ckalloc(sizeof(Display));
ZeroMemory(display, sizeof(Display));
- display->display_name = (char *) ckalloc(strlen(display_name)+1);
+ display->display_name = ckalloc(strlen(display_name) + 1);
strcpy(display->display_name, display_name);
display->cursor_font = 1;
@@ -614,7 +563,7 @@ TkpOpenDisplay(
display->request = 1;
display->qlen = 0;
- screen = (Screen *) ckalloc(sizeof(Screen));
+ screen = ckalloc(sizeof(Screen));
ZeroMemory(screen, sizeof(Screen));
screen->display = display;
@@ -622,7 +571,7 @@ TkpOpenDisplay(
* Set up the root window.
*/
- twdPtr = (TkWinDrawable*) ckalloc(sizeof(TkWinDrawable));
+ twdPtr = ckalloc(sizeof(TkWinDrawable));
if (twdPtr == NULL) {
return None;
}
@@ -645,7 +594,7 @@ TkpOpenDisplay(
TkWinDisplayChanged(display);
- tsdPtr->winDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ tsdPtr->winDisplay = ckalloc(sizeof(TkDisplay));
ZeroMemory(tsdPtr->winDisplay, sizeof(TkDisplay));
tsdPtr->winDisplay->display = display;
tsdPtr->updatingClipboard = FALSE;
@@ -690,17 +639,17 @@ TkpCloseDisplay(
}
if (display->screens != NULL) {
if (display->screens->root_visual != NULL) {
- ckfree((char *) display->screens->root_visual);
+ ckfree(display->screens->root_visual);
}
if (display->screens->root != None) {
- ckfree((char *) display->screens->root);
+ ckfree(display->screens->root);
}
if (display->screens->cmap != None) {
XFreeColormap(display, display->screens->cmap);
}
- ckfree((char *) display->screens);
+ ckfree(display->screens);
}
- ckfree((char *) display);
+ ckfree(display);
}
/*
@@ -1004,7 +953,23 @@ GenerateXEvent(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd);
+ if (message == WM_MOUSEWHEEL) {
+ union {LPARAM lParam; POINTS point;} root;
+ POINT pos;
+ root.lParam = lParam;
+
+ /*
+ * Redirect mousewheel events to the window containing the cursor.
+ * That feels much less strange to users, and is how all the other
+ * platforms work.
+ */
+
+ pos.x = root.point.x;
+ pos.y = root.point.y;
+ hwnd = WindowFromPoint(pos);
+ }
+
+ winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd);
if (!winPtr || winPtr->window == None) {
return;
}
@@ -1103,11 +1068,6 @@ GenerateXEvent(
break;
case WM_MOUSEWHEEL:
- /*
- * The mouse wheel event is closer to a key event than a mouse event
- * in that the message is sent to the window that has focus.
- */
-
case WM_CHAR:
case WM_UNICHAR:
case WM_SYSKEYDOWN:
@@ -1386,12 +1346,12 @@ GetTranslatedKey(
xkey->nbytes = 0;
while ((xkey->nbytes < XMaxTransChars)
- && PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
+ && PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE)) {
if ((msg.message != WM_CHAR) && (msg.message != WM_SYSCHAR)) {
break;
}
- GetMessage(&msg, NULL, 0, 0);
+ GetMessageA(&msg, NULL, 0, 0);
/*
* If this is a normal character message, we may need to strip off the
@@ -1562,7 +1522,6 @@ HandleIMEComposition(
{
HIMC hIMC;
int n;
- BOOL isWinNT = (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT);
if ((lParam & GCS_RESULTSTR) == 0) {
/*
@@ -1577,47 +1536,15 @@ HandleIMEComposition(
return 0;
}
- if (isWinNT) {
- n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
- } else {
- n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, NULL, 0);
- }
+ n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0);
if (n > 0) {
- char *buff = ckalloc((unsigned) n);
+ char *buff = ckalloc(n);
TkWindow *winPtr;
XEvent event;
int i;
- if (isWinNT) {
- n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff,
- (unsigned) n);
- } else {
- Tcl_DString utfString, unicodeString;
- Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
-
- n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, buff,
- (unsigned) 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((unsigned) i);
- }
- n = i;
- memcpy(buff, Tcl_DStringValue(&unicodeString), (unsigned) n);
- Tcl_DStringFree(&utfString);
- Tcl_DStringFree(&unicodeString);
- }
+ n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, buff, (unsigned) n);
/*
* Set up the fields pertinent to key event.
@@ -1930,32 +1857,10 @@ long
Tk_GetUserInactiveTime(
Display *dpy) /* Ignored on Windows */
{
- struct tagLASTINPUTINFO {
- UINT cbSize;
- DWORD dwTime;
- } li;
+ LASTINPUTINFO li;
- /*
- * Multiple settings of either of these variables should be OK; any thread
- * hazards should just cause inefficiency...
- */
-
- static FARPROC pfnGetLastInputInfo = NULL;
- static int initinfo = 0;
-
- if (!initinfo) {
- HMODULE hMod = GetModuleHandleA("USER32.DLL");
-
- initinfo = 1;
- if (hMod){
- pfnGetLastInputInfo = GetProcAddress(hMod, "GetLastInputInfo");
- }
- }
- if (pfnGetLastInputInfo == NULL) {
- return -1;
- }
li.cbSize = sizeof(li);
- if (!(BOOL)(pfnGetLastInputInfo)(&li)) {
+ if (!(BOOL)GetLastInputInfo(&li)) {
return -1;
}
diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c
index 25c9c0c..04baa16 100644
--- a/win/ttkWinMonitor.c
+++ b/win/ttkWinMonitor.c
@@ -92,7 +92,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp)
hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hinst, NULL );
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)interp);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) interp);
ShowWindow(hwnd, SW_HIDE);
UpdateWindow(hwnd);
}
diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c
index e0a0eda..63e9704 100644
--- a/win/ttkWinTheme.c
+++ b/win/ttkWinTheme.c
@@ -490,7 +490,7 @@ static void TroughClientDataDeleteProc(void *clientData)
static TroughClientData *TroughClientDataInit(Tcl_Interp *interp)
{
- TroughClientData *cd = (TroughClientData*)ckalloc(sizeof(*cd));
+ TroughClientData *cd = ckalloc(sizeof(*cd));
cd->PatternBitmap = CreateBitmap(8, 8, 1, 1, Pattern);
cd->PatternBrush = CreatePatternBrush(cd->PatternBitmap);
Ttk_RegisterCleanup(interp, cd, TroughClientDataDeleteProc);
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index e2f916f..af6103b 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -106,7 +106,7 @@ LoadXPThemeProcs(HINSTANCE *phlib)
* We have successfully loaded the library. Proceed in storing the
* addresses of the functions we want to use.
*/
- XPThemeProcs *procs = (XPThemeProcs*)ckalloc(sizeof(XPThemeProcs));
+ XPThemeProcs *procs = ckalloc(sizeof(XPThemeProcs));
#define LOADPROC(name) \
(0 != (procs->name = (name ## Proc *)GetProcAddress(handle, #name) ))
@@ -124,7 +124,7 @@ LoadXPThemeProcs(HINSTANCE *phlib)
return procs;
}
#undef LOADPROC
- ckfree((char*)procs);
+ ckfree(procs);
}
return 0;
}
@@ -411,7 +411,7 @@ typedef struct
static ElementData *
NewElementData(XPThemeProcs *procs, ElementInfo *info)
{
- ElementData *elementData = (ElementData*)ckalloc(sizeof(ElementData));
+ ElementData *elementData = ckalloc(sizeof(ElementData));
elementData->procs = procs;
elementData->info = info;
@@ -429,10 +429,10 @@ static void DestroyElementData(void *clientData)
{
ElementData *elementData = clientData;
if (elementData->info->flags & HEAP_ELEMENT) {
- ckfree((char *)elementData->info->statemap);
- ckfree((char *)elementData->info->className);
- ckfree((char *)elementData->info->elementName);
- ckfree((char *)elementData->info);
+ ckfree(elementData->info->statemap);
+ ckfree(elementData->info->className);
+ ckfree(elementData->info->elementName);
+ ckfree(elementData->info);
}
ckfree(clientData);
}
@@ -1197,8 +1197,7 @@ Ttk_CreateVsapiElement(
if (Tcl_ListObjGetElements(interp, objv[2], &count, &specs) != TCL_OK)
return TCL_ERROR;
/* we over-allocate to ensure there is a terminating entry */
- stateTable = (Ttk_StateTable *)
- ckalloc(sizeof(Ttk_StateTable) * (count + 1));
+ stateTable = ckalloc(sizeof(Ttk_StateTable) * (count + 1));
memset(stateTable, 0, sizeof(Ttk_StateTable) * (count + 1));
for (n = 0, j = 0; status == TCL_OK && n < count; n += 2, ++j) {
Ttk_StateSpec spec = {0,0};
@@ -1211,15 +1210,15 @@ Ttk_CreateVsapiElement(
}
}
if (status != TCL_OK) {
- ckfree((char *)stateTable);
+ ckfree(stateTable);
return status;
}
} else {
- stateTable = (Ttk_StateTable *)ckalloc(sizeof(Ttk_StateTable));
+ stateTable = ckalloc(sizeof(Ttk_StateTable));
memset(stateTable, 0, sizeof(Ttk_StateTable));
}
- elementPtr = (ElementInfo *)ckalloc(sizeof(ElementInfo));
+ elementPtr = ckalloc(sizeof(ElementInfo));
elementPtr->elementSpec = elementSpec;
elementPtr->partId = partId;
elementPtr->statemap = stateTable;
@@ -1232,7 +1231,7 @@ Ttk_CreateVsapiElement(
elementPtr->elementName = name;
/* set the class name to an allocated copy */
- wname = (LPWSTR) ckalloc(sizeof(WCHAR) * (length + 1));
+ wname = ckalloc(sizeof(WCHAR) * (length + 1));
wcscpy(wname, className);
elementPtr->className = wname;
@@ -1279,7 +1278,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd)
* Set theme data and cleanup proc
*/
- themeData = (XPThemeData *)ckalloc(sizeof(XPThemeData));
+ themeData = ckalloc(sizeof(XPThemeData));
themeData->procs = procs;
themeData->hlibrary = hlibrary;
diff --git a/win/winMain.c b/win/winMain.c
index 2883ad7..a182e3c 100644
--- a/win/winMain.c
+++ b/win/winMain.c
@@ -1,26 +1,25 @@
/*
* winMain.c --
*
- * Main entry point for wish and other Tk-based applications.
+ * Provides a default version of the main program and Tcl_AppInit
+ * procedure for wish and other Tk-based applications.
*
- * Copyright (c) 1995-1997 Sun Microsystems, Inc.
- * Copyright (c) 1998-1999 by Scriptics Corporation.
+ * Copyright (c) 1993 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998-1999 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkInt.h"
+#include "tk.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <locale.h>
+#include <stdlib.h>
+#include <tchar.h>
-
-/*
- * The following declarations refer to internal Tk routines. These interfaces
- * are available for use, but are not supported.
- */
#ifdef TK_TEST
extern Tcl_PackageInitProc Tktest_Init;
#endif /* TK_TEST */
@@ -31,16 +30,14 @@ extern Tcl_PackageInitProc Dde_Init;
extern Tcl_PackageInitProc Dde_SafeInit;
#endif
+#ifdef TCL_BROKEN_MAINARGS
+static void setargv(int *argcPtr, TCHAR ***argvPtr);
+#endif
+
/*
* Forward declarations for procedures defined later in this file:
*/
-static void WishPanic(CONST char *format, ...);
-
-#if defined(__CYGWIN__)
-static void setargv(int *argcPtr, char ***argvPtr);
-#endif /* __CYGWIN__ */
-
static BOOL consoleRequired = TRUE;
/*
@@ -61,13 +58,13 @@ extern int TK_LOCAL_APPINIT(Tcl_Interp *interp);
*/
#ifdef TK_LOCAL_MAIN_HOOK
-extern int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
+extern int TK_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv);
#endif
/*
*----------------------------------------------------------------------
*
- * WinMain --
+ * _tWinMain --
*
* Main entry point from Windows.
*
@@ -81,17 +78,23 @@ extern int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
*/
int APIENTRY
+#ifdef TCL_BROKEN_MAINARGS
WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow)
+#else
+_tWinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpszCmdLine,
+ int nCmdShow)
+#endif
{
- char **argv;
+ TCHAR **argv;
int argc;
- char *p;
-
- Tcl_SetPanicProc(WishPanic);
+ TCHAR *p;
/*
* Create the console channels and install them as the standard channels.
@@ -112,20 +115,20 @@ WinMain(
* Get our args from the c-runtime. Ignore lpszCmdLine.
*/
-#if defined(__CYGWIN__)
+#if defined(TCL_BROKEN_MAINARGS)
setargv(&argc, &argv);
#else
argc = __argc;
- argv = __argv;
+ argv = __targv;
#endif
/*
* Forward slashes substituted for backslashes.
*/
- for (p = argv[0]; *p != '\0'; p++) {
- if (*p == '\\') {
- *p = '/';
+ for (p = argv[0]; *p != TEXT('\0'); p++) {
+ if (*p == TEXT('\\')) {
+ *p = TEXT('/');
}
}
@@ -134,7 +137,7 @@ WinMain(
#endif
Tk_Main(argc, argv, TK_LOCAL_APPINIT);
- return 1;
+ return 0; /* Needed only to prevent compiler warning. */
}
/*
@@ -160,14 +163,11 @@ int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
-#define TK_MAX_WARN_LEN 1024
- WCHAR msgString[TK_MAX_WARN_LEN + 5];
-
- if (Tcl_Init(interp) == TCL_ERROR) {
- goto error;
+ if ((Tcl_Init)(interp) == TCL_ERROR) {
+ return TCL_ERROR;
}
if (Tk_Init(interp) == TCL_ERROR) {
- goto error;
+ return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
@@ -178,26 +178,26 @@ Tcl_AppInit(
if (consoleRequired) {
if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
- goto error;
+ return TCL_ERROR;
}
}
#if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES
if (Registry_Init(interp) == TCL_ERROR) {
- goto error;
+ return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "registry", Registry_Init, NULL);
+ Tcl_StaticPackage(interp, "registry", Registry_Init, 0);
if (Dde_Init(interp) == TCL_ERROR) {
- goto error;
+ return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "dde", Dde_Init, NULL);
+ Tcl_StaticPackage(interp, "dde", Dde_Init, Dde_SafeInit);
#endif
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
- goto error;
+ return TCL_ERROR;
}
- Tcl_StaticPackage(interp, "Tktest", Tktest_Init, NULL);
+ Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0);
#endif /* TK_TEST */
/*
@@ -224,76 +224,15 @@ Tcl_AppInit(
* specific startup file will be run under any conditions.
*/
- Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
+ (Tcl_SetVar)(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
return TCL_OK;
-
-error:
- MultiByteToWideChar(CP_UTF8, 0, Tcl_GetStringResult(interp), -1,
- msgString, TK_MAX_WARN_LEN);
- /*
- * Truncate MessageBox string if it is too long to not overflow the screen
- * and cause possible oversized window error.
- */
- memcpy(msgString + TK_MAX_WARN_LEN, L" ...", 5 * sizeof(WCHAR));
- MessageBeep(MB_ICONEXCLAMATION);
- MessageBoxW(NULL, msgString, L"Error in Wish",
- MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
- ExitProcess(1);
-
- /*
- * We won't reach this, but we need the return.
- */
-
- return TCL_ERROR;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * WishPanic --
- *
- * Display a message and exit.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Exits the program.
- *
- *----------------------------------------------------------------------
- */
-
-void
-WishPanic(
- CONST char *format, ...)
-{
- va_list argList;
- char buf[TK_MAX_WARN_LEN];
- WCHAR msgString[TK_MAX_WARN_LEN + 5];
-
- va_start(argList, format);
- vsprintf(buf, format, argList);
-
- MultiByteToWideChar(CP_UTF8, 0, buf, -1, msgString, TK_MAX_WARN_LEN);
- /*
- * Truncate MessageBox string if it is too long to not overflow the screen
- * and cause possible oversized window error.
- */
- memcpy(msgString + TK_MAX_WARN_LEN, L" ...", 5 * sizeof(WCHAR));
- MessageBeep(MB_ICONEXCLAMATION);
- MessageBoxW(NULL, msgString, L"Fatal Error in Wish",
- MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
-#ifdef _MSC_VER
- DebugBreak();
-#endif
- ExitProcess(1);
}
-#if !defined(__GNUC__) || defined(TK_TEST)
+#if defined(__CYGWIN__) || defined(TK_TEST)
/*
*----------------------------------------------------------------------
*
- * main --
+ * _tmain --
*
* Main entry point from the console.
*
@@ -307,13 +246,20 @@ WishPanic(
*----------------------------------------------------------------------
*/
+#ifdef TCL_BROKEN_MAINARGS
int
main(
int argc,
- char **argv)
+ char **dummy)
{
- Tcl_SetPanicProc(WishPanic);
-
+ TCHAR **argv;
+#else
+int
+_tmain(
+ int argc,
+ TCHAR **argv)
+{
+#endif
/*
* Set up the default locale to be standard "C" locale so parsing is
* performed correctly.
@@ -321,6 +267,13 @@ main(
setlocale(LC_ALL, "C");
+#ifdef TCL_BROKEN_MAINARGS
+ /*
+ * Get our args from the c-runtime. Ignore argc/argv.
+ */
+
+ setargv(&argc, &argv);
+#endif
/*
* Console emulation widget not required as this entry is from the
* console subsystem, thus stdin,out,err already have end-points.
@@ -328,6 +281,10 @@ main(
consoleRequired = FALSE;
+#ifdef TK_LOCAL_MAIN_HOOK
+ TK_LOCAL_MAIN_HOOK(&argc, &argv);
+#endif
+
Tk_Main(argc, argv, Tcl_AppInit);
return 0;
}
@@ -361,17 +318,17 @@ main(
*--------------------------------------------------------------------------
*/
-#if defined(__CYGWIN__)
+#ifdef TCL_BROKEN_MAINARGS
static void
setargv(
int *argcPtr, /* Filled with number of argument strings. */
- char ***argvPtr) /* Filled with argument strings (malloc'd). */
+ TCHAR ***argvPtr) /* Filled with argument strings (malloc'd). */
{
- char *cmdLine, *p, *arg, *argSpace;
- char **argv;
+ TCHAR *cmdLine, *p, *arg, *argSpace;
+ TCHAR **argv;
int argc, size, inquote, copy, slashes;
- cmdLine = GetCommandLine(); /* INTL: BUG */
+ cmdLine = GetCommandLine();
/*
* Precompute an overly pessimistic guess at the number of arguments in
@@ -379,30 +336,35 @@ setargv(
*/
size = 2;
- for (p = cmdLine; *p != '\0'; p++) {
- if ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
+ for (p = cmdLine; *p != TEXT('\0'); p++) {
+ if ((*p == TEXT(' ')) || (*p == TEXT('\t'))) { /* INTL: ISO space. */
size++;
- while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
+ while ((*p == TEXT(' ')) || (*p == TEXT('\t'))) { /* INTL: ISO space. */
p++;
}
- if (*p == '\0') {
+ if (*p == TEXT('\0')) {
break;
}
}
}
- argSpace = (char *) ckalloc(
- (unsigned) (size * sizeof(char *) + strlen(cmdLine) + 1));
- argv = (char **) argSpace;
- argSpace += size * sizeof(char *);
+
+ /* Make sure we don't call ckalloc through the (not yet initialized) stub table */
+ #undef Tcl_Alloc
+ #undef Tcl_DbCkalloc
+
+ argSpace = ckalloc(size*sizeof(char *)
+ + (_tcslen(cmdLine)+1) * sizeof(TCHAR));
+ argv = (TCHAR **) argSpace;
+ argSpace += size * (sizeof(char *)/sizeof(TCHAR));
size--;
p = cmdLine;
for (argc = 0; argc < size; argc++) {
argv[argc] = arg = argSpace;
- while ((*p == ' ') || (*p == '\t')) { /* INTL: ISO space. */
+ while ((*p == TEXT(' ')) || (*p == TEXT('\t'))) { /* INTL: ISO space. */
p++;
}
- if (*p == '\0') {
+ if (*p == TEXT('\0')) {
break;
}
@@ -410,14 +372,14 @@ setargv(
slashes = 0;
while (1) {
copy = 1;
- while (*p == '\\') {
+ while (*p == TEXT('\\')) {
slashes++;
p++;
}
- if (*p == '"') {
+ if (*p == TEXT('"')) {
if ((slashes & 1) == 0) {
copy = 0;
- if ((inquote) && (p[1] == '"')) {
+ if ((inquote) && (p[1] == TEXT('"'))) {
p++;
copy = 1;
} else {
@@ -428,13 +390,13 @@ setargv(
}
while (slashes) {
- *arg = '\\';
+ *arg = TEXT('\\');
arg++;
slashes--;
}
- if ((*p == '\0') || (!inquote &&
- ((*p == ' ') || (*p == '\t')))) { /* INTL: ISO space. */
+ if ((*p == TEXT('\0')) || (!inquote &&
+ ((*p == TEXT(' ')) || (*p == TEXT('\t'))))) { /* INTL: ISO space. */
break;
}
if (copy != 0) {
@@ -446,13 +408,13 @@ setargv(
*arg = '\0';
argSpace = arg + 1;
}
- argv[argc] = NULL;
+ argv[argc] = 0;
*argcPtr = argc;
*argvPtr = argv;
}
-#endif /* __CYGWIN__ */
-
+#endif /* TCL_BROKEN_MAINARGS */
+
/*
* Local Variables:
* mode: c
diff --git a/xlib/xcolors.c b/xlib/xcolors.c
index ad33b7b..be9e479 100644
--- a/xlib/xcolors.c
+++ b/xlib/xcolors.c
@@ -10,7 +10,7 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <tkInt.h>
+#include "tkInt.h"
/*
* This value will be set to the number of colors in the color table
@@ -32,11 +32,11 @@ static int FindColor(const char *name, XColor *colorPtr);
*/
typedef struct {
- char *name;
+ const char *name;
unsigned char red, green, blue;
} XColorEntry;
-static XColorEntry xColors[] = {
+static const XColorEntry xColors[] = {
{ "alice blue", 240, 248, 255 },
{ "AliceBlue", 240, 248, 255 },
{ "antique white", 250, 235, 215 },
@@ -823,7 +823,7 @@ FindColor(
*/
if (numXColors == 0) {
- XColorEntry *ePtr;
+ const XColorEntry *ePtr;
for (ePtr = xColors; ePtr->name != NULL; ePtr++) {
numXColors++;
}
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 9fa8c4a..61602e2 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -5,23 +5,28 @@
* contexts.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
- * Copyright (c) 2002-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2002-2009 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright 2008-2009, Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <tkInt.h>
+#include "tkInt.h"
#if !defined(MAC_OSX_TK)
# include <X11/Xlib.h>
-#endif
-#ifdef MAC_OSX_TK
+# define gcCacheSize 0
+# define TkpInitGCCache(gc)
+# define TkpFreeGCCache(gc)
+# define TkpGetGCCache(gc)
+#else
# include <tkMacOSXInt.h>
# include <X11/Xlib.h>
# include <X11/X.h>
# define Cursor XCursor
# define Region XRegion
+# define gcCacheSize sizeof(TkpGCCache)
#endif
@@ -45,7 +50,7 @@ static TkpClipMask *AllocClipMask(GC gc) {
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
if (clip_mask == None) {
- clip_mask = (TkpClipMask*) ckalloc(sizeof(TkpClipMask));
+ clip_mask = ckalloc(sizeof(TkpClipMask));
gc->clip_mask = (Pixmap) clip_mask;
#ifdef MAC_OSX_TK
} else if (clip_mask->type == TKP_CLIP_REGION) {
@@ -78,7 +83,7 @@ static void FreeClipMask(GC gc) {
TkpReleaseRegion(((TkpClipMask*) gc->clip_mask)->value.region);
}
#endif
- ckfree((char*) gc->clip_mask);
+ ckfree(gc->clip_mask);
gc->clip_mask = None;
}
}
@@ -117,7 +122,7 @@ XCreateGC(
#define MAX_DASH_LIST_SIZE 10
- gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE);
+ gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
if (!gp) {
return None;
}
@@ -158,10 +163,33 @@ XCreateGC(
clip_mask->type = TKP_CLIP_PIXMAP;
clip_mask->value.pixmap = values->clip_mask;
}
+ TkpInitGCCache(gp);
return gp;
}
+#ifdef MAC_OSX_TK
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetGCCache --
+ *
+ * Results:
+ * Pointer to the TkpGCCache at the end of the GC.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkpGCCache*
+TkpGetGCCache(GC gc) {
+ return (gc ? (TkpGCCache*)(((char*) gc) + sizeof(XGCValues) +
+ MAX_DASH_LIST_SIZE) : NULL);
+}
+#endif
+
/*
*----------------------------------------------------------------------
*
@@ -240,7 +268,8 @@ void XFreeGC(
{
if (gc != None) {
FreeClipMask(gc);
- ckfree((char *) gc);
+ TkpFreeGCCache(gc);
+ ckfree(gc);
}
}
diff --git a/xlib/xutil.c b/xlib/xutil.c
index 267a624..0514d7a 100644
--- a/xlib/xutil.c
+++ b/xlib/xutil.c
@@ -68,7 +68,8 @@ XGetVisualInfo(
XVisualInfo *vinfo_template,
int *nitems_return)
{
- XVisualInfo *info = (XVisualInfo *) ckalloc(sizeof(XVisualInfo));
+ XVisualInfo *info = ckalloc(sizeof(XVisualInfo));
+
info->visual = DefaultVisual(display, 0);
info->visualid = info->visual->visualid;
info->screen = 0;
@@ -99,7 +100,7 @@ XGetVisualInfo(
|| ((vinfo_mask & VisualBlueMaskMask)
&& (vinfo_template->blue_mask != info->blue_mask))
) {
- ckfree((char *) info);
+ ckfree(info);
return NULL;
}